Skip to content
Snippets Groups Projects
Commit e03b970d authored by Adrien Béraud's avatar Adrien Béraud
Browse files

android: enable vp8, cleanup

Fix and enable VPX on Android.
Since the Android build moved to clang and libc++,
it's no longer necessary to redefine some common
standard C++ methods.

Change-Id: I3488633782ded31bc260c5a234802ebd6f251377
parent c86a2a4b
Branches
Tags
No related merge requests found
...@@ -37,9 +37,7 @@ FFMPEGCONF += \ ...@@ -37,9 +37,7 @@ FFMPEGCONF += \
#librairies #librairies
ifndef HAVE_ANDROID ifndef HAVE_ANDROID
FFMPEGCONF += \ FFMPEGCONF += --enable-libx264
--enable-libx264 \
--enable-libvpx
endif endif
#encoders/decoders #encoders/decoders
...@@ -66,6 +64,7 @@ FFMPEGCONF += \ ...@@ -66,6 +64,7 @@ FFMPEGCONF += \
--enable-decoder=mjpegb \ --enable-decoder=mjpegb \
--enable-libspeex \ --enable-libspeex \
--enable-libopus \ --enable-libopus \
--enable-libvpx \
--enable-encoder=libspeex \ --enable-encoder=libspeex \
--enable-decoder=libspeex \ --enable-decoder=libspeex \
--enable-encoder=libopus \ --enable-encoder=libopus \
......
--- pjproject/pjlib/include/pj/compat/ctype.h 2016-10-06 16:39:29.708512865 -0400
+++ pjproject/pjlib/include/pj/compat/ctype.h 2016-10-06 17:39:00.084513427 -0400
@@ -43,5 +43,2 @@
-#ifndef isblank
-# define isblank(c) (c==' ' || c=='\t')
-#endif
...@@ -69,6 +69,7 @@ endif ...@@ -69,6 +69,7 @@ endif
$(APPLY) $(SRC)/pjproject/notestsapps.patch $(APPLY) $(SRC)/pjproject/notestsapps.patch
ifdef HAVE_ANDROID ifdef HAVE_ANDROID
$(APPLY) $(SRC)/pjproject/android.patch $(APPLY) $(SRC)/pjproject/android.patch
$(APPLY) $(SRC)/pjproject/isblank.patch
endif endif
$(APPLY) $(SRC)/pjproject/ipv6.patch $(APPLY) $(SRC)/pjproject/ipv6.patch
$(APPLY) $(SRC)/pjproject/ice_config.patch $(APPLY) $(SRC)/pjproject/ice_config.patch
......
...@@ -117,7 +117,7 @@ ifdef HAVE_ANDROID ...@@ -117,7 +117,7 @@ ifdef HAVE_ANDROID
# uses that path to look for the compiler (which we already know) # uses that path to look for the compiler (which we already know)
VPX_CONF += --sdk-path=$(ANDROID_TOOLCHAIN)/bin VPX_CONF += --sdk-path=$(ANDROID_TOOLCHAIN)/bin
# needed for cpu-features.h # needed for cpu-features.h
VPX_CONF += --extra-cflags="-I$(ANDROID_NDK)/sources/cpufeatures/" VPX_CONF += --extra-cflags="-I$(ANDROID_NDK)/sources/cpufeatures/ -fvisibility=hidden"
# set an explicit alternative libc since the sysroot override can make it blank # set an explicit alternative libc since the sysroot override can make it blank
VPX_CONF += --libc=$(SYSROOT) VPX_CONF += --libc=$(SYSROOT)
LOCAL_HOSTVARS=$(HOSTVARS) LOCAL_HOSTVARS=$(HOSTVARS)
......
...@@ -21,7 +21,9 @@ ...@@ -21,7 +21,9 @@
#ifndef IP_UTILS_H_ #ifndef IP_UTILS_H_
#define IP_UTILS_H_ #define IP_UTILS_H_
extern "C" {
#include <pjlib.h> #include <pjlib.h>
}
#ifdef HAVE_CONFIG #ifdef HAVE_CONFIG
#include <config.h> #include <config.h>
......
...@@ -25,10 +25,6 @@ ...@@ -25,10 +25,6 @@
#include <string> #include <string>
#include <vector> #include <vector>
#ifdef __ANDROID__
#include <sstream>
#endif
namespace ring { namespace ring {
constexpr static const char* TRUE_STR = "true"; constexpr static const char* TRUE_STR = "true";
...@@ -48,42 +44,6 @@ std::wstring to_wstring(const std::string& s); ...@@ -48,42 +44,6 @@ std::wstring to_wstring(const std::string& s);
#endif #endif
#ifdef __ANDROID__
// Rationale:
// Some strings functions are not available on Android NDK as explained here:
// http://stackoverflow.com/questions/17950814/how-to-use-stdstoul-and-stdstoull-in-android/18124627#18124627
// We implement them by ourself as well as possible here.
template <typename T>
inline std::string
to_string(T &&value)
{
std::ostringstream os;
os << value;
return os.str();
}
static inline int
stoi(const std::string& str)
{
int v;
std::istringstream os(str);
os >> v;
return v;
}
static inline double
stod(const std::string& str)
{
double v;
std::istringstream os(str);
os >> v;
return v;
}
#else
template <typename T> template <typename T>
inline std::string inline std::string
to_string(T &&value) to_string(T &&value)
...@@ -103,8 +63,6 @@ stod(const std::string& str) ...@@ -103,8 +63,6 @@ stod(const std::string& str)
return std::stod(str); return std::stod(str);
} }
#endif
std::string trim(const std::string &s); std::string trim(const std::string &s);
std::vector<std::string> std::vector<std::string>
......
...@@ -24,15 +24,6 @@ ...@@ -24,15 +24,6 @@
#include "upnp_context.h" #include "upnp_context.h"
#include <string>
#include <set>
#include <mutex>
#include <memory>
#include <condition_variable>
#include <random>
#include <chrono>
#include <cstdlib> // for std::free
#if HAVE_LIBUPNP #if HAVE_LIBUPNP
#include <upnp/upnp.h> #include <upnp/upnp.h>
#include <upnp/upnptools.h> #include <upnp/upnptools.h>
...@@ -50,6 +41,15 @@ ...@@ -50,6 +41,15 @@
#include <opendht/rng.h> #include <opendht/rng.h>
using random_device = dht::crypto::random_device; using random_device = dht::crypto::random_device;
#include <string>
#include <set>
#include <mutex>
#include <memory>
#include <condition_variable>
#include <random>
#include <chrono>
#include <cstdlib> // for std::free
namespace ring { namespace upnp { namespace ring { namespace upnp {
/** /**
......
...@@ -24,15 +24,6 @@ ...@@ -24,15 +24,6 @@
#include "config.h" #include "config.h"
#endif #endif
#include <set>
#include <map>
#include <mutex>
#include <memory>
#include <condition_variable>
#include <chrono>
#include <atomic>
#include <thread>
#if HAVE_LIBUPNP #if HAVE_LIBUPNP
#ifdef _WIN32 #ifdef _WIN32
#define UPNP_STATIC_LIB #define UPNP_STATIC_LIB
...@@ -50,6 +41,15 @@ ...@@ -50,6 +41,15 @@
#include "noncopyable.h" #include "noncopyable.h"
#include "upnp_igd.h" #include "upnp_igd.h"
#include <set>
#include <map>
#include <mutex>
#include <memory>
#include <condition_variable>
#include <chrono>
#include <atomic>
#include <thread>
namespace ring { namespace ring {
class IpAddr; class IpAddr;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment