| OLD | NEW | 
|---|
| (Empty) |  | 
|  | 1 // Copyright 2016 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/base/video_facing.h" | 
|  | 6 | 
|  | 7 #if defined(OS_CHROMEOS) | 
|  | 8 namespace { | 
|  | 9 | 
|  | 10 chromeos::VideoFacingMode ConvertVideoFacing(media::VideoFacingMode facing) { | 
|  | 11   switch (facing) { | 
|  | 12     case media::VideoFacingMode::MEDIA_VIDEO_FACING_NONE: | 
|  | 13     case media::VideoFacingMode::NUM_MEDIA_VIDEO_FACING_MODE: | 
|  | 14       return chromeos::VideoFacingMode::NONE; | 
|  | 15     case media::VideoFacingMode::MEDIA_VIDEO_FACING_USER: | 
|  | 16       return chromeos::VideoFacingMode::USER; | 
|  | 17     case media::VideoFacingMode::MEDIA_VIDEO_FACING_ENVIRONMENT: | 
|  | 18       return chromeos::VideoFacingMode::ENVIRONMENT; | 
|  | 19   } | 
|  | 20   return chromeos::VideoFacingMode::NONE; | 
|  | 21 } | 
|  | 22 } | 
|  | 23 #endif | 
|  | 24 | 
|  | 25 namespace media { | 
|  | 26 | 
|  | 27 #if defined(OS_CHROMEOS) | 
|  | 28 VideoCaptureObserver::VideoCaptureObserver( | 
|  | 29     chromeos::VideoCaptureObserver* observer) | 
|  | 30     : observer_(observer) {} | 
|  | 31 #endif | 
|  | 32 | 
|  | 33 VideoCaptureObserver::VideoCaptureObserver() | 
|  | 34 #if defined(OS_CHROMEOS) | 
|  | 35     : observer_(NULL) | 
|  | 36 #endif | 
|  | 37 { | 
|  | 38 } | 
|  | 39 | 
|  | 40 void VideoCaptureObserver::OnVideoCaptureStarted(VideoFacingMode facing) { | 
|  | 41 #if defined(OS_CHROMEOS) | 
|  | 42   if (observer_ != NULL) { | 
|  | 43     observer_->OnVideoCaptureStarted(ConvertVideoFacing(facing)); | 
|  | 44   } | 
|  | 45 #endif | 
|  | 46 } | 
|  | 47 | 
|  | 48 void VideoCaptureObserver::OnVideoCaptureStopped(VideoFacingMode facing) { | 
|  | 49 #if defined(OS_CHROMEOS) | 
|  | 50   if (observer_ != NULL) { | 
|  | 51     observer_->OnVideoCaptureStopped(ConvertVideoFacing(facing)); | 
|  | 52   } | 
|  | 53 #endif | 
|  | 54 } | 
|  | 55 } | 
| OLD | NEW | 
|---|