vaapipostproc: use GST_*_OBJECT when possible

Since we can have several vaapipostproc operating in a pipeline, it is useful
to know which one is generating the logging message.

https://bugzilla.gnome.org/show_bug.cgi?id=773497
This commit is contained in:
Víctor Manuel Jáquez Leal 2016-10-25 14:32:44 +02:00
parent c258343243
commit bb0abb1a18

View file

@ -344,7 +344,8 @@ should_deinterlace_buffer (GstVaapiPostproc * postproc, GstBuffer * buf)
return TRUE; return TRUE;
break; break;
default: default:
GST_ERROR ("unhandled \"interlace-mode\", disabling deinterlacing"); GST_ERROR_OBJECT (postproc,
"unhandled \"interlace-mode\", disabling deinterlacing");
break; break;
} }
return FALSE; return FALSE;
@ -373,12 +374,12 @@ create_output_buffer (GstVaapiPostproc * postproc)
/* ERRORS */ /* ERRORS */
error_activate_pool: error_activate_pool:
{ {
GST_ERROR ("failed to activate output video buffer pool"); GST_ERROR_OBJECT (postproc, "failed to activate output video buffer pool");
return NULL; return NULL;
} }
error_create_buffer: error_create_buffer:
{ {
GST_ERROR ("failed to create output video buffer"); GST_ERROR_OBJECT (postproc, "failed to create output video buffer");
return NULL; return NULL;
} }
} }
@ -772,42 +773,43 @@ gst_vaapipostproc_process_vpp (GstBaseTransform * trans, GstBuffer * inbuf,
/* ERRORS */ /* ERRORS */
error_invalid_buffer: error_invalid_buffer:
{ {
GST_ERROR ("failed to validate source buffer"); GST_ERROR_OBJECT (postproc, "failed to validate source buffer");
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
error_create_buffer: error_create_buffer:
{ {
GST_ERROR ("failed to create output buffer"); GST_ERROR_OBJECT (postproc, "failed to create output buffer");
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
error_create_meta: error_create_meta:
{ {
GST_ERROR ("failed to create new output buffer meta"); GST_ERROR_OBJECT (postproc, "failed to create new output buffer meta");
gst_buffer_replace (&fieldbuf, NULL); gst_buffer_replace (&fieldbuf, NULL);
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
error_create_proxy: error_create_proxy:
{ {
GST_ERROR ("failed to create surface proxy from pool"); GST_ERROR_OBJECT (postproc, "failed to create surface proxy from pool");
gst_buffer_replace (&fieldbuf, NULL); gst_buffer_replace (&fieldbuf, NULL);
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
error_op_deinterlace: error_op_deinterlace:
{ {
GST_ERROR ("failed to apply deinterlacing filter"); GST_ERROR_OBJECT (postproc, "failed to apply deinterlacing filter");
gst_buffer_replace (&fieldbuf, NULL); gst_buffer_replace (&fieldbuf, NULL);
return GST_FLOW_NOT_SUPPORTED; return GST_FLOW_NOT_SUPPORTED;
} }
error_process_vpp: error_process_vpp:
{ {
GST_ERROR ("failed to apply VPP filters (error %d)", status); GST_ERROR_OBJECT (postproc, "failed to apply VPP filters (error %d)",
status);
gst_buffer_replace (&fieldbuf, NULL); gst_buffer_replace (&fieldbuf, NULL);
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
error_push_buffer: error_push_buffer:
{ {
if (ret != GST_FLOW_FLUSHING) if (ret != GST_FLOW_FLUSHING)
GST_ERROR ("failed to push output buffer to video sink"); GST_ERROR_OBJECT (postproc, "failed to push output buffer to video sink");
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
} }
@ -873,18 +875,18 @@ gst_vaapipostproc_process (GstBaseTransform * trans, GstBuffer * inbuf,
/* ERRORS */ /* ERRORS */
error_invalid_buffer: error_invalid_buffer:
{ {
GST_ERROR ("failed to validate source buffer"); GST_ERROR_OBJECT (postproc, "failed to validate source buffer");
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
error_create_buffer: error_create_buffer:
{ {
GST_ERROR ("failed to create output buffer"); GST_ERROR_OBJECT (postproc, "failed to create output buffer");
return GST_FLOW_EOS; return GST_FLOW_EOS;
} }
error_push_buffer: error_push_buffer:
{ {
if (ret != GST_FLOW_FLUSHING) if (ret != GST_FLOW_FLUSHING)
GST_ERROR ("failed to push output buffer to video sink"); GST_ERROR_OBJECT (postproc, "failed to push output buffer to video sink");
return GST_FLOW_EOS; return GST_FLOW_EOS;
} }
} }
@ -893,6 +895,7 @@ static GstFlowReturn
gst_vaapipostproc_passthrough (GstBaseTransform * trans, GstBuffer * inbuf, gst_vaapipostproc_passthrough (GstBaseTransform * trans, GstBuffer * inbuf,
GstBuffer * outbuf) GstBuffer * outbuf)
{ {
GstVaapiPostproc *const postproc = GST_VAAPIPOSTPROC (trans);
GstVaapiVideoMeta *meta; GstVaapiVideoMeta *meta;
/* No video processing needed, simply copy buffer metadata */ /* No video processing needed, simply copy buffer metadata */
@ -900,14 +903,14 @@ gst_vaapipostproc_passthrough (GstBaseTransform * trans, GstBuffer * inbuf,
if (!meta) if (!meta)
goto error_invalid_buffer; goto error_invalid_buffer;
append_output_buffer_metadata (GST_VAAPIPOSTPROC (trans), outbuf, inbuf, append_output_buffer_metadata (postproc, outbuf, inbuf,
GST_BUFFER_COPY_TIMESTAMPS); GST_BUFFER_COPY_TIMESTAMPS);
return GST_FLOW_OK; return GST_FLOW_OK;
/* ERRORS */ /* ERRORS */
error_invalid_buffer: error_invalid_buffer:
{ {
GST_ERROR ("failed to validate source buffer"); GST_ERROR_OBJECT (postproc, "failed to validate source buffer");
return GST_FLOW_ERROR; return GST_FLOW_ERROR;
} }
} }
@ -1071,7 +1074,7 @@ ensure_allowed_srcpad_caps (GstVaapiPostproc * postproc)
/* Create initial caps from pad template */ /* Create initial caps from pad template */
out_caps = gst_caps_from_string (gst_vaapipostproc_src_caps_str); out_caps = gst_caps_from_string (gst_vaapipostproc_src_caps_str);
if (!out_caps) { if (!out_caps) {
GST_ERROR ("failed to create VA src caps"); GST_ERROR_OBJECT (postproc, "failed to create VA src caps");
return FALSE; return FALSE;
} }
@ -1194,7 +1197,7 @@ gst_vaapipostproc_transform (GstBaseTransform * trans, GstBuffer * inbuf,
ret = gst_vaapipostproc_process_vpp (trans, buf, outbuf); ret = gst_vaapipostproc_process_vpp (trans, buf, outbuf);
if (ret != GST_FLOW_NOT_SUPPORTED) if (ret != GST_FLOW_NOT_SUPPORTED)
goto done; goto done;
GST_WARNING ("unsupported VPP filters. Disabling"); GST_WARNING_OBJECT (postproc, "unsupported VPP filters. Disabling");
} }
/* Only append picture structure meta data (top/bottom field) */ /* Only append picture structure meta data (top/bottom field) */