mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-24 01:14:05 +08:00
Merge commit '87a051f97633010f71dfc1d23d806856499bf231'
* commit '87a051f97633010f71dfc1d23d806856499bf231': lavc: allow asynchronous decoders to return correct pkt_dts values Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
This commit is contained in:
@@ -46,7 +46,13 @@
|
|||||||
* all.
|
* all.
|
||||||
*/
|
*/
|
||||||
#define FF_CODEC_CAP_INIT_CLEANUP (1 << 1)
|
#define FF_CODEC_CAP_INIT_CLEANUP (1 << 1)
|
||||||
|
/**
|
||||||
|
* Decoders marked with FF_CODEC_CAP_SETS_PKT_DTS want to set
|
||||||
|
* AVFrame.pkt_dts manually. If the flag is set, utils.c won't overwrite
|
||||||
|
* this field. If it's unset, utils.c tries to guess the pkt_dts field
|
||||||
|
* from the input AVPacket.
|
||||||
|
*/
|
||||||
|
#define FF_CODEC_CAP_SETS_PKT_DTS (1 << 2)
|
||||||
|
|
||||||
#ifdef TRACE
|
#ifdef TRACE
|
||||||
# define ff_tlog(ctx, ...) av_log(ctx, AV_LOG_TRACE, __VA_ARGS__)
|
# define ff_tlog(ctx, ...) av_log(ctx, AV_LOG_TRACE, __VA_ARGS__)
|
||||||
|
@@ -790,6 +790,7 @@ AVCodec ff_h264_mmal_decoder = {
|
|||||||
.flush = ffmmal_flush,
|
.flush = ffmmal_flush,
|
||||||
.priv_class = &ffmmaldec_class,
|
.priv_class = &ffmmaldec_class,
|
||||||
.capabilities = AV_CODEC_CAP_DELAY,
|
.capabilities = AV_CODEC_CAP_DELAY,
|
||||||
|
.caps_internal = FF_CODEC_CAP_SETS_PKT_DTS,
|
||||||
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MMAL,
|
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MMAL,
|
||||||
AV_PIX_FMT_YUV420P,
|
AV_PIX_FMT_YUV420P,
|
||||||
AV_PIX_FMT_NONE},
|
AV_PIX_FMT_NONE},
|
||||||
|
@@ -2095,6 +2095,7 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
|
|||||||
else {
|
else {
|
||||||
ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
|
ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
|
||||||
&tmp);
|
&tmp);
|
||||||
|
if (!(avctx->codec->caps_internal & FF_CODEC_CAP_SETS_PKT_DTS))
|
||||||
picture->pkt_dts = avpkt->dts;
|
picture->pkt_dts = avpkt->dts;
|
||||||
|
|
||||||
if(!avctx->has_b_frames){
|
if(!avctx->has_b_frames){
|
||||||
|
Reference in New Issue
Block a user