#include <boost/shared_ptr.hpp>
#include <sigc++/sigc++.h>
#include "util.h"
+#include "stream.h"
class Job;
class FilmState;
class Image;
class Log;
class DelayLine;
+class TimedSubtitle;
class Subtitle;
/** @class Decoder.
int last_video_frame () const {
return _video_frame;
}
+
+ virtual std::vector<Stream> audio_streams () const {
+ return std::vector<Stream> ();
+ }
+
+ virtual std::vector<Stream> subtitle_streams () const {
+ return std::vector<Stream> ();
+ }
+
+ virtual void set_audio_stream (Stream s) {}
+ virtual void set_subtitle_stream (Stream s) {}
/** Emitted when a video frame is ready.
* First parameter is the frame.
*/
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.
- * Second parameter is the size of the data.
- */
- sigc::signal<void, uint8_t *, int> Audio;
+ /** Emitted when some audio data is ready */
+ sigc::signal<void, boost::shared_ptr<AudioBuffers> > Audio;
protected:
/** perform a single pass at our content */
void process_video (AVFrame *);
void process_audio (uint8_t *, int);
- void process_subtitle (boost::shared_ptr<Subtitle>);
+ void process_subtitle (boost::shared_ptr<TimedSubtitle>);
/** our FilmState */
boost::shared_ptr<const FilmState> _fs;
private:
void setup_video_filters ();
+ void emit_audio (uint8_t* data, int size);
+ int bytes_per_audio_sample () const;
/** last video frame to be processed */
int _video_frame;
*/
int64_t _audio_frames_processed;
- boost::shared_ptr<Subtitle> _subtitle;
+ boost::shared_ptr<TimedSubtitle> _timed_subtitle;
};
#endif