diff options
Diffstat (limited to 'devel/electron29/files/patch-media_base_video__frame.cc')
-rw-r--r-- | devel/electron29/files/patch-media_base_video__frame.cc | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/devel/electron29/files/patch-media_base_video__frame.cc b/devel/electron29/files/patch-media_base_video__frame.cc new file mode 100644 index 000000000000..719b47a156b8 --- /dev/null +++ b/devel/electron29/files/patch-media_base_video__frame.cc @@ -0,0 +1,74 @@ +--- media/base/video_frame.cc.orig 2024-02-21 00:20:48 UTC ++++ media/base/video_frame.cc +@@ -80,7 +80,7 @@ std::string VideoFrame::StorageTypeToString( + return "OWNED_MEMORY"; + case VideoFrame::STORAGE_SHMEM: + return "SHMEM"; +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + case VideoFrame::STORAGE_DMABUFS: + return "DMABUFS"; + #endif +@@ -95,7 +95,7 @@ bool VideoFrame::IsStorageTypeMappable(VideoFrame::Sto + // static + bool VideoFrame::IsStorageTypeMappable(VideoFrame::StorageType storage_type) { + return +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + // This is not strictly needed but makes explicit that, at VideoFrame + // level, DmaBufs are not mappable from userspace. + storage_type != VideoFrame::STORAGE_DMABUFS && +@@ -306,7 +306,7 @@ static absl::optional<VideoFrameLayout> GetDefaultLayo + return VideoFrameLayout::CreateWithPlanes(format, coded_size, planes); + } + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + // This class allows us to embed a vector<ScopedFD> into a scoped_refptr, and + // thus to have several VideoFrames share the same set of DMABUF FDs. + class VideoFrame::DmabufHolder +@@ -636,7 +636,7 @@ scoped_refptr<VideoFrame> VideoFrame::WrapExternalGpuM + for (size_t i = 0; i < num_planes; ++i) + planes[i].stride = gpu_memory_buffer->stride(i); + uint64_t modifier = gfx::NativePixmapHandle::kNoModifier; +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + if (gpu_memory_buffer->GetType() == gfx::NATIVE_PIXMAP) { + const auto gmb_handle = gpu_memory_buffer->CloneHandle(); + if (gmb_handle.is_null() || +@@ -682,7 +682,7 @@ scoped_refptr<VideoFrame> VideoFrame::WrapExternalGpuM + return frame; + } + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + // static + scoped_refptr<VideoFrame> VideoFrame::WrapExternalDmabufs( + const VideoFrameLayout& layout, +@@ -901,7 +901,7 @@ scoped_refptr<VideoFrame> VideoFrame::WrapVideoFrame( + } + } + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + DCHECK(frame->dmabuf_fds_); + // If there are any |dmabuf_fds_| plugged in, we should refer them too. + wrapping_frame->dmabuf_fds_ = frame->dmabuf_fds_; +@@ -1312,7 +1312,7 @@ const gpu::MailboxHolder& VideoFrame::mailbox_holder( + : mailbox_holders_[texture_index]; + } + +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + size_t VideoFrame::NumDmabufFds() const { + return dmabuf_fds_->size(); + } +@@ -1429,7 +1429,7 @@ VideoFrame::VideoFrame(const VideoFrameLayout& layout, + storage_type_(storage_type), + visible_rect_(Intersection(visible_rect, gfx::Rect(layout.coded_size()))), + natural_size_(natural_size), +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + dmabuf_fds_(base::MakeRefCounted<DmabufHolder>()), + #endif + timestamp_(timestamp), |