added hooks for netflix app manager

This commit is contained in:
jcli
2016-07-20 14:05:24 -07:00
parent f0584404e2
commit 474789340b
5 changed files with 103 additions and 2 deletions

View File

@@ -40,6 +40,10 @@
#include <signal.h>
#include <stdbool.h>
#include "nf_appmanager.h"
#define NF_APP_MANAGER
#define BUFSIZE 256
static char *spAppNetflix = "netflix"; // name of the netflix executable
@@ -58,6 +62,8 @@ static char spUuid[BUFSIZE];
extern bool wakeOnWifiLan;
static int gDialPort;
static bool sUseNFAppManager=false;
static char *spAppYouTube = "chrome";
static char *spAppYouTubeMatch = "chrome.*google-chrome-dial";
static char *spAppYouTubeExecutable = "/opt/google/chrome/google-chrome";
@@ -388,7 +394,18 @@ void runDial(void)
{
DIALServer *ds;
ds = DIAL_create();
struct DIALAppCallbacks cb_nf = {netflix_start, netflix_hide, netflix_stop, netflix_status};
struct DIALAppCallbacks cb_nf;
if (sUseNFAppManager){
cb_nf.start_cb = am_netflix_start;
cb_nf.hide_cb = am_netflix_hide;
cb_nf.stop_cb = am_netflix_stop;
cb_nf.status_cb = am_netflix_status;
}else{
cb_nf.start_cb = netflix_start;
cb_nf.hide_cb = netflix_hide;
cb_nf.stop_cb = netflix_stop;
cb_nf.status_cb = netflix_status;
}
struct DIALAppCallbacks cb_yt = {youtube_start, youtube_hide, youtube_stop, youtube_status};
DIAL_register_app(ds, "Netflix", &cb_nf, NULL, 1, ".netflix.com");
@@ -434,6 +451,13 @@ static void processOption( int index, char * pOption )
exit(1);
}
break;
case 6:
if (strcmp(pOption, "true")==0){
sUseNFAppManager=true;
}else{
sUseNFAppManager=false;
}
break;
default:
// Should not get here
fprintf( stderr, "Option %d not valid\n", index);