summaryrefslogtreecommitdiff
path: root/dom/media/fmp4/MP4Demuxer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/fmp4/MP4Demuxer.cpp')
-rw-r--r--dom/media/fmp4/MP4Demuxer.cpp35
1 files changed, 8 insertions, 27 deletions
diff --git a/dom/media/fmp4/MP4Demuxer.cpp b/dom/media/fmp4/MP4Demuxer.cpp
index 70b1766990..5a637b0035 100644
--- a/dom/media/fmp4/MP4Demuxer.cpp
+++ b/dom/media/fmp4/MP4Demuxer.cpp
@@ -81,35 +81,11 @@ private:
bool
AccumulateSPSTelemetry(const MediaByteBuffer* aExtradata)
{
+ // XXX: Do we still need this without telemetry?
mp4_demuxer::SPSData spsdata;
if (mp4_demuxer::H264::DecodeSPSFromExtraData(aExtradata, spsdata)) {
- uint8_t constraints = (spsdata.constraint_set0_flag ? (1 << 0) : 0) |
- (spsdata.constraint_set1_flag ? (1 << 1) : 0) |
- (spsdata.constraint_set2_flag ? (1 << 2) : 0) |
- (spsdata.constraint_set3_flag ? (1 << 3) : 0) |
- (spsdata.constraint_set4_flag ? (1 << 4) : 0) |
- (spsdata.constraint_set5_flag ? (1 << 5) : 0);
- Telemetry::Accumulate(Telemetry::VIDEO_DECODED_H264_SPS_CONSTRAINT_SET_FLAG,
- constraints);
-
- // Collect profile_idc values up to 244, otherwise 0 for unknown.
- Telemetry::Accumulate(Telemetry::VIDEO_DECODED_H264_SPS_PROFILE,
- spsdata.profile_idc <= 244 ? spsdata.profile_idc : 0);
-
- // Make sure level_idc represents a value between levels 1 and 5.2,
- // otherwise collect 0 for unknown level.
- Telemetry::Accumulate(Telemetry::VIDEO_DECODED_H264_SPS_LEVEL,
- (spsdata.level_idc >= 10 && spsdata.level_idc <= 52) ?
- spsdata.level_idc : 0);
-
- // max_num_ref_frames should be between 0 and 16, anything larger will
- // be treated as invalid.
- Telemetry::Accumulate(Telemetry::VIDEO_H264_SPS_MAX_NUM_REF_FRAMES,
- std::min(spsdata.max_num_ref_frames, 17u));
-
return false;
}
-
return true;
}
@@ -349,8 +325,13 @@ MP4TrackDemuxer::GetNextSample()
if (sample->mCrypto.mValid) {
nsAutoPtr<MediaRawDataWriter> writer(sample->CreateWriter());
writer->mCrypto.mMode = mInfo->mCrypto.mMode;
- writer->mCrypto.mIVSize = mInfo->mCrypto.mIVSize;
- writer->mCrypto.mKeyId.AppendElements(mInfo->mCrypto.mKeyId);
+
+ // Only use the default key parsed from the moov if we haven't already got
+ // one from the sample group description.
+ if (writer->mCrypto.mKeyId.Length() == 0) {
+ writer->mCrypto.mIVSize = mInfo->mCrypto.mIVSize;
+ writer->mCrypto.mKeyId.AppendElements(mInfo->mCrypto.mKeyId);
+ }
}
return sample.forget();
}