[FFmpeg-devel] [PATCH] Fix libavdevice/vfwcap.c for w32api-3.12

JonY 10walls
Wed Sep 10 18:35:32 CEST 2008


Ramiro Polla wrote:
> Hello,
>
> Note I have not tested what I'm writing here since I don't have a
> Windows box atm.
>
> JonY wrote:
>> HWND_MESSAGE is now present in w32api but only exposed when WINVER is at
>> least 0x0500.
>>
>> I want to stress that vfwcap is still not buildable, it ends with
>> "error: WM_CAP_FIRSTA undeclared" when compiled with w32api-3.12.
>>
>> Defines for WM_CAP_FIRSTA == WM_CAP_START, but was undef'ed for reasons
>> unknown in "vfw.h" soon after it was defined, currently awaiting
>> explaination from the MinGW team.
>
> I screwed up when submitting the patch to MinGW. You probably have to
> remove the 3 #undefs in vfw.h which are not #undef INTERFACE.
>
>> Do we support older w32api versions? Comments?
>
> What happens with vfwcap.c the way it is and w32api-3.12?
>

vfwcap.o fails to build. The structs from vfw.h conflicts with local 
structs.

vfwcap.c:46: error: redefinition of 'struct videohdr_tag'
vfwcap.c:81: error: conflicting types for 'CAPTUREPARMS'

>> Index: libavdevice/vfwcap.c
>> ===================================================================
>> --- libavdevice/vfwcap.c	(revision 15290)
>> +++ libavdevice/vfwcap.c	(working copy)
>> @@ -19,6 +19,10 @@
>>    * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
>>    */
>>
>> +#if !defined (WINVER) || (WINVER<  0x0500)
>> +#warning vfwcap requires Windows 2000/XP
>> +#define WINVER 0x0500
>> +#endif
>
> I think there are other parts of FFmpeg that expect Windows to be
> 2000/XP already (GetProcessTimes() IIRC). Besides this shouldn't be in
> compile-time since FFmpeg specifies all the CFLAGS to be used.
>
> I haven't tested with Windows 98 for over a year now, and I don't think
> anyone cares about it anymore... I don't even know if it will refuse to
> run because of missing functions or just not work properly.
>

Good point, I haven't heard of any FFmpeg users still on 9X systems. 
Should configure add -DWINVER=0x0500 for MinGW builds?

> [...]
>> @@ -27,6 +31,7 @@
>>
>>   /* Defines for VFW missing from MinGW.
>>    * Remove this when MinGW incorporates them. */
>> +#if defined (__W32API_VERSION)&&  (__W32API_MAJOR_VERSION == 3)&&  (__W32API_MINOR_VERSION<  12)
>>   #define WM_CAP_START                (0x0400)
>>   #define WM_CAP_SET_CALLBACK_VIDEOSTREAM (WM_CAP_START + 6)
>>   #define WM_CAP_DRIVER_CONNECT       (WM_CAP_START + 10)
>> @@ -79,6 +84,7 @@
>>       BOOL  fDisableWriteCache;
>>       UINT  AVStreamMaster;
>>   } CAPTUREPARMS;
>> +#endif /* __W32API_VERSION<  3.12 */
>>   /* End of missing MinGW defines */
>>
>>   struct vfw_ctx {
>
> Well, you say it doesn't work with 3.12, so I guess we should wait for
> 3.13. In the meantime I still haven't figured out if we should just drop
> 3.12 support or work around it somehow.
>
> Ramiro Polla

Maybe we should warn users of w32api-3.12 about the problematic undefs.




More information about the ffmpeg-devel mailing list