diff --git a/configure.ac b/configure.ac
index 85bff557a..5e00a3065 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,6 +35,17 @@ else
rm -f local_build_config.h.tmp
fi
+AC_ARG_ENABLE(ffmpegdec,
+ AS_HELP_STRING(--enable-ffmpegdec,include ffmpeg decoder support),
+ ,[enable_ffmpegdec=no])
+
+AM_CONDITIONAL(ENABLE_FFMPEGDEC,test "$enable_ffmpegdec" = "yes")
+if test "$enable_ffmpegdec" = "yes"; then
+ AC_DEFINE(ENABLE_FFMPEGDEC,1,[include ffmpeg decoder support])
+fi
+
+if test x"$enable_ffmpegdec" != xyes; then
+
AC_ARG_WITH([tremor], [AS_HELP_STRING([--with-tremor],
[use libvorbisidec instead of libogg/libvorbis])],
[TREMOR="$withval"],
@@ -45,10 +56,6 @@ AC_ARG_WITH([tremor-static], [AS_HELP_STRING([--with-tremor-static],
[TREMOR_STATIC="$withval"],
[TREMOR_STATIC=no])
-if test "$BOXTYPE" = "tripledragon"; then
- TUXBOX_APPS_LIB_PKGCONFIG(DIRECTFB, directfb)
-fi
-
if test "$TREMOR_STATIC" = "yes"; then
TREMOR=yes
fi
@@ -63,23 +70,34 @@ if test "$TREMOR_STATIC" = "yes"; then
VORBISIDEC_LIBS="$(echo $VORBISIDEC_LIBS | sed 's@-L@@; s@ -l.*@/libvorbisidec.a@;')"
fi
-AM_CONDITIONAL(USE_TREMOR, test "$TREMOR" = "yes")
-
-TUXBOX_APPS_LIB_CONFIG(CURL,curl-config)
-TUXBOX_APPS_LIB_CONFIG(FREETYPE,freetype-config)
-# TUXBOX_APPS_LIB_PKGCONFIG(OPENSSL,openssl)
TUXBOX_APPS_LIB_PKGCONFIG_CHECK(ID3TAG,libid3tag)
if test x"$ID3TAG_EXISTS" != xyes; then
TUXBOX_APPS_LIB_PKGCONFIG(ID3TAG,id3tag)
fi
+
TUXBOX_APPS_LIB_PKGCONFIG_CHECK(MAD,libmad)
if test x"$MAD_EXISTS" != xyes; then
TUXBOX_APPS_LIB_PKGCONFIG(MAD,mad)
fi
+
TUXBOX_APPS_LIB_PKGCONFIG_CHECK(OGG,ogg)
if test -z "$OGG_CFLAGS" ; then
TUXBOX_APPS_LIB_PKGCONFIG(OGG,ogg)
fi
+else
+TUXBOX_APPS_LIB_PKGCONFIG(SWRESAMPLE,libswresample)
+fi
+
+if test "$BOXTYPE" = "tripledragon"; then
+ TUXBOX_APPS_LIB_PKGCONFIG(DIRECTFB, directfb)
+fi
+
+AM_CONDITIONAL(USE_TREMOR, test "$TREMOR" = "yes")
+
+# TUXBOX_APPS_LIB_PKGCONFIG(OPENSSL,openssl)
+TUXBOX_APPS_LIB_CONFIG(CURL,curl-config)
+TUXBOX_APPS_LIB_CONFIG(FREETYPE,freetype-config)
+
TUXBOX_APPS_LIB_PKGCONFIG(PNG,libpng)
TUXBOX_APPS_LIB_PKGCONFIG(AVFORMAT,libavformat)
TUXBOX_APPS_LIB_PKGCONFIG(AVCODEC,libavcodec)
diff --git a/data/cables.xml b/data/cables.xml
index e992a06bc..ea6f28f32 100644
--- a/data/cables.xml
+++ b/data/cables.xml
@@ -512,7 +512,13 @@
-
+
+
+
+
+
+
+
@@ -541,6 +547,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale
index 52fffd1d9..b3fc76430 100644
--- a/data/locale/deutsch.locale
+++ b/data/locale/deutsch.locale
@@ -256,7 +256,8 @@ ci.reset_standby Reset nach Standby
ci.settings Zugangskontrolle
ci.timeout CAM antwortet nicht
ci.waiting Warte auf CAM-Antwort
-clock_size Info Uhr
+clock_background Hintergrund anzeigen
+clock_seconds Sekunden anzeigen
clock_size_height Höhe der Anzeige
clock_switch_off Uhr ausblenden
clock_switch_on Uhr einblenden
@@ -433,7 +434,7 @@ extra.volume_pos Lautstärkeanzeige
extra.volume_size Höhe der Anzeige
extra.west Westen
extra.zap_cycle Zap nur in Bouquet
-extra.zapit_fe_timeout Tuning Timeout (1=10ms)
+extra.zapit_fe_timeout Tuning Timeout
extra.zapit_hvoltage High (13.5/ 18.5) Voltage
extra.zapit_make_bouquet Kanalliste auffüllen
extra.zapit_motor_speed Rotor Drehzeit (10 = 1°/ sec)
@@ -812,7 +813,10 @@ menu.hint_channellist_foot Definiert, welche Informationen im unteren Sendungsfe
menu.hint_channellist_setup Wählen Sie die Anzeigeoptionen für die Kanalliste
menu.hint_channels Kanalliste öffnen
menu.hint_ci Conditional-Access-Menü zum Einrichten Ihres CI-Moduls oder der eingebetteten Conax-Karte
-menu.hint_clock_size Stellen Sie die Größe der Info Uhr ein.
+menu.hint_clock_background Lassen Sie die Uhr mit Hintergrund anzeigen
+menu.hint_clock_mode Schalten Sie die Uhr ein oder aus
+menu.hint_clock_seconds Legen Sie fest, ob die Sekunden angezeigt werden sollen
+menu.hint_clock_size Stellen Sie die Größe der Uhr ein
menu.hint_colors Konfigurieren Sie die Menü-Farben
menu.hint_content_back Ändern Sie die Hintergrundfarbe für den Fensterinhalt
menu.hint_content_textcolor Ändern Sie die Textfarbe für den Fensterinhalt
@@ -1242,7 +1246,7 @@ miscsettings.infobar_show_res Auflösung anzeigen
miscsettings.infobar_show_res_simple einfach
miscsettings.infobar_show_sysfs_hdd Füllstandanzeige (sysFS & hdd)
miscsettings.infobar_show_tuner Aktiven Tuner anzeigen
-miscsettings.infoclock Info Uhr
+miscsettings.infoclock Uhr
miscsettings.progressbar Fortschrittsbalken
miscsettings.progressbar_color Farbe
miscsettings.progressbar_design Design
@@ -1945,6 +1949,11 @@ timing.volumebar Lautstärkeanzeige
unicable.lnb Unicable Eingang
unicable.qrg Unicable Frequenz
unicable.scr Unicable SCR
+unit.decimal ,
+unit.short.hour h
+unit.short.millisecond ms
+unit.short.minute min
+unit.short.second s
upnpbrowser.head UPnP Browser
upnpbrowser.noservers Kein UPnP-Server gefunden
upnpbrowser.rescan Neue Suche
diff --git a/data/locale/english.locale b/data/locale/english.locale
index 72bef7ade..81a9fdad7 100644
--- a/data/locale/english.locale
+++ b/data/locale/english.locale
@@ -256,7 +256,8 @@ ci.reset_standby Reset after standby
ci.settings Conditional access
ci.timeout Timeout waiting CI menu ready
ci.waiting Waiting for CI answer
-clock_size Info clock
+clock_background Show background
+clock_seconds Show seconds
clock_size_height Display height
clock_switch_off Clock off
clock_switch_on Clock on
@@ -433,7 +434,7 @@ extra.volume_pos Volumebar
extra.volume_size Height of display
extra.west West
extra.zap_cycle Zap cycle
-extra.zapit_fe_timeout Tune timeout (1 = 10 msec)
+extra.zapit_fe_timeout Tune timeout
extra.zapit_hvoltage 18V for rotor moving
extra.zapit_make_bouquet Make Remaining Channels list
extra.zapit_motor_speed Motor moving speed (10 = 1deg/sec)
@@ -812,7 +813,10 @@ menu.hint_channellist_foot Show additional information\nin bottom box
menu.hint_channellist_setup Configure channel list GUI options
menu.hint_channels Open channel list
menu.hint_ci Conditional access menu\nto setup your CI CAM or embeded Conax card
-menu.hint_clock_size Set the size of the info clock.
+menu.hint_clock_background Show clock with theme's background color
+menu.hint_clock_mode Switch clock on or off
+menu.hint_clock_seconds Show time format with seconds
+menu.hint_clock_size Set the size of the info clock
menu.hint_colors Configure GUI colors
menu.hint_content_back Change GUI window background color
menu.hint_content_textcolor Change GUI window text color
@@ -1242,7 +1246,7 @@ miscsettings.infobar_show_res show resolution on infobar
miscsettings.infobar_show_res_simple simple
miscsettings.infobar_show_sysfs_hdd Fill level (sysFS & hdd)
miscsettings.infobar_show_tuner Display active tuner
-miscsettings.infoclock Info clock
+miscsettings.infoclock Clock
miscsettings.progressbar Progressbar
miscsettings.progressbar_color Color
miscsettings.progressbar_design Design
@@ -1945,6 +1949,11 @@ timing.volumebar Volume bar
unicable.lnb Unicable Input
unicable.qrg Unicable Frequency
unicable.scr Unicable SCR
+unit.decimal .
+unit.short.hour h
+unit.short.millisecond ms
+unit.short.minute min
+unit.short.second s
upnpbrowser.head UPnP Browser
upnpbrowser.noservers No UPnP servers found
upnpbrowser.rescan Scan again
diff --git a/src/Makefile.am b/src/Makefile.am
index db50c59c1..ad69b8376 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -41,11 +41,21 @@ rcsim_SOURCES = rcsim.c rcsim.h
if ENABLE_FLAC
FLACLIBS = -lFLAC
-AM_CPPFLAGS += -DENABLE_FLAC
else
FLACLIBS =
endif
+if ENABLE_FFMPEGDEC
+ADEC_LIBS = @SWRESAMPLE_LIBS@
+else
+ADEC_LIBS = @MAD_LIBS@ \
+ @ID3TAG_LIBS@ \
+ $(FLACLIBS) \
+ $(VORBISLIBS)
+endif
+
+AM_CPPFLAGS += -D_FILE_OFFSET_BITS=64
+
if BOXMODEL_APOLLO
MTDUTILSLIBS = \
system/mtdutils/libneutrino_system_mtdutils.a \
@@ -91,11 +101,11 @@ neutrino_LDADD = \
@CURL_LIBS@ \
@FREETYPE_LIBS@ \
@PNG_LIBS@ \
- @MAD_LIBS@ \
- @ID3TAG_LIBS@ \
@LIBCS_LIBS@ \
- $(FLACLIBS) \
- $(VORBISLIBS) \
+ @AVFORMAT_LIBS@ \
+ @AVUTIL_LIBS@ \
+ @AVCODEC_LIBS@ \
+ $(ADEC_LIBS) \
-ldvbsi++ \
-ljpeg \
-lOpenThreads \
diff --git a/src/driver/audiodec/Makefile.am b/src/driver/audiodec/Makefile.am
index 6bfe9e451..fe2691f3b 100644
--- a/src/driver/audiodec/Makefile.am
+++ b/src/driver/audiodec/Makefile.am
@@ -9,22 +9,22 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/zapit/include \
-I$(top_srcdir)/lib/libconfigfile \
@FREETYPE_CFLAGS@ \
- @VORBISIDEC_CFLAGS@ \
@HWLIB_CFLAGS@
noinst_LIBRARIES = libneutrino_driver_audiodec.a
-if ENABLE_FLAC
-FLACdec= flacdec.cpp
-endif
-
-libneutrino_driver_audiodec_a_SOURCES = \
- basedec.cpp \
- cdrdec.cpp \
+if ENABLE_FFMPEGDEC
+ASOURCES = ffmpegdec.cpp
+else
+ASOURCES = cdrdec.cpp \
crc.c \
- $(FLACdec) \
+ flacdec.cpp \
mp3dec.cpp \
oggdec.cpp \
tag.c \
wavdec.cpp
-# vis.cpp
+endif
+
+libneutrino_driver_audiodec_a_SOURCES = \
+ basedec.cpp \
+ $(ASOURCES)
diff --git a/src/driver/audiodec/basedec.cpp b/src/driver/audiodec/basedec.cpp
index c38752464..0c4c1bd52 100644
--- a/src/driver/audiodec/basedec.cpp
+++ b/src/driver/audiodec/basedec.cpp
@@ -27,13 +27,11 @@
#ifdef HAVE_CONFIG_H
#include
#endif
-#ifdef ENABLE_FLAC
-#include
-#endif
#include
#include
#include
#include
+#include
#include // for ShoutcastCallback()
@@ -42,13 +40,23 @@
#include
#include "basedec.h"
+#ifdef ENABLE_FFMPEGDEC
+#include "ffmpegdec.h"
+#else
#include "cdrdec.h"
#include "mp3dec.h"
#include "oggdec.h"
#include "wavdec.h"
+#ifdef ENABLE_FLAC
+#include "flacdec.h"
+#endif
+#endif
+
#include
unsigned int CBaseDec::mSamplerate=0;
+OpenThreads::Mutex CBaseDec::metaDataMutex;
+std::map CBaseDec::metaDataCache;
void ShoutcastCallback(void *arg)
{
@@ -79,57 +87,43 @@ CBaseDec::RetCode CBaseDec::DecoderBase(CAudiofile* const in,
if ( Status == OK )
{
+#ifndef ENABLE_FFMPEGDEC
if( in->FileType == CFile::STREAM_AUDIO )
{
if ( fstatus( fp, ShoutcastCallback ) < 0 )
- {
fprintf( stderr, "Error adding shoutcast callback: %s",
- err_txt );
- }
+ err_txt );
+
if (ftype(fp, "ogg"))
- {
Status = COggDec::getInstance()->Decoder( fp, OutputFd, state,
- &in->MetaData, t,
- secondsToSkip );
- }
+ &in->MetaData, t,
+ secondsToSkip );
else
- {
Status = CMP3Dec::getInstance()->Decoder( fp, OutputFd, state,
- &in->MetaData, t,
- secondsToSkip );
- }
+ &in->MetaData, t,
+ secondsToSkip );
}
else if( in->FileType == CFile::FILE_MP3)
- {
Status = CMP3Dec::getInstance()->Decoder( fp, OutputFd, state,
- &in->MetaData, t,
- secondsToSkip );
- }
+ &in->MetaData, t,
+ secondsToSkip );
else if( in->FileType == CFile::FILE_OGG )
- {
Status = COggDec::getInstance()->Decoder( fp, OutputFd, state,
- &in->MetaData, t,
- secondsToSkip );
- }
+ &in->MetaData, t,
+ secondsToSkip );
else if( in->FileType == CFile::FILE_WAV )
- {
Status = CWavDec::getInstance()->Decoder( fp, OutputFd, state,
- &in->MetaData, t,
- secondsToSkip );
- }
+ &in->MetaData, t,
+ secondsToSkip );
else if( in->FileType == CFile::FILE_CDR )
- {
Status = CCdrDec::getInstance()->Decoder( fp, OutputFd, state,
- &in->MetaData, t,
- secondsToSkip );
- }
+ &in->MetaData, t,
+ secondsToSkip );
#ifdef ENABLE_FLAC
else if (in->FileType == CFile::FILE_FLAC)
- {
Status = CFlacDec::getInstance()->Decoder(fp, OutputFd, state,
- &in->MetaData, t,
- secondsToSkip );
- }
+ &in->MetaData, t,
+ secondsToSkip );
#endif
else
{
@@ -138,55 +132,118 @@ CBaseDec::RetCode CBaseDec::DecoderBase(CAudiofile* const in,
Status = INTERNAL_ERR;
}
+#else
+ CFile::FileType ft = in->FileType;
+ if( in->FileType == CFile::STREAM_AUDIO )
+ {
+ if ( fstatus( fp, ShoutcastCallback ) < 0 )
+ fprintf( stderr, "Error adding shoutcast callback: %s", err_txt );
+
+ if (ftype(fp, "ogg"))
+ ft = CFile::FILE_OGG;
+ else if (ftype(fp, "mpeg"))
+ ft = CFile::FILE_MP3;
+ else
+ ft = CFile::FILE_UNKNOWN;
+ }
+ else
+ {
+ struct stat st;
+ if (!fstat(fileno(fp), &st))
+ in->MetaData.filesize = st.st_size;
+
+ }
+ in->MetaData.type = ft;
+
+ Status = CFfmpegDec::getInstance()->Decoder(fp, OutputFd, state, &in->MetaData, t, secondsToSkip );
+#endif
+
if ( fclose( fp ) == EOF )
{
- fprintf( stderr, "Could not close file %s.\n",
- in->Filename.c_str() );
+ fprintf( stderr, "Could not close file %s.\n", in->Filename.c_str() );
}
}
return Status;
}
+bool CBaseDec::LookupMetaData(CAudiofile* const in)
+{
+ bool res = false;
+ metaDataMutex.lock();
+ std::map::const_iterator it = metaDataCache.find(in->Filename);
+ if (it != metaDataCache.end()) {
+ *in = it->second;
+ res = true;
+ }
+ metaDataMutex.unlock();
+ return res;
+}
+
+void CBaseDec::CacheMetaData(CAudiofile* const in)
+{
+ metaDataMutex.lock();
+ // FIXME: This places a limit on the cache size. A LRU scheme would be more appropriate.
+ if (metaDataCache.size() > 128)
+ metaDataCache.clear();
+ metaDataCache[in->Filename] = *in;
+ metaDataMutex.unlock();
+}
+
+void CBaseDec::ClearMetaData()
+{
+ metaDataMutex.lock();
+ metaDataCache.clear();
+ metaDataMutex.unlock();
+}
+
bool CBaseDec::GetMetaDataBase(CAudiofile* const in, const bool nice)
{
- bool Status = true;
+ if (in->FileType == CFile::STREAM_AUDIO)
+ return true;
+ if (LookupMetaData(in))
+ return true;
+
+ bool Status = true;
+#ifndef ENABLE_FFMPEGDEC
if (in->FileType == CFile::FILE_MP3 || in->FileType == CFile::FILE_OGG
- || in->FileType == CFile::FILE_WAV || in->FileType == CFile::FILE_CDR
+ || in->FileType == CFile::FILE_WAV || in->FileType == CFile::FILE_CDR
#ifdef ENABLE_FLAC
- || in->FileType == CFile::FILE_FLAC
+ || in->FileType == CFile::FILE_FLAC
#endif
)
+#endif
{
FILE* fp = fopen( in->Filename.c_str(), "r" );
if ( fp == NULL )
{
fprintf( stderr, "Error opening file %s for meta data reading.\n",
- in->Filename.c_str() );
+ in->Filename.c_str() );
Status = false;
}
else
{
+#ifndef ENABLE_FFMPEGDEC
if(in->FileType == CFile::FILE_MP3)
{
Status = CMP3Dec::getInstance()->GetMetaData(fp, nice,
- &in->MetaData);
+ &in->MetaData);
}
else if(in->FileType == CFile::FILE_OGG)
{
Status = COggDec::getInstance()->GetMetaData(fp, nice,
- &in->MetaData);
+ &in->MetaData);
}
else if(in->FileType == CFile::FILE_WAV)
{
Status = CWavDec::getInstance()->GetMetaData(fp, nice,
- &in->MetaData);
+ &in->MetaData);
}
else if(in->FileType == CFile::FILE_CDR)
{
Status = CCdrDec::getInstance()->GetMetaData(fp, nice,
- &in->MetaData);
+ &in->MetaData);
}
#ifdef ENABLE_FLAC
else if (in->FileType == CFile::FILE_FLAC)
@@ -195,68 +252,39 @@ bool CBaseDec::GetMetaDataBase(CAudiofile* const in, const bool nice)
Status = FlacDec.GetMetaData(fp, nice, &in->MetaData);
}
#endif
+#else
+ struct stat st;
+ if (!fstat(fileno(fp), &st))
+ in->MetaData.filesize = st.st_size;
+ in->MetaData.type = in->FileType;
+
+ CFfmpegDec d;
+ Status = d.GetMetaData(fp, nice, &in->MetaData);
+#endif
+ if (Status)
+ CacheMetaData(in);
if ( fclose( fp ) == EOF )
{
fprintf( stderr, "Could not close file %s.\n",
- in->Filename.c_str() );
+ in->Filename.c_str() );
}
}
}
+#ifndef ENABLE_FFMPEGDEC
else
{
fprintf( stderr, "GetMetaDataBase: Filetype is not supported for " );
fprintf( stderr, "meta data reading.\n" );
Status = false;
}
+#endif
return Status;
}
-bool CBaseDec::SetDSP(int soundfd, int fmt, unsigned int dsp_speed, unsigned int channels)
-{
- bool crit_error=false;
-
- if (::ioctl(soundfd, SNDCTL_DSP_RESET))
- printf("reset failed\n");
- if(::ioctl(soundfd, SNDCTL_DSP_SETFMT, &fmt))
- printf("setfmt failed\n");
- if(::ioctl(soundfd, SNDCTL_DSP_CHANNELS, &channels))
- printf("channel set failed\n");
- if (dsp_speed != mSamplerate)
- {
- // mute audio to reduce pops when changing samplerate (avia_reset)
- //bool was_muted = avs_mute(true);
- if (::ioctl(soundfd, SNDCTL_DSP_SPEED, &dsp_speed))
- {
- printf("speed set failed\n");
- crit_error=true;
- }
- else
- {
-#if 0
- unsigned int rs = 0;
- ::ioctl(soundfd, SNDCTL_DSP_SPEED, &rs);
- mSamplerate = dsp_speed;
- // disable iec aka digi out (avia reset enables it again)
- //g_Zapit->IecOff();
-#endif
- }
- //usleep(400000);
- //if (!was_muted)
- // avs_mute(false);
- }
-//printf("Debug: SNDCTL_DSP_RESET %d / SNDCTL_DSP_SPEED %d / SNDCTL_DSP_CHANNELS %d / SNDCTL_DSP_SETFMT %d\n",
-// SNDCTL_DSP_RESET, SNDCTL_DSP_SPEED, SNDCTL_DSP_CHANNELS, SNDCTL_DSP_SETFMT);
- return crit_error;
-}
-
-bool CBaseDec::avs_mute(bool /*mute*/)
-{
- return true;
-}
-
void CBaseDec::Init()
{
mSamplerate=0;
}
+// vim:ts=4
diff --git a/src/driver/audiodec/basedec.h b/src/driver/audiodec/basedec.h
index 5715e3e7f..7e5bd3c27 100644
--- a/src/driver/audiodec/basedec.h
+++ b/src/driver/audiodec/basedec.h
@@ -32,6 +32,9 @@
#include
#include
#include
+#include