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

Side by Side Diff: ppapi/proxy/video_source_resource.cc

Issue 16335018: Add NaCl proxies for Pepper Video Source and Destination resources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't register APIs twice. Created 7 years, 6 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/proxy/resource_creation_proxy.cc ('k') | ppapi/thunk/interfaces_ppb_private.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/proxy/video_source_resource.h" 5 #include "ppapi/proxy/video_source_resource.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "ipc/ipc_message.h" 8 #include "ipc/ipc_message.h"
9 #include "ppapi/c/pp_errors.h" 9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/c/private/pp_video_frame_private.h" 10 #include "ppapi/c/private/pp_video_frame_private.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 int fd, 101 int fd,
102 PP_TimeTicks timestamp) { 102 PP_TimeTicks timestamp) {
103 // The callback may have been aborted by Close(). 103 // The callback may have been aborted by Close().
104 if (TrackedCallback::IsPending(get_frame_callback_)) { 104 if (TrackedCallback::IsPending(get_frame_callback_)) {
105 int32_t result = reply_params.result(); 105 int32_t result = reply_params.result();
106 if (result == PP_OK && 106 if (result == PP_OK &&
107 PPB_ImageData_Shared::IsImageDataDescValid(image_desc)) { 107 PPB_ImageData_Shared::IsImageDataDescValid(image_desc)) {
108 frame->timestamp = timestamp; 108 frame->timestamp = timestamp;
109 109
110 #if defined(OS_ANDROID) 110 #if defined(OS_ANDROID)
111 frame->image_data = 0; 111 frame->image_data = 0;
dmichael (off chromium) 2013/06/04 17:10:49 Do we do OS_ANDROID checks anywhere else in PPAPI?
bbudge 2013/06/04 23:46:28 Done.
112 #elif defined(TOOLKIT_GTK) 112 #elif defined(TOOLKIT_GTK)
113 frame->image_data = 113 frame->image_data =
114 (new ImageData(image_data, image_desc, fd))->GetReference(); 114 (new ImageData(image_data, image_desc, fd))->GetReference();
115 #elif defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MACOSX) 115 #elif defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MACOSX) || \
116 defined(OS_NACL)
116 base::SharedMemoryHandle handle; 117 base::SharedMemoryHandle handle;
117 if (!reply_params.TakeSharedMemoryHandleAtIndex(0, &handle)) 118 if (!reply_params.TakeSharedMemoryHandleAtIndex(0, &handle))
118 frame->image_data = 0; 119 frame->image_data = 0;
119 frame->image_data = 120 frame->image_data =
120 (new ImageData(image_data, image_desc, handle))->GetReference(); 121 (new ImageData(image_data, image_desc, handle))->GetReference();
121 #else 122 #else
122 #error Not implemented. 123 #error Not implemented.
123 #endif 124 #endif
124 } 125 }
125 get_frame_callback_->Run(result); 126 get_frame_callback_->Run(result);
126 } 127 }
127 } 128 }
128 129
129 } // namespace proxy 130 } // namespace proxy
130 } // namespace ppapi 131 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/resource_creation_proxy.cc ('k') | ppapi/thunk/interfaces_ppb_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698