Commit 5c5b45f4 authored by gb's avatar gb

Use GST_DEBUG.

parent 0bf78c5e
......@@ -26,6 +26,8 @@
#define DEBUG 1
#include "vaapi_debug.h"
GST_DEBUG_CATEGORY(gst_debug_vaapi);
G_DEFINE_TYPE(GstVaapiDisplay, gst_vaapi_display, G_TYPE_OBJECT);
#define GST_VAAPI_DISPLAY_GET_PRIVATE(obj) \
......@@ -97,7 +99,7 @@ gst_vaapi_display_create(GstVaapiDisplay *display)
status = vaInitialize(priv->display, &major_version, &minor_version);
if (!vaapi_check_status(status, "vaInitialize()"))
return FALSE;
D(bug("VA-API version %d.%d\n", major_version, minor_version));
GST_DEBUG("VA-API version %d.%d", major_version, minor_version);
/* VA profiles */
priv->num_profiles = vaMaxNumProfiles(priv->display);
......@@ -110,9 +112,9 @@ gst_vaapi_display_create(GstVaapiDisplay *display)
if (!vaapi_check_status(status, "vaQueryConfigProfiles()"))
return FALSE;
D(bug("%d profiles\n", priv->num_profiles));
GST_DEBUG("%d profiles", priv->num_profiles);
for (i = 0; i < priv->num_profiles; i++)
D(bug(" %s\n", string_of_VAProfile(priv->profiles[i])));
GST_DEBUG(" %s", string_of_VAProfile(priv->profiles[i]));
/* VA image formats */
priv->num_image_formats = vaMaxNumImageFormats(priv->display);
......@@ -125,9 +127,9 @@ gst_vaapi_display_create(GstVaapiDisplay *display)
if (!vaapi_check_status(status, "vaQueryImageFormats()"))
return FALSE;
D(bug("%d image formats\n", priv->num_image_formats));
GST_DEBUG("%d image formats", priv->num_image_formats);
for (i = 0; i < priv->num_image_formats; i++)
D(bug(" %s\n", string_of_FOURCC(priv->image_formats[i].fourcc)));
GST_DEBUG(" %s", string_of_FOURCC(priv->image_formats[i].fourcc));
/* VA subpicture formats */
priv->num_subpicture_formats = vaMaxNumSubpictureFormats(priv->display);
......@@ -144,9 +146,9 @@ gst_vaapi_display_create(GstVaapiDisplay *display)
if (!vaapi_check_status(status, "vaQuerySubpictureFormats()"))
return FALSE;
D(bug("%d subpicture formats\n", priv->num_subpicture_formats));
GST_DEBUG("%d subpicture formats", priv->num_subpicture_formats);
for (i = 0; i < priv->num_subpicture_formats; i++)
D(bug(" %s\n", string_of_FOURCC(priv->subpicture_formats[i].fourcc)));
GST_DEBUG(" %s", string_of_FOURCC(priv->subpicture_formats[i].fourcc));
return TRUE;
}
......@@ -202,6 +204,8 @@ gst_vaapi_display_class_init(GstVaapiDisplayClass *klass)
{
GObjectClass * const object_class = G_OBJECT_CLASS(klass);
GST_DEBUG_CATEGORY_INIT(gst_debug_vaapi, "vaapi", 0, "VA-API helper");
g_type_class_add_private(klass, sizeof(GstVaapiDisplayPrivate));
object_class->finalize = gst_vaapi_display_finalize;
......@@ -254,15 +258,12 @@ gst_vaapi_display_set_display(GstVaapiDisplay *display, VADisplay va_display)
{
GstVaapiDisplayPrivate * const priv = display->priv;
g_return_if_fail(GST_VAAPI_IS_DISPLAY(display));
if (priv->display)
gst_vaapi_display_destroy(display);
if (va_display) {
priv->display = va_display;
if (!gst_vaapi_display_create(display)) {
printf("FAIL\n");
gst_vaapi_display_destroy(display);
return;
}
......
......@@ -179,8 +179,6 @@ gst_vaapi_image_constructed(GObject *object)
GstVaapiImage * const image = GST_VAAPI_IMAGE(object);
GObjectClass *parent_class;
D(bug("gst_vaapi_image_constructed()\n"));
gst_vaapi_image_create(image);
parent_class = G_OBJECT_CLASS(gst_vaapi_image_parent_class);
......@@ -251,8 +249,6 @@ gst_vaapi_image_init(GstVaapiImage *image)
{
GstVaapiImagePrivate *priv = GST_VAAPI_IMAGE_GET_PRIVATE(image);
D(bug("gst_vaapi_image_init()\n"));
image->priv = priv;
priv->display = NULL;
priv->image_data = NULL;
......@@ -273,8 +269,11 @@ gst_vaapi_image_new(
GstVaapiImageFormat format
)
{
D(bug("gst_vaapi_image_new(): size %ux%u, format 0x%x\n",
width, height, format));
g_return_val_if_fail(GST_VAAPI_IS_DISPLAY(display), NULL);
g_return_val_if_fail(width > 0, NULL);
g_return_val_if_fail(height > 0, NULL);
GST_DEBUG("size %ux%u, format 0x%x", width, height, format);
return g_object_new(GST_VAAPI_TYPE_IMAGE,
"display", display,
......
......@@ -188,8 +188,6 @@ gst_vaapi_subpicture_init(GstVaapiSubpicture *subpicture)
{
GstVaapiSubpicturePrivate *priv = GST_VAAPI_SUBPICTURE_GET_PRIVATE(subpicture);
D(bug("gst_vaapi_subpicture_init()\n"));
subpicture->priv = priv;
priv->subpicture_id = VA_INVALID_ID;
priv->image = NULL;
......@@ -198,8 +196,9 @@ gst_vaapi_subpicture_init(GstVaapiSubpicture *subpicture)
GstVaapiSubpicture *
gst_vaapi_subpicture_new(GstVaapiImage *image)
{
D(bug("gst_vaapi_subpicture_new(): image 0x%08x\n",
gst_vaapi_image_get_id(image)));
g_return_val_if_fail(GST_VAAPI_IS_IMAGE(image), NULL);
GST_DEBUG("image 0x%08x", gst_vaapi_image_get_id(image));
return g_object_new(GST_VAAPI_TYPE_SUBPICTURE,
"image", image,
......
......@@ -235,8 +235,6 @@ gst_vaapi_surface_init(GstVaapiSurface *surface)
{
GstVaapiSurfacePrivate *priv = GST_VAAPI_SURFACE_GET_PRIVATE(surface);
D(bug("gst_vaapi_surface_init()\n"));
surface->priv = priv;
priv->display = NULL;
priv->surface_id = VA_INVALID_SURFACE;
......@@ -251,8 +249,7 @@ gst_vaapi_surface_new(GstVaapiDisplay *display,
guint height,
guint format)
{
D(bug("gst_vaapi_surface_new(): size %ux%u, format 0x%x\n",
width, height, format));
GST_DEBUG("size %ux%u, format 0x%x", width, height, format);
return g_object_new(GST_VAAPI_TYPE_SURFACE,
"display", display,
......
......@@ -30,4 +30,7 @@
#endif
#define bug vaapi_dprintf
GST_DEBUG_CATEGORY_EXTERN(gst_debug_vaapi);
#define GST_CAT_DEFAULT gst_debug_vaapi
#endif /* VAAPI_DEBUG_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment