diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-03-20 11:24:11 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-03-20 11:24:11 +0100 |
commit | 17ebef2fc8094a235c0f30ce247c77659ea86539 (patch) | |
tree | e5e435fe4269c33888e1f55fc09b32e787e3479e | |
parent | db8403d04afc025278f611d43a91429bbfa44026 (diff) | |
parent | 2c328a907978b61949fd20f7c991803174337855 (diff) | |
download | ffmpeg-17ebef2fc8094a235c0f30ce247c77659ea86539.tar.gz |
Merge commit '2c328a907978b61949fd20f7c991803174337855'
* commit '2c328a907978b61949fd20f7c991803174337855':
pixdesc: add a function for counting planes in a pixel format.
avplay: remove the -debug option.
Revert "asfenc: return error on negative timestamp"
Conflicts:
doc/APIchanges
doc/ffplay.texi
ffplay.c
libavutil/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | doc/APIchanges | 3 | ||||
-rw-r--r-- | libavformat/asfenc.c | 8 | ||||
-rw-r--r-- | libavutil/pixdesc.c | 15 | ||||
-rw-r--r-- | libavutil/pixdesc.h | 6 | ||||
-rw-r--r-- | libavutil/version.h | 4 |
5 files changed, 26 insertions, 10 deletions
diff --git a/doc/APIchanges b/doc/APIchanges index 2bde666c35..2c1358fe05 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -144,6 +144,9 @@ API changes, most recent first: 2012-03-26 - a67d9cf - lavfi 2.66.100 Add avfilter_fill_frame_from_{audio_,}buffer_ref() functions. +2013-xx-xx - lavu 52.9.0 - pixdesc.h + Add av_pix_fmt_count_planes() function for counting planes in a pixel format. + 2013-xx-xx - lavfi 3.6.0 Add AVFilterGraph.nb_filters, deprecate AVFilterGraph.filter_count. diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c index 9a8a739d39..f3aec9c845 100644 --- a/libavformat/asfenc.c +++ b/libavformat/asfenc.c @@ -804,14 +804,6 @@ static int asf_write_packet(AVFormatContext *s, AVPacket *pkt) flags &= ~AV_PKT_FLAG_KEY; pts = (pkt->pts != AV_NOPTS_VALUE) ? pkt->pts : pkt->dts; - - if (pts < 0) { - av_log(s, AV_LOG_ERROR, - "Negative dts not supported stream %d, dts %"PRId64"\n", - pkt->stream_index, pts); - return AVERROR(ENOSYS); - } - assert(pts != AV_NOPTS_VALUE); pts *= 10000; asf->duration = FFMAX(asf->duration, pts + pkt->duration * 10000); diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index 1016dbaecb..31363cfb61 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -1791,3 +1791,18 @@ int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, return 0; } + +int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + int i, planes[4] = { 0 }, ret = 0; + + if (!desc) + return AVERROR(EINVAL); + + for (i = 0; i < desc->nb_components; i++) + planes[desc->comp[i].plane] = 1; + for (i = 0; i < FF_ARRAY_ELEMS(planes); i++) + ret += planes[i]; + return ret; +} diff --git a/libavutil/pixdesc.h b/libavutil/pixdesc.h index 1042e1ed45..0947fd1f88 100644 --- a/libavutil/pixdesc.h +++ b/libavutil/pixdesc.h @@ -233,5 +233,11 @@ enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc); int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift); +/** + * @return number of planes in pix_fmt, a negative AVERROR if pix_fmt is not a + * valid pixel format. + */ +int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt); + #endif /* AVUTIL_PIXDESC_H */ diff --git a/libavutil/version.h b/libavutil/version.h index b8f814f587..1ff9ffeb92 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -75,8 +75,8 @@ */ #define LIBAVUTIL_VERSION_MAJOR 52 -#define LIBAVUTIL_VERSION_MINOR 19 -#define LIBAVUTIL_VERSION_MICRO 101 +#define LIBAVUTIL_VERSION_MINOR 20 +#define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ LIBAVUTIL_VERSION_MINOR, \ |