mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00

git-subtree-dir: submodules/ffmpeg git-subtree-mainline: 8f5a4f7dc119599d326c72d9a6115973e825491b git-subtree-split: 53fc3dcb6022f35015afd2605ead32bfd7417144
35 lines
559 B
Objective-C
35 lines
559 B
Objective-C
#import "FFMpegAVCodec.h"
|
|
|
|
#import "libavcodec/avcodec.h"
|
|
|
|
@interface FFMpegAVCodec () {
|
|
AVCodec *_impl;
|
|
}
|
|
|
|
@end
|
|
|
|
@implementation FFMpegAVCodec
|
|
|
|
- (instancetype)initWithImpl:(AVCodec *)impl {
|
|
self = [super init];
|
|
if (self != nil) {
|
|
_impl = impl;
|
|
}
|
|
return self;
|
|
}
|
|
|
|
+ (FFMpegAVCodec * _Nullable)findForId:(int)codecId {
|
|
AVCodec *codec = avcodec_find_decoder(codecId);
|
|
if (codec) {
|
|
return [[FFMpegAVCodec alloc] initWithImpl:codec];
|
|
} else {
|
|
return nil;
|
|
}
|
|
}
|
|
|
|
- (void *)impl {
|
|
return _impl;
|
|
}
|
|
|
|
@end
|