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