Use IsMediaMIMEType to refuse MIME types that cannot possibly be media-related.
MozReview-Commit-ID: JXhf1biL4L0
--HG--
extra : rebase_source : 130847e58e0a1b2cb510d7c62b6dea7180bf180a
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
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
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
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
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
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
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
The same reason as bug 1329897 P3.
MozReview-Commit-ID: AhyFnUmXoOr
--HG--
extra : rebase_source : 2121fcef9faa0838bda07ed3273d1b24c98ff342
extra : intermediate-source : 8822c00ab309a845e16aea97ea02c4640d4d9519
extra : source : 11ee1f3ac0009afc175fd813980501cd65ae5f9e
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
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
Note we remove the checks for mState.
MozReview-Commit-ID: 7uzjzjKDCIj
--HG--
extra : rebase_source : a3c18a977a96edf64b44598cd2244ea20d5f9363
extra : intermediate-source : 294a139aa91dcaaa2d3c2654cbae0fce5317fcbd
extra : source : 1ac775ae3fbb65146c28024e6c19d33b2dd55f66
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
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
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
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
States expect this event should override this function.
MozReview-Commit-ID: 8Y4ngn4X7MS
--HG--
extra : rebase_source : 705affda97d3ee919f560a76c3858fa3564bfbe4
extra : intermediate-source : 9139df5e241af72bc75544ae3d1df27a7cc514aa
extra : source : b7c803ea73a1b1af0ee40a64d7710c52186c3c25
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
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
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
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
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
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