| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 return false; | 49 return false; |
| 50 } | 50 } |
| 51 bool GetPreferredFourccs(std::vector<uint32_t>* fourccs) override { | 51 bool GetPreferredFourccs(std::vector<uint32_t>* fourccs) override { |
| 52 fourccs->push_back(cricket::FOURCC_NV12); | 52 fourccs->push_back(cricket::FOURCC_NV12); |
| 53 return true; | 53 return true; |
| 54 } | 54 } |
| 55 | 55 |
| 56 // Returns the active capture session. | 56 // Returns the active capture session. |
| 57 AVCaptureSession* GetCaptureSession(); | 57 AVCaptureSession* GetCaptureSession(); |
| 58 | 58 |
| 59 // Returns whether the rear-facing camera can be used. |
| 60 // e.g. It can't be used because it doesn't exist. |
| 61 bool CanUseBackCamera() const; |
| 62 |
| 59 // Switches the camera being used (either front or back). | 63 // Switches the camera being used (either front or back). |
| 60 void SetUseBackCamera(bool useBackCamera); | 64 void SetUseBackCamera(bool useBackCamera); |
| 61 bool GetUseBackCamera() const; | 65 bool GetUseBackCamera() const; |
| 62 | 66 |
| 63 // Converts the sample buffer into a cricket::CapturedFrame and signals the | 67 // Converts the sample buffer into a cricket::CapturedFrame and signals the |
| 64 // frame for capture. | 68 // frame for capture. |
| 65 void CaptureSampleBuffer(CMSampleBufferRef sampleBuffer); | 69 void CaptureSampleBuffer(CMSampleBufferRef sampleBuffer); |
| 66 | 70 |
| 67 private: | 71 private: |
| 68 // Used to signal frame capture on the thread that capturer was started on. | 72 // Used to signal frame capture on the thread that capturer was started on. |
| 69 void SignalFrameCapturedOnStartThread(const cricket::CapturedFrame* frame); | 73 void SignalFrameCapturedOnStartThread(const cricket::CapturedFrame* frame); |
| 70 | 74 |
| 71 RTCAVFoundationVideoCapturerInternal* _capturer; | 75 RTCAVFoundationVideoCapturerInternal* _capturer; |
| 72 rtc::Thread* _startThread; // Set in Start(), unset in Stop(). | 76 rtc::Thread* _startThread; // Set in Start(), unset in Stop(). |
| 73 }; // AVFoundationVideoCapturer | 77 }; // AVFoundationVideoCapturer |
| 74 | 78 |
| 75 } // namespace webrtc | 79 } // namespace webrtc |
| 76 | 80 |
| 77 #endif // TALK_APP_WEBRTC_OBJC_AVFOUNDATION_CAPTURER_H_ | 81 #endif // TALK_APP_WEBRTC_OBJC_AVFOUNDATION_CAPTURER_H_ |
| OLD | NEW |