2012-12-11 17:27:34 +00:00
|
|
|
#ifndef MPV_LAVC_H
|
|
|
|
#define MPV_LAVC_H
|
|
|
|
|
2012-12-11 23:43:50 +00:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
2012-12-11 17:27:34 +00:00
|
|
|
#include <libavcodec/avcodec.h>
|
|
|
|
|
|
|
|
#include "demux/stheader.h"
|
|
|
|
#include "video/mp_image.h"
|
|
|
|
|
|
|
|
typedef struct ffmpeg_ctx {
|
|
|
|
AVCodecContext *avctx;
|
|
|
|
AVFrame *pic;
|
|
|
|
struct hwdec *hwdec;
|
|
|
|
enum PixelFormat pix_fmt;
|
2012-12-11 23:43:50 +00:00
|
|
|
int do_hw_dr1, do_dr1;
|
2012-12-11 17:27:34 +00:00
|
|
|
int vo_initialized;
|
|
|
|
int best_csp;
|
|
|
|
int qp_stat[32];
|
|
|
|
double qp_sum;
|
|
|
|
double inv_qp_sum;
|
|
|
|
AVRational last_sample_aspect_ratio;
|
|
|
|
enum AVDiscard skip_frame;
|
|
|
|
AVCodec *software_fallback;
|
|
|
|
struct FramePool *dr1_buffer_pool;
|
video/filter: change filter API, use refcounting, remove filter DR
Change the entire filter API to use reference counted images instead
of vf_get_image().
Remove filter "direct rendering". This was useful for vf_expand and (in
rare cases) vf_sub: DR allowed these filters to pass a cropped image to
the filters before them. Then, on filtering, the image was "uncropped",
so that black bars could be added around the image without copying. This
means that in some cases, vf_expand will be slower (-vf gradfun,expand
for example).
Note that another form of DR used for in-place filters has been replaced
by simpler logic. Instead of trying to do DR, filters can check if the
image is writeable (with mp_image_is_writeable()), and do true in-place
if that's the case. This affects filters like vf_gradfun and vf_sub.
Everything has to support strides now. If something doesn't, making a
copy of the image data is required.
2012-11-05 13:25:04 +00:00
|
|
|
struct mp_image_pool *non_dr1_pool;
|
2012-12-11 17:27:34 +00:00
|
|
|
} vd_ffmpeg_ctx;
|
|
|
|
|
|
|
|
int mp_codec_get_buffer(AVCodecContext *s, AVFrame *frame);
|
|
|
|
void mp_codec_release_buffer(AVCodecContext *s, AVFrame *frame);
|
|
|
|
|
|
|
|
struct FrameBuffer;
|
|
|
|
|
|
|
|
void mp_buffer_ref(struct FrameBuffer *buffer);
|
|
|
|
void mp_buffer_unref(struct FrameBuffer *buffer);
|
2012-12-11 23:43:50 +00:00
|
|
|
bool mp_buffer_is_unique(struct FrameBuffer *buffer);
|
2012-12-11 17:27:34 +00:00
|
|
|
|
|
|
|
void mp_buffer_pool_free(struct FramePool **pool);
|
|
|
|
|
|
|
|
#endif
|