summaryrefslogtreecommitdiff
Diffstat
-rw-r--r--TvPlay.cpp25
-rw-r--r--TvPlay.h2
-rw-r--r--tv_input.cpp262
3 files changed, 113 insertions, 176 deletions
diff --git a/TvPlay.cpp b/TvPlay.cpp
index 030b9f4..266e264 100644
--- a/TvPlay.cpp
+++ b/TvPlay.cpp
@@ -1,4 +1,7 @@
+#define LOG_TAG "TvPlay"
+
#include <utils/Log.h>
+#include <string.h>
#include "TvPlay.h"
#include "tvcmd.h"
@@ -95,3 +98,25 @@ int TvPlay::GetHdmiAvHotplugDetectOnoff()
return r.readInt32();
}
+int TvPlay::getAllTvDevices(int *devices, int *count)
+{
+ Parcel p, r;
+ p.writeInt32(GET_ALL_TV_DEVICES);
+ tvSession->processCmd(p, &r);
+ const char *input_list = r.readCString();
+ ALOGD("input_list = %s", input_list);
+
+ int len = 0;
+ const char *seg = ",";
+ char *pT = strtok((char*)input_list, seg);
+ while (pT) {
+ len ++;
+ *devices = atoi(pT);
+ ALOGD("devices: %d: %d", len , *devices);
+ devices ++;
+ pT = strtok(NULL, seg);
+ }
+ *count = len;
+ return 0;
+}
+