|
Revision 850, 1.4 kB
(checked in by astrange, 6 months ago)
|
Preroll subtitle fonts when loading the file.
This moves the annoying pause on start to the main thread.
Some cleanup.
|
| Line | |
|---|
| 1 |
// |
|---|
| 2 |
// SubATSUIRenderer.h |
|---|
| 3 |
// SSARender2 |
|---|
| 4 |
// |
|---|
| 5 |
// Created by Alexander Strange on 7/30/07. |
|---|
| 6 |
// Copyright 2007 __MyCompanyName__. All rights reserved. |
|---|
| 7 |
// |
|---|
| 8 |
|
|---|
| 9 |
#ifdef __cplusplus |
|---|
| 10 |
extern "C" |
|---|
| 11 |
{ |
|---|
| 12 |
#endif |
|---|
| 13 |
|
|---|
| 14 |
#ifdef __OBJC__ |
|---|
| 15 |
#import <Cocoa/Cocoa.h> |
|---|
| 16 |
#import "SubRenderer.h" |
|---|
| 17 |
|
|---|
| 18 |
@interface SubATSUIRenderer : SubRenderer { |
|---|
| 19 |
SubContext *context; |
|---|
| 20 |
unichar *ubuffer; |
|---|
| 21 |
ATSUTextLayout layout; |
|---|
| 22 |
float screenScaleX, screenScaleY, videoWidth, videoHeight; |
|---|
| 23 |
@public; |
|---|
| 24 |
CGColorSpaceRef srgbCSpace; |
|---|
| 25 |
TextBreakLocatorRef breakLocator; |
|---|
| 26 |
} |
|---|
| 27 |
-(SubATSUIRenderer*)initWithVideoWidth:(float)width videoHeight:(float)height; |
|---|
| 28 |
-(SubATSUIRenderer*)initWithSSAHeader:(NSString*)header videoWidth:(float)width videoHeight:(float)height; |
|---|
| 29 |
-(void)renderPacket:(NSString *)packet inContext:(CGContextRef)c width:(float)cWidth height:(float)cHeight; |
|---|
| 30 |
@end |
|---|
| 31 |
|
|---|
| 32 |
typedef SubATSUIRenderer *SubtitleRendererPtr; |
|---|
| 33 |
|
|---|
| 34 |
#else |
|---|
| 35 |
#include <QuickTime/QuickTime.h> |
|---|
| 36 |
|
|---|
| 37 |
typedef void *SubtitleRendererPtr; |
|---|
| 38 |
|
|---|
| 39 |
#endif |
|---|
| 40 |
|
|---|
| 41 |
extern SubtitleRendererPtr SubInitForSSA(char *header, size_t headerLen, int width, int height); |
|---|
| 42 |
extern SubtitleRendererPtr SubInitNonSSA(int width, int height); |
|---|
| 43 |
extern CGColorSpaceRef SubGetColorSpace(SubtitleRendererPtr s); |
|---|
| 44 |
extern void SubRenderPacket(SubtitleRendererPtr s, CGContextRef c, CFStringRef str, int cWidth, int cHeight); |
|---|
| 45 |
extern void SubPrerollFromHeader(char *header, int headerLen); |
|---|
| 46 |
extern void SubDisposeRenderer(SubtitleRendererPtr s); |
|---|
| 47 |
|
|---|
| 48 |
#ifdef __cplusplus |
|---|
| 49 |
} |
|---|
| 50 |
#endif |
|---|