projects
/
libdcp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tidying.
[libdcp.git]
/
src
/
reel.cc
diff --git
a/src/reel.cc
b/src/reel.cc
index efb161bb0f8c445ef5c6ccfa483f781da018c9bb..74107ed05e883e5af051c2522122e67ca4d625b5 100644
(file)
--- a/
src/reel.cc
+++ b/
src/reel.cc
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2014-202
0
Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-202
1
Carl Hetherington <cth@carlh.net>
This file is part of libdcp.
This file is part of libdcp.
@@
-31,6
+31,12
@@
files in the program, then also delete it here.
*/
files in the program, then also delete it here.
*/
+
+/** @file src/reel.cc
+ * @brief Reel class
+ */
+
+
#include "reel.h"
#include "util.h"
#include "picture_asset.h"
#include "reel.h"
#include "util.h"
#include "picture_asset.h"
@@
-50,13
+56,8
@@
#include "reel_atmos_asset.h"
#include "reel_closed_caption_asset.h"
#include <libxml++/nodes/element.h>
#include "reel_atmos_asset.h"
#include "reel_closed_caption_asset.h"
#include <libxml++/nodes/element.h>
-#include <boost/foreach.hpp>
#include <stdint.h>
#include <stdint.h>
-/* Centos 6 does not have this */
-#ifndef INT64_MAX
-#define INT64_MAX 0x7fffffffffffffff
-#endif
using std::string;
using std::cout;
using std::string;
using std::cout;
@@
-67,6
+68,7
@@
using std::dynamic_pointer_cast;
using std::vector;
using namespace dcp;
using std::vector;
using namespace dcp;
+
Reel::Reel (std::shared_ptr<const cxml::Node> node)
: Object (remove_urn_uuid (node->string_child ("Id")))
{
Reel::Reel (std::shared_ptr<const cxml::Node> node)
: Object (remove_urn_uuid (node->string_child ("Id")))
{
@@
-74,27
+76,27
@@
Reel::Reel (std::shared_ptr<const cxml::Node> node)
auto main_picture = asset_list->optional_node_child ("MainPicture");
if (main_picture) {
auto main_picture = asset_list->optional_node_child ("MainPicture");
if (main_picture) {
- _main_picture
.reset (new ReelMonoPictureAsset (main_picture)
);
+ _main_picture
= make_shared<ReelMonoPictureAsset>(main_picture
);
}
auto main_stereoscopic_picture = asset_list->optional_node_child ("MainStereoscopicPicture");
if (main_stereoscopic_picture) {
}
auto main_stereoscopic_picture = asset_list->optional_node_child ("MainStereoscopicPicture");
if (main_stereoscopic_picture) {
- _main_picture
.reset (new ReelStereoPictureAsset (main_stereoscopic_picture)
);
+ _main_picture
= make_shared<ReelStereoPictureAsset>(main_stereoscopic_picture
);
}
auto main_sound = asset_list->optional_node_child ("MainSound");
if (main_sound) {
}
auto main_sound = asset_list->optional_node_child ("MainSound");
if (main_sound) {
- _main_sound
.reset (new ReelSoundAsset (main_sound)
);
+ _main_sound
= make_shared<ReelSoundAsset>(main_sound
);
}
auto main_subtitle = asset_list->optional_node_child ("MainSubtitle");
if (main_subtitle) {
}
auto main_subtitle = asset_list->optional_node_child ("MainSubtitle");
if (main_subtitle) {
- _main_subtitle
.reset (new ReelSubtitleAsset (main_subtitle)
);
+ _main_subtitle
= make_shared<ReelSubtitleAsset>(main_subtitle
);
}
auto main_markers = asset_list->optional_node_child ("MainMarkers");
if (main_markers) {
}
auto main_markers = asset_list->optional_node_child ("MainMarkers");
if (main_markers) {
- _main_markers
.reset (new ReelMarkersAsset (main_markers)
);
+ _main_markers
= make_shared<ReelMarkersAsset>(main_markers
);
}
/* XXX: it's not ideal that we silently tolerate Interop or SMPTE nodes here */
}
/* XXX: it's not ideal that we silently tolerate Interop or SMPTE nodes here */
@@
-116,6
+118,7
@@
Reel::Reel (std::shared_ptr<const cxml::Node> node)
node->done ();
}
node->done ();
}
+
xmlpp::Element *
Reel::write_to_cpl (xmlpp::Element* node, Standard standard) const
{
xmlpp::Element *
Reel::write_to_cpl (xmlpp::Element* node, Standard standard) const
{
@@
-156,6
+159,7
@@
Reel::write_to_cpl (xmlpp::Element* node, Standard standard) const
return asset_list;
}
return asset_list;
}
+
bool
Reel::equals (std::shared_ptr<const Reel> other, EqualityOptions opt, NoteHandler note) const
{
bool
Reel::equals (std::shared_ptr<const Reel> other, EqualityOptions opt, NoteHandler note) const
{
@@
-222,6
+226,7
@@
Reel::equals (std::shared_ptr<const Reel> other, EqualityOptions opt, NoteHandle
return true;
}
return true;
}
+
bool
Reel::any_encrypted () const
{
bool
Reel::any_encrypted () const
{
@@
-261,6
+266,7
@@
Reel::all_encrypted () const
);
}
);
}
+
void
Reel::add (DecryptedKDM const & kdm)
{
void
Reel::add (DecryptedKDM const & kdm)
{
@@
-293,6
+299,7
@@
Reel::add (DecryptedKDM const & kdm)
}
}
}
}
+
void
Reel::add (shared_ptr<ReelAsset> asset)
{
void
Reel::add (shared_ptr<ReelAsset> asset)
{
@@
-317,6
+324,7
@@
Reel::add (shared_ptr<ReelAsset> asset)
}
}
}
}
+
vector<shared_ptr<ReelAsset>>
Reel::assets () const
{
vector<shared_ptr<ReelAsset>>
Reel::assets () const
{
@@
-337,19
+345,20
@@
Reel::assets () const
return a;
}
return a;
}
+
void
Reel::resolve_refs (vector<shared_ptr<Asset>> assets)
{
if (_main_picture) {
void
Reel::resolve_refs (vector<shared_ptr<Asset>> assets)
{
if (_main_picture) {
- _main_picture->asset_ref().resolve
(assets);
+ _main_picture->asset_ref().resolve(assets);
}
if (_main_sound) {
}
if (_main_sound) {
- _main_sound->asset_ref().resolve
(assets);
+ _main_sound->asset_ref().resolve(assets);
}
if (_main_subtitle) {
}
if (_main_subtitle) {
- _main_subtitle->asset_ref().resolve
(assets);
+ _main_subtitle->asset_ref().resolve(assets);
/* Interop subtitle handling is all special cases */
if (_main_subtitle->asset_ref().resolved()) {
/* Interop subtitle handling is all special cases */
if (_main_subtitle->asset_ref().resolved()) {
@@
-377,6
+386,7
@@
Reel::resolve_refs (vector<shared_ptr<Asset>> assets)
}
}
}
}
+
int64_t
Reel::duration () const
{
int64_t
Reel::duration () const
{