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_media_stream_video_track.idl modified Thu Jan 23 08:56:57 2014.
7 #include "ppapi/c/pp_completion_callback.h"
8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/ppb_media_stream_video_track.h"
10 #include "ppapi/shared_impl/tracked_callback.h"
11 #include "ppapi/thunk/enter.h"
12 #include "ppapi/thunk/ppapi_thunk_export.h"
13 #include "ppapi/thunk/ppb_media_stream_video_track_api.h"
20 PP_Bool
IsMediaStreamVideoTrack(PP_Resource resource
) {
21 VLOG(4) << "PPB_MediaStreamVideoTrack::IsMediaStreamVideoTrack()";
22 EnterResource
<PPB_MediaStreamVideoTrack_API
> enter(resource
, false);
23 return PP_FromBool(enter
.succeeded());
26 int32_t Configure(PP_Resource video_track
,
27 const int32_t attrib_list
[],
28 struct PP_CompletionCallback callback
) {
29 VLOG(4) << "PPB_MediaStreamVideoTrack::Configure()";
30 EnterResource
<PPB_MediaStreamVideoTrack_API
> enter(video_track
,
34 return enter
.retval();
35 return enter
.SetResult(enter
.object()->Configure(attrib_list
,
39 int32_t GetAttrib(PP_Resource video_track
,
40 PP_MediaStreamVideoTrack_Attrib attrib
,
42 VLOG(4) << "PPB_MediaStreamVideoTrack::GetAttrib()";
43 EnterResource
<PPB_MediaStreamVideoTrack_API
> enter(video_track
, true);
45 return enter
.retval();
46 return enter
.object()->GetAttrib(attrib
, value
);
49 struct PP_Var
GetId(PP_Resource video_track
) {
50 VLOG(4) << "PPB_MediaStreamVideoTrack::GetId()";
51 EnterResource
<PPB_MediaStreamVideoTrack_API
> enter(video_track
, true);
53 return PP_MakeUndefined();
54 return enter
.object()->GetId();
57 PP_Bool
HasEnded(PP_Resource video_track
) {
58 VLOG(4) << "PPB_MediaStreamVideoTrack::HasEnded()";
59 EnterResource
<PPB_MediaStreamVideoTrack_API
> enter(video_track
, true);
62 return enter
.object()->HasEnded();
65 int32_t GetFrame(PP_Resource video_track
,
67 struct PP_CompletionCallback callback
) {
68 VLOG(4) << "PPB_MediaStreamVideoTrack::GetFrame()";
69 EnterResource
<PPB_MediaStreamVideoTrack_API
> enter(video_track
,
73 return enter
.retval();
74 return enter
.SetResult(enter
.object()->GetFrame(frame
, enter
.callback()));
77 int32_t RecycleFrame(PP_Resource video_track
, PP_Resource frame
) {
78 VLOG(4) << "PPB_MediaStreamVideoTrack::RecycleFrame()";
79 EnterResource
<PPB_MediaStreamVideoTrack_API
> enter(video_track
, true);
81 return enter
.retval();
82 return enter
.object()->RecycleFrame(frame
);
85 void Close(PP_Resource video_track
) {
86 VLOG(4) << "PPB_MediaStreamVideoTrack::Close()";
87 EnterResource
<PPB_MediaStreamVideoTrack_API
> enter(video_track
, true);
90 enter
.object()->Close();
93 const PPB_MediaStreamVideoTrack_0_1 g_ppb_mediastreamvideotrack_thunk_0_1
= {
94 &IsMediaStreamVideoTrack
,
106 PPAPI_THUNK_EXPORT
const PPB_MediaStreamVideoTrack_0_1
*
107 GetPPB_MediaStreamVideoTrack_0_1_Thunk() {
108 return &g_ppb_mediastreamvideotrack_thunk_0_1
;