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)
Tracking
(blocking-b2g:leo+, 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)
|
4.33 KB,
patch
|
shelly
:
review+
|
Details | Diff | Splinter Review |
|
4.61 KB,
patch
|
Details | Diff | Splinter Review |
In require to the spec of MMS, adding audio/amr to the supported media type on Firefox OS.
| Assignee | ||
Comment 1•13 years ago
|
||
| Assignee | ||
Comment 2•13 years ago
|
||
Attachment #721091 -
Attachment is obsolete: true
Comment 4•13 years ago
|
||
Shelly, since you already working on this. assign to you. thanks
Assignee: nobody → slin
Comment 6•13 years ago
|
||
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.
Comment 7•13 years ago
|
||
Should we mark this P1 given it's new feature work?
Updated•13 years ago
|
Priority: -- → P1
Comment 8•13 years ago
|
||
Shelly, do you have any idea about the possible effort on this case? Thanks.
Comment 9•13 years ago
|
||
It looks like we only need to enable the support for AMR, and it's already done. Shelly also did the testing.
Updated•13 years ago
|
Whiteboard: [3/11~3/15]
Updated•13 years ago
|
Comment 10•13 years ago
|
||
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+ → -
| Assignee | ||
Comment 11•13 years ago
|
||
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)
| Assignee | ||
Comment 12•13 years ago
|
||
Add audio/amr to the supported decoder type of OMX, and to the list of external mimetype.
| Assignee | ||
Updated•13 years ago
|
Attachment #723781 -
Attachment is obsolete: true
| Assignee | ||
Comment 13•13 years ago
|
||
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)
| Assignee | ||
Comment 14•13 years ago
|
||
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 16•13 years ago
|
||
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-
| Assignee | ||
Comment 17•13 years ago
|
||
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+
| Assignee | ||
Comment 19•13 years ago
|
||
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.
| Assignee | ||
Comment 21•13 years ago
|
||
Thanks :roc, here is the fixed :)
Attachment #725977 -
Attachment is obsolete: true
Attachment #725977 -
Flags: review?(roc)
Attachment #725986 -
Flags: review?(roc)
Attachment #725986 -
Flags: review?(roc) → review+
| Assignee | ||
Comment 22•13 years ago
|
||
| Assignee | ||
Updated•13 years ago
|
Keywords: checkin-needed
Comment 23•13 years ago
|
||
Keywords: checkin-needed
Comment 24•13 years ago
|
||
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
| Assignee | ||
Comment 25•13 years ago
|
||
Carry r+.
Attachment #725986 -
Attachment is obsolete: true
Attachment #728024 -
Flags: review+
| Assignee | ||
Comment 26•13 years ago
|
||
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...)
| Assignee | ||
Updated•13 years ago
|
Keywords: checkin-needed
Comment 27•13 years ago
|
||
Keywords: checkin-needed
Comment 28•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → B2G C4 (2jan on)
| Assignee | ||
Updated•12 years ago
|
blocking-b2g: - → leo?
Comment 31•12 years ago
|
||
To change the status-b2g18 to affected, so the sheriff will scan it and help to uplift.
status-b2g18:
--- → affected
Comment 32•12 years ago
|
||
(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.
| Assignee | ||
Comment 33•12 years ago
|
||
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)
| Assignee | ||
Comment 34•12 years ago
|
||
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)|
| Assignee | ||
Comment 35•12 years ago
|
||
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.
Comment 37•12 years ago
|
||
(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)
Comment 38•12 years ago
|
||
status-b2g18-v1.0.0:
--- → wontfix
status-b2g18-v1.0.1:
--- → wontfix
status-firefox21:
--- → wontfix
status-firefox22:
--- → fixed
Updated•12 years ago
|
Flags: in-moztrap-
Comment 39•12 years ago
|
||
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.
| Assignee | ||
Comment 40•12 years ago
|
||
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.
| Assignee | ||
Updated•12 years ago
|
Attachment #747271 -
Flags: review?(roc)
You need to log in
before you can comment on or make changes to this bug.
Description
•