~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to libass/ass_render.h

  • Committer: Gauvain Pocentek
  • Date: 2012-03-06 11:59:12 UTC
  • mfrom: (66.1.15 precise)
  • Revision ID: gauvain@pocentek.net-20120306115912-h9d6kt9j0l532oo5
* Merge from Ubuntu:
  - put back faac support
  - recommends apport-hooks-medibuntu
  - change Maintainer, Uploaders & Vcs-* fields.
* New upstream snapshot
* upload to unstable
* Build against external libmpeg2
* drop 51_FTBFS_arm.patch again
* no longer build depend on libcdparanoia-dev on the Hurd
* Fix FTBFS on the hurd.
  Thanks to Samuel Thibault <sthibault@debian.org> (Closes: #654974)
* Fix FTBFS on arm
* New upstream snapshot, Closes: #650339, #643621, #481807
* Imported Upstream version 1.0~rc4+svn34492
* Bump standards version
* Bump dependency on libav >= 4:0.8~, Closes: #653887
* Fix build-indep
* Build mplayer-gui again, Closes: #568514
* Drop debian/all-lang-config-mak.sh, no longer needed
* include .dfsg1 in version number
* remove get-orig-source target
* no longer prune compiler flags from the environment
* No longer advertise nor build 3fdx, mga and dxr3 backends,
  Closes: #496106, #442181, #533546
* beautify mplayer version identification string
* Brown paperbag upload.
* Next try to fix build failure on sparce after recent binutils change.
* Brown paperbag upload.
* Really fix build failure on sparc after recent binutils change.
* Properly set Replaces/Conflicts on mplayer2{,-dbg} to avoid
  file overwrite errors.
* Adjust versioning of mplayer listed in the mplayer-dbg's Depends field.
* Fix build failure on sparc after recent binutils change.
* Urgency medium bumped because of RC-level bugfix
  and speeding up x264 transition.
* Update to my @debian.org email.
* Upload to unstable
* Enable joystick support on Linux only, Closes: #638408
* Rebuild fixes toolchain issue on arm, Closes: #637077
* New upstream snapshot
* following the discussion started by Diego Biurrun <diego@biurrun.de>
  in debian-devel, I have prepared a new packaging of 'mplayer'
  (with code that comes from CVS)
* the upstream tar.bz cannot be distributed by Debian, since it contains
   CSS code; so I am repackaging it 
* I have tried my best to address all known issues:
  - the package contains the detailed Copyright made by Diego Biurrun 
  - the package does not contain CSS code, or  AFAIK other code on which 
     there is active patent enforcement
  - there is a script  debian/cvs-changelog.sh  that shows all changes
     done to files included in this source.
    This should comply with GPLv2 sec 2.a  (in spirit if not in letter)
    For this reason, the source code contains CVS directories.
* needs   make (>= 3.80) for 'html-chunked-$(1)' in DOCS/xml/Makefile

* some corrections, as suggested Diego Biurrun
  - binary codecs should go into /usr/lib/codecs (upstream default)
  - better template 'mplayer/install_codecs'
  - an empty 'font=' in mplayer.conf breaks mplayer: postinst corrected
* correction in 'mplayer/cfgnote'
* better mplayer.postinst and mplayer.config

* New upstream release
* better debian/copyright file
* do not ship a skin
* New upstream release
* changed DEB_BUILD_OPTIONS to DEB_BUILD_CONFIGURE ,
  DEB_BUILD_OPTIONS is used as in debian policy
* use gcc-3.4
* changed xlibs-dev to a long list of dependencies, for Debian/etch
* try to adhere to  http://www.mplayerhq.hu/DOCS/tech/binary-packaging.txt
  (see README.Debian for details)
* removed dependency on xlibmesa-dev, disabled opengl
* New upstream release
* Simon McVittie <hacks@pseudorandom.co.uk> wonderful work:
- Work around Debian bug #267442 (glibc's sys/uio.h and gcc's altivec.h have
  conflicting uses for __vector) by re-ordering #includes
- Fix potential symlink attack in ./configure
- Disable support for binary codecs on platforms for which those codecs
  aren't available; also disable the corresponding Debconf note when it's
  inappropriate
- Changed Build-Depends: so it works in pbuilder
- Explicitly build-depend on libjpeg62-dev, libfontconfig1-dev,
  libungif4-dev 
- Tweak debian/rules to avoid certain errors being ignored
- Use --language=all
* provide a target  'debian/rules get-orig-source' 
  that recreates the orig.tar.gz ; then use the above orig.tar.gz
* rewrote some parts of debian/rules
* don't clean and recompile docs if upstream ships them
* mplayer-doc was shipping too much stuff
* translated man pages where not installed properly
* compile with libdv4-dev
* correct README.Debian
* Forgot build-dep on libtheora
* Must not depend on libxvidcore
* New upstream release
* new release.
* rc1 to become 0.90
* new pre-release
* new pre-release
* gtk bug fixed.
* new release.
* version bumped
* 0.60 pre2 release
* 0.60 pre-release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 *
5
5
 * This file is part of libass.
6
6
 *
7
 
 * libass is free software; you can redistribute it and/or modify
8
 
 * it under the terms of the GNU General Public License as published by
9
 
 * the Free Software Foundation; either version 2 of the License, or
10
 
 * (at your option) any later version.
11
 
 *
12
 
 * libass is distributed in the hope that it will be useful,
13
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
 * GNU General Public License for more details.
16
 
 *
17
 
 * You should have received a copy of the GNU General Public License along
18
 
 * with libass; if not, write to the Free Software Foundation, Inc.,
19
 
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
7
 * Permission to use, copy, modify, and distribute this software for any
 
8
 * purpose with or without fee is hereby granted, provided that the above
 
9
 * copyright notice and this permission notice appear in all copies.
 
10
 *
 
11
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 
12
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 
13
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 
14
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 
15
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 
16
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 
17
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20
18
 */
21
19
 
22
20
#ifndef LIBASS_RENDER_H
29
27
#include FT_GLYPH_H
30
28
#include FT_SYNTHESIS_H
31
29
 
 
30
// XXX: fix the inclusion mess so we can avoid doing this here
 
31
typedef struct ass_shaper ASS_Shaper;
 
32
 
32
33
#include "ass.h"
33
34
#include "ass_font.h"
34
35
#include "ass_bitmap.h"
41
42
#define GLYPH_CACHE_MAX 1000
42
43
#define BITMAP_CACHE_MAX_SIZE 30 * 1048576
43
44
 
 
45
#define PARSED_FADE (1<<0)
 
46
#define PARSED_A    (1<<1)
 
47
 
44
48
typedef struct {
45
49
    double xMin;
46
50
    double xMax;
72
76
    double aspect;              // frame aspect ratio, d_width / d_height.
73
77
    double storage_aspect;      // pixel ratio of the source image
74
78
    ASS_Hinting hinting;
 
79
    ASS_ShapingLevel shaper;
75
80
 
76
81
    char *default_font;
77
82
    char *default_family;
95
100
 
96
101
// describes a glyph
97
102
// GlyphInfo and TextInfo are used for text centering and word-wrapping operations
98
 
typedef struct {
 
103
typedef struct glyph_info {
99
104
    unsigned symbol;
100
105
    unsigned skip;              // skip glyph when layouting text
101
 
    FT_Glyph glyph;
102
 
    FT_Glyph outline_glyph;
 
106
    ASS_Font *font;
 
107
    int face_index;
 
108
    int glyph_index;
 
109
    double font_size;
 
110
    ASS_Drawing *drawing;
 
111
    FT_Outline *outline;
 
112
    FT_Outline *border;
103
113
    Bitmap *bm;                 // glyph bitmap
104
114
    Bitmap *bm_o;               // outline bitmap
105
115
    Bitmap *bm_s;               // shadow bitmap
106
116
    FT_BBox bbox;
107
117
    FT_Vector pos;
 
118
    FT_Vector offset;
108
119
    char linebreak;             // the first (leading) glyph of some line ?
109
120
    uint32_t c[4];              // colors
110
121
    FT_Vector advance;          // 26.6
 
122
    FT_Vector cluster_advance;
111
123
    Effect effect_type;
112
124
    int effect_timing;          // time duration of current karaoke word
113
125
    // after process_karaoke_effects: distance in pixels from the glyph origin.
120
132
    double shadow_y;
121
133
    double frx, fry, frz;       // rotation
122
134
    double fax, fay;            // text shearing
 
135
    double scale_x, scale_y;
 
136
    double border_x, border_y;
 
137
    unsigned italic;
 
138
    unsigned bold;
 
139
    int flags;
 
140
 
 
141
    int bm_run_id;
 
142
    int shape_run_id;
123
143
 
124
144
    BitmapHashKey hash_key;
 
145
 
 
146
    // next glyph in this cluster
 
147
    struct glyph_info *next;
125
148
} GlyphInfo;
126
149
 
127
150
typedef struct {
128
151
    double asc, desc;
 
152
    int offset, len;
129
153
} LineInfo;
130
154
 
131
155
typedef struct {
143
167
typedef struct {
144
168
    ASS_Event *event;
145
169
    ASS_Style *style;
 
170
    int parsed_tags;
146
171
 
147
172
    ASS_Font *font;
148
 
    char *font_path;
149
173
    double font_size;
150
174
    int flags;                  // decoration flags (underline/strike-through)
151
175
 
184
208
    int effect_timing;
185
209
    int effect_skip_timing;
186
210
 
 
211
    // bitmap run id (used for final bitmap rendering)
 
212
    int bm_run_id;
 
213
 
187
214
    enum {
188
215
        SCROLL_LR,              // left-to-right
189
216
        SCROLL_RL,
198
225
    unsigned italic;
199
226
    int treat_family_as_pattern;
200
227
    int wrap_style;
 
228
    int font_encoding;
201
229
} RenderContext;
202
230
 
203
231
typedef struct {
204
 
    Hashmap *font_cache;
205
 
    Hashmap *glyph_cache;
206
 
    Hashmap *bitmap_cache;
207
 
    Hashmap *composite_cache;
 
232
    Cache *font_cache;
 
233
    Cache *outline_cache;
 
234
    Cache *bitmap_cache;
 
235
    Cache *composite_cache;
208
236
    size_t glyph_max;
209
237
    size_t bitmap_max_size;
210
238
} CacheStore;
216
244
    ASS_Settings settings;
217
245
    int render_id;
218
246
    ASS_SynthPriv *synth_priv;
 
247
    ASS_Shaper *shaper;
219
248
 
220
249
    ASS_Image *images_root;     // rendering result is stored here
221
250
    ASS_Image *prev_images_root;
263
292
void reset_render_context(ASS_Renderer *render_priv);
264
293
void ass_free_images(ASS_Image *img);
265
294
 
 
295
// XXX: this is actually in ass.c, includes should be fixed later on
 
296
void ass_lazy_track_init(ASS_Library *lib, ASS_Track *track);
 
297
 
266
298
#endif /* LIBASS_RENDER_H */