platform/upstream/gstreamer-vaapi.git
10 years agovaapisink: allow scaling to ignore aspect ratio.
Simon Farnsworth [Fri, 16 Aug 2013 15:58:58 +0000 (16:58 +0100)]
vaapisink: allow scaling to ignore aspect ratio.

Other GStreamer sinks, like xvimagesink, have a force-aspect-ratio property,
which allows you to say that you don't want the sink to respect aspect
ratio. Add the same property to vaapisink.

http://lists.freedesktop.org/archives/libva/2012-September/001298.html

Signed-off-by: Simon Farnsworth <simon.farnsworth at onelan.co.uk>
10 years agovaapisink: fix memory leak of GstVaapiUploader instance.
Wind Yuan [Tue, 14 May 2013 07:19:04 +0000 (15:19 +0800)]
vaapisink: fix memory leak of GstVaapiUploader instance.

Make sure gst_vaapisink_ensure_uploader() checks for the existence
of a former GstVaapiUploader instance prior to forcibly creating a
new one.

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

10 years agovaapisink: fix get_caps() implementation for GStreamer 1.0.
Guangxin.Xu [Wed, 31 Jul 2013 08:49:20 +0000 (16:49 +0800)]
vaapisink: fix get_caps() implementation for GStreamer 1.0.

Fix GstBaseSink::get_caps() implementation for GStreamer 1.0.X builds
by honouring the filter caps argument. More precisely, this fixes the
following pipeline: gst-launch-1.0 videotestsrc ! vaapisink

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

Signed-off-by: Guangxin.Xu <Guangxin.Xu@intel.com>
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
10 years agompeg4: fix double definition of GstVaapiDecoderMpeg4Class.
Gwenole Beauchesne [Mon, 26 Aug 2013 09:31:06 +0000 (11:31 +0200)]
mpeg4: fix double definition of GstVaapiDecoderMpeg4Class.

This fixes the following issue:

  CC     libgstvaapi_0.10_la-gstvaapidecoder_mpeg4.lo
gstvaapidecoder_mpeg4.c:113: error: redefinition of typedef
'GstVaapiDecoderMpeg4Class'
gstvaapidecoder_mpeg4.c:44: note: previous declaration of
'GstVaapiDecoderMpeg4Class' was here
make[5]: *** [libgstvaapi_0.10_la-gstvaapidecoder_mpeg4.lo] Error 1
make[5]: Leaving directory
`/builddir/build/BUILD/gstreamer-vaapi-0.5.5.1/gst-libs/gst/vaapi'

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

10 years agotests: filter: add support for deinterlacing.
Gwenole Beauchesne [Tue, 30 Jul 2013 13:59:40 +0000 (15:59 +0200)]
tests: filter: add support for deinterlacing.

Add --deinterlace option to enable deinterlacing through explicit VA/VPP
deinterlacing filter. However, if --deinterlace option is not set but the
--deinterlace-flags option is set with "top-field-first", then the very
basic bob deinterlacing filter is set through VA/VPP proc pipeline flags.

10 years agotests: filter: add support for denoising and sharpening.
Zhao Halley [Wed, 17 Jul 2013 09:29:41 +0000 (17:29 +0800)]
tests: filter: add support for denoising and sharpening.

Add --denoise option to enable noise reduction with the level specified
as the option value (float). Likewise, add --sharpen option to enable
sharpening.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
10 years agotests: filter: add support for frame cropping.
Gwenole Beauchesne [Wed, 24 Jul 2013 12:31:34 +0000 (14:31 +0200)]
tests: filter: add support for frame cropping.

Add support for frame cropping through the --crop-rect|-c argument.
The format used is either <WIDTH> 'x' <HEIGHT>, with origin at (0,0) ;
or full specification with '('? <X> ',' <Y> ')'? <WIDTH> 'x' <HEIGHT>.

10 years agotests: filter: dump supported operations and formats.
Gwenole Beauchesne [Tue, 23 Jul 2013 16:00:26 +0000 (18:00 +0200)]
tests: filter: dump supported operations and formats.

10 years agotests: add initial test for video processing.
Zhao Halley [Mon, 8 Jul 2013 08:54:55 +0000 (16:54 +0800)]
tests: add initial test for video processing.

Add minimal test case for video processing: scaling and color format
conversion.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
10 years agofilter: add initial support for deinterlacing.
Zhao Halley [Mon, 29 Jul 2013 01:23:50 +0000 (09:23 +0800)]
filter: add initial support for deinterlacing.

Add basic deinterlacing support, i.e. bob-deinterlacing whereby only
the selected field from the input surface is kept for the target surface.
Setting gst_vaapi_filter_set_deinterlacing() method argument to
GST_VAAPI_DEINTERLACE_METHOD_NONE means to disable deinterlacing.

Also move GstVaapiDeinterlaceMethod definition from vaapipostproc plug-in
to libgstvaapi core library.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
10 years agofilter: add support for color balance adjustment.
Zhao Halley [Wed, 17 Jul 2013 09:40:41 +0000 (17:40 +0800)]
filter: add support for color balance adjustment.

Add ProcAmp (color balance) adjustments for hue, saturation, brightness
and contrast. The respective range for each filter shall be the same as
for the VA display attributes.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
10 years agofilter: add support for sharpening.
Zhao Halley [Wed, 17 Jul 2013 09:37:16 +0000 (17:37 +0800)]
filter: add support for sharpening.

Sharpening is configured with a float value. The supported range is
-1.0 .. 1.0 with 0.0 being the default, and that means no sharpening
operation at all.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
10 years agofilter: add support for denoising.
Zhao Halley [Wed, 17 Jul 2013 09:29:41 +0000 (17:29 +0800)]
filter: add support for denoising.

Noise reduction is configured with a float value. The supported range
is 0.0 .. 1.0 with 0.0 being the default, and that means no denoise
operation at all.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
10 years agofilter: add support for frame cropping.
Gwenole Beauchesne [Wed, 24 Jul 2013 12:22:28 +0000 (14:22 +0200)]
filter: add support for frame cropping.

Frame cropping is defined with a GstVaapiRectangle value. The default
behaviour is to treat the source surface as a whole

10 years agofilter: add helper functions.
Gwenole Beauchesne [Thu, 25 Jul 2013 11:55:15 +0000 (13:55 +0200)]
filter: add helper functions.

Add helper functions to ensure an operation VA buffer is allocated to
the right size; that filter caps get parsed and assigned to the right
operation too; and that float parameters are correctly scaled to fit
the reported range from the VA driver.

10 years agoAdd initial infrastructure for video processing.
Gwenole Beauchesne [Tue, 23 Jul 2013 13:52:45 +0000 (15:52 +0200)]
Add initial infrastructure for video processing.

Add initial API for video processing: only scaling and color format
conversion operations are supported.

10 years agolibs: add gst_vaapi_video_format_from_string() helper.
Gwenole Beauchesne [Wed, 24 Jul 2013 09:53:38 +0000 (11:53 +0200)]
libs: add gst_vaapi_video_format_from_string() helper.

Add gst_vaapi_video_format_from_string() helper function to convert from
a video format string representation to a suitable GstVideoFormat. This
is just an alias to gst_video_format_from_string() for GStreamer 1.0.x
builds, and a proper iteration over all GstVideoFormat string representations
otherwise for earlier GStreamer 0.10.x builds.

10 years agolibs: add gst_vaapi_video_format_from_va_fourcc() helper.
Gwenole Beauchesne [Wed, 24 Jul 2013 09:37:23 +0000 (11:37 +0200)]
libs: add gst_vaapi_video_format_from_va_fourcc() helper.

Add gst_vaapi_video_format_from_va_fourcc() helper that converts from a
VA fourcc value to a suitable GstVideoFormat.

10 years agolibs: add type definitions for GstVaapiPoint and GstVaapiRectangle.
Gwenole Beauchesne [Wed, 24 Jul 2013 09:41:05 +0000 (11:41 +0200)]
libs: add type definitions for GstVaapiPoint and GstVaapiRectangle.

Add helper functions to describe GstVaapiPoint and GstVaapiRectangle
structures as a standard GType. This could be useful to have them
described as a GValue later on.

10 years agolibs: drop some public APIs.
Gwenole Beauchesne [Fri, 26 Jul 2013 11:57:35 +0000 (13:57 +0200)]
libs: drop some public APIs.

Don't expose GstVaapiContext APIs and make them totally private to
libgstvaapi core library. That API would also tend to disappear in
a future revision. Likewise, don't expose GstVaapiDisplayCache API
but keep symbols visible so that the various render backends could
share a common display cache implementation in libgstvaapi.

Try to clean-up the documentation from any stale entry too.

10 years agotests: image: allow creation of images with interleaved patterns.
Gwenole Beauchesne [Fri, 23 Aug 2013 16:35:42 +0000 (18:35 +0200)]
tests: image: allow creation of images with interleaved patterns.

Add image_generate_full() function to create interleaved color rectangles.
If flags is zero, the whole frame is generated with a unique pattern. If
flags is non-zero, then each field is handled individually.

10 years agotests: image: fix conversion from RGB to YUV.
Gwenole Beauchesne [Fri, 23 Aug 2013 14:25:39 +0000 (16:25 +0200)]
tests: image: fix conversion from RGB to YUV.

Fix RGB to YUV conversion to preserve full data range.

10 years agotests: image: try to upload images through vaDeriveImage() too. old-upstream-0905 upstream/0.5.5
Gwenole Beauchesne [Fri, 26 Jul 2013 11:12:28 +0000 (13:12 +0200)]
tests: image: try to upload images through vaDeriveImage() too.

On some platforms, vaPutImage() would fail even if it does not involve
color format conversion or scaling, whereas copying raw pixels through
vaDeriveImage() could work instead.

10 years agotests: image: add support for packed YUV formats.
Gwenole Beauchesne [Fri, 26 Jul 2013 08:05:06 +0000 (10:05 +0200)]
tests: image: add support for packed YUV formats.

Add support for packed YUV 4:2:2 formats, i.e. YUY2 and UYVY.

10 years agotests: image: fix generation of I420/YV12 images.
Gwenole Beauchesne [Thu, 25 Jul 2013 16:10:40 +0000 (18:10 +0200)]
tests: image: fix generation of I420/YV12 images.

U/V planes were reversed, thus producing invalid images.

10 years agotests: image: fix string representation for GstVideoFormat.
Gwenole Beauchesne [Wed, 24 Jul 2013 11:55:04 +0000 (13:55 +0200)]
tests: image: fix string representation for GstVideoFormat.

10 years agoimage: clean image API up.
Gwenole Beauchesne [Fri, 26 Jul 2013 10:57:19 +0000 (12:57 +0200)]
image: clean image API up.

Don't expose functions that reference a GstVaapiImageRaw, those are
meant to be internal only for implementing subpictures sync. Also add
a few private definitions to avoid functions calls for retrieving
image size and format information.

10 years agoimage: add gst_vaapi_image_copy() helper.
Gwenole Beauchesne [Fri, 26 Jul 2013 09:43:49 +0000 (11:43 +0200)]
image: add gst_vaapi_image_copy() helper.

Add gst_vaapi_image_copy() helper function to copy images of same format
and size.

10 years agoplugins: handle video cropping in X11 pixmap converter.
Gwenole Beauchesne [Mon, 22 Jul 2013 12:53:51 +0000 (14:53 +0200)]
plugins: handle video cropping in X11 pixmap converter.

Use GstVideoCropMeta in GStreamer 1.0 or any other render rectangle
we could decode from the stream.

10 years agoplugins: add support for "x11-pixmap" video converter type.
Gwenole Beauchesne [Mon, 22 Jul 2013 09:58:33 +0000 (11:58 +0200)]
plugins: add support for "x11-pixmap" video converter type.

Install a new video converter that supports X11 pixmap targets for X11
backends only, or make the GLX converter creation function chain up to
the X11 converter whenever requested.

10 years agotests: simple-decoder: add support for pixmap API.
Gwenole Beauchesne [Mon, 22 Jul 2013 07:36:08 +0000 (09:36 +0200)]
tests: simple-decoder: add support for pixmap API.

Add support for the new render-to-pixmap API. Avoid flickering on
platforms supporting video overlay by keeping up to 2 intermediate
pixmaps.

10 years agotests: simple-decoder: add support for video cropping.
Gwenole Beauchesne [Mon, 22 Jul 2013 07:12:21 +0000 (09:12 +0200)]
tests: simple-decoder: add support for video cropping.

Handle video cropping information attached to a VA surface proxy.

10 years agotests: add support for render-to-pixmap.
Gwenole Beauchesne [Mon, 22 Jul 2013 07:03:30 +0000 (09:03 +0200)]
tests: add support for render-to-pixmap.

Add --pixmap option to test-decode so that to allow copies of VA
surface to an intermediate pixmap and rendering from that pixmap.

Only X11 backends are supported for now.

10 years agox11: implement pixmap rendering with RENDER extension.
Gwenole Beauchesne [Mon, 22 Jul 2013 07:00:38 +0000 (09:00 +0200)]
x11: implement pixmap rendering with RENDER extension.

Use hardware accelerated XRenderComposite() function, from the RENDER
extension, to blit a pixmap to screen. Besides, this can also support
cropping and scaling.

10 years agox11: implement pixmap API.
Gwenole Beauchesne [Fri, 19 Jul 2013 13:05:34 +0000 (15:05 +0200)]
x11: implement pixmap API.

Implement the new render-to-pixmap API. The only supported pixmap format
that will work is xRGB, with native byte ordering. Others might work but
they were not tested.

10 years agox11: update x11_get_geometry() helper function with depth output.
Gwenole Beauchesne [Mon, 22 Jul 2013 08:10:40 +0000 (10:10 +0200)]
x11: update x11_get_geometry() helper function with depth output.

Allow x11_get_geometry() utility function to also return the depth
assigned to the X drawable.

10 years agoAdd initial Pixmap API.
Gwenole Beauchesne [Mon, 22 Jul 2013 08:00:21 +0000 (10:00 +0200)]
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.

10 years agolibs: add and expose gst_vaapi_video_format_to_string() helper.
Gwenole Beauchesne [Mon, 22 Jul 2013 13:15:48 +0000 (15:15 +0200)]
libs: add and expose gst_vaapi_video_format_to_string() helper.

This is just a wrapper over gst_video_format_to_string() for older
GStreamer 0.10 builds.

10 years agoplugins: fix display type comparison in gst_vaapi_create_display().
Emilio López [Thu, 18 Jul 2013 05:54:54 +0000 (02:54 -0300)]
plugins: fix display type comparison in gst_vaapi_create_display().

After the code got moved to create the gst_vaapi_create_display() helper,
this comparison was not updated to dereference the newly-created
pointer, so the code was comparing the pointer itself to the type, and
therefore failing to retrieve the VA display.

This fixes the following error (and gets gst-vaapi decoding again):

    ERROR vaapidecode gstvaapidecode.c:807:gst_vaapidecode_ensure_allowed_caps: failed to retrieve VA display

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

Signed-off-by: Emilio López <emilio@elopez.com.ar>
10 years agoBump version for development.
Gwenole Beauchesne [Wed, 17 Jul 2013 09:07:39 +0000 (11:07 +0200)]
Bump version for development.

10 years agompeg2: don't output dummy pictures. 0.5.5
Gwenole Beauchesne [Mon, 15 Jul 2013 15:49:31 +0000 (17:49 +0200)]
mpeg2: don't output dummy pictures.

Mark dummy pictures as output already so that we don't try to submit
them to the upper layer since this is purely internal / temporary
picture for helping the decoder.

10 years agodecoder: dispose GstVideoCodecFrame earlier.
Gwenole Beauchesne [Mon, 15 Jul 2013 15:43:34 +0000 (17:43 +0200)]
decoder: dispose GstVideoCodecFrame earlier.

Once the picture was output, it is no longer necessary to keep an extra
reference to the underlying GstVideoCodecFrame. So, we can release it
earlier, and maybe subsequently release the associate surface proxy
earlier.

10 years ago0.5.5.
Gwenole Beauchesne [Mon, 15 Jul 2013 12:47:01 +0000 (14:47 +0200)]
0.5.5.

10 years agoFix new video format API.
Gwenole Beauchesne [Mon, 15 Jul 2013 12:42:33 +0000 (14:42 +0200)]
Fix new video format API.

Fix new internal video format API, based on GstVideoFormat, to not
clobber with system symbols. So replace the gst_video_format_* prefix
with gst_vaapi_video_format_ prefix, even if the format type remains
GstVideoFormat.

10 years agoBump library major version.
Gwenole Beauchesne [Mon, 15 Jul 2013 12:05:45 +0000 (14:05 +0200)]
Bump library major version.

Bump the library major version due to API/ABI changes that occurred in
the imaging API. In particular, GstVaapiImageFormat type was replaced
with the standard GstVideoFormat type. All dependent APIs were updated
to match this change.

10 years agoNEWS: updates.
Gwenole Beauchesne [Mon, 15 Jul 2013 11:44:43 +0000 (13:44 +0200)]
NEWS: updates.

10 years agodecoder: fix memory leak when processing interlaced pictures.
Gwenole Beauchesne [Tue, 11 Jun 2013 13:11:34 +0000 (15:11 +0200)]
decoder: fix memory leak when processing interlaced pictures.

Fix memory leak when processing interlaced pictures and that occurs
because the first field, represented as a GstVideoCodecFrame, never
gets released. i.e. when the picture is completed, this is generally
the case when the second field is successfully decoded, we need to
propagate the GstVideoCodecFrame of the first field to the original
GstVideoDecoder so that it could reclaim memory.

Otherwise, we keep accumulating the first fields into GstVideoDecoder
private frames list until the end-of-stream is reached. The frames
are eventually released there, but too late, i.e. too much memory
may have been consumed.

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

10 years agoplugins: simlpify gst_vaapi_create_display() helper.
Gwenole Beauchesne [Mon, 15 Jul 2013 09:58:31 +0000 (11:58 +0200)]
plugins: simlpify gst_vaapi_create_display() helper.

Simplify gst_vaapi_create_display() helper as gst_vaapi_display_XXX_new()
performs the necessary validation checks for the underlying VA display
prior to returning to the caller. So, if an error occurred, then NULL is
really returned in that case.

10 years agoplugins: add gst_vaapi_create_display() helper.
Víctor Manuel Jáquez Leal [Fri, 24 May 2013 09:04:01 +0000 (05:04 -0400)]
plugins: add gst_vaapi_create_display() helper.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
10 years agoplugins: don't reallocate pool allocator for the same caps.
Gwenole Beauchesne [Fri, 12 Jul 2013 15:47:07 +0000 (17:47 +0200)]
plugins: don't reallocate pool allocator for the same caps.

If the video buffer pool config doesn't have new caps, then it's not
necessary to reinstantiate the allocator. That could be a costly
operation as we could do some extra heavy checking in there.

10 years agoplugins: fix ref counting of GstVaapiVideoMemory allocator.
Gwenole Beauchesne [Fri, 12 Jul 2013 15:14:49 +0000 (17:14 +0200)]
plugins: fix ref counting of GstVaapiVideoMemory allocator.

Fix reference counting issue whereby gst_memory_init() does not hold
an extra reference to the GstAllocator. So, there could be situations
where the last instance of GstVaapiVideoAllocator gets released before
a dangling GstVaapiVideoMemory object, thus possibly leading to a crash.

10 years agovaapiupload: use implicit color conversion to NV12.
Gwenole Beauchesne [Fri, 12 Jul 2013 13:15:07 +0000 (15:15 +0200)]
vaapiupload: use implicit color conversion to NV12.

Always perform conversion of sources buffers to NV12 since this is
the way we tested for this capability in ensure_allowed_caps(). This
also saves memory bandwidth for further rendering. However, this may
not preserve quality since the YUV buffers are down-sampled to 4:2:0.

10 years agopool: fix deallocation of video pools.
Gwenole Beauchesne [Fri, 12 Jul 2013 13:01:01 +0000 (15:01 +0200)]
pool: fix deallocation of video pools.

The queue of free objects to used was deallocated with g_queue_free_full().
However, this convenience function shall only be used if the original queue
was allocated with g_queue_new(). This caused memory corruption, eventually
leading to a crash.

The correct solution is to pair the g_queue_init() with the corresponding
g_queue_clear(), while iterating over all free objects to deallocate them.

10 years agovaapidownload: fix src caps format error.
Wind Yuan [Wed, 13 Mar 2013 09:44:52 +0000 (17:44 +0800)]
vaapidownload: fix src caps format error.

This fixes direct linking of vaapidownload element to xvimagesink with
VA drivers supporting vaGetImage() from the native VA surface format to
a different VA image format. i.e. color conversion during download.

http://bugzilla.gnome.org/show_bug.cgi?id=703937

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
10 years agovaapidownload: fix debug string for image formats.
Gwenole Beauchesne [Thu, 11 Jul 2013 16:26:37 +0000 (18:26 +0200)]
vaapidownload: fix debug string for image formats.

The image is now expressed as a standard GstVideoFormat, which is not
a FOURCC but rather a regular enum value.

This is a regression introduced in commit 09397fa.

10 years agoimage: add support for raw YUY2/UYVY image copies.
Wind Yuan [Wed, 24 Apr 2013 02:39:03 +0000 (10:39 +0800)]
image: add support for raw YUY2/UYVY image copies.

Implement raw image copies for YUY2 format. Add support for UYVY format
too, with the same copy function as for YUY2. Even though components
ordering differs, copying line strides is essentially the same.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
10 years agoplugins: clean-up video uploader helper.
Gwenole Beauchesne [Wed, 10 Jul 2013 13:15:11 +0000 (15:15 +0200)]
plugins: clean-up video uploader helper.

Fix gst_vaapi_uploader_get_buffer() to not assign caps since they
were already negotiated beforehand, and they are not used from the
buffer in upstream elements.

Clean-up gst_vaapi_uploader_ensure_caps() to use the new image caps
represented as a GstVideoInfo.

10 years agoplugins: use GstVideoInfo in video uploader helper.
Gwenole Beauchesne [Wed, 10 Jul 2013 13:03:43 +0000 (15:03 +0200)]
plugins: use GstVideoInfo in video uploader helper.

10 years agoplugins: allow creation of VA surfaces with explicit pixel format.
Gwenole Beauchesne [Wed, 10 Jul 2013 08:34:24 +0000 (10:34 +0200)]
plugins: allow creation of VA surfaces with explicit pixel format.

Adapt GstVaapiVideoMemory allocator to support creation of VA surfaces
with an explicit pixel format. This allows for direct rendering to
VA surface memory from a software decoder.

10 years agosurface: fix surface pool creation with an explicit pixel format.
Gwenole Beauchesne [Wed, 10 Jul 2013 12:20:30 +0000 (14:20 +0200)]
surface: fix surface pool creation with an explicit pixel format.

Fix creation of surface pool objects to honour explicit pixel format
specification. If this operation is not supported, then fallback to
the older interface with chroma format.

10 years agosurface: try to determine the underlying VA surface format.
Gwenole Beauchesne [Wed, 10 Jul 2013 11:58:55 +0000 (13:58 +0200)]
surface: try to determine the underlying VA surface format.

If a VA surface was allocated with the chroma-format interface, try to
determine the underlying pixel format on gst_vaapi_surface_get_format(),
or return GST_VIDEO_FORMAT_ENCODED if this is not a supported operation.

10 years agosurface: allow creation with explicit pixel format.
Gwenole Beauchesne [Tue, 9 Jul 2013 17:08:37 +0000 (19:08 +0200)]
surface: allow creation with explicit pixel format.

Make it possible to create VA surfaces with a specific pixel format.
This is a new capability brought in by VA-API >= 0.34.0. If that
capability is not built-in (e.g. using VA-API < 0.34.0), then
gst_vaapi_surface_new_with_format() will return NULL.

10 years agosurface: add helper function to get chroma type from GstVideoFormat.
Gwenole Beauchesne [Wed, 10 Jul 2013 07:48:40 +0000 (09:48 +0200)]
surface: add helper function to get chroma type from GstVideoFormat.

Add gst_video_format_get_chroma_type() helper function to determine
the GstVaapiChromaType from a standard GStreamer video format. It is
possible to reconstruct that from GstVideoFormatInfo but it is much
simpler (and faster?) to use the local GstVideoFormatMap table.

10 years agosurface: add new chroma formats.
Gwenole Beauchesne [Tue, 9 Jul 2013 17:13:39 +0000 (19:13 +0200)]
surface: add new chroma formats.

Add new chroma formats available with VA-API >= 0.34.0. In particular,
this includes "RGB" chroma formats, and more YUV subsampled formats.
Also add a new from_GstVaapiChromaType() helper function to convert
libgstvaapi chroma type to VA chroma format.

10 years agopool: fix image pool to check for the video format to use.
Gwenole Beauchesne [Wed, 10 Jul 2013 11:32:15 +0000 (13:32 +0200)]
pool: fix image pool to check for the video format to use.

Make gst_vaapi_image_pool_new() succeed, and thus returning a valid
image pool object, only if the underlying VA display does support the
requested VA image format.

10 years agoUse GstVideoInfo for video pools.
Gwenole Beauchesne [Wed, 10 Jul 2013 11:07:37 +0000 (13:07 +0200)]
Use GstVideoInfo for video pools.

Get rid of GstCaps to create surface/image pool, and use GstVideoInfo
structures instead. Those are smaller, and allows for streamlining
libgstvaapi more.

10 years agoAdd more video formats.
Gwenole Beauchesne [Tue, 9 Jul 2013 16:03:36 +0000 (18:03 +0200)]
Add more video formats.

Add new video format mappings to VA image formats:
- YUV: packed YUV (YUY2, UYVY), grayscale (Y800) ;
- RGB: 32-bit RGB without alpha channel (XRGB, XBGR, RGBX, BGRX).

10 years agoimage: fix debug message with video format.
Gwenole Beauchesne [Wed, 10 Jul 2013 13:52:20 +0000 (15:52 +0200)]
image: fix debug message with video format.

Fix debug message string with image format expressed with GstVideoFormat
instead of the obsolete format that turned out to be a fourcc.

This is a regression from git commit e61c5fc.

10 years agotests: port to new video format API.
Gwenole Beauchesne [Tue, 9 Jul 2013 13:28:31 +0000 (15:28 +0200)]
tests: port to new video format API.

10 years agoplugins: port to new video format API.
Gwenole Beauchesne [Tue, 9 Jul 2013 13:44:35 +0000 (15:44 +0200)]
plugins: port to new video format API.

10 years agolibs: use GstVideoInfo wherever possible.
Gwenole Beauchesne [Tue, 9 Jul 2013 14:26:11 +0000 (16:26 +0200)]
libs: use GstVideoInfo wherever possible.

In particular, use gst_video_info_from_caps() helper function in VA image
for implementating gst_vaapi_image_get_buffer() [vaapidownload] and
gst_vaapi_image_update_from_buffer() [subpictures] in GStreamer 0.10 builds.

10 years agolibs: drop GstVaapiImageFormat helpers.
Gwenole Beauchesne [Tue, 9 Jul 2013 14:38:05 +0000 (16:38 +0200)]
libs: drop GstVaapiImageFormat helpers.

Drop GstVaapiImageFormat helpers since everything was moved to the new
GstVideoFormat based API. Don't bother with backwards compatibility and
just bump the library major version afterwards.

10 years agolibs: port to new video format API.
Gwenole Beauchesne [Tue, 9 Jul 2013 12:03:01 +0000 (14:03 +0200)]
libs: port to new video format API.

10 years agoAdd new video format API.
Gwenole Beauchesne [Tue, 9 Jul 2013 13:29:59 +0000 (15:29 +0200)]
Add new video format API.

Leverage GstVideoFormat utilities from core GStreamer to provide an
adaptation layer to VA image formats.

10 years agoNEWS: updates.
Gwenole Beauchesne [Tue, 9 Jul 2013 09:13:59 +0000 (11:13 +0200)]
NEWS: updates.

10 years agovaapisink: fix creation of GLX texture.
Gwenole Beauchesne [Mon, 8 Jul 2013 16:32:00 +0000 (18:32 +0200)]
vaapisink: fix creation of GLX texture.

Fix creation of GLX texture, to not depend on the GstCaps video size that
could be wrong, especially in presence of frame cropping. So, use the size
from the source VA surfaces.

An optimization could be to reduce the texture size to the actual visible
size on screen. i.e. scale down the texture size to match the screen dimensions,
while preserving the VA surface aspect ratio. However, some VA drivers don't
honour that.

10 years agompeg2: add support for video cropping.
Sreerenj Balachandran [Mon, 18 Feb 2013 14:28:27 +0000 (16:28 +0200)]
mpeg2: add support for video cropping.

If the stream has a sequence_display_extenion, then attach the
display_horizontal/display_vertical dimension as the cropping
rectangle width/height to the GstVaapiPicture.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
10 years agovc1: add support for video cropping.
Sreerenj Balachandran [Mon, 18 Feb 2013 13:05:37 +0000 (15:05 +0200)]
vc1: add support for video cropping.

If the Advanced profile has display_extension fields, then set the display
width/height dimension as cropping rectangle to the GstVaapiPicture.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
10 years agoh264: add support for video cropping.
Sreerenj Balachandran [Fri, 15 Feb 2013 16:50:26 +0000 (18:50 +0200)]
h264: add support for video cropping.

If the encoded stream has the frame_cropping_flag set, then associate
the cropping rectangle to GstVaapiPicture.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
10 years agotests: add basic support for video cropping.
Gwenole Beauchesne [Mon, 8 Jul 2013 15:01:21 +0000 (17:01 +0200)]
tests: add basic support for video cropping.

Change generic decoder of sample I-frame to return a GstVaapiSurfaceProxy
instead of a plain GstVaapiSurface. This means that we can now retrieve
the frame cropping rectangle from the surface proxy, along with additional
information if ever needed.

10 years agoplugins: add support for video cropping.
Gwenole Beauchesne [Mon, 8 Jul 2013 12:50:42 +0000 (14:50 +0200)]
plugins: add support for video cropping.

Add support for GstVideoCropMeta in GStreamer >= 1.0.x builds and gst-vaapi
specific meta information to hold video cropping details. Make the sink
support video cropping in X11 and GLX modes.

10 years agoplugins: add helper functions to set the render rectangle.
Sreerenj Balachandran [Fri, 15 Feb 2013 16:24:24 +0000 (18:24 +0200)]
plugins: add helper functions to set the render rectangle.

Some video clips may have a clipping region that needs to propogate to
the renderer. These helper functions make it possible to attach that
clipping region, as a GstVaapiRectangle, the the video meta associated
with the buffer.

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>

10 years agosurfaceproxy: allow for NULL cropping rectangle.
Gwenole Beauchesne [Mon, 8 Jul 2013 12:47:24 +0000 (14:47 +0200)]
surfaceproxy: allow for NULL cropping rectangle.

Make it possible associate an empty cropping rectangle to the surface
proxy, thus resetting any cropping rectangle that was previously set.
This allows for returning plain NULL when no cropping rectangle was
initially set up to the surface proxy, or if it was reset to defaults.

10 years agosurfaceproxy: clean-up helper macros.
Gwenole Beauchesne [Mon, 8 Jul 2013 09:41:59 +0000 (11:41 +0200)]
surfaceproxy: clean-up helper macros.

Always use the GST_VAAPI_SURFACE_PROXY() helper macro to cast from a
proxy macro argument to a GstVaapiSurfaceProxy pointer.

10 years agosurface: add simple surface info accessors as helper macros.
Gwenole Beauchesne [Mon, 8 Jul 2013 09:43:27 +0000 (11:43 +0200)]
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.

10 years agodecoder: add support for video cropping.
Sreerenj Balachandran [Fri, 15 Feb 2013 16:42:12 +0000 (18:42 +0200)]
decoder: add support for video cropping.

Add gst_vaapi_picture_set_crop_rect() helper function to copy the video
cropping information from raw bitstreams to each picture being decoded.
Also add helper function to surface proxy to propagate that information
outside of libgstvaapi. e.g. plug-in elements or standalone applications.

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
10 years agocodecparsers: update to gst-vaapi-branch commit f90de0a.
Gwenole Beauchesne [Mon, 8 Jul 2013 15:30:30 +0000 (17:30 +0200)]
codecparsers: update to gst-vaapi-branch commit f90de0a.

f90de0a h264: fix calculation of the frame cropping rectangle
535515c h264: parse the cropping rectangle separately

10 years agocodecparsers: update to gst-vaapi-branch commit 0f68a71.
Gwenole Beauchesne [Fri, 5 Jul 2013 17:03:41 +0000 (19:03 +0200)]
codecparsers: update to gst-vaapi-branch commit 0f68a71.

0f68a71 mpeg2: fix video packet header size checks

10 years agompeg2: reset quantization matrices on new sequence headers.
Zhong Cong [Fri, 7 Jun 2013 12:08:43 +0000 (20:08 +0800)]
mpeg2: reset quantization matrices on new sequence headers.

The MPEG-2 standard specifies (6.3.7) that all quantisation matrices
shall be reset to their default values when a Sequence_Header() is
decoded.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
10 years agompeg2: cope with latest codecparser changes.
Gwenole Beauchesne [Fri, 5 Jul 2013 13:49:34 +0000 (15:49 +0200)]
mpeg2: cope with latest codecparser changes.

Fix build with newer MPEG-2 codecparser where GstMpegVideoPacket are
used in individual header parsers. Also use the new slice parsing API.

10 years agocodecparsers: update to gst-vaapi-branch commit dddd182.
Gwenole Beauchesne [Fri, 5 Jul 2013 15:51:26 +0000 (17:51 +0200)]
codecparsers: update to gst-vaapi-branch commit dddd182.

dddd182 mpeg2: add slice header parsing API
94e6228 mpeg2: add sequence scalable extension parsing API
531134f mpeg2: add new API that takes GstMpegVideoPacket arguments
4b135d3 h264: fix the return value type for the SEI palyload parsing methods

10 years agovaapisink: expose the raw video formats in static caps template.
Sreerenj Balachandran [Thu, 27 Jun 2013 09:25:44 +0000 (12:25 +0300)]
vaapisink: expose the raw video formats in static caps template.

Expose all raw video formats in the static caps template since the
vaapisink is supporting raw data. We will get the exact set of formats
supported by the driver dynamically through the _get_caps() routine.

This also fixes an inconsistency wrt. GStreamer 0.10 builds.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
10 years agovaapisink: add "use-glx" property for OpenGL rendering.
Gwenole Beauchesne [Thu, 27 Jun 2013 11:53:46 +0000 (13:53 +0200)]
vaapisink: add "use-glx" property for OpenGL rendering.

Now that VA/GLX capable buffers are generated by default on X11, thus
depending on a VA/GLX display, we stil want to use vaPutSurface() for
rendering since it is faster.

Anyway, OpenGL rendering in vaapisink was only meant for testing and
enabling "fancy" effects to play with. This has no real value. So,
disable OpenGL rendering by default.

10 years agoplugins: try to allocate a GLX display first over an X11 one.
Víctor Manuel Jáquez Leal [Thu, 6 Jun 2013 09:36:03 +0000 (05:36 -0400)]
plugins: try to allocate a GLX display first over an X11 one.

If the gstreamer-vaapi plug-in elements are built with GLX support, then
try to allocate a GstVaapiDisplayGLX first before resorting to a VA/X11
display next.

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

10 years agoconfigure: use GST_PLUGIN_PATH_1_0 instead of GST_PLUGIN_PATH for Gst 1.0.
Lionel Landwerlin [Thu, 25 Apr 2013 16:07:13 +0000 (17:07 +0100)]
configure: use GST_PLUGIN_PATH_1_0 instead of GST_PLUGIN_PATH for Gst 1.0.

jhbuild sets $GST_PLUGIN_PATH_1_0 which overrides $GST_PLUGIN_PATH.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
11 years agoimage: fix wrong check for rect bounds in copy_image().
Wind Yuan [Sat, 27 Apr 2013 07:15:49 +0000 (15:15 +0800)]
image: fix wrong check for rect bounds in copy_image().

11 years agoBump version for development.
Gwenole Beauchesne [Fri, 14 Jun 2013 11:41:14 +0000 (13:41 +0200)]
Bump version for development.

11 years ago0.5.4. 0.5.4
Gwenole Beauchesne [Fri, 14 Jun 2013 09:47:50 +0000 (11:47 +0200)]
0.5.4.

11 years agoNEWS: updates.
Gwenole Beauchesne [Fri, 14 Jun 2013 09:43:46 +0000 (11:43 +0200)]
NEWS: updates.

11 years agoconfigure: always build the MPEG-4 parser.
Gwenole Beauchesne [Fri, 14 Jun 2013 09:39:54 +0000 (11:39 +0200)]
configure: always build the MPEG-4 parser.

Always build the MPEG-4 parser for now as there are also core fixes
included in the parser that cannot be tested for with API checks.