blob: 2ddde6dd59bdd78ab93f00bab64b5f569c23199e [file] [log] [blame]
Daniela012b56b2017-11-15 12:15:241/*
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 "ARDFileCaptureController.h"
12
Mirko Bonadei19640aa2020-10-19 14:12:4313#import "sdk/objc/components/capturer/RTCFileVideoCapturer.h"
Daniela012b56b2017-11-15 12:15:2414
15@interface ARDFileCaptureController ()
16
Mirko Bonadeia81e9c82020-05-04 14:14:3217@property(nonatomic, strong) RTC_OBJC_TYPE(RTCFileVideoCapturer) * fileCapturer;
Daniela012b56b2017-11-15 12:15:2418
19@end
20
21@implementation ARDFileCaptureController
22@synthesize fileCapturer = _fileCapturer;
23
Mirko Bonadeia81e9c82020-05-04 14:14:3224- (instancetype)initWithCapturer:(RTC_OBJC_TYPE(RTCFileVideoCapturer) *)capturer {
Daniela012b56b2017-11-15 12:15:2425 if (self = [super init]) {
26 _fileCapturer = capturer;
27 }
28 return self;
29}
30
31- (void)startCapture {
32 [self startFileCapture];
33}
34
35- (void)startFileCapture {
36 [self.fileCapturer startCapturingFromFileNamed:@"foreman.mp4"
37 onError:^(NSError *_Nonnull error) {
38 NSLog(@"Error %@", error.userInfo);
39 }];
40}
41
42- (void)stopCapture {
43 [self.fileCapturer stopCapture];
44}
45@end