|
|
Chromium Code Reviews|
Created:
4 years, 9 months ago by jensf Modified:
4 years, 7 months ago CC:
chromium-reviews, posciak+watch_chromium.org, feature-media-reviews_chromium.org, mcasas+watch_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionUse the encoded video mode for capture setup of decklink devices.
The user selects a combination of vide device name and video mode containing the
resolution, framerate and interlaced/progressive information.
I changed the capture setup routine to use device-videomode combination instead
of the given constraints in the parameters. In the parameters, the i/p
information is not available, so for a video signal of e.g. 1080p50 the capture
was setup with 1080i50 which showed a black screen only.
fixed selection of video mode for decklink capture devices in getUserMedia.
BUG=603027
Patch Set 1 #
Total comments: 8
Patch Set 2 : update code style #
Total comments: 4
Patch Set 3 : update code style #Patch Set 4 : updated code style the next #Messages
Total messages: 17 (5 generated)
j.goo.fischer@googlemail.com changed reviewers: + davve@opera.com
I've made a change to the decklink media capture for mac such that the video format given in the device name will be used for capture instead of these given in the requested capabilities. Would you have a look on this and see if it can be integrated into the main version?
On 2016/04/06 10:33:57, jensf wrote: > Would you have a look on this and see if it can be integrated into the main > version? I don't think I'm a good reviewer for this change. Please see the corresponding OWNERS file or use 'git cl owners'.
j.goo.fischer@googlemail.com changed reviewers: + mcasas@chromium.org - davve@opera.com
had to modify the reviewers
Description was changed from ========== Use the encoded video mode for capture setup of decklink devices. The user selects a combination of vide device name and video mode containing the resolution, framerate and interlaced/progressive information. I changed the capture setup routine to use device-videomode combination instead of the given constraints in the parameters. In the parameters, the i/p information is not available, so for a video signal of e.g. 1080p50 the capture was setup with 1080i50 which showed a black screen only. fixed selection of video mode for decklink capture devices in getUserMedia. BUG= ========== to ========== Use the encoded video mode for capture setup of decklink devices. The user selects a combination of vide device name and video mode containing the resolution, framerate and interlaced/progressive information. I changed the capture setup routine to use device-videomode combination instead of the given constraints in the parameters. In the parameters, the i/p information is not available, so for a video signal of e.g. 1080p50 the capture was setup with 1080i50 which showed a black screen only. fixed selection of video mode for decklink capture devices in getUserMedia. BUG= ==========
j.goo.fischer@googlemail.com changed reviewers: + perkj@chromium.org, tommi@chromium.org
A few comments. I'm also wary that you're changing this functionality completely - would there be a way to have a fallback to the existing ToT behaviour if the names do not include resolution&frame rates? Also, this CL needs a BUG= and a TEST= detailing under which conditions is this tested and what issues are being addressed. https://codereview.chromium.org/1806883004/diff/1/media/capture/video/mac/vid... File media/capture/video/mac/video_capture_device_decklink_mac.mm (right): https://codereview.chromium.org/1806883004/diff/1/media/capture/video/mac/vid... media/capture/video/mac/video_capture_device_decklink_mac.mm:17: static std::string JoinDeviceNameAndFormat(CFStringRef name, If this function is only used in this file, we can stuff it in the anonymous namespace, right? https://codereview.chromium.org/1806883004/diff/1/media/capture/video/mac/vid... media/capture/video/mac/video_capture_device_decklink_mac.mm:143: if (!decklink_iter.get()) { No {} for one-line bodies. https://codereview.chromium.org/1806883004/diff/1/media/capture/video/mac/vid... media/capture/video/mac/video_capture_device_decklink_mac.mm:155: CFStringRef device_model_name = NULL; nullptr? nil? https://codereview.chromium.org/1806883004/diff/1/media/capture/video/mac/vid... media/capture/video/mac/video_capture_device_decklink_mac.mm:157: DVLOG_IF(1, hr != S_OK) << "Error reading Blackmagic device model name"; Consider DLOG_IF(ERROR,...
Description was changed from ========== Use the encoded video mode for capture setup of decklink devices. The user selects a combination of vide device name and video mode containing the resolution, framerate and interlaced/progressive information. I changed the capture setup routine to use device-videomode combination instead of the given constraints in the parameters. In the parameters, the i/p information is not available, so for a video signal of e.g. 1080p50 the capture was setup with 1080i50 which showed a black screen only. fixed selection of video mode for decklink capture devices in getUserMedia. BUG= ========== to ========== Use the encoded video mode for capture setup of decklink devices. The user selects a combination of vide device name and video mode containing the resolution, framerate and interlaced/progressive information. I changed the capture setup routine to use device-videomode combination instead of the given constraints in the parameters. In the parameters, the i/p information is not available, so for a video signal of e.g. 1080p50 the capture was setup with 1080i50 which showed a black screen only. fixed selection of video mode for decklink capture devices in getUserMedia. BUG=603027 ==========
On 2016/04/12 17:54:42, mcasas wrote: > A few comments. I'm also wary that you're > changing this functionality completely - > would there be a way to have a fallback to > the existing ToT behaviour if the names do > not include resolution&frame rates? The device names are generated in the same file (VideoCaptureDeviceDeckLinkMac::EnumerateDevices see device_names->push_back(..) ) with the corresponding video format - so restoring the old behavior without modification does not make much sense. It may be possible to rewrite the device detection to only include the device name and on activation to try to find the video mode from the given constraints. This will be a much larger change and I'm not aware of any constraint for the progressive/interlaced format selection. > Also, this CL needs a BUG= and a TEST= > detailing under which conditions is this > tested and what issues are being addressed. Just filed a bug report. Don't know how to get a TEST= ? Updated the code style as you mentioned and submitted a new patch. > https://codereview.chromium.org/1806883004/diff/1/media/capture/video/mac/vid... > media/capture/video/mac/video_capture_device_decklink_mac.mm:157: DVLOG_IF(1, hr > != S_OK) << "Error reading Blackmagic device model name"; > Consider DLOG_IF(ERROR,... I just used the logging commands which were present before. Have not looked up the macro here to avoid the magic numbers. Kind regards Jens
On 2016/04/13 14:33:38, jensf wrote: > On 2016/04/12 17:54:42, mcasas wrote: > > A few comments. I'm also wary that you're > > changing this functionality completely - > > would there be a way to have a fallback to > > the existing ToT behaviour if the names do > > not include resolution&frame rates? > > The device names are generated in the same > file (VideoCaptureDeviceDeckLinkMac::EnumerateDevices see > device_names->push_back(..) ) with the corresponding video format - so > restoring > the old behavior without modification does not make much sense. > > It may be possible to rewrite the device detection to only include the device > name and on activation to try to find the video mode from the given > constraints. This will be a much larger change and I'm not aware of any > constraint for the progressive/interlaced format selection. > > > Also, this CL needs a BUG= and a TEST= > > detailing under which conditions is this > > tested and what issues are being addressed. > > Just filed a bug report. Don't know how to get a TEST= ? > Just write in a TEST= line what you did to test that this was working, by hand or otherwise. > Updated the code style as you mentioned and submitted a new patch. > > > > https://codereview.chromium.org/1806883004/diff/1/media/capture/video/mac/vid... > > media/capture/video/mac/video_capture_device_decklink_mac.mm:157: DVLOG_IF(1, > hr > > != S_OK) << "Error reading Blackmagic device model name"; > > Consider DLOG_IF(ERROR,... > > I just used the logging commands which were present before. Have not looked up > the macro here to avoid the magic numbers. > > Kind regards Jens It's customary to click on every comment and mark it as "Done" or comment on it, then click on "Publish and mail comments" and write PTAL, so reviewers get it in their email inbox. I have a question on the overall approach. IIRC, the Blackmagic/Decklink devices I tested would only work with a certain resolution+framerate (a mode) that is marked by the external device. The enumeration would display (many) more modes which would not work. Am I right to understand that with this CL any other mode would also work, beside the one provided by the external capture device? Or is the goal to address just the interlaced/progressive issue mentioned in the description?
https://codereview.chromium.org/1806883004/diff/20001/media/capture/video/mac... File media/capture/video/mac/video_capture_device_decklink_mac.mm (right): https://codereview.chromium.org/1806883004/diff/20001/media/capture/video/mac... media/capture/video/mac/video_capture_device_decklink_mac.mm:155: DVLOG_IF(1, hr != S_OK) << "Error reading Blackmagic device model name"; DLOG_IF(ERROR, condition) here and elsewhere. https://codereview.chromium.org/1806883004/diff/20001/media/capture/video/mac... media/capture/video/mac/video_capture_device_decklink_mac.mm:156: CFStringRef device_display_name = NULL; Actually CFStringRef is a C++ construct, so it should be nullptr, here and in l.153 etc.
all code style problems should be solved now https://codereview.chromium.org/1806883004/diff/1/media/capture/video/mac/vid... File media/capture/video/mac/video_capture_device_decklink_mac.mm (right): https://codereview.chromium.org/1806883004/diff/1/media/capture/video/mac/vid... media/capture/video/mac/video_capture_device_decklink_mac.mm:17: static std::string JoinDeviceNameAndFormat(CFStringRef name, On 2016/04/12 17:54:42, mcasas wrote: > If this function is only used in this file, we can > stuff it in the anonymous namespace, right? Done. https://codereview.chromium.org/1806883004/diff/1/media/capture/video/mac/vid... media/capture/video/mac/video_capture_device_decklink_mac.mm:143: if (!decklink_iter.get()) { On 2016/04/12 17:54:42, mcasas wrote: > No {} for one-line bodies. Done. https://codereview.chromium.org/1806883004/diff/1/media/capture/video/mac/vid... media/capture/video/mac/video_capture_device_decklink_mac.mm:155: CFStringRef device_model_name = NULL; On 2016/04/12 17:54:42, mcasas wrote: > nullptr? nil? Done. https://codereview.chromium.org/1806883004/diff/1/media/capture/video/mac/vid... media/capture/video/mac/video_capture_device_decklink_mac.mm:157: DVLOG_IF(1, hr != S_OK) << "Error reading Blackmagic device model name"; On 2016/04/12 17:54:42, mcasas wrote: > Consider DLOG_IF(ERROR,... Done. https://codereview.chromium.org/1806883004/diff/20001/media/capture/video/mac... File media/capture/video/mac/video_capture_device_decklink_mac.mm (right): https://codereview.chromium.org/1806883004/diff/20001/media/capture/video/mac... media/capture/video/mac/video_capture_device_decklink_mac.mm:155: DVLOG_IF(1, hr != S_OK) << "Error reading Blackmagic device model name"; On 2016/04/19 21:53:32, mcasas wrote: > DLOG_IF(ERROR, condition) here and > elsewhere. Done. https://codereview.chromium.org/1806883004/diff/20001/media/capture/video/mac... media/capture/video/mac/video_capture_device_decklink_mac.mm:156: CFStringRef device_display_name = NULL; On 2016/04/19 21:53:32, mcasas wrote: > Actually CFStringRef is a C++ construct, so > it should be nullptr, here and in l.153 etc. Done.
> It's customary to click on every comment and > mark it as "Done" or comment on it, then click > on "Publish and mail comments" and write PTAL, > so reviewers get it in their email inbox. Sorry this is my first contribution to Chromium. Thanks for your patience. > I have a question on the overall approach. IIRC, > the Blackmagic/Decklink devices I tested would > only work with a certain resolution+framerate > (a mode) that is marked by the external device. > The enumeration would display (many) more modes > which would not work. Am I right to understand > that with this CL any other mode would also work, > beside the one provided by the external capture > device? Or is the goal to address just the > interlaced/progressive issue mentioned in the > description? Your right the devices deliver exactly that mode which is connected to the input. There is no way to specify any conversion. If the wrong mode is selected the driver returns a black frame. (Even worse with some HDMI signals the colorspace is some RGBA and not YUV any more and you have to select and handle the incoming data differently, unfortunately this is not addressed in my approach) With recent SDKs and drivers some of the devices from Blackmagic does support auto-detection of the connected signals. For now my approach was to let the user exactly set the mode which is connected because this will work well for all devices. For a more sophisticated approach one has to utilize the auto-detection on devices which supports that and some other method to make the other devices do work.
On 2016/04/21 07:50:52, jensf wrote: > > It's customary to click on every comment and > > mark it as "Done" or comment on it, then click > > on "Publish and mail comments" and write PTAL, > > so reviewers get it in their email inbox. > > Sorry this is my first contribution to Chromium. Thanks > for your patience. > No worries! > > > I have a question on the overall approach. IIRC, > > the Blackmagic/Decklink devices I tested would > > only work with a certain resolution+framerate > > (a mode) that is marked by the external device. > > The enumeration would display (many) more modes > > which would not work. Am I right to understand > > that with this CL any other mode would also work, > > beside the one provided by the external capture > > device? Or is the goal to address just the > > interlaced/progressive issue mentioned in the > > description? > > > Your right the devices deliver exactly that mode which is connected to the > input. There is no way to specify any conversion. If the wrong mode is selected > the driver returns a black frame. (Even worse with some HDMI signals the > colorspace is some RGBA and not YUV any more and you have to select and handle > the incoming data differently, unfortunately this is not addressed in my > approach) > > With recent SDKs and drivers some of the devices from Blackmagic does support > auto-detection of the connected signals. For now my approach was to let the user > exactly set the mode which is connected because this will work well for all > devices. > > For a more sophisticated approach one has to utilize the auto-detection on > devices which supports that and some other method to make the other devices do > work. I see. Then I have a suggestion for an alternative implementation: Extend JoinDeviceAndFormat() to add an indication of the scanning method (progressive or interlaced), possibly in between the name and the format name around l.371 [1]. Then fill in that field with a stringified indication of the said scanning mode that can be read from |display_mode| by calling GetFieldDominance() [2]. This is for enumeration, then on AllocateAndStart() also take that scanning mode into account. WDYT? [1] https://code.google.com/p/chromium/codesearch#chromium/src/media/capture/vide... [2] https://code.google.com/p/chromium/codesearch#chromium/src/third_party/deckli...
On 2016/04/21 15:06:57, mcasas wrote: > On 2016/04/21 07:50:52, jensf wrote: > > > It's customary to click on every comment and > > > mark it as "Done" or comment on it, then click > > > on "Publish and mail comments" and write PTAL, > > > so reviewers get it in their email inbox. > > > > Sorry this is my first contribution to Chromium. Thanks > > for your patience. > > > > No worries! > > > > > > I have a question on the overall approach. IIRC, > > > the Blackmagic/Decklink devices I tested would > > > only work with a certain resolution+framerate > > > (a mode) that is marked by the external device. > > > The enumeration would display (many) more modes > > > which would not work. Am I right to understand > > > that with this CL any other mode would also work, > > > beside the one provided by the external capture > > > device? Or is the goal to address just the > > > interlaced/progressive issue mentioned in the > > > description? > > > > > > Your right the devices deliver exactly that mode which is connected to the > > input. There is no way to specify any conversion. If the wrong mode is > selected > > the driver returns a black frame. (Even worse with some HDMI signals the > > colorspace is some RGBA and not YUV any more and you have to select and handle > > the incoming data differently, unfortunately this is not addressed in my > > approach) > > > > With recent SDKs and drivers some of the devices from Blackmagic does support > > auto-detection of the connected signals. For now my approach was to let the > user > > exactly set the mode which is connected because this will work well for all > > devices. > > > > For a more sophisticated approach one has to utilize the auto-detection on > > devices which supports that and some other method to make the other devices do > > work. > > I see. Then I have a suggestion for an alternative > implementation: > > Extend JoinDeviceAndFormat() to add an indication of the > scanning method (progressive or interlaced), possibly in > between the name and the format name around l.371 [1]. > Then fill in that field with a stringified indication of the > said scanning mode that can be read from |display_mode| > by calling GetFieldDominance() [2]. This is for enumeration, > then on AllocateAndStart() also take that scanning mode > into account. WDYT? > > > [1] > https://code.google.com/p/chromium/codesearch#chromium/src/media/capture/vide... > [2] > https://code.google.com/p/chromium/codesearch#chromium/src/third_party/deckli... And?
On 2016/04/27 02:36:05, mcasas wrote: > On 2016/04/21 15:06:57, mcasas wrote: > > On 2016/04/21 07:50:52, jensf wrote: > > > > It's customary to click on every comment and > > > > mark it as "Done" or comment on it, then click > > > > on "Publish and mail comments" and write PTAL, > > > > so reviewers get it in their email inbox. > > > > > > Sorry this is my first contribution to Chromium. Thanks > > > for your patience. > > > > > > > No worries! > > > > > > > > > I have a question on the overall approach. IIRC, > > > > the Blackmagic/Decklink devices I tested would > > > > only work with a certain resolution+framerate > > > > (a mode) that is marked by the external device. > > > > The enumeration would display (many) more modes > > > > which would not work. Am I right to understand > > > > that with this CL any other mode would also work, > > > > beside the one provided by the external capture > > > > device? Or is the goal to address just the > > > > interlaced/progressive issue mentioned in the > > > > description? > > > > > > > > > Your right the devices deliver exactly that mode which is connected to the > > > input. There is no way to specify any conversion. If the wrong mode is > > selected > > > the driver returns a black frame. (Even worse with some HDMI signals the > > > colorspace is some RGBA and not YUV any more and you have to select and > handle > > > the incoming data differently, unfortunately this is not addressed in my > > > approach) > > > > > > With recent SDKs and drivers some of the devices from Blackmagic does > support > > > auto-detection of the connected signals. For now my approach was to let the > > user > > > exactly set the mode which is connected because this will work well for all > > > devices. > > > > > > For a more sophisticated approach one has to utilize the auto-detection on > > > devices which supports that and some other method to make the other devices > do > > > work. > > > > I see. Then I have a suggestion for an alternative > > implementation: > > > > Extend JoinDeviceAndFormat() to add an indication of the > > scanning method (progressive or interlaced), possibly in > > between the name and the format name around l.371 [1]. > > Then fill in that field with a stringified indication of the > > said scanning mode that can be read from |display_mode| > > by calling GetFieldDominance() [2]. This is for enumeration, > > then on AllocateAndStart() also take that scanning mode > > into account. WDYT? > > > > > > [1] > > > https://code.google.com/p/chromium/codesearch#chromium/src/media/capture/vide... > > [2] > > > https://code.google.com/p/chromium/codesearch#chromium/src/third_party/deckli... > > And? Ping. |
