Sreerenj Balachandran [Mon, 25 May 2015 08:26:14 +0000 (11:26 +0300)]
HEVC_Encode: build: Check availability of VA APIs for H265 encoding.
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=748874
Sreerenj Balachandran [Mon, 25 May 2015 07:58:52 +0000 (10:58 +0300)]
gstvaapiutils_h265: Add H265 Tier specific utility functions
-- New API: gst_vaapi_utils_h265_get_tier_from_string()
-- New API: gst_vaapi_utils_h265_get_tier_string()
https://bugzilla.gnome.org/show_bug.cgi?id=748874
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Víctor Manuel Jáquez Leal [Tue, 19 May 2015 08:57:42 +0000 (10:57 +0200)]
doc: conditional linking for scanner
Add x11 library only if it is enabled.
https://bugzilla.gnome.org/show_bug.cgi?id=749018
Víctor Manuel Jáquez Leal [Tue, 19 May 2015 08:37:13 +0000 (10:37 +0200)]
doc: fix scanner compilation warning
https://bugzilla.gnome.org/show_bug.cgi?id=749018
Víctor Manuel Jáquez Leal [Wed, 6 May 2015 14:19:23 +0000 (16:19 +0200)]
doc: update sections and symbols
https://bugzilla.gnome.org/show_bug.cgi?id=749018
Víctor Manuel Jáquez Leal [Wed, 13 May 2015 08:38:24 +0000 (10:38 +0200)]
build: use git.mk
This patch handles dinamically the gitignore files with git.mk[1].
Removed the automake variable MAINTAINERCLANFILES in most of the
Makefile.am files since now it is handled by the top one.
1. https://github.com/behdad/git.mk/blob/master/git.mk
https://bugzilla.gnome.org/show_bug.cgi?id=749321
Víctor Manuel Jáquez Leal [Thu, 7 May 2015 09:28:15 +0000 (11:28 +0200)]
wayland: sync() when destroy()
Before pushing a the new frame, the render() method calls sync() to flush the
pending frames. Nonetheless, the last pushed frame never gets rendered, leading
to a memory leak too.
This patch calls sync() in the destroy() to flush the pending frames before
destroying the window.
Also a is_cancelled flag is added. This flag tells to not flush the event
queue again since the method failed previously or were cancelled by the user.
https://bugzilla.gnome.org/show_bug.cgi?id=749078
Michael Olbrich [Thu, 7 May 2015 13:55:40 +0000 (15:55 +0200)]
vaapisink: implement unlock/unlock_stop for wayland
Otherwise wl_display_dispatch_queue() might prevent the pipeline from
shutting down. This can happen e.g. if the wayland compositor exits while
the pipeline is running.
Changes:
* renamed unlock()/unlock_stop() to unblock()/unblock_cancel() in gstvaapiwindow
* splitted the patch removing wl_display_dispatch_queue()
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=747492
https://bugzilla.gnome.org/show_bug.cgi?id=749078
Víctor Manuel Jáquez Leal [Thu, 7 May 2015 10:33:34 +0000 (12:33 +0200)]
wayland: wl_display_dispatch_queue() can block forever.
wl_display_dispatch_queue() might prevent the pipeline from shutting
down. This can happen e.g. if the wayland compositor exits while the
pipeline is running.
This patch replaces it with these steps:
- With wl_display_prepare_read() all threads announce their intention
to read.
- wl_display_read_events() is thread save. On threads reads, the other
wait for it to finish.
- With wl_display_dispatch_queue_pending() each thread dispatches its
own events.
wl_display_dispatch_queue_pending() was defined since wayland 1.0.2
Original-patch-by: Michael Olbrich <m.olbrich@pengutronix.de>
* stripped out the unlock() unlock_stop() logic
* stripped out the poll handling
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=749078
https://bugzilla.gnome.org/show_bug.cgi?id=747492
Víctor Manuel Jáquez Leal [Thu, 7 May 2015 16:30:33 +0000 (18:30 +0200)]
wayland: rename frame for last_frame
Since frame in the private data means the last frame sent, it would
semantically better use last_frame.
Also, this patch makes use of g_atomic_pointer_{compare_and_exchange, set}()
functions.
https://bugzilla.gnome.org/show_bug.cgi?id=749078
Víctor Manuel Jáquez Leal [Thu, 7 May 2015 09:18:12 +0000 (11:18 +0200)]
wayland: use a counter as sync flag
Wayland window has a pointer to the last pushed frame and use it to set the
flag for stopping the queue dispatch loop. This may lead to memory leaks,
since we are not keeping track of all the queued frames structures.
This patch removes the last pushed frame pointer and change the binary flag
for an atomic counter, keeping track of number of queued frames and use it for
the queue dispatch loop.
https://bugzilla.gnome.org/show_bug.cgi?id=749078
Víctor Manuel Jáquez Leal [Thu, 7 May 2015 08:36:17 +0000 (10:36 +0200)]
wayland: decouple wl_buffer from frame
This patch takes out the wayland's buffer from the the frame structure. The
buffer is queued to wayland and destroyed in the "release" callback. The
frame is freed in the surface's "done" callback.
In this way a buffer may be leaked but not the whole frame structure.
- surface 'done' callback is used to throttle the rendering operation and to
unallocate the frame, but not the buffer.
- buffer 'release' callback is used to destroy wl_buffer.
Original-patch-by: Zhao Halley <halley.zhao@intel.com>
* code rebase
* kept the the event_queue for buffer's proxy
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=749078
Víctor Manuel Jáquez Leal [Thu, 14 May 2015 14:22:36 +0000 (16:22 +0200)]
vaapisink: fix indentation
Víctor Manuel Jáquez Leal [Wed, 13 May 2015 09:54:01 +0000 (11:54 +0200)]
build: fix make distcheck
This patch fixes several issues found when running the `make distcheck`
target:
- In commit
c561b8da, the update of gstcompat.h in Makefile.am was
forgotten.
- In commit
c5756a91 add the simple_encoder_source_h in EXTRA_DIST was
forgotten.
- vpx.build.stamp is not generated at all, only vpx.configure.stamp.
- The make target distcleancheck failed because some autogenerated files
were not handled with the DISTCLEANFILES variable.
Note: `make distcheck -jXX` is not currently supported.
Víctor Manuel Jáquez Leal [Wed, 13 May 2015 11:28:17 +0000 (13:28 +0200)]
h264parse: update patches with upstream
These patches didn't applied cleanly, breaking the `make distcleancheck`
target. Re-sync'ed the patches against the current git's submodule.
Gwenole Beauchesne [Tue, 12 May 2015 14:04:33 +0000 (16:04 +0200)]
tests: simple-encoder: fix build warnings on 64-bit platforms.
Add a cosmetic change to replace VAAPI buffer with VA buffer and most
importantly fix warnings spitted out during build on 64-bit platforms.
../../tests/simple-encoder.c:211:5: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘gssize’ [-Wformat=]
g_warning ("Invalid VAAPI buffer size (%d)", size);
^
../../tests/simple-encoder.c:217:5: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘gssize’ [-Wformat=]
g_warning ("Failed to create output buffer of size %d", size);
^
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
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
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.
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
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.
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
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.
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.
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.
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.
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.
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
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
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
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.
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
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.
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()
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
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.
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
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
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
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
Gwenole Beauchesne [Fri, 17 Apr 2015 08:10:10 +0000 (10:10 +0200)]
autogen: drop videoutils submodule.
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.
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
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
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
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
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
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().
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
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.
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
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
Sreerenj Balachandran [Mon, 13 Apr 2015 13:04:59 +0000 (16:04 +0300)]
vaapidecode: Update Author name in plugin metadata
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>
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>
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>
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>
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>
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>
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
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
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
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
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
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
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
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
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
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
Sreerenj Balachandran [Fri, 3 Apr 2015 21:40:29 +0000 (00:40 +0300)]
Update README
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
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
Sreerenj Balachandran [Fri, 3 Apr 2015 14:45:08 +0000 (17:45 +0300)]
Remove the gstvaapivideoconverter_*.c source files missed in commit 51b1e4a
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>
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>
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>
Sreerenj Balachandran [Fri, 3 Apr 2015 14:03:38 +0000 (17:03 +0300)]
Remove the gstreamer-videoutils submodule
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>
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>
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>
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>
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>
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>
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>
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
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.
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>
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>
Sreerenj Balachandran [Fri, 6 Mar 2015 12:31:21 +0000 (14:31 +0200)]
vaapidecode: clean-ups (indentation, drop unused variables)
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
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
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().
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.
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.
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
Sreerenj Balachandran [Mon, 2 Mar 2015 12:59:16 +0000 (14:59 +0200)]
vaapidecode: re-indent (gst-indent) gstvaapidecode.c
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>
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.
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.
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>