Commit 17acb72
committed
[GStreamer] Fix video losing size at the end of the stream
https://bugs.webkit.org/show_bug.cgi?id=219493
Reviewed by Xabier Rodriguez-Calvar.
LayoutTests/imported/w3c:
Added a test reproducing the bug that gets fixed with the patch.
* web-platform-tests/html/semantics/embedded-content/the-video-element/video_size_preserved_after_ended-expected.txt: Added.
* web-platform-tests/html/semantics/embedded-content/the-video-element/video_size_preserved_after_ended.html: Added.
* web-platform-tests/media/test-1s.mp4: Added.
* web-platform-tests/media/test-1s.webm: Added.
Source/WebCore:
Our port for long had an issue where at the end of the video the
tracks would be erased, causing the video to lose its size and by
extension its aspect ratio.
In absence of a size, WebKit uses the default video size defined by
the spec of 300x150 (2:1 aspect ratio). This causes a video element
that doesn't have a size set through CSS to shrink to that size at the
end of playback, and also for black bars to appear on wider content
(e.g. 16:9 video) when watched in full screen mode.
This patch fixes the problem by not removing the tracks after an end
of stream, and instead reusing them with different pads the next time
the video is played.
Test: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-video-element/video_size_preserved_after_ended.html
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::setPad):
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
Canonical link: https://commits.webkit.org/232089@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270404 268f45cc-cd09-0410-ab3c-d52691b4dbfc1 parent 3c8c05b commit 17acb72
8 files changed
Lines changed: 97 additions & 4 deletions
File tree
- LayoutTests/imported/w3c
- web-platform-tests
- html/semantics/embedded-content/the-video-element
- media
- Source/WebCore
- platform/graphics/gstreamer
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
1 | 15 | | |
2 | 16 | | |
3 | 17 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
Binary file not shown.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
1 | 31 | | |
2 | 32 | | |
3 | 33 | | |
| |||
Lines changed: 18 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1023 | 1023 | | |
1024 | 1024 | | |
1025 | 1025 | | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
1026 | 1030 | | |
1027 | 1031 | | |
1028 | 1032 | | |
| |||
1056 | 1060 | | |
1057 | 1061 | | |
1058 | 1062 | | |
1059 | | - | |
1060 | | - | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
1061 | 1068 | | |
1062 | 1069 | | |
1063 | 1070 | | |
| |||
1101 | 1108 | | |
1102 | 1109 | | |
1103 | 1110 | | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
1104 | 1115 | | |
1105 | 1116 | | |
1106 | 1117 | | |
| |||
1130 | 1141 | | |
1131 | 1142 | | |
1132 | 1143 | | |
1133 | | - | |
1134 | | - | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
1135 | 1149 | | |
1136 | 1150 | | |
1137 | 1151 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
0 commit comments