OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_API_H_ | 5 #ifndef CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_API_H_ |
6 #define CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_API_H_ | 6 #define CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_API_H_ |
7 | 7 |
8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
9 #include "media/base/audio_capturer_source.h" | 9 #include "media/base/audio_capturer_source.h" |
10 #include "media/base/video_capturer_source.h" | 10 #include "media/base/video_capturer_source.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 class WebMediaStreamSource; | 13 class WebMediaStream; |
14 } | 14 } |
15 | 15 |
16 namespace Media { | 16 namespace media { |
17 class AudioParameters; | 17 class AudioParameters; |
18 } | 18 } |
19 | 19 |
20 namespace content { | 20 namespace content { |
21 | 21 // These methods create a WebMediaStreamSource + MediaStreamSource pair with the |
22 // These two methods will initialize a WebMediaStreamSource object to take | 22 // provided audio or video capturer source. A new WebMediaStreamTrack + |
23 // data from the provided audio or video capturer source. | 23 // MediaStreamTrack pair is created, holding the previous MediaStreamSource, and |
| 24 // is plugged into the stream identified by |media_stream_url| (or passed as |
| 25 // |web_stream|). |
24 // |is_remote| should be true if the source of the data is not a local device. | 26 // |is_remote| should be true if the source of the data is not a local device. |
25 // |is_readonly| should be true if the format of the data cannot be changed by | 27 // |is_readonly| should be true if the format of the data cannot be changed by |
26 // MediaTrackConstraints. | 28 // MediaTrackConstraints. |
27 CONTENT_EXPORT bool AddVideoTrackToMediaStream( | 29 CONTENT_EXPORT bool AddVideoTrackToMediaStream( |
28 scoped_ptr<media::VideoCapturerSource> source, | 30 scoped_ptr<media::VideoCapturerSource> source, |
29 bool is_remote, | 31 bool is_remote, |
30 bool is_readonly, | 32 bool is_readonly, |
31 const std::string& media_stream_url); | 33 const std::string& media_stream_url); |
| 34 CONTENT_EXPORT bool AddVideoTrackToMediaStream( |
| 35 scoped_ptr<media::VideoCapturerSource> source, |
| 36 bool is_remote, |
| 37 bool is_readonly, |
| 38 blink::WebMediaStream* web_stream); |
| 39 |
32 CONTENT_EXPORT bool AddAudioTrackToMediaStream( | 40 CONTENT_EXPORT bool AddAudioTrackToMediaStream( |
33 scoped_refptr<media::AudioCapturerSource> source, | 41 const scoped_refptr<media::AudioCapturerSource>& source, |
34 const media::AudioParameters& params, | 42 const media::AudioParameters& params, |
35 bool is_remote, | 43 bool is_remote, |
36 bool is_readonly, | 44 bool is_readonly, |
37 const std::string& media_stream_url); | 45 const std::string& media_stream_url); |
38 | 46 |
39 } // namespace content | 47 } // namespace content |
40 | 48 |
41 #endif // CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_API_H_ | 49 #endif // CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_API_H_ |
OLD | NEW |