From: Ronald S. Bultje Date: Thu, 16 Dec 2004 11:17:00 +0000 (+0000) Subject: ext/ffmpeg/gstffmpegcolorspace.c: Some sync with ffmpegcolorspace (flatten AVFrame). X-Git-Tag: RELEASE-0_8_3~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8dc3756ec3a275c3b07a35d4cb5ac7e3cfe45bd2;p=platform%2Fupstream%2Fgst-libav.git ext/ffmpeg/gstffmpegcolorspace.c: Some sync with ffmpegcolorspace (flatten AVFrame). Original commit message from CVS: * ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link), (gst_ffmpegcsp_init), (gst_ffmpegcsp_chain), (gst_ffmpegcsp_change_state): Some sync with ffmpegcolorspace (flatten AVFrame). --- diff --git a/ChangeLog b/ChangeLog index 77994c1..4f27f31 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-12-16 Ronald S. Bultje + + * ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link), + (gst_ffmpegcsp_init), (gst_ffmpegcsp_chain), + (gst_ffmpegcsp_change_state): + Some sync with ffmpegcolorspace (flatten AVFrame). + 2004-11-05 Wim Taymans * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_avpicture_get_size), diff --git a/common b/common index ded6dc5..b2638c1 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit ded6dc5186cb7f8c64cb06a8591b9f787122c6f1 +Subproject commit b2638c100721f67b280c3b43b21f1ce1c9b5e316 diff --git a/ext/ffmpeg/gstffmpegcolorspace.c b/ext/ffmpeg/gstffmpegcolorspace.c index 2486f00..4a56452 100644 --- a/ext/ffmpeg/gstffmpegcolorspace.c +++ b/ext/ffmpeg/gstffmpegcolorspace.c @@ -55,7 +55,7 @@ struct _GstFFMpegCsp gint width, height; gfloat fps; enum PixelFormat from_pixfmt, to_pixfmt; - AVFrame *from_frame, *to_frame; + AVPicture from_frame, to_frame; AVPaletteControl *palette; GstCaps *sinkcaps; }; @@ -246,17 +246,10 @@ gst_ffmpegcsp_pad_link (GstPad * pad, const GstCaps * caps) space->palette = ctx->palctrl; } av_free (ctx); - if (space->from_frame) - av_free (space->from_frame); - if (space->to_frame) - av_free (space->to_frame); space->width = width; space->height = height; - space->from_frame = avcodec_alloc_frame (); - space->to_frame = avcodec_alloc_frame (); - return GST_PAD_LINK_OK; } @@ -327,7 +320,6 @@ gst_ffmpegcsp_init (GstFFMpegCsp * space) gst_pad_set_getcaps_function (space->srcpad, gst_ffmpegcsp_getcaps); space->from_pixfmt = space->to_pixfmt = PIX_FMT_NB; - space->from_frame = space->to_frame = NULL; space->palette = NULL; } @@ -369,16 +361,16 @@ gst_ffmpegcsp_chain (GstPad * pad, GstData * data) outbuf = gst_pad_alloc_buffer (space->srcpad, GST_BUFFER_OFFSET_NONE, size); /* convert */ - gst_ffmpeg_avpicture_fill ((AVPicture *) space->from_frame, + gst_ffmpeg_avpicture_fill (&space->from_frame, GST_BUFFER_DATA (inbuf), space->from_pixfmt, space->width, space->height); if (space->palette) - space->from_frame->data[1] = (uint8_t *) space->palette; - gst_ffmpeg_avpicture_fill ((AVPicture *) space->to_frame, + space->from_frame.data[1] = (uint8_t *) space->palette; + gst_ffmpeg_avpicture_fill (&space->to_frame, GST_BUFFER_DATA (outbuf), space->to_pixfmt, space->width, space->height); - img_convert ((AVPicture *) space->to_frame, space->to_pixfmt, - (AVPicture *) space->from_frame, space->from_pixfmt, + img_convert (&space->to_frame, space->to_pixfmt, + &space->from_frame, space->from_pixfmt, space->width, space->height); GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (inbuf); @@ -399,14 +391,8 @@ gst_ffmpegcsp_change_state (GstElement * element) switch (GST_STATE_TRANSITION (element)) { case GST_STATE_PAUSED_TO_READY: - if (space->from_frame) - av_free (space->from_frame); - if (space->to_frame) - av_free (space->to_frame); if (space->palette) av_free (space->palette); - space->from_frame = NULL; - space->to_frame = NULL; space->palette = NULL; break; }