Purpose: Made minor changes to get the decklink avdevice code to build using Visual C++. Notes: Made changes to configure per Hendrik Leppkes's review of first and second versions of patch. Also made slight alterations per Marton Balint's reviews. Comments: -- configure: Added if enabled decklink section and setting decklink_indev_extralibs and decklink_outdev_extralibs here for both mingw and Windows. Also eliminated the setting of these variables in the mingw section earlier in the file. -- libavdevice/decklink_common.cpp: Switched the order of the include of libavformat/internal.h to workaround build issues with Visual C++. See comment in file for more details. -- libavdevice/decklink_dec.cpp: a) Rearranged the include of libavformat/internal.h (for reasons as described above). b) Made slight alteration to an argument for call to av_rescale_q() to workaround a compiler error with Visual C++. This appears to only be an issue when building C++ files with Visual C++. See comment in code for more details. -- libavdevice/decklink_enc.cpp: Rearranged the include of libavformat/internal.h (for reasons as described above).
Showing the changes to libavdevice/decklink_common.cpp (1 of 4 files). Show all
Unified · Split
| @@ -19,6 +19,12 @@ · 18 unmodified lines | ||
| 19 | 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 | 20 | */ |
| 21 | 21 | |
| 22 | +/* Include internal.h first to avoid conflict between winsock.h (used by | |
| 23 | + * DeckLink headers) and winsock2.h (used by libavformat) in MSVC++ builds */ | |
| 24 | +extern "C" { | |
| 25 | +#include "libavformat/internal.h" | |
| 26 | +} | |
| 27 | + | |
| 22 | 28 | #include <DeckLinkAPI.h> |
| 23 | 29 | #ifdef _WIN32 |
| 24 | 30 | #include <DeckLinkAPI_i.c> |
| @@ -28,7 +34,6 @@ · 3 unmodified lines | ||
| 28 | 34 | |
| 29 | 35 | extern "C" { |
| 30 | 36 | #include "libavformat/avformat.h" |
| 31 | −#include "libavformat/internal.h" | |
| 32 | 37 | #include "libavutil/imgutils.h" |
| 33 | 38 | #include "libavutil/intreadwrite.h" |
| 34 | 39 | #include "libavutil/bswap.h" |