Changeset 270404 in webkit
- Timestamp:
- Dec 3, 2020 1:12:34 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r270324 r270404 1 2020-12-03 Alicia Boya García <aboya@igalia.com> 2 3 [GStreamer] Fix video losing size at the end of the stream 4 https://bugs.webkit.org/show_bug.cgi?id=219493 5 6 Reviewed by Xabier Rodriguez-Calvar. 7 8 Added a test reproducing the bug that gets fixed with the patch. 9 10 * web-platform-tests/html/semantics/embedded-content/the-video-element/video_size_preserved_after_ended-expected.txt: Added. 11 * web-platform-tests/html/semantics/embedded-content/the-video-element/video_size_preserved_after_ended.html: Added. 12 * web-platform-tests/media/test-1s.mp4: Added. 13 * web-platform-tests/media/test-1s.webm: Added. 14 1 15 2020-12-01 Chris Dumez <cdumez@apple.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r270403 r270404 1 2020-12-03 Alicia Boya García <aboya@igalia.com> 2 3 [GStreamer] Fix video losing size at the end of the stream 4 https://bugs.webkit.org/show_bug.cgi?id=219493 5 6 Reviewed by Xabier Rodriguez-Calvar. 7 8 Our port for long had an issue where at the end of the video the 9 tracks would be erased, causing the video to lose its size and by 10 extension its aspect ratio. 11 12 In absence of a size, WebKit uses the default video size defined by 13 the spec of 300x150 (2:1 aspect ratio). This causes a video element 14 that doesn't have a size set through CSS to shrink to that size at the 15 end of playback, and also for black bars to appear on wider content 16 (e.g. 16:9 video) when watched in full screen mode. 17 18 This patch fixes the problem by not removing the tracks after an end 19 of stream, and instead reusing them with different pads the next time 20 the video is played. 21 22 Test: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-video-element/video_size_preserved_after_ended.html 23 24 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: 25 (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): 26 (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): 27 * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp: 28 (WebCore::TrackPrivateBaseGStreamer::setPad): 29 * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: 30 1 31 2020-12-03 Aditya Keerthi <akeerthi@apple.com> 2 32 -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
r269951 r270404 1024 1024 ASSERT(m_isLegacyPlaybin || isMediaSource()); 1025 1025 1026 // Ignore notifications after a EOS. We don't want the tracks to disappear when the video is finished. 1027 if (m_isEndReached) 1028 return; 1029 1026 1030 unsigned numTracks = 0; 1027 1031 bool useMediaSource = isMediaSource(); … … 1057 1061 if (existingTrack) { 1058 1062 existingTrack->setIndex(i); 1059 if (existingTrack->pad() == pad) 1060 continue; 1063 // If the video has been played twice, the track is still there, but we need 1064 // to update the pad pointer. 1065 if (existingTrack->pad() != pad) 1066 existingTrack->setPad(GRefPtr(pad)); 1067 continue; 1061 1068 } 1062 1069 } … … 1102 1109 ASSERT(m_isLegacyPlaybin || isMediaSource()); 1103 1110 1111 // Ignore notifications after a EOS. We don't want the tracks to disappear when the video is finished. 1112 if (m_isEndReached) 1113 return; 1114 1104 1115 unsigned numTracks = 0; 1105 1116 bool useMediaSource = isMediaSource(); … … 1131 1142 if (existingTrack) { 1132 1143 existingTrack->setIndex(i); 1133 if (existingTrack->pad() == pad) 1134 continue; 1144 // If the video has been played twice, the track is still there, but we need 1145 // to update the pad pointer. 1146 if (existingTrack->pad() != pad) 1147 existingTrack->setPad(GRefPtr(pad)); 1148 continue; 1135 1149 } 1136 1150 } -
trunk/Source/WebCore/platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h
r262695 r270404 50 50 51 51 GstPad* pad() const { return m_pad.get(); } 52 void setPad(GRefPtr<GstPad>&& pad) { m_pad = WTFMove(pad); } 52 53 53 54 virtual void disconnect();
Note: See TracChangeset
for help on using the changeset viewer.