Commit graph

59 commits

Author SHA1 Message Date
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
18031dc6ff surface: fix memory leak through unreleased parent context.
Break the circular references between GstVaapiContext and its children
GstVaapiSurfaces. Since the VA surfaces held an extra reference to the
context, which holds a reference to its VA surfaces, then none of those
were released.

How does this impact support for subpictures?

The only situation when the parent context needs to disappear is when
it is replaced with another one because of a resolution change in the
video stream for instance, or a normal destroy. In this case, it does
not really matter to apply subpictures to the peer surfaces since they
are either gone, or those that are left in the pipe can probably bear
a reinstantiation of the subpictures for it.

So, parent_context is set to NULL when the parent context is destroyed,
other VA surfaces can still get subpictures attached to them, individually
not as a whole. i.e. subpictures for surface S1 will be created from
active composition buffers and associated to S1, subpictures for S2 will
be created from the next active composition buffers, etc. We don't try
to cache the subpictures in those cases (pending surfaces until EOS
is reached, or pending surfaces until new surfaces matching new VA context
get to be used instead).
2013-05-30 19:32:58 +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
6c46179709 libs: use GstVaapiObject for VA objects. 2013-05-07 17:51:27 +02:00
Gwenole Beauchesne
0c99f351fc legal: fix year for some copyright notices (2013). 2013-01-29 14:37:02 +01:00
Gwenole Beauchesne
22094ed053 legal: fix year for some copyright notices (2012). 2013-01-29 14:37:02 +01:00
Holger Kaelberer
1cd4a8fc04 subpicture: add support for global-alpha.
Add the necessary helpers in GstVaapiDisplay to determine whether subpictures
with global alpha are supported or not. Also add accessors in GstVaapiSubpicture
to address this feature.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-01-11 14:23:06 +01:00
Gwenole Beauchesne
61cc02f54b libs: fix build in strict ISO C mode. 2012-09-07 16:23:42 +02:00
Javier Jardón
30024b3f8e libs: use g_clear_object() wherever applicable.
This is a preferred thread-safe version. Also add an inline version of
g_clear_object() if compiling with glib < 2.28.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-07-19 15:19:17 +02:00
Gwenole Beauchesne
0fb1147d9c Add header for system-dependent definitions. 2012-01-30 19:52:10 +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
ac7c4cfe78 surface: apply composition to the parent context, if requested. 2011-12-14 14:40:37 +01:00
Gwenole Beauchesne
0634dc768d surface: fix associate subpicture to not report deassociation errors. 2011-12-14 14:13:58 +01:00
Gwenole Beauchesne
bf63fe671f surface: fix typo in debug message. 2011-12-14 13:46:26 +01:00
Gwenole Beauchesne
3227168487 subpicture: add helper to create subpicture from GstVideoOverlayRectangle. 2011-12-14 13:16:21 +01:00
Gwenole Beauchesne
317c4e639e surface: record parent context. 2011-12-13 16:53:15 +01:00
Gwenole Beauchesne
a4244820af Rename gst_vaapi_surface_update_composition() to
gst_vaapi_surface_set_subpictures_from_composition().
2011-12-13 15:51:58 +01:00
Gwenole Beauchesne
b014567502 surface: use unscaled overlay rectangle for blending. 2011-12-12 18:38:46 +01:00
Gwenole Beauchesne
010f94b85d surface: fix VA image leak when an error occurred. 2011-12-12 18:37:13 +01:00
Nicolas Dufresne
c997607c6f surface: add helper to handle GstVideoOverlayComposition.
This helper resets the subpictures to reflect the current composition
layers provided with the buffers.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2011-12-12 18:34:57 +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
a1dbe90077 Add gst_vaapi_surface_query_status() wrapper. 2010-03-30 08:11:50 +00:00
gb
05a1ed2d23 Try to not reference VA-API types directly. 2010-03-30 07:39:16 +00:00
gb
1703ef2aca Restore the gst_vaapi_{surface,image,subpicture}_get_id() interfaces. 2010-03-25 09:49:17 +00:00
gb
2ecadd45b8 Rename to GST_VAAPI_OBJECT_DISPLAY(). 2010-03-24 17:40:19 +00:00
gb
9961c03c6a All GstVaapiID are initialized to GST_VAAPI_ID_NONE by default.
Besides, all GstVaapiObject derived class shall initialize "id" to a valid value.
2010-03-24 17:38:23 +00:00
gb
725bc7a607 Add compatibility with the original VA-API 0.29. 2010-03-24 16:17:49 +00:00
gb
4f7af960cb Fix g_warning() invocation. 2010-03-24 15:12:56 +00:00
gb
ae6c1637f3 Deassociate subpictures while destroying the surface. 2010-03-24 15:11:26 +00:00
gb
c8ec504343 Fix destruction order of subpictures. They should be destroyed first. 2010-03-24 14:57:33 +00:00
gb
a91206bbc1 Move "id" down to the GstVaapiObject base. 2010-03-24 13:19:58 +00:00
gb
63add8fd63 Drop useless include (<va/va_backend.h>). 2010-03-24 08:35:27 +00:00
gb
b8b82d3337 Move private definitions and accessors to gstvaapiobject_priv.h. 2010-03-24 08:32:12 +00:00
gb
755f198a74 Fix short descriptions. 2010-03-24 08:16:32 +00:00
gb
2155318d12 Make GstVaapi{Surface,Image,Subpicture} derive from a GstVaapiObject. 2010-03-23 16:21:28 +00:00
gb
b271ebd760 Drop introspection annotations since they require gtk-doc >= 1.12. 2010-03-23 13:32:36 +00:00
gb
b4aaa2e8c1 Add note about the fact that the surface holds an extra reference to the subpicture. 2010-03-23 10:51:35 +00:00
gb
95edba8907 Improve debugging messages. 2010-03-23 10:49:33 +00:00
gb
6a8c6ad04c Add gst_vaapi_surface_{,de}associate_subpicture() API. 2010-03-23 10:36:20 +00:00
gb
d63f196c73 Add tedious documentation. 2010-03-19 15:45:21 +00:00
gb
ea2c6c502c Add gst_vaapi_surface_derive_image() API. 2010-03-18 15:28:59 +00:00
gb
bcb5d3f138 Add VA display locking utilities. 2010-03-17 07:59:31 +00:00
gb
d6f883f73a Rename vaapi_debug.h to gstvaapidebug.h. 2010-03-16 09:17:41 +00:00
gb
4e2db9d8e4 Move vaapi_utils.* to gstvaapiutils.* 2010-03-16 09:15:48 +00:00
gb
606c016263 Add gst_vaapi_surface_sync(). 2010-03-15 16:13:51 +00:00
gb
eca4c7da42 Cosmetics. 2010-03-15 15:55:20 +00:00
gb
d69e59ffee Add gst_vaapi_{get,put}_image() API. 2010-03-15 11:49:03 +00:00