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

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

Issue 140783004: [PPAPI] Pepper MediaStream API audio track implementation and example. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix review issues Created 6 years, 10 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
« no previous file with comments | « ppapi/proxy/media_stream_video_track_resource.cc ('k') | ppapi/proxy/ppapi_messages.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 #include "ppapi/proxy/plugin_var_tracker.h" 5 #include "ppapi/proxy/plugin_var_tracker.h"
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "ipc/ipc_message.h" 9 #include "ipc/ipc_message.h"
10 #include "ppapi/c/dev/ppp_class_deprecated.h" 10 #include "ppapi/c/dev/ppp_class_deprecated.h"
11 #include "ppapi/c/ppb_var.h" 11 #include "ppapi/c/ppb_var.h"
12 #include "ppapi/proxy/file_system_resource.h" 12 #include "ppapi/proxy/file_system_resource.h"
13 #include "ppapi/proxy/media_stream_audio_track_resource.h"
13 #include "ppapi/proxy/media_stream_video_track_resource.h" 14 #include "ppapi/proxy/media_stream_video_track_resource.h"
14 #include "ppapi/proxy/plugin_array_buffer_var.h" 15 #include "ppapi/proxy/plugin_array_buffer_var.h"
15 #include "ppapi/proxy/plugin_dispatcher.h" 16 #include "ppapi/proxy/plugin_dispatcher.h"
16 #include "ppapi/proxy/plugin_globals.h" 17 #include "ppapi/proxy/plugin_globals.h"
17 #include "ppapi/proxy/plugin_resource_var.h" 18 #include "ppapi/proxy/plugin_resource_var.h"
18 #include "ppapi/proxy/ppapi_messages.h" 19 #include "ppapi/proxy/ppapi_messages.h"
19 #include "ppapi/proxy/proxy_object_var.h" 20 #include "ppapi/proxy/proxy_object_var.h"
20 #include "ppapi/shared_impl/api_id.h" 21 #include "ppapi/shared_impl/api_id.h"
21 #include "ppapi/shared_impl/ppapi_globals.h" 22 #include "ppapi/shared_impl/ppapi_globals.h"
22 #include "ppapi/shared_impl/proxy_lock.h" 23 #include "ppapi/shared_impl/proxy_lock.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 // Note: This only makes sense when the plugin is out of process (which 189 // Note: This only makes sense when the plugin is out of process (which
189 // should always be true when passing resource vars). 190 // should always be true when passing resource vars).
190 PP_Resource pp_resource = 191 PP_Resource pp_resource =
191 (new FileSystemResource(GetConnectionForInstance(instance), 192 (new FileSystemResource(GetConnectionForInstance(instance),
192 instance, 193 instance,
193 pending_renderer_id, 194 pending_renderer_id,
194 pending_browser_id, 195 pending_browser_id,
195 file_system_type))->GetReference(); 196 file_system_type))->GetReference();
196 return MakeResourcePPVar(pp_resource); 197 return MakeResourcePPVar(pp_resource);
197 } 198 }
199 case PpapiPluginMsg_MediaStreamAudioTrack_CreateFromPendingHost::ID: {
200 DCHECK(pending_renderer_id);
201 std::string track_id;
202 if (!UnpackMessage<
203 PpapiPluginMsg_MediaStreamAudioTrack_CreateFromPendingHost>(
204 creation_message, &track_id)) {
205 NOTREACHED() <<
206 "Invalid message of type "
207 "PpapiPluginMsg_MediaStreamAudioTrack_CreateFromPendingHost";
208 return PP_MakeNull();
209 }
210 PP_Resource pp_resource =
211 (new MediaStreamAudioTrackResource(GetConnectionForInstance(instance),
212 instance,
213 pending_renderer_id,
214 track_id))->GetReference();
215 return MakeResourcePPVar(pp_resource);
216 }
198 case PpapiPluginMsg_MediaStreamVideoTrack_CreateFromPendingHost::ID: { 217 case PpapiPluginMsg_MediaStreamVideoTrack_CreateFromPendingHost::ID: {
199 DCHECK(pending_renderer_id); 218 DCHECK(pending_renderer_id);
200 std::string track_id; 219 std::string track_id;
201 if (!UnpackMessage< 220 if (!UnpackMessage<
202 PpapiPluginMsg_MediaStreamVideoTrack_CreateFromPendingHost>( 221 PpapiPluginMsg_MediaStreamVideoTrack_CreateFromPendingHost>(
203 creation_message, &track_id)) { 222 creation_message, &track_id)) {
204 NOTREACHED() << 223 NOTREACHED() <<
205 "Invalid message of type " 224 "Invalid message of type "
206 "PpapiPluginMsg_MediaStreamVideoTrack_CreateFromPendingHost"; 225 "PpapiPluginMsg_MediaStreamVideoTrack_CreateFromPendingHost";
207 return PP_MakeNull(); 226 return PP_MakeNull();
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 int id, 508 int id,
490 PP_Instance instance, 509 PP_Instance instance,
491 base::SharedMemoryHandle* handle, 510 base::SharedMemoryHandle* handle,
492 uint32* size_in_bytes) { 511 uint32* size_in_bytes) {
493 NOTREACHED(); 512 NOTREACHED();
494 return false; 513 return false;
495 } 514 }
496 515
497 } // namesace proxy 516 } // namesace proxy
498 } // namespace ppapi 517 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/media_stream_video_track_resource.cc ('k') | ppapi/proxy/ppapi_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698