| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 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 #include "media/capture/video/linux/video_capture_observer_chromeos.h" |
| 6 |
| 7 namespace { |
| 8 |
| 9 chromeos::VideoFacingMode ConvertVideoFacing(media::VideoFacingMode facing) { |
| 10 switch (facing) { |
| 11 case media::VideoFacingMode::MEDIA_VIDEO_FACING_NONE: |
| 12 case media::VideoFacingMode::NUM_MEDIA_VIDEO_FACING_MODE: |
| 13 return chromeos::VideoFacingMode::NONE; |
| 14 case media::VideoFacingMode::MEDIA_VIDEO_FACING_USER: |
| 15 return chromeos::VideoFacingMode::USER; |
| 16 case media::VideoFacingMode::MEDIA_VIDEO_FACING_ENVIRONMENT: |
| 17 return chromeos::VideoFacingMode::ENVIRONMENT; |
| 18 } |
| 19 return chromeos::VideoFacingMode::NONE; |
| 20 } |
| 21 } |
| 22 |
| 23 namespace media { |
| 24 |
| 25 VideoCaptureObserverChromeOS::VideoCaptureObserverChromeOS( |
| 26 chromeos::VideoCaptureObserver* observer) |
| 27 : observer_(observer) {} |
| 28 |
| 29 VideoCaptureObserverChromeOS::VideoCaptureObserverChromeOS() |
| 30 : observer_(NULL) {} |
| 31 |
| 32 void VideoCaptureObserverChromeOS::OnVideoCaptureStarted( |
| 33 VideoFacingMode facing) { |
| 34 if (observer_ != NULL) { |
| 35 observer_->OnVideoCaptureStarted(ConvertVideoFacing(facing)); |
| 36 } |
| 37 } |
| 38 |
| 39 void VideoCaptureObserverChromeOS::OnVideoCaptureStopped( |
| 40 VideoFacingMode facing) { |
| 41 if (observer_ != NULL) { |
| 42 observer_->OnVideoCaptureStopped(ConvertVideoFacing(facing)); |
| 43 } |
| 44 } |
| 45 } |
| OLD | NEW |