| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/renderer/gpu/gpu_video_service_host.h" | 5 #include "content/renderer/gpu/gpu_video_service_host.h" |
| 6 | 6 |
| 7 #include "content/common/gpu/gpu_messages.h" | 7 #include "content/common/gpu/gpu_messages.h" |
| 8 #include "content/renderer/gpu/gpu_video_decode_accelerator_host.h" | 8 #include "content/renderer/gpu/gpu_video_decode_accelerator_host.h" |
| 9 #include "content/renderer/render_thread.h" | 9 #include "content/renderer/render_thread.h" |
| 10 #include "media/video/video_decode_accelerator.h" | 10 #include "media/video/video_decode_accelerator.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 on_initialized_.Run(); | 27 on_initialized_.Run(); |
| 28 } | 28 } |
| 29 | 29 |
| 30 bool GpuVideoServiceHost::OnMessageReceived(const IPC::Message& msg) { | 30 bool GpuVideoServiceHost::OnMessageReceived(const IPC::Message& msg) { |
| 31 DCHECK(CalledOnValidThread()); | 31 DCHECK(CalledOnValidThread()); |
| 32 if (!channel_) | 32 if (!channel_) |
| 33 return false; | 33 return false; |
| 34 switch (msg.type()) { | 34 switch (msg.type()) { |
| 35 case AcceleratedVideoDecoderHostMsg_BitstreamBufferProcessed::ID: | 35 case AcceleratedVideoDecoderHostMsg_BitstreamBufferProcessed::ID: |
| 36 case AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers::ID: | 36 case AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers::ID: |
| 37 case AcceleratedVideoDecoderHostMsg_CreateDone::ID: | |
| 38 case AcceleratedVideoDecoderHostMsg_InitializeDone::ID: | 37 case AcceleratedVideoDecoderHostMsg_InitializeDone::ID: |
| 39 case AcceleratedVideoDecoderHostMsg_DismissPictureBuffer::ID: | 38 case AcceleratedVideoDecoderHostMsg_DismissPictureBuffer::ID: |
| 40 case AcceleratedVideoDecoderHostMsg_PictureReady::ID: | 39 case AcceleratedVideoDecoderHostMsg_PictureReady::ID: |
| 41 case AcceleratedVideoDecoderHostMsg_FlushDone::ID: | 40 case AcceleratedVideoDecoderHostMsg_FlushDone::ID: |
| 42 case AcceleratedVideoDecoderHostMsg_AbortDone::ID: | 41 case AcceleratedVideoDecoderHostMsg_AbortDone::ID: |
| 43 case AcceleratedVideoDecoderHostMsg_EndOfStream::ID: | 42 case AcceleratedVideoDecoderHostMsg_EndOfStream::ID: |
| 44 case AcceleratedVideoDecoderHostMsg_ErrorNotification::ID: | 43 case AcceleratedVideoDecoderHostMsg_ErrorNotification::ID: |
| 45 if (router_.RouteMessage(msg)) | 44 if (router_.RouteMessage(msg)) |
| 46 return true; | 45 return true; |
| 47 LOG(ERROR) << "AcceleratedVideoDecoderHostMsg cannot be dispatched."; | 46 LOG(ERROR) << "AcceleratedVideoDecoderHostMsg cannot be dispatched."; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 67 GpuVideoDecodeAcceleratorHost* GpuVideoServiceHost::CreateVideoAccelerator( | 66 GpuVideoDecodeAcceleratorHost* GpuVideoServiceHost::CreateVideoAccelerator( |
| 68 media::VideoDecodeAccelerator::Client* client, | 67 media::VideoDecodeAccelerator::Client* client, |
| 69 int32 command_buffer_route_id, | 68 int32 command_buffer_route_id, |
| 70 gpu::CommandBufferHelper* cmd_buffer_helper) { | 69 gpu::CommandBufferHelper* cmd_buffer_helper) { |
| 71 DCHECK(CalledOnValidThread()); | 70 DCHECK(CalledOnValidThread()); |
| 72 DCHECK(channel_); | 71 DCHECK(channel_); |
| 73 return new GpuVideoDecodeAcceleratorHost( | 72 return new GpuVideoDecodeAcceleratorHost( |
| 74 &router_, channel_, next_decoder_host_id_++, | 73 &router_, channel_, next_decoder_host_id_++, |
| 75 command_buffer_route_id, cmd_buffer_helper, client); | 74 command_buffer_route_id, cmd_buffer_helper, client); |
| 76 } | 75 } |
| OLD | NEW |