Add accessor for intrinsic_duration in SMPTESubtitleAsset.
[libdcp.git] / README.md
1 # libdcp
2
3 Library for reading and writing Digital Cinema Packages (DCPs).
4
5
6 # Acknowledgements
7
8 Wolfgang Woehl's cinemaslides was most informative on the
9 nasty details of encryption.
10
11 libdcp is written by Carl Hetherington and Mart Jansink.
12 Bugfixes were received from Philip Tschiemer.
13
14
15 # Building
16
17 ```
18   ./waf configure
19   ./waf
20   sudo ./waf install
21 ```
22
23
24 # Dependencies
25
26 - pkg-config (for build system)
27 - boost (1.45 or above): filesystem, signals2, datetime and unit testing libraries
28 - openssl
29 - libsigc++
30 - libxml++
31 - xmlsec
32 - ImageMagick or GraphicsMagick
33 - sndfile
34 - openjpeg (1.5.0 or above)
35 - [libasdcp-cth](https://github.com/cth103/asdcplib-cth/tree/cth)
36 - [libcxml](https://github.com/cth103/libcxml)
37 - (optional) OpenMP
38 - (optional) gcov (for tests)
39
40
41 # Build options
42
43 ```
44   --target-windows      set up to do a cross-compile to Windows
45   --enable-debug        build with debugging information and without optimisation
46   --static              build libdcp statically, and link statically to openjpeg, cxml, asdcplib-cth
47   --disable-tests       disable building of tests
48   --disable-gcov        dont use gcov in tests
49   --disable-examples    disable building of examples
50   --enable-openmp       enable use of OpenMP
51   --openmp=OPENMP       Specify OpenMP Library to use: omp, gomp (default), iomp..
52   --jpeg=JPEG           specify JPEG library to build with: oj1 or oj2 for OpenJPEG 1.5.x or OpenJPEG 2.1.x respectively
53   --force-cpp11         force use of C++11
54 ```
55
56 # A note on building for macOS
57
58 As goto solution, all dependencies can be installed using [Homebrew](https://brew.sh/).
59 Make sure to add the respective `PKG_CONFIG_PATH` paths so the packages are indeed found.
60
61 ```bash
62 ## Default Homebrew paths
63 PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig"
64 PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/pangomm/lib/pkgconfig"
65 PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libffi/lib/pkgconfig" # needed by gobject2
66 PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/openssl/lib/pkgconfig"
67 PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libxml2/lib/pkgconfig"
68
69 ## Set as installed
70 # PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/path-to-your-install-folder/libasdcp-cth"
71 # PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/path-to-your-install-folder/libcxml"
72
73 export PKG_CONFIG_PATH
74 ```
75
76 If you want support for *OpenMP*, the standard llvm compiler coming with Xcode (or rather its command line tools) does not support it such that you will have to override the compiler (using the `CXX` environment variable).
77 The version provided through Homebrew will work (or any of your choice) along with `--openmp=omp`.
78
79 ```bash
80 ## Default Homebrew path
81 export CXX=/usr/local/opt/llvm/bin/clang++
82 ```
83
84
85 # Documentation
86
87 Run doxygen in the top-level directory and then see build/doc/html/index.html.
88
89 There are some examples in the examples/ directory.
90
91
92 # Coding style
93
94 * Use C++11 but nothing higher, as we need the library to be usable on some quite old compilers.
95 * Put a Doxygen @file comment under the GPL banner in each source file.
96 * Two blank lines between methods, and between 'blocks' in headers.
97 * Doxygen comments in header files for public methods, source files for protected / private methods; no full stops after simple doxygen strings.
98 * Use `= delete` on copy constructors and assignment operators instead of boost::noncopyable.
99 * Initialise POD members in classes in the header.
100 * Use std::make_shared to create shared pointers to things.