*/
-#include <fstream>
#include <libxml/parser.h>
#include "cpl.h"
#include "parse/cpl.h"
#include "util.h"
-#include "picture_asset.h"
+#include "mono_picture_asset.h"
+#include "stereo_picture_asset.h"
#include "sound_asset.h"
#include "subtitle_asset.h"
#include "parse/asset_map.h"
using std::string;
using std::stringstream;
-using std::ofstream;
using std::ostream;
using std::list;
using std::pair;
if (!(*i)->asset_list->main_stereoscopic_picture && p->edit_rate == p->frame_rate) {
- pair<string, shared_ptr<const parse::AssetMapAsset> > asset = asset_from_id (asset_maps, p->id);
-
try {
- picture.reset (new MonoPictureAsset (
- asset.first,
- asset.second->chunks.front()->path
- )
- );
+ pair<string, shared_ptr<const parse::AssetMapAsset> > asset = asset_from_id (asset_maps, p->id);
+
+ picture.reset (new MonoPictureAsset (asset.first, asset.second->chunks.front()->path));
+ picture->read ();
+ picture->set_edit_rate (_fps);
picture->set_entry_point (p->entry_point);
picture->set_duration (p->duration);
if (p->key_id.length() > 9) {
try {
pair<string, shared_ptr<const parse::AssetMapAsset> > asset = asset_from_id (asset_maps, p->id);
- picture.reset (new StereoPictureAsset (
- asset.first,
- asset.second->chunks.front()->path,
- _fps,
- p->duration
- )
- );
+ picture.reset (new StereoPictureAsset (asset.first, asset.second->chunks.front()->path));
+ picture->read ();
+ picture->set_edit_rate (_fps);
picture->set_entry_point (p->entry_point);
picture->set_duration (p->duration);
if (p->key_id.length() > 9) {
try {
pair<string, shared_ptr<const parse::AssetMapAsset> > asset = asset_from_id (asset_maps, (*i)->asset_list->main_sound->id);
- sound.reset (new SoundAsset (
- asset.first,
- asset.second->chunks.front()->path
- )
- );
-
+ sound.reset (new SoundAsset (asset.first, asset.second->chunks.front()->path));
shared_ptr<parse::MainSound> s = (*i)->asset_list->main_sound;
+ sound->read ();
sound->set_entry_point (s->entry_point);
sound->set_duration (s->duration);
if (s->key_id.length() > 9) {
pair<string, shared_ptr<const parse::AssetMapAsset> > asset = asset_from_id (asset_maps, (*i)->asset_list->main_subtitle->id);
- subtitle.reset (new SubtitleAsset (
- asset.first,
- asset.second->chunks.front()->path
- )
- );
+ subtitle.reset (new SubtitleAsset (asset.first, asset.second->chunks.front()->path));
subtitle->set_entry_point ((*i)->asset_list->main_subtitle->entry_point);
subtitle->set_duration ((*i)->asset_list->main_subtitle->duration);
signer->sign (root, interop);
}
- doc.write_to_file_formatted (p.string (), "UTF-8");
+ /* This must not be the _formatted version otherwise signature digests will be wrong */
+ doc.write_to_file (p.string (), "UTF-8");
_digest = make_digest (p.string (), 0);
_length = boost::filesystem::file_size (p.string ());
return make_pair ("", shared_ptr<const parse::AssetMapAsset> ());
}
+
+void
+CPL::set_mxf_keys (Key key)
+{
+ for (list<shared_ptr<Reel> >::const_iterator i = _reels.begin(); i != _reels.end(); ++i) {
+ (*i)->set_mxf_keys (key);
+ }
+}