Bug 462957 - Stubs for buffered for WebM and raw video. r=roc a=blocking2.0

This commit is contained in:
Chris Pearce 2010-08-05 19:40:35 +12:00
parent fe0c15afe6
commit 1ff7ef5cbf
5 changed files with 19 additions and 1 deletions

View File

@ -300,3 +300,8 @@ PRInt64 nsRawReader::FindEndTime(PRInt64 aEndTime)
{
return -1;
}
nsresult nsRawReader::GetBuffered(nsHTMLTimeRanges* aBuffered, PRInt64 aStartTime)
{
return NS_OK;
}

View File

@ -113,6 +113,7 @@ public:
virtual nsresult ReadMetadata();
virtual nsresult Seek(PRInt64 aTime, PRInt64 aStartTime, PRInt64 aEndTime);
virtual PRInt64 FindEndTime(PRInt64 aEndOffset);
virtual nsresult GetBuffered(nsHTMLTimeRanges* aBuffered, PRInt64 aStartTime);
private:
PRBool ReadFromStream(nsMediaStream *aStream, PRUint8 *aBuf,

View File

@ -41,10 +41,17 @@ function ended(e) {
return false;
}
// Only support for buffered is available for Ogg and WAV.
// Eventually we'll support WebM as well.
function supportsBuffered(type) {
var s = type.toLowerCase();
return /ogg$/.test(s) || /wav$/.test(s)
}
for (var i=0; i<gSeekTests.length; ++i) {
var v = document.createElement('video');
var test = gSeekTests[i];
if (!v.canPlayType(test.type))
if (!v.canPlayType(test.type) || !supportsBuffered(test.type))
continue;
v.src = test.name;
v._name = test.name;

View File

@ -670,3 +670,7 @@ nsresult nsWebMReader::Seek(PRInt64 aTarget, PRInt64 aStartTime, PRInt64 aEndTim
return NS_OK;
}
nsresult nsWebMReader::GetBuffered(nsHTMLTimeRanges* aBuffered, PRInt64 aStartTime)
{
return NS_OK;
}

View File

@ -125,6 +125,7 @@ public:
virtual nsresult ReadMetadata();
virtual nsresult Seek(PRInt64 aTime, PRInt64 aStartTime, PRInt64 aEndTime);
virtual nsresult GetBuffered(nsHTMLTimeRanges* aBuffered, PRInt64 aStartTime);
private:
// Value passed to NextPacket to determine if we are reading a video or an