-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move libMXF and libMXF projects into bmx
- Loading branch information
1 parent
d448677
commit ebbc70f
Showing
479 changed files
with
120,355 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule libMXF
deleted from
8df9cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
*~ | ||
build/ | ||
CMakeLists.txt.user | ||
CMakeCache.txt | ||
CMakeFiles | ||
CMakeScripts | ||
Testing | ||
Makefile | ||
cmake_install.cmake | ||
install_manifest.txt | ||
compile_commands.json | ||
CTestTestfile.cmake | ||
_deps | ||
out/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
cmake_minimum_required(VERSION 3.12 FATAL_ERROR) | ||
|
||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.15.0) | ||
# Set policy CMP0091 to new to allow use of CMAKE_MSVC_RUNTIME_LIBRARY | ||
cmake_policy(SET CMP0091 NEW) | ||
endif() | ||
|
||
project(libMXF | ||
VERSION 1.1 | ||
DESCRIPTION "Low-level C library for reading and writing the SMPTE ST 377-1 MXF file format" | ||
HOMEPAGE_URL https://github.com/bbc/libMXF | ||
LANGUAGES C CXX | ||
) | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/cmake/options.cmake") | ||
|
||
if(MSVC AND LIBMXF_SET_MSVC_RUNTIME AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.15.0) | ||
# cmake version >= 3.15: Use MultiThreadedDLL runtime | ||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL") | ||
endif() | ||
|
||
if(BUILD_SHARED_LIBS) | ||
# Ensure that static library code can be linked into the dynamic libraries (-fPIC compile option) | ||
set(CMAKE_POSITION_INDEPENDENT_CODE ON) | ||
endif() | ||
set(CMAKE_CXX_STANDARD 11) | ||
|
||
# Set the test samples output directory | ||
if(LIBMXF_TEST_SAMPLES_DIR STREQUAL "") | ||
set(new_samples_dir ${CMAKE_CURRENT_BINARY_DIR}/test_samples) | ||
else() | ||
get_filename_component(new_samples_dir | ||
${LIBMXF_TEST_SAMPLES_DIR} | ||
REALPATH | ||
BASE_DIR ${CMAKE_CURRENT_BINARY_DIR} | ||
) | ||
endif() | ||
if(NOT new_samples_dir STREQUAL ${LIBMXF_TEST_SAMPLES_DIR}) | ||
set(LIBMXF_TEST_SAMPLES_DIR ${new_samples_dir}) | ||
message("-- Test samples output directory: ${LIBMXF_TEST_SAMPLES_DIR}") | ||
endif() | ||
|
||
if(MSVC) | ||
add_compile_options(/W3) | ||
add_definitions(-D_CRT_SECURE_NO_WARNINGS) | ||
|
||
if(LIBMXF_SET_MSVC_RUNTIME AND CMAKE_VERSION VERSION_LESS 3.15.0) | ||
# cmake version < 3.15: Update compiler flags to use the MultiThreadedDLL runtime | ||
macro(update_msvc_runtime_flags flags) | ||
string(REGEX REPLACE "/MT" "/MD" ${flags} "${${flags}}") | ||
endmacro() | ||
|
||
update_msvc_runtime_flags(CMAKE_C_FLAGS) | ||
update_msvc_runtime_flags(CMAKE_CXX_FLAGS) | ||
foreach(suffix _DEBUG _RELEASE _MINSIZEREL _RELWITHDEBINFO) | ||
update_msvc_runtime_flags(CMAKE_C_FLAGS${suffix}) | ||
update_msvc_runtime_flags(CMAKE_CXX_FLAGS${suffix}) | ||
endforeach() | ||
endif() | ||
else() | ||
add_compile_options(-W -Wall -O2) | ||
|
||
# Enable large file support on 32-bit systems. | ||
add_definitions( | ||
-D_FILE_OFFSET_BITS=64 | ||
-D_LARGEFILE_SOURCE | ||
-D_LARGEFILE64_SOURCE | ||
) | ||
endif() | ||
|
||
if(LIBMXF_BUILD_TESTING AND (NOT DEFINED BUILD_TESTING OR BUILD_TESTING)) | ||
enable_testing() | ||
endif() | ||
add_custom_target(libMXF_test_samples) | ||
add_custom_target(libMXF_test_data) | ||
|
||
include("${PROJECT_SOURCE_DIR}/cmake/ext_uuid.cmake") | ||
|
||
configure_file(config.h.in config.h) | ||
|
||
add_subdirectory(mxf) | ||
if(LIBMXF_BUILD_TESTING AND (NOT DEFINED BUILD_TESTING OR BUILD_TESTING)) | ||
add_subdirectory(test) | ||
endif() | ||
if(NOT LIBMXF_BUILD_LIB_ONLY) | ||
add_subdirectory(examples) | ||
add_subdirectory(tools) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Copyright (C) 2014, British Broadcasting Corporation | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, | ||
this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
* Neither the name of the British Broadcasting Corporation nor the names | ||
of its contributors may be used to endorse or promote products derived | ||
from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# libMXF | ||
|
||
libMXF is a low-level C library for reading and writing the [SMPTE ST 377-1 MXF file format](https://ieeexplore.ieee.org/document/7292073). | ||
|
||
libMXF was originally developed as part of the [Ingex Project](http://ingex.sourceforge.net/) where it supported MXF transfer, playback and storage applications. libMXF was also used in the [BBC Archive Preservation Project](https://www.bbc.co.uk/rd/publications/whitepaper275) to migrate BBC archive content from video tapes to files. | ||
|
||
The [MXFDump](./tools/MXFDump) MXF text dumper utility from the [AAF SDK](https://sourceforge.net/projects/aaf/) is provided in this project for convenience. | ||
|
||
## Examples | ||
|
||
A number of applications and library code can be found in the [examples](./examples) directory. These are not part of the core library and are not required to build [libMXF++](../libMXFpp) or [bmx](../../). | ||
|
||
* [archive](./examples/archive): library code and utilities used in the [BBC Archive Preservation Project](https://www.bbc.co.uk/rd/publications/whitepaper275). | ||
* [avidmxfinfo](./examples/avidmxfinfo): library and utility for extracting metadata about Avid MXF OP-Atom files. This utility has been superseded by | ||
`mxf2raw` in the [bmx](../../) project. | ||
* [reader](./examples/reader): library code used by the [Ingex Player](http://ingex.sourceforge.net/) for reading MXF files. | ||
* [transfertop2](./examples/transfertop2): utilities used in the [TransferToP2](http://ingex.sourceforge.net/TransferToP2.html) application to allow edited sequences to be transferred from an editing system to a P2 card. | ||
* [vlc](./examples/vlc): legacy code that was written to test how easy it would be to support MXF in [VLC](https://www.videolan.org/vlc/). | ||
* [writeaviddv50](./examples/writeaviddv50): example utility for writing DV 50 MBit/s video in Avid MXF OP-Atom files. | ||
* [writeavidmxf](./examples/writeavidmxf): library code and utility for writing Avid MXF OP-Atom files. This utility has been superseded by `raw2bmx` in the [bmx](../../) project. | ||
|
||
## Build, Test and Install | ||
|
||
libMXF is developed on Ubuntu Linux but is supported on other Unix-like systems and Windows. | ||
|
||
The [cmake](https://cmake.org/) build system is used, with minimum version **3.12**. The build requires the `git` tool along with the C/C++ compilers. | ||
|
||
The build process has been tested on Ubuntu, Debian, MacOS and Windows (Microsoft Visual C++ 2017 v15.9.51 and later versions). | ||
|
||
### Dependencies | ||
|
||
The uuid library (Ubuntu / Debian package name `uuid-dev`) is required for non-Apple Unix-like systems. | ||
|
||
### Commands | ||
|
||
A basic commandline process is described here for platforms that default to the Unix Makefiles or Visual Studio cmake generators. See [build.md](./docs/build.md) for more detailed build options. | ||
|
||
Replace `<build type>` in the commandlines below with `Debug` or `Release`. Note that the Visual Studio generator supports multiple build types for a configuration, which is why the build type is selected _after_ configuration. | ||
|
||
The default generator can be overridden using the cmake `-G` option. The list of available generators is shown at the end of the output of `cmake --help`. | ||
|
||
Start by creating a build directory and change into it. The commandlines below use a `out/build` build directory in the working tree, which follows the approach taken by Microsoft Visual Studio C++. | ||
|
||
#### Unix-like (Unix Makefiles) | ||
|
||
```bash | ||
mkdir -p out/build | ||
cd out/build | ||
cmake ../../ -DCMAKE_BUILD_TYPE=<build type> | ||
cmake --build . | ||
make test | ||
sudo make install | ||
``` | ||
|
||
Run `ldconfig` to update the runtime linker cache. This avoids library link errors similar to "error while loading shared libraries". | ||
|
||
```bash | ||
sudo /sbin/ldconfig | ||
``` | ||
|
||
#### Windows (Visual Studio) | ||
|
||
```console | ||
mkdir out\build | ||
cd out\build | ||
cmake ..\..\ | ||
cmake --build . --config <build type> | ||
ctest -C <build type> | ||
cmake --build . --config <build type> --target install | ||
``` | ||
|
||
## Source and Binary Distributions | ||
|
||
Source distributions, including dependencies for the Windows build, and Windows binaries are made available as in [bmx](../../). | ||
|
||
## License | ||
|
||
The libMXF library is provided under the BSD 3-clause license. See the [COPYING](./COPYING) file provided with this library for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
if(uuid_link_lib) | ||
return() | ||
endif() | ||
|
||
|
||
if(UNIX AND NOT APPLE) | ||
find_library(uuid_lib | ||
NAMES uuid | ||
) | ||
find_path(uuid_include_dir | ||
NAMES uuid/uuid.h | ||
) | ||
|
||
if(NOT uuid_lib OR NOT uuid_include_dir) | ||
message(FATAL_ERROR "uuid dependency not found") | ||
endif() | ||
|
||
add_library(libuuid UNKNOWN IMPORTED) | ||
set_target_properties(libuuid PROPERTIES | ||
IMPORTED_LOCATION ${uuid_lib} | ||
INTERFACE_INCLUDE_DIRECTORIES ${uuid_include_dir} | ||
) | ||
set(uuid_link_lib libuuid) | ||
else() | ||
# MSVC: "ole" will already be linked in | ||
# APPLE: doesn't require uuid library | ||
set(uuid_link_lib) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
if(TARGET libmxf_git_version) | ||
return() | ||
endif() | ||
|
||
|
||
# Ensure the cmake targets and code symbols are libMXF specific | ||
set(GIT_VERSION_PROJECT_PREFIX "libmxf_") | ||
|
||
# Set the git release tag pattern to describe relative to | ||
set(GIT_DESCRIBE_TAG_PATTERN "v${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}") | ||
set(GIT_WORKING_DIR ${PROJECT_SOURCE_DIR}) | ||
|
||
# Set to ignore git_version errors if there is no .git directory | ||
set(GIT_FAIL_IF_NONZERO_EXIT FALSE) | ||
|
||
include(FetchContent) | ||
|
||
set(git_version_deps_source "${PROJECT_SOURCE_DIR}/deps/cmake-git-version-tracking") | ||
|
||
if(EXISTS ${git_version_deps_source}) | ||
FetchContent_Declare(libmxf_git_version | ||
SOURCE_DIR ${git_version_deps_source} | ||
) | ||
message("-- Build using git version source: ${git_version_deps_source}") | ||
else() | ||
FetchContent_Declare(libmxf_git_version | ||
GIT_REPOSITORY "https://github.com/andrew-hardin/cmake-git-version-tracking.git" | ||
GIT_TAG "904dbda1336ba4b9a1415a68d5f203f576b696bb" | ||
PATCH_COMMAND git clean -fdx | ||
COMMAND git reset --hard | ||
COMMAND git apply --ignore-whitespace "${CMAKE_CURRENT_LIST_DIR}/git_version_904dbda.patch" | ||
) | ||
endif() | ||
|
||
FetchContent_GetProperties(libmxf_git_version) | ||
if(NOT libmxf_git_version_POPULATED) | ||
FetchContent_Populate(libmxf_git_version) | ||
add_subdirectory(${libmxf_git_version_SOURCE_DIR} ${libmxf_git_version_BINARY_DIR}) | ||
endif() |
Oops, something went wrong.