WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
123322
[MSE] Add mock MediaSource classes for testing.
https://bugs.webkit.org/show_bug.cgi?id=123322
Summary
[MSE] Add mock MediaSource classes for testing.
Jer Noble
Reported
2013-10-24 23:29:44 PDT
[MSE] Add mock MediaSource classes for testing.
Attachments
Patch
(103.59 KB, patch)
2013-10-30 10:53 PDT
,
Jer Noble
eric.carlson
: review+
Details
Formatted Diff
Diff
Patch for landing
(98.05 KB, patch)
2013-11-07 08:54 PST
,
Jer Noble
no flags
Details
Formatted Diff
Diff
Patch for landing
(98.06 KB, patch)
2013-11-07 09:10 PST
,
Jer Noble
no flags
Details
Formatted Diff
Diff
Patch for landing
(98.16 KB, patch)
2013-11-07 09:27 PST
,
Jer Noble
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Jer Noble
Comment 1
2013-10-30 10:53:40 PDT
Created
attachment 215524
[details]
Patch
Eric Carlson
Comment 2
2013-11-01 14:52:05 PDT
Comment on
attachment 215524
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=215524&action=review
r=me with a few nits.
> Source/WebCore/platform/graphics/MediaPlayer.cpp:1213 > +void MediaPlayerFactorySupport::callRegisterMediaEngine(MediaEngineRegister registerMediaEngine)
"callRegisterMediaEngine" is an odd name for an externally visible method (even though that is what it does).
> Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:206 > +#if ENABLE(MEDIA_SOURCE) > +void MediaPlayerPrivateAVFoundation::load(const String&, PassRefPtr<HTMLMediaSource>) > +{ > + m_networkState = MediaPlayer::FormatError; > + m_player->networkStateChanged(); > +} > +#endif
This was part of
bug 123593
.
> Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:133 > + virtual void load(const String&, PassRefPtr<HTMLMediaSource>);
Ditto.
> Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:910 > +#if ENABLE(MEDIA_SOURCE) > + if (parameters.isMediaSource) > + return MediaPlayer::IsNotSupported; > +#endif
Ditto.
> Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h:98 > + virtual void load(const String&, PassRefPtr<HTMLMediaSource>);
Ditto.
> Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm:678 > +#if ENABLE(MEDIA_SOURCE) > +void MediaPlayerPrivateQTKit::load(const String&, PassRefPtr<HTMLMediaSource>) > +{ > + m_networkState = MediaPlayer::FormatError; > + m_player->networkStateChanged(); > +} > +#endif
Ditto.
> Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm:1481 > +#if ENABLE(MEDIA_SOURCE) > + if (parameters.isMediaSource) > + return MediaPlayer::IsNotSupported; > +#endif
Ditto.
> Source/WebCore/platform/mock/mediasource/MockBox.cpp:42 > +MockBox::MockBox(ArrayBuffer* data) > +{ > + m_type = peekType(data); > + m_length = peekLength(data); > +}
Should you check that data is big enough for a box?
> Source/WebCore/platform/mock/mediasource/MockBox.cpp:63 > + RefPtr<JSC::DataView> view = JSC::DataView::create(data, 0, data->byteLength()); > + m_trackID = view->get<int32_t>(8, true);
Ditto.
> Source/WebCore/platform/mock/mediasource/MockBox.cpp:83 > + RefPtr<JSC::DataView> view = JSC::DataView::create(data, 0, data->byteLength());
Ditto.
> Source/WebCore/platform/mock/mediasource/MockBox.cpp:110 > + RefPtr<JSC::DataView> view = JSC::DataView::create(data, 0, data->byteLength());
Ditto.
> Source/WebCore/platform/mock/mediasource/MockBox.h:70 > +class MockTrackBox : public MockBox {
Can this be marked FINAL?
> Source/WebCore/platform/mock/mediasource/MockBox.h:97 > +class MockInitializationBox : public MockBox {
Ditto.
> Source/WebCore/platform/mock/mediasource/MockBox.h:121 > +class MockSampleBox : public MockBox {
Ditto.
> Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h:38 > +class MockMediaPlayerMediaSource : public MediaPlayerPrivateInterface {
Can this be marked FINAL?
> Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h:72 > + // MediaPlayerPrivate Overrides > + virtual void load(const String& url) OVERRIDE; > + virtual void load(const String& url, PassRefPtr<HTMLMediaSource>) OVERRIDE; > + virtual void cancelLoad() OVERRIDE; > + virtual void play() OVERRIDE; > + virtual void pause() OVERRIDE; > + virtual IntSize naturalSize() const OVERRIDE; > + virtual bool hasVideo() const OVERRIDE; > + virtual bool hasAudio() const OVERRIDE; > + virtual void setVisible(bool) OVERRIDE; > + virtual bool seeking() const OVERRIDE; > + virtual bool paused() const OVERRIDE; > + virtual MediaPlayer::NetworkState networkState() const OVERRIDE; > + virtual MediaPlayer::ReadyState readyState() const OVERRIDE; > + virtual PassRefPtr<TimeRanges> buffered() const OVERRIDE; > + virtual bool didLoadingProgress() const OVERRIDE; > + virtual void setSize(const IntSize&) OVERRIDE; > + virtual void paint(GraphicsContext*, const IntRect&) OVERRIDE; > + virtual double currentTimeDouble() const OVERRIDE; > + virtual double durationDouble() const OVERRIDE; > + virtual void seekDouble(double time) OVERRIDE; > + > + void advanceCurrentTime(); > + void updateDuration(double); > + void setReadyState(MediaPlayer::ReadyState);
Can these be made private?
> Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h:81 > + bool m_playing;
Nit: packing.
> Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp:131 > + RefPtr<MockSourceBufferPrivate> sourceBuffer = prpSourceBuffer; > + return sourceBuffer->hasAudio();
Nit: the local isn't necessary.
> Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp:141 > + RefPtr<MockSourceBufferPrivate> sourceBuffer = prpSourceBuffer;
Ditto.
> Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h:39 > +class MockMediaSourcePrivate : public MediaSourcePrivate {
Can this be marked FINAL?
> Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h:53 > + // 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; > + > + const Vector<MockSourceBufferPrivate*>& activeSourceBuffers() const { return m_activeSourceBuffers; }
Can these be made private?
> Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp:44 > +class MockMediaSample : public MediaSample {
FINAL?
> Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp:46 > + static RefPtr<MockMediaSample> create(MockSampleBox box) { return adoptRef(new MockMediaSample(box)); }
const MockSampleBox&
> Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp:58 > + MockMediaSample(MockSampleBox box)
Ditto.
> Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp:74 > +class MockMediaDescription : public MediaDescription {
FINAL?
> Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp:76 > + static RefPtr<MockMediaDescription> create(MockTrackBox box) { return adoptRef(new MockMediaDescription(box)); }
const MockTrackBox&
> Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp:85 > + MockMediaDescription(MockTrackBox box) : m_box(box) { }
Ditto.
> Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp:143 > + MockTrackBox trackBox = *it;
MockTrackBox&
> Source/WebCore/platform/mock/mediasource/MockTracks.h:40 > + static RefPtr<MockAudioTrackPrivate> create(MockTrackBox box) { return adoptRef(new MockAudioTrackPrivate(box)); }
const MockTrackBox&
> Source/WebCore/platform/mock/mediasource/MockTracks.h:46 > + MockAudioTrackPrivate(MockTrackBox box)
Ditto.
> Source/WebCore/platform/mock/mediasource/MockTracks.h:57 > + static RefPtr<MockTextTrackPrivate> create(MockTrackBox box) { return adoptRef(new MockTextTrackPrivate(box)); }
Ditto.
> Source/WebCore/platform/mock/mediasource/MockTracks.h:63 > + MockTextTrackPrivate(MockTrackBox box)
Ditto.
> Source/WebCore/platform/mock/mediasource/MockTracks.h:76 > + static RefPtr<MockVideoTrackPrivate> create(MockTrackBox box) { return adoptRef(new MockVideoTrackPrivate(box)); }
Ditto.
> Source/WebCore/platform/mock/mediasource/MockTracks.h:82 > + MockVideoTrackPrivate(MockTrackBox box)
Ditto.
> LayoutTests/ChangeLog:71 > +
Four ChangeLog entries?
Jer Noble
Comment 3
2013-11-07 08:52:50 PST
(In reply to
comment #2
)
> (From update of
attachment 215524
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=215524&action=review
> > r=me with a few nits. > > > Source/WebCore/platform/graphics/MediaPlayer.cpp:1213 > > +void MediaPlayerFactorySupport::callRegisterMediaEngine(MediaEngineRegister registerMediaEngine) > > "callRegisterMediaEngine" is an odd name for an externally visible method (even though that is what it does).
I agonized over this, but couldn't come up with another name with which I was happy.
> > Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:206 > > +#if ENABLE(MEDIA_SOURCE) > > +void MediaPlayerPrivateAVFoundation::load(const String&, PassRefPtr<HTMLMediaSource>) > > +{ > > + m_networkState = MediaPlayer::FormatError; > > + m_player->networkStateChanged(); > > +} > > +#endif > > This was part of
bug 123593
.
Removed this and the following dittos.
> > Source/WebCore/platform/mock/mediasource/MockBox.cpp:42 > > +MockBox::MockBox(ArrayBuffer* data) > > +{ > > + m_type = peekType(data); > > + m_length = peekLength(data); > > +} > > Should you check that data is big enough for a box?
I added an ASSERT here (and the following dittos).
> > Source/WebCore/platform/mock/mediasource/MockBox.h:70 > > +class MockTrackBox : public MockBox { > > Can this be marked FINAL?
Yes. And the dittos as well.
> > Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h:38 > > +class MockMediaPlayerMediaSource : public MediaPlayerPrivateInterface { > > Can this be marked FINAL?
No. Marking it as final (somehow) breaks passing this class into Function objects.
> > Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h:72 > > + // MediaPlayerPrivate Overrides > > + virtual void load(const String& url) OVERRIDE; > > + virtual void load(const String& url, PassRefPtr<HTMLMediaSource>) OVERRIDE; > > + virtual void cancelLoad() OVERRIDE; > > + virtual void play() OVERRIDE; > > + virtual void pause() OVERRIDE; > > + virtual IntSize naturalSize() const OVERRIDE; > > + virtual bool hasVideo() const OVERRIDE; > > + virtual bool hasAudio() const OVERRIDE; > > + virtual void setVisible(bool) OVERRIDE; > > + virtual bool seeking() const OVERRIDE; > > + virtual bool paused() const OVERRIDE; > > + virtual MediaPlayer::NetworkState networkState() const OVERRIDE; > > + virtual MediaPlayer::ReadyState readyState() const OVERRIDE; > > + virtual PassRefPtr<TimeRanges> buffered() const OVERRIDE; > > + virtual bool didLoadingProgress() const OVERRIDE; > > + virtual void setSize(const IntSize&) OVERRIDE; > > + virtual void paint(GraphicsContext*, const IntRect&) OVERRIDE; > > + virtual double currentTimeDouble() const OVERRIDE; > > + virtual double durationDouble() const OVERRIDE; > > + virtual void seekDouble(double time) OVERRIDE; > > + > > + void advanceCurrentTime(); > > + void updateDuration(double); > > + void setReadyState(MediaPlayer::ReadyState); > > Can these be made private?
All except for readyState().
> > Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h:81 > > + bool m_playing; > > Nit: packing.
Sorted.
> > Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp:131 > > + RefPtr<MockSourceBufferPrivate> sourceBuffer = prpSourceBuffer; > > + return sourceBuffer->hasAudio(); > > Nit: the local isn't necessary.
Removed.
> > Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp:141 > > + RefPtr<MockSourceBufferPrivate> sourceBuffer = prpSourceBuffer; > > Ditto.
Ditto.
> > Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h:39 > > +class MockMediaSourcePrivate : public MediaSourcePrivate { > > Can this be marked FINAL?
Yes.
> > Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.h:53 > > + // 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; > > + > > + const Vector<MockSourceBufferPrivate*>& activeSourceBuffers() const { return m_activeSourceBuffers; } > > Can these be made private?
Yes.
> > Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp:44 > > +class MockMediaSample : public MediaSample { > > FINAL?
Yes.
> > Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp:46 > > + static RefPtr<MockMediaSample> create(MockSampleBox box) { return adoptRef(new MockMediaSample(box)); } > > const MockSampleBox&
Yes.
> > Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp:58 > > + MockMediaSample(MockSampleBox box) > > Ditto.
Yes.
> > Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp:74 > > +class MockMediaDescription : public MediaDescription { > > FINAL?
Yes.
> > Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp:76 > > + static RefPtr<MockMediaDescription> create(MockTrackBox box) { return adoptRef(new MockMediaDescription(box)); } > > const MockTrackBox&
Yes.
> > Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp:85 > > + MockMediaDescription(MockTrackBox box) : m_box(box) { } > > Ditto.
Yes.
> > Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp:143 > > + MockTrackBox trackBox = *it; > > MockTrackBox&
const MockTrackBox&.
> > Source/WebCore/platform/mock/mediasource/MockTracks.h:40 > > + static RefPtr<MockAudioTrackPrivate> create(MockTrackBox box) { return adoptRef(new MockAudioTrackPrivate(box)); } > > const MockTrackBox&
Ok.
> > Source/WebCore/platform/mock/mediasource/MockTracks.h:46 > > + MockAudioTrackPrivate(MockTrackBox box) > > Ditto.
Ok.
> > Source/WebCore/platform/mock/mediasource/MockTracks.h:57 > > + static RefPtr<MockTextTrackPrivate> create(MockTrackBox box) { return adoptRef(new MockTextTrackPrivate(box)); } > > Ditto.
Ok.
> > Source/WebCore/platform/mock/mediasource/MockTracks.h:63 > > + MockTextTrackPrivate(MockTrackBox box) > > Ditto.
Ok.
> > Source/WebCore/platform/mock/mediasource/MockTracks.h:76 > > + static RefPtr<MockVideoTrackPrivate> create(MockTrackBox box) { return adoptRef(new MockVideoTrackPrivate(box)); } > > Ditto.
Ok.
> > Source/WebCore/platform/mock/mediasource/MockTracks.h:82 > > + MockVideoTrackPrivate(MockTrackBox box) > > Ditto.
Ok.
> > LayoutTests/ChangeLog:71 > > + > > Four ChangeLog entries?
Removed.
Jer Noble
Comment 4
2013-11-07 08:54:32 PST
Created
attachment 216305
[details]
Patch for landing
Jer Noble
Comment 5
2013-11-07 09:10:12 PST
Created
attachment 216306
[details]
Patch for landing
EFL EWS Bot
Comment 6
2013-11-07 09:18:48 PST
Comment on
attachment 216306
[details]
Patch for landing
Attachment 216306
[details]
did not pass efl-ews (efl): Output:
http://webkit-queues.appspot.com/results/22748239
EFL EWS Bot
Comment 7
2013-11-07 09:21:02 PST
Comment on
attachment 216306
[details]
Patch for landing
Attachment 216306
[details]
did not pass efl-wk2-ews (efl-wk2): Output:
http://webkit-queues.appspot.com/results/22778214
kov's GTK+ EWS bot
Comment 8
2013-11-07 09:21:55 PST
Comment on
attachment 216306
[details]
Patch for landing
Attachment 216306
[details]
did not pass gtk-ews (gtk): Output:
http://webkit-queues.appspot.com/results/22778215
Jer Noble
Comment 9
2013-11-07 09:27:41 PST
Created
attachment 216309
[details]
Patch for landing Fixed the build error in Internals.cpp for ports which do not enable MEDIA_SOURCE.
Jer Noble
Comment 10
2013-11-07 09:56:59 PST
Committed
r158853
: <
http://trac.webkit.org/changeset/158853
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug