| 7 | #import "TGVVideoSource.h" |
| 8 | #include "VideoToolboxEncoderSource.h" |
| 9 |
| 10 | @implementation TGVVideoSource{ |
| 11 | tgvoip::video::VideoToolboxEncoderSource* nativeSource; |
| 12 | id<TGVVideoSourceDelegate> delegate; |
| 13 | } |
| 14 |
| 15 |
| 16 | - (instancetype)initWithDelegate: (id<TGVVideoSourceDelegate>)delegate{ |
| 17 | self=[super init]; |
| 18 | nativeSource=new tgvoip::video::VideoToolboxEncoderSource(); |
| 19 | self->delegate=delegate; |
| 20 | return self; |
| 21 | } |
| 22 |
| 23 | - (void)dealloc{ |
| 24 | delete nativeSource; |
| 25 | } |
| 26 |
| 27 | - (void)sendVideoFrame: (CMSampleBufferRef)buffer{ |
| 28 | nativeSource->EncodeFrame(buffer); |
| 29 | } |
| 30 |
| 31 | - (TGVVideoResolution)maximumSupportedVideoResolution{ |
| 32 | return TGVVideoResolution1080; |
| 33 | } |
| 34 |
| 35 | - (void)setVideoRotation: (int)rotation{ |
| 36 |
| 37 | } |
| 38 |
| 39 | - (void)pauseStream{ |
| 40 |
| 41 | } |
| 42 |
| 43 | - (void)resumeStream{ |
| 44 |
| 45 | } |
| 46 |
| 47 | - (tgvoip::video::VideoSource*)nativeVideoSource{ |
| 48 | return nativeSource; |
| 49 | } |
| 50 |
| 51 | @end |
| 52 |