diff --git a/mpp/mpp_buffer_impl.cpp b/mpp/mpp_buffer_impl.cpp index f8f4b09f..f4d7ba93 100644 --- a/mpp/mpp_buffer_impl.cpp +++ b/mpp/mpp_buffer_impl.cpp @@ -25,7 +25,8 @@ #define SEARCH_GROUP_NORMAL(id) search_group_by_id_no_lock(&service.mListGroup, id) #define SEARCH_GROUP_ORPHAN(id) search_group_by_id_no_lock(&service.mListOrphan, id) -class MppBufferService { +class MppBufferService +{ public: MppBufferService(); ~MppBufferService(); diff --git a/osal/android/os_allocator.c b/osal/android/os_allocator.c index 59c99031..0fa8dc4a 100644 --- a/osal/android/os_allocator.c +++ b/osal/android/os_allocator.c @@ -265,7 +265,7 @@ MPP_RET os_allocator_ion_close(void *ctx) p = (allocator_ctx_ion *)ctx; ret = close(p->ion_device); if (ret < 0) - return (MPP_RET)-errno; + return (MPP_RET) - errno; return MPP_OK; } diff --git a/osal/inc/mpp_thread.h b/osal/inc/mpp_thread.h index ebc41e43..514fab94 100644 --- a/osal/inc/mpp_thread.h +++ b/osal/inc/mpp_thread.h @@ -63,7 +63,8 @@ class Condition; /* * for shorter type name and function name */ -class Mutex { +class Mutex +{ public: Mutex(); ~Mutex(); @@ -71,7 +72,8 @@ public: void lock(); void unlock(); - class Autolock { + class Autolock + { public: inline Autolock(Mutex& mutex) : mLock(mutex) { mLock.lock(); } inline Autolock(Mutex* mutex) : mLock(*mutex) { mLock.lock(); } @@ -89,20 +91,24 @@ private: Mutex &operator = (const Mutex&); }; -inline Mutex::Mutex() { +inline Mutex::Mutex() +{ pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); pthread_mutex_init(&mMutex, &attr); pthread_mutexattr_destroy(&attr); } -inline Mutex::~Mutex() { +inline Mutex::~Mutex() +{ pthread_mutex_destroy(&mMutex); } -inline void Mutex::lock() { +inline void Mutex::lock() +{ pthread_mutex_lock(&mMutex); } -inline void Mutex::unlock() { +inline void Mutex::unlock() +{ pthread_mutex_unlock(&mMutex); } @@ -112,7 +118,8 @@ typedef Mutex::Autolock AutoMutex; /* * for shorter type name and function name */ -class Condition { +class Condition +{ public: Condition(); Condition(int type); @@ -124,21 +131,26 @@ private: pthread_cond_t mCond; }; -inline Condition::Condition() { +inline Condition::Condition() +{ pthread_cond_init(&mCond, NULL); } -inline Condition::~Condition() { +inline Condition::~Condition() +{ pthread_cond_destroy(&mCond); } -inline void Condition::wait(Mutex& mutex) { +inline void Condition::wait(Mutex& mutex) +{ pthread_cond_wait(&mCond, &mutex.mMutex); } -inline void Condition::signal() { +inline void Condition::signal() +{ pthread_cond_signal(&mCond); } -class MppThread { +class MppThread +{ public: MppThread(MppThreadFunc func, void *ctx); ~MppThread() {};