mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1214989. Part 2 - add MediaDecoderOwner to Clone() and overrides. r=gerald.
This commit is contained in:
parent
31039842e1
commit
78f4511dfc
@ -2758,7 +2758,7 @@ nsresult HTMLMediaElement::InitializeDecoderAsClone(MediaDecoder* aOriginal)
|
|||||||
MediaResource* originalResource = aOriginal->GetResource();
|
MediaResource* originalResource = aOriginal->GetResource();
|
||||||
if (!originalResource)
|
if (!originalResource)
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
nsRefPtr<MediaDecoder> decoder = aOriginal->Clone();
|
nsRefPtr<MediaDecoder> decoder = aOriginal->Clone(this);
|
||||||
if (!decoder)
|
if (!decoder)
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
|
@ -15,11 +15,11 @@
|
|||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
MediaDecoder*
|
MediaDecoder*
|
||||||
MP3Decoder::Clone() {
|
MP3Decoder::Clone(MediaDecoderOwner* aOwner) {
|
||||||
if (!IsEnabled()) {
|
if (!IsEnabled()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
return new MP3Decoder();
|
return new MP3Decoder(aOwner);
|
||||||
}
|
}
|
||||||
|
|
||||||
MediaDecoderStateMachine*
|
MediaDecoderStateMachine*
|
||||||
|
@ -14,7 +14,7 @@ class MP3Decoder : public MediaDecoder {
|
|||||||
public:
|
public:
|
||||||
// MediaDecoder interface.
|
// MediaDecoder interface.
|
||||||
explicit MP3Decoder(MediaDecoderOwner* aOwner) : MediaDecoder(aOwner) {}
|
explicit MP3Decoder(MediaDecoderOwner* aOwner) : MediaDecoder(aOwner) {}
|
||||||
MediaDecoder* Clone() override;
|
MediaDecoder* Clone(MediaDecoderOwner* aOwner) override;
|
||||||
MediaDecoderStateMachine* CreateStateMachine() override;
|
MediaDecoderStateMachine* CreateStateMachine() override;
|
||||||
|
|
||||||
// Returns true if the MP3 backend is preffed on, and we're running on a
|
// Returns true if the MP3 backend is preffed on, and we're running on a
|
||||||
|
@ -306,7 +306,7 @@ public:
|
|||||||
virtual void ResetConnectionState();
|
virtual void ResetConnectionState();
|
||||||
// Create a new decoder of the same type as this one.
|
// Create a new decoder of the same type as this one.
|
||||||
// Subclasses must implement this.
|
// Subclasses must implement this.
|
||||||
virtual MediaDecoder* Clone() = 0;
|
virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) = 0;
|
||||||
// Create a new state machine to run this decoder.
|
// Create a new state machine to run this decoder.
|
||||||
// Subclasses must implement this.
|
// Subclasses must implement this.
|
||||||
virtual MediaDecoderStateMachine* CreateStateMachine() = 0;
|
virtual MediaDecoderStateMachine* CreateStateMachine() = 0;
|
||||||
|
@ -22,7 +22,9 @@ public:
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual MediaDecoder* Clone() { return new AndroidMediaDecoder(mType); }
|
virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) {
|
||||||
|
return new AndroidMediaDecoder(aOwner, mType);
|
||||||
|
}
|
||||||
virtual MediaDecoderStateMachine* CreateStateMachine();
|
virtual MediaDecoderStateMachine* CreateStateMachine();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -15,9 +15,9 @@ AppleDecoder::AppleDecoder(MediaDecoderOwner* aOwner)
|
|||||||
}
|
}
|
||||||
|
|
||||||
MediaDecoder *
|
MediaDecoder *
|
||||||
AppleDecoder::Clone()
|
AppleDecoder::Clone(MediaDecoderOwner* aOwner)
|
||||||
{
|
{
|
||||||
return new AppleDecoder();
|
return new AppleDecoder(aOwner);
|
||||||
}
|
}
|
||||||
|
|
||||||
MediaDecoderStateMachine *
|
MediaDecoderStateMachine *
|
||||||
|
@ -14,7 +14,7 @@ class AppleDecoder : public MediaDecoder
|
|||||||
public:
|
public:
|
||||||
explicit AppleDecoder(MediaDecoderOwner* aOwner);
|
explicit AppleDecoder(MediaDecoderOwner* aOwner);
|
||||||
|
|
||||||
virtual MediaDecoder* Clone() override;
|
virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) override;
|
||||||
virtual MediaDecoderStateMachine* CreateStateMachine() override;
|
virtual MediaDecoderStateMachine* CreateStateMachine() override;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -19,11 +19,11 @@ public:
|
|||||||
explicit DirectShowDecoder(MediaDecoderOwner* aOwner);
|
explicit DirectShowDecoder(MediaDecoderOwner* aOwner);
|
||||||
virtual ~DirectShowDecoder();
|
virtual ~DirectShowDecoder();
|
||||||
|
|
||||||
MediaDecoder* Clone() override {
|
MediaDecoder* Clone(MediaDecoderOwner* aOwner) override {
|
||||||
if (!IsEnabled()) {
|
if (!IsEnabled()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
return new DirectShowDecoder();
|
return new DirectShowDecoder(aOwner);
|
||||||
}
|
}
|
||||||
|
|
||||||
MediaDecoderStateMachine* CreateStateMachine() override;
|
MediaDecoderStateMachine* CreateStateMachine() override;
|
||||||
|
@ -16,11 +16,11 @@ class MP4Decoder : public MediaDecoder
|
|||||||
public:
|
public:
|
||||||
explicit MP4Decoder(MediaDecoderOwner* aOwner);
|
explicit MP4Decoder(MediaDecoderOwner* aOwner);
|
||||||
|
|
||||||
virtual MediaDecoder* Clone() override {
|
virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) override {
|
||||||
if (!IsEnabled()) {
|
if (!IsEnabled()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
return new MP4Decoder();
|
return new MP4Decoder(aOwner);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual MediaDecoderStateMachine* CreateStateMachine() override;
|
virtual MediaDecoderStateMachine* CreateStateMachine() override;
|
||||||
|
@ -16,7 +16,9 @@ class GStreamerDecoder : public MediaDecoder
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit GStreamerDecoder(MediaDecoderOwner* aOwner) : MediaDecoder(aOwner) {}
|
explicit GStreamerDecoder(MediaDecoderOwner* aOwner) : MediaDecoder(aOwner) {}
|
||||||
virtual MediaDecoder* Clone() { return new GStreamerDecoder(); }
|
virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) {
|
||||||
|
return new GStreamerDecoder(aOwner);
|
||||||
|
}
|
||||||
virtual MediaDecoderStateMachine* CreateStateMachine();
|
virtual MediaDecoderStateMachine* CreateStateMachine();
|
||||||
static bool CanHandleMediaType(const nsACString& aMIMEType, const nsAString* aCodecs);
|
static bool CanHandleMediaType(const nsACString& aMIMEType, const nsAString* aCodecs);
|
||||||
};
|
};
|
||||||
|
@ -35,7 +35,7 @@ MediaSourceDecoder::MediaSourceDecoder(dom::HTMLMediaElement* aElement)
|
|||||||
}
|
}
|
||||||
|
|
||||||
MediaDecoder*
|
MediaDecoder*
|
||||||
MediaSourceDecoder::Clone()
|
MediaSourceDecoder::Clone(MediaDecoderOwner* aOwner)
|
||||||
{
|
{
|
||||||
// TODO: Sort out cloning.
|
// TODO: Sort out cloning.
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -36,7 +36,7 @@ class MediaSourceDecoder : public MediaDecoder
|
|||||||
public:
|
public:
|
||||||
explicit MediaSourceDecoder(dom::HTMLMediaElement* aElement);
|
explicit MediaSourceDecoder(dom::HTMLMediaElement* aElement);
|
||||||
|
|
||||||
virtual MediaDecoder* Clone() override;
|
virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) override;
|
||||||
virtual MediaDecoderStateMachine* CreateStateMachine() override;
|
virtual MediaDecoderStateMachine* CreateStateMachine() override;
|
||||||
virtual nsresult Load(nsIStreamListener**) override;
|
virtual nsresult Load(nsIStreamListener**) override;
|
||||||
virtual media::TimeIntervals GetSeekable() override;
|
virtual media::TimeIntervals GetSeekable() override;
|
||||||
|
@ -19,11 +19,11 @@ public:
|
|||||||
, mShutdownBit(false)
|
, mShutdownBit(false)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
virtual MediaDecoder* Clone() override {
|
virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) override {
|
||||||
if (!IsOggEnabled()) {
|
if (!IsOggEnabled()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
return new OggDecoder();
|
return new OggDecoder(aOwner);
|
||||||
}
|
}
|
||||||
virtual MediaDecoderStateMachine* CreateStateMachine() override;
|
virtual MediaDecoderStateMachine* CreateStateMachine() override;
|
||||||
|
|
||||||
|
@ -12,9 +12,9 @@
|
|||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
MediaDecoder*
|
MediaDecoder*
|
||||||
MediaCodecDecoder::Clone()
|
MediaCodecDecoder::Clone(MediaDecoderOwner* aOwner)
|
||||||
{
|
{
|
||||||
return new MediaCodecDecoder();
|
return new MediaCodecDecoder(aOwner);
|
||||||
}
|
}
|
||||||
|
|
||||||
MediaOmxCommonReader*
|
MediaOmxCommonReader*
|
||||||
|
@ -18,7 +18,7 @@ public:
|
|||||||
explicit MediaCodecDecoder(MediaDecoderOwner* aOwner)
|
explicit MediaCodecDecoder(MediaDecoderOwner* aOwner)
|
||||||
: MediaOmxCommonDecoder(aOwner) {}
|
: MediaOmxCommonDecoder(aOwner) {}
|
||||||
|
|
||||||
virtual MediaDecoder* Clone();
|
virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner);
|
||||||
|
|
||||||
virtual MediaOmxCommonReader* CreateReader();
|
virtual MediaOmxCommonReader* CreateReader();
|
||||||
|
|
||||||
|
@ -13,9 +13,9 @@ using namespace android;
|
|||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
MediaDecoder*
|
MediaDecoder*
|
||||||
MediaOmxDecoder::Clone()
|
MediaOmxDecoder::Clone(MediaDecoderOwner* aOwner)
|
||||||
{
|
{
|
||||||
return new MediaOmxDecoder();
|
return new MediaOmxDecoder(aOwner);
|
||||||
}
|
}
|
||||||
|
|
||||||
MediaOmxCommonReader*
|
MediaOmxCommonReader*
|
||||||
|
@ -15,7 +15,7 @@ class MediaOmxDecoder : public MediaOmxCommonDecoder
|
|||||||
public:
|
public:
|
||||||
explicit MediaOmxDecoder(MediaDecoderOwner* aOwner)
|
explicit MediaOmxDecoder(MediaDecoderOwner* aOwner)
|
||||||
: MediaOmxCommonDecoder(aOwner) {}
|
: MediaOmxCommonDecoder(aOwner) {}
|
||||||
virtual MediaDecoder* Clone();
|
virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner);
|
||||||
virtual MediaOmxCommonReader* CreateReader();
|
virtual MediaOmxCommonReader* CreateReader();
|
||||||
virtual MediaDecoderStateMachine* CreateStateMachineFromReader(MediaOmxCommonReader* aReader);
|
virtual MediaDecoderStateMachine* CreateStateMachineFromReader(MediaOmxCommonReader* aReader);
|
||||||
};
|
};
|
||||||
|
@ -13,9 +13,9 @@
|
|||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
MediaDecoder*
|
MediaDecoder*
|
||||||
RtspMediaCodecDecoder::Clone()
|
RtspMediaCodecDecoder::Clone(MediaDecoderOwner* aOwner)
|
||||||
{
|
{
|
||||||
return new RtspMediaCodecDecoder();
|
return new RtspMediaCodecDecoder(aOwner);
|
||||||
}
|
}
|
||||||
|
|
||||||
MediaOmxCommonReader*
|
MediaOmxCommonReader*
|
||||||
|
@ -17,7 +17,7 @@ public:
|
|||||||
explicit RtspMediaCodecDecoder(MediaDecoderOwner* aOwner)
|
explicit RtspMediaCodecDecoder(MediaDecoderOwner* aOwner)
|
||||||
: MediaOmxCommonDecoder(aOwner) {}
|
: MediaOmxCommonDecoder(aOwner) {}
|
||||||
|
|
||||||
virtual MediaDecoder* Clone() override;
|
virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) override;
|
||||||
|
|
||||||
virtual MediaOmxCommonReader* CreateReader() override;
|
virtual MediaOmxCommonReader* CreateReader() override;
|
||||||
|
|
||||||
|
@ -11,9 +11,9 @@
|
|||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
MediaDecoder* RtspOmxDecoder::Clone()
|
MediaDecoder* RtspOmxDecoder::Clone(MediaDecoderOwner* aOwner)
|
||||||
{
|
{
|
||||||
return new RtspOmxDecoder();
|
return new RtspOmxDecoder(aOwner);
|
||||||
}
|
}
|
||||||
|
|
||||||
MediaDecoderStateMachine*
|
MediaDecoderStateMachine*
|
||||||
|
@ -29,7 +29,7 @@ public:
|
|||||||
MOZ_COUNT_DTOR(RtspOmxDecoder);
|
MOZ_COUNT_DTOR(RtspOmxDecoder);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual MediaDecoder* Clone() override final;
|
virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) override final;
|
||||||
virtual MediaDecoderStateMachine* CreateStateMachine() override final;
|
virtual MediaDecoderStateMachine* CreateStateMachine() override final;
|
||||||
virtual void ChangeState(PlayState aState) override final;
|
virtual void ChangeState(PlayState aState) override final;
|
||||||
};
|
};
|
||||||
|
@ -13,11 +13,11 @@ class RawDecoder : public MediaDecoder
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit RawDecoder(MediaDecoderOwner* aOwner) : MediaDecoder(aOwner) {}
|
explicit RawDecoder(MediaDecoderOwner* aOwner) : MediaDecoder(aOwner) {}
|
||||||
virtual MediaDecoder* Clone() {
|
virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) {
|
||||||
if (!IsRawEnabled()) {
|
if (!IsRawEnabled()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
return new RawDecoder();
|
return new RawDecoder(aOwner);
|
||||||
}
|
}
|
||||||
virtual MediaDecoderStateMachine* CreateStateMachine();
|
virtual MediaDecoderStateMachine* CreateStateMachine();
|
||||||
};
|
};
|
||||||
|
@ -25,11 +25,11 @@ class WaveDecoder : public MediaDecoder
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit WaveDecoder(MediaDecoderOwner* aOwner) : MediaDecoder(aOwner) {}
|
explicit WaveDecoder(MediaDecoderOwner* aOwner) : MediaDecoder(aOwner) {}
|
||||||
virtual MediaDecoder* Clone() {
|
virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) {
|
||||||
if (!IsWaveEnabled()) {
|
if (!IsWaveEnabled()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
return new WaveDecoder();
|
return new WaveDecoder(aOwner);
|
||||||
}
|
}
|
||||||
virtual MediaDecoderStateMachine* CreateStateMachine();
|
virtual MediaDecoderStateMachine* CreateStateMachine();
|
||||||
};
|
};
|
||||||
|
@ -14,11 +14,11 @@ class WebMDecoder : public MediaDecoder
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit WebMDecoder(MediaDecoderOwner* aOwner) : MediaDecoder(aOwner) {}
|
explicit WebMDecoder(MediaDecoderOwner* aOwner) : MediaDecoder(aOwner) {}
|
||||||
virtual MediaDecoder* Clone() {
|
virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) {
|
||||||
if (!IsWebMEnabled()) {
|
if (!IsWebMEnabled()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
return new WebMDecoder();
|
return new WebMDecoder(aOwner);
|
||||||
}
|
}
|
||||||
virtual MediaDecoderStateMachine* CreateStateMachine();
|
virtual MediaDecoderStateMachine* CreateStateMachine();
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user