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 "webkit/plugins/ppapi/ppb_video_decoder_impl.h" | 5 #include "webkit/plugins/ppapi/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.h" | 10 #include "base/message_loop.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 using ppapi::thunk::EnterResourceNoLock; | 27 using ppapi::thunk::EnterResourceNoLock; |
28 using ppapi::thunk::PPB_Buffer_API; | 28 using ppapi::thunk::PPB_Buffer_API; |
29 using ppapi::thunk::PPB_Graphics3D_API; | 29 using ppapi::thunk::PPB_Graphics3D_API; |
30 using ppapi::thunk::PPB_VideoDecoder_API; | 30 using ppapi::thunk::PPB_VideoDecoder_API; |
31 | 31 |
32 namespace webkit { | 32 namespace webkit { |
33 namespace ppapi { | 33 namespace ppapi { |
34 | 34 |
35 PPB_VideoDecoder_Impl::PPB_VideoDecoder_Impl(PP_Instance instance) | 35 PPB_VideoDecoder_Impl::PPB_VideoDecoder_Impl(PP_Instance instance) |
36 : Resource(instance), | 36 : PPB_VideoDecoder_Shared(instance), |
37 ppp_videodecoder_(NULL) { | 37 ppp_videodecoder_(NULL) { |
38 PluginModule* plugin_module = ResourceHelper::GetPluginModule(this); | 38 PluginModule* plugin_module = ResourceHelper::GetPluginModule(this); |
39 if (plugin_module) { | 39 if (plugin_module) { |
40 ppp_videodecoder_ = static_cast<const PPP_VideoDecoder_Dev*>( | 40 ppp_videodecoder_ = static_cast<const PPP_VideoDecoder_Dev*>( |
41 plugin_module->GetPluginInterface(PPP_VIDEODECODER_DEV_INTERFACE)); | 41 plugin_module->GetPluginInterface(PPP_VIDEODECODER_DEV_INTERFACE)); |
42 } | 42 } |
43 } | 43 } |
44 | 44 |
45 PPB_VideoDecoder_Impl::~PPB_VideoDecoder_Impl() { | 45 PPB_VideoDecoder_Impl::~PPB_VideoDecoder_Impl() { |
46 } | 46 } |
47 | 47 |
48 PPB_VideoDecoder_API* PPB_VideoDecoder_Impl::AsPPB_VideoDecoder_API() { | |
49 return this; | |
50 } | |
51 | |
52 // Convert PP_VideoDecoder_Profile to media::VideoDecodeAccelerator::Profile. | 48 // Convert PP_VideoDecoder_Profile to media::VideoDecodeAccelerator::Profile. |
53 static media::VideoDecodeAccelerator::Profile PPToMediaProfile( | 49 static media::VideoDecodeAccelerator::Profile PPToMediaProfile( |
54 const PP_VideoDecoder_Profile pp_profile) { | 50 const PP_VideoDecoder_Profile pp_profile) { |
55 // TODO(fischman,vrk): this assumes the enum values in the two Profile types | 51 // TODO(fischman,vrk): this assumes the enum values in the two Profile types |
56 // match up exactly. Add a COMPILE_ASSERT for this somewhere. | 52 // match up exactly. Add a COMPILE_ASSERT for this somewhere. |
57 return static_cast<media::VideoDecodeAccelerator::Profile>(pp_profile); | 53 return static_cast<media::VideoDecodeAccelerator::Profile>(pp_profile); |
58 } | 54 } |
59 | 55 |
60 // static | 56 // static |
61 PP_Resource PPB_VideoDecoder_Impl::Create( | 57 PP_Resource PPB_VideoDecoder_Impl::Create( |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 void PPB_VideoDecoder_Impl::NotifyFlushDone() { | 249 void PPB_VideoDecoder_Impl::NotifyFlushDone() { |
254 RunFlushCallback(PP_OK); | 250 RunFlushCallback(PP_OK); |
255 } | 251 } |
256 | 252 |
257 void PPB_VideoDecoder_Impl::NotifyInitializeDone() { | 253 void PPB_VideoDecoder_Impl::NotifyInitializeDone() { |
258 NOTREACHED() << "PlatformVideoDecoder::Initialize() is synchronous!"; | 254 NOTREACHED() << "PlatformVideoDecoder::Initialize() is synchronous!"; |
259 } | 255 } |
260 | 256 |
261 } // namespace ppapi | 257 } // namespace ppapi |
262 } // namespace webkit | 258 } // namespace webkit |
OLD | NEW |