OLD | NEW |
| (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 #ifndef CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_API_H_ | |
6 #define CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_API_H_ | |
7 | |
8 #include "content/common/content_export.h" | |
9 #include "media/base/audio_capturer_source.h" | |
10 #include "media/base/channel_layout.h" | |
11 #include "media/base/video_capture_types.h" | |
12 #include "media/base/video_capturer_source.h" | |
13 | |
14 namespace blink { | |
15 class WebMediaStream; | |
16 class WebMediaStreamTrack; | |
17 } | |
18 | |
19 namespace content { | |
20 // These methods create a WebMediaStreamSource + MediaStreamSource pair with the | |
21 // provided audio or video capturer source. A new WebMediaStreamTrack + | |
22 // MediaStreamTrack pair is created, connected to the source and is plugged into | |
23 // the WebMediaStream (|web_media_stream|). | |
24 // |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 | |
26 // MediaTrackConstraints. | |
27 CONTENT_EXPORT bool AddVideoTrackToMediaStream( | |
28 scoped_ptr<media::VideoCapturerSource> video_source, | |
29 bool is_remote, | |
30 bool is_readonly, | |
31 blink::WebMediaStream* web_media_stream); | |
32 | |
33 // |sample_rate|, |channel_layout|, and |frames_per_buffer| specify the audio | |
34 // parameters of the track. Generally, these should match the |audio_source| so | |
35 // that it does not have to perform unnecessary sample rate conversion or | |
36 // channel mixing. | |
37 CONTENT_EXPORT bool AddAudioTrackToMediaStream( | |
38 scoped_refptr<media::AudioCapturerSource> audio_source, | |
39 int sample_rate, | |
40 media::ChannelLayout channel_layout, | |
41 int frames_per_buffer, | |
42 bool is_remote, | |
43 bool is_readonly, | |
44 blink::WebMediaStream* web_media_stream); | |
45 | |
46 // On success returns pointer to the current format of the given video track; | |
47 // returns nullptr on failure (if the argument is invalid or if the format | |
48 // cannot be retrieved at the moment). | |
49 CONTENT_EXPORT const media::VideoCaptureFormat* GetCurrentVideoTrackFormat( | |
50 const blink::WebMediaStreamTrack& video_track); | |
51 | |
52 } // namespace content | |
53 | |
54 #endif // CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_API_H_ | |
OLD | NEW |