1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // From ppb_video_frame.idl modified Mon Apr 7 08:56:43 2014.
7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/ppb_video_frame.h"
9 #include "ppapi/shared_impl/tracked_callback.h"
10 #include "ppapi/thunk/enter.h"
11 #include "ppapi/thunk/ppapi_thunk_export.h"
12 #include "ppapi/thunk/ppb_video_frame_api.h"
19 PP_Bool
IsVideoFrame(PP_Resource resource
) {
20 VLOG(4) << "PPB_VideoFrame::IsVideoFrame()";
21 EnterResource
<PPB_VideoFrame_API
> enter(resource
, false);
22 return PP_FromBool(enter
.succeeded());
25 PP_TimeDelta
GetTimestamp(PP_Resource frame
) {
26 VLOG(4) << "PPB_VideoFrame::GetTimestamp()";
27 EnterResource
<PPB_VideoFrame_API
> enter(frame
, true);
30 return enter
.object()->GetTimestamp();
33 void SetTimestamp(PP_Resource frame
, PP_TimeDelta timestamp
) {
34 VLOG(4) << "PPB_VideoFrame::SetTimestamp()";
35 EnterResource
<PPB_VideoFrame_API
> enter(frame
, true);
38 enter
.object()->SetTimestamp(timestamp
);
41 PP_VideoFrame_Format
GetFormat(PP_Resource frame
) {
42 VLOG(4) << "PPB_VideoFrame::GetFormat()";
43 EnterResource
<PPB_VideoFrame_API
> enter(frame
, true);
45 return PP_VIDEOFRAME_FORMAT_UNKNOWN
;
46 return enter
.object()->GetFormat();
49 PP_Bool
GetSize(PP_Resource frame
, struct PP_Size
* size
) {
50 VLOG(4) << "PPB_VideoFrame::GetSize()";
51 EnterResource
<PPB_VideoFrame_API
> enter(frame
, true);
54 return enter
.object()->GetSize(size
);
57 void* GetDataBuffer(PP_Resource frame
) {
58 VLOG(4) << "PPB_VideoFrame::GetDataBuffer()";
59 EnterResource
<PPB_VideoFrame_API
> enter(frame
, true);
62 return enter
.object()->GetDataBuffer();
65 uint32_t GetDataBufferSize(PP_Resource frame
) {
66 VLOG(4) << "PPB_VideoFrame::GetDataBufferSize()";
67 EnterResource
<PPB_VideoFrame_API
> enter(frame
, true);
70 return enter
.object()->GetDataBufferSize();
73 const PPB_VideoFrame_0_1 g_ppb_videoframe_thunk_0_1
= {&IsVideoFrame
,
83 PPAPI_THUNK_EXPORT
const PPB_VideoFrame_0_1
* GetPPB_VideoFrame_0_1_Thunk() {
84 return &g_ppb_videoframe_thunk_0_1
;