[FFmpeg-devel] [PATCH] hwcontext_vulkan: make 2 public functions always available

Anton Khirnov anton at khirnov.net
Mon Dec 6 12:31:27 EET 2021


Quoting Hendrik Leppkes (2021-12-03 14:17:44)
> On Thu, Dec 2, 2021 at 7:13 PM Andreas Rheinhardt
> <andreas.rheinhardt at outlook.com> wrote:
> >
> > Lynne:
> > > The issue is that if ffmpeg is compiled without Vulkan, and an API
> > > user includes and uses the functions exposed in hwcontext_vulkan.h,
> > > then a linking error will happen, as the hwcontext_vulkan.c file has
> > > not been compiled.
> > >
> > > Move the functions to another file, and make it always compiled. The
> > > functions do not use any Vulkan functions.
> > >
> > > Patch attached.
> > >
> > >
> >
> > 1. Isn't a linking error exactly what is intended in such cases?
> 
> Just do document what was already said on IRC:
> 
> I believe a stable ABI is important, and that includes always
> exporting the same symbols on any given platform, no matter the build
> configuration.
> That way you can use binary distributions of our libraries without
> needing to worry it was build just right, and use such optional
> features when they are functional.
> 
> It was suggested to me that I should just dlsym any "optional"
> features, but thats really forcing a lot of complexity on any user-app
> just to save a few bytes of stub functions to ensure linking or
> dynamic loading works.
> 
> I believe we have in the past included stubs for APIs that might not
> be functional at all times, and we should continue to do so and patch
> any holes that might have crept up here.

I agree with this and have added such stubs in the past.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list