Bug 1038031 - Add --disable-eme flag - r=cpearce,gps,bz

This commit is contained in:
Edwin Flores 2014-07-17 08:54:00 +12:00
parent e53a1ff7c3
commit 154b202425
6 changed files with 46 additions and 10 deletions

View File

@ -3867,6 +3867,7 @@ MOZ_GSTREAMER=
MOZ_DIRECTSHOW=
MOZ_WMF=
MOZ_FMP4=
MOZ_EME=1
MOZ_FFMPEG=
MOZ_WEBRTC=1
MOZ_PEERCONNECTION=
@ -5246,6 +5247,18 @@ if test -n "$MOZ_FMP4"; then
AC_DEFINE(MOZ_FMP4)
fi;
dnl ========================================================
dnl = EME support
dnl ========================================================
MOZ_ARG_DISABLE_BOOL(eme,
[ --disable-eme Disable support for Encrypted Media Extensions],
MOZ_EME=,
MOZ_EME=1)
if test -n "$MOZ_EME"; then
AC_DEFINE(MOZ_EME)
fi;
dnl ========================================================
dnl = Enable media plugin support
@ -8825,6 +8838,7 @@ AC_SUBST(MOZ_WEBM)
AC_SUBST(MOZ_WMF)
AC_SUBST(MOZ_FFMPEG)
AC_SUBST(MOZ_FMP4)
AC_SUBST(MOZ_EME)
AC_SUBST(MOZ_DIRECTSHOW)
AC_SUBST(MOZ_MEDIA_PLUGINS)
AC_SUBST(MOZ_APPLEMEDIA)

View File

@ -18,9 +18,12 @@
#include "nsIAudioChannelAgent.h"
#include "mozilla/Attributes.h"
#include "mozilla/dom/AudioChannelBinding.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/TextTrackManager.h"
#include "MediaDecoder.h"
#ifdef MOZ_EME
#include "mozilla/dom/MediaKeys.h"
#endif
// Something on Linux #defines None, which is an entry in the
// MediaWaitingFor enum, so undef it here before including the binfing,
@ -521,6 +524,7 @@ public:
// XPCOM MozPreservesPitch() is OK
#ifdef MOZ_EME
MediaKeys* GetMediaKeys() const;
already_AddRefed<Promise> SetMediaKeys(MediaKeys* mediaKeys,
@ -536,6 +540,7 @@ public:
bool IsEventAttributeName(nsIAtom* aName) MOZ_OVERRIDE;
#endif // MOZ_EME
bool MozAutoplayEnabled() const
{
@ -1076,8 +1081,10 @@ protected:
// Range of time played.
nsRefPtr<TimeRanges> mPlayed;
#ifdef MOZ_EME
// Encrypted Media Extension media keys.
nsRefPtr<MediaKeys> mMediaKeys;
#endif
// Stores the time at the start of the current 'played' range.
double mCurrentPlayRangeStart;

View File

@ -10,8 +10,10 @@
#include "mozilla/dom/ElementInlines.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/MathAlgorithms.h"
#include "mozilla/dom/MediaKeyNeededEvent.h"
#include "mozilla/AsyncEventDispatcher.h"
#ifdef MOZ_EME
#include "mozilla/dom/MediaKeyNeededEvent.h"
#endif
#include "base/basictypes.h"
#include "nsIDOMHTMLMediaElement.h"
@ -430,7 +432,9 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(HTMLMediaElement, nsGenericHTM
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTextTrackManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAudioTrackList)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mVideoTrackList)
#ifdef MOZ_EME
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMediaKeys)
#endif
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLMediaElement, nsGenericHTMLElement)
@ -453,7 +457,9 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLMediaElement, nsGenericHTMLE
NS_IMPL_CYCLE_COLLECTION_UNLINK(mTextTrackManager)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mAudioTrackList)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mVideoTrackList)
#ifdef MOZ_EME
NS_IMPL_CYCLE_COLLECTION_UNLINK(mMediaKeys)
#endif
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(HTMLMediaElement)
@ -3943,6 +3949,7 @@ NS_IMETHODIMP HTMLMediaElement::CanPlayChanged(int32_t canPlay)
return NS_OK;
}
#ifdef MOZ_EME
MediaKeys*
HTMLMediaElement::GetMediaKeys() const
{
@ -4008,6 +4015,7 @@ HTMLMediaElement::IsEventAttributeName(nsIAtom* aName)
return aName == nsGkAtoms::onneedkey ||
nsGenericHTMLElement::IsEventAttributeName(aName);
}
#endif // MOZ_EME
NS_IMETHODIMP HTMLMediaElement::WindowVolumeChanged()
{

View File

@ -50,7 +50,8 @@ if CONFIG['MOZ_OMX_DECODER']:
PARALLEL_DIRS += ['webspeech']
PARALLEL_DIRS += ['eme']
if CONFIG['MOZ_EME']:
PARALLEL_DIRS += ['eme']
TEST_DIRS += [
'test',

View File

@ -144,18 +144,20 @@ enum MediaWaitingFor {
"key"
};
#ifdef MOZ_EME
// Encrypted Media Extensions
partial interface HTMLMediaElement {
[Pref="media.eme.enabled"]
readonly attribute MediaKeys? mediaKeys;
// Promise<any>
[Pref="media.eme.enabled", Throws, NewObject]
Promise setMediaKeys(MediaKeys? mediaKeys);
[Pref="media.eme.enabled"]
attribute EventHandler onneedkey;
[Pref="media.eme.enabled"]
readonly attribute MediaWaitingFor waitingFor;
};
#endif

View File

@ -10,6 +10,7 @@ GENERATED_WEBIDL_FILES = [
PREPROCESSED_WEBIDL_FILES = [
'Crypto.webidl',
'HTMLMediaElement.webidl',
'Navigator.webidl',
'Window.webidl',
]
@ -169,7 +170,6 @@ WEBIDL_FILES = [
'HTMLLIElement.webidl',
'HTMLLinkElement.webidl',
'HTMLMapElement.webidl',
'HTMLMediaElement.webidl',
'HTMLMenuElement.webidl',
'HTMLMenuItemElement.webidl',
'HTMLMetaElement.webidl',
@ -237,11 +237,6 @@ WEBIDL_FILES = [
'Location.webidl',
'MediaElementAudioSourceNode.webidl',
'MediaError.webidl',
'MediaKeyError.webidl',
'MediaKeyMessageEvent.webidl',
'MediaKeyNeededEvent.webidl',
'MediaKeys.webidl',
'MediaKeySession.webidl',
'MediaList.webidl',
'MediaQueryList.webidl',
'MediaRecorder.webidl',
@ -731,3 +726,12 @@ if CONFIG['MOZ_BUILD_APP'] in ['browser', 'mobile/android', 'xulrunner']:
WEBIDL_FILES += [
'External.webidl',
]
if CONFIG['MOZ_EME']:
WEBIDL_FILES += [
'MediaKeyError.webidl',
'MediaKeyMessageEvent.webidl',
'MediaKeyNeededEvent.webidl',
'MediaKeys.webidl',
'MediaKeySession.webidl',
]