dnl *** assrender ***
translit(dnm, m, l) AM_CONDITIONAL(USE_ASSRENDER, true)
AG_GST_CHECK_FEATURE(ASSRENDER, [ASS/SSA renderer], assrender, [
- PKG_CHECK_MODULES(ASSRENDER, libass >= 0.9.4 libass < 0.9.7, [
+ PKG_CHECK_MODULES(ASSRENDER, libass >= 0.9.4, [
HAVE_ASSRENDER="yes" ], [
HAVE_ASSRENDER="no"
AC_MSG_RESULT(no)
if (gst_structure_get_int (structure, "width", &render->width) &&
gst_structure_get_int (structure, "height", &render->height)) {
+ gdouble dar;
+
ret = gst_pad_set_caps (render->srcpad, caps);
ass_set_frame_size (render->ass_renderer, render->width, render->height);
- /* FIXME: Does this expect aspect ratio or pixel aspect ratio? */
+
+ dar = (((gdouble) par_n) * ((gdouble) render->width));
+ dar /= (((gdouble) par_d) * ((gdouble) render->height));
+#if !defined(LIBASS_VERSION) || LIBASS_VERSION < 0x00907010
+ ass_set_aspect_ratio (render->ass_renderer, dar);
+#else
ass_set_aspect_ratio (render->ass_renderer,
- ((gdouble) par_n) / ((gdouble) par_d));
+ dar, ((gdouble) render->width) / ((gdouble) render->height));
+#endif
ass_set_font_scale (render->ass_renderer, 1.0);
ass_set_hinting (render->ass_renderer, ASS_HINTING_NATIVE);
+
+#if !defined(LIBASS_VERSION) || LIBASS_VERSION < 0x00907010
ass_set_fonts (render->ass_renderer, "Arial", "sans-serif");
ass_set_fonts (render->ass_renderer, NULL, "Sans");
+#else
+ ass_set_fonts (render->ass_renderer, "Arial", "sans-serif", 1, NULL, 1);
+ ass_set_fonts (render->ass_renderer, NULL, "Sans", 1, NULL, 1);
+#endif
ass_set_margins (render->ass_renderer, 0, 0, 0, 0);
ass_set_use_margins (render->ass_renderer, 0);
gint64 start, stop, clip_start = 0, clip_stop = 0;
double timestamp;
double step;
- ass_image_t *ass_image;
+ ASS_Image *ass_image;
render = GST_ASSRENDER (GST_PAD_PARENT (pad));
G_BEGIN_DECLS
+#if !defined(LIBASS_VERSION) || LIBASS_VERSION < 0x00907010
+#define ASS_Library ass_library_t
+#define ASS_Renderer ass_renderer_t
+#define ASS_Track ass_track_t
+#define ASS_Image ass_image_t
+#endif
+
#define GST_TYPE_ASSRENDER (gst_assrender_get_type())
#define GST_ASSRENDER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ASSRENDER,Gstassrender))
#define GST_ASSRENDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ASSRENDER,GstassrenderClass))
gint width, height;
- ass_library_t *ass_library;
- ass_renderer_t *ass_renderer;
- ass_track_t *ass_track;
+ ASS_Library *ass_library;
+ ASS_Renderer *ass_renderer;
+ ASS_Track *ass_track;
gboolean renderer_init_ok, track_init_ok, enable, embeddedfonts;
};