Added
Link Here
|
1 |
--- configure.orig 2013-04-23 18:48:24 UTC |
2 |
+++ configure |
3 |
@@ -16009,9 +16009,9 @@ if test "x$enable_video_hash" != "xno"; |
4 |
|
5 |
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether FFmpeg is present" >&5 |
6 |
$as_echo_n "checking whether FFmpeg is present... " >&6; } |
7 |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for avcodec_alloc_frame in -lavcodec" >&5 |
8 |
-$as_echo_n "checking for avcodec_alloc_frame in -lavcodec... " >&6; } |
9 |
-if ${ac_cv_lib_avcodec_avcodec_alloc_frame+:} false; then : |
10 |
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for avcodec_decode_video2 in -lavcodec" >&5 |
11 |
+$as_echo_n "checking for avcodec_decode_video2 in -lavcodec... " >&6; } |
12 |
+if ${ac_cv_lib_avcodec_avcodec_decode_video2+:} false; then : |
13 |
$as_echo_n "(cached) " >&6 |
14 |
else |
15 |
ac_check_lib_save_LIBS=$LIBS |
16 |
@@ -16025,27 +16025,27 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ |
17 |
#ifdef __cplusplus |
18 |
extern "C" |
19 |
#endif |
20 |
-char avcodec_alloc_frame (); |
21 |
+char avcodec_decode_video2 (); |
22 |
int |
23 |
main () |
24 |
{ |
25 |
-return avcodec_alloc_frame (); |
26 |
+return avcodec_decode_video2 (); |
27 |
; |
28 |
return 0; |
29 |
} |
30 |
_ACEOF |
31 |
if ac_fn_cxx_try_link "$LINENO"; then : |
32 |
- ac_cv_lib_avcodec_avcodec_alloc_frame=yes |
33 |
+ ac_cv_lib_avcodec_avcodec_decode_video2=yes |
34 |
else |
35 |
- ac_cv_lib_avcodec_avcodec_alloc_frame=no |
36 |
+ ac_cv_lib_avcodec_avcodec_decode_video2=no |
37 |
fi |
38 |
rm -f core conftest.err conftest.$ac_objext \ |
39 |
conftest$ac_exeext conftest.$ac_ext |
40 |
LIBS=$ac_check_lib_save_LIBS |
41 |
fi |
42 |
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avcodec_avcodec_alloc_frame" >&5 |
43 |
-$as_echo "$ac_cv_lib_avcodec_avcodec_alloc_frame" >&6; } |
44 |
-if test "x$ac_cv_lib_avcodec_avcodec_alloc_frame" = xyes; then : |
45 |
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_avcodec_avcodec_decode_video2" >&5 |
46 |
+$as_echo "$ac_cv_lib_avcodec_avcodec_decode_video2" >&6; } |
47 |
+if test "x$ac_cv_lib_avcodec_avcodec_decode_video2" = xyes; then : |
48 |
cat >>confdefs.h <<_ACEOF |
49 |
#define HAVE_LIBAVCODEC 1 |
50 |
_ACEOF |
51 |
--- configure.ac.orig 2013-04-23 18:47:49 UTC |
52 |
+++ configure.ac |
53 |
@@ -122,7 +122,7 @@ fi]) |
54 |
AC_DEFUN([AC_CHECK_FFMPEG], |
55 |
[ |
56 |
AC_MSG_CHECKING([whether FFmpeg is present]) |
57 |
-AC_CHECK_LIB([avcodec], [avcodec_alloc_frame], [], [AC_MSG_ERROR([ |
58 |
+AC_CHECK_LIB([avcodec], [avcodec_decode_video2], [], [AC_MSG_ERROR([ |
59 |
|
60 |
*** libavcodec not found. |
61 |
You need FFmpeg. Get it at <http://ffmpeg.org/>])]) |
62 |
--- src/cimgffmpeg.cpp.orig 2012-11-23 20:58:01 UTC |
63 |
+++ src/cimgffmpeg.cpp |
64 |
@@ -39,11 +39,11 @@ void vfinfo_close(VFInfo *vfinfo){ |
65 |
int ReadFrames(VFInfo *st_info, CImgList<uint8_t> *pFrameList, unsigned int low_index, unsigned int hi_index) |
66 |
{ |
67 |
//target pixel format |
68 |
- PixelFormat ffmpeg_pixfmt; |
69 |
+ AVPixelFormat ffmpeg_pixfmt; |
70 |
if (st_info->pixelformat == 0) |
71 |
- ffmpeg_pixfmt = PIX_FMT_GRAY8; |
72 |
+ ffmpeg_pixfmt = AV_PIX_FMT_GRAY8; |
73 |
else |
74 |
- ffmpeg_pixfmt = PIX_FMT_RGB24; |
75 |
+ ffmpeg_pixfmt = AV_PIX_FMT_RGB24; |
76 |
|
77 |
st_info->next_index = low_index; |
78 |
|
79 |
@@ -100,12 +100,12 @@ int ReadFrames(VFInfo *st_info, CImgList |
80 |
AVFrame *pFrame; |
81 |
|
82 |
// Allocate video frame |
83 |
- pFrame=avcodec_alloc_frame(); |
84 |
+ pFrame=av_frame_alloc(); |
85 |
if (pFrame==NULL) |
86 |
return -1; |
87 |
|
88 |
// Allocate an AVFrame structure |
89 |
- AVFrame *pConvertedFrame = avcodec_alloc_frame(); |
90 |
+ AVFrame *pConvertedFrame = av_frame_alloc(); |
91 |
if(pConvertedFrame==NULL) |
92 |
return -1; |
93 |
|
94 |
@@ -123,7 +123,7 @@ int ReadFrames(VFInfo *st_info, CImgList |
95 |
int size = 0; |
96 |
|
97 |
|
98 |
- int channels = ffmpeg_pixfmt == PIX_FMT_GRAY8 ? 1 : 3; |
99 |
+ int channels = ffmpeg_pixfmt == AV_PIX_FMT_GRAY8 ? 1 : 3; |
100 |
|
101 |
AVPacket packet; |
102 |
int result = 1; |
103 |
@@ -189,11 +189,11 @@ int ReadFrames(VFInfo *st_info, CImgList |
104 |
|
105 |
int NextFrames(VFInfo *st_info, CImgList<uint8_t> *pFrameList) |
106 |
{ |
107 |
- PixelFormat ffmpeg_pixfmt; |
108 |
+ AVPixelFormat ffmpeg_pixfmt; |
109 |
if (st_info->pixelformat == 0) |
110 |
- ffmpeg_pixfmt = PIX_FMT_GRAY8; |
111 |
+ ffmpeg_pixfmt = AV_PIX_FMT_GRAY8; |
112 |
else |
113 |
- ffmpeg_pixfmt = PIX_FMT_RGB24; |
114 |
+ ffmpeg_pixfmt = AV_PIX_FMT_RGB24; |
115 |
|
116 |
if (st_info->pFormatCtx == NULL) |
117 |
{ |
118 |
@@ -254,10 +254,10 @@ int NextFrames(VFInfo *st_info, CImgList |
119 |
AVFrame *pFrame; |
120 |
|
121 |
// Allocate video frame |
122 |
- pFrame=avcodec_alloc_frame(); |
123 |
+ pFrame=av_frame_alloc(); |
124 |
|
125 |
// Allocate an AVFrame structure |
126 |
- AVFrame *pConvertedFrame = avcodec_alloc_frame(); |
127 |
+ AVFrame *pConvertedFrame = av_frame_alloc(); |
128 |
if(pConvertedFrame==NULL){ |
129 |
return -1; |
130 |
} |
131 |
@@ -287,7 +287,7 @@ int NextFrames(VFInfo *st_info, CImgList |
132 |
break; |
133 |
if(packet.stream_index == st_info->videoStream) { |
134 |
|
135 |
- int channels = ffmpeg_pixfmt == PIX_FMT_GRAY8 ? 1 : 3; |
136 |
+ int channels = ffmpeg_pixfmt == AV_PIX_FMT_GRAY8 ? 1 : 3; |
137 |
AVPacket avpkt; |
138 |
av_init_packet(&avpkt); |
139 |
avpkt.data = packet.data; |