2019-02-24 13:15:14 +01:00
|
|
|
//
|
|
|
|
// libtgvoip is free and unencumbered public domain software.
|
|
|
|
// For more information, see http://unlicense.org or the UNLICENSE file
|
|
|
|
// you should have received with this source code distribution.
|
|
|
|
//
|
|
|
|
|
|
|
|
#import "TGVVideoSource.h"
|
|
|
|
#include "VideoToolboxEncoderSource.h"
|
|
|
|
|
|
|
|
@implementation TGVVideoSource{
|
|
|
|
tgvoip::video::VideoToolboxEncoderSource* nativeSource;
|
2019-03-10 23:12:09 +01:00
|
|
|
id<TGVVideoSourceDelegate> delegate;
|
2019-02-24 13:15:14 +01:00
|
|
|
}
|
|
|
|
|
2019-03-10 23:12:09 +01:00
|
|
|
|
|
|
|
- (instancetype)initWithDelegate: (id<TGVVideoSourceDelegate>)delegate{
|
2019-02-24 13:15:14 +01:00
|
|
|
self=[super init];
|
|
|
|
nativeSource=new tgvoip::video::VideoToolboxEncoderSource();
|
2019-03-10 23:12:09 +01:00
|
|
|
self->delegate=delegate;
|
2019-02-24 13:15:14 +01:00
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)dealloc{
|
|
|
|
delete nativeSource;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)sendVideoFrame: (CMSampleBufferRef)buffer{
|
|
|
|
nativeSource->EncodeFrame(buffer);
|
|
|
|
}
|
|
|
|
|
|
|
|
- (TGVVideoResolution)maximumSupportedVideoResolution{
|
|
|
|
return TGVVideoResolution1080;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setVideoRotation: (int)rotation{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)pauseStream{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)resumeStream{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
- (tgvoip::video::VideoSource*)nativeVideoSource{
|
|
|
|
return nativeSource;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|