| Index: content/renderer/media/media_stream_video_capturer_source.cc
|
| diff --git a/content/renderer/media/media_stream_video_capturer_source.cc b/content/renderer/media/media_stream_video_capturer_source.cc
|
| index 8734698c46c9f91c78988fa4c8474a0107bc4c38..73d6f6174a8ab371cbcdf2766037fecb5d125407 100644
|
| --- a/content/renderer/media/media_stream_video_capturer_source.cc
|
| +++ b/content/renderer/media/media_stream_video_capturer_source.cc
|
| @@ -216,6 +216,7 @@ class LocalVideoCapturerSource final : public media::VideoCapturerSource {
|
| void MaybeSuspend() override;
|
| void Resume() override;
|
| void StopCapture() override;
|
| + media::CameraFacing GetCameraFacing() override;
|
|
|
| private:
|
| void OnStateUpdate(VideoCaptureState state);
|
| @@ -226,6 +227,8 @@ class LocalVideoCapturerSource final : public media::VideoCapturerSource {
|
| // |session_id_| identifies the capture device used for this capture session.
|
| const media::VideoCaptureSessionId session_id_;
|
|
|
| + const VideoFacingMode facing_;
|
| +
|
| VideoCaptureImplManager* const manager_;
|
|
|
| const base::Closure release_device_cb_;
|
| @@ -256,6 +259,7 @@ class LocalVideoCapturerSource final : public media::VideoCapturerSource {
|
| LocalVideoCapturerSource::LocalVideoCapturerSource(
|
| const StreamDeviceInfo& device_info)
|
| : session_id_(device_info.session_id),
|
| + facing_(device_info.device.video_facing),
|
| manager_(RenderThreadImpl::current()->video_capture_impl_manager()),
|
| release_device_cb_(manager_->UseDevice(session_id_)),
|
| is_content_capture_(IsContentVideoCaptureDevice(device_info)),
|
| @@ -347,6 +351,17 @@ void LocalVideoCapturerSource::StopCapture() {
|
| formats_enumerated_callback_.Reset();
|
| }
|
|
|
| +media::CameraFacing LocalVideoCapturerSource::GetCameraFacing() {
|
| + switch (facing_) {
|
| + case VideoFacingMode::MEDIA_VIDEO_FACING_USER:
|
| + return media::CameraFacing::FRONT;
|
| + case VideoFacingMode::MEDIA_VIDEO_FACING_ENVIRONMENT:
|
| + return media::CameraFacing::BACK;
|
| + default:
|
| + return media::CameraFacing::DEFAULT;
|
| + }
|
| +}
|
| +
|
| void LocalVideoCapturerSource::OnStateUpdate(VideoCaptureState state) {
|
| DVLOG(3) << __func__ << " state = " << state;
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| @@ -440,6 +455,10 @@ MediaStreamVideoCapturerSource::MediaStreamVideoCapturerSource(
|
| MediaStreamVideoCapturerSource::~MediaStreamVideoCapturerSource() {
|
| }
|
|
|
| +media::CameraFacing MediaStreamVideoCapturerSource::GetCameraFacing() {
|
| + return source_->GetCameraFacing();
|
| +}
|
| +
|
| void MediaStreamVideoCapturerSource::RequestRefreshFrame() {
|
| source_->RequestRefreshFrame();
|
| }
|
|
|