Changeset 1086
- Timestamp:
- 06/25/09 01:41:15 (9 months ago)
- Files:
-
- trunk/FFusionCodec.c (modified) (2 diffs)
- trunk/FrameBuffer.h (modified) (1 diff)
- trunk/Subtitles/SubATSUIRenderer.m (modified) (5 diffs)
- trunk/Subtitles/SubContext.m (modified) (2 diffs)
- trunk/Subtitles/SubImport.h (modified) (1 diff)
- trunk/Subtitles/SubImport.mm (modified) (2 diffs)
- trunk/TextSubCodec.c (modified) (2 diffs)
- trunk/VobSubCodec.c (modified) (2 diffs)
- trunk/bitstream_info.c (modified) (5 diffs)
- trunk/bitstream_info.h (modified) (1 diff)
- trunk/ff_MovieImport.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/FFusionCodec.c
r1069 r1086 32 32 #include <QuickTime/QuickTime.h> 33 33 #include <Accelerate/Accelerate.h> 34 #include <sys/sysctl.h> 34 35 35 36 #include "FFusionCodec.h" … … 414 415 if (glob->begin.parser) 415 416 { 416 f reeFFusionParser(glob->begin.parser);417 ffusionParserFree(glob->begin.parser); 417 418 } 418 419 trunk/FrameBuffer.h
r1074 r1086 103 103 void FFusionDataSetUnparsed(FFusionData *data, uint8_t *buffer, int bufferSize); 104 104 105 void FFusionDataReadUnparsed(FFusionData *data); 105 106 106 107 /*! trunk/Subtitles/SubATSUIRenderer.m
r1048 r1086 253 253 254 254 UCCreateTextBreakLocator(NULL, 0, kUCTextBreakLineMask, &breakLocator); 255 [[SubContext alloc] initWithNonSSAType:kSubTypeSRT delegate:self];255 context = [[SubContext alloc] initWithNonSSAType:kSubTypeSRT delegate:self]; 256 256 } 257 257 … … 277 277 278 278 UCCreateTextBreakLocator(NULL, 0, kUCTextBreakLineMask, &breakLocator); 279 [[SubContext alloc] initWithHeaders:headers styles:styles delegate:self];279 context = [[SubContext alloc] initWithHeaders:headers styles:styles delegate:self]; 280 280 } 281 281 … … 303 303 -(void)completedHeaderParsing:(SubContext*)sc 304 304 { 305 context = sc; 306 screenScaleX = videoWidth / context->resX; 307 screenScaleY = videoHeight / context->resY; 305 screenScaleX = videoWidth / sc->resX; 306 screenScaleY = videoHeight / sc->resY; 308 307 } 309 308 … … 1186 1185 void SubPrerollFromHeader(char *header, int headerLen) 1187 1186 { 1188 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];1189 1187 SubtitleRendererPtr s = headerLen ? SubInitForSSA(header, headerLen, 640, 480) 1190 1188 : SubInitNonSSA(640, 480); … … 1213 1211 1214 1212 SubDisposeRenderer(s); 1215 [pool release];1216 1213 } 1217 1214 trunk/Subtitles/SubContext.m
r1044 r1086 268 268 269 269 } 270 270 271 271 return self; 272 272 } … … 285 285 defaultStyle = [[SubStyle defaultStyleWithDelegate:delegate] retain]; 286 286 } 287 287 288 288 return self; 289 289 } trunk/Subtitles/SubImport.h
r1044 r1086 110 110 { 111 111 __strong void *priv; 112 int retainCount; 112 113 113 114 public: trunk/Subtitles/SubImport.mm
r1046 r1086 1433 1433 priv = [[SubSerializer alloc] init]; 1434 1434 CFRetain(priv); 1435 retainCount = 1; 1435 1436 } 1436 1437 … … 1472 1473 1473 1474 void CXXSubSerializer::release() 1474 { 1475 SubSerializer *s = (SubSerializer*)priv; 1476 int r = [s retainCount]; 1477 1478 if (r == 1) delete this; 1479 else [s release]; 1475 { 1476 retainCount--; 1477 1478 if (!retainCount) 1479 delete this; 1480 1480 } 1481 1481 1482 1482 void CXXSubSerializer::retain() 1483 1483 { 1484 [(SubSerializer*)priv retain];1484 retainCount++; 1485 1485 } 1486 1486 trunk/TextSubCodec.c
r1038 r1086 117 117 glob->ssa = NULL; 118 118 glob->colorSpace = NULL; 119 glob->translateSRT = true; 119 120 120 121 // Open and target an instance of the base decompressor as we delegate … … 248 249 249 250 capabilities->flags |= codecCanAsync | codecCanAsyncWhen | codecCanScale; 250 capabilities->flags2 |= codecDrawsHigherQualityScaled; 251 252 glob->colorSpace = NULL; 253 glob->translateSRT = true; 254 glob->ssa = NULL; 251 capabilities->flags2 |= codecDrawsHigherQualityScaled; 255 252 256 253 if (!glob->ssa) { trunk/VobSubCodec.c
r1056 r1086 24 24 #include "VobSubCodec.h" 25 25 #include "Codecprintf.h" 26 #include "CommonUtils.h" 26 27 #include <zlib.h> 27 28 #include "avcodec.h" … … 85 86 static ComponentResult ReadPacketControls(UInt8 *packet, UInt32 palette[16], PacketControlData *controlDataOut); 86 87 extern void initLib(); 88 extern void init_FFmpeg(); 87 89 88 90 ComponentResult VobSubCodecOpen(VobSubCodecGlobals glob, ComponentInstance self) trunk/bitstream_info.c
r1038 r1086 36 36 #include "parser.h" 37 37 #include "golomb.h" 38 #include "mpeg4video_parser.h" 39 #include "Codecprintf.h" 38 40 39 41 #include "CodecIDs.h" … … 868 870 } 869 871 870 void freeFFusionParser(FFusionParserContext *parser) 871 { 872 void ffusionParserFree(FFusionParserContext *parser) 873 { 874 AVCodecParser *avparse = parser->parserStructure->avparse; 875 872 876 if(parser->pc) 873 877 { 874 if(parser->pc->priv_data) 875 av_free(parser->pc->priv_data); 878 if (avparse->parser_close) 879 avparse->parser_close(parser->pc); 880 av_free(parser->pc->priv_data); 876 881 av_free(parser->pc); 877 882 } 878 if(parser->avctx) 879 av_free(parser->avctx); 880 if(parser->internalContext) 881 av_free(parser->internalContext); 883 av_free(parser->avctx); 884 av_free(parser->internalContext); 882 885 free(parser); 883 886 } … … 888 891 AVCodecParser *parser; 889 892 FFusionParser *ffParser; 890 int ret; 891 struct AVCodecContext *ctx = avcodec_alloc_context(); 893 int ret, i; 892 894 893 895 if(codec_id == CODEC_ID_NONE) … … 898 900 for(ffParser = ffusionFirstParser; ffParser != NULL; ffParser = ffParser->next) { 899 901 parser = ffParser->avparse; 900 if (parser->codec_ids[0] == codec_id || 901 parser->codec_ids[1] == codec_id || 902 parser->codec_ids[2] == codec_id || 903 parser->codec_ids[3] == codec_id || 904 parser->codec_ids[4] == codec_id) 905 goto found; 902 903 for (i = 0; i < 5; i++) 904 if (parser->codec_ids[i] == codec_id) 905 goto found; 906 906 } 907 907 return NULL; … … 928 928 929 929 FFusionParserContext *parserContext = malloc(sizeof(FFusionParserContext)); 930 parserContext->avctx = ctx;930 parserContext->avctx = avcodec_alloc_context(); 931 931 parserContext->pc = s; 932 932 parserContext->parserStructure = ffParser; trunk/bitstream_info.h
r1038 r1086 59 59 void initFFusionParsers(); 60 60 FFusionParserContext *ffusionParserInit(int codec_id); 61 void ffusionParserFree(FFusionParserContext *parser); 61 62 int ffusionParseExtraData(FFusionParserContext *parser, const uint8_t *buf, int buf_size); 62 63 int ffusionParse(FFusionParserContext *parser, const uint8_t *buf, int buf_size, int *out_buf_size, int *type, int *skippable); trunk/ff_MovieImport.c
r1083 r1086 556 556 bail: 557 557 if(result == noErr) 558 storage->movieLoadState = =kMovieLoadStateLoaded;558 storage->movieLoadState = kMovieLoadStateLoaded; 559 559 else 560 storage->movieLoadState = =kMovieLoadStateError;560 storage->movieLoadState = kMovieLoadStateError; 561 561 562 562 if (result == -1)
