Changeset 194
- Timestamp:
- 11/17/06 18:08:23 (2 years ago)
- Files:
-
- trunk/Codecprintf.c (modified) (1 diff)
- trunk/FFusionCodec.c (modified) (2 diffs)
- trunk/ff_dataref.c (modified) (5 diffs)
- trunk/ff_private.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Codecprintf.c
r57 r194 55 55 if (a < 64) 56 56 { 57 printf("%s:%ld\n", string, a);57 Codecprintf(NULL, "%s%ld\n", string, a); 58 58 } 59 59 else 60 60 { 61 printf("%s: %c%c%c%c\n", string, (unsigned char)((a >> 24) & 0xff), 61 Codecprintf(NULL, "%s%c%c%c%c\n", string, 62 (unsigned char)((a >> 24) & 0xff), 62 63 (unsigned char)((a >> 16) & 0xff), 63 64 (unsigned char)((a >> 8) & 0xff), trunk/FFusionCodec.c
r154 r194 171 171 GetComponentInfo((Component)self, &descout, 0, 0, 0); 172 172 173 Codecprintf(NULL, "Opening component for type"); 174 FourCCprintf(" ", descout.componentSubType); 173 FourCCprintf("Opening component for type ", descout.componentSubType); 175 174 176 175 // Allocate memory for our globals, set them up and inform the component manager that we've done so … … 1230 1229 #define kInfiniteDataSize (0x7fffffff) 1231 1230 1232 //---------------------------------------------------------------------------1233 // Private SubRoutines1234 //---------------------------------------------------------------------------1235 1236 //-----------------------------------------------------------------1237 // FourCCcopy1238 //-----------------------------------------------------------------1239 // Copy src FourCC in dest FourCC1240 //-----------------------------------------------------------------1241 1242 void FourCCcopy(OSType *dest, OSType *src)1243 {1244 int i;1245 1246 for (i=0; i<3; i++)1247 dest[i] = src[i];1248 }1249 1250 //-----------------------------------------------------------------1251 // FourCCprintf1252 //-----------------------------------------------------------------1253 // Compare two FourCC (case sensitive)1254 // Returns 1 if equal, 0 if not equal1255 //-----------------------------------------------------------------1256 1257 int FourCCcompare(OSType *a, OSType *b)1258 {1259 return ((a[0] == b[0]) && (a[1] == b[1]) && (a[2] == b[2]) && (a[3] == b[3]));1260 }1261 1262 1231 //----------------------------------------------------------------- 1263 1232 // FFusionDecompress trunk/ff_dataref.c
r45 r194 31 31 int64_t pos; 32 32 int64_t size; 33 unsigned char supportsWideOffsets; 33 34 }; 34 35 typedef struct _dataref_private dataref_private; … … 72 73 private->size = 0ll; 73 74 74 DataHGetFileSize64(private->dh, &fsize); 75 private->size = (int64_t)fsize.lo; 76 private->size += (int64_t)fsize.hi << 32; 75 result = DataHGetFileSize64(private->dh, &fsize); 76 if(result == noErr) { 77 private->size = (int64_t)fsize.lo; 78 private->size += (int64_t)fsize.hi << 32; 79 // Our data handler supports wide offsets. Remember for later use. 80 private->supportsWideOffsets = 1; 81 } else { 82 long size32; 83 result = DataHGetFileSize(private->dh, &size32); 84 require_noerr(result, bail); 85 private->size = size32; 86 } 77 87 78 88 bail: … … 84 94 int result; 85 95 int64_t read; 86 wide offset; 96 87 97 dataref_private *p = (dataref_private*)h->priv_data; 88 98 … … 90 100 read = (read < size) ? read : size; 91 101 92 offset.hi = p->pos >> 32; 93 offset.lo = (UInt32)p->pos; 94 95 result = DataHScheduleData64(p->dh, (Ptr)buf, &offset, (long)read, 0, NULL, NULL); 102 if(p->supportsWideOffsets) { 103 wide offset; 104 offset.hi = p->pos >> 32; 105 offset.lo = (UInt32)p->pos; 106 107 result = DataHScheduleData64(p->dh, (Ptr)buf, &offset, (long)read, 0, NULL, NULL); 108 } else { 109 result = DataHScheduleData(p->dh, (Ptr)buf, (long)p->pos, (long)read, 0, NULL, NULL); 110 } 111 96 112 if(result != noErr) { 97 113 read = -1; … … 109 125 int result; 110 126 int written = size; 111 wide offset; 112 dataref_private *p = (dataref_private*)h->priv_data; 113 114 offset.hi = p->pos >> 32; 115 offset.lo = (UInt32)p->pos; 116 117 result = DataHWrite64(p->dh, (Ptr)buf, &offset, size, NULL, 0); 127 dataref_private *p = (dataref_private*)h->priv_data; 128 129 if(p->supportsWideOffsets) { 130 wide offset; 131 offset.hi = p->pos >> 32; 132 offset.lo = (UInt32)p->pos; 133 134 result = DataHWrite64(p->dh, (Ptr)buf, &offset, size, NULL, 0); 135 } else { 136 result = DataHWrite(p->dh, (Ptr)buf, (long)p->pos, size, NULL, 0); 137 } 138 118 139 if(result != noErr) { 119 140 written = -1; trunk/ff_private.c
r175 r194 150 150 // need to lookup the fourcc from the codec_id 151 151 (*imgHdl)->cType = map_video_codec_to_mov_tag(codec->codec_id); 152 Codecprintf(NULL, "fourcc: %c%c%c%c\n",0xff & (*imgHdl)->cType,0xff & (*imgHdl)->cType>>8,0xff & (*imgHdl)->cType>>16,0xff & (*imgHdl)->cType>>24);152 FourCCprintf("fourcc: ", (*imgHdl)->cType); 153 153 154 154 (*imgHdl)->temporalQuality = codecMaxQuality;
