GIF-related fixes part 2

This commit is contained in:
Ali
2020-05-26 03:53:24 +04:00
parent 03e773580d
commit c4dd56b596
47 changed files with 893 additions and 568 deletions

View File

@@ -50,11 +50,22 @@
return result >= 0;
}
- (bool)receiveIntoFrame:(FFMpegAVFrame *)frame {
int status = avcodec_receive_frame(_impl, (AVFrame *)[frame impl]);
- (bool)sendEnd {
int status = avcodec_send_packet(_impl, nil);
return status == 0;
}
- (FFMpegAVCodecContextReceiveResult)receiveIntoFrame:(FFMpegAVFrame *)frame {
int status = avcodec_receive_frame(_impl, (AVFrame *)[frame impl]);
if (status == 0) {
return FFMpegAVCodecContextReceiveResultSuccess;
} else if (status == -35) {
return FFMpegAVCodecContextReceiveResultNotEnoughData;
} else {
return FFMpegAVCodecContextReceiveResultError;
}
}
- (void)flushBuffers {
avcodec_flush_buffers(_impl);
}

View File

@@ -44,6 +44,10 @@
return _impl->pts;
}
- (int64_t)duration {
return _impl->pkt_duration;
}
- (FFMpegAVFrameColorRange)colorRange {
switch (_impl->color_range) {
case AVCOL_RANGE_MPEG: