OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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_completion_callback.h" | 5 #include "ppapi/c/pp_completion_callback.h" |
6 #include "ppapi/c/pp_errors.h" | 6 #include "ppapi/c/pp_errors.h" |
7 #include "ppapi/c/private/pp_video_frame_private.h" | 7 #include "ppapi/c/private/pp_video_frame_private.h" |
8 #include "ppapi/c/private/ppb_video_destination_private.h" | 8 #include "ppapi/c/private/ppb_video_destination_private.h" |
9 #include "ppapi/shared_impl/tracked_callback.h" | 9 #include "ppapi/shared_impl/tracked_callback.h" |
10 #include "ppapi/thunk/enter.h" | 10 #include "ppapi/thunk/enter.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 if (enter.failed()) | 38 if (enter.failed()) |
39 return enter.retval(); | 39 return enter.retval(); |
40 return enter.SetResult(enter.object()->Open(stream_url, enter.callback())); | 40 return enter.SetResult(enter.object()->Open(stream_url, enter.callback())); |
41 } | 41 } |
42 | 42 |
43 int32_t PutFrame(PP_Resource destination, | 43 int32_t PutFrame(PP_Resource destination, |
44 const PP_VideoFrame_Private* frame) { | 44 const PP_VideoFrame_Private* frame) { |
45 EnterResource<PPB_VideoDestination_Private_API> enter(destination, true); | 45 EnterResource<PPB_VideoDestination_Private_API> enter(destination, true); |
46 if (enter.failed()) | 46 if (enter.failed()) |
47 return enter.retval(); | 47 return enter.retval(); |
48 return enter.SetResult(enter.object()->PutFrame(*frame)); | 48 return enter.object()->PutFrame(*frame); |
49 } | 49 } |
50 | 50 |
51 void Close(PP_Resource destination) { | 51 void Close(PP_Resource destination) { |
52 EnterResource<PPB_VideoDestination_Private_API> enter(destination, true); | 52 EnterResource<PPB_VideoDestination_Private_API> enter(destination, true); |
53 if (enter.succeeded()) | 53 if (enter.succeeded()) |
54 enter.object()->Close(); | 54 enter.object()->Close(); |
55 } | 55 } |
56 | 56 |
57 const PPB_VideoDestination_Private_0_1 | 57 const PPB_VideoDestination_Private_0_1 |
58 g_ppb_video_destination_private_thunk_0_1 = { | 58 g_ppb_video_destination_private_thunk_0_1 = { |
59 &Create, | 59 &Create, |
60 &IsVideoDestination, | 60 &IsVideoDestination, |
61 &Open, | 61 &Open, |
62 &PutFrame, | 62 &PutFrame, |
63 &Close | 63 &Close |
64 }; | 64 }; |
65 | 65 |
66 } // namespace | 66 } // namespace |
67 | 67 |
68 const PPB_VideoDestination_Private_0_1* | 68 const PPB_VideoDestination_Private_0_1* |
69 GetPPB_VideoDestination_Private_0_1_Thunk() { | 69 GetPPB_VideoDestination_Private_0_1_Thunk() { |
70 return &g_ppb_video_destination_private_thunk_0_1; | 70 return &g_ppb_video_destination_private_thunk_0_1; |
71 } | 71 } |
72 | 72 |
73 } // namespace thunk | 73 } // namespace thunk |
74 } // namespace ppapi | 74 } // namespace ppapi |
OLD | NEW |