Commit graph

9502 commits

Author SHA1 Message Date
Thibault Saunier 3e063703b3 qtdemux: Do not run the preferred decryptor context query if no decryptor avalaible
Ultimately this avoids a segfault as the code expect a non NULL array
here.
2018-05-25 10:53:16 +02:00
Alicia Boya García c2a0da8096 qtdemux: Allow edit lists on fragmented files on push mode
Fragmented files often use elst.duration=0 which before
ee78825eae was wrongly interpreted as
having no frames.

Since that issue has now been fixed, there is no reason to disable edit
lists in fragmented files. This commit enables them, therefore producing
correct stream time for files containing edit lists.

https://bugzilla.gnome.org/show_bug.cgi?id=793058
2018-05-24 15:53:48 +02:00
Alicia Boya García 5388d6e6a2 qtdemux: fix computation of first_duration for fragmented files in push mode
Since ca068865c3 the duration of the first
frame is not used for estimating the frame rate.

For this purpose, stream->first_duration was initialized with the
duration of the first frame. In fragmented files, this was previously
done by peeking the first moof, but that can only be done in pull mode.

Fortunately, we don't really need to do that, at least with the current
design: When we are estimating the frame rate we already have the
sample table, regardless of the scheduling mode and whether the file is
fragmented or not, so we can obtain first_duration there much more
reliably.

This fixes frame rate estimation for fragmented files in push mode.

https://bugzilla.gnome.org/show_bug.cgi?id=796384
2018-05-24 15:53:48 +02:00
Vivia Nikolaidou d11339d616 splitmuxsink: Added new async-finalize mode
This mode is useful for muxers that can take a long time to finalize a
file. Instead of blocking the whole upstream pipeline while the muxer is
doing its stuff, we can unlink it and spawn a new muxer+sink combination
to continue running normally.

This requires us to receive the muxer and sink (if needed) as factories,
optionally accompanied by their respective properties structures. Also
added the muxer-added and sink-added signals, in case custom code has to
be called for them.

https://bugzilla.gnome.org/show_bug.cgi?id=783754
2018-05-24 12:47:24 +03:00
Alicia Boya García d35f893715 qtdemux: Don't send gaps bigger than 1 second (now in push mode too)
This applies the same workaround to gaps that is being used in pull
mode.

https://bugzilla.gnome.org/show_bug.cgi?id=778426
2018-05-24 11:09:53 +02:00
Seungha Yang f61c2bc301 qtdemux: Properly handle edit list in push mode
If there are empty segments in edit list, demux should
adjust "accumulated_base" to apply it into running time.

https://bugzilla.gnome.org/show_bug.cgi?id=778426
2018-05-24 11:09:53 +02:00
Mathieu Duponchelle d9235404aa matroska-mux: write colorimetry
This is a straightforward translation of 5dd39d8, can be trivially
checked by running:

gst-launch-1.0 -v videotestsrc ! video/x-raw, colorimetry=2:4:7:1 ! \
matroskamux ! matroskademux ! fakesink

and verifying that the colorimetry is correctly preserved.

https://bugzilla.gnome.org/show_bug.cgi?id=796344
2018-05-23 15:14:23 +02:00
Alicia Boya García ee78825eae qtdemux: fix buggy duration in edits with duration=0 in fragmented files without a mehd
https://bugzilla.gnome.org/show_bug.cgi?id=794858
2018-05-23 14:25:56 +02:00
Tim-Philipp Müller db688c5504 docs: fix typos 2018-05-23 13:14:27 +01:00
Seungha Yang c69ccf60d8 qtdemux: Clarify variable name
As defined by spec, use "empty edit". It's more straightforward.

https://bugzilla.gnome.org/show_bug.cgi?id=778426
2018-05-22 11:29:44 +02:00
Xabier Rodriguez Calvar ee4b45da24 qtdemux: add context for a preferred protection
qtdemux selected the first system corresponding to a working GStreamer
decryptor. With this change, before selecting that decryptor, qtdemux
will check if it has context (a preferred decryptor id) and if not, it
will request it.

The request includes track-id, available key system ids for the
available decryptors and even the events so that the init data is
accessible.

[eocanha@igalia.com: select the preferred protection system even if not available]

Test "4. ClearKeyVideo" in YouTube leanback EME conformance tests 2016 for
H.264[1] uses a media file[2] with cenc encryption which embeds 'pssh' boxes
with the init data for the Playready and Widevine encryption systems, but not
for the ClearKey encryption system (as defined by the EMEv0.1b spec[3] and with
the encryption system id defined in [4]).

Instead, the ClearKey encryption system is manually selected by the web page
code (even if not originally detected by qtdemux) and the proper decryption key
is dispatched to the decryptor, which can then decrypt the video successfully.

[1] http://yt-dash-mse-test.commondatastorage.googleapis.com/unit-tests/2016.html?test_type=encryptedmedia-test&webm=false
[2] http://yt-dash-mse-test.commondatastorage.googleapis.com/unit-tests/media/car_cenc-20120827-86.mp4
[3] https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1b/encrypted-media/encrypted-media.html#simple-decryption-clear-key
[4] https://www.w3.org/Bugs/Public/show_bug.cgi?id=24027#c2

https://bugzilla.gnome.org/show_bug.cgi?id=770107
2018-05-21 17:36:17 +02:00
Enrique Ocaña González 844423ff99 qtdemux: also push buffers without encryption info instead of dropping them
Test "17. PlayReadyH264Video" in YouTube leanback EME conformance tests 2016
for H.264[1] uses a media file[2] with cenc encryption whose first two 'moof'
boxes have no encryption information (no 'saiz' and 'saio' boxes).

Those boxes are actually not encrypted and the current qtdemux implementation
was just dropping them, breaking the test use case.

This patch detects those kind of situations and just lets the unencrypted
buffers pass. Of course, this needs some collaboration by the decryptors,
which should also do the same and not to try to decrypt those clear buffers.

[1] http://yt-dash-mse-test.commondatastorage.googleapis.com/unit-tests/2016.html?test_type=encryptedmedia-test&webm=false
[2] http://yt-dash-mse-test.commondatastorage.googleapis.com/unit-tests/media/oops_cenc-20121114-142.mp4

https://bugzilla.gnome.org/show_bug.cgi?id=770107
2018-05-21 17:36:17 +02:00
Alicia Boya García c097289725 qtdemux_parse_segments: remove superfluous variable
https://bugzilla.gnome.org/show_bug.cgi?id=793751
2018-05-18 11:29:47 -04:00
Olivier Crête 87b2b35fac flvmux: Remove custom get_next_time implementation
GstAggregator now does the same thing in the simple implementation.

https://bugzilla.gnome.org/show_bug.cgi?id=795486
2018-05-16 22:23:36 +02:00
Havard Graff 4d54673cb4 rtpsession: make "clear-pt-map" action signal actually work
Needed for PLI + FIR unit tests in follow-up commit.

https://bugzilla.gnome.org/show_bug.cgi?id=795139
2018-05-15 11:52:14 +01:00
Mikhail Fludkov 40eb462591 rtpsession: Avoid unnecessary copy of stats structure
The code before copied GstStructure twice. The first time inside
gst_value_set_structure and the second time in g_value_array_append.
Optimized version does no copies, just transfers ownership to
GValueArray. It takes advantage of the fact that array has already
enough elements preallocated and the memory is zero initialized.

https://bugzilla.gnome.org/show_bug.cgi?id=795139
2018-05-15 11:33:01 +01:00
Tim-Philipp Müller d5d6e6cfdd Revert "BugFix : Change peak value to normalize audio file with fallback gain"
This reverts commit 36e49fd6f8.

Breaks unit test, someone needs to investigate if it's the
patch's fault or if the test needs adjusting/updating.

https://bugzilla.gnome.org/show_bug.cgi?id=673970
2018-05-15 10:35:09 +01:00
Stian Selnes 457fdf95c4 rtpsession: Drop packet if trying to send from non-internal source
If obtain_internal_source() returns a source that is not internal it
means there exists a non-internal source with the same ssrc. Such an
ssrc collision should be handled by sending a GstRTPCollision event
upstream and choose a new ssrc, but for now we simply drop the packet.
Trying to process the packet further will cause it to be pushed
usptream (!) since the source is not internal (see source_push_rtp()).

https://bugzilla.gnome.org/show_bug.cgi?id=795139
2018-05-15 10:34:29 +01:00
Tim-Philipp Müller adc315978c matroskademux: tag disabled streams with FLAG_UNSELECT
So they're never picked as default, only by explicit
user action.

https://bugzilla.gnome.org/show_bug.cgi?id=690911
2018-05-15 10:25:35 +01:00
Sebastian Dröge 6e7b0d6061 qtmux: Print expected/actual values in debug log on mismatch in prefill mode
This helps debugging a lot.
2018-05-14 21:06:55 +03:00
Havard Graff b43ee8f5b1 rtpsession: Try media_ssrc if no src can be found for PLI sender_ssrc
Some RTP stacks out there does not set the sender_ssrc. In order to be
more robust, try to lookup the media_ssrc before dropping the PLI.

https://bugzilla.gnome.org/show_bug.cgi?id=795139
2018-05-13 20:41:39 +01:00
Mikhail Fludkov 386ca1d378 rtpsession: Fix on-feedback-rtcp race
If there is an external source which is about to timeout and be removed
from the source hashtable and we receive feedback RTCP packet with the
media ssrc of the source, we unlock the session in
rtp_session_process_feedback before emitting 'on-feedback-rtcp' signal
allowing rtcp timer to kick in and grab the lock. It will get rid of
the source and rtp_session_process_feedback will be left with RTPSource
with ref count 0.

The fix is to grab the ref to the RTPSource object in
rtp_session_process_feedback.

https://bugzilla.gnome.org/show_bug.cgi?id=795139
2018-05-13 20:33:56 +01:00
Stian Selnes 29f26e8768 rtpsession: Add missing lock around sess->ssrcs iteration
https://bugzilla.gnome.org/show_bug.cgi?id=795139
2018-05-13 19:17:02 +01:00
John-Mark Bell 0a2b55ac3c rtpsession: do not emit RBs for internal senders.
These are the sources we send from, so there is no reason to
report receive statistics for them (as we do not receive on them,
and the remote side has no knowledge of them).

https://bugzilla.gnome.org/show_bug.cgi?id=795139
2018-05-13 19:16:59 +01:00
Vivia Nikolaidou 498ebc5503 splitmuxsink: Added caption_%u pad template
For closed-caption-enabled muxers (e.g. qtmux)
2018-05-11 16:39:46 +03:00
Edward Hervey 4253c51c5f qtdemux: Initialize riff library
Avoids debugging message issues. Also just use the main riff header
2018-05-10 13:59:36 +02:00
Seungha Yang 7651036530 qtdemux: Protect _expose_streams() from flush event
Flush during stream change can break autoplugging or the
flush event could be dropped.

https://bugzilla.gnome.org/show_bug.cgi?id=684790
2018-05-10 08:09:20 +02:00
Seungha Yang d72a7c038c qtdemux: Try to expose whenever got new moov or new stream-start
Whenever got new moov or new stream-start,
demux will try to expose new pad by following rule.

Comparing stream-id in the current moov with previous one, then
* If matched stream-id is found from previous one,
  reuse existing pad (most common case)
* Otherwise, expose new pad with new stream-start
* No more used stream will be freed

https://bugzilla.gnome.org/show_bug.cgi?id=684790
2018-05-10 08:09:20 +02:00
Seungha Yang 0bd3459053 qtdemux: Remove duplication of initializing member variables
Most initialization of variables in gst_qtdemux_init() are duplicated in
gst_qtdemux_reset() function.

https://bugzilla.gnome.org/show_bug.cgi?id=684790
2018-05-10 08:09:20 +02:00
Seungha Yang 553607756b qtdemux: Create stream whenever got new moov
Whenever demux got moov, demux will create new stream. Only exception is
duplicated track-id in a moov box. In that case the first stream
will be accepted. This patch is pre-work for rework of moov handling.

https://bugzilla.gnome.org/show_bug.cgi?id=684790
2018-05-10 08:09:20 +02:00
Seungha Yang 96a6aab6a1 qtdemux: Store stream-id to manage streams
In order to figure out stream change such as
track-id change or stream-id change, demux will store
 stream-id per QtDemuxStream structure.

https://bugzilla.gnome.org/show_bug.cgi?id=684790
2018-05-10 08:09:20 +02:00
Seungha Yang b5245be1b1 qtdemux: Use GList to manage QtDemuxStream
* Move to GList from static array
* Logging track-id instead of array index. It's more meaningful.

https://bugzilla.gnome.org/show_bug.cgi?id=684790
2018-05-10 08:09:20 +02:00
Seungha Yang aca8d32437 qtdemux: Adjust the number of args of some functions
To be used with g_list_free_full in the next patch

https://bugzilla.gnome.org/show_bug.cgi?id=684790
2018-05-10 08:09:20 +02:00
Seungha Yang 80f391aa3b qtdemux: Add parentheses in macro
https://bugzilla.gnome.org/show_bug.cgi?id=684790
2018-05-10 08:09:20 +02:00
Marinus Schraal c2cce8a9fc isomp4: Use full date time if available
The ©day tag contains a full date time, use it for the DATE_TIME tag
instead of just the DATE tag. This overrules the unreliable qt creation
time.

https://bugzilla.gnome.org/show_bug.cgi?id=731029
2018-05-09 15:49:30 +02:00
Jan Schmidt 9cbde904e8 rtspsrc: Fix doc comment markers 2018-05-07 01:40:05 +10:00
Kyrylo Polezhaiev 70a55f90a3 icydemux: avoid timestamp field initialisation for tag event
This field is not used and will be removed in 2.0 API.

https://bugzilla.gnome.org/show_bug.cgi?id=761462
2018-05-07 01:25:25 +10:00
Matej Knopp 61ba778347 dcaparse: do not accept header with invalid channel count
https://bugzilla.gnome.org/show_bug.cgi?id=737928
2018-05-06 11:08:20 +02:00
Anthony Violo 36e49fd6f8 BugFix : Change peak value to normalize audio file with fallback gain
https://bugzilla.gnome.org/show_bug.cgi?id=673970
2018-05-05 16:49:57 +02:00
Tim-Philipp Müller 5b8e775d1c rtpvrawpay: don't use buffer lists if everything fits into one buffer
People might use very large mtu sizes where every payload
fits into a single output packet.

https://bugzilla.gnome.org/show_bug.cgi?id=795758
2018-05-05 16:32:59 +02:00
Olivier Crête c2c7d110e5 flvmux: Don't wake up the muxer unless there is data
https://bugzilla.gnome.org/show_bug.cgi?id=795332
2018-04-26 15:41:54 -04:00
Olivier Crête 11297c3337 flvmux: Save the current position in the output segment
https://bugzilla.gnome.org/show_bug.cgi?id=795332
2018-04-26 15:41:54 -04:00
Olivier Crête 168fae813b flvmux: Wait for caps from both srcs before writing header
Wait for caps on all pads to start writing data even when source is live.

Includes unit test by Havard Graff that simulates it.

https://bugzilla.gnome.org/show_bug.cgi?id=794722
2018-04-26 15:41:54 -04:00
Xavier Claessens edd9c8f6b8 Meson: Generate pc file for all plugins in good
https://bugzilla.gnome.org/show_bug.cgi?id=794568
2018-04-25 11:07:06 +01:00
Edward Hervey 90244da780 qtmux: Read caption from input buffer
And not from unallocated output buffer GstMapInfo

CID #1435131
2018-04-25 10:37:40 +02:00
Edward Hervey 7378f1b4fd isomp4: qtmux: Add Closed Caption support
Supports CEA 608 and CEA 708 CC streams

Also supports usage in "Robust Prefill" mode if the incoming caption
stream is constant (i.e. there is one incoming CC buffer for each
video frame).

https://bugzilla.gnome.org/show_bug.cgi?id=606643
2018-04-23 15:58:10 +02:00
Edward Hervey 76e32ef414 isomp4: Make 'gmhd' atom usage more generic
Only the 'gmin' atom is required. Any other entry within it are
optional.

https://bugzilla.gnome.org/show_bug.cgi?id=606643
2018-04-23 15:58:10 +02:00
Mathieu Duponchelle 90f5ae8f45 ulpfecdec: output perfect seqnums
ULP FEC, as defined in RFC 5109, has the protected and protection
packets sharing the same ssrc, and a different payload type, and
implies rewriting the seqnums of the protected stream when encoding
the protection packets. This has the unfortunate drawback of not
being able to tell whether a lost packet was a protection packet.

rtpbasedepayload relies on gaps in the seqnums to set the DISCONT
flag on buffers it outputs. Before that commit, this created two
problems:

* The protection packets don't make it as far as the depayloader,
  which means it will mark buffers as DISCONT every time the previous
  packets were protected

* While we could work around the previous issue by looking at
  the protection packets ignored and dropped in rtpptdemux, we
  would still mark buffers as DISCONT when a FEC packet was lost,
  as we cannot know that it was indeed a FEC packet, even though
  this should have no impact on the decoding of the stream

With this commit, we consider that when using ULPFEC, gaps in
the seqnums are not a reliable indicator of whether buffers should
be marked as DISCONT or not, and thus rewrite the seqnums on
the decoding side as well to form a perfect sequence, this
obviously doesn't prevent the jitterbuffer from doing its job
as the ulpfec decoder is downstream from it.

https://bugzilla.gnome.org/show_bug.cgi?id=794909
2018-04-19 18:17:39 +02:00
Sebastian Dröge 6d92fcd043 Revert "rtspsrc: Fix up sendonly/recvonly attribute handling"
This reverts commit af273b4de9.

While RFC 3264 (SDP) says that sendonly/recvonly are from the point of view of
the requester, the actual RTSP RFCs (RFC 2326 / 7826) disagree and say
the opposite, just like the ONVIF standard.

Let's follow those RFCs as we're doing RTSP here, and add a property at
a later time if needed to switch to the SDP RFC behaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=793964
2018-04-17 17:58:01 +03:00
Sebastian Dröge 336a97157c flacparse: Drain the parser when a CAPS event is received
After a CAPS event, in theory a new stream can start and it might start
with the FLAC headers again. We can't detect FLAC headers in the middle
of the stream, so we drain the parser to be able to detect either FLAC
headers after the CAPS event or the continuation of the previous stream.

This fixes for example

gst-launch-1.0 audiotestsrc num-buffers=200 ! flacenc ! c. \
    audiotestsrc num-buffers=200 freq=880 ! flacenc ! c. \
    concat name=c ! rtpgstpay ! udpsink host=127.0.0.1 port=5000

gst-launch-1.0 udpsrc multicast-group=127.0.0.1 port=5000 \
    caps=application/x-rtp,media=application,clock-rate=90000,encoding-name=X-GST ! \
    rtpgstdepay ! flacparse ! flacdec ! audioconvert ! pulsesin
2018-04-16 21:29:57 +03:00