summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cde36fe)
raw | patch | inline | side by side (parent: cde36fe)
author | Alessandro Decina <alessandro.decina@collabora.co.uk> | |
Tue, 28 Feb 2012 17:04:59 +0000 (18:04 +0100) | ||
committer | Alessandro Decina <alessandro.decina@collabora.co.uk> | |
Tue, 28 Feb 2012 17:04:59 +0000 (18:04 +0100) |
src/gstducatividdec.c | patch | blob | history | |
src/gstducatividdec.h | patch | blob | history |
diff --git a/src/gstducatividdec.c b/src/gstducatividdec.c
index cc1ec390ce94aa9460c2a22e841c02c8d0b5b7d9..1d403efd3cf31e85a2e955762f53c47ff097eb48 100644 (file)
--- a/src/gstducatividdec.c
+++ b/src/gstducatividdec.c
send = FALSE;
}
- if (G_UNLIKELY (self->first_out_buffer) && send) {
+ if (G_UNLIKELY (self->send_crop_event) && send) {
gint crop_width, crop_height;
- GstDucatiBufferPool *pool;
GstDucatiVidDecClass *klass = GST_DUCATIVIDDEC_GET_CLASS (self);
/* send region of interest to sink on first buffer: */
gst_event_new_crop (r->topLeft.y, r->topLeft.x,
crop_width, crop_height));
+ self->send_crop_event = FALSE;
+ }
+
+ if (G_UNLIKELY (self->first_out_buffer) && send) {
+ GstDucatiBufferPool *pool;
self->first_out_buffer = FALSE;
/* Destroy the pool so the buffers we used so far are eventually released.
i, outbuf, GST_TIME_ARGS (ts));
}
-
if (GST_BUFFER_CAPS (outbuf) &&
!gst_caps_is_equal (GST_BUFFER_CAPS (outbuf),
GST_PAD_CAPS (self->srcpad))) {
GST_INFO_OBJECT (self, "outsize %d stride %d outcaps: %" GST_PTR_FORMAT,
self->outsize, self->stride, outcaps);
+ /* (re)send a crop event when caps change */
+ self->send_crop_event = TRUE;
+
ret = gst_pad_set_caps (self->srcpad, outcaps);
out:
@@ -1069,6 +1075,7 @@ gst_ducati_viddec_change_state (GstElement * element, GstStateChange transition)
switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_READY:
self->interlaced = FALSE;
+ self->send_crop_event = TRUE;
gst_ducati_viddec_codec_flush (self, FALSE);
break;
case GST_STATE_CHANGE_READY_TO_NULL:
self->first_in_buffer = TRUE;
self->first_out_buffer = TRUE;
self->interlaced = FALSE;
+ self->send_crop_event = TRUE;
self->dts_ridx = self->dts_widx = 0;
self->last_dts = self->last_pts = GST_CLOCK_TIME_NONE;
diff --git a/src/gstducatividdec.h b/src/gstducatividdec.h
index 73bc4d082e3b1de90b54f04a7d50f579356a9abd..0b7297327a97b6aae9fc56794074d4398f8c827f 100644 (file)
--- a/src/gstducatividdec.h
+++ b/src/gstducatividdec.h
* input buffers:
*/
gboolean first_out_buffer, first_in_buffer;
+ gboolean send_crop_event;
GstSegment segment;
gdouble qos_proportion;