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/renderer/pepper/ppb_video_decoder_impl.h" | 5 #include "content/renderer/pepper/ppb_video_decoder_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
12 #include "content/renderer/media/pepper_platform_video_decoder.h" | 12 #include "content/renderer/media/pepper_platform_video_decoder.h" |
13 #include "content/renderer/pepper/common.h" | 13 #include "content/renderer/pepper/common.h" |
14 #include "content/renderer/pepper/pepper_platform_context_3d.h" | 14 #include "content/renderer/pepper/pepper_platform_context_3d.h" |
| 15 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" |
15 #include "content/renderer/pepper/plugin_module.h" | 16 #include "content/renderer/pepper/plugin_module.h" |
16 #include "content/renderer/pepper/ppb_buffer_impl.h" | 17 #include "content/renderer/pepper/ppb_buffer_impl.h" |
17 #include "content/renderer/pepper/ppb_graphics_3d_impl.h" | 18 #include "content/renderer/pepper/ppb_graphics_3d_impl.h" |
18 #include "content/renderer/pepper/resource_helper.h" | 19 #include "content/renderer/pepper/resource_helper.h" |
19 #include "gpu/command_buffer/client/gles2_implementation.h" | 20 #include "gpu/command_buffer/client/gles2_implementation.h" |
20 #include "media/video/picture.h" | 21 #include "media/video/picture.h" |
21 #include "media/video/video_decode_accelerator.h" | 22 #include "media/video/video_decode_accelerator.h" |
22 #include "ppapi/c/dev/pp_video_dev.h" | 23 #include "ppapi/c/dev/pp_video_dev.h" |
23 #include "ppapi/c/dev/ppb_video_decoder_dev.h" | 24 #include "ppapi/c/dev/ppb_video_decoder_dev.h" |
24 #include "ppapi/c/dev/ppp_video_decoder_dev.h" | 25 #include "ppapi/c/dev/ppp_video_decoder_dev.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 PP_Resource graphics_context, | 132 PP_Resource graphics_context, |
132 PlatformContext3D* context, | 133 PlatformContext3D* context, |
133 gpu::gles2::GLES2Implementation* gles2_impl, | 134 gpu::gles2::GLES2Implementation* gles2_impl, |
134 PP_VideoDecoder_Profile profile) { | 135 PP_VideoDecoder_Profile profile) { |
135 InitCommon(graphics_context, gles2_impl); | 136 InitCommon(graphics_context, gles2_impl); |
136 | 137 |
137 int command_buffer_route_id = context->GetCommandBufferRouteId(); | 138 int command_buffer_route_id = context->GetCommandBufferRouteId(); |
138 if (command_buffer_route_id == 0) | 139 if (command_buffer_route_id == 0) |
139 return false; | 140 return false; |
140 | 141 |
141 PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this); | 142 PepperPluginDelegateImpl* plugin_delegate = |
| 143 ResourceHelper::GetPluginDelegate(this); |
142 if (!plugin_delegate) | 144 if (!plugin_delegate) |
143 return false; | 145 return false; |
144 | 146 |
145 platform_video_decoder_.reset(new PlatformVideoDecoder( | 147 platform_video_decoder_.reset(new PlatformVideoDecoder( |
146 this, command_buffer_route_id)); | 148 this, command_buffer_route_id)); |
147 if (!platform_video_decoder_) | 149 if (!platform_video_decoder_) |
148 return false; | 150 return false; |
149 | 151 |
150 FlushCommandBuffer(); | 152 FlushCommandBuffer(); |
151 return platform_video_decoder_->Initialize(PPToMediaProfile(profile)); | 153 return platform_video_decoder_->Initialize(PPToMediaProfile(profile)); |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 | 296 |
295 void PPB_VideoDecoder_Impl::NotifyFlushDone() { | 297 void PPB_VideoDecoder_Impl::NotifyFlushDone() { |
296 RunFlushCallback(PP_OK); | 298 RunFlushCallback(PP_OK); |
297 } | 299 } |
298 | 300 |
299 void PPB_VideoDecoder_Impl::NotifyInitializeDone() { | 301 void PPB_VideoDecoder_Impl::NotifyInitializeDone() { |
300 NOTREACHED() << "PlatformVideoDecoder::Initialize() is synchronous!"; | 302 NOTREACHED() << "PlatformVideoDecoder::Initialize() is synchronous!"; |
301 } | 303 } |
302 | 304 |
303 } // namespace content | 305 } // namespace content |
OLD | NEW |