summaryrefslogtreecommitdiff
path: root/sys/uvch264
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2013-08-10 21:33:36 +0100
committerTim-Philipp Müller <tim@centricular.net>2013-08-10 21:35:09 +0100
commit6f5934f3aa9822673ed25343d8ba7e011ad7a407 (patch)
treea6e42c1cdd0f0ff5110748778faf8b1fab232723 /sys/uvch264
parent86acf25ffc03e450ae912ad5d2e535b47d5c334b (diff)
downloadgstreamer-plugins-bad-6f5934f3aa9822673ed25343d8ba7e011ad7a407.tar.gz
uvch264mjpgdemux: fix event ordering
Diffstat (limited to 'sys/uvch264')
-rw-r--r--sys/uvch264/gstuvch264_mjpgdemux.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/sys/uvch264/gstuvch264_mjpgdemux.c b/sys/uvch264/gstuvch264_mjpgdemux.c
index e42cd49a2..3ff73aca7 100644
--- a/sys/uvch264/gstuvch264_mjpgdemux.c
+++ b/sys/uvch264/gstuvch264_mjpgdemux.c
@@ -144,6 +144,9 @@ struct _GstUvcH264MjpgDemuxPrivate
guint16 yuy2_height;
guint16 nv12_width;
guint16 nv12_height;
+
+ /* input segment */
+ GstSegment segment;
};
typedef struct
@@ -365,14 +368,21 @@ gst_uvc_h264_mjpg_demux_sink_event (GstPad * pad, GstObject * parent,
GstEvent * event)
{
GstUvcH264MjpgDemux *self = GST_UVC_H264_MJPG_DEMUX (parent);
+ gboolean res;
switch (GST_EVENT_TYPE (event)) {
+ case GST_EVENT_SEGMENT:
+ gst_event_copy_segment (event, &self->priv->segment);
+ res = gst_pad_push_event (self->priv->jpeg_pad, event);
+ break;
case GST_EVENT_CAPS:
- return gst_pad_push_event (self->priv->jpeg_pad, event);
+ res = gst_pad_push_event (self->priv->jpeg_pad, event);
+ break;
default:
+ res = gst_pad_event_default (pad, parent, event);
break;
}
- return gst_pad_event_default (pad, parent, event);
+ return res;
}
static gboolean
@@ -612,10 +622,9 @@ gst_uvc_h264_mjpg_demux_chain (GstPad * pad,
"width", G_TYPE_INT, aux_header.width,
"height", G_TYPE_INT, aux_header.height,
"framerate", GST_TYPE_FRACTION, fps_num, fps_den, NULL);
- if (!gst_pad_set_caps (aux_pad, *aux_caps)) {
- ret = GST_FLOW_NOT_NEGOTIATED;
- goto done;
- }
+ gst_pad_push_event (aux_pad, gst_event_new_caps (*aux_caps));
+ gst_pad_push_event (aux_pad,
+ gst_event_new_segment (&self->priv->segment));
}
/* Create new auxiliary buffer list and adjust i/segment size */