summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchriszero <zerov83@gmail.com>2015-02-19 20:29:12 +0100
committerchriszero <zerov83@gmail.com>2015-02-19 20:29:12 +0100
commit7de1748cbaf31337f1f592cc9ee47f7872333f33 (patch)
treeb170afeb9e656675adfe0afa33b7b494be52fad6
parent216db1e9eb1800df1969ba3fd6755f898a0b2526 (diff)
downloadvdr-plugin-plex-7de1748cbaf31337f1f592cc9ee47f7872333f33.tar.gz
vdr-plugin-plex-7de1748cbaf31337f1f592cc9ee47f7872333f33.tar.bz2
Supporting custom transcoding profile.
-rw-r--r--Config.cpp8
-rw-r--r--Config.h3
-rw-r--r--VDR Plex Plugin.xml20
-rw-r--r--hlsPlayer.cpp9
-rw-r--r--plex.cpp1
5 files changed, 38 insertions, 3 deletions
diff --git a/Config.cpp b/Config.cpp
index 0ce98d6..c3a5abf 100644
--- a/Config.cpp
+++ b/Config.cpp
@@ -65,8 +65,11 @@ cMyMenuSetupPage::cMyMenuSetupPage(void)
strn0cpy(Username, Config::GetInstance().s_username.c_str(), STRING_SIZE);
strn0cpy(Password, Config::GetInstance().s_password.c_str(), STRING_SIZE);
strn0cpy(Uuid, Config::GetInstance().GetUUID().c_str(), STRING_SIZE);
+ HideMainMenuEntry = Config::GetInstance().HideMainMenuEntry;
+ UseCustomTranscodeProfile = Config::GetInstance().UseCustomTranscodeProfile;
- Add(new cMenuEditBoolItem(tr("Hide main menu entry"), (int*)&Config::GetInstance().HideMainMenuEntry, trVDR("no"), trVDR("yes")));
+ Add(new cMenuEditBoolItem(tr("Hide main menu entry"), (int*)&HideMainMenuEntry, trVDR("no"), trVDR("yes")));
+ Add(new cMenuEditBoolItem(tr("Use custom transcoding profile"), (int*)&UseCustomTranscodeProfile, trVDR("no"), trVDR("yes")));
Add(new cMenuEditStrItem(tr("Plex Username"), Username, STRING_SIZE));
Add(new cMenuEditStrItem(tr("Plex Password"), Password, STRING_SIZE));
cMenuEditStrItem* devUUID = new cMenuEditStrItem(tr("Current UUID"), Uuid, STRING_SIZE);
@@ -81,7 +84,10 @@ void cMyMenuSetupPage::Store(void)
{
Config::GetInstance().s_username = std::string(Username);
Config::GetInstance().s_password = std::string(Password);
+ Config::GetInstance().HideMainMenuEntry = HideMainMenuEntry;
+ Config::GetInstance().UseCustomTranscodeProfile = UseCustomTranscodeProfile;
+ SetupStore("UseCustomTranscodeProfile", Config::GetInstance().UseCustomTranscodeProfile);
SetupStore("HideMainMenuEntry", Config::GetInstance().HideMainMenuEntry);
SetupStore("Username", Config::GetInstance().s_username.c_str());
SetupStore("Password", Config::GetInstance().s_password.c_str());
diff --git a/Config.h b/Config.h
index a424305..a32bbcf 100644
--- a/Config.h
+++ b/Config.h
@@ -28,6 +28,7 @@ public:
std::string s_password;
bool HideMainMenuEntry;
+ bool UseCustomTranscodeProfile = false;
std::string GetUUID();
void SetUUID(const char* uuid);
@@ -57,6 +58,8 @@ class cMyMenuSetupPage:public cMenuSetupPage
char Username[STRING_SIZE];
char Password[STRING_SIZE];
char Uuid[STRING_SIZE];
+ int HideMainMenuEntry;
+ int UseCustomTranscodeProfile;
virtual void Store(void);
diff --git a/VDR Plex Plugin.xml b/VDR Plex Plugin.xml
new file mode 100644
index 0000000..a492308
--- /dev/null
+++ b/VDR Plex Plugin.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Edit for your needs (audioCodec)
+Copy this custom transcode profile to your "/Library/Application Support/Plex Media Server/Profiles"
+Restart the PMS.
+In the pluign options set "Use custom transcode profile" to "yes"
+-->
+<Client name="VDR Plex Plugin">
+ <TranscodeTargets>
+ <VideoProfile protocol="hls" container="mpegts" codec="h264" audioCodec="ac3,mp2,dts" context="streaming">
+ <Setting name="VideoEncodeFlags" value="-x264opts bframes=3:cabac=1" />
+ </VideoProfile>
+ <MusicProfile container="mp3" codec="mp3" />
+ <PhotoProfile container="jpeg" />
+ </TranscodeTargets>
+ <DirectPlayProfiles>
+ </DirectPlayProfiles>
+ <CodecProfiles>
+ </CodecProfiles>
+</Client>
diff --git a/hlsPlayer.cpp b/hlsPlayer.cpp
index fe52c7c..605280f 100644
--- a/hlsPlayer.cpp
+++ b/hlsPlayer.cpp
@@ -326,10 +326,15 @@ bool cHlsSegmentLoader::StopLoader(void)
void cHlsSegmentLoader::AddHeader(Poco::Net::HTTPRequest& req)
{
req.add("X-Plex-Client-Identifier", Config::GetInstance().GetUUID());
- req.add("X-Plex-Product", "Plex Home Theater");
req.add("X-Plex-Device", "PC");
- req.add("X-Plex-Platform", "Plex Home Theater");
req.add("X-Plex-Model", "Linux");
+ if(Config::GetInstance().UseCustomTranscodeProfile) {
+ req.add("X-Plex-Product", "VDR Plex Plugin");
+ req.add("X-Plex-Platform", "VDR Plex Plugin");
+ } else {
+ req.add("X-Plex-Product", "Plex Home Theater");
+ req.add("X-Plex-Platform", "Plex Home Theater");
+ }
}
bool cHlsSegmentLoader::Active(void)
diff --git a/plex.cpp b/plex.cpp
index 3707d88..0e40847 100644
--- a/plex.cpp
+++ b/plex.cpp
@@ -356,6 +356,7 @@ bool cMyPlugin::SetupParse(const char *name, const char *value)
//dsyslog("[plex]%s: '%s' = '%s'\n", __FUNCTION__, name, value);
if (strcasecmp(name, "HideMainMenuEntry") == 0) Config::GetInstance().HideMainMenuEntry = atoi(value) ? true : false;
+ else if (strcasecmp(name, "UseCustomTranscodeProfile") == 0) Config::GetInstance().UseCustomTranscodeProfile = atoi(value) ? true : false;
else if (strcasecmp(name, "Username") == 0) Config::GetInstance().s_username = std::string(value);
else if (strcasecmp(name, "Password") == 0) Config::GetInstance().s_password = std::string(value);
else if (strcasecmp(name, "UUID") == 0) Config::GetInstance().SetUUID(value);