comparison asf.c @ 1806:bf6a0dd6d7be libavformat

Add the stream_bitrate GUID to the asf parsing code, and set stream bitrate properties accordingly. Patch by Ryan Martell, rdm4 % martellventures com.
author takis
date Tue, 20 Feb 2007 23:44:11 +0000
parents b090df664f0d
children 9bc07f90d4a2
comparison
equal deleted inserted replaced
1805:2c2e787782bb 1806:bf6a0dd6d7be
32 32
33 static const GUID index_guid = { 33 static const GUID index_guid = {
34 0x90, 0x08, 0x00, 0x33, 0xb1, 0xe5, 0xcf, 0x11, 0x89, 0xf4, 0x00, 0xa0, 0xc9, 0x03, 0x49, 0xcb 34 0x90, 0x08, 0x00, 0x33, 0xb1, 0xe5, 0xcf, 0x11, 0x89, 0xf4, 0x00, 0xa0, 0xc9, 0x03, 0x49, 0xcb
35 }; 35 };
36 36
37 static const GUID stream_bitrate_guid = { /* (http://get.to/sdp) */
38 0xce, 0x75, 0xf8, 0x7b, 0x8d, 0x46, 0xd1, 0x11, 0x8d, 0x82, 0x00, 0x60, 0x97, 0xc9, 0xa2, 0xb2
39 };
37 /**********************************/ 40 /**********************************/
38 /* decoding */ 41 /* decoding */
39 42
40 //#define DEBUG 43 //#define DEBUG
41 44
66 else PRINT_IF_GUID(g, ext_stream_header); 69 else PRINT_IF_GUID(g, ext_stream_header);
67 else PRINT_IF_GUID(g, extended_content_header); 70 else PRINT_IF_GUID(g, extended_content_header);
68 else PRINT_IF_GUID(g, ext_stream_embed_stream_header); 71 else PRINT_IF_GUID(g, ext_stream_embed_stream_header);
69 else PRINT_IF_GUID(g, ext_stream_audio_stream); 72 else PRINT_IF_GUID(g, ext_stream_audio_stream);
70 else PRINT_IF_GUID(g, metadata_header); 73 else PRINT_IF_GUID(g, metadata_header);
74 else PRINT_IF_GUID(g, stream_bitrate_guid);
71 else 75 else
72 printf("(GUID: unknown) "); 76 printf("(GUID: unknown) ");
73 for(i=0;i<16;i++) 77 for(i=0;i<16;i++)
74 printf(" 0x%02x,", (*g)[i]); 78 printf(" 0x%02x,", (*g)[i]);
75 printf("}\n"); 79 printf("}\n");
343 get_str16_nolen(pb, len1, s->title , sizeof(s->title)); 347 get_str16_nolen(pb, len1, s->title , sizeof(s->title));
344 get_str16_nolen(pb, len2, s->author , sizeof(s->author)); 348 get_str16_nolen(pb, len2, s->author , sizeof(s->author));
345 get_str16_nolen(pb, len3, s->copyright, sizeof(s->copyright)); 349 get_str16_nolen(pb, len3, s->copyright, sizeof(s->copyright));
346 get_str16_nolen(pb, len4, s->comment , sizeof(s->comment)); 350 get_str16_nolen(pb, len4, s->comment , sizeof(s->comment));
347 url_fskip(pb, len5); 351 url_fskip(pb, len5);
352 } else if (!memcmp(&g, &stream_bitrate_guid, sizeof(GUID))) {
353 int stream_count = get_le16(pb);
354 int j;
355
356 // av_log(NULL, AV_LOG_ERROR, "stream bitrate properties\n");
357 // av_log(NULL, AV_LOG_ERROR, "streams %d\n", streams);
358 for(j = 0; j < stream_count; j++) {
359 int flags, bitrate, stream_id;
360
361 flags= get_le16(pb);
362 bitrate= get_le32(pb);
363 stream_id= (flags & 0x7f);
364 // av_log(NULL, AV_LOG_ERROR, "flags: 0x%x stream id %d, bitrate %d\n", flags, stream_id, bitrate);
365 asf->stream_bitrates[stream_id-1]= bitrate;
366 }
348 } else if (!memcmp(&g, &extended_content_header, sizeof(GUID))) { 367 } else if (!memcmp(&g, &extended_content_header, sizeof(GUID))) {
349 int desc_count, i; 368 int desc_count, i;
350 369
351 desc_count = get_le16(pb); 370 desc_count = get_le16(pb);
352 for(i=0;i<desc_count;i++) 371 for(i=0;i<desc_count;i++)