| 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/channel_layout.h" |
| 10 #include "media/base/video_capturer_source.h" | 11 #include "media/base/video_capturer_source.h" |
| 11 | 12 |
| 12 namespace blink { | 13 namespace blink { |
| 13 class WebMediaStream; | 14 class WebMediaStream; |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace media { | |
| 17 class AudioParameters; | |
| 18 } | |
| 19 | |
| 20 namespace content { | 17 namespace content { |
| 21 // These methods create a WebMediaStreamSource + MediaStreamSource pair with the | 18 // These methods create a WebMediaStreamSource + MediaStreamSource pair with the |
| 22 // provided audio or video capturer source. A new WebMediaStreamTrack + | 19 // provided audio or video capturer source. A new WebMediaStreamTrack + |
| 23 // MediaStreamTrack pair is created, holding the previous MediaStreamSource, and | 20 // MediaStreamTrack pair is created, connected to the source and is plugged into |
| 24 // is plugged into the stream identified by |media_stream_url| (or passed as | 21 // the WebMediaStream (|web_media_stream|). |
| 25 // |web_stream|). | |
| 26 // |is_remote| should be true if the source of the data is not a local device. | 22 // |is_remote| should be true if the source of the data is not a local device. |
| 27 // |is_readonly| should be true if the format of the data cannot be changed by | 23 // |is_readonly| should be true if the format of the data cannot be changed by |
| 28 // MediaTrackConstraints. | 24 // MediaTrackConstraints. |
| 29 CONTENT_EXPORT bool AddVideoTrackToMediaStream( | 25 CONTENT_EXPORT bool AddVideoTrackToMediaStream( |
| 30 scoped_ptr<media::VideoCapturerSource> source, | 26 scoped_ptr<media::VideoCapturerSource> video_source, |
| 31 bool is_remote, | 27 bool is_remote, |
| 32 bool is_readonly, | 28 bool is_readonly, |
| 33 const std::string& media_stream_url); | 29 blink::WebMediaStream* web_media_stream); |
| 34 CONTENT_EXPORT bool AddVideoTrackToMediaStream( | 30 |
| 35 scoped_ptr<media::VideoCapturerSource> source, | 31 // |sample_rate|, |channel_layout|, and |frames_per_buffer| specify the audio |
| 32 // parameters of the track. Generally, these should match the |audio_source| so |
| 33 // that it does not have to perform unnecessary sample rate conversion or |
| 34 // channel mixing. |
| 35 CONTENT_EXPORT bool AddAudioTrackToMediaStream( |
| 36 scoped_refptr<media::AudioCapturerSource> audio_source, |
| 37 int sample_rate, |
| 38 media::ChannelLayout channel_layout, |
| 39 int frames_per_buffer, |
| 36 bool is_remote, | 40 bool is_remote, |
| 37 bool is_readonly, | 41 bool is_readonly, |
| 38 blink::WebMediaStream* web_stream); | 42 blink::WebMediaStream* web_media_stream); |
| 39 | |
| 40 CONTENT_EXPORT bool AddAudioTrackToMediaStream( | |
| 41 const scoped_refptr<media::AudioCapturerSource>& source, | |
| 42 const media::AudioParameters& params, | |
| 43 bool is_remote, | |
| 44 bool is_readonly, | |
| 45 const std::string& media_stream_url); | |
| 46 CONTENT_EXPORT bool AddAudioTrackToMediaStream( | |
| 47 const scoped_refptr<media::AudioCapturerSource>& source, | |
| 48 bool is_remote, | |
| 49 bool is_readonly, | |
| 50 blink::WebMediaStream* web_stream); | |
| 51 | 43 |
| 52 } // namespace content | 44 } // namespace content |
| 53 | 45 |
| 54 #endif // CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_API_H_ | 46 #endif // CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_API_H_ |
| OLD | NEW |