summaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-26 03:35:54 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-12-26 04:10:47 +0100
commit484e59a0a0329c4005ddacd05051925345f4362f (patch)
treee5521f4eb5095df300545bb30694d1e3427115c9 /libavfilter
parentc48f67f06ec3b887626b5938987d2a46bd52cf77 (diff)
parent80dc7c0160fb27e46fc0caae8af10b3d63730c7c (diff)
downloadffmpeg-streaming-484e59a0a0329c4005ddacd05051925345f4362f.zip
ffmpeg-streaming-484e59a0a0329c4005ddacd05051925345f4362f.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: avs: call release_buffer() at the end. Add minor bumps and APIchanges entries for lavc/lavfi changes. mpegvideo.c: K&R formatting and cosmetics. avconv: avoid memcpy in vsrc_buffer when possible. avconv: implement get_buffer()/release_buffer(). lavfi: add a new function av_buffersrc_buffer(). lavfi: add avfilter_copy_frame_props() lavc: add format field to AVFrame lavc: add width and height fields to AVFrame lavc: add a sample_aspect_ratio field to AVFrame doxy: add website-alike style to the html output FAQ: add an entry for common error when using -profile Conflicts: avconv.c cmdutils.c doc/APIchanges libavcodec/avcodec.h libavcodec/mpegvideo.c libavcodec/utils.c libavcodec/version.h libavfilter/Makefile libavfilter/avfilter.c libavfilter/avfilter.h libavfilter/src_movie.c libavfilter/vsrc_buffer.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/avcodec.c4
-rw-r--r--libavfilter/avcodec.h2
-rw-r--r--libavfilter/avfilter.h11
-rw-r--r--libavfilter/buffersrc.h38
-rw-r--r--libavfilter/src_movie.c1
-rw-r--r--libavfilter/vsrc_buffer.c18
6 files changed, 71 insertions, 3 deletions
diff --git a/libavfilter/avcodec.c b/libavfilter/avcodec.c
index 2010040..2850c4d 100644
--- a/libavfilter/avcodec.c
+++ b/libavfilter/avcodec.c
@@ -23,7 +23,7 @@
#include "avcodec.h"
-void avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src)
+int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src)
{
dst->pts = src->pts;
dst->pos = src->pkt_pos;
@@ -39,6 +39,8 @@ void avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src)
dst->video->key_frame = src->key_frame;
dst->video->pict_type = src->pict_type;
}
+
+ return 0;
}
AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame,
diff --git a/libavfilter/avcodec.h b/libavfilter/avcodec.h
index dec5ae4..22dd1a2 100644
--- a/libavfilter/avcodec.h
+++ b/libavfilter/avcodec.h
@@ -36,7 +36,7 @@
* Copy the frame properties of src to dst, without copying the actual
* image data.
*/
-void avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src);
+int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src);
/**
* Create and return a picref reference from the data and properties
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index de777b1..77d10cd 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -27,9 +27,10 @@
#include "libavutil/samplefmt.h"
#include "libavutil/pixfmt.h"
#include "libavutil/rational.h"
+#include "libavcodec/avcodec.h"
#define LIBAVFILTER_VERSION_MAJOR 2
-#define LIBAVFILTER_VERSION_MINOR 53
+#define LIBAVFILTER_VERSION_MINOR 54
#define LIBAVFILTER_VERSION_MICRO 100
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
@@ -953,4 +954,12 @@ static inline void avfilter_insert_outpad(AVFilterContext *f, unsigned index,
&f->output_pads, &f->outputs, p);
}
+/**
+ * Copy the frame properties of src to dst, without copying the actual
+ * image data.
+ *
+ * @return 0 on success, a negative number on error.
+ */
+int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src);
+
#endif /* AVFILTER_AVFILTER_H */
diff --git a/libavfilter/buffersrc.h b/libavfilter/buffersrc.h
new file mode 100644
index 0000000..bd82c06
--- /dev/null
+++ b/libavfilter/buffersrc.h
@@ -0,0 +1,38 @@
+/*
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVFILTER_BUFFERSRC_H
+#define AVFILTER_BUFFERSRC_H
+
+/**
+ * @file
+ * Memory buffer source API.
+ */
+
+#include "avfilter.h"
+
+/**
+ * Add a buffer to the filtergraph s.
+ *
+ * @param buf buffer containing frame data to be passed down the filtergraph.
+ * This function will take ownership of buf, the user must not free it.
+ */
+int av_buffersrc_buffer(AVFilterContext *s, AVFilterBufferRef *buf);
+
+#endif /* AVFILTER_BUFFERSRC_H */
diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c
index 840000f..a0b427d 100644
--- a/libavfilter/src_movie.c
+++ b/libavfilter/src_movie.c
@@ -264,6 +264,7 @@ static int movie_get_frame(AVFilterLink *outlink)
/* use pkt_dts if pkt_pts is not available */
movie->picref->pts = movie->frame->pkt_pts == AV_NOPTS_VALUE ?
movie->frame->pkt_dts : movie->frame->pkt_pts;
+
if (!movie->frame->sample_aspect_ratio.num)
movie->picref->video->sample_aspect_ratio = st->sample_aspect_ratio;
av_dlog(outlink->src,
diff --git a/libavfilter/vsrc_buffer.c b/libavfilter/vsrc_buffer.c
index 3c0936a..6f44368 100644
--- a/libavfilter/vsrc_buffer.c
+++ b/libavfilter/vsrc_buffer.c
@@ -26,6 +26,7 @@
#include "avfilter.h"
#include "internal.h"
#include "avcodec.h"
+#include "buffersrc.h"
#include "vsrc_buffer.h"
#include "libavutil/imgutils.h"
@@ -112,6 +113,23 @@ int av_vsrc_buffer_add_video_buffer_ref(AVFilterContext *buffer_filter,
return 0;
}
+int av_buffersrc_buffer(AVFilterContext *s, AVFilterBufferRef *buf)
+{
+ BufferSourceContext *c = s->priv;
+
+ if (c->picref) {
+ av_log(s, AV_LOG_ERROR,
+ "Buffering several frames is not supported. "
+ "Please consume all available frames before adding a new one.\n"
+ );
+ return AVERROR(EINVAL);
+ }
+
+ c->picref = buf;
+
+ return 0;
+}
+
#if CONFIG_AVCODEC
#include "avcodec.h"
OpenPOWER on IntegriCloud