| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
constexpr StorageType storage = STORAGE_MAPPABLE_SHARED_IMAGE;This now gets set for non-linear buffers. A lot of places check for this StorageType either directly or through `VideoFrame::HasMappableSharedImage()`, and they may assume it is mappable/linear and call SharedImage::Map() and that will fail. Could you take a look and see if that's possible? In that case, I'm wondering if we should add another StorageType to distinguish between the two. Adding vasilyt@ for input as well.
Regardless, just to be safe this change should be behind a FeatureFlag that is ENABLED_BY_DEFAULT.
native_pixmap_handle.modifier != gfx::NativePixmapHandle::kNoModifier;nit: Also check that the modifier is not `kLinear` since for those we want to keep the size check.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
constexpr StorageType storage = STORAGE_MAPPABLE_SHARED_IMAGE;This now gets set for non-linear buffers. A lot of places check for this StorageType either directly or through `VideoFrame::HasMappableSharedImage()`, and they may assume it is mappable/linear and call SharedImage::Map() and that will fail. Could you take a look and see if that's possible? In that case, I'm wondering if we should add another StorageType to distinguish between the two. Adding vasilyt@ for input as well.
Regardless, just to be safe this change should be behind a FeatureFlag that is ENABLED_BY_DEFAULT.
I went through the callers. The only frames this lets through come from MappableSharedImageVideoFramePool in kPreferSharedImageWithNativeHandle mode, and since crrev.com/c/8220427 those are already SCANOUT buffers that aren't CPU-mappable, single-plane tiled ones included, so non-linear STORAGE_MAPPABLE_SHARED_IMAGE frames exist today without this change. The capturer doesn't map them: it skips CPU overlays and letterboxing when HasMappableSharedImage() is true, and delivers them only as a GpuMemoryBufferHandle through CloneHandleForDelivery(). Nothing in Chromium requests that mode, so the consumer is the embedder importing the dma-buf. I agree a separate storage type, or a way to tell non-mappable frames apart, would make this clearer, but I think it's a separate change from this one, since it's about the native-handle mode as a whole. Happy to hear what vasilyt@ thinks.
Put it behind kVideoFrameAuxiliaryPixmapPlanes, enabled by default.
native_pixmap_handle.modifier != gfx::NativePixmapHandle::kNoModifier;nit: Also check that the modifier is not `kLinear` since for those we want to keep the size check.
Done, and the rejection test covers a linear modifier too.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Commit-Queue | +1 |
BASE_FEATURE(kVideoFrameAuxiliaryPixmapPlanes,nit: Since this is only used on Linux/ChromeOS, let's guard it here as well.
constexpr StorageType storage = STORAGE_MAPPABLE_SHARED_IMAGE;Kristof ImeriThis now gets set for non-linear buffers. A lot of places check for this StorageType either directly or through `VideoFrame::HasMappableSharedImage()`, and they may assume it is mappable/linear and call SharedImage::Map() and that will fail. Could you take a look and see if that's possible? In that case, I'm wondering if we should add another StorageType to distinguish between the two. Adding vasilyt@ for input as well.
Regardless, just to be safe this change should be behind a FeatureFlag that is ENABLED_BY_DEFAULT.
I went through the callers. The only frames this lets through come from MappableSharedImageVideoFramePool in kPreferSharedImageWithNativeHandle mode, and since crrev.com/c/8220427 those are already SCANOUT buffers that aren't CPU-mappable, single-plane tiled ones included, so non-linear STORAGE_MAPPABLE_SHARED_IMAGE frames exist today without this change. The capturer doesn't map them: it skips CPU overlays and letterboxing when HasMappableSharedImage() is true, and delivers them only as a GpuMemoryBufferHandle through CloneHandleForDelivery(). Nothing in Chromium requests that mode, so the consumer is the embedder importing the dma-buf. I agree a separate storage type, or a way to tell non-mappable frames apart, would make this clearer, but I think it's a separate change from this one, since it's about the native-handle mode as a whole. Happy to hear what vasilyt@ thinks.
Put it behind kVideoFrameAuxiliaryPixmapPlanes, enabled by default.
Okay, it makes sense since it is used for only MappableSIVFPool path which passes SCANOUT. I was more concerned that all existing callers of WrapMappableSharedImage would now allow non-linear buffers with this change, but that doesn't seem possible since creating a MappableBuffer with NativePixmap [would fail](https://source.chromium.org/chromium/chromium/src/+/main:ui/gfx/linux/client_native_pixmap_factory_dmabuf.cc;l=80-81;drc=e53e5009a806f9dbc2fb7fca2543326f3c644611;bpv=1;bpt=1) in such a case for buffers with CPU usage, so that seems okay. Thanks for putting behind flag as well.
native_pixmap_handle.modifier != DRM_FORMAT_MOD_LINEAR;nit: This can be `gfx::NativePixmapHandle::kLinearModifier`, then you don't need to include drm_fourcc.h or make BUILD file changes anymore.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
const bool has_auxiliary_planes =`FrameSinkVideoCapturerImpl` delivers frames via `VideoBufferHandle`, so it bypasses video frame deserialization.
However, `media::VerifyGpuMemoryBufferHandle()` still requires the native pixmap handle to have the same number of planes as `num_planes`, so passing one of these video farmes over mojom or CreateGpuMemoryBufferHandle() / CreateNativePixmapDmaBuf() will still fail.
Worth noting in the CL description or tracking in a follow-up if those paths might see these frames.
native_pixmap_handle.modifier != DRM_FORMAT_MOD_LINEAR;Nit: `gfx::NativePixmapHandle::kLinearModifier` is already defined in `ui/gfx/native_pixmap_handle.h` (and `static_assert`ed to equal `DRM_FORMAT_MOD_LINEAR` in `ui/gfx/native_pixmap_handle.cc`), right next to `kNoModifier`.
Using `kLinearModifier` here and in `video_frame_unittest.cc` avoids adding `<drm_fourcc.h>` and the `//build/config/linux/libdrm` deps in `media/base/BUILD.gn`.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
nit: Since this is only used on Linux/ChromeOS, let's guard it here as well.
Done.
`FrameSinkVideoCapturerImpl` delivers frames via `VideoBufferHandle`, so it bypasses video frame deserialization.
However, `media::VerifyGpuMemoryBufferHandle()` still requires the native pixmap handle to have the same number of planes as `num_planes`, so passing one of these video farmes over mojom or CreateGpuMemoryBufferHandle() / CreateNativePixmapDmaBuf() will still fail.
Worth noting in the CL description or tracking in a follow-up if those paths might see these frames.
Good point, VerifyGpuMemoryBufferHandle() would still reject these. I added a note about it to the CL description. The capturer path this fixes doesn't go through it, so I'd leave those paths for a follow-up if they turn out to see such frames.
native_pixmap_handle.modifier != DRM_FORMAT_MOD_LINEAR;Nit: `gfx::NativePixmapHandle::kLinearModifier` is already defined in `ui/gfx/native_pixmap_handle.h` (and `static_assert`ed to equal `DRM_FORMAT_MOD_LINEAR` in `ui/gfx/native_pixmap_handle.cc`), right next to `kNoModifier`.
Using `kLinearModifier` here and in `video_frame_unittest.cc` avoids adding `<drm_fourcc.h>` and the `//build/config/linux/libdrm` deps in `media/base/BUILD.gn`.
Done, thanks. That drops the drm_fourcc.h include and the BUILD.gn change.
native_pixmap_handle.modifier != DRM_FORMAT_MOD_LINEAR;nit: This can be `gfx::NativePixmapHandle::kLinearModifier`, then you don't need to include drm_fourcc.h or make BUILD file changes anymore.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Could someone submit this to CQ when they get a chance? Thanks!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |