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

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

Issue 1559753002: Move RTCAVFoundationCapturer to webrtc/api/objc. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@updateRTCVideoSource
Patch Set: Created 4 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
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #ifndef TALK_APP_WEBRTC_OBJC_AVFOUNDATION_VIDEO_CAPTURER_H_
12 #define TALK_APP_WEBRTC_OBJC_AVFOUNDATION_VIDEO_CAPTURER_H_
13
14 #include "talk/media/base/videocapturer.h"
15 #include "webrtc/base/scoped_ptr.h"
16 #include "webrtc/video_frame.h"
17
18 #import <AVFoundation/AVFoundation.h>
19
20 NS_ASSUME_NONNULL_BEGIN
tkchin_webrtc 2016/01/14 01:45:46 I wouldn't use NONNULL stuff in a C++ header.
hjon 2016/01/14 19:54:12 Done.
21
22 @class RTCAVFoundationVideoCapturerInternal;
23
24 namespace webrtc {
25
26 class AVFoundationVideoCapturer : public cricket::VideoCapturer {
27 public:
28 AVFoundationVideoCapturer();
29 ~AVFoundationVideoCapturer();
30
31 cricket::CaptureState Start(const cricket::VideoFormat& format) override;
32 void Stop() override;
33 bool IsRunning() override;
34 bool IsScreencast() const override {
35 return false;
36 }
37 bool GetPreferredFourccs(std::vector<uint32_t> *fourccs) override {
38 fourccs->push_back(cricket::FOURCC_NV12);
39 return true;
40 }
41
42 // Returns the active capture session.
43 AVCaptureSession* GetCaptureSession();
44
45 // Switches the camera being used (either front or back).
46 void SetUseBackCamera(bool useBackCamera);
47 bool GetUseBackCamera() const;
48
49 // Converts the sample buffer into a cricket::CapturedFrame and signals the
50 // frame for capture.
51 void CaptureSampleBuffer(CMSampleBufferRef sampleBuffer);
52
53 private:
54 // Used to signal frame capture on the thread that capturer was started on.
55 void SignalFrameCapturedOnStartThread(const cricket::CapturedFrame *frame);
56
57 RTCAVFoundationVideoCapturerInternal *_capturer;
58 rtc::Thread *_startThread; // Set in Start(), unset in Stop().
59 }; // AVFoundationVideoCapturer
60
61 } // namespace webrtc
62
63 #endif // TALK_APP_WEBRTC_OBJC_AVFOUNDATION_CAPTURER_H_
64
65
66 NS_ASSUME_NONNULL_END
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698