Skip to content

Instantly share code, notes, and snippets.

@lyokato
Created June 12, 2017 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lyokato/e00b83cbef7fa502107f3bc67888197a to your computer and use it in GitHub Desktop.
Save lyokato/e00b83cbef7fa502107f3bc67888197a to your computer and use it in GitHub Desktop.
WebRTC iOS SDK用 Video Source Filter 実装例1
@interface MyVideoSourceFilter : NSObject<RTCVideoCapturerDelegate>
- (instancetype)initWithSource:(RTCVideoSource *)source;
@end
@implementation MyVideoSourceFilter
- (instancetype)initWithSource:(RTCVideoSource *)source {
if (self = [super init]) {
self.source = source;
}
return self;
}
- (void)capturer:(RTCVideoCapturer *)capturer didCaptureVideoFrame:(RTCVideoFrame *)frame {
// ここでframeに対してフィルタ処理を行い
// その後VideoSourceに流す
[self.source capturer didCaptureVideoFrame:frame];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment