mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-06 23:48:53 +00:00
examples: gst-camera: update to GTK3
When opening the .ui file it complains about being for GTK 2 and automatically updates it to GTK3. Commit this version and update the makefile
This commit is contained in:
parent
2690cd33ce
commit
a1a58d438f
3 changed files with 7 additions and 19 deletions
|
@ -2,7 +2,7 @@ GST_CAMERABIN_UI_FILES = gst-camera2.ui
|
||||||
|
|
||||||
AM_CPPFLAGS = -DCAMERA_APPS_UIDIR=\""$(srcdir)"\"
|
AM_CPPFLAGS = -DCAMERA_APPS_UIDIR=\""$(srcdir)"\"
|
||||||
|
|
||||||
if HAVE_GTK
|
if HAVE_GTK3
|
||||||
|
|
||||||
GST_CAMERABIN_GTK_EXAMPLES = gst-camera2
|
GST_CAMERABIN_GTK_EXAMPLES = gst-camera2
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ gst_camera2_SOURCES = gst-camera2.h gst-camera2.c
|
||||||
gst_camera2_CFLAGS = \
|
gst_camera2_CFLAGS = \
|
||||||
$(GST_PLUGINS_BAD_CFLAGS) \
|
$(GST_PLUGINS_BAD_CFLAGS) \
|
||||||
$(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) \
|
$(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) \
|
||||||
$(GTK_CFLAGS) \
|
$(GTK3_CFLAGS) \
|
||||||
$(GMODULE_EXPORT_CFLAGS) \
|
$(GMODULE_EXPORT_CFLAGS) \
|
||||||
-DGST_USE_UNSTABLE_API
|
-DGST_USE_UNSTABLE_API
|
||||||
gst_camera2_LDADD = \
|
gst_camera2_LDADD = \
|
||||||
|
@ -21,7 +21,7 @@ gst_camera2_LDADD = \
|
||||||
-lgstpbutils-@GST_API_VERSION@ \
|
-lgstpbutils-@GST_API_VERSION@ \
|
||||||
-lgstvideo-@GST_API_VERSION@ \
|
-lgstvideo-@GST_API_VERSION@ \
|
||||||
$(GST_LIBS) \
|
$(GST_LIBS) \
|
||||||
$(GTK_LIBS) \
|
$(GTK3_LIBS) \
|
||||||
$(GMODULE_EXPORT_LIBS)
|
$(GMODULE_EXPORT_LIBS)
|
||||||
|
|
||||||
noinst_DATA = $(GST_CAMERABIN_UI_FILES)
|
noinst_DATA = $(GST_CAMERABIN_UI_FILES)
|
||||||
|
|
|
@ -170,9 +170,7 @@ on_videoRButton_toggled (GtkToggleButton * button, gpointer user_data)
|
||||||
void
|
void
|
||||||
on_viewfinderArea_realize (GtkWidget * widget, gpointer data)
|
on_viewfinderArea_realize (GtkWidget * widget, gpointer data)
|
||||||
{
|
{
|
||||||
#if GTK_CHECK_VERSION (2, 18, 0)
|
|
||||||
gdk_window_ensure_native (gtk_widget_get_window (widget));
|
gdk_window_ensure_native (gtk_widget_get_window (widget));
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -219,11 +217,7 @@ bus_sync_callback (GstBus * bus, GstMessage * message, gpointer data)
|
||||||
/* FIXME: make sure to get XID in main thread */
|
/* FIXME: make sure to get XID in main thread */
|
||||||
ui_drawing = GTK_WIDGET (gtk_builder_get_object (builder, "viewfinderArea"));
|
ui_drawing = GTK_WIDGET (gtk_builder_get_object (builder, "viewfinderArea"));
|
||||||
gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (message->src),
|
gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (message->src),
|
||||||
#if GTK_CHECK_VERSION (2, 91, 6)
|
|
||||||
GDK_WINDOW_XID (gtk_widget_get_window (ui_drawing)));
|
GDK_WINDOW_XID (gtk_widget_get_window (ui_drawing)));
|
||||||
#else
|
|
||||||
GDK_WINDOW_XWINDOW (gtk_widget_get_window (ui_drawing)));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
gst_message_unref (message);
|
gst_message_unref (message);
|
||||||
return GST_BUS_DROP;
|
return GST_BUS_DROP;
|
||||||
|
@ -276,7 +270,6 @@ bus_callback (GstBus * bus, GstMessage * message, gpointer data)
|
||||||
static gboolean
|
static gboolean
|
||||||
init_gtkwidgets_data (void)
|
init_gtkwidgets_data (void)
|
||||||
{
|
{
|
||||||
#if GTK_CHECK_VERSION(2,24,0)
|
|
||||||
gint i;
|
gint i;
|
||||||
GtkComboBoxText *combobox =
|
GtkComboBoxText *combobox =
|
||||||
GTK_COMBO_BOX_TEXT (gtk_builder_get_object (builder, "formatComboBox"));
|
GTK_COMBO_BOX_TEXT (gtk_builder_get_object (builder, "formatComboBox"));
|
||||||
|
@ -291,10 +284,6 @@ init_gtkwidgets_data (void)
|
||||||
/* default to the first one -> ogg */
|
/* default to the first one -> ogg */
|
||||||
gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), 0);
|
gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), 0);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
#else
|
|
||||||
g_warning ("This needs a newer version of GTK (2.24 at least)");
|
|
||||||
return FALSE;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- Generated with glade 3.18.3 -->
|
||||||
<interface>
|
<interface>
|
||||||
<requires lib="gtk+" version="2.16"/>
|
<requires lib="gtk+" version="3.0"/>
|
||||||
<object class="GtkWindow" id="mainWindow">
|
<object class="GtkWindow" id="mainWindow">
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="default_width">800</property>
|
<property name="default_width">800</property>
|
||||||
|
@ -21,7 +22,7 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">False</property>
|
<property name="receives_default">False</property>
|
||||||
<property name="use_action_appearance">False</property>
|
<property name="xalign">0.5</property>
|
||||||
<property name="active">True</property>
|
<property name="active">True</property>
|
||||||
<property name="draw_indicator">True</property>
|
<property name="draw_indicator">True</property>
|
||||||
<signal name="toggled" handler="on_imageRButton_toggled" swapped="no"/>
|
<signal name="toggled" handler="on_imageRButton_toggled" swapped="no"/>
|
||||||
|
@ -39,7 +40,7 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">False</property>
|
<property name="receives_default">False</property>
|
||||||
<property name="use_action_appearance">False</property>
|
<property name="xalign">0.5</property>
|
||||||
<property name="active">True</property>
|
<property name="active">True</property>
|
||||||
<property name="draw_indicator">True</property>
|
<property name="draw_indicator">True</property>
|
||||||
<property name="group">imageRButton</property>
|
<property name="group">imageRButton</property>
|
||||||
|
@ -97,7 +98,6 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<property name="use_action_appearance">False</property>
|
|
||||||
<signal name="clicked" handler="on_captureButton_clicked" swapped="no"/>
|
<signal name="clicked" handler="on_captureButton_clicked" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
|
@ -113,7 +113,6 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
<property name="use_action_appearance">False</property>
|
|
||||||
<signal name="clicked" handler="on_stopCaptureButton_clicked" swapped="no"/>
|
<signal name="clicked" handler="on_stopCaptureButton_clicked" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
|
|
Loading…
Reference in a new issue