Skip to content

Commit

Permalink
Merge r222388 - [GTK] HTMLMediaElement resize event not fired when vi…
Browse files Browse the repository at this point in the history
…deo size changes

https://bugs.webkit.org/show_bug.cgi?id=174582

Reviewed by Xabier Rodriguez-Calvar.

Modify AppendPipeline to notify MediaPlayerPrivateGStreamerMSE that a track is detected
not only for the initial track detection but also for subsequent in particular when the
video size has changed.

Update test expectation for new passing tests.

Source/WebCore:

* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::appsinkCapsChanged):
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
* platform/graphics/gstreamer/mse/AppendPipeline.h:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
(WebCore::PlaybackPipeline::reattachTrack):
* platform/graphics/gstreamer/mse/PlaybackPipeline.h:

LayoutTests:

* platform/gtk/TestExpectations:
  • Loading branch information
naeloued authored and carlosgcampos committed Oct 16, 2017
1 parent c89bef7 commit a1ff577
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 17 deletions.
15 changes: 15 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
2017-09-22 Nael Ouedraogo <nael.ouedraogo@crf.canon.fr>

[GTK] HTMLMediaElement resize event not fired when video size changes
https://bugs.webkit.org/show_bug.cgi?id=174582

Reviewed by Xabier Rodriguez-Calvar.

Modify AppendPipeline to notify MediaPlayerPrivateGStreamerMSE that a track is detected
not only for the initial track detection but also for subsequent in particular when the
video size has changed.

Update test expectation for new passing tests.

* platform/gtk/TestExpectations:

2017-09-21 Zhifei FANG <facetothefate@gmail.com>

In regular block layout, the width of a child's margin box should always be equal to that of its containing block
Expand Down
2 changes: 0 additions & 2 deletions LayoutTests/platform/gtk/TestExpectations
Expand Up @@ -238,8 +238,6 @@ webkit.org/b/167108 imported/w3c/web-platform-tests/media-source/mediasource-add
webkit.org/b/167108 imported/w3c/web-platform-tests/media-source/mediasource-append-buffer.html [ Failure ]
webkit.org/b/167108 imported/w3c/web-platform-tests/media-source/mediasource-avtracks.html [ Failure ]
webkit.org/b/167108 imported/w3c/web-platform-tests/media-source/mediasource-buffered.html [ Failure ]
webkit.org/b/167108 imported/w3c/web-platform-tests/media-source/mediasource-config-change-mp4-av-framesize.html [ Failure ]
webkit.org/b/167108 imported/w3c/web-platform-tests/media-source/mediasource-config-change-mp4-v-framesize.html [ Failure ]
webkit.org/b/167108 imported/w3c/web-platform-tests/media-source/mediasource-config-change-webm-a-bitrate.html [ Failure ]
webkit.org/b/167108 imported/w3c/web-platform-tests/media-source/mediasource-config-change-webm-av-audio-bitrate.html [ Failure ]
webkit.org/b/167108 imported/w3c/web-platform-tests/media-source/mediasource-config-change-webm-av-framesize.html [ Failure ]
Expand Down
24 changes: 24 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,27 @@
2017-09-22 Nael Ouedraogo <nael.ouedraogo@crf.canon.fr>

[GTK] HTMLMediaElement resize event not fired when video size changes
https://bugs.webkit.org/show_bug.cgi?id=174582

Reviewed by Xabier Rodriguez-Calvar.

Modify AppendPipeline to notify MediaPlayerPrivateGStreamerMSE that a track is detected
not only for the initial track detection but also for subsequent in particular when the
video size has changed.

Update test expectation for new passing tests.

* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::appsinkCapsChanged):
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
* platform/graphics/gstreamer/mse/AppendPipeline.h:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
(WebCore::PlaybackPipeline::reattachTrack):
* platform/graphics/gstreamer/mse/PlaybackPipeline.h:

2017-09-21 Zhifei FANG <facetothefate@gmail.com>

In regular block layout, the width of a child's margin box should always be equal to that of its containing block
Expand Down
Expand Up @@ -607,8 +607,8 @@ void AppendPipeline::appsinkCapsChanged()

if (m_appsinkCaps != caps) {
m_appsinkCaps = WTFMove(caps);
if (m_playerPrivate && previousCapsWereNull)
m_playerPrivate->trackDetected(this, m_oldTrack, m_track);
if (m_playerPrivate)
m_playerPrivate->trackDetected(this, m_track, previousCapsWereNull);
didReceiveInitializationSegment();
gst_element_set_state(m_pipeline.get(), GST_STATE_PLAYING);
}
Expand Down Expand Up @@ -982,8 +982,6 @@ void AppendPipeline::connectDemuxerSrcPadToAppsink(GstPad* demuxerSrcPad)
|| (m_mediaSourceClient->duration().isInvalid() && m_initialDuration > MediaTime::zeroTime()))
m_mediaSourceClient->durationChanged(m_initialDuration);

m_oldTrack = m_track;

parseDemuxerSrcPadCaps(gst_caps_ref(caps.get()));

switch (m_streamType) {
Expand Down
Expand Up @@ -142,7 +142,6 @@ class AppendPipeline : public ThreadSafeRefCounted<AppendPipeline> {
bool m_abortPending;

WebCore::MediaSourceStreamTypeGStreamer m_streamType;
RefPtr<WebCore::TrackPrivateBase> m_oldTrack;
RefPtr<WebCore::TrackPrivateBase> m_track;

GRefPtr<GstBuffer> m_pendingBuffer;
Expand Down
Expand Up @@ -723,7 +723,7 @@ void MediaPlayerPrivateGStreamerMSE::getSupportedTypes(HashSet<String, ASCIICase
types = mimeTypeCache();
}

void MediaPlayerPrivateGStreamerMSE::trackDetected(RefPtr<AppendPipeline> appendPipeline, RefPtr<WebCore::TrackPrivateBase> oldTrack, RefPtr<WebCore::TrackPrivateBase> newTrack)
void MediaPlayerPrivateGStreamerMSE::trackDetected(RefPtr<AppendPipeline> appendPipeline, RefPtr<WebCore::TrackPrivateBase> newTrack, bool firstTrackDetected)
{
ASSERT(appendPipeline->track() == newTrack);

Expand All @@ -744,10 +744,10 @@ void MediaPlayerPrivateGStreamerMSE::trackDetected(RefPtr<AppendPipeline> append
m_videoSize.setHeight(height);
}

if (!oldTrack)
if (firstTrackDetected)
m_playbackPipeline->attachTrack(appendPipeline->sourceBufferPrivate(), newTrack, structure, caps);
else
m_playbackPipeline->reattachTrack(appendPipeline->sourceBufferPrivate(), newTrack);
m_playbackPipeline->reattachTrack(appendPipeline->sourceBufferPrivate(), newTrack, mediaType);
}

const static HashSet<AtomicString>& codecSet()
Expand Down
Expand Up @@ -80,7 +80,7 @@ class MediaPlayerPrivateGStreamerMSE : public MediaPlayerPrivateGStreamer {

void markEndOfStream(MediaSourcePrivate::EndOfStreamStatus);

void trackDetected(RefPtr<AppendPipeline>, RefPtr<WebCore::TrackPrivateBase> oldTrack, RefPtr<WebCore::TrackPrivateBase> newTrack);
void trackDetected(RefPtr<AppendPipeline>, RefPtr<WebCore::TrackPrivateBase>, bool firstTrackDetected);
void notifySeekNeedsDataForTime(const MediaTime&);

static bool supportsCodecs(const String& codecs);
Expand Down
Expand Up @@ -300,7 +300,7 @@ void PlaybackPipeline::attachTrack(RefPtr<SourceBufferPrivateGStreamer> sourceBu
g_signal_emit(G_OBJECT(stream->parent), webKitMediaSrcSignals[signal], 0, nullptr);
}

void PlaybackPipeline::reattachTrack(RefPtr<SourceBufferPrivateGStreamer> sourceBufferPrivate, RefPtr<TrackPrivateBase> trackPrivate)
void PlaybackPipeline::reattachTrack(RefPtr<SourceBufferPrivateGStreamer> sourceBufferPrivate, RefPtr<TrackPrivateBase> trackPrivate, const char* mediaType)
{
GST_DEBUG("Re-attaching track");

Expand All @@ -315,10 +315,6 @@ void PlaybackPipeline::reattachTrack(RefPtr<SourceBufferPrivateGStreamer> source

ASSERT(stream && stream->type != Invalid);

// The caps change is managed by gst_appsrc_push_sample() in enqueueSample() and
// flushAndEnqueueNonDisplayingSamples(), so the caps aren't set from here.
GRefPtr<GstCaps> appsrcCaps = adoptGRef(gst_app_src_get_caps(GST_APP_SRC(stream->appsrc)));
const gchar* mediaType = gst_structure_get_name(gst_caps_get_structure(appsrcCaps.get(), 0));
int signal = -1;

GST_OBJECT_LOCK(webKitMediaSrc);
Expand Down
Expand Up @@ -58,7 +58,7 @@ class PlaybackPipeline: public RefCounted<PlaybackPipeline> {
MediaSourcePrivate::AddStatus addSourceBuffer(RefPtr<SourceBufferPrivateGStreamer>);
void removeSourceBuffer(RefPtr<SourceBufferPrivateGStreamer>);
void attachTrack(RefPtr<SourceBufferPrivateGStreamer>, RefPtr<TrackPrivateBase>, GstStructure*, GstCaps*);
void reattachTrack(RefPtr<SourceBufferPrivateGStreamer>, RefPtr<TrackPrivateBase>);
void reattachTrack(RefPtr<SourceBufferPrivateGStreamer>, RefPtr<TrackPrivateBase>, const char*);
void notifyDurationChanged();

// From MediaSourceGStreamer.
Expand Down

0 comments on commit a1ff577

Please sign in to comment.