[vlc-commits] commit: quartztext: Basic support for iOS. (Pierre d'Herbemont )
git at videolan.org
git at videolan.org
Sun Oct 31 11:17:44 CET 2010
vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Sun Oct 31 10:15:07 2010 +0100| [4197f75c1a126e9f0ce9b7774726b62f8e45a261] | committer: Pierre d'Herbemont
quartztext: Basic support for iOS.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4197f75c1a126e9f0ce9b7774726b62f8e45a261
---
modules/misc/quartztext.c | 24 +++++++++++++++++++-----
1 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/modules/misc/quartztext.c b/modules/misc/quartztext.c
index d3e91c9..219efa6 100644
--- a/modules/misc/quartztext.c
+++ b/modules/misc/quartztext.c
@@ -36,11 +36,17 @@
#include <vlc_xml.h>
#include <vlc_input.h>
+#include <Availability.h>
+#include <CoreText/CoreText.h>
+#include <CoreGraphics/CoreGraphics.h>
+
+#if !TARGET_OS_IPHONE
// Fix ourselves ColorSync headers that gets included in ApplicationServices.
#define DisposeCMProfileIterateUPP(a) DisposeCMProfileIterateUPP(CMProfileIterateUPP userUPP __attribute__((unused)))
#define DisposeCMMIterateUPP(a) DisposeCMMIterateUPP(CMProfileIterateUPP userUPP __attribute__((unused)))
#define __MACHINEEXCEPTIONS__
#include <ApplicationServices/ApplicationServices.h>
+#endif
#define DEFAULT_FONT "Arial Black"
#define DEFAULT_FONT_COLOR 0xffffff
@@ -165,8 +171,10 @@ struct filter_sys_t
int i_font_color;
int i_font_size;
+#if !TARGET_OS_IPHONE
ATSFontContainerRef *p_fonts;
int i_fonts;
+#endif
};
//////////////////////////////////////////////////////////////////////////////
@@ -191,8 +199,10 @@ static int Create( vlc_object_t *p_this )
p_filter->pf_render_text = RenderText;
p_filter->pf_render_html = RenderHtml;
+#if !TARGET_OS_IPHONE
p_sys->p_fonts = NULL;
p_sys->i_fonts = 0;
+#endif
LoadFontsFromAttachments( p_filter );
@@ -208,7 +218,7 @@ static void Destroy( vlc_object_t *p_this )
{
filter_t *p_filter = (filter_t *)p_this;
filter_sys_t *p_sys = p_filter->p_sys;
-
+#if !TARGET_OS_IPHONE
if( p_sys->p_fonts )
{
int k;
@@ -220,7 +230,7 @@ static void Destroy( vlc_object_t *p_this )
free( p_sys->p_fonts );
}
-
+#endif
free( p_sys->psz_font_name );
free( p_sys );
}
@@ -231,6 +241,10 @@ static void Destroy( vlc_object_t *p_this )
//////////////////////////////////////////////////////////////////////////////
static int LoadFontsFromAttachments( filter_t *p_filter )
{
+#if TARGET_OS_IPHONE
+ VLC_UNUSED(p_filter);
+ return VLC_SUCCESS;
+#else
filter_sys_t *p_sys = p_filter->p_sys;
input_attachment_t **pp_attachments;
int i_attachments_cnt;
@@ -267,8 +281,8 @@ static int LoadFontsFromAttachments( filter_t *p_filter )
vlc_input_attachment_Delete( p_attach );
}
free( pp_attachments );
-
return VLC_SUCCESS;
+#endif
}
static char *EliminateCRLF( char *psz_string )
@@ -541,7 +555,7 @@ static void setFontAttibutes( char *psz_fontname, int i_font_size, uint32_t i_fo
{
CFStringRef p_cfString;
CTFontRef p_font;
-
+
// Handle font name and size
p_cfString = CFStringCreateWithCString( NULL,
psz_fontname,
@@ -881,7 +895,7 @@ static CGContextRef CreateOffScreenContext( int i_width, int i_height,
p_bitmap->p_data = calloc( i_height, p_bitmap->i_bytesPerRow );
- *pp_colorSpace = CGColorSpaceCreateWithName( kCGColorSpaceGenericRGB );
+ *pp_colorSpace = CGColorSpaceCreateDeviceRGB();
if( p_bitmap->p_data && *pp_colorSpace )
{
More information about the vlc-commits
mailing list