summaryrefslogtreecommitdiff
path: root/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h')
-rw-r--r--Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h34
1 files changed, 19 insertions, 15 deletions
diff --git a/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h b/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h
index 9cc3da2eb..8c7169ea0 100644
--- a/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h
+++ b/Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h
@@ -10,10 +10,10 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
@@ -39,7 +39,7 @@ class TimeRanges;
class MockMediaSourcePrivate final : public MediaSourcePrivate {
public:
- static RefPtr<MockMediaSourcePrivate> create(MockMediaPlayerMediaSource*);
+ static RefPtr<MockMediaSourcePrivate> create(MockMediaPlayerMediaSource*, MediaSourcePrivateClient*);
virtual ~MockMediaSourcePrivate();
const Vector<MockSourceBufferPrivate*>& activeSourceBuffers() const { return m_activeSourceBuffers; }
@@ -47,6 +47,9 @@ public:
bool hasAudio() const;
bool hasVideo() const;
+ MediaTime duration();
+ std::unique_ptr<PlatformTimeRanges> buffered();
+
MockMediaPlayerMediaSource* player() const { return m_player; }
void seekToTime(const MediaTime&);
@@ -55,24 +58,25 @@ public:
unsigned long totalVideoFrames() const { return m_totalVideoFrames; }
unsigned long droppedVideoFrames() const { return m_droppedVideoFrames; }
unsigned long corruptedVideoFrames() const { return m_corruptedVideoFrames; }
- double totalFrameDelay() const { return m_totalFrameDelay; }
+ MediaTime totalFrameDelay() const { return m_totalFrameDelay; }
void incrementTotalVideoFrames() { ++m_totalVideoFrames; }
void incrementDroppedFrames() { ++m_droppedVideoFrames; }
void incrementCorruptedFrames() { ++m_corruptedVideoFrames; }
- void incrementTotalFrameDelayBy(double delay) { m_totalFrameDelay += delay; }
+ void incrementTotalFrameDelayBy(const MediaTime& delay) { m_totalFrameDelay += delay; }
private:
- MockMediaSourcePrivate(MockMediaPlayerMediaSource*);
+ MockMediaSourcePrivate(MockMediaPlayerMediaSource*, MediaSourcePrivateClient*);
// MediaSourcePrivate Overrides
- virtual AddStatus addSourceBuffer(const ContentType&, RefPtr<SourceBufferPrivate>&) override;
- virtual double duration() override;
- virtual void setDuration(double) override;
- virtual void markEndOfStream(EndOfStreamStatus) override;
- virtual void unmarkEndOfStream() override;
- virtual MediaPlayer::ReadyState readyState() const override;
- virtual void setReadyState(MediaPlayer::ReadyState) override;
+ AddStatus addSourceBuffer(const ContentType&, RefPtr<SourceBufferPrivate>&) override;
+ void durationChanged() override;
+ void markEndOfStream(EndOfStreamStatus) override;
+ void unmarkEndOfStream() override;
+ MediaPlayer::ReadyState readyState() const override;
+ void setReadyState(MediaPlayer::ReadyState) override;
+ void waitForSeekCompleted() override;
+ void seekCompleted() override;
void sourceBufferPrivateDidChangeActiveState(MockSourceBufferPrivate*, bool active);
void removeSourceBuffer(SourceBufferPrivate*);
@@ -80,7 +84,7 @@ private:
friend class MockSourceBufferPrivate;
MockMediaPlayerMediaSource* m_player;
- double m_duration;
+ RefPtr<MediaSourcePrivateClient> m_client;
Vector<RefPtr<MockSourceBufferPrivate>> m_sourceBuffers;
Vector<MockSourceBufferPrivate*> m_activeSourceBuffers;
bool m_isEnded;
@@ -88,7 +92,7 @@ private:
unsigned long m_totalVideoFrames;
unsigned long m_droppedVideoFrames;
unsigned long m_corruptedVideoFrames;
- double m_totalFrameDelay;
+ MediaTime m_totalFrameDelay;
};
}