| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/c/pp_errors.h" | 5 #include "ppapi/c/pp_errors.h" |
| 6 #include "ppapi/thunk/enter.h" | 6 #include "ppapi/thunk/enter.h" |
| 7 #include "ppapi/thunk/thunk.h" | 7 #include "ppapi/thunk/thunk.h" |
| 8 #include "ppapi/thunk/ppb_video_decoder_api.h" | 8 #include "ppapi/thunk/ppb_video_decoder_api.h" |
| 9 #include "ppapi/thunk/resource_creation_api.h" | 9 #include "ppapi/thunk/resource_creation_api.h" |
| 10 | 10 |
| 11 namespace ppapi { | 11 namespace ppapi { |
| 12 namespace thunk { | 12 namespace thunk { |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 typedef EnterResource<PPB_VideoDecoder_API> EnterVideoDecoder; | 16 typedef EnterResource<PPB_VideoDecoder_API> EnterVideoDecoder; |
| 17 | 17 |
| 18 PP_Resource Create(PP_Instance instance, | 18 PP_Resource Create(PP_Instance instance, |
| 19 PP_Resource graphics_3d, | 19 PP_Resource graphics_3d, |
| 20 PP_VideoDecoder_Profile profile) { | 20 PP_VideoDecoder_Profile profile, |
| 21 const PP_Size* frame_size, |
| 22 const uint8_t* extra_data, |
| 23 uint32_t extra_data_size) { |
| 21 EnterResourceCreation enter(instance); | 24 EnterResourceCreation enter(instance); |
| 22 if (enter.failed()) | 25 if (enter.failed()) |
| 23 return 0; | 26 return 0; |
| 24 return enter.functions()->CreateVideoDecoder(instance, graphics_3d, profile); | 27 return enter.functions()->CreateVideoDecoder(instance, graphics_3d, profile, |
| 28 *frame_size, extra_data, extra_data_size); |
| 25 } | 29 } |
| 26 | 30 |
| 27 PP_Bool IsVideoDecoder(PP_Resource resource) { | 31 PP_Bool IsVideoDecoder(PP_Resource resource) { |
| 28 EnterVideoDecoder enter(resource, false); | 32 EnterVideoDecoder enter(resource, false); |
| 29 return PP_FromBool(enter.succeeded()); | 33 return PP_FromBool(enter.succeeded()); |
| 30 } | 34 } |
| 31 | 35 |
| 32 int32_t Decode(PP_Resource video_decoder, | 36 int32_t Decode(PP_Resource video_decoder, |
| 33 const PP_VideoBitstreamBuffer_Dev* bitstream_buffer, | 37 const PP_VideoBitstreamBuffer_Dev* bitstream_buffer, |
| 34 PP_CompletionCallback callback) { | 38 PP_CompletionCallback callback) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 &Decode, | 83 &Decode, |
| 80 &AssignPictureBuffers, | 84 &AssignPictureBuffers, |
| 81 &ReusePictureBuffer, | 85 &ReusePictureBuffer, |
| 82 &Flush, | 86 &Flush, |
| 83 &Reset, | 87 &Reset, |
| 84 &Destroy | 88 &Destroy |
| 85 }; | 89 }; |
| 86 | 90 |
| 87 } // namespace | 91 } // namespace |
| 88 | 92 |
| 89 const PPB_VideoDecoder_Dev_0_16* GetPPB_VideoDecoder_Dev_0_16_Thunk() { | 93 const PPB_VideoDecoder_Dev_0_17* GetPPB_VideoDecoder_Dev_0_17_Thunk() { |
| 90 return &g_ppb_videodecoder_thunk; | 94 return &g_ppb_videodecoder_thunk; |
| 91 } | 95 } |
| 92 | 96 |
| 93 } // namespace thunk | 97 } // namespace thunk |
| 94 } // namespace ppapi | 98 } // namespace ppapi |
| OLD | NEW |