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

Side by Side Diff: ppapi/thunk/ppb_video_decoder_thunk.cc

Issue 540393003: Move PPB_VideoDecoder from 'Dev' to Stable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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 // From ppb_video_decoder.idl modified Thu Aug 21 16:59:07 2014. 5 // From ppb_video_decoder.idl modified Fri Sep 5 17:38:12 2014.
6 6
7 #include "ppapi/c/pp_completion_callback.h" 7 #include "ppapi/c/pp_completion_callback.h"
8 #include "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/ppb_video_decoder.h" 9 #include "ppapi/c/ppb_video_decoder.h"
10 #include "ppapi/shared_impl/tracked_callback.h" 10 #include "ppapi/shared_impl/tracked_callback.h"
11 #include "ppapi/thunk/enter.h" 11 #include "ppapi/thunk/enter.h"
12 #include "ppapi/thunk/ppapi_thunk_export.h" 12 #include "ppapi/thunk/ppapi_thunk_export.h"
13 #include "ppapi/thunk/ppb_video_decoder_api.h" 13 #include "ppapi/thunk/ppb_video_decoder_api.h"
14 14
15 namespace ppapi { 15 namespace ppapi {
16 namespace thunk { 16 namespace thunk {
17 17
18 namespace { 18 namespace {
19 19
20 PP_Resource Create(PP_Instance instance) { 20 PP_Resource Create(PP_Instance instance) {
21 VLOG(4) << "PPB_VideoDecoder::Create()"; 21 VLOG(4) << "PPB_VideoDecoder::Create()";
22 EnterResourceCreation enter(instance); 22 EnterResourceCreation enter(instance);
23 if (enter.failed()) 23 if (enter.failed())
24 return 0; 24 return 0;
25 return enter.functions()->CreateVideoDecoder(instance); 25 return enter.functions()->CreateVideoDecoder(instance);
26 } 26 }
27 27
28 PP_Bool IsVideoDecoder(PP_Resource resource) { 28 PP_Bool IsVideoDecoder(PP_Resource resource) {
29 VLOG(4) << "PPB_VideoDecoder::IsVideoDecoder()"; 29 VLOG(4) << "PPB_VideoDecoder::IsVideoDecoder()";
30 EnterResource<PPB_VideoDecoder_API> enter(resource, false); 30 EnterResource<PPB_VideoDecoder_API> enter(resource, false);
31 return PP_FromBool(enter.succeeded()); 31 return PP_FromBool(enter.succeeded());
32 } 32 }
33 33
34 int32_t Initialize_0_1(PP_Resource video_decoder,
35 PP_Resource graphics3d_context,
36 PP_VideoProfile profile,
37 PP_Bool allow_software_fallback,
38 struct PP_CompletionCallback callback) {
39 VLOG(4) << "PPB_VideoDecoder::Initialize()";
40 EnterResource<PPB_VideoDecoder_API> enter(video_decoder, callback, true);
41 if (enter.failed())
42 return enter.retval();
43 return enter.SetResult(enter.object()->Initialize0_1(graphics3d_context,
44 profile,
45 allow_software_fallback,
46 enter.callback()));
47 }
48
49 int32_t Initialize(PP_Resource video_decoder, 34 int32_t Initialize(PP_Resource video_decoder,
50 PP_Resource graphics3d_context, 35 PP_Resource graphics3d_context,
51 PP_VideoProfile profile, 36 PP_VideoProfile profile,
52 PP_HardwareAcceleration acceleration, 37 PP_HardwareAcceleration acceleration,
53 struct PP_CompletionCallback callback) { 38 struct PP_CompletionCallback callback) {
54 VLOG(4) << "PPB_VideoDecoder::Initialize()"; 39 VLOG(4) << "PPB_VideoDecoder::Initialize()";
55 EnterResource<PPB_VideoDecoder_API> enter(video_decoder, callback, true); 40 EnterResource<PPB_VideoDecoder_API> enter(video_decoder, callback, true);
56 if (enter.failed()) 41 if (enter.failed())
57 return enter.retval(); 42 return enter.retval();
58 return enter.SetResult(enter.object()->Initialize(graphics3d_context, 43 return enter.SetResult(enter.object()->Initialize(graphics3d_context,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 91
107 int32_t Reset(PP_Resource video_decoder, 92 int32_t Reset(PP_Resource video_decoder,
108 struct PP_CompletionCallback callback) { 93 struct PP_CompletionCallback callback) {
109 VLOG(4) << "PPB_VideoDecoder::Reset()"; 94 VLOG(4) << "PPB_VideoDecoder::Reset()";
110 EnterResource<PPB_VideoDecoder_API> enter(video_decoder, callback, true); 95 EnterResource<PPB_VideoDecoder_API> enter(video_decoder, callback, true);
111 if (enter.failed()) 96 if (enter.failed())
112 return enter.retval(); 97 return enter.retval();
113 return enter.SetResult(enter.object()->Reset(enter.callback())); 98 return enter.SetResult(enter.object()->Reset(enter.callback()));
114 } 99 }
115 100
116 const PPB_VideoDecoder_0_1 g_ppb_videodecoder_thunk_0_1 = {
117 &Create,
118 &IsVideoDecoder,
119 &Initialize_0_1,
120 &Decode,
121 &GetPicture,
122 &RecyclePicture,
123 &Flush,
124 &Reset
125 };
126
127 const PPB_VideoDecoder_0_2 g_ppb_videodecoder_thunk_0_2 = { 101 const PPB_VideoDecoder_0_2 g_ppb_videodecoder_thunk_0_2 = {
128 &Create, 102 &Create,
129 &IsVideoDecoder, 103 &IsVideoDecoder,
130 &Initialize, 104 &Initialize,
131 &Decode, 105 &Decode,
132 &GetPicture, 106 &GetPicture,
133 &RecyclePicture, 107 &RecyclePicture,
134 &Flush, 108 &Flush,
135 &Reset 109 &Reset
136 }; 110 };
137 111
138 } // namespace 112 } // namespace
139 113
140 PPAPI_THUNK_EXPORT const PPB_VideoDecoder_0_1*
141 GetPPB_VideoDecoder_0_1_Thunk() {
142 return &g_ppb_videodecoder_thunk_0_1;
143 }
144
145 PPAPI_THUNK_EXPORT const PPB_VideoDecoder_0_2* 114 PPAPI_THUNK_EXPORT const PPB_VideoDecoder_0_2*
146 GetPPB_VideoDecoder_0_2_Thunk() { 115 GetPPB_VideoDecoder_0_2_Thunk() {
147 return &g_ppb_videodecoder_thunk_0_2; 116 return &g_ppb_videodecoder_thunk_0_2;
148 } 117 }
149 118
150 } // namespace thunk 119 } // namespace thunk
151 } // namespace ppapi 120 } // namespace ppapi
OLDNEW
« ppapi/api/ppb_video_decoder.idl ('K') | « ppapi/thunk/interfaces_ppb_public_stable.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698