In particular, this avoids missing the intended keyframe when first converting
from the frame's mov time to global segment time, and then back from global
time to mov time when activating the segment.
Make win32 build bot happy again, and nicefy output while we're at it.
qtdemux.c: In function 'qtdemux_parse_trun':
qtdemux.c:2162:3: error: format '%lu' expects type 'long unsigned int', but argument 9 has type 'guint32'
Check that the WAVEHEADER node is present instead of blindly using it.
If not present we won't be able to provide a more refined caps, but at
least we won't crash.
https://bugzilla.gnome.org/show_bug.cgi?id=640028
Old code was difficult to understand exactly how the neighboring
scan lines are calculated, and it appeared that some were off by
+2 or -2, depending on the field flag. Fixes#639321.
Set caps from the start so discoverer doesn't blow up on
seeing no negotiated caps between elements on preroll,
which might happen if no subtitle buffers have been
pushed yet at the time. See file from bug #603308.
The previous default, greedyh, takes 4 times as long as MPEG-2
video decoding, and is unlikely fast enough on any current CPU
to play 1080i video in real-time. greedyl isn't much faster.
linear was chosen over vfir, since the quality advantage of vfir
is minimal compared to the occasional visual artifacts and slower
processing.
Improve parsing of the samplerate.
Parse the framelen so that we can calculate timestamps.
When interpollate the incomming timestamp on outgoing buffers when there are
multiple subframes.
fixes#625825
It was an arbitrary limit from the start, meant as a basic sanity check,
so may just as well increase it a little. Would be good to provide
progress reporting while completing the block in any case..
https://bugzilla.gnome.org/show_bug.cgi?id=637060
Use g_ascii_dtostr() and g_ascii_strtod() to serialise/deserialise
floating point numbers, instead of ugly hacks that switch locale
before and after calling libc functions (which is not a good idea
in a multi-threaded application).
atof() converts strings according to the current locale, but the
framerate string will likely always use a dot as floating point
separator, so use g_ascii_strtod() instead (but also canonicalise
the string before, so we can handle both formats as input).
Include all possible stats of a source in the stats structure because we might
be interested in what happened in the past.
Document the stats property and the fields.
Using this in a demuxer will cause deadlocks if there's
a pad with a pending pad-block downstream, no matter if
there is a queue between the pad or not. Queues pass
bufferalloc downstream from the same thread and only
act as a thread boundary for events and buffers.
When the jitterbuffer contains -1 timestamps, make sure we still calculate the
buffer fill level by skipping the -1 buffers.
Try to be more resilient to weird input timestamps.
since we are using the clock for sync, we need to also provide a clock for good
measure. The reason is that even if downstream elements provide a clock, we
don't want to have that clock selected because it might not be running yet.
... thereby (partially) deprecating properties currently controlling whether
or not byte-stream output or NAL/AU alignment (though properties still determine
fallback if nothing specified in caps).
Fixes#606662.
Extra info can't hurt. Field names aren't necessarily consistent with
what's used elsewhere though (e.g. avidemux), but then neither are the
caps.
https://bugzilla.gnome.org/show_bug.cgi?id=623178
In particular, when streaming interleaved, this arranges for setting a new
timestamp on outgoing buffer so downstream can appropriate reset
to a change in (rtp)time.
Use 3 adapters, one to accumulate paketization units, another on to accumulate
tiles and a last one to accumulate the final frame.
Don't just blindly flush the adapter on DISCONT but only discard the current
packetization unit.
When we dropped jpeg2000 packets between SOP markers, adjust the SOT header with
the new lenght.
In particular, accept unknown stream in track fragment, and only error out
if that raises problems later on with respect to offset tracking.
Fixes#620283.
The following keys will now be interpreted by navseek:
'f' means fast forward: the stream gets played at rate 2.0
'r' means rewind: the stream gets played at rate -2.0
'n' means normal: the stream gets played at rate 1.0
Fixes#631516.
On the one hand, it insufficiently checks whether it only updates a dummy
segment. On the other hand, only doing this at the time the last sampled is
prepared (and sent downstream) is too little too late.
That is, parse each moof in one pass (considering all contained streams'
metadata), and do so incrementally as needed for playback rather than
an initial complete scan of all moof (though all moov sample metadata
is fully parsed at startup).
... as some bogus files may indicate streams of 0 duration in moov,
while indicating the complete movie duration in mvhd (the latter should
be in mehd).
Avoid extra allocation in _parse_trun, add more checks for parsing errors,
add or adjust some debug statement, fix comments, sprinkle some branch
prediction.
The allocation of the samples can be placed out of the loop.
Makes the code clearer.
Also avoid relying on traf information as it is placed on the
end of the file and might not be acessible on push mode.
The fragmented mp4 format stores the tracks and samples information in the
'moof' boxes, which are appended before each fragment (fragment->'moof'+'mdat').
The 'mfra' box stores the offset of each 'moof' box and their presentation
time. The location of this box can be retrieved from the 'mfro' box, which is
located at the end of the file.
The 'mfra' box is parsed to get the offset of each 'moof' box and their
presentation time.
Each 'moof' box can contain information for one or more tracks inside
'tfhd' boxes. For each track in a 'moof', we have a 'trun' box, which
contains information of each sample (offset and duration) used to build
the samples table.
Based on patch by Marc-André Lureau <mlureau@flumotion.com>
https://bugzilla.gnome.org/show_bug.cgi?id=596321
Versions 0 and 1 of mvhd have different sizes of its values
(32bits/64bits). This patch makes it dump them correctly.
Also use the right node in the parameter and not the root node.
https://bugzilla.gnome.org/show_bug.cgi?id=596321
The DTS typefinder may return a lower probability for frames that start
at non-zero offsets and where there's no second frame sync in the first
buffer. It's fairly unlikely that we'll acidentally identify PCM data
as DTS, so we don't do additional checks for now.
https://bugzilla.gnome.org/show_bug.cgi?id=636234
When parsing the bitstream, look for SOP markers because we are allowed to split
packets on those marker boundaries.
Rework the parsing code a little so that we can pack multiple Packetization
units in one RTP packet.
When handling newsegment, flush out the buffer history in the
existing segment, not the new one. Fixes playback in some DVD
cases.
Partially fixes#633294
In a number of cases it is necessary to flush the field history by
performing 'degraded' deinterlacing - that is, using the user-chosen
method for as many fields as possible, then using vfir for as long as
there are >= 2 fields remaining in the history, then using linear for
the last field.
This should avoid losing fields being kept for history for example at
EOS.
This may address part of #633294
Only set the delta flag when all of the units in the packet are delta units.
Based on patch from Olivier Crête <olivier.crete@collabora.co.uk>
Fixes#632945
If caps weren't negotiated, goom should return not-negotiated
from its chain functions instead of using bps unitialized, which
leads to a division by 0
https://bugzilla.gnome.org/show_bug.cgi?id=633212
GST_ELEMENT_ERROR must not be called with the object lock held,
since it will call gst_object_get_parent() internally, which
takes the object lock as well.
Only send newsegment events with new positions downstream when actually
needed, instead of sending multiple newsegment events with new seek
positions in a row. Also set the discont flag on buffers after a
discontinuity.
Re-use the existing 'pos' field maintained by ebml writer to set
buffer offsets. This also makes sure that we set the right offsets
on buffers after a seek (e.g. when writing an index at the end).
Incomming buffer is only pushed on the adapter at the end of the
handle_buffer function. But duration/timestamp of this buffer is already
taken into account for the current data in the adapter. This leads to
wrong rtp timestamps and extra latency.
Both history_count and fields_required count from 1. As per the while loop
condition that follows this code, to perform the deinterlacing method, we need
history_count >= fields_required fields in the history. Therefore if we have
history_count < fields_required (not fields_required + 1), we need more fields.
This fixes the assumption that DecoderSpecificInfo must be 2 bytes long
for AAC files. The specification allows HE-AAC to be explicitly
signalled in a backward compatible way. This is done by means of an
additional information after the regular AAC header. It is expected that
decoders that can play AAC but not HE-AAC will parse the header normally
and ignore extended bits, much as they do for the HE-AAC specific payload
in the actual stream.
https://bugzilla.gnome.org/show_bug.cgi?id=612313
Implement a latency query and report how much latency we will add to the
stream.
Alse make some defaults for the default width/height/framerate
Fixes#631303
This uses gstpbutils to extract the profile and level from the video
object sequence and adds this to stream caps. This can be used as
metadata and for fine-grained decoder selection.
https://bugzilla.gnome.org/show_bug.cgi?id=616521
This exports the AAC profile and level in caps for use as metadata and
(eventually) for more fine-grained selection of decoders at
caps-negotiation time. (Doesn't work for HE-AAC yet though.)
https://bugzilla.gnome.org/show_bug.cgi?id=612313
Using _foreach_remove on the hashtable, while releasing the lock protecting
that table inside the callback is not a good idea. The hashtable might
then change (a source removed or added) while signals like on_timeout
are being sent.
This solution makes a copy of the table, performs the _foreach without
actually removing any sources, but marks them for removal on a second
iteration with the real list, but this time not letting go of the lock.
Fixes#630452
Holding internal locks while potentially calling out is a source
of deadlocks, and in this case the application might subscribe to the
pad-added signal.
Fixes#630449
If the source has been inactive for some time, we assume that it has
simply changed its transport source address. Hence, there is no true
third-party collision - only a simulated one.
Fixes#630447
For H264, there is an extra header containing the CTS, which is a timestamp
offset that should be applied to the PTS. Parse this value and use it to adjust
the pts.
Fixes#630088
Parses uuid atoms in push mode when they are found, they might
contain xmp tags.
Also does a minor refactoring to put the global tags posting
into a single function instead of repeating it in 3 different
places.
Fixes#629839
xmp packet is placed into a top-level uuid atom for
isom/mp4 variants.
This patch makes qtdemux parse all top-level atoms
in pull-mode before starting to push data, making
it able to find those tags.
https://bugzilla.gnome.org/show_bug.cgi?id=629839