Mercurial > libavformat.hg
comparison yuv4mpeg.c @ 739:db0a5e0f4db5 libavformat
Adds read probe to y4m, and changes the extension to .y4m patch by (Roine Gustafsson <roine users sourceforge net)
author | michael |
---|---|
date | Tue, 26 Apr 2005 09:06:39 +0000 |
parents | dad78387544a |
children | af4e24d6310c |
comparison
equal
deleted
inserted
replaced
738:dad78387544a | 739:db0a5e0f4db5 |
---|---|
168 | 168 |
169 AVOutputFormat yuv4mpegpipe_oformat = { | 169 AVOutputFormat yuv4mpegpipe_oformat = { |
170 "yuv4mpegpipe", | 170 "yuv4mpegpipe", |
171 "YUV4MPEG pipe format", | 171 "YUV4MPEG pipe format", |
172 "", | 172 "", |
173 "yuv4mpeg", | 173 "y4m", |
174 sizeof(int), | 174 sizeof(int), |
175 CODEC_ID_NONE, | 175 CODEC_ID_NONE, |
176 CODEC_ID_RAWVIDEO, | 176 CODEC_ID_RAWVIDEO, |
177 yuv4_write_header, | 177 yuv4_write_header, |
178 yuv4_write_packet, | 178 yuv4_write_packet, |
373 static int yuv4_read_close(AVFormatContext *s) | 373 static int yuv4_read_close(AVFormatContext *s) |
374 { | 374 { |
375 return 0; | 375 return 0; |
376 } | 376 } |
377 | 377 |
378 static int yuv4_probe(AVProbeData *pd) | |
379 { | |
380 /* check file header */ | |
381 if (pd->buf_size <= sizeof(Y4M_MAGIC)) | |
382 return 0; | |
383 if (strncmp(pd->buf, Y4M_MAGIC, sizeof(Y4M_MAGIC)-1)==0) | |
384 return AVPROBE_SCORE_MAX; | |
385 else | |
386 return 0; | |
387 } | |
388 | |
378 AVInputFormat yuv4mpegpipe_iformat = { | 389 AVInputFormat yuv4mpegpipe_iformat = { |
379 "yuv4mpegpipe", | 390 "yuv4mpegpipe", |
380 "YUV4MPEG pipe format", | 391 "YUV4MPEG pipe format", |
381 0, | 392 0, |
382 NULL, | 393 yuv4_probe, |
383 yuv4_read_header, | 394 yuv4_read_header, |
384 yuv4_read_packet, | 395 yuv4_read_packet, |
385 yuv4_read_close, | 396 yuv4_read_close, |
386 .extensions = "yuv4mpeg" | 397 .extensions = "y4m" |
387 }; | 398 }; |
388 | 399 |
389 int yuv4mpeg_init(void) | 400 int yuv4mpeg_init(void) |
390 { | 401 { |
391 av_register_input_format(&yuv4mpegpipe_iformat); | 402 av_register_input_format(&yuv4mpegpipe_iformat); |