#include "gstvaapisurfaceproxy.h"
#include "gstvaapivideopool_priv.h"
#include "gstvaapiutils.h"
-#include "gstvaapiutils_core.h"
#define DEBUG 1
#include "gstvaapidebug.h"
#define SCRATCH_SURFACES_COUNT (4)
static gboolean
-ensure_formats (GstVaapiContext * context)
+ensure_attributes (GstVaapiContext * context)
{
- if (G_LIKELY (context->formats))
+ if (G_LIKELY (context->attribs))
return TRUE;
- context->formats =
- gst_vaapi_get_surface_formats (GST_VAAPI_OBJECT_DISPLAY (context),
- context->va_config);
- return (context->formats != NULL);
+ context->attribs =
+ gst_vaapi_config_surface_attributes_get (GST_VAAPI_OBJECT_DISPLAY
+ (context), context->va_config);
+ return (context->attribs != NULL);
}
static void
context->va_config = VA_INVALID_ID;
}
- if (context->formats) {
- g_array_unref (context->formats);
- context->formats = NULL;
+ if (context->attribs) {
+ gst_vaapi_config_surface_attributes_free (context->attribs);
+ context->attribs = NULL;
}
}
GstVaapiSurface *surface;
guint i;
- if (!ensure_formats (context))
+ if (!ensure_attributes (context))
return FALSE;
for (i = context->surfaces->len; i < num_surfaces; i++) {
surface =
gst_vaapi_surface_new_from_formats (GST_VAAPI_OBJECT_DISPLAY (context),
- cip->chroma_type, cip->width, cip->height, context->formats);
+ cip->chroma_type, cip->width, cip->height, context->attribs->formats);
if (!surface)
return FALSE;
gst_vaapi_surface_set_parent_context (surface, context);
context->reset_on_resize = TRUE;
gst_vaapi_context_overlay_init (context);
- context->formats = NULL;
+ context->attribs = NULL;
}
static void
{
g_return_val_if_fail (context, NULL);
- if (!ensure_formats (context))
+ if (!ensure_attributes (context))
return NULL;
- return g_array_ref (context->formats);
+
+ if (context->attribs->formats)
+ return g_array_ref (context->attribs->formats);
+ return NULL;
}
#include "gstvaapiprofile.h"
#include "gstvaapidisplay.h"
#include "gstvaapisurface.h"
+#include "gstvaapiutils_core.h"
#include "gstvaapivideopool.h"
G_BEGIN_DECLS
GPtrArray *overlays[2];
guint overlay_id;
gboolean reset_on_resize;
- GArray *formats;
+ GstVaapiConfigSurfaceAttributes *attribs;
};
/**
GstVideoFormat format;
GstVaapiScaleMethod scale_method;
GstVideoOrientationMethod video_direction;
- GArray *formats;
+ GstVaapiConfigSurfaceAttributes *attribs;
GArray *forward_references;
GArray *backward_references;
GstVaapiRectangle crop_rect;
}
/* ------------------------------------------------------------------------- */
-/* --- Surface Formats --- */
+/* --- Surface Attribs --- */
/* ------------------------------------------------------------------------- */
static gboolean
-ensure_formats (GstVaapiFilter * filter)
+ensure_attributes (GstVaapiFilter * filter)
{
- if (G_LIKELY (filter->formats))
+ if (G_LIKELY (filter->attribs))
return TRUE;
- filter->formats = gst_vaapi_get_surface_formats (filter->display,
+ filter->attribs = gst_vaapi_config_surface_attributes_get (filter->display,
filter->va_config);
- return (filter->formats != NULL);
+ return (filter->attribs != NULL);
}
static inline gboolean
find_format (GstVaapiFilter * filter, GstVideoFormat format)
{
guint i;
+ GArray *formats;
- if (is_special_format (format) || !filter->formats)
+ formats = filter->attribs->formats;
+ if (is_special_format (format) || !formats)
return FALSE;
- for (i = 0; i < filter->formats->len; i++) {
- if (g_array_index (filter->formats, GstVideoFormat, i) == format)
+ for (i = 0; i < formats->len; i++) {
+ if (g_array_index (formats, GstVideoFormat, i) == format)
return TRUE;
}
return FALSE;
filter->backward_references = NULL;
}
- if (filter->formats) {
- g_array_unref (filter->formats);
- filter->formats = NULL;
+ if (filter->attribs) {
+ gst_vaapi_config_surface_attributes_free (filter->attribs);
+ filter->attribs = NULL;
}
G_OBJECT_CLASS (gst_vaapi_filter_parent_class)->finalize (object);
{
g_return_val_if_fail (filter != NULL, NULL);
- if (!ensure_formats (filter))
+ if (!ensure_attributes (filter))
return NULL;
- return g_array_ref (filter->formats);
+ if (filter->attribs->formats)
+ return g_array_ref (filter->attribs->formats);
+ return NULL;
}
/**
{
g_return_val_if_fail (filter != NULL, FALSE);
- if (!ensure_formats (filter))
+ if (!ensure_attributes (filter))
return FALSE;
if (!is_special_format (format) && !find_format (filter, format))