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

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

Issue 1903663002: Build dynamic iOS SDK. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix test gyp Created 4 years, 8 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
« no previous file with comments | « webrtc/api/objc/RTCVideoTrack+Private.h ('k') | webrtc/api/objc/avfoundationvideocapturer.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 WEBRTC_API_OBJC_AVFOUNDATION_VIDEO_CAPTURER_H_
12 #define WEBRTC_API_OBJC_AVFOUNDATION_VIDEO_CAPTURER_H_
13
14 #include "webrtc/base/scoped_ptr.h"
15 #include "webrtc/media/base/videocapturer.h"
16 #include "webrtc/video_frame.h"
17
18 #import <AVFoundation/AVFoundation.h>
19
20 @class RTCAVFoundationVideoCapturerInternal;
21
22 namespace rtc {
23 class Thread;
24 } // namespace rtc
25
26 namespace webrtc {
27
28 class AVFoundationVideoCapturer : public cricket::VideoCapturer,
29 public rtc::MessageHandler {
30 public:
31 AVFoundationVideoCapturer();
32 ~AVFoundationVideoCapturer();
33
34 cricket::CaptureState Start(const cricket::VideoFormat& format) override;
35 void Stop() override;
36 bool IsRunning() override;
37 bool IsScreencast() const override {
38 return false;
39 }
40 bool GetPreferredFourccs(std::vector<uint32_t> *fourccs) override {
41 fourccs->push_back(cricket::FOURCC_NV12);
42 return true;
43 }
44
45 // Returns the active capture session. Calls to the capture session should
46 // occur on the RTCDispatcherTypeCaptureSession queue in RTCDispatcher.
47 AVCaptureSession* GetCaptureSession();
48
49 // Returns whether the rear-facing camera can be used.
50 // e.g. It can't be used because it doesn't exist.
51 bool CanUseBackCamera() const;
52
53 // Switches the camera being used (either front or back).
54 void SetUseBackCamera(bool useBackCamera);
55 bool GetUseBackCamera() const;
56
57 // Converts the sample buffer into a cricket::CapturedFrame and signals the
58 // frame for capture.
59 void CaptureSampleBuffer(CMSampleBufferRef sampleBuffer);
60
61 // Handles messages from posts.
62 void OnMessage(rtc::Message *msg) override;
63
64 private:
65 void OnFrameMessage(CVImageBufferRef image_buffer, int64_t capture_time);
66
67 RTCAVFoundationVideoCapturerInternal *_capturer;
68 rtc::Thread *_startThread; // Set in Start(), unset in Stop().
69 }; // AVFoundationVideoCapturer
70
71 } // namespace webrtc
72
73 #endif // WEBRTC_API_OBJC_AVFOUNDATION_VIDEO_CAPTURER_H_
OLDNEW
« no previous file with comments | « webrtc/api/objc/RTCVideoTrack+Private.h ('k') | webrtc/api/objc/avfoundationvideocapturer.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698