417 lines
13 KiB
Diff
417 lines
13 KiB
Diff
|
Fix build with latest ffmpeg: Sanitize include paths and port to the new API
|
||
|
Part of bug #443254
|
||
|
|
||
|
Index: qutecom-2.2_p20110210/libs/pixertool/src/pixertool.cpp
|
||
|
===================================================================
|
||
|
--- qutecom-2.2_p20110210.orig/libs/pixertool/src/pixertool.cpp
|
||
|
+++ qutecom-2.2_p20110210/libs/pixertool/src/pixertool.cpp
|
||
|
@@ -26,9 +26,10 @@
|
||
|
#ifdef __cplusplus
|
||
|
extern "C" {
|
||
|
#endif
|
||
|
-#include <avcodec.h>
|
||
|
+#include <libavcodec/avcodec.h>
|
||
|
+#include <libavutil/pixdesc.h>
|
||
|
#ifdef HAVE_SWSCALE
|
||
|
-#include <swscale.h>
|
||
|
+#include <libswscale/swscale.h>
|
||
|
#endif
|
||
|
#ifdef __cplusplus
|
||
|
}
|
||
|
@@ -54,8 +55,6 @@ static uint8_t * _nv12_to_yuv420p(uint8_
|
||
|
piximage * pix_alloc(pixosi pix, unsigned width, unsigned height) {
|
||
|
piximage * image = (piximage *) malloc(sizeof(piximage));
|
||
|
|
||
|
- avcodec_init();
|
||
|
-
|
||
|
image->width = width;
|
||
|
image->height = height;
|
||
|
image->palette = pix;
|
||
|
@@ -83,7 +82,7 @@ unsigned pix_size(pixosi pix, unsigned w
|
||
|
}
|
||
|
|
||
|
const char *pix_get_fmt_name(pixosi pixfmt) {
|
||
|
- return avcodec_get_pix_fmt_name(pix_ffmpeg_from_pix_osi(pixfmt));
|
||
|
+ return av_get_pix_fmt_name(pix_ffmpeg_from_pix_osi(pixfmt));
|
||
|
}
|
||
|
|
||
|
pixerrorcode pix_convert(int flags, piximage * img_dst, piximage * img_src) {
|
||
|
Index: qutecom-2.2_p20110210/owbuild/FindFFMPEG.cmake
|
||
|
===================================================================
|
||
|
--- qutecom-2.2_p20110210.orig/owbuild/FindFFMPEG.cmake
|
||
|
+++ qutecom-2.2_p20110210/owbuild/FindFFMPEG.cmake
|
||
|
@@ -47,16 +47,13 @@ else (FFMPEG_LIBRARIES AND FFMPEG_INCLUD
|
||
|
|
||
|
find_path(AVCODEC_INCLUDE_DIR
|
||
|
NAMES
|
||
|
- avcodec.h
|
||
|
+ libavcodec/avcodec.h
|
||
|
PATHS
|
||
|
${_AVCODEC_INCLUDEDIR}
|
||
|
/usr/include
|
||
|
/usr/local/include
|
||
|
/opt/local/include
|
||
|
/sw/include
|
||
|
- PATH_SUFFIXES
|
||
|
- libavcodec
|
||
|
- ffmpeg
|
||
|
NO_DEFAULT_PATH
|
||
|
)
|
||
|
|
||
|
@@ -66,32 +63,26 @@ else (FFMPEG_LIBRARIES AND FFMPEG_INCLUD
|
||
|
|
||
|
find_path(AVUTIL_INCLUDE_DIR
|
||
|
NAMES
|
||
|
- avutil.h
|
||
|
+ libavutil/avutil.h
|
||
|
PATHS
|
||
|
${_AVUTIL_INCLUDEDIR}
|
||
|
/usr/include
|
||
|
/usr/local/include
|
||
|
/opt/local/include
|
||
|
/sw/include
|
||
|
- PATH_SUFFIXES
|
||
|
- libavutil
|
||
|
- ffmpeg
|
||
|
NO_DEFAULT_PATH
|
||
|
)
|
||
|
mark_as_advanced(AVUTIL_INCLUDE_DIR)
|
||
|
|
||
|
find_path(AVFORMAT_INCLUDE_DIR
|
||
|
NAMES
|
||
|
- avformat.h
|
||
|
+ libavformat/avformat.h
|
||
|
PATHS
|
||
|
${_AVFORMAT_INCLUDEDIR}
|
||
|
/usr/include
|
||
|
/usr/local/include
|
||
|
/opt/local/include
|
||
|
/sw/include
|
||
|
- PATH_SUFFIXES
|
||
|
- libavformat
|
||
|
- ffmpeg
|
||
|
NO_DEFAULT_PATH
|
||
|
)
|
||
|
mark_as_advanced(AVFORMAT_INCLUDE_DIR)
|
||
|
@@ -99,32 +90,26 @@ else (FFMPEG_LIBRARIES AND FFMPEG_INCLUD
|
||
|
if (FALSE)
|
||
|
find_path(POSTPROC_INCLUDE_DIR
|
||
|
NAMES
|
||
|
- postprocess.h
|
||
|
+ libpostproc/postprocess.h
|
||
|
PATHS
|
||
|
${_POSTPROC_INCLUDEDIR}
|
||
|
/usr/include/postproc
|
||
|
/usr/local/include/postproc
|
||
|
/opt/local/include/postproc
|
||
|
/sw/include
|
||
|
- PATH_SUFFIXES
|
||
|
- libpostproc
|
||
|
- ffmpeg
|
||
|
)
|
||
|
mark_as_advanced(POSTPROC_INCLUDE_DIR)
|
||
|
endif(FALSE)
|
||
|
|
||
|
find_path(SWSCALE_INCLUDE_DIR
|
||
|
NAMES
|
||
|
- swscale.h
|
||
|
+ libswscale/swscale.h
|
||
|
PATHS
|
||
|
${_SWSCALE_INCLUDEDIR}
|
||
|
/usr/include
|
||
|
/usr/local/include
|
||
|
/opt/local/include
|
||
|
/sw/include
|
||
|
- PATH_SUFFIXES
|
||
|
- libswscale
|
||
|
- ffmpeg
|
||
|
NO_DEFAULT_PATH
|
||
|
)
|
||
|
mark_as_advanced(SWSCALE_INCLUDE_DIR)
|
||
|
Index: qutecom-2.2_p20110210/libs/pixertool/include/pixertool/ffmpeg-pixertool.h
|
||
|
===================================================================
|
||
|
--- qutecom-2.2_p20110210.orig/libs/pixertool/include/pixertool/ffmpeg-pixertool.h
|
||
|
+++ qutecom-2.2_p20110210/libs/pixertool/include/pixertool/ffmpeg-pixertool.h
|
||
|
@@ -28,14 +28,14 @@
|
||
|
extern "C" {
|
||
|
#endif
|
||
|
#ifdef HAVE_SWSCALE
|
||
|
-#include <swscale.h>
|
||
|
+#include <libswscale/swscale.h>
|
||
|
#endif
|
||
|
-#include <avcodec.h>
|
||
|
+#include <libavcodec/avcodec.h>
|
||
|
#ifdef __cplusplus
|
||
|
}
|
||
|
#endif
|
||
|
|
||
|
-#include <avutil.h>
|
||
|
+#include <libavutil/avutil.h>
|
||
|
|
||
|
#ifdef __cplusplus
|
||
|
extern "C" {
|
||
|
Index: qutecom-2.2_p20110210/libs/pixertool/src/ffmpeg/ffmpeg-pixertool.c
|
||
|
===================================================================
|
||
|
--- qutecom-2.2_p20110210.orig/libs/pixertool/src/ffmpeg/ffmpeg-pixertool.c
|
||
|
+++ qutecom-2.2_p20110210/libs/pixertool/src/ffmpeg/ffmpeg-pixertool.c
|
||
|
@@ -23,9 +23,9 @@
|
||
|
|
||
|
#include <stdlib.h>
|
||
|
|
||
|
-#include <avcodec.h>
|
||
|
+#include <libavcodec/avcodec.h>
|
||
|
#ifdef HAVE_SWSCALE
|
||
|
-#include <swscale.h>
|
||
|
+#include <libswscale/swscale.h>
|
||
|
#endif
|
||
|
|
||
|
|
||
|
Index: qutecom-2.2_p20110210/qutecom/src/QuteComBuildId.cpp
|
||
|
===================================================================
|
||
|
--- qutecom-2.2_p20110210.orig/qutecom/src/QuteComBuildId.cpp
|
||
|
+++ qutecom-2.2_p20110210/qutecom/src/QuteComBuildId.cpp
|
||
|
@@ -29,7 +29,7 @@
|
||
|
#include <boost/version.hpp>
|
||
|
#include <tinyxml.h>
|
||
|
extern "C" {
|
||
|
-#include <avcodec.h>
|
||
|
+#include <libavcodec/avcodec.h>
|
||
|
#if defined (IMWRAPPER_BACKEND_MULTI)
|
||
|
#include <glib.h>
|
||
|
#include <libpurple/core.h>
|
||
|
Index: qutecom-2.2_p20110210/wifo/phapi/phapi-old.c
|
||
|
===================================================================
|
||
|
--- qutecom-2.2_p20110210.orig/wifo/phapi/phapi-old.c
|
||
|
+++ qutecom-2.2_p20110210/wifo/phapi/phapi-old.c
|
||
|
@@ -59,7 +59,7 @@
|
||
|
#define SKIP(x)
|
||
|
|
||
|
#ifdef PHAPI_VIDEO_SUPPORT
|
||
|
-#include <avcodec.h>
|
||
|
+#include <libavcodec/avcodec.h>
|
||
|
#include <webcam/webcam.h>
|
||
|
#endif
|
||
|
|
||
|
@@ -2295,7 +2295,9 @@ void
|
||
|
ph_avcodec_init()
|
||
|
{
|
||
|
#ifdef PHAPI_VIDEO_SUPPORT
|
||
|
+#if LIBAVCODEC_VERSION_MAJOR < 54
|
||
|
avcodec_init();
|
||
|
+#endif
|
||
|
avcodec_register_all();
|
||
|
//phcfg.video_config.video_line_configuration = PHAPI_VIDEO_LINE_128KBPS;
|
||
|
#endif
|
||
|
Index: qutecom-2.2_p20110210/wifo/phapi/phcodec-avcodec-wrapper.c
|
||
|
===================================================================
|
||
|
--- qutecom-2.2_p20110210.orig/wifo/phapi/phcodec-avcodec-wrapper.c
|
||
|
+++ qutecom-2.2_p20110210/wifo/phapi/phcodec-avcodec-wrapper.c
|
||
|
@@ -36,7 +36,7 @@
|
||
|
|
||
|
|
||
|
|
||
|
-#include <avcodec.h>
|
||
|
+#include <libavcodec/avcodec.h>
|
||
|
#include <ortp.h>
|
||
|
#include <osip2/osip_mt.h>
|
||
|
#include <osipparser2/osip_list.h>
|
||
|
@@ -53,7 +53,9 @@
|
||
|
|
||
|
void ph_avcodec_wrapper_init()
|
||
|
{
|
||
|
+#if LIBAVCODEC_VERSION_MAJOR < 54
|
||
|
avcodec_init();
|
||
|
+#endif
|
||
|
avcodec_register_all();
|
||
|
}
|
||
|
|
||
|
Index: qutecom-2.2_p20110210/wifo/phapi/phcodec-avcodec-wrapper.h
|
||
|
===================================================================
|
||
|
--- qutecom-2.2_p20110210.orig/wifo/phapi/phcodec-avcodec-wrapper.h
|
||
|
+++ qutecom-2.2_p20110210/wifo/phapi/phcodec-avcodec-wrapper.h
|
||
|
@@ -22,7 +22,7 @@
|
||
|
#include "phapi.h"
|
||
|
#include "phcall.h"
|
||
|
#include "phmedia.h"
|
||
|
-#include <avcodec.h>
|
||
|
+#include <libavcodec/avcodec.h>
|
||
|
|
||
|
#define PHCODEC_DEFAULT_BITRATE 1000000
|
||
|
// 99 = 11*9 = (176/16)*(144/16) = a partition of macroblocs ( 1 MB = four 8x8 squares)
|
||
|
Index: qutecom-2.2_p20110210/wifo/phapi/phcodec-h263.c
|
||
|
===================================================================
|
||
|
--- qutecom-2.2_p20110210.orig/wifo/phapi/phcodec-h263.c
|
||
|
+++ qutecom-2.2_p20110210/wifo/phapi/phcodec-h263.c
|
||
|
@@ -23,7 +23,7 @@
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
-#include <avcodec.h>
|
||
|
+#include <libavcodec/avcodec.h>
|
||
|
#include <ortp.h>
|
||
|
#include <osip2/osip_mt.h>
|
||
|
#include <osipparser2/osip_list.h>
|
||
|
@@ -76,7 +76,6 @@ void *h263_encoder_init(void *ctx) {
|
||
|
}
|
||
|
|
||
|
h263t->encoder_ctx.context->flags |= CODEC_FLAG_QP_RD;
|
||
|
- h263t->encoder_ctx.context->flags |= CODEC_FLAG_H263P_SLICE_STRUCT;
|
||
|
h263t->encoder_ctx.context->flags |= CODEC_FLAG_QSCALE;
|
||
|
|
||
|
//h263t->encoder_ctx.context->flags |= CODEC_FLAG_INPUT_PRESERVED;
|
||
|
Index: qutecom-2.2_p20110210/wifo/phapi/phcodec-h263flv1.c
|
||
|
===================================================================
|
||
|
--- qutecom-2.2_p20110210.orig/wifo/phapi/phcodec-h263flv1.c
|
||
|
+++ qutecom-2.2_p20110210/wifo/phapi/phcodec-h263flv1.c
|
||
|
@@ -23,7 +23,7 @@
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
-#include <avcodec.h>
|
||
|
+#include <libavcodec/avcodec.h>
|
||
|
#include <ortp.h>
|
||
|
#include <osip2/osip_mt.h>
|
||
|
#include <osipparser2/osip_list.h>
|
||
|
@@ -76,7 +76,6 @@ void *h263flv1_encoder_init(void *ctx) {
|
||
|
}
|
||
|
|
||
|
h263t->encoder_ctx.context->flags |= CODEC_FLAG_QP_RD;
|
||
|
- h263t->encoder_ctx.context->flags |= CODEC_FLAG_H263P_SLICE_STRUCT;
|
||
|
h263t->encoder_ctx.context->flags |= CODEC_FLAG_QSCALE;
|
||
|
|
||
|
//h263t->encoder_ctx.context->flags |= CODEC_FLAG_INPUT_PRESERVED;
|
||
|
Index: qutecom-2.2_p20110210/wifo/phapi/phcodec-h263flv1.h
|
||
|
===================================================================
|
||
|
--- qutecom-2.2_p20110210.orig/wifo/phapi/phcodec-h263flv1.h
|
||
|
+++ qutecom-2.2_p20110210/wifo/phapi/phcodec-h263flv1.h
|
||
|
@@ -25,7 +25,7 @@
|
||
|
#include "phcall.h"
|
||
|
#include "phmedia.h"
|
||
|
#include "phcodec-h263.h"
|
||
|
-#include <avcodec.h>
|
||
|
+#include <libavcodec/avcodec.h>
|
||
|
#include "phcodec-avcodec-wrapper.h"
|
||
|
|
||
|
#define MAX_ENC_BUFFER_SIZE (FF_MIN_BUFFER_SIZE * 32)
|
||
|
Index: qutecom-2.2_p20110210/wifo/phapi/phcodec-h263.h
|
||
|
===================================================================
|
||
|
--- qutecom-2.2_p20110210.orig/wifo/phapi/phcodec-h263.h
|
||
|
+++ qutecom-2.2_p20110210/wifo/phapi/phcodec-h263.h
|
||
|
@@ -24,7 +24,7 @@
|
||
|
#include "phapi.h"
|
||
|
#include "phcall.h"
|
||
|
#include "phmedia.h"
|
||
|
-#include <avcodec.h>
|
||
|
+#include <libavcodec/avcodec.h>
|
||
|
#include "phcodec-avcodec-wrapper.h"
|
||
|
|
||
|
#define MAX_ENC_BUFFER_SIZE (FF_MIN_BUFFER_SIZE * 32)
|
||
|
Index: qutecom-2.2_p20110210/wifo/phapi/phcodec-h263plus.c
|
||
|
===================================================================
|
||
|
--- qutecom-2.2_p20110210.orig/wifo/phapi/phcodec-h263plus.c
|
||
|
+++ qutecom-2.2_p20110210/wifo/phapi/phcodec-h263plus.c
|
||
|
@@ -16,7 +16,7 @@
|
||
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||
|
*/
|
||
|
|
||
|
-#include <avcodec.h>
|
||
|
+#include <libavcodec/avcodec.h>
|
||
|
#include <ortp.h>
|
||
|
#include <osip2/osip_mt.h>
|
||
|
#include <osipparser2/osip_list.h>
|
||
|
@@ -69,7 +69,6 @@ void *h263p_encoder_init(void *ctx) {
|
||
|
}
|
||
|
|
||
|
h263t->encoder_ctx.context->flags |= CODEC_FLAG_QP_RD;
|
||
|
- h263t->encoder_ctx.context->flags |= CODEC_FLAG_H263P_SLICE_STRUCT;
|
||
|
h263t->encoder_ctx.context->flags |= CODEC_FLAG_QSCALE;
|
||
|
|
||
|
//h263t->encoder_ctx.context->flags |= CODEC_FLAG_INPUT_PRESERVED;
|
||
|
Index: qutecom-2.2_p20110210/wifo/phapi/phcodec-h263plus.h
|
||
|
===================================================================
|
||
|
--- qutecom-2.2_p20110210.orig/wifo/phapi/phcodec-h263plus.h
|
||
|
+++ qutecom-2.2_p20110210/wifo/phapi/phcodec-h263plus.h
|
||
|
@@ -25,7 +25,7 @@
|
||
|
#include "phcall.h"
|
||
|
#include "phmedia.h"
|
||
|
#include "phcodec-h263.h"
|
||
|
-#include <avcodec.h>
|
||
|
+#include <libavcodec/avcodec.h>
|
||
|
#include "phcodec-avcodec-wrapper.h"
|
||
|
|
||
|
#define MAX_ENC_BUFFER_SIZE (FF_MIN_BUFFER_SIZE * 32)
|
||
|
Index: qutecom-2.2_p20110210/wifo/phapi/phcodec-h264.c
|
||
|
===================================================================
|
||
|
--- qutecom-2.2_p20110210.orig/wifo/phapi/phcodec-h264.c
|
||
|
+++ qutecom-2.2_p20110210/wifo/phapi/phcodec-h264.c
|
||
|
@@ -21,7 +21,7 @@
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
-#include <avcodec.h>
|
||
|
+#include <libavcodec/avcodec.h>
|
||
|
#include <ortp.h>
|
||
|
#include <osip2/osip_mt.h>
|
||
|
#include <osipparser2/osip_list.h>
|
||
|
Index: qutecom-2.2_p20110210/wifo/phapi/phcodec-mpeg4.c
|
||
|
===================================================================
|
||
|
--- qutecom-2.2_p20110210.orig/wifo/phapi/phcodec-mpeg4.c
|
||
|
+++ qutecom-2.2_p20110210/wifo/phapi/phcodec-mpeg4.c
|
||
|
@@ -24,7 +24,7 @@
|
||
|
*/
|
||
|
|
||
|
|
||
|
-#include <avcodec.h>
|
||
|
+#include <libavcodec/avcodec.h>
|
||
|
#include <ortp.h>
|
||
|
#include <osip2/osip_mt.h>
|
||
|
#include <osipparser2/osip_list.h>
|
||
|
Index: qutecom-2.2_p20110210/wifo/phapi/phmedia-video-bwcontrol.c
|
||
|
===================================================================
|
||
|
--- qutecom-2.2_p20110210.orig/wifo/phapi/phmedia-video-bwcontrol.c
|
||
|
+++ qutecom-2.2_p20110210/wifo/phapi/phmedia-video-bwcontrol.c
|
||
|
@@ -36,7 +36,7 @@
|
||
|
#include <stdio.h>
|
||
|
#include <math.h>
|
||
|
#include <webcam/webcam.h>
|
||
|
-#include <avcodec.h>
|
||
|
+#include <libavcodec/avcodec.h>
|
||
|
|
||
|
#include "phlog.h"
|
||
|
#include "phcodec.h"
|
||
|
Index: qutecom-2.2_p20110210/wifo/phapi/phmedia-video.c
|
||
|
===================================================================
|
||
|
--- qutecom-2.2_p20110210.orig/wifo/phapi/phmedia-video.c
|
||
|
+++ qutecom-2.2_p20110210/wifo/phapi/phmedia-video.c
|
||
|
@@ -34,7 +34,7 @@
|
||
|
#include <fcntl.h>
|
||
|
#include <stdio.h>
|
||
|
#include <webcam/webcam.h>
|
||
|
-#include <avcodec.h>
|
||
|
+#include <libavcodec/avcodec.h>
|
||
|
#include <pixertool/ffmpeg-pixertool.h>
|
||
|
#include <pixertool/pixertool.h>
|
||
|
|
||
|
@@ -867,7 +867,7 @@ int ph_media_video_flush_queue(phvstream
|
||
|
stream->stat_num_decoded_total_over_5s++;
|
||
|
gettimeofday(&now_time, 0);
|
||
|
ph_tvsub(&now_time, &stream->last_decode_time);
|
||
|
- if (picIn->pict_type != FF_I_TYPE && (now_time.tv_usec / 1000) < stream->fps_interleave_time)
|
||
|
+ if (picIn->pict_type != AV_PICTURE_TYPE_I && (now_time.tv_usec / 1000) < stream->fps_interleave_time)
|
||
|
{
|
||
|
stream->stat_num_decoded_dropped_over_5s++;
|
||
|
return 0;
|
||
|
Index: qutecom-2.2_p20110210/wifo/phapi/phmedia-video-control.c
|
||
|
===================================================================
|
||
|
--- qutecom-2.2_p20110210.orig/wifo/phapi/phmedia-video-control.c
|
||
|
+++ qutecom-2.2_p20110210/wifo/phapi/phmedia-video-control.c
|
||
|
@@ -29,7 +29,7 @@
|
||
|
#include <fcntl.h>
|
||
|
#include <stdio.h>
|
||
|
#include <webcam/webcam.h>
|
||
|
-#include <avcodec.h>
|
||
|
+#include <libavcodec/avcodec.h>
|
||
|
|
||
|
#include "phcodec.h"
|
||
|
#include "phapi.h"
|