summaryrefslogtreecommitdiff
path: root/src/atmos_asset.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-09-27 12:30:04 +0100
committerCarl Hetherington <cth@carlh.net>2016-09-27 12:30:04 +0100
commit214d72306bdfdd617c3e6a7cfeb5c5d76d7f5e72 (patch)
tree7af52f9614b84e975586c7c8fd328931adc14306 /src/atmos_asset.cc
parent52b563097e355b098fc9da13cb25f135f0d9bf9e (diff)
Add Atmos read/write and untested MXF decryption tool.1.0-templates
Diffstat (limited to 'src/atmos_asset.cc')
-rw-r--r--src/atmos_asset.cc33
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));
+}