diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-03-31 02:19:40 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-03-31 02:19:40 +0100 |
| commit | ed78fd3d138114185e43edf81ffe91db17377da0 (patch) | |
| tree | 398eede0828b52f222193fbdb5011791f92c774f /src | |
| parent | d4f6b22be930567dfc25be027b28a747d287d8a0 (diff) | |
Skeletal remains.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/audio_content.h | 8 | ||||
| -rw-r--r-- | src/lib/content.h | 17 | ||||
| -rw-r--r-- | src/lib/ffmpeg_content.h | 8 | ||||
| -rw-r--r-- | src/lib/film.cc | 15 | ||||
| -rw-r--r-- | src/lib/film.h | 116 | ||||
| -rw-r--r-- | src/lib/imagemagick_content.h | 6 | ||||
| -rw-r--r-- | src/lib/playlist.h | 30 | ||||
| -rw-r--r-- | src/lib/sndfile_content.h | 7 | ||||
| -rw-r--r-- | src/lib/video_content.h | 8 | ||||
| -rw-r--r-- | src/lib/video_source.h | 2 |
10 files changed, 87 insertions, 130 deletions
diff --git a/src/lib/audio_content.h b/src/lib/audio_content.h new file mode 100644 index 000000000..95fd681a7 --- /dev/null +++ b/src/lib/audio_content.h @@ -0,0 +1,8 @@ +#include "content.h" + +class AudioContent : public virtual Content +{ +public: + + +}; diff --git a/src/lib/content.h b/src/lib/content.h new file mode 100644 index 000000000..c848860aa --- /dev/null +++ b/src/lib/content.h @@ -0,0 +1,17 @@ +#include <boost/filesystem.hpp> +#include <boost/thread/mutex.hpp> + +class Content +{ +public: + boost::filesystem::path file () const { + boost::mutex::scoped_lock lm (_mutex); + return _file; + } + +protected: + boost::mutex _mutex; + +private: + boost::filesystem::path _file; +}; diff --git a/src/lib/ffmpeg_content.h b/src/lib/ffmpeg_content.h new file mode 100644 index 000000000..8b3eca62d --- /dev/null +++ b/src/lib/ffmpeg_content.h @@ -0,0 +1,8 @@ +#include "content.h" + +class FFmpegContent : public VideoContent, public AudioContent +{ +public: + + +}; diff --git a/src/lib/film.cc b/src/lib/film.cc index bd11c1eb5..0d969f16d 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -94,10 +94,8 @@ Film::Film (string d, bool must_exist) , _trim_start (0) , _trim_end (0) , _dcp_ab (false) - , _use_content_audio (true) , _audio_gain (0) , _audio_delay (0) - , _still_duration (10) , _with_subtitles (false) , _subtitle_offset (0) , _subtitle_scale (1) @@ -105,7 +103,6 @@ Film::Film (string d, bool must_exist) , _j2k_bandwidth (200000000) , _dci_metadata (Config::instance()->default_dci_metadata ()) , _dcp_frame_rate (0) - , _source_frame_rate (0) , _dirty (false) { set_dci_date_today (); @@ -154,7 +151,6 @@ Film::Film (Film const & o) , _directory (o._directory) , _name (o._name) , _use_dci_name (o._use_dci_name) - , _content (o._content) , _trust_content_header (o._trust_content_header) , _dcp_content_type (o._dcp_content_type) , _format (o._format) @@ -164,13 +160,9 @@ Film::Film (Film const & o) , _trim_start (o._trim_start) , _trim_end (o._trim_end) , _dcp_ab (o._dcp_ab) - , _content_audio_stream (o._content_audio_stream) - , _external_audio (o._external_audio) - , _use_content_audio (o._use_content_audio) , _audio_gain (o._audio_gain) , _audio_delay (o._audio_delay) , _still_duration (o._still_duration) - , _subtitle_stream (o._subtitle_stream) , _with_subtitles (o._with_subtitles) , _subtitle_offset (o._subtitle_offset) , _subtitle_scale (o._subtitle_scale) @@ -179,13 +171,6 @@ Film::Film (Film const & o) , _dci_metadata (o._dci_metadata) , _dci_date (o._dci_date) , _dcp_frame_rate (o._dcp_frame_rate) - , _size (o._size) - , _length (o._length) - , _content_digest (o._content_digest) - , _content_audio_streams (o._content_audio_streams) - , _sndfile_stream (o._sndfile_stream) - , _subtitle_streams (o._subtitle_streams) - , _source_frame_rate (o._source_frame_rate) , _dirty (o._dirty) { diff --git a/src/lib/film.h b/src/lib/film.h index adc4b0eec..2e05d64f4 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -47,6 +47,7 @@ class Log; class ExamineContentJob; class AnalyseAudioJob; class ExternalAudioStream; +class Content; /** @class Film * @brief A representation of a video, maybe with sound. @@ -116,7 +117,6 @@ public: NONE, NAME, USE_DCI_NAME, - CONTENT, TRUST_CONTENT_HEADER, DCP_CONTENT_TYPE, FORMAT, @@ -126,9 +126,6 @@ public: TRIM_START, TRIM_END, DCP_AB, - CONTENT_AUDIO_STREAM, - EXTERNAL_AUDIO, - USE_CONTENT_AUDIO, AUDIO_GAIN, AUDIO_DELAY, STILL_DURATION, @@ -139,11 +136,6 @@ public: COLOUR_LUT, J2K_BANDWIDTH, DCI_METADATA, - SIZE, - LENGTH, - CONTENT_AUDIO_STREAMS, - SUBTITLE_STREAMS, - SOURCE_FRAME_RATE, DCP_FRAME_RATE }; @@ -165,11 +157,6 @@ public: return _use_dci_name; } - std::string content () const { - boost::mutex::scoped_lock lm (_state_mutex); - return _content; - } - bool trust_content_header () const { boost::mutex::scoped_lock lm (_state_mutex); return _trust_content_header; @@ -215,21 +202,6 @@ public: return _dcp_ab; } - boost::shared_ptr<AudioStream> content_audio_stream () const { - boost::mutex::scoped_lock lm (_state_mutex); - return _content_audio_stream; - } - - std::vector<std::string> external_audio () const { - boost::mutex::scoped_lock lm (_state_mutex); - return _external_audio; - } - - bool use_content_audio () const { - boost::mutex::scoped_lock lm (_state_mutex); - return _use_content_audio; - } - float audio_gain () const { boost::mutex::scoped_lock lm (_state_mutex); return _audio_gain; @@ -240,13 +212,6 @@ public: return _audio_delay; } - int still_duration () const { - boost::mutex::scoped_lock lm (_state_mutex); - return _still_duration; - } - - int still_duration_in_frames () const; - boost::shared_ptr<SubtitleStream> subtitle_stream () const { boost::mutex::scoped_lock lm (_state_mutex); return _subtitle_stream; @@ -286,40 +251,6 @@ public: boost::mutex::scoped_lock lm (_state_mutex); return _dcp_frame_rate; } - - libdcp::Size size () const { - boost::mutex::scoped_lock lm (_state_mutex); - return _size; - } - - boost::optional<SourceFrame> length () const { - boost::mutex::scoped_lock lm (_state_mutex); - return _length; - } - - std::string content_digest () const { - boost::mutex::scoped_lock lm (_state_mutex); - return _content_digest; - } - - std::vector<boost::shared_ptr<AudioStream> > content_audio_streams () const { - boost::mutex::scoped_lock lm (_state_mutex); - return _content_audio_streams; - } - - std::vector<boost::shared_ptr<SubtitleStream> > subtitle_streams () const { - boost::mutex::scoped_lock lm (_state_mutex); - return _subtitle_streams; - } - - float source_frame_rate () const { - boost::mutex::scoped_lock lm (_state_mutex); - if (content_type() == STILL) { - return 24; - } - - return _source_frame_rate; - } boost::shared_ptr<AudioStream> audio_stream () const; bool has_audio () const; @@ -329,7 +260,6 @@ public: void set_directory (std::string); void set_name (std::string); void set_use_dci_name (bool); - void set_content (std::string); void set_trust_content_header (bool); void set_dcp_content_type (DCPContentType const *); void set_format (Format const *); @@ -343,13 +273,9 @@ public: void set_trim_start (int); void set_trim_end (int); void set_dcp_ab (bool); - void set_content_audio_stream (boost::shared_ptr<AudioStream>); - void set_external_audio (std::vector<std::string>); - void set_use_content_audio (bool); void set_audio_gain (float); void set_audio_delay (int); void set_still_duration (int); - void set_subtitle_stream (boost::shared_ptr<SubtitleStream>); void set_with_subtitles (bool); void set_subtitle_offset (int); void set_subtitle_scale (float); @@ -357,13 +283,6 @@ public: void set_j2k_bandwidth (int); void set_dci_metadata (DCIMetadata); void set_dcp_frame_rate (int); - void set_size (libdcp::Size); - void set_length (SourceFrame); - void unset_length (); - void set_content_digest (std::string); - void set_content_audio_streams (std::vector<boost::shared_ptr<AudioStream> >); - void set_subtitle_streams (std::vector<boost::shared_ptr<SubtitleStream> >); - void set_source_frame_rate (float); /** Emitted when some property has changed */ mutable boost::signals2::signal<void (Property)> Changed; @@ -399,10 +318,7 @@ private: std::string _name; /** True if a auto-generated DCI-compliant name should be used for our DCP */ bool _use_dci_name; - /** File or directory containing content; may be relative to our directory - * or an absolute path. - */ - std::string _content; + std::list<boost::shared_ptr<Content> > _content; /** If this is true, we will believe the length specified by the content * file's header; if false, we will run through the whole content file * the first time we see it in order to obtain the length. @@ -427,21 +343,10 @@ private: has the specified filters and post-processing. */ bool _dcp_ab; - /** The audio stream to use from our content */ - boost::shared_ptr<AudioStream> _content_audio_stream; - /** List of filenames of external audio files, in channel order - (L, R, C, Lfe, Ls, Rs) - */ - std::vector<std::string> _external_audio; - /** true to use audio from our content file; false to use external audio */ - bool _use_content_audio; /** Gain to apply to audio in dB */ float _audio_gain; /** Delay to apply to audio (positive moves audio later) in milliseconds */ int _audio_delay; - /** Duration to make still-sourced films (in seconds) */ - int _still_duration; - boost::shared_ptr<SubtitleStream> _subtitle_stream; /** True if subtitles should be shown for this film */ bool _with_subtitles; /** y offset for placing subtitles, in source pixels; +ve is further down @@ -465,23 +370,6 @@ private: /** Frames per second to run our DCP at */ int _dcp_frame_rate; - /* Data which are cached to speed things up */ - - /** Size, in pixels, of the source (ignoring cropping) */ - libdcp::Size _size; - /** The length of the source, in video frames (as far as we know) */ - boost::optional<SourceFrame> _length; - /** MD5 digest of our content file */ - std::string _content_digest; - /** The audio streams in our content */ - std::vector<boost::shared_ptr<AudioStream> > _content_audio_streams; - /** A stream to represent possible external audio (will always exist) */ - boost::shared_ptr<AudioStream> _sndfile_stream; - /** the subtitle streams that we can use */ - std::vector<boost::shared_ptr<SubtitleStream> > _subtitle_streams; - /** Frames per second of the source */ - float _source_frame_rate; - /** true if our state has changed since we last saved it */ mutable bool _dirty; diff --git a/src/lib/imagemagick_content.h b/src/lib/imagemagick_content.h new file mode 100644 index 000000000..2a8197b69 --- /dev/null +++ b/src/lib/imagemagick_content.h @@ -0,0 +1,6 @@ +#include "video_content.h" + +class ImageMagickContent : public VideoContent +{ + +}; diff --git a/src/lib/playlist.h b/src/lib/playlist.h new file mode 100644 index 000000000..4add76344 --- /dev/null +++ b/src/lib/playlist.h @@ -0,0 +1,30 @@ +/* + Copyright (C) 2013 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. + +*/ + +#include <boost/shared_ptr.hpp> +#include "video_source.h" +#include "video_sink.h" + +class Content; + +class Playlist : public VideoSource, public AudioSource +{ +public: + Playlist (std::list<boost::shared_ptr<Content> >); +}; diff --git a/src/lib/sndfile_content.h b/src/lib/sndfile_content.h new file mode 100644 index 000000000..382e55c40 --- /dev/null +++ b/src/lib/sndfile_content.h @@ -0,0 +1,7 @@ +#include "audio_content.h" + +class SndfileContent : public AudioContent +{ +public: + +}; diff --git a/src/lib/video_content.h b/src/lib/video_content.h new file mode 100644 index 000000000..ee4a64fc4 --- /dev/null +++ b/src/lib/video_content.h @@ -0,0 +1,8 @@ +#include "content.h" + +class VideoContent : public virtual Content +{ +public: + + +}; diff --git a/src/lib/video_source.h b/src/lib/video_source.h index 893629160..e60e7dfd0 100644 --- a/src/lib/video_source.h +++ b/src/lib/video_source.h @@ -32,7 +32,7 @@ class VideoSink; class Subtitle; class Image; -/** @class VideoSink +/** @class VideoSource * @param A class that emits video data. */ class VideoSource |
