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

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

Issue 2634263002: Pass camera facing info to audio client (Closed)
Patch Set: Address comments Created 3 years, 10 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 VideoCaptureObserverAdapter::VideoCaptureObserverAdapter(
29 chromeos::VideoCaptureObserver* observer)
30 : observer_(observer) {}
31 #endif
32
33 VideoCaptureObserverAdapter::VideoCaptureObserverAdapter()
34 #if defined(OS_CHROMEOS)
35 : observer_(NULL)
36 #endif
37 {
38 }
39
40 void VideoCaptureObserverAdapter::OnVideoCaptureStarted(
41 VideoFacingMode facing) {
42 #if defined(OS_CHROMEOS)
43 if (observer_ != NULL) {
44 observer_->OnVideoCaptureStarted(ConvertVideoFacing(facing));
45 }
46 #endif
47 }
48
49 void VideoCaptureObserverAdapter::OnVideoCaptureStopped(
50 VideoFacingMode facing) {
51 #if defined(OS_CHROMEOS)
52 if (observer_ != NULL) {
53 observer_->OnVideoCaptureStopped(ConvertVideoFacing(facing));
54 }
55 #endif
56 }
57 }
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