Re: [FFmpeg-devel] [PATCH] build: restore videotoolbox compilation on iOS

2015-10-09 Thread Clément Bœsch
On Fri, Oct 02, 2015 at 12:36:54PM +0200, Clément Bœsch wrote:
> On Fri, Oct 02, 2015 at 12:20:10PM +0200, wm4 wrote:
> > On Fri, 2 Oct 2015 11:23:59 +0200
> > Clément Bœsch  wrote:
> > 
> > > On Fri, Oct 02, 2015 at 11:11:37AM +0200, wm4 wrote:
> > > [...]
> > > > > +#if HAVE_UTGETOSTYPEFROMSTRING
> > > > >  vdactx->cv_pix_fmt_type = 
> > > > > UTGetOSTypeFromString(pixfmt_str);
> > > > > +#else
> > > > > +av_log(s, loglevel, "UTGetOSTypeFromString() is not 
> > > > > available "
> > > > > +   "on this platform, %s pixel format can not be 
> > > > > honored from "
> > > > > +   "the command line\n", videotoolbox_pixfmt);
> > > > > +#endif
> > > > >  ret = av_vda_default_init2(s, vdactx);
> > > > >  CFRelease(pixfmt_str);
> > > > >  }
> > > > 
> > > > I'd question the use of this in the first place. What does it do at
> > > > all? I couldn't find documentation for this option at all.
> > > > 
> > > > You could just do a numerical conversion from FourCC or a plain numeric
> > > > value, but I question why this needs to be user-settable at all.
> > > 
> > > This is a CLI option to save a software convert by making VT outputs
> > > directly in a given pixel format (the NV12 → BGRA can be faster than
> > > swscale for instance).
> > > 
> > > So the function is just to map from the vt pixel format string (user
> > > specified) to the vt pixel format.
> > > 
> > > What we can do also is to make a mapping from our pixel format strings to
> > > the VT pixel formats, which could make more sense. But this is a behaviour
> > > change, and I'm just trying to fix the build here.
> > > 
> > 
> > Why not disable ffmpeg_videotoolbox.c on iOS then? (I don't mind either
> > way, but this fix feels slightly wrong. But I don't want to block it.)
> 
> I could do that, but it would require to add that build granularity, and I
> would still need to fix the link to the CoreServices. I don't think the
> diff will be simpler & shorter.

Applied.

-- 
Clément B.


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] build: restore videotoolbox compilation on iOS

2015-10-02 Thread Clément Bœsch
On Fri, Oct 02, 2015 at 12:20:10PM +0200, wm4 wrote:
> On Fri, 2 Oct 2015 11:23:59 +0200
> Clément Bœsch  wrote:
> 
> > On Fri, Oct 02, 2015 at 11:11:37AM +0200, wm4 wrote:
> > [...]
> > > > +#if HAVE_UTGETOSTYPEFROMSTRING
> > > >  vdactx->cv_pix_fmt_type = 
> > > > UTGetOSTypeFromString(pixfmt_str);
> > > > +#else
> > > > +av_log(s, loglevel, "UTGetOSTypeFromString() is not 
> > > > available "
> > > > +   "on this platform, %s pixel format can not be 
> > > > honored from "
> > > > +   "the command line\n", videotoolbox_pixfmt);
> > > > +#endif
> > > >  ret = av_vda_default_init2(s, vdactx);
> > > >  CFRelease(pixfmt_str);
> > > >  }
> > > 
> > > I'd question the use of this in the first place. What does it do at
> > > all? I couldn't find documentation for this option at all.
> > > 
> > > You could just do a numerical conversion from FourCC or a plain numeric
> > > value, but I question why this needs to be user-settable at all.
> > 
> > This is a CLI option to save a software convert by making VT outputs
> > directly in a given pixel format (the NV12 → BGRA can be faster than
> > swscale for instance).
> > 
> > So the function is just to map from the vt pixel format string (user
> > specified) to the vt pixel format.
> > 
> > What we can do also is to make a mapping from our pixel format strings to
> > the VT pixel formats, which could make more sense. But this is a behaviour
> > change, and I'm just trying to fix the build here.
> > 
> 
> Why not disable ffmpeg_videotoolbox.c on iOS then? (I don't mind either
> way, but this fix feels slightly wrong. But I don't want to block it.)

I could do that, but it would require to add that build granularity, and I
would still need to fix the link to the CoreServices. I don't think the
diff will be simpler & shorter.

-- 
Clément B.


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] build: restore videotoolbox compilation on iOS

2015-10-02 Thread wm4
On Fri, 2 Oct 2015 11:23:59 +0200
Clément Bœsch  wrote:

> On Fri, Oct 02, 2015 at 11:11:37AM +0200, wm4 wrote:
> [...]
> > > +#if HAVE_UTGETOSTYPEFROMSTRING
> > >  vdactx->cv_pix_fmt_type = UTGetOSTypeFromString(pixfmt_str);
> > > +#else
> > > +av_log(s, loglevel, "UTGetOSTypeFromString() is not 
> > > available "
> > > +   "on this platform, %s pixel format can not be honored 
> > > from "
> > > +   "the command line\n", videotoolbox_pixfmt);
> > > +#endif
> > >  ret = av_vda_default_init2(s, vdactx);
> > >  CFRelease(pixfmt_str);
> > >  }
> > 
> > I'd question the use of this in the first place. What does it do at
> > all? I couldn't find documentation for this option at all.
> > 
> > You could just do a numerical conversion from FourCC or a plain numeric
> > value, but I question why this needs to be user-settable at all.
> 
> This is a CLI option to save a software convert by making VT outputs
> directly in a given pixel format (the NV12 → BGRA can be faster than
> swscale for instance).
> 
> So the function is just to map from the vt pixel format string (user
> specified) to the vt pixel format.
> 
> What we can do also is to make a mapping from our pixel format strings to
> the VT pixel formats, which could make more sense. But this is a behaviour
> change, and I'm just trying to fix the build here.
> 

Why not disable ffmpeg_videotoolbox.c on iOS then? (I don't mind either
way, but this fix feels slightly wrong. But I don't want to block it.)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] build: restore videotoolbox compilation on iOS

2015-10-02 Thread Clément Bœsch
On Fri, Oct 02, 2015 at 11:11:37AM +0200, wm4 wrote:
[...]
> > +#if HAVE_UTGETOSTYPEFROMSTRING
> >  vdactx->cv_pix_fmt_type = UTGetOSTypeFromString(pixfmt_str);
> > +#else
> > +av_log(s, loglevel, "UTGetOSTypeFromString() is not available "
> > +   "on this platform, %s pixel format can not be honored 
> > from "
> > +   "the command line\n", videotoolbox_pixfmt);
> > +#endif
> >  ret = av_vda_default_init2(s, vdactx);
> >  CFRelease(pixfmt_str);
> >  }
> 
> I'd question the use of this in the first place. What does it do at
> all? I couldn't find documentation for this option at all.
> 
> You could just do a numerical conversion from FourCC or a plain numeric
> value, but I question why this needs to be user-settable at all.

This is a CLI option to save a software convert by making VT outputs
directly in a given pixel format (the NV12 → BGRA can be faster than
swscale for instance).

So the function is just to map from the vt pixel format string (user
specified) to the vt pixel format.

What we can do also is to make a mapping from our pixel format strings to
the VT pixel formats, which could make more sense. But this is a behaviour
change, and I'm just trying to fix the build here.

-- 
Clément B.


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] build: restore videotoolbox compilation on iOS

2015-10-02 Thread wm4
On Fri,  2 Oct 2015 10:36:39 +0200
Clément Bœsch  wrote:

> From: Clément Bœsch 
> 
> ---
>  configure | 11 ++-
>  ffmpeg_videotoolbox.c |  8 
>  2 files changed, 14 insertions(+), 5 deletions(-)
> 
> diff --git a/configure b/configure
> index fd39778..225e7ae 100755
> --- a/configure
> +++ b/configure
> @@ -1804,6 +1804,7 @@ SYSTEM_FUNCS="
>  sysconf
>  sysctl
>  usleep
> +UTGetOSTypeFromString
>  VirtualAlloc
>  wglGetProcAddress
>  "
> @@ -2377,11 +2378,11 @@ crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
>  d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder"
>  dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode"
>  vaapi_deps="va_va_h"
> -vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads 
> CoreServices_CoreServices_h"
> -vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration 
> -framework QuartzCore -framework CoreServices"
> +vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
> +vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration 
> -framework QuartzCore"
>  vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
> -videotoolbox_deps="VideoToolbox_VideoToolbox_h pthreads 
> CoreServices_CoreServices_h"
> -videotoolbox_extralibs="-framework CoreFoundation -framework VideoToolbox 
> -framework CoreMedia -framework QuartzCore -framework CoreServices"
> +videotoolbox_deps="VideoToolbox_VideoToolbox_h pthreads"
> +videotoolbox_extralibs="-framework CoreFoundation -framework VideoToolbox 
> -framework CoreMedia -framework QuartzCore"
>  xvmc_deps="X11_extensions_XvMClib_h"
>  
>  h263_vaapi_hwaccel_deps="vaapi"
> @@ -5109,7 +5110,6 @@ check_func_headers glob.h glob
>  enabled xlib &&
>  check_func_headers "X11/Xlib.h X11/extensions/Xvlib.h" 
> XvGetPortAttribute -lXv -lX11 -lXext
>  
> -check_header CoreServices/CoreServices.h
>  check_header direct.h
>  check_header dirent.h
>  check_header dlfcn.h
> @@ -5142,6 +5142,7 @@ check_header asm/types.h
>  check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32
>  check_lib2 "windows.h wincrypt.h" CryptGenRandom -ladvapi32
>  check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
> +check_lib "CoreServices/CoreServices.h" UTGetOSTypeFromString "-framework 
> CoreServices"
>  
>  check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
>  
> diff --git a/ffmpeg_videotoolbox.c b/ffmpeg_videotoolbox.c
> index 0bb0600..70b0d9c 100644
> --- a/ffmpeg_videotoolbox.c
> +++ b/ffmpeg_videotoolbox.c
> @@ -16,7 +16,9 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
>   */
>  
> +#if HAVE_UTGETOSTYPEFROMSTRING
>  #include 
> +#endif
>  
>  #include "config.h"
>  #include "libavcodec/avcodec.h"
> @@ -209,7 +211,13 @@ int videotoolbox_init(AVCodecContext *s)
>  CFStringRef pixfmt_str = 
> CFStringCreateWithCString(kCFAllocatorDefault,
> 
> videotoolbox_pixfmt,
> 
> kCFStringEncodingUTF8);
> +#if HAVE_UTGETOSTYPEFROMSTRING
>  vdactx->cv_pix_fmt_type = UTGetOSTypeFromString(pixfmt_str);
> +#else
> +av_log(s, loglevel, "UTGetOSTypeFromString() is not available "
> +   "on this platform, %s pixel format can not be honored 
> from "
> +   "the command line\n", videotoolbox_pixfmt);
> +#endif
>  ret = av_vda_default_init2(s, vdactx);
>  CFRelease(pixfmt_str);
>  }

I'd question the use of this in the first place. What does it do at
all? I couldn't find documentation for this option at all.

You could just do a numerical conversion from FourCC or a plain numeric
value, but I question why this needs to be user-settable at all.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel