gint encode_frame;
gint live_id;
gchar *current;
+ gint live_enabled;
};
#if defined(_ENABLE_GST)
GObjectClass *klass;
GParamSpec *pspec;
+ if (!ud->preview->live_enabled)
+ goto fail;
+
g_value_init(&disp_par, GST_TYPE_FRACTION);
gst_value_set_fraction(&disp_par, 1, 1);
g_object_get(ud->preview->play, "video-sink", &xover, NULL);
//xover = gst_element_factory_make("xvimagesink", "xover");
//xover = gst_element_factory_make("ximagesink", "xover");
xover = gst_element_factory_make("gconfvideosink", "xover");
- if (xover == NULL)
+ if (ud->preview->play == NULL || xover == NULL)
{
GtkWidget *widget = GHB_WIDGET(ud->builder, "live_preview_box");
gtk_widget_hide (widget);
gtk_widget_hide (widget);
return;
}
+ else
+ {
- g_object_set(G_OBJECT(ud->preview->play), "video-sink", xover, NULL);
- g_object_set(ud->preview->play, "subtitle-font-desc",
- "sans bold 20", NULL);
- //g_object_set(G_OBJECT(xover), "force-aspect-ratio", TRUE, NULL);
+ g_object_set(G_OBJECT(ud->preview->play), "video-sink", xover, NULL);
+ g_object_set(ud->preview->play, "subtitle-font-desc",
+ "sans bold 20", NULL);
- bus = gst_pipeline_get_bus(GST_PIPELINE(ud->preview->play));
- gst_bus_add_watch(bus, live_preview_cb, ud);
- gst_bus_set_sync_handler(bus, create_window, ud->preview);
- gst_object_unref(bus);
+ bus = gst_pipeline_get_bus(GST_PIPELINE(ud->preview->play));
+ gst_bus_add_watch(bus, live_preview_cb, ud);
+ gst_bus_set_sync_handler(bus, create_window, ud->preview);
+ gst_object_unref(bus);
+ ud->preview->live_enabled = 1;
+ }
#else
widget = GHB_WIDGET(ud->builder, "live_preview_box");
gtk_widget_hide (widget);
GtkImage *img;
gchar *uri;
+ if (!ud->preview->live_enabled)
+ return;
+
img = GTK_IMAGE(GHB_WIDGET(ud->builder, "live_preview_play_image"));
if (!ud->preview->encoded[ud->preview->frame])
{
{
GtkImage *img;
+ if (!ud->preview->live_enabled)
+ return;
+
img = GTK_IMAGE(GHB_WIDGET(ud->builder, "live_preview_play_image"));
gtk_image_set_from_stock(img, "gtk-media-play", GTK_ICON_SIZE_BUTTON);
gst_element_set_state(ud->preview->play, GST_STATE_PAUSED);
GtkImage *img;
GtkRange *progress;
+ if (!ud->preview->live_enabled)
+ return;
+
img = GTK_IMAGE(GHB_WIDGET(ud->builder, "live_preview_play_image"));
gtk_image_set_from_stock(img, "gtk-media-play", GTK_ICON_SIZE_BUTTON);
#if defined(_ENABLE_GST)
GstFormat fmt = GST_FORMAT_TIME;
gint64 len = -1, pos = -1;
+ if (!ud->preview->live_enabled)
+ return;
+
if (ud->preview->state != PREVIEW_STATE_LIVE || ud->preview->seek_lock)
return;
gdouble dval;
gint64 pos;
+ if (!ud->preview->live_enabled)
+ return;
+
if (ud->preview->progress_lock)
return;
GstElement *vsink;
GstXOverlay *xover;
+ if (!ud->preview->live_enabled)
+ return FALSE;
+
g_object_get(ud->preview->play, "video-sink", &vsink, NULL);
if (vsink == NULL)
return FALSE;
signal_user_data_t *ud)
{
#if defined(_ENABLE_GST)
- if (ud->preview->state == PREVIEW_STATE_LIVE)
+ if (ud->preview->live_enabled && ud->preview->state == PREVIEW_STATE_LIVE)
{
if (GST_STATE(ud->preview->play) >= GST_STATE_PAUSED)
{