[FFmpeg-devel] [PATCH 09/12] asf: rename GUIDs to correspond to the specs
Anton Khirnov
anton
Wed Feb 9 21:55:59 CET 2011
---
libavformat/asf.c | 64 +++++++++++++++---------------
libavformat/asf.h | 67 ++++++++++++++++++-------------
libavformat/asfdec.c | 98 +++++++++++++++++++++-------------------------
libavformat/asfenc.c | 36 ++++++++--------
libavformat/mms.c | 10 ++--
libavformat/rtpdec_asf.c | 4 +-
6 files changed, 141 insertions(+), 138 deletions(-)
diff --git a/libavformat/asf.c b/libavformat/asf.c
index 1f6af18..dcffd71 100644
--- a/libavformat/asf.c
+++ b/libavformat/asf.c
@@ -20,122 +20,122 @@
#include "asf.h"
-
-const ff_asf_guid ff_asf_header = {
+const ff_asf_guid ff_asf_guid_header = {
0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C
};
-const ff_asf_guid ff_asf_file_header = {
+const ff_asf_guid ff_asf_guid_file_properties = {
0xA1, 0xDC, 0xAB, 0x8C, 0x47, 0xA9, 0xCF, 0x11, 0x8E, 0xE4, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65
};
-const ff_asf_guid ff_asf_stream_header = {
+const ff_asf_guid ff_asf_guid_stream_properties = {
0x91, 0x07, 0xDC, 0xB7, 0xB7, 0xA9, 0xCF, 0x11, 0x8E, 0xE6, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65
};
-const ff_asf_guid ff_asf_ext_stream_header = {
+const ff_asf_guid ff_asf_guid_ext_stream_properties = {
0xCB, 0xA5, 0xE6, 0x14, 0x72, 0xC6, 0x32, 0x43, 0x83, 0x99, 0xA9, 0x69, 0x52, 0x06, 0x5B, 0x5A
};
-const ff_asf_guid ff_asf_audio_stream = {
+const ff_asf_guid ff_asf_guid_audio_media = {
0x40, 0x9E, 0x69, 0xF8, 0x4D, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B
};
-const ff_asf_guid ff_asf_audio_conceal_none = {
+const ff_asf_guid ff_asf_guid_no_error_correction = {
// 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 ff_asf_guid ff_asf_audio_conceal_spread = {
+const ff_asf_guid ff_asf_guid_audio_spread = {
0x50, 0xCD, 0xC3, 0xBF, 0x8F, 0x61, 0xCF, 0x11, 0x8B, 0xB2, 0x00, 0xAA, 0x00, 0xB4, 0xE2, 0x20
};
-const ff_asf_guid ff_asf_video_stream = {
+const ff_asf_guid ff_asf_guid_video_media = {
0xC0, 0xEF, 0x19, 0xBC, 0x4D, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B
};
-const ff_asf_guid ff_asf_jfif_media = {
+const ff_asf_guid ff_asf_guid_jfif_media = {
0x00, 0xE1, 0x1B, 0xB6, 0x4E, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B
};
-const ff_asf_guid ff_asf_video_conceal_none = {
- 0x00, 0x57, 0xFB, 0x20, 0x55, 0x5B, 0xCF, 0x11, 0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B
-};
-
-const ff_asf_guid ff_asf_command_stream = {
+const ff_asf_guid ff_asf_guid_command_media = {
0xC0, 0xCF, 0xDA, 0x59, 0xE6, 0x59, 0xD0, 0x11, 0xA3, 0xAC, 0x00, 0xA0, 0xC9, 0x03, 0x48, 0xF6
};
-const ff_asf_guid ff_asf_comment_header = {
+const ff_asf_guid ff_asf_guid_content_description = {
0x33, 0x26, 0xb2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c
};
-const ff_asf_guid ff_asf_codec_comment_header = {
+const ff_asf_guid ff_asf_guid_codec_list = {
0x40, 0x52, 0xD1, 0x86, 0x1D, 0x31, 0xD0, 0x11, 0xA3, 0xA4, 0x00, 0xA0, 0xC9, 0x03, 0x48, 0xF6
};
-const ff_asf_guid ff_asf_codec_comment1_header = {
+const ff_asf_guid ff_asf_guid_reserved_2 = {
0x41, 0x52, 0xd1, 0x86, 0x1D, 0x31, 0xD0, 0x11, 0xa3, 0xa4, 0x00, 0xa0, 0xc9, 0x03, 0x48, 0xf6
};
-const ff_asf_guid ff_asf_data_header = {
+const ff_asf_guid ff_asf_guid_data = {
0x36, 0x26, 0xb2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xa6, 0xd9, 0x00, 0xaa, 0x00, 0x62, 0xce, 0x6c
};
-const ff_asf_guid ff_asf_head1_guid = {
+const ff_asf_guid ff_asf_guid_header_extension = {
0xb5, 0x03, 0xbf, 0x5f, 0x2E, 0xA9, 0xCF, 0x11, 0x8e, 0xe3, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65
};
-const ff_asf_guid ff_asf_head2_guid = {
+const ff_asf_guid ff_asf_guid_reserved_1 = {
0x11, 0xd2, 0xd3, 0xab, 0xBA, 0xA9, 0xCF, 0x11, 0x8e, 0xe6, 0x00, 0xc0, 0x0c, 0x20, 0x53, 0x65
};
-const ff_asf_guid ff_asf_extended_content_header = {
+const ff_asf_guid ff_asf_guid_ext_content_description = {
0x40, 0xA4, 0xD0, 0xD2, 0x07, 0xE3, 0xD2, 0x11, 0x97, 0xF0, 0x00, 0xA0, 0xC9, 0x5E, 0xA8, 0x50
};
-const ff_asf_guid ff_asf_simple_index_header = {
+const ff_asf_guid ff_asf_guid_simple_index = {
0x90, 0x08, 0x00, 0x33, 0xB1, 0xE5, 0xCF, 0x11, 0x89, 0xF4, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xCB
};
-const ff_asf_guid ff_asf_ext_stream_embed_stream_header = {
+const ff_asf_guid ff_asf_guid_binary_media = {
0xe2, 0x65, 0xfb, 0x3a, 0xEF, 0x47, 0xF2, 0x40, 0xac, 0x2c, 0x70, 0xa9, 0x0d, 0x71, 0xd3, 0x43
};
-const ff_asf_guid ff_asf_ext_stream_audio_stream = {
+/* this one is not in the specs */
+const ff_asf_guid ff_asf_guid_binary_media_dvr_ms = {
0x9d, 0x8c, 0x17, 0x31, 0xE1, 0x03, 0x28, 0x45, 0xb5, 0x82, 0x3d, 0xf9, 0xdb, 0x22, 0xf5, 0x03
};
-const ff_asf_guid ff_asf_metadata_header = {
+const ff_asf_guid ff_asf_guid_metadata = {
0xea, 0xcb, 0xf8, 0xc5, 0xaf, 0x5b, 0x77, 0x48, 0x84, 0x67, 0xaa, 0x8c, 0x44, 0xfa, 0x4c, 0xca
};
-const ff_asf_guid ff_asf_marker_header = {
+const ff_asf_guid ff_asf_guid_marker = {
0x01, 0xCD, 0x87, 0xF4, 0x51, 0xA9, 0xCF, 0x11, 0x8E, 0xE6, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65
};
/* I am not a number !!! This GUID is the one found on the PC used to
generate the stream */
-const ff_asf_guid ff_asf_my_guid = {
+const ff_asf_guid ff_asf_guid_my = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
-const ff_asf_guid ff_asf_language_guid = {
+const ff_asf_guid ff_asf_guid_language_list = {
0xa9, 0x46, 0x43, 0x7c, 0xe0, 0xef, 0xfc, 0x4b, 0xb2, 0x29, 0x39, 0x3e, 0xde, 0x41, 0x5c, 0x85
};
-const ff_asf_guid ff_asf_content_encryption = {
+const ff_asf_guid ff_asf_guid_content_encryption = {
0xfb, 0xb3, 0x11, 0x22, 0x23, 0xbd, 0xd2, 0x11, 0xb4, 0xb7, 0x00, 0xa0, 0xc9, 0x55, 0xfc, 0x6e
};
-const ff_asf_guid ff_asf_ext_content_encryption = {
+const ff_asf_guid ff_asf_guid_ext_content_encryption = {
0x14, 0xe6, 0x8a, 0x29, 0x22, 0x26, 0x17, 0x4c, 0xb9, 0x35, 0xda, 0xe0, 0x7e, 0xe9, 0x28, 0x9c
};
-const ff_asf_guid ff_asf_digital_signature = {
+const ff_asf_guid ff_asf_guid_digital_signature = {
0xfc, 0xb3, 0x11, 0x22, 0x23, 0xbd, 0xd2, 0x11, 0xb4, 0xb7, 0x00, 0xa0, 0xc9, 0x55, 0xfc, 0x6e
};
+const ff_asf_guid ff_asf_guid_stream_bitrate_properties = {
+ 0xce, 0x75, 0xf8, 0x7b, 0x8d, 0x46, 0xd1, 0x11, 0x8d, 0x82, 0x00, 0x60, 0x97, 0xc9, 0xa2, 0xb2
+};
+
/* List of official tags at http://msdn.microsoft.com/en-us/library/dd743066(VS.85).aspx */
const AVMetadataConv ff_asf_metadata_conv[] = {
{ "WM/AlbumArtist" , "album_artist"},
diff --git a/libavformat/asf.h b/libavformat/asf.h
index e89bd28..59684fd 100644
--- a/libavformat/asf.h
+++ b/libavformat/asf.h
@@ -79,34 +79,45 @@ typedef struct {
uint16_t packet_count;
} ASFIndex;
-extern const ff_asf_guid ff_asf_header;
-extern const ff_asf_guid ff_asf_file_header;
-extern const ff_asf_guid ff_asf_stream_header;
-extern const ff_asf_guid ff_asf_ext_stream_header;
-extern const ff_asf_guid ff_asf_audio_stream;
-extern const ff_asf_guid ff_asf_audio_conceal_none;
-extern const ff_asf_guid ff_asf_audio_conceal_spread;
-extern const ff_asf_guid ff_asf_video_stream;
-extern const ff_asf_guid ff_asf_jfif_media;
-extern const ff_asf_guid ff_asf_video_conceal_none;
-extern const ff_asf_guid ff_asf_command_stream;
-extern const ff_asf_guid ff_asf_comment_header;
-extern const ff_asf_guid ff_asf_codec_comment_header;
-extern const ff_asf_guid ff_asf_codec_comment1_header;
-extern const ff_asf_guid ff_asf_data_header;
-extern const ff_asf_guid ff_asf_head1_guid;
-extern const ff_asf_guid ff_asf_head2_guid;
-extern const ff_asf_guid ff_asf_extended_content_header;
-extern const ff_asf_guid ff_asf_simple_index_header;
-extern const ff_asf_guid ff_asf_ext_stream_embed_stream_header;
-extern const ff_asf_guid ff_asf_ext_stream_audio_stream;
-extern const ff_asf_guid ff_asf_metadata_header;
-extern const ff_asf_guid ff_asf_marker_header;
-extern const ff_asf_guid ff_asf_my_guid;
-extern const ff_asf_guid ff_asf_language_guid;
-extern const ff_asf_guid ff_asf_content_encryption;
-extern const ff_asf_guid ff_asf_ext_content_encryption;
-extern const ff_asf_guid ff_asf_digital_signature;
+/* top-level GUIDs */
+extern const ff_asf_guid ff_asf_guid_header;
+extern const ff_asf_guid ff_asf_guid_data;
+extern const ff_asf_guid ff_asf_guid_simple_index;
+
+/* header GUIDs */
+extern const ff_asf_guid ff_asf_guid_file_properties;
+extern const ff_asf_guid ff_asf_guid_stream_properties;
+extern const ff_asf_guid ff_asf_guid_header_extension;
+extern const ff_asf_guid ff_asf_guid_codec_list;
+extern const ff_asf_guid ff_asf_guid_marker;
+extern const ff_asf_guid ff_asf_guid_content_description;
+extern const ff_asf_guid ff_asf_guid_ext_content_description;
+extern const ff_asf_guid ff_asf_guid_stream_bitrate_properties;
+extern const ff_asf_guid ff_asf_guid_content_encryption;
+extern const ff_asf_guid ff_asf_guid_ext_content_encryption;
+extern const ff_asf_guid ff_asf_guid_digital_signature;
+
+/* header extension GUIDs */
+extern const ff_asf_guid ff_asf_guid_ext_stream_properties;
+extern const ff_asf_guid ff_asf_guid_language_list;
+extern const ff_asf_guid ff_asf_guid_metadata;
+
+/* stream type GUIDs */
+extern const ff_asf_guid ff_asf_guid_video_media;
+extern const ff_asf_guid ff_asf_guid_audio_media;
+extern const ff_asf_guid ff_asf_guid_jfif_media;
+extern const ff_asf_guid ff_asf_guid_command_media;
+extern const ff_asf_guid ff_asf_guid_binary_media;
+
+/* error correction GUIDs */
+extern const ff_asf_guid ff_asf_guid_no_error_correction;
+extern const ff_asf_guid ff_asf_guid_audio_spread;
+
+/* other GUIDs */
+extern const ff_asf_guid ff_asf_guid_reserved_2;
+extern const ff_asf_guid ff_asf_guid_reserved_1;
+extern const ff_asf_guid ff_asf_guid_binary_media_dvr_ms;
+extern const ff_asf_guid ff_asf_guid_my;
extern const AVMetadataConv ff_asf_metadata_conv[];
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index e877e2d..0b3b338 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -78,13 +78,6 @@ typedef struct {
#define FRAME_HEADER_SIZE 17
// Fix Me! FRAME_HEADER_SIZE may be different.
-static const ff_asf_guid index_guid = {
- 0x90, 0x08, 0x00, 0x33, 0xb1, 0xe5, 0xcf, 0x11, 0x89, 0xf4, 0x00, 0xa0, 0xc9, 0x03, 0x49, 0xcb
-};
-
-static const ff_asf_guid stream_bitrate_guid = { /* (http://get.to/sdp) */
- 0xce, 0x75, 0xf8, 0x7b, 0x8d, 0x46, 0xd1, 0x11, 0x8d, 0x82, 0x00, 0x60, 0x97, 0xc9, 0xa2, 0xb2
-};
/**********************************/
/* decoding */
@@ -96,30 +89,29 @@ if (!ff_guidcmp(g, &cmp)) \
static void print_guid(const ff_asf_guid *g)
{
int i;
- PRINT_IF_GUID(g, ff_asf_header);
- else PRINT_IF_GUID(g, ff_asf_file_header);
- else PRINT_IF_GUID(g, ff_asf_stream_header);
- else PRINT_IF_GUID(g, ff_asf_audio_stream);
- else PRINT_IF_GUID(g, ff_asf_audio_conceal_none);
- else PRINT_IF_GUID(g, ff_asf_video_stream);
- else PRINT_IF_GUID(g, ff_asf_video_conceal_none);
- else PRINT_IF_GUID(g, ff_asf_command_stream);
- else PRINT_IF_GUID(g, ff_asf_comment_header);
- else PRINT_IF_GUID(g, ff_asf_codec_comment_header);
- else PRINT_IF_GUID(g, ff_asf_codec_comment1_header);
- else PRINT_IF_GUID(g, ff_asf_data_header);
- else PRINT_IF_GUID(g, index_guid);
- else PRINT_IF_GUID(g, ff_asf_head1_guid);
- else PRINT_IF_GUID(g, ff_asf_head2_guid);
- else PRINT_IF_GUID(g, ff_asf_my_guid);
- else PRINT_IF_GUID(g, ff_asf_ext_stream_header);
- else PRINT_IF_GUID(g, ff_asf_extended_content_header);
- else PRINT_IF_GUID(g, ff_asf_ext_stream_embed_stream_header);
- else PRINT_IF_GUID(g, ff_asf_ext_stream_audio_stream);
- else PRINT_IF_GUID(g, ff_asf_metadata_header);
- else PRINT_IF_GUID(g, ff_asf_marker_header);
- else PRINT_IF_GUID(g, stream_bitrate_guid);
- else PRINT_IF_GUID(g, ff_asf_language_guid);
+ PRINT_IF_GUID(g, ff_asf_guid_header);
+ else PRINT_IF_GUID(g, ff_asf_guid_file_properties);
+ else PRINT_IF_GUID(g, ff_asf_guid_stream_properties);
+ else PRINT_IF_GUID(g, ff_asf_guid_audio_media);
+ else PRINT_IF_GUID(g, ff_asf_guid_no_error_correction);
+ else PRINT_IF_GUID(g, ff_asf_guid_video_media);
+ else PRINT_IF_GUID(g, ff_asf_guid_command_media);
+ else PRINT_IF_GUID(g, ff_asf_guid_content_description);
+ else PRINT_IF_GUID(g, ff_asf_guid_codec_list);
+ else PRINT_IF_GUID(g, ff_asf_guid_reserved_2);
+ else PRINT_IF_GUID(g, ff_asf_guid_data);
+ else PRINT_IF_GUID(g, ff_asf_guid_simple_index);
+ else PRINT_IF_GUID(g, ff_asf_guid_header_extension);
+ else PRINT_IF_GUID(g, ff_asf_guid_reserved_1);
+ else PRINT_IF_GUID(g, ff_asf_guid_my);
+ else PRINT_IF_GUID(g, ff_asf_guid_ext_stream_properties);
+ else PRINT_IF_GUID(g, ff_asf_guid_ext_content_description);
+ else PRINT_IF_GUID(g, ff_asf_guid_binary_media);
+ else PRINT_IF_GUID(g, ff_asf_guid_binary_media_dvr_ms);
+ else PRINT_IF_GUID(g, ff_asf_guid_metadata);
+ else PRINT_IF_GUID(g, ff_asf_guid_marker);
+ else PRINT_IF_GUID(g, ff_asf_guid_stream_bitrate_properties);
+ else PRINT_IF_GUID(g, ff_asf_guid_language_list);
else
av_dlog(NULL, "(GUID: unknown) ");
for(i=0;i<16;i++)
@@ -140,7 +132,7 @@ void ff_get_guid(ByteIOContext *s, ff_asf_guid *g)
static int asf_probe(AVProbeData *pd)
{
/* check file header */
- if (!ff_guidcmp(pd->buf, &ff_asf_header))
+ if (!ff_guidcmp(pd->buf, &ff_asf_guid_header))
return AVPROBE_SCORE_MAX;
else
return 0;
@@ -245,16 +237,16 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
ff_get_guid(pb, &g);
test_for_ext_stream_audio = 0;
- if (!ff_guidcmp(&g, &ff_asf_audio_stream)) {
+ if (!ff_guidcmp(&g, &ff_asf_guid_audio_media)) {
type = AVMEDIA_TYPE_AUDIO;
- } else if (!ff_guidcmp(&g, &ff_asf_video_stream)) {
+ } else if (!ff_guidcmp(&g, &ff_asf_guid_video_media)) {
type = AVMEDIA_TYPE_VIDEO;
- } else if (!ff_guidcmp(&g, &ff_asf_jfif_media)) {
+ } else if (!ff_guidcmp(&g, &ff_asf_guid_jfif_media)) {
type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = CODEC_ID_MJPEG;
- } else if (!ff_guidcmp(&g, &ff_asf_command_stream)) {
+ } else if (!ff_guidcmp(&g, &ff_asf_guid_command_media)) {
type = AVMEDIA_TYPE_DATA;
- } else if (!ff_guidcmp(&g, &ff_asf_ext_stream_embed_stream_header)) {
+ } else if (!ff_guidcmp(&g, &ff_asf_guid_binary_media)) {
test_for_ext_stream_audio = 1;
type = AVMEDIA_TYPE_UNKNOWN;
} else {
@@ -272,7 +264,7 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
if (test_for_ext_stream_audio) {
ff_get_guid(pb, &g);
- if (!ff_guidcmp(&g, &ff_asf_ext_stream_audio_stream)) {
+ if (!ff_guidcmp(&g, &ff_asf_guid_binary_media_dvr_ms)) {
type = AVMEDIA_TYPE_AUDIO;
is_dvr_ms_audio=1;
ff_get_guid(pb, &g);
@@ -579,7 +571,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
int64_t gsize;
ff_get_guid(pb, &g);
- if (ff_guidcmp(&g, &ff_asf_header))
+ if (ff_guidcmp(&g, &ff_asf_guid_header))
return -1;
get_le64(pb);
get_le32(pb);
@@ -593,7 +585,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
av_dlog(s, "%08"PRIx64": ", gpos);
print_guid(&g);
av_dlog(s, " size=0x%"PRIx64"\n", gsize);
- if (!ff_guidcmp(&g, &ff_asf_data_header)) {
+ if (!ff_guidcmp(&g, &ff_asf_guid_data)) {
asf->data_object_offset = url_ftell(pb);
// if not streaming, gsize is not unlimited (how?), and there is enough space in the file..
if (!(asf->hdr.flags & 0x01) && gsize >= 100) {
@@ -605,41 +597,41 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
}
if (gsize < 24)
return -1;
- if (!ff_guidcmp(&g, &ff_asf_file_header)) {
+ if (!ff_guidcmp(&g, &ff_asf_guid_file_properties)) {
asf_read_file_properties(s, gsize);
- } else if (!ff_guidcmp(&g, &ff_asf_stream_header)) {
+ } else if (!ff_guidcmp(&g, &ff_asf_guid_stream_properties)) {
asf_read_stream_properties(s, gsize);
- } else if (!ff_guidcmp(&g, &ff_asf_comment_header)) {
+ } else if (!ff_guidcmp(&g, &ff_asf_guid_content_description)) {
asf_read_content_desc(s, gsize);
- } else if (!ff_guidcmp(&g, &ff_asf_language_guid)) {
+ } else if (!ff_guidcmp(&g, &ff_asf_guid_language_list)) {
asf_read_language_list(s, gsize);
- } else if (!ff_guidcmp(&g, &ff_asf_extended_content_header)) {
+ } else if (!ff_guidcmp(&g, &ff_asf_guid_ext_content_description)) {
asf_read_ext_content_desc(s, gsize);
- } else if (!ff_guidcmp(&g, &ff_asf_metadata_header)) {
+ } else if (!ff_guidcmp(&g, &ff_asf_guid_metadata)) {
asf_read_metadata(s, gsize);
- } else if (!ff_guidcmp(&g, &ff_asf_ext_stream_header)) {
+ } else if (!ff_guidcmp(&g, &ff_asf_guid_ext_stream_properties)) {
asf_read_ext_stream_properties(s, gsize);
// there could be a optional stream properties object to follow
// if so the next iteration will pick it up
continue;
- } else if (!ff_guidcmp(&g, &ff_asf_head1_guid)) {
+ } else if (!ff_guidcmp(&g, &ff_asf_guid_header_extension)) {
int v1, v2;
ff_get_guid(pb, &g);
v1 = get_le32(pb);
v2 = get_le16(pb);
continue;
- } else if (!ff_guidcmp(&g, &ff_asf_marker_header)) {
+ } else if (!ff_guidcmp(&g, &ff_asf_guid_marker)) {
asf_read_marker(s, gsize);
} else if (url_feof(pb)) {
return -1;
} else {
if (!s->keylen) {
- if (!ff_guidcmp(&g, &ff_asf_content_encryption)) {
+ if (!ff_guidcmp(&g, &ff_asf_guid_content_encryption)) {
av_log(s, AV_LOG_WARNING, "DRM protected stream detected, decoding will likely fail!\n");
- } else if (!ff_guidcmp(&g, &ff_asf_ext_content_encryption)) {
+ } else if (!ff_guidcmp(&g, &ff_asf_guid_ext_content_encryption)) {
av_log(s, AV_LOG_WARNING, "Ext DRM protected stream detected, decoding will likely fail!\n");
- } else if (!ff_guidcmp(&g, &ff_asf_digital_signature)) {
+ } else if (!ff_guidcmp(&g, &ff_asf_guid_digital_signature)) {
av_log(s, AV_LOG_WARNING, "Digital signature detected, decoding will likely fail!\n");
}
}
@@ -1164,7 +1156,7 @@ static void asf_build_simple_index(AVFormatContext *s, int stream_index)
/* the data object can be followed by other top-level objects,
skip them until the simple index object is reached */
- while (ff_guidcmp(&g, &index_guid)) {
+ while (ff_guidcmp(&g, &ff_asf_guid_simple_index)) {
int64_t gsize= get_le64(s->pb);
if (gsize < 24 || url_feof(s->pb)) {
url_fseek(s->pb, current_pos, SEEK_SET);
diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c
index 709080f..9249533 100644
--- a/libavformat/asfenc.c
+++ b/libavformat/asfenc.c
@@ -329,7 +329,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_guid(pb, &ff_asf_header);
+ put_guid(pb, &ff_asf_guid_header);
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_byte(pb, 1); /* ??? */
@@ -337,8 +337,8 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
/* file header */
header_offset = url_ftell(pb);
- hpos = put_header(pb, &ff_asf_file_header);
- put_guid(pb, &ff_asf_my_guid);
+ hpos = put_header(pb, &ff_asf_guid_file_properties);
+ put_guid(pb, &ff_asf_guid_my);
put_le64(pb, file_size);
file_time = 0;
put_le64(pb, unix_to_file_time(file_time));
@@ -353,8 +353,8 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
end_header(pb, hpos);
/* unknown headers */
- hpos = put_header(pb, &ff_asf_head1_guid);
- put_guid(pb, &ff_asf_head2_guid);
+ hpos = put_header(pb, &ff_asf_guid_header_extension);
+ put_guid(pb, &ff_asf_guid_reserved_1);
put_le32(pb, 6);
put_le16(pb, 0);
end_header(pb, hpos);
@@ -368,7 +368,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
if (url_open_dyn_buf(&dyn_buf) < 0)
return AVERROR(ENOMEM);
- hpos = put_header(pb, &ff_asf_comment_header);
+ hpos = put_header(pb, &ff_asf_guid_content_description);
for (n = 0; n < FF_ARRAY_ELEMS(tags); n++) {
len = tags[n] ? avio_put_str16le(dyn_buf, tags[n]->value) : 0;
@@ -381,7 +381,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
}
if (metadata_count) {
AVMetadataTag *tag = NULL;
- hpos = put_header(pb, &ff_asf_extended_content_header);
+ hpos = put_header(pb, &ff_asf_guid_ext_content_description);
put_le16(pb, metadata_count);
while ((tag = av_metadata_get(s->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX))) {
put_str16(pb, tag->key);
@@ -415,13 +415,13 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
break;
}
- hpos = put_header(pb, &ff_asf_stream_header);
+ hpos = put_header(pb, &ff_asf_guid_stream_properties);
if (enc->codec_type == AVMEDIA_TYPE_AUDIO) {
- put_guid(pb, &ff_asf_audio_stream);
- put_guid(pb, &ff_asf_audio_conceal_spread);
+ put_guid(pb, &ff_asf_guid_audio_media);
+ put_guid(pb, &ff_asf_guid_audio_spread);
} else {
- put_guid(pb, &ff_asf_video_stream);
- put_guid(pb, &ff_asf_video_conceal_none);
+ put_guid(pb, &ff_asf_guid_video_media);
+ put_guid(pb, &ff_asf_guid_no_error_correction);
}
put_le64(pb, 0); /* ??? */
es_pos = url_ftell(pb);
@@ -471,8 +471,8 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
/* media comments */
- hpos = put_header(pb, &ff_asf_codec_comment_header);
- put_guid(pb, &ff_asf_codec_comment1_header);
+ hpos = put_header(pb, &ff_asf_guid_codec_list);
+ put_guid(pb, &ff_asf_guid_reserved_2);
put_le32(pb, s->nb_streams);
for(n=0;n<s->nb_streams;n++) {
AVCodec *p;
@@ -543,9 +543,9 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
/* movie chunk, followed by packets of packet_size */
asf->data_offset = cur_pos;
- put_guid(pb, &ff_asf_data_header);
+ put_guid(pb, &ff_asf_guid_data);
put_le64(pb, data_chunk_size);
- put_guid(pb, &ff_asf_my_guid);
+ put_guid(pb, &ff_asf_guid_my);
put_le64(pb, asf->nb_packets); /* nb packets */
put_byte(pb, 1); /* ??? */
put_byte(pb, 1); /* ??? */
@@ -835,9 +835,9 @@ static int asf_write_index(AVFormatContext *s, ASFIndex *index, uint16_t max, ui
ByteIOContext *pb = s->pb;
int i;
- put_guid(pb, &ff_asf_simple_index_header);
+ put_guid(pb, &ff_asf_guid_simple_index);
put_le64(pb, 24 + 16 + 8 + 4 + 4 + (4 + 2)*count);
- put_guid(pb, &ff_asf_my_guid);
+ put_guid(pb, &ff_asf_guid_my);
put_le64(pb, ASF_INDEXED_INTERVAL);
put_le32(pb, max);
put_le32(pb, count);
diff --git a/libavformat/mms.c b/libavformat/mms.c
index d995a43..20502ab 100644
--- a/libavformat/mms.c
+++ b/libavformat/mms.c
@@ -63,7 +63,7 @@ int ff_mms_asf_header_parser(MMSContext *mms)
mms->stream_num = 0;
if (mms->asf_header_size < sizeof(ff_asf_guid) * 2 + 22 ||
- memcmp(p, ff_asf_header, sizeof(ff_asf_guid))) {
+ memcmp(p, ff_asf_guid_header, sizeof(ff_asf_guid))) {
av_log(NULL, AV_LOG_ERROR,
"Corrupt stream (invalid ASF header, size=%d)\n",
mms->asf_header_size);
@@ -75,7 +75,7 @@ int ff_mms_asf_header_parser(MMSContext *mms)
p += sizeof(ff_asf_guid) + 14;
while(end - p >= sizeof(ff_asf_guid) + 8) {
uint64_t chunksize;
- if (!memcmp(p, ff_asf_data_header, sizeof(ff_asf_guid))) {
+ if (!memcmp(p, ff_asf_guid_data, sizeof(ff_asf_guid))) {
chunksize = 50; // see Reference [2] section 5.1
} else {
chunksize = AV_RL64(p + sizeof(ff_asf_guid));
@@ -86,7 +86,7 @@ int ff_mms_asf_header_parser(MMSContext *mms)
chunksize);
return AVERROR_INVALIDDATA;
}
- if (!memcmp(p, ff_asf_file_header, sizeof(ff_asf_guid))) {
+ if (!memcmp(p, ff_asf_guid_file_properties, sizeof(ff_asf_guid))) {
/* read packet size */
if (end - p > sizeof(ff_asf_guid) * 2 + 68) {
mms->asf_packet_len = AV_RL32(p + sizeof(ff_asf_guid) * 2 + 64);
@@ -97,7 +97,7 @@ int ff_mms_asf_header_parser(MMSContext *mms)
return AVERROR_INVALIDDATA;
}
}
- } else if (!memcmp(p, ff_asf_stream_header, sizeof(ff_asf_guid))) {
+ } else if (!memcmp(p, ff_asf_guid_stream_properties, sizeof(ff_asf_guid))) {
flags = AV_RL16(p + sizeof(ff_asf_guid)*3 + 24);
stream_id = flags & 0x7F;
//The second condition is for checking CS_PKT_STREAM_ID_REQUEST packet size,
@@ -115,7 +115,7 @@ int ff_mms_asf_header_parser(MMSContext *mms)
"Corrupt stream (too many A/V streams)\n");
return AVERROR_INVALIDDATA;
}
- } else if (!memcmp(p, ff_asf_head1_guid, sizeof(ff_asf_guid))) {
+ } else if (!memcmp(p, ff_asf_guid_header_extension, sizeof(ff_asf_guid))) {
chunksize = 46; // see references [2] section 3.4. This should be set 46.
}
p += chunksize;
diff --git a/libavformat/rtpdec_asf.c b/libavformat/rtpdec_asf.c
index db09f8f..c96f0ba 100644
--- a/libavformat/rtpdec_asf.c
+++ b/libavformat/rtpdec_asf.c
@@ -45,13 +45,13 @@ static int rtp_asf_fix_header(uint8_t *buf, int len)
uint8_t *p = buf, *end = buf + len;
if (len < sizeof(ff_asf_guid) * 2 + 22 ||
- memcmp(p, ff_asf_header, sizeof(ff_asf_guid))) {
+ memcmp(p, ff_asf_guid_header, sizeof(ff_asf_guid))) {
return -1;
}
p += sizeof(ff_asf_guid) + 14;
do {
uint64_t chunksize = AV_RL64(p + sizeof(ff_asf_guid));
- if (memcmp(p, ff_asf_file_header, sizeof(ff_asf_guid))) {
+ if (memcmp(p, ff_asf_guid_file_properties, sizeof(ff_asf_guid))) {
if (chunksize > end - p)
return -1;
p += chunksize;
--
1.7.2.3
More information about the ffmpeg-devel
mailing list