blob: 0782588d9cb3636a60a6e36425b24deddaf18446 [file] [log] [blame]
Anders Carlsson7bca8ca2018-08-30 09:30:29 +02001/*
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
15NS_ASSUME_NONNULL_BEGIN
16
17/**
18 * Error passing block.
19 */
20typedef void (^RTCFileVideoCapturerErrorBlock)(NSError *error);
21
22/**
23 * Captures buffers from bundled video file.
24 *
25 * See @c RTCVideoCapturer for more info on capturers.
26 */
Mirko Bonadeie8d57242018-09-17 10:22:56 +020027RTC_OBJC_EXPORT
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020028
29NS_CLASS_AVAILABLE_IOS(10)
30@interface RTCFileVideoCapturer : 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
51NS_ASSUME_NONNULL_END