Mercurial > libavformat.hg
comparison gxf.c @ 4074:58051a1dc7ea libavformat
Use "struct gxf_stream_info" instead of "st_info_t",
avoids a typedef that is not really worth it and the
reserved POSIX _t namespace.
author | reimar |
---|---|
date | Thu, 11 Dec 2008 10:42:06 +0000 |
parents | 20da3b0e6adf |
children | 10d52cda08dd |
comparison
equal
deleted
inserted
replaced
4073:ecad9e1c8e86 | 4074:58051a1dc7ea |
---|---|
21 | 21 |
22 #include "libavutil/common.h" | 22 #include "libavutil/common.h" |
23 #include "avformat.h" | 23 #include "avformat.h" |
24 #include "gxf.h" | 24 #include "gxf.h" |
25 | 25 |
26 typedef struct { | 26 struct gxf_stream_info { |
27 int64_t first_field; | 27 int64_t first_field; |
28 int64_t last_field; | 28 int64_t last_field; |
29 AVRational frames_per_second; | 29 AVRational frames_per_second; |
30 int32_t fields_per_frame; | 30 int32_t fields_per_frame; |
31 } st_info_t; | 31 }; |
32 | 32 |
33 /** | 33 /** |
34 * \brief parses a packet header, extracting type and length | 34 * \brief parses a packet header, extracting type and length |
35 * \param pb ByteIOContext to read header from | 35 * \param pb ByteIOContext to read header from |
36 * \param type detected packet type is stored here | 36 * \param type detected packet type is stored here |
155 /** | 155 /** |
156 * \brief filters out interesting tags from material information. | 156 * \brief filters out interesting tags from material information. |
157 * \param len length of tag section, will be adjusted to contain remaining bytes | 157 * \param len length of tag section, will be adjusted to contain remaining bytes |
158 * \param si struct to store collected information into | 158 * \param si struct to store collected information into |
159 */ | 159 */ |
160 static void gxf_material_tags(ByteIOContext *pb, int *len, st_info_t *si) { | 160 static void gxf_material_tags(ByteIOContext *pb, int *len, struct gxf_stream_info *si) { |
161 si->first_field = AV_NOPTS_VALUE; | 161 si->first_field = AV_NOPTS_VALUE; |
162 si->last_field = AV_NOPTS_VALUE; | 162 si->last_field = AV_NOPTS_VALUE; |
163 while (*len >= 2) { | 163 while (*len >= 2) { |
164 mat_tag_t tag = get_byte(pb); | 164 mat_tag_t tag = get_byte(pb); |
165 int tlen = get_byte(pb); | 165 int tlen = get_byte(pb); |
204 /** | 204 /** |
205 * \brief filters out interesting tags from track information. | 205 * \brief filters out interesting tags from track information. |
206 * \param len length of tag section, will be adjusted to contain remaining bytes | 206 * \param len length of tag section, will be adjusted to contain remaining bytes |
207 * \param si struct to store collected information into | 207 * \param si struct to store collected information into |
208 */ | 208 */ |
209 static void gxf_track_tags(ByteIOContext *pb, int *len, st_info_t *si) { | 209 static void gxf_track_tags(ByteIOContext *pb, int *len, struct gxf_stream_info *si) { |
210 si->frames_per_second = (AVRational){0, 0}; | 210 si->frames_per_second = (AVRational){0, 0}; |
211 si->fields_per_frame = 0; | 211 si->fields_per_frame = 0; |
212 while (*len >= 2) { | 212 while (*len >= 2) { |
213 track_tag_t tag = get_byte(pb); | 213 track_tag_t tag = get_byte(pb); |
214 int tlen = get_byte(pb); | 214 int tlen = get_byte(pb); |
258 ByteIOContext *pb = s->pb; | 258 ByteIOContext *pb = s->pb; |
259 pkt_type_t pkt_type; | 259 pkt_type_t pkt_type; |
260 int map_len; | 260 int map_len; |
261 int len; | 261 int len; |
262 AVRational main_timebase = {0, 0}; | 262 AVRational main_timebase = {0, 0}; |
263 st_info_t si; | 263 struct gxf_stream_info si; |
264 int i; | 264 int i; |
265 if (!parse_packet_header(pb, &pkt_type, &map_len) || pkt_type != PKT_MAP) { | 265 if (!parse_packet_header(pb, &pkt_type, &map_len) || pkt_type != PKT_MAP) { |
266 av_log(s, AV_LOG_ERROR, "map packet not found\n"); | 266 av_log(s, AV_LOG_ERROR, "map packet not found\n"); |
267 return 0; | 267 return 0; |
268 } | 268 } |