2 * GPAC - Multimedia Framework C SDK
\r
4 * Authors: Jean le Feuvre
\r
5 * Copyright (c) 2005-200X ENST
\r
6 * All rights reserved
\r
8 * This file is part of GPAC / Elementary Stream Interface sub-project
\r
10 * GPAC is free software; you can redistribute it and/or modify
\r
11 * it under the terms of the GNU Lesser General Public License as published by
\r
12 * the Free Software Foundation; either version 2, or (at your option)
\r
13 * any later version.
\r
15 * GPAC is distributed in the hope that it will be useful,
\r
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
18 * GNU Lesser General Public License for more details.
\r
20 * You should have received a copy of the GNU Lesser General Public
\r
21 * License along with this library; see the file COPYING. If not, write to
\r
22 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
\r
33 #include <gpac/tools.h>
\r
35 /* ESI input control commands*/
\r
38 /*forces a data flush from interface to dest (caller) - used for non-threaded interfaces
\r
39 corresponding parameter: unused
\r
41 GF_ESI_INPUT_DATA_FLUSH,
\r
42 /*pulls a COMPLETE AU from the stream
\r
43 corresponding parameter: pointer to a GF_ESIPacket to fill. The indut data_len in the packet is used to indicate any padding in bytes
\r
45 GF_ESI_INPUT_DATA_PULL,
\r
46 /*releases the currently pulled AU from the stream - AU cannot be pulled after that, unless seek happens
\r
47 corresponding parameter: unused
\r
49 GF_ESI_INPUT_DATA_RELEASE,
\r
51 /*destroys any allocated resource by the stream interface*/
\r
52 GF_ESI_INPUT_DESTROY,
\r
55 /* ESI output control commands*/
\r
58 /*forces a data flush from interface to dest (caller) - used for non-threaded interfaces
\r
59 corresponding parameter: unused
\r
61 GF_ESI_OUTPUT_DATA_DISPATCH
\r
69 GF_ESI_DATA_AU_START = 1,
\r
70 GF_ESI_DATA_AU_END = 1<<1,
\r
71 GF_ESI_DATA_AU_RAP = 1<<2,
\r
72 GF_ESI_DATA_HAS_CTS = 1<<3,
\r
73 GF_ESI_DATA_HAS_DTS = 1<<4,
\r
74 GF_ESI_DATA_ENCRYPTED = 1<<5,
\r
77 typedef struct __data_packet_ifce
\r
82 /*DTS, CTS/PTS and duration expressed in media timescale*/
\r
88 /*for packets using ISMACrypt/OMA/3GPP based crypto*/
\r
92 struct __esi_video_info
\r
94 u32 width, height, par;
\r
97 struct __esi_audio_info
\r
99 u32 sample_rate, nb_channels;
\r
104 /*data can be pulled from this stream*/
\r
105 GF_ESI_AU_PULL_CAP = 1,
\r
106 /*DTS is signaled for this stream*/
\r
107 GF_ESI_SIGNAL_DTS = 1<<1,
\r
108 /*no more data to expect from this stream*/
\r
109 GF_ESI_STREAM_IS_OVER = 1<<2,
\r
112 typedef struct __elementary_stream_ifce
\r
114 /*misc caps of the stream*/
\r
116 /*matches PID for MPEG2, ES_ID for MPEG-4*/
\r
118 /*MPEG-TS program number if any*/
\r
119 u16 program_number;
\r
122 u8 object_type_indication;
\r
123 /* MPEG-4 SL Config */
\r
124 GF_SLConfig sl_config;
\r
125 /*stream 4CC for non-mpeg codecs, 0 otherwise (stream is identified through StreamType/ObjectType)*/
\r
127 /*packed 3-char language code (4CC with last byte ' ')*/
\r
129 /*media timescale*/
\r
131 /*duration in ms - 0 if unknown*/
\r
133 /*average bit rate in bit/sec - 0 if unknown*/
\r
136 struct __esi_video_info info_video;
\r
137 struct __esi_audio_info info_audio;
\r
139 /*input ES control from caller*/
\r
140 GF_Err (*input_ctrl)(struct __elementary_stream_ifce *_self, u32 ctrl_type, void *param);
\r
141 /*input user data of interface - usually set by interface owner*/
\r
144 /*output ES control of destination*/
\r
145 GF_Err (*output_ctrl)(struct __elementary_stream_ifce *_self, u32 ctrl_type, void *param);
\r
146 /*output user data of interface - usually set during interface setup*/
\r
151 typedef struct __service_ifce
\r
155 /*input service control from caller*/
\r
156 GF_Err (*input_ctrl)(struct __service_ifce *_self, u32 ctrl_type, void *param);
\r
157 /*input user data of interface - usually set by interface owner*/
\r
160 /*output service control of destination*/
\r
161 GF_Err (*output_ctrl)(struct __service_ifce *_self, u32 ctrl_type, void *param);
\r
162 /*output user data of interface - usually set during interface setup*/
\r
165 GF_ESInterface **streams;
\r
167 } GF_ServiceInterface;
\r
170 typedef struct __data_io
\r
172 u32 (*read)(struct __data_io *_self, char *buffer, u32 nb_bytes);
\r
173 u32 (*write)(struct __data_io *_self, char *buffer, u32 nb_bytes);
\r
182 #endif //_GF_ESI_H_
\r