MediaPlayerPrivateGStreamerMSE.h [plain text]
#pragma once
#if ENABLE(VIDEO) && USE(GSTREAMER) && ENABLE(MEDIA_SOURCE)
#include "GStreamerCommon.h"
#include "MediaPlayerPrivateGStreamer.h"
#include "MediaSample.h"
#include "MediaSourcePrivateGStreamer.h"
#include "WebKitMediaSourceGStreamer.h"
namespace WebCore {
class AppendPipeline;
class PlaybackPipeline;
class MediaPlayerPrivateGStreamerMSE : public MediaPlayerPrivateGStreamer {
WTF_MAKE_NONCOPYABLE(MediaPlayerPrivateGStreamerMSE); WTF_MAKE_FAST_ALLOCATED;
public:
explicit MediaPlayerPrivateGStreamerMSE(MediaPlayer*);
virtual ~MediaPlayerPrivateGStreamerMSE();
static void registerMediaEngine(MediaEngineRegistrar);
void load(const String&) override;
void load(const String&, MediaSourcePrivateClient*) override;
void updateDownloadBufferingFlag() override { };
MediaTime currentMediaTime() const override;
void pause() override;
bool seeking() const override;
void seek(const MediaTime&) override;
void configurePlaySink() override;
bool changePipelineState(GstState) override;
void durationChanged() override;
MediaTime durationMediaTime() const override;
std::unique_ptr<PlatformTimeRanges> buffered() const override;
MediaTime maxMediaTimeSeekable() const override;
void sourceSetup(GstElement*) override;
void setReadyState(MediaPlayer::ReadyState);
void waitForSeekCompleted();
void seekCompleted();
MediaSourcePrivateClient* mediaSourcePrivateClient() { return m_mediaSource.get(); }
void markEndOfStream(MediaSourcePrivate::EndOfStreamStatus);
void trackDetected(AppendPipeline&, RefPtr<WebCore::TrackPrivateBase>, bool firstTrackDetected);
void notifySeekNeedsDataForTime(const MediaTime&);
void blockDurationChanges();
void unblockDurationChanges();
PlaybackPipeline* playbackPipeline() const { return m_playbackPipeline.get(); }
#if !RELEASE_LOG_DISABLED
WTFLogChannel& logChannel() const final { return WebCore::LogMediaSource; }
#endif
private:
friend class MediaPlayerFactoryGStreamerMSE;
static void getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>&);
static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
void updateStates() override;
bool doSeek(const MediaTime&, float, GstSeekFlags) override;
void maybeFinishSeek();
void asyncStateChangeDone() override;
bool isTimeBuffered(const MediaTime&) const;
bool isMediaSource() const override { return true; }
bool m_eosMarked = false;
mutable bool m_eosPending = false;
bool m_gstSeekCompleted = true;
RefPtr<MediaSourcePrivateClient> m_mediaSource;
MediaTime m_mediaTimeDuration;
bool m_mseSeekCompleted = true;
bool m_areDurationChangesBlocked = false;
bool m_shouldReportDurationWhenUnblocking = false;
RefPtr<PlaybackPipeline> m_playbackPipeline;
};
}
#endif // USE(GSTREAMER)