We use the cheddar crate to generate a C header file
for our mp4parse_capi wrapper crate. Currently we
do this at code check-in time via update-rust.sh.
Cargo 0.18 and later will try to execute a build.rs
file in the crate source tree regardless of whether
it's specified in Cargo.toml so patching out that
line just results in 'crate cheddar not found'.
This change restores the old behaviour by substituting
a 'build = false' line instead.
We do have syntex vendored, but we don't currently build
it by default, so I prefer this solution to just vendoring
cheddar and generating the header at build time. The syntex
crate is quite large and adds significantly to our compile
time.
MozReview-Commit-ID: InJRRODWAdP
--HG--
extra : rebase_source : 29378fcbc86015ce6cc22dc66d38a43ddbac204e
A PPS contains an id that is used as index inside an array. We must ensure that there's enough space in that array.
Also fix H264::DecodePPS which incorrectly always returned an error when parsing a valid PPS.
MozReview-Commit-ID: L1HUAdxWdu0
--HG--
extra : rebase_source : 5e32981d60398d37775573ea17ce54a345401b21
All writes through a ByteWriter are now checked for success.
Possible failures could be in three classes:
A. Attempt to write a single unreasonably-large block of data. In this case we
just don't allocate more memory, so Firefox should keep functioning but simply
refuse to play this media.
B. Accumulation of a lot of data into a single vector. In this case we return
from the function, which should immediately free the large vector, and
hopefully allow Firefox to continue unscathed; but there is the possibility
that other memory allocations elsewhere will fail in the meantime.
C. OOM across all of Firefox, and this write is just the final drop. Like
previously we will still try to return and deallocate some memory, but this
may not be enough to recover.
So even though this patch cannot fix all possible OOM causes, I think it is
worth adding, as it is simple enough, and will help in some cases where
corrupted data could sensibly be handled without making Firefox crash.
MozReview-Commit-ID: JPVC9hao4Uq
--HG--
extra : rebase_source : b4a8af61ec8f4129819d2e8d51a5b9adc449183c
Because we read 8 bits from extradata, it won't exceed MAX_SPS/PPS_COUNT (256).
MozReview-Commit-ID: 5qr1pDLrmvt
--HG--
extra : rebase_source : 4a7269a7430ea913650298ad06a2132297dad85d
The file did set a duration of -1, which is now considered as 0.
MozReview-Commit-ID: 6HMeRw4Q8uT
--HG--
extra : rebase_source : 2292e0e945f9ac0d3d18cd758ab75ed81f412345
This is a rewrite from Stagefright's ABitReader. The major difference is that you give the original size in bits rather than in bytes. ABitReader always read all bits available. While under some circumstances we want to bound the buffer to a set number of bits.
MozReview-Commit-ID: hdJ7CAwOea
--HG--
extra : rebase_source : 684f02540f46d053f2a12d7007a67f6e0f765057
In order to increase the readability, use enum value for the NAL types.
MozReview-Commit-ID: 8iwFbB7BEOM
--HG--
extra : rebase_source : 4bfecd012904942f6ad38be9b6b69786d2d732d1
Implement the data structure for multuple SPS/PPS, and decode the multiple SPS/PPS from the extra data.
MozReview-Commit-ID: E90fdH1pvlA
--HG--
extra : rebase_source : 4b9c3229b92ec5d1d43ce14a72b8e96da516c59d
Update the import script to reference the latest published release.
Add a cargo-update step to the script. Without this the gecko build
will fail if the declared crate versions change from what is recorded
in the in-tree Cargo.lock files.
Also make it fail on first error.
MozReview-Commit-ID: 6IDK6jdkSm1
--HG--
extra : rebase_source : 0e09eb311a8ba59ad4075f43ab0d9f8a07074e89
The error message refers to video, not audio tracks. Looks like
a cut-and-paste error.
MozReview-Commit-ID: J6ur36FMSRF
--HG--
extra : rebase_source : 626e4b3287ce268d9daee26610a599c721116148
Recognize FLAC as an audio mimetype in MP4Metadata and prefer
the rust demuxer for it. Stagefright does not support this.
MozReview-Commit-ID: 7T4tCSCCNBk
--HG--
extra : rebase_source : b69c6e35d4e48c4d419856ee979eae893dbc72b1
Update to the latest upstream master, including skipping padding
at the end of some boxes, esds parsing and flac support.
MozReview-Commit-ID: GdHEQIrtyLB
--HG--
extra : rebase_source : 97e1d09725d813e0f2b31bed6ce80e16b0701fbe
Writes should always be small, so if any fails, we are in big trouble anyway.
(Effectively ByteWriter is infallible.)
MozReview-Commit-ID: CJVsrTx0PFh
--HG--
extra : rebase_source : fa4dd3230382620a393c8555338e8956df83f748
When we add SPS/PPS NAL in front of each keyframe data, this somehow makes the WMF decoder to misbehave and to always return an invalid timestamp.
MozReview-Commit-ID: 2SzTiwP0ii1
--HG--
extra : rebase_source : b499c83d504df772e6d722053630ff4d92306d4f
Having these files in-tree makes it possible to run
`cargo test` to verify changes.
MozReview-Commit-ID: 6x4XZaw4UtD
--HG--
extra : rebase_source : 293572cbbc21929b43a735bf53ddb5521503bcd2
The byteorder dependency was moved to $topsrcdir/third_party/rust/
in bug 1298422 but this import script wasn't updated.
MozReview-Commit-ID: CzoxsFPYpIm
--HG--
extra : rebase_source : 18bcc2e3351887f0593e2167acc59c6c4f6003e8