mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
decoder: drop obsolete functions.
Drop the following functions that are now obsolete: - gst_vaapi_context_get_surface() - gst_vaapi_context_put_surface() - gst_vaapi_context_find_surface_by_id() - gst_vaapi_surface_proxy_new() - gst_vaapi_surface_proxy_get_context() - gst_vaapi_surface_proxy_set_context() - gst_vaapi_surface_proxy_set_surface() This is an API change.
This commit is contained in:
parent
6e82da1e93
commit
e65726de8d
5 changed files with 7 additions and 204 deletions
|
@ -402,10 +402,7 @@ gst_vaapi_context_set_profile
|
|||
gst_vaapi_context_get_entrypoint
|
||||
gst_vaapi_context_get_size
|
||||
gst_vaapi_context_get_surface_proxy
|
||||
gst_vaapi_context_get_surface
|
||||
gst_vaapi_context_get_surface_count
|
||||
gst_vaapi_context_put_surface
|
||||
gst_vaapi_context_find_surface_by_id
|
||||
gst_vaapi_context_apply_composition
|
||||
<SUBSECTION Standard>
|
||||
GST_VAAPI_CONTEXT
|
||||
|
@ -524,16 +521,12 @@ GST_VAAPI_DECODER_VC1_GET_CLASS
|
|||
<SECTION>
|
||||
<FILE>gstvaapisurfaceproxy</FILE>
|
||||
<TITLE>GstVaapiSurfaceProxy</TITLE>
|
||||
gst_vaapi_surface_proxy_get_context
|
||||
gst_vaapi_surface_proxy_get_surface
|
||||
gst_vaapi_surface_proxy_get_surface_id
|
||||
gst_vaapi_surface_proxy_get_user_data
|
||||
gst_vaapi_surface_proxy_new
|
||||
gst_vaapi_surface_proxy_new_from_pool
|
||||
gst_vaapi_surface_proxy_ref
|
||||
gst_vaapi_surface_proxy_replace
|
||||
gst_vaapi_surface_proxy_set_context
|
||||
gst_vaapi_surface_proxy_set_surface
|
||||
gst_vaapi_surface_proxy_set_user_data
|
||||
gst_vaapi_surface_proxy_unref
|
||||
<SUBSECTION Standard>
|
||||
|
|
|
@ -1024,25 +1024,6 @@ gst_vaapi_context_get_surface_proxy(GstVaapiContext *context)
|
|||
GST_VAAPI_SURFACE_POOL(context->priv->surfaces_pool));
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vaapi_context_get_surface:
|
||||
* @context: a #GstVaapiContext
|
||||
*
|
||||
* Acquires a free surface. The returned surface but be released with
|
||||
* gst_vaapi_context_put_surface(). This function returns %NULL if
|
||||
* there is no free surface available in the pool. The surfaces are
|
||||
* pre-allocated during context creation though.
|
||||
*
|
||||
* Return value: a free surface, or %NULL if none is available
|
||||
*/
|
||||
GstVaapiSurface *
|
||||
gst_vaapi_context_get_surface(GstVaapiContext *context)
|
||||
{
|
||||
g_return_val_if_fail(GST_VAAPI_IS_CONTEXT(context), NULL);
|
||||
|
||||
return gst_vaapi_video_pool_get_object(context->priv->surfaces_pool);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vaapi_context_get_surface_count:
|
||||
* @context: a #GstVaapiContext
|
||||
|
@ -1059,52 +1040,6 @@ gst_vaapi_context_get_surface_count(GstVaapiContext *context)
|
|||
return gst_vaapi_video_pool_get_size(context->priv->surfaces_pool);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vaapi_context_put_surface:
|
||||
* @context: a #GstVaapiContext
|
||||
* @surface: the #GstVaapiSurface to release
|
||||
*
|
||||
* Releases a surface acquired by gst_vaapi_context_get_surface().
|
||||
*/
|
||||
void
|
||||
gst_vaapi_context_put_surface(GstVaapiContext *context, GstVaapiSurface *surface)
|
||||
{
|
||||
g_return_if_fail(GST_VAAPI_IS_CONTEXT(context));
|
||||
g_return_if_fail(GST_VAAPI_IS_SURFACE(surface));
|
||||
|
||||
gst_vaapi_video_pool_put_object(context->priv->surfaces_pool, surface);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vaapi_context_find_surface_by_id:
|
||||
* @context: a #GstVaapiContext
|
||||
* @id: the VA surface id to find
|
||||
*
|
||||
* Finds VA surface by @id in the list of surfaces attached to the @context.
|
||||
*
|
||||
* Return value: the matching #GstVaapiSurface object, or %NULL if
|
||||
* none was found
|
||||
*/
|
||||
GstVaapiSurface *
|
||||
gst_vaapi_context_find_surface_by_id(GstVaapiContext *context, GstVaapiID id)
|
||||
{
|
||||
GstVaapiContextPrivate *priv;
|
||||
GstVaapiSurface *surface;
|
||||
guint i;
|
||||
|
||||
g_return_val_if_fail(GST_VAAPI_IS_CONTEXT(context), NULL);
|
||||
|
||||
priv = context->priv;
|
||||
g_return_val_if_fail(priv->surfaces, NULL);
|
||||
|
||||
for (i = 0; i < priv->surfaces->len; i++) {
|
||||
surface = g_ptr_array_index(priv->surfaces, i);
|
||||
if (GST_VAAPI_OBJECT_ID(surface) == id)
|
||||
return surface;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vaapi_context_apply_composition:
|
||||
* @context: a #GstVaapiContext
|
||||
|
|
|
@ -146,18 +146,9 @@ gst_vaapi_context_get_size(
|
|||
GstVaapiSurfaceProxy *
|
||||
gst_vaapi_context_get_surface_proxy(GstVaapiContext *context);
|
||||
|
||||
GstVaapiSurface *
|
||||
gst_vaapi_context_get_surface(GstVaapiContext *context);
|
||||
|
||||
guint
|
||||
gst_vaapi_context_get_surface_count(GstVaapiContext *context);
|
||||
|
||||
void
|
||||
gst_vaapi_context_put_surface(GstVaapiContext *context, GstVaapiSurface *surface);
|
||||
|
||||
GstVaapiSurface *
|
||||
gst_vaapi_context_find_surface_by_id(GstVaapiContext *context, GstVaapiID id);
|
||||
|
||||
gboolean
|
||||
gst_vaapi_context_apply_composition(
|
||||
GstVaapiContext *context,
|
||||
|
|
|
@ -44,15 +44,19 @@ struct _GstVaapiSurfaceProxy {
|
|||
GstVaapiMiniObject parent_instance;
|
||||
|
||||
GstVaapiVideoPool *pool;
|
||||
GstVaapiContext *context;
|
||||
GstVaapiSurface *surface;
|
||||
};
|
||||
|
||||
static void
|
||||
gst_vaapi_surface_proxy_finalize(GstVaapiSurfaceProxy *proxy)
|
||||
{
|
||||
gst_vaapi_surface_proxy_set_surface(proxy, NULL);
|
||||
gst_vaapi_surface_proxy_set_context(proxy, NULL);
|
||||
if (proxy->surface) {
|
||||
if (proxy->pool)
|
||||
gst_vaapi_video_pool_put_object(proxy->pool, proxy->surface);
|
||||
g_object_unref(proxy->surface);
|
||||
proxy->surface = NULL;
|
||||
}
|
||||
g_clear_object(&proxy->pool);
|
||||
}
|
||||
|
||||
static inline const GstVaapiMiniObjectClass *
|
||||
|
@ -65,35 +69,6 @@ gst_vaapi_surface_proxy_class(void)
|
|||
return &GstVaapiSurfaceProxyClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
{
|
||||
GstVaapiSurfaceProxy *proxy;
|
||||
|
||||
g_return_val_if_fail(GST_VAAPI_IS_CONTEXT(context), NULL);
|
||||
g_return_val_if_fail(GST_VAAPI_IS_SURFACE(surface), NULL);
|
||||
|
||||
proxy = (GstVaapiSurfaceProxy *)
|
||||
gst_vaapi_mini_object_new(gst_vaapi_surface_proxy_class());
|
||||
if (!proxy)
|
||||
return NULL;
|
||||
|
||||
proxy->pool = NULL;
|
||||
proxy->context = g_object_ref(context);
|
||||
proxy->surface = g_object_ref(surface);
|
||||
return proxy;
|
||||
}
|
||||
|
||||
GstVaapiSurfaceProxy *
|
||||
gst_vaapi_surface_proxy_new_from_pool(GstVaapiSurfacePool *pool)
|
||||
{
|
||||
|
@ -107,7 +82,6 @@ gst_vaapi_surface_proxy_new_from_pool(GstVaapiSurfacePool *pool)
|
|||
return NULL;
|
||||
|
||||
proxy->pool = g_object_ref(pool);
|
||||
proxy->context = NULL;
|
||||
proxy->surface = gst_vaapi_video_pool_get_object(proxy->pool);
|
||||
if (!proxy->surface)
|
||||
goto error;
|
||||
|
@ -209,45 +183,6 @@ gst_vaapi_surface_proxy_set_user_data(GstVaapiSurfaceProxy *proxy,
|
|||
user_data, destroy_notify);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
return proxy->context;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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));
|
||||
|
||||
g_clear_object(&proxy->context);
|
||||
|
||||
if (context)
|
||||
proxy->context = g_object_ref(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vaapi_surface_proxy_get_surface:
|
||||
* @proxy: a #GstVaapiSurfaceProxy
|
||||
|
@ -280,35 +215,3 @@ gst_vaapi_surface_proxy_get_surface_id(GstVaapiSurfaceProxy *proxy)
|
|||
|
||||
return GST_VAAPI_OBJECT_ID(proxy->surface);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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));
|
||||
|
||||
if (proxy->surface) {
|
||||
if (proxy->pool)
|
||||
gst_vaapi_video_pool_put_object(proxy->pool, proxy->surface);
|
||||
else if (proxy->context)
|
||||
gst_vaapi_context_put_surface(proxy->context, proxy->surface);
|
||||
g_object_unref(proxy->surface);
|
||||
proxy->surface = NULL;
|
||||
}
|
||||
|
||||
g_clear_object(&proxy->pool);
|
||||
|
||||
if (surface)
|
||||
proxy->surface = g_object_ref(surface);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#ifndef GST_VAAPI_SURFACE_PROXY_H
|
||||
#define GST_VAAPI_SURFACE_PROXY_H
|
||||
|
||||
#include <gst/vaapi/gstvaapicontext.h>
|
||||
#include <gst/vaapi/gstvaapisurface.h>
|
||||
#include <gst/vaapi/gstvaapisurfacepool.h>
|
||||
|
||||
|
@ -38,9 +37,6 @@ G_BEGIN_DECLS
|
|||
#define GST_VAAPI_SURFACE_PROXY_SURFACE(surface) \
|
||||
gst_vaapi_surface_proxy_get_surface(surface)
|
||||
|
||||
GstVaapiSurfaceProxy *
|
||||
gst_vaapi_surface_proxy_new(GstVaapiContext *context, GstVaapiSurface *surface);
|
||||
|
||||
GstVaapiSurfaceProxy *
|
||||
gst_vaapi_surface_proxy_new_from_pool(GstVaapiSurfacePool *pool);
|
||||
|
||||
|
@ -61,27 +57,12 @@ void
|
|||
gst_vaapi_surface_proxy_set_user_data(GstVaapiSurfaceProxy *proxy,
|
||||
gpointer user_data, GDestroyNotify destroy_notify);
|
||||
|
||||
GstVaapiContext *
|
||||
gst_vaapi_surface_proxy_get_context(GstVaapiSurfaceProxy *proxy);
|
||||
|
||||
void
|
||||
gst_vaapi_surface_proxy_set_context(
|
||||
GstVaapiSurfaceProxy *proxy,
|
||||
GstVaapiContext *context
|
||||
);
|
||||
|
||||
GstVaapiSurface *
|
||||
gst_vaapi_surface_proxy_get_surface(GstVaapiSurfaceProxy *proxy);
|
||||
|
||||
GstVaapiID
|
||||
gst_vaapi_surface_proxy_get_surface_id(GstVaapiSurfaceProxy *proxy);
|
||||
|
||||
void
|
||||
gst_vaapi_surface_proxy_set_surface(
|
||||
GstVaapiSurfaceProxy *proxy,
|
||||
GstVaapiSurface *surface
|
||||
);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* GST_VAAPI_SURFACE_PROXY_H */
|
||||
|
|
Loading…
Reference in a new issue