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

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

Issue 496203002: Pepper: PPB_VideoDecoder software-only mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 6 years, 4 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
« no previous file with comments | « ppapi/thunk/ppb_video_decoder_api.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 Tue May 6 05:06:35 2014. 5 // From ppb_video_decoder.idl modified Thu Aug 21 16:59:07 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
34 int32_t Initialize(PP_Resource video_decoder, 49 int32_t Initialize(PP_Resource video_decoder,
35 PP_Resource graphics3d_context, 50 PP_Resource graphics3d_context,
36 PP_VideoProfile profile, 51 PP_VideoProfile profile,
37 PP_Bool allow_software_fallback, 52 PP_HardwareAcceleration acceleration,
38 struct PP_CompletionCallback callback) { 53 struct PP_CompletionCallback callback) {
39 VLOG(4) << "PPB_VideoDecoder::Initialize()"; 54 VLOG(4) << "PPB_VideoDecoder::Initialize()";
40 EnterResource<PPB_VideoDecoder_API> enter(video_decoder, callback, true); 55 EnterResource<PPB_VideoDecoder_API> enter(video_decoder, callback, true);
41 if (enter.failed()) 56 if (enter.failed())
42 return enter.retval(); 57 return enter.retval();
43 return enter.SetResult(enter.object()->Initialize(graphics3d_context, 58 return enter.SetResult(enter.object()->Initialize(graphics3d_context,
44 profile, 59 profile,
45 allow_software_fallback, 60 acceleration,
46 enter.callback())); 61 enter.callback()));
47 } 62 }
48 63
49 int32_t Decode(PP_Resource video_decoder, 64 int32_t Decode(PP_Resource video_decoder,
50 uint32_t decode_id, 65 uint32_t decode_id,
51 uint32_t size, 66 uint32_t size,
52 const void* buffer, 67 const void* buffer,
53 struct PP_CompletionCallback callback) { 68 struct PP_CompletionCallback callback) {
54 VLOG(4) << "PPB_VideoDecoder::Decode()"; 69 VLOG(4) << "PPB_VideoDecoder::Decode()";
55 EnterResource<PPB_VideoDecoder_API> enter(video_decoder, callback, true); 70 EnterResource<PPB_VideoDecoder_API> enter(video_decoder, callback, true);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 VLOG(4) << "PPB_VideoDecoder::Reset()"; 109 VLOG(4) << "PPB_VideoDecoder::Reset()";
95 EnterResource<PPB_VideoDecoder_API> enter(video_decoder, callback, true); 110 EnterResource<PPB_VideoDecoder_API> enter(video_decoder, callback, true);
96 if (enter.failed()) 111 if (enter.failed())
97 return enter.retval(); 112 return enter.retval();
98 return enter.SetResult(enter.object()->Reset(enter.callback())); 113 return enter.SetResult(enter.object()->Reset(enter.callback()));
99 } 114 }
100 115
101 const PPB_VideoDecoder_0_1 g_ppb_videodecoder_thunk_0_1 = { 116 const PPB_VideoDecoder_0_1 g_ppb_videodecoder_thunk_0_1 = {
102 &Create, 117 &Create,
103 &IsVideoDecoder, 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 = {
128 &Create,
129 &IsVideoDecoder,
104 &Initialize, 130 &Initialize,
105 &Decode, 131 &Decode,
106 &GetPicture, 132 &GetPicture,
107 &RecyclePicture, 133 &RecyclePicture,
108 &Flush, 134 &Flush,
109 &Reset 135 &Reset
110 }; 136 };
111 137
112 } // namespace 138 } // namespace
113 139
114 PPAPI_THUNK_EXPORT const PPB_VideoDecoder_0_1* 140 PPAPI_THUNK_EXPORT const PPB_VideoDecoder_0_1*
115 GetPPB_VideoDecoder_0_1_Thunk() { 141 GetPPB_VideoDecoder_0_1_Thunk() {
116 return &g_ppb_videodecoder_thunk_0_1; 142 return &g_ppb_videodecoder_thunk_0_1;
117 } 143 }
118 144
145 PPAPI_THUNK_EXPORT const PPB_VideoDecoder_0_2*
146 GetPPB_VideoDecoder_0_2_Thunk() {
147 return &g_ppb_videodecoder_thunk_0_2;
148 }
149
119 } // namespace thunk 150 } // namespace thunk
120 } // namespace ppapi 151 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/thunk/ppb_video_decoder_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698