[DEV] todo : set ogg decoder for android

This commit is contained in:
Edouard DUPIN 2015-06-22 21:13:53 +02:00
parent 69632b7f02
commit 60a8905b63

View File

@ -13,11 +13,14 @@
#include <audio/ess/LoadedFile.h> #include <audio/ess/LoadedFile.h>
#include <audio/ess/decWav.h> #include <audio/ess/decWav.h>
#include <audio/ess/decOgg.h> #include <audio/ess/decOgg.h>
#include <unistd.h>
static void threadCallback2(void* _userData) { static void threadCallback2(void* _userData) {
etk::thread::setName("ewolSA decoder"); etk::thread::setName("ewolSA decoder");
audio::ess::LoadedFile* decodeFile = reinterpret_cast<audio::ess::LoadedFile*>(_userData); audio::ess::LoadedFile* decodeFile = static_cast<audio::ess::LoadedFile*>(_userData);
decodeFile->decode(); if (decodeFile != nullptr) {
decodeFile->decode();
}
} }
void audio::ess::LoadedFile::decode() { void audio::ess::LoadedFile::decode() {
@ -35,13 +38,17 @@ audio::ess::LoadedFile::LoadedFile(const std::string& _fileName, int8_t _nbChanR
// select the corect Loader : // select the corect Loader :
if (etk::end_with(tmpName, ".wav") == true) { if (etk::end_with(tmpName, ".wav") == true) {
m_data = audio::ess::wav::loadAudioFile(m_file, m_nbChanRequested); m_data = audio::ess::wav::loadAudioFile(m_file, m_nbChanRequested);
m_nbSamples = m_data.size(); m_nbSamples = decodem_data.size();
} else if (etk::end_with(tmpName, ".ogg") == true) { } else if (etk::end_with(tmpName, ".ogg") == true) {
/*
EWOLSA_DEBUG("create thread"); EWOLSA_DEBUG("create thread");
m_thread = new std::thread(&threadCallback2, this); m_thread = new std::thread(&threadCallback2, this);
EWOLSA_DEBUG("done 1"); EWOLSA_DEBUG("done 1");
std::this_thread::sleep_for(std::chrono::milliseconds(1000)); std::this_thread::sleep_for(std::chrono::milliseconds(1000));
EWOLSA_DEBUG("done 2"); EWOLSA_DEBUG("done 2");
*/
// TODO: Set this back to have music decode();
// TODO: This is removed to test faster ==> pb on android to create thread ...
} else { } else {
EWOLSA_ERROR("Extention not managed '" << m_file << "' Sopported extention : .wav / .ogg"); EWOLSA_ERROR("Extention not managed '" << m_file << "' Sopported extention : .wav / .ogg");
return; return;