aboutsummaryrefslogtreecommitdiff
path: root/www/chromium/files/patch-media_base_video__frame.cc
diff options
context:
space:
mode:
Diffstat (limited to 'www/chromium/files/patch-media_base_video__frame.cc')
-rw-r--r--www/chromium/files/patch-media_base_video__frame.cc59
1 files changed, 16 insertions, 43 deletions
diff --git a/www/chromium/files/patch-media_base_video__frame.cc b/www/chromium/files/patch-media_base_video__frame.cc
index 3dcfb3ce24b1..16692d1e511f 100644
--- a/www/chromium/files/patch-media_base_video__frame.cc
+++ b/www/chromium/files/patch-media_base_video__frame.cc
@@ -1,6 +1,6 @@
---- media/base/video_frame.cc.orig 2022-05-19 14:06:27 UTC
+--- media/base/video_frame.cc.orig 2025-10-30 15:44:36 UTC
+++ media/base/video_frame.cc
-@@ -72,7 +72,7 @@ std::string VideoFrame::StorageTypeToString(
+@@ -86,7 +86,7 @@ std::string VideoFrame::StorageTypeToString(
return "OWNED_MEMORY";
case VideoFrame::STORAGE_SHMEM:
return "SHMEM";
@@ -9,7 +9,7 @@
case VideoFrame::STORAGE_DMABUFS:
return "DMABUFS";
#endif
-@@ -89,7 +89,7 @@ std::string VideoFrame::StorageTypeToString(
+@@ -100,7 +100,7 @@ std::string VideoFrame::StorageTypeToString(
// static
bool VideoFrame::IsStorageTypeMappable(VideoFrame::StorageType storage_type) {
return
@@ -18,57 +18,30 @@
// This is not strictly needed but makes explicit that, at VideoFrame
// level, DmaBufs are not mappable from userspace.
storage_type != VideoFrame::STORAGE_DMABUFS &&
-@@ -285,7 +285,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
-@@ -624,7 +624,7 @@ scoped_refptr<VideoFrame> VideoFrame::WrapExternalGpuM
- for (size_t i = 0; i < num_planes; ++i)
- planes[i].stride = gpu_memory_buffer->stride(i);
+@@ -395,7 +395,7 @@ scoped_refptr<VideoFrame> VideoFrame::CreateFrameForMa
+ plane_size.width() * VideoFrame::BytesPerElement(*format, plane);
+ }
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() ||
-@@ -670,7 +670,7 @@ scoped_refptr<VideoFrame> VideoFrame::WrapExternalGpuM
- return frame;
+ bool is_native_buffer = !shared_image->IsSharedMemoryForVideoFrame();
+ if (is_native_buffer) {
+ const auto gmb_handle = shared_image->CloneGpuMemoryBufferHandle();
+@@ -852,7 +852,7 @@ scoped_refptr<VideoFrame> VideoFrame::WrapExternalGpuM
}
+ #endif
-#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,
-@@ -894,7 +894,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_;
-@@ -1265,7 +1265,7 @@ const gpu::MailboxHolder& VideoFrame::mailbox_holder(
- : mailbox_holders_[texture_index];
+@@ -1539,7 +1539,7 @@ scoped_refptr<gpu::ClientSharedImage> VideoFrame::shar
+ return wrapped_frame_ ? wrapped_frame_->shared_image() : shared_image_;
}
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
- const std::vector<base::ScopedFD>& VideoFrame::DmabufFds() const {
- DCHECK_EQ(storage_type_, STORAGE_DMABUFS);
-
-@@ -1377,7 +1377,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),
+ size_t VideoFrame::NumDmabufFds() const {
+ if (wrapped_frame_) {
+ return wrapped_frame_->NumDmabufFds();