#include "content.h"
#include "reel_picture_asset.h"
#include "picture_mxf.h"
+#include "dcp_assert.h"
#include "compose.hpp"
#include <libcxml/cxml.h>
#include <iomanip>
using std::string;
using std::stringstream;
using boost::shared_ptr;
+using boost::dynamic_pointer_cast;
using namespace dcp;
ReelPictureAsset::ReelPictureAsset ()
}
-ReelPictureAsset::ReelPictureAsset (boost::shared_ptr<PictureMXF> content, int64_t entry_point)
- : ReelAsset (content, entry_point)
+ReelPictureAsset::ReelPictureAsset (shared_ptr<PictureMXF> content, int64_t entry_point)
+ : ReelMXFAsset (content, content->edit_rate(), content->intrinsic_duration(), entry_point)
, _frame_rate (content->frame_rate ())
, _screen_aspect_ratio (content->screen_aspect_ratio ())
{
}
-ReelPictureAsset::ReelPictureAsset (boost::shared_ptr<const cxml::Node> node)
- : ReelAsset (node)
+ReelPictureAsset::ReelPictureAsset (shared_ptr<const cxml::Node> node)
+ : ReelMXFAsset (node)
{
_frame_rate = Fraction (node->string_child ("FrameRate"));
try {
void
ReelPictureAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const
{
- ReelAsset::write_to_cpl (node, standard);
+ ReelMXFAsset::write_to_cpl (node, standard);
xmlpp::Node::NodeList c = node->get_children ();
xmlpp::Node::NodeList::iterator i = c.begin();
++i;
}
- assert (i != c.end ());
+ DCP_ASSERT (i != c.end ());
(*i)->add_child ("FrameRate")->add_child_text (String::compose ("%1 %2", _frame_rate.numerator, _frame_rate.denominator));
if (standard == INTEROP) {
);
}
}
+
+string
+ReelPictureAsset::key_type () const
+{
+ return "MDIK";
+}
+
+bool
+ReelPictureAsset::equals (shared_ptr<const ReelAsset> other, EqualityOptions opt, NoteHandler note) const
+{
+ if (!ReelAsset::equals (other, opt, note)) {
+ return false;
+ }
+
+ shared_ptr<const ReelPictureAsset> rpa = dynamic_pointer_cast<const ReelPictureAsset> (other);
+ if (!rpa) {
+ return false;
+ }
+
+ if (_frame_rate != rpa->_frame_rate) {
+ note (DCP_ERROR, "frame rates differ in reel");
+ return false;
+ }
+
+ if (_screen_aspect_ratio != rpa->_screen_aspect_ratio) {
+ note (DCP_ERROR, "screen aspect ratios differ in reel");
+ return false;
+ }
+
+ return true;
+}