GstVaapiContext *context;
GstVaapiSurface *surface;
GstClockTime timestamp;
+ GstClockTime duration;
guint is_interlaced : 1;
guint tff : 1;
};
PROP_CONTEXT,
PROP_SURFACE,
PROP_TIMESTAMP,
+ PROP_DURATION,
PROP_INTERLACED,
PROP_TFF
};
case PROP_TIMESTAMP:
gst_vaapi_surface_proxy_set_timestamp(proxy, g_value_get_uint64(value));
break;
+ case PROP_DURATION:
+ gst_vaapi_surface_proxy_set_duration(proxy, g_value_get_uint64(value));
+ break;
case PROP_INTERLACED:
gst_vaapi_surface_proxy_set_interlaced(proxy, g_value_get_boolean(value));
break;
case PROP_TIMESTAMP:
g_value_set_uint64(value, gst_vaapi_surface_proxy_get_timestamp(proxy));
break;
+ case PROP_DURATION:
+ g_value_set_uint64(value, gst_vaapi_surface_proxy_get_duration(proxy));
+ break;
case PROP_INTERLACED:
g_value_set_boolean(value, gst_vaapi_surface_proxy_get_interlaced(proxy));
break;
g_object_class_install_property
(object_class,
+ PROP_DURATION,
+ g_param_spec_uint64("duration",
+ "Duration",
+ "The amount of time the surface is to be presented",
+ 0, G_MAXUINT64, GST_CLOCK_TIME_NONE,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property
+ (object_class,
PROP_INTERLACED,
g_param_spec_boolean("interlaced",
"Interlaced",
priv->context = NULL;
priv->surface = NULL;
priv->timestamp = GST_CLOCK_TIME_NONE;
+ priv->duration = GST_CLOCK_TIME_NONE;
priv->is_interlaced = FALSE;
priv->tff = FALSE;
}
}
/**
+ * gst_vaapi_surface_proxy_get_duration:
+ * @proxy: a #GstVaapiSurfaceProxy
+ *
+ * Returns the presentation duration of the #GstVaapiSurface held by @proxy.
+ *
+ * Return value: the presentation duration of the surface, or
+ * %GST_CLOCK_TIME_NONE is none was set
+ */
+GstClockTime
+gst_vaapi_surface_proxy_get_duration(GstVaapiSurfaceProxy *proxy)
+{
+ g_return_val_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy),
+ GST_CLOCK_TIME_NONE);
+
+ return proxy->priv->duration;
+}
+
+/**
+ * gst_vaapi_surface_proxy_set_duration:
+ * @proxy: a #GstVaapiSurfaceProxy
+ * @duration: the presentation duration of this surface as a #GstClockTime
+ *
+ * Sets the presentation duration of the @proxy surface to @duration.
+ */
+void
+gst_vaapi_surface_proxy_set_duration(
+ GstVaapiSurfaceProxy *proxy,
+ GstClockTime duration
+)
+{
+ g_return_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy));
+
+ proxy->priv->duration = duration;
+}
+
+/**
* gst_vaapi_surface_proxy_get_interlaced:
* @proxy: a #GstVaapiSurfaceProxy
*
gst_vaapi_surface_proxy_get_timestamp(surface)
/**
+ * GST_VAAPI_SURFACE_PROXY_DURATION:
+ * @surface: a #GstVaapiSurfaceProxy
+ *
+ * Macro that evaluates to the amount of time the @surface should be
+ * displayed, or %GST_CLOCK_TIME_NONE if none was set.
+ */
+#define GST_VAAPI_SURFACE_PROXY_DURATION(surface) \
+ gst_vaapi_surface_proxy_get_duration(surface)
+
+/**
* GST_VAAPI_SURFACE_PROXY_INTERLACED:
* @surface: a #GstVaapiSurfaceProxy
*
GstClockTime timestamp
);
+GstClockTime
+gst_vaapi_surface_proxy_get_duration(GstVaapiSurfaceProxy *proxy);
+
+void
+gst_vaapi_surface_proxy_set_duration(
+ GstVaapiSurfaceProxy *proxy,
+ GstClockTime duration
+);
+
gboolean
gst_vaapi_surface_proxy_get_interlaced(GstVaapiSurfaceProxy *proxy);