From 0b3f95627751f82576435525150e68f20211cd4e Mon Sep 17 00:00:00 2001 From: David Schleef Date: Sat, 18 Feb 2012 17:37:29 -0800 Subject: [PATCH 1/9] riff: Add v210, r210 formats --- gst-libs/gst/riff/riff-media.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gst-libs/gst/riff/riff-media.c b/gst-libs/gst/riff/riff-media.c index 40b2bf628c..53d9c88b69 100644 --- a/gst-libs/gst/riff/riff-media.c +++ b/gst-libs/gst/riff/riff-media.c @@ -104,6 +104,19 @@ gst_riff_create_video_caps (guint32 codec_fcc, } break; } + case GST_MAKE_FOURCC ('r', '2', '1', '0'): + caps = gst_caps_new_simple ("video/x-raw-rgb", + "endianness", G_TYPE_INT, G_BIG_ENDIAN, "depth", G_TYPE_INT, 30, + "bpp", G_TYPE_INT, 32, + "endianness", G_TYPE_INT, G_BIG_ENDIAN, + "red_mask", G_TYPE_INT, 0x3ff00000, + "green_mask", G_TYPE_INT, 0x000ffc00, + "blue_mask", G_TYPE_INT, 0x000003ff, NULL); + + if (codec_name) + *codec_name = g_strdup ("Uncompressed packed RGB 10-bit 4:4:4"); + break; + case GST_MAKE_FOURCC ('I', '4', '2', '0'): caps = gst_caps_new_simple ("video/x-raw-yuv", "format", GST_TYPE_FOURCC, codec_fcc, NULL); @@ -142,6 +155,12 @@ gst_riff_create_video_caps (guint32 codec_fcc, if (codec_name) *codec_name = g_strdup ("Uncompressed packed YVU 4:2:2"); break; + case GST_MAKE_FOURCC ('v', '2', '1', '0'): + caps = gst_caps_new_simple ("video/x-raw-yuv", + "format", GST_TYPE_FOURCC, codec_fcc, NULL); + if (codec_name) + *codec_name = g_strdup ("Uncompressed packed 10-bit YUV 4:2:2"); + break; case GST_MAKE_FOURCC ('M', 'J', 'P', 'G'): /* YUY2 MJPEG */ case GST_MAKE_FOURCC ('A', 'V', 'R', 'n'): @@ -1828,6 +1847,8 @@ gst_riff_create_video_template_caps (void) GST_MAKE_FOURCC ('Y', 'V', '1', '2'), GST_MAKE_FOURCC ('L', 'O', 'C', 'O'), GST_MAKE_FOURCC ('Z', 'M', 'B', 'V'), + GST_MAKE_FOURCC ('v', '2', '1', '0'), + GST_MAKE_FOURCC ('r', '2', '1', '0'), /* FILL ME */ }; guint i; From f8dc679ca7e9542e6f410062df5e332fc8e0ba9d Mon Sep 17 00:00:00 2001 From: David Schleef Date: Sun, 19 Feb 2012 00:03:03 -0800 Subject: [PATCH 2/9] videoscale: fix AYUV64 scaling --- gst/videoscale/vs_lanczos.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gst/videoscale/vs_lanczos.c b/gst/videoscale/vs_lanczos.c index d141a01c78..67cd4017c1 100644 --- a/gst/videoscale/vs_lanczos.c +++ b/gst/videoscale/vs_lanczos.c @@ -728,6 +728,9 @@ RESAMPLE_HORIZ_AYUV_FLOAT (resample_horiz_double_ayuv_generic, double, double, RESAMPLE_HORIZ_AYUV_FLOAT (resample_horiz_float_ayuv_generic, float, float, guint8, n_taps) +RESAMPLE_HORIZ_AYUV_FLOAT (resample_horiz_double_ayuv_generic_s16, double, double, + guint16, n_taps) + RESAMPLE_HORIZ (resample_horiz_int32_int32_u8_generic, gint32, gint32, guint8, n_taps, shift) RESAMPLE_HORIZ (resample_horiz_int16_int16_u8_generic, gint16, gint16, @@ -1636,7 +1639,7 @@ vs_image_scale_lanczos_AYUV64_double (const VSImage * dest, const VSImage * src, scale->dither = dither; scale->horiz_resample_func = - (HorizResampleFunc) resample_horiz_double_ayuv_generic; + (HorizResampleFunc) resample_horiz_double_ayuv_generic_s16; scale->tmpdata = g_malloc (sizeof (double) * scale->dest->width * scale->src->height * 4); From 662830c21d6d03938289c5bc509674bf5d6a230e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 20 Feb 2012 14:09:28 +0100 Subject: [PATCH 3/9] seek: Explicitely call gst_x_overlay_expose() from the GtkDrawingArea expose/draw signal --- tests/examples/seek/seek.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index 3f63f35da6..2222323510 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -2459,6 +2459,7 @@ msg_clock_lost (GstBus * bus, GstMessage * message, GstPipeline * data) #if defined (GDK_WINDOWING_X11) || defined (GDK_WINDOWING_WIN32) +static GstElement *xoverlay_element = NULL; static gulong embed_xid = 0; /* We set the xid here in response to the prepare-xwindow-id message via a @@ -2473,6 +2474,8 @@ bus_sync_handler (GstBus * bus, GstMessage * message, GstPipeline * data) gst_structure_has_name (message->structure, "prepare-xwindow-id")) { GstElement *element = GST_ELEMENT (GST_MESSAGE_SRC (message)); + xoverlay_element = element; + g_print ("got prepare-xwindow-id, setting XID %lu\n", embed_xid); if (g_object_class_find_property (G_OBJECT_GET_CLASS (element), @@ -2506,6 +2509,10 @@ draw_cb (GtkWidget * widget, cairo_t * cr, gpointer data) cairo_fill (cr); return TRUE; } + + if (xoverlay_element) + gst_x_overlay_expose (GST_X_OVERLAY (xoverlay_element)); + return FALSE; } From 775d851d66c2c34392a9dc515dc48565e4df58a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 20 Feb 2012 14:35:37 +0100 Subject: [PATCH 4/9] seek: Add window-embedding support for OS X/Quartz osxvideosink implements the GstXOverlay interface since some time now. --- tests/examples/seek/seek.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index 2222323510..0a4c3c5969 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -40,6 +40,8 @@ #include #elif defined (GDK_WINDOWING_WIN32) #include +#elif defined (GDK_WINDOWING_QUARTZ) +#include #endif #include @@ -2457,10 +2459,10 @@ msg_clock_lost (GstBus * bus, GstMessage * message, GstPipeline * data) } } -#if defined (GDK_WINDOWING_X11) || defined (GDK_WINDOWING_WIN32) +#if defined (GDK_WINDOWING_X11) || defined (GDK_WINDOWING_WIN32) || defined (GDK_WINDOWING_QUARTZ) static GstElement *xoverlay_element = NULL; -static gulong embed_xid = 0; +static guintptr embed_xid = 0; /* We set the xid here in response to the prepare-xwindow-id message via a * bus sync handler because we don't know the actual videosink used from the @@ -2529,7 +2531,10 @@ realize_cb (GtkWidget * widget, gpointer data) #if defined (GDK_WINDOWING_WIN32) embed_xid = GDK_WINDOW_HWND (window); g_print ("Window realize: video window HWND = %lu\n", embed_xid); -#else +#elif defined (GDK_WINDOWING_QUARTZ) + embed_xid = gdk_quartz_window_get_nsview (window); + g_print ("Window realize: video window NSView = %p\n", embed_xid); +#elif defined (GDK_WINDOWING_X11) embed_xid = GDK_WINDOW_XID (window); g_print ("Window realize: video window XID = %lu\n", embed_xid); #endif @@ -2563,7 +2568,7 @@ connect_bus_signals (GstElement * pipeline) { GstBus *bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); -#if defined (GDK_WINDOWING_X11) || defined (GDK_WINDOWING_WIN32) +#if defined (GDK_WINDOWING_X11) || defined (GDK_WINDOWING_WIN32) || defined (GDK_WINDOWING_QUARTZ) /* handle prepare-xwindow-id element message synchronously */ gst_bus_set_sync_handler (bus, (GstBusSyncHandler) bus_sync_handler, pipeline); @@ -3014,7 +3019,7 @@ main (int argc, char **argv) * asks for the XID of the window to render onto */ gtk_widget_realize (window); -#if defined (GDK_WINDOWING_X11) || defined (GDK_WINDOWING_WIN32) +#if defined (GDK_WINDOWING_X11) || defined (GDK_WINDOWING_WIN32) || defined (GDK_WINDOWING_QUARTZ) /* we should have the XID now */ g_assert (embed_xid != 0); #endif From 4262e93019b9bc976a899f1bd0686f783293a7b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 20 Feb 2012 14:57:11 +0100 Subject: [PATCH 5/9] seek: Keep a reference to the xoverlay element --- tests/examples/seek/seek.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index 0a4c3c5969..c7b53dad8d 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -2476,7 +2476,9 @@ bus_sync_handler (GstBus * bus, GstMessage * message, GstPipeline * data) gst_structure_has_name (message->structure, "prepare-xwindow-id")) { GstElement *element = GST_ELEMENT (GST_MESSAGE_SRC (message)); - xoverlay_element = element; + if (xoverlay_element) + gst_object_unref (xoverlay_element); + xoverlay_element = GST_ELEMENT (gst_object_ref (element)); g_print ("got prepare-xwindow-id, setting XID %lu\n", embed_xid); @@ -3035,6 +3037,9 @@ main (int argc, char **argv) g_print ("NULL pipeline\n"); gst_element_set_state (pipeline, GST_STATE_NULL); + if (xoverlay_element) + gst_object_unref (xoverlay_element); + g_print ("free pipeline\n"); gst_object_unref (pipeline); From e87f71245f463ef6e8abf1263c2ae4938ede00a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 20 Feb 2012 14:57:36 +0100 Subject: [PATCH 6/9] seek: Add support for the navigation interface --- tests/examples/seek/seek.c | 99 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index c7b53dad8d..70aa0e5bad 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -45,6 +45,7 @@ #endif #include +#include GST_DEBUG_CATEGORY_STATIC (seek_debug); #define GST_CAT_DEFAULT (seek_debug) @@ -2462,8 +2463,33 @@ msg_clock_lost (GstBus * bus, GstMessage * message, GstPipeline * data) #if defined (GDK_WINDOWING_X11) || defined (GDK_WINDOWING_WIN32) || defined (GDK_WINDOWING_QUARTZ) static GstElement *xoverlay_element = NULL; +static GstElement *navigation_element = NULL; static guintptr embed_xid = 0; +static void +find_navigation_element (void) +{ + GstElement *video_sink; + + g_object_get (pipeline, "video-sink", &video_sink, NULL); + if (!video_sink) + return; + + if (navigation_element) + gst_object_unref (navigation_element); + + if (GST_IS_NAVIGATION (video_sink)) { + navigation_element = gst_object_ref (video_sink); + } else if (GST_IS_BIN (video_sink)) { + navigation_element = + gst_bin_get_by_interface (GST_BIN (video_sink), GST_TYPE_NAVIGATION); + } else { + navigation_element = NULL; + } + + gst_object_unref (video_sink); +} + /* We set the xid here in response to the prepare-xwindow-id message via a * bus sync handler because we don't know the actual videosink used from the * start (as we don't know the pipeline, or bin elements such as autovideosink @@ -2495,6 +2521,9 @@ bus_sync_handler (GstBus * bus, GstMessage * message, GstPipeline * data) g_assert (embed_xid != 0); gst_x_overlay_set_window_handle (GST_X_OVERLAY (element), embed_xid); + gst_x_overlay_handle_events (GST_X_OVERLAY (element), FALSE); + + find_navigation_element (); } return GST_BUS_PASS; } @@ -2542,6 +2571,60 @@ realize_cb (GtkWidget * widget, gpointer data) #endif } +static gboolean +button_press_cb (GtkWidget * widget, GdkEventButton * event, gpointer user_data) +{ + gtk_widget_grab_focus (widget); + + if (navigation_element) + gst_navigation_send_mouse_event (GST_NAVIGATION (navigation_element), + "mouse-button-press", event->button, event->x, event->y); + + return FALSE; +} + +static gboolean +button_release_cb (GtkWidget * widget, GdkEventButton * event, + gpointer user_data) +{ + if (navigation_element) + gst_navigation_send_mouse_event (GST_NAVIGATION (navigation_element), + "mouse-button-release", event->button, event->x, event->y); + + return FALSE; +} + +static gboolean +key_press_cb (GtkWidget * widget, GdkEventKey * event, gpointer user_data) +{ + if (navigation_element) + gst_navigation_send_key_event (GST_NAVIGATION (navigation_element), + "key-press", gdk_keyval_name (event->keyval)); + + return FALSE; +} + +static gboolean +key_release_cb (GtkWidget * widget, GdkEventKey * event, gpointer user_data) +{ + if (navigation_element) + gst_navigation_send_key_event (GST_NAVIGATION (navigation_element), + "key-release", gdk_keyval_name (event->keyval)); + + return FALSE; +} + +static gboolean +motion_notify_cb (GtkWidget * widget, GdkEventMotion * event, + gpointer user_data) +{ + if (navigation_element) + gst_navigation_send_mouse_event (GST_NAVIGATION (navigation_element), + "mouse-move", 0, event->x, event->y); + + return FALSE; +} + static void msg_eos (GstBus * bus, GstMessage * message, GstPipeline * data) { @@ -2752,7 +2835,21 @@ main (int argc, char **argv) video_window = gtk_drawing_area_new (); g_signal_connect (video_window, "draw", G_CALLBACK (draw_cb), NULL); g_signal_connect (video_window, "realize", G_CALLBACK (realize_cb), NULL); + g_signal_connect (video_window, "button-press-event", + G_CALLBACK (button_press_cb), NULL); + g_signal_connect (video_window, "button-release-event", + G_CALLBACK (button_release_cb), NULL); + g_signal_connect (video_window, "key-press-event", G_CALLBACK (key_press_cb), + NULL); + g_signal_connect (video_window, "key-release-event", + G_CALLBACK (key_release_cb), NULL); + g_signal_connect (video_window, "motion-notify-event", + G_CALLBACK (motion_notify_cb), NULL); + gtk_widget_set_can_focus (video_window, TRUE); gtk_widget_set_double_buffered (video_window, FALSE); + gtk_widget_add_events (video_window, + GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK); statusbar = gtk_statusbar_new (); status_id = gtk_statusbar_get_context_id (GTK_STATUSBAR (statusbar), "seek"); @@ -3039,6 +3136,8 @@ main (int argc, char **argv) if (xoverlay_element) gst_object_unref (xoverlay_element); + if (navigation_element) + gst_object_unref (navigation_element); g_print ("free pipeline\n"); gst_object_unref (pipeline); From a24c72cccaa8d9e84ff15285b5af403d168ed3c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 20 Feb 2012 15:29:49 +0100 Subject: [PATCH 7/9] seek: Make the seek-bar insensitive for DVD menus --- tests/examples/seek/seek.c | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index 70aa0e5bad..e9eb17fb6a 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -1606,6 +1606,7 @@ stop_cb (GtkButton * button, gpointer data) connect_bus_signals (pipeline); } #endif + gtk_widget_set_sensitive (GTK_WIDGET (hscale), TRUE); } return; @@ -2648,6 +2649,53 @@ msg_step_done (GstBus * bus, GstMessage * message, GstPipeline * data) message_received (bus, message, data); } +static void +msg (GstBus * bus, GstMessage * message, GstPipeline * data) +{ + GstNavigationMessageType nav_type; + + nav_type = gst_navigation_message_get_type (message); + switch (nav_type) { + case GST_NAVIGATION_MESSAGE_COMMANDS_CHANGED:{ + GstQuery *query; + gboolean res; + + /* Heuristic to detect if we're dealing with a DVD menu */ + query = gst_navigation_query_new_commands (); + res = gst_element_query (GST_ELEMENT (GST_MESSAGE_SRC (message)), query); + + if (res) { + gboolean is_menu = FALSE; + guint i, n; + + if (gst_navigation_query_parse_commands_length (query, &n)) { + for (i = 0; i < n; i++) { + GstNavigationCommand cmd; + + if (!gst_navigation_query_parse_commands_nth (query, i, &cmd)) + break; + + is_menu |= (cmd == GST_NAVIGATION_COMMAND_ACTIVATE); + is_menu |= (cmd == GST_NAVIGATION_COMMAND_LEFT); + is_menu |= (cmd == GST_NAVIGATION_COMMAND_RIGHT); + is_menu |= (cmd == GST_NAVIGATION_COMMAND_UP); + is_menu |= (cmd == GST_NAVIGATION_COMMAND_DOWN); + } + } + + gtk_widget_set_sensitive (GTK_WIDGET (hscale), !is_menu); + } else { + g_assert_not_reached (); + } + + gst_query_unref (query); + break; + } + default: + break; + } +} + static void connect_bus_signals (GstElement * pipeline) { @@ -2692,6 +2740,7 @@ connect_bus_signals (GstElement * pipeline) pipeline); g_signal_connect (bus, "sync-message::step-done", (GCallback) msg_sync_step_done, pipeline); + g_signal_connect (bus, "message", (GCallback) msg, pipeline); gst_object_unref (bus); } From 98b7177aa3dd5b21d3ae2915a1d467a24c6236bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 20 Feb 2012 16:44:07 +0100 Subject: [PATCH 8/9] seek: Add support for sending navigation commands --- tests/examples/seek/seek.c | 200 +++++++++++++++++++++++++++++++++++-- 1 file changed, 194 insertions(+), 6 deletions(-) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index e9eb17fb6a..552419b720 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -125,6 +125,12 @@ static GtkWidget *shuttle_checkbox, *step_button; static GtkWidget *shuttle_hscale; static GtkAdjustment *shuttle_adjustment; +static struct +{ + GstNavigationCommand cmd; + GtkWidget *button; +} navigation_buttons[14]; + static GList *paths = NULL, *l = NULL; /* we keep an array of the visualisation entries so that we can easily switch @@ -139,6 +145,7 @@ static GArray *vis_entries; static void clear_streams (GstElement * pipeline); static void volume_notify_cb (GstElement * pipeline, GParamSpec * arg, gpointer user_dat); +static void find_navigation_element (void); /* pipeline construction */ @@ -1562,6 +1569,7 @@ stop_cb (GtkButton * button, gpointer data) { if (state != STOP_STATE) { GstStateChangeReturn ret; + gint i; g_print ("READY pipeline\n"); gtk_statusbar_pop (GTK_STATUSBAR (statusbar), status_id); @@ -1607,6 +1615,8 @@ stop_cb (GtkButton * button, gpointer data) } #endif gtk_widget_set_sensitive (GTK_WIDGET (hscale), TRUE); + for (i = 0; i < G_N_ELEMENTS (navigation_buttons); i++) + gtk_widget_set_sensitive (navigation_buttons[i].button, FALSE); } return; @@ -2296,6 +2306,8 @@ msg_async_done (GstBus * bus, GstMessage * message, GstPipeline * pipeline) /* update the available streams */ update_streams (pipeline); + + find_navigation_element (); } static void @@ -2461,11 +2473,7 @@ msg_clock_lost (GstBus * bus, GstMessage * message, GstPipeline * data) } } -#if defined (GDK_WINDOWING_X11) || defined (GDK_WINDOWING_WIN32) || defined (GDK_WINDOWING_QUARTZ) - -static GstElement *xoverlay_element = NULL; static GstElement *navigation_element = NULL; -static guintptr embed_xid = 0; static void find_navigation_element (void) @@ -2491,6 +2499,26 @@ find_navigation_element (void) gst_object_unref (video_sink); } +/* called when Navigation command button is pressed */ +static void +navigation_cmd_cb (GtkButton * button, gpointer data) +{ + GstNavigationCommand cmd = GPOINTER_TO_INT (data); + + if (!navigation_element) { + find_navigation_element (); + if (!navigation_element) + return; + } + + gst_navigation_send_command (GST_NAVIGATION (navigation_element), cmd); +} + +#if defined (GDK_WINDOWING_X11) || defined (GDK_WINDOWING_WIN32) || defined (GDK_WINDOWING_QUARTZ) + +static GstElement *xoverlay_element = NULL; +static guintptr embed_xid = 0; + /* We set the xid here in response to the prepare-xwindow-id message via a * bus sync handler because we don't know the actual videosink used from the * start (as we don't know the pipeline, or bin elements such as autovideosink @@ -2658,12 +2686,15 @@ msg (GstBus * bus, GstMessage * message, GstPipeline * data) switch (nav_type) { case GST_NAVIGATION_MESSAGE_COMMANDS_CHANGED:{ GstQuery *query; - gboolean res; + gboolean res, j; /* Heuristic to detect if we're dealing with a DVD menu */ query = gst_navigation_query_new_commands (); res = gst_element_query (GST_ELEMENT (GST_MESSAGE_SRC (message)), query); + for (j = 0; j < G_N_ELEMENTS (navigation_buttons); j++) + gtk_widget_set_sensitive (navigation_buttons[j].button, FALSE); + if (res) { gboolean is_menu = FALSE; guint i, n; @@ -2680,6 +2711,13 @@ msg (GstBus * bus, GstMessage * message, GstPipeline * data) is_menu |= (cmd == GST_NAVIGATION_COMMAND_RIGHT); is_menu |= (cmd == GST_NAVIGATION_COMMAND_UP); is_menu |= (cmd == GST_NAVIGATION_COMMAND_DOWN); + + for (j = 0; j < G_N_ELEMENTS (navigation_buttons); j++) { + if (navigation_buttons[j].cmd != cmd) + continue; + + gtk_widget_set_sensitive (navigation_buttons[j].button, TRUE); + } } } @@ -2803,7 +2841,7 @@ int main (int argc, char **argv) { GtkWidget *window, *hbox, *vbox, *panel, *expander, *pb2vbox, *boxes, - *flagtable, *boxes2, *step; + *flagtable, *boxes2, *step, *navigation; GtkWidget *play_button, *pause_button, *stop_button, *shot_button; GtkWidget *accurate_checkbox, *key_checkbox, *loop_checkbox, *flush_checkbox; GtkWidget *scrub_checkbox, *play_scrub_checkbox; @@ -2998,6 +3036,155 @@ main (int argc, char **argv) gtk_container_add (GTK_CONTAINER (step), hbox); } + /* navigation command expander */ + { + GtkWidget *navigation_button; + GtkWidget *grid; + gint i = 0; + + navigation = gtk_expander_new ("navigation commands"); + grid = gtk_grid_new (); + gtk_grid_set_row_spacing (GTK_GRID (grid), 2); + gtk_grid_set_row_homogeneous (GTK_GRID (grid), TRUE); + gtk_grid_set_column_spacing (GTK_GRID (grid), 2); + gtk_grid_set_column_homogeneous (GTK_GRID (grid), TRUE); + + navigation_button = gtk_button_new_with_label ("Menu 1"); + g_signal_connect (G_OBJECT (navigation_button), "clicked", + G_CALLBACK (navigation_cmd_cb), + GINT_TO_POINTER (GST_NAVIGATION_COMMAND_MENU1)); + gtk_grid_attach (GTK_GRID (grid), navigation_button, i, 0, 1, 1); + gtk_widget_set_sensitive (navigation_button, FALSE); + gtk_widget_set_tooltip_text (navigation_button, "DVD Menu"); + navigation_buttons[i].button = navigation_button; + navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU1; + + navigation_button = gtk_button_new_with_label ("Menu 2"); + g_signal_connect (G_OBJECT (navigation_button), "clicked", + G_CALLBACK (navigation_cmd_cb), + GINT_TO_POINTER (GST_NAVIGATION_COMMAND_MENU2)); + gtk_grid_attach (GTK_GRID (grid), navigation_button, i, 0, 1, 1); + gtk_widget_set_sensitive (navigation_button, FALSE); + gtk_widget_set_tooltip_text (navigation_button, "DVD Title Menu"); + navigation_buttons[i].button = navigation_button; + navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU2; + + navigation_button = gtk_button_new_with_label ("Menu 3"); + g_signal_connect (G_OBJECT (navigation_button), "clicked", + G_CALLBACK (navigation_cmd_cb), + GINT_TO_POINTER (GST_NAVIGATION_COMMAND_MENU3)); + gtk_grid_attach (GTK_GRID (grid), navigation_button, i, 0, 1, 1); + gtk_widget_set_sensitive (navigation_button, FALSE); + gtk_widget_set_tooltip_text (navigation_button, "DVD Root Menu"); + navigation_buttons[i].button = navigation_button; + navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU3; + + navigation_button = gtk_button_new_with_label ("Menu 4"); + g_signal_connect (G_OBJECT (navigation_button), "clicked", + G_CALLBACK (navigation_cmd_cb), + GINT_TO_POINTER (GST_NAVIGATION_COMMAND_MENU4)); + gtk_grid_attach (GTK_GRID (grid), navigation_button, i, 0, 1, 1); + gtk_widget_set_sensitive (navigation_button, FALSE); + gtk_widget_set_tooltip_text (navigation_button, "DVD Subpicture Menu"); + navigation_buttons[i].button = navigation_button; + navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU4; + + navigation_button = gtk_button_new_with_label ("Menu 5"); + g_signal_connect (G_OBJECT (navigation_button), "clicked", + G_CALLBACK (navigation_cmd_cb), + GINT_TO_POINTER (GST_NAVIGATION_COMMAND_MENU5)); + gtk_grid_attach (GTK_GRID (grid), navigation_button, i, 0, 1, 1); + gtk_widget_set_sensitive (navigation_button, FALSE); + gtk_widget_set_tooltip_text (navigation_button, "DVD Audio Menu"); + navigation_buttons[i].button = navigation_button; + navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU5; + + navigation_button = gtk_button_new_with_label ("Menu 6"); + g_signal_connect (G_OBJECT (navigation_button), "clicked", + G_CALLBACK (navigation_cmd_cb), + GINT_TO_POINTER (GST_NAVIGATION_COMMAND_MENU6)); + gtk_grid_attach (GTK_GRID (grid), navigation_button, i, 0, 1, 1); + gtk_widget_set_sensitive (navigation_button, FALSE); + gtk_widget_set_tooltip_text (navigation_button, "DVD Angle Menu"); + navigation_buttons[i].button = navigation_button; + navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU6; + + navigation_button = gtk_button_new_with_label ("Menu 7"); + g_signal_connect (G_OBJECT (navigation_button), "clicked", + G_CALLBACK (navigation_cmd_cb), + GINT_TO_POINTER (GST_NAVIGATION_COMMAND_MENU7)); + gtk_grid_attach (GTK_GRID (grid), navigation_button, i, 0, 1, 1); + gtk_widget_set_sensitive (navigation_button, FALSE); + gtk_widget_set_tooltip_text (navigation_button, "DVD Chapter Menu"); + navigation_buttons[i].button = navigation_button; + navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU7; + + navigation_button = gtk_button_new_with_label ("Left"); + g_signal_connect (G_OBJECT (navigation_button), "clicked", + G_CALLBACK (navigation_cmd_cb), + GINT_TO_POINTER (GST_NAVIGATION_COMMAND_LEFT)); + gtk_grid_attach (GTK_GRID (grid), navigation_button, i - 7, 1, 1, 1); + gtk_widget_set_sensitive (navigation_button, FALSE); + navigation_buttons[i].button = navigation_button; + navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_LEFT; + + navigation_button = gtk_button_new_with_label ("Right"); + g_signal_connect (G_OBJECT (navigation_button), "clicked", + G_CALLBACK (navigation_cmd_cb), + GINT_TO_POINTER (GST_NAVIGATION_COMMAND_RIGHT)); + gtk_grid_attach (GTK_GRID (grid), navigation_button, i - 7, 1, 1, 1); + gtk_widget_set_sensitive (navigation_button, FALSE); + navigation_buttons[i].button = navigation_button; + navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_RIGHT; + + navigation_button = gtk_button_new_with_label ("Up"); + g_signal_connect (G_OBJECT (navigation_button), "clicked", + G_CALLBACK (navigation_cmd_cb), + GINT_TO_POINTER (GST_NAVIGATION_COMMAND_UP)); + gtk_grid_attach (GTK_GRID (grid), navigation_button, i - 7, 1, 1, 1); + gtk_widget_set_sensitive (navigation_button, FALSE); + navigation_buttons[i].button = navigation_button; + navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_UP; + + navigation_button = gtk_button_new_with_label ("Down"); + g_signal_connect (G_OBJECT (navigation_button), "clicked", + G_CALLBACK (navigation_cmd_cb), + GINT_TO_POINTER (GST_NAVIGATION_COMMAND_DOWN)); + gtk_grid_attach (GTK_GRID (grid), navigation_button, i - 7, 1, 1, 1); + gtk_widget_set_sensitive (navigation_button, FALSE); + navigation_buttons[i].button = navigation_button; + navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_DOWN; + + navigation_button = gtk_button_new_with_label ("Activate"); + g_signal_connect (G_OBJECT (navigation_button), "clicked", + G_CALLBACK (navigation_cmd_cb), + GINT_TO_POINTER (GST_NAVIGATION_COMMAND_ACTIVATE)); + gtk_grid_attach (GTK_GRID (grid), navigation_button, i - 7, 1, 1, 1); + gtk_widget_set_sensitive (navigation_button, FALSE); + navigation_buttons[i].button = navigation_button; + navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_ACTIVATE; + + navigation_button = gtk_button_new_with_label ("Prev. Angle"); + g_signal_connect (G_OBJECT (navigation_button), "clicked", + G_CALLBACK (navigation_cmd_cb), + GINT_TO_POINTER (GST_NAVIGATION_COMMAND_PREV_ANGLE)); + gtk_grid_attach (GTK_GRID (grid), navigation_button, i - 7, 1, 1, 1); + gtk_widget_set_sensitive (navigation_button, FALSE); + navigation_buttons[i].button = navigation_button; + navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_PREV_ANGLE; + + navigation_button = gtk_button_new_with_label ("Next. Angle"); + g_signal_connect (G_OBJECT (navigation_button), "clicked", + G_CALLBACK (navigation_cmd_cb), + GINT_TO_POINTER (GST_NAVIGATION_COMMAND_NEXT_ANGLE)); + gtk_grid_attach (GTK_GRID (grid), navigation_button, i - 7, 1, 1, 1); + gtk_widget_set_sensitive (navigation_button, FALSE); + navigation_buttons[i].button = navigation_button; + navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_NEXT_ANGLE; + + gtk_container_add (GTK_CONTAINER (navigation), grid); + } + /* seek bar */ adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.00, N_GRAD, 0.1, 1.0, 1.0)); @@ -3130,6 +3317,7 @@ main (int argc, char **argv) gtk_box_pack_start (GTK_BOX (vbox), expander, FALSE, FALSE, 2); } gtk_box_pack_start (GTK_BOX (vbox), step, FALSE, FALSE, 2); + gtk_box_pack_start (GTK_BOX (vbox), navigation, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), hscale, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), statusbar, FALSE, FALSE, 2); From 0c85bb60ea8b322c5dc2ed7517f98e7d8c61bef5 Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Mon, 20 Feb 2012 20:39:59 +0100 Subject: [PATCH 9/9] seek: fix format strings --- tests/examples/seek/seek.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index 552419b720..c90691517d 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -2535,7 +2535,8 @@ bus_sync_handler (GstBus * bus, GstMessage * message, GstPipeline * data) gst_object_unref (xoverlay_element); xoverlay_element = GST_ELEMENT (gst_object_ref (element)); - g_print ("got prepare-xwindow-id, setting XID %lu\n", embed_xid); + g_print ("got prepare-xwindow-id, setting XID %" G_GUINTPTR_FORMAT "\n", + embed_xid); if (g_object_class_find_property (G_OBJECT_GET_CLASS (element), "force-aspect-ratio")) { @@ -2596,7 +2597,8 @@ realize_cb (GtkWidget * widget, gpointer data) g_print ("Window realize: video window NSView = %p\n", embed_xid); #elif defined (GDK_WINDOWING_X11) embed_xid = GDK_WINDOW_XID (window); - g_print ("Window realize: video window XID = %lu\n", embed_xid); + g_print ("Window realize: video window XID = %" G_GUINTPTR_FORMAT "\n", + embed_xid); #endif }