This repository was archived by the owner on Oct 25, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +19
-18
lines changed
webrtc/sdk/objc/Framework Expand file tree Collapse file tree 6 files changed +19
-18
lines changed Original file line number Diff line number Diff line change @@ -89,9 +89,9 @@ - (RTCAVFoundationVideoSource *)avFoundationVideoSourceWithConstraints:
89
89
}
90
90
91
91
- (RTCVideoSource *)videoSource {
92
- rtc::scoped_refptr<webrtc::ObjcVideoTrackSource> objc_video_track_source (
92
+ rtc::scoped_refptr<webrtc::ObjcVideoTrackSource> objcVideoTrackSource (
93
93
new rtc::RefCountedObject<webrtc::ObjcVideoTrackSource>());
94
- return [[RTCVideoSource alloc ] initWithNativeVideoSource: objc_video_track_source ];
94
+ return [[RTCVideoSource alloc ] initWithNativeVideoSource: objcVideoTrackSource ];
95
95
}
96
96
97
97
- (RTCVideoTrack *)videoTrackWithSource : (RTCVideoSource *)source
Original file line number Diff line number Diff line change 10
10
11
11
#import " WebRTC/RTCVideoCapturer.h"
12
12
13
- @implementation RTCVideoCapturer {
14
- __weak id <RTCVideoCapturerDelegate> _delegate;
15
- }
13
+ @implementation RTCVideoCapturer
14
+
15
+ @synthesize delegate = _delegate;
16
16
17
17
- (instancetype )initWithDelegate : (id <RTCVideoCapturerDelegate>)delegate {
18
+ NSAssert (delegate != nil , @" delegate cannot be nil" );
18
19
if (self = [super init ]) {
19
20
_delegate = delegate;
20
21
}
21
22
return self;
22
23
}
23
24
24
- - (id <RTCVideoCapturerDelegate>)delegate {
25
- return _delegate;
26
- }
27
-
28
25
@end
Original file line number Diff line number Diff line change 11
11
#ifndef WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_OBJCVIDEOTRACKSOURCE_H_
12
12
#define WEBRTC_SDK_OBJC_FRAMEWORK_CLASSES_OBJCVIDEOTRACKSOURCE_H_
13
13
14
- #import < WebRTC/RTCVideoFrame.h>
15
-
14
+ #include " WebRTC/RTCMacros.h"
16
15
#include " webrtc/base/timestampaligner.h"
17
16
#include " webrtc/media/base/adaptedvideotracksource.h"
18
17
18
+ RTC_FWD_DECL_OBJC_CLASS (RTCVideoFrame);
19
+
19
20
namespace webrtc {
20
21
21
22
class ObjcVideoTrackSource : public rtc ::AdaptedVideoTrackSource {
Original file line number Diff line number Diff line change @@ -46,6 +46,9 @@ RTC_EXPORT
46
46
- (RTCAVFoundationVideoSource *)avFoundationVideoSourceWithConstraints :
47
47
(nullable RTCMediaConstraints *)constraints ;
48
48
49
+ /* * Initialize a generic RTCVideoSource. The RTCVideoSource should be passed to a RTCVideoCapturer
50
+ * implementation, e.g. RTCCameraVideoCapturer, in order to produce frames.
51
+ */
49
52
- (RTCVideoSource *)videoSource ;
50
53
51
54
/* * Initialize an RTCVideoTrack with a source and an id. */
Original file line number Diff line number Diff line change @@ -15,14 +15,17 @@ NS_ASSUME_NONNULL_BEGIN
15
15
@class RTCVideoCapturer;
16
16
17
17
RTC_EXPORT
18
-
19
- @protocol RTCVideoCapturerDelegate
18
+ @protocol RTCVideoCapturerDelegate <NSObject >
20
19
- (void )capturer : (RTCVideoCapturer *)capturer didCaptureVideoFrame : (RTCVideoFrame *)frame ;
21
20
@end
22
21
22
+ RTC_EXPORT
23
23
@interface RTCVideoCapturer : NSObject
24
- - ( instancetype ) initWithDelegate : ( id <RTCVideoCapturerDelegate>) delegate ;
24
+
25
25
@property (nonatomic , readonly , weak ) id <RTCVideoCapturerDelegate> delegate;
26
+
27
+ - (instancetype )initWithDelegate : (id <RTCVideoCapturerDelegate>)delegate ;
28
+
26
29
@end
27
30
28
31
NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change @@ -18,13 +18,10 @@ NS_ASSUME_NONNULL_BEGIN
18
18
19
19
RTC_EXPORT
20
20
21
- @interface RTCVideoSource : RTCMediaSource <RTCVideoCapturerDelegate>
21
+ @interface RTCVideoSource : RTCMediaSource <RTCVideoCapturerDelegate>
22
22
23
23
- (instancetype )init NS_UNAVAILABLE;
24
24
25
- // RTCVideoCapturerDelegate protocol implementation.
26
- - (void )capturer : (RTCVideoCapturer*)capturer didCaptureVideoFrame : (RTCVideoFrame*)frame ;
27
-
28
25
/* *
29
26
* Calling this function will cause frames to be scaled down to the
30
27
* requested resolution. Also, frames will be cropped to match the
You can’t perform that action at this time.
0 commit comments