From e990fb2ffeaa786339895c8f3b3f104ef536bf39 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Sun, 16 Jan 2011 20:03:08 +0200 Subject: subtitles: add framework for subtitle decoders Add a framework for subtitle decoder modules that work more like audio/video decoders do, and change libass rendering of demuxed subtitles to use the new framework. The old subtitle code is messy, with details specific to handling particular subtitle types spread over high-level code. This should make it easier to clean things up and fix some bugs/limitations. --- sub/dec_sub.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 sub/dec_sub.h (limited to 'sub/dec_sub.h') diff --git a/sub/dec_sub.h b/sub/dec_sub.h new file mode 100644 index 0000000000..d6fbef25f0 --- /dev/null +++ b/sub/dec_sub.h @@ -0,0 +1,14 @@ +struct sh_sub; +struct osd_state; + +static inline bool is_text_sub(int type) +{ + return type == 't' || type == 'm' || type == 'a'; +} + +void sub_decode(struct sh_sub *sh, struct osd_state *osd, void *data, + int data_len, double pts, double duration); +void sub_init(struct sh_sub *sh, struct osd_state *osd); +void sub_reset(struct sh_sub *sh, struct osd_state *osd); +void sub_switchoff(struct sh_sub *sh, struct osd_state *osd); +void sub_uninit(struct sh_sub *sh); -- cgit v1.2.3