project divided into two parts: static library ffcpp (which is the main part) and a set of examples (currently only one - ffConv)

This commit is contained in:
Selim Mustafaev 2016-11-09 22:35:56 +03:00
parent 341e779fc4
commit 18123eacb5
23 changed files with 60 additions and 22 deletions

2
.gitignore vendored
View File

@ -1,2 +1,4 @@
.idea/ .idea/
lib/
bin/

View File

@ -1,16 +1,15 @@
cmake_minimum_required(VERSION 3.5) cmake_minimum_required(VERSION 3.5)
project(ffConv)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -ggdb -O2") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -ggdb -O2")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -std=c++14 -ggdb -O0") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -std=c++14 -ggdb -O0")
find_package(FFMPEG REQUIRED) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
include_directories(${FFMPEG_INCLUDE_DIR}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib)
link_directories(${FFMPEG_LIBRARY_DIRS}) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib)
#message(FATAL_ERROR ${FFMPEG_INCLUDE_DIR}) include_directories(include)
link_directories(lib)
set(SOURCE_FILES main.cpp ffcpp/MediaFile.cpp ffcpp/MediaFile.h ffcpp/ffcpp.cpp ffcpp/ffcpp.h ffcpp/Stream.cpp ffcpp/Stream.h ffcpp/Codec.cpp ffcpp/Codec.h ffcpp/Packet.cpp ffcpp/Packet.h ffcpp/Frame.cpp ffcpp/Frame.h ffcpp/FifoQueue.cpp ffcpp/FifoQueue.h ffcpp/Scaler.cpp ffcpp/Scaler.h ffcpp/Resampler.cpp ffcpp/Resampler.h) add_subdirectory(src)
add_executable(ffConv ${SOURCE_FILES}) add_subdirectory(examples)
target_link_libraries(ffConv ${FFMPEG_LIBRARIES})

5
examples/CMakeLists.txt Normal file
View File

@ -0,0 +1,5 @@
project(ffConv)
add_executable(ffConv ffConv.cpp)
add_dependencies(ffConv ffcpp)
target_link_libraries(ffConv ffcpp)

32
src/CMakeLists.txt Normal file
View File

@ -0,0 +1,32 @@
project(ffcpp)
find_package(FFMPEG REQUIRED)
include_directories(${FFMPEG_INCLUDE_DIR})
link_directories(${FFMPEG_LIBRARY_DIRS})
if(NOT FFMPEG_FOUND)
message(FATAL_ERROR "FFMpeg not found")
endif()
set(SOURCE_FILES MediaFile.cpp
../include/ffcpp/MediaFile.h
ffcpp.cpp
../include/ffcpp/ffcpp.h
Stream.cpp
../include/ffcpp/Stream.h
Codec.cpp
../include/ffcpp/Codec.h
Packet.cpp
../include/ffcpp/Packet.h
Frame.cpp
../include/ffcpp/Frame.h
FifoQueue.cpp
../include/ffcpp/FifoQueue.h
Scaler.cpp
../include/ffcpp/Scaler.h
Resampler.cpp
../include/ffcpp/Resampler.h)
add_library(ffcpp ${SOURCE_FILES})
target_link_libraries(ffcpp ${FFMPEG_LIBRARIES})

View File

@ -1,5 +1,5 @@
#include "Codec.h" #include "ffcpp/Codec.h"
#include "ffcpp.h" #include "ffcpp/ffcpp.h"
#include <stdexcept> #include <stdexcept>
namespace ffcpp { namespace ffcpp {

View File

@ -1,5 +1,5 @@
#include "FifoQueue.h" #include "ffcpp/FifoQueue.h"
#include "ffcpp.h" #include "ffcpp/ffcpp.h"
#include <stdexcept> #include <stdexcept>
namespace ffcpp { namespace ffcpp {

View File

@ -1,5 +1,5 @@
#include "ffcpp.h" #include "ffcpp/ffcpp.h"
#include "Frame.h" #include "ffcpp/Frame.h"
#include <stdexcept> #include <stdexcept>
namespace ffcpp { namespace ffcpp {

View File

@ -1,5 +1,5 @@
#include "MediaFile.h" #include "ffcpp/MediaFile.h"
#include "ffcpp.h" #include "ffcpp/ffcpp.h"
#include <stdexcept> #include <stdexcept>
namespace ffcpp { namespace ffcpp {

View File

@ -1,4 +1,4 @@
#include "Packet.h" #include "ffcpp/Packet.h"
#include <stdexcept> #include <stdexcept>
namespace ffcpp { namespace ffcpp {

View File

@ -1,5 +1,5 @@
#include "Resampler.h" #include "ffcpp/Resampler.h"
#include "ffcpp.h" #include "ffcpp/ffcpp.h"
#include <stdexcept> #include <stdexcept>
#include <memory> #include <memory>

View File

@ -1,4 +1,4 @@
#include "Scaler.h" #include "ffcpp/Scaler.h"
#include <stdexcept> #include <stdexcept>
namespace ffcpp { namespace ffcpp {

View File

@ -1,4 +1,4 @@
#include "Stream.h" #include "ffcpp/Stream.h"
#include <stdexcept> #include <stdexcept>
namespace ffcpp { namespace ffcpp {

View File

@ -1,4 +1,4 @@
#include "ffcpp.h" #include "ffcpp/ffcpp.h"
#include <stdexcept> #include <stdexcept>
extern "C" { extern "C" {