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

Side by Side Diff: ppapi/proxy/serialized_structs.h

Issue 11274036: Refactor video capture to new design (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: export Created 8 years, 1 month 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
« no previous file with comments | « ppapi/proxy/resource_message_params.cc ('k') | ppapi/proxy/video_capture_resource.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef PPAPI_PROXY_SERIALIZED_STRUCTS_H_ 5 #ifndef PPAPI_PROXY_SERIALIZED_STRUCTS_H_
6 #define PPAPI_PROXY_SERIALIZED_STRUCTS_H_ 6 #define PPAPI_PROXY_SERIALIZED_STRUCTS_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 struct PPBURLLoader_UpdateProgress_Params { 75 struct PPBURLLoader_UpdateProgress_Params {
76 PP_Instance instance; 76 PP_Instance instance;
77 ppapi::HostResource resource; 77 ppapi::HostResource resource;
78 int64_t bytes_sent; 78 int64_t bytes_sent;
79 int64_t total_bytes_to_be_sent; 79 int64_t total_bytes_to_be_sent;
80 int64_t bytes_received; 80 int64_t bytes_received;
81 int64_t total_bytes_to_be_received; 81 int64_t total_bytes_to_be_received;
82 }; 82 };
83 83
84 struct PPPVideoCapture_Buffer {
85 ppapi::HostResource resource;
86 uint32_t size;
87 base::SharedMemoryHandle handle;
88 };
89
90 // We put all our handles in a unified structure to make it easy to translate 84 // We put all our handles in a unified structure to make it easy to translate
91 // them in NaClIPCAdapter for use in NaCl. 85 // them in NaClIPCAdapter for use in NaCl.
92 class PPAPI_PROXY_EXPORT SerializedHandle { 86 class PPAPI_PROXY_EXPORT SerializedHandle {
93 public: 87 public:
94 enum Type { INVALID, SHARED_MEMORY, SOCKET, CHANNEL_HANDLE }; 88 enum Type { INVALID, SHARED_MEMORY, SOCKET, CHANNEL_HANDLE };
95 struct Header { 89 struct Header {
96 Header() : type(INVALID), size(0) {} 90 Header() : type(INVALID), size(0) {}
97 Header(Type type_arg, uint32_t size_arg) 91 Header(Type type_arg, uint32_t size_arg)
98 : type(type_arg), size(size_arg) { 92 : type(type_arg), size(size_arg) {
99 } 93 }
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 // we add more complex things later, we should come up with a more memory- 176 // we add more complex things later, we should come up with a more memory-
183 // efficient strategy. 177 // efficient strategy.
184 // These are valid if type == SHARED_MEMORY. 178 // These are valid if type == SHARED_MEMORY.
185 base::SharedMemoryHandle shm_handle_; 179 base::SharedMemoryHandle shm_handle_;
186 uint32_t size_; 180 uint32_t size_;
187 181
188 // This is valid if type == SOCKET || type == CHANNEL_HANDLE. 182 // This is valid if type == SOCKET || type == CHANNEL_HANDLE.
189 IPC::PlatformFileForTransit descriptor_; 183 IPC::PlatformFileForTransit descriptor_;
190 }; 184 };
191 185
192 // TODO(tomfinegan): This is identical to PPPVideoCapture_Buffer, maybe replace
193 // both with a single type?
194 struct PPPDecryptor_Buffer { 186 struct PPPDecryptor_Buffer {
195 ppapi::HostResource resource; 187 ppapi::HostResource resource;
196 uint32_t size; 188 uint32_t size;
197 base::SharedMemoryHandle handle; 189 base::SharedMemoryHandle handle;
198 }; 190 };
199 191
200 #if defined(OS_WIN) 192 #if defined(OS_WIN)
201 typedef HANDLE ImageHandle; 193 typedef HANDLE ImageHandle;
202 #elif defined(OS_MACOSX) || defined(OS_ANDROID) 194 #elif defined(OS_MACOSX) || defined(OS_ANDROID)
203 typedef base::SharedMemoryHandle ImageHandle; 195 typedef base::SharedMemoryHandle ImageHandle;
204 #else 196 #else
205 // On X Windows this is a SysV shared memory key. 197 // On X Windows this is a SysV shared memory key.
206 typedef int ImageHandle; 198 typedef int ImageHandle;
207 #endif 199 #endif
208 200
209 } // namespace proxy 201 } // namespace proxy
210 } // namespace ppapi 202 } // namespace ppapi
211 203
212 #endif // PPAPI_PROXY_SERIALIZED_STRUCTS_H_ 204 #endif // PPAPI_PROXY_SERIALIZED_STRUCTS_H_
OLDNEW
« no previous file with comments | « ppapi/proxy/resource_message_params.cc ('k') | ppapi/proxy/video_capture_resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698