summaryrefslogtreecommitdiffstats
path: root/tvouthack
diff options
context:
space:
mode:
authormauimauer <sebastian@n-unity.de>2012-02-17 13:30:04 +0100
committermauimauer <sebastian@n-unity.de>2012-02-17 13:30:04 +0100
commitdc27c42df6c819a816660e86060d4dfa14c9f217 (patch)
tree9199ec864fdd64d07a3f1968af0a0b02c0f29c5e /tvouthack
parent72114c1c1583d3834c66b0e28cfe9999d9fd00ba (diff)
downloaddevice_samsung_n7000-dc27c42df6c819a816660e86060d4dfa14c9f217.zip
device_samsung_n7000-dc27c42df6c819a816660e86060d4dfa14c9f217.tar.gz
device_samsung_n7000-dc27c42df6c819a816660e86060d4dfa14c9f217.tar.bz2
Updated stuff for I9220ZSLP1
Diffstat (limited to 'tvouthack')
-rw-r--r--tvouthack/Android.mk27
-rw-r--r--tvouthack/main.cpp52
2 files changed, 79 insertions, 0 deletions
diff --git a/tvouthack/Android.mk b/tvouthack/Android.mk
new file mode 100644
index 0000000..19ad32f
--- /dev/null
+++ b/tvouthack/Android.mk
@@ -0,0 +1,27 @@
+# Copyright (C) 2012 The CyanogenMod Project
+# Copyright (C) 2012 Pawit Pornkitprasan
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES := main.cpp
+
+LOCAL_SHARED_LIBRARIES := libutils libbinder
+
+LOCAL_MODULE := TvOutHack
+
+include $(BUILD_EXECUTABLE)
diff --git a/tvouthack/main.cpp b/tvouthack/main.cpp
new file mode 100644
index 0000000..a59d4a9
--- /dev/null
+++ b/tvouthack/main.cpp
@@ -0,0 +1,52 @@
+#include <stdio.h>
+#include <binder/IPCThreadState.h>
+#include <binder/ProcessState.h>
+#include <binder/IServiceManager.h>
+#include <utils/Log.h>
+
+using namespace android;
+
+int main() {
+ sp<IServiceManager> sm = defaultServiceManager();
+ sp<IBinder> binder;
+
+ do {
+ binder = sm->getService(String16("TvoutService_C"));
+ if (binder != 0) break;
+ usleep(500000); // 0.5 s
+ } while(true);
+
+ int ret;
+
+ Parcel s2, r2;
+ s2.writeInterfaceToken(String16("android.hardware.ITvoutService"));
+ binder->transact(1, s2, &r2);
+ sp<IBinder> binder2 = r2.readStrongBinder();
+
+ while (true) {
+ {
+
+ Parcel send, reply;
+ int code = 4;
+ send.writeInterfaceToken(String16("android.hardware.Tvout"));
+ int ret = binder2->transact(code, send, &reply);
+ }
+ {
+
+ Parcel send, reply;
+ int code = 27;
+ send.writeInterfaceToken(String16("android.hardware.ITvout"));
+ int ret = binder2->transact(code, send, &reply);
+ }
+ {
+
+ Parcel send, reply;
+ int code = 13;
+ send.writeInterfaceToken(String16("android.hardware.ITvout"));
+ send.writeInt32(0);
+ int ret = binder2->transact(code, send, &reply);
+ }
+ usleep(15000); // Should give ~60 fps
+ }
+ return 0;
+}