Nagram/TMessagesProj/jni/libtgvoip3/os/darwin/TGVVideoRenderer.h
2020-04-24 12:21:58 +03:00

51 lines
1.4 KiB
Objective-C

//
// 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 <AVFoundation/AVFoundation.h>
#import <Foundation/Foundation.h>
namespace tgvoip
{
namespace video
{
class VideoRenderer;
}
}
typedef NS_ENUM(int, TGVStreamPauseReason) {
TGVStreamPauseReasonBackground,
TGVStreamPauseReasonPoorConnection
};
typedef NS_ENUM(int, TGVStreamStopReason) {
TGVStreamStopReasonUser,
TGVStreamStopReasonPoorConnection
};
@protocol TGVVideoRendererDelegate <NSObject>
- (void)incomingVideoRotationDidChange:(int)rotation;
- (void)incomingVideoStreamWillStartWithFrameSize:(CGSize)size;
- (void)incomingVideoStreamDidStopWithReason:(TGVStreamStopReason)reason;
- (void)incomingVideoStreamDidPauseWithReason:(TGVStreamPauseReason)reason;
- (void)incomingVideoStreamWillResume;
@end
@interface TGVVideoRenderer : NSObject
- (instancetype)initWithDisplayLayer:(AVSampleBufferDisplayLayer*)layer delegate:(id<TGVVideoRendererDelegate>)delegate;
- (tgvoip::video::VideoRenderer*)nativeVideoRenderer;
- (void)_enqueueBuffer:(CMSampleBufferRef)buffer reset:(BOOL)reset;
- (void)_setSizeWidth:(std::uint16_t)width height:(std::uint16_t)height;
- (void)_setRotation:(std::uint16_t)rotation;
- (void)_setStopped;
- (void)_setPaused;
- (void)_setResumed;
@end