platform/upstream/gstreamer.git
9 years agoplugins: remove gstreamer-0.10 crumbs
Víctor Manuel Jáquez Leal [Fri, 8 May 2015 13:54:09 +0000 (15:54 +0200)]
plugins: remove gstreamer-0.10 crumbs

GstVideoContext was used in gstreamer-0.10, which is not supported anymore.
Still, its definition was still in the code. This patch removes it.

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

9 years agotests: add simple-encoder program
Víctor Manuel Jáquez Leal [Tue, 5 May 2015 11:08:25 +0000 (13:08 +0200)]
tests: add simple-encoder program

This patch adds a simple-encoder test program that uses libgstvaapi for video
encoding to elementary (raw) streams. Input stream is raw YUV in the Y4M
format. That can be from a regular file or standard input when the input
filename is "-".

Usage: simple-encoder [options]* <source>

Options:
--output|-o     output file name
--codec|-c      codec to use for video encoding
--bitrate|-b    desired bitrate (kbps)

By default, and as an initial patch, the encoded stream shall conform to the
minimally supported profile. That is "Constrained Baseline Profile" for H.264
and "Simple Profile" for MPEG-2. Though, those are the defaults to be
generated by libgstvaapi.

You can find Y4M sample files here http://samples.mplayerhq.hu/yuv4mpeg2/

Original-patch-by: Changzhi Wei <changzhix.wei@intel.com>
* general code clean-up
* removed the yuv reader thread
* re-wrote the y4m file parser
* updated used API fixed some wrong usage
* fixed a lot of memory leaks
* added the bitrate setting
* keep fps' numerator and denominator
* simplified the thread control
* removed custom logging and use glib

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=719528

9 years agolibs: trivial documentation fix
Víctor Manuel Jáquez Leal [Tue, 5 May 2015 11:02:19 +0000 (13:02 +0200)]
libs: trivial documentation fix

GST_VAAPI_ENCODER_STATUS_NO_SURFACE and GST_VAAPI_ENCODER_STATUS_NO_BUFFER
are not errors, so they do not have the ERROR namespace.

This patch fixes this typo in documentation.

9 years agowindow: Correct prototype to match implementation
Simon Farnsworth [Sun, 15 Feb 2015 15:01:03 +0000 (15:01 +0000)]
window: Correct prototype to match implementation

On s390x, guintptr and GstVaapiID are not compatible types. The
implementation of gst_vaapi_window_new_internal() and all its callers
seem to assume that its third argument is a GstVaapiID, while the
header gives it guintptr type.

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

9 years agovaapidecode: add guards for disabled codecs.
Gwenole Beauchesne [Mon, 4 May 2015 12:24:43 +0000 (14:24 +0200)]
vaapidecode: add guards for disabled codecs.

Fix link when building plugin elements without HEVC support. e.g. don't
try to call into gst_vaapi_decoder_h265_set_alignment() if there is no
support HEVC enabled in libgstvaapi.

Also, drop disabled codecs from static template caps. Add the missing
HEVC static template caps into vaapidecodebin too.

9 years agobuild: upgrade glib dependency to 2.32
Víctor Manuel Jáquez Leal [Thu, 30 Apr 2015 11:29:48 +0000 (13:29 +0200)]
build: upgrade glib dependency to 2.32

Since bug #745728 was fixed the oldest supported version of GStreamer is
1.2. That GStreamer release requires glib 2.32, so we can upgrade our
requirement too.

This patch changes the required version of glib in configure.ac and removes
the hacks in glibcompat.h

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

9 years agoplugins: check if the pool config is already set
Víctor Manuel Jáquez Leal [Thu, 30 Apr 2015 11:21:08 +0000 (13:21 +0200)]
plugins: check if the pool config is already set

In commit 97b768, a regression for GStreamer 1.2 was introduced:

GStreamer 1.2 doesn't check, in gst_buffer_pool_set_config() if the
config option is already set. This patch adds an inline function to
first verify if the option is not in the pool config berfore add it.

9 years agovaapipostproc: tune up a couple of log messages
Víctor Manuel Jáquez Leal [Wed, 29 Apr 2015 10:39:50 +0000 (12:39 +0200)]
vaapipostproc: tune up a couple of log messages

In order to reduce the noise, the query type log was downgrade from INFO to
DEBUG, and the shared display address log message is assigned to the object.

9 years agoplugins: check gst_buffer_pool_set_config()
Víctor Manuel Jáquez Leal [Wed, 29 Apr 2015 10:27:43 +0000 (12:27 +0200)]
plugins: check gst_buffer_pool_set_config()

Check the return value of gst_buffer_pool_set_config(). If it fails an error
message is posted in the bus.

9 years agoplugins: more specific log message
Víctor Manuel Jáquez Leal [Wed, 29 Apr 2015 10:24:52 +0000 (12:24 +0200)]
plugins: more specific log message

Be more specific in the log message about the reason of creating a new pool.

9 years agoplugins: delete unused variable
Víctor Manuel Jáquez Leal [Wed, 29 Apr 2015 10:22:29 +0000 (12:22 +0200)]
plugins: delete unused variable

need_pool is a boolean variable extracted from the allocation query, but it is
not used afterwards.

9 years agovaapipluginbase: Update the pool if there was no pool in the downstream reply
Olivier Crete [Mon, 27 Apr 2015 23:21:12 +0000 (19:21 -0400)]
vaapipluginbase: Update the pool if there was no pool in the downstream reply

Fix regression introduced by bd866479, the query after decide_allocation()
always needs a pool in the first slot.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=748559

9 years agovideopool: Free members before chaining up finalize
Olivier Crete [Tue, 28 Apr 2015 00:50:19 +0000 (20:50 -0400)]
videopool: Free members before chaining up finalize

The finalize function in GObject frees the object memory, so
everything else needs to have been freed before.

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

9 years agowayland: don't leak the registry proxy
Olivier Crete [Tue, 28 Apr 2015 00:31:50 +0000 (20:31 -0400)]
wayland: don't leak the registry proxy

Release the registry proxy when closing the display.

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

9 years agowayland: refactor _sync() method and rename callback
Víctor Manuel Jáquez Leal [Tue, 21 Apr 2015 15:17:06 +0000 (17:17 +0200)]
wayland: refactor _sync() method and rename callback

This patch only intends to improve readability: in the method
gst_vaapi_window_wayland_sync() the if/do instructions are squashed into a
single while loop.

Also renames the frame_redraw_callback() callback into frame_done_callback(),
which is a bit more aligned to Wayland API.

9 years agowayland: free frame in buffer release callback
Michael Olbrich [Tue, 3 Feb 2015 15:52:06 +0000 (16:52 +0100)]
wayland: free frame in buffer release callback

The Wayland compositor may still use the buffer when the frame done
callback is called.

This patch destroys the frame (which contains the buffer) until the
release callback is called. The draw termination callback only controls
the display queue dispatching.

Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
https://bugzilla.gnome.org/show_bug.cgi?id=747492

9 years agovaapidecode: refactor gst_vaapidecode_internal_flush()
Víctor Manuel Jáquez Leal [Tue, 21 Apr 2015 08:00:36 +0000 (10:00 +0200)]
vaapidecode: refactor gst_vaapidecode_internal_flush()

This a cosmetic refactor: gst_vaapidecode_internal_flush() removes its only
label; gst_vaapidecode_finish() is more readable and gst_vaapidecode_purge()
shares the same error message of gst_vaapidecode_internal_flush() when flush
fails.

9 years agovaapidecode: refactor gst_vaapidecode_destroy()
Víctor Manuel Jáquez Leal [Mon, 20 Apr 2015 11:27:27 +0000 (13:27 +0200)]
vaapidecode: refactor gst_vaapidecode_destroy()

Add the method gst_vaapidecode_purge(). This method releases the
flushed frames from the decoder.

This new method add more readablity to gst_vaapidecode_destroy()

9 years agovaapidecode: Tell the base class about released frames on close
Olivier Crete [Thu, 16 Apr 2015 16:53:18 +0000 (12:53 -0400)]
vaapidecode: Tell the base class about released frames on close

The base class needs to be informed about frames that were still queued
in the decoder on release, otherwise they are leaked.

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

9 years agovaapidecode: reduce logging noise
Víctor Manuel Jáquez Leal [Sun, 19 Apr 2015 09:19:03 +0000 (11:19 +0200)]
vaapidecode: reduce logging noise

When a frame is rejected by downstream, the message is logged twice. This
patch removes one of those logging messages.

Also, the reject of a frame doesn't mean an alarming error. This patch demotes
the log message from error to info.

9 years agovaapidecode: Use the GstVideoDecoder error reporting function
Olivier Crete [Fri, 17 Apr 2015 00:18:13 +0000 (20:18 -0400)]
vaapidecode: Use the GstVideoDecoder error reporting function

This way, the decoder won't stop on the first decoding error,
in most cases it can recover after some glitchiness.

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

9 years agovaapipluginbase: The allocation query can return without a pool
Olivier Crete [Fri, 17 Apr 2015 19:10:35 +0000 (19:10 +0000)]
vaapipluginbase: The allocation query can return without a pool

It is possible to return the min/max/size without actually providing
a pool. This way the source knows how many buffers downstream needs.

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

9 years agoplugins: Add h265 videoparser element "vaapiparse_h265"
Sreerenj Balachandran [Fri, 17 Apr 2015 13:45:22 +0000 (16:45 +0300)]
plugins: Add h265 videoparser element "vaapiparse_h265"

This is a mirror of h265parse element in upstream gst-plugins-bad.
There could be additional patches but all should go to upstream.
This is for making development faster.

Note: vaapiparse_h265 will get build only for GStreamer version >= 1.4

9 years agocodecparsers: Update to gst-vaapi-branch commit 43a0368
Sreerenj Balachandran [Fri, 17 Apr 2015 12:44:04 +0000 (15:44 +0300)]
codecparsers: Update to gst-vaapi-branch commit 43a0368

45f1c28: codecparser: h265: Fix nal unit size checking
f25987b: codecparser: h265: Calculate crop rectangle dimensions
639573a: codecparser: h265: Fix parsing multiple SEI messages in a single SEI Nal
4c8ec41: Add h265 videoparser plugin source files

9 years agoautogen: drop videoutils submodule.
Gwenole Beauchesne [Fri, 17 Apr 2015 08:10:10 +0000 (10:10 +0200)]
autogen: drop videoutils submodule.

9 years agodecoder: hevc: cosmetics.
Gwenole Beauchesne [Fri, 17 Apr 2015 08:36:25 +0000 (10:36 +0200)]
decoder: hevc: cosmetics.

Mostly coding style updates. Avoid integer signess inconsistencies.
Optimize dpb_find_lowest_poc() to align with original h264's decoder.

9 years agodecoder: hevc: Add Support for tiled video decoding
Sreerenj Balachandran [Thu, 16 Apr 2015 11:13:59 +0000 (14:13 +0300)]
decoder: hevc: Add Support for tiled video decoding

Based up on the value of uniform_spacing_flag in Picture Parameter Set,
the tile column width and tile row height should be calculated.
Equations: 6-1, 6-2
Tiled video Descriptions: 7.3.2.3, 7.4.3.3

9 years agodecoder: hevc: Fix decoding when there are RASL pictures present.
Sreerenj Balachandran [Thu, 16 Apr 2015 11:13:21 +0000 (14:13 +0300)]
decoder: hevc: Fix decoding when there are RASL pictures present.

-- Set NoRaslOutputFlag based on EOS and EOB Nal units
-- Fix PicOutputFlag setting for RASL picture
-- Fix prev_poc_lsb/prev_poc_msb calculation
-- Drop the RASL frames if NoRaslOutputFlag is TRUE for the associated IRAP picture
-- Fixed couple of crashes and added cosmetics

9 years agodisplay: drm: fix race condition setting device type
Martin Sherburn [Tue, 14 Apr 2015 09:54:54 +0000 (10:54 +0100)]
display: drm: fix race condition setting device type

There is a race condition where g_drm_device_type can be left set to
DRM_DEVICE_RENDERNODES when it shouldn't.

If thread 1 comes in and falls into the last else statement setting up both
RENDERNODES and LEGACY types. And begins to process the first type (RENDERNODES),
it sets g_drm_device_type = RENDERNODES.

Now when thread 2 comes in and sees g_drm_device_type is RENDERNODES, it queues
up that type to be tried but then encounters the lock and has to wait until the
first thread finishes. Once the lock is acquired it will then proceed to ONLY try
RENDERNODES and fail it. But it doesn't try LEGACY. And from then on, all future
attempts will only try RENDERNODES.

So to avoid this situation I have simply moved the acquisition of the lock higher
up in the attached patch.

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

9 years agovaapipostproc: Don't create filter on caps query
Olivier Crete [Wed, 15 Apr 2015 19:26:12 +0000 (15:26 -0400)]
vaapipostproc: Don't create filter on caps query

The problem with this is that creating the filter causes the display to
be selected, and the caps query happens while linking the element. So,
if the downstream or upstream element is using a specific display
object, it won't be propagated correctly to the postproc as it already
has a display at this point.

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

9 years agovideopool: Release lock while allocating new object
Olivier Crete [Wed, 15 Apr 2015 19:20:17 +0000 (15:20 -0400)]
videopool: Release lock while allocating new object

The video pool can be accessed with the display lock held, for example,
when releasing a buffer from inside vaapisink_render, but allocating
a new object can may also take the display lock. Which means a possible
deadlock.

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

9 years agovaapisink: use GstVideoSink vmethod show_frame()
Víctor Manuel Jáquez Leal [Wed, 15 Apr 2015 15:26:43 +0000 (17:26 +0200)]
vaapisink: use GstVideoSink vmethod show_frame()

vaapisink inherits from GstVideoSink, in order to use its functionality (such
as ::show-preroll-frame property), we should use its vmethod show_frame(),
rather than call ourselves render() and preroll().

9 years agovaapisink: add 'handoff' signal
Víctor Manuel Jáquez Leal [Wed, 15 Apr 2015 16:16:47 +0000 (18:16 +0200)]
vaapisink: add 'handoff' signal

This patch adds the signal ::handoff and the property signal-handoffs. If the
property is set TRUE, the signal ::handoff is emitted just after the buffer is
rendered.

Based on Zhao Halley <halley.zhao@intel.com>

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

9 years agoHEVC: silence the compiler
Víctor Manuel Jáquez Leal [Tue, 14 Apr 2015 08:17:16 +0000 (10:17 +0200)]
HEVC: silence the compiler

Fixed a couple of clang complains.

9 years agowayland: destroy vpp buffer pool on resize
Michael Olbrich [Mon, 2 Feb 2015 15:42:43 +0000 (16:42 +0100)]
wayland: destroy vpp buffer pool on resize

Otherwise the old buffers with the old size are used.

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

9 years agobuild: don't compile HEVC if not supported
Víctor Manuel Jáquez Leal [Tue, 14 Apr 2015 08:08:47 +0000 (10:08 +0200)]
build: don't compile HEVC if not supported

HEVC decoding was added recently libva-1.5.

This patch avoids HEVC decoding support in libgstvaapi if it is not available
in the installed libva.

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

9 years agovaapidecode: Update Author name in plugin metadata
Sreerenj Balachandran [Mon, 13 Apr 2015 13:04:59 +0000 (16:04 +0300)]
vaapidecode: Update Author name in plugin metadata

9 years agoplugins: Add HEVC decoder
Sreerenj Balachandran [Mon, 13 Apr 2015 12:43:30 +0000 (15:43 +0300)]
plugins: Add HEVC decoder

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agoHEVC: Add HEVC(h265) decoder to core libgstvaapi
Sreerenj Balachandran [Mon, 13 Apr 2015 12:41:45 +0000 (15:41 +0300)]
HEVC: Add HEVC(h265) decoder to core libgstvaapi

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agoHEVC: Add codec utility methods to core libgstvaapi
Sreerenj Balachandran [Mon, 13 Apr 2015 11:53:46 +0000 (14:53 +0300)]
HEVC: Add codec utility methods to core libgstvaapi

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agoHEVC: gstvaapiprofile: Add profile definitions
Sreerenj Balachandran [Mon, 13 Apr 2015 11:52:53 +0000 (14:52 +0300)]
HEVC: gstvaapiprofile: Add profile definitions

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agoHEVC: build: Check availability of h265 decoder APIs
Sreerenj Balachandran [Mon, 13 Apr 2015 11:52:14 +0000 (14:52 +0300)]
HEVC: build: Check availability of h265 decoder APIs

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agoHEVC: Allow to build h265 codecparser internally
Sreerenj Balachandran [Mon, 13 Apr 2015 11:51:51 +0000 (14:51 +0300)]
HEVC: Allow to build h265 codecparser internally

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agoguard buffer export API if not available
Víctor Manuel Jáquez Leal [Wed, 8 Apr 2015 16:05:20 +0000 (18:05 +0200)]
guard buffer export API if not available

The support for buffer exports in VA-API was added in version 0.36. These
interfaces are for interop with EGL, OpenCL, etc.

GStreamer-VAAPI uses it for a dmabuf memory allocator. Though, gstreamer-vaapi
has to support VA-API versions ranging from 0.30.4, which doesn't support it.

This patch guards all the buffer exports handling (and dmabuf allocator) if
the detected VA-API version is below 0.36.

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

9 years agocodecparsers: Update to gst-vaapi-branch commit 9bc72b0
Sreerenj Balachandran [Mon, 13 Apr 2015 08:29:35 +0000 (11:29 +0300)]
codecparsers: Update to gst-vaapi-branch commit 9bc72b0

767bf22: codecparsers: h265: add helpers to convert quantization matrices
71c8e93: codecparser: h265: skip byte alignment bits while parsing slice header
3bf0355: codecparsre: h265: Fix the NumDeltaPocs calculation
10e2087: codecparser: h265: Fix the NumPocTotalCurr calculatio
2d753b8: codecparser: h265: Fix nal size calculation for EOS and EOB

9 years agovaapidecode: unref video codec frame twice
Michael Olbrich [Thu, 11 Dec 2014 11:02:38 +0000 (12:02 +0100)]
vaapidecode: unref video codec frame twice

We get one reference when the frame is passed to decode_handle_frame()
and create another one in gst_vaapi_decoder_push_frame().

Usually the frame is handled in gst_vaapidecode_push_decoded_frame().
Here the frame is always released twice:
gst_video_decoder_finish_frame() + gst_video_codec_frame_unref() or
gst_video_decoder_drop_frame() + gst_video_codec_frame_unref().

In gst_vaapidecode_reset_full() both references to the frame must be
released as well.

Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
https://bugzilla.gnome.org/show_bug.cgi?id=743226

9 years agolibs: remove unused variables
Víctor Manuel Jáquez Leal [Wed, 8 Apr 2015 16:20:34 +0000 (18:20 +0200)]
libs: remove unused variables

clang reports these unused variables. Let's get rid of them.

This patch is a missing part of commit c82e5173

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

9 years agodecoder: mpeg4: remove an spurious comparison
Víctor Manuel Jáquez Leal [Fri, 3 Apr 2015 18:38:07 +0000 (20:38 +0200)]
decoder: mpeg4: remove an spurious comparison

The member size in GstMpeg4Packet is gsize which is unsigned, which cannot be
less than zero. Hence this pre-condition test is a no-op. This patch removes
that code.

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

9 years agoencoder: h264: casts slice_param->slice_type
Víctor Manuel Jáquez Leal [Fri, 3 Apr 2015 18:33:44 +0000 (20:33 +0200)]
encoder: h264: casts slice_param->slice_type

slice_type in slice_param is defined as (char *), but it is compared against a
signed integer. clang complains about this comparison.

This patch casts the variable.

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

9 years agoencoder: avoid GstVaapiCodedBuffer redefinition
Víctor Manuel Jáquez Leal [Fri, 3 Apr 2015 18:31:47 +0000 (20:31 +0200)]
encoder: avoid GstVaapiCodedBuffer redefinition

The symbol GstVaapiCodedBuffer is already defined in
gst-libs/gst/vaapi/gstvaapicodedbuffer.h which is loaded, at the end, by
gstvaapiencoder_objects.h. Clang complains about the symbol re-definition.

This patch removes that redefinition.

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

9 years agolibs: remove unused variables
Víctor Manuel Jáquez Leal [Fri, 3 Apr 2015 18:28:22 +0000 (20:28 +0200)]
libs: remove unused variables

clang reports these unused variables. Let's get rid of them.

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

9 years agoencoder: mpeg2: use fabsf() instead of abs()
Víctor Manuel Jáquez Leal [Fri, 3 Apr 2015 18:27:24 +0000 (20:27 +0200)]
encoder: mpeg2: use fabsf() instead of abs()

The member value in frame_rate_tab is float, the result of the abs() function
should be float too. But abs() only manages integers.

This patch replaces abs() with fabsf() to handle correctly the possible floats
values.

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

9 years agodecoder: cast GST_VAAPI_DECODER_STATUS_DROP_FRAME
Víctor Manuel Jáquez Leal [Fri, 3 Apr 2015 18:02:29 +0000 (20:02 +0200)]
decoder: cast GST_VAAPI_DECODER_STATUS_DROP_FRAME

Since GST_VAAPI_DECODER_STATUS_DROP_FRAME is not part of the enum
GstVaapiDecoderStatus, we need to cast it to avoid compiler complains.

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

9 years agoUpdate README
Sreerenj Balachandran [Fri, 3 Apr 2015 21:40:29 +0000 (00:40 +0300)]
Update README

9 years agoChanging source code download links from https://gitorious to https://github
Sreerenj Balachandran [Fri, 3 Apr 2015 21:06:56 +0000 (00:06 +0300)]
Changing source code download links from https://gitorious  to https://github

-- gitmodules: Change gstreamer-codecparsers submodule source download link
-- README: Change the gstreamer-vaapi webpage link

9 years agocodecparsers: update to gst-vaapi-branch commit 1f792e4
Sreerenj Balachandran [Fri, 3 Apr 2015 20:30:24 +0000 (23:30 +0300)]
codecparsers: update to gst-vaapi-branch commit 1f792e4

87f4a7e: bytereader: add gst_byte_reader_peek_sub_reader() and _get_sub_reader()
7d8ba7a: bytereader: use unchecked inline variant for get_remaining in more places
2528ea6: bytereader: add gst_byte_reader_masked_scan_uint32_peek
2b92a67: h264parse: reset the parser information when caps changes
05eee86: codecparsers: Indent file
e27a38b: codecparsers: Add READ_UE_MAX macro
2036471: Constify some static arrays everywhere

9 years agoRemove the gstvaapivideoconverter_*.c source files missed in commit 51b1e4a
Sreerenj Balachandran [Fri, 3 Apr 2015 14:45:08 +0000 (17:45 +0300)]
Remove the gstvaapivideoconverter_*.c source files missed in commit 51b1e4a

9 years agoRemoval of gstreamer-1.0 support
Víctor Manuel Jáquez Leal [Fri, 3 Apr 2015 14:09:08 +0000 (17:09 +0300)]
Removal of gstreamer-1.0 support

The support for GStreamer 1.0 has been obsoleted in 0.5.10 release.
GStreamer 1.2 is the a minimal requirement for building the gstreamer-vaapi.

This patch removes all the pre-processor conditional code compilation guarded
for gstreamer-1.0.

Thus, all the video converters were removed too.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agoupdate and move gstcompat.h
Víctor Manuel Jáquez Leal [Fri, 3 Apr 2015 14:08:30 +0000 (17:08 +0300)]
update and move gstcompat.h

The purpose of gstcompat.h is to couple the API differences among
gstreamer-1.0 and gstreamer-0.10. Since gstreamer-0.10 is obsolete, the code
in this compatibility layer shall be removed.

Nevertheless, the gstcompat.h header should be kept, if new incompatibilites
appear in the future, but it shall live in gst/vaapi, not in gst-libs.

This patch removes the crumbs defined gstcompat.h and moves it to gst/vaapi.
In order to avoid layer violations, gstcompat.h includes sysdeps.h and all
the includes in gst/vaapi of sysdeps.h are replaced with gstcompat.h

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agoautotools: remove gstreamer-1.0 support
Víctor Manuel Jáquez Leal [Fri, 3 Apr 2015 14:05:45 +0000 (17:05 +0300)]
autotools: remove gstreamer-1.0 support

This patch only removes the support of gstreamer-1.0 in the autotools
scripts. No other files are touched.

In the automake file all the converters were deprecated.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agoRemove the gstreamer-videoutils submodule
Sreerenj Balachandran [Fri, 3 Apr 2015 14:03:38 +0000 (17:03 +0300)]
Remove the gstreamer-videoutils submodule

9 years agoRemove libgstvaapi-videoutils.so
Víctor Manuel Jáquez Leal [Fri, 3 Apr 2015 14:01:45 +0000 (17:01 +0300)]
Remove libgstvaapi-videoutils.so

This library was intended to add the base classes for video decoders which
where not included in gstreamer-0.10.

Since the support of gstreamer-0.10 is deprecated those classes are not
required, thus the whole library is removed.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
9 years agoRemove HAVE_GST_VIDEO_OVERLAY_HWCAPS macro
Víctor Manuel Jáquez Leal [Fri, 3 Apr 2015 13:55:43 +0000 (16:55 +0300)]
Remove HAVE_GST_VIDEO_OVERLAY_HWCAPS macro

This macro guarded the use of HAVE_GST_VIDEO_OVERLAY_HWCAPS, which was not
defined before gstreamer 0.10.35. Since the support of gstreamer-0.10 is
deprecated these guards are not required.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
9 years agoRemoval of gstreamer-0.10 support
Víctor Manuel Jáquez Leal [Fri, 3 Apr 2015 13:55:27 +0000 (16:55 +0300)]
Removal of gstreamer-0.10 support

This patch removes all the pre-processor conditional code compilation guarded
for gstreamer-0.10.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
9 years agoautotools: remove gstreamer-0.10 support
Víctor Manuel Jáquez Leal [Fri, 3 Apr 2015 13:54:54 +0000 (16:54 +0300)]
autotools: remove gstreamer-0.10 support

This patch only removes the support of gstreamer-0.10 in the autotools
scripts. No other files are touched.

The configuration parameter --gstreamer-api was deleted since now it is always
auto-detected.

The verification of vmethod query in GstBaseSinkClass was removed since it was
added in gstreamer 0.10.35. The same case for GstVideoOverlayComposition and
its format flags.

The precious variable GST_PLUGIN_PATH was removed, while GST_PLUGIN_PATH_1_0
remained.

The automake files were changed accordingly.

Removed, in debian/control, the vaapiupload and vaapidownload descriptions.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
9 years agovaapidecode: add drain() vmethod
Víctor Manuel Jáquez Leal [Mon, 16 Mar 2015 21:38:18 +0000 (23:38 +0200)]
vaapidecode: add drain() vmethod

In GStremer v1.6 a new vmethod drain() was added in GstVideoDecoder
class. This patch implements this new method.

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

Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agovaapidecode: remove vmethod reset()
Víctor Manuel Jáquez Leal [Mon, 16 Mar 2015 21:37:29 +0000 (23:37 +0200)]
vaapidecode: remove vmethod reset()

Since in bug #745728 the support for GStreamer 1.0 is going to be dropped,
this patch removes the method reset() which was deprecated in GStreamer 1.2.

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

Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agovaapidecode: handle flush() vmethod
Víctor Manuel Jáquez Leal [Mon, 16 Mar 2015 21:36:33 +0000 (23:36 +0200)]
vaapidecode: handle flush() vmethod

Since GStreamer 1.2 the vmethod reset() in GstVideoDecoderClass was deprecated
and flush() was added.

This patch set the vmethod flush() if the installed GStreamer version is 1.2 or
superior. Otherwise, reset() is set.

v2: 1) In order to avoid symbol collision, the old method gst_vaapidecode_flush()
       was renamed to gst_vaapidecode_internal_flush().
    2) The new vmethod flush() always do a hard full reset.
v3: 1) Call gst_vaapidecode_internal_flush() first in flush() vmethod, in order to
       gather all collected data with  gst_video_decoder_have_frame()

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

Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agovaapidecode: call the correct query function
Víctor Manuel Jáquez Leal [Mon, 16 Mar 2015 21:10:53 +0000 (23:10 +0200)]
vaapidecode: call the correct query function

In commit 2f8c115 (vaapidecode: use the query virtual methods in 1.4)
a bug was introduced: when calling the parent's query function of the
src pad, the one of the sink pad is called instead. This patch fixes
this issue.

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

9 years agogitmodules: Use https:// url instead of git:// for submodules.
Sreerenj Balachandran [Sat, 14 Mar 2015 22:36:45 +0000 (00:36 +0200)]
gitmodules: Use https:// url instead of git:// for submodules.

Gitorious is failing to clone repositories over git:// url.

9 years agovaapidisplay: mark X11 display as compatible with EGL
Julien Isorce [Sat, 14 Mar 2015 20:12:19 +0000 (22:12 +0200)]
vaapidisplay: mark X11 display as compatible with EGL

GST_GL_WINDOW=x11 GST_GL_API=gles2 GST_GL_PLATFORM=egl
gst-launch-1.0 ... ! vaapidecode ! glimagesink

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

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
9 years agovaapidecode: Don't crash if a buffer outlives the decoder
Olivier Crete [Fri, 6 Mar 2015 13:20:01 +0000 (15:20 +0200)]
vaapidecode: Don't crash if a buffer outlives the decoder

Sometimes, for example, when switching video streams but keeping
the same sink, the surface will be released after the decoder is
stopped and replaced. This caused a crash because the release
callback was called on an invalid pointer.
The patch adding an additional reference to the decoder object in the buffer.

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

Signed-off-by: Olivier Crete <olivier.crete@collabora.com>
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agovaapidecode: clean-ups (indentation, drop unused variables)
Sreerenj Balachandran [Fri, 6 Mar 2015 12:31:21 +0000 (14:31 +0200)]
vaapidecode: clean-ups (indentation, drop unused variables)

9 years agovaapidecode: use the query virtual methods in 1.4
Víctor Manuel Jáquez Leal [Fri, 6 Mar 2015 12:09:22 +0000 (14:09 +0200)]
vaapidecode: use the query virtual methods in 1.4

GstVideoDecoder, the base class of vaapidecode, added support for
pad queries as virtual methods. This patch enables the use of that
support, while keeping support for lower versions of gstreamer.

This patch is important because GstVideoDecoder takes care of other
queries that might be important in the pipeline managing.

v2: 1) rebase to current master
    2) fix indentation with gst-indent
    3) simplify the patch layout
    4) fix the context query
    5) initialise the filter to NULL
    6) improve the query log message for gst-1.2

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

9 years agovaapipostproc: always activate buffer pool
Víctor Manuel Jáquez Leal [Fri, 6 Mar 2015 10:16:17 +0000 (12:16 +0200)]
vaapipostproc: always activate buffer pool

The vaapipostproc has a proxy flag to know if the the buffer pool is
already active. But this fails in some situations where it is needed
to renegotiate the buffer pool.

This patch removes that flag so the renegotiation is done whenever is
required.

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

9 years agovaapisink: fix minor memory leak in debug mode.
Gwenole Beauchesne [Mon, 2 Mar 2015 16:04:20 +0000 (17:04 +0100)]
vaapisink: fix minor memory leak in debug mode.

The gst_video_colorimetry_to_string() function returns a newly created
string that represents the GstVideoColorimetry value. So, that needs
to be released after usage, in e.g. GST_DEBUG().

9 years agovaapidecodebin: Avoid usage of "__" prefix in macro names
Sreerenj Balachandran [Tue, 3 Mar 2015 10:37:41 +0000 (12:37 +0200)]
vaapidecodebin: Avoid usage of "__" prefix in macro names

Avoiding "__" prefix usage in Header File Guards as per
C standard recommendation.

9 years agoplugins: Disable vaapidecodebin for GStreamer < 1.4
Sreerenj Balachandran [Tue, 3 Mar 2015 10:31:11 +0000 (12:31 +0200)]
plugins: Disable vaapidecodebin for GStreamer < 1.4

There are autoplugging issues in GStreamer-1.2.
Lets disable vaapidecodebin untill we get some workarounds for this.

9 years agoplugins: Add a vaapidecodebin element
Sreerenj Balachandran [Mon, 2 Mar 2015 13:19:40 +0000 (15:19 +0200)]
plugins: Add a vaapidecodebin element

Add a "vaapidecodebin" element to vaapi plugins.

Child Elements: "vaapidecode ! queue ! vaapipostproc"

The Reasons for implementing a new bin element:

-- Help to Autoplug Hardware Accelerated Video Postprocessing element in playbin
with out any dependency to upstream gstreamer.
This is to overcome the *unacceptable* delay in upstream gstreamer to get new
features in. Eg: https://bugzilla.gnome.org/show_bug.cgi?id=687182.
Also customers using older gstreamer versions (1.2 and 1.4) will get the
benefit of autoplugging, hardware accelerated deinterlacing support etc.

-- Help to maintain a single thread implementation in vaapidecode.
This will result a dead-lock free vaapidecode in most of the cases.
More details here: https://bugzilla.gnome.org/show_bug.cgi?id=742605

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

9 years agovaapidecode: re-indent (gst-indent) gstvaapidecode.c
Sreerenj Balachandran [Mon, 2 Mar 2015 12:59:16 +0000 (14:59 +0200)]
vaapidecode: re-indent (gst-indent) gstvaapidecode.c

9 years agovaapidecode: Switch back to Single thread implementation
Simon Farnsworth [Mon, 2 Mar 2015 12:46:38 +0000 (14:46 +0200)]
vaapidecode: Switch back to Single thread implementation

Because the decoder uses the thread from handle_frame() to decode a frame,
the src pad task creates an unsolveable AB-BA deadlock between
handle_frame() waiting for a free surface and decode_loop() pushing
decoded frames out.

Instead, have handle_frame() take responsibility for pushing surfaces,
and remove the deadlock completely. If you need a separate thread
downstream, you can insert a queue between vaapidecode and its downstream
to get one.

Another justification for the single thread implementation is,
there are two many point of locking in gstreamer-vaapi's current
implementation which can lead to deadlocks.

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

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agoplugins: fix detection of upstream v4l2src element.
Gwenole Beauchesne [Mon, 2 Mar 2015 12:28:41 +0000 (13:28 +0100)]
plugins: fix detection of upstream v4l2src element.

Improve check for upstream element that requires DMABUF buffer pool,
e.g. v4l2src element. In particular, make sure to traverse through
any additional capsfilter for instance.

Note: the traversal to the top-most upstream element could be made
more generic, but we are insofar only interested in supporting pipes
similar to v4l2src or v4l2src ! capsfilter, e.g. with an explicit
specification for a desired video camera format, or resolution.

9 years agoplugins: fix allocation of DMABUF memory.
Gwenole Beauchesne [Mon, 2 Mar 2015 10:12:53 +0000 (11:12 +0100)]
plugins: fix allocation of DMABUF memory.

The dmabuf allocator would close the DMABUF handle passed in the init
function gst_dmabuf_allocator_alloc(). So, we need to dup() it so that
to avoid a double close, ultimately in the underlying driver that owns
the DMABUF handle.

9 years agovaapidecode: keep src caps and output state in sync
Víctor Manuel Jáquez Leal [Thu, 26 Feb 2015 10:28:02 +0000 (12:28 +0200)]
vaapidecode: keep src caps and output state in sync

vaapidecode keeps an output state that use the format
GST_VIDEO_FORMAT_ENCODED, while it crafts a different src caps
for a correct negotiation.

I don't see the rational behind this decoupling, it looks like
unnecessary complexity. This patch simplify this logic keeping
in sync the output state and the src caps.

This patch improves the readability of the function
gst_vaapidecode_update_src_caps() and simplify its logic. Also,
the patch validates if the buffer pool has the configuration for
the GL texture upload meta, in order to set the caps feature
meta:GLTextureUpload. Otherwise, the I420 format is set back.

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

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agovaapidecode: upload meta only if feature and allocation
Víctor Manuel Jáquez Leal [Thu, 26 Feb 2015 10:26:54 +0000 (12:26 +0200)]
vaapidecode: upload meta only if feature and allocation

When vaapidecode finishes the decoding of a frame and pushes it,
if, in the decide_allocation() method, it is determined if the
next element supports the GL texture upload meta feature, the
decoder adds the buffer's meta.

Nonetheless, in the same spirit of the commit 71d3ce4d, the
determination if the next element supports the GL texture upload
meta needs to check both the preferred caps feature *and* if the
allocation query request the API type.

This patch, first removes the unused variable need_pool, and
determines the attribute has_texture_upload_meta using the
preferred caps feature *and* the allocation query.

Also, the feature passed to GstVaapPluginBase is not longer
determined by has_texture_upload_meta, but by the computed
preferred one.

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

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agovaapidecode: delayed src caps negotiation
Víctor Manuel Jáquez Leal [Thu, 26 Feb 2015 10:24:55 +0000 (12:24 +0200)]
vaapidecode: delayed src caps negotiation

Currently the src caps are set immediately after the sink caps are set, but in
that moment the pipeline might not fully constructed and the video sink has
not negotiated its supported caps and features. As a consequence, in many cases
of playback, the least optimized caps feature is forced. This is partially the
responsible of bug #744039.

Also, vaapidecode doesn't attend the reconfigure events from downstream,
which is a problem too, since the video sink can be changed with different
caps features.

This patch delays the src caps, setting them until the first frame arrives to
the decoder, assuming until that very moment the whole pipeline is already
negotiated. Particularly, it checks if the src pad needs to be reconfigured,
as a consequence of a reconfiguration event from downstream.

A key part of this patch is the new GstVaapiCapsFeature
GST_VAAPI_CAPS_FEATURE_NOT_NEGOTIATED, which is returned when the src pad
doesn't have a peer yet. Also, for a better report of the caps allowed
through the src pad and its peer, this patch uses gst_pad_get_allowed_caps()
instead of gst_pad_peer_query_caps() when looking for the preferred feature.

v3: move the input_state unref to close(), since videodecoder resets at
some events such as navigation.

v4: a) the state_changed() callback replaces the input_state if the media
changed, so this case is also handled.
    b) since the parameter ref_state in gst_vaapidecode_update_src_caps() is
always the input_state, the parameter were removed.
    c) there were a lot of repeated code handling the input_state, so I
refactored it with the function gst_vaapi_decode_input_state_replace().

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

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agoencoder: h264: add support for more than 2 views
Sreerenj Balachandran [Tue, 24 Feb 2015 15:14:33 +0000 (17:14 +0200)]
encoder: h264: add support for more than 2 views

Add support for H.264 MVC Multiview High profile encoding with
more than 2 views. All views within the same accesss unit are
provided in increasing order of view order index (VOIdx).

Upto 10 view are supported for now.

A new property "view-ids" has been provided for the plugins to
set the view ids (which is an array of guint values) to be used
for mvc encoding.

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

9 years agoplugins: upload meta only if feature and allocation
Víctor Manuel Jáquez Leal [Mon, 23 Feb 2015 15:55:36 +0000 (16:55 +0100)]
plugins: upload meta only if feature and allocation

Working on bug #743687, I realized that vaapidecode always adds to its buffer
pool the config option GST_BUFFER_POOL_OPTION_VIDEO_GL_TEXTURE_UPLOAD_META if
the decide_allocation()'s query has GST_VIDEO_GL_TEXTURE_UPLOAD_META_API_TYPE.

Nevertheless, there are occasions where the query has the API type, but the
last negotiated caps don't have the feature meta:GstVideoGLTextureUploadMeta.

Under this contradiction, vaapidecode adds the GLTextureUploadMeta API to its
buffer pool configuration, and adds its buffer's meta to each output buffer,
even if the negotiated caps feature is memory:SystemMemory with I420 color
format.

This kind of output buffers chokes ClutterAutoVideosSink, since it uses a map
that relates caps <-> GL upload method. If it receives a buffer with color
format I420, it assumes that it doesn't have a texture upload meta, because
only those with RGB color format has it. Our buffers, with I420 format, say
that they have the upload meta too. In that case the mapped method is a dummy
one which does nothing. I reported this issue in bug #744039 (the patch,
obviously, was rejected).

This patch workarounds the problem: the buffer pool's configuration option
GST_BUFFER_POOL_OPTION_VIDEO_GL_TEXTURE_UPLOAD_META is set if and only if the
query has the GST_VIDEO_GL_TEXTURE_UPLOAD_META_API_TYPE *and* the negotiated
caps feature is meta:GstVideoGLTextureUploadMeta.

I have tested these patches with gst-master (1.5), gst-1.4 and gst-1.2 and
in all they seem to work correctly.

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

[adapted to fit current EGL changes]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
9 years agoplugins: add support for GstVideoGLTextureOrientation.
Gwenole Beauchesne [Fri, 20 Feb 2015 14:13:03 +0000 (15:13 +0100)]
plugins: add support for GstVideoGLTextureOrientation.

Add support for GstVideoGLTextureOrientation modes. In particular,
add orientation flags to the GstVaapiTexture wrapper and the GLX
implementations. Default mode is that texture memory is laid out
with top lines first, left row first. Flags indicate whether the
X or Y axis need to be inverted.

9 years agoplugins: add support for BGRA textures.
Gwenole Beauchesne [Mon, 9 Feb 2015 20:09:07 +0000 (21:09 +0100)]
plugins: add support for BGRA textures.

Some frameworks (EFL) expect BGRA textures for storage. However,
adding support for that broadly into GStreamer framework  implies
two kinds of hacks: (i) libgstgl helpers currently do not support
BGRA textures correctly, (ii) we need to better parse downstream
suggested caps and intersect them with what the VA plugin elements
can offer to them for GL texturing.

9 years agoplugins: fix support for Wayland/EGL running alongside X11.
Gwenole Beauchesne [Fri, 23 Jan 2015 08:31:57 +0000 (09:31 +0100)]
plugins: fix support for Wayland/EGL running alongside X11.

When multiple display servers are available, the glimagesink element
(from GStreamer 1.4) may not be able to derive a global display in
Wayland. Rather, a "window"-specific display is created. In this case,
the GstGLDisplay handle available through GstGLContext is invalid.

So, try to improve heuristics for display server characterisation in
those particular situations.

9 years agoplugins: add initial support for EGL.
Gwenole Beauchesne [Fri, 20 Feb 2015 14:29:17 +0000 (15:29 +0100)]
plugins: add initial support for EGL.

Add initial support for EGL through GstVideoGLTextureUploadMeta.

Fix gst_vaapi_ensure_display() to allocate a GstVaapiDisplay off the
downstream supplied GstGLContext configuration, i.e. use its native
display handle to create a GstVaapiDisplay of type X11 or Wayland ;
and use the desired OpenGL API to allocate the GstVaapiDisplayEGL
wrapper.

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

9 years agoplugins: track video texture size changes.
Gwenole Beauchesne [Tue, 9 Dec 2014 10:46:58 +0000 (11:46 +0100)]
plugins: track video texture size changes.

Sync video texture sizes to GstVideoGLTextureUploadMeta private date,
i.e. GstVaapiVideoMetaTexture, on a regular basis. In particular, we
now update the texture size from the GstVideoMeta, if any, or reset
to some defaults otherwise.

9 years agoplugins: ensure VA display matches GL context expectations.
Gwenole Beauchesne [Wed, 3 Dec 2014 14:45:52 +0000 (15:45 +0100)]
plugins: ensure VA display matches GL context expectations.

If a GstGLContext is supplied by the downstream element, then make
sure that the VA plugin element gets a compatible display to what
is requested by the GL context. e.g. re-allocate a VA/GLX display
when a GLX context is provided by the downstream element.

9 years agoplugins: record downstream GstGLContext.
Gwenole Beauchesne [Wed, 3 Dec 2014 13:14:30 +0000 (14:14 +0100)]
plugins: record downstream GstGLContext.

Record GL context supplied by downstream elements. This can be useful,
and further needed, to enforce run-time check that the GL context is
compatible for use by libgstvaapi. e.g. check that we don't create a
VA/GLX display for EGL/X11 contexts.

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

Original-path-by: Matthew Waters <ystreet00@gmail.com>
9 years agoegl: update tests.
Gwenole Beauchesne [Mon, 1 Dec 2014 13:52:39 +0000 (14:52 +0100)]
egl: update tests.

Add initial support for EGL to tests. The new EGL backend can be selected
through the --egl command line option. The OpenGL|ES version can further
be selected with the --gles-version command line option, where the default
of 0 means "desktop" OpenGL.

9 years agoegl: add windowing support.
Gwenole Beauchesne [Tue, 27 Jan 2015 15:21:04 +0000 (16:21 +0100)]
egl: add windowing support.

This provides for some basic EGL window abstraction.

9 years agoegl: add texture abstraction.
Gwenole Beauchesne [Sat, 24 Jan 2015 07:29:57 +0000 (08:29 +0100)]
egl: add texture abstraction.

Add GstVaapiTextureEGL abstraction that can create its own GL texture,
or import a foreign allocated one, while still allowing updates from a
VA surface.

9 years agoegl: allow for EGLImage imports into VA Surfaces.
Gwenole Beauchesne [Tue, 9 Dec 2014 17:14:56 +0000 (18:14 +0100)]
egl: allow for EGLImage imports into VA Surfaces.

Add helpers to import EGLImage objects into VA surfaces. There are
two operational modes: (i) gst_vaapi_surface_new_from_egl_image(),
which allows for implicit conversion from EGLImage to a VA surface
in native video format, and (ii) gst_vaapi_surface_new_with_egl_image(),
which exactly wraps the source EGLImage, typically in RGBA format
with linear storage.

Note: in case of (i), the EGLImage can be disposed right after the
VA surface creation call, unlike in (ii) where the user shall ensure
that the EGLImage is live until the associated VA surface is no longer
needed.

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

9 years agoAdd initial support for EGL.
Gwenole Beauchesne [Fri, 20 Feb 2015 14:27:53 +0000 (15:27 +0100)]
Add initial support for EGL.

Add initial support for EGL to libgstvaapi core library. The target
display server and the desired OpenGL API can be programmatically
selected at run-time.

A comprehensive set of EGL utilities are provided to support those
dynamic selection needs, but also most importantly to ensure that
the GL command stream is executed from within a single thread.

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