Commit graph

517 commits

Author SHA1 Message Date
Vincent Penquerc'h a06423efa4 h264parse: fix caps leak in renegotiation 2017-05-12 11:15:00 +01:00
Vincent Penquerc'h ba22007e2f jpeg2000parse: fix negotiation with j2c and jpc both allowed upstream
If upstream supports both, but downstream supports only jpc, j2c
would have been selected as the first in the caps.

https://bugzilla.gnome.org/show_bug.cgi?id=782221
2017-05-12 11:14:31 +01:00
Thibault Saunier 78022a6e0c docs: Port all docstring to gtk-doc markdown 2017-04-12 12:57:57 -03:00
Sebastian Dröge 8f8c5e25fa h264parse: frame->buffer can't be NULL in pre_push_frame()
CID 1402118
2017-03-08 14:22:52 +02:00
Hyunjun Ko a997a99fdd h264parse: fix some failures in testcases
Move logic of judgement whether or not to insert AU Delimiter before
draining.
Besides, aud_needed flag is reset to TRUE when skip.

https://bugzilla.gnome.org/show_bug.cgi?id=736213
2017-03-08 14:18:18 +02:00
Hyunjun Ko 201e71c3aa h264parse: insert AU delimiter only in case of byte-stream
Inserts AU delimeter by default if missing au delimeter from upstream.
This should be done only in case of byte-stream format.

Note that:
We have to compensate for the new bytes added for the AU, otherwise
insertion of PPS/SPS will use wrong offsets and overwrite wrong data.

Also mark the AU delimiter blob const, and use frame->out_buffer for
storing the output to keep baseparse assumptions valid.

Original-Patch-By: Michal Lazo <michal.lazo@mdragon.org>
Helped by Sebastian Dröge <sebastian@centricular.com>

https://bugzilla.gnome.org/show_bug.cgi?id=736213
2017-03-07 13:27:33 +02:00
Thibault Saunier b75a61342f h264parse: Include interlace-mode in caps
Those are the rules:

In the SPS:
  * if frame_mbs_only_flag=1 => all frame progressive
  * if frame_mbs_only_flag=0 => field_pic_flag defines if each frame is
    progressive or interlaced, thus the mode is 'mixed' in GStreamer
    terms.

https://bugzilla.gnome.org/show_bug.cgi?id=779309
2017-02-27 15:28:31 -03:00
Mark Nauwelaerts dc970791b8 mpeg4videoparse: determine intra of frame at frame parse time
... rather than when determining when to end the frame.
The opportunity to do so might not come when forced to drain,
and it seems nicer anyway to do so at parse wrapup time.
2016-12-28 13:54:24 +01:00
Sebastian Dröge 55043aff12 h264parse: Fix indentation 2016-11-26 12:16:58 +02:00
Sebastian Dröge cb4ccecc97 h265parse: Fix assertion when encountering an invalid NALU
Error out properly instead.

https://bugzilla.gnome.org/show_bug.cgi?id=775130
2016-11-26 12:16:58 +02:00
Sebastian Dröge 47bf425cba h264parse: Fix assertion when encountering an invalid NALU
Error out properly instead.

https://bugzilla.gnome.org/show_bug.cgi?id=775130
2016-11-26 12:16:58 +02:00
Sebastian Dröge 43736e5c37 h265parse: Ensure codec_data has the required size when reading number of NAL arrays
https://bugzilla.gnome.org/show_bug.cgi?id=774896
2016-11-23 10:53:46 +02:00
Sebastian Dröge 1dbfef93d6 h264parse: Ensure codec_data has the required size when reading number of SPS
https://bugzilla.gnome.org/show_bug.cgi?id=774896
2016-11-23 10:53:40 +02:00
Sebastian Dröge 0f657cec07 vc1parse: Mark pad as needing reconfiguration again if it failed
And return FLUSHING instead of NOT_NEGOTIATED on flushing pads.

https://bugzilla.gnome.org/show_bug.cgi?id=774623
2016-11-18 12:22:44 +02:00
Nirbheek Chauhan bb0a83b018 plugins: Use explicit type conversion from enums
MSVC warns about this because it's a C++ compiler, and this actually
results in useful things such as the incorrect 'gboolean' return value
for functions that return GstFlowReturn, so let's do explicit
conversions to reduce the noise and increase its efficacy.
2016-10-27 23:06:26 +05:30
Kyungyong Kim 214a041e13 h265parse: Fix parsing of multiple NALs in the hvcC box
https://bugzilla.gnome.org/show_bug.cgi?id=771970
2016-09-26 09:35:25 +03:00
Sebastian Dröge 8daf628910 jpeg2000parse: Don't pass NULL strings to the colorspace / sampling parsing functions
They assert on NULL.
2016-09-24 10:05:49 -04:00
Nirbheek Chauhan 42af2d66d8 Add support for Meson as alternative/parallel build system
https://github.com/mesonbuild/meson

With contributions from:

Tim-Philipp Müller <tim@centricular.com>
Matej Knopp <matej.knopp@gmail.com>
Jussi Pakkanen <jpakkane@gmail.com> (original port)

Highlights of the features provided are:
* Faster builds on Linux (~40-50% faster)
* The ability to build with MSVC on Windows
* Generate Visual Studio project files
* Generate XCode project files
* Much faster builds on Windows (on-par with Linux)
* Seriously fast configure and building on embedded

... and many more. For more details see:

http://blog.nirbheek.in/2016/05/gstreamer-and-meson-new-hope.html
http://blog.nirbheek.in/2016/07/building-and-developing-gstreamer-using.html

Building with Meson should work on both Linux and Windows, but may
need a few more tweaks on other operating systems.
2016-08-20 11:35:54 +01:00
Sreerenj Balachandran 14cc51cddc videoparsers: h264: Add more scalable profiles to the profile list
Adding Scalable Constrained High (G.10.1.2.1) and
Scalable High Intra(G.10.1.3) profiles to the profile list

https://bugzilla.gnome.org/show_bug.cgi?id=769303
2016-08-02 14:26:40 +03:00
Sebastian Dröge 064f46e9e1 jpeg2000parse: Use correct enum type
GST_JPEG2000_SAMPLING_RGB instead of GST_JPEG2000_COLORSPACE_RGB

https://bugzilla.gnome.org/show_bug.cgi?id=768696
2016-07-12 00:02:53 +03:00
Luis de Bethencourt 418e643b61 gstjpeg2000parse: no need for else after a goto
else clause is redundant when the end of the if statement is a jump.
If we haven't gone to the beach, we are in the false branch.
2016-07-01 14:08:13 +01:00
Aaron Boxer 154698389d gstjpeg2000parse: improved parsing of jpc magic and j2c box
https://bugzilla.gnome.org/show_bug.cgi?id=767512
2016-07-01 13:15:11 +01:00
Edward Hervey c19d1b46c3 h264parse: Drop filler data
When skipping data, check if they are filler bytes. If so, drop the
data instead of skipping. We don't want to output filler bytes, but they
shouldn't cause a discontinuity.

https://bugzilla.gnome.org/show_bug.cgi?id=768125
2016-06-30 10:32:01 +02:00
Jan Schmidt 92e7e3a3bf h264parse: When input alignment=AU, always drain each packet.
If the input alignment claims AU alignment, each received
buffer should contain a complete video frame, so never hold over parts
of buffers for later processing. Also reduces latency, as packets
are parsed/converted and output immediately instead of 1 buffer
later.

Fixes a problem where an (arguably disallowed) padding byte on the
end of a buffer is detected as an extra byte in the following
start code, and messes up the timestamping that should apply to
that start code.
2016-06-24 22:55:18 +10:00
Tim-Philipp Müller cb7b6e7a90 videoparsers: fix broken include 2016-06-24 09:39:00 +01:00
Aaron Boxer e7e6a3579d jpeg2000parse: use enums for colorspace and sampling, rather than strings
Also, move gstjpeg2000sampling to codecparsers project

https://bugzilla.gnome.org/show_bug.cgi?id=767908
2016-06-24 11:23:31 +03:00
Aaron Boxer 81e3b998be jpeg2000parse: support j2c format
https://bugzilla.gnome.org/show_bug.cgi?id=767512
2016-06-17 23:08:37 +03:00
Mats Lindestam a0876aa750 h264parse: support for handling of config-interval = -1
Added support for handling of config-interval = -1.
config-inteval = -1 represents resending SPS and PPS for each
I-/IDR-frame.

https://bugzilla.gnome.org/show_bug.cgi?id=766803
2016-06-13 10:10:21 +01:00
Mats Lindestam bf0d952387 h264parse: refactored handling of SPS/PPS when pushing frames
https://bugzilla.gnome.org/show_bug.cgi?id=766803
2016-06-13 10:10:05 +01:00
Mats Lindestam 0c04e004bb h264parse: change "config-interval" property type from uint to int
So we can use -1 as special value like in rtph264pay.

https://bugzilla.gnome.org/show_bug.cgi?id=766803
2016-06-13 10:08:22 +01:00
Aaron Boxer 3dc3a915ea jpeg2000parse: Require either colorspace or sampling field in sink caps
And always set the sampling field on the src caps, if necessary guessing a
correct value for it from the colorspace field.

Also, did some cleanup: removed sampling enum - redundant.

https://bugzilla.gnome.org/show_bug.cgi?id=766236
2016-06-10 16:25:50 +03:00
Aaron Boxer fffee978c2 jpeg2000parse: Add JPEG2000 parser element
https://bugzilla.gnome.org/show_bug.cgi?id=766236
2016-06-07 15:29:41 +03:00
Aaron Boxer eebb65e934 openjpeg: set sampling in the caps
https://bugzilla.gnome.org/show_bug.cgi?id=766236
2016-06-07 15:24:32 +03:00
Scott D Phillips 3edd641667 h265parse: Don't assume contiguous id's in make_codec_data
vps/sps/pps id's are not required to be used contiguously.

https://bugzilla.gnome.org/show_bug.cgi?id=766891
2016-05-30 12:42:24 +03:00
Sebastian Dröge 920ad27122 h265parse: H265 level idc 0 is not valid
Don't put level=0 into the caps, it confuses other elements.

https://bugzilla.gnome.org/show_bug.cgi?id=765538
2016-04-25 18:50:59 +03:00
Sebastian Dröge 4bdda1d810 h264parse: H264 level idc 0 is not valid
Don't put level=0 into the caps, it confuses other elements.

https://bugzilla.gnome.org/show_bug.cgi?id=765538
2016-04-25 18:50:59 +03:00
Sebastian Dröge 0fa43aaab4 h264parse: constrained-baseline is a subset of baseline
We get into this code path if the profile is already constrained-baseline and
downstream does not support constrained-baseline. So we should try baseline
and the other compatible profiles.

https://bugzilla.gnome.org/show_bug.cgi?id=764448
2016-04-01 12:08:29 +03:00
Vineeth TM 8cdfb13658 bad: use new gst_element_class_add_static_pad_template()
https://bugzilla.gnome.org/show_bug.cgi?id=763081
2016-03-24 14:56:51 +02:00
Aleksander Wabik d8e681bb63 h264parse, h265parse: fix handling of downstream force-key-unit events
The parser handles the downstream force-key-unit event incorrectly,
it tries to parse it as an upstream force-key-unit event, does not
check the return value, and then uses uninitialized memory in
"all_headers" boolean variable.

https://bugzilla.gnome.org/show_bug.cgi?id=763793
2016-03-17 19:24:32 +00:00
Sreerenj Balachandran 92f4eb45ab videoparsers: h265: Fix segfault while transforming hevc to nal aligned bytestream
Create temporary ParseFrame and copy the nal size buffer region
for each nal unit like we did for h264.

https://bugzilla.gnome.org/show_bug.cgi?id=763494
2016-03-11 17:34:03 +02:00
Edward Hervey 5ebf1d477d mpegvideoparser: Handle non-hierarchical profiles again
This is a regression from since mpegvideoparser was switched to
use the codecparsing library.

The problem is that the high bit of the profile_and_level is used
to specify non-hierarchical profiles and levels. Unfortunately we
were discarding that information.

Expose that escape bit, and use it in the element

https://bugzilla.gnome.org/show_bug.cgi?id=763220
2016-03-09 15:18:42 +01:00
Sreerenj Balachandran cf7056a312 videoparsers: h264: Disable passthorugh mode enabling
Enabling passthorugh mode is causing multiple issue:
For nal aligned multiresoluton streams, passthrough mode
make h264parse unable to advertise the new resoultions.
Also causing issues while parsing MVC streams which have two
separate layers (base-view and non-base-view).

This fix is only a temporary workaround.

For MVC, proper fixes needed in many places:
(handle prefix nal unit, handle non-base-view slice nal extension,
fix the picture_start detection for multi-layer-mvc streams etc)

https://bugzilla.gnome.org/show_bug.cgi?id=758656
2016-02-29 12:35:58 +02:00
Luis de Bethencourt 63af4649c6 h264parse: remove unused mview_mode value
Since commit b77f8e172a the new value
assigned to mview_mode hasn't been used. That commit changed the following
"if" check to an "else if", which means the original value of mview_mode
is used.
2016-02-04 12:50:47 +00:00
Matthew Waters 2a49811721 h265parse: avoid sending unnecessary downstream caps queries/events
h265 versions of the following commits:
f352691a04
try the current caps before querying downstream
72bc7d7f73
increase caps equality check for no codec_data

https://bugzilla.gnome.org/show_bug.cgi?id=761014
2016-02-04 18:19:40 +11:00
Matthew Waters 72bc7d7f73 h264parse: increase caps equality check for no codec_data
When converting from avc to byte-stream, there will not be any codec_data
in the src caps.  Remove it before the equality check to avoid sending caps
events downstream on every SPS/PPS change.

https://bugzilla.gnome.org/show_bug.cgi?id=761014
2016-02-04 18:07:57 +11:00
Matthew Waters f352691a04 h264parse: try the current caps before querying downstream
If we have a stream that contains an unchanging SPS/PPS for every video frame,
we don't need to to constantly query downstream for it's supported caps if the
current caps are compatible with the negotiated caps.

https://bugzilla.gnome.org/show_bug.cgi?id=761014
2016-02-04 18:07:47 +11:00
Vineeth TM e389211aa5 h265parse: Fix buffer leak when sps is not present
When sps data is NULL, the buffer allocated and mapped is not being freed.
In this scenario there is no need to allocate the buffer as we are supposed to return NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=761070
2016-01-25 10:07:55 -03:00
Vineeth TM 6a35a4018e h265parse: Fix buffer memory leak.
While setting caps, codec_data buffer is mapped, but not being unmapped
leading to memory leaks.

https://bugzilla.gnome.org/show_bug.cgi?id=761070
2016-01-25 10:07:55 -03:00
Dave Craig 88d7beb921 videoparsers: Check for NULL return value of gst_pad_get_current_caps()
https://bugzilla.gnome.org/show_bug.cgi?id=759503
2015-12-16 10:08:43 +01:00
Vineeth TM 7c42ba97d7 plugins-bad: Fix example pipelines
rename gst-launch --> gst-launch-1.0
replace old elements with new elements(ffmpegcolorspace -> videoconvert, ffenc_** -> avenc_**)
fix caps in examples

https://bugzilla.gnome.org/show_bug.cgi?id=759432
2015-12-15 10:30:49 +00:00
Nicolas Dufresne fe116092cd h26xparse: Resend PPS/SPS after seek
This is to support byte-stream decoder that does not remember the
PPS/SPS after a flush. This is not needed by all decoders, but is
harmless for those that do remember.

https://bugzilla.gnome.org/show_bug.cgi?id=758405
2015-12-05 19:05:26 -05:00
Luis de Bethencourt c8d4e85f9e vc1parse: add break to switch case
Even though all cases inside VC1_STREAM_FORMAT_ASF are goto or
g_assert_not_reached(), add a break at the end to appease Coverity.

CID #1320706
2015-09-29 13:34:15 +01:00
Nicolas Dufresne b392a6e3b9 h264parse/h265parse: Fix negotiation crash
As it's recursive, gst_pad_get_allowed_caps() may also return
empty for anything incompatible downstream. EMPTY is not valid caps
value for gst_caps_fixate(). This lead to assertion and then crash.
Ideally, the negotiate function should be re-factored to have a return
value, and we could make the negotiation fails earlier.

https://bugzilla.gnome.org/show_bug.cgi?id=754122
2015-08-26 10:56:07 -04:00
Olivier Crête 567b1e8c46 videoparsers: Use gst_base_parse_merge_tags()
Instead of squashing all upstream tags

https://bugzilla.gnome.org/show_bug.cgi?id=679768
2015-08-16 17:28:29 +01:00
Jan Schmidt fdac09d843 h264parse: Clear SPS info after processing.
The SPS struct might be filled out by a call to
gst_h264_parser_parse_subset_sps, which fills out
dynamically allocated data and requires a call
to gst_h264_sps_clear() to free it. Also make sure
to clear out any allocated SPS data when returning
an error.

https://bugzilla.gnome.org/show_bug.cgi?id=753306
2015-08-15 15:39:23 +10:00
Thiago Santos 8f855a8b78 pngparse: enable accept-intersect and accept-template flags on sinkpad
Do a quick check with the pad template caps as it is enough. Users
should have figured the appropriate full caps on a previous caps query

https://bugzilla.gnome.org/show_bug.cgi?id=753623
2015-08-14 13:42:59 -03:00
Thiago Santos c4cd1ce4fd videoparsers: enable accept-template flag
Do a quick check with the pad template caps as it is enough. Users
should have figured the appropriate full caps on a previous caps query

https://bugzilla.gnome.org/show_bug.cgi?id=753623
2015-08-14 13:42:59 -03:00
Sreerenj Balachandran a83dabd5e8 videoparsers: h265: Fix the frame start detection code
Check slice headers in between GST_H265_NAL_SLICE_TRAIL_N
and GST_H265_NAL_SLICE_RASL_R for frame start detection.

https://bugzilla.gnome.org/show_bug.cgi?id=753497
2015-08-11 11:34:36 +01:00
Sreerenj Balachandran 2775b202dc videoparsers: h265: Avoid skipping of EOS and EOB nals
EndOfSequence and EndOfBitstream nal units have size of 2 bytes.
Don't consider them as broken nals.

https://bugzilla.gnome.org/show_bug.cgi?id=753497
2015-08-11 11:34:36 +01:00
Sreerenj Balachandran 69becd734d h265parse: expose compatible profiles to downstream
Some video bitstreams report a too restrictive set of profiles. If a video
decoder was to strictly follow the indicated profile, it wouldn't support that
stream, whereas it could in theory and in practice. So we should relax the
profile restriction for allowing the decoder to get connected with parser.

https://bugzilla.gnome.org/show_bug.cgi?id=747613
2015-08-07 13:11:53 +02:00
Vineeth TM 09992f32dc h265parse: Avoid checking for Non Mandatory VPS NAL
VPS is not mandatory, and need not check for its presence before setting
the caps. Because of the check, in streams which don't have VPS,
sticky event mishandling happens.

https://bugzilla.gnome.org/show_bug.cgi?id=752807
2015-07-30 15:10:05 +01:00
Jan Schmidt c1b0d818bb h264parse: Add more NAL types for debugging output.
Register more NAL unit types so that they are dumped
by name in the debug output instead of being labelled
'Invalid'
2015-07-29 23:10:49 +10:00
Vineeth TM 9b43bed607 h263parse: fix caps memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=752991
2015-07-29 09:25:47 +01:00
Jan Schmidt 48a1f27923 h264parse: Don't discard first AU delimiter
Don't throw away AU delimiter(s) that precede the SPS/PPS. Should
fix MPEG-TS playback on iOS/Quicktime when muxing streams that
already have AU delimiters.

See https://bugzilla.gnome.org/show_bug.cgi?id=736213 for getting
h264parse to insert AU delimiters when they don't already
exist.
2015-07-24 02:46:21 +10:00
Roman Donchenko 649e76575d pngparse: fix a GstCaps object leak
https://bugzilla.gnome.org//show_bug.cgi?id=752127
2015-07-08 17:26:59 +01:00
Tim-Philipp Müller 1bf7ca64c0 h264parse: fix typo in log message 2015-06-20 16:07:57 +01:00
Jan Schmidt b77f8e172a h264parse: Move PAR calcs, and use them for stereoscopic half-aspect
Move the pixel-aspect-ratio calculations higher up in caps
determination, so the results are available for a call to
gst_video_multiview_guess_half_aspect() when stereoscopic video
is detected.
2015-06-19 01:49:33 +10:00
Jan Schmidt 08c73f9cc7 h264parse: Add support for passing stereoscopic/multiview info
Pass any multiview info from the container or SEI info downstream
2015-06-12 00:39:15 +10:00
Jan Schmidt e8908f5aee h264parse: Don't switch to passthrough on set_caps()
Wait until at least one keyframe has been parsed before
deciding to switch to passthrough mode, in case the
stream contains SEI messages that supplement the output
caps - for example by providing stereoscopic information
2015-06-12 00:39:15 +10:00
Edward Hervey 898b436219 h263parse: Fix PSC matching
We were off by one byte in the matching

It should be (using 24 bit matching):
   * startcode  : 0000 0000 0000 0000 1000 00xx
   * mask (bin) : 1111 1111 1111 1111 1111 1100
   * mask (hex) :    f    f    f    f    f    c
   * match      :    0    0    0    0    8    0

https://bugzilla.gnome.org/show_bug.cgi?id=750685
2015-06-11 08:27:19 +02:00
Luis de Bethencourt a85a8afc3e vc1parse: remove useless value assignments
In all these cases ret is set but overwritten before the return of the function
2015-06-03 15:25:16 +01:00
Edward Hervey 69c09c38cf h264parse: Consider SEI NALU as "HEADER" packets
Like SPS/PPS they do contain information which will be needed to
decode the following data (as per definition of the flag)

Also ensures that the series of SPS/PPS/SEI NALU before a keyframe
can be considered as one contiguous header
2015-05-20 15:41:11 +02:00
Lyon Wang 6adf3c2499 h263parse: fix custom picture format (CPFMT) parsing
In the H263 spec, CPFMT is present only if the use of a custom
picture format is signalled in PLUSEPTYPE and UFEP is "001",
so we need to check params->format and only if the value is
6 (custom source format) the CPFMT should be read, otherwise
it's not present and wrong data will be parsed.

When reading the CPFMT, the width and height were not
calculated correctly (wrong bitmask).

https://bugzilla.gnome.org//show_bug.cgi?id=749253
2015-05-13 11:51:20 +01:00
Luis de Bethencourt 8899efae60 Update references to decodebin
Update old references for decodebin2 to decodebin.
2015-05-08 13:54:08 +01:00
Sreerenj Balachandran 3fae18b5d2 h264parse: Fix profile and level setting in caps
Don't use the apis in codec-utils to extract the profile and level
syntax elements since it is wrong if there are emulation prevention
bytes existing in the byte-stream data.

https://bugzilla.gnome.org/show_bug.cgi?id=747613
2015-05-04 09:30:05 +02:00
Sreerenj Balachandran 6fc55a997e h265parse: Fix source caps to report cropped dimensions
https://bugzilla.gnome.org/show_bug.cgi?id=747613
2015-04-30 21:49:56 +02:00
Sreerenj Balachandran 5770a96c8d h265parse: Fix the memory freeing of stored VPS nals
https://bugzilla.gnome.org/show_bug.cgi?id=747613
2015-04-30 21:49:17 +02:00
Sreerenj Balachandran a70c4f319d h265parse: Fix profile, tier and level setting in caps
Don't use the apis in codec-utils to extract the profile,tier and level
syntax elements since it is wrong if there are emulation prevention
bytes existing in the byte-stream data.

https://bugzilla.gnome.org/show_bug.cgi?id=747613
2015-04-30 21:48:35 +02:00
Tim-Philipp Müller 699452ef31 Remove obsolete Android build cruft
This is not needed any longer.
2015-04-26 18:59:32 +01:00
Luis de Bethencourt c944093d08 remove unused enum items PROP_LAST
This were probably added to the enums due to cargo cult programming and are
unused.
2015-04-24 16:48:26 +01:00
Edward Hervey 8ba1fbbe64 h264parse: Remove dead code
The detection for missing format/alignment is done way before this
codepath is reached (at which point we have already decided of a
format and alignment).

CID #1232800
2015-04-20 14:35:19 +02:00
Sebastian Dröge 9b50a12b52 h264parse: Don't unref buffer that was unreffed just a few lines before already 2015-04-15 21:07:59 +02:00
Luis de Bethencourt 68efb43322 videoparser: unused value
Value set in off will be immediately overwritten after going to next.

CID #1226476
2015-03-09 11:13:55 +00:00
Xavier Claessens 92028e5da0 pngparse: stop spamming info messages
https://bugzilla.gnome.org/show_bug.cgi?id=745755
2015-03-06 13:46:48 -05:00
Thiago Santos 14f6fcdbd8 h264parse: reset the parser information when caps changes
This prevents it from going into passthrough after receiving 2
byte-stream caps (different ones) as it would keep the have_pps and
have_sps set to true and would just go into passthrough without
updating its caps.

This patch makes it reset its stream information to restart properly
when new caps are received.

https://bugzilla.gnome.org/show_bug.cgi?id=745409
2015-03-04 08:00:52 -03:00
Víctor Manuel Jáquez Leal 654e2a0298 h264parse: expose stereo-high profile
Exposing stereo-high profile as a compatible profile of multiview-high
if the maximum number of encoded views in the stream is two.

https://bugzilla.gnome.org/show_bug.cgi?id=743174
2015-01-21 01:03:36 +11:00
Víctor Manuel Jáquez Leal 4fc3db1808 h264parse: parse SPS subset
This patch calls gst_h264_parser_parse_subset_sps() when a
SPS subset NAL type is found.

All the bits required for parsing the SPS subset in NALs were
already there, just we need to call them when the this NAL type
is found.

With this parsing, the number of views (minus 1) attribute is
filled, which was a requirement for negotiating the stereo-high
profile.

https://bugzilla.gnome.org/show_bug.cgi?id=743174
2015-01-21 01:03:36 +11:00
Sreerenj Balachandran d8c2dd2da1 h264parse: add initial support for MVC NAL units.
Initial support for MVC NAL units. It is only needed to propagate the
complete set of NAL units downstream at this time.

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

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2015-01-21 00:18:44 +11:00
Sreerenj Balachandran 542c77ab38 h264parse: expose compatible profiles to downstream
Some video bitstreams report a too restrictive set of profiles. If a video
decoder was to strictly follow the indicated profile, it wouldn't support that
stream, whereas it could in theory and in practice. So we should relax the
profile restriction for allowing the decoder to get connected with parser.

https://bugzilla.gnome.org/show_bug.cgi?id=739992
2015-01-09 18:19:00 +01:00
Tim-Philipp Müller 854630fb92 Revert "pngparse: improve parsing of the image"
This reverts commit 59e7f0597d.

This patch should not have been pushed, see
https://bugzilla.gnome.org/show_bug.cgi?id=740058#c3
2015-01-07 16:40:25 +00:00
Vineeth T M 59e7f0597d pngparse: improve parsing of the image
Everytime a buffer is being provided from baseparse, we are parsing all the data from the beginning.
But since we would have already parsed some of the data in the previous iterations,
it doesnt make much sense to keep parsing the same everytime.
Hence skipping the data which is already read in previous iterations to improve the parsing performance.

https://bugzilla.gnome.org/show_bug.cgi?id=740058
2015-01-07 16:32:49 +00:00
Duncan Palmer ef71b6178e h264parse: Fix periodic SPS/PPS sending work after a seek
Reset the interval variable to have SPS/PPS sending work after
 a (backwards) seek.

https://bugzilla.gnome.org/show_bug.cgi?id=742212
2015-01-06 09:14:48 -03:00
Mathieu Duponchelle bd5688d1ee Revert "h264parse: expose compatible profiles to downstream"
This reverts commit 3910cbe7ce.
2014-12-09 04:28:17 +01:00
Sreerenj Balachandran 3910cbe7ce h264parse: expose compatible profiles to downstream
Some video bitstreams report a too restrictive set of profiles. If a video
decoder was to strictly follow the indicated profile, it wouldn't support that
stream, whereas it could in theory and in practice. So we should relax the
profile restriction for allowing the decoder to get connected with parser.

https://bugzilla.gnome.org/show_bug.cgi?id=739992
2014-12-05 09:36:02 +01:00
Tim-Philipp Müller 6e3518dfd6 pngparse: optimise reading of png files
Read PNG data chunk in one go by letting the parser
base class know the size we need, so that it doesn't
drip-feed us small chunks of data (causing a lot of
reallocs and memcpy in the process) until we have
everything.

Improves parsing performance of very large PNG files
(65MB) from ~13 seconds to a couple of millisecs.

https://bugzilla.gnome.org/show_bug.cgi?id=736176
2014-11-09 21:02:15 +00:00
Aurélien Zanelli 6b5e950236 vc1parse: set seq_layer_sent to FALSE on reset()
https://bugzilla.gnome.org/show_bug.cgi?id=738526
2014-11-08 19:01:10 +01:00
Aurélien Zanelli 025f8b9129 vc1parse: implement asf to *-frame-layer stream-format
This commit add an helper to convert a frame to frame-layer format and
use it to implement these two stream-format conversion:
- asf --> sequence-layer-frame-layer
- asf --> frame-layer

In simple/main profile, we basically have a raw frame, so building a
frame layer isn't too complicated. But in advanced profile, the first
frame-layer should contain sequence-header, entrypoint, and frame and
each keyframe should contain entrypoint, so we have to handle these
carefully.

https://bugzilla.gnome.org/show_bug.cgi?id=738526
2014-11-08 19:01:10 +01:00
Aurélien Zanelli 7d76ba5731 vc1parse: check output format at negotiation time
Add an helper to check that output stream-format is coherent with
profile and header-format. It also check if we know how to do the
conversion if the input stream-format differs from selected
output-format.
So, in case output stream-format is not allowed, it will now fail at
negotiation rather than in pre_push_frame.

https://bugzilla.gnome.org/show_bug.cgi?id=738526
2014-11-08 19:01:10 +01:00
Aurélien Zanelli 5eadb05fab vc1parse: add some asf related stream-format conversions
This commit introduces an helper to convert an ASF frame to BDUs format with
startcodes and use this helper to implements following stream-format
conversions:
- asf --> bdu
- asf --> sequence-layer-bdu
- asf --> sequence-layer-raw-frame

https://bugzilla.gnome.org/show_bug.cgi?id=738526
2014-11-08 19:01:10 +01:00
Aurélien Zanelli f2c5900c6d vc1parse: add some simple stream-format conversion
It add the support of following stream-format conversion:
- bdu --> sequence-layer-bdu
- bdu-frame --> sequence-layer-bdu-frame
- frame-layer --> sequence-layer-frame-layer

For these conversion, the only requirements is to push a sequence-layer
buffer prior to data.

https://bugzilla.gnome.org/show_bug.cgi?id=738526
2014-11-08 19:01:10 +01:00
Aurélien Zanelli cd500c5a06 vc1parse: prepare the stream-format conversion code and add the simplest ones
It prepares the template for stream-format conversion and it implements
the following conversion:
- sequence-layer-bdu --> bdu
- sequence-layer-bdu-frame --> bdu-frame
- sequence-layer-frame-layer --> frame-layer

Work is done in the pre_push_frame() method.

https://bugzilla.gnome.org/show_bug.cgi?id=738526
2014-11-08 19:01:10 +01:00
Josep Torra d518033e77 h264parse: set the HEADER flag on buffers containing SPS or PPS 2014-11-07 15:51:48 +01:00
Josep Torra 4b43e95ebd h265parse: set the HEADER flag on buffers containing VPS, SPS or PPS 2014-11-07 15:51:48 +01:00
Sebastian Dröge df64862ebe h265parse: don't unnecesarily set src_caps
https://bugzilla.gnome.org/show_bug.cgi?id=739374
2014-11-06 11:53:04 +01:00
Matej Knopp 1f367764fc h264parse: don't unnecesarily set src_caps
https://bugzilla.gnome.org/show_bug.cgi?id=739374
2014-11-06 11:51:59 +01:00
Sreerenj Balachandran 3776e78ae6 codecparsers: h264: add support for Frame Packing Arrangement SEI message.
This parses the frame_packing_arragement() payload in SEI message.
This information can be used by decoders to appropriately rearrange the
samples which belong to Stereoscopic and Multiview High profiles.

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

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2014-10-29 23:09:41 +11:00
Sreerenj Balachandran 51f003e469 codecparsers: h264: add support for Stereo Video Information SEI message.
Add the necessary payload parsing support for stereo_video_info.

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

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
2014-10-29 23:09:41 +11:00
Aurélien Zanelli 4cc6c7fe3b vc1parse: introduce a helper to make sequence-layer
It will be useful to implement stream-format conversion.

https://bugzilla.gnome.org/show_bug.cgi?id=738526
2014-10-20 13:17:57 +02:00
Aurélien Zanelli 89455b7106 vc1parse: select caps according to wmv format at negotiation
Some VC1 decoder can have different caps according to wmv format, ie
WMV3 or WVC1.
So instead of keeping the first available caps, we interserct with
current WMV format.

https://bugzilla.gnome.org/show_bug.cgi?id=738532
2014-10-20 12:18:50 +02:00
Aurélien Zanelli 6375fce925 vc1parse: parse frame header when stream format is ASF/raw for simple/main profile
When stream-format is ASF or sequence-layer-raw-frame, we basically have
a raw frame so we can parse it to extract some information such the
keyframe flag. The only requirement is to have a valid sequence-header.

This commit parse the frame header and set the DELTA_UNIT buffer flag in
case the frame is not a keyframe.

https://bugzilla.gnome.org/show_bug.cgi?id=738519
2014-10-14 14:02:30 +02:00
Aurélien Zanelli 77453c8124 vc1parse: just assume none header-format when no codec_data is present
https://bugzilla.gnome.org/show_bug.cgi?id=738449
2014-10-14 10:23:28 +02:00
Aurélien Zanelli 6df477ff0d vc1parse: fix framesize when input is frame-layer
frame-layer header is represented as a sequence of 32 bit unsigned
integer serialized in little-endian byte order, so framesize is on the
first 3 bytes.

SMPTE 421M Annex L.

https://bugzilla.gnome.org/show_bug.cgi?id=738243
2014-10-10 11:51:14 +01:00
Sebastian Dröge 2817472b9e h265parse: expose parsed profile, tier and level to downstream
https://bugzilla.gnome.org/show_bug.cgi?id=732239
2014-10-09 11:46:23 +03:00
Sreerenj Balachandran b1a286cd7c h264parse: expose parsed profile and level to downstream
Set parsed profile and level in src caps.

https://bugzilla.gnome.org/show_bug.cgi?id=732239
2014-10-09 11:46:18 +03:00
Vineeth T M 52ac7cf27a videoparser: comment unused GST_BASE_PARSE_FRAME_FLAG_PARSING
GST_BASE_PARSE_FRAME_FLAG_PARSING value is wrong, and the same flag is
not being used presently. Hence changing the value and commenting it out.
This needs to be included in baseparse.h later on

https://bugzilla.gnome.org/show_bug.cgi?id=737411
2014-10-06 11:48:08 +01:00
Aurélien Zanelli 677d052e84 vc1parse: unref caps when it is empty in renegotiate()
https://bugzilla.gnome.org/show_bug.cgi?id=737724
2014-10-02 10:43:49 +03:00
Luis de Bethencourt efca04f23f style: remove unnecessary break statements
Code flow never arrives to these break statements due to the gotos preceding
them. So the breaks are unnecessary, as discussed in bug 736942.

https://bugzilla.gnome.org/show_bug.cgi?id=737370
2014-09-25 16:41:15 +01:00
Thibault Saunier 4c63326a7a h264parse: Return flushing if we get chained while being set to READY
Or not negotiated in the case we would be actually not negotiated

Currently we are getting assertions from
gst_pb_utils_add_codec_description_to_tag_list because of NULL
caps.

https://bugzilla.gnome.org/show_bug.cgi?id=737186
2014-09-24 19:21:18 +02:00
Aurélien Zanelli 42167b0d1f vc1parse: initialize sent_codec_tag before using it
https://bugzilla.gnome.org/show_bug.cgi?id=736951
2014-09-23 19:50:26 +03:00
Aurélien Zanelli 7acf2fe5cb vc1parse: enable header-format conversion
In fact we support header-format conversion which is done in
update_caps() method.

https://bugzilla.gnome.org/show_bug.cgi?id=736786
2014-09-18 12:28:12 +03:00
Aurélien Zanelli de141c3237 vc1parse: forge sequence-layer from seq_hdr instead of seq_layer
If we don't have a seq_layer_buffer, we also don't have a valid
seq_layer because there are set together in
gst_vc1_parse_handle_seq_layer().

So when output header format is sequence-layer and when we don't have a
seq_layer_buffer, we forge one from seq_hdr.

https://bugzilla.gnome.org/show_bug.cgi?id=736781
2014-09-17 11:37:44 +03:00
Aurélien Zanelli d2847eaa09 vc1parse: fix sequence-layer/frame-layer endianness
Sequence-layer and frame-layer are serialized in little-endian byte
order except for STRUCT_C and framedata fields as described in SMPTE 421M Annex
L.

https://bugzilla.gnome.org/show_bug.cgi?id=736750
2014-09-16 17:40:55 +03:00
Aurélien Zanelli 2071c13936 vc1parse: fix malformed sequence layer header and STRUCT_C
This commit fix several issues with sequence layer header forging on
update_caps():
- 0x00000004 unsigned integer is before STRUCT_C.

- Set reserved bits of STRUCT_C to their values for simple/main
  profiles in sequence layer header format and ASF header format.

- Sequence layer shall be represented as a sequence of 32 bits unsigned
  integers and shall be serialized in little-endian byte order except
  for STRUCT_C which shall be serialized in big-endian byte-order.

See SMPTE 421M Annex L for more details about sequence layer format.

https://bugzilla.gnome.org/show_bug.cgi?id=736474
2014-09-12 16:10:50 +03:00
Tim-Philipp Müller ea7d5027a0 h264parse: fix up handling of input caps corner cases
Do more elaborate validation of the input caps: what fields
are required and/or not allowed. Don't assume AVC3 format
input without codec_data field is byte-stream format. Fix
up some now-unreachable code (CID 1232800).
2014-08-28 20:18:17 +01:00
Thiago Santos 9b6c8a48b4 h264parse: don't consider unknown stream-format as avc
It should try to use bytestream in these cases that the format
is set to _FORMAT_NONE as it seems that is what the 'else' clause
for bytestream can handle (by defaulting to _FORMAT_BYTESTREAM).
2014-08-25 13:37:57 -03:00
Gwenole Beauchesne 7d44a51bfe h264parse: fix collection of access units to preserve config headers.
Always use a GstAdapter when collecting access units (alignment="au")
in either byte-stream or avcC format. This is required to properly
preserve config headers like SPS and PPS when invalid or broken NAL
units are subsequently parsed.

More precisely, this fixes scenario like:
<SPS> <PPS> <invalid-NAL> <slice>

where we used to reset the output frame buffer when an invalid or
broken NAL is parsed, i.e. SPS and PPS NAL units were lost, thus
preventing the next slice unit to be decoded, should this also
represent any valid data.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2014-07-01 16:26:48 +02:00
Gwenole Beauchesne 34c2cfd4dd h264parse: improve conditions for skipping NAL units.
Carefully track cases when skipping broken or invalid NAL units is
necessary. In particular, always allow NAL units to be processed
and let that gst_h264_parse_process_nal() function decide on whether
the current NAL needs to be dropped or not.

This fixes parsing of streams with SEI NAL buffering_period() message
inserted between SPS and PPS, or SPS-Ext NAL following a traditional
SPS NAL unit, among other cases too.

Practical examples from the H.264 AVC conformance suite include
alphaconformanceG, CVSE2_Sony_B, CVSE3_Sony_H, CVSEFDFT3_Sony_E
when parsing in stream-format=byte-stream,alignment=au mode.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2014-07-01 16:26:48 +02:00
Gwenole Beauchesne 7bb6443bfb h264parse: introduce new state tracking variables.
Improve parser state tracking by introducing new flags reflecting
it: "got-sps", "got-pps" and "got-slice". This is an addition for
robustness purposes.

Older have_sps and have_pps variables are kept because they have
a different meaning. i.e. they are used for deciding on when to
submit updated caps or not, and rather mean "have new SPS/PPS to
be submitted?"

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2014-07-01 16:26:48 +02:00
Gwenole Beauchesne 5601c87598 h264parse: fix and optimize NAL collection function.
Use gst_h264_parser_identify_nalu_unchecked() to identify the next
NAL unit. We don't want to parse the full NAL unit, but only the
header bytes and possibly the first RBSP byte for identifying the
first_mb_in_slice syntax element.

Also fix check for failure when returning from that function. The
only success condition for that is GST_H264_PARSER_OK, so use it.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2014-07-01 16:26:48 +02:00
Sebastian Dröge 78ab2cdffd vc1parse: Fix compiler warnings when compiling with G_DISABLE_ASSERT 2014-06-29 20:11:58 +02:00
Gwenole Beauchesne 9bd186a960 codecparsers: h264: fix memory leak in GstH264PPS.
The gst_h264_parse_pps() function dynamically allocates the slice
group ids map array, so that needs to be cleared before parsing a
new PPS NAL unit again, or when it is no longer needed.

Likewise, a clean copy to the internal NAL parser state needs to be
performed so that to avoid a double-free corruption.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2014-06-27 14:00:10 +02:00
Aurélien Zanelli 67df207280 codecparsers: h264: add support for Recovery Point SEI message.
The recovery point SEI message helps a decoder in determining if the
decoding process would produce acceptable pictures for display after
the decoder initiates random access or after the encoder indicates
a broken link in the coded video sequence.

This is not used in the h264parse element, but it could help debugging.

https://bugzilla.gnome.org/show_bug.cgi?id=723380
2014-06-26 17:22:26 +02:00
Chris Bass d9d4a91c62 h265parse: fix hvcC size check
In ISO/IEC 14496-15, the minimum size of a HEVCDecoderConfigurationRecord
(i.e., the contents of a hvcC box) is 23 bytes. However, the code in h265parse
checks that the size of this data is not less than 28 bytes, and it refuses to
accept caps if the check fails. The result is that standards-conformant streams
that don't carry any parameter sets in their hvcC boxes won't play.

https://bugzilla.gnome.org//show_bug.cgi?id=731783
2014-06-22 21:57:28 +01:00
Aurélien Zanelli 2c3e7b6352 h264parse: use new gst_h264_video_calculate_framerate() to get framerate
https://bugzilla.gnome.org/show_bug.cgi?id=723352
2014-05-22 16:12:36 +02:00
Aurélien Zanelli a9dfa354f6 h264parse: set field_pic_flag when parsing a slice header
field_pic_flag was used but never set to other value than its default

https://bugzilla.gnome.org/show_bug.cgi?id=730363
2014-05-22 15:54:04 +02:00
Haakon Sporsheim (ieei) 36a2acae45 h264parse: unref/replace force_key_unit_event in gst_h264_parse_reset
https://bugzilla.gnome.org/show_bug.cgi?id=729200
2014-04-29 12:17:51 -03:00
Vincent Penquerc'h 7659f3bec4 vc1parse: guard against dividing by zero
If framerate is unknown, we write the maximum framerate
allowed for this profile/level:

https://tools.ietf.org/html/draft-ietf-avt-rtp-vc1-06#section-6.1
http://wiki.multimedia.cx/index.php?title=VC-1#Setup_Data_.2F_Sequence_Layer

Coverity 1139694
2014-04-21 13:23:46 +01:00
Sebastian Dröge 10ffa089a0 h264parse: Copy over DISCONT flag from input buffers 2014-03-29 10:33:45 +01:00
Sreerenj Balachandran 4d17166b03 mpegvideoparse: Differentiate the mpeg-2 stream from mpeg-1 based on pic_ext
Presence of picture extension header identifies the stream as mpeg2.
We are supposed to set the mpegversion to 2 if there is a picextension
instead of blindly setting the version to 1

https://bugzilla.gnome.org/show_bug.cgi?id=726028
2014-03-12 08:46:41 +01:00
Thibault Saunier 5fd9b42f29 h264parse: Default framerate to 0/1 when no informations found
It is not perfect but it allows us to be sure that the mandatory 'framerate'
field is present in the caps.

As soon as some information is found in the stream, that will be
updated.

https://bugzilla.gnome.org/show_bug.cgi?id=723243
2014-01-31 09:28:58 +01:00
Aurélien Zanelli af78b45979 h264parse: Fix multiple SEI messages in one SEI RBSP parsing.
An SEI RBSP could contains more than one SEI message as specified in
7.4.2.3.1.

This commit change the parser API: the gst_h264_parser_parse_sei()
function now create and fill a GArray containing GstH264SEIMessage.

https://bugzilla.gnome.org/show_bug.cgi?id=721715
2014-01-23 20:18:53 +01:00
duhui.lee cd8c0227c8 h265parse: Update caps when receive VPS/SPS/PPS
https://bugzilla.gnome.org/show_bug.cgi?id=722240
2014-01-20 10:05:18 +01:00
Thiago Santos 4e283dbb62 mpeg4videoparse: do not lose DISCONT flag if buffer isn't pushed
mpeg4videoparse might not push buffers while parsing. If those buffers
contain the DISCONT flag, it gets lost and downstream won't get any
buffer with the flag.

Fix it by adding the DISCONT to the next pushed buffer.
This makes backwards playback work.
2014-01-08 16:50:38 -03:00
Sebastian Dröge 63fee31a3f h265parse: Allows hvc1 version 0 and fix reading of NAL count in codec_data 2014-01-06 14:52:54 +01:00
Sebastian Dröge 57c195eed8 h265parse: Fix some more debug output
And don't access invalid memory
2014-01-06 14:48:26 +01:00
Todd Agulnick ccd9a9cb89 vc1parse: Some compiler warning fixes to satisfy XCode compiler
https://bugzilla.gnome.org/show_bug.cgi?id=720513
2013-12-16 16:53:25 +01:00
Sebastian Dröge b3f198b67d vc1parse: Post VIDEO_CODEC tag 2013-12-16 10:25:22 +01:00
Sebastian Dröge 3faa8920ce pngparse: Post VIDEO_CODEC tag 2013-12-16 10:24:28 +01:00
Sebastian Dröge 6fbc101d19 mpegvideoparse: Use pbutils API to create the VIDEO_CODEC tag string 2013-12-16 10:22:24 +01:00
Sebastian Dröge 188b445fdd mpeg4videoparse: Post VIDEO_CODEC tag 2013-12-16 10:21:00 +01:00