mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 10:33:33 +00:00
Bug 1204407: P2. Remove no longer required MediaDataDemuxer APIs. r=cpearce
This commit is contained in:
parent
1de1d09411
commit
33e5945370
@ -59,16 +59,6 @@ MP3Demuxer::Init() {
|
||||
return InitPromise::CreateAndResolve(NS_OK, __func__);
|
||||
}
|
||||
|
||||
already_AddRefed<MediaDataDemuxer>
|
||||
MP3Demuxer::Clone() const {
|
||||
nsRefPtr<MP3Demuxer> demuxer = new MP3Demuxer(mSource);
|
||||
if (!demuxer->InitInternal()) {
|
||||
NS_WARNING("Couldn't recreate MP3Demuxer");
|
||||
return nullptr;
|
||||
}
|
||||
return demuxer.forget();
|
||||
}
|
||||
|
||||
bool
|
||||
MP3Demuxer::HasTrackType(TrackInfo::TrackType aType) const {
|
||||
return aType == TrackInfo::kAudioTrack;
|
||||
|
@ -19,7 +19,6 @@ public:
|
||||
// MediaDataDemuxer interface.
|
||||
explicit MP3Demuxer(MediaResource* aSource);
|
||||
nsRefPtr<InitPromise> Init() override;
|
||||
already_AddRefed<MediaDataDemuxer> Clone() const override;
|
||||
bool HasTrackType(TrackInfo::TrackType aType) const override;
|
||||
uint32_t GetNumberTracks(TrackInfo::TrackType aType) const override;
|
||||
already_AddRefed<MediaTrackDemuxer> GetTrackDemuxer(
|
||||
|
@ -51,19 +51,6 @@ public:
|
||||
// again to retry once more data has been received.
|
||||
virtual nsRefPtr<InitPromise> Init() = 0;
|
||||
|
||||
// MediaFormatReader ensures that calls to the MediaDataDemuxer are thread-safe.
|
||||
// This is done by having multiple demuxers, created with Clone(), one per
|
||||
// running thread.
|
||||
// However, should the MediaDataDemuxer object guaranteed to be thread-safe
|
||||
// such cloning is unecessary and only one demuxer will be used across
|
||||
// all threads.
|
||||
virtual bool IsThreadSafe() { return false; }
|
||||
|
||||
// Clone the demuxer and return a new initialized demuxer.
|
||||
// This can only be called once Init() has succeeded.
|
||||
// The new demuxer can be immediately use to retrieve the track demuxers.
|
||||
virtual already_AddRefed<MediaDataDemuxer> Clone() const = 0;
|
||||
|
||||
// Returns true if a aType track type is available.
|
||||
virtual bool HasTrackType(TrackInfo::TrackType aType) const = 0;
|
||||
|
||||
|
@ -102,22 +102,6 @@ MP4Demuxer::Init()
|
||||
return InitPromise::CreateAndResolve(NS_OK, __func__);
|
||||
}
|
||||
|
||||
already_AddRefed<MediaDataDemuxer>
|
||||
MP4Demuxer::Clone() const
|
||||
{
|
||||
nsRefPtr<MP4Demuxer> demuxer = new MP4Demuxer(mResource);
|
||||
demuxer->mInitData = mInitData;
|
||||
nsRefPtr<mp4_demuxer::BufferStream> bufferstream =
|
||||
new mp4_demuxer::BufferStream(mInitData);
|
||||
demuxer->mMetadata = MakeUnique<mp4_demuxer::MP4Metadata>(bufferstream);
|
||||
if (!mMetadata->GetNumberTracks(mozilla::TrackInfo::kAudioTrack) &&
|
||||
!mMetadata->GetNumberTracks(mozilla::TrackInfo::kVideoTrack)) {
|
||||
NS_WARNING("Couldn't recreate MP4Demuxer");
|
||||
return nullptr;
|
||||
}
|
||||
return demuxer.forget();
|
||||
}
|
||||
|
||||
bool
|
||||
MP4Demuxer::HasTrackType(TrackInfo::TrackType aType) const
|
||||
{
|
||||
|
@ -30,8 +30,6 @@ public:
|
||||
|
||||
virtual nsRefPtr<InitPromise> Init() override;
|
||||
|
||||
virtual already_AddRefed<MediaDataDemuxer> Clone() const override;
|
||||
|
||||
virtual bool HasTrackType(TrackInfo::TrackType aType) const override;
|
||||
|
||||
virtual uint32_t GetNumberTracks(TrackInfo::TrackType aType) const override;
|
||||
|
@ -29,14 +29,6 @@ public:
|
||||
|
||||
nsRefPtr<InitPromise> Init() override;
|
||||
|
||||
bool IsThreadSafe() override { return true; }
|
||||
|
||||
already_AddRefed<MediaDataDemuxer> Clone() const override
|
||||
{
|
||||
MOZ_CRASH("Shouldn't be called");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool HasTrackType(TrackInfo::TrackType aType) const override;
|
||||
|
||||
uint32_t GetNumberTracks(TrackInfo::TrackType aType) const override;
|
||||
|
@ -182,18 +182,6 @@ WebMDemuxer::InitBufferedState()
|
||||
mBufferedState = new WebMBufferedState;
|
||||
}
|
||||
|
||||
already_AddRefed<MediaDataDemuxer>
|
||||
WebMDemuxer::Clone() const
|
||||
{
|
||||
nsRefPtr<WebMDemuxer> demuxer = new WebMDemuxer(mResource.GetResource());
|
||||
demuxer->InitBufferedState();
|
||||
if (NS_FAILED(demuxer->ReadMetadata())) {
|
||||
NS_WARNING("Couldn't recreate WebMDemuxer");
|
||||
return nullptr;
|
||||
}
|
||||
return demuxer.forget();
|
||||
}
|
||||
|
||||
bool
|
||||
WebMDemuxer::HasTrackType(TrackInfo::TrackType aType) const
|
||||
{
|
||||
|
@ -80,8 +80,6 @@ public:
|
||||
|
||||
nsRefPtr<InitPromise> Init() override;
|
||||
|
||||
already_AddRefed<MediaDataDemuxer> Clone() const override;
|
||||
|
||||
bool HasTrackType(TrackInfo::TrackType aType) const override;
|
||||
|
||||
uint32_t GetNumberTracks(TrackInfo::TrackType aType) const override;
|
||||
|
Loading…
Reference in New Issue
Block a user