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

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: Create "NaCl style" image data on host side. 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
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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 is_open_ = true; 91 is_open_ = true;
92 open_callback_->Run(result); 92 open_callback_->Run(result);
93 } 93 }
94 } 94 }
95 95
96 void VideoSourceResource::OnPluginMsgGetFrameComplete( 96 void VideoSourceResource::OnPluginMsgGetFrameComplete(
97 PP_VideoFrame_Private* frame, 97 PP_VideoFrame_Private* frame,
98 const ResourceMessageReplyParams& reply_params, 98 const ResourceMessageReplyParams& reply_params,
99 const HostResource& image_data, 99 const HostResource& image_data,
100 const PP_ImageDataDesc& image_desc, 100 const PP_ImageDataDesc& image_desc,
101 int fd, 101 int shmem_key,
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(TOOLKIT_GTK)
dmichael (off chromium) 2013/06/05 01:54:42 What's this case for? Can you just use the SharedM
bbudge 2013/06/05 02:05:03 The difficulty is that the ImageData constructor t
bbudge 2013/06/19 00:22:32 This issue was solved by the recent ImageData refa
111 frame->image_data = 0;
112 #elif defined(TOOLKIT_GTK)
113 frame->image_data = 111 frame->image_data =
114 (new ImageData(image_data, image_desc, fd))->GetReference(); 112 (new ImageData(image_data, image_desc, shmem_key))->GetReference();
115 #elif defined(OS_LINUX) || defined(OS_WIN) || defined(OS_MACOSX) 113 #elif defined(OS_POSIX) || defined(OS_WIN)
116 base::SharedMemoryHandle handle; 114 base::SharedMemoryHandle handle;
117 if (!reply_params.TakeSharedMemoryHandleAtIndex(0, &handle)) 115 if (!reply_params.TakeSharedMemoryHandleAtIndex(0, &handle))
118 frame->image_data = 0; 116 frame->image_data = 0;
119 frame->image_data = 117 frame->image_data =
120 (new ImageData(image_data, image_desc, handle))->GetReference(); 118 (new ImageData(image_data, image_desc, handle))->GetReference();
121 #else 119 #else
122 #error Not implemented. 120 #error Not implemented.
123 #endif 121 #endif
124 } 122 }
125 get_frame_callback_->Run(result); 123 get_frame_callback_->Run(result);
126 } 124 }
127 } 125 }
128 126
129 } // namespace proxy 127 } // namespace proxy
130 } // namespace ppapi 128 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698