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/host_globals.h" |
14 #include "content/renderer/pepper/pepper_helper_impl.h" | 15 #include "content/renderer/pepper/pepper_helper_impl.h" |
15 #include "content/renderer/pepper/pepper_platform_context_3d.h" | 16 #include "content/renderer/pepper/pepper_platform_context_3d.h" |
| 17 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
16 #include "content/renderer/pepper/plugin_module.h" | 18 #include "content/renderer/pepper/plugin_module.h" |
17 #include "content/renderer/pepper/ppb_buffer_impl.h" | 19 #include "content/renderer/pepper/ppb_buffer_impl.h" |
18 #include "content/renderer/pepper/ppb_graphics_3d_impl.h" | 20 #include "content/renderer/pepper/ppb_graphics_3d_impl.h" |
19 #include "content/renderer/pepper/resource_helper.h" | |
20 #include "gpu/command_buffer/client/gles2_implementation.h" | 21 #include "gpu/command_buffer/client/gles2_implementation.h" |
21 #include "media/video/picture.h" | 22 #include "media/video/picture.h" |
22 #include "media/video/video_decode_accelerator.h" | 23 #include "media/video/video_decode_accelerator.h" |
23 #include "ppapi/c/dev/pp_video_dev.h" | 24 #include "ppapi/c/dev/pp_video_dev.h" |
24 #include "ppapi/c/dev/ppb_video_decoder_dev.h" | 25 #include "ppapi/c/dev/ppb_video_decoder_dev.h" |
25 #include "ppapi/c/dev/ppp_video_decoder_dev.h" | 26 #include "ppapi/c/dev/ppp_video_decoder_dev.h" |
26 #include "ppapi/c/pp_completion_callback.h" | 27 #include "ppapi/c/pp_completion_callback.h" |
27 #include "ppapi/c/pp_errors.h" | 28 #include "ppapi/c/pp_errors.h" |
28 #include "ppapi/shared_impl/resource_tracker.h" | 29 #include "ppapi/shared_impl/resource_tracker.h" |
29 #include "ppapi/thunk/enter.h" | 30 #include "ppapi/thunk/enter.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 } | 92 } |
92 } | 93 } |
93 | 94 |
94 } // namespace | 95 } // namespace |
95 | 96 |
96 namespace content { | 97 namespace content { |
97 | 98 |
98 PPB_VideoDecoder_Impl::PPB_VideoDecoder_Impl(PP_Instance instance) | 99 PPB_VideoDecoder_Impl::PPB_VideoDecoder_Impl(PP_Instance instance) |
99 : PPB_VideoDecoder_Shared(instance), | 100 : PPB_VideoDecoder_Shared(instance), |
100 ppp_videodecoder_(NULL) { | 101 ppp_videodecoder_(NULL) { |
101 PluginModule* plugin_module = ResourceHelper::GetPluginModule(this); | 102 PluginModule* plugin_module = |
| 103 HostGlobals::Get()->GetInstance(pp_instance())->module(); |
102 if (plugin_module) { | 104 if (plugin_module) { |
103 ppp_videodecoder_ = static_cast<const PPP_VideoDecoder_Dev*>( | 105 ppp_videodecoder_ = static_cast<const PPP_VideoDecoder_Dev*>( |
104 plugin_module->GetPluginInterface(PPP_VIDEODECODER_DEV_INTERFACE)); | 106 plugin_module->GetPluginInterface(PPP_VIDEODECODER_DEV_INTERFACE)); |
105 } | 107 } |
106 } | 108 } |
107 | 109 |
108 PPB_VideoDecoder_Impl::~PPB_VideoDecoder_Impl() { | 110 PPB_VideoDecoder_Impl::~PPB_VideoDecoder_Impl() { |
109 Destroy(); | 111 Destroy(); |
110 } | 112 } |
111 | 113 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 | 293 |
292 void PPB_VideoDecoder_Impl::NotifyFlushDone() { | 294 void PPB_VideoDecoder_Impl::NotifyFlushDone() { |
293 RunFlushCallback(PP_OK); | 295 RunFlushCallback(PP_OK); |
294 } | 296 } |
295 | 297 |
296 void PPB_VideoDecoder_Impl::NotifyInitializeDone() { | 298 void PPB_VideoDecoder_Impl::NotifyInitializeDone() { |
297 NOTREACHED() << "PlatformVideoDecoder::Initialize() is synchronous!"; | 299 NOTREACHED() << "PlatformVideoDecoder::Initialize() is synchronous!"; |
298 } | 300 } |
299 | 301 |
300 } // namespace content | 302 } // namespace content |
OLD | NEW |