MockSourceBufferPrivate.h [plain text]
#ifndef MockSourceBufferPrivate_h
#define MockSourceBufferPrivate_h
#if ENABLE(MEDIA_SOURCE)
#include "SourceBufferPrivate.h"
#include <wtf/HashMap.h>
#include <wtf/MediaTime.h>
#include <wtf/RefPtr.h>
#include <wtf/RetainPtr.h>
#include <wtf/Vector.h>
namespace WebCore {
class AudioTrackPrivate;
class InbandTextTrackPrivate;
class MockInitializationBox;
class MockMediaSourcePrivate;
class MockSampleBox;
class TimeRanges;
class VideoTrackPrivate;
class MockSourceBufferPrivate : public SourceBufferPrivate {
public:
static RefPtr<MockSourceBufferPrivate> create(MockMediaSourcePrivate*);
virtual ~MockSourceBufferPrivate();
void clearMediaSource() { m_mediaSource = nullptr; }
bool hasVideo() const;
bool hasAudio() const;
void seekToTime(const MediaTime&);
MediaTime fastSeekTimeForMediaTime(const MediaTime&, const MediaTime& negativeThreshold, const MediaTime& positiveThreshold);
private:
explicit MockSourceBufferPrivate(MockMediaSourcePrivate*);
virtual void setClient(SourceBufferPrivateClient*) override;
virtual void append(const unsigned char* data, unsigned length) override;
virtual void abort() override;
virtual void removedFromMediaSource() override;
virtual MediaPlayer::ReadyState readyState() const override;
virtual void setReadyState(MediaPlayer::ReadyState) override;
virtual void flushAndEnqueueNonDisplayingSamples(Vector<RefPtr<MediaSample>>, AtomicString) override { }
virtual void enqueueSample(PassRefPtr<MediaSample>, AtomicString) override;
virtual bool isReadyForMoreSamples(AtomicString) override { return true; }
virtual void setActive(bool) override;
void didReceiveInitializationSegment(const MockInitializationBox&);
void didReceiveSample(const MockSampleBox&);
MockMediaSourcePrivate* m_mediaSource;
SourceBufferPrivateClient* m_client;
Vector<char> m_inputBuffer;
};
}
#endif // ENABLE(MEDIA_SOURCE) && USE(AVFOUNDATION)
#endif