Commit graph

1316 commits

Author SHA1 Message Date
Gwenole Beauchesne
71e5fd536f filter: allow specification of render target regions.
Add support for rendering the source surface to a particular region within
the supplied target surface. The default background color is black.
2013-08-27 18:28:10 +02:00
Gwenole Beauchesne
771071a4e5 decode: fix creation of GLX video buffers for GStreamer 0.10.
Fix creation of GstVaapiVideoBuffer objects (i) to have that type for real;
and (ii) to correctly extract the GstSurfaceConverter from the video buffer
object meta.

This fixes support for cluttersink with GStreamer 0.10 builds.
2013-08-26 17:14:33 +02:00
Gwenole Beauchesne
292b2f51b4 mpeg2: disable video cropping as picture_display_extension() is missing.
Disable video cropping in MPEG-2 codec because it is partially implemented
and actually because nobody implements it that way, and the standard spec
does not specify the display process either anyway.

Most notably, there are two possible use cases for sequence_display_extension()
horizontal_display_size & vertical_display_size: (i) guesstimating the
pixel-aspect-ratio, or (ii) implement some kind of span & scan process
in conjunction with picture_display_extension() information.

https://bugzilla.gnome.org/show_bug.cgi?id=704848
2013-08-26 16:19:01 +02:00
Simon Farnsworth
0ef5979d77 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>
2013-08-26 13:10:33 +02:00
Wind Yuan
e5a50af2ae 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
2013-08-26 13:01:26 +02:00
Guangxin.Xu
92a124f306 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>
2013-08-26 12:56:06 +02:00
Gwenole Beauchesne
d16db58968 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
2013-08-26 11:31:06 +02:00
Gwenole Beauchesne
ed9cc7c8d2 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.
2013-08-23 19:00:38 +02:00
Zhao Halley
d48a18c9f2 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>
2013-08-23 19:00:38 +02:00
Gwenole Beauchesne
96362e6162 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>.
2013-08-23 19:00:38 +02:00
Gwenole Beauchesne
290cc8b7c9 tests: filter: dump supported operations and formats. 2013-08-23 19:00:38 +02:00
Zhao Halley
d7cc1374ed 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>
2013-08-23 19:00:38 +02:00
Zhao Halley
944a7bd077 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>
2013-08-23 19:00:38 +02:00
Zhao Halley
1d222d3b4a 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>
2013-08-23 19:00:38 +02:00
Zhao Halley
a854768a80 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>
2013-08-23 19:00:38 +02:00
Zhao Halley
22f55bd513 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>
2013-08-23 19:00:38 +02:00
Gwenole Beauchesne
81395418e9 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
2013-08-23 19:00:38 +02:00
Gwenole Beauchesne
87c8d28499 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.
2013-08-23 19:00:38 +02:00
Gwenole Beauchesne
f09008a8d1 Add initial infrastructure for video processing.
Add initial API for video processing: only scaling and color format
conversion operations are supported.
2013-08-23 19:00:38 +02:00
Gwenole Beauchesne
f34b6ffc60 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.
2013-08-23 19:00:38 +02:00
Gwenole Beauchesne
8ffe11a9df 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.
2013-08-23 19:00:38 +02:00
Gwenole Beauchesne
53fc8bb4c7 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.
2013-08-23 19:00:38 +02:00
Gwenole Beauchesne
d8ffc2c150 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.
2013-08-23 19:00:38 +02:00
Gwenole Beauchesne
b1085b57d5 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.
2013-08-23 19:00:38 +02:00
Gwenole Beauchesne
dd6a0d87ff tests: image: fix conversion from RGB to YUV.
Fix RGB to YUV conversion to preserve full data range.
2013-08-23 19:00:37 +02:00
Gwenole Beauchesne
73323ba76a 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.
2013-07-26 13:16:57 +02:00
Gwenole Beauchesne
f997f6271f tests: image: add support for packed YUV formats.
Add support for packed YUV 4:2:2 formats, i.e. YUY2 and UYVY.
2013-07-26 13:16:57 +02:00
Gwenole Beauchesne
6e9ce9ae37 tests: image: fix generation of I420/YV12 images.
U/V planes were reversed, thus producing invalid images.
2013-07-26 13:16:57 +02:00
Gwenole Beauchesne
e790722a84 tests: image: fix string representation for GstVideoFormat. 2013-07-26 13:16:52 +02:00
Gwenole Beauchesne
2b0a4a0304 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.
2013-07-26 13:16:52 +02:00
Gwenole Beauchesne
e183ea1290 image: add gst_vaapi_image_copy() helper.
Add gst_vaapi_image_copy() helper function to copy images of same format
and size.
2013-07-26 13:16:52 +02:00
Gwenole Beauchesne
0b1a97cbf9 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.
2013-07-22 15:45:10 +02:00
Gwenole Beauchesne
6f04a52905 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.
2013-07-22 15:45:10 +02:00
Gwenole Beauchesne
17c8f17d06 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.
2013-07-22 15:45:10 +02:00
Gwenole Beauchesne
2e85860c9c tests: simple-decoder: add support for video cropping.
Handle video cropping information attached to a VA surface proxy.
2013-07-22 15:45:10 +02:00
Gwenole Beauchesne
155af03491 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.
2013-07-22 15:45:10 +02:00
Gwenole Beauchesne
0af0849a92 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.
2013-07-22 15:45:10 +02:00
Gwenole Beauchesne
373329e6ff 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.
2013-07-22 15:45:10 +02:00
Gwenole Beauchesne
5eb2cbb5ef 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.
2013-07-22 15:45:10 +02: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
4a8a80061f 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.
2013-07-22 15:22:34 +02:00
Emilio López
b868c6d888 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>
2013-07-18 08:41:28 +02:00
Gwenole Beauchesne
07e890e818 Bump version for development. 2013-07-17 11:07:39 +02:00
Gwenole Beauchesne
f4097931a1 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.
2013-07-15 17:51:51 +02:00
Gwenole Beauchesne
b358651fb3 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.
2013-07-15 17:43:34 +02:00
Gwenole Beauchesne
415e65a980 0.5.5. 2013-07-15 14:47:01 +02:00
Gwenole Beauchesne
7fa4973f8a 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.
2013-07-15 14:42:33 +02:00
Gwenole Beauchesne
abd432d7b1 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.
2013-07-15 14:05:45 +02:00
Gwenole Beauchesne
20db4f2ad9 NEWS: updates. 2013-07-15 14:01:58 +02:00
Gwenole Beauchesne
1fff3a44dd 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
2013-07-15 14:01:06 +02:00