Commit graph

4986 commits

Author SHA1 Message Date
Mark Nauwelaerts
60c8ed21d5 qtmux: remove large-file property
Rather, auto-determine if 64-bits fields are needed for a valid result, and
stick to plain 32-bits if not needed.

API: GstQTMux:large-file (removed)
2011-04-12 20:32:20 +01:00
Sebastian Dröge
d8a690e64c qtmux: Free AtomInfo structs 2011-04-12 20:32:20 +01:00
Sebastian Dröge
6e350ec961 qtmux: Free tag string after use 2011-04-12 20:32:20 +01:00
Lasse Laukkanen
02bdefd9ba qtmux: allow zero duration tracks 2011-04-12 20:32:20 +01:00
Mark Nauwelaerts
07be810e0e qtmux: add documentation 2011-04-12 20:32:20 +01:00
David Hoyt
62484ac805 qtmux: handle msvc ftruncate incompatibility
Fixes #636185.
2011-04-12 20:32:20 +01:00
Alejandro Gonzalez
04b0a37f87 qtmux: gst_qtmux_check_difference verify before subtract
Avoid negative overflow by checking the order of operands
on subtraction of unsigned integers.

https://bugzilla.gnome.org/show_bug.cgi?id=635878
2011-04-12 20:32:20 +01:00
Mark Nauwelaerts
9c198ffeed qtmux: remove remnant of obsolete property 2011-04-12 20:32:20 +01:00
Marc-André Lureau
bee00aa70f qtmux: allow specifying trak timescale
This is mainly because Smoothstreaming client are broken and don't
take the TimeScale property into account.
2011-04-12 20:32:19 +01:00
Mark Nauwelaerts
92b8a00ac8 qtmux: include sdtp atoms for ismv fragmented files
Based on patch by Marc-André Lureau <mlureau@flumotion.com>
2011-04-12 20:32:19 +01:00
Mark Nauwelaerts
f490e3a868 qtmux: enable default fragmented file for ismlmux 2011-04-12 20:32:19 +01:00
Marc-André Lureau
7a447b4372 qtmux: add ismlmux, for fragmented isml major brand 2011-04-12 20:32:19 +01:00
Mark Nauwelaerts
50464d5f93 qtmux: finalize sinkpads list 2011-04-12 20:32:19 +01:00
Marc-André Lureau
bd0d320d6c qtmux: add moov in streamheader 2011-04-12 20:32:19 +01:00
Marc-André Lureau
61964eb109 qtmux: add streamable property to avoid building fragmented mfra index 2011-04-12 20:32:19 +01:00
Mark Nauwelaerts
26a281bdab qtmux: add mfra to fragmented file
Based on patch by Marc-André Lureau <mlureau@flumotion.com>
2011-04-12 20:32:19 +01:00
Mark Nauwelaerts
4b64dc2f3e qtmux: optionally create fragmented file
In this mode, an initial empty moov (containing only stream metadata) is written,
followed by fragments containing actual data (along with required metadata).
New fragments are started either at keyframe (if such are sparse) or when
property configured duration exceeded.

Based on patch by Marc-André Lureau <mlureau@flumotion.com>

Fixes #632911.
2011-04-12 20:32:19 +01:00
Mark Nauwelaerts
c61dc2ec4a qtmux: use helper to set atom flags from given uint 2011-04-12 20:32:19 +01:00
Mark Nauwelaerts
69d07466e0 qtmux: refactor configuring and sending of moov
Based on patch by Marc-André Lureau <mlureau@flumotion.com>
2011-04-12 20:32:19 +01:00
Mark Nauwelaerts
35e028f33b qtmux: refactor extra top-level atom handling
Also check a bit more for possible errors, and free proper items in such case.
2011-04-12 20:32:19 +01:00
Mark Nauwelaerts
79f565f962 qtmux: refactor slightly using buffer helper 2011-04-12 20:32:19 +01:00
Mark Nauwelaerts
1e3da91bd1 qtmux: fix misinforming comment 2011-04-12 20:32:19 +01:00
Mark Nauwelaerts
ce865cc374 qtmux: delegate mvex handling to atoms
... which keeps qtmux simpler.
2011-04-12 20:32:19 +01:00
Marc-André Lureau
2618cb03af qtmux: add mvex/trex in header if fragmented
One "trex" is added per "trak". We don't support default values,
but the "trex" box is mandatory.
2011-04-12 20:32:18 +01:00
Marc-André Lureau
9100168eae qtmux: add a couple of fourcc for fragmented mp4 2011-04-12 20:32:18 +01:00
Mark Nauwelaerts
c35074499a qtmux: avoid removing temp file when error occurred 2011-04-12 20:32:18 +01:00
Marc-André Lureau
c2718fdd5f qtmux: truncate buffer file after each send 2011-04-12 20:32:18 +01:00
Marc-André Lureau
3e6a415e52 qtmux: remove temp file when reset/finalize 2011-04-12 20:32:18 +01:00
Stefan Kost
1d1ffe234f various (gst): add missing G_PARAM_STATIC_STRINGS flags
Canonicalize property names as needed.
2011-04-12 20:32:18 +01:00
Mark Nauwelaerts
a5edbe38a0 qtmux: prevent infinite loop when adjusting framerate
Fixes #632070.
2011-04-12 20:32:18 +01:00
Thiago Santos
5ccc066c98 qtmux: Add G_PARAM_STATIC_STRINGS
Add G_PARAM_STATIC_STRINGS to qtmux properties
2011-04-12 20:32:18 +01:00
Thiago Santos
7065a65ec8 qtmux: Follow xmp serialization guidelines closer
qt and isom variants have different ways of serializing
xmp, follow these guidelines.

Those can be found in Adobe's xmp docs.
2011-04-12 20:32:18 +01:00
Mark Nauwelaerts
365b419216 qtmux: autodetect out-of-order input timestamps and determine DTS accordingly
Favour using input buffer timestamps for DTS, but fallback to using buffer
duration (accumulation) if input ts detected out-of-order.

Fixes #624212.
2011-04-12 20:32:18 +01:00
Marc-André Lureau
9e79307431 qtmux: use caps bitrate at last chance
If we didn't get the stream's bitrate from one of the atoms,
try getting it from the caps as a last resort.

https://bugzilla.gnome.org/show_bug.cgi?id=625496
2011-04-12 20:32:18 +01:00
Marc-André Lureau
da6bfa460d qtmux: btrt - max bitrate before average
According to iso base media file format, the max bitrate
is before the avg

https://bugzilla.gnome.org/show_bug.cgi?id=625496
2011-04-12 20:32:18 +01:00
Arun Raghavan
9e5c575b49 qtmux: Write 'btrt' atom for H.264 media if possible
This writes out the optional 'btrt' atom (MPEG4BitrateBox) for H.264
media if either or both of average and maximum bitrate are available for
the stream.

https://bugzilla.gnome.org/show_bug.cgi?id=623678
2011-04-12 20:32:18 +01:00
Arun Raghavan
4b4398c9dd qtmux: Write avg/max bitrate to ESDS if available
This collects the 'bitrate' and 'maximum-bitrate' tags on the
corresponding pad and uses these to populate these fields in the ESDS
where applicable.

https://bugzilla.gnome.org/show_bug.cgi?id=623678
2011-04-12 20:32:18 +01:00
Edward Hervey
099ad6380f qtmux: Don't use bogus codec/format tags
https://bugzilla.gnome.org/show_bug.cgi?id=623365
2011-04-12 20:32:17 +01:00
Thiago Santos
ac7f4cba67 qtmux: Write uint tags that don't have a complement
Write uint tags that have complements (e.g. track-number/
track-count) even when we only have one of them available
and set the other one to 0.

Fixes #622484
2011-04-12 20:32:17 +01:00
Edward Hervey
0fa380b199 qtmux: Remove the pad from our internal list before calling collectpads
Previously we would end up with the collectpaddata structure already freed.
This would result in a bogus iteration of mux->sinkpads (all the
GstQTPad being freed) and it wouldn't be removed from that list.

Finally, due to it not being removed from that list, we would end up
calling a bogus gst_qt_mux_pad_reset on those structures => SEGFAULT
2011-04-12 20:32:17 +01:00
David Schleef
4bb9ffa8fb qtmux: Add VP8 2011-04-12 20:32:17 +01:00
Tim-Philipp Müller
48880abb5b qtmux: use GStreamer package name and origin in the plugin info 2011-04-12 20:32:17 +01:00
Tim-Philipp Müller
1663c51243 qtmux: init debug category before using it 2011-04-12 20:32:17 +01:00
Benjamin Otte
6f27e4e488 Add -Wold-style-definition
and fix the warnings
2011-04-12 20:32:17 +01:00
Benjamin Otte
c4161b3c33 Add -Wwrite-strings
and fix its warnings
2011-04-12 20:32:17 +01:00
Benjamin Otte
62be91708f Add -Wmissing-declarations -Wmissing-prototypes to configure flags
And fix all warnings
2011-04-12 20:32:17 +01:00
Benjamin Otte
af347a9545 gst_element_class_set_details => gst_element_class_set_details_simple 2011-04-12 20:32:17 +01:00
Thiago Santos
281ef57d2b qtmux: Use xmp on mp4mux and gppmux too
Do not restrict xmp to qtmux, but use it too
on mp4mux and gppmux
2011-04-12 20:32:17 +01:00
Thiago Santos
a740adc137 qtmux: add xmp support
Adds xmp metatags adding to qtmux.

Fixes #609539
2011-04-12 20:32:16 +01:00
Tim-Philipp Müller
f9bba010fa qtmux: fix GST_ELEMENT_ERROR usage
We need to pass (NULL) rather than NULL for empty arguments.
2011-04-12 20:32:16 +01:00
Rob Clark
ae0d32843e qtmux: fix compile error
gst/quicktime/gstqtmoovrecover.c:268: warning: format not a string literal and no format arguments

https://bugzilla.gnome.org/show_bug.cgi?id=612454
2011-04-12 20:32:16 +01:00
Thiago Santos
8d86f34871 qtmux: Rename 'avc-sample' to 'avc' in caps
Fixes #606662
2011-04-12 20:32:16 +01:00
Michael Smith
8b3aca9070 qtmux: Take lock around use of (non-threadsafe) tagsetter interface. 2011-04-12 20:32:16 +01:00
Thiago Santos
953aa983bb qtmux: write all udta children atoms
UDTA might have META and other children atoms
together, write them all.
2011-04-12 20:32:16 +01:00
Thiago Santos
c92785e1c2 qtmux: Use internal sink pads list
Due to GstCollectPads sink pads list being not reliably
iteratable (when not inside the collected function) this
patch adds a sink pads list to qtmux to be used when iterating
sink pads on reset function.

Fixes #609055
2011-04-12 20:32:16 +01:00
Mark Nauwelaerts
589f70955c qtmux: prevent leaking hdlr name 2011-04-12 20:32:16 +01:00
Mark Nauwelaerts
bcc9fe0463 qtmux: support for ALAC
Fixes #580731.
2011-04-12 20:32:16 +01:00
Mark Nauwelaerts
76b6997b55 qtmux: refactor building stsd entry 'wave' extension 2011-04-12 20:32:16 +01:00
Thiago Santos
528846c5a1 qtmux: atomsrecovery: Fix compilation problem
Fixes a compilation error due to unused function result.
2011-04-12 20:32:16 +01:00
Thiago Santos
b692f9ffb0 qtmux: Adds moov recovery feature
Adds a new property to qtmux that sets a path to a file to write
and update data about the moov atom (that is not writen till the
end of the file). If the pipeline/app crashes during execution it
might be possible to recover the movie using the qtmoovrecover element.

qtmoovrecover is an element that is also a pipeline. It is not
meant to be used with other elements (it has no pads). It is merely
a tool/utilitary to recover unfinished qtmux files.

Fixes #601576
2011-04-12 20:32:16 +01:00
Michael Smith
3c0e4d8267 qtmux: for fixed-sample size streams (PCM audio, etc) don't allocate an enormous
buffer that we then won't use at all.
2011-04-12 20:32:15 +01:00
Michael Smith
d784a8da6a qtmux: handle muxing adpcm correctly. 2011-04-12 20:32:15 +01:00
Michael Smith
5f1941a000 qtmux: Set the mdia hdlr name field to what quicktime uses. Fix writing it
since it's not null-terminated. Improves compatibility with some hardware
players.
2011-04-12 20:32:15 +01:00
Michael Smith
2d3dc1653b qtmux: endianness in gstreamer is an int, not boolean. 2011-04-12 20:32:15 +01:00
Mark Nauwelaerts
150f9ad64d qtmux: streamline moov data memory storage
In particular, use arrays rather than (double) linked lists.
2011-04-12 20:32:15 +01:00
Thiago Santos
6dc515bfa7 qtmux: g_free is NULL safe 2011-04-12 20:32:15 +01:00
Benjamin Otte
6569e9587c [cleanup] Various style and cleanups
Various fixes for gtk-doc warnings and making functions without
arguments take void as parameter.
2011-04-12 20:32:15 +01:00
Thiago Santos
33bf180eaa qtmux: Actually use new caps info on renegotiation
Following the previous qtmux commit, this patch tries
to use the new info added to the caps to fill the 'trak'
atom's fields and children atoms. This way qtmux will
use the late added 'codec_data' when h264parse adds
it in the following pipeline:

videotestsrc num-buffers=200 ! x264enc byte-stream=true ! \
h264parse output-format=0 ! qtmux ! \
filesink location=test.mov
2011-04-12 20:32:15 +01:00
Thiago Santos
a5f22f03aa qtmux: Do caps renegotiation when it only adds fields
Qtmux can accept caps renegotiation if the new caps is a
superset of the old one, meaning upstream added new info to
the caps. This patch still doesn't make qtmux update any
atoms info from the new info, but at least it doesn't
reject the new caps anymore.

A pipeline that reproduces this use case is:

videotestsrc num-buffers=200 ! x264enc byte-stream=true ! \
h264parse output-format=0 ! qtmux ! \
filesink location=test.mov
2011-04-12 20:32:15 +01:00
Mark Nauwelaerts
6beda8aae0 qtmux: provide request pads under wider conditions
Fixes #606859.
2011-04-12 20:32:15 +01:00
Thiago Santos
45458c44a4 qtmux: Only accept avc-sample h264
qtmux and mp4mux should only accept h264 in avc-sample
format
2011-04-12 20:32:15 +01:00
Thiago Santos
87450c1b6e Rename aac's stream-format 'none' to 'raw'
Renames aac's stream-format from previous commits from none to
raw
2011-04-12 20:32:15 +01:00
Thiago Santos
cbc0b053ee qtmux: Only accept stream-format='none' aac
Only accept raw aac streams (stream-format=none) to avoid
generating invalid files.

Fixes #604925
2011-04-12 20:32:15 +01:00
Stefan Kost
02d1035571 qtmux: also add .h file changes to unbreak the build 2011-04-12 20:32:14 +01:00
Stefan Kost
05257feb87 qtmux: use correct names from template for request pads
The pads where names pad0, pad1, ...
2011-04-12 20:32:14 +01:00
Stefan Kost
7d9ed16bbe qtmux: move errors _new_pad to the end 2011-04-12 20:32:14 +01:00
Thiago Santos
592171b9b5 qtmux: Accept non-paired uint tags
Adds support for unpaired unsigned interger tags
2011-04-12 20:32:14 +01:00
Thiago Santos
9a6514e4a7 qtmux: Adds new tags
Maps more tags that are already posted by qtdemux

Fixes #599759
2011-04-12 20:32:14 +01:00
Thiago Santos
c5f6e74db9 qtmux: support more of j2k
Reads the new caps added to qtdemux by commit
c917d65e6d
and adds its corresponding atoms.

Also adds support for image/x-jpc as it is the same
as image/x-jp2, except that the buffers need to be
boxed inside a jp2c isom box before muxing. To solve
this the QTPads now have a function that (if
not NULL) is called when a buffer is collected. This
function returns a replacement to the current collected
buffer.

Fixes #598916
2011-04-12 20:32:14 +01:00
Thiago Santos
083f825c43 qtmux: Maps 'classification' tag for 3gpp files
Adds the mapping of 'classification' tags to writing of
'clsf' atoms for gppmux.

Based on a patch by: Lasse Laukkanen <ext-lasse.2.laukkanen@nokia.com>
2011-04-12 20:32:14 +01:00
Michael Smith
a597bd7273 qtmux: remove c++ comments and add some more comments. 2011-04-12 20:32:14 +01:00
Michael Smith
d74567ca94 qtmux: add ima adpcm support 2011-04-12 20:32:14 +01:00
Thiago Santos
79a9031c16 qtmux: replace _scale with _scale_round
Use the rounding version for improved sync between streams.
Small variations in the duration when muxing might lead to
cumullative wrong timestamping when demuxing.

Fixes #602936
2011-04-12 20:32:14 +01:00
Thiago Santos
259c204f42 qtmux: use timestamps for muxing
Try to use timestamps even when the stream has out of order
timestamps, only fall back to durations when we detect an
out of order buffer. Improves sync between streams.
2011-04-12 20:32:14 +01:00
Thiago Santos
e62be695a1 qtmux: fix missing debug argument
Adds a missing debug argument
2011-04-12 20:32:14 +01:00
Mark Nauwelaerts
7bf67a6e3d qtmux: fix misinforming debug statement 2011-04-12 20:32:13 +01:00
Mark Nauwelaerts
a64873e15a qtmux: ensure writable buffer metadata before setting caps 2011-04-12 20:32:13 +01:00
Thiago Santos
496bd01a0f qtmux: support for SVQ3
Adds support for muxing SVQ3 content. Usually this format
has decoder info that must be passed in the 'seqh' field
in the caps. It is also good to add the gama atom to make
quicktime not crash.

Fixes #587922
2011-04-12 20:32:13 +01:00
Thiago Sousa Santos
d24d1e40ea qtmux: do not leak a string
Frees a string after use. Also does some code organization
2011-04-12 20:32:13 +01:00
Thiago Sousa Santos
2f90d33509 qtmux: do not add size to the pointer variable
Do not wrongly add the result of the function to the
pointer to the buffer size. Instead, check the result
to see if the serialization was ok.

Based on a patch by: "Carsten Kroll <car@ximidi.com>"

Fixes #602106
2011-04-12 20:32:13 +01:00
Thiago Santos
8d80e93512 qtmux: handle 'late' streams
When muxing streams, some can start later than others. qtmux
now handle this by adding an empty edts entry with the
duration of the 'lateness' to the stream's trak.
It tolerates a stream to be up to 0.1s late.

Fixes #586848
2011-04-12 20:32:13 +01:00
Thiago Santos
22e4fb92a9 qtmux: adds the EDTS and ELTS atoms to atoms.c
These atoms will be useful for signaling streams
that start later in the file. As well for adding
edit lists if needed sometime later.
2011-04-12 20:32:13 +01:00
Thiago Santos
009d104a34 qtmux: Adding some ifs for protection
Adding somes ifs to protect against warning conditions
that might happen when upstream element is not sane

Fixes #600895
2011-04-12 20:32:13 +01:00
Thiago Santos
4ff2fad6a0 gppmux: Add support for 3gr6
Keep track of the chunk durations to be able to add 3gr6
brand if it is a faststart file and the longest chunk is
smaller than a sec. Implemented according to 3gpp
TS 26.244 v6.4.0 (2005-09)

Fixes #584361
2011-04-12 20:32:13 +01:00
Thiago Santos
e8c21f14cc qtmux: Only push ftyp later (in faststart mode)
In faststart mode, there is no need to send the ftyp
right at the beginning of the stream. Waiting and sending it
only later (when the moov atom is ready to be sent) provides
us with more information about the stream and we can better
select the compatible brands.
2011-04-12 20:32:13 +01:00
Thiago Santos
99f47c4b17 qtmux: Improve error message
Improve error message when we can't get or estimate the
timestamp/duration of a buffer
2011-04-12 20:32:13 +01:00
Marc-André Lureau
0dec6cbbba qtmux: fix flags_as_uint to flags[] 2011-04-12 20:32:13 +01:00
Jan Urbanski
d43db1bc8d qtmux: Don't require endianness field for 8 bit raw audio
Fixes bug #590360.
2011-04-12 20:32:12 +01:00
Edward Hervey
ac88adca6e qtmux: Remove unused variable. 2011-04-12 20:32:12 +01:00
Edward Hervey
430953e8d2 qtmux: Fix debug statement. 2011-04-12 20:32:12 +01:00