From 8e8280efbf01e997564831c14cd1bc30a50d313f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Tue, 11 Apr 2017 18:22:00 +0200 Subject: libs: window: remove surface_format member Since we always convert to NV12, there is no need to keep a variable for that. Let us hard code it. https://bugzilla.gnome.org/show_bug.cgi?id=759533 --- gst-libs/gst/vaapi/gstvaapiwindow.c | 7 +++---- gst-libs/gst/vaapi/gstvaapiwindow_priv.h | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/gst-libs/gst/vaapi/gstvaapiwindow.c b/gst-libs/gst/vaapi/gstvaapiwindow.c index f63a4b98ba..001802cfb4 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow.c +++ b/gst-libs/gst/vaapi/gstvaapiwindow.c @@ -69,7 +69,7 @@ ensure_filter (GstVaapiWindow * window) window->filter = gst_vaapi_filter_new (display); if (!window->filter) goto error_create_filter; - if (!gst_vaapi_filter_set_format (window->filter, window->surface_format)) + if (!gst_vaapi_filter_set_format (window->filter, GST_VIDEO_FORMAT_NV12)) goto error_unsupported_format; return TRUE; @@ -83,7 +83,7 @@ error_create_filter: error_unsupported_format: { GST_ERROR ("unsupported render target format %s", - gst_vaapi_video_format_to_string (window->surface_format)); + gst_vaapi_video_format_to_string (GST_VIDEO_FORMAT_NV12)); window->has_vpp = FALSE; return FALSE; } @@ -100,7 +100,7 @@ ensure_filter_surface_pool (GstVaapiWindow * window) /* Ensure VA surface pool is created */ /* XXX: optimize the surface format to use. e.g. YUY2 */ window->surface_pool = gst_vaapi_surface_pool_new (display, - window->surface_format, window->width, window->height); + GST_VIDEO_FORMAT_NV12, window->width, window->height); if (!window->surface_pool) { GST_WARNING ("failed to create surface pool for conversion"); return FALSE; @@ -168,7 +168,6 @@ gst_vaapi_window_new_internal (const GstVaapiWindowClass * window_class, window->use_foreign_window = id != GST_VAAPI_ID_INVALID; GST_VAAPI_OBJECT_ID (window) = window->use_foreign_window ? id : 0; - window->surface_format = GST_VIDEO_FORMAT_ENCODED; window->has_vpp = GST_VAAPI_DISPLAY_HAS_VPP (GST_VAAPI_OBJECT_DISPLAY (window)); diff --git a/gst-libs/gst/vaapi/gstvaapiwindow_priv.h b/gst-libs/gst/vaapi/gstvaapiwindow_priv.h index c2c106337e..cd0df1a467 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow_priv.h +++ b/gst-libs/gst/vaapi/gstvaapiwindow_priv.h @@ -78,8 +78,7 @@ struct _GstVaapiWindow guint is_fullscreen:1; guint check_geometry:1; - /* for conversion */ - GstVideoFormat surface_format; + /* for conversion */ GstVaapiVideoPool *surface_pool; GstVaapiFilter *filter; gboolean has_vpp; -- cgit v1.2.1