| 6 |
| 7 | #import <Foundation/Foundation.h> |
| 8 | #import <AVFoundation/AVFoundation.h> |
| 9 |
| 10 | namespace tgvoip{ |
| 11 | namespace video{ |
| 12 | class VideoRenderer; |
| 13 | } |
| 14 | } |
| 15 |
| 16 | typedef NS_ENUM(int, TGVStreamPauseReason){ |
| 17 | TGVStreamPauseReasonBackground, |
| 18 | TGVStreamPauseReasonPoorConnection |
| 19 | }; |
| 20 |
| 21 | typedef NS_ENUM(int, TGVStreamStopReason){ |
| 22 | TGVStreamStopReasonUser, |
| 23 | TGVStreamStopReasonPoorConnection |
| 24 | }; |
| 25 |
| 26 | @protocol TGVVideoRendererDelegate <NSObject> |
| 27 |
| 28 | - (void)incomingVideoRotationDidChange: (int)rotation; |
| 29 | - (void)incomingVideoStreamWillStartWithFrameSize: (CGSize)size; |
| 30 | - (void)incomingVideoStreamDidStopWithReason: (TGVStreamStopReason)reason; |
| 31 | - (void)incomingVideoStreamDidPauseWithReason: (TGVStreamPauseReason)reason; |
| 32 | - (void)incomingVideoStreamWillResume; |
| 33 |
| 34 | @end |
| 35 |
| 36 | @interface TGVVideoRenderer : NSObject |
| 37 |
| 38 | - (instancetype)initWithDisplayLayer: (AVSampleBufferDisplayLayer *)layer delegate: (id<TGVVideoRendererDelegate>)delegate; |
| 39 | - (tgvoip::video::VideoRenderer*)nativeVideoRenderer; |
| 40 |
| 41 | - (void)_enqueueBuffer: (CMSampleBufferRef)buffer reset: (BOOL)reset; |
| 42 |
| 43 | @end |
| 44 |