|
|
DescriptionDesktopCaptureDevice is available when webrtc is enabled.
ENABLED_SCREEN_CAPTURE is not flag to enable DesktopCaptureDevice.
It enables DesktopCaptureDeviceAura (if use_aura=1).
Use BUILDFLAG(ENABLE_WEBRTC) instead of ENABLED_SCREEN_CAPTURE to
use DesktopCaptureDevice in VidepCaptureManager.
BUG=internal b/34176576
Review-Url: https://codereview.chromium.org/2625553003
Cr-Commit-Position: refs/heads/master@{#442957}
Committed: https://chromium.googlesource.com/chromium/src/+/c164a25463bbe2aee8e6dd4672b77afe16559ba7
Patch Set 1 #Patch Set 2 : Guard one more place with ENABLE_SCREEN_CAPTURE #
Total comments: 2
Patch Set 3 : Remove unnecessary defines #
Total comments: 1
Patch Set 4 : Use BUILDFLAG(ENABLE_WEBRTC) to use DesktopCaptureDevice #
Total comments: 7
Patch Set 5 : DesktopCaptureDevice is available when enable_webrtc=1 and enable_screen_capture=1 #Patch Set 6 : DesktopCaptureDevice is available when webrtc is enabled. #
Total comments: 2
Patch Set 7 : Fixed the comment in BUILD.gn #
Messages
Total messages: 40 (19 generated)
The CQ bit was checked by byungchul@chromium.org to run a CQ dry run
The CQ bit was unchecked by byungchul@chromium.org
The CQ bit was checked by byungchul@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...
Description was changed from ========== Disable screen capture for cast audio devices. No DesktopCaptureDevice is available for cast audio device because use_aura=0. BUG=internal b/34176576 ========== to ========== Disable screen capture for cast audio devices. No DesktopCaptureDevice is available for cast audio device because use_aura=0. BUG=internal b/34176576 ==========
byungchul@chromium.org changed reviewers: + boliu@chromium.org, slan@chromium.org
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: chromeos_amd64-generic_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) linux_chromium_compile_dbg_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL)
byungchul@chromium.org changed reviewers: + chfremer@chromium.org, mcasas@chromium.org
The CQ bit was checked by byungchul@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...
lgtm
I'll stamp after a chromecast owner approves https://codereview.chromium.org/2625553003/diff/20001/content/browser/rendere... File content/browser/renderer_host/media/video_capture_manager.cc (right): https://codereview.chromium.org/2625553003/diff/20001/content/browser/rendere... content/browser/renderer_host/media/video_capture_manager.cc:665: #if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) don't need the inner define anymore
byungchul@chromium.org changed reviewers: + halliwell@chromium.org
https://codereview.chromium.org/2625553003/diff/20001/content/browser/rendere... File content/browser/renderer_host/media/video_capture_manager.cc (right): https://codereview.chromium.org/2625553003/diff/20001/content/browser/rendere... content/browser/renderer_host/media/video_capture_manager.cc:665: #if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_WIN) On 2017/01/10 17:31:51, boliu wrote: > don't need the inner define anymore Done.
https://codereview.chromium.org/2625553003/diff/40001/content/browser/BUILD.gn File content/browser/BUILD.gn (right): https://codereview.chromium.org/2625553003/diff/40001/content/browser/BUILD.g... content/browser/BUILD.gn:1514: if ((is_linux && !(is_chromecast && is_cast_audio_only)) || is_mac || is_win) { From the CL description, it sounds like any linux build with use_aura = 0 could have this problem. Did I understand that right? If so, would it be better to generalise this to (is_linux && use_aura) ? (I'm always wary of sprinkling is_chromecast too wide)
On 2017/01/10 17:45:44, halliwell wrote: > https://codereview.chromium.org/2625553003/diff/40001/content/browser/BUILD.gn > File content/browser/BUILD.gn (right): > > https://codereview.chromium.org/2625553003/diff/40001/content/browser/BUILD.g... > content/browser/BUILD.gn:1514: if ((is_linux && !(is_chromecast && > is_cast_audio_only)) || is_mac || is_win) { > From the CL description, it sounds like any linux build with use_aura = 0 could > have this problem. Did I understand that right? If so, would it be better to > generalise this to (is_linux && use_aura) ? > > (I'm always wary of sprinkling is_chromecast too wide) It seems like linux instantiates WebContentsVideoCaptureDevice for web contents. So, aura is not mandatory for linux.
On 2017/01/10 17:52:25, byungchul wrote: > On 2017/01/10 17:45:44, halliwell wrote: > > https://codereview.chromium.org/2625553003/diff/40001/content/browser/BUILD.gn > > File content/browser/BUILD.gn (right): > > > > > https://codereview.chromium.org/2625553003/diff/40001/content/browser/BUILD.g... > > content/browser/BUILD.gn:1514: if ((is_linux && !(is_chromecast && > > is_cast_audio_only)) || is_mac || is_win) { > > From the CL description, it sounds like any linux build with use_aura = 0 > could > > have this problem. Did I understand that right? If so, would it be better to > > generalise this to (is_linux && use_aura) ? > > > > (I'm always wary of sprinkling is_chromecast too wide) > > It seems like linux instantiates WebContentsVideoCaptureDevice for web contents. > So, aura is not mandatory for linux. If the bug is that non-aura linux builds don't link, then the change should only mention use_aura (no need to mention is_chromecast).
On 2017/01/10 18:04:20, halliwell wrote: > On 2017/01/10 17:52:25, byungchul wrote: > > On 2017/01/10 17:45:44, halliwell wrote: > > > > https://codereview.chromium.org/2625553003/diff/40001/content/browser/BUILD.gn > > > File content/browser/BUILD.gn (right): > > > > > > > > > https://codereview.chromium.org/2625553003/diff/40001/content/browser/BUILD.g... > > > content/browser/BUILD.gn:1514: if ((is_linux && !(is_chromecast && > > > is_cast_audio_only)) || is_mac || is_win) { > > > From the CL description, it sounds like any linux build with use_aura = 0 > > could > > > have this problem. Did I understand that right? If so, would it be better > to > > > generalise this to (is_linux && use_aura) ? > > > > > > (I'm always wary of sprinkling is_chromecast too wide) > > > > It seems like linux instantiates WebContentsVideoCaptureDevice for web > contents. > > So, aura is not mandatory for linux. > > If the bug is that non-aura linux builds don't link, then the change should only > mention use_aura (no need to mention is_chromecast). It seems like same problem will happen when linux=1 && use_aura=0 && enable_webrtc=0. @Christian, is the condition "linux && (use_aura || enabled_webrtc)" be better?
Description was changed from ========== Disable screen capture for cast audio devices. No DesktopCaptureDevice is available for cast audio device because use_aura=0. BUG=internal b/34176576 ========== to ========== DesktopCaptureDevice is available when webrtc is enabled. ENABLED_SCREEN_CAPTURE is not flag to enable DesktopCaptureDevice. It enables DesktopCaptureDeviceAura (if use_aura=1). Use BUILDFLAG(ENABLE_WEBRTC) instead of ENABLED_SCREEN_CAPTURE to use DesktopCaptureDevice in VidepCaptureManager. BUG=internal b/34176576 ==========
byungchul@chromium.org changed reviewers: + emircan@chromium.org
On 2017/01/10 18:14:55, byungchul wrote: > On 2017/01/10 18:04:20, halliwell wrote: > > On 2017/01/10 17:52:25, byungchul wrote: > > > On 2017/01/10 17:45:44, halliwell wrote: > > > > > > https://codereview.chromium.org/2625553003/diff/40001/content/browser/BUILD.gn > > > > File content/browser/BUILD.gn (right): > > > > > > > > > > > > > > https://codereview.chromium.org/2625553003/diff/40001/content/browser/BUILD.g... > > > > content/browser/BUILD.gn:1514: if ((is_linux && !(is_chromecast && > > > > is_cast_audio_only)) || is_mac || is_win) { > > > > From the CL description, it sounds like any linux build with use_aura = 0 > > > could > > > > have this problem. Did I understand that right? If so, would it be > better > > to > > > > generalise this to (is_linux && use_aura) ? > > > > > > > > (I'm always wary of sprinkling is_chromecast too wide) > > > > > > It seems like linux instantiates WebContentsVideoCaptureDevice for web > > contents. > > > So, aura is not mandatory for linux. > > > > If the bug is that non-aura linux builds don't link, then the change should > only > > mention use_aura (no need to mention is_chromecast). > > It seems like same problem will happen when linux=1 && use_aura=0 && > enable_webrtc=0. > > @Christian, is the condition "linux && (use_aura || enabled_webrtc)" be better? PTAL I reverted BUILD.gn and modified video_capture_manager.cc only. I think this approach is better.
chfremer@chromium.org changed reviewers: + miu@chromium.org
Hmm, I feel this is somewhat going in the wrong direction. I felt okay about the slim changes to video_capture_manager.cc in the earlier 3 PatchSets, assuming that someone else would sign off on the flag usage in BUILD.gn. Moving more of the build-time logic to #ifdefs in the .cc as in PatchSet#4 seems dangerous to me. The build-time logic is getting uncomfortably scattered and hard to follow (and maybe redundant with other places that depend on the same conditions?). Ideally, we should have only _one_ feature flag ENABLE_SCREEN_CAPTURE being used in video_capture_manager.cc, and should have _one_ place in some BUILD.gn file that determines its value. If we need more fine-grained variations, we can introduce additional feature flags, and should give them revealing names and set their value in the same place as the ENABLE_SCREEN_CAPTURE flag. I feel my understanding of the existing flags is too limited to give any better advice. Therefore I would like to defer to miu@ to help us out with his knowledge of the desktop capture components. miu@ could you please help us with your input on this?
On 2017/01/10 22:08:09, chfremer wrote: > Hmm, I feel this is somewhat going in the wrong direction. > I felt okay about the slim changes to video_capture_manager.cc in the earlier 3 > PatchSets, > assuming that someone else would sign off on the flag usage in BUILD.gn. > > Moving more of the build-time logic to #ifdefs in the .cc as in PatchSet#4 seems > dangerous to me. The build-time logic is > getting uncomfortably scattered and hard to follow (and maybe redundant with > other places that depend on the same conditions?). Ideally, we should have only > _one_ feature > flag ENABLE_SCREEN_CAPTURE being used in video_capture_manager.cc, and should > have > _one_ place in some BUILD.gn file that determines its value. If we need more > fine-grained > variations, we can introduce additional feature flags, and should give them > revealing names and > set their value in the same place as the ENABLE_SCREEN_CAPTURE flag. > > I feel my understanding of the existing flags is too limited to give any better > advice. > Therefore I would like to defer to miu@ to help us out with his knowledge of the > desktop capture components. > > miu@ could you please help us with your input on this? I agree that the less flags, the better. However, this is compatible to what BUILD.gn specifies. Otherwise, you will encounter unresolved symbols with some configuration, for example, like cast audio devices which is linux=1, use_aura=1, enable_webrtc=0. So, if you feel the flags are not correct, BUILD.gn should be updated accordingly, I think.
On 2017/01/10 22:15:25, byungchul wrote: > On 2017/01/10 22:08:09, chfremer wrote: > > Hmm, I feel this is somewhat going in the wrong direction. > > I felt okay about the slim changes to video_capture_manager.cc in the earlier > 3 > > PatchSets, > > assuming that someone else would sign off on the flag usage in BUILD.gn. > > > > Moving more of the build-time logic to #ifdefs in the .cc as in PatchSet#4 > seems > > dangerous to me. The build-time logic is > > getting uncomfortably scattered and hard to follow (and maybe redundant with > > other places that depend on the same conditions?). Ideally, we should have > only > > _one_ feature > > flag ENABLE_SCREEN_CAPTURE being used in video_capture_manager.cc, and should > > have > > _one_ place in some BUILD.gn file that determines its value. If we need more > > fine-grained > > variations, we can introduce additional feature flags, and should give them > > revealing names and > > set their value in the same place as the ENABLE_SCREEN_CAPTURE flag. > > > > I feel my understanding of the existing flags is too limited to give any > better > > advice. > > Therefore I would like to defer to miu@ to help us out with his knowledge of > the > > desktop capture components. > > > > miu@ could you please help us with your input on this? > > I agree that the less flags, the better. However, this is compatible to what > BUILD.gn specifies. Otherwise, you will encounter unresolved symbols with some > configuration, for example, like cast audio devices which is linux=1, > use_aura=1, enable_webrtc=0. So, if you feel the flags are not correct, BUILD.gn > should be updated accordingly, I think. I am unable to say anything about the correctness of the flags and need to refer to miu@ for this. My concern is that having flag logic in the .cc file that has to be "compatible" or needs to "match" build logic in some BUILD.gn file sounds like redundancy, and as such a potential source of bugs when changing one site requires changing the other accordingly. Would it not be possible to have the flag logic in just one place, preferably in a BUILD.gn file?.
On 2017/01/10 22:36:31, chfremer wrote: > On 2017/01/10 22:15:25, byungchul wrote: > > On 2017/01/10 22:08:09, chfremer wrote: > > > Hmm, I feel this is somewhat going in the wrong direction. > > > I felt okay about the slim changes to video_capture_manager.cc in the > earlier > > 3 > > > PatchSets, > > > assuming that someone else would sign off on the flag usage in BUILD.gn. > > > > > > Moving more of the build-time logic to #ifdefs in the .cc as in PatchSet#4 > > seems > > > dangerous to me. The build-time logic is > > > getting uncomfortably scattered and hard to follow (and maybe redundant with > > > other places that depend on the same conditions?). Ideally, we should have > > only > > > _one_ feature > > > flag ENABLE_SCREEN_CAPTURE being used in video_capture_manager.cc, and > should > > > have > > > _one_ place in some BUILD.gn file that determines its value. If we need more > > > fine-grained > > > variations, we can introduce additional feature flags, and should give them > > > revealing names and > > > set their value in the same place as the ENABLE_SCREEN_CAPTURE flag. > > > > > > I feel my understanding of the existing flags is too limited to give any > > better > > > advice. > > > Therefore I would like to defer to miu@ to help us out with his knowledge of > > the > > > desktop capture components. > > > > > > miu@ could you please help us with your input on this? > > > > I agree that the less flags, the better. However, this is compatible to what > > BUILD.gn specifies. Otherwise, you will encounter unresolved symbols with some > > configuration, for example, like cast audio devices which is linux=1, > > use_aura=1, enable_webrtc=0. So, if you feel the flags are not correct, > BUILD.gn > > should be updated accordingly, I think. > > I am unable to say anything about the correctness of the flags and need to refer > > to miu@ for this. > > My concern is that having flag logic in the .cc file that has to be "compatible" > > or needs to "match" build logic in some BUILD.gn file sounds like redundancy, > and > as such a potential source of bugs when changing one site requires changing the > other > accordingly. Would it not be possible to have the flag logic in just one place, > preferably > in a BUILD.gn file?. I see your point. This is the typical case of your concern, breaking something by inconsistent in BUILD.gn and .cc. Usually, the pattern how to resolve this kind of issue is factory functions/classes with same signature. Unfortunately, this is not the case. Weirdly, DesktopCaptureDeviceAura is not a subclass of DesktopCaptureDevice, but both inherit media::VideoCaptureDevice.
Hi all. This change may have been necessitated by my recent change (https://codereview.chromium.org/2605973002/). There are reasons for the confusion in this file: 1. DesktopCaptureDevice's implementation depends on WebRTC (it uses code from this 3rd party lib). 2. On some platforms (Win/Linux-nonCrOS), there are situations where DesktopCaptureDeviceAura could be used, but others where DesktopCaptureDevice will have to be the fall-back. 3. I had originally envisioned that none/all devices are built into Chrome depending on the ENABLE_SCREEN_CAPTURE flag. If that flag is not being set in some circumstances where DesktopCaptureDevice can be used, then we should fix the content/browser/BUILD.gn file. I see that we should move these lines https://cs.chromium.org/chromium/src/content/browser/BUILD.gn?rcl=0&l=1503 to here: https://cs.chromium.org/chromium/src/content/browser/BUILD.gn?rcl=0&l=1542 (wrapped in a "if (enable_webrtc) {...}"). I'll make more-specific comments on the patch in just a few minutes...
https://codereview.chromium.org/2625553003/diff/60001/content/browser/rendere... File content/browser/renderer_host/media/video_capture_manager.cc (right): https://codereview.chromium.org/2625553003/diff/60001/content/browser/rendere... content/browser/renderer_host/media/video_capture_manager.cc:43: #if BUILDFLAG(ENABLE_WEBRTC) && !defined(OS_ANDROID) Both (per prior e-mail on this CR): #if defined(ENABLE_SCREEN_CAPTURE) && BUILDFLAG(ENABLE_WEBRTC) && !defined(OS_ANDROID) But, let's consolidate all of lines 43-53 as: #if defined(ENABLE_SCREEN_CAPTURE) #if BUILDFLAG(ENABLE_WEBRTC) && !defined(OS_ANDROID) #include "content/browser/media/capture/desktop_capture_device.h" #endif #if defined(USE_AURA) #include "content/browser/media/capture/desktop_capture_device_aura.h" #endif #if defined(OS_ANDROID) #include "content/browser/media/capture/screen_capture_device_android.h" #endif #endif // defined(ENABLE_SCREEN_CAPTURE) https://codereview.chromium.org/2625553003/diff/60001/content/browser/rendere... content/browser/renderer_host/media/video_capture_manager.cc:47: #if defined(ENABLE_SCREEN_CAPTURE) && !defined(OS_ANDROID) && defined(USE_AURA) !defined(OS_ANDROID) is not needed (since AURA is not built on Android). https://codereview.chromium.org/2625553003/diff/60001/content/browser/rendere... content/browser/renderer_host/media/video_capture_manager.cc:693: #if defined(ENABLE_SCREEN_CAPTURE) Let's move this back up to where it was, given previous comments (and prior e-mails). https://codereview.chromium.org/2625553003/diff/60001/content/browser/rendere... content/browser/renderer_host/media/video_capture_manager.cc:715: #if BUILDFLAG(ENABLE_WEBRTC) && !defined(OS_ANDROID) ...and move this up so that it is within the ENABLE_SCREEN_CAPTURE block.
PTAL. https://codereview.chromium.org/2625553003/diff/60001/content/browser/rendere... File content/browser/renderer_host/media/video_capture_manager.cc (right): https://codereview.chromium.org/2625553003/diff/60001/content/browser/rendere... content/browser/renderer_host/media/video_capture_manager.cc:43: #if BUILDFLAG(ENABLE_WEBRTC) && !defined(OS_ANDROID) On 2017/01/10 23:27:49, miu wrote: > Both (per prior e-mail on this CR): > > #if defined(ENABLE_SCREEN_CAPTURE) && BUILDFLAG(ENABLE_WEBRTC) && > !defined(OS_ANDROID) > > But, let's consolidate all of lines 43-53 as: > > #if defined(ENABLE_SCREEN_CAPTURE) > > #if BUILDFLAG(ENABLE_WEBRTC) && !defined(OS_ANDROID) > #include "content/browser/media/capture/desktop_capture_device.h" > #endif > > #if defined(USE_AURA) > #include "content/browser/media/capture/desktop_capture_device_aura.h" > #endif > > #if defined(OS_ANDROID) > #include "content/browser/media/capture/screen_capture_device_android.h" > #endif > > #endif // defined(ENABLE_SCREEN_CAPTURE) Done. https://codereview.chromium.org/2625553003/diff/60001/content/browser/rendere... content/browser/renderer_host/media/video_capture_manager.cc:693: #if defined(ENABLE_SCREEN_CAPTURE) On 2017/01/10 23:27:49, miu wrote: > Let's move this back up to where it was, given previous comments (and prior > e-mails). Done. https://codereview.chromium.org/2625553003/diff/60001/content/browser/rendere... content/browser/renderer_host/media/video_capture_manager.cc:715: #if BUILDFLAG(ENABLE_WEBRTC) && !defined(OS_ANDROID) On 2017/01/10 23:27:49, miu wrote: > ...and move this up so that it is within the ENABLE_SCREEN_CAPTURE block. Done.
PS6 LGTM % a minor thing: https://codereview.chromium.org/2625553003/diff/100001/content/browser/BUILD.gn File content/browser/BUILD.gn (right): https://codereview.chromium.org/2625553003/diff/100001/content/browser/BUILD.... content/browser/BUILD.gn:1505: # Desktop screen capture implementations that are not dependent on WebRTC. This comment needs a little adjusting now. Maybe it could be just: # Desktop screen capture implementations, conditionally built depending on the available implementations for each platform.
content/browser/BUILD.gn lgtm
https://codereview.chromium.org/2625553003/diff/100001/content/browser/BUILD.gn File content/browser/BUILD.gn (right): https://codereview.chromium.org/2625553003/diff/100001/content/browser/BUILD.... content/browser/BUILD.gn:1505: # Desktop screen capture implementations that are not dependent on WebRTC. On 2017/01/10 23:58:15, miu wrote: > This comment needs a little adjusting now. Maybe it could be just: > > # Desktop screen capture implementations, conditionally built depending on the > available implementations for each platform. Done.
The CQ bit was checked by byungchul@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from chfremer@chromium.org, boliu@chromium.org, miu@chromium.org Link to the patchset: https://codereview.chromium.org/2625553003/#ps120001 (title: "Fixed the comment in BUILD.gn")
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": 120001, "attempt_start_ts": 1484154805056230, "parent_rev": "3ae6c6b59c0c9a5609fb220d7c494649ad1e826a", "commit_rev": "c164a25463bbe2aee8e6dd4672b77afe16559ba7"}
Message was sent while issue was closed.
Description was changed from ========== DesktopCaptureDevice is available when webrtc is enabled. ENABLED_SCREEN_CAPTURE is not flag to enable DesktopCaptureDevice. It enables DesktopCaptureDeviceAura (if use_aura=1). Use BUILDFLAG(ENABLE_WEBRTC) instead of ENABLED_SCREEN_CAPTURE to use DesktopCaptureDevice in VidepCaptureManager. BUG=internal b/34176576 ========== to ========== DesktopCaptureDevice is available when webrtc is enabled. ENABLED_SCREEN_CAPTURE is not flag to enable DesktopCaptureDevice. It enables DesktopCaptureDeviceAura (if use_aura=1). Use BUILDFLAG(ENABLE_WEBRTC) instead of ENABLED_SCREEN_CAPTURE to use DesktopCaptureDevice in VidepCaptureManager. BUG=internal b/34176576 Review-Url: https://codereview.chromium.org/2625553003 Cr-Commit-Position: refs/heads/master@{#442957} Committed: https://chromium.googlesource.com/chromium/src/+/c164a25463bbe2aee8e6dd4672b7... ==========
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as https://chromium.googlesource.com/chromium/src/+/c164a25463bbe2aee8e6dd4672b7... |