+PictureAsset::PictureAsset (string directory, string mxf_name, boost::signals2::signal<void (float)>* progress, int fps, int intrinsic_duration, bool encrypted, Size size)
+ : MXFAsset (directory, mxf_name, progress, fps, intrinsic_duration, encrypted)
+ , _size (size)
+{
+
+}
+
+PictureAsset::PictureAsset (string directory, string mxf_name)
+ : MXFAsset (directory, mxf_name)
+{
+
+}
+
+string
+MonoPictureAsset::cpl_node_name () const
+{
+ return "MainPicture";
+}
+
+int
+MonoPictureAsset::edit_rate_factor () const
+{
+ return 1;
+}
+
+string
+StereoPictureAsset::cpl_node_name () const
+{
+ return "MainStereoscopicPicture";
+}
+
+string
+StereoPictureAsset::cpl_node_namespace (bool interop) const
+{
+ if (interop) {
+ return "http://www.digicine.com/schemas/437-Y/2007/Main-Stereo-Picture-CPL";
+ } else {
+ return "http://www.smpte-ra.org/schemas/429-10/2008/Main-Stereo-Picture-CPL";
+ }
+
+ return "";
+}
+
+int
+StereoPictureAsset::edit_rate_factor () const
+{
+ return 2;
+}
+
+void
+PictureAsset::write_to_cpl (xmlpp::Node* node, bool interop) const
+{
+ MXFAsset::write_to_cpl (node, interop);
+
+ xmlpp::Node::NodeList c = node->get_children ();
+ xmlpp::Node::NodeList::iterator i = c.begin();
+ while (i != c.end() && (*i)->get_name() != cpl_node_name ()) {
+ ++i;
+ }
+
+ assert (i != c.end ());
+
+ (*i)->add_child ("FrameRate")->add_child_text (lexical_cast<string> (_edit_rate * edit_rate_factor ()) + " 1");
+ if (interop) {
+ (*i)->add_child ("ScreenAspectRatio")->add_child_text (lexical_cast<string> (float (_size.width) / _size.height));
+ } else {
+ (*i)->add_child ("ScreenAspectRatio")->add_child_text (lexical_cast<string> (_size.width) + " " + lexical_cast<string> (_size.height));
+ }
+}
+
+bool
+PictureAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
+{
+ if (!MXFAsset::equals (other, opt, note)) {
+ return false;
+ }
+
+ ASDCP::JP2K::MXFReader reader_A;
+ if (ASDCP_FAILURE (reader_A.OpenRead (path().string().c_str()))) {
+ boost::throw_exception (MXFFileError ("could not open MXF file for reading", path().string()));
+ }
+
+ ASDCP::JP2K::MXFReader reader_B;
+ if (ASDCP_FAILURE (reader_B.OpenRead (other->path().string().c_str()))) {
+ boost::throw_exception (MXFFileError ("could not open MXF file for reading", path().string()));
+ }
+
+ ASDCP::JP2K::PictureDescriptor desc_A;
+ if (ASDCP_FAILURE (reader_A.FillPictureDescriptor (desc_A))) {
+ boost::throw_exception (DCPReadError ("could not read video MXF information"));
+ }
+ ASDCP::JP2K::PictureDescriptor desc_B;
+ if (ASDCP_FAILURE (reader_B.FillPictureDescriptor (desc_B))) {
+ boost::throw_exception (DCPReadError ("could not read video MXF information"));
+ }
+
+ if (
+ desc_A.EditRate != desc_B.EditRate ||
+ desc_A.SampleRate != desc_B.SampleRate ||
+ desc_A.StoredWidth != desc_B.StoredWidth ||
+ desc_A.StoredHeight != desc_B.StoredHeight ||
+ desc_A.AspectRatio != desc_B.AspectRatio ||
+ desc_A.Rsize != desc_B.Rsize ||
+ desc_A.Xsize != desc_B.Xsize ||
+ desc_A.Ysize != desc_B.Ysize ||
+ desc_A.XOsize != desc_B.XOsize ||
+ desc_A.YOsize != desc_B.YOsize ||
+ desc_A.XTsize != desc_B.XTsize ||
+ desc_A.YTsize != desc_B.YTsize ||
+ desc_A.XTOsize != desc_B.XTOsize ||
+ desc_A.YTOsize != desc_B.YTOsize ||
+ desc_A.Csize != desc_B.Csize
+// desc_A.CodingStyleDefault != desc_B.CodingStyleDefault ||
+// desc_A.QuantizationDefault != desc_B.QuantizationDefault
+ ) {
+
+ note (ERROR, "video MXF picture descriptors differ");
+ return false;
+ }
+
+ if (desc_A.ContainerDuration != desc_B.ContainerDuration) {
+ note (ERROR, "video container durations differ");
+ }
+
+// for (unsigned int j = 0; j < ASDCP::JP2K::MaxComponents; ++j) {
+// if (desc_A.ImageComponents[j] != desc_B.ImageComponents[j]) {
+// notes.pack_start ("video MXF picture descriptors differ");
+// }
+// }
+
+ return true;
+}
+
+
+MonoPictureAsset::MonoPictureAsset (
+ boost::function<string (int)> get_path,