3 * author: Tahseen Mohammad
14 #define snprintf _snprintf
17 #include <ext/libogg/ogg.h>
19 #define SKELETON_VERSION_MAJOR 3
20 #define SKELETON_VERSION_MINOR 0
21 #define FISHEAD_IDENTIFIER "fishead\0"
22 #define FISBONE_IDENTIFIER "fisbone\0"
23 #define FISHEAD_SIZE 64
24 #define FISBONE_SIZE 52
25 #define FISBONE_MESSAGE_HEADER_OFFSET 44
27 /* fishead_packet holds a fishead header packet. */
29 ogg_uint16_t version_major; /* skeleton version major */
30 ogg_uint16_t version_minor; /* skeleton version minor */
31 /* Start time of the presentation
32 * For a new stream presentationtime & basetime is same. */
33 ogg_int64_t ptime_n; /* presentation time numerator */
34 ogg_int64_t ptime_d; /* presentation time denominator */
35 ogg_int64_t btime_n; /* basetime numerator */
36 ogg_int64_t btime_d; /* basetime denominator */
37 /* will holds the time of origin of the stream, a 20 bit field. */
38 unsigned char UTC[20];
41 /* fisbone_packet holds a fisbone header packet. */
43 ogg_uint32_t serial_no; /* serial no of the corresponding stream */
44 ogg_uint32_t nr_header_packet; /* number of header packets */
45 /* granule rate is the temporal resolution of the logical bitstream */
46 ogg_int64_t granule_rate_n; /* granule rate numerator */
47 ogg_int64_t granule_rate_d; /* granule rate denominator */
48 ogg_int64_t start_granule; /* start granule value */
49 ogg_uint32_t preroll; /* preroll */
50 unsigned char granule_shift; /* 1 byte value holding the granule shift */
51 char *message_header_fields; /* holds all the message header fields */
52 /* current total size of the message header fields, for realloc purpose, initially zero */
53 ogg_uint32_t current_header_size;
56 extern int write_ogg_page_to_file(ogg_page *og, FILE *out);
57 extern int add_message_header_field(fisbone_packet *fp, char *header_key, char *header_value);
58 /* remember to deallocate the returned ogg_packet properly */
59 extern ogg_packet ogg_from_fishead(fishead_packet *fp);
60 extern ogg_packet ogg_from_fisbone(fisbone_packet *fp);
61 extern fishead_packet fishead_from_ogg(ogg_packet *op);
62 extern fisbone_packet fisbone_from_ogg(ogg_packet *op);
63 extern int add_fishead_to_stream(ogg_stream_state *os, fishead_packet *fp);
64 extern int add_fisbone_to_stream(ogg_stream_state *os, fisbone_packet *fp);
65 extern int add_eos_packet_to_stream(ogg_stream_state *os);
66 extern int flush_ogg_stream_to_file(ogg_stream_state *os, FILE *out);
72 #endif /* _SKELETON_H */