#include <stdint.h>
#include <boost/shared_ptr.hpp>
#include <boost/optional.hpp>
+#include <boost/thread/mutex.hpp>
extern "C" {
#include <libavcodec/avcodec.h>
#include <libpostproc/postprocess.h>
#include "decoder.h"
#include "video_decoder.h"
#include "audio_decoder.h"
+#include "film.h"
struct AVFilterGraph;
struct AVCodecContext;
, _name (n)
, _id (i)
{}
-
+
std::string to_string () const;
std::string name () const {
float frames_per_second () const;
Size native_size () const;
+ SourceFrame length () const;
int time_base_numerator () const;
int time_base_denominator () const;
int sample_aspect_ratio_numerator () const;
void set_audio_stream (boost::shared_ptr<AudioStream>);
void set_subtitle_stream (boost::shared_ptr<SubtitleStream>);
- bool seek (SourceFrame);
+ bool seek (double);
+ bool seek_to_last ();
private:
bool pass ();
+ bool do_seek (double p, bool);
PixelFormat pixel_format () const;
AVSampleFormat audio_sample_format () const;
int bytes_per_audio_sample () const;
- void out_careful ();
+ void out_with_sync ();
void filter_and_emit_video (AVFrame *);
+ double frame_time () const;
void setup_general ();
void setup_video ();
void maybe_add_subtitle ();
boost::shared_ptr<AudioBuffers> deinterleave_audio (uint8_t* data, int size);
+ void film_changed (Film::Property);
+
std::string stream_name (AVStream* s) const;
AVFormatContext* _format_context;
boost::optional<double> _first_audio;
std::list<boost::shared_ptr<FilterGraph> > _filter_graphs;
+ boost::mutex _filter_graphs_mutex;
};