} else {
m_sensorThread = new SensorThread(this);
m_mainThread->Start("MainThread", PRIORITY_DEFAULT, 0);
+ m_sensorThread->Start("SensorThread", PRIORITY_DEFAULT, 0);
ALOGV("DEBUG(%s): created sensorthread ", __FUNCTION__);
for (int i = 0 ; i < STREAM_ID_LAST+1 ; i++)
}
AllocatedStream = (StreamThread*)(m_streamThreads[1].get());
if (!threadExists) {
+ AllocatedStream->Start("StreamThread", PRIORITY_DEFAULT, 0);
m_streamThreadInitialize((SignalDrivenThread*)AllocatedStream);
AllocatedStream->m_numRegisteredStream = 1;
}
m_streamThreads[0] = new StreamThread(this, *stream_id);
AllocatedStream = (StreamThread*)(m_streamThreads[0].get());
+ AllocatedStream->Start("StreamThread", PRIORITY_DEFAULT, 0);
m_streamThreadInitialize((SignalDrivenThread*)AllocatedStream);
*format_actual = HAL_PIXEL_FORMAT_EXYNOS_YV12;
if (useDirectOutput) {
*stream_id = STREAM_ID_ZSL;
- /*if (createThread)*/ {
- m_streamThreads[1] = new StreamThread(this, *stream_id);
- }
+ m_streamThreads[1] = new StreamThread(this, *stream_id);
AllocatedStream = (StreamThread*)(m_streamThreads[1].get());
+ AllocatedStream->Start("StreamThread", PRIORITY_DEFAULT, 0);
m_streamThreadInitialize((SignalDrivenThread*)AllocatedStream);
*format_actual = HAL_PIXEL_FORMAT_EXYNOS_YV12;
return;
}
-void ExynosCameraHWInterface2::m_sensorThreadInitialize(SignalDrivenThread * self)
-{
- ALOGV("DEBUG(%s): ", __FUNCTION__ );
- /* will add */
- return;
-}
-
-
void ExynosCameraHWInterface2::DumpInfoWithShot(struct camera2_shot_ext * shot_ext)
{
ALOGD("#### common Section");
ALOGV("cam_device(0x%08x):", (unsigned int)cam_device);
ALOGV("g_cam2_device(0x%08x):", (unsigned int)g_cam2_device);
delete static_cast<ExynosCameraHWInterface2 *>(cam_device->priv);
- g_cam2_device = NULL;
free(cam_device);
g_camera_vaild = false;
+ g_cam2_device = NULL;
}
ALOGD("(%s): EXIT", __FUNCTION__);
public:
MainThread(ExynosCameraHWInterface2 *hw):
SignalDrivenThread(),
- mHardware(hw) {
-// Start("MainThread", PRIORITY_DEFAULT, 0);
- }
+ mHardware(hw) { }
~MainThread();
- status_t readyToRunInternal()
- {
- return NO_ERROR;
- }
void threadFunctionInternal()
- {
+ {
mHardware->m_mainThreadFunc(this);
return;
}
ExynosCameraHWInterface2 *mHardware;
public:
SensorThread(ExynosCameraHWInterface2 *hw):
- SignalDrivenThread("SensorThread", PRIORITY_DEFAULT, 0),
+ SignalDrivenThread(),
mHardware(hw) { }
~SensorThread();
- status_t readyToRunInternal() {
- mHardware->m_sensorThreadInitialize(this);
- return NO_ERROR;
- }
void threadFunctionInternal() {
mHardware->m_sensorThreadFunc(this);
return;
ExynosCameraHWInterface2 *mHardware;
public:
StreamThread(ExynosCameraHWInterface2 *hw, uint8_t new_index):
- SignalDrivenThread("StreamThread", PRIORITY_DEFAULT, 0),
+ SignalDrivenThread(),
mHardware(hw),
m_index(new_index) { }
~StreamThread();
- status_t readyToRunInternal() {
- return NO_ERROR;
- }
void threadFunctionInternal() {
mHardware->m_streamThreadFunc(this);
return;
void m_mainThreadFunc(SignalDrivenThread * self);
void m_sensorThreadFunc(SignalDrivenThread * self);
- void m_sensorThreadInitialize(SignalDrivenThread * self);
void m_streamThreadFunc(SignalDrivenThread * self);
void m_streamThreadInitialize(SignalDrivenThread * self);
-/*\r
-**\r
-** Copyright 2008, The Android Open Source Project\r
-** Copyright 2012, Samsung Electronics Co. LTD\r
-**\r
-** Licensed under the Apache License, Version 2.0 (the "License");\r
-** you may not use this file except in compliance with the License.\r
-** You may obtain a copy of the License at\r
-**\r
-** http://www.apache.org/licenses/LICENSE-2.0\r
-**\r
-** Unless required by applicable law or agreed to in writing, software\r
-** distributed under the License is distributed on an "AS IS" BASIS,\r
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-** See the License for the specific language governing permissions and\r
-** limitations under the License.\r
-*/\r
-\r
-/*!\r
- * \file SignalDrivenThread.h\r
- * \brief header file for general thread ( for camera hal2 implementation )\r
- * \author Sungjoong Kang(sj3.kang@samsung.com)\r
- * \date 2012/05/31\r
- *\r
- * <b>Revision History: </b>\r
- * - 2012/05/31 : Sungjoong Kang(sj3.kang@samsung.com) \n\r
- * Initial Release\r
- *\r
- * - 2012/07/10 : Sungjoong Kang(sj3.kang@samsung.com) \n\r
- * 2nd Release\r
- *\r
- */\r
-\r
-\r
-\r
-#ifndef SIGNAL_DRIVEN_THREAD_H\r
-#define SIGNAL_DRIVEN_THREAD_H\r
-\r
-#include <utils/threads.h>\r
-\r
-namespace android {\r
-\r
-#define SIGNAL_THREAD_TERMINATE (1<<0)\r
-#define SIGNAL_THREAD_PAUSE (1<<1)\r
-\r
-#define SIGNAL_THREAD_COMMON_LAST (1<<3)\r
-\r
-class SignalDrivenThread:public Thread {\r
-public:\r
- SignalDrivenThread();\r
- SignalDrivenThread(const char *name,\r
- int32_t priority, size_t stack);\r
- virtual ~SignalDrivenThread();\r
-\r
- status_t SetSignal(uint32_t signal);\r
-\r
- uint32_t GetProcessingSignal();\r
- //void ClearProcessingSignal(uint32_t signal);\r
- void Start(const char *name,\r
- int32_t priority, size_t stack);\r
- bool IsTerminated();\r
-\r
-private:\r
- status_t readyToRun();\r
- virtual status_t readyToRunInternal() = 0;\r
-\r
- bool threadLoop();\r
- virtual void threadFunctionInternal() = 0;\r
-\r
- void ClearSignal();\r
-\r
- uint32_t m_receivedSignal;\r
- uint32_t m_processingSignal;\r
-\r
- Mutex m_signalMutex;\r
- Condition m_threadCondition;\r
- bool m_isTerminated;\r
-};\r
-\r
-}; // namespace android\r
-\r
-#endif\r
+/*
+**
+** Copyright 2008, The Android Open Source Project
+** Copyright 2012, 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.
+*/
+
+/*!
+ * \file SignalDrivenThread.h
+ * \brief header file for general thread ( for camera hal2 implementation )
+ * \author Sungjoong Kang(sj3.kang@samsung.com)
+ * \date 2012/05/31
+ *
+ * <b>Revision History: </b>
+ * - 2012/05/31 : Sungjoong Kang(sj3.kang@samsung.com) \n
+ * Initial Release
+ *
+ * - 2012/07/10 : Sungjoong Kang(sj3.kang@samsung.com) \n
+ * 2nd Release
+ *
+ */
+
+
+
+#ifndef SIGNAL_DRIVEN_THREAD_H
+#define SIGNAL_DRIVEN_THREAD_H
+
+#include <utils/threads.h>
+
+namespace android {
+
+#define SIGNAL_THREAD_TERMINATE (1<<0)
+#define SIGNAL_THREAD_PAUSE (1<<1)
+
+#define SIGNAL_THREAD_COMMON_LAST (1<<3)
+
+class SignalDrivenThread:public Thread {
+public:
+ SignalDrivenThread();
+ SignalDrivenThread(const char *name,
+ int32_t priority, size_t stack);
+ virtual ~SignalDrivenThread();
+
+ status_t SetSignal(uint32_t signal);
+
+ uint32_t GetProcessingSignal();
+ //void ClearProcessingSignal(uint32_t signal);
+ void Start(const char *name,
+ int32_t priority, size_t stack);
+ bool IsTerminated();
+
+private:
+ status_t readyToRun();
+ status_t readyToRunInternal();
+
+ bool threadLoop();
+ virtual void threadFunctionInternal() = 0;
+
+ void ClearSignal();
+
+ uint32_t m_receivedSignal;
+ uint32_t m_processingSignal;
+
+ Mutex m_signalMutex;
+ Condition m_threadCondition;
+ bool m_isTerminated;
+};
+
+}; // namespace android
+
+#endif