blob: 0e740608057e18db0e46e1c55ec603aea7ec301f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
|
diff -Nur a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt 2015-08-16 01:25:43.282403676 -0300
+++ b/CMakeLists.txt 2015-08-16 01:33:33.084570830 -0300
@@ -419,159 +419,19 @@
include_directories(native/ext/stb_vorbis)
if(USE_FFMPEG)
- if(USE_SYSTEM_FFMPEG)
- include(FindFFMPEG)
- else()
- set(FFMPEG_FOUND OFF)
- endif()
- if(NOT FFMPEG_FOUND)
- if(NOT DEFINED FFMPEG_BUILDDIR)
- if(ANDROID)
- if(ARMV7)
- set(PLATFORM_ARCH "android/armv7")
- elseif(ARM)
- set(PLATFORM_ARCH "android/arm")
- elseif(X86)
- set(PLATFORM_ARCH "android/x86")
- endif()
- elseif(BLACKBERRY)
- set(PLATFORM_ARCH "blackberry/armv7")
- elseif(IOS)
- set(PLATFORM_ARCH "ios/universal")
- elseif(MACOSX)
- set(PLATFORM_ARCH "macosx/x86_64")
- elseif(LINUX)
- if(ARMV7)
- set(PLATFORM_ARCH "linux/armv7")
- elseif(ARM)
- set(PLATFORM_ARCH "linux/arm")
- elseif(MIPS)
- set(PLATFORM_ARCH "linux/mips32")
- elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
- set(PLATFORM_ARCH "linux/x86_64")
- else()
- set(PLATFORM_ARCH "linux/x86")
- endif()
- endif()
- # Using static libraries
- if (DEFINED PLATFORM_ARCH)
- include_directories(ffmpeg/${PLATFORM_ARCH}/include)
- link_directories(ffmpeg/${PLATFORM_ARCH}/lib)
- set(FFMPEG_LIBRARIES libavformat.a libavcodec.a libavutil.a libswresample.a libswscale.a)
- else()
- # Manual definition of system library locations by the user.
- if (DEFINED FFMPEG_INCLUDE_PATH)
- include_directories(ffmpeg ${FFMPEG_INCLUDE_PATH})
- endif()
- if (DEFINED AVFORMAT_PATH)
- add_library(libavformat STATIC IMPORTED)
- set_target_properties(libavformat PROPERTIES IMPORTED_LOCATION ${AVFORMAT_PATH})
- SET (FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} libavformat)
- endif()
- if (DEFINED AVCODEC_PATH)
- add_library(libavcodec STATIC IMPORTED)
- set_target_properties(libavcodec PROPERTIES IMPORTED_LOCATION ${AVCODEC_PATH})
- SET (FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} libavcodec)
- endif()
- if (DEFINED AVUTIL_PATH)
- add_library(libavutil STATIC IMPORTED)
- set_target_properties(libavutil PROPERTIES IMPORTED_LOCATION ${AVUTIL_PATH})
- SET (FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} libavutil)
- endif()
- if (DEFINED SWRESAMPLE_PATH)
- add_library(libswresample STATIC IMPORTED)
- set_target_properties(libswresample PROPERTIES IMPORTED_LOCATION ${SWRESAMPLE_PATH})
- SET (FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} libswresample)
- endif()
- if (DEFINED SWSCALE_PATH)
- add_library(libswscale STATIC IMPORTED)
- set_target_properties(libswscale PROPERTIES IMPORTED_LOCATION ${SWSCALE_PATH})
- SET (FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} libswscale)
- endif()
- endif(DEFINED PLATFORM_ARCH)
- else(NOT DEFINED FFMPEG_BUILDDIR)
- # Using shared libraries
- include_directories(ffmpeg ${FFMPEG_BUILDDIR})
+ SET (FFMPEG_LIBRARIES
+ avformat
+ avcodec
+ avutil
+ swresample
+ swscale
+ )
- add_library(libavformat STATIC IMPORTED)
- set_target_properties(libavformat PROPERTIES IMPORTED_LOCATION ${FFMPEG_BUILDDIR}/libavformat/libavformat.a)
- add_library(libavcodec STATIC IMPORTED)
- set_target_properties(libavcodec PROPERTIES IMPORTED_LOCATION ${FFMPEG_BUILDDIR}/libavcodec/libavcodec.a)
- add_library(libavutil STATIC IMPORTED)
- set_target_properties(libavutil PROPERTIES IMPORTED_LOCATION ${FFMPEG_BUILDDIR}/libavutil/libavutil.a)
- add_library(libswresample STATIC IMPORTED)
- set_target_properties(libswresample PROPERTIES IMPORTED_LOCATION ${FFMPEG_BUILDDIR}/libswresample/libswresample.a)
- add_library(libswscale STATIC IMPORTED)
- set_target_properties(libswscale PROPERTIES IMPORTED_LOCATION ${FFMPEG_BUILDDIR}/libswscale/libswscale.a)
-
- SET (FFMPEG_LIBRARIES
- libavformat
- libavcodec
- libavutil
- libswresample
- libswscale
- )
- endif(NOT DEFINED FFMPEG_BUILDDIR)
- endif(NOT FFMPEG_FOUND)
-
- find_library(ICONV_LIBRARY NAMES iconv)
- if (ICONV_LIBRARY)
- set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${ICONV_LIBRARY})
- endif()
-
- if(APPLE)
- set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} bz2 "-framework CoreVideo")
- if (NOT IOS)
- set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} "-framework VideoDecodeAcceleration")
- endif()
- endif(APPLE)
-
- if(FFMPEG_FOUND)
- set(nativeExtraLibs ${nativeExtraLibs} ${FFMPEG_LIBRARIES})
- else()
- set(LinkCommon ${LinkCommon} ${FFMPEG_LIBRARIES})
- endif()
+ set(nativeExtraLibs ${nativeExtraLibs} ${FFMPEG_LIBRARIES})
target_link_libraries(Common ${FFMPEG_LIBRARIES})
add_definitions(-DUSE_FFMPEG)
endif(USE_FFMPEG)
-# Modification to show where we are pulling the ffmpeg libraries from.
-if(USE_FFMPEG AND DEFINED FFMPEG_LIBRARIES)
- message(STATUS "FFMPEG library locations:")
- if(FFMPEG_FOUND)
- message(STATUS "libavcodec location: ${FFMPEG_avcodec_LIBRARY}")
- message(STATUS "libavformat location: ${FFMPEG_avformat_LIBRARY}")
- message(STATUS "libavutil location: ${FFMPEG_avutil_LIBRARY}")
- message(STATUS "libswresample location: ${FFMPEG_swresample_LIBRARY}")
- message(STATUS "libswscale location: ${FFMPEG_swscale_LIBRARY}")
- elseif(DEFINED PLATFORM_ARCH)
- set(TEMP ${CMAKE_SOURCE_DIR}/ffmpeg/${PLATFORM_ARCH}/lib)
- message(STATUS "libavcodec location: ${TEMP}/libavcodec.a")
- message(STATUS "libavformat location: ${TEMP}/libavformat.a")
- message(STATUS "libavutil location: ${TEMP}/libavutil.a")
- message(STATUS "libswresample location: ${TEMP}/libswresample.a")
- message(STATUS "libswscale location: ${TEMP}/libswscale.a")
- else()
- get_target_property(TEMP libavcodec IMPORTED_LOCATION)
- message(STATUS "libavcodec location: ${TEMP}")
- get_target_property(TEMP libavformat IMPORTED_LOCATION)
- message(STATUS "libavformat location: ${TEMP}")
- get_target_property(TEMP libavutil IMPORTED_LOCATION)
- message(STATUS "libavutil location: ${TEMP}")
- get_target_property(TEMP libswresample IMPORTED_LOCATION)
- message(STATUS "libswresample location: ${TEMP}")
- get_target_property(TEMP libswscale IMPORTED_LOCATION)
- message(STATUS "libswscale location: ${TEMP}")
- endif()
-else()
- message(STATUS "ERROR: No FFMPEG library locations")
-endif()
-
-if(USE_FFMPEG AND NOT DEFINED FFMPEG_LIBRARIES)
- message(WARNING "FFMPEG_BUILDDIR variable or manual path definition is required to enable FFmpeg. Disabling it.")
- unset(USE_FFMPEG)
-endif()
-
find_package(ZLIB)
if(ZLIB_FOUND)
include_directories(${ZLIB_INCLUDE_DIR})
diff -Nur a/Core/HW/MediaEngine.h b/Core/HW/MediaEngine.h
--- a/Core/HW/MediaEngine.h 2015-08-16 01:25:43.332404138 -0300
+++ b/Core/HW/MediaEngine.h 2015-08-16 01:35:59.109776759 -0300
@@ -34,9 +34,14 @@
class SimpleAudio;
#ifdef USE_FFMPEG
+extern "C" {
+#include <libavformat/avformat.h>
+#include <libavutil/old_pix_fmts.h>
+}
+
struct SwsContext;
struct AVFrame;
-struct AVIOContext;
+//struct AVIOContext;
struct AVFormatContext;
struct AVCodecContext;
#endif
|