[FFmpeg-devel] [PATCH] Fix build with --disable-swscale
Måns Rullgård
mans
Fri May 7 18:41:10 CEST 2010
Vladimir Pantelic <pan at nt.tu-darmstadt.de> writes:
> Mans Rullgard wrote:
>> ---
>> cmdutils.c | 2 ++
>> 1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/cmdutils.c b/cmdutils.c
>> index 7a58cea..3e47fce 100644
>> --- a/cmdutils.c
>> +++ b/cmdutils.c
>> @@ -609,6 +609,7 @@ void show_pix_fmts(void)
>> "FLAGS NAME NB_COMPONENTS BITS_PER_PIXEL\n"
>> "-----\n");
>>
>> +#if CONFIG_SWSCALE
>> for (pix_fmt = 0; pix_fmt< PIX_FMT_NB; pix_fmt++) {
>> const AVPixFmtDescriptor *pix_desc =&av_pix_fmt_descriptors[pix_fmt];
>> printf("%c%c%c%c%c %-16s %d %2d\n",
>> @@ -621,6 +622,7 @@ void show_pix_fmts(void)
>> pix_desc->nb_components,
>> av_get_bits_per_pixel(pix_desc));
>> }
>> +#endif
>
> that #ifdefs away a bit too much, no?
Yeah, just realised that.
> see attached that also takes care about bitstream filters and protocols...
>
>
> Index: cmdutils.c
> ===================================================================
> --- cmdutils.c (revision 23034)
> +++ cmdutils.c (working copy)
> @@ -570,8 +570,10 @@
> AVBitStreamFilter *bsf=NULL;
>
> printf("Bitstream filters:\n");
> +#if CONFIG_BSFS
> while((bsf = av_bitstream_filter_next(bsf)))
> printf("%s\n", bsf->name);
> +#endif
> printf("\n");
> }
>
> @@ -580,8 +582,10 @@
> URLProtocol *up=NULL;
>
> printf("Supported file protocols:\n");
> +#if CONFIG_PROTOCOLS
> while((up = av_protocol_next(up)))
> printf("%s\n", up->name);
> +#endif
> }
>
> void show_filters(void)
Those look OK to me.
> @@ -612,8 +616,13 @@
> for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++) {
> const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[pix_fmt];
> printf("%c%c%c%c%c %-16s %d %2d\n",
> +#if CONFIG_SWSCALE
> sws_isSupportedInput (pix_fmt) ? 'I' : '.',
> sws_isSupportedOutput(pix_fmt) ? 'O' : '.',
> +#else
> + '.',
> + '.'
> +#endif
> pix_desc->flags & PIX_FMT_HWACCEL ? 'H' : '.',
> pix_desc->flags & PIX_FMT_PAL ? 'P' : '.',
> pix_desc->flags & PIX_FMT_BITSTREAM ? 'B' : '.',
Alternative:
diff --git a/cmdutils.c b/cmdutils.c
index 7a58cea..80917c3 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -609,6 +609,11 @@ void show_pix_fmts(void)
"FLAGS NAME NB_COMPONENTS BITS_PER_PIXEL\n"
"-----\n");
+#if !CONFIG_SWSCALE
+# define sws_isSupportedInput(x) 0
+# define sws_isSupportedOutput(x) 0
+#endif
+
for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++) {
const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[pix_fmt];
printf("%c%c%c%c%c %-16s %d %2d\n",
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list