move static tables from asf.h to non-static tables in asf.c

this avoid getting those tables duplicated in asfenc.o and asfdec.o

Originally committed as revision 17619 to svn://svn.ffmpeg.org/ffmpeg/trunk
pull/126/head
Aurelien Jacobs 16 years ago
parent 5e293c424d
commit 17af052531
  1. 6
      libavformat/Makefile
  2. 113
      libavformat/asf.c
  3. 112
      libavformat/asf.h
  4. 72
      libavformat/asfdec.c
  5. 36
      libavformat/asfenc.c

@ -18,9 +18,9 @@ OBJS-$(CONFIG_AMR_DEMUXER) += amr.o
OBJS-$(CONFIG_AMR_MUXER) += amr.o OBJS-$(CONFIG_AMR_MUXER) += amr.o
OBJS-$(CONFIG_APC_DEMUXER) += apc.o OBJS-$(CONFIG_APC_DEMUXER) += apc.o
OBJS-$(CONFIG_APE_DEMUXER) += ape.o OBJS-$(CONFIG_APE_DEMUXER) += ape.o
OBJS-$(CONFIG_ASF_DEMUXER) += asfdec.o asfcrypt.o riff.o OBJS-$(CONFIG_ASF_DEMUXER) += asfdec.o asf.o asfcrypt.o riff.o
OBJS-$(CONFIG_ASF_MUXER) += asfenc.o riff.o OBJS-$(CONFIG_ASF_MUXER) += asfenc.o asf.o riff.o
OBJS-$(CONFIG_ASF_STREAM_MUXER) += asfenc.o riff.o OBJS-$(CONFIG_ASF_STREAM_MUXER) += asfenc.o asf.o riff.o
OBJS-$(CONFIG_ASS_DEMUXER) += assdec.o OBJS-$(CONFIG_ASS_DEMUXER) += assdec.o
OBJS-$(CONFIG_ASS_MUXER) += assenc.o OBJS-$(CONFIG_ASS_MUXER) += assenc.o
OBJS-$(CONFIG_AU_DEMUXER) += au.o raw.o OBJS-$(CONFIG_AU_DEMUXER) += au.o raw.o

@ -0,0 +1,113 @@
/*
* Copyright (c) 2000, 2001 Fabrice Bellard
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "asf.h"
const GUID ff_asf_header = {
0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C
};
const GUID ff_asf_file_header = {
0xA1, 0xDC, 0xAB, 0x8C, 0x47, 0xA9, 0xCF, 0x11, 0x8E, 0xE4, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65
};
const GUID ff_asf_stream_header = {
0x91, 0x07, 0xDC, 0xB7, 0xB7, 0xA9, 0xCF, 0x11, 0x8E, 0xE6, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65
};
const GUID ff_asf_ext_stream_header = {
0xCB, 0xA5, 0xE6, 0x14, 0x72, 0xC6, 0x32, 0x43, 0x83, 0x99, 0xA9, 0x69, 0x52, 0x06, 0x5B, 0x5A
};
const GUID ff_asf_audio_stream = {
0x40, 0x9E, 0x69, 0xF8, 0x4D, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B
};
const GUID ff_asf_audio_conceal_none = {
// 0x40, 0xa4, 0xf1, 0x49, 0x4ece, 0x11d0, 0xa3, 0xac, 0x00, 0xa0, 0xc9, 0x03, 0x48, 0xf6
// New value lifted from avifile
0x00, 0x57, 0xfb, 0x20, 0x55, 0x5B, 0xCF, 0x11, 0xa8, 0xfd, 0x00, 0x80, 0x5f, 0x5c, 0x44, 0x2b
};
const GUID ff_asf_audio_conceal_spread = {
0x50, 0xCD, 0xC3, 0xBF, 0x8F, 0x61, 0xCF, 0x11, 0x8B, 0xB2, 0x00, 0xAA, 0x00, 0xB4, 0xE2, 0x20
};
const GUID ff_asf_video_stream = {
0xC0, 0xEF, 0x19, 0xBC, 0x4D, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B
};
const GUID ff_asf_video_conceal_none = {
0x00, 0x57, 0xFB, 0x20, 0x55, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B
};
const GUID ff_asf_command_stream = {
0xC0, 0xCF, 0xDA, 0x59, 0xE6, 0x59, 0xD0, 0x11, 0xA3, 0xAC, 0x00, 0xA0, 0xC9, 0x03, 0x48, 0xF6
};
const GUID ff_asf_comment_header = {
0x33, 0x26, 0xb2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c
};
const GUID ff_asf_codec_comment_header = {
0x40, 0x52, 0xD1, 0x86, 0x1D, 0x31, 0xD0, 0x11, 0xA3, 0xA4, 0x00, 0xA0, 0xC9, 0x03, 0x48, 0xF6
};
const GUID ff_asf_codec_comment1_header = {
0x41, 0x52, 0xd1, 0x86, 0x1D, 0x31, 0xD0, 0x11, 0xa3, 0xa4, 0x00, 0xa0, 0xc9, 0x03, 0x48, 0xf6
};
const GUID ff_asf_data_header = {
0x36, 0x26, 0xb2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c
};
const GUID ff_asf_head1_guid = {
0xb5, 0x03, 0xbf, 0x5f, 0x2E, 0xA9, 0xCF, 0x11, 0x8e, 0xe3, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65
};
const GUID ff_asf_head2_guid = {
0x11, 0xd2, 0xd3, 0xab, 0xBA, 0xA9, 0xCF, 0x11, 0x8e, 0xe6, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65
};
const GUID ff_asf_extended_content_header = {
0x40, 0xA4, 0xD0, 0xD2, 0x07, 0xE3, 0xD2, 0x11, 0x97, 0xF0, 0x00, 0xA0, 0xC9, 0x5E, 0xA8, 0x50
};
const GUID ff_asf_simple_index_header = {
0x90, 0x08, 0x00, 0x33, 0xB1, 0xE5, 0xCF, 0x11, 0x89, 0xF4, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xCB
};
const GUID ff_asf_ext_stream_embed_stream_header = {
0xe2, 0x65, 0xfb, 0x3a, 0xEF, 0x47, 0xF2, 0x40, 0xac, 0x2c, 0x70, 0xa9, 0x0d, 0x71, 0xd3, 0x43
};
const GUID ff_asf_ext_stream_audio_stream = {
0x9d, 0x8c, 0x17, 0x31, 0xE1, 0x03, 0x28, 0x45, 0xb5, 0x82, 0x3d, 0xf9, 0xdb, 0x22, 0xf5, 0x03
};
const GUID ff_asf_metadata_header = {
0xea, 0xcb, 0xf8, 0xc5, 0xaf, 0x5b, 0x77, 0x48, 0x84, 0x67, 0xaa, 0x8c, 0x44, 0xfa, 0x4c, 0xca
};
/* I am not a number !!! This GUID is the one found on the PC used to
generate the stream */
const GUID ff_asf_my_guid = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};

@ -134,96 +134,28 @@ typedef struct {
ASFStream* asf_st; ///< currently decoded stream ASFStream* asf_st; ///< currently decoded stream
} ASFContext; } ASFContext;
static const GUID asf_header = { extern const GUID ff_asf_header;
0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C extern const GUID ff_asf_file_header;
}; extern const GUID ff_asf_stream_header;
extern const GUID ff_asf_ext_stream_header;
static const GUID file_header = { extern const GUID ff_asf_audio_stream;
0xA1, 0xDC, 0xAB, 0x8C, 0x47, 0xA9, 0xCF, 0x11, 0x8E, 0xE4, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65 extern const GUID ff_asf_audio_conceal_none;
}; extern const GUID ff_asf_audio_conceal_spread;
extern const GUID ff_asf_video_stream;
static const GUID stream_header = { extern const GUID ff_asf_video_conceal_none;
0x91, 0x07, 0xDC, 0xB7, 0xB7, 0xA9, 0xCF, 0x11, 0x8E, 0xE6, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65 extern const GUID ff_asf_command_stream;
}; extern const GUID ff_asf_comment_header;
extern const GUID ff_asf_codec_comment_header;
static const GUID ext_stream_header = { extern const GUID ff_asf_codec_comment1_header;
0xCB, 0xA5, 0xE6, 0x14, 0x72, 0xC6, 0x32, 0x43, 0x83, 0x99, 0xA9, 0x69, 0x52, 0x06, 0x5B, 0x5A extern const GUID ff_asf_data_header;
}; extern const GUID ff_asf_head1_guid;
extern const GUID ff_asf_head2_guid;
static const GUID audio_stream = { extern const GUID ff_asf_extended_content_header;
0x40, 0x9E, 0x69, 0xF8, 0x4D, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B extern const GUID ff_asf_simple_index_header;
}; extern const GUID ff_asf_ext_stream_embed_stream_header;
extern const GUID ff_asf_ext_stream_audio_stream;
static const GUID audio_conceal_none = { extern const GUID ff_asf_metadata_header;
// 0x40, 0xa4, 0xf1, 0x49, 0x4ece, 0x11d0, 0xa3, 0xac, 0x00, 0xa0, 0xc9, 0x03, 0x48, 0xf6 extern const GUID ff_asf_my_guid;
// New value lifted from avifile
0x00, 0x57, 0xfb, 0x20, 0x55, 0x5B, 0xCF, 0x11, 0xa8, 0xfd, 0x00, 0x80, 0x5f, 0x5c, 0x44, 0x2b
};
static const GUID audio_conceal_spread = {
0x50, 0xCD, 0xC3, 0xBF, 0x8F, 0x61, 0xCF, 0x11, 0x8B, 0xB2, 0x00, 0xAA, 0x00, 0xB4, 0xE2, 0x20
};
static const GUID video_stream = {
0xC0, 0xEF, 0x19, 0xBC, 0x4D, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B
};
static const GUID video_conceal_none = {
0x00, 0x57, 0xFB, 0x20, 0x55, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B
};
static const GUID command_stream = {
0xC0, 0xCF, 0xDA, 0x59, 0xE6, 0x59, 0xD0, 0x11, 0xA3, 0xAC, 0x00, 0xA0, 0xC9, 0x03, 0x48, 0xF6
};
static const GUID comment_header = {
0x33, 0x26, 0xb2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c
};
static const GUID codec_comment_header = {
0x40, 0x52, 0xD1, 0x86, 0x1D, 0x31, 0xD0, 0x11, 0xA3, 0xA4, 0x00, 0xA0, 0xC9, 0x03, 0x48, 0xF6
};
static const GUID codec_comment1_header = {
0x41, 0x52, 0xd1, 0x86, 0x1D, 0x31, 0xD0, 0x11, 0xa3, 0xa4, 0x00, 0xa0, 0xc9, 0x03, 0x48, 0xf6
};
static const GUID data_header = {
0x36, 0x26, 0xb2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c
};
static const GUID head1_guid = {
0xb5, 0x03, 0xbf, 0x5f, 0x2E, 0xA9, 0xCF, 0x11, 0x8e, 0xe3, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65
};
static const GUID head2_guid = {
0x11, 0xd2, 0xd3, 0xab, 0xBA, 0xA9, 0xCF, 0x11, 0x8e, 0xe6, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65
};
static const GUID extended_content_header = {
0x40, 0xA4, 0xD0, 0xD2, 0x07, 0xE3, 0xD2, 0x11, 0x97, 0xF0, 0x00, 0xA0, 0xC9, 0x5E, 0xA8, 0x50
};
static const GUID simple_index_header = {
0x90, 0x08, 0x00, 0x33, 0xB1, 0xE5, 0xCF, 0x11, 0x89, 0xF4, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xCB
};
static const GUID ext_stream_embed_stream_header = {
0xe2, 0x65, 0xfb, 0x3a, 0xEF, 0x47, 0xF2, 0x40, 0xac, 0x2c, 0x70, 0xa9, 0x0d, 0x71, 0xd3, 0x43
};
static const GUID ext_stream_audio_stream = {
0x9d, 0x8c, 0x17, 0x31, 0xE1, 0x03, 0x28, 0x45, 0xb5, 0x82, 0x3d, 0xf9, 0xdb, 0x22, 0xf5, 0x03
};
static const GUID metadata_header = {
0xea, 0xcb, 0xf8, 0xc5, 0xaf, 0x5b, 0x77, 0x48, 0x84, 0x67, 0xaa, 0x8c, 0x44, 0xfa, 0x4c, 0xca
};
/* I am not a number !!! This GUID is the one found on the PC used to
generate the stream */
static const GUID my_guid = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
#define ASF_PACKET_FLAG_ERROR_CORRECTION_PRESENT 0x80 //1000 0000 #define ASF_PACKET_FLAG_ERROR_CORRECTION_PRESENT 0x80 //1000 0000

@ -54,27 +54,27 @@ if (!memcmp(g, &cmp, sizeof(GUID))) \
static void print_guid(const GUID *g) static void print_guid(const GUID *g)
{ {
int i; int i;
PRINT_IF_GUID(g, asf_header); PRINT_IF_GUID(g, ff_asf_header);
else PRINT_IF_GUID(g, file_header); else PRINT_IF_GUID(g, ff_asf_file_header);
else PRINT_IF_GUID(g, stream_header); else PRINT_IF_GUID(g, ff_asf_stream_header);
else PRINT_IF_GUID(g, audio_stream); else PRINT_IF_GUID(g, ff_asf_audio_stream);
else PRINT_IF_GUID(g, audio_conceal_none); else PRINT_IF_GUID(g, ff_asf_audio_conceal_none);
else PRINT_IF_GUID(g, video_stream); else PRINT_IF_GUID(g, ff_asf_video_stream);
else PRINT_IF_GUID(g, video_conceal_none); else PRINT_IF_GUID(g, ff_asf_video_conceal_none);
else PRINT_IF_GUID(g, command_stream); else PRINT_IF_GUID(g, ff_asf_command_stream);
else PRINT_IF_GUID(g, comment_header); else PRINT_IF_GUID(g, ff_asf_comment_header);
else PRINT_IF_GUID(g, codec_comment_header); else PRINT_IF_GUID(g, ff_asf_codec_comment_header);
else PRINT_IF_GUID(g, codec_comment1_header); else PRINT_IF_GUID(g, ff_asf_codec_comment1_header);
else PRINT_IF_GUID(g, data_header); else PRINT_IF_GUID(g, ff_asf_data_header);
else PRINT_IF_GUID(g, index_guid); else PRINT_IF_GUID(g, index_guid);
else PRINT_IF_GUID(g, head1_guid); else PRINT_IF_GUID(g, ff_asf_head1_guid);
else PRINT_IF_GUID(g, head2_guid); else PRINT_IF_GUID(g, ff_asf_head2_guid);
else PRINT_IF_GUID(g, my_guid); else PRINT_IF_GUID(g, ff_asf_my_guid);
else PRINT_IF_GUID(g, ext_stream_header); else PRINT_IF_GUID(g, ff_asf_ext_stream_header);
else PRINT_IF_GUID(g, extended_content_header); else PRINT_IF_GUID(g, ff_asf_extended_content_header);
else PRINT_IF_GUID(g, ext_stream_embed_stream_header); else PRINT_IF_GUID(g, ff_asf_ext_stream_embed_stream_header);
else PRINT_IF_GUID(g, ext_stream_audio_stream); else PRINT_IF_GUID(g, ff_asf_ext_stream_audio_stream);
else PRINT_IF_GUID(g, metadata_header); else PRINT_IF_GUID(g, ff_asf_metadata_header);
else PRINT_IF_GUID(g, stream_bitrate_guid); else PRINT_IF_GUID(g, stream_bitrate_guid);
else else
dprintf(NULL, "(GUID: unknown) "); dprintf(NULL, "(GUID: unknown) ");
@ -125,7 +125,7 @@ static void get_str16_nolen(ByteIOContext *pb, int len, char *buf, int buf_size)
static int asf_probe(AVProbeData *pd) static int asf_probe(AVProbeData *pd)
{ {
/* check file header */ /* check file header */
if (!memcmp(pd->buf, &asf_header, sizeof(GUID))) if (!memcmp(pd->buf, &ff_asf_header, sizeof(GUID)))
return AVPROBE_SCORE_MAX; return AVPROBE_SCORE_MAX;
else else
return 0; return 0;
@ -174,7 +174,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
memset(bitrate, 0, sizeof(bitrate)); memset(bitrate, 0, sizeof(bitrate));
get_guid(pb, &g); get_guid(pb, &g);
if (memcmp(&g, &asf_header, sizeof(GUID))) if (memcmp(&g, &ff_asf_header, sizeof(GUID)))
return -1; return -1;
get_le64(pb); get_le64(pb);
get_le32(pb); get_le32(pb);
@ -187,7 +187,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
dprintf(s, "%08"PRIx64": ", url_ftell(pb) - 24); dprintf(s, "%08"PRIx64": ", url_ftell(pb) - 24);
print_guid(&g); print_guid(&g);
dprintf(s, " size=0x%"PRIx64"\n", gsize); dprintf(s, " size=0x%"PRIx64"\n", gsize);
if (!memcmp(&g, &data_header, sizeof(GUID))) { if (!memcmp(&g, &ff_asf_data_header, sizeof(GUID))) {
asf->data_object_offset = url_ftell(pb); asf->data_object_offset = url_ftell(pb);
// if not streaming, gsize is not unlimited (how?), and there is enough space in the file.. // if not streaming, gsize is not unlimited (how?), and there is enough space in the file..
if (!(asf->hdr.flags & 0x01) && gsize >= 100) { if (!(asf->hdr.flags & 0x01) && gsize >= 100) {
@ -199,7 +199,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
} }
if (gsize < 24) if (gsize < 24)
return -1; return -1;
if (!memcmp(&g, &file_header, sizeof(GUID))) { if (!memcmp(&g, &ff_asf_file_header, sizeof(GUID))) {
get_guid(pb, &asf->hdr.guid); get_guid(pb, &asf->hdr.guid);
asf->hdr.file_size = get_le64(pb); asf->hdr.file_size = get_le64(pb);
asf->hdr.create_time = get_le64(pb); asf->hdr.create_time = get_le64(pb);
@ -213,7 +213,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
asf->hdr.max_pktsize = get_le32(pb); asf->hdr.max_pktsize = get_le32(pb);
asf->hdr.max_bitrate = get_le32(pb); asf->hdr.max_bitrate = get_le32(pb);
asf->packet_size = asf->hdr.max_pktsize; asf->packet_size = asf->hdr.max_pktsize;
} else if (!memcmp(&g, &stream_header, sizeof(GUID))) { } else if (!memcmp(&g, &ff_asf_stream_header, sizeof(GUID))) {
enum CodecType type; enum CodecType type;
int type_specific_size, sizeX; int type_specific_size, sizeX;
uint64_t total_size; uint64_t total_size;
@ -240,13 +240,13 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
get_guid(pb, &g); get_guid(pb, &g);
test_for_ext_stream_audio = 0; test_for_ext_stream_audio = 0;
if (!memcmp(&g, &audio_stream, sizeof(GUID))) { if (!memcmp(&g, &ff_asf_audio_stream, sizeof(GUID))) {
type = CODEC_TYPE_AUDIO; type = CODEC_TYPE_AUDIO;
} else if (!memcmp(&g, &video_stream, sizeof(GUID))) { } else if (!memcmp(&g, &ff_asf_video_stream, sizeof(GUID))) {
type = CODEC_TYPE_VIDEO; type = CODEC_TYPE_VIDEO;
} else if (!memcmp(&g, &command_stream, sizeof(GUID))) { } else if (!memcmp(&g, &ff_asf_command_stream, sizeof(GUID))) {
type = CODEC_TYPE_DATA; type = CODEC_TYPE_DATA;
} else if (!memcmp(&g, &ext_stream_embed_stream_header, sizeof(GUID))) { } else if (!memcmp(&g, &ff_asf_ext_stream_embed_stream_header, sizeof(GUID))) {
test_for_ext_stream_audio = 1; test_for_ext_stream_audio = 1;
type = CODEC_TYPE_UNKNOWN; type = CODEC_TYPE_UNKNOWN;
} else { } else {
@ -264,7 +264,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
if (test_for_ext_stream_audio) { if (test_for_ext_stream_audio) {
get_guid(pb, &g); get_guid(pb, &g);
if (!memcmp(&g, &ext_stream_audio_stream, sizeof(GUID))) { if (!memcmp(&g, &ff_asf_ext_stream_audio_stream, sizeof(GUID))) {
type = CODEC_TYPE_AUDIO; type = CODEC_TYPE_AUDIO;
is_dvr_ms_audio=1; is_dvr_ms_audio=1;
get_guid(pb, &g); get_guid(pb, &g);
@ -370,7 +370,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
} }
pos2 = url_ftell(pb); pos2 = url_ftell(pb);
url_fskip(pb, gsize - (pos2 - pos1 + 24)); url_fskip(pb, gsize - (pos2 - pos1 + 24));
} else if (!memcmp(&g, &comment_header, sizeof(GUID))) { } else if (!memcmp(&g, &ff_asf_comment_header, sizeof(GUID))) {
int len1, len2, len3, len4, len5; int len1, len2, len3, len4, len5;
len1 = get_le16(pb); len1 = get_le16(pb);
@ -398,7 +398,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
// av_log(s, AV_LOG_ERROR, "flags: 0x%x stream id %d, bitrate %d\n", flags, stream_id, bitrate); // av_log(s, AV_LOG_ERROR, "flags: 0x%x stream id %d, bitrate %d\n", flags, stream_id, bitrate);
asf->stream_bitrates[stream_id]= bitrate; asf->stream_bitrates[stream_id]= bitrate;
} }
} else if (!memcmp(&g, &extended_content_header, sizeof(GUID))) { } else if (!memcmp(&g, &ff_asf_extended_content_header, sizeof(GUID))) {
int desc_count, i; int desc_count, i;
desc_count = get_le16(pb); desc_count = get_le16(pb);
@ -413,7 +413,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
value_len = get_le16(pb); value_len = get_le16(pb);
get_tag(s, name, value_type, value_len); get_tag(s, name, value_type, value_len);
} }
} else if (!memcmp(&g, &metadata_header, sizeof(GUID))) { } else if (!memcmp(&g, &ff_asf_metadata_header, sizeof(GUID))) {
int n, stream_num, name_len, value_len, value_type, value_num; int n, stream_num, name_len, value_len, value_type, value_num;
n = get_le16(pb); n = get_le16(pb);
@ -436,7 +436,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
else if(!strcmp(name, "AspectRatioY")) dar[stream_num].den= value_num; else if(!strcmp(name, "AspectRatioY")) dar[stream_num].den= value_num;
} }
} }
} else if (!memcmp(&g, &ext_stream_header, sizeof(GUID))) { } else if (!memcmp(&g, &ff_asf_ext_stream_header, sizeof(GUID))) {
int ext_len, payload_ext_ct, stream_ct; int ext_len, payload_ext_ct, stream_ct;
uint32_t ext_d, leak_rate, stream_num; uint32_t ext_d, leak_rate, stream_num;
int64_t pos_ex_st; int64_t pos_ex_st;
@ -476,13 +476,13 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
// there could be a optional stream properties object to follow // there could be a optional stream properties object to follow
// if so the next iteration will pick it up // if so the next iteration will pick it up
} else if (!memcmp(&g, &head1_guid, sizeof(GUID))) { } else if (!memcmp(&g, &ff_asf_head1_guid, sizeof(GUID))) {
int v1, v2; int v1, v2;
get_guid(pb, &g); get_guid(pb, &g);
v1 = get_le32(pb); v1 = get_le32(pb);
v2 = get_le16(pb); v2 = get_le16(pb);
#if 0 #if 0
} else if (!memcmp(&g, &codec_comment_header, sizeof(GUID))) { } else if (!memcmp(&g, &ff_asf_codec_comment_header, sizeof(GUID))) {
int len, v1, n, num; int len, v1, n, num;
char str[256], *q; char str[256], *q;
char tag[16]; char tag[16];

@ -303,7 +303,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
put_chunk(s, 0x4824, 0, 0xc00); /* start of stream (length will be patched later) */ put_chunk(s, 0x4824, 0, 0xc00); /* start of stream (length will be patched later) */
} }
put_guid(pb, &asf_header); put_guid(pb, &ff_asf_header);
put_le64(pb, -1); /* header length, will be patched after */ put_le64(pb, -1); /* header length, will be patched after */
put_le32(pb, 3 + has_title + !!metadata_count + s->nb_streams); /* number of chunks in header */ put_le32(pb, 3 + has_title + !!metadata_count + s->nb_streams); /* number of chunks in header */
put_byte(pb, 1); /* ??? */ put_byte(pb, 1); /* ??? */
@ -311,8 +311,8 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
/* file header */ /* file header */
header_offset = url_ftell(pb); header_offset = url_ftell(pb);
hpos = put_header(pb, &file_header); hpos = put_header(pb, &ff_asf_file_header);
put_guid(pb, &my_guid); put_guid(pb, &ff_asf_my_guid);
put_le64(pb, file_size); put_le64(pb, file_size);
file_time = 0; file_time = 0;
put_le64(pb, unix_to_file_time(file_time)); put_le64(pb, unix_to_file_time(file_time));
@ -327,15 +327,15 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
end_header(pb, hpos); end_header(pb, hpos);
/* unknown headers */ /* unknown headers */
hpos = put_header(pb, &head1_guid); hpos = put_header(pb, &ff_asf_head1_guid);
put_guid(pb, &head2_guid); put_guid(pb, &ff_asf_head2_guid);
put_le32(pb, 6); put_le32(pb, 6);
put_le16(pb, 0); put_le16(pb, 0);
end_header(pb, hpos); end_header(pb, hpos);
/* title and other infos */ /* title and other infos */
if (has_title) { if (has_title) {
hpos = put_header(pb, &comment_header); hpos = put_header(pb, &ff_asf_comment_header);
put_le16(pb, title ? 2 * (strlen(title->value ) + 1) : 0); put_le16(pb, title ? 2 * (strlen(title->value ) + 1) : 0);
put_le16(pb, author ? 2 * (strlen(author->value ) + 1) : 0); put_le16(pb, author ? 2 * (strlen(author->value ) + 1) : 0);
put_le16(pb, copyright ? 2 * (strlen(copyright->value) + 1) : 0); put_le16(pb, copyright ? 2 * (strlen(copyright->value) + 1) : 0);
@ -349,7 +349,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
} }
if (metadata_count) { if (metadata_count) {
AVMetadataTag *tag = NULL; AVMetadataTag *tag = NULL;
hpos = put_header(pb, &extended_content_header); hpos = put_header(pb, &ff_asf_extended_content_header);
put_le16(pb, metadata_count); put_le16(pb, metadata_count);
while ((tag = av_metadata_get(s->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX))) { while ((tag = av_metadata_get(s->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX))) {
put_le16(pb, 2*(strlen(tag->key) + 3) + 1); put_le16(pb, 2*(strlen(tag->key) + 3) + 1);
@ -388,13 +388,13 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
break; break;
} }
hpos = put_header(pb, &stream_header); hpos = put_header(pb, &ff_asf_stream_header);
if (enc->codec_type == CODEC_TYPE_AUDIO) { if (enc->codec_type == CODEC_TYPE_AUDIO) {
put_guid(pb, &audio_stream); put_guid(pb, &ff_asf_audio_stream);
put_guid(pb, &audio_conceal_spread); put_guid(pb, &ff_asf_audio_conceal_spread);
} else { } else {
put_guid(pb, &video_stream); put_guid(pb, &ff_asf_video_stream);
put_guid(pb, &video_conceal_none); put_guid(pb, &ff_asf_video_conceal_none);
} }
put_le64(pb, 0); /* ??? */ put_le64(pb, 0); /* ??? */
es_pos = url_ftell(pb); es_pos = url_ftell(pb);
@ -444,8 +444,8 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
/* media comments */ /* media comments */
hpos = put_header(pb, &codec_comment_header); hpos = put_header(pb, &ff_asf_codec_comment_header);
put_guid(pb, &codec_comment1_header); put_guid(pb, &ff_asf_codec_comment1_header);
put_le32(pb, s->nb_streams); put_le32(pb, s->nb_streams);
for(n=0;n<s->nb_streams;n++) { for(n=0;n<s->nb_streams;n++) {
AVCodec *p; AVCodec *p;
@ -501,9 +501,9 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
/* movie chunk, followed by packets of packet_size */ /* movie chunk, followed by packets of packet_size */
asf->data_offset = cur_pos; asf->data_offset = cur_pos;
put_guid(pb, &data_header); put_guid(pb, &ff_asf_data_header);
put_le64(pb, data_chunk_size); put_le64(pb, data_chunk_size);
put_guid(pb, &my_guid); put_guid(pb, &ff_asf_my_guid);
put_le64(pb, asf->nb_packets); /* nb packets */ put_le64(pb, asf->nb_packets); /* nb packets */
put_byte(pb, 1); /* ??? */ put_byte(pb, 1); /* ??? */
put_byte(pb, 1); /* ??? */ put_byte(pb, 1); /* ??? */
@ -793,9 +793,9 @@ static int asf_write_index(AVFormatContext *s, ASFIndex *index, uint16_t max, ui
ByteIOContext *pb = s->pb; ByteIOContext *pb = s->pb;
int i; int i;
put_guid(pb, &simple_index_header); put_guid(pb, &ff_asf_simple_index_header);
put_le64(pb, 24 + 16 + 8 + 4 + 4 + (4 + 2)*count); put_le64(pb, 24 + 16 + 8 + 4 + 4 + (4 + 2)*count);
put_guid(pb, &my_guid); put_guid(pb, &ff_asf_my_guid);
put_le64(pb, ASF_INDEXED_INTERVAL); put_le64(pb, ASF_INDEXED_INTERVAL);
put_le32(pb, max); put_le32(pb, max);
put_le32(pb, count); put_le32(pb, count);

Loading…
Cancel
Save