Bug 216856

Summary: MediaRecorder should support isTypeSupported
Product: WebKit Reporter: Eric Carlson <eric.carlson>
Component: WebRTCAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, clopez, darin, esprehn+autocc, ews-watchlist, glenn, hta, jer.noble, kondapallykalyan, philipj, sergio, tommyw, webkit-bug-importer, youennf, zach
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 85851, 215018    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch for landing
none
Patch for landing
none
Patch for landing
none
Patch for landing none

Eric Carlson
Reported 2020-09-22 15:57:11 PDT
MediaRecorder should support isTypeSupported.
Attachments
Patch (28.75 KB, patch)
2020-09-28 05:50 PDT, youenn fablet
no flags
Patch (28.76 KB, patch)
2020-09-28 06:06 PDT, youenn fablet
no flags
Patch (43.37 KB, patch)
2020-09-29 08:17 PDT, youenn fablet
no flags
Patch for landing (43.36 KB, patch)
2020-09-30 01:27 PDT, youenn fablet
no flags
Patch for landing (43.36 KB, patch)
2020-09-30 01:41 PDT, youenn fablet
no flags
Patch for landing (43.32 KB, patch)
2020-09-30 06:34 PDT, youenn fablet
no flags
Patch for landing (44.20 KB, patch)
2020-10-01 01:36 PDT, youenn fablet
no flags
youenn fablet
Comment 1 2020-09-28 05:50:11 PDT
youenn fablet
Comment 2 2020-09-28 06:06:12 PDT
Darin Adler
Comment 3 2020-09-28 08:15:06 PDT
Comment on attachment 409884 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=409884&action=review > Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp:53 > + return page ? page->mediaRecorderProvider().isSupported(value) : false; Clearer with &&? > Source/WebCore/Modules/mediarecorder/MediaRecorderProvider.cpp:53 > + auto mimeType = parseMIMEType(value); If parseMIMEType takes a StringView then I suggest having this function and the other function that calls it take a StringView and not a String. > Source/WebCore/Modules/mediarecorder/MediaRecorderProvider.cpp:64 > + if (!codecs.isEmpty()) { Don’t need this check. The loop below will already correctly do nothing if the string is empty. > Source/WebCore/platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:92 > + m_writer->fetchData([completionHandler = WTFMove(completionHandler), mimeType = this->mimeType()](auto&& buffer) mutable { The old code didn’t need “this->”. Why do we need to add it now? > Source/WebCore/platform/network/HTTPParsers.h:114 > +struct MimeType { I would call this ParsedMIMEType. Typically a MIMEType is just a String so I think that name is clearer. > Source/WebCore/platform/network/HTTPParsers.h:121 > +Optional<MimeType> parseMIMEType(const String&); Can this take a StringView instead of a String? > Source/WebKit/WebProcess/GPU/webrtc/MediaRecorderPrivate.cpp:129 > + m_connection->sendWithAsyncReply(Messages::RemoteMediaRecorder::FetchData { }, [completionHandler = WTFMove(completionHandler), mimeType = this->mimeType()](auto&& data) mutable { I don’t think we need the “this->” here.
Eric Carlson
Comment 4 2020-09-28 09:10:59 PDT
Comment on attachment 409884 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=409884&action=review > Source/WebCore/platform/network/HTTPParsers.cpp:999 > +// https://mimesniff.spec.whatwg.org/#parsing-a-mime-type > +Optional<MimeType> parseMIMEType(const String& contentType) The `ContentType` class used extensively in other media code also has a MIME type parser. We should figure out how to share code. > Source/WebCore/platform/network/HTTPParsers.h:117 > +struct MimeType { > + String type; > + String subtype; > + HashMap<String, String> parameters; Could you use ContentType?
youenn fablet
Comment 5 2020-09-29 08:17:05 PDT
EWS Watchlist
Comment 6 2020-09-29 08:17:52 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Radar WebKit Bug Importer
Comment 7 2020-09-29 15:58:15 PDT
EWS
Comment 8 2020-09-30 00:56:51 PDT
ChangeLog entry in LayoutTests/imported/w3c/ChangeLog contains OOPS!.
youenn fablet
Comment 9 2020-09-30 01:27:04 PDT
Created attachment 410100 [details] Patch for landing
youenn fablet
Comment 10 2020-09-30 01:41:30 PDT
Created attachment 410101 [details] Patch for landing
youenn fablet
Comment 11 2020-09-30 01:41:47 PDT
> > Source/WebCore/platform/network/HTTPParsers.h:117 > > +struct MimeType { > > + String type; > > + String subtype; > > + HashMap<String, String> parameters; > > Could you use ContentType? I migrated to ContentType. > > Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp:53 > > + return page ? page->mediaRecorderProvider().isSupported(value) : false; > > Clearer with &&? OK > > Source/WebCore/Modules/mediarecorder/MediaRecorderProvider.cpp:64 > > + if (!codecs.isEmpty()) { > > Don’t need this check. The loop below will already correctly do nothing if > the string is empty. OK > > Source/WebCore/platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:92 > > + m_writer->fetchData([completionHandler = WTFMove(completionHandler), mimeType = this->mimeType()](auto&& buffer) mutable { > > The old code didn’t need “this->”. Why do we need to add it now? Removed
EWS
Comment 12 2020-09-30 06:31:47 PDT
Downloading setuptools-44.1.1... Installing setuptools-44.1.1... Installed setuptools-44.1.1! Downloading chardet-3.0.4... Installing chardet-3.0.4... Installed chardet-3.0.4! ChangeLog entry in Source/WebCore/ChangeLog contains OOPS!.
youenn fablet
Comment 13 2020-09-30 06:34:44 PDT
Created attachment 410112 [details] Patch for landing
EWS
Comment 14 2020-09-30 07:12:12 PDT
Committed r267788: <https://trac.webkit.org/changeset/267788> All reviewed patches have been landed. Closing bug and clearing flags on attachment 410112 [details].
Ryan Haddad
Comment 15 2020-09-30 11:37:57 PDT
Reverted r267788 for reason: Broke internal builds. Committed r267798: <https://trac.webkit.org/changeset/267798>
youenn fablet
Comment 16 2020-10-01 01:36:45 PDT
Created attachment 410208 [details] Patch for landing
EWS
Comment 17 2020-10-01 03:38:09 PDT
Committed r267825: <https://trac.webkit.org/changeset/267825> All reviewed patches have been landed. Closing bug and clearing flags on attachment 410208 [details].
Eric Carlson
Comment 18 2020-10-23 22:09:48 PDT
*** Bug 217280 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.