Files
GLEGram-iOS/submodules/FFMpegBinding/Sources/FFMpegPacket.m
T
Leeksov 4647310322 GLEGram 12.5 — Initial public release
Based on Swiftgram 12.5 (Telegram iOS 12.5).
All GLEGram features ported and organized in GLEGram/ folder.

Features: Ghost Mode, Saved Deleted Messages, Content Protection Bypass,
Font Replacement, Fake Profile, Chat Export, Plugin System, and more.

See CHANGELOG_12.5.md for full details.
2026-04-06 09:48:12 +03:00

73 lines
1.1 KiB
Objective-C

#import <FFMpegBinding/FFMpegPacket.h>
#import <FFMpegBinding/FFMpegAVCodecContext.h>
#import "libavcodec/avcodec.h"
#import "libavformat/avformat.h"
@interface FFMpegPacket () {
AVPacket *_impl;
}
@end
@implementation FFMpegPacket
- (instancetype)init {
self = [super init];
if (self != nil) {
_impl = av_packet_alloc();
}
return self;
}
- (void)dealloc {
av_packet_free(&_impl);
}
- (void *)impl {
return _impl;
}
- (int64_t)pts {
if (_impl->pts == 0x8000000000000000) {
return _impl->dts;
} else {
return _impl->pts;
}
}
- (int64_t)dts {
return _impl->dts;
}
- (int64_t)duration {
return _impl->duration;
}
- (int32_t)streamIndex {
return (int32_t)_impl->stream_index;
}
- (int32_t)size {
return (int32_t)_impl->size;
}
- (bool)isKeyframe {
return (_impl->flags & AV_PKT_FLAG_KEY) != 0;
}
- (uint8_t *)data {
return _impl->data;
}
- (int32_t)sendToDecoder:(FFMpegAVCodecContext *)codecContext {
return avcodec_send_packet((AVCodecContext *)[codecContext impl], _impl);
}
- (void)reuse {
av_packet_unref(_impl);
}
@end