|
|
Created:
3 years, 10 months ago by mcasas Modified:
3 years, 10 months ago Reviewers:
emircan CC:
chromium-reviews, posciak+watch_chromium.org, blink-reviews, haraken, emircan+watch+mediarecorder_chromium.org, mcasas+watch+mediarecorder_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionMediaRecorder: make sure ondataavailable+onstop events are fired before onerror
This CL makes sure that "error" is the last event to be fired, after
any "dataavailable" and "stop" events have been received, which
was brought up in [1];
A typical situation triggering an error condition is if the amount
of tracks of the MediaStream being recorded changes. Checking
for this amount of tracks is moved to the renderer/
implementation so all the errors are now sent via onError(), which
forces the recording to stop().
Added a new Layout Test for it (using <canvas>.captureStream() ISO
getUserMedia() which makes it more upstream-able).
[1] https://github.com/w3c/mediacapture-record/issues/52
BUG=693179
Review-Url: https://codereview.chromium.org/2697703003
Cr-Commit-Position: refs/heads/master@{#451561}
Committed: https://chromium.googlesource.com/chromium/src/+/786184e85335e590fd0dd3b31d267f524633a90b
Patch Set 1 #
Total comments: 8
Patch Set 2 : emircan@s comments #
Total comments: 6
Patch Set 3 : emircan@ comments: checking tracks individually via id #Patch Set 4 : fix some naming confusion #
Messages
Total messages: 29 (19 generated)
Description was changed from ========== MediaRecorder: Force onstop+ondataavailable events before onerror Force onstop+ondataavailable events before onerror and add layouttest for it; [1] use <canvas>.captureStream() ISO getUserMedia() where possible; Correct indentation of test JS [1] https://github.com/w3c/mediacapture-record/issues/52 BUG= ========== to ========== MediaRecorder: Force onstop+ondataavailable events before onerror Force firing ondataavailable events before onerror [1], with a new layouttest for it (using <canvas>.captureStream() ISO getUserMedia() which makes it more upstream-able). Correct indentation of test JS according to style guide [2] [1] https://github.com/w3c/mediacapture-record/issues/52 [2] https://google.github.io/styleguide/jsguide.html#formatting-block-indentation BUG= ==========
Description was changed from ========== MediaRecorder: Force onstop+ondataavailable events before onerror Force firing ondataavailable events before onerror [1], with a new layouttest for it (using <canvas>.captureStream() ISO getUserMedia() which makes it more upstream-able). Correct indentation of test JS according to style guide [2] [1] https://github.com/w3c/mediacapture-record/issues/52 [2] https://google.github.io/styleguide/jsguide.html#formatting-block-indentation BUG= ========== to ========== MediaRecorder: make sure ondataavailable event is fired before onerror Force firing ondataavailable events before onerror [1], with a new layouttest for it (using <canvas>.captureStream() ISO getUserMedia() which makes it more upstream-able). Correct indentation of test JS according to style guide [2] [1] https://github.com/w3c/mediacapture-record/issues/52 [2] https://google.github.io/styleguide/jsguide.html#formatting-block-indentation BUG= ==========
Patchset #1 (id:1) has been deleted
Patchset #1 (id:20001) has been deleted
Description was changed from ========== MediaRecorder: make sure ondataavailable event is fired before onerror Force firing ondataavailable events before onerror [1], with a new layouttest for it (using <canvas>.captureStream() ISO getUserMedia() which makes it more upstream-able). Correct indentation of test JS according to style guide [2] [1] https://github.com/w3c/mediacapture-record/issues/52 [2] https://google.github.io/styleguide/jsguide.html#formatting-block-indentation BUG= ========== to ========== MediaRecorder: make sure ondataavailable+onstop events are fired before onerror Force firing ondataavailable events before onstop+ onerror [1]; added a new Layout Test for it (using <canvas>.captureStream() ISO getUserMedia() which makes it more upstream-able). [1] https://github.com/w3c/mediacapture-record/issues/52 BUG= ==========
Description was changed from ========== MediaRecorder: make sure ondataavailable+onstop events are fired before onerror Force firing ondataavailable events before onstop+ onerror [1]; added a new Layout Test for it (using <canvas>.captureStream() ISO getUserMedia() which makes it more upstream-able). [1] https://github.com/w3c/mediacapture-record/issues/52 BUG= ========== to ========== MediaRecorder: make sure ondataavailable+onstop events are fired before onerror This CL makes sure that "error" is the last event to be fired, after any "dataavailable" and "stop" events have been received, which was brought up in [1]; A typical situation triggering an error condition is if the amount of tracks of the MediaStream being recorded changes. Checking for this amount of tracks is moved to the renderer/ implementation so all the errors are now sent via onError(), which forces the recording to stop(). Added a new Layout Test for it (using <canvas>.captureStream() ISO getUserMedia() which makes it more upstream-able). [1] https://github.com/w3c/mediacapture-record/issues/52 BUG= ==========
Description was changed from ========== MediaRecorder: make sure ondataavailable+onstop events are fired before onerror This CL makes sure that "error" is the last event to be fired, after any "dataavailable" and "stop" events have been received, which was brought up in [1]; A typical situation triggering an error condition is if the amount of tracks of the MediaStream being recorded changes. Checking for this amount of tracks is moved to the renderer/ implementation so all the errors are now sent via onError(), which forces the recording to stop(). Added a new Layout Test for it (using <canvas>.captureStream() ISO getUserMedia() which makes it more upstream-able). [1] https://github.com/w3c/mediacapture-record/issues/52 BUG= ========== to ========== MediaRecorder: make sure ondataavailable+onstop events are fired before onerror This CL makes sure that "error" is the last event to be fired, after any "dataavailable" and "stop" events have been received, which was brought up in [1]; A typical situation triggering an error condition is if the amount of tracks of the MediaStream being recorded changes. Checking for this amount of tracks is moved to the renderer/ implementation so all the errors are now sent via onError(), which forces the recording to stop(). Added a new Layout Test for it (using <canvas>.captureStream() ISO getUserMedia() which makes it more upstream-able). [1] https://github.com/w3c/mediacapture-record/issues/52 BUG=693179 ==========
mcasas@chromium.org changed reviewers: + emircan@chromium.org
emircan@ PTAL
https://codereview.chromium.org/2697703003/diff/40001/content/renderer/media/... File content/renderer/media/recorder/media_recorder_handler.cc (right): https://codereview.chromium.org/2697703003/diff/40001/content/renderer/media/... content/renderer/media/recorder/media_recorder_handler.cc:150: media_stream_num_tracks_ = 0; // Will be updated in start(); Should we set it to 0 in Stop() as well? https://codereview.chromium.org/2697703003/diff/40001/content/renderer/media/... content/renderer/media/recorder/media_recorder_handler.cc:337: if (media_stream_num_tracks_ == current_num_tracks) What about the case where one is added another is removed? https://codereview.chromium.org/2697703003/diff/40001/content/renderer/media/... content/renderer/media/recorder/media_recorder_handler.cc:340: media_stream_num_tracks_ = current_num_tracks; Is it necessary to update |media_stream_num_tracks_| here? Can you change this function to only check that number of tracks is different than the initialize? https://codereview.chromium.org/2697703003/diff/40001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/fast/mediarecorder/MediaRecorder-error.html (right): https://codereview.chromium.org/2697703003/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/fast/mediarecorder/MediaRecorder-error.html:46: drawSomethingOnCanvas(canvas); Move this after l.56. Also, AFAIU first frame is only used to initialize encoders but not encoded. I am not sure how this works as it only draws once. Maybe something triggers page repaint and another canvas capture call? https://cs.chromium.org/chromium/src/content/renderer/media/recorder/video_tr...
Patchset #2 (id:60001) has been deleted
ptal https://codereview.chromium.org/2697703003/diff/40001/content/renderer/media/... File content/renderer/media/recorder/media_recorder_handler.cc (right): https://codereview.chromium.org/2697703003/diff/40001/content/renderer/media/... content/renderer/media/recorder/media_recorder_handler.cc:150: media_stream_num_tracks_ = 0; // Will be updated in start(); On 2017/02/17 00:19:07, emircan wrote: > Should we set it to 0 in Stop() as well? Not really because after stop(), we'd need to have to start() again. Actually it's not needed to reinitialise it/them here. https://codereview.chromium.org/2697703003/diff/40001/content/renderer/media/... content/renderer/media/recorder/media_recorder_handler.cc:337: if (media_stream_num_tracks_ == current_num_tracks) On 2017/02/17 00:19:07, emircan wrote: > What about the case where one is added another is removed? Hmm good point, modified. https://codereview.chromium.org/2697703003/diff/40001/content/renderer/media/... content/renderer/media/recorder/media_recorder_handler.cc:340: media_stream_num_tracks_ = current_num_tracks; On 2017/02/17 00:19:07, emircan wrote: > Is it necessary to update |media_stream_num_tracks_| here? Can you change this > function to only check that number of tracks is different than the initialize? I still need the update because at the end of the day from MRHandler we're signalling the error, but the WebApp might like to continue recording with the current status (i.e. ignoring the error). You could perfectly argue that all errors are fatal, but note that we're not calling stop()... https://codereview.chromium.org/2697703003/diff/40001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/fast/mediarecorder/MediaRecorder-error.html (right): https://codereview.chromium.org/2697703003/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/fast/mediarecorder/MediaRecorder-error.html:46: drawSomethingOnCanvas(canvas); On 2017/02/17 00:19:07, emircan wrote: > Move this after l.56. Done. > > Also, AFAIU first frame is only used to initialize encoders but not encoded. I > am not sure how this works as it only draws once. Maybe something triggers page > repaint and another canvas capture call? > > https://cs.chromium.org/chromium/src/content/renderer/media/recorder/video_tr... When a new MediaStreamVideoSink is connected to a Track it does a RequestRefreshFrame() : https://cs.chromium.org/chromium/src/content/renderer/media/media_stream_vide...
https://codereview.chromium.org/2697703003/diff/80001/content/renderer/media/... File content/renderer/media/recorder/media_recorder_handler.cc (right): https://codereview.chromium.org/2697703003/diff/80001/content/renderer/media/... content/renderer/media/recorder/media_recorder_handler.cc:151: not: Remove empty line. https://codereview.chromium.org/2697703003/diff/80001/content/renderer/media/... content/renderer/media/recorder/media_recorder_handler.cc:340: media_stream_num_audio_tracks_ == audio_tracks.size()) { As we discussed offline, there can be a case of one video track removed and another added so we can compare the actual tracks here instead. https://codereview.chromium.org/2697703003/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp (left): https://codereview.chromium.org/2697703003/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp:341: // is in muted() state. Is this TODO still relevant or...
The CQ bit was checked by mcasas@chromium.org to run a CQ dry run
ptal https://codereview.chromium.org/2697703003/diff/80001/content/renderer/media/... File content/renderer/media/recorder/media_recorder_handler.cc (right): https://codereview.chromium.org/2697703003/diff/80001/content/renderer/media/... content/renderer/media/recorder/media_recorder_handler.cc:151: On 2017/02/17 18:59:25, emircan wrote: > not: Remove empty line. Done. https://codereview.chromium.org/2697703003/diff/80001/content/renderer/media/... content/renderer/media/recorder/media_recorder_handler.cc:340: media_stream_num_audio_tracks_ == audio_tracks.size()) { On 2017/02/17 18:59:25, emircan wrote: > As we discussed offline, there can be a case of one video track removed and > another added so we can compare the actual tracks here instead. Done. https://codereview.chromium.org/2697703003/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp (left): https://codereview.chromium.org/2697703003/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp:341: // is in muted() state. On 2017/02/17 18:59:25, emircan wrote: > Is this TODO still relevant or... No, it was removed from the Spec in https://github.com/w3c/mediacapture-record/issues/99
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
Patchset #4 (id:120001) has been deleted
lgtm
The CQ bit was checked by emircan@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by mcasas@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 140001, "attempt_start_ts": 1487564860072560, "parent_rev": "7ff34467488f2eb5e4fa0dc38f14e18a4a17584f", "commit_rev": "786184e85335e590fd0dd3b31d267f524633a90b"}
Message was sent while issue was closed.
Description was changed from ========== MediaRecorder: make sure ondataavailable+onstop events are fired before onerror This CL makes sure that "error" is the last event to be fired, after any "dataavailable" and "stop" events have been received, which was brought up in [1]; A typical situation triggering an error condition is if the amount of tracks of the MediaStream being recorded changes. Checking for this amount of tracks is moved to the renderer/ implementation so all the errors are now sent via onError(), which forces the recording to stop(). Added a new Layout Test for it (using <canvas>.captureStream() ISO getUserMedia() which makes it more upstream-able). [1] https://github.com/w3c/mediacapture-record/issues/52 BUG=693179 ========== to ========== MediaRecorder: make sure ondataavailable+onstop events are fired before onerror This CL makes sure that "error" is the last event to be fired, after any "dataavailable" and "stop" events have been received, which was brought up in [1]; A typical situation triggering an error condition is if the amount of tracks of the MediaStream being recorded changes. Checking for this amount of tracks is moved to the renderer/ implementation so all the errors are now sent via onError(), which forces the recording to stop(). Added a new Layout Test for it (using <canvas>.captureStream() ISO getUserMedia() which makes it more upstream-able). [1] https://github.com/w3c/mediacapture-record/issues/52 BUG=693179 Review-Url: https://codereview.chromium.org/2697703003 Cr-Commit-Position: refs/heads/master@{#451561} Committed: https://chromium.googlesource.com/chromium/src/+/786184e85335e590fd0dd3b31d26... ==========
Message was sent while issue was closed.
Committed patchset #4 (id:140001) as https://chromium.googlesource.com/chromium/src/+/786184e85335e590fd0dd3b31d26... |