libs: va: Documentation and annotations.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2196>
This commit is contained in:
Víctor Manuel Jáquez Leal 2021-05-13 10:27:49 +02:00
parent c335f00d62
commit d09aae68a5
4 changed files with 87 additions and 11 deletions

View file

@ -18,6 +18,24 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*/ */
/**
* SECTION:gstvadisplay
* @title: GstVaDisplay
* @short_description: Generic VADisplay wrapper.
* @sources:
* - gstvadisplay.h
*
* It is a generic wrapper for VADisplay. To create new instances
* subclasses are required, depending on the display type to use
* (v.gr. DRM, X11, Wayland, etc.).
*
* The purpose of this class is to be shared among pipelines via
* #GstContext so all the VA processing elements will use the same
* display entry. Application developers can create their own
* subclass, based on their display, and shared it via the synced bus
* message for the application.
*/
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif

View file

@ -60,6 +60,8 @@ typedef enum
* *
* Check whether the display is the implementation of the specified * Check whether the display is the implementation of the specified
* #GstVaImplementation type. * #GstVaImplementation type.
*
* Since: 1.20
*/ */
#define GST_VA_DISPLAY_IS_IMPLEMENTATION(display, impl) \ #define GST_VA_DISPLAY_IS_IMPLEMENTATION(display, impl) \
(gst_va_display_is_implementation (display, G_PASTE (GST_VA_IMPLEMENTATION_, impl))) (gst_va_display_is_implementation (display, G_PASTE (GST_VA_IMPLEMENTATION_, impl)))
@ -73,6 +75,7 @@ typedef enum
/** /**
* GstVaDisplay: * GstVaDisplay:
* @parent: parent #GstObject
* *
* The common VA display object structure. * The common VA display object structure.
* *
@ -80,24 +83,30 @@ typedef enum
*/ */
struct _GstVaDisplay struct _GstVaDisplay
{ {
/*< private > */
GstObject parent; GstObject parent;
}; };
/** /**
* GstVaDisplayClass: * GstVaDisplayClass:
* @parent_class: parent #GstObjectClass
* *
* The common VA display object class structure. * The common VA display object class structure.
* @create_va_display: The function to create the real VA display.
* *
* Since: 1.20 * Since: 1.20
*/ */
struct _GstVaDisplayClass struct _GstVaDisplayClass
{ {
/*< private > */
GstObjectClass parent_class; GstObjectClass parent_class;
/*< public > */ /**
* GstVaDisplayClass::create_va_display:
* @self: a #GstVaDisplay instance
*
* This is called when the subclass has to create the internal
* VADisplay.
*
* Returns: The created VADisplay
*/
gpointer (*create_va_display) (GstVaDisplay * self); gpointer (*create_va_display) (GstVaDisplay * self);
}; };

View file

@ -18,6 +18,16 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*/ */
/**
* SECTION:gstvadisplaydrm
* @title: GstVaDisplayDrm
* @short_description: VADisplay from a DRM device
* @sources:
* - gstvadisplay_drm.h
*
* This is a #GstVaDisplay subclass to instantiate with DRM devices.
*/
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
@ -33,17 +43,29 @@
#include <xf86drm.h> #include <xf86drm.h>
#endif #endif
/**
* GstVaDisplayDrm:
* @parent: parent #GstVaDisplay
*
* Since: 1.20
*/
struct _GstVaDisplayDrm struct _GstVaDisplayDrm
{ {
GstVaDisplay parent; GstVaDisplay parent;
/* <private> */
gchar *path; gchar *path;
gint fd; gint fd;
}; };
/**
* GstVaDisplayDrmClass:
* @parent_class: parent #GstVaDisplayClass
*
* Since: 1.20
*/
struct _GstVaDisplayDrmClass struct _GstVaDisplayDrmClass
{ {
/*< private > */
GstVaDisplayClass parent_class; GstVaDisplayClass parent_class;
}; };
@ -173,9 +195,9 @@ gst_va_display_drm_init (GstVaDisplayDrm * self)
* Creates a new #GstVaDisplay from a DRM device . It will try to open * Creates a new #GstVaDisplay from a DRM device . It will try to open
* and operate the device in @path. * and operate the device in @path.
* *
* Returns: a newly allocated #GstVaDisplay if the specified DRM * Returns: (transfer full): a newly allocated #GstVaDisplay if the
* render device could be opened and initialized; otherwise %NULL * specified DRM render device could be opened and initialized;
* is returned. * otherwise %NULL is returned.
* *
* Since: 1.20 * Since: 1.20
**/ **/

View file

@ -18,20 +18,42 @@
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*/ */
/**
* SECTION:gstvadisplaywrapped
* @title: GstVaDisplayWrapped
* @short_description: User's custom VADisplay
* @sources:
* - gstvadisplay_wrapped.h
*
* This is a #GstVaDisplay instantiaton subclass for custom created
* VADisplay, such as X11 or Wayland, wrapping it.
*/
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#include "gstvadisplay_wrapped.h" #include "gstvadisplay_wrapped.h"
/**
* GstVaDisplayWrapped:
* @parent: parent #GstVaDisplay
*
* Since: 1.20
*/
struct _GstVaDisplayWrapped struct _GstVaDisplayWrapped
{ {
GstVaDisplay parent; GstVaDisplay parent;
}; };
/**
* GstVaDisplayWrappedClass:
* @parent_class: parent #GstVaDisplayClass
*
* Since: 1.20
*/
struct _GstVaDisplayWrappedClass struct _GstVaDisplayWrappedClass
{ {
/*< private > */
GstVaDisplayClass parent_class; GstVaDisplayClass parent_class;
}; };
@ -51,12 +73,17 @@ gst_va_display_wrapped_init (GstVaDisplayWrapped * self)
/** /**
* gst_va_display_wrapped_new: * gst_va_display_wrapped_new:
* @handle: a #VADisplay to wrap * @handle: a VADisplay to wrap
* *
* Creates a #GstVaDisplay wrapping an already created and initialized * Creates a #GstVaDisplay wrapping an already created and initialized
* VADisplay. * VADisplay.
* *
* Returns: a new #GstVaDisplay if @handle is valid, Otherwise %NULL. * The lifetime of @handle must be hold by the provider while the
* pipeline is instantiated. Do not call vaTerminate on it while the
* pipeline is not in NULL state.
*
* Returns: (transfer full): a new #GstVaDisplay if @handle is valid,
* Otherwise %NULL.
* *
* Since: 1.20 * Since: 1.20
**/ **/