mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
video: move struct mp_hwdec_info into its own header file
This means most code accessing this struct must now include hwdec.h instead of dec_video.h. I just put it into dec_video.h at first because I thought a separate file would be a waste, but it's more proper to do it this way, as there are too many files which include dec_video.h only to get the mp_hwdec_info definition.
This commit is contained in:
@@ -35,6 +35,7 @@
|
|||||||
#include "demux/demux.h"
|
#include "demux/demux.h"
|
||||||
#include "stream/stream.h"
|
#include "stream/stream.h"
|
||||||
#include "sub/sub.h"
|
#include "sub/sub.h"
|
||||||
|
#include "video/hwdec.h"
|
||||||
#include "video/filter/vf.h"
|
#include "video/filter/vf.h"
|
||||||
#include "video/decode/dec_video.h"
|
#include "video/decode/dec_video.h"
|
||||||
#include "video/out/vo.h"
|
#include "video/out/vo.h"
|
||||||
|
|||||||
@@ -42,18 +42,4 @@ void video_reinit_vo(struct sh_video *sh_video);
|
|||||||
int get_current_video_decoder_lag(sh_video_t *sh_video);
|
int get_current_video_decoder_lag(sh_video_t *sh_video);
|
||||||
int vd_control(struct sh_video *sh_video, int cmd, void *arg);
|
int vd_control(struct sh_video *sh_video, int cmd, void *arg);
|
||||||
|
|
||||||
// Used to communicate hardware decoder API handles from VO to video decoder.
|
|
||||||
// The VO can set the context pointer for supported APIs.
|
|
||||||
struct mp_hwdec_info {
|
|
||||||
struct mp_vdpau_ctx *vdpau_ctx;
|
|
||||||
struct mp_vaapi_ctx *vaapi_ctx;
|
|
||||||
// Can be used to lazily load a requested API.
|
|
||||||
// api_name is e.g. "vdpau" (like the fields above, without "_ctx")
|
|
||||||
// Can be NULL, is idempotent, caller checks _ctx fields for success/access.
|
|
||||||
void (*load_api)(struct mp_hwdec_info *info, const char *api_name);
|
|
||||||
void *load_api_ctx;
|
|
||||||
};
|
|
||||||
|
|
||||||
void hwdec_request_api(struct mp_hwdec_info *info, const char *api_name);
|
|
||||||
|
|
||||||
#endif /* MPLAYER_DEC_VIDEO_H */
|
#endif /* MPLAYER_DEC_VIDEO_H */
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include "demux/stheader.h"
|
#include "demux/stheader.h"
|
||||||
#include "video/mp_image.h"
|
#include "video/mp_image.h"
|
||||||
|
#include "video/hwdec.h"
|
||||||
|
|
||||||
// keep in sync with --hwdec option
|
// keep in sync with --hwdec option
|
||||||
enum hwdec_type {
|
enum hwdec_type {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
#include "video/fmt-conversion.h"
|
#include "video/fmt-conversion.h"
|
||||||
#include "video/vaapi.h"
|
#include "video/vaapi.h"
|
||||||
#include "video/mp_image_pool.h"
|
#include "video/mp_image_pool.h"
|
||||||
#include "video/decode/dec_video.h"
|
#include "video/hwdec.h"
|
||||||
#include "video/filter/vf.h"
|
#include "video/filter/vf.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
#include "mpvcore/av_common.h"
|
#include "mpvcore/av_common.h"
|
||||||
#include "video/fmt-conversion.h"
|
#include "video/fmt-conversion.h"
|
||||||
#include "video/vdpau.h"
|
#include "video/vdpau.h"
|
||||||
#include "video/decode/dec_video.h"
|
#include "video/hwdec.h"
|
||||||
|
|
||||||
struct priv {
|
struct priv {
|
||||||
struct mp_vdpau_ctx *mpvdp;
|
struct mp_vdpau_ctx *mpvdp;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
#include "lavc.h"
|
#include "lavc.h"
|
||||||
#include "video/fmt-conversion.h"
|
#include "video/fmt-conversion.h"
|
||||||
#include "video/vdpau.h"
|
#include "video/vdpau.h"
|
||||||
#include "video/decode/dec_video.h"
|
#include "video/hwdec.h"
|
||||||
|
|
||||||
struct priv {
|
struct priv {
|
||||||
struct mp_vdpau_ctx *mpvdp;
|
struct mp_vdpau_ctx *mpvdp;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#include "mpvcore/options.h"
|
#include "mpvcore/options.h"
|
||||||
#include "vf.h"
|
#include "vf.h"
|
||||||
#include "video/vaapi.h"
|
#include "video/vaapi.h"
|
||||||
#include "video/decode/dec_video.h"
|
#include "video/hwdec.h"
|
||||||
|
|
||||||
static inline bool is_success(VAStatus status, const char *msg)
|
static inline bool is_success(VAStatus status, const char *msg)
|
||||||
{
|
{
|
||||||
|
|||||||
20
video/hwdec.h
Normal file
20
video/hwdec.h
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#ifndef MP_HWDEC_H_
|
||||||
|
#define MP_HWDEC_H_
|
||||||
|
|
||||||
|
// Used to communicate hardware decoder API handles from VO to video decoder.
|
||||||
|
// The VO can set the context pointer for supported APIs.
|
||||||
|
struct mp_hwdec_info {
|
||||||
|
struct mp_vdpau_ctx *vdpau_ctx;
|
||||||
|
struct mp_vaapi_ctx *vaapi_ctx;
|
||||||
|
// Can be used to lazily load a requested API.
|
||||||
|
// api_name is e.g. "vdpau" (like the fields above, without "_ctx")
|
||||||
|
// Can be NULL, is idempotent, caller checks _ctx fields for success/access.
|
||||||
|
void (*load_api)(struct mp_hwdec_info *info, const char *api_name);
|
||||||
|
void *load_api_ctx;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Trivial helper to call info->load_api().
|
||||||
|
// Implemented in vd_lavc.c.
|
||||||
|
void hwdec_request_api(struct mp_hwdec_info *info, const char *api_name);
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
#include "x11_common.h"
|
#include "x11_common.h"
|
||||||
#include "gl_common.h"
|
#include "gl_common.h"
|
||||||
#include "video/vaapi.h"
|
#include "video/vaapi.h"
|
||||||
#include "video/decode/dec_video.h"
|
#include "video/hwdec.h"
|
||||||
|
|
||||||
struct priv {
|
struct priv {
|
||||||
struct mp_vaapi_ctx *ctx;
|
struct mp_vaapi_ctx *ctx;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include "gl_common.h"
|
#include "gl_common.h"
|
||||||
#include "video/vdpau.h"
|
#include "video/vdpau.h"
|
||||||
#include "video/decode/dec_video.h"
|
#include "video/hwdec.h"
|
||||||
|
|
||||||
// This is a GL_NV_vdpau_interop specification bug, and headers (unfortunately)
|
// This is a GL_NV_vdpau_interop specification bug, and headers (unfortunately)
|
||||||
// follow it. I'm not sure about the original nvidia headers.
|
// follow it. I'm not sure about the original nvidia headers.
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
#include "gl_osd.h"
|
#include "gl_osd.h"
|
||||||
#include "filter_kernels.h"
|
#include "filter_kernels.h"
|
||||||
#include "video/memcpy_pic.h"
|
#include "video/memcpy_pic.h"
|
||||||
#include "video/decode/dec_video.h"
|
#include "video/hwdec.h"
|
||||||
#include "gl_video.h"
|
#include "gl_video.h"
|
||||||
#include "gl_lcms.h"
|
#include "gl_lcms.h"
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
#include "video/vfcap.h"
|
#include "video/vfcap.h"
|
||||||
#include "video/mp_image.h"
|
#include "video/mp_image.h"
|
||||||
#include "video/vaapi.h"
|
#include "video/vaapi.h"
|
||||||
#include "video/decode/dec_video.h"
|
#include "video/hwdec.h"
|
||||||
|
|
||||||
struct vaapi_osd_image {
|
struct vaapi_osd_image {
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "video/vdpau.h"
|
#include "video/vdpau.h"
|
||||||
#include "video/decode/dec_video.h"
|
#include "video/hwdec.h"
|
||||||
#include "mpvcore/mp_msg.h"
|
#include "mpvcore/mp_msg.h"
|
||||||
#include "mpvcore/options.h"
|
#include "mpvcore/options.h"
|
||||||
#include "talloc.h"
|
#include "talloc.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user