root/branches/perian-1.0/CommonUtils.h

Revision 242, 1.1 kB (checked in by dconrad, 2 years ago)

Rewrite/cleanup of the Matroska importer
- No longer reads the entire file into memory before processing it
- Imports subtitle tracks that are numerically before video tracks correctly
- Fixes some memory leaks
- Fixes EOF in DataHandlerCallback?

Line 
1 /*
2  *  CommonUtils.h
3  *  Perian
4  *
5  *  Created by David Conrad on 10/13/06.
6  *  Copyright 2006 Perian Project. All rights reserved.
7  *
8  */
9
10 #ifndef __COMMONUTILS_H__
11 #define __COMMONUTILS_H__
12
13 #ifdef __cplusplus
14 extern "C"
15 {
16 #endif
17
18 // ISO 639-1 to language ID expected by SetMediaLanguage
19 short ISO639_1ToQTLangCode(const char *lang);
20
21 // ISO 639-2 to language ID expected by SetMediaLanguage
22 short ISO639_2ToQTLangCode(const char *lang);
23
24 /* write the int32_t data to target & then return a pointer which points after that data */
25 uint8_t *write_int32(uint8_t *target, int32_t data);
26
27 /* write the int16_t data to target & then return a pointer which points after that data */
28 uint8_t *write_int16(uint8_t *target, int16_t data);
29
30 /* write the data to the target adress & then return a pointer which points after the written data */
31 uint8_t *write_data(uint8_t *target, uint8_t* data, int32_t data_size);
32
33 // mallocs the buffer and copies the codec-specific description to it, in the same format
34 // as is specified in Matroska and is used in libavcodec
35 ComponentResult ReadESDSDescExt(Handle descExt, UInt8 **buffer, int *size);
36
37 #ifdef __cplusplus
38 }
39 #endif
40
41 #endif
Note: See TracBrowser for help on using the browser.