Am Samstag, den 21.05.2016, 21:57 +0200 schrieb Michael Niedermayer:
> On Sat, May 21, 2016 at 09:20:55PM +0200, Jens Ziller wrote:
> > 
> > for deinterlacing is needed frame->interlaced_frame and format
> > struct. This patch added this.
> > 
> > Signed-off-by: Jens Ziller <zille...@gmx.de>
> > ---
> >  libavcodec/mmaldec.c | 16 ++++++++++++++++
> >  1 file changed, 16 insertions(+)
> > 
> > diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c
> > index 52232d5..89f19a0 100644
> > --- a/libavcodec/mmaldec.c
> > +++ b/libavcodec/mmaldec.c
> > @@ -88,6 +88,7 @@ typedef struct MMALDecodeContext {
> >      int eos_received;
> >      int eos_sent;
> >      int extradata_sent;
> > +    int interlaced_frame;
> >  } MMALDecodeContext;
> >  
> >  // Assume decoder is guaranteed to produce output after at least
> > this
> > many
> > @@ -274,6 +275,7 @@ static int ffmal_update_format(AVCodecContext
> > *avctx)
> the inline patch is corrupted by newlines
> the attached patch is missing the author
> "Patch does not have a valid e-mail address."
> and the whole mail cannot be applied as the inline patch is corrupted
> 
> [...]
> 

Sorry for inconvenience. Attached is the new patch.

Regards Jens.

> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
From f5818bde8e73b778c13b21e89d24f0d687c96714 Mon Sep 17 00:00:00 2001
From: Jens Ziller <zille...@gmx.de>
Date: Sun, 22 May 2016 09:49:45 +0200
Subject: [PATCH] for deinterlacing needed

---
 libavcodec/mmaldec.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c
index 52232d5..89f19a0 100644
--- a/libavcodec/mmaldec.c
+++ b/libavcodec/mmaldec.c
@@ -88,6 +88,7 @@ typedef struct MMALDecodeContext {
     int eos_received;
     int eos_sent;
     int extradata_sent;
+    int interlaced_frame;
 } MMALDecodeContext;
 
 // Assume decoder is guaranteed to produce output after at least this many
@@ -274,6 +275,7 @@ static int ffmal_update_format(AVCodecContext *avctx)
     int ret = 0;
     MMAL_COMPONENT_T *decoder = ctx->decoder;
     MMAL_ES_FORMAT_T *format_out = decoder->output[0]->format;
+    MMAL_PARAMETER_VIDEO_INTERLACE_TYPE_T interlace_type;
 
     ffmmal_poolref_unref(ctx->pool_out);
     if (!(ctx->pool_out = av_mallocz(sizeof(*ctx->pool_out)))) {
@@ -300,6 +302,15 @@ static int ffmal_update_format(AVCodecContext *avctx)
     if ((status = mmal_port_format_commit(decoder->output[0])))
         goto fail;
 
+    interlace_type.hdr.id = MMAL_PARAMETER_VIDEO_INTERLACE_TYPE;
+    interlace_type.hdr.size = sizeof(MMAL_PARAMETER_VIDEO_INTERLACE_TYPE_T);
+    status = mmal_port_parameter_get(decoder->output[0], &interlace_type.hdr);
+    if (status != MMAL_SUCCESS) {
+        av_log(avctx, AV_LOG_ERROR, "Cannot read MMAL interlace information!\n");
+    } else {
+        ctx->interlaced_frame = !(interlace_type.eMode == MMAL_InterlaceProgressive);
+    }
+
     if ((ret = ff_set_dimensions(avctx, format_out->es->video.crop.x + format_out->es->video.crop.width,
                                         format_out->es->video.crop.y + format_out->es->video.crop.height)) < 0)
         goto fail;
@@ -607,7 +618,12 @@ static int ffmal_copy_frame(AVCodecContext *avctx,  AVFrame *frame,
     MMALDecodeContext *ctx = avctx->priv_data;
     int ret = 0;
 
+    frame->interlaced_frame = ctx->interlaced_frame;
+
     if (avctx->pix_fmt == AV_PIX_FMT_MMAL) {
+        // in data[2] give the format struct for configure deinterlacer and renderer
+        frame->data[2] = ctx->decoder->output[0]->format;
+
         if (!ctx->pool_out)
             return AVERROR_UNKNOWN; // format change code failed with OOM previously
 
-- 
2.7.3

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to