
* added package gptune with all its dependencies: adding py-autotune, pygmo, py-pyaml, py-autotune, py-gpy, py-lhsmdu, py-hpbandster, pagmo2, py-opentuner; modifying superlu-dist, py-scikit-optimize * adding gptune package * minor fix for macos spack test * update patch for py-scikit-optimize; update test files for gptune * fixing gptune package style error * fixing unit tests * a few changes reviewed in the PR * improved gptune package.py with a few newly added/improved dependencies * fixed a few style errors * minor fix on package name py-pyro4 * fixing more style errors * Update var/spack/repos/builtin/packages/py-scikit-optimize/package.py Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com> * resolved a few issues in the PR * fixing file permissions * a few minor changes * style correction * minor correction to jq package file * Update var/spack/repos/builtin/packages/py-pyro4/package.py Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com> * fixing a few issues in the PR * adding py-selectors34 required by py-pyro4 * improved the superlu-dist package * improved the superlu-dist package * moree changes to gptune and py-selectors34 based on the PR * Update var/spack/repos/builtin/packages/py-selectors34/package.py Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com> Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
108 lines
3.4 KiB
Diff
108 lines
3.4 KiB
Diff
commit b1d208891b9f6ae3968730b120a5d0dcbba679d0
|
|
Author: Jonathan Viney <jonathan.viney@gmail.com>
|
|
Date: Sun Nov 19 07:08:41 2017 +1300
|
|
|
|
Merge pull request #10011 from jviney:master
|
|
|
|
Fix build with FFmpeg master. Some deprecated APIs have been removed. (#10011)
|
|
|
|
* Fix build with FFmpeg master.
|
|
|
|
* ffmpeg: update AVFMT_RAWPICTURE support removal
|
|
|
|
diff --git a/modules/videoio/src/cap_ffmpeg_impl.hpp b/modules/videoio/src/cap_ffmpeg_impl.hpp
|
|
index 5f51e65134..46461483a7 100644
|
|
--- a/modules/videoio/src/cap_ffmpeg_impl.hpp
|
|
+++ b/modules/videoio/src/cap_ffmpeg_impl.hpp
|
|
@@ -149,6 +149,10 @@ extern "C" {
|
|
#define AV_PIX_FMT_GRAY16BE PIX_FMT_GRAY16BE
|
|
#endif
|
|
|
|
+#ifndef PKT_FLAG_KEY
|
|
+#define PKT_FLAG_KEY AV_PKT_FLAG_KEY
|
|
+#endif
|
|
+
|
|
#if LIBAVUTIL_BUILD >= (LIBAVUTIL_VERSION_MICRO >= 100 \
|
|
? CALC_FFMPEG_VERSION(52, 38, 100) : CALC_FFMPEG_VERSION(52, 13, 0))
|
|
#define USE_AV_FRAME_GET_BUFFER 1
|
|
@@ -1570,7 +1574,11 @@ static AVStream *icv_add_video_stream_FFMPEG(AVFormatContext *oc,
|
|
// some formats want stream headers to be seperate
|
|
if(oc->oformat->flags & AVFMT_GLOBALHEADER)
|
|
{
|
|
+#if LIBAVCODEC_BUILD > CALC_FFMPEG_VERSION(56, 35, 0)
|
|
+ c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
|
|
+#else
|
|
c->flags |= CODEC_FLAG_GLOBAL_HEADER;
|
|
+#endif
|
|
}
|
|
#endif
|
|
|
|
@@ -1598,23 +1606,24 @@ static int icv_av_write_frame_FFMPEG( AVFormatContext * oc, AVStream * video_st,
|
|
#endif
|
|
int ret = OPENCV_NO_FRAMES_WRITTEN_CODE;
|
|
|
|
- if (oc->oformat->flags & AVFMT_RAWPICTURE) {
|
|
+#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(57, 0, 0)
|
|
+ if (oc->oformat->flags & AVFMT_RAWPICTURE)
|
|
+ {
|
|
/* raw video case. The API will change slightly in the near
|
|
futur for that */
|
|
AVPacket pkt;
|
|
av_init_packet(&pkt);
|
|
|
|
-#ifndef PKT_FLAG_KEY
|
|
-#define PKT_FLAG_KEY AV_PKT_FLAG_KEY
|
|
-#endif
|
|
-
|
|
pkt.flags |= PKT_FLAG_KEY;
|
|
pkt.stream_index= video_st->index;
|
|
pkt.data= (uint8_t *)picture;
|
|
pkt.size= sizeof(AVPicture);
|
|
|
|
ret = av_write_frame(oc, &pkt);
|
|
- } else {
|
|
+ }
|
|
+ else
|
|
+#endif
|
|
+ {
|
|
/* encode the image */
|
|
AVPacket pkt;
|
|
av_init_packet(&pkt);
|
|
@@ -1772,7 +1781,9 @@ void CvVideoWriter_FFMPEG::close()
|
|
/* write the trailer, if any */
|
|
if(ok && oc)
|
|
{
|
|
- if( (oc->oformat->flags & AVFMT_RAWPICTURE) == 0 )
|
|
+#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(57, 0, 0)
|
|
+ if (!(oc->oformat->flags & AVFMT_RAWPICTURE))
|
|
+#endif
|
|
{
|
|
for(;;)
|
|
{
|
|
@@ -2071,7 +2082,11 @@ bool CvVideoWriter_FFMPEG::open( const char * filename, int fourcc,
|
|
|
|
outbuf = NULL;
|
|
|
|
- if (!(oc->oformat->flags & AVFMT_RAWPICTURE)) {
|
|
+
|
|
+#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(57, 0, 0)
|
|
+ if (!(oc->oformat->flags & AVFMT_RAWPICTURE))
|
|
+#endif
|
|
+ {
|
|
/* allocate output buffer */
|
|
/* assume we will never get codec output with more than 4 bytes per pixel... */
|
|
outbuf_size = width*height*4;
|
|
@@ -2376,7 +2391,11 @@ AVStream* OutputMediaStream_FFMPEG::addVideoStream(AVFormatContext *oc, CV_CODEC
|
|
// some formats want stream headers to be seperate
|
|
if (oc->oformat->flags & AVFMT_GLOBALHEADER)
|
|
{
|
|
- c->flags |= CODEC_FLAG_GLOBAL_HEADER;
|
|
+ #if LIBAVCODEC_BUILD > CALC_FFMPEG_VERSION(56, 35, 0)
|
|
+ c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
|
|
+ #else
|
|
+ c->flags |= CODEC_FLAG_GLOBAL_HEADER;
|
|
+ #endif
|
|
}
|
|
#endif
|
|
|