path: root/common/encode_lavc.h
diff options
authorRudolf Polzer <>2016-04-11 14:24:48 -0400
committerRudolf Polzer <>2016-04-11 14:57:20 -0400
commit160497b8ff316f5ddd4deb6198302e5abbe7a56b (patch)
treef9cc97201ab446658956ae2e7d3f2426fcf015dd /common/encode_lavc.h
parentb968d779afb9114694976792e903b0591a71a816 (diff)
encode_lavc: Migrate to codecpar API.
Diffstat (limited to 'common/encode_lavc.h')
1 files changed, 22 insertions, 11 deletions
diff --git a/common/encode_lavc.h b/common/encode_lavc.h
index 0ab922f788..7bfe4e4a8f 100644
--- a/common/encode_lavc.h
+++ b/common/encode_lavc.h
@@ -46,8 +46,14 @@ struct encode_lavc_context {
float vo_fps;
- // these are processed from the options
+ // FFmpeg contexts.
AVFormatContext *avc;
+ AVStream *vst;
+ AVStream *ast;
+ AVCodecContext *vcc;
+ AVCodecContext *acc;
+ // these are processed from the options
AVRational timebase;
AVCodec *vc;
AVCodec *ac;
@@ -88,26 +94,31 @@ struct encode_lavc_context {
// interface for vo/ao drivers
-AVStream *encode_lavc_alloc_stream(struct encode_lavc_context *ctx, enum AVMediaType mt);
-void encode_lavc_write_stats(struct encode_lavc_context *ctx, AVStream *stream);
-int encode_lavc_write_frame(struct encode_lavc_context *ctx, AVPacket *packet);
+int encode_lavc_alloc_stream(struct encode_lavc_context *ctx,
+ enum AVMediaType mt, AVStream **stream_out,
+ AVCodecContext **codec_out);
+void encode_lavc_write_stats(struct encode_lavc_context *ctx,
+ AVCodecContext *stream);
+int encode_lavc_write_frame(struct encode_lavc_context *ctx, AVStream *stream,
+ AVPacket *packet);
int encode_lavc_supports_pixfmt(struct encode_lavc_context *ctx, enum AVPixelFormat format);
-AVCodec *encode_lavc_get_codec(struct encode_lavc_context *ctx, AVStream *stream);
-int encode_lavc_open_codec(struct encode_lavc_context *ctx, AVStream *stream);
+int encode_lavc_open_codec(struct encode_lavc_context *ctx,
+ AVCodecContext *codec);
int encode_lavc_available(struct encode_lavc_context *ctx);
int encode_lavc_timesyncfailed(struct encode_lavc_context *ctx);
int encode_lavc_start(struct encode_lavc_context *ctx); // returns 1 on success
int encode_lavc_oformat_flags(struct encode_lavc_context *ctx);
-double encode_lavc_getoffset(struct encode_lavc_context *ctx, AVStream *stream);
+double encode_lavc_getoffset(struct encode_lavc_context *ctx,
+ AVCodecContext *codec);
void encode_lavc_fail(struct encode_lavc_context *ctx, const char *format, ...); // report failure of encoding
bool encode_lavc_set_csp(struct encode_lavc_context *ctx,
- AVStream *stream, enum mp_csp csp);
+ AVCodecContext *codec, enum mp_csp csp);
bool encode_lavc_set_csp_levels(struct encode_lavc_context *ctx,
- AVStream *stream, enum mp_csp_levels lev);
+ AVCodecContext *codec, enum mp_csp_levels lev);
enum mp_csp encode_lavc_get_csp(struct encode_lavc_context *ctx,
- AVStream *stream);
+ AVCodecContext *codec);
enum mp_csp_levels encode_lavc_get_csp_levels(struct encode_lavc_context *ctx,
- AVStream *stream);
+ AVCodecContext *codec);