mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +02:00
plugin: sink: Replace deprecated method
The method gtk_picture_set_keep_aspect_ratio is deprecated. As per the warnings given when compiling clapper, it is replaced with gtk_picture_set_content_fit with the same behavior as before.
This commit is contained in:
@@ -279,8 +279,15 @@ gst_clapper_sink_get_widget (GstClapperSink *self)
|
|||||||
gst_clapper_paintable_set_widget (self->paintable, self->widget);
|
gst_clapper_paintable_set_widget (self->paintable, self->widget);
|
||||||
|
|
||||||
/* Set earlier remembered property */
|
/* Set earlier remembered property */
|
||||||
|
#if GTK_CHECK_VERSION(4,8,0)
|
||||||
|
if (self->force_aspect_ratio)
|
||||||
|
gtk_picture_set_content_fit (GTK_PICTURE (self->widget), GTK_CONTENT_FIT_CONTAIN);
|
||||||
|
else
|
||||||
|
gtk_picture_set_content_fit (GTK_PICTURE (self->widget), GTK_CONTENT_FIT_FILL);
|
||||||
|
#else
|
||||||
gtk_picture_set_keep_aspect_ratio (GTK_PICTURE (self->widget),
|
gtk_picture_set_keep_aspect_ratio (GTK_PICTURE (self->widget),
|
||||||
self->force_aspect_ratio);
|
self->force_aspect_ratio);
|
||||||
|
#endif
|
||||||
|
|
||||||
gtk_picture_set_paintable (GTK_PICTURE (self->widget), GDK_PAINTABLE (self->paintable));
|
gtk_picture_set_paintable (GTK_PICTURE (self->widget), GDK_PAINTABLE (self->paintable));
|
||||||
|
|
||||||
@@ -358,8 +365,15 @@ gst_clapper_sink_set_property (GObject *object, guint prop_id,
|
|||||||
self->force_aspect_ratio = g_value_get_boolean (value);
|
self->force_aspect_ratio = g_value_get_boolean (value);
|
||||||
|
|
||||||
if (self->widget) {
|
if (self->widget) {
|
||||||
|
#if GTK_CHECK_VERSION(4,8,0)
|
||||||
|
if (self->force_aspect_ratio)
|
||||||
|
gtk_picture_set_content_fit (GTK_PICTURE (self->widget), GTK_CONTENT_FIT_CONTAIN);
|
||||||
|
else
|
||||||
|
gtk_picture_set_content_fit (GTK_PICTURE (self->widget), GTK_CONTENT_FIT_FILL);
|
||||||
|
#else
|
||||||
gtk_picture_set_keep_aspect_ratio (GTK_PICTURE (self->widget),
|
gtk_picture_set_keep_aspect_ratio (GTK_PICTURE (self->widget),
|
||||||
self->force_aspect_ratio);
|
self->force_aspect_ratio);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PROP_PIXEL_ASPECT_RATIO:
|
case PROP_PIXEL_ASPECT_RATIO:
|
||||||
|
Reference in New Issue
Block a user