2010-04-23 16:00:50 +00:00
|
|
|
/*
|
|
|
|
* gstvaapisurfaceproxy.c - VA surface proxy
|
|
|
|
*
|
2012-01-16 09:41:10 +00:00
|
|
|
* Copyright (C) 2010-2011 Splitted-Desktop Systems
|
2012-01-16 10:03:51 +00:00
|
|
|
* Copyright (C) 2011-2012 Intel Corporation
|
2010-04-23 16:00:50 +00:00
|
|
|
*
|
2011-06-14 11:51:41 +00:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2.1
|
|
|
|
* of the License, or (at your option) any later version.
|
2010-04-23 16:00:50 +00:00
|
|
|
*
|
2011-06-14 11:51:41 +00:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
2010-04-23 16:00:50 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2011-06-14 11:51:41 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2010-04-23 16:00:50 +00:00
|
|
|
*
|
2011-06-14 11:51:41 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free
|
|
|
|
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301 USA
|
2010-04-23 16:00:50 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* SECTION:gstvaapisurfaceproxy
|
|
|
|
* @short_description: VA surface proxy
|
|
|
|
*/
|
|
|
|
|
2012-01-30 17:12:59 +00:00
|
|
|
#include "sysdeps.h"
|
2010-04-23 16:00:50 +00:00
|
|
|
#include "gstvaapisurfaceproxy.h"
|
2012-01-05 15:59:57 +00:00
|
|
|
#include "gstvaapiobject_priv.h"
|
2012-12-03 12:46:28 +00:00
|
|
|
#include "gstvaapiminiobject.h"
|
2010-04-23 16:00:50 +00:00
|
|
|
|
|
|
|
#define DEBUG 1
|
|
|
|
#include "gstvaapidebug.h"
|
|
|
|
|
2012-12-03 12:46:28 +00:00
|
|
|
#define GST_VAAPI_SURFACE_PROXY(obj) \
|
|
|
|
((GstVaapiSurfaceProxy *)(obj))
|
2010-04-23 16:00:50 +00:00
|
|
|
|
2012-12-03 12:46:28 +00:00
|
|
|
#define GST_VAAPI_IS_SURFACE_PROXY(obj) \
|
|
|
|
(GST_VAAPI_SURFACE_PROXY(obj) != NULL)
|
|
|
|
|
|
|
|
struct _GstVaapiSurfaceProxy {
|
|
|
|
/*< private >*/
|
|
|
|
GstVaapiMiniObject parent_instance;
|
2010-04-29 12:52:27 +00:00
|
|
|
|
|
|
|
GstVaapiContext *context;
|
|
|
|
GstVaapiSurface *surface;
|
|
|
|
GstClockTime timestamp;
|
2012-09-11 08:59:10 +00:00
|
|
|
GstClockTime duration;
|
2012-03-28 13:16:17 +00:00
|
|
|
guint is_interlaced : 1;
|
|
|
|
guint tff : 1;
|
2010-04-29 12:52:27 +00:00
|
|
|
};
|
|
|
|
|
2010-04-23 16:00:50 +00:00
|
|
|
static void
|
2012-12-03 12:46:28 +00:00
|
|
|
gst_vaapi_surface_proxy_finalize(GstVaapiSurfaceProxy *proxy)
|
2010-04-23 16:00:50 +00:00
|
|
|
{
|
2012-01-05 15:44:44 +00:00
|
|
|
gst_vaapi_surface_proxy_set_surface(proxy, NULL);
|
|
|
|
gst_vaapi_surface_proxy_set_context(proxy, NULL);
|
2010-04-23 16:00:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-12-03 12:46:28 +00:00
|
|
|
gst_vaapi_surface_proxy_init(GstVaapiSurfaceProxy *proxy)
|
|
|
|
{
|
|
|
|
proxy->timestamp = GST_CLOCK_TIME_NONE;
|
|
|
|
proxy->duration = GST_CLOCK_TIME_NONE;
|
2010-04-23 16:00:50 +00:00
|
|
|
|
2012-12-03 12:46:28 +00:00
|
|
|
proxy->is_interlaced = FALSE;
|
|
|
|
proxy->tff = FALSE;
|
2010-04-23 16:00:50 +00:00
|
|
|
}
|
|
|
|
|
2012-12-03 12:46:28 +00:00
|
|
|
static inline const GstVaapiMiniObjectClass *
|
|
|
|
gst_vaapi_surface_proxy_class(void)
|
2010-04-23 16:00:50 +00:00
|
|
|
{
|
2012-12-03 12:46:28 +00:00
|
|
|
static const GstVaapiMiniObjectClass GstVaapiSurfaceProxyClass = {
|
|
|
|
sizeof(GstVaapiSurfaceProxy),
|
|
|
|
(GDestroyNotify)gst_vaapi_surface_proxy_finalize
|
|
|
|
};
|
|
|
|
return &GstVaapiSurfaceProxyClass;
|
2010-04-23 16:00:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_vaapi_surface_proxy_new:
|
|
|
|
* @context: a #GstVaapiContext
|
|
|
|
* @surface: a #GstVaapiSurface
|
|
|
|
*
|
|
|
|
* Creates a new #GstVaapiSurfaceProxy with the specified context and
|
|
|
|
* surface.
|
|
|
|
*
|
|
|
|
* Return value: the newly allocated #GstVaapiSurfaceProxy object
|
|
|
|
*/
|
|
|
|
GstVaapiSurfaceProxy *
|
|
|
|
gst_vaapi_surface_proxy_new(GstVaapiContext *context, GstVaapiSurface *surface)
|
|
|
|
{
|
2012-12-03 12:46:28 +00:00
|
|
|
GstVaapiMiniObject *object;
|
|
|
|
GstVaapiSurfaceProxy *proxy;
|
|
|
|
|
2010-04-23 16:00:50 +00:00
|
|
|
g_return_val_if_fail(GST_VAAPI_IS_CONTEXT(context), NULL);
|
|
|
|
g_return_val_if_fail(GST_VAAPI_IS_SURFACE(surface), NULL);
|
|
|
|
|
2012-12-03 12:46:28 +00:00
|
|
|
object = gst_vaapi_mini_object_new(gst_vaapi_surface_proxy_class());
|
|
|
|
if (!object)
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_vaapi_surface_proxy_ref:
|
|
|
|
* @proxy: a #GstVaapiSurfaceProxy
|
|
|
|
*
|
|
|
|
* Atomically increases the reference count of the given @proxy by one.
|
|
|
|
*
|
|
|
|
* Returns: The same @proxy argument
|
|
|
|
*/
|
|
|
|
GstVaapiSurfaceProxy *
|
|
|
|
gst_vaapi_surface_proxy_ref(GstVaapiSurfaceProxy *proxy)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy), NULL);
|
|
|
|
|
|
|
|
return GST_VAAPI_SURFACE_PROXY(gst_vaapi_mini_object_ref(
|
|
|
|
GST_VAAPI_MINI_OBJECT(proxy)));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_vaapi_surface_proxy_unref:
|
|
|
|
* @proxy: a #GstVaapiSurfaceProxy
|
|
|
|
*
|
|
|
|
* Atomically decreases the reference count of the @proxy by one. If
|
|
|
|
* the reference count reaches zero, the object will be free'd.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_vaapi_surface_proxy_unref(GstVaapiSurfaceProxy *proxy)
|
|
|
|
{
|
|
|
|
g_return_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy));
|
|
|
|
|
|
|
|
gst_vaapi_mini_object_unref(GST_VAAPI_MINI_OBJECT(proxy));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_vaapi_surface_proxy_replace:
|
|
|
|
* @old_proxy_ptr: a pointer to a #GstVaapiSurfaceProxy
|
|
|
|
* @new_proxy: a #GstVaapiSurfaceProxy
|
|
|
|
*
|
|
|
|
* Atomically replaces the proxy object held in @old_proxy_ptr with
|
|
|
|
* @new_proxy. This means that @old_proxy_ptr shall reference a valid
|
|
|
|
* object. However, @new_proxy can be NULL.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_vaapi_surface_proxy_replace(GstVaapiSurfaceProxy **old_proxy_ptr,
|
|
|
|
GstVaapiSurfaceProxy *new_proxy)
|
|
|
|
{
|
|
|
|
g_return_if_fail(old_proxy_ptr != NULL);
|
|
|
|
|
|
|
|
gst_vaapi_mini_object_replace((GstVaapiMiniObject **)old_proxy_ptr,
|
|
|
|
GST_VAAPI_MINI_OBJECT(new_proxy));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_vaapi_surface_proxy_get_user_data:
|
|
|
|
* @proxy: a #GstVaapiSurfaceProxy
|
|
|
|
*
|
|
|
|
* Gets user-provided data set on the object via a previous call to
|
|
|
|
* gst_vaapi_surface_proxy_set_user_data().
|
|
|
|
*
|
|
|
|
* Returns: (transfer none): The previously set user_data
|
|
|
|
*/
|
|
|
|
gpointer
|
|
|
|
gst_vaapi_surface_proxy_get_user_data(GstVaapiSurfaceProxy *proxy)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy), NULL);
|
|
|
|
|
|
|
|
return gst_vaapi_mini_object_get_user_data(GST_VAAPI_MINI_OBJECT(proxy));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_vaapi_surface_proxy_set_user_data:
|
|
|
|
* @proxy: a #GstVaapiSurfaceProxy
|
|
|
|
* @user_data: user-provided data
|
|
|
|
* @destroy_notify: (closure user_data): a #GDestroyNotify
|
|
|
|
*
|
|
|
|
* Sets @user_data on the object and the #GDestroyNotify that will be
|
|
|
|
* called when the data is freed.
|
|
|
|
*
|
|
|
|
* If some @user_data was previously set, then the former @destroy_notify
|
|
|
|
* function will be called before the @user_data is replaced.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_vaapi_surface_proxy_set_user_data(GstVaapiSurfaceProxy *proxy,
|
|
|
|
gpointer user_data, GDestroyNotify destroy_notify)
|
|
|
|
{
|
|
|
|
g_return_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy));
|
|
|
|
|
|
|
|
gst_vaapi_mini_object_set_user_data(GST_VAAPI_MINI_OBJECT(proxy),
|
|
|
|
user_data, destroy_notify);
|
2010-04-23 16:00:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_vaapi_surface_proxy_get_context:
|
|
|
|
* @proxy: a #GstVaapiSurfaceProxy
|
|
|
|
*
|
|
|
|
* Returns the #GstVaapiContext stored in the @proxy.
|
|
|
|
*
|
|
|
|
* Return value: the #GstVaapiContext
|
|
|
|
*/
|
|
|
|
GstVaapiContext *
|
|
|
|
gst_vaapi_surface_proxy_get_context(GstVaapiSurfaceProxy *proxy)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy), NULL);
|
|
|
|
|
2012-12-03 12:46:28 +00:00
|
|
|
return proxy->context;
|
2010-04-23 16:00:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_vaapi_surface_proxy_set_context:
|
|
|
|
* @proxy: a #GstVaapiSurfaceProxy
|
|
|
|
* @context: the new #GstVaapiContext to be stored in @proxy
|
|
|
|
*
|
|
|
|
* Stores a new @context into the @proxy. The proxy releases the
|
|
|
|
* previous reference, if any, and then holds a reference to the new
|
|
|
|
* @context.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_vaapi_surface_proxy_set_context(
|
|
|
|
GstVaapiSurfaceProxy *proxy,
|
|
|
|
GstVaapiContext *context
|
|
|
|
)
|
|
|
|
{
|
|
|
|
g_return_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy));
|
|
|
|
|
2012-12-03 12:46:28 +00:00
|
|
|
g_clear_object(&proxy->context);
|
2010-04-23 16:00:50 +00:00
|
|
|
|
|
|
|
if (context)
|
2012-12-03 12:46:28 +00:00
|
|
|
proxy->context = g_object_ref(context);
|
2010-04-23 16:00:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_vaapi_surface_proxy_get_surface:
|
|
|
|
* @proxy: a #GstVaapiSurfaceProxy
|
|
|
|
*
|
|
|
|
* Returns the #GstVaapiSurface stored in the @proxy.
|
|
|
|
*
|
|
|
|
* Return value: the #GstVaapiSurface
|
|
|
|
*/
|
|
|
|
GstVaapiSurface *
|
|
|
|
gst_vaapi_surface_proxy_get_surface(GstVaapiSurfaceProxy *proxy)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy), NULL);
|
|
|
|
|
2012-12-03 12:46:28 +00:00
|
|
|
return proxy->surface;
|
2010-04-23 16:00:50 +00:00
|
|
|
}
|
|
|
|
|
2012-01-05 15:59:57 +00:00
|
|
|
/**
|
|
|
|
* gst_vaapi_surface_proxy_get_surface_id:
|
|
|
|
* @proxy: a #GstVaapiSurfaceProxy
|
|
|
|
*
|
|
|
|
* Returns the VA surface ID stored in the @proxy.
|
|
|
|
*
|
|
|
|
* Return value: the #GstVaapiID
|
|
|
|
*/
|
|
|
|
GstVaapiID
|
|
|
|
gst_vaapi_surface_proxy_get_surface_id(GstVaapiSurfaceProxy *proxy)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy), GST_VAAPI_ID_NONE);
|
2012-12-03 12:46:28 +00:00
|
|
|
g_return_val_if_fail(proxy->surface != NULL, GST_VAAPI_ID_NONE);
|
2012-01-05 15:59:57 +00:00
|
|
|
|
2012-12-03 12:46:28 +00:00
|
|
|
return GST_VAAPI_OBJECT_ID(proxy->surface);
|
2012-01-05 15:59:57 +00:00
|
|
|
}
|
|
|
|
|
2010-04-23 16:00:50 +00:00
|
|
|
/**
|
|
|
|
* gst_vaapi_surface_proxy_set_surface:
|
|
|
|
* @proxy: a #GstVaapiSurfaceProxy
|
|
|
|
* @surface: the new #GstVaapiSurface to be stored in @proxy
|
|
|
|
*
|
|
|
|
* Stores a new @surface into the @proxy. The proxy releases the
|
|
|
|
* previous reference, if any, and then holds a reference to the new
|
|
|
|
* @surface.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_vaapi_surface_proxy_set_surface(
|
|
|
|
GstVaapiSurfaceProxy *proxy,
|
|
|
|
GstVaapiSurface *surface
|
|
|
|
)
|
|
|
|
{
|
|
|
|
g_return_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy));
|
|
|
|
|
2012-12-03 12:46:28 +00:00
|
|
|
if (proxy->surface) {
|
|
|
|
if (proxy->context)
|
|
|
|
gst_vaapi_context_put_surface(proxy->context, proxy->surface);
|
|
|
|
g_object_unref(proxy->surface);
|
|
|
|
proxy->surface = NULL;
|
2010-04-23 16:00:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (surface)
|
2012-12-03 12:46:28 +00:00
|
|
|
proxy->surface = g_object_ref(surface);
|
2010-04-29 12:52:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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)
|
|
|
|
{
|
2012-12-03 12:46:28 +00:00
|
|
|
g_return_val_if_fail(GST_VAAPI_IS_SURFACE_PROXY(proxy),
|
|
|
|
GST_CLOCK_TIME_NONE);
|
2010-04-29 12:52:27 +00:00
|
|
|
|
2012-12-03 12:46:28 +00:00
|
|
|
return proxy->timestamp;
|
2010-04-29 12:52:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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));
|
|
|
|
|
2012-12-03 12:46:28 +00:00
|
|
|
proxy->timestamp = timestamp;
|
2010-04-23 16:00:50 +00:00
|
|
|
}
|
2012-02-07 14:54:15 +00:00
|
|
|
|
2012-09-11 08:59:10 +00:00
|
|
|
/**
|
|
|
|
* 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);
|
|
|
|
|
2012-12-03 12:46:28 +00:00
|
|
|
return proxy->duration;
|
2012-09-11 08:59:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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));
|
|
|
|
|
2012-12-03 12:46:28 +00:00
|
|
|
proxy->duration = duration;
|
2012-09-11 08:59:10 +00:00
|
|
|
}
|
|
|
|
|
2012-03-28 13:16:17 +00:00
|
|
|
/**
|
|
|
|
* 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);
|
|
|
|
|
2012-12-03 12:46:28 +00:00
|
|
|
return proxy->is_interlaced;
|
2012-03-28 13:16:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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));
|
|
|
|
|
2012-12-03 12:46:28 +00:00
|
|
|
proxy->is_interlaced = b;
|
2012-03-28 13:16:17 +00:00
|
|
|
}
|
|
|
|
|
2012-02-07 14:54:15 +00:00
|
|
|
/**
|
|
|
|
* 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);
|
|
|
|
|
2012-12-03 12:46:28 +00:00
|
|
|
return proxy->is_interlaced && proxy->tff;
|
2012-02-07 14:54:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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));
|
|
|
|
|
2012-12-03 12:46:28 +00:00
|
|
|
proxy->tff = tff;
|
2012-02-07 14:54:15 +00:00
|
|
|
}
|