#include <stdint.h>
#include <boost/shared_ptr.hpp>
#include <sigc++/sigc++.h>
-#ifdef HAVE_SWRESAMPLE
-extern "C" {
-#include <libswresample/swresample.h>
-}
-#endif
#include "util.h"
class Job;
class Image;
class Log;
class DelayLine;
+class TimedSubtitle;
+class Subtitle;
/** @class Decoder.
* @brief Parent class for decoders of content.
/** @return format of audio samples */
virtual AVSampleFormat audio_sample_format () const = 0;
virtual int64_t audio_channel_layout () const = 0;
+ virtual bool has_subtitles () const = 0;
void process_begin ();
bool pass ();
return _video_frame;
}
- int decoding_frames () const;
-
/** Emitted when a video frame is ready.
* First parameter is the frame.
* Second parameter is its index within the content.
+ * Third parameter is either 0 or a subtitle that should be on this frame.
*/
- sigc::signal<void, boost::shared_ptr<Image>, int> Video;
+ sigc::signal<void, boost::shared_ptr<Image>, int, boost::shared_ptr<Subtitle> > Video;
/** Emitted when some audio data is ready.
* First parameter is the interleaved sample data, format is given in the FilmState.
void process_video (AVFrame *);
void process_audio (uint8_t *, int);
+ void process_subtitle (boost::shared_ptr<TimedSubtitle>);
/** our FilmState */
boost::shared_ptr<const FilmState> _fs;
AVFilterContext* _buffer_src_context;
AVFilterContext* _buffer_sink_context;
-#if HAVE_SWRESAMPLE
- SwrContext* _swr_context;
-#endif
-
bool _have_setup_video_filters;
DelayLine* _delay_line;
int _delay_in_bytes;
/* Number of audio frames that we have pushed to the encoder
(at the DCP sample rate).
*/
- int _audio_frames_processed;
+ int64_t _audio_frames_processed;
+
+ boost::shared_ptr<TimedSubtitle> _timed_subtitle;
};
#endif