| OLD | NEW |
| 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/c/pp_errors.h" | 5 #include "ppapi/c/pp_errors.h" |
| 6 #include "ppapi/thunk/common.h" | 6 #include "ppapi/thunk/common.h" |
| 7 #include "ppapi/thunk/enter.h" | 7 #include "ppapi/thunk/enter.h" |
| 8 #include "ppapi/thunk/thunk.h" | 8 #include "ppapi/thunk/thunk.h" |
| 9 #include "ppapi/thunk/ppb_video_decoder_api.h" | 9 #include "ppapi/thunk/ppb_video_decoder_api.h" |
| 10 #include "ppapi/thunk/resource_creation_api.h" | 10 #include "ppapi/thunk/resource_creation_api.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 int32_t Decode(PP_Resource video_decoder, | 43 int32_t Decode(PP_Resource video_decoder, |
| 44 const PP_VideoBitstreamBuffer_Dev* bitstream_buffer, | 44 const PP_VideoBitstreamBuffer_Dev* bitstream_buffer, |
| 45 PP_CompletionCallback callback) { | 45 PP_CompletionCallback callback) { |
| 46 EnterVideoDecoder enter(video_decoder, true); | 46 EnterVideoDecoder enter(video_decoder, true); |
| 47 if (enter.failed()) | 47 if (enter.failed()) |
| 48 return MayForceCallback(callback, PP_ERROR_BADRESOURCE); | 48 return MayForceCallback(callback, PP_ERROR_BADRESOURCE); |
| 49 int32_t result = enter.object()->Decode(bitstream_buffer, callback); | 49 int32_t result = enter.object()->Decode(bitstream_buffer, callback); |
| 50 return MayForceCallback(callback, result); | 50 return MayForceCallback(callback, result); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void AssignGLESBuffers(PP_Resource video_decoder, | 53 void AssignPictureBuffers(PP_Resource video_decoder, |
| 54 uint32_t no_of_buffers, | 54 uint32_t no_of_buffers, |
| 55 const PP_GLESBuffer_Dev* buffers) { | 55 const PP_PictureBuffer_Dev* buffers) { |
| 56 EnterVideoDecoder enter(video_decoder, true); | 56 EnterVideoDecoder enter(video_decoder, true); |
| 57 if (enter.succeeded()) | 57 if (enter.succeeded()) |
| 58 enter.object()->AssignGLESBuffers(no_of_buffers, buffers); | 58 enter.object()->AssignPictureBuffers(no_of_buffers, buffers); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void ReusePictureBuffer(PP_Resource video_decoder, int32_t picture_buffer_id) { | 61 void ReusePictureBuffer(PP_Resource video_decoder, int32_t picture_buffer_id) { |
| 62 EnterVideoDecoder enter(video_decoder, true); | 62 EnterVideoDecoder enter(video_decoder, true); |
| 63 if (enter.succeeded()) | 63 if (enter.succeeded()) |
| 64 enter.object()->ReusePictureBuffer(picture_buffer_id); | 64 enter.object()->ReusePictureBuffer(picture_buffer_id); |
| 65 } | 65 } |
| 66 | 66 |
| 67 int32_t Flush(PP_Resource video_decoder, PP_CompletionCallback callback) { | 67 int32_t Flush(PP_Resource video_decoder, PP_CompletionCallback callback) { |
| 68 EnterVideoDecoder enter(video_decoder, true); | 68 EnterVideoDecoder enter(video_decoder, true); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 85 EnterVideoDecoder enter(video_decoder, true); | 85 EnterVideoDecoder enter(video_decoder, true); |
| 86 if (enter.succeeded()) | 86 if (enter.succeeded()) |
| 87 enter.object()->Destroy(); | 87 enter.object()->Destroy(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 const PPB_VideoDecoder_Dev g_ppb_videodecoder_thunk = { | 90 const PPB_VideoDecoder_Dev g_ppb_videodecoder_thunk = { |
| 91 &Create, | 91 &Create, |
| 92 &IsVideoDecoder, | 92 &IsVideoDecoder, |
| 93 &Initialize, | 93 &Initialize, |
| 94 &Decode, | 94 &Decode, |
| 95 &AssignGLESBuffers, | 95 &AssignPictureBuffers, |
| 96 &ReusePictureBuffer, | 96 &ReusePictureBuffer, |
| 97 &Flush, | 97 &Flush, |
| 98 &Reset, | 98 &Reset, |
| 99 &Destroy | 99 &Destroy |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 } // namespace | 102 } // namespace |
| 103 | 103 |
| 104 const PPB_VideoDecoder_Dev* GetPPB_VideoDecoder_Thunk() { | 104 const PPB_VideoDecoder_Dev* GetPPB_VideoDecoder_Thunk() { |
| 105 return &g_ppb_videodecoder_thunk; | 105 return &g_ppb_videodecoder_thunk; |
| 106 } | 106 } |
| 107 | 107 |
| 108 } // namespace thunk | 108 } // namespace thunk |
| 109 } // namespace ppapi | 109 } // namespace ppapi |
| OLD | NEW |