2014 snapchat source code
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.

44 lines
1.2 KiB

  1. //
  2. // SCCapturerBufferedVideoWriter.h
  3. // Snapchat
  4. //
  5. // Created by Chao Pang on 12/5/17.
  6. //
  7. #import <SCFoundation/SCQueuePerformer.h>
  8. #import <SCManagedVideoCapturerOutputSettings.h>
  9. #import <AVFoundation/AVFoundation.h>
  10. #import <Foundation/Foundation.h>
  11. @protocol SCCapturerBufferedVideoWriterDelegate <NSObject>
  12. - (void)videoWriterDidFailWritingWithError:(NSError *)error;
  13. @end
  14. @interface SCCapturerBufferedVideoWriter : NSObject
  15. - (instancetype)init NS_UNAVAILABLE;
  16. - (instancetype)initWithPerformer:(id<SCPerforming>)performer
  17. outputURL:(NSURL *)outputURL
  18. delegate:(id<SCCapturerBufferedVideoWriterDelegate>)delegate
  19. error:(NSError **)error;
  20. - (BOOL)prepareWritingWithOutputSettings:(SCManagedVideoCapturerOutputSettings *)outputSettings;
  21. - (void)startWritingAtSourceTime:(CMTime)sourceTime;
  22. - (void)finishWritingAtSourceTime:(CMTime)sourceTime withCompletionHanlder:(dispatch_block_t)completionBlock;
  23. - (void)cancelWriting;
  24. - (void)appendVideoSampleBuffer:(CMSampleBufferRef)sampleBuffer;
  25. - (void)appendAudioSampleBuffer:(CMSampleBufferRef)sampleBuffer;
  26. - (void)cleanUp;
  27. @end