• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "ARDFileCaptureController.h"
12
13#import "sdk/objc/components/capturer/RTCFileVideoCapturer.h"
14
15@interface ARDFileCaptureController ()
16
17@property(nonatomic, strong) RTC_OBJC_TYPE(RTCFileVideoCapturer) * fileCapturer;
18
19@end
20
21@implementation ARDFileCaptureController
22@synthesize fileCapturer = _fileCapturer;
23
24- (instancetype)initWithCapturer:(RTC_OBJC_TYPE(RTCFileVideoCapturer) *)capturer {
25  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
46