GstVaapiContext *context;
GstVaapiSurface *surface;
- GstClockTime timestamp;
- GstClockTime duration;
- guint is_interlaced : 1;
- guint tff : 1;
};
static void
gst_vaapi_surface_proxy_set_context(proxy, NULL);
}
-static void
-gst_vaapi_surface_proxy_init(GstVaapiSurfaceProxy *proxy)
-{
- proxy->timestamp = GST_CLOCK_TIME_NONE;
- proxy->duration = GST_CLOCK_TIME_NONE;
-
- proxy->is_interlaced = FALSE;
- proxy->tff = FALSE;
-}
-
static inline const GstVaapiMiniObjectClass *
gst_vaapi_surface_proxy_class(void)
{
return NULL;
proxy = GST_VAAPI_SURFACE_PROXY(object);
- gst_vaapi_surface_proxy_init(proxy);
gst_vaapi_surface_proxy_set_context(proxy, context);
gst_vaapi_surface_proxy_set_surface(proxy, surface);
return proxy;
if (surface)
proxy->surface = g_object_ref(surface);
}
-
-/**
- * gst_vaapi_surface_proxy_get_timestamp:
- * @proxy: a #GstVaapiSurfaceProxy
- *
- * Returns the presentation timestamp of the #GstVaapiSurface held by @proxy.
- *
- * Return value: the presentation timestamp of the surface, or
- * %GST_CLOCK_TIME_NONE is none was set
- */
-GstClockTime
-gst_vaapi_surface_proxy_get_timestamp(GstVaapiSurfaceProxy *proxy)
-{
- g_return_val_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy),
- GST_CLOCK_TIME_NONE);
-
- return proxy->timestamp;
-}
-
-/**
- * gst_vaapi_surface_proxy_set_timestamp:
- * @proxy: a #GstVaapiSurfaceProxy
- * @timestamp: the new presentation timestamp as a #GstClockTime
- *
- * Sets the presentation timestamp of the @proxy surface to @timestamp.
- */
-void
-gst_vaapi_surface_proxy_set_timestamp(
- GstVaapiSurfaceProxy *proxy,
- GstClockTime timestamp
-)
-{
- g_return_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy));
-
- proxy->timestamp = timestamp;
-}
-
-/**
- * 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->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->duration = duration;
-}
-
-/**
- * gst_vaapi_surface_proxy_get_interlaced:
- * @proxy: a #GstVaapiSurfaceProxy
- *
- * Returns whether the @proxy holds an interlaced #GstVaapiSurface or not.
- *
- * Return value: %TRUE if the underlying surface is interlaced, %FALSE
- * otherwise.
- */
-gboolean
-gst_vaapi_surface_proxy_get_interlaced(GstVaapiSurfaceProxy *proxy)
-{
- g_return_val_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy), FALSE);
-
- return proxy->is_interlaced;
-}
-
-/**
- * gst_vaapi_surface_proxy_set_interlaced:
- * @proxy: a #GstVaapiSurfaceProxy
- * @b: a boolean value
- *
- * Sets whether the underlying #GstVaapiSurface for @proxy is interlaced
- * or not.
- */
-void
-gst_vaapi_surface_proxy_set_interlaced(GstVaapiSurfaceProxy *proxy, gboolean b)
-{
- g_return_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy));
-
- proxy->is_interlaced = b;
-}
-
-/**
- * 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->is_interlaced && proxy->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->tff = tff;
-}
#define GST_VAAPI_SURFACE_PROXY_SURFACE(surface) \
gst_vaapi_surface_proxy_get_surface(surface)
-/**
- * GST_VAAPI_SURFACE_PROXY_TIMESTAMP:
- * @surface: a #GstVaapiSurfaceProxy
- *
- * Macro that evaluates to the @surface timestamp, or
- * %GST_CLOCK_TIME_NONE if none was set.
- */
-#define GST_VAAPI_SURFACE_PROXY_TIMESTAMP(surface) \
- 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
- *
- * Macro that evaluates to %TRUE if the @surface is interlaced.
- */
-#define GST_VAAPI_SURFACE_PROXY_INTERLACED(surface) \
- gst_vaapi_surface_proxy_get_interlaced(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)
-
GstVaapiSurfaceProxy *
gst_vaapi_surface_proxy_new(GstVaapiContext *context, GstVaapiSurface *surface);
GstVaapiSurface *surface
);
-GstClockTime
-gst_vaapi_surface_proxy_get_timestamp(GstVaapiSurfaceProxy *proxy);
-
-void
-gst_vaapi_surface_proxy_set_timestamp(
- GstVaapiSurfaceProxy *proxy,
- 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);
-
-void
-gst_vaapi_surface_proxy_set_interlaced(GstVaapiSurfaceProxy *proxy, gboolean b);
-
-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 */