From 687b552db186af66e97c58792b2db40294e92bad Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 18 Dec 2015 01:54:14 +0100 Subject: sub: remove subtitle filter chain concept It was stupid. The only thing that still effectively used it was sd_lavc_conv - all other "filters" were the subtitle decoder/renderers for text (sd_ass) and bitmap (sd_lavc) subtitles. While having a subtitle filter chain was interesting (and actually worked in almost the same way as the audio/video ones), I didn't manage to use it in a meaningful way, and I couldn't e.g. factor secondary features like fixing subtitle timing into filters. Refactor the shit and drop unneeded things as it goes. --- sub/sd.h | 37 ++++++++----------------------------- 1 file changed, 8 insertions(+), 29 deletions(-) (limited to 'sub/sd.h') diff --git a/sub/sd.h b/sub/sd.h index 39b2970911..2d9207dc48 100644 --- a/sub/sd.h +++ b/sub/sd.h @@ -16,18 +16,8 @@ struct sd { const struct sd_functions *driver; void *priv; - const char *codec; - - // Extra header data passed from demuxer - char *extradata; - int extradata_len; - struct sh_stream *sh; - // Set to !=NULL if the input packets are being converted from another - // format. - const char *converted_from; - // Video resolution used for subtitle decoding. Doesn't necessarily match // the resolution of the VO, nor does it have to be the OSD resolution. int sub_video_w, sub_video_h; @@ -38,14 +28,6 @@ struct sd { struct ass_library *ass_library; struct ass_renderer *ass_renderer; pthread_mutex_t *ass_lock; - - // Set by sub converter - const char *output_codec; - char *output_extradata; - int output_extradata_len; - - // Internal buffer for sd_conv_* functions - struct sd_conv_buffer *sd_conv_buffer; }; struct sd_functions { @@ -60,21 +42,18 @@ struct sd_functions { bool (*accepts_packet)(struct sd *sd); // implicit default if NULL: true int (*control)(struct sd *sd, enum sd_ctrl cmd, void *arg); - // decoder void (*get_bitmaps)(struct sd *sd, struct mp_osd_res dim, double pts, struct sub_bitmaps *res); char *(*get_text)(struct sd *sd, double pts); - - // converter - struct demux_packet *(*get_converted)(struct sd *sd); }; -void sd_conv_add_packet(struct sd *sd, void *data, int data_len, double pts, - double duration, int64_t pos); -struct demux_packet *sd_conv_def_get_converted(struct sd *sd); -void sd_conv_def_reset(struct sd *sd); -void sd_conv_def_uninit(struct sd *sd); - -#define SD_MAX_LINE_LEN 1000 +struct lavc_conv; +bool lavc_conv_supports_format(const char *format); +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); #endif -- cgit v1.2.3