summaryrefslogtreecommitdiffstats
path: root/TVOutDummy
diff options
context:
space:
mode:
Diffstat (limited to 'TVOutDummy')
-rw-r--r--TVOutDummy/Android.mk40
-rw-r--r--TVOutDummy/Barrier.h55
-rw-r--r--TVOutDummy/ISecTVOut.cpp111
-rw-r--r--TVOutDummy/ISecTVOut.h74
-rw-r--r--TVOutDummy/MessageQueue.cpp197
-rw-r--r--TVOutDummy/MessageQueue.h126
-rw-r--r--TVOutDummy/SecTVOutService.cpp168
-rw-r--r--TVOutDummy/SecTVOutService.h94
-rw-r--r--TVOutDummy/main.cpp11
9 files changed, 876 insertions, 0 deletions
diff --git a/TVOutDummy/Android.mk b/TVOutDummy/Android.mk
new file mode 100644
index 0000000..1e74174
--- /dev/null
+++ b/TVOutDummy/Android.mk
@@ -0,0 +1,40 @@
+# Copyright (C) 2008 The Android Open Source Project
+#
+# 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)
+
+#
+# libTVOut
+#
+
+include $(CLEAR_VARS)
+LOCAL_MODULE_TAGS := optional
+LOCAL_PRELINK_MODULE := false
+
+LOCAL_SRC_FILES := \
+ SecTVOutService.cpp \
+ MessageQueue.cpp \
+ main.cpp
+# ISecTVOut.cpp \
+
+LOCAL_C_INCLUDES := \
+
+LOCAL_SHARED_LIBRARIES := \
+ libbinder \
+ libutils \
+ libcutils
+
+LOCAL_MODULE := TVOutDummy
+include $(BUILD_EXECUTABLE)
+
diff --git a/TVOutDummy/Barrier.h b/TVOutDummy/Barrier.h
new file mode 100644
index 0000000..6f8507e
--- /dev/null
+++ b/TVOutDummy/Barrier.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * 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.
+ */
+
+#ifndef ANDROID_BARRIER_H
+#define ANDROID_BARRIER_H
+
+#include <stdint.h>
+#include <sys/types.h>
+#include <utils/threads.h>
+
+namespace android {
+
+class Barrier
+{
+public:
+ inline Barrier() : state(CLOSED) { }
+ inline ~Barrier() { }
+ void open() {
+ Mutex::Autolock _l(lock);
+ state = OPENED;
+ cv.broadcast();
+ }
+ void close() {
+ Mutex::Autolock _l(lock);
+ state = CLOSED;
+ }
+ void wait() const {
+ Mutex::Autolock _l(lock);
+ while (state == CLOSED) {
+ cv.wait(lock);
+ }
+ }
+private:
+ enum { OPENED, CLOSED };
+ mutable Mutex lock;
+ mutable Condition cv;
+ volatile int state;
+};
+
+}; // namespace android
+
+#endif // ANDROID_BARRIER_H
diff --git a/TVOutDummy/ISecTVOut.cpp b/TVOutDummy/ISecTVOut.cpp
new file mode 100644
index 0000000..a013bf1
--- /dev/null
+++ b/TVOutDummy/ISecTVOut.cpp
@@ -0,0 +1,111 @@
+/*
+**
+** Copyright 2008, The Android Open Source Project
+** Copyright 2010, Samsung Electronics Co. LTD
+**
+** 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.
+*/
+
+/*
+**
+** @author Taikyung, Yu(taikyung.yu@samsung.com)
+** @date 2011-07-06
+*/
+
+#include <stdint.h>
+#include <sys/types.h>
+#include <binder/Parcel.h>
+#include <utils/Log.h>
+#include "ISecTVOut.h"
+
+namespace android {
+
+ enum {
+ SET_HDMI_STATUS = IBinder::FIRST_CALL_TRANSACTION,
+ SET_HDMI_MODE,
+ SET_HDMI_RESOLUTION,
+ SET_HDMI_HDCP,
+ SET_HDMI_ROTATE,
+ SET_HDMI_HWCLAYER,
+ BLIT_2_HDMI
+ };
+
+ void BpSecTVOut::setHdmiCableStatus(uint32_t status)
+ {
+ Parcel data, reply;
+ data.writeInt32(status);
+ remote()->transact(SET_HDMI_STATUS, data, &reply);
+ }
+
+ void BpSecTVOut::setHdmiMode(uint32_t mode)
+ {
+ Parcel data, reply;
+ data.writeInt32(mode);
+ remote()->transact(SET_HDMI_MODE, data, &reply);
+ }
+
+ void BpSecTVOut::setHdmiResolution(uint32_t resolution)
+ {
+ Parcel data, reply;
+ data.writeInt32(resolution);
+ remote()->transact(SET_HDMI_RESOLUTION, data, &reply);
+ }
+
+ void BpSecTVOut::setHdmiHdcp(uint32_t resolution)
+ {
+ Parcel data, reply;
+ data.writeInt32(resolution);
+ remote()->transact(SET_HDMI_HDCP, data, &reply);
+ }
+
+ void BpSecTVOut::setHdmiRotate(uint32_t rotVal, uint32_t hwcLayer)
+ {
+ Parcel data, reply;
+ data.writeInt32(rotVal);
+ data.writeInt32(hwcLayer);
+ remote()->transact(SET_HDMI_ROTATE, data, &reply);
+ }
+
+ void BpSecTVOut::setHdmiHwcLayer(uint32_t hwcLayer)
+ {
+ Parcel data, reply;
+ data.writeInt32(hwcLayer);
+ remote()->transact(SET_HDMI_HWCLAYER, data, &reply);
+ }
+
+ void BpSecTVOut::blit2Hdmi(uint32_t w, uint32_t h,
+ uint32_t colorFormat,
+ uint32_t physYAddr,
+ uint32_t physCbAddr,
+ uint32_t physCrAddr,
+ uint32_t dstX,
+ uint32_t dstY,
+ uint32_t hdmiLayer,
+ uint32_t num_of_hwc_layer)
+ {
+ Parcel data, reply;
+ data.writeInt32(w);
+ data.writeInt32(h);
+ data.writeInt32(colorFormat);
+ data.writeInt32(physYAddr);
+ data.writeInt32(physCbAddr);
+ data.writeInt32(physCrAddr);
+ data.writeInt32(dstX);
+ data.writeInt32(dstY);
+ data.writeInt32(hdmiLayer);
+ data.writeInt32(num_of_hwc_layer);
+ remote()->transact(BLIT_2_HDMI, data, &reply);
+ }
+
+ IMPLEMENT_META_INTERFACE(SecTVOut, "android.os.ISecTVOut");
+};
diff --git a/TVOutDummy/ISecTVOut.h b/TVOutDummy/ISecTVOut.h
new file mode 100644
index 0000000..5506b57
--- /dev/null
+++ b/TVOutDummy/ISecTVOut.h
@@ -0,0 +1,74 @@
+/*
+**
+** Copyright 2008, The Android Open Source Project
+** Copyright 2010, Samsung Electronics Co. LTD
+**
+** 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.
+*/
+
+/*
+**
+** @author Taikyung, Yu(taikyung.yu@samsung.com)
+** @date 2011-07-06
+*/
+
+#ifndef ISECTVOUT_H
+#define ISECTVOUT_H
+#include <utils/RefBase.h>
+#include <binder/IInterface.h>
+#include <binder/Parcel.h>
+
+namespace android {
+ class ISecTVOut: public IInterface
+ {
+ public:
+ DECLARE_META_INTERFACE(SecTVOut);
+ virtual void setHdmiCableStatus(uint32_t status) = 0;
+ virtual void setHdmiMode(uint32_t mode) = 0;
+ virtual void setHdmiResolution(uint32_t resolution) = 0;
+ virtual void setHdmiHdcp(uint32_t enHdcp) = 0;
+ virtual void setHdmiRotate(uint32_t rotVal, uint32_t hwcLayer) = 0;
+ virtual void setHdmiHwcLayer(uint32_t hwcLayer) = 0;
+ virtual void blit2Hdmi(uint32_t w, uint32_t h,
+ uint32_t colorFormat,
+ uint32_t physYAddr,
+ uint32_t physCbAddr,
+ uint32_t physCrAddr,
+ uint32_t dstX,
+ uint32_t dstY,
+ uint32_t hdmiLayer,
+ uint32_t num_of_hwc_layer) = 0;
+ };
+ //--------------------------------------------------------------
+ class BpSecTVOut: public BpInterface<ISecTVOut>
+ {
+ public:
+ BpSecTVOut(const sp<IBinder>& impl): BpInterface<ISecTVOut>(impl){}
+ virtual void setHdmiCableStatus(uint32_t status);
+ virtual void setHdmiMode(uint32_t mode);
+ virtual void setHdmiResolution(uint32_t resolution);
+ virtual void setHdmiHdcp(uint32_t enHdcp);
+ virtual void setHdmiRotate(uint32_t rotVal, uint32_t hwcLayer);
+ virtual void setHdmiHwcLayer(uint32_t hwcLayer);
+ virtual void blit2Hdmi(uint32_t w, uint32_t h,
+ uint32_t colorFormat,
+ uint32_t physYAddr,
+ uint32_t physCbAddr,
+ uint32_t physCrAddr,
+ uint32_t dstX,
+ uint32_t dstY,
+ uint32_t hdmiLayer,
+ uint32_t num_of_hwc_layer);
+ };
+};
+#endif
diff --git a/TVOutDummy/MessageQueue.cpp b/TVOutDummy/MessageQueue.cpp
new file mode 100644
index 0000000..9441019
--- /dev/null
+++ b/TVOutDummy/MessageQueue.cpp
@@ -0,0 +1,197 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * 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.
+ */
+
+#include <stdint.h>
+#include <errno.h>
+#include <sys/types.h>
+
+#include <utils/threads.h>
+#include <utils/Timers.h>
+#include <utils/Log.h>
+#include <binder/IPCThreadState.h>
+
+#include "MessageQueue.h"
+
+namespace android {
+
+// ---------------------------------------------------------------------------
+
+void MessageList::insert(const sp<MessageBase>& node)
+{
+ LIST::iterator cur(mList.begin());
+ LIST::iterator end(mList.end());
+ while (cur != end) {
+ if (*node < **cur) {
+ mList.insert(cur, node);
+ return;
+ }
+ ++cur;
+ }
+ mList.insert(++end, node);
+}
+
+void MessageList::remove(MessageList::LIST::iterator pos)
+{
+ mList.erase(pos);
+}
+
+// ---------------------------------------------------------------------------
+
+MessageQueue::MessageQueue()
+ : mInvalidate(false)
+{
+ mInvalidateMessage = new MessageBase(INVALIDATE);
+}
+
+MessageQueue::~MessageQueue()
+{
+}
+
+sp<MessageBase> MessageQueue::waitMessage(nsecs_t timeout)
+{
+ sp<MessageBase> result;
+
+ bool again;
+ do {
+ const nsecs_t timeoutTime = systemTime() + timeout;
+ while (true) {
+ Mutex::Autolock _l(mLock);
+ nsecs_t now = systemTime();
+ nsecs_t nextEventTime = -1;
+
+ LIST::iterator cur(mMessages.begin());
+ if (cur != mMessages.end()) {
+ result = *cur;
+ }
+
+ if (result != 0) {
+ if (result->when <= now) {
+ // there is a message to deliver
+ mMessages.remove(cur);
+ break;
+ }
+ nextEventTime = result->when;
+ result = 0;
+ }
+
+ // see if we have an invalidate message
+ if (mInvalidate) {
+ mInvalidate = false;
+ mInvalidateMessage->when = now;
+ result = mInvalidateMessage;
+ break;
+ }
+
+ if (timeout >= 0) {
+ if (timeoutTime < now) {
+ // we timed-out, return a NULL message
+ result = 0;
+ break;
+ }
+ if (nextEventTime > 0) {
+ if (nextEventTime > timeoutTime) {
+ nextEventTime = timeoutTime;
+ }
+ } else {
+ nextEventTime = timeoutTime;
+ }
+ }
+
+ if (nextEventTime >= 0) {
+ //ALOGD("nextEventTime = %lld ms", nextEventTime);
+ if (nextEventTime > 0) {
+ // we're about to wait, flush the binder command buffer
+ IPCThreadState::self()->flushCommands();
+ const nsecs_t reltime = nextEventTime - systemTime();
+ if (reltime > 0) {
+ mCondition.waitRelative(mLock, reltime);
+ }
+ }
+ } else {
+ //ALOGD("going to wait");
+ // we're about to wait, flush the binder command buffer
+ IPCThreadState::self()->flushCommands();
+ mCondition.wait(mLock);
+ }
+ }
+ // here we're not holding the lock anymore
+
+ if (result == 0)
+ break;
+
+ again = result->handler();
+ if (again) {
+ // the message has been processed. release our reference to it
+ // without holding the lock.
+ result->notify();
+ result = 0;
+ }
+
+ } while (again);
+
+ return result;
+}
+
+status_t MessageQueue::postMessage(
+ const sp<MessageBase>& message, nsecs_t relTime, uint32_t flags)
+{
+ return queueMessage(message, relTime, flags);
+}
+
+status_t MessageQueue::invalidate() {
+ Mutex::Autolock _l(mLock);
+ mInvalidate = true;
+ mCondition.signal();
+ return NO_ERROR;
+}
+
+status_t MessageQueue::queueMessage(
+ const sp<MessageBase>& message, nsecs_t relTime, uint32_t flags)
+{
+ Mutex::Autolock _l(mLock);
+ message->when = systemTime() + relTime;
+ mMessages.insert(message);
+
+ //ALOGD("MessageQueue::queueMessage time = %lld ms", message->when);
+ //dumpLocked(message);
+
+ mCondition.signal();
+ return NO_ERROR;
+}
+
+void MessageQueue::dump(const sp<MessageBase>& message)
+{
+ Mutex::Autolock _l(mLock);
+ dumpLocked(message);
+}
+
+void MessageQueue::dumpLocked(const sp<MessageBase>& message)
+{
+ LIST::const_iterator cur(mMessages.begin());
+ LIST::const_iterator end(mMessages.end());
+ int c = 0;
+ while (cur != end) {
+ const char tick = (*cur == message) ? '>' : ' ';
+ ALOGD("%c %d: msg{.what=%08x, when=%lld}",
+ tick, c, (*cur)->what, (*cur)->when);
+ ++cur;
+ c++;
+ }
+}
+
+// ---------------------------------------------------------------------------
+
+}; // namespace android
diff --git a/TVOutDummy/MessageQueue.h b/TVOutDummy/MessageQueue.h
new file mode 100644
index 0000000..890f809
--- /dev/null
+++ b/TVOutDummy/MessageQueue.h
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * 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.
+ */
+
+#ifndef ANDROID_MESSAGE_QUEUE_H
+#define ANDROID_MESSAGE_QUEUE_H
+
+#include <stdint.h>
+#include <errno.h>
+#include <sys/types.h>
+
+#include <utils/threads.h>
+#include <utils/Timers.h>
+#include <utils/List.h>
+
+#include "Barrier.h"
+
+namespace android {
+
+// ---------------------------------------------------------------------------
+
+class MessageBase;
+
+class MessageList
+{
+ List< sp<MessageBase> > mList;
+ typedef List< sp<MessageBase> > LIST;
+public:
+ inline LIST::iterator begin() { return mList.begin(); }
+ inline LIST::const_iterator begin() const { return mList.begin(); }
+ inline LIST::iterator end() { return mList.end(); }
+ inline LIST::const_iterator end() const { return mList.end(); }
+ inline bool isEmpty() const { return mList.empty(); }
+ void insert(const sp<MessageBase>& node);
+ void remove(LIST::iterator pos);
+};
+
+// ============================================================================
+
+class MessageBase :
+ public LightRefBase<MessageBase>
+{
+public:
+ nsecs_t when;
+ uint32_t what;
+ int32_t arg0;
+
+ MessageBase() : when(0), what(0), arg0(0) { }
+ MessageBase(uint32_t what, int32_t arg0=0)
+ : when(0), what(what), arg0(arg0) { }
+
+ // return true if message has a handler
+ virtual bool handler() { return false; }
+
+ // waits for the handler to be processed
+ void wait() const { barrier.wait(); }
+
+ // releases all waiters. this is done automatically if
+ // handler returns true
+ void notify() const { barrier.open(); }
+
+protected:
+ virtual ~MessageBase() { }
+
+private:
+ mutable Barrier barrier;
+ friend class LightRefBase<MessageBase>;
+};
+
+inline bool operator < (const MessageBase& lhs, const MessageBase& rhs) {
+ return lhs.when < rhs.when;
+}
+
+// ---------------------------------------------------------------------------
+
+class MessageQueue
+{
+ typedef List< sp<MessageBase> > LIST;
+public:
+
+ MessageQueue();
+ ~MessageQueue();
+
+ // pre-defined messages
+ enum {
+ INVALIDATE = '_upd'
+ };
+
+ sp<MessageBase> waitMessage(nsecs_t timeout = -1);
+
+ status_t postMessage(const sp<MessageBase>& message,
+ nsecs_t reltime=0, uint32_t flags = 0);
+
+ status_t invalidate();
+
+ void dump(const sp<MessageBase>& message);
+
+private:
+ status_t queueMessage(const sp<MessageBase>& message,
+ nsecs_t reltime, uint32_t flags);
+ void dumpLocked(const sp<MessageBase>& message);
+
+ Mutex mLock;
+ Condition mCondition;
+ MessageList mMessages;
+ bool mInvalidate;
+ sp<MessageBase> mInvalidateMessage;
+};
+
+// ---------------------------------------------------------------------------
+
+}; // namespace android
+
+#endif /* ANDROID_MESSAGE_QUEUE_H */
diff --git a/TVOutDummy/SecTVOutService.cpp b/TVOutDummy/SecTVOutService.cpp
new file mode 100644
index 0000000..490f888
--- /dev/null
+++ b/TVOutDummy/SecTVOutService.cpp
@@ -0,0 +1,168 @@
+/*
+**
+** Copyright 2008, The Android Open Source Project
+** Copyright 2010, Samsung Electronics Co. LTD
+**
+** 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.
+*/
+
+/*
+**
+** @author Taikyung, Yu(taikyung.yu@samsung.com)
+** @date 2011-07-06
+*/
+
+#define ALOG_TAG "SecTVOutService"
+
+#include <binder/IServiceManager.h>
+#include <utils/RefBase.h>
+#include <binder/IInterface.h>
+#include <binder/Parcel.h>
+#include <utils/Log.h>
+#include "SecTVOutService.h"
+#include <linux/fb.h>
+
+namespace android {
+#define DEFAULT_LCD_WIDTH 800
+#define DEFAULT_LCD_HEIGHT 480
+
+#define DIRECT_VIDEO_RENDERING (1)
+#define DIRECT_UI_RENDERING (0)
+
+ enum {
+ SET_HDMI_STATUS = IBinder::FIRST_CALL_TRANSACTION,
+ SET_HDMI_MODE,
+ SET_HDMI_RESOLUTION,
+ SET_HDMI_HDCP,
+ SET_HDMI_ROTATE,
+ SET_HDMI_HWCLAYER,
+ BLIT_2_HDMI
+ };
+
+ int SecTVOutService::instantiate()
+ {
+ ALOGD("SKURWYSYN, SecTVOutService instantiate!");
+ int r = defaultServiceManager()->addService(String16( "SecTVOutService"), new SecTVOutService ());
+ ALOGD("SecTVOutService r=%d", r);
+
+ return r;
+ }
+
+ SecTVOutService::SecTVOutService () {
+ ALOGV("SecTVOutService created");
+ mHdmiCableInserted = false;
+ }
+
+ void SecTVOutService::setLCDsize(void) {
+ }
+
+ SecTVOutService::~SecTVOutService () {
+ ALOGV ("SecTVOutService destroyed");
+ }
+
+ status_t SecTVOutService::onTransact(uint32_t code, const Parcel & data, Parcel * reply, uint32_t flags)
+ {
+ switch (code) {
+ case SET_HDMI_STATUS: {
+ int status = data.readInt32();
+ setHdmiStatus(status);
+ } break;
+
+ case SET_HDMI_MODE: {
+ int mode = data.readInt32();
+ setHdmiMode(mode);
+ } break;
+
+ case SET_HDMI_RESOLUTION: {
+ int resolution = data.readInt32();
+ setHdmiResolution(resolution);
+ } break;
+
+ case SET_HDMI_HDCP: {
+ int enHdcp = data.readInt32();
+ setHdmiHdcp(enHdcp);
+ } break;
+
+ case SET_HDMI_ROTATE: {
+ int rotVal = data.readInt32();
+ int hwcLayer = data.readInt32();
+ setHdmiRotate(rotVal, hwcLayer);
+ } break;
+
+ case SET_HDMI_HWCLAYER: {
+ int hwcLayer = data.readInt32();
+ setHdmiHwcLayer((uint32_t)hwcLayer);
+ } break;
+
+ case BLIT_2_HDMI: {
+ uint32_t w = data.readInt32();
+ uint32_t h = data.readInt32();
+ uint32_t colorFormat = data.readInt32();
+ uint32_t physYAddr = data.readInt32();
+ uint32_t physCbAddr = data.readInt32();
+ uint32_t physCrAddr = data.readInt32();
+ uint32_t dstX = data.readInt32();
+ uint32_t dstY = data.readInt32();
+ uint32_t hdmiLayer = data.readInt32();
+ uint32_t num_of_hwc_layer = data.readInt32();
+
+ blit2Hdmi(w, h, colorFormat, physYAddr, physCbAddr, physCrAddr, dstX, dstY, hdmiLayer, num_of_hwc_layer);
+ } break;
+
+ default :
+ ALOGE ( "onTransact::default");
+ return BBinder::onTransact (code, data, reply, flags);
+ }
+
+ return NO_ERROR;
+ }
+
+ void SecTVOutService::setHdmiStatus(uint32_t status)
+ {
+
+ }
+
+ void SecTVOutService::setHdmiMode(uint32_t mode)
+ {
+ }
+
+ void SecTVOutService::setHdmiResolution(uint32_t resolution)
+ {
+ }
+
+ void SecTVOutService::setHdmiHdcp(uint32_t hdcp_en)
+ {
+ }
+
+ void SecTVOutService::setHdmiRotate(uint32_t rotVal, uint32_t hwcLayer)
+ {
+ }
+
+ void SecTVOutService::setHdmiHwcLayer(uint32_t hwcLayer)
+ {
+ }
+
+ void SecTVOutService::blit2Hdmi(uint32_t w, uint32_t h, uint32_t colorFormat,
+ uint32_t pPhyYAddr, uint32_t pPhyCbAddr, uint32_t pPhyCrAddr,
+ uint32_t dstX, uint32_t dstY,
+ uint32_t hdmiMode,
+ uint32_t num_of_hwc_layer)
+ {
+ }
+
+ bool SecTVOutService::hdmiCableInserted(void)
+ {
+ return mHdmiCableInserted;
+ }
+
+}
diff --git a/TVOutDummy/SecTVOutService.h b/TVOutDummy/SecTVOutService.h
new file mode 100644
index 0000000..11e10d5
--- /dev/null
+++ b/TVOutDummy/SecTVOutService.h
@@ -0,0 +1,94 @@
+/*
+**
+** Copyright 2008, The Android Open Source Project
+** Copyright 2010, Samsung Electronics Co. LTD
+**
+** 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.
+*/
+
+/*
+**
+** @author Taikyung, Yu(taikyung.yu@samsung.com)
+** @date 2011-07-06
+*/
+
+#ifndef SECTVOUTSERVICE_H
+#define SECTVOUTSERVICE_H
+
+#include <stdint.h>
+#include <sys/types.h>
+#include <binder/Parcel.h>
+#include <utils/KeyedVector.h>
+
+#include "ISecTVOut.h"
+#include "MessageQueue.h"
+
+namespace android {
+//#define CHECK_VIDEO_TIME
+//#define CHECK_UI_TIME
+
+ class SecTVOutService : public BBinder
+ {
+ public :
+ enum {
+ HDMI_MODE_NONE = 0,
+ HDMI_MODE_UI,
+ HDMI_MODE_VIDEO,
+ };
+
+ mutable Mutex mLock;
+
+ class HDMIFlushThread : public Thread {
+ SecTVOutService *mTVOutService;
+ public:
+ HDMIFlushThread(SecTVOutService *service):
+ Thread(false),
+ mTVOutService(service) { }
+ virtual void onFirstRef() {
+ run("HDMIFlushThread", PRIORITY_URGENT_DISPLAY);
+ }
+ virtual bool threadLoop() {
+ return false;
+ }
+ };
+
+ mutable MessageQueue mHdmiEventQueue;
+ bool mExitHdmiFlushThread;
+
+ SecTVOutService();
+ static int instantiate ();
+ virtual status_t onTransact(uint32_t, const Parcel &, Parcel *, uint32_t);
+ virtual ~SecTVOutService ();
+
+ virtual void setHdmiStatus(uint32_t status);
+ virtual void setHdmiMode(uint32_t mode);
+ virtual void setHdmiResolution(uint32_t resolution);
+ virtual void setHdmiHdcp(uint32_t enHdcp);
+ virtual void setHdmiRotate(uint32_t rotVal, uint32_t hwcLayer);
+ virtual void setHdmiHwcLayer(uint32_t hwcLayer);
+ virtual void blit2Hdmi(uint32_t w, uint32_t h,
+ uint32_t colorFormat,
+ uint32_t pPhyYAddr, uint32_t pPhyCbAddr, uint32_t pPhyCrAddr,
+ uint32_t dstX, uint32_t dstY,
+ uint32_t hdmiMode, uint32_t num_of_hwc_layer);
+ bool hdmiCableInserted(void);
+ void setLCDsize(void);
+
+ private:
+ bool mHdmiCableInserted;
+ int mUILayerMode;
+ uint32_t mLCD_width, mLCD_height;
+ uint32_t mHwcLayer;
+ };
+};
+#endif
diff --git a/TVOutDummy/main.cpp b/TVOutDummy/main.cpp
new file mode 100644
index 0000000..d0a7497
--- /dev/null
+++ b/TVOutDummy/main.cpp
@@ -0,0 +1,11 @@
+#include "SecTVOutService.h"
+#include <cstdlib>
+
+int main() {
+ android::SecTVOutService::instantiate();
+
+ // let it run for some time (1 sec)
+ usleep(1000000);
+
+ return 0;
+}