OLD | NEW |
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 Loading... |
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 |
OLD | NEW |