projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
pot/merge.
[dcpomatic.git]
/
src
/
lib
/
ffmpeg_content.cc
diff --git
a/src/lib/ffmpeg_content.cc
b/src/lib/ffmpeg_content.cc
index 515b58cd0fbaa82eac39ec95d2194525b2f39406..20fe7776bd9aafb80ca12c0fbd035875c0551aaf 100644
(file)
--- a/
src/lib/ffmpeg_content.cc
+++ b/
src/lib/ffmpeg_content.cc
@@
-19,22
+19,22
@@
*/
*/
-#include "ffmpeg_content.h"
-#include "video_content.h"
#include "audio_content.h"
#include "audio_content.h"
-#include "ffmpeg_examiner.h"
-#include "ffmpeg_subtitle_stream.h"
-#include "ffmpeg_audio_stream.h"
#include "compose.hpp"
#include "compose.hpp"
-#include "job.h"
-#include "util.h"
-#include "filter.h"
-#include "film.h"
-#include "log.h"
#include "config.h"
#include "config.h"
+#include "constants.h"
#include "exceptions.h"
#include "exceptions.h"
+#include "ffmpeg_audio_stream.h"
+#include "ffmpeg_content.h"
+#include "ffmpeg_examiner.h"
+#include "ffmpeg_subtitle_stream.h"
+#include "film.h"
+#include "filter.h"
#include "frame_rate_change.h"
#include "frame_rate_change.h"
+#include "job.h"
+#include "log.h"
#include "text_content.h"
#include "text_content.h"
+#include "video_content.h"
#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
extern "C" {
#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
extern "C" {
@@
-115,9
+115,8
@@
FFmpegContent::FFmpegContent (cxml::ConstNodePtr node, int version, list<string>
}
for (auto i: node->node_children("Filter")) {
}
for (auto i: node->node_children("Filter")) {
- Filter const * f = Filter::from_id(i->content());
- if (f) {
- _filters.push_back (f);
+ if (auto filter = Filter::from_id(i->content())) {
+ _filters.push_back(*filter);
} else {
notes.push_back (String::compose (_("DCP-o-matic no longer supports the `%1' filter, so it has been turned off."), i->content()));
}
} else {
notes.push_back (String::compose (_("DCP-o-matic no longer supports the `%1' filter, so it has been turned off."), i->content()));
}
@@
-232,7
+231,7
@@
FFmpegContent::as_xml (xmlpp::Node* node, bool with_paths) const
}
for (auto i: _filters) {
}
for (auto i: _filters) {
- node->add_child("Filter")->add_child_text(i
->
id());
+ node->add_child("Filter")->add_child_text(i
.
id());
}
if (_first_video) {
}
if (_first_video) {
@@
-292,14
+291,17
@@
FFmpegContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
if (examiner->rotation()) {
auto rot = *examiner->rotation ();
if (fabs (rot - 180) < 1.0) {
if (examiner->rotation()) {
auto rot = *examiner->rotation ();
if (fabs (rot - 180) < 1.0) {
- _filters.push_back
(Filter::from_id
("vflip"));
- _filters.push_back
(Filter::from_id
("hflip"));
+ _filters.push_back
(*Filter::from_id
("vflip"));
+ _filters.push_back
(*Filter::from_id
("hflip"));
} else if (fabs (rot - 90) < 1.0) {
} else if (fabs (rot - 90) < 1.0) {
- _filters.push_back
(Filter::from_id
("90clock"));
+ _filters.push_back
(*Filter::from_id
("90clock"));
} else if (fabs (rot - 270) < 1.0) {
} else if (fabs (rot - 270) < 1.0) {
- _filters.push_back
(Filter::from_id
("90anticlock"));
+ _filters.push_back
(*Filter::from_id
("90anticlock"));
}
}
}
}
+ if (examiner->has_alpha()) {
+ _filters.push_back(*Filter::from_id("premultiply"));
+ }
}
if (!examiner->audio_streams().empty()) {
}
if (!examiner->audio_streams().empty()) {
@@
-455,7
+457,7
@@
FFmpegContent::approximate_length () const
void
void
-FFmpegContent::set_filters
(vector<Filter const *> const
& filters)
+FFmpegContent::set_filters
(vector<Filter> const
& filters)
{
ContentChangeSignaller cc (this, FFmpegContentProperty::FILTERS);
{
ContentChangeSignaller cc (this, FFmpegContentProperty::FILTERS);
@@
-486,7
+488,7
@@
FFmpegContent::identifier () const
}
for (auto i: _filters) {
}
for (auto i: _filters) {
- s += "_" + i
->
id();
+ s += "_" + i
.
id();
}
return s;
}
return s;