return _file;
}
+ /** @return MD5 digest of the content's file */
std::string digest () const {
boost::mutex::scoped_lock lm (_mutex);
return _digest;
audio_stream()->mapping = m;
signal_changed (AudioContentProperty::AUDIO_MAPPING);
}
+
+string
+FFmpegContent::identifier () const
+{
+ stringstream s;
+
+ s << VideoContent::identifier();
+
+ boost::mutex::scoped_lock lm (_mutex);
+
+ if (_subtitle_stream) {
+ s << "_" << _subtitle_stream->id;
+ }
+
+ for (vector<Filter const *>::const_iterator i = _filters.begin(); i != _filters.end(); ++i) {
+ s << "_" << (*i)->id ();
+ }
+
+ return s.str ();
+}
boost::shared_ptr<Content> clone () const;
Time length () const;
+ std::string identifier () const;
+
/* AudioContent */
int audio_channels () const;
AudioContent::Frame audio_length () const;
}
string
-Film::video_state_identifier () const
+Film::video_identifier () const
{
assert (container ());
LocaleGuard lg;
stringstream s;
s << container()->id()
- << "_" << _playlist->video_digest()
+ << "_" << _playlist->video_identifier()
<< "_" << _dcp_video_frame_rate
<< "_" << scaler()->id()
<< "_" << j2k_bandwidth()
{
boost::filesystem::path p;
p /= "info";
- p /= video_state_identifier ();
+ p /= video_identifier ();
return dir (p.string());
}
string
Film::internal_video_mxf_filename () const
{
- return video_state_identifier() + ".mxf";
+ return video_identifier() + ".mxf";
}
string
{
boost::filesystem::path p;
p /= "j2c";
- p /= video_state_identifier ();
+ p /= video_identifier ();
stringstream s;
s.width (8);
private:
void signal_changed (Property);
- std::string video_state_identifier () const;
+ std::string video_identifier () const;
void playlist_changed ();
void playlist_content_changed (boost::weak_ptr<Content>, int);
std::string filename_safe_name () const;
return video_length() * frc.factor() * TIME_HZ / film->dcp_video_frame_rate ();
}
+string
+ImageMagickContent::identifier () const
+{
+ stringstream s;
+ s << VideoContent::identifier ();
+ s << "_" << video_length();
+}
boost::shared_ptr<Content> clone () const;
Time length () const;
+ std::string identifier () const;
+
void set_video_length (VideoContent::Frame);
static bool valid_file (boost::filesystem::path);
}
string
-Playlist::video_digest () const
+Playlist::video_identifier () const
{
string t;
for (ContentList::const_iterator i = _content.begin(); i != _content.end(); ++i) {
- if (!dynamic_pointer_cast<const VideoContent> (*i)) {
- continue;
- }
-
- t += (*i)->digest ();
- shared_ptr<const FFmpegContent> fc = dynamic_pointer_cast<const FFmpegContent> (*i);
- if (fc && fc->subtitle_stream()) {
- t += fc->subtitle_stream()->id;
+ shared_ptr<const VideoContent> vc = dynamic_pointer_cast<const VideoContent> (*i);
+ if (vc) {
+ t += vc->identifier ();
}
}
return _content;
}
- std::string video_digest () const;
+ std::string video_identifier () const;
int loop () const {
return _loop;
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 ();
+}
void as_xml (xmlpp::Node *) const;
virtual std::string information () const;
+ virtual std::string identifier () const;
VideoContent::Frame video_length () const {
boost::mutex::scoped_lock lm (_mutex);