class FFPacket {
AVPacket pkt;
public:
- FFPacket();
- ~FFPacket();
- void init();
operator AVPacket*() { return &pkt; }
operator AVPacket&() { return pkt; }
AVPacket *operator ->() { return &pkt; }
+
+ void init();
+ void finit();
+ FFPacket() { init(); }
+ ~FFPacket() { finit(); }
};
class FFrame : public ListItem<FFrame> {
virtual int create_filter(const char *filter_spec,
AVCodecContext *src_ctx, AVCodecContext *sink_ctx) = 0;
virtual void load_markers() = 0;
+ virtual IndexMarks *get_markers() = 0;
int create_filter(const char *filter_spec);
int load_filter(AVFrame *frame);
int read_filter(AVFrame *frame);
int frm_count;
List<FFrame> frms;
Mutex *frm_lock;
- IndexMarks *index_markers;
int64_t nudge;
int64_t seek_pos, curr_pos;
int create_filter(const char *filter_spec,
AVCodecContext *src_ctx, AVCodecContext *sink_ctx);
void load_markers();
+ IndexMarks *get_markers();
int encode_activate();
int nb_samples();
static AVPixelFormat color_model_to_pix_fmt(int color_model);
static int pix_fmt_to_color_model(AVPixelFormat pix_fmt);
- int convert_picture_vframe(VFrame *frame,
- AVFrame *ip, AVPixelFormat ifmt, int iw, int ih);
- int convert_cmodel(VFrame *frame_out,
- AVFrame *ip, AVPixelFormat ifmt, int iw, int ih);
- int transfer_cmodel(VFrame *frame_in, //defaults->metadata
- AVFrame *ifp, AVPixelFormat ifmt, int iw, int ih);
- int convert_vframe_picture(VFrame *frame,
- AVFrame *op, AVPixelFormat ofmt, int ow, int oh);
- int convert_pixfmt(VFrame *frame_in,
- AVFrame *op, AVPixelFormat ofmt, int ow, int oh);
- int transfer_pixfmt(VFrame *frame_in, //metadata->defaults
- AVFrame *ofp, AVPixelFormat ofmt, int ow, int oh);
+ int convert_picture_vframe(VFrame *frame, AVFrame *ip);
+ int convert_picture_vframe(VFrame *frame, AVFrame *ip, AVFrame *ipic);
+ int convert_cmodel(VFrame *frame, AVFrame *ip);
+ int transfer_cmodel(VFrame *frame, AVFrame *ifp);
+ int convert_vframe_picture(VFrame *frame, AVFrame *op);
+ int convert_vframe_picture(VFrame *frame, AVFrame *op, AVFrame *opic);
+ int convert_pixfmt(VFrame *frame, AVFrame *op);
+ int transfer_pixfmt(VFrame *frame, AVFrame *ofp);
};
class FFVideoStream : public FFStream, public FFVideoConvert {
int create_filter(const char *filter_spec,
AVCodecContext *src_ctx, AVCodecContext *sink_ctx);
void load_markers();
+ IndexMarks *get_markers();
int init_frame(AVFrame *picture);
int load(VFrame *vframe, int64_t pos);
int64_t length;
float aspect_ratio;
- uint8_t *pkt_bfr;
- int pkt_bfr_sz;
- int64_t start_pts;
+ int interlaced;
+ int top_field_first;
};
class FFMPEG : public Thread {
static void set_option_path(char *path, const char *fmt, ...);
static void get_option_path(char *path, const char *type, const char *spec);
- static int get_format(char *format, const char *path, char *spec);
+ static int get_format(char *format, const char *path, const char *spec);
+ static int get_codec(char *codec, const char *path, const char *spec);
static int scan_option_line(char *cp,char *tag,char *val);
static int load_defaults(const char *path, const char *type,
char *codec, char *codec_options, int len);
char *format, char *codec, char *bsfilter, char *bsargs);
int get_encoder(FILE *fp,
char *format, char *codec, char *bsfilter, char *bsargs);
- int read_options(const char *options, AVDictionary *&opts);
+ int read_options(const char *options, AVDictionary *&opts, int skip=0);
int scan_options(const char *options, AVDictionary *&opts, AVStream *st);
int read_options(FILE *fp, const char *options, AVDictionary *&opts);
int load_options(const char *options, AVDictionary *&opts);
Condition *mux_lock;
Condition *flow_lock;
int done, flow;
-
+
void start_muxer();
void stop_muxer();
void flow_off();