Skip to content

Commit 0dd7691

Browse files
author
Giulio Carota
committed
add support to ffmpeg 5.x
1 parent 8230b6e commit 0dd7691

File tree

6 files changed

+10
-12
lines changed

6 files changed

+10
-12
lines changed

CMakeLists.txt

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ endif()
1010

1111

1212
if(APPLE)
13-
link_directories(/usr/local/Cellar/ffmpeg/4.4.1_5/lib)
14-
include_directories(/usr/local/Cellar/ffmpeg/4.4.1_5/include)
13+
link_directories(/usr/local/Cellar/ffmpeg/5.0.1_2/lib)
14+
include_directories(/usr/local/Cellar/ffmpeg/5.0.1_2/include)
1515
endif()
16-
link_directories(/usr/local/Cellar/ffmpeg/4.4.1_5/lib)
17-
include_directories(/usr/local/Cellar/ffmpeg/4.4.1_5/include)
1816

1917
if (UNIX AND NOT APPLE)
2018
link_directories(/usr/local/ffmpeg/lib)

example/QtRecorder/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ endif()
2222

2323
if(APPLE)
2424
set(CMAKE_PREFIX_PATH /Users/giuliocarota/Qt/QtDesignStudio/qt5_design_studio_reduced_version/lib/cmake/)
25-
set(PATH_TO_FFMPEG /usr/local/Cellar/ffmpeg@4/4.4.2_2/)
25+
set(PATH_TO_FFMPEG /usr/local/Cellar/ffmpeg/5.0.1_2)
2626
link_directories(${PATH_TO_FFMPEG}/lib)
27-
include_directories(${PATH_TO_FFMPEG}include)
27+
include_directories(${PATH_TO_FFMPEG}/include)
2828
find_package(Qt5 REQUIRED COMPONENTS Core Gui Widgets)
2929

3030
endif()

example/SimpleMain/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ endif()
1212

1313

1414
if(APPLE)
15-
set(PATH_TO_FFMPEG /usr/local/Cellar/ffmpeg@4/4.4.2_2/)
15+
set(PATH_TO_FFMPEG /usr/local/Cellar/ffmpeg/5.0.1_2)
1616
link_directories(${PATH_TO_FFMPEG}/lib)
17-
include_directories(${PATH_TO_FFMPEG}include)
17+
include_directories(${PATH_TO_FFMPEG}/include)
1818
endif()
1919

2020
if (UNIX AND NOT APPLE)

include/muxing/SRMediaOutput.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class SRMediaOutput {
1414
private:
1515
bool video_recorded;
1616
bool audio_recorded;
17-
#if __linux__
17+
#if(LIBAVFORMAT_VERSION_INT > AV_VERSION_INT(59,0,0))
1818
const AVOutputFormat* outputFormat;
1919
#else
2020
AVOutputFormat* outputFormat;

src/SRAudioInput.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ AVFormatContext* SRAudioInput::open(){
2020
//if one of them != nullptr then input already initialized
2121
if(inFormatContext != nullptr || inCodecContext!= nullptr || streamIndex != -1)
2222
return inFormatContext;
23-
#if __linux__
23+
#if(LIBAVFORMAT_VERSION_INT > AV_VERSION_INT(59,0,0))
2424
const AVInputFormat* inAInputFormat =nullptr;
2525
#else
2626
AVInputFormat* inAInputFormat =nullptr;

src/SRVideoInput.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ AVFormatContext* SRVideoInput::open(){
8484
//if one of them != nullptr then input already initialized
8585
if(inFormatContext != nullptr || inCodecContext!= nullptr || streamIndex != -1)
8686
return inFormatContext;
87-
#if __linux__
88-
const AVInputFormat* inVInputFormat =nullptr;
87+
#if(LIBAVFORMAT_VERSION_INT > AV_VERSION_INT(59,0,0))
88+
const AVInputFormat* inVInputFormat =nullptr;
8989
#else
9090
AVInputFormat* inVInputFormat =nullptr;
9191
#endif

0 commit comments

Comments
 (0)