Commit e03b970d authored by Adrien Béraud's avatar Adrien Béraud

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
......@@ -37,9 +37,7 @@ FFMPEGCONF += \
#librairies
ifndef HAVE_ANDROID
FFMPEGCONF += \
--enable-libx264 \
--enable-libvpx
FFMPEGCONF += --enable-libx264
endif
#encoders/decoders
......@@ -66,6 +64,7 @@ FFMPEGCONF += \
--enable-decoder=mjpegb \
--enable-libspeex \
--enable-libopus \
--enable-libvpx \
--enable-encoder=libspeex \
--enable-decoder=libspeex \
--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
$(APPLY) $(SRC)/pjproject/notestsapps.patch
ifdef HAVE_ANDROID
$(APPLY) $(SRC)/pjproject/android.patch
$(APPLY) $(SRC)/pjproject/isblank.patch
endif
$(APPLY) $(SRC)/pjproject/ipv6.patch
$(APPLY) $(SRC)/pjproject/ice_config.patch
......
......@@ -117,7 +117,7 @@ ifdef HAVE_ANDROID
# uses that path to look for the compiler (which we already know)
VPX_CONF += --sdk-path=$(ANDROID_TOOLCHAIN)/bin
# 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
VPX_CONF += --libc=$(SYSROOT)
LOCAL_HOSTVARS=$(HOSTVARS)
......
......@@ -21,7 +21,9 @@
#ifndef IP_UTILS_H_
#define IP_UTILS_H_
extern "C" {
#include <pjlib.h>
}
#ifdef HAVE_CONFIG
#include <config.h>
......
......@@ -25,10 +25,6 @@
#include <string>
#include <vector>
#ifdef __ANDROID__
#include <sstream>
#endif
namespace ring {
constexpr static const char* TRUE_STR = "true";
......@@ -48,42 +44,6 @@ std::wstring to_wstring(const std::string& s);
#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>
inline std::string
to_string(T &&value)
......@@ -103,8 +63,6 @@ stod(const std::string& str)
return std::stod(str);
}
#endif
std::string trim(const std::string &s);
std::vector<std::string>
......
......@@ -24,15 +24,6 @@
#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
#include <upnp/upnp.h>
#include <upnp/upnptools.h>
......@@ -50,6 +41,15 @@
#include <opendht/rng.h>
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 {
/**
......
......@@ -24,15 +24,6 @@
#include "config.h"
#endif
#include <set>
#include <map>
#include <mutex>
#include <memory>
#include <condition_variable>
#include <chrono>
#include <atomic>
#include <thread>
#if HAVE_LIBUPNP
#ifdef _WIN32
#define UPNP_STATIC_LIB
......@@ -50,6 +41,15 @@
#include "noncopyable.h"
#include "upnp_igd.h"
#include <set>
#include <map>
#include <mutex>
#include <memory>
#include <condition_variable>
#include <chrono>
#include <atomic>
#include <thread>
namespace ring {
class IpAddr;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment