Commit graph

1243 commits

Author SHA1 Message Date
Sebastian Dröge
734b8bad8f vaapi: Fix various compiler warnings and disable -Wredundant-decls for now 2016-02-16 15:09:01 +02:00
Víctor Manuel Jáquez Leal
60ebfbc595 libs: fix build error
gst_vaapi_buffer_proxy_{acquire_handle,release_handle,finalize,class}
functions are used only when libva's API version is greater than 0.36.0

This patch guards those functions completely rather than just their
content. The patch is a continuation of commit 38f8fea4

Original-patch-by: Vineeth TM <vineeth.tm@samsung.com>

https://bugzilla.gnome.org/show_bug.cgi?id=762055
2016-02-15 18:20:48 +01:00
Víctor Manuel Jáquez Leal
d76d78cc8e libs: fix compiler warnings
After setting the release flags, the compiler warns about a couple
initialized variables.

Also marked a couple of set variables as unused, because they are only
used for assertion.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-02-03 20:22:46 +01:00
Víctor Manuel Jáquez Leal
ac730d0a62 libs: humongous code style fix
As part of the upstreaming process of gstreamer-vaapi into the GStreamer
umbrella, we need to comply with the project's code style. This meant to
change a lot of code.

It was decided to use a single massive patch to update the code style.

I would like to apologize with the original developers of this code because of
the history breakage.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-02-03 20:03:47 +01:00
Víctor Manuel Jáquez Leal
4b5be5973e libs: small refactors to enhance the code style
As gst-indent generated ugly code in these cases, this patch changes the used
idiomatic into other one.

No functional changes were introduced.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-02-03 20:03:47 +01:00
Víctor Manuel Jáquez Leal
28d01c0857 libs: small code style fixes
This a set of small code style fixes detected as-is by gst-indent.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-02-03 12:45:30 +01:00
Víctor Manuel Jáquez Leal
02c0e6c183 libs: trivial comment style fixes
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-02-03 12:20:37 +01:00
Víctor Manuel Jáquez Leal
a0b325c19a libs: avoid gst-indent mess up
Guard pieces of code to avoid gst-ident to mess up the following code.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-02-03 12:20:37 +01:00
Tim-Philipp Müller
ab28dea7c1 Fix some more compiler warning
Two (false) compiler warnings about variables potentially
being used uninitialized, and one about a variable being
set but not used.

https://bugzilla.gnome.org/show_bug.cgi?id=759192
2016-02-02 17:19:42 +01:00
Tim-Philipp Müller
24168a2093 vaapi: fix 'ISO C90 forbids mixed declarations and code' compiler warnings
Declare variables at the beginning of a code block, which
is how it's done in GStreamer.

https://bugzilla.gnome.org/show_bug.cgi?id=759192
2016-02-02 16:17:43 +01:00
Sreerenj Balachandran
eb2daed2a7 decoder: vp9: Fix crop rectangle setting
Align with software vp9dec behaviour: Add crop rectangle
only if display_width/display_height is less than the
frame_hdr->width/frame_hdr->height
2016-02-02 16:17:43 +01:00
Víctor Manuel Jáquez Leal
2a80f4b909 decoder: update a deprecated function
Somehow this didn't show up earlier, but gst_adapter_prev_timestamp() got
deprecated since GStreamer 1.0.

This patch replace it with gst_adapter_prev_pts()

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-02-02 16:17:43 +01:00
Víctor Manuel Jáquez Leal
54011c22e2 build: fix when HEVC decoder is disabled
This a very pathological situation: when we have a HEVC encoder but not a HEVC
decoder.

The encoder needs functions that are only available when the decoder is
enabled.

This patch moves the utils functions into the generic sources, such as the
rest of the utils.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-02-01 12:21:57 +01:00
Víctor Manuel Jáquez Leal
1c722efe54 Remove old gst version guards
As gstreamer-vaapi now only supports from GStreamer 1.6, this patch removes
all the old GStreamer version guards.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-01-25 12:09:40 +00:00
Víctor Manuel Jáquez Leal
fa6144545f libs: remove versioning
Since we don't install libraries anymore, it makes no sense to keep
versioning them according to the gstreamer's version.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-01-20 10:19:07 +01:00
Víctor Manuel Jáquez Leal
f8bb674028 libs: make libraries no installables
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-01-19 13:16:43 +01:00
Víctor Manuel Jáquez Leal
bc54fa27e6 Do not install libgstvaapi headers
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-01-19 13:16:43 +01:00
Víctor Manuel Jáquez Leal
56fab31c00 Remove codecparsers submodule
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-01-19 12:49:11 +01:00
Sreerenj Balachandran
258214aa33 Remove libvpx submodule
We will be using upstream codecparsers always.
No more internal libvpx !
2016-01-19 12:49:11 +01:00
Michael Olbrich
e4ed64b731 wayland: free the frame in frame_release_callback()
This basically reverts 62c3888b76 (wayland:
decouple wl_buffer from frame).

Otherwise the frame may be overwritten while it is still used by the
compositer:

The frame done callback (frame_done_callback()) is called, when the
compositor is done processing the frame and hands it to the hardware.
The buffer release callback (frame_release_callback()) is called when the
buffer memory is no longer used.

This can be quite some time later: E.g. if weston (with the DRM backend)
puts the buffer on a hardware plane, then then buffer release callback is
called when the kernel is done with the buffer. This is usually when the
next frame is shown, so most likely after the frame done callback for the
next frame!

Since 70eff01d36 "wayland: sync() when
destroy()" the mentioned possible leak should no longer be a problem, so
reverting this change should cause no leaking buffers.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=758848
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
2016-01-19 12:43:45 +01:00
Sreerenj Balachandran
61045041c4 Add 10 HEVC 10 bit decoding support
Only supporting vaapidecode ! vaapisink combination for now.

Missing dependencies:
1: No support for P010 video format in GStreamer
2: No support for P010 vaGetImage()/vaPutimage() in vaapi-intel-driver
3: As a result of 1&2 , we have no support for Vaapi Video memory mapping
   through GstVideoMeta.

Right now we only set chroma format (YUV420 with more than 8 bits per channel)
for surface pool and keeping GST_VIDEO_FORMAT as ENCODED. The underlying format
of the surfaces is implementation (driver) defined, which is P010.
2015-12-08 16:14:11 +02:00
Sreerenj Balachandran
9ccdbce4bd gstvaapisurfacepool: Add new API to create surface pool based on chroma type
This new API gst_vaapi_surface_pool_new_with_chroma_type() is for
creating a new GstVaapiVideoPool of GstVaapiSurfaces with the specified
chroam type and dimensions. The underlying format of the surfaces is
implementation (driver) defined.
2015-12-08 15:16:00 +02:00
Sreerenj Balachandran
009c2c72c9 Add definitions for YUV420 with more than 8 bits per channel 2015-12-07 19:06:28 +02:00
Sreerenj Balachandran
a2171ea0eb gstvaapiporfile: Fix string representation of HEVCMain10 profile 2015-12-07 17:26:24 +02:00
Víctor Manuel Jáquez Leal
4897d96945 texture: detect GL version and use the proper API
When receiving the texture from the application or the video sink, we must
know it size and border. To query the texture the API has changed according to
the OpenGL version used in the GL context of the application/vsink.

This patch checks the current context API type and queries the texture
according to this detected API.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=753099
2015-11-30 13:26:22 +01:00
Víctor Manuel Jáquez Leal
1e39b59ce8 texture: check for expected target and format
gst_vaapi_texture_glx_new_wrapped() only handles a GL_TEXTURE_2D target and
formats GL_RGBA or GL_BGRA.

This patch adds a debugging verification of those values.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=753099
2015-11-30 13:26:22 +01:00
Víctor Manuel Jáquez Leal
da835c7508 libs: add gl3_bind_texture_2d()
Since OpenGL3.1 removed the fixed pipelines[1] enabling 2D textures is not
needed. In particular, the Intel's Mesa implementation complains if it is
called.

This patch add a new binding function for 2D textures, without enabling
gl3_bind_texture_2d()[2].

1. https://www.opengl.org/wiki/Fixed_Function_Pipeline
2. https://www.opengl.org/wiki/Common_Mistakes#OOP_and_hidden_binding

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=753099
2015-11-30 13:26:22 +01:00
Víctor Manuel Jáquez Leal
03fed576f0 libs: add gl_get_current_api()
In order to know which OpenGL API use, we must detect the API type of current
context. This patch adds the function gl_get_current_api() which returns the
OpenGL API type.

This function is an adaptation of gst_gl_context_get_current_gl_api() from
GstGL.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=753099
2015-11-30 13:26:22 +01:00
Sreerenj Balachandran
d7bd0a4c10 build: Add gmodule dependency for libgstvaapi_egl
https://bugzilla.gnome.org/show_bug.cgi?id=756259
2015-11-30 13:03:04 +01:00
Sreerenj Balachandran
a24918037d decoder: vp9: Fix last/golden/altref frame index setting
Always fill VADecPictureParameterBufferVP9 last/golden/altref indices
based on what ever reference frame indices encoded in frame header.
2015-11-17 19:37:07 +02:00
Sreerenj Balachandran
2855682bd3 decoder: vp9: Fix PTS calculation of cloned frames 2015-11-16 18:22:55 +02:00
Sreerenj Balachandran
9a314a2430 decoder: vp9: Avoid unnecessary show_frame flag checking while doing picture output
We always set GST_VAAPI_PICTURE_FLAG_SKIPPED for DECODE_ONLY frames and the
gstvaapidecoder base calss is reponsible for handling those frames later on.
No need for explicit verification of frame header's show_frame in order to
do picture outputing.
2015-11-16 18:22:33 +02:00
Sreerenj Balachandran
26f895f4a8 decoder: vp9: Fix ref picture update while doing repeat frame
Don't try to do frame decoding and reference picture update
while receiving a vp9 frame having show_existing_frame flag
set as TRUE.
2015-11-16 18:22:14 +02:00
Sreerenj Balachandran
247896884b decoder: vp9: Add repeat-frame display handling
If vp9 frame header come up with show_existing_frame flag set,
we should duplicate the existing decoded frame as current frame to
be displayed.
2015-11-16 18:21:56 +02:00
Sreerenj Balachandran
8ee23ffd96 decoder: vp9: Add crop rectangle support.
Set crop rectange if:
There is display_width and display_height which is different from actual width/height
 or
The changed resolution is less than the actual configured dimension of surfaces
2015-11-13 19:46:01 +02:00
Sreerenj Balachandran
a48eebefd6 decoder: vp9: Fix the context and surface pool reset for multi resolution video
Unlike other decoders, vp9 decoder doesn't need to reset the
whole context and surfaces for each resolution change. Context
reset only needed if resolution of any frame is greater than
what actullay configured. There are streams where a bigger
resolution set in ivf header or webm header but actual resolution
of all frames are less. Also it is possible to have inter-prediction
between these multi resolution frames.
2015-11-13 19:23:05 +02:00
Sreerenj Balachandran
4aa523f8b4 decoder: vp9: Fill the VADecPictureParameterBufferVP9 width/height from frame header
Always fill width/height of VADecPictureParameterBufferVP9 from frame header.
Preliminary fix for supproting multi resolution video decode.
2015-11-13 18:58:33 +02:00
Sreerenj Balachandran
9b885c65ca decoder: vp9: Set lossless flag from frame header 2015-11-13 18:41:53 +02:00
Víctor Manuel Jáquez Leal
57b69d36f2 libs: vp9: remove unused symbols
clang complains about a couple variables and one label which were not
used. This patch removes them.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=757958
2015-11-11 19:18:52 +01:00
Víctor Manuel Jáquez Leal
f182fcfb37 libs: remove unneeded headers
Since gstvaapidisplay_glx.h do not expose gl.h/glx.h structures, it is not
required to include them in the header. It is not also required to include
them in gstvaapidisplay_glx.c, since gstvaapiutils_glx.h includes them and
exposes their structures (e.g. GLXPixmap).

Nonetheless, glext.h neither glxext.h are required to include, they are
already included conditionally by gl.h and glx.h, respectively.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=757577
2015-11-09 15:12:31 +01:00
Sreerenj Balachandran
db877e015d VP9: libgstvaapi: Add VP9 decoder 2015-11-06 15:12:51 +02:00
Sreerenj Balachandran
a3d63724dd VP9: gstvaapiprofile: Add profile definitions 2015-11-06 14:57:00 +02:00
Sreerenj Balachandran
279f494bc0 VP9: Allow building vp9 codecparser internally 2015-11-06 14:25:39 +02:00
Víctor Manuel Jáquez Leal
f6ae00a6bb decoder: h264: initialize PPS's slice_group_id
When the GstVaapiParserInfoH264 is allocated, the memory is not initialized,
so it contains random data.

When gst_h264_parser_parse_pps() fails, the PPS structure keeps slice_group_id
pointer uninitialized, leading to a segmentation fault when the memory is
freed.

This patch prevents this by initializing the slice_group_id before the PPS
parsing.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=754845
2015-09-15 19:36:37 +02:00
Sreerenj Balachandran
3bd6185f9f decoder: hevc: Don't flush dpb for EOS/EOB nal
Explicit flushing of dpb for EOS and EOB nal decoding is wrong,
the dpb_add() itself will handle the flusing(if needed) of dpb
for end of sequence and end of bitstream.

https://bugzilla.gnome.org/show_bug.cgi?id=754010
2015-09-04 22:19:55 +03:00
Sreerenj Balachandran
e90ea99df1 decoder: hevc: Fix the dpb_add() based on C.5.2.3
Follow the spec as it is in C.5.2.3, add the decoded frame to dpb
just after the PicLatencyCnt setting of existing dpb frames.

https://bugzilla.gnome.org/show_bug.cgi?id=754010
2015-09-04 22:11:10 +03:00
Sreerenj Balachandran
8799a8044d decoder: hevc: Fix the picture addition in dpb() based on spec H265 v3 (04/2015)
This fix is based on the V3 vesion of spec which was missing in older versions.

When the current picture has PicOutputFlag equal to 1, for each picture in the
DPB that is marked as "needed for output" and follows the current picture in output order,
the associated variable PicLatencyCount is set equal to PicLatencyCount + 1 (C.5.2.3).

https://bugzilla.gnome.org/show_bug.cgi?id=754010
2015-09-04 22:02:55 +03:00
Sreerenj Balachandran
ac92e6d5bc decoder: h265: Fix indentation 2015-09-04 22:00:36 +03:00
Jan Schmidt
b0194a1dc5 multiview: initial attempt at stereo/multiview support
Add support for marking caps and buffers for multiview or
stereoscopic output.

https://bugzilla.gnome.org/show_bug.cgi?id=750835
2015-08-31 17:51:56 +02:00
Víctor Manuel Jáquez Leal
cc63452d72 decoder: hevc: remove unused functions
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=754250
2015-08-31 13:13:24 +02:00