return FALSE;
}
- if (!gtk_gst_base_widget_set_caps (gtk_sink->widget, caps))
+ if (!gtk_gst_base_widget_set_format (gtk_sink->widget, >k_sink->v_info))
return FALSE;
GST_OBJECT_UNLOCK (gtk_sink);
}
gboolean
-gtk_gst_base_widget_set_caps (GtkGstBaseWidget * widget, GstCaps * caps)
+gtk_gst_base_widget_set_format (GtkGstBaseWidget * widget,
+ GstVideoInfo * v_info)
{
- GstVideoInfo v_info;
+ GTK_GST_BASE_WIDGET_LOCK (widget);
- if (widget->caps && gst_caps_is_equal_fixed (widget->caps, caps))
+ if (gst_video_info_is_equal (&widget->v_info, v_info)) {
+ GTK_GST_BASE_WIDGET_UNLOCK (widget);
return TRUE;
-
- if (!gst_video_info_from_caps (&v_info, caps))
- return FALSE;
-
- GTK_GST_BASE_WIDGET_LOCK (widget);
+ }
/* FIXME this will cause black frame to be displayed, move this in the
* _queue_resize callback passing over the video info */
- if (!_calculate_par (widget, &v_info)) {
+ if (!_calculate_par (widget, v_info)) {
GTK_GST_BASE_WIDGET_UNLOCK (widget);
return FALSE;
}
widget->reset (widget);
gst_buffer_replace (&widget->buffer, NULL);
- gst_caps_replace (&widget->caps, caps);
- widget->v_info = v_info;
+ widget->v_info = *v_info;
widget->negotiated = TRUE;
widget->new_buffer = TRUE;
/*< private >*/
GMutex lock;
- GstCaps *caps;
/* Pending queued idles callback */
guint draw_id;
void gtk_gst_base_widget_finalize (GObject * object);
/* API */
-gboolean gtk_gst_base_widget_set_caps (GtkGstBaseWidget * widget, GstCaps *caps);
+gboolean gtk_gst_base_widget_set_format (GtkGstBaseWidget * widget, GstVideoInfo *v_info);
void gtk_gst_base_widget_set_buffer (GtkGstBaseWidget * widget, GstBuffer *buffer);
G_END_DECLS