mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 07:13:20 +00:00
Bug 1171330: P14. Add ContainerParser::FirstCompleteMediaHeader() method. r=kentuckyfriedtakahe
--HG-- extra : rebase_source : 6adaf84ce44a6024b5eb40672f3d8d9bb107432d
This commit is contained in:
parent
0a0c636147
commit
bc7bec465a
@ -92,18 +92,24 @@ ContainerParser::InitData()
|
||||
return mInitData;
|
||||
}
|
||||
|
||||
MediaByteRange
|
||||
ContainerParser::MediaSegmentRange()
|
||||
{
|
||||
return mCompleteMediaSegmentRange;
|
||||
}
|
||||
|
||||
MediaByteRange
|
||||
ContainerParser::InitSegmentRange()
|
||||
{
|
||||
return mCompleteInitSegmentRange;
|
||||
}
|
||||
|
||||
MediaByteRange
|
||||
ContainerParser::MediaHeaderRange()
|
||||
{
|
||||
return mCompleteMediaHeaderRange;
|
||||
}
|
||||
|
||||
MediaByteRange
|
||||
ContainerParser::MediaSegmentRange()
|
||||
{
|
||||
return mCompleteMediaSegmentRange;
|
||||
}
|
||||
|
||||
class WebMContainerParser : public ContainerParser {
|
||||
public:
|
||||
explicit WebMContainerParser(const nsACString& aType)
|
||||
@ -339,6 +345,7 @@ public:
|
||||
mp4_demuxer::Interval<mp4_demuxer::Microseconds> compositionRange =
|
||||
mParser->GetCompositionRange(byteRanges);
|
||||
|
||||
mCompleteMediaHeaderRange = mParser->FirstCompleteMediaHeader();
|
||||
mCompleteMediaSegmentRange = mParser->FirstCompleteMediaSegment();
|
||||
ErrorResult rv;
|
||||
mResource->EvictData(mParser->mOffset, mParser->mOffset, rv);
|
||||
|
@ -52,10 +52,15 @@ public:
|
||||
}
|
||||
|
||||
bool HasCompleteInitData();
|
||||
// Return the byte range of the first complete media segment or an empty
|
||||
// Returns the byte range of the first complete init segment, or an empty
|
||||
// range if not complete.
|
||||
MediaByteRange InitSegmentRange();
|
||||
// Returns the byte range of the first complete media segment header,
|
||||
// or an empty range if not complete.
|
||||
MediaByteRange MediaHeaderRange();
|
||||
// Returns the byte range of the first complete media segment or an empty
|
||||
// range if not complete.
|
||||
MediaByteRange MediaSegmentRange();
|
||||
MediaByteRange InitSegmentRange();
|
||||
|
||||
static ContainerParser* CreateForMIMEType(const nsACString& aType);
|
||||
|
||||
@ -63,8 +68,9 @@ protected:
|
||||
nsRefPtr<MediaLargeByteBuffer> mInitData;
|
||||
nsRefPtr<SourceBufferResource> mResource;
|
||||
bool mHasInitData;
|
||||
MediaByteRange mCompleteMediaSegmentRange;
|
||||
MediaByteRange mCompleteInitSegmentRange;
|
||||
MediaByteRange mCompleteMediaHeaderRange;
|
||||
MediaByteRange mCompleteMediaSegmentRange;
|
||||
const nsCString mType;
|
||||
};
|
||||
|
||||
|
@ -81,6 +81,15 @@ MoofParser::RebuildFragmentedIndex(BoxContext& aContext)
|
||||
return foundValidMoof;
|
||||
}
|
||||
|
||||
MediaByteRange
|
||||
MoofParser::FirstCompleteMediaHeader()
|
||||
{
|
||||
if (Moofs().IsEmpty()) {
|
||||
return MediaByteRange();
|
||||
}
|
||||
return Moofs()[0].mRange;
|
||||
}
|
||||
|
||||
MediaByteRange
|
||||
MoofParser::FirstCompleteMediaSegment()
|
||||
{
|
||||
|
@ -226,6 +226,7 @@ public:
|
||||
bool BlockingReadNextMoof();
|
||||
bool HasMetadata();
|
||||
MediaByteRange FirstCompleteMediaSegment();
|
||||
MediaByteRange FirstCompleteMediaHeader();
|
||||
|
||||
mozilla::MediaByteRange mInitRange;
|
||||
nsRefPtr<Stream> mSource;
|
||||
|
Loading…
Reference in New Issue
Block a user