Closed Bug 847809 Opened 13 years ago Closed 13 years ago

[MMS] Support AMR media type on Firefox OS

Categories

(Firefox OS Graveyard :: General, defect, P1)

x86_64
Gonk (Firefox OS)
defect

Tracking

(blocking-b2g:leo+, firefox21 wontfix, firefox22 fixed, b2g18 fixed, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 wontfix)

RESOLVED FIXED
B2G C4 (2jan on)
blocking-b2g leo+
Tracking Status
firefox21 --- wontfix
firefox22 --- fixed
b2g18 --- fixed
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- wontfix

People

(Reporter: shelly, Assigned: shelly)

References

Details

(Keywords: feature, Whiteboard: [3/11~3/15])

Attachments

(2 files, 7 obsolete files)

In require to the spec of MMS, adding audio/amr to the supported media type on Firefox OS.
Blocks: 840082
Attachment #721091 - Attachment is obsolete: true
this is needed to support MMS user stories. Leo+
blocking-b2g: --- → leo+
Shelly, since you already working on this. assign to you. thanks
Assignee: nobody → slin
Hi Shelly, is the patch ready for review? Thanks
Flags: needinfo?(slin)
Please ensure that AMR files cannot be played or used generally from the web. The use of AMR (and other B2G specific formats) should be restricted to internal B2G apps somehow.
Should we mark this P1 given it's new feature work?
Priority: -- → P1
Shelly, do you have any idea about the possible effort on this case? Thanks.
It looks like we only need to enable the support for AMR, and it's already done. Shelly also did the testing.
Whiteboard: [3/11~3/15]
Blocks: mms-p1
Keywords: feature
Per partner and release-driver discussions, marking blocking- until all MMS functionality in bug 849867 is complete, allowing it all to be uplifted at once to avoid SMS bustage.
blocking-b2g: leo+ → -
Attached patch Support amr audio type (obsolete) — Splinter Review
Add audio/amr to the supported decoder type of OMX, and to the list of external mimetype.
Attachment #721095 - Attachment is obsolete: true
Flags: needinfo?(slin)
Attached patch Support amr audio type (obsolete) — Splinter Review
Add audio/amr to the supported decoder type of OMX, and to the list of external mimetype.
Attachment #723781 - Attachment is obsolete: true
Comment on attachment 723787 [details] [diff] [review] Support amr audio type Hi Chris, this has ensure that we only support amr files on B2G, could you review the patch at your convenience? or could you direct me to someone else who can take the reviewing job? Thanks!
Attachment #723787 - Flags: feedback?(chris.double)
Comment on attachment 723787 [details] [diff] [review] Support amr audio type Hi :roc, since this is a p1 issue and I haven't heard from Chris, could you review this patch? Thanks.
Attachment #723787 - Flags: feedback?(roc)
What Chris asked for in comment #6 was that on B2G, only B2G apps should be able to play AMR. Web sites loaded in the Web browser should not be able to play AMR. We need to discourage Web and app developers from using AMR and encourage them to use Opus, MP3 or AAC instead. It would be even better if we can limit the apps which can use AMR to some set of privileged apps. The same is true for 3gpp. The way I suggest you do this is to add an nsIPrincipal* parameter to IsOmxSupportedType, defaulting to null. All our current callers would pass null except nsHTMLMediaElement::CreateDecoder, which would pass this->NodePrincipal(). IsOmxSupportedType should only support AMR and 3gpp when the principal is not null and corresponds to the right sort of app. Maybe we should check nsIPrincipal::GetAppStatus is APP_STATUS_PRIVILEGED or above? I don't know enough about the B2G app permissions system to be sure.
Comment on attachment 723787 [details] [diff] [review] Support amr audio type Review of attachment 723787 [details] [diff] [review]: ----------------------------------------------------------------- Sorry, missed the feedback request due to email issues. It all looks good for supporting AMR at compile time but the issue is this enables AMR support at runtime for all web properties. This means the browser can visit sites with AMR files and play them. We shouldn't allow these formats to spread into the open web and should limit them to 'on device' playback only.
Attachment #723787 - Flags: feedback?(chris.double) → feedback-
Attached patch v2: Support amr audio type (obsolete) — Splinter Review
Thanks for your feedback! I think it works becuase a Tab has an appStatus of "APP_STATUS_INSTALLED".
Attachment #723787 - Attachment is obsolete: true
Attachment #723787 - Flags: feedback?(roc)
Attachment #725344 - Flags: feedback?(roc)
Comment on attachment 725344 [details] [diff] [review] v2: Support amr audio type Review of attachment 725344 [details] [diff] [review]: ----------------------------------------------------------------- ::: content/media/DecoderTraits.cpp @@ +416,5 @@ > #endif > #ifdef MOZ_WIDGET_GONK > if (IsOmxSupportedType(aType)) { > + if (aType.EqualsASCII("audio/amr") || aType.EqualsASCII("video/3gpp")) { > + nsHTMLMediaElement* aElement = aOwner->GetMediaElement(); This might return null. If it's null, we should not support this format. @@ +418,5 @@ > if (IsOmxSupportedType(aType)) { > + if (aType.EqualsASCII("audio/amr") || aType.EqualsASCII("video/3gpp")) { > + nsHTMLMediaElement* aElement = aOwner->GetMediaElement(); > + nsIPrincipal* aPrincipal = aElement->NodePrincipal(); > + if (!aPrincipal) return decoder.forget(); just return nullptr. Also, the return goes on its own line. @@ +420,5 @@ > + nsHTMLMediaElement* aElement = aOwner->GetMediaElement(); > + nsIPrincipal* aPrincipal = aElement->NodePrincipal(); > + if (!aPrincipal) return decoder.forget(); > + if (aPrincipal->GetAppStatus() < nsIPrincipal::APP_STATUS_PRIVILEGED) { > + return decoder.forget(); same as above.
Attachment #725344 - Flags: feedback?(roc) → feedback+
Attached patch v2: Support amr audio type (obsolete) — Splinter Review
Hi :roc, Could you review the patch at your convenience? I've fixed the patch per feedback and added some comments to the change. Thank you very much!
Attachment #725344 - Attachment is obsolete: true
Attachment #725977 - Flags: review?(roc)
Comment on attachment 725977 [details] [diff] [review] v2: Support amr audio type Review of attachment 725977 [details] [diff] [review]: ----------------------------------------------------------------- ::: content/media/DecoderTraits.cpp @@ +419,5 @@ > + // AMR audio is enabled for MMS, but we are discouraging Web and App > + // developers from using AMR, thus we only allow AMR to be played on WebApps. > + if (aType.EqualsASCII("audio/amr") || aType.EqualsASCII("video/3gpp")) { > + nsHTMLMediaElement* aElement = aOwner->GetMediaElement(); > + nsIPrincipal* aPrincipal = aElement->NodePrincipal(); Don't call these aElement/aPrincipal. Names starting with "a" are reserved for parameters. Call them "element" and "principal". "element" could be null, so you need to check for that here.
Attached patch v2: Support amr audio type (obsolete) — Splinter Review
Thanks :roc, here is the fixed :)
Attachment #725977 - Attachment is obsolete: true
Attachment #725977 - Flags: review?(roc)
Attachment #725986 - Flags: review?(roc)
Keywords: checkin-needed
Backed out for build bustage. https://hg.mozilla.org/integration/mozilla-inbound/rev/f9fb17feaa70 https://tbpl.mozilla.org/php/getParsedLog.php?id=20930318&tree=Mozilla-Inbound /builds/slave/m-in-ics_a7_g-0000000000000000/build/content/media/DecoderTraits.cpp: In static member function 'static already_AddRefed<mozilla::MediaDecoder> mozilla::DecoderTraits::CreateDecoder(const nsACString_internal&, mozilla::MediaDecoderOwner*)': /builds/slave/m-in-ics_a7_g-0000000000000000/build/content/media/DecoderTraits.cpp:407: error: 'nsHTMLMediaElement' was not declared in this scope /builds/slave/m-in-ics_a7_g-0000000000000000/build/content/media/DecoderTraits.cpp:407: error: 'element' was not declared in this scope make[6]: *** [DecoderTraits.o] Error 1
Carry r+.
Attachment #725986 - Attachment is obsolete: true
Attachment #728024 - Flags: review+
https://tbpl.mozilla.org/?tree=Try&rev=c10e6f4e9509 https://tbpl.mozilla.org/?tree=Try&rev=a994f4802ee0 (It was very weird that I can even pass the building stage and try server...)
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → B2G C4 (2jan on)
blocking-b2g: - → leo?
Bug 847006 added amr support into DeviceStorage.
Depends on: 847006
triage: blocking in support of MMS
blocking-b2g: leo? → leo+
To change the status-b2g18 to affected, so the sheriff will scan it and help to uplift.
(In reply to Marco Chen [:mchen] from comment #31) > To change the status-b2g18 to affected, so the sheriff will scan it and help > to uplift. All I need is the leo+ to find it :). That said, this needs a b2g18-specific patch.
I found out that we have a refactor for media decoder, file DecoderTraits.cpp is newly added and is not in the code base of b2g18. Does it needs another review?
Attachment #747271 - Flags: review?(roc)
Comment on attachment 747271 [details] [diff] [review] Support amr audio type (b2g18) Review of attachment 747271 [details] [diff] [review]: ----------------------------------------------------------------- ::: content/html/content/src/nsHTMLMediaElement.cpp @@ +2590,5 @@ > + nsIPrincipal* principal = NodePrincipal(); > + if (!principal) { > + return nullptr; > + } > + if (principal->GetAppStatus() < nsIPrincipal::APP_STATUS_PRIVILEGED) { Actually, the app status of a web tab is APP_STATUS_NOT_INSTALLED, and is APP_STATUS_INSTALLED on a test app (not approved by Firefox Marketplace). Should I lower the level check to the following? |if (principal->GetAppStatus() < nsIPrincipal::APP_STATUS_INSTALLED)|
Hi Chris, any thoughts about comment 34?
Flags: needinfo?(chris.double)
Comment on attachment 747271 [details] [diff] [review] Support amr audio type (b2g18) Review of attachment 747271 [details] [diff] [review]: ----------------------------------------------------------------- The patch looks OK. Let's land this. The question of whether installed-but-not-privileged apps should have AMR access can be answered separately. I'd say that if we don't have a compelling need for that, we should avoid it.
(In reply to Shelly Lin [:shelly] from comment #35) > Hi Chris, any thoughts about comment 34? Stick with privileged for now and worry about installed apps later. Easier to drop down than up if needed I think,
Flags: needinfo?(chris.double)
Flags: in-moztrap-
To clarify, what does the current patch include? All points Roc mentioned in comment #15 or some? 1. AMR for "on device" play only and not on web 2. limit the apps which can use AMR to some set (or all?) of privileged apps.
1. Yes, AMR can only be loaded and played on "on device" web apps, not on web pages. 2. Yes, even for "on device" web apps are limited to privileged apps.
Attachment #747271 - Flags: review?(roc)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: