You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.2 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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. #import "ARDFileCaptureController.h"
  11. #import <WebRTC/RTCFileVideoCapturer.h>
  12. @interface ARDFileCaptureController ()
  13. @property(nonatomic, strong) RTCFileVideoCapturer *fileCapturer;
  14. @end
  15. @implementation ARDFileCaptureController
  16. @synthesize fileCapturer = _fileCapturer;
  17. - (instancetype)initWithCapturer:(RTCFileVideoCapturer *)capturer {
  18. if (self = [super init]) {
  19. _fileCapturer = capturer;
  20. }
  21. return self;
  22. }
  23. - (void)startCapture {
  24. [self startFileCapture];
  25. }
  26. - (void)startFileCapture {
  27. [self.fileCapturer startCapturingFromFileNamed:@"foreman.mp4"
  28. onError:^(NSError *_Nonnull error) {
  29. NSLog(@"Error %@", error.userInfo);
  30. }];
  31. }
  32. - (void)stopCapture {
  33. [self.fileCapturer stopCapture];
  34. }
  35. @end