plugins: add support for GstImplementsInterface.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Thu, 19 Jul 2012 09:43:03 +0000 (11:43 +0200)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Thu, 19 Jul 2012 09:45:19 +0000 (11:45 +0200)
gst/vaapi/gstvaapidecode.c
gst/vaapi/gstvaapidownload.c
gst/vaapi/gstvaapipostproc.c
gst/vaapi/gstvaapiupload.c

index ea34345..540d15f 100644 (file)
@@ -105,6 +105,9 @@ static GstStaticPadTemplate gst_vaapidecode_src_factory =
         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);
 
 #define GstVideoContextClass GstVideoContextInterface
@@ -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)
 {
index eb0c7c5..63f2afe 100644 (file)
@@ -109,6 +109,9 @@ struct _GstVaapiDownloadClass {
 };
 
 static void
+gst_vaapidownload_implements_iface_init(GstImplementsInterfaceClass *iface);
+
+static void
 gst_video_context_interface_init(GstVideoContextInterface *iface);
 
 #define GstVideoContextClass GstVideoContextInterface
@@ -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)
 {
index 8d38a35..feb5558 100644 (file)
@@ -75,6 +75,9 @@ static GstStaticPadTemplate gst_vaapipostproc_src_factory =
         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);
 
 #define GstVideoContextClass GstVideoContextInterface
@@ -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)
 {
index d96f366..0762279 100644 (file)
@@ -85,6 +85,9 @@ static GstStaticPadTemplate gst_vaapiupload_src_factory =
         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);
 
 #define GstVideoContextClass GstVideoContextInterface
@@ -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)
 {