1 /* 2 * Copyright 2017 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 #import <Foundation/Foundation.h> 12 13 #import "RTCVideoCapturer.h" 14 15 NS_ASSUME_NONNULL_BEGIN 16 17 /** 18 * Error passing block. 19 */ 20 typedef void (^RTCFileVideoCapturerErrorBlock)(NSError *error); 21 22 /** 23 * Captures buffers from bundled video file. 24 * 25 * See @c RTCVideoCapturer for more info on capturers. 26 */ 27 RTC_OBJC_EXPORT 28 29 NS_CLASS_AVAILABLE_IOS(10) 30 @interface RTC_OBJC_TYPE (RTCFileVideoCapturer) : RTC_OBJC_TYPE(RTCVideoCapturer) 31 32 /** 33 * Starts asynchronous capture of frames from video file. 34 * 35 * Capturing is not started if error occurs. Underlying error will be 36 * relayed in the errorBlock if one is provided. 37 * Successfully captured video frames will be passed to the delegate. 38 * 39 * @param nameOfFile The name of the bundled video file to be read. 40 * @errorBlock block to be executed upon error. 41 */ 42 - (void)startCapturingFromFileNamed:(NSString *)nameOfFile 43 onError:(__nullable RTCFileVideoCapturerErrorBlock)errorBlock; 44 45 /** 46 * Immediately stops capture. 47 */ 48 - (void)stopCapture; 49 @end 50 51 NS_ASSUME_NONNULL_END 52