tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

ARDFileCaptureController.m (1313B)


      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:
     25    (RTC_OBJC_TYPE(RTCFileVideoCapturer) *)capturer {
     26  self = [super init];
     27  if (self) {
     28    _fileCapturer = capturer;
     29  }
     30  return self;
     31 }
     32 
     33 - (void)startCapture {
     34  [self startFileCapture];
     35 }
     36 
     37 - (void)startFileCapture {
     38  [self.fileCapturer startCapturingFromFileNamed:@"foreman.mp4"
     39                                         onError:^(NSError *_Nonnull error) {
     40                                           NSLog(@"Error %@", error.userInfo);
     41                                         }];
     42 }
     43 
     44 - (void)stopCapture {
     45  [self.fileCapturer stopCapture];
     46 }
     47 @end