2011-01-16 18:03:08 +00:00
|
|
|
#ifndef MPLAYER_SD_H
|
|
|
|
#define MPLAYER_SD_H
|
|
|
|
|
VO, sub: refactor
Remove VFCTRL_DRAW_OSD, VFCAP_EOSD_FILTER, VFCAP_EOSD_RGBA, VFCAP_EOSD,
VOCTRL_DRAW_EOSD, VOCTRL_GET_EOSD_RES, VOCTRL_QUERY_EOSD_FORMAT.
Remove draw_osd_with_eosd(), which rendered the OSD by calling
VOCTRL_DRAW_EOSD. Change VOs to call osd_draw() directly, which takes
a callback as argument. (This basically works like the old OSD API,
except multiple OSD bitmap formats are supported and caching is
possible.)
Remove all mentions of "eosd". It's simply "osd" now.
Make OSD size per-OSD-object, as they can be different when using
vf_sub. Include display_par/video_par in resolution change detection.
Fix the issue with margin borders in vo_corevideo.
2012-10-19 17:25:18 +00:00
|
|
|
#include "dec_sub.h"
|
2013-11-18 17:46:44 +00:00
|
|
|
#include "demux/packet.h"
|
2013-06-01 17:44:12 +00:00
|
|
|
|
2015-12-07 22:47:18 +00:00
|
|
|
// up to 210 ms overlaps or gaps are removed
|
|
|
|
#define SUB_GAP_THRESHOLD 0.210
|
2015-12-05 22:55:56 +00:00
|
|
|
// don't change timings if durations are smaller
|
|
|
|
#define SUB_GAP_KEEP 0.4
|
|
|
|
|
2013-06-01 17:44:12 +00:00
|
|
|
struct sd {
|
2015-12-26 17:34:18 +00:00
|
|
|
struct mpv_global *global;
|
2013-12-21 18:06:37 +00:00
|
|
|
struct mp_log *log;
|
2013-06-01 17:44:12 +00:00
|
|
|
struct MPOpts *opts;
|
|
|
|
|
|
|
|
const struct sd_functions *driver;
|
|
|
|
void *priv;
|
|
|
|
|
2015-12-26 17:34:18 +00:00
|
|
|
struct demuxer *demuxer;
|
2015-12-05 22:56:28 +00:00
|
|
|
struct sh_stream *sh;
|
2013-06-01 17:44:12 +00:00
|
|
|
};
|
2011-01-16 18:03:08 +00:00
|
|
|
|
|
|
|
struct sd_functions {
|
2013-06-03 19:49:39 +00:00
|
|
|
const char *name;
|
2013-04-28 19:12:11 +00:00
|
|
|
bool accept_packets_in_advance;
|
2013-06-01 17:44:12 +00:00
|
|
|
int (*init)(struct sd *sd);
|
|
|
|
void (*decode)(struct sd *sd, struct demux_packet *packet);
|
2013-06-01 17:44:55 +00:00
|
|
|
void (*reset)(struct sd *sd);
|
2015-12-26 17:35:36 +00:00
|
|
|
void (*select)(struct sd *sd, bool selected);
|
2013-06-01 17:44:55 +00:00
|
|
|
void (*uninit)(struct sd *sd);
|
|
|
|
|
2015-12-05 22:54:00 +00:00
|
|
|
bool (*accepts_packet)(struct sd *sd); // implicit default if NULL: true
|
2013-06-28 23:34:11 +00:00
|
|
|
int (*control)(struct sd *sd, enum sd_ctrl cmd, void *arg);
|
2013-06-01 17:54:31 +00:00
|
|
|
|
2013-06-01 17:44:12 +00:00
|
|
|
void (*get_bitmaps)(struct sd *sd, struct mp_osd_res dim, double pts,
|
2012-08-25 18:22:39 +00:00
|
|
|
struct sub_bitmaps *res);
|
2013-06-01 17:44:12 +00:00
|
|
|
char *(*get_text)(struct sd *sd, double pts);
|
2011-01-16 18:03:08 +00:00
|
|
|
};
|
|
|
|
|
2015-12-18 00:54:14 +00:00
|
|
|
struct lavc_conv;
|
|
|
|
struct lavc_conv *lavc_conv_create(struct mp_log *log, const char *codec_name,
|
|
|
|
char *extradata, int extradata_len);
|
|
|
|
char *lavc_conv_get_extradata(struct lavc_conv *priv);
|
|
|
|
char **lavc_conv_decode(struct lavc_conv *priv, struct demux_packet *packet);
|
|
|
|
void lavc_conv_reset(struct lavc_conv *priv);
|
|
|
|
void lavc_conv_uninit(struct lavc_conv *priv);
|
2013-06-01 17:54:18 +00:00
|
|
|
|
2011-01-16 18:03:08 +00:00
|
|
|
#endif
|