~ubuntu-branches/ubuntu/intrepid/gpac/intrepid-proposed

« back to all changes in this revision

Viewing changes to applications/standalone2drender/standalone2drender.c

  • Committer: Bazaar Package Importer
  • Author(s): John Dong
  • Date: 2007-01-24 23:34:57 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070124233457-zzlls8afkt0nyakj
Tags: 0.4.2~rc2-0ubuntu1
* New upstream release
  * Most notably MP4 tagging support via MP4Box -itags
* debian/patches/01_64bits.dpatch: dropped; included upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
#include "standalone2drender.h"
27
27
#include <gpac/options.h>
 
28
#include <gpac/color.h>
28
29
#include "render2d.h"
29
30
#include "stacks2d.h"
30
31
#include "visualsurface2d.h"
37
38
GF_Err R2D_GetSurfaceAccess(VisualSurface2D *surf);
38
39
void R2D_ReleaseSurfaceAccess(VisualSurface2D *surf);
39
40
Bool R2D_SupportsFormat(VisualSurface2D *surf, u32 pixel_format);
40
 
void R2D_DrawBitmap(VisualSurface2D *surf, struct _gf_sr_texture_handler *txh, GF_IRect *clip, GF_Rect *unclip);
 
41
void R2D_DrawBitmap(VisualSurface2D *surf, struct _gf_sr_texture_handler *txh, GF_IRect *clip, GF_Rect *unclip, u8 alpha, u32 *col_key, GF_ColorMatrix *cmat);
41
42
GF_FontRaster *FT_Load();
42
43
void FT_Delete(GF_FontRaster *);
43
44
 
49
50
        if (FT_Init_FreeType(&ftpriv->library) ) return GF_IO_ERR;
50
51
 
51
52
        /*remove the final delimiter*/
52
 
    ftpriv->font_dir = "C:\\WINDOWS\\Fonts";
 
53
#if defined(WIN32)
 
54
#pragma message("using C:\\WINDOWS\\Fonts directory for fonts")
 
55
    ftpriv->font_dir = strdup("C:\\WINDOWS\\Fonts");
 
56
#else if defined(_WIN32_WCE)
 
57
#pragma message("using \\Windows directory for fonts")
 
58
    ftpriv->font_dir = strdup("\\Windows");
 
59
#endif
53
60
        strcpy(ftpriv->font_serif,"Arial");
54
61
        strcpy(ftpriv->font_sans,"Times New Roman");
55
62
        strcpy(ftpriv->font_fixed,"Courier New");
95
102
        sr->surface->DrawBitmap = R2D_DrawBitmap;
96
103
        sr->surface->SupportsFormat = R2D_SupportsFormat;
97
104
        sr->surface->render = sr;
98
 
        sr->surface->pixel_format = 0;
99
105
        gf_list_add(sr->surfaces_2D, sr->surface);
100
106
 
101
107
        sr->zoom = sr->scale_x = sr->scale_y = 1.0;
123
129
        GF_SAFEALLOC(tmp->user, sizeof(GF_User))
124
130
 
125
131
        tmp->visual_renderer = NewVisualRenderer();
 
132
        tmp->aspect_ratio = GF_ASPECT_RATIO_FILL_SCREEN;
126
133
 
127
134
        memset(&cfg, 0, sizeof(cfg));
128
135
        cfg.double_buffered = 1;
159
166
        tmp->antiAlias = GF_ANTIALIAS_FULL;
160
167
        return tmp;
161
168
}
 
169
 
 
170
void SR_DeleteStandaloneRenderer(GF_Renderer *tmp)
 
171
{
 
172
        tmp->visual_renderer->UnloadRenderer(tmp->visual_renderer);
 
173
        free(tmp->visual_renderer);
 
174
        DeleteVideoOutput(tmp->video_out);
 
175
        EVG_ShutdownRenderer(tmp->r2d);
 
176
        ft_shutdown_font_engine(tmp->font_engine);
 
177
        FT_Delete(tmp->font_engine);
 
178
        free(tmp->user);
 
179
        free(tmp);
 
180
}
 
181