summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-11-04 01:15:31 +0000
committerCarl Hetherington <cth@carlh.net>2012-11-04 01:15:31 +0000
commitfad1998b907232b01a46369a49b55129149613bb (patch)
treed6a330ec0d27d76480acbd4eac849c91e053fe20 /src/lib
parent09fcd95ff5125d7238188c59aa40430acb45ecbc (diff)
Remove trim action settings.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/decoder.cc4
-rw-r--r--src/lib/film.cc44
-rw-r--r--src/lib/film.h10
-rw-r--r--src/lib/options.h2
-rw-r--r--src/lib/trim_action.h28
5 files changed, 0 insertions, 88 deletions
diff --git a/src/lib/decoder.cc b/src/lib/decoder.cc
index 6f5d63358..32d0bab64 100644
--- a/src/lib/decoder.cc
+++ b/src/lib/decoder.cc
@@ -300,10 +300,6 @@ Decoder::process_video (AVFrame* frame)
list<shared_ptr<Image> > images = graph->process (frame);
for (list<shared_ptr<Image> >::iterator i = images.begin(); i != images.end(); ++i) {
- if (_opt->black_after > 0 && _video_frame_index > _opt->black_after) {
- (*i)->make_black ();
- }
-
shared_ptr<Subtitle> sub;
if (_timed_subtitle && _timed_subtitle->displayed_at (double (video_frame_index()) / _film->frames_per_second())) {
sub = _timed_subtitle->subtitle ();
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 9c351a64d..70c8f7db2 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -82,7 +82,6 @@ Film::Film (string d, bool must_exist)
, _dcp_content_type (0)
, _format (0)
, _scaler (Scaler::from_id ("bicubic"))
- , _dcp_trim_action (CUT)
, _dcp_ab (false)
, _audio_stream (-1)
, _audio_gain (0)
@@ -143,7 +142,6 @@ Film::Film (Film const & o)
, _filters (o._filters)
, _scaler (o._scaler)
, _dcp_frames (o._dcp_frames)
- , _dcp_trim_action (o._dcp_trim_action)
, _dcp_ab (o._dcp_ab)
, _audio_stream (o._audio_stream)
, _audio_gain (o._audio_gain)
@@ -254,21 +252,6 @@ Film::make_dcp (bool transcode)
shared_ptr<Options> o (new Options (j2k_dir(), ".j2c", dir ("wavs")));
o->out_size = format()->dcp_size ();
- if (!dcp_frames()) {
- /* Decode the whole film, no blacking */
- o->black_after = 0;
- } else {
- switch (dcp_trim_action()) {
- case CUT:
- /* Decode only part of the film, no blacking */
- o->black_after = 0;
- break;
- case BLACK_OUT:
- /* Decode the whole film, but black some frames out */
- o->black_after = dcp_frames().get ();
- }
- }
-
o->padding = format()->dcp_padding (shared_from_this ());
o->ratio = format()->ratio_as_float (shared_from_this ());
o->decode_subtitles = with_subtitles ();
@@ -420,17 +403,6 @@ Film::write_metadata () const
}
f << "scaler " << _scaler->id () << "\n";
f << "dcp_frames " << _dcp_frames.get_value_or(0) << "\n";
-
- f << "dcp_trim_action ";
- switch (_dcp_trim_action) {
- case CUT:
- f << "cut\n";
- break;
- case BLACK_OUT:
- f << "black_out\n";
- break;
- }
-
f << "dcp_ab " << (_dcp_ab ? "1" : "0") << "\n";
f << "selected_audio_stream " << _audio_stream << "\n";
f << "audio_gain " << _audio_gain << "\n";
@@ -514,12 +486,6 @@ Film::read_metadata ()
if (vv) {
_dcp_frames = vv;
}
- } else if (k == "dcp_trim_action") {
- if (v == "cut") {
- _dcp_trim_action = CUT;
- } else if (v == "black_out") {
- _dcp_trim_action = BLACK_OUT;
- }
} else if (k == "dcp_ab") {
_dcp_ab = (v == "1");
} else if (k == "selected_audio_stream") {
@@ -1066,16 +1032,6 @@ Film::unset_dcp_frames ()
}
void
-Film::set_dcp_trim_action (TrimAction a)
-{
- {
- boost::mutex::scoped_lock lm (_state_mutex);
- _dcp_trim_action = a;
- }
- signal_changed (DCP_TRIM_ACTION);
-}
-
-void
Film::set_dcp_ab (bool a)
{
{
diff --git a/src/lib/film.h b/src/lib/film.h
index f3ddc652a..ff312fcb5 100644
--- a/src/lib/film.h
+++ b/src/lib/film.h
@@ -38,7 +38,6 @@ extern "C" {
#include "dcp_content_type.h"
#include "util.h"
#include "stream.h"
-#include "trim_action.h"
class Format;
class Job;
@@ -119,7 +118,6 @@ public:
FILTERS,
SCALER,
DCP_FRAMES,
- DCP_TRIM_ACTION,
DCP_AB,
AUDIO_STREAM,
AUDIO_GAIN,
@@ -193,11 +191,6 @@ public:
return _dcp_frames;
}
- TrimAction dcp_trim_action () const {
- boost::mutex::scoped_lock lm (_state_mutex);
- return _dcp_trim_action;
- }
-
bool dcp_ab () const {
boost::mutex::scoped_lock lm (_state_mutex);
return _dcp_ab;
@@ -353,7 +346,6 @@ public:
void set_scaler (Scaler const *);
void set_dcp_frames (int);
void unset_dcp_frames ();
- void set_dcp_trim_action (TrimAction);
void set_dcp_ab (bool);
void set_audio_stream (int);
void set_audio_gain (float);
@@ -426,8 +418,6 @@ private:
Scaler const * _scaler;
/** Maximum number of frames to put in the DCP, if applicable */
boost::optional<int> _dcp_frames;
- /** What to do with audio when trimming DCPs */
- TrimAction _dcp_trim_action;
/** true to create an A/B comparison DCP, where the left half of the image
is the video without any filters or post-processing, and the right half
has the specified filters and post-processing.
diff --git a/src/lib/options.h b/src/lib/options.h
index 86db35210..d8b99815d 100644
--- a/src/lib/options.h
+++ b/src/lib/options.h
@@ -39,7 +39,6 @@ public:
Options (std::string f, std::string e, std::string m)
: padding (0)
, apply_crop (true)
- , black_after (0)
, decode_video_frequency (0)
, decode_audio (true)
, decode_subtitles (false)
@@ -97,7 +96,6 @@ public:
float ratio; ///< ratio of the wanted output image (not considering padding)
int padding; ///< number of pixels of padding (in terms of the output size) each side of the image
bool apply_crop; ///< true to apply cropping
- int black_after; ///< first frame for which to output a black frame, rather than the actual video content, or 0 for none
int decode_video_frequency; ///< skip frames so that this many are decoded in all (or 0) (for generating thumbnails)
bool decode_audio; ///< true to decode audio, otherwise false
bool decode_subtitles;
diff --git a/src/lib/trim_action.h b/src/lib/trim_action.h
deleted file mode 100644
index 405d31bbc..000000000
--- a/src/lib/trim_action.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- Copyright (C) 2012 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
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef DVDOMATIC_TRIM_ACTION_H
-#define DVDOMATIC_TRIM_ACTION_H
-
-enum TrimAction {
- CUT, ///< cut everything out after dcp_frames
- BLACK_OUT ///< black out after dcp_frames so that the film stays the same length (and audio continues)
-};
-
-#endif