Commit graph

35 commits

Author SHA1 Message Date
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
b1f6da98de libs: fix code style for errors 2016-11-03 12:51:44 +01:00
Víctor Manuel Jáquez Leal
02c0e6c183 libs: trivial comment style fixes
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-02-03 12:20:37 +01:00
Gwenole Beauchesne
babae32432 window: add toplevel API to determine the colormap.
Add GstVaapiWindowClass::get_colormap() hook to help determine the
currently active colormap bound to the supplied window, or actually
create it if it does not already exist yet.
2015-01-27 18:11:45 +01:00
Gwenole Beauchesne
e9f437167f window: add toplevel API to determine a visual id.
Add GstVaapiWindowClass::get_visual_id() function hook to help find
the best suitable visual id for the supplied window. While doing so,
also simplify the process by which an X11 window is created with a
desired Visual, i.e. now use a visual id instead of a Visual object.
2015-01-27 18:11:45 +01: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
Gwenole Beauchesne
1843774c0b display: record native display object.
Record the underlying native display instance into the toplevel
GstVaapiDisplay object. This is useful for fast lookups to the
underlying native display, e.g. for creating an EGL display.
2015-01-27 18:11:44 +01:00
Gwenole Beauchesne
3490212988 window: re-indent all GstVaapiWindow related source code. 2014-07-25 17:36:12 +02:00
Gwenole Beauchesne
6bf3c1863c legal: update copyright notice dates. 2014-01-22 19:02:35 +01:00
Gwenole Beauchesne
33bb859228 Fix printf()-like formats.
Fix formts for various GST_DEBUG et al. invocations. More precisely,
make size_t arguments use the %zu format specifier accordingly; force
XID formats to be a 32-bit unsigned integer; and fix the format used
for gst_vaapi_create_surface_with_format() error cases since we have
been using strings nowadays.
2014-01-06 10:04:05 +01: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
382542c747 window: fix GLX window initialization.
Make sure to create the GLX context once the window object has completed
its creation. Since gl_resize() relies on the newly created window size,
then we cannot simply overload the GstVaapiWindowClass::create() hook.
So, we just call into gst_vaapi_window_glx_ensure_context() once the
window object is created in the gst_vaapi_window_glx_new*() functions.
2013-05-27 17:21:10 +02:00
Gwenole Beauchesne
b1e5dfab96 display: validate display types. 2013-05-27 17:20:35 +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
0f662a8913 legal: add Intel copyright on modified files. 2013-01-29 14:00:04 +01: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
14cc1cf061 legal: fix copyright notices to include "Copyright" term. 2012-01-16 11:40:51 +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
3ddab3f253 The shared GL context in GstVaapiTexture is only useful for cases
where TFP+FBO are used, thus avoiding the need fully preserve the states
and call into glGet*() functions that need synchronization.
2010-04-01 15:38:59 +00:00
gb
7edf8c9bb7 Make more helpers internal, thus reducing .text size further. Add gst_vaapi_display_x11_get_screen() helper along the way. 2010-04-01 13:41:24 +00: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
702f844a7e Improve handling of GL contexts. 2010-03-31 15:25:19 +00:00
gb
1165419fd0 Add glXSwapBuffers() workaround for NVIDIA. 2010-03-29 13:40:27 +00:00
gb
dd92195093 Add gst_vaapi_window_glx_put_texture() helper. 2010-03-29 10:40:26 +00:00
gb
504dc9bf98 Fix typos. 2010-03-29 09:09:30 +00:00
gb
d84d6b0f80 Make sure window resize completed prior to resizing the GL viewport. 2010-03-26 11:50:31 +00:00
gb
72fb4f6def Restore GLX context only if there is one. 2010-03-26 10:09:23 +00:00
gb
c9f62b7405 Add gst_vaapi_window_glx_make_current(). Handle X11 window size changes and reset the GL viewport. 2010-03-26 09:41:12 +00:00
gb
89a99d828c Add initial VA/GLX support. 2010-03-25 17:28:49 +00:00