Commit Graph

9442 Commits

Author SHA1 Message Date
Gerald Squelart
814db309fc Bug 1329568 - Restrict MediaMIMEType to IsMediaMIMEType-checked strings - r=jya
Use IsMediaMIMEType to refuse MIME types that cannot possibly be media-related.

MozReview-Commit-ID: JXhf1biL4L0

--HG--
extra : rebase_source : 130847e58e0a1b2cb510d7c62b6dea7180bf180a
2017-01-03 22:07:11 +11:00
Gerald Squelart
8558ce5e5e Bug 1329568 - Simple IsMediaMIMEType checker for strings - r=jya
Inside dom/media, we really only deal with audio and video MIME types.
IsMediaMIMEType will help check for that.

Note that 'application' is an acceptable MIME major type, as some A/V contents
do use it! E.g.: "application/ogg".

IsMediaMIMEType is constexpr to allow its use in static_assert's, so we will be
able to verify string literals at compile time.

MozReview-Commit-ID: InBicRRUeiP

--HG--
extra : rebase_source : f10355e7570b163473cee2548c04c6be11d9120f
2017-01-01 08:46:34 +11:00
Gerald Squelart
fe26cb66da Bug 1329568 - MediaMIMEType - r=jya
MediaMIMEType factors out the main MIME "type/subtype" string from
MediaExtendedMIMEType, as it is often useful to deal with just that part.
Like MediaContentType and MediaExtendedMIMEType, MediaMIMEType is always valid
once constructed.

MozReview-Commit-ID: 5Urlk6OLo5q

--HG--
extra : rebase_source : c46b480b9fc63eab9170b052c7f9ea9b7bbd048e
2016-12-01 16:57:31 +11:00
Gerald Squelart
d6f0cf3f9c Bug 1329568 - MediaExtendedMIMEType - r=jya
This patch factors out all data handling of MIME strings from MediaContentType
to MediaExtendedMIMEType.

MediaExtendedMIMEType is pretty much a copy of the old MediaContentType, as the
functionality was fine (but will be modified in upcoming patches).
MediaContentType then just delegates the work to its embedded
MediaExtendedMIMEType field.
The main difference is that the default constructor and Populate() method have
been replaced with a single constructor that takes all the arguments at once.

MozReview-Commit-ID: GBAgPDT2DUW

--HG--
rename : dom/media/MediaContentType.cpp => dom/media/MediaMIMETypes.cpp
rename : dom/media/MediaContentType.h => dom/media/MediaMIMETypes.h
extra : rebase_source : cefaeeb2a81b60c575e350cc8399af038a021dc2
2016-12-01 13:05:45 +11:00
Gerald Squelart
5945087c01 Bug 1329568 - Add missing #include in MediaStreamListener.h - r=jya
This is required because the next patch adds new files, which changes the
unified-build order and exposes error due to this missing #include.

MozReview-Commit-ID: 3pmqNK1B2bR

--HG--
extra : rebase_source : 1ff1baa3758ef709c78d83548f8a2727c4fefaf6
2016-11-28 09:47:46 +11:00
Xidorn Quan
a8e64a94e1 Bug 1298756 - Use uint8_t/uint16_t as underlying type for enums from webidl. r=bz
MozReview-Commit-ID: 3uS9s5ZrPFd

--HG--
extra : rebase_source : ff64b4468ee99ba08fd8638298a27711b7fb6393
2017-01-12 12:23:37 +11:00
Gerald Squelart
cea9ab4dfb Bug 1329564 - StringListRange::begin/end() can be const - r=jya
The StringListRange iterator does not modify the list, and cannot be used to
modify the list, so we can make the begin&end functions const.

MozReview-Commit-ID: 4uNf6CWQ767

--HG--
extra : rebase_source : e4992a8c7e6b686004c90a335194617d2f77ca7b
2016-12-16 19:03:20 +11:00
Gerald Squelart
c0cf767767 Bug 1329564 - Option to process empty items in StringListRange - r=jya
By default StringListRange skips empty items.
Two new template options allow handling empty items:
- ProcessEmptyItems: Process all, *except* if string is empty.
- ProcessAll: Process all, including 1 empty item in an empty string.

MozReview-Commit-ID: WNRHU5iCHt

--HG--
extra : rebase_source : 994bf1364a705c8280473635a2a6a685d267ec44
2016-11-28 22:45:58 +11:00
Michelangelo De Simone
0b3a927918 Bug 1313155 - Remove dom/settings and related code. r=Ehsan
MozReview-Commit-ID: Gi7frPFQ6yW

--HG--
extra : rebase_source : 401a8a202b1d8ebfd719d460bff96c9280062ded
2016-12-29 11:26:49 -08:00
Gerald Squelart
cd181bc396 Bug 1329561 - MediaContentType is always valid - r=jya
MediaContentType can only be created through MakeMediaContentType(), which
returns a Maybe<MediaContentType>.
If the return value is Nothing, parsing failed.
Otherwise the contained MediaContentType object is guaranteed to be valid;
E.g., GetMIMEType() will always return a non-empty string.

Note that this interface will change a lot in the following bugs&patches, so
please don't worry about the 'Get' in the never-failing GetMIMEType(), it will
be gone soon!

MozReview-Commit-ID: IjGKkQ6RVd4

--HG--
extra : rebase_source : 5254af80dec0beb05da49f68c12fecc28edd725e
2016-12-01 12:56:11 +11:00
Jean-Yves Avenard
a9ce3fa61d Bug 1328038: Refuse to play High 4:4:4 Predictive Profile. r=JamesCheng
It is not supported by Windows WMF.

MozReview-Commit-ID: 2OyjC0qGwD4

--HG--
extra : rebase_source : 0ffe6595d94aefd0a3d340f382fe9319bcc8024f
2017-01-03 06:58:09 +11:00
JW Wang
9fd85dbe58 Bug 1330254. Part 4 - let Handle{Audio,Video}Canceled and Handle{Audio,Video}Waited call Request{Audio,Video}Data instead. r=kikuo
The same reason as bug 1329897 P3.

MozReview-Commit-ID: AhyFnUmXoOr

--HG--
extra : rebase_source : 2121fcef9faa0838bda07ed3273d1b24c98ff342
extra : intermediate-source : 8822c00ab309a845e16aea97ea02c4640d4d9519
extra : source : 11ee1f3ac0009afc175fd813980501cd65ae5f9e
2017-01-09 22:25:20 +08:00
JW Wang
a1d21f679f Bug 1330254. Part 3 - remove some checks from NeedToSkipToNextKeyframe(). r=kikuo
1. we assert mSentFirstFrameLoadedEvent in DecodingState::Enter()
2. NeedToSkipToNextKeyframe() is called by EnsureVideoDecodeTaskQueued() when IsVideoDecoding() is true.

MozReview-Commit-ID: O6rkCBVmNu

--HG--
extra : rebase_source : 54ad2ddbf0c089cf7c493f7a9c5420bbbb3b5640
extra : intermediate-source : 3158eff8d06e40e3297b94f828dd40487f6e788b
extra : source : 6d92368a8f6f847b3a5b78a4072fd031383ead0e
2017-01-09 22:17:21 +08:00
JW Wang
43dbba6553 Bug 1330254. Part 2 - move NeedToSkipToNextKeyframe() into DecodingState and remove some checks for mState. r=kikuo
MozReview-Commit-ID: FTsXX04rk2p

--HG--
extra : rebase_source : 7bac055236795feeeabe710d214d5291ee2011a6
extra : intermediate-source : 9362d3b1cf3fd54b749e8d4c7d9f952d5718ddeb
extra : source : a645f33d99ae794eaf85fe942755131bf945be52
2017-01-09 21:39:22 +08:00
JW Wang
a1b72a6467 Bug 1330254. Part 1 - move MDSM::Ensure{Audio,Video}DecodeTaskQueued into DecodingState. r=kikuo
MozReview-Commit-ID: 9xPNQ9E7R3E

--HG--
extra : rebase_source : b4b329cafb223b1af3e116d6605ef1e4dcefc31d
extra : intermediate-source : 619564872603b357b395b2ff8e8a6f7f0fb80d62
extra : source : 77eb9d0c761c0441f2f73d5eb4be69382f7d02ec
2017-01-09 21:11:01 +08:00
Carsten "Tomcat" Book
088f1dc213 Merge mozilla-central to autoland 2017-01-12 10:39:04 +01:00
Carsten "Tomcat" Book
3ad97e202a merge mozilla-inbound to mozilla-central a=merge 2017-01-12 10:14:43 +01:00
Phil Ringnalda
e3c15e2b7e Backed out changeset f69ae549623a (bug 1321198) for being a totally unacceptable thing to have landed on an integration branch
--HG--
extra : rebase_source : 010e42975a95d521188f61abff9227569d98995c
2017-01-11 21:41:57 -08:00
Ryan VanderMeulen
e8f15d975e Backed out changeset 94e48b834d82 (bug 1329386) for bustage on a CLOSED TREE. 2017-01-11 21:49:18 -05:00
Matt Woodrow
fd9309fe71 Bug 1329386 - Fallback to WMF decoding if the OOP decoder fails. r=jya 2017-01-12 15:35:10 +13:00
Matt Woodrow
4e6b9e51c7 Bug 1329305 - Don't wait on readback task if dispatching it failed. r=dvander 2017-01-12 15:33:25 +13:00
Jan Beich
3b398e68ed Bug 1330378 - Add missing header after bug 1329891. r=jwwang
MozReview-Commit-ID: AcOqT3fVuUA

--HG--
extra : rebase_source : 61dabdff9bfcc1fcda0b49e73532cd705dcc4437
2017-01-11 18:19:18 +00:00
Kilik Kuo
2873d75a62 Bug 1316573 - Reset the information in EncryptionInfo to make MediaElement reusable from encrypted content to plain content. r=jya
MozReview-Commit-ID: 4OU0sb2OSzi

--HG--
extra : rebase_source : c18f76229bc2cfde79dc114ff5bc892a973a1ae2
2017-01-12 11:33:55 +08:00
Carsten "Tomcat" Book
a712d69adb merge mozilla-inbound to mozilla-central a=merge 2017-01-11 16:23:39 +01:00
JW Wang
0342dec38e Bug 1329897. Part 4 - inline Ensure{Audio,Video}DecodeTaskQueued for DispatchDecodeTasksIfNeeded is the only caller. r=kaku
MozReview-Commit-ID: CrldEKxY9Qg

--HG--
extra : rebase_source : 03df3e0378213e8675b9c72dbe22fd544c4ac96e
extra : intermediate-source : c84e8a74f5907030b8d134d7f577925948a86cfc
extra : source : 9f2b276446af127328da3aaf7abbc7846ec8fbb6
2017-01-09 20:37:06 +08:00
JW Wang
e1c0f361aa Bug 1329897. Part 3 - call Request{Audio,Video}Data instead. r=kaku
For HandleAudioCanceled():
1. IsRequestingAudioData() is false because mAudioDataRequest is completed in MDSM::RequestAudioData().
2. IsWaitingAudioData() is false because data promsie and wait promise are mutually exclusive.
3. IsAudioDecoding() is true because we wouldn't have requested audio data otherwise.

Likewise, we can prove EnsureAudioDecodeTaskQueued() can be reduced to mMaster->RequestAudioData()
in HandleAudioWaited.

MozReview-Commit-ID: 1i63IMfZaUh

--HG--
extra : rebase_source : ac389a7ccc74d969ecfc5f5f622c1c90e2d9b118
extra : intermediate-source : 50bb6d229443be0c410daf7c9553e84cd21fd929
extra : source : f4c3f02f3741c49eed38c2aaab5c872d18fb74ff
2017-01-09 20:27:36 +08:00
JW Wang
59e78145eb Bug 1329897. Part 2 - we don't want to skip to next key frames when buffering. r=kaku
MozReview-Commit-ID: 6Ln73FOVovs

--HG--
extra : rebase_source : 2387c92ae79997cd52cd374185ee2a94707deddc
extra : intermediate-source : 252125fb5a79f2e4a91e5af8b3eb51afee7a2cbf
extra : source : cd86e5a1440aa31e6885727f076e4e1e014debe9
2017-01-09 20:14:01 +08:00
JW Wang
63a0e6a39f Bug 1329897. Part 1 - copy Ensure{Audio,Video}DecodeTaskQueued into BufferingState. r=kaku
Note we remove the checks for mState.

MozReview-Commit-ID: 7uzjzjKDCIj

--HG--
extra : rebase_source : a3c18a977a96edf64b44598cd2244ea20d5f9363
extra : intermediate-source : 294a139aa91dcaaa2d3c2654cbae0fce5317fcbd
extra : source : 1ac775ae3fbb65146c28024e6c19d33b2dd55f66
2017-01-09 20:12:00 +08:00
JW Wang
a7b9a8665e Bug 1329891. Part 6 - default HandleWaitingFor{Audio,Video} to crash. r=kikuo
States that expect this event should override the function.

MozReview-Commit-ID: AmqktrDyVH5

--HG--
extra : rebase_source : 610dec3def2944c6234fd18cf71d9ee02998ad4d
extra : intermediate-source : 28ed7fa9991588b4ba131856cab0ff239f0b24e5
extra : source : 6e5d3a1d32985b6eba449f76e99538b0589bd200
2017-01-09 19:43:55 +08:00
JW Wang
9357fc0732 Bug 1329891. Part 5 - default HandleEndOf{Audio,Video} to crash. r=kikuo
States that expect this event should override the function.

MozReview-Commit-ID: 5Zhcu1m2MMm

--HG--
extra : rebase_source : 4462e34f5c063fdfc201f0f27e2caa8ba8d2fdc2
extra : intermediate-source : a91db7dd4a3d832f8c7b32ac87f8a8d5e518bec3
extra : source : 4499e663ce6821b98057454c8d6f06fe2cb762e0
2017-01-09 19:38:10 +08:00
JW Wang
fedda3a0b4 Bug 1329891. Part 4 - remove StateObject::HandleNotWaited(). r=kikuo
If the wait promise is rejected, we probably won't be able to finish
decoding after seeking. So we should just raise an error immediately.

MozReview-Commit-ID: GKXo9ZooBfV

--HG--
extra : rebase_source : 257a2724d1d2f3266e17b2de3f7d80fa385a2782
extra : intermediate-source : 150ce8e05dc887b7ed2b71cdc5ab77fb117775d2
extra : source : 6ff0dea0afabd57ea53ea3571020cdea3d4b0eca
2017-01-09 19:34:12 +08:00
JW Wang
c5599e5087 Bug 1329891. Part 3 - default Handle{Audio,Video}Waited to crash. r=kikuo
States that expect this event should override the function.

MozReview-Commit-ID: IjmR7F1UOiU

--HG--
extra : rebase_source : a83f4a96838e7358df8d0579163002ade53b5cc7
extra : intermediate-source : 2db95ef2473440ad2ec9130cf24f959291b18bef
extra : source : 78ae9269f4f09986a14e498843a7638f81dbc440
2017-01-09 15:53:12 +08:00
JW Wang
703766cdd0 Bug 1329891. Part 2 - default Handle{Audio,Video}Decoded to crash. r=kikuo
States expect this event should override this function.

MozReview-Commit-ID: 8Y4ngn4X7MS

--HG--
extra : rebase_source : 705affda97d3ee919f560a76c3858fa3564bfbe4
extra : intermediate-source : 9139df5e241af72bc75544ae3d1df27a7cc514aa
extra : source : b7c803ea73a1b1af0ee40a64d7710c52186c3c25
2017-01-09 15:48:00 +08:00
JW Wang
982fb8390e Bug 1329891. Part 1 - default Handle{Audio,Video}Canceled() to crash. r=kikuo
1. States (DecodeMetadataState and WaitForCDMState) happen before
DecodingFirstFrameState should never receive this event because they don't
decode at all.
2. DormantState and ShutdownState shouldn't receive this event because
they call ResetDecode() in the entry action.
3. CompletedState should never receive this event because it happens after
HandleEndOf{Audio,Video} which happens before Handle{Audio,Video}Canceled.

MozReview-Commit-ID: LdwpWlFHtRp

--HG--
extra : rebase_source : d48b8c7b2347fa745de006fcd1aff640cb474aa1
extra : intermediate-source : 981305f87ff796060666227cf89a23b51e607b54
extra : source : ee5e78f761568bea438c51b9e70eef9b83e14626
2017-01-09 15:44:18 +08:00
Nicholas Nethercote
949658eb73 Bug 1329857 - Remove NS_METHOD and NS_CALLBACK. r=froydnj.
Bug 1295053 removed most uses of NS_METHOD and NS_CALLBACK, but one use was
unintentionally left behind (in the XPIDL parser) and another has since crept
in (in MediaDrmCDMProxy.h).

So this patch removes NS_METHOD and NS_CALLBACK. NS_METHOD_(nsresult) and
NS_CALLBACK_(nsresult, T) can still be used for the same purpose, but those
alternatives are less likely to be used unintentionally.

--HG--
extra : rebase_source : a50fc7b2a64a36d1ca9beda81bc0edb8f2ec1934
2017-01-10 14:08:43 +11:00
Wes Kocher
0b29e777da Merge m-c to inbound, a=merge
MozReview-Commit-ID: 6eBJRasdMck
2017-01-10 18:36:19 -08:00
Andrea Marchesini
2abf88ce1f Bug 1329744 - AudioBuffer ctor updated, r=padenot 2017-01-10 21:30:28 +00:00
Carsten "Tomcat" Book
89882dc5f4 merge mozilla-inbound to mozilla-central a=merge 2017-01-10 12:11:31 +01:00
Wes Kocher
105aea2522 Merge m-c to inbound a=merge
MozReview-Commit-ID: G24aq5fbYNd
2017-01-09 16:44:58 -08:00
Geoff Brown
4499383617 Bug 1326005 - Skip test_peerConnection_renderAfterRenegotiation on android emulator, for frequent timeouts; r=me 2017-01-09 16:15:11 -07:00
Gerald Squelart
1cc4e2c254 Bug 1329319 - Allow NewRunnableMethod to method of a non-refcounted base class - r=froydnj
This is done by storing the object pointer based on the exact pointee type,
instead of as hinted by the method-pointer, which could be a non-refcounted
base class.

The stored pointer type is statically-checked to be derived from (or the same
as) the class type from the method-pointer, to prevent misuses.

One change had to be done in TrackBuffersManager, as it was passing another
type and relying on implicit pointer conversions. A simple `.get()` to pass
the raw pointer type (to be stored in a RefPtr) fixed that one issue.

MozReview-Commit-ID: 4kH0XdjB5Rk

--HG--
extra : rebase_source : 40ad68820cfce469ecda272f430062f05dfcd09f
2017-01-10 10:49:08 +11:00
Carsten "Tomcat" Book
47628ca590 Merge mozilla-central to autoland 2017-01-10 12:24:10 +01:00
Alastor Wu
3bfd999bfd Bug 1323703 - implement a method to create DXVA2 decoder. r=mattwoodrow
When we want to decode with DXVA2 aPI directly instead of using it by MFT, we need to take responsibility for
creating a decoder and handle the related decoding operations by ourself. So implement a method to create and
hold a ref to DXVA2 decoder for DXVA2Manager.

MozReview-Commit-ID: 4EyrsjzEyYK

--HG--
extra : rebase_source : 6719bfe15243395711984d66919baca2bb74699e
2016-12-15 18:26:17 +08:00
JW Wang
063d3eaeb0 Bug 1329110. Part 7 - remove StateObject::HandleEndOfStream(). r=kaku
The same reason as P6. We would like to avoid virtual functions calls
inside a virtual function.

MozReview-Commit-ID: EYCk6tKPYSs

--HG--
extra : rebase_source : 8482799473e4cf856238b9fa7897e432b4e3a674
extra : source : 17769cff12ccc2157adc91c4fce7e4030f303b00
2017-01-09 13:18:37 +08:00
JW Wang
ce97bad770 Bug 1329110. Part 6 - remove StateObject::HandleWaitingForData(). r=kaku
Since DecodingState is the only one that overrides the function, we will let it
just override HandleWaitingFor{Audio,Video}. We also reduce the code complexity
because it is hard to trace the code when one virtual function calls another
virtual function.

MozReview-Commit-ID: AdLXpDgvOyx

--HG--
extra : rebase_source : a8c2aef15537044d904f576976e08264524c26e4
extra : source : 60c230cff746f91653922223dc1f56e48c0d6120
2017-01-09 13:06:55 +08:00
JW Wang
b338772d2a Bug 1329110. Part 5 - split Split StateObject::HandleVideoNotDecoded into small functions. r=kaku
MozReview-Commit-ID: Bfyekr4I6OX

--HG--
extra : rebase_source : 43579faa96eba1e2fae2db98a7336aa928006661
extra : source : ea122d8b79c7cb87ec3671cc849d1358cf97976d
2017-01-09 12:59:32 +08:00
JW Wang
c981850d84 Bug 1329110. Part 4 - remove StateObject::HandleAudioNotDecoded(). r=kaku
MozReview-Commit-ID: 53iQ46klPMr

--HG--
extra : rebase_source : 279e78eacfb63a94b729c19b9f4473a6999c1e11
extra : source : adac40b710796c1ec9b9af420cade911bff3cc48
2017-01-09 12:45:43 +08:00
JW Wang
5bcdb2f65e Bug 1329110. Part 3 - add HandleEndOfAudio(). r=kaku
MozReview-Commit-ID: KGiWU8t79pv

--HG--
extra : rebase_source : 3809783134481a31135776a0bf0d5218afff6ba8
extra : intermediate-source : 4396f620afc3752a06005f79ed4721fa8ab2b584
extra : source : e12ce512f9153bf263150eeab3717671a2a01543
2017-01-06 17:54:59 +08:00
JW Wang
49a2f5c842 Bug 1329110. Part 2 - add HandleAudioCanceled(). r=kaku
MozReview-Commit-ID: IlzcucZOHpo

--HG--
extra : rebase_source : 7ee390235f6813117c7400bcbec13b376e7ef72a
extra : intermediate-source : 4ac81f01d3804c3e41b18ce3dcb5f19ab9cda69d
extra : source : 48a4f61f58bca7e48ac970494f0749417d8d5c4e
2017-01-06 17:49:11 +08:00
JW Wang
849a835855 Bug 1329110. Part 1 - add HandleWaitingForAudio(). r=kaku
MozReview-Commit-ID: B2ElMMYKt7m

--HG--
extra : rebase_source : da07871951b787e8c101a490ea78107e11ad80e8
extra : intermediate-source : da16ca5f7b522b191b183a4923722b3e4141117f
extra : source : 558d053ca2f80d9ed52bb72d2f822ec2ae36dfb6
2017-01-06 17:43:05 +08:00