Merge commit '7621e2f8dec938cf48181c8b10afc9b01f444e68' into beta

This commit is contained in:
Ilya Laktyushin
2025-12-06 02:17:48 +04:00
commit 8344b97e03
28070 changed files with 7995182 additions and 0 deletions
@@ -0,0 +1,72 @@
#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