[FFmpeg-devel] [PATCH 1/2] lavf/swf: rename some tag defines to match the specs.
Clément Bœsch
ubitux at gmail.com
Fri Oct 12 23:21:04 CEST 2012
---
libavformat/swf.h | 10 +++++-----
libavformat/swfdec.c | 8 ++++----
libavformat/swfenc.c | 8 ++++----
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/libavformat/swf.h b/libavformat/swf.h
index 6ecd0da..5bd3cd9 100644
--- a/libavformat/swf.h
+++ b/libavformat/swf.h
@@ -56,10 +56,10 @@ enum {
TAG_DEFINESOUND = 14,
TAG_STARTSOUND = 15,
TAG_DEFINEBUTTONSOUND = 17,
- TAG_STREAMHEAD = 18,
- TAG_STREAMBLOCK = 19,
+ TAG_SOUNDSTREAMHEAD = 18,
+ TAG_SOUNDSTREAMBLOCK = 19,
TAG_DEFINEBITSLOSSLESS = 20,
- TAG_JPEG2 = 21,
+ TAG_DEFINEBITSJPEG2 = 21,
TAG_DEFINESHAPE2 = 22,
TAG_DEFINEBUTTONCXFORM = 23,
TAG_PROTECT = 24,
@@ -73,14 +73,14 @@ enum {
TAG_DEFINEEDITTEXT = 37,
TAG_DEFINESPRITE = 39,
TAG_FRAMELABEL = 43,
- TAG_STREAMHEAD2 = 45,
+ TAG_SOUNDSTREAMHEAD2 = 45,
TAG_DEFINEMORPHSHAPE = 46,
TAG_DEFINEFONT2 = 48,
TAG_EXPORTASSETS = 56,
TAG_IMPORTASSETS = 57,
TAG_ENABLEDEBUGGER = 58,
TAG_DOINITACTION = 59,
- TAG_VIDEOSTREAM = 60,
+ TAG_DEFINEVIDEOSTREAM = 60,
TAG_VIDEOFRAME = 61,
TAG_DEFINEFONTINFO2 = 62,
TAG_ENABLEDEBUGGER2 = 64,
diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c
index e8ab718..48a2156 100644
--- a/libavformat/swfdec.c
+++ b/libavformat/swfdec.c
@@ -152,7 +152,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
tag = get_swf_tag(pb, &len);
if (tag < 0)
return tag;
- if (tag == TAG_VIDEOSTREAM) {
+ if (tag == TAG_DEFINEVIDEOSTREAM) {
int ch_id = avio_rl16(pb);
len -= 2;
@@ -175,7 +175,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
vst->codec->codec_id = ff_codec_get_id(ff_swf_codec_tags, avio_r8(pb));
avpriv_set_pts_info(vst, 16, 256, swf->frame_rate);
len -= 8;
- } else if (tag == TAG_STREAMHEAD || tag == TAG_STREAMHEAD2) {
+ } else if (tag == TAG_SOUNDSTREAMHEAD || tag == TAG_SOUNDSTREAMHEAD2) {
/* streaming found */
int sample_rate_code;
@@ -253,7 +253,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
return pkt->size;
}
}
- } else if (tag == TAG_STREAMBLOCK) {
+ } else if (tag == TAG_SOUNDSTREAMBLOCK) {
for (i = 0; i < s->nb_streams; i++) {
st = s->streams[i];
if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && st->id == -1) {
@@ -270,7 +270,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
return pkt->size;
}
}
- } else if (tag == TAG_JPEG2) {
+ } else if (tag == TAG_DEFINEBITSJPEG2) {
for (i=0; i<s->nb_streams; i++) {
st = s->streams[i];
if (st->codec->codec_id == AV_CODEC_ID_MJPEG && st->id == -2)
diff --git a/libavformat/swfenc.c b/libavformat/swfenc.c
index b55f1a9..fb6b160 100644
--- a/libavformat/swfenc.c
+++ b/libavformat/swfenc.c
@@ -309,7 +309,7 @@ static int swf_write_header(AVFormatContext *s)
int v = 0;
/* start sound */
- put_swf_tag(s, TAG_STREAMHEAD2);
+ put_swf_tag(s, TAG_SOUNDSTREAMHEAD2);
switch(swf->audio_enc->sample_rate) {
case 11025: v |= 1 << 2; break;
case 22050: v |= 2 << 2; break;
@@ -349,7 +349,7 @@ static int swf_write_video(AVFormatContext *s,
enc->codec_id == AV_CODEC_ID_FLV1) {
if (swf->video_frame_number == 0) {
/* create a new video object */
- put_swf_tag(s, TAG_VIDEOSTREAM);
+ put_swf_tag(s, TAG_DEFINEVIDEOSTREAM);
avio_wl16(pb, VIDEO_ID);
swf->vframes_pos = avio_tell(pb);
avio_wl16(pb, 15000); /* hard flash player limit */
@@ -398,7 +398,7 @@ static int swf_write_video(AVFormatContext *s,
put_swf_end_tag(s);
}
- put_swf_tag(s, TAG_JPEG2 | TAG_LONG);
+ put_swf_tag(s, TAG_DEFINEBITSJPEG2 | TAG_LONG);
avio_wl16(pb, BITMAP_ID); /* ID of the image */
@@ -423,7 +423,7 @@ static int swf_write_video(AVFormatContext *s,
/* streaming sound always should be placed just before showframe tags */
if (swf->audio_enc && av_fifo_size(swf->audio_fifo)) {
int frame_size = av_fifo_size(swf->audio_fifo);
- put_swf_tag(s, TAG_STREAMBLOCK | TAG_LONG);
+ put_swf_tag(s, TAG_SOUNDSTREAMBLOCK | TAG_LONG);
avio_wl16(pb, swf->sound_samples);
avio_wl16(pb, 0); // seek samples
av_fifo_generic_read(swf->audio_fifo, pb, frame_size, (void*)avio_write);
--
1.7.12.2
More information about the ffmpeg-devel
mailing list