Changeset 224107 in webkit
- Timestamp:
- Oct 27, 2017 2:35:53 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r224091 r224107 1 2017-10-27 Alicia Boya García <aboya@igalia.com> 2 3 [GStreamer][MSE] Trim space between codecs 4 https://bugs.webkit.org/show_bug.cgi?id=178160 5 6 Reviewed by Xabier Rodriguez-Calvar. 7 8 Update expected test output. 9 10 * platform/gtk/imported/w3c/web-platform-tests/media-source/mediasource-is-type-supported-expected.txt: 11 1 12 2017-10-27 Ryosuke Niwa <rniwa@webkit.org> 2 13 -
trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/media-source/mediasource-is-type-supported-expected.txt
r223477 r224107 8 8 PASS Test invalid MIME format "video/webm;codecs="" 9 9 FAIL Test invalid MIME format "video/webm;codecs=""" assert_equals: supported expected false but got true 10 FAIL Test invalid MIME format "video/webm;codecs=","" assert_equals: supported expected false but got true 10 PASS Test invalid MIME format "video/webm;codecs=","" 11 11 PASS Test invalid MIME format "" 12 12 PASS Test invalid MIME format "null" … … 28 28 PASS Test valid WebM type "video/webm;codecs="vorbis"" 29 29 PASS Test valid WebM type "video/webm;codecs="vp8,vorbis"" 30 FAIL Test valid WebM type "video/webm;codecs="vorbis, vp8"" assert_equals: supported expected true but got false 30 PASS Test valid WebM type "video/webm;codecs="vorbis, vp8"" 31 31 PASS Test valid WebM type "audio/webm;codecs="vorbis"" 32 32 PASS Test valid WebM type "AUDIO/WEBM;CODECS="vorbis"" … … 38 38 PASS Test valid MP4 type "video/mp4;codecs="mp4a.40.2"" 39 39 PASS Test valid MP4 type "video/mp4;codecs="avc1.4d001e,mp4a.40.2"" 40 FAIL Test valid MP4 type "video/mp4;codecs="mp4a.40.2 , avc1.4d001e "" assert_equals: supported expected true but got false 40 PASS Test valid MP4 type "video/mp4;codecs="mp4a.40.2 , avc1.4d001e "" 41 41 PASS Test valid MP4 type "video/mp4;codecs="avc1.4d001e,mp4a.40.5"" 42 42 -
trunk/Source/WebCore/ChangeLog
r224087 r224107 1 2017-10-27 Alicia Boya García <aboya@igalia.com> 2 3 [GStreamer][MSE] Trim space between codecs 4 https://bugs.webkit.org/show_bug.cgi?id=178160 5 6 Reviewed by Xabier Rodriguez-Calvar. 7 8 Modify supportsCodecs() to accept a Vector<String> instead of 9 receiving a string and parsing itself. 10 11 This improves passrate for `mediasource-is-type-supported` as it 12 ensures that whitespace between codecs is now trimmed and codec 13 strings such as `video/webm;codecs="opus, vp9"` are matched as a valid 14 type, as required by the spec. 15 16 This patch also renames supportCodecs() to supportAllCodecs() and adds 17 a new variant, supportCodec(), that checks for support of an 18 individual codec. 19 20 * platform/graphics/gstreamer/mse/AppendPipeline.cpp: 21 (WebCore::AppendPipeline::parseDemuxerSrcPadCaps): 22 * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: 23 (WebCore::MediaPlayerPrivateGStreamerMSE::supportsCodec): 24 (WebCore::MediaPlayerPrivateGStreamerMSE::supportsAllCodecs): 25 (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType): 26 * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h: 27 1 28 2017-10-27 Michael Catanzaro <mcatanzaro@igalia.com> 2 29 -
trunk/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp
r224012 r224107 600 600 const gchar* originalMediaType = gst_structure_get_string(structure, "original-media-type"); 601 601 602 if (!MediaPlayerPrivateGStreamerMSE::supportsCodec s(originalMediaType)) {602 if (!MediaPlayerPrivateGStreamerMSE::supportsCodec(originalMediaType)) { 603 603 m_presentationSize = WebCore::FloatSize(); 604 604 m_streamType = WebCore::MediaSourceStreamTypeGStreamer::Invalid; … … 633 633 GstVideoInfo info; 634 634 635 if (!MediaPlayerPrivateGStreamerMSE::supportsCodec s(structureName)) {635 if (!MediaPlayerPrivateGStreamerMSE::supportsCodec(structureName)) { 636 636 m_presentationSize = WebCore::FloatSize(); 637 637 m_streamType = WebCore::MediaSourceStreamTypeGStreamer::Invalid; -
trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp
r222707 r224107 838 838 } 839 839 840 bool MediaPlayerPrivateGStreamerMSE::supportsCodec s(const String& codecs)841 { 842 Vector<String> codecEntries;843 codecs.split(',', false, codecEntries);844 845 for (String codec : codecEntries) {846 bool isCodecSupported = false; 847 848 // If the codec is named like a mimetype (eg: video/avc) remove the "video/" part.849 size_t slashIndex = codec.find('/');850 if (slashIndex != WTF::notFound)851 codec = codec.substring(slashIndex+1);852 853 const char* codecData = codec.utf8().data();854 for (const auto& pattern : codecSet()) { 855 isCodecSupported = !fnmatch(pattern.string().utf8().data(), codecData, 0); 856 if (isCodecSupported)857 break; 858 }859 if (! isCodecSupported)840 bool MediaPlayerPrivateGStreamerMSE::supportsCodec(String codec) 841 { 842 // If the codec is named like a mimetype (eg: video/avc) remove the "video/" part. 843 size_t slashIndex = codec.find('/'); 844 if (slashIndex != WTF::notFound) 845 codec = codec.substring(slashIndex+1); 846 847 for (const auto& pattern : codecSet()) { 848 bool codecMatchesPattern = !fnmatch(pattern.string().utf8().data(), codec.utf8().data(), 0); 849 if (codecMatchesPattern) 850 return true; 851 } 852 853 return false; 854 } 855 856 bool MediaPlayerPrivateGStreamerMSE::supportsAllCodecs(const Vector<String>& codecs) 857 { 858 for (String codec : codecs) { 859 if (!supportsCodec(codec)) 860 860 return false; 861 861 } … … 880 880 // Spec says we should not return "probably" if the codecs string is empty. 881 881 if (mimeTypeCache().contains(containerType)) { 882 String codecs = parameters.type.parameter(ContentType::codecsParameter());882 Vector<String> codecs = parameters.type.codecs(); 883 883 if (codecs.isEmpty()) 884 884 result = MediaPlayer::MayBeSupported; 885 885 else 886 result = supports Codecs(codecs) ? MediaPlayer::IsSupported : MediaPlayer::IsNotSupported;886 result = supportsAllCodecs(codecs) ? MediaPlayer::IsSupported : MediaPlayer::IsNotSupported; 887 887 } 888 888 -
trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h
r222649 r224107 84 84 void notifySeekNeedsDataForTime(const MediaTime&); 85 85 86 static bool supportsCodecs(const String& codecs); 86 static bool supportsCodec(String codec); 87 static bool supportsAllCodecs(const Vector<String>& codecs); 87 88 88 89 #if ENABLE(ENCRYPTED_MEDIA)
Note: See TracChangeset
for help on using the changeset viewer.