简体   繁体   中英

Camera media source with media foundation - MS Sample code doesn't compile with Visual Studio 2013

I tried compiling this sample code with Visual Studio 2013 for Win64 (on Windows 8.1). I included mfapi.h and mfidl.h. However it gets compilation errors with identifiers not found for example:

MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE MFEnumDeviceSources

I googled, and saw mention of these features being windows 7+ specific and of a VS "platform toolset" property which is required to enable them - but this property doesn't seem to exist in VS 2013.

Any suggestions?

You have to make the C++ project a Win32 Project, not a Store App project type. If you look at mfidl.h there is a compile flag that disables all the Media Foundation DEVSOURCE attributes when it is not a desktop application, ie, WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) is only true when the project type is Win32, not Windows 8.1.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM