projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move deinterleaving of audio into ffmpeg decoder.
[dcpomatic.git]
/
src
/
lib
/
film.h
diff --git
a/src/lib/film.h
b/src/lib/film.h
index bf5fb936d5b0aea7c768c6e58d8e775e0c0fa6ae..168a5e0b207ce3f350549ba61e3bfb6b6fb89015 100644
(file)
--- a/
src/lib/film.h
+++ b/
src/lib/film.h
@@
-30,13
+30,14
@@
#include <inttypes.h>
#include <boost/thread/mutex.hpp>
#include <boost/thread.hpp>
#include <inttypes.h>
#include <boost/thread/mutex.hpp>
#include <boost/thread.hpp>
+#include <boost/signals2.hpp>
+#include <boost/enable_shared_from_this.hpp>
extern "C" {
#include <libavcodec/avcodec.h>
}
#include "dcp_content_type.h"
#include "util.h"
#include "stream.h"
extern "C" {
#include <libavcodec/avcodec.h>
}
#include "dcp_content_type.h"
#include "util.h"
#include "stream.h"
-#include "trim_action.h"
class Format;
class Job;
class Format;
class Job;
@@
-61,9
+62,7
@@
public:
std::vector<std::string> audio_files () const;
std::pair<Position, std::string> thumb_subtitle (int) const;
std::vector<std::string> audio_files () const;
std::pair<Position, std::string> thumb_subtitle (int) const;
- void copy_from_dvd_post_gui ();
void examine_content ();
void examine_content ();
- void examine_content_post_gui ();
void send_dcp_to_tms ();
void copy_from_dvd ();
void send_dcp_to_tms ();
void copy_from_dvd ();
@@
-88,7
+87,7
@@
public:
std::string thumb_file (int) const;
std::string thumb_base (int) const;
std::string thumb_file (int) const;
std::string thumb_base (int) const;
-
int
thumb_frame (int) const;
+
SourceFrame
thumb_frame (int) const;
int target_audio_sample_rate () const;
int target_audio_sample_rate () const;
@@
-96,7
+95,7
@@
public:
void read_metadata ();
Size cropped_size (Size) const;
void read_metadata ();
Size cropped_size (Size) const;
-
int
dcp_length () const;
+
boost::optional<SourceFrame>
dcp_length () const;
std::string dci_name () const;
std::string dcp_name () const;
std::string dci_name () const;
std::string dcp_name () const;
@@
-106,6
+105,8
@@
public:
int audio_channels () const;
int audio_channels () const;
+ void set_dci_date_today ();
+
enum Property {
NONE,
NAME,
enum Property {
NONE,
NAME,
@@
-116,10
+117,12
@@
public:
CROP,
FILTERS,
SCALER,
CROP,
FILTERS,
SCALER,
- DCP_
FRAMES
,
- DCP_TRIM_
ACTION
,
+ DCP_
TRIM_START
,
+ DCP_TRIM_
END
,
DCP_AB,
DCP_AB,
+ USE_SOURCE_AUDIO,
AUDIO_STREAM,
AUDIO_STREAM,
+ EXTERNAL_AUDIO,
AUDIO_GAIN,
AUDIO_DELAY,
STILL_DURATION,
AUDIO_GAIN,
AUDIO_DELAY,
STILL_DURATION,
@@
-142,7
+145,7
@@
public:
/* GET */
std::string directory () const {
/* GET */
std::string directory () const {
- boost::mutex::scoped_lock lm (_
state
_mutex);
+ boost::mutex::scoped_lock lm (_
directory
_mutex);
return _directory;
}
return _directory;
}
@@
-186,21
+189,26
@@
public:
return _scaler;
}
return _scaler;
}
-
int dcp_frames
() const {
+
SourceFrame dcp_trim_start
() const {
boost::mutex::scoped_lock lm (_state_mutex);
boost::mutex::scoped_lock lm (_state_mutex);
- return _dcp_
frames
;
+ return _dcp_
trim_start
;
}
}
-
TrimAction dcp_trim_action
() const {
+
SourceFrame dcp_trim_end
() const {
boost::mutex::scoped_lock lm (_state_mutex);
boost::mutex::scoped_lock lm (_state_mutex);
- return _dcp_trim_
action
;
+ return _dcp_trim_
end
;
}
}
-
+
bool dcp_ab () const {
boost::mutex::scoped_lock lm (_state_mutex);
return _dcp_ab;
}
bool dcp_ab () const {
boost::mutex::scoped_lock lm (_state_mutex);
return _dcp_ab;
}
+ bool use_source_audio () const {
+ boost::mutex::scoped_lock lm (_state_mutex);
+ return _use_source_audio;
+ }
+
int audio_stream_index () const {
boost::mutex::scoped_lock lm (_state_mutex);
return _audio_stream;
int audio_stream_index () const {
boost::mutex::scoped_lock lm (_state_mutex);
return _audio_stream;
@@
-211,6
+219,11
@@
public:
assert (_audio_stream < int (_audio_streams.size()));
return _audio_streams[_audio_stream];
}
assert (_audio_stream < int (_audio_streams.size()));
return _audio_streams[_audio_stream];
}
+
+ std::vector<std::string> external_audio () const {
+ boost::mutex::scoped_lock lm (_state_mutex);
+ return _external_audio;
+ }
float audio_gain () const {
boost::mutex::scoped_lock lm (_state_mutex);
float audio_gain () const {
boost::mutex::scoped_lock lm (_state_mutex);
@@
-288,7
+301,7
@@
public:
return _package_type;
}
return _package_type;
}
- std::vector<
int
> thumbs () const {
+ std::vector<
SourceFrame
> thumbs () const {
boost::mutex::scoped_lock lm (_state_mutex);
return _thumbs;
}
boost::mutex::scoped_lock lm (_state_mutex);
return _thumbs;
}
@@
-298,11
+311,11
@@
public:
return _size;
}
return _size;
}
-
int
length () const {
+
boost::optional<SourceFrame>
length () const {
boost::mutex::scoped_lock lm (_state_mutex);
return _length;
}
boost::mutex::scoped_lock lm (_state_mutex);
return _length;
}
-
+
int audio_sample_rate () const {
boost::mutex::scoped_lock lm (_state_mutex);
return _audio_sample_rate;
int audio_sample_rate () const {
boost::mutex::scoped_lock lm (_state_mutex);
return _audio_sample_rate;
@@
-349,10
+362,12
@@
public:
void set_bottom_crop (int);
void set_filters (std::vector<Filter const *>);
void set_scaler (Scaler const *);
void set_bottom_crop (int);
void set_filters (std::vector<Filter const *>);
void set_scaler (Scaler const *);
- void set_dcp_
frames
(int);
- void set_dcp_trim_
action (TrimAction
);
+ void set_dcp_
trim_start
(int);
+ void set_dcp_trim_
end (int
);
void set_dcp_ab (bool);
void set_dcp_ab (bool);
+ void set_use_source_audio (bool);
void set_audio_stream (int);
void set_audio_stream (int);
+ void set_external_audio (std::vector<std::string>);
void set_audio_gain (float);
void set_audio_delay (int);
void set_still_duration (int);
void set_audio_gain (float);
void set_audio_delay (int);
void set_still_duration (int);
@@
-367,9
+382,10
@@
public:
void set_studio (std::string);
void set_facility (std::string);
void set_package_type (std::string);
void set_studio (std::string);
void set_facility (std::string);
void set_package_type (std::string);
- void set_thumbs (std::vector<
int
>);
+ void set_thumbs (std::vector<
SourceFrame
>);
void set_size (Size);
void set_size (Size);
- void set_length (int);
+ void set_length (SourceFrame);
+ void unset_length ();
void set_audio_sample_rate (int);
void set_content_digest (std::string);
void set_has_subtitles (bool);
void set_audio_sample_rate (int);
void set_content_digest (std::string);
void set_has_subtitles (bool);
@@
-378,7
+394,7
@@
public:
void set_frames_per_second (float);
/** Emitted when some property has changed */
void set_frames_per_second (float);
/** Emitted when some property has changed */
- mutable
sigc::signal1<void, Property
> Changed;
+ mutable
boost::signals2::signal<void (Property)
> Changed;
private:
private:
@@
-388,15
+404,21
@@
private:
/** Any running ExamineContentJob, or 0 */
boost::shared_ptr<ExamineContentJob> _examine_content_job;
/** Any running ExamineContentJob, or 0 */
boost::shared_ptr<ExamineContentJob> _examine_content_job;
- std::string thumb_file_for_frame (int) const;
- std::string thumb_base_for_frame (int) const;
+ /** The date that we should use in a DCI name */
+ boost::gregorian::date _dci_date;
+
+ std::string thumb_file_for_frame (SourceFrame) const;
+ std::string thumb_base_for_frame (SourceFrame) const;
void signal_changed (Property);
void signal_changed (Property);
-
std::string file_locked (std::string) const
;
-
+
void examine_content_finished ()
;
+
/** Complete path to directory containing the film metadata;
* must not be relative.
*/
std::string _directory;
/** Complete path to directory containing the film metadata;
* must not be relative.
*/
std::string _directory;
+ /** Mutex for _directory */
+ mutable boost::mutex _directory_mutex;
+
/** Name for DVD-o-matic */
std::string _name;
/** True if a auto-generated DCI-compliant name should be used for our DCP */
/** Name for DVD-o-matic */
std::string _name;
/** True if a auto-generated DCI-compliant name should be used for our DCP */
@@
-415,17
+437,19
@@
private:
std::vector<Filter const *> _filters;
/** Scaler algorithm to use */
Scaler const * _scaler;
std::vector<Filter const *> _filters;
/** Scaler algorithm to use */
Scaler const * _scaler;
- /**
Number of frames to put in the DCP, or 0 for all
*/
-
int _dcp_frames
;
- /**
What to do with audio when trimming DCPs
*/
-
TrimAction _dcp_trim_action
;
+ /**
Frames to trim off the start of the source
*/
+
SourceFrame _dcp_trim_start
;
+ /**
Frames to trim off the end of the source
*/
+
SourceFrame _dcp_trim_end
;
/** 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.
*/
bool _dcp_ab;
/** 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.
*/
bool _dcp_ab;
+ bool _use_source_audio;
/** An index into our _audio_streams vector for the stream to use for audio, or -1 if there is none */
int _audio_stream;
/** An index into our _audio_streams vector for the stream to use for audio, or -1 if there is none */
int _audio_stream;
+ std::vector<std::string> _external_audio;
/** Gain to apply to audio in dB */
float _audio_gain;
/** Delay to apply to audio (positive moves audio later) in milliseconds */
/** Gain to apply to audio in dB */
float _audio_gain;
/** Delay to apply to audio (positive moves audio later) in milliseconds */
@@
-455,11
+479,11
@@
private:
/* Data which are cached to speed things up */
/** Vector of frame indices for each of our `thumbnails' */
/* Data which are cached to speed things up */
/** Vector of frame indices for each of our `thumbnails' */
- std::vector<
int
> _thumbs;
+ std::vector<
SourceFrame
> _thumbs;
/** Size, in pixels, of the source (ignoring cropping) */
Size _size;
/** Size, in pixels, of the source (ignoring cropping) */
Size _size;
- /**
Length of the source in frames
*/
-
int
_length;
+ /**
Actual length of the source (in video frames) from examining it
*/
+
boost::optional<SourceFrame>
_length;
/** Sample rate of the source audio, in Hz */
int _audio_sample_rate;
/** MD5 digest of our content file */
/** Sample rate of the source audio, in Hz */
int _audio_sample_rate;
/** MD5 digest of our content file */
@@
-475,6
+499,7
@@
private:
mutable bool _dirty;
mutable bool _dirty;
+ /** Mutex for all state except _directory */
mutable boost::mutex _state_mutex;
friend class paths_test;
mutable boost::mutex _state_mutex;
friend class paths_test;