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 * Unless otherwise indicated, Source Code is licensed under MIT license.
21 * See further explanation attached in License Statement (distributed in the file
24 * Permission is hereby granted, free of charge, to any person obtaining a copy of
25 * this software and associated documentation files (the "Software"), to deal in
26 * the Software without restriction, including without limitation the rights to
27 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
28 * of the Software, and to permit persons to whom the Software is furnished to do
29 * so, subject to the following conditions:
31 * The above copyright notice and this permission notice shall be included in all
32 * copies or substantial portions of the Software.
34 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
37 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
39 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
43 #ifndef __DESCRIPTORS_H__
44 #define __DESCRIPTORS_H__
48 #include "properties.h"
51 * Tags for descriptor (each kind is represented by a number, instead of fourcc as in atoms)
53 #define OBJECT_DESC_TAG 0x01
54 #define INIT_OBJECT_DESC_TAG 0x02
55 #define ES_DESCRIPTOR_TAG 0x03
56 #define DECODER_CONFIG_DESC_TAG 0x04
57 #define DECODER_SPECIFIC_INFO_TAG 0x05
58 #define SL_CONFIG_DESC_TAG 0x06
59 #define ES_ID_INC_TAG 0x0E
60 #define MP4_INIT_OBJECT_DESC_TAG 0x10
62 #define ESDS_OBJECT_TYPE_MPEG1_P3 0x6B
63 #define ESDS_OBJECT_TYPE_MPEG2_P7_MAIN 0x66
64 #define ESDS_OBJECT_TYPE_MPEG4_P7_LC 0x67
65 #define ESDS_OBJECT_TYPE_MPEG4_P7_SSR 0x68
66 #define ESDS_OBJECT_TYPE_MPEG4_P2 0x20
67 #define ESDS_OBJECT_TYPE_MPEG4_P3 0x40
69 #define ESDS_STREAM_TYPE_VISUAL 0x04
70 #define ESDS_STREAM_TYPE_AUDIO 0x05
73 typedef struct _BaseDescriptor
76 /* the first bit of each byte indicates if the next byte should be used */
80 typedef struct _SLConfigDescriptor
84 guint8 predefined; /* everything is supposed predefined */
87 typedef struct _DecoderSpecificInfoDescriptor
92 } DecoderSpecificInfoDescriptor;
94 typedef struct _DecoderConfigDescriptor {
99 /* following are condensed into streamType:
102 * const bit(1) reserved=1;
106 guint8 buffer_size_DB[3];
110 DecoderSpecificInfoDescriptor *dec_specific_info;
111 } DecoderConfigDescriptor;
113 typedef struct _ESDescriptor
119 /* flags contains the following:
120 * bit(1) streamDependenceFlag;
122 * bit(1) OCRstreamFlag;
123 * bit(5) streamPriority;
127 guint16 depends_on_es_id;
128 guint8 url_length; /* only if URL_flag is set */
129 guint8 *url_string; /* size is url_length */
131 guint16 ocr_es_id; /* only if OCRstreamFlag is set */
133 DecoderConfigDescriptor dec_conf_desc;
134 SLConfigDescriptor sl_conf_desc;
136 /* optional remainder of ESDescriptor is not used */
139 /* --- FUNCTIONS --- */
140 void desc_es_init (ESDescriptor *es);
141 ESDescriptor *desc_es_descriptor_new (void);
142 guint64 desc_es_descriptor_copy_data (ESDescriptor *es, guint8 **buffer,
143 guint64 *size, guint64 *offset);
144 void desc_es_descriptor_clear (ESDescriptor *es);
146 DecoderSpecificInfoDescriptor *desc_dec_specific_info_new(void);
147 void desc_dec_specific_info_free (DecoderSpecificInfoDescriptor *dsid);
148 void desc_dec_specific_info_alloc_data (DecoderSpecificInfoDescriptor *dsid,
151 #endif /* __DESCRIPTORS_H__ */