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_UTILS_H_ | 5 #ifndef CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_UTILS_H_ |
6 #define CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_UTILS_H_ | 6 #define CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_UTILS_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // These methods create a WebMediaStreamSource + MediaStreamSource pair with the | 26 // These methods create a WebMediaStreamSource + MediaStreamSource pair with the |
27 // provided audio or video capturer source. A new WebMediaStreamTrack + | 27 // provided audio or video capturer source. A new WebMediaStreamTrack + |
28 // MediaStreamTrack pair is created, connected to the source and is plugged into | 28 // MediaStreamTrack pair is created, connected to the source and is plugged into |
29 // the WebMediaStream (|web_media_stream|). | 29 // the WebMediaStream (|web_media_stream|). |
30 // |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. |
31 // |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 |
32 // MediaTrackConstraints. | 32 // MediaTrackConstraints. |
33 CONTENT_EXPORT bool AddVideoTrackToMediaStream( | 33 CONTENT_EXPORT bool AddVideoTrackToMediaStream( |
34 std::unique_ptr<media::VideoCapturerSource> video_source, | 34 std::unique_ptr<media::VideoCapturerSource> video_source, |
35 bool is_remote, | 35 bool is_remote, |
36 bool is_readonly, | |
37 blink::WebMediaStream* web_media_stream); | 36 blink::WebMediaStream* web_media_stream); |
38 | 37 |
39 // |sample_rate|, |channel_layout|, and |frames_per_buffer| specify the audio | 38 // |sample_rate|, |channel_layout|, and |frames_per_buffer| specify the audio |
40 // parameters of the track. Generally, these should match the |audio_source| so | 39 // parameters of the track. Generally, these should match the |audio_source| so |
41 // that it does not have to perform unnecessary sample rate conversion or | 40 // that it does not have to perform unnecessary sample rate conversion or |
42 // channel mixing. | 41 // channel mixing. |
43 CONTENT_EXPORT bool AddAudioTrackToMediaStream( | 42 CONTENT_EXPORT bool AddAudioTrackToMediaStream( |
44 scoped_refptr<media::AudioCapturerSource> audio_source, | 43 scoped_refptr<media::AudioCapturerSource> audio_source, |
45 int sample_rate, | 44 int sample_rate, |
46 media::ChannelLayout channel_layout, | 45 media::ChannelLayout channel_layout, |
47 int frames_per_buffer, | 46 int frames_per_buffer, |
48 bool is_remote, | 47 bool is_remote, |
49 bool is_readonly, | |
50 blink::WebMediaStream* web_media_stream); | 48 blink::WebMediaStream* web_media_stream); |
51 | 49 |
52 // On success returns pointer to the current format of the given video track; | 50 // On success returns pointer to the current format of the given video track; |
53 // returns nullptr on failure (if the argument is invalid or if the format | 51 // returns nullptr on failure (if the argument is invalid or if the format |
54 // cannot be retrieved at the moment). | 52 // cannot be retrieved at the moment). |
55 CONTENT_EXPORT const media::VideoCaptureFormat* GetCurrentVideoTrackFormat( | 53 CONTENT_EXPORT const media::VideoCaptureFormat* GetCurrentVideoTrackFormat( |
56 const blink::WebMediaStreamTrack& video_track); | 54 const blink::WebMediaStreamTrack& video_track); |
57 | 55 |
58 // Requests that a refresh frame be sent "soon" (e.g., to resolve picture loss | 56 // Requests that a refresh frame be sent "soon" (e.g., to resolve picture loss |
59 // or quality issues). | 57 // or quality issues). |
60 CONTENT_EXPORT void RequestRefreshFrameFromVideoTrack( | 58 CONTENT_EXPORT void RequestRefreshFrameFromVideoTrack( |
61 const blink::WebMediaStreamTrack& video_track); | 59 const blink::WebMediaStreamTrack& video_track); |
62 | 60 |
63 } // namespace content | 61 } // namespace content |
64 | 62 |
65 #endif // CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_UTILS_H_ | 63 #endif // CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_UTILS_H_ |
OLD | NEW |