[FFmpeg-devel] [PATCH] Remove last deprecated calls

Hendrik Leppkes h.leppkes at gmail.com
Mon Jun 27 23:17:01 CEST 2016


On Mon, Jun 27, 2016 at 11:11 PM, Felt, Patrick
<Patrick.Felt at echostar.com> wrote:
> ---
> libavdevice/decklink_dec.cpp | 17 ++++++-----------
> 1 file changed, 6 insertions(+), 11 deletions(-)
>
> diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp
> index 7412727..9c5d5f9 100644
> --- a/libavdevice/decklink_dec.cpp
> +++ b/libavdevice/decklink_dec.cpp
> @@ -120,10 +120,6 @@ static int avpacket_queue_put(AVPacketQueue *q, AVPacket *pkt)
>          av_log(q->avctx, AV_LOG_WARNING,  "Decklink input buffer overrun!\n");
>          return -1;
>      }
> -    /* duplicate the packet */
> -    if (av_dup_packet(pkt) < 0) {
> -        return -1;
> -    }
>
>      pkt1 = (AVPacketList *)av_malloc(sizeof(AVPacketList));
>      if (!pkt1) {
> @@ -582,6 +578,12 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx)
>          st->codecpar->codec_tag   = MKTAG('U', 'Y', 'V', 'Y');
>          st->codecpar->bit_rate    = av_rescale(ctx->bmd_width * ctx->bmd_height * 16, st->time_base.den, st->time_base.num);
>      }
> +    /* set up the interlacing settings */
> +    if (ctx->bmd_field_dominance == bmdLowerFieldFirst) {
> +        st->codecpar->field_order = AV_FIELD_BB;
> +    } else if (ctx->bmd_field_dominance == bmdUpperFieldFirst) {
> +        st->codecpar->field_order = AV_FIELD_TT;
> +    }
>
>      avpriv_set_pts_info(st, 64, 1, 1000000);  /* 64 bits pts in us */
>
> @@ -640,15 +642,8 @@ int ff_decklink_read_packet(AVFormatContext *avctx, AVPacket *pkt)
> {
>      struct decklink_cctx *cctx = (struct decklink_cctx *) avctx->priv_data;
>      struct decklink_ctx *ctx = (struct decklink_ctx *) cctx->ctx;
> -    AVFrame *frame = ctx->video_st->codec->coded_frame;
>
>      avpacket_queue_get(&ctx->queue, pkt, 1);
> -    if (frame && (ctx->bmd_field_dominance == bmdUpperFieldFirst || ctx->bmd_field_dominance == bmdLowerFieldFirst)) {
> -        frame->interlaced_frame = 1;
> -        if (ctx->bmd_field_dominance == bmdUpperFieldFirst) {
> -            frame->top_field_first = 1;
> -        }
> -    }
>
>      return 0;
> }

decklink should probably be updated eventually to use wrapped_avframe
output or something like that, then you could properly output
interlaced and field order flags on a per-frame basis.
Especially since the AVFMT_RAWPICTURE mode it uses is deprecated.

This applies to both decklink_dec and decklink_enc, fwiw.

- Hendrik


More information about the ffmpeg-devel mailing list