2 * This file is part of MPlayer.
4 * MPlayer is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * MPlayer is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 #include "libmpdemux/stheader.h"
26 typedef struct mp_codec_info vd_info_t
;
30 /* interface of video decoder drivers */
31 typedef struct vd_functions
33 const vd_info_t
*info
;
34 int (*init
)(sh_video_t
*sh
);
35 void (*uninit
)(sh_video_t
*sh
);
36 int (*control
)(sh_video_t
*sh
, int cmd
, void *arg
, ...);
37 mp_image_t
* (*decode
)(sh_video_t
* sh
, void *data
, int len
, int flags
);
38 struct mp_image
*(*decode2
)(struct sh_video
*sh
, struct demux_packet
*pkt
,
39 void *data
, int len
, int flags
,
40 double *reordered_pts
);
43 // NULL terminated array of all drivers
44 extern const vd_functions_t
*const mpcodecs_vd_drivers
[];
46 #define VDCTRL_QUERY_FORMAT 3 // test for availabilty of a format
47 #define VDCTRL_QUERY_MAX_PP_LEVEL 4 // query max postprocessing level (if any)
48 #define VDCTRL_SET_PP_LEVEL 5 // set postprocessing level
49 #define VDCTRL_SET_EQUALIZER 6 // set color options (brightness,contrast etc)
50 #define VDCTRL_GET_EQUALIZER 7 // get color options (brightness,contrast etc)
51 #define VDCTRL_RESYNC_STREAM 8 // reset decode state after seeking
52 #define VDCTRL_QUERY_UNSEEN_FRAMES 9 // current decoder lag
53 #define VDCTRL_RESET_ASPECT 10 // reinit filter/VO chain for new aspect ratio
56 int mpcodecs_config_vo2(sh_video_t
*sh
, int w
, int h
,
57 const unsigned int *outfmts
,
58 unsigned int preferred_outfmt
);
60 static inline int mpcodecs_config_vo(sh_video_t
*sh
, int w
, int h
,
61 unsigned int preferred_outfmt
)
63 return mpcodecs_config_vo2(sh
, w
, h
, NULL
, preferred_outfmt
);
66 mp_image_t
*mpcodecs_get_image(sh_video_t
*sh
, int mp_imgtype
, int mp_imgflag
,
68 void mpcodecs_draw_slice(sh_video_t
*sh
, unsigned char **src
, int *stride
,
69 int w
, int h
, int x
, int y
);
71 #endif /* MPLAYER_VD_H */