Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(683)

Side by Side Diff: media/gpu/ipc/service/media_gpu_channel.cc

Issue 2427053002: Move video encode accelerator IPC messages to GPU IO thread (Closed)
Patch Set: posciak@ comments. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/gpu/ipc/service/media_gpu_channel.h" 5 #include "media/gpu/ipc/service/media_gpu_channel.h"
6 6
7 #include "base/unguessable_token.h" 7 #include "base/unguessable_token.h"
8 #include "gpu/ipc/service/gpu_channel.h" 8 #include "gpu/ipc/service/gpu_channel.h"
9 #include "ipc/message_filter.h" 9 #include "ipc/message_filter.h"
10 #include "media/gpu/ipc/common/media_messages.h" 10 #include "media/gpu/ipc/common/media_messages.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 const CreateVideoEncoderParams& params, 159 const CreateVideoEncoderParams& params,
160 IPC::Message* reply_message) { 160 IPC::Message* reply_message) {
161 TRACE_EVENT0("gpu", "MediaGpuChannel::OnCreateVideoEncoder"); 161 TRACE_EVENT0("gpu", "MediaGpuChannel::OnCreateVideoEncoder");
162 gpu::GpuCommandBufferStub* stub = 162 gpu::GpuCommandBufferStub* stub =
163 channel_->LookupCommandBuffer(command_buffer_route_id); 163 channel_->LookupCommandBuffer(command_buffer_route_id);
164 if (!stub) { 164 if (!stub) {
165 reply_message->set_reply_error(); 165 reply_message->set_reply_error();
166 Send(reply_message); 166 Send(reply_message);
167 return; 167 return;
168 } 168 }
169 GpuVideoEncodeAccelerator* encoder = 169 GpuVideoEncodeAccelerator* encoder = new GpuVideoEncodeAccelerator(
170 new GpuVideoEncodeAccelerator(params.encoder_route_id, stub); 170 params.encoder_route_id, stub, stub->channel()->io_task_runner());
171 bool succeeded = 171 bool succeeded =
172 encoder->Initialize(params.input_format, params.input_visible_size, 172 encoder->Initialize(params.input_format, params.input_visible_size,
173 params.output_profile, params.initial_bitrate); 173 params.output_profile, params.initial_bitrate);
174 GpuCommandBufferMsg_CreateVideoEncoder::WriteReplyParams(reply_message, 174 GpuCommandBufferMsg_CreateVideoEncoder::WriteReplyParams(reply_message,
175 succeeded); 175 succeeded);
176 Send(reply_message); 176 Send(reply_message);
177 177
178 // encoder is registered as a DestructionObserver of this stub and will 178 // encoder is registered as a DestructionObserver of this stub and will
179 // self-delete during destruction of this stub. 179 // self-delete during destruction of this stub.
180 } 180 }
181 181
182 } // namespace media 182 } // namespace media
OLDNEW
« no previous file with comments | « media/gpu/ipc/service/gpu_video_encode_accelerator.cc ('k') | media/gpu/media_foundation_video_encode_accelerator_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698