Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

changed, add a proper GUI selector for AMLogic video decoder, refactor AMLogic bits in AESinkAUDIOTRACK #3344

Merged
merged 2 commits into from

4 participants

@davilla

No description provided.

@Memphiz

will be overwritten with 0.0 below ... if the diff shows it right - might want to add an else here?

crap, I'll rework it, I don't want a dangling else just waiting to f**k us over if someone does not watch what they are doing.

@davilla @FernetMenta @fritsch: This is our blip. I missed it on mainline due to amcodec not being enabled by default. :/

so adding this blips, removing it, removes the blip ?

Most of it :)

I'm still seeing a much shorter and less consistent blip of silence on the Pivos tree. I'll bring over @FernetMenta's work since a10 tomorrow, which I have high hopes of resolving the remainder.

this was added to resolve a noticeable constant a/v offset of about 1/4 second.

@Memphiz

want to use the setting here instead of aml_present like you did with the othrer?

no, if the device is some AMLogic SoC, then the m_audiotrack_empty_sec_tweaks applied for all audio, not just audio that comes from playing a video with amcodec. So it is device depended, not video codec dependent

@davilla davilla merged commit 405488d into xbmc:master
@ghost Unknown referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@Voyager1

I'm suspecting this is the cause of http://forum.xbmc.org/showthread.php?tid=181739&pid=1617597#pid1617597
The only right way to decode dvd menu stills is using libmpeg2 - because when amcodec is enabled, you'll ultimately fall back to ffmpeg decoding which is proven not to work for dvd stills (hint.stills = true and hint.software = true). Perhaps a solution to try would be:

if (!CSettings::Get().GetBool("videoplayer.useamcodec") || hint.software) 

to at least allow to get in here for software decoding.

hint.software is much less expensive than '!CSettings::Get().GetBool("videoplayer.useamcodec"' in the case of an OR, the less expensive operations should be first in line :)

Collaborator

of course, I was merely pointing out the idea.

@davilla davilla deleted the davilla:amcodec-guisettings branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 28, 2013
  1. @davilla

    changed, add a proper GUI selector for AMLogic video decoder, refacto…

    davilla authored
    …r AMLogic bits in AESinkAUDIOTRACK
  2. @davilla
This page is out of date. Refresh to see the latest.
View
14 language/English/strings.po
@@ -5796,7 +5796,12 @@ msgctxt "#13437"
msgid "Prefer VDPAU Video Mixer"
msgstr ""
-#empty strings from id 13438 to 13499
+#: system/settings/settings.xml
+msgctxt "#13438"
+msgid "Allow hardware acceleration (amcodec)"
+msgstr ""
+
+#empty strings from id 13439 to 13499
#: system/settings/settings.xml
msgctxt "#13500"
@@ -14196,7 +14201,12 @@ msgctxt "#36421"
msgid "Bypassing VDPAU mixer saves resources on low power systems but slightly reduces picture quality"
msgstr ""
-#empty strings from id 36422 to 36499
+#: system/settings/settings.xml
+msgctxt "#36422"
+msgid "Enable hardware video decode using AMLogic decoder"
+msgstr ""
+
+#empty strings from id 36423 to 36499
#end reservation
#: system/settings/settings.xml
View
9 system/settings/android.xml
@@ -10,6 +10,15 @@
<section id="videos">
<category id="videoplayer">
<group id="2">
+ <setting id="videoplayer.useamcodec" type="boolean" label="13438" help="36422">
+ <requirement>HAVE_AMCODEC</requirement>
+ <level>2</level>
+ <default>true</default>
+ </setting>
+ </group>
+ </category>
+ <category id="videoplayer">
+ <group id="2">
<setting id="videoplayer.usestagefright" type="boolean" label="13436" help="36260">
<requirement>HAVE_LIBSTAGEFRIGHTDECODER</requirement>
<level>2</level>
View
27 xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp
@@ -22,10 +22,11 @@
#include "Utils/AEUtil.h"
#include "Utils/AERingBuffer.h"
#include "android/activity/XBMCApp.h"
-#include "utils/log.h"
-#if defined(HAS_AMLPLAYER) || defined(HAS_LIBAMCODEC)
+#include "settings/Settings.h"
+#if defined(HAS_LIBAMCODEC)
#include "utils/AMLUtils.h"
#endif
+#include "utils/log.h"
#include <jni.h>
@@ -82,17 +83,16 @@ CAESinkAUDIOTRACK::CAESinkAUDIOTRACK()
m_draining = false;
m_audiotrackbuffer_sec = 0.0;
m_audiotrack_empty_sec = 0.0;
- m_volume = 1.0;
-#if defined(HAS_AMLPLAYER) || defined(HAS_LIBAMCODEC)
- aml_cpufreq_limit(true);
+ m_audiotrack_empty_sec_tweaks = 0.0;
+#if defined(HAS_LIBAMCODEC)
+ if (aml_present())
+ m_audiotrack_empty_sec_tweaks = 0.250;
#endif
+ m_volume = 1.0;
}
CAESinkAUDIOTRACK::~CAESinkAUDIOTRACK()
{
-#if defined(HAS_AMLPLAYER) || defined(HAS_LIBAMCODEC)
- aml_cpufreq_limit(false);
-#endif
}
bool CAESinkAUDIOTRACK::Initialize(AEAudioFormat &format, std::string &device)
@@ -105,8 +105,9 @@ bool CAESinkAUDIOTRACK::Initialize(AEAudioFormat &format, std::string &device)
m_passthrough = false;
#if defined(HAS_LIBAMCODEC)
- if (aml_present())
+ if (CSettings::Get().GetBool("videoplayer.useamcodec"))
aml_set_audio_passthrough(m_passthrough);
+ }
#endif
// default to 44100, all android devices support it.
@@ -184,10 +185,8 @@ double CAESinkAUDIOTRACK::GetDelay()
double sinkbuffer_seconds_to_empty = m_sinkbuffer_sec_per_byte * (double)m_sinkbuffer->GetReadSize();
sinkbuffer_seconds_to_empty += m_audiotrack_empty_sec;
-#if defined(HAS_LIBAMCODEC)
if (sinkbuffer_seconds_to_empty > 0.0)
- sinkbuffer_seconds_to_empty += 0.250;
-#endif
+ sinkbuffer_seconds_to_empty += m_audiotrack_empty_sec_tweaks;
return sinkbuffer_seconds_to_empty;
}
@@ -198,10 +197,8 @@ double CAESinkAUDIOTRACK::GetCacheTime()
double sinkbuffer_seconds_to_empty = m_sinkbuffer_sec_per_byte * (double)m_sinkbuffer->GetReadSize();
sinkbuffer_seconds_to_empty += m_audiotrack_empty_sec;
-#if defined(HAS_LIBAMCODEC)
if (sinkbuffer_seconds_to_empty > 0.0)
- sinkbuffer_seconds_to_empty += 0.250;
-#endif
+ sinkbuffer_seconds_to_empty += m_audiotrack_empty_sec_tweaks;
return sinkbuffer_seconds_to_empty;
}
View
1  xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.h
@@ -69,4 +69,5 @@ class CAESinkAUDIOTRACK : public CThread, public IAESink
double m_audiotrackbuffer_sec;
double m_audiotrack_empty_sec;
+ double m_audiotrack_empty_sec_tweaks;
};
View
16 xbmc/cores/dvdplayer/DVDCodecs/DVDFactoryCodec.cpp
@@ -186,13 +186,17 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, unsigne
#endif
CLog::Log(LOGDEBUG, "CDVDFactoryCodec: compiled in hardware support: %s", hwSupport.c_str());
-#if !defined(HAS_LIBAMCODEC)
- // dvd's have weird still-frames in it, which is not fully supported in ffmpeg
- if(hint.stills && (hint.codec == AV_CODEC_ID_MPEG2VIDEO || hint.codec == AV_CODEC_ID_MPEG1VIDEO))
+#if defined(HAS_LIBAMCODEC)
+ // amcodec can handle dvd playback.
+ if (!CSettings::Get().GetBool("videoplayer.useamcodec"))
+#endif
{
- if( (pCodec = OpenCodec(new CDVDVideoCodecLibMpeg2(), hint, options)) ) return pCodec;
+ // dvd's have weird still-frames in it, which is not fully supported in ffmpeg
+ if(hint.stills && (hint.codec == AV_CODEC_ID_MPEG2VIDEO || hint.codec == AV_CODEC_ID_MPEG1VIDEO))
+ {
+ if( (pCodec = OpenCodec(new CDVDVideoCodecLibMpeg2(), hint, options)) ) return pCodec;
+ }
}
-#endif
#if defined(TARGET_DARWIN_OSX)
if (!hint.software && CSettings::Get().GetBool("videoplayer.usevda"))
@@ -248,7 +252,7 @@ CDVDVideoCodec* CDVDFactoryCodec::CreateVideoCodec(CDVDStreamInfo &hint, unsigne
#endif
#if defined(HAS_LIBAMCODEC)
- if (!hint.software && aml_present())
+ if (!hint.software && CSettings::Get().GetBool("videoplayer.useamcodec"))
{
CLog::Log(LOGINFO, "Amlogic Video Decoder...");
if ( (pCodec = OpenCodec(new CDVDVideoCodecAmlogic(), hint, options)) ) return pCodec;
View
8 xbmc/settings/Settings.cpp
@@ -83,6 +83,10 @@
#include "view/ViewStateSettings.h"
#include "windowing/WindowingFactory.h"
+#if defined(HAS_LIBAMCODEC)
+#include "utils/AMLUtils.h"
+#endif
+
#define SETTINGS_XML_FOLDER "special://xbmc/system/settings/"
#define SETTINGS_XML_ROOT "settings"
@@ -760,6 +764,10 @@ void CSettings::InitializeConditions()
if (g_sysinfo.HasVideoToolBoxDecoder())
m_settingsManager->AddCondition("hasvideotoolboxdecoder");
#endif
+#ifdef HAS_LIBAMCODEC
+ if (aml_present())
+ m_settingsManager->AddCondition("have_amcodec");
+#endif
#ifdef HAS_LIBSTAGEFRIGHT
m_settingsManager->AddCondition("have_libstagefrightdecoder");
#endif
Something went wrong with that request. Please try again.