mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
surfaceproxy: add TFF property.
Add TFF (top-field-first) property to GstVaapiSurfaceProxy. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
This commit is contained in:
parent
c94390be71
commit
8593fb619c
3 changed files with 67 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue