Commit graph

23 commits

Author SHA1 Message Date
Holger Kaelberer
082a56599b overlay: fix build without advanced GstVideoOverlayFormatFlags.
Check for global-alpha support in GstVideoOverlayComposition API.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-01-11 15:47:46 +01:00
Gwenole Beauchesne
7e1a8eabfe overlay: fix ordering of composition layers.
Make sure to maintain the association order of composition layers when
GstVideoOverlayRectangle objects are kept around (cached).
2013-01-11 15:32:17 +01:00
Holger Kaelberer
2ecb955626 overlay: fix support for global-alpha.
Fix support for global-alpha subpictures. The previous changes brought
the ability to check for GstVideoOverlayRectangle changes by comparing
the underlying pixel buffer pointers. If sequence number and pixel data
did not change, then this is an indication that only the global-alpha
value changed. Now, try to update the underlying VA subpicture global-alpha
value.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-01-11 15:29:12 +01:00
Gwenole Beauchesne
e6390d6e5f overlay: detect render-rect changes.
Don't re-upload VA subpicture if only the render rectangle changed.
Rather deassociate the subpicture and re-associate it with the new
render rectangle.
2013-01-11 15:29:12 +01:00
Gwenole Beauchesne
e876d9a581 overlay: fix check for pixels buffer change.
A GstVideoOverlayRectangle is created whenever the underlying pixels data
change. However, when global-alpha is supported, it is possible to re-use
the same GstVideoOverlayRectangle but with a change to the global-alpha
value. This process causes a change of sequence number, so we can no longer
check for that.

Still, if sequence numbers did not change, then there was no change in
global-alpha either. So, we need a way to compare the underlying GstBuffer
pointers. There is no API to retrieve the original pixels buffer from
a GstVideoOverlayRectangle. So, we use the following heuristics:

1. Use gst_video_overlay_rectangle_get_pixels_unscaled_argb() with the same
   format flags from which the GstVideoOverlayRectangle was created. This
   will work if there was no prior consumer of the GstVideoOverlayRectangle
   with alternate (non-"native") format flags.

2. In overlay_rectangle_has_changed_pixels(), we have to use the same
   gst_video_overlay_rectangle_get_pixels_unscaled_argb() function but
   with flags that match the subpicture. This is needed to cope with
   platforms that don't support global-alpha in HW, so the gst-video
   layer takes care of that and fixes this up with a possibly new
   GstBuffer, and hence pixels data (or) in-place by caching the current
   global-alpha value applied. So we have to determine the rectangle
   was previously used, based on what previous flags were used to
   retrieve the ARGB pixels buffer.
2013-01-11 15:29:12 +01:00
Gwenole Beauchesne
a14d259060 overlay: optimize cache at the GstVideoOverlayRectangle level.
We previously assumed that an overlay composition changed if the number
of overlay rectangles in there actually changed, or that the rectangle
was updated, and thus its seqnum was also updated.

Now, we can cope with cases where the GstVideoOverlayComposition grew
by one or a few more overlay rectangles, and the initial overlay rectangles
are kept as is.
2013-01-11 15:29:11 +01:00
Gwenole Beauchesne
ad6cdc0b52 overlay: simplify caching of GstVideoOverlayComposition objects.
Create the GPtrArray once in the _init() function and destroy it only
in the _finalize() function. Then use overlay_clear() to remove all
subpicture associations for intermediate updates, don't recreate the
GPtrArray.

Make GstVaapiOverlayRectangle a reference counted object. Also make
sure that overlay_rectangle_new() actually creates and associates the
VA subpicture.
2013-01-11 15:28:25 +01:00
Gwenole Beauchesne
893e45ecb5 context: JPEG codec does not need any reference frame. 2012-09-10 18:17:10 +02:00
Gwenole Beauchesne
4ca1f3f47c context: allow number of reference frames to be set.
Make it possible to specify the maximum number of references to use within
a single VA context. This helps reducing GPU memory allocations to the useful
number of references to be used.
2012-09-10 18:15:02 +02: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
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
0afd2e5c42 context: avoid self reference loops with surfaces. 2012-01-05 14:50:26 +01:00
Gwenole Beauchesne
17538a340e context: make it possible to apply composition globally. 2011-12-14 14:35:13 +01:00
Gwenole Beauchesne
317c4e639e surface: record parent context. 2011-12-13 16:53:15 +01:00
Nicolas Dufresne
075374cda3 Change caps to use new video/x-surface generic type.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2011-12-08 14:58:58 +01:00
Gwenole Beauchesne
1701ce3107 Update copyright notice. 2011-06-14 13:54:07 +02:00
gb
5e8e268e26 Check for out-of-free-surfaces condition. 2010-09-20 12:55:46 +02:00
gb
4754317e70 Relicense gst-libs/ code to LGPL v2.1+. 2010-09-20 12:55:42 +02:00
gb
ecf60d2284 Add VA context abstraction. 2010-04-23 15:59:31 +00:00