RTCFileVideoCapturer.h 1.4 KB

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