summaryrefslogtreecommitdiff
path: root/app/webrtc/objc/public
diff options
context:
space:
mode:
Diffstat (limited to 'app/webrtc/objc/public')
-rw-r--r--app/webrtc/objc/public/RTCEAGLVideoView.h7
-rw-r--r--app/webrtc/objc/public/RTCI420Frame.h2
-rw-r--r--app/webrtc/objc/public/RTCNSGLVideoView.h5
-rw-r--r--app/webrtc/objc/public/RTCVideoRenderer.h27
-rw-r--r--app/webrtc/objc/public/RTCVideoTrack.h9
5 files changed, 13 insertions, 37 deletions
diff --git a/app/webrtc/objc/public/RTCEAGLVideoView.h b/app/webrtc/objc/public/RTCEAGLVideoView.h
index c38799e..526175f 100644
--- a/app/webrtc/objc/public/RTCEAGLVideoView.h
+++ b/app/webrtc/objc/public/RTCEAGLVideoView.h
@@ -37,11 +37,10 @@
@end
-@class RTCVideoTrack;
-// RTCEAGLVideoView renders |videoTrack| onto itself using OpenGLES.
-@interface RTCEAGLVideoView : UIView
+// RTCEAGLVideoView is an RTCVideoRenderer which renders i420 frames in its
+// bounds using OpenGLES 2.0.
+@interface RTCEAGLVideoView : UIView <RTCVideoRenderer>
-@property(nonatomic, strong) RTCVideoTrack* videoTrack;
@property(nonatomic, weak) id<RTCEAGLVideoViewDelegate> delegate;
@end
diff --git a/app/webrtc/objc/public/RTCI420Frame.h b/app/webrtc/objc/public/RTCI420Frame.h
index 737968c..7a8c4d4 100644
--- a/app/webrtc/objc/public/RTCI420Frame.h
+++ b/app/webrtc/objc/public/RTCI420Frame.h
@@ -43,6 +43,8 @@
@property(nonatomic, readonly) NSInteger uPitch;
@property(nonatomic, readonly) NSInteger vPitch;
+- (BOOL)makeExclusive;
+
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// Disallow init and don't add to documentation
- (id)init __attribute__((
diff --git a/app/webrtc/objc/public/RTCNSGLVideoView.h b/app/webrtc/objc/public/RTCNSGLVideoView.h
index fd757cb..0af2dc5 100644
--- a/app/webrtc/objc/public/RTCNSGLVideoView.h
+++ b/app/webrtc/objc/public/RTCNSGLVideoView.h
@@ -31,7 +31,7 @@
#import <AppKit/NSOpenGLView.h>
-#import "RTCVideoTrack.h"
+#import "RTCVideoRenderer.h"
@class RTCNSGLVideoView;
@protocol RTCNSGLVideoViewDelegate
@@ -40,9 +40,8 @@
@end
-@interface RTCNSGLVideoView : NSOpenGLView
+@interface RTCNSGLVideoView : NSOpenGLView <RTCVideoRenderer>
-@property(nonatomic, strong) RTCVideoTrack* videoTrack;
@property(nonatomic, weak) id<RTCNSGLVideoViewDelegate> delegate;
@end
diff --git a/app/webrtc/objc/public/RTCVideoRenderer.h b/app/webrtc/objc/public/RTCVideoRenderer.h
index 37977ce..3c2baba 100644
--- a/app/webrtc/objc/public/RTCVideoRenderer.h
+++ b/app/webrtc/objc/public/RTCVideoRenderer.h
@@ -31,34 +31,13 @@
#endif
@class RTCI420Frame;
-@class RTCVideoRenderer;
-// RTCVideoRendererDelegate is a protocol for an object that must be
-// implemented to get messages when rendering.
-@protocol RTCVideoRendererDelegate<NSObject>
+@protocol RTCVideoRenderer<NSObject>
// The size of the frame.
-- (void)renderer:(RTCVideoRenderer*)renderer didSetSize:(CGSize)size;
+- (void)setSize:(CGSize)size;
// The frame to be displayed.
-- (void)renderer:(RTCVideoRenderer*)renderer
- didReceiveFrame:(RTCI420Frame*)frame;
-
-@end
-
-// Interface for rendering VideoFrames from a VideoTrack
-@interface RTCVideoRenderer : NSObject
-
-@property(nonatomic, weak) id<RTCVideoRendererDelegate> delegate;
-
-// Initialize the renderer. Requires a delegate which does the actual drawing
-// of frames.
-- (instancetype)initWithDelegate:(id<RTCVideoRendererDelegate>)delegate;
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-// Disallow init and don't add to documentation
-- (id)init __attribute__((
- unavailable("init is not a supported initializer for this class.")));
-#endif /* DOXYGEN_SHOULD_SKIP_THIS */
+- (void)renderFrame:(RTCI420Frame*)frame;
@end
diff --git a/app/webrtc/objc/public/RTCVideoTrack.h b/app/webrtc/objc/public/RTCVideoTrack.h
index 291c923..8385b71 100644
--- a/app/webrtc/objc/public/RTCVideoTrack.h
+++ b/app/webrtc/objc/public/RTCVideoTrack.h
@@ -27,19 +27,16 @@
#import "RTCMediaStreamTrack.h"
-@class RTCVideoRenderer;
+@protocol RTCVideoRenderer;
// RTCVideoTrack is an ObjectiveC wrapper for VideoTrackInterface.
@interface RTCVideoTrack : RTCMediaStreamTrack
-// The currently registered renderers.
-@property(nonatomic, strong, readonly) NSArray *renderers;
-
// Register a renderer that will render all frames received on this track.
-- (void)addRenderer:(RTCVideoRenderer *)renderer;
+- (void)addRenderer:(id<RTCVideoRenderer>)renderer;
// Deregister a renderer.
-- (void)removeRenderer:(RTCVideoRenderer *)renderer;
+- (void)removeRenderer:(id<RTCVideoRenderer>)renderer;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// Disallow init and don't add to documentation