diff options
author | Nick Haddad <nick@haddads.net> | 2008-10-31 10:00:18 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2008-10-31 10:00:18 +0000 |
commit | 66c804b41ca0ac876ba436f0fc0780775d8bc737 (patch) | |
tree | 0688d61c95ce1ebc2738b804483ce89c0f139430 /gst | |
parent | bab5d042b232ca7d01cd029f897ec1e1b931b222 (diff) |
gst/avi/gstavidemux.c: Invert other uncompressed RGB formats. Fixes #558554.
Original commit message from CVS:
Patch by: Nick Haddad <nick at haddads dot net>
* gst/avi/gstavidemux.c: (gst_avi_demux_is_uncompressed),
(gst_avi_demux_invert), (gst_avi_demux_process_next_entry),
(gst_avi_demux_stream_data):
Invert other uncompressed RGB formats. Fixes #558554.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/avi/gstavidemux.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c index 62313e5a..05912fa1 100644 --- a/gst/avi/gstavidemux.c +++ b/gst/avi/gstavidemux.c @@ -3584,6 +3584,17 @@ swap_line (guint8 * d1, guint8 * d2, guint8 * tmp, gint bytes) } /* + * Helper for gst_avi_demux_insert() + */ +static gboolean +gst_avi_demux_is_uncompressed (guint32 fourcc) +{ + return fourcc == GST_RIFF_DIB || + fourcc == GST_RIFF_rgb || + fourcc == GST_RIFF_RGB || fourcc == GST_RIFF_RAW; +} + +/* * Invert DIB buffers... Takes existing buffer and * returns either the buffer or a new one (with old * one dereferenced). @@ -3597,6 +3608,10 @@ gst_avi_demux_invert (avi_stream_context * stream, GstBuffer * buf) gint bpp, stride; guint8 *tmp = NULL; + if (!gst_avi_demux_is_uncompressed (stream->strh->fcc_handler)) { + return buf; /* Ignore non DIB buffers */ + } + s = gst_caps_get_structure (GST_PAD_CAPS (stream->pad), 0); if (!gst_structure_get_int (s, "bpp", &bpp)) { GST_WARNING ("Failed to retrieve depth from caps"); @@ -3770,8 +3785,7 @@ gst_avi_demux_process_next_entry (GstAviDemux * avi) goto short_buffer; /* invert the picture if needed */ - if (stream->strh->fcc_handler == GST_MAKE_FOURCC ('D', 'I', 'B', ' ')) - buf = gst_avi_demux_invert (stream, buf); + buf = gst_avi_demux_invert (stream, buf); /* mark non-keyframes */ if (!(entry->flags & GST_AVI_INDEX_ENTRY_FLAG_KEYFRAME)) @@ -3997,9 +4011,7 @@ gst_avi_demux_stream_data (GstAviDemux * avi) GstClockTime dur_ts = 0; /* invert the picture if needed */ - if (stream->strh->fcc_handler == GST_MAKE_FOURCC ('D', 'I', 'B', ' ')) { - buf = gst_avi_demux_invert (stream, buf); - } + buf = gst_avi_demux_invert (stream, buf); gst_pad_query_position (stream->pad, &format, (gint64 *) & dur_ts); if (format != GST_FORMAT_TIME) |