Commit graph

51 commits

Author SHA1 Message Date
Víctor Manuel Jáquez Leal
8c08ef31a5 libs: surface: surfacepool: Add allocation flags in constructors. 2020-02-23 13:12:15 +01:00
He Junyan
608ce681e5 libs: surface: port to GstMiniObject
GstVaapiMiniObject and GstVaapiObject are deprecated.

This is the first step to remove them by porting GstVaapiSurface as
a GstMiniBuffer descendant.

Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
2019-12-20 05:01:08 +00:00
Víctor Manuel Jáquez Leal
8bdd1bf5f6 libs: window: remove native-id property
native-id property is problematic since the variable that stores it is
gsize, which is platform specific, and in some is bigger than unsigned
long, and there are not way to handle gsize properties.

Also, GST_VAAPI_ID_INVALID is defined in gsize terms, and we would
like to keep using it for this scope.

This patch removes the native-id property and set it manually in
gst_vaapi_window_new_internal().
2019-01-22 09:46:57 +00:00
Víctor Manuel Jáquez Leal
92af6b82fa libs: window: use G_GSIZE_MODIFIER for window id
gsize type is not equal in all platforms, then the 'l' print modifier
shall not be used always.

This issue was found in Debian builds.
2019-01-22 09:46:57 +00:00
Víctor Manuel Jáquez Leal
e4ae7d9879 libs: window: remove custom ref() and unref()
Use gst_object_ref() and gst_object_unref() instead.
2018-12-24 12:20:00 +00:00
Víctor Manuel Jáquez Leal
8ef95a7dc2 libs: window: use its own debug category 2018-12-24 12:20:00 +00:00
Víctor Manuel Jáquez Leal
6c364cb9a7 libs: window: refactor as gobject
This is another step in the gobjectification of the internal library
of gstreamer-vaapi. Now it is the turn of GstVaapiWindow and its
derivates.

The idea is to minimize the changeset keeping the same design as
much as possible.

GstVaapiWindow is defined as an abstract class with two properties:
the GstVaapiDisplay and the native ID. Thus, many of the
GstVaapiObject macros were copied as GstVaapiWindow macros.

The function gst_vaapi_window_new_internal() is kept as a decorator
of for calling gst_vaapi_window_create() and the possibility of
failure.

The descendant classes, such as glx, still use the private
structures, but through the gobject mechanism.
2018-12-24 12:20:00 +00:00
Víctor Manuel Jáquez Leal
4505acc522 libs: remove dependency on IN_LIBGSTVAAPI_CORE
This conditional code was when libgstvaapi was intended to be library
used outside GStreamer. This not the case anymore, thus removing it.

https://bugzilla.gnome.org/show_bug.cgi?id=797139
2018-09-25 17:41:55 +02:00
Víctor Manuel Jáquez Leal
bd2e304ea4 libs: window: don't add an unused function
The macro GST_VAAPI_OBJECT_DEFINE_CLASS_WITH_CODE only defines
a function that is never used, thus when compiling we might see
this warning (clang):

gstvaapiwindow.c:147:1: warning: unused function 'gst_vaapi_window_class' [-Wunused-function]
GST_VAAPI_OBJECT_DEFINE_CLASS_WITH_CODE (GstVaapiWindow,
^

https://bugzilla.gnome.org/show_bug.cgi?id=759533
2017-04-11 19:22:38 +02:00
Víctor Manuel Jáquez Leal
8e8280efbf libs: window: remove surface_format member
Since we always convert to NV12, there is no need to keep a
variable for that. Let us hard code it.

https://bugzilla.gnome.org/show_bug.cgi?id=759533
2017-04-11 19:22:38 +02:00
Hyunjun Ko
ccfbca733d libs: window: add gst_vaapi_window_vpp_convert_internal()
If a backend doesn't support specific format, we can use vpp for conversion
and make it playing.

This api is originated from GstVaapiWindowWayland and moved to GstVaapiWindow,
so that GstVaapiWindowX11 could use it.

https://bugzilla.gnome.org/show_bug.cgi?id=759533
2017-04-11 19:20:24 +02:00
Hyunjun Ko
4752f68a37 libs: window: x11/wayland: chaining up to GstVaapiWindow
Currently, GstVaapiWindowX11/Wayland are not descendants of GstVaapiWindow.
This patch chains them up to GstVaapiWindow to handle common members in GstVaapiWindow.

https://bugzilla.gnome.org/show_bug.cgi?id=759533
2017-04-11 16:41:41 +02:00
Víctor Manuel Jáquez Leal
b1f6da98de libs: fix code style for errors 2016-11-03 12:51:44 +01:00
Víctor Manuel Jáquez Leal
28d01c0857 libs: small code style fixes
This a set of small code style fixes detected as-is by gst-indent.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-02-03 12:45:30 +01:00
Michael Olbrich
11b9260b6c vaapisink: implement unlock/unlock_stop for wayland
Otherwise wl_display_dispatch_queue() might prevent the pipeline from
shutting down. This can happen e.g. if the wayland compositor exits while
the pipeline is running.

Changes:
* renamed unlock()/unlock_stop() to unblock()/unblock_cancel() in gstvaapiwindow
* splitted the patch removing wl_display_dispatch_queue()

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=747492

https://bugzilla.gnome.org/show_bug.cgi?id=749078
2015-05-15 17:10:37 +02:00
Gwenole Beauchesne
ff0a237458 window: add generic helper to create windows.
Add a new generic helper function gst_vaapi_window_new() to create
a window without having the caller to check for the display type
himself. i.e. internally, there is now a GstVaapiDisplayClass hook
to create windows, and the actual backend implementation fills it in.
Add new generic helper functions gst_vaapi_texture_new_wrapped()

This is a simplification in view to supporting EGL.
2015-01-27 18:11:45 +01:00
Holger Kaelberer
08dc3036f4 window: allow for updating size from current geometry.
Add gst_vaapi_window_reconfigure() interface to force an update of
the GstVaapiWindow "soft" size, based on the current geometry of the
underlying native window.

This can be useful for instance to synchronize the window size when
the user changed it.

Thanks to Fabrice Bellet for rebasing the patch.

[changed interface to gst_vaapi_window_reconfigure()]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2014-07-25 17:36:12 +02:00
Gwenole Beauchesne
3490212988 window: re-indent all GstVaapiWindow related source code. 2014-07-25 17:36:12 +02:00
Gwenole Beauchesne
c516311a1a legal: update copyright notice dates. 2013-11-22 06:39:20 +01:00
Gwenole Beauchesne
15519ebe3d legal: add per-file authorship information.
Credit original authors on a per-file basis as we cannot expect people
to know all country-specific rules, or bother browsing through the git
history.
2013-11-22 06:39:15 +01:00
Gwenole Beauchesne
5cabf4e305 Add initial Pixmap API.
Add API to transfer VA urfaces to native pixmaps. Also add an API to
render a native pixmap, for completeness. In general, rendering to
pixmap would only be useful to certain VA drivers and use cases on
X11 display servers. e.g. GLX_EXT_texture_from_pixmap (TFP) handled
in an upper layer.
2013-07-22 15:43:28 +02:00
Gwenole Beauchesne
99dfd44f33 surface: add simple surface info accessors as helper macros.
Add helper macros to retrieve the VA surface information like size
(width, height) or chroma type. This is a micro-optimization to avoid
useless function calls and NULL pointer re-checks in internal routines.
2013-07-08 18:52:56 +02:00
Gwenole Beauchesne
67eea92044 libs: drop GST_VAAPI_IS_xxx() helper macros.
Drop obsolete GST_VAAPI_IS_xxx() helper macros since we are no longer
deriving from GObject and so those were only checking for whether the
argument was NULL or not. This is now irrelevant, and even confusing
to some extent, because we no longer have type checking.

Note: this incurs more type checking (review) but the libgstvaapi is
rather small, so this is manageable.
2013-05-23 18:15:48 +02:00
Gwenole Beauchesne
8402b04ac9 libs: use GstVaapiObject for window objects. 2013-05-07 17:51:27 +02:00
Gwenole Beauchesne
61cc02f54b libs: fix build in strict ISO C mode. 2012-09-07 16:23:42 +02:00
Gwenole Beauchesne
0fb1147d9c Add header for system-dependent definitions. 2012-01-30 19:52:10 +01:00
Gwenole Beauchesne
92f11799d1 legal: fix year for some copyright notices. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
1594d99d55 legal: add Intel copyright on modified files. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
14cc1cf061 legal: fix copyright notices to include "Copyright" term. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
420402d593 window: always check geometry when the window is mapped. 2012-01-11 09:38:56 +01:00
Gwenole Beauchesne
1701ce3107 Update copyright notice. 2011-06-14 13:54:07 +02:00
Gwenole Beauchesne
b614ec9c9b Fix licensing terms. 2011-06-14 13:54:03 +02:00
gb
6b56ca0068 Move GST_VAAPI_DISPLAY_VADISPLAY() and GST_VAAPI_DISPLAY_{LOCK,UNLOCK}() to gstvaapidisplay_priv.h. 2010-04-01 09:47:59 +00:00
gb
c3dcabd90c Check GstVaapiWindow::render() is available prior to calling it. 2010-03-26 08:35:24 +00:00
gb
2ecadd45b8 Rename to GST_VAAPI_OBJECT_DISPLAY(). 2010-03-24 17:40:19 +00:00
gb
0881507989 Make GstVaapiWindow* derive from GstVaapiObject. 2010-03-24 17:22:18 +00:00
gb
755f198a74 Fix short descriptions. 2010-03-24 08:16:32 +00:00
gb
b271ebd760 Drop introspection annotations since they require gtk-doc >= 1.12. 2010-03-23 13:32:36 +00:00
gb
df9e25d473 Shorten condition. 2010-03-22 16:59:29 +00:00
gb
3136cdc991 Try to improve switch to fullscreen mode. 2010-03-22 16:57:20 +00:00
gb
729f4fc9c6 Move _GstVaapiWindowPrivate declaration to gstvaapiwindow_priv.h. 2010-03-22 13:06:41 +00:00
gb
6407e5339a Add private API to set window size & fullscreen modes
without triggering any notification or virtual functions.
This is useful for derived class to fix up sizes whenever appropriate.
2010-03-22 13:05:05 +00:00
gb
8e773e6d10 Add gst_vaapi_window_get_fullscreen() helper and "fullscreen" property. 2010-03-22 12:47:13 +00:00
gb
cc10345448 Add gst_vaapi_window_get_display() to base. 2010-03-22 12:39:02 +00:00
gb
873d5b7a04 Add GstVaapiPoint & GstVaapiRectangle data structures. 2010-03-22 12:16:47 +00:00
gb
b8daf624c5 Add gst_vaapi_window_set_fullscreen() API. 2010-03-22 10:51:49 +00:00
gb
27307a6c1b Rename gst_vaapi_window_put_surface_full() to plain gst_vaapi_window_put_surface(). 2010-03-21 08:12:52 +00:00
gb
d63f196c73 Add tedious documentation. 2010-03-19 15:45:21 +00:00
gb
b9bf5678f9 Make it possible to bin an X11 window to GstVaapiWindowX11 with plain
g_object_new() and "xid" property. i.e. get foreign window size in
gst_vaapi_window_x11_create().
2010-03-18 13:49:50 +00:00
gb
d6f883f73a Rename vaapi_debug.h to gstvaapidebug.h. 2010-03-16 09:17:41 +00:00