Changeset 268908 in webkit
- Timestamp:
- Oct 23, 2020, 1:25:22 AM (6 years ago)
- Location:
- releases/WebKitGTK/webkit-2.30
- Files:
-
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/media/media-can-play-mpeg4-video-expected.txt (modified) (1 diff)
-
LayoutTests/media/media-can-play-mpeg4-video.html (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
releases/WebKitGTK/webkit-2.30/LayoutTests/ChangeLog
r266595 r268908 1 2020-10-13 Philippe Normand <pnormand@igalia.com> 2 3 [GStreamer] Crash in WebCore::GStreamerRegistryScanner::isAVC1CodecSupported 4 https://bugs.webkit.org/show_bug.cgi?id=217647 5 6 Reviewed by Xabier Rodriguez-Calvar. 7 8 * media/media-can-play-mpeg4-video-expected.txt: 9 * media/media-can-play-mpeg4-video.html: Add test for "avc1" codec. 10 1 11 2020-08-28 Adrian Perez de Castro <aperez@igalia.com> 2 12 -
releases/WebKitGTK/webkit-2.30/LayoutTests/media/media-can-play-mpeg4-video-expected.txt
r158743 r268908 6 6 EXPECTED (video.canPlayType('video/x-m4v') == 'maybe') OK 7 7 EXPECTED (video.canPlayType('video/mp4') == 'maybe') OK 8 EXPECTED (video.canPlayType('video/mp4; Codecs="avc1"') == 'probably') OK 8 9 EXPECTED (video.canPlayType('video/mp4; Codecs="avc1.4D400C"') == 'probably') OK 9 10 EXPECTED (video.canPlayType(' Video/MP4 ; CODECS="mp4v.20.8, mp4a.40.2"') == 'probably') OK -
releases/WebKitGTK/webkit-2.30/LayoutTests/media/media-can-play-mpeg4-video.html
r115798 r268908 10 10 testExpected("video.canPlayType('video/x-m4v')", "maybe"); 11 11 testExpected("video.canPlayType('video/mp4')", "maybe"); 12 testExpected("video.canPlayType('video/mp4; Codecs=\"avc1\"')", "probably"); 12 13 testExpected("video.canPlayType('video/mp4; Codecs=\"avc1.4D400C\"')", "probably"); 13 14 testExpected("video.canPlayType(' Video/MP4 ; CODECS=\"mp4v.20.8, mp4a.40.2\"')", "probably"); -
releases/WebKitGTK/webkit-2.30/Source/WebCore/ChangeLog
r268452 r268908 1 2020-10-13 Philippe Normand <pnormand@igalia.com> 2 3 [GStreamer] Crash in WebCore::GStreamerRegistryScanner::isAVC1CodecSupported 4 https://bugs.webkit.org/show_bug.cgi?id=217647 5 6 Reviewed by Xabier Rodriguez-Calvar. 7 8 The registry scanner was assuming the avc1 codec field is always of the form 9 avc1.codecprofile, which is wrong. 10 11 Covered by test: media/media-can-play-mpeg4-video.html 12 13 * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: 14 (WebCore::GStreamerRegistryScanner::isAVC1CodecSupported const): Check for '.' presence and 15 fallback to unconstrained check if no profile or level information was extracted. 16 1 17 2020-10-13 Adrian Perez de Castro <aperez@igalia.com> 2 18 -
releases/WebKitGTK/webkit-2.30/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp
r264162 r268908 363 363 bool GStreamerRegistryScanner::isAVC1CodecSupported(const String& codec, bool shouldCheckForHardwareUse) const 364 364 { 365 auto components = codec.split('.');366 long int spsAsInteger = strtol(components[1].utf8().data(), nullptr, 16);367 uint8_t sps[3];368 sps[0] = spsAsInteger >> 16;369 sps[1] = spsAsInteger >> 8;370 sps[2] = spsAsInteger;371 372 const char* profile = gst_codec_utils_h264_get_profile(sps, 3);373 const char* level = gst_codec_utils_h264_get_level(sps, 3);374 375 // To avoid going through a class hierarchy for such a simple376 // string conversion, we use a little trick here: See377 // https://bugs.webkit.org/show_bug.cgi?id=201870.378 char levelAsStringFallback[2] = { '\0', '\0' };379 if (!level && sps[2] > 0 && sps[2] <= 5) {380 levelAsStringFallback[0] = static_cast<char>('0' + sps[2]);381 level = levelAsStringFallback;382 }383 384 if (!profile || !level) {385 GST_ERROR("H.264 profile / level was not recognised in codec %s", codec.utf8().data());386 return false;387 }388 389 GST_DEBUG("Codec %s translates to H.264 profile %s and level %s", codec.utf8().data(), profile, level);390 391 365 auto checkH264Caps = [&](const char* capsString) { 392 366 bool supported = false; … … 398 372 return supported; 399 373 }; 374 375 if (codec.find('.') == notFound) { 376 GST_DEBUG("Codec has no profile/level, falling back to unconstrained caps"); 377 return checkH264Caps("video/x-h264"); 378 } 379 380 auto components = codec.split('.'); 381 long int spsAsInteger = strtol(components[1].utf8().data(), nullptr, 16); 382 uint8_t sps[3]; 383 sps[0] = spsAsInteger >> 16; 384 sps[1] = spsAsInteger >> 8; 385 sps[2] = spsAsInteger; 386 387 const char* profile = gst_codec_utils_h264_get_profile(sps, 3); 388 const char* level = gst_codec_utils_h264_get_level(sps, 3); 389 390 // To avoid going through a class hierarchy for such a simple 391 // string conversion, we use a little trick here: See 392 // https://bugs.webkit.org/show_bug.cgi?id=201870. 393 char levelAsStringFallback[2] = { '\0', '\0' }; 394 if (!level && sps[2] > 0 && sps[2] <= 5) { 395 levelAsStringFallback[0] = static_cast<char>('0' + sps[2]); 396 level = levelAsStringFallback; 397 } 398 399 if (!profile || !level) { 400 GST_ERROR("H.264 profile / level was not recognised in codec %s", codec.utf8().data()); 401 return false; 402 } 403 404 GST_DEBUG("Codec %s translates to H.264 profile %s and level %s", codec.utf8().data(), profile, level); 400 405 401 406 if (const char* maxVideoResolution = g_getenv("WEBKIT_GST_MAX_AVC1_RESOLUTION")) {
Note:
See TracChangeset
for help on using the changeset viewer.