Mercurial > libavformat.hg
changeset 2282:47f5906c30cc libavformat
replaces hardcoded values by the equivalent enum definitions
author | aurel |
---|---|
date | Thu, 26 Jul 2007 13:01:09 +0000 |
parents | ab7f29ef9976 |
children | ab7237c58572 |
files | gxf.c gxf.h gxfenc.c |
diffstat | 3 files changed, 33 insertions(+), 40 deletions(-) [+] |
line wrap: on
line diff
--- a/gxf.c Wed Jul 25 20:39:43 2007 +0000 +++ b/gxf.c Thu Jul 26 13:01:09 2007 +0000 @@ -20,33 +20,7 @@ */ #include "avformat.h" #include "common.h" - -typedef enum { - PKT_MAP = 0xbc, - PKT_MEDIA = 0xbf, - PKT_EOS = 0xfb, - PKT_FLT = 0xfc, - PKT_UMF = 0xfd -} pkt_type_t; - -typedef enum { - MAT_NAME = 0x40, - MAT_FIRST_FIELD = 0x41, - MAT_LAST_FIELD = 0x42, - MAT_MARK_IN = 0x43, - MAT_MARK_OUT = 0x44, - MAT_SIZE = 0x45 -} mat_tag_t; - -typedef enum { - TRACK_NAME = 0x4c, - TRACK_AUX = 0x4d, - TRACK_VER = 0x4e, - TRACK_MPG_AUX = 0x4f, - TRACK_FPS = 0x50, - TRACK_LINES = 0x51, - TRACK_FPF = 0x52 -} track_tag_t; +#include "gxf.h" typedef struct { int64_t first_field;
--- a/gxf.h Wed Jul 25 20:39:43 2007 +0000 +++ b/gxf.h Thu Jul 26 13:01:09 2007 +0000 @@ -31,4 +31,23 @@ PKT_UMF = 0xfd } pkt_type_t; +typedef enum { + MAT_NAME = 0x40, + MAT_FIRST_FIELD = 0x41, + MAT_LAST_FIELD = 0x42, + MAT_MARK_IN = 0x43, + MAT_MARK_OUT = 0x44, + MAT_SIZE = 0x45, +} mat_tag_t; + +typedef enum { + TRACK_NAME = 0x4c, + TRACK_AUX = 0x4d, + TRACK_VER = 0x4e, + TRACK_MPG_AUX = 0x4f, + TRACK_FPS = 0x50, + TRACK_LINES = 0x51, + TRACK_FPF = 0x52, +} track_tag_t; + #endif /* FFMPEG_GXF_H */
--- a/gxfenc.c Wed Jul 25 20:39:43 2007 +0000 +++ b/gxfenc.c Thu Jul 26 13:01:09 2007 +0000 @@ -187,7 +187,7 @@ (float)ctx->codec->bit_rate, ctx->p_per_gop, ctx->b_per_gop, ctx->codec->pix_fmt == PIX_FMT_YUV422P ? 2 : 1, ctx->first_gop_closed == 1, ctx->codec->height / 16); - put_byte(pb, 0x4F); + put_byte(pb, TRACK_MPG_AUX); put_byte(pb, size + 1); put_buffer(pb, (uint8_t *)buffer, size + 1); return size + 3; @@ -217,7 +217,7 @@ put_be16(pb, 0); /* size */ /* media file name */ - put_byte(pb, 0x4C); + put_byte(pb, TRACK_NAME); put_byte(pb, strlen(ES_NAME_PATTERN) + 3); put_tag(pb, ES_NAME_PATTERN); put_be16(pb, stream->media_info); @@ -225,7 +225,7 @@ if (stream->codec->codec_id != CODEC_ID_MPEG2VIDEO) { /* auxiliary information */ - put_byte(pb, 0x4D); + put_byte(pb, TRACK_AUX); put_byte(pb, 8); if (stream->codec->codec_id == CODEC_ID_NONE) gxf_write_timecode_auxiliary(pb, stream); @@ -234,7 +234,7 @@ } /* file system version */ - put_byte(pb, 0x4E); + put_byte(pb, TRACK_VER); put_byte(pb, 4); put_be32(pb, 0); @@ -242,17 +242,17 @@ gxf_write_mpeg_auxiliary(pb, stream); /* frame rate */ - put_byte(pb, 0x50); + put_byte(pb, TRACK_FPS); put_byte(pb, 4); put_be32(pb, stream->frame_rate_index); /* lines per frame */ - put_byte(pb, 0x51); + put_byte(pb, TRACK_LINES); put_byte(pb, 4); put_be32(pb, stream->lines_index); /* fields per frame */ - put_byte(pb, 0x52); + put_byte(pb, TRACK_FPF); put_byte(pb, 4); put_be32(pb, stream->fields); @@ -272,33 +272,33 @@ filename++; else filename = ctx->fc->filename; - put_byte(pb, 0x40); + put_byte(pb, MAT_NAME); put_byte(pb, strlen(SERVER_PATH) + strlen(filename) + 1); put_tag(pb, SERVER_PATH); put_tag(pb, filename); put_byte(pb, 0); /* first field */ - put_byte(pb, 0x41); + put_byte(pb, MAT_FIRST_FIELD); put_byte(pb, 4); put_be32(pb, 0); /* last field */ - put_byte(pb, 0x42); + put_byte(pb, MAT_LAST_FIELD); put_byte(pb, 4); put_be32(pb, ctx->nb_frames); /* reserved */ - put_byte(pb, 0x43); + put_byte(pb, MAT_MARK_IN); put_byte(pb, 4); put_be32(pb, 0); - put_byte(pb, 0x44); + put_byte(pb, MAT_MARK_OUT); put_byte(pb, 4); put_be32(pb, ctx->nb_frames); /* estimated size */ - put_byte(pb, 0x45); + put_byte(pb, MAT_SIZE); put_byte(pb, 4); put_be32(pb, url_fsize(pb) / 1024);