| 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" |
| 11 | 11 |
| 12 namespace ppapi { | 12 namespace ppapi { |
| 13 namespace thunk { | 13 namespace thunk { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 typedef EnterResource<PPB_VideoDecoder_API> EnterVideoDecoder; | 17 typedef EnterResource<PPB_VideoDecoder_API> EnterVideoDecoder; |
| 18 | 18 |
| 19 PP_Resource Create(PP_Instance instance, | 19 PP_Resource Create(PP_Instance instance, |
| 20 PP_Resource context_3d, | 20 PP_Resource context_3d, |
| 21 const PP_VideoConfigElement* config) { | 21 PP_VideoDecoder_Profile profile) { |
| 22 EnterFunction<ResourceCreationAPI> enter(instance, true); | 22 EnterFunction<ResourceCreationAPI> enter(instance, true); |
| 23 if (enter.failed()) | 23 if (enter.failed()) |
| 24 return 0; | 24 return 0; |
| 25 return enter.functions()->CreateVideoDecoder(instance, context_3d, config); | 25 return enter.functions()->CreateVideoDecoder(instance, context_3d, profile); |
| 26 } | 26 } |
| 27 | 27 |
| 28 PP_Bool IsVideoDecoder(PP_Resource resource) { | 28 PP_Bool IsVideoDecoder(PP_Resource resource) { |
| 29 EnterVideoDecoder enter(resource, false); | 29 EnterVideoDecoder enter(resource, false); |
| 30 return PP_FromBool(enter.succeeded()); | 30 return PP_FromBool(enter.succeeded()); |
| 31 } | 31 } |
| 32 | 32 |
| 33 int32_t Decode(PP_Resource video_decoder, | 33 int32_t Decode(PP_Resource video_decoder, |
| 34 const PP_VideoBitstreamBuffer_Dev* bitstream_buffer, | 34 const PP_VideoBitstreamBuffer_Dev* bitstream_buffer, |
| 35 PP_CompletionCallback callback) { | 35 PP_CompletionCallback callback) { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 } // namespace | 91 } // namespace |
| 92 | 92 |
| 93 const PPB_VideoDecoder_Dev* GetPPB_VideoDecoder_Thunk() { | 93 const PPB_VideoDecoder_Dev* GetPPB_VideoDecoder_Thunk() { |
| 94 return &g_ppb_videodecoder_thunk; | 94 return &g_ppb_videodecoder_thunk; |
| 95 } | 95 } |
| 96 | 96 |
| 97 } // namespace thunk | 97 } // namespace thunk |
| 98 } // namespace ppapi | 98 } // namespace ppapi |
| OLD | NEW |