| 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> |
| 9 |
| 8 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 11 #include "media/base/channel_layout.h" | 12 #include "media/base/channel_layout.h" |
| 12 #include "media/base/video_capture_types.h" | 13 #include "media/base/video_capture_types.h" |
| 13 | 14 |
| 14 namespace blink { | 15 namespace blink { |
| 15 class WebMediaStream; | 16 class WebMediaStream; |
| 16 class WebMediaStreamTrack; | 17 class WebMediaStreamTrack; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace media { | 20 namespace media { |
| 20 class AudioCapturerSource; | 21 class AudioCapturerSource; |
| 21 class VideoCapturerSource; | 22 class VideoCapturerSource; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace content { | 25 namespace content { |
| 25 // These methods create a WebMediaStreamSource + MediaStreamSource pair with the | 26 // These methods create a WebMediaStreamSource + MediaStreamSource pair with the |
| 26 // provided audio or video capturer source. A new WebMediaStreamTrack + | 27 // provided audio or video capturer source. A new WebMediaStreamTrack + |
| 27 // 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 |
| 28 // the WebMediaStream (|web_media_stream|). | 29 // the WebMediaStream (|web_media_stream|). |
| 29 // |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. |
| 30 // |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 |
| 31 // MediaTrackConstraints. | 32 // MediaTrackConstraints. |
| 32 CONTENT_EXPORT bool AddVideoTrackToMediaStream( | 33 CONTENT_EXPORT bool AddVideoTrackToMediaStream( |
| 33 scoped_ptr<media::VideoCapturerSource> video_source, | 34 std::unique_ptr<media::VideoCapturerSource> video_source, |
| 34 bool is_remote, | 35 bool is_remote, |
| 35 bool is_readonly, | 36 bool is_readonly, |
| 36 blink::WebMediaStream* web_media_stream); | 37 blink::WebMediaStream* web_media_stream); |
| 37 | 38 |
| 38 // |sample_rate|, |channel_layout|, and |frames_per_buffer| specify the audio | 39 // |sample_rate|, |channel_layout|, and |frames_per_buffer| specify the audio |
| 39 // parameters of the track. Generally, these should match the |audio_source| so | 40 // parameters of the track. Generally, these should match the |audio_source| so |
| 40 // that it does not have to perform unnecessary sample rate conversion or | 41 // that it does not have to perform unnecessary sample rate conversion or |
| 41 // channel mixing. | 42 // channel mixing. |
| 42 CONTENT_EXPORT bool AddAudioTrackToMediaStream( | 43 CONTENT_EXPORT bool AddAudioTrackToMediaStream( |
| 43 scoped_refptr<media::AudioCapturerSource> audio_source, | 44 scoped_refptr<media::AudioCapturerSource> audio_source, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 55 const blink::WebMediaStreamTrack& video_track); | 56 const blink::WebMediaStreamTrack& video_track); |
| 56 | 57 |
| 57 // Requests that a refresh frame be sent "soon" (e.g., to resolve picture loss | 58 // Requests that a refresh frame be sent "soon" (e.g., to resolve picture loss |
| 58 // or quality issues). | 59 // or quality issues). |
| 59 CONTENT_EXPORT void RequestRefreshFrameFromVideoTrack( | 60 CONTENT_EXPORT void RequestRefreshFrameFromVideoTrack( |
| 60 const blink::WebMediaStreamTrack& video_track); | 61 const blink::WebMediaStreamTrack& video_track); |
| 61 | 62 |
| 62 } // namespace content | 63 } // namespace content |
| 63 | 64 |
| 64 #endif // CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_UTILS_H_ | 65 #endif // CONTENT_PUBLIC_RENDERER_MEDIA_STREAM_UTILS_H_ |
| OLD | NEW |