projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Basic and rather clumsy option to respect KDM validity windows.
[dcpomatic.git]
/
src
/
lib
/
ffmpeg_content.cc
diff --git
a/src/lib/ffmpeg_content.cc
b/src/lib/ffmpeg_content.cc
index 3f0a692cdd646f7e08444920ebc7e03eaea114d6..961c0b0a39c77d9a63372f4fb34b870fa98fdc33 100644
(file)
--- a/
src/lib/ffmpeg_content.cc
+++ b/
src/lib/ffmpeg_content.cc
@@
-32,7
+32,7
@@
#include "log.h"
#include "exceptions.h"
#include "frame_rate_change.h"
#include "log.h"
#include "exceptions.h"
#include "frame_rate_change.h"
-#include "
caption
_content.h"
+#include "
text
_content.h"
#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
extern "C" {
#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
extern "C" {
@@
-85,7
+85,7
@@
FFmpegContent::FFmpegContent (shared_ptr<const Film> film, cxml::ConstNodePtr no
{
video = VideoContent::from_xml (this, node, version);
audio = AudioContent::from_xml (this, node, version);
{
video = VideoContent::from_xml (this, node, version);
audio = AudioContent::from_xml (this, node, version);
-
caption = Caption
Content::from_xml (this, node, version);
+
text = Text
Content::from_xml (this, node, version);
list<cxml::NodePtr> c = node->node_children ("SubtitleStream");
for (list<cxml::NodePtr>::const_iterator i = c.begin(); i != c.end(); ++i) {
list<cxml::NodePtr> c = node->node_children ("SubtitleStream");
for (list<cxml::NodePtr>::const_iterator i = c.begin(); i != c.end(); ++i) {
@@
-135,12
+135,12
@@
FFmpegContent::FFmpegContent (shared_ptr<const Film> film, vector<shared_ptr<Con
bool need_video = false;
bool need_audio = false;
bool need_video = false;
bool need_audio = false;
- bool need_
caption
= false;
+ bool need_
text
= false;
if (i != c.end ()) {
need_video = static_cast<bool> ((*i)->video);
need_audio = static_cast<bool> ((*i)->audio);
if (i != c.end ()) {
need_video = static_cast<bool> ((*i)->video);
need_audio = static_cast<bool> ((*i)->audio);
- need_
caption = !(*i)->caption
.empty();
+ need_
text = !(*i)->text
.empty();
}
while (i != c.end ()) {
}
while (i != c.end ()) {
@@
-150,8
+150,8
@@
FFmpegContent::FFmpegContent (shared_ptr<const Film> film, vector<shared_ptr<Con
if (need_audio != static_cast<bool> ((*i)->audio)) {
throw JoinError (_("Content to be joined must all have or not have audio"));
}
if (need_audio != static_cast<bool> ((*i)->audio)) {
throw JoinError (_("Content to be joined must all have or not have audio"));
}
- if (need_
caption != !(*i)->caption
.empty()) {
- throw JoinError (_("Content to be joined must all have or not have captions"));
+ if (need_
text != !(*i)->text
.empty()) {
+ throw JoinError (_("Content to be joined must all have or not have
subtitles or
captions"));
}
++i;
}
}
++i;
}
@@
-162,8
+162,8
@@
FFmpegContent::FFmpegContent (shared_ptr<const Film> film, vector<shared_ptr<Con
if (need_audio) {
audio.reset (new AudioContent (this, c));
}
if (need_audio) {
audio.reset (new AudioContent (this, c));
}
- if (need_
caption
) {
-
caption.push_back (shared_ptr<CaptionContent> (new Caption
Content (this, c)));
+ if (need_
text
) {
+
text.push_back (shared_ptr<TextContent> (new Text
Content (this, c)));
}
shared_ptr<FFmpegContent> ref = dynamic_pointer_cast<FFmpegContent> (c[0]);
}
shared_ptr<FFmpegContent> ref = dynamic_pointer_cast<FFmpegContent> (c[0]);
@@
-171,7
+171,7
@@
FFmpegContent::FFmpegContent (shared_ptr<const Film> film, vector<shared_ptr<Con
for (size_t i = 0; i < c.size(); ++i) {
shared_ptr<FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (c[i]);
for (size_t i = 0; i < c.size(); ++i) {
shared_ptr<FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (c[i]);
- if (fc->only_
caption() && fc->only_caption
()->use() && *(fc->_subtitle_stream.get()) != *(ref->_subtitle_stream.get())) {
+ if (fc->only_
text() && fc->only_text
()->use() && *(fc->_subtitle_stream.get()) != *(ref->_subtitle_stream.get())) {
throw JoinError (_("Content to be joined must use the same subtitle stream."));
}
}
throw JoinError (_("Content to be joined must use the same subtitle stream."));
}
}
@@
-209,8
+209,8
@@
FFmpegContent::as_xml (xmlpp::Node* node, bool with_paths) const
}
}
}
}
- if (only_
caption
()) {
- only_
caption
()->as_xml (node);
+ if (only_
text
()) {
+ only_
text
()->as_xml (node);
}
boost::mutex::scoped_lock lm (_mutex);
}
boost::mutex::scoped_lock lm (_mutex);
@@
-251,6
+251,9
@@
FFmpegContent::as_xml (xmlpp::Node* node, bool with_paths) const
void
FFmpegContent::examine (shared_ptr<Job> job)
{
void
FFmpegContent::examine (shared_ptr<Job> job)
{
+ ChangeSignaller<Content> cc1 (this, FFmpegContentProperty::SUBTITLE_STREAMS);
+ ChangeSignaller<Content> cc2 (this, FFmpegContentProperty::SUBTITLE_STREAM);
+
job->set_progress_unknown ();
Content::examine (job);
job->set_progress_unknown ();
Content::examine (job);
@@
-303,8
+306,8
@@
FFmpegContent::examine (shared_ptr<Job> job)
_subtitle_streams = examiner->subtitle_streams ();
if (!_subtitle_streams.empty ()) {
_subtitle_streams = examiner->subtitle_streams ();
if (!_subtitle_streams.empty ()) {
-
caption
.clear ();
-
caption.push_back (shared_ptr<CaptionContent> (new CaptionContent (this, CAPTION_OPE
N)));
+
text
.clear ();
+
text.push_back (shared_ptr<TextContent> (new TextContent (this, TEXT_OPEN_SUBTITLE, TEXT_UNKNOW
N)));
_subtitle_stream = _subtitle_streams.front ();
}
_subtitle_stream = _subtitle_streams.front ();
}
@@
-313,9
+316,6
@@
FFmpegContent::examine (shared_ptr<Job> job)
if (examiner->has_video ()) {
set_default_colour_conversion ();
}
if (examiner->has_video ()) {
set_default_colour_conversion ();
}
-
- signal_changed (FFmpegContentProperty::SUBTITLE_STREAMS);
- signal_changed (FFmpegContentProperty::SUBTITLE_STREAM);
}
string
}
string
@@
-369,12
+369,12
@@
FFmpegContent::technical_summary () const
void
FFmpegContent::set_subtitle_stream (shared_ptr<FFmpegSubtitleStream> s)
{
void
FFmpegContent::set_subtitle_stream (shared_ptr<FFmpegSubtitleStream> s)
{
+ ChangeSignaller<Content> cc (this, FFmpegContentProperty::SUBTITLE_STREAM);
+
{
boost::mutex::scoped_lock lm (_mutex);
_subtitle_stream = s;
}
{
boost::mutex::scoped_lock lm (_mutex);
_subtitle_stream = s;
}
-
- signal_changed (FFmpegContentProperty::SUBTITLE_STREAM);
}
bool
}
bool
@@
-410,12
+410,12
@@
FFmpegContent::full_length () const
void
FFmpegContent::set_filters (vector<Filter const *> const & filters)
{
void
FFmpegContent::set_filters (vector<Filter const *> const & filters)
{
+ ChangeSignaller<Content> cc (this, FFmpegContentProperty::FILTERS);
+
{
boost::mutex::scoped_lock lm (_mutex);
_filters = filters;
}
{
boost::mutex::scoped_lock lm (_mutex);
_filters = filters;
}
-
- signal_changed (FFmpegContentProperty::FILTERS);
}
string
}
string
@@
-427,8
+427,8
@@
FFmpegContent::identifier () const
s += "_" + video->identifier();
}
s += "_" + video->identifier();
}
- if (only_
caption() && only_caption()->use() && only_caption
()->burn()) {
- s += "_" + only_
caption
()->identifier();
+ if (only_
text() && only_text()->use() && only_text
()->burn()) {
+ s += "_" + only_
text
()->identifier();
}
boost::mutex::scoped_lock lm (_mutex);
}
boost::mutex::scoped_lock lm (_mutex);
@@
-629,7
+629,8
@@
FFmpegContent::add_properties (list<UserProperty>& p) const
void
FFmpegContent::signal_subtitle_stream_changed ()
{
void
FFmpegContent::signal_subtitle_stream_changed ()
{
- signal_changed (FFmpegContentProperty::SUBTITLE_STREAM);
+ /* XXX: this is too late; really it should be before the change */
+ ChangeSignaller<Content> cc (this, FFmpegContentProperty::SUBTITLE_STREAM);
}
vector<shared_ptr<FFmpegAudioStream> >
}
vector<shared_ptr<FFmpegAudioStream> >