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 "ppapi/cpp/dev/video_decoder_dev.h" | 5 #include "ppapi/cpp/dev/video_decoder_dev.h" |
6 | 6 |
7 #include "ppapi/c/dev/ppb_video_decoder_dev.h" | 7 #include "ppapi/c/dev/ppb_video_decoder_dev.h" |
8 #include "ppapi/c/dev/ppp_video_decoder_dev.h" | 8 #include "ppapi/c/dev/ppp_video_decoder_dev.h" |
9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
10 #include "ppapi/cpp/dev/context_3d_dev.h" | |
11 #include "ppapi/cpp/graphics_3d.h" | 10 #include "ppapi/cpp/graphics_3d.h" |
12 #include "ppapi/cpp/instance.h" | 11 #include "ppapi/cpp/instance.h" |
13 #include "ppapi/cpp/module.h" | 12 #include "ppapi/cpp/module.h" |
14 #include "ppapi/cpp/module_impl.h" | 13 #include "ppapi/cpp/module_impl.h" |
15 | 14 |
16 namespace pp { | 15 namespace pp { |
17 | 16 |
18 namespace { | 17 namespace { |
19 | 18 |
20 template <> const char* interface_name<PPB_VideoDecoder_Dev>() { | 19 template <> const char* interface_name<PPB_VideoDecoder_Dev>() { |
21 return PPB_VIDEODECODER_DEV_INTERFACE; | 20 return PPB_VIDEODECODER_DEV_INTERFACE; |
22 } | 21 } |
23 | 22 |
24 } // namespace | 23 } // namespace |
25 | 24 |
26 VideoDecoder_Dev::VideoDecoder_Dev(const Instance* instance, | 25 VideoDecoder_Dev::VideoDecoder_Dev(const Instance* instance, |
27 const Context3D_Dev& context, | |
28 PP_VideoDecoder_Profile profile) { | |
29 if (!has_interface<PPB_VideoDecoder_Dev>()) | |
30 return; | |
31 PassRefFromConstructor(get_interface<PPB_VideoDecoder_Dev>()->Create( | |
32 instance->pp_instance(), context.pp_resource(), profile)); | |
33 } | |
34 | |
35 VideoDecoder_Dev::VideoDecoder_Dev(const Instance* instance, | |
36 const Graphics3D& context, | 26 const Graphics3D& context, |
37 PP_VideoDecoder_Profile profile) { | 27 PP_VideoDecoder_Profile profile) { |
38 if (!has_interface<PPB_VideoDecoder_Dev>()) | 28 if (!has_interface<PPB_VideoDecoder_Dev>()) |
39 return; | 29 return; |
40 PassRefFromConstructor(get_interface<PPB_VideoDecoder_Dev>()->Create( | 30 PassRefFromConstructor(get_interface<PPB_VideoDecoder_Dev>()->Create( |
41 instance->pp_instance(), context.pp_resource(), profile)); | 31 instance->pp_instance(), context.pp_resource(), profile)); |
42 } | 32 } |
43 | 33 |
44 VideoDecoder_Dev::VideoDecoder_Dev(PP_Resource resource) : Resource(resource) { | 34 VideoDecoder_Dev::VideoDecoder_Dev(PP_Resource resource) : Resource(resource) { |
45 } | 35 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 } | 70 } |
81 | 71 |
82 int32_t VideoDecoder_Dev::Reset(CompletionCallback callback) { | 72 int32_t VideoDecoder_Dev::Reset(CompletionCallback callback) { |
83 if (!has_interface<PPB_VideoDecoder_Dev>()) | 73 if (!has_interface<PPB_VideoDecoder_Dev>()) |
84 return callback.MayForce(PP_ERROR_NOINTERFACE); | 74 return callback.MayForce(PP_ERROR_NOINTERFACE); |
85 return get_interface<PPB_VideoDecoder_Dev>()->Reset( | 75 return get_interface<PPB_VideoDecoder_Dev>()->Reset( |
86 pp_resource(), callback.pp_completion_callback()); | 76 pp_resource(), callback.pp_completion_callback()); |
87 } | 77 } |
88 | 78 |
89 } // namespace pp | 79 } // namespace pp |
OLD | NEW |