|
|
Created:
4 years ago by emircan Modified:
4 years ago CC:
avayvod+watch_chromium.org, chromium-reviews, darin-cc_chromium.org, feature-media-reviews_chromium.org, imcheng+watch_chromium.org, isheriff+watch_chromium.org, jam, jasonroberts+watch_google.com, mcasas+watch+vc_chromium.org, miu+watch_chromium.org, mlamouri+watch-content_chromium.org, posciak+watch_chromium.org, xjz+watch_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionMove passing of WebRTC rendering frames to IO thread
This is follow-up for CL[0] that moved passing of WebRTC rendering frames
off of main thread. That CL caused a regression in test[1] where the number
of unique frames encoded is less, suggesting that we are dropping frames.
Traces showed that compositor thread may be blocked by long texture upload
calls and frames get accumulated in the meantime. We might be dropping
frames due to the limit of having only 3 frames in flight.
This CL addresses this issue by moving these calls to IO thread directly.
In order to do it:
- FrameDeliverer classes in MediaStreamVideoRendererSink and WebMediaPlayerMS
are moved to IO thread.
- WebMediaPlayerMSCompositor::EnqueueFrame gets called on IO thread.
- Since WebMediaPlayerMSCompositor operates on three threads, I made it a ref
counted object. This way, we do not need to create multiple WeakPtr factories
or synchronize/block destruction on multiple threads.
[0] https://codereview.chromium.org/2472273002/
[1] crbug.com/667262
BUG=667262, 652923
TEST=Tested running JS alert() in console during an AppRTC loopback.
Committed: https://crrev.com/8f71ad428b65fc259b48c2a0917158a762a5e5f6
Cr-Commit-Position: refs/heads/master@{#437594}
Patch Set 1 : #
Total comments: 9
Patch Set 2 : Move to IO thread. #
Total comments: 2
Patch Set 3 : qiangchen@ comment #
Total comments: 2
Patch Set 4 : Fix unittests. #
Total comments: 2
Patch Set 5 : ncarter@ comment. #Messages
Total messages: 92 (64 generated)
Description was changed from ========== move to media thread. BUG= ========== to ========== Move passing of WebRTC rendering frames to media thread BUG= ==========
Description was changed from ========== Move passing of WebRTC rendering frames to media thread BUG= ========== to ========== Move passing of WebRTC rendering frames to media thread BUG=667262,652923 TEST= ==========
Patchset #1 (id:1) has been deleted
Patchset #1 (id:20001) has been deleted
Patchset #1 (id:40001) has been deleted
The CQ bit was checked by emircan@chromium.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.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: cast_shell_linux on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linu...)
The CQ bit was checked by emircan@chromium.org to run a CQ dry run
Patchset #1 (id:60001) has been deleted
Patchset #1 (id:80001) has been deleted
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Move passing of WebRTC rendering frames to media thread BUG=667262,652923 TEST= ========== to ========== Move passing of WebRTC rendering frames to media thread This is follow-up for CL[0] that moved passing of WebRTC rendering frames off of main thread. That CL caused a regression in test[1] where the number of unique frames encoded is less, suggesting that we are dropping frames. Traces showed that compositor thread may be blocked by long texture upload calls and frames get accumulated in the meantime. We might be dropping frames due to the limit of frames in flight. This CL addresses this issue by moving these calls to more responsice media thread. In order to do it: - FrameDeliverer classes in MediaStreamVideoRendererSink and WebMediaPlayerMS are moved to media thread. - WebMediaPlayerMSCompositor::EnqueueFrame gets called on media thread. - Since WebMediaPlayerMSCompositor operates on three threads, I made it a ref counted object. This way, we do not need to create multiple WeakPtr factories or synchronize destrcution on multiple threads. [0] https://codereview.chromium.org/2472273002/ [1] crbug.com/667262 BUG=667262,652923 TEST=Tested running JS alert() in console during an AppRTC loopback. ==========
emircan@chromium.org changed reviewers: + dalecurtis@chromium.org, mcasas@chromium.org, qiangchen@chromium.org
Description was changed from ========== Move passing of WebRTC rendering frames to media thread This is follow-up for CL[0] that moved passing of WebRTC rendering frames off of main thread. That CL caused a regression in test[1] where the number of unique frames encoded is less, suggesting that we are dropping frames. Traces showed that compositor thread may be blocked by long texture upload calls and frames get accumulated in the meantime. We might be dropping frames due to the limit of frames in flight. This CL addresses this issue by moving these calls to more responsice media thread. In order to do it: - FrameDeliverer classes in MediaStreamVideoRendererSink and WebMediaPlayerMS are moved to media thread. - WebMediaPlayerMSCompositor::EnqueueFrame gets called on media thread. - Since WebMediaPlayerMSCompositor operates on three threads, I made it a ref counted object. This way, we do not need to create multiple WeakPtr factories or synchronize destrcution on multiple threads. [0] https://codereview.chromium.org/2472273002/ [1] crbug.com/667262 BUG=667262,652923 TEST=Tested running JS alert() in console during an AppRTC loopback. ========== to ========== Move passing of WebRTC rendering frames to media thread This is follow-up for CL[0] that moved passing of WebRTC rendering frames off of main thread. That CL caused a regression in test[1] where the number of unique frames encoded is less, suggesting that we are dropping frames. Traces showed that compositor thread may be blocked by long texture upload calls and frames get accumulated in the meantime. We might be dropping frames due to the limit of having only 3 frames in flight. This CL addresses this issue by moving these calls to more responsice media thread. In order to do it: - FrameDeliverer classes in MediaStreamVideoRendererSink and WebMediaPlayerMS are moved to media thread. - WebMediaPlayerMSCompositor::EnqueueFrame gets called on media thread. - Since WebMediaPlayerMSCompositor operates on three threads, I made it a ref counted object. This way, we do not need to create multiple WeakPtr factories or synchronize destrcution on multiple threads. [0] https://codereview.chromium.org/2472273002/ [1] crbug.com/667262 BUG=667262,652923 TEST=Tested running JS alert() in console during an AppRTC loopback. ==========
Description was changed from ========== Move passing of WebRTC rendering frames to media thread This is follow-up for CL[0] that moved passing of WebRTC rendering frames off of main thread. That CL caused a regression in test[1] where the number of unique frames encoded is less, suggesting that we are dropping frames. Traces showed that compositor thread may be blocked by long texture upload calls and frames get accumulated in the meantime. We might be dropping frames due to the limit of having only 3 frames in flight. This CL addresses this issue by moving these calls to more responsice media thread. In order to do it: - FrameDeliverer classes in MediaStreamVideoRendererSink and WebMediaPlayerMS are moved to media thread. - WebMediaPlayerMSCompositor::EnqueueFrame gets called on media thread. - Since WebMediaPlayerMSCompositor operates on three threads, I made it a ref counted object. This way, we do not need to create multiple WeakPtr factories or synchronize destrcution on multiple threads. [0] https://codereview.chromium.org/2472273002/ [1] crbug.com/667262 BUG=667262,652923 TEST=Tested running JS alert() in console during an AppRTC loopback. ========== to ========== Move passing of WebRTC rendering frames to media thread This is follow-up for CL[0] that moved passing of WebRTC rendering frames off of main thread. That CL caused a regression in test[1] where the number of unique frames encoded is less, suggesting that we are dropping frames. Traces showed that compositor thread may be blocked by long texture upload calls and frames get accumulated in the meantime. We might be dropping frames due to the limit of having only 3 frames in flight. This CL addresses this issue by moving these calls to more responsive media thread. In order to do it: - FrameDeliverer classes in MediaStreamVideoRendererSink and WebMediaPlayerMS are moved to media thread. - WebMediaPlayerMSCompositor::EnqueueFrame gets called on media thread. - Since WebMediaPlayerMSCompositor operates on three threads, I made it a ref counted object. This way, we do not need to create multiple WeakPtr factories or synchronize destruction on multiple threads. [0] https://codereview.chromium.org/2472273002/ [1] crbug.com/667262 BUG=667262,652923 TEST=Tested running JS alert() in console during an AppRTC loopback. ==========
The CQ bit was checked by emircan@chromium.org to run a CQ dry run
Patchset #1 (id:100001) has been deleted
PTAL.
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Move passing of WebRTC rendering frames to media thread This is follow-up for CL[0] that moved passing of WebRTC rendering frames off of main thread. That CL caused a regression in test[1] where the number of unique frames encoded is less, suggesting that we are dropping frames. Traces showed that compositor thread may be blocked by long texture upload calls and frames get accumulated in the meantime. We might be dropping frames due to the limit of having only 3 frames in flight. This CL addresses this issue by moving these calls to more responsive media thread. In order to do it: - FrameDeliverer classes in MediaStreamVideoRendererSink and WebMediaPlayerMS are moved to media thread. - WebMediaPlayerMSCompositor::EnqueueFrame gets called on media thread. - Since WebMediaPlayerMSCompositor operates on three threads, I made it a ref counted object. This way, we do not need to create multiple WeakPtr factories or synchronize destruction on multiple threads. [0] https://codereview.chromium.org/2472273002/ [1] crbug.com/667262 BUG=667262,652923 TEST=Tested running JS alert() in console during an AppRTC loopback. ========== to ========== Move passing of WebRTC rendering frames to media thread This is follow-up for CL[0] that moved passing of WebRTC rendering frames off of main thread. That CL caused a regression in test[1] where the number of unique frames encoded is less, suggesting that we are dropping frames. Traces showed that compositor thread may be blocked by long texture upload calls and frames get accumulated in the meantime. We might be dropping frames due to the limit of having only 3 frames in flight. This CL addresses this issue by moving these calls to more responsive media thread. In order to do it: - FrameDeliverer classes in MediaStreamVideoRendererSink and WebMediaPlayerMS are moved to media thread. - WebMediaPlayerMSCompositor::EnqueueFrame gets called on media thread. - Since WebMediaPlayerMSCompositor operates on three threads, I made it a ref counted object. This way, we do not need to create multiple WeakPtr factories or synchronize/block destruction on multiple threads. [0] https://codereview.chromium.org/2472273002/ [1] crbug.com/667262 BUG=667262,652923 TEST=Tested running JS alert() in console during an AppRTC loopback. ==========
https://codereview.chromium.org/2529263004/diff/120001/content/renderer/media... File content/renderer/media/webmediaplayer_ms.h (right): https://codereview.chromium.org/2529263004/diff/120001/content/renderer/media... content/renderer/media/webmediaplayer_ms.h:223: scoped_refptr<WebMediaPlayerMSCompositor> compositor_; Can we avoid this?
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
https://codereview.chromium.org/2529263004/diff/120001/content/renderer/media... File content/renderer/media/webmediaplayer_ms.h (right): https://codereview.chromium.org/2529263004/diff/120001/content/renderer/media... content/renderer/media/webmediaplayer_ms.h:223: scoped_refptr<WebMediaPlayerMSCompositor> compositor_; On 2016/12/03 01:17:54, DaleCurtis wrote: > Can we avoid this? I can think of a way of avoiding this, but I mentioned briefly in the CL description why I preferred not to. Let me know if I am missing smt, you can think of another way or prefer this. I still need to post WebMediaPlayerMSCompositor::Enqueue frame on media_task_runner. (Main and compositor are janky, and using IO all the way here is too long of a task for IO.) If this class is not ref counted, I would need a WeakPtr to access it. Then, I would need two WeakPtrFactory's since there is already one in use for compositor thread here. In dtor(or earlier), I need to make sure that both are invalidated in their respective threads. That would require synchronization/blocking until the other is completed.
I think we've talked about using IO thread injecting frames. What's the reason you still use media thread doing that?
On 2016/12/05 16:51:58, qiangchen wrote: > I think we've talked about using IO thread injecting frames. What's the reason > you still use media thread doing that? I want to address the current regression with this CL, see https://bugs.chromium.org/p/chromium/issues/detail?id=667262#c15. If this CL does not sound like a good idea, then I have to revert my earlier CL as well and go back to square one using main thread. We cannot make a quick change to IO thread here. AFAIK from an earlier CL discussion with piman@, IO thread needs to be responsive within 10 to maybe 100µs. Also, we need to be able to send the frame to the other sink callbacks immediately using IO thread. Enqueing frames here involves acquiring a lock, reading metadata, checking state, etc. These will all take time and block the IO thread for more than necessary. We need a refactor of these classes such that pooling immediately happens on IO thread, ideally on MediaStreamVideoRendererSink, and WebMediaPlayerMSCompositor pulls frames from there. I honestly don't know the details of rendering smoothness algorithm at this point to do the refactor properly. I am currently just making a refactor of the current code. Main thread was bridging the gap between IO and compositor here; moving those tasks to compositor didn't work out; so I am proposing moving them to media thread.
Some minor suggestions. https://codereview.chromium.org/2529263004/diff/120001/content/renderer/media... File content/renderer/media/webmediaplayer_ms_compositor.cc (right): https://codereview.chromium.org/2529263004/diff/120001/content/renderer/media... content/renderer/media/webmediaplayer_ms_compositor.cc:415: void WebMediaPlayerMSCompositor::StartRenderingInternal() { I think it is better to put these two functions where they are, as it would make code review a little easier. https://codereview.chromium.org/2529263004/diff/120001/content/renderer/media... File content/renderer/media/webmediaplayer_ms_compositor.h (right): https://codereview.chromium.org/2529263004/diff/120001/content/renderer/media... content/renderer/media/webmediaplayer_ms_compositor.h:108: void SetCurrentFrame(const scoped_refptr<media::VideoFrame>& frame); Can you order this before Render function to kill this extra diff. https://codereview.chromium.org/2529263004/diff/120001/content/renderer/media... content/renderer/media/webmediaplayer_ms_compositor.h:159: bool provider_in_use_; Can you simply set video_frame_provider_client_ to nullptr in the implementation of StopUsingProvider. And thus |provider_in_use_|==true is equivalent as |video_frame_provier_client_|!=nullptr, and thus we can avoid |provider_in_use_| variable.
Is it really that expensive to run this on the IO thread? The compositor thread must also be very responsive, due to the whole UI thingy :p
On 2016/12/05 19:05:35, DaleCurtis wrote: > Is it really that expensive to run this on the IO thread? The compositor thread > must also be very responsive, due to the whole UI thingy :p I am moving tasks off of compositor thread in this CL for that exact reason :) As I pointed out before, pushing frames as it is now involves acquiring a lock, reading metadata, checking state, so I would expect this to be a significant time for IO thread in a low end machine. Let me know if you don't think media thread is appropriate for pushing frames.
Media thread is fine, but I wonder if just keeping everything on the IO thread is easier. Was there an explicit issue you moved things to the compositor thread to fix?
On 2016/12/05 21:00:29, DaleCurtis wrote: > Media thread is fine, but I wonder if just keeping everything on the IO thread > is easier. Was there an explicit issue you moved things to the compositor thread > to fix? In this earlier CL you reviewed, I moved the push frame tasks from main thread to compositor: https://codereview.chromium.org/2472273002/ The explicit issue there was that main thread can be busy/blocked due to other JS calls, i.e. GetStats(), media recorder, copying arrays. Frames would accumulate in posted tasks in the meantime and increase memory usage. If we can call WebMediaPlayerMSCompositor::EnqueueFrame reliably on a different thread, it can decide to use or discard the frames. Keeping all on IO thread is of course easier, but I believe it is too long of a task for it as I explained before.
On 2016/12/05 at 21:42:41, emircan wrote: > On 2016/12/05 21:00:29, DaleCurtis wrote: > > Media thread is fine, but I wonder if just keeping everything on the IO thread > > is easier. Was there an explicit issue you moved things to the compositor thread > > to fix? > > In this earlier CL you reviewed, I moved the push frame tasks from main thread to compositor: https://codereview.chromium.org/2472273002/ The explicit issue there was that main thread can be busy/blocked due to other JS calls, i.e. GetStats(), media recorder, copying arrays. Frames would accumulate in posted tasks in the meantime and increase memory usage. If we can call WebMediaPlayerMSCompositor::EnqueueFrame reliably on a different thread, it can decide to use or discard the frames. Keeping all on IO thread is of course easier, but I believe it is too long of a task for it as I explained before. The main thread can definitely be blocked for long periods of times due to JS, etc; but are you saying that you actually saw the IO thread being blocked for too long?
emircan@chromium.org changed reviewers: - mcasas@chromium.org
Description was changed from ========== Move passing of WebRTC rendering frames to media thread This is follow-up for CL[0] that moved passing of WebRTC rendering frames off of main thread. That CL caused a regression in test[1] where the number of unique frames encoded is less, suggesting that we are dropping frames. Traces showed that compositor thread may be blocked by long texture upload calls and frames get accumulated in the meantime. We might be dropping frames due to the limit of having only 3 frames in flight. This CL addresses this issue by moving these calls to more responsive media thread. In order to do it: - FrameDeliverer classes in MediaStreamVideoRendererSink and WebMediaPlayerMS are moved to media thread. - WebMediaPlayerMSCompositor::EnqueueFrame gets called on media thread. - Since WebMediaPlayerMSCompositor operates on three threads, I made it a ref counted object. This way, we do not need to create multiple WeakPtr factories or synchronize/block destruction on multiple threads. [0] https://codereview.chromium.org/2472273002/ [1] crbug.com/667262 BUG=667262,652923 TEST=Tested running JS alert() in console during an AppRTC loopback. ========== to ========== Move passing of WebRTC rendering frames to media thread This is follow-up for CL[0] that moved passing of WebRTC rendering frames off of main thread. That CL caused a regression in test[1] where the number of unique frames encoded is less, suggesting that we are dropping frames. Traces showed that compositor thread may be blocked by long texture upload calls and frames get accumulated in the meantime. We might be dropping frames due to the limit of having only 3 frames in flight. This CL addresses this issue by moving these calls to IO thread directly. In order to do it: - FrameDeliverer classes in MediaStreamVideoRendererSink and WebMediaPlayerMS are moved to IO thread. - WebMediaPlayerMSCompositor::EnqueueFrame gets called on IO thread. - Since WebMediaPlayerMSCompositor operates on three threads, I made it a ref counted object. This way, we do not need to create multiple WeakPtr factories or synchronize/block destruction on multiple threads. [0] https://codereview.chromium.org/2472273002/ [1] crbug.com/667262 BUG=667262,652923 TEST=Tested running JS alert() in console during an AppRTC loopback. ==========
After offline discussion, I ran a trace to see how long these tasks take on an average case. In a simple AppRTC loopback, it looks like we spend overall ~0.03 ms in these functions with details below. Note that this will scale with the number of connections. We decided that it is reasonable to use Io thread, so I updated the CL and description accordingly. PTAL again. On Macbook Air 2013: - WebMediaPlayerMSCompositor::EnqueueFrame 0.021 - WebMediaPlayerMS::OnVideoFrame 0.05 - MediaStreamVideoRendererSink::FrameDeliverer::OnVideoFrame 0.01 https://codereview.chromium.org/2529263004/diff/120001/content/renderer/media... File content/renderer/media/webmediaplayer_ms_compositor.h (right): https://codereview.chromium.org/2529263004/diff/120001/content/renderer/media... content/renderer/media/webmediaplayer_ms_compositor.h:108: void SetCurrentFrame(const scoped_refptr<media::VideoFrame>& frame); On 2016/12/05 18:54:57, qiangchen wrote: > Can you order this before Render function to kill this extra diff. I wanted to sync the order of declaration/definition in these files while I am already adding new functions. https://codereview.chromium.org/2529263004/diff/120001/content/renderer/media... content/renderer/media/webmediaplayer_ms_compositor.h:159: bool provider_in_use_; On 2016/12/05 18:54:57, qiangchen wrote: > Can you simply set video_frame_provider_client_ to nullptr in the implementation > of StopUsingProvider. And thus |provider_in_use_|==true is equivalent as > |video_frame_provier_client_|!=nullptr, and thus we can avoid |provider_in_use_| > variable. Done.
The CQ bit was checked by emircan@chromium.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.chromium.or...
https://codereview.chromium.org/2529263004/diff/120001/content/renderer/media... File content/renderer/media/webmediaplayer_ms.h (right): https://codereview.chromium.org/2529263004/diff/120001/content/renderer/media... content/renderer/media/webmediaplayer_ms.h:223: scoped_refptr<WebMediaPlayerMSCompositor> compositor_; On 2016/12/03 at 01:42:13, emircan wrote: > On 2016/12/03 01:17:54, DaleCurtis wrote: > > Can we avoid this? > > I can think of a way of avoiding this, but I mentioned briefly in the CL description why I preferred not to. Let me know if I am missing smt, you can think of another way or prefer this. > I still need to post WebMediaPlayerMSCompositor::Enqueue frame on media_task_runner. (Main and compositor are janky, and using IO all the way here is too long of a task for IO.) If this class is not ref counted, I would need a WeakPtr to access it. Then, I would need two WeakPtrFactory's since there is already one in use for compositor thread here. In dtor(or earlier), I need to make sure that both are invalidated in their respective threads. That would require synchronization/blocking until the other is completed. Is this true? Or would it be sufficient to just generate a cancellable callback you can hand out?
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: cast_shell_linux on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linu...)
https://codereview.chromium.org/2529263004/diff/120001/content/renderer/media... File content/renderer/media/webmediaplayer_ms_compositor.cc (right): https://codereview.chromium.org/2529263004/diff/120001/content/renderer/media... content/renderer/media/webmediaplayer_ms_compositor.cc:415: void WebMediaPlayerMSCompositor::StartRenderingInternal() { On 2016/12/05 18:54:57, qiangchen wrote: > I think it is better to put these two functions where they are, as it would make > code review a little easier. Acknowledged. https://codereview.chromium.org/2529263004/diff/140001/content/renderer/media... File content/renderer/media/webmediaplayer_ms_compositor.h (right): https://codereview.chromium.org/2529263004/diff/140001/content/renderer/media... content/renderer/media/webmediaplayer_ms_compositor.h:159: bool provider_in_use_; Remove this declaration, too.
The CQ bit was checked by emircan@chromium.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.chromium.or...
https://codereview.chromium.org/2529263004/diff/140001/content/renderer/media... File content/renderer/media/webmediaplayer_ms_compositor.h (right): https://codereview.chromium.org/2529263004/diff/140001/content/renderer/media... content/renderer/media/webmediaplayer_ms_compositor.h:159: bool provider_in_use_; On 2016/12/06 17:48:17, qiangchen wrote: > Remove this declaration, too. Done.
On 2016/12/06 01:00:42, DaleCurtis wrote: > https://codereview.chromium.org/2529263004/diff/120001/content/renderer/media... > File content/renderer/media/webmediaplayer_ms.h (right): > > https://codereview.chromium.org/2529263004/diff/120001/content/renderer/media... > content/renderer/media/webmediaplayer_ms.h:223: > scoped_refptr<WebMediaPlayerMSCompositor> compositor_; > On 2016/12/03 at 01:42:13, emircan wrote: > > On 2016/12/03 01:17:54, DaleCurtis wrote: > > > Can we avoid this? > > > > I can think of a way of avoiding this, but I mentioned briefly in the CL > description why I preferred not to. Let me know if I am missing smt, you can > think of another way or prefer this. > > I still need to post WebMediaPlayerMSCompositor::Enqueue frame on > media_task_runner. (Main and compositor are janky, and using IO all the way here > is too long of a task for IO.) If this class is not ref counted, I would need a > WeakPtr to access it. Then, I would need two WeakPtrFactory's since there is > already one in use for compositor thread here. In dtor(or earlier), I need to > make sure that both are invalidated in their respective threads. That would > require synchronization/blocking until the other is completed. > > Is this true? Or would it be sufficient to just generate a cancellable callback > you can hand out? CancelableCallback objects must be created on, posted to, cancelled on, and destroyed on the same thread. AFAIU, we will still have a similar problem.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
lgtm, though I'm always sad to see more scoped_refptr
A question about the newly added override function. https://codereview.chromium.org/2529263004/diff/160001/content/renderer/media... File content/renderer/media/webmediaplayer_ms.h (right): https://codereview.chromium.org/2529263004/diff/160001/content/renderer/media... content/renderer/media/webmediaplayer_ms.h:160: bool texImageImpl(TexImageFunctionID functionID, I did not see where this new function gets used.
https://codereview.chromium.org/2529263004/diff/160001/content/renderer/media... File content/renderer/media/webmediaplayer_ms.h (right): https://codereview.chromium.org/2529263004/diff/160001/content/renderer/media... content/renderer/media/webmediaplayer_ms.h:160: bool texImageImpl(TexImageFunctionID functionID, On 2016/12/07 17:44:13, qiangchen wrote: > I did not see where this new function gets used. It is added by rebase, not related to my CL.
lgtm
The CQ bit was checked by emircan@chromium.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.chromium.or...
emircan@chromium.org changed reviewers: + avi@chromium.org, mcasas@chromium.org
mcasas@chromium.org: Please review changes in content/renderer/media/* avi@chromium.org: Please review changes in content/public/renderer/*, content/renderer/* and content/shell/renderer/*
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by emircan@chromium.org to run a CQ dry run
Patchset #4 (id:180001) has been deleted
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: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_...)
The CQ bit was checked by emircan@chromium.org to run a CQ dry run
Patchset #4 (id:200001) has been deleted
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: This issue passed the CQ dry run.
On 2016/12/07 18:26:58, emircan wrote: > mailto:mcasas@chromium.org: Please review changes in content/renderer/media/* > > mailto:avi@chromium.org: Please review changes in content/public/renderer/*, > content/renderer/* and content/shell/renderer/* RS lgtm content/renderer/media/*
emircan@chromium.org changed reviewers: - avi@chromium.org
emircan@chromium.org changed reviewers: + avi@chromium.org, nick@chromium.org
It looks like avi@ is OOO. nick@chromium.org: Can you please review changes in content/public/renderer/*, content/renderer/* and content/shell/renderer/*
lgtm https://codereview.chromium.org/2529263004/diff/220001/content/renderer/media... File content/renderer/media/media_stream_video_renderer_sink.cc (right): https://codereview.chromium.org/2529263004/diff/220001/content/renderer/media... content/renderer/media/media_stream_video_renderer_sink.cc:259: io_task_runner_->PostTaskAndReply(FROM_HERE, base::Bind([] {}), This doesn't belong in the .cc file for production code; it looks like a random hack. Can you move it out to wherever you call GetStateForTesting?
The CQ bit was checked by emircan@chromium.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.chromium.or...
Thanks. https://codereview.chromium.org/2529263004/diff/220001/content/renderer/media... File content/renderer/media/media_stream_video_renderer_sink.cc (right): https://codereview.chromium.org/2529263004/diff/220001/content/renderer/media... content/renderer/media/media_stream_video_renderer_sink.cc:259: io_task_runner_->PostTaskAndReply(FROM_HERE, base::Bind([] {}), On 2016/12/08 22:43:44, ncarter wrote: > This doesn't belong in the .cc file for production code; it looks like a random > hack. Can you move it out to wherever you call GetStateForTesting? I moved it to unittest.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: 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_...)
Description was changed from ========== Move passing of WebRTC rendering frames to media thread This is follow-up for CL[0] that moved passing of WebRTC rendering frames off of main thread. That CL caused a regression in test[1] where the number of unique frames encoded is less, suggesting that we are dropping frames. Traces showed that compositor thread may be blocked by long texture upload calls and frames get accumulated in the meantime. We might be dropping frames due to the limit of having only 3 frames in flight. This CL addresses this issue by moving these calls to IO thread directly. In order to do it: - FrameDeliverer classes in MediaStreamVideoRendererSink and WebMediaPlayerMS are moved to IO thread. - WebMediaPlayerMSCompositor::EnqueueFrame gets called on IO thread. - Since WebMediaPlayerMSCompositor operates on three threads, I made it a ref counted object. This way, we do not need to create multiple WeakPtr factories or synchronize/block destruction on multiple threads. [0] https://codereview.chromium.org/2472273002/ [1] crbug.com/667262 BUG=667262,652923 TEST=Tested running JS alert() in console during an AppRTC loopback. ========== to ========== Move passing of WebRTC rendering frames to IO thread This is follow-up for CL[0] that moved passing of WebRTC rendering frames off of main thread. That CL caused a regression in test[1] where the number of unique frames encoded is less, suggesting that we are dropping frames. Traces showed that compositor thread may be blocked by long texture upload calls and frames get accumulated in the meantime. We might be dropping frames due to the limit of having only 3 frames in flight. This CL addresses this issue by moving these calls to IO thread directly. In order to do it: - FrameDeliverer classes in MediaStreamVideoRendererSink and WebMediaPlayerMS are moved to IO thread. - WebMediaPlayerMSCompositor::EnqueueFrame gets called on IO thread. - Since WebMediaPlayerMSCompositor operates on three threads, I made it a ref counted object. This way, we do not need to create multiple WeakPtr factories or synchronize/block destruction on multiple threads. [0] https://codereview.chromium.org/2472273002/ [1] crbug.com/667262 BUG=667262,652923 TEST=Tested running JS alert() in console during an AppRTC loopback. ==========
The CQ bit was checked by emircan@chromium.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.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by emircan@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from qiangchen@chromium.org, dalecurtis@chromium.org, mcasas@chromium.org, nick@chromium.org Link to the patchset: https://codereview.chromium.org/2529263004/#ps240001 (title: "ncarter@ comment.")
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": 240001, "attempt_start_ts": 1481307170188110, "parent_rev": "25c7933ac7e4e1b143fc4791648d5094e2b79418", "commit_rev": "d22f81c971f50ed62e3052de9162bba54207d16f"}
Message was sent while issue was closed.
Description was changed from ========== Move passing of WebRTC rendering frames to IO thread This is follow-up for CL[0] that moved passing of WebRTC rendering frames off of main thread. That CL caused a regression in test[1] where the number of unique frames encoded is less, suggesting that we are dropping frames. Traces showed that compositor thread may be blocked by long texture upload calls and frames get accumulated in the meantime. We might be dropping frames due to the limit of having only 3 frames in flight. This CL addresses this issue by moving these calls to IO thread directly. In order to do it: - FrameDeliverer classes in MediaStreamVideoRendererSink and WebMediaPlayerMS are moved to IO thread. - WebMediaPlayerMSCompositor::EnqueueFrame gets called on IO thread. - Since WebMediaPlayerMSCompositor operates on three threads, I made it a ref counted object. This way, we do not need to create multiple WeakPtr factories or synchronize/block destruction on multiple threads. [0] https://codereview.chromium.org/2472273002/ [1] crbug.com/667262 BUG=667262,652923 TEST=Tested running JS alert() in console during an AppRTC loopback. ========== to ========== Move passing of WebRTC rendering frames to IO thread This is follow-up for CL[0] that moved passing of WebRTC rendering frames off of main thread. That CL caused a regression in test[1] where the number of unique frames encoded is less, suggesting that we are dropping frames. Traces showed that compositor thread may be blocked by long texture upload calls and frames get accumulated in the meantime. We might be dropping frames due to the limit of having only 3 frames in flight. This CL addresses this issue by moving these calls to IO thread directly. In order to do it: - FrameDeliverer classes in MediaStreamVideoRendererSink and WebMediaPlayerMS are moved to IO thread. - WebMediaPlayerMSCompositor::EnqueueFrame gets called on IO thread. - Since WebMediaPlayerMSCompositor operates on three threads, I made it a ref counted object. This way, we do not need to create multiple WeakPtr factories or synchronize/block destruction on multiple threads. [0] https://codereview.chromium.org/2472273002/ [1] crbug.com/667262 BUG=667262,652923 TEST=Tested running JS alert() in console during an AppRTC loopback. Review-Url: https://codereview.chromium.org/2529263004 ==========
Message was sent while issue was closed.
Committed patchset #5 (id:240001)
Message was sent while issue was closed.
Description was changed from ========== Move passing of WebRTC rendering frames to IO thread This is follow-up for CL[0] that moved passing of WebRTC rendering frames off of main thread. That CL caused a regression in test[1] where the number of unique frames encoded is less, suggesting that we are dropping frames. Traces showed that compositor thread may be blocked by long texture upload calls and frames get accumulated in the meantime. We might be dropping frames due to the limit of having only 3 frames in flight. This CL addresses this issue by moving these calls to IO thread directly. In order to do it: - FrameDeliverer classes in MediaStreamVideoRendererSink and WebMediaPlayerMS are moved to IO thread. - WebMediaPlayerMSCompositor::EnqueueFrame gets called on IO thread. - Since WebMediaPlayerMSCompositor operates on three threads, I made it a ref counted object. This way, we do not need to create multiple WeakPtr factories or synchronize/block destruction on multiple threads. [0] https://codereview.chromium.org/2472273002/ [1] crbug.com/667262 BUG=667262,652923 TEST=Tested running JS alert() in console during an AppRTC loopback. Review-Url: https://codereview.chromium.org/2529263004 ========== to ========== Move passing of WebRTC rendering frames to IO thread This is follow-up for CL[0] that moved passing of WebRTC rendering frames off of main thread. That CL caused a regression in test[1] where the number of unique frames encoded is less, suggesting that we are dropping frames. Traces showed that compositor thread may be blocked by long texture upload calls and frames get accumulated in the meantime. We might be dropping frames due to the limit of having only 3 frames in flight. This CL addresses this issue by moving these calls to IO thread directly. In order to do it: - FrameDeliverer classes in MediaStreamVideoRendererSink and WebMediaPlayerMS are moved to IO thread. - WebMediaPlayerMSCompositor::EnqueueFrame gets called on IO thread. - Since WebMediaPlayerMSCompositor operates on three threads, I made it a ref counted object. This way, we do not need to create multiple WeakPtr factories or synchronize/block destruction on multiple threads. [0] https://codereview.chromium.org/2472273002/ [1] crbug.com/667262 BUG=667262,652923 TEST=Tested running JS alert() in console during an AppRTC loopback. Committed: https://crrev.com/8f71ad428b65fc259b48c2a0917158a762a5e5f6 Cr-Commit-Position: refs/heads/master@{#437594} ==========
Message was sent while issue was closed.
Patchset 5 (id:??) landed as https://crrev.com/8f71ad428b65fc259b48c2a0917158a762a5e5f6 Cr-Commit-Position: refs/heads/master@{#437594} |