diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-05-29 02:55:19 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-05-29 03:34:35 +0200 |
commit | b8a43bc1b50f409414493a05f6c4b7895ca4ddf9 (patch) | |
tree | 95dda1b7289aac9bdb1f457417baf9515aa4383a /libavformat | |
parent | 39d607e5bbc25ad9629683702b510e865434ef21 (diff) | |
parent | 90da52f01f8b6c22af22a002eb226989b1cf7ef8 (diff) | |
download | ffmpeg-b8a43bc1b50f409414493a05f6c4b7895ca4ddf9.tar.gz |
Merge remote-tracking branch 'qatar/master' into master
* qatar/master: (27 commits)
ac3enc: fix LOCAL_ALIGNED usage in count_mantissa_bits()
ac3dsp: do not use the ff_* prefix when referencing ff_ac3_bap_bits.
ac3dsp: fix loop condition in ac3_update_bap_counts_c()
ARM: unbreak build
ac3enc: modify mantissa bit counting to keep bap counts for all values of bap instead of just 0 to 4.
ac3enc: split mantissa bit counting into a separate function.
ac3enc: store per-block/channel bap pointers by reference block in a 2D array rather than in the AC3Block struct.
get_bits: add av_unused tag to cache variable
sws: replace all long with int.
ARM: aacdec: fix constraints on inline asm
ARM: remove unnecessary volatile from inline asm
ARM: add "cc" clobbers to inline asm where needed
ARM: improve FASTDIV asm
ac3enc: use LOCAL_ALIGNED macro
APIchanges: fill in git hash for av_get_pix_fmt_name (0420bd7).
lavu: add av_get_pix_fmt_name() convenience function
cmdutils: remove OPT_FUNC2
swscale: fix crash in bilinear scaling.
vpxenc: add VP8E_SET_STATIC_THRESHOLD mapping
webm: support stereo videos in matroska/webm muxer
...
Conflicts:
Changelog
cmdutils.c
cmdutils.h
doc/APIchanges
doc/muxers.texi
ffmpeg.c
ffplay.c
libavcodec/ac3enc.c
libavcodec/ac3enc_float.c
libavcodec/avcodec.h
libavcodec/get_bits.h
libavcodec/libvpxenc.c
libavcodec/version.h
libavdevice/libdc1394.c
libavformat/matroskaenc.c
libavutil/avutil.h
libswscale/rgb2rgb.c
libswscale/swscale.c
libswscale/swscale_template.c
libswscale/x86/swscale_template.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/avformat.h | 4 | ||||
-rw-r--r-- | libavformat/matroska.h | 18 | ||||
-rw-r--r-- | libavformat/rawdec.c | 29 | ||||
-rw-r--r-- | libavformat/rawdec.h | 1 |
4 files changed, 39 insertions, 13 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 292479e3d6..41830adcac 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -233,9 +233,7 @@ typedef struct AVFormatParameters { attribute_deprecated int channels; attribute_deprecated int width; attribute_deprecated int height; -#endif - enum PixelFormat pix_fmt; -#if FF_API_FORMAT_PARAMETERS + attribute_deprecated enum PixelFormat pix_fmt; attribute_deprecated int channel; /**< Used to select DV channel. */ attribute_deprecated const char *standard; /**< deprecated, use demuxer-specific options instead. */ attribute_deprecated unsigned int mpeg2ts_raw:1; /**< deprecated, use mpegtsraw demuxer */ diff --git a/libavformat/matroska.h b/libavformat/matroska.h index 32b04c5a4b..ab7e3269fa 100644 --- a/libavformat/matroska.h +++ b/libavformat/matroska.h @@ -223,6 +223,24 @@ typedef enum { MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP = 3, } MatroskaTrackEncodingCompAlgo; +typedef enum { + MATROSKA_VIDEO_STEREOMODE_TYPE_MONO = 0, + MATROSKA_VIDEO_STEREOMODE_TYPE_LEFT_RIGHT = 1, + MATROSKA_VIDEO_STEREOMODE_TYPE_BOTTOM_TOP = 2, + MATROSKA_VIDEO_STEREOMODE_TYPE_TOP_BOTTOM = 3, + MATROSKA_VIDEO_STEREOMODE_TYPE_CHECKERBOARD_RL = 4, + MATROSKA_VIDEO_STEREOMODE_TYPE_CHECKERBOARD_LR = 5, + MATROSKA_VIDEO_STEREOMODE_TYPE_ROW_INTERLEAVED_RL = 6, + MATROSKA_VIDEO_STEREOMODE_TYPE_ROW_INTERLEAVED_LR = 7, + MATROSKA_VIDEO_STEREOMODE_TYPE_COL_INTERLEAVED_RL = 8, + MATROSKA_VIDEO_STEREOMODE_TYPE_COL_INTERLEAVED_LR = 9, + MATROSKA_VIDEO_STEREOMODE_TYPE_ANAGLYPH_CYAN_RED = 10, + MATROSKA_VIDEO_STEREOMODE_TYPE_RIGHT_LEFT = 11, + MATROSKA_VIDEO_STEREOMODE_TYPE_ANAGLYPH_GREEN_MAG = 12, + MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_LR = 13, + MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_RL = 14, +} MatroskaVideoStereoModeType; + /* * Matroska Codec IDs, strings */ diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c index a1617f00c4..fa25c6ba0e 100644 --- a/libavformat/rawdec.c +++ b/libavformat/rawdec.c @@ -25,6 +25,7 @@ #include "rawdec.h" #include "libavutil/opt.h" #include "libavutil/parseutils.h" +#include "libavutil/pixdesc.h" /* raw input */ int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap) @@ -70,30 +71,37 @@ int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap) case AVMEDIA_TYPE_VIDEO: { FFRawVideoDemuxerContext *s1 = s->priv_data; int width = 0, height = 0, ret; + enum PixelFormat pix_fmt; + if(ap->time_base.num) av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den); else av_set_pts_info(st, 64, 1, 25); - if (s1->video_size) { - ret = av_parse_video_size(&width, &height, s1->video_size); - av_freep(&s1->video_size); - if (ret < 0) { - av_log(s, AV_LOG_ERROR, "Couldn't parse video size.\n"); - return ret; - } + if (s1->video_size && (ret = av_parse_video_size(&width, &height, s1->video_size)) < 0) { + av_log(s, AV_LOG_ERROR, "Couldn't parse video size.\n"); + goto fail; + } + if ((pix_fmt = av_get_pix_fmt(s1->pixel_format)) == PIX_FMT_NONE) { + av_log(s, AV_LOG_ERROR, "No such pixel format: %s.\n", s1->pixel_format); + ret = AVERROR(EINVAL); + goto fail; } #if FF_API_FORMAT_PARAMETERS if (ap->width > 0) width = ap->width; if (ap->height > 0) height = ap->height; + if (ap->pix_fmt) + pix_fmt = ap->pix_fmt; #endif st->codec->width = width; st->codec->height = height; - st->codec->pix_fmt = ap->pix_fmt; - if(st->codec->pix_fmt == PIX_FMT_NONE) - st->codec->pix_fmt= PIX_FMT_YUV420P; + st->codec->pix_fmt = pix_fmt; break; +fail: + av_freep(&s1->video_size); + av_freep(&s1->pixel_format); + return ret; } default: return -1; @@ -188,6 +196,7 @@ const AVClass ff_rawaudio_demuxer_class = { #define DEC AV_OPT_FLAG_DECODING_PARAM static const AVOption video_options[] = { { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, + { "pixel_format", "", OFFSET(pixel_format), FF_OPT_TYPE_STRING, {.str = "yuv420p"}, 0, 0, DEC }, { NULL }, }; #undef OFFSET diff --git a/libavformat/rawdec.h b/libavformat/rawdec.h index 3eed6e711d..f5d40c063f 100644 --- a/libavformat/rawdec.h +++ b/libavformat/rawdec.h @@ -34,6 +34,7 @@ typedef struct RawAudioDemuxerContext { typedef struct FFRawVideoDemuxerContext { const AVClass *class; /**< Class for private options. */ char *video_size; /**< String describing video size, set by a private option. */ + char *pixel_format; /**< Set by a private option. */ } FFRawVideoDemuxerContext; extern const AVClass ff_rawaudio_demuxer_class; |