Anders Carlsson | 7bca8ca | 2018-08-30 09:30:29 +0200 | [diff] [blame] | 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 | */ |
Mirko Bonadei | e8d5724 | 2018-09-17 10:22:56 +0200 | [diff] [blame^] | 27 | RTC_OBJC_EXPORT |
Anders Carlsson | 7bca8ca | 2018-08-30 09:30:29 +0200 | [diff] [blame] | 28 | |
| 29 | NS_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 | |
| 51 | NS_ASSUME_NONNULL_END |