/*
- Copyright (C) 2012-2013 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "KM_fileio.h"
#include "exceptions.h"
#include "mono_picture_frame.h"
+#include "compose.hpp"
using std::string;
using std::vector;
+using std::cout;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
-using boost::lexical_cast;
using namespace dcp;
MonoPictureMXF::MonoPictureMXF (boost::filesystem::path file)
boost::throw_exception (DCPReadError ("could not read video MXF information"));
}
- _size.width = desc.StoredWidth;
- _size.height = desc.StoredHeight;
- _edit_rate = desc.EditRate.Numerator;
- assert (desc.EditRate.Denominator == 1);
- _intrinsic_duration = desc.ContainerDuration;
+ read_picture_descriptor (desc);
+
+ ASDCP::WriterInfo info;
+ if (ASDCP_FAILURE (reader.FillWriterInfo (info))) {
+ boost::throw_exception (DCPReadError ("could not read video MXF information"));
+ }
+
+ read_writer_info (info);
}
-MonoPictureMXF::MonoPictureMXF (int edit_rate)
+MonoPictureMXF::MonoPictureMXF (Fraction edit_rate)
: PictureMXF (edit_rate)
{
}
bool
-MonoPictureMXF::equals (shared_ptr<const Content> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
+MonoPictureMXF::equals (shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, string)> note) const
{
+ if (!dynamic_pointer_cast<const MonoPictureMXF> (other)) {
+ return false;
+ }
+
if (!MXF::equals (other, opt, note)) {
return false;
}
return false;
}
- note (PROGRESS, "Comparing video frame " + lexical_cast<string> (i) + " of " + lexical_cast<string> (_intrinsic_duration));
+ note (DCP_PROGRESS, String::compose ("Comparing video frame %1 of %2", i, _intrinsic_duration));
shared_ptr<const MonoPictureFrame> frame_A = get_frame (i);
shared_ptr<const MonoPictureFrame> frame_B = other_picture->get_frame (i);
}
shared_ptr<PictureMXFWriter>
-MonoPictureMXF::start_write (boost::filesystem::path file, bool overwrite)
+MonoPictureMXF::start_write (boost::filesystem::path file, Standard standard, bool overwrite)
{
/* XXX: can't we use shared_ptr here? */
- return shared_ptr<MonoPictureMXFWriter> (new MonoPictureMXFWriter (this, file, overwrite));
+ return shared_ptr<MonoPictureMXFWriter> (new MonoPictureMXFWriter (this, file, standard, overwrite));
}
string
{
return "MainPicture";
}
-
-int
-MonoPictureMXF::edit_rate_factor () const
-{
- return 1;
-}