summaryrefslogtreecommitdiff
path: root/recipes-support/opencv/opencv/0005-cap_ffmpeg-use-avcodec_encode_video2-where-available.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-support/opencv/opencv/0005-cap_ffmpeg-use-avcodec_encode_video2-where-available.patch')
-rw-r--r--recipes-support/opencv/opencv/0005-cap_ffmpeg-use-avcodec_encode_video2-where-available.patch80
1 files changed, 0 insertions, 80 deletions
diff --git a/recipes-support/opencv/opencv/0005-cap_ffmpeg-use-avcodec_encode_video2-where-available.patch b/recipes-support/opencv/opencv/0005-cap_ffmpeg-use-avcodec_encode_video2-where-available.patch
deleted file mode 100644
index 71c5001..0000000
--- a/recipes-support/opencv/opencv/0005-cap_ffmpeg-use-avcodec_encode_video2-where-available.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-From aecaa02aba9f1b4e356127b458e464d1feacf599 Mon Sep 17 00:00:00 2001
-From: Anton Khirnov <anton@khirnov.net>
-Date: Thu, 6 Feb 2014 10:08:17 +0100
-Subject: [PATCH 5/5] cap_ffmpeg: use avcodec_encode_video2() where available
-
-avcodec_encode_video() has been deprecated and removed in newer
-libavcodec versions.
-
-(cherry picked from commit 8dbc0ac766f2342bd3004a1459012f65004042a6)
----
- modules/highgui/src/cap_ffmpeg_impl.hpp | 44 +++++++++++++++++++++++----------
- 1 file changed, 31 insertions(+), 13 deletions(-)
-
-diff --git a/modules/highgui/src/cap_ffmpeg_impl.hpp b/modules/highgui/src/cap_ffmpeg_impl.hpp
-index 44ef553..4ac2f84 100644
---- a/modules/highgui/src/cap_ffmpeg_impl.hpp
-+++ b/modules/highgui/src/cap_ffmpeg_impl.hpp
-@@ -1136,7 +1136,6 @@ static const int OPENCV_NO_FRAMES_WRITTEN_CODE = 1000;
- static int icv_av_write_frame_FFMPEG( AVFormatContext * oc, AVStream * video_st, uint8_t * outbuf, uint32_t outbuf_size, AVFrame * picture )
- {
- AVCodecContext * c = video_st->codec;
-- int out_size;
- int ret = 0;
-
- if (oc->oformat->flags & AVFMT_RAWPICTURE) {
-@@ -1156,20 +1155,39 @@ static int icv_av_write_frame_FFMPEG( AVFormatContext * oc, AVStream * video_st,
-
- ret = av_write_frame(oc, &pkt);
- } else {
-+ AVPacket pkt;
-+ int got_output;
-+
-+ av_init_packet(&pkt);
-+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(54, 1, 0)
- /* encode the image */
-- out_size = avcodec_encode_video(c, outbuf, outbuf_size, picture);
-- /* if zero size, it means the image was buffered */
-- if (out_size > 0) {
-- AVPacket pkt;
-- av_init_packet(&pkt);
--
-- if(c->coded_frame->pts != (int64_t)AV_NOPTS_VALUE)
-- pkt.pts = av_rescale_q(c->coded_frame->pts, c->time_base, video_st->time_base);
-- if(c->coded_frame->key_frame)
-- pkt.flags |= PKT_FLAG_KEY;
-+ int out_size = avcodec_encode_video(c, outbuf, outbuf_size, picture);
-+ got_output = out_size > 0;
-+ pkt.data = outbuf;
-+ pkt.size = out_size;
-+ if(c->coded_frame->pts != (int64_t)AV_NOPTS_VALUE)
-+ pkt.pts = c->coded_frame->pts;
-+ pkt.dts = AV_NOPTS_VALUE;
-+ if(c->coded_frame->key_frame)
-+ pkt.flags |= PKT_FLAG_KEY;
-+#else
-+ pkt.data = NULL;
-+ pkt.size = 0;
-+
-+ ret = avcodec_encode_video2(c, &pkt, picture, &got_output);
-+ if (ret < 0)
-+ got_output = 0;
-+#endif
-+
-+ if (got_output) {
-+ if (pkt.pts != (int64_t)AV_NOPTS_VALUE)
-+ pkt.pts = av_rescale_q(pkt.pts, c->time_base, video_st->time_base);
-+ if (pkt.dts != (int64_t)AV_NOPTS_VALUE)
-+ pkt.dts = av_rescale_q(pkt.dts, c->time_base, video_st->time_base);
-+ if (pkt.duration)
-+ pkt.duration = av_rescale_q(pkt.duration, c->time_base, video_st->time_base);
-+
- pkt.stream_index= video_st->index;
-- pkt.data= outbuf;
-- pkt.size= out_size;
-
- /* write the compressed frame in the media file */
- ret = av_write_frame(oc, &pkt);
---
-1.9.3
-