diff options
author | chriszero <zerov83@gmail.com> | 2015-10-02 20:07:19 +0200 |
---|---|---|
committer | chriszero <zerov83@gmail.com> | 2015-10-02 20:07:19 +0200 |
commit | 0be6c14499cbc7351578198e8f15b3e1bf1b1335 (patch) | |
tree | 4f52aa690a45dfa1bc2354e0e562dba9978482b4 | |
parent | 98a8f298b1886f63c99c8f2e0833e0393e5b5822 (diff) | |
download | vdr-plugin-plex-0be6c14499cbc7351578198e8f15b3e1bf1b1335.tar.gz vdr-plugin-plex-0be6c14499cbc7351578198e8f15b3e1bf1b1335.tar.bz2 |
Option to use AC3 audio without installing the custom profile to your pms
-rw-r--r-- | Config.cpp | 5 | ||||
-rw-r--r-- | Config.h | 3 | ||||
-rw-r--r-- | PVideo.cpp | 9 | ||||
-rw-r--r-- | PVideo.h | 2 | ||||
-rw-r--r-- | Plexservice.cpp | 20 | ||||
-rw-r--r-- | plex.h | 2 | ||||
-rw-r--r-- | po/de_DE.po | 7 |
7 files changed, 40 insertions, 8 deletions
@@ -106,6 +106,7 @@ bool Config::Parse(const char *name, const char *value) else if (strcasecmp(name, "UseMpv") == 0) Config::GetInstance().UseMpv = atoi(value) ? true : false; else if (strcasecmp(name, "ScrollByPage") == 0) Config::GetInstance().ScrollByPage = atoi(value) ? true : false; else if (strcasecmp(name, "ScrollAllAround") == 0) Config::GetInstance().ScrollAllAround = atoi(value) ? true : false; + else if (strcasecmp(name, "UseAc3") == 0) Config::GetInstance().UseAc3 = atoi(value) ? true : false; else parsed = false; if(!parsed) { @@ -155,9 +156,11 @@ cMyMenuSetupPage::cMyMenuSetupPage(void) ScrollByPage = Config::GetInstance().ScrollByPage; ScrollAllAround = Config::GetInstance().ScrollAllAround; DefaultViewMode = Config::GetInstance().DefaultViewMode; + UseAc3 = Config::GetInstance().UseAc3; Add(new cMenuEditBoolItem(tr("Hide main menu entry"), (int*)&HideMainMenuEntry, trVDR("no"), trVDR("yes"))); + Add(new cMenuEditBoolItem(tr("Use AC3 instead of aac Audio"), (int*)&UseAc3, trVDR("no"), trVDR("yes"))); Add(new cMenuEditBoolItem(tr("Use Mpv Plugin (If Availiable)"), (int*)&UseMpv, trVDR("no"), trVDR("yes"))); Add(new cMenuEditBoolItem(tr("Scroll by Page"), (int*)&ScrollByPage, trVDR("no"), trVDR("yes"))); Add(new cMenuEditBoolItem(tr("Scroll all around"), (int*)&ScrollAllAround, trVDR("no"), trVDR("yes"))); @@ -209,6 +212,7 @@ void cMyMenuSetupPage::Store(void) Config::GetInstance().UseMpv = UseMpv; Config::GetInstance().ScrollByPage = ScrollByPage; Config::GetInstance().ScrollAllAround = ScrollAllAround; + Config::GetInstance().UseAc3 = UseAc3; SetupStore("UseCustomTranscodeProfile", Config::GetInstance().UseCustomTranscodeProfile); SetupStore("HideMainMenuEntry", Config::GetInstance().HideMainMenuEntry); @@ -229,4 +233,5 @@ void cMyMenuSetupPage::Store(void) SetupStore("UseMpv", Config::GetInstance().UseMpv); SetupStore("ScrollByPage", Config::GetInstance().ScrollByPage); SetupStore("ScrollAllAround", Config::GetInstance().ScrollAllAround); + SetupStore("UseAc3", Config::GetInstance().ScrollAllAround); } @@ -46,6 +46,8 @@ public: bool UseCustomTranscodeProfile; bool UsePlexAccount; bool UseConfiguredServer; + bool UseAc3; + int CoverGridColumns; int CoverGridRows; @@ -117,6 +119,7 @@ class cMyMenuSetupPage:public cMenuSetupPage int UseMpv; int ScrollByPage; int ScrollAllAround; + int UseAc3; virtual void Store(void); @@ -331,4 +331,13 @@ std::string Video::ThumbUri() return m_pServer->GetUri() + '/' + m_sThumb; } +std::string Video::GetSubtitleUrl() +{ + // /video/:/transcode/universal/subtitles + // Argument? m_sKey? + //std::string subtitleUrl = m_pServer.GetUri() + "/video/:/transcode/universal/subtitles?" + Config::GetInstance().GetUUID(); + return ""; + // Format is "Mpeg4 Timed Text" +} + } // Namespace @@ -88,6 +88,8 @@ public: bool SetUnwatched(); std::string ThumbUri(); std::string ArtUri(); + + std::string GetSubtitleUrl(); // gridElement virtual void AddTokens(std::shared_ptr<skindesignerapi::cOsdElement> grid, bool clear = true, std::function<void(cGridElement*)> OnCached = NULL); diff --git a/Plexservice.cpp b/Plexservice.cpp index 20db51e..bae8ed2 100644 --- a/Plexservice.cpp +++ b/Plexservice.cpp @@ -189,7 +189,6 @@ std::string Plexservice::encode(std::string message) return temp; } - std::string Plexservice::GetUniversalTranscodeUrl(Video* video, int offset, PlexServer* server) { PlexServer* pSrv = server ? server : video->m_pServer; @@ -200,19 +199,30 @@ std::string Plexservice::GetUniversalTranscodeUrl(Video* video, int offset, Plex params << "&partIndex=0"; params << "&protocol=hls"; params << "&offset=" << offset; - params << "&fastSeek=1"; + params << "&fastSeek=0"; params << "&directPlay=0"; params << "&directStream=1"; params << "&maxVideoBitrate=20000"; - //params << "&subtitles=burn"; + params << "&subtitles=burn"; //params << "&subtitleSize=90"; //params << "&skipSubtitles=1"; //params << "&audioBoost=100"; params << "&videoResolution=1920x1080"; params << "&videoQuality=100"; params << "&session=" << encode(Config::GetInstance().GetUUID()); // TODO: generate Random SessionID - - + + params << "&includeCodecs=1"; + params << "©ts=1"; + + if(Config::GetInstance().UseAc3) { + params << "&X-Plex-Client-Profile-Extra="; + if(Config::GetInstance().UseAc3) + params << encode("add-transcode-target-audio-codec(type=videoProfile&context=streaming&protocol=hls&audioCodec=ac3)"); + + //params << encode("+add-limitation(scope=videoCodec&scopeName=h264&type=lowerBound&name=video.height&value=1080)"); + //params << encode("+add-limitation(scope=videoCodec&scopeName=h264&type=lowerBound&name=video.frameRate&value=25)"); + //params << encode("+add-limitation(scope=videoCodec&scopeName=h264&type=upperBound&name=video.frameRate&value=25)"); + } return pSrv->GetUri() + params.str(); } @@ -28,7 +28,7 @@ /// vdr-plugin version number. /// Makefile extracts the version number for generating the file name /// for the distribution archive. -static const char *const VERSION = "0.1.4" +static const char *const VERSION = "0.1.5" #ifdef GIT_REV "-GIT" GIT_REV #endif diff --git a/po/de_DE.po b/po/de_DE.po index be74288..d4244f4 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: vdr-plex 0.1.0\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2015-07-05 13:51+0200\n" -"PO-Revision-Date: 2015-07-05 16:25+0200\n" +"POT-Creation-Date: 2015-10-02 18:19+0200\n" +"PO-Revision-Date: 2015-10-02 20:06+0200\n" "Last-Translator: Chris <zerov83@gmail.com>\n" "Language-Team: LANGUAGE <LL@li.org>\n" "Language: de\n" @@ -36,6 +36,9 @@ msgstr "Gesehen" msgid "Hide main menu entry" msgstr "Verstecke Hauptmenüeintrag" +msgid "Use AC3 instead of aac Audio" +msgstr "Verwende AC3 anstelle von AAC" + msgid "Use Mpv Plugin (If Availiable)" msgstr "Verwende MPV-Plugin falls verfügbar" |