commit 475391209e7ed897fa60bd82ac0c3634132289a0
parent 94598ef5f31b9a9e3b9e61322640a98ae7742745
Author: Karl Tomlinson <karlt+@karlt.net>
Date: Wed, 10 Dec 2025 20:57:03 +0000
Bug 2004858 Declare Box reference parameters in Moof as const r=ArnaudBienner,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D275551
Diffstat:
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/dom/media/mp4/MoofParser.cpp b/dom/media/mp4/MoofParser.cpp
@@ -429,10 +429,10 @@ class CtsComparator {
}
};
-Moof::Moof(Box& aBox, const TrackParseMode& aTrackParseMode, const Trex& aTrex,
- const Mvhd& aMvhd, const Mdhd& aMdhd, const Edts& aEdts,
- const Sinf& aSinf, const bool aIsAudio, uint64_t* aDecodeTime,
- nsTArray<TrackEndCts>& aTracksEndCts)
+Moof::Moof(const Box& aBox, const TrackParseMode& aTrackParseMode,
+ const Trex& aTrex, const Mvhd& aMvhd, const Mdhd& aMdhd,
+ const Edts& aEdts, const Sinf& aSinf, const bool aIsAudio,
+ uint64_t* aDecodeTime, nsTArray<TrackEndCts>& aTracksEndCts)
: mRange(aBox.Range()),
mTfhd(aTrex),
// Do not reporting discontuities less than 35ms
@@ -725,7 +725,7 @@ const CencSampleEncryptionInfoEntry* Moof::GetSampleEncryptionEntry(
: &entries->ElementAt(groupIndex - 1);
}
-void Moof::ParseTraf(Box& aBox, const TrackParseMode& aTrackParseMode,
+void Moof::ParseTraf(const Box& aBox, const TrackParseMode& aTrackParseMode,
const Trex& aTrex, const Mvhd& aMvhd, const Mdhd& aMdhd,
const Edts& aEdts, const Sinf& aSinf, const bool aIsAudio,
uint64_t* aDecodeTime) {
@@ -834,7 +834,7 @@ void Moof::FixRounding(const Moof& aMoof) {
}
}
-Result<Ok, nsresult> Moof::ParseSenc(Box& aBox, const Sinf& aSinf) {
+Result<Ok, nsresult> Moof::ParseSenc(const Box& aBox, const Sinf& aSinf) {
// If we already had a senc box, ignore following ones
// Not sure how likely this could be in real life
if (mSencValid) [[unlikely]] {
@@ -910,7 +910,7 @@ Result<Ok, nsresult> Moof::ParseSenc(Box& aBox, const Sinf& aSinf) {
return Ok();
}
-Result<Ok, nsresult> Moof::ParseTrun(Box& aBox, const Mvhd& aMvhd,
+Result<Ok, nsresult> Moof::ParseTrun(const Box& aBox, const Mvhd& aMvhd,
const Mdhd& aMdhd, const Edts& aEdts,
const bool aIsAudio,
uint64_t* aDecodeTime) {
diff --git a/dom/media/mp4/MoofParser.h b/dom/media/mp4/MoofParser.h
@@ -246,10 +246,10 @@ using TrackParseMode = Variant<ParseAllTracks, uint32_t>;
class Moof final : public Atom {
public:
- Moof(Box& aBox, const TrackParseMode& aTrackParseMode, const Trex& aTrex,
- const Mvhd& aMvhd, const Mdhd& aMdhd, const Edts& aEdts,
- const Sinf& aSinf, const bool aIsAudio, uint64_t* aDecodeTime,
- nsTArray<TrackEndCts>& aTracksEndCts);
+ Moof(const Box& aBox, const TrackParseMode& aTrackParseMode,
+ const Trex& aTrex, const Mvhd& aMvhd, const Mdhd& aMdhd,
+ const Edts& aEdts, const Sinf& aSinf, const bool aIsAudio,
+ uint64_t* aDecodeTime, nsTArray<TrackEndCts>& aTracksEndCts);
void FixRounding(const Moof& aMoof);
// Retrieve CencSampleEncryptionInfoEntry for a given sample number.
@@ -282,15 +282,15 @@ class Moof final : public Atom {
private:
// aDecodeTime is updated to the end of the parsed TRAF on return.
- void ParseTraf(Box& aBox, const TrackParseMode& aTrackParseMode,
+ void ParseTraf(const Box& aBox, const TrackParseMode& aTrackParseMode,
const Trex& aTrex, const Mvhd& aMvhd, const Mdhd& aMdhd,
const Edts& aEdts, const Sinf& aSinf, const bool aIsAudio,
uint64_t* aDecodeTime);
// aDecodeTime is updated to the end of the parsed TRUN on return.
- Result<Ok, nsresult> ParseTrun(Box& aBox, const Mvhd& aMvhd,
+ Result<Ok, nsresult> ParseTrun(const Box& aBox, const Mvhd& aMvhd,
const Mdhd& aMdhd, const Edts& aEdts,
const bool aIsAudio, uint64_t* aDecodeTime);
- Result<Ok, nsresult> ParseSenc(Box& aBox, const Sinf& aSinf);
+ Result<Ok, nsresult> ParseSenc(const Box& aBox, const Sinf& aSinf);
// Process the sample auxiliary information used by common encryption.
// aScheme is used to select the appropriate auxiliary information and should
// be set based on the encryption scheme used by the track being processed.