OLD | NEW |
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 Loading... |
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_ |
OLD | NEW |