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

Side by Side Diff: content/public/renderer/media_stream_source_api.cc

Issue 883293005: Cast: Basic cast_receiver API for chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missed include file changes Created 5 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
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/public/renderer/media_stream_source_api.h"
6
7 #include "base/callback.h"
8 #include "base/strings/utf_string_conversions.h"
9 #include "content/renderer/media/media_stream_audio_source.h"
10 #include "content/renderer/media/media_stream_video_capturer_source.h"
11 #include "media/base/audio_capturer_source.h"
12 #include "media/base/video_capturer_source.h"
13 #include "third_party/WebKit/public/platform/WebMediaDeviceInfo.h"
14 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h"
15
16 namespace content {
17
18 void InitializeVideoWebMediaStreamSource(
19 scoped_refptr<media::VideoCapturerSource> source,
20 blink::WebMediaStreamSource* webkit_source) {
21 webkit_source->initialize(base::UTF8ToUTF16(""),
22 blink::WebMediaStreamSource::TypeVideo,
23 base::UTF8ToUTF16(""),
24 true /* remote */,
perkj_chrome 2015/02/09 14:50:27 Remote means that this is something you receive. r
hubbe 2015/02/09 20:13:32 I've added and documented these arguments to the A
25 true /* readonly */);
26 webkit_source->setExtraData(
27 new content::MediaStreamVideoCapturerSource(
perkj_chrome 2015/02/09 14:50:27 We had a few discussion regarding inheritance and
hubbe 2015/02/09 20:13:32 I started out with trying to do this, but MediaStr
28 StreamDeviceInfo(),
perkj_chrome 2015/02/09 14:50:27 Humm, StreamDeviceInfo seems wrong here. Its only
hubbe 2015/02/09 20:13:32 Fixed the constructor to not require the device in
29 content::MediaStreamSource::SourceStoppedCallback(),
30 source));
31 }
32
33 void InitializeAudioWebMediaStreamSource(
34 scoped_refptr<media::AudioCapturerSource> source,
35 blink::WebMediaStreamSource* webkit_source) {
36 webkit_source->initialize(base::UTF8ToUTF16(""),
37 blink::WebMediaStreamSource::TypeAudio,
38 base::UTF8ToUTF16(""),
39 true /* remote */,
40 true /* readonly */);
41 MediaStreamAudioSource* audio_source(
42 new MediaStreamAudioSource(
43 -1,
44 StreamDeviceInfo(),
45 content::MediaStreamSource::SourceStoppedCallback(),
46 RenderThreadImpl::current()->GetPeerConnectionDependencyFactory()));
47 scoped_refptr<WebRtcAudioCapturer> capturer(
48 WebRtcAudioCapturer::CreateCapturer(
49 -1,
perkj_chrome 2015/02/09 14:50:27 indentation
hubbe 2015/02/09 20:13:32 Done.
50 StreamDeviceInfo(),
51 blink::WebMediaConstraints(),
52 NULL,
53 audio_source));
54 media::AudioParameters params;
55 capturer->SetCapturerSource(source, params);
56 audio_source->SetAudioCapturer(capturer);
57 webkit_source->setExtraData(audio_source);
58 }
59
60 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698