Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: media/base/video_facing.cc

Issue 2634263002: Pass camera facing info to audio client (Closed)
Patch Set: refactor to pass VideoCaptureObserver in setters, not in ctor Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« media/base/video_facing.h ('K') | « media/base/video_facing.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 }
OLDNEW
« media/base/video_facing.h ('K') | « media/base/video_facing.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698