1 /* Quicktime muxer plugin for GStreamer
2 * Copyright (C) 2008 Thiago Sousa Santos <thiagoss@embedded.ufcg.edu.br>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #ifndef __DESCRIPTORS_H__
21 #define __DESCRIPTORS_H__
25 #include "properties.h"
28 * Tags for descriptor (each kind is represented by a number, instead of fourcc as in atoms)
30 #define OBJECT_DESC_TAG 0x01
31 #define INIT_OBJECT_DESC_TAG 0x02
32 #define ES_DESCRIPTOR_TAG 0x03
33 #define DECODER_CONFIG_DESC_TAG 0x04
34 #define DECODER_SPECIFIC_INFO_TAG 0x05
35 #define SL_CONFIG_DESC_TAG 0x06
36 #define ES_ID_INC_TAG 0x0E
37 #define MP4_INIT_OBJECT_DESC_TAG 0x10
39 #define ESDS_OBJECT_TYPE_MPEG1_P3 0x6B
40 #define ESDS_OBJECT_TYPE_MPEG2_P7_MAIN 0x66
41 #define ESDS_OBJECT_TYPE_MPEG4_P7_LC 0x67
42 #define ESDS_OBJECT_TYPE_MPEG4_P7_SSR 0x68
43 #define ESDS_OBJECT_TYPE_MPEG4_P2 0x20
44 #define ESDS_OBJECT_TYPE_MPEG4_P3 0x40
46 #define ESDS_STREAM_TYPE_VISUAL 0x04
47 #define ESDS_STREAM_TYPE_AUDIO 0x05
50 typedef struct _BaseDescriptor
53 /* the first bit of each byte indicates if the next byte should be used */
57 typedef struct _SLConfigDescriptor
61 guint8 predefined; /* everything is supposed predefined */
64 typedef struct _DecoderSpecificInfoDescriptor
69 } DecoderSpecificInfoDescriptor;
71 typedef struct _DecoderConfigDescriptor {
76 /* following are condensed into streamType:
79 * const bit(1) reserved=1;
83 guint8 buffer_size_DB[3];
87 DecoderSpecificInfoDescriptor *dec_specific_info;
88 } DecoderConfigDescriptor;
90 typedef struct _ESDescriptor
96 /* flags contains the following:
97 * bit(1) streamDependenceFlag;
99 * bit(1) OCRstreamFlag;
100 * bit(5) streamPriority;
104 guint16 depends_on_es_id;
105 guint8 url_length; /* only if URL_flag is set */
106 guint8 *url_string; /* size is url_length */
108 guint16 ocr_es_id; /* only if OCRstreamFlag is set */
110 DecoderConfigDescriptor dec_conf_desc;
111 SLConfigDescriptor sl_conf_desc;
113 /* optional remainder of ESDescriptor is not used */
116 /* --- FUNCTIONS --- */
117 void desc_es_init (ESDescriptor *es);
118 ESDescriptor *desc_es_descriptor_new ();
119 guint64 desc_es_descriptor_copy_data (ESDescriptor *es, guint8 **buffer,
120 guint64 *size, guint64 *offset);
121 void desc_es_descriptor_clear (ESDescriptor *es);
123 DecoderSpecificInfoDescriptor *desc_dec_specific_info_new();
124 void desc_dec_specific_info_free (DecoderSpecificInfoDescriptor *dsid);
125 void desc_dec_specific_info_alloc_data (DecoderSpecificInfoDescriptor *dsid,
128 #endif /* __DESCRIPTORS_H__ */