2009-11-22 21:28:18 +00:00
|
|
|
/*
|
|
|
|
* GStreamer
|
|
|
|
* Copyright (C) 2009 Carl-Anton Ingmarsson <ca.ingmarsson@gmail.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2010-03-17 19:59:08 +00:00
|
|
|
#include "gstvdputils.h"
|
2009-11-22 21:28:18 +00:00
|
|
|
#include "gstvdpvideobuffer.h"
|
2010-07-30 09:27:27 +00:00
|
|
|
#include "gstvdpoutputbufferpool.h"
|
2009-11-22 21:28:18 +00:00
|
|
|
|
|
|
|
#include "gstvdpoutputsrcpad.h"
|
|
|
|
|
|
|
|
GST_DEBUG_CATEGORY_STATIC (gst_vdp_output_src_pad_debug);
|
|
|
|
#define GST_CAT_DEFAULT gst_vdp_output_src_pad_debug
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
2010-07-28 19:39:12 +00:00
|
|
|
PROP_DEVICE
|
2009-11-22 21:28:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef enum _GstVdpOutputSrcPadFormat GstVdpOutputSrcPadFormat;
|
|
|
|
|
|
|
|
enum _GstVdpOutputSrcPadFormat
|
|
|
|
{
|
|
|
|
GST_VDP_OUTPUT_SRC_PAD_FORMAT_RGB,
|
|
|
|
GST_VDP_OUTPUT_SRC_PAD_FORMAT_VDPAU
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _GstVdpOutputSrcPad
|
|
|
|
{
|
|
|
|
GstPad pad;
|
|
|
|
|
|
|
|
GstCaps *caps;
|
|
|
|
|
2010-07-30 09:27:27 +00:00
|
|
|
GstCaps *output_caps;
|
2009-11-22 21:28:18 +00:00
|
|
|
GstVdpOutputSrcPadFormat output_format;
|
|
|
|
VdpRGBAFormat rgba_format;
|
|
|
|
gint width, height;
|
|
|
|
|
2010-07-30 09:27:27 +00:00
|
|
|
GstVdpBufferPool *bpool;
|
2010-07-30 12:07:22 +00:00
|
|
|
gboolean lock_caps;
|
2010-07-30 09:27:27 +00:00
|
|
|
|
2009-11-22 21:28:18 +00:00
|
|
|
/* properties */
|
2010-07-28 19:15:46 +00:00
|
|
|
GstVdpDevice *device;
|
2009-11-22 21:28:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GstVdpOutputSrcPadClass
|
|
|
|
{
|
|
|
|
GstPadClass pad_class;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define DEBUG_INIT(bla) \
|
|
|
|
GST_DEBUG_CATEGORY_INIT (gst_vdp_output_src_pad_debug, "vdpoutputsrcpad", 0, "GstVdpOutputSrcPad");
|
|
|
|
|
|
|
|
G_DEFINE_TYPE_WITH_CODE (GstVdpOutputSrcPad, gst_vdp_output_src_pad,
|
|
|
|
GST_TYPE_PAD, DEBUG_INIT ());
|
|
|
|
|
|
|
|
GstFlowReturn
|
|
|
|
gst_vdp_output_src_pad_push (GstVdpOutputSrcPad * vdp_pad,
|
2010-03-17 19:59:08 +00:00
|
|
|
GstVdpOutputBuffer * output_buf, GError ** error)
|
2009-11-22 21:28:18 +00:00
|
|
|
{
|
|
|
|
GstPad *pad;
|
2010-03-17 19:59:08 +00:00
|
|
|
GstBuffer *outbuf;
|
2009-11-22 21:28:18 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (GST_IS_VDP_OUTPUT_SRC_PAD (vdp_pad), GST_FLOW_ERROR);
|
|
|
|
g_return_val_if_fail (GST_IS_VDP_OUTPUT_BUFFER (output_buf), GST_FLOW_ERROR);
|
|
|
|
|
|
|
|
pad = (GstPad *) vdp_pad;
|
|
|
|
|
|
|
|
if (G_UNLIKELY (!GST_PAD_CAPS (pad)))
|
|
|
|
return GST_FLOW_NOT_NEGOTIATED;
|
|
|
|
|
|
|
|
switch (vdp_pad->output_format) {
|
|
|
|
case GST_VDP_OUTPUT_SRC_PAD_FORMAT_RGB:
|
|
|
|
{
|
2010-07-30 12:07:22 +00:00
|
|
|
GstFlowReturn ret;
|
2009-11-22 21:28:18 +00:00
|
|
|
guint size;
|
|
|
|
|
2010-03-17 19:59:08 +00:00
|
|
|
gst_vdp_output_buffer_calculate_size (output_buf, &size);
|
2009-11-22 21:28:18 +00:00
|
|
|
|
2010-07-30 12:07:22 +00:00
|
|
|
vdp_pad->lock_caps = TRUE;
|
|
|
|
ret = gst_pad_alloc_buffer (pad, 0, size, GST_PAD_CAPS (vdp_pad),
|
|
|
|
&outbuf);
|
|
|
|
vdp_pad->lock_caps = FALSE;
|
|
|
|
|
|
|
|
if (ret != GST_FLOW_OK) {
|
|
|
|
gst_buffer_unref (GST_BUFFER_CAST (output_buf));
|
|
|
|
return ret;
|
|
|
|
}
|
2009-11-22 21:28:18 +00:00
|
|
|
|
2010-03-17 19:59:08 +00:00
|
|
|
if (!gst_vdp_output_buffer_download (output_buf, outbuf, error)) {
|
2009-11-22 21:28:18 +00:00
|
|
|
gst_buffer_unref (GST_BUFFER_CAST (output_buf));
|
2010-03-17 19:59:08 +00:00
|
|
|
gst_buffer_unref (outbuf);
|
|
|
|
return GST_FLOW_ERROR;
|
2009-11-22 21:28:18 +00:00
|
|
|
}
|
|
|
|
|
2010-03-17 19:59:08 +00:00
|
|
|
gst_buffer_copy_metadata (outbuf, (const GstBuffer *) output_buf,
|
2009-11-22 21:28:18 +00:00
|
|
|
GST_BUFFER_COPY_FLAGS | GST_BUFFER_COPY_TIMESTAMPS);
|
|
|
|
gst_buffer_unref (GST_BUFFER_CAST (output_buf));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case GST_VDP_OUTPUT_SRC_PAD_FORMAT_VDPAU:
|
|
|
|
{
|
2010-03-17 19:59:08 +00:00
|
|
|
outbuf = GST_BUFFER_CAST (output_buf);
|
2009-11-22 21:28:18 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
g_assert_not_reached ();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2010-03-17 19:59:08 +00:00
|
|
|
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (vdp_pad));
|
2009-11-22 21:28:18 +00:00
|
|
|
|
2010-03-17 19:59:08 +00:00
|
|
|
return gst_pad_push (pad, outbuf);
|
2009-11-22 21:28:18 +00:00
|
|
|
}
|
|
|
|
|
2010-03-17 19:59:08 +00:00
|
|
|
static GstFlowReturn
|
|
|
|
gst_vdp_output_src_pad_create_buffer (GstVdpOutputSrcPad * vdp_pad,
|
|
|
|
GstVdpOutputBuffer ** output_buf, GError ** error)
|
|
|
|
{
|
|
|
|
GstFlowReturn ret;
|
|
|
|
GstBuffer *neg_buf;
|
|
|
|
|
|
|
|
/* negotiate */
|
|
|
|
ret = gst_pad_alloc_buffer_and_set_caps (GST_PAD_CAST (vdp_pad),
|
|
|
|
GST_BUFFER_OFFSET_NONE, 0, GST_PAD_CAPS (vdp_pad), &neg_buf);
|
2010-07-30 09:27:27 +00:00
|
|
|
if (ret == GST_FLOW_OK)
|
2010-03-17 19:59:08 +00:00
|
|
|
gst_buffer_unref (neg_buf);
|
|
|
|
|
2010-07-30 09:27:27 +00:00
|
|
|
*output_buf =
|
|
|
|
(GstVdpOutputBuffer *) gst_vdp_buffer_pool_get_buffer (vdp_pad->bpool,
|
|
|
|
error);
|
2010-03-17 19:59:08 +00:00
|
|
|
if (!*output_buf)
|
2010-07-30 09:27:27 +00:00
|
|
|
return GST_FLOW_ERROR;
|
2010-03-17 19:59:08 +00:00
|
|
|
|
|
|
|
return GST_FLOW_OK;
|
|
|
|
}
|
|
|
|
|
2010-06-26 22:36:25 +00:00
|
|
|
static GstFlowReturn
|
|
|
|
gst_vdp_output_src_pad_alloc_with_caps (GstVdpOutputSrcPad * vdp_pad,
|
|
|
|
GstCaps * caps, GstVdpOutputBuffer ** output_buf, GError ** error)
|
|
|
|
{
|
|
|
|
GstFlowReturn ret;
|
|
|
|
|
2010-07-30 09:27:27 +00:00
|
|
|
ret = gst_pad_alloc_buffer_and_set_caps ((GstPad *) vdp_pad, 0, 0, caps,
|
2010-06-26 22:36:25 +00:00
|
|
|
(GstBuffer **) output_buf);
|
|
|
|
if (ret != GST_FLOW_OK)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
if (!GST_IS_VDP_OUTPUT_BUFFER (*output_buf))
|
|
|
|
goto invalid_buf;
|
|
|
|
|
|
|
|
return GST_FLOW_OK;
|
|
|
|
|
|
|
|
invalid_buf:
|
|
|
|
gst_buffer_unref (GST_BUFFER (*output_buf));
|
|
|
|
g_set_error (error, GST_STREAM_ERROR, GST_STREAM_ERROR_FAILED,
|
|
|
|
"Sink element returned buffer of wrong type");
|
|
|
|
return GST_FLOW_ERROR;
|
|
|
|
}
|
|
|
|
|
2009-11-22 21:28:18 +00:00
|
|
|
GstFlowReturn
|
|
|
|
gst_vdp_output_src_pad_alloc_buffer (GstVdpOutputSrcPad * vdp_pad,
|
2010-03-17 19:59:08 +00:00
|
|
|
GstVdpOutputBuffer ** output_buf, GError ** error)
|
2009-11-22 21:28:18 +00:00
|
|
|
{
|
|
|
|
GstCaps *caps;
|
|
|
|
GstFlowReturn ret;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GST_IS_VDP_OUTPUT_SRC_PAD (vdp_pad), GST_FLOW_ERROR);
|
|
|
|
|
|
|
|
caps = GST_PAD_CAPS (vdp_pad);
|
|
|
|
if (!caps)
|
|
|
|
return GST_FLOW_NOT_NEGOTIATED;
|
|
|
|
|
|
|
|
switch (vdp_pad->output_format) {
|
|
|
|
case GST_VDP_OUTPUT_SRC_PAD_FORMAT_RGB:
|
|
|
|
{
|
2010-03-17 19:59:08 +00:00
|
|
|
ret = gst_vdp_output_src_pad_create_buffer (vdp_pad, output_buf, error);
|
2009-11-22 21:28:18 +00:00
|
|
|
if (ret != GST_FLOW_OK)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case GST_VDP_OUTPUT_SRC_PAD_FORMAT_VDPAU:
|
|
|
|
{
|
2010-06-26 22:36:25 +00:00
|
|
|
ret = gst_vdp_output_src_pad_alloc_with_caps (vdp_pad, caps, output_buf,
|
|
|
|
error);
|
2009-11-22 21:28:18 +00:00
|
|
|
if (ret != GST_FLOW_OK)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
g_assert_not_reached ();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return GST_FLOW_OK;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2010-07-30 12:07:22 +00:00
|
|
|
static gboolean
|
|
|
|
gst_vdp_output_src_pad_acceptcaps (GstPad * pad, GstCaps * caps)
|
|
|
|
{
|
|
|
|
GstVdpOutputSrcPad *vdp_pad = GST_VDP_OUTPUT_SRC_PAD (pad);
|
|
|
|
|
|
|
|
if (!vdp_pad->lock_caps)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
return gst_caps_is_equal_fixed (caps, GST_PAD_CAPS (pad));
|
|
|
|
}
|
|
|
|
|
2010-07-30 09:27:27 +00:00
|
|
|
static gboolean
|
|
|
|
gst_vdp_output_src_pad_setcaps (GstPad * pad, GstCaps * caps)
|
2009-11-22 21:28:18 +00:00
|
|
|
{
|
2010-07-30 09:27:27 +00:00
|
|
|
GstVdpOutputSrcPad *vdp_pad = GST_VDP_OUTPUT_SRC_PAD (pad);
|
2009-11-22 21:28:18 +00:00
|
|
|
const GstStructure *structure;
|
|
|
|
|
2010-07-30 09:27:27 +00:00
|
|
|
structure = gst_caps_get_structure (caps, 0);
|
2009-11-22 21:28:18 +00:00
|
|
|
|
2010-07-30 09:27:27 +00:00
|
|
|
if (!gst_structure_get_int (structure, "width", &vdp_pad->width))
|
|
|
|
return FALSE;
|
|
|
|
if (!gst_structure_get_int (structure, "height", &vdp_pad->height))
|
|
|
|
return FALSE;
|
2010-03-17 19:59:08 +00:00
|
|
|
|
2010-07-30 09:27:27 +00:00
|
|
|
if (gst_structure_has_name (structure, "video/x-raw-rgb")) {
|
|
|
|
if (!gst_vdp_caps_to_rgba_format (caps, &vdp_pad->rgba_format))
|
|
|
|
return FALSE;
|
2010-03-17 19:59:08 +00:00
|
|
|
|
2010-07-30 09:27:27 +00:00
|
|
|
/* create buffer pool if we dont't have one */
|
|
|
|
if (!vdp_pad->bpool)
|
|
|
|
vdp_pad->bpool = gst_vdp_output_buffer_pool_new (vdp_pad->device);
|
2010-03-17 19:59:08 +00:00
|
|
|
|
2010-07-30 09:27:27 +00:00
|
|
|
if (vdp_pad->output_caps)
|
|
|
|
gst_caps_unref (vdp_pad->output_caps);
|
2009-11-22 21:28:18 +00:00
|
|
|
|
2010-07-30 09:27:27 +00:00
|
|
|
vdp_pad->output_caps = gst_caps_new_simple ("video/x-vdpau-output",
|
|
|
|
"rgba-format", G_TYPE_INT, vdp_pad->rgba_format,
|
|
|
|
"width", G_TYPE_INT, vdp_pad->width, "height", G_TYPE_INT,
|
|
|
|
vdp_pad->height, NULL);
|
|
|
|
gst_vdp_buffer_pool_set_caps (vdp_pad->bpool, vdp_pad->output_caps);
|
2009-11-22 21:28:18 +00:00
|
|
|
|
|
|
|
vdp_pad->output_format = GST_VDP_OUTPUT_SRC_PAD_FORMAT_RGB;
|
|
|
|
} else if (gst_structure_has_name (structure, "video/x-vdpau-output")) {
|
|
|
|
if (!gst_structure_get_int (structure, "rgba-format",
|
|
|
|
(gint *) & vdp_pad->rgba_format))
|
|
|
|
return FALSE;
|
|
|
|
|
2010-07-30 09:27:27 +00:00
|
|
|
/* don't need the buffer pool */
|
|
|
|
if (vdp_pad->bpool) {
|
|
|
|
gst_object_unref (vdp_pad->bpool);
|
|
|
|
vdp_pad->bpool = NULL;
|
|
|
|
}
|
|
|
|
|
2009-11-22 21:28:18 +00:00
|
|
|
vdp_pad->output_format = GST_VDP_OUTPUT_SRC_PAD_FORMAT_VDPAU;
|
|
|
|
} else
|
|
|
|
return FALSE;
|
|
|
|
|
2010-07-30 09:27:27 +00:00
|
|
|
return TRUE;
|
2009-11-22 21:28:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GstCaps *
|
|
|
|
gst_vdp_output_src_pad_getcaps (GstPad * pad)
|
|
|
|
{
|
|
|
|
GstVdpOutputSrcPad *vdp_pad = (GstVdpOutputSrcPad *) pad;
|
|
|
|
|
2010-07-28 19:39:12 +00:00
|
|
|
const GstCaps *templ_caps;
|
|
|
|
|
2009-11-22 21:28:18 +00:00
|
|
|
if (vdp_pad->caps)
|
|
|
|
return gst_caps_ref (vdp_pad->caps);
|
|
|
|
|
2010-07-28 19:39:12 +00:00
|
|
|
else if ((templ_caps = gst_pad_get_pad_template_caps (pad)))
|
|
|
|
return gst_caps_copy (templ_caps);
|
|
|
|
|
|
|
|
return NULL;
|
2009-11-22 21:28:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_vdp_output_src_pad_activate_push (GstPad * pad, gboolean active)
|
|
|
|
{
|
|
|
|
GstVdpOutputSrcPad *vdp_pad = GST_VDP_OUTPUT_SRC_PAD (pad);
|
|
|
|
|
|
|
|
if (!active) {
|
|
|
|
if (vdp_pad->caps)
|
|
|
|
gst_caps_unref (vdp_pad->caps);
|
|
|
|
vdp_pad->caps = NULL;
|
2010-07-28 19:15:46 +00:00
|
|
|
|
2010-07-30 09:27:27 +00:00
|
|
|
if (vdp_pad->output_caps)
|
|
|
|
gst_caps_unref (vdp_pad->output_caps);
|
|
|
|
vdp_pad->output_caps = NULL;
|
|
|
|
|
|
|
|
if (vdp_pad->bpool)
|
|
|
|
g_object_unref (vdp_pad->bpool);
|
|
|
|
vdp_pad->bpool = NULL;
|
|
|
|
|
2010-07-28 19:15:46 +00:00
|
|
|
if (vdp_pad->device)
|
2010-07-30 09:27:27 +00:00
|
|
|
g_object_unref (vdp_pad->device);
|
2010-07-28 19:15:46 +00:00
|
|
|
vdp_pad->device = NULL;
|
2009-11-22 21:28:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
GstVdpOutputSrcPad *
|
2010-07-28 19:39:12 +00:00
|
|
|
gst_vdp_output_src_pad_new (GstPadTemplate * templ, const gchar * name)
|
2009-11-22 21:28:18 +00:00
|
|
|
{
|
2010-07-28 19:39:12 +00:00
|
|
|
return g_object_new (GST_TYPE_VDP_OUTPUT_SRC_PAD, "name", name,
|
|
|
|
"template", templ, "direction", GST_PAD_SRC, NULL);
|
2009-11-22 21:28:18 +00:00
|
|
|
}
|
|
|
|
|
2010-07-28 19:15:46 +00:00
|
|
|
static void
|
|
|
|
gst_vdp_output_src_pad_update_caps (GstVdpOutputSrcPad * vdp_pad)
|
|
|
|
{
|
2010-07-28 19:39:12 +00:00
|
|
|
GstCaps *caps;
|
|
|
|
const GstCaps *templ_caps;
|
2010-07-28 19:15:46 +00:00
|
|
|
|
|
|
|
if (vdp_pad->caps)
|
|
|
|
gst_caps_unref (vdp_pad->caps);
|
|
|
|
|
2010-07-28 19:39:12 +00:00
|
|
|
caps = gst_vdp_output_buffer_get_allowed_caps (vdp_pad->device);
|
2010-07-28 19:15:46 +00:00
|
|
|
|
2010-07-28 19:39:12 +00:00
|
|
|
if ((templ_caps = gst_pad_get_pad_template_caps (GST_PAD (vdp_pad)))) {
|
|
|
|
vdp_pad->caps = gst_caps_intersect (caps, templ_caps);
|
|
|
|
gst_caps_unref (caps);
|
|
|
|
} else
|
|
|
|
vdp_pad->caps = caps;
|
2010-07-28 19:15:46 +00:00
|
|
|
}
|
|
|
|
|
2009-11-22 21:28:18 +00:00
|
|
|
static void
|
|
|
|
gst_vdp_output_src_pad_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstVdpOutputSrcPad *vdp_pad = (GstVdpOutputSrcPad *) object;
|
|
|
|
|
|
|
|
switch (prop_id) {
|
2010-07-28 19:15:46 +00:00
|
|
|
case PROP_DEVICE:
|
|
|
|
g_value_set_object (value, vdp_pad->device);
|
2009-11-22 21:28:18 +00:00
|
|
|
break;
|
2010-07-28 19:15:46 +00:00
|
|
|
|
2009-11-22 21:28:18 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_vdp_output_src_pad_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstVdpOutputSrcPad *vdp_pad = (GstVdpOutputSrcPad *) object;
|
|
|
|
|
|
|
|
switch (prop_id) {
|
2010-07-28 19:15:46 +00:00
|
|
|
case PROP_DEVICE:
|
|
|
|
if (vdp_pad->device)
|
|
|
|
g_object_unref (vdp_pad->device);
|
|
|
|
vdp_pad->device = g_value_dup_object (value);
|
|
|
|
gst_vdp_output_src_pad_update_caps (vdp_pad);
|
2009-11-22 21:28:18 +00:00
|
|
|
break;
|
2010-07-28 19:15:46 +00:00
|
|
|
|
2009-11-22 21:28:18 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_vdp_output_src_pad_init (GstVdpOutputSrcPad * vdp_pad)
|
|
|
|
{
|
|
|
|
GstPad *pad = GST_PAD (vdp_pad);
|
|
|
|
|
|
|
|
vdp_pad->caps = NULL;
|
2010-07-30 09:27:27 +00:00
|
|
|
vdp_pad->output_caps = NULL;
|
|
|
|
vdp_pad->bpool = NULL;
|
2010-07-28 19:15:46 +00:00
|
|
|
vdp_pad->device = NULL;
|
2009-11-22 21:28:18 +00:00
|
|
|
|
2010-07-30 12:07:22 +00:00
|
|
|
vdp_pad->lock_caps = FALSE;
|
|
|
|
|
2009-11-22 21:28:18 +00:00
|
|
|
gst_pad_set_getcaps_function (pad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_vdp_output_src_pad_getcaps));
|
2010-07-30 09:27:27 +00:00
|
|
|
gst_pad_set_setcaps_function (pad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_vdp_output_src_pad_setcaps));
|
2010-07-30 12:07:22 +00:00
|
|
|
gst_pad_set_acceptcaps_function (pad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_vdp_output_src_pad_acceptcaps));
|
|
|
|
|
2009-11-22 21:28:18 +00:00
|
|
|
gst_pad_set_activatepush_function (pad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_vdp_output_src_pad_activate_push));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_vdp_output_src_pad_class_init (GstVdpOutputSrcPadClass * klass)
|
|
|
|
{
|
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
|
|
|
|
|
|
|
object_class->get_property = gst_vdp_output_src_pad_get_property;
|
|
|
|
object_class->set_property = gst_vdp_output_src_pad_set_property;
|
|
|
|
|
2010-07-28 19:15:46 +00:00
|
|
|
/**
|
|
|
|
* GstVdpVideoSrcPad:device:
|
|
|
|
*
|
|
|
|
* The #GstVdpDevice this pool is bound to.
|
|
|
|
*/
|
|
|
|
g_object_class_install_property
|
|
|
|
(object_class,
|
|
|
|
PROP_DEVICE,
|
|
|
|
g_param_spec_object ("device",
|
|
|
|
"Device",
|
|
|
|
"The GstVdpDevice the pad should use",
|
|
|
|
GST_TYPE_VDP_DEVICE, G_PARAM_READWRITE));
|
2009-11-22 21:28:18 +00:00
|
|
|
}
|