Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: ppapi/cpp/dev/video_decoder_dev.cc

Issue 7779001: Replace the use of an int32* with a proper struct for decoder configuration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Replaced struct with explicit profile parameter. Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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" 10 #include "ppapi/cpp/dev/context_3d_dev.h"
11 #include "ppapi/cpp/dev/graphics_3d_dev.h" 11 #include "ppapi/cpp/dev/graphics_3d_dev.h"
12 #include "ppapi/cpp/instance.h" 12 #include "ppapi/cpp/instance.h"
13 #include "ppapi/cpp/module.h" 13 #include "ppapi/cpp/module.h"
14 #include "ppapi/cpp/module_impl.h" 14 #include "ppapi/cpp/module_impl.h"
15 15
16 namespace pp { 16 namespace pp {
17 17
18 namespace { 18 namespace {
19 19
20 template <> const char* interface_name<PPB_VideoDecoder_Dev>() { 20 template <> const char* interface_name<PPB_VideoDecoder_Dev>() {
21 return PPB_VIDEODECODER_DEV_INTERFACE; 21 return PPB_VIDEODECODER_DEV_INTERFACE;
22 } 22 }
23 23
24 } // namespace 24 } // namespace
25 25
26 VideoDecoder_Dev::VideoDecoder_Dev(const Instance& instance, 26 VideoDecoder_Dev::VideoDecoder_Dev(const Instance* instance,
27 const Context3D_Dev& context, 27 const Context3D_Dev& context,
28 const PP_VideoConfigElement* config) { 28 PP_VideoDecoder_Profile profile) {
29 if (!has_interface<PPB_VideoDecoder_Dev>()) 29 if (!has_interface<PPB_VideoDecoder_Dev>())
30 return; 30 return;
31 PassRefFromConstructor(get_interface<PPB_VideoDecoder_Dev>()->Create( 31 PassRefFromConstructor(get_interface<PPB_VideoDecoder_Dev>()->Create(
32 instance.pp_instance(), context.pp_resource(), config)); 32 instance->pp_instance(), context.pp_resource(), profile));
33 } 33 }
34 34
35 VideoDecoder_Dev::VideoDecoder_Dev(const Instance& instance, 35 VideoDecoder_Dev::VideoDecoder_Dev(const Instance* instance,
36 const Graphics3D_Dev& context, 36 const Graphics3D_Dev& context,
37 const PP_VideoConfigElement* config) { 37 PP_VideoDecoder_Profile profile) {
38 if (!has_interface<PPB_VideoDecoder_Dev>()) 38 if (!has_interface<PPB_VideoDecoder_Dev>())
39 return; 39 return;
40 PassRefFromConstructor(get_interface<PPB_VideoDecoder_Dev>()->Create( 40 PassRefFromConstructor(get_interface<PPB_VideoDecoder_Dev>()->Create(
41 instance.pp_instance(), context.pp_resource(), config)); 41 instance->pp_instance(), context.pp_resource(), profile));
42 } 42 }
43 43
44 VideoDecoder_Dev::VideoDecoder_Dev(PP_Resource resource) : Resource(resource) { 44 VideoDecoder_Dev::VideoDecoder_Dev(PP_Resource resource) : Resource(resource) {
45 } 45 }
46 46
47 VideoDecoder_Dev::~VideoDecoder_Dev() { 47 VideoDecoder_Dev::~VideoDecoder_Dev() {
48 get_interface<PPB_VideoDecoder_Dev>()->Destroy(pp_resource()); 48 get_interface<PPB_VideoDecoder_Dev>()->Destroy(pp_resource());
49 } 49 }
50 50
51 void VideoDecoder_Dev::AssignPictureBuffers( 51 void VideoDecoder_Dev::AssignPictureBuffers(
(...skipping 28 matching lines...) Expand all
80 } 80 }
81 81
82 int32_t VideoDecoder_Dev::Reset(CompletionCallback callback) { 82 int32_t VideoDecoder_Dev::Reset(CompletionCallback callback) {
83 if (!has_interface<PPB_VideoDecoder_Dev>()) 83 if (!has_interface<PPB_VideoDecoder_Dev>())
84 return callback.MayForce(PP_ERROR_NOINTERFACE); 84 return callback.MayForce(PP_ERROR_NOINTERFACE);
85 return get_interface<PPB_VideoDecoder_Dev>()->Reset( 85 return get_interface<PPB_VideoDecoder_Dev>()->Reset(
86 pp_resource(), callback.pp_completion_callback()); 86 pp_resource(), callback.pp_completion_callback());
87 } 87 }
88 88
89 } // namespace pp 89 } // namespace pp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698