return _tms_password;
}
+ /** @return The sound processor that we are using */
SoundProcessor const * sound_processor () const {
return _sound_processor;
}
*/
+/** @file src/lib/filter_graph.cc
+ * @brief A graph of FFmpeg filters.
+ */
+
extern "C" {
#include <libavfilter/avfiltergraph.h>
#include <libavfilter/buffersrc.h>
using std::list;
using boost::shared_ptr;
+/** Construct a FilterGraph for the settings in a film.
+ * @param film Film.
+ * @param decoder Decoder that we are using.
+ * @param crop true to apply crop, otherwise false.
+ * @param s Size of the images to process.
+ * @param p Pixel format of the images to process.
+ */
FilterGraph::FilterGraph (shared_ptr<Film> film, FFmpegDecoder* decoder, bool crop, Size s, AVPixelFormat p)
: _buffer_src_context (0)
, _buffer_sink_context (0)
/* XXX: leaking `inputs' / `outputs' ? */
}
+/** Take an AVFrame and process it using our configured filters, returning a
+ * set of Images.
+ */
list<shared_ptr<Image> >
FilterGraph::process (AVFrame const * frame)
{
return images;
}
+/** @param s Image size.
+ * @param p Pixel format.
+ * @return true if this chain can process images with `s' and `p', otherwise false.
+ */
bool
FilterGraph::can_process (Size s, AVPixelFormat p) const
{
*/
+/** @file src/lib/filter_graph.h
+ * @brief A graph of FFmpeg filters.
+ */
+
#ifndef DVDOMATIC_FILTER_GRAPH_H
#define DVDOMATIC_FILTER_GRAPH_H
class VideoFilter;
class FFmpegDecoder;
+/** @class FilterGraph
+ * @brief A graph of FFmpeg filters.
+ */
class FilterGraph
{
public:
private:
AVFilterContext* _buffer_src_context;
AVFilterContext* _buffer_sink_context;
- Size _size;
- AVPixelFormat _pixel_format;
+ Size _size; ///< size of the images that this chain can process
+ AVPixelFormat _pixel_format; ///< pixel format of the images that this chain can process
};
#endif
using boost::shared_ptr;
/** @param s Film that we are operating on.
+ * @param req Job that must be completed before this job is run.
*/
Job::Job (shared_ptr<Film> f, shared_ptr<Job> req)
: _film (f)
}
}
+/** @return true if this job is new (ie has not started running) */
bool
Job::is_new () const
{
class Processor
{
public:
+ /** Construct a Processor.
+ * @param log Log to use.
+ */
Processor (Log* log)
: _log (log)
{}
-
- virtual void process_begin () {}
+
+ /** Will be called at the end of a processing run */
virtual void process_end () {}
protected:
- Log* _log;
+ Log* _log; ///< log to write to
};
/** @class AudioVideoProcessor
class AudioVideoProcessor : public Processor, public VideoSource, public VideoSink, public AudioSource, public AudioSink
{
public:
+ /** Construct an AudioVideoProcessor.
+ * @param log Log to write to.
+ */
AudioVideoProcessor (Log* log)
: Processor (log)
{}
class AudioProcessor : public Processor, public AudioSource, public AudioSink
{
public:
+ /** Construct an AudioProcessor.
+ * @param log Log to write to.
+ */
AudioProcessor (Log* log)
: Processor (log)
{}
class VideoProcessor : public Processor, public VideoSource, public VideoSink
{
public:
+ /** Construct an VideoProcessor.
+ * @param log Log to write to.
+ */
VideoProcessor (Log* log)
: Processor (log)
{}
using boost::shared_ptr;
using boost::optional;
+/** Construct a SubtitleStream from a value returned from to_string().
+ * @param t String returned from to_string().
+ * @param v State file version.
+ */
SubtitleStream::SubtitleStream (string t, boost::optional<int>)
{
stringstream n (t);
}
}
+/** @return A canonical string representation of this stream */
string
SubtitleStream::to_string () const
{
return String::compose ("%1 %2", _id, _name);
}
+/** Create a SubtitleStream from a value returned from to_string().
+ * @param t String returned from to_string().
+ * @param v State file version.
+ */
shared_ptr<SubtitleStream>
SubtitleStream::create (string t, optional<int> v)
{
return shared_ptr<SubtitleStream> (new SubtitleStream (t, v));
}
+/** Create an AudioStream from a string returned from to_string().
+ * @param t String returned from to_string().
+ * @param v State file version.
+ * @return AudioStream, or 0.
+ */
shared_ptr<AudioStream>
audio_stream_factory (string t, optional<int> v)
{
return s;
}
+/** Create a SubtitleStream from a string returned from to_string().
+ * @param t String returned from to_string().
+ * @param v State file version.
+ * @return SubtitleStream, or 0.
+ */
shared_ptr<SubtitleStream>
subtitle_stream_factory (string t, optional<int> v)
{
*/
+/** @file src/lib/stream.h
+ * @brief Representations of audio and subtitle streams.
+ *
+ * Some content may have multiple `streams' of audio and/or subtitles; perhaps
+ * for multiple languages, or for stereo / surround mixes. These classes represent
+ * those streams, and know about their details.
+ */
+
#ifndef DVDOMATIC_STREAM_H
#define DVDOMATIC_STREAM_H
#include <libavutil/audioconvert.h>
}
+/** @class Stream
+ * @brief Parent class for streams.
+ */
class Stream
{
public:
virtual std::string to_string () const = 0;
};
+/** @class AudioStream
+ * @brief A stream of audio data.
+ */
struct AudioStream : public Stream
{
public:
int64_t _channel_layout;
};
+/** @class SubtitleStream
+ * @brief A stream of subtitle data.
+ */
class SubtitleStream : public Stream
{
public:
/** @param s Film to use.
* @param o Options.
+ * @param req Job that must be completed before this job is run.
*/
TranscodeJob::TranscodeJob (shared_ptr<Film> f, shared_ptr<const Options> o, shared_ptr<Job> req)
: Job (f, req)
#endif
}
+/** @param start Start position for the crop within the image.
+ * @param size Size of the cropped area.
+ * @return FFmpeg crop filter string.
+ */
string
crop_string (Position start, Size size)
{
return s.str ();
}
+/** @param s A string.
+ * @return Parts of the string split at spaces, except when a space is within quotation marks.
+ */
vector<string>
split_at_spaces_considering_quotes (string s)
{
return s.str ();
}
+/** @param fps Arbitrary frames-per-second value.
+ * @return DCPFrameRate for this frames-per-second.
+ */
DCPFrameRate
dcp_frame_rate (float fps)
{
memcpy (data, _buffer, size);
}
+/** @param other A Rect.
+ * @return The intersection of this with `other'.
+ */
Rect
Rect::intersection (Rect const & other) const
{
* @param t Multiple to round to.
* @return Rounded number.
*/
-
int
stride_round_up (int c, int const * stride, int t)
{
}
}
+/** AudioBuffers destructor */
AudioBuffers::~AudioBuffers ()
{
for (int i = 0; i < _channels; ++i) {
#define TIMING(...)
#endif
+/** The maximum number of audio channels that we can cope with */
#define MAX_AUDIO_CHANNELS 6
class Scaler;
struct DCPFrameRate
{
+ /** frames per second for the DCP */
int frames_per_second;
+ /** Skip every `skip' frames. e.g. if this is 1, we skip nothing;
+ * if it's 2, we skip every other frame.
+ */
int skip;
+ /** true if this DCP will run its video faster than the source
+ * (e.g. if the source is 29.97fps and we will run the DCP at 30fps)
+ */
bool run_fast;
};
enum ContentType {
- STILL,
- VIDEO
+ STILL, ///< content is still images
+ VIDEO ///< content is a video
};
/** @class Size
extern bool operator== (Size const & a, Size const & b);
-/** A description of the crop of an image or video. */
+/** @struct Crop
+ * @brief A description of the crop of an image or video.
+ */
struct Crop
{
Crop () : left (0), right (0), top (0), bottom (0) {}
extern bool operator== (Crop const & a, Crop const & b);
extern bool operator!= (Crop const & a, Crop const & b);
-/** A position */
+/** @struct Position
+ * @brief A position.
+ */
struct Position
{
Position ()
int y;
};
-/** A rectangle */
+/** @struct Rect
+ * @brief A rectangle.
+ */
struct Rect
{
Rect ()
void emit_subtitle (boost::shared_ptr<TimedSubtitle>);
void repeat_last_video ();
+ /** Subtitle stream to use when decoding */
boost::shared_ptr<SubtitleStream> _subtitle_stream;
+ /** Subtitle streams that this decoder's content has */
std::vector<boost::shared_ptr<SubtitleStream> > _subtitle_streams;
private: