[MPlayer-cvslog] r31869 - in trunk: command.c libass/ass_mp.c libass/ass_mp.h libmpcodecs/vf_ass.c libmpcodecs/vf_vo.c libmpdemux/stheader.h libvo/vo_gl.c libvo/vo_vdpau.c mencoder.c mp_core.h mpcommon.c mpcommon.h...

greg subversion at mplayerhq.hu
Fri Jul 30 20:14:36 CEST 2010


Author: greg
Date: Fri Jul 30 20:14:35 2010
New Revision: 31869

Log:
Rename libass types to match upstream libass >= 0.9.7

Modified:
   trunk/command.c
   trunk/libass/ass_mp.c
   trunk/libass/ass_mp.h
   trunk/libmpcodecs/vf_ass.c
   trunk/libmpcodecs/vf_vo.c
   trunk/libmpdemux/stheader.h
   trunk/libvo/vo_gl.c
   trunk/libvo/vo_vdpau.c
   trunk/mencoder.c
   trunk/mp_core.h
   trunk/mpcommon.c
   trunk/mpcommon.h
   trunk/mplayer.c

Modified: trunk/command.c
==============================================================================
--- trunk/command.c	Fri Jul 30 19:02:58 2010	(r31868)
+++ trunk/command.c	Fri Jul 30 20:14:35 2010	(r31869)
@@ -2425,7 +2425,7 @@ static void remove_subtitle_range(MPCont
     int after = mpctx->set_of_sub_size - end;
     sub_data **subs = mpctx->set_of_subtitles;
 #ifdef CONFIG_ASS
-    ass_track_t **ass_tracks = mpctx->set_of_ass_tracks;
+    ASS_Track **ass_tracks = mpctx->set_of_ass_tracks;
 #endif
     if (count < 0 || count > mpctx->set_of_sub_size ||
         start < 0 || start > mpctx->set_of_sub_size - count) {

Modified: trunk/libass/ass_mp.c
==============================================================================
--- trunk/libass/ass_mp.c	Fri Jul 30 19:02:58 2010	(r31868)
+++ trunk/libass/ass_mp.c	Fri Jul 30 20:14:35 2010	(r31869)
@@ -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,8 +70,8 @@ extern char* sub_cp;
 static char* sub_cp = 0;
 #endif
 
-ass_track_t* ass_default_track(ass_library_t* library) {
-	ass_track_t* track = ass_new_track(library);
+ASS_Track* ass_default_track(ASS_Library* library) {
+	ASS_Track* track = ass_new_track(library);
 
 	track->track_type = TRACK_TYPE_ASS;
 	track->Timer = 100.;
@@ -82,7 +82,7 @@ ass_track_t* ass_default_track(ass_libra
 		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;
@@ -120,14 +120,14 @@ ass_track_t* ass_default_track(ass_libra
 		style->ScaleY = 1.;
 	}
 
-	process_force_style(track);
+	ass_process_force_style(track);
 	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 &&
@@ -138,17 +138,17 @@ static int check_duplicate_plaintext_eve
 }
 
 /**
- * \brief Convert subtitle to ass_event_t for the given track
- * \param ass_track_t track
+ * \brief Convert subtitle to ASS_Event for the given track
+ * \param track ASS_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;
@@ -194,13 +194,13 @@ int ass_process_subtitle(ass_track_t* tr
 
 
 /**
- * \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_t* track;
+ASS_Track* ass_read_subdata(ASS_Library* library, sub_data* subdata, double fps) {
+	ASS_Track* track;
 	int i;
 
 	track = ass_default_track(library);
@@ -218,10 +218,10 @@ ass_track_t* ass_read_subdata(ass_librar
 	return track;
 }
 
-ass_track_t* ass_read_stream(ass_library_t* library, const char *fname, char *charset) {
+ASS_Track* ass_read_stream(ASS_Library* library, const char *fname, char *charset) {
 	int i;
 	char *buf = NULL;
-	ass_track_t *track;
+	ASS_Track *track;
 	size_t sz = 0;
 	size_t buf_alloc = 0;
 	stream_t *fd;
@@ -263,7 +263,7 @@ ass_track_t* ass_read_stream(ass_library
 	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);
 	ass_set_margins(priv, ass_top_margin, ass_bottom_margin, 0, 0);
@@ -277,7 +277,7 @@ void ass_configure(ass_renderer_t* priv,
 	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");
 	if (font_fontconfig < 0 && sub_font_name) path = strdup(sub_font_name);
@@ -309,8 +309,8 @@ static void message_callback(int level, 
 	}
 }
 
-ass_library_t* ass_init(void) {
-	ass_library_t* priv;
+ASS_Library* ass_init(void) {
+	ASS_Library* priv;
 	char* path = get_path("fonts");
 	priv = ass_library_init();
 	ass_set_message_cb(priv, message_callback, NULL);
@@ -323,7 +323,7 @@ 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);
 		ass_set_use_margins(priv, ass_use_margins);

Modified: trunk/libass/ass_mp.h
==============================================================================
--- trunk/libass/ass_mp.h	Fri Jul 30 19:02:58 2010	(r31868)
+++ trunk/libass/ass_mp.h	Fri Jul 30 20:14:35 2010	(r31869)
@@ -23,23 +23,16 @@
 #ifndef LIBASS_MP_H
 #define LIBASS_MP_H
 
+#include <stdint.h>
+
 #include "subreader.h"
 #if defined(CONFIG_ASS_INTERNAL) || !defined(CONFIG_ASS)
 #include "ass.h"
 #else
 #include <ass/ass.h>
 #endif
-// FIXME: rename types used by MPlayer
-#define ass_library_t ASS_Library
-#define ass_track_t ASS_Track
-#define ass_track_s ASS_Track
-#define ass_renderer_t ASS_Renderer
-#define ass_image_t ASS_Image
-#define ass_style_t ASS_Style
-#define ass_event_t ASS_Event
-#define process_force_style(t) ass_process_force_style(t)
 
-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;
@@ -53,21 +46,21 @@ 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_t* ass_read_stream(ass_library_t* library, const char *fname, char *charset);
+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);
+ASS_Track* ass_read_stream(ASS_Library* library, const char *fname, char *charset);
 
-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);
 
 typedef struct {
-	ass_image_t* imgs;
+	ASS_Image* imgs;
 	int changed;
-} mp_eosd_images_t;
+} EOSD_ImageList;
 
 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);
 
 #endif /* LIBASS_MP_H */

Modified: trunk/libmpcodecs/vf_ass.c
==============================================================================
--- trunk/libmpcodecs/vf_ass.c	Fri Jul 30 19:02:58 2010	(r31868)
+++ trunk/libmpcodecs/vf_ass.c	Fri Jul 30 20:14:35 2010	(r31869)
@@ -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];
 	unsigned char* dirty_rows;
@@ -307,7 +307,7 @@ static void my_draw_bitmap(struct vf_ins
 	}
 }
 
-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) {
 		memset(vf->priv->dirty_rows, 0, vf->priv->outh); // reset dirty rows
@@ -324,7 +324,7 @@ static int render_frame(struct vf_instan
 
 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);
 
@@ -349,7 +349,7 @@ static int control(vf_instance_t *vf, in
 {
 	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;

Modified: trunk/libmpcodecs/vf_vo.c
==============================================================================
--- trunk/libmpcodecs/vf_vo.c	Fri Jul 30 19:02:58 2010	(r31868)
+++ trunk/libmpcodecs/vf_vo.c	Fri Jul 30 20:14:35 2010	(r31869)
@@ -39,7 +39,7 @@ struct vf_priv_s {
     double pts;
     const vo_functions_t *vo;
 #ifdef CONFIG_ASS
-    ass_renderer_t* ass_priv;
+    ASS_Renderer* ass_priv;
     int prev_visibility;
 #endif
 };
@@ -130,7 +130,7 @@ static int control(struct vf_instance *v
 #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;
@@ -138,7 +138,7 @@ static int control(struct vf_instance *v
     }
     case VFCTRL_DRAW_EOSD:
     {
-        mp_eosd_images_t images = {NULL, 2};
+        EOSD_ImageList images = {NULL, 2};
         double pts = vf->priv->pts;
         if (!vo_config_count || !vf->priv->ass_priv) return CONTROL_FALSE;
         if (sub_visibility && vf->priv->ass_priv && ass_track && (pts != MP_NOPTS_VALUE)) {

Modified: trunk/libmpdemux/stheader.h
==============================================================================
--- trunk/libmpdemux/stheader.h	Fri Jul 30 19:02:58 2010	(r31868)
+++ trunk/libmpdemux/stheader.h	Fri Jul 30 20:14:35 2010	(r31869)
@@ -126,7 +126,7 @@ typedef struct sh_sub {
   unsigned char* extradata; // extra header data passed from demuxer
   int extradata_len;
 #ifdef CONFIG_ASS
-  ass_track_t* ass_track;  // for SSA/ASS streams (type == 'a')
+  ASS_Track* ass_track;  // for SSA/ASS streams (type == 'a')
 #endif
 } sh_sub_t;
 

Modified: trunk/libvo/vo_gl.c
==============================================================================
--- trunk/libvo/vo_gl.c	Fri Jul 30 19:02:58 2010	(r31868)
+++ trunk/libvo/vo_gl.c	Fri Jul 30 20:14:35 2010	(r31869)
@@ -313,11 +313,11 @@ static void clearEOSD(void) {
   eosdtex = NULL;
 }
 
-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;
 }
 
@@ -336,14 +336,14 @@ static inline void smalltex_pos(int smal
  * \param img image list to create OSD from.
  *            A value of NULL has the same effect as clearEOSD()
  */
-static void genEOSD(mp_eosd_images_t *imgs) {
+static void genEOSD(EOSD_ImageList *imgs) {
   int sx, sy;
   int tinytexcur = 0;
   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;

Modified: trunk/libvo/vo_vdpau.c
==============================================================================
--- trunk/libvo/vo_vdpau.c	Fri Jul 30 19:02:58 2010	(r31868)
+++ trunk/libvo/vo_vdpau.c	Fri Jul 30 20:14:35 2010	(r31869)
@@ -854,13 +854,13 @@ static void draw_eosd(void)
     }
 }
 
-static void generate_eosd(mp_eosd_images_t *imgs)
+static void generate_eosd(EOSD_ImageList *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)

Modified: trunk/mencoder.c
==============================================================================
--- trunk/mencoder.c	Fri Jul 30 19:02:58 2010	(r31868)
+++ trunk/mencoder.c	Fri Jul 30 20:14:35 2010	(r31869)
@@ -325,7 +325,7 @@ static void add_subtitles(char *filename
 {
     sub_data *subd;
 #ifdef CONFIG_ASS
-    ass_track_t *asst = 0;
+    ASS_Track *asst = 0;
 #endif
 
     if (!filename) return;

Modified: trunk/mp_core.h
==============================================================================
--- trunk/mp_core.h	Fri Jul 30 19:02:58 2010	(r31868)
+++ trunk/mp_core.h	Fri Jul 30 20:14:35 2010	(r31869)
@@ -114,7 +114,7 @@ typedef struct MPContext {
 #ifdef CONFIG_ASS
     // set_of_ass_tracks[i] contains subtitles from set_of_subtitles[i]
     // parsed by libass or NULL if format unsupported
-    ass_track_t* set_of_ass_tracks[MAX_SUBTITLE_FILES];
+    ASS_Track* set_of_ass_tracks[MAX_SUBTITLE_FILES];
 #endif
     sub_data* set_of_subtitles[MAX_SUBTITLE_FILES];
 

Modified: trunk/mpcommon.c
==============================================================================
--- trunk/mpcommon.c	Fri Jul 30 19:02:58 2010	(r31868)
+++ trunk/mpcommon.c	Fri Jul 30 20:14:35 2010	(r31869)
@@ -39,7 +39,7 @@ double sub_last_pts = -303;
 
 #ifdef CONFIG_ASS
 #include "libass/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;

Modified: trunk/mpcommon.h
==============================================================================
--- trunk/mpcommon.h	Fri Jul 30 19:02:58 2010	(r31868)
+++ trunk/mpcommon.h	Fri Jul 30 20:14:35 2010	(r31869)
@@ -26,7 +26,7 @@
 #include "libass/ass_mp.h"
 
 extern double sub_last_pts;
-extern ass_track_t *ass_track;
+extern ASS_Track *ass_track;
 extern subtitle *vo_sub_last;
 
 extern float sub_delay;

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	Fri Jul 30 19:02:58 2010	(r31868)
+++ trunk/mplayer.c	Fri Jul 30 20:14:35 2010	(r31869)
@@ -1091,7 +1091,7 @@ void add_subtitles(char *filename, float
 {
     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) {


More information about the MPlayer-cvslog mailing list