mirror of
https://github.com/zebrajr/opencv.git
synced 2025-12-06 12:19:50 +01:00
Merge pull request #27948 from vrabaud:c_headers
Get code to compile without FFmpeg's libavdevice
This commit is contained in:
commit
c69e20a495
|
|
@ -1170,7 +1170,9 @@ bool CvCapture_FFMPEG::open(const char* _filename, int index, const Ptr<IStreamR
|
||||||
input_format = av_find_input_format(entry->value);
|
input_format = av_find_input_format(entry->value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_FFMPEG_LIBAVDEVICE
|
||||||
AVDeviceInfoList* device_list = nullptr;
|
AVDeviceInfoList* device_list = nullptr;
|
||||||
|
#endif
|
||||||
if (index >= 0)
|
if (index >= 0)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_FFMPEG_LIBAVDEVICE
|
#ifdef HAVE_FFMPEG_LIBAVDEVICE
|
||||||
|
|
@ -1267,13 +1269,13 @@ bool CvCapture_FFMPEG::open(const char* _filename, int index, const Ptr<IStreamR
|
||||||
ic->pb = avio_context;
|
ic->pb = avio_context;
|
||||||
}
|
}
|
||||||
int err = avformat_open_input(&ic, _filename, input_format, &dict);
|
int err = avformat_open_input(&ic, _filename, input_format, &dict);
|
||||||
|
#ifdef HAVE_FFMPEG_LIBAVDEVICE
|
||||||
if (device_list)
|
if (device_list)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_FFMPEG_LIBAVDEVICE
|
|
||||||
avdevice_free_list_devices(&device_list);
|
avdevice_free_list_devices(&device_list);
|
||||||
device_list = nullptr;
|
device_list = nullptr;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user