projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added some notes on DVD-o-matic's files to the manual.
[dcpomatic.git]
/
src
/
lib
/
video_content.cc
diff --git
a/src/lib/video_content.cc
b/src/lib/video_content.cc
index 99471edc1a84f0fdf222e9151314223664716fed..a157b05993ca4b2532d0dd5fc8168436c2048a69 100644
(file)
--- a/
src/lib/video_content.cc
+++ b/
src/lib/video_content.cc
@@
-17,10
+17,12
@@
*/
*/
+#include <iomanip>
#include <libcxml/cxml.h>
#include "video_content.h"
#include <libcxml/cxml.h>
#include "video_content.h"
-#include "video_
decod
er.h"
+#include "video_
examin
er.h"
#include "ratio.h"
#include "ratio.h"
+#include "compose.hpp"
#include "i18n.h"
#include "i18n.h"
@@
-36,7
+38,7
@@
using boost::shared_ptr;
using boost::lexical_cast;
using boost::optional;
using boost::lexical_cast;
using boost::optional;
-VideoContent::VideoContent (shared_ptr<const Film> f, Time s,
ContentVideo
Frame len)
+VideoContent::VideoContent (shared_ptr<const Film> f, Time s,
VideoContent::
Frame len)
: Content (f, s)
, _video_length (len)
, _video_frame_rate (0)
: Content (f, s)
, _video_length (len)
, _video_frame_rate (0)
@@
-57,7
+59,7
@@
VideoContent::VideoContent (shared_ptr<const Film> f, boost::filesystem::path p)
VideoContent::VideoContent (shared_ptr<const Film> f, shared_ptr<const cxml::Node> node)
: Content (f, node)
{
VideoContent::VideoContent (shared_ptr<const Film> f, shared_ptr<const cxml::Node> node)
: Content (f, node)
{
- _video_length = node->number_child<
ContentVideo
Frame> ("VideoLength");
+ _video_length = node->number_child<
VideoContent::
Frame> ("VideoLength");
_video_size.width = node->number_child<int> ("VideoWidth");
_video_size.height = node->number_child<int> ("VideoHeight");
_video_frame_rate = node->number_child<float> ("VideoFrameRate");
_video_size.width = node->number_child<int> ("VideoWidth");
_video_size.height = node->number_child<int> ("VideoHeight");
_video_frame_rate = node->number_child<float> ("VideoFrameRate");
@@
-71,16
+73,6
@@
VideoContent::VideoContent (shared_ptr<const Film> f, shared_ptr<const cxml::Nod
}
}
}
}
-VideoContent::VideoContent (VideoContent const & o)
- : Content (o)
- , _video_length (o._video_length)
- , _video_size (o._video_size)
- , _video_frame_rate (o._video_frame_rate)
- , _ratio (o._ratio)
-{
-
-}
-
void
VideoContent::as_xml (xmlpp::Node* node) const
{
void
VideoContent::as_xml (xmlpp::Node* node) const
{
@@
-99,20
+91,20
@@
VideoContent::as_xml (xmlpp::Node* node) const
}
void
}
void
-VideoContent::take_from_video_
decoder (shared_ptr<VideoDecod
er> d)
+VideoContent::take_from_video_
examiner (shared_ptr<VideoExamin
er> d)
{
{
- /* These
decod
er calls could call other content methods which take a lock on the mutex */
+ /* These
examin
er calls could call other content methods which take a lock on the mutex */
libdcp::Size const vs = d->video_size ();
float const vfr = d->video_frame_rate ();
libdcp::Size const vs = d->video_size ();
float const vfr = d->video_frame_rate ();
-
{
-
boost::mutex::scoped_lock lm (_mutex);
-
_video_size = vs;
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _video_size = vs;
_video_frame_rate = vfr;
_video_frame_rate = vfr;
-
}
-
-
signal_changed (VideoContentProperty::VIDEO_SIZE);
-
signal_changed (VideoContentProperty::VIDEO_FRAME_RATE);
+ }
+
+ signal_changed (VideoContentProperty::VIDEO_SIZE);
+ signal_changed (VideoContentProperty::VIDEO_FRAME_RATE);
}
}
@@
-135,16
+127,6
@@
VideoContent::information () const
return s.str ();
}
return s.str ();
}
-void
-VideoContent::set_crop (Crop c)
-{
- {
- boost::mutex::scoped_lock lm (_mutex);
- _crop = c;
- }
- signal_changed (VideoContentProperty::VIDEO_CROP);
-}
-
void
VideoContent::set_left_crop (int c)
{
void
VideoContent::set_left_crop (int c)
{
@@
-220,3
+202,21
@@
VideoContent::set_ratio (Ratio const * r)
signal_changed (VideoContentProperty::VIDEO_RATIO);
}
signal_changed (VideoContentProperty::VIDEO_RATIO);
}
+
+/** @return string which includes everything about how this content looks */
+string
+VideoContent::identifier () const
+{
+ stringstream s;
+ s << Content::digest()
+ << "_" << crop().left
+ << "_" << crop().right
+ << "_" << crop().top
+ << "_" << crop().bottom;
+
+ if (ratio()) {
+ s << "_" << ratio()->id ();
+ }
+
+ return s.str ();
+}