diff options
author | John Stebbins <[email protected]> | 2016-03-13 18:17:44 -0600 |
---|---|---|
committer | John Stebbins <[email protected]> | 2016-03-13 18:17:44 -0600 |
commit | 3a61ac5213042907586ccda388283edbc51771f4 (patch) | |
tree | eb8db049cc2767e5369ce80d9b608345fe5bf85d /gtk/src | |
parent | 26946a22799d5bedb13ef826aca9fbe0e64231e6 (diff) |
LinGui: some win32 fixes
Fix preview hud background. it was transparent.
Fix initialization of gstreamer. It could not initialize the video
overlay.
Diffstat (limited to 'gtk/src')
-rw-r--r-- | gtk/src/preview.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/gtk/src/preview.c b/gtk/src/preview.c index 3d5c62cc7..865702b05 100644 --- a/gtk/src/preview.c +++ b/gtk/src/preview.c @@ -31,6 +31,8 @@ #if !defined(_WIN32) #include <gdk/gdkx.h> +#else +#include <gdk/gdkwin32.h> #endif #if defined(_ENABLE_GST) @@ -196,6 +198,17 @@ ghb_preview_init(signal_user_data_t *ud) widget = GHB_WIDGET(ud->builder, "preview_button_image"); gtk_widget_get_size_request(widget, &ud->preview->button_width, &ud->preview->button_height); + widget = GHB_WIDGET(ud->builder, "preview_hud"); + gtk_widget_realize(widget); + // Use a native window for the HUD. Client side windows don't get + // updated properly as video changes benieth them. + // This also seems to be required to make the preview hud visible + // on win32. otherwise it is transparent for some reason. + if (!gdk_window_ensure_native(gtk_widget_get_window(widget))) + { + g_message("Couldn't create native window for HUD."); + } + #if defined(_ENABLE_GST) GstBus *bus; GstElement *xover; @@ -209,14 +222,6 @@ ghb_preview_init(signal_user_data_t *ud) gtk_widget_hide (widget); return; } - widget = GHB_WIDGET(ud->builder, "preview_hud"); - gtk_widget_realize(widget); - // Use a native window for the HUD. Client side windows don't get - // updated properly as video changes benieth them. - if (!gdk_window_ensure_native(gtk_widget_get_window(widget))) - { - g_message("Couldn't create native window for HUD."); - } #if !defined(_WIN32) ud->preview->xid = GDK_WINDOW_XID(preview_window(ud->preview->view)); @@ -233,6 +238,10 @@ ghb_preview_init(signal_user_data_t *ud) { xover = gst_element_factory_make("ximagesink", "xover"); } + if (xover == NULL) + { + xover = gst_element_factory_make("autovideosink", "xover"); + } if (ud->preview->play == NULL || xover == NULL) { g_message("Couldn't initialize gstreamer. Disabling live preview."); @@ -698,7 +707,11 @@ live_preview_start(signal_user_data_t *ud) return; } +#if defined(_WIN32) + uri = g_strdup_printf("file:///%s", ud->preview->current); +#else uri = g_strdup_printf("file://%s", ud->preview->current); +#endif gtk_image_set_from_icon_name(img, GHB_PAUSE_ICON, GTK_ICON_SIZE_BUTTON); ud->preview->state = PREVIEW_STATE_LIVE; g_object_set(G_OBJECT(ud->preview->play), "uri", uri, NULL); |