Swiftgram/submodules/libtgvoip/os/darwin/TGVVideoSource.mm
Peter 085acd26c4 Add 'submodules/libtgvoip/' from commit 'dcbbfd9ec40ee8702852a768d75362142becc727'
git-subtree-dir: submodules/libtgvoip
git-subtree-mainline: d153fe0f21174c4d6e1c3602e852e7a0e53051f0
git-subtree-split: dcbbfd9ec40ee8702852a768d75362142becc727
2019-06-11 18:52:32 +01:00

52 lines
998 B
Plaintext

//
// 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;
id<TGVVideoSourceDelegate> delegate;
}
- (instancetype)initWithDelegate: (id<TGVVideoSourceDelegate>)delegate{
self=[super init];
nativeSource=new tgvoip::video::VideoToolboxEncoderSource();
self->delegate=delegate;
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