|
|
DescriptionUse TaskQueue in IncomingVideoStream instead of the PlatformThread + event timer approach.
BUG=webrtc:7219, webrtc:7253
Review-Url: https://codereview.webrtc.org/2716473002
Cr-Commit-Position: refs/heads/master@{#16860}
Committed: https://chromium.googlesource.com/external/webrtc/+/e2d1d6429557af4560a97581a5e282b54c742173
Patch Set 1 : rebase and squash #
Total comments: 12
Patch Set 2 : Address comments #
Total comments: 2
Patch Set 3 : Address comments #Patch Set 4 : Rebase #Patch Set 5 : Ignore frames from the past #Patch Set 6 : remove return statement and add TODO #Patch Set 7 : ugh, looks like a pebkac #Patch Set 8 : test pebkac again #Patch Set 9 : Remove DCHECK #Patch Set 10 : Print render_time_ms instead of timestamp #
Messages
Total messages: 78 (46 generated)
The CQ bit was checked by tommi@webrtc.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: presubmit on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/presubmit/builds/13905)
cleanup
add comment
use lambda
The CQ bit was checked by tommi@webrtc.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: presubmit on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/presubmit/builds/13909)
Simplify
The CQ bit was checked by tommi@webrtc.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
Fix constants, move to cc
Rebase
rebase and squash
Description was changed from ========== WIP BUG= ========== to ========== Use TaskQueue in IncomingVideoStream instead of the PlatformThread + event timer approach. BUG=webrtc:7219 ==========
tommi@webrtc.org changed reviewers: + mflodman@webrtc.org
Patchset #1 (id:1) has been deleted
Patchset #1 (id:20001) has been deleted
Patchset #1 (id:40001) has been deleted
Patchset #1 (id:60001) has been deleted
Patchset #1 (id:80001) has been deleted
Patchset #1 (id:100001) has been deleted
Patchset #1 (id:120001) has been deleted
The CQ bit was checked by tommi@webrtc.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
A few comments / questions, then LGTM. https://codereview.webrtc.org/2716473002/diff/140001/webrtc/common_video/incl... File webrtc/common_video/include/incoming_video_stream.h (left): https://codereview.webrtc.org/2716473002/diff/140001/webrtc/common_video/incl... webrtc/common_video/include/incoming_video_stream.h:44: rtc::CriticalSection buffer_critsect_; Very nice to get rid of both this critsect and the thread below! https://codereview.webrtc.org/2716473002/diff/140001/webrtc/common_video/inco... File webrtc/common_video/incoming_video_stream.cc (right): https://codereview.webrtc.org/2716473002/diff/140001/webrtc/common_video/inco... webrtc/common_video/incoming_video_stream.cc:37: if (stream_->render_buffers_.AddFrame(std::move(frame_)) == 1) There is no check that this happens on the right thread, 'render_buffers_' have no thread/queue checks, should we add something here? Dequeue is covered below. https://codereview.webrtc.org/2716473002/diff/140001/webrtc/common_video/inco... webrtc/common_video/incoming_video_stream.cc:72: incoming_render_queue_.PostDelayedTask([this]() { Dequeue(); }, wait_time); 'wait_time' can in theory be '0, e.g. if 'OnFrame' above takes a long time, but I assume that is ok. Right? There is no unittest for that case in TaskQueue. https://codereview.webrtc.org/2716473002/diff/140001/webrtc/common_video/vide... File webrtc/common_video/video_render_frames.cc (right): https://codereview.webrtc.org/2716473002/diff/140001/webrtc/common_video/vide... webrtc/common_video/video_render_frames.cc:65: incoming_frames_.emplace_back(std::move(new_frame)); Looking through the code, I can't find a check that the render time of a new frame always is higher than existing frames. Maybe we should add a check for this? I can' fix that in a follow up otherwise,
https://codereview.webrtc.org/2716473002/diff/140001/webrtc/common_video/vide... File webrtc/common_video/video_render_frames.cc (right): https://codereview.webrtc.org/2716473002/diff/140001/webrtc/common_video/vide... webrtc/common_video/video_render_frames.cc:65: incoming_frames_.emplace_back(std::move(new_frame)); On 2017/02/23 15:23:25, mflodman wrote: > Looking through the code, I can't find a check that the render time of a new > frame always is higher than existing frames. Maybe we should add a check for > this? > > I can' fix that in a follow up otherwise, And that would be as a dcheck and not for release builds...
Address comments
https://codereview.webrtc.org/2716473002/diff/140001/webrtc/common_video/incl... File webrtc/common_video/include/incoming_video_stream.h (left): https://codereview.webrtc.org/2716473002/diff/140001/webrtc/common_video/incl... webrtc/common_video/include/incoming_video_stream.h:44: rtc::CriticalSection buffer_critsect_; On 2017/02/23 15:23:25, mflodman wrote: > Very nice to get rid of both this critsect and the thread below! hopefully there will be some performance benefits https://codereview.webrtc.org/2716473002/diff/140001/webrtc/common_video/inco... File webrtc/common_video/incoming_video_stream.cc (right): https://codereview.webrtc.org/2716473002/diff/140001/webrtc/common_video/inco... webrtc/common_video/incoming_video_stream.cc:37: if (stream_->render_buffers_.AddFrame(std::move(frame_)) == 1) On 2017/02/23 15:23:25, mflodman wrote: > There is no check that this happens on the right thread, 'render_buffers_' have > no thread/queue checks, should we add something here? Dequeue is covered below. Check added. Dequeue would have caught it, but one more check doesn't hurt. https://codereview.webrtc.org/2716473002/diff/140001/webrtc/common_video/inco... webrtc/common_video/incoming_video_stream.cc:72: incoming_render_queue_.PostDelayedTask([this]() { Dequeue(); }, wait_time); On 2017/02/23 15:23:25, mflodman wrote: > 'wait_time' can in theory be '0, e.g. if 'OnFrame' above takes a long time, but > I assume that is ok. Right? There is no unittest for that case in TaskQueue. That's ok. Also added test for TaskQueue. https://codereview.webrtc.org/2716473002/diff/140001/webrtc/common_video/vide... File webrtc/common_video/video_render_frames.cc (right): https://codereview.webrtc.org/2716473002/diff/140001/webrtc/common_video/vide... webrtc/common_video/video_render_frames.cc:65: incoming_frames_.emplace_back(std::move(new_frame)); On 2017/02/23 15:23:25, mflodman wrote: > Looking through the code, I can't find a check that the render time of a new > frame always is higher than existing frames. Maybe we should add a check for > this? > > I can' fix that in a follow up otherwise, Done. https://codereview.webrtc.org/2716473002/diff/140001/webrtc/common_video/vide... webrtc/common_video/video_render_frames.cc:65: incoming_frames_.emplace_back(std::move(new_frame)); On 2017/02/23 15:29:20, mflodman wrote: > On 2017/02/23 15:23:25, mflodman wrote: > > Looking through the code, I can't find a check that the render time of a new > > frame always is higher than existing frames. Maybe we should add a check for > > this? > > > > I can' fix that in a follow up otherwise, > > And that would be as a dcheck and not for release builds... Acknowledged.
The CQ bit was checked by tommi@webrtc.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios_dbg on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/ios_dbg/builds/23149)
https://codereview.webrtc.org/2716473002/diff/140001/webrtc/common_video/inco... File webrtc/common_video/incoming_video_stream.cc (right): https://codereview.webrtc.org/2716473002/diff/140001/webrtc/common_video/inco... webrtc/common_video/incoming_video_stream.cc:37: if (stream_->render_buffers_.AddFrame(std::move(frame_)) == 1) On 2017/02/23 19:00:08, tommi (webrtc) wrote: > On 2017/02/23 15:23:25, mflodman wrote: > > There is no check that this happens on the right thread, 'render_buffers_' > have > > no thread/queue checks, should we add something here? Dequeue is covered > below. > > Check added. Dequeue would have caught it, but one more check doesn't hurt. If render_buffers_ were empty yes, but not otherwise. But I agree that would probably be enough anyway. https://codereview.webrtc.org/2716473002/diff/140001/webrtc/common_video/inco... webrtc/common_video/incoming_video_stream.cc:72: incoming_render_queue_.PostDelayedTask([this]() { Dequeue(); }, wait_time); On 2017/02/23 19:00:08, tommi (webrtc) wrote: > On 2017/02/23 15:23:25, mflodman wrote: > > 'wait_time' can in theory be '0, e.g. if 'OnFrame' above takes a long time, > but > > I assume that is ok. Right? There is no unittest for that case in TaskQueue. > > That's ok. Also added test for TaskQueue. Thanks https://codereview.webrtc.org/2716473002/diff/160001/webrtc/common_video/vide... File webrtc/common_video/video_render_frames.cc (right): https://codereview.webrtc.org/2716473002/diff/160001/webrtc/common_video/vide... webrtc/common_video/video_render_frames.cc:69: // correctly ordered. I was thinking something easier to avoid looping over the list for each frame, something like this but before line 65: if (!incoming_frames_.empty()) RTC_DCHECK_GE(new_frame.render_time_ms(), incoming_frames_.back().render_time_ms());
Address comments
https://codereview.webrtc.org/2716473002/diff/160001/webrtc/common_video/vide... File webrtc/common_video/video_render_frames.cc (right): https://codereview.webrtc.org/2716473002/diff/160001/webrtc/common_video/vide... webrtc/common_video/video_render_frames.cc:69: // correctly ordered. On 2017/02/24 15:29:58, mflodman wrote: > I was thinking something easier to avoid looping over the list for each frame, > something like this but before line 65: > > if (!incoming_frames_.empty()) > RTC_DCHECK_GE(new_frame.render_time_ms(), > incoming_frames_.back().render_time_ms()); ah, of course. I changed the code and ran a bunch of unit tests but didn't find a single one where the list of frames contains more than one frame :-/ So, I changed the check so that in DCHECK builds, we store the last time stamp and DCHECK that new frames have a timestamp that's >= the last one.
Rebase
The CQ bit was checked by tommi@webrtc.org
The patchset sent to the CQ was uploaded after l-g-t-m from mflodman@webrtc.org Link to the patchset: https://codereview.webrtc.org/2716473002/#ps200001 (title: "Rebase")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: mac_asan on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/mac_asan/builds/22361)
Looks like this is indeed happening in a few tests and it looks kind of random on top of that: win_x64_dbg P2PTestConductor.GetGcmRecv P2PTestConductor.IceRestart P2PTestConductor.LocalP2PTestWithSpecCompliantMaxBundleOffer win_dbg P2PTestConductor.LocalP2PTestRtpDataChannel P2PTestConductor.IceRenominationEnabled mac_asan TestWithNewVideoJitterBuffer/EndToEndTest.SendsAndReceivesVP9/0 android_rel org.appspot.apprtc.test.PeerConnectionClientTest#testCameraSwitch linux_memcheck TestWithNewVideoJitterBuffer/EndToEndTest.SendsAndReceivesVP8/0 TestWithNewVideoJitterBuffer/EndToEndTest.SendsAndReceivesVP9/1 TestWithNewVideoJitterBuffer/EndToEndTest.SendsAndReceivesVP9VideoRotation9
Ignore frames from the past
The CQ bit was checked by tommi@webrtc.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
On 2017/02/24 21:43:05, tommi (webrtc) wrote: > Ignore frames from the past Magnus - can you take another look at the time stamp check? It does appear that we're getting frames from the past in some tests. There are two patches, one that has a DCHECK and another that logs a warning and drops them. The second one is the latest patch and the trybots aren't complaining fwiw.
On 2017/02/24 22:47:53, tommi (webrtc) wrote: > On 2017/02/24 21:43:05, tommi (webrtc) wrote: > > Ignore frames from the past > > Magnus - can you take another look at the time stamp check? It does appear that > we're getting frames from the past in some tests. There are two patches, one > that has a DCHECK and another that logs a warning and drops them. The second > one is the latest patch and the trybots aren't complaining fwiw. Hmm, that is weird. I'll take a look at it but given the travel I'm not sure exactly when that might be. I might ask for assistance if it won't happen soon.
On 2017/02/25 17:10:42, mflodman wrote: > On 2017/02/24 22:47:53, tommi (webrtc) wrote: > > On 2017/02/24 21:43:05, tommi (webrtc) wrote: > > > Ignore frames from the past > > > > Magnus - can you take another look at the time stamp check? It does appear > that > > we're getting frames from the past in some tests. There are two patches, one > > that has a DCHECK and another that logs a warning and drops them. The second > > one is the latest patch and the trybots aren't complaining fwiw. > > Hmm, that is weird. I'll take a look at it but given the travel I'm not sure > exactly when that might be. I might ask for assistance if it won't happen soon. I'll file a bug for it with the above info and change the DCHECK to a log for now (and not drop the frames).
LGTM
Description was changed from ========== Use TaskQueue in IncomingVideoStream instead of the PlatformThread + event timer approach. BUG=webrtc:7219 ========== to ========== Use TaskQueue in IncomingVideoStream instead of the PlatformThread + event timer approach. BUG=webrtc:7219, 7253 ==========
Description was changed from ========== Use TaskQueue in IncomingVideoStream instead of the PlatformThread + event timer approach. BUG=webrtc:7219, 7253 ========== to ========== Use TaskQueue in IncomingVideoStream instead of the PlatformThread + event timer approach. BUG=webrtc:7219, webrtc:7253 ==========
remove return statement and add TODO
ugh, looks like a pebkac
The CQ bit was checked by tommi@webrtc.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_rel on master.tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/linux_rel/builds/23635)
test pebkac again
The CQ bit was checked by tommi@webrtc.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
Remove DCHECK
Print render_time_ms instead of timestamp
The CQ bit was checked by tommi@webrtc.org
The patchset sent to the CQ was uploaded after l-g-t-m from mflodman@webrtc.org Link to the patchset: https://codereview.webrtc.org/2716473002/#ps320001 (title: "Print render_time_ms instead of timestamp")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
CQ is committing da patch. Bot data: {"patchset_id": 320001, "attempt_start_ts": 1488197778471100, "parent_rev": "21253fc2c8a06a4b144be9fa6823b063c2b2f1dc", "commit_rev": "e2d1d6429557af4560a97581a5e282b54c742173"}
Message was sent while issue was closed.
Description was changed from ========== Use TaskQueue in IncomingVideoStream instead of the PlatformThread + event timer approach. BUG=webrtc:7219, webrtc:7253 ========== to ========== Use TaskQueue in IncomingVideoStream instead of the PlatformThread + event timer approach. BUG=webrtc:7219, webrtc:7253 Review-Url: https://codereview.webrtc.org/2716473002 Cr-Commit-Position: refs/heads/master@{#16860} Committed: https://chromium.googlesource.com/external/webrtc/+/e2d1d6429557af4560a97581a... ==========
Message was sent while issue was closed.
Committed patchset #10 (id:320001) as https://chromium.googlesource.com/external/webrtc/+/e2d1d6429557af4560a97581a...
Message was sent while issue was closed.
A revert of this CL (patchset #10 id:320001) has been created in https://codereview.webrtc.org/2714393003/ by tommi@webrtc.org. The reason for reverting is: Reverting while fixing build issue in Chromium.. |