Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Side by Side Diff: ppapi/thunk/ppb_video_source_private_thunk.cc

Issue 13771020: Add Pepper VideoReader and VideoWriter plumbing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase, clean up some headers. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/thunk/ppb_video_source_private_api.h ('k') | ppapi/thunk/resource_creation_api.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 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.
4
5 #include "ppapi/c/pp_completion_callback.h"
6 #include "ppapi/c/pp_errors.h"
7 #include "ppapi/c/private/pp_video_frame_private.h"
8 #include "ppapi/c/private/ppb_video_source_private.h"
9 #include "ppapi/shared_impl/tracked_callback.h"
10 #include "ppapi/thunk/enter.h"
11 #include "ppapi/thunk/ppb_video_source_private_api.h"
12 #include "ppapi/thunk/resource_creation_api.h"
13 #include "ppapi/thunk/thunk.h"
14
15 namespace ppapi {
16 namespace thunk {
17
18 namespace {
19
20 PP_Resource Create(PP_Instance instance) {
21 EnterResourceCreation enter(instance);
22 if (enter.failed())
23 return 0;
24 return enter.functions()->CreateVideoSource(instance);
25 }
26
27 PP_Bool IsVideoSource(PP_Resource resource) {
28 EnterResource<PPB_VideoSource_Private_API> enter(resource, false);
29 return PP_FromBool(enter.succeeded());
30 }
31
32 int32_t Open(PP_Resource source,
33 PP_Var stream_url,
34 PP_CompletionCallback callback) {
35 EnterResource<PPB_VideoSource_Private_API> enter(source, callback, true);
36 if (enter.failed())
37 return enter.retval();
38 return enter.SetResult(enter.object()->Open(stream_url, enter.callback()));
39 }
40
41 int32_t GetFrame(PP_Resource source,
42 PP_VideoFrame_Private* frame,
43 PP_CompletionCallback callback) {
44 EnterResource<PPB_VideoSource_Private_API> enter(source, callback, true);
45 if (enter.failed())
46 return enter.retval();
47 return enter.SetResult(enter.object()->GetFrame(frame, enter.callback()));
48 }
49
50 void Close(PP_Resource source) {
51 EnterResource<PPB_VideoSource_Private_API> enter(source, true);
52 if (enter.succeeded())
53 enter.object()->Close();
54 }
55
56 const PPB_VideoSource_Private_0_1 g_ppb_video_source_private_thunk_0_1 = {
57 &Create,
58 &IsVideoSource,
59 &Open,
60 &GetFrame,
61 &Close
62 };
63
64 } // namespace
65
66 const PPB_VideoSource_Private_0_1* GetPPB_VideoSource_Private_0_1_Thunk() {
67 return &g_ppb_video_source_private_thunk_0_1;
68 }
69
70 } // namespace thunk
71 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/thunk/ppb_video_source_private_api.h ('k') | ppapi/thunk/resource_creation_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698