From cdf27513762c3313f8ef8e606bb31533e5f25087 Mon Sep 17 00:00:00 2001 From: Pawit Pornkitprasan Date: Tue, 6 Dec 2011 14:45:41 +0700 Subject: Add TV Out support --- AriesParts/src/android/hardware/TvOut.java | 70 ++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 AriesParts/src/android/hardware/TvOut.java (limited to 'AriesParts/src/android/hardware/TvOut.java') diff --git a/AriesParts/src/android/hardware/TvOut.java b/AriesParts/src/android/hardware/TvOut.java new file mode 100644 index 0000000..6c0936e --- /dev/null +++ b/AriesParts/src/android/hardware/TvOut.java @@ -0,0 +1,70 @@ +package android.hardware; + +import java.lang.ref.WeakReference; + +import android.graphics.Bitmap; +import android.util.Log; + +public class TvOut { + private static final String TAG = "TvOut"; + + private int mListenerContext; + private int mNativeContext; + + public native void _DisableTvOut(); + + public native void _EnableTvOut(); + + public native void _SetOrientation(int paramInt); + + public native void _SetTvScreenSize(int paramInt); + + public native void _SetTvSystem(int paramInt); + + public native void _TvOutResume(int paramInt); + + public native void _TvOutSetImageString(String paramString); + + public native void _TvOutSuspend(String paramString); + + public native boolean _TvoutSubtitleIsEnable(); + + public native boolean _TvoutSubtitlePostBitmap(Bitmap paramBitmap, int paramInt); + + public native boolean _TvoutSubtitleSetStatus(int paramInt); + + public native int _getSubtitleHDMIHeight(); + + public native int _getSubtitleHDMIWidth(); + + public native boolean _isEnabled(); + + public native boolean _isSuspended(); + + public native boolean _isTvoutCableConnected(); + + private final native void _native_setup(Object paramObject); + + private final native void _release(); + + public native void _setTvoutCableConnected(int paramInt); + + static { + System.loadLibrary("tvout_jni"); + } + + public TvOut() { + _native_setup(new WeakReference(this)); + } + + public void finalize() { + _release(); + } + + private static void postEventFromNative(Object tvOutRef, int what, int arg1, int arg2, Object obj) { + TvOut tvOut = (TvOut)((WeakReference)tvOutRef).get(); + + Log.d(TAG, "Native Event: " + what + " " + arg1 + " " + arg2); + } + +} \ No newline at end of file -- cgit v1.1