summaryrefslogtreecommitdiff
path: root/libavformat/yuv4mpeg.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-10-06 12:10:34 +0200
committerAnton Khirnov <anton@khirnov.net>2012-10-08 07:13:26 +0200
commit716d413c13981da15323c7a3821860536eefdbbb (patch)
treeb15ebcded50b8edaa5b9fc8f261774043138e1fa /libavformat/yuv4mpeg.c
parent78071a1420b425dfb787ac739048f523007b8139 (diff)
Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat
Diffstat (limited to 'libavformat/yuv4mpeg.c')
-rw-r--r--libavformat/yuv4mpeg.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c
index 23fb129971..bdae17b93e 100644
--- a/libavformat/yuv4mpeg.c
+++ b/libavformat/yuv4mpeg.c
@@ -57,23 +57,23 @@ static int yuv4_generate_header(AVFormatContext *s, char* buf)
inter = st->codec->coded_frame->top_field_first ? 't' : 'b';
switch (st->codec->pix_fmt) {
- case PIX_FMT_GRAY8:
+ case AV_PIX_FMT_GRAY8:
colorspace = " Cmono";
break;
- case PIX_FMT_YUV411P:
+ case AV_PIX_FMT_YUV411P:
colorspace = " C411 XYSCSS=411";
break;
- case PIX_FMT_YUV420P:
+ case AV_PIX_FMT_YUV420P:
switch (st->codec->chroma_sample_location) {
case AVCHROMA_LOC_TOPLEFT: colorspace = " C420paldv XYSCSS=420PALDV"; break;
case AVCHROMA_LOC_LEFT: colorspace = " C420mpeg2 XYSCSS=420MPEG2"; break;
default: colorspace = " C420jpeg XYSCSS=420JPEG"; break;
}
break;
- case PIX_FMT_YUV422P:
+ case AV_PIX_FMT_YUV422P:
colorspace = " C422 XYSCSS=422";
break;
- case PIX_FMT_YUV444P:
+ case AV_PIX_FMT_YUV444P:
colorspace = " C444 XYSCSS=444";
break;
}
@@ -126,7 +126,7 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt)
ptr += picture->linesize[0];
}
- if (st->codec->pix_fmt != PIX_FMT_GRAY8) {
+ if (st->codec->pix_fmt != AV_PIX_FMT_GRAY8) {
// Adjust for smaller Cb and Cr planes
avcodec_get_chroma_sub_sample(st->codec->pix_fmt, &h_chroma_shift,
&v_chroma_shift);
@@ -155,13 +155,13 @@ static int yuv4_write_header(AVFormatContext *s)
if (s->nb_streams != 1)
return AVERROR(EIO);
- if (s->streams[0]->codec->pix_fmt == PIX_FMT_YUV411P) {
+ if (s->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUV411P) {
av_log(s, AV_LOG_ERROR, "Warning: generating rarely used 4:1:1 YUV "
"stream, some mjpegtools might not work.\n");
- } else if ((s->streams[0]->codec->pix_fmt != PIX_FMT_YUV420P) &&
- (s->streams[0]->codec->pix_fmt != PIX_FMT_YUV422P) &&
- (s->streams[0]->codec->pix_fmt != PIX_FMT_GRAY8) &&
- (s->streams[0]->codec->pix_fmt != PIX_FMT_YUV444P)) {
+ } else if ((s->streams[0]->codec->pix_fmt != AV_PIX_FMT_YUV420P) &&
+ (s->streams[0]->codec->pix_fmt != AV_PIX_FMT_YUV422P) &&
+ (s->streams[0]->codec->pix_fmt != AV_PIX_FMT_GRAY8) &&
+ (s->streams[0]->codec->pix_fmt != AV_PIX_FMT_YUV444P)) {
av_log(s, AV_LOG_ERROR, "ERROR: yuv4mpeg only handles yuv444p, "
"yuv422p, yuv420p, yuv411p and gray pixel formats. "
"Use -pix_fmt to select one.\n");
@@ -199,7 +199,7 @@ static int yuv4_read_header(AVFormatContext *s)
AVIOContext *pb = s->pb;
int width = -1, height = -1, raten = 0,
rated = 0, aspectn = 0, aspectd = 0;
- enum PixelFormat pix_fmt = PIX_FMT_NONE, alt_pix_fmt = PIX_FMT_NONE;
+ enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE, alt_pix_fmt = AV_PIX_FMT_NONE;
enum AVChromaLocation chroma_sample_location = AVCHROMA_LOC_UNSPECIFIED;
AVStream *st;
struct frame_attributes *s1 = s->priv_data;
@@ -236,29 +236,29 @@ static int yuv4_read_header(AVFormatContext *s)
break;
case 'C': // Color space
if (strncmp("420jpeg", tokstart, 7) == 0) {
- pix_fmt = PIX_FMT_YUV420P;
+ pix_fmt = AV_PIX_FMT_YUV420P;
chroma_sample_location = AVCHROMA_LOC_CENTER;
} else if (strncmp("420mpeg2", tokstart, 8) == 0) {
- pix_fmt = PIX_FMT_YUV420P;
+ pix_fmt = AV_PIX_FMT_YUV420P;
chroma_sample_location = AVCHROMA_LOC_LEFT;
} else if (strncmp("420paldv", tokstart, 8) == 0) {
- pix_fmt = PIX_FMT_YUV420P;
+ pix_fmt = AV_PIX_FMT_YUV420P;
chroma_sample_location = AVCHROMA_LOC_TOPLEFT;
} else if (strncmp("420", tokstart, 3) == 0) {
- pix_fmt = PIX_FMT_YUV420P;
+ pix_fmt = AV_PIX_FMT_YUV420P;
chroma_sample_location = AVCHROMA_LOC_CENTER;
} else if (strncmp("411", tokstart, 3) == 0)
- pix_fmt = PIX_FMT_YUV411P;
+ pix_fmt = AV_PIX_FMT_YUV411P;
else if (strncmp("422", tokstart, 3) == 0)
- pix_fmt = PIX_FMT_YUV422P;
+ pix_fmt = AV_PIX_FMT_YUV422P;
else if (strncmp("444alpha", tokstart, 8) == 0 ) {
av_log(s, AV_LOG_ERROR, "Cannot handle 4:4:4:4 "
"YUV4MPEG stream.\n");
return -1;
} else if (strncmp("444", tokstart, 3) == 0)
- pix_fmt = PIX_FMT_YUV444P;
+ pix_fmt = AV_PIX_FMT_YUV444P;
else if (strncmp("mono", tokstart, 4) == 0) {
- pix_fmt = PIX_FMT_GRAY8;
+ pix_fmt = AV_PIX_FMT_GRAY8;
} else {
av_log(s, AV_LOG_ERROR, "YUV4MPEG stream contains an unknown "
"pixel format.\n");
@@ -306,17 +306,17 @@ static int yuv4_read_header(AVFormatContext *s)
// Older nonstandard pixel format representation
tokstart += 6;
if (strncmp("420JPEG", tokstart, 7) == 0)
- alt_pix_fmt = PIX_FMT_YUV420P;
+ alt_pix_fmt = AV_PIX_FMT_YUV420P;
else if (strncmp("420MPEG2", tokstart, 8) == 0)
- alt_pix_fmt = PIX_FMT_YUV420P;
+ alt_pix_fmt = AV_PIX_FMT_YUV420P;
else if (strncmp("420PALDV", tokstart, 8) == 0)
- alt_pix_fmt = PIX_FMT_YUV420P;
+ alt_pix_fmt = AV_PIX_FMT_YUV420P;
else if (strncmp("411", tokstart, 3) == 0)
- alt_pix_fmt = PIX_FMT_YUV411P;
+ alt_pix_fmt = AV_PIX_FMT_YUV411P;
else if (strncmp("422", tokstart, 3) == 0)
- alt_pix_fmt = PIX_FMT_YUV422P;
+ alt_pix_fmt = AV_PIX_FMT_YUV422P;
else if (strncmp("444", tokstart, 3) == 0)
- alt_pix_fmt = PIX_FMT_YUV444P;
+ alt_pix_fmt = AV_PIX_FMT_YUV444P;
}
while (tokstart < header_end && *tokstart != 0x20)
tokstart++;
@@ -329,9 +329,9 @@ static int yuv4_read_header(AVFormatContext *s)
return -1;
}
- if (pix_fmt == PIX_FMT_NONE) {
- if (alt_pix_fmt == PIX_FMT_NONE)
- pix_fmt = PIX_FMT_YUV420P;
+ if (pix_fmt == AV_PIX_FMT_NONE) {
+ if (alt_pix_fmt == AV_PIX_FMT_NONE)
+ pix_fmt = AV_PIX_FMT_YUV420P;
else
pix_fmt = alt_pix_fmt;
}