ext/libvisual/visual.c: update to work also with libvisual 0.4 API

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
This commit is contained in:
Stefan Kost 2006-09-18 11:40:14 +00:00
parent 084dacbba2
commit dfb5b3011f
5 changed files with 55 additions and 20 deletions

View file

@ -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> 2006-09-18 Michael Smith <msmith@fluendo.com>
* ext/ogg/gstoggmux.c: (gst_ogg_mux_clear), * ext/ogg/gstoggmux.c: (gst_ogg_mux_clear),

View file

@ -411,7 +411,6 @@ no_format:
GST_ELEMENT_ERROR (visual, STREAM, FORMAT, (NULL), GST_ELEMENT_ERROR (visual, STREAM, FORMAT, (NULL),
("could not negotiate output format")); ("could not negotiate output format"));
gst_caps_unref (intersect); gst_caps_unref (intersect);
gst_caps_unref (othercaps);
return FALSE; return FALSE;
} }
} }
@ -636,6 +635,7 @@ gst_visual_chain (GstPad * pad, GstBuffer * buffer)
visual_audio_analyze (&visual->audio); visual_audio_analyze (&visual->audio);
visual_actor_run (visual->actor, &visual->audio); visual_actor_run (visual->actor, &visual->audio);
visual_video_set_buffer (visual->video, NULL); visual_video_set_buffer (visual->video, NULL);
GST_DEBUG_OBJECT (visual, "rendered one frame");
GST_BUFFER_TIMESTAMP (outbuf) = visual->next_ts; GST_BUFFER_TIMESTAMP (outbuf) = visual->next_ts;
GST_BUFFER_DURATION (outbuf) = visual->duration; 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-> visual_actor_new (GST_VISUAL_GET_CLASS (visual)->plugin->info->
plugname); plugname);
visual->video = visual_video_new (); 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 */ /* can't have a play without actors */
if (!visual->actor || !visual->video) if (!visual->actor || !visual->video)
goto no_actors; goto no_actors;

View file

@ -1368,9 +1368,11 @@ print_usage (int argc, char **argv)
int int
main (int argc, char **argv) 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 *accurate_checkbox, *key_checkbox, *loop_checkbox, *flush_checkbox;
GtkWidget *scrub_checkbox, *play_scrub_checkbox; GtkWidget *scrub_checkbox, *play_scrub_checkbox;
GtkTooltips *tips;
GOptionEntry options[] = { GOptionEntry options[] = {
{"stats", 's', 0, G_OPTION_ARG_NONE, &stats, {"stats", 's', 0, G_OPTION_ARG_NONE, &stats,
"Show pad stats", NULL}, "Show pad stats", NULL},
@ -1384,7 +1386,7 @@ main (int argc, char **argv)
GOptionContext *ctx; GOptionContext *ctx;
GError *err = NULL; 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_main_entries (ctx, options, NULL);
g_option_context_add_group (ctx, gst_init_get_option_group ()); g_option_context_add_group (ctx, gst_init_get_option_group ());
@ -1413,23 +1415,43 @@ main (int argc, char **argv)
g_assert (pipeline); g_assert (pipeline);
/* initialize gui elements ... */ /* initialize gui elements ... */
tips = gtk_tooltips_new ();
window = gtk_window_new (GTK_WINDOW_TOPLEVEL); window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
hbox = gtk_hbox_new (FALSE, 0); hbox = gtk_hbox_new (FALSE, 0);
vbox = gtk_vbox_new (FALSE, 0); vbox = gtk_vbox_new (FALSE, 0);
play_button = gtk_button_new_with_label ("play"); flagtable = gtk_table_new (3, 2, FALSE);
pause_button = gtk_button_new_with_label ("pause"); gtk_container_set_border_width (GTK_CONTAINER (vbox), 3);
stop_button = gtk_button_new_with_label ("stop");
/* 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"); 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"); loop_checkbox = gtk_check_button_new_with_label ("Loop");
flush_checkbox = gtk_check_button_new_with_label ("Flush"); flush_checkbox = gtk_check_button_new_with_label ("Flush");
scrub_checkbox = gtk_check_button_new_with_label ("Scrub"); scrub_checkbox = gtk_check_button_new_with_label ("Scrub");
play_scrub_checkbox = gtk_check_button_new_with_label ("Play 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 (flush_checkbox), TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (scrub_checkbox), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (scrub_checkbox), TRUE);
/* seek bar */
adjustment = adjustment =
GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.00, 100.0, 0.1, 1.0, 1.0)); GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.00, 100.0, 0.1, 1.0, 1.0));
hscale = gtk_hscale_new (adjustment); 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), play_button, FALSE, FALSE, 2);
gtk_box_pack_start (GTK_BOX (hbox), pause_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), stop_button, FALSE, FALSE, 2);
gtk_box_pack_start (GTK_BOX (hbox), accurate_checkbox, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (hbox), flagtable, FALSE, FALSE, 2);
gtk_box_pack_start (GTK_BOX (hbox), key_checkbox, FALSE, FALSE, 2); gtk_table_attach_defaults (GTK_TABLE (flagtable), accurate_checkbox, 0, 1, 0,
gtk_box_pack_start (GTK_BOX (hbox), loop_checkbox, FALSE, FALSE, 2); 1);
gtk_box_pack_start (GTK_BOX (hbox), flush_checkbox, FALSE, FALSE, 2); gtk_table_attach_defaults (GTK_TABLE (flagtable), flush_checkbox, 1, 2, 0, 1);
gtk_box_pack_start (GTK_BOX (hbox), scrub_checkbox, FALSE, FALSE, 2); gtk_table_attach_defaults (GTK_TABLE (flagtable), loop_checkbox, 2, 3, 0, 1);
gtk_box_pack_start (GTK_BOX (hbox), play_scrub_checkbox, FALSE, FALSE, 2); 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); gtk_box_pack_start (GTK_BOX (vbox), hscale, TRUE, TRUE, 2);
/* connect things ... */ /* connect things ... */

View file

@ -36,9 +36,6 @@ or sdlvideosink.
Other plug-ins might be used as well if GStreamer has them. Other plug-ins might be used as well if GStreamer has them.
.SH "SEE ALSO" .SH "SEE ALSO"
.BR gst\-guilaunch (1),
.BR gst\-complete (1),
.BR gst\-register (1),
.BR gst\-inspect (1), .BR gst\-inspect (1),
.BR gst\-launch (1), .BR gst\-launch (1),
.SH "AUTHOR" .SH "AUTHOR"

View file

@ -26,9 +26,6 @@ VIDEOSINK parameter in ~/.gst, defaulting to sdlvideosink.
.SH "SEE ALSO" .SH "SEE ALSO"
.BR gst\-launch\-ext (1), .BR gst\-launch\-ext (1),
.BR gst\-guilaunch (1),
.BR gst\-complete (1),
.BR gst\-register (1),
.BR gst\-inspect (1), .BR gst\-inspect (1),
.BR gst\-launch (1), .BR gst\-launch (1),
.SH "AUTHOR" .SH "AUTHOR"