| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/common/gpu/media/gpu_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/gpu_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 media::VideoDecodeAccelerator::Error error) { | 227 media::VideoDecodeAccelerator::Error error) { |
| 228 if (!Send(new AcceleratedVideoDecoderHostMsg_ErrorNotification( | 228 if (!Send(new AcceleratedVideoDecoderHostMsg_ErrorNotification( |
| 229 host_route_id_, error))) { | 229 host_route_id_, error))) { |
| 230 DLOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ErrorNotification) " | 230 DLOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ErrorNotification) " |
| 231 << "failed"; | 231 << "failed"; |
| 232 } | 232 } |
| 233 } | 233 } |
| 234 | 234 |
| 235 void GpuVideoDecodeAccelerator::Initialize( | 235 void GpuVideoDecodeAccelerator::Initialize( |
| 236 const media::VideoCodecProfile profile, | 236 const media::VideoCodecProfile profile, |
| 237 uint32 min_picture_count, |
| 237 IPC::Message* init_done_msg) { | 238 IPC::Message* init_done_msg) { |
| 238 DCHECK(!video_decode_accelerator_.get()); | 239 DCHECK(!video_decode_accelerator_.get()); |
| 239 | 240 |
| 240 if (!stub_->channel()->AddRoute(host_route_id_, this)) { | 241 if (!stub_->channel()->AddRoute(host_route_id_, this)) { |
| 241 DLOG(ERROR) << "Initialize(): failed to add route"; | 242 DLOG(ERROR) << "Initialize(): failed to add route"; |
| 242 SendCreateDecoderReply(init_done_msg, false); | 243 SendCreateDecoderReply(init_done_msg, false); |
| 243 } | 244 } |
| 244 | 245 |
| 245 #if !defined(OS_WIN) | 246 #if !defined(OS_WIN) |
| 246 // Ensure we will be able to get a GL context at all before initializing | 247 // Ensure we will be able to get a GL context at all before initializing |
| (...skipping 12 matching lines...) Expand all Loading... |
| 259 &GpuVideoDecodeAccelerator::CreateV4L2VDA, | 260 &GpuVideoDecodeAccelerator::CreateV4L2VDA, |
| 260 &GpuVideoDecodeAccelerator::CreateV4L2SliceVDA, | 261 &GpuVideoDecodeAccelerator::CreateV4L2SliceVDA, |
| 261 &GpuVideoDecodeAccelerator::CreateVaapiVDA, | 262 &GpuVideoDecodeAccelerator::CreateVaapiVDA, |
| 262 &GpuVideoDecodeAccelerator::CreateVTVDA, | 263 &GpuVideoDecodeAccelerator::CreateVTVDA, |
| 263 &GpuVideoDecodeAccelerator::CreateOzoneVDA, | 264 &GpuVideoDecodeAccelerator::CreateOzoneVDA, |
| 264 &GpuVideoDecodeAccelerator::CreateAndroidVDA}; | 265 &GpuVideoDecodeAccelerator::CreateAndroidVDA}; |
| 265 | 266 |
| 266 for (const auto& create_vda_function : create_vda_fps) { | 267 for (const auto& create_vda_function : create_vda_fps) { |
| 267 video_decode_accelerator_ = (this->*create_vda_function)(); | 268 video_decode_accelerator_ = (this->*create_vda_function)(); |
| 268 if (!video_decode_accelerator_ || | 269 if (!video_decode_accelerator_ || |
| 269 !video_decode_accelerator_->Initialize(profile, this)) | 270 !video_decode_accelerator_->Initialize( |
| 271 profile, min_picture_count, this)) |
| 270 continue; | 272 continue; |
| 271 | 273 |
| 272 if (video_decode_accelerator_->CanDecodeOnIOThread()) { | 274 if (video_decode_accelerator_->CanDecodeOnIOThread()) { |
| 273 filter_ = new MessageFilter(this, host_route_id_); | 275 filter_ = new MessageFilter(this, host_route_id_); |
| 274 stub_->channel()->AddFilter(filter_.get()); | 276 stub_->channel()->AddFilter(filter_.get()); |
| 275 } | 277 } |
| 276 SendCreateDecoderReply(init_done_msg, true); | 278 SendCreateDecoderReply(init_done_msg, true); |
| 277 return; | 279 return; |
| 278 } | 280 } |
| 279 video_decode_accelerator_.reset(); | 281 video_decode_accelerator_.reset(); |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 return stub_->channel()->Send(message); | 608 return stub_->channel()->Send(message); |
| 607 } | 609 } |
| 608 | 610 |
| 609 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, | 611 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, |
| 610 bool succeeded) { | 612 bool succeeded) { |
| 611 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); | 613 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); |
| 612 Send(message); | 614 Send(message); |
| 613 } | 615 } |
| 614 | 616 |
| 615 } // namespace content | 617 } // namespace content |
| OLD | NEW |