Closed Bug 1027875 Opened 10 years ago Closed 10 years ago

Add MP4 support to MSE

Categories

(Core :: Audio/Video, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla33

People

(Reporter: ajones, Assigned: ajones)

References

(Blocks 1 open bug, )

Details

(Keywords: dev-doc-needed)

Attachments

(5 files, 3 obsolete files)

Media Source Extensions needs to also support MP4 containers.
Comment on attachment 8443098 [details] [diff] [review]
Add MP4 support to MSE

Review of attachment 8443098 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/media/mediasource/SourceBufferResource.h
@@ +233,5 @@
>    virtual void Unpin() MOZ_OVERRIDE {}
>    virtual double GetDownloadRate(bool* aIsReliable) MOZ_OVERRIDE { return 0; }
>    virtual int64_t GetLength() MOZ_OVERRIDE { return mInputBuffer.GetLength(); }
>    virtual int64_t GetNextCachedData(int64_t aOffset) MOZ_OVERRIDE { return aOffset; }
> +  virtual int64_t GetCachedDataEnd(int64_t aOffset) MOZ_OVERRIDE { return GetLength() == aOffset ? -1 : GetLength(); }

So, this is actually wrong, sorry.  The old code was correct and this should not return a negative value.  GetNextCachedData, on the other hand, does need to return -1 when aOffset == GetLength().  That should fix the assert you're currently hitting, too.
Attached patch Add MP4 support to MSE (obsolete) — Splinter Review
Still work in progress
Attachment #8443098 - Attachment is obsolete: true
Attachment #8443190 - Flags: review?(cpearce)
Attachment #8444903 - Attachment is obsolete: true
Comment on attachment 8449969 [details] [diff] [review]
Add MP4 support to MSE

Review of attachment 8449969 [details] [diff] [review]:
-----------------------------------------------------------------

r+ with comments

::: content/media/mediasource/SourceBuffer.cpp
@@ +165,5 @@
> +    // DocType == "webm"
> +    // ...
> +    // 0x18538067 // Segment (must be "unknown" size)
> +    // 0x1549a966 // -> Segment Info
> +    // 0x1654ae6b // -> One or more Tracks

Make the comment appropriate for MP4.

@@ +175,5 @@
> +    uint32_t chunk_size = BigEndian::readUint32(aData);
> +    uint32_t chunk_type = BigEndian::readUint32(aData + 4);
> +    return chunk_size > 8 && chunk_type == 'ftyp';
> +
> +    return true;

Remove the last two lines.
Attachment #8449969 - Flags: review?(kinetik) → review+
Attachment #8449971 - Flags: review?(kinetik) → review+
Attachment #8443190 - Flags: review?(cpearce) → review+
Attachment #8449967 - Flags: review?(cpearce) → review+
Attachment #8449968 - Flags: review?(cpearce) → review+
Comment on attachment 8449973 [details] [diff] [review]
Make MP4Reader::GetBuffered() accurate - WORK IN PROGRESS

Create a separate bug for GetBuffered()
Attachment #8449973 - Attachment is obsolete: true
Do you have plans to enable it by default or only with media.mediasource.ignore_codecs pref? (like it's now).
It'll be enabled when it's ready.
The MSE part of MP4 is apparently working but there are still issues with the MP4 demuxer.
This doesn't work under Windows, right? I see there is no "media.mediasource.ignore_codecs" option in my Windows 7 x86.
What needs to be done to make this work in Windows?
You need to have nightly and set both "media.mediasource.ignore_codecs" and "media.mediasource.enabled" prefs to true. (through about:config). But I wouldn't recommend that atm since it hang itself on youtube. Not sure about mp4 though, but webm works "sometimes".
This bug means the support in MSE is there and it plays more than nothing. However both MP4 and WebM hang up on bug 1024858.
Depends on: 1041919
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: