mirror of
https://github.com/mpv-player/mpv
synced 2025-01-19 22:01:10 +00:00
5accc5e7c1
Move the decoder parts from vo_vdpau.c to a new file vdpau_old.c. This file is named so because because it's written against the "old" libavcodec vdpau pseudo-decoder (e.g. "h264_vdpau"). Add support for the "new" libavcodec vdpau support. This was recently added and replaces the "old" vdpau parts. (In fact, Libav is about to deprecate and remove the "old" API without deprecation grace period, so we have to support it now. Moreover, there will probably be no Libav release which supports both, so the transition is even less smooth than we could hope, and we have to support both the old and new API.) Whether the old or new API is used is checked by a configure test: if the new API is found, it is used, otherwise the old API is assumed. Some details might be handled differently. Especially display preemption is a bit problematic with the "new" libavcodec vdpau support: it wants to keep a pointer to a specific vdpau API function (which can be driver specific, because preemption might switch drivers). Also, surface IDs are now directly stored in AVFrames (and mp_images), so they can't be forced to VDP_INVALID_HANDLE on preemption. (This changes even with older libavcodec versions, because mp_image always uses the newer representation to make vo_vdpau.c simpler.) Decoder initialization in the new code tries to deal with codec profiles, while the old code always uses the highest profile per codec. Surface allocation changes. Since the decoder won't call config() in vo_vdpau.c on video size change anymore, we allow allocating surfaces of arbitrary size instead of locking it to what the VO was configured. The non-hwdec code also has slightly different allocation behavior now. Enabling the old vdpau special decoders via e.g. --vd=lavc:h264_vdpau doesn't work anymore (a warning suggesting the --hwdec option is printed instead).
57 lines
2.0 KiB
C
57 lines
2.0 KiB
C
/*
|
|
* This file is part of MPlayer.
|
|
*
|
|
* MPlayer is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* MPlayer is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along
|
|
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
*/
|
|
|
|
#ifndef MPLAYER_DEC_VIDEO_H
|
|
#define MPLAYER_DEC_VIDEO_H
|
|
|
|
#include "demux/stheader.h"
|
|
|
|
struct osd_state;
|
|
struct mp_decoder_list;
|
|
|
|
struct mp_decoder_list *mp_video_decoder_list(void);
|
|
|
|
int init_best_video_codec(sh_video_t *sh_video, char* video_decoders);
|
|
void uninit_video(sh_video_t *sh_video);
|
|
|
|
struct demux_packet;
|
|
void *decode_video(sh_video_t *sh_video, struct demux_packet *packet,
|
|
int drop_frame, double pts);
|
|
|
|
int get_video_quality_max(sh_video_t *sh_video);
|
|
|
|
int get_video_colors(sh_video_t *sh_video, const char *item, int *value);
|
|
int set_video_colors(sh_video_t *sh_video, const char *item, int value);
|
|
struct mp_image_params;
|
|
bool get_video_params(struct sh_video *sh, struct mp_image_params *p);
|
|
void set_video_output_levels(struct sh_video *sh);
|
|
void resync_video_stream(sh_video_t *sh_video);
|
|
void video_reinit_vo(struct sh_video *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);
|
|
|
|
extern int divx_quality;
|
|
|
|
// 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;
|
|
};
|
|
|
|
#endif /* MPLAYER_DEC_VIDEO_H */
|