Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(714)

Unified Diff: ui/gl/gl_image_io_surface.h

Issue 1861923002: Mac h264: Retain CVPixelBuffer inside GLImageIOSurface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix assert Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/gpu/media/vt_video_decode_accelerator_mac.cc ('k') | ui/gl/gl_image_io_surface.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_image_io_surface.h
diff --git a/ui/gl/gl_image_io_surface.h b/ui/gl/gl_image_io_surface.h
index d8b731828f26d674176401f38b89489857fed367..1df77e068892c120b2bdb5a2500c0b12018e6358 100644
--- a/ui/gl/gl_image_io_surface.h
+++ b/ui/gl/gl_image_io_surface.h
@@ -5,6 +5,7 @@
#ifndef UI_GL_GL_IMAGE_IO_SURFACE_H_
#define UI_GL_GL_IMAGE_IO_SURFACE_H_
+#include <CoreVideo/CVPixelBuffer.h>
#include <IOSurface/IOSurface.h>
#include <stdint.h>
@@ -31,6 +32,14 @@ class GL_EXPORT GLImageIOSurface : public GLImage {
gfx::GenericSharedMemoryId io_surface_id,
gfx::BufferFormat format);
+ // IOSurfaces coming from video decode are wrapped in a CVPixelBuffer
+ // and may be discarded if the owning CVPixelBuffer is destroyed. This
+ // initialization will ensure that the CVPixelBuffer be retained for the
+ // lifetime of the GLImage.
+ bool InitializeWithCVPixelBuffer(CVPixelBufferRef cv_pixel_buffer,
+ gfx::GenericSharedMemoryId io_surface_id,
+ gfx::BufferFormat format);
+
// Overridden from GLImage:
void Destroy(bool have_context) override;
gfx::Size GetSize() override;
@@ -52,6 +61,7 @@ class GL_EXPORT GLImageIOSurface : public GLImage {
gfx::GenericSharedMemoryId io_surface_id() const { return io_surface_id_; }
base::ScopedCFTypeRef<IOSurfaceRef> io_surface();
+ base::ScopedCFTypeRef<CVPixelBufferRef> cv_pixel_buffer();
static void SetLayerForWidget(gfx::AcceleratedWidget widget, CALayer* layer);
@@ -65,6 +75,7 @@ class GL_EXPORT GLImageIOSurface : public GLImage {
const unsigned internalformat_;
gfx::BufferFormat format_;
base::ScopedCFTypeRef<IOSurfaceRef> io_surface_;
+ base::ScopedCFTypeRef<CVPixelBufferRef> cv_pixel_buffer_;
gfx::GenericSharedMemoryId io_surface_id_;
base::ThreadChecker thread_checker_;
« no previous file with comments | « content/common/gpu/media/vt_video_decode_accelerator_mac.cc ('k') | ui/gl/gl_image_io_surface.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698