diff --git a/ass_mp.c b/ass_mp.c index 207b0454d1..0480b546cd 100644 --- a/ass_mp.c +++ b/ass_mp.c @@ -36,7 +36,7 @@ #endif // libass-related command line options -ass_library_t *ass_library; +ASS_Library *ass_library; int ass_enabled = 0; float ass_font_scale = 1.; float ass_line_spacing = 0.; @@ -70,11 +70,11 @@ extern char *sub_cp; static char *sub_cp = 0; #endif -void process_force_style(ass_track_t *track); +void process_force_style(ASS_Track *track); -ass_track_t *ass_default_track(ass_library_t *library) +ASS_Track *ass_default_track(ASS_Library *library) { - ass_track_t *track = ass_new_track(library); + ASS_Track *track = ass_new_track(library); track->track_type = TRACK_TYPE_ASS; track->Timer = 100.; @@ -85,7 +85,7 @@ ass_track_t *ass_default_track(ass_library_t *library) ass_read_styles(track, ass_styles_file, sub_cp); if (track->n_styles == 0) { - ass_style_t *style; + ASS_Style *style; int sid; double fs; uint32_t c1, c2; @@ -134,10 +134,10 @@ ass_track_t *ass_default_track(ass_library_t *library) return track; } -static int check_duplicate_plaintext_event(ass_track_t *track) +static int check_duplicate_plaintext_event(ASS_Track *track) { int i; - ass_event_t *evt = track->events + track->n_events - 1; + ASS_Event *evt = track->events + track->n_events - 1; for (i = 0; i < track->n_events - 1; ++i) // ignoring last event, it is the one we are comparing with if (track->events[i].Start == evt->Start && @@ -148,17 +148,17 @@ static int check_duplicate_plaintext_event(ass_track_t *track) } /** - * \brief Convert subtitle to ass_event_t for the given track - * \param ass_track_t track + * \brief Convert subtitle to ASS_Events for the given track + * \param track track * \param sub subtitle to convert * \return event id * note: assumes that subtitle is _not_ fps-based; caller must manually correct * Start and Duration in other case. **/ -int ass_process_subtitle(ass_track_t *track, subtitle *sub) +int ass_process_subtitle(ASS_Track *track, subtitle *sub) { int eid; - ass_event_t *event; + ASS_Event *event; int len = 0, j; char *p; char *end; @@ -206,15 +206,15 @@ int ass_process_subtitle(ass_track_t *track, subtitle *sub) /** - * \brief Convert subdata to ass_track + * \brief Convert subdata to ASS_Track * \param subdata subtitles struct from subreader * \param fps video framerate - * \return newly allocated ass_track, filled with subtitles from subdata + * \return newly allocated ASS_Track, filled with subtitles from subdata */ -ass_track_t *ass_read_subdata(ass_library_t *library, sub_data *subdata, - double fps) +ASS_Track *ass_read_subdata(ASS_Library *library, sub_data *subdata, + double fps) { - ass_track_t *track; + ASS_Track *track; int i; track = ass_default_track(library); @@ -232,7 +232,7 @@ ass_track_t *ass_read_subdata(ass_library_t *library, sub_data *subdata, return track; } -void ass_configure(ass_renderer_t *priv, int w, int h, int unscaled) +void ass_configure(ASS_Renderer *priv, int w, int h, int unscaled) { int hinting; ass_set_frame_size(priv, w, h); @@ -247,7 +247,7 @@ void ass_configure(ass_renderer_t *priv, int w, int h, int unscaled) ass_set_line_spacing(priv, ass_line_spacing); } -void ass_configure_fonts(ass_renderer_t *priv) +void ass_configure_fonts(ASS_Renderer *priv) { char *dir, *path, *family; dir = get_path("fonts"); @@ -279,9 +279,9 @@ static void message_callback(int level, const char *format, va_list va, void *ct mp_msg(MSGT_ASS, level, "\n"); } -ass_library_t *ass_init(void) +ASS_Library *ass_init(void) { - ass_library_t *priv; + ASS_Library *priv; char *path = get_path("fonts"); priv = ass_library_init(); ass_set_message_cb(priv, message_callback, NULL); @@ -294,8 +294,8 @@ ass_library_t *ass_init(void) int ass_force_reload = 0; // flag set if global ass-related settings were changed -ass_image_t *ass_mp_render_frame(ass_renderer_t *priv, ass_track_t *track, - long long now, int *detect_change) +ASS_Image *ass_mp_render_frame(ASS_Renderer *priv, ASS_Track *track, + long long now, int *detect_change) { if (ass_force_reload) { ass_set_margins(priv, ass_top_margin, ass_bottom_margin, 0, 0); diff --git a/ass_mp.h b/ass_mp.h index 0b335b9921..9e4da23ff0 100644 --- a/ass_mp.h +++ b/ass_mp.h @@ -31,7 +31,7 @@ #include #include -extern ass_library_t *ass_library; +extern ASS_Library *ass_library; extern int ass_enabled; extern float ass_font_scale; extern float ass_line_spacing; @@ -45,18 +45,18 @@ extern char *ass_border_color; extern char *ass_styles_file; extern int ass_hinting; -ass_track_t *ass_default_track(ass_library_t *library); -int ass_process_subtitle(ass_track_t *track, subtitle *sub); -ass_track_t *ass_read_subdata(ass_library_t *library, sub_data *subdata, - double fps); +ASS_Track *ass_default_track(ASS_Library *library); +int ass_process_subtitle(ASS_Track *track, subtitle *sub); +ASS_Track *ass_read_subdata(ASS_Library *library, sub_data *subdata, + double fps); -void ass_configure(ass_renderer_t *priv, int w, int h, int hinting); -void ass_configure_fonts(ass_renderer_t *priv); -ass_library_t *ass_init(void); +void ass_configure(ASS_Renderer *priv, int w, int h, int hinting); +void ass_configure_fonts(ASS_Renderer *priv); +ASS_Library *ass_init(void); extern int ass_force_reload; -ass_image_t *ass_mp_render_frame(ass_renderer_t *priv, ass_track_t *track, - long long now, int *detect_change); +ASS_Image *ass_mp_render_frame(ASS_Renderer *priv, ASS_Track *track, + long long now, int *detect_change); #else /* CONFIG_ASS */ @@ -69,12 +69,12 @@ typedef struct ass_image { uint32_t color; int dst_x, dst_y; struct ass_image *next; -} ass_image_t; +} ASS_Image; #endif typedef struct { - ass_image_t *imgs; + ASS_Image *imgs; int changed; } mp_eosd_images_t; diff --git a/libmpcodecs/vf_ass.c b/libmpcodecs/vf_ass.c index 4c2f9bef7c..5ea2f8b10d 100644 --- a/libmpcodecs/vf_ass.c +++ b/libmpcodecs/vf_ass.c @@ -62,7 +62,7 @@ static const struct vf_priv_s { // 0 = insert always int auto_insert; - ass_renderer_t* ass_priv; + ASS_Renderer* ass_priv; unsigned char* planes[3]; struct line_limits { @@ -71,7 +71,7 @@ static const struct vf_priv_s { } *line_limits; } vf_priv_dflt; -extern ass_track_t* ass_track; +extern ASS_Track *ass_track; extern float sub_delay; extern int sub_visibility; @@ -309,12 +309,12 @@ static void my_draw_bitmap(struct vf_instance* vf, unsigned char* bitmap, int bi } } -static int render_frame(struct vf_instance* vf, mp_image_t *mpi, const ass_image_t* img) +static int render_frame(struct vf_instance* vf, mp_image_t *mpi, const ASS_Image *img) { if (img) { for (int i = 0; i < (vf->priv->outh + 1) / 2; i++) vf->priv->line_limits[i] = (struct line_limits){65535, 0}; - for (const ass_image_t *im = img; im; im = im->next) + for (const ASS_Image *im = img; im; im = im->next) update_limits(vf, im->dst_y, im->dst_y + im->h, im->dst_x, im->dst_x + im->w); copy_from_image(vf); while (img) { @@ -329,7 +329,7 @@ static int render_frame(struct vf_instance* vf, mp_image_t *mpi, const ass_image static int put_image(struct vf_instance* vf, mp_image_t *mpi, double pts) { - ass_image_t* images = 0; + ASS_Image* images = 0; if (sub_visibility && vf->priv->ass_priv && ass_track && (pts != MP_NOPTS_VALUE)) images = ass_mp_render_frame(vf->priv->ass_priv, ass_track, (pts+sub_delay) * 1000 + .5, NULL); @@ -354,7 +354,7 @@ static int control(vf_instance_t *vf, int request, void *data) { switch (request) { case VFCTRL_INIT_EOSD: - vf->priv->ass_priv = ass_renderer_init((ass_library_t*)data); + vf->priv->ass_priv = ass_renderer_init((ASS_Library*)data); if (!vf->priv->ass_priv) return CONTROL_FALSE; ass_configure_fonts(vf->priv->ass_priv); return CONTROL_TRUE; diff --git a/libmpcodecs/vf_vo.c b/libmpcodecs/vf_vo.c index 6ec5904053..7b3e16224f 100644 --- a/libmpcodecs/vf_vo.c +++ b/libmpcodecs/vf_vo.c @@ -13,7 +13,7 @@ #ifdef CONFIG_ASS #include "ass_mp.h" -extern ass_track_t* ass_track; +extern ASS_Track *ass_track; #endif //===========================================================================// @@ -25,7 +25,7 @@ struct vf_priv_s { double pts; struct vo *vo; #ifdef CONFIG_ASS - ass_renderer_t* ass_priv; + ASS_Renderer *ass_priv; int prev_visibility; double scale_ratio; #endif @@ -118,7 +118,7 @@ static int control(struct vf_instance* vf, int request, void* data) #ifdef CONFIG_ASS case VFCTRL_INIT_EOSD: { - vf->priv->ass_priv = ass_renderer_init((ass_library_t*)data); + vf->priv->ass_priv = ass_renderer_init((ASS_Library*)data); if (!vf->priv->ass_priv) return CONTROL_FALSE; ass_configure_fonts(vf->priv->ass_priv); vf->priv->prev_visibility = 0; diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index ceb70ec32e..13ff34cd68 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -289,11 +289,11 @@ static void clearEOSD(void) { static void do_render_osd(int); -static inline int is_tinytex(ass_image_t *i, int tinytexcur) { +static inline int is_tinytex(ASS_Image *i, int tinytexcur) { return i->w < TINYTEX_SIZE && i->h < TINYTEX_SIZE && tinytexcur < TINYTEX_MAX; } -static inline int is_smalltex(ass_image_t *i, int smalltexcur) { +static inline int is_smalltex(ASS_Image *i, int smalltexcur) { return i->w < SMALLTEX_SIZE && i->h < SMALLTEX_SIZE && smalltexcur < SMALLTEX_MAX; } @@ -318,8 +318,8 @@ static void genEOSD(mp_eosd_images_t *imgs) { int smalltexcur = 0; GLuint *curtex; GLint scale_type = scaled_osd ? GL_LINEAR : GL_NEAREST; - ass_image_t *img = imgs->imgs; - ass_image_t *i; + ASS_Image *img = imgs->imgs; + ASS_Image *i; if (imgs->changed == 0) // there are elements, but they are unchanged return; diff --git a/libvo/vo_vdpau.c b/libvo/vo_vdpau.c index 281bfe60e2..486a6e699f 100644 --- a/libvo/vo_vdpau.c +++ b/libvo/vo_vdpau.c @@ -733,8 +733,8 @@ static void generate_eosd(mp_eosd_images_t *imgs) { VdpStatus vdp_st; VdpRect destRect; int j, found; - ass_image_t *img = imgs->imgs; - ass_image_t *i; + ASS_Image *img = imgs->imgs; + ASS_Image *i; // Nothing changed, no need to redraw if (imgs->changed == 0) diff --git a/mpcommon.c b/mpcommon.c index 83cf2b6881..4a68fe9f25 100644 --- a/mpcommon.c +++ b/mpcommon.c @@ -23,7 +23,7 @@ double sub_last_pts = -303; #ifdef CONFIG_ASS #include "ass_mp.h" -ass_track_t* ass_track = 0; // current track to render +ASS_Track *ass_track = 0; // current track to render #endif sub_data* subdata = NULL; diff --git a/mplayer.c b/mplayer.c index 8697e47a85..8c46d0edcf 100644 --- a/mplayer.c +++ b/mplayer.c @@ -1018,7 +1018,7 @@ void add_subtitles(struct MPContext *mpctx, char *filename, float fps, int noerr { sub_data *subd; #ifdef CONFIG_ASS - ass_track_t *asst = 0; + ASS_Track *asst = 0; #endif if (filename == NULL || mpctx->set_of_sub_size >= MAX_SUBTITLE_FILES) {