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

Side by Side Diff: content/renderer/media/media_stream_impl.cc

Issue 15979015: Reland 15721002: Hook up the device selection to the WebAudio live audio (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed the comments. 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) 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 "content/renderer/media/media_stream_impl.h" 5 #include "content/renderer/media/media_stream_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 (type == WebKit::WebMediaStreamSource::TypeAudio) ? "a" : "v"; 84 (type == WebKit::WebMediaStreamSource::TypeAudio) ? "a" : "v";
85 std::string source_id = base::StringPrintf("%s%s%u", label.c_str(), 85 std::string source_id = base::StringPrintf("%s%s%u", label.c_str(),
86 track_type, 86 track_type,
87 static_cast<unsigned int>(i)); 87 static_cast<unsigned int>(i));
88 webkit_sources[i].initialize( 88 webkit_sources[i].initialize(
89 UTF8ToUTF16(source_id), 89 UTF8ToUTF16(source_id),
90 type, 90 type,
91 UTF8ToUTF16(devices[i].device.name)); 91 UTF8ToUTF16(devices[i].device.name));
92 webkit_sources[i].setExtraData( 92 webkit_sources[i].setExtraData(
93 new content::MediaStreamSourceExtraData(devices[i], webkit_sources[i])); 93 new content::MediaStreamSourceExtraData(devices[i], webkit_sources[i]));
94 webkit_sources[i].setDeviceId(UTF8ToUTF16(devices[i].device.id.c_str())); 94 webkit_sources[i].setDeviceId(UTF8ToUTF16(
95 base::IntToString(devices[i].session_id)));
95 } 96 }
96 } 97 }
97 98
98 webrtc::MediaStreamInterface* GetNativeMediaStream( 99 webrtc::MediaStreamInterface* GetNativeMediaStream(
99 const WebKit::WebMediaStream& descriptor) { 100 const WebKit::WebMediaStream& descriptor) {
100 content::MediaStreamExtraData* extra_data = 101 content::MediaStreamExtraData* extra_data =
101 static_cast<content::MediaStreamExtraData*>(descriptor.extraData()); 102 static_cast<content::MediaStreamExtraData*>(descriptor.extraData());
102 if (!extra_data) 103 if (!extra_data)
103 return NULL; 104 return NULL;
104 return extra_data->stream().get(); 105 return extra_data->stream().get();
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 } 626 }
626 627
627 for (size_t i = 0; i < video_sources.size(); ++i) { 628 for (size_t i = 0; i < video_sources.size(); ++i) {
628 video_sources[i].setReadyState( 629 video_sources[i].setReadyState(
629 WebKit::WebMediaStreamSource::ReadyStateEnded); 630 WebKit::WebMediaStreamSource::ReadyStateEnded);
630 video_sources[i].setExtraData(NULL); 631 video_sources[i].setExtraData(NULL);
631 } 632 }
632 } 633 }
633 634
634 } // namespace content 635 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698