Lines Matching full:app
201 static void clear_streams (PlaybackApp * app);
202 static void find_interface_elements (PlaybackApp * app);
204 PlaybackApp * app);
206 PlaybackApp * app);
208 static void video_sink_activate_cb (GtkEntry * entry, PlaybackApp * app);
209 static void text_sink_activate_cb (GtkEntry * entry, PlaybackApp * app);
210 static void audio_sink_activate_cb (GtkEntry * entry, PlaybackApp * app);
211 static void buffer_size_activate_cb (GtkEntry * entry, PlaybackApp * app);
212 static void buffer_duration_activate_cb (GtkEntry * entry, PlaybackApp * app);
214 PlaybackApp * app);
215 static void connection_speed_activate_cb (GtkEntry * entry, PlaybackApp * app);
216 static void av_offset_activate_cb (GtkEntry * entry, PlaybackApp * app);
217 static void text_offset_activate_cb (GtkEntry * entry, PlaybackApp * app);
218 static void subtitle_encoding_activate_cb (GtkEntry * entry, PlaybackApp * app);
272 make_playbin_pipeline (PlaybackApp * app, const gchar * location) in make_playbin_pipeline() argument
276 app->pipeline = pipeline = gst_element_factory_make ("playbin", "playbin"); in make_playbin_pipeline()
280 app->current_sub_path ? app->current_sub_path->data : NULL); in make_playbin_pipeline()
283 app); in make_playbin_pipeline()
284 g_signal_connect (pipeline, "notify::mute", G_CALLBACK (mute_notify_cb), app); in make_playbin_pipeline()
286 app->navigation_element = GST_ELEMENT (gst_object_ref (pipeline)); in make_playbin_pipeline()
287 app->colorbalance_element = GST_ELEMENT (gst_object_ref (pipeline)); in make_playbin_pipeline()
292 make_parselaunch_pipeline (PlaybackApp * app, const gchar * description) in make_parselaunch_pipeline() argument
294 app->pipeline = gst_parse_launch (description, NULL); in make_parselaunch_pipeline()
301 void (*func) (PlaybackApp * app, const gchar * location);
316 format_value (GtkScale * scale, gdouble value, PlaybackApp * app) in format_value() argument
321 real = value * app->duration / N_GRAD; in format_value()
367 query_positions (PlaybackApp * app) in query_positions() argument
371 g_print ("positions %8.8s: ", GST_ELEMENT_NAME (app->pipeline)); in query_positions()
378 if (gst_element_query_position (app->pipeline, format, &position) && in query_positions()
379 gst_element_query_duration (app->pipeline, format, &total)) { in query_positions()
387 g_print (" %s\n", GST_ELEMENT_NAME (app->pipeline)); in query_positions()
391 PlaybackApp * app);
393 PlaybackApp * app);
394 static void seek_cb (GtkRange * range, PlaybackApp * app);
397 set_scale (PlaybackApp * app, gdouble value) in set_scale() argument
399 g_signal_handlers_block_by_func (app->seek_scale, start_seek, app); in set_scale()
400 g_signal_handlers_block_by_func (app->seek_scale, stop_seek, app); in set_scale()
401 g_signal_handlers_block_by_func (app->seek_scale, seek_cb, app); in set_scale()
402 gtk_range_set_value (GTK_RANGE (app->seek_scale), value); in set_scale()
403 g_signal_handlers_unblock_by_func (app->seek_scale, start_seek, app); in set_scale()
404 g_signal_handlers_unblock_by_func (app->seek_scale, stop_seek, app); in set_scale()
405 g_signal_handlers_unblock_by_func (app->seek_scale, seek_cb, app); in set_scale()
406 gtk_widget_queue_draw (app->seek_scale); in set_scale()
410 update_fill (PlaybackApp * app) in update_fill() argument
416 if (gst_element_query (app->pipeline, query)) { in update_fill()
444 gtk_range_set_fill_level (GTK_RANGE (app->seek_scale), fill); in update_fill()
452 update_seek_range (PlaybackApp * app) in update_seek_range() argument
460 if (gst_element_query (app->pipeline, query)) { in update_seek_range()
470 gtk_label_set_text (GTK_LABEL (app->seek_start_label), str); in update_seek_range()
474 gtk_label_set_text (GTK_LABEL (app->seek_stop_label), str); in update_seek_range()
483 update_scale (PlaybackApp * app) in update_scale() argument
492 gst_element_query_position (app->pipeline, format, &app->position); in update_scale()
493 gst_element_query_duration (app->pipeline, format, &app->duration); in update_scale()
495 if (app->stats) in update_scale()
496 query_positions (app); in update_scale()
498 if (app->position >= app->duration) in update_scale()
499 app->duration = app->position; in update_scale()
501 if (app->duration > 0) { in update_scale()
502 set_scale (app, app->position * N_GRAD / app->duration); in update_scale()
505 if (app->seek_format) { in update_scale()
506 format = app->seek_format->value; in update_scale()
508 gst_element_query_position (app->pipeline, format, &seek_pos); in update_scale()
509 gst_element_query_duration (app->pipeline, format, &seek_dur); in update_scale()
512 gtk_label_set_text (GTK_LABEL (app->seek_position_label), str); in update_scale()
516 gtk_label_set_text (GTK_LABEL (app->seek_duration_label), str); in update_scale()
523 static void set_update_scale (PlaybackApp * app, gboolean active);
524 static void set_update_fill (PlaybackApp * app, gboolean active);
527 end_scrub (PlaybackApp * app) in end_scrub() argument
530 gst_element_set_state (app->pipeline, GST_STATE_PAUSED); in end_scrub()
531 app->seek_timeout_id = 0; in end_scrub()
537 send_event (PlaybackApp * app, GstEvent * event) in send_event() argument
541 GST_DEBUG ("send event on element %s", GST_ELEMENT_NAME (app->pipeline)); in send_event()
542 res = gst_element_send_event (app->pipeline, event); in send_event()
548 do_seek (PlaybackApp * app, GstFormat format, gint64 position) in do_seek() argument
558 if (app->flush_seek) in do_seek()
560 if (app->accurate_seek) in do_seek()
562 if (app->keyframe_seek) in do_seek()
564 if (app->loop_seek) in do_seek()
566 if (app->skip_seek) in do_seek()
568 if (app->skip_seek_key_only) in do_seek()
570 if (app->skip_seek_no_audio) in do_seek()
572 if (app->snap_before) in do_seek()
574 if (app->snap_after) in do_seek()
577 if (app->instant_rate_change) { in do_seek()
581 if (app->flush_seek) { in do_seek()
588 } else if (app->rate < 0) { in do_seek()
596 if (app->rate >= 0) { in do_seek()
597 s_event = gst_event_new_seek (app->rate, in do_seek()
600 app->rate, GST_TIME_ARGS (start), GST_TIME_ARGS (stop)); in do_seek()
602 s_event = gst_event_new_seek (app->rate, in do_seek()
605 app->rate, GST_TIME_ARGS (start), GST_TIME_ARGS (stop)); in do_seek()
608 res = send_event (app, s_event); in do_seek()
611 if (app->flush_seek) { in do_seek()
612 gst_element_get_state (GST_ELEMENT (app->pipeline), NULL, NULL, in do_seek()
615 set_update_scale (app, TRUE); in do_seek()
619 set_update_scale (app, TRUE); in do_seek()
624 seek_cb (GtkRange * range, PlaybackApp * app) in seek_cb() argument
629 gtk_range_get_value (GTK_RANGE (app->seek_scale)) * app->duration / in seek_cb()
633 gtk_range_get_value (GTK_RANGE (app->seek_scale)), real); in seek_cb()
636 do_seek (app, GST_FORMAT_TIME, real); in seek_cb()
638 if (app->play_scrub) { in seek_cb()
639 if (app->buffering) { in seek_cb()
643 gst_element_set_state (app->pipeline, GST_STATE_PLAYING); in seek_cb()
646 if (app->seek_timeout_id == 0) { in seek_cb()
647 app->seek_timeout_id = in seek_cb()
648 g_timeout_add (SCRUB_TIME, (GSourceFunc) end_scrub, app); in seek_cb()
654 advanced_seek_button_cb (GtkButton * button, PlaybackApp * app) in advanced_seek_button_cb() argument
661 if (!app->seek_format) in advanced_seek_button_cb()
664 fmt = app->seek_format->value; in advanced_seek_button_cb()
666 text = gtk_entry_get_text (GTK_ENTRY (app->seek_entry)); in advanced_seek_button_cb()
670 do_seek (app, fmt, pos); in advanced_seek_button_cb()
672 do_seek (app, fmt, GST_CLOCK_TIME_NONE); in advanced_seek_button_cb()
677 set_update_fill (PlaybackApp * app, gboolean active) in set_update_fill() argument
682 if (app->fill_id == 0) { in set_update_fill()
683 app->fill_id = in set_update_fill()
684 g_timeout_add (FILL_INTERVAL, (GSourceFunc) update_fill, app); in set_update_fill()
687 if (app->fill_id) { in set_update_fill()
688 g_source_remove (app->fill_id); in set_update_fill()
689 app->fill_id = 0; in set_update_fill()
695 set_update_scale (PlaybackApp * app, gboolean active) in set_update_scale() argument
700 if (app->update_id == 0) { in set_update_scale()
701 app->update_id = in set_update_scale()
702 g_timeout_add (UPDATE_INTERVAL, (GSourceFunc) update_scale, app); in set_update_scale()
704 if (app->slow_update_id == 0) { in set_update_scale()
705 app->slow_update_id = in set_update_scale()
707 app); in set_update_scale()
710 if (app->update_id) { in set_update_scale()
711 g_source_remove (app->update_id); in set_update_scale()
712 app->update_id = 0; in set_update_scale()
714 if (app->slow_update_id) { in set_update_scale()
715 g_source_remove (app->slow_update_id); in set_update_scale()
716 app->slow_update_id = 0; in set_update_scale()
722 start_seek (GtkRange * range, GdkEventButton * event, PlaybackApp * app) in start_seek() argument
727 set_update_scale (app, FALSE); in start_seek()
729 if (app->state == GST_STATE_PLAYING && app->flush_seek && app->scrub) { in start_seek()
731 gst_element_set_state (app->pipeline, GST_STATE_PAUSED); in start_seek()
734 if (app->changed_id == 0 && app->flush_seek && app->scrub) { in start_seek()
735 app->changed_id = in start_seek()
736 g_signal_connect (app->seek_scale, "value-changed", in start_seek()
737 G_CALLBACK (seek_cb), app); in start_seek()
744 stop_seek (GtkRange * range, GdkEventButton * event, PlaybackApp * app) in stop_seek() argument
746 if (app->changed_id) { in stop_seek()
747 g_signal_handler_disconnect (app->seek_scale, app->changed_id); in stop_seek()
748 app->changed_id = 0; in stop_seek()
751 if (!app->flush_seek || !app->scrub) { in stop_seek()
756 gtk_range_get_value (GTK_RANGE (app->seek_scale)) * app->duration / in stop_seek()
758 do_seek (app, GST_FORMAT_TIME, real); in stop_seek()
761 if (app->seek_timeout_id != 0) { in stop_seek()
762 g_source_remove (app->seek_timeout_id); in stop_seek()
763 app->seek_timeout_id = 0; in stop_seek()
766 if (app->state == GST_STATE_PAUSED) { in stop_seek()
768 gst_element_set_state (app->pipeline, GST_STATE_PAUSED); in stop_seek()
771 if (app->state == GST_STATE_PLAYING) { in stop_seek()
772 if (app->buffering) { in stop_seek()
776 gst_element_set_state (app->pipeline, GST_STATE_PLAYING); in stop_seek()
785 play_cb (GtkButton * button, PlaybackApp * app) in play_cb() argument
789 if (app->state != GST_STATE_PLAYING) { in play_cb()
791 gtk_statusbar_pop (GTK_STATUSBAR (app->statusbar), app->status_id); in play_cb()
793 if (app->pipeline_type == 0) { in play_cb()
794 video_sink_activate_cb (GTK_ENTRY (app->video_sink_entry), app); in play_cb()
795 audio_sink_activate_cb (GTK_ENTRY (app->audio_sink_entry), app); in play_cb()
796 text_sink_activate_cb (GTK_ENTRY (app->text_sink_entry), app); in play_cb()
797 buffer_size_activate_cb (GTK_ENTRY (app->buffer_size_entry), app); in play_cb()
798 buffer_duration_activate_cb (GTK_ENTRY (app->buffer_duration_entry), app); in play_cb()
799 ringbuffer_maxsize_activate_cb (GTK_ENTRY (app->ringbuffer_maxsize_entry), in play_cb()
800 app); in play_cb()
801 connection_speed_activate_cb (GTK_ENTRY (app->connection_speed_entry), in play_cb()
802 app); in play_cb()
803 av_offset_activate_cb (GTK_ENTRY (app->av_offset_entry), app); in play_cb()
804 text_offset_activate_cb (GTK_ENTRY (app->text_offset_entry), app); in play_cb()
805 subtitle_encoding_activate_cb (GTK_ENTRY (app->subtitle_encoding_entry), in play_cb()
806 app); in play_cb()
809 ret = gst_element_set_state (app->pipeline, GST_STATE_PLAYING); in play_cb()
814 app->is_live = TRUE; in play_cb()
819 app->state = GST_STATE_PLAYING; in play_cb()
820 gtk_statusbar_push (GTK_STATUSBAR (app->statusbar), app->status_id, in play_cb()
829 gtk_statusbar_push (GTK_STATUSBAR (app->statusbar), app->status_id, in play_cb()
835 pause_cb (GtkButton * button, PlaybackApp * app) in pause_cb() argument
837 g_mutex_lock (&app->state_mutex); in pause_cb()
838 if (app->state != GST_STATE_PAUSED) { in pause_cb()
841 gtk_statusbar_pop (GTK_STATUSBAR (app->statusbar), app->status_id); in pause_cb()
843 ret = gst_element_set_state (app->pipeline, GST_STATE_PAUSED); in pause_cb()
848 app->is_live = TRUE; in pause_cb()
854 app->state = GST_STATE_PAUSED; in pause_cb()
855 gtk_statusbar_push (GTK_STATUSBAR (app->statusbar), app->status_id, in pause_cb()
858 g_mutex_unlock (&app->state_mutex); in pause_cb()
864 g_mutex_unlock (&app->state_mutex); in pause_cb()
866 gtk_statusbar_push (GTK_STATUSBAR (app->statusbar), app->status_id, in pause_cb()
872 stop_cb (GtkButton * button, PlaybackApp * app) in stop_cb() argument
874 if (app->state != STOP_STATE) { in stop_cb()
879 gtk_statusbar_pop (GTK_STATUSBAR (app->statusbar), app->status_id); in stop_cb()
881 g_mutex_lock (&app->state_mutex); in stop_cb()
882 ret = gst_element_set_state (app->pipeline, STOP_STATE); in stop_cb()
886 app->state = STOP_STATE; in stop_cb()
887 gtk_statusbar_push (GTK_STATUSBAR (app->statusbar), app->status_id, in stop_cb()
889 gtk_widget_queue_draw (app->video_window); in stop_cb()
891 app->is_live = FALSE; in stop_cb()
892 app->buffering = FALSE; in stop_cb()
893 set_update_scale (app, FALSE); in stop_cb()
894 set_scale (app, 0.0); in stop_cb()
895 set_update_fill (app, FALSE); in stop_cb()
897 if (app->pipeline_type == 0) in stop_cb()
898 clear_streams (app); in stop_cb()
899 g_mutex_unlock (&app->state_mutex); in stop_cb()
901 gtk_widget_set_sensitive (GTK_WIDGET (app->seek_scale), TRUE); in stop_cb()
902 for (i = 0; i < G_N_ELEMENTS (app->navigation_buttons); i++) in stop_cb()
903 gtk_widget_set_sensitive (app->navigation_buttons[i].button, FALSE); in stop_cb()
909 g_mutex_unlock (&app->state_mutex); in stop_cb()
911 gtk_statusbar_push (GTK_STATUSBAR (app->statusbar), app->status_id, in stop_cb()
917 snap_before_toggle_cb (GtkToggleButton * button, PlaybackApp * app) in snap_before_toggle_cb() argument
919 app->snap_before = gtk_toggle_button_get_active (button); in snap_before_toggle_cb()
923 snap_after_toggle_cb (GtkToggleButton * button, PlaybackApp * app) in snap_after_toggle_cb() argument
925 app->snap_after = gtk_toggle_button_get_active (button); in snap_after_toggle_cb()
929 accurate_toggle_cb (GtkToggleButton * button, PlaybackApp * app) in accurate_toggle_cb() argument
931 app->accurate_seek = gtk_toggle_button_get_active (button); in accurate_toggle_cb()
935 key_toggle_cb (GtkToggleButton * button, PlaybackApp * app) in key_toggle_cb() argument
937 app->keyframe_seek = gtk_toggle_button_get_active (button); in key_toggle_cb()
941 loop_toggle_cb (GtkToggleButton * button, PlaybackApp * app) in loop_toggle_cb() argument
943 app->loop_seek = gtk_toggle_button_get_active (button); in loop_toggle_cb()
944 if (app->state == GST_STATE_PLAYING) { in loop_toggle_cb()
948 gtk_range_get_value (GTK_RANGE (app->seek_scale)) * app->duration / in loop_toggle_cb()
950 do_seek (app, GST_FORMAT_TIME, real); in loop_toggle_cb()
955 flush_toggle_cb (GtkToggleButton * button, PlaybackApp * app) in flush_toggle_cb() argument
957 app->flush_seek = gtk_toggle_button_get_active (button); in flush_toggle_cb()
961 scrub_toggle_cb (GtkToggleButton * button, PlaybackApp * app) in scrub_toggle_cb() argument
963 app->scrub = gtk_toggle_button_get_active (button); in scrub_toggle_cb()
967 play_scrub_toggle_cb (GtkToggleButton * button, PlaybackApp * app) in play_scrub_toggle_cb() argument
969 app->play_scrub = gtk_toggle_button_get_active (button); in play_scrub_toggle_cb()
973 instant_rate_change_toggle_cb (GtkToggleButton * button, PlaybackApp * app) in instant_rate_change_toggle_cb() argument
975 app->instant_rate_change = gtk_toggle_button_get_active (button); in instant_rate_change_toggle_cb()
979 skip_toggle_common (gboolean * v, GtkToggleButton * button, PlaybackApp * app) in skip_toggle_common() argument
982 if (app->state == GST_STATE_PLAYING) { in skip_toggle_common()
986 gtk_range_get_value (GTK_RANGE (app->seek_scale)) * app->duration / in skip_toggle_common()
988 do_seek (app, GST_FORMAT_TIME, real); in skip_toggle_common()
993 skip_toggle_cb (GtkToggleButton * button, PlaybackApp * app) in skip_toggle_cb() argument
995 skip_toggle_common (&app->skip_seek, button, app); in skip_toggle_cb()
999 skip_key_toggle_cb (GtkToggleButton * button, PlaybackApp * app) in skip_key_toggle_cb() argument
1001 skip_toggle_common (&app->skip_seek_key_only, button, app); in skip_key_toggle_cb()
1005 skip_audio_toggle_cb (GtkToggleButton * button, PlaybackApp * app) in skip_audio_toggle_cb() argument
1007 skip_toggle_common (&app->skip_seek_no_audio, button, app); in skip_audio_toggle_cb()
1011 rate_spinbutton_changed_cb (GtkSpinButton * button, PlaybackApp * app) in rate_spinbutton_changed_cb() argument
1020 app->rate = gtk_spin_button_get_value (button); in rate_spinbutton_changed_cb()
1022 GST_DEBUG ("rate changed to %lf", app->rate); in rate_spinbutton_changed_cb()
1025 if (app->flush_seek) in rate_spinbutton_changed_cb()
1027 if (app->loop_seek) in rate_spinbutton_changed_cb()
1029 if (app->accurate_seek) in rate_spinbutton_changed_cb()
1031 if (app->keyframe_seek) in rate_spinbutton_changed_cb()
1033 if (app->skip_seek) in rate_spinbutton_changed_cb()
1035 if (app->skip_seek_key_only) in rate_spinbutton_changed_cb()
1037 if (app->skip_seek_no_audio) in rate_spinbutton_changed_cb()
1040 if (app->instant_rate_change) { in rate_spinbutton_changed_cb()
1044 if (app->flush_seek) { in rate_spinbutton_changed_cb()
1048 } else if (app->rate < 0) { in rate_spinbutton_changed_cb()
1049 stop = app->position; in rate_spinbutton_changed_cb()
1052 start = app->position; in rate_spinbutton_changed_cb()
1056 if (app->rate >= 0.0) { in rate_spinbutton_changed_cb()
1057 s_event = gst_event_new_seek (app->rate, in rate_spinbutton_changed_cb()
1060 s_event = gst_event_new_seek (app->rate, in rate_spinbutton_changed_cb()
1064 res = send_event (app, s_event); in rate_spinbutton_changed_cb()
1067 if (app->flush_seek) { in rate_spinbutton_changed_cb()
1068 gst_element_get_state (GST_ELEMENT (app->pipeline), NULL, NULL, in rate_spinbutton_changed_cb()
1091 vis_toggle_cb (GtkToggleButton * button, PlaybackApp * app) in vis_toggle_cb() argument
1096 update_flag (app->pipeline, GST_PLAY_FLAG_VIS, state); in vis_toggle_cb()
1097 gtk_widget_set_sensitive (app->vis_combo, state); in vis_toggle_cb()
1101 audio_toggle_cb (GtkToggleButton * button, PlaybackApp * app) in audio_toggle_cb() argument
1106 update_flag (app->pipeline, GST_PLAY_FLAG_AUDIO, state); in audio_toggle_cb()
1107 gtk_widget_set_sensitive (app->audio_combo, state); in audio_toggle_cb()
1111 video_toggle_cb (GtkToggleButton * button, PlaybackApp * app) in video_toggle_cb() argument
1116 update_flag (app->pipeline, GST_PLAY_FLAG_VIDEO, state); in video_toggle_cb()
1117 gtk_widget_set_sensitive (app->video_combo, state); in video_toggle_cb()
1121 text_toggle_cb (GtkToggleButton * button, PlaybackApp * app) in text_toggle_cb() argument
1126 update_flag (app->pipeline, GST_PLAY_FLAG_TEXT, state); in text_toggle_cb()
1127 gtk_widget_set_sensitive (app->text_combo, state); in text_toggle_cb()
1131 mute_toggle_cb (GtkToggleButton * button, PlaybackApp * app) in mute_toggle_cb() argument
1136 g_object_set (app->pipeline, "mute", mute, NULL); in mute_toggle_cb()
1140 download_toggle_cb (GtkToggleButton * button, PlaybackApp * app) in download_toggle_cb() argument
1145 update_flag (app->pipeline, GST_PLAY_FLAG_DOWNLOAD, state); in download_toggle_cb()
1149 buffering_toggle_cb (GtkToggleButton * button, PlaybackApp * app) in buffering_toggle_cb() argument
1154 update_flag (app->pipeline, GST_PLAY_FLAG_BUFFERING, state); in buffering_toggle_cb()
1158 soft_volume_toggle_cb (GtkToggleButton * button, PlaybackApp * app) in soft_volume_toggle_cb() argument
1163 update_flag (app->pipeline, GST_PLAY_FLAG_SOFT_VOLUME, state); in soft_volume_toggle_cb()
1167 native_audio_toggle_cb (GtkToggleButton * button, PlaybackApp * app) in native_audio_toggle_cb() argument
1172 update_flag (app->pipeline, GST_PLAY_FLAG_NATIVE_AUDIO, state); in native_audio_toggle_cb()
1176 native_video_toggle_cb (GtkToggleButton * button, PlaybackApp * app) in native_video_toggle_cb() argument
1181 update_flag (app->pipeline, GST_PLAY_FLAG_NATIVE_VIDEO, state); in native_video_toggle_cb()
1185 deinterlace_toggle_cb (GtkToggleButton * button, PlaybackApp * app) in deinterlace_toggle_cb() argument
1190 update_flag (app->pipeline, GST_PLAY_FLAG_DEINTERLACE, state); in deinterlace_toggle_cb()
1194 soft_colorbalance_toggle_cb (GtkToggleButton * button, PlaybackApp * app) in soft_colorbalance_toggle_cb() argument
1199 update_flag (app->pipeline, GST_PLAY_FLAG_SOFT_COLORBALANCE, state); in soft_colorbalance_toggle_cb()
1203 clear_streams (PlaybackApp * app) in clear_streams() argument
1208 for (i = 0; i < app->n_video; i++) in clear_streams()
1209 gtk_combo_box_text_remove (GTK_COMBO_BOX_TEXT (app->video_combo), 0); in clear_streams()
1210 for (i = 0; i < app->n_audio; i++) in clear_streams()
1211 gtk_combo_box_text_remove (GTK_COMBO_BOX_TEXT (app->audio_combo), 0); in clear_streams()
1212 for (i = 0; i < app->n_text; i++) in clear_streams()
1213 gtk_combo_box_text_remove (GTK_COMBO_BOX_TEXT (app->text_combo), 0); in clear_streams()
1215 app->n_audio = app->n_video = app->n_text = 0; in clear_streams()
1216 gtk_widget_set_sensitive (app->video_combo, FALSE); in clear_streams()
1217 gtk_widget_set_sensitive (app->audio_combo, FALSE); in clear_streams()
1218 gtk_widget_set_sensitive (app->text_combo, FALSE); in clear_streams()
1220 app->need_streams = TRUE; in clear_streams()
1224 update_streams (PlaybackApp * app) in update_streams() argument
1228 if (app->pipeline_type == 0 && app->need_streams) { in update_streams()
1235 clear_streams (app); in update_streams()
1238 g_object_get (app->pipeline, "n-video", &app->n_video, NULL); in update_streams()
1239 g_object_get (app->pipeline, "n-audio", &app->n_audio, NULL); in update_streams()
1240 g_object_get (app->pipeline, "n-text", &app->n_text, NULL); in update_streams()
1242 g_print ("video %d, audio %d, text %d\n", app->n_video, app->n_audio, in update_streams()
1243 app->n_text); in update_streams()
1246 for (i = 0; i < app->n_video; i++) { in update_streams()
1247 g_signal_emit_by_name (app->pipeline, "get-video-tags", i, &tags); in update_streams()
1256 gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (app->video_combo), in update_streams()
1261 gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (app->video_checkbox)); in update_streams()
1262 gtk_widget_set_sensitive (app->video_combo, state && app->n_video > 0); in update_streams()
1263 gtk_combo_box_set_active (GTK_COMBO_BOX (app->video_combo), active_idx); in update_streams()
1266 for (i = 0; i < app->n_audio; i++) { in update_streams()
1267 g_signal_emit_by_name (app->pipeline, "get-audio-tags", i, &tags); in update_streams()
1276 gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (app->audio_combo), in update_streams()
1281 gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (app->audio_checkbox)); in update_streams()
1282 gtk_widget_set_sensitive (app->audio_combo, state && app->n_audio > 0); in update_streams()
1283 gtk_combo_box_set_active (GTK_COMBO_BOX (app->audio_combo), active_idx); in update_streams()
1286 for (i = 0; i < app->n_text; i++) { in update_streams()
1287 g_signal_emit_by_name (app->pipeline, "get-text-tags", i, &tags); in update_streams()
1308 gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (app->text_combo), in update_streams()
1313 gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (app->text_checkbox)); in update_streams()
1314 gtk_widget_set_sensitive (app->text_combo, state && app->n_text > 0); in update_streams()
1315 gtk_combo_box_set_active (GTK_COMBO_BOX (app->text_combo), active_idx); in update_streams()
1317 app->need_streams = FALSE; in update_streams()
1322 video_combo_cb (GtkComboBox * combo, PlaybackApp * app) in video_combo_cb() argument
1329 g_object_set (app->pipeline, "current-video", active, NULL); in video_combo_cb()
1333 audio_combo_cb (GtkComboBox * combo, PlaybackApp * app) in audio_combo_cb() argument
1340 g_object_set (app->pipeline, "current-audio", active, NULL); in audio_combo_cb()
1344 text_combo_cb (GtkComboBox * combo, PlaybackApp * app) in text_combo_cb() argument
1351 g_object_set (app->pipeline, "current-text", active, NULL); in text_combo_cb()
1371 init_visualization_features (PlaybackApp * app) in init_visualization_features() argument
1375 app->vis_entries = g_array_new (FALSE, FALSE, sizeof (VisEntry)); in init_visualization_features()
1388 g_array_append_val (app->vis_entries, entry); in init_visualization_features()
1389 gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (app->vis_combo), name); in init_visualization_features()
1391 gtk_combo_box_set_active (GTK_COMBO_BOX (app->vis_combo), 0); in init_visualization_features()
1396 vis_combo_cb (GtkComboBox * combo, PlaybackApp * app) in vis_combo_cb() argument
1403 index = gtk_combo_box_get_active (GTK_COMBO_BOX (app->vis_combo)); in vis_combo_cb()
1404 if (app->vis_entries->len > 0) { in vis_combo_cb()
1405 entry = &g_array_index (app->vis_entries, VisEntry, index); in vis_combo_cb()
1413 g_object_set (app->pipeline, "vis-plugin", element, NULL); in vis_combo_cb()
1418 volume_spinbutton_changed_cb (GtkSpinButton * button, PlaybackApp * app) in volume_spinbutton_changed_cb() argument
1424 g_object_set (app->pipeline, "volume", volume, NULL); in volume_spinbutton_changed_cb()
1428 volume_notify_idle_cb (PlaybackApp * app) in volume_notify_idle_cb() argument
1432 g_object_get (app->pipeline, "volume", &new_volume, NULL); in volume_notify_idle_cb()
1434 gtk_spin_button_get_value (GTK_SPIN_BUTTON (app->volume_spinbutton)); in volume_notify_idle_cb()
1436 g_signal_handlers_block_by_func (app->volume_spinbutton, in volume_notify_idle_cb()
1437 volume_spinbutton_changed_cb, app); in volume_notify_idle_cb()
1438 gtk_spin_button_set_value (GTK_SPIN_BUTTON (app->volume_spinbutton), in volume_notify_idle_cb()
1440 g_signal_handlers_unblock_by_func (app->volume_spinbutton, in volume_notify_idle_cb()
1441 volume_spinbutton_changed_cb, app); in volume_notify_idle_cb()
1448 volume_notify_cb (GstElement * pipeline, GParamSpec * arg, PlaybackApp * app) in volume_notify_cb() argument
1451 g_idle_add ((GSourceFunc) volume_notify_idle_cb, app); in volume_notify_cb()
1455 mute_notify_idle_cb (PlaybackApp * app) in mute_notify_idle_cb() argument
1459 g_object_get (app->pipeline, "mute", &new_mute, NULL); in mute_notify_idle_cb()
1461 gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (app->mute_checkbox)); in mute_notify_idle_cb()
1463 g_signal_handlers_block_by_func (app->mute_checkbox, mute_toggle_cb, app); in mute_notify_idle_cb()
1464 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->mute_checkbox), in mute_notify_idle_cb()
1466 g_signal_handlers_unblock_by_func (app->mute_checkbox, mute_toggle_cb, app); in mute_notify_idle_cb()
1473 mute_notify_cb (GstElement * pipeline, GParamSpec * arg, PlaybackApp * app) in mute_notify_cb() argument
1476 g_idle_add ((GSourceFunc) mute_notify_idle_cb, app); in mute_notify_cb()
1480 shot_cb (GtkButton * button, PlaybackApp * app) in shot_cb() argument
1495 g_signal_emit_by_name (app->pipeline, "convert-sample", caps, &sample); in shot_cb()
1547 step_cb (GtkButton * button, PlaybackApp * app) in step_cb() argument
1556 active = gtk_combo_box_get_active (GTK_COMBO_BOX (app->step_format_combo)); in step_cb()
1559 (app->step_amount_spinbutton)); in step_cb()
1561 gtk_spin_button_get_value (GTK_SPIN_BUTTON (app->step_rate_spinbutton)); in step_cb()
1579 res = send_event (app, event); in step_cb()
1587 message_received (GstBus * bus, GstMessage * message, PlaybackApp * app) in message_received() argument
1592 do_shuttle (PlaybackApp * app) in do_shuttle() argument
1596 if (app->shuttling) in do_shuttle()
1601 gst_element_send_event (app->pipeline, in do_shuttle()
1602 gst_event_new_step (GST_FORMAT_TIME, duration, app->shuttle_rate, FALSE, in do_shuttle()
1607 msg_sync_step_done (GstBus * bus, GstMessage * message, PlaybackApp * app) in msg_sync_step_done() argument
1625 if (g_mutex_trylock (&app->state_mutex)) { in msg_sync_step_done()
1626 if (app->shuttling) in msg_sync_step_done()
1627 do_shuttle (app); in msg_sync_step_done()
1628 g_mutex_unlock (&app->state_mutex); in msg_sync_step_done()
1636 shuttle_toggled (GtkToggleButton * button, PlaybackApp * app) in shuttle_toggled() argument
1642 if (active != app->shuttling) { in shuttle_toggled()
1643 app->shuttling = active; in shuttle_toggled()
1644 g_print ("shuttling %s\n", app->shuttling ? "active" : "inactive"); in shuttle_toggled()
1646 app->shuttle_rate = 0.0; in shuttle_toggled()
1647 app->play_rate = 1.0; in shuttle_toggled()
1648 pause_cb (NULL, app); in shuttle_toggled()
1649 gst_element_get_state (app->pipeline, NULL, NULL, -1); in shuttle_toggled()
1655 shuttle_rate_switch (PlaybackApp * app) in shuttle_rate_switch() argument
1661 if (app->state == GST_STATE_PLAYING) { in shuttle_rate_switch()
1663 pause_cb (NULL, app); in shuttle_rate_switch()
1664 gst_element_get_state (app->pipeline, NULL, NULL, -1); in shuttle_rate_switch()
1667 if (app->play_rate == 1.0) in shuttle_rate_switch()
1668 app->play_rate = -1.0; in shuttle_rate_switch()
1670 app->play_rate = 1.0; in shuttle_rate_switch()
1672 g_print ("rate changed to %lf %" GST_TIME_FORMAT "\n", app->play_rate, in shuttle_rate_switch()
1673 GST_TIME_ARGS (app->position)); in shuttle_rate_switch()
1678 if (app->play_rate >= 0.0) { in shuttle_rate_switch()
1679 s_event = gst_event_new_seek (app->play_rate, in shuttle_rate_switch()
1680 GST_FORMAT_TIME, flags, GST_SEEK_TYPE_SET, app->position, in shuttle_rate_switch()
1683 s_event = gst_event_new_seek (app->play_rate, in shuttle_rate_switch()
1685 GST_SEEK_TYPE_SET, app->position); in shuttle_rate_switch()
1687 res = send_event (app, s_event); in shuttle_rate_switch()
1689 gst_element_get_state (app->pipeline, NULL, NULL, SEEK_TIMEOUT); in shuttle_rate_switch()
1696 shuttle_value_changed (GtkRange * range, PlaybackApp * app) in shuttle_value_changed() argument
1704 pause_cb (NULL, app); in shuttle_value_changed()
1705 gst_element_get_state (app->pipeline, NULL, NULL, -1); in shuttle_value_changed()
1709 if ((rate < 0.0 && app->play_rate > 0.0) || (rate > 0.0 in shuttle_value_changed()
1710 && app->play_rate < 0.0)) { in shuttle_value_changed()
1711 shuttle_rate_switch (app); in shuttle_value_changed()
1714 app->shuttle_rate = ABS (rate); in shuttle_value_changed()
1715 if (app->state != GST_STATE_PLAYING) { in shuttle_value_changed()
1716 do_shuttle (app); in shuttle_value_changed()
1717 play_cb (NULL, app); in shuttle_value_changed()
1723 colorbalance_value_changed (GtkRange * range, PlaybackApp * app) in colorbalance_value_changed() argument
1731 if (range == GTK_RANGE (app->contrast_scale)) in colorbalance_value_changed()
1733 else if (range == GTK_RANGE (app->brightness_scale)) in colorbalance_value_changed()
1735 else if (range == GTK_RANGE (app->hue_scale)) in colorbalance_value_changed()
1737 else if (range == GTK_RANGE (app->saturation_scale)) in colorbalance_value_changed()
1746 if (!app->colorbalance_element) { in colorbalance_value_changed()
1747 find_interface_elements (app); in colorbalance_value_changed()
1748 if (!app->colorbalance_element) in colorbalance_value_changed()
1754 (app->colorbalance_element)); in colorbalance_value_changed()
1771 gst_color_balance_set_value (GST_COLOR_BALANCE (app->colorbalance_element), in colorbalance_value_changed()
1776 seek_format_changed_cb (GtkComboBox * box, PlaybackApp * app) in seek_format_changed_cb() argument
1784 for (l = app->formats; l; l = l->next) { in seek_format_changed_cb()
1796 app->seek_format = format; in seek_format_changed_cb()
1797 update_scale (app); in seek_format_changed_cb()
1804 update_formats (PlaybackApp * app) in update_formats() argument
1815 (app->seek_format_combo)); in update_formats()
1822 g_list_free (app->formats); in update_formats()
1823 app->formats = NULL; in update_formats()
1830 app->formats = g_list_prepend (app->formats, def); in update_formats()
1835 g_list_free (app->formats); in update_formats()
1836 app->formats = NULL; in update_formats()
1848 app->formats = g_list_reverse (app->formats); in update_formats()
1851 g_signal_handlers_block_by_func (app->seek_format_combo, in update_formats()
1852 seek_format_changed_cb, app); in update_formats()
1853 gtk_combo_box_text_remove_all (GTK_COMBO_BOX_TEXT (app->seek_format_combo)); in update_formats()
1855 for (i = 0, l = app->formats; l; l = l->next, i++) { in update_formats()
1858 gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (app->seek_format_combo), in update_formats()
1863 g_signal_handlers_unblock_by_func (app->seek_format_combo, in update_formats()
1864 seek_format_changed_cb, app); in update_formats()
1866 gtk_combo_box_set_active (GTK_COMBO_BOX (app->seek_format_combo), in update_formats()
1873 msg_async_done (GstBus * bus, GstMessage * message, PlaybackApp * app) in msg_async_done() argument
1878 update_formats (app); in msg_async_done()
1882 update_scale (app); in msg_async_done()
1885 update_streams (app); in msg_async_done()
1887 find_interface_elements (app); in msg_async_done()
1891 msg_state_changed (GstBus * bus, GstMessage * message, PlaybackApp * app) in msg_state_changed() argument
1898 if (s && GST_MESSAGE_SRC (message) == GST_OBJECT_CAST (app->pipeline)) { in msg_state_changed()
1905 set_update_scale (app, TRUE); in msg_state_changed()
1907 set_update_scale (app, FALSE); in msg_state_changed()
1917 GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (app->pipeline), in msg_state_changed()
1926 msg_segment_done (GstBus * bus, GstMessage * message, PlaybackApp * app) in msg_segment_done() argument
1933 GST_DEBUG ("position is %" GST_TIME_FORMAT, GST_TIME_ARGS (app->position)); in msg_segment_done()
1934 gst_message_parse_segment_done (message, &format, &app->position); in msg_segment_done()
1936 GST_TIME_ARGS (app->position)); in msg_segment_done()
1941 if (app->loop_seek) in msg_segment_done()
1943 if (app->skip_seek) in msg_segment_done()
1945 if (app->skip_seek_key_only) in msg_segment_done()
1947 if (app->skip_seek_no_audio) in msg_segment_done()
1950 s_event = gst_event_new_seek (app->rate, in msg_segment_done()
1952 GST_SEEK_TYPE_SET, app->duration); in msg_segment_done()
1955 app->rate, GST_TIME_ARGS (app->duration)); in msg_segment_done()
1957 res = send_event (app, s_event); in msg_segment_done()
1965 do_stream_buffering (PlaybackApp * app, gint percent) in do_stream_buffering() argument
1969 gtk_statusbar_pop (GTK_STATUSBAR (app->statusbar), app->status_id); in do_stream_buffering()
1971 gtk_statusbar_push (GTK_STATUSBAR (app->statusbar), app->status_id, bufstr); in do_stream_buffering()
1976 app->buffering = FALSE; in do_stream_buffering()
1978 if (app->state == GST_STATE_PLAYING) { in do_stream_buffering()
1980 if (!app->is_live) { in do_stream_buffering()
1982 gst_element_set_state (app->pipeline, GST_STATE_PLAYING); in do_stream_buffering()
1984 gtk_statusbar_pop (GTK_STATUSBAR (app->statusbar), app->status_id); in do_stream_buffering()
1985 gtk_statusbar_push (GTK_STATUSBAR (app->statusbar), app->status_id, in do_stream_buffering()
1990 if (!app->buffering && app->state == GST_STATE_PLAYING) { in do_stream_buffering()
1992 if (!app->is_live) { in do_stream_buffering()
1994 gst_element_set_state (app->pipeline, GST_STATE_PAUSED); in do_stream_buffering()
1997 app->buffering = TRUE; in do_stream_buffering()
2002 do_download_buffering (PlaybackApp * app, gint percent) in do_download_buffering() argument
2004 if (!app->buffering && percent < 100) { in do_download_buffering()
2007 app->buffering = TRUE; in do_download_buffering()
2010 gtk_statusbar_push (GTK_STATUSBAR (app->statusbar), app->status_id, bufstr); in do_download_buffering()
2014 set_update_fill (app, TRUE); in do_download_buffering()
2016 if (app->state == GST_STATE_PLAYING && !app->is_live) { in do_download_buffering()
2018 gst_element_set_state (app->pipeline, GST_STATE_PAUSED); in do_download_buffering()
2020 app->state = GST_STATE_PAUSED; in do_download_buffering()
2026 msg_buffering (GstBus * bus, GstMessage * message, PlaybackApp * app) in msg_buffering() argument
2033 gst_message_parse_buffering_stats (message, &app->mode, NULL, NULL, in msg_buffering()
2034 &app->buffering_left); in msg_buffering()
2036 switch (app->mode) { in msg_buffering()
2038 do_download_buffering (app, percent); in msg_buffering()
2041 app->is_live = TRUE; in msg_buffering()
2044 do_stream_buffering (app, percent); in msg_buffering()
2050 msg_clock_lost (GstBus * bus, GstMessage * message, PlaybackApp * app) in msg_clock_lost() argument
2053 if (app->state == GST_STATE_PLAYING) { in msg_clock_lost()
2054 gst_element_set_state (app->pipeline, GST_STATE_PAUSED); in msg_clock_lost()
2055 gst_element_set_state (app->pipeline, GST_STATE_PLAYING); in msg_clock_lost()
2087 find_interface_elements (PlaybackApp * app) in find_interface_elements() argument
2093 if (app->pipeline_type == 0) in find_interface_elements()
2096 if (app->navigation_element) in find_interface_elements()
2097 gst_object_unref (app->navigation_element); in find_interface_elements()
2098 app->navigation_element = NULL; in find_interface_elements()
2100 if (app->colorbalance_element) in find_interface_elements()
2101 gst_object_unref (app->colorbalance_element); in find_interface_elements()
2102 app->colorbalance_element = NULL; in find_interface_elements()
2104 app->navigation_element = in find_interface_elements()
2105 gst_bin_get_by_interface (GST_BIN (app->pipeline), GST_TYPE_NAVIGATION); in find_interface_elements()
2107 it = gst_bin_iterate_all_by_interface (GST_BIN (app->pipeline), in find_interface_elements()
2115 if (!app->colorbalance_element) { in find_interface_elements()
2116 app->colorbalance_element = in find_interface_elements()
2127 if (app->colorbalance_element) in find_interface_elements()
2128 gst_object_unref (app->colorbalance_element); in find_interface_elements()
2129 app->colorbalance_element = in find_interface_elements()
2138 if (hardware && app->colorbalance_element) in find_interface_elements()
2146 if (app->colorbalance_element) in find_interface_elements()
2147 gst_object_unref (app->colorbalance_element); in find_interface_elements()
2148 app->colorbalance_element = NULL; in find_interface_elements()
2163 navigation_cmd_cb (GtkButton * button, PlaybackApp * app) in navigation_cmd_cb() argument
2168 if (!app->navigation_element) { in navigation_cmd_cb()
2169 find_interface_elements (app); in navigation_cmd_cb()
2170 if (!app->navigation_element) in navigation_cmd_cb()
2174 for (i = 0; i < G_N_ELEMENTS (app->navigation_buttons); i++) { in navigation_cmd_cb()
2175 if (app->navigation_buttons[i].button == GTK_WIDGET (button)) { in navigation_cmd_cb()
2176 cmd = app->navigation_buttons[i].cmd; in navigation_cmd_cb()
2182 gst_navigation_send_command (GST_NAVIGATION (app->navigation_element), cmd); in navigation_cmd_cb()
2192 bus_sync_handler (GstBus * bus, GstMessage * message, PlaybackApp * app) in bus_sync_handler() argument
2197 if (app->overlay_element) in bus_sync_handler()
2198 gst_object_unref (app->overlay_element); in bus_sync_handler()
2199 app->overlay_element = GST_ELEMENT (gst_object_ref (element)); in bus_sync_handler()
2202 app->embed_xid); in bus_sync_handler()
2209 g_assert (app->embed_xid != 0); in bus_sync_handler()
2212 app->embed_xid); in bus_sync_handler()
2214 find_interface_elements (app); in bus_sync_handler()
2221 draw_cb (GtkWidget * widget, cairo_t * cr, PlaybackApp * app) in draw_cb() argument
2223 if (app->state < GST_STATE_PAUSED) { in draw_cb()
2236 if (!app->overlay_element) { in draw_cb()
2237 app->overlay_element = gst_bin_get_by_interface (GST_BIN (app->pipeline), in draw_cb()
2241 if (app->overlay_element) in draw_cb()
2242 gst_video_overlay_expose (GST_VIDEO_OVERLAY (app->overlay_element)); in draw_cb()
2248 realize_cb (GtkWidget * widget, PlaybackApp * app) in realize_cb() argument
2258 app->embed_xid = (guintptr) GDK_WINDOW_HWND (window); in realize_cb()
2260 app->embed_xid); in realize_cb()
2262 app->embed_xid = (guintptr) gdk_quartz_window_get_nsview (window); in realize_cb()
2264 app->embed_xid); in realize_cb()
2266 app->embed_xid = GDK_WINDOW_XID (window); in realize_cb()
2268 app->embed_xid); in realize_cb()
2273 button_press_cb (GtkWidget * widget, GdkEventButton * event, PlaybackApp * app) in button_press_cb() argument
2277 if (app->navigation_element) in button_press_cb()
2278 gst_navigation_send_mouse_event (GST_NAVIGATION (app->navigation_element), in button_press_cb()
2286 PlaybackApp * app) in button_release_cb() argument
2288 if (app->navigation_element) in button_release_cb()
2289 gst_navigation_send_mouse_event (GST_NAVIGATION (app->navigation_element), in button_release_cb()
2296 key_press_cb (GtkWidget * widget, GdkEventKey * event, PlaybackApp * app) in key_press_cb() argument
2298 if (app->navigation_element) in key_press_cb()
2299 gst_navigation_send_key_event (GST_NAVIGATION (app->navigation_element), in key_press_cb()
2306 key_release_cb (GtkWidget * widget, GdkEventKey * event, PlaybackApp * app) in key_release_cb() argument
2308 if (app->navigation_element) in key_release_cb()
2309 gst_navigation_send_key_event (GST_NAVIGATION (app->navigation_element), in key_release_cb()
2316 motion_notify_cb (GtkWidget * widget, GdkEventMotion * event, PlaybackApp * app) in motion_notify_cb() argument
2318 if (app->navigation_element) in motion_notify_cb()
2319 gst_navigation_send_mouse_event (GST_NAVIGATION (app->navigation_element), in motion_notify_cb()
2338 PlaybackApp * app) in configure_event_cb() argument
2344 if (!app->overlay_element) { in configure_event_cb()
2345 app->overlay_element = gst_bin_get_by_interface (GST_BIN (app->pipeline), in configure_event_cb()
2349 if (app->overlay_element) { in configure_event_cb()
2351 (app->overlay_element), 0, 0, event->width, event->height); in configure_event_cb()
2359 msg_eos (GstBus * bus, GstMessage * message, PlaybackApp * app) in msg_eos() argument
2361 message_received (bus, message, app); in msg_eos()
2364 if (app->current_path && app->pipeline_type == 0) { in msg_eos()
2365 stop_cb (NULL, app); in msg_eos()
2366 app->current_path = g_list_next (app->current_path); in msg_eos()
2367 app->current_sub_path = g_list_next (app->current_sub_path); in msg_eos()
2368 if (app->current_path) { in msg_eos()
2369 playbin_set_uri (app->pipeline, app->current_path->data, in msg_eos()
2370 app->current_sub_path ? app->current_sub_path->data : NULL); in msg_eos()
2371 play_cb (NULL, app); in msg_eos()
2377 msg_step_done (GstBus * bus, GstMessage * message, PlaybackApp * app) in msg_step_done() argument
2379 if (!app->shuttling) in msg_step_done()
2380 message_received (bus, message, app); in msg_step_done()
2384 msg (GstBus * bus, GstMessage * message, PlaybackApp * app) in msg() argument
2398 for (j = 0; j < G_N_ELEMENTS (app->navigation_buttons); j++) in msg()
2399 gtk_widget_set_sensitive (app->navigation_buttons[j].button, FALSE); in msg()
2418 for (j = 0; j < G_N_ELEMENTS (app->navigation_buttons); j++) { in msg()
2419 if (app->navigation_buttons[j].cmd != cmd) in msg()
2422 gtk_widget_set_sensitive (app->navigation_buttons[j].button, in msg()
2428 gtk_widget_set_sensitive (GTK_WIDGET (app->seek_scale), !is_menu); in msg()
2434 message_received (bus, message, app); in msg()
2443 connect_bus_signals (PlaybackApp * app) in connect_bus_signals() argument
2445 GstBus *bus = gst_pipeline_get_bus (GST_PIPELINE (app->pipeline)); in connect_bus_signals()
2448 if (app->pipeline_type != 0) { in connect_bus_signals()
2450 gst_bus_set_sync_handler (bus, (GstBusSyncHandler) bus_sync_handler, app, in connect_bus_signals()
2459 G_CALLBACK (msg_state_changed), app); in connect_bus_signals()
2461 app); in connect_bus_signals()
2463 app); in connect_bus_signals()
2466 app); in connect_bus_signals()
2468 app); in connect_bus_signals()
2469 g_signal_connect (bus, "message::error", G_CALLBACK (message_received), app); in connect_bus_signals()
2471 app); in connect_bus_signals()
2472 g_signal_connect (bus, "message::eos", G_CALLBACK (msg_eos), app); in connect_bus_signals()
2473 g_signal_connect (bus, "message::tag", G_CALLBACK (message_received), app); in connect_bus_signals()
2475 app); in connect_bus_signals()
2477 app); in connect_bus_signals()
2478 g_signal_connect (bus, "message::buffering", G_CALLBACK (msg_buffering), app); in connect_bus_signals()
2480 // app); in connect_bus_signals()
2482 app); in connect_bus_signals()
2484 G_CALLBACK (msg_sync_step_done), app); in connect_bus_signals()
2485 g_signal_connect (bus, "message", G_CALLBACK (msg), app); in connect_bus_signals()
2529 delete_event_cb (GtkWidget * widget, GdkEvent * event, PlaybackApp * app) in delete_event_cb() argument
2531 stop_cb (NULL, app); in delete_event_cb()
2536 video_sink_activate_cb (GtkEntry * entry, PlaybackApp * app) in video_sink_activate_cb() argument
2546 g_object_set (app->pipeline, "video-sink", sink, NULL); in video_sink_activate_cb()
2550 audio_sink_activate_cb (GtkEntry * entry, PlaybackApp * app) in audio_sink_activate_cb() argument
2560 g_object_set (app->pipeline, "audio-sink", sink, NULL); in audio_sink_activate_cb()
2564 text_sink_activate_cb (GtkEntry * entry, PlaybackApp * app) in text_sink_activate_cb() argument
2574 g_object_set (app->pipeline, "text-sink", sink, NULL); in text_sink_activate_cb()
2578 buffer_size_activate_cb (GtkEntry * entry, PlaybackApp * app) in buffer_size_activate_cb() argument
2589 g_object_set (app->pipeline, "buffer-size", (gint) v, NULL); in buffer_size_activate_cb()
2595 buffer_duration_activate_cb (GtkEntry * entry, PlaybackApp * app) in buffer_duration_activate_cb() argument
2606 g_object_set (app->pipeline, "buffer-duration", v, NULL); in buffer_duration_activate_cb()
2612 ringbuffer_maxsize_activate_cb (GtkEntry * entry, PlaybackApp * app) in ringbuffer_maxsize_activate_cb() argument
2623 g_object_set (app->pipeline, "ring-buffer-max-size", v, NULL); in ringbuffer_maxsize_activate_cb()
2629 connection_speed_activate_cb (GtkEntry * entry, PlaybackApp * app) in connection_speed_activate_cb() argument
2640 g_object_set (app->pipeline, "connection-speed", v, NULL); in connection_speed_activate_cb()
2646 subtitle_encoding_activate_cb (GtkEntry * entry, PlaybackApp * app) in subtitle_encoding_activate_cb() argument
2651 g_object_set (app->pipeline, "subtitle-encoding", text, NULL); in subtitle_encoding_activate_cb()
2655 subtitle_fontdesc_cb (GtkFontButton * button, PlaybackApp * app) in subtitle_fontdesc_cb() argument
2660 g_object_set (app->pipeline, "subtitle-font-desc", text, NULL); in subtitle_fontdesc_cb()
2677 av_offset_activate_cb (GtkEntry * entry, PlaybackApp * app) in av_offset_activate_cb() argument
2684 g_object_set (app->pipeline, "av-offset", v, NULL); in av_offset_activate_cb()
2688 text_offset_activate_cb (GtkEntry * entry, PlaybackApp * app) in text_offset_activate_cb() argument
2695 g_object_set (app->pipeline, "text-offset", v, NULL); in text_offset_activate_cb()
2712 create_ui (PlaybackApp * app) in create_ui() argument
2719 app->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); in create_ui()
2720 app->video_window = gtk_drawing_area_new (); in create_ui()
2721 g_signal_connect (app->video_window, "draw", G_CALLBACK (draw_cb), app); in create_ui()
2722 g_signal_connect (app->video_window, "realize", G_CALLBACK (realize_cb), app); in create_ui()
2723 g_signal_connect (app->video_window, "button-press-event", in create_ui()
2724 G_CALLBACK (button_press_cb), app); in create_ui()
2725 g_signal_connect (app->video_window, "button-release-event", in create_ui()
2726 G_CALLBACK (button_release_cb), app); in create_ui()
2727 g_signal_connect (app->video_window, "key-press-event", in create_ui()
2728 G_CALLBACK (key_press_cb), app); in create_ui()
2729 g_signal_connect (app->video_window, "key-release-event", in create_ui()
2730 G_CALLBACK (key_release_cb), app); in create_ui()
2731 g_signal_connect (app->video_window, "motion-notify-event", in create_ui()
2732 G_CALLBACK (motion_notify_cb), app); in create_ui()
2734 g_signal_connect (app->video_window, "configure-event", in create_ui()
2735 G_CALLBACK (configure_event_cb), app); in create_ui()
2737 gtk_widget_set_can_focus (app->video_window, TRUE); in create_ui()
2738 gtk_widget_add_events (app->video_window, in create_ui()
2742 app->statusbar = gtk_statusbar_new (); in create_ui()
2743 app->status_id = in create_ui()
2744 gtk_statusbar_get_context_id (GTK_STATUSBAR (app->statusbar), in create_ui()
2746 gtk_statusbar_push (GTK_STATUSBAR (app->statusbar), app->status_id, in create_ui()
2823 gtk_spin_button_set_value (GTK_SPIN_BUTTON (rate_spinbutton), app->rate); in create_ui()
2826 G_CALLBACK (accurate_toggle_cb), app); in create_ui()
2828 G_CALLBACK (key_toggle_cb), app); in create_ui()
2830 G_CALLBACK (loop_toggle_cb), app); in create_ui()
2832 G_CALLBACK (flush_toggle_cb), app); in create_ui()
2834 G_CALLBACK (scrub_toggle_cb), app); in create_ui()
2836 G_CALLBACK (play_scrub_toggle_cb), app); in create_ui()
2838 G_CALLBACK (instant_rate_change_toggle_cb), app); in create_ui()
2840 G_CALLBACK (skip_toggle_cb), app); in create_ui()
2842 G_CALLBACK (skip_key_toggle_cb), app); in create_ui()
2844 G_CALLBACK (skip_audio_toggle_cb), app); in create_ui()
2846 G_CALLBACK (rate_spinbutton_changed_cb), app); in create_ui()
2848 G_CALLBACK (snap_before_toggle_cb), app); in create_ui()
2850 G_CALLBACK (snap_after_toggle_cb), app); in create_ui()
2874 app->seek_format_combo = gtk_combo_box_text_new (); in create_ui()
2875 g_signal_connect (app->seek_format_combo, "changed", in create_ui()
2876 G_CALLBACK (seek_format_changed_cb), app); in create_ui()
2877 gtk_grid_attach (GTK_GRID (advanced_seek_grid), app->seek_format_combo, 0, in create_ui()
2880 app->seek_entry = gtk_entry_new (); in create_ui()
2881 gtk_entry_set_width_chars (GTK_ENTRY (app->seek_entry), 12); in create_ui()
2882 gtk_grid_attach (GTK_GRID (advanced_seek_grid), app->seek_entry, 0, 1, 1, in create_ui()
2887 G_CALLBACK (advanced_seek_button_cb), app); in create_ui()
2895 app->seek_position_label = gtk_label_new ("-1"); in create_ui()
2896 gtk_grid_attach (GTK_GRID (advanced_seek_grid), app->seek_position_label, 3, in create_ui()
2898 app->seek_duration_label = gtk_label_new ("-1"); in create_ui()
2899 gtk_grid_attach (GTK_GRID (advanced_seek_grid), app->seek_duration_label, 3, in create_ui()
2907 app->seek_start_label = gtk_label_new ("-1"); in create_ui()
2908 gtk_grid_attach (GTK_GRID (advanced_seek_grid), app->seek_start_label, 5, in create_ui()
2910 app->seek_stop_label = gtk_label_new ("-1"); in create_ui()
2911 gtk_grid_attach (GTK_GRID (advanced_seek_grid), app->seek_stop_label, 5, in create_ui()
2927 app->step_format_combo = gtk_combo_box_text_new (); in create_ui()
2928 gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (app->step_format_combo), in create_ui()
2930 gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (app->step_format_combo), in create_ui()
2932 gtk_combo_box_set_active (GTK_COMBO_BOX (app->step_format_combo), 0); in create_ui()
2933 gtk_box_pack_start (GTK_BOX (hbox), app->step_format_combo, FALSE, FALSE, in create_ui()
2936 app->step_amount_spinbutton = gtk_spin_button_new_with_range (1, 1000, 1); in create_ui()
2937 gtk_spin_button_set_digits (GTK_SPIN_BUTTON (app->step_amount_spinbutton), in create_ui()
2939 gtk_spin_button_set_value (GTK_SPIN_BUTTON (app->step_amount_spinbutton), in create_ui()
2941 gtk_box_pack_start (GTK_BOX (hbox), app->step_amount_spinbutton, FALSE, in create_ui()
2944 app->step_rate_spinbutton = gtk_spin_button_new_with_range (0.0, 100, 0.1); in create_ui()
2945 gtk_spin_button_set_digits (GTK_SPIN_BUTTON (app->step_rate_spinbutton), 3); in create_ui()
2946 gtk_spin_button_set_value (GTK_SPIN_BUTTON (app->step_rate_spinbutton), in create_ui()
2948 gtk_box_pack_start (GTK_BOX (hbox), app->step_rate_spinbutton, FALSE, FALSE, in create_ui()
2958 app); in create_ui()
2965 app); in create_ui()
2969 app->shuttle_scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, adjustment); in create_ui()
2970 gtk_scale_set_digits (GTK_SCALE (app->shuttle_scale), 2); in create_ui()
2971 gtk_scale_set_value_pos (GTK_SCALE (app->shuttle_scale), GTK_POS_TOP); in create_ui()
2972 g_signal_connect (app->shuttle_scale, "value-changed", in create_ui()
2973 G_CALLBACK (shuttle_value_changed), app); in create_ui()
2974 g_signal_connect (app->shuttle_scale, "format_value", in create_ui()
2975 G_CALLBACK (shuttle_format_value), app); in create_ui()
2977 gtk_box_pack_start (GTK_BOX (hbox), app->shuttle_scale, TRUE, TRUE, 2); in create_ui()
2997 G_CALLBACK (navigation_cmd_cb), app); in create_ui()
3001 app->navigation_buttons[i].button = navigation_button; in create_ui()
3002 app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU1; in create_ui()
3006 G_CALLBACK (navigation_cmd_cb), app); in create_ui()
3010 app->navigation_buttons[i].button = navigation_button; in create_ui()
3011 app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU2; in create_ui()
3015 G_CALLBACK (navigation_cmd_cb), app); in create_ui()
3019 app->navigation_buttons[i].button = navigation_button; in create_ui()
3020 app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU3; in create_ui()
3024 G_CALLBACK (navigation_cmd_cb), app); in create_ui()
3028 app->navigation_buttons[i].button = navigation_button; in create_ui()
3029 app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU4; in create_ui()
3033 G_CALLBACK (navigation_cmd_cb), app); in create_ui()
3037 app->navigation_buttons[i].button = navigation_button; in create_ui()
3038 app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU5; in create_ui()
3042 G_CALLBACK (navigation_cmd_cb), app); in create_ui()
3046 app->navigation_buttons[i].button = navigation_button; in create_ui()
3047 app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU6; in create_ui()
3051 G_CALLBACK (navigation_cmd_cb), app); in create_ui()
3055 app->navigation_buttons[i].button = navigation_button; in create_ui()
3056 app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU7; in create_ui()
3060 G_CALLBACK (navigation_cmd_cb), app); in create_ui()
3063 app->navigation_buttons[i].button = navigation_button; in create_ui()
3064 app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_LEFT; in create_ui()
3068 G_CALLBACK (navigation_cmd_cb), app); in create_ui()
3071 app->navigation_buttons[i].button = navigation_button; in create_ui()
3072 app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_RIGHT; in create_ui()
3076 G_CALLBACK (navigation_cmd_cb), app); in create_ui()
3079 app->navigation_buttons[i].button = navigation_button; in create_ui()
3080 app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_UP; in create_ui()
3084 G_CALLBACK (navigation_cmd_cb), app); in create_ui()
3087 app->navigation_buttons[i].button = navigation_button; in create_ui()
3088 app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_DOWN; in create_ui()
3092 G_CALLBACK (navigation_cmd_cb), app); in create_ui()
3095 app->navigation_buttons[i].button = navigation_button; in create_ui()
3096 app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_ACTIVATE; in create_ui()
3100 G_CALLBACK (navigation_cmd_cb), app); in create_ui()
3103 app->navigation_buttons[i].button = navigation_button; in create_ui()
3104 app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_PREV_ANGLE; in create_ui()
3108 G_CALLBACK (navigation_cmd_cb), app); in create_ui()
3111 app->navigation_buttons[i].button = navigation_button; in create_ui()
3112 app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_NEXT_ANGLE; in create_ui()
3129 app->contrast_scale = in create_ui()
3131 gtk_scale_set_draw_value (GTK_SCALE (app->contrast_scale), FALSE); in create_ui()
3132 g_signal_connect (app->contrast_scale, "value-changed", in create_ui()
3133 G_CALLBACK (colorbalance_value_changed), app); in create_ui()
3134 gtk_container_add (GTK_CONTAINER (frame), app->contrast_scale); in create_ui()
3142 app->brightness_scale = in create_ui()
3144 gtk_scale_set_draw_value (GTK_SCALE (app->brightness_scale), FALSE); in create_ui()
3145 g_signal_connect (app->brightness_scale, "value-changed", in create_ui()
3146 G_CALLBACK (colorbalance_value_changed), app); in create_ui()
3147 gtk_container_add (GTK_CONTAINER (frame), app->brightness_scale); in create_ui()
3155 app->hue_scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, adjustment); in create_ui()
3156 gtk_scale_set_draw_value (GTK_SCALE (app->hue_scale), FALSE); in create_ui()
3157 g_signal_connect (app->hue_scale, "value-changed", in create_ui()
3158 G_CALLBACK (colorbalance_value_changed), app); in create_ui()
3159 gtk_container_add (GTK_CONTAINER (frame), app->hue_scale); in create_ui()
3167 app->saturation_scale = in create_ui()
3169 gtk_scale_set_draw_value (GTK_SCALE (app->saturation_scale), FALSE); in create_ui()
3170 g_signal_connect (app->saturation_scale, "value-changed", in create_ui()
3171 G_CALLBACK (colorbalance_value_changed), app); in create_ui()
3172 gtk_container_add (GTK_CONTAINER (frame), app->saturation_scale); in create_ui()
3181 app->seek_scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, adjustment); in create_ui()
3182 gtk_scale_set_digits (GTK_SCALE (app->seek_scale), 2); in create_ui()
3183 gtk_scale_set_value_pos (GTK_SCALE (app->seek_scale), GTK_POS_RIGHT); in create_ui()
3184 gtk_range_set_show_fill_level (GTK_RANGE (app->seek_scale), TRUE); in create_ui()
3185 gtk_range_set_restrict_to_fill_level (GTK_RANGE (app->seek_scale), FALSE); in create_ui()
3186 gtk_range_set_fill_level (GTK_RANGE (app->seek_scale), N_GRAD); in create_ui()
3188 g_signal_connect (app->seek_scale, "button_press_event", in create_ui()
3189 G_CALLBACK (start_seek), app); in create_ui()
3190 g_signal_connect (app->seek_scale, "button_release_event", in create_ui()
3191 G_CALLBACK (stop_seek), app); in create_ui()
3192 g_signal_connect (app->seek_scale, "format_value", G_CALLBACK (format_value), in create_ui()
3193 app); in create_ui()
3195 if (app->pipeline_type == 0) { in create_ui()
3203 app->video_combo = gtk_combo_box_text_new (); in create_ui()
3204 app->audio_combo = gtk_combo_box_text_new (); in create_ui()
3205 app->text_combo = gtk_combo_box_text_new (); in create_ui()
3206 gtk_widget_set_sensitive (app->video_combo, FALSE); in create_ui()
3207 gtk_widget_set_sensitive (app->audio_combo, FALSE); in create_ui()
3208 gtk_widget_set_sensitive (app->text_combo, FALSE); in create_ui()
3209 gtk_box_pack_start (GTK_BOX (panel), app->video_combo, TRUE, TRUE, 2); in create_ui()
3210 gtk_box_pack_start (GTK_BOX (panel), app->audio_combo, TRUE, TRUE, 2); in create_ui()
3211 gtk_box_pack_start (GTK_BOX (panel), app->text_combo, TRUE, TRUE, 2); in create_ui()
3212 g_signal_connect (G_OBJECT (app->video_combo), "changed", in create_ui()
3213 G_CALLBACK (video_combo_cb), app); in create_ui()
3214 g_signal_connect (G_OBJECT (app->audio_combo), "changed", in create_ui()
3215 G_CALLBACK (audio_combo_cb), app); in create_ui()
3216 g_signal_connect (G_OBJECT (app->text_combo), "changed", in create_ui()
3217 G_CALLBACK (text_combo_cb), app); in create_ui()
3225 app->video_checkbox = gtk_check_button_new_with_label ("Video"); in create_ui()
3226 app->audio_checkbox = gtk_check_button_new_with_label ("Audio"); in create_ui()
3227 app->text_checkbox = gtk_check_button_new_with_label ("Text"); in create_ui()
3228 app->vis_checkbox = gtk_check_button_new_with_label ("Vis"); in create_ui()
3229 app->soft_volume_checkbox = gtk_check_button_new_with_label ("Soft Volume"); in create_ui()
3230 app->native_audio_checkbox = in create_ui()
3232 app->native_video_checkbox = in create_ui()
3234 app->download_checkbox = gtk_check_button_new_with_label ("Download"); in create_ui()
3235 app->buffering_checkbox = gtk_check_button_new_with_label ("Buffering"); in create_ui()
3236 app->deinterlace_checkbox = gtk_check_button_new_with_label ("Deinterlace"); in create_ui()
3237 app->soft_colorbalance_checkbox = in create_ui()
3239 app->mute_checkbox = gtk_check_button_new_with_label ("Mute"); in create_ui()
3241 app->volume_spinbutton = gtk_spin_button_new_with_range (0, 10.0, 0.1); in create_ui()
3243 gtk_grid_attach (GTK_GRID (boxes), app->video_checkbox, 0, 0, 1, 1); in create_ui()
3244 gtk_grid_attach (GTK_GRID (boxes), app->audio_checkbox, 1, 0, 1, 1); in create_ui()
3245 gtk_grid_attach (GTK_GRID (boxes), app->text_checkbox, 2, 0, 1, 1); in create_ui()
3246 gtk_grid_attach (GTK_GRID (boxes), app->vis_checkbox, 3, 0, 1, 1); in create_ui()
3247 gtk_grid_attach (GTK_GRID (boxes), app->soft_volume_checkbox, 4, 0, 1, 1); in create_ui()
3248 gtk_grid_attach (GTK_GRID (boxes), app->native_audio_checkbox, 5, 0, 1, 1); in create_ui()
3249 gtk_grid_attach (GTK_GRID (boxes), app->native_video_checkbox, 0, 1, 1, 1); in create_ui()
3250 gtk_grid_attach (GTK_GRID (boxes), app->download_checkbox, 1, 1, 1, 1); in create_ui()
3251 gtk_grid_attach (GTK_GRID (boxes), app->buffering_checkbox, 2, 1, 1, 1); in create_ui()
3252 gtk_grid_attach (GTK_GRID (boxes), app->deinterlace_checkbox, 3, 1, 1, 1); in create_ui()
3253 gtk_grid_attach (GTK_GRID (boxes), app->soft_colorbalance_checkbox, 4, 1, 1, in create_ui()
3256 gtk_grid_attach (GTK_GRID (boxes), app->mute_checkbox, 6, 0, 1, 1); in create_ui()
3258 gtk_grid_attach (GTK_GRID (boxes), app->volume_spinbutton, 6, 1, 1, 1); in create_ui()
3260 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->video_checkbox), in create_ui()
3262 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->audio_checkbox), in create_ui()
3264 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->text_checkbox), TRUE); in create_ui()
3265 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->vis_checkbox), FALSE); in create_ui()
3266 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->soft_volume_checkbox), in create_ui()
3269 (app->native_audio_checkbox), FALSE); in create_ui()
3271 (app->native_video_checkbox), FALSE); in create_ui()
3272 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->download_checkbox), in create_ui()
3274 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->buffering_checkbox), in create_ui()
3276 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->deinterlace_checkbox), in create_ui()
3279 (app->soft_colorbalance_checkbox), TRUE); in create_ui()
3280 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->mute_checkbox), in create_ui()
3282 gtk_spin_button_set_value (GTK_SPIN_BUTTON (app->volume_spinbutton), 1.0); in create_ui()
3284 g_signal_connect (G_OBJECT (app->video_checkbox), "toggled", in create_ui()
3285 G_CALLBACK (video_toggle_cb), app); in create_ui()
3286 g_signal_connect (G_OBJECT (app->audio_checkbox), "toggled", in create_ui()
3287 G_CALLBACK (audio_toggle_cb), app); in create_ui()
3288 g_signal_connect (G_OBJECT (app->text_checkbox), "toggled", in create_ui()
3289 G_CALLBACK (text_toggle_cb), app); in create_ui()
3290 g_signal_connect (G_OBJECT (app->vis_checkbox), "toggled", in create_ui()
3291 G_CALLBACK (vis_toggle_cb), app); in create_ui()
3292 g_signal_connect (G_OBJECT (app->soft_volume_checkbox), "toggled", in create_ui()
3293 G_CALLBACK (soft_volume_toggle_cb), app); in create_ui()
3294 g_signal_connect (G_OBJECT (app->native_audio_checkbox), "toggled", in create_ui()
3295 G_CALLBACK (native_audio_toggle_cb), app); in create_ui()
3296 g_signal_connect (G_OBJECT (app->native_video_checkbox), "toggled", in create_ui()
3297 G_CALLBACK (native_video_toggle_cb), app); in create_ui()
3298 g_signal_connect (G_OBJECT (app->download_checkbox), "toggled", in create_ui()
3299 G_CALLBACK (download_toggle_cb), app); in create_ui()
3300 g_signal_connect (G_OBJECT (app->buffering_checkbox), "toggled", in create_ui()
3301 G_CALLBACK (buffering_toggle_cb), app); in create_ui()
3302 g_signal_connect (G_OBJECT (app->deinterlace_checkbox), "toggled", in create_ui()
3303 G_CALLBACK (deinterlace_toggle_cb), app); in create_ui()
3304 g_signal_connect (G_OBJECT (app->soft_colorbalance_checkbox), "toggled", in create_ui()
3305 G_CALLBACK (soft_colorbalance_toggle_cb), app); in create_ui()
3306 g_signal_connect (G_OBJECT (app->mute_checkbox), "toggled", in create_ui()
3307 G_CALLBACK (mute_toggle_cb), app); in create_ui()
3308 g_signal_connect (G_OBJECT (app->volume_spinbutton), "value-changed", in create_ui()
3309 G_CALLBACK (volume_spinbutton_changed_cb), app); in create_ui()
3317 app); in create_ui()
3318 app->vis_combo = gtk_combo_box_text_new (); in create_ui()
3319 g_signal_connect (G_OBJECT (app->vis_combo), "changed", in create_ui()
3320 G_CALLBACK (vis_combo_cb), app); in create_ui()
3321 gtk_widget_set_sensitive (app->vis_combo, FALSE); in create_ui()
3323 gtk_box_pack_start (GTK_BOX (boxes2), app->vis_combo, TRUE, TRUE, 2); in create_ui()
3326 init_visualization_features (app); in create_ui()
3337 app->video_sink_entry = gtk_entry_new (); in create_ui()
3338 g_signal_connect (app->video_sink_entry, "activate", in create_ui()
3339 G_CALLBACK (video_sink_activate_cb), app); in create_ui()
3340 gtk_grid_attach (GTK_GRID (boxes3), app->video_sink_entry, 0, 1, 1, 1); in create_ui()
3344 app->audio_sink_entry = gtk_entry_new (); in create_ui()
3345 g_signal_connect (app->audio_sink_entry, "activate", in create_ui()
3346 G_CALLBACK (audio_sink_activate_cb), app); in create_ui()
3347 gtk_grid_attach (GTK_GRID (boxes3), app->audio_sink_entry, 1, 1, 1, 1); in create_ui()
3351 app->text_sink_entry = gtk_entry_new (); in create_ui()
3352 g_signal_connect (app->text_sink_entry, "activate", in create_ui()
3353 G_CALLBACK (text_sink_activate_cb), app); in create_ui()
3354 gtk_grid_attach (GTK_GRID (boxes3), app->text_sink_entry, 2, 1, 1, 1); in create_ui()
3358 app->buffer_size_entry = gtk_entry_new (); in create_ui()
3359 gtk_entry_set_text (GTK_ENTRY (app->buffer_size_entry), "-1"); in create_ui()
3360 g_signal_connect (app->buffer_size_entry, "activate", in create_ui()
3361 G_CALLBACK (buffer_size_activate_cb), app); in create_ui()
3362 gtk_grid_attach (GTK_GRID (boxes3), app->buffer_size_entry, 0, 3, 1, 1); in create_ui()
3366 app->buffer_duration_entry = gtk_entry_new (); in create_ui()
3367 gtk_entry_set_text (GTK_ENTRY (app->buffer_duration_entry), "-1"); in create_ui()
3368 g_signal_connect (app->buffer_duration_entry, "activate", in create_ui()
3369 G_CALLBACK (buffer_duration_activate_cb), app); in create_ui()
3370 gtk_grid_attach (GTK_GRID (boxes3), app->buffer_duration_entry, 1, 3, 1, 1); in create_ui()
3374 app->ringbuffer_maxsize_entry = gtk_entry_new (); in create_ui()
3375 gtk_entry_set_text (GTK_ENTRY (app->ringbuffer_maxsize_entry), "0"); in create_ui()
3376 g_signal_connect (app->ringbuffer_maxsize_entry, "activate", in create_ui()
3377 G_CALLBACK (ringbuffer_maxsize_activate_cb), app); in create_ui()
3378 gtk_grid_attach (GTK_GRID (boxes3), app->ringbuffer_maxsize_entry, 2, 3, 1, in create_ui()
3383 app->connection_speed_entry = gtk_entry_new (); in create_ui()
3384 gtk_entry_set_text (GTK_ENTRY (app->connection_speed_entry), "0"); in create_ui()
3385 g_signal_connect (app->connection_speed_entry, "activate", in create_ui()
3386 G_CALLBACK (connection_speed_activate_cb), app); in create_ui()
3387 gtk_grid_attach (GTK_GRID (boxes3), app->connection_speed_entry, 3, 3, 1, in create_ui()
3392 app->av_offset_entry = gtk_entry_new (); in create_ui()
3393 g_signal_connect (app->av_offset_entry, "activate", in create_ui()
3394 G_CALLBACK (av_offset_activate_cb), app); in create_ui()
3395 gtk_entry_set_text (GTK_ENTRY (app->av_offset_entry), "0"); in create_ui()
3396 g_signal_connect (app->av_offset_entry, "activate", in create_ui()
3397 G_CALLBACK (av_offset_activate_cb), app); in create_ui()
3398 gtk_grid_attach (GTK_GRID (boxes3), app->av_offset_entry, 4, 3, 1, 1); in create_ui()
3402 app->text_offset_entry = gtk_entry_new (); in create_ui()
3403 g_signal_connect (app->text_offset_entry, "activate", in create_ui()
3404 G_CALLBACK (text_offset_activate_cb), app); in create_ui()
3405 gtk_entry_set_text (GTK_ENTRY (app->text_offset_entry), "0"); in create_ui()
3406 g_signal_connect (app->text_offset_entry, "activate", in create_ui()
3407 G_CALLBACK (text_offset_activate_cb), app); in create_ui()
3408 gtk_grid_attach (GTK_GRID (boxes3), app->text_offset_entry, 5, 3, 1, 1); in create_ui()
3412 app->subtitle_encoding_entry = gtk_entry_new (); in create_ui()
3413 g_signal_connect (app->subtitle_encoding_entry, "activate", in create_ui()
3414 G_CALLBACK (subtitle_encoding_activate_cb), app); in create_ui()
3415 gtk_grid_attach (GTK_GRID (boxes3), app->subtitle_encoding_entry, 0, 5, 1, in create_ui()
3420 app->subtitle_fontdesc_button = gtk_font_button_new (); in create_ui()
3421 g_signal_connect (app->subtitle_fontdesc_button, "font-set", in create_ui()
3422 G_CALLBACK (subtitle_fontdesc_cb), app); in create_ui()
3423 gtk_grid_attach (GTK_GRID (boxes3), app->subtitle_fontdesc_button, 1, 5, 1, in create_ui()
3435 if (app->pipeline_type == 0) in create_ui()
3436 gtk_window_set_title (GTK_WINDOW (app->window), app->current_path->data); in create_ui()
3438 gtk_window_set_default_size (GTK_WINDOW (app->window), 250, 96); in create_ui()
3440 gtk_widget_set_size_request (GTK_WIDGET (app->video_window), -1, in create_ui()
3442 gtk_container_add (GTK_CONTAINER (app->window), vbox); in create_ui()
3443 gtk_box_pack_start (GTK_BOX (vbox), app->video_window, TRUE, TRUE, 2); in create_ui()
3457 gtk_box_pack_start (GTK_BOX (vbox), app->seek_scale, FALSE, FALSE, 2); in create_ui()
3458 gtk_box_pack_start (GTK_BOX (vbox), app->statusbar, FALSE, FALSE, 2); in create_ui()
3462 app); in create_ui()
3464 app); in create_ui()
3466 app); in create_ui()
3468 g_signal_connect (G_OBJECT (app->window), "delete-event", in create_ui()
3469 G_CALLBACK (delete_event_cb), app); in create_ui()
3476 set_defaults (PlaybackApp * app) in set_defaults() argument
3478 memset (app, 0, sizeof (PlaybackApp)); in set_defaults()
3480 app->flush_seek = TRUE; in set_defaults()
3481 app->scrub = TRUE; in set_defaults()
3482 app->rate = 1.0; in set_defaults()
3484 app->position = app->duration = -1; in set_defaults()
3485 app->state = GST_STATE_NULL; in set_defaults()
3487 app->need_streams = TRUE; in set_defaults()
3489 g_mutex_init (&app->state_mutex); in set_defaults()
3491 app->play_rate = 1.0; in set_defaults()
3495 reset_app (PlaybackApp * app) in reset_app() argument
3497 GstBus *bus = gst_pipeline_get_bus (GST_PIPELINE (app->pipeline)); in reset_app()
3501 g_list_free (app->formats); in reset_app()
3502 g_mutex_clear (&app->state_mutex); in reset_app()
3504 if (app->overlay_element) in reset_app()
3505 gst_object_unref (app->overlay_element); in reset_app()
3506 if (app->navigation_element) in reset_app()
3507 gst_object_unref (app->navigation_element); in reset_app()
3508 if (app->colorbalance_element) in reset_app()
3509 gst_object_unref (app->colorbalance_element); in reset_app()
3511 g_list_foreach (app->paths, (GFunc) g_free, NULL); in reset_app()
3512 g_list_free (app->paths); in reset_app()
3513 g_list_foreach (app->sub_paths, (GFunc) g_free, NULL); in reset_app()
3514 g_list_free (app->sub_paths); in reset_app()
3515 if (app->vis_entries) in reset_app()
3516 g_array_free (app->vis_entries, TRUE); in reset_app()
3518 gst_object_unref (app->pipeline); in reset_app()
3524 PlaybackApp app; in main() local
3526 {"stats", 's', 0, G_OPTION_ARG_NONE, &app.stats, in main()
3528 {"verbose", 'v', 0, G_OPTION_ARG_NONE, &app.verbose, in main()
3535 set_defaults (&app); in main()
3557 app.pipeline_type = -1; in main()
3559 app.pipeline_type = atoi (argv[1]); in main()
3565 app.pipeline_type = i; in main()
3571 if (app.pipeline_type < 0 || app.pipeline_type >= G_N_ELEMENTS (pipelines)) { in main()
3576 app.pipeline_spec = argv[2]; in main()
3578 if (g_path_is_absolute (app.pipeline_spec) && in main()
3579 (g_strrstr (app.pipeline_spec, "*") != NULL || in main()
3580 g_strrstr (app.pipeline_spec, "?") != NULL)) { in main()
3581 app.paths = handle_wildcards (app.pipeline_spec); in main()
3583 app.paths = g_list_prepend (app.paths, g_strdup (app.pipeline_spec)); in main()
3586 if (!app.paths) { in main()
3587 g_print ("opening %s failed\n", app.pipeline_spec); in main()
3591 app.current_path = app.paths; in main()
3597 app.sub_paths = handle_wildcards (argv[3]); in main()
3599 app.sub_paths = g_list_prepend (app.sub_paths, g_strdup (argv[3])); in main()
3602 if (!app.sub_paths) { in main()
3607 app.current_sub_path = app.sub_paths; in main()
3610 pipelines[app.pipeline_type].func (&app, app.current_path->data); in main()
3611 if (!app.pipeline || !GST_IS_PIPELINE (app.pipeline)) { in main()
3616 create_ui (&app); in main()
3619 gtk_widget_show_all (app.window); in main()
3624 gtk_widget_realize (app.window); in main()
3628 g_assert (app.embed_xid != 0); in main()
3630 if (app.pipeline_type == 0) { in main()
3631 gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (app.pipeline), in main()
3632 app.embed_xid); in main()
3636 if (app.verbose) { in main()
3637 g_signal_connect (app.pipeline, "deep_notify", in main()
3641 connect_bus_signals (&app); in main()
3646 gst_element_set_state (app.pipeline, GST_STATE_NULL); in main()
3648 reset_app (&app); in main()