summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolger Kaelberer <holger.k@elberer.de>2012-02-07 15:54:15 +0100
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-03-19 18:43:06 +0100
commit8593fb619c970143ddcacc798f4b5a5384c569db (patch)
tree97e7e8db60bcb2926a77ef251ca77b7cd5107d2a
parentc94390be710c5ab5dd8ed4348450777f88278dfb (diff)
surfaceproxy: add TFF property.
Add TFF (top-field-first) property to GstVaapiSurfaceProxy. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
-rw-r--r--docs/reference/libs/libs-sections.txt2
-rw-r--r--gst-libs/gst/vaapi/gstvaapisurfaceproxy.c51
-rw-r--r--gst-libs/gst/vaapi/gstvaapisurfaceproxy.h15
3 files changed, 67 insertions, 1 deletions
diff --git a/docs/reference/libs/libs-sections.txt b/docs/reference/libs/libs-sections.txt
index b4fd5130..29fa8c05 100644
--- a/docs/reference/libs/libs-sections.txt
+++ b/docs/reference/libs/libs-sections.txt
@@ -499,6 +499,8 @@ gst_vaapi_surface_proxy_get_surface_id
gst_vaapi_surface_proxy_set_surface
gst_vaapi_surface_proxy_get_timestamp
gst_vaapi_surface_proxy_set_timestamp
+gst_vaapi_surface_proxy_get_tff
+gst_vaapi_surface_proxy_set_tff
<SUBSECTION Standard>
GST_VAAPI_SURFACE_PROXY
GST_VAAPI_IS_SURFACE_PROXY
diff --git a/gst-libs/gst/vaapi/gstvaapisurfaceproxy.c b/gst-libs/gst/vaapi/gstvaapisurfaceproxy.c
index 404583c3..9b01ac34 100644
--- a/gst-libs/gst/vaapi/gstvaapisurfaceproxy.c
+++ b/gst-libs/gst/vaapi/gstvaapisurfaceproxy.c
@@ -43,6 +43,7 @@ struct _GstVaapiSurfaceProxyPrivate {
GstVaapiContext *context;
GstVaapiSurface *surface;
GstClockTime timestamp;
+ gboolean tff;
};
enum {
@@ -50,7 +51,8 @@ enum {
PROP_CONTEXT,
PROP_SURFACE,
- PROP_TIMESTAMP
+ PROP_TIMESTAMP,
+ PROP_TFF
};
static void
@@ -84,6 +86,9 @@ gst_vaapi_surface_proxy_set_property(
case PROP_TIMESTAMP:
gst_vaapi_surface_proxy_set_timestamp(proxy, g_value_get_uint64(value));
break;
+ case PROP_TFF:
+ gst_vaapi_surface_proxy_set_tff(proxy, g_value_get_boolean(value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
@@ -110,6 +115,9 @@ gst_vaapi_surface_proxy_get_property(
case PROP_TIMESTAMP:
g_value_set_uint64(value, gst_vaapi_surface_proxy_get_timestamp(proxy));
break;
+ case PROP_TFF:
+ g_value_set_boolean(value, gst_vaapi_surface_proxy_get_tff(proxy));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
@@ -151,6 +159,15 @@ gst_vaapi_surface_proxy_class_init(GstVaapiSurfaceProxyClass *klass)
"The presentation time of the surface",
0, G_MAXUINT64, GST_CLOCK_TIME_NONE,
G_PARAM_READWRITE));
+
+ g_object_class_install_property
+ (object_class,
+ PROP_TFF,
+ g_param_spec_boolean("tff",
+ "Top-Field-First",
+ "Flag indicating for interlaced surfaces whether Top Field is First",
+ FALSE,
+ G_PARAM_READWRITE));
}
static void
@@ -163,6 +180,7 @@ gst_vaapi_surface_proxy_init(GstVaapiSurfaceProxy *proxy)
priv->context = NULL;
priv->surface = NULL;
priv->timestamp = GST_CLOCK_TIME_NONE;
+ priv->tff = FALSE;
}
/**
@@ -332,3 +350,34 @@ gst_vaapi_surface_proxy_set_timestamp(
proxy->priv->timestamp = timestamp;
}
+
+/**
+ * gst_vaapi_surface_proxy_get_tff:
+ * @proxy: a #GstVaapiSurfaceProxy
+ *
+ * Returns the TFF flag of the #GstVaapiSurface held by @proxy.
+ *
+ * Return value: the TFF flag of the surface
+ */
+gboolean
+gst_vaapi_surface_proxy_get_tff(GstVaapiSurfaceProxy *proxy)
+{
+ g_return_val_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy), FALSE);
+
+ return proxy->priv->tff;
+}
+
+/**
+ * gst_vaapi_surface_proxy_set_tff:
+ * @proxy: a #GstVaapiSurfaceProxy
+ * @tff: the new value of the TFF flag
+ *
+ * Sets the TFF flag of the @proxy surface to @tff.
+ */
+void
+gst_vaapi_surface_proxy_set_tff(GstVaapiSurfaceProxy *proxy, gboolean tff)
+{
+ g_return_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy));
+
+ proxy->priv->tff = tff;
+}
diff --git a/gst-libs/gst/vaapi/gstvaapisurfaceproxy.h b/gst-libs/gst/vaapi/gstvaapisurfaceproxy.h
index 6cc4dea9..a6d96308 100644
--- a/gst-libs/gst/vaapi/gstvaapisurfaceproxy.h
+++ b/gst-libs/gst/vaapi/gstvaapisurfaceproxy.h
@@ -72,6 +72,15 @@ G_BEGIN_DECLS
#define GST_VAAPI_SURFACE_PROXY_TIMESTAMP(surface) \
gst_vaapi_surface_proxy_get_timestamp(surface)
+/**
+ * GST_VAAPI_SURFACE_PROXY_TFF:
+ * @surface: a #GstVaapiSurfaceProxy
+ *
+ * Macro that evaluates to the tff flag of the @surface
+ */
+#define GST_VAAPI_SURFACE_PROXY_TFF(surface) \
+ gst_vaapi_surface_proxy_get_tff(surface)
+
typedef struct _GstVaapiSurfaceProxy GstVaapiSurfaceProxy;
typedef struct _GstVaapiSurfaceProxyPrivate GstVaapiSurfaceProxyPrivate;
typedef struct _GstVaapiSurfaceProxyClass GstVaapiSurfaceProxyClass;
@@ -134,6 +143,12 @@ gst_vaapi_surface_proxy_set_timestamp(
GstClockTime timestamp
);
+gboolean
+gst_vaapi_surface_proxy_get_tff(GstVaapiSurfaceProxy *proxy);
+
+void
+gst_vaapi_surface_proxy_set_tff(GstVaapiSurfaceProxy *proxy, gboolean tff);
+
G_END_DECLS
#endif /* GST_VAAPI_SURFACE_PROXY_H */