diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-09-28 19:15:03 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-09-28 19:15:03 +0100 |
| commit | eb772d227c378e17c99b5d609b81d0cc4b664d2c (patch) | |
| tree | ccc3b4c75316d76fd441767e29ed1e0d8d3908a6 /src/atmos_asset.cc | |
| parent | fba372ef15a9dd9c6f840e5c03bdb85146657955 (diff) | |
| parent | 5aba207171b7f1da91968bf2197c5668e8aacb4e (diff) | |
Merge branch '1.0' of ssh://main.carlh.net/home/carl/git/libdcp into 1.0
Diffstat (limited to 'src/atmos_asset.cc')
| -rw-r--r-- | src/atmos_asset.cc | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/atmos_asset.cc b/src/atmos_asset.cc index a8a595c3..eac01dcf 100644 --- a/src/atmos_asset.cc +++ b/src/atmos_asset.cc @@ -32,12 +32,27 @@ */ #include "atmos_asset.h" +#include "atmos_asset_reader.h" +#include "atmos_asset_writer.h" #include "exceptions.h" #include <asdcp/AS_DCP.h> using std::string; +using boost::shared_ptr; using namespace dcp; +AtmosAsset::AtmosAsset (Fraction edit_rate, int first_frame, int max_channel_count, int max_object_count, string atmos_id, int atmos_version) + : _edit_rate (edit_rate) + , _intrinsic_duration (0) + , _first_frame (first_frame) + , _max_channel_count (max_channel_count) + , _max_object_count (max_object_count) + , _atmos_id (atmos_id) + , _atmos_version (atmos_version) +{ + +} + AtmosAsset::AtmosAsset (boost::filesystem::path file) : Asset (file) { @@ -57,6 +72,12 @@ AtmosAsset::AtmosAsset (boost::filesystem::path file) _first_frame = desc.FirstFrame; _max_channel_count = desc.MaxChannelCount; _max_object_count = desc.MaxObjectCount; + + char id[64]; + Kumu::bin2UUIDhex (desc.AtmosID, ASDCP::UUIDlen, id, sizeof (id)); + _atmos_id = id; + + _atmos_version = desc.AtmosVersion; } string @@ -64,3 +85,15 @@ AtmosAsset::pkl_type (Standard) const { return "application/mxf"; } + +shared_ptr<AtmosAssetReader> +AtmosAsset::start_read () const +{ + return shared_ptr<AtmosAssetReader> (new AtmosAssetReader (this, key ())); +} + +shared_ptr<AtmosAssetWriter> +AtmosAsset::start_write (boost::filesystem::path file) +{ + return shared_ptr<AtmosAssetWriter> (new AtmosAssetWriter (this, file)); +} |
