mirror of
https://github.com/mpv-player/mpv
synced 2024-12-27 01:22:30 +00:00
3382a6f6e4
The filter chain and the video ouputs have config() functions. They are strictly limited to transfering the video size and format. Other parameters (like color levels) have to be transferred separately. Improve upon this by introducing a separate set of reconfig() functions, which use mp_image_params to carry format parameters. This struct contains all image format related parameters from config(), plus additional parameters such as colorspace. Change vf_rotate to use it, as well as vo_opengl. vf_rotate is just an example/test case, but vo_opengl will need it later. The intention is also to get rid of VOCTRL_SET_YUV_COLORSPACE. This information is now handed to the VOs via reconfig(). The getter, VOCTRL_GET_YUV_COLORSPACE, will still be needed though.
41 lines
1002 B
C
41 lines
1002 B
C
#ifndef MPV_LAVC_H
|
|
#define MPV_LAVC_H
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <libavcodec/avcodec.h>
|
|
|
|
#include "config.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;
|
|
int do_hw_dr1;
|
|
int vo_initialized;
|
|
int best_csp;
|
|
struct mp_image_params image_params;
|
|
AVRational last_sample_aspect_ratio;
|
|
enum AVDiscard skip_frame;
|
|
const char *software_fallback_decoder;
|
|
|
|
bool do_dr1;
|
|
struct FramePool *dr1_buffer_pool;
|
|
struct mp_image_pool *non_dr1_pool;
|
|
} vd_ffmpeg_ctx;
|
|
|
|
// lavc_dr1.c
|
|
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);
|
|
bool mp_buffer_is_unique(struct FrameBuffer *buffer);
|
|
void mp_buffer_pool_free(struct FramePool **pool);
|
|
|
|
#endif
|