platform/upstream/gstreamer.git
9 years agovaapidecodebin: ensure VPP before going to READY
Víctor Manuel Jáquez Leal [Thu, 6 Aug 2015 16:48:13 +0000 (18:48 +0200)]
vaapidecodebin: ensure VPP before going to READY

There are sometimes that the VA-API display context is not shared among the
pipeline, but it is important to know it before going to READY state (when the
pipeline is already linked).

One instance of this case is this:

gst-launch-1.0 filesrc location=media ! decodebin ! vaapipostproc ! vaapisink

This patch adds a new function in gstvaapipluginutil called
gst_vaapi_create_test_display(). Its purpose is to create a disposable VA-API
display, which only will be used for verify if the VAEntrypointVideoProc is
available by the hardware. Afterwards, it should be unrefed.

If the vaapidecodebin is going to READY state, and the element still doesn't
know if VPP is available, the last resort is to create a new instance of the
VA-API display and test for it.

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

9 years agovaapidecodebin: post an error message if fails
Víctor Manuel Jáquez Leal [Thu, 6 Aug 2015 10:39:52 +0000 (12:39 +0200)]
vaapidecodebin: post an error message if fails

If the construction of the bin fails, post an error message in the bus.

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

9 years agovaapidecodebin: has_vpp as a tri-state variable
Víctor Manuel Jáquez Leal [Thu, 6 Aug 2015 10:36:07 +0000 (12:36 +0200)]
vaapidecodebin: has_vpp as a tri-state variable

has_vpp can be UNKNOWN while the context message hasn't being received.

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

9 years agogstvaapivideomemory: native format with no derived image
Víctor Manuel Jáquez Leal [Mon, 3 Aug 2015 14:33:02 +0000 (16:33 +0200)]
gstvaapivideomemory: native format with no derived image

If USE_NATIVE_FORMATS is defined we bail out before configuring the surface
info based on the derived image configuration.

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

9 years agosurface pool config based on video info
Víctor Manuel Jáquez Leal [Thu, 23 Jul 2015 18:07:59 +0000 (20:07 +0200)]
surface pool config based on video info

First added the function gst_vaapi_video_format_get_best_native(), which
returns the best native format that matches a particular chroma type:

YUV 4:2:0 -> NV12, YUV 4:2:2 -> YUY2, YUV 4:0:0 -> Y800

RGB32 chroma and encoded format map to NV12 too.

That format is used to configure, initially, the surface's pool for the
allocator.

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

9 years agogstvaapivideomemory: refactor gst_vaapi_video_allocator_new()
Víctor Manuel Jáquez Leal [Thu, 23 Jul 2015 14:03:43 +0000 (16:03 +0200)]
gstvaapivideomemory: refactor gst_vaapi_video_allocator_new()

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

9 years agogstvaapiencoder: validate chroma according to the VA's RT format
Victor Jaquez [Fri, 19 Jun 2015 13:51:07 +0000 (15:51 +0200)]
gstvaapiencoder: validate chroma according to the VA's RT format

Before, only YUV420 color space where supported. With this patch, the
encoder is queried to know the supported formats and admits YUV422
color space if its available.

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

9 years agodecoder: hevc: Add calculation of WpOffsetHalfRangeC
Sreerenj Balachandran [Thu, 13 Aug 2015 02:07:52 +0000 (05:07 +0300)]
decoder: hevc: Add calculation of WpOffsetHalfRangeC

This is necessary for finding ChromaOffsetL0/ChromaOffsetL1
prediction weight table values with out using any hard coding.

Fixme: We don't have parser API for sps_range_extension, so
assumed zero value for high_precision_offsets_enabled_flag.

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agodecoder: hevc: Fix ChromaOffsetL0/ChromaOffsetL1 calculation
Sreerenj Balachandran [Thu, 13 Aug 2015 01:09:44 +0000 (04:09 +0300)]
decoder: hevc: Fix ChromaOffsetL0/ChromaOffsetL1 calculation

Based on ITU-T rec H265(4/2015): 7-56

This was a wrong equation in rec H265 (4/2013): 7-44...

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agodecoder: hevc: Fix default value assignment of pred_weight_table
Sreerenj Balachandran [Thu, 13 Aug 2015 01:08:03 +0000 (04:08 +0300)]
decoder: hevc: Fix default value assignment of pred_weight_table

9 years agodecoder: hevc: Fix the value assigning for delta_chroma_log2_weight_denom
Sreerenj Balachandran [Thu, 13 Aug 2015 00:48:43 +0000 (03:48 +0300)]
decoder: hevc: Fix the value assigning for delta_chroma_log2_weight_denom

Assign only if ChromaArrayType != 0..

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agocodecparsers: Update to gst-vaapi-branch commit 1c70432
Sreerenj Balachandran [Thu, 13 Aug 2015 00:06:32 +0000 (03:06 +0300)]
codecparsers: Update to gst-vaapi-branch commit 1c70432

8e98b41: codecparsers: h265: Fix the range of delta_chroma_log2_weight_denom
839c5bc: codecparsers: h265: Fix the parsing of ref_pic_lists_modification

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agocodecparsers: Update to gst-vaapi-branch commit c18b8ad
Sreerenj Balachandran [Tue, 11 Aug 2015 05:09:10 +0000 (08:09 +0300)]
codecparsers: Update to gst-vaapi-branch commit c18b8ad

8a03e67: videoparsers: h265: Avoid skipping of EOS and EOB nals
a033083: videoparsers: h265: Fix the frame start detection code

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agodecoder: hevc: Add SEI parsing
Sreerenj Balachandran [Mon, 10 Aug 2015 02:50:50 +0000 (05:50 +0300)]
decoder: hevc: Add SEI parsing

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agodecoder: hevc: Workaround to recognize wrongly encoded main profile streams
Sreerenj Balachandran [Fri, 7 Aug 2015 05:43:44 +0000 (08:43 +0300)]
decoder: hevc: Workaround to recognize wrongly encoded main profile streams

HACK: This is a work-around to identify some main profile streams having wrong profile_idc.
There are some wrongly encoded main profile streams(eg: ENTP_C_LG_3.bin) which doesn't
have any of the profile_idc values mentioned in Annex-A, instead general_profile_idc
has been set as zero and having general_profile_compatibility_flag[general_profile_idc]
is TRUE. Assuming them as MAIN profile for now.

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

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agopatches/videoparsers: Fix the wrong source file path
Sreerenj Balachandran [Fri, 7 Aug 2015 05:41:57 +0000 (08:41 +0300)]
patches/videoparsers: Fix the wrong source file path

This is something wrongly typed in commit 6d7b631

9 years agocodecparsers: Update to gst-vaapi-branch commit b8d8be4
Sreerenj Balachandran [Fri, 7 Aug 2015 05:34:55 +0000 (08:34 +0300)]
codecparsers: Update to gst-vaapi-branch commit b8d8be4

ee7e81b: h264parse: Don't discard first AU delimiter
3690fb9: h264parse: Add more NAL types for debugging output
108d368: h265parse: Avoid checking for Non Mandatory VPS NAL
ace61048: h265parse: expose compatible profiles to downstream

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agogstvaapivideocontext: remove unused parameter
Víctor Manuel Jáquez Leal [Thu, 6 Aug 2015 11:07:53 +0000 (13:07 +0200)]
gstvaapivideocontext: remove unused parameter

gst_vaapi_video_context_prepare() received an unused parameter. This patch
removes it and the structure passed by the caller.

This a left over of "Removal of gstreamer-1.0 support" (commit 8b36e25f).

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
9 years agodecoder: hevc: Fix decoding of stream when it has temporal sublayers
Sreerenj Balachandran [Thu, 6 Aug 2015 01:01:24 +0000 (04:01 +0300)]
decoder: hevc: Fix decoding of stream when it has temporal sublayers

We are calculating the dpb size based on max_dec_pic_buffering.
But if there are more than one temporal sublayers, we are supposed
to use the max_dec_pic_buffering[max_sub_layers_minus] for dpb
size calculation (Assuming HighestTid as max_sub_layers_minus).

Sample streams: TSCL_A_VIDYO_5.bin, TSCL_B_VIDYO_4.bin

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

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agorefactor vaapi caps strings for pad templates
Víctor Manuel Jáquez Leal [Wed, 5 Aug 2015 12:11:12 +0000 (14:11 +0200)]
refactor vaapi caps strings for pad templates

Refactor the main vaapi caps strings into three macros:
GST_VAAPI_MAKE_SURFACE_CAPS, GST_VAAPI_MAKE_ENC_SURFACE_CAPS and
GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS.

Those are in gstvaapipluginutil.h so all the elements could use them, instead
of re-declaring them every time.

No functional changes.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
9 years agogstvaapipostproc: fix code style
Víctor Manuel Jáquez Leal [Wed, 5 Aug 2015 12:15:07 +0000 (14:15 +0200)]
gstvaapipostproc: fix code style

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
9 years agodecoder: hevc: Fix the decoding of dependent slice segment
Sreerenj Balachandran [Wed, 5 Aug 2015 02:23:20 +0000 (05:23 +0300)]
decoder: hevc: Fix the decoding of dependent slice segment

Decoding process for reference picture list construction needs to be
invoked only for P and B slice and the value for slice_type of dependent slice
segment should be taken from the previous independent slice segment header
of the same pic.

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

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agoplugins: reduce the noise of warnings
Victor Jaquez [Mon, 22 Jun 2015 15:38:41 +0000 (17:38 +0200)]
plugins: reduce the noise of warnings

Those messagse should be attached to the object, also the lack of
caps is not an error, in particular in the case of JPEG encoding.

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

9 years agogstvaapicontext: fix the JPEG encoder attribs value
Víctor Manuel Jáquez Leal [Tue, 23 Jun 2015 15:49:51 +0000 (17:49 +0200)]
gstvaapicontext: fix the JPEG encoder attribs value

When we query for the VAConfigAttribEncJPEG, we get a value which packs the
VAConfigAttribValEncJPEG structure, but we did not assign it. This patch
assigns the returned value to the attribute.

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

9 years agogstvaapiencoder: framerate 0/1 is valid too
Victor Jaquez [Thu, 18 Jun 2015 15:37:46 +0000 (17:37 +0200)]
gstvaapiencoder: framerate 0/1 is valid too

Framerate 0/1 is valid, and it is particularly useful for picture
encoding, such as jpeg. This patch makes the encoder to admit that
framerate.

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

9 years agovaapipostroc: GLTextureUploadMeta in sink template
Víctor Manuel Jáquez Leal [Fri, 3 Jul 2015 07:35:16 +0000 (09:35 +0200)]
vaapipostroc: GLTextureUploadMeta in sink template

Advertise GLTextureUploadMeta in sink caps template.

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

9 years agoremove gstvaapiuploader
Víctor Manuel Jáquez Leal [Thu, 23 Jul 2015 11:11:40 +0000 (13:11 +0200)]
remove gstvaapiuploader

Working on bug #744042 I realized that the gstvaapiuploader is practically not
used.

This patch removes the gstvaapiuploader and add the method
gst_vaapi_plugin_base_get_allowed_raw_caps () that returns the raw caps that
the system can handle, which is used by vaapisink and vaapipostproc.

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

9 years agovaapidecode: don't lost GLTextureUpload on seek
Víctor Manuel Jáquez Leal [Mon, 27 Jul 2015 16:49:13 +0000 (18:49 +0200)]
vaapidecode: don't lost GLTextureUpload on seek

When seeking, the decoder is reset, but the buffer pool is not
re-negotiated, but in reset_full() the code forgets if the negotiated buffer
pool has the GLTextureUpload meta.

The decoder knows that GLTextureUpload meta was negotiated in
decide_allocation(), but this method is not called when seeking.

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

9 years agoplugins: don't use gst_pad_get_allowed_caps()
Víctor Manuel Jáquez Leal [Tue, 21 Jul 2015 16:45:56 +0000 (18:45 +0200)]
plugins: don't use gst_pad_get_allowed_caps()

gst_pad_get_allowed_caps() query the pad and the peer pad. In the case
decoders, that is OK, but in the case of the postproc might lead loops,
since the gst_base_transform_query_caps() forwards the query upstream
and forth.

Instead of gst_pad_get_allowed_caps() we only query the peer with
gst_pad_peer_query_caps() using the pad's template as filter.

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

9 years agoREADME: updates
Sreerenj Balachandran [Wed, 22 Jul 2015 09:40:19 +0000 (12:40 +0300)]
README: updates

9 years agopatches/videoparsers: h264parse: Disable 3D video support for GStremaer < 1.5
Sreerenj Balachandran [Wed, 22 Jul 2015 06:45:26 +0000 (09:45 +0300)]
patches/videoparsers: h264parse: Disable 3D video support for GStremaer < 1.5

All API/ABI changes for S3D/MVC are added in 1.5, backporting
them to older verison is not recommended.

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agopatches/Videoparsers: update patch to fix build with older GStreamer 1.2 stacks
Sreerenj Balachandran [Wed, 22 Jul 2015 06:41:34 +0000 (09:41 +0300)]
patches/Videoparsers: update patch to fix build with older GStreamer 1.2 stacks

9 years agodecoder: jpeg: Align with new API/ABI changes in codecparser
Sreerenj Balachandran [Wed, 22 Jul 2015 06:38:42 +0000 (09:38 +0300)]
decoder: jpeg: Align with new API/ABI changes in codecparser

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agocodecparsers: Update to gst-vaapi-branch commit 800bdb2
Sreerenj Balachandran [Wed, 22 Jul 2015 06:31:02 +0000 (09:31 +0300)]
codecparsers: Update to gst-vaapi-branch commit 800bdb2

ed13220: mpegvideometa: add meta transform function
18d5efd: codecparsers: jpeg: add some padding to ScanHdr struct
7a51722: codecparsers: jpeg: fix docs for table parsing functions
06b8ded: codecparsers: jpeg: fix validity checking of data parsed
387a39d: codecparsers: jpeg: fix up API
db9d6a9: codecparsers: jpeg: tweak API a little
bb6951e: codecparsers: jpeg: hide gst_jpeg_scan_for_marker_code()
f33c30c: codecparsers: jpeg: fix and optimize scan for next marker code
4658c30: codecparsers: jpeg: fix calculation of segment size
759bcb9: codecparsers: jpeg: fix default Huffman tables generation
b4811ee: codecparsers: jpeg: add JPEG bitstream parser
9422464: h264parse: fix typo in log message
9e793a0: h264parse: Move PAR calcs, and use them for stereoscopic half-aspect
77704ce: nalutils: trivial patch to check if
8bb9249: codecparsers: mpeg4: actually return full number of bits of resync marker
7862f95: Revert "codecparsers: remove ignored increment of return"
54017b1: h264parse: Add support for passing stereoscopic/multiview info
8667ee4: h264parse: Don't switch to passthrough on set_caps()

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agodecoder: h264: track previous reference frames.
Gwenole Beauchesne [Mon, 29 Jun 2015 12:27:56 +0000 (14:27 +0200)]
decoder: h264: track previous reference frames.

Improve closure of gaps in frame_num by strictly following and trying
to fill them with previous reference frames. So, they are now tracked
thus avoiding insertion of dummy ("greenish") frames.

9 years agodecoder: h264: fix integration of second field into the DPB.
Gwenole Beauchesne [Mon, 29 Jun 2015 11:16:09 +0000 (13:16 +0200)]
decoder: h264: fix integration of second field into the DPB.

If the new picture to be added to the DPB is not a first field, then
it shall be the second field of the previous picture that was added
before.

This removes the need for dpb_find_picture() now that we track the
immediately preceding decoded picture, in decode order.

9 years agodecoder: h264: fix closure of "other-field" gap.
Gwenole Beauchesne [Mon, 6 Jul 2015 12:38:26 +0000 (14:38 +0200)]
decoder: h264: fix closure of "other-field" gap.

When a dummy "other-field" is inserted, it is assumed to inherit the
reference flags from the first field, and the sliding window decoded
reference picture marking process is also executed so that corrupted
frames are moved out as early as possible.

While doing so, we also try to output frames that now contain a single
valid field picture, prior to inserting any other picture into the DPB.
Note: this may be superfluous currently based on the fact that dpb_add()
combines the two most recent pairable fields, but this process would be
further simplified later on.

9 years agodecoder: h264: track corrupted frames.
Gwenole Beauchesne [Wed, 24 Jun 2015 11:58:17 +0000 (13:58 +0200)]
decoder: h264: track corrupted frames.

Mark the picture as "corrupted" if it is reconstructed from corrupted
references or if those references are fake, e.g. resulting from lost
frames.

This is useful for notifying the upper layer, or downstream elements,
that the decoded frame may contain artefacts.

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

9 years agodecoder: add initial infrastructure for marking corrupted output.
Gwenole Beauchesne [Wed, 24 Jun 2015 11:48:46 +0000 (13:48 +0200)]
decoder: add initial infrastructure for marking corrupted output.

Add initial infrastructure in core codec library and vaapidecode to mark
corrupted frames as such. A corrupted frame is such a frame that was
reconstructed from invalid references for instance.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
9 years agoBump version for development
Sreerenj Balachandran [Wed, 15 Jul 2015 15:18:49 +0000 (18:18 +0300)]
Bump version for development

9 years ago0.6.0
Sreerenj Balachandran [Wed, 15 Jul 2015 12:49:38 +0000 (15:49 +0300)]
0.6.0

9 years agoNEWS: updates
Sreerenj Balachandran [Wed, 15 Jul 2015 12:49:19 +0000 (15:49 +0300)]
NEWS: updates

9 years agovaapidecoder: no wmv profiles gstreamer 1.4/1.2
Víctor Manuel Jáquez Leal [Tue, 14 Jul 2015 17:39:20 +0000 (19:39 +0200)]
vaapidecoder: no wmv profiles gstreamer 1.4/1.2

This patch fix the auto-plugging problem in gstreamer 1.2 and gstreamer 1.4

Right now there is not a primary ranked parser for vc1 and the demuxers
delivers caps without specifying the profile. This situation is not an issue
for avdec_vc1 but for vaapidecode it is, which refuses to negotiate without a
explicit profile defined in the negotiated caps.

Nonetheless, in gstreamer 1.5 it seems not to be a problem since the
negotiation admits caps subsets try outs.

This patch solves the issue ignoring the profile negotiation in the caps. For
gstreamer < 1.5 the profile string is not handled, so the auto-plugging get
done without the vc1 parser, such as happens in gstreamer 1.5.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
9 years agoMarking rank of vaapidecodebin as GST_RANK_MARGINAL for now.
Sreerenj Balachandran [Tue, 7 Jul 2015 17:57:20 +0000 (20:57 +0300)]
Marking rank of vaapidecodebin as GST_RANK_MARGINAL for now.

Unfortunately vaapidecodebin element is not seems to be stable
enough for autoplugging ahead of vaapidecode.
Lowering the rank for now (cosidering the immediate 0.6 release).

See this: https://bugzilla.gnome.org/show_bug.cgi?id=749554

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agobuild: Add missing CFLAGS to Makefile.am
Sreerenj Balachandran [Tue, 7 Jul 2015 10:32:18 +0000 (13:32 +0300)]
build: Add missing CFLAGS to Makefile.am

9 years agogstvaapifilter: Only register STE property if it supported by corresponding VA library
Sreerenj Balachandran [Fri, 3 Jul 2015 12:07:02 +0000 (15:07 +0300)]
gstvaapifilter: Only register STE property if it supported by corresponding VA library

Fix the regression introduced in commit eb465fb.
VAProcFilterSkinToneEnhancement is avaialbe from VA >= 0.36.

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agovaapipostproc: no format convert on GL tex upload meta
Víctor Manuel Jáquez Leal [Thu, 2 Jul 2015 15:49:25 +0000 (17:49 +0200)]
vaapipostproc: no format convert on GL tex upload meta

When GL texture upload meta is negotiated, vaapipostproc shall not modify the
color format of the buffer.

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

9 years agogstvaapifilter: Add guard for VAProcFilterSkinToneEnhancement
Sreerenj Balachandran [Fri, 3 Jul 2015 09:42:09 +0000 (12:42 +0300)]
gstvaapifilter: Add guard for VAProcFilterSkinToneEnhancement

VAProcFilterSkinToneEnhancement is avaialbe from VA >= 0.36.

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agoencoder:h265: Fix the check for packed-header support
Sreerenj Balachandran [Thu, 2 Jul 2015 18:57:38 +0000 (21:57 +0300)]
encoder:h265: Fix the check for packed-header support

Use VA_ENC_PACKED_HEADER_* definition for checking.

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agoencoder:h264: Fix the check for packed-header support
Sreerenj Balachandran [Thu, 2 Jul 2015 18:37:56 +0000 (21:37 +0300)]
encoder:h264: Fix the check for packed-header support

Use VA_ENC_PACKED_HEADER_* definition for checking.

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agoencoder: h264: submit SEI buffering_period() and picture_timing() messages for CBR...
Sreerenj Balachandran [Thu, 2 Jul 2015 18:00:14 +0000 (21:00 +0300)]
encoder: h264: submit SEI buffering_period() and picture_timing() messages for CBR mode

One buffering_period() SEI message shall be present in every IDR access unit
when NalHrdBpPresentFlag is inferred to be equal to 1. This is the case when we
use a non-CQP mode, e.g. CBR. In other words, when
nal_hrd_parameters_present_flag is set to 1.

One picture_timing() SEI messages shall be present in every access unit
if CpbDpbDelaysPresentFlag is equal to 1 or pic_struct_present_flag is equal to 1

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

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agovaapidecodebin: notify if vpp is disabled
Víctor Manuel Jáquez Leal [Wed, 1 Jul 2015 12:16:50 +0000 (14:16 +0200)]
vaapidecodebin: notify if vpp is disabled

When the system is aware that VPP is not available by the VA driver,
it would be useful to notify to the user that the disable-vpp property
has changed.

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

9 years agovaapidecodebin: enable vpp if it is available
Víctor Manuel Jáquez Leal [Wed, 1 Jul 2015 12:17:17 +0000 (14:17 +0200)]
vaapidecodebin: enable vpp if it is available

Instead of creating and adding VPP into the bin at setup, we wait until
we are sure the VA driver supports it. We know that when the VA video
context is received by the bin. Afterwards, it is decided to instanciate
and link the VPP or not.

This is more efficient and safer than waiting the VPP to fail and then
disable it.

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

9 years agotests: Fix compilation while enabling egl as the only renderer in build
Sreerenj Balachandran [Thu, 2 Jul 2015 09:29:32 +0000 (12:29 +0300)]
tests: Fix compilation while enabling egl as the only renderer in build

Include missing header files gstvaapidisplay_egl.h and gstvaapiwindow_egl.h.

9 years agoconfigure: fix the build while enabling egl as the only renderer
Sreerenj Balachandran [Thu, 2 Jul 2015 07:45:50 +0000 (10:45 +0300)]
configure: fix the build while enabling egl as the only renderer

9 years agolibs: Bump library major version
Sreerenj Balachandran [Thu, 2 Jul 2015 07:25:25 +0000 (10:25 +0300)]
libs: Bump library major version

9 years agogst/vaapi: Switch to upstreram like indentation.
Sreerenj Balachandran [Tue, 30 Jun 2015 06:44:18 +0000 (09:44 +0300)]
gst/vaapi: Switch to upstreram like indentation.

gst-indent for all gst/vaapi/*.c source files

9 years agovaapidecodebin: Add property to disable VPP
Sreerenj Balachandran [Tue, 30 Jun 2015 06:35:37 +0000 (09:35 +0300)]
vaapidecodebin: Add property to disable VPP

Adding a new propery "disable-vpp", enabling it will prevent
the insertion of vaapipostproc child element.

This is helpful in debugging, specifically to narrow-down the
vaapidecodebin/vaapipostproc related negotiation issues.

No support for run-time disabling for now.

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

9 years agovaapipostproc: Fix wrong selection of passthrough mode.
Sreerenj Balachandran [Mon, 29 Jun 2015 10:35:59 +0000 (13:35 +0300)]
vaapipostproc: Fix wrong selection of passthrough mode.

The Current code path is falling back to passthorugh mode if there is no
vpp property set by the user explictily. But we should not use the
passthrough mode if the negotiated src pad caps have a differnt color space
format than sink pad caps (Even though the user didn't set the format property
explicitly).

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

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agovaapipostproc: prevent advanced-deinterlacing of non-native video formats.
Sreerenj Balachandran [Mon, 29 Jun 2015 10:20:28 +0000 (13:20 +0300)]
vaapipostproc: prevent advanced-deinterlacing of non-native video formats.

This is a workaround to deal with the va-intel-driver for non-native
formats while doing advanced deinterlacing. The format of reference surfaces must
be same as the format used by the driver internally for motion adaptive
deinterlacing and motion compensated deinterlacing.

A permanent solution could be to do the color space conversion internally
for reference surfaces.

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

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agoWork around ABBA deadlock between vaapisink and vaapipostproc
Simon Farnsworth [Mon, 29 Jun 2015 10:06:30 +0000 (13:06 +0300)]
Work around ABBA deadlock between vaapisink and vaapipostproc

vaapisink takes the display lock, then does a gst_buffer_replace which can
take the lock on the gst_vaapi_video_pool.

vaapipostproc asks the gst_vaapi_video_pool for a new surface. This takes
the lock on the gst_vaapi_video_pool; if you're unlucky, there are no free
surfaces, which means that gst_vaapi_surface_create is
called. gst_vaapi_surface_create takes the display lock.

If vaapisink and vaapipostproc are in different threads, and this happens,
you get a deadlock. vaapisink holds the display lock, and wants the
gst_vaapi_video_pool lock. vaapipostproc holds the gst_vaapi_video_pool lock
and wants the display lock.

Work around this by releasing the display lock in vaapisink around the
gst_buffer_replace.

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

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agovaapidecodebin: expose deinterlace-method property from inner vaapipostproc
Jacobo Aragunde Pérez [Wed, 29 Apr 2015 14:34:07 +0000 (16:34 +0200)]
vaapidecodebin: expose deinterlace-method property from inner vaapipostproc

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

9 years agovaapipostproc: log negotiated caps
Víctor Manuel Jáquez Leal [Tue, 19 May 2015 09:24:10 +0000 (11:24 +0200)]
vaapipostproc: log negotiated caps

9 years agovaapipostproc: remove useless debug message
Víctor Manuel Jáquez Leal [Mon, 18 May 2015 12:30:22 +0000 (14:30 +0200)]
vaapipostproc: remove useless debug message

9 years agovaapidecode: log negotiated src/sink caps
Víctor Manuel Jáquez Leal [Thu, 12 Feb 2015 11:31:57 +0000 (12:31 +0100)]
vaapidecode: log negotiated src/sink caps

9 years agovaapisink: error handling if rendering fails
Víctor Manuel Jáquez Leal [Thu, 7 May 2015 13:57:26 +0000 (15:57 +0200)]
vaapisink: error handling if rendering fails

This patch enhance the code path when an error is found when rendering a
buffer.

If the video meta doesn't contain a surface proxy or a surface, a warning
message is printed.

If the rendering backend fails, a error message is posted in the bus.

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

9 years agovaapisink: Fix the conditional pad template creation.
Sreerenj Balachandran [Thu, 18 Jun 2015 11:55:12 +0000 (14:55 +0300)]
vaapisink: Fix the conditional pad template creation.

9 years agobuild: Don't build simple-encoder test program if there is no VA Encoding support
Sreerenj Balachandran [Thu, 18 Jun 2015 10:19:26 +0000 (13:19 +0300)]
build: Don't build simple-encoder test program if there is no VA Encoding support

This will fix the build error against older VA-APIs <= 0.32

9 years agoFix build error for older VA-API versions
Sreerenj Balachandran [Thu, 18 Jun 2015 09:20:37 +0000 (12:20 +0300)]
Fix build error for older VA-API versions

Provide guards for VA_SURFACE_ATTRIB_MEM_TYPE_KERNEL_DRM and
VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME which are only availble from
VA >= 0.36.

9 years agovaapisink: Fix the capsfeature advertisement in padtemplate
Sreerenj Balachandran [Wed, 17 Jun 2015 11:20:37 +0000 (14:20 +0300)]
vaapisink: Fix the capsfeature advertisement in padtemplate

This fixes the regression introduced in 64acc74.

If a pad supports multiple set of capsfeatures, it needs to add
multiple equal structures with different feature sets to the caps.
Because caps structures with the same name but with a non-equal
set of caps features are not compatible.

Without this patch, playbin will autoplug xvimagesink instead of vaapisink.

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

9 years agovaapisink: Expose the overlay capability for compatibility with dvbsuboverlay.
Adrian Cox [Wed, 17 Jun 2015 09:41:28 +0000 (12:41 +0300)]
vaapisink: Expose the overlay capability for compatibility with dvbsuboverlay.

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

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
9 years agovaapipluginbase: Override downstream allocation reply if no pool
Olivier Crete [Wed, 17 Jun 2015 06:53:29 +0000 (09:53 +0300)]
vaapipluginbase: Override downstream allocation reply if no pool

If the downstream replied without a pool, then override it.

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

9 years agovaapipostproc: add color balance interface
Víctor Manuel Jáquez Leal [Tue, 9 Jun 2015 13:15:31 +0000 (15:15 +0200)]
vaapipostproc: add color balance interface

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

9 years agovaapipostproc: add skin tone enhancement
Víctor Manuel Jáquez Leal [Fri, 22 May 2015 16:13:25 +0000 (18:13 +0200)]
vaapipostproc: add skin tone enhancement

Added the 'skin-tone-enhancement' property to vaapostproc.

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

9 years agodoc: add VA-API reference in freedesktop
Víctor Manuel Jáquez Leal [Wed, 20 May 2015 16:02:37 +0000 (18:02 +0200)]
doc: add VA-API reference in freedesktop

9 years agopatches/videoparsers: rebase all the h264parse patches
Víctor Manuel Jáquez Leal [Thu, 4 Jun 2015 17:03:44 +0000 (19:03 +0200)]
patches/videoparsers: rebase all the h264parse patches

In order to avoid the creation of .orig files and break the distcheck target

9 years agobuild: don't build in parallel libvpx
Víctor Manuel Jáquez Leal [Thu, 4 Jun 2015 16:29:15 +0000 (18:29 +0200)]
build: don't build in parallel libvpx

This fixes the distcheck -j XX target.

9 years agoencoder: jpeg: Fix the packed header generation
Sreerenj Balachandran [Tue, 2 Jun 2015 05:52:53 +0000 (08:52 +0300)]
encoder: jpeg: Fix the packed header generation

This is a work-around to satisfy the va-intel-driver.
Normalize the quality factor and scale QM values (only for packed header
generation) similar to what VA-Intel driver is doing . Otherwise the
generated packed headers will be wrong, since the driver itself is
scaling the QM values using the normalized quality factor.

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

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agodecoder: h264: fix uninitialized variables in avcC mode.
Gwenole Beauchesne [Tue, 2 Jun 2015 09:46:00 +0000 (11:46 +0200)]
decoder: h264: fix uninitialized variables in avcC mode.

Fix uninitialized variables when decoding SPS and PPS NAL units from
"codec-data" buffers. This is particularly important when seeking ops
are involved, and the new persistent states are used more often.

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

9 years agovaapidecode: remove unneeded casting
Víctor Manuel Jáquez Leal [Mon, 1 Jun 2015 16:39:18 +0000 (18:39 +0200)]
vaapidecode: remove unneeded casting

And a code-style fix

9 years agovaapidecode: calculate decoding latency
Víctor Manuel Jáquez Leal [Thu, 21 May 2015 17:38:33 +0000 (19:38 +0200)]
vaapidecode: calculate decoding latency

This is a naïve approach to the calculation of the VA-API decoding latency. It
takes into consideration when the frame-rate has some insane value.

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

9 years agoconfigure: Compiling against libgstgl requires libgstvideo
Jan Schmidt [Thu, 21 May 2015 13:16:14 +0000 (23:16 +1000)]
configure: Compiling against libgstgl requires libgstvideo

Fix detection of the GstGL helper headers in uninstalled
builds.

9 years agoencoder: hevc: Fix the size over-flow for encoded buffer.
Sreerenj Balachandran [Thu, 28 May 2015 07:52:48 +0000 (10:52 +0300)]
encoder: hevc: Fix the size over-flow for encoded buffer.

The approximation of 6 times compression ratio migh not
work in all cases. Especially when enabling I frames.
Provide large enough size for coded-buffer creation.

9 years agoencoder: vp8: Fix the size over-flow for encoded buffer.
Sreerenj Balachandran [Thu, 28 May 2015 07:43:20 +0000 (10:43 +0300)]
encoder: vp8: Fix the size over-flow for encoded buffer.

The approximation of 4 times compression ratio will not
work in all cases. Especially when enabling I frames.
Provide large enough size for coded-buffer creation.

9 years agoencoder: hevc: fix bug in multi slice encoding.
Sreerenj Balachandran [Thu, 28 May 2015 02:43:49 +0000 (05:43 +0300)]
encoder: hevc:  fix bug in multi slice encoding.

This is a work-around for satisfying the VA-Intel driver.
The driver only support slices begin from CTU row start address.

Multi-Slice encoding also requires a fix in va-intel-driver:
http://lists.freedesktop.org/archives/libva/2015-May/003351.html

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

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agodecoder: h264: add initial support for loss of pictures.
Gwenole Beauchesne [Thu, 12 Mar 2015 21:57:22 +0000 (22:57 +0100)]
decoder: h264: add initial support for loss of pictures.

Implement decoding process for gaps in frame_num (8.5.2). This
also somewhat supports unintentional loss of pictures.

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

Original-patch-by: Wind Yuan <feng.yuan@intel.com>
[fixed derivation of POC, ensured clone is valid for reference,
 actually fixed detection of gaps in FrameNum by PrevRefFrameNum]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
9 years agodecoder: h264: add support for missing first field.
Gwenole Beauchesne [Fri, 22 May 2015 09:42:52 +0000 (11:42 +0200)]
decoder: h264: add support for missing first field.

Try to identify missing first fields too, thus disregarding any
intermediate gaps in frames. We also assume that we keep the same
field sequence, i.e. if previous frames were in top-field-first
(TFF) order, then so are subsequent frames.

Note that insertion of dummy first fields need to operate in two
steps: (i) create the original first field that the current field
will inherit from, and (ii) submit that field into the DPB prior
to initializing the current (other) field POC values but after any
reference flag was set. i.e. copy reference flags from the child
(other field) to the parent (first field).

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

9 years agodecoder: h264: add support for missing second field.
Gwenole Beauchesne [Thu, 7 May 2015 12:00:58 +0000 (14:00 +0200)]
decoder: h264: add support for missing second field.

Interlaced H.264 video frames always have two fields to decode and
display. However, in some cases, e.g. packet loss, one of the field
can be missing. This perturbs the reference picture marking process,
whereby the number of references available in DPB no longer matches
the expected value.

This patch adds initial support for missing field within a decoded
frame. The current strategy taken is to find out the nearest field,
by POC value, and with the same parity.

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

9 years agodecoder: h264: improve tracking of "top-field-first" flag.
Gwenole Beauchesne [Fri, 22 May 2015 15:06:11 +0000 (17:06 +0200)]
decoder: h264: improve tracking of "top-field-first" flag.

Try to maintain a "top-field-first" (TFF) flag, even if the H.264 standard
does not mandate it. This will be useful for tracking missing fields, and
also for more correct _split_fields() implementation for frames in the DPB.

9 years agodecoder: h264: skip all pictures prior the first I-frame.
Gwenole Beauchesne [Tue, 5 May 2015 09:56:11 +0000 (11:56 +0200)]
decoder: h264: skip all pictures prior the first I-frame.

Don't try to decode pictures until the first I-frame is received within
the currently active sequence. There is no point is decoding and then
displaying frames with artifacts.

9 years agodecoder: h264: fix processing of EOSEQ NAL.
Gwenole Beauchesne [Tue, 12 May 2015 13:36:10 +0000 (15:36 +0200)]
decoder: h264: fix processing of EOSEQ NAL.

Fix decoding of end_of_seq() NAL unit so that to not submit the current
picture for decoding again. This is pretty vintage code that dates back
before the existing of the whole decoder units machinery.

One issue that could be arising if that code was kept is that we could
have submitted a picture, and subsequently a GstVideoCodec frame, twice.
Once without the decode_only flag set, and once with that flag set. The
end result is that the GstVideoDecoder would release the codec frame
twice, thus releasing stale data.

In short, the piece of code that is removed by this patch is for once
completely obsolete for a while, and secondly error-prone in corner
cases.

9 years agodecoder: add utility function to clone picture objects.
Wind Yuan [Thu, 28 Feb 2013 07:26:36 +0000 (15:26 +0800)]
decoder: add utility function to clone picture objects.

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

Signed-off-by: Wind Yuan <feng.yuan@intel.com>
[added cosmetic changes, fixed propagation of "one-field" flag to
 children, fixed per-codec clone modes (h264)]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
9 years agobuild: don't compile HEVC encoder if not supported
Alban Browaeys [Wed, 27 May 2015 20:49:18 +0000 (23:49 +0300)]
build: don't compile HEVC encoder if not supported

Fix:
(gst-plugin-scanner:16681): GStreamer-WARNING **: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvaapi.so': /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvaapi.so: undefined symbol: gst_vaapi_encoder_h265_get_default_properties

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

Signed-off-by: Alban Browaeys <prahal@yahoo.com>
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agoHEVC: decode: add missing va_dec_hevc header
Alban Browaeys [Wed, 27 May 2015 20:43:16 +0000 (23:43 +0300)]
HEVC: decode: add missing va_dec_hevc header

Signed-off-by: Alban Browaeys <prahal@yahoo.com>
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=749953

9 years agompeg2: fix PTS cache for GOP start.
Gwenole Beauchesne [Tue, 26 May 2015 11:28:32 +0000 (13:28 +0200)]
mpeg2: fix PTS cache for GOP start.

If the GOP temporal sequence number (TSN) is interpolated from a valid
PTS, then we need to compensate that PTS corresponding to the start of
GOP with the next picture to be decoded, which shall be an I-frame,
based on its sequence number.

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

9 years agompeg2: avoid crash when seeking with debug logs
Víctor Manuel Jáquez Leal [Wed, 27 May 2015 08:49:56 +0000 (10:49 +0200)]
mpeg2: avoid crash when seeking with debug logs

Move down the debug message when the state of the decoder is verified
so the slice header is not NULL.

9 years agompeg2: Avoid crashes and warnings on re-opened decoder after a seek
Jan Schmidt [Tue, 16 Dec 2014 13:41:10 +0000 (00:41 +1100)]
mpeg2: Avoid crashes and warnings on re-opened decoder after a seek

Reset state and add some checks for safe state to avoid a crash and
a warning after the decoder is destroyed/recreated during a seek.

9 years agopatches/videoparsers: Rebase the patch on top of gst-vaapi-branch commit 20ee952
Sreerenj Balachandran [Tue, 26 May 2015 07:21:59 +0000 (10:21 +0300)]
patches/videoparsers: Rebase the patch on top of gst-vaapi-branch commit 20ee952

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agocodecparsers: Update to gst-vaapi-branch commit 20ee952
Sreerenj Balachandran [Tue, 26 May 2015 07:03:20 +0000 (10:03 +0300)]
codecparsers: Update to gst-vaapi-branch commit 20ee952

b7dded3: h264parse: don't consider unknown stream-format as avc
5110ad9: h264parse: fix up handling of input caps corner cases
e51db3e: h264parse: Remove dead code
3d739d0: codecparser: h265: Fix the number of tile rows/columns parsing
8482957: h265parse: Fix profile, tier and level setting in caps
4649acb: h265parse: Fix the memory freeing of stored VPS nals
f2beeb7: h265parse: Fix source caps to report cropped dimensions
6886a31: h264parse: Fix profile and level setting in caps
5286c1a: h264parse: Consider SEI NALU as "HEADER" packets
eb97854: videoparsers: h264: bit-exact sync with upstream, minor changes here and there
53074fc: build: Upgrade GStreamer dependency to 1.0

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
9 years agoHEVC: decode: Replace clip3 implementation with glib CLAMP macro
Sreerenj Balachandran [Tue, 26 May 2015 03:01:10 +0000 (06:01 +0300)]
HEVC: decode: Replace clip3 implementation with glib CLAMP macro

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>