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