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

Side by Side Diff: webrtc/api/objc/avfoundationvideocapturer.h

Issue 1416303003: Handle iOS devices with no rear-facing camera (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Changes based on feedback Created 4 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 22 matching lines...) Expand all
33 return false; 33 return false;
34 } 34 }
35 bool GetPreferredFourccs(std::vector<uint32_t> *fourccs) override { 35 bool GetPreferredFourccs(std::vector<uint32_t> *fourccs) override {
36 fourccs->push_back(cricket::FOURCC_NV12); 36 fourccs->push_back(cricket::FOURCC_NV12);
37 return true; 37 return true;
38 } 38 }
39 39
40 /** Returns the active capture session. */ 40 /** Returns the active capture session. */
41 AVCaptureSession* GetCaptureSession(); 41 AVCaptureSession* GetCaptureSession();
42 42
43 /**
44 * Returns whether the rear-facing camera can be used.
45 * e.g. It can't be used because it doesn't exist.
46 */
47 bool CanUseBackCamera() const;
48
43 /** Switches the camera being used (either front or back). */ 49 /** Switches the camera being used (either front or back). */
44 void SetUseBackCamera(bool useBackCamera); 50 void SetUseBackCamera(bool useBackCamera);
45 bool GetUseBackCamera() const; 51 bool GetUseBackCamera() const;
46 52
47 /** 53 /**
48 * Converts the sample buffer into a cricket::CapturedFrame and signals the 54 * Converts the sample buffer into a cricket::CapturedFrame and signals the
49 * frame for capture. 55 * frame for capture.
50 */ 56 */
51 void CaptureSampleBuffer(CMSampleBufferRef sampleBuffer); 57 void CaptureSampleBuffer(CMSampleBufferRef sampleBuffer);
52 58
53 private: 59 private:
54 /** 60 /**
55 * Used to signal frame capture on the thread that capturer was started on. 61 * Used to signal frame capture on the thread that capturer was started on.
56 */ 62 */
57 void SignalFrameCapturedOnStartThread(const cricket::CapturedFrame *frame); 63 void SignalFrameCapturedOnStartThread(const cricket::CapturedFrame *frame);
58 64
59 RTCAVFoundationVideoCapturerInternal *_capturer; 65 RTCAVFoundationVideoCapturerInternal *_capturer;
60 rtc::Thread *_startThread; // Set in Start(), unset in Stop(). 66 rtc::Thread *_startThread; // Set in Start(), unset in Stop().
61 }; // AVFoundationVideoCapturer 67 }; // AVFoundationVideoCapturer
62 68
63 } // namespace webrtc 69 } // namespace webrtc
64 70
65 #endif // TALK_APP_WEBRTC_OBJC_AVFOUNDATION_CAPTURER_H_ 71 #endif // TALK_APP_WEBRTC_OBJC_AVFOUNDATION_CAPTURER_H_
OLDNEW
« no previous file with comments | « webrtc/api/objc/RTCAVFoundationVideoSource.mm ('k') | webrtc/api/objc/avfoundationvideocapturer.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698