Re: [FFmpeg-devel] [PATCH] lavc/videotoolbox: set kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey

2017-03-06 Thread wm4
On Fri, 3 Mar 2017 18:16:18 +0800
Wang Bin  wrote:

> From 011d03c4d2b6b138de539dcf5019169781ee7fb2 Mon Sep 17 00:00:00 2001
> From: wang-bin 
> Date: Fri, 3 Mar 2017 18:10:54 +0800
> Subject: [PATCH] avcodec/videotoolbox: set
>  kCVPixelBufferOpenGLESCompatibilityKey for iOS
> 
> kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey is not available in
> iOS
> ---
>  libavcodec/videotoolbox.c | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
> index 824f2d8e68..9199b02055 100644
> --- a/libavcodec/videotoolbox.c
> +++ b/libavcodec/videotoolbox.c
> @@ -31,6 +31,7 @@
>  #include "bytestream.h"
>  #include "h264dec.h"
>  #include "mpegvideo.h"
> +#include 
> 
>  #ifndef kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder
>  #  define
> kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder
> CFSTR("RequireHardwareAcceleratedVideoDecoder")
> @@ -477,7 +478,11 @@ 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);
> +#if TARGET_OS_IPHONE
> +CFDictionarySetValue(buffer_attributes,
> kCVPixelBufferOpenGLESCompatibilityKey, kCFBooleanTrue);
> +#else
>  CFDictionarySetValue(buffer_attributes,
> kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey, kCFBooleanTrue);
> +#endif
> 
>  CFRelease(io_surface_properties);
>  CFRelease(cv_pix_fmt);

Applied.

The patch was broken by auto-wrapping in your mail client. I managed to
fix it, but please use git send-email next time, or attach it as
attachment.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavc/videotoolbox: set kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey

2017-03-03 Thread wm4
On Fri, 3 Mar 2017 18:16:18 +0800
Wang Bin  wrote:

> From 011d03c4d2b6b138de539dcf5019169781ee7fb2 Mon Sep 17 00:00:00 2001
> From: wang-bin 
> Date: Fri, 3 Mar 2017 18:10:54 +0800
> Subject: [PATCH] avcodec/videotoolbox: set
>  kCVPixelBufferOpenGLESCompatibilityKey for iOS
> 
> kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey is not available in
> iOS
> ---
>  libavcodec/videotoolbox.c | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
> index 824f2d8e68..9199b02055 100644
> --- a/libavcodec/videotoolbox.c
> +++ b/libavcodec/videotoolbox.c
> @@ -31,6 +31,7 @@
>  #include "bytestream.h"
>  #include "h264dec.h"
>  #include "mpegvideo.h"
> +#include 
> 
>  #ifndef kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder
>  #  define
> kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder
> CFSTR("RequireHardwareAcceleratedVideoDecoder")
> @@ -477,7 +478,11 @@ 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);
> +#if TARGET_OS_IPHONE
> +CFDictionarySetValue(buffer_attributes,
> kCVPixelBufferOpenGLESCompatibilityKey, kCFBooleanTrue);
> +#else
>  CFDictionarySetValue(buffer_attributes,
> kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey, kCFBooleanTrue);
> +#endif
> 
>  CFRelease(io_surface_properties);
>  CFRelease(cv_pix_fmt);

We use this TARGET_ stuff in some other source files too, so LGTM.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavc/videotoolbox: set kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey

2017-03-03 Thread Wang Bin
From 011d03c4d2b6b138de539dcf5019169781ee7fb2 Mon Sep 17 00:00:00 2001
From: wang-bin 
Date: Fri, 3 Mar 2017 18:10:54 +0800
Subject: [PATCH] avcodec/videotoolbox: set
 kCVPixelBufferOpenGLESCompatibilityKey for iOS

kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey is not available in
iOS
---
 libavcodec/videotoolbox.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index 824f2d8e68..9199b02055 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -31,6 +31,7 @@
 #include "bytestream.h"
 #include "h264dec.h"
 #include "mpegvideo.h"
+#include 

 #ifndef kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder
 #  define
kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder
CFSTR("RequireHardwareAcceleratedVideoDecoder")
@@ -477,7 +478,11 @@ 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);
+#if TARGET_OS_IPHONE
+CFDictionarySetValue(buffer_attributes,
kCVPixelBufferOpenGLESCompatibilityKey, kCFBooleanTrue);
+#else
 CFDictionarySetValue(buffer_attributes,
kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey, kCFBooleanTrue);
+#endif

 CFRelease(io_surface_properties);
 CFRelease(cv_pix_fmt);
-- 
2.11.1
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavc/videotoolbox: set kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey

2017-03-03 Thread wm4
On Fri, 3 Mar 2017 16:53:37 +0800
Wang Bin  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.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavc/videotoolbox: set kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey

2017-03-03 Thread Wang Bin
>
> 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?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavc/videotoolbox: set kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey

2017-03-02 Thread wm4
On Fri, 3 Mar 2017 10:37:08 +0800
Wang Bin  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.)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavc/videotoolbox: set kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey

2017-03-02 Thread Wang Bin
It's macOS only. For iOS, we can use kCVPixelBufferOpenGLESCompatibilityKey
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavc/videotoolbox: set kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey

2017-03-02 Thread wm4
On Fri, 24 Feb 2017 10:49:39 +0100
wm4  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.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] lavc/videotoolbox: set kCVPixelBufferIOSurfaceOpenGLTextureCompatibilityKey

2017-02-24 Thread wm4
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);
-- 
2.11.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel