ext/libvisual/visual.c: update to work also with libvisual 0.4 API
authorStefan Kost <ensonic@users.sourceforge.net>
Mon, 18 Sep 2006 11:40:14 +0000 (11:40 +0000)
committerStefan Kost <ensonic@users.sourceforge.net>
Mon, 18 Sep 2006 11:40:14 +0000 (11:40 +0000)
Original commit message from CVS:
* ext/libvisual/visual.c: (gst_vis_src_negotiate),
(gst_visual_chain), (gst_visual_change_state):
update to work also with libvisual 0.4 API
* tools/gst-launch-ext.1.in:
* tools/gst-visualise.1.in:
remove references to old man-pages
* tests/examples/seek/seek.c: (main):
add real meadi-buttons, add tool-tips for the seek-options, arrange
seek options in a table

ChangeLog
ext/libvisual/visual.c
tests/examples/seek/seek.c
tools/gst-launch-ext.1.in
tools/gst-visualise.1.in

index 7e6aee7..991cff3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2006-09-18  Stefan Kost  <ensonic@users.sf.net>
+
+       * ext/libvisual/visual.c: (gst_vis_src_negotiate),
+       (gst_visual_chain), (gst_visual_change_state):
+         update to work also with libvisual 0.4 API
+         
+       * tools/gst-launch-ext.1.in:
+       * tools/gst-visualise.1.in:
+         remove references to old man-pages
+
+       * tests/examples/seek/seek.c: (main):
+         add real meadi-buttons, add tool-tips for the seek-options, arrange
+         seek options in a table
+
 2006-09-18  Michael Smith  <msmith@fluendo.com>
 
        * ext/ogg/gstoggmux.c: (gst_ogg_mux_clear),
index 7359d9f..a3a5946 100644 (file)
@@ -411,7 +411,6 @@ no_format:
     GST_ELEMENT_ERROR (visual, STREAM, FORMAT, (NULL),
         ("could not negotiate output format"));
     gst_caps_unref (intersect);
-    gst_caps_unref (othercaps);
     return FALSE;
   }
 }
@@ -636,6 +635,7 @@ gst_visual_chain (GstPad * pad, GstBuffer * buffer)
     visual_audio_analyze (&visual->audio);
     visual_actor_run (visual->actor, &visual->audio);
     visual_video_set_buffer (visual->video, NULL);
+    GST_DEBUG_OBJECT (visual, "rendered one frame");
 
     GST_BUFFER_TIMESTAMP (outbuf) = visual->next_ts;
     GST_BUFFER_DURATION (outbuf) = visual->duration;
@@ -682,7 +682,9 @@ gst_visual_change_state (GstElement * element, GstStateChange transition)
           visual_actor_new (GST_VISUAL_GET_CLASS (visual)->plugin->info->
           plugname);
       visual->video = visual_video_new ();
-
+#if defined(VISUAL_API_VERSION) && VISUAL_API_VERSION >= 4000 && VISUAL_API_VERSION < 5000
+      visual_audio_init (&visual->audio);
+#endif
       /* can't have a play without actors */
       if (!visual->actor || !visual->video)
         goto no_actors;
index 1a819b7..013f7d6 100644 (file)
@@ -1368,9 +1368,11 @@ print_usage (int argc, char **argv)
 int
 main (int argc, char **argv)
 {
-  GtkWidget *window, *hbox, *vbox, *play_button, *pause_button, *stop_button;
+  GtkWidget *window, *hbox, *vbox, *flagtable;
+  GtkWidget *play_button, *pause_button, *stop_button;
   GtkWidget *accurate_checkbox, *key_checkbox, *loop_checkbox, *flush_checkbox;
   GtkWidget *scrub_checkbox, *play_scrub_checkbox;
+  GtkTooltips *tips;
   GOptionEntry options[] = {
     {"stats", 's', 0, G_OPTION_ARG_NONE, &stats,
         "Show pad stats", NULL},
@@ -1384,7 +1386,7 @@ main (int argc, char **argv)
   GOptionContext *ctx;
   GError *err = NULL;
 
-  ctx = g_option_context_new ("seek");
+  ctx = g_option_context_new ("- test seeking in gsteamer");
   g_option_context_add_main_entries (ctx, options, NULL);
   g_option_context_add_group (ctx, gst_init_get_option_group ());
 
@@ -1413,23 +1415,43 @@ main (int argc, char **argv)
   g_assert (pipeline);
 
   /* initialize gui elements ... */
+  tips = gtk_tooltips_new ();
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
   hbox = gtk_hbox_new (FALSE, 0);
   vbox = gtk_vbox_new (FALSE, 0);
-  play_button = gtk_button_new_with_label ("play");
-  pause_button = gtk_button_new_with_label ("pause");
-  stop_button = gtk_button_new_with_label ("stop");
+  flagtable = gtk_table_new (3, 2, FALSE);
+  gtk_container_set_border_width (GTK_CONTAINER (vbox), 3);
 
+  /* media controls */
+  play_button = gtk_button_new_from_stock (GTK_STOCK_MEDIA_PLAY);
+  pause_button = gtk_button_new_from_stock (GTK_STOCK_MEDIA_PAUSE);
+  stop_button = gtk_button_new_from_stock (GTK_STOCK_MEDIA_STOP);
+
+  /* seek flags */
   accurate_checkbox = gtk_check_button_new_with_label ("Accurate Seek");
-  key_checkbox = gtk_check_button_new_with_label ("Key_unit Seek");
+  key_checkbox = gtk_check_button_new_with_label ("Key-unit Seek");
   loop_checkbox = gtk_check_button_new_with_label ("Loop");
   flush_checkbox = gtk_check_button_new_with_label ("Flush");
   scrub_checkbox = gtk_check_button_new_with_label ("Scrub");
   play_scrub_checkbox = gtk_check_button_new_with_label ("Play Scrub");
 
+  gtk_tooltips_set_tip (tips, accurate_checkbox,
+      "accurate position is requested, this might be considerably slower for some formats",
+      NULL);
+  gtk_tooltips_set_tip (tips, key_checkbox,
+      "seek to the nearest keyframe. This might be faster but less accurate",
+      NULL);
+  gtk_tooltips_set_tip (tips, loop_checkbox, "loop playback", NULL);
+  gtk_tooltips_set_tip (tips, flush_checkbox, "flush pipeline after seeking",
+      NULL);
+  /* FIXME: describe these */
+  gtk_tooltips_set_tip (tips, scrub_checkbox, "???", NULL);
+  gtk_tooltips_set_tip (tips, play_scrub_checkbox, "???", NULL);
+
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (flush_checkbox), TRUE);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (scrub_checkbox), TRUE);
 
+  /* seek bar */
   adjustment =
       GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.00, 100.0, 0.1, 1.0, 1.0));
   hscale = gtk_hscale_new (adjustment);
@@ -1450,12 +1472,15 @@ main (int argc, char **argv)
   gtk_box_pack_start (GTK_BOX (hbox), play_button, FALSE, FALSE, 2);
   gtk_box_pack_start (GTK_BOX (hbox), pause_button, FALSE, FALSE, 2);
   gtk_box_pack_start (GTK_BOX (hbox), stop_button, FALSE, FALSE, 2);
-  gtk_box_pack_start (GTK_BOX (hbox), accurate_checkbox, FALSE, FALSE, 2);
-  gtk_box_pack_start (GTK_BOX (hbox), key_checkbox, FALSE, FALSE, 2);
-  gtk_box_pack_start (GTK_BOX (hbox), loop_checkbox, FALSE, FALSE, 2);
-  gtk_box_pack_start (GTK_BOX (hbox), flush_checkbox, FALSE, FALSE, 2);
-  gtk_box_pack_start (GTK_BOX (hbox), scrub_checkbox, FALSE, FALSE, 2);
-  gtk_box_pack_start (GTK_BOX (hbox), play_scrub_checkbox, FALSE, FALSE, 2);
+  gtk_box_pack_start (GTK_BOX (hbox), flagtable, FALSE, FALSE, 2);
+  gtk_table_attach_defaults (GTK_TABLE (flagtable), accurate_checkbox, 0, 1, 0,
+      1);
+  gtk_table_attach_defaults (GTK_TABLE (flagtable), flush_checkbox, 1, 2, 0, 1);
+  gtk_table_attach_defaults (GTK_TABLE (flagtable), loop_checkbox, 2, 3, 0, 1);
+  gtk_table_attach_defaults (GTK_TABLE (flagtable), key_checkbox, 0, 1, 1, 2);
+  gtk_table_attach_defaults (GTK_TABLE (flagtable), scrub_checkbox, 1, 2, 1, 2);
+  gtk_table_attach_defaults (GTK_TABLE (flagtable), play_scrub_checkbox, 2, 3,
+      1, 2);
   gtk_box_pack_start (GTK_BOX (vbox), hscale, TRUE, TRUE, 2);
 
   /* connect things ... */
index fd2ebf1..ada7380 100644 (file)
@@ -36,9 +36,6 @@ or sdlvideosink.
 Other plug-ins might be used as well if GStreamer has them.
 
 .SH "SEE ALSO"
-.BR gst\-guilaunch (1),
-.BR gst\-complete (1),
-.BR gst\-register (1),
 .BR gst\-inspect (1),
 .BR gst\-launch (1),
 .SH "AUTHOR"
index f61446e..5b5a1fc 100644 (file)
@@ -26,9 +26,6 @@ VIDEOSINK parameter in ~/.gst, defaulting to sdlvideosink.
 
 .SH "SEE ALSO"
 .BR gst\-launch\-ext (1),
-.BR gst\-guilaunch (1),
-.BR gst\-complete (1),
-.BR gst\-register (1),
 .BR gst\-inspect (1),
 .BR gst\-launch (1),
 .SH "AUTHOR"