Message ID | 20170224094939.12523-1-nfxjfg@googlemail.com |
---|---|
State | Accepted |
Commit | f07492e7fb6601948649ea09a25a493b3da0b75b |
Headers | show |
On Fri, 24 Feb 2017 10:49:39 +0100 wm4 <nfxjfg@googlemail.com> wrote: > Makes sure the output can be mapped as OpenGL texture. > This is what at least video players normally want. > --- > libavcodec/videotoolbox.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c > index 2ebe60fb5c..824f2d8e68 100644 > --- a/libavcodec/videotoolbox.c > +++ b/libavcodec/videotoolbox.c > @@ -477,6 +477,7 @@ static CFDictionaryRef videotoolbox_buffer_attributes_create(int width, > CFDictionarySetValue(buffer_attributes, kCVPixelBufferIOSurfacePropertiesKey, io_surface_properties); > CFDictionarySetValue(buffer_attributes, kCVPixelBufferWidthKey, w); > CFDictionarySetValue(buffer_attributes, kCVPixelBufferHeightKey, h); > + CFDictionarySetValue(buffer_attributes, kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey, kCFBooleanTrue); > > CFRelease(io_surface_properties); > CFRelease(cv_pix_fmt); Applied.
It's macOS only. For iOS, we can use kCVPixelBufferOpenGLESCompatibilityKey
On Fri, 3 Mar 2017 10:37:08 +0800
Wang Bin <wbsecg1@gmail.com> wrote:
> It's macOS only. For iOS, we can use kCVPixelBufferOpenGLESCompatibilityKey
So what happens on iOS with the current code? If it doesn't work, could
you add support for using the iOS-specific constant on iOS? (From what
I know, GLES is exclusive to iOS, while real GL is exclusive to OSX, so
maybe not a huge problem.)
> > So what happens on iOS with the current code? Compile error. VLC uses kCVPixelBufferOpenGLESCompatibilityKey for iOS and kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey for OSX. Should I send a patch?
On Fri, 3 Mar 2017 16:53:37 +0800 Wang Bin <wbsecg1@gmail.com> wrote: > > > > So what happens on iOS with the current code? > > > Compile error. VLC uses kCVPixelBufferOpenGLESCompatibilityKey for iOS and > kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey for OSX. Should I send > a patch? That would be great.
diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c index 2ebe60fb5c..824f2d8e68 100644 --- a/libavcodec/videotoolbox.c +++ b/libavcodec/videotoolbox.c @@ -477,6 +477,7 @@ static CFDictionaryRef videotoolbox_buffer_attributes_create(int width, CFDictionarySetValue(buffer_attributes, kCVPixelBufferIOSurfacePropertiesKey, io_surface_properties); CFDictionarySetValue(buffer_attributes, kCVPixelBufferWidthKey, w); CFDictionarySetValue(buffer_attributes, kCVPixelBufferHeightKey, h); + CFDictionarySetValue(buffer_attributes, kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey, kCFBooleanTrue); CFRelease(io_surface_properties); CFRelease(cv_pix_fmt);