Besides, all GstVaapiObject derived class shall initialize "id" to a valid value.
GstVaapiID
GST_VAAPI_ID_FORMAT
GST_VAAPI_ID_ARGS
+GST_VAAPI_ID
+GST_VAAPI_ID_NONE
GstVaapiPoint
GstVaapiRectangle
</SECTION>
image = g_object_new(
GST_VAAPI_TYPE_IMAGE,
"display", display,
+ "id", GST_VAAPI_ID(VA_INVALID_ID),
"format", format,
"width", width,
"height", height,
image = g_object_new(
GST_VAAPI_TYPE_IMAGE,
"display", display,
+ "id", GST_VAAPI_ID(va_image->image_id),
"image", va_image,
NULL
);
*/
#include "config.h"
-#include "gstvaapicompat.h"
#include "gstvaapiobject.h"
#include "gstvaapiobject_priv.h"
#include "gstvaapiparamspecs.h"
{
GstVaapiObjectPrivate * const priv = GST_VAAPI_OBJECT(object)->priv;
- priv->id = VA_INVALID_ID;
+ priv->id = GST_VAAPI_ID_NONE;
if (priv->display) {
g_object_unref(priv->display);
gst_vaapi_param_spec_id("id",
"ID",
"The GstVaapiID contained in this object",
- VA_INVALID_ID,
+ GST_VAAPI_ID_NONE,
G_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY));
/**
object->priv = priv;
priv->display = NULL;
- priv->id = VA_INVALID_ID;
+ priv->id = GST_VAAPI_ID_NONE;
priv->is_destroying = FALSE;
}
GstVaapiID
gst_vaapi_object_get_id(GstVaapiObject *object)
{
- g_return_val_if_fail(GST_VAAPI_IS_OBJECT(object), VA_INVALID_ID);
+ g_return_val_if_fail(GST_VAAPI_IS_OBJECT(object), GST_VAAPI_ID_NONE);
return object->priv->id;
}
#include "config.h"
#include "gstvaapiparamspecs.h"
#include "gstvaapivalue.h"
-#include "gstvaapicompat.h"
-
-#ifdef GST_VAAPI_USE_OLD_VAAPI_0_29
-# include <va.h>
-#else
-# include <va/va.h>
-#endif
/* --- GstVaapiParamSpecID --- */
static void
gst_vaapi_param_id_init(GParamSpec *pspec)
{
- GST_VAAPI_PARAM_SPEC_ID(pspec)->default_value = VA_INVALID_ID;
+ GST_VAAPI_PARAM_SPEC_ID(pspec)->default_value = GST_VAAPI_ID_NONE;
}
static void
return g_object_new(GST_VAAPI_TYPE_SUBPICTURE,
"display", GST_VAAPI_OBJECT_GET_DISPLAY(image),
+ "id", GST_VAAPI_ID(VA_INVALID_ID),
"image", image,
NULL);
}
return g_object_new(GST_VAAPI_TYPE_SURFACE,
"display", display,
+ "id", GST_VAAPI_ID(VA_INVALID_ID),
"width", width,
"height", height,
"chroma-type", chroma_type,
# error "unsupported value for GST_VAAPI_TYPE_ID_SIZE"
#endif
+/**
+ * GST_VAAPI_ID:
+ * @id: an arbitrary integer value
+ *
+ * Macro that creates a #GstVaapiID from @id.
+ */
+#define GST_VAAPI_ID(id) ((GstVaapiID)(id))
+
+/**
+ * GST_VAAPI_ID_NONE:
+ *
+ * Macro that evaluates to the default #GstVaapiID value.
+ */
+#define GST_VAAPI_ID_NONE GST_VAAPI_ID(0)
+
/**
* GST_VAAPI_ID_FORMAT:
*
return g_object_new(GST_VAAPI_TYPE_WINDOW_X11,
"display", display,
- "id", (GstVaapiID)None,
+ "id", GST_VAAPI_ID(None),
"width", width,
"height", height,
NULL);
return g_object_new(GST_VAAPI_TYPE_WINDOW_X11,
"display", display,
- "id", (GstVaapiID)xid,
+ "id", GST_VAAPI_ID(xid),
NULL);
}