| OLD | NEW |
| 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 Wed Nov 5 13:39:36 2014. | 5 // From ppb_video_decoder.idl modified Fri Nov 7 14:49:08 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 { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 int32_t Initialize_0_1(PP_Resource video_decoder, | 34 int32_t Initialize_0_1(PP_Resource video_decoder, |
| 35 PP_Resource graphics3d_context, | 35 PP_Resource graphics3d_context, |
| 36 PP_VideoProfile profile, | 36 PP_VideoProfile profile, |
| 37 PP_Bool allow_software_fallback, | 37 PP_Bool allow_software_fallback, |
| 38 struct PP_CompletionCallback callback) { | 38 struct PP_CompletionCallback callback) { |
| 39 VLOG(4) << "PPB_VideoDecoder::Initialize()"; | 39 VLOG(4) << "PPB_VideoDecoder::Initialize()"; |
| 40 EnterResource<PPB_VideoDecoder_API> enter(video_decoder, callback, true); | 40 EnterResource<PPB_VideoDecoder_API> enter(video_decoder, callback, true); |
| 41 if (enter.failed()) | 41 if (enter.failed()) |
| 42 return enter.retval(); | 42 return enter.retval(); |
| 43 return enter.SetResult(enter.object()->Initialize0_1(graphics3d_context, | 43 return enter.SetResult(enter.object()->Initialize0_1( |
| 44 profile, | 44 graphics3d_context, profile, allow_software_fallback, enter.callback())); |
| 45 allow_software_fallback, | |
| 46 enter.callback())); | |
| 47 } | 45 } |
| 48 | 46 |
| 49 int32_t Initialize(PP_Resource video_decoder, | 47 int32_t Initialize(PP_Resource video_decoder, |
| 50 PP_Resource graphics3d_context, | 48 PP_Resource graphics3d_context, |
| 51 PP_VideoProfile profile, | 49 PP_VideoProfile profile, |
| 52 PP_HardwareAcceleration acceleration, | 50 PP_HardwareAcceleration acceleration, |
| 53 struct PP_CompletionCallback callback) { | 51 struct PP_CompletionCallback callback) { |
| 54 VLOG(4) << "PPB_VideoDecoder::Initialize()"; | 52 VLOG(4) << "PPB_VideoDecoder::Initialize()"; |
| 55 EnterResource<PPB_VideoDecoder_API> enter(video_decoder, callback, true); | 53 EnterResource<PPB_VideoDecoder_API> enter(video_decoder, callback, true); |
| 56 if (enter.failed()) | 54 if (enter.failed()) |
| 57 return enter.retval(); | 55 return enter.retval(); |
| 58 return enter.SetResult(enter.object()->Initialize(graphics3d_context, | 56 return enter.SetResult(enter.object()->Initialize( |
| 59 profile, | 57 graphics3d_context, profile, acceleration, enter.callback())); |
| 60 acceleration, | |
| 61 enter.callback())); | |
| 62 } | 58 } |
| 63 | 59 |
| 64 int32_t Decode(PP_Resource video_decoder, | 60 int32_t Decode(PP_Resource video_decoder, |
| 65 uint32_t decode_id, | 61 uint32_t decode_id, |
| 66 uint32_t size, | 62 uint32_t size, |
| 67 const void* buffer, | 63 const void* buffer, |
| 68 struct PP_CompletionCallback callback) { | 64 struct PP_CompletionCallback callback) { |
| 69 VLOG(4) << "PPB_VideoDecoder::Decode()"; | 65 VLOG(4) << "PPB_VideoDecoder::Decode()"; |
| 70 EnterResource<PPB_VideoDecoder_API> enter(video_decoder, callback, true); | 66 EnterResource<PPB_VideoDecoder_API> enter(video_decoder, callback, true); |
| 71 if (enter.failed()) | 67 if (enter.failed()) |
| 72 return enter.retval(); | 68 return enter.retval(); |
| 73 return enter.SetResult(enter.object()->Decode(decode_id, | 69 return enter.SetResult( |
| 74 size, | 70 enter.object()->Decode(decode_id, size, buffer, enter.callback())); |
| 75 buffer, | |
| 76 enter.callback())); | |
| 77 } | 71 } |
| 78 | 72 |
| 79 int32_t GetPicture_0_1(PP_Resource video_decoder, | 73 int32_t GetPicture_0_1(PP_Resource video_decoder, |
| 80 struct PP_VideoPicture_0_1* picture, | 74 struct PP_VideoPicture_0_1* picture, |
| 81 struct PP_CompletionCallback callback) { | 75 struct PP_CompletionCallback callback) { |
| 82 VLOG(4) << "PPB_VideoDecoder::GetPicture()"; | 76 VLOG(4) << "PPB_VideoDecoder::GetPicture()"; |
| 83 EnterResource<PPB_VideoDecoder_API> enter(video_decoder, callback, true); | 77 EnterResource<PPB_VideoDecoder_API> enter(video_decoder, callback, true); |
| 84 if (enter.failed()) | 78 if (enter.failed()) |
| 85 return enter.retval(); | 79 return enter.retval(); |
| 86 return enter.SetResult( | 80 return enter.SetResult( |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 &IsVideoDecoder, | 140 &IsVideoDecoder, |
| 147 &Initialize, | 141 &Initialize, |
| 148 &Decode, | 142 &Decode, |
| 149 &GetPicture, | 143 &GetPicture, |
| 150 &RecyclePicture, | 144 &RecyclePicture, |
| 151 &Flush, | 145 &Flush, |
| 152 &Reset}; | 146 &Reset}; |
| 153 | 147 |
| 154 } // namespace | 148 } // namespace |
| 155 | 149 |
| 156 PPAPI_THUNK_EXPORT const PPB_VideoDecoder_0_1* | 150 PPAPI_THUNK_EXPORT const PPB_VideoDecoder_0_1* GetPPB_VideoDecoder_0_1_Thunk() { |
| 157 GetPPB_VideoDecoder_0_1_Thunk() { | |
| 158 return &g_ppb_videodecoder_thunk_0_1; | 151 return &g_ppb_videodecoder_thunk_0_1; |
| 159 } | 152 } |
| 160 | 153 |
| 161 PPAPI_THUNK_EXPORT const PPB_VideoDecoder_0_2* | 154 PPAPI_THUNK_EXPORT const PPB_VideoDecoder_0_2* GetPPB_VideoDecoder_0_2_Thunk() { |
| 162 GetPPB_VideoDecoder_0_2_Thunk() { | |
| 163 return &g_ppb_videodecoder_thunk_0_2; | 155 return &g_ppb_videodecoder_thunk_0_2; |
| 164 } | 156 } |
| 165 | 157 |
| 166 PPAPI_THUNK_EXPORT const PPB_VideoDecoder_1_0* GetPPB_VideoDecoder_1_0_Thunk() { | 158 PPAPI_THUNK_EXPORT const PPB_VideoDecoder_1_0* GetPPB_VideoDecoder_1_0_Thunk() { |
| 167 return &g_ppb_videodecoder_thunk_1_0; | 159 return &g_ppb_videodecoder_thunk_1_0; |
| 168 } | 160 } |
| 169 | 161 |
| 170 } // namespace thunk | 162 } // namespace thunk |
| 171 } // namespace ppapi | 163 } // namespace ppapi |
| OLD | NEW |