From a114d93ac883730acc0cb91e80ad0fababe10f6e Mon Sep 17 00:00:00 2001 From: Thibaut Mattern Date: Thu, 12 Dec 2002 23:30:18 +0000 Subject: Uses asfheader.h CVS patchset: 3500 CVS date: 2002/12/12 23:30:18 --- src/demuxers/demux_asf.c | 191 +---------------------------------------------- 1 file changed, 4 insertions(+), 187 deletions(-) diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c index 61fceabec..a1e5d58d5 100644 --- a/src/demuxers/demux_asf.c +++ b/src/demuxers/demux_asf.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_asf.c,v 1.87 2002/12/08 21:43:50 miguelfreitas Exp $ + * $Id: demux_asf.c,v 1.88 2002/12/12 23:30:18 tmattern Exp $ * * demultiplexer for asf streams * @@ -42,6 +42,7 @@ #include "xine_internal.h" #include "demux.h" #include "xineutils.h" +#include "asfheader.h" /* #define LOG @@ -53,62 +54,6 @@ #define DEFRAG_BUFSIZE 65536 -/* - * define asf GUIDs (list from avifile) - */ -#define GUID_ERROR 0 - - /* base ASF objects */ -#define GUID_ASF_HEADER 1 -#define GUID_ASF_DATA 2 -#define GUID_ASF_SIMPLE_INDEX 3 - - /* header ASF objects */ -#define GUID_ASF_FILE_PROPERTIES 4 -#define GUID_ASF_STREAM_PROPERTIES 5 -#define GUID_ASF_STREAM_BITRATE_PROPERTIES 6 -#define GUID_ASF_CONTENT_DESCRIPTION 7 -#define GUID_ASF_EXTENDED_CONTENT_ENCRYPTION 8 -#define GUID_ASF_SCRIPT_COMMAND 9 -#define GUID_ASF_MARKER 10 -#define GUID_ASF_HEADER_EXTENSION 11 -#define GUID_ASF_BITRATE_MUTUAL_EXCLUSION 12 -#define GUID_ASF_CODEC_LIST 13 -#define GUID_ASF_EXTENDED_CONTENT_DESCRIPTION 14 -#define GUID_ASF_ERROR_CORRECTION 15 -#define GUID_ASF_PADDING 16 - - /* stream properties object stream type */ -#define GUID_ASF_AUDIO_MEDIA 17 -#define GUID_ASF_VIDEO_MEDIA 18 -#define GUID_ASF_COMMAND_MEDIA 19 - - /* stream properties object error correction type */ -#define GUID_ASF_NO_ERROR_CORRECTION 20 -#define GUID_ASF_AUDIO_SPREAD 21 - - /* mutual exclusion object exlusion type */ -#define GUID_ASF_MUTEX_BITRATE 22 -#define GUID_ASF_MUTEX_UKNOWN 23 - - /* header extension */ -#define GUID_ASF_RESERVED_1 24 - - /* script command */ -#define GUID_ASF_RESERVED_SCRIPT_COMMNAND 25 - - /* marker object */ -#define GUID_ASF_RESERVED_MARKER 26 - - /* various */ -/* -#define GUID_ASF_HEAD2 27 -*/ -#define GUID_ASF_AUDIO_CONCEAL_NONE 27 -#define GUID_ASF_CODEC_COMMENT1_HEADER 28 -#define GUID_ASF_2_0_HEADER 29 - -#define GUID_END 30 typedef struct { @@ -209,132 +154,6 @@ typedef struct { } demux_asf_class_t; -typedef struct { - uint32_t v1; - uint16_t v2; - uint16_t v3; - uint8_t v4[8]; -} GUID; - -static const struct -{ - const char* name; - const GUID guid; -} guids[] = -{ - { "error", - { 0x0,} }, - - - /* base ASF objects */ - { "header", - { 0x75b22630, 0x668e, 0x11cf, { 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c }} }, - - { "data", - { 0x75b22636, 0x668e, 0x11cf, { 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c }} }, - - { "simple index", - { 0x33000890, 0xe5b1, 0x11cf, { 0x89, 0xf4, 0x00, 0xa0, 0xc9, 0x03, 0x49, 0xcb }} }, - - - /* header ASF objects */ - { "file properties", - { 0x8cabdca1, 0xa947, 0x11cf, { 0x8e, 0xe4, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65 }} }, - - { "stream header", - { 0xb7dc0791, 0xa9b7, 0x11cf, { 0x8e, 0xe6, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65 }} }, - - { "stream bitrate properties", /* (http://get.to/sdp) */ - { 0x7bf875ce, 0x468d, 0x11d1, { 0x8d, 0x82, 0x00, 0x60, 0x97, 0xc9, 0xa2, 0xb2 }} }, - - { "content description", - { 0x75b22633, 0x668e, 0x11cf, { 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c }} }, - - { "extended content encryption", - { 0x298ae614, 0x2622, 0x4c17, { 0xb9, 0x35, 0xda, 0xe0, 0x7e, 0xe9, 0x28, 0x9c }} }, - - { "script command", - { 0x1efb1a30, 0x0b62, 0x11d0, { 0xa3, 0x9b, 0x00, 0xa0, 0xc9, 0x03, 0x48, 0xf6 }} }, - - { "marker", - { 0xf487cd01, 0xa951, 0x11cf, { 0x8e, 0xe6, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65 }} }, - - { "header extension", - { 0x5fbf03b5, 0xa92e, 0x11cf, { 0x8e, 0xe3, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65 }} }, - - { "bitrate mutual exclusion", - { 0xd6e229dc, 0x35da, 0x11d1, { 0x90, 0x34, 0x00, 0xa0, 0xc9, 0x03, 0x49, 0xbe }} }, - - { "codec list", - { 0x86d15240, 0x311d, 0x11d0, { 0xa3, 0xa4, 0x00, 0xa0, 0xc9, 0x03, 0x48, 0xf6 }} }, - - { "extended content description", - { 0xd2d0a440, 0xe307, 0x11d2, { 0x97, 0xf0, 0x00, 0xa0, 0xc9, 0x5e, 0xa8, 0x50 }} }, - - { "error correction", - { 0x75b22635, 0x668e, 0x11cf, { 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c }} }, - - { "padding", - { 0x1806d474, 0xcadf, 0x4509, { 0xa4, 0xba, 0x9a, 0xab, 0xcb, 0x96, 0xaa, 0xe8 }} }, - - - /* stream properties object stream type */ - { "audio media", - { 0xf8699e40, 0x5b4d, 0x11cf, { 0xa8, 0xfd, 0x00, 0x80, 0x5f, 0x5c, 0x44, 0x2b }} }, - - { "video media", - { 0xbc19efc0, 0x5b4d, 0x11cf, { 0xa8, 0xfd, 0x00, 0x80, 0x5f, 0x5c, 0x44, 0x2b }} }, - - { "command media", - { 0x59dacfc0, 0x59e6, 0x11d0, { 0xa3, 0xac, 0x00, 0xa0, 0xc9, 0x03, 0x48, 0xf6 }} }, - - - /* stream properties object error correction */ - { "no error correction", - { 0x20fb5700, 0x5b55, 0x11cf, { 0xa8, 0xfd, 0x00, 0x80, 0x5f, 0x5c, 0x44, 0x2b }} }, - - { "audio spread", - { 0xbfc3cd50, 0x618f, 0x11cf, { 0x8b, 0xb2, 0x00, 0xaa, 0x00, 0xb4, 0xe2, 0x20 }} }, - - - /* mutual exclusion object exlusion type */ - { "mutex bitrate", - { 0xd6e22a01, 0x35da, 0x11d1, { 0x90, 0x34, 0x00, 0xa0, 0xc9, 0x03, 0x49, 0xbe }} }, - - { "mutex unknown", - { 0xd6e22a02, 0x35da, 0x11d1, { 0x90, 0x34, 0x00, 0xa0, 0xc9, 0x03, 0x49, 0xbe }} }, - - - /* header extension */ - { "reserved_1", - { 0xabd3d211, 0xa9ba, 0x11cf, { 0x8e, 0xe6, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65 }} }, - - - /* script command */ - { "reserved script command", - { 0x4B1ACBE3, 0x100B, 0x11D0, { 0xA3, 0x9B, 0x00, 0xA0, 0xC9, 0x03, 0x48, 0xF6 }} }, - - /* marker object */ - { "reserved marker", - { 0x4CFEDB20, 0x75F6, 0x11CF, { 0x9C, 0x0F, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xCB }} }, - - /* various */ - /* Already defined (reserved_1) - { "head2", - { 0xabd3d211, 0xa9ba, 0x11cf, { 0x8e, 0xe6, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65 }} }, - */ - { "audio conceal none", - { 0x49f1a440, 0x4ece, 0x11d0, { 0xa3, 0xac, 0x00, 0xa0, 0xc9, 0x03, 0x48, 0xf6 }} }, - - { "codec comment1 header", - { 0x86d15241, 0x311d, 0x11d0, { 0xa3, 0xa4, 0x00, 0xa0, 0xc9, 0x03, 0x48, 0xf6 }} }, - - { "asf 2.0 header", - { 0xd6e229d1, 0x35da, 0x11d1, { 0x90, 0x34, 0x00, 0xa0, 0xc9, 0x03, 0x49, 0xbe }} }, - -}; - - static uint8_t get_byte (demux_asf_t *this) { uint8_t buf; @@ -1426,7 +1245,7 @@ static void demux_asf_send_headers (demux_plugin_t *this_gen) { demux_asf_t *this = (demux_asf_t *) this_gen; int i; int stream_id; - uint32_t buf_type, max_vrate, max_arate, sum_rate; + uint32_t buf_type, max_vrate, max_arate; uint32_t bitrate = 0; this->video_fifo = this->stream->video_fifo; @@ -1486,14 +1305,11 @@ static void demux_asf_send_headers (demux_plugin_t *this_gen) { */ max_vrate = 0; max_arate = 0; - sum_rate = 0; for (i = 0; i < this->num_streams; i++) { buf_type = (this->streams[i].buf_type & BUF_MAJOR_MASK); stream_id = this->streams[i].stream_id; bitrate = this->bitrates[stream_id]; - sum_rate += bitrate; - printf("demux_asf: stream: %d, bitrate %d bps\n", stream_id, bitrate); if ((buf_type == BUF_VIDEO_BASE) && (bitrate > max_vrate || this->video_stream_id == 0)) { @@ -1523,6 +1339,7 @@ static void demux_asf_send_headers (demux_plugin_t *this_gen) { asf_send_audio_header(this, this->audio_stream); asf_send_video_header(this, this->video_stream); + } this->frame = 0; -- cgit v1.2.3