Skip to content

Commit

Permalink
Merge branch 'master' into devel/resync-ffmpeg28
Browse files Browse the repository at this point in the history
  • Loading branch information
jyavenard committed Nov 2, 2015
2 parents 8a48da7 + 5ed7db9 commit 218306f
Show file tree
Hide file tree
Showing 88 changed files with 1,980 additions and 185 deletions.
6 changes: 3 additions & 3 deletions mythplugins/mythmusic/mythmusic/mainvisual.cpp
Expand Up @@ -147,7 +147,7 @@ void MainVisual::prepare()
// This is called via : mythtv/libs/libmyth/output.cpp :: OutputListeners::dispatchVisual
// from : mythtv/libs/libmyth/audio/audiooutputbase.cpp :: AudioOutputBase::AddData
// Caller holds mutex() lock
void MainVisual::add(uchar *buffer, unsigned long b_len, unsigned long timecode, int source_channels, int bits_per_sample)
void MainVisual::add(const void *buffer, unsigned long b_len, unsigned long timecode, int source_channels, int bits_per_sample)
{
unsigned long len = b_len, cnt;
short *l = 0, *r = 0;
Expand Down Expand Up @@ -176,7 +176,7 @@ void MainVisual::add(uchar *buffer, unsigned long b_len, unsigned long timecode,
r = new short[len];

if (bits_per_sample == 8)
stereo16_from_stereopcm8(l, r, buffer, cnt);
stereo16_from_stereopcm8(l, r, (uchar *) buffer, cnt);
else if (bits_per_sample == 16)
stereo16_from_stereopcm16(l, r, (short *) buffer, cnt);
else if (s32le)
Expand All @@ -191,7 +191,7 @@ void MainVisual::add(uchar *buffer, unsigned long b_len, unsigned long timecode,
l = new short[len];

if (bits_per_sample == 8)
mono16_from_monopcm8(l, buffer, cnt);
mono16_from_monopcm8(l, (uchar *) buffer, cnt);
else if (bits_per_sample == 16)
mono16_from_monopcm16(l, (short *) buffer, cnt);
else if (s32le)
Expand Down
2 changes: 1 addition & 1 deletion mythplugins/mythmusic/mythmusic/mainvisual.h
Expand Up @@ -45,7 +45,7 @@ class MainVisual : public QObject, public MythTV::Visual

void resize(const QSize &size);

void add(uchar *, unsigned long, unsigned long, int, int);
void add(const void *, unsigned long, unsigned long, int, int);
void prepare(void);

void customEvent(QEvent *);
Expand Down
6 changes: 3 additions & 3 deletions mythtv/bindings/python/MythTV/dataheap.py
Expand Up @@ -865,9 +865,9 @@ def _cat_toid(self):
self._fill_cm(self._db)
if self.category.lower() not in self._cm_toid:
with self._db.cursor(self._log) as cursor:
cursor.execute("""INSERT INTO videocategory
SET category=%s""",
self.category)
cursor.execute("""INSERT INTO videocategory (category)
VALUES (%s)""",
[self.category])
self._cm_toid[self.category] = cursor.lastrowid
self.category = self._cm_toid[self.category]
except AttributeError:
Expand Down
41 changes: 35 additions & 6 deletions mythtv/configure
Expand Up @@ -1942,6 +1942,8 @@ HEADERS_LIST="
d3d11_h
dxva_h
ES2_gl_h
EGL_egl_h
GLES2_gl2_h
fcntl_h
gsm_h
io_h
Expand Down Expand Up @@ -2058,6 +2060,7 @@ SYSTEM_FUNCS="
usleep
VirtualAlloc
wglGetProcAddress
eglGetProcAddress
"

TOOLCHAIN_FEATURES="
Expand Down Expand Up @@ -2417,6 +2420,7 @@ CMDLINE_APPEND="
armv5te_deps="arm"
armv6_deps="arm"
armv6t2_deps="arm"
armv7_a_deps="arm"
armv8_deps="aarch64"
neon_deps_any="aarch64 arm"
intrinsics_neon_deps="neon"
Expand Down Expand Up @@ -3222,7 +3226,7 @@ vbox_deps="backend"
ceton_deps="backend"
mpegtsraw_demuxer_deps="merge_libavformat_mpegts_c"
mythtranscode_deps="backend frontend"
opengl_deps_any="agl_h GL_gl_h GLES2_gl2_h darwin windows x11"
opengl_deps_any="agl_h GL_gl_h EGL_egl_h GLES2_gl2_h darwin windows x11"
opengles_deps="GLES2_gl2_h"
opengl_video_deps="opengl"
v4l2_deps="backend linux_videodev2_h"
Expand Down Expand Up @@ -5144,10 +5148,12 @@ case $target_os in
android)
disable symver
enable section_data_rel_ro
disable qtdbus
SLIB_INSTALL_NAME='$(SLIBNAME)'
SLIB_INSTALL_LINKS=
# soname not set on purpose
SHFLAGS=-shared
enable pic
;;
haiku)
prefix_default="/boot/common"
Expand Down Expand Up @@ -5276,7 +5282,12 @@ case $target_os in
SLIBSUF=".dll"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)'
SLIB_EXTRA_CMD='-lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)'
dlltool="${cross_prefix}dlltool"
if check_cmd lib.exe -list ; then
SLIB_EXTRA_CMD='-lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)'
else
SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > $$(@:$(SLIBSUF)=.def); $(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
fi
SLIB_INSTALL_EXTRA_CMD='-install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"; \
install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)"; \
install -d "$(LIBDIR)"; \
Expand Down Expand Up @@ -5515,7 +5526,9 @@ test -n "$host_libc_type" && enable host_libc_$host_libc_type

case $libc_type in
bionic)
add_compat strtod.o strtod=avpriv_strtod
if test $target_os != android ; then
add_compat strtod.o strtod=avpriv_strtod
fi
;;
esac

Expand Down Expand Up @@ -5552,6 +5565,9 @@ set_default $PATHS_LIST
set_default nm

set_default $MYTHTV_PATHS_LIST
if test $target_os = android ; then
append CONFIG_INCLUDEPATH $sysinclude "${sysroot}${prefix}"
fi

append CCONFIG "$compile_type"
if test x$compile_type = x"profile" ; then
Expand Down Expand Up @@ -6299,12 +6315,16 @@ if enabled taglib; then
echo "Can't find taglib-config. Assuming 1.7 or later."
taglib_minor="7"
fi
tagprefix=${sysroot}`taglib-config --prefix`
if test $target_os = android ; then
tagprefix=`taglib-config --prefix`
else
tagprefix=${sysroot}`taglib-config --prefix`
fi
tagincludes="-I${tagprefix}/include"
taglibs=`taglib-config --libs`
fi

if test $taglib_minor -lt 7 || ! check_class_headers_cpp taglib/fileref.h TagLib::FileRef $tagincludes $taglibs -lstdc++; then
if test $taglib_minor -lt 7 || ! check_class_headers_cpp "taglib/fileref.h stdlib.h" TagLib::FileRef $tagincludes $taglibs -lstdc++; then
die "ERROR: cannot find taglib 1.7 or later."
fi
fi
Expand Down Expand Up @@ -6494,6 +6514,10 @@ enabled opengl && { check_lib GL/glx.h glXGetProcAddress "-lGL" ||
check_lib2 windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
check_lib2 OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
check_lib2 ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
check_lib2 GLES/gl.h glGetError "-Wl,-framework,OpenGLES" ||
{ check_lib2 GLES2/gl2.h glGetError "-lGLESv2" &&
check_lib2 EGL/egl.h eglGetProcAddress "-lEGL"
} ||
die "ERROR: opengl not found."
}
enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
Expand Down Expand Up @@ -6920,6 +6944,9 @@ if test $target_os = mingw32 ; then
elif test $target_os = darwin ; then
qt_inc="-I`cd $(${qmake} -query QT_INSTALL_HEADERS); pwd` -F`cd $(${qmake} -query QT_INSTALL_LIBS); pwd`"
qt_libs="-L`cd $(${qmake} -query QT_INSTALL_LIBS) ; pwd`"
elif test $target_os = android ; then
qt_inc="-I$(${qmake} -query QT_INSTALL_HEADERS)"
qt_libs="-L$(${qmake} -query QT_INSTALL_LIBS)"
else
qt_inc="-I${sysroot}/$(${qmake} -query QT_INSTALL_HEADERS)"
qt_libs="-L${sysroot}/$(${qmake} -query QT_INSTALL_LIBS)"
Expand Down Expand Up @@ -6967,7 +6994,9 @@ fi
# Disable OpenGL ES support if Qt does not support it
QTGL=$(pkg-config --list-all | grep Qt | grep OpenGL | awk '{print $1}')
if $(pkg-config --variable=qt_config $QTGL | grep -qv opengles2) ; then
disable opengles
if test $target_os != android ; then
disable opengles
fi
fi

if enabled firewire; then
Expand Down
1 change: 1 addition & 0 deletions mythtv/external/FFmpeg/configure
Expand Up @@ -5352,6 +5352,7 @@ enabled opengl && { check_lib GL/glx.h glXGetProcAddress "-lGL" ||
check_lib2 windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
check_lib2 OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
check_lib2 ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
check_lib2 GLES2/gl2.h glGetError "-lGLESv2" ||
die "ERROR: opengl not found."
}
enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
Expand Down
5 changes: 5 additions & 0 deletions mythtv/external/FFmpeg/libavdevice/opengl_enc.c
Expand Up @@ -38,6 +38,9 @@
#include <OpenGL/gl3.h>
#elif HAVE_ES2_GL_H
#include <ES2/gl.h>
#elif HAVE_EGL_EGL_H && HAVE_GLES2_GL2_H
#include <EGL/egl.h>
#include <GLES2/gl2.h>
#else
#include <GL/gl.h>
#include <GL/glext.h>
Expand Down Expand Up @@ -508,6 +511,8 @@ static int av_cold opengl_load_procedures(OpenGLContext *opengl)
#define SelectedGetProcAddress glXGetProcAddress
#elif HAVE_WGLGETPROCADDRESS
#define SelectedGetProcAddress wglGetProcAddress
#elif HAVE_EGLGETPROCADDRESS
#define SelectedGetProcAddress eglGetProcAddress
#endif

#define LOAD_OPENGL_FUN(name, type) \
Expand Down
5 changes: 4 additions & 1 deletion mythtv/external/libhdhomerun/libhdhomerun.pro
Expand Up @@ -14,11 +14,13 @@ unix {

HEADERS += hdhomerun_os_posix.h
SOURCES += hdhomerun_os_posix.c hdhomerun_sock_posix.c
!android {
LIBS += -lpthread

!macx {
LIBS += -lrt
}
}

}

Expand Down Expand Up @@ -87,7 +89,8 @@ Makefile.app {

QMAKE_CLEAN += $(TARGET)

unix:QMAKE_POST_LINK=strip $(TARGET)
# FIXME QMAKE_STRIP is empty sometimes, skip for now
# unix:QMAKE_POST_LINK=$${QMAKE_STRIP} $(TARGET)

SOURCES += hdhomerun_config.c

Expand Down
3 changes: 3 additions & 0 deletions mythtv/external/libmythdvdnav/dvdnav/vm/vmget.c
Expand Up @@ -339,6 +339,7 @@ video_attr_t vm_get_video_attr(vm_t *vm) {
default:
assert(0);
}
return (video_attr_t){};
}

audio_attr_t vm_get_audio_attr(vm_t *vm, int streamN) {
Expand All @@ -353,6 +354,7 @@ audio_attr_t vm_get_audio_attr(vm_t *vm, int streamN) {
default:
assert(0);
}
return (audio_attr_t){};
}

subp_attr_t vm_get_subp_attr(vm_t *vm, int streamN) {
Expand All @@ -367,4 +369,5 @@ subp_attr_t vm_get_subp_attr(vm_t *vm, int streamN) {
default:
assert(0);
}
return (subp_attr_t){};
}
2 changes: 1 addition & 1 deletion mythtv/external/qjson/src/serializer.cpp
Expand Up @@ -164,7 +164,7 @@ QByteArray Serializer::SerializerPrivate::serialize( const QVariant &v, int rese
const double value = v.toDouble();
#if defined _WIN32 && !defined(Q_OS_SYMBIAN)
const bool special = _isnan(value) || !_finite(value);
#elif defined(Q_OS_SYMBIAN) || defined(Q_OS_ANDROID)
#elif defined(Q_OS_SYMBIAN)
const bool special = isnan(value) || isinf(value);
#else
const bool special = std::isnan(value) || std::isinf(value);
Expand Down
5 changes: 5 additions & 0 deletions mythtv/filters/filter-common.pro
Expand Up @@ -15,3 +15,8 @@ DEPENDPATH += ../../libs/libmythtv ../../libs/libmythbase
DEPENDPATH += ../../external/FFmpeg

macx:LIBS += $$EXTRA_LIBS

android {
# to discriminate filters in a flat directory structure
TARGET = mythfilter$${TARGET}
}
27 changes: 27 additions & 0 deletions mythtv/libs/libmyth/audio/audiooutput.cpp
Expand Up @@ -36,6 +36,9 @@ using namespace std;
#ifdef USING_PULSE
#include "audiopulsehandler.h"
#endif
#ifdef Q_OS_ANDROID
#include "audiooutputopensles.h"
#endif

extern "C" {
#include "libavcodec/avcodec.h" // to get codec id
Expand Down Expand Up @@ -187,6 +190,16 @@ AudioOutput *AudioOutput::OpenAudio(AudioSettings &settings,
LOG(VB_GENERAL, LOG_ERR, "Audio output device is set to a Windows "
"device but Windows support is not compiled "
"in!");
#endif
}
else if (main_device.startsWith("OpenSLES:"))
{
#ifdef Q_OS_ANDROID
ret = new AudioOutputOpenSLES(settings);
#else
LOG(VB_GENERAL, LOG_ERR, "Audio output device is set to a OpenSLES "
"device but Android support is not compiled "
"in!");
#endif
}
#if defined(USING_OSS)
Expand Down Expand Up @@ -535,6 +548,20 @@ AudioOutput::ADCVect* AudioOutput::GetOutputList(void)
}
}
#endif

#ifdef ANDROID
{
QString name = "OpenSLES:";
QString desc = tr("OpenSLES default output.");
adc = GetAudioDeviceConfig(name, desc);
if (adc)
{
list->append(*adc);
delete adc;
}
}
#endif

QString name = "NULL";
QString desc = "NULL device";
adc = GetAudioDeviceConfig(name, desc);
Expand Down
9 changes: 5 additions & 4 deletions mythtv/libs/libmyth/audio/audiooutputgraph.cpp
Expand Up @@ -81,7 +81,7 @@ class AudioOutputGraph::Buffer : protected QByteArray
resize(0);
}

void Append(const uchar *b, unsigned long len, unsigned long timecode, int channels, int bits)
void Append(const void *b, unsigned long len, unsigned long timecode, int channels, int bits)
{
if (m_bits != bits || m_channels != channels)
{
Expand Down Expand Up @@ -151,7 +151,7 @@ class AudioOutputGraph::Buffer : protected QByteArray
return ms > 0 ? (ms * m_sample_rate) / 1000 : 0; // NB round down
}

void Append(const uchar *b, unsigned long len, int bits)
void Append(const void *b, unsigned long len, int bits)
{
switch (bits)
{
Expand All @@ -161,9 +161,10 @@ class AudioOutputGraph::Buffer : protected QByteArray
unsigned long cnt = len;
int n = size();
resize(n + sizeof(int16_t) * cnt);
const uchar *s = reinterpret_cast< const uchar* >(b);
int16_t *p = reinterpret_cast< int16_t* >(data() + n);
while (cnt--)
*p++ = (int16_t(*b++) - CHAR_MAX) << (16 - CHAR_BIT);
*p++ = (int16_t(*s++) - CHAR_MAX) << (16 - CHAR_BIT);
}
break;

Expand Down Expand Up @@ -252,7 +253,7 @@ void AudioOutputGraph::prepare()
{
}

void AudioOutputGraph::add(uchar *buf, unsigned long len, unsigned long timecode, int channels, int bits)
void AudioOutputGraph::add(const void *buf, unsigned long len, unsigned long timecode, int channels, int bits)
{
QMutexLocker lock(&m_mutex);
m_buffer->Append(buf, len, timecode, channels, bits);
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmyth/audio/audiooutputgraph.h
Expand Up @@ -32,7 +32,7 @@ class MPUBLIC AudioOutputGraph : public MythTV::Visual

// MythTV::Visual implementation
public:
virtual void add(uchar *b, unsigned long b_len, unsigned long timecode, int chnls, int bits);
virtual void add(const void *b, unsigned long b_len, unsigned long timecode, int chnls, int bits);
virtual void prepare();

// Implementation
Expand Down

0 comments on commit 218306f

Please sign in to comment.