MediaRecorder should fire dataavailable event when all tracks are ended and stop...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Oct 2018 17:19:27 +0000 (17:19 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Oct 2018 17:19:27 +0000 (17:19 +0000)
commit360bf2fa8af246a6a9c868b05fcf71dff491931e
tree46ede944835a20073cfc84c26ab9edff1fd383ad
parent40b28e583eb7f29eeb3e341871692c92f9e09a8b
MediaRecorder should fire dataavailable event when all tracks are ended and stop() is called
https://bugs.webkit.org/show_bug.cgi?id=190778

Patch by YUHAN WU <yuhan_wu@apple.com> on 2018-10-31
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/mediacapture-record/BlobEvent-constructor-expected.txt:
* web-platform-tests/mediacapture-record/MediaRecorder-destroy-script-execution-expected.txt: Added.
* web-platform-tests/mediacapture-record/MediaRecorder-destroy-script-execution.html: Added.
* web-platform-tests/mediacapture-record/MediaRecorder-stop-expected.txt:
* web-platform-tests/mediacapture-record/MediaRecorder-stop.html:
* web-platform-tests/mediacapture-record/support/MediaRecorder-iframe.html: Added.

Source/WebCore:

Implement JavaScript dispatch event dataavailable and JavaScript exposed method stop().
Implement a mock string as the output buffer of MediaRecorder.
Remove the declaration of timecode in BlobEvent since it has not been implemented in MediaRecorder and MediaRecorderPrivate.

Tests: http/wpt/mediarecorder/MediaRecorder-dataavailable.html
       http/wpt/mediarecorder/MediaRecorder-mock-dataavailable.html
       imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-destroy-script-execution.html
       imported/w3c/web-platform-tests/mediacapture-record/support/MediaRecorder-iframe.html

* CMakeLists.txt:
* Modules/mediarecorder/BlobEvent.cpp: Added.
(WebCore::BlobEvent::create):
(WebCore::BlobEvent::BlobEvent):
(WebCore::BlobEvent::eventInterface const):
* Modules/mediarecorder/BlobEvent.h:
* Modules/mediarecorder/BlobEvent.idl:
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::MediaRecorder):
(WebCore::MediaRecorder::~MediaRecorder):
(WebCore::MediaRecorder::stop):
(WebCore::MediaRecorder::startRecording):
(WebCore::MediaRecorder::stopRecording):
(WebCore::MediaRecorder::stopRecordingInternal):
(WebCore::MediaRecorder::didAddOrRemoveTrack):
(WebCore::MediaRecorder::trackEnded):
(WebCore::MediaRecorder::sampleBufferUpdated):
(WebCore::MediaRecorder::audioSamplesAvailable):
(WebCore::MediaRecorder::scheduleDeferredTask):
* Modules/mediarecorder/MediaRecorder.h:
* Modules/mediarecorder/MediaRecorder.idl:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/EventNames.h:
* dom/EventNames.in:
* platform/mediarecorder/MediaRecorderPrivate.h: Added.
* platform/mediarecorder/MediaRecorderPrivateMock.cpp: Added.
(WebCore::MediaRecorderPrivateMock::sampleBufferUpdated):
(WebCore::MediaRecorderPrivateMock::audioSamplesAvailable):
(WebCore::MediaRecorderPrivateMock::generateMockString):
(WebCore::MediaRecorderPrivateMock::fetchData):
* platform/mediarecorder/MediaRecorderPrivateMock.h: Added.

LayoutTests:

These tests are used to check if MediaRecorder can generate both video and audio buffers through mock source.

* http/wpt/mediarecorder/MediaRecorder-dataavailable-expected.txt: Added.
* http/wpt/mediarecorder/MediaRecorder-dataavailable.html: Added.
* http/wpt/mediarecorder/MediaRecorder-mock-dataavailable-expected.txt: Added.
* http/wpt/mediarecorder/MediaRecorder-mock-dataavailable.html: Added.
* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237642 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
LayoutTests/ChangeLog
LayoutTests/http/wpt/mediarecorder/MediaRecorder-dataavailable-expected.txt [new file with mode: 0644]
LayoutTests/http/wpt/mediarecorder/MediaRecorder-dataavailable.html [new file with mode: 0644]
LayoutTests/http/wpt/mediarecorder/MediaRecorder-mock-dataavailable-expected.txt [new file with mode: 0644]
LayoutTests/http/wpt/mediarecorder/MediaRecorder-mock-dataavailable.html [new file with mode: 0644]
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/BlobEvent-constructor-expected.txt
LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-destroy-script-execution-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-destroy-script-execution.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-stop-expected.txt
LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-stop.html
LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/support/MediaRecorder-iframe.html [new file with mode: 0644]
LayoutTests/platform/win/TestExpectations
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediarecorder/BlobEvent.cpp [new file with mode: 0644]
Source/WebCore/Modules/mediarecorder/BlobEvent.h
Source/WebCore/Modules/mediarecorder/BlobEvent.idl
Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp
Source/WebCore/Modules/mediarecorder/MediaRecorder.h
Source/WebCore/Modules/mediarecorder/MediaRecorder.idl
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/EventNames.h
Source/WebCore/dom/EventNames.in
Source/WebCore/platform/mediarecorder/MediaRecorderPrivate.h [new file with mode: 0644]
Source/WebCore/platform/mediarecorder/MediaRecorderPrivateMock.cpp [new file with mode: 0644]
Source/WebCore/platform/mediarecorder/MediaRecorderPrivateMock.h [new file with mode: 0644]