[FFmpeg-devel] [PATCH v2 17/33] avdevice/dshow: discover source color range/space/etc

Michael Niedermayer michael at niedermayer.cc
Mon Jun 14 19:56:00 EEST 2021


On Fri, Jun 11, 2021 at 10:30:48PM +0200, Diederick Niehorster wrote:
> Enabled discovering a DirectShow device's color range, space, primaries,
> transfer characteristics and chroma location, if the device exposes that
> information. Sets them in the stream's codecpars.
> 
> Signed-off-by: Diederick Niehorster <dcnieho at gmail.com>
> Co-authored-by: Valerii Zapodovnikov <val.zapod.vz at gmail.com>
> Signed-off-by: Diederick Niehorster <dcnieho at gmail.com>
> ---
>  libavdevice/dshow.c | 250 +++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 249 insertions(+), 1 deletion(-)

breaks build on mingw64

make
CC	libavdevice/dshow.o
src/libavdevice/dshow.c: In function ‘dshow_get_device_media_types’:
src/libavdevice/dshow.c:415:23: warning: unused variable ‘ctx’ [-Wunused-variable]
     struct dshow_ctx *ctx = avctx->priv_data;
                       ^~~
src/libavdevice/dshow.c: In function ‘dshow_get_device_list’:
src/libavdevice/dshow.c:662:23: warning: unused variable ‘ctx’ [-Wunused-variable]
     struct dshow_ctx *ctx = avctx->priv_data;
                       ^~~
src/libavdevice/dshow.c: In function ‘dshow_cycle_formats’:
src/libavdevice/dshow.c:731:13: error: unknown type name ‘DXVA_ExtendedFormat’; did you mean ‘DXVA2_ExtendedFormat’?
             DXVA_ExtendedFormat *extended_format_info = NULL;
             ^~~~~~~~~~~~~~~~~~~
             DXVA2_ExtendedFormat
src/libavdevice/dshow.c:744:41: error: ‘AMCONTROL_COLORINFO_PRESENT’ undeclared (first use in this function)
                 if (v->dwControlFlags & AMCONTROL_COLORINFO_PRESENT)
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
src/libavdevice/dshow.c:744:41: note: each undeclared identifier is reported only once for each function it appears in
src/libavdevice/dshow.c:745:45: error: ‘DXVA_ExtendedFormat’ undeclared (first use in this function); did you mean ‘DXVA2_ExtendedFormat’?
                     extended_format_info = (DXVA_ExtendedFormat*)&v->dwControlFlags;
                                             ^~~~~~~~~~~~~~~~~~~
                                             DXVA2_ExtendedFormat
src/libavdevice/dshow.c:745:65: error: expected expression before ‘)’ token
                     extended_format_info = (DXVA_ExtendedFormat*)&v->dwControlFlags;
                                                                 ^
src/libavdevice/dshow.c:768:69: warning: passing argument 1 of ‘dshow_color_range’ from incompatible pointer type [-Wincompatible-pointer-types]
                     enum AVColorRange col_range = dshow_color_range(extended_format_info);
                                                                     ^~~~~~~~~~~~~~~~~~~~
src/libavdevice/dshow.c:77:26: note: expected ‘DXVA2_ExtendedFormat * {aka struct _DXVA2_ExtendedFormat *}’ but argument is of type ‘int *’
 static enum AVColorRange dshow_color_range(DXVA2_ExtendedFormat* fmt_info)
                          ^~~~~~~~~~~~~~~~~
src/libavdevice/dshow.c:769:69: warning: passing argument 1 of ‘dshow_color_space’ from incompatible pointer type [-Wincompatible-pointer-types]
                     enum AVColorSpace col_space = dshow_color_space(extended_format_info);
                                                                     ^~~~~~~~~~~~~~~~~~~~
src/libavdevice/dshow.c:101:26: note: expected ‘DXVA2_ExtendedFormat * {aka struct _DXVA2_ExtendedFormat *}’ but argument is of type ‘int *’
 static enum AVColorSpace dshow_color_space(DXVA2_ExtendedFormat* fmt_info)
                          ^~~~~~~~~~~~~~~~~
src/libavdevice/dshow.c:770:76: warning: passing argument 1 of ‘dshow_color_primaries’ from incompatible pointer type [-Wincompatible-pointer-types]
                     enum AVColorPrimaries col_prim = dshow_color_primaries(extended_format_info);
                                                                            ^~~~~~~~~~~~~~~~~~~~
src/libavdevice/dshow.c:156:30: note: expected ‘DXVA2_ExtendedFormat * {aka struct _DXVA2_ExtendedFormat *}’ but argument is of type ‘int *’
 static enum AVColorPrimaries dshow_color_primaries(DXVA2_ExtendedFormat* fmt_info)
                              ^~~~~~~~~~~~~~~~~~~~~
src/libavdevice/dshow.c:771:82: warning: passing argument 1 of ‘dshow_color_trc’ from incompatible pointer type [-Wincompatible-pointer-types]
                     enum AVColorTransferCharacteristic col_trc = dshow_color_trc(extended_format_info);
                                                                                  ^~~~~~~~~~~~~~~~~~~~
src/libavdevice/dshow.c:193:43: note: expected ‘DXVA2_ExtendedFormat * {aka struct _DXVA2_ExtendedFormat *}’ but argument is of type ‘int *’
 static enum AVColorTransferCharacteristic dshow_color_trc(DXVA2_ExtendedFormat* fmt_info)
                                           ^~~~~~~~~~~~~~~
src/libavdevice/dshow.c:772:73: warning: passing argument 1 of ‘dshow_chroma_loc’ from incompatible pointer type [-Wincompatible-pointer-types]
                     enum AVChromaLocation chroma_loc = dshow_chroma_loc(extended_format_info);
                                                                         ^~~~~~~~~~~~~~~~~~~~
src/libavdevice/dshow.c:248:30: note: expected ‘DXVA2_ExtendedFormat * {aka struct _DXVA2_ExtendedFormat *}’ but argument is of type ‘int *’
 static enum AVChromaLocation dshow_chroma_loc(DXVA2_ExtendedFormat* fmt_info)
                              ^~~~~~~~~~~~~~~~
src/libavdevice/dshow.c: In function ‘dshow_add_device’:
src/libavdevice/dshow.c:1474:9: error: unknown type name ‘DXVA_ExtendedFormat’; did you mean ‘DXVA2_ExtendedFormat’?
         DXVA_ExtendedFormat* extended_format_info = NULL;
         ^~~~~~~~~~~~~~~~~~~
         DXVA2_ExtendedFormat
src/libavdevice/dshow.c:1484:37: error: ‘AMCONTROL_COLORINFO_PRESENT’ undeclared (first use in this function)
             if (v->dwControlFlags & AMCONTROL_COLORINFO_PRESENT)
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
src/libavdevice/dshow.c:1485:41: error: ‘DXVA_ExtendedFormat’ undeclared (first use in this function); did you mean ‘DXVA2_ExtendedFormat’?
                 extended_format_info = (DXVA_ExtendedFormat*)&v->dwControlFlags;
                                         ^~~~~~~~~~~~~~~~~~~
                                         DXVA2_ExtendedFormat
src/libavdevice/dshow.c:1485:61: error: expected expression before ‘)’ token
                 extended_format_info = (DXVA_ExtendedFormat*)&v->dwControlFlags;
                                                             ^
src/libavdevice/dshow.c:1505:50: warning: passing argument 1 of ‘dshow_color_range’ from incompatible pointer type [-Wincompatible-pointer-types]
             par->color_range = dshow_color_range(extended_format_info);
                                                  ^~~~~~~~~~~~~~~~~~~~
src/libavdevice/dshow.c:77:26: note: expected ‘DXVA2_ExtendedFormat * {aka struct _DXVA2_ExtendedFormat *}’ but argument is of type ‘int *’
 static enum AVColorRange dshow_color_range(DXVA2_ExtendedFormat* fmt_info)
                          ^~~~~~~~~~~~~~~~~
src/libavdevice/dshow.c:1506:50: warning: passing argument 1 of ‘dshow_color_space’ from incompatible pointer type [-Wincompatible-pointer-types]
             par->color_space = dshow_color_space(extended_format_info);
                                                  ^~~~~~~~~~~~~~~~~~~~
src/libavdevice/dshow.c:101:26: note: expected ‘DXVA2_ExtendedFormat * {aka struct _DXVA2_ExtendedFormat *}’ but argument is of type ‘int *’
 static enum AVColorSpace dshow_color_space(DXVA2_ExtendedFormat* fmt_info)
                          ^~~~~~~~~~~~~~~~~
src/libavdevice/dshow.c:1507:58: warning: passing argument 1 of ‘dshow_color_primaries’ from incompatible pointer type [-Wincompatible-pointer-types]
             par->color_primaries = dshow_color_primaries(extended_format_info);
                                                          ^~~~~~~~~~~~~~~~~~~~
src/libavdevice/dshow.c:156:30: note: expected ‘DXVA2_ExtendedFormat * {aka struct _DXVA2_ExtendedFormat *}’ but argument is of type ‘int *’
 static enum AVColorPrimaries dshow_color_primaries(DXVA2_ExtendedFormat* fmt_info)
                              ^~~~~~~~~~~~~~~~~~~~~
src/libavdevice/dshow.c:1508:46: warning: passing argument 1 of ‘dshow_color_trc’ from incompatible pointer type [-Wincompatible-pointer-types]
             par->color_trc = dshow_color_trc(extended_format_info);
                                              ^~~~~~~~~~~~~~~~~~~~
src/libavdevice/dshow.c:193:43: note: expected ‘DXVA2_ExtendedFormat * {aka struct _DXVA2_ExtendedFormat *}’ but argument is of type ‘int *’
 static enum AVColorTransferCharacteristic dshow_color_trc(DXVA2_ExtendedFormat* fmt_info)
                                           ^~~~~~~~~~~~~~~
src/libavdevice/dshow.c:1509:53: warning: passing argument 1 of ‘dshow_chroma_loc’ from incompatible pointer type [-Wincompatible-pointer-types]
             par->chroma_location = dshow_chroma_loc(extended_format_info);
                                                     ^~~~~~~~~~~~~~~~~~~~
src/libavdevice/dshow.c:248:30: note: expected ‘DXVA2_ExtendedFormat * {aka struct _DXVA2_ExtendedFormat *}’ but argument is of type ‘int *’
 static enum AVChromaLocation dshow_chroma_loc(DXVA2_ExtendedFormat* fmt_info)
                              ^~~~~~~~~~~~~~~~
src/ffbuild/common.mak:67: recipe for target 'libavdevice/dshow.o' failed
make: *** [libavdevice/dshow.o] Error 1


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20210614/3df6d871/attachment.sig>


More information about the ffmpeg-devel mailing list