[FFmpeg-cvslog] avcodec/v4l2_buffers: split out V4L2Buffer generation into helper method
Aman Gupta
git at videolan.org
Wed Sep 11 05:16:57 EEST 2019
ffmpeg | branch: master | Aman Gupta <aman at tmm1.net> | Mon Aug 26 18:53:05 2019 -0700| [d620b1f9de57573c8fb5b5035578d10c49df91a6] | committer: Aman Gupta
avcodec/v4l2_buffers: split out V4L2Buffer generation into helper method
Signed-off-by: Aman Gupta <aman at tmm1.net>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d620b1f9de57573c8fb5b5035578d10c49df91a6
---
libavcodec/v4l2_buffers.c | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c
index 9eee2f927c..3e6ba6b9d3 100644
--- a/libavcodec/v4l2_buffers.c
+++ b/libavcodec/v4l2_buffers.c
@@ -322,13 +322,7 @@ static int v4l2_buffer_buf_to_swframe(AVFrame *frame, V4L2Buffer *avbuf)
return 0;
}
-/******************************************************************************
- *
- * V4L2Buffer interface
- *
- ******************************************************************************/
-
-int ff_v4l2_buffer_avframe_to_buf(const AVFrame *frame, V4L2Buffer *out)
+static int v4l2_buffer_swframe_to_buf(const AVFrame *frame, V4L2Buffer *out)
{
int i, ret;
struct v4l2_format fmt = out->context->format;
@@ -354,8 +348,6 @@ int ff_v4l2_buffer_avframe_to_buf(const AVFrame *frame, V4L2Buffer *out)
is_planar_format = 1;
}
- v4l2_set_pts(out, frame->pts);
-
if (!is_planar_format) {
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
int planes_nb = 0;
@@ -387,6 +379,19 @@ int ff_v4l2_buffer_avframe_to_buf(const AVFrame *frame, V4L2Buffer *out)
return 0;
}
+/******************************************************************************
+ *
+ * V4L2Buffer interface
+ *
+ ******************************************************************************/
+
+int ff_v4l2_buffer_avframe_to_buf(const AVFrame *frame, V4L2Buffer *out)
+{
+ v4l2_set_pts(out, frame->pts);
+
+ return v4l2_buffer_swframe_to_buf(frame, out);
+}
+
int ff_v4l2_buffer_buf_to_avframe(AVFrame *frame, V4L2Buffer *avbuf)
{
V4L2m2mContext *s = buf_to_m2mctx(avbuf);
More information about the ffmpeg-cvslog
mailing list