diff --git a/src/gstvpe.c b/src/gstvpe.c index a5ed1ff..efe9fcc 100644 --- a/src/gstvpe.c +++ b/src/gstvpe.c @@ -41,7 +41,6 @@ #define MIN(a,b) (((a) < (b)) ? (a) : (b)) #endif - static void gst_vpe_class_init (GstVpeClass * klass); static void gst_vpe_init (GstVpe * self, gpointer klass); static void gst_vpe_base_init (gpointer gclass); @@ -166,7 +165,8 @@ static gboolean gst_vpe_set_output_caps (GstVpe * self) { GstCaps *outcaps; - GstStructure *s, *out_s; +// GstStructure *s, *out_s; + GstStructure *s, *out_s = NULL; gint fps_n, fps_d; gint par_width, par_height; const gchar *fmt = NULL; @@ -184,8 +184,12 @@ gst_vpe_set_output_caps (GstVpe * self) && gst_caps_is_strictly_equal (outcaps, self->output_caps))) { GST_DEBUG_OBJECT (self, "Downstream allowed caps: %s", gst_caps_to_string (outcaps)); - out_s = gst_caps_get_structure (outcaps, 0); - fmt = gst_structure_get_string (out_s, "format"); +// out_s = gst_caps_get_structure (outcaps, 0); +// fmt = gst_structure_get_string (out_s, "format"); + if(gst_caps_get_size(outcaps) > 0 ) { + out_s = gst_caps_get_structure (outcaps, 0); + fmt = gst_structure_get_string (out_s, "format"); + } if (out_s && gst_structure_get_int (out_s, "width", &self->output_width) && @@ -210,8 +214,10 @@ gst_vpe_set_output_caps (GstVpe * self) 2 : self->input_crop.c.height; self->output_width = self->input_crop.c.width; } else { - self->output_height = self->input_height; - self->output_width = self->input_width; +// self->output_height = self->input_height; +// self->output_width = self->input_width; + self->output_height = self->input_crop.c.height; + self->output_width = self->input_crop.c.width; } self->output_fourcc = GST_MAKE_FOURCC ('N', 'V', '1', '2'); }