diff options
33 files changed, 8 insertions, 3253 deletions
diff --git a/Makefile.in b/Makefile.in index 8e3d38a03f..8293701bd1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -13,10 +13,6 @@ DVDPCODECS_DIRS= \ lib \ lib/libdvd -ifeq (@USE_LIBSTAGEFRIGHT@,1) -DVDPCODECS_DIRS += xbmc/cores/VideoPlayer/DVDCodecs/Video/libstagefrightICS -endif - VideoPlayer_ARCHIVES=xbmc/cores/VideoPlayer/VideoPlayer.a \ xbmc/cores/VideoPlayer/DVDCodecs/DVDCodecs.a \ xbmc/cores/VideoPlayer/DVDCodecs/Audio/Audio.a \ @@ -341,12 +337,7 @@ libaddon: exports dvdpcodecs: dllloader $(MAKE) -C lib/libdvd -ifeq (@USE_LIBSTAGEFRIGHT@,1) -dvdpextcodecs: lib@APP_NAME_LC@.so - $(MAKE) -C xbmc/cores/VideoPlayer/DVDCodecs/Video/libstagefrightICS -else dvdpextcodecs: -endif eventclients: ifeq ($(findstring osx,@ARCH@), osx) diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po index dd71d828a4..e3a67f77a8 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -6498,10 +6498,7 @@ msgctxt "#13435" msgid "Enable HQ scalers for scaling above" msgstr "" -#: xbmc/settings/GUISettings.cpp -msgctxt "#13436" -msgid "Allow hardware acceleration - libstagefright" -msgstr "" +#empty string with id 13436 #: system/settings/settings.xml msgctxt "#13437" diff --git a/configure.ac b/configure.ac index a3b3912c51..2fa3b29be0 100644 --- a/configure.ac +++ b/configure.ac @@ -513,7 +513,7 @@ AC_ARG_ENABLE([breakpad], AC_ARG_ENABLE([codec], [AS_HELP_STRING([--enable-codec], - [enable additional codecs from a list of comma separated names, (default is none, choices are amcodec, libstagefright and imxvpu)])], + [enable additional codecs from a list of comma separated names, (default is none, choices are amcodec and imxvpu)])], [add_codecs=$enableval], [add_codecs=no]) @@ -1878,9 +1878,6 @@ for codecs in `echo $add_codecs | sed 's/,/ /g'`; do AC_CHECK_HEADER([amcodec/codec_error.h],, AC_MSG_ERROR($missing_headers)) XB_ADD_CODEC([LIBAMCODEC], [amcodec], [$codecs]) ;; - *libstagefright*) - XB_ADD_CODEC([LIBSTAGEFRIGHT], [libstagefright], [$codecs]) - ;; *imxvpu*) AC_CHECK_HEADER([imx-mm/vpu/vpu_wrapper.h],, AC_MSG_ERROR($missing_headers)) AC_CHECK_LIB([vpu], main, LIBS="$LIBS -lfslvpuwrap -lvpu -lg2d", AC_MSG_ERROR($missing_library)) @@ -2454,10 +2451,6 @@ if test "$use_touch_skin" = "yes"; then OUTPUT_FILES="$OUTPUT_FILES addons/skin.re-touched/media/Makefile" fi -if test "$use_codec_libstagefright" = "yes"; then -OUTPUT_FILES="$OUTPUT_FILES xbmc/cores/VideoPlayer/DVDCodecs/Video/libstagefrightICS/Makefile" -fi - if test "$use_sse4" = "yes"; then OUTPUT_FILES="$OUTPUT_FILES xbmc/linux/sse4/Makefile" fi diff --git a/system/settings/android.xml b/system/settings/android.xml index 78123c75ba..dd218071a5 100644 --- a/system/settings/android.xml +++ b/system/settings/android.xml @@ -17,15 +17,6 @@ </category> <category id="videoacceleration"> <group id="3"> - <setting id="videoplayer.usestagefright" type="boolean" label="13436" help="36260"> - <requirement>HAVE_LIBSTAGEFRIGHTDECODER</requirement> - <level>2</level> - <default>true</default> - <updates> - <update type="change" /> - </updates> - <control type="toggle" /> - </setting> <setting id="videoplayer.usemediacodecsurface" type="boolean" label="13440" help="36544"> <visible>HAS_MEDIACODEC</visible> <level>2</level> diff --git a/tools/depends/target/Makefile b/tools/depends/target/Makefile index 080a10212b..c174304c21 100644 --- a/tools/depends/target/Makefile +++ b/tools/depends/target/Makefile @@ -37,7 +37,7 @@ ifeq ($(OS),osx) endif ifeq ($(OS),android) - DEPENDS += mdnsresponder android-sources-ics google-breakpad libuuid + DEPENDS += mdnsresponder google-breakpad libuuid CROSSGUID_DEPS = libuuid endif diff --git a/tools/depends/target/android-sources-ics/Makefile b/tools/depends/target/android-sources-ics/Makefile deleted file mode 100644 index 3b0bf57274..0000000000 --- a/tools/depends/target/android-sources-ics/Makefile +++ /dev/null @@ -1,66 +0,0 @@ -include ../../Makefile.include -DEPS= ../../Makefile.include Makefile -INCLUDES += -I$(PREFIX)/opt/android-source/frameworks/base/include -INCLUDES += -I$(PREFIX)/opt/android-source/frameworks/base/native/include -INCLUDES += -I$(PREFIX)/opt/android-source/frameworks/base/include/media/stagefright -INCLUDES += -I$(PREFIX)/opt/android-source/frameworks/base/include/media/stagefright/openmax -INCLUDES += -I$(PREFIX)/opt/android-source/system/core/include -INCLUDES += -I$(PREFIX)/opt/android-source/libhardware/include - -ANDROID_VERSION=ics-mr0 -ANDROID_SOURCE=android-source -ANDROID_LIBS=android-libs -ARCHIVE=$(ANDROID_SOURCE)-$(ANDROID_VERSION)-extract.tar.gz - -all: .installed-$(PLATFORM) - -.installed-$(PLATFORM): install-sources $(ANDROID_LIBS) - touch $@ - -$(ANDROID_SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE) - cd $(CURDIR) -# git clone --depth=1 --branch $(ANDROID_VERSION) https://android.googlesource.com/platform/frameworks/base $(ANDROID_SOURCE)/frameworks/base -# git clone --depth=1 --branch $(ANDROID_VERSION) https://android.googlesource.com/platform/system/core $(ANDROID_SOURCE)/system/core -# git clone --depth=1 --branch $(ANDROID_VERSION) https://android.googlesource.com/platform/hardware/libhardware $(ANDROID_SOURCE)/libhardware - $(ARCHIVE_TOOL) -xf $(TARBALLS_LOCATION)/$(ARCHIVE) - -$(TARBALLS_LOCATION)/$(ARCHIVE): - echo "Fetching Android system headers" - cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE) - -install-sources: $(ANDROID_SOURCE) - mkdir -p $(PREFIX)/opt - rm -f $(PREFIX)/opt/$(ANDROID_SOURCE) - ln -s $(CURDIR)/$(ANDROID_SOURCE) $(PREFIX)/opt/$(ANDROID_SOURCE) - -$(ANDROID_LIBS): $(PLATFORM)/libstagefright.so $(PLATFORM)/libutils.so $(PLATFORM)/libbinder.so $(PLATFORM)/libcutils.so $(PLATFORM)/libui.so $(PLATFORM)/libgui.so - mkdir -p $(PREFIX)/opt/$(ANDROID_LIBS) - rm -f $(PREFIX)/opt/$(ANDROID_LIBS)/* - cp $(PLATFORM)/libstagefright.so $(PLATFORM)/libutils.so $(PLATFORM)/libbinder.so $(PLATFORM)/libcutils.so $(PLATFORM)/libui.so $(PLATFORM)/libgui.so $(PREFIX)/opt/$(ANDROID_LIBS) - -$(PLATFORM): install-sources - mkdir -p $(PLATFORM) - -$(PLATFORM)/libstagefright.so: $(PLATFORM) $(DEPS) libstagefright.cpp - $(CXX) -Wno-multichar -fno-exceptions -fno-rtti $(INCLUDES) -DHAVE_PTHREADS -shared -o $(PLATFORM)/libstagefright.so libstagefright.cpp - -$(PLATFORM)/libutils.so: $(PLATFORM) $(DEPS) libutils.cpp - $(CXX) -Wno-multichar -fno-exceptions -fno-rtti $(INCLUDES) -shared -o $(PLATFORM)/libutils.so libutils.cpp - -$(PLATFORM)/libbinder.so: $(PLATFORM) $(DEPS) libbinder.cpp - $(CXX) -Wno-multichar -fno-exceptions -fno-rtti $(INCLUDES) -shared -o $(PLATFORM)/libbinder.so libbinder.cpp - -$(PLATFORM)/libcutils.so: $(PLATFORM) $(DEPS) libcutils.c - $(CXX) -Wno-multichar -fno-exceptions -fno-rtti $(INCLUDES) -shared -o $(PLATFORM)/libcutils.so libcutils.c - -$(PLATFORM)/libui.so: $(PLATFORM) $(DEPS) libui.cpp - $(CXX) -Wno-multichar -fno-exceptions -fno-rtti $(INCLUDES) -shared -o $(PLATFORM)/libui.so libui.cpp - -$(PLATFORM)/libgui.so: $(PLATFORM) $(DEPS) libgui.cpp - $(CXX) -Wno-multichar -fno-exceptions -fno-rtti $(INCLUDES) -shared -o $(PLATFORM)/libgui.so libgui.cpp - -clean: - rm -f $(PREFIX)/opt/$(ANDROID_SOURCE) - rm -rf .installed-$(PLATFORM) $(ANDROID_SOURCE) $(PLATFORM) $(ANDROID_LIBS_ARCHIVE) $(ANDROID_LIBS) - -distclean: clean diff --git a/tools/depends/target/android-sources-ics/libbinder.cpp b/tools/depends/target/android-sources-ics/libbinder.cpp deleted file mode 100644 index cb4ecbadb4..0000000000 --- a/tools/depends/target/android-sources-ics/libbinder.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2010-2013 Team XBMC - * http://xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -// --------------------------------------------------------------------------- - -#include <binder/ProcessState.h> - -namespace android { - -sp<ProcessState> ProcessState::self() -{ -} - -void ProcessState::startThreadPool() -{ -} - -ProcessState::ProcessState() -{ -} - -ProcessState::~ProcessState() -{ -} - -}; // namespace android diff --git a/tools/depends/target/android-sources-ics/libcutils.c b/tools/depends/target/android-sources-ics/libcutils.c deleted file mode 100644 index dbb29125ea..0000000000 --- a/tools/depends/target/android-sources-ics/libcutils.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2010-2013 Team XBMC - * http://xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -#include <cutils/atomic.h> - -int32_t android_atomic_dec(volatile int32_t* addr) { - return 0; -} diff --git a/tools/depends/target/android-sources-ics/libgui.cpp b/tools/depends/target/android-sources-ics/libgui.cpp deleted file mode 100644 index d8b6e0ce16..0000000000 --- a/tools/depends/target/android-sources-ics/libgui.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2010-2013 Team XBMC - * http://xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ -#include <gui/SurfaceTexture.h> - -namespace android { - -status_t SurfaceTexture::updateTexImage() -{ - return 0; -} - -void SurfaceTexture::getTransformMatrix(float mtx[16]) {} - -} - diff --git a/tools/depends/target/android-sources-ics/libstagefright.cpp b/tools/depends/target/android-sources-ics/libstagefright.cpp deleted file mode 100644 index 6ab7b91712..0000000000 --- a/tools/depends/target/android-sources-ics/libstagefright.cpp +++ /dev/null @@ -1,381 +0,0 @@ -/* - * Copyright (C) 2010-2013 Team XBMC - * http://xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -#define STAGEFRIGHT_EXPORT __attribute__ ((visibility ("default"))) -#include <media/stagefright/foundation/ABuffer.h> -#include <media/stagefright/DataSource.h> -#include <media/stagefright/MetaData.h> -#include <media/stagefright/MediaBuffer.h> -#include <media/stagefright/MediaBufferGroup.h> -#include <media/stagefright/MediaDebug.h> -#include <media/stagefright/MediaDefs.h> -#include <media/stagefright/MediaExtractor.h> -#include <media/stagefright/OMXClient.h> -#include <media/stagefright/OMXCodec.h> -#include <utils/List.h> -#include <utils/RefBase.h> - -#include <media/stagefright/MediaDefs.h> - -namespace android { - -const char *MEDIA_MIMETYPE_IMAGE_JPEG = "image/jpeg"; - -const char *MEDIA_MIMETYPE_VIDEO_VPX = "video/x-vnd.on2.vp8"; -const char *MEDIA_MIMETYPE_VIDEO_AVC = "video/avc"; -const char *MEDIA_MIMETYPE_VIDEO_MPEG4 = "video/mp4v-es"; -const char *MEDIA_MIMETYPE_VIDEO_H263 = "video/3gpp"; -const char *MEDIA_MIMETYPE_VIDEO_MPEG2 = "video/mpeg2"; -const char *MEDIA_MIMETYPE_VIDEO_RAW = "video/raw"; - -const char *MEDIA_MIMETYPE_AUDIO_AMR_NB = "audio/3gpp"; -const char *MEDIA_MIMETYPE_AUDIO_AMR_WB = "audio/amr-wb"; -const char *MEDIA_MIMETYPE_AUDIO_MPEG = "audio/mpeg"; -const char *MEDIA_MIMETYPE_AUDIO_MPEG_LAYER_I = "audio/mpeg-L1"; -const char *MEDIA_MIMETYPE_AUDIO_MPEG_LAYER_II = "audio/mpeg-L2"; -const char *MEDIA_MIMETYPE_AUDIO_AAC = "audio/mp4a-latm"; -const char *MEDIA_MIMETYPE_AUDIO_QCELP = "audio/qcelp"; -const char *MEDIA_MIMETYPE_AUDIO_VORBIS = "audio/vorbis"; -const char *MEDIA_MIMETYPE_AUDIO_G711_ALAW = "audio/g711-alaw"; -const char *MEDIA_MIMETYPE_AUDIO_G711_MLAW = "audio/g711-mlaw"; -const char *MEDIA_MIMETYPE_AUDIO_RAW = "audio/raw"; -const char *MEDIA_MIMETYPE_AUDIO_FLAC = "audio/flac"; -const char *MEDIA_MIMETYPE_AUDIO_AAC_ADTS = "audio/aac-adts"; - -const char *MEDIA_MIMETYPE_CONTAINER_MPEG4 = "video/mpeg4"; -const char *MEDIA_MIMETYPE_CONTAINER_WAV = "audio/wav"; -const char *MEDIA_MIMETYPE_CONTAINER_OGG = "application/ogg"; -const char *MEDIA_MIMETYPE_CONTAINER_MATROSKA = "video/x-matroska"; -const char *MEDIA_MIMETYPE_CONTAINER_MPEG2TS = "video/mp2ts"; -const char *MEDIA_MIMETYPE_CONTAINER_AVI = "video/avi"; -const char *MEDIA_MIMETYPE_CONTAINER_MPEG2PS = "video/mp2p"; - -const char *MEDIA_MIMETYPE_CONTAINER_WVM = "video/wvm"; -#ifdef QCOM_HARDWARE -const char *MEDIA_MIMETYPE_AUDIO_EVRC = "audio/evrc"; - -const char *MEDIA_MIMETYPE_VIDEO_WMV = "video/x-ms-wmv"; -const char *MEDIA_MIMETYPE_AUDIO_WMA = "audio/x-ms-wma"; -const char *MEDIA_MIMETYPE_CONTAINER_ASF = "video/x-ms-asf"; -const char *MEDIA_MIMETYPE_VIDEO_DIVX = "video/divx"; -const char *MEDIA_MIMETYPE_AUDIO_AC3 = "audio/ac3"; -const char *MEDIA_MIMETYPE_CONTAINER_AAC = "audio/aac"; -const char *MEDIA_MIMETYPE_CONTAINER_QCP = "audio/vnd.qcelp"; -const char *MEDIA_MIMETYPE_VIDEO_DIVX311 = "video/divx311"; -const char *MEDIA_MIMETYPE_VIDEO_DIVX4 = "video/divx4"; -const char *MEDIA_MIMETYPE_CONTAINER_MPEG2 = "video/mp2"; -const char *MEDIA_MIMETYPE_CONTAINER_3G2 = "video/3g2"; -#endif -const char *MEDIA_MIMETYPE_TEXT_3GPP = "text/3gpp-tt"; - -MetaData::MetaData() { -} - -MetaData::MetaData(const MetaData &from) { -} - -MetaData::~MetaData() { -} - -void MetaData::clear() { -} - -bool MetaData::remove(uint32_t key) { - return false; -} - -bool MetaData::setCString(uint32_t key, const char *value) { - return false; -} - -bool MetaData::setInt32(uint32_t key, int32_t value) { - return false; -} - -bool MetaData::setInt64(uint32_t key, int64_t value) { - return false; -} - -bool MetaData::setFloat(uint32_t key, float value) { - return false; -} - -bool MetaData::setPointer(uint32_t key, void *value) { - return false; -} - -bool MetaData::setRect( - uint32_t key, - int32_t left, int32_t top, - int32_t right, int32_t bottom) { - return false; -} - -bool MetaData::findCString(uint32_t key, const char **value) { - return false; -} - -bool MetaData::findInt32(uint32_t key, int32_t *value) { - return false; -} - -bool MetaData::findInt64(uint32_t key, int64_t *value) { - return false; -} - -bool MetaData::findFloat(uint32_t key, float *value) { - return false; -} - -bool MetaData::findPointer(uint32_t key, void **value) { - return false; -} - -bool MetaData::findRect( - uint32_t key, - int32_t *left, int32_t *top, - int32_t *right, int32_t *bottom) { - return false; -} - -bool MetaData::setData( - uint32_t key, uint32_t type, const void *data, size_t size) { - return false; -} - -bool MetaData::findData(uint32_t key, uint32_t *type, - const void **data, size_t *size) const { - return false; -} - -MetaData::typed_data::typed_data() - : mType(0), - mSize(0) { -} - -MetaData::typed_data::~typed_data() { -} - -MetaData::typed_data::typed_data(const typed_data &from) - : mType(from.mType), - mSize(0) { -} - -MetaData::typed_data &MetaData::typed_data::operator=( - const MetaData::typed_data &from) { - return *this; -} - -void MetaData::typed_data::clear() { -} - -void MetaData::typed_data::setData( - uint32_t type, const void *data, size_t size) { -} - -void MetaData::typed_data::getData( - uint32_t *type, const void **data, size_t *size) const { -} - -void MetaData::typed_data::allocateStorage(size_t size) { -} - -void MetaData::typed_data::freeStorage() { -} - -MediaBuffer::MediaBuffer(void *data, size_t size) -{} - -MediaBuffer::MediaBuffer(size_t size) -{} - -MediaBuffer::MediaBuffer(const sp<GraphicBuffer>& graphicBuffer) -{} - -MediaBuffer::MediaBuffer(const sp<ABuffer> &buffer) -{} - -void MediaBuffer::release() { -} - -void MediaBuffer::claim() { -} - -void MediaBuffer::add_ref() { -} - -void *MediaBuffer::data() const { - return 0; -} - -size_t MediaBuffer::size() const { - return 0; -} - -size_t MediaBuffer::range_offset() const { - return 0; -} - -size_t MediaBuffer::range_length() const { - return 0; -} - -void MediaBuffer::set_range(size_t offset, size_t length) { -} - -sp<GraphicBuffer> MediaBuffer::graphicBuffer() const { -} - -sp<MetaData> MediaBuffer::meta_data() { -} - -void MediaBuffer::reset() { -} - -MediaBuffer::~MediaBuffer() { -} - -void MediaBuffer::setObserver(MediaBufferObserver *observer) { -} - -void MediaBuffer::setNextBuffer(MediaBuffer *buffer) { -} - -MediaBuffer *MediaBuffer::nextBuffer() { - return 0; -} - -int MediaBuffer::refcount() const { - return 0; -} - -MediaBuffer *MediaBuffer::clone() { - return 0; -} - -MediaBufferGroup::MediaBufferGroup() {} - -MediaBufferGroup::~MediaBufferGroup() {} - -void MediaBufferGroup::add_buffer(MediaBuffer *buffer) { -} - -status_t MediaBufferGroup::acquire_buffer(MediaBuffer **out) { - return OK; -} - -void MediaBufferGroup::signalBufferReturned(MediaBuffer *) { -} - -MediaSource::MediaSource() {} - -MediaSource::~MediaSource() {} - -MediaSource::MediaSource(const MediaSource &) {} - -MediaSource& MediaSource::operator=(const MediaSource &) {} - -MediaSource::ReadOptions::ReadOptions() { -} - -void MediaSource::ReadOptions::reset() { -} - -void MediaSource::ReadOptions::setSeekTo(int64_t time_us, SeekMode mode) { -} - -void MediaSource::ReadOptions::clearSeekTo() { -} - -bool MediaSource::ReadOptions::getSeekTo( - int64_t *time_us, SeekMode *mode) const { - return false; -} - -void MediaSource::ReadOptions::setLateBy(int64_t lateness_us) { -} - -int64_t MediaSource::ReadOptions::getLateBy() const { - return 0; -} - -status_t -DataSource::getSize(off64_t *size) -{ - return 0; -} - -String8 -DataSource::getMIMEType() const -{ - return String8(); -} - -void -DataSource::RegisterDefaultSniffers() -{ -} - -sp<MediaExtractor> -MediaExtractor::Create(const sp<DataSource> &source, const char *mime) -{ - return 0; -} - -sp<MediaSource> -OMXCodec::Create( - const sp<IOMX> &omx, - const sp<MetaData> &meta, bool createEncoder, - const sp<MediaSource> &source, - const char *matchComponentName, - uint32_t flags, - const sp<ANativeWindow> &nativeWindow) -{ - return 0; -} - -OMXClient::OMXClient() -{ -} - -status_t OMXClient::connect() -{ - return OK; -} - -void OMXClient::disconnect() -{ -} - -class __attribute__ ((visibility ("default"))) UnknownDataSource : public DataSource { -public: -UnknownDataSource(); - -virtual status_t initCheck() const { return 0; } -virtual ssize_t readAt(off64_t offset, void *data, size_t size) { return 0; } -virtual status_t getSize(off64_t *size) { return 0; } - -virtual ~UnknownDataSource() { } -}; - -UnknownDataSource foo; - -UnknownDataSource::UnknownDataSource() { } -} diff --git a/tools/depends/target/android-sources-ics/libui.cpp b/tools/depends/target/android-sources-ics/libui.cpp deleted file mode 100644 index 84ead6ecc6..0000000000 --- a/tools/depends/target/android-sources-ics/libui.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2010-2013 Team XBMC - * http://xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ -#include <ui/FramebufferNativeWindow.h> -#include <ui/GraphicBuffer.h> -#include <ui/PixelFormat.h> -#include <EGL/egl.h> - -using namespace android; - -ANativeWindowBuffer* GraphicBuffer::getNativeBuffer() const -{ - return NULL; -} - -namespace android { -ssize_t bytesPerPixel(PixelFormat format) -{ - return 0; -} -} diff --git a/tools/depends/target/android-sources-ics/libutils.cpp b/tools/depends/target/android-sources-ics/libutils.cpp deleted file mode 100644 index 2daef9352a..0000000000 --- a/tools/depends/target/android-sources-ics/libutils.cpp +++ /dev/null @@ -1,333 +0,0 @@ -/* - * Copyright (C) 2010-2013 Team XBMC - * http://xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -#include "utils/RefBase.h" -#include "utils/String16.h" -#include "utils/String8.h" -#include "utils/VectorImpl.h" -#include "utils/Unicode.h" - -extern "C" { - -int strzcmp16(const char16_t *s1, size_t n1, const char16_t *s2, size_t n2) -{ - return 0; -} - -} - -namespace android { -RefBase::RefBase() : mRefs(0) -{ -} - -RefBase::~RefBase() -{ -} - -void RefBase::incStrong(const void *id) const -{ -} - -void RefBase::decStrong(const void *id) const -{ -} - -void RefBase::onFirstRef() -{ -} - -void RefBase::onLastStrongRef(const void* id) -{ -} - -bool RefBase::onIncStrongAttempted(uint32_t flags, const void* id) -{ - return false; -} - -void RefBase::onLastWeakRef(void const* id) -{ -} - -String16::String16() -{ -} - -String16::String16(String16 const&) -{ -} - -String16::String16(char const*) -{ -} - -String16::~String16() -{ -} - -String8::String8() -{ -} - -String8::~String8() -{ -} - -VectorImpl::VectorImpl(size_t itemSize, uint32_t flags) - : mFlags(flags), mItemSize(itemSize) -{ -} - -VectorImpl::VectorImpl(const VectorImpl& rhs) - : mFlags(rhs.mFlags), mItemSize(rhs.mItemSize) -{ -} - -VectorImpl::~VectorImpl() -{ -} - -VectorImpl& VectorImpl::operator = (const VectorImpl& rhs) -{ -} - -void* VectorImpl::editArrayImpl() -{ -} - -size_t VectorImpl::capacity() const -{ - return 0; -} - -ssize_t VectorImpl::insertVectorAt(const VectorImpl& vector, size_t index) -{ - return 0; -} - -ssize_t VectorImpl::appendVector(const VectorImpl& vector) -{ - return 0; -} - -ssize_t VectorImpl::insertArrayAt(const void* array, size_t index, size_t length) -{ - return 0; -} - -ssize_t VectorImpl::appendArray(const void* array, size_t length) -{ - return 0; -} - -ssize_t VectorImpl::insertAt(size_t index, size_t numItems) -{ - return 0; -} - -ssize_t VectorImpl::insertAt(const void* item, size_t index, size_t numItems) -{ - return 0; -} - -static int sortProxy(const void* lhs, const void* rhs, void* func) -{ - return 0; -} - -status_t VectorImpl::sort(VectorImpl::compar_t cmp) -{ - return 0; -} - -status_t VectorImpl::sort(VectorImpl::compar_r_t cmp, void* state) -{ - return 0; -} - -void VectorImpl::pop() -{ -} - -void VectorImpl::push() -{ -} - -void VectorImpl::push(const void* item) -{ -} - -ssize_t VectorImpl::add() -{ - return 0; -} - -ssize_t VectorImpl::add(const void* item) -{ - return 0; -} - -ssize_t VectorImpl::replaceAt(size_t index) -{ - return 0; -} - -ssize_t VectorImpl::replaceAt(const void* prototype, size_t index) -{ - return 0; -} - -ssize_t VectorImpl::removeItemsAt(size_t index, size_t count) -{ - return 0; -} - -void VectorImpl::finish_vector() -{ -} - -void VectorImpl::clear() -{ -} - -void* VectorImpl::editItemLocation(size_t index) -{ - return 0; -} - -const void* VectorImpl::itemLocation(size_t index) const -{ - return 0; -} - -ssize_t VectorImpl::setCapacity(size_t new_capacity) -{ - return 0; -} - -void VectorImpl::release_storage() -{ -} - -void* VectorImpl::_grow(size_t where, size_t amount) -{ - return 0; -} - -void VectorImpl::_shrink(size_t where, size_t amount) -{ -} - -size_t VectorImpl::itemSize() const { - return 0; -} - -void VectorImpl::_do_construct(void* storage, size_t num) const -{ -} - -void VectorImpl::_do_destroy(void* storage, size_t num) const -{ -} - -void VectorImpl::_do_copy(void* dest, const void* from, size_t num) const -{ -} - -void VectorImpl::_do_splat(void* dest, const void* item, size_t num) const { -} - -void VectorImpl::_do_move_forward(void* dest, const void* from, size_t num) const { -} - -void VectorImpl::_do_move_backward(void* dest, const void* from, size_t num) const { -} - -void VectorImpl::reservedVectorImpl1() { } -void VectorImpl::reservedVectorImpl2() { } -void VectorImpl::reservedVectorImpl3() { } -void VectorImpl::reservedVectorImpl4() { } -void VectorImpl::reservedVectorImpl5() { } -void VectorImpl::reservedVectorImpl6() { } -void VectorImpl::reservedVectorImpl7() { } -void VectorImpl::reservedVectorImpl8() { } - -/*****************************************************************************/ - -SortedVectorImpl::SortedVectorImpl(size_t itemSize, uint32_t flags) - : VectorImpl(itemSize, flags) -{ -} - -SortedVectorImpl::SortedVectorImpl(const VectorImpl& rhs) -: VectorImpl(rhs) -{ -} - -SortedVectorImpl::~SortedVectorImpl() -{ -} - -ssize_t SortedVectorImpl::indexOf(const void* item) const -{ - return 0; -} - -size_t SortedVectorImpl::orderOf(const void* item) const -{ - return 0; -} - -ssize_t SortedVectorImpl::_indexOrderOf(const void* item, size_t* order) const -{ - return 0; -} - -ssize_t SortedVectorImpl::add(const void* item) -{ - return 0; -} - -ssize_t SortedVectorImpl::merge(const VectorImpl& vector) -{ - return 0; -} - -ssize_t SortedVectorImpl::merge(const SortedVectorImpl& vector) -{ - return 0; -} - -ssize_t SortedVectorImpl::remove(const void* item) -{ - return 0; -} - -void SortedVectorImpl::reservedSortedVectorImpl1() { }; -void SortedVectorImpl::reservedSortedVectorImpl2() { }; -void SortedVectorImpl::reservedSortedVectorImpl3() { }; -void SortedVectorImpl::reservedSortedVectorImpl4() { }; -void SortedVectorImpl::reservedSortedVectorImpl5() { }; -void SortedVectorImpl::reservedSortedVectorImpl6() { }; -void SortedVectorImpl::reservedSortedVectorImpl7() { }; -void SortedVectorImpl::reservedSortedVectorImpl8() { }; - -} diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp index 0217c35991..0d55f487e7 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -1494,7 +1494,8 @@ bool CApplication::OnSettingUpdate(CSetting* &setting, const char *oldSettingId, } #endif #if defined(TARGET_ANDROID) - if (setting->GetId() == CSettings::SETTING_VIDEOPLAYER_USESTAGEFRIGHT) + // TODO:Handle stf removed + if (setting->GetId( == CSettings::SETTING_VIDEOPLAYER_USESTAGEFRIGHT) { CSettingBool *usestagefright = (CSettingBool*)setting; return usestagefright->SetValue(false); diff --git a/xbmc/DllPaths_generated_android.h.in b/xbmc/DllPaths_generated_android.h.in index 3eb51ce2f2..13451cfd7e 100644 --- a/xbmc/DllPaths_generated_android.h.in +++ b/xbmc/DllPaths_generated_android.h.in @@ -46,7 +46,6 @@ #define DLL_PATH_LIBASS "@ASS_SONAME@" #define DLL_PATH_LIBDVDNAV "libdvdnav-@ARCH@.so" #define DLL_PATH_LIBMPEG2 "@MPEG2_SONAME@" -#define DLL_PATH_LIBSTAGEFRIGHTICS "libXBMCvcodec_stagefrightICS-@ARCH@.so" /* libbluray */ #define DLL_PATH_LIBBLURAY "@BLURAY_SONAME@" diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.cpp index 409463d8dc..421d44b682 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.cpp +++ b/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.cpp @@ -41,7 +41,6 @@ #include "Video/DVDVideoCodecIMX.h" #endif #include "Video/MMALCodec.h" -#include "Video/DVDVideoCodecStageFright.h" #if defined(HAS_LIBAMCODEC) #include "utils/AMLUtils.h" #include "Video/DVDVideoCodecAmlogic.h" @@ -169,11 +168,6 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, const C #elif defined(TARGET_POSIX) hwSupport += "OpenMax:no "; #endif -#if defined(HAS_LIBSTAGEFRIGHT) - hwSupport += "libstagefright:yes "; -#elif defined(_LINUX) - hwSupport += "libstagefright:no "; -#endif #if defined(HAVE_LIBVDPAU) && defined(TARGET_POSIX) hwSupport += "VDPAU:yes "; #elif defined(TARGET_POSIX) && !defined(TARGET_DARWIN) @@ -324,27 +318,6 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, const C } #endif -#if defined(HAS_LIBSTAGEFRIGHT) - if (!hint.software && CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_USESTAGEFRIGHT)) - { - switch(hint.codec) - { - case AV_CODEC_ID_MPEG4: - case AV_CODEC_ID_MSMPEG4V2: - case AV_CODEC_ID_MSMPEG4V3: - case AV_CODEC_ID_MPEG1VIDEO: - case AV_CODEC_ID_MPEG2VIDEO: - // Avoid h/w decoder for SD; Those files might use features - // not supported and can easily be soft-decoded - if (hint.width <= 800) - break; - default: - if ( (pCodec = OpenCodec(new CDVDVideoCodecStageFright(), hint, options)) ) return pCodec; - } - } -#endif - - // try to decide if we want to try halfres decoding #if !defined(TARGET_POSIX) && !defined(TARGET_WINDOWS) float pixelrate = (float)hint.width*hint.height*hint.fpsrate/hint.fpsscale; diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h index 63a8637373..73b858b795 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h @@ -51,11 +51,9 @@ namespace VDPAU { class CVdpauRenderPicture; } class COpenMax; class COpenMaxVideo; struct OpenMaxVideoBufferHolder; -class CDVDVideoCodecStageFright; class CDVDMediaCodecInfo; class CDVDVideoCodecIMXBuffer; class CMMALVideoBuffer; -typedef void* EGLImageKHR; // should be entirely filled by all codecs @@ -90,11 +88,6 @@ struct DVDVideoPicture }; struct { - CDVDVideoCodecStageFright* stf; - EGLImageKHR eglimg; - }; - - struct { CDVDMediaCodecInfo *mediacodec; }; diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecStageFright.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecStageFright.cpp deleted file mode 100644 index 8a23753fef..0000000000 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecStageFright.cpp +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Copyright (C) 2013 Team XBMC - * http://xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -//#define DEBUG_VERBOSE 1 - -#if (defined HAVE_CONFIG_H) && (!defined TARGET_WINDOWS) -#include "config.h" -#elif defined(TARGET_WINDOWS) -#include "system.h" -#endif - -#if defined(HAS_LIBSTAGEFRIGHT) -#include "DVDClock.h" -#include "settings/Settings.h" -#include "DVDStreamInfo.h" -#include "DVDVideoCodecStageFright.h" -#include "utils/log.h" -#include "Application.h" -#include "messaging/ApplicationMessenger.h" -#include "windowing/WindowingFactory.h" -#include "settings/AdvancedSettings.h" - -#include "DllLibStageFrightCodec.h" - -#define CLASSNAME "CDVDVideoCodecStageFright" - -using namespace KODI::MESSAGING; -//////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////// - -DllLibStageFrightCodec* CDVDVideoCodecStageFright::m_stf_dll = NULL; - -CDVDVideoCodecStageFright::CDVDVideoCodecStageFright() - : CDVDVideoCodec() - , m_convert_bitstream(false), m_converter(NULL) - , m_stf_handle(NULL) -{ - m_pFormatName = "stf-xxxx"; - - if (!m_stf_dll) - m_stf_dll = new DllLibStageFrightCodec; -} - -CDVDVideoCodecStageFright::~CDVDVideoCodecStageFright() -{ - Dispose(); -} - -bool CDVDVideoCodecStageFright::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) -{ - // we always qualify even if DVDFactoryCodec does this too. - if (CSettings::GetInstance().GetBool("videoplayer.usestagefright") && !hints.software) - { - m_convert_bitstream = false; - CLog::Log(LOGDEBUG, - "%s::%s - trying to open, codec(%d), profile(%d), level(%d)", - CLASSNAME, __func__, hints.codec, hints.profile, hints.level); - - switch (hints.codec) - { - case AV_CODEC_ID_H264: - switch(hints.profile) - { - case FF_PROFILE_H264_HIGH_10: - case FF_PROFILE_H264_HIGH_10_INTRA: - // No known h/w decoder supporting Hi10P - return false; - } - m_pFormatName = "stf-h264"; - if (hints.extrasize < 7 || hints.extradata == NULL) - { - CLog::Log(LOGNOTICE, - "%s::%s - avcC data too small or missing", CLASSNAME, __func__); - return false; - } - m_converter = new CBitstreamConverter(); - m_convert_bitstream = m_converter->Open(hints.codec, (uint8_t *)hints.extradata, hints.extrasize, true); - - break; - case AV_CODEC_ID_HEVC: - m_pFormatName = "stf-h265"; - if (hints.extrasize < 22 || hints.extradata == NULL) - { - CLog::Log(LOGNOTICE, - "%s::%s - hvcC data too small or missing", CLASSNAME, __func__); - return false; - } - m_converter = new CBitstreamConverter(); - m_convert_bitstream = m_converter->Open(hints.codec, (uint8_t *)hints.extradata, hints.extrasize, true); - - break; - case CODEC_ID_MPEG2VIDEO: - m_pFormatName = "stf-mpeg2"; - break; - case CODEC_ID_MPEG4: - m_pFormatName = "stf-mpeg4"; - break; - case CODEC_ID_VP3: - case CODEC_ID_VP6: - case CODEC_ID_VP6F: - case CODEC_ID_VP8: - m_pFormatName = "stf-vpx"; - break; - case AV_CODEC_ID_VP9: - m_pFormatName = "stf-vp9"; - break; - case AV_CODEC_ID_WMV3: - m_pFormatName = "stf-wmv"; - break; - case AV_CODEC_ID_VC1: - m_pFormatName = "stf-vc1"; - break; - default: - return false; - break; - } - - if (!(m_stf_dll && m_stf_dll->Load())) - return false; - m_stf_dll->EnableDelayedUnload(false); - - m_stf_handle = m_stf_dll->create_stf(&g_application, &CApplicationMessenger::GetInstance(), &g_Windowing, &g_advancedSettings); - - if (!m_stf_dll->stf_Open(m_stf_handle, hints)) - { - CLog::Log(LOGERROR, - "%s::%s - failed to open, codec(%d), profile(%d), level(%d)", - CLASSNAME, __func__, hints.codec, hints.profile, hints.level); - Dispose(); - return false; - } - - return true; - } - - return false; -} - -void CDVDVideoCodecStageFright::Dispose() -{ - if (m_converter) - { - m_converter->Close(); - delete m_converter; - m_converter = NULL; - } - if (m_stf_handle) - { - m_stf_dll->stf_Dispose(m_stf_handle); - m_stf_dll->destroy_stf(m_stf_handle); - m_stf_handle = NULL; - } -} - -void CDVDVideoCodecStageFright::SetDropState(bool bDrop) -{ - m_stf_dll->stf_SetDropState(m_stf_handle, bDrop); -} - -int CDVDVideoCodecStageFright::Decode(uint8_t *pData, int iSize, double dts, double pts) -{ -#if defined(DEBUG_VERBOSE) - unsigned int time = XbmcThreads::SystemClockMillis(); -#endif - int rtn; - int demuxer_bytes = iSize; - uint8_t *demuxer_content = pData; - - if (m_convert_bitstream && demuxer_content) - { - // convert demuxer packet from bitstream to bytestream (AnnexB) - if (m_converter->Convert(demuxer_content, demuxer_bytes)) - { - demuxer_content = m_converter->GetConvertBuffer(); - demuxer_bytes = m_converter->GetConvertSize(); - } - else - CLog::Log(LOGERROR,"%s::%s - bitstream_convert error", CLASSNAME, __func__); - } -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, ">>> decode conversion - tm:%d\n", XbmcThreads::SystemClockMillis() - time); -#endif - - rtn = m_stf_dll->stf_Decode(m_stf_handle, demuxer_content, demuxer_bytes, dts, pts); - - return rtn; -} - -void CDVDVideoCodecStageFright::Reset(void) -{ - m_stf_dll->stf_Reset(m_stf_handle); -} - -bool CDVDVideoCodecStageFright::GetPicture(DVDVideoPicture* pDvdVideoPicture) -{ - pDvdVideoPicture->stf = this; - return m_stf_dll->stf_GetPicture(m_stf_handle, pDvdVideoPicture); -} - -bool CDVDVideoCodecStageFright::ClearPicture(DVDVideoPicture* pDvdVideoPicture) -{ - return m_stf_dll->stf_ClearPicture(m_stf_handle, pDvdVideoPicture); -} - -void CDVDVideoCodecStageFright::SetSpeed(int iSpeed) -{ - m_stf_dll->stf_SetSpeed(m_stf_handle, iSpeed); -} - -int CDVDVideoCodecStageFright::GetDataSize(void) -{ - return 0; -} - -double CDVDVideoCodecStageFright::GetTimeSize(void) -{ - return 0; -} - -void CDVDVideoCodecStageFright::LockBuffer(EGLImageKHR eglimg) -{ - m_stf_dll->stf_LockBuffer(m_stf_handle, eglimg); -} - -void CDVDVideoCodecStageFright::ReleaseBuffer(EGLImageKHR eglimg) -{ - m_stf_dll->stf_ReleaseBuffer(m_stf_handle, eglimg); -} - -#endif diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecStageFright.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecStageFright.h deleted file mode 100644 index 5289651817..0000000000 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecStageFright.h +++ /dev/null @@ -1,61 +0,0 @@ -#pragma once -/* - * Copyright (C) 2013 Team XBMC - * http://xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -#if defined(HAS_LIBSTAGEFRIGHT) - -#include "DVDVideoCodec.h" -#include "utils/BitstreamConverter.h" - -class DllLibStageFrightCodec; - -class CDVDVideoCodecStageFright : public CDVDVideoCodec -{ -public: - CDVDVideoCodecStageFright(); - virtual ~CDVDVideoCodecStageFright(); - - // Required overrides - virtual bool Open(CDVDStreamInfo &hints, CDVDCodecOptions &options); - virtual void Dispose(void); - virtual int Decode(uint8_t *pData, int iSize, double dts, double pts); - virtual void Reset(void); - virtual unsigned GetAllowedReferences() { return 2; } - virtual bool GetPicture(DVDVideoPicture *pDvdVideoPicture); - virtual bool ClearPicture(DVDVideoPicture* pDvdVideoPicture); - virtual void SetDropState(bool bDrop); - virtual const char* GetName(void) { return (const char*)m_pFormatName; } - virtual void SetSpeed(int iSpeed); - virtual int GetDataSize(void); - virtual double GetTimeSize(void); - - virtual void LockBuffer(EGLImageKHR eglimg); - virtual void ReleaseBuffer(EGLImageKHR eglimg); - -protected: - const char *m_pFormatName; - bool m_convert_bitstream; - CBitstreamConverter *m_converter; - - static DllLibStageFrightCodec* m_stf_dll; - void * m_stf_handle; -}; - -#endif diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DllLibStageFrightCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DllLibStageFrightCodec.h deleted file mode 100644 index 35cb16aa6c..0000000000 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DllLibStageFrightCodec.h +++ /dev/null @@ -1,92 +0,0 @@ -#pragma once - -/* - * Copyright (C) 2013 Team XBMC - * http://xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -#if (defined HAVE_CONFIG_H) && (!defined TARGET_WINDOWS) -#include "config.h" -#endif - -#include "DynamicDll.h" -#include "DVDVideoCodec.h" - -class CApplication; -class CWinSystemEGL; -class CAdvancedSettings; - -namespace KODI -{ - namespace MESSAGING - { - class CApplicationMessenger; - } -} - -class DllLibStageFrightCodecInterface -{ -public: - virtual ~DllLibStageFrightCodecInterface() {} - - virtual void* create_stf(CApplication* application, KODI::MESSAGING::CApplicationMessenger* applicationMessenger, CWinSystemEGL* windowing, CAdvancedSettings* advsettings)=0; - virtual void destroy_stf(void*)=0; - - virtual bool stf_Open(void*, CDVDStreamInfo &hints) = 0; - virtual void stf_Dispose(void*) = 0; - virtual int stf_Decode(void*, uint8_t *pData, int iSize, double dts, double pts) = 0; - virtual void stf_Reset(void*) = 0; - virtual bool stf_GetPicture(void*, DVDVideoPicture *pDvdVideoPicture) = 0; - virtual bool stf_ClearPicture(void*, DVDVideoPicture* pDvdVideoPicture) = 0; - virtual void stf_SetDropState(void*, bool bDrop) = 0; - virtual void stf_SetSpeed(void*, int iSpeed) = 0; - - virtual void stf_LockBuffer(void*, EGLImageKHR eglimg) = 0; - virtual void stf_ReleaseBuffer(void*, EGLImageKHR eglimg) = 0; -}; - -class DllLibStageFrightCodec : public DllDynamic, DllLibStageFrightCodecInterface -{ - DECLARE_DLL_WRAPPER(DllLibStageFrightCodec, DLL_PATH_LIBSTAGEFRIGHTICS) - DEFINE_METHOD4(void*, create_stf, (CApplication* p1, KODI::MESSAGING::CApplicationMessenger* p2, CWinSystemEGL* p3, CAdvancedSettings* p4)) - DEFINE_METHOD1(void, destroy_stf, (void* p1)) - DEFINE_METHOD2(bool, stf_Open, (void* p1, CDVDStreamInfo &p2)) - DEFINE_METHOD1(void, stf_Dispose, (void* p1)) - DEFINE_METHOD5(int, stf_Decode, (void* p1, uint8_t *p2, int p3, double p4, double p5)) - DEFINE_METHOD1(void, stf_Reset, (void* p1)) - DEFINE_METHOD2(bool, stf_GetPicture, (void* p1, DVDVideoPicture * p2)) - DEFINE_METHOD2(bool, stf_ClearPicture, (void* p1, DVDVideoPicture * p2)) - DEFINE_METHOD2(void, stf_SetDropState, (void* p1, bool p2)) - DEFINE_METHOD2(void, stf_SetSpeed, (void* p1, int p2)) - DEFINE_METHOD2(void, stf_LockBuffer, (void* p1, EGLImageKHR p2)) - DEFINE_METHOD2(void, stf_ReleaseBuffer, (void* p1, EGLImageKHR p2)) - BEGIN_METHOD_RESOLVE() - RESOLVE_METHOD(create_stf) - RESOLVE_METHOD(destroy_stf) - RESOLVE_METHOD(stf_Open) - RESOLVE_METHOD(stf_Dispose) - RESOLVE_METHOD(stf_Decode) - RESOLVE_METHOD(stf_Reset) - RESOLVE_METHOD(stf_GetPicture) - RESOLVE_METHOD(stf_ClearPicture) - RESOLVE_METHOD(stf_SetDropState) - RESOLVE_METHOD(stf_SetSpeed) - RESOLVE_METHOD(stf_LockBuffer) - RESOLVE_METHOD(stf_ReleaseBuffer) - END_METHOD_RESOLVE() -}; diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/Makefile.in b/xbmc/cores/VideoPlayer/DVDCodecs/Video/Makefile.in index b05184022d..b8f6056e2b 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/Makefile.in +++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/Makefile.in @@ -33,9 +33,6 @@ endif ifeq (@USE_ANDROID@,1) SRCS += DVDVideoCodecAndroidMediaCodec.cpp endif -ifeq (@USE_LIBSTAGEFRIGHT@,1) -SRCS += DVDVideoCodecStageFright.cpp -endif ifeq (@USE_MMAL@,1) SRCS += MMALCodec.cpp diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/libstagefrightICS/Makefile.in b/xbmc/cores/VideoPlayer/DVDCodecs/Video/libstagefrightICS/Makefile.in deleted file mode 100644 index 4f2d6386e0..0000000000 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/libstagefrightICS/Makefile.in +++ /dev/null @@ -1,49 +0,0 @@ -ARCH=@ARCH@ - -INCLUDES+=-I@abs_top_srcdir@/xbmc/cores/VideoPlayer -INCLUDES+=-I.. - -SRCS += StageFrightInterface.cpp -SRCS += StageFrightVideo.cpp -SRCS += StageFrightVideoPrivate.cpp -INCLUDES += -I${prefix}/opt/android-source/frameworks/base/include -INCLUDES += -I${prefix}/opt/android-source/frameworks/base/native/include -INCLUDES += -I${prefix}/opt/android-source/frameworks/base/include/media/stagefright -INCLUDES += -I${prefix}/opt/android-source/frameworks/base/include/media/stagefright/openmax -INCLUDES += -I${prefix}/opt/android-source/system/core/include -INCLUDES += -I${prefix}/opt/android-source/libhardware/include - -LIBNAME=libXBMCvcodec_stagefrightICS -LIB_SHARED=@abs_top_srcdir@/system/players/VideoPlayer/$(LIBNAME)-$(ARCH).so - -LIBS += -landroid -lEGL -lGLESv2 -L${prefix}/opt/android-libs -lstdc++ -lutils -lcutils -lstagefright -lbinder -lui -lgui -L@abs_top_srcdir@ -l@APP_NAME_LC@ - -all: $(LIB_SHARED) - -include @abs_top_srcdir@/Makefile.include --include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS))) - -JNICXXFLAGS = $(CXXFLAGS) -std=gnu++0x -Wextra -STFCXXFLAGS = $(CXXFLAGS) -Wno-multichar -fno-rtti -fPIC - -$(LIB_SHARED): $(OBJS) - $(CXX) $(STFCXXFLAGS) $(LDFLAGS) -shared -Wl,-no-undefined -g -o $(LIB_SHARED) $(OBJS) $(LIBS) - -StageFrightVideo.o: StageFrightVideo.cpp - $(CXX) -MF $*.d -MD -c $(STFCXXFLAGS) $(DEFINES) $(INCLUDES) $< -o $@ - -StageFrightVideoPrivate.o: StageFrightVideoPrivate.cpp - $(CXX) -MF $*.d -MD -c $(STFCXXFLAGS) $(DEFINES) $(INCLUDES) $< -o $@ - -Surface.o: Surface.cpp - $(CXX) -MF $*.d -MD -c $(JNICXXFLAGS) $(DEFINES) $(INCLUDES) $< -o $@ - -SurfaceTexture.o: SurfaceTexture.cpp - $(CXX) -MF $*.d -MD -c $(JNICXXFLAGS) $(DEFINES) $(INCLUDES) $< -o $@ - -CLEAN_FILES = \ - $(LIB_SHARED) \ - -DISTCLEAN_FILES= \ - Makefile \ - diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/libstagefrightICS/StageFrightInterface.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/libstagefrightICS/StageFrightInterface.cpp deleted file mode 100644 index d10a3786ab..0000000000 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/libstagefrightICS/StageFrightInterface.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2013 Team XBMC - * http://xbmc.org - * - * This Program is free software; you can redistfribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distfributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -#include "StageFrightInterface.h" -#include "StageFrightVideo.h" - -#include "windowing/WindowingFactory.h" -#include "settings/AdvancedSettings.h" - -void* create_stf(CApplication* application, KODI::MESSAGING::CApplicationMessenger* applicationMessenger, CWinSystemEGL* windowing, CAdvancedSettings* advsettings) -{ - return (void*)new CStageFrightVideo(application, applicationMessenger, windowing, advsettings); -} - -void destroy_stf(void* stf) -{ - delete (CStageFrightVideo*)stf; -} - -bool stf_Open(void* stf, CDVDStreamInfo &hints) -{ - return ((CStageFrightVideo*)stf)->Open(hints); -} - -void stf_Dispose(void* stf) -{ - ((CStageFrightVideo*)stf)->Dispose(); -} - -int stf_Decode(void* stf, uint8_t *pData, int iSize, double dts, double pts) -{ - return ((CStageFrightVideo*)stf)->Decode(pData, iSize, dts, pts); -} - -void stf_Reset(void* stf) -{ - ((CStageFrightVideo*)stf)->Reset(); -} - -bool stf_GetPicture(void* stf, DVDVideoPicture *pDvdVideoPicture) -{ - return ((CStageFrightVideo*)stf)->GetPicture(pDvdVideoPicture); -} - -bool stf_ClearPicture(void* stf, DVDVideoPicture* pDvdVideoPicture) -{ - return ((CStageFrightVideo*)stf)->ClearPicture(pDvdVideoPicture); -} - -void stf_SetDropState(void* stf, bool bDrop) -{ - ((CStageFrightVideo*)stf)->SetDropState(bDrop); -} - -void stf_SetSpeed(void* stf, int iSpeed) -{ - ((CStageFrightVideo*)stf)->SetSpeed(iSpeed); -} - -void stf_LockBuffer(void* stf, EGLImageKHR eglimg) -{ - ((CStageFrightVideo*)stf)->LockBuffer(eglimg); -} - -void stf_ReleaseBuffer(void* stf, EGLImageKHR eglimg) -{ - ((CStageFrightVideo*)stf)->ReleaseBuffer(eglimg); -} diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/libstagefrightICS/StageFrightInterface.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/libstagefrightICS/StageFrightInterface.h deleted file mode 100644 index 9b0def2244..0000000000 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/libstagefrightICS/StageFrightInterface.h +++ /dev/null @@ -1,54 +0,0 @@ -#pragma once - -/* - * Copyright (C) 2013 Team XBMC - * http://xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -#include "DVDVideoCodec.h" - -class CStageFrightVideo; -class CApplication; -class CWinSystemEGL; -class CAdvancedSettings; - -namespace KODI -{ - namespace MESSAGING - { - class CApplicationMessenger; - } -} - -extern "C" -{ - void* create_stf(CApplication* application, KODI::MESSAGING::CApplicationMessenger* applicationMessenger, CWinSystemEGL* windowing, CAdvancedSettings* advsettings); - void destroy_stf(void*); - - bool stf_Open(void*, CDVDStreamInfo &hints); - void stf_Dispose(void*); - int stf_Decode(void*, uint8_t *pData, int iSize, double dts, double pts); - void stf_Reset(void*); - bool stf_GetPicture(void*, DVDVideoPicture *pDvdVideoPicture); - bool stf_ClearPicture(void*, DVDVideoPicture* pDvdVideoPicture); - void stf_SetDropState(void*, bool bDrop); - void stf_SetSpeed(void*, int iSpeed); - - void stf_LockBuffer(void*, EGLImageKHR eglimg); - void stf_ReleaseBuffer(void*, EGLImageKHR eglimg); -} diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/libstagefrightICS/StageFrightVideo.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/libstagefrightICS/StageFrightVideo.cpp deleted file mode 100644 index b80637fb66..0000000000 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/libstagefrightICS/StageFrightVideo.cpp +++ /dev/null @@ -1,966 +0,0 @@ -/* - * Copyright (C) 2013 Team XBMC - * http://xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ -/***************************************************************************/ - -//#define DEBUG_VERBOSE 1 - -#include "system.h" -#include "system_gl.h" - -#include "StageFrightVideo.h" -#include "StageFrightVideoPrivate.h" - -#include "guilib/GraphicContext.h" -#include "DVDClock.h" -#include "utils/log.h" -#include "threads/Thread.h" -#include "threads/Event.h" -#include "Application.h" -#include "messaging/ApplicationMessenger.h" -#include "settings/AdvancedSettings.h" -#include "android/jni/Build.h" - -#include "xbmc/guilib/FrameBufferObject.h" - -#include <EGL/egl.h> -#include <EGL/eglext.h> -#include "windowing/egl/EGLWrapper.h" -#include "windowing/WindowingFactory.h" - -#include <new> - -#define OMX_QCOM_COLOR_FormatYVU420SemiPlanar 0x7FA30C00 -#define OMX_TI_COLOR_FormatYUV420PackedSemiPlanar 0x7F000100 - -#define CLASSNAME "CStageFrightVideo" - -#define EGL_NATIVE_BUFFER_ANDROID 0x3140 -#define EGL_IMAGE_PRESERVED_KHR 0x30D2 - -using namespace android; -using namespace KODI::MESSAGING; - -static int64_t pts_dtoi(double pts) -{ - return (int64_t)(pts); -} - -/***********************************************************/ - -class CStageFrightMediaSource : public MediaSource -{ -public: - CStageFrightMediaSource(CStageFrightVideoPrivate *priv, sp<MetaData> meta) - { - p = priv; - source_meta = meta; - } - - virtual sp<MetaData> getFormat() - { - return source_meta; - } - - virtual status_t start(MetaData *params) - { - return OK; - } - - virtual status_t stop() - { - return OK; - } - - virtual status_t read(MediaBuffer **buffer, - const MediaSource::ReadOptions *options) - { - Frame *frame; - status_t ret; - *buffer = NULL; - int64_t time_us = -1; - MediaSource::ReadOptions::SeekMode mode; - - if (options && options->getSeekTo(&time_us, &mode)) - { -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s: reading source(%d): seek:%llu\n", CLASSNAME,p->in_queue.size(), time_us); -#endif - } - else - { -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s: reading source(%d)\n", CLASSNAME,p->in_queue.size()); -#endif - } - - p->in_mutex.lock(); - while (p->in_queue.empty() && p->decode_thread) - p->in_condition.wait(p->in_mutex); - - if (p->in_queue.empty()) - { - p->in_mutex.unlock(); - return VC_ERROR; - } - - std::list<Frame*>::iterator it = p->in_queue.begin(); - frame = *it; - ret = frame->status; - *buffer = frame->medbuf; - - p->in_queue.erase(it); - p->in_mutex.unlock(); - -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, ">>> exiting reading source(%d); pts:%llu\n", p->in_queue.size(),frame->pts); -#endif - - free(frame); - - return ret; - } - -private: - sp<MetaData> source_meta; - CStageFrightVideoPrivate *p; -}; - -/********************************************/ - -class CStageFrightDecodeThread : public CThread -{ -protected: - CStageFrightVideoPrivate *p; - -public: - CStageFrightDecodeThread(CStageFrightVideoPrivate *priv) - : CThread("CStageFrightDecodeThread") - , p(priv) - {} - - void OnStartup() - { - #if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s: entering decode thread\n", CLASSNAME); - #endif - } - - void OnExit() - { - #if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s: exited decode thread\n", CLASSNAME); - #endif - } - - void Process() - { - Frame* frame; - int32_t w, h; - int decode_done = 0; - MediaSource::ReadOptions readopt; - // GLuint texid; - - //SetPriority(THREAD_PRIORITY_ABOVE_NORMAL); - do - { - #if defined(DEBUG_VERBOSE) - unsigned int time = XbmcThreads::SystemClockMillis(); - CLog::Log(LOGDEBUG, "%s: >>> Handling frame\n", CLASSNAME); - #endif - p->cur_frame = NULL; - frame = (Frame*)malloc(sizeof(Frame)); - if (!frame) - { - decode_done = 1; - continue; - } - - frame->eglimg = EGL_NO_IMAGE_KHR; - frame->medbuf = NULL; - if (p->resetting) - { - readopt.setSeekTo(0); - p->resetting = false; - } - frame->status = p->decoder->read(&frame->medbuf, &readopt); - readopt.clearSeekTo(); - - if (frame->status == OK) - { - if (!frame->medbuf->graphicBuffer().get()) // hw buffers - { - if (frame->medbuf->range_length() == 0) - { - CLog::Log(LOGERROR, "%s - Invalid buffer\n", CLASSNAME); - frame->status = VC_ERROR; - decode_done = 1; - frame->medbuf->release(); - frame->medbuf = NULL; - } - else - frame->format = RENDER_FMT_YUV420P; - } - else - frame->format = RENDER_FMT_EGLIMG; - } - - if (frame->status == OK) - { - frame->width = p->width; - frame->height = p->height; - frame->pts = 0; - - sp<MetaData> outFormat = p->decoder->getFormat(); - outFormat->findInt32(kKeyWidth , &w); - outFormat->findInt32(kKeyHeight, &h); - frame->medbuf->meta_data()->findInt64(kKeyTime, &(frame->pts)); - } - else if (frame->status == INFO_FORMAT_CHANGED) - { - int32_t cropLeft, cropTop, cropRight, cropBottom; - sp<MetaData> outFormat = p->decoder->getFormat(); - - outFormat->findInt32(kKeyWidth , &p->width); - outFormat->findInt32(kKeyHeight, &p->height); - - cropLeft = cropTop = cropRight = cropBottom = 0; - if (!outFormat->findRect(kKeyCropRect, &cropLeft, &cropTop, &cropRight, &cropBottom)) - { - p->x = 0; - p->y = 0; - } - else - { - p->x = cropLeft; - p->y = cropTop; - p->width = cropRight - cropLeft + 1; - p->height = cropBottom - cropTop + 1; - } - outFormat->findInt32(kKeyColorFormat, &p->videoColorFormat); - if (!outFormat->findInt32(kKeyStride, &p->videoStride)) - p->videoStride = p->width; - if (!outFormat->findInt32(kKeySliceHeight, &p->videoSliceHeight)) - p->videoSliceHeight = p->height; - -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, ">>> new format col:%d, w:%d, h:%d, sw:%d, sh:%d, ctl:%d,%d; cbr:%d,%d\n", p->videoColorFormat, p->width, p->height, p->videoStride, p->videoSliceHeight, cropTop, cropLeft, cropBottom, cropRight); -#endif - - if (frame->medbuf) - frame->medbuf->release(); - frame->medbuf = NULL; - free(frame); - continue; - } - else - { - CLog::Log(LOGERROR, "%s - decoding error (%d)\n", CLASSNAME,frame->status); - if (frame->medbuf) - frame->medbuf->release(); - frame->medbuf = NULL; - free(frame); - continue; - } - - if (frame->format == RENDER_FMT_EGLIMG) - { - if (!p->eglInitialized) - { - p->InitializeEGL(frame->width, frame->height); - } - else if (p->texwidth != frame->width || p->texheight != frame->height) - { - p->ReleaseEGL(); - p->InitializeEGL(frame->width, frame->height); - } - - ANativeWindowBuffer* graphicBuffer = frame->medbuf->graphicBuffer()->getNativeBuffer(); - native_window_set_buffers_timestamp(p->mVideoNativeWindow.get(), frame->pts * 1000); - int err = p->mVideoNativeWindow.get()->queueBuffer(p->mVideoNativeWindow.get(), graphicBuffer); - if (err == 0) - frame->medbuf->meta_data()->setInt32(kKeyRendered, 1); - frame->medbuf->release(); - frame->medbuf = NULL; - p->UpdateSurfaceTexture(); - - if (!p->drop_state) - { - p->free_mutex.lock(); - - stSlot* cur_slot = p->getFreeSlot(); - if (!cur_slot) - { - CLog::Log(LOGERROR, "STF: No free output buffers\n"); - continue; - } - - p->fbo.BindToTexture(GL_TEXTURE_2D, cur_slot->texid); - p->fbo.BeginRender(); - - glDisable(GL_DEPTH_TEST); - //glClear(GL_COLOR_BUFFER_BIT); - - const GLfloat triangleVertices[] = { - -1.0f, 1.0f, - -1.0f, -1.0f, - 1.0f, -1.0f, - 1.0f, 1.0f, - }; - - glVertexAttribPointer(p->mPositionHandle, 2, GL_FLOAT, GL_FALSE, 0, triangleVertices); - glEnableVertexAttribArray(p->mPositionHandle); - - glUseProgram(p->mPgm); - glUniform1i(p->mTexSamplerHandle, 0); - - glBindTexture(GL_TEXTURE_EXTERNAL_OES, p->mVideoTextureId); - - GLfloat texMatrix[16]; - p->GetSurfaceTextureTransformMatrix(texMatrix); - glUniformMatrix4fv(p->mTexMatrixHandle, 1, GL_FALSE, texMatrix); - - glDrawArrays(GL_TRIANGLE_FAN, 0, 4); - - glBindTexture(GL_TEXTURE_EXTERNAL_OES, 0); - p->fbo.EndRender(); - - glBindTexture(GL_TEXTURE_2D, 0); - - frame->eglimg = cur_slot->eglimg; - p->free_mutex.unlock(); - } - } - - #if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s: >>> pushed OUT frame; w:%d, h:%d, img:%p, tm:%d\n", CLASSNAME, frame->width, frame->height, frame->eglimg, XbmcThreads::SystemClockMillis() - time); - #endif - - p->out_mutex.lock(); - p->cur_frame = frame; - while (p->cur_frame) - p->out_condition.wait(p->out_mutex); - p->out_mutex.unlock(); - } - while (!decode_done && !m_bStop); - - if (p->eglInitialized) - p->ReleaseEGL(); - - } -}; - -/***********************************************************/ - -CStageFrightVideo::CStageFrightVideo(CApplication* application, CApplicationMessenger* applicationMessenger, CWinSystemEGL* windowing, CAdvancedSettings* advsettings) -{ -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s::ctor: %d\n", CLASSNAME, sizeof(CStageFrightVideo)); -#endif - p = new CStageFrightVideoPrivate; - p->m_g_application = application; - p->m_g_applicationMessenger = applicationMessenger; - p->m_g_Windowing = windowing; - p->m_g_advancedSettings = advsettings; -} - -CStageFrightVideo::~CStageFrightVideo() -{ - delete p; -} - -bool CStageFrightVideo::Open(CDVDStreamInfo &hints) -{ -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s::Open\n", CLASSNAME); -#endif - - CSingleLock lock(g_graphicsContext); - - // stagefright crashes with null size. Trap this... - if (!hints.width || !hints.height) - { - CLog::Log(LOGERROR, "%s::%s - %s\n", CLASSNAME, __func__,"null size, cannot handle"); - return false; - } - p->width = hints.width; - p->height = hints.height; - - if (p->m_g_advancedSettings->m_stagefrightConfig.useSwRenderer) - p->quirks |= QuirkSWRender; - - p->meta = new MetaData; - if (p->meta == NULL) - { - CLog::Log(LOGERROR, "%s::%s - %s\n", CLASSNAME, __func__,"cannot allocate MetaData"); - return false; - } - - const char* mimetype; - switch (hints.codec) - { - case AV_CODEC_ID_HEVC: - if (p->m_g_advancedSettings->m_stagefrightConfig.useHEVCcodec == 0) - return false; - mimetype = "video/hevc"; - break; - case CODEC_ID_H264: - if (p->m_g_advancedSettings->m_stagefrightConfig.useAVCcodec == 0) - return false; - mimetype = "video/avc"; - if ( *(char*)hints.extradata == 1 ) - p->meta->setData(kKeyAVCC, kTypeAVCC, hints.extradata, hints.extrasize); - break; - case CODEC_ID_MPEG4: - if (p->m_g_advancedSettings->m_stagefrightConfig.useMP4codec == 0) - return false; - mimetype = "video/mp4v-es"; - break; - case CODEC_ID_MPEG2VIDEO: - if (p->m_g_advancedSettings->m_stagefrightConfig.useMPEG2codec == 0) - return false; - mimetype = "video/mpeg2"; - break; - case CODEC_ID_VP3: - case CODEC_ID_VP6: - case CODEC_ID_VP6F: - if (p->m_g_advancedSettings->m_stagefrightConfig.useVPXcodec == 0) - return false; - mimetype = "video/vp6"; - break; - case CODEC_ID_VP8: - if (p->m_g_advancedSettings->m_stagefrightConfig.useVPXcodec == 0) - return false; - mimetype = "video/x-vnd.on2.vp8"; - break; - case AV_CODEC_ID_VP9: - if (p->m_g_advancedSettings->m_stagefrightConfig.useVPXcodec == 0) - return false; - mimetype = "video/x-vnd.on2.vp9"; - break; - case AV_CODEC_ID_WMV3: - if (p->m_g_advancedSettings->m_stagefrightConfig.useVC1codec == 0) - return false; - mimetype = "video/x-ms-wmv"; - break; - case AV_CODEC_ID_VC1: - if (p->m_g_advancedSettings->m_stagefrightConfig.useVC1codec == 0) - return false; - mimetype = "video/wvc1"; - break; - default: - return false; - break; - } - - p->meta->setCString(kKeyMIMEType, mimetype); - p->meta->setInt32(kKeyWidth, p->width); - p->meta->setInt32(kKeyHeight, p->height); - - android::ProcessState::self()->startThreadPool(); - - p->source = new CStageFrightMediaSource(p, p->meta); - p->client = new OMXClient; - - if (p->source == NULL || p->client == NULL) - { - p->meta = NULL; - p->source = NULL; - p->decoder = NULL; - CLog::Log(LOGERROR, "%s::%s - %s\n", CLASSNAME, __func__,"Cannot obtain source / client"); - return false; - } - - if (p->client->connect() != OK) - { - p->meta = NULL; - p->source = NULL; - delete p->client; - p->client = NULL; - CLog::Log(LOGERROR, "%s::%s - %s\n", CLASSNAME, __func__,"Cannot connect OMX client"); - return false; - } - - if ((p->quirks & QuirkSWRender) == 0) - if (!p->InitSurfaceTexture()) - { - p->meta = NULL; - p->source = NULL; - delete p->client; - p->client = NULL; - CLog::Log(LOGERROR, "%s::%s - %s\n", CLASSNAME, __func__,"Cannot allocate texture"); - return false; - } - - p->decoder = OMXCodec::Create(p->client->interface(), p->meta, - false, p->source, NULL, - OMXCodec::kHardwareCodecsOnly | (p->quirks & QuirkSWRender ? OMXCodec::kClientNeedsFramebuffer : 0), - p->mVideoNativeWindow - ); - - if (!(p->decoder != NULL && p->decoder->start() == OK)) - { - p->meta = NULL; - p->source = NULL; - p->decoder = NULL; - return false; - } - - sp<MetaData> outFormat = p->decoder->getFormat(); - - if (!outFormat->findInt32(kKeyWidth, &p->width) || !outFormat->findInt32(kKeyHeight, &p->height) - || !outFormat->findInt32(kKeyColorFormat, &p->videoColorFormat)) - { - p->meta = NULL; - p->source = NULL; - p->decoder = NULL; - return false; - } - - const char *component; - if (outFormat->findCString(kKeyDecoderComponent, &component)) - { - CLog::Log(LOGDEBUG, "%s::%s - component: %s\n", CLASSNAME, __func__, component); - - //Blacklist - if (!strncmp(component, "OMX.google", 10)) - { - // On some platforms, software decoders are returned anyway - CLog::Log(LOGERROR, "%s::%s - %s\n", CLASSNAME, __func__,"Blacklisted component (software)"); - return false; - } - else if (!strncmp(component, "OMX.Nvidia.mp4.decode", 21) && p->m_g_advancedSettings->m_stagefrightConfig.useMP4codec != 1) - { - // Has issues with some XVID encoded MP4. Only fails after actual decoding starts... - CLog::Log(LOGERROR, "%s::%s - %s\n", CLASSNAME, __func__,"Blacklisted component (MP4)"); - return false; - } - } - - int32_t cropLeft, cropTop, cropRight, cropBottom; - cropLeft = cropTop = cropRight = cropBottom = 0; - if (!outFormat->findRect(kKeyCropRect, &cropLeft, &cropTop, &cropRight, &cropBottom)) - { - p->x = 0; - p->y = 0; - } - else - { - p->x = cropLeft; - p->y = cropTop; - p->width = cropRight - cropLeft + 1; - p->height = cropBottom - cropTop + 1; - } - - if (!outFormat->findInt32(kKeyStride, &p->videoStride)) - p->videoStride = p->width; - if (!outFormat->findInt32(kKeySliceHeight, &p->videoSliceHeight)) - p->videoSliceHeight = p->height; - - for (int i=0; i<INBUFCOUNT; ++i) - { - p->inbuf[i] = new MediaBuffer(300000); - p->inbuf[i]->setObserver(p); - } - - p->decode_thread = new CStageFrightDecodeThread(p); - p->decode_thread->Create(true /*autodelete*/); - -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, ">>> format col:%d, w:%d, h:%d, sw:%d, sh:%d, ctl:%d,%d; cbr:%d,%d\n", p->videoColorFormat, p->width, p->height, p->videoStride, p->videoSliceHeight, cropTop, cropLeft, cropBottom, cropRight); -#endif - - return true; -} - -/*** Decode ***/ -int CStageFrightVideo::Decode(uint8_t *pData, int iSize, double dts, double pts) -{ -#if defined(DEBUG_VERBOSE) - unsigned int time = XbmcThreads::SystemClockMillis(); - CLog::Log(LOGDEBUG, "%s::Decode - d:%p; s:%d; dts:%f; pts:%f\n", CLASSNAME, pData, iSize, dts, pts); -#endif - - Frame *frame; - int demuxer_bytes = iSize; - uint8_t *demuxer_content = pData; - int ret = 0; - - if (demuxer_content) - { - frame = (Frame*)malloc(sizeof(Frame)); - if (!frame) - return VC_ERROR; - - frame->status = OK; - if (p->m_g_advancedSettings->m_stagefrightConfig.useInputDTS) - frame->pts = (dts != DVD_NOPTS_VALUE) ? pts_dtoi(dts) : ((pts != DVD_NOPTS_VALUE) ? pts_dtoi(pts) : 0); - else - frame->pts = (pts != DVD_NOPTS_VALUE) ? pts_dtoi(pts) : ((dts != DVD_NOPTS_VALUE) ? pts_dtoi(dts) : 0); - - // No valid pts? libstagefright asserts on this. - if (frame->pts < 0) - { - free(frame); - return ret; - } - - frame->medbuf = p->getBuffer(demuxer_bytes); - if (!frame->medbuf) - { - CLog::Log(LOGWARNING, "STF: Cannot get input buffer\n"); - free(frame); - return VC_ERROR; - } - - memcpy(frame->medbuf->data(), demuxer_content, demuxer_bytes); - frame->medbuf->set_range(0, demuxer_bytes); - frame->medbuf->meta_data()->clear(); - frame->medbuf->meta_data()->setInt64(kKeyTime, frame->pts); - - p->in_mutex.lock(); - p->in_queue.push_back(frame); - p->in_condition.notify(); - p->in_mutex.unlock(); - } - - if (p->inputBufferAvailable() && p->in_queue.size() < INBUFCOUNT) - ret |= VC_BUFFER; - else - usleep(1000); - if (p->cur_frame != NULL) - ret |= VC_PICTURE; -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s::Decode: pushed IN frame (%d); tm:%d\n", CLASSNAME,p->in_queue.size(), XbmcThreads::SystemClockMillis() - time); -#endif - - return ret; -} - -bool CStageFrightVideo::ClearPicture(DVDVideoPicture* pDvdVideoPicture) -{ - #if defined(DEBUG_VERBOSE) - unsigned int time = XbmcThreads::SystemClockMillis(); -#endif - if (pDvdVideoPicture->format == RENDER_FMT_EGLIMG && pDvdVideoPicture->eglimg != EGL_NO_IMAGE_KHR) - ReleaseBuffer(pDvdVideoPicture->eglimg); - - if (p->prev_frame) { - if (p->prev_frame->medbuf) - p->prev_frame->medbuf->release(); - free(p->prev_frame); - p->prev_frame = NULL; - } -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s::ClearPicture (%d)\n", CLASSNAME, XbmcThreads::SystemClockMillis() - time); -#endif - - return true; -} - -bool CStageFrightVideo::GetPicture(DVDVideoPicture* pDvdVideoPicture) -{ -#if defined(DEBUG_VERBOSE) - unsigned int time = XbmcThreads::SystemClockMillis(); - CLog::Log(LOGDEBUG, "%s::GetPicture\n", CLASSNAME); - if (p->cycle_time != 0) - CLog::Log(LOGDEBUG, ">>> cycle dur:%d\n", XbmcThreads::SystemClockMillis() - p->cycle_time); - p->cycle_time = time; -#endif - - status_t status; - - p->out_mutex.lock(); - if (!p->cur_frame) - { - CLog::Log(LOGERROR, "%s::%s - Error getting frame\n", CLASSNAME, __func__); - p->out_condition.notify(); - p->out_mutex.unlock(); - return false; - } - - Frame *frame = p->cur_frame; - status = frame->status; - - pDvdVideoPicture->format = frame->format; - pDvdVideoPicture->dts = DVD_NOPTS_VALUE; - pDvdVideoPicture->pts = frame->pts; - pDvdVideoPicture->iWidth = frame->width; - pDvdVideoPicture->iHeight = frame->height; - pDvdVideoPicture->iDisplayWidth = frame->width; - pDvdVideoPicture->iDisplayHeight = frame->height; - pDvdVideoPicture->iFlags = DVP_FLAG_ALLOCATED; - pDvdVideoPicture->eglimg = EGL_NO_IMAGE_KHR; - - if (status != OK) - { - CLog::Log(LOGERROR, "%s::%s - Error getting picture from frame(%d)\n", CLASSNAME, __func__,status); - if (frame->medbuf) { - frame->medbuf->release(); - } - free(frame); - p->cur_frame = NULL; - p->out_condition.notify(); - p->out_mutex.unlock(); - return false; - } - - if (pDvdVideoPicture->format == RENDER_FMT_EGLIMG) - { - pDvdVideoPicture->eglimg = frame->eglimg; - if (pDvdVideoPicture->eglimg == EGL_NO_IMAGE_KHR) - pDvdVideoPicture->iFlags |= DVP_FLAG_DROPPED; - else - LockBuffer(pDvdVideoPicture->eglimg); - #if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, ">>> pic dts:%f, pts:%llu, img:%p, tm:%d\n", pDvdVideoPicture->dts, frame->pts, pDvdVideoPicture->eglimg, XbmcThreads::SystemClockMillis() - time); - #endif - } - else if (pDvdVideoPicture->format == RENDER_FMT_YUV420P) - { - pDvdVideoPicture->color_range = 0; - pDvdVideoPicture->color_matrix = 4; - - unsigned int luma_pixels = frame->width * frame->height; - unsigned int chroma_pixels = luma_pixels/4; - uint8_t* data = NULL; - if (frame->medbuf && !p->drop_state) - { - data = (uint8_t*)((long)frame->medbuf->data() + frame->medbuf->range_offset()); - } - switch (p->videoColorFormat) - { - case OMX_COLOR_FormatYUV420Planar: - pDvdVideoPicture->iLineSize[0] = frame->width; - pDvdVideoPicture->iLineSize[1] = frame->width / 2; - pDvdVideoPicture->iLineSize[2] = frame->width / 2; - pDvdVideoPicture->iLineSize[3] = 0; - pDvdVideoPicture->data[0] = data; - pDvdVideoPicture->data[1] = pDvdVideoPicture->data[0] + luma_pixels; - pDvdVideoPicture->data[2] = pDvdVideoPicture->data[1] + chroma_pixels; - pDvdVideoPicture->data[3] = 0; - break; - case OMX_COLOR_FormatYUV420SemiPlanar: - case OMX_QCOM_COLOR_FormatYVU420SemiPlanar: - case OMX_TI_COLOR_FormatYUV420PackedSemiPlanar: - pDvdVideoPicture->iLineSize[0] = frame->width; - pDvdVideoPicture->iLineSize[1] = frame->width; - pDvdVideoPicture->iLineSize[2] = 0; - pDvdVideoPicture->iLineSize[3] = 0; - pDvdVideoPicture->data[0] = data; - pDvdVideoPicture->data[1] = pDvdVideoPicture->data[0] + luma_pixels; - pDvdVideoPicture->data[2] = pDvdVideoPicture->data[1] + chroma_pixels; - pDvdVideoPicture->data[3] = 0; - break; - default: - CLog::Log(LOGERROR, "%s::%s - Unsupported color format(%d)\n", CLASSNAME, __func__,p->videoColorFormat); - } - #if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, ">>> pic pts:%f, data:%p, col:%d, w:%d, h:%d, tm:%d\n", pDvdVideoPicture->pts, data, p->videoColorFormat, frame->width, frame->height, XbmcThreads::SystemClockMillis() - time); - #endif - } - - if (p->drop_state) - pDvdVideoPicture->iFlags |= DVP_FLAG_DROPPED; - - p->prev_frame = p->cur_frame; - p->cur_frame = NULL; - p->out_condition.notify(); - p->out_mutex.unlock(); - - return true; -} - -void CStageFrightVideo::Dispose() -{ -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s::Close\n", CLASSNAME); -#endif - - Frame *frame; - - if (p->decode_thread && p->decode_thread->IsRunning()) - p->decode_thread->StopThread(false); - p->decode_thread = NULL; - p->in_condition.notify(); - - // Give decoder_thread time to process EOS, if stuck on reading - usleep(50000); - -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "Cleaning OUT\n"); -#endif - p->out_mutex.lock(); - if (p->cur_frame) - { - if (p->cur_frame->medbuf) - p->cur_frame->medbuf->release(); - free(p->cur_frame); - p->cur_frame = NULL; - } - p->out_condition.notify(); - p->out_mutex.unlock(); - - if (p->prev_frame) - { - if (p->prev_frame->medbuf) - p->prev_frame->medbuf->release(); - free(p->prev_frame); - p->prev_frame = NULL; - } - -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "Stopping omxcodec\n"); -#endif - if (p->decoder != NULL) - { - p->decoder->stop(); - p->decoder = NULL; - } - if (p->client) - { - p->client->disconnect(); - delete p->client; - } - p->meta = NULL; - -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "Cleaning IN(%d)\n", p->in_queue.size()); -#endif - std::list<Frame*>::iterator it; - while (!p->in_queue.empty()) - { - it = p->in_queue.begin(); - frame = *it; - p->in_queue.erase(it); - if (frame->medbuf) - frame->medbuf->release(); - free(frame); - } - for (int i=0; i<INBUFCOUNT; ++i) - { - if (p->inbuf[i]) - { - p->inbuf[i]->setObserver(NULL); - p->inbuf[i]->release(); - p->inbuf[i] = NULL; - } - } - p->source = NULL; - -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "Cleaning libstagefright\n", p->in_queue.size()); -#endif - if ((p->quirks & QuirkSWRender) == 0) - p->ReleaseSurfaceTexture(); - -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "Final Cleaning\n", p->in_queue.size()); -#endif - if (p->decoder_component) - free(&p->decoder_component); -} - -void CStageFrightVideo::Reset(void) -{ -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s::Reset\n", CLASSNAME); -#endif - Frame* frame; - p->in_mutex.lock(); - std::list<Frame*>::iterator it; - while (!p->in_queue.empty()) - { - it = p->in_queue.begin(); - frame = *it; - p->in_queue.erase(it); - if (frame->medbuf) - frame->medbuf->release(); - free(frame); - } - p->resetting = true; - - p->in_mutex.unlock(); -} - -void CStageFrightVideo::SetDropState(bool bDrop) -{ - if (bDrop == p->drop_state) - return; - -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s::SetDropState (%d->%d)\n", CLASSNAME,p->drop_state,bDrop); -#endif - - p->drop_state = bDrop; -} - -void CStageFrightVideo::SetSpeed(int iSpeed) -{ -} - -/***************/ - -void CStageFrightVideo::LockBuffer(EGLImageKHR eglimg) -{ -#if defined(DEBUG_VERBOSE) - unsigned int time = XbmcThreads::SystemClockMillis(); -#endif - p->free_mutex.lock(); - stSlot* slot = p->getSlot(eglimg); - if (!slot) - { - CLog::Log(LOGDEBUG, "STF: LockBuffer: Unknown img(%p)", eglimg); - p->free_mutex.unlock(); - return; - } - slot->use_cnt++; - -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "STF: LockBuffer: Locking %p: cnt:%d tm:%d\n", eglimg, slot->use_cnt, XbmcThreads::SystemClockMillis() - time); -#endif - p->free_mutex.unlock(); -} - -void CStageFrightVideo::ReleaseBuffer(EGLImageKHR eglimg) -{ -#if defined(DEBUG_VERBOSE) - unsigned int time = XbmcThreads::SystemClockMillis(); -#endif - p->free_mutex.lock(); - stSlot* slot = p->getSlot(eglimg); - if (!slot) - { - CLog::Log(LOGDEBUG, "STF: ReleaseBuffer: Unknown img(%p)", eglimg); - p->free_mutex.unlock(); - return; - } - if (slot->use_cnt == 0) - { - CLog::Log(LOGDEBUG, "STF: ReleaseBuffer: already unlocked img(%p)", eglimg); - p->free_mutex.unlock(); - return; - } - slot->use_cnt--; - -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "STF: ReleaseBuffer: Unlocking %p: cnt:%d tm:%d\n", eglimg, slot->use_cnt, XbmcThreads::SystemClockMillis() - time); -#endif - p->free_mutex.unlock(); -} diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/libstagefrightICS/StageFrightVideo.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/libstagefrightICS/StageFrightVideo.h deleted file mode 100644 index 7abfc29239..0000000000 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/libstagefrightICS/StageFrightVideo.h +++ /dev/null @@ -1,65 +0,0 @@ -#pragma once -/* - * Copyright (C) 2010-2013 Team XBMC - * http://xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ - -#if defined(HAS_LIBSTAGEFRIGHT) - -#include "cores/VideoPlayer/DVDStreamInfo.h" -#include "DVDVideoCodec.h" - -namespace KODI -{ - namespace MESSAGING - { - class CApplicationMessenger; - } -} - -class CApplication; -class CWinSystemEGL; -class CAdvancedSettings; -class CStageFrightVideoPrivate; - -namespace android { class MediaBuffer; } - -class CStageFrightVideo -{ -public: - CStageFrightVideo(CApplication* application, KODI::MESSAGING::CApplicationMessenger* applicationMessenger, CWinSystemEGL* windowing, CAdvancedSettings* advsettings); - virtual ~CStageFrightVideo(); - - bool Open(CDVDStreamInfo &hints); - void Dispose(void); - int Decode(uint8_t *pData, int iSize, double dts, double pts); - void Reset(void); - bool GetPicture(DVDVideoPicture *pDvdVideoPicture); - bool ClearPicture(DVDVideoPicture* pDvdVideoPicture); - void SetDropState(bool bDrop); - virtual void SetSpeed(int iSpeed); - - void LockBuffer(EGLImageKHR eglimg); - void ReleaseBuffer(EGLImageKHR eglimg); - -private: - CStageFrightVideoPrivate* p; -}; - -// defined(HAS_LIBSTAGEFRIGHT) -#endif diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/libstagefrightICS/StageFrightVideoPrivate.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/libstagefrightICS/StageFrightVideoPrivate.cpp deleted file mode 100644 index f0a03a8cec..0000000000 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/libstagefrightICS/StageFrightVideoPrivate.cpp +++ /dev/null @@ -1,418 +0,0 @@ -/* - * Copyright (C) 2013 Team XBMC - * http://xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ -/***************************************************************************/ - -//#define DEBUG_VERBOSE 1 - -#include "StageFrightVideoPrivate.h" - -#include <EGL/egl.h> -#include <EGL/eglext.h> -#include <GLES2/gl2.h> -#include <GLES2/gl2ext.h> -#include "windowing/egl/EGLWrapper.h" -#include "Application.h" -#include "messaging/ApplicationMessenger.h" -#include "windowing/WindowingFactory.h" -#include "settings/AdvancedSettings.h" -#include "utils/log.h" -#include "threads/Thread.h" - -#include "android/jni/Surface.h" -#include "android/jni/SurfaceTexture.h" - -#define CLASSNAME "CStageFrightVideoPrivate" - -using namespace KODI::MESSAGING; - -GLint glerror; -#define CheckEglError(x) while((glerror = eglGetError()) != EGL_SUCCESS) CLog::Log(LOGERROR, "EGL error in %s: %x",x, glerror); -#define CheckGlError(x) while((glerror = glGetError()) != GL_NO_ERROR) CLog::Log(LOGERROR, "GL error in %s: %x",x, glerror); - -// EGL extension functions -static PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR; -static PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR; -static PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES; - -int NP2( unsigned x ) { - --x; - x |= x >> 1; - x |= x >> 2; - x |= x >> 4; - x |= x >> 8; - x |= x >> 16; - return ++x; -} - -using namespace android; - -CStageFrightVideoPrivate::CStageFrightVideoPrivate() - : decode_thread(NULL), source(NULL) - , eglDisplay(EGL_NO_DISPLAY), eglSurface(EGL_NO_SURFACE), eglContext(EGL_NO_CONTEXT) - , eglInitialized(false) - , framecount(0) - , quirks(QuirkNone), cur_frame(NULL), prev_frame(NULL) - , width(-1), height(-1) - , texwidth(-1), texheight(-1) - , client(NULL), decoder(NULL), decoder_component(NULL) - , drop_state(false), resetting(false) -{ - if (!eglCreateImageKHR) - eglCreateImageKHR = (PFNEGLCREATEIMAGEKHRPROC) CEGLWrapper::GetProcAddress("eglCreateImageKHR"); - if (!eglDestroyImageKHR) - eglDestroyImageKHR = (PFNEGLDESTROYIMAGEKHRPROC) CEGLWrapper::GetProcAddress("eglDestroyImageKHR"); - if (!glEGLImageTargetTexture2DOES) - glEGLImageTargetTexture2DOES = (PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) CEGLWrapper::GetProcAddress("glEGLImageTargetTexture2DOES"); - - for (int i=0; i<INBUFCOUNT; ++i) - inbuf[i] = NULL; -} - -void CStageFrightVideoPrivate::signalBufferReturned(MediaBuffer *buffer) -{ -} - -MediaBuffer* CStageFrightVideoPrivate::getBuffer(size_t size) -{ - int i=0; - for (; i<INBUFCOUNT; ++i) - if (inbuf[i]->refcount() == 0 && inbuf[i]->size() >= size) - break; - if (i == INBUFCOUNT) - { - i = 0; - for (; i<INBUFCOUNT; ++i) - if (inbuf[i]->refcount() == 0) - break; - if (i == INBUFCOUNT) - return NULL; - inbuf[i]->setObserver(NULL); - inbuf[i]->release(); - inbuf[i] = new MediaBuffer(size); - inbuf[i]->setObserver(this); - } - - inbuf[i]->reset(); - inbuf[i]->add_ref(); - return inbuf[i]; -} - -bool CStageFrightVideoPrivate::inputBufferAvailable() -{ - for (int i=0; i<INBUFCOUNT; ++i) - if (inbuf[i]->refcount() == 0) - return true; - - return false; -} - -stSlot* CStageFrightVideoPrivate::getSlot(EGLImageKHR eglimg) -{ - for (int i=0; i<NUMFBOTEX; ++i) - if (texslots[i].eglimg == eglimg) - return &(texslots[i]); - - return NULL; -} - -stSlot* CStageFrightVideoPrivate::getFreeSlot() -{ - for (int i=0; i<NUMFBOTEX; ++i) - if (texslots[i].use_cnt == 0) - return &(texslots[i]); - - return NULL; -} - -void CStageFrightVideoPrivate::loadOESShader(GLenum shaderType, const char* pSource, GLuint* outShader) -{ -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, ">>loadOESShader\n"); -#endif - - GLuint shader = glCreateShader(shaderType); - CheckGlError("loadOESShader"); - if (shader) { - glShaderSource(shader, 1, &pSource, NULL); - glCompileShader(shader); - GLint compiled = 0; - glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled); - if (!compiled) { - GLint infoLen = 0; - glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen); - if (infoLen) { - char* buf = (char*) malloc(infoLen); - if (buf) { - glGetShaderInfoLog(shader, infoLen, NULL, buf); - printf("Shader compile log:\n%s\n", buf); - free(buf); - } - } else { - char* buf = (char*) malloc(0x1000); - if (buf) { - glGetShaderInfoLog(shader, 0x1000, NULL, buf); - printf("Shader compile log:\n%s\n", buf); - free(buf); - } - } - glDeleteShader(shader); - shader = 0; - } - } - *outShader = shader; -} - -void CStageFrightVideoPrivate::createOESProgram(const char* pVertexSource, const char* pFragmentSource, GLuint* outPgm) -{ -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, ">>createOESProgram\n"); -#endif - GLuint vertexShader, fragmentShader; - { - loadOESShader(GL_VERTEX_SHADER, pVertexSource, &vertexShader); - } - { - loadOESShader(GL_FRAGMENT_SHADER, pFragmentSource, &fragmentShader); - } - - GLuint program = glCreateProgram(); - if (program) { - glAttachShader(program, vertexShader); - glAttachShader(program, fragmentShader); - glLinkProgram(program); - GLint linkStatus = GL_FALSE; - glGetProgramiv(program, GL_LINK_STATUS, &linkStatus); - if (linkStatus != GL_TRUE) { - GLint bufLength = 0; - glGetProgramiv(program, GL_INFO_LOG_LENGTH, &bufLength); - if (bufLength) { - char* buf = (char*) malloc(bufLength); - if (buf) { - glGetProgramInfoLog(program, bufLength, NULL, buf); - printf("Program link log:\n%s\n", buf); - free(buf); - } - } - glDeleteProgram(program); - program = 0; - } - } - glDeleteShader(vertexShader); - glDeleteShader(fragmentShader); - *outPgm = program; -} - -void CStageFrightVideoPrivate::OES_shader_setUp() -{ - - const char vsrc[] = - "attribute vec4 vPosition;\n" - "varying vec2 texCoords;\n" - "uniform mat4 texMatrix;\n" - "void main() {\n" - " vec2 vTexCoords = 0.5 * (vPosition.xy + vec2(1.0, 1.0));\n" - " texCoords = (texMatrix * vec4(vTexCoords.x, 1.0 - vTexCoords.y, 0.0, 1.0)).xy;\n" - " gl_Position = vPosition;\n" - "}\n"; - - const char fsrc[] = - "#extension GL_OES_EGL_image_external : require\n" - "precision mediump float;\n" - "uniform samplerExternalOES texSampler;\n" - "varying vec2 texCoords;\n" - "void main() {\n" - " gl_FragColor = texture2D(texSampler, texCoords);\n" - "}\n"; - - { - #if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, ">>OES_shader_setUp\n"); - #endif - CheckGlError("OES_shader_setUp"); - createOESProgram(vsrc, fsrc, &mPgm); - } - - mPositionHandle = glGetAttribLocation(mPgm, "vPosition"); - mTexSamplerHandle = glGetUniformLocation(mPgm, "texSampler"); - mTexMatrixHandle = glGetUniformLocation(mPgm, "texMatrix"); -} - -void CStageFrightVideoPrivate::InitializeEGL(int w, int h) -{ -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s: >>> InitializeEGL: w:%d; h:%d\n", CLASSNAME, w, h); -#endif - texwidth = w; - texheight = h; - if (!m_g_Windowing->IsExtSupported("GL_TEXTURE_NPOT")) - { - texwidth = NP2(texwidth); - texheight = NP2(texheight); - } - - eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); - if (eglDisplay == EGL_NO_DISPLAY) - CLog::Log(LOGERROR, "%s: InitializeEGL: no display\n", CLASSNAME); - eglBindAPI(EGL_OPENGL_ES_API); - EGLint contextAttributes[] = { - EGL_CONTEXT_CLIENT_VERSION, 2, - EGL_NONE - }; - eglContext = eglCreateContext(eglDisplay, m_g_Windowing->GetEGLConfig(), EGL_NO_CONTEXT, contextAttributes); - EGLint pbufferAttribs[] = { - EGL_WIDTH, texwidth, - EGL_HEIGHT, texheight, - EGL_NONE - }; - eglSurface = eglCreatePbufferSurface(eglDisplay, m_g_Windowing->GetEGLConfig(), pbufferAttribs); - eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext); - CheckGlError("stf init"); - - static const EGLint imageAttributes[] = { - EGL_IMAGE_PRESERVED_KHR, EGL_FALSE, - EGL_GL_TEXTURE_LEVEL_KHR, 0, - EGL_NONE - }; - - for (int i=0; i<NUMFBOTEX; ++i) - { - glGenTextures(1, &(texslots[i].texid)); - glBindTexture(GL_TEXTURE_2D, texslots[i].texid); - - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texwidth, texheight, 0, - GL_RGBA, GL_UNSIGNED_BYTE, 0); - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - // This is necessary for non-power-of-two textures - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - - texslots[i].eglimg = eglCreateImageKHR(eglDisplay, eglContext, EGL_GL_TEXTURE_2D_KHR, (EGLClientBuffer)(texslots[i].texid),imageAttributes); - texslots[i].use_cnt = 0; - } - glBindTexture(GL_TEXTURE_2D, 0); - - fbo.Initialize(); - OES_shader_setUp(); - - eglInitialized = true; -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s: <<< InitializeEGL: w:%d; h:%d\n", CLASSNAME, texwidth, texheight); -#endif -} - -void CStageFrightVideoPrivate::ReleaseEGL() -{ -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s: >>> UninitializeEGL\n", CLASSNAME); -#endif - fbo.Cleanup(); - for (int i=0; i<NUMFBOTEX; ++i) - { - glDeleteTextures(1, &(texslots[i].texid)); - eglDestroyImageKHR(eglDisplay, texslots[i].eglimg); - } - - if (eglContext != EGL_NO_CONTEXT) - eglDestroyContext(eglDisplay, eglContext); - eglContext = EGL_NO_CONTEXT; - - if (eglSurface != EGL_NO_SURFACE) - eglDestroySurface(eglDisplay, eglSurface); - eglSurface = EGL_NO_SURFACE; - - eglInitialized = false; -} - -void CStageFrightVideoPrivate::CallbackInitSurfaceTexture(void *userdata) -{ - CStageFrightVideoPrivate *ctx = static_cast<CStageFrightVideoPrivate*>(userdata); - ctx->InitSurfaceTexture(); -} - -bool CStageFrightVideoPrivate::InitSurfaceTexture() -{ -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s: >>> InitSurfaceTexture\n", CLASSNAME); -#endif - if (mVideoNativeWindow != NULL) - return false; - - //FIXME: Playing back-to-back vids induces a bug when properly generating textures between runs. - // Symptoms are upside down vid, "updateTexImage: error binding external texture" in log, and crash - // after stopping. - // Workaround is to always use the same, arbitrary chosen, texture ids. - mVideoTextureId = 0xbaad; - - glBindTexture( GL_TEXTURE_EXTERNAL_OES, mVideoTextureId); - glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glBindTexture( GL_TEXTURE_EXTERNAL_OES, 0); - - mSurfTexture = new CJNISurfaceTexture(mVideoTextureId); - mSurface = new CJNISurface(*mSurfTexture); - - JNIEnv* env = xbmc_jnienv(); - mVideoNativeWindow = ANativeWindow_fromSurface(env, mSurface->get_raw()); - native_window_api_connect(mVideoNativeWindow.get(), NATIVE_WINDOW_API_MEDIA); - -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s: <<< InitSurfaceTexture texid(%d) natwin(%p)\n", CLASSNAME, mVideoTextureId, mVideoNativeWindow.get()); -#endif - - return true; -} - -void CStageFrightVideoPrivate::ReleaseSurfaceTexture() -{ -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s: >>> ReleaseSurfaceTexture\n", CLASSNAME); -#endif - if (mVideoNativeWindow == NULL) - return; - - native_window_api_disconnect(mVideoNativeWindow.get(), NATIVE_WINDOW_API_MEDIA); - ANativeWindow_release(mVideoNativeWindow.get()); - mVideoNativeWindow.clear(); - - mSurface->release(); - mSurfTexture->release(); - - delete mSurface; - delete mSurfTexture; - -#if defined(DEBUG_VERBOSE) - CLog::Log(LOGDEBUG, "%s: <<< ReleaseSurfaceTexture\n", CLASSNAME); -#endif -} - -void CStageFrightVideoPrivate::UpdateSurfaceTexture() -{ - mSurfTexture->updateTexImage(); -} - -void CStageFrightVideoPrivate::GetSurfaceTextureTransformMatrix(float* transformMatrix) -{ - mSurfTexture->getTransformMatrix(transformMatrix); -} - diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/libstagefrightICS/StageFrightVideoPrivate.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/libstagefrightICS/StageFrightVideoPrivate.h deleted file mode 100644 index 3c53735bff..0000000000 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/libstagefrightICS/StageFrightVideoPrivate.h +++ /dev/null @@ -1,185 +0,0 @@ -#pragma once -/* - * Copyright (C) 2013 Team XBMC - * http://xbmc.org - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with XBMC; see the file COPYING. If not, see - * <http://www.gnu.org/licenses/>. - * - */ -/***************************************************************************/ - -#include "threads/Thread.h" -#include "xbmc/guilib/FrameBufferObject.h" -#include "cores/VideoPlayer/VideoRenderers/RenderFormats.h" - -#include <android/native_window.h> -#include <android/native_window_jni.h> - -#include <media/stagefright/MetaData.h> -#include <media/stagefright/MediaBuffer.h> -#include <media/stagefright/MediaBufferGroup.h> -#include <media/stagefright/MediaDefs.h> -#include <media/stagefright/MediaSource.h> - -#if __cplusplus >= 201103L -#define char16_t LIBRARY_char16_t -#define char32_t LIBRARY_char32_t -#endif -#include <binder/ProcessState.h> -#include <media/stagefright/OMXClient.h> -#include <media/stagefright/OMXCodec.h> -#include <media/stagefright/foundation/ABuffer.h> -#include <utils/List.h> -#include <utils/RefBase.h> -#include <ui/GraphicBuffer.h> -#include <ui/PixelFormat.h> -#include <gui/SurfaceTexture.h> -#if __cplusplus >= 201103L -#undef char16_t -#undef char32_t -#endif - -#include "system_gl.h" - -#include <map> -#include <list> - -#define NUMFBOTEX 4 -#define INBUFCOUNT 16 - -class CStageFrightDecodeThread; -class CJNISurface; -class CJNISurfaceTexture; -class CWinSystemEGL; -class CAdvancedSettings; -class CApplication; - -namespace KODI -{ - namespace MESSAGING - { - class CApplicationMessenger; - } -} - -struct stSlot -{ - GLuint texid; - EGLImageKHR eglimg; - int use_cnt; -}; - -struct Frame -{ - android::status_t status; - int32_t width, height; - int64_t pts; - ERenderFormat format; - EGLImageKHR eglimg; - android::MediaBuffer* medbuf; -}; - -enum StageFrightQuirks -{ - QuirkNone = 0, - QuirkSWRender = 0x01, -}; - -class CStageFrightVideoPrivate : public android::MediaBufferObserver -{ -public: - CStageFrightVideoPrivate(); - - virtual void signalBufferReturned(android::MediaBuffer *buffer); - - android::MediaBuffer* getBuffer(size_t size); - bool inputBufferAvailable(); - - stSlot* getSlot(EGLImageKHR eglimg); - stSlot* getFreeSlot(); - - void loadOESShader(GLenum shaderType, const char* pSource, GLuint* outShader); - void createOESProgram(const char* pVertexSource, const char* pFragmentSource, GLuint* outPgm); - void OES_shader_setUp(); - void InitializeEGL(int w, int h); - void ReleaseEGL(); - -public: - CStageFrightDecodeThread* decode_thread; - - android::sp<android::MediaSource> source; - - android::MediaBuffer* inbuf[INBUFCOUNT]; - - GLuint mPgm; - GLint mPositionHandle; - GLint mTexSamplerHandle; - GLint mTexMatrixHandle; - - CApplication* m_g_application; - KODI::MESSAGING::CApplicationMessenger* m_g_applicationMessenger; - CWinSystemEGL* m_g_Windowing; - CAdvancedSettings* m_g_advancedSettings; - - CFrameBufferObject fbo; - EGLDisplay eglDisplay; - EGLSurface eglSurface; - EGLContext eglContext; - bool eglInitialized; - - stSlot texslots[NUMFBOTEX]; - - android::sp<android::MetaData> meta; - int64_t framecount; - std::list<Frame*> in_queue; - std::map<int64_t, Frame*> out_queue; - CCriticalSection in_mutex; - CCriticalSection out_mutex; - CCriticalSection free_mutex; - XbmcThreads::ConditionVariable in_condition; - XbmcThreads::ConditionVariable out_condition; - - int quirks; - Frame *cur_frame; - Frame *prev_frame; - bool source_done; - int x, y; - int width, height; - int texwidth, texheight; - - android::OMXClient *client; - android::sp<android::MediaSource> decoder; - const char *decoder_component; - int videoColorFormat; - int videoStride; - int videoSliceHeight; - - bool drop_state; - bool resetting; -#if defined(DEBUG_VERBOSE) - unsigned int cycle_time; -#endif - - unsigned int mVideoTextureId; - CJNISurfaceTexture* mSurfTexture; - CJNISurface* mSurface; - android::sp<ANativeWindow> mVideoNativeWindow; - - static void CallbackInitSurfaceTexture(void*); - bool InitSurfaceTexture(); - void ReleaseSurfaceTexture(); - void UpdateSurfaceTexture(); - void GetSurfaceTextureTransformMatrix(float* transformMatrix); -}; diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.h b/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.h index c17ba46885..4af4dda4c4 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.h +++ b/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.h @@ -86,7 +86,6 @@ enum RenderMethod RENDER_OMXEGL = 0x040, RENDER_CVREF = 0x080, RENDER_BYPASS = 0x100, - RENDER_EGLIMG = 0x200, RENDER_MEDIACODEC = 0x400, RENDER_MEDIACODECSURFACE = 0x800, RENDER_IMXMAP = 0x1000 @@ -193,9 +192,9 @@ protected: void RenderSoftware(int index, int field); // single pass s/w yuv2rgb renderer // hooks for HwDec Renderered - virtual bool LoadShadersHook() { return false; }; - virtual bool RenderHook(int idx) { return false; }; - virtual bool RenderUpdateVideoHook(bool clear, DWORD flags, DWORD alpha) { return false; }; + virtual bool LoadShadersHook() { return false; } + virtual bool RenderHook(int idx) { return false; } + virtual bool RenderUpdateVideoHook(const CRect &srcRect, const CRect &dstRect, bool clear, DWORD flags, DWORD alpha) { return false; } virtual int GetImageHook(YV12Image *image, int source = AUTOSOURCE, bool readonly = false) { return NOSOURCE; } CFrameBufferObject m_fbo; diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/RenderFormats.h b/xbmc/cores/VideoPlayer/VideoRenderers/RenderFormats.h index c6329ff7f6..830084f5db 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/RenderFormats.h +++ b/xbmc/cores/VideoPlayer/VideoRenderers/RenderFormats.h @@ -38,7 +38,6 @@ enum ERenderFormat { RENDER_FMT_OMXEGL, RENDER_FMT_CVBREF, RENDER_FMT_BYPASS, - RENDER_FMT_EGLIMG, RENDER_FMT_MEDIACODEC, RENDER_FMT_MEDIACODECSURFACE, RENDER_FMT_IMXMAP, diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp index 8e1b6fed0e..c8a61d83c8 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp @@ -133,7 +133,6 @@ static std::string GetRenderFormatName(ERenderFormat format) case RENDER_FMT_VAAPINV12: return "VAAPI_NV12"; case RENDER_FMT_OMXEGL: return "OMXEGL"; case RENDER_FMT_CVBREF: return "BGRA"; - case RENDER_FMT_EGLIMG: return "EGLIMG"; case RENDER_FMT_BYPASS: return "BYPASS"; case RENDER_FMT_MEDIACODEC:return "MEDIACODEC"; case RENDER_FMT_IMXMAP: return "IMXMAP"; @@ -1192,7 +1191,6 @@ int CRenderManager::AddVideoPicture(DVDVideoPicture& pic) || pic.format == RENDER_FMT_CVBREF || pic.format == RENDER_FMT_VAAPI || pic.format == RENDER_FMT_VAAPINV12 - || pic.format == RENDER_FMT_EGLIMG || pic.format == RENDER_FMT_MEDIACODEC || pic.format == RENDER_FMT_IMXMAP || pic.format == RENDER_FMT_MMAL) diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp index a3da083564..d0e7d070b5 100644 --- a/xbmc/settings/AdvancedSettings.cpp +++ b/xbmc/settings/AdvancedSettings.cpp @@ -163,14 +163,6 @@ void CAdvancedSettings::Initialize() m_DXVAAllowHqScaling = true; m_videoFpsDetect = 1; m_videoBusyDialogDelay_ms = 500; - m_stagefrightConfig.useAVCcodec = -1; - m_stagefrightConfig.useHEVCcodec = -1; - m_stagefrightConfig.useVC1codec = -1; - m_stagefrightConfig.useVPXcodec = -1; - m_stagefrightConfig.useMP4codec = -1; - m_stagefrightConfig.useMPEG2codec = -1; - m_stagefrightConfig.useSwRenderer = false; - m_stagefrightConfig.useInputDTS = false; m_mediacodecForceSoftwareRendring = false; @@ -554,19 +546,6 @@ void CAdvancedSettings::ParseSettingsFile(const std::string &file) XMLUtils::GetBoolean(pElement,"vdpauHDdeintSkipChroma",m_videoVDPAUdeintSkipChromaHD); XMLUtils::GetBoolean(pElement,"useffmpegvda", m_useFfmpegVda); - TiXmlElement* pStagefrightElem = pElement->FirstChildElement("stagefright"); - if (pStagefrightElem) - { - XMLUtils::GetInt(pStagefrightElem,"useavccodec",m_stagefrightConfig.useAVCcodec, -1, 1); - XMLUtils::GetInt(pStagefrightElem,"usehevccodec",m_stagefrightConfig.useHEVCcodec, -1, 1); - XMLUtils::GetInt(pStagefrightElem,"usevc1codec",m_stagefrightConfig.useVC1codec, -1, 1); - XMLUtils::GetInt(pStagefrightElem,"usevpxcodec",m_stagefrightConfig.useVPXcodec, -1, 1); - XMLUtils::GetInt(pStagefrightElem,"usemp4codec",m_stagefrightConfig.useMP4codec, -1, 1); - XMLUtils::GetInt(pStagefrightElem,"usempeg2codec",m_stagefrightConfig.useMPEG2codec, -1, 1); - XMLUtils::GetBoolean(pStagefrightElem,"useswrenderer",m_stagefrightConfig.useSwRenderer); - XMLUtils::GetBoolean(pStagefrightElem,"useinputdts",m_stagefrightConfig.useInputDTS); - } - XMLUtils::GetBoolean(pElement,"mediacodecforcesoftwarerendering",m_mediacodecForceSoftwareRendring); TiXmlElement* pAdjustRefreshrate = pElement->FirstChildElement("adjustrefreshrate"); diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h index 9d8f95ffb8..76513f8c53 100644 --- a/xbmc/settings/AdvancedSettings.h +++ b/xbmc/settings/AdvancedSettings.h @@ -102,18 +102,6 @@ struct RefreshVideoLatency float delay; }; -struct StagefrightConfig -{ - int useAVCcodec; - int useHEVCcodec; - int useVC1codec; - int useVPXcodec; - int useMP4codec; - int useMPEG2codec; - bool useSwRenderer; - bool useInputDTS; -}; - typedef std::vector<TVShowRegexp> SETTINGS_TVSHOWLIST; class CAdvancedSettings : public ISettingCallback, public ISettingsHandler @@ -199,7 +187,6 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler bool m_DXVAAllowHqScaling; int m_videoFpsDetect; int m_videoBusyDialogDelay_ms; - StagefrightConfig m_stagefrightConfig; bool m_mediacodecForceSoftwareRendring; std::string m_videoDefaultPlayer; diff --git a/xbmc/settings/SettingConditions.cpp b/xbmc/settings/SettingConditions.cpp index 5e97b87b46..60f8cd217c 100644 --- a/xbmc/settings/SettingConditions.cpp +++ b/xbmc/settings/SettingConditions.cpp @@ -236,9 +236,6 @@ void CSettingConditions::Initialize() #ifdef TARGET_ANDROID m_simpleConditions.insert("has_mediacodec"); #endif -#ifdef HAS_LIBSTAGEFRIGHT - m_simpleConditions.insert("have_libstagefrightdecoder"); -#endif #ifdef HAVE_VIDEOTOOLBOXDECODER m_simpleConditions.insert("have_videotoolboxdecoder"); if (g_sysinfo.HasVideoToolBoxDecoder()) |