plugins: add support for GstImplementsInterface.

This commit is contained in:
Gwenole Beauchesne 2012-07-19 11:43:03 +02:00
parent 2594aadb0e
commit 50e40a4c87
4 changed files with 88 additions and 24 deletions

View file

@ -104,6 +104,9 @@ static GstStaticPadTemplate gst_vaapidecode_src_factory =
GST_PAD_ALWAYS,
GST_STATIC_CAPS(gst_vaapidecode_src_caps_str));
static void
gst_vaapidecode_implements_iface_init(GstImplementsInterfaceClass *iface);
static void
gst_video_context_interface_init(GstVideoContextInterface *iface);
@ -112,6 +115,8 @@ G_DEFINE_TYPE_WITH_CODE(
GstVaapiDecode,
gst_vaapidecode,
GST_TYPE_ELEMENT,
G_IMPLEMENT_INTERFACE(GST_TYPE_IMPLEMENTS_INTERFACE,
gst_vaapidecode_implements_iface_init);
G_IMPLEMENT_INTERFACE(GST_TYPE_VIDEO_CONTEXT,
gst_video_context_interface_init));
@ -404,6 +409,23 @@ gst_vaapidecode_reset(GstVaapiDecode *decode, GstCaps *caps)
return gst_vaapidecode_create(decode, caps);
}
/* GstImplementsInterface interface */
static gboolean
gst_vaapidecode_implements_interface_supported(
GstImplementsInterface *iface,
GType type
)
{
return (type == GST_TYPE_VIDEO_CONTEXT);
}
static void
gst_vaapidecode_implements_iface_init(GstImplementsInterfaceClass *iface)
{
iface->supported = gst_vaapidecode_implements_interface_supported;
}
/* GstVideoContext interface */
static void
@ -414,12 +436,6 @@ gst_vaapidecode_set_video_context(GstVideoContext *context, const gchar *type,
gst_vaapi_set_display (type, value, &decode->display);
}
static gboolean
gst_video_context_supported (GstVaapiDecode *decode, GType iface_type)
{
return (iface_type == GST_TYPE_VIDEO_CONTEXT);
}
static void
gst_video_context_interface_init(GstVideoContextInterface *iface)
{

View file

@ -108,6 +108,9 @@ struct _GstVaapiDownloadClass {
GstBaseTransformClass parent_class;
};
static void
gst_vaapidownload_implements_iface_init(GstImplementsInterfaceClass *iface);
static void
gst_video_context_interface_init(GstVideoContextInterface *iface);
@ -116,6 +119,8 @@ G_DEFINE_TYPE_WITH_CODE(
GstVaapiDownload,
gst_vaapidownload,
GST_TYPE_BASE_TRANSFORM,
G_IMPLEMENT_INTERFACE(GST_TYPE_IMPLEMENTS_INTERFACE,
gst_vaapidownload_implements_iface_init);
G_IMPLEMENT_INTERFACE(GST_TYPE_VIDEO_CONTEXT,
gst_video_context_interface_init));
@ -165,6 +170,23 @@ gst_vaapidownload_query(
GstQuery *query
);
/* GstImplementsInterface interface */
static gboolean
gst_vaapidownload_implements_interface_supported(
GstImplementsInterface *iface,
GType type
)
{
return (type == GST_TYPE_VIDEO_CONTEXT);
}
static void
gst_vaapidownload_implements_iface_init(GstImplementsInterfaceClass *iface)
{
iface->supported = gst_vaapidownload_implements_interface_supported;
}
/* GstVideoContext interface */
static void
@ -175,12 +197,6 @@ gst_vaapidownload_set_video_context(GstVideoContext *context, const gchar *type,
gst_vaapi_set_display (type, value, &download->display);
}
static gboolean
gst_video_context_supported (GstVaapiDownload *download, GType iface_type)
{
return (iface_type == GST_TYPE_VIDEO_CONTEXT);
}
static void
gst_video_context_interface_init(GstVideoContextInterface *iface)
{

View file

@ -74,6 +74,9 @@ static GstStaticPadTemplate gst_vaapipostproc_src_factory =
GST_PAD_ALWAYS,
GST_STATIC_CAPS(gst_vaapipostproc_src_caps_str));
static void
gst_vaapipostproc_implements_iface_init(GstImplementsInterfaceClass *iface);
static void
gst_video_context_interface_init(GstVideoContextInterface *iface);
@ -82,6 +85,8 @@ G_DEFINE_TYPE_WITH_CODE(
GstVaapiPostproc,
gst_vaapipostproc,
GST_TYPE_ELEMENT,
G_IMPLEMENT_INTERFACE(GST_TYPE_IMPLEMENTS_INTERFACE,
gst_vaapipostproc_implements_iface_init);
G_IMPLEMENT_INTERFACE(GST_TYPE_VIDEO_CONTEXT,
gst_video_context_interface_init));
@ -156,6 +161,23 @@ get_vaapipostproc_from_pad(GstPad *pad)
return GST_VAAPIPOSTPROC(gst_pad_get_parent_element(pad));
}
/* GstImplementsInterface interface */
static gboolean
gst_vaapipostproc_implements_interface_supported(
GstImplementsInterface *iface,
GType type
)
{
return (type == GST_TYPE_VIDEO_CONTEXT);
}
static void
gst_vaapipostproc_implements_iface_init(GstImplementsInterfaceClass *iface)
{
iface->supported = gst_vaapipostproc_implements_interface_supported;
}
/* GstVideoContext interface */
static void
@ -170,12 +192,6 @@ gst_vaapipostproc_set_video_context(
gst_vaapi_set_display(type, value, &postproc->display);
}
static gboolean
gst_video_context_supported(GstVaapiPostproc *postproc, GType iface_type)
{
return (iface_type == GST_TYPE_VIDEO_CONTEXT);
}
static void
gst_video_context_interface_init(GstVideoContextInterface *iface)
{

View file

@ -84,6 +84,9 @@ static GstStaticPadTemplate gst_vaapiupload_src_factory =
GST_PAD_ALWAYS,
GST_STATIC_CAPS(gst_vaapiupload_vaapi_caps_str));
static void
gst_vaapiupload_implements_iface_init(GstImplementsInterfaceClass *iface);
static void
gst_video_context_interface_init(GstVideoContextInterface *iface);
@ -92,6 +95,8 @@ G_DEFINE_TYPE_WITH_CODE(
GstVaapiUpload,
gst_vaapiupload,
GST_TYPE_BASE_TRANSFORM,
G_IMPLEMENT_INTERFACE(GST_TYPE_IMPLEMENTS_INTERFACE,
gst_vaapiupload_implements_iface_init);
G_IMPLEMENT_INTERFACE(GST_TYPE_VIDEO_CONTEXT,
gst_video_context_interface_init));
@ -167,6 +172,23 @@ gst_vaapiupload_query(
GstQuery *query
);
/* GstImplementsInterface interface */
static gboolean
gst_vaapiupload_implements_interface_supported(
GstImplementsInterface *iface,
GType type
)
{
return (type == GST_TYPE_VIDEO_CONTEXT);
}
static void
gst_vaapiupload_implements_iface_init(GstImplementsInterfaceClass *iface)
{
iface->supported = gst_vaapiupload_implements_interface_supported;
}
/* GstVideoContext interface */
static void
@ -177,12 +199,6 @@ gst_vaapiupload_set_video_context(GstVideoContext *context, const gchar *type,
gst_vaapi_set_display (type, value, &upload->display);
}
static gboolean
gst_video_context_supported (GstVaapiUpload *upload, GType iface_type)
{
return (iface_type == GST_TYPE_VIDEO_CONTEXT);
}
static void
gst_video_context_interface_init(GstVideoContextInterface *iface)
{