diff --git a/external/android/colorconversion/ndkbuild.mk b/external/android/colorconversion/ndkbuild.mk index 0bade42..db65f2b 100644 --- a/external/android/colorconversion/ndkbuild.mk +++ b/external/android/colorconversion/ndkbuild.mk @@ -5,7 +5,7 @@ LOCAL_SRC_FILES:= \ ColorConverter.cpp LOCAL_C_INCLUDES += \ - $(ANDROID_INCLUDES_14) + $(ANDROID_INCLUDES_21) LOCAL_MODULE:= libstagefright_color_conversion diff --git a/external/android/include/14/frameworks/base/include/binder/Binder.h b/external/android/include/14/frameworks/base/include/binder/Binder.h deleted file mode 100644 index ba3ac4b..0000000 --- a/external/android/include/14/frameworks/base/include/binder/Binder.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_BINDER_H -#define ANDROID_BINDER_H - -#include - -// --------------------------------------------------------------------------- -namespace android { - -class BBinder : public IBinder -{ -public: - BBinder(); - - virtual const String16& getInterfaceDescriptor() const; - virtual bool isBinderAlive() const; - virtual status_t pingBinder(); - virtual status_t dump(int fd, const Vector& args); - - virtual status_t transact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); - - virtual status_t linkToDeath(const sp& recipient, - void* cookie = NULL, - uint32_t flags = 0); - - virtual status_t unlinkToDeath( const wp& recipient, - void* cookie = NULL, - uint32_t flags = 0, - wp* outRecipient = NULL); - - virtual void attachObject( const void* objectID, - void* object, - void* cleanupCookie, - object_cleanup_func func); - virtual void* findObject(const void* objectID) const; - virtual void detachObject(const void* objectID); - - virtual BBinder* localBinder(); - -protected: - virtual ~BBinder(); - - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); - -private: - BBinder(const BBinder& o); - BBinder& operator=(const BBinder& o); - - class Extras; - - Extras* mExtras; - void* mReserved0; -}; - -// --------------------------------------------------------------------------- - -class BpRefBase : public virtual RefBase -{ -protected: - BpRefBase(const sp& o); - virtual ~BpRefBase(); - virtual void onFirstRef(); - virtual void onLastStrongRef(const void* id); - virtual bool onIncStrongAttempted(uint32_t flags, const void* id); - - inline IBinder* remote() { return mRemote; } - inline IBinder* remote() const { return mRemote; } - -private: - BpRefBase(const BpRefBase& o); - BpRefBase& operator=(const BpRefBase& o); - - IBinder* const mRemote; - RefBase::weakref_type* mRefs; - volatile int32_t mState; -}; - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_BINDER_H diff --git a/external/android/include/14/frameworks/base/include/binder/BinderService.h b/external/android/include/14/frameworks/base/include/binder/BinderService.h deleted file mode 100644 index 2316fef..0000000 --- a/external/android/include/14/frameworks/base/include/binder/BinderService.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2010 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_BINDER_SERVICE_H -#define ANDROID_BINDER_SERVICE_H - -#include - -#include -#include - -#include -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -template -class BinderService -{ -public: - static status_t publish() { - sp sm(defaultServiceManager()); - return sm->addService(String16(SERVICE::getServiceName()), new SERVICE()); - } - - static void publishAndJoinThreadPool() { - sp proc(ProcessState::self()); - sp sm(defaultServiceManager()); - sm->addService(String16(SERVICE::getServiceName()), new SERVICE()); - ProcessState::self()->startThreadPool(); - IPCThreadState::self()->joinThreadPool(); - } - - static void instantiate() { publish(); } - - static status_t shutdown() { - return NO_ERROR; - } -}; - - -}; // namespace android -// --------------------------------------------------------------------------- -#endif // ANDROID_BINDER_SERVICE_H diff --git a/external/android/include/14/frameworks/base/include/binder/BpBinder.h b/external/android/include/14/frameworks/base/include/binder/BpBinder.h deleted file mode 100644 index 7ef93aa..0000000 --- a/external/android/include/14/frameworks/base/include/binder/BpBinder.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (C) 2005 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_BPBINDER_H -#define ANDROID_BPBINDER_H - -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -class BpBinder : public IBinder -{ -public: - BpBinder(int32_t handle); - - inline int32_t handle() const { return mHandle; } - - virtual const String16& getInterfaceDescriptor() const; - virtual bool isBinderAlive() const; - virtual status_t pingBinder(); - virtual status_t dump(int fd, const Vector& args); - - virtual status_t transact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); - - virtual status_t linkToDeath(const sp& recipient, - void* cookie = NULL, - uint32_t flags = 0); - virtual status_t unlinkToDeath( const wp& recipient, - void* cookie = NULL, - uint32_t flags = 0, - wp* outRecipient = NULL); - - virtual void attachObject( const void* objectID, - void* object, - void* cleanupCookie, - object_cleanup_func func); - virtual void* findObject(const void* objectID) const; - virtual void detachObject(const void* objectID); - - virtual BpBinder* remoteBinder(); - - status_t setConstantData(const void* data, size_t size); - void sendObituary(); - - class ObjectManager - { - public: - ObjectManager(); - ~ObjectManager(); - - void attach( const void* objectID, - void* object, - void* cleanupCookie, - IBinder::object_cleanup_func func); - void* find(const void* objectID) const; - void detach(const void* objectID); - - void kill(); - - private: - ObjectManager(const ObjectManager&); - ObjectManager& operator=(const ObjectManager&); - - struct entry_t - { - void* object; - void* cleanupCookie; - IBinder::object_cleanup_func func; - }; - - KeyedVector mObjects; - }; - -protected: - virtual ~BpBinder(); - virtual void onFirstRef(); - virtual void onLastStrongRef(const void* id); - virtual bool onIncStrongAttempted(uint32_t flags, const void* id); - -private: - const int32_t mHandle; - - struct Obituary { - wp recipient; - void* cookie; - uint32_t flags; - }; - - void reportOneDeath(const Obituary& obit); - bool isDescriptorCached() const; - - mutable Mutex mLock; - volatile int32_t mAlive; - volatile int32_t mObitsSent; - Vector* mObituaries; - ObjectManager mObjects; - Parcel* mConstantData; - mutable String16 mDescriptorCache; -}; - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_BPBINDER_H diff --git a/external/android/include/14/frameworks/base/include/binder/CursorWindow.h b/external/android/include/14/frameworks/base/include/binder/CursorWindow.h deleted file mode 100644 index 5d490ed..0000000 --- a/external/android/include/14/frameworks/base/include/binder/CursorWindow.h +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright (C) 2006 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__DATABASE_WINDOW_H -#define _ANDROID__DATABASE_WINDOW_H - -#include -#include -#include - -#include -#include - -#if LOG_NDEBUG - -#define IF_LOG_WINDOW() if (false) -#define LOG_WINDOW(...) - -#else - -#define IF_LOG_WINDOW() IF_LOG(LOG_DEBUG, "CursorWindow") -#define LOG_WINDOW(...) LOG(LOG_DEBUG, "CursorWindow", __VA_ARGS__) - -#endif - -namespace android { - -/** - * This class stores a set of rows from a database in a buffer. The begining of the - * window has first chunk of RowSlots, which are offsets to the row directory, followed by - * an offset to the next chunk in a linked-list of additional chunk of RowSlots in case - * the pre-allocated chunk isn't big enough to refer to all rows. Each row directory has a - * FieldSlot per column, which has the size, offset, and type of the data for that field. - * Note that the data types come from sqlite3.h. - * - * Strings are stored in UTF-8. - */ -class CursorWindow { - CursorWindow(const String8& name, int ashmemFd, - void* data, size_t size, bool readOnly); - -public: - /* Field types. */ - enum { - FIELD_TYPE_NULL = 0, - FIELD_TYPE_INTEGER = 1, - FIELD_TYPE_FLOAT = 2, - FIELD_TYPE_STRING = 3, - FIELD_TYPE_BLOB = 4, - }; - - /* Opaque type that describes a field slot. */ - struct FieldSlot { - private: - int32_t type; - union { - double d; - int64_t l; - struct { - uint32_t offset; - uint32_t size; - } buffer; - } data; - - friend class CursorWindow; - } __attribute((packed)); - - ~CursorWindow(); - - static status_t create(const String8& name, size_t size, bool localOnly, - CursorWindow** outCursorWindow); - static status_t createFromParcel(Parcel* parcel, CursorWindow** outCursorWindow); - - status_t writeToParcel(Parcel* parcel); - - inline String8 name() { return mName; } - inline size_t size() { return mSize; } - inline size_t freeSpace() { return mSize - mHeader->freeOffset; } - inline uint32_t getNumRows() { return mHeader->numRows; } - inline uint32_t getNumColumns() { return mHeader->numColumns; } - - status_t clear(); - status_t setNumColumns(uint32_t numColumns); - - /** - * Allocate a row slot and its directory. - * The row is initialized will null entries for each field. - */ - status_t allocRow(); - status_t freeLastRow(); - - status_t putBlob(uint32_t row, uint32_t column, const void* value, size_t size); - status_t putString(uint32_t row, uint32_t column, const char* value, size_t sizeIncludingNull); - status_t putLong(uint32_t row, uint32_t column, int64_t value); - status_t putDouble(uint32_t row, uint32_t column, double value); - status_t putNull(uint32_t row, uint32_t column); - - /** - * Gets the field slot at the specified row and column. - * Returns null if the requested row or column is not in the window. - */ - FieldSlot* getFieldSlot(uint32_t row, uint32_t column); - - inline int32_t getFieldSlotType(FieldSlot* fieldSlot) { - return fieldSlot->type; - } - - inline int64_t getFieldSlotValueLong(FieldSlot* fieldSlot) { - return fieldSlot->data.l; - } - - inline double getFieldSlotValueDouble(FieldSlot* fieldSlot) { - return fieldSlot->data.d; - } - - inline const char* getFieldSlotValueString(FieldSlot* fieldSlot, - size_t* outSizeIncludingNull) { - *outSizeIncludingNull = fieldSlot->data.buffer.size; - return static_cast(offsetToPtr(fieldSlot->data.buffer.offset)); - } - - inline const void* getFieldSlotValueBlob(FieldSlot* fieldSlot, size_t* outSize) { - *outSize = fieldSlot->data.buffer.size; - return offsetToPtr(fieldSlot->data.buffer.offset); - } - -private: - static const size_t ROW_SLOT_CHUNK_NUM_ROWS = 100; - - struct Header { - // Offset of the lowest unused byte in the window. - uint32_t freeOffset; - - // Offset of the first row slot chunk. - uint32_t firstChunkOffset; - - uint32_t numRows; - uint32_t numColumns; - }; - - struct RowSlot { - uint32_t offset; - }; - - struct RowSlotChunk { - RowSlot slots[ROW_SLOT_CHUNK_NUM_ROWS]; - uint32_t nextChunkOffset; - }; - - String8 mName; - int mAshmemFd; - void* mData; - size_t mSize; - bool mReadOnly; - Header* mHeader; - - inline void* offsetToPtr(uint32_t offset) { - return static_cast(mData) + offset; - } - - inline uint32_t offsetFromPtr(void* ptr) { - return static_cast(ptr) - static_cast(mData); - } - - /** - * Allocate a portion of the window. Returns the offset - * of the allocation, or 0 if there isn't enough space. - * If aligned is true, the allocation gets 4 byte alignment. - */ - uint32_t alloc(size_t size, bool aligned = false); - - RowSlot* getRowSlot(uint32_t row); - RowSlot* allocRowSlot(); - - status_t putBlobOrString(uint32_t row, uint32_t column, - const void* value, size_t size, int32_t type); -}; - -}; // namespace android - -#endif diff --git a/external/android/include/14/frameworks/base/include/binder/IBinder.h b/external/android/include/14/frameworks/base/include/binder/IBinder.h deleted file mode 100644 index 81b56c2..0000000 --- a/external/android/include/14/frameworks/base/include/binder/IBinder.h +++ /dev/null @@ -1,159 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_IBINDER_H -#define ANDROID_IBINDER_H - -#include -#include -#include -#include - - -#define B_PACK_CHARS(c1, c2, c3, c4) \ - ((((c1)<<24)) | (((c2)<<16)) | (((c3)<<8)) | (c4)) - -// --------------------------------------------------------------------------- -namespace android { - -class BBinder; -class BpBinder; -class IInterface; -class Parcel; - -/** - * Base class and low-level protocol for a remotable object. - * You can derive from this class to create an object for which other - * processes can hold references to it. Communication between processes - * (method calls, property get and set) is down through a low-level - * protocol implemented on top of the transact() API. - */ -class IBinder : public virtual RefBase -{ -public: - enum { - FIRST_CALL_TRANSACTION = 0x00000001, - LAST_CALL_TRANSACTION = 0x00ffffff, - - PING_TRANSACTION = B_PACK_CHARS('_','P','N','G'), - DUMP_TRANSACTION = B_PACK_CHARS('_','D','M','P'), - INTERFACE_TRANSACTION = B_PACK_CHARS('_', 'N', 'T', 'F'), - - // Corresponds to TF_ONE_WAY -- an asynchronous call. - FLAG_ONEWAY = 0x00000001 - }; - - IBinder(); - - /** - * Check if this IBinder implements the interface named by - * @a descriptor. If it does, the base pointer to it is returned, - * which you can safely static_cast<> to the concrete C++ interface. - */ - virtual sp queryLocalInterface(const String16& descriptor); - - /** - * Return the canonical name of the interface provided by this IBinder - * object. - */ - virtual const String16& getInterfaceDescriptor() const = 0; - - virtual bool isBinderAlive() const = 0; - virtual status_t pingBinder() = 0; - virtual status_t dump(int fd, const Vector& args) = 0; - - virtual status_t transact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0) = 0; - - /** - * This method allows you to add data that is transported through - * IPC along with your IBinder pointer. When implementing a Binder - * object, override it to write your desired data in to @a outData. - * You can then call getConstantData() on your IBinder to retrieve - * that data, from any process. You MUST return the number of bytes - * written in to the parcel (including padding). - */ - class DeathRecipient : public virtual RefBase - { - public: - virtual void binderDied(const wp& who) = 0; - }; - - /** - * Register the @a recipient for a notification if this binder - * goes away. If this binder object unexpectedly goes away - * (typically because its hosting process has been killed), - * then DeathRecipient::binderDied() will be called with a reference - * to this. - * - * The @a cookie is optional -- if non-NULL, it should be a - * memory address that you own (that is, you know it is unique). - * - * @note You will only receive death notifications for remote binders, - * as local binders by definition can't die without you dying as well. - * Trying to use this function on a local binder will result in an - * INVALID_OPERATION code being returned and nothing happening. - * - * @note This link always holds a weak reference to its recipient. - * - * @note You will only receive a weak reference to the dead - * binder. You should not try to promote this to a strong reference. - * (Nor should you need to, as there is nothing useful you can - * directly do with it now that it has passed on.) - */ - virtual status_t linkToDeath(const sp& recipient, - void* cookie = NULL, - uint32_t flags = 0) = 0; - - /** - * Remove a previously registered death notification. - * The @a recipient will no longer be called if this object - * dies. The @a cookie is optional. If non-NULL, you can - * supply a NULL @a recipient, and the recipient previously - * added with that cookie will be unlinked. - */ - virtual status_t unlinkToDeath( const wp& recipient, - void* cookie = NULL, - uint32_t flags = 0, - wp* outRecipient = NULL) = 0; - - virtual bool checkSubclass(const void* subclassID) const; - - typedef void (*object_cleanup_func)(const void* id, void* obj, void* cleanupCookie); - - virtual void attachObject( const void* objectID, - void* object, - void* cleanupCookie, - object_cleanup_func func) = 0; - virtual void* findObject(const void* objectID) const = 0; - virtual void detachObject(const void* objectID) = 0; - - virtual BBinder* localBinder(); - virtual BpBinder* remoteBinder(); - -protected: - virtual ~IBinder(); - -private: -}; - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_IBINDER_H diff --git a/external/android/include/14/frameworks/base/include/binder/IInterface.h b/external/android/include/14/frameworks/base/include/binder/IInterface.h deleted file mode 100644 index 5f9f69c..0000000 --- a/external/android/include/14/frameworks/base/include/binder/IInterface.h +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (C) 2005 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_IINTERFACE_H -#define ANDROID_IINTERFACE_H - -#include - -namespace android { - -// ---------------------------------------------------------------------- - -class IInterface : public virtual RefBase -{ -public: - IInterface(); - sp asBinder(); - sp asBinder() const; - -protected: - virtual ~IInterface(); - virtual IBinder* onAsBinder() = 0; -}; - -// ---------------------------------------------------------------------- - -template -inline sp interface_cast(const sp& obj) -{ - return INTERFACE::asInterface(obj); -} - -// ---------------------------------------------------------------------- - -template -class BnInterface : public INTERFACE, public BBinder -{ -public: - virtual sp queryLocalInterface(const String16& _descriptor); - virtual const String16& getInterfaceDescriptor() const; - -protected: - virtual IBinder* onAsBinder(); -}; - -// ---------------------------------------------------------------------- - -template -class BpInterface : public INTERFACE, public BpRefBase -{ -public: - BpInterface(const sp& remote); - -protected: - virtual IBinder* onAsBinder(); -}; - -// ---------------------------------------------------------------------- - -#define DECLARE_META_INTERFACE(INTERFACE) \ - static const android::String16 descriptor; \ - static android::sp asInterface( \ - const android::sp& obj); \ - virtual const android::String16& getInterfaceDescriptor() const; \ - I##INTERFACE(); \ - virtual ~I##INTERFACE(); \ - - -#define IMPLEMENT_META_INTERFACE(INTERFACE, NAME) \ - const android::String16 I##INTERFACE::descriptor(NAME); \ - const android::String16& \ - I##INTERFACE::getInterfaceDescriptor() const { \ - return I##INTERFACE::descriptor; \ - } \ - android::sp I##INTERFACE::asInterface( \ - const android::sp& obj) \ - { \ - android::sp intr; \ - if (obj != NULL) { \ - intr = static_cast( \ - obj->queryLocalInterface( \ - I##INTERFACE::descriptor).get()); \ - if (intr == NULL) { \ - intr = new Bp##INTERFACE(obj); \ - } \ - } \ - return intr; \ - } \ - I##INTERFACE::I##INTERFACE() { } \ - I##INTERFACE::~I##INTERFACE() { } \ - - -#define CHECK_INTERFACE(interface, data, reply) \ - if (!data.checkInterface(this)) { return PERMISSION_DENIED; } \ - - -// ---------------------------------------------------------------------- -// No user-serviceable parts after this... - -template -inline sp BnInterface::queryLocalInterface( - const String16& _descriptor) -{ - if (_descriptor == INTERFACE::descriptor) return this; - return NULL; -} - -template -inline const String16& BnInterface::getInterfaceDescriptor() const -{ - return INTERFACE::getInterfaceDescriptor(); -} - -template -IBinder* BnInterface::onAsBinder() -{ - return this; -} - -template -inline BpInterface::BpInterface(const sp& remote) - : BpRefBase(remote) -{ -} - -template -inline IBinder* BpInterface::onAsBinder() -{ - return remote(); -} - -// ---------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IINTERFACE_H diff --git a/external/android/include/14/frameworks/base/include/binder/IMemory.h b/external/android/include/14/frameworks/base/include/binder/IMemory.h deleted file mode 100644 index 2d0db00..0000000 --- a/external/android/include/14/frameworks/base/include/binder/IMemory.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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_IMEMORY_H -#define ANDROID_IMEMORY_H - -#include -#include -#include - -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class IMemoryHeap : public IInterface -{ -public: - DECLARE_META_INTERFACE(MemoryHeap); - - // flags returned by getFlags() - enum { - READ_ONLY = 0x00000001 - }; - - virtual int getHeapID() const = 0; - virtual void* getBase() const = 0; - virtual size_t getSize() const = 0; - virtual uint32_t getFlags() const = 0; - virtual uint32_t getOffset() const = 0; - - // these are there just for backward source compatibility - int32_t heapID() const { return getHeapID(); } - void* base() const { return getBase(); } - size_t virtualSize() const { return getSize(); } -}; - -class BnMemoryHeap : public BnInterface -{ -public: - virtual status_t onTransact( - uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); - - BnMemoryHeap(); -protected: - virtual ~BnMemoryHeap(); -}; - -// ---------------------------------------------------------------------------- - -class IMemory : public IInterface -{ -public: - DECLARE_META_INTERFACE(Memory); - - virtual sp getMemory(ssize_t* offset=0, size_t* size=0) const = 0; - - // helpers - void* fastPointer(const sp& heap, ssize_t offset) const; - void* pointer() const; - size_t size() const; - ssize_t offset() const; -}; - -class BnMemory : public BnInterface -{ -public: - virtual status_t onTransact( - uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); - - BnMemory(); -protected: - virtual ~BnMemory(); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IMEMORY_H diff --git a/external/android/include/14/frameworks/base/include/binder/IPCThreadState.h b/external/android/include/14/frameworks/base/include/binder/IPCThreadState.h deleted file mode 100644 index 3378d97..0000000 --- a/external/android/include/14/frameworks/base/include/binder/IPCThreadState.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (C) 2005 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_IPC_THREAD_STATE_H -#define ANDROID_IPC_THREAD_STATE_H - -#include -#include -#include -#include - -#ifdef HAVE_WIN32_PROC -typedef int uid_t; -#endif - -// --------------------------------------------------------------------------- -namespace android { - -class IPCThreadState -{ -public: - static IPCThreadState* self(); - static IPCThreadState* selfOrNull(); // self(), but won't instantiate - - sp process(); - - status_t clearLastError(); - - int getCallingPid(); - int getCallingUid(); - - void setStrictModePolicy(int32_t policy); - int32_t getStrictModePolicy() const; - - void setLastTransactionBinderFlags(int32_t flags); - int32_t getLastTransactionBinderFlags() const; - - int64_t clearCallingIdentity(); - void restoreCallingIdentity(int64_t token); - - void flushCommands(); - - void joinThreadPool(bool isMain = true); - - // Stop the local process. - void stopProcess(bool immediate = true); - - status_t transact(int32_t handle, - uint32_t code, const Parcel& data, - Parcel* reply, uint32_t flags); - - void incStrongHandle(int32_t handle); - void decStrongHandle(int32_t handle); - void incWeakHandle(int32_t handle); - void decWeakHandle(int32_t handle); - status_t attemptIncStrongHandle(int32_t handle); - static void expungeHandle(int32_t handle, IBinder* binder); - status_t requestDeathNotification( int32_t handle, - BpBinder* proxy); - status_t clearDeathNotification( int32_t handle, - BpBinder* proxy); - - static void shutdown(); - - // Call this to disable switching threads to background scheduling when - // receiving incoming IPC calls. This is specifically here for the - // Android system process, since it expects to have background apps calling - // in to it but doesn't want to acquire locks in its services while in - // the background. - static void disableBackgroundScheduling(bool disable); - -private: - IPCThreadState(); - ~IPCThreadState(); - - status_t sendReply(const Parcel& reply, uint32_t flags); - status_t waitForResponse(Parcel *reply, - status_t *acquireResult=NULL); - status_t talkWithDriver(bool doReceive=true); - status_t writeTransactionData(int32_t cmd, - uint32_t binderFlags, - int32_t handle, - uint32_t code, - const Parcel& data, - status_t* statusBuffer); - status_t executeCommand(int32_t command); - - void clearCaller(); - - static void threadDestructor(void *st); - static void freeBuffer(Parcel* parcel, - const uint8_t* data, size_t dataSize, - const size_t* objects, size_t objectsSize, - void* cookie); - - const sp mProcess; - const pid_t mMyThreadId; - Vector mPendingStrongDerefs; - Vector mPendingWeakDerefs; - - Parcel mIn; - Parcel mOut; - status_t mLastError; - pid_t mCallingPid; - uid_t mCallingUid; - int32_t mStrictModePolicy; - int32_t mLastTransactionBinderFlags; -}; - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_IPC_THREAD_STATE_H diff --git a/external/android/include/14/frameworks/base/include/binder/IPermissionController.h b/external/android/include/14/frameworks/base/include/binder/IPermissionController.h deleted file mode 100644 index f9d371b..0000000 --- a/external/android/include/14/frameworks/base/include/binder/IPermissionController.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2005 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_IPERMISSION_CONTROLLER_H -#define ANDROID_IPERMISSION_CONTROLLER_H - -#include - -namespace android { - -// ---------------------------------------------------------------------- - -class IPermissionController : public IInterface -{ -public: - DECLARE_META_INTERFACE(PermissionController); - - virtual bool checkPermission(const String16& permission, - int32_t pid, int32_t uid) = 0; - - enum { - CHECK_PERMISSION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION - }; -}; - -// ---------------------------------------------------------------------- - -class BnPermissionController : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IPERMISSION_CONTROLLER_H - diff --git a/external/android/include/14/frameworks/base/include/binder/IServiceManager.h b/external/android/include/14/frameworks/base/include/binder/IServiceManager.h deleted file mode 100644 index 24e9e99..0000000 --- a/external/android/include/14/frameworks/base/include/binder/IServiceManager.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2005 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_ISERVICE_MANAGER_H -#define ANDROID_ISERVICE_MANAGER_H - -#include -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------- - -class IServiceManager : public IInterface -{ -public: - DECLARE_META_INTERFACE(ServiceManager); - - /** - * Retrieve an existing service, blocking for a few seconds - * if it doesn't yet exist. - */ - virtual sp getService( const String16& name) const = 0; - - /** - * Retrieve an existing service, non-blocking. - */ - virtual sp checkService( const String16& name) const = 0; - - /** - * Register a service. - */ - virtual status_t addService( const String16& name, - const sp& service) = 0; - - /** - * Return list of all existing services. - */ - virtual Vector listServices() = 0; - - enum { - GET_SERVICE_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION, - CHECK_SERVICE_TRANSACTION, - ADD_SERVICE_TRANSACTION, - LIST_SERVICES_TRANSACTION, - }; -}; - -sp defaultServiceManager(); - -template -status_t getService(const String16& name, sp* outService) -{ - const sp sm = defaultServiceManager(); - if (sm != NULL) { - *outService = interface_cast(sm->getService(name)); - if ((*outService) != NULL) return NO_ERROR; - } - return NAME_NOT_FOUND; -} - -bool checkCallingPermission(const String16& permission); -bool checkCallingPermission(const String16& permission, - int32_t* outPid, int32_t* outUid); -bool checkPermission(const String16& permission, pid_t pid, uid_t uid); - - -// ---------------------------------------------------------------------- - -class BnServiceManager : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_ISERVICE_MANAGER_H - diff --git a/external/android/include/14/frameworks/base/include/binder/MemoryBase.h b/external/android/include/14/frameworks/base/include/binder/MemoryBase.h deleted file mode 100644 index 463e26d..0000000 --- a/external/android/include/14/frameworks/base/include/binder/MemoryBase.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_MEMORY_BASE_H -#define ANDROID_MEMORY_BASE_H - -#include -#include - -#include - - -namespace android { - -// --------------------------------------------------------------------------- - -class MemoryBase : public BnMemory -{ -public: - MemoryBase(const sp& heap, ssize_t offset, size_t size); - virtual ~MemoryBase(); - virtual sp getMemory(ssize_t* offset, size_t* size) const; - -protected: - size_t getSize() const { return mSize; } - ssize_t getOffset() const { return mOffset; } - const sp& getHeap() const { return mHeap; } - -private: - size_t mSize; - ssize_t mOffset; - sp mHeap; -}; - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_MEMORY_BASE_H diff --git a/external/android/include/14/frameworks/base/include/binder/MemoryDealer.h b/external/android/include/14/frameworks/base/include/binder/MemoryDealer.h deleted file mode 100644 index 170f20d..0000000 --- a/external/android/include/14/frameworks/base/include/binder/MemoryDealer.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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_MEMORY_DEALER_H -#define ANDROID_MEMORY_DEALER_H - - -#include -#include - -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class SimpleBestFitAllocator; - -// ---------------------------------------------------------------------------- - -class MemoryDealer : public RefBase -{ -public: - MemoryDealer(size_t size, const char* name = 0); - - virtual sp allocate(size_t size); - virtual void deallocate(size_t offset); - virtual void dump(const char* what) const; - - sp getMemoryHeap() const { return heap(); } - -protected: - virtual ~MemoryDealer(); - -private: - const sp& heap() const; - SimpleBestFitAllocator* allocator() const; - - sp mHeap; - SimpleBestFitAllocator* mAllocator; -}; - - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_MEMORY_DEALER_H diff --git a/external/android/include/14/frameworks/base/include/binder/MemoryHeapBase.h b/external/android/include/14/frameworks/base/include/binder/MemoryHeapBase.h deleted file mode 100644 index bbbda9c..0000000 --- a/external/android/include/14/frameworks/base/include/binder/MemoryHeapBase.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_MEMORY_HEAP_BASE_H -#define ANDROID_MEMORY_HEAP_BASE_H - -#include -#include - -#include - - -namespace android { - -// --------------------------------------------------------------------------- - -class MemoryHeapBase : public virtual BnMemoryHeap -{ -public: - enum { - READ_ONLY = IMemoryHeap::READ_ONLY, - // memory won't be mapped locally, but will be mapped in the remote - // process. - DONT_MAP_LOCALLY = 0x00000100, - NO_CACHING = 0x00000200 - }; - - /* - * maps the memory referenced by fd. but DOESN'T take ownership - * of the filedescriptor (it makes a copy with dup() - */ - MemoryHeapBase(int fd, size_t size, uint32_t flags = 0, uint32_t offset = 0); - - /* - * maps memory from the given device - */ - MemoryHeapBase(const char* device, size_t size = 0, uint32_t flags = 0); - - /* - * maps memory from ashmem, with the given name for debugging - */ - MemoryHeapBase(size_t size, uint32_t flags = 0, char const* name = NULL); - - virtual ~MemoryHeapBase(); - - /* implement IMemoryHeap interface */ - virtual int getHeapID() const; - virtual void* getBase() const; - virtual size_t getSize() const; - virtual uint32_t getFlags() const; - virtual uint32_t getOffset() const; - - const char* getDevice() const; - - /* this closes this heap -- use carefully */ - void dispose(); - - /* this is only needed as a workaround, use only if you know - * what you are doing */ - status_t setDevice(const char* device) { - if (mDevice == 0) - mDevice = device; - return mDevice ? NO_ERROR : ALREADY_EXISTS; - } - -protected: - MemoryHeapBase(); - // init() takes ownership of fd - status_t init(int fd, void *base, int size, - int flags = 0, const char* device = NULL); - -private: - status_t mapfd(int fd, size_t size, uint32_t offset = 0); - - int mFD; - size_t mSize; - void* mBase; - uint32_t mFlags; - const char* mDevice; - bool mNeedUnmap; - uint32_t mOffset; -}; - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_MEMORY_HEAP_BASE_H diff --git a/external/android/include/14/frameworks/base/include/binder/MemoryHeapPmem.h b/external/android/include/14/frameworks/base/include/binder/MemoryHeapPmem.h deleted file mode 100644 index e1660c4..0000000 --- a/external/android/include/14/frameworks/base/include/binder/MemoryHeapPmem.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_MEMORY_HEAP_PMEM_H -#define ANDROID_MEMORY_HEAP_PMEM_H - -#include -#include - -#include -#include -#include -#include - -namespace android { - -class MemoryHeapBase; - -// --------------------------------------------------------------------------- - -class MemoryHeapPmem : public MemoryHeapBase -{ -public: - class MemoryPmem : public BnMemory { - public: - MemoryPmem(const sp& heap); - ~MemoryPmem(); - protected: - const sp& getHeap() const { return mClientHeap; } - private: - friend class MemoryHeapPmem; - virtual void revoke() = 0; - sp mClientHeap; - }; - - MemoryHeapPmem(const sp& pmemHeap, uint32_t flags = 0); - ~MemoryHeapPmem(); - - /* HeapInterface additions */ - virtual sp mapMemory(size_t offset, size_t size); - - /* make the whole heap visible (you know who you are) */ - virtual status_t slap(); - - /* hide (revoke) the whole heap (the client will see the garbage page) */ - virtual status_t unslap(); - - /* revoke all allocations made by this heap */ - virtual void revoke(); - -private: - /* use this to create your own IMemory for mapMemory */ - virtual sp createMemory(size_t offset, size_t size); - void remove(const wp& memory); - -private: - sp mParentHeap; - mutable Mutex mLock; - SortedVector< wp > mAllocations; -}; - - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_MEMORY_HEAP_PMEM_H diff --git a/external/android/include/14/frameworks/base/include/binder/Parcel.h b/external/android/include/14/frameworks/base/include/binder/Parcel.h deleted file mode 100644 index 33b2f00..0000000 --- a/external/android/include/14/frameworks/base/include/binder/Parcel.h +++ /dev/null @@ -1,297 +0,0 @@ -/* - * Copyright (C) 2005 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_PARCEL_H -#define ANDROID_PARCEL_H - -#include -#include -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -class Flattenable; -class IBinder; -class IPCThreadState; -class ProcessState; -class String8; -class TextOutput; - -struct flat_binder_object; // defined in support_p/binder_module.h - -class Parcel -{ -public: - class ReadableBlob; - class WritableBlob; - - Parcel(); - ~Parcel(); - - const uint8_t* data() const; - size_t dataSize() const; - size_t dataAvail() const; - size_t dataPosition() const; - size_t dataCapacity() const; - - status_t setDataSize(size_t size); - void setDataPosition(size_t pos) const; - status_t setDataCapacity(size_t size); - - status_t setData(const uint8_t* buffer, size_t len); - - status_t appendFrom(const Parcel *parcel, - size_t start, size_t len); - - bool pushAllowFds(bool allowFds); - void restoreAllowFds(bool lastValue); - - bool hasFileDescriptors() const; - - // Writes the RPC header. - status_t writeInterfaceToken(const String16& interface); - - // Parses the RPC header, returning true if the interface name - // in the header matches the expected interface from the caller. - // - // Additionally, enforceInterface does part of the work of - // propagating the StrictMode policy mask, populating the current - // IPCThreadState, which as an optimization may optionally be - // passed in. - bool enforceInterface(const String16& interface, - IPCThreadState* threadState = NULL) const; - bool checkInterface(IBinder*) const; - - void freeData(); - - const size_t* objects() const; - size_t objectsCount() const; - - status_t errorCheck() const; - void setError(status_t err); - - status_t write(const void* data, size_t len); - void* writeInplace(size_t len); - status_t writeUnpadded(const void* data, size_t len); - status_t writeInt32(int32_t val); - status_t writeInt64(int64_t val); - status_t writeFloat(float val); - status_t writeDouble(double val); - status_t writeIntPtr(intptr_t val); - status_t writeCString(const char* str); - status_t writeString8(const String8& str); - status_t writeString16(const String16& str); - status_t writeString16(const char16_t* str, size_t len); - status_t writeStrongBinder(const sp& val); - status_t writeWeakBinder(const wp& val); - status_t write(const Flattenable& val); - - // Place a native_handle into the parcel (the native_handle's file- - // descriptors are dup'ed, so it is safe to delete the native_handle - // when this function returns). - // Doesn't take ownership of the native_handle. - status_t writeNativeHandle(const native_handle* handle); - - // Place a file descriptor into the parcel. The given fd must remain - // valid for the lifetime of the parcel. - // The Parcel does not take ownership of the given fd unless you ask it to. - status_t writeFileDescriptor(int fd, bool takeOwnership = false); - - // Place a file descriptor into the parcel. A dup of the fd is made, which - // will be closed once the parcel is destroyed. - status_t writeDupFileDescriptor(int fd); - - // Writes a blob to the parcel. - // If the blob is small, then it is stored in-place, otherwise it is - // transferred by way of an anonymous shared memory region. - // The caller should call release() on the blob after writing its contents. - status_t writeBlob(size_t len, WritableBlob* outBlob); - - status_t writeObject(const flat_binder_object& val, bool nullMetaData); - - // Like Parcel.java's writeNoException(). Just writes a zero int32. - // Currently the native implementation doesn't do any of the StrictMode - // stack gathering and serialization that the Java implementation does. - status_t writeNoException(); - - void remove(size_t start, size_t amt); - - status_t read(void* outData, size_t len) const; - const void* readInplace(size_t len) const; - int32_t readInt32() const; - status_t readInt32(int32_t *pArg) const; - int64_t readInt64() const; - status_t readInt64(int64_t *pArg) const; - float readFloat() const; - status_t readFloat(float *pArg) const; - double readDouble() const; - status_t readDouble(double *pArg) const; - intptr_t readIntPtr() const; - status_t readIntPtr(intptr_t *pArg) const; - - const char* readCString() const; - String8 readString8() const; - String16 readString16() const; - const char16_t* readString16Inplace(size_t* outLen) const; - sp readStrongBinder() const; - wp readWeakBinder() const; - status_t read(Flattenable& val) const; - - // Like Parcel.java's readExceptionCode(). Reads the first int32 - // off of a Parcel's header, returning 0 or the negative error - // code on exceptions, but also deals with skipping over rich - // response headers. Callers should use this to read & parse the - // response headers rather than doing it by hand. - int32_t readExceptionCode() const; - - // Retrieve native_handle from the parcel. This returns a copy of the - // parcel's native_handle (the caller takes ownership). The caller - // must free the native_handle with native_handle_close() and - // native_handle_delete(). - native_handle* readNativeHandle() const; - - - // Retrieve a file descriptor from the parcel. This returns the raw fd - // in the parcel, which you do not own -- use dup() to get your own copy. - int readFileDescriptor() const; - - // Reads a blob from the parcel. - // The caller should call release() on the blob after reading its contents. - status_t readBlob(size_t len, ReadableBlob* outBlob) const; - - const flat_binder_object* readObject(bool nullMetaData) const; - - // Explicitly close all file descriptors in the parcel. - void closeFileDescriptors(); - - typedef void (*release_func)(Parcel* parcel, - const uint8_t* data, size_t dataSize, - const size_t* objects, size_t objectsSize, - void* cookie); - - const uint8_t* ipcData() const; - size_t ipcDataSize() const; - const size_t* ipcObjects() const; - size_t ipcObjectsCount() const; - void ipcSetDataReference(const uint8_t* data, size_t dataSize, - const size_t* objects, size_t objectsCount, - release_func relFunc, void* relCookie); - - void print(TextOutput& to, uint32_t flags = 0) const; - -private: - Parcel(const Parcel& o); - Parcel& operator=(const Parcel& o); - - status_t finishWrite(size_t len); - void releaseObjects(); - void acquireObjects(); - status_t growData(size_t len); - status_t restartWrite(size_t desired); - status_t continueWrite(size_t desired); - void freeDataNoInit(); - void initState(); - void scanForFds() const; - - template - status_t readAligned(T *pArg) const; - - template T readAligned() const; - - template - status_t writeAligned(T val); - - status_t mError; - uint8_t* mData; - size_t mDataSize; - size_t mDataCapacity; - mutable size_t mDataPos; - size_t* mObjects; - size_t mObjectsSize; - size_t mObjectsCapacity; - mutable size_t mNextObjectHint; - - mutable bool mFdsKnown; - mutable bool mHasFds; - bool mAllowFds; - - release_func mOwner; - void* mOwnerCookie; - - class Blob { - public: - Blob(); - ~Blob(); - - void release(); - inline size_t size() const { return mSize; } - - protected: - void init(bool mapped, void* data, size_t size); - void clear(); - - bool mMapped; - void* mData; - size_t mSize; - }; - -public: - class ReadableBlob : public Blob { - friend class Parcel; - public: - inline const void* data() const { return mData; } - }; - - class WritableBlob : public Blob { - friend class Parcel; - public: - inline void* data() { return mData; } - }; -}; - -// --------------------------------------------------------------------------- - -inline TextOutput& operator<<(TextOutput& to, const Parcel& parcel) -{ - parcel.print(to); - return to; -} - -// --------------------------------------------------------------------------- - -// Generic acquire and release of objects. -void acquire_object(const sp& proc, - const flat_binder_object& obj, const void* who); -void release_object(const sp& proc, - const flat_binder_object& obj, const void* who); - -void flatten_binder(const sp& proc, - const sp& binder, flat_binder_object* out); -void flatten_binder(const sp& proc, - const wp& binder, flat_binder_object* out); -status_t unflatten_binder(const sp& proc, - const flat_binder_object& flat, sp* out); -status_t unflatten_binder(const sp& proc, - const flat_binder_object& flat, wp* out); - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_PARCEL_H diff --git a/external/android/include/14/frameworks/base/include/binder/PermissionCache.h b/external/android/include/14/frameworks/base/include/binder/PermissionCache.h deleted file mode 100644 index 1171d48..0000000 --- a/external/android/include/14/frameworks/base/include/binder/PermissionCache.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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 BINDER_PERMISSION_H -#define BINDER_PERMISSION_H - -#include -#include - -#include -#include - -namespace android { -// --------------------------------------------------------------------------- - -/* - * PermissionCache caches permission checks for a given uid. - * - * Currently the cache is not updated when there is a permission change, - * for instance when an application is uninstalled. - * - * IMPORTANT: for the reason stated above, only system permissions are safe - * to cache. This restriction may be lifted at a later time. - * - */ - -class PermissionCache : Singleton { - struct Entry { - String16 name; - uid_t uid; - bool granted; - inline bool operator < (const Entry& e) const { - return (uid == e.uid) ? (name < e.name) : (uid < e.uid); - } - }; - mutable Mutex mLock; - // we pool all the permission names we see, as many permissions checks - // will have identical names - SortedVector< String16 > mPermissionNamesPool; - // this is our cache per say. it stores pooled names. - SortedVector< Entry > mCache; - - // free the whole cache, but keep the permission name pool - void purge(); - - status_t check(bool* granted, - const String16& permission, uid_t uid) const; - - void cache(const String16& permission, uid_t uid, bool granted); - -public: - PermissionCache(); - - static bool checkCallingPermission(const String16& permission); - - static bool checkCallingPermission(const String16& permission, - int32_t* outPid, int32_t* outUid); - - static bool checkPermission(const String16& permission, - pid_t pid, uid_t uid); -}; - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif /* BINDER_PERMISSION_H */ diff --git a/external/android/include/14/frameworks/base/include/binder/ProcessState.h b/external/android/include/14/frameworks/base/include/binder/ProcessState.h deleted file mode 100644 index 9725822..0000000 --- a/external/android/include/14/frameworks/base/include/binder/ProcessState.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (C) 2005 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_PROCESS_STATE_H -#define ANDROID_PROCESS_STATE_H - -#include -#include -#include -#include - -#include - -// --------------------------------------------------------------------------- -namespace android { - -// Global variables -extern int mArgC; -extern const char* const* mArgV; -extern int mArgLen; - -class IPCThreadState; - -class ProcessState : public virtual RefBase -{ -public: - static sp self(); - - void setContextObject(const sp& object); - sp getContextObject(const sp& caller); - - void setContextObject(const sp& object, - const String16& name); - sp getContextObject(const String16& name, - const sp& caller); - - void startThreadPool(); - - typedef bool (*context_check_func)(const String16& name, - const sp& caller, - void* userData); - - bool isContextManager(void) const; - bool becomeContextManager( - context_check_func checkFunc, - void* userData); - - sp getStrongProxyForHandle(int32_t handle); - wp getWeakProxyForHandle(int32_t handle); - void expungeHandle(int32_t handle, IBinder* binder); - - void setArgs(int argc, const char* const argv[]); - int getArgC() const; - const char* const* getArgV() const; - - void setArgV0(const char* txt); - - void spawnPooledThread(bool isMain); - -private: - friend class IPCThreadState; - - ProcessState(); - ~ProcessState(); - - ProcessState(const ProcessState& o); - ProcessState& operator=(const ProcessState& o); - - struct handle_entry { - IBinder* binder; - RefBase::weakref_type* refs; - }; - - handle_entry* lookupHandleLocked(int32_t handle); - - int mDriverFD; - void* mVMStart; - - mutable Mutex mLock; // protects everything below. - - VectormHandleToObject; - - bool mManagesContexts; - context_check_func mBinderContextCheckFunc; - void* mBinderContextUserData; - - KeyedVector > - mContexts; - - - String8 mRootDir; - bool mThreadPoolStarted; - volatile int32_t mThreadPoolSeq; -}; - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_PROCESS_STATE_H diff --git a/external/android/include/14/frameworks/base/include/gui/ISensorEventConnection.h b/external/android/include/14/frameworks/base/include/gui/ISensorEventConnection.h deleted file mode 100644 index ed4e4cc..0000000 --- a/external/android/include/14/frameworks/base/include/gui/ISensorEventConnection.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_ISENSOR_EVENT_CONNECTION_H -#define ANDROID_GUI_ISENSOR_EVENT_CONNECTION_H - -#include -#include - -#include -#include - -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class SensorChannel; - -class ISensorEventConnection : public IInterface -{ -public: - DECLARE_META_INTERFACE(SensorEventConnection); - - virtual sp getSensorChannel() const = 0; - virtual status_t enableDisable(int handle, bool enabled) = 0; - virtual status_t setEventRate(int handle, nsecs_t ns) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnSensorEventConnection : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_ISENSOR_EVENT_CONNECTION_H diff --git a/external/android/include/14/frameworks/base/include/gui/ISensorServer.h b/external/android/include/14/frameworks/base/include/gui/ISensorServer.h deleted file mode 100644 index 9c8afc5..0000000 --- a/external/android/include/14/frameworks/base/include/gui/ISensorServer.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_ISENSORSERVER_H -#define ANDROID_GUI_ISENSORSERVER_H - -#include -#include - -#include -#include - -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class Sensor; -class ISensorEventConnection; - -class ISensorServer : public IInterface -{ -public: - DECLARE_META_INTERFACE(SensorServer); - - virtual Vector getSensorList() = 0; - virtual sp createSensorEventConnection() = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnSensorServer : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_ISENSORSERVER_H diff --git a/external/android/include/14/frameworks/base/include/gui/ISurfaceTexture.h b/external/android/include/14/frameworks/base/include/gui/ISurfaceTexture.h deleted file mode 100644 index 50626a0..0000000 --- a/external/android/include/14/frameworks/base/include/gui/ISurfaceTexture.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_ISURFACETEXTURE_H -#define ANDROID_GUI_ISURFACETEXTURE_H - -#include -#include - -#include -#include - -#include - -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class SurfaceTextureClient; - -class ISurfaceTexture : public IInterface -{ -public: - DECLARE_META_INTERFACE(SurfaceTexture); - -protected: - friend class SurfaceTextureClient; - - enum { - BUFFER_NEEDS_REALLOCATION = 0x1, - RELEASE_ALL_BUFFERS = 0x2, - }; - - // requestBuffer requests a new buffer for the given index. The server (i.e. - // the ISurfaceTexture implementation) assigns the newly created buffer to - // the given slot index, and the client is expected to mirror the - // slot->buffer mapping so that it's not necessary to transfer a - // GraphicBuffer for every dequeue operation. - virtual status_t requestBuffer(int slot, sp* buf) = 0; - - // setBufferCount sets the number of buffer slots available. Calling this - // will also cause all buffer slots to be emptied. The caller should empty - // its mirrored copy of the buffer slots when calling this method. - virtual status_t setBufferCount(int bufferCount) = 0; - - // dequeueBuffer requests a new buffer slot for the client to use. Ownership - // of the slot is transfered to the client, meaning that the server will not - // use the contents of the buffer associated with that slot. The slot index - // returned may or may not contain a buffer. If the slot is empty the client - // should call requestBuffer to assign a new buffer to that slot. The client - // is expected to either call cancelBuffer on the dequeued slot or to fill - // in the contents of its associated buffer contents and call queueBuffer. - // If dequeueBuffer return BUFFER_NEEDS_REALLOCATION, the client is - // expected to call requestBuffer immediately. - virtual status_t dequeueBuffer(int *slot, uint32_t w, uint32_t h, - uint32_t format, uint32_t usage) = 0; - - // queueBuffer indicates that the client has finished filling in the - // contents of the buffer associated with slot and transfers ownership of - // that slot back to the server. It is not valid to call queueBuffer on a - // slot that is not owned by the client or one for which a buffer associated - // via requestBuffer. In addition, a timestamp must be provided by the - // client for this buffer. The timestamp is measured in nanoseconds, and - // must be monotonically increasing. Its other properties (zero point, etc) - // are client-dependent, and should be documented by the client. - // - // outWidth, outHeight and outTransform are filled with the default width - // and height of the window and current transform applied to buffers, - // respectively. - virtual status_t queueBuffer(int slot, int64_t timestamp, - uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) = 0; - - // cancelBuffer indicates that the client does not wish to fill in the - // buffer associated with slot and transfers ownership of the slot back to - // the server. - virtual void cancelBuffer(int slot) = 0; - - virtual status_t setCrop(const Rect& reg) = 0; - virtual status_t setTransform(uint32_t transform) = 0; - virtual status_t setScalingMode(int mode) = 0; - - // query retrieves some information for this surface - // 'what' tokens allowed are that of android_natives.h - virtual int query(int what, int* value) = 0; - - // setSynchronousMode set whether dequeueBuffer is synchronous or - // asynchronous. In synchronous mode, dequeueBuffer blocks until - // a buffer is available, the currently bound buffer can be dequeued and - // queued buffers will be retired in order. - // The default mode is asynchronous. - virtual status_t setSynchronousMode(bool enabled) = 0; - - // connect attempts to connect a client API to the SurfaceTexture. This - // must be called before any other ISurfaceTexture methods are called except - // for getAllocator. - // - // This method will fail if the connect was previously called on the - // SurfaceTexture and no corresponding disconnect call was made. - // - // outWidth, outHeight and outTransform are filled with the default width - // and height of the window and current transform applied to buffers, - // respectively. - virtual status_t connect(int api, - uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) = 0; - - // disconnect attempts to disconnect a client API from the SurfaceTexture. - // Calling this method will cause any subsequent calls to other - // ISurfaceTexture methods to fail except for getAllocator and connect. - // Successfully calling connect after this will allow the other methods to - // succeed again. - // - // This method will fail if the the SurfaceTexture is not currently - // connected to the specified client API. - virtual status_t disconnect(int api) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnSurfaceTexture : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_ISURFACETEXTURE_H diff --git a/external/android/include/14/frameworks/base/include/gui/Sensor.h b/external/android/include/14/frameworks/base/include/gui/Sensor.h deleted file mode 100644 index e59757a..0000000 --- a/external/android/include/14/frameworks/base/include/gui/Sensor.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_SENSOR_H -#define ANDROID_GUI_SENSOR_H - -#include -#include - -#include -#include -#include -#include - -#include - -#include - -// ---------------------------------------------------------------------------- -// Concrete types for the NDK -struct ASensor { }; - -// ---------------------------------------------------------------------------- -namespace android { -// ---------------------------------------------------------------------------- - -class Parcel; - -// ---------------------------------------------------------------------------- - -class Sensor : public ASensor, public Flattenable -{ -public: - enum { - TYPE_ACCELEROMETER = ASENSOR_TYPE_ACCELEROMETER, - TYPE_MAGNETIC_FIELD = ASENSOR_TYPE_MAGNETIC_FIELD, - TYPE_GYROSCOPE = ASENSOR_TYPE_GYROSCOPE, - TYPE_LIGHT = ASENSOR_TYPE_LIGHT, - TYPE_PROXIMITY = ASENSOR_TYPE_PROXIMITY - }; - - Sensor(); - Sensor(struct sensor_t const* hwSensor); - virtual ~Sensor(); - - const String8& getName() const; - const String8& getVendor() const; - int32_t getHandle() const; - int32_t getType() const; - float getMinValue() const; - float getMaxValue() const; - float getResolution() const; - float getPowerUsage() const; - int32_t getMinDelay() const; - nsecs_t getMinDelayNs() const; - int32_t getVersion() const; - - // Flattenable interface - virtual size_t getFlattenedSize() const; - virtual size_t getFdCount() const; - virtual status_t flatten(void* buffer, size_t size, - int fds[], size_t count) const; - virtual status_t unflatten(void const* buffer, size_t size, - int fds[], size_t count); - -private: - String8 mName; - String8 mVendor; - int32_t mHandle; - int32_t mType; - float mMinValue; - float mMaxValue; - float mResolution; - float mPower; - int32_t mMinDelay; - int32_t mVersion; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_SENSOR_H diff --git a/external/android/include/14/frameworks/base/include/gui/SensorChannel.h b/external/android/include/14/frameworks/base/include/gui/SensorChannel.h deleted file mode 100644 index bb54618..0000000 --- a/external/android/include/14/frameworks/base/include/gui/SensorChannel.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_SENSOR_CHANNEL_H -#define ANDROID_GUI_SENSOR_CHANNEL_H - -#include -#include - -#include -#include - - -namespace android { -// ---------------------------------------------------------------------------- -class Parcel; - -class SensorChannel : public RefBase -{ -public: - - SensorChannel(); - SensorChannel(const Parcel& data); - virtual ~SensorChannel(); - - int getFd() const; - ssize_t write(void const* vaddr, size_t size); - ssize_t read(void* vaddr, size_t size); - - status_t writeToParcel(Parcel* reply) const; - -private: - int mSendFd; - mutable int mReceiveFd; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_SENSOR_CHANNEL_H diff --git a/external/android/include/14/frameworks/base/include/gui/SensorEventQueue.h b/external/android/include/14/frameworks/base/include/gui/SensorEventQueue.h deleted file mode 100644 index 97dd391..0000000 --- a/external/android/include/14/frameworks/base/include/gui/SensorEventQueue.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2010 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_SENSOR_EVENT_QUEUE_H -#define ANDROID_SENSOR_EVENT_QUEUE_H - -#include -#include - -#include -#include -#include - -#include - -// ---------------------------------------------------------------------------- - -struct ALooper; -struct ASensorEvent; - -// Concrete types for the NDK -struct ASensorEventQueue { - ALooper* looper; -}; - -// ---------------------------------------------------------------------------- -namespace android { -// ---------------------------------------------------------------------------- - -class ISensorEventConnection; -class Sensor; -class Looper; - -// ---------------------------------------------------------------------------- - -class SensorEventQueue : public ASensorEventQueue, public RefBase -{ -public: - SensorEventQueue(const sp& connection); - virtual ~SensorEventQueue(); - virtual void onFirstRef(); - - int getFd() const; - ssize_t write(ASensorEvent const* events, size_t numEvents); - ssize_t read(ASensorEvent* events, size_t numEvents); - - status_t waitForEvent() const; - status_t wake() const; - - status_t enableSensor(Sensor const* sensor) const; - status_t disableSensor(Sensor const* sensor) const; - status_t setEventRate(Sensor const* sensor, nsecs_t ns) const; - - // these are here only to support SensorManager.java - status_t enableSensor(int32_t handle, int32_t us) const; - status_t disableSensor(int32_t handle) const; - -private: - sp getLooper() const; - sp mSensorEventConnection; - sp mSensorChannel; - mutable Mutex mLock; - mutable sp mLooper; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_SENSOR_EVENT_QUEUE_H diff --git a/external/android/include/14/frameworks/base/include/gui/SensorManager.h b/external/android/include/14/frameworks/base/include/gui/SensorManager.h deleted file mode 100644 index 3176462..0000000 --- a/external/android/include/14/frameworks/base/include/gui/SensorManager.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_SENSOR_MANAGER_H -#define ANDROID_GUI_SENSOR_MANAGER_H - -#include -#include - -#include - -#include -#include -#include -#include - -#include - -// ---------------------------------------------------------------------------- -// Concrete types for the NDK -struct ASensorManager { }; - -// ---------------------------------------------------------------------------- -namespace android { -// ---------------------------------------------------------------------------- - -class ISensorServer; -class Sensor; -class SensorEventQueue; - -// ---------------------------------------------------------------------------- - -class SensorManager : - public ASensorManager, - public Singleton -{ -public: - SensorManager(); - ~SensorManager(); - - ssize_t getSensorList(Sensor const* const** list) const; - Sensor const* getDefaultSensor(int type); - sp createEventQueue(); - -private: - // DeathRecipient interface - void sensorManagerDied(); - - status_t assertStateLocked() const; - -private: - mutable Mutex mLock; - mutable sp mSensorServer; - mutable Sensor const** mSensorList; - mutable Vector mSensors; - mutable sp mDeathObserver; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_SENSOR_MANAGER_H diff --git a/external/android/include/14/frameworks/base/include/gui/SurfaceTexture.h b/external/android/include/14/frameworks/base/include/gui/SurfaceTexture.h deleted file mode 100644 index e2d6179..0000000 --- a/external/android/include/14/frameworks/base/include/gui/SurfaceTexture.h +++ /dev/null @@ -1,476 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_SURFACETEXTURE_H -#define ANDROID_GUI_SURFACETEXTURE_H - -#include -#include -#include -#include - -#include - -#include - -#include -#include -#include - -#define ANDROID_GRAPHICS_SURFACETEXTURE_JNI_ID "mSurfaceTexture" - -namespace android { -// ---------------------------------------------------------------------------- - -class IGraphicBufferAlloc; -class String8; - -class SurfaceTexture : public BnSurfaceTexture { -public: - enum { MIN_UNDEQUEUED_BUFFERS = 2 }; - enum { - MIN_ASYNC_BUFFER_SLOTS = MIN_UNDEQUEUED_BUFFERS + 1, - MIN_SYNC_BUFFER_SLOTS = MIN_UNDEQUEUED_BUFFERS - }; - enum { NUM_BUFFER_SLOTS = 32 }; - enum { NO_CONNECTED_API = 0 }; - - struct FrameAvailableListener : public virtual RefBase { - // onFrameAvailable() is called from queueBuffer() each time an - // additional frame becomes available for consumption. This means that - // frames that are queued while in asynchronous mode only trigger the - // callback if no previous frames are pending. Frames queued while in - // synchronous mode always trigger the callback. - // - // This is called without any lock held and can be called concurrently - // by multiple threads. - virtual void onFrameAvailable() = 0; - }; - - // tex indicates the name OpenGL texture to which images are to be streamed. - // This texture name cannot be changed once the SurfaceTexture is created. - SurfaceTexture(GLuint tex, bool allowSynchronousMode = true, - GLenum texTarget = GL_TEXTURE_EXTERNAL_OES); - - virtual ~SurfaceTexture(); - - // setBufferCount updates the number of available buffer slots. After - // calling this all buffer slots are both unallocated and owned by the - // SurfaceTexture object (i.e. they are not owned by the client). - virtual status_t setBufferCount(int bufferCount); - - virtual status_t requestBuffer(int slot, sp* buf); - - // dequeueBuffer gets the next buffer slot index for the client to use. If a - // buffer slot is available then that slot index is written to the location - // pointed to by the buf argument and a status of OK is returned. If no - // slot is available then a status of -EBUSY is returned and buf is - // unmodified. - virtual status_t dequeueBuffer(int *buf, uint32_t w, uint32_t h, - uint32_t format, uint32_t usage); - - // queueBuffer returns a filled buffer to the SurfaceTexture. In addition, a - // timestamp must be provided for the buffer. The timestamp is in - // nanoseconds, and must be monotonically increasing. Its other semantics - // (zero point, etc) are client-dependent and should be documented by the - // client. - virtual status_t queueBuffer(int buf, int64_t timestamp, - uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform); - virtual void cancelBuffer(int buf); - virtual status_t setCrop(const Rect& reg); - virtual status_t setTransform(uint32_t transform); - virtual status_t setScalingMode(int mode); - - virtual int query(int what, int* value); - - // setSynchronousMode set whether dequeueBuffer is synchronous or - // asynchronous. In synchronous mode, dequeueBuffer blocks until - // a buffer is available, the currently bound buffer can be dequeued and - // queued buffers will be retired in order. - // The default mode is asynchronous. - virtual status_t setSynchronousMode(bool enabled); - - // connect attempts to connect a client API to the SurfaceTexture. This - // must be called before any other ISurfaceTexture methods are called except - // for getAllocator. - // - // This method will fail if the connect was previously called on the - // SurfaceTexture and no corresponding disconnect call was made. - virtual status_t connect(int api, - uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform); - - // disconnect attempts to disconnect a client API from the SurfaceTexture. - // Calling this method will cause any subsequent calls to other - // ISurfaceTexture methods to fail except for getAllocator and connect. - // Successfully calling connect after this will allow the other methods to - // succeed again. - // - // This method will fail if the the SurfaceTexture is not currently - // connected to the specified client API. - virtual status_t disconnect(int api); - - // updateTexImage sets the image contents of the target texture to that of - // the most recently queued buffer. - // - // This call may only be made while the OpenGL ES context to which the - // target texture belongs is bound to the calling thread. - status_t updateTexImage(); - - // setBufferCountServer set the buffer count. If the client has requested - // a buffer count using setBufferCount, the server-buffer count will - // take effect once the client sets the count back to zero. - status_t setBufferCountServer(int bufferCount); - - // getTransformMatrix retrieves the 4x4 texture coordinate transform matrix - // associated with the texture image set by the most recent call to - // updateTexImage. - // - // This transform matrix maps 2D homogeneous texture coordinates of the form - // (s, t, 0, 1) with s and t in the inclusive range [0, 1] to the texture - // coordinate that should be used to sample that location from the texture. - // Sampling the texture outside of the range of this transform is undefined. - // - // This transform is necessary to compensate for transforms that the stream - // content producer may implicitly apply to the content. By forcing users of - // a SurfaceTexture to apply this transform we avoid performing an extra - // copy of the data that would be needed to hide the transform from the - // user. - // - // The matrix is stored in column-major order so that it may be passed - // directly to OpenGL ES via the glLoadMatrixf or glUniformMatrix4fv - // functions. - void getTransformMatrix(float mtx[16]); - - // getTimestamp retrieves the timestamp associated with the texture image - // set by the most recent call to updateTexImage. - // - // The timestamp is in nanoseconds, and is monotonically increasing. Its - // other semantics (zero point, etc) are source-dependent and should be - // documented by the source. - int64_t getTimestamp(); - - // setFrameAvailableListener sets the listener object that will be notified - // when a new frame becomes available. - void setFrameAvailableListener(const sp& listener); - - // getAllocator retrieves the binder object that must be referenced as long - // as the GraphicBuffers dequeued from this SurfaceTexture are referenced. - // Holding this binder reference prevents SurfaceFlinger from freeing the - // buffers before the client is done with them. - sp getAllocator(); - - // setDefaultBufferSize is used to set the size of buffers returned by - // requestBuffers when a with and height of zero is requested. - // A call to setDefaultBufferSize() may trigger requestBuffers() to - // be called from the client. - status_t setDefaultBufferSize(uint32_t w, uint32_t h); - - // getCurrentBuffer returns the buffer associated with the current image. - sp getCurrentBuffer() const; - - // getCurrentTextureTarget returns the texture target of the current - // texture as returned by updateTexImage(). - GLenum getCurrentTextureTarget() const; - - // getCurrentCrop returns the cropping rectangle of the current buffer - Rect getCurrentCrop() const; - - // getCurrentTransform returns the transform of the current buffer - uint32_t getCurrentTransform() const; - - // getCurrentScalingMode returns the scaling mode of the current buffer - uint32_t getCurrentScalingMode() const; - - // abandon frees all the buffers and puts the SurfaceTexture into the - // 'abandoned' state. Once put in this state the SurfaceTexture can never - // leave it. When in the 'abandoned' state, all methods of the - // ISurfaceTexture interface will fail with the NO_INIT error. - // - // Note that while calling this method causes all the buffers to be freed - // from the perspective of the the SurfaceTexture, if there are additional - // references on the buffers (e.g. if a buffer is referenced by a client or - // by OpenGL ES as a texture) then those buffer will remain allocated. - void abandon(); - - // set the name of the SurfaceTexture that will be used to identify it in - // log messages. - void setName(const String8& name); - - // dump our state in a String - void dump(String8& result) const; - void dump(String8& result, const char* prefix, char* buffer, size_t SIZE) const; - -protected: - - // freeBufferLocked frees the resources (both GraphicBuffer and EGLImage) - // for the given slot. - void freeBufferLocked(int index); - - // freeAllBuffersLocked frees the resources (both GraphicBuffer and - // EGLImage) for all slots. - void freeAllBuffersLocked(); - - // freeAllBuffersExceptHeadLocked frees the resources (both GraphicBuffer - // and EGLImage) for all slots except the head of mQueue - void freeAllBuffersExceptHeadLocked(); - - // drainQueueLocked drains the buffer queue if we're in synchronous mode - // returns immediately otherwise. return NO_INIT if SurfaceTexture - // became abandoned or disconnected during this call. - status_t drainQueueLocked(); - - // drainQueueAndFreeBuffersLocked drains the buffer queue if we're in - // synchronous mode and free all buffers. In asynchronous mode, all buffers - // are freed except the current buffer. - status_t drainQueueAndFreeBuffersLocked(); - - static bool isExternalFormat(uint32_t format); - -private: - - // createImage creates a new EGLImage from a GraphicBuffer. - EGLImageKHR createImage(EGLDisplay dpy, - const sp& graphicBuffer); - - status_t setBufferCountServerLocked(int bufferCount); - - // computeCurrentTransformMatrix computes the transform matrix for the - // current texture. It uses mCurrentTransform and the current GraphicBuffer - // to compute this matrix and stores it in mCurrentTransformMatrix. - void computeCurrentTransformMatrix(); - - enum { INVALID_BUFFER_SLOT = -1 }; - - struct BufferSlot { - - BufferSlot() - : mEglImage(EGL_NO_IMAGE_KHR), - mEglDisplay(EGL_NO_DISPLAY), - mBufferState(BufferSlot::FREE), - mRequestBufferCalled(false), - mTransform(0), - mScalingMode(NATIVE_WINDOW_SCALING_MODE_FREEZE), - mTimestamp(0) { - mCrop.makeInvalid(); - } - - // mGraphicBuffer points to the buffer allocated for this slot or is NULL - // if no buffer has been allocated. - sp mGraphicBuffer; - - // mEglImage is the EGLImage created from mGraphicBuffer. - EGLImageKHR mEglImage; - - // mEglDisplay is the EGLDisplay used to create mEglImage. - EGLDisplay mEglDisplay; - - // BufferState represents the different states in which a buffer slot - // can be. - enum BufferState { - // FREE indicates that the buffer is not currently being used and - // will not be used in the future until it gets dequeued and - // subsequently queued by the client. - FREE = 0, - - // DEQUEUED indicates that the buffer has been dequeued by the - // client, but has not yet been queued or canceled. The buffer is - // considered 'owned' by the client, and the server should not use - // it for anything. - // - // Note that when in synchronous-mode (mSynchronousMode == true), - // the buffer that's currently attached to the texture may be - // dequeued by the client. That means that the current buffer can - // be in either the DEQUEUED or QUEUED state. In asynchronous mode, - // however, the current buffer is always in the QUEUED state. - DEQUEUED = 1, - - // QUEUED indicates that the buffer has been queued by the client, - // and has not since been made available for the client to dequeue. - // Attaching the buffer to the texture does NOT transition the - // buffer away from the QUEUED state. However, in Synchronous mode - // the current buffer may be dequeued by the client under some - // circumstances. See the note about the current buffer in the - // documentation for DEQUEUED. - QUEUED = 2, - }; - - // mBufferState is the current state of this buffer slot. - BufferState mBufferState; - - // mRequestBufferCalled is used for validating that the client did - // call requestBuffer() when told to do so. Technically this is not - // needed but useful for debugging and catching client bugs. - bool mRequestBufferCalled; - - // mCrop is the current crop rectangle for this buffer slot. This gets - // set to mNextCrop each time queueBuffer gets called for this buffer. - Rect mCrop; - - // mTransform is the current transform flags for this buffer slot. This - // gets set to mNextTransform each time queueBuffer gets called for this - // slot. - uint32_t mTransform; - - // mScalingMode is the current scaling mode for this buffer slot. This - // gets set to mNextScalingMode each time queueBuffer gets called for - // this slot. - uint32_t mScalingMode; - - // mTimestamp is the current timestamp for this buffer slot. This gets - // to set by queueBuffer each time this slot is queued. - int64_t mTimestamp; - }; - - // mSlots is the array of buffer slots that must be mirrored on the client - // side. This allows buffer ownership to be transferred between the client - // and server without sending a GraphicBuffer over binder. The entire array - // is initialized to NULL at construction time, and buffers are allocated - // for a slot when requestBuffer is called with that slot's index. - BufferSlot mSlots[NUM_BUFFER_SLOTS]; - - // mDefaultWidth holds the default width of allocated buffers. It is used - // in requestBuffers() if a width and height of zero is specified. - uint32_t mDefaultWidth; - - // mDefaultHeight holds the default height of allocated buffers. It is used - // in requestBuffers() if a width and height of zero is specified. - uint32_t mDefaultHeight; - - // mPixelFormat holds the pixel format of allocated buffers. It is used - // in requestBuffers() if a format of zero is specified. - uint32_t mPixelFormat; - - // mBufferCount is the number of buffer slots that the client and server - // must maintain. It defaults to MIN_ASYNC_BUFFER_SLOTS and can be changed - // by calling setBufferCount or setBufferCountServer - int mBufferCount; - - // mClientBufferCount is the number of buffer slots requested by the client. - // The default is zero, which means the client doesn't care how many buffers - // there is. - int mClientBufferCount; - - // mServerBufferCount buffer count requested by the server-side - int mServerBufferCount; - - // mCurrentTexture is the buffer slot index of the buffer that is currently - // bound to the OpenGL texture. It is initialized to INVALID_BUFFER_SLOT, - // indicating that no buffer slot is currently bound to the texture. Note, - // however, that a value of INVALID_BUFFER_SLOT does not necessarily mean - // that no buffer is bound to the texture. A call to setBufferCount will - // reset mCurrentTexture to INVALID_BUFFER_SLOT. - int mCurrentTexture; - - // mCurrentTextureBuf is the graphic buffer of the current texture. It's - // possible that this buffer is not associated with any buffer slot, so we - // must track it separately in order to support the getCurrentBuffer method. - sp mCurrentTextureBuf; - - // mCurrentCrop is the crop rectangle that applies to the current texture. - // It gets set each time updateTexImage is called. - Rect mCurrentCrop; - - // mCurrentTransform is the transform identifier for the current texture. It - // gets set each time updateTexImage is called. - uint32_t mCurrentTransform; - - // mCurrentScalingMode is the scaling mode for the current texture. It gets - // set to each time updateTexImage is called. - uint32_t mCurrentScalingMode; - - // mCurrentTransformMatrix is the transform matrix for the current texture. - // It gets computed by computeTransformMatrix each time updateTexImage is - // called. - float mCurrentTransformMatrix[16]; - - // mCurrentTimestamp is the timestamp for the current texture. It - // gets set each time updateTexImage is called. - int64_t mCurrentTimestamp; - - // mNextCrop is the crop rectangle that will be used for the next buffer - // that gets queued. It is set by calling setCrop. - Rect mNextCrop; - - // mNextTransform is the transform identifier that will be used for the next - // buffer that gets queued. It is set by calling setTransform. - uint32_t mNextTransform; - - // mNextScalingMode is the scaling mode that will be used for the next - // buffers that get queued. It is set by calling setScalingMode. - int mNextScalingMode; - - // mTexName is the name of the OpenGL texture to which streamed images will - // be bound when updateTexImage is called. It is set at construction time - // changed with a call to setTexName. - const GLuint mTexName; - - // mGraphicBufferAlloc is the connection to SurfaceFlinger that is used to - // allocate new GraphicBuffer objects. - sp mGraphicBufferAlloc; - - // mFrameAvailableListener is the listener object that will be called when a - // new frame becomes available. If it is not NULL it will be called from - // queueBuffer. - sp mFrameAvailableListener; - - // mSynchronousMode whether we're in synchronous mode or not - bool mSynchronousMode; - - // mAllowSynchronousMode whether we allow synchronous mode or not - const bool mAllowSynchronousMode; - - // mConnectedApi indicates the API that is currently connected to this - // SurfaceTexture. It defaults to NO_CONNECTED_API (= 0), and gets updated - // by the connect and disconnect methods. - int mConnectedApi; - - // mDequeueCondition condition used for dequeueBuffer in synchronous mode - mutable Condition mDequeueCondition; - - // mQueue is a FIFO of queued buffers used in synchronous mode - typedef Vector Fifo; - Fifo mQueue; - - // mAbandoned indicates that the SurfaceTexture will no longer be used to - // consume images buffers pushed to it using the ISurfaceTexture interface. - // It is initialized to false, and set to true in the abandon method. A - // SurfaceTexture that has been abandoned will return the NO_INIT error from - // all ISurfaceTexture methods capable of returning an error. - bool mAbandoned; - - // mName is a string used to identify the SurfaceTexture in log messages. - // It is set by the setName method. - String8 mName; - - // mMutex is the mutex used to prevent concurrent access to the member - // variables of SurfaceTexture objects. It must be locked whenever the - // member variables are accessed. - mutable Mutex mMutex; - - // mTexTarget is the GL texture target with which the GL texture object is - // associated. It is set in the constructor and never changed. It is - // almost always GL_TEXTURE_EXTERNAL_OES except for one use case in Android - // Browser. In that case it is set to GL_TEXTURE_2D to allow - // glCopyTexSubImage to read from the texture. This is a hack to work - // around a GL driver limitation on the number of FBO attachments, which the - // browser's tile cache exceeds. - const GLenum mTexTarget; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_SURFACETEXTURE_H diff --git a/external/android/include/14/frameworks/base/include/gui/SurfaceTextureClient.h b/external/android/include/14/frameworks/base/include/gui/SurfaceTextureClient.h deleted file mode 100644 index 57f9e15..0000000 --- a/external/android/include/14/frameworks/base/include/gui/SurfaceTextureClient.h +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_SURFACETEXTURECLIENT_H -#define ANDROID_GUI_SURFACETEXTURECLIENT_H - -#include -#include - -#include -#include - -#include -#include - -namespace android { - -class Surface; - -class SurfaceTextureClient - : public EGLNativeBase -{ -public: - SurfaceTextureClient(const sp& surfaceTexture); - - sp getISurfaceTexture() const; - -protected: - SurfaceTextureClient(); - void setISurfaceTexture(const sp& surfaceTexture); - -private: - // can't be copied - SurfaceTextureClient& operator = (const SurfaceTextureClient& rhs); - SurfaceTextureClient(const SurfaceTextureClient& rhs); - void init(); - - // ANativeWindow hooks - static int hook_cancelBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer); - static int hook_dequeueBuffer(ANativeWindow* window, ANativeWindowBuffer** buffer); - static int hook_lockBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer); - static int hook_perform(ANativeWindow* window, int operation, ...); - static int hook_query(const ANativeWindow* window, int what, int* value); - static int hook_queueBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer); - static int hook_setSwapInterval(ANativeWindow* window, int interval); - - int dispatchConnect(va_list args); - int dispatchDisconnect(va_list args); - int dispatchSetBufferCount(va_list args); - int dispatchSetBuffersGeometry(va_list args); - int dispatchSetBuffersDimensions(va_list args); - int dispatchSetBuffersFormat(va_list args); - int dispatchSetScalingMode(va_list args); - int dispatchSetBuffersTransform(va_list args); - int dispatchSetBuffersTimestamp(va_list args); - int dispatchSetCrop(va_list args); - int dispatchSetUsage(va_list args); - int dispatchLock(va_list args); - int dispatchUnlockAndPost(va_list args); - -protected: - virtual int cancelBuffer(ANativeWindowBuffer* buffer); - virtual int dequeueBuffer(ANativeWindowBuffer** buffer); - virtual int lockBuffer(ANativeWindowBuffer* buffer); - virtual int perform(int operation, va_list args); - virtual int query(int what, int* value) const; - virtual int queueBuffer(ANativeWindowBuffer* buffer); - virtual int setSwapInterval(int interval); - - virtual int connect(int api); - virtual int disconnect(int api); - virtual int setBufferCount(int bufferCount); - virtual int setBuffersDimensions(int w, int h); - virtual int setBuffersFormat(int format); - virtual int setScalingMode(int mode); - virtual int setBuffersTransform(int transform); - virtual int setBuffersTimestamp(int64_t timestamp); - virtual int setCrop(Rect const* rect); - virtual int setUsage(uint32_t reqUsage); - virtual int lock(ANativeWindow_Buffer* outBuffer, ARect* inOutDirtyBounds); - virtual int unlockAndPost(); - - enum { MIN_UNDEQUEUED_BUFFERS = SurfaceTexture::MIN_UNDEQUEUED_BUFFERS }; - enum { NUM_BUFFER_SLOTS = SurfaceTexture::NUM_BUFFER_SLOTS }; - enum { DEFAULT_FORMAT = PIXEL_FORMAT_RGBA_8888 }; - -private: - void freeAllBuffers(); - int getSlotFromBufferLocked(android_native_buffer_t* buffer) const; - - // mSurfaceTexture is the interface to the surface texture server. All - // operations on the surface texture client ultimately translate into - // interactions with the server using this interface. - sp mSurfaceTexture; - - // mSlots stores the buffers that have been allocated for each buffer slot. - // It is initialized to null pointers, and gets filled in with the result of - // ISurfaceTexture::requestBuffer when the client dequeues a buffer from a - // slot that has not yet been used. The buffer allocated to a slot will also - // be replaced if the requested buffer usage or geometry differs from that - // of the buffer allocated to a slot. - sp mSlots[NUM_BUFFER_SLOTS]; - - // mReqWidth is the buffer width that will be requested at the next dequeue - // operation. It is initialized to 1. - uint32_t mReqWidth; - - // mReqHeight is the buffer height that will be requested at the next deuque - // operation. It is initialized to 1. - uint32_t mReqHeight; - - // mReqFormat is the buffer pixel format that will be requested at the next - // deuque operation. It is initialized to PIXEL_FORMAT_RGBA_8888. - uint32_t mReqFormat; - - // mReqUsage is the set of buffer usage flags that will be requested - // at the next deuque operation. It is initialized to 0. - uint32_t mReqUsage; - - // mTimestamp is the timestamp that will be used for the next buffer queue - // operation. It defaults to NATIVE_WINDOW_TIMESTAMP_AUTO, which means that - // a timestamp is auto-generated when queueBuffer is called. - int64_t mTimestamp; - - // mDefaultWidth is default width of the window, regardless of the - // native_window_set_buffers_dimensions call - uint32_t mDefaultWidth; - - // mDefaultHeight is default width of the window, regardless of the - // native_window_set_buffers_dimensions call - uint32_t mDefaultHeight; - - // mTransformHint is the transform probably applied to buffers of this - // window. this is only a hint, actual transform may differ. - uint32_t mTransformHint; - - // mMutex is the mutex used to prevent concurrent access to the member - // variables of SurfaceTexture objects. It must be locked whenever the - // member variables are accessed. - mutable Mutex mMutex; - - // must be used from the lock/unlock thread - sp mLockedBuffer; - sp mPostedBuffer; - mutable Region mOldDirtyRegion; - bool mConnectedToCpu; -}; - -}; // namespace android - -#endif // ANDROID_GUI_SURFACETEXTURECLIENT_H diff --git a/external/android/include/14/frameworks/base/include/media/AudioEffect.h b/external/android/include/14/frameworks/base/include/media/AudioEffect.h deleted file mode 100644 index 1417416..0000000 --- a/external/android/include/14/frameworks/base/include/media/AudioEffect.h +++ /dev/null @@ -1,458 +0,0 @@ -/* - * 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_AUDIOEFFECT_H -#define ANDROID_AUDIOEFFECT_H - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - -namespace android { - -// ---------------------------------------------------------------------------- - -class effect_param_cblk_t; - -// ---------------------------------------------------------------------------- - -class AudioEffect : public RefBase -{ -public: - - /* - * Static methods for effects enumeration. - */ - - /* - * Returns the number of effects available. This method together - * with queryEffect() is used to enumerate all effects: - * The enumeration sequence is: - * queryNumberEffects(&num_effects); - * for (i = 0; i < num_effects; i++) - * queryEffect(i,...); - * - * Parameters: - * numEffects: address where the number of effects should be returned. - * - * Returned status (from utils/Errors.h) can be: - * NO_ERROR successful operation. - * PERMISSION_DENIED could not get AudioFlinger interface - * NO_INIT effect library failed to initialize - * BAD_VALUE invalid numEffects pointer - * - * Returned value - * *numEffects: updated with number of effects available - */ - static status_t queryNumberEffects(uint32_t *numEffects); - - /* - * Returns an effect descriptor during effect - * enumeration. - * - * Parameters: - * index: index of the queried effect. - * descriptor: address where the effect descriptor should be returned. - * - * Returned status (from utils/Errors.h) can be: - * NO_ERROR successful operation. - * PERMISSION_DENIED could not get AudioFlinger interface - * NO_INIT effect library failed to initialize - * BAD_VALUE invalid descriptor pointer or index - * INVALID_OPERATION effect list has changed since last execution of queryNumberEffects() - * - * Returned value - * *descriptor: updated with effect descriptor - */ - static status_t queryEffect(uint32_t index, effect_descriptor_t *descriptor); - - - /* - * Returns the descriptor for the specified effect uuid. - * - * Parameters: - * uuid: pointer to effect uuid. - * descriptor: address where the effect descriptor should be returned. - * - * Returned status (from utils/Errors.h) can be: - * NO_ERROR successful operation. - * PERMISSION_DENIED could not get AudioFlinger interface - * NO_INIT effect library failed to initialize - * BAD_VALUE invalid uuid or descriptor pointers - * NAME_NOT_FOUND no effect with this uuid found - * - * Returned value - * *descriptor updated with effect descriptor - */ - static status_t getEffectDescriptor(effect_uuid_t *uuid, effect_descriptor_t *descriptor); - - - /* - * Returns a list of descriptors corresponding to the pre processings enabled by default - * on an AudioRecord with the supplied audio session ID. - * - * Parameters: - * audioSession: audio session ID. - * descriptors: address where the effect descriptors should be returned. - * count: as input, the maximum number of descriptor than should be returned - * as output, the number of descriptor returned if status is NO_ERROR or the actual - * number of enabled pre processings if status is NO_MEMORY - * - * Returned status (from utils/Errors.h) can be: - * NO_ERROR successful operation. - * NO_MEMORY the number of descriptor to return is more than the maximum number - * indicated by count. - * PERMISSION_DENIED could not get AudioFlinger interface - * NO_INIT effect library failed to initialize - * BAD_VALUE invalid audio session or descriptor pointers - * - * Returned value - * *descriptor updated with descriptors of pre processings enabled by default - * *count number of descriptors returned if returned status is N_ERROR. - * total number of pre processing enabled by default if returned status is - * NO_MEMORY. This happens if the count passed as input is less than the number - * of descriptors to return - */ - static status_t queryDefaultPreProcessing(int audioSession, - effect_descriptor_t *descriptors, - uint32_t *count); - - /* - * Events used by callback function (effect_callback_t). - */ - enum event_type { - EVENT_CONTROL_STATUS_CHANGED = 0, - EVENT_ENABLE_STATUS_CHANGED = 1, - EVENT_PARAMETER_CHANGED = 2, - EVENT_ERROR = 3 - }; - - /* Callback function notifying client application of a change in effect engine state or - * configuration. - * An effect engine can be shared by several applications but only one has the control - * of the engine activity and configuration at a time. - * The EVENT_CONTROL_STATUS_CHANGED event is received when an application loses or - * retrieves the control of the effect engine. Loss of control happens - * if another application requests the use of the engine by creating an AudioEffect for - * the same effect type but with a higher priority. Control is returned when the - * application having the control deletes its AudioEffect object. - * The EVENT_ENABLE_STATUS_CHANGED event is received by all applications not having the - * control of the effect engine when the effect is enabled or disabled. - * The EVENT_PARAMETER_CHANGED event is received by all applications not having the - * control of the effect engine when an effect parameter is changed. - * The EVENT_ERROR event is received when the media server process dies. - * - * Parameters: - * - * event: type of event notified (see enum AudioEffect::event_type). - * user: Pointer to context for use by the callback receiver. - * info: Pointer to optional parameter according to event type: - * - EVENT_CONTROL_STATUS_CHANGED: boolean indicating if control is granted (true) - * or stolen (false). - * - EVENT_ENABLE_STATUS_CHANGED: boolean indicating if effect is now enabled (true) - * or disabled (false). - * - EVENT_PARAMETER_CHANGED: pointer to a effect_param_t structure. - * - EVENT_ERROR: status_t indicating the error (DEAD_OBJECT when media server dies). - */ - - typedef void (*effect_callback_t)(int32_t event, void* user, void *info); - - - /* Constructor. - * AudioEffect is the base class for creating and controlling an effect engine from - * the application process. Creating an AudioEffect object will create the effect engine - * in the AudioFlinger if no engine of the specified type exists. If one exists, this engine - * will be used. The application creating the AudioEffect object (or a derived class like - * Reverb for instance) will either receive control of the effect engine or not, depending - * on the priority parameter. If priority is higher than the priority used by the current - * effect engine owner, the control will be transfered to the new application. Otherwise - * control will remain to the previous application. In this case, the new application will be - * notified of changes in effect engine state or control ownership by the effect callback. - * After creating the AudioEffect, the application must call the initCheck() method and - * check the creation status before trying to control the effect engine (see initCheck()). - * If the effect is to be applied to an AudioTrack or MediaPlayer only the application - * must specify the audio session ID corresponding to this player. - */ - - /* Simple Constructor. - */ - AudioEffect(); - - - /* Constructor. - * - * Parameters: - * - * type: type of effect created: can be null if uuid is specified. This corresponds to - * the OpenSL ES interface implemented by this effect. - * uuid: Uuid of effect created: can be null if type is specified. This uuid corresponds to - * a particular implementation of an effect type. - * priority: requested priority for effect control: the priority level corresponds to the - * value of priority parameter: negative values indicate lower priorities, positive values - * higher priorities, 0 being the normal priority. - * cbf: optional callback function (see effect_callback_t) - * user: pointer to context for use by the callback receiver. - * sessionID: audio session this effect is associated to. If 0, the effect will be global to - * the output mix. If not 0, the effect will be applied to all players - * (AudioTrack or MediaPLayer) within the same audio session. - * io: HAL audio output or input stream to which this effect must be attached. Leave at 0 for - * automatic output selection by AudioFlinger. - */ - - AudioEffect(const effect_uuid_t *type, - const effect_uuid_t *uuid = NULL, - int32_t priority = 0, - effect_callback_t cbf = 0, - void* user = 0, - int sessionId = 0, - audio_io_handle_t io = 0 - ); - - /* Constructor. - * Same as above but with type and uuid specified by character strings - */ - AudioEffect(const char *typeStr, - const char *uuidStr = NULL, - int32_t priority = 0, - effect_callback_t cbf = 0, - void* user = 0, - int sessionId = 0, - audio_io_handle_t io = 0 - ); - - /* Terminates the AudioEffect and unregisters it from AudioFlinger. - * The effect engine is also destroyed if this AudioEffect was the last controlling - * the engine. - */ - ~AudioEffect(); - - /* Initialize an uninitialized AudioEffect. - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR or ALREADY_EXISTS: successful initialization - * - INVALID_OPERATION: AudioEffect is already initialized - * - BAD_VALUE: invalid parameter - * - NO_INIT: audio flinger or audio hardware not initialized - * */ - status_t set(const effect_uuid_t *type, - const effect_uuid_t *uuid = NULL, - int32_t priority = 0, - effect_callback_t cbf = 0, - void* user = 0, - int sessionId = 0, - audio_io_handle_t io = 0 - ); - - /* Result of constructing the AudioEffect. This must be checked - * before using any AudioEffect API. - * initCheck() can return: - * - NO_ERROR: the effect engine is successfully created and the application has control. - * - ALREADY_EXISTS: the effect engine is successfully created but the application does not - * have control. - * - NO_INIT: the effect creation failed. - * - */ - status_t initCheck() const; - - - /* Returns the unique effect Id for the controlled effect engine. This ID is unique - * system wide and is used for instance in the case of auxiliary effects to attach - * the effect to an AudioTrack or MediaPlayer. - * - */ - int32_t id() const { return mId; } - - /* Returns a descriptor for the effect (see effect_descriptor_t in audio_effect.h). - */ - effect_descriptor_t descriptor() const; - - /* Returns effect control priority of this AudioEffect object. - */ - int32_t priority() const { return mPriority; } - - - /* Enables or disables the effect engine. - * - * Parameters: - * enabled: requested enable state. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the application does not have control of the effect engine or the - * effect is already in the requested state. - */ - virtual status_t setEnabled(bool enabled); - bool getEnabled() const; - - /* Sets a parameter value. - * - * Parameters: - * param: pointer to effect_param_t structure containing the parameter - * and its value (See audio_effect.h). - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation. - * - INVALID_OPERATION: the application does not have control of the effect engine. - * - BAD_VALUE: invalid parameter identifier or value. - * - DEAD_OBJECT: the effect engine has been deleted. - */ - virtual status_t setParameter(effect_param_t *param); - - /* Prepare a new parameter value that will be set by next call to - * setParameterCommit(). This method can be used to set multiple parameters - * in a synchronous manner or to avoid multiple binder calls for each - * parameter. - * - * Parameters: - * param: pointer to effect_param_t structure containing the parameter - * and its value (See audio_effect.h). - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation. - * - INVALID_OPERATION: the application does not have control of the effect engine. - * - NO_MEMORY: no more space available in shared memory used for deferred parameter - * setting. - */ - virtual status_t setParameterDeferred(effect_param_t *param); - - /* Commit all parameter values previously prepared by setParameterDeferred(). - * - * Parameters: - * none - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation. - * - INVALID_OPERATION: No new parameter values ready for commit. - * - BAD_VALUE: invalid parameter identifier or value: there is no indication - * as to which of the parameters caused this error. - * - DEAD_OBJECT: the effect engine has been deleted. - */ - virtual status_t setParameterCommit(); - - /* Gets a parameter value. - * - * Parameters: - * param: pointer to effect_param_t structure containing the parameter - * and the returned value (See audio_effect.h). - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation. - * - INVALID_OPERATION: the AudioEffect was not successfully initialized. - * - BAD_VALUE: invalid parameter identifier. - * - DEAD_OBJECT: the effect engine has been deleted. - */ - virtual status_t getParameter(effect_param_t *param); - - /* Sends a command and receives a response to/from effect engine. - * See audio_effect.h for details on effect command() function, valid command codes - * and formats. - */ - virtual status_t command(uint32_t cmdCode, - uint32_t cmdSize, - void *cmdData, - uint32_t *replySize, - void *replyData); - - - /* - * Utility functions. - */ - - /* Converts the string passed as first argument to the effect_uuid_t - * pointed to by second argument - */ - static status_t stringToGuid(const char *str, effect_uuid_t *guid); - /* Converts the effect_uuid_t pointed to by first argument to the - * string passed as second argument - */ - static status_t guidToString(const effect_uuid_t *guid, char *str, size_t maxLen); - -protected: - bool mEnabled; // enable state - int32_t mSessionId; // audio session ID - int32_t mPriority; // priority for effect control - status_t mStatus; // effect status - effect_callback_t mCbf; // callback function for status, control and - // parameter changes notifications - void* mUserData; // client context for callback function - effect_descriptor_t mDescriptor; // effect descriptor - int32_t mId; // system wide unique effect engine instance ID - Mutex mLock; // Mutex for mEnabled access - -private: - - // Implements the IEffectClient interface - class EffectClient : public android::BnEffectClient, public android::IBinder::DeathRecipient - { - public: - - EffectClient(AudioEffect *effect) : mEffect(effect){} - - // IEffectClient - virtual void controlStatusChanged(bool controlGranted) { - mEffect->controlStatusChanged(controlGranted); - } - virtual void enableStatusChanged(bool enabled) { - mEffect->enableStatusChanged(enabled); - } - virtual void commandExecuted(uint32_t cmdCode, - uint32_t cmdSize, - void *pCmdData, - uint32_t replySize, - void *pReplyData) { - mEffect->commandExecuted(cmdCode, cmdSize, pCmdData, replySize, pReplyData); - } - - // IBinder::DeathRecipient - virtual void binderDied(const wp& who) {mEffect->binderDied();} - - private: - AudioEffect *mEffect; - }; - - - friend class EffectClient; - - // IEffectClient - void controlStatusChanged(bool controlGranted); - void enableStatusChanged(bool enabled); - void commandExecuted(uint32_t cmdCode, - uint32_t cmdSize, - void *pCmdData, - uint32_t replySize, - void *pReplyData); - void binderDied(); - - - sp mIEffect; // IEffect binder interface - sp mIEffectClient; // IEffectClient implementation - sp mCblkMemory; // shared memory for deferred parameter setting - effect_param_cblk_t* mCblk; // control block for deferred parameter setting -}; - - -}; // namespace android - -#endif // ANDROID_AUDIOEFFECT_H diff --git a/external/android/include/14/frameworks/base/include/media/AudioParameter.h b/external/android/include/14/frameworks/base/include/media/AudioParameter.h deleted file mode 100644 index 79d5d82..0000000 --- a/external/android/include/14/frameworks/base/include/media/AudioParameter.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2008-2011 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_AUDIOPARAMETER_H_ -#define ANDROID_AUDIOPARAMETER_H_ - -#include -#include -#include - -namespace android { - -class AudioParameter { - -public: - AudioParameter() {} - AudioParameter(const String8& keyValuePairs); - virtual ~AudioParameter(); - - // reserved parameter keys for changing standard parameters with setParameters() function. - // Using these keys is mandatory for AudioFlinger to properly monitor audio output/input - // configuration changes and act accordingly. - // keyRouting: to change audio routing, value is an int in audio_devices_t - // keySamplingRate: to change sampling rate routing, value is an int - // keyFormat: to change audio format, value is an int in audio_format_t - // keyChannels: to change audio channel configuration, value is an int in audio_channels_t - // keyFrameCount: to change audio output frame count, value is an int - // keyInputSource: to change audio input source, value is an int in audio_source_t - // (defined in media/mediarecorder.h) - static const char *keyRouting; - static const char *keySamplingRate; - static const char *keyFormat; - static const char *keyChannels; - static const char *keyFrameCount; - static const char *keyInputSource; - - String8 toString(); - - status_t add(const String8& key, const String8& value); - status_t addInt(const String8& key, const int value); - status_t addFloat(const String8& key, const float value); - - status_t remove(const String8& key); - - status_t get(const String8& key, String8& value); - status_t getInt(const String8& key, int& value); - status_t getFloat(const String8& key, float& value); - status_t getAt(size_t index, String8& key, String8& value); - - size_t size() { return mParameters.size(); } - -private: - String8 mKeyValuePairs; - KeyedVector mParameters; -}; - -}; // namespace android - -#endif /*ANDROID_AUDIOPARAMETER_H_*/ diff --git a/external/android/include/14/frameworks/base/include/media/AudioRecord.h b/external/android/include/14/frameworks/base/include/media/AudioRecord.h deleted file mode 100644 index 605680a..0000000 --- a/external/android/include/14/frameworks/base/include/media/AudioRecord.h +++ /dev/null @@ -1,392 +0,0 @@ -/* - * 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. - */ - -#ifndef AUDIORECORD_H_ -#define AUDIORECORD_H_ - -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class AudioRecord -{ -public: - - static const int DEFAULT_SAMPLE_RATE = 8000; - - /* Events used by AudioRecord callback function (callback_t). - * - * to keep in sync with frameworks/base/media/java/android/media/AudioRecord.java - */ - enum event_type { - EVENT_MORE_DATA = 0, // Request to reqd more data from PCM buffer. - EVENT_OVERRUN = 1, // PCM buffer overrun occured. - EVENT_MARKER = 2, // Record head is at the specified marker position - // (See setMarkerPosition()). - EVENT_NEW_POS = 3, // Record head is at a new position - // (See setPositionUpdatePeriod()). - }; - - /* Create Buffer on the stack and pass it to obtainBuffer() - * and releaseBuffer(). - */ - - class Buffer - { - public: - enum { - MUTE = 0x00000001 - }; - uint32_t flags; - int channelCount; - int format; - size_t frameCount; - size_t size; - union { - void* raw; - short* i16; - int8_t* i8; - }; - }; - - /* These are static methods to control the system-wide AudioFlinger - * only privileged processes can have access to them - */ - -// static status_t setMasterMute(bool mute); - - /* As a convenience, if a callback is supplied, a handler thread - * is automatically created with the appropriate priority. This thread - * invokes the callback when a new buffer becomes ready or an overrun condition occurs. - * Parameters: - * - * event: type of event notified (see enum AudioRecord::event_type). - * user: Pointer to context for use by the callback receiver. - * info: Pointer to optional parameter according to event type: - * - EVENT_MORE_DATA: pointer to AudioRecord::Buffer struct. The callback must not read - * more bytes than indicated by 'size' field and update 'size' if less bytes are - * read. - * - EVENT_OVERRUN: unused. - * - EVENT_MARKER: pointer to an uin32_t containing the marker position in frames. - * - EVENT_NEW_POS: pointer to an uin32_t containing the new position in frames. - */ - - typedef void (*callback_t)(int event, void* user, void *info); - - /* Returns the minimum frame count required for the successful creation of - * an AudioRecord object. - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - NO_INIT: audio server or audio hardware not initialized - * - BAD_VALUE: unsupported configuration - */ - - static status_t getMinFrameCount(int* frameCount, - uint32_t sampleRate, - int format, - int channelCount); - - /* Constructs an uninitialized AudioRecord. No connection with - * AudioFlinger takes place. - */ - AudioRecord(); - - /* Creates an AudioRecord track and registers it with AudioFlinger. - * Once created, the track needs to be started before it can be used. - * Unspecified values are set to the audio hardware's current - * values. - * - * Parameters: - * - * inputSource: Select the audio input to record to (e.g. AUDIO_SOURCE_DEFAULT). - * sampleRate: Track sampling rate in Hz. - * format: Audio format (e.g AUDIO_FORMAT_PCM_16_BIT for signed - * 16 bits per sample). - * channelMask: Channel mask: see audio_channels_t. - * frameCount: Total size of track PCM buffer in frames. This defines the - * latency of the track. - * flags: A bitmask of acoustic values from enum record_flags. It enables - * AGC, NS, and IIR. - * cbf: Callback function. If not null, this function is called periodically - * to provide new PCM data. - * notificationFrames: The callback function is called each time notificationFrames PCM - * frames are ready in record track output buffer. - * user Context for use by the callback receiver. - */ - - enum record_flags { - RECORD_AGC_ENABLE = AUDIO_IN_ACOUSTICS_AGC_ENABLE, - RECORD_NS_ENABLE = AUDIO_IN_ACOUSTICS_NS_ENABLE, - RECORD_IIR_ENABLE = AUDIO_IN_ACOUSTICS_TX_IIR_ENABLE, - }; - - AudioRecord(int inputSource, - uint32_t sampleRate = 0, - int format = 0, - uint32_t channelMask = AUDIO_CHANNEL_IN_MONO, - int frameCount = 0, - uint32_t flags = 0, - callback_t cbf = 0, - void* user = 0, - int notificationFrames = 0, - int sessionId = 0); - - - /* Terminates the AudioRecord and unregisters it from AudioFlinger. - * Also destroys all resources assotiated with the AudioRecord. - */ - ~AudioRecord(); - - - /* Initialize an uninitialized AudioRecord. - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful intialization - * - INVALID_OPERATION: AudioRecord is already intitialized or record device is already in use - * - BAD_VALUE: invalid parameter (channels, format, sampleRate...) - * - NO_INIT: audio server or audio hardware not initialized - * - PERMISSION_DENIED: recording is not allowed for the requesting process - * */ - status_t set(int inputSource = 0, - uint32_t sampleRate = 0, - int format = 0, - uint32_t channelMask = AUDIO_CHANNEL_IN_MONO, - int frameCount = 0, - uint32_t flags = 0, - callback_t cbf = 0, - void* user = 0, - int notificationFrames = 0, - bool threadCanCallJava = false, - int sessionId = 0); - - - /* Result of constructing the AudioRecord. This must be checked - * before using any AudioRecord API (except for set()), using - * an uninitialized AudioRecord produces undefined results. - * See set() method above for possible return codes. - */ - status_t initCheck() const; - - /* Returns this track's latency in milliseconds. - * This includes the latency due to AudioRecord buffer size - * and audio hardware driver. - */ - uint32_t latency() const; - - /* getters, see constructor */ - - int format() const; - int channelCount() const; - int channels() const; - uint32_t frameCount() const; - int frameSize() const; - int inputSource() const; - - - /* After it's created the track is not active. Call start() to - * make it active. If set, the callback will start being called. - */ - status_t start(); - - /* Stop a track. If set, the callback will cease being called and - * obtainBuffer returns STOPPED. Note that obtainBuffer() still works - * and will fill up buffers until the pool is exhausted. - */ - status_t stop(); - bool stopped() const; - - /* get sample rate for this record track - */ - uint32_t getSampleRate(); - - /* Sets marker position. When record reaches the number of frames specified, - * a callback with event type EVENT_MARKER is called. Calling setMarkerPosition - * with marker == 0 cancels marker notification callback. - * If the AudioRecord has been opened with no callback function associated, - * the operation will fail. - * - * Parameters: - * - * marker: marker position expressed in frames. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the AudioRecord has no callback installed. - */ - status_t setMarkerPosition(uint32_t marker); - status_t getMarkerPosition(uint32_t *marker); - - - /* Sets position update period. Every time the number of frames specified has been recorded, - * a callback with event type EVENT_NEW_POS is called. - * Calling setPositionUpdatePeriod with updatePeriod == 0 cancels new position notification - * callback. - * If the AudioRecord has been opened with no callback function associated, - * the operation will fail. - * - * Parameters: - * - * updatePeriod: position update notification period expressed in frames. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the AudioRecord has no callback installed. - */ - status_t setPositionUpdatePeriod(uint32_t updatePeriod); - status_t getPositionUpdatePeriod(uint32_t *updatePeriod); - - - /* Gets record head position. The position is the total number of frames - * recorded since record start. - * - * Parameters: - * - * position: Address where to return record head position within AudioRecord buffer. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - BAD_VALUE: position is NULL - */ - status_t getPosition(uint32_t *position); - - /* returns a handle on the audio input used by this AudioRecord. - * - * Parameters: - * none. - * - * Returned value: - * handle on audio hardware input - */ - audio_io_handle_t getInput(); - - /* returns the audio session ID associated to this AudioRecord. - * - * Parameters: - * none. - * - * Returned value: - * AudioRecord session ID. - */ - int getSessionId(); - - /* obtains a buffer of "frameCount" frames. The buffer must be - * filled entirely. If the track is stopped, obtainBuffer() returns - * STOPPED instead of NO_ERROR as long as there are buffers availlable, - * at which point NO_MORE_BUFFERS is returned. - * Buffers will be returned until the pool (buffercount()) - * is exhausted, at which point obtainBuffer() will either block - * or return WOULD_BLOCK depending on the value of the "blocking" - * parameter. - */ - - enum { - NO_MORE_BUFFERS = 0x80000001, - STOPPED = 1 - }; - - status_t obtainBuffer(Buffer* audioBuffer, int32_t waitCount); - void releaseBuffer(Buffer* audioBuffer); - - - /* As a convenience we provide a read() interface to the audio buffer. - * This is implemented on top of lockBuffer/unlockBuffer. - */ - ssize_t read(void* buffer, size_t size); - - /* Return the amount of input frames lost in the audio driver since the last call of this function. - * Audio driver is expected to reset the value to 0 and restart counting upon returning the current value by this function call. - * Such loss typically occurs when the user space process is blocked longer than the capacity of audio driver buffers. - * Unit: the number of input audio frames - */ - unsigned int getInputFramesLost(); - -private: - /* copying audio tracks is not allowed */ - AudioRecord(const AudioRecord& other); - AudioRecord& operator = (const AudioRecord& other); - - /* a small internal class to handle the callback */ - class ClientRecordThread : public Thread - { - public: - ClientRecordThread(AudioRecord& receiver, bool bCanCallJava = false); - private: - friend class AudioRecord; - virtual bool threadLoop(); - virtual status_t readyToRun() { return NO_ERROR; } - virtual void onFirstRef() {} - AudioRecord& mReceiver; - Mutex mLock; - }; - - bool processAudioBuffer(const sp& thread); - status_t openRecord_l(uint32_t sampleRate, - uint32_t format, - uint32_t channelMask, - int frameCount, - uint32_t flags, - audio_io_handle_t input); - audio_io_handle_t getInput_l(); - status_t restoreRecord_l(audio_track_cblk_t*& cblk); - - sp mAudioRecord; - sp mCblkMemory; - sp mClientRecordThread; - Mutex mLock; - - uint32_t mFrameCount; - - audio_track_cblk_t* mCblk; - uint32_t mFormat; - uint8_t mChannelCount; - uint8_t mInputSource; - uint8_t mReserved[2]; - status_t mStatus; - uint32_t mLatency; - - volatile int32_t mActive; - - callback_t mCbf; - void* mUserData; - uint32_t mNotificationFrames; - uint32_t mRemainingFrames; - uint32_t mMarkerPosition; - bool mMarkerReached; - uint32_t mNewPosition; - uint32_t mUpdatePeriod; - uint32_t mFlags; - uint32_t mChannelMask; - audio_io_handle_t mInput; - int mSessionId; -}; - -}; // namespace android - -#endif /*AUDIORECORD_H_*/ diff --git a/external/android/include/14/frameworks/base/include/media/AudioSystem.h b/external/android/include/14/frameworks/base/include/media/AudioSystem.h deleted file mode 100644 index 6a15f6e..0000000 --- a/external/android/include/14/frameworks/base/include/media/AudioSystem.h +++ /dev/null @@ -1,250 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_AUDIOSYSTEM_H_ -#define ANDROID_AUDIOSYSTEM_H_ - -#include -#include -#include - -#include -#include - -/* XXX: Should be include by all the users instead */ -#include - -namespace android { - -typedef void (*audio_error_callback)(status_t err); - -class IAudioPolicyService; -class String8; - -class AudioSystem -{ -public: - - /* These are static methods to control the system-wide AudioFlinger - * only privileged processes can have access to them - */ - - // mute/unmute microphone - static status_t muteMicrophone(bool state); - static status_t isMicrophoneMuted(bool *state); - - // set/get master volume - static status_t setMasterVolume(float value); - static status_t getMasterVolume(float* volume); - - // mute/unmute audio outputs - static status_t setMasterMute(bool mute); - static status_t getMasterMute(bool* mute); - - // set/get stream volume on specified output - static status_t setStreamVolume(int stream, float value, int output); - static status_t getStreamVolume(int stream, float* volume, int output); - - // mute/unmute stream - static status_t setStreamMute(int stream, bool mute); - static status_t getStreamMute(int stream, bool* mute); - - // set audio mode in audio hardware (see audio_mode_t) - static status_t setMode(int mode); - - // returns true in *state if tracks are active on the specified stream or has been active - // in the past inPastMs milliseconds - static status_t isStreamActive(int stream, bool *state, uint32_t inPastMs = 0); - - // set/get audio hardware parameters. The function accepts a list of parameters - // key value pairs in the form: key1=value1;key2=value2;... - // Some keys are reserved for standard parameters (See AudioParameter class). - static status_t setParameters(audio_io_handle_t ioHandle, const String8& keyValuePairs); - static String8 getParameters(audio_io_handle_t ioHandle, const String8& keys); - - static void setErrorCallback(audio_error_callback cb); - - // helper function to obtain AudioFlinger service handle - static const sp& get_audio_flinger(); - - static float linearToLog(int volume); - static int logToLinear(float volume); - - static status_t getOutputSamplingRate(int* samplingRate, int stream = AUDIO_STREAM_DEFAULT); - static status_t getOutputFrameCount(int* frameCount, int stream = AUDIO_STREAM_DEFAULT); - static status_t getOutputLatency(uint32_t* latency, int stream = AUDIO_STREAM_DEFAULT); - - static bool routedToA2dpOutput(int streamType); - - static status_t getInputBufferSize(uint32_t sampleRate, int format, int channelCount, - size_t* buffSize); - - static status_t setVoiceVolume(float volume); - - // return the number of audio frames written by AudioFlinger to audio HAL and - // audio dsp to DAC since the output on which the specified stream is playing - // has exited standby. - // returned status (from utils/Errors.h) can be: - // - NO_ERROR: successful operation, halFrames and dspFrames point to valid data - // - INVALID_OPERATION: Not supported on current hardware platform - // - BAD_VALUE: invalid parameter - // NOTE: this feature is not supported on all hardware platforms and it is - // necessary to check returned status before using the returned values. - static status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, int stream = AUDIO_STREAM_DEFAULT); - - static unsigned int getInputFramesLost(audio_io_handle_t ioHandle); - - static int newAudioSessionId(); - static void acquireAudioSessionId(int audioSession); - static void releaseAudioSessionId(int audioSession); - - // types of io configuration change events received with ioConfigChanged() - enum io_config_event { - OUTPUT_OPENED, - OUTPUT_CLOSED, - OUTPUT_CONFIG_CHANGED, - INPUT_OPENED, - INPUT_CLOSED, - INPUT_CONFIG_CHANGED, - STREAM_CONFIG_CHANGED, - NUM_CONFIG_EVENTS - }; - - // audio output descritor used to cache output configurations in client process to avoid frequent calls - // through IAudioFlinger - class OutputDescriptor { - public: - OutputDescriptor() - : samplingRate(0), format(0), channels(0), frameCount(0), latency(0) {} - - uint32_t samplingRate; - int32_t format; - int32_t channels; - size_t frameCount; - uint32_t latency; - }; - - // - // IAudioPolicyService interface (see AudioPolicyInterface for method descriptions) - // - static status_t setDeviceConnectionState(audio_devices_t device, audio_policy_dev_state_t state, const char *device_address); - static audio_policy_dev_state_t getDeviceConnectionState(audio_devices_t device, const char *device_address); - static status_t setPhoneState(int state); - static status_t setRingerMode(uint32_t mode, uint32_t mask); - static status_t setForceUse(audio_policy_force_use_t usage, audio_policy_forced_cfg_t config); - static audio_policy_forced_cfg_t getForceUse(audio_policy_force_use_t usage); - static audio_io_handle_t getOutput(audio_stream_type_t stream, - uint32_t samplingRate = 0, - uint32_t format = AUDIO_FORMAT_DEFAULT, - uint32_t channels = AUDIO_CHANNEL_OUT_STEREO, - audio_policy_output_flags_t flags = AUDIO_POLICY_OUTPUT_FLAG_INDIRECT); - static status_t startOutput(audio_io_handle_t output, - audio_stream_type_t stream, - int session = 0); - static status_t stopOutput(audio_io_handle_t output, - audio_stream_type_t stream, - int session = 0); - static void releaseOutput(audio_io_handle_t output); - static audio_io_handle_t getInput(int inputSource, - uint32_t samplingRate = 0, - uint32_t format = AUDIO_FORMAT_DEFAULT, - uint32_t channels = AUDIO_CHANNEL_IN_MONO, - audio_in_acoustics_t acoustics = (audio_in_acoustics_t)0, - int sessionId = 0); - static status_t startInput(audio_io_handle_t input); - static status_t stopInput(audio_io_handle_t input); - static void releaseInput(audio_io_handle_t input); - static status_t initStreamVolume(audio_stream_type_t stream, - int indexMin, - int indexMax); - static status_t setStreamVolumeIndex(audio_stream_type_t stream, int index); - static status_t getStreamVolumeIndex(audio_stream_type_t stream, int *index); - - static uint32_t getStrategyForStream(audio_stream_type_t stream); - static uint32_t getDevicesForStream(audio_stream_type_t stream); - - static audio_io_handle_t getOutputForEffect(effect_descriptor_t *desc); - static status_t registerEffect(effect_descriptor_t *desc, - audio_io_handle_t io, - uint32_t strategy, - int session, - int id); - static status_t unregisterEffect(int id); - static status_t setEffectEnabled(int id, bool enabled); - - // clear stream to output mapping cache (gStreamOutputMap) - // and output configuration cache (gOutputs) - static void clearAudioConfigCache(); - - static const sp& get_audio_policy_service(); - - // ---------------------------------------------------------------------------- - -private: - - class AudioFlingerClient: public IBinder::DeathRecipient, public BnAudioFlingerClient - { - public: - AudioFlingerClient() { - } - - // DeathRecipient - virtual void binderDied(const wp& who); - - // IAudioFlingerClient - - // indicate a change in the configuration of an output or input: keeps the cached - // values for output/input parameters upto date in client process - virtual void ioConfigChanged(int event, int ioHandle, void *param2); - }; - - class AudioPolicyServiceClient: public IBinder::DeathRecipient - { - public: - AudioPolicyServiceClient() { - } - - // DeathRecipient - virtual void binderDied(const wp& who); - }; - - static sp gAudioFlingerClient; - static sp gAudioPolicyServiceClient; - friend class AudioFlingerClient; - friend class AudioPolicyServiceClient; - - static Mutex gLock; - static sp gAudioFlinger; - static audio_error_callback gAudioErrorCallback; - - static size_t gInBuffSize; - // previous parameters for recording buffer size queries - static uint32_t gPrevInSamplingRate; - static int gPrevInFormat; - static int gPrevInChannelCount; - - static sp gAudioPolicyService; - - // mapping between stream types and outputs - static DefaultKeyedVector gStreamOutputMap; - // list of output descriptors containing cached parameters - // (sampling rate, framecount, channel count...) - static DefaultKeyedVector gOutputs; -}; - -}; // namespace android - -#endif /*ANDROID_AUDIOSYSTEM_H_*/ diff --git a/external/android/include/14/frameworks/base/include/media/AudioTrack.h b/external/android/include/14/frameworks/base/include/media/AudioTrack.h deleted file mode 100644 index d1a8105..0000000 --- a/external/android/include/14/frameworks/base/include/media/AudioTrack.h +++ /dev/null @@ -1,495 +0,0 @@ -/* - * 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_AUDIOTRACK_H -#define ANDROID_AUDIOTRACK_H - -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class audio_track_cblk_t; - -// ---------------------------------------------------------------------------- - -class AudioTrack -{ -public: - enum channel_index { - MONO = 0, - LEFT = 0, - RIGHT = 1 - }; - - /* Events used by AudioTrack callback function (audio_track_cblk_t). - */ - enum event_type { - EVENT_MORE_DATA = 0, // Request to write more data to PCM buffer. - EVENT_UNDERRUN = 1, // PCM buffer underrun occured. - EVENT_LOOP_END = 2, // Sample loop end was reached; playback restarted from loop start if loop count was not 0. - EVENT_MARKER = 3, // Playback head is at the specified marker position (See setMarkerPosition()). - EVENT_NEW_POS = 4, // Playback head is at a new position (See setPositionUpdatePeriod()). - EVENT_BUFFER_END = 5 // Playback head is at the end of the buffer. - }; - - /* Create Buffer on the stack and pass it to obtainBuffer() - * and releaseBuffer(). - */ - - class Buffer - { - public: - enum { - MUTE = 0x00000001 - }; - uint32_t flags; - int format; - int channelCount; // will be removed in the future, do not use - size_t frameCount; - size_t size; - union { - void* raw; - short* i16; - int8_t* i8; - }; - }; - - - /* As a convenience, if a callback is supplied, a handler thread - * is automatically created with the appropriate priority. This thread - * invokes the callback when a new buffer becomes availlable or an underrun condition occurs. - * Parameters: - * - * event: type of event notified (see enum AudioTrack::event_type). - * user: Pointer to context for use by the callback receiver. - * info: Pointer to optional parameter according to event type: - * - EVENT_MORE_DATA: pointer to AudioTrack::Buffer struct. The callback must not write - * more bytes than indicated by 'size' field and update 'size' if less bytes are - * written. - * - EVENT_UNDERRUN: unused. - * - EVENT_LOOP_END: pointer to an int indicating the number of loops remaining. - * - EVENT_MARKER: pointer to an uin32_t containing the marker position in frames. - * - EVENT_NEW_POS: pointer to an uin32_t containing the new position in frames. - * - EVENT_BUFFER_END: unused. - */ - - typedef void (*callback_t)(int event, void* user, void *info); - - /* Returns the minimum frame count required for the successful creation of - * an AudioTrack object. - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - NO_INIT: audio server or audio hardware not initialized - */ - - static status_t getMinFrameCount(int* frameCount, - int streamType =-1, - uint32_t sampleRate = 0); - - /* Constructs an uninitialized AudioTrack. No connection with - * AudioFlinger takes place. - */ - AudioTrack(); - - /* Creates an audio track and registers it with AudioFlinger. - * Once created, the track needs to be started before it can be used. - * Unspecified values are set to the audio hardware's current - * values. - * - * Parameters: - * - * streamType: Select the type of audio stream this track is attached to - * (e.g. AUDIO_STREAM_MUSIC). - * sampleRate: Track sampling rate in Hz. - * format: Audio format (e.g AUDIO_FORMAT_PCM_16_BIT for signed - * 16 bits per sample). - * channelMask: Channel mask: see audio_channels_t. - * frameCount: Total size of track PCM buffer in frames. This defines the - * latency of the track. - * flags: Reserved for future use. - * cbf: Callback function. If not null, this function is called periodically - * to request new PCM data. - * notificationFrames: The callback function is called each time notificationFrames PCM - * frames have been comsumed from track input buffer. - * user Context for use by the callback receiver. - */ - - AudioTrack( int streamType, - uint32_t sampleRate = 0, - int format = 0, - int channelMask = 0, - int frameCount = 0, - uint32_t flags = 0, - callback_t cbf = 0, - void* user = 0, - int notificationFrames = 0, - int sessionId = 0); - - /* Creates an audio track and registers it with AudioFlinger. With this constructor, - * The PCM data to be rendered by AudioTrack is passed in a shared memory buffer - * identified by the argument sharedBuffer. This prototype is for static buffer playback. - * PCM data must be present into memory before the AudioTrack is started. - * The Write() and Flush() methods are not supported in this case. - * It is recommented to pass a callback function to be notified of playback end by an - * EVENT_UNDERRUN event. - */ - - AudioTrack( int streamType, - uint32_t sampleRate = 0, - int format = 0, - int channelMask = 0, - const sp& sharedBuffer = 0, - uint32_t flags = 0, - callback_t cbf = 0, - void* user = 0, - int notificationFrames = 0, - int sessionId = 0); - - /* Terminates the AudioTrack and unregisters it from AudioFlinger. - * Also destroys all resources assotiated with the AudioTrack. - */ - ~AudioTrack(); - - - /* Initialize an uninitialized AudioTrack. - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful intialization - * - INVALID_OPERATION: AudioTrack is already intitialized - * - BAD_VALUE: invalid parameter (channels, format, sampleRate...) - * - NO_INIT: audio server or audio hardware not initialized - * */ - status_t set(int streamType =-1, - uint32_t sampleRate = 0, - int format = 0, - int channelMask = 0, - int frameCount = 0, - uint32_t flags = 0, - callback_t cbf = 0, - void* user = 0, - int notificationFrames = 0, - const sp& sharedBuffer = 0, - bool threadCanCallJava = false, - int sessionId = 0); - - - /* Result of constructing the AudioTrack. This must be checked - * before using any AudioTrack API (except for set()), using - * an uninitialized AudioTrack produces undefined results. - * See set() method above for possible return codes. - */ - status_t initCheck() const; - - /* Returns this track's latency in milliseconds. - * This includes the latency due to AudioTrack buffer size, AudioMixer (if any) - * and audio hardware driver. - */ - uint32_t latency() const; - - /* getters, see constructor */ - - int streamType() const; - int format() const; - int channelCount() const; - uint32_t frameCount() const; - int frameSize() const; - sp& sharedBuffer(); - - - /* After it's created the track is not active. Call start() to - * make it active. If set, the callback will start being called. - */ - void start(); - - /* Stop a track. If set, the callback will cease being called and - * obtainBuffer returns STOPPED. Note that obtainBuffer() still works - * and will fill up buffers until the pool is exhausted. - */ - void stop(); - bool stopped() const; - - /* flush a stopped track. All pending buffers are discarded. - * This function has no effect if the track is not stoped. - */ - void flush(); - - /* Pause a track. If set, the callback will cease being called and - * obtainBuffer returns STOPPED. Note that obtainBuffer() still works - * and will fill up buffers until the pool is exhausted. - */ - void pause(); - - /* mute or unmutes this track. - * While mutted, the callback, if set, is still called. - */ - void mute(bool); - bool muted() const; - - - /* set volume for this track, mostly used for games' sound effects - * left and right volumes. Levels must be <= 1.0. - */ - status_t setVolume(float left, float right); - void getVolume(float* left, float* right); - - /* set the send level for this track. An auxiliary effect should be attached - * to the track with attachEffect(). Level must be <= 1.0. - */ - status_t setAuxEffectSendLevel(float level); - void getAuxEffectSendLevel(float* level); - - /* set sample rate for this track, mostly used for games' sound effects - */ - status_t setSampleRate(int sampleRate); - uint32_t getSampleRate(); - - /* Enables looping and sets the start and end points of looping. - * - * Parameters: - * - * loopStart: loop start expressed as the number of PCM frames played since AudioTrack start. - * loopEnd: loop end expressed as the number of PCM frames played since AudioTrack start. - * loopCount: number of loops to execute. Calling setLoop() with loopCount == 0 cancels any pending or - * active loop. loopCount = -1 means infinite looping. - * - * For proper operation the following condition must be respected: - * (loopEnd-loopStart) <= framecount() - */ - status_t setLoop(uint32_t loopStart, uint32_t loopEnd, int loopCount); - status_t getLoop(uint32_t *loopStart, uint32_t *loopEnd, int *loopCount); - - - /* Sets marker position. When playback reaches the number of frames specified, a callback with event - * type EVENT_MARKER is called. Calling setMarkerPosition with marker == 0 cancels marker notification - * callback. - * If the AudioTrack has been opened with no callback function associated, the operation will fail. - * - * Parameters: - * - * marker: marker position expressed in frames. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the AudioTrack has no callback installed. - */ - status_t setMarkerPosition(uint32_t marker); - status_t getMarkerPosition(uint32_t *marker); - - - /* Sets position update period. Every time the number of frames specified has been played, - * a callback with event type EVENT_NEW_POS is called. - * Calling setPositionUpdatePeriod with updatePeriod == 0 cancels new position notification - * callback. - * If the AudioTrack has been opened with no callback function associated, the operation will fail. - * - * Parameters: - * - * updatePeriod: position update notification period expressed in frames. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the AudioTrack has no callback installed. - */ - status_t setPositionUpdatePeriod(uint32_t updatePeriod); - status_t getPositionUpdatePeriod(uint32_t *updatePeriod); - - - /* Sets playback head position within AudioTrack buffer. The new position is specified - * in number of frames. - * This method must be called with the AudioTrack in paused or stopped state. - * Note that the actual position set is modulo the AudioTrack buffer size in frames. - * Therefore using this method makes sense only when playing a "static" audio buffer - * as opposed to streaming. - * The getPosition() method on the other hand returns the total number of frames played since - * playback start. - * - * Parameters: - * - * position: New playback head position within AudioTrack buffer. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the AudioTrack is not stopped. - * - BAD_VALUE: The specified position is beyond the number of frames present in AudioTrack buffer - */ - status_t setPosition(uint32_t position); - status_t getPosition(uint32_t *position); - - /* Forces AudioTrack buffer full condition. When playing a static buffer, this method avoids - * rewriting the buffer before restarting playback after a stop. - * This method must be called with the AudioTrack in paused or stopped state. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the AudioTrack is not stopped. - */ - status_t reload(); - - /* returns a handle on the audio output used by this AudioTrack. - * - * Parameters: - * none. - * - * Returned value: - * handle on audio hardware output - */ - audio_io_handle_t getOutput(); - - /* returns the unique ID associated to this track. - * - * Parameters: - * none. - * - * Returned value: - * AudioTrack ID. - */ - int getSessionId(); - - - /* Attach track auxiliary output to specified effect. Used effectId = 0 - * to detach track from effect. - * - * Parameters: - * - * effectId: effectId obtained from AudioEffect::id(). - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the effect is not an auxiliary effect. - * - BAD_VALUE: The specified effect ID is invalid - */ - status_t attachAuxEffect(int effectId); - - /* obtains a buffer of "frameCount" frames. The buffer must be - * filled entirely. If the track is stopped, obtainBuffer() returns - * STOPPED instead of NO_ERROR as long as there are buffers availlable, - * at which point NO_MORE_BUFFERS is returned. - * Buffers will be returned until the pool (buffercount()) - * is exhausted, at which point obtainBuffer() will either block - * or return WOULD_BLOCK depending on the value of the "blocking" - * parameter. - */ - - enum { - NO_MORE_BUFFERS = 0x80000001, - STOPPED = 1 - }; - - status_t obtainBuffer(Buffer* audioBuffer, int32_t waitCount); - void releaseBuffer(Buffer* audioBuffer); - - - /* As a convenience we provide a write() interface to the audio buffer. - * This is implemented on top of lockBuffer/unlockBuffer. For best - * performance - * - */ - ssize_t write(const void* buffer, size_t size); - - /* - * Dumps the state of an audio track. - */ - status_t dump(int fd, const Vector& args) const; - -private: - /* copying audio tracks is not allowed */ - AudioTrack(const AudioTrack& other); - AudioTrack& operator = (const AudioTrack& other); - - /* a small internal class to handle the callback */ - class AudioTrackThread : public Thread - { - public: - AudioTrackThread(AudioTrack& receiver, bool bCanCallJava = false); - private: - friend class AudioTrack; - virtual bool threadLoop(); - virtual status_t readyToRun(); - virtual void onFirstRef(); - AudioTrack& mReceiver; - Mutex mLock; - }; - - bool processAudioBuffer(const sp& thread); - status_t createTrack_l(int streamType, - uint32_t sampleRate, - uint32_t format, - uint32_t channelMask, - int frameCount, - uint32_t flags, - const sp& sharedBuffer, - audio_io_handle_t output, - bool enforceFrameCount); - void flush_l(); - status_t setLoop_l(uint32_t loopStart, uint32_t loopEnd, int loopCount); - audio_io_handle_t getOutput_l(); - status_t restoreTrack_l(audio_track_cblk_t*& cblk, bool fromStart); - - sp mAudioTrack; - sp mCblkMemory; - sp mAudioTrackThread; - - float mVolume[2]; - float mSendLevel; - uint32_t mFrameCount; - - audio_track_cblk_t* mCblk; - uint32_t mFormat; - uint8_t mStreamType; - uint8_t mChannelCount; - uint8_t mMuted; - uint8_t mReserved; - uint32_t mChannelMask; - status_t mStatus; - uint32_t mLatency; - - volatile int32_t mActive; - - callback_t mCbf; - void* mUserData; - uint32_t mNotificationFramesReq; // requested number of frames between each notification callback - uint32_t mNotificationFramesAct; // actual number of frames between each notification callback - sp mSharedBuffer; - int mLoopCount; - uint32_t mRemainingFrames; - uint32_t mMarkerPosition; - bool mMarkerReached; - uint32_t mNewPosition; - uint32_t mUpdatePeriod; - bool mFlushed; // FIXME will be made obsolete by making flush() synchronous - uint32_t mFlags; - int mSessionId; - int mAuxEffectId; - Mutex mLock; - status_t mRestoreStatus; -}; - - -}; // namespace android - -#endif // ANDROID_AUDIOTRACK_H diff --git a/external/android/include/14/frameworks/base/include/media/EffectsFactoryApi.h b/external/android/include/14/frameworks/base/include/media/EffectsFactoryApi.h deleted file mode 100644 index 8ae13cc..0000000 --- a/external/android/include/14/frameworks/base/include/media/EffectsFactoryApi.h +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright (C) 2010 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_EFFECTSFACTORYAPI_H_ -#define ANDROID_EFFECTSFACTORYAPI_H_ - -#include -#include -#include -#include - -#if __cplusplus -extern "C" { -#endif - -///////////////////////////////////////////////// -// Effect factory interface -///////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectQueryNumberEffects -// -// Description: Returns the number of different effects in all loaded libraries. -// Each effect must have a different effect uuid (see -// effect_descriptor_t). This function together with EffectQueryEffect() -// is used to enumerate all effects present in all loaded libraries. -// Each time EffectQueryNumberEffects() is called, the factory must -// reset the index of the effect descriptor returned by next call to -// EffectQueryEffect() to restart enumeration from the beginning. -// -// Input/Output: -// pNumEffects: address where the number of effects should be returned. -// -// Output: -// returned value: 0 successful operation. -// -ENODEV factory failed to initialize -// -EINVAL invalid pNumEffects -// *pNumEffects: updated with number of effects in factory -// -//////////////////////////////////////////////////////////////////////////////// -int EffectQueryNumberEffects(uint32_t *pNumEffects); - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectQueryEffect -// -// Description: Returns a descriptor of the next available effect. -// See effect_descriptor_t for a details on effect descriptor. -// This function together with EffectQueryNumberEffects() is used to enumerate all -// effects present in all loaded libraries. The enumeration sequence is: -// EffectQueryNumberEffects(&num_effects); -// for (i = 0; i < num_effects; i++) -// EffectQueryEffect(i,...); -// -// Input/Output: -// pDescriptor: address where to return the effect descriptor. -// -// Output: -// returned value: 0 successful operation. -// -ENOENT no more effect available -// -ENODEV factory failed to initialize -// -EINVAL invalid pDescriptor -// -ENOSYS effect list has changed since last execution of EffectQueryNumberEffects() -// *pDescriptor: updated with the effect descriptor. -// -//////////////////////////////////////////////////////////////////////////////// -int EffectQueryEffect(uint32_t index, effect_descriptor_t *pDescriptor); - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectCreate -// -// Description: Creates an effect engine of the specified type and returns an -// effect control interface on this engine. The function will allocate the -// resources for an instance of the requested effect engine and return -// a handler on the effect control interface. -// -// Input: -// pEffectUuid: pointer to the effect uuid. -// sessionId: audio session to which this effect instance will be attached. All effects created -// with the same session ID are connected in series and process the same signal stream. -// Knowing that two effects are part of the same effect chain can help the library implement -// some kind of optimizations. -// ioId: identifies the output or input stream this effect is directed to at audio HAL. For future -// use especially with tunneled HW accelerated effects -// -// Input/Output: -// pHandle: address where to return the effect handle. -// -// Output: -// returned value: 0 successful operation. -// -ENODEV factory failed to initialize -// -EINVAL invalid pEffectUuid or pHandle -// -ENOENT no effect with this uuid found -// *pHandle: updated with the effect handle. -// -//////////////////////////////////////////////////////////////////////////////// -int EffectCreate(effect_uuid_t *pEffectUuid, int32_t sessionId, int32_t ioId, effect_handle_t *pHandle); - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectRelease -// -// Description: Releases the effect engine whose handler is given as argument. -// All resources allocated to this particular instance of the effect are -// released. -// -// Input: -// handle: handler on the effect interface to be released. -// -// Output: -// returned value: 0 successful operation. -// -ENODEV factory failed to initialize -// -EINVAL invalid interface handler -// -//////////////////////////////////////////////////////////////////////////////// -int EffectRelease(effect_handle_t handle); - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectGetDescriptor -// -// Description: Returns the descriptor of the effect which uuid is pointed -// to by first argument. -// -// Input: -// pEffectUuid: pointer to the effect uuid. -// -// Input/Output: -// pDescriptor: address where to return the effect descriptor. -// -// Output: -// returned value: 0 successful operation. -// -ENODEV factory failed to initialize -// -EINVAL invalid pEffectUuid or pDescriptor -// -ENOENT no effect with this uuid found -// *pDescriptor: updated with the effect descriptor. -// -//////////////////////////////////////////////////////////////////////////////// -int EffectGetDescriptor(effect_uuid_t *pEffectUuid, effect_descriptor_t *pDescriptor); - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectIsNullUuid -// -// Description: Helper function to compare effect uuid to EFFECT_UUID_NULL -// -// Input: -// pEffectUuid: pointer to effect uuid to compare to EFFECT_UUID_NULL. -// -// Output: -// returned value: 0 if uuid is different from EFFECT_UUID_NULL. -// 1 if uuid is equal to EFFECT_UUID_NULL. -// -//////////////////////////////////////////////////////////////////////////////// -int EffectIsNullUuid(effect_uuid_t *pEffectUuid); - -#if __cplusplus -} // extern "C" -#endif - - -#endif /*ANDROID_EFFECTSFACTORYAPI_H_*/ diff --git a/external/android/include/14/frameworks/base/include/media/IAudioFlinger.h b/external/android/include/14/frameworks/base/include/media/IAudioFlinger.h deleted file mode 100644 index 9e3cb7f..0000000 --- a/external/android/include/14/frameworks/base/include/media/IAudioFlinger.h +++ /dev/null @@ -1,180 +0,0 @@ -/* - * 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_IAUDIOFLINGER_H -#define ANDROID_IAUDIOFLINGER_H - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class IAudioFlinger : public IInterface -{ -public: - DECLARE_META_INTERFACE(AudioFlinger); - - /* create an audio track and registers it with AudioFlinger. - * return null if the track cannot be created. - */ - virtual sp createTrack( - pid_t pid, - int streamType, - uint32_t sampleRate, - uint32_t format, - uint32_t channelMask, - int frameCount, - uint32_t flags, - const sp& sharedBuffer, - int output, - int *sessionId, - status_t *status) = 0; - - virtual sp openRecord( - pid_t pid, - int input, - uint32_t sampleRate, - uint32_t format, - uint32_t channelMask, - int frameCount, - uint32_t flags, - int *sessionId, - status_t *status) = 0; - - /* query the audio hardware state. This state never changes, - * and therefore can be cached. - */ - virtual uint32_t sampleRate(int output) const = 0; - virtual int channelCount(int output) const = 0; - virtual uint32_t format(int output) const = 0; - virtual size_t frameCount(int output) const = 0; - virtual uint32_t latency(int output) const = 0; - - /* set/get the audio hardware state. This will probably be used by - * the preference panel, mostly. - */ - virtual status_t setMasterVolume(float value) = 0; - virtual status_t setMasterMute(bool muted) = 0; - - virtual float masterVolume() const = 0; - virtual bool masterMute() const = 0; - - /* set/get stream type state. This will probably be used by - * the preference panel, mostly. - */ - virtual status_t setStreamVolume(int stream, float value, int output) = 0; - virtual status_t setStreamMute(int stream, bool muted) = 0; - - virtual float streamVolume(int stream, int output) const = 0; - virtual bool streamMute(int stream) const = 0; - - // set audio mode - virtual status_t setMode(int mode) = 0; - - // mic mute/state - virtual status_t setMicMute(bool state) = 0; - virtual bool getMicMute() const = 0; - - virtual status_t setParameters(int ioHandle, const String8& keyValuePairs) = 0; - virtual String8 getParameters(int ioHandle, const String8& keys) = 0; - - // register a current process for audio output change notifications - virtual void registerClient(const sp& client) = 0; - - // retrieve the audio recording buffer size - virtual size_t getInputBufferSize(uint32_t sampleRate, int format, int channelCount) = 0; - - virtual int openOutput(uint32_t *pDevices, - uint32_t *pSamplingRate, - uint32_t *pFormat, - uint32_t *pChannels, - uint32_t *pLatencyMs, - uint32_t flags) = 0; - virtual int openDuplicateOutput(int output1, int output2) = 0; - virtual status_t closeOutput(int output) = 0; - virtual status_t suspendOutput(int output) = 0; - virtual status_t restoreOutput(int output) = 0; - - virtual int openInput(uint32_t *pDevices, - uint32_t *pSamplingRate, - uint32_t *pFormat, - uint32_t *pChannels, - uint32_t acoustics) = 0; - virtual status_t closeInput(int input) = 0; - - virtual status_t setStreamOutput(uint32_t stream, int output) = 0; - - virtual status_t setVoiceVolume(float volume) = 0; - - virtual status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, int output) = 0; - - virtual unsigned int getInputFramesLost(int ioHandle) = 0; - - virtual int newAudioSessionId() = 0; - - virtual void acquireAudioSessionId(int audioSession) = 0; - virtual void releaseAudioSessionId(int audioSession) = 0; - - virtual status_t queryNumberEffects(uint32_t *numEffects) = 0; - - virtual status_t queryEffect(uint32_t index, effect_descriptor_t *pDescriptor) = 0; - - virtual status_t getEffectDescriptor(effect_uuid_t *pEffectUUID, effect_descriptor_t *pDescriptor) = 0; - - virtual sp createEffect(pid_t pid, - effect_descriptor_t *pDesc, - const sp& client, - int32_t priority, - int output, - int sessionId, - status_t *status, - int *id, - int *enabled) = 0; - - virtual status_t moveEffects(int session, int srcOutput, int dstOutput) = 0; -}; - - -// ---------------------------------------------------------------------------- - -class BnAudioFlinger : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IAUDIOFLINGER_H diff --git a/external/android/include/14/frameworks/base/include/media/IAudioFlingerClient.h b/external/android/include/14/frameworks/base/include/media/IAudioFlingerClient.h deleted file mode 100644 index aa0cdcf..0000000 --- a/external/android/include/14/frameworks/base/include/media/IAudioFlingerClient.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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_IAUDIOFLINGERCLIENT_H -#define ANDROID_IAUDIOFLINGERCLIENT_H - - -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class IAudioFlingerClient : public IInterface -{ -public: - DECLARE_META_INTERFACE(AudioFlingerClient); - - // Notifies a change of audio input/output configuration. - virtual void ioConfigChanged(int event, int ioHandle, void *param2) = 0; - -}; - - -// ---------------------------------------------------------------------------- - -class BnAudioFlingerClient : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IAUDIOFLINGERCLIENT_H diff --git a/external/android/include/14/frameworks/base/include/media/IAudioPolicyService.h b/external/android/include/14/frameworks/base/include/media/IAudioPolicyService.h deleted file mode 100644 index 9807cbe..0000000 --- a/external/android/include/14/frameworks/base/include/media/IAudioPolicyService.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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_IAUDIOPOLICYSERVICE_H -#define ANDROID_IAUDIOPOLICYSERVICE_H - -#include -#include -#include - -#include -#include -#include -#include - -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class IAudioPolicyService : public IInterface -{ -public: - DECLARE_META_INTERFACE(AudioPolicyService); - - // - // IAudioPolicyService interface (see AudioPolicyInterface for method descriptions) - // - virtual status_t setDeviceConnectionState(audio_devices_t device, - audio_policy_dev_state_t state, - const char *device_address) = 0; - virtual audio_policy_dev_state_t getDeviceConnectionState(audio_devices_t device, - const char *device_address) = 0; - virtual status_t setPhoneState(int state) = 0; - virtual status_t setRingerMode(uint32_t mode, uint32_t mask) = 0; - virtual status_t setForceUse(audio_policy_force_use_t usage, audio_policy_forced_cfg_t config) = 0; - virtual audio_policy_forced_cfg_t getForceUse(audio_policy_force_use_t usage) = 0; - virtual audio_io_handle_t getOutput(audio_stream_type_t stream, - uint32_t samplingRate = 0, - uint32_t format = AUDIO_FORMAT_DEFAULT, - uint32_t channels = 0, - audio_policy_output_flags_t flags = AUDIO_POLICY_OUTPUT_FLAG_INDIRECT) = 0; - virtual status_t startOutput(audio_io_handle_t output, - audio_stream_type_t stream, - int session = 0) = 0; - virtual status_t stopOutput(audio_io_handle_t output, - audio_stream_type_t stream, - int session = 0) = 0; - virtual void releaseOutput(audio_io_handle_t output) = 0; - virtual audio_io_handle_t getInput(int inputSource, - uint32_t samplingRate = 0, - uint32_t format = AUDIO_FORMAT_DEFAULT, - uint32_t channels = 0, - audio_in_acoustics_t acoustics = (audio_in_acoustics_t)0, - int audioSession = 0) = 0; - virtual status_t startInput(audio_io_handle_t input) = 0; - virtual status_t stopInput(audio_io_handle_t input) = 0; - virtual void releaseInput(audio_io_handle_t input) = 0; - virtual status_t initStreamVolume(audio_stream_type_t stream, - int indexMin, - int indexMax) = 0; - virtual status_t setStreamVolumeIndex(audio_stream_type_t stream, int index) = 0; - virtual status_t getStreamVolumeIndex(audio_stream_type_t stream, int *index) = 0; - virtual uint32_t getStrategyForStream(audio_stream_type_t stream) = 0; - virtual uint32_t getDevicesForStream(audio_stream_type_t stream) = 0; - virtual audio_io_handle_t getOutputForEffect(effect_descriptor_t *desc) = 0; - virtual status_t registerEffect(effect_descriptor_t *desc, - audio_io_handle_t io, - uint32_t strategy, - int session, - int id) = 0; - virtual status_t unregisterEffect(int id) = 0; - virtual status_t setEffectEnabled(int id, bool enabled) = 0; - virtual bool isStreamActive(int stream, uint32_t inPastMs = 0) const = 0; - virtual status_t queryDefaultPreProcessing(int audioSession, - effect_descriptor_t *descriptors, - uint32_t *count) = 0; -}; - - -// ---------------------------------------------------------------------------- - -class BnAudioPolicyService : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IAUDIOPOLICYSERVICE_H diff --git a/external/android/include/14/frameworks/base/include/media/IAudioRecord.h b/external/android/include/14/frameworks/base/include/media/IAudioRecord.h deleted file mode 100644 index 46735de..0000000 --- a/external/android/include/14/frameworks/base/include/media/IAudioRecord.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 IAUDIORECORD_H_ -#define IAUDIORECORD_H_ - -#include -#include - -#include -#include -#include -#include - - -namespace android { - -// ---------------------------------------------------------------------------- - -class IAudioRecord : public IInterface -{ -public: - DECLARE_META_INTERFACE(AudioRecord); - - /* After it's created the track is not active. Call start() to - * make it active. If set, the callback will start being called. - */ - virtual status_t start() = 0; - - /* Stop a track. If set, the callback will cease being called and - * obtainBuffer will return an error. Buffers that are already released - * will be processed, unless flush() is called. - */ - virtual void stop() = 0; - - /* get this tracks control block */ - virtual sp getCblk() const = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnAudioRecord : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif /*IAUDIORECORD_H_*/ diff --git a/external/android/include/14/frameworks/base/include/media/IAudioTrack.h b/external/android/include/14/frameworks/base/include/media/IAudioTrack.h deleted file mode 100644 index 47d530b..0000000 --- a/external/android/include/14/frameworks/base/include/media/IAudioTrack.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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_IAUDIOTRACK_H -#define ANDROID_IAUDIOTRACK_H - -#include -#include - -#include -#include -#include -#include - - -namespace android { - -// ---------------------------------------------------------------------------- - -class IAudioTrack : public IInterface -{ -public: - DECLARE_META_INTERFACE(AudioTrack); - - /* After it's created the track is not active. Call start() to - * make it active. If set, the callback will start being called. - */ - virtual status_t start() = 0; - - /* Stop a track. If set, the callback will cease being called and - * obtainBuffer will return an error. Buffers that are already released - * will be processed, unless flush() is called. - */ - virtual void stop() = 0; - - /* flush a stopped track. All pending buffers are discarded. - * This function has no effect if the track is not stoped. - */ - virtual void flush() = 0; - - /* mute or unmutes this track. - * While mutted, the callback, if set, is still called. - */ - virtual void mute(bool) = 0; - - /* Pause a track. If set, the callback will cease being called and - * obtainBuffer will return an error. Buffers that are already released - * will be processed, unless flush() is called. - */ - virtual void pause() = 0; - - /* Attach track auxiliary output to specified effect. Use effectId = 0 - * to detach track from effect. - */ - virtual status_t attachAuxEffect(int effectId) = 0; - - /* get this tracks control block */ - virtual sp getCblk() const = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnAudioTrack : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IAUDIOTRACK_H diff --git a/external/android/include/14/frameworks/base/include/media/IEffect.h b/external/android/include/14/frameworks/base/include/media/IEffect.h deleted file mode 100644 index ff04869..0000000 --- a/external/android/include/14/frameworks/base/include/media/IEffect.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2010 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_IEFFECT_H -#define ANDROID_IEFFECT_H - -#include -#include -#include -#include - -namespace android { - -class IEffect: public IInterface -{ -public: - DECLARE_META_INTERFACE(Effect); - - virtual status_t enable() = 0; - - virtual status_t disable() = 0; - - virtual status_t command(uint32_t cmdCode, - uint32_t cmdSize, - void *pCmdData, - uint32_t *pReplySize, - void *pReplyData) = 0; - - virtual void disconnect() = 0; - - virtual sp getCblk() const = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnEffect: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IEFFECT_H diff --git a/external/android/include/14/frameworks/base/include/media/IEffectClient.h b/external/android/include/14/frameworks/base/include/media/IEffectClient.h deleted file mode 100644 index 2f78c98..0000000 --- a/external/android/include/14/frameworks/base/include/media/IEffectClient.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2010 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_IEFFECTCLIENT_H -#define ANDROID_IEFFECTCLIENT_H - -#include -#include -#include -#include - -namespace android { - -class IEffectClient: public IInterface -{ -public: - DECLARE_META_INTERFACE(EffectClient); - - virtual void controlStatusChanged(bool controlGranted) = 0; - virtual void enableStatusChanged(bool enabled) = 0; - virtual void commandExecuted(uint32_t cmdCode, - uint32_t cmdSize, - void *pCmdData, - uint32_t replySize, - void *pReplyData) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnEffectClient: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IEFFECTCLIENT_H diff --git a/external/android/include/14/frameworks/base/include/media/IMediaDeathNotifier.h b/external/android/include/14/frameworks/base/include/media/IMediaDeathNotifier.h deleted file mode 100644 index bb3d0d8..0000000 --- a/external/android/include/14/frameworks/base/include/media/IMediaDeathNotifier.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2010 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_IMEDIADEATHNOTIFIER_H -#define ANDROID_IMEDIADEATHNOTIFIER_H - -#include -#include -#include - -namespace android { - -class IMediaDeathNotifier: virtual public RefBase -{ -public: - IMediaDeathNotifier() { addObitRecipient(this); } - virtual ~IMediaDeathNotifier() { removeObitRecipient(this); } - - virtual void died() = 0; - static const sp& getMediaPlayerService(); - -private: - IMediaDeathNotifier &operator=(const IMediaDeathNotifier &); - IMediaDeathNotifier(const IMediaDeathNotifier &); - - static void addObitRecipient(const wp& recipient); - static void removeObitRecipient(const wp& recipient); - - class DeathNotifier: public IBinder::DeathRecipient - { - public: - DeathNotifier() {} - virtual ~DeathNotifier(); - - virtual void binderDied(const wp& who); - }; - - friend class DeathNotifier; - - static Mutex sServiceLock; - static sp sMediaPlayerService; - static sp sDeathNotifier; - static SortedVector< wp > sObitRecipients; -}; - -}; // namespace android - -#endif // ANDROID_IMEDIADEATHNOTIFIER_H diff --git a/external/android/include/14/frameworks/base/include/media/IMediaMetadataRetriever.h b/external/android/include/14/frameworks/base/include/media/IMediaMetadataRetriever.h deleted file mode 100644 index 1c1c268..0000000 --- a/external/android/include/14/frameworks/base/include/media/IMediaMetadataRetriever.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -** -** 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. -*/ - -#ifndef ANDROID_IMEDIAMETADATARETRIEVER_H -#define ANDROID_IMEDIAMETADATARETRIEVER_H - -#include -#include -#include -#include -#include - -namespace android { - -class IMediaMetadataRetriever: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaMetadataRetriever); - virtual void disconnect() = 0; - - virtual status_t setDataSource( - const char *srcUrl, - const KeyedVector *headers = NULL) = 0; - - virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; - virtual sp getFrameAtTime(int64_t timeUs, int option) = 0; - virtual sp extractAlbumArt() = 0; - virtual const char* extractMetadata(int keyCode) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnMediaMetadataRetriever: public BnInterface -{ -public: - virtual status_t onTransact(uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IMEDIAMETADATARETRIEVER_H - diff --git a/external/android/include/14/frameworks/base/include/media/IMediaPlayer.h b/external/android/include/14/frameworks/base/include/media/IMediaPlayer.h deleted file mode 100644 index 0e2cdf7..0000000 --- a/external/android/include/14/frameworks/base/include/media/IMediaPlayer.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_IMEDIAPLAYER_H -#define ANDROID_IMEDIAPLAYER_H - -#include -#include -#include -#include - -namespace android { - -class Parcel; -class Surface; -class IStreamSource; -class ISurfaceTexture; - -class IMediaPlayer: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaPlayer); - - virtual void disconnect() = 0; - - virtual status_t setDataSource(const char *url, - const KeyedVector* headers) = 0; - virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; - virtual status_t setDataSource(const sp& source) = 0; - virtual status_t setVideoSurface(const sp& surface) = 0; - virtual status_t setVideoSurfaceTexture( - const sp& surfaceTexture) = 0; - virtual status_t prepareAsync() = 0; - virtual status_t start() = 0; - virtual status_t stop() = 0; - virtual status_t pause() = 0; - virtual status_t isPlaying(bool* state) = 0; - virtual status_t seekTo(int msec) = 0; - virtual status_t getCurrentPosition(int* msec) = 0; - virtual status_t getDuration(int* msec) = 0; - virtual status_t reset() = 0; - virtual status_t setAudioStreamType(int type) = 0; - virtual status_t setLooping(int loop) = 0; - virtual status_t setVolume(float leftVolume, float rightVolume) = 0; - virtual status_t setAuxEffectSendLevel(float level) = 0; - virtual status_t attachAuxEffect(int effectId) = 0; - virtual status_t setParameter(int key, const Parcel& request) = 0; - virtual status_t getParameter(int key, Parcel* reply) = 0; - - // Invoke a generic method on the player by using opaque parcels - // for the request and reply. - // @param request Parcel that must start with the media player - // interface token. - // @param[out] reply Parcel to hold the reply data. Cannot be null. - // @return OK if the invocation was made successfully. - virtual status_t invoke(const Parcel& request, Parcel *reply) = 0; - - // Set a new metadata filter. - // @param filter A set of allow and drop rules serialized in a Parcel. - // @return OK if the invocation was made successfully. - virtual status_t setMetadataFilter(const Parcel& filter) = 0; - - // Retrieve a set of metadata. - // @param update_only Include only the metadata that have changed - // since the last invocation of getMetadata. - // The set is built using the unfiltered - // notifications the native player sent to the - // MediaPlayerService during that period of - // time. If false, all the metadatas are considered. - // @param apply_filter If true, once the metadata set has been built based - // on the value update_only, the current filter is - // applied. - // @param[out] metadata On exit contains a set (possibly empty) of metadata. - // Valid only if the call returned OK. - // @return OK if the invocation was made successfully. - virtual status_t getMetadata(bool update_only, - bool apply_filter, - Parcel *metadata) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnMediaPlayer: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IMEDIAPLAYER_H diff --git a/external/android/include/14/frameworks/base/include/media/IMediaPlayerClient.h b/external/android/include/14/frameworks/base/include/media/IMediaPlayerClient.h deleted file mode 100644 index daec1c7..0000000 --- a/external/android/include/14/frameworks/base/include/media/IMediaPlayerClient.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_IMEDIAPLAYERCLIENT_H -#define ANDROID_IMEDIAPLAYERCLIENT_H - -#include -#include -#include - -namespace android { - -class IMediaPlayerClient: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaPlayerClient); - - virtual void notify(int msg, int ext1, int ext2, const Parcel *obj) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnMediaPlayerClient: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IMEDIAPLAYERCLIENT_H - diff --git a/external/android/include/14/frameworks/base/include/media/IMediaPlayerService.h b/external/android/include/14/frameworks/base/include/media/IMediaPlayerService.h deleted file mode 100644 index 93bbe13..0000000 --- a/external/android/include/14/frameworks/base/include/media/IMediaPlayerService.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_IMEDIAPLAYERSERVICE_H -#define ANDROID_IMEDIAPLAYERSERVICE_H - -#include // for status_t -#include -#include -#include -#include -#include - -#include -#include -#include - -namespace android { - -class IMediaRecorder; -class IOMX; -struct IStreamSource; - -class IMediaPlayerService: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaPlayerService); - - virtual sp createMediaRecorder(pid_t pid) = 0; - virtual sp createMetadataRetriever(pid_t pid) = 0; - virtual sp create(pid_t pid, const sp& client, int audioSessionId = 0) = 0; - - virtual sp decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, int* pFormat) = 0; - virtual sp decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, int* pFormat) = 0; - virtual sp getOMX() = 0; - - // codecs and audio devices usage tracking for the battery app - enum BatteryDataBits { - // tracking audio codec - kBatteryDataTrackAudio = 0x1, - // tracking video codec - kBatteryDataTrackVideo = 0x2, - // codec is started, otherwise codec is paused - kBatteryDataCodecStarted = 0x4, - // tracking decoder (for media player), - // otherwise tracking encoder (for media recorder) - kBatteryDataTrackDecoder = 0x8, - // start to play an audio on an audio device - kBatteryDataAudioFlingerStart = 0x10, - // stop/pause the audio playback - kBatteryDataAudioFlingerStop = 0x20, - // audio is rounted to speaker - kBatteryDataSpeakerOn = 0x40, - // audio is rounted to devices other than speaker - kBatteryDataOtherAudioDeviceOn = 0x80, - }; - - virtual void addBatteryData(uint32_t params) = 0; - virtual status_t pullBatteryData(Parcel* reply) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnMediaPlayerService: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IMEDIAPLAYERSERVICE_H diff --git a/external/android/include/14/frameworks/base/include/media/IMediaRecorder.h b/external/android/include/14/frameworks/base/include/media/IMediaRecorder.h deleted file mode 100644 index ec84e25..0000000 --- a/external/android/include/14/frameworks/base/include/media/IMediaRecorder.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - ** - ** Copyright 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. - */ - -#ifndef ANDROID_IMEDIARECORDER_H -#define ANDROID_IMEDIARECORDER_H - -#include - -namespace android { - -class Surface; -class ICamera; -class ICameraRecordingProxy; -class IMediaRecorderClient; -class ISurfaceTexture; - -class IMediaRecorder: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaRecorder); - - virtual status_t setCamera(const sp& camera, - const sp& proxy) = 0; - virtual status_t setPreviewSurface(const sp& surface) = 0; - virtual status_t setVideoSource(int vs) = 0; - virtual status_t setAudioSource(int as) = 0; - virtual status_t setOutputFormat(int of) = 0; - virtual status_t setVideoEncoder(int ve) = 0; - virtual status_t setAudioEncoder(int ae) = 0; - virtual status_t setOutputFile(const char* path) = 0; - virtual status_t setOutputFile(int fd, int64_t offset, int64_t length) = 0; - virtual status_t setVideoSize(int width, int height) = 0; - virtual status_t setVideoFrameRate(int frames_per_second) = 0; - virtual status_t setParameters(const String8& params) = 0; - virtual status_t setListener(const sp& listener) = 0; - virtual status_t prepare() = 0; - virtual status_t getMaxAmplitude(int* max) = 0; - virtual status_t start() = 0; - virtual status_t stop() = 0; - virtual status_t reset() = 0; - virtual status_t init() = 0; - virtual status_t close() = 0; - virtual status_t release() = 0; - virtual sp querySurfaceMediaSource() = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnMediaRecorder: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IMEDIARECORDER_H diff --git a/external/android/include/14/frameworks/base/include/media/IMediaRecorderClient.h b/external/android/include/14/frameworks/base/include/media/IMediaRecorderClient.h deleted file mode 100644 index 0058ef2..0000000 --- a/external/android/include/14/frameworks/base/include/media/IMediaRecorderClient.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2010 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_IMEDIARECORDERCLIENT_H -#define ANDROID_IMEDIARECORDERCLIENT_H - -#include -#include -#include - -namespace android { - -class IMediaRecorderClient: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaRecorderClient); - - virtual void notify(int msg, int ext1, int ext2) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnMediaRecorderClient: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IMEDIARECORDERCLIENT_H - diff --git a/external/android/include/14/frameworks/base/include/media/IOMX.h b/external/android/include/14/frameworks/base/include/media/IOMX.h deleted file mode 100644 index c4cc947..0000000 --- a/external/android/include/14/frameworks/base/include/media/IOMX.h +++ /dev/null @@ -1,197 +0,0 @@ -/* - * 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_IOMX_H_ - -#define ANDROID_IOMX_H_ - -#include -#include -#include -#include - -#include -#include - -#include "jni.h" - -namespace android { - -class IMemory; -class IOMXObserver; -class IOMXRenderer; -class Surface; - -class IOMX : public IInterface { -public: - DECLARE_META_INTERFACE(OMX); - - typedef void *buffer_id; - typedef void *node_id; - - // Given the calling process' pid, returns true iff - // the implementation of the OMX interface lives in the same - // process. - virtual bool livesLocally(pid_t pid) = 0; - - struct ComponentInfo { - String8 mName; - List mRoles; - }; - virtual status_t listNodes(List *list) = 0; - - virtual status_t allocateNode( - const char *name, const sp &observer, - node_id *node) = 0; - - virtual status_t freeNode(node_id node) = 0; - - virtual status_t sendCommand( - node_id node, OMX_COMMANDTYPE cmd, OMX_S32 param) = 0; - - virtual status_t getParameter( - node_id node, OMX_INDEXTYPE index, - void *params, size_t size) = 0; - - virtual status_t setParameter( - node_id node, OMX_INDEXTYPE index, - const void *params, size_t size) = 0; - - virtual status_t getConfig( - node_id node, OMX_INDEXTYPE index, - void *params, size_t size) = 0; - - virtual status_t setConfig( - node_id node, OMX_INDEXTYPE index, - const void *params, size_t size) = 0; - - virtual status_t getState( - node_id node, OMX_STATETYPE* state) = 0; - - virtual status_t storeMetaDataInBuffers( - node_id node, OMX_U32 port_index, OMX_BOOL enable) = 0; - - virtual status_t enableGraphicBuffers( - node_id node, OMX_U32 port_index, OMX_BOOL enable) = 0; - - virtual status_t getGraphicBufferUsage( - node_id node, OMX_U32 port_index, OMX_U32* usage) = 0; - - virtual status_t useBuffer( - node_id node, OMX_U32 port_index, const sp ¶ms, - buffer_id *buffer) = 0; - - virtual status_t useGraphicBuffer( - node_id node, OMX_U32 port_index, - const sp &graphicBuffer, buffer_id *buffer) = 0; - - // This API clearly only makes sense if the caller lives in the - // same process as the callee, i.e. is the media_server, as the - // returned "buffer_data" pointer is just that, a pointer into local - // address space. - virtual status_t allocateBuffer( - node_id node, OMX_U32 port_index, size_t size, - buffer_id *buffer, void **buffer_data) = 0; - - virtual status_t allocateBufferWithBackup( - node_id node, OMX_U32 port_index, const sp ¶ms, - buffer_id *buffer) = 0; - - virtual status_t freeBuffer( - node_id node, OMX_U32 port_index, buffer_id buffer) = 0; - - virtual status_t fillBuffer(node_id node, buffer_id buffer) = 0; - - virtual status_t emptyBuffer( - node_id node, - buffer_id buffer, - OMX_U32 range_offset, OMX_U32 range_length, - OMX_U32 flags, OMX_TICKS timestamp) = 0; - - virtual status_t getExtensionIndex( - node_id node, - const char *parameter_name, - OMX_INDEXTYPE *index) = 0; -}; - -struct omx_message { - enum { - EVENT, - EMPTY_BUFFER_DONE, - FILL_BUFFER_DONE, - - } type; - - IOMX::node_id node; - - union { - // if type == EVENT - struct { - OMX_EVENTTYPE event; - OMX_U32 data1; - OMX_U32 data2; - } event_data; - - // if type == EMPTY_BUFFER_DONE - struct { - IOMX::buffer_id buffer; - } buffer_data; - - // if type == FILL_BUFFER_DONE - struct { - IOMX::buffer_id buffer; - OMX_U32 range_offset; - OMX_U32 range_length; - OMX_U32 flags; - OMX_TICKS timestamp; - OMX_PTR platform_private; - OMX_PTR data_ptr; - } extended_buffer_data; - - } u; -}; - -class IOMXObserver : public IInterface { -public: - DECLARE_META_INTERFACE(OMXObserver); - - virtual void onMessage(const omx_message &msg) = 0; -}; - -//////////////////////////////////////////////////////////////////////////////// - -class BnOMX : public BnInterface { -public: - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -}; - -class BnOMXObserver : public BnInterface { -public: - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -}; - -struct CodecProfileLevel { - OMX_U32 mProfile; - OMX_U32 mLevel; -}; - -} // namespace android - -#endif // ANDROID_IOMX_H_ diff --git a/external/android/include/14/frameworks/base/include/media/IStreamSource.h b/external/android/include/14/frameworks/base/include/media/IStreamSource.h deleted file mode 100644 index cc63356..0000000 --- a/external/android/include/14/frameworks/base/include/media/IStreamSource.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2010 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_ISTREAMSOURCE_H_ - -#define ANDROID_ISTREAMSOURCE_H_ - -#include - -namespace android { - -struct AMessage; -struct IMemory; -struct IStreamListener; - -struct IStreamSource : public IInterface { - DECLARE_META_INTERFACE(StreamSource); - - virtual void setListener(const sp &listener) = 0; - virtual void setBuffers(const Vector > &buffers) = 0; - - virtual void onBufferAvailable(size_t index) = 0; -}; - -struct IStreamListener : public IInterface { - DECLARE_META_INTERFACE(StreamListener); - - enum Command { - EOS, - DISCONTINUITY, - }; - - virtual void queueBuffer(size_t index, size_t size) = 0; - - // When signalling a discontinuity you can optionally - // specify an int64_t PTS timestamp in "msg". - // If present, rendering of data following the discontinuity - // will be suppressed until media time reaches this timestamp. - static const char *const kKeyResumeAtPTS; - - // When signalling a discontinuity you can optionally - // signal that this is a "hard" discontinuity, i.e. the format - // or configuration of subsequent stream data differs from that - // currently active. To do so, include a non-zero int32_t value - // under the key "kKeyFormatChange" when issuing the DISCONTINUITY - // command. - // The new logical stream must start with proper codec initialization - // information for playback to continue, i.e. SPS and PPS in the case - // of AVC video etc. - static const char *const kKeyFormatChange; - - virtual void issueCommand( - Command cmd, bool synchronous, const sp &msg = NULL) = 0; -}; - -//////////////////////////////////////////////////////////////////////////////// - -struct BnStreamSource : public BnInterface { - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -}; - -struct BnStreamListener : public BnInterface { - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -}; - -} // namespace android - -#endif // ANDROID_ISTREAMSOURCE_H_ diff --git a/external/android/include/14/frameworks/base/include/media/JetPlayer.h b/external/android/include/14/frameworks/base/include/media/JetPlayer.h deleted file mode 100644 index 16764a9..0000000 --- a/external/android/include/14/frameworks/base/include/media/JetPlayer.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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. - */ - -#ifndef JETPLAYER_H_ -#define JETPLAYER_H_ - -#include -#include - -#include -#include -#include "AudioTrack.h" - - -namespace android { - -typedef void (*jetevent_callback)(int eventType, int val1, int val2, void *cookie); - -class JetPlayer { - -public: - - // to keep in sync with the JetPlayer class constants - // defined in frameworks/base/media/java/android/media/JetPlayer.java - static const int JET_EVENT = 1; - static const int JET_USERID_UPDATE = 2; - static const int JET_NUMQUEUEDSEGMENT_UPDATE = 3; - static const int JET_PAUSE_UPDATE = 4; - - JetPlayer(jobject javaJetPlayer, - int maxTracks = 32, - int trackBufferSize = 1200); - ~JetPlayer(); - int init(); - int release(); - - int loadFromFile(const char* url); - int loadFromFD(const int fd, const long long offset, const long long length); - int closeFile(); - int play(); - int pause(); - int queueSegment(int segmentNum, int libNum, int repeatCount, int transpose, - EAS_U32 muteFlags, EAS_U8 userID); - int setMuteFlags(EAS_U32 muteFlags, bool sync); - int setMuteFlag(int trackNum, bool muteFlag, bool sync); - int triggerClip(int clipId); - int clearQueue(); - - void setEventCallback(jetevent_callback callback); - - int getMaxTracks() { return mMaxTracks; }; - - -private: - static int renderThread(void*); - int render(); - void fireUpdateOnStatusChange(); - void fireEventsFromJetQueue(); - - JetPlayer() {} // no default constructor - void dump(); - void dumpJetStatus(S_JET_STATUS* pJetStatus); - - jetevent_callback mEventCallback; - - jobject mJavaJetPlayerRef; - Mutex mMutex; // mutex to sync the render and playback thread with the JET calls - pid_t mTid; - Condition mCondition; - volatile bool mRender; - bool mPaused; - - EAS_STATE mState; - int* mMemFailedVar; - - int mMaxTracks; // max number of MIDI tracks, usually 32 - EAS_DATA_HANDLE mEasData; - EAS_FILE_LOCATOR mEasJetFileLoc; - EAS_PCM* mAudioBuffer;// EAS renders the MIDI data into this buffer, - AudioTrack* mAudioTrack; // and we play it in this audio track - int mTrackBufferSize; - S_JET_STATUS mJetStatus; - S_JET_STATUS mPreviousJetStatus; - - char mJetFilePath[256]; - - -}; // end class JetPlayer - -} // end namespace android - - - -#endif /*JETPLAYER_H_*/ diff --git a/external/android/include/14/frameworks/base/include/media/MediaMetadataRetrieverInterface.h b/external/android/include/14/frameworks/base/include/media/MediaMetadataRetrieverInterface.h deleted file mode 100644 index 27b7e4d..0000000 --- a/external/android/include/14/frameworks/base/include/media/MediaMetadataRetrieverInterface.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -** -** 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. -*/ - -#ifndef ANDROID_MEDIAMETADATARETRIEVERINTERFACE_H -#define ANDROID_MEDIAMETADATARETRIEVERINTERFACE_H - -#include -#include -#include - -namespace android { - -// Abstract base class -class MediaMetadataRetrieverBase : public RefBase -{ -public: - MediaMetadataRetrieverBase() {} - virtual ~MediaMetadataRetrieverBase() {} - - virtual status_t setDataSource( - const char *url, - const KeyedVector *headers = NULL) = 0; - - virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; - virtual VideoFrame* getFrameAtTime(int64_t timeUs, int option) = 0; - virtual MediaAlbumArt* extractAlbumArt() = 0; - virtual const char* extractMetadata(int keyCode) = 0; -}; - -// MediaMetadataRetrieverInterface -class MediaMetadataRetrieverInterface : public MediaMetadataRetrieverBase -{ -public: - MediaMetadataRetrieverInterface() {} - - virtual ~MediaMetadataRetrieverInterface() {} - virtual VideoFrame* getFrameAtTime(int64_t timeUs, int option) { return NULL; } - virtual MediaAlbumArt* extractAlbumArt() { return NULL; } - virtual const char* extractMetadata(int keyCode) { return NULL; } -}; - -}; // namespace android - -#endif // ANDROID_MEDIAMETADATARETRIEVERINTERFACE_H - diff --git a/external/android/include/14/frameworks/base/include/media/MediaPlayerInterface.h b/external/android/include/14/frameworks/base/include/media/MediaPlayerInterface.h deleted file mode 100644 index 4328d3c..0000000 --- a/external/android/include/14/frameworks/base/include/media/MediaPlayerInterface.h +++ /dev/null @@ -1,213 +0,0 @@ -/* - * 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_MEDIAPLAYERINTERFACE_H -#define ANDROID_MEDIAPLAYERINTERFACE_H - -#ifdef __cplusplus - -#include -#include -#include -#include -#include - -#include -#include -#include - -namespace android { - -class Parcel; -class Surface; -class ISurfaceTexture; - -template class SortedVector; - -enum player_type { - PV_PLAYER = 1, - SONIVOX_PLAYER = 2, - STAGEFRIGHT_PLAYER = 3, - NU_PLAYER = 4, - // Test players are available only in the 'test' and 'eng' builds. - // The shared library with the test player is passed passed as an - // argument to the 'test:' url in the setDataSource call. - TEST_PLAYER = 5, -}; - - -#define DEFAULT_AUDIOSINK_BUFFERCOUNT 4 -#define DEFAULT_AUDIOSINK_BUFFERSIZE 1200 -#define DEFAULT_AUDIOSINK_SAMPLERATE 44100 - - -// callback mechanism for passing messages to MediaPlayer object -typedef void (*notify_callback_f)(void* cookie, - int msg, int ext1, int ext2, const Parcel *obj); - -// abstract base class - use MediaPlayerInterface -class MediaPlayerBase : public RefBase -{ -public: - // AudioSink: abstraction layer for audio output - class AudioSink : public RefBase { - public: - // Callback returns the number of bytes actually written to the buffer. - typedef size_t (*AudioCallback)( - AudioSink *audioSink, void *buffer, size_t size, void *cookie); - - virtual ~AudioSink() {} - virtual bool ready() const = 0; // audio output is open and ready - virtual bool realtime() const = 0; // audio output is real-time output - virtual ssize_t bufferSize() const = 0; - virtual ssize_t frameCount() const = 0; - virtual ssize_t channelCount() const = 0; - virtual ssize_t frameSize() const = 0; - virtual uint32_t latency() const = 0; - virtual float msecsPerFrame() const = 0; - virtual status_t getPosition(uint32_t *position) = 0; - virtual int getSessionId() = 0; - - // If no callback is specified, use the "write" API below to submit - // audio data. - virtual status_t open( - uint32_t sampleRate, int channelCount, - int format=AUDIO_FORMAT_PCM_16_BIT, - int bufferCount=DEFAULT_AUDIOSINK_BUFFERCOUNT, - AudioCallback cb = NULL, - void *cookie = NULL) = 0; - - virtual void start() = 0; - virtual ssize_t write(const void* buffer, size_t size) = 0; - virtual void stop() = 0; - virtual void flush() = 0; - virtual void pause() = 0; - virtual void close() = 0; - }; - - MediaPlayerBase() : mCookie(0), mNotify(0) {} - virtual ~MediaPlayerBase() {} - virtual status_t initCheck() = 0; - virtual bool hardwareOutput() = 0; - - virtual status_t setUID(uid_t uid) { - return INVALID_OPERATION; - } - - virtual status_t setDataSource( - const char *url, - const KeyedVector *headers = NULL) = 0; - - virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; - - virtual status_t setDataSource(const sp &source) { - return INVALID_OPERATION; - } - - // pass the buffered Surface to the media player service - virtual status_t setVideoSurface(const sp& surface) = 0; - - // pass the buffered ISurfaceTexture to the media player service - virtual status_t setVideoSurfaceTexture( - const sp& surfaceTexture) = 0; - - virtual status_t prepare() = 0; - virtual status_t prepareAsync() = 0; - virtual status_t start() = 0; - virtual status_t stop() = 0; - virtual status_t pause() = 0; - virtual bool isPlaying() = 0; - virtual status_t seekTo(int msec) = 0; - virtual status_t getCurrentPosition(int *msec) = 0; - virtual status_t getDuration(int *msec) = 0; - virtual status_t reset() = 0; - virtual status_t setLooping(int loop) = 0; - virtual player_type playerType() = 0; - virtual status_t setParameter(int key, const Parcel &request) = 0; - virtual status_t getParameter(int key, Parcel *reply) = 0; - - // Invoke a generic method on the player by using opaque parcels - // for the request and reply. - // - // @param request Parcel that is positioned at the start of the - // data sent by the java layer. - // @param[out] reply Parcel to hold the reply data. Cannot be null. - // @return OK if the call was successful. - virtual status_t invoke(const Parcel& request, Parcel *reply) = 0; - - // The Client in the MetadataPlayerService calls this method on - // the native player to retrieve all or a subset of metadata. - // - // @param ids SortedList of metadata ID to be fetch. If empty, all - // the known metadata should be returned. - // @param[inout] records Parcel where the player appends its metadata. - // @return OK if the call was successful. - virtual status_t getMetadata(const media::Metadata::Filter& ids, - Parcel *records) { - return INVALID_OPERATION; - }; - - void setNotifyCallback( - void* cookie, notify_callback_f notifyFunc) { - Mutex::Autolock autoLock(mNotifyLock); - mCookie = cookie; mNotify = notifyFunc; - } - - void sendEvent(int msg, int ext1=0, int ext2=0, - const Parcel *obj=NULL) { - Mutex::Autolock autoLock(mNotifyLock); - if (mNotify) mNotify(mCookie, msg, ext1, ext2, obj); - } - - virtual status_t dump(int fd, const Vector &args) const { - return INVALID_OPERATION; - } - -private: - friend class MediaPlayerService; - - Mutex mNotifyLock; - void* mCookie; - notify_callback_f mNotify; -}; - -// Implement this class for media players that use the AudioFlinger software mixer -class MediaPlayerInterface : public MediaPlayerBase -{ -public: - virtual ~MediaPlayerInterface() { } - virtual bool hardwareOutput() { return false; } - virtual void setAudioSink(const sp& audioSink) { mAudioSink = audioSink; } -protected: - sp mAudioSink; -}; - -// Implement this class for media players that output audio directly to hardware -class MediaPlayerHWInterface : public MediaPlayerBase -{ -public: - virtual ~MediaPlayerHWInterface() {} - virtual bool hardwareOutput() { return true; } - virtual status_t setVolume(float leftVolume, float rightVolume) = 0; - virtual status_t setAudioStreamType(int streamType) = 0; -}; - -}; // namespace android - -#endif // __cplusplus - - -#endif // ANDROID_MEDIAPLAYERINTERFACE_H diff --git a/external/android/include/14/frameworks/base/include/media/MediaProfiles.h b/external/android/include/14/frameworks/base/include/media/MediaProfiles.h deleted file mode 100644 index eab7648..0000000 --- a/external/android/include/14/frameworks/base/include/media/MediaProfiles.h +++ /dev/null @@ -1,509 +0,0 @@ -/* - ** - ** Copyright 2010, 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_MEDIAPROFILES_H -#define ANDROID_MEDIAPROFILES_H - -#include -#include - -namespace android { - -enum camcorder_quality { - CAMCORDER_QUALITY_LIST_START = 0, - CAMCORDER_QUALITY_LOW = 0, - CAMCORDER_QUALITY_HIGH = 1, - CAMCORDER_QUALITY_QCIF = 2, - CAMCORDER_QUALITY_CIF = 3, - CAMCORDER_QUALITY_480P = 4, - CAMCORDER_QUALITY_720P = 5, - CAMCORDER_QUALITY_1080P = 6, - CAMCORDER_QUALITY_QVGA = 7, - CAMCORDER_QUALITY_LIST_END = 7, - - CAMCORDER_QUALITY_TIME_LAPSE_LIST_START = 1000, - CAMCORDER_QUALITY_TIME_LAPSE_LOW = 1000, - CAMCORDER_QUALITY_TIME_LAPSE_HIGH = 1001, - CAMCORDER_QUALITY_TIME_LAPSE_QCIF = 1002, - CAMCORDER_QUALITY_TIME_LAPSE_CIF = 1003, - CAMCORDER_QUALITY_TIME_LAPSE_480P = 1004, - CAMCORDER_QUALITY_TIME_LAPSE_720P = 1005, - CAMCORDER_QUALITY_TIME_LAPSE_1080P = 1006, - CAMCORDER_QUALITY_TIME_LAPSE_QVGA = 1007, - CAMCORDER_QUALITY_TIME_LAPSE_LIST_END = 1007, -}; - -/** - *Set CIF as default maximum import and export resolution of video editor. - *The maximum import and export resolutions are platform specific, - *which should be defined in media_profiles.xml. - */ -enum videoeditor_capability { - VIDEOEDITOR_DEFAULT_MAX_INPUT_FRAME_WIDTH = 352, - VIDEOEDITOR_DEFUALT_MAX_INPUT_FRAME_HEIGHT = 288, - VIDEOEDITOR_DEFAULT_MAX_OUTPUT_FRAME_WIDTH = 352, - VIDEOEDITOR_DEFUALT_MAX_OUTPUT_FRAME_HEIGHT = 288, -}; - -enum video_decoder { - VIDEO_DECODER_WMV, -}; - -enum audio_decoder { - AUDIO_DECODER_WMA, -}; - - -class MediaProfiles -{ -public: - - /** - * Returns the singleton instance for subsequence queries. - * or NULL if error. - */ - static MediaProfiles* getInstance(); - - /** - * Returns the value for the given param name for the given camera at - * the given quality level, or -1 if error. - * - * Supported param name are: - * duration - the recording duration. - * file.format - output file format. see mediarecorder.h for details - * vid.codec - video encoder. see mediarecorder.h for details. - * aud.codec - audio encoder. see mediarecorder.h for details. - * vid.width - video frame width - * vid.height - video frame height - * vid.fps - video frame rate - * vid.bps - video bit rate - * aud.bps - audio bit rate - * aud.hz - audio sample rate - * aud.ch - number of audio channels - */ - int getCamcorderProfileParamByName(const char *name, int cameraId, - camcorder_quality quality) const; - - /** - * Returns true if a profile for the given camera at the given quality exists, - * or false if not. - */ - bool hasCamcorderProfile(int cameraId, camcorder_quality quality) const; - - /** - * Returns the output file formats supported. - */ - Vector getOutputFileFormats() const; - - /** - * Returns the video encoders supported. - */ - Vector getVideoEncoders() const; - - /** - * Returns the value for the given param name for the given video encoder - * returned from getVideoEncoderByIndex or -1 if error. - * - * Supported param name are: - * enc.vid.width.min - min video frame width - * enc.vid.width.max - max video frame width - * enc.vid.height.min - min video frame height - * enc.vid.height.max - max video frame height - * enc.vid.bps.min - min bit rate in bits per second - * enc.vid.bps.max - max bit rate in bits per second - * enc.vid.fps.min - min frame rate in frames per second - * enc.vid.fps.max - max frame rate in frames per second - */ - int getVideoEncoderParamByName(const char *name, video_encoder codec) const; - - /** - * Returns the value for the given param name for the video editor cap - * param or -1 if error. - * Supported param name are: - * videoeditor.input.width.max - max input video frame width - * videoeditor.input.height.max - max input video frame height - * videoeditor.output.width.max - max output video frame width - * videoeditor.output.height.max - max output video frame height - */ - int getVideoEditorCapParamByName(const char *name) const; - - /** - * Returns the value for the given param name for the video editor export codec format - * param or -1 if error. - * Supported param name are: - * videoeditor.export.profile - export video profile - * videoeditor.export.level - export video level - * Supported param codec are: - * 1 for h263 - * 2 for h264 - * 3 for mpeg4 - */ - int getVideoEditorExportParamByName(const char *name, int codec) const; - - /** - * Returns the audio encoders supported. - */ - Vector getAudioEncoders() const; - - /** - * Returns the value for the given param name for the given audio encoder - * returned from getAudioEncoderByIndex or -1 if error. - * - * Supported param name are: - * enc.aud.ch.min - min number of channels - * enc.aud.ch.max - max number of channels - * enc.aud.bps.min - min bit rate in bits per second - * enc.aud.bps.max - max bit rate in bits per second - * enc.aud.hz.min - min sample rate in samples per second - * enc.aud.hz.max - max sample rate in samples per second - */ - int getAudioEncoderParamByName(const char *name, audio_encoder codec) const; - - /** - * Returns the video decoders supported. - */ - Vector getVideoDecoders() const; - - /** - * Returns the audio decoders supported. - */ - Vector getAudioDecoders() const; - - /** - * Returns the number of image encoding quality levels supported. - */ - Vector getImageEncodingQualityLevels(int cameraId) const; - - /** - * Returns the start time offset (in ms) for the given camera Id. - * If the given camera Id does not exist, -1 will be returned. - */ - int getStartTimeOffsetMs(int cameraId) const; - -private: - enum { - // Camcorder profiles (high/low) and timelapse profiles (high/low) - kNumRequiredProfiles = 4, - }; - - MediaProfiles& operator=(const MediaProfiles&); // Don't call me - MediaProfiles(const MediaProfiles&); // Don't call me - MediaProfiles() { mVideoEditorCap = NULL; } // Dummy default constructor - ~MediaProfiles(); // Don't delete me - - struct VideoCodec { - VideoCodec(video_encoder codec, int bitRate, int frameWidth, int frameHeight, int frameRate) - : mCodec(codec), - mBitRate(bitRate), - mFrameWidth(frameWidth), - mFrameHeight(frameHeight), - mFrameRate(frameRate) {} - - VideoCodec(const VideoCodec& copy) { - mCodec = copy.mCodec; - mBitRate = copy.mBitRate; - mFrameWidth = copy.mFrameWidth; - mFrameHeight = copy.mFrameHeight; - mFrameRate = copy.mFrameRate; - } - - ~VideoCodec() {} - - video_encoder mCodec; - int mBitRate; - int mFrameWidth; - int mFrameHeight; - int mFrameRate; - }; - - struct AudioCodec { - AudioCodec(audio_encoder codec, int bitRate, int sampleRate, int channels) - : mCodec(codec), - mBitRate(bitRate), - mSampleRate(sampleRate), - mChannels(channels) {} - - AudioCodec(const AudioCodec& copy) { - mCodec = copy.mCodec; - mBitRate = copy.mBitRate; - mSampleRate = copy.mSampleRate; - mChannels = copy.mChannels; - } - - ~AudioCodec() {} - - audio_encoder mCodec; - int mBitRate; - int mSampleRate; - int mChannels; - }; - - struct CamcorderProfile { - CamcorderProfile() - : mCameraId(0), - mFileFormat(OUTPUT_FORMAT_THREE_GPP), - mQuality(CAMCORDER_QUALITY_HIGH), - mDuration(0), - mVideoCodec(0), - mAudioCodec(0) {} - - CamcorderProfile(const CamcorderProfile& copy) { - mCameraId = copy.mCameraId; - mFileFormat = copy.mFileFormat; - mQuality = copy.mQuality; - mDuration = copy.mDuration; - mVideoCodec = new VideoCodec(*copy.mVideoCodec); - mAudioCodec = new AudioCodec(*copy.mAudioCodec); - } - - ~CamcorderProfile() { - delete mVideoCodec; - delete mAudioCodec; - } - - int mCameraId; - output_format mFileFormat; - camcorder_quality mQuality; - int mDuration; - VideoCodec *mVideoCodec; - AudioCodec *mAudioCodec; - }; - - struct VideoEncoderCap { - // Ugly constructor - VideoEncoderCap(video_encoder codec, - int minBitRate, int maxBitRate, - int minFrameWidth, int maxFrameWidth, - int minFrameHeight, int maxFrameHeight, - int minFrameRate, int maxFrameRate) - : mCodec(codec), - mMinBitRate(minBitRate), mMaxBitRate(maxBitRate), - mMinFrameWidth(minFrameWidth), mMaxFrameWidth(maxFrameWidth), - mMinFrameHeight(minFrameHeight), mMaxFrameHeight(maxFrameHeight), - mMinFrameRate(minFrameRate), mMaxFrameRate(maxFrameRate) {} - - ~VideoEncoderCap() {} - - video_encoder mCodec; - int mMinBitRate, mMaxBitRate; - int mMinFrameWidth, mMaxFrameWidth; - int mMinFrameHeight, mMaxFrameHeight; - int mMinFrameRate, mMaxFrameRate; - }; - - struct AudioEncoderCap { - // Ugly constructor - AudioEncoderCap(audio_encoder codec, - int minBitRate, int maxBitRate, - int minSampleRate, int maxSampleRate, - int minChannels, int maxChannels) - : mCodec(codec), - mMinBitRate(minBitRate), mMaxBitRate(maxBitRate), - mMinSampleRate(minSampleRate), mMaxSampleRate(maxSampleRate), - mMinChannels(minChannels), mMaxChannels(maxChannels) {} - - ~AudioEncoderCap() {} - - audio_encoder mCodec; - int mMinBitRate, mMaxBitRate; - int mMinSampleRate, mMaxSampleRate; - int mMinChannels, mMaxChannels; - }; - - struct VideoDecoderCap { - VideoDecoderCap(video_decoder codec): mCodec(codec) {} - ~VideoDecoderCap() {} - - video_decoder mCodec; - }; - - struct AudioDecoderCap { - AudioDecoderCap(audio_decoder codec): mCodec(codec) {} - ~AudioDecoderCap() {} - - audio_decoder mCodec; - }; - - struct NameToTagMap { - const char* name; - int tag; - }; - - struct ImageEncodingQualityLevels { - int mCameraId; - Vector mLevels; - }; - struct ExportVideoProfile { - ExportVideoProfile(int codec, int profile, int level) - :mCodec(codec),mProfile(profile),mLevel(level) {} - ~ExportVideoProfile() {} - int mCodec; - int mProfile; - int mLevel; - }; - struct VideoEditorCap { - VideoEditorCap(int inFrameWidth, int inFrameHeight, - int outFrameWidth, int outFrameHeight) - : mMaxInputFrameWidth(inFrameWidth), - mMaxInputFrameHeight(inFrameHeight), - mMaxOutputFrameWidth(outFrameWidth), - mMaxOutputFrameHeight(outFrameHeight) {} - - ~VideoEditorCap() {} - - int mMaxInputFrameWidth; - int mMaxInputFrameHeight; - int mMaxOutputFrameWidth; - int mMaxOutputFrameHeight; - }; - - int getCamcorderProfileIndex(int cameraId, camcorder_quality quality) const; - void initRequiredProfileRefs(const Vector& cameraIds); - int getRequiredProfileRefIndex(int cameraId); - - // Debug - static void logVideoCodec(const VideoCodec& codec); - static void logAudioCodec(const AudioCodec& codec); - static void logVideoEncoderCap(const VideoEncoderCap& cap); - static void logAudioEncoderCap(const AudioEncoderCap& cap); - static void logVideoDecoderCap(const VideoDecoderCap& cap); - static void logAudioDecoderCap(const AudioDecoderCap& cap); - static void logVideoEditorCap(const VideoEditorCap& cap); - - // If the xml configuration file does exist, use the settings - // from the xml - static MediaProfiles* createInstanceFromXmlFile(const char *xml); - static output_format createEncoderOutputFileFormat(const char **atts); - static VideoCodec* createVideoCodec(const char **atts, MediaProfiles *profiles); - static AudioCodec* createAudioCodec(const char **atts, MediaProfiles *profiles); - static AudioDecoderCap* createAudioDecoderCap(const char **atts); - static VideoDecoderCap* createVideoDecoderCap(const char **atts); - static VideoEncoderCap* createVideoEncoderCap(const char **atts); - static AudioEncoderCap* createAudioEncoderCap(const char **atts); - static VideoEditorCap* createVideoEditorCap( - const char **atts, MediaProfiles *profiles); - static ExportVideoProfile* createExportVideoProfile(const char **atts); - - static CamcorderProfile* createCamcorderProfile( - int cameraId, const char **atts, Vector& cameraIds); - - static int getCameraId(const char **atts); - - void addStartTimeOffset(int cameraId, const char **atts); - - ImageEncodingQualityLevels* findImageEncodingQualityLevels(int cameraId) const; - void addImageEncodingQualityLevel(int cameraId, const char** atts); - - // Customized element tag handler for parsing the xml configuration file. - static void startElementHandler(void *userData, const char *name, const char **atts); - - // If the xml configuration file does not exist, use hard-coded values - static MediaProfiles* createDefaultInstance(); - - static CamcorderProfile *createDefaultCamcorderQcifProfile(camcorder_quality quality); - static CamcorderProfile *createDefaultCamcorderCifProfile(camcorder_quality quality); - static void createDefaultCamcorderLowProfiles( - MediaProfiles::CamcorderProfile **lowProfile, - MediaProfiles::CamcorderProfile **lowSpecificProfile); - static void createDefaultCamcorderHighProfiles( - MediaProfiles::CamcorderProfile **highProfile, - MediaProfiles::CamcorderProfile **highSpecificProfile); - - static CamcorderProfile *createDefaultCamcorderTimeLapseQcifProfile(camcorder_quality quality); - static CamcorderProfile *createDefaultCamcorderTimeLapse480pProfile(camcorder_quality quality); - static void createDefaultCamcorderTimeLapseLowProfiles( - MediaProfiles::CamcorderProfile **lowTimeLapseProfile, - MediaProfiles::CamcorderProfile **lowSpecificTimeLapseProfile); - static void createDefaultCamcorderTimeLapseHighProfiles( - MediaProfiles::CamcorderProfile **highTimeLapseProfile, - MediaProfiles::CamcorderProfile **highSpecificTimeLapseProfile); - - static void createDefaultCamcorderProfiles(MediaProfiles *profiles); - static void createDefaultVideoEncoders(MediaProfiles *profiles); - static void createDefaultAudioEncoders(MediaProfiles *profiles); - static void createDefaultVideoDecoders(MediaProfiles *profiles); - static void createDefaultAudioDecoders(MediaProfiles *profiles); - static void createDefaultEncoderOutputFileFormats(MediaProfiles *profiles); - static void createDefaultImageEncodingQualityLevels(MediaProfiles *profiles); - static void createDefaultImageDecodingMaxMemory(MediaProfiles *profiles); - static void createDefaultVideoEditorCap(MediaProfiles *profiles); - static void createDefaultExportVideoProfiles(MediaProfiles *profiles); - - static VideoEncoderCap* createDefaultH263VideoEncoderCap(); - static VideoEncoderCap* createDefaultM4vVideoEncoderCap(); - static AudioEncoderCap* createDefaultAmrNBEncoderCap(); - - static int findTagForName(const NameToTagMap *map, size_t nMappings, const char *name); - - /** - * Check on existing profiles with the following criteria: - * 1. Low quality profile must have the lowest video - * resolution product (width x height) - * 2. High quality profile must have the highest video - * resolution product (width x height) - * - * and add required low/high quality camcorder/timelapse - * profiles if they are not found. This allows to remove - * duplicate profile definitions in the media_profiles.xml - * file. - */ - void checkAndAddRequiredProfilesIfNecessary(); - - - // Mappings from name (for instance, codec name) to enum value - static const NameToTagMap sVideoEncoderNameMap[]; - static const NameToTagMap sAudioEncoderNameMap[]; - static const NameToTagMap sFileFormatMap[]; - static const NameToTagMap sVideoDecoderNameMap[]; - static const NameToTagMap sAudioDecoderNameMap[]; - static const NameToTagMap sCamcorderQualityNameMap[]; - - static bool sIsInitialized; - static MediaProfiles *sInstance; - static Mutex sLock; - int mCurrentCameraId; - - Vector mCamcorderProfiles; - Vector mAudioEncoders; - Vector mVideoEncoders; - Vector mAudioDecoders; - Vector mVideoDecoders; - Vector mEncoderOutputFileFormats; - Vector mImageEncodingQualityLevels; - KeyedVector mStartTimeOffsets; - - typedef struct { - bool mHasRefProfile; // Refers to an existing profile - int mRefProfileIndex; // Reference profile index - int mResolutionProduct; // width x height - } RequiredProfileRefInfo; // Required low and high profiles - - typedef struct { - RequiredProfileRefInfo mRefs[kNumRequiredProfiles]; - int mCameraId; - } RequiredProfiles; - - RequiredProfiles *mRequiredProfileRefs; - Vector mCameraIds; - VideoEditorCap* mVideoEditorCap; - Vector mVideoEditorExportProfiles; -}; - -}; // namespace android - -#endif // ANDROID_MEDIAPROFILES_H - diff --git a/external/android/include/14/frameworks/base/include/media/MediaRecorderBase.h b/external/android/include/14/frameworks/base/include/media/MediaRecorderBase.h deleted file mode 100644 index ef799f5..0000000 --- a/external/android/include/14/frameworks/base/include/media/MediaRecorderBase.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 MEDIA_RECORDER_BASE_H_ - -#define MEDIA_RECORDER_BASE_H_ - -#include - -#include - -namespace android { - -class ICameraRecordingProxy; -class Surface; -class ISurfaceTexture; - -struct MediaRecorderBase { - MediaRecorderBase() {} - virtual ~MediaRecorderBase() {} - - virtual status_t init() = 0; - virtual status_t setAudioSource(audio_source_t as) = 0; - virtual status_t setVideoSource(video_source vs) = 0; - virtual status_t setOutputFormat(output_format of) = 0; - virtual status_t setAudioEncoder(audio_encoder ae) = 0; - virtual status_t setVideoEncoder(video_encoder ve) = 0; - virtual status_t setVideoSize(int width, int height) = 0; - virtual status_t setVideoFrameRate(int frames_per_second) = 0; - virtual status_t setCamera(const sp& camera, - const sp& proxy) = 0; - virtual status_t setPreviewSurface(const sp& surface) = 0; - virtual status_t setOutputFile(const char *path) = 0; - virtual status_t setOutputFile(int fd, int64_t offset, int64_t length) = 0; - virtual status_t setOutputFileAuxiliary(int fd) {return INVALID_OPERATION;} - virtual status_t setParameters(const String8& params) = 0; - virtual status_t setListener(const sp& listener) = 0; - virtual status_t prepare() = 0; - virtual status_t start() = 0; - virtual status_t stop() = 0; - virtual status_t close() = 0; - virtual status_t reset() = 0; - virtual status_t getMaxAmplitude(int *max) = 0; - virtual status_t dump(int fd, const Vector& args) const = 0; - virtual sp querySurfaceMediaSource() const = 0; - -private: - MediaRecorderBase(const MediaRecorderBase &); - MediaRecorderBase &operator=(const MediaRecorderBase &); -}; - -} // namespace android - -#endif // MEDIA_RECORDER_BASE_H_ diff --git a/external/android/include/14/frameworks/base/include/media/MemoryLeakTrackUtil.h b/external/android/include/14/frameworks/base/include/media/MemoryLeakTrackUtil.h deleted file mode 100644 index 290b748..0000000 --- a/external/android/include/14/frameworks/base/include/media/MemoryLeakTrackUtil.h +++ /dev/null @@ -1,28 +0,0 @@ - -/* - * Copyright 2011, 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 MEMORY_LEAK_TRACK_UTIL_H -#define MEMORY_LEAK_TRACK_UTIL_H - -namespace android { -/* - * Dump the memory adddress of the calling process to the given fd. - */ -extern void dumpMemoryAddresses(int fd); - -}; - -#endif // MEMORY_LEAK_TRACK_UTIL_H diff --git a/external/android/include/14/frameworks/base/include/media/Metadata.h b/external/android/include/14/frameworks/base/include/media/Metadata.h deleted file mode 100644 index 07567eb..0000000 --- a/external/android/include/14/frameworks/base/include/media/Metadata.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 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_MEDIA_METADATA_H__ -#define ANDROID_MEDIA_METADATA_H__ - -#include -#include -#include -#include - -namespace android { -class Parcel; - -namespace media { - -// Metadata is a class to build/serialize a set of metadata in a Parcel. -// -// This class should be kept in sync with android/media/Metadata.java. -// It provides all the metadata ids available and methods to build the -// header, add records and adjust the set size header field. -// -// Typical Usage: -// ============== -// Parcel p; -// media::Metadata data(&p); -// -// data.appendHeader(); -// data.appendBool(Metadata::kPauseAvailable, true); -// ... more append ... -// data.updateLength(); -// - -class Metadata { - public: - typedef int32_t Type; - typedef SortedVector Filter; - - static const Type kAny = 0; - - // Playback capabilities. - static const Type kPauseAvailable = 1; // Boolean - static const Type kSeekBackwardAvailable = 2; // Boolean - static const Type kSeekForwardAvailable = 3; // Boolean - static const Type kSeekAvailable = 4; // Boolean - - // Keep in sync with android/media/Metadata.java - static const Type kTitle = 5; // String - static const Type kComment = 6; // String - static const Type kCopyright = 7; // String - static const Type kAlbum = 8; // String - static const Type kArtist = 9; // String - static const Type kAuthor = 10; // String - static const Type kComposer = 11; // String - static const Type kGenre = 12; // String - static const Type kDate = 13; // Date - static const Type kDuration = 14; // Integer(millisec) - static const Type kCdTrackNum = 15; // Integer 1-based - static const Type kCdTrackMax = 16; // Integer - static const Type kRating = 17; // String - static const Type kAlbumArt = 18; // byte[] - static const Type kVideoFrame = 19; // Bitmap - - static const Type kBitRate = 20; // Integer, Aggregate rate of - // all the streams in bps. - - static const Type kAudioBitRate = 21; // Integer, bps - static const Type kVideoBitRate = 22; // Integer, bps - static const Type kAudioSampleRate = 23; // Integer, Hz - static const Type kVideoframeRate = 24; // Integer, Hz - - // See RFC2046 and RFC4281. - static const Type kMimeType = 25; // String - static const Type kAudioCodec = 26; // String - static const Type kVideoCodec = 27; // String - - static const Type kVideoHeight = 28; // Integer - static const Type kVideoWidth = 29; // Integer - static const Type kNumTracks = 30; // Integer - static const Type kDrmCrippled = 31; // Boolean - - // @param p[inout] The parcel to append the metadata records - // to. The global metadata header should have been set already. - explicit Metadata(Parcel *p); - ~Metadata(); - - // Rewind the underlying parcel, undoing all the changes. - void resetParcel(); - - // Append the size and 'META' marker. - bool appendHeader(); - - // Once all the records have been added, call this to update the - // lenght field in the header. - void updateLength(); - - // append* are methods to append metadata. - // @param key Is the metadata Id. - // @param val Is the value of the metadata. - // @return true if successful, false otherwise. - // TODO: add more as needed to handle other types. - bool appendBool(Type key, bool val); - bool appendInt32(Type key, int32_t val); - - private: - Metadata(const Metadata&); - Metadata& operator=(const Metadata&); - - - // Checks the key is valid and not already present. - bool checkKey(Type key); - - Parcel *mData; - size_t mBegin; -}; - -} // namespace android::media -} // namespace android - -#endif // ANDROID_MEDIA_METADATA_H__ diff --git a/external/android/include/14/frameworks/base/include/media/ToneGenerator.h b/external/android/include/14/frameworks/base/include/media/ToneGenerator.h deleted file mode 100644 index 1ad1f26..0000000 --- a/external/android/include/14/frameworks/base/include/media/ToneGenerator.h +++ /dev/null @@ -1,313 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_TONEGENERATOR_H_ -#define ANDROID_TONEGENERATOR_H_ - -#include -#include -#include -#include -#include - -namespace android { - -class ToneGenerator { -public: - - // List of all available tones - // This enum must be kept consistant with constants in ToneGenerator JAVA class - enum tone_type { - // DTMF tones ITU-T Recommendation Q.23 - TONE_DTMF_0 = 0, // 0 key: 1336Hz, 941Hz - TONE_DTMF_1, // 1 key: 1209Hz, 697Hz - TONE_DTMF_2, // 2 key: 1336Hz, 697Hz - TONE_DTMF_3, // 3 key: 1477Hz, 697Hz - TONE_DTMF_4, // 4 key: 1209Hz, 770Hz - TONE_DTMF_5, // 5 key: 1336Hz, 770Hz - TONE_DTMF_6, // 6 key: 1477Hz, 770Hz - TONE_DTMF_7, // 7 key: 1209Hz, 852Hz - TONE_DTMF_8, // 8 key: 1336Hz, 852Hz - TONE_DTMF_9, // 9 key: 1477Hz, 852Hz - TONE_DTMF_S, // * key: 1209Hz, 941Hz - TONE_DTMF_P, // # key: 1477Hz, 941Hz - TONE_DTMF_A, // A key: 1633Hz, 697Hz - TONE_DTMF_B, // B key: 1633Hz, 770Hz - TONE_DTMF_C, // C key: 1633Hz, 852Hz - TONE_DTMF_D, // D key: 1633Hz, 941Hz - // Call supervisory tones: 3GPP TS 22.001 (CEPT) - TONE_SUP_DIAL, // Dial tone: CEPT: 425Hz, continuous - FIRST_SUP_TONE = TONE_SUP_DIAL, - TONE_SUP_BUSY, // Busy tone, CEPT: 425Hz, 500ms ON, 500ms OFF... - TONE_SUP_CONGESTION, // Congestion tone CEPT, JAPAN: 425Hz, 200ms ON, 200ms OFF... - TONE_SUP_RADIO_ACK, // Radio path acknowlegment, CEPT, ANSI: 425Hz, 200ms ON - TONE_SUP_RADIO_NOTAVAIL, // Radio path not available: 425Hz, 200ms ON, 200 OFF 3 bursts - TONE_SUP_ERROR, // Error/Special info: 950Hz+1400Hz+1800Hz, 330ms ON, 1s OFF... - TONE_SUP_CALL_WAITING, // Call Waiting CEPT,JAPAN: 425Hz, 200ms ON, 600ms OFF, 200ms ON, 3s OFF... - TONE_SUP_RINGTONE, // Ring Tone CEPT, JAPAN: 425Hz, 1s ON, 4s OFF... - LAST_SUP_TONE = TONE_SUP_RINGTONE, - // Proprietary tones: 3GPP TS 31.111 - TONE_PROP_BEEP, // General beep: 400Hz+1200Hz, 35ms ON - TONE_PROP_ACK, // Positive Acknowlgement: 1200Hz, 100ms ON, 100ms OFF 2 bursts - TONE_PROP_NACK, // Negative Acknowlgement: 300Hz+400Hz+500Hz, 400ms ON - TONE_PROP_PROMPT, // Prompt tone: 400Hz+1200Hz, 200ms ON - TONE_PROP_BEEP2, // General double beep: 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms on - // Additional call supervisory tones: specified by IS-95 only - TONE_SUP_INTERCEPT, // Intercept tone: alternating 440 Hz and 620 Hz tones, each on for 250 ms. - TONE_SUP_INTERCEPT_ABBREV, // Abbreviated intercept: intercept tone limited to 4 seconds - TONE_SUP_CONGESTION_ABBREV, // Abbreviated congestion: congestion tone limited to 4 seconds - TONE_SUP_CONFIRM, // Confirm tone: a 350 Hz tone added to a 440 Hz tone repeated 3 times in a 100 ms on, 100 ms off cycle. - TONE_SUP_PIP, // Pip tone: four bursts of 480 Hz tone (0.1 s on, 0.1 s off). - - // CDMA Tones - TONE_CDMA_DIAL_TONE_LITE, - TONE_CDMA_NETWORK_USA_RINGBACK, - TONE_CDMA_INTERCEPT, - TONE_CDMA_ABBR_INTERCEPT, - TONE_CDMA_REORDER, - TONE_CDMA_ABBR_REORDER, - TONE_CDMA_NETWORK_BUSY, - TONE_CDMA_CONFIRM, - TONE_CDMA_ANSWER, - TONE_CDMA_NETWORK_CALLWAITING, - TONE_CDMA_PIP, - - // ISDN - TONE_CDMA_CALL_SIGNAL_ISDN_NORMAL, // ISDN Alert Normal - TONE_CDMA_CALL_SIGNAL_ISDN_INTERGROUP, // ISDN Intergroup - TONE_CDMA_CALL_SIGNAL_ISDN_SP_PRI, // ISDN SP PRI - TONE_CDMA_CALL_SIGNAL_ISDN_PAT3, // ISDN Alert PAT3 - TONE_CDMA_CALL_SIGNAL_ISDN_PING_RING, // ISDN Alert PING RING - TONE_CDMA_CALL_SIGNAL_ISDN_PAT5, // ISDN Alert PAT5 - TONE_CDMA_CALL_SIGNAL_ISDN_PAT6, // ISDN Alert PAT6 - TONE_CDMA_CALL_SIGNAL_ISDN_PAT7, // ISDN Alert PAT7 - // ISDN end - - // IS54 - TONE_CDMA_HIGH_L, // IS54 High Pitch Long - TONE_CDMA_MED_L, // IS54 Med Pitch Long - TONE_CDMA_LOW_L, // IS54 Low Pitch Long - TONE_CDMA_HIGH_SS, // IS54 High Pitch Short Short - TONE_CDMA_MED_SS, // IS54 Medium Pitch Short Short - TONE_CDMA_LOW_SS, // IS54 Low Pitch Short Short - TONE_CDMA_HIGH_SSL, // IS54 High Pitch Short Short Long - TONE_CDMA_MED_SSL, // IS54 Medium Pitch Short Short Long - TONE_CDMA_LOW_SSL, // IS54 Low Pitch Short Short Long - TONE_CDMA_HIGH_SS_2, // IS54 High Pitch Short Short 2 - TONE_CDMA_MED_SS_2, // IS54 Med Pitch Short Short 2 - TONE_CDMA_LOW_SS_2, // IS54 Low Pitch Short Short 2 - TONE_CDMA_HIGH_SLS, // IS54 High Pitch Short Long Short - TONE_CDMA_MED_SLS, // IS54 Med Pitch Short Long Short - TONE_CDMA_LOW_SLS, // IS54 Low Pitch Short Long Short - TONE_CDMA_HIGH_S_X4, // IS54 High Pitch Short Short Short Short - TONE_CDMA_MED_S_X4, // IS54 Med Pitch Short Short Short Short - TONE_CDMA_LOW_S_X4, // IS54 Low Pitch Short Short Short Short - TONE_CDMA_HIGH_PBX_L, // PBX High Pitch Long - TONE_CDMA_MED_PBX_L, // PBX Med Pitch Long - TONE_CDMA_LOW_PBX_L, // PBX Low Pitch Long - TONE_CDMA_HIGH_PBX_SS, // PBX High Short Short - TONE_CDMA_MED_PBX_SS, // PBX Med Short Short - TONE_CDMA_LOW_PBX_SS, // PBX Low Short Short - TONE_CDMA_HIGH_PBX_SSL, // PBX High Short Short Long - TONE_CDMA_MED_PBX_SSL, // PBX Med Short Short Long - TONE_CDMA_LOW_PBX_SSL, // PBX Low Short Short Long - TONE_CDMA_HIGH_PBX_SLS, // PBX High SLS - TONE_CDMA_MED_PBX_SLS, // PBX Med SLS - TONE_CDMA_LOW_PBX_SLS, // PBX Low SLS - TONE_CDMA_HIGH_PBX_S_X4, // PBX High SSSS - TONE_CDMA_MED_PBX_S_X4, // PBX Med SSSS - TONE_CDMA_LOW_PBX_S_X4, // PBX LOW SSSS - //IS54 end - // proprietary - TONE_CDMA_ALERT_NETWORK_LITE, - TONE_CDMA_ALERT_AUTOREDIAL_LITE, - TONE_CDMA_ONE_MIN_BEEP, - TONE_CDMA_KEYPAD_VOLUME_KEY_LITE, - TONE_CDMA_PRESSHOLDKEY_LITE, - TONE_CDMA_ALERT_INCALL_LITE, - TONE_CDMA_EMERGENCY_RINGBACK, - TONE_CDMA_ALERT_CALL_GUARD, - TONE_CDMA_SOFT_ERROR_LITE, - TONE_CDMA_CALLDROP_LITE, - // proprietary end - TONE_CDMA_NETWORK_BUSY_ONE_SHOT, - TONE_CDMA_ABBR_ALERT, - TONE_CDMA_SIGNAL_OFF, - //CDMA end - NUM_TONES, - NUM_SUP_TONES = LAST_SUP_TONE-FIRST_SUP_TONE+1 - }; - - ToneGenerator(int streamType, float volume, bool threadCanCallJava = false); - ~ToneGenerator(); - - bool startTone(int toneType, int durationMs = -1); - void stopTone(); - - bool isInited() { return (mState == TONE_IDLE)?false:true;} - -private: - - enum tone_state { - TONE_IDLE, // ToneGenerator is being initialized or initialization failed - TONE_INIT, // ToneGenerator has been successfully initialized and is not playing - TONE_STARTING, // ToneGenerator is starting playing - TONE_PLAYING, // ToneGenerator is playing - TONE_STOPPING, // ToneGenerator is stoping - TONE_STOPPED, // ToneGenerator is stopped: the AudioTrack will be stopped - TONE_RESTARTING // A start request was received in active state (playing or stopping) - }; - - - // Region specific tones. - // These supervisory tones are different depending on the region (USA/CANADA, JAPAN, rest of the world). - // When a tone in the range [FIRST_SUP_TONE, LAST_SUP_TONE] is requested, the region is determined - // from system property gsm.operator.iso-country and the proper tone descriptor is selected with the - // help of sToneMappingTable[] - enum regional_tone_type { - // ANSI supervisory tones - TONE_ANSI_DIAL = NUM_TONES, // Dial tone: a continuous 350 Hz + 440 Hz tone. - TONE_ANSI_BUSY, // Busy tone on: a 480 Hz + 620 Hz tone repeated in a 500 ms on, 500 ms off cycle. - TONE_ANSI_CONGESTION, // Network congestion (reorder) tone on: a 480 Hz + 620 Hz tone repeated in a 250 ms on, 250 ms off cycle. - TONE_ANSI_CALL_WAITING, // Call waiting tone on: 440 Hz, on for 300 ms, 9,7 s off followed by - // (440 Hz, on for 100 ms off for 100 ms, on for 100 ms, 9,7s off and repeated as necessary). - TONE_ANSI_RINGTONE, // Ring Tone: a 440 Hz + 480 Hz tone repeated in a 2 s on, 4 s off pattern. - // JAPAN Supervisory tones - TONE_JAPAN_DIAL, // Dial tone: 400Hz, continuous - TONE_JAPAN_BUSY, // Busy tone: 400Hz, 500ms ON, 500ms OFF... - TONE_JAPAN_RADIO_ACK, // Radio path acknowlegment: 400Hz, 1s ON, 2s OFF... - NUM_ALTERNATE_TONES - }; - - enum region { - ANSI, - JAPAN, - CEPT, - NUM_REGIONS - }; - - static const unsigned char sToneMappingTable[NUM_REGIONS-1][NUM_SUP_TONES]; - - static const unsigned int TONEGEN_MAX_WAVES = 3; // Maximun number of sine waves in a tone segment - static const unsigned int TONEGEN_MAX_SEGMENTS = 12; // Maximun number of segments in a tone descriptor - static const unsigned int TONEGEN_INF = 0xFFFFFFFF; // Represents infinite time duration - static const float TONEGEN_GAIN = 0.9; // Default gain passed to WaveGenerator(). - - // ToneDescriptor class contains all parameters needed to generate a tone: - // - The array waveFreq[]: - // 1 for static tone descriptors: contains the frequencies of all individual waves making the multi-tone. - // 2 for active tone descritors: contains the indexes of the WaveGenerator objects in mWaveGens - // The number of sine waves varies from 1 to TONEGEN_MAX_WAVES. - // The first null value indicates that no more waves are needed. - // - The array segments[] is used to generate the tone pulses. A segment is a period of time - // during which the tone is ON or OFF. Segments with even index (starting from 0) - // correspond to tone ON state and segments with odd index to OFF state. - // The data stored in segments[] is the duration of the corresponding period in ms. - // The first segment encountered with a 0 duration indicates that no more segment follows. - // - loopCnt - Number of times to repeat a sequence of seqments after playing this - // - loopIndx - The segment index to go back and play is loopcnt > 0 - // - repeatCnt indicates the number of times the sequence described by segments[] array must be repeated. - // When the tone generator encounters the first 0 duration segment, it will compare repeatCnt to mCurCount. - // If mCurCount > repeatCnt, the tone is stopped automatically. Otherwise, tone sequence will be - // restarted from segment repeatSegment. - // - repeatSegment number of the first repeated segment when repeatCnt is not null - - class ToneSegment { - public: - unsigned int duration; - unsigned short waveFreq[TONEGEN_MAX_WAVES+1]; - unsigned short loopCnt; - unsigned short loopIndx; - }; - - class ToneDescriptor { - public: - ToneSegment segments[TONEGEN_MAX_SEGMENTS+1]; - unsigned long repeatCnt; - unsigned long repeatSegment; - }; - - static const ToneDescriptor sToneDescriptors[]; - - bool mThreadCanCallJava; - unsigned int mTotalSmp; // Total number of audio samples played (gives current time) - unsigned int mNextSegSmp; // Position of next segment transition expressed in samples - // NOTE: because mTotalSmp, mNextSegSmp are stored on 32 bit, current design will operate properly - // only if tone duration is less than about 27 Hours(@44100Hz sampling rate). If this time is exceeded, - // no crash will occur but tone sequence will show a glitch. - unsigned int mMaxSmp; // Maximum number of audio samples played (maximun tone duration) - int mDurationMs; // Maximum tone duration in ms - - unsigned short mCurSegment; // Current segment index in ToneDescriptor segments[] - unsigned short mCurCount; // Current sequence repeat count - volatile unsigned short mState; // ToneGenerator state (tone_state) - unsigned short mRegion; - const ToneDescriptor *mpToneDesc; // pointer to active tone descriptor - const ToneDescriptor *mpNewToneDesc; // pointer to next active tone descriptor - - unsigned short mLoopCounter; // Current tone loopback count - - int mSamplingRate; // AudioFlinger Sampling rate - AudioTrack *mpAudioTrack; // Pointer to audio track used for playback - Mutex mLock; // Mutex to control concurent access to ToneGenerator object from audio callback and application API - Mutex mCbkCondLock; // Mutex associated to mWaitCbkCond - Condition mWaitCbkCond; // condition enabling interface to wait for audio callback completion after a change is requested - float mVolume; // Volume applied to audio track - int mStreamType; // Audio stream used for output - unsigned int mProcessSize; // Size of audio blocks generated at a time by audioCallback() (in PCM frames). - - bool initAudioTrack(); - static void audioCallback(int event, void* user, void *info); - bool prepareWave(); - unsigned int numWaves(unsigned int segmentIdx); - void clearWaveGens(); - int getToneForRegion(int toneType); - - // WaveGenerator generates a single sine wave - class WaveGenerator { - public: - enum gen_command { - WAVEGEN_START, // Start/restart wave from phase 0 - WAVEGEN_CONT, // Continue wave from current phase - WAVEGEN_STOP // Stop wave on zero crossing - }; - - WaveGenerator(unsigned short samplingRate, unsigned short frequency, - float volume); - ~WaveGenerator(); - - void getSamples(short *outBuffer, unsigned int count, - unsigned int command); - - private: - static const short GEN_AMP = 32000; // amplitude of generator - static const short S_Q14 = 14; // shift for Q14 - static const short S_Q15 = 15; // shift for Q15 - - short mA1_Q14; // Q14 coefficient - // delay line of full amplitude generator - short mS1, mS2; // delay line S2 oldest - short mS2_0; // saved value for reinitialisation - short mAmplitude_Q15; // Q15 amplitude - }; - - KeyedVector mWaveGens; // list of active wave generators. -}; - -} -; // namespace android - -#endif /*ANDROID_TONEGENERATOR_H_*/ diff --git a/external/android/include/14/frameworks/base/include/media/Visualizer.h b/external/android/include/14/frameworks/base/include/media/Visualizer.h deleted file mode 100644 index 5d2c874..0000000 --- a/external/android/include/14/frameworks/base/include/media/Visualizer.h +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (C) 2010 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_MEDIA_VISUALIZER_H -#define ANDROID_MEDIA_VISUALIZER_H - -#include -#include -#include - -/** - * The Visualizer class enables application to retrieve part of the currently playing audio for - * visualization purpose. It is not an audio recording interface and only returns partial and low - * quality audio content. However, to protect privacy of certain audio data (e.g voice mail) the use - * of the visualizer requires the permission android.permission.RECORD_AUDIO. - * The audio session ID passed to the constructor indicates which audio content should be - * visualized: - * - If the session is 0, the audio output mix is visualized - * - If the session is not 0, the audio from a particular MediaPlayer or AudioTrack - * using this audio session is visualized - * Two types of representation of audio content can be captured: - * - Waveform data: consecutive 8-bit (unsigned) mono samples by using the getWaveForm() method - * - Frequency data: 8-bit magnitude FFT by using the getFft() method - * - * The length of the capture can be retrieved or specified by calling respectively - * getCaptureSize() and setCaptureSize() methods. Note that the size of the FFT - * is half of the specified capture size but both sides of the spectrum are returned yielding in a - * number of bytes equal to the capture size. The capture size must be a power of 2 in the range - * returned by getMinCaptureSize() and getMaxCaptureSize(). - * In addition to the polling capture mode, a callback mode is also available by installing a - * callback function by use of the setCaptureCallBack() method. The rate at which the callback - * is called as well as the type of data returned is specified. - * Before capturing data, the Visualizer must be enabled by calling the setEnabled() method. - * When data capture is not needed any more, the Visualizer should be disabled. - */ - - -namespace android { - -// ---------------------------------------------------------------------------- - -class Visualizer: public AudioEffect { -public: - - enum callback_flags { - CAPTURE_WAVEFORM = 0x00000001, // capture callback returns a PCM wave form - CAPTURE_FFT = 0x00000002, // apture callback returns a frequency representation - CAPTURE_CALL_JAVA = 0x00000004 // the callback thread can call java - }; - - - /* Constructor. - * See AudioEffect constructor for details on parameters. - */ - Visualizer(int32_t priority = 0, - effect_callback_t cbf = 0, - void* user = 0, - int sessionId = 0); - - ~Visualizer(); - - virtual status_t setEnabled(bool enabled); - - // maximum capture size in samples - static uint32_t getMaxCaptureSize() { return VISUALIZER_CAPTURE_SIZE_MAX; } - // minimum capture size in samples - static uint32_t getMinCaptureSize() { return VISUALIZER_CAPTURE_SIZE_MIN; } - // maximum capture rate in millihertz - static uint32_t getMaxCaptureRate() { return CAPTURE_RATE_MAX; } - - // callback used to return periodic PCM or FFT captures to the application. Either one or both - // types of data are returned (PCM and FFT) according to flags indicated when installing the - // callback. When a type of data is not present, the corresponding size (waveformSize or - // fftSize) is 0. - typedef void (*capture_cbk_t)(void* user, - uint32_t waveformSize, - uint8_t *waveform, - uint32_t fftSize, - uint8_t *fft, - uint32_t samplingrate); - - // install a callback to receive periodic captures. The capture rate is specified in milliHertz - // and the capture format is according to flags (see callback_flags). - status_t setCaptureCallBack(capture_cbk_t cbk, void* user, uint32_t flags, uint32_t rate); - - // set the capture size capture size must be a power of two in the range - // [VISUALIZER_CAPTURE_SIZE_MAX. VISUALIZER_CAPTURE_SIZE_MIN] - // must be called when the visualizer is not enabled - status_t setCaptureSize(uint32_t size); - uint32_t getCaptureSize() { return mCaptureSize; } - - // returns the capture rate indicated when installing the callback - uint32_t getCaptureRate() { return mCaptureRate; } - - // returns the sampling rate of the audio being captured - uint32_t getSamplingRate() { return mSampleRate; } - - // return a capture in PCM 8 bit unsigned format. The size of the capture is equal to - // getCaptureSize() - status_t getWaveForm(uint8_t *waveform); - - // return a capture in FFT 8 bit signed format. The size of the capture is equal to - // getCaptureSize() but the length of the FFT is half of the size (both parts of the spectrum - // are returned - status_t getFft(uint8_t *fft); - -private: - - static const uint32_t CAPTURE_RATE_MAX = 20000; - static const uint32_t CAPTURE_RATE_DEF = 10000; - static const uint32_t CAPTURE_SIZE_DEF = VISUALIZER_CAPTURE_SIZE_MAX; - - /* internal class to handle the callback */ - class CaptureThread : public Thread - { - public: - CaptureThread(Visualizer& receiver, uint32_t captureRate, bool bCanCallJava = false); - - private: - friend class Visualizer; - virtual bool threadLoop(); - virtual status_t readyToRun(); - virtual void onFirstRef(); - Visualizer& mReceiver; - Mutex mLock; - uint32_t mSleepTimeUs; - }; - - status_t doFft(uint8_t *fft, uint8_t *waveform); - void periodicCapture(); - uint32_t initCaptureSize(); - - Mutex mLock; - uint32_t mCaptureRate; - uint32_t mCaptureSize; - uint32_t mSampleRate; - capture_cbk_t mCaptureCallBack; - void *mCaptureCbkUser; - sp mCaptureThread; - uint32_t mCaptureFlags; -}; - - -}; // namespace android - -#endif // ANDROID_MEDIA_VISUALIZER_H diff --git a/external/android/include/14/frameworks/base/include/media/mediametadataretriever.h b/external/android/include/14/frameworks/base/include/media/mediametadataretriever.h deleted file mode 100644 index 9aa6700..0000000 --- a/external/android/include/14/frameworks/base/include/media/mediametadataretriever.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * 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. - */ - - -#ifndef MEDIAMETADATARETRIEVER_H -#define MEDIAMETADATARETRIEVER_H - -#include // for status_t -#include -#include -#include - -namespace android { - -class IMediaPlayerService; -class IMediaMetadataRetriever; - -// Keep these in synch with the constants defined in MediaMetadataRetriever.java -// class. -enum { - METADATA_KEY_CD_TRACK_NUMBER = 0, - METADATA_KEY_ALBUM = 1, - METADATA_KEY_ARTIST = 2, - METADATA_KEY_AUTHOR = 3, - METADATA_KEY_COMPOSER = 4, - METADATA_KEY_DATE = 5, - METADATA_KEY_GENRE = 6, - METADATA_KEY_TITLE = 7, - METADATA_KEY_YEAR = 8, - METADATA_KEY_DURATION = 9, - METADATA_KEY_NUM_TRACKS = 10, - METADATA_KEY_WRITER = 11, - METADATA_KEY_MIMETYPE = 12, - METADATA_KEY_ALBUMARTIST = 13, - METADATA_KEY_DISC_NUMBER = 14, - METADATA_KEY_COMPILATION = 15, - METADATA_KEY_HAS_AUDIO = 16, - METADATA_KEY_HAS_VIDEO = 17, - METADATA_KEY_VIDEO_WIDTH = 18, - METADATA_KEY_VIDEO_HEIGHT = 19, - METADATA_KEY_BITRATE = 20, - METADATA_KEY_TIMED_TEXT_LANGUAGES = 21, - METADATA_KEY_IS_DRM = 22, - - // Add more here... -}; - -class MediaMetadataRetriever: public RefBase -{ -public: - MediaMetadataRetriever(); - ~MediaMetadataRetriever(); - void disconnect(); - - status_t setDataSource( - const char *dataSourceUrl, - const KeyedVector *headers = NULL); - - status_t setDataSource(int fd, int64_t offset, int64_t length); - sp getFrameAtTime(int64_t timeUs, int option); - sp extractAlbumArt(); - const char* extractMetadata(int keyCode); - -private: - static const sp& getService(); - - class DeathNotifier: public IBinder::DeathRecipient - { - public: - DeathNotifier() {} - virtual ~DeathNotifier(); - virtual void binderDied(const wp& who); - }; - - static sp sDeathNotifier; - static Mutex sServiceLock; - static sp sService; - - Mutex mLock; - sp mRetriever; - -}; - -}; // namespace android - -#endif // MEDIAMETADATARETRIEVER_H diff --git a/external/android/include/14/frameworks/base/include/media/mediaplayer.h b/external/android/include/14/frameworks/base/include/media/mediaplayer.h deleted file mode 100644 index 08835fb..0000000 --- a/external/android/include/14/frameworks/base/include/media/mediaplayer.h +++ /dev/null @@ -1,239 +0,0 @@ -/* - * 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_MEDIAPLAYER_H -#define ANDROID_MEDIAPLAYER_H - -#include -#include -#include -#include -#include - -#include -#include - -class ANativeWindow; - -namespace android { - -class Surface; -class ISurfaceTexture; - -enum media_event_type { - MEDIA_NOP = 0, // interface test message - MEDIA_PREPARED = 1, - MEDIA_PLAYBACK_COMPLETE = 2, - MEDIA_BUFFERING_UPDATE = 3, - MEDIA_SEEK_COMPLETE = 4, - MEDIA_SET_VIDEO_SIZE = 5, - MEDIA_TIMED_TEXT = 99, - MEDIA_ERROR = 100, - MEDIA_INFO = 200, -}; - -// Generic error codes for the media player framework. Errors are fatal, the -// playback must abort. -// -// Errors are communicated back to the client using the -// MediaPlayerListener::notify method defined below. -// In this situation, 'notify' is invoked with the following: -// 'msg' is set to MEDIA_ERROR. -// 'ext1' should be a value from the enum media_error_type. -// 'ext2' contains an implementation dependant error code to provide -// more details. Should default to 0 when not used. -// -// The codes are distributed as follow: -// 0xx: Reserved -// 1xx: Android Player errors. Something went wrong inside the MediaPlayer. -// 2xx: Media errors (e.g Codec not supported). There is a problem with the -// media itself. -// 3xx: Runtime errors. Some extraordinary condition arose making the playback -// impossible. -// -enum media_error_type { - // 0xx - MEDIA_ERROR_UNKNOWN = 1, - // 1xx - MEDIA_ERROR_SERVER_DIED = 100, - // 2xx - MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK = 200, - // 3xx -}; - - -// Info and warning codes for the media player framework. These are non fatal, -// the playback is going on but there might be some user visible issues. -// -// Info and warning messages are communicated back to the client using the -// MediaPlayerListener::notify method defined below. In this situation, -// 'notify' is invoked with the following: -// 'msg' is set to MEDIA_INFO. -// 'ext1' should be a value from the enum media_info_type. -// 'ext2' contains an implementation dependant info code to provide -// more details. Should default to 0 when not used. -// -// The codes are distributed as follow: -// 0xx: Reserved -// 7xx: Android Player info/warning (e.g player lagging behind.) -// 8xx: Media info/warning (e.g media badly interleaved.) -// -enum media_info_type { - // 0xx - MEDIA_INFO_UNKNOWN = 1, - // 7xx - // The video is too complex for the decoder: it can't decode frames fast - // enough. Possibly only the audio plays fine at this stage. - MEDIA_INFO_VIDEO_TRACK_LAGGING = 700, - // MediaPlayer is temporarily pausing playback internally in order to - // buffer more data. - MEDIA_INFO_BUFFERING_START = 701, - // MediaPlayer is resuming playback after filling buffers. - MEDIA_INFO_BUFFERING_END = 702, - // Bandwidth in recent past - MEDIA_INFO_NETWORK_BANDWIDTH = 703, - - // 8xx - // Bad interleaving means that a media has been improperly interleaved or not - // interleaved at all, e.g has all the video samples first then all the audio - // ones. Video is playing but a lot of disk seek may be happening. - MEDIA_INFO_BAD_INTERLEAVING = 800, - // The media is not seekable (e.g live stream). - MEDIA_INFO_NOT_SEEKABLE = 801, - // New media metadata is available. - MEDIA_INFO_METADATA_UPDATE = 802, -}; - - - -enum media_player_states { - MEDIA_PLAYER_STATE_ERROR = 0, - MEDIA_PLAYER_IDLE = 1 << 0, - MEDIA_PLAYER_INITIALIZED = 1 << 1, - MEDIA_PLAYER_PREPARING = 1 << 2, - MEDIA_PLAYER_PREPARED = 1 << 3, - MEDIA_PLAYER_STARTED = 1 << 4, - MEDIA_PLAYER_PAUSED = 1 << 5, - MEDIA_PLAYER_STOPPED = 1 << 6, - MEDIA_PLAYER_PLAYBACK_COMPLETE = 1 << 7 -}; - -// Keep KEY_PARAMETER_* in sync with MediaPlayer.java. -// The same enum space is used for both set and get, in case there are future keys that -// can be both set and get. But as of now, all parameters are either set only or get only. -enum media_parameter_keys { - KEY_PARAMETER_TIMED_TEXT_TRACK_INDEX = 1000, // set only - KEY_PARAMETER_TIMED_TEXT_ADD_OUT_OF_BAND_SOURCE = 1001, // set only - - // Streaming/buffering parameters - KEY_PARAMETER_CACHE_STAT_COLLECT_FREQ_MS = 1100, // set only - - // Return a Parcel containing a single int, which is the channel count of the - // audio track, or zero for error (e.g. no audio track) or unknown. - KEY_PARAMETER_AUDIO_CHANNEL_COUNT = 1200, // get only - -}; - -// ---------------------------------------------------------------------------- -// ref-counted object for callbacks -class MediaPlayerListener: virtual public RefBase -{ -public: - virtual void notify(int msg, int ext1, int ext2, const Parcel *obj) = 0; -}; - -class MediaPlayer : public BnMediaPlayerClient, - public virtual IMediaDeathNotifier -{ -public: - MediaPlayer(); - ~MediaPlayer(); - void died(); - void disconnect(); - - status_t setDataSource( - const char *url, - const KeyedVector *headers); - - status_t setDataSource(int fd, int64_t offset, int64_t length); - status_t setDataSource(const sp &source); - status_t setVideoSurface(const sp& surface); - status_t setVideoSurfaceTexture( - const sp& surfaceTexture); - status_t setListener(const sp& listener); - status_t prepare(); - status_t prepareAsync(); - status_t start(); - status_t stop(); - status_t pause(); - bool isPlaying(); - status_t getVideoWidth(int *w); - status_t getVideoHeight(int *h); - status_t seekTo(int msec); - status_t getCurrentPosition(int *msec); - status_t getDuration(int *msec); - status_t reset(); - status_t setAudioStreamType(int type); - status_t setLooping(int loop); - bool isLooping(); - status_t setVolume(float leftVolume, float rightVolume); - void notify(int msg, int ext1, int ext2, const Parcel *obj = NULL); - static sp decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, int* pFormat); - static sp decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, int* pFormat); - status_t invoke(const Parcel& request, Parcel *reply); - status_t setMetadataFilter(const Parcel& filter); - status_t getMetadata(bool update_only, bool apply_filter, Parcel *metadata); - status_t setAudioSessionId(int sessionId); - int getAudioSessionId(); - status_t setAuxEffectSendLevel(float level); - status_t attachAuxEffect(int effectId); - status_t setParameter(int key, const Parcel& request); - status_t getParameter(int key, Parcel* reply); - -private: - void clear_l(); - status_t seekTo_l(int msec); - status_t prepareAsync_l(); - status_t getDuration_l(int *msec); - status_t attachNewPlayer(const sp& player); - status_t reset_l(); - - sp mPlayer; - thread_id_t mLockThreadId; - Mutex mLock; - Mutex mNotifyLock; - Condition mSignal; - sp mListener; - void* mCookie; - media_player_states mCurrentState; - int mDuration; - int mCurrentPosition; - int mSeekPosition; - bool mPrepareSync; - status_t mPrepareStatus; - int mStreamType; - bool mLoop; - float mLeftVolume; - float mRightVolume; - int mVideoWidth; - int mVideoHeight; - int mAudioSessionId; - float mSendLevel; -}; - -}; // namespace android - -#endif // ANDROID_MEDIAPLAYER_H diff --git a/external/android/include/14/frameworks/base/include/media/mediarecorder.h b/external/android/include/14/frameworks/base/include/media/mediarecorder.h deleted file mode 100644 index 30db642..0000000 --- a/external/android/include/14/frameworks/base/include/media/mediarecorder.h +++ /dev/null @@ -1,257 +0,0 @@ -/* - ** 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. - */ - -#ifndef ANDROID_MEDIARECORDER_H -#define ANDROID_MEDIARECORDER_H - -#include -#include -#include -#include -#include -#include - -namespace android { - -class Surface; -class IMediaRecorder; -class ICamera; -class ICameraRecordingProxy; -class ISurfaceTexture; -class SurfaceTextureClient; - -typedef void (*media_completion_f)(status_t status, void *cookie); - -enum video_source { - VIDEO_SOURCE_DEFAULT = 0, - VIDEO_SOURCE_CAMERA = 1, - VIDEO_SOURCE_GRALLOC_BUFFER = 2, - - VIDEO_SOURCE_LIST_END // must be last - used to validate audio source type -}; - -//Please update media/java/android/media/MediaRecorder.java if the following is updated. -enum output_format { - OUTPUT_FORMAT_DEFAULT = 0, - OUTPUT_FORMAT_THREE_GPP = 1, - OUTPUT_FORMAT_MPEG_4 = 2, - - - OUTPUT_FORMAT_AUDIO_ONLY_START = 3, // Used in validating the output format. Should be the - // at the start of the audio only output formats. - - /* These are audio only file formats */ - OUTPUT_FORMAT_RAW_AMR = 3, //to be backward compatible - OUTPUT_FORMAT_AMR_NB = 3, - OUTPUT_FORMAT_AMR_WB = 4, - OUTPUT_FORMAT_AAC_ADIF = 5, - OUTPUT_FORMAT_AAC_ADTS = 6, - - /* Stream over a socket, limited to a single stream */ - OUTPUT_FORMAT_RTP_AVP = 7, - - /* H.264/AAC data encapsulated in MPEG2/TS */ - OUTPUT_FORMAT_MPEG2TS = 8, - - OUTPUT_FORMAT_LIST_END // must be last - used to validate format type -}; - -enum audio_encoder { - AUDIO_ENCODER_DEFAULT = 0, - AUDIO_ENCODER_AMR_NB = 1, - AUDIO_ENCODER_AMR_WB = 2, - AUDIO_ENCODER_AAC = 3, - AUDIO_ENCODER_AAC_PLUS = 4, - AUDIO_ENCODER_EAAC_PLUS = 5, - - AUDIO_ENCODER_LIST_END // must be the last - used to validate the audio encoder type -}; - -enum video_encoder { - VIDEO_ENCODER_DEFAULT = 0, - VIDEO_ENCODER_H263 = 1, - VIDEO_ENCODER_H264 = 2, - VIDEO_ENCODER_MPEG_4_SP = 3, - - VIDEO_ENCODER_LIST_END // must be the last - used to validate the video encoder type -}; - -/* - * The state machine of the media_recorder. - */ -enum media_recorder_states { - // Error state. - MEDIA_RECORDER_ERROR = 0, - - // Recorder was just created. - MEDIA_RECORDER_IDLE = 1 << 0, - - // Recorder has been initialized. - MEDIA_RECORDER_INITIALIZED = 1 << 1, - - // Configuration of the recorder has been completed. - MEDIA_RECORDER_DATASOURCE_CONFIGURED = 1 << 2, - - // Recorder is ready to start. - MEDIA_RECORDER_PREPARED = 1 << 3, - - // Recording is in progress. - MEDIA_RECORDER_RECORDING = 1 << 4, -}; - -// The "msg" code passed to the listener in notify. -enum media_recorder_event_type { - MEDIA_RECORDER_EVENT_LIST_START = 1, - MEDIA_RECORDER_EVENT_ERROR = 1, - MEDIA_RECORDER_EVENT_INFO = 2, - MEDIA_RECORDER_EVENT_LIST_END = 99, - - // Track related event types - MEDIA_RECORDER_TRACK_EVENT_LIST_START = 100, - MEDIA_RECORDER_TRACK_EVENT_ERROR = 100, - MEDIA_RECORDER_TRACK_EVENT_INFO = 101, - MEDIA_RECORDER_TRACK_EVENT_LIST_END = 1000, -}; - -/* - * The (part of) "what" code passed to the listener in notify. - * When the error or info type is track specific, the what has - * the following layout: - * the left-most 16-bit is meant for error or info type. - * the right-most 4-bit is meant for track id. - * the rest is reserved. - * - * | track id | reserved | error or info type | - * 31 28 16 0 - * - */ -enum media_recorder_error_type { - MEDIA_RECORDER_ERROR_UNKNOWN = 1, - - // Track related error type - MEDIA_RECORDER_TRACK_ERROR_LIST_START = 100, - MEDIA_RECORDER_TRACK_ERROR_GENERAL = 100, - MEDIA_RECORDER_ERROR_VIDEO_NO_SYNC_FRAME = 200, - MEDIA_RECORDER_TRACK_ERROR_LIST_END = 1000, -}; - -// The codes are distributed as follow: -// 0xx: Reserved -// 8xx: General info/warning -// -enum media_recorder_info_type { - MEDIA_RECORDER_INFO_UNKNOWN = 1, - - MEDIA_RECORDER_INFO_MAX_DURATION_REACHED = 800, - MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED = 801, - - // All track related informtional events start here - MEDIA_RECORDER_TRACK_INFO_LIST_START = 1000, - MEDIA_RECORDER_TRACK_INFO_COMPLETION_STATUS = 1000, - MEDIA_RECORDER_TRACK_INFO_PROGRESS_IN_TIME = 1001, - MEDIA_RECORDER_TRACK_INFO_TYPE = 1002, - MEDIA_RECORDER_TRACK_INFO_DURATION_MS = 1003, - - // The time to measure the max chunk duration - MEDIA_RECORDER_TRACK_INFO_MAX_CHUNK_DUR_MS = 1004, - - MEDIA_RECORDER_TRACK_INFO_ENCODED_FRAMES = 1005, - - // The time to measure how well the audio and video - // track data is interleaved. - MEDIA_RECORDER_TRACK_INTER_CHUNK_TIME_MS = 1006, - - // The time to measure system response. Note that - // the delay does not include the intentional delay - // we use to eliminate the recording sound. - MEDIA_RECORDER_TRACK_INFO_INITIAL_DELAY_MS = 1007, - - // The time used to compensate for initial A/V sync. - MEDIA_RECORDER_TRACK_INFO_START_OFFSET_MS = 1008, - - // Total number of bytes of the media data. - MEDIA_RECORDER_TRACK_INFO_DATA_KBYTES = 1009, - - MEDIA_RECORDER_TRACK_INFO_LIST_END = 2000, -}; - -// ---------------------------------------------------------------------------- -// ref-counted object for callbacks -class MediaRecorderListener: virtual public RefBase -{ -public: - virtual void notify(int msg, int ext1, int ext2) = 0; -}; - -class MediaRecorder : public BnMediaRecorderClient, - public virtual IMediaDeathNotifier -{ -public: - MediaRecorder(); - ~MediaRecorder(); - - void died(); - status_t initCheck(); - status_t setCamera(const sp& camera, const sp& proxy); - status_t setPreviewSurface(const sp& surface); - status_t setVideoSource(int vs); - status_t setAudioSource(int as); - status_t setOutputFormat(int of); - status_t setVideoEncoder(int ve); - status_t setAudioEncoder(int ae); - status_t setOutputFile(const char* path); - status_t setOutputFile(int fd, int64_t offset, int64_t length); - status_t setVideoSize(int width, int height); - status_t setVideoFrameRate(int frames_per_second); - status_t setParameters(const String8& params); - status_t setListener(const sp& listener); - status_t prepare(); - status_t getMaxAmplitude(int* max); - status_t start(); - status_t stop(); - status_t reset(); - status_t init(); - status_t close(); - status_t release(); - void notify(int msg, int ext1, int ext2); - sp querySurfaceMediaSourceFromMediaServer(); - -private: - void doCleanUp(); - status_t doReset(); - - sp mMediaRecorder; - sp mListener; - - // Reference toISurfaceTexture - // for encoding GL Frames. That is useful only when the - // video source is set to VIDEO_SOURCE_GRALLOC_BUFFER - sp mSurfaceMediaSource; - - media_recorder_states mCurrentState; - bool mIsAudioSourceSet; - bool mIsVideoSourceSet; - bool mIsAudioEncoderSet; - bool mIsVideoEncoderSet; - bool mIsOutputFileSet; - Mutex mLock; - Mutex mNotifyLock; -}; - -}; // namespace android - -#endif // ANDROID_MEDIARECORDER_H diff --git a/external/android/include/14/frameworks/base/include/media/mediascanner.h b/external/android/include/14/frameworks/base/include/media/mediascanner.h deleted file mode 100644 index a73403b..0000000 --- a/external/android/include/14/frameworks/base/include/media/mediascanner.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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. - */ - -#ifndef MEDIASCANNER_H -#define MEDIASCANNER_H - -#include -#include -#include -#include -#include - -struct dirent; - -namespace android { - -class MediaScannerClient; -class StringArray; - -enum MediaScanResult { - // This file or directory was scanned successfully. - MEDIA_SCAN_RESULT_OK, - // This file or directory was skipped because it was not found, could - // not be opened, was of an unsupported type, or was malfored in some way. - MEDIA_SCAN_RESULT_SKIPPED, - // The scan should be aborted due to a fatal error such as out of memory - // or an exception. - MEDIA_SCAN_RESULT_ERROR, -}; - -struct MediaScanner { - MediaScanner(); - virtual ~MediaScanner(); - - virtual MediaScanResult processFile( - const char *path, const char *mimeType, MediaScannerClient &client) = 0; - - virtual MediaScanResult processDirectory( - const char *path, MediaScannerClient &client); - - void setLocale(const char *locale); - - // extracts album art as a block of data - virtual char *extractAlbumArt(int fd) = 0; - -protected: - const char *locale() const; - -private: - // current locale (like "ja_JP"), created/destroyed with strdup()/free() - char *mLocale; - char *mSkipList; - int *mSkipIndex; - - MediaScanResult doProcessDirectory( - char *path, int pathRemaining, MediaScannerClient &client, bool noMedia); - MediaScanResult doProcessDirectoryEntry( - char *path, int pathRemaining, MediaScannerClient &client, bool noMedia, - struct dirent* entry, char* fileSpot); - void loadSkipList(); - bool shouldSkipDirectory(char *path); - - - MediaScanner(const MediaScanner &); - MediaScanner &operator=(const MediaScanner &); -}; - -class MediaScannerClient -{ -public: - MediaScannerClient(); - virtual ~MediaScannerClient(); - void setLocale(const char* locale); - void beginFile(); - status_t addStringTag(const char* name, const char* value); - void endFile(); - - virtual status_t scanFile(const char* path, long long lastModified, - long long fileSize, bool isDirectory, bool noMedia) = 0; - virtual status_t handleStringTag(const char* name, const char* value) = 0; - virtual status_t setMimeType(const char* mimeType) = 0; - -protected: - void convertValues(uint32_t encoding); - -protected: - // cached name and value strings, for native encoding support. - StringArray* mNames; - StringArray* mValues; - - // default encoding based on MediaScanner::mLocale string - uint32_t mLocaleEncoding; -}; - -}; // namespace android - -#endif // MEDIASCANNER_H diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/AACWriter.h b/external/android/include/14/frameworks/base/include/media/stagefright/AACWriter.h deleted file mode 100644 index fa3ab8a..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/AACWriter.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2011 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 AAC_WRITER_H_ -#define AAC_WRITER_H_ - -#include -#include - -namespace android { - -struct MediaSource; -struct MetaData; - -struct AACWriter : public MediaWriter { - AACWriter(const char *filename); - AACWriter(int fd); - - status_t initCheck() const; - - virtual status_t addSource(const sp &source); - virtual bool reachedEOS(); - virtual status_t start(MetaData *params = NULL); - virtual status_t stop(); - virtual status_t pause(); - -protected: - virtual ~AACWriter(); - -private: - enum { - kAdtsHeaderLength = 7, // # of bytes for the adts header - kSamplesPerFrame = 1024, // # of samples in a frame - }; - - int mFd; - status_t mInitCheck; - sp mSource; - bool mStarted; - volatile bool mPaused; - volatile bool mResumed; - volatile bool mDone; - volatile bool mReachedEOS; - pthread_t mThread; - int64_t mEstimatedSizeBytes; - int64_t mEstimatedDurationUs; - int32_t mChannelCount; - int32_t mSampleRate; - int32_t mFrameDurationUs; - - static void *ThreadWrapper(void *); - status_t threadFunc(); - bool exceedsFileSizeLimit(); - bool exceedsFileDurationLimit(); - status_t writeAdtsHeader(uint32_t frameLength); - - DISALLOW_EVIL_CONSTRUCTORS(AACWriter); -}; - -} // namespace android - -#endif // AAC_WRITER_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/ACodec.h b/external/android/include/14/frameworks/base/include/media/stagefright/ACodec.h deleted file mode 100644 index 5822877..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/ACodec.h +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (C) 2010 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 A_CODEC_H_ - -#define A_CODEC_H_ - -#include -#include -#include -#include - -namespace android { - -struct ABuffer; -struct MemoryDealer; - -struct ACodec : public AHierarchicalStateMachine { - enum { - kWhatFillThisBuffer = 'fill', - kWhatDrainThisBuffer = 'drai', - kWhatEOS = 'eos ', - kWhatShutdownCompleted = 'scom', - kWhatFlushCompleted = 'fcom', - kWhatOutputFormatChanged = 'outC', - kWhatError = 'erro', - }; - - ACodec(); - - void setNotificationMessage(const sp &msg); - void initiateSetup(const sp &msg); - void signalFlush(); - void signalResume(); - void initiateShutdown(); - -protected: - virtual ~ACodec(); - -private: - struct BaseState; - struct UninitializedState; - struct LoadedToIdleState; - struct IdleToExecutingState; - struct ExecutingState; - struct OutputPortSettingsChangedState; - struct ExecutingToIdleState; - struct IdleToLoadedState; - struct FlushingState; - - enum { - kWhatSetup = 'setu', - kWhatOMXMessage = 'omx ', - kWhatInputBufferFilled = 'inpF', - kWhatOutputBufferDrained = 'outD', - kWhatShutdown = 'shut', - kWhatFlush = 'flus', - kWhatResume = 'resm', - kWhatDrainDeferredMessages = 'drai', - }; - - enum { - kPortIndexInput = 0, - kPortIndexOutput = 1 - }; - - struct BufferInfo { - enum Status { - OWNED_BY_US, - OWNED_BY_COMPONENT, - OWNED_BY_UPSTREAM, - OWNED_BY_DOWNSTREAM, - OWNED_BY_NATIVE_WINDOW, - }; - - IOMX::buffer_id mBufferID; - Status mStatus; - - sp mData; - sp mGraphicBuffer; - }; - - sp mNotify; - - sp mUninitializedState; - sp mLoadedToIdleState; - sp mIdleToExecutingState; - sp mExecutingState; - sp mOutputPortSettingsChangedState; - sp mExecutingToIdleState; - sp mIdleToLoadedState; - sp mFlushingState; - - AString mComponentName; - sp mOMX; - IOMX::node_id mNode; - sp mDealer[2]; - - sp mNativeWindow; - - Vector mBuffers[2]; - bool mPortEOS[2]; - status_t mInputEOSResult; - - List > mDeferredQueue; - - bool mSentFormat; - - status_t allocateBuffersOnPort(OMX_U32 portIndex); - status_t freeBuffersOnPort(OMX_U32 portIndex); - status_t freeBuffer(OMX_U32 portIndex, size_t i); - - status_t allocateOutputBuffersFromNativeWindow(); - status_t cancelBufferToNativeWindow(BufferInfo *info); - status_t freeOutputBuffersNotOwnedByComponent(); - BufferInfo *dequeueBufferFromNativeWindow(); - - BufferInfo *findBufferByID( - uint32_t portIndex, IOMX::buffer_id bufferID, - ssize_t *index = NULL); - - void setComponentRole(bool isEncoder, const char *mime); - void configureCodec(const char *mime, const sp &msg); - - status_t setVideoPortFormatType( - OMX_U32 portIndex, - OMX_VIDEO_CODINGTYPE compressionFormat, - OMX_COLOR_FORMATTYPE colorFormat); - - status_t setSupportedOutputFormat(); - - status_t setupVideoDecoder( - const char *mime, int32_t width, int32_t height); - - status_t setVideoFormatOnPort( - OMX_U32 portIndex, - int32_t width, int32_t height, - OMX_VIDEO_CODINGTYPE compressionFormat); - - status_t setupAACDecoder(int32_t numChannels, int32_t sampleRate); - status_t setupAMRDecoder(bool isWAMR); - status_t setupG711Decoder(int32_t numChannels); - - status_t setupRawAudioFormat( - OMX_U32 portIndex, int32_t sampleRate, int32_t numChannels); - - status_t setMinBufferSize(OMX_U32 portIndex, size_t size); - - status_t initNativeWindow(); - - // Returns true iff all buffers on the given port have status OWNED_BY_US. - bool allYourBuffersAreBelongToUs(OMX_U32 portIndex); - - bool allYourBuffersAreBelongToUs(); - - void deferMessage(const sp &msg); - void processDeferredMessages(); - - void sendFormatChange(); - - void signalError(OMX_ERRORTYPE error = OMX_ErrorUndefined); - - DISALLOW_EVIL_CONSTRUCTORS(ACodec); -}; - -} // namespace android - -#endif // A_CODEC_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/AMRWriter.h b/external/android/include/14/frameworks/base/include/media/stagefright/AMRWriter.h deleted file mode 100644 index 62d57b4..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/AMRWriter.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2010 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 AMR_WRITER_H_ - -#define AMR_WRITER_H_ - -#include - -#include -#include - -namespace android { - -struct MediaSource; -struct MetaData; - -struct AMRWriter : public MediaWriter { - AMRWriter(const char *filename); - AMRWriter(int fd); - - status_t initCheck() const; - - virtual status_t addSource(const sp &source); - virtual bool reachedEOS(); - virtual status_t start(MetaData *params = NULL); - virtual status_t stop(); - virtual status_t pause(); - -protected: - virtual ~AMRWriter(); - -private: - int mFd; - status_t mInitCheck; - sp mSource; - bool mStarted; - volatile bool mPaused; - volatile bool mResumed; - volatile bool mDone; - volatile bool mReachedEOS; - pthread_t mThread; - int64_t mEstimatedSizeBytes; - int64_t mEstimatedDurationUs; - - static void *ThreadWrapper(void *); - status_t threadFunc(); - bool exceedsFileSizeLimit(); - bool exceedsFileDurationLimit(); - - AMRWriter(const AMRWriter &); - AMRWriter &operator=(const AMRWriter &); -}; - -} // namespace android - -#endif // AMR_WRITER_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/AudioPlayer.h b/external/android/include/14/frameworks/base/include/media/stagefright/AudioPlayer.h deleted file mode 100644 index 0b79324..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/AudioPlayer.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - * 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 AUDIO_PLAYER_H_ - -#define AUDIO_PLAYER_H_ - -#include -#include -#include -#include - -namespace android { - -class MediaSource; -class AudioTrack; -class AwesomePlayer; - -class AudioPlayer : public TimeSource { -public: - enum { - REACHED_EOS, - SEEK_COMPLETE - }; - - AudioPlayer(const sp &audioSink, - AwesomePlayer *audioObserver = NULL); - - virtual ~AudioPlayer(); - - // Caller retains ownership of "source". - void setSource(const sp &source); - - // Return time in us. - virtual int64_t getRealTimeUs(); - - status_t start(bool sourceAlreadyStarted = false); - - void pause(bool playPendingSamples = false); - void resume(); - - // Returns the timestamp of the last buffer played (in us). - int64_t getMediaTimeUs(); - - // Returns true iff a mapping is established, i.e. the AudioPlayer - // has played at least one frame of audio. - bool getMediaTimeMapping(int64_t *realtime_us, int64_t *mediatime_us); - - status_t seekTo(int64_t time_us); - - bool isSeeking(); - bool reachedEOS(status_t *finalStatus); - -private: - friend class VideoEditorAudioPlayer; - sp mSource; - AudioTrack *mAudioTrack; - - MediaBuffer *mInputBuffer; - - int mSampleRate; - int64_t mLatencyUs; - size_t mFrameSize; - - Mutex mLock; - int64_t mNumFramesPlayed; - - int64_t mPositionTimeMediaUs; - int64_t mPositionTimeRealUs; - - bool mSeeking; - bool mReachedEOS; - status_t mFinalStatus; - int64_t mSeekTimeUs; - - bool mStarted; - - bool mIsFirstBuffer; - status_t mFirstBufferResult; - MediaBuffer *mFirstBuffer; - - sp mAudioSink; - AwesomePlayer *mObserver; - - static void AudioCallback(int event, void *user, void *info); - void AudioCallback(int event, void *info); - - static size_t AudioSinkCallback( - MediaPlayerBase::AudioSink *audioSink, - void *data, size_t size, void *me); - - size_t fillBuffer(void *data, size_t size); - - int64_t getRealTimeUsLocked() const; - - void reset(); - - uint32_t getNumFramesPendingPlayout() const; - - AudioPlayer(const AudioPlayer &); - AudioPlayer &operator=(const AudioPlayer &); -}; - -} // namespace android - -#endif // AUDIO_PLAYER_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/AudioSource.h b/external/android/include/14/frameworks/base/include/media/stagefright/AudioSource.h deleted file mode 100644 index 19bd31b..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/AudioSource.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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 AUDIO_SOURCE_H_ - -#define AUDIO_SOURCE_H_ - -#include -#include -#include -#include -#include - -#include - -namespace android { - -class AudioRecord; - -struct AudioSource : public MediaSource, public MediaBufferObserver { - // Note that the "channels" parameter is _not_ the number of channels, - // but a bitmask of audio_channels_t constants. - AudioSource( - int inputSource, uint32_t sampleRate, - uint32_t channels = AUDIO_CHANNEL_IN_MONO); - - status_t initCheck() const; - - virtual status_t start(MetaData *params = NULL); - virtual status_t stop(); - virtual sp getFormat(); - - // Returns the maximum amplitude since last call. - int16_t getMaxAmplitude(); - - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL); - - status_t dataCallbackTimestamp(const AudioRecord::Buffer& buffer, int64_t timeUs); - virtual void signalBufferReturned(MediaBuffer *buffer); - -protected: - virtual ~AudioSource(); - -private: - enum { - kMaxBufferSize = 2048, - - // After the initial mute, we raise the volume linearly - // over kAutoRampDurationUs. - kAutoRampDurationUs = 300000, - - // This is the initial mute duration to suppress - // the video recording signal tone - kAutoRampStartUs = 0, - }; - - Mutex mLock; - Condition mFrameAvailableCondition; - Condition mFrameEncodingCompletionCondition; - - AudioRecord *mRecord; - status_t mInitCheck; - bool mStarted; - int32_t mSampleRate; - - bool mTrackMaxAmplitude; - int64_t mStartTimeUs; - int16_t mMaxAmplitude; - int64_t mPrevSampleTimeUs; - int64_t mInitialReadTimeUs; - int64_t mNumFramesReceived; - int64_t mNumClientOwnedBuffers; - - List mBuffersReceived; - - void trackMaxAmplitude(int16_t *data, int nSamples); - - // This is used to raise the volume from mute to the - // actual level linearly. - void rampVolume( - int32_t startFrame, int32_t rampDurationFrames, - uint8_t *data, size_t bytes); - - void releaseQueuedFrames_l(); - void waitOutstandingEncodingFrames_l(); - - AudioSource(const AudioSource &); - AudioSource &operator=(const AudioSource &); -}; - -} // namespace android - -#endif // AUDIO_SOURCE_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/CameraSource.h b/external/android/include/14/frameworks/base/include/media/stagefright/CameraSource.h deleted file mode 100644 index 8c1c593..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/CameraSource.h +++ /dev/null @@ -1,228 +0,0 @@ -/* - * 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 CAMERA_SOURCE_H_ - -#define CAMERA_SOURCE_H_ - -#include -#include -#include -#include -#include -#include -#include - -namespace android { - -class IMemory; -class Camera; -class Surface; - -class CameraSource : public MediaSource, public MediaBufferObserver { -public: - /** - * Factory method to create a new CameraSource using the current - * settings (such as video size, frame rate, color format, etc) - * from the default camera. - * - * @return NULL on error. - */ - static CameraSource *Create(); - - /** - * Factory method to create a new CameraSource. - * - * @param camera the video input frame data source. If it is NULL, - * we will try to connect to the camera with the given - * cameraId. - * - * @param cameraId the id of the camera that the source will connect - * to if camera is NULL; otherwise ignored. - * - * @param videoSize the dimension (in pixels) of the video frame - * @param frameRate the target frames per second - * @param surface the preview surface for display where preview - * frames are sent to - * @param storeMetaDataInVideoBuffers true to request the camera - * source to store meta data in video buffers; false to - * request the camera source to store real YUV frame data - * in the video buffers. The camera source may not support - * storing meta data in video buffers, if so, a request - * to do that will NOT be honored. To find out whether - * meta data is actually being stored in video buffers - * during recording, call isMetaDataStoredInVideoBuffers(). - * - * @return NULL on error. - */ - static CameraSource *CreateFromCamera(const sp &camera, - const sp &proxy, - int32_t cameraId, - Size videoSize, - int32_t frameRate, - const sp& surface, - bool storeMetaDataInVideoBuffers = false); - - virtual ~CameraSource(); - - virtual status_t start(MetaData *params = NULL); - virtual status_t stop(); - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL); - - /** - * Check whether a CameraSource object is properly initialized. - * Must call this method before stop(). - * @return OK if initialization has successfully completed. - */ - virtual status_t initCheck() const; - - /** - * Returns the MetaData associated with the CameraSource, - * including: - * kKeyColorFormat: YUV color format of the video frames - * kKeyWidth, kKeyHeight: dimension (in pixels) of the video frames - * kKeySampleRate: frame rate in frames per second - * kKeyMIMEType: always fixed to be MEDIA_MIMETYPE_VIDEO_RAW - */ - virtual sp getFormat(); - - /** - * Tell whether this camera source stores meta data or real YUV - * frame data in video buffers. - * - * @return true if meta data is stored in the video - * buffers; false if real YUV data is stored in - * the video buffers. - */ - bool isMetaDataStoredInVideoBuffers() const; - - virtual void signalBufferReturned(MediaBuffer* buffer); - -protected: - class ProxyListener: public BnCameraRecordingProxyListener { - public: - ProxyListener(const sp& source); - virtual void dataCallbackTimestamp(int64_t timestampUs, int32_t msgType, - const sp &data); - - private: - sp mSource; - }; - - // isBinderAlive needs linkToDeath to work. - class DeathNotifier: public IBinder::DeathRecipient { - public: - DeathNotifier() {} - virtual void binderDied(const wp& who); - }; - - enum CameraFlags { - FLAGS_SET_CAMERA = 1L << 0, - FLAGS_HOT_CAMERA = 1L << 1, - }; - - int32_t mCameraFlags; - Size mVideoSize; - int32_t mVideoFrameRate; - int32_t mColorFormat; - status_t mInitCheck; - - sp mCamera; - sp mCameraRecordingProxy; - sp mDeathNotifier; - sp mSurface; - sp mMeta; - - int64_t mStartTimeUs; - int32_t mNumFramesReceived; - int64_t mLastFrameTimestampUs; - bool mStarted; - int32_t mNumFramesEncoded; - - CameraSource(const sp& camera, const sp& proxy, - int32_t cameraId, - Size videoSize, int32_t frameRate, - const sp& surface, - bool storeMetaDataInVideoBuffers); - - virtual void startCameraRecording(); - virtual void stopCameraRecording(); - virtual void releaseRecordingFrame(const sp& frame); - - // Returns true if need to skip the current frame. - // Called from dataCallbackTimestamp. - virtual bool skipCurrentFrame(int64_t timestampUs) {return false;} - - // Callback called when still camera raw data is available. - virtual void dataCallback(int32_t msgType, const sp &data) {} - - virtual void dataCallbackTimestamp(int64_t timestampUs, int32_t msgType, - const sp &data); - -private: - friend class CameraSourceListener; - - Mutex mLock; - Condition mFrameAvailableCondition; - Condition mFrameCompleteCondition; - List > mFramesReceived; - List > mFramesBeingEncoded; - List mFrameTimes; - - int64_t mFirstFrameTimeUs; - int32_t mNumFramesDropped; - int32_t mNumGlitches; - int64_t mGlitchDurationThresholdUs; - bool mCollectStats; - bool mIsMetaDataStoredInVideoBuffers; - - void releaseQueuedFrames(); - void releaseOneRecordingFrame(const sp& frame); - - - status_t init(const sp& camera, const sp& proxy, - int32_t cameraId, Size videoSize, int32_t frameRate, - bool storeMetaDataInVideoBuffers); - - status_t initWithCameraAccess( - const sp& camera, const sp& proxy, - int32_t cameraId, Size videoSize, int32_t frameRate, - bool storeMetaDataInVideoBuffers); - - status_t isCameraAvailable(const sp& camera, - const sp& proxy, - int32_t cameraId); - status_t isCameraColorFormatSupported(const CameraParameters& params); - status_t configureCamera(CameraParameters* params, - int32_t width, int32_t height, - int32_t frameRate); - - status_t checkVideoSize(const CameraParameters& params, - int32_t width, int32_t height); - - status_t checkFrameRate(const CameraParameters& params, - int32_t frameRate); - - void releaseCamera(); - - CameraSource(const CameraSource &); - CameraSource &operator=(const CameraSource &); -}; - -} // namespace android - -#endif // CAMERA_SOURCE_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/CameraSourceTimeLapse.h b/external/android/include/14/frameworks/base/include/media/stagefright/CameraSourceTimeLapse.h deleted file mode 100644 index 0e264c7..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/CameraSourceTimeLapse.h +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (C) 2010 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 CAMERA_SOURCE_TIME_LAPSE_H_ - -#define CAMERA_SOURCE_TIME_LAPSE_H_ - -#include - -#include -#include - -namespace android { - -class ICamera; -class IMemory; -class Camera; - -class CameraSourceTimeLapse : public CameraSource { -public: - static CameraSourceTimeLapse *CreateFromCamera( - const sp &camera, - const sp &proxy, - int32_t cameraId, - Size videoSize, - int32_t videoFrameRate, - const sp& surface, - int64_t timeBetweenTimeLapseFrameCaptureUs); - - virtual ~CameraSourceTimeLapse(); - - // If the frame capture interval is large, read will block for a long time. - // Due to the way the mediaRecorder framework works, a stop() call from - // mediaRecorder waits until the read returns, causing a long wait for - // stop() to return. To avoid this, we can make read() return a copy of the - // last read frame with the same time stamp frequently. This keeps the - // read() call from blocking too long. Calling this function quickly - // captures another frame, keeps its copy, and enables this mode of read() - // returning quickly. - void startQuickReadReturns(); - -private: - // size of the encoded video. - int32_t mVideoWidth; - int32_t mVideoHeight; - - // Time between capture of two frames during time lapse recording - // Negative value indicates that timelapse is disabled. - int64_t mTimeBetweenTimeLapseFrameCaptureUs; - - // Time between two frames in final video (1/frameRate) - int64_t mTimeBetweenTimeLapseVideoFramesUs; - - // Real timestamp of the last encoded time lapse frame - int64_t mLastTimeLapseFrameRealTimestampUs; - - // Variable set in dataCallbackTimestamp() to help skipCurrentFrame() - // to know if current frame needs to be skipped. - bool mSkipCurrentFrame; - - // Lock for accessing mCameraIdle - Mutex mCameraIdleLock; - - // Condition variable to wait on if camera is is not yet idle. Once the - // camera gets idle, this variable will be signalled. - Condition mCameraIdleCondition; - - // True if camera is in preview mode and ready for takePicture(). - // False after a call to takePicture() but before the final compressed - // data callback has been called and preview has been restarted. - volatile bool mCameraIdle; - - // True if stop() is waiting for camera to get idle, i.e. for the last - // takePicture() to complete. This is needed so that dataCallbackTimestamp() - // can return immediately. - volatile bool mStopWaitingForIdleCamera; - - // Lock for accessing quick stop variables. - Mutex mQuickStopLock; - - // mQuickStop is set to true if we use quick read() returns, otherwise it is set - // to false. Once in this mode read() return a copy of the last read frame - // with the same time stamp. See startQuickReadReturns(). - volatile bool mQuickStop; - - // Forces the next frame passed to dataCallbackTimestamp() to be read - // as a time lapse frame. Used by startQuickReadReturns() so that the next - // frame wakes up any blocking read. - volatile bool mForceRead; - - // Stores a copy of the MediaBuffer read in the last read() call after - // mQuickStop was true. - MediaBuffer* mLastReadBufferCopy; - - // Status code for last read. - status_t mLastReadStatus; - - CameraSourceTimeLapse( - const sp &camera, - const sp &proxy, - int32_t cameraId, - Size videoSize, - int32_t videoFrameRate, - const sp& surface, - int64_t timeBetweenTimeLapseFrameCaptureUs); - - // Wrapper over CameraSource::signalBufferReturned() to implement quick stop. - // It only handles the case when mLastReadBufferCopy is signalled. Otherwise - // it calls the base class' function. - virtual void signalBufferReturned(MediaBuffer* buffer); - - // Wrapper over CameraSource::read() to implement quick stop. - virtual status_t read(MediaBuffer **buffer, const ReadOptions *options = NULL); - - // For video camera case, just stops the camera's video recording. - virtual void stopCameraRecording(); - - // mSkipCurrentFrame is set to true in dataCallbackTimestamp() if the current - // frame needs to be skipped and this function just returns the value of mSkipCurrentFrame. - virtual bool skipCurrentFrame(int64_t timestampUs); - - // In the video camera case calls skipFrameAndModifyTimeStamp() to modify - // timestamp and set mSkipCurrentFrame. - // Then it calls the base CameraSource::dataCallbackTimestamp() - virtual void dataCallbackTimestamp(int64_t timestampUs, int32_t msgType, - const sp &data); - - // Convenience function to fill mLastReadBufferCopy from the just read - // buffer. - void fillLastReadBufferCopy(MediaBuffer& sourceBuffer); - - // If the passed in size (width x height) is a supported video/preview size, - // the function sets the camera's video/preview size to it and returns true. - // Otherwise returns false. - bool trySettingVideoSize(int32_t width, int32_t height); - - // When video camera is used for time lapse capture, returns true - // until enough time has passed for the next time lapse frame. When - // the frame needs to be encoded, it returns false and also modifies - // the time stamp to be one frame time ahead of the last encoded - // frame's time stamp. - bool skipFrameAndModifyTimeStamp(int64_t *timestampUs); - - // Wrapper to enter threadTimeLapseEntry() - static void *ThreadTimeLapseWrapper(void *me); - - // Creates a copy of source_data into a new memory of final type MemoryBase. - sp createIMemoryCopy(const sp &source_data); - - CameraSourceTimeLapse(const CameraSourceTimeLapse &); - CameraSourceTimeLapse &operator=(const CameraSourceTimeLapse &); -}; - -} // namespace android - -#endif // CAMERA_SOURCE_TIME_LAPSE_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/ColorConverter.h b/external/android/include/14/frameworks/base/include/media/stagefright/ColorConverter.h deleted file mode 100644 index 85ba920..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/ColorConverter.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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 COLOR_CONVERTER_H_ - -#define COLOR_CONVERTER_H_ - -#include - -#include -#include - -#include - -namespace android { - -struct ColorConverter { - ColorConverter(OMX_COLOR_FORMATTYPE from, OMX_COLOR_FORMATTYPE to); - ~ColorConverter(); - - bool isValid() const; - - status_t convert( - const void *srcBits, - size_t srcWidth, size_t srcHeight, - size_t srcCropLeft, size_t srcCropTop, - size_t srcCropRight, size_t srcCropBottom, - void *dstBits, - size_t dstWidth, size_t dstHeight, - size_t dstCropLeft, size_t dstCropTop, - size_t dstCropRight, size_t dstCropBottom); - -private: - struct BitmapParams { - BitmapParams( - void *bits, - size_t width, size_t height, - size_t cropLeft, size_t cropTop, - size_t cropRight, size_t cropBottom); - - size_t cropWidth() const; - size_t cropHeight() const; - - void *mBits; - size_t mWidth, mHeight; - size_t mCropLeft, mCropTop, mCropRight, mCropBottom; - }; - - OMX_COLOR_FORMATTYPE mSrcFormat, mDstFormat; - uint8_t *mClip; - - uint8_t *initClip(); - - status_t convertCbYCrY( - const BitmapParams &src, const BitmapParams &dst); - - status_t convertYUV420Planar( - const BitmapParams &src, const BitmapParams &dst); - - status_t convertQCOMYUV420SemiPlanar( - const BitmapParams &src, const BitmapParams &dst); - - status_t convertYUV420SemiPlanar( - const BitmapParams &src, const BitmapParams &dst); - - status_t convertTIYUV420PackedSemiPlanar( - const BitmapParams &src, const BitmapParams &dst); - - ColorConverter(const ColorConverter &); - ColorConverter &operator=(const ColorConverter &); -}; - -} // namespace android - -#endif // COLOR_CONVERTER_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/DataSource.h b/external/android/include/14/frameworks/base/include/media/stagefright/DataSource.h deleted file mode 100644 index 713af92..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/DataSource.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * 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 DATA_SOURCE_H_ - -#define DATA_SOURCE_H_ - -#include - -#include -#include -#include -#include -#include -#include -#include - -namespace android { - -struct AMessage; -class String8; - -class DataSource : public RefBase { -public: - enum Flags { - kWantsPrefetching = 1, - kStreamedFromLocalHost = 2, - kIsCachingDataSource = 4, - kIsHTTPBasedSource = 8, - }; - - static sp CreateFromURI( - const char *uri, - const KeyedVector *headers = NULL); - - DataSource() {} - - virtual status_t initCheck() const = 0; - - virtual ssize_t readAt(off64_t offset, void *data, size_t size) = 0; - - // Convenience methods: - bool getUInt16(off64_t offset, uint16_t *x); - - // May return ERROR_UNSUPPORTED. - virtual status_t getSize(off64_t *size); - - virtual uint32_t flags() { - return 0; - } - - virtual status_t reconnectAtOffset(off64_t offset) { - return ERROR_UNSUPPORTED; - } - - //////////////////////////////////////////////////////////////////////////// - - bool sniff(String8 *mimeType, float *confidence, sp *meta); - - // The sniffer can optionally fill in "meta" with an AMessage containing - // a dictionary of values that helps the corresponding extractor initialize - // its state without duplicating effort already exerted by the sniffer. - typedef bool (*SnifferFunc)( - const sp &source, String8 *mimeType, - float *confidence, sp *meta); - - static void RegisterSniffer(SnifferFunc func); - static void RegisterDefaultSniffers(); - - // for DRM - virtual sp DrmInitialization() { - return NULL; - } - virtual void getDrmInfo(sp &handle, DrmManagerClient **client) {}; - - virtual String8 getUri() { - return String8(); - } - - virtual String8 getMIMEType() const; - -protected: - virtual ~DataSource() {} - -private: - static Mutex gSnifferMutex; - static List gSniffers; - - DataSource(const DataSource &); - DataSource &operator=(const DataSource &); -}; - -} // namespace android - -#endif // DATA_SOURCE_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/FileSource.h b/external/android/include/14/frameworks/base/include/media/stagefright/FileSource.h deleted file mode 100644 index 6cf86dc..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/FileSource.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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 FILE_SOURCE_H_ - -#define FILE_SOURCE_H_ - -#include - -#include -#include -#include -#include - -namespace android { - -class FileSource : public DataSource { -public: - FileSource(const char *filename); - FileSource(int fd, int64_t offset, int64_t length); - - virtual status_t initCheck() const; - - virtual ssize_t readAt(off64_t offset, void *data, size_t size); - - virtual status_t getSize(off64_t *size); - - virtual sp DrmInitialization(); - - virtual void getDrmInfo(sp &handle, DrmManagerClient **client); - -protected: - virtual ~FileSource(); - -private: - int mFd; - int64_t mOffset; - int64_t mLength; - Mutex mLock; - - /*for DRM*/ - sp mDecryptHandle; - DrmManagerClient *mDrmManagerClient; - int64_t mDrmBufOffset; - int64_t mDrmBufSize; - unsigned char *mDrmBuf; - - ssize_t readAtDRM(off64_t offset, void *data, size_t size); - - FileSource(const FileSource &); - FileSource &operator=(const FileSource &); -}; - -} // namespace android - -#endif // FILE_SOURCE_H_ - diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/HardwareAPI.h b/external/android/include/14/frameworks/base/include/media/stagefright/HardwareAPI.h deleted file mode 100644 index 32eed3f..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/HardwareAPI.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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 HARDWARE_API_H_ - -#define HARDWARE_API_H_ - -#include -#include -#include - -#include - -namespace android { - -// A pointer to this struct is passed to the OMX_SetParameter when the extension -// index for the 'OMX.google.android.index.enableAndroidNativeBuffers' extension -// is given. -// -// When Android native buffer use is disabled for a port (the default state), -// the OMX node should operate as normal, and expect UseBuffer calls to set its -// buffers. This is the mode that will be used when CPU access to the buffer is -// required. -// -// When Android native buffer use has been enabled for a given port, the video -// color format for the port is to be interpreted as an Android pixel format -// rather than an OMX color format. The node should then expect to receive -// UseAndroidNativeBuffer calls (via OMX_SetParameter) rather than UseBuffer -// calls for that port. -struct EnableAndroidNativeBuffersParams { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL enable; -}; - -// A pointer to this struct is passed to OMX_SetParameter() when the extension -// index "OMX.google.android.index.storeMetaDataInBuffers" -// is given. -// -// When meta data is stored in the video buffers passed between OMX clients -// and OMX components, interpretation of the buffer data is up to the -// buffer receiver, and the data may or may not be the actual video data, but -// some information helpful for the receiver to locate the actual data. -// The buffer receiver thus needs to know how to interpret what is stored -// in these buffers, with mechanisms pre-determined externally. How to -// interpret the meta data is outside of the scope of this method. -// -// Currently, this is specifically used to pass meta data from video source -// (camera component, for instance) to video encoder to avoid memcpying of -// input video frame data. To do this, bStoreMetaDta is set to OMX_TRUE. -// If bStoreMetaData is set to false, real YUV frame data will be stored -// in the buffers. In addition, if no OMX_SetParameter() call is made -// with the corresponding extension index, real YUV data is stored -// in the buffers. -struct StoreMetaDataInBuffersParams { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL bStoreMetaData; -}; - -// A pointer to this struct is passed to OMX_SetParameter when the extension -// index for the 'OMX.google.android.index.useAndroidNativeBuffer' extension is -// given. This call will only be performed if a prior call was made with the -// 'OMX.google.android.index.enableAndroidNativeBuffers' extension index, -// enabling use of Android native buffers. -struct UseAndroidNativeBufferParams { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_PTR pAppPrivate; - OMX_BUFFERHEADERTYPE **bufferHeader; - const sp& nativeBuffer; -}; - -// A pointer to this struct is passed to OMX_GetParameter when the extension -// index for the 'OMX.google.android.index.getAndroidNativeBufferUsage' -// extension is given. The usage bits returned from this query will be used to -// allocate the Gralloc buffers that get passed to the useAndroidNativeBuffer -// command. -struct GetAndroidNativeBufferUsageParams { - OMX_U32 nSize; // IN - OMX_VERSIONTYPE nVersion; // IN - OMX_U32 nPortIndex; // IN - OMX_U32 nUsage; // OUT -}; - -// An enum OMX_COLOR_FormatAndroidOpaque to indicate an opaque colorformat -// is declared in media/stagefright/openmax/OMX_IVCommon.h -// This will inform the encoder that the actual -// colorformat will be relayed by the GRalloc Buffers. -// OMX_COLOR_FormatAndroidOpaque = 0x7F000001, - - -} // namespace android - -extern android::OMXPluginBase *createOMXPlugin(); - -#endif // HARDWARE_API_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/JPEGSource.h b/external/android/include/14/frameworks/base/include/media/stagefright/JPEGSource.h deleted file mode 100644 index 1b7e91b..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/JPEGSource.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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 JPEG_SOURCE_H_ - -#define JPEG_SOURCE_H_ - -#include - -namespace android { - -class DataSource; -class MediaBufferGroup; - -struct JPEGSource : public MediaSource { - JPEGSource(const sp &source); - - virtual status_t start(MetaData *params = NULL); - virtual status_t stop(); - virtual sp getFormat(); - - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL); - -protected: - virtual ~JPEGSource(); - -private: - sp mSource; - MediaBufferGroup *mGroup; - bool mStarted; - off64_t mSize; - int32_t mWidth, mHeight; - off64_t mOffset; - - status_t parseJPEG(); - - JPEGSource(const JPEGSource &); - JPEGSource &operator=(const JPEGSource &); -}; - -} // namespace android - -#endif // JPEG_SOURCE_H_ - diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/MPEG2TSWriter.h b/external/android/include/14/frameworks/base/include/media/stagefright/MPEG2TSWriter.h deleted file mode 100644 index e4c1c49..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/MPEG2TSWriter.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (C) 2010 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 MPEG2TS_WRITER_H_ - -#define MPEG2TS_WRITER_H_ - -#include -#include -#include -#include - -namespace android { - -struct ABuffer; - -struct MPEG2TSWriter : public MediaWriter { - MPEG2TSWriter(int fd); - MPEG2TSWriter(const char *filename); - - MPEG2TSWriter( - void *cookie, - ssize_t (*write)(void *cookie, const void *data, size_t size)); - - virtual status_t addSource(const sp &source); - virtual status_t start(MetaData *param = NULL); - virtual status_t stop(); - virtual status_t pause(); - virtual bool reachedEOS(); - virtual status_t dump(int fd, const Vector& args); - - void onMessageReceived(const sp &msg); - -protected: - virtual ~MPEG2TSWriter(); - -private: - enum { - kWhatSourceNotify = 'noti' - }; - - struct SourceInfo; - - FILE *mFile; - - void *mWriteCookie; - ssize_t (*mWriteFunc)(void *cookie, const void *data, size_t size); - - sp mLooper; - sp > mReflector; - - bool mStarted; - - Vector > mSources; - size_t mNumSourcesDone; - - int64_t mNumTSPacketsWritten; - int64_t mNumTSPacketsBeforeMeta; - - void init(); - - void writeTS(); - void writeProgramAssociationTable(); - void writeProgramMap(); - void writeAccessUnit(int32_t sourceIndex, const sp &buffer); - - ssize_t internalWrite(const void *data, size_t size); - - DISALLOW_EVIL_CONSTRUCTORS(MPEG2TSWriter); -}; - -} // namespace android - -#endif // MPEG2TS_WRITER_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/MPEG4Writer.h b/external/android/include/14/frameworks/base/include/media/stagefright/MPEG4Writer.h deleted file mode 100644 index 77166ed..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/MPEG4Writer.h +++ /dev/null @@ -1,194 +0,0 @@ -/* - * 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 MPEG4_WRITER_H_ - -#define MPEG4_WRITER_H_ - -#include - -#include -#include -#include - -namespace android { - -class MediaBuffer; -class MediaSource; -class MetaData; - -class MPEG4Writer : public MediaWriter { -public: - MPEG4Writer(const char *filename); - MPEG4Writer(int fd); - - virtual status_t addSource(const sp &source); - virtual status_t start(MetaData *param = NULL); - virtual status_t stop(); - virtual status_t pause(); - virtual bool reachedEOS(); - virtual status_t dump(int fd, const Vector& args); - - void beginBox(const char *fourcc); - void writeInt8(int8_t x); - void writeInt16(int16_t x); - void writeInt32(int32_t x); - void writeInt64(int64_t x); - void writeCString(const char *s); - void writeFourcc(const char *fourcc); - void write(const void *data, size_t size); - void endBox(); - uint32_t interleaveDuration() const { return mInterleaveDurationUs; } - status_t setInterleaveDuration(uint32_t duration); - int32_t getTimeScale() const { return mTimeScale; } - - status_t setGeoData(int latitudex10000, int longitudex10000); - void setStartTimeOffsetMs(int ms) { mStartTimeOffsetMs = ms; } - int32_t getStartTimeOffsetMs() const { return mStartTimeOffsetMs; } - -protected: - virtual ~MPEG4Writer(); - -private: - class Track; - - int mFd; - status_t mInitCheck; - bool mUse4ByteNalLength; - bool mUse32BitOffset; - bool mIsFileSizeLimitExplicitlyRequested; - bool mPaused; - bool mStarted; // Writer thread + track threads started successfully - bool mWriterThreadStarted; // Only writer thread started successfully - off64_t mOffset; - off_t mMdatOffset; - uint8_t *mMoovBoxBuffer; - off64_t mMoovBoxBufferOffset; - bool mWriteMoovBoxToMemory; - off64_t mFreeBoxOffset; - bool mStreamableFile; - off64_t mEstimatedMoovBoxSize; - uint32_t mInterleaveDurationUs; - int32_t mTimeScale; - int64_t mStartTimestampUs; - int mLatitudex10000; - int mLongitudex10000; - bool mAreGeoTagsAvailable; - int32_t mStartTimeOffsetMs; - - Mutex mLock; - - List mTracks; - - List mBoxes; - - void setStartTimestampUs(int64_t timeUs); - int64_t getStartTimestampUs(); // Not const - status_t startTracks(MetaData *params); - size_t numTracks(); - int64_t estimateMoovBoxSize(int32_t bitRate); - - struct Chunk { - Track *mTrack; // Owner - int64_t mTimeStampUs; // Timestamp of the 1st sample - List mSamples; // Sample data - - // Convenient constructor - Chunk(): mTrack(NULL), mTimeStampUs(0) {} - - Chunk(Track *track, int64_t timeUs, List samples) - : mTrack(track), mTimeStampUs(timeUs), mSamples(samples) { - } - - }; - struct ChunkInfo { - Track *mTrack; // Owner - List mChunks; // Remaining chunks to be written - - // Previous chunk timestamp that has been written - int64_t mPrevChunkTimestampUs; - - // Max time interval between neighboring chunks - int64_t mMaxInterChunkDurUs; - - }; - - bool mIsFirstChunk; - volatile bool mDone; // Writer thread is done? - pthread_t mThread; // Thread id for the writer - List mChunkInfos; // Chunk infos - Condition mChunkReadyCondition; // Signal that chunks are available - - // Writer thread handling - status_t startWriterThread(); - void stopWriterThread(); - static void *ThreadWrapper(void *me); - void threadFunc(); - - // Buffer a single chunk to be written out later. - void bufferChunk(const Chunk& chunk); - - // Write all buffered chunks from all tracks - void writeAllChunks(); - - // Retrieve the proper chunk to write if there is one - // Return true if a chunk is found; otherwise, return false. - bool findChunkToWrite(Chunk *chunk); - - // Actually write the given chunk to the file. - void writeChunkToFile(Chunk* chunk); - - // Adjust other track media clock (presumably wall clock) - // based on audio track media clock with the drift time. - int64_t mDriftTimeUs; - void setDriftTimeUs(int64_t driftTimeUs); - int64_t getDriftTimeUs(); - - // Return whether the nal length is 4 bytes or 2 bytes - // Only makes sense for H.264/AVC - bool useNalLengthFour(); - - void lock(); - void unlock(); - - // Acquire lock before calling these methods - off64_t addSample_l(MediaBuffer *buffer); - off64_t addLengthPrefixedSample_l(MediaBuffer *buffer); - - inline size_t write(const void *ptr, size_t size, size_t nmemb); - bool exceedsFileSizeLimit(); - bool use32BitFileOffset() const; - bool exceedsFileDurationLimit(); - bool isFileStreamable() const; - void trackProgressStatus(size_t trackId, int64_t timeUs, status_t err = OK); - void writeCompositionMatrix(int32_t degrees); - void writeMvhdBox(int64_t durationUs); - void writeMoovBox(int64_t durationUs); - void writeFtypBox(MetaData *param); - void writeUdtaBox(); - void writeGeoDataBox(); - void writeLatitude(int degreex10000); - void writeLongitude(int degreex10000); - void sendSessionSummary(); - void release(); - - MPEG4Writer(const MPEG4Writer &); - MPEG4Writer &operator=(const MPEG4Writer &); -}; - -} // namespace android - -#endif // MPEG4_WRITER_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/MediaBuffer.h b/external/android/include/14/frameworks/base/include/media/stagefright/MediaBuffer.h deleted file mode 100644 index 3d79596..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/MediaBuffer.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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 MEDIA_BUFFER_H_ - -#define MEDIA_BUFFER_H_ - -#include - -#include -#include - -namespace android { - -struct ABuffer; -class GraphicBuffer; -class MediaBuffer; -class MediaBufferObserver; -class MetaData; - -class MediaBufferObserver { -public: - MediaBufferObserver() {} - virtual ~MediaBufferObserver() {} - - virtual void signalBufferReturned(MediaBuffer *buffer) = 0; - -private: - MediaBufferObserver(const MediaBufferObserver &); - MediaBufferObserver &operator=(const MediaBufferObserver &); -}; - -class MediaBuffer { -public: - // The underlying data remains the responsibility of the caller! - MediaBuffer(void *data, size_t size); - - MediaBuffer(size_t size); - - MediaBuffer(const sp& graphicBuffer); - - MediaBuffer(const sp &buffer); - - // Decrements the reference count and returns the buffer to its - // associated MediaBufferGroup if the reference count drops to 0. - void release(); - - // Increments the reference count. - void add_ref(); - - void *data() const; - size_t size() const; - - size_t range_offset() const; - size_t range_length() const; - - void set_range(size_t offset, size_t length); - - sp graphicBuffer() const; - - sp meta_data(); - - // Clears meta data and resets the range to the full extent. - void reset(); - - void setObserver(MediaBufferObserver *group); - - // Returns a clone of this MediaBuffer increasing its reference count. - // The clone references the same data but has its own range and - // MetaData. - MediaBuffer *clone(); - - int refcount() const; - -protected: - virtual ~MediaBuffer(); - -private: - friend class MediaBufferGroup; - friend class OMXDecoder; - - // For use by OMXDecoder, reference count must be 1, drop reference - // count to 0 without signalling the observer. - void claim(); - - MediaBufferObserver *mObserver; - MediaBuffer *mNextBuffer; - int mRefCount; - - void *mData; - size_t mSize, mRangeOffset, mRangeLength; - sp mGraphicBuffer; - sp mBuffer; - - bool mOwnsData; - - sp mMetaData; - - MediaBuffer *mOriginal; - - void setNextBuffer(MediaBuffer *buffer); - MediaBuffer *nextBuffer(); - - MediaBuffer(const MediaBuffer &); - MediaBuffer &operator=(const MediaBuffer &); -}; - -} // namespace android - -#endif // MEDIA_BUFFER_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/MediaBufferGroup.h b/external/android/include/14/frameworks/base/include/media/stagefright/MediaBufferGroup.h deleted file mode 100644 index 0488292..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/MediaBufferGroup.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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 MEDIA_BUFFER_GROUP_H_ - -#define MEDIA_BUFFER_GROUP_H_ - -#include -#include -#include - -namespace android { - -class MediaBuffer; -class MetaData; - -class MediaBufferGroup : public MediaBufferObserver { -public: - MediaBufferGroup(); - ~MediaBufferGroup(); - - void add_buffer(MediaBuffer *buffer); - - // Blocks until a buffer is available and returns it to the caller, - // the returned buffer will have a reference count of 1. - status_t acquire_buffer(MediaBuffer **buffer); - -protected: - virtual void signalBufferReturned(MediaBuffer *buffer); - -private: - friend class MediaBuffer; - - Mutex mLock; - Condition mCondition; - - MediaBuffer *mFirstBuffer, *mLastBuffer; - - MediaBufferGroup(const MediaBufferGroup &); - MediaBufferGroup &operator=(const MediaBufferGroup &); -}; - -} // namespace android - -#endif // MEDIA_BUFFER_GROUP_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/MediaDebug.h b/external/android/include/14/frameworks/base/include/media/stagefright/MediaDebug.h deleted file mode 100644 index 2ca9667..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/MediaDebug.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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 MEDIA_DEBUG_H_ - -#define MEDIA_DEBUG_H_ - -#include - -#define LITERAL_TO_STRING_INTERNAL(x) #x -#define LITERAL_TO_STRING(x) LITERAL_TO_STRING_INTERNAL(x) - -#define CHECK_EQ(x,y) \ - LOG_ALWAYS_FATAL_IF( \ - (x) != (y), \ - __FILE__ ":" LITERAL_TO_STRING(__LINE__) " " #x " != " #y) - -#define CHECK(x) \ - LOG_ALWAYS_FATAL_IF( \ - !(x), \ - __FILE__ ":" LITERAL_TO_STRING(__LINE__) " " #x) - -#endif // MEDIA_DEBUG_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/MediaDefs.h b/external/android/include/14/frameworks/base/include/media/stagefright/MediaDefs.h deleted file mode 100644 index 3e48459..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/MediaDefs.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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 MEDIA_DEFS_H_ - -#define MEDIA_DEFS_H_ - -namespace android { - -extern const char *MEDIA_MIMETYPE_IMAGE_JPEG; - -extern const char *MEDIA_MIMETYPE_VIDEO_VPX; -extern const char *MEDIA_MIMETYPE_VIDEO_AVC; -extern const char *MEDIA_MIMETYPE_VIDEO_MPEG4; -extern const char *MEDIA_MIMETYPE_VIDEO_H263; -extern const char *MEDIA_MIMETYPE_VIDEO_MPEG2; -extern const char *MEDIA_MIMETYPE_VIDEO_RAW; - -extern const char *MEDIA_MIMETYPE_AUDIO_AMR_NB; -extern const char *MEDIA_MIMETYPE_AUDIO_AMR_WB; -extern const char *MEDIA_MIMETYPE_AUDIO_MPEG; -extern const char *MEDIA_MIMETYPE_AUDIO_AAC; -extern const char *MEDIA_MIMETYPE_AUDIO_QCELP; -extern const char *MEDIA_MIMETYPE_AUDIO_VORBIS; -extern const char *MEDIA_MIMETYPE_AUDIO_G711_ALAW; -extern const char *MEDIA_MIMETYPE_AUDIO_G711_MLAW; -extern const char *MEDIA_MIMETYPE_AUDIO_RAW; -extern const char *MEDIA_MIMETYPE_AUDIO_FLAC; -extern const char *MEDIA_MIMETYPE_AUDIO_AAC_ADTS; - -extern const char *MEDIA_MIMETYPE_CONTAINER_MPEG4; -extern const char *MEDIA_MIMETYPE_CONTAINER_WAV; -extern const char *MEDIA_MIMETYPE_CONTAINER_OGG; -extern const char *MEDIA_MIMETYPE_CONTAINER_MATROSKA; -extern const char *MEDIA_MIMETYPE_CONTAINER_MPEG2TS; -extern const char *MEDIA_MIMETYPE_CONTAINER_AVI; - -extern const char *MEDIA_MIMETYPE_CONTAINER_WVM; - -extern const char *MEDIA_MIMETYPE_TEXT_3GPP; - -} // namespace android - -#endif // MEDIA_DEFS_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/MediaErrors.h b/external/android/include/14/frameworks/base/include/media/stagefright/MediaErrors.h deleted file mode 100644 index 21d00b8..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/MediaErrors.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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 MEDIA_ERRORS_H_ - -#define MEDIA_ERRORS_H_ - -#include - -namespace android { - -enum { - MEDIA_ERROR_BASE = -1000, - - ERROR_ALREADY_CONNECTED = MEDIA_ERROR_BASE, - ERROR_NOT_CONNECTED = MEDIA_ERROR_BASE - 1, - ERROR_UNKNOWN_HOST = MEDIA_ERROR_BASE - 2, - ERROR_CANNOT_CONNECT = MEDIA_ERROR_BASE - 3, - ERROR_IO = MEDIA_ERROR_BASE - 4, - ERROR_CONNECTION_LOST = MEDIA_ERROR_BASE - 5, - ERROR_MALFORMED = MEDIA_ERROR_BASE - 7, - ERROR_OUT_OF_RANGE = MEDIA_ERROR_BASE - 8, - ERROR_BUFFER_TOO_SMALL = MEDIA_ERROR_BASE - 9, - ERROR_UNSUPPORTED = MEDIA_ERROR_BASE - 10, - ERROR_END_OF_STREAM = MEDIA_ERROR_BASE - 11, - - // Not technically an error. - INFO_FORMAT_CHANGED = MEDIA_ERROR_BASE - 12, - INFO_DISCONTINUITY = MEDIA_ERROR_BASE - 13, - - // The following constant values should be in sync with - // drm/drm_framework_common.h - DRM_ERROR_BASE = -2000, - - ERROR_DRM_UNKNOWN = DRM_ERROR_BASE, - ERROR_DRM_NO_LICENSE = DRM_ERROR_BASE - 1, - ERROR_DRM_LICENSE_EXPIRED = DRM_ERROR_BASE - 2, - ERROR_DRM_SESSION_NOT_OPENED = DRM_ERROR_BASE - 3, - ERROR_DRM_DECRYPT_UNIT_NOT_INITIALIZED = DRM_ERROR_BASE - 4, - ERROR_DRM_DECRYPT = DRM_ERROR_BASE - 5, - ERROR_DRM_CANNOT_HANDLE = DRM_ERROR_BASE - 6, - ERROR_DRM_TAMPER_DETECTED = DRM_ERROR_BASE - 7, - - // Heartbeat Error Codes - HEARTBEAT_ERROR_BASE = -3000, - - ERROR_HEARTBEAT_AUTHENTICATION_FAILURE = HEARTBEAT_ERROR_BASE, - ERROR_HEARTBEAT_NO_ACTIVE_PURCHASE_AGREEMENT = HEARTBEAT_ERROR_BASE - 1, - ERROR_HEARTBEAT_CONCURRENT_PLAYBACK = HEARTBEAT_ERROR_BASE - 2, - ERROR_HEARTBEAT_UNUSUAL_ACTIVITY = HEARTBEAT_ERROR_BASE - 3, - ERROR_HEARTBEAT_STREAMING_UNAVAILABLE = HEARTBEAT_ERROR_BASE - 4, - ERROR_HEARTBEAT_CANNOT_ACTIVATE_RENTAL = HEARTBEAT_ERROR_BASE - 5, - ERROR_HEARTBEAT_TERMINATE_REQUESTED = HEARTBEAT_ERROR_BASE - 6, -}; - -} // namespace android - -#endif // MEDIA_ERRORS_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/MediaExtractor.h b/external/android/include/14/frameworks/base/include/media/stagefright/MediaExtractor.h deleted file mode 100644 index eb45237..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/MediaExtractor.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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 MEDIA_EXTRACTOR_H_ - -#define MEDIA_EXTRACTOR_H_ - -#include - -namespace android { - -class DataSource; -class MediaSource; -class MetaData; - -class MediaExtractor : public RefBase { -public: - static sp Create( - const sp &source, const char *mime = NULL); - - virtual size_t countTracks() = 0; - virtual sp getTrack(size_t index) = 0; - - enum GetTrackMetaDataFlags { - kIncludeExtensiveMetaData = 1 - }; - virtual sp getTrackMetaData( - size_t index, uint32_t flags = 0) = 0; - - // Return container specific meta-data. The default implementation - // returns an empty metadata object. - virtual sp getMetaData(); - - enum Flags { - CAN_SEEK_BACKWARD = 1, // the "seek 10secs back button" - CAN_SEEK_FORWARD = 2, // the "seek 10secs forward button" - CAN_PAUSE = 4, - CAN_SEEK = 8, // the "seek bar" - }; - - // If subclasses do _not_ override this, the default is - // CAN_SEEK_BACKWARD | CAN_SEEK_FORWARD | CAN_SEEK | CAN_PAUSE - virtual uint32_t flags() const; - - // for DRM - virtual void setDrmFlag(bool flag) { - mIsDrm = flag; - }; - virtual bool getDrmFlag() { - return mIsDrm; - } - virtual char* getDrmTrackInfo(size_t trackID, int *len) { - return NULL; - } - -protected: - MediaExtractor() {} - virtual ~MediaExtractor() {} - -private: - bool mIsDrm; - - MediaExtractor(const MediaExtractor &); - MediaExtractor &operator=(const MediaExtractor &); -}; - -} // namespace android - -#endif // MEDIA_EXTRACTOR_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/MediaSource.h b/external/android/include/14/frameworks/base/include/media/stagefright/MediaSource.h deleted file mode 100644 index 3818e63..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/MediaSource.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - * 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 MEDIA_SOURCE_H_ - -#define MEDIA_SOURCE_H_ - -#include - -#include -#include -#include - -namespace android { - -class MediaBuffer; -class MetaData; - -struct MediaSource : public virtual RefBase { - MediaSource(); - - // To be called before any other methods on this object, except - // getFormat(). - virtual status_t start(MetaData *params = NULL) = 0; - - // Any blocking read call returns immediately with a result of NO_INIT. - // It is an error to call any methods other than start after this call - // returns. Any buffers the object may be holding onto at the time of - // the stop() call are released. - // Also, it is imperative that any buffers output by this object and - // held onto by callers be released before a call to stop() !!! - virtual status_t stop() = 0; - - // Returns the format of the data output by this media source. - virtual sp getFormat() = 0; - - struct ReadOptions; - - // Returns a new buffer of data. Call blocks until a - // buffer is available, an error is encountered of the end of the stream - // is reached. - // End of stream is signalled by a result of ERROR_END_OF_STREAM. - // A result of INFO_FORMAT_CHANGED indicates that the format of this - // MediaSource has changed mid-stream, the client can continue reading - // but should be prepared for buffers of the new configuration. - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL) = 0; - - // Options that modify read() behaviour. The default is to - // a) not request a seek - // b) not be late, i.e. lateness_us = 0 - struct ReadOptions { - enum SeekMode { - SEEK_PREVIOUS_SYNC, - SEEK_NEXT_SYNC, - SEEK_CLOSEST_SYNC, - SEEK_CLOSEST, - }; - - ReadOptions(); - - // Reset everything back to defaults. - void reset(); - - void setSeekTo(int64_t time_us, SeekMode mode = SEEK_CLOSEST_SYNC); - void clearSeekTo(); - bool getSeekTo(int64_t *time_us, SeekMode *mode) const; - - void setLateBy(int64_t lateness_us); - int64_t getLateBy() const; - - private: - enum Options { - kSeekTo_Option = 1, - }; - - uint32_t mOptions; - int64_t mSeekTimeUs; - SeekMode mSeekMode; - int64_t mLatenessUs; - }; - - // Causes this source to suspend pulling data from its upstream source - // until a subsequent read-with-seek. Currently only supported by - // OMXCodec. - virtual status_t pause() { - return ERROR_UNSUPPORTED; - } - - // The consumer of this media source requests that the given buffers - // are to be returned exclusively in response to read calls. - // This will be called after a successful start() and before the - // first read() call. - // Callee assumes ownership of the buffers if no error is returned. - virtual status_t setBuffers(const Vector &buffers) { - return ERROR_UNSUPPORTED; - } - -protected: - virtual ~MediaSource(); - -private: - MediaSource(const MediaSource &); - MediaSource &operator=(const MediaSource &); -}; - -} // namespace android - -#endif // MEDIA_SOURCE_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/MediaSourceSplitter.h b/external/android/include/14/frameworks/base/include/media/stagefright/MediaSourceSplitter.h deleted file mode 100644 index 568f4c2..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/MediaSourceSplitter.h +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -// This class provides a way to split a single media source into multiple sources. -// The constructor takes in the real mediaSource and createClient() can then be -// used to create multiple sources served from this real mediaSource. -// -// Usage: -// - Create MediaSourceSplitter by passing in a real mediaSource from which -// multiple duplicate channels are needed. -// - Create a client using createClient() and use it as any other mediaSource. -// -// Note that multiple clients can be created using createClient() and -// started/stopped in any order. MediaSourceSplitter stops the real source only -// when all clients have been stopped. -// -// If a new client is created/started after some existing clients have already -// started, the new client will start getting its read frames from the current -// time. - -#ifndef MEDIA_SOURCE_SPLITTER_H_ - -#define MEDIA_SOURCE_SPLITTER_H_ - -#include -#include -#include -#include - -namespace android { - -class MediaBuffer; -class MetaData; - -class MediaSourceSplitter : public RefBase { -public: - // Constructor - // mediaSource: The real mediaSource. The class keeps a reference to it to - // implement the various clients. - MediaSourceSplitter(sp mediaSource); - - ~MediaSourceSplitter(); - - // Creates a new client of base type MediaSource. Multiple clients can be - // created which get their data through the same real mediaSource. These - // clients can then be used like any other MediaSource, all of which provide - // data from the same real source. - sp createClient(); - -private: - // Total number of clients created through createClient(). - int32_t mNumberOfClients; - - // reference to the real MediaSource passed to the constructor. - sp mSource; - - // Stores pointer to the MediaBuffer read from the real MediaSource. - // All clients use this to implement the read() call. - MediaBuffer *mLastReadMediaBuffer; - - // Status code for read from the real MediaSource. All clients return - // this for their read(). - status_t mLastReadStatus; - - // Boolean telling whether the real MediaSource has started. - bool mSourceStarted; - - // List of booleans, one for each client, storing whether the corresponding - // client's start() has been called. - Vector mClientsStarted; - - // Stores the number of clients which are currently started. - int32_t mNumberOfClientsStarted; - - // Since different clients call read() asynchronously, we need to keep track - // of what data is currently read into the mLastReadMediaBuffer. - // mCurrentReadBit stores the bit for the current read buffer. This bit - // flips each time a new buffer is read from the source. - // mClientsDesiredReadBit stores the bit for the next desired read buffer - // for each client. This bit flips each time read() is completed for this - // client. - bool mCurrentReadBit; - Vector mClientsDesiredReadBit; - - // Number of clients whose current read has been completed. - int32_t mNumberOfCurrentReads; - - // Boolean telling whether the last read has been completed for all clients. - // The variable is reset to false each time buffer is read from the real - // source. - bool mLastReadCompleted; - - // A global mutex for access to critical sections. - Mutex mLock; - - // Condition variable for waiting on read from source to complete. - Condition mReadFromSourceCondition; - - // Condition variable for waiting on all client's last read to complete. - Condition mAllReadsCompleteCondition; - - // Functions used by Client to implement the MediaSource interface. - - // If the real source has not been started yet by any client, starts it. - status_t start(int clientId, MetaData *params); - - // Stops the real source after all clients have called stop(). - status_t stop(int clientId); - - // returns the real source's getFormat(). - sp getFormat(int clientId); - - // If the client's desired buffer has already been read into - // mLastReadMediaBuffer, points the buffer to that. Otherwise if it is the - // master client, reads the buffer from source or else waits for the master - // client to read the buffer and uses that. - status_t read(int clientId, - MediaBuffer **buffer, const MediaSource::ReadOptions *options = NULL); - - // Not implemented right now. - status_t pause(int clientId); - - // Function which reads a buffer from the real source into - // mLastReadMediaBuffer - void readFromSource_lock(const MediaSource::ReadOptions *options); - - // Waits until read from the real source has been completed. - // _lock means that the function should be called when the thread has already - // obtained the lock for the mutex mLock. - void waitForReadFromSource_lock(int32_t clientId); - - // Waits until all clients have read the current buffer in - // mLastReadCompleted. - void waitForAllClientsLastRead_lock(int32_t clientId); - - // Each client calls this after it completes its read(). Once all clients - // have called this for the current buffer, the function calls - // mAllReadsCompleteCondition.broadcast() to signal the waiting clients. - void signalReadComplete_lock(bool readAborted); - - // Make these constructors private. - MediaSourceSplitter(); - MediaSourceSplitter(const MediaSourceSplitter &); - MediaSourceSplitter &operator=(const MediaSourceSplitter &); - - // This class implements the MediaSource interface. Each client stores a - // reference to the parent MediaSourceSplitter and uses it to complete the - // various calls. - class Client : public MediaSource { - public: - // Constructor stores reference to the parent MediaSourceSplitter and it - // client id. - Client(sp splitter, int32_t clientId); - - // MediaSource interface - virtual status_t start(MetaData *params = NULL); - - virtual status_t stop(); - - virtual sp getFormat(); - - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL); - - virtual status_t pause(); - - private: - // Refernce to the parent MediaSourceSplitter - sp mSplitter; - - // Id of this client. - int32_t mClientId; - }; - - friend class Client; -}; - -} // namespace android - -#endif // MEDIA_SOURCE_SPLITTER_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/MediaWriter.h b/external/android/include/14/frameworks/base/include/media/stagefright/MediaWriter.h deleted file mode 100644 index 5cc8dcf..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/MediaWriter.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2010 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 MEDIA_WRITER_H_ - -#define MEDIA_WRITER_H_ - -#include -#include - -namespace android { - -struct MediaSource; -struct MetaData; - -struct MediaWriter : public RefBase { - MediaWriter() - : mMaxFileSizeLimitBytes(0), - mMaxFileDurationLimitUs(0) { - } - - virtual status_t addSource(const sp &source) = 0; - virtual bool reachedEOS() = 0; - virtual status_t start(MetaData *params = NULL) = 0; - virtual status_t stop() = 0; - virtual status_t pause() = 0; - - virtual void setMaxFileSize(int64_t bytes) { mMaxFileSizeLimitBytes = bytes; } - virtual void setMaxFileDuration(int64_t durationUs) { mMaxFileDurationLimitUs = durationUs; } - virtual void setListener(const sp& listener) { - mListener = listener; - } - - virtual status_t dump(int fd, const Vector& args) { - return OK; - } - -protected: - virtual ~MediaWriter() {} - int64_t mMaxFileSizeLimitBytes; - int64_t mMaxFileDurationLimitUs; - sp mListener; - - void notify(int msg, int ext1, int ext2) { - if (mListener != NULL) { - mListener->notify(msg, ext1, ext2); - } - } -private: - MediaWriter(const MediaWriter &); - MediaWriter &operator=(const MediaWriter &); -}; - -} // namespace android - -#endif // MEDIA_WRITER_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/MetaData.h b/external/android/include/14/frameworks/base/include/media/stagefright/MetaData.h deleted file mode 100644 index 57f678c..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/MetaData.h +++ /dev/null @@ -1,230 +0,0 @@ -/* - * 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 META_DATA_H_ - -#define META_DATA_H_ - -#include - -#include - -#include -#include - -namespace android { - -// The following keys map to int32_t data unless indicated otherwise. -enum { - kKeyMIMEType = 'mime', // cstring - kKeyWidth = 'widt', // int32_t, image pixel - kKeyHeight = 'heig', // int32_t, image pixel - kKeyDisplayWidth = 'dWid', // int32_t, display/presentation - kKeyDisplayHeight = 'dHgt', // int32_t, display/presentation - - // a rectangle, if absent assumed to be (0, 0, width - 1, height - 1) - kKeyCropRect = 'crop', - - kKeyRotation = 'rotA', // int32_t (angle in degrees) - kKeyIFramesInterval = 'ifiv', // int32_t - kKeyStride = 'strd', // int32_t - kKeySliceHeight = 'slht', // int32_t - kKeyChannelCount = '#chn', // int32_t - kKeySampleRate = 'srte', // int32_t (audio sampling rate Hz) - kKeyFrameRate = 'frmR', // int32_t (video frame rate fps) - kKeyBitRate = 'brte', // int32_t (bps) - kKeyESDS = 'esds', // raw data - kKeyAVCC = 'avcc', // raw data - kKeyD263 = 'd263', // raw data - kKeyVorbisInfo = 'vinf', // raw data - kKeyVorbisBooks = 'vboo', // raw data - kKeyWantsNALFragments = 'NALf', - kKeyIsSyncFrame = 'sync', // int32_t (bool) - kKeyIsCodecConfig = 'conf', // int32_t (bool) - kKeyTime = 'time', // int64_t (usecs) - kKeyDecodingTime = 'decT', // int64_t (decoding timestamp in usecs) - kKeyNTPTime = 'ntpT', // uint64_t (ntp-timestamp) - kKeyTargetTime = 'tarT', // int64_t (usecs) - kKeyDriftTime = 'dftT', // int64_t (usecs) - kKeyAnchorTime = 'ancT', // int64_t (usecs) - kKeyDuration = 'dura', // int64_t (usecs) - kKeyColorFormat = 'colf', - kKeyPlatformPrivate = 'priv', // pointer - kKeyDecoderComponent = 'decC', // cstring - kKeyBufferID = 'bfID', - kKeyMaxInputSize = 'inpS', - kKeyThumbnailTime = 'thbT', // int64_t (usecs) - kKeyTrackID = 'trID', - kKeyIsDRM = 'idrm', // int32_t (bool) - - kKeyAlbum = 'albu', // cstring - kKeyArtist = 'arti', // cstring - kKeyAlbumArtist = 'aart', // cstring - kKeyComposer = 'comp', // cstring - kKeyGenre = 'genr', // cstring - kKeyTitle = 'titl', // cstring - kKeyYear = 'year', // cstring - kKeyAlbumArt = 'albA', // compressed image data - kKeyAlbumArtMIME = 'alAM', // cstring - kKeyAuthor = 'auth', // cstring - kKeyCDTrackNumber = 'cdtr', // cstring - kKeyDiscNumber = 'dnum', // cstring - kKeyDate = 'date', // cstring - kKeyWriter = 'writ', // cstring - kKeyCompilation = 'cpil', // cstring - kKeyTimeScale = 'tmsl', // int32_t - - // video profile and level - kKeyVideoProfile = 'vprf', // int32_t - kKeyVideoLevel = 'vlev', // int32_t - - // Set this key to enable authoring files in 64-bit offset - kKey64BitFileOffset = 'fobt', // int32_t (bool) - kKey2ByteNalLength = '2NAL', // int32_t (bool) - - // Identify the file output format for authoring - // Please see for the supported - // file output formats. - kKeyFileType = 'ftyp', // int32_t - - // Track authoring progress status - // kKeyTrackTimeStatus is used to track progress in elapsed time - kKeyTrackTimeStatus = 'tktm', // int64_t - - kKeyNotRealTime = 'ntrt', // bool (int32_t) - - // Ogg files can be tagged to be automatically looping... - kKeyAutoLoop = 'autL', // bool (int32_t) - - kKeyValidSamples = 'valD', // int32_t - - kKeyIsUnreadable = 'unre', // bool (int32_t) - - // An indication that a video buffer has been rendered. - kKeyRendered = 'rend', // bool (int32_t) - - // The language code for this media - kKeyMediaLanguage = 'lang', // cstring - - // To store the timed text format data - kKeyTextFormatData = 'text', // raw data - - kKeyRequiresSecureBuffers = 'secu', // bool (int32_t) -}; - -enum { - kTypeESDS = 'esds', - kTypeAVCC = 'avcc', - kTypeD263 = 'd263', -}; - -class MetaData : public RefBase { -public: - MetaData(); - MetaData(const MetaData &from); - - enum Type { - TYPE_NONE = 'none', - TYPE_C_STRING = 'cstr', - TYPE_INT32 = 'in32', - TYPE_INT64 = 'in64', - TYPE_FLOAT = 'floa', - TYPE_POINTER = 'ptr ', - TYPE_RECT = 'rect', - }; - - void clear(); - bool remove(uint32_t key); - - bool setCString(uint32_t key, const char *value); - bool setInt32(uint32_t key, int32_t value); - bool setInt64(uint32_t key, int64_t value); - bool setFloat(uint32_t key, float value); - bool setPointer(uint32_t key, void *value); - - bool setRect( - uint32_t key, - int32_t left, int32_t top, - int32_t right, int32_t bottom); - - bool findCString(uint32_t key, const char **value); - bool findInt32(uint32_t key, int32_t *value); - bool findInt64(uint32_t key, int64_t *value); - bool findFloat(uint32_t key, float *value); - bool findPointer(uint32_t key, void **value); - - bool findRect( - uint32_t key, - int32_t *left, int32_t *top, - int32_t *right, int32_t *bottom); - - bool setData(uint32_t key, uint32_t type, const void *data, size_t size); - - bool findData(uint32_t key, uint32_t *type, - const void **data, size_t *size) const; - -protected: - virtual ~MetaData(); - -private: - struct typed_data { - typed_data(); - ~typed_data(); - - typed_data(const MetaData::typed_data &); - typed_data &operator=(const MetaData::typed_data &); - - void clear(); - void setData(uint32_t type, const void *data, size_t size); - void getData(uint32_t *type, const void **data, size_t *size) const; - - private: - uint32_t mType; - size_t mSize; - - union { - void *ext_data; - float reservoir; - } u; - - bool usesReservoir() const { - return mSize <= sizeof(u.reservoir); - } - - void allocateStorage(size_t size); - void freeStorage(); - - void *storage() { - return usesReservoir() ? &u.reservoir : u.ext_data; - } - - const void *storage() const { - return usesReservoir() ? &u.reservoir : u.ext_data; - } - }; - - struct Rect { - int32_t mLeft, mTop, mRight, mBottom; - }; - - KeyedVector mItems; - - // MetaData &operator=(const MetaData &); -}; - -} // namespace android - -#endif // META_DATA_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/MetadataBufferType.h b/external/android/include/14/frameworks/base/include/media/stagefright/MetadataBufferType.h deleted file mode 100644 index 4eaf8ac..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/MetadataBufferType.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2011 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 METADATA_BUFFER_TYPE_H -#define METADATA_BUFFER_TYPE_H - -#ifdef __cplusplus -extern "C" { -namespace android { -#endif - -/* - * MetadataBufferType defines the type of the metadata buffers that - * can be passed to video encoder component for encoding, via Stagefright - * media recording framework. To see how to work with the metadata buffers - * in media recording framework, please consult HardwareAPI.h - * - * The creator of metadata buffers and video encoder share common knowledge - * on what is actually being stored in these metadata buffers, and - * how the information can be used by the video encoder component - * to locate the actual pixel data as the source input for video - * encoder, plus whatever other information that is necessary. Stagefright - * media recording framework does not need to know anything specific about the - * metadata buffers, except for receving each individual metadata buffer - * as the source input, making a copy of the metadata buffer, and passing the - * copy via OpenMAX API to the video encoder component. - * - * The creator of the metadata buffers must ensure that the first - * 4 bytes in every metadata buffer indicates its buffer type, - * and the rest of the metadata buffer contains the - * actual metadata information. When a video encoder component receives - * a metadata buffer, it uses the first 4 bytes in that buffer to find - * out the type of the metadata buffer, and takes action appropriate - * to that type of metadata buffers (for instance, locate the actual - * pixel data input and then encoding the input data to produce a - * compressed output buffer). - * - * The following shows the layout of a metadata buffer, - * where buffer type is a 4-byte field of MetadataBufferType, - * and the payload is the metadata information. - * - * -------------------------------------------------------------- - * | buffer type | payload | - * -------------------------------------------------------------- - * - */ -typedef enum { - - /* - * kMetadataBufferTypeCameraSource is used to indicate that - * the source of the metadata buffer is the camera component. - */ - kMetadataBufferTypeCameraSource = 0, - - /* - * kMetadataBufferTypeGrallocSource is used to indicate that - * the payload of the metadata buffers can be interpreted as - * a buffer_handle_t. - * So in this case,the metadata that the encoder receives - * will have a byte stream that consists of two parts: - * 1. First, there is an integer indicating that it is a GRAlloc - * source (kMetadataBufferTypeGrallocSource) - * 2. This is followed by the buffer_handle_t that is a handle to the - * GRalloc buffer. The encoder needs to interpret this GRalloc handle - * and encode the frames. - * -------------------------------------------------------------- - * | kMetadataBufferTypeGrallocSource | sizeof(buffer_handle_t) | - * -------------------------------------------------------------- - */ - kMetadataBufferTypeGrallocSource = 1, - - // Add more here... - -} MetadataBufferType; - -#ifdef __cplusplus -} // namespace android -} -#endif - -#endif // METADATA_BUFFER_TYPE_H diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/NativeWindowWrapper.h b/external/android/include/14/frameworks/base/include/media/stagefright/NativeWindowWrapper.h deleted file mode 100644 index f323cbc..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/NativeWindowWrapper.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2011 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 NATIVE_WINDOW_WRAPPER_H_ - -#define NATIVE_WINDOW_WRAPPER_H_ - -#include -#include - -namespace android { - -// Both Surface and SurfaceTextureClient are RefBase that implement the -// ANativeWindow interface, but at different addresses. ANativeWindow is not -// a RefBase but acts like one for use with sp<>. This wrapper converts a -// Surface or SurfaceTextureClient into a single reference-counted object -// that holds an sp reference to the underlying Surface or SurfaceTextureClient, -// It provides a method to get the ANativeWindow. - -struct NativeWindowWrapper : RefBase { - NativeWindowWrapper( - const sp &surface) : - mSurface(surface) { } - - NativeWindowWrapper( - const sp &surfaceTextureClient) : - mSurfaceTextureClient(surfaceTextureClient) { } - - sp getNativeWindow() const { - if (mSurface != NULL) { - return mSurface; - } else { - return mSurfaceTextureClient; - } - } - - // If needed later we can provide a method to ask what kind of native window - -private: - // At most one of mSurface and mSurfaceTextureClient will be non-NULL - const sp mSurface; - const sp mSurfaceTextureClient; - - DISALLOW_EVIL_CONSTRUCTORS(NativeWindowWrapper); -}; - -} // namespace android - -#endif // NATIVE_WINDOW_WRAPPER_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/OMXClient.h b/external/android/include/14/frameworks/base/include/media/stagefright/OMXClient.h deleted file mode 100644 index 2f14d06..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/OMXClient.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 OMX_CLIENT_H_ - -#define OMX_CLIENT_H_ - -#include - -namespace android { - -class OMXClient { -public: - OMXClient(); - - status_t connect(); - void disconnect(); - - sp interface() { - return mOMX; - } - -private: - sp mOMX; - - OMXClient(const OMXClient &); - OMXClient &operator=(const OMXClient &); -}; - -} // namespace android - -#endif // OMX_CLIENT_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/OMXCodec.h b/external/android/include/14/frameworks/base/include/media/stagefright/OMXCodec.h deleted file mode 100644 index c21d19d..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/OMXCodec.h +++ /dev/null @@ -1,374 +0,0 @@ -/* - * 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 OMX_CODEC_H_ - -#define OMX_CODEC_H_ - -#include -#include -#include -#include -#include - -namespace android { - -class MemoryDealer; -struct OMXCodecObserver; -struct CodecProfileLevel; - -struct OMXCodec : public MediaSource, - public MediaBufferObserver { - enum CreationFlags { - kPreferSoftwareCodecs = 1, - kIgnoreCodecSpecificData = 2, - - // The client wants to access the output buffer's video - // data for example for thumbnail extraction. - kClientNeedsFramebuffer = 4, - - // Request for software or hardware codecs. If request - // can not be fullfilled, Create() returns NULL. - kSoftwareCodecsOnly = 8, - kHardwareCodecsOnly = 16, - - // Store meta data in video buffers - kStoreMetaDataInVideoBuffers = 32, - - // Only submit one input buffer at one time. - kOnlySubmitOneInputBufferAtOneTime = 64, - - // Enable GRALLOC_USAGE_PROTECTED for output buffers from native window - kEnableGrallocUsageProtected = 128, - - // Secure decoding mode - kUseSecureInputBuffers = 256, - }; - static sp Create( - const sp &omx, - const sp &meta, bool createEncoder, - const sp &source, - const char *matchComponentName = NULL, - uint32_t flags = 0, - const sp &nativeWindow = NULL); - - static void setComponentRole( - const sp &omx, IOMX::node_id node, bool isEncoder, - const char *mime); - - virtual status_t start(MetaData *params = NULL); - virtual status_t stop(); - - virtual sp getFormat(); - - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL); - - virtual status_t pause(); - - // from MediaBufferObserver - virtual void signalBufferReturned(MediaBuffer *buffer); - - // for use by ACodec - static void findMatchingCodecs( - const char *mime, - bool createEncoder, const char *matchComponentName, - uint32_t flags, - Vector *matchingCodecs); - -protected: - virtual ~OMXCodec(); - -private: - - // Make sure mLock is accessible to OMXCodecObserver - friend class OMXCodecObserver; - - // Call this with mLock hold - void on_message(const omx_message &msg); - - enum State { - DEAD, - LOADED, - LOADED_TO_IDLE, - IDLE_TO_EXECUTING, - EXECUTING, - EXECUTING_TO_IDLE, - IDLE_TO_LOADED, - RECONFIGURING, - ERROR - }; - - enum { - kPortIndexInput = 0, - kPortIndexOutput = 1 - }; - - enum PortStatus { - ENABLED, - DISABLING, - DISABLED, - ENABLING, - SHUTTING_DOWN, - }; - - enum Quirks { - kNeedsFlushBeforeDisable = 1, - kWantsNALFragments = 2, - kRequiresLoadedToIdleAfterAllocation = 4, - kRequiresAllocateBufferOnInputPorts = 8, - kRequiresFlushCompleteEmulation = 16, - kRequiresAllocateBufferOnOutputPorts = 32, - kRequiresFlushBeforeShutdown = 64, - kDefersOutputBufferAllocation = 128, - kDecoderLiesAboutNumberOfChannels = 256, - kInputBufferSizesAreBogus = 512, - kSupportsMultipleFramesPerInputBuffer = 1024, - kAvoidMemcopyInputRecordingFrames = 2048, - kRequiresLargerEncoderOutputBuffer = 4096, - kOutputBuffersAreUnreadable = 8192, - }; - - enum BufferStatus { - OWNED_BY_US, - OWNED_BY_COMPONENT, - OWNED_BY_NATIVE_WINDOW, - OWNED_BY_CLIENT, - }; - - struct BufferInfo { - IOMX::buffer_id mBuffer; - BufferStatus mStatus; - sp mMem; - size_t mSize; - void *mData; - MediaBuffer *mMediaBuffer; - }; - - struct CodecSpecificData { - size_t mSize; - uint8_t mData[1]; - }; - - sp mOMX; - bool mOMXLivesLocally; - IOMX::node_id mNode; - uint32_t mQuirks; - - // Flags specified in the creation of the codec. - uint32_t mFlags; - - bool mIsEncoder; - char *mMIME; - char *mComponentName; - sp mOutputFormat; - sp mSource; - Vector mCodecSpecificData; - size_t mCodecSpecificDataIndex; - - sp mDealer[2]; - - State mState; - Vector mPortBuffers[2]; - PortStatus mPortStatus[2]; - bool mInitialBufferSubmit; - bool mSignalledEOS; - status_t mFinalStatus; - bool mNoMoreOutputData; - bool mOutputPortSettingsHaveChanged; - int64_t mSeekTimeUs; - ReadOptions::SeekMode mSeekMode; - int64_t mTargetTimeUs; - bool mOutputPortSettingsChangedPending; - - MediaBuffer *mLeftOverBuffer; - - Mutex mLock; - Condition mAsyncCompletion; - - bool mPaused; - - sp mNativeWindow; - - // The index in each of the mPortBuffers arrays of the buffer that will be - // submitted to OMX next. This only applies when using buffers from a - // native window. - size_t mNextNativeBufferIndex[2]; - - // A list of indices into mPortStatus[kPortIndexOutput] filled with data. - List mFilledBuffers; - Condition mBufferFilled; - - // Used to record the decoding time for an output picture from - // a video encoder. - List mDecodingTimeList; - - OMXCodec(const sp &omx, IOMX::node_id node, - uint32_t quirks, uint32_t flags, - bool isEncoder, const char *mime, const char *componentName, - const sp &source, - const sp &nativeWindow); - - void addCodecSpecificData(const void *data, size_t size); - void clearCodecSpecificData(); - - void setComponentRole(); - - void setAMRFormat(bool isWAMR, int32_t bitRate); - status_t setAACFormat(int32_t numChannels, int32_t sampleRate, int32_t bitRate); - void setG711Format(int32_t numChannels); - - status_t setVideoPortFormatType( - OMX_U32 portIndex, - OMX_VIDEO_CODINGTYPE compressionFormat, - OMX_COLOR_FORMATTYPE colorFormat); - - void setVideoInputFormat( - const char *mime, const sp& meta); - - status_t setupBitRate(int32_t bitRate); - status_t setupErrorCorrectionParameters(); - status_t setupH263EncoderParameters(const sp& meta); - status_t setupMPEG4EncoderParameters(const sp& meta); - status_t setupAVCEncoderParameters(const sp& meta); - status_t findTargetColorFormat( - const sp& meta, OMX_COLOR_FORMATTYPE *colorFormat); - - status_t isColorFormatSupported( - OMX_COLOR_FORMATTYPE colorFormat, int portIndex); - - // If profile/level is set in the meta data, its value in the meta - // data will be used; otherwise, the default value will be used. - status_t getVideoProfileLevel(const sp& meta, - const CodecProfileLevel& defaultProfileLevel, - CodecProfileLevel& profileLevel); - - status_t setVideoOutputFormat( - const char *mime, OMX_U32 width, OMX_U32 height); - - void setImageOutputFormat( - OMX_COLOR_FORMATTYPE format, OMX_U32 width, OMX_U32 height); - - void setJPEGInputFormat( - OMX_U32 width, OMX_U32 height, OMX_U32 compressedSize); - - void setMinBufferSize(OMX_U32 portIndex, OMX_U32 size); - - void setRawAudioFormat( - OMX_U32 portIndex, int32_t sampleRate, int32_t numChannels); - - status_t allocateBuffers(); - status_t allocateBuffersOnPort(OMX_U32 portIndex); - status_t allocateOutputBuffersFromNativeWindow(); - - status_t queueBufferToNativeWindow(BufferInfo *info); - status_t cancelBufferToNativeWindow(BufferInfo *info); - BufferInfo* dequeueBufferFromNativeWindow(); - status_t pushBlankBuffersToNativeWindow(); - - status_t freeBuffersOnPort( - OMX_U32 portIndex, bool onlyThoseWeOwn = false); - - status_t freeBuffer(OMX_U32 portIndex, size_t bufIndex); - - bool drainInputBuffer(IOMX::buffer_id buffer); - void fillOutputBuffer(IOMX::buffer_id buffer); - bool drainInputBuffer(BufferInfo *info); - void fillOutputBuffer(BufferInfo *info); - - void drainInputBuffers(); - void fillOutputBuffers(); - - bool drainAnyInputBuffer(); - BufferInfo *findInputBufferByDataPointer(void *ptr); - BufferInfo *findEmptyInputBuffer(); - - // Returns true iff a flush was initiated and a completion event is - // upcoming, false otherwise (A flush was not necessary as we own all - // the buffers on that port). - // This method will ONLY ever return false for a component with quirk - // "kRequiresFlushCompleteEmulation". - bool flushPortAsync(OMX_U32 portIndex); - - void disablePortAsync(OMX_U32 portIndex); - status_t enablePortAsync(OMX_U32 portIndex); - - static size_t countBuffersWeOwn(const Vector &buffers); - static bool isIntermediateState(State state); - - void onEvent(OMX_EVENTTYPE event, OMX_U32 data1, OMX_U32 data2); - void onCmdComplete(OMX_COMMANDTYPE cmd, OMX_U32 data); - void onStateChange(OMX_STATETYPE newState); - void onPortSettingsChanged(OMX_U32 portIndex); - - void setState(State newState); - - status_t init(); - void initOutputFormat(const sp &inputFormat); - status_t initNativeWindow(); - - void initNativeWindowCrop(); - - void dumpPortStatus(OMX_U32 portIndex); - - status_t configureCodec(const sp &meta); - - static uint32_t getComponentQuirks( - const char *componentName, bool isEncoder); - - void restorePatchedDataPointer(BufferInfo *info); - - status_t applyRotation(); - status_t waitForBufferFilled_l(); - - int64_t retrieveDecodingTimeUs(bool isCodecSpecific); - - OMXCodec(const OMXCodec &); - OMXCodec &operator=(const OMXCodec &); -}; - -struct CodecCapabilities { - String8 mComponentName; - Vector mProfileLevels; - Vector mColorFormats; -}; - -// Return a vector of componentNames with supported profile/level pairs -// supporting the given mime type, if queryDecoders==true, returns components -// that decode content of the given type, otherwise returns components -// that encode content of the given type. -// profile and level indications only make sense for h.263, mpeg4 and avc -// video. -// If hwCodecOnly==true, only returns hardware-based components, software and -// hardware otherwise. -// The profile/level values correspond to -// OMX_VIDEO_H263PROFILETYPE, OMX_VIDEO_MPEG4PROFILETYPE, -// OMX_VIDEO_AVCPROFILETYPE, OMX_VIDEO_H263LEVELTYPE, OMX_VIDEO_MPEG4LEVELTYPE -// and OMX_VIDEO_AVCLEVELTYPE respectively. - -status_t QueryCodecs( - const sp &omx, - const char *mimeType, bool queryDecoders, bool hwCodecOnly, - Vector *results); - -status_t QueryCodecs( - const sp &omx, - const char *mimeType, bool queryDecoders, - Vector *results); - -} // namespace android - -#endif // OMX_CODEC_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/OMXPluginBase.h b/external/android/include/14/frameworks/base/include/media/stagefright/OMXPluginBase.h deleted file mode 100644 index 2fd8e12..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/OMXPluginBase.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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 OMX_PLUGIN_BASE_H_ - -#define OMX_PLUGIN_BASE_H_ - -#include - -#include - -#include -#include - -namespace android { - -struct OMXComponentBase; - -struct OMXPluginBase { - OMXPluginBase() {} - virtual ~OMXPluginBase() {} - - virtual OMX_ERRORTYPE makeComponentInstance( - const char *name, - const OMX_CALLBACKTYPE *callbacks, - OMX_PTR appData, - OMX_COMPONENTTYPE **component) = 0; - - virtual OMX_ERRORTYPE destroyComponentInstance( - OMX_COMPONENTTYPE *component) = 0; - - virtual OMX_ERRORTYPE enumerateComponents( - OMX_STRING name, - size_t size, - OMX_U32 index) = 0; - - virtual OMX_ERRORTYPE getRolesOfComponent( - const char *name, - Vector *roles) = 0; - -private: - OMXPluginBase(const OMXPluginBase &); - OMXPluginBase &operator=(const OMXPluginBase &); -}; - -} // namespace android - -#endif // OMX_PLUGIN_BASE_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/StagefrightMediaScanner.h b/external/android/include/14/frameworks/base/include/media/stagefright/StagefrightMediaScanner.h deleted file mode 100644 index 6510a59..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/StagefrightMediaScanner.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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 STAGEFRIGHT_MEDIA_SCANNER_H_ - -#define STAGEFRIGHT_MEDIA_SCANNER_H_ - -#include - -namespace android { - -struct StagefrightMediaScanner : public MediaScanner { - StagefrightMediaScanner(); - virtual ~StagefrightMediaScanner(); - - virtual MediaScanResult processFile( - const char *path, const char *mimeType, - MediaScannerClient &client); - - virtual char *extractAlbumArt(int fd); - -private: - StagefrightMediaScanner(const StagefrightMediaScanner &); - StagefrightMediaScanner &operator=(const StagefrightMediaScanner &); - - MediaScanResult processFileInternal( - const char *path, const char *mimeType, - MediaScannerClient &client); -}; - -} // namespace android - -#endif // STAGEFRIGHT_MEDIA_SCANNER_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/SurfaceMediaSource.h b/external/android/include/14/frameworks/base/include/media/stagefright/SurfaceMediaSource.h deleted file mode 100644 index d0940bb..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/SurfaceMediaSource.h +++ /dev/null @@ -1,369 +0,0 @@ -/* - * Copyright (C) 2011 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_GUI_SURFACEMEDIASOURCE_H -#define ANDROID_GUI_SURFACEMEDIASOURCE_H - -#include - -#include -#include -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class IGraphicBufferAlloc; -class String8; -class GraphicBuffer; - -class SurfaceMediaSource : public BnSurfaceTexture, public MediaSource, - public MediaBufferObserver { -public: - enum { MIN_UNDEQUEUED_BUFFERS = 4 }; - enum { - MIN_ASYNC_BUFFER_SLOTS = MIN_UNDEQUEUED_BUFFERS + 1, - MIN_SYNC_BUFFER_SLOTS = MIN_UNDEQUEUED_BUFFERS - }; - enum { NUM_BUFFER_SLOTS = 32 }; - enum { NO_CONNECTED_API = 0 }; - - struct FrameAvailableListener : public virtual RefBase { - // onFrameAvailable() is called from queueBuffer() is the FIFO is - // empty. You can use SurfaceMediaSource::getQueuedCount() to - // figure out if there are more frames waiting. - // This is called without any lock held can be called concurrently by - // multiple threads. - virtual void onFrameAvailable() = 0; - }; - - SurfaceMediaSource(uint32_t bufW, uint32_t bufH); - - virtual ~SurfaceMediaSource(); - - - // For the MediaSource interface for use by StageFrightRecorder: - virtual status_t start(MetaData *params = NULL); - virtual status_t stop(); - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL); - virtual sp getFormat(); - - // Pass the metadata over to the buffer, call when you have the lock - void passMetadataBufferLocked(MediaBuffer **buffer); - bool checkBufferMatchesSlot(int slot, MediaBuffer *buffer); - - // Get / Set the frame rate used for encoding. Default fps = 30 - status_t setFrameRate(int32_t fps) ; - int32_t getFrameRate( ) const; - - // The call for the StageFrightRecorder to tell us that - // it is done using the MediaBuffer data so that its state - // can be set to FREE for dequeuing - virtual void signalBufferReturned(MediaBuffer* buffer); - // end of MediaSource interface - - uint32_t getBufferCount( ) const { return mBufferCount;} - - - // setBufferCount updates the number of available buffer slots. After - // calling this all buffer slots are both unallocated and owned by the - // SurfaceMediaSource object (i.e. they are not owned by the client). - virtual status_t setBufferCount(int bufferCount); - - virtual status_t requestBuffer(int slot, sp* buf); - - // dequeueBuffer gets the next buffer slot index for the client to use. If a - // buffer slot is available then that slot index is written to the location - // pointed to by the buf argument and a status of OK is returned. If no - // slot is available then a status of -EBUSY is returned and buf is - // unmodified. - virtual status_t dequeueBuffer(int *buf, uint32_t w, uint32_t h, - uint32_t format, uint32_t usage); - - // queueBuffer returns a filled buffer to the SurfaceMediaSource. In addition, a - // timestamp must be provided for the buffer. The timestamp is in - // nanoseconds, and must be monotonically increasing. Its other semantics - // (zero point, etc) are client-dependent and should be documented by the - // client. - virtual status_t queueBuffer(int buf, int64_t timestamp, - uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform); - virtual void cancelBuffer(int buf); - - // onFrameReceivedLocked informs the buffer consumers (StageFrightRecorder) - // or listeners that a frame has been received - // The buffer is not made available for dequeueing immediately. We need to - // wait to hear from StageFrightRecorder to set the buffer FREE - // Make sure this is called when the mutex is locked - virtual status_t onFrameReceivedLocked(); - - virtual status_t setScalingMode(int mode) { } // no op for encoding - virtual int query(int what, int* value); - - // Just confirming to the ISurfaceTexture interface as of now - virtual status_t setCrop(const Rect& reg) { return OK; } - virtual status_t setTransform(uint32_t transform) {return OK;} - - // setSynchronousMode set whether dequeueBuffer is synchronous or - // asynchronous. In synchronous mode, dequeueBuffer blocks until - // a buffer is available, the currently bound buffer can be dequeued and - // queued buffers will be retired in order. - // The default mode is synchronous. - // TODO: Clarify the minute differences bet sycn /async - // modes (S.Encoder vis-a-vis SurfaceTexture) - virtual status_t setSynchronousMode(bool enabled); - - // connect attempts to connect a client API to the SurfaceMediaSource. This - // must be called before any other ISurfaceTexture methods are called except - // for getAllocator. - // - // This method will fail if the connect was previously called on the - // SurfaceMediaSource and no corresponding disconnect call was made. - virtual status_t connect(int api, - uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform); - - // disconnect attempts to disconnect a client API from the SurfaceMediaSource. - // Calling this method will cause any subsequent calls to other - // ISurfaceTexture methods to fail except for getAllocator and connect. - // Successfully calling connect after this will allow the other methods to - // succeed again. - // - // This method will fail if the the SurfaceMediaSource is not currently - // connected to the specified client API. - virtual status_t disconnect(int api); - - // getqueuedCount returns the number of queued frames waiting in the - // FIFO. In asynchronous mode, this always returns 0 or 1 since - // frames are not accumulating in the FIFO. - size_t getQueuedCount() const; - - // setBufferCountServer set the buffer count. If the client has requested - // a buffer count using setBufferCount, the server-buffer count will - // take effect once the client sets the count back to zero. - status_t setBufferCountServer(int bufferCount); - - // getTimestamp retrieves the timestamp associated with the image - // set by the most recent call to read() - // - // The timestamp is in nanoseconds, and is monotonically increasing. Its - // other semantics (zero point, etc) are source-dependent and should be - // documented by the source. - int64_t getTimestamp(); - - // setFrameAvailableListener sets the listener object that will be notified - // when a new frame becomes available. - void setFrameAvailableListener(const sp& listener); - - // getCurrentBuffer returns the buffer associated with the current image. - sp getCurrentBuffer() const; - - // dump our state in a String - void dump(String8& result) const; - void dump(String8& result, const char* prefix, char* buffer, - size_t SIZE) const; - - // isMetaDataStoredInVideoBuffers tells the encoder whether we will - // pass metadata through the buffers. Currently, it is force set to true - bool isMetaDataStoredInVideoBuffers() const; - -protected: - - // freeAllBuffersLocked frees the resources (both GraphicBuffer and EGLImage) for - // all slots. - void freeAllBuffersLocked(); - static bool isExternalFormat(uint32_t format); - -private: - - status_t setBufferCountServerLocked(int bufferCount); - - enum { INVALID_BUFFER_SLOT = -1 }; - - struct BufferSlot { - - BufferSlot() - : mBufferState(BufferSlot::FREE), - mRequestBufferCalled(false), - mTimestamp(0) { - } - - // mGraphicBuffer points to the buffer allocated for this slot or is - // NULL if no buffer has been allocated. - sp mGraphicBuffer; - - // BufferState represents the different states in which a buffer slot - // can be. - enum BufferState { - // FREE indicates that the buffer is not currently being used and - // will not be used in the future until it gets dequeued and - // subseqently queued by the client. - FREE = 0, - - // DEQUEUED indicates that the buffer has been dequeued by the - // client, but has not yet been queued or canceled. The buffer is - // considered 'owned' by the client, and the server should not use - // it for anything. - // - // Note that when in synchronous-mode (mSynchronousMode == true), - // the buffer that's currently attached to the texture may be - // dequeued by the client. That means that the current buffer can - // be in either the DEQUEUED or QUEUED state. In asynchronous mode, - // however, the current buffer is always in the QUEUED state. - DEQUEUED = 1, - - // QUEUED indicates that the buffer has been queued by the client, - // and has not since been made available for the client to dequeue. - // Attaching the buffer to the texture does NOT transition the - // buffer away from the QUEUED state. However, in Synchronous mode - // the current buffer may be dequeued by the client under some - // circumstances. See the note about the current buffer in the - // documentation for DEQUEUED. - QUEUED = 2, - }; - - // mBufferState is the current state of this buffer slot. - BufferState mBufferState; - - // mRequestBufferCalled is used for validating that the client did - // call requestBuffer() when told to do so. Technically this is not - // needed but useful for debugging and catching client bugs. - bool mRequestBufferCalled; - - // mTimestamp is the current timestamp for this buffer slot. This gets - // to set by queueBuffer each time this slot is queued. - int64_t mTimestamp; - }; - - // mSlots is the array of buffer slots that must be mirrored on the client - // side. This allows buffer ownership to be transferred between the client - // and server without sending a GraphicBuffer over binder. The entire array - // is initialized to NULL at construction time, and buffers are allocated - // for a slot when requestBuffer is called with that slot's index. - BufferSlot mSlots[NUM_BUFFER_SLOTS]; - - // mDefaultWidth holds the default width of allocated buffers. It is used - // in requestBuffers() if a width and height of zero is specified. - uint32_t mDefaultWidth; - - // mDefaultHeight holds the default height of allocated buffers. It is used - // in requestBuffers() if a width and height of zero is specified. - uint32_t mDefaultHeight; - - // mPixelFormat holds the pixel format of allocated buffers. It is used - // in requestBuffers() if a format of zero is specified. - uint32_t mPixelFormat; - - // mBufferCount is the number of buffer slots that the client and server - // must maintain. It defaults to MIN_ASYNC_BUFFER_SLOTS and can be changed - // by calling setBufferCount or setBufferCountServer - int mBufferCount; - - // mClientBufferCount is the number of buffer slots requested by the - // client. The default is zero, which means the client doesn't care how - // many buffers there are - int mClientBufferCount; - - // mServerBufferCount buffer count requested by the server-side - int mServerBufferCount; - - // mCurrentSlot is the buffer slot index of the buffer that is currently - // being used by buffer consumer - // (e.g. StageFrightRecorder in the case of SurfaceMediaSource or GLTexture - // in the case of SurfaceTexture). - // It is initialized to INVALID_BUFFER_SLOT, - // indicating that no buffer slot is currently bound to the texture. Note, - // however, that a value of INVALID_BUFFER_SLOT does not necessarily mean - // that no buffer is bound to the texture. A call to setBufferCount will - // reset mCurrentTexture to INVALID_BUFFER_SLOT. - int mCurrentSlot; - - - // mCurrentBuf is the graphic buffer of the current slot to be used by - // buffer consumer. It's possible that this buffer is not associated - // with any buffer slot, so we must track it separately in order to - // properly use IGraphicBufferAlloc::freeAllGraphicBuffersExcept. - sp mCurrentBuf; - - - // mCurrentTimestamp is the timestamp for the current texture. It - // gets set to mLastQueuedTimestamp each time updateTexImage is called. - int64_t mCurrentTimestamp; - - // mGraphicBufferAlloc is the connection to SurfaceFlinger that is used to - // allocate new GraphicBuffer objects. - sp mGraphicBufferAlloc; - - // mFrameAvailableListener is the listener object that will be called when a - // new frame becomes available. If it is not NULL it will be called from - // queueBuffer. - sp mFrameAvailableListener; - - // mSynchronousMode whether we're in synchronous mode or not - bool mSynchronousMode; - - // mConnectedApi indicates the API that is currently connected to this - // SurfaceTexture. It defaults to NO_CONNECTED_API (= 0), and gets updated - // by the connect and disconnect methods. - int mConnectedApi; - - // mDequeueCondition condition used for dequeueBuffer in synchronous mode - mutable Condition mDequeueCondition; - - - // mQueue is a FIFO of queued buffers used in synchronous mode - typedef Vector Fifo; - Fifo mQueue; - - // mMutex is the mutex used to prevent concurrent access to the member - // variables of SurfaceMediaSource objects. It must be locked whenever the - // member variables are accessed. - mutable Mutex mMutex; - - ////////////////////////// For MediaSource - // Set to a default of 30 fps if not specified by the client side - int32_t mFrameRate; - - // mStopped is a flag to check if the recording is going on - bool mStopped; - - // mNumFramesReceived indicates the number of frames recieved from - // the client side - int mNumFramesReceived; - // mNumFramesEncoded indicates the number of frames passed on to the - // encoder - int mNumFramesEncoded; - - // mFirstFrameTimestamp is the timestamp of the first received frame. - // It is used to offset the output timestamps so recording starts at time 0. - int64_t mFirstFrameTimestamp; - // mStartTimeNs is the start time passed into the source at start, used to - // offset timestamps. - int64_t mStartTimeNs; - - // mFrameAvailableCondition condition used to indicate whether there - // is a frame available for dequeuing - Condition mFrameAvailableCondition; - Condition mFrameCompleteCondition; - - // Avoid copying and equating and default constructor - DISALLOW_IMPLICIT_CONSTRUCTORS(SurfaceMediaSource); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_SURFACEMEDIASOURCE_H diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/TimeSource.h b/external/android/include/14/frameworks/base/include/media/stagefright/TimeSource.h deleted file mode 100644 index 443673d..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/TimeSource.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 TIME_SOURCE_H_ - -#define TIME_SOURCE_H_ - -#include - -namespace android { - -class TimeSource { -public: - TimeSource() {} - virtual ~TimeSource() {} - - virtual int64_t getRealTimeUs() = 0; - -private: - TimeSource(const TimeSource &); - TimeSource &operator=(const TimeSource &); -}; - -class SystemTimeSource : public TimeSource { -public: - SystemTimeSource(); - - virtual int64_t getRealTimeUs(); - -private: - static int64_t GetSystemTimeUs(); - - int64_t mStartTimeUs; -}; - -} // namespace android - -#endif // TIME_SOURCE_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/Utils.h b/external/android/include/14/frameworks/base/include/media/stagefright/Utils.h deleted file mode 100644 index 498b525..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/Utils.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 UTILS_H_ - -#define UTILS_H_ - -#include - -namespace android { - -#define FOURCC(c1, c2, c3, c4) \ - (c1 << 24 | c2 << 16 | c3 << 8 | c4) - -uint16_t U16_AT(const uint8_t *ptr); -uint32_t U32_AT(const uint8_t *ptr); -uint64_t U64_AT(const uint8_t *ptr); - -uint16_t U16LE_AT(const uint8_t *ptr); -uint32_t U32LE_AT(const uint8_t *ptr); -uint64_t U64LE_AT(const uint8_t *ptr); - -uint64_t ntoh64(uint64_t x); -uint64_t hton64(uint64_t x); - -} // namespace android - -#endif // UTILS_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/VideoSourceDownSampler.h b/external/android/include/14/frameworks/base/include/media/stagefright/VideoSourceDownSampler.h deleted file mode 100644 index 439918c..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/VideoSourceDownSampler.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -// VideoSourceDownSampler implements the MediaSource interface, -// downsampling frames provided from a real video source. - -#ifndef VIDEO_SOURCE_DOWN_SAMPLER_H_ - -#define VIDEO_SOURCE_DOWN_SAMPLER_H_ - -#include -#include - -namespace android { - -class IMemory; -class MediaBuffer; -class MetaData; - -class VideoSourceDownSampler : public MediaSource { -public: - virtual ~VideoSourceDownSampler(); - - // Constructor: - // videoSource: The real video source which provides the original frames. - // width, height: The desired width, height. These should be less than or equal - // to those of the real video source. We then downsample the original frames to - // this size. - VideoSourceDownSampler(const sp &videoSource, - int32_t width, int32_t height); - - // MediaSource interface - virtual status_t start(MetaData *params = NULL); - - virtual status_t stop(); - - virtual sp getFormat(); - - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL); - - virtual status_t pause(); - -private: - // Reference to the real video source. - sp mRealVideoSource; - - // Size of frames to be provided by this source. - int32_t mWidth; - int32_t mHeight; - - // Size of frames provided by the real source. - int32_t mRealSourceWidth; - int32_t mRealSourceHeight; - - // Down sampling paramters. - int32_t mDownSampleOffsetX; - int32_t mDownSampleOffsetY; - int32_t mDownSampleSkipX; - int32_t mDownSampleSkipY; - - // True if we need to crop the still video image to get the video frame. - bool mNeedDownSampling; - - // Meta data. This is a copy of the real source except for the width and - // height parameters. - sp mMeta; - - // Computes the offset, skip parameters for downsampling the original frame - // to the desired size. - void computeDownSamplingParameters(); - - // Downsamples the frame in sourceBuffer to size (mWidth x mHeight). A new - // buffer is created which stores the downsampled image. - void downSampleYUVImage(const MediaBuffer &sourceBuffer, MediaBuffer **buffer) const; - - // Disallow these. - VideoSourceDownSampler(const VideoSourceDownSampler &); - VideoSourceDownSampler &operator=(const VideoSourceDownSampler &); -}; - -} // namespace android - -#endif // VIDEO_SOURCE_DOWN_SAMPLER_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/YUVCanvas.h b/external/android/include/14/frameworks/base/include/media/stagefright/YUVCanvas.h deleted file mode 100644 index ff70923..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/YUVCanvas.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -// YUVCanvas holds a reference to a YUVImage on which it can do various -// drawing operations. It provides various utility functions for filling, -// cropping, etc. - - -#ifndef YUV_CANVAS_H_ - -#define YUV_CANVAS_H_ - -#include - -namespace android { - -class YUVImage; -class Rect; - -class YUVCanvas { -public: - - // Constructor takes in reference to a yuvImage on which it can do - // various drawing opreations. - YUVCanvas(YUVImage &yuvImage); - ~YUVCanvas(); - - // Fills the entire image with the given YUV values. - void FillYUV(uint8_t yValue, uint8_t uValue, uint8_t vValue); - - // Fills the rectangular region [startX,endX]x[startY,endY] with the given YUV values. - void FillYUVRectangle(const Rect& rect, - uint8_t yValue, uint8_t uValue, uint8_t vValue); - - // Copies the region [startX,endX]x[startY,endY] from srcImage into the - // canvas' target image (mYUVImage) starting at - // (destinationStartX,destinationStartY). - // Note that undefined behavior may occur if srcImage is same as the canvas' - // target image. - void CopyImageRect( - const Rect& srcRect, - int32_t destStartX, int32_t destStartY, - const YUVImage &srcImage); - - // Downsamples the srcImage into the canvas' target image (mYUVImage) - // The downsampling copies pixels from the source image starting at - // (srcOffsetX, srcOffsetY) to the target image, starting at (0, 0). - // For each X increment in the target image, skipX pixels are skipped - // in the source image. - // Similarly for each Y increment in the target image, skipY pixels - // are skipped in the source image. - void downsample( - int32_t srcOffsetX, int32_t srcOffsetY, - int32_t skipX, int32_t skipY, - const YUVImage &srcImage); - -private: - YUVImage& mYUVImage; - - YUVCanvas(const YUVCanvas &); - YUVCanvas &operator=(const YUVCanvas &); -}; - -} // namespace android - -#endif // YUV_CANVAS_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/YUVImage.h b/external/android/include/14/frameworks/base/include/media/stagefright/YUVImage.h deleted file mode 100644 index 4e98618..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/YUVImage.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -// A container class to hold YUV data and provide various utilities, -// e.g. to set/get pixel values. -// Supported formats: -// - YUV420 Planar -// - YUV420 Semi Planar -// -// Currently does not support variable strides. -// -// Implementation: Two simple abstractions are done to simplify access -// to YUV channels for different formats: -// - initializeYUVPointers() sets up pointers (mYdata, mUdata, mVdata) to -// point to the right start locations of the different channel data depending -// on the format. -// - getOffsets() returns the correct offset for the different channels -// depending on the format. -// Location of any pixel's YUV channels can then be easily computed using these. -// - -#ifndef YUV_IMAGE_H_ - -#define YUV_IMAGE_H_ - -#include -#include - -namespace android { - -class Rect; - -class YUVImage { -public: - // Supported YUV formats - enum YUVFormat { - YUV420Planar, - YUV420SemiPlanar - }; - - // Constructs an image with the given size, format. Also allocates and owns - // the required memory. - YUVImage(YUVFormat yuvFormat, int32_t width, int32_t height); - - // Constructs an image with the given size, format. The memory is provided - // by the caller and we don't own it. - YUVImage(YUVFormat yuvFormat, int32_t width, int32_t height, uint8_t *buffer); - - // Destructor to delete the memory if it owns it. - ~YUVImage(); - - // Returns the size of the buffer required to store the YUV data for the given - // format and geometry. Useful when the caller wants to allocate the requisite - // memory. - static size_t bufferSize(YUVFormat yuvFormat, int32_t width, int32_t height); - - int32_t width() const {return mWidth;} - int32_t height() const {return mHeight;} - - // Returns true if pixel is the range [0, width-1] x [0, height-1] - // and false otherwise. - bool validPixel(int32_t x, int32_t y) const; - - // Get the pixel YUV value at pixel (x,y). - // Note that the range of x is [0, width-1] and the range of y is [0, height-1]. - // Returns true if get was successful and false otherwise. - bool getPixelValue(int32_t x, int32_t y, - uint8_t *yPtr, uint8_t *uPtr, uint8_t *vPtr) const; - - // Set the pixel YUV value at pixel (x,y). - // Note that the range of x is [0, width-1] and the range of y is [0, height-1]. - // Returns true if set was successful and false otherwise. - bool setPixelValue(int32_t x, int32_t y, - uint8_t yValue, uint8_t uValue, uint8_t vValue); - - // Uses memcpy to copy an entire row of data - static void fastCopyRectangle420Planar( - const Rect& srcRect, - int32_t destStartX, int32_t destStartY, - const YUVImage &srcImage, YUVImage &destImage); - - // Uses memcpy to copy an entire row of data - static void fastCopyRectangle420SemiPlanar( - const Rect& srcRect, - int32_t destStartX, int32_t destStartY, - const YUVImage &srcImage, YUVImage &destImage); - - // Tries to use memcopy to copy entire rows of data. - // Returns false if fast copy is not possible for the passed image formats. - static bool fastCopyRectangle( - const Rect& srcRect, - int32_t destStartX, int32_t destStartY, - const YUVImage &srcImage, YUVImage &destImage); - - // Convert the given YUV value to RGB. - void yuv2rgb(uint8_t yValue, uint8_t uValue, uint8_t vValue, - uint8_t *r, uint8_t *g, uint8_t *b) const; - - // Write the image to a human readable PPM file. - // Returns true if write was succesful and false otherwise. - bool writeToPPM(const char *filename) const; - -private: - // YUV Format of the image. - YUVFormat mYUVFormat; - - int32_t mWidth; - int32_t mHeight; - - // Pointer to the memory buffer. - uint8_t *mBuffer; - - // Boolean telling whether we own the memory buffer. - bool mOwnBuffer; - - // Pointer to start of the Y data plane. - uint8_t *mYdata; - - // Pointer to start of the U data plane. Note that in case of interleaved formats like - // YUV420 semiplanar, mUdata points to the start of the U data in the UV plane. - uint8_t *mUdata; - - // Pointer to start of the V data plane. Note that in case of interleaved formats like - // YUV420 semiplanar, mVdata points to the start of the V data in the UV plane. - uint8_t *mVdata; - - // Initialize the pointers mYdata, mUdata, mVdata to point to the right locations for - // the given format and geometry. - // Returns true if initialize was succesful and false otherwise. - bool initializeYUVPointers(); - - // For the given pixel location, this returns the offset of the location of y, u and v - // data from the corresponding base pointers -- mYdata, mUdata, mVdata. - // Note that the range of x is [0, width-1] and the range of y is [0, height-1]. - // Returns true if getting offsets was succesful and false otherwise. - bool getOffsets(int32_t x, int32_t y, - int32_t *yOffset, int32_t *uOffset, int32_t *vOffset) const; - - // Returns the offset increments incurred in going from one data row to the next data row - // for the YUV channels. Note that this corresponds to data rows and not pixel rows. - // E.g. depending on formats, U/V channels may have only one data row corresponding - // to two pixel rows. - bool getOffsetIncrementsPerDataRow( - int32_t *yDataOffsetIncrement, - int32_t *uDataOffsetIncrement, - int32_t *vDataOffsetIncrement) const; - - // Given the offset return the address of the corresponding channel's data. - uint8_t* getYAddress(int32_t offset) const; - uint8_t* getUAddress(int32_t offset) const; - uint8_t* getVAddress(int32_t offset) const; - - // Given the pixel location, returns the address of the corresponding channel's data. - // Note that the range of x is [0, width-1] and the range of y is [0, height-1]. - bool getYUVAddresses(int32_t x, int32_t y, - uint8_t **yAddr, uint8_t **uAddr, uint8_t **vAddr) const; - - // Disallow implicit casting and copying. - YUVImage(const YUVImage &); - YUVImage &operator=(const YUVImage &); -}; - -} // namespace android - -#endif // YUV_IMAGE_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/AAtomizer.h b/external/android/include/14/frameworks/base/include/media/stagefright/foundation/AAtomizer.h deleted file mode 100644 index 5f3a678..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/AAtomizer.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2010 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 A_ATOMIZER_H_ - -#define A_ATOMIZER_H_ - -#include - -#include -#include -#include -#include -#include - -namespace android { - -struct AAtomizer { - static const char *Atomize(const char *name); - -private: - static AAtomizer gAtomizer; - - Mutex mLock; - Vector > mAtoms; - - AAtomizer(); - - const char *atomize(const char *name); - - static uint32_t Hash(const char *s); - - DISALLOW_EVIL_CONSTRUCTORS(AAtomizer); -}; - -} // namespace android - -#endif // A_ATOMIZER_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/ABase.h b/external/android/include/14/frameworks/base/include/media/stagefright/foundation/ABase.h deleted file mode 100644 index 9eceea3..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/ABase.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2010 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 A_BASE_H_ - -#define A_BASE_H_ - -#define DISALLOW_EVIL_CONSTRUCTORS(name) \ - name(const name &); \ - name &operator=(const name &) - -#endif // A_BASE_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/ABitReader.h b/external/android/include/14/frameworks/base/include/media/stagefright/foundation/ABitReader.h deleted file mode 100644 index 5510b12..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/ABitReader.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2010 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 A_BIT_READER_H_ - -#define A_BIT_READER_H_ - -#include - -#include -#include - -namespace android { - -struct ABitReader { - ABitReader(const uint8_t *data, size_t size); - - uint32_t getBits(size_t n); - void skipBits(size_t n); - - void putBits(uint32_t x, size_t n); - - size_t numBitsLeft() const; - - const uint8_t *data() const; - -private: - const uint8_t *mData; - size_t mSize; - - uint32_t mReservoir; // left-aligned bits - size_t mNumBitsLeft; - - void fillReservoir(); - - DISALLOW_EVIL_CONSTRUCTORS(ABitReader); -}; - -} // namespace android - -#endif // A_BIT_READER_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/ABuffer.h b/external/android/include/14/frameworks/base/include/media/stagefright/foundation/ABuffer.h deleted file mode 100644 index 28f0aed..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/ABuffer.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2010 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 A_BUFFER_H_ - -#define A_BUFFER_H_ - -#include -#include - -#include -#include - -namespace android { - -struct AMessage; - -struct ABuffer : public RefBase { - ABuffer(size_t capacity); - ABuffer(void *data, size_t capacity); - - void setFarewellMessage(const sp msg); - - uint8_t *base() { return (uint8_t *)mData; } - uint8_t *data() { return (uint8_t *)mData + mRangeOffset; } - size_t capacity() const { return mCapacity; } - size_t size() const { return mRangeLength; } - size_t offset() const { return mRangeOffset; } - - void setRange(size_t offset, size_t size); - - void setInt32Data(int32_t data) { mInt32Data = data; } - int32_t int32Data() const { return mInt32Data; } - - sp meta(); - -protected: - virtual ~ABuffer(); - -private: - sp mFarewell; - sp mMeta; - - void *mData; - size_t mCapacity; - size_t mRangeOffset; - size_t mRangeLength; - - int32_t mInt32Data; - - bool mOwnsData; - - DISALLOW_EVIL_CONSTRUCTORS(ABuffer); -}; - -} // namespace android - -#endif // A_BUFFER_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/ADebug.h b/external/android/include/14/frameworks/base/include/media/stagefright/foundation/ADebug.h deleted file mode 100644 index 450dcfe..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/ADebug.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2010 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 A_DEBUG_H_ - -#define A_DEBUG_H_ - -#include - -#include -#include -#include - -namespace android { - -#define LITERAL_TO_STRING_INTERNAL(x) #x -#define LITERAL_TO_STRING(x) LITERAL_TO_STRING_INTERNAL(x) - -#define CHECK(condition) \ - LOG_ALWAYS_FATAL_IF( \ - !(condition), \ - "%s", \ - __FILE__ ":" LITERAL_TO_STRING(__LINE__) \ - " CHECK(" #condition ") failed.") - -#define MAKE_COMPARATOR(suffix,op) \ - template \ - AString Compare_##suffix(const A &a, const B &b) { \ - AString res; \ - if (!(a op b)) { \ - res.append(a); \ - res.append(" vs. "); \ - res.append(b); \ - } \ - return res; \ - } - -MAKE_COMPARATOR(EQ,==) -MAKE_COMPARATOR(NE,!=) -MAKE_COMPARATOR(LE,<=) -MAKE_COMPARATOR(GE,>=) -MAKE_COMPARATOR(LT,<) -MAKE_COMPARATOR(GT,>) - -#define CHECK_OP(x,y,suffix,op) \ - do { \ - AString ___res = Compare_##suffix(x, y); \ - if (!___res.empty()) { \ - AString ___full = \ - __FILE__ ":" LITERAL_TO_STRING(__LINE__) \ - " CHECK_" #suffix "( " #x "," #y ") failed: "; \ - ___full.append(___res); \ - \ - LOG_ALWAYS_FATAL("%s", ___full.c_str()); \ - } \ - } while (false) - -#define CHECK_EQ(x,y) CHECK_OP(x,y,EQ,==) -#define CHECK_NE(x,y) CHECK_OP(x,y,NE,!=) -#define CHECK_LE(x,y) CHECK_OP(x,y,LE,<=) -#define CHECK_LT(x,y) CHECK_OP(x,y,LT,<) -#define CHECK_GE(x,y) CHECK_OP(x,y,GE,>=) -#define CHECK_GT(x,y) CHECK_OP(x,y,GT,>) - -#define TRESPASS() \ - LOG_ALWAYS_FATAL( \ - __FILE__ ":" LITERAL_TO_STRING(__LINE__) \ - " Should not be here."); - -} // namespace android - -#endif // A_DEBUG_H_ - diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/AHandler.h b/external/android/include/14/frameworks/base/include/media/stagefright/foundation/AHandler.h deleted file mode 100644 index b008b54..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/AHandler.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2010 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 A_HANDLER_H_ - -#define A_HANDLER_H_ - -#include -#include - -namespace android { - -struct AMessage; - -struct AHandler : public RefBase { - AHandler() - : mID(0) { - } - - ALooper::handler_id id() const { - return mID; - } - - sp looper(); - -protected: - virtual void onMessageReceived(const sp &msg) = 0; - -private: - friend struct ALooperRoster; - - ALooper::handler_id mID; - - void setID(ALooper::handler_id id) { - mID = id; - } - - DISALLOW_EVIL_CONSTRUCTORS(AHandler); -}; - -} // namespace android - -#endif // A_HANDLER_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/AHandlerReflector.h b/external/android/include/14/frameworks/base/include/media/stagefright/foundation/AHandlerReflector.h deleted file mode 100644 index 9d201b5..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/AHandlerReflector.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2010 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 A_HANDLER_REFLECTOR_H_ - -#define A_HANDLER_REFLECTOR_H_ - -#include - -namespace android { - -template -struct AHandlerReflector : public AHandler { - AHandlerReflector(T *target) - : mTarget(target) { - } - -protected: - virtual void onMessageReceived(const sp &msg) { - sp target = mTarget.promote(); - if (target != NULL) { - target->onMessageReceived(msg); - } - } - -private: - wp mTarget; - - AHandlerReflector(const AHandlerReflector &); - AHandlerReflector &operator=(const AHandlerReflector &); -}; - -} // namespace android - -#endif // A_HANDLER_REFLECTOR_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/AHierarchicalStateMachine.h b/external/android/include/14/frameworks/base/include/media/stagefright/foundation/AHierarchicalStateMachine.h deleted file mode 100644 index d2e6b28..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/AHierarchicalStateMachine.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2010 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 A_HIERARCHICAL_STATE_MACHINE_H_ - -#define A_HIERARCHICAL_STATE_MACHINE_H_ - -#include - -namespace android { - -struct AState : public RefBase { - AState(const sp &parentState = NULL); - - sp parentState(); - -protected: - virtual ~AState(); - - virtual void stateEntered(); - virtual void stateExited(); - - virtual bool onMessageReceived(const sp &msg) = 0; - -private: - friend struct AHierarchicalStateMachine; - - sp mParentState; - - DISALLOW_EVIL_CONSTRUCTORS(AState); -}; - -struct AHierarchicalStateMachine : public AHandler { - AHierarchicalStateMachine(); - -protected: - virtual ~AHierarchicalStateMachine(); - - virtual void onMessageReceived(const sp &msg); - - // Only to be called in response to a message. - void changeState(const sp &state); - -private: - sp mState; - - DISALLOW_EVIL_CONSTRUCTORS(AHierarchicalStateMachine); -}; - -} // namespace android - -#endif // A_HIERARCHICAL_STATE_MACHINE_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/ALooper.h b/external/android/include/14/frameworks/base/include/media/stagefright/foundation/ALooper.h deleted file mode 100644 index 70e0c5e..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/ALooper.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2010 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 A_LOOPER_H_ - -#define A_LOOPER_H_ - -#include -#include -#include -#include -#include -#include -#include - -namespace android { - -struct AHandler; -struct AMessage; - -struct ALooper : public RefBase { - typedef int32_t event_id; - typedef int32_t handler_id; - - ALooper(); - - // Takes effect in a subsequent call to start(). - void setName(const char *name); - - handler_id registerHandler(const sp &handler); - void unregisterHandler(handler_id handlerID); - - status_t start( - bool runOnCallingThread = false, - bool canCallJava = false, - int32_t priority = PRIORITY_DEFAULT - ); - - status_t stop(); - - static int64_t GetNowUs(); - -protected: - virtual ~ALooper(); - -private: - friend struct ALooperRoster; - - struct Event { - int64_t mWhenUs; - sp mMessage; - }; - - Mutex mLock; - Condition mQueueChangedCondition; - - AString mName; - - List mEventQueue; - - struct LooperThread; - sp mThread; - bool mRunningLocally; - - void post(const sp &msg, int64_t delayUs); - bool loop(); - - DISALLOW_EVIL_CONSTRUCTORS(ALooper); -}; - -} // namespace android - -#endif // A_LOOPER_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/ALooperRoster.h b/external/android/include/14/frameworks/base/include/media/stagefright/foundation/ALooperRoster.h deleted file mode 100644 index 2e5fd73..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/ALooperRoster.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2010 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 A_LOOPER_ROSTER_H_ - -#define A_LOOPER_ROSTER_H_ - -#include -#include - -namespace android { - -struct ALooperRoster { - ALooperRoster(); - - ALooper::handler_id registerHandler( - const sp looper, const sp &handler); - - void unregisterHandler(ALooper::handler_id handlerID); - - status_t postMessage(const sp &msg, int64_t delayUs = 0); - void deliverMessage(const sp &msg); - - status_t postAndAwaitResponse( - const sp &msg, sp *response); - - void postReply(uint32_t replyID, const sp &reply); - - sp findLooper(ALooper::handler_id handlerID); - -private: - struct HandlerInfo { - wp mLooper; - wp mHandler; - }; - - Mutex mLock; - KeyedVector mHandlers; - ALooper::handler_id mNextHandlerID; - uint32_t mNextReplyID; - Condition mRepliesCondition; - - KeyedVector > mReplies; - - status_t postMessage_l(const sp &msg, int64_t delayUs); - - DISALLOW_EVIL_CONSTRUCTORS(ALooperRoster); -}; - -} // namespace android - -#endif // A_LOOPER_ROSTER_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/AMessage.h b/external/android/include/14/frameworks/base/include/media/stagefright/foundation/AMessage.h deleted file mode 100644 index 7ec54aa..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/AMessage.h +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (C) 2010 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 A_MESSAGE_H_ - -#define A_MESSAGE_H_ - -#include -#include -#include -#include - -namespace android { - -struct AString; -struct Parcel; - -struct AMessage : public RefBase { - AMessage(uint32_t what = 0, ALooper::handler_id target = 0); - - static sp FromParcel(const Parcel &parcel); - void writeToParcel(Parcel *parcel) const; - - void setWhat(uint32_t what); - uint32_t what() const; - - void setTarget(ALooper::handler_id target); - ALooper::handler_id target() const; - - void clear(); - - void setInt32(const char *name, int32_t value); - void setInt64(const char *name, int64_t value); - void setSize(const char *name, size_t value); - void setFloat(const char *name, float value); - void setDouble(const char *name, double value); - void setPointer(const char *name, void *value); - void setString(const char *name, const char *s, ssize_t len = -1); - void setObject(const char *name, const sp &obj); - void setMessage(const char *name, const sp &obj); - - void setRect( - const char *name, - int32_t left, int32_t top, int32_t right, int32_t bottom); - - bool findInt32(const char *name, int32_t *value) const; - bool findInt64(const char *name, int64_t *value) const; - bool findSize(const char *name, size_t *value) const; - bool findFloat(const char *name, float *value) const; - bool findDouble(const char *name, double *value) const; - bool findPointer(const char *name, void **value) const; - bool findString(const char *name, AString *value) const; - bool findObject(const char *name, sp *obj) const; - bool findMessage(const char *name, sp *obj) const; - - bool findRect( - const char *name, - int32_t *left, int32_t *top, int32_t *right, int32_t *bottom) const; - - void post(int64_t delayUs = 0); - - // Posts the message to its target and waits for a response (or error) - // before returning. - status_t postAndAwaitResponse(sp *response); - - // If this returns true, the sender of this message is synchronously - // awaiting a response, the "replyID" can be used to send the response - // via "postReply" below. - bool senderAwaitsResponse(uint32_t *replyID) const; - - void postReply(uint32_t replyID); - - // Performs a deep-copy of "this", contained messages are in turn "dup'ed". - // Warning: RefBase items, i.e. "objects" are _not_ copied but only have - // their refcount incremented. - sp dup() const; - - AString debugString(int32_t indent = 0) const; - -protected: - virtual ~AMessage(); - -private: - enum Type { - kTypeInt32, - kTypeInt64, - kTypeSize, - kTypeFloat, - kTypeDouble, - kTypePointer, - kTypeString, - kTypeObject, - kTypeMessage, - kTypeRect, - }; - - uint32_t mWhat; - ALooper::handler_id mTarget; - - struct Rect { - int32_t mLeft, mTop, mRight, mBottom; - }; - - struct Item { - union { - int32_t int32Value; - int64_t int64Value; - size_t sizeValue; - float floatValue; - double doubleValue; - void *ptrValue; - RefBase *refValue; - AString *stringValue; - Rect rectValue; - } u; - const char *mName; - Type mType; - }; - - enum { - kMaxNumItems = 16 - }; - Item mItems[kMaxNumItems]; - size_t mNumItems; - - Item *allocateItem(const char *name); - void freeItem(Item *item); - const Item *findItem(const char *name, Type type) const; - - DISALLOW_EVIL_CONSTRUCTORS(AMessage); -}; - -} // namespace android - -#endif // A_MESSAGE_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/AString.h b/external/android/include/14/frameworks/base/include/media/stagefright/foundation/AString.h deleted file mode 100644 index 55ade64..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/AString.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2010 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 A_STRING_H_ - -#define A_STRING_H_ - -#include - -namespace android { - -struct AString { - AString(); - AString(const char *s); - AString(const char *s, size_t size); - AString(const AString &from); - AString(const AString &from, size_t offset, size_t n); - ~AString(); - - AString &operator=(const AString &from); - void setTo(const char *s); - void setTo(const char *s, size_t size); - void setTo(const AString &from, size_t offset, size_t n); - - size_t size() const; - const char *c_str() const; - - bool empty() const; - - void clear(); - void trim(); - void erase(size_t start, size_t n); - - void append(char c) { append(&c, 1); } - void append(const char *s); - void append(const char *s, size_t size); - void append(const AString &from); - void append(const AString &from, size_t offset, size_t n); - void append(int x); - void append(unsigned x); - void append(long x); - void append(unsigned long x); - void append(long long x); - void append(unsigned long long x); - void append(float x); - void append(double x); - void append(void *x); - - void insert(const AString &from, size_t insertionPos); - void insert(const char *from, size_t size, size_t insertionPos); - - ssize_t find(const char *substring, size_t start = 0) const; - - size_t hash() const; - - bool operator==(const AString &other) const; - bool operator<(const AString &other) const; - bool operator>(const AString &other) const; - - int compare(const AString &other) const; - - bool startsWith(const char *prefix) const; - - void tolower(); - -private: - static const char *kEmptyString; - - char *mData; - size_t mSize; - size_t mAllocSize; - - void makeMutable(); -}; - -AString StringPrintf(const char *format, ...); - -} // namespace android - -#endif // A_STRING_H_ - diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/base64.h b/external/android/include/14/frameworks/base/include/media/stagefright/foundation/base64.h deleted file mode 100644 index e340b89..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/base64.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2010 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 BASE_64_H_ - -#define BASE_64_H_ - -#include - -namespace android { - -struct ABuffer; -struct AString; - -sp decodeBase64(const AString &s); -void encodeBase64(const void *data, size_t size, AString *out); - -} // namespace android - -#endif // BASE_64_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/hexdump.h b/external/android/include/14/frameworks/base/include/media/stagefright/foundation/hexdump.h deleted file mode 100644 index f6083a9..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/foundation/hexdump.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2010 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 HEXDUMP_H_ - -#define HEXDUMP_H_ - -#include - -namespace android { - -void hexdump(const void *_data, size_t size); - -} // namespace android - -#endif // HEXDUMP_H_ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/openmax/OMX_Audio.h b/external/android/include/14/frameworks/base/include/media/stagefright/openmax/OMX_Audio.h deleted file mode 100644 index 3482841..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/openmax/OMX_Audio.h +++ /dev/null @@ -1,1328 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** @file OMX_Audio.h - OpenMax IL version 1.1.2 - * The structures needed by Audio components to exchange - * parameters and configuration data with the componenmilts. - */ - -#ifndef OMX_Audio_h -#define OMX_Audio_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/* Each OMX header must include all required header files to allow the - * header to compile without errors. The includes below are required - * for this header file to compile successfully - */ - -#include - -/** @defgroup midi MIDI - * @ingroup audio - */ - -/** @defgroup effects Audio effects - * @ingroup audio - */ - -/** @defgroup audio OpenMAX IL Audio Domain - * Structures for OpenMAX IL Audio domain - * @{ - */ - -/** Enumeration used to define the possible audio codings. - * If "OMX_AUDIO_CodingUnused" is selected, the coding selection must - * be done in a vendor specific way. Since this is for an audio - * processing element this enum is relevant. However, for another - * type of component other enums would be in this area. - */ -typedef enum OMX_AUDIO_CODINGTYPE { - OMX_AUDIO_CodingUnused = 0, /**< Placeholder value when coding is N/A */ - OMX_AUDIO_CodingAutoDetect, /**< auto detection of audio format */ - OMX_AUDIO_CodingPCM, /**< Any variant of PCM coding */ - OMX_AUDIO_CodingADPCM, /**< Any variant of ADPCM encoded data */ - OMX_AUDIO_CodingAMR, /**< Any variant of AMR encoded data */ - OMX_AUDIO_CodingGSMFR, /**< Any variant of GSM fullrate (i.e. GSM610) */ - OMX_AUDIO_CodingGSMEFR, /**< Any variant of GSM Enhanced Fullrate encoded data*/ - OMX_AUDIO_CodingGSMHR, /**< Any variant of GSM Halfrate encoded data */ - OMX_AUDIO_CodingPDCFR, /**< Any variant of PDC Fullrate encoded data */ - OMX_AUDIO_CodingPDCEFR, /**< Any variant of PDC Enhanced Fullrate encoded data */ - OMX_AUDIO_CodingPDCHR, /**< Any variant of PDC Halfrate encoded data */ - OMX_AUDIO_CodingTDMAFR, /**< Any variant of TDMA Fullrate encoded data (TIA/EIA-136-420) */ - OMX_AUDIO_CodingTDMAEFR, /**< Any variant of TDMA Enhanced Fullrate encoded data (TIA/EIA-136-410) */ - OMX_AUDIO_CodingQCELP8, /**< Any variant of QCELP 8kbps encoded data */ - OMX_AUDIO_CodingQCELP13, /**< Any variant of QCELP 13kbps encoded data */ - OMX_AUDIO_CodingEVRC, /**< Any variant of EVRC encoded data */ - OMX_AUDIO_CodingSMV, /**< Any variant of SMV encoded data */ - OMX_AUDIO_CodingG711, /**< Any variant of G.711 encoded data */ - OMX_AUDIO_CodingG723, /**< Any variant of G.723 dot 1 encoded data */ - OMX_AUDIO_CodingG726, /**< Any variant of G.726 encoded data */ - OMX_AUDIO_CodingG729, /**< Any variant of G.729 encoded data */ - OMX_AUDIO_CodingAAC, /**< Any variant of AAC encoded data */ - OMX_AUDIO_CodingMP3, /**< Any variant of MP3 encoded data */ - OMX_AUDIO_CodingSBC, /**< Any variant of SBC encoded data */ - OMX_AUDIO_CodingVORBIS, /**< Any variant of VORBIS encoded data */ - OMX_AUDIO_CodingWMA, /**< Any variant of WMA encoded data */ - OMX_AUDIO_CodingRA, /**< Any variant of RA encoded data */ - OMX_AUDIO_CodingMIDI, /**< Any variant of MIDI encoded data */ - OMX_AUDIO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_CodingMax = 0x7FFFFFFF -} OMX_AUDIO_CODINGTYPE; - - -/** The PortDefinition structure is used to define all of the parameters - * necessary for the compliant component to setup an input or an output audio - * path. If additional information is needed to define the parameters of the - * port (such as frequency), additional structures must be sent such as the - * OMX_AUDIO_PARAM_PCMMODETYPE structure to supply the extra parameters for the port. - */ -typedef struct OMX_AUDIO_PORTDEFINITIONTYPE { - OMX_STRING cMIMEType; /**< MIME type of data for the port */ - OMX_NATIVE_DEVICETYPE pNativeRender; /** < platform specific reference - for an output device, - otherwise this field is 0 */ - OMX_BOOL bFlagErrorConcealment; /**< Turns on error concealment if it is - supported by the OMX component */ - OMX_AUDIO_CODINGTYPE eEncoding; /**< Type of data expected for this - port (e.g. PCM, AMR, MP3, etc) */ -} OMX_AUDIO_PORTDEFINITIONTYPE; - - -/** Port format parameter. This structure is used to enumerate - * the various data input/output format supported by the port. - */ -typedef struct OMX_AUDIO_PARAM_PORTFORMATTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Indicates which port to set */ - OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */ - OMX_AUDIO_CODINGTYPE eEncoding; /**< Type of data expected for this port (e.g. PCM, AMR, MP3, etc) */ -} OMX_AUDIO_PARAM_PORTFORMATTYPE; - - -/** PCM mode type */ -typedef enum OMX_AUDIO_PCMMODETYPE { - OMX_AUDIO_PCMModeLinear = 0, /**< Linear PCM encoded data */ - OMX_AUDIO_PCMModeALaw, /**< A law PCM encoded data (G.711) */ - OMX_AUDIO_PCMModeMULaw, /**< Mu law PCM encoded data (G.711) */ - OMX_AUDIO_PCMModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_PCMModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_PCMModeMax = 0x7FFFFFFF -} OMX_AUDIO_PCMMODETYPE; - - -typedef enum OMX_AUDIO_CHANNELTYPE { - OMX_AUDIO_ChannelNone = 0x0, /**< Unused or empty */ - OMX_AUDIO_ChannelLF = 0x1, /**< Left front */ - OMX_AUDIO_ChannelRF = 0x2, /**< Right front */ - OMX_AUDIO_ChannelCF = 0x3, /**< Center front */ - OMX_AUDIO_ChannelLS = 0x4, /**< Left surround */ - OMX_AUDIO_ChannelRS = 0x5, /**< Right surround */ - OMX_AUDIO_ChannelLFE = 0x6, /**< Low frequency effects */ - OMX_AUDIO_ChannelCS = 0x7, /**< Back surround */ - OMX_AUDIO_ChannelLR = 0x8, /**< Left rear. */ - OMX_AUDIO_ChannelRR = 0x9, /**< Right rear. */ - OMX_AUDIO_ChannelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_ChannelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_ChannelMax = 0x7FFFFFFF -} OMX_AUDIO_CHANNELTYPE; - -#define OMX_AUDIO_MAXCHANNELS 16 /**< maximum number distinct audio channels that a buffer may contain */ -#define OMX_MIN_PCMPAYLOAD_MSEC 5 /**< Minimum audio buffer payload size for uncompressed (PCM) audio */ - -/** PCM format description */ -typedef struct OMX_AUDIO_PARAM_PCMMODETYPE { - OMX_U32 nSize; /**< Size of this structure, in Bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels (e.g. 2 for stereo) */ - OMX_NUMERICALDATATYPE eNumData; /**< indicates PCM data as signed or unsigned */ - OMX_ENDIANTYPE eEndian; /**< indicates PCM data as little or big endian */ - OMX_BOOL bInterleaved; /**< True for normal interleaved data; false for - non-interleaved data (e.g. block data) */ - OMX_U32 nBitPerSample; /**< Bit per sample */ - OMX_U32 nSamplingRate; /**< Sampling rate of the source data. Use 0 for - variable or unknown sampling rate. */ - OMX_AUDIO_PCMMODETYPE ePCMMode; /**< PCM mode enumeration */ - OMX_AUDIO_CHANNELTYPE eChannelMapping[OMX_AUDIO_MAXCHANNELS]; /**< Slot i contains channel defined by eChannelMap[i] */ - -} OMX_AUDIO_PARAM_PCMMODETYPE; - - -/** Audio channel mode. This is used by both AAC and MP3, although the names are more appropriate - * for the MP3. For example, JointStereo for MP3 is CouplingChannels for AAC. - */ -typedef enum OMX_AUDIO_CHANNELMODETYPE { - OMX_AUDIO_ChannelModeStereo = 0, /**< 2 channels, the bitrate allocation between those - two channels changes accordingly to each channel information */ - OMX_AUDIO_ChannelModeJointStereo, /**< mode that takes advantage of what is common between - 2 channels for higher compression gain */ - OMX_AUDIO_ChannelModeDual, /**< 2 mono-channels, each channel is encoded with half - the bitrate of the overall bitrate */ - OMX_AUDIO_ChannelModeMono, /**< Mono channel mode */ - OMX_AUDIO_ChannelModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_ChannelModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_ChannelModeMax = 0x7FFFFFFF -} OMX_AUDIO_CHANNELMODETYPE; - - -typedef enum OMX_AUDIO_MP3STREAMFORMATTYPE { - OMX_AUDIO_MP3StreamFormatMP1Layer3 = 0, /**< MP3 Audio MPEG 1 Layer 3 Stream format */ - OMX_AUDIO_MP3StreamFormatMP2Layer3, /**< MP3 Audio MPEG 2 Layer 3 Stream format */ - OMX_AUDIO_MP3StreamFormatMP2_5Layer3, /**< MP3 Audio MPEG2.5 Layer 3 Stream format */ - OMX_AUDIO_MP3StreamFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_MP3StreamFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_MP3StreamFormatMax = 0x7FFFFFFF -} OMX_AUDIO_MP3STREAMFORMATTYPE; - -/** MP3 params */ -typedef struct OMX_AUDIO_PARAM_MP3TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable - rate or unknown bit rates */ - OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for - variable or unknown sampling rate. */ - OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should - limit the audio signal. Use 0 to let encoder decide */ - OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */ - OMX_AUDIO_MP3STREAMFORMATTYPE eFormat; /**< MP3 stream format */ -} OMX_AUDIO_PARAM_MP3TYPE; - - -typedef enum OMX_AUDIO_AACSTREAMFORMATTYPE { - OMX_AUDIO_AACStreamFormatMP2ADTS = 0, /**< AAC Audio Data Transport Stream 2 format */ - OMX_AUDIO_AACStreamFormatMP4ADTS, /**< AAC Audio Data Transport Stream 4 format */ - OMX_AUDIO_AACStreamFormatMP4LOAS, /**< AAC Low Overhead Audio Stream format */ - OMX_AUDIO_AACStreamFormatMP4LATM, /**< AAC Low overhead Audio Transport Multiplex */ - OMX_AUDIO_AACStreamFormatADIF, /**< AAC Audio Data Interchange Format */ - OMX_AUDIO_AACStreamFormatMP4FF, /**< AAC inside MPEG-4/ISO File Format */ - OMX_AUDIO_AACStreamFormatRAW, /**< AAC Raw Format */ - OMX_AUDIO_AACStreamFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_AACStreamFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_AACStreamFormatMax = 0x7FFFFFFF -} OMX_AUDIO_AACSTREAMFORMATTYPE; - - -/** AAC mode type. Note that the term profile is used with the MPEG-2 - * standard and the term object type and profile is used with MPEG-4 */ -typedef enum OMX_AUDIO_AACPROFILETYPE{ - OMX_AUDIO_AACObjectNull = 0, /**< Null, not used */ - OMX_AUDIO_AACObjectMain = 1, /**< AAC Main object */ - OMX_AUDIO_AACObjectLC, /**< AAC Low Complexity object (AAC profile) */ - OMX_AUDIO_AACObjectSSR, /**< AAC Scalable Sample Rate object */ - OMX_AUDIO_AACObjectLTP, /**< AAC Long Term Prediction object */ - OMX_AUDIO_AACObjectHE, /**< AAC High Efficiency (object type SBR, HE-AAC profile) */ - OMX_AUDIO_AACObjectScalable, /**< AAC Scalable object */ - OMX_AUDIO_AACObjectERLC = 17, /**< ER AAC Low Complexity object (Error Resilient AAC-LC) */ - OMX_AUDIO_AACObjectLD = 23, /**< AAC Low Delay object (Error Resilient) */ - OMX_AUDIO_AACObjectHE_PS = 29, /**< AAC High Efficiency with Parametric Stereo coding (HE-AAC v2, object type PS) */ - OMX_AUDIO_AACObjectKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_AACObjectVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_AACObjectMax = 0x7FFFFFFF -} OMX_AUDIO_AACPROFILETYPE; - - -/** AAC tool usage (for nAACtools in OMX_AUDIO_PARAM_AACPROFILETYPE). - * Required for encoder configuration and optional as decoder info output. - * For MP3, OMX_AUDIO_CHANNELMODETYPE is sufficient. */ -#define OMX_AUDIO_AACToolNone 0x00000000 /**< no AAC tools allowed (encoder config) or active (decoder info output) */ -#define OMX_AUDIO_AACToolMS 0x00000001 /**< MS: Mid/side joint coding tool allowed or active */ -#define OMX_AUDIO_AACToolIS 0x00000002 /**< IS: Intensity stereo tool allowed or active */ -#define OMX_AUDIO_AACToolTNS 0x00000004 /**< TNS: Temporal Noise Shaping tool allowed or active */ -#define OMX_AUDIO_AACToolPNS 0x00000008 /**< PNS: MPEG-4 Perceptual Noise substitution tool allowed or active */ -#define OMX_AUDIO_AACToolLTP 0x00000010 /**< LTP: MPEG-4 Long Term Prediction tool allowed or active */ -#define OMX_AUDIO_AACToolAll 0x7FFFFFFF /**< all AAC tools allowed or active (*/ - -/** MPEG-4 AAC error resilience (ER) tool usage (for nAACERtools in OMX_AUDIO_PARAM_AACPROFILETYPE). - * Required for ER encoder configuration and optional as decoder info output */ -#define OMX_AUDIO_AACERNone 0x00000000 /**< no AAC ER tools allowed/used */ -#define OMX_AUDIO_AACERVCB11 0x00000001 /**< VCB11: Virtual Code Books for AAC section data */ -#define OMX_AUDIO_AACERRVLC 0x00000002 /**< RVLC: Reversible Variable Length Coding */ -#define OMX_AUDIO_AACERHCR 0x00000004 /**< HCR: Huffman Codeword Reordering */ -#define OMX_AUDIO_AACERAll 0x7FFFFFFF /**< all AAC ER tools allowed/used */ - - -/** AAC params */ -typedef struct OMX_AUDIO_PARAM_AACPROFILETYPE { - OMX_U32 nSize; /**< Size of this structure, in Bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for - variable or unknown sampling rate. */ - OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable - rate or unknown bit rates */ - OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should - limit the audio signal. Use 0 to let encoder decide */ - OMX_U32 nFrameLength; /**< Frame length (in audio samples per channel) of the codec. - Can be 1024 or 960 (AAC-LC), 2048 (HE-AAC), 480 or 512 (AAC-LD). - Use 0 to let encoder decide */ - OMX_U32 nAACtools; /**< AAC tool usage */ - OMX_U32 nAACERtools; /**< MPEG-4 AAC error resilience tool usage */ - OMX_AUDIO_AACPROFILETYPE eAACProfile; /**< AAC profile enumeration */ - OMX_AUDIO_AACSTREAMFORMATTYPE eAACStreamFormat; /**< AAC stream format enumeration */ - OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */ -} OMX_AUDIO_PARAM_AACPROFILETYPE; - - -/** VORBIS params */ -typedef struct OMX_AUDIO_PARAM_VORBISTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nBitRate; /**< Bit rate of the encoded data data. Use 0 for variable - rate or unknown bit rates. Encoding is set to the - bitrate closest to specified value (in bps) */ - OMX_U32 nMinBitRate; /**< Sets minimum bitrate (in bps). */ - OMX_U32 nMaxBitRate; /**< Sets maximum bitrate (in bps). */ - - OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for - variable or unknown sampling rate. */ - OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should - limit the audio signal. Use 0 to let encoder decide */ - OMX_S32 nQuality; /**< Sets encoding quality to n, between -1 (low) and 10 (high). - In the default mode of operation, teh quality level is 3. - Normal quality range is 0 - 10. */ - OMX_BOOL bManaged; /**< Set bitrate management mode. This turns off the - normal VBR encoding, but allows hard or soft bitrate - constraints to be enforced by the encoder. This mode can - be slower, and may also be lower quality. It is - primarily useful for streaming. */ - OMX_BOOL bDownmix; /**< Downmix input from stereo to mono (has no effect on - non-stereo streams). Useful for lower-bitrate encoding. */ -} OMX_AUDIO_PARAM_VORBISTYPE; - - -/** WMA Version */ -typedef enum OMX_AUDIO_WMAFORMATTYPE { - OMX_AUDIO_WMAFormatUnused = 0, /**< format unused or unknown */ - OMX_AUDIO_WMAFormat7, /**< Windows Media Audio format 7 */ - OMX_AUDIO_WMAFormat8, /**< Windows Media Audio format 8 */ - OMX_AUDIO_WMAFormat9, /**< Windows Media Audio format 9 */ - OMX_AUDIO_WMAFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_WMAFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_WMAFormatMax = 0x7FFFFFFF -} OMX_AUDIO_WMAFORMATTYPE; - - -/** WMA Profile */ -typedef enum OMX_AUDIO_WMAPROFILETYPE { - OMX_AUDIO_WMAProfileUnused = 0, /**< profile unused or unknown */ - OMX_AUDIO_WMAProfileL1, /**< Windows Media audio version 9 profile L1 */ - OMX_AUDIO_WMAProfileL2, /**< Windows Media audio version 9 profile L2 */ - OMX_AUDIO_WMAProfileL3, /**< Windows Media audio version 9 profile L3 */ - OMX_AUDIO_WMAProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_WMAProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_WMAProfileMax = 0x7FFFFFFF -} OMX_AUDIO_WMAPROFILETYPE; - - -/** WMA params */ -typedef struct OMX_AUDIO_PARAM_WMATYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U16 nChannels; /**< Number of channels */ - OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable - rate or unknown bit rates */ - OMX_AUDIO_WMAFORMATTYPE eFormat; /**< Version of WMA stream / data */ - OMX_AUDIO_WMAPROFILETYPE eProfile; /**< Profile of WMA stream / data */ - OMX_U32 nSamplingRate; /**< Sampling rate of the source data */ - OMX_U16 nBlockAlign; /**< is the block alignment, or block size, in bytes of the audio codec */ - OMX_U16 nEncodeOptions; /**< WMA Type-specific data */ - OMX_U32 nSuperBlockAlign; /**< WMA Type-specific data */ -} OMX_AUDIO_PARAM_WMATYPE; - -/** - * RealAudio format - */ -typedef enum OMX_AUDIO_RAFORMATTYPE { - OMX_AUDIO_RAFormatUnused = 0, /**< Format unused or unknown */ - OMX_AUDIO_RA8, /**< RealAudio 8 codec */ - OMX_AUDIO_RA9, /**< RealAudio 9 codec */ - OMX_AUDIO_RA10_AAC, /**< MPEG-4 AAC codec for bitrates of more than 128kbps */ - OMX_AUDIO_RA10_CODEC, /**< RealAudio codec for bitrates less than 128 kbps */ - OMX_AUDIO_RA10_LOSSLESS, /**< RealAudio Lossless */ - OMX_AUDIO_RA10_MULTICHANNEL, /**< RealAudio Multichannel */ - OMX_AUDIO_RA10_VOICE, /**< RealAudio Voice for bitrates below 15 kbps */ - OMX_AUDIO_RAFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_RAFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_RAFormatMax = 0x7FFFFFFF -} OMX_AUDIO_RAFORMATTYPE; - -/** RA (Real Audio) params */ -typedef struct OMX_AUDIO_PARAM_RATYPE { - OMX_U32 nSize; /**< Size of this structure, in Bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nSamplingRate; /**< is the sampling rate of the source data */ - OMX_U32 nBitsPerFrame; /**< is the value for bits per frame */ - OMX_U32 nSamplePerFrame; /**< is the value for samples per frame */ - OMX_U32 nCouplingQuantBits; /**< is the number of coupling quantization bits in the stream */ - OMX_U32 nCouplingStartRegion; /**< is the coupling start region in the stream */ - OMX_U32 nNumRegions; /**< is the number of regions value */ - OMX_AUDIO_RAFORMATTYPE eFormat; /**< is the RealAudio audio format */ -} OMX_AUDIO_PARAM_RATYPE; - - -/** SBC Allocation Method Type */ -typedef enum OMX_AUDIO_SBCALLOCMETHODTYPE { - OMX_AUDIO_SBCAllocMethodLoudness, /**< Loudness allocation method */ - OMX_AUDIO_SBCAllocMethodSNR, /**< SNR allocation method */ - OMX_AUDIO_SBCAllocMethodKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_SBCAllocMethodVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_SBCAllocMethodMax = 0x7FFFFFFF -} OMX_AUDIO_SBCALLOCMETHODTYPE; - - -/** SBC params */ -typedef struct OMX_AUDIO_PARAM_SBCTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable - rate or unknown bit rates */ - OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for - variable or unknown sampling rate. */ - OMX_U32 nBlocks; /**< Number of blocks */ - OMX_U32 nSubbands; /**< Number of subbands */ - OMX_U32 nBitPool; /**< Bitpool value */ - OMX_BOOL bEnableBitrate; /**< Use bitrate value instead of bitpool */ - OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */ - OMX_AUDIO_SBCALLOCMETHODTYPE eSBCAllocType; /**< SBC Allocation method type */ -} OMX_AUDIO_PARAM_SBCTYPE; - - -/** ADPCM stream format parameters */ -typedef struct OMX_AUDIO_PARAM_ADPCMTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_U32 nBitsPerSample; /**< Number of bits in each sample */ - OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for - variable or unknown sampling rate. */ -} OMX_AUDIO_PARAM_ADPCMTYPE; - - -/** G723 rate */ -typedef enum OMX_AUDIO_G723RATE { - OMX_AUDIO_G723ModeUnused = 0, /**< AMRNB Mode unused / unknown */ - OMX_AUDIO_G723ModeLow, /**< 5300 bps */ - OMX_AUDIO_G723ModeHigh, /**< 6300 bps */ - OMX_AUDIO_G723ModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_G723ModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_G723ModeMax = 0x7FFFFFFF -} OMX_AUDIO_G723RATE; - - -/** G723 - Sample rate must be 8 KHz */ -typedef struct OMX_AUDIO_PARAM_G723TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_AUDIO_G723RATE eBitRate; /**< todo: Should this be moved to a config? */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ - OMX_BOOL bPostFilter; /**< Enable Post Filter */ -} OMX_AUDIO_PARAM_G723TYPE; - - -/** ITU G726 (ADPCM) rate */ -typedef enum OMX_AUDIO_G726MODE { - OMX_AUDIO_G726ModeUnused = 0, /**< G726 Mode unused / unknown */ - OMX_AUDIO_G726Mode16, /**< 16 kbps */ - OMX_AUDIO_G726Mode24, /**< 24 kbps */ - OMX_AUDIO_G726Mode32, /**< 32 kbps, most common rate, also G721 */ - OMX_AUDIO_G726Mode40, /**< 40 kbps */ - OMX_AUDIO_G726ModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_G726ModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_G726ModeMax = 0x7FFFFFFF -} OMX_AUDIO_G726MODE; - - -/** G.726 stream format parameters - must be at 8KHz */ -typedef struct OMX_AUDIO_PARAM_G726TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_AUDIO_G726MODE eG726Mode; -} OMX_AUDIO_PARAM_G726TYPE; - - -/** G729 coder type */ -typedef enum OMX_AUDIO_G729TYPE { - OMX_AUDIO_G729 = 0, /**< ITU G.729 encoded data */ - OMX_AUDIO_G729A, /**< ITU G.729 annex A encoded data */ - OMX_AUDIO_G729B, /**< ITU G.729 with annex B encoded data */ - OMX_AUDIO_G729AB, /**< ITU G.729 annexes A and B encoded data */ - OMX_AUDIO_G729KhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_G729VendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_G729Max = 0x7FFFFFFF -} OMX_AUDIO_G729TYPE; - - -/** G729 stream format parameters - fixed 6KHz sample rate */ -typedef struct OMX_AUDIO_PARAM_G729TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_AUDIO_G729TYPE eBitType; -} OMX_AUDIO_PARAM_G729TYPE; - - -/** AMR Frame format */ -typedef enum OMX_AUDIO_AMRFRAMEFORMATTYPE { - OMX_AUDIO_AMRFrameFormatConformance = 0, /**< Frame Format is AMR Conformance - (Standard) Format */ - OMX_AUDIO_AMRFrameFormatIF1, /**< Frame Format is AMR Interface - Format 1 */ - OMX_AUDIO_AMRFrameFormatIF2, /**< Frame Format is AMR Interface - Format 2*/ - OMX_AUDIO_AMRFrameFormatFSF, /**< Frame Format is AMR File Storage - Format */ - OMX_AUDIO_AMRFrameFormatRTPPayload, /**< Frame Format is AMR Real-Time - Transport Protocol Payload Format */ - OMX_AUDIO_AMRFrameFormatITU, /**< Frame Format is ITU Format (added at Motorola request) */ - OMX_AUDIO_AMRFrameFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_AMRFrameFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_AMRFrameFormatMax = 0x7FFFFFFF -} OMX_AUDIO_AMRFRAMEFORMATTYPE; - - -/** AMR band mode */ -typedef enum OMX_AUDIO_AMRBANDMODETYPE { - OMX_AUDIO_AMRBandModeUnused = 0, /**< AMRNB Mode unused / unknown */ - OMX_AUDIO_AMRBandModeNB0, /**< AMRNB Mode 0 = 4750 bps */ - OMX_AUDIO_AMRBandModeNB1, /**< AMRNB Mode 1 = 5150 bps */ - OMX_AUDIO_AMRBandModeNB2, /**< AMRNB Mode 2 = 5900 bps */ - OMX_AUDIO_AMRBandModeNB3, /**< AMRNB Mode 3 = 6700 bps */ - OMX_AUDIO_AMRBandModeNB4, /**< AMRNB Mode 4 = 7400 bps */ - OMX_AUDIO_AMRBandModeNB5, /**< AMRNB Mode 5 = 7950 bps */ - OMX_AUDIO_AMRBandModeNB6, /**< AMRNB Mode 6 = 10200 bps */ - OMX_AUDIO_AMRBandModeNB7, /**< AMRNB Mode 7 = 12200 bps */ - OMX_AUDIO_AMRBandModeWB0, /**< AMRWB Mode 0 = 6600 bps */ - OMX_AUDIO_AMRBandModeWB1, /**< AMRWB Mode 1 = 8850 bps */ - OMX_AUDIO_AMRBandModeWB2, /**< AMRWB Mode 2 = 12650 bps */ - OMX_AUDIO_AMRBandModeWB3, /**< AMRWB Mode 3 = 14250 bps */ - OMX_AUDIO_AMRBandModeWB4, /**< AMRWB Mode 4 = 15850 bps */ - OMX_AUDIO_AMRBandModeWB5, /**< AMRWB Mode 5 = 18250 bps */ - OMX_AUDIO_AMRBandModeWB6, /**< AMRWB Mode 6 = 19850 bps */ - OMX_AUDIO_AMRBandModeWB7, /**< AMRWB Mode 7 = 23050 bps */ - OMX_AUDIO_AMRBandModeWB8, /**< AMRWB Mode 8 = 23850 bps */ - OMX_AUDIO_AMRBandModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_AMRBandModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_AMRBandModeMax = 0x7FFFFFFF -} OMX_AUDIO_AMRBANDMODETYPE; - - -/** AMR Discontinuous Transmission mode */ -typedef enum OMX_AUDIO_AMRDTXMODETYPE { - OMX_AUDIO_AMRDTXModeOff = 0, /**< AMR Discontinuous Transmission Mode is disabled */ - OMX_AUDIO_AMRDTXModeOnVAD1, /**< AMR Discontinuous Transmission Mode using - Voice Activity Detector 1 (VAD1) is enabled */ - OMX_AUDIO_AMRDTXModeOnVAD2, /**< AMR Discontinuous Transmission Mode using - Voice Activity Detector 2 (VAD2) is enabled */ - OMX_AUDIO_AMRDTXModeOnAuto, /**< The codec will automatically select between - Off, VAD1 or VAD2 modes */ - - OMX_AUDIO_AMRDTXasEFR, /**< DTX as EFR instead of AMR standard (3GPP 26.101, frame type =8,9,10) */ - - OMX_AUDIO_AMRDTXModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_AMRDTXModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_AMRDTXModeMax = 0x7FFFFFFF -} OMX_AUDIO_AMRDTXMODETYPE; - - -/** AMR params */ -typedef struct OMX_AUDIO_PARAM_AMRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nBitRate; /**< Bit rate read only field */ - OMX_AUDIO_AMRBANDMODETYPE eAMRBandMode; /**< AMR Band Mode enumeration */ - OMX_AUDIO_AMRDTXMODETYPE eAMRDTXMode; /**< AMR DTX Mode enumeration */ - OMX_AUDIO_AMRFRAMEFORMATTYPE eAMRFrameFormat; /**< AMR frame format enumeration */ -} OMX_AUDIO_PARAM_AMRTYPE; - - -/** GSM_FR (ETSI 06.10, 3GPP 46.010) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_GSMFRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_GSMFRTYPE; - - -/** GSM-HR (ETSI 06.20, 3GPP 46.020) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_GSMHRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_GSMHRTYPE; - - -/** GSM-EFR (ETSI 06.60, 3GPP 46.060) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_GSMEFRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_GSMEFRTYPE; - - -/** TDMA FR (TIA/EIA-136-420, VSELP 7.95kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_TDMAFRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_TDMAFRTYPE; - - -/** TDMA EFR (TIA/EIA-136-410, ACELP 7.4kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_TDMAEFRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_TDMAEFRTYPE; - - -/** PDC FR ( RCR-27, VSELP 6.7kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_PDCFRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_PDCFRTYPE; - - -/** PDC EFR ( RCR-27, ACELP 6.7kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_PDCEFRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_PDCEFRTYPE; - -/** PDC HR ( RCR-27, PSI-CELP 3.45kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_PDCHRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_PDCHRTYPE; - - -/** CDMA Rate types */ -typedef enum OMX_AUDIO_CDMARATETYPE { - OMX_AUDIO_CDMARateBlank = 0, /**< CDMA encoded frame is blank */ - OMX_AUDIO_CDMARateFull, /**< CDMA encoded frame in full rate */ - OMX_AUDIO_CDMARateHalf, /**< CDMA encoded frame in half rate */ - OMX_AUDIO_CDMARateQuarter, /**< CDMA encoded frame in quarter rate */ - OMX_AUDIO_CDMARateEighth, /**< CDMA encoded frame in eighth rate (DTX)*/ - OMX_AUDIO_CDMARateErasure, /**< CDMA erasure frame */ - OMX_AUDIO_CDMARateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_CDMARateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_CDMARateMax = 0x7FFFFFFF -} OMX_AUDIO_CDMARATETYPE; - - -/** QCELP8 (TIA/EIA-96, up to 8kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_QCELP8TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable - rate or unknown bit rates */ - OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */ - OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */ - OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */ -} OMX_AUDIO_PARAM_QCELP8TYPE; - - -/** QCELP13 ( CDMA, EIA/TIA-733, 13.3kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_QCELP13TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */ - OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */ - OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */ -} OMX_AUDIO_PARAM_QCELP13TYPE; - - -/** EVRC ( CDMA, EIA/TIA-127, RCELP up to 8.55kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_EVRCTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_AUDIO_CDMARATETYPE eCDMARate; /**< actual Frame rate */ - OMX_BOOL bRATE_REDUCon; /**< RATE_REDUCtion is requested for this frame */ - OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */ - OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */ - OMX_BOOL bHiPassFilter; /**< Enable encoder's High Pass Filter */ - OMX_BOOL bNoiseSuppressor; /**< Enable encoder's noise suppressor pre-processing */ - OMX_BOOL bPostFilter; /**< Enable decoder's post Filter */ -} OMX_AUDIO_PARAM_EVRCTYPE; - - -/** SMV ( up to 8.55kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_SMVTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */ - OMX_BOOL bRATE_REDUCon; /**< RATE_REDUCtion is requested for this frame */ - OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 ??*/ - OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 ??*/ - OMX_BOOL bHiPassFilter; /**< Enable encoder's High Pass Filter ??*/ - OMX_BOOL bNoiseSuppressor; /**< Enable encoder's noise suppressor pre-processing */ - OMX_BOOL bPostFilter; /**< Enable decoder's post Filter ??*/ -} OMX_AUDIO_PARAM_SMVTYPE; - - -/** MIDI Format - * @ingroup midi - */ -typedef enum OMX_AUDIO_MIDIFORMATTYPE -{ - OMX_AUDIO_MIDIFormatUnknown = 0, /**< MIDI Format unknown or don't care */ - OMX_AUDIO_MIDIFormatSMF0, /**< Standard MIDI File Type 0 */ - OMX_AUDIO_MIDIFormatSMF1, /**< Standard MIDI File Type 1 */ - OMX_AUDIO_MIDIFormatSMF2, /**< Standard MIDI File Type 2 */ - OMX_AUDIO_MIDIFormatSPMIDI, /**< SP-MIDI */ - OMX_AUDIO_MIDIFormatXMF0, /**< eXtensible Music Format type 0 */ - OMX_AUDIO_MIDIFormatXMF1, /**< eXtensible Music Format type 1 */ - OMX_AUDIO_MIDIFormatMobileXMF, /**< Mobile XMF (eXtensible Music Format type 2) */ - OMX_AUDIO_MIDIFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_MIDIFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_MIDIFormatMax = 0x7FFFFFFF -} OMX_AUDIO_MIDIFORMATTYPE; - - -/** MIDI params - * @ingroup midi - */ -typedef struct OMX_AUDIO_PARAM_MIDITYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nFileSize; /**< size of the MIDI file in bytes, where the entire - MIDI file passed in, otherwise if 0x0, the MIDI data - is merged and streamed (instead of passed as an - entire MIDI file) */ - OMX_BU32 sMaxPolyphony; /**< Specifies the maximum simultaneous polyphonic - voices. A value of zero indicates that the default - polyphony of the device is used */ - OMX_BOOL bLoadDefaultSound; /**< Whether to load default sound - bank at initialization */ - OMX_AUDIO_MIDIFORMATTYPE eMidiFormat; /**< Version of the MIDI file */ -} OMX_AUDIO_PARAM_MIDITYPE; - - -/** Type of the MIDI sound bank - * @ingroup midi - */ -typedef enum OMX_AUDIO_MIDISOUNDBANKTYPE { - OMX_AUDIO_MIDISoundBankUnused = 0, /**< unused/unknown soundbank type */ - OMX_AUDIO_MIDISoundBankDLS1, /**< DLS version 1 */ - OMX_AUDIO_MIDISoundBankDLS2, /**< DLS version 2 */ - OMX_AUDIO_MIDISoundBankMobileDLSBase, /**< Mobile DLS, using the base functionality */ - OMX_AUDIO_MIDISoundBankMobileDLSPlusOptions, /**< Mobile DLS, using the specification-defined optional feature set */ - OMX_AUDIO_MIDISoundBankKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_MIDISoundBankVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_MIDISoundBankMax = 0x7FFFFFFF -} OMX_AUDIO_MIDISOUNDBANKTYPE; - - -/** Bank Layout describes how bank MSB & LSB are used in the DLS instrument definitions sound bank - * @ingroup midi - */ -typedef enum OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE { - OMX_AUDIO_MIDISoundBankLayoutUnused = 0, /**< unused/unknown soundbank type */ - OMX_AUDIO_MIDISoundBankLayoutGM, /**< GS layout (based on bank MSB 0x00) */ - OMX_AUDIO_MIDISoundBankLayoutGM2, /**< General MIDI 2 layout (using MSB 0x78/0x79, LSB 0x00) */ - OMX_AUDIO_MIDISoundBankLayoutUser, /**< Does not conform to any bank numbering standards */ - OMX_AUDIO_MIDISoundBankLayoutKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_MIDISoundBankLayoutVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_MIDISoundBankLayoutMax = 0x7FFFFFFF -} OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE; - - -/** MIDI params to load/unload user soundbank - * @ingroup midi - */ -typedef struct OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nDLSIndex; /**< DLS file index to be loaded */ - OMX_U32 nDLSSize; /**< Size in bytes */ - OMX_PTR pDLSData; /**< Pointer to DLS file data */ - OMX_AUDIO_MIDISOUNDBANKTYPE eMidiSoundBank; /**< Midi sound bank type enumeration */ - OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE eMidiSoundBankLayout; /**< Midi sound bank layout enumeration */ -} OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE; - - -/** Structure for Live MIDI events and MIP messages. - * (MIP = Maximum Instantaneous Polyphony; part of the SP-MIDI standard.) - * @ingroup midi - */ -typedef struct OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port that this structure applies to */ - OMX_U32 nMidiEventSize; /**< Size of immediate MIDI events or MIP message in bytes */ - OMX_U8 nMidiEvents[1]; /**< MIDI event array to be rendered immediately, or an - array for the MIP message buffer, where the size is - indicated by nMidiEventSize */ -} OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE; - - -/** MIDI sound bank/ program pair in a given channel - * @ingroup midi - */ -typedef struct OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port that this structure applies to */ - OMX_U32 nChannel; /**< Valid channel values range from 1 to 16 */ - OMX_U16 nIDProgram; /**< Valid program ID range is 1 to 128 */ - OMX_U16 nIDSoundBank; /**< Sound bank ID */ - OMX_U32 nUserSoundBankIndex;/**< User soundbank index, easier to access soundbanks - by index if multiple banks are present */ -} OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE; - - -/** MIDI control - * @ingroup midi - */ -typedef struct OMX_AUDIO_CONFIG_MIDICONTROLTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BS32 sPitchTransposition; /**< Pitch transposition in semitones, stored as Q22.10 - format based on JAVA MMAPI (JSR-135) requirement */ - OMX_BU32 sPlayBackRate; /**< Relative playback rate, stored as Q14.17 fixed-point - number based on JSR-135 requirement */ - OMX_BU32 sTempo ; /**< Tempo in beats per minute (BPM), stored as Q22.10 - fixed-point number based on JSR-135 requirement */ - OMX_U32 nMaxPolyphony; /**< Specifies the maximum simultaneous polyphonic - voices. A value of zero indicates that the default - polyphony of the device is used */ - OMX_U32 nNumRepeat; /**< Number of times to repeat playback */ - OMX_U32 nStopTime; /**< Time in milliseconds to indicate when playback - will stop automatically. Set to zero if not used */ - OMX_U16 nChannelMuteMask; /**< 16 bit mask for channel mute status */ - OMX_U16 nChannelSoloMask; /**< 16 bit mask for channel solo status */ - OMX_U32 nTrack0031MuteMask; /**< 32 bit mask for track mute status. Note: This is for tracks 0-31 */ - OMX_U32 nTrack3263MuteMask; /**< 32 bit mask for track mute status. Note: This is for tracks 32-63 */ - OMX_U32 nTrack0031SoloMask; /**< 32 bit mask for track solo status. Note: This is for tracks 0-31 */ - OMX_U32 nTrack3263SoloMask; /**< 32 bit mask for track solo status. Note: This is for tracks 32-63 */ - -} OMX_AUDIO_CONFIG_MIDICONTROLTYPE; - - -/** MIDI Playback States - * @ingroup midi - */ -typedef enum OMX_AUDIO_MIDIPLAYBACKSTATETYPE { - OMX_AUDIO_MIDIPlayBackStateUnknown = 0, /**< Unknown state or state does not map to - other defined states */ - OMX_AUDIO_MIDIPlayBackStateClosedEngaged, /**< No MIDI resource is currently open. - The MIDI engine is currently processing - MIDI events. */ - OMX_AUDIO_MIDIPlayBackStateParsing, /**< A MIDI resource is open and is being - primed. The MIDI engine is currently - processing MIDI events. */ - OMX_AUDIO_MIDIPlayBackStateOpenEngaged, /**< A MIDI resource is open and primed but - not playing. The MIDI engine is currently - processing MIDI events. The transition to - this state is only possible from the - OMX_AUDIO_MIDIPlayBackStatePlaying state, - when the 'playback head' reaches the end - of media data or the playback stops due - to stop time set.*/ - OMX_AUDIO_MIDIPlayBackStatePlaying, /**< A MIDI resource is open and currently - playing. The MIDI engine is currently - processing MIDI events.*/ - OMX_AUDIO_MIDIPlayBackStatePlayingPartially, /**< Best-effort playback due to SP-MIDI/DLS - resource constraints */ - OMX_AUDIO_MIDIPlayBackStatePlayingSilently, /**< Due to system resource constraints and - SP-MIDI content constraints, there is - no audible MIDI content during playback - currently. The situation may change if - resources are freed later.*/ - OMX_AUDIO_MIDIPlayBackStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_MIDIPlayBackStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_MIDIPlayBackStateMax = 0x7FFFFFFF -} OMX_AUDIO_MIDIPLAYBACKSTATETYPE; - - -/** MIDI status - * @ingroup midi - */ -typedef struct OMX_AUDIO_CONFIG_MIDISTATUSTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U16 nNumTracks; /**< Number of MIDI tracks in the file, read only field. - NOTE: May not return a meaningful value until the entire - file is parsed and buffered. */ - OMX_U32 nDuration; /**< The length of the currently open MIDI resource - in milliseconds. NOTE: May not return a meaningful value - until the entire file is parsed and buffered. */ - OMX_U32 nPosition; /**< Current Position of the MIDI resource being played - in milliseconds */ - OMX_BOOL bVibra; /**< Does Vibra track exist? NOTE: May not return a meaningful - value until the entire file is parsed and buffered. */ - OMX_U32 nNumMetaEvents; /**< Total number of MIDI Meta Events in the currently - open MIDI resource. NOTE: May not return a meaningful value - until the entire file is parsed and buffered. */ - OMX_U32 nNumActiveVoices; /**< Number of active voices in the currently playing - MIDI resource. NOTE: May not return a meaningful value until - the entire file is parsed and buffered. */ - OMX_AUDIO_MIDIPLAYBACKSTATETYPE eMIDIPlayBackState; /**< MIDI playback state enumeration, read only field */ -} OMX_AUDIO_CONFIG_MIDISTATUSTYPE; - - -/** MIDI Meta Event structure one per Meta Event. - * MIDI Meta Events are like audio metadata, except that they are interspersed - * with the MIDI content throughout the file and are not localized in the header. - * As such, it is necessary to retrieve information about these Meta Events from - * the engine, as it encounters these Meta Events within the MIDI content. - * For example, SMF files can have up to 14 types of MIDI Meta Events (copyright, - * author, default tempo, etc.) scattered throughout the file. - * @ingroup midi - */ -typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE{ - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nIndex; /**< Index of Meta Event */ - OMX_U8 nMetaEventType; /**< Meta Event Type, 7bits (i.e. 0 - 127) */ - OMX_U32 nMetaEventSize; /**< size of the Meta Event in bytes */ - OMX_U32 nTrack; /**< track number for the meta event */ - OMX_U32 nPosition; /**< Position of the meta-event in milliseconds */ -} OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE; - - -/** MIDI Meta Event Data structure - one per Meta Event. - * @ingroup midi - */ -typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE{ - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nIndex; /**< Index of Meta Event */ - OMX_U32 nMetaEventSize; /**< size of the Meta Event in bytes */ - OMX_U8 nData[1]; /**< array of one or more bytes of meta data - as indicated by the nMetaEventSize field */ -} OMX_AUDIO_CONFIG__MIDIMETAEVENTDATATYPE; - - -/** Audio Volume adjustment for a port */ -typedef struct OMX_AUDIO_CONFIG_VOLUMETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port index indicating which port to - set. Select the input port to set - just that port's volume. Select the - output port to adjust the master - volume. */ - OMX_BOOL bLinear; /**< Is the volume to be set in linear (0.100) - or logarithmic scale (mB) */ - OMX_BS32 sVolume; /**< Volume linear setting in the 0..100 range, OR - Volume logarithmic setting for this port. The values - for volume are in mB (millibels = 1/100 dB) relative - to a gain of 1 (e.g. the output is the same as the - input level). Values are in mB from nMax - (maximum volume) to nMin mB (typically negative). - Since the volume is "voltage" - and not a "power", it takes a setting of - -600 mB to decrease the volume by 1/2. If - a component cannot accurately set the - volume to the requested value, it must - set the volume to the closest value BELOW - the requested value. When getting the - volume setting, the current actual volume - must be returned. */ -} OMX_AUDIO_CONFIG_VOLUMETYPE; - - -/** Audio Volume adjustment for a channel */ -typedef struct OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port index indicating which port to - set. Select the input port to set - just that port's volume. Select the - output port to adjust the master - volume. */ - OMX_U32 nChannel; /**< channel to select from 0 to N-1, - using OMX_ALL to apply volume settings - to all channels */ - OMX_BOOL bLinear; /**< Is the volume to be set in linear (0.100) or - logarithmic scale (mB) */ - OMX_BS32 sVolume; /**< Volume linear setting in the 0..100 range, OR - Volume logarithmic setting for this port. - The values for volume are in mB - (millibels = 1/100 dB) relative to a gain - of 1 (e.g. the output is the same as the - input level). Values are in mB from nMax - (maximum volume) to nMin mB (typically negative). - Since the volume is "voltage" - and not a "power", it takes a setting of - -600 mB to decrease the volume by 1/2. If - a component cannot accurately set the - volume to the requested value, it must - set the volume to the closest value BELOW - the requested value. When getting the - volume setting, the current actual volume - must be returned. */ - OMX_BOOL bIsMIDI; /**< TRUE if nChannel refers to a MIDI channel, - FALSE otherwise */ -} OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE; - - -/** Audio balance setting */ -typedef struct OMX_AUDIO_CONFIG_BALANCETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port index indicating which port to - set. Select the input port to set - just that port's balance. Select the - output port to adjust the master - balance. */ - OMX_S32 nBalance; /**< balance setting for this port - (-100 to 100, where -100 indicates - all left, and no right */ -} OMX_AUDIO_CONFIG_BALANCETYPE; - - -/** Audio Port mute */ -typedef struct OMX_AUDIO_CONFIG_MUTETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port index indicating which port to - set. Select the input port to set - just that port's mute. Select the - output port to adjust the master - mute. */ - OMX_BOOL bMute; /**< Mute setting for this port */ -} OMX_AUDIO_CONFIG_MUTETYPE; - - -/** Audio Channel mute */ -typedef struct OMX_AUDIO_CONFIG_CHANNELMUTETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannel; /**< channel to select from 0 to N-1, - using OMX_ALL to apply mute settings - to all channels */ - OMX_BOOL bMute; /**< Mute setting for this channel */ - OMX_BOOL bIsMIDI; /**< TRUE if nChannel refers to a MIDI channel, - FALSE otherwise */ -} OMX_AUDIO_CONFIG_CHANNELMUTETYPE; - - - -/** Enable / Disable for loudness control, which boosts bass and to a - * smaller extent high end frequencies to compensate for hearing - * ability at the extreme ends of the audio spectrum - */ -typedef struct OMX_AUDIO_CONFIG_LOUDNESSTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bLoudness; /**< Enable/disable for loudness */ -} OMX_AUDIO_CONFIG_LOUDNESSTYPE; - - -/** Enable / Disable for bass, which controls low frequencies - */ -typedef struct OMX_AUDIO_CONFIG_BASSTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bEnable; /**< Enable/disable for bass control */ - OMX_S32 nBass; /**< bass setting for the port, as a - continuous value from -100 to 100 - (0 means no change in bass level)*/ -} OMX_AUDIO_CONFIG_BASSTYPE; - - -/** Enable / Disable for treble, which controls high frequencies tones - */ -typedef struct OMX_AUDIO_CONFIG_TREBLETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bEnable; /**< Enable/disable for treble control */ - OMX_S32 nTreble; /**< treble setting for the port, as a - continuous value from -100 to 100 - (0 means no change in treble level) */ -} OMX_AUDIO_CONFIG_TREBLETYPE; - - -/** An equalizer is typically used for two reasons: to compensate for an - * sub-optimal frequency response of a system to make it sound more natural - * or to create intentionally some unnatural coloring to the sound to create - * an effect. - * @ingroup effects - */ -typedef struct OMX_AUDIO_CONFIG_EQUALIZERTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bEnable; /**< Enable/disable for equalizer */ - OMX_BU32 sBandIndex; /**< Band number to be set. Upper Limit is - N-1, where N is the number of bands, lower limit is 0 */ - OMX_BU32 sCenterFreq; /**< Center frequecies in Hz. This is a - read only element and is used to determine - the lower, center and upper frequency of - this band. */ - OMX_BS32 sBandLevel; /**< band level in millibels */ -} OMX_AUDIO_CONFIG_EQUALIZERTYPE; - - -/** Stereo widening mode type - * @ingroup effects - */ -typedef enum OMX_AUDIO_STEREOWIDENINGTYPE { - OMX_AUDIO_StereoWideningHeadphones, /**< Stereo widening for loudspeakers */ - OMX_AUDIO_StereoWideningLoudspeakers, /**< Stereo widening for closely spaced loudspeakers */ - OMX_AUDIO_StereoWideningKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_StereoWideningVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_StereoWideningMax = 0x7FFFFFFF -} OMX_AUDIO_STEREOWIDENINGTYPE; - - -/** Control for stereo widening, which is a special 2-channel - * case of the audio virtualizer effect. For example, for 5.1-channel - * output, it translates to virtual surround sound. - * @ingroup effects - */ -typedef struct OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bEnable; /**< Enable/disable for stereo widening control */ - OMX_AUDIO_STEREOWIDENINGTYPE eWideningType; /**< Stereo widening algorithm type */ - OMX_U32 nStereoWidening; /**< stereo widening setting for the port, - as a continuous value from 0 to 100 */ -} OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE; - - -/** The chorus effect (or ``choralizer'') is any signal processor which makes - * one sound source (such as a voice) sound like many such sources singing - * (or playing) in unison. Since performance in unison is never exact, chorus - * effects simulate this by making independently modified copies of the input - * signal. Modifications may include (1) delay, (2) frequency shift, and - * (3) amplitude modulation. - * @ingroup effects - */ -typedef struct OMX_AUDIO_CONFIG_CHORUSTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bEnable; /**< Enable/disable for chorus */ - OMX_BU32 sDelay; /**< average delay in milliseconds */ - OMX_BU32 sModulationRate; /**< rate of modulation in millihertz */ - OMX_U32 nModulationDepth; /**< depth of modulation as a percentage of - delay (i.e. 0 to 100) */ - OMX_BU32 nFeedback; /**< Feedback from chorus output to input in percentage */ -} OMX_AUDIO_CONFIG_CHORUSTYPE; - - -/** Reverberation is part of the reflected sound that follows the early - * reflections. In a typical room, this consists of a dense succession of - * echoes whose energy decays exponentially. The reverberation effect structure - * as defined here includes both (early) reflections as well as (late) reverberations. - * @ingroup effects - */ -typedef struct OMX_AUDIO_CONFIG_REVERBERATIONTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bEnable; /**< Enable/disable for reverberation control */ - OMX_BS32 sRoomLevel; /**< Intensity level for the whole room effect - (i.e. both early reflections and late - reverberation) in millibels */ - OMX_BS32 sRoomHighFreqLevel; /**< Attenuation at high frequencies - relative to the intensity at low - frequencies in millibels */ - OMX_BS32 sReflectionsLevel; /**< Intensity level of early reflections - (relative to room value), in millibels */ - OMX_BU32 sReflectionsDelay; /**< Delay time of the first reflection relative - to the direct path, in milliseconds */ - OMX_BS32 sReverbLevel; /**< Intensity level of late reverberation - relative to room level, in millibels */ - OMX_BU32 sReverbDelay; /**< Time delay from the first early reflection - to the beginning of the late reverberation - section, in milliseconds */ - OMX_BU32 sDecayTime; /**< Late reverberation decay time at low - frequencies, in milliseconds */ - OMX_BU32 nDecayHighFreqRatio; /**< Ratio of high frequency decay time relative - to low frequency decay time in percent */ - OMX_U32 nDensity; /**< Modal density in the late reverberation decay, - in percent (i.e. 0 - 100) */ - OMX_U32 nDiffusion; /**< Echo density in the late reverberation decay, - in percent (i.e. 0 - 100) */ - OMX_BU32 sReferenceHighFreq; /**< Reference high frequency in Hertz. This is - the frequency used as the reference for all - the high-frequency settings above */ - -} OMX_AUDIO_CONFIG_REVERBERATIONTYPE; - - -/** Possible settings for the Echo Cancelation structure to use - * @ingroup effects - */ -typedef enum OMX_AUDIO_ECHOCANTYPE { - OMX_AUDIO_EchoCanOff = 0, /**< Echo Cancellation is disabled */ - OMX_AUDIO_EchoCanNormal, /**< Echo Cancellation normal operation - - echo from plastics and face */ - OMX_AUDIO_EchoCanHFree, /**< Echo Cancellation optimized for - Hands Free operation */ - OMX_AUDIO_EchoCanCarKit, /**< Echo Cancellation optimized for - Car Kit (longer echo) */ - OMX_AUDIO_EchoCanKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_EchoCanVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_EchoCanMax = 0x7FFFFFFF -} OMX_AUDIO_ECHOCANTYPE; - - -/** Enable / Disable for echo cancelation, which removes undesired echo's - * from the audio - * @ingroup effects - */ -typedef struct OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_AUDIO_ECHOCANTYPE eEchoCancelation; /**< Echo cancelation settings */ -} OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE; - - -/** Enable / Disable for noise reduction, which undesired noise from - * the audio - * @ingroup effects - */ -typedef struct OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bNoiseReduction; /**< Enable/disable for noise reduction */ -} OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE; - -/** @} */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ - diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/openmax/OMX_Component.h b/external/android/include/14/frameworks/base/include/media/stagefright/openmax/OMX_Component.h deleted file mode 100644 index b5b784e..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/openmax/OMX_Component.h +++ /dev/null @@ -1,596 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** OMX_Component.h - OpenMax IL version 1.1.2 - * The OMX_Component header file contains the definitions used to define - * the public interface of a component. This header file is intended to - * be used by both the application and the component. - */ - -#ifndef OMX_Component_h -#define OMX_Component_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - - -/* Each OMX header must include all required header files to allow the - * header to compile without errors. The includes below are required - * for this header file to compile successfully - */ - -#include -#include -#include -#include - -/** @ingroup comp */ -typedef enum OMX_PORTDOMAINTYPE { - OMX_PortDomainAudio, - OMX_PortDomainVideo, - OMX_PortDomainImage, - OMX_PortDomainOther, - OMX_PortDomainKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_PortDomainVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_PortDomainMax = 0x7ffffff -} OMX_PORTDOMAINTYPE; - -/** @ingroup comp */ -typedef struct OMX_PARAM_PORTDEFINITIONTYPE { - OMX_U32 nSize; /**< Size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port number the structure applies to */ - OMX_DIRTYPE eDir; /**< Direction (input or output) of this port */ - OMX_U32 nBufferCountActual; /**< The actual number of buffers allocated on this port */ - OMX_U32 nBufferCountMin; /**< The minimum number of buffers this port requires */ - OMX_U32 nBufferSize; /**< Size, in bytes, for buffers to be used for this channel */ - OMX_BOOL bEnabled; /**< Ports default to enabled and are enabled/disabled by - OMX_CommandPortEnable/OMX_CommandPortDisable. - When disabled a port is unpopulated. A disabled port - is not populated with buffers on a transition to IDLE. */ - OMX_BOOL bPopulated; /**< Port is populated with all of its buffers as indicated by - nBufferCountActual. A disabled port is always unpopulated. - An enabled port is populated on a transition to OMX_StateIdle - and unpopulated on a transition to loaded. */ - OMX_PORTDOMAINTYPE eDomain; /**< Domain of the port. Determines the contents of metadata below. */ - union { - OMX_AUDIO_PORTDEFINITIONTYPE audio; - OMX_VIDEO_PORTDEFINITIONTYPE video; - OMX_IMAGE_PORTDEFINITIONTYPE image; - OMX_OTHER_PORTDEFINITIONTYPE other; - } format; - OMX_BOOL bBuffersContiguous; - OMX_U32 nBufferAlignment; -} OMX_PARAM_PORTDEFINITIONTYPE; - -/** @ingroup comp */ -typedef struct OMX_PARAM_U32TYPE { - OMX_U32 nSize; /**< Size of this structure, in Bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nU32; /**< U32 value */ -} OMX_PARAM_U32TYPE; - -/** @ingroup rpm */ -typedef enum OMX_SUSPENSIONPOLICYTYPE { - OMX_SuspensionDisabled, /**< No suspension; v1.0 behavior */ - OMX_SuspensionEnabled, /**< Suspension allowed */ - OMX_SuspensionPolicyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_SuspensionPolicyStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_SuspensionPolicyMax = 0x7fffffff -} OMX_SUSPENSIONPOLICYTYPE; - -/** @ingroup rpm */ -typedef struct OMX_PARAM_SUSPENSIONPOLICYTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_SUSPENSIONPOLICYTYPE ePolicy; -} OMX_PARAM_SUSPENSIONPOLICYTYPE; - -/** @ingroup rpm */ -typedef enum OMX_SUSPENSIONTYPE { - OMX_NotSuspended, /**< component is not suspended */ - OMX_Suspended, /**< component is suspended */ - OMX_SuspensionKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_SuspensionVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_SuspendMax = 0x7FFFFFFF -} OMX_SUSPENSIONTYPE; - -/** @ingroup rpm */ -typedef struct OMX_PARAM_SUSPENSIONTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_SUSPENSIONTYPE eType; -} OMX_PARAM_SUSPENSIONTYPE ; - -typedef struct OMX_CONFIG_BOOLEANTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_BOOL bEnabled; -} OMX_CONFIG_BOOLEANTYPE; - -/* Parameter specifying the content uri to use. */ -/** @ingroup cp */ -typedef struct OMX_PARAM_CONTENTURITYPE -{ - OMX_U32 nSize; /**< size of the structure in bytes, including - actual URI name */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U8 contentURI[1]; /**< The URI name */ -} OMX_PARAM_CONTENTURITYPE; - -/* Parameter specifying the pipe to use. */ -/** @ingroup cp */ -typedef struct OMX_PARAM_CONTENTPIPETYPE -{ - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_HANDLETYPE hPipe; /**< The pipe handle*/ -} OMX_PARAM_CONTENTPIPETYPE; - -/** @ingroup rpm */ -typedef struct OMX_RESOURCECONCEALMENTTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_BOOL bResourceConcealmentForbidden; /**< disallow the use of resource concealment - methods (like degrading algorithm quality to - lower resource consumption or functional bypass) - on a component as a resolution to resource conflicts. */ -} OMX_RESOURCECONCEALMENTTYPE; - - -/** @ingroup metadata */ -typedef enum OMX_METADATACHARSETTYPE { - OMX_MetadataCharsetUnknown = 0, - OMX_MetadataCharsetASCII, - OMX_MetadataCharsetBinary, - OMX_MetadataCharsetCodePage1252, - OMX_MetadataCharsetUTF8, - OMX_MetadataCharsetJavaConformantUTF8, - OMX_MetadataCharsetUTF7, - OMX_MetadataCharsetImapUTF7, - OMX_MetadataCharsetUTF16LE, - OMX_MetadataCharsetUTF16BE, - OMX_MetadataCharsetGB12345, - OMX_MetadataCharsetHZGB2312, - OMX_MetadataCharsetGB2312, - OMX_MetadataCharsetGB18030, - OMX_MetadataCharsetGBK, - OMX_MetadataCharsetBig5, - OMX_MetadataCharsetISO88591, - OMX_MetadataCharsetISO88592, - OMX_MetadataCharsetISO88593, - OMX_MetadataCharsetISO88594, - OMX_MetadataCharsetISO88595, - OMX_MetadataCharsetISO88596, - OMX_MetadataCharsetISO88597, - OMX_MetadataCharsetISO88598, - OMX_MetadataCharsetISO88599, - OMX_MetadataCharsetISO885910, - OMX_MetadataCharsetISO885913, - OMX_MetadataCharsetISO885914, - OMX_MetadataCharsetISO885915, - OMX_MetadataCharsetShiftJIS, - OMX_MetadataCharsetISO2022JP, - OMX_MetadataCharsetISO2022JP1, - OMX_MetadataCharsetISOEUCJP, - OMX_MetadataCharsetSMS7Bit, - OMX_MetadataCharsetKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_MetadataCharsetVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_MetadataCharsetTypeMax= 0x7FFFFFFF -} OMX_METADATACHARSETTYPE; - -/** @ingroup metadata */ -typedef enum OMX_METADATASCOPETYPE -{ - OMX_MetadataScopeAllLevels, - OMX_MetadataScopeTopLevel, - OMX_MetadataScopePortLevel, - OMX_MetadataScopeNodeLevel, - OMX_MetadataScopeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_MetadataScopeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_MetadataScopeTypeMax = 0x7fffffff -} OMX_METADATASCOPETYPE; - -/** @ingroup metadata */ -typedef enum OMX_METADATASEARCHMODETYPE -{ - OMX_MetadataSearchValueSizeByIndex, - OMX_MetadataSearchItemByIndex, - OMX_MetadataSearchNextItemByKey, - OMX_MetadataSearchKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_MetadataSearchVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_MetadataSearchTypeMax = 0x7fffffff -} OMX_METADATASEARCHMODETYPE; -/** @ingroup metadata */ -typedef struct OMX_CONFIG_METADATAITEMCOUNTTYPE -{ - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_METADATASCOPETYPE eScopeMode; - OMX_U32 nScopeSpecifier; - OMX_U32 nMetadataItemCount; -} OMX_CONFIG_METADATAITEMCOUNTTYPE; - -/** @ingroup metadata */ -typedef struct OMX_CONFIG_METADATAITEMTYPE -{ - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_METADATASCOPETYPE eScopeMode; - OMX_U32 nScopeSpecifier; - OMX_U32 nMetadataItemIndex; - OMX_METADATASEARCHMODETYPE eSearchMode; - OMX_METADATACHARSETTYPE eKeyCharset; - OMX_U8 nKeySizeUsed; - OMX_U8 nKey[128]; - OMX_METADATACHARSETTYPE eValueCharset; - OMX_STRING sLanguageCountry; - OMX_U32 nValueMaxSize; - OMX_U32 nValueSizeUsed; - OMX_U8 nValue[1]; -} OMX_CONFIG_METADATAITEMTYPE; - -/* @ingroup metadata */ -typedef struct OMX_CONFIG_CONTAINERNODECOUNTTYPE -{ - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_BOOL bAllKeys; - OMX_U32 nParentNodeID; - OMX_U32 nNumNodes; -} OMX_CONFIG_CONTAINERNODECOUNTTYPE; - -/** @ingroup metadata */ -typedef struct OMX_CONFIG_CONTAINERNODEIDTYPE -{ - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_BOOL bAllKeys; - OMX_U32 nParentNodeID; - OMX_U32 nNodeIndex; - OMX_U32 nNodeID; - OMX_STRING cNodeName; - OMX_BOOL bIsLeafType; -} OMX_CONFIG_CONTAINERNODEIDTYPE; - -/** @ingroup metadata */ -typedef struct OMX_PARAM_METADATAFILTERTYPE -{ - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_BOOL bAllKeys; /* if true then this structure refers to all keys and - * the three key fields below are ignored */ - OMX_METADATACHARSETTYPE eKeyCharset; - OMX_U32 nKeySizeUsed; - OMX_U8 nKey [128]; - OMX_U32 nLanguageCountrySizeUsed; - OMX_U8 nLanguageCountry[128]; - OMX_BOOL bEnabled; /* if true then key is part of filter (e.g. - * retained for query later). If false then - * key is not part of filter */ -} OMX_PARAM_METADATAFILTERTYPE; - -/** The OMX_HANDLETYPE structure defines the component handle. The component - * handle is used to access all of the component's public methods and also - * contains pointers to the component's private data area. The component - * handle is initialized by the OMX core (with help from the component) - * during the process of loading the component. After the component is - * successfully loaded, the application can safely access any of the - * component's public functions (although some may return an error because - * the state is inappropriate for the access). - * - * @ingroup comp - */ -typedef struct OMX_COMPONENTTYPE -{ - /** The size of this structure, in bytes. It is the responsibility - of the allocator of this structure to fill in this value. Since - this structure is allocated by the GetHandle function, this - function will fill in this value. */ - OMX_U32 nSize; - - /** nVersion is the version of the OMX specification that the structure - is built against. It is the responsibility of the creator of this - structure to initialize this value and every user of this structure - should verify that it knows how to use the exact version of - this structure found herein. */ - OMX_VERSIONTYPE nVersion; - - /** pComponentPrivate is a pointer to the component private data area. - This member is allocated and initialized by the component when the - component is first loaded. The application should not access this - data area. */ - OMX_PTR pComponentPrivate; - - /** pApplicationPrivate is a pointer that is a parameter to the - OMX_GetHandle method, and contains an application private value - provided by the IL client. This application private data is - returned to the IL Client by OMX in all callbacks */ - OMX_PTR pApplicationPrivate; - - /** refer to OMX_GetComponentVersion in OMX_core.h or the OMX IL - specification for details on the GetComponentVersion method. - */ - OMX_ERRORTYPE (*GetComponentVersion)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_OUT OMX_STRING pComponentName, - OMX_OUT OMX_VERSIONTYPE* pComponentVersion, - OMX_OUT OMX_VERSIONTYPE* pSpecVersion, - OMX_OUT OMX_UUIDTYPE* pComponentUUID); - - /** refer to OMX_SendCommand in OMX_core.h or the OMX IL - specification for details on the SendCommand method. - */ - OMX_ERRORTYPE (*SendCommand)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_COMMANDTYPE Cmd, - OMX_IN OMX_U32 nParam1, - OMX_IN OMX_PTR pCmdData); - - /** refer to OMX_GetParameter in OMX_core.h or the OMX IL - specification for details on the GetParameter method. - */ - OMX_ERRORTYPE (*GetParameter)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_INDEXTYPE nParamIndex, - OMX_INOUT OMX_PTR pComponentParameterStructure); - - - /** refer to OMX_SetParameter in OMX_core.h or the OMX IL - specification for details on the SetParameter method. - */ - OMX_ERRORTYPE (*SetParameter)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_INDEXTYPE nIndex, - OMX_IN OMX_PTR pComponentParameterStructure); - - - /** refer to OMX_GetConfig in OMX_core.h or the OMX IL - specification for details on the GetConfig method. - */ - OMX_ERRORTYPE (*GetConfig)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_INDEXTYPE nIndex, - OMX_INOUT OMX_PTR pComponentConfigStructure); - - - /** refer to OMX_SetConfig in OMX_core.h or the OMX IL - specification for details on the SetConfig method. - */ - OMX_ERRORTYPE (*SetConfig)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_INDEXTYPE nIndex, - OMX_IN OMX_PTR pComponentConfigStructure); - - - /** refer to OMX_GetExtensionIndex in OMX_core.h or the OMX IL - specification for details on the GetExtensionIndex method. - */ - OMX_ERRORTYPE (*GetExtensionIndex)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_STRING cParameterName, - OMX_OUT OMX_INDEXTYPE* pIndexType); - - - /** refer to OMX_GetState in OMX_core.h or the OMX IL - specification for details on the GetState method. - */ - OMX_ERRORTYPE (*GetState)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_OUT OMX_STATETYPE* pState); - - - /** The ComponentTunnelRequest method will interact with another OMX - component to determine if tunneling is possible and to setup the - tunneling. The return codes for this method can be used to - determine if tunneling is not possible, or if tunneling is not - supported. - - Base profile components (i.e. non-interop) do not support this - method and should return OMX_ErrorNotImplemented - - The interop profile component MUST support tunneling to another - interop profile component with a compatible port parameters. - A component may also support proprietary communication. - - If proprietary communication is supported the negotiation of - proprietary communication is done outside of OMX in a vendor - specific way. It is only required that the proper result be - returned and the details of how the setup is done is left - to the component implementation. - - When this method is invoked when nPort in an output port, the - component will: - 1. Populate the pTunnelSetup structure with the output port's - requirements and constraints for the tunnel. - - When this method is invoked when nPort in an input port, the - component will: - 1. Query the necessary parameters from the output port to - determine if the ports are compatible for tunneling - 2. If the ports are compatible, the component should store - the tunnel step provided by the output port - 3. Determine which port (either input or output) is the buffer - supplier, and call OMX_SetParameter on the output port to - indicate this selection. - - The component will return from this call within 5 msec. - - @param [in] hComp - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle method. - @param [in] nPort - nPort is used to select the port on the component to be used - for tunneling. - @param [in] hTunneledComp - Handle of the component to tunnel with. This is the component - handle returned by the call to the OMX_GetHandle method. When - this parameter is 0x0 the component should setup the port for - communication with the application / IL Client. - @param [in] nPortOutput - nPortOutput is used indicate the port the component should - tunnel with. - @param [in] pTunnelSetup - Pointer to the tunnel setup structure. When nPort is an output port - the component should populate the fields of this structure. When - When nPort is an input port the component should review the setup - provided by the component with the output port. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup tun - */ - - OMX_ERRORTYPE (*ComponentTunnelRequest)( - OMX_IN OMX_HANDLETYPE hComp, - OMX_IN OMX_U32 nPort, - OMX_IN OMX_HANDLETYPE hTunneledComp, - OMX_IN OMX_U32 nTunneledPort, - OMX_INOUT OMX_TUNNELSETUPTYPE* pTunnelSetup); - - /** refer to OMX_UseBuffer in OMX_core.h or the OMX IL - specification for details on the UseBuffer method. - @ingroup buf - */ - OMX_ERRORTYPE (*UseBuffer)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr, - OMX_IN OMX_U32 nPortIndex, - OMX_IN OMX_PTR pAppPrivate, - OMX_IN OMX_U32 nSizeBytes, - OMX_IN OMX_U8* pBuffer); - - /** refer to OMX_AllocateBuffer in OMX_core.h or the OMX IL - specification for details on the AllocateBuffer method. - @ingroup buf - */ - OMX_ERRORTYPE (*AllocateBuffer)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_INOUT OMX_BUFFERHEADERTYPE** ppBuffer, - OMX_IN OMX_U32 nPortIndex, - OMX_IN OMX_PTR pAppPrivate, - OMX_IN OMX_U32 nSizeBytes); - - /** refer to OMX_FreeBuffer in OMX_core.h or the OMX IL - specification for details on the FreeBuffer method. - @ingroup buf - */ - OMX_ERRORTYPE (*FreeBuffer)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_U32 nPortIndex, - OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); - - /** refer to OMX_EmptyThisBuffer in OMX_core.h or the OMX IL - specification for details on the EmptyThisBuffer method. - @ingroup buf - */ - OMX_ERRORTYPE (*EmptyThisBuffer)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); - - /** refer to OMX_FillThisBuffer in OMX_core.h or the OMX IL - specification for details on the FillThisBuffer method. - @ingroup buf - */ - OMX_ERRORTYPE (*FillThisBuffer)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); - - /** The SetCallbacks method is used by the core to specify the callback - structure from the application to the component. This is a blocking - call. The component will return from this call within 5 msec. - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the GetHandle function. - @param [in] pCallbacks - pointer to an OMX_CALLBACKTYPE structure used to provide the - callback information to the component - @param [in] pAppData - pointer to an application defined value. It is anticipated that - the application will pass a pointer to a data structure or a "this - pointer" in this area to allow the callback (in the application) - to determine the context of the call - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - */ - OMX_ERRORTYPE (*SetCallbacks)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_CALLBACKTYPE* pCallbacks, - OMX_IN OMX_PTR pAppData); - - /** ComponentDeInit method is used to deinitialize the component - providing a means to free any resources allocated at component - initialization. NOTE: After this call the component handle is - not valid for further use. - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the GetHandle function. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - */ - OMX_ERRORTYPE (*ComponentDeInit)( - OMX_IN OMX_HANDLETYPE hComponent); - - /** @ingroup buf */ - OMX_ERRORTYPE (*UseEGLImage)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr, - OMX_IN OMX_U32 nPortIndex, - OMX_IN OMX_PTR pAppPrivate, - OMX_IN void* eglImage); - - OMX_ERRORTYPE (*ComponentRoleEnum)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_OUT OMX_U8 *cRole, - OMX_IN OMX_U32 nIndex); - -} OMX_COMPONENTTYPE; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/openmax/OMX_ContentPipe.h b/external/android/include/14/frameworks/base/include/media/stagefright/openmax/OMX_ContentPipe.h deleted file mode 100644 index ee9e4db..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/openmax/OMX_ContentPipe.h +++ /dev/null @@ -1,212 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** OMX_ContentPipe.h - OpenMax IL version 1.1.2 - * The OMX_ContentPipe header file contains the definitions used to define - * the public interface for content piples. This header file is intended to - * be used by the component. - */ - -#ifndef OMX_CONTENTPIPE_H -#define OMX_CONTENTPIPE_H - -#ifndef KD_EACCES -/* OpenKODE error codes. CPResult values may be zero (indicating success - or one of the following values) */ -#define KD_EACCES (1) -#define KD_EADDRINUSE (2) -#define KD_EAGAIN (5) -#define KD_EBADF (7) -#define KD_EBUSY (8) -#define KD_ECONNREFUSED (9) -#define KD_ECONNRESET (10) -#define KD_EDEADLK (11) -#define KD_EDESTADDRREQ (12) -#define KD_ERANGE (35) -#define KD_EEXIST (13) -#define KD_EFBIG (14) -#define KD_EHOSTUNREACH (15) -#define KD_EINVAL (17) -#define KD_EIO (18) -#define KD_EISCONN (20) -#define KD_EISDIR (21) -#define KD_EMFILE (22) -#define KD_ENAMETOOLONG (23) -#define KD_ENOENT (24) -#define KD_ENOMEM (25) -#define KD_ENOSPC (26) -#define KD_ENOSYS (27) -#define KD_ENOTCONN (28) -#define KD_EPERM (33) -#define KD_ETIMEDOUT (36) -#define KD_EILSEQ (19) -#endif - -/** Map types from OMX standard types only here so interface is as generic as possible. */ -typedef OMX_U32 CPresult; -typedef char * CPstring; -typedef void * CPhandle; -typedef OMX_U32 CPuint; -typedef OMX_S32 CPint; -typedef char CPbyte; -typedef OMX_BOOL CPbool; - -/** enumeration of origin types used in the CP_PIPETYPE's Seek function - * @ingroup cp - */ -typedef enum CP_ORIGINTYPE { - CP_OriginBegin, - CP_OriginCur, - CP_OriginEnd, - CP_OriginKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - CP_OriginVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - CP_OriginMax = 0X7FFFFFFF -} CP_ORIGINTYPE; - -/** enumeration of contact access types used in the CP_PIPETYPE's Open function - * @ingroup cp - */ -typedef enum CP_ACCESSTYPE { - CP_AccessRead, - CP_AccessWrite, - CP_AccessReadWrite , - CP_AccessKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - CP_AccessVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - CP_AccessMax = 0X7FFFFFFF -} CP_ACCESSTYPE; - -/** enumeration of results returned by the CP_PIPETYPE's CheckAvailableBytes function - * @ingroup cp - */ -typedef enum CP_CHECKBYTESRESULTTYPE -{ - CP_CheckBytesOk, /**< There are at least the request number - of bytes available */ - CP_CheckBytesNotReady, /**< The pipe is still retrieving bytes - and presently lacks sufficient bytes. - Client will be called when they are - sufficient bytes are available. */ - CP_CheckBytesInsufficientBytes , /**< The pipe has retrieved all bytes - but those available are less than those - requested */ - CP_CheckBytesAtEndOfStream, /**< The pipe has reached the end of stream - and no more bytes are available. */ - CP_CheckBytesOutOfBuffers, /**< All read/write buffers are currently in use. */ - CP_CheckBytesKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - CP_CheckBytesVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - CP_CheckBytesMax = 0X7FFFFFFF -} CP_CHECKBYTESRESULTTYPE; - -/** enumeration of content pipe events sent to the client callback. - * @ingroup cp - */ -typedef enum CP_EVENTTYPE{ - CP_BytesAvailable, /** bytes requested in a CheckAvailableBytes call are now available*/ - CP_Overflow, /** enumeration of content pipe events sent to the client callback*/ - CP_PipeDisconnected , /** enumeration of content pipe events sent to the client callback*/ - CP_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - CP_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - CP_EventMax = 0X7FFFFFFF -} CP_EVENTTYPE; - -/** content pipe definition - * @ingroup cp - */ -typedef struct CP_PIPETYPE -{ - /** Open a content stream for reading or writing. */ - CPresult (*Open)( CPhandle* hContent, CPstring szURI, CP_ACCESSTYPE eAccess ); - - /** Close a content stream. */ - CPresult (*Close)( CPhandle hContent ); - - /** Create a content source and open it for writing. */ - CPresult (*Create)( CPhandle *hContent, CPstring szURI ); - - /** Check the that specified number of bytes are available for reading or writing (depending on access type).*/ - CPresult (*CheckAvailableBytes)( CPhandle hContent, CPuint nBytesRequested, CP_CHECKBYTESRESULTTYPE *eResult ); - - /** Seek to certain position in the content relative to the specified origin. */ - CPresult (*SetPosition)( CPhandle hContent, CPint nOffset, CP_ORIGINTYPE eOrigin); - - /** Retrieve the current position relative to the start of the content. */ - CPresult (*GetPosition)( CPhandle hContent, CPuint *pPosition); - - /** Retrieve data of the specified size from the content stream (advance content pointer by size of data). - Note: pipe client provides pointer. This function is appropriate for small high frequency reads. */ - CPresult (*Read)( CPhandle hContent, CPbyte *pData, CPuint nSize); - - /** Retrieve a buffer allocated by the pipe that contains the requested number of bytes. - Buffer contains the next block of bytes, as specified by nSize, of the content. nSize also - returns the size of the block actually read. Content pointer advances the by the returned size. - Note: pipe provides pointer. This function is appropriate for large reads. The client must call - ReleaseReadBuffer when done with buffer. - - In some cases the requested block may not reside in contiguous memory within the - pipe implementation. For instance if the pipe leverages a circular buffer then the requested - block may straddle the boundary of the circular buffer. By default a pipe implementation - performs a copy in this case to provide the block to the pipe client in one contiguous buffer. - If, however, the client sets bForbidCopy, then the pipe returns only those bytes preceding the memory - boundary. Here the client may retrieve the data in segments over successive calls. */ - CPresult (*ReadBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint *nSize, CPbool bForbidCopy); - - /** Release a buffer obtained by ReadBuffer back to the pipe. */ - CPresult (*ReleaseReadBuffer)(CPhandle hContent, CPbyte *pBuffer); - - /** Write data of the specified size to the content (advance content pointer by size of data). - Note: pipe client provides pointer. This function is appropriate for small high frequency writes. */ - CPresult (*Write)( CPhandle hContent, CPbyte *data, CPuint nSize); - - /** Retrieve a buffer allocated by the pipe used to write data to the content. - Client will fill buffer with output data. Note: pipe provides pointer. This function is appropriate - for large writes. The client must call WriteBuffer when done it has filled the buffer with data.*/ - CPresult (*GetWriteBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint nSize); - - /** Deliver a buffer obtained via GetWriteBuffer to the pipe. Pipe will write the - the contents of the buffer to content and advance content pointer by the size of the buffer */ - CPresult (*WriteBuffer)( CPhandle hContent, CPbyte *pBuffer, CPuint nFilledSize); - - /** Register a per-handle client callback with the content pipe. */ - CPresult (*RegisterCallback)( CPhandle hContent, CPresult (*ClientCallback)(CP_EVENTTYPE eEvent, CPuint iParam)); - -} CP_PIPETYPE; - -#endif - diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/openmax/OMX_Core.h b/external/android/include/14/frameworks/base/include/media/stagefright/openmax/OMX_Core.h deleted file mode 100644 index 9fb0f6f..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/openmax/OMX_Core.h +++ /dev/null @@ -1,1448 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** OMX_Core.h - OpenMax IL version 1.1.2 - * The OMX_Core header file contains the definitions used by both the - * application and the component to access common items. - */ - -#ifndef OMX_Core_h -#define OMX_Core_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/* Each OMX header shall include all required header files to allow the - * header to compile without errors. The includes below are required - * for this header file to compile successfully - */ - -#include - - -/** The OMX_COMMANDTYPE enumeration is used to specify the action in the - * OMX_SendCommand macro. - * @ingroup core - */ -typedef enum OMX_COMMANDTYPE -{ - OMX_CommandStateSet, /**< Change the component state */ - OMX_CommandFlush, /**< Flush the data queue(s) of a component */ - OMX_CommandPortDisable, /**< Disable a port on a component. */ - OMX_CommandPortEnable, /**< Enable a port on a component. */ - OMX_CommandMarkBuffer, /**< Mark a component/buffer for observation */ - OMX_CommandKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_CommandVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_CommandMax = 0X7FFFFFFF -} OMX_COMMANDTYPE; - - - -/** The OMX_STATETYPE enumeration is used to indicate or change the component - * state. This enumeration reflects the current state of the component when - * used with the OMX_GetState macro or becomes the parameter in a state change - * command when used with the OMX_SendCommand macro. - * - * The component will be in the Loaded state after the component is initially - * loaded into memory. In the Loaded state, the component is not allowed to - * allocate or hold resources other than to build it's internal parameter - * and configuration tables. The application will send one or more - * SetParameters/GetParameters and SetConfig/GetConfig commands to the - * component and the component will record each of these parameter and - * configuration changes for use later. When the application sends the - * Idle command, the component will acquire the resources needed for the - * specified configuration and will transition to the idle state if the - * allocation is successful. If the component cannot successfully - * transition to the idle state for any reason, the state of the component - * shall be fully rolled back to the Loaded state (e.g. all allocated - * resources shall be released). When the component receives the command - * to go to the Executing state, it shall begin processing buffers by - * sending all input buffers it holds to the application. While - * the component is in the Idle state, the application may also send the - * Pause command. If the component receives the pause command while in the - * Idle state, the component shall send all input buffers it holds to the - * application, but shall not begin processing buffers. This will allow the - * application to prefill buffers. - * - * @ingroup comp - */ - -typedef enum OMX_STATETYPE -{ - OMX_StateInvalid, /**< component has detected that it's internal data - structures are corrupted to the point that - it cannot determine it's state properly */ - OMX_StateLoaded, /**< component has been loaded but has not completed - initialization. The OMX_SetParameter macro - and the OMX_GetParameter macro are the only - valid macros allowed to be sent to the - component in this state. */ - OMX_StateIdle, /**< component initialization has been completed - successfully and the component is ready to - to start. */ - OMX_StateExecuting, /**< component has accepted the start command and - is processing data (if data is available) */ - OMX_StatePause, /**< component has received pause command */ - OMX_StateWaitForResources, /**< component is waiting for resources, either after - preemption or before it gets the resources requested. - See specification for complete details. */ - OMX_StateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_StateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_StateMax = 0X7FFFFFFF -} OMX_STATETYPE; - -/** The OMX_ERRORTYPE enumeration defines the standard OMX Errors. These - * errors should cover most of the common failure cases. However, - * vendors are free to add additional error messages of their own as - * long as they follow these rules: - * 1. Vendor error messages shall be in the range of 0x90000000 to - * 0x9000FFFF. - * 2. Vendor error messages shall be defined in a header file provided - * with the component. No error messages are allowed that are - * not defined. - */ -typedef enum OMX_ERRORTYPE -{ - OMX_ErrorNone = 0, - - /** There were insufficient resources to perform the requested operation */ - OMX_ErrorInsufficientResources = (OMX_S32) 0x80001000, - - /** There was an error, but the cause of the error could not be determined */ - OMX_ErrorUndefined = (OMX_S32) 0x80001001, - - /** The component name string was not valid */ - OMX_ErrorInvalidComponentName = (OMX_S32) 0x80001002, - - /** No component with the specified name string was found */ - OMX_ErrorComponentNotFound = (OMX_S32) 0x80001003, - - /** The component specified did not have a "OMX_ComponentInit" or - "OMX_ComponentDeInit entry point */ - OMX_ErrorInvalidComponent = (OMX_S32) 0x80001004, - - /** One or more parameters were not valid */ - OMX_ErrorBadParameter = (OMX_S32) 0x80001005, - - /** The requested function is not implemented */ - OMX_ErrorNotImplemented = (OMX_S32) 0x80001006, - - /** The buffer was emptied before the next buffer was ready */ - OMX_ErrorUnderflow = (OMX_S32) 0x80001007, - - /** The buffer was not available when it was needed */ - OMX_ErrorOverflow = (OMX_S32) 0x80001008, - - /** The hardware failed to respond as expected */ - OMX_ErrorHardware = (OMX_S32) 0x80001009, - - /** The component is in the state OMX_StateInvalid */ - OMX_ErrorInvalidState = (OMX_S32) 0x8000100A, - - /** Stream is found to be corrupt */ - OMX_ErrorStreamCorrupt = (OMX_S32) 0x8000100B, - - /** Ports being connected are not compatible */ - OMX_ErrorPortsNotCompatible = (OMX_S32) 0x8000100C, - - /** Resources allocated to an idle component have been - lost resulting in the component returning to the loaded state */ - OMX_ErrorResourcesLost = (OMX_S32) 0x8000100D, - - /** No more indicies can be enumerated */ - OMX_ErrorNoMore = (OMX_S32) 0x8000100E, - - /** The component detected a version mismatch */ - OMX_ErrorVersionMismatch = (OMX_S32) 0x8000100F, - - /** The component is not ready to return data at this time */ - OMX_ErrorNotReady = (OMX_S32) 0x80001010, - - /** There was a timeout that occurred */ - OMX_ErrorTimeout = (OMX_S32) 0x80001011, - - /** This error occurs when trying to transition into the state you are already in */ - OMX_ErrorSameState = (OMX_S32) 0x80001012, - - /** Resources allocated to an executing or paused component have been - preempted, causing the component to return to the idle state */ - OMX_ErrorResourcesPreempted = (OMX_S32) 0x80001013, - - /** A non-supplier port sends this error to the IL client (via the EventHandler callback) - during the allocation of buffers (on a transition from the LOADED to the IDLE state or - on a port restart) when it deems that it has waited an unusually long time for the supplier - to send it an allocated buffer via a UseBuffer call. */ - OMX_ErrorPortUnresponsiveDuringAllocation = (OMX_S32) 0x80001014, - - /** A non-supplier port sends this error to the IL client (via the EventHandler callback) - during the deallocation of buffers (on a transition from the IDLE to LOADED state or - on a port stop) when it deems that it has waited an unusually long time for the supplier - to request the deallocation of a buffer header via a FreeBuffer call. */ - OMX_ErrorPortUnresponsiveDuringDeallocation = (OMX_S32) 0x80001015, - - /** A supplier port sends this error to the IL client (via the EventHandler callback) - during the stopping of a port (either on a transition from the IDLE to LOADED - state or a port stop) when it deems that it has waited an unusually long time for - the non-supplier to return a buffer via an EmptyThisBuffer or FillThisBuffer call. */ - OMX_ErrorPortUnresponsiveDuringStop = (OMX_S32) 0x80001016, - - /** Attempting a state transtion that is not allowed */ - OMX_ErrorIncorrectStateTransition = (OMX_S32) 0x80001017, - - /* Attempting a command that is not allowed during the present state. */ - OMX_ErrorIncorrectStateOperation = (OMX_S32) 0x80001018, - - /** The values encapsulated in the parameter or config structure are not supported. */ - OMX_ErrorUnsupportedSetting = (OMX_S32) 0x80001019, - - /** The parameter or config indicated by the given index is not supported. */ - OMX_ErrorUnsupportedIndex = (OMX_S32) 0x8000101A, - - /** The port index supplied is incorrect. */ - OMX_ErrorBadPortIndex = (OMX_S32) 0x8000101B, - - /** The port has lost one or more of its buffers and it thus unpopulated. */ - OMX_ErrorPortUnpopulated = (OMX_S32) 0x8000101C, - - /** Component suspended due to temporary loss of resources */ - OMX_ErrorComponentSuspended = (OMX_S32) 0x8000101D, - - /** Component suspended due to an inability to acquire dynamic resources */ - OMX_ErrorDynamicResourcesUnavailable = (OMX_S32) 0x8000101E, - - /** When the macroblock error reporting is enabled the component returns new error - for every frame that has errors */ - OMX_ErrorMbErrorsInFrame = (OMX_S32) 0x8000101F, - - /** A component reports this error when it cannot parse or determine the format of an input stream. */ - OMX_ErrorFormatNotDetected = (OMX_S32) 0x80001020, - - /** The content open operation failed. */ - OMX_ErrorContentPipeOpenFailed = (OMX_S32) 0x80001021, - - /** The content creation operation failed. */ - OMX_ErrorContentPipeCreationFailed = (OMX_S32) 0x80001022, - - /** Separate table information is being used */ - OMX_ErrorSeperateTablesUsed = (OMX_S32) 0x80001023, - - /** Tunneling is unsupported by the component*/ - OMX_ErrorTunnelingUnsupported = (OMX_S32) 0x80001024, - - OMX_ErrorKhronosExtensions = (OMX_S32)0x8F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_ErrorVendorStartUnused = (OMX_S32)0x90000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_ErrorMax = 0x7FFFFFFF -} OMX_ERRORTYPE; - -/** @ingroup core */ -typedef OMX_ERRORTYPE (* OMX_COMPONENTINITTYPE)(OMX_IN OMX_HANDLETYPE hComponent); - -/** @ingroup core */ -typedef struct OMX_COMPONENTREGISTERTYPE -{ - const char * pName; /* Component name, 128 byte limit (including '\0') applies */ - OMX_COMPONENTINITTYPE pInitialize; /* Component instance initialization function */ -} OMX_COMPONENTREGISTERTYPE; - -/** @ingroup core */ -extern OMX_COMPONENTREGISTERTYPE OMX_ComponentRegistered[]; - -/** @ingroup rpm */ -typedef struct OMX_PRIORITYMGMTTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nGroupPriority; /**< Priority of the component group */ - OMX_U32 nGroupID; /**< ID of the component group */ -} OMX_PRIORITYMGMTTYPE; - -/* Component name and Role names are limited to 128 characters including the terminating '\0'. */ -#define OMX_MAX_STRINGNAME_SIZE 128 - -/** @ingroup comp */ -typedef struct OMX_PARAM_COMPONENTROLETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U8 cRole[OMX_MAX_STRINGNAME_SIZE]; /**< name of standard component which defines component role */ -} OMX_PARAM_COMPONENTROLETYPE; - -/** End of Stream Buffer Flag: - * - * A component sets EOS when it has no more data to emit on a particular - * output port. Thus an output port shall set EOS on the last buffer it - * emits. A component's determination of when an output port should - * cease sending data is implemenation specific. - * @ingroup buf - */ - -#define OMX_BUFFERFLAG_EOS 0x00000001 - -/** Start Time Buffer Flag: - * - * The source of a stream (e.g. a demux component) sets the STARTTIME - * flag on the buffer that contains the starting timestamp for the - * stream. The starting timestamp corresponds to the first data that - * should be displayed at startup or after a seek. - * The first timestamp of the stream is not necessarily the start time. - * For instance, in the case of a seek to a particular video frame, - * the target frame may be an interframe. Thus the first buffer of - * the stream will be the intra-frame preceding the target frame and - * the starttime will occur with the target frame (with any other - * required frames required to reconstruct the target intervening). - * - * The STARTTIME flag is directly associated with the buffer's - * timestamp ' thus its association to buffer data and its - * propagation is identical to the timestamp's. - * - * When a Sync Component client receives a buffer with the - * STARTTIME flag it shall perform a SetConfig on its sync port - * using OMX_ConfigTimeClientStartTime and passing the buffer's - * timestamp. - * - * @ingroup buf - */ - -#define OMX_BUFFERFLAG_STARTTIME 0x00000002 - - - -/** Decode Only Buffer Flag: - * - * The source of a stream (e.g. a demux component) sets the DECODEONLY - * flag on any buffer that should shall be decoded but should not be - * displayed. This flag is used, for instance, when a source seeks to - * a target interframe that requires the decode of frames preceding the - * target to facilitate the target's reconstruction. In this case the - * source would emit the frames preceding the target downstream - * but mark them as decode only. - * - * The DECODEONLY is associated with buffer data and propagated in a - * manner identical to the buffer timestamp. - * - * A component that renders data should ignore all buffers with - * the DECODEONLY flag set. - * - * @ingroup buf - */ - -#define OMX_BUFFERFLAG_DECODEONLY 0x00000004 - - -/* Data Corrupt Flag: This flag is set when the IL client believes the data in the associated buffer is corrupt - * @ingroup buf - */ - -#define OMX_BUFFERFLAG_DATACORRUPT 0x00000008 - -/* End of Frame: The buffer contains exactly one end of frame and no data - * occurs after the end of frame. This flag is an optional hint. The absence - * of this flag does not imply the absence of an end of frame within the buffer. - * @ingroup buf -*/ -#define OMX_BUFFERFLAG_ENDOFFRAME 0x00000010 - -/* Sync Frame Flag: This flag is set when the buffer content contains a coded sync frame ' - * a frame that has no dependency on any other frame information - * @ingroup buf - */ -#define OMX_BUFFERFLAG_SYNCFRAME 0x00000020 - -/* Extra data present flag: there is extra data appended to the data stream - * residing in the buffer - * @ingroup buf - */ -#define OMX_BUFFERFLAG_EXTRADATA 0x00000040 - -/** Codec Config Buffer Flag: -* OMX_BUFFERFLAG_CODECCONFIG is an optional flag that is set by an -* output port when all bytes in the buffer form part or all of a set of -* codec specific configuration data. Examples include SPS/PPS nal units -* for OMX_VIDEO_CodingAVC or AudioSpecificConfig data for -* OMX_AUDIO_CodingAAC. Any component that for a given stream sets -* OMX_BUFFERFLAG_CODECCONFIG shall not mix codec configuration bytes -* with frame data in the same buffer, and shall send all buffers -* containing codec configuration bytes before any buffers containing -* frame data that those configurations bytes describe. -* If the stream format for a particular codec has a frame specific -* header at the start of each frame, for example OMX_AUDIO_CodingMP3 or -* OMX_AUDIO_CodingAAC in ADTS mode, then these shall be presented as -* normal without setting OMX_BUFFERFLAG_CODECCONFIG. - * @ingroup buf - */ -#define OMX_BUFFERFLAG_CODECCONFIG 0x00000080 - - - -/** @ingroup buf */ -typedef struct OMX_BUFFERHEADERTYPE -{ - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U8* pBuffer; /**< Pointer to actual block of memory - that is acting as the buffer */ - OMX_U32 nAllocLen; /**< size of the buffer allocated, in bytes */ - OMX_U32 nFilledLen; /**< number of bytes currently in the - buffer */ - OMX_U32 nOffset; /**< start offset of valid data in bytes from - the start of the buffer */ - OMX_PTR pAppPrivate; /**< pointer to any data the application - wants to associate with this buffer */ - OMX_PTR pPlatformPrivate; /**< pointer to any data the platform - wants to associate with this buffer */ - OMX_PTR pInputPortPrivate; /**< pointer to any data the input port - wants to associate with this buffer */ - OMX_PTR pOutputPortPrivate; /**< pointer to any data the output port - wants to associate with this buffer */ - OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will generate a - mark event upon processing this buffer. */ - OMX_PTR pMarkData; /**< Application specific data associated with - the mark sent on a mark event to disambiguate - this mark from others. */ - OMX_U32 nTickCount; /**< Optional entry that the component and - application can update with a tick count - when they access the component. This - value should be in microseconds. Since - this is a value relative to an arbitrary - starting point, this value cannot be used - to determine absolute time. This is an - optional entry and not all components - will update it.*/ - OMX_TICKS nTimeStamp; /**< Timestamp corresponding to the sample - starting at the first logical sample - boundary in the buffer. Timestamps of - successive samples within the buffer may - be inferred by adding the duration of the - of the preceding buffer to the timestamp - of the preceding buffer.*/ - OMX_U32 nFlags; /**< buffer specific flags */ - OMX_U32 nOutputPortIndex; /**< The index of the output port (if any) using - this buffer */ - OMX_U32 nInputPortIndex; /**< The index of the input port (if any) using - this buffer */ -} OMX_BUFFERHEADERTYPE; - -/** The OMX_EXTRADATATYPE enumeration is used to define the - * possible extra data payload types. - * NB: this enum is binary backwards compatible with the previous - * OMX_EXTRADATA_QUANT define. This should be replaced with - * OMX_ExtraDataQuantization. - */ -typedef enum OMX_EXTRADATATYPE -{ - OMX_ExtraDataNone = 0, /**< Indicates that no more extra data sections follow */ - OMX_ExtraDataQuantization, /**< The data payload contains quantization data */ - OMX_ExtraDataKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_ExtraDataVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_ExtraDataMax = 0x7FFFFFFF -} OMX_EXTRADATATYPE; - - -typedef struct OMX_OTHER_EXTRADATATYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_EXTRADATATYPE eType; /* Extra Data type */ - OMX_U32 nDataSize; /* Size of the supporting data to follow */ - OMX_U8 data[1]; /* Supporting data hint */ -} OMX_OTHER_EXTRADATATYPE; - -/** @ingroup comp */ -typedef struct OMX_PORT_PARAM_TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPorts; /**< The number of ports for this component */ - OMX_U32 nStartPortNumber; /** first port number for this type of port */ -} OMX_PORT_PARAM_TYPE; - -/** @ingroup comp */ -typedef enum OMX_EVENTTYPE -{ - OMX_EventCmdComplete, /**< component has sucessfully completed a command */ - OMX_EventError, /**< component has detected an error condition */ - OMX_EventMark, /**< component has detected a buffer mark */ - OMX_EventPortSettingsChanged, /**< component is reported a port settings change */ - OMX_EventBufferFlag, /**< component has detected an EOS */ - OMX_EventResourcesAcquired, /**< component has been granted resources and is - automatically starting the state change from - OMX_StateWaitForResources to OMX_StateIdle. */ - OMX_EventComponentResumed, /**< Component resumed due to reacquisition of resources */ - OMX_EventDynamicResourcesAvailable, /**< Component has acquired previously unavailable dynamic resources */ - OMX_EventPortFormatDetected, /**< Component has detected a supported format. */ - OMX_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_EventMax = 0x7FFFFFFF -} OMX_EVENTTYPE; - -typedef struct OMX_CALLBACKTYPE -{ - /** The EventHandler method is used to notify the application when an - event of interest occurs. Events are defined in the OMX_EVENTTYPE - enumeration. Please see that enumeration for details of what will - be returned for each type of event. Callbacks should not return - an error to the component, so if an error occurs, the application - shall handle it internally. This is a blocking call. - - The application should return from this call within 5 msec to avoid - blocking the component for an excessively long period of time. - - @param hComponent - handle of the component to access. This is the component - handle returned by the call to the GetHandle function. - @param pAppData - pointer to an application defined value that was provided in the - pAppData parameter to the OMX_GetHandle method for the component. - This application defined value is provided so that the application - can have a component specific context when receiving the callback. - @param eEvent - Event that the component wants to notify the application about. - @param nData1 - nData will be the OMX_ERRORTYPE for an error event and will be - an OMX_COMMANDTYPE for a command complete event and OMX_INDEXTYPE for a OMX_PortSettingsChanged event. - @param nData2 - nData2 will hold further information related to the event. Can be OMX_STATETYPE for - a OMX_CommandStateSet command or port index for a OMX_PortSettingsChanged event. - Default value is 0 if not used. ) - @param pEventData - Pointer to additional event-specific data (see spec for meaning). - */ - - OMX_ERRORTYPE (*EventHandler)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_PTR pAppData, - OMX_IN OMX_EVENTTYPE eEvent, - OMX_IN OMX_U32 nData1, - OMX_IN OMX_U32 nData2, - OMX_IN OMX_PTR pEventData); - - /** The EmptyBufferDone method is used to return emptied buffers from an - input port back to the application for reuse. This is a blocking call - so the application should not attempt to refill the buffers during this - call, but should queue them and refill them in another thread. There - is no error return, so the application shall handle any errors generated - internally. - - The application should return from this call within 5 msec. - - @param hComponent - handle of the component to access. This is the component - handle returned by the call to the GetHandle function. - @param pAppData - pointer to an application defined value that was provided in the - pAppData parameter to the OMX_GetHandle method for the component. - This application defined value is provided so that the application - can have a component specific context when receiving the callback. - @param pBuffer - pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer - or AllocateBuffer indicating the buffer that was emptied. - @ingroup buf - */ - OMX_ERRORTYPE (*EmptyBufferDone)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_PTR pAppData, - OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); - - /** The FillBufferDone method is used to return filled buffers from an - output port back to the application for emptying and then reuse. - This is a blocking call so the application should not attempt to - empty the buffers during this call, but should queue the buffers - and empty them in another thread. There is no error return, so - the application shall handle any errors generated internally. The - application shall also update the buffer header to indicate the - number of bytes placed into the buffer. - - The application should return from this call within 5 msec. - - @param hComponent - handle of the component to access. This is the component - handle returned by the call to the GetHandle function. - @param pAppData - pointer to an application defined value that was provided in the - pAppData parameter to the OMX_GetHandle method for the component. - This application defined value is provided so that the application - can have a component specific context when receiving the callback. - @param pBuffer - pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer - or AllocateBuffer indicating the buffer that was filled. - @ingroup buf - */ - OMX_ERRORTYPE (*FillBufferDone)( - OMX_OUT OMX_HANDLETYPE hComponent, - OMX_OUT OMX_PTR pAppData, - OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer); - -} OMX_CALLBACKTYPE; - -/** The OMX_BUFFERSUPPLIERTYPE enumeration is used to dictate port supplier - preference when tunneling between two ports. - @ingroup tun buf -*/ -typedef enum OMX_BUFFERSUPPLIERTYPE -{ - OMX_BufferSupplyUnspecified = 0x0, /**< port supplying the buffers is unspecified, - or don't care */ - OMX_BufferSupplyInput, /**< input port supplies the buffers */ - OMX_BufferSupplyOutput, /**< output port supplies the buffers */ - OMX_BufferSupplyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_BufferSupplyVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_BufferSupplyMax = 0x7FFFFFFF -} OMX_BUFFERSUPPLIERTYPE; - - -/** buffer supplier parameter - * @ingroup tun - */ -typedef struct OMX_PARAM_BUFFERSUPPLIERTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BUFFERSUPPLIERTYPE eBufferSupplier; /**< buffer supplier */ -} OMX_PARAM_BUFFERSUPPLIERTYPE; - - -/**< indicates that buffers received by an input port of a tunnel - may not modify the data in the buffers - @ingroup tun - */ -#define OMX_PORTTUNNELFLAG_READONLY 0x00000001 - - -/** The OMX_TUNNELSETUPTYPE structure is used to pass data from an output - port to an input port as part the two ComponentTunnelRequest calls - resulting from a OMX_SetupTunnel call from the IL Client. - @ingroup tun - */ -typedef struct OMX_TUNNELSETUPTYPE -{ - OMX_U32 nTunnelFlags; /**< bit flags for tunneling */ - OMX_BUFFERSUPPLIERTYPE eSupplier; /**< supplier preference */ -} OMX_TUNNELSETUPTYPE; - -/* OMX Component headers is included to enable the core to use - macros for functions into the component for OMX release 1.0. - Developers should not access any structures or data from within - the component header directly */ -/* TO BE REMOVED - #include */ - -/** GetComponentVersion will return information about the component. - This is a blocking call. This macro will go directly from the - application to the component (via a core macro). The - component will return from this call within 5 msec. - @param [in] hComponent - handle of component to execute the command - @param [out] pComponentName - pointer to an empty string of length 128 bytes. The component - will write its name into this string. The name will be - terminated by a single zero byte. The name of a component will - be 127 bytes or less to leave room for the trailing zero byte. - An example of a valid component name is "OMX.ABC.ChannelMixer\0". - @param [out] pComponentVersion - pointer to an OMX Version structure that the component will fill - in. The component will fill in a value that indicates the - component version. NOTE: the component version is NOT the same - as the OMX Specification version (found in all structures). The - component version is defined by the vendor of the component and - its value is entirely up to the component vendor. - @param [out] pSpecVersion - pointer to an OMX Version structure that the component will fill - in. The SpecVersion is the version of the specification that the - component was built against. Please note that this value may or - may not match the structure's version. For example, if the - component was built against the 2.0 specification, but the - application (which creates the structure is built against the - 1.0 specification the versions would be different. - @param [out] pComponentUUID - pointer to the UUID of the component which will be filled in by - the component. The UUID is a unique identifier that is set at - RUN time for the component and is unique to each instantion of - the component. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_GetComponentVersion( \ - hComponent, \ - pComponentName, \ - pComponentVersion, \ - pSpecVersion, \ - pComponentUUID) \ - ((OMX_COMPONENTTYPE*)hComponent)->GetComponentVersion( \ - hComponent, \ - pComponentName, \ - pComponentVersion, \ - pSpecVersion, \ - pComponentUUID) /* Macro End */ - - -/** Send a command to the component. This call is a non-blocking call. - The component should check the parameters and then queue the command - to the component thread to be executed. The component thread shall - send the EventHandler() callback at the conclusion of the command. - This macro will go directly from the application to the component (via - a core macro). The component will return from this call within 5 msec. - - When the command is "OMX_CommandStateSet" the component will queue a - state transition to the new state idenfied in nParam. - - When the command is "OMX_CommandFlush", to flush a port's buffer queues, - the command will force the component to return all buffers NOT CURRENTLY - BEING PROCESSED to the application, in the order in which the buffers - were received. - - When the command is "OMX_CommandPortDisable" or - "OMX_CommandPortEnable", the component's port (given by the value of - nParam) will be stopped or restarted. - - When the command "OMX_CommandMarkBuffer" is used to mark a buffer, the - pCmdData will point to a OMX_MARKTYPE structure containing the component - handle of the component to examine the buffer chain for the mark. nParam1 - contains the index of the port on which the buffer mark is applied. - - Specification text for more details. - - @param [in] hComponent - handle of component to execute the command - @param [in] Cmd - Command for the component to execute - @param [in] nParam - Parameter for the command to be executed. When Cmd has the value - OMX_CommandStateSet, value is a member of OMX_STATETYPE. When Cmd has - the value OMX_CommandFlush, value of nParam indicates which port(s) - to flush. -1 is used to flush all ports a single port index will - only flush that port. When Cmd has the value "OMX_CommandPortDisable" - or "OMX_CommandPortEnable", the component's port is given by - the value of nParam. When Cmd has the value "OMX_CommandMarkBuffer" - the components pot is given by the value of nParam. - @param [in] pCmdData - Parameter pointing to the OMX_MARKTYPE structure when Cmd has the value - "OMX_CommandMarkBuffer". - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_SendCommand( \ - hComponent, \ - Cmd, \ - nParam, \ - pCmdData) \ - ((OMX_COMPONENTTYPE*)hComponent)->SendCommand( \ - hComponent, \ - Cmd, \ - nParam, \ - pCmdData) /* Macro End */ - - -/** The OMX_GetParameter macro will get one of the current parameter - settings from the component. This macro cannot only be invoked when - the component is in the OMX_StateInvalid state. The nParamIndex - parameter is used to indicate which structure is being requested from - the component. The application shall allocate the correct structure - and shall fill in the structure size and version information before - invoking this macro. When the parameter applies to a port, the - caller shall fill in the appropriate nPortIndex value indicating the - port on which the parameter applies. If the component has not had - any settings changed, then the component should return a set of - valid DEFAULT parameters for the component. This is a blocking - call. - - The component should return from this call within 20 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] nParamIndex - Index of the structure to be filled. This value is from the - OMX_INDEXTYPE enumeration. - @param [in,out] pComponentParameterStructure - Pointer to application allocated structure to be filled by the - component. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_GetParameter( \ - hComponent, \ - nParamIndex, \ - pComponentParameterStructure) \ - ((OMX_COMPONENTTYPE*)hComponent)->GetParameter( \ - hComponent, \ - nParamIndex, \ - pComponentParameterStructure) /* Macro End */ - - -/** The OMX_SetParameter macro will send an initialization parameter - structure to a component. Each structure shall be sent one at a time, - in a separate invocation of the macro. This macro can only be - invoked when the component is in the OMX_StateLoaded state, or the - port is disabled (when the parameter applies to a port). The - nParamIndex parameter is used to indicate which structure is being - passed to the component. The application shall allocate the - correct structure and shall fill in the structure size and version - information (as well as the actual data) before invoking this macro. - The application is free to dispose of this structure after the call - as the component is required to copy any data it shall retain. This - is a blocking call. - - The component should return from this call within 20 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] nIndex - Index of the structure to be sent. This value is from the - OMX_INDEXTYPE enumeration. - @param [in] pComponentParameterStructure - pointer to application allocated structure to be used for - initialization by the component. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_SetParameter( \ - hComponent, \ - nParamIndex, \ - pComponentParameterStructure) \ - ((OMX_COMPONENTTYPE*)hComponent)->SetParameter( \ - hComponent, \ - nParamIndex, \ - pComponentParameterStructure) /* Macro End */ - - -/** The OMX_GetConfig macro will get one of the configuration structures - from a component. This macro can be invoked anytime after the - component has been loaded. The nParamIndex call parameter is used to - indicate which structure is being requested from the component. The - application shall allocate the correct structure and shall fill in the - structure size and version information before invoking this macro. - If the component has not had this configuration parameter sent before, - then the component should return a set of valid DEFAULT values for the - component. This is a blocking call. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] nIndex - Index of the structure to be filled. This value is from the - OMX_INDEXTYPE enumeration. - @param [in,out] pComponentConfigStructure - pointer to application allocated structure to be filled by the - component. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp -*/ -#define OMX_GetConfig( \ - hComponent, \ - nConfigIndex, \ - pComponentConfigStructure) \ - ((OMX_COMPONENTTYPE*)hComponent)->GetConfig( \ - hComponent, \ - nConfigIndex, \ - pComponentConfigStructure) /* Macro End */ - - -/** The OMX_SetConfig macro will send one of the configuration - structures to a component. Each structure shall be sent one at a time, - each in a separate invocation of the macro. This macro can be invoked - anytime after the component has been loaded. The application shall - allocate the correct structure and shall fill in the structure size - and version information (as well as the actual data) before invoking - this macro. The application is free to dispose of this structure after - the call as the component is required to copy any data it shall retain. - This is a blocking call. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] nConfigIndex - Index of the structure to be sent. This value is from the - OMX_INDEXTYPE enumeration above. - @param [in] pComponentConfigStructure - pointer to application allocated structure to be used for - initialization by the component. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_SetConfig( \ - hComponent, \ - nConfigIndex, \ - pComponentConfigStructure) \ - ((OMX_COMPONENTTYPE*)hComponent)->SetConfig( \ - hComponent, \ - nConfigIndex, \ - pComponentConfigStructure) /* Macro End */ - - -/** The OMX_GetExtensionIndex macro will invoke a component to translate - a vendor specific configuration or parameter string into an OMX - structure index. There is no requirement for the vendor to support - this command for the indexes already found in the OMX_INDEXTYPE - enumeration (this is done to save space in small components). The - component shall support all vendor supplied extension indexes not found - in the master OMX_INDEXTYPE enumeration. This is a blocking call. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the GetHandle function. - @param [in] cParameterName - OMX_STRING that shall be less than 128 characters long including - the trailing null byte. This is the string that will get - translated by the component into a configuration index. - @param [out] pIndexType - a pointer to a OMX_INDEXTYPE to receive the index value. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_GetExtensionIndex( \ - hComponent, \ - cParameterName, \ - pIndexType) \ - ((OMX_COMPONENTTYPE*)hComponent)->GetExtensionIndex( \ - hComponent, \ - cParameterName, \ - pIndexType) /* Macro End */ - - -/** The OMX_GetState macro will invoke the component to get the current - state of the component and place the state value into the location - pointed to by pState. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [out] pState - pointer to the location to receive the state. The value returned - is one of the OMX_STATETYPE members - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_GetState( \ - hComponent, \ - pState) \ - ((OMX_COMPONENTTYPE*)hComponent)->GetState( \ - hComponent, \ - pState) /* Macro End */ - - -/** The OMX_UseBuffer macro will request that the component use - a buffer (and allocate its own buffer header) already allocated - by another component, or by the IL Client. This is a blocking - call. - - The component should return from this call within 20 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [out] ppBuffer - pointer to an OMX_BUFFERHEADERTYPE structure used to receive the - pointer to the buffer header - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp buf - */ - -#define OMX_UseBuffer( \ - hComponent, \ - ppBufferHdr, \ - nPortIndex, \ - pAppPrivate, \ - nSizeBytes, \ - pBuffer) \ - ((OMX_COMPONENTTYPE*)hComponent)->UseBuffer( \ - hComponent, \ - ppBufferHdr, \ - nPortIndex, \ - pAppPrivate, \ - nSizeBytes, \ - pBuffer) - - -/** The OMX_AllocateBuffer macro will request that the component allocate - a new buffer and buffer header. The component will allocate the - buffer and the buffer header and return a pointer to the buffer - header. This is a blocking call. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [out] ppBuffer - pointer to an OMX_BUFFERHEADERTYPE structure used to receive - the pointer to the buffer header - @param [in] nPortIndex - nPortIndex is used to select the port on the component the buffer will - be used with. The port can be found by using the nPortIndex - value as an index into the Port Definition array of the component. - @param [in] pAppPrivate - pAppPrivate is used to initialize the pAppPrivate member of the - buffer header structure. - @param [in] nSizeBytes - size of the buffer to allocate. Used when bAllocateNew is true. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp buf - */ -#define OMX_AllocateBuffer( \ - hComponent, \ - ppBuffer, \ - nPortIndex, \ - pAppPrivate, \ - nSizeBytes) \ - ((OMX_COMPONENTTYPE*)hComponent)->AllocateBuffer( \ - hComponent, \ - ppBuffer, \ - nPortIndex, \ - pAppPrivate, \ - nSizeBytes) /* Macro End */ - - -/** The OMX_FreeBuffer macro will release a buffer header from the component - which was allocated using either OMX_AllocateBuffer or OMX_UseBuffer. If - the component allocated the buffer (see the OMX_UseBuffer macro) then - the component shall free the buffer and buffer header. This is a - blocking call. - - The component should return from this call within 20 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] nPortIndex - nPortIndex is used to select the port on the component the buffer will - be used with. - @param [in] pBuffer - pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer - or AllocateBuffer. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp buf - */ -#define OMX_FreeBuffer( \ - hComponent, \ - nPortIndex, \ - pBuffer) \ - ((OMX_COMPONENTTYPE*)hComponent)->FreeBuffer( \ - hComponent, \ - nPortIndex, \ - pBuffer) /* Macro End */ - - -/** The OMX_EmptyThisBuffer macro will send a buffer full of data to an - input port of a component. The buffer will be emptied by the component - and returned to the application via the EmptyBufferDone call back. - This is a non-blocking call in that the component will record the buffer - and return immediately and then empty the buffer, later, at the proper - time. As expected, this macro may be invoked only while the component - is in the OMX_StateExecuting. If nPortIndex does not specify an input - port, the component shall return an error. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] pBuffer - pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer - or AllocateBuffer. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp buf - */ -#define OMX_EmptyThisBuffer( \ - hComponent, \ - pBuffer) \ - ((OMX_COMPONENTTYPE*)hComponent)->EmptyThisBuffer( \ - hComponent, \ - pBuffer) /* Macro End */ - - -/** The OMX_FillThisBuffer macro will send an empty buffer to an - output port of a component. The buffer will be filled by the component - and returned to the application via the FillBufferDone call back. - This is a non-blocking call in that the component will record the buffer - and return immediately and then fill the buffer, later, at the proper - time. As expected, this macro may be invoked only while the component - is in the OMX_ExecutingState. If nPortIndex does not specify an output - port, the component shall return an error. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] pBuffer - pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer - or AllocateBuffer. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp buf - */ -#define OMX_FillThisBuffer( \ - hComponent, \ - pBuffer) \ - ((OMX_COMPONENTTYPE*)hComponent)->FillThisBuffer( \ - hComponent, \ - pBuffer) /* Macro End */ - - - -/** The OMX_UseEGLImage macro will request that the component use - a EGLImage provided by EGL (and allocate its own buffer header) - This is a blocking call. - - The component should return from this call within 20 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [out] ppBuffer - pointer to an OMX_BUFFERHEADERTYPE structure used to receive the - pointer to the buffer header. Note that the memory location used - for this buffer is NOT visible to the IL Client. - @param [in] nPortIndex - nPortIndex is used to select the port on the component the buffer will - be used with. The port can be found by using the nPortIndex - value as an index into the Port Definition array of the component. - @param [in] pAppPrivate - pAppPrivate is used to initialize the pAppPrivate member of the - buffer header structure. - @param [in] eglImage - eglImage contains the handle of the EGLImage to use as a buffer on the - specified port. The component is expected to validate properties of - the EGLImage against the configuration of the port to ensure the component - can use the EGLImage as a buffer. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp buf - */ -#define OMX_UseEGLImage( \ - hComponent, \ - ppBufferHdr, \ - nPortIndex, \ - pAppPrivate, \ - eglImage) \ - ((OMX_COMPONENTTYPE*)hComponent)->UseEGLImage( \ - hComponent, \ - ppBufferHdr, \ - nPortIndex, \ - pAppPrivate, \ - eglImage) - -/** The OMX_Init method is used to initialize the OMX core. It shall be the - first call made into OMX and it should only be executed one time without - an interviening OMX_Deinit call. - - The core should return from this call within 20 msec. - - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Init(void); - - -/** The OMX_Deinit method is used to deinitialize the OMX core. It shall be - the last call made into OMX. In the event that the core determines that - thare are components loaded when this call is made, the core may return - with an error rather than try to unload the components. - - The core should return from this call within 20 msec. - - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Deinit(void); - - -/** The OMX_ComponentNameEnum method will enumerate through all the names of - recognised valid components in the system. This function is provided - as a means to detect all the components in the system run-time. There is - no strict ordering to the enumeration order of component names, although - each name will only be enumerated once. If the OMX core supports run-time - installation of new components, it is only requried to detect newly - installed components when the first call to enumerate component names - is made (i.e. when nIndex is 0x0). - - The core should return from this call in 20 msec. - - @param [out] cComponentName - pointer to a null terminated string with the component name. The - names of the components are strings less than 127 bytes in length - plus the trailing null for a maximum size of 128 bytes. An example - of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are - assigned by the vendor, but shall start with "OMX." and then have - the Vendor designation next. - @param [in] nNameLength - number of characters in the cComponentName string. With all - component name strings restricted to less than 128 characters - (including the trailing null) it is recomended that the caller - provide a input string for the cComponentName of 128 characters. - @param [in] nIndex - number containing the enumeration index for the component. - Multiple calls to OMX_ComponentNameEnum with increasing values - of nIndex will enumerate through the component names in the - system until OMX_ErrorNoMore is returned. The value of nIndex - is 0 to (N-1), where N is the number of valid installed components - in the system. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. When the value of nIndex exceeds the number of - components in the system minus 1, OMX_ErrorNoMore will be - returned. Otherwise the appropriate OMX error will be returned. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_ComponentNameEnum( - OMX_OUT OMX_STRING cComponentName, - OMX_IN OMX_U32 nNameLength, - OMX_IN OMX_U32 nIndex); - - -/** The OMX_GetHandle method will locate the component specified by the - component name given, load that component into memory and then invoke - the component's methods to create an instance of the component. - - The core should return from this call within 20 msec. - - @param [out] pHandle - pointer to an OMX_HANDLETYPE pointer to be filled in by this method. - @param [in] cComponentName - pointer to a null terminated string with the component name. The - names of the components are strings less than 127 bytes in length - plus the trailing null for a maximum size of 128 bytes. An example - of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are - assigned by the vendor, but shall start with "OMX." and then have - the Vendor designation next. - @param [in] pAppData - pointer to an application defined value that will be returned - during callbacks so that the application can identify the source - of the callback. - @param [in] pCallBacks - pointer to a OMX_CALLBACKTYPE structure that will be passed to the - component to initialize it with. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_GetHandle( - OMX_OUT OMX_HANDLETYPE* pHandle, - OMX_IN OMX_STRING cComponentName, - OMX_IN OMX_PTR pAppData, - OMX_IN OMX_CALLBACKTYPE* pCallBacks); - - -/** The OMX_FreeHandle method will free a handle allocated by the OMX_GetHandle - method. If the component reference count goes to zero, the component will - be unloaded from memory. - - The core should return from this call within 20 msec when the component is - in the OMX_StateLoaded state. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the GetHandle function. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_FreeHandle( - OMX_IN OMX_HANDLETYPE hComponent); - - - -/** The OMX_SetupTunnel method will handle the necessary calls to the components - to setup the specified tunnel the two components. NOTE: This is - an actual method (not a #define macro). This method will make calls into - the component ComponentTunnelRequest method to do the actual tunnel - connection. - - The ComponentTunnelRequest method on both components will be called. - This method shall not be called unless the component is in the - OMX_StateLoaded state except when the ports used for the tunnel are - disabled. In this case, the component may be in the OMX_StateExecuting, - OMX_StatePause, or OMX_StateIdle states. - - The core should return from this call within 20 msec. - - @param [in] hOutput - Handle of the component to be accessed. Also this is the handle - of the component whose port, specified in the nPortOutput parameter - will be used the source for the tunnel. This is the component handle - returned by the call to the OMX_GetHandle function. There is a - requirement that hOutput be the source for the data when - tunelling (i.e. nPortOutput is an output port). If 0x0, the component - specified in hInput will have it's port specified in nPortInput - setup for communication with the application / IL client. - @param [in] nPortOutput - nPortOutput is used to select the source port on component to be - used in the tunnel. - @param [in] hInput - This is the component to setup the tunnel with. This is the handle - of the component whose port, specified in the nPortInput parameter - will be used the destination for the tunnel. This is the component handle - returned by the call to the OMX_GetHandle function. There is a - requirement that hInput be the destination for the data when - tunelling (i.e. nPortInut is an input port). If 0x0, the component - specified in hOutput will have it's port specified in nPortPOutput - setup for communication with the application / IL client. - @param [in] nPortInput - nPortInput is used to select the destination port on component to be - used in the tunnel. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - When OMX_ErrorNotImplemented is returned, one or both components is - a non-interop component and does not support tunneling. - - On failure, the ports of both components are setup for communication - with the application / IL Client. - @ingroup core tun - */ -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_SetupTunnel( - OMX_IN OMX_HANDLETYPE hOutput, - OMX_IN OMX_U32 nPortOutput, - OMX_IN OMX_HANDLETYPE hInput, - OMX_IN OMX_U32 nPortInput); - -/** @ingroup cp */ -OMX_API OMX_ERRORTYPE OMX_GetContentPipe( - OMX_OUT OMX_HANDLETYPE *hPipe, - OMX_IN OMX_STRING szURI); - -/** The OMX_GetComponentsOfRole method will return the number of components that support the given - role and (if the compNames field is non-NULL) the names of those components. The call will fail if - an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the - client should: - * first call this function with the compNames field NULL to determine the number of component names - * second call this function with the compNames field pointing to an array of names allocated - according to the number returned by the first call. - - The core should return from this call within 5 msec. - - @param [in] role - This is generic standard component name consisting only of component class - name and the type within that class (e.g. 'audio_decoder.aac'). - @param [inout] pNumComps - This is used both as input and output. - - If compNames is NULL, the input is ignored and the output specifies how many components support - the given role. - - If compNames is not NULL, on input it bounds the size of the input structure and - on output, it specifies the number of components string names listed within the compNames parameter. - @param [inout] compNames - If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings which accepts - a list of the names of all physical components that implement the specified standard component name. - Each name is NULL terminated. numComps indicates the number of names. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_GetComponentsOfRole ( - OMX_IN OMX_STRING role, - OMX_INOUT OMX_U32 *pNumComps, - OMX_INOUT OMX_U8 **compNames); - -/** The OMX_GetRolesOfComponent method will return the number of roles supported by the given - component and (if the roles field is non-NULL) the names of those roles. The call will fail if - an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the - client should: - * first call this function with the roles field NULL to determine the number of role names - * second call this function with the roles field pointing to an array of names allocated - according to the number returned by the first call. - - The core should return from this call within 5 msec. - - @param [in] compName - This is the name of the component being queried about. - @param [inout] pNumRoles - This is used both as input and output. - - If roles is NULL, the input is ignored and the output specifies how many roles the component supports. - - If compNames is not NULL, on input it bounds the size of the input structure and - on output, it specifies the number of roles string names listed within the roles parameter. - @param [out] roles - If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings - which accepts a list of the names of all standard components roles implemented on the - specified component name. numComps indicates the number of names. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_GetRolesOfComponent ( - OMX_IN OMX_STRING compName, - OMX_INOUT OMX_U32 *pNumRoles, - OMX_OUT OMX_U8 **roles); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ - diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/openmax/OMX_IVCommon.h b/external/android/include/14/frameworks/base/include/media/stagefright/openmax/OMX_IVCommon.h deleted file mode 100644 index 8bb4ded..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/openmax/OMX_IVCommon.h +++ /dev/null @@ -1,947 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/** - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** - * @file OMX_IVCommon.h - OpenMax IL version 1.1.2 - * The structures needed by Video and Image components to exchange - * parameters and configuration data with the components. - */ -#ifndef OMX_IVCommon_h -#define OMX_IVCommon_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/** - * Each OMX header must include all required header files to allow the header - * to compile without errors. The includes below are required for this header - * file to compile successfully - */ - -#include - -/** @defgroup iv OpenMAX IL Imaging and Video Domain - * Common structures for OpenMAX IL Imaging and Video domains - * @{ - */ - - -/** - * Enumeration defining possible uncompressed image/video formats. - * - * ENUMS: - * Unused : Placeholder value when format is N/A - * Monochrome : black and white - * 8bitRGB332 : Red 7:5, Green 4:2, Blue 1:0 - * 12bitRGB444 : Red 11:8, Green 7:4, Blue 3:0 - * 16bitARGB4444 : Alpha 15:12, Red 11:8, Green 7:4, Blue 3:0 - * 16bitARGB1555 : Alpha 15, Red 14:10, Green 9:5, Blue 4:0 - * 16bitRGB565 : Red 15:11, Green 10:5, Blue 4:0 - * 16bitBGR565 : Blue 15:11, Green 10:5, Red 4:0 - * 18bitRGB666 : Red 17:12, Green 11:6, Blue 5:0 - * 18bitARGB1665 : Alpha 17, Red 16:11, Green 10:5, Blue 4:0 - * 19bitARGB1666 : Alpha 18, Red 17:12, Green 11:6, Blue 5:0 - * 24bitRGB888 : Red 24:16, Green 15:8, Blue 7:0 - * 24bitBGR888 : Blue 24:16, Green 15:8, Red 7:0 - * 24bitARGB1887 : Alpha 23, Red 22:15, Green 14:7, Blue 6:0 - * 25bitARGB1888 : Alpha 24, Red 23:16, Green 15:8, Blue 7:0 - * 32bitBGRA8888 : Blue 31:24, Green 23:16, Red 15:8, Alpha 7:0 - * 32bitARGB8888 : Alpha 31:24, Red 23:16, Green 15:8, Blue 7:0 - * YUV411Planar : U,Y are subsampled by a factor of 4 horizontally - * YUV411PackedPlanar : packed per payload in planar slices - * YUV420Planar : Three arrays Y,U,V. - * YUV420PackedPlanar : packed per payload in planar slices - * YUV420SemiPlanar : Two arrays, one is all Y, the other is U and V - * YUV422Planar : Three arrays Y,U,V. - * YUV422PackedPlanar : packed per payload in planar slices - * YUV422SemiPlanar : Two arrays, one is all Y, the other is U and V - * YCbYCr : Organized as 16bit YUYV (i.e. YCbYCr) - * YCrYCb : Organized as 16bit YVYU (i.e. YCrYCb) - * CbYCrY : Organized as 16bit UYVY (i.e. CbYCrY) - * CrYCbY : Organized as 16bit VYUY (i.e. CrYCbY) - * YUV444Interleaved : Each pixel contains equal parts YUV - * RawBayer8bit : SMIA camera output format - * RawBayer10bit : SMIA camera output format - * RawBayer8bitcompressed : SMIA camera output format - */ -typedef enum OMX_COLOR_FORMATTYPE { - OMX_COLOR_FormatUnused, - OMX_COLOR_FormatMonochrome, - OMX_COLOR_Format8bitRGB332, - OMX_COLOR_Format12bitRGB444, - OMX_COLOR_Format16bitARGB4444, - OMX_COLOR_Format16bitARGB1555, - OMX_COLOR_Format16bitRGB565, - OMX_COLOR_Format16bitBGR565, - OMX_COLOR_Format18bitRGB666, - OMX_COLOR_Format18bitARGB1665, - OMX_COLOR_Format19bitARGB1666, - OMX_COLOR_Format24bitRGB888, - OMX_COLOR_Format24bitBGR888, - OMX_COLOR_Format24bitARGB1887, - OMX_COLOR_Format25bitARGB1888, - OMX_COLOR_Format32bitBGRA8888, - OMX_COLOR_Format32bitARGB8888, - OMX_COLOR_FormatYUV411Planar, - OMX_COLOR_FormatYUV411PackedPlanar, - OMX_COLOR_FormatYUV420Planar, - OMX_COLOR_FormatYUV420PackedPlanar, - OMX_COLOR_FormatYUV420SemiPlanar, - OMX_COLOR_FormatYUV422Planar, - OMX_COLOR_FormatYUV422PackedPlanar, - OMX_COLOR_FormatYUV422SemiPlanar, - OMX_COLOR_FormatYCbYCr, - OMX_COLOR_FormatYCrYCb, - OMX_COLOR_FormatCbYCrY, - OMX_COLOR_FormatCrYCbY, - OMX_COLOR_FormatYUV444Interleaved, - OMX_COLOR_FormatRawBayer8bit, - OMX_COLOR_FormatRawBayer10bit, - OMX_COLOR_FormatRawBayer8bitcompressed, - OMX_COLOR_FormatL2, - OMX_COLOR_FormatL4, - OMX_COLOR_FormatL8, - OMX_COLOR_FormatL16, - OMX_COLOR_FormatL24, - OMX_COLOR_FormatL32, - OMX_COLOR_FormatYUV420PackedSemiPlanar, - OMX_COLOR_FormatYUV422PackedSemiPlanar, - OMX_COLOR_Format18BitBGR666, - OMX_COLOR_Format24BitARGB6666, - OMX_COLOR_Format24BitABGR6666, - OMX_COLOR_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_COLOR_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - /** - -/** @defgroup imaging OpenMAX IL Imaging Domain - * @ingroup iv - * Structures for OpenMAX IL Imaging domain - * @{ - */ - -/** - * Enumeration used to define the possible image compression coding. - */ -typedef enum OMX_IMAGE_CODINGTYPE { - OMX_IMAGE_CodingUnused, /**< Value when format is N/A */ - OMX_IMAGE_CodingAutoDetect, /**< Auto detection of image format */ - OMX_IMAGE_CodingJPEG, /**< JPEG/JFIF image format */ - OMX_IMAGE_CodingJPEG2K, /**< JPEG 2000 image format */ - OMX_IMAGE_CodingEXIF, /**< EXIF image format */ - OMX_IMAGE_CodingTIFF, /**< TIFF image format */ - OMX_IMAGE_CodingGIF, /**< Graphics image format */ - OMX_IMAGE_CodingPNG, /**< PNG image format */ - OMX_IMAGE_CodingLZW, /**< LZW image format */ - OMX_IMAGE_CodingBMP, /**< Windows Bitmap format */ - OMX_IMAGE_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_IMAGE_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_IMAGE_CodingMax = 0x7FFFFFFF -} OMX_IMAGE_CODINGTYPE; - - -/** - * Data structure used to define an image path. The number of image paths - * for input and output will vary by type of the image component. - * - * Input (aka Source) : Zero Inputs, one Output, - * Splitter : One Input, 2 or more Outputs, - * Processing Element : One Input, one output, - * Mixer : 2 or more inputs, one output, - * Output (aka Sink) : One Input, zero outputs. - * - * The PortDefinition structure is used to define all of the parameters - * necessary for the compliant component to setup an input or an output - * image path. If additional vendor specific data is required, it should - * be transmitted to the component using the CustomCommand function. - * Compliant components will prepopulate this structure with optimal - * values during the OMX_GetParameter() command. - * - * STRUCT MEMBERS: - * cMIMEType : MIME type of data for the port - * pNativeRender : Platform specific reference for a display if a - * sync, otherwise this field is 0 - * nFrameWidth : Width of frame to be used on port if - * uncompressed format is used. Use 0 for - * unknown, don't care or variable - * nFrameHeight : Height of frame to be used on port if - * uncompressed format is used. Use 0 for - * unknown, don't care or variable - * nStride : Number of bytes per span of an image (i.e. - * indicates the number of bytes to get from - * span N to span N+1, where negative stride - * indicates the image is bottom up - * nSliceHeight : Height used when encoding in slices - * bFlagErrorConcealment : Turns on error concealment if it is supported by - * the OMX component - * eCompressionFormat : Compression format used in this instance of - * the component. When OMX_IMAGE_CodingUnused is - * specified, eColorFormat is valid - * eColorFormat : Decompressed format used by this component - * pNativeWindow : Platform specific reference for a window object if a - * display sink , otherwise this field is 0x0. - */ -typedef struct OMX_IMAGE_PORTDEFINITIONTYPE { - OMX_STRING cMIMEType; - OMX_NATIVE_DEVICETYPE pNativeRender; - OMX_U32 nFrameWidth; - OMX_U32 nFrameHeight; - OMX_S32 nStride; - OMX_U32 nSliceHeight; - OMX_BOOL bFlagErrorConcealment; - OMX_IMAGE_CODINGTYPE eCompressionFormat; - OMX_COLOR_FORMATTYPE eColorFormat; - OMX_NATIVE_WINDOWTYPE pNativeWindow; -} OMX_IMAGE_PORTDEFINITIONTYPE; - - -/** - * Port format parameter. This structure is used to enumerate the various - * data input/output format supported by the port. - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Indicates which port to set - * nIndex : Indicates the enumeration index for the format from - * 0x0 to N-1 - * eCompressionFormat : Compression format used in this instance of the - * component. When OMX_IMAGE_CodingUnused is specified, - * eColorFormat is valid - * eColorFormat : Decompressed format used by this component - */ -typedef struct OMX_IMAGE_PARAM_PORTFORMATTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nIndex; - OMX_IMAGE_CODINGTYPE eCompressionFormat; - OMX_COLOR_FORMATTYPE eColorFormat; -} OMX_IMAGE_PARAM_PORTFORMATTYPE; - - -/** - * Flash control type - * - * ENUMS - * Torch : Flash forced constantly on - */ -typedef enum OMX_IMAGE_FLASHCONTROLTYPE { - OMX_IMAGE_FlashControlOn = 0, - OMX_IMAGE_FlashControlOff, - OMX_IMAGE_FlashControlAuto, - OMX_IMAGE_FlashControlRedEyeReduction, - OMX_IMAGE_FlashControlFillin, - OMX_IMAGE_FlashControlTorch, - OMX_IMAGE_FlashControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_IMAGE_FlashControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_IMAGE_FlashControlMax = 0x7FFFFFFF -} OMX_IMAGE_FLASHCONTROLTYPE; - - -/** - * Flash control configuration - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eFlashControl : Flash control type - */ -typedef struct OMX_IMAGE_PARAM_FLASHCONTROLTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_IMAGE_FLASHCONTROLTYPE eFlashControl; -} OMX_IMAGE_PARAM_FLASHCONTROLTYPE; - - -/** - * Focus control type - */ -typedef enum OMX_IMAGE_FOCUSCONTROLTYPE { - OMX_IMAGE_FocusControlOn = 0, - OMX_IMAGE_FocusControlOff, - OMX_IMAGE_FocusControlAuto, - OMX_IMAGE_FocusControlAutoLock, - OMX_IMAGE_FocusControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_IMAGE_FocusControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_IMAGE_FocusControlMax = 0x7FFFFFFF -} OMX_IMAGE_FOCUSCONTROLTYPE; - - -/** - * Focus control configuration - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eFocusControl : Focus control - * nFocusSteps : Focus can take on values from 0 mm to infinity. - * Interest is only in number of steps over this range. - * nFocusStepIndex : Current focus step index - */ -typedef struct OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_IMAGE_FOCUSCONTROLTYPE eFocusControl; - OMX_U32 nFocusSteps; - OMX_U32 nFocusStepIndex; -} OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE; - - -/** - * Q Factor for JPEG compression, which controls the tradeoff between image - * quality and size. Q Factor provides a more simple means of controlling - * JPEG compression quality, without directly programming Quantization - * tables for chroma and luma - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nQFactor : JPEG Q factor value in the range of 1-100. A factor of 1 - * produces the smallest, worst quality images, and a factor - * of 100 produces the largest, best quality images. A - * typical default is 75 for small good quality images - */ -typedef struct OMX_IMAGE_PARAM_QFACTORTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nQFactor; -} OMX_IMAGE_PARAM_QFACTORTYPE; - -/** - * Quantization table type - */ - -typedef enum OMX_IMAGE_QUANTIZATIONTABLETYPE { - OMX_IMAGE_QuantizationTableLuma = 0, - OMX_IMAGE_QuantizationTableChroma, - OMX_IMAGE_QuantizationTableChromaCb, - OMX_IMAGE_QuantizationTableChromaCr, - OMX_IMAGE_QuantizationTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_IMAGE_QuantizationTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_IMAGE_QuantizationTableMax = 0x7FFFFFFF -} OMX_IMAGE_QUANTIZATIONTABLETYPE; - -/** - * JPEG quantization tables are used to determine DCT compression for - * YUV data, as an alternative to specifying Q factor, providing exact - * control of compression - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eQuantizationTable : Quantization table type - * nQuantizationMatrix[64] : JPEG quantization table of coefficients stored - * in increasing columns then by rows of data (i.e. - * row 1, ... row 8). Quantization values are in - * the range 0-255 and stored in linear order - * (i.e. the component will zig-zag the - * quantization table data if required internally) - */ -typedef struct OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_IMAGE_QUANTIZATIONTABLETYPE eQuantizationTable; - OMX_U8 nQuantizationMatrix[64]; -} OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE; - - -/** - * Huffman table type, the same Huffman table is applied for chroma and - * luma component - */ -typedef enum OMX_IMAGE_HUFFMANTABLETYPE { - OMX_IMAGE_HuffmanTableAC = 0, - OMX_IMAGE_HuffmanTableDC, - OMX_IMAGE_HuffmanTableACLuma, - OMX_IMAGE_HuffmanTableACChroma, - OMX_IMAGE_HuffmanTableDCLuma, - OMX_IMAGE_HuffmanTableDCChroma, - OMX_IMAGE_HuffmanTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_IMAGE_HuffmanTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_IMAGE_HuffmanTableMax = 0x7FFFFFFF -} OMX_IMAGE_HUFFMANTABLETYPE; - -/** - * JPEG Huffman table - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eHuffmanTable : Huffman table type - * nNumberOfHuffmanCodeOfLength[16] : 0-16, number of Huffman codes of each - * possible length - * nHuffmanTable[256] : 0-255, the size used for AC and DC - * HuffmanTable are 16 and 162 - */ -typedef struct OMX_IMAGE_PARAM_HUFFMANTTABLETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_IMAGE_HUFFMANTABLETYPE eHuffmanTable; - OMX_U8 nNumberOfHuffmanCodeOfLength[16]; - OMX_U8 nHuffmanTable[256]; -}OMX_IMAGE_PARAM_HUFFMANTTABLETYPE; - -/** @} */ -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/openmax/OMX_Index.h b/external/android/include/14/frameworks/base/include/media/stagefright/openmax/OMX_Index.h deleted file mode 100644 index c0b8d92..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/openmax/OMX_Index.h +++ /dev/null @@ -1,275 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** @file OMX_Index.h - OpenMax IL version 1.1.2 - * The OMX_Index header file contains the definitions for both applications - * and components . - */ - - -#ifndef OMX_Index_h -#define OMX_Index_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/* Each OMX header must include all required header files to allow the - * header to compile without errors. The includes below are required - * for this header file to compile successfully - */ -#include - - -/** The OMX_INDEXTYPE enumeration is used to select a structure when either - * getting or setting parameters and/or configuration data. Each entry in - * this enumeration maps to an OMX specified structure. When the - * OMX_GetParameter, OMX_SetParameter, OMX_GetConfig or OMX_SetConfig methods - * are used, the second parameter will always be an entry from this enumeration - * and the third entry will be the structure shown in the comments for the entry. - * For example, if the application is initializing a cropping function, the - * OMX_SetConfig command would have OMX_IndexConfigCommonInputCrop as the second parameter - * and would send a pointer to an initialized OMX_RECTTYPE structure as the - * third parameter. - * - * The enumeration entries named with the OMX_Config prefix are sent using - * the OMX_SetConfig command and the enumeration entries named with the - * OMX_PARAM_ prefix are sent using the OMX_SetParameter command. - */ -typedef enum OMX_INDEXTYPE { - - OMX_IndexComponentStartUnused = 0x01000000, - OMX_IndexParamPriorityMgmt, /**< reference: OMX_PRIORITYMGMTTYPE */ - OMX_IndexParamAudioInit, /**< reference: OMX_PORT_PARAM_TYPE */ - OMX_IndexParamImageInit, /**< reference: OMX_PORT_PARAM_TYPE */ - OMX_IndexParamVideoInit, /**< reference: OMX_PORT_PARAM_TYPE */ - OMX_IndexParamOtherInit, /**< reference: OMX_PORT_PARAM_TYPE */ - OMX_IndexParamNumAvailableStreams, /**< reference: OMX_PARAM_U32TYPE */ - OMX_IndexParamActiveStream, /**< reference: OMX_PARAM_U32TYPE */ - OMX_IndexParamSuspensionPolicy, /**< reference: OMX_PARAM_SUSPENSIONPOLICYTYPE */ - OMX_IndexParamComponentSuspended, /**< reference: OMX_PARAM_SUSPENSIONTYPE */ - OMX_IndexConfigCapturing, /**< reference: OMX_CONFIG_BOOLEANTYPE */ - OMX_IndexConfigCaptureMode, /**< reference: OMX_CONFIG_CAPTUREMODETYPE */ - OMX_IndexAutoPauseAfterCapture, /**< reference: OMX_CONFIG_BOOLEANTYPE */ - OMX_IndexParamContentURI, /**< reference: OMX_PARAM_CONTENTURITYPE */ - OMX_IndexParamCustomContentPipe, /**< reference: OMX_PARAM_CONTENTPIPETYPE */ - OMX_IndexParamDisableResourceConcealment, /**< reference: OMX_RESOURCECONCEALMENTTYPE */ - OMX_IndexConfigMetadataItemCount, /**< reference: OMX_CONFIG_METADATAITEMCOUNTTYPE */ - OMX_IndexConfigContainerNodeCount, /**< reference: OMX_CONFIG_CONTAINERNODECOUNTTYPE */ - OMX_IndexConfigMetadataItem, /**< reference: OMX_CONFIG_METADATAITEMTYPE */ - OMX_IndexConfigCounterNodeID, /**< reference: OMX_CONFIG_CONTAINERNODEIDTYPE */ - OMX_IndexParamMetadataFilterType, /**< reference: OMX_PARAM_METADATAFILTERTYPE */ - OMX_IndexParamMetadataKeyFilter, /**< reference: OMX_PARAM_METADATAFILTERTYPE */ - OMX_IndexConfigPriorityMgmt, /**< reference: OMX_PRIORITYMGMTTYPE */ - OMX_IndexParamStandardComponentRole, /**< reference: OMX_PARAM_COMPONENTROLETYPE */ - - OMX_IndexPortStartUnused = 0x02000000, - OMX_IndexParamPortDefinition, /**< reference: OMX_PARAM_PORTDEFINITIONTYPE */ - OMX_IndexParamCompBufferSupplier, /**< reference: OMX_PARAM_BUFFERSUPPLIERTYPE */ - OMX_IndexReservedStartUnused = 0x03000000, - - /* Audio parameters and configurations */ - OMX_IndexAudioStartUnused = 0x04000000, - OMX_IndexParamAudioPortFormat, /**< reference: OMX_AUDIO_PARAM_PORTFORMATTYPE */ - OMX_IndexParamAudioPcm, /**< reference: OMX_AUDIO_PARAM_PCMMODETYPE */ - OMX_IndexParamAudioAac, /**< reference: OMX_AUDIO_PARAM_AACPROFILETYPE */ - OMX_IndexParamAudioRa, /**< reference: OMX_AUDIO_PARAM_RATYPE */ - OMX_IndexParamAudioMp3, /**< reference: OMX_AUDIO_PARAM_MP3TYPE */ - OMX_IndexParamAudioAdpcm, /**< reference: OMX_AUDIO_PARAM_ADPCMTYPE */ - OMX_IndexParamAudioG723, /**< reference: OMX_AUDIO_PARAM_G723TYPE */ - OMX_IndexParamAudioG729, /**< reference: OMX_AUDIO_PARAM_G729TYPE */ - OMX_IndexParamAudioAmr, /**< reference: OMX_AUDIO_PARAM_AMRTYPE */ - OMX_IndexParamAudioWma, /**< reference: OMX_AUDIO_PARAM_WMATYPE */ - OMX_IndexParamAudioSbc, /**< reference: OMX_AUDIO_PARAM_SBCTYPE */ - OMX_IndexParamAudioMidi, /**< reference: OMX_AUDIO_PARAM_MIDITYPE */ - OMX_IndexParamAudioGsm_FR, /**< reference: OMX_AUDIO_PARAM_GSMFRTYPE */ - OMX_IndexParamAudioMidiLoadUserSound, /**< reference: OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE */ - OMX_IndexParamAudioG726, /**< reference: OMX_AUDIO_PARAM_G726TYPE */ - OMX_IndexParamAudioGsm_EFR, /**< reference: OMX_AUDIO_PARAM_GSMEFRTYPE */ - OMX_IndexParamAudioGsm_HR, /**< reference: OMX_AUDIO_PARAM_GSMHRTYPE */ - OMX_IndexParamAudioPdc_FR, /**< reference: OMX_AUDIO_PARAM_PDCFRTYPE */ - OMX_IndexParamAudioPdc_EFR, /**< reference: OMX_AUDIO_PARAM_PDCEFRTYPE */ - OMX_IndexParamAudioPdc_HR, /**< reference: OMX_AUDIO_PARAM_PDCHRTYPE */ - OMX_IndexParamAudioTdma_FR, /**< reference: OMX_AUDIO_PARAM_TDMAFRTYPE */ - OMX_IndexParamAudioTdma_EFR, /**< reference: OMX_AUDIO_PARAM_TDMAEFRTYPE */ - OMX_IndexParamAudioQcelp8, /**< reference: OMX_AUDIO_PARAM_QCELP8TYPE */ - OMX_IndexParamAudioQcelp13, /**< reference: OMX_AUDIO_PARAM_QCELP13TYPE */ - OMX_IndexParamAudioEvrc, /**< reference: OMX_AUDIO_PARAM_EVRCTYPE */ - OMX_IndexParamAudioSmv, /**< reference: OMX_AUDIO_PARAM_SMVTYPE */ - OMX_IndexParamAudioVorbis, /**< reference: OMX_AUDIO_PARAM_VORBISTYPE */ - - OMX_IndexConfigAudioMidiImmediateEvent, /**< reference: OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE */ - OMX_IndexConfigAudioMidiControl, /**< reference: OMX_AUDIO_CONFIG_MIDICONTROLTYPE */ - OMX_IndexConfigAudioMidiSoundBankProgram, /**< reference: OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE */ - OMX_IndexConfigAudioMidiStatus, /**< reference: OMX_AUDIO_CONFIG_MIDISTATUSTYPE */ - OMX_IndexConfigAudioMidiMetaEvent, /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE */ - OMX_IndexConfigAudioMidiMetaEventData, /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE */ - OMX_IndexConfigAudioVolume, /**< reference: OMX_AUDIO_CONFIG_VOLUMETYPE */ - OMX_IndexConfigAudioBalance, /**< reference: OMX_AUDIO_CONFIG_BALANCETYPE */ - OMX_IndexConfigAudioChannelMute, /**< reference: OMX_AUDIO_CONFIG_CHANNELMUTETYPE */ - OMX_IndexConfigAudioMute, /**< reference: OMX_AUDIO_CONFIG_MUTETYPE */ - OMX_IndexConfigAudioLoudness, /**< reference: OMX_AUDIO_CONFIG_LOUDNESSTYPE */ - OMX_IndexConfigAudioEchoCancelation, /**< reference: OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE */ - OMX_IndexConfigAudioNoiseReduction, /**< reference: OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE */ - OMX_IndexConfigAudioBass, /**< reference: OMX_AUDIO_CONFIG_BASSTYPE */ - OMX_IndexConfigAudioTreble, /**< reference: OMX_AUDIO_CONFIG_TREBLETYPE */ - OMX_IndexConfigAudioStereoWidening, /**< reference: OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE */ - OMX_IndexConfigAudioChorus, /**< reference: OMX_AUDIO_CONFIG_CHORUSTYPE */ - OMX_IndexConfigAudioEqualizer, /**< reference: OMX_AUDIO_CONFIG_EQUALIZERTYPE */ - OMX_IndexConfigAudioReverberation, /**< reference: OMX_AUDIO_CONFIG_REVERBERATIONTYPE */ - OMX_IndexConfigAudioChannelVolume, /**< reference: OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE */ - - /* Image specific parameters and configurations */ - OMX_IndexImageStartUnused = 0x05000000, - OMX_IndexParamImagePortFormat, /**< reference: OMX_IMAGE_PARAM_PORTFORMATTYPE */ - OMX_IndexParamFlashControl, /**< reference: OMX_IMAGE_PARAM_FLASHCONTROLTYPE */ - OMX_IndexConfigFocusControl, /**< reference: OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE */ - OMX_IndexParamQFactor, /**< reference: OMX_IMAGE_PARAM_QFACTORTYPE */ - OMX_IndexParamQuantizationTable, /**< reference: OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE */ - OMX_IndexParamHuffmanTable, /**< reference: OMX_IMAGE_PARAM_HUFFMANTTABLETYPE */ - OMX_IndexConfigFlashControl, /**< reference: OMX_IMAGE_PARAM_FLASHCONTROLTYPE */ - - /* Video specific parameters and configurations */ - OMX_IndexVideoStartUnused = 0x06000000, - OMX_IndexParamVideoPortFormat, /**< reference: OMX_VIDEO_PARAM_PORTFORMATTYPE */ - OMX_IndexParamVideoQuantization, /**< reference: OMX_VIDEO_PARAM_QUANTIZATIONTYPE */ - OMX_IndexParamVideoFastUpdate, /**< reference: OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE */ - OMX_IndexParamVideoBitrate, /**< reference: OMX_VIDEO_PARAM_BITRATETYPE */ - OMX_IndexParamVideoMotionVector, /**< reference: OMX_VIDEO_PARAM_MOTIONVECTORTYPE */ - OMX_IndexParamVideoIntraRefresh, /**< reference: OMX_VIDEO_PARAM_INTRAREFRESHTYPE */ - OMX_IndexParamVideoErrorCorrection, /**< reference: OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE */ - OMX_IndexParamVideoVBSMC, /**< reference: OMX_VIDEO_PARAM_VBSMCTYPE */ - OMX_IndexParamVideoMpeg2, /**< reference: OMX_VIDEO_PARAM_MPEG2TYPE */ - OMX_IndexParamVideoMpeg4, /**< reference: OMX_VIDEO_PARAM_MPEG4TYPE */ - OMX_IndexParamVideoWmv, /**< reference: OMX_VIDEO_PARAM_WMVTYPE */ - OMX_IndexParamVideoRv, /**< reference: OMX_VIDEO_PARAM_RVTYPE */ - OMX_IndexParamVideoAvc, /**< reference: OMX_VIDEO_PARAM_AVCTYPE */ - OMX_IndexParamVideoH263, /**< reference: OMX_VIDEO_PARAM_H263TYPE */ - OMX_IndexParamVideoProfileLevelQuerySupported, /**< reference: OMX_VIDEO_PARAM_PROFILELEVELTYPE */ - OMX_IndexParamVideoProfileLevelCurrent, /**< reference: OMX_VIDEO_PARAM_PROFILELEVELTYPE */ - OMX_IndexConfigVideoBitrate, /**< reference: OMX_VIDEO_CONFIG_BITRATETYPE */ - OMX_IndexConfigVideoFramerate, /**< reference: OMX_CONFIG_FRAMERATETYPE */ - OMX_IndexConfigVideoIntraVOPRefresh, /**< reference: OMX_CONFIG_INTRAREFRESHVOPTYPE */ - OMX_IndexConfigVideoIntraMBRefresh, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */ - OMX_IndexConfigVideoMBErrorReporting, /**< reference: OMX_CONFIG_MBERRORREPORTINGTYPE */ - OMX_IndexParamVideoMacroblocksPerFrame, /**< reference: OMX_PARAM_MACROBLOCKSTYPE */ - OMX_IndexConfigVideoMacroBlockErrorMap, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */ - OMX_IndexParamVideoSliceFMO, /**< reference: OMX_VIDEO_PARAM_AVCSLICEFMO */ - OMX_IndexConfigVideoAVCIntraPeriod, /**< reference: OMX_VIDEO_CONFIG_AVCINTRAPERIOD */ - OMX_IndexConfigVideoNalSize, /**< reference: OMX_VIDEO_CONFIG_NALSIZE */ - - /* Image & Video common Configurations */ - OMX_IndexCommonStartUnused = 0x07000000, - OMX_IndexParamCommonDeblocking, /**< reference: OMX_PARAM_DEBLOCKINGTYPE */ - OMX_IndexParamCommonSensorMode, /**< reference: OMX_PARAM_SENSORMODETYPE */ - OMX_IndexParamCommonInterleave, /**< reference: OMX_PARAM_INTERLEAVETYPE */ - OMX_IndexConfigCommonColorFormatConversion, /**< reference: OMX_CONFIG_COLORCONVERSIONTYPE */ - OMX_IndexConfigCommonScale, /**< reference: OMX_CONFIG_SCALEFACTORTYPE */ - OMX_IndexConfigCommonImageFilter, /**< reference: OMX_CONFIG_IMAGEFILTERTYPE */ - OMX_IndexConfigCommonColorEnhancement, /**< reference: OMX_CONFIG_COLORENHANCEMENTTYPE */ - OMX_IndexConfigCommonColorKey, /**< reference: OMX_CONFIG_COLORKEYTYPE */ - OMX_IndexConfigCommonColorBlend, /**< reference: OMX_CONFIG_COLORBLENDTYPE */ - OMX_IndexConfigCommonFrameStabilisation,/**< reference: OMX_CONFIG_FRAMESTABTYPE */ - OMX_IndexConfigCommonRotate, /**< reference: OMX_CONFIG_ROTATIONTYPE */ - OMX_IndexConfigCommonMirror, /**< reference: OMX_CONFIG_MIRRORTYPE */ - OMX_IndexConfigCommonOutputPosition, /**< reference: OMX_CONFIG_POINTTYPE */ - OMX_IndexConfigCommonInputCrop, /**< reference: OMX_CONFIG_RECTTYPE */ - OMX_IndexConfigCommonOutputCrop, /**< reference: OMX_CONFIG_RECTTYPE */ - OMX_IndexConfigCommonDigitalZoom, /**< reference: OMX_CONFIG_SCALEFACTORTYPE */ - OMX_IndexConfigCommonOpticalZoom, /**< reference: OMX_CONFIG_SCALEFACTORTYPE*/ - OMX_IndexConfigCommonWhiteBalance, /**< reference: OMX_CONFIG_WHITEBALCONTROLTYPE */ - OMX_IndexConfigCommonExposure, /**< reference: OMX_CONFIG_EXPOSURECONTROLTYPE */ - OMX_IndexConfigCommonContrast, /**< reference: OMX_CONFIG_CONTRASTTYPE */ - OMX_IndexConfigCommonBrightness, /**< reference: OMX_CONFIG_BRIGHTNESSTYPE */ - OMX_IndexConfigCommonBacklight, /**< reference: OMX_CONFIG_BACKLIGHTTYPE */ - OMX_IndexConfigCommonGamma, /**< reference: OMX_CONFIG_GAMMATYPE */ - OMX_IndexConfigCommonSaturation, /**< reference: OMX_CONFIG_SATURATIONTYPE */ - OMX_IndexConfigCommonLightness, /**< reference: OMX_CONFIG_LIGHTNESSTYPE */ - OMX_IndexConfigCommonExclusionRect, /**< reference: OMX_CONFIG_RECTTYPE */ - OMX_IndexConfigCommonDithering, /**< reference: OMX_CONFIG_DITHERTYPE */ - OMX_IndexConfigCommonPlaneBlend, /**< reference: OMX_CONFIG_PLANEBLENDTYPE */ - OMX_IndexConfigCommonExposureValue, /**< reference: OMX_CONFIG_EXPOSUREVALUETYPE */ - OMX_IndexConfigCommonOutputSize, /**< reference: OMX_FRAMESIZETYPE */ - OMX_IndexParamCommonExtraQuantData, /**< reference: OMX_OTHER_EXTRADATATYPE */ - OMX_IndexConfigCommonFocusRegion, /**< reference: OMX_CONFIG_FOCUSREGIONTYPE */ - OMX_IndexConfigCommonFocusStatus, /**< reference: OMX_PARAM_FOCUSSTATUSTYPE */ - OMX_IndexConfigCommonTransitionEffect, /**< reference: OMX_CONFIG_TRANSITIONEFFECTTYPE */ - - /* Reserved Configuration range */ - OMX_IndexOtherStartUnused = 0x08000000, - OMX_IndexParamOtherPortFormat, /**< reference: OMX_OTHER_PARAM_PORTFORMATTYPE */ - OMX_IndexConfigOtherPower, /**< reference: OMX_OTHER_CONFIG_POWERTYPE */ - OMX_IndexConfigOtherStats, /**< reference: OMX_OTHER_CONFIG_STATSTYPE */ - - - /* Reserved Time range */ - OMX_IndexTimeStartUnused = 0x09000000, - OMX_IndexConfigTimeScale, /**< reference: OMX_TIME_CONFIG_SCALETYPE */ - OMX_IndexConfigTimeClockState, /**< reference: OMX_TIME_CONFIG_CLOCKSTATETYPE */ - OMX_IndexConfigTimeActiveRefClock, /**< reference: OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE */ - OMX_IndexConfigTimeCurrentMediaTime, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only) */ - OMX_IndexConfigTimeCurrentWallTime, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only) */ - OMX_IndexConfigTimeCurrentAudioReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */ - OMX_IndexConfigTimeCurrentVideoReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */ - OMX_IndexConfigTimeMediaTimeRequest, /**< reference: OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE (write only) */ - OMX_IndexConfigTimeClientStartTime, /** - - -/** - * Enumeration of possible data types which match to multiple domains or no - * domain at all. For types which are vendor specific, a value above - * OMX_OTHER_VENDORTSTART should be used. - */ -typedef enum OMX_OTHER_FORMATTYPE { - OMX_OTHER_FormatTime = 0, /**< Transmission of various timestamps, elapsed time, - time deltas, etc */ - OMX_OTHER_FormatPower, /**< Perhaps used for enabling/disabling power - management, setting clocks? */ - OMX_OTHER_FormatStats, /**< Could be things such as frame rate, frames - dropped, etc */ - OMX_OTHER_FormatBinary, /**< Arbitrary binary data */ - OMX_OTHER_FormatVendorReserved = 1000, /**< Starting value for vendor specific - formats */ - - OMX_OTHER_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_OTHER_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_OTHER_FormatMax = 0x7FFFFFFF -} OMX_OTHER_FORMATTYPE; - -/** - * Enumeration of seek modes. - */ -typedef enum OMX_TIME_SEEKMODETYPE { - OMX_TIME_SeekModeFast = 0, /**< Prefer seeking to an approximation - * of the requested seek position over - * the actual seek position if it - * results in a faster seek. */ - OMX_TIME_SeekModeAccurate, /**< Prefer seeking to the actual seek - * position over an approximation - * of the requested seek position even - * if it results in a slower seek. */ - OMX_TIME_SeekModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_TIME_SeekModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_TIME_SeekModeMax = 0x7FFFFFFF -} OMX_TIME_SEEKMODETYPE; - -/* Structure representing the seekmode of the component */ -typedef struct OMX_TIME_CONFIG_SEEKMODETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_TIME_SEEKMODETYPE eType; /**< The seek mode */ -} OMX_TIME_CONFIG_SEEKMODETYPE; - -/** Structure representing a time stamp used with the following configs - * on the Clock Component (CC): - * - * OMX_IndexConfigTimeCurrentWallTime: query of the CC’s current wall - * time - * OMX_IndexConfigTimeCurrentMediaTime: query of the CC’s current media - * time - * OMX_IndexConfigTimeCurrentAudioReference and - * OMX_IndexConfigTimeCurrentVideoReference: audio/video reference - * clock sending SC its reference time - * OMX_IndexConfigTimeClientStartTime: a Clock Component client sends - * this structure to the Clock Component via a SetConfig on its - * client port when it receives a buffer with - * OMX_BUFFERFLAG_STARTTIME set. It must use the timestamp - * specified by that buffer for nStartTimestamp. - * - * It’s also used with the following config on components in general: - * - * OMX_IndexConfigTimePosition: IL client querying component position - * (GetConfig) or commanding a component to seek to the given location - * (SetConfig) - */ -typedef struct OMX_TIME_CONFIG_TIMESTAMPTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version - * information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_TICKS nTimestamp; /**< timestamp .*/ -} OMX_TIME_CONFIG_TIMESTAMPTYPE; - -/** Enumeration of possible reference clocks to the media time. */ -typedef enum OMX_TIME_UPDATETYPE { - OMX_TIME_UpdateRequestFulfillment, /**< Update is the fulfillment of a media time request. */ - OMX_TIME_UpdateScaleChanged, /**< Update was generated because the scale chagned. */ - OMX_TIME_UpdateClockStateChanged, /**< Update was generated because the clock state changed. */ - OMX_TIME_UpdateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_TIME_UpdateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_TIME_UpdateMax = 0x7FFFFFFF -} OMX_TIME_UPDATETYPE; - -/** Enumeration of possible reference clocks to the media time. */ -typedef enum OMX_TIME_REFCLOCKTYPE { - OMX_TIME_RefClockNone, /**< Use no references. */ - OMX_TIME_RefClockAudio, /**< Use references sent through OMX_IndexConfigTimeCurrentAudioReference */ - OMX_TIME_RefClockVideo, /**< Use references sent through OMX_IndexConfigTimeCurrentVideoReference */ - OMX_TIME_RefClockKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_TIME_RefClockVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_TIME_RefClockMax = 0x7FFFFFFF -} OMX_TIME_REFCLOCKTYPE; - -/** Enumeration of clock states. */ -typedef enum OMX_TIME_CLOCKSTATE { - OMX_TIME_ClockStateRunning, /**< Clock running. */ - OMX_TIME_ClockStateWaitingForStartTime, /**< Clock waiting until the - * prescribed clients emit their - * start time. */ - OMX_TIME_ClockStateStopped, /**< Clock stopped. */ - OMX_TIME_ClockStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_TIME_ClockStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_TIME_ClockStateMax = 0x7FFFFFFF -} OMX_TIME_CLOCKSTATE; - -/** Structure representing a media time request to the clock component. - * - * A client component sends this structure to the Clock Component via a SetConfig - * on its client port to specify a media timestamp the Clock Component - * should emit. The Clock Component should fulfill the request by sending a - * OMX_TIME_MEDIATIMETYPE when its media clock matches the requested - * timestamp. - * - * The client may require a media time request be fulfilled slightly - * earlier than the media time specified. In this case the client specifies - * an offset which is equal to the difference between wall time corresponding - * to the requested media time and the wall time when it will be - * fulfilled. - * - * A client component may uses these requests and the OMX_TIME_MEDIATIMETYPE to - * time events according to timestamps. If a client must perform an operation O at - * a time T (e.g. deliver a video frame at its corresponding timestamp), it makes a - * media time request at T (perhaps specifying an offset to ensure the request fulfillment - * is a little early). When the clock component passes the resulting OMX_TIME_MEDIATIMETYPE - * structure back to the client component, the client may perform operation O (perhaps having - * to wait a slight amount more time itself as specified by the return values). - */ - -typedef struct OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_PTR pClientPrivate; /**< Client private data to disabiguate this media time - * from others (e.g. the number of the frame to deliver). - * Duplicated in the media time structure that fulfills - * this request. A value of zero is reserved for time scale - * updates. */ - OMX_TICKS nMediaTimestamp; /**< Media timestamp requested.*/ - OMX_TICKS nOffset; /**< Amount of wall clock time by which this - * request should be fulfilled early */ -} OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE; - -/**< Structure sent from the clock component client either when fulfilling - * a media time request or when the time scale has changed. - * - * In the former case the Clock Component fills this structure and times its emission - * to a client component (via the client port) according to the corresponding media - * time request sent by the client. The Clock Component should time the emission to occur - * when the requested timestamp matches the Clock Component's media time but also the - * prescribed offset early. - * - * Upon scale changes the clock component clears the nClientPrivate data, sends the current - * media time and sets the nScale to the new scale via the client port. It emits a - * OMX_TIME_MEDIATIMETYPE to all clients independent of any requests. This allows clients to - * alter processing to accomodate scaling. For instance a video component might skip inter-frames - * in the case of extreme fastforward. Likewise an audio component might add or remove samples - * from an audio frame to scale audio data. - * - * It is expected that some clock components may not be able to fulfill requests - * at exactly the prescribed time. This is acceptable so long as the request is - * fulfilled at least as early as described and not later. This structure provides - * fields the client may use to wait for the remaining time. - * - * The client may use either the nOffset or nWallTimeAtMedia fields to determine the - * wall time until the nMediaTimestamp actually occurs. In the latter case the - * client can get a more accurate value for offset by getting the current wall - * from the cloc component and subtracting it from nWallTimeAtMedia. - */ - -typedef struct OMX_TIME_MEDIATIMETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nClientPrivate; /**< Client private data to disabiguate this media time - * from others. Copied from the media time request. - * A value of zero is reserved for time scale updates. */ - OMX_TIME_UPDATETYPE eUpdateType; /**< Reason for the update */ - OMX_TICKS nMediaTimestamp; /**< Media time requested. If no media time was - * requested then this is the current media time. */ - OMX_TICKS nOffset; /**< Amount of wall clock time by which this - * request was actually fulfilled early */ - - OMX_TICKS nWallTimeAtMediaTime; /**< Wall time corresponding to nMediaTimeStamp. - * A client may compare this value to current - * media time obtained from the Clock Component to determine - * the wall time until the media timestamp is really - * current. */ - OMX_S32 xScale; /**< Current media time scale in Q16 format. */ - OMX_TIME_CLOCKSTATE eState; /* Seeking Change. Added 7/12.*/ - /**< State of the media time. */ -} OMX_TIME_MEDIATIMETYPE; - -/** Structure representing the current media time scale factor. Applicable only to clock - * component, other components see scale changes via OMX_TIME_MEDIATIMETYPE buffers sent via - * the clock component client ports. Upon recieving this config the clock component changes - * the rate by which the media time increases or decreases effectively implementing trick modes. - */ -typedef struct OMX_TIME_CONFIG_SCALETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_S32 xScale; /**< This is a value in Q16 format which is used for - * scaling the media time */ -} OMX_TIME_CONFIG_SCALETYPE; - -/** Bits used to identify a clock port. Used in OMX_TIME_CONFIG_CLOCKSTATETYPE’s nWaitMask field */ -#define OMX_CLOCKPORT0 0x00000001 -#define OMX_CLOCKPORT1 0x00000002 -#define OMX_CLOCKPORT2 0x00000004 -#define OMX_CLOCKPORT3 0x00000008 -#define OMX_CLOCKPORT4 0x00000010 -#define OMX_CLOCKPORT5 0x00000020 -#define OMX_CLOCKPORT6 0x00000040 -#define OMX_CLOCKPORT7 0x00000080 - -/** Structure representing the current mode of the media clock. - * IL Client uses this config to change or query the mode of the - * media clock of the clock component. Applicable only to clock - * component. - * - * On a SetConfig if eState is OMX_TIME_ClockStateRunning media time - * starts immediately at the prescribed start time. If - * OMX_TIME_ClockStateWaitingForStartTime the Clock Component ignores - * the given nStartTime and waits for all clients specified in the - * nWaitMask to send starttimes (via - * OMX_IndexConfigTimeClientStartTime). The Clock Component then starts - * the media clock using the earliest start time supplied. */ -typedef struct OMX_TIME_CONFIG_CLOCKSTATETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version - * information */ - OMX_TIME_CLOCKSTATE eState; /**< State of the media time. */ - OMX_TICKS nStartTime; /**< Start time of the media time. */ - OMX_TICKS nOffset; /**< Time to offset the media time by - * (e.g. preroll). Media time will be - * reported to be nOffset ticks earlier. - */ - OMX_U32 nWaitMask; /**< Mask of OMX_CLOCKPORT values. */ -} OMX_TIME_CONFIG_CLOCKSTATETYPE; - -/** Structure representing the reference clock currently being used to - * compute media time. IL client uses this config to change or query the - * clock component's active reference clock */ -typedef struct OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_TIME_REFCLOCKTYPE eClock; /**< Reference clock used to compute media time */ -} OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE; - -/** Descriptor for setting specifics of power type. - * Note: this structure is listed for backwards compatibility. */ -typedef struct OMX_OTHER_CONFIG_POWERTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_BOOL bEnablePM; /**< Flag to enable Power Management */ -} OMX_OTHER_CONFIG_POWERTYPE; - - -/** Descriptor for setting specifics of stats type. - * Note: this structure is listed for backwards compatibility. */ -typedef struct OMX_OTHER_CONFIG_STATSTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - /* what goes here */ -} OMX_OTHER_CONFIG_STATSTYPE; - - -/** - * The PortDefinition structure is used to define all of the parameters - * necessary for the compliant component to setup an input or an output other - * path. - */ -typedef struct OMX_OTHER_PORTDEFINITIONTYPE { - OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */ -} OMX_OTHER_PORTDEFINITIONTYPE; - -/** Port format parameter. This structure is used to enumerate - * the various data input/output format supported by the port. - */ -typedef struct OMX_OTHER_PARAM_PORTFORMATTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Indicates which port to set */ - OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */ - OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */ -} OMX_OTHER_PARAM_PORTFORMATTYPE; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/openmax/OMX_Types.h b/external/android/include/14/frameworks/base/include/media/stagefright/openmax/OMX_Types.h deleted file mode 100644 index 03fd4bc..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/openmax/OMX_Types.h +++ /dev/null @@ -1,365 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** OMX_Types.h - OpenMax IL version 1.1.2 - * The OMX_Types header file contains the primitive type definitions used by - * the core, the application and the component. This file may need to be - * modified to be used on systems that do not have "char" set to 8 bits, - * "short" set to 16 bits and "long" set to 32 bits. - */ - -#ifndef OMX_Types_h -#define OMX_Types_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/** The OMX_API and OMX_APIENTRY are platform specific definitions used - * to declare OMX function prototypes. They are modified to meet the - * requirements for a particular platform */ -#ifdef __SYMBIAN32__ -# ifdef __OMX_EXPORTS -# define OMX_API __declspec(dllexport) -# else -# ifdef _WIN32 -# define OMX_API __declspec(dllexport) -# else -# define OMX_API __declspec(dllimport) -# endif -# endif -#else -# ifdef _WIN32 -# ifdef __OMX_EXPORTS -# define OMX_API __declspec(dllexport) -# else -//# define OMX_API __declspec(dllimport) -#define OMX_API -# endif -# else -# ifdef __OMX_EXPORTS -# define OMX_API -# else -# define OMX_API extern -# endif -# endif -#endif - -#ifndef OMX_APIENTRY -#define OMX_APIENTRY -#endif - -/** OMX_IN is used to identify inputs to an OMX function. This designation - will also be used in the case of a pointer that points to a parameter - that is used as an output. */ -#ifndef OMX_IN -#define OMX_IN -#endif - -/** OMX_OUT is used to identify outputs from an OMX function. This - designation will also be used in the case of a pointer that points - to a parameter that is used as an input. */ -#ifndef OMX_OUT -#define OMX_OUT -#endif - - -/** OMX_INOUT is used to identify parameters that may be either inputs or - outputs from an OMX function at the same time. This designation will - also be used in the case of a pointer that points to a parameter that - is used both as an input and an output. */ -#ifndef OMX_INOUT -#define OMX_INOUT -#endif - -/** OMX_ALL is used to as a wildcard to select all entities of the same type - * when specifying the index, or referring to a object by an index. (i.e. - * use OMX_ALL to indicate all N channels). When used as a port index - * for a config or parameter this OMX_ALL denotes that the config or - * parameter applies to the entire component not just one port. */ -#define OMX_ALL 0xFFFFFFFF - -/** In the following we define groups that help building doxygen documentation */ - -/** @defgroup core OpenMAX IL core - * Functions and structure related to the OMX IL core - */ - - /** @defgroup comp OpenMAX IL component - * Functions and structure related to the OMX IL component - */ - -/** @defgroup rpm Resource and Policy Management - * Structures for resource and policy management of components - */ - -/** @defgroup buf Buffer Management - * Buffer handling functions and structures - */ - -/** @defgroup tun Tunneling - * @ingroup core comp - * Structures and functions to manage tunnels among component ports - */ - -/** @defgroup cp Content Pipes - * @ingroup core - */ - - /** @defgroup metadata Metadata handling - * - */ - -/** OMX_U8 is an 8 bit unsigned quantity that is byte aligned */ -typedef unsigned char OMX_U8; - -/** OMX_S8 is an 8 bit signed quantity that is byte aligned */ -typedef signed char OMX_S8; - -/** OMX_U16 is a 16 bit unsigned quantity that is 16 bit word aligned */ -typedef unsigned short OMX_U16; - -/** OMX_S16 is a 16 bit signed quantity that is 16 bit word aligned */ -typedef signed short OMX_S16; - -/** OMX_U32 is a 32 bit unsigned quantity that is 32 bit word aligned */ -typedef unsigned long OMX_U32; - -/** OMX_S32 is a 32 bit signed quantity that is 32 bit word aligned */ -typedef signed long OMX_S32; - - -/* Users with compilers that cannot accept the "long long" designation should - define the OMX_SKIP64BIT macro. It should be noted that this may cause - some components to fail to compile if the component was written to require - 64 bit integral types. However, these components would NOT compile anyway - since the compiler does not support the way the component was written. -*/ -#ifndef OMX_SKIP64BIT -#ifdef __SYMBIAN32__ -/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */ -typedef unsigned long long OMX_U64; - -/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */ -typedef signed long long OMX_S64; - -#elif defined(WIN32) - -/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */ -typedef unsigned __int64 OMX_U64; - -/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */ -typedef signed __int64 OMX_S64; - -#else /* WIN32 */ - -/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */ -typedef unsigned long long OMX_U64; - -/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */ -typedef signed long long OMX_S64; - -#endif /* WIN32 */ -#endif - - -/** The OMX_BOOL type is intended to be used to represent a true or a false - value when passing parameters to and from the OMX core and components. The - OMX_BOOL is a 32 bit quantity and is aligned on a 32 bit word boundary. - */ -typedef enum OMX_BOOL { - OMX_FALSE = 0, - OMX_TRUE = !OMX_FALSE, - OMX_BOOL_MAX = 0x7FFFFFFF -} OMX_BOOL; - -/** The OMX_PTR type is intended to be used to pass pointers between the OMX - applications and the OMX Core and components. This is a 32 bit pointer and - is aligned on a 32 bit boundary. - */ -typedef void* OMX_PTR; - -/** The OMX_STRING type is intended to be used to pass "C" type strings between - the application and the core and component. The OMX_STRING type is a 32 - bit pointer to a zero terminated string. The pointer is word aligned and - the string is byte aligned. - */ -typedef char* OMX_STRING; - -/** The OMX_BYTE type is intended to be used to pass arrays of bytes such as - buffers between the application and the component and core. The OMX_BYTE - type is a 32 bit pointer to a zero terminated string. The pointer is word - aligned and the string is byte aligned. - */ -typedef unsigned char* OMX_BYTE; - -/** OMX_UUIDTYPE is a very long unique identifier to uniquely identify - at runtime. This identifier should be generated by a component in a way - that guarantees that every instance of the identifier running on the system - is unique. */ -typedef unsigned char OMX_UUIDTYPE[128]; - -/** The OMX_DIRTYPE enumeration is used to indicate if a port is an input or - an output port. This enumeration is common across all component types. - */ -typedef enum OMX_DIRTYPE -{ - OMX_DirInput, /**< Port is an input port */ - OMX_DirOutput, /**< Port is an output port */ - OMX_DirMax = 0x7FFFFFFF -} OMX_DIRTYPE; - -/** The OMX_ENDIANTYPE enumeration is used to indicate the bit ordering - for numerical data (i.e. big endian, or little endian). - */ -typedef enum OMX_ENDIANTYPE -{ - OMX_EndianBig, /**< big endian */ - OMX_EndianLittle, /**< little endian */ - OMX_EndianMax = 0x7FFFFFFF -} OMX_ENDIANTYPE; - - -/** The OMX_NUMERICALDATATYPE enumeration is used to indicate if data - is signed or unsigned - */ -typedef enum OMX_NUMERICALDATATYPE -{ - OMX_NumericalDataSigned, /**< signed data */ - OMX_NumericalDataUnsigned, /**< unsigned data */ - OMX_NumercialDataMax = 0x7FFFFFFF -} OMX_NUMERICALDATATYPE; - - -/** Unsigned bounded value type */ -typedef struct OMX_BU32 { - OMX_U32 nValue; /**< actual value */ - OMX_U32 nMin; /**< minimum for value (i.e. nValue >= nMin) */ - OMX_U32 nMax; /**< maximum for value (i.e. nValue <= nMax) */ -} OMX_BU32; - - -/** Signed bounded value type */ -typedef struct OMX_BS32 { - OMX_S32 nValue; /**< actual value */ - OMX_S32 nMin; /**< minimum for value (i.e. nValue >= nMin) */ - OMX_S32 nMax; /**< maximum for value (i.e. nValue <= nMax) */ -} OMX_BS32; - - -/** Structure representing some time or duration in microseconds. This structure - * must be interpreted as a signed 64 bit value. The quantity is signed to accommodate - * negative deltas and preroll scenarios. The quantity is represented in microseconds - * to accomodate high resolution timestamps (e.g. DVD presentation timestamps based - * on a 90kHz clock) and to allow more accurate and synchronized delivery (e.g. - * individual audio samples delivered at 192 kHz). The quantity is 64 bit to - * accommodate a large dynamic range (signed 32 bit values would allow only for plus - * or minus 35 minutes). - * - * Implementations with limited precision may convert the signed 64 bit value to - * a signed 32 bit value internally but risk loss of precision. - */ -#ifndef OMX_SKIP64BIT -typedef OMX_S64 OMX_TICKS; -#else -typedef struct OMX_TICKS -{ - OMX_U32 nLowPart; /** low bits of the signed 64 bit tick value */ - OMX_U32 nHighPart; /** high bits of the signed 64 bit tick value */ -} OMX_TICKS; -#endif -#define OMX_TICKS_PER_SECOND 1000000 - -/** Define the public interface for the OMX Handle. The core will not use - this value internally, but the application should only use this value. - */ -typedef void* OMX_HANDLETYPE; - -typedef struct OMX_MARKTYPE -{ - OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will - generate a mark event upon - processing the mark. */ - OMX_PTR pMarkData; /**< Application specific data associated with - the mark sent on a mark event to disambiguate - this mark from others. */ -} OMX_MARKTYPE; - - -/** OMX_NATIVE_DEVICETYPE is used to map a OMX video port to the - * platform & operating specific object used to reference the display - * or can be used by a audio port for native audio rendering */ -typedef void* OMX_NATIVE_DEVICETYPE; - -/** OMX_NATIVE_WINDOWTYPE is used to map a OMX video port to the - * platform & operating specific object used to reference the window */ -typedef void* OMX_NATIVE_WINDOWTYPE; - -/** The OMX_VERSIONTYPE union is used to specify the version for - a structure or component. For a component, the version is entirely - specified by the component vendor. Components doing the same function - from different vendors may or may not have the same version. For - structures, the version shall be set by the entity that allocates the - structure. For structures specified in the OMX 1.1 specification, the - value of the version shall be set to 1.1.0.0 in all cases. Access to the - OMX_VERSIONTYPE can be by a single 32 bit access (e.g. by nVersion) or - by accessing one of the structure elements to, for example, check only - the Major revision. - */ -typedef union OMX_VERSIONTYPE -{ - struct - { - OMX_U8 nVersionMajor; /**< Major version accessor element */ - OMX_U8 nVersionMinor; /**< Minor version accessor element */ - OMX_U8 nRevision; /**< Revision version accessor element */ - OMX_U8 nStep; /**< Step version accessor element */ - } s; - OMX_U32 nVersion; /**< 32 bit value to make accessing the - version easily done in a single word - size copy/compare operation */ -} OMX_VERSIONTYPE; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ diff --git a/external/android/include/14/frameworks/base/include/media/stagefright/openmax/OMX_Video.h b/external/android/include/14/frameworks/base/include/media/stagefright/openmax/OMX_Video.h deleted file mode 100644 index 4f8485d..0000000 --- a/external/android/include/14/frameworks/base/include/media/stagefright/openmax/OMX_Video.h +++ /dev/null @@ -1,1078 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/** - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** - * @file OMX_Video.h - OpenMax IL version 1.1.2 - * The structures is needed by Video components to exchange parameters - * and configuration data with OMX components. - */ -#ifndef OMX_Video_h -#define OMX_Video_h - -/** @defgroup video OpenMAX IL Video Domain - * @ingroup iv - * Structures for OpenMAX IL Video domain - * @{ - */ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/** - * Each OMX header must include all required header files to allow the - * header to compile without errors. The includes below are required - * for this header file to compile successfully - */ - -#include - - -/** - * Enumeration used to define the possible video compression codings. - * NOTE: This essentially refers to file extensions. If the coding is - * being used to specify the ENCODE type, then additional work - * must be done to configure the exact flavor of the compression - * to be used. For decode cases where the user application can - * not differentiate between MPEG-4 and H.264 bit streams, it is - * up to the codec to handle this. - */ -typedef enum OMX_VIDEO_CODINGTYPE { - OMX_VIDEO_CodingUnused, /**< Value when coding is N/A */ - OMX_VIDEO_CodingAutoDetect, /**< Autodetection of coding type */ - OMX_VIDEO_CodingMPEG2, /**< AKA: H.262 */ - OMX_VIDEO_CodingH263, /**< H.263 */ - OMX_VIDEO_CodingMPEG4, /**< MPEG-4 */ - OMX_VIDEO_CodingWMV, /**< all versions of Windows Media Video */ - OMX_VIDEO_CodingRV, /**< all versions of Real Video */ - OMX_VIDEO_CodingAVC, /**< H.264/AVC */ - OMX_VIDEO_CodingMJPEG, /**< Motion JPEG */ - OMX_VIDEO_CodingVPX, /**< Google VPX, formerly known as On2 VP8 */ - OMX_VIDEO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_CodingMax = 0x7FFFFFFF -} OMX_VIDEO_CODINGTYPE; - - -/** - * Data structure used to define a video path. The number of Video paths for - * input and output will vary by type of the Video component. - * - * Input (aka Source) : zero Inputs, one Output, - * Splitter : one Input, 2 or more Outputs, - * Processing Element : one Input, one output, - * Mixer : 2 or more inputs, one output, - * Output (aka Sink) : one Input, zero outputs. - * - * The PortDefinition structure is used to define all of the parameters - * necessary for the compliant component to setup an input or an output video - * path. If additional vendor specific data is required, it should be - * transmitted to the component using the CustomCommand function. Compliant - * components will prepopulate this structure with optimal values during the - * GetDefaultInitParams command. - * - * STRUCT MEMBERS: - * cMIMEType : MIME type of data for the port - * pNativeRender : Platform specific reference for a display if a - * sync, otherwise this field is 0 - * nFrameWidth : Width of frame to be used on channel if - * uncompressed format is used. Use 0 for unknown, - * don't care or variable - * nFrameHeight : Height of frame to be used on channel if - * uncompressed format is used. Use 0 for unknown, - * don't care or variable - * nStride : Number of bytes per span of an image - * (i.e. indicates the number of bytes to get - * from span N to span N+1, where negative stride - * indicates the image is bottom up - * nSliceHeight : Height used when encoding in slices - * nBitrate : Bit rate of frame to be used on channel if - * compressed format is used. Use 0 for unknown, - * don't care or variable - * xFramerate : Frame rate to be used on channel if uncompressed - * format is used. Use 0 for unknown, don't care or - * variable. Units are Q16 frames per second. - * bFlagErrorConcealment : Turns on error concealment if it is supported by - * the OMX component - * eCompressionFormat : Compression format used in this instance of the - * component. When OMX_VIDEO_CodingUnused is - * specified, eColorFormat is used - * eColorFormat : Decompressed format used by this component - * pNativeWindow : Platform specific reference for a window object if a - * display sink , otherwise this field is 0x0. - */ -typedef struct OMX_VIDEO_PORTDEFINITIONTYPE { - OMX_STRING cMIMEType; - OMX_NATIVE_DEVICETYPE pNativeRender; - OMX_U32 nFrameWidth; - OMX_U32 nFrameHeight; - OMX_S32 nStride; - OMX_U32 nSliceHeight; - OMX_U32 nBitrate; - OMX_U32 xFramerate; - OMX_BOOL bFlagErrorConcealment; - OMX_VIDEO_CODINGTYPE eCompressionFormat; - OMX_COLOR_FORMATTYPE eColorFormat; - OMX_NATIVE_WINDOWTYPE pNativeWindow; -} OMX_VIDEO_PORTDEFINITIONTYPE; - -/** - * Port format parameter. This structure is used to enumerate the various - * data input/output format supported by the port. - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Indicates which port to set - * nIndex : Indicates the enumeration index for the format from - * 0x0 to N-1 - * eCompressionFormat : Compression format used in this instance of the - * component. When OMX_VIDEO_CodingUnused is specified, - * eColorFormat is used - * eColorFormat : Decompressed format used by this component - * xFrameRate : Indicates the video frame rate in Q16 format - */ -typedef struct OMX_VIDEO_PARAM_PORTFORMATTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nIndex; - OMX_VIDEO_CODINGTYPE eCompressionFormat; - OMX_COLOR_FORMATTYPE eColorFormat; - OMX_U32 xFramerate; -} OMX_VIDEO_PARAM_PORTFORMATTYPE; - - -/** - * This is a structure for configuring video compression quantization - * parameter values. Codecs may support different QP values for different - * frame types. - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version info - * nPortIndex : Port that this structure applies to - * nQpI : QP value to use for index frames - * nQpP : QP value to use for P frames - * nQpB : QP values to use for bidirectional frames - */ -typedef struct OMX_VIDEO_PARAM_QUANTIZATIONTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nQpI; - OMX_U32 nQpP; - OMX_U32 nQpB; -} OMX_VIDEO_PARAM_QUANTIZATIONTYPE; - - -/** - * Structure for configuration of video fast update parameters. - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version info - * nPortIndex : Port that this structure applies to - * bEnableVFU : Enable/Disable video fast update - * nFirstGOB : Specifies the number of the first macroblock row - * nFirstMB : specifies the first MB relative to the specified first GOB - * nNumMBs : Specifies the number of MBs to be refreshed from nFirstGOB - * and nFirstMB - */ -typedef struct OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL bEnableVFU; - OMX_U32 nFirstGOB; - OMX_U32 nFirstMB; - OMX_U32 nNumMBs; -} OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE; - - -/** - * Enumeration of possible bitrate control types - */ -typedef enum OMX_VIDEO_CONTROLRATETYPE { - OMX_Video_ControlRateDisable, - OMX_Video_ControlRateVariable, - OMX_Video_ControlRateConstant, - OMX_Video_ControlRateVariableSkipFrames, - OMX_Video_ControlRateConstantSkipFrames, - OMX_Video_ControlRateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_Video_ControlRateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_Video_ControlRateMax = 0x7FFFFFFF -} OMX_VIDEO_CONTROLRATETYPE; - - -/** - * Structure for configuring bitrate mode of a codec. - * - * STRUCT MEMBERS: - * nSize : Size of the struct in bytes - * nVersion : OMX spec version info - * nPortIndex : Port that this struct applies to - * eControlRate : Control rate type enum - * nTargetBitrate : Target bitrate to encode with - */ -typedef struct OMX_VIDEO_PARAM_BITRATETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_VIDEO_CONTROLRATETYPE eControlRate; - OMX_U32 nTargetBitrate; -} OMX_VIDEO_PARAM_BITRATETYPE; - - -/** - * Enumeration of possible motion vector (MV) types - */ -typedef enum OMX_VIDEO_MOTIONVECTORTYPE { - OMX_Video_MotionVectorPixel, - OMX_Video_MotionVectorHalfPel, - OMX_Video_MotionVectorQuarterPel, - OMX_Video_MotionVectorEighthPel, - OMX_Video_MotionVectorKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_Video_MotionVectorVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_Video_MotionVectorMax = 0x7FFFFFFF -} OMX_VIDEO_MOTIONVECTORTYPE; - - -/** - * Structure for configuring the number of motion vectors used as well - * as their accuracy. - * - * STRUCT MEMBERS: - * nSize : Size of the struct in bytes - * nVersion : OMX spec version info - * nPortIndex : port that this structure applies to - * eAccuracy : Enumerated MV accuracy - * bUnrestrictedMVs : Allow unrestricted MVs - * bFourMV : Allow use of 4 MVs - * sXSearchRange : Search range in horizontal direction for MVs - * sYSearchRange : Search range in vertical direction for MVs - */ -typedef struct OMX_VIDEO_PARAM_MOTIONVECTORTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_VIDEO_MOTIONVECTORTYPE eAccuracy; - OMX_BOOL bUnrestrictedMVs; - OMX_BOOL bFourMV; - OMX_S32 sXSearchRange; - OMX_S32 sYSearchRange; -} OMX_VIDEO_PARAM_MOTIONVECTORTYPE; - - -/** - * Enumeration of possible methods to use for Intra Refresh - */ -typedef enum OMX_VIDEO_INTRAREFRESHTYPE { - OMX_VIDEO_IntraRefreshCyclic, - OMX_VIDEO_IntraRefreshAdaptive, - OMX_VIDEO_IntraRefreshBoth, - OMX_VIDEO_IntraRefreshKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_IntraRefreshVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_IntraRefreshMax = 0x7FFFFFFF -} OMX_VIDEO_INTRAREFRESHTYPE; - - -/** - * Structure for configuring intra refresh mode - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eRefreshMode : Cyclic, Adaptive, or Both - * nAirMBs : Number of intra macroblocks to refresh in a frame when - * AIR is enabled - * nAirRef : Number of times a motion marked macroblock has to be - * intra coded - * nCirMBs : Number of consecutive macroblocks to be coded as "intra" - * when CIR is enabled - */ -typedef struct OMX_VIDEO_PARAM_INTRAREFRESHTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_VIDEO_INTRAREFRESHTYPE eRefreshMode; - OMX_U32 nAirMBs; - OMX_U32 nAirRef; - OMX_U32 nCirMBs; -} OMX_VIDEO_PARAM_INTRAREFRESHTYPE; - - -/** - * Structure for enabling various error correction methods for video - * compression. - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * bEnableHEC : Enable/disable header extension codes (HEC) - * bEnableResync : Enable/disable resynchronization markers - * nResynchMarkerSpacing : Resynch markers interval (in bits) to be - * applied in the stream - * bEnableDataPartitioning : Enable/disable data partitioning - * bEnableRVLC : Enable/disable reversible variable length - * coding - */ -typedef struct OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL bEnableHEC; - OMX_BOOL bEnableResync; - OMX_U32 nResynchMarkerSpacing; - OMX_BOOL bEnableDataPartitioning; - OMX_BOOL bEnableRVLC; -} OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE; - - -/** - * Configuration of variable block-size motion compensation (VBSMC) - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * b16x16 : Enable inter block search 16x16 - * b16x8 : Enable inter block search 16x8 - * b8x16 : Enable inter block search 8x16 - * b8x8 : Enable inter block search 8x8 - * b8x4 : Enable inter block search 8x4 - * b4x8 : Enable inter block search 4x8 - * b4x4 : Enable inter block search 4x4 - */ -typedef struct OMX_VIDEO_PARAM_VBSMCTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL b16x16; - OMX_BOOL b16x8; - OMX_BOOL b8x16; - OMX_BOOL b8x8; - OMX_BOOL b8x4; - OMX_BOOL b4x8; - OMX_BOOL b4x4; -} OMX_VIDEO_PARAM_VBSMCTYPE; - - -/** - * H.263 profile types, each profile indicates support for various - * performance bounds and different annexes. - * - * ENUMS: - * Baseline : Baseline Profile: H.263 (V1), no optional modes - * H320 Coding : H.320 Coding Efficiency Backward Compatibility - * Profile: H.263+ (V2), includes annexes I, J, L.4 - * and T - * BackwardCompatible : Backward Compatibility Profile: H.263 (V1), - * includes annex F - * ISWV2 : Interactive Streaming Wireless Profile: H.263+ - * (V2), includes annexes I, J, K and T - * ISWV3 : Interactive Streaming Wireless Profile: H.263++ - * (V3), includes profile 3 and annexes V and W.6.3.8 - * HighCompression : Conversational High Compression Profile: H.263++ - * (V3), includes profiles 1 & 2 and annexes D and U - * Internet : Conversational Internet Profile: H.263++ (V3), - * includes profile 5 and annex K - * Interlace : Conversational Interlace Profile: H.263++ (V3), - * includes profile 5 and annex W.6.3.11 - * HighLatency : High Latency Profile: H.263++ (V3), includes - * profile 6 and annexes O.1 and P.5 - */ -typedef enum OMX_VIDEO_H263PROFILETYPE { - OMX_VIDEO_H263ProfileBaseline = 0x01, - OMX_VIDEO_H263ProfileH320Coding = 0x02, - OMX_VIDEO_H263ProfileBackwardCompatible = 0x04, - OMX_VIDEO_H263ProfileISWV2 = 0x08, - OMX_VIDEO_H263ProfileISWV3 = 0x10, - OMX_VIDEO_H263ProfileHighCompression = 0x20, - OMX_VIDEO_H263ProfileInternet = 0x40, - OMX_VIDEO_H263ProfileInterlace = 0x80, - OMX_VIDEO_H263ProfileHighLatency = 0x100, - OMX_VIDEO_H263ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_H263ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_H263ProfileMax = 0x7FFFFFFF -} OMX_VIDEO_H263PROFILETYPE; - - -/** - * H.263 level types, each level indicates support for various frame sizes, - * bit rates, decoder frame rates. - */ -typedef enum OMX_VIDEO_H263LEVELTYPE { - OMX_VIDEO_H263Level10 = 0x01, - OMX_VIDEO_H263Level20 = 0x02, - OMX_VIDEO_H263Level30 = 0x04, - OMX_VIDEO_H263Level40 = 0x08, - OMX_VIDEO_H263Level45 = 0x10, - OMX_VIDEO_H263Level50 = 0x20, - OMX_VIDEO_H263Level60 = 0x40, - OMX_VIDEO_H263Level70 = 0x80, - OMX_VIDEO_H263LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_H263LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_H263LevelMax = 0x7FFFFFFF -} OMX_VIDEO_H263LEVELTYPE; - - -/** - * Specifies the picture type. These values should be OR'd to signal all - * pictures types which are allowed. - * - * ENUMS: - * Generic Picture Types: I, P and B - * H.263 Specific Picture Types: SI and SP - * H.264 Specific Picture Types: EI and EP - * MPEG-4 Specific Picture Types: S - */ -typedef enum OMX_VIDEO_PICTURETYPE { - OMX_VIDEO_PictureTypeI = 0x01, - OMX_VIDEO_PictureTypeP = 0x02, - OMX_VIDEO_PictureTypeB = 0x04, - OMX_VIDEO_PictureTypeSI = 0x08, - OMX_VIDEO_PictureTypeSP = 0x10, - OMX_VIDEO_PictureTypeEI = 0x11, - OMX_VIDEO_PictureTypeEP = 0x12, - OMX_VIDEO_PictureTypeS = 0x14, - OMX_VIDEO_PictureTypeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_PictureTypeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_PictureTypeMax = 0x7FFFFFFF -} OMX_VIDEO_PICTURETYPE; - - -/** - * H.263 Params - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nPFrames : Number of P frames between each I frame - * nBFrames : Number of B frames between each I frame - * eProfile : H.263 profile(s) to use - * eLevel : H.263 level(s) to use - * bPLUSPTYPEAllowed : Indicating that it is allowed to use PLUSPTYPE - * (specified in the 1998 version of H.263) to - * indicate custom picture sizes or clock - * frequencies - * nAllowedPictureTypes : Specifies the picture types allowed in the - * bitstream - * bForceRoundingTypeToZero : value of the RTYPE bit (bit 6 of MPPTYPE) is - * not constrained. It is recommended to change - * the value of the RTYPE bit for each reference - * picture in error-free communication - * nPictureHeaderRepetition : Specifies the frequency of picture header - * repetition - * nGOBHeaderInterval : Specifies the interval of non-empty GOB - * headers in units of GOBs - */ -typedef struct OMX_VIDEO_PARAM_H263TYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nPFrames; - OMX_U32 nBFrames; - OMX_VIDEO_H263PROFILETYPE eProfile; - OMX_VIDEO_H263LEVELTYPE eLevel; - OMX_BOOL bPLUSPTYPEAllowed; - OMX_U32 nAllowedPictureTypes; - OMX_BOOL bForceRoundingTypeToZero; - OMX_U32 nPictureHeaderRepetition; - OMX_U32 nGOBHeaderInterval; -} OMX_VIDEO_PARAM_H263TYPE; - - -/** - * MPEG-2 profile types, each profile indicates support for various - * performance bounds and different annexes. - */ -typedef enum OMX_VIDEO_MPEG2PROFILETYPE { - OMX_VIDEO_MPEG2ProfileSimple = 0, /**< Simple Profile */ - OMX_VIDEO_MPEG2ProfileMain, /**< Main Profile */ - OMX_VIDEO_MPEG2Profile422, /**< 4:2:2 Profile */ - OMX_VIDEO_MPEG2ProfileSNR, /**< SNR Profile */ - OMX_VIDEO_MPEG2ProfileSpatial, /**< Spatial Profile */ - OMX_VIDEO_MPEG2ProfileHigh, /**< High Profile */ - OMX_VIDEO_MPEG2ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_MPEG2ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_MPEG2ProfileMax = 0x7FFFFFFF -} OMX_VIDEO_MPEG2PROFILETYPE; - - -/** - * MPEG-2 level types, each level indicates support for various frame - * sizes, bit rates, decoder frame rates. No need - */ -typedef enum OMX_VIDEO_MPEG2LEVELTYPE { - OMX_VIDEO_MPEG2LevelLL = 0, /**< Low Level */ - OMX_VIDEO_MPEG2LevelML, /**< Main Level */ - OMX_VIDEO_MPEG2LevelH14, /**< High 1440 */ - OMX_VIDEO_MPEG2LevelHL, /**< High Level */ - OMX_VIDEO_MPEG2LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_MPEG2LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_MPEG2LevelMax = 0x7FFFFFFF -} OMX_VIDEO_MPEG2LEVELTYPE; - - -/** - * MPEG-2 params - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nPFrames : Number of P frames between each I frame - * nBFrames : Number of B frames between each I frame - * eProfile : MPEG-2 profile(s) to use - * eLevel : MPEG-2 levels(s) to use - */ -typedef struct OMX_VIDEO_PARAM_MPEG2TYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nPFrames; - OMX_U32 nBFrames; - OMX_VIDEO_MPEG2PROFILETYPE eProfile; - OMX_VIDEO_MPEG2LEVELTYPE eLevel; -} OMX_VIDEO_PARAM_MPEG2TYPE; - - -/** - * MPEG-4 profile types, each profile indicates support for various - * performance bounds and different annexes. - * - * ENUMS: - * - Simple Profile, Levels 1-3 - * - Simple Scalable Profile, Levels 1-2 - * - Core Profile, Levels 1-2 - * - Main Profile, Levels 2-4 - * - N-bit Profile, Level 2 - * - Scalable Texture Profile, Level 1 - * - Simple Face Animation Profile, Levels 1-2 - * - Simple Face and Body Animation (FBA) Profile, Levels 1-2 - * - Basic Animated Texture Profile, Levels 1-2 - * - Hybrid Profile, Levels 1-2 - * - Advanced Real Time Simple Profiles, Levels 1-4 - * - Core Scalable Profile, Levels 1-3 - * - Advanced Coding Efficiency Profile, Levels 1-4 - * - Advanced Core Profile, Levels 1-2 - * - Advanced Scalable Texture, Levels 2-3 - */ -typedef enum OMX_VIDEO_MPEG4PROFILETYPE { - OMX_VIDEO_MPEG4ProfileSimple = 0x01, - OMX_VIDEO_MPEG4ProfileSimpleScalable = 0x02, - OMX_VIDEO_MPEG4ProfileCore = 0x04, - OMX_VIDEO_MPEG4ProfileMain = 0x08, - OMX_VIDEO_MPEG4ProfileNbit = 0x10, - OMX_VIDEO_MPEG4ProfileScalableTexture = 0x20, - OMX_VIDEO_MPEG4ProfileSimpleFace = 0x40, - OMX_VIDEO_MPEG4ProfileSimpleFBA = 0x80, - OMX_VIDEO_MPEG4ProfileBasicAnimated = 0x100, - OMX_VIDEO_MPEG4ProfileHybrid = 0x200, - OMX_VIDEO_MPEG4ProfileAdvancedRealTime = 0x400, - OMX_VIDEO_MPEG4ProfileCoreScalable = 0x800, - OMX_VIDEO_MPEG4ProfileAdvancedCoding = 0x1000, - OMX_VIDEO_MPEG4ProfileAdvancedCore = 0x2000, - OMX_VIDEO_MPEG4ProfileAdvancedScalable = 0x4000, - OMX_VIDEO_MPEG4ProfileAdvancedSimple = 0x8000, - OMX_VIDEO_MPEG4ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_MPEG4ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_MPEG4ProfileMax = 0x7FFFFFFF -} OMX_VIDEO_MPEG4PROFILETYPE; - - -/** - * MPEG-4 level types, each level indicates support for various frame - * sizes, bit rates, decoder frame rates. No need - */ -typedef enum OMX_VIDEO_MPEG4LEVELTYPE { - OMX_VIDEO_MPEG4Level0 = 0x01, /**< Level 0 */ - OMX_VIDEO_MPEG4Level0b = 0x02, /**< Level 0b */ - OMX_VIDEO_MPEG4Level1 = 0x04, /**< Level 1 */ - OMX_VIDEO_MPEG4Level2 = 0x08, /**< Level 2 */ - OMX_VIDEO_MPEG4Level3 = 0x10, /**< Level 3 */ - OMX_VIDEO_MPEG4Level4 = 0x20, /**< Level 4 */ - OMX_VIDEO_MPEG4Level4a = 0x40, /**< Level 4a */ - OMX_VIDEO_MPEG4Level5 = 0x80, /**< Level 5 */ - OMX_VIDEO_MPEG4LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_MPEG4LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_MPEG4LevelMax = 0x7FFFFFFF -} OMX_VIDEO_MPEG4LEVELTYPE; - - -/** - * MPEG-4 configuration. This structure handles configuration options - * which are specific to MPEG4 algorithms - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nSliceHeaderSpacing : Number of macroblocks between slice header (H263+ - * Annex K). Put zero if not used - * bSVH : Enable Short Video Header mode - * bGov : Flag to enable GOV - * nPFrames : Number of P frames between each I frame (also called - * GOV period) - * nBFrames : Number of B frames between each I frame - * nIDCVLCThreshold : Value of intra DC VLC threshold - * bACPred : Flag to use ac prediction - * nMaxPacketSize : Maximum size of packet in bytes. - * nTimeIncRes : Used to pass VOP time increment resolution for MPEG4. - * Interpreted as described in MPEG4 standard. - * eProfile : MPEG-4 profile(s) to use. - * eLevel : MPEG-4 level(s) to use. - * nAllowedPictureTypes : Specifies the picture types allowed in the bitstream - * nHeaderExtension : Specifies the number of consecutive video packet - * headers within a VOP - * bReversibleVLC : Specifies whether reversible variable length coding - * is in use - */ -typedef struct OMX_VIDEO_PARAM_MPEG4TYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nSliceHeaderSpacing; - OMX_BOOL bSVH; - OMX_BOOL bGov; - OMX_U32 nPFrames; - OMX_U32 nBFrames; - OMX_U32 nIDCVLCThreshold; - OMX_BOOL bACPred; - OMX_U32 nMaxPacketSize; - OMX_U32 nTimeIncRes; - OMX_VIDEO_MPEG4PROFILETYPE eProfile; - OMX_VIDEO_MPEG4LEVELTYPE eLevel; - OMX_U32 nAllowedPictureTypes; - OMX_U32 nHeaderExtension; - OMX_BOOL bReversibleVLC; -} OMX_VIDEO_PARAM_MPEG4TYPE; - - -/** - * WMV Versions - */ -typedef enum OMX_VIDEO_WMVFORMATTYPE { - OMX_VIDEO_WMVFormatUnused = 0x01, /**< Format unused or unknown */ - OMX_VIDEO_WMVFormat7 = 0x02, /**< Windows Media Video format 7 */ - OMX_VIDEO_WMVFormat8 = 0x04, /**< Windows Media Video format 8 */ - OMX_VIDEO_WMVFormat9 = 0x08, /**< Windows Media Video format 9 */ - OMX_VIDEO_WMFFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_WMFFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_WMVFormatMax = 0x7FFFFFFF -} OMX_VIDEO_WMVFORMATTYPE; - - -/** - * WMV Params - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eFormat : Version of WMV stream / data - */ -typedef struct OMX_VIDEO_PARAM_WMVTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_VIDEO_WMVFORMATTYPE eFormat; -} OMX_VIDEO_PARAM_WMVTYPE; - - -/** - * Real Video Version - */ -typedef enum OMX_VIDEO_RVFORMATTYPE { - OMX_VIDEO_RVFormatUnused = 0, /**< Format unused or unknown */ - OMX_VIDEO_RVFormat8, /**< Real Video format 8 */ - OMX_VIDEO_RVFormat9, /**< Real Video format 9 */ - OMX_VIDEO_RVFormatG2, /**< Real Video Format G2 */ - OMX_VIDEO_RVFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_RVFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_RVFormatMax = 0x7FFFFFFF -} OMX_VIDEO_RVFORMATTYPE; - - -/** - * Real Video Params - * - * STUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eFormat : Version of RV stream / data - * nBitsPerPixel : Bits per pixel coded in the frame - * nPaddedWidth : Padded width in pixel of a video frame - * nPaddedHeight : Padded Height in pixels of a video frame - * nFrameRate : Rate of video in frames per second - * nBitstreamFlags : Flags which internal information about the bitstream - * nBitstreamVersion : Bitstream version - * nMaxEncodeFrameSize: Max encoded frame size - * bEnablePostFilter : Turn on/off post filter - * bEnableTemporalInterpolation : Turn on/off temporal interpolation - * bEnableLatencyMode : When enabled, the decoder does not display a decoded - * frame until it has detected that no enhancement layer - * frames or dependent B frames will be coming. This - * detection usually occurs when a subsequent non-B - * frame is encountered - */ -typedef struct OMX_VIDEO_PARAM_RVTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_VIDEO_RVFORMATTYPE eFormat; - OMX_U16 nBitsPerPixel; - OMX_U16 nPaddedWidth; - OMX_U16 nPaddedHeight; - OMX_U32 nFrameRate; - OMX_U32 nBitstreamFlags; - OMX_U32 nBitstreamVersion; - OMX_U32 nMaxEncodeFrameSize; - OMX_BOOL bEnablePostFilter; - OMX_BOOL bEnableTemporalInterpolation; - OMX_BOOL bEnableLatencyMode; -} OMX_VIDEO_PARAM_RVTYPE; - - -/** - * AVC profile types, each profile indicates support for various - * performance bounds and different annexes. - */ -typedef enum OMX_VIDEO_AVCPROFILETYPE { - OMX_VIDEO_AVCProfileBaseline = 0x01, /**< Baseline profile */ - OMX_VIDEO_AVCProfileMain = 0x02, /**< Main profile */ - OMX_VIDEO_AVCProfileExtended = 0x04, /**< Extended profile */ - OMX_VIDEO_AVCProfileHigh = 0x08, /**< High profile */ - OMX_VIDEO_AVCProfileHigh10 = 0x10, /**< High 10 profile */ - OMX_VIDEO_AVCProfileHigh422 = 0x20, /**< High 4:2:2 profile */ - OMX_VIDEO_AVCProfileHigh444 = 0x40, /**< High 4:4:4 profile */ - OMX_VIDEO_AVCProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_AVCProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_AVCProfileMax = 0x7FFFFFFF -} OMX_VIDEO_AVCPROFILETYPE; - - -/** - * AVC level types, each level indicates support for various frame sizes, - * bit rates, decoder frame rates. No need - */ -typedef enum OMX_VIDEO_AVCLEVELTYPE { - OMX_VIDEO_AVCLevel1 = 0x01, /**< Level 1 */ - OMX_VIDEO_AVCLevel1b = 0x02, /**< Level 1b */ - OMX_VIDEO_AVCLevel11 = 0x04, /**< Level 1.1 */ - OMX_VIDEO_AVCLevel12 = 0x08, /**< Level 1.2 */ - OMX_VIDEO_AVCLevel13 = 0x10, /**< Level 1.3 */ - OMX_VIDEO_AVCLevel2 = 0x20, /**< Level 2 */ - OMX_VIDEO_AVCLevel21 = 0x40, /**< Level 2.1 */ - OMX_VIDEO_AVCLevel22 = 0x80, /**< Level 2.2 */ - OMX_VIDEO_AVCLevel3 = 0x100, /**< Level 3 */ - OMX_VIDEO_AVCLevel31 = 0x200, /**< Level 3.1 */ - OMX_VIDEO_AVCLevel32 = 0x400, /**< Level 3.2 */ - OMX_VIDEO_AVCLevel4 = 0x800, /**< Level 4 */ - OMX_VIDEO_AVCLevel41 = 0x1000, /**< Level 4.1 */ - OMX_VIDEO_AVCLevel42 = 0x2000, /**< Level 4.2 */ - OMX_VIDEO_AVCLevel5 = 0x4000, /**< Level 5 */ - OMX_VIDEO_AVCLevel51 = 0x8000, /**< Level 5.1 */ - OMX_VIDEO_AVCLevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_AVCLevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_AVCLevelMax = 0x7FFFFFFF -} OMX_VIDEO_AVCLEVELTYPE; - - -/** - * AVC loop filter modes - * - * OMX_VIDEO_AVCLoopFilterEnable : Enable - * OMX_VIDEO_AVCLoopFilterDisable : Disable - * OMX_VIDEO_AVCLoopFilterDisableSliceBoundary : Disabled on slice boundaries - */ -typedef enum OMX_VIDEO_AVCLOOPFILTERTYPE { - OMX_VIDEO_AVCLoopFilterEnable = 0, - OMX_VIDEO_AVCLoopFilterDisable, - OMX_VIDEO_AVCLoopFilterDisableSliceBoundary, - OMX_VIDEO_AVCLoopFilterKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_AVCLoopFilterVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_AVCLoopFilterMax = 0x7FFFFFFF -} OMX_VIDEO_AVCLOOPFILTERTYPE; - - -/** - * AVC params - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nSliceHeaderSpacing : Number of macroblocks between slice header, put - * zero if not used - * nPFrames : Number of P frames between each I frame - * nBFrames : Number of B frames between each I frame - * bUseHadamard : Enable/disable Hadamard transform - * nRefFrames : Max number of reference frames to use for inter - * motion search (1-16) - * nRefIdxTrailing : Pic param set ref frame index (index into ref - * frame buffer of trailing frames list), B frame - * support - * nRefIdxForward : Pic param set ref frame index (index into ref - * frame buffer of forward frames list), B frame - * support - * bEnableUEP : Enable/disable unequal error protection. This - * is only valid of data partitioning is enabled. - * bEnableFMO : Enable/disable flexible macroblock ordering - * bEnableASO : Enable/disable arbitrary slice ordering - * bEnableRS : Enable/disable sending of redundant slices - * eProfile : AVC profile(s) to use - * eLevel : AVC level(s) to use - * nAllowedPictureTypes : Specifies the picture types allowed in the - * bitstream - * bFrameMBsOnly : specifies that every coded picture of the - * coded video sequence is a coded frame - * containing only frame macroblocks - * bMBAFF : Enable/disable switching between frame and - * field macroblocks within a picture - * bEntropyCodingCABAC : Entropy decoding method to be applied for the - * syntax elements for which two descriptors appear - * in the syntax tables - * bWeightedPPrediction : Enable/disable weighted prediction shall not - * be applied to P and SP slices - * nWeightedBipredicitonMode : Default weighted prediction is applied to B - * slices - * bconstIpred : Enable/disable intra prediction - * bDirect8x8Inference : Specifies the method used in the derivation - * process for luma motion vectors for B_Skip, - * B_Direct_16x16 and B_Direct_8x8 as specified - * in subclause 8.4.1.2 of the AVC spec - * bDirectSpatialTemporal : Flag indicating spatial or temporal direct - * mode used in B slice coding (related to - * bDirect8x8Inference) . Spatial direct mode is - * more common and should be the default. - * nCabacInitIdx : Index used to init CABAC contexts - * eLoopFilterMode : Enable/disable loop filter - */ -typedef struct OMX_VIDEO_PARAM_AVCTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nSliceHeaderSpacing; - OMX_U32 nPFrames; - OMX_U32 nBFrames; - OMX_BOOL bUseHadamard; - OMX_U32 nRefFrames; - OMX_U32 nRefIdx10ActiveMinus1; - OMX_U32 nRefIdx11ActiveMinus1; - OMX_BOOL bEnableUEP; - OMX_BOOL bEnableFMO; - OMX_BOOL bEnableASO; - OMX_BOOL bEnableRS; - OMX_VIDEO_AVCPROFILETYPE eProfile; - OMX_VIDEO_AVCLEVELTYPE eLevel; - OMX_U32 nAllowedPictureTypes; - OMX_BOOL bFrameMBsOnly; - OMX_BOOL bMBAFF; - OMX_BOOL bEntropyCodingCABAC; - OMX_BOOL bWeightedPPrediction; - OMX_U32 nWeightedBipredicitonMode; - OMX_BOOL bconstIpred ; - OMX_BOOL bDirect8x8Inference; - OMX_BOOL bDirectSpatialTemporal; - OMX_U32 nCabacInitIdc; - OMX_VIDEO_AVCLOOPFILTERTYPE eLoopFilterMode; -} OMX_VIDEO_PARAM_AVCTYPE; - -typedef struct OMX_VIDEO_PARAM_PROFILELEVELTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 eProfile; /**< type is OMX_VIDEO_AVCPROFILETYPE, OMX_VIDEO_H263PROFILETYPE, - or OMX_VIDEO_MPEG4PROFILETYPE depending on context */ - OMX_U32 eLevel; /**< type is OMX_VIDEO_AVCLEVELTYPE, OMX_VIDEO_H263LEVELTYPE, - or OMX_VIDEO_MPEG4PROFILETYPE depending on context */ - OMX_U32 nProfileIndex; /**< Used to query for individual profile support information, - This parameter is valid only for - OMX_IndexParamVideoProfileLevelQuerySupported index, - For all other indices this parameter is to be ignored. */ -} OMX_VIDEO_PARAM_PROFILELEVELTYPE; - -/** - * Structure for dynamically configuring bitrate mode of a codec. - * - * STRUCT MEMBERS: - * nSize : Size of the struct in bytes - * nVersion : OMX spec version info - * nPortIndex : Port that this struct applies to - * nEncodeBitrate : Target average bitrate to be generated in bps - */ -typedef struct OMX_VIDEO_CONFIG_BITRATETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nEncodeBitrate; -} OMX_VIDEO_CONFIG_BITRATETYPE; - -/** - * Defines Encoder Frame Rate setting - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * xEncodeFramerate : Encoding framerate represented in Q16 format - */ -typedef struct OMX_CONFIG_FRAMERATETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 xEncodeFramerate; /* Q16 format */ -} OMX_CONFIG_FRAMERATETYPE; - -typedef struct OMX_CONFIG_INTRAREFRESHVOPTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL IntraRefreshVOP; -} OMX_CONFIG_INTRAREFRESHVOPTYPE; - -typedef struct OMX_CONFIG_MACROBLOCKERRORMAPTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nErrMapSize; /* Size of the Error Map in bytes */ - OMX_U8 ErrMap[1]; /* Error map hint */ -} OMX_CONFIG_MACROBLOCKERRORMAPTYPE; - -typedef struct OMX_CONFIG_MBERRORREPORTINGTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL bEnabled; -} OMX_CONFIG_MBERRORREPORTINGTYPE; - -typedef struct OMX_PARAM_MACROBLOCKSTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nMacroblocks; -} OMX_PARAM_MACROBLOCKSTYPE; - -/** - * AVC Slice Mode modes - * - * OMX_VIDEO_SLICEMODE_AVCDefault : Normal frame encoding, one slice per frame - * OMX_VIDEO_SLICEMODE_AVCMBSlice : NAL mode, number of MBs per frame - * OMX_VIDEO_SLICEMODE_AVCByteSlice : NAL mode, number of bytes per frame - */ -typedef enum OMX_VIDEO_AVCSLICEMODETYPE { - OMX_VIDEO_SLICEMODE_AVCDefault = 0, - OMX_VIDEO_SLICEMODE_AVCMBSlice, - OMX_VIDEO_SLICEMODE_AVCByteSlice, - OMX_VIDEO_SLICEMODE_AVCKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_SLICEMODE_AVCVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_SLICEMODE_AVCLevelMax = 0x7FFFFFFF -} OMX_VIDEO_AVCSLICEMODETYPE; - -/** - * AVC FMO Slice Mode Params - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nNumSliceGroups : Specifies the number of slice groups - * nSliceGroupMapType : Specifies the type of slice groups - * eSliceMode : Specifies the type of slice - */ -typedef struct OMX_VIDEO_PARAM_AVCSLICEFMO { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U8 nNumSliceGroups; - OMX_U8 nSliceGroupMapType; - OMX_VIDEO_AVCSLICEMODETYPE eSliceMode; -} OMX_VIDEO_PARAM_AVCSLICEFMO; - -/** - * AVC IDR Period Configs - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nIDRPeriod : Specifies periodicity of IDR frames - * nPFrames : Specifies internal of coding Intra frames - */ -typedef struct OMX_VIDEO_CONFIG_AVCINTRAPERIOD { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nIDRPeriod; - OMX_U32 nPFrames; -} OMX_VIDEO_CONFIG_AVCINTRAPERIOD; - -/** - * AVC NAL Size Configs - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nNaluBytes : Specifies the NAL unit size - */ -typedef struct OMX_VIDEO_CONFIG_NALSIZE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nNaluBytes; -} OMX_VIDEO_CONFIG_NALSIZE; - -/** @} */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ - diff --git a/external/android/include/14/frameworks/base/include/media/thread_init.h b/external/android/include/14/frameworks/base/include/media/thread_init.h deleted file mode 100644 index 2feac86..0000000 --- a/external/android/include/14/frameworks/base/include/media/thread_init.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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. - */ - -#ifndef THREAD_INIT_H -#define THREAD_INIT_H - -bool InitializeForThread(); -void UninitializeForThread(); - -#endif /* THREAD_INIT_H*/ - diff --git a/external/android/include/14/frameworks/base/include/ui/DisplayInfo.h b/external/android/include/14/frameworks/base/include/ui/DisplayInfo.h deleted file mode 100644 index edd28a6..0000000 --- a/external/android/include/14/frameworks/base/include/ui/DisplayInfo.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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_UI_DISPLAY_INFO_H -#define ANDROID_UI_DISPLAY_INFO_H - -#include -#include - -#include - -namespace android { - -struct DisplayInfo { - uint32_t w; - uint32_t h; - PixelFormatInfo pixelFormatInfo; - uint8_t orientation; - uint8_t reserved[3]; - float fps; - float density; - float xdpi; - float ydpi; -}; - -/* Display orientations as defined in Surface.java and ISurfaceComposer.h. */ -enum { - DISPLAY_ORIENTATION_0 = 0, - DISPLAY_ORIENTATION_90 = 1, - DISPLAY_ORIENTATION_180 = 2, - DISPLAY_ORIENTATION_270 = 3 -}; - - -}; // namespace android - -#endif // ANDROID_COMPOSER_DISPLAY_INFO_H - diff --git a/external/android/include/14/frameworks/base/include/ui/EGLNativeSurface.h b/external/android/include/14/frameworks/base/include/ui/EGLNativeSurface.h deleted file mode 100644 index 7964e7c..0000000 --- a/external/android/include/14/frameworks/base/include/ui/EGLNativeSurface.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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_EGL_NATIVE_SURFACE_H -#define ANDROID_EGL_NATIVE_SURFACE_H - -#include -#include - -#include -#include - -#include - -// --------------------------------------------------------------------------- -namespace android { -// --------------------------------------------------------------------------- - -template -class EGLNativeSurface : public egl_native_window_t, public LightRefBase -{ -public: - EGLNativeSurface() { - memset(egl_native_window_t::reserved, 0, - sizeof(egl_native_window_t::reserved)); - memset(egl_native_window_t::reserved_proc, 0, - sizeof(egl_native_window_t::reserved_proc)); - memset(egl_native_window_t::oem, 0, - sizeof(egl_native_window_t::oem)); - } -protected: - EGLNativeSurface& operator = (const EGLNativeSurface& rhs); - EGLNativeSurface(const EGLNativeSurface& rhs); - inline ~EGLNativeSurface() { }; -}; - -// --------------------------------------------------------------------------- -}; // namespace android -// --------------------------------------------------------------------------- - -#endif // ANDROID_EGL_SURFACE_H - diff --git a/external/android/include/14/frameworks/base/include/ui/EGLUtils.h b/external/android/include/14/frameworks/base/include/ui/EGLUtils.h deleted file mode 100644 index a5bff81..0000000 --- a/external/android/include/14/frameworks/base/include/ui/EGLUtils.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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_UI_EGLUTILS_H -#define ANDROID_UI_EGLUTILS_H - -#include -#include -#include - - -// ---------------------------------------------------------------------------- -namespace android { -// ---------------------------------------------------------------------------- - -class EGLUtils -{ -public: - - static const char *strerror(EGLint err); - - static status_t selectConfigForPixelFormat( - EGLDisplay dpy, - EGLint const* attrs, - PixelFormat format, - EGLConfig* outConfig); - - static status_t selectConfigForNativeWindow( - EGLDisplay dpy, - EGLint const* attrs, - EGLNativeWindowType window, - EGLConfig* outConfig); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android -// ---------------------------------------------------------------------------- - -#endif /* ANDROID_UI_EGLUTILS_H */ diff --git a/external/android/include/14/frameworks/base/include/ui/FramebufferNativeWindow.h b/external/android/include/14/frameworks/base/include/ui/FramebufferNativeWindow.h deleted file mode 100644 index 302d012..0000000 --- a/external/android/include/14/frameworks/base/include/ui/FramebufferNativeWindow.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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_FRAMEBUFFER_NATIVE_WINDOW_H -#define ANDROID_FRAMEBUFFER_NATIVE_WINDOW_H - -#include -#include - -#include - -#include -#include -#include - -#include - -#include - -#define NUM_FRAME_BUFFERS 2 - -extern "C" EGLNativeWindowType android_createDisplaySurface(void); - -// --------------------------------------------------------------------------- -namespace android { -// --------------------------------------------------------------------------- - -class Surface; -class NativeBuffer; - -// --------------------------------------------------------------------------- - -class FramebufferNativeWindow - : public EGLNativeBase< - ANativeWindow, - FramebufferNativeWindow, - LightRefBase > -{ -public: - FramebufferNativeWindow(); - - framebuffer_device_t const * getDevice() const { return fbDev; } - - bool isUpdateOnDemand() const { return mUpdateOnDemand; } - status_t setUpdateRectangle(const Rect& updateRect); - status_t compositionComplete(); - - void dump(String8& result); - - // for debugging only - int getCurrentBufferIndex() const; - -private: - friend class LightRefBase; - ~FramebufferNativeWindow(); // this class cannot be overloaded - static int setSwapInterval(ANativeWindow* window, int interval); - static int dequeueBuffer(ANativeWindow* window, ANativeWindowBuffer** buffer); - static int lockBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer); - static int queueBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer); - static int query(const ANativeWindow* window, int what, int* value); - static int perform(ANativeWindow* window, int operation, ...); - - framebuffer_device_t* fbDev; - alloc_device_t* grDev; - - sp buffers[NUM_FRAME_BUFFERS]; - sp front; - - mutable Mutex mutex; - Condition mCondition; - int32_t mNumBuffers; - int32_t mNumFreeBuffers; - int32_t mBufferHead; - int32_t mCurrentBufferIndex; - bool mUpdateOnDemand; -}; - -// --------------------------------------------------------------------------- -}; // namespace android -// --------------------------------------------------------------------------- - -#endif // ANDROID_FRAMEBUFFER_NATIVE_WINDOW_H - diff --git a/external/android/include/14/frameworks/base/include/ui/GraphicBuffer.h b/external/android/include/14/frameworks/base/include/ui/GraphicBuffer.h deleted file mode 100644 index b9deafc..0000000 --- a/external/android/include/14/frameworks/base/include/ui/GraphicBuffer.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * 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_GRAPHIC_BUFFER_H -#define ANDROID_GRAPHIC_BUFFER_H - -#include -#include - -#include -#include -#include -#include -#include - -struct ANativeWindowBuffer; - -namespace android { - -class GraphicBufferMapper; - -// =========================================================================== -// GraphicBuffer -// =========================================================================== - -class GraphicBuffer - : public EGLNativeBase< - ANativeWindowBuffer, - GraphicBuffer, - LightRefBase >, public Flattenable -{ -public: - - enum { - USAGE_SW_READ_NEVER = GRALLOC_USAGE_SW_READ_NEVER, - USAGE_SW_READ_RARELY = GRALLOC_USAGE_SW_READ_RARELY, - USAGE_SW_READ_OFTEN = GRALLOC_USAGE_SW_READ_OFTEN, - USAGE_SW_READ_MASK = GRALLOC_USAGE_SW_READ_MASK, - - USAGE_SW_WRITE_NEVER = GRALLOC_USAGE_SW_WRITE_NEVER, - USAGE_SW_WRITE_RARELY = GRALLOC_USAGE_SW_WRITE_RARELY, - USAGE_SW_WRITE_OFTEN = GRALLOC_USAGE_SW_WRITE_OFTEN, - USAGE_SW_WRITE_MASK = GRALLOC_USAGE_SW_WRITE_MASK, - - USAGE_SOFTWARE_MASK = USAGE_SW_READ_MASK|USAGE_SW_WRITE_MASK, - - USAGE_PROTECTED = GRALLOC_USAGE_PROTECTED, - - USAGE_HW_TEXTURE = GRALLOC_USAGE_HW_TEXTURE, - USAGE_HW_RENDER = GRALLOC_USAGE_HW_RENDER, - USAGE_HW_2D = GRALLOC_USAGE_HW_2D, - USAGE_HW_COMPOSER = GRALLOC_USAGE_HW_COMPOSER, - USAGE_HW_MASK = GRALLOC_USAGE_HW_MASK - }; - - GraphicBuffer(); - - // creates w * h buffer - GraphicBuffer(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage); - - // create a buffer from an existing handle - GraphicBuffer(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage, - uint32_t stride, native_handle_t* handle, bool keepOwnership); - - // create a buffer from an existing ANativeWindowBuffer - GraphicBuffer(ANativeWindowBuffer* buffer, bool keepOwnership); - - // return status - status_t initCheck() const; - - uint32_t getWidth() const { return width; } - uint32_t getHeight() const { return height; } - uint32_t getStride() const { return stride; } - uint32_t getUsage() const { return usage; } - PixelFormat getPixelFormat() const { return format; } - Rect getBounds() const { return Rect(width, height); } - - status_t reallocate(uint32_t w, uint32_t h, PixelFormat f, uint32_t usage); - - status_t lock(uint32_t usage, void** vaddr); - status_t lock(uint32_t usage, const Rect& rect, void** vaddr); - status_t lock(GGLSurface* surface, uint32_t usage); - status_t unlock(); - - ANativeWindowBuffer* getNativeBuffer() const; - - void setIndex(int index); - int getIndex() const; - - // for debugging - static void dumpAllocationsToSystemLog(); - -private: - virtual ~GraphicBuffer(); - - enum { - ownNone = 0, - ownHandle = 1, - ownData = 2, - }; - - inline const GraphicBufferMapper& getBufferMapper() const { - return mBufferMapper; - } - inline GraphicBufferMapper& getBufferMapper() { - return mBufferMapper; - } - uint8_t mOwner; - -private: - friend class Surface; - friend class BpSurface; - friend class BnSurface; - friend class SurfaceTextureClient; - friend class LightRefBase; - GraphicBuffer(const GraphicBuffer& rhs); - GraphicBuffer& operator = (const GraphicBuffer& rhs); - const GraphicBuffer& operator = (const GraphicBuffer& rhs) const; - - status_t initSize(uint32_t w, uint32_t h, PixelFormat format, - uint32_t usage); - - void free_handle(); - - // Flattenable interface - size_t getFlattenedSize() const; - size_t getFdCount() const; - status_t flatten(void* buffer, size_t size, - int fds[], size_t count) const; - status_t unflatten(void const* buffer, size_t size, - int fds[], size_t count); - - - GraphicBufferMapper& mBufferMapper; - ssize_t mInitCheck; - int mIndex; - - // If we're wrapping another buffer then this reference will make sure it - // doesn't get freed. - sp mWrappedBuffer; -}; - -}; // namespace android - -#endif // ANDROID_GRAPHIC_BUFFER_H diff --git a/external/android/include/14/frameworks/base/include/ui/GraphicBufferAllocator.h b/external/android/include/14/frameworks/base/include/ui/GraphicBufferAllocator.h deleted file mode 100644 index dffa788..0000000 --- a/external/android/include/14/frameworks/base/include/ui/GraphicBufferAllocator.h +++ /dev/null @@ -1,96 +0,0 @@ -/* -** -** Copyright 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_BUFFER_ALLOCATOR_H -#define ANDROID_BUFFER_ALLOCATOR_H - -#include - -#include - -#include -#include -#include -#include - -#include - -#include - - -namespace android { -// --------------------------------------------------------------------------- - -class String8; - -class GraphicBufferAllocator : public Singleton -{ -public: - enum { - USAGE_SW_READ_NEVER = GRALLOC_USAGE_SW_READ_NEVER, - USAGE_SW_READ_RARELY = GRALLOC_USAGE_SW_READ_RARELY, - USAGE_SW_READ_OFTEN = GRALLOC_USAGE_SW_READ_OFTEN, - USAGE_SW_READ_MASK = GRALLOC_USAGE_SW_READ_MASK, - - USAGE_SW_WRITE_NEVER = GRALLOC_USAGE_SW_WRITE_NEVER, - USAGE_SW_WRITE_RARELY = GRALLOC_USAGE_SW_WRITE_RARELY, - USAGE_SW_WRITE_OFTEN = GRALLOC_USAGE_SW_WRITE_OFTEN, - USAGE_SW_WRITE_MASK = GRALLOC_USAGE_SW_WRITE_MASK, - - USAGE_SOFTWARE_MASK = USAGE_SW_READ_MASK|USAGE_SW_WRITE_MASK, - - USAGE_HW_TEXTURE = GRALLOC_USAGE_HW_TEXTURE, - USAGE_HW_RENDER = GRALLOC_USAGE_HW_RENDER, - USAGE_HW_2D = GRALLOC_USAGE_HW_2D, - USAGE_HW_MASK = GRALLOC_USAGE_HW_MASK - }; - - static inline GraphicBufferAllocator& get() { return getInstance(); } - - - status_t alloc(uint32_t w, uint32_t h, PixelFormat format, int usage, - buffer_handle_t* handle, int32_t* stride); - - status_t free(buffer_handle_t handle); - - void dump(String8& res) const; - static void dumpToSystemLog(); - -private: - struct alloc_rec_t { - uint32_t w; - uint32_t h; - uint32_t s; - PixelFormat format; - uint32_t usage; - size_t size; - }; - - static Mutex sLock; - static KeyedVector sAllocList; - - friend class Singleton; - GraphicBufferAllocator(); - ~GraphicBufferAllocator(); - - alloc_device_t *mAllocDev; -}; - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_BUFFER_ALLOCATOR_H diff --git a/external/android/include/14/frameworks/base/include/ui/GraphicBufferMapper.h b/external/android/include/14/frameworks/base/include/ui/GraphicBufferMapper.h deleted file mode 100644 index 697a02a..0000000 --- a/external/android/include/14/frameworks/base/include/ui/GraphicBufferMapper.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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_UI_BUFFER_MAPPER_H -#define ANDROID_UI_BUFFER_MAPPER_H - -#include -#include - -#include - -#include - - -struct gralloc_module_t; - -namespace android { - -// --------------------------------------------------------------------------- - -class Rect; - -class GraphicBufferMapper : public Singleton -{ -public: - static inline GraphicBufferMapper& get() { return getInstance(); } - - status_t registerBuffer(buffer_handle_t handle); - - status_t unregisterBuffer(buffer_handle_t handle); - - status_t lock(buffer_handle_t handle, - int usage, const Rect& bounds, void** vaddr); - - status_t unlock(buffer_handle_t handle); - - // dumps information about the mapping of this handle - void dump(buffer_handle_t handle); - -private: - friend class Singleton; - GraphicBufferMapper(); - gralloc_module_t const *mAllocMod; -}; - -// --------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_UI_BUFFER_MAPPER_H - diff --git a/external/android/include/14/frameworks/base/include/ui/GraphicLog.h b/external/android/include/14/frameworks/base/include/ui/GraphicLog.h deleted file mode 100644 index ee1b09a..0000000 --- a/external/android/include/14/frameworks/base/include/ui/GraphicLog.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2010 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 _UI_GRAPHIC_LOG_H -#define _UI_GRAPHIC_LOG_H - -#include -#include - -namespace android { - -class GraphicLog : public Singleton -{ - int32_t mEnabled; - static void logImpl(int32_t tag, int32_t buffer); - static void logImpl(int32_t tag, int32_t identity, int32_t buffer); - -public: - enum { - SF_APP_DEQUEUE_BEFORE = 60100, - SF_APP_DEQUEUE_AFTER = 60101, - SF_APP_LOCK_BEFORE = 60102, - SF_APP_LOCK_AFTER = 60103, - SF_APP_QUEUE = 60104, - - SF_REPAINT = 60105, - SF_COMPOSITION_COMPLETE = 60106, - SF_UNLOCK_CLIENTS = 60107, - SF_SWAP_BUFFERS = 60108, - SF_REPAINT_DONE = 60109, - - SF_FB_POST_BEFORE = 60110, - SF_FB_POST_AFTER = 60111, - SF_FB_DEQUEUE_BEFORE = 60112, - SF_FB_DEQUEUE_AFTER = 60113, - SF_FB_LOCK_BEFORE = 60114, - SF_FB_LOCK_AFTER = 60115, - }; - - inline void log(int32_t tag, int32_t buffer) { - if (CC_UNLIKELY(mEnabled)) - logImpl(tag, buffer); - } - inline void log(int32_t tag, int32_t identity, int32_t buffer) { - if (CC_UNLIKELY(mEnabled)) - logImpl(tag, identity, buffer); - } - - GraphicLog(); - - void setEnabled(bool enable); -}; - -} - -#endif // _UI_GRAPHIC_LOG_H - diff --git a/external/android/include/14/frameworks/base/include/ui/Input.h b/external/android/include/14/frameworks/base/include/ui/Input.h deleted file mode 100644 index 438a1a0..0000000 --- a/external/android/include/14/frameworks/base/include/ui/Input.h +++ /dev/null @@ -1,893 +0,0 @@ -/* - * Copyright (C) 2010 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 _UI_INPUT_H -#define _UI_INPUT_H - -/** - * Native input event structures. - */ - -#include -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_ANDROID_OS -class SkMatrix; -#endif - -/* - * Additional private constants not defined in ndk/ui/input.h. - */ -enum { - /* Private control to determine when an app is tracking a key sequence. */ - AKEY_EVENT_FLAG_START_TRACKING = 0x40000000, - - /* Key event is inconsistent with previously sent key events. */ - AKEY_EVENT_FLAG_TAINTED = 0x80000000, -}; - -enum { - /* Motion event is inconsistent with previously sent motion events. */ - AMOTION_EVENT_FLAG_TAINTED = 0x80000000, -}; - -enum { - /* - * Indicates that an input device has switches. - * This input source flag is hidden from the API because switches are only used by the system - * and applications have no way to interact with them. - */ - AINPUT_SOURCE_SWITCH = 0x80000000, -}; - -/* - * SystemUiVisibility constants from View. - */ -enum { - ASYSTEM_UI_VISIBILITY_STATUS_BAR_VISIBLE = 0, - ASYSTEM_UI_VISIBILITY_STATUS_BAR_HIDDEN = 0x00000001, -}; - -/* - * Maximum number of pointers supported per motion event. - * Smallest number of pointers is 1. - * (We want at least 10 but some touch controllers obstensibly configured for 10 pointers - * will occasionally emit 11. There is not much harm making this constant bigger.) - */ -#define MAX_POINTERS 16 - -/* - * Maximum pointer id value supported in a motion event. - * Smallest pointer id is 0. - * (This is limited by our use of BitSet32 to track pointer assignments.) - */ -#define MAX_POINTER_ID 31 - -/* - * Declare a concrete type for the NDK's input event forward declaration. - */ -struct AInputEvent { - virtual ~AInputEvent() { } -}; - -/* - * Declare a concrete type for the NDK's input device forward declaration. - */ -struct AInputDevice { - virtual ~AInputDevice() { } -}; - - -namespace android { - -#ifdef HAVE_ANDROID_OS -class Parcel; -#endif - -/* - * Flags that flow alongside events in the input dispatch system to help with certain - * policy decisions such as waking from device sleep. - * - * These flags are also defined in frameworks/base/core/java/android/view/WindowManagerPolicy.java. - */ -enum { - /* These flags originate in RawEvents and are generally set in the key map. - * NOTE: If you edit these flags, also edit labels in KeycodeLabels.h. */ - - POLICY_FLAG_WAKE = 0x00000001, - POLICY_FLAG_WAKE_DROPPED = 0x00000002, - POLICY_FLAG_SHIFT = 0x00000004, - POLICY_FLAG_CAPS_LOCK = 0x00000008, - POLICY_FLAG_ALT = 0x00000010, - POLICY_FLAG_ALT_GR = 0x00000020, - POLICY_FLAG_MENU = 0x00000040, - POLICY_FLAG_LAUNCHER = 0x00000080, - POLICY_FLAG_VIRTUAL = 0x00000100, - POLICY_FLAG_FUNCTION = 0x00000200, - - POLICY_FLAG_RAW_MASK = 0x0000ffff, - - /* These flags are set by the input dispatcher. */ - - // Indicates that the input event was injected. - POLICY_FLAG_INJECTED = 0x01000000, - - // Indicates that the input event is from a trusted source such as a directly attached - // input device or an application with system-wide event injection permission. - POLICY_FLAG_TRUSTED = 0x02000000, - - // Indicates that the input event has passed through an input filter. - POLICY_FLAG_FILTERED = 0x04000000, - - // Disables automatic key repeating behavior. - POLICY_FLAG_DISABLE_KEY_REPEAT = 0x08000000, - - /* These flags are set by the input reader policy as it intercepts each event. */ - - // Indicates that the screen was off when the event was received and the event - // should wake the device. - POLICY_FLAG_WOKE_HERE = 0x10000000, - - // Indicates that the screen was dim when the event was received and the event - // should brighten the device. - POLICY_FLAG_BRIGHT_HERE = 0x20000000, - - // Indicates that the event should be dispatched to applications. - // The input event should still be sent to the InputDispatcher so that it can see all - // input events received include those that it will not deliver. - POLICY_FLAG_PASS_TO_USER = 0x40000000, -}; - -/* - * Describes the basic configuration of input devices that are present. - */ -struct InputConfiguration { - enum { - TOUCHSCREEN_UNDEFINED = 0, - TOUCHSCREEN_NOTOUCH = 1, - TOUCHSCREEN_STYLUS = 2, - TOUCHSCREEN_FINGER = 3 - }; - - enum { - KEYBOARD_UNDEFINED = 0, - KEYBOARD_NOKEYS = 1, - KEYBOARD_QWERTY = 2, - KEYBOARD_12KEY = 3 - }; - - enum { - NAVIGATION_UNDEFINED = 0, - NAVIGATION_NONAV = 1, - NAVIGATION_DPAD = 2, - NAVIGATION_TRACKBALL = 3, - NAVIGATION_WHEEL = 4 - }; - - int32_t touchScreen; - int32_t keyboard; - int32_t navigation; -}; - -/* - * Pointer coordinate data. - */ -struct PointerCoords { - enum { MAX_AXES = 14 }; // 14 so that sizeof(PointerCoords) == 64 - - // Bitfield of axes that are present in this structure. - uint64_t bits; - - // Values of axes that are stored in this structure packed in order by axis id - // for each axis that is present in the structure according to 'bits'. - float values[MAX_AXES]; - - inline void clear() { - bits = 0; - } - - float getAxisValue(int32_t axis) const; - status_t setAxisValue(int32_t axis, float value); - - void scale(float scale); - - inline float getX() const { - return getAxisValue(AMOTION_EVENT_AXIS_X); - } - - inline float getY() const { - return getAxisValue(AMOTION_EVENT_AXIS_Y); - } - -#ifdef HAVE_ANDROID_OS - status_t readFromParcel(Parcel* parcel); - status_t writeToParcel(Parcel* parcel) const; -#endif - - bool operator==(const PointerCoords& other) const; - inline bool operator!=(const PointerCoords& other) const { - return !(*this == other); - } - - void copyFrom(const PointerCoords& other); - -private: - void tooManyAxes(int axis); -}; - -/* - * Pointer property data. - */ -struct PointerProperties { - // The id of the pointer. - int32_t id; - - // The pointer tool type. - int32_t toolType; - - inline void clear() { - id = -1; - toolType = 0; - } - - bool operator==(const PointerProperties& other) const; - inline bool operator!=(const PointerProperties& other) const { - return !(*this == other); - } - - void copyFrom(const PointerProperties& other); -}; - -/* - * Input events. - */ -class InputEvent : public AInputEvent { -public: - virtual ~InputEvent() { } - - virtual int32_t getType() const = 0; - - inline int32_t getDeviceId() const { return mDeviceId; } - - inline int32_t getSource() const { return mSource; } - - inline void setSource(int32_t source) { mSource = source; } - -protected: - void initialize(int32_t deviceId, int32_t source); - void initialize(const InputEvent& from); - - int32_t mDeviceId; - int32_t mSource; -}; - -/* - * Key events. - */ -class KeyEvent : public InputEvent { -public: - virtual ~KeyEvent() { } - - virtual int32_t getType() const { return AINPUT_EVENT_TYPE_KEY; } - - inline int32_t getAction() const { return mAction; } - - inline int32_t getFlags() const { return mFlags; } - - inline int32_t getKeyCode() const { return mKeyCode; } - - inline int32_t getScanCode() const { return mScanCode; } - - inline int32_t getMetaState() const { return mMetaState; } - - inline int32_t getRepeatCount() const { return mRepeatCount; } - - inline nsecs_t getDownTime() const { return mDownTime; } - - inline nsecs_t getEventTime() const { return mEventTime; } - - // Return true if this event may have a default action implementation. - static bool hasDefaultAction(int32_t keyCode); - bool hasDefaultAction() const; - - // Return true if this event represents a system key. - static bool isSystemKey(int32_t keyCode); - bool isSystemKey() const; - - void initialize( - int32_t deviceId, - int32_t source, - int32_t action, - int32_t flags, - int32_t keyCode, - int32_t scanCode, - int32_t metaState, - int32_t repeatCount, - nsecs_t downTime, - nsecs_t eventTime); - void initialize(const KeyEvent& from); - -protected: - int32_t mAction; - int32_t mFlags; - int32_t mKeyCode; - int32_t mScanCode; - int32_t mMetaState; - int32_t mRepeatCount; - nsecs_t mDownTime; - nsecs_t mEventTime; -}; - -/* - * Motion events. - */ -class MotionEvent : public InputEvent { -public: - virtual ~MotionEvent() { } - - virtual int32_t getType() const { return AINPUT_EVENT_TYPE_MOTION; } - - inline int32_t getAction() const { return mAction; } - - inline int32_t getActionMasked() const { return mAction & AMOTION_EVENT_ACTION_MASK; } - - inline int32_t getActionIndex() const { - return (mAction & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) - >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT; - } - - inline void setAction(int32_t action) { mAction = action; } - - inline int32_t getFlags() const { return mFlags; } - - inline void setFlags(int32_t flags) { mFlags = flags; } - - inline int32_t getEdgeFlags() const { return mEdgeFlags; } - - inline void setEdgeFlags(int32_t edgeFlags) { mEdgeFlags = edgeFlags; } - - inline int32_t getMetaState() const { return mMetaState; } - - inline void setMetaState(int32_t metaState) { mMetaState = metaState; } - - inline int32_t getButtonState() const { return mButtonState; } - - inline float getXOffset() const { return mXOffset; } - - inline float getYOffset() const { return mYOffset; } - - inline float getXPrecision() const { return mXPrecision; } - - inline float getYPrecision() const { return mYPrecision; } - - inline nsecs_t getDownTime() const { return mDownTime; } - - inline void setDownTime(nsecs_t downTime) { mDownTime = downTime; } - - inline size_t getPointerCount() const { return mPointerProperties.size(); } - - inline const PointerProperties* getPointerProperties(size_t pointerIndex) const { - return &mPointerProperties[pointerIndex]; - } - - inline int32_t getPointerId(size_t pointerIndex) const { - return mPointerProperties[pointerIndex].id; - } - - inline int32_t getToolType(size_t pointerIndex) const { - return mPointerProperties[pointerIndex].toolType; - } - - inline nsecs_t getEventTime() const { return mSampleEventTimes[getHistorySize()]; } - - const PointerCoords* getRawPointerCoords(size_t pointerIndex) const; - - float getRawAxisValue(int32_t axis, size_t pointerIndex) const; - - inline float getRawX(size_t pointerIndex) const { - return getRawAxisValue(AMOTION_EVENT_AXIS_X, pointerIndex); - } - - inline float getRawY(size_t pointerIndex) const { - return getRawAxisValue(AMOTION_EVENT_AXIS_Y, pointerIndex); - } - - float getAxisValue(int32_t axis, size_t pointerIndex) const; - - inline float getX(size_t pointerIndex) const { - return getAxisValue(AMOTION_EVENT_AXIS_X, pointerIndex); - } - - inline float getY(size_t pointerIndex) const { - return getAxisValue(AMOTION_EVENT_AXIS_Y, pointerIndex); - } - - inline float getPressure(size_t pointerIndex) const { - return getAxisValue(AMOTION_EVENT_AXIS_PRESSURE, pointerIndex); - } - - inline float getSize(size_t pointerIndex) const { - return getAxisValue(AMOTION_EVENT_AXIS_SIZE, pointerIndex); - } - - inline float getTouchMajor(size_t pointerIndex) const { - return getAxisValue(AMOTION_EVENT_AXIS_TOUCH_MAJOR, pointerIndex); - } - - inline float getTouchMinor(size_t pointerIndex) const { - return getAxisValue(AMOTION_EVENT_AXIS_TOUCH_MINOR, pointerIndex); - } - - inline float getToolMajor(size_t pointerIndex) const { - return getAxisValue(AMOTION_EVENT_AXIS_TOOL_MAJOR, pointerIndex); - } - - inline float getToolMinor(size_t pointerIndex) const { - return getAxisValue(AMOTION_EVENT_AXIS_TOOL_MINOR, pointerIndex); - } - - inline float getOrientation(size_t pointerIndex) const { - return getAxisValue(AMOTION_EVENT_AXIS_ORIENTATION, pointerIndex); - } - - inline size_t getHistorySize() const { return mSampleEventTimes.size() - 1; } - - inline nsecs_t getHistoricalEventTime(size_t historicalIndex) const { - return mSampleEventTimes[historicalIndex]; - } - - const PointerCoords* getHistoricalRawPointerCoords( - size_t pointerIndex, size_t historicalIndex) const; - - float getHistoricalRawAxisValue(int32_t axis, size_t pointerIndex, - size_t historicalIndex) const; - - inline float getHistoricalRawX(size_t pointerIndex, size_t historicalIndex) const { - return getHistoricalRawAxisValue( - AMOTION_EVENT_AXIS_X, pointerIndex, historicalIndex); - } - - inline float getHistoricalRawY(size_t pointerIndex, size_t historicalIndex) const { - return getHistoricalRawAxisValue( - AMOTION_EVENT_AXIS_Y, pointerIndex, historicalIndex); - } - - float getHistoricalAxisValue(int32_t axis, size_t pointerIndex, size_t historicalIndex) const; - - inline float getHistoricalX(size_t pointerIndex, size_t historicalIndex) const { - return getHistoricalAxisValue( - AMOTION_EVENT_AXIS_X, pointerIndex, historicalIndex); - } - - inline float getHistoricalY(size_t pointerIndex, size_t historicalIndex) const { - return getHistoricalAxisValue( - AMOTION_EVENT_AXIS_Y, pointerIndex, historicalIndex); - } - - inline float getHistoricalPressure(size_t pointerIndex, size_t historicalIndex) const { - return getHistoricalAxisValue( - AMOTION_EVENT_AXIS_PRESSURE, pointerIndex, historicalIndex); - } - - inline float getHistoricalSize(size_t pointerIndex, size_t historicalIndex) const { - return getHistoricalAxisValue( - AMOTION_EVENT_AXIS_SIZE, pointerIndex, historicalIndex); - } - - inline float getHistoricalTouchMajor(size_t pointerIndex, size_t historicalIndex) const { - return getHistoricalAxisValue( - AMOTION_EVENT_AXIS_TOUCH_MAJOR, pointerIndex, historicalIndex); - } - - inline float getHistoricalTouchMinor(size_t pointerIndex, size_t historicalIndex) const { - return getHistoricalAxisValue( - AMOTION_EVENT_AXIS_TOUCH_MINOR, pointerIndex, historicalIndex); - } - - inline float getHistoricalToolMajor(size_t pointerIndex, size_t historicalIndex) const { - return getHistoricalAxisValue( - AMOTION_EVENT_AXIS_TOOL_MAJOR, pointerIndex, historicalIndex); - } - - inline float getHistoricalToolMinor(size_t pointerIndex, size_t historicalIndex) const { - return getHistoricalAxisValue( - AMOTION_EVENT_AXIS_TOOL_MINOR, pointerIndex, historicalIndex); - } - - inline float getHistoricalOrientation(size_t pointerIndex, size_t historicalIndex) const { - return getHistoricalAxisValue( - AMOTION_EVENT_AXIS_ORIENTATION, pointerIndex, historicalIndex); - } - - ssize_t findPointerIndex(int32_t pointerId) const; - - void initialize( - int32_t deviceId, - int32_t source, - int32_t action, - int32_t flags, - int32_t edgeFlags, - int32_t metaState, - int32_t buttonState, - float xOffset, - float yOffset, - float xPrecision, - float yPrecision, - nsecs_t downTime, - nsecs_t eventTime, - size_t pointerCount, - const PointerProperties* pointerProperties, - const PointerCoords* pointerCoords); - - void copyFrom(const MotionEvent* other, bool keepHistory); - - void addSample( - nsecs_t eventTime, - const PointerCoords* pointerCoords); - - void offsetLocation(float xOffset, float yOffset); - - void scale(float scaleFactor); - -#ifdef HAVE_ANDROID_OS - void transform(const SkMatrix* matrix); - - status_t readFromParcel(Parcel* parcel); - status_t writeToParcel(Parcel* parcel) const; -#endif - - static bool isTouchEvent(int32_t source, int32_t action); - inline bool isTouchEvent() const { - return isTouchEvent(mSource, mAction); - } - - // Low-level accessors. - inline const PointerProperties* getPointerProperties() const { - return mPointerProperties.array(); - } - inline const nsecs_t* getSampleEventTimes() const { return mSampleEventTimes.array(); } - inline const PointerCoords* getSamplePointerCoords() const { - return mSamplePointerCoords.array(); - } - -protected: - int32_t mAction; - int32_t mFlags; - int32_t mEdgeFlags; - int32_t mMetaState; - int32_t mButtonState; - float mXOffset; - float mYOffset; - float mXPrecision; - float mYPrecision; - nsecs_t mDownTime; - Vector mPointerProperties; - Vector mSampleEventTimes; - Vector mSamplePointerCoords; -}; - -/* - * Input event factory. - */ -class InputEventFactoryInterface { -protected: - virtual ~InputEventFactoryInterface() { } - -public: - InputEventFactoryInterface() { } - - virtual KeyEvent* createKeyEvent() = 0; - virtual MotionEvent* createMotionEvent() = 0; -}; - -/* - * A simple input event factory implementation that uses a single preallocated instance - * of each type of input event that are reused for each request. - */ -class PreallocatedInputEventFactory : public InputEventFactoryInterface { -public: - PreallocatedInputEventFactory() { } - virtual ~PreallocatedInputEventFactory() { } - - virtual KeyEvent* createKeyEvent() { return & mKeyEvent; } - virtual MotionEvent* createMotionEvent() { return & mMotionEvent; } - -private: - KeyEvent mKeyEvent; - MotionEvent mMotionEvent; -}; - -/* - * Calculates the velocity of pointer movements over time. - */ -class VelocityTracker { -public: - // Default polynomial degree. (used by getVelocity) - static const uint32_t DEFAULT_DEGREE = 2; - - // Default sample horizon. (used by getVelocity) - // We don't use too much history by default since we want to react to quick - // changes in direction. - static const nsecs_t DEFAULT_HORIZON = 100 * 1000000; // 100 ms - - struct Position { - float x, y; - }; - - struct Estimator { - static const size_t MAX_DEGREE = 2; - - // Polynomial coefficients describing motion in X and Y. - float xCoeff[MAX_DEGREE + 1], yCoeff[MAX_DEGREE + 1]; - - // Polynomial degree (number of coefficients), or zero if no information is - // available. - uint32_t degree; - - // Confidence (coefficient of determination), between 0 (no fit) and 1 (perfect fit). - float confidence; - - inline void clear() { - degree = 0; - confidence = 0; - for (size_t i = 0; i <= MAX_DEGREE; i++) { - xCoeff[i] = 0; - yCoeff[i] = 0; - } - } - }; - - VelocityTracker(); - - // Resets the velocity tracker state. - void clear(); - - // Resets the velocity tracker state for specific pointers. - // Call this method when some pointers have changed and may be reusing - // an id that was assigned to a different pointer earlier. - void clearPointers(BitSet32 idBits); - - // Adds movement information for a set of pointers. - // The idBits bitfield specifies the pointer ids of the pointers whose positions - // are included in the movement. - // The positions array contains position information for each pointer in order by - // increasing id. Its size should be equal to the number of one bits in idBits. - void addMovement(nsecs_t eventTime, BitSet32 idBits, const Position* positions); - - // Adds movement information for all pointers in a MotionEvent, including historical samples. - void addMovement(const MotionEvent* event); - - // Gets the velocity of the specified pointer id in position units per second. - // Returns false and sets the velocity components to zero if there is - // insufficient movement information for the pointer. - bool getVelocity(uint32_t id, float* outVx, float* outVy) const; - - // Gets a quadratic estimator for the movements of the specified pointer id. - // Returns false and clears the estimator if there is no information available - // about the pointer. - bool getEstimator(uint32_t id, uint32_t degree, nsecs_t horizon, - Estimator* outEstimator) const; - - // Gets the active pointer id, or -1 if none. - inline int32_t getActivePointerId() const { return mActivePointerId; } - - // Gets a bitset containing all pointer ids from the most recent movement. - inline BitSet32 getCurrentPointerIdBits() const { return mMovements[mIndex].idBits; } - -private: - // Number of samples to keep. - static const uint32_t HISTORY_SIZE = 20; - - struct Movement { - nsecs_t eventTime; - BitSet32 idBits; - Position positions[MAX_POINTERS]; - - inline const Position& getPosition(uint32_t id) const { - return positions[idBits.getIndexOfBit(id)]; - } - }; - - uint32_t mIndex; - Movement mMovements[HISTORY_SIZE]; - int32_t mActivePointerId; -}; - - -/* - * Specifies parameters that govern pointer or wheel acceleration. - */ -struct VelocityControlParameters { - // A scale factor that is multiplied with the raw velocity deltas - // prior to applying any other velocity control factors. The scale - // factor should be used to adapt the input device resolution - // (eg. counts per inch) to the output device resolution (eg. pixels per inch). - // - // Must be a positive value. - // Default is 1.0 (no scaling). - float scale; - - // The scaled speed at which acceleration begins to be applied. - // This value establishes the upper bound of a low speed regime for - // small precise motions that are performed without any acceleration. - // - // Must be a non-negative value. - // Default is 0.0 (no low threshold). - float lowThreshold; - - // The scaled speed at which maximum acceleration is applied. - // The difference between highThreshold and lowThreshold controls - // the range of speeds over which the acceleration factor is interpolated. - // The wider the range, the smoother the acceleration. - // - // Must be a non-negative value greater than or equal to lowThreshold. - // Default is 0.0 (no high threshold). - float highThreshold; - - // The acceleration factor. - // When the speed is above the low speed threshold, the velocity will scaled - // by an interpolated value between 1.0 and this amount. - // - // Must be a positive greater than or equal to 1.0. - // Default is 1.0 (no acceleration). - float acceleration; - - VelocityControlParameters() : - scale(1.0f), lowThreshold(0.0f), highThreshold(0.0f), acceleration(1.0f) { - } - - VelocityControlParameters(float scale, float lowThreshold, - float highThreshold, float acceleration) : - scale(scale), lowThreshold(lowThreshold), - highThreshold(highThreshold), acceleration(acceleration) { - } -}; - -/* - * Implements mouse pointer and wheel speed control and acceleration. - */ -class VelocityControl { -public: - VelocityControl(); - - /* Sets the various parameters. */ - void setParameters(const VelocityControlParameters& parameters); - - /* Resets the current movement counters to zero. - * This has the effect of nullifying any acceleration. */ - void reset(); - - /* Translates a raw movement delta into an appropriately - * scaled / accelerated delta based on the current velocity. */ - void move(nsecs_t eventTime, float* deltaX, float* deltaY); - -private: - // If no movements are received within this amount of time, - // we assume the movement has stopped and reset the movement counters. - static const nsecs_t STOP_TIME = 500 * 1000000; // 500 ms - - VelocityControlParameters mParameters; - - nsecs_t mLastMovementTime; - VelocityTracker::Position mRawPosition; - VelocityTracker mVelocityTracker; -}; - - -/* - * Describes the characteristics and capabilities of an input device. - */ -class InputDeviceInfo { -public: - InputDeviceInfo(); - InputDeviceInfo(const InputDeviceInfo& other); - ~InputDeviceInfo(); - - struct MotionRange { - int32_t axis; - uint32_t source; - float min; - float max; - float flat; - float fuzz; - }; - - void initialize(int32_t id, const String8& name); - - inline int32_t getId() const { return mId; } - inline const String8 getName() const { return mName; } - inline uint32_t getSources() const { return mSources; } - - const MotionRange* getMotionRange(int32_t axis, uint32_t source) const; - - void addSource(uint32_t source); - void addMotionRange(int32_t axis, uint32_t source, - float min, float max, float flat, float fuzz); - void addMotionRange(const MotionRange& range); - - inline void setKeyboardType(int32_t keyboardType) { mKeyboardType = keyboardType; } - inline int32_t getKeyboardType() const { return mKeyboardType; } - - inline const Vector& getMotionRanges() const { - return mMotionRanges; - } - -private: - int32_t mId; - String8 mName; - uint32_t mSources; - int32_t mKeyboardType; - - Vector mMotionRanges; -}; - -/* - * Identifies a device. - */ -struct InputDeviceIdentifier { - inline InputDeviceIdentifier() : - bus(0), vendor(0), product(0), version(0) { - } - - String8 name; - String8 location; - String8 uniqueId; - uint16_t bus; - uint16_t vendor; - uint16_t product; - uint16_t version; -}; - -/* Types of input device configuration files. */ -enum InputDeviceConfigurationFileType { - INPUT_DEVICE_CONFIGURATION_FILE_TYPE_CONFIGURATION = 0, /* .idc file */ - INPUT_DEVICE_CONFIGURATION_FILE_TYPE_KEY_LAYOUT = 1, /* .kl file */ - INPUT_DEVICE_CONFIGURATION_FILE_TYPE_KEY_CHARACTER_MAP = 2, /* .kcm file */ -}; - -/* - * Gets the path of an input device configuration file, if one is available. - * Considers both system provided and user installed configuration files. - * - * The device identifier is used to construct several default configuration file - * names to try based on the device name, vendor, product, and version. - * - * Returns an empty string if not found. - */ -extern String8 getInputDeviceConfigurationFilePathByDeviceIdentifier( - const InputDeviceIdentifier& deviceIdentifier, - InputDeviceConfigurationFileType type); - -/* - * Gets the path of an input device configuration file, if one is available. - * Considers both system provided and user installed configuration files. - * - * The name is case-sensitive and is used to construct the filename to resolve. - * All characters except 'a'-'z', 'A'-'Z', '0'-'9', '-', and '_' are replaced by underscores. - * - * Returns an empty string if not found. - */ -extern String8 getInputDeviceConfigurationFilePathByName( - const String8& name, InputDeviceConfigurationFileType type); - -} // namespace android - -#endif // _UI_INPUT_H diff --git a/external/android/include/14/frameworks/base/include/ui/InputTransport.h b/external/android/include/14/frameworks/base/include/ui/InputTransport.h deleted file mode 100644 index 95e4447..0000000 --- a/external/android/include/14/frameworks/base/include/ui/InputTransport.h +++ /dev/null @@ -1,338 +0,0 @@ -/* - * Copyright (C) 2010 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 _UI_INPUT_TRANSPORT_H -#define _UI_INPUT_TRANSPORT_H - -/** - * Native input transport. - * - * Uses anonymous shared memory as a whiteboard for sending input events from an - * InputPublisher to an InputConsumer and ensuring appropriate synchronization. - * One interesting feature is that published events can be updated in place as long as they - * have not yet been consumed. - * - * The InputPublisher and InputConsumer only take care of transferring event data - * over an InputChannel and sending synchronization signals. The InputDispatcher and InputQueue - * build on these abstractions to add multiplexing and queueing. - */ - -#include -#include -#include -#include -#include -#include - -namespace android { - -/* - * An input channel consists of a shared memory buffer and a pair of pipes - * used to send input messages from an InputPublisher to an InputConsumer - * across processes. Each channel has a descriptive name for debugging purposes. - * - * Each endpoint has its own InputChannel object that specifies its own file descriptors. - * - * The input channel is closed when all references to it are released. - */ -class InputChannel : public RefBase { -protected: - virtual ~InputChannel(); - -public: - InputChannel(const String8& name, int32_t ashmemFd, int32_t receivePipeFd, - int32_t sendPipeFd); - - /* Creates a pair of input channels and their underlying shared memory buffers - * and pipes. - * - * Returns OK on success. - */ - static status_t openInputChannelPair(const String8& name, - sp& outServerChannel, sp& outClientChannel); - - inline String8 getName() const { return mName; } - inline int32_t getAshmemFd() const { return mAshmemFd; } - inline int32_t getReceivePipeFd() const { return mReceivePipeFd; } - inline int32_t getSendPipeFd() const { return mSendPipeFd; } - - /* Sends a signal to the other endpoint. - * - * Returns OK on success. - * Returns DEAD_OBJECT if the channel's peer has been closed. - * Other errors probably indicate that the channel is broken. - */ - status_t sendSignal(char signal); - - /* Receives a signal send by the other endpoint. - * (Should only call this after poll() indicates that the receivePipeFd has available input.) - * - * Returns OK on success. - * Returns WOULD_BLOCK if there is no signal present. - * Returns DEAD_OBJECT if the channel's peer has been closed. - * Other errors probably indicate that the channel is broken. - */ - status_t receiveSignal(char* outSignal); - -private: - String8 mName; - int32_t mAshmemFd; - int32_t mReceivePipeFd; - int32_t mSendPipeFd; -}; - -/* - * Private intermediate representation of input events as messages written into an - * ashmem buffer. - */ -struct InputMessage { - /* Semaphore count is set to 1 when the message is published. - * It becomes 0 transiently while the publisher updates the message. - * It becomes 0 permanently when the consumer consumes the message. - */ - sem_t semaphore; - - /* Initialized to false by the publisher. - * Set to true by the consumer when it consumes the message. - */ - bool consumed; - - int32_t type; - - struct SampleData { - nsecs_t eventTime; - PointerCoords coords[0]; // variable length - }; - - int32_t deviceId; - int32_t source; - - union { - struct { - int32_t action; - int32_t flags; - int32_t keyCode; - int32_t scanCode; - int32_t metaState; - int32_t repeatCount; - nsecs_t downTime; - nsecs_t eventTime; - } key; - - struct { - int32_t action; - int32_t flags; - int32_t metaState; - int32_t buttonState; - int32_t edgeFlags; - nsecs_t downTime; - float xOffset; - float yOffset; - float xPrecision; - float yPrecision; - size_t pointerCount; - PointerProperties pointerProperties[MAX_POINTERS]; - size_t sampleCount; - SampleData sampleData[0]; // variable length - } motion; - }; - - /* Gets the number of bytes to add to step to the next SampleData object in a motion - * event message for a given number of pointers. - */ - static inline size_t sampleDataStride(size_t pointerCount) { - return sizeof(InputMessage::SampleData) + pointerCount * sizeof(PointerCoords); - } - - /* Adds the SampleData stride to the given pointer. */ - static inline SampleData* sampleDataPtrIncrement(SampleData* ptr, size_t stride) { - return reinterpret_cast(reinterpret_cast(ptr) + stride); - } -}; - -/* - * Publishes input events to an anonymous shared memory buffer. - * Uses atomic operations to coordinate shared access with a single concurrent consumer. - */ -class InputPublisher { -public: - /* Creates a publisher associated with an input channel. */ - explicit InputPublisher(const sp& channel); - - /* Destroys the publisher and releases its input channel. */ - ~InputPublisher(); - - /* Gets the underlying input channel. */ - inline sp getChannel() { return mChannel; } - - /* Prepares the publisher for use. Must be called before it is used. - * Returns OK on success. - * - * This method implicitly calls reset(). */ - status_t initialize(); - - /* Resets the publisher to its initial state and unpins its ashmem buffer. - * Returns OK on success. - * - * Should be called after an event has been consumed to release resources used by the - * publisher until the next event is ready to be published. - */ - status_t reset(); - - /* Publishes a key event to the ashmem buffer. - * - * Returns OK on success. - * Returns INVALID_OPERATION if the publisher has not been reset. - */ - status_t publishKeyEvent( - int32_t deviceId, - int32_t source, - int32_t action, - int32_t flags, - int32_t keyCode, - int32_t scanCode, - int32_t metaState, - int32_t repeatCount, - nsecs_t downTime, - nsecs_t eventTime); - - /* Publishes a motion event to the ashmem buffer. - * - * Returns OK on success. - * Returns INVALID_OPERATION if the publisher has not been reset. - * Returns BAD_VALUE if pointerCount is less than 1 or greater than MAX_POINTERS. - */ - status_t publishMotionEvent( - int32_t deviceId, - int32_t source, - int32_t action, - int32_t flags, - int32_t edgeFlags, - int32_t metaState, - int32_t buttonState, - float xOffset, - float yOffset, - float xPrecision, - float yPrecision, - nsecs_t downTime, - nsecs_t eventTime, - size_t pointerCount, - const PointerProperties* pointerProperties, - const PointerCoords* pointerCoords); - - /* Appends a motion sample to a motion event unless already consumed. - * - * Returns OK on success. - * Returns INVALID_OPERATION if the current event is not a AMOTION_EVENT_ACTION_MOVE event. - * Returns FAILED_TRANSACTION if the current event has already been consumed. - * Returns NO_MEMORY if the buffer is full and no additional samples can be added. - */ - status_t appendMotionSample( - nsecs_t eventTime, - const PointerCoords* pointerCoords); - - /* Sends a dispatch signal to the consumer to inform it that a new message is available. - * - * Returns OK on success. - * Errors probably indicate that the channel is broken. - */ - status_t sendDispatchSignal(); - - /* Receives the finished signal from the consumer in reply to the original dispatch signal. - * Returns whether the consumer handled the message. - * - * Returns OK on success. - * Returns WOULD_BLOCK if there is no signal present. - * Other errors probably indicate that the channel is broken. - */ - status_t receiveFinishedSignal(bool* outHandled); - -private: - sp mChannel; - - size_t mAshmemSize; - InputMessage* mSharedMessage; - bool mPinned; - bool mSemaphoreInitialized; - bool mWasDispatched; - - size_t mMotionEventPointerCount; - InputMessage::SampleData* mMotionEventSampleDataTail; - size_t mMotionEventSampleDataStride; - - status_t publishInputEvent( - int32_t type, - int32_t deviceId, - int32_t source); -}; - -/* - * Consumes input events from an anonymous shared memory buffer. - * Uses atomic operations to coordinate shared access with a single concurrent publisher. - */ -class InputConsumer { -public: - /* Creates a consumer associated with an input channel. */ - explicit InputConsumer(const sp& channel); - - /* Destroys the consumer and releases its input channel. */ - ~InputConsumer(); - - /* Gets the underlying input channel. */ - inline sp getChannel() { return mChannel; } - - /* Prepares the consumer for use. Must be called before it is used. */ - status_t initialize(); - - /* Consumes the input event in the buffer and copies its contents into - * an InputEvent object created using the specified factory. - * This operation will block if the publisher is updating the event. - * - * Returns OK on success. - * Returns INVALID_OPERATION if there is no currently published event. - * Returns NO_MEMORY if the event could not be created. - */ - status_t consume(InputEventFactoryInterface* factory, InputEvent** outEvent); - - /* Sends a finished signal to the publisher to inform it that the current message is - * finished processing and specifies whether the message was handled by the consumer. - * - * Returns OK on success. - * Errors probably indicate that the channel is broken. - */ - status_t sendFinishedSignal(bool handled); - - /* Receives the dispatched signal from the publisher. - * - * Returns OK on success. - * Returns WOULD_BLOCK if there is no signal present. - * Other errors probably indicate that the channel is broken. - */ - status_t receiveDispatchSignal(); - -private: - sp mChannel; - - size_t mAshmemSize; - InputMessage* mSharedMessage; - - void populateKeyEvent(KeyEvent* keyEvent) const; - void populateMotionEvent(MotionEvent* motionEvent) const; -}; - -} // namespace android - -#endif // _UI_INPUT_TRANSPORT_H diff --git a/external/android/include/14/frameworks/base/include/ui/KeyCharacterMap.h b/external/android/include/14/frameworks/base/include/ui/KeyCharacterMap.h deleted file mode 100644 index 10a3810..0000000 --- a/external/android/include/14/frameworks/base/include/ui/KeyCharacterMap.h +++ /dev/null @@ -1,200 +0,0 @@ -/* - * 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. - */ - -#ifndef _UI_KEY_CHARACTER_MAP_H -#define _UI_KEY_CHARACTER_MAP_H - -#include - -#include -#include -#include -#include -#include -#include - -namespace android { - -/** - * Describes a mapping from Android key codes to characters. - * Also specifies other functions of the keyboard such as the keyboard type - * and key modifier semantics. - */ -class KeyCharacterMap { -public: - enum KeyboardType { - KEYBOARD_TYPE_UNKNOWN = 0, - KEYBOARD_TYPE_NUMERIC = 1, - KEYBOARD_TYPE_PREDICTIVE = 2, - KEYBOARD_TYPE_ALPHA = 3, - KEYBOARD_TYPE_FULL = 4, - KEYBOARD_TYPE_SPECIAL_FUNCTION = 5, - }; - - // Substitute key code and meta state for fallback action. - struct FallbackAction { - int32_t keyCode; - int32_t metaState; - }; - - ~KeyCharacterMap(); - - static status_t load(const String8& filename, KeyCharacterMap** outMap); - static status_t loadByDeviceId(int32_t deviceId, KeyCharacterMap** outMap); - - /* Gets the keyboard type. */ - int32_t getKeyboardType() const; - - /* Gets the primary character for this key as in the label physically printed on it. - * Returns 0 if none (eg. for non-printing keys). */ - char16_t getDisplayLabel(int32_t keyCode) const; - - /* Gets the Unicode character for the number or symbol generated by the key - * when the keyboard is used as a dialing pad. - * Returns 0 if no number or symbol is generated. - */ - char16_t getNumber(int32_t keyCode) const; - - /* Gets the Unicode character generated by the key and meta key modifiers. - * Returns 0 if no character is generated. - */ - char16_t getCharacter(int32_t keyCode, int32_t metaState) const; - - /* Gets the fallback action to use by default if the application does not - * handle the specified key. - * Returns true if an action was available, false if none. - */ - bool getFallbackAction(int32_t keyCode, int32_t metaState, - FallbackAction* outFallbackAction) const; - - /* Gets the first matching Unicode character that can be generated by the key, - * preferring the one with the specified meta key modifiers. - * Returns 0 if no matching character is generated. - */ - char16_t getMatch(int32_t keyCode, const char16_t* chars, - size_t numChars, int32_t metaState) const; - - /* Gets a sequence of key events that could plausibly generate the specified - * character sequence. Returns false if some of the characters cannot be generated. - */ - bool getEvents(int32_t deviceId, const char16_t* chars, size_t numChars, - Vector& outEvents) const; - -private: - struct Behavior { - Behavior(); - - /* The next behavior in the list, or NULL if none. */ - Behavior* next; - - /* The meta key modifiers for this behavior. */ - int32_t metaState; - - /* The character to insert. */ - char16_t character; - - /* The fallback keycode if the key is not handled. */ - int32_t fallbackKeyCode; - }; - - struct Key { - Key(); - ~Key(); - - /* The single character label printed on the key, or 0 if none. */ - char16_t label; - - /* The number or symbol character generated by the key, or 0 if none. */ - char16_t number; - - /* The list of key behaviors sorted from most specific to least specific - * meta key binding. */ - Behavior* firstBehavior; - }; - - class Parser { - enum State { - STATE_TOP = 0, - STATE_KEY = 1, - }; - - enum { - PROPERTY_LABEL = 1, - PROPERTY_NUMBER = 2, - PROPERTY_META = 3, - }; - - struct Property { - inline Property(int32_t property = 0, int32_t metaState = 0) : - property(property), metaState(metaState) { } - - int32_t property; - int32_t metaState; - }; - - KeyCharacterMap* mMap; - Tokenizer* mTokenizer; - State mState; - int32_t mKeyCode; - - public: - Parser(KeyCharacterMap* map, Tokenizer* tokenizer); - ~Parser(); - status_t parse(); - - private: - status_t parseType(); - status_t parseKey(); - status_t parseKeyProperty(); - status_t parseModifier(const String8& token, int32_t* outMetaState); - status_t parseCharacterLiteral(char16_t* outCharacter); - }; - - KeyedVector mKeys; - int mType; - - KeyCharacterMap(); - - bool getKey(int32_t keyCode, const Key** outKey) const; - bool getKeyBehavior(int32_t keyCode, int32_t metaState, - const Key** outKey, const Behavior** outBehavior) const; - - bool findKey(char16_t ch, int32_t* outKeyCode, int32_t* outMetaState) const; - - static void addKey(Vector& outEvents, - int32_t deviceId, int32_t keyCode, int32_t metaState, bool down, nsecs_t time); - static void addMetaKeys(Vector& outEvents, - int32_t deviceId, int32_t metaState, bool down, nsecs_t time, - int32_t* currentMetaState); - static bool addSingleEphemeralMetaKey(Vector& outEvents, - int32_t deviceId, int32_t metaState, bool down, nsecs_t time, - int32_t keyCode, int32_t keyMetaState, - int32_t* currentMetaState); - static void addDoubleEphemeralMetaKey(Vector& outEvents, - int32_t deviceId, int32_t metaState, bool down, nsecs_t time, - int32_t leftKeyCode, int32_t leftKeyMetaState, - int32_t rightKeyCode, int32_t rightKeyMetaState, - int32_t eitherKeyMetaState, - int32_t* currentMetaState); - static void addLockedMetaKey(Vector& outEvents, - int32_t deviceId, int32_t metaState, nsecs_t time, - int32_t keyCode, int32_t keyMetaState, - int32_t* currentMetaState); -}; - -} // namespace android - -#endif // _UI_KEY_CHARACTER_MAP_H diff --git a/external/android/include/14/frameworks/base/include/ui/KeyLayoutMap.h b/external/android/include/14/frameworks/base/include/ui/KeyLayoutMap.h deleted file mode 100644 index d82d0c8..0000000 --- a/external/android/include/14/frameworks/base/include/ui/KeyLayoutMap.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * 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. - */ - -#ifndef _UI_KEY_LAYOUT_MAP_H -#define _UI_KEY_LAYOUT_MAP_H - -#include -#include -#include -#include - -namespace android { - -struct AxisInfo { - enum Mode { - // Axis value is reported directly. - MODE_NORMAL = 0, - // Axis value should be inverted before reporting. - MODE_INVERT = 1, - // Axis value should be split into two axes - MODE_SPLIT = 2, - }; - - // Axis mode. - Mode mode; - - // Axis id. - // When split, this is the axis used for values smaller than the split position. - int32_t axis; - - // When split, this is the axis used for values after higher than the split position. - int32_t highAxis; - - // The split value, or 0 if not split. - int32_t splitValue; - - // The flat value, or -1 if none. - int32_t flatOverride; - - AxisInfo() : mode(MODE_NORMAL), axis(-1), highAxis(-1), splitValue(0), flatOverride(-1) { - } -}; - -/** - * Describes a mapping from keyboard scan codes and joystick axes to Android key codes and axes. - */ -class KeyLayoutMap { -public: - ~KeyLayoutMap(); - - static status_t load(const String8& filename, KeyLayoutMap** outMap); - - status_t mapKey(int32_t scanCode, int32_t* keyCode, uint32_t* flags) const; - status_t findScanCodesForKey(int32_t keyCode, Vector* outScanCodes) const; - - status_t mapAxis(int32_t scanCode, AxisInfo* outAxisInfo) const; - -private: - struct Key { - int32_t keyCode; - uint32_t flags; - }; - - KeyedVector mKeys; - KeyedVector mAxes; - - KeyLayoutMap(); - - class Parser { - KeyLayoutMap* mMap; - Tokenizer* mTokenizer; - - public: - Parser(KeyLayoutMap* map, Tokenizer* tokenizer); - ~Parser(); - status_t parse(); - - private: - status_t parseKey(); - status_t parseAxis(); - }; -}; - -} // namespace android - -#endif // _UI_KEY_LAYOUT_MAP_H diff --git a/external/android/include/14/frameworks/base/include/ui/Keyboard.h b/external/android/include/14/frameworks/base/include/ui/Keyboard.h deleted file mode 100644 index 609f319..0000000 --- a/external/android/include/14/frameworks/base/include/ui/Keyboard.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (C) 2010 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 _UI_KEYBOARD_H -#define _UI_KEYBOARD_H - -#include -#include -#include -#include - -namespace android { - -enum { - /* Device id of the built in keyboard. */ - DEVICE_ID_BUILT_IN_KEYBOARD = 0, - - /* Device id of a generic virtual keyboard with a full layout that can be used - * to synthesize key events. */ - DEVICE_ID_VIRTUAL_KEYBOARD = -1, -}; - -class KeyLayoutMap; -class KeyCharacterMap; - -/** - * Loads the key layout map and key character map for a keyboard device. - */ -class KeyMap { -public: - String8 keyLayoutFile; - KeyLayoutMap* keyLayoutMap; - - String8 keyCharacterMapFile; - KeyCharacterMap* keyCharacterMap; - - KeyMap(); - ~KeyMap(); - - status_t load(const InputDeviceIdentifier& deviceIdenfier, - const PropertyMap* deviceConfiguration); - - inline bool haveKeyLayout() const { - return !keyLayoutFile.isEmpty(); - } - - inline bool haveKeyCharacterMap() const { - return !keyCharacterMapFile.isEmpty(); - } - - inline bool isComplete() const { - return haveKeyLayout() && haveKeyCharacterMap(); - } - -private: - bool probeKeyMap(const InputDeviceIdentifier& deviceIdentifier, const String8& name); - status_t loadKeyLayout(const InputDeviceIdentifier& deviceIdentifier, const String8& name); - status_t loadKeyCharacterMap(const InputDeviceIdentifier& deviceIdentifier, - const String8& name); - String8 getPath(const InputDeviceIdentifier& deviceIdentifier, - const String8& name, InputDeviceConfigurationFileType type); -}; - -/** - * Returns true if the keyboard is eligible for use as a built-in keyboard. - */ -extern bool isEligibleBuiltInKeyboard(const InputDeviceIdentifier& deviceIdentifier, - const PropertyMap* deviceConfiguration, const KeyMap* keyMap); - -/** - * Sets keyboard system properties. - */ -extern void setKeyboardProperties(int32_t deviceId, const InputDeviceIdentifier& deviceIdentifier, - const String8& keyLayoutFile, const String8& keyCharacterMapFile); - -/** - * Clears keyboard system properties. - */ -extern void clearKeyboardProperties(int32_t deviceId); - -/** - * Gets the key character map filename for a device using inspecting system properties - * and then falling back on a default key character map if necessary. - * Returns a NAME_NOT_FOUND if none found. - */ -extern status_t getKeyCharacterMapFile(int32_t deviceId, String8& outKeyCharacterMapFile); - -/** - * Gets a key code by its short form label, eg. "HOME". - * Returns 0 if unknown. - */ -extern int32_t getKeyCodeByLabel(const char* label); - -/** - * Gets a key flag by its short form label, eg. "WAKE". - * Returns 0 if unknown. - */ -extern uint32_t getKeyFlagByLabel(const char* label); - -/** - * Gets a axis by its short form label, eg. "X". - * Returns -1 if unknown. - */ -extern int32_t getAxisByLabel(const char* label); - -/** - * Gets a axis label by its id. - * Returns NULL if unknown. - */ -extern const char* getAxisLabel(int32_t axisId); - -/** - * Updates a meta state field when a key is pressed or released. - */ -extern int32_t updateMetaState(int32_t keyCode, bool down, int32_t oldMetaState); - -/** - * Returns true if a key is a meta key like ALT or CAPS_LOCK. - */ -extern bool isMetaKey(int32_t keyCode); - -} // namespace android - -#endif // _UI_KEYBOARD_H diff --git a/external/android/include/14/frameworks/base/include/ui/KeycodeLabels.h b/external/android/include/14/frameworks/base/include/ui/KeycodeLabels.h deleted file mode 100755 index 2efe8ca..0000000 --- a/external/android/include/14/frameworks/base/include/ui/KeycodeLabels.h +++ /dev/null @@ -1,306 +0,0 @@ -/* - * 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. - */ - -#ifndef _UI_KEYCODE_LABELS_H -#define _UI_KEYCODE_LABELS_H - -#include - -struct KeycodeLabel { - const char *literal; - int value; -}; - -static const KeycodeLabel KEYCODES[] = { - { "SOFT_LEFT", 1 }, - { "SOFT_RIGHT", 2 }, - { "HOME", 3 }, - { "BACK", 4 }, - { "CALL", 5 }, - { "ENDCALL", 6 }, - { "0", 7 }, - { "1", 8 }, - { "2", 9 }, - { "3", 10 }, - { "4", 11 }, - { "5", 12 }, - { "6", 13 }, - { "7", 14 }, - { "8", 15 }, - { "9", 16 }, - { "STAR", 17 }, - { "POUND", 18 }, - { "DPAD_UP", 19 }, - { "DPAD_DOWN", 20 }, - { "DPAD_LEFT", 21 }, - { "DPAD_RIGHT", 22 }, - { "DPAD_CENTER", 23 }, - { "VOLUME_UP", 24 }, - { "VOLUME_DOWN", 25 }, - { "POWER", 26 }, - { "CAMERA", 27 }, - { "CLEAR", 28 }, - { "A", 29 }, - { "B", 30 }, - { "C", 31 }, - { "D", 32 }, - { "E", 33 }, - { "F", 34 }, - { "G", 35 }, - { "H", 36 }, - { "I", 37 }, - { "J", 38 }, - { "K", 39 }, - { "L", 40 }, - { "M", 41 }, - { "N", 42 }, - { "O", 43 }, - { "P", 44 }, - { "Q", 45 }, - { "R", 46 }, - { "S", 47 }, - { "T", 48 }, - { "U", 49 }, - { "V", 50 }, - { "W", 51 }, - { "X", 52 }, - { "Y", 53 }, - { "Z", 54 }, - { "COMMA", 55 }, - { "PERIOD", 56 }, - { "ALT_LEFT", 57 }, - { "ALT_RIGHT", 58 }, - { "SHIFT_LEFT", 59 }, - { "SHIFT_RIGHT", 60 }, - { "TAB", 61 }, - { "SPACE", 62 }, - { "SYM", 63 }, - { "EXPLORER", 64 }, - { "ENVELOPE", 65 }, - { "ENTER", 66 }, - { "DEL", 67 }, - { "GRAVE", 68 }, - { "MINUS", 69 }, - { "EQUALS", 70 }, - { "LEFT_BRACKET", 71 }, - { "RIGHT_BRACKET", 72 }, - { "BACKSLASH", 73 }, - { "SEMICOLON", 74 }, - { "APOSTROPHE", 75 }, - { "SLASH", 76 }, - { "AT", 77 }, - { "NUM", 78 }, - { "HEADSETHOOK", 79 }, - { "FOCUS", 80 }, - { "PLUS", 81 }, - { "MENU", 82 }, - { "NOTIFICATION", 83 }, - { "SEARCH", 84 }, - { "MEDIA_PLAY_PAUSE", 85 }, - { "MEDIA_STOP", 86 }, - { "MEDIA_NEXT", 87 }, - { "MEDIA_PREVIOUS", 88 }, - { "MEDIA_REWIND", 89 }, - { "MEDIA_FAST_FORWARD", 90 }, - { "MUTE", 91 }, - { "PAGE_UP", 92 }, - { "PAGE_DOWN", 93 }, - { "PICTSYMBOLS", 94 }, - { "SWITCH_CHARSET", 95 }, - { "BUTTON_A", 96 }, - { "BUTTON_B", 97 }, - { "BUTTON_C", 98 }, - { "BUTTON_X", 99 }, - { "BUTTON_Y", 100 }, - { "BUTTON_Z", 101 }, - { "BUTTON_L1", 102 }, - { "BUTTON_R1", 103 }, - { "BUTTON_L2", 104 }, - { "BUTTON_R2", 105 }, - { "BUTTON_THUMBL", 106 }, - { "BUTTON_THUMBR", 107 }, - { "BUTTON_START", 108 }, - { "BUTTON_SELECT", 109 }, - { "BUTTON_MODE", 110 }, - { "ESCAPE", 111 }, - { "FORWARD_DEL", 112 }, - { "CTRL_LEFT", 113 }, - { "CTRL_RIGHT", 114 }, - { "CAPS_LOCK", 115 }, - { "SCROLL_LOCK", 116 }, - { "META_LEFT", 117 }, - { "META_RIGHT", 118 }, - { "FUNCTION", 119 }, - { "SYSRQ", 120 }, - { "BREAK", 121 }, - { "MOVE_HOME", 122 }, - { "MOVE_END", 123 }, - { "INSERT", 124 }, - { "FORWARD", 125 }, - { "MEDIA_PLAY", 126 }, - { "MEDIA_PAUSE", 127 }, - { "MEDIA_CLOSE", 128 }, - { "MEDIA_EJECT", 129 }, - { "MEDIA_RECORD", 130 }, - { "F1", 131 }, - { "F2", 132 }, - { "F3", 133 }, - { "F4", 134 }, - { "F5", 135 }, - { "F6", 136 }, - { "F7", 137 }, - { "F8", 138 }, - { "F9", 139 }, - { "F10", 140 }, - { "F11", 141 }, - { "F12", 142 }, - { "NUM_LOCK", 143 }, - { "NUMPAD_0", 144 }, - { "NUMPAD_1", 145 }, - { "NUMPAD_2", 146 }, - { "NUMPAD_3", 147 }, - { "NUMPAD_4", 148 }, - { "NUMPAD_5", 149 }, - { "NUMPAD_6", 150 }, - { "NUMPAD_7", 151 }, - { "NUMPAD_8", 152 }, - { "NUMPAD_9", 153 }, - { "NUMPAD_DIVIDE", 154 }, - { "NUMPAD_MULTIPLY", 155 }, - { "NUMPAD_SUBTRACT", 156 }, - { "NUMPAD_ADD", 157 }, - { "NUMPAD_DOT", 158 }, - { "NUMPAD_COMMA", 159 }, - { "NUMPAD_ENTER", 160 }, - { "NUMPAD_EQUALS", 161 }, - { "NUMPAD_LEFT_PAREN", 162 }, - { "NUMPAD_RIGHT_PAREN", 163 }, - { "VOLUME_MUTE", 164 }, - { "INFO", 165 }, - { "CHANNEL_UP", 166 }, - { "CHANNEL_DOWN", 167 }, - { "ZOOM_IN", 168 }, - { "ZOOM_OUT", 169 }, - { "TV", 170 }, - { "WINDOW", 171 }, - { "GUIDE", 172 }, - { "DVR", 173 }, - { "BOOKMARK", 174 }, - { "CAPTIONS", 175 }, - { "SETTINGS", 176 }, - { "TV_POWER", 177 }, - { "TV_INPUT", 178 }, - { "STB_POWER", 179 }, - { "STB_INPUT", 180 }, - { "AVR_POWER", 181 }, - { "AVR_INPUT", 182 }, - { "PROG_RED", 183 }, - { "PROG_GREEN", 184 }, - { "PROG_YELLOW", 185 }, - { "PROG_BLUE", 186 }, - { "APP_SWITCH", 187 }, - { "BUTTON_1", 188 }, - { "BUTTON_2", 189 }, - { "BUTTON_3", 190 }, - { "BUTTON_4", 191 }, - { "BUTTON_5", 192 }, - { "BUTTON_6", 193 }, - { "BUTTON_7", 194 }, - { "BUTTON_8", 195 }, - { "BUTTON_9", 196 }, - { "BUTTON_10", 197 }, - { "BUTTON_11", 198 }, - { "BUTTON_12", 199 }, - { "BUTTON_13", 200 }, - { "BUTTON_14", 201 }, - { "BUTTON_15", 202 }, - { "BUTTON_16", 203 }, - { "LANGUAGE_SWITCH", 204 }, - { "MANNER_MODE", 205 }, - { "3D_MODE", 206 }, - - // NOTE: If you add a new keycode here you must also add it to several other files. - // Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list. - - { NULL, 0 } -}; - -// NOTE: If you edit these flags, also edit policy flags in Input.h. -static const KeycodeLabel FLAGS[] = { - { "WAKE", 0x00000001 }, - { "WAKE_DROPPED", 0x00000002 }, - { "SHIFT", 0x00000004 }, - { "CAPS_LOCK", 0x00000008 }, - { "ALT", 0x00000010 }, - { "ALT_GR", 0x00000020 }, - { "MENU", 0x00000040 }, - { "LAUNCHER", 0x00000080 }, - { "VIRTUAL", 0x00000100 }, - { "FUNCTION", 0x00000200 }, - { NULL, 0 } -}; - -static const KeycodeLabel AXES[] = { - { "X", 0 }, - { "Y", 1 }, - { "PRESSURE", 2 }, - { "SIZE", 3 }, - { "TOUCH_MAJOR", 4 }, - { "TOUCH_MINOR", 5 }, - { "TOOL_MAJOR", 6 }, - { "TOOL_MINOR", 7 }, - { "ORIENTATION", 8 }, - { "VSCROLL", 9 }, - { "HSCROLL", 10 }, - { "Z", 11 }, - { "RX", 12 }, - { "RY", 13 }, - { "RZ", 14 }, - { "HAT_X", 15 }, - { "HAT_Y", 16 }, - { "LTRIGGER", 17 }, - { "RTRIGGER", 18 }, - { "THROTTLE", 19 }, - { "RUDDER", 20 }, - { "WHEEL", 21 }, - { "GAS", 22 }, - { "BRAKE", 23 }, - { "DISTANCE", 24 }, - { "TILT", 25 }, - { "GENERIC_1", 32 }, - { "GENERIC_2", 33 }, - { "GENERIC_3", 34 }, - { "GENERIC_4", 35 }, - { "GENERIC_5", 36 }, - { "GENERIC_6", 37 }, - { "GENERIC_7", 38 }, - { "GENERIC_8", 39 }, - { "GENERIC_9", 40 }, - { "GENERIC_10", 41 }, - { "GENERIC_11", 42 }, - { "GENERIC_12", 43 }, - { "GENERIC_13", 44 }, - { "GENERIC_14", 45 }, - { "GENERIC_15", 46 }, - { "GENERIC_16", 47 }, - - // NOTE: If you add a new axis here you must also add it to several other files. - // Refer to frameworks/base/core/java/android/view/MotionEvent.java for the full list. - - { NULL, -1 } -}; - -#endif // _UI_KEYCODE_LABELS_H diff --git a/external/android/include/14/frameworks/base/include/ui/PixelFormat.h b/external/android/include/14/frameworks/base/include/ui/PixelFormat.h deleted file mode 100644 index 848c5a1..0000000 --- a/external/android/include/14/frameworks/base/include/ui/PixelFormat.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// - -// Pixel formats used across the system. -// These formats might not all be supported by all renderers, for instance -// skia or SurfaceFlinger are not required to support all of these formats -// (either as source or destination) - -// XXX: we should consolidate these formats and skia's - -#ifndef UI_PIXELFORMAT_H -#define UI_PIXELFORMAT_H - -#include -#include -#include -#include -#include - -namespace android { - -enum { - // - // these constants need to match those - // in graphics/PixelFormat.java & pixelflinger/format.h - // - PIXEL_FORMAT_UNKNOWN = 0, - PIXEL_FORMAT_NONE = 0, - - // logical pixel formats used by the SurfaceFlinger ----------------------- - PIXEL_FORMAT_CUSTOM = -4, - // Custom pixel-format described by a PixelFormatInfo structure - - PIXEL_FORMAT_TRANSLUCENT = -3, - // System chooses a format that supports translucency (many alpha bits) - - PIXEL_FORMAT_TRANSPARENT = -2, - // System chooses a format that supports transparency - // (at least 1 alpha bit) - - PIXEL_FORMAT_OPAQUE = -1, - // System chooses an opaque format (no alpha bits required) - - // real pixel formats supported for rendering ----------------------------- - - PIXEL_FORMAT_RGBA_8888 = HAL_PIXEL_FORMAT_RGBA_8888, // 4x8-bit RGBA - PIXEL_FORMAT_RGBX_8888 = HAL_PIXEL_FORMAT_RGBX_8888, // 4x8-bit RGB0 - PIXEL_FORMAT_RGB_888 = HAL_PIXEL_FORMAT_RGB_888, // 3x8-bit RGB - PIXEL_FORMAT_RGB_565 = HAL_PIXEL_FORMAT_RGB_565, // 16-bit RGB - PIXEL_FORMAT_BGRA_8888 = HAL_PIXEL_FORMAT_BGRA_8888, // 4x8-bit BGRA - PIXEL_FORMAT_RGBA_5551 = HAL_PIXEL_FORMAT_RGBA_5551, // 16-bit ARGB - PIXEL_FORMAT_RGBA_4444 = HAL_PIXEL_FORMAT_RGBA_4444, // 16-bit ARGB - PIXEL_FORMAT_A_8 = GGL_PIXEL_FORMAT_A_8, // 8-bit A - PIXEL_FORMAT_L_8 = GGL_PIXEL_FORMAT_L_8, // 8-bit L (R=G=B=L) - PIXEL_FORMAT_LA_88 = GGL_PIXEL_FORMAT_LA_88, // 16-bit LA - PIXEL_FORMAT_RGB_332 = GGL_PIXEL_FORMAT_RGB_332, // 8-bit RGB - - // New formats can be added if they're also defined in - // pixelflinger/format.h -}; - -typedef int32_t PixelFormat; - -struct PixelFormatInfo -{ - enum { - INDEX_ALPHA = 0, - INDEX_RED = 1, - INDEX_GREEN = 2, - INDEX_BLUE = 3 - }; - - enum { // components - ALPHA = 1, - RGB = 2, - RGBA = 3, - LUMINANCE = 4, - LUMINANCE_ALPHA = 5, - OTHER = 0xFF - }; - - struct szinfo { - uint8_t h; - uint8_t l; - }; - - inline PixelFormatInfo() : version(sizeof(PixelFormatInfo)) { } - size_t getScanlineSize(unsigned int width) const; - size_t getSize(size_t ci) const { - return (ci <= 3) ? (cinfo[ci].h - cinfo[ci].l) : 0; - } - size_t version; - PixelFormat format; - size_t bytesPerPixel; - size_t bitsPerPixel; - union { - szinfo cinfo[4]; - struct { - uint8_t h_alpha; - uint8_t l_alpha; - uint8_t h_red; - uint8_t l_red; - uint8_t h_green; - uint8_t l_green; - uint8_t h_blue; - uint8_t l_blue; - }; - }; - uint8_t components; - uint8_t reserved0[3]; - uint32_t reserved1; -}; - -// Consider caching the results of these functions are they're not -// guaranteed to be fast. -ssize_t bytesPerPixel(PixelFormat format); -ssize_t bitsPerPixel(PixelFormat format); -status_t getPixelFormatInfo(PixelFormat format, PixelFormatInfo* info); - -}; // namespace android - -#endif // UI_PIXELFORMAT_H diff --git a/external/android/include/14/frameworks/base/include/ui/Point.h b/external/android/include/14/frameworks/base/include/ui/Point.h deleted file mode 100644 index 1653120..0000000 --- a/external/android/include/14/frameworks/base/include/ui/Point.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (C) 2006 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_UI_POINT -#define ANDROID_UI_POINT - -#include - -namespace android { - -class Point -{ -public: - int x; - int y; - - // we don't provide copy-ctor and operator= on purpose - // because we want the compiler generated versions - - // Default constructor doesn't initialize the Point - inline Point() { - } - inline Point(int x, int y) : x(x), y(y) { - } - - inline bool operator == (const Point& rhs) const { - return (x == rhs.x) && (y == rhs.y); - } - inline bool operator != (const Point& rhs) const { - return !operator == (rhs); - } - - inline bool isOrigin() const { - return !(x|y); - } - - // operator < defines an order which allows to use points in sorted - // vectors. - bool operator < (const Point& rhs) const { - return y -#include - -#include - -namespace android { - -class Rect : public ARect -{ -public: - typedef ARect::value_type value_type; - - // we don't provide copy-ctor and operator= on purpose - // because we want the compiler generated versions - - inline Rect() { - } - inline Rect(int32_t w, int32_t h) { - left = top = 0; right = w; bottom = h; - } - inline Rect(int32_t l, int32_t t, int32_t r, int32_t b) { - left = l; top = t; right = r; bottom = b; - } - inline Rect(const Point& lt, const Point& rb) { - left = lt.x; top = lt.y; right = rb.x; bottom = rb.y; - } - - void makeInvalid(); - - inline void clear() { - left = top = right = bottom = 0; - } - - // a valid rectangle has a non negative width and height - inline bool isValid() const { - return (width()>=0) && (height()>=0); - } - - // an empty rect has a zero width or height, or is invalid - inline bool isEmpty() const { - return (width()<=0) || (height()<=0); - } - - inline void set(const Rect& rhs) { - operator = (rhs); - } - - // rectangle's width - inline int32_t width() const { - return right-left; - } - - // rectangle's height - inline int32_t height() const { - return bottom-top; - } - - void setLeftTop(const Point& lt) { - left = lt.x; - top = lt.y; - } - - void setRightBottom(const Point& rb) { - right = rb.x; - bottom = rb.y; - } - - // the following 4 functions return the 4 corners of the rect as Point - Point leftTop() const { - return Point(left, top); - } - Point rightBottom() const { - return Point(right, bottom); - } - Point rightTop() const { - return Point(right, top); - } - Point leftBottom() const { - return Point(left, bottom); - } - - // comparisons - inline bool operator == (const Rect& rhs) const { - return (left == rhs.left) && (top == rhs.top) && - (right == rhs.right) && (bottom == rhs.bottom); - } - - inline bool operator != (const Rect& rhs) const { - return !operator == (rhs); - } - - // operator < defines an order which allows to use rectangles in sorted - // vectors. - bool operator < (const Rect& rhs) const; - - Rect& offsetToOrigin() { - right -= left; - bottom -= top; - left = top = 0; - return *this; - } - Rect& offsetTo(const Point& p) { - return offsetTo(p.x, p.y); - } - Rect& offsetBy(const Point& dp) { - return offsetBy(dp.x, dp.y); - } - Rect& operator += (const Point& rhs) { - return offsetBy(rhs.x, rhs.y); - } - Rect& operator -= (const Point& rhs) { - return offsetBy(-rhs.x, -rhs.y); - } - const Rect operator + (const Point& rhs) const; - const Rect operator - (const Point& rhs) const; - - void translate(int32_t dx, int32_t dy) { // legacy, don't use. - offsetBy(dx, dy); - } - - Rect& offsetTo(int32_t x, int32_t y); - Rect& offsetBy(int32_t x, int32_t y); - bool intersect(const Rect& with, Rect* result) const; -}; - -ANDROID_BASIC_TYPES_TRAITS(Rect) - -}; // namespace android - -#endif // ANDROID_UI_RECT diff --git a/external/android/include/14/frameworks/base/include/ui/Region.h b/external/android/include/14/frameworks/base/include/ui/Region.h deleted file mode 100644 index 6c9a620..0000000 --- a/external/android/include/14/frameworks/base/include/ui/Region.h +++ /dev/null @@ -1,188 +0,0 @@ -/* - * 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_UI_REGION_H -#define ANDROID_UI_REGION_H - -#include -#include - -#include - -#include - -namespace android { -// --------------------------------------------------------------------------- - -class String8; - -// --------------------------------------------------------------------------- -class Region -{ -public: - Region(); - Region(const Region& rhs); - explicit Region(const Rect& rhs); - explicit Region(const void* buffer); - ~Region(); - - Region& operator = (const Region& rhs); - - inline bool isEmpty() const { return mBounds.isEmpty(); } - inline bool isRect() const { return mStorage.isEmpty(); } - - inline Rect getBounds() const { return mBounds; } - inline Rect bounds() const { return getBounds(); } - - // the region becomes its bounds - Region& makeBoundsSelf(); - - void clear(); - void set(const Rect& r); - void set(uint32_t w, uint32_t h); - - Region& orSelf(const Rect& rhs); - Region& andSelf(const Rect& rhs); - Region& subtractSelf(const Rect& rhs); - - // boolean operators, applied on this - Region& orSelf(const Region& rhs); - Region& andSelf(const Region& rhs); - Region& subtractSelf(const Region& rhs); - - // boolean operators - const Region merge(const Rect& rhs) const; - const Region intersect(const Rect& rhs) const; - const Region subtract(const Rect& rhs) const; - - // boolean operators - const Region merge(const Region& rhs) const; - const Region intersect(const Region& rhs) const; - const Region subtract(const Region& rhs) const; - - // these translate rhs first - Region& translateSelf(int dx, int dy); - Region& orSelf(const Region& rhs, int dx, int dy); - Region& andSelf(const Region& rhs, int dx, int dy); - Region& subtractSelf(const Region& rhs, int dx, int dy); - - // these translate rhs first - const Region translate(int dx, int dy) const; - const Region merge(const Region& rhs, int dx, int dy) const; - const Region intersect(const Region& rhs, int dx, int dy) const; - const Region subtract(const Region& rhs, int dx, int dy) const; - - // convenience operators overloads - inline const Region operator | (const Region& rhs) const; - inline const Region operator & (const Region& rhs) const; - inline const Region operator - (const Region& rhs) const; - inline const Region operator + (const Point& pt) const; - - inline Region& operator |= (const Region& rhs); - inline Region& operator &= (const Region& rhs); - inline Region& operator -= (const Region& rhs); - inline Region& operator += (const Point& pt); - - - /* various ways to access the rectangle list */ - - typedef Rect const* const_iterator; - - const_iterator begin() const; - const_iterator end() const; - - /* no user serviceable parts here... */ - - size_t getRects(Vector& rectList) const; - Rect const* getArray(size_t* count) const; - - - // add a rectangle to the internal list. This rectangle must - // be sorted in Y and X and must not make the region invalid. - void addRectUnchecked(int l, int t, int r, int b); - - // flatten/unflatten a region to/from a raw buffer - ssize_t write(void* buffer, size_t size) const; - static ssize_t writeEmpty(void* buffer, size_t size); - - ssize_t read(const void* buffer); - static bool isEmpty(void* buffer); - - void dump(String8& out, const char* what, uint32_t flags=0) const; - void dump(const char* what, uint32_t flags=0) const; - -private: - class rasterizer; - friend class rasterizer; - - Region& operationSelf(const Rect& r, int op); - Region& operationSelf(const Region& r, int op); - Region& operationSelf(const Region& r, int dx, int dy, int op); - const Region operation(const Rect& rhs, int op) const; - const Region operation(const Region& rhs, int op) const; - const Region operation(const Region& rhs, int dx, int dy, int op) const; - - static void boolean_operation(int op, Region& dst, - const Region& lhs, const Region& rhs, int dx, int dy); - static void boolean_operation(int op, Region& dst, - const Region& lhs, const Rect& rhs, int dx, int dy); - - static void boolean_operation(int op, Region& dst, - const Region& lhs, const Region& rhs); - static void boolean_operation(int op, Region& dst, - const Region& lhs, const Rect& rhs); - - static void translate(Region& reg, int dx, int dy); - static void translate(Region& dst, const Region& reg, int dx, int dy); - - static bool validate(const Region& reg, const char* name); - - Rect mBounds; - Vector mStorage; -}; - - -const Region Region::operator | (const Region& rhs) const { - return merge(rhs); -} -const Region Region::operator & (const Region& rhs) const { - return intersect(rhs); -} -const Region Region::operator - (const Region& rhs) const { - return subtract(rhs); -} -const Region Region::operator + (const Point& pt) const { - return translate(pt.x, pt.y); -} - - -Region& Region::operator |= (const Region& rhs) { - return orSelf(rhs); -} -Region& Region::operator &= (const Region& rhs) { - return andSelf(rhs); -} -Region& Region::operator -= (const Region& rhs) { - return subtractSelf(rhs); -} -Region& Region::operator += (const Point& pt) { - return translateSelf(pt.x, pt.y); -} -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_UI_REGION_H - diff --git a/external/android/include/14/frameworks/base/include/ui/VirtualKeyMap.h b/external/android/include/14/frameworks/base/include/ui/VirtualKeyMap.h deleted file mode 100644 index 7813d9d..0000000 --- a/external/android/include/14/frameworks/base/include/ui/VirtualKeyMap.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2010 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 _UI_VIRTUAL_KEY_MAP_H -#define _UI_VIRTUAL_KEY_MAP_H - -#include - -#include -#include -#include -#include -#include -#include - -namespace android { - -/* Describes a virtual key. */ -struct VirtualKeyDefinition { - int32_t scanCode; - - // configured position data, specified in display coords - int32_t centerX; - int32_t centerY; - int32_t width; - int32_t height; -}; - - -/** - * Describes a collection of virtual keys on a touch screen in terms of - * virtual scan codes and hit rectangles. - */ -class VirtualKeyMap { -public: - ~VirtualKeyMap(); - - static status_t load(const String8& filename, VirtualKeyMap** outMap); - - inline const Vector& getVirtualKeys() const { - return mVirtualKeys; - } - -private: - class Parser { - VirtualKeyMap* mMap; - Tokenizer* mTokenizer; - - public: - Parser(VirtualKeyMap* map, Tokenizer* tokenizer); - ~Parser(); - status_t parse(); - - private: - bool consumeFieldDelimiterAndSkipWhitespace(); - bool parseNextIntField(int32_t* outValue); - }; - - Vector mVirtualKeys; - - VirtualKeyMap(); -}; - -} // namespace android - -#endif // _UI_KEY_CHARACTER_MAP_H diff --git a/external/android/include/14/frameworks/base/include/ui/android_native_buffer.h b/external/android/include/14/frameworks/base/include/ui/android_native_buffer.h deleted file mode 100644 index b6e1db4..0000000 --- a/external/android/include/14/frameworks/base/include/ui/android_native_buffer.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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_ANDROID_NATIVES_PRIV_H -#define ANDROID_ANDROID_NATIVES_PRIV_H - -#include - -#endif /* ANDROID_ANDROID_NATIVES_PRIV_H */ diff --git a/external/android/include/14/frameworks/base/include/ui/egl/android_natives.h b/external/android/include/14/frameworks/base/include/ui/egl/android_natives.h deleted file mode 100644 index 9ac50a5..0000000 --- a/external/android/include/14/frameworks/base/include/ui/egl/android_natives.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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_ANDROID_NATIVES_H -#define ANDROID_ANDROID_NATIVES_H - -#include -#include - -#include -#include -// FIXME: remove this header, it's for legacy use. native_window is pulled from frameworks/base/native/include/android/ -#include -// --------------------------------------------------------------------------- - -/* FIXME: this is legacy for pixmaps */ -typedef struct egl_native_pixmap_t -{ - int32_t version; /* must be 32 */ - int32_t width; - int32_t height; - int32_t stride; - uint8_t* data; - uint8_t format; - uint8_t rfu[3]; - union { - uint32_t compressedFormat; - int32_t vstride; - }; - int32_t reserved; -} egl_native_pixmap_t; - -/*****************************************************************************/ - -#ifdef __cplusplus - -#include - -namespace android { - -/* - * This helper class turns an EGL android_native_xxx type into a C++ - * reference-counted object; with proper type conversions. - */ -template -class EGLNativeBase : public NATIVE_TYPE, public REF -{ -public: - // Disambiguate between the incStrong in REF and NATIVE_TYPE - void incStrong(const void* id) const { - REF::incStrong(id); - } - void decStrong(const void* id) const { - REF::decStrong(id); - } - -protected: - typedef EGLNativeBase BASE; - EGLNativeBase() : NATIVE_TYPE(), REF() { - NATIVE_TYPE::common.incRef = incRef; - NATIVE_TYPE::common.decRef = decRef; - } - static inline TYPE* getSelf(NATIVE_TYPE* self) { - return static_cast(self); - } - static inline TYPE const* getSelf(NATIVE_TYPE const* self) { - return static_cast(self); - } - static inline TYPE* getSelf(android_native_base_t* base) { - return getSelf(reinterpret_cast(base)); - } - static inline TYPE const * getSelf(android_native_base_t const* base) { - return getSelf(reinterpret_cast(base)); - } - static void incRef(android_native_base_t* base) { - EGLNativeBase* self = getSelf(base); - self->incStrong(self); - } - static void decRef(android_native_base_t* base) { - EGLNativeBase* self = getSelf(base); - self->decStrong(self); - } -}; - -} // namespace android -#endif // __cplusplus - -/*****************************************************************************/ - -#endif /* ANDROID_ANDROID_NATIVES_H */ diff --git a/external/android/include/14/frameworks/base/include/utils/Asset.h b/external/android/include/14/frameworks/base/include/utils/Asset.h deleted file mode 100644 index 1fe0e06..0000000 --- a/external/android/include/14/frameworks/base/include/utils/Asset.h +++ /dev/null @@ -1,322 +0,0 @@ -/* - * Copyright (C) 2006 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. - */ - -// -// Class providing access to a read-only asset. Asset objects are NOT -// thread-safe, and should not be shared across threads. -// -#ifndef __LIBS_ASSET_H -#define __LIBS_ASSET_H - -#include -#include - -#include -#include -#include -#include - -namespace android { - -/* - * Instances of this class provide read-only operations on a byte stream. - * - * Access may be optimized for streaming, random, or whole buffer modes. All - * operations are supported regardless of how the file was opened, but some - * things will be less efficient. [pass that in??] - * - * "Asset" is the base class for all types of assets. The classes below - * provide most of the implementation. The AssetManager uses one of the - * static "create" functions defined here to create a new instance. - */ -class Asset { -public: - virtual ~Asset(void); - - static int32_t getGlobalCount(); - static String8 getAssetAllocations(); - - /* used when opening an asset */ - typedef enum AccessMode { - ACCESS_UNKNOWN = 0, - - /* read chunks, and seek forward and backward */ - ACCESS_RANDOM, - - /* read sequentially, with an occasional forward seek */ - ACCESS_STREAMING, - - /* caller plans to ask for a read-only buffer with all data */ - ACCESS_BUFFER, - } AccessMode; - - /* - * Read data from the current offset. Returns the actual number of - * bytes read, 0 on EOF, or -1 on error. - */ - virtual ssize_t read(void* buf, size_t count) = 0; - - /* - * Seek to the specified offset. "whence" uses the same values as - * lseek/fseek. Returns the new position on success, or (off64_t) -1 - * on failure. - */ - virtual off64_t seek(off64_t offset, int whence) = 0; - - /* - * Close the asset, freeing all associated resources. - */ - virtual void close(void) = 0; - - /* - * Get a pointer to a buffer with the entire contents of the file. - */ - virtual const void* getBuffer(bool wordAligned) = 0; - - /* - * Get the total amount of data that can be read. - */ - virtual off64_t getLength(void) const = 0; - - /* - * Get the total amount of data that can be read from the current position. - */ - virtual off64_t getRemainingLength(void) const = 0; - - /* - * Open a new file descriptor that can be used to read this asset. - * Returns -1 if you can not use the file descriptor (for example if the - * asset is compressed). - */ - virtual int openFileDescriptor(off64_t* outStart, off64_t* outLength) const = 0; - - /* - * Return whether this asset's buffer is allocated in RAM (not mmapped). - * Note: not virtual so it is safe to call even when being destroyed. - */ - virtual bool isAllocated(void) const { return false; } - - /* - * Get a string identifying the asset's source. This might be a full - * path, it might be a colon-separated list of identifiers. - * - * This is NOT intended to be used for anything except debug output. - * DO NOT try to parse this or use it to open a file. - */ - const char* getAssetSource(void) const { return mAssetSource.string(); } - -protected: - Asset(void); // constructor; only invoked indirectly - - /* handle common seek() housekeeping */ - off64_t handleSeek(off64_t offset, int whence, off64_t curPosn, off64_t maxPosn); - - /* set the asset source string */ - void setAssetSource(const String8& path) { mAssetSource = path; } - - AccessMode getAccessMode(void) const { return mAccessMode; } - -private: - /* these operations are not implemented */ - Asset(const Asset& src); - Asset& operator=(const Asset& src); - - /* AssetManager needs access to our "create" functions */ - friend class AssetManager; - - /* - * Create the asset from a named file on disk. - */ - static Asset* createFromFile(const char* fileName, AccessMode mode); - - /* - * Create the asset from a named, compressed file on disk (e.g. ".gz"). - */ - static Asset* createFromCompressedFile(const char* fileName, - AccessMode mode); - -#if 0 - /* - * Create the asset from a segment of an open file. This will fail - * if "offset" and "length" don't fit within the bounds of the file. - * - * The asset takes ownership of the file descriptor. - */ - static Asset* createFromFileSegment(int fd, off64_t offset, size_t length, - AccessMode mode); - - /* - * Create from compressed data. "fd" should be seeked to the start of - * the compressed data. This could be inside a gzip file or part of a - * Zip archive. - * - * The asset takes ownership of the file descriptor. - * - * This may not verify the validity of the compressed data until first - * use. - */ - static Asset* createFromCompressedData(int fd, off64_t offset, - int compressionMethod, size_t compressedLength, - size_t uncompressedLength, AccessMode mode); -#endif - - /* - * Create the asset from a memory-mapped file segment. - * - * The asset takes ownership of the FileMap. - */ - static Asset* createFromUncompressedMap(FileMap* dataMap, AccessMode mode); - - /* - * Create the asset from a memory-mapped file segment with compressed - * data. "method" is a Zip archive compression method constant. - * - * The asset takes ownership of the FileMap. - */ - static Asset* createFromCompressedMap(FileMap* dataMap, int method, - size_t uncompressedLen, AccessMode mode); - - - /* - * Create from a reference-counted chunk of shared memory. - */ - // TODO - - AccessMode mAccessMode; // how the asset was opened - String8 mAssetSource; // debug string - - Asset* mNext; // linked list. - Asset* mPrev; -}; - - -/* - * =========================================================================== - * - * Innards follow. Do not use these classes directly. - */ - -/* - * An asset based on an uncompressed file on disk. It may encompass the - * entire file or just a piece of it. Access is through fread/fseek. - */ -class _FileAsset : public Asset { -public: - _FileAsset(void); - virtual ~_FileAsset(void); - - /* - * Use a piece of an already-open file. - * - * On success, the object takes ownership of "fd". - */ - status_t openChunk(const char* fileName, int fd, off64_t offset, size_t length); - - /* - * Use a memory-mapped region. - * - * On success, the object takes ownership of "dataMap". - */ - status_t openChunk(FileMap* dataMap); - - /* - * Standard Asset interfaces. - */ - virtual ssize_t read(void* buf, size_t count); - virtual off64_t seek(off64_t offset, int whence); - virtual void close(void); - virtual const void* getBuffer(bool wordAligned); - virtual off64_t getLength(void) const { return mLength; } - virtual off64_t getRemainingLength(void) const { return mLength-mOffset; } - virtual int openFileDescriptor(off64_t* outStart, off64_t* outLength) const; - virtual bool isAllocated(void) const { return mBuf != NULL; } - -private: - off64_t mStart; // absolute file offset of start of chunk - off64_t mLength; // length of the chunk - off64_t mOffset; // current local offset, 0 == mStart - FILE* mFp; // for read/seek - char* mFileName; // for opening - - /* - * To support getBuffer() we either need to read the entire thing into - * a buffer or memory-map it. For small files it's probably best to - * just read them in. - */ - enum { kReadVsMapThreshold = 4096 }; - - FileMap* mMap; // for memory map - unsigned char* mBuf; // for read - - const void* ensureAlignment(FileMap* map); -}; - - -/* - * An asset based on compressed data in a file. - */ -class _CompressedAsset : public Asset { -public: - _CompressedAsset(void); - virtual ~_CompressedAsset(void); - - /* - * Use a piece of an already-open file. - * - * On success, the object takes ownership of "fd". - */ - status_t openChunk(int fd, off64_t offset, int compressionMethod, - size_t uncompressedLen, size_t compressedLen); - - /* - * Use a memory-mapped region. - * - * On success, the object takes ownership of "fd". - */ - status_t openChunk(FileMap* dataMap, int compressionMethod, - size_t uncompressedLen); - - /* - * Standard Asset interfaces. - */ - virtual ssize_t read(void* buf, size_t count); - virtual off64_t seek(off64_t offset, int whence); - virtual void close(void); - virtual const void* getBuffer(bool wordAligned); - virtual off64_t getLength(void) const { return mUncompressedLen; } - virtual off64_t getRemainingLength(void) const { return mUncompressedLen-mOffset; } - virtual int openFileDescriptor(off64_t* outStart, off64_t* outLength) const { return -1; } - virtual bool isAllocated(void) const { return mBuf != NULL; } - -private: - off64_t mStart; // offset to start of compressed data - off64_t mCompressedLen; // length of the compressed data - off64_t mUncompressedLen; // length of the uncompressed data - off64_t mOffset; // current offset, 0 == start of uncomp data - - FileMap* mMap; // for memory-mapped input - int mFd; // for file input - - class StreamingZipInflater* mZipInflater; // for streaming large compressed assets - - unsigned char* mBuf; // for getBuffer() -}; - -// need: shared mmap version? - -}; // namespace android - -#endif // __LIBS_ASSET_H diff --git a/external/android/include/14/frameworks/base/include/utils/AssetDir.h b/external/android/include/14/frameworks/base/include/utils/AssetDir.h deleted file mode 100644 index abf8a35..0000000 --- a/external/android/include/14/frameworks/base/include/utils/AssetDir.h +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (C) 2006 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. - */ - -// -// Access a chunk of the asset hierarchy as if it were a single directory. -// -#ifndef __LIBS_ASSETDIR_H -#define __LIBS_ASSETDIR_H - -#include -#include -#include -#include -#include - -namespace android { - -/* - * This provides vector-style access to a directory. We do this rather - * than modeling opendir/readdir access because it's simpler and the - * nature of the operation requires us to have all data on hand anyway. - * - * The list of files will be sorted in ascending order by ASCII value. - * - * The contents are populated by our friend, the AssetManager. - */ -class AssetDir { -public: - AssetDir(void) - : mFileInfo(NULL) - {} - virtual ~AssetDir(void) { - delete mFileInfo; - } - - /* - * Vector-style access. - */ - size_t getFileCount(void) { return mFileInfo->size(); } - const String8& getFileName(int idx) { - return mFileInfo->itemAt(idx).getFileName(); - } - const String8& getSourceName(int idx) { - return mFileInfo->itemAt(idx).getSourceName(); - } - - /* - * Get the type of a file (usually regular or directory). - */ - FileType getFileType(int idx) { - return mFileInfo->itemAt(idx).getFileType(); - } - -private: - /* these operations are not implemented */ - AssetDir(const AssetDir& src); - const AssetDir& operator=(const AssetDir& src); - - friend class AssetManager; - - /* - * This holds information about files in the asset hierarchy. - */ - class FileInfo { - public: - FileInfo(void) {} - FileInfo(const String8& path) // useful for e.g. svect.indexOf - : mFileName(path), mFileType(kFileTypeUnknown) - {} - ~FileInfo(void) {} - FileInfo(const FileInfo& src) { - copyMembers(src); - } - const FileInfo& operator= (const FileInfo& src) { - if (this != &src) - copyMembers(src); - return *this; - } - - void copyMembers(const FileInfo& src) { - mFileName = src.mFileName; - mFileType = src.mFileType; - mSourceName = src.mSourceName; - } - - /* need this for SortedVector; must compare only on file name */ - bool operator< (const FileInfo& rhs) const { - return mFileName < rhs.mFileName; - } - - /* used by AssetManager */ - bool operator== (const FileInfo& rhs) const { - return mFileName == rhs.mFileName; - } - - void set(const String8& path, FileType type) { - mFileName = path; - mFileType = type; - } - - const String8& getFileName(void) const { return mFileName; } - void setFileName(const String8& path) { mFileName = path; } - - FileType getFileType(void) const { return mFileType; } - void setFileType(FileType type) { mFileType = type; } - - const String8& getSourceName(void) const { return mSourceName; } - void setSourceName(const String8& path) { mSourceName = path; } - - /* - * Handy utility for finding an entry in a sorted vector of FileInfo. - * Returns the index of the matching entry, or -1 if none found. - */ - static int findEntry(const SortedVector* pVector, - const String8& fileName); - - private: - String8 mFileName; // filename only - FileType mFileType; // regular, directory, etc - - String8 mSourceName; // currently debug-only - }; - - /* AssetManager uses this to initialize us */ - void setFileList(SortedVector* list) { mFileInfo = list; } - - SortedVector* mFileInfo; -}; - -}; // namespace android - -#endif // __LIBS_ASSETDIR_H diff --git a/external/android/include/14/frameworks/base/include/utils/AssetManager.h b/external/android/include/14/frameworks/base/include/utils/AssetManager.h deleted file mode 100644 index a8c7ddb..0000000 --- a/external/android/include/14/frameworks/base/include/utils/AssetManager.h +++ /dev/null @@ -1,373 +0,0 @@ -/* - * Copyright (C) 2006 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. - */ - -// -// Asset management class. AssetManager objects are thread-safe. -// -#ifndef __LIBS_ASSETMANAGER_H -#define __LIBS_ASSETMANAGER_H - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Native-app access is via the opaque typedef struct AAssetManager in the C namespace. - */ -#ifdef __cplusplus -extern "C" { -#endif - -struct AAssetManager { }; - -#ifdef __cplusplus -}; -#endif - - -/* - * Now the proper C++ android-namespace definitions - */ - -namespace android { - -class Asset; // fwd decl for things that include Asset.h first -class ResTable; -struct ResTable_config; - -/* - * Every application that uses assets needs one instance of this. A - * single instance may be shared across multiple threads, and a single - * thread may have more than one instance (the latter is discouraged). - * - * The purpose of the AssetManager is to create Asset objects. To do - * this efficiently it may cache information about the locations of - * files it has seen. This can be controlled with the "cacheMode" - * argument. - * - * The asset hierarchy may be examined like a filesystem, using - * AssetDir objects to peruse a single directory. - */ -class AssetManager : public AAssetManager { -public: - typedef enum CacheMode { - CACHE_UNKNOWN = 0, - CACHE_OFF, // don't try to cache file locations - CACHE_DEFER, // construct cache as pieces are needed - //CACHE_SCAN, // scan full(!) asset hierarchy at init() time - } CacheMode; - - AssetManager(CacheMode cacheMode = CACHE_OFF); - virtual ~AssetManager(void); - - static int32_t getGlobalCount(); - - /* - * Add a new source for assets. This can be called multiple times to - * look in multiple places for assets. It can be either a directory (for - * finding assets as raw files on the disk) or a ZIP file. This newly - * added asset path will be examined first when searching for assets, - * before any that were previously added. - * - * Returns "true" on success, "false" on failure. If 'cookie' is non-NULL, - * then on success, *cookie is set to the value corresponding to the - * newly-added asset source. - */ - bool addAssetPath(const String8& path, void** cookie); - - /* - * Convenience for adding the standard system assets. Uses the - * ANDROID_ROOT environment variable to find them. - */ - bool addDefaultAssets(); - - /* - * Iterate over the asset paths in this manager. (Previously - * added via addAssetPath() and addDefaultAssets().) On first call, - * 'cookie' must be NULL, resulting in the first cookie being returned. - * Each next cookie will be returned there-after, until NULL indicating - * the end has been reached. - */ - void* nextAssetPath(void* cookie) const; - - /* - * Return an asset path in the manager. 'which' must be between 0 and - * countAssetPaths(). - */ - String8 getAssetPath(void* cookie) const; - - /* - * Set the current locale and vendor. The locale can change during - * the lifetime of an AssetManager if the user updates the device's - * language setting. The vendor is less likely to change. - * - * Pass in NULL to indicate no preference. - */ - void setLocale(const char* locale); - void setVendor(const char* vendor); - - /* - * Choose screen orientation for resources values returned. - */ - void setConfiguration(const ResTable_config& config, const char* locale = NULL); - - void getConfiguration(ResTable_config* outConfig) const; - - typedef Asset::AccessMode AccessMode; // typing shortcut - - /* - * Open an asset. - * - * This will search through locale-specific and vendor-specific - * directories and packages to find the file. - * - * The object returned does not depend on the AssetManager. It should - * be freed by calling Asset::close(). - */ - Asset* open(const char* fileName, AccessMode mode); - - /* - * Open a non-asset file as an asset. - * - * This is for opening files that are included in an asset package - * but aren't assets. These sit outside the usual "locale/vendor" - * path hierarchy, and will not be seen by "AssetDir" or included - * in our filename cache. - */ - Asset* openNonAsset(const char* fileName, AccessMode mode); - - /* - * Explicit non-asset file. The file explicitly named by the cookie (the - * resource set to look in) and fileName will be opened and returned. - */ - Asset* openNonAsset(void* cookie, const char* fileName, AccessMode mode); - - /* - * Open a directory within the asset hierarchy. - * - * The contents of the directory are an amalgam of vendor-specific, - * locale-specific, and generic assets stored loosely or in asset - * packages. Depending on the cache setting and previous accesses, - * this call may incur significant disk overhead. - * - * To open the top-level directory, pass in "". - */ - AssetDir* openDir(const char* dirName); - - /* - * Open a directory within a particular path of the asset manager. - * - * The contents of the directory are an amalgam of vendor-specific, - * locale-specific, and generic assets stored loosely or in asset - * packages. Depending on the cache setting and previous accesses, - * this call may incur significant disk overhead. - * - * To open the top-level directory, pass in "". - */ - AssetDir* openNonAssetDir(void* cookie, const char* dirName); - - /* - * Get the type of a file in the asset hierarchy. They will either - * be "regular" or "directory". [Currently only works for "regular".] - * - * Can also be used as a quick test for existence of a file. - */ - FileType getFileType(const char* fileName); - - /* - * Return the complete resource table to find things in the package. - */ - const ResTable& getResources(bool required = true) const; - - /* - * Discard cached filename information. This only needs to be called - * if somebody has updated the set of "loose" files, and we want to - * discard our cached notion of what's where. - */ - void purge(void) { purgeFileNameCacheLocked(); } - - /* - * Return true if the files this AssetManager references are all - * up-to-date (have not been changed since it was created). If false - * is returned, you will need to create a new AssetManager to get - * the current data. - */ - bool isUpToDate(); - - /** - * Get the known locales for this asset manager object. - */ - void getLocales(Vector* locales) const; - -private: - struct asset_path - { - String8 path; - FileType type; - String8 idmap; - }; - - Asset* openInPathLocked(const char* fileName, AccessMode mode, - const asset_path& path); - Asset* openNonAssetInPathLocked(const char* fileName, AccessMode mode, - const asset_path& path); - Asset* openInLocaleVendorLocked(const char* fileName, AccessMode mode, - const asset_path& path, const char* locale, const char* vendor); - String8 createPathNameLocked(const asset_path& path, const char* locale, - const char* vendor); - String8 createPathNameLocked(const asset_path& path, const char* rootDir); - String8 createZipSourceNameLocked(const String8& zipFileName, - const String8& dirName, const String8& fileName); - - ZipFileRO* getZipFileLocked(const asset_path& path); - Asset* openAssetFromFileLocked(const String8& fileName, AccessMode mode); - Asset* openAssetFromZipLocked(const ZipFileRO* pZipFile, - const ZipEntryRO entry, AccessMode mode, const String8& entryName); - - bool scanAndMergeDirLocked(SortedVector* pMergedInfo, - const asset_path& path, const char* rootDir, const char* dirName); - SortedVector* scanDirLocked(const String8& path); - bool scanAndMergeZipLocked(SortedVector* pMergedInfo, - const asset_path& path, const char* rootDir, const char* dirName); - void mergeInfoLocked(SortedVector* pMergedInfo, - const SortedVector* pContents); - - void loadFileNameCacheLocked(void); - void fncScanLocked(SortedVector* pMergedInfo, - const char* dirName); - bool fncScanAndMergeDirLocked( - SortedVector* pMergedInfo, - const asset_path& path, const char* locale, const char* vendor, - const char* dirName); - void purgeFileNameCacheLocked(void); - - const ResTable* getResTable(bool required = true) const; - void setLocaleLocked(const char* locale); - void updateResourceParamsLocked() const; - - bool createIdmapFileLocked(const String8& originalPath, const String8& overlayPath, - const String8& idmapPath); - - bool isIdmapStaleLocked(const String8& originalPath, const String8& overlayPath, - const String8& idmapPath); - - Asset* openIdmapLocked(const struct asset_path& ap) const; - - bool getZipEntryCrcLocked(const String8& zipPath, const char* entryFilename, uint32_t* pCrc); - - class SharedZip : public RefBase { - public: - static sp get(const String8& path); - - ZipFileRO* getZip(); - - Asset* getResourceTableAsset(); - Asset* setResourceTableAsset(Asset* asset); - - ResTable* getResourceTable(); - ResTable* setResourceTable(ResTable* res); - - bool isUpToDate(); - - protected: - ~SharedZip(); - - private: - SharedZip(const String8& path, time_t modWhen); - SharedZip(); // <-- not implemented - - String8 mPath; - ZipFileRO* mZipFile; - time_t mModWhen; - - Asset* mResourceTableAsset; - ResTable* mResourceTable; - - static Mutex gLock; - static DefaultKeyedVector > gOpen; - }; - - /* - * Manage a set of Zip files. For each file we need a pointer to the - * ZipFile and a time_t with the file's modification date. - * - * We currently only have two zip files (current app, "common" app). - * (This was originally written for 8, based on app/locale/vendor.) - */ - class ZipSet { - public: - ZipSet(void); - ~ZipSet(void); - - /* - * Return a ZipFileRO structure for a ZipFileRO with the specified - * parameters. - */ - ZipFileRO* getZip(const String8& path); - - Asset* getZipResourceTableAsset(const String8& path); - Asset* setZipResourceTableAsset(const String8& path, Asset* asset); - - ResTable* getZipResourceTable(const String8& path); - ResTable* setZipResourceTable(const String8& path, ResTable* res); - - // generate path, e.g. "common/en-US-noogle.zip" - static String8 getPathName(const char* path); - - bool isUpToDate(); - - private: - void closeZip(int idx); - - int getIndex(const String8& zip) const; - mutable Vector mZipPath; - mutable Vector > mZipFile; - }; - - // Protect all internal state. - mutable Mutex mLock; - - ZipSet mZipSet; - - Vector mAssetPaths; - char* mLocale; - char* mVendor; - - mutable ResTable* mResources; - ResTable_config* mConfig; - - /* - * Cached data for "loose" files. This lets us avoid poking at the - * filesystem when searching for loose assets. Each entry is the - * "extended partial" path, e.g. "default/default/foo/bar.txt". The - * full set of files is present, including ".EXCLUDE" entries. - * - * We do not cache directory names. We don't retain the ".gz", - * because to our clients "foo" and "foo.gz" both look like "foo". - */ - CacheMode mCacheMode; // is the cache enabled? - bool mCacheValid; // clear when locale or vendor changes - SortedVector mCache; -}; - -}; // namespace android - -#endif // __LIBS_ASSETMANAGER_H diff --git a/external/android/include/14/frameworks/base/include/utils/Atomic.h b/external/android/include/14/frameworks/base/include/utils/Atomic.h deleted file mode 100644 index 7eb476c..0000000 --- a/external/android/include/14/frameworks/base/include/utils/Atomic.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2005 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_UTILS_ATOMIC_H -#define ANDROID_UTILS_ATOMIC_H - -#include - -#endif // ANDROID_UTILS_ATOMIC_H diff --git a/external/android/include/14/frameworks/base/include/utils/BackupHelpers.h b/external/android/include/14/frameworks/base/include/utils/BackupHelpers.h deleted file mode 100644 index 1bb04a7..0000000 --- a/external/android/include/14/frameworks/base/include/utils/BackupHelpers.h +++ /dev/null @@ -1,169 +0,0 @@ -/* - * 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 _UTILS_BACKUP_HELPERS_H -#define _UTILS_BACKUP_HELPERS_H - -#include -#include -#include - -namespace android { - -enum { - BACKUP_HEADER_ENTITY_V1 = 0x61746144, // Data (little endian) -}; - -typedef struct { - int type; // BACKUP_HEADER_ENTITY_V1 - int keyLen; // length of the key name, not including the null terminator - int dataSize; // size of the data, not including the padding, -1 means delete -} entity_header_v1; - -struct SnapshotHeader { - int magic0; - int fileCount; - int magic1; - int totalSize; -}; - -struct FileState { - int modTime_sec; - int modTime_nsec; - int mode; - int size; - int crc32; - int nameLen; -}; - -struct FileRec { - String8 file; - bool deleted; - FileState s; -}; - - -/** - * Writes the data. - * - * If an error occurs, it poisons this object and all write calls will fail - * with the error that occurred. - */ -class BackupDataWriter -{ -public: - BackupDataWriter(int fd); - // does not close fd - ~BackupDataWriter(); - - status_t WriteEntityHeader(const String8& key, size_t dataSize); - - /* Note: WriteEntityData will write arbitrary data into the file without - * validation or a previously-supplied header. The full backup implementation - * uses it this way to generate a controlled binary stream that is not - * entity-structured. If the implementation here is changed, either this - * use case must remain valid, or the full backup implementation should be - * adjusted to use some other appropriate mechanism. - */ - status_t WriteEntityData(const void* data, size_t size); - - void SetKeyPrefix(const String8& keyPrefix); - -private: - explicit BackupDataWriter(); - status_t write_padding_for(int n); - - int m_fd; - status_t m_status; - ssize_t m_pos; - int m_entityCount; - String8 m_keyPrefix; -}; - -/** - * Reads the data. - * - * If an error occurs, it poisons this object and all write calls will fail - * with the error that occurred. - */ -class BackupDataReader -{ -public: - BackupDataReader(int fd); - // does not close fd - ~BackupDataReader(); - - status_t Status(); - status_t ReadNextHeader(bool* done, int* type); - - bool HasEntities(); - status_t ReadEntityHeader(String8* key, size_t* dataSize); - status_t SkipEntityData(); // must be called with the pointer at the beginning of the data. - ssize_t ReadEntityData(void* data, size_t size); - -private: - explicit BackupDataReader(); - status_t skip_padding(); - - int m_fd; - bool m_done; - status_t m_status; - ssize_t m_pos; - ssize_t m_dataEndPos; - int m_entityCount; - union { - int type; - entity_header_v1 entity; - } m_header; - String8 m_key; -}; - -int back_up_files(int oldSnapshotFD, BackupDataWriter* dataStream, int newSnapshotFD, - char const* const* files, char const* const *keys, int fileCount); - -int write_tarfile(const String8& packageName, const String8& domain, - const String8& rootPath, const String8& filePath, BackupDataWriter* outputStream); - -class RestoreHelperBase -{ -public: - RestoreHelperBase(); - ~RestoreHelperBase(); - - status_t WriteFile(const String8& filename, BackupDataReader* in); - status_t WriteSnapshot(int fd); - -private: - void* m_buf; - bool m_loggedUnknownMetadata; - KeyedVector m_files; -}; - -#define TEST_BACKUP_HELPERS 1 - -#if TEST_BACKUP_HELPERS -int backup_helper_test_empty(); -int backup_helper_test_four(); -int backup_helper_test_files(); -int backup_helper_test_null_base(); -int backup_helper_test_missing_file(); -int backup_helper_test_data_writer(); -int backup_helper_test_data_reader(); -#endif - -} // namespace android - -#endif // _UTILS_BACKUP_HELPERS_H diff --git a/external/android/include/14/frameworks/base/include/utils/BitSet.h b/external/android/include/14/frameworks/base/include/utils/BitSet.h deleted file mode 100644 index 9452e86..0000000 --- a/external/android/include/14/frameworks/base/include/utils/BitSet.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (C) 2010 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 UTILS_BITSET_H -#define UTILS_BITSET_H - -#include - -/* - * Contains some bit manipulation helpers. - */ - -namespace android { - -// A simple set of 32 bits that can be individually marked or cleared. -struct BitSet32 { - uint32_t value; - - inline BitSet32() : value(0) { } - explicit inline BitSet32(uint32_t value) : value(value) { } - - // Gets the value associated with a particular bit index. - static inline uint32_t valueForBit(uint32_t n) { return 0x80000000 >> n; } - - // Clears the bit set. - inline void clear() { value = 0; } - - // Returns the number of marked bits in the set. - inline uint32_t count() const { return __builtin_popcount(value); } - - // Returns true if the bit set does not contain any marked bits. - inline bool isEmpty() const { return ! value; } - - // Returns true if the bit set does not contain any unmarked bits. - inline bool isFull() const { return value == 0xffffffff; } - - // Returns true if the specified bit is marked. - inline bool hasBit(uint32_t n) const { return value & valueForBit(n); } - - // Marks the specified bit. - inline void markBit(uint32_t n) { value |= valueForBit(n); } - - // Clears the specified bit. - inline void clearBit(uint32_t n) { value &= ~ valueForBit(n); } - - // Finds the first marked bit in the set. - // Result is undefined if all bits are unmarked. - inline uint32_t firstMarkedBit() const { return __builtin_clz(value); } - - // Finds the first unmarked bit in the set. - // Result is undefined if all bits are marked. - inline uint32_t firstUnmarkedBit() const { return __builtin_clz(~ value); } - - // Finds the last marked bit in the set. - // Result is undefined if all bits are unmarked. - inline uint32_t lastMarkedBit() const { return 31 - __builtin_ctz(value); } - - // Finds the first marked bit in the set and clears it. Returns the bit index. - // Result is undefined if all bits are unmarked. - inline uint32_t clearFirstMarkedBit() { - uint32_t n = firstMarkedBit(); - clearBit(n); - return n; - } - - // Finds the first unmarked bit in the set and marks it. Returns the bit index. - // Result is undefined if all bits are marked. - inline uint32_t markFirstUnmarkedBit() { - uint32_t n = firstUnmarkedBit(); - markBit(n); - return n; - } - - // Finds the last marked bit in the set and clears it. Returns the bit index. - // Result is undefined if all bits are unmarked. - inline uint32_t clearLastMarkedBit() { - uint32_t n = lastMarkedBit(); - clearBit(n); - return n; - } - - // Gets the index of the specified bit in the set, which is the number of - // marked bits that appear before the specified bit. - inline uint32_t getIndexOfBit(uint32_t n) const { - return __builtin_popcount(value & ~(0xffffffffUL >> n)); - } - - inline bool operator== (const BitSet32& other) const { return value == other.value; } - inline bool operator!= (const BitSet32& other) const { return value != other.value; } -}; - -} // namespace android - -#endif // UTILS_BITSET_H diff --git a/external/android/include/14/frameworks/base/include/utils/BlobCache.h b/external/android/include/14/frameworks/base/include/utils/BlobCache.h deleted file mode 100644 index dc45ff0..0000000 --- a/external/android/include/14/frameworks/base/include/utils/BlobCache.h +++ /dev/null @@ -1,184 +0,0 @@ -/* - ** Copyright 2011, 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_BLOB_CACHE_H -#define ANDROID_BLOB_CACHE_H - -#include - -#include -#include -#include - -namespace android { - -// A BlobCache is an in-memory cache for binary key/value pairs. All the public -// methods are thread-safe. -// -// The cache contents can be serialized to a file and reloaded in a subsequent -// execution of the program. This serialization is non-portable and should only -// be loaded by the device that generated it. -class BlobCache : public RefBase { -public: - - // Create an empty blob cache. The blob cache will cache key/value pairs - // with key and value sizes less than or equal to maxKeySize and - // maxValueSize, respectively. The total combined size of ALL cache entries - // (key sizes plus value sizes) will not exceed maxTotalSize. - BlobCache(size_t maxKeySize, size_t maxValueSize, size_t maxTotalSize); - - // set inserts a new binary value into the cache and associates it with the - // given binary key. If the key or value are too large for the cache then - // the cache remains unchanged. This includes the case where a different - // value was previously associated with the given key - the old value will - // remain in the cache. If the given key and value are small enough to be - // put in the cache (based on the maxKeySize, maxValueSize, and maxTotalSize - // values specified to the BlobCache constructor), then the key/value pair - // will be in the cache after set returns. Note, however, that a subsequent - // call to set may evict old key/value pairs from the cache. - // - // Preconditions: - // key != NULL - // 0 < keySize - // value != NULL - // 0 < valueSize - void set(const void* key, size_t keySize, const void* value, - size_t valueSize); - - // The get function retrieves from the cache the binary value associated - // with a given binary key. If the key is present in the cache then the - // length of the binary value associated with that key is returned. If the - // value argument is non-NULL and the size of the cached value is less than - // valueSize bytes then the cached value is copied into the buffer pointed - // to by the value argument. If the key is not present in the cache then 0 - // is returned and the buffer pointed to by the value argument is not - // modified. - // - // Note that when calling get multiple times with the same key, the later - // calls may fail, returning 0, even if earlier calls succeeded. The return - // value must be checked for each call. - // - // Preconditions: - // key != NULL - // 0 < keySize - // 0 <= valueSize - size_t get(const void* key, size_t keySize, void* value, size_t valueSize); - -private: - // Copying is disallowed. - BlobCache(const BlobCache&); - void operator=(const BlobCache&); - - // A random function helper to get around MinGW not having nrand48() - long int blob_random(); - - // clean evicts a randomly chosen set of entries from the cache such that - // the total size of all remaining entries is less than mMaxTotalSize/2. - void clean(); - - // isCleanable returns true if the cache is full enough for the clean method - // to have some effect, and false otherwise. - bool isCleanable() const; - - // A Blob is an immutable sized unstructured data blob. - class Blob : public RefBase { - public: - Blob(const void* data, size_t size, bool copyData); - ~Blob(); - - bool operator<(const Blob& rhs) const; - - const void* getData() const; - size_t getSize() const; - - private: - // Copying is not allowed. - Blob(const Blob&); - void operator=(const Blob&); - - // mData points to the buffer containing the blob data. - const void* mData; - - // mSize is the size of the blob data in bytes. - size_t mSize; - - // mOwnsData indicates whether or not this Blob object should free the - // memory pointed to by mData when the Blob gets destructed. - bool mOwnsData; - }; - - // A CacheEntry is a single key/value pair in the cache. - class CacheEntry { - public: - CacheEntry(); - CacheEntry(const sp& key, const sp& value); - CacheEntry(const CacheEntry& ce); - - bool operator<(const CacheEntry& rhs) const; - const CacheEntry& operator=(const CacheEntry&); - - sp getKey() const; - sp getValue() const; - - void setValue(const sp& value); - - private: - - // mKey is the key that identifies the cache entry. - sp mKey; - - // mValue is the cached data associated with the key. - sp mValue; - }; - - // mMaxKeySize is the maximum key size that will be cached. Calls to - // BlobCache::set with a keySize parameter larger than mMaxKeySize will - // simply not add the key/value pair to the cache. - const size_t mMaxKeySize; - - // mMaxValueSize is the maximum value size that will be cached. Calls to - // BlobCache::set with a valueSize parameter larger than mMaxValueSize will - // simply not add the key/value pair to the cache. - const size_t mMaxValueSize; - - // mMaxTotalSize is the maximum size that all cache entries can occupy. This - // includes space for both keys and values. When a call to BlobCache::set - // would otherwise cause this limit to be exceeded, either the key/value - // pair passed to BlobCache::set will not be cached or other cache entries - // will be evicted from the cache to make room for the new entry. - const size_t mMaxTotalSize; - - // mTotalSize is the total combined size of all keys and values currently in - // the cache. - size_t mTotalSize; - - // mRandState is the pseudo-random number generator state. It is passed to - // nrand48 to generate random numbers when needed. It must be protected by - // mMutex. - unsigned short mRandState[3]; - - // mCacheEntries stores all the cache entries that are resident in memory. - // Cache entries are added to it by the 'set' method. - SortedVector mCacheEntries; - - // mMutex is used to synchronize access to all member variables. It must be - // locked any time the member variables are written or read. - Mutex mMutex; -}; - -} - -#endif // ANDROID_BLOB_CACHE_H diff --git a/external/android/include/14/frameworks/base/include/utils/BufferedTextOutput.h b/external/android/include/14/frameworks/base/include/utils/BufferedTextOutput.h deleted file mode 100644 index 69c6240..0000000 --- a/external/android/include/14/frameworks/base/include/utils/BufferedTextOutput.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2006 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_BUFFEREDTEXTOUTPUT_H -#define ANDROID_BUFFEREDTEXTOUTPUT_H - -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -class BufferedTextOutput : public TextOutput -{ -public: - //** Flags for constructor */ - enum { - MULTITHREADED = 0x0001 - }; - - BufferedTextOutput(uint32_t flags = 0); - virtual ~BufferedTextOutput(); - - virtual status_t print(const char* txt, size_t len); - virtual void moveIndent(int delta); - - virtual void pushBundle(); - virtual void popBundle(); - -protected: - virtual status_t writeLines(const struct iovec& vec, size_t N) = 0; - -private: - struct BufferState; - struct ThreadState; - - static ThreadState*getThreadState(); - static void threadDestructor(void *st); - - BufferState*getBuffer() const; - - uint32_t mFlags; - const int32_t mSeq; - const int32_t mIndex; - - Mutex mLock; - BufferState* mGlobalState; -}; - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_BUFFEREDTEXTOUTPUT_H diff --git a/external/android/include/14/frameworks/base/include/utils/ByteOrder.h b/external/android/include/14/frameworks/base/include/utils/ByteOrder.h deleted file mode 100644 index baa3a83..0000000 --- a/external/android/include/14/frameworks/base/include/utils/ByteOrder.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2006 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 _LIBS_UTILS_BYTE_ORDER_H -#define _LIBS_UTILS_BYTE_ORDER_H - -#include -#include -#ifdef HAVE_WINSOCK -#include -#else -#include -#endif - -/* - * These macros are like the hton/ntoh byte swapping macros, - * except they allow you to swap to and from the "device" byte - * order. The device byte order is the endianness of the target - * device -- for the ARM CPUs we use today, this is little endian. - * - * Note that the byte swapping functions have not been optimized - * much; performance is currently not an issue for them since the - * intent is to allow us to avoid byte swapping on the device. - */ - -static inline uint32_t android_swap_long(uint32_t v) -{ - return (v<<24) | ((v<<8)&0x00FF0000) | ((v>>8)&0x0000FF00) | (v>>24); -} - -static inline uint16_t android_swap_short(uint16_t v) -{ - return (v<<8) | (v>>8); -} - -#define DEVICE_BYTE_ORDER LITTLE_ENDIAN - -#if BYTE_ORDER == DEVICE_BYTE_ORDER - -#define dtohl(x) (x) -#define dtohs(x) (x) -#define htodl(x) (x) -#define htods(x) (x) - -#else - -#define dtohl(x) (android_swap_long(x)) -#define dtohs(x) (android_swap_short(x)) -#define htodl(x) (android_swap_long(x)) -#define htods(x) (android_swap_short(x)) - -#endif - -#if BYTE_ORDER == LITTLE_ENDIAN -#define fromlel(x) (x) -#define fromles(x) (x) -#define tolel(x) (x) -#define toles(x) (x) -#else -#define fromlel(x) (android_swap_long(x)) -#define fromles(x) (android_swap_short(x)) -#define tolel(x) (android_swap_long(x)) -#define toles(x) (android_swap_short(x)) -#endif - -#endif // _LIBS_UTILS_BYTE_ORDER_H diff --git a/external/android/include/14/frameworks/base/include/utils/CallStack.h b/external/android/include/14/frameworks/base/include/utils/CallStack.h deleted file mode 100644 index 8817120..0000000 --- a/external/android/include/14/frameworks/base/include/utils/CallStack.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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_CALLSTACK_H -#define ANDROID_CALLSTACK_H - -#include -#include - -#include - -// --------------------------------------------------------------------------- - -namespace android { - -class CallStack -{ -public: - enum { - MAX_DEPTH = 31 - }; - - CallStack(); - CallStack(const CallStack& rhs); - ~CallStack(); - - CallStack& operator = (const CallStack& rhs); - - bool operator == (const CallStack& rhs) const; - bool operator != (const CallStack& rhs) const; - bool operator < (const CallStack& rhs) const; - bool operator >= (const CallStack& rhs) const; - bool operator > (const CallStack& rhs) const; - bool operator <= (const CallStack& rhs) const; - - const void* operator [] (int index) const; - - void clear(); - - void update(int32_t ignoreDepth=1, int32_t maxDepth=MAX_DEPTH); - - // Dump a stack trace to the log - void dump(const char* prefix = 0) const; - - // Return a string (possibly very long) containing the complete stack trace - String8 toString(const char* prefix = 0) const; - - size_t size() const { return mCount; } - -private: - // Internal helper function - String8 toStringSingleLevel(const char* prefix, int32_t level) const; - - size_t mCount; - const void* mStack[MAX_DEPTH]; -}; - -}; // namespace android - - -// --------------------------------------------------------------------------- - -#endif // ANDROID_CALLSTACK_H diff --git a/external/android/include/14/frameworks/base/include/utils/Compat.h b/external/android/include/14/frameworks/base/include/utils/Compat.h deleted file mode 100644 index 1819266..0000000 --- a/external/android/include/14/frameworks/base/include/utils/Compat.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2010 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 __LIB_UTILS_COMPAT_H -#define __LIB_UTILS_COMPAT_H - -#include - -/* Compatibility definitions for non-Linux (i.e., BSD-based) hosts. */ -#ifndef HAVE_OFF64_T -#if _FILE_OFFSET_BITS < 64 -#error "_FILE_OFFSET_BITS < 64; large files are not supported on this platform" -#endif /* _FILE_OFFSET_BITS < 64 */ - -typedef off_t off64_t; - -static inline off64_t lseek64(int fd, off64_t offset, int whence) { - return lseek(fd, offset, whence); -} - -#ifdef HAVE_PREAD -static inline ssize_t pread64(int fd, void* buf, size_t nbytes, off64_t offset) { - return pread(fd, buf, nbytes, offset); -} -#endif - -#endif /* !HAVE_OFF64_T */ - -#endif /* __LIB_UTILS_COMPAT_H */ diff --git a/external/android/include/14/frameworks/base/include/utils/Debug.h b/external/android/include/14/frameworks/base/include/utils/Debug.h deleted file mode 100644 index d9ed32d..0000000 --- a/external/android/include/14/frameworks/base/include/utils/Debug.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2005 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_DEBUG_H -#define ANDROID_DEBUG_H - -#include -#include - -namespace android { -// --------------------------------------------------------------------------- - -#ifdef __cplusplus -template struct CompileTimeAssert; -template<> struct CompileTimeAssert {}; -#define COMPILE_TIME_ASSERT(_exp) \ - template class CompileTimeAssert< (_exp) >; -#endif -#define COMPILE_TIME_ASSERT_FUNCTION_SCOPE(_exp) \ - CompileTimeAssert<( _exp )>(); - -// --------------------------------------------------------------------------- - -#ifdef __cplusplus -template struct CompileTimeIfElse; -template -struct CompileTimeIfElse { typedef LHS TYPE; }; -template -struct CompileTimeIfElse { typedef RHS TYPE; }; -#endif - -// --------------------------------------------------------------------------- - -#ifdef __cplusplus -extern "C" { -#endif - -const char* stringForIndent(int32_t indentLevel); - -typedef void (*debugPrintFunc)(void* cookie, const char* txt); - -void printTypeCode(uint32_t typeCode, - debugPrintFunc func = 0, void* cookie = 0); - -void printHexData(int32_t indent, const void *buf, size_t length, - size_t bytesPerLine=16, int32_t singleLineBytesCutoff=16, - size_t alignment=0, bool cArrayStyle=false, - debugPrintFunc func = 0, void* cookie = 0); - -#ifdef __cplusplus -} -#endif - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_DEBUG_H diff --git a/external/android/include/14/frameworks/base/include/utils/Endian.h b/external/android/include/14/frameworks/base/include/utils/Endian.h deleted file mode 100644 index 19f2504..0000000 --- a/external/android/include/14/frameworks/base/include/utils/Endian.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// Android endian-ness defines. -// -#ifndef _LIBS_UTILS_ENDIAN_H -#define _LIBS_UTILS_ENDIAN_H - -#if defined(HAVE_ENDIAN_H) - -#include - -#else /*not HAVE_ENDIAN_H*/ - -#define __BIG_ENDIAN 0x1000 -#define __LITTLE_ENDIAN 0x0001 - -#if defined(HAVE_LITTLE_ENDIAN) -# define __BYTE_ORDER __LITTLE_ENDIAN -#else -# define __BYTE_ORDER __BIG_ENDIAN -#endif - -#endif /*not HAVE_ENDIAN_H*/ - -#endif /*_LIBS_UTILS_ENDIAN_H*/ diff --git a/external/android/include/14/frameworks/base/include/utils/Errors.h b/external/android/include/14/frameworks/base/include/utils/Errors.h deleted file mode 100644 index 0b75b19..0000000 --- a/external/android/include/14/frameworks/base/include/utils/Errors.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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_ERRORS_H -#define ANDROID_ERRORS_H - -#include -#include - -namespace android { - -// use this type to return error codes -#ifdef HAVE_MS_C_RUNTIME -typedef int status_t; -#else -typedef int32_t status_t; -#endif - -/* the MS C runtime lacks a few error codes */ - -/* - * Error codes. - * All error codes are negative values. - */ - -// Win32 #defines NO_ERROR as well. It has the same value, so there's no -// real conflict, though it's a bit awkward. -#ifdef _WIN32 -# undef NO_ERROR -#endif - -enum { - OK = 0, // Everything's swell. - NO_ERROR = 0, // No errors. - - UNKNOWN_ERROR = 0x80000000, - - NO_MEMORY = -ENOMEM, - INVALID_OPERATION = -ENOSYS, - BAD_VALUE = -EINVAL, - BAD_TYPE = 0x80000001, - NAME_NOT_FOUND = -ENOENT, - PERMISSION_DENIED = -EPERM, - NO_INIT = -ENODEV, - ALREADY_EXISTS = -EEXIST, - DEAD_OBJECT = -EPIPE, - FAILED_TRANSACTION = 0x80000002, - JPARKS_BROKE_IT = -EPIPE, -#if !defined(HAVE_MS_C_RUNTIME) - BAD_INDEX = -EOVERFLOW, - NOT_ENOUGH_DATA = -ENODATA, - WOULD_BLOCK = -EWOULDBLOCK, - TIMED_OUT = -ETIMEDOUT, - UNKNOWN_TRANSACTION = -EBADMSG, -#else - BAD_INDEX = -E2BIG, - NOT_ENOUGH_DATA = 0x80000003, - WOULD_BLOCK = 0x80000004, - TIMED_OUT = 0x80000005, - UNKNOWN_TRANSACTION = 0x80000006, -#endif - FDS_NOT_ALLOWED = 0x80000007, -}; - -// Restore define; enumeration is in "android" namespace, so the value defined -// there won't work for Win32 code in a different namespace. -#ifdef _WIN32 -# define NO_ERROR 0L -#endif - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_ERRORS_H diff --git a/external/android/include/14/frameworks/base/include/utils/FileMap.h b/external/android/include/14/frameworks/base/include/utils/FileMap.h deleted file mode 100644 index dfe6d51..0000000 --- a/external/android/include/14/frameworks/base/include/utils/FileMap.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (C) 2006 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. - */ - -// -// Encapsulate a shared file mapping. -// -#ifndef __LIBS_FILE_MAP_H -#define __LIBS_FILE_MAP_H - -#include - -#include - -#ifdef HAVE_WIN32_FILEMAP -#include -#endif - -namespace android { - -/* - * This represents a memory-mapped file. It might be the entire file or - * only part of it. This requires a little bookkeeping because the mapping - * needs to be aligned on page boundaries, and in some cases we'd like to - * have multiple references to the mapped area without creating additional - * maps. - * - * This always uses MAP_SHARED. - * - * TODO: we should be able to create a new FileMap that is a subset of - * an existing FileMap and shares the underlying mapped pages. Requires - * completing the refcounting stuff and possibly introducing the notion - * of a FileMap hierarchy. - */ -class FileMap { -public: - FileMap(void); - - /* - * Create a new mapping on an open file. - * - * Closing the file descriptor does not unmap the pages, so we don't - * claim ownership of the fd. - * - * Returns "false" on failure. - */ - bool create(const char* origFileName, int fd, - off64_t offset, size_t length, bool readOnly); - - /* - * Return the name of the file this map came from, if known. - */ - const char* getFileName(void) const { return mFileName; } - - /* - * Get a pointer to the piece of the file we requested. - */ - void* getDataPtr(void) const { return mDataPtr; } - - /* - * Get the length we requested. - */ - size_t getDataLength(void) const { return mDataLength; } - - /* - * Get the data offset used to create this map. - */ - off64_t getDataOffset(void) const { return mDataOffset; } - - /* - * Get a "copy" of the object. - */ - FileMap* acquire(void) { mRefCount++; return this; } - - /* - * Call this when mapping is no longer needed. - */ - void release(void) { - if (--mRefCount <= 0) - delete this; - } - - /* - * This maps directly to madvise() values, but allows us to avoid - * including everywhere. - */ - enum MapAdvice { - NORMAL, RANDOM, SEQUENTIAL, WILLNEED, DONTNEED - }; - - /* - * Apply an madvise() call to the entire file. - * - * Returns 0 on success, -1 on failure. - */ - int advise(MapAdvice advice); - -protected: - // don't delete objects; call release() - ~FileMap(void); - -private: - // these are not implemented - FileMap(const FileMap& src); - const FileMap& operator=(const FileMap& src); - - int mRefCount; // reference count - char* mFileName; // original file name, if known - void* mBasePtr; // base of mmap area; page aligned - size_t mBaseLength; // length, measured from "mBasePtr" - off64_t mDataOffset; // offset used when map was created - void* mDataPtr; // start of requested data, offset from base - size_t mDataLength; // length, measured from "mDataPtr" -#ifdef HAVE_WIN32_FILEMAP - HANDLE mFileHandle; // Win32 file handle - HANDLE mFileMapping; // Win32 file mapping handle -#endif - - static long mPageSize; -}; - -}; // namespace android - -#endif // __LIBS_FILE_MAP_H diff --git a/external/android/include/14/frameworks/base/include/utils/Flattenable.h b/external/android/include/14/frameworks/base/include/utils/Flattenable.h deleted file mode 100644 index 852be3b..0000000 --- a/external/android/include/14/frameworks/base/include/utils/Flattenable.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2010 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_UTILS_FLATTENABLE_H -#define ANDROID_UTILS_FLATTENABLE_H - - -#include -#include -#include - -namespace android { - -class Flattenable -{ -public: - // size in bytes of the flattened object - virtual size_t getFlattenedSize() const = 0; - - // number of file descriptors to flatten - virtual size_t getFdCount() const = 0; - - // flattens the object into buffer. - // size should be at least of getFlattenedSize() - // file descriptors are written in the fds[] array but ownership is - // not transfered (ie: they must be dupped by the caller of - // flatten() if needed). - virtual status_t flatten(void* buffer, size_t size, - int fds[], size_t count) const = 0; - - // unflattens the object from buffer. - // size should be equal to the value of getFlattenedSize() when the - // object was flattened. - // unflattened file descriptors are found in the fds[] array and - // don't need to be dupped(). ie: the caller of unflatten doesn't - // keep ownership. If a fd is not retained by unflatten() it must be - // explicitly closed. - virtual status_t unflatten(void const* buffer, size_t size, - int fds[], size_t count) = 0; - -protected: - virtual ~Flattenable() = 0; - -}; - -}; // namespace android - - -#endif /* ANDROID_UTILS_FLATTENABLE_H */ diff --git a/external/android/include/14/frameworks/base/include/utils/Functor.h b/external/android/include/14/frameworks/base/include/utils/Functor.h deleted file mode 100644 index e24ded4..0000000 --- a/external/android/include/14/frameworks/base/include/utils/Functor.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2011 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_FUNCTOR_H -#define ANDROID_FUNCTOR_H - -#include - -namespace android { - -class Functor { -public: - Functor() {} - virtual ~Functor() {} - virtual status_t operator ()(int what, void* data) { return NO_ERROR; } -}; - -}; // namespace android - -#endif // ANDROID_FUNCTOR_H diff --git a/external/android/include/14/frameworks/base/include/utils/GenerationCache.h b/external/android/include/14/frameworks/base/include/utils/GenerationCache.h deleted file mode 100644 index bb9ddd6..0000000 --- a/external/android/include/14/frameworks/base/include/utils/GenerationCache.h +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Copyright (C) 2010 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_UTILS_GENERATION_CACHE_H -#define ANDROID_UTILS_GENERATION_CACHE_H - -#include -#include - -namespace android { - -/** - * GenerationCache callback used when an item is removed - */ -template -class OnEntryRemoved { -public: - virtual ~OnEntryRemoved() { }; - virtual void operator()(EntryKey& key, EntryValue& value) = 0; -}; // class OnEntryRemoved - -template -struct Entry: public LightRefBase > { - Entry() { } - Entry(const Entry& e): - key(e.key), value(e.value), parent(e.parent), child(e.child) { } - Entry(sp > e): - key(e->key), value(e->value), parent(e->parent), child(e->child) { } - - EntryKey key; - EntryValue value; - - sp > parent; - sp > child; -}; // struct Entry - -/** - * A LRU type cache - */ -template -class GenerationCache { -public: - GenerationCache(uint32_t maxCapacity); - virtual ~GenerationCache(); - - enum Capacity { - kUnlimitedCapacity, - }; - - void setOnEntryRemovedListener(OnEntryRemoved* listener); - - void clear(); - - bool contains(K key) const; - V get(K key); - K getKeyAt(uint32_t index) const; - bool put(K key, V value); - V remove(K key); - V removeOldest(); - V getValueAt(uint32_t index) const; - - uint32_t size() const; - - void addToCache(sp > entry, K key, V value); - void attachToCache(sp > entry); - void detachFromCache(sp > entry); - - V removeAt(ssize_t index); - -private: - KeyedVector > > mCache; - uint32_t mMaxCapacity; - - OnEntryRemoved* mListener; - - sp > mOldest; - sp > mYoungest; -}; // class GenerationCache - -template -GenerationCache::GenerationCache(uint32_t maxCapacity): mMaxCapacity(maxCapacity), - mListener(NULL) { -}; - -template -GenerationCache::~GenerationCache() { - clear(); -}; - -template -uint32_t GenerationCache::size() const { - return mCache.size(); -} - -/** - * Should be set by the user of the Cache so that the callback is called whenever an item is - * removed from the cache - */ -template -void GenerationCache::setOnEntryRemovedListener(OnEntryRemoved* listener) { - mListener = listener; -} - -template -void GenerationCache::clear() { - if (mListener) { - for (uint32_t i = 0; i < mCache.size(); i++) { - sp > entry = mCache.valueAt(i); - if (mListener) { - (*mListener)(entry->key, entry->value); - } - } - } - mCache.clear(); - mYoungest.clear(); - mOldest.clear(); -} - -template -bool GenerationCache::contains(K key) const { - return mCache.indexOfKey(key) >= 0; -} - -template -K GenerationCache::getKeyAt(uint32_t index) const { - return mCache.keyAt(index); -} - -template -V GenerationCache::getValueAt(uint32_t index) const { - return mCache.valueAt(index)->value; -} - -template -V GenerationCache::get(K key) { - ssize_t index = mCache.indexOfKey(key); - if (index >= 0) { - sp > entry = mCache.valueAt(index); - if (entry.get()) { - detachFromCache(entry); - attachToCache(entry); - return entry->value; - } - } - - return NULL; -} - -template -bool GenerationCache::put(K key, V value) { - if (mMaxCapacity != kUnlimitedCapacity && mCache.size() >= mMaxCapacity) { - removeOldest(); - } - - ssize_t index = mCache.indexOfKey(key); - if (index < 0) { - sp > entry = new Entry; - addToCache(entry, key, value); - return true; - } - - return false; -} - -template -void GenerationCache::addToCache(sp > entry, K key, V value) { - entry->key = key; - entry->value = value; - mCache.add(key, entry); - attachToCache(entry); -} - -template -V GenerationCache::remove(K key) { - ssize_t index = mCache.indexOfKey(key); - if (index >= 0) { - return removeAt(index); - } - - return NULL; -} - -template -V GenerationCache::removeAt(ssize_t index) { - sp > entry = mCache.valueAt(index); - if (mListener) { - (*mListener)(entry->key, entry->value); - } - mCache.removeItemsAt(index, 1); - detachFromCache(entry); - - return entry->value; -} - -template -V GenerationCache::removeOldest() { - if (mOldest.get()) { - ssize_t index = mCache.indexOfKey(mOldest->key); - if (index >= 0) { - return removeAt(index); - } - } - - return NULL; -} - -template -void GenerationCache::attachToCache(sp > entry) { - if (!mYoungest.get()) { - mYoungest = mOldest = entry; - } else { - entry->parent = mYoungest; - mYoungest->child = entry; - mYoungest = entry; - } -} - -template -void GenerationCache::detachFromCache(sp > entry) { - if (entry->parent.get()) { - entry->parent->child = entry->child; - } - - if (entry->child.get()) { - entry->child->parent = entry->parent; - } - - if (mOldest == entry) { - mOldest = entry->child; - } - - if (mYoungest == entry) { - mYoungest = entry->parent; - } - - entry->parent.clear(); - entry->child.clear(); -} - -}; // namespace android - -#endif // ANDROID_UTILS_GENERATION_CACHE_H diff --git a/external/android/include/14/frameworks/base/include/utils/KeyedVector.h b/external/android/include/14/frameworks/base/include/utils/KeyedVector.h deleted file mode 100644 index 6bcdea4..0000000 --- a/external/android/include/14/frameworks/base/include/utils/KeyedVector.h +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright (C) 2005 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_KEYED_VECTOR_H -#define ANDROID_KEYED_VECTOR_H - -#include -#include -#include - -#include -#include -#include - -// --------------------------------------------------------------------------- - -namespace android { - -template -class KeyedVector -{ -public: - typedef KEY key_type; - typedef VALUE value_type; - - inline KeyedVector(); - - /* - * empty the vector - */ - - inline void clear() { mVector.clear(); } - - /*! - * vector stats - */ - - //! returns number of items in the vector - inline size_t size() const { return mVector.size(); } - //! returns wether or not the vector is empty - inline bool isEmpty() const { return mVector.isEmpty(); } - //! returns how many items can be stored without reallocating the backing store - inline size_t capacity() const { return mVector.capacity(); } - //! setst the capacity. capacity can never be reduced less than size() - inline ssize_t setCapacity(size_t size) { return mVector.setCapacity(size); } - - /*! - * accessors - */ - const VALUE& valueFor(const KEY& key) const; - const VALUE& valueAt(size_t index) const; - const KEY& keyAt(size_t index) const; - ssize_t indexOfKey(const KEY& key) const; - - /*! - * modifing the array - */ - - VALUE& editValueFor(const KEY& key); - VALUE& editValueAt(size_t index); - - /*! - * add/insert/replace items - */ - - ssize_t add(const KEY& key, const VALUE& item); - ssize_t replaceValueFor(const KEY& key, const VALUE& item); - ssize_t replaceValueAt(size_t index, const VALUE& item); - - /*! - * remove items - */ - - ssize_t removeItem(const KEY& key); - ssize_t removeItemsAt(size_t index, size_t count = 1); - -private: - SortedVector< key_value_pair_t > mVector; -}; - -// --------------------------------------------------------------------------- - -/** - * Variation of KeyedVector that holds a default value to return when - * valueFor() is called with a key that doesn't exist. - */ -template -class DefaultKeyedVector : public KeyedVector -{ -public: - inline DefaultKeyedVector(const VALUE& defValue = VALUE()); - const VALUE& valueFor(const KEY& key) const; - -private: - VALUE mDefault; -}; - -// --------------------------------------------------------------------------- - -template inline -KeyedVector::KeyedVector() -{ -} - -template inline -ssize_t KeyedVector::indexOfKey(const KEY& key) const { - return mVector.indexOf( key_value_pair_t(key) ); -} - -template inline -const VALUE& KeyedVector::valueFor(const KEY& key) const { - ssize_t i = indexOfKey(key); - assert(i>=0); - return mVector.itemAt(i).value; -} - -template inline -const VALUE& KeyedVector::valueAt(size_t index) const { - return mVector.itemAt(index).value; -} - -template inline -const KEY& KeyedVector::keyAt(size_t index) const { - return mVector.itemAt(index).key; -} - -template inline -VALUE& KeyedVector::editValueFor(const KEY& key) { - ssize_t i = indexOfKey(key); - assert(i>=0); - return mVector.editItemAt(i).value; -} - -template inline -VALUE& KeyedVector::editValueAt(size_t index) { - return mVector.editItemAt(index).value; -} - -template inline -ssize_t KeyedVector::add(const KEY& key, const VALUE& value) { - return mVector.add( key_value_pair_t(key, value) ); -} - -template inline -ssize_t KeyedVector::replaceValueFor(const KEY& key, const VALUE& value) { - key_value_pair_t pair(key, value); - mVector.remove(pair); - return mVector.add(pair); -} - -template inline -ssize_t KeyedVector::replaceValueAt(size_t index, const VALUE& item) { - if (index inline -ssize_t KeyedVector::removeItem(const KEY& key) { - return mVector.remove(key_value_pair_t(key)); -} - -template inline -ssize_t KeyedVector::removeItemsAt(size_t index, size_t count) { - return mVector.removeItemsAt(index, count); -} - -// --------------------------------------------------------------------------- - -template inline -DefaultKeyedVector::DefaultKeyedVector(const VALUE& defValue) - : mDefault(defValue) -{ -} - -template inline -const VALUE& DefaultKeyedVector::valueFor(const KEY& key) const { - ssize_t i = indexOfKey(key); - return i >= 0 ? KeyedVector::valueAt(i) : mDefault; -} - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_KEYED_VECTOR_H diff --git a/external/android/include/14/frameworks/base/include/utils/LinearTransform.h b/external/android/include/14/frameworks/base/include/utils/LinearTransform.h deleted file mode 100644 index 04cb355..0000000 --- a/external/android/include/14/frameworks/base/include/utils/LinearTransform.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2011 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 _LIBS_UTILS_LINEAR_TRANSFORM_H -#define _LIBS_UTILS_LINEAR_TRANSFORM_H - -#include - -namespace android { - -// LinearTransform defines a structure which hold the definition of a -// transformation from single dimensional coordinate system A into coordinate -// system B (and back again). Values in A and in B are 64 bit, the linear -// scale factor is expressed as a rational number using two 32 bit values. -// -// Specifically, let -// f(a) = b -// F(b) = f^-1(b) = a -// then -// -// f(a) = (((a - a_zero) * a_to_b_numer) / a_to_b_denom) + b_zero; -// -// and -// -// F(b) = (((b - b_zero) * a_to_b_denom) / a_to_b_numer) + a_zero; -// -struct LinearTransform { - int64_t a_zero; - int64_t b_zero; - int32_t a_to_b_numer; - uint32_t a_to_b_denom; - - // Transform from A->B - // Returns true on success, or false in the case of a singularity or an - // overflow. - bool doForwardTransform(int64_t a_in, int64_t* b_out) const; - - // Transform from B->A - // Returns true on success, or false in the case of a singularity or an - // overflow. - bool doReverseTransform(int64_t b_in, int64_t* a_out) const; - - // Helpers which will reduce the fraction N/D using Euclid's method. - template static void reduce(T* N, T* D); - static void reduce(int32_t* N, uint32_t* D); -}; - - -} - -#endif // _LIBS_UTILS_LINEAR_TRANSFORM_H diff --git a/external/android/include/14/frameworks/base/include/utils/List.h b/external/android/include/14/frameworks/base/include/utils/List.h deleted file mode 100644 index 403cd7f..0000000 --- a/external/android/include/14/frameworks/base/include/utils/List.h +++ /dev/null @@ -1,332 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// Templated list class. Normally we'd use STL, but we don't have that. -// This class mimics STL's interfaces. -// -// Objects are copied into the list with the '=' operator or with copy- -// construction, so if the compiler's auto-generated versions won't work for -// you, define your own. -// -// The only class you want to use from here is "List". -// -#ifndef _LIBS_UTILS_LIST_H -#define _LIBS_UTILS_LIST_H - -#include -#include - -namespace android { - -/* - * Doubly-linked list. Instantiate with "List myList". - * - * Objects added to the list are copied using the assignment operator, - * so this must be defined. - */ -template -class List -{ -protected: - /* - * One element in the list. - */ - class _Node { - public: - explicit _Node(const T& val) : mVal(val) {} - ~_Node() {} - inline T& getRef() { return mVal; } - inline const T& getRef() const { return mVal; } - inline _Node* getPrev() const { return mpPrev; } - inline _Node* getNext() const { return mpNext; } - inline void setVal(const T& val) { mVal = val; } - inline void setPrev(_Node* ptr) { mpPrev = ptr; } - inline void setNext(_Node* ptr) { mpNext = ptr; } - private: - friend class List; - friend class _ListIterator; - T mVal; - _Node* mpPrev; - _Node* mpNext; - }; - - /* - * Iterator for walking through the list. - */ - - template - struct CONST_ITERATOR { - typedef _Node const * NodePtr; - typedef const TYPE Type; - }; - - template - struct NON_CONST_ITERATOR { - typedef _Node* NodePtr; - typedef TYPE Type; - }; - - template< - typename U, - template class Constness - > - class _ListIterator { - typedef _ListIterator _Iter; - typedef typename Constness::NodePtr _NodePtr; - typedef typename Constness::Type _Type; - - explicit _ListIterator(_NodePtr ptr) : mpNode(ptr) {} - - public: - _ListIterator() {} - _ListIterator(const _Iter& rhs) : mpNode(rhs.mpNode) {} - ~_ListIterator() {} - - // this will handle conversions from iterator to const_iterator - // (and also all convertible iterators) - // Here, in this implementation, the iterators can be converted - // if the nodes can be converted - template explicit - _ListIterator(const V& rhs) : mpNode(rhs.mpNode) {} - - - /* - * Dereference operator. Used to get at the juicy insides. - */ - _Type& operator*() const { return mpNode->getRef(); } - _Type* operator->() const { return &(mpNode->getRef()); } - - /* - * Iterator comparison. - */ - inline bool operator==(const _Iter& right) const { - return mpNode == right.mpNode; } - - inline bool operator!=(const _Iter& right) const { - return mpNode != right.mpNode; } - - /* - * handle comparisons between iterator and const_iterator - */ - template - inline bool operator==(const OTHER& right) const { - return mpNode == right.mpNode; } - - template - inline bool operator!=(const OTHER& right) const { - return mpNode != right.mpNode; } - - /* - * Incr/decr, used to move through the list. - */ - inline _Iter& operator++() { // pre-increment - mpNode = mpNode->getNext(); - return *this; - } - const _Iter operator++(int) { // post-increment - _Iter tmp(*this); - mpNode = mpNode->getNext(); - return tmp; - } - inline _Iter& operator--() { // pre-increment - mpNode = mpNode->getPrev(); - return *this; - } - const _Iter operator--(int) { // post-increment - _Iter tmp(*this); - mpNode = mpNode->getPrev(); - return tmp; - } - - inline _NodePtr getNode() const { return mpNode; } - - _NodePtr mpNode; /* should be private, but older gcc fails */ - private: - friend class List; - }; - -public: - List() { - prep(); - } - List(const List& src) { // copy-constructor - prep(); - insert(begin(), src.begin(), src.end()); - } - virtual ~List() { - clear(); - delete[] (unsigned char*) mpMiddle; - } - - typedef _ListIterator iterator; - typedef _ListIterator const_iterator; - - List& operator=(const List& right); - - /* returns true if the list is empty */ - inline bool empty() const { return mpMiddle->getNext() == mpMiddle; } - - /* return #of elements in list */ - size_t size() const { - return size_t(distance(begin(), end())); - } - - /* - * Return the first element or one past the last element. The - * _Node* we're returning is converted to an "iterator" by a - * constructor in _ListIterator. - */ - inline iterator begin() { - return iterator(mpMiddle->getNext()); - } - inline const_iterator begin() const { - return const_iterator(const_cast<_Node const*>(mpMiddle->getNext())); - } - inline iterator end() { - return iterator(mpMiddle); - } - inline const_iterator end() const { - return const_iterator(const_cast<_Node const*>(mpMiddle)); - } - - /* add the object to the head or tail of the list */ - void push_front(const T& val) { insert(begin(), val); } - void push_back(const T& val) { insert(end(), val); } - - /* insert before the current node; returns iterator at new node */ - iterator insert(iterator posn, const T& val) - { - _Node* newNode = new _Node(val); // alloc & copy-construct - newNode->setNext(posn.getNode()); - newNode->setPrev(posn.getNode()->getPrev()); - posn.getNode()->getPrev()->setNext(newNode); - posn.getNode()->setPrev(newNode); - return iterator(newNode); - } - - /* insert a range of elements before the current node */ - void insert(iterator posn, const_iterator first, const_iterator last) { - for ( ; first != last; ++first) - insert(posn, *first); - } - - /* remove one entry; returns iterator at next node */ - iterator erase(iterator posn) { - _Node* pNext = posn.getNode()->getNext(); - _Node* pPrev = posn.getNode()->getPrev(); - pPrev->setNext(pNext); - pNext->setPrev(pPrev); - delete posn.getNode(); - return iterator(pNext); - } - - /* remove a range of elements */ - iterator erase(iterator first, iterator last) { - while (first != last) - erase(first++); // don't erase than incr later! - return iterator(last); - } - - /* remove all contents of the list */ - void clear() { - _Node* pCurrent = mpMiddle->getNext(); - _Node* pNext; - - while (pCurrent != mpMiddle) { - pNext = pCurrent->getNext(); - delete pCurrent; - pCurrent = pNext; - } - mpMiddle->setPrev(mpMiddle); - mpMiddle->setNext(mpMiddle); - } - - /* - * Measure the distance between two iterators. On exist, "first" - * will be equal to "last". The iterators must refer to the same - * list. - * - * FIXME: This is actually a generic iterator function. It should be a - * template function at the top-level with specializations for things like - * vector<>, which can just do pointer math). Here we limit it to - * _ListIterator of the same type but different constness. - */ - template< - typename U, - template class CL, - template class CR - > - ptrdiff_t distance( - _ListIterator first, _ListIterator last) const - { - ptrdiff_t count = 0; - while (first != last) { - ++first; - ++count; - } - return count; - } - -private: - /* - * I want a _Node but don't need it to hold valid data. More - * to the point, I don't want T's constructor to fire, since it - * might have side-effects or require arguments. So, we do this - * slightly uncouth storage alloc. - */ - void prep() { - mpMiddle = (_Node*) new unsigned char[sizeof(_Node)]; - mpMiddle->setPrev(mpMiddle); - mpMiddle->setNext(mpMiddle); - } - - /* - * This node plays the role of "pointer to head" and "pointer to tail". - * It sits in the middle of a circular list of nodes. The iterator - * runs around the circle until it encounters this one. - */ - _Node* mpMiddle; -}; - -/* - * Assignment operator. - * - * The simplest way to do this would be to clear out the target list and - * fill it with the source. However, we can speed things along by - * re-using existing elements. - */ -template -List& List::operator=(const List& right) -{ - if (this == &right) - return *this; // self-assignment - iterator firstDst = begin(); - iterator lastDst = end(); - const_iterator firstSrc = right.begin(); - const_iterator lastSrc = right.end(); - while (firstSrc != lastSrc && firstDst != lastDst) - *firstDst++ = *firstSrc++; - if (firstSrc == lastSrc) // ran out of elements in source? - erase(firstDst, lastDst); // yes, erase any extras - else - insert(lastDst, firstSrc, lastSrc); // copy remaining over - return *this; -} - -}; // namespace android - -#endif // _LIBS_UTILS_LIST_H diff --git a/external/android/include/14/frameworks/base/include/utils/Log.h b/external/android/include/14/frameworks/base/include/utils/Log.h deleted file mode 100644 index 3c6cc8b..0000000 --- a/external/android/include/14/frameworks/base/include/utils/Log.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// C/C++ logging functions. See the logging documentation for API details. -// -// We'd like these to be available from C code (in case we import some from -// somewhere), so this has a C interface. -// -// The output will be correct when the log file is shared between multiple -// threads and/or multiple processes so long as the operating system -// supports O_APPEND. These calls have mutex-protected data structures -// and so are NOT reentrant. Do not use LOG in a signal handler. -// -#ifndef _LIBS_UTILS_LOG_H -#define _LIBS_UTILS_LOG_H - -#include - -#endif // _LIBS_UTILS_LOG_H diff --git a/external/android/include/14/frameworks/base/include/utils/Looper.h b/external/android/include/14/frameworks/base/include/utils/Looper.h deleted file mode 100644 index 3c2905d..0000000 --- a/external/android/include/14/frameworks/base/include/utils/Looper.h +++ /dev/null @@ -1,377 +0,0 @@ -/* - * Copyright (C) 2010 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 UTILS_LOOPER_H -#define UTILS_LOOPER_H - -#include -#include -#include -#include - -#include - -// When defined, uses epoll_wait() for polling, otherwise uses poll(). -#define LOOPER_USES_EPOLL - -// When defined, logs performance statistics for tuning and debugging purposes. -//#define LOOPER_STATISTICS - -#ifdef LOOPER_USES_EPOLL -#include -#else -#include -#endif - -/* - * Declare a concrete type for the NDK's looper forward declaration. - */ -struct ALooper { -}; - -namespace android { - -/** - * A message that can be posted to a Looper. - */ -struct Message { - Message() : what(0) { } - Message(int what) : what(what) { } - - /* The message type. (interpretation is left up to the handler) */ - int what; -}; - - -/** - * Interface for a Looper message handler. - * - * The Looper holds a strong reference to the message handler whenever it has - * a message to deliver to it. Make sure to call Looper::removeMessages - * to remove any pending messages destined for the handler so that the handler - * can be destroyed. - */ -class MessageHandler : public virtual RefBase { -protected: - virtual ~MessageHandler() { } - -public: - /** - * Handles a message. - */ - virtual void handleMessage(const Message& message) = 0; -}; - - -/** - * A simple proxy that holds a weak reference to a message handler. - */ -class WeakMessageHandler : public MessageHandler { -public: - WeakMessageHandler(const wp& handler); - virtual void handleMessage(const Message& message); - -private: - wp mHandler; -}; - - -/** - * A polling loop that supports monitoring file descriptor events, optionally - * using callbacks. The implementation uses epoll() internally. - * - * A looper can be associated with a thread although there is no requirement that it must be. - */ -class Looper : public ALooper, public RefBase { -protected: - virtual ~Looper(); - -public: - /** - * Creates a looper. - * - * If allowNonCallbaks is true, the looper will allow file descriptors to be - * registered without associated callbacks. This assumes that the caller of - * pollOnce() is prepared to handle callback-less events itself. - */ - Looper(bool allowNonCallbacks); - - /** - * Returns whether this looper instance allows the registration of file descriptors - * using identifiers instead of callbacks. - */ - bool getAllowNonCallbacks() const; - - /** - * Waits for events to be available, with optional timeout in milliseconds. - * Invokes callbacks for all file descriptors on which an event occurred. - * - * If the timeout is zero, returns immediately without blocking. - * If the timeout is negative, waits indefinitely until an event appears. - * - * Returns ALOOPER_POLL_WAKE if the poll was awoken using wake() before - * the timeout expired and no callbacks were invoked and no other file - * descriptors were ready. - * - * Returns ALOOPER_POLL_CALLBACK if one or more callbacks were invoked. - * - * Returns ALOOPER_POLL_TIMEOUT if there was no data before the given - * timeout expired. - * - * Returns ALOOPER_POLL_ERROR if an error occurred. - * - * Returns a value >= 0 containing an identifier if its file descriptor has data - * and it has no callback function (requiring the caller here to handle it). - * In this (and only this) case outFd, outEvents and outData will contain the poll - * events and data associated with the fd, otherwise they will be set to NULL. - * - * This method does not return until it has finished invoking the appropriate callbacks - * for all file descriptors that were signalled. - */ - int pollOnce(int timeoutMillis, int* outFd, int* outEvents, void** outData); - inline int pollOnce(int timeoutMillis) { - return pollOnce(timeoutMillis, NULL, NULL, NULL); - } - - /** - * Like pollOnce(), but performs all pending callbacks until all - * data has been consumed or a file descriptor is available with no callback. - * This function will never return ALOOPER_POLL_CALLBACK. - */ - int pollAll(int timeoutMillis, int* outFd, int* outEvents, void** outData); - inline int pollAll(int timeoutMillis) { - return pollAll(timeoutMillis, NULL, NULL, NULL); - } - - /** - * Wakes the poll asynchronously. - * - * This method can be called on any thread. - * This method returns immediately. - */ - void wake(); - - /** - * Adds a new file descriptor to be polled by the looper. - * If the same file descriptor was previously added, it is replaced. - * - * "fd" is the file descriptor to be added. - * "ident" is an identifier for this event, which is returned from ALooper_pollOnce(). - * The identifier must be >= 0, or ALOOPER_POLL_CALLBACK if providing a non-NULL callback. - * "events" are the poll events to wake up on. Typically this is ALOOPER_EVENT_INPUT. - * "callback" is the function to call when there is an event on the file descriptor. - * "data" is a private data pointer to supply to the callback. - * - * There are two main uses of this function: - * - * (1) If "callback" is non-NULL, then this function will be called when there is - * data on the file descriptor. It should execute any events it has pending, - * appropriately reading from the file descriptor. The 'ident' is ignored in this case. - * - * (2) If "callback" is NULL, the 'ident' will be returned by ALooper_pollOnce - * when its file descriptor has data available, requiring the caller to take - * care of processing it. - * - * Returns 1 if the file descriptor was added, 0 if the arguments were invalid. - * - * This method can be called on any thread. - * This method may block briefly if it needs to wake the poll. - */ - int addFd(int fd, int ident, int events, ALooper_callbackFunc callback, void* data); - - /** - * Removes a previously added file descriptor from the looper. - * - * When this method returns, it is safe to close the file descriptor since the looper - * will no longer have a reference to it. However, it is possible for the callback to - * already be running or for it to run one last time if the file descriptor was already - * signalled. Calling code is responsible for ensuring that this case is safely handled. - * For example, if the callback takes care of removing itself during its own execution either - * by returning 0 or by calling this method, then it can be guaranteed to not be invoked - * again at any later time unless registered anew. - * - * Returns 1 if the file descriptor was removed, 0 if none was previously registered. - * - * This method can be called on any thread. - * This method may block briefly if it needs to wake the poll. - */ - int removeFd(int fd); - - /** - * Enqueues a message to be processed by the specified handler. - * - * The handler must not be null. - * This method can be called on any thread. - */ - void sendMessage(const sp& handler, const Message& message); - - /** - * Enqueues a message to be processed by the specified handler after all pending messages - * after the specified delay. - * - * The time delay is specified in uptime nanoseconds. - * The handler must not be null. - * This method can be called on any thread. - */ - void sendMessageDelayed(nsecs_t uptimeDelay, const sp& handler, - const Message& message); - - /** - * Enqueues a message to be processed by the specified handler after all pending messages - * at the specified time. - * - * The time is specified in uptime nanoseconds. - * The handler must not be null. - * This method can be called on any thread. - */ - void sendMessageAtTime(nsecs_t uptime, const sp& handler, - const Message& message); - - /** - * Removes all messages for the specified handler from the queue. - * - * The handler must not be null. - * This method can be called on any thread. - */ - void removeMessages(const sp& handler); - - /** - * Removes all messages of a particular type for the specified handler from the queue. - * - * The handler must not be null. - * This method can be called on any thread. - */ - void removeMessages(const sp& handler, int what); - - /** - * Prepares a looper associated with the calling thread, and returns it. - * If the thread already has a looper, it is returned. Otherwise, a new - * one is created, associated with the thread, and returned. - * - * The opts may be ALOOPER_PREPARE_ALLOW_NON_CALLBACKS or 0. - */ - static sp prepare(int opts); - - /** - * Sets the given looper to be associated with the calling thread. - * If another looper is already associated with the thread, it is replaced. - * - * If "looper" is NULL, removes the currently associated looper. - */ - static void setForThread(const sp& looper); - - /** - * Returns the looper associated with the calling thread, or NULL if - * there is not one. - */ - static sp getForThread(); - -private: - struct Request { - int fd; - int ident; - ALooper_callbackFunc callback; - void* data; - }; - - struct Response { - int events; - Request request; - }; - - struct MessageEnvelope { - MessageEnvelope() : uptime(0) { } - - MessageEnvelope(nsecs_t uptime, const sp handler, - const Message& message) : uptime(uptime), handler(handler), message(message) { - } - - nsecs_t uptime; - sp handler; - Message message; - }; - - const bool mAllowNonCallbacks; // immutable - - int mWakeReadPipeFd; // immutable - int mWakeWritePipeFd; // immutable - Mutex mLock; - - Vector mMessageEnvelopes; // guarded by mLock - bool mSendingMessage; // guarded by mLock - -#ifdef LOOPER_USES_EPOLL - int mEpollFd; // immutable - - // Locked list of file descriptor monitoring requests. - KeyedVector mRequests; // guarded by mLock -#else - // The lock guards state used to track whether there is a poll() in progress and whether - // there are any other threads waiting in wakeAndLock(). The condition variables - // are used to transfer control among these threads such that all waiters are - // serviced before a new poll can begin. - // The wakeAndLock() method increments mWaiters, wakes the poll, blocks on mAwake - // until mPolling becomes false, then decrements mWaiters again. - // The poll() method blocks on mResume until mWaiters becomes 0, then sets - // mPolling to true, blocks until the poll completes, then resets mPolling to false - // and signals mResume if there are waiters. - bool mPolling; // guarded by mLock - uint32_t mWaiters; // guarded by mLock - Condition mAwake; // guarded by mLock - Condition mResume; // guarded by mLock - - Vector mRequestedFds; // must hold mLock and mPolling must be false to modify - Vector mRequests; // must hold mLock and mPolling must be false to modify - - ssize_t getRequestIndexLocked(int fd); - void wakeAndLock(); -#endif - -#ifdef LOOPER_STATISTICS - static const int SAMPLED_WAKE_CYCLES_TO_AGGREGATE = 100; - static const int SAMPLED_POLLS_TO_AGGREGATE = 1000; - - nsecs_t mPendingWakeTime; - int mPendingWakeCount; - - int mSampledWakeCycles; - int mSampledWakeCountSum; - nsecs_t mSampledWakeLatencySum; - - int mSampledPolls; - int mSampledZeroPollCount; - int mSampledZeroPollLatencySum; - int mSampledTimeoutPollCount; - int mSampledTimeoutPollLatencySum; -#endif - - // This state is only used privately by pollOnce and does not require a lock since - // it runs on a single thread. - Vector mResponses; - size_t mResponseIndex; - nsecs_t mNextMessageUptime; // set to LLONG_MAX when none - - int pollInner(int timeoutMillis); - void awoken(); - void pushResponse(int events, const Request& request); - - static void initTLSKey(); - static void threadDestructor(void *st); -}; - -} // namespace android - -#endif // UTILS_LOOPER_H diff --git a/external/android/include/14/frameworks/base/include/utils/ObbFile.h b/external/android/include/14/frameworks/base/include/utils/ObbFile.h deleted file mode 100644 index 47559cd..0000000 --- a/external/android/include/14/frameworks/base/include/utils/ObbFile.h +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (C) 2010 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 OBBFILE_H_ -#define OBBFILE_H_ - -#include -#include - -#include -#include - -namespace android { - -// OBB flags (bit 0) -#define OBB_OVERLAY (1 << 0) -#define OBB_SALTED (1 << 1) - -class ObbFile : public RefBase { -protected: - virtual ~ObbFile(); - -public: - ObbFile(); - - bool readFrom(const char* filename); - bool readFrom(int fd); - bool writeTo(const char* filename); - bool writeTo(int fd); - bool removeFrom(const char* filename); - bool removeFrom(int fd); - - const char* getFileName() const { - return mFileName; - } - - const String8 getPackageName() const { - return mPackageName; - } - - void setPackageName(String8 packageName) { - mPackageName = packageName; - } - - int32_t getVersion() const { - return mVersion; - } - - void setVersion(int32_t version) { - mVersion = version; - } - - int32_t getFlags() const { - return mFlags; - } - - void setFlags(int32_t flags) { - mFlags = flags; - } - - const unsigned char* getSalt(size_t* length) const { - if ((mFlags & OBB_SALTED) == 0) { - *length = 0; - return NULL; - } - - *length = sizeof(mSalt); - return mSalt; - } - - bool setSalt(const unsigned char* salt, size_t length) { - if (length != sizeof(mSalt)) { - return false; - } - - memcpy(mSalt, salt, sizeof(mSalt)); - mFlags |= OBB_SALTED; - return true; - } - - bool isOverlay() { - return (mFlags & OBB_OVERLAY) == OBB_OVERLAY; - } - - void setOverlay(bool overlay) { - if (overlay) { - mFlags |= OBB_OVERLAY; - } else { - mFlags &= ~OBB_OVERLAY; - } - } - - static inline uint32_t get4LE(const unsigned char* buf) { - return buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24); - } - - static inline void put4LE(unsigned char* buf, uint32_t val) { - buf[0] = val & 0xFF; - buf[1] = (val >> 8) & 0xFF; - buf[2] = (val >> 16) & 0xFF; - buf[3] = (val >> 24) & 0xFF; - } - -private: - /* Package name this ObbFile is associated with */ - String8 mPackageName; - - /* Package version this ObbFile is associated with */ - int32_t mVersion; - - /* Flags for this OBB type. */ - int32_t mFlags; - - /* Whether the file is salted. */ - bool mSalted; - - /* The encryption salt. */ - unsigned char mSalt[8]; - - const char* mFileName; - - size_t mFileSize; - - size_t mFooterStart; - - unsigned char* mReadBuf; - - bool parseObbFile(int fd); -}; - -} -#endif /* OBBFILE_H_ */ diff --git a/external/android/include/14/frameworks/base/include/utils/PropertyMap.h b/external/android/include/14/frameworks/base/include/utils/PropertyMap.h deleted file mode 100644 index a9e674f..0000000 --- a/external/android/include/14/frameworks/base/include/utils/PropertyMap.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (C) 2010 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 _UTILS_PROPERTY_MAP_H -#define _UTILS_PROPERTY_MAP_H - -#include -#include -#include -#include - -namespace android { - -/* - * Provides a mechanism for passing around string-based property key / value pairs - * and loading them from property files. - * - * The property files have the following simple structure: - * - * # Comment - * key = value - * - * Keys and values are any sequence of printable ASCII characters. - * The '=' separates the key from the value. - * The key and value may not contain whitespace. - * - * The '\' character is reserved for escape sequences and is not currently supported. - * The '"" character is reserved for quoting and is not currently supported. - * Files that contain the '\' or '"' character will fail to parse. - * - * The file must not contain duplicate keys. - * - * TODO Support escape sequences and quoted values when needed. - */ -class PropertyMap { -public: - /* Creates an empty property map. */ - PropertyMap(); - ~PropertyMap(); - - /* Clears the property map. */ - void clear(); - - /* Adds a property. - * Replaces the property with the same key if it is already present. - */ - void addProperty(const String8& key, const String8& value); - - /* Returns true if the property map contains the specified key. */ - bool hasProperty(const String8& key) const; - - /* Gets the value of a property and parses it. - * Returns true and sets outValue if the key was found and its value was parsed successfully. - * Otherwise returns false and does not modify outValue. (Also logs a warning.) - */ - bool tryGetProperty(const String8& key, String8& outValue) const; - bool tryGetProperty(const String8& key, bool& outValue) const; - bool tryGetProperty(const String8& key, int32_t& outValue) const; - bool tryGetProperty(const String8& key, float& outValue) const; - - /* Adds all values from the specified property map. */ - void addAll(const PropertyMap* map); - - /* Gets the underlying property map. */ - inline const KeyedVector& getProperties() const { return mProperties; } - - /* Loads a property map from a file. */ - static status_t load(const String8& filename, PropertyMap** outMap); - -private: - class Parser { - PropertyMap* mMap; - Tokenizer* mTokenizer; - - public: - Parser(PropertyMap* map, Tokenizer* tokenizer); - ~Parser(); - status_t parse(); - - private: - status_t parseType(); - status_t parseKey(); - status_t parseKeyProperty(); - status_t parseModifier(const String8& token, int32_t* outMetaState); - status_t parseCharacterLiteral(char16_t* outCharacter); - }; - - KeyedVector mProperties; -}; - -} // namespace android - -#endif // _UTILS_PROPERTY_MAP_H diff --git a/external/android/include/14/frameworks/base/include/utils/RefBase.h b/external/android/include/14/frameworks/base/include/utils/RefBase.h deleted file mode 100644 index c7a9b78..0000000 --- a/external/android/include/14/frameworks/base/include/utils/RefBase.h +++ /dev/null @@ -1,528 +0,0 @@ -/* - * Copyright (C) 2005 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_REF_BASE_H -#define ANDROID_REF_BASE_H - -#include - -#include -#include -#include -#include - -#include - -// --------------------------------------------------------------------------- -namespace android { - -class TextOutput; -TextOutput& printWeakPointer(TextOutput& to, const void* val); - -// --------------------------------------------------------------------------- - -#define COMPARE_WEAK(_op_) \ -inline bool operator _op_ (const sp& o) const { \ - return m_ptr _op_ o.m_ptr; \ -} \ -inline bool operator _op_ (const T* o) const { \ - return m_ptr _op_ o; \ -} \ -template \ -inline bool operator _op_ (const sp& o) const { \ - return m_ptr _op_ o.m_ptr; \ -} \ -template \ -inline bool operator _op_ (const U* o) const { \ - return m_ptr _op_ o; \ -} - -// --------------------------------------------------------------------------- -class ReferenceMover; -class ReferenceConverterBase { -public: - virtual size_t getReferenceTypeSize() const = 0; - virtual void* getReferenceBase(void const*) const = 0; - inline virtual ~ReferenceConverterBase() { } -}; - -// --------------------------------------------------------------------------- - -class RefBase -{ -public: - void incStrong(const void* id) const; - void decStrong(const void* id) const; - - void forceIncStrong(const void* id) const; - - //! DEBUGGING ONLY: Get current strong ref count. - int32_t getStrongCount() const; - - class weakref_type - { - public: - RefBase* refBase() const; - - void incWeak(const void* id); - void decWeak(const void* id); - - // acquires a strong reference if there is already one. - bool attemptIncStrong(const void* id); - - // acquires a weak reference if there is already one. - // This is not always safe. see ProcessState.cpp and BpBinder.cpp - // for proper use. - bool attemptIncWeak(const void* id); - - //! DEBUGGING ONLY: Get current weak ref count. - int32_t getWeakCount() const; - - //! DEBUGGING ONLY: Print references held on object. - void printRefs() const; - - //! DEBUGGING ONLY: Enable tracking for this object. - // enable -- enable/disable tracking - // retain -- when tracking is enable, if true, then we save a stack trace - // for each reference and dereference; when retain == false, we - // match up references and dereferences and keep only the - // outstanding ones. - - void trackMe(bool enable, bool retain); - }; - - weakref_type* createWeak(const void* id) const; - - weakref_type* getWeakRefs() const; - - //! DEBUGGING ONLY: Print references held on object. - inline void printRefs() const { getWeakRefs()->printRefs(); } - - //! DEBUGGING ONLY: Enable tracking of object. - inline void trackMe(bool enable, bool retain) - { - getWeakRefs()->trackMe(enable, retain); - } - - typedef RefBase basetype; - -protected: - RefBase(); - virtual ~RefBase(); - - //! Flags for extendObjectLifetime() - enum { - OBJECT_LIFETIME_STRONG = 0x0000, - OBJECT_LIFETIME_WEAK = 0x0001, - OBJECT_LIFETIME_MASK = 0x0001 - }; - - void extendObjectLifetime(int32_t mode); - - //! Flags for onIncStrongAttempted() - enum { - FIRST_INC_STRONG = 0x0001 - }; - - virtual void onFirstRef(); - virtual void onLastStrongRef(const void* id); - virtual bool onIncStrongAttempted(uint32_t flags, const void* id); - virtual void onLastWeakRef(const void* id); - -private: - friend class ReferenceMover; - static void moveReferences(void* d, void const* s, size_t n, - const ReferenceConverterBase& caster); - -private: - friend class weakref_type; - class weakref_impl; - - RefBase(const RefBase& o); - RefBase& operator=(const RefBase& o); - - weakref_impl* const mRefs; -}; - -// --------------------------------------------------------------------------- - -template -class LightRefBase -{ -public: - inline LightRefBase() : mCount(0) { } - inline void incStrong(const void* id) const { - android_atomic_inc(&mCount); - } - inline void decStrong(const void* id) const { - if (android_atomic_dec(&mCount) == 1) { - delete static_cast(this); - } - } - //! DEBUGGING ONLY: Get current strong ref count. - inline int32_t getStrongCount() const { - return mCount; - } - - typedef LightRefBase basetype; - -protected: - inline ~LightRefBase() { } - -private: - friend class ReferenceMover; - inline static void moveReferences(void* d, void const* s, size_t n, - const ReferenceConverterBase& caster) { } - -private: - mutable volatile int32_t mCount; -}; - -// --------------------------------------------------------------------------- - -template -class wp -{ -public: - typedef typename RefBase::weakref_type weakref_type; - - inline wp() : m_ptr(0) { } - - wp(T* other); - wp(const wp& other); - wp(const sp& other); - template wp(U* other); - template wp(const sp& other); - template wp(const wp& other); - - ~wp(); - - // Assignment - - wp& operator = (T* other); - wp& operator = (const wp& other); - wp& operator = (const sp& other); - - template wp& operator = (U* other); - template wp& operator = (const wp& other); - template wp& operator = (const sp& other); - - void set_object_and_refs(T* other, weakref_type* refs); - - // promotion to sp - - sp promote() const; - - // Reset - - void clear(); - - // Accessors - - inline weakref_type* get_refs() const { return m_refs; } - - inline T* unsafe_get() const { return m_ptr; } - - // Operators - - COMPARE_WEAK(==) - COMPARE_WEAK(!=) - COMPARE_WEAK(>) - COMPARE_WEAK(<) - COMPARE_WEAK(<=) - COMPARE_WEAK(>=) - - inline bool operator == (const wp& o) const { - return (m_ptr == o.m_ptr) && (m_refs == o.m_refs); - } - template - inline bool operator == (const wp& o) const { - return m_ptr == o.m_ptr; - } - - inline bool operator > (const wp& o) const { - return (m_ptr == o.m_ptr) ? (m_refs > o.m_refs) : (m_ptr > o.m_ptr); - } - template - inline bool operator > (const wp& o) const { - return (m_ptr == o.m_ptr) ? (m_refs > o.m_refs) : (m_ptr > o.m_ptr); - } - - inline bool operator < (const wp& o) const { - return (m_ptr == o.m_ptr) ? (m_refs < o.m_refs) : (m_ptr < o.m_ptr); - } - template - inline bool operator < (const wp& o) const { - return (m_ptr == o.m_ptr) ? (m_refs < o.m_refs) : (m_ptr < o.m_ptr); - } - inline bool operator != (const wp& o) const { return m_refs != o.m_refs; } - template inline bool operator != (const wp& o) const { return !operator == (o); } - inline bool operator <= (const wp& o) const { return !operator > (o); } - template inline bool operator <= (const wp& o) const { return !operator > (o); } - inline bool operator >= (const wp& o) const { return !operator < (o); } - template inline bool operator >= (const wp& o) const { return !operator < (o); } - -private: - template friend class sp; - template friend class wp; - - T* m_ptr; - weakref_type* m_refs; -}; - -template -TextOutput& operator<<(TextOutput& to, const wp& val); - -#undef COMPARE_WEAK - -// --------------------------------------------------------------------------- -// No user serviceable parts below here. - -template -wp::wp(T* other) - : m_ptr(other) -{ - if (other) m_refs = other->createWeak(this); -} - -template -wp::wp(const wp& other) - : m_ptr(other.m_ptr), m_refs(other.m_refs) -{ - if (m_ptr) m_refs->incWeak(this); -} - -template -wp::wp(const sp& other) - : m_ptr(other.m_ptr) -{ - if (m_ptr) { - m_refs = m_ptr->createWeak(this); - } -} - -template template -wp::wp(U* other) - : m_ptr(other) -{ - if (other) m_refs = other->createWeak(this); -} - -template template -wp::wp(const wp& other) - : m_ptr(other.m_ptr) -{ - if (m_ptr) { - m_refs = other.m_refs; - m_refs->incWeak(this); - } -} - -template template -wp::wp(const sp& other) - : m_ptr(other.m_ptr) -{ - if (m_ptr) { - m_refs = m_ptr->createWeak(this); - } -} - -template -wp::~wp() -{ - if (m_ptr) m_refs->decWeak(this); -} - -template -wp& wp::operator = (T* other) -{ - weakref_type* newRefs = - other ? other->createWeak(this) : 0; - if (m_ptr) m_refs->decWeak(this); - m_ptr = other; - m_refs = newRefs; - return *this; -} - -template -wp& wp::operator = (const wp& other) -{ - weakref_type* otherRefs(other.m_refs); - T* otherPtr(other.m_ptr); - if (otherPtr) otherRefs->incWeak(this); - if (m_ptr) m_refs->decWeak(this); - m_ptr = otherPtr; - m_refs = otherRefs; - return *this; -} - -template -wp& wp::operator = (const sp& other) -{ - weakref_type* newRefs = - other != NULL ? other->createWeak(this) : 0; - T* otherPtr(other.m_ptr); - if (m_ptr) m_refs->decWeak(this); - m_ptr = otherPtr; - m_refs = newRefs; - return *this; -} - -template template -wp& wp::operator = (U* other) -{ - weakref_type* newRefs = - other ? other->createWeak(this) : 0; - if (m_ptr) m_refs->decWeak(this); - m_ptr = other; - m_refs = newRefs; - return *this; -} - -template template -wp& wp::operator = (const wp& other) -{ - weakref_type* otherRefs(other.m_refs); - U* otherPtr(other.m_ptr); - if (otherPtr) otherRefs->incWeak(this); - if (m_ptr) m_refs->decWeak(this); - m_ptr = otherPtr; - m_refs = otherRefs; - return *this; -} - -template template -wp& wp::operator = (const sp& other) -{ - weakref_type* newRefs = - other != NULL ? other->createWeak(this) : 0; - U* otherPtr(other.m_ptr); - if (m_ptr) m_refs->decWeak(this); - m_ptr = otherPtr; - m_refs = newRefs; - return *this; -} - -template -void wp::set_object_and_refs(T* other, weakref_type* refs) -{ - if (other) refs->incWeak(this); - if (m_ptr) m_refs->decWeak(this); - m_ptr = other; - m_refs = refs; -} - -template -sp wp::promote() const -{ - sp result; - if (m_ptr && m_refs->attemptIncStrong(&result)) { - result.set_pointer(m_ptr); - } - return result; -} - -template -void wp::clear() -{ - if (m_ptr) { - m_refs->decWeak(this); - m_ptr = 0; - } -} - -template -inline TextOutput& operator<<(TextOutput& to, const wp& val) -{ - return printWeakPointer(to, val.unsafe_get()); -} - -// --------------------------------------------------------------------------- - -// this class just serves as a namespace so TYPE::moveReferences can stay -// private. - -class ReferenceMover { - // StrongReferenceCast and WeakReferenceCast do the impedance matching - // between the generic (void*) implementation in Refbase and the strongly typed - // template specializations below. - - template - struct StrongReferenceCast : public ReferenceConverterBase { - virtual size_t getReferenceTypeSize() const { return sizeof( sp ); } - virtual void* getReferenceBase(void const* p) const { - sp const* sptr(reinterpret_cast const*>(p)); - return static_cast(sptr->get()); - } - }; - - template - struct WeakReferenceCast : public ReferenceConverterBase { - virtual size_t getReferenceTypeSize() const { return sizeof( wp ); } - virtual void* getReferenceBase(void const* p) const { - wp const* sptr(reinterpret_cast const*>(p)); - return static_cast(sptr->unsafe_get()); - } - }; - -public: - template static inline - void move_references(sp* d, sp const* s, size_t n) { - memmove(d, s, n*sizeof(sp)); - StrongReferenceCast caster; - TYPE::moveReferences(d, s, n, caster); - } - template static inline - void move_references(wp* d, wp const* s, size_t n) { - memmove(d, s, n*sizeof(wp)); - WeakReferenceCast caster; - TYPE::moveReferences(d, s, n, caster); - } -}; - -// specialization for moving sp<> and wp<> types. -// these are used by the [Sorted|Keyed]Vector<> implementations -// sp<> and wp<> need to be handled specially, because they do not -// have trivial copy operation in the general case (see RefBase.cpp -// when DEBUG ops are enabled), but can be implemented very -// efficiently in most cases. - -template inline -void move_forward_type(sp* d, sp const* s, size_t n) { - ReferenceMover::move_references(d, s, n); -} - -template inline -void move_backward_type(sp* d, sp const* s, size_t n) { - ReferenceMover::move_references(d, s, n); -} - -template inline -void move_forward_type(wp* d, wp const* s, size_t n) { - ReferenceMover::move_references(d, s, n); -} - -template inline -void move_backward_type(wp* d, wp const* s, size_t n) { - ReferenceMover::move_references(d, s, n); -} - - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_REF_BASE_H diff --git a/external/android/include/14/frameworks/base/include/utils/ResourceTypes.h b/external/android/include/14/frameworks/base/include/utils/ResourceTypes.h deleted file mode 100644 index 612ff93..0000000 --- a/external/android/include/14/frameworks/base/include/utils/ResourceTypes.h +++ /dev/null @@ -1,2128 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// Definitions of resource data structures. -// -#ifndef _LIBS_UTILS_RESOURCE_TYPES_H -#define _LIBS_UTILS_RESOURCE_TYPES_H - -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include - -namespace android { - -/** ******************************************************************** - * PNG Extensions - * - * New private chunks that may be placed in PNG images. - * - *********************************************************************** */ - -/** - * This chunk specifies how to split an image into segments for - * scaling. - * - * There are J horizontal and K vertical segments. These segments divide - * the image into J*K regions as follows (where J=4 and K=3): - * - * F0 S0 F1 S1 - * +-----+----+------+-------+ - * S2| 0 | 1 | 2 | 3 | - * +-----+----+------+-------+ - * | | | | | - * | | | | | - * F2| 4 | 5 | 6 | 7 | - * | | | | | - * | | | | | - * +-----+----+------+-------+ - * S3| 8 | 9 | 10 | 11 | - * +-----+----+------+-------+ - * - * Each horizontal and vertical segment is considered to by either - * stretchable (marked by the Sx labels) or fixed (marked by the Fy - * labels), in the horizontal or vertical axis, respectively. In the - * above example, the first is horizontal segment (F0) is fixed, the - * next is stretchable and then they continue to alternate. Note that - * the segment list for each axis can begin or end with a stretchable - * or fixed segment. - * - * The relative sizes of the stretchy segments indicates the relative - * amount of stretchiness of the regions bordered by the segments. For - * example, regions 3, 7 and 11 above will take up more horizontal space - * than regions 1, 5 and 9 since the horizontal segment associated with - * the first set of regions is larger than the other set of regions. The - * ratios of the amount of horizontal (or vertical) space taken by any - * two stretchable slices is exactly the ratio of their corresponding - * segment lengths. - * - * xDivs and yDivs point to arrays of horizontal and vertical pixel - * indices. The first pair of Divs (in either array) indicate the - * starting and ending points of the first stretchable segment in that - * axis. The next pair specifies the next stretchable segment, etc. So - * in the above example xDiv[0] and xDiv[1] specify the horizontal - * coordinates for the regions labeled 1, 5 and 9. xDiv[2] and - * xDiv[3] specify the coordinates for regions 3, 7 and 11. Note that - * the leftmost slices always start at x=0 and the rightmost slices - * always end at the end of the image. So, for example, the regions 0, - * 4 and 8 (which are fixed along the X axis) start at x value 0 and - * go to xDiv[0] and slices 2, 6 and 10 start at xDiv[1] and end at - * xDiv[2]. - * - * The array pointed to by the colors field lists contains hints for - * each of the regions. They are ordered according left-to-right and - * top-to-bottom as indicated above. For each segment that is a solid - * color the array entry will contain that color value; otherwise it - * will contain NO_COLOR. Segments that are completely transparent - * will always have the value TRANSPARENT_COLOR. - * - * The PNG chunk type is "npTc". - */ -struct Res_png_9patch -{ - Res_png_9patch() : wasDeserialized(false), xDivs(NULL), - yDivs(NULL), colors(NULL) { } - - int8_t wasDeserialized; - int8_t numXDivs; - int8_t numYDivs; - int8_t numColors; - - // These tell where the next section of a patch starts. - // For example, the first patch includes the pixels from - // 0 to xDivs[0]-1 and the second patch includes the pixels - // from xDivs[0] to xDivs[1]-1. - // Note: allocation/free of these pointers is left to the caller. - int32_t* xDivs; - int32_t* yDivs; - - int32_t paddingLeft, paddingRight; - int32_t paddingTop, paddingBottom; - - enum { - // The 9 patch segment is not a solid color. - NO_COLOR = 0x00000001, - - // The 9 patch segment is completely transparent. - TRANSPARENT_COLOR = 0x00000000 - }; - // Note: allocation/free of this pointer is left to the caller. - uint32_t* colors; - - // Convert data from device representation to PNG file representation. - void deviceToFile(); - // Convert data from PNG file representation to device representation. - void fileToDevice(); - // Serialize/Marshall the patch data into a newly malloc-ed block - void* serialize(); - // Serialize/Marshall the patch data - void serialize(void* outData); - // Deserialize/Unmarshall the patch data - static Res_png_9patch* deserialize(const void* data); - // Compute the size of the serialized data structure - size_t serializedSize(); -}; - -/** ******************************************************************** - * Base Types - * - * These are standard types that are shared between multiple specific - * resource types. - * - *********************************************************************** */ - -/** - * Header that appears at the front of every data chunk in a resource. - */ -struct ResChunk_header -{ - // Type identifier for this chunk. The meaning of this value depends - // on the containing chunk. - uint16_t type; - - // Size of the chunk header (in bytes). Adding this value to - // the address of the chunk allows you to find its associated data - // (if any). - uint16_t headerSize; - - // Total size of this chunk (in bytes). This is the chunkSize plus - // the size of any data associated with the chunk. Adding this value - // to the chunk allows you to completely skip its contents (including - // any child chunks). If this value is the same as chunkSize, there is - // no data associated with the chunk. - uint32_t size; -}; - -enum { - RES_NULL_TYPE = 0x0000, - RES_STRING_POOL_TYPE = 0x0001, - RES_TABLE_TYPE = 0x0002, - RES_XML_TYPE = 0x0003, - - // Chunk types in RES_XML_TYPE - RES_XML_FIRST_CHUNK_TYPE = 0x0100, - RES_XML_START_NAMESPACE_TYPE= 0x0100, - RES_XML_END_NAMESPACE_TYPE = 0x0101, - RES_XML_START_ELEMENT_TYPE = 0x0102, - RES_XML_END_ELEMENT_TYPE = 0x0103, - RES_XML_CDATA_TYPE = 0x0104, - RES_XML_LAST_CHUNK_TYPE = 0x017f, - // This contains a uint32_t array mapping strings in the string - // pool back to resource identifiers. It is optional. - RES_XML_RESOURCE_MAP_TYPE = 0x0180, - - // Chunk types in RES_TABLE_TYPE - RES_TABLE_PACKAGE_TYPE = 0x0200, - RES_TABLE_TYPE_TYPE = 0x0201, - RES_TABLE_TYPE_SPEC_TYPE = 0x0202 -}; - -/** - * Macros for building/splitting resource identifiers. - */ -#define Res_VALIDID(resid) (resid != 0) -#define Res_CHECKID(resid) ((resid&0xFFFF0000) != 0) -#define Res_MAKEID(package, type, entry) \ - (((package+1)<<24) | (((type+1)&0xFF)<<16) | (entry&0xFFFF)) -#define Res_GETPACKAGE(id) ((id>>24)-1) -#define Res_GETTYPE(id) (((id>>16)&0xFF)-1) -#define Res_GETENTRY(id) (id&0xFFFF) - -#define Res_INTERNALID(resid) ((resid&0xFFFF0000) != 0 && (resid&0xFF0000) == 0) -#define Res_MAKEINTERNAL(entry) (0x01000000 | (entry&0xFFFF)) -#define Res_MAKEARRAY(entry) (0x02000000 | (entry&0xFFFF)) - -#define Res_MAXPACKAGE 255 - -/** - * Representation of a value in a resource, supplying type - * information. - */ -struct Res_value -{ - // Number of bytes in this structure. - uint16_t size; - - // Always set to 0. - uint8_t res0; - - // Type of the data value. - enum { - // Contains no data. - TYPE_NULL = 0x00, - // The 'data' holds a ResTable_ref, a reference to another resource - // table entry. - TYPE_REFERENCE = 0x01, - // The 'data' holds an attribute resource identifier. - TYPE_ATTRIBUTE = 0x02, - // The 'data' holds an index into the containing resource table's - // global value string pool. - TYPE_STRING = 0x03, - // The 'data' holds a single-precision floating point number. - TYPE_FLOAT = 0x04, - // The 'data' holds a complex number encoding a dimension value, - // such as "100in". - TYPE_DIMENSION = 0x05, - // The 'data' holds a complex number encoding a fraction of a - // container. - TYPE_FRACTION = 0x06, - - // Beginning of integer flavors... - TYPE_FIRST_INT = 0x10, - - // The 'data' is a raw integer value of the form n..n. - TYPE_INT_DEC = 0x10, - // The 'data' is a raw integer value of the form 0xn..n. - TYPE_INT_HEX = 0x11, - // The 'data' is either 0 or 1, for input "false" or "true" respectively. - TYPE_INT_BOOLEAN = 0x12, - - // Beginning of color integer flavors... - TYPE_FIRST_COLOR_INT = 0x1c, - - // The 'data' is a raw integer value of the form #aarrggbb. - TYPE_INT_COLOR_ARGB8 = 0x1c, - // The 'data' is a raw integer value of the form #rrggbb. - TYPE_INT_COLOR_RGB8 = 0x1d, - // The 'data' is a raw integer value of the form #argb. - TYPE_INT_COLOR_ARGB4 = 0x1e, - // The 'data' is a raw integer value of the form #rgb. - TYPE_INT_COLOR_RGB4 = 0x1f, - - // ...end of integer flavors. - TYPE_LAST_COLOR_INT = 0x1f, - - // ...end of integer flavors. - TYPE_LAST_INT = 0x1f - }; - uint8_t dataType; - - // Structure of complex data values (TYPE_UNIT and TYPE_FRACTION) - enum { - // Where the unit type information is. This gives us 16 possible - // types, as defined below. - COMPLEX_UNIT_SHIFT = 0, - COMPLEX_UNIT_MASK = 0xf, - - // TYPE_DIMENSION: Value is raw pixels. - COMPLEX_UNIT_PX = 0, - // TYPE_DIMENSION: Value is Device Independent Pixels. - COMPLEX_UNIT_DIP = 1, - // TYPE_DIMENSION: Value is a Scaled device independent Pixels. - COMPLEX_UNIT_SP = 2, - // TYPE_DIMENSION: Value is in points. - COMPLEX_UNIT_PT = 3, - // TYPE_DIMENSION: Value is in inches. - COMPLEX_UNIT_IN = 4, - // TYPE_DIMENSION: Value is in millimeters. - COMPLEX_UNIT_MM = 5, - - // TYPE_FRACTION: A basic fraction of the overall size. - COMPLEX_UNIT_FRACTION = 0, - // TYPE_FRACTION: A fraction of the parent size. - COMPLEX_UNIT_FRACTION_PARENT = 1, - - // Where the radix information is, telling where the decimal place - // appears in the mantissa. This give us 4 possible fixed point - // representations as defined below. - COMPLEX_RADIX_SHIFT = 4, - COMPLEX_RADIX_MASK = 0x3, - - // The mantissa is an integral number -- i.e., 0xnnnnnn.0 - COMPLEX_RADIX_23p0 = 0, - // The mantissa magnitude is 16 bits -- i.e, 0xnnnn.nn - COMPLEX_RADIX_16p7 = 1, - // The mantissa magnitude is 8 bits -- i.e, 0xnn.nnnn - COMPLEX_RADIX_8p15 = 2, - // The mantissa magnitude is 0 bits -- i.e, 0x0.nnnnnn - COMPLEX_RADIX_0p23 = 3, - - // Where the actual value is. This gives us 23 bits of - // precision. The top bit is the sign. - COMPLEX_MANTISSA_SHIFT = 8, - COMPLEX_MANTISSA_MASK = 0xffffff - }; - - // The data for this item, as interpreted according to dataType. - uint32_t data; - - void copyFrom_dtoh(const Res_value& src); -}; - -/** - * This is a reference to a unique entry (a ResTable_entry structure) - * in a resource table. The value is structured as: 0xpptteeee, - * where pp is the package index, tt is the type index in that - * package, and eeee is the entry index in that type. The package - * and type values start at 1 for the first item, to help catch cases - * where they have not been supplied. - */ -struct ResTable_ref -{ - uint32_t ident; -}; - -/** - * Reference to a string in a string pool. - */ -struct ResStringPool_ref -{ - // Index into the string pool table (uint32_t-offset from the indices - // immediately after ResStringPool_header) at which to find the location - // of the string data in the pool. - uint32_t index; -}; - -/** ******************************************************************** - * String Pool - * - * A set of strings that can be references by others through a - * ResStringPool_ref. - * - *********************************************************************** */ - -/** - * Definition for a pool of strings. The data of this chunk is an - * array of uint32_t providing indices into the pool, relative to - * stringsStart. At stringsStart are all of the UTF-16 strings - * concatenated together; each starts with a uint16_t of the string's - * length and each ends with a 0x0000 terminator. If a string is > - * 32767 characters, the high bit of the length is set meaning to take - * those 15 bits as a high word and it will be followed by another - * uint16_t containing the low word. - * - * If styleCount is not zero, then immediately following the array of - * uint32_t indices into the string table is another array of indices - * into a style table starting at stylesStart. Each entry in the - * style table is an array of ResStringPool_span structures. - */ -struct ResStringPool_header -{ - struct ResChunk_header header; - - // Number of strings in this pool (number of uint32_t indices that follow - // in the data). - uint32_t stringCount; - - // Number of style span arrays in the pool (number of uint32_t indices - // follow the string indices). - uint32_t styleCount; - - // Flags. - enum { - // If set, the string index is sorted by the string values (based - // on strcmp16()). - SORTED_FLAG = 1<<0, - - // String pool is encoded in UTF-8 - UTF8_FLAG = 1<<8 - }; - uint32_t flags; - - // Index from header of the string data. - uint32_t stringsStart; - - // Index from header of the style data. - uint32_t stylesStart; -}; - -/** - * This structure defines a span of style information associated with - * a string in the pool. - */ -struct ResStringPool_span -{ - enum { - END = 0xFFFFFFFF - }; - - // This is the name of the span -- that is, the name of the XML - // tag that defined it. The special value END (0xFFFFFFFF) indicates - // the end of an array of spans. - ResStringPool_ref name; - - // The range of characters in the string that this span applies to. - uint32_t firstChar, lastChar; -}; - -/** - * Convenience class for accessing data in a ResStringPool resource. - */ -class ResStringPool -{ -public: - ResStringPool(); - ResStringPool(const void* data, size_t size, bool copyData=false); - ~ResStringPool(); - - status_t setTo(const void* data, size_t size, bool copyData=false); - - status_t getError() const; - - void uninit(); - - inline const char16_t* stringAt(const ResStringPool_ref& ref, size_t* outLen) const { - return stringAt(ref.index, outLen); - } - const char16_t* stringAt(size_t idx, size_t* outLen) const; - - const char* string8At(size_t idx, size_t* outLen) const; - - const ResStringPool_span* styleAt(const ResStringPool_ref& ref) const; - const ResStringPool_span* styleAt(size_t idx) const; - - ssize_t indexOfString(const char16_t* str, size_t strLen) const; - - size_t size() const; - -#ifndef HAVE_ANDROID_OS - bool isUTF8() const; -#endif - -private: - status_t mError; - void* mOwnedData; - const ResStringPool_header* mHeader; - size_t mSize; - mutable Mutex mDecodeLock; - const uint32_t* mEntries; - const uint32_t* mEntryStyles; - const void* mStrings; - char16_t** mCache; - uint32_t mStringPoolSize; // number of uint16_t - const uint32_t* mStyles; - uint32_t mStylePoolSize; // number of uint32_t -}; - -/** ******************************************************************** - * XML Tree - * - * Binary representation of an XML document. This is designed to - * express everything in an XML document, in a form that is much - * easier to parse on the device. - * - *********************************************************************** */ - -/** - * XML tree header. This appears at the front of an XML tree, - * describing its content. It is followed by a flat array of - * ResXMLTree_node structures; the hierarchy of the XML document - * is described by the occurrance of RES_XML_START_ELEMENT_TYPE - * and corresponding RES_XML_END_ELEMENT_TYPE nodes in the array. - */ -struct ResXMLTree_header -{ - struct ResChunk_header header; -}; - -/** - * Basic XML tree node. A single item in the XML document. Extended info - * about the node can be found after header.headerSize. - */ -struct ResXMLTree_node -{ - struct ResChunk_header header; - - // Line number in original source file at which this element appeared. - uint32_t lineNumber; - - // Optional XML comment that was associated with this element; -1 if none. - struct ResStringPool_ref comment; -}; - -/** - * Extended XML tree node for CDATA tags -- includes the CDATA string. - * Appears header.headerSize bytes after a ResXMLTree_node. - */ -struct ResXMLTree_cdataExt -{ - // The raw CDATA character data. - struct ResStringPool_ref data; - - // The typed value of the character data if this is a CDATA node. - struct Res_value typedData; -}; - -/** - * Extended XML tree node for namespace start/end nodes. - * Appears header.headerSize bytes after a ResXMLTree_node. - */ -struct ResXMLTree_namespaceExt -{ - // The prefix of the namespace. - struct ResStringPool_ref prefix; - - // The URI of the namespace. - struct ResStringPool_ref uri; -}; - -/** - * Extended XML tree node for element start/end nodes. - * Appears header.headerSize bytes after a ResXMLTree_node. - */ -struct ResXMLTree_endElementExt -{ - // String of the full namespace of this element. - struct ResStringPool_ref ns; - - // String name of this node if it is an ELEMENT; the raw - // character data if this is a CDATA node. - struct ResStringPool_ref name; -}; - -/** - * Extended XML tree node for start tags -- includes attribute - * information. - * Appears header.headerSize bytes after a ResXMLTree_node. - */ -struct ResXMLTree_attrExt -{ - // String of the full namespace of this element. - struct ResStringPool_ref ns; - - // String name of this node if it is an ELEMENT; the raw - // character data if this is a CDATA node. - struct ResStringPool_ref name; - - // Byte offset from the start of this structure where the attributes start. - uint16_t attributeStart; - - // Size of the ResXMLTree_attribute structures that follow. - uint16_t attributeSize; - - // Number of attributes associated with an ELEMENT. These are - // available as an array of ResXMLTree_attribute structures - // immediately following this node. - uint16_t attributeCount; - - // Index (1-based) of the "id" attribute. 0 if none. - uint16_t idIndex; - - // Index (1-based) of the "class" attribute. 0 if none. - uint16_t classIndex; - - // Index (1-based) of the "style" attribute. 0 if none. - uint16_t styleIndex; -}; - -struct ResXMLTree_attribute -{ - // Namespace of this attribute. - struct ResStringPool_ref ns; - - // Name of this attribute. - struct ResStringPool_ref name; - - // The original raw string value of this attribute. - struct ResStringPool_ref rawValue; - - // Processesd typed value of this attribute. - struct Res_value typedValue; -}; - -class ResXMLTree; - -class ResXMLParser -{ -public: - ResXMLParser(const ResXMLTree& tree); - - enum event_code_t { - BAD_DOCUMENT = -1, - START_DOCUMENT = 0, - END_DOCUMENT = 1, - - FIRST_CHUNK_CODE = RES_XML_FIRST_CHUNK_TYPE, - - START_NAMESPACE = RES_XML_START_NAMESPACE_TYPE, - END_NAMESPACE = RES_XML_END_NAMESPACE_TYPE, - START_TAG = RES_XML_START_ELEMENT_TYPE, - END_TAG = RES_XML_END_ELEMENT_TYPE, - TEXT = RES_XML_CDATA_TYPE - }; - - struct ResXMLPosition - { - event_code_t eventCode; - const ResXMLTree_node* curNode; - const void* curExt; - }; - - void restart(); - - const ResStringPool& getStrings() const; - - event_code_t getEventType() const; - // Note, unlike XmlPullParser, the first call to next() will return - // START_TAG of the first element. - event_code_t next(); - - // These are available for all nodes: - int32_t getCommentID() const; - const uint16_t* getComment(size_t* outLen) const; - uint32_t getLineNumber() const; - - // This is available for TEXT: - int32_t getTextID() const; - const uint16_t* getText(size_t* outLen) const; - ssize_t getTextValue(Res_value* outValue) const; - - // These are available for START_NAMESPACE and END_NAMESPACE: - int32_t getNamespacePrefixID() const; - const uint16_t* getNamespacePrefix(size_t* outLen) const; - int32_t getNamespaceUriID() const; - const uint16_t* getNamespaceUri(size_t* outLen) const; - - // These are available for START_TAG and END_TAG: - int32_t getElementNamespaceID() const; - const uint16_t* getElementNamespace(size_t* outLen) const; - int32_t getElementNameID() const; - const uint16_t* getElementName(size_t* outLen) const; - - // Remaining methods are for retrieving information about attributes - // associated with a START_TAG: - - size_t getAttributeCount() const; - - // Returns -1 if no namespace, -2 if idx out of range. - int32_t getAttributeNamespaceID(size_t idx) const; - const uint16_t* getAttributeNamespace(size_t idx, size_t* outLen) const; - - int32_t getAttributeNameID(size_t idx) const; - const uint16_t* getAttributeName(size_t idx, size_t* outLen) const; - uint32_t getAttributeNameResID(size_t idx) const; - - int32_t getAttributeValueStringID(size_t idx) const; - const uint16_t* getAttributeStringValue(size_t idx, size_t* outLen) const; - - int32_t getAttributeDataType(size_t idx) const; - int32_t getAttributeData(size_t idx) const; - ssize_t getAttributeValue(size_t idx, Res_value* outValue) const; - - ssize_t indexOfAttribute(const char* ns, const char* attr) const; - ssize_t indexOfAttribute(const char16_t* ns, size_t nsLen, - const char16_t* attr, size_t attrLen) const; - - ssize_t indexOfID() const; - ssize_t indexOfClass() const; - ssize_t indexOfStyle() const; - - void getPosition(ResXMLPosition* pos) const; - void setPosition(const ResXMLPosition& pos); - -private: - friend class ResXMLTree; - - event_code_t nextNode(); - - const ResXMLTree& mTree; - event_code_t mEventCode; - const ResXMLTree_node* mCurNode; - const void* mCurExt; -}; - -/** - * Convenience class for accessing data in a ResXMLTree resource. - */ -class ResXMLTree : public ResXMLParser -{ -public: - ResXMLTree(); - ResXMLTree(const void* data, size_t size, bool copyData=false); - ~ResXMLTree(); - - status_t setTo(const void* data, size_t size, bool copyData=false); - - status_t getError() const; - - void uninit(); - -private: - friend class ResXMLParser; - - status_t validateNode(const ResXMLTree_node* node) const; - - status_t mError; - void* mOwnedData; - const ResXMLTree_header* mHeader; - size_t mSize; - const uint8_t* mDataEnd; - ResStringPool mStrings; - const uint32_t* mResIds; - size_t mNumResIds; - const ResXMLTree_node* mRootNode; - const void* mRootExt; - event_code_t mRootCode; -}; - -/** ******************************************************************** - * RESOURCE TABLE - * - *********************************************************************** */ - -/** - * Header for a resource table. Its data contains a series of - * additional chunks: - * * A ResStringPool_header containing all table values. - * * One or more ResTable_package chunks. - * - * Specific entries within a resource table can be uniquely identified - * with a single integer as defined by the ResTable_ref structure. - */ -struct ResTable_header -{ - struct ResChunk_header header; - - // The number of ResTable_package structures. - uint32_t packageCount; -}; - -/** - * A collection of resource data types within a package. Followed by - * one or more ResTable_type and ResTable_typeSpec structures containing the - * entry values for each resource type. - */ -struct ResTable_package -{ - struct ResChunk_header header; - - // If this is a base package, its ID. Package IDs start - // at 1 (corresponding to the value of the package bits in a - // resource identifier). 0 means this is not a base package. - uint32_t id; - - // Actual name of this package, \0-terminated. - char16_t name[128]; - - // Offset to a ResStringPool_header defining the resource - // type symbol table. If zero, this package is inheriting from - // another base package (overriding specific values in it). - uint32_t typeStrings; - - // Last index into typeStrings that is for public use by others. - uint32_t lastPublicType; - - // Offset to a ResStringPool_header defining the resource - // key symbol table. If zero, this package is inheriting from - // another base package (overriding specific values in it). - uint32_t keyStrings; - - // Last index into keyStrings that is for public use by others. - uint32_t lastPublicKey; -}; - -/** - * Describes a particular resource configuration. - */ -struct ResTable_config -{ - // Number of bytes in this structure. - uint32_t size; - - union { - struct { - // Mobile country code (from SIM). 0 means "any". - uint16_t mcc; - // Mobile network code (from SIM). 0 means "any". - uint16_t mnc; - }; - uint32_t imsi; - }; - - union { - struct { - // \0\0 means "any". Otherwise, en, fr, etc. - char language[2]; - - // \0\0 means "any". Otherwise, US, CA, etc. - char country[2]; - }; - uint32_t locale; - }; - - enum { - ORIENTATION_ANY = ACONFIGURATION_ORIENTATION_ANY, - ORIENTATION_PORT = ACONFIGURATION_ORIENTATION_PORT, - ORIENTATION_LAND = ACONFIGURATION_ORIENTATION_LAND, - ORIENTATION_SQUARE = ACONFIGURATION_ORIENTATION_SQUARE, - }; - - enum { - TOUCHSCREEN_ANY = ACONFIGURATION_TOUCHSCREEN_ANY, - TOUCHSCREEN_NOTOUCH = ACONFIGURATION_TOUCHSCREEN_NOTOUCH, - TOUCHSCREEN_STYLUS = ACONFIGURATION_TOUCHSCREEN_STYLUS, - TOUCHSCREEN_FINGER = ACONFIGURATION_TOUCHSCREEN_FINGER, - }; - - enum { - DENSITY_DEFAULT = ACONFIGURATION_DENSITY_DEFAULT, - DENSITY_LOW = ACONFIGURATION_DENSITY_LOW, - DENSITY_MEDIUM = ACONFIGURATION_DENSITY_MEDIUM, - DENSITY_TV = ACONFIGURATION_DENSITY_TV, - DENSITY_HIGH = ACONFIGURATION_DENSITY_HIGH, - DENSITY_NONE = ACONFIGURATION_DENSITY_NONE - }; - - union { - struct { - uint8_t orientation; - uint8_t touchscreen; - uint16_t density; - }; - uint32_t screenType; - }; - - enum { - KEYBOARD_ANY = ACONFIGURATION_KEYBOARD_ANY, - KEYBOARD_NOKEYS = ACONFIGURATION_KEYBOARD_NOKEYS, - KEYBOARD_QWERTY = ACONFIGURATION_KEYBOARD_QWERTY, - KEYBOARD_12KEY = ACONFIGURATION_KEYBOARD_12KEY, - }; - - enum { - NAVIGATION_ANY = ACONFIGURATION_NAVIGATION_ANY, - NAVIGATION_NONAV = ACONFIGURATION_NAVIGATION_NONAV, - NAVIGATION_DPAD = ACONFIGURATION_NAVIGATION_DPAD, - NAVIGATION_TRACKBALL = ACONFIGURATION_NAVIGATION_TRACKBALL, - NAVIGATION_WHEEL = ACONFIGURATION_NAVIGATION_WHEEL, - }; - - enum { - MASK_KEYSHIDDEN = 0x0003, - KEYSHIDDEN_ANY = ACONFIGURATION_KEYSHIDDEN_ANY, - KEYSHIDDEN_NO = ACONFIGURATION_KEYSHIDDEN_NO, - KEYSHIDDEN_YES = ACONFIGURATION_KEYSHIDDEN_YES, - KEYSHIDDEN_SOFT = ACONFIGURATION_KEYSHIDDEN_SOFT, - }; - - enum { - MASK_NAVHIDDEN = 0x000c, - SHIFT_NAVHIDDEN = 2, - NAVHIDDEN_ANY = ACONFIGURATION_NAVHIDDEN_ANY << SHIFT_NAVHIDDEN, - NAVHIDDEN_NO = ACONFIGURATION_NAVHIDDEN_NO << SHIFT_NAVHIDDEN, - NAVHIDDEN_YES = ACONFIGURATION_NAVHIDDEN_YES << SHIFT_NAVHIDDEN, - }; - - union { - struct { - uint8_t keyboard; - uint8_t navigation; - uint8_t inputFlags; - uint8_t inputPad0; - }; - uint32_t input; - }; - - enum { - SCREENWIDTH_ANY = 0 - }; - - enum { - SCREENHEIGHT_ANY = 0 - }; - - union { - struct { - uint16_t screenWidth; - uint16_t screenHeight; - }; - uint32_t screenSize; - }; - - enum { - SDKVERSION_ANY = 0 - }; - - enum { - MINORVERSION_ANY = 0 - }; - - union { - struct { - uint16_t sdkVersion; - // For now minorVersion must always be 0!!! Its meaning - // is currently undefined. - uint16_t minorVersion; - }; - uint32_t version; - }; - - enum { - // screenLayout bits for screen size class. - MASK_SCREENSIZE = 0x0f, - SCREENSIZE_ANY = ACONFIGURATION_SCREENSIZE_ANY, - SCREENSIZE_SMALL = ACONFIGURATION_SCREENSIZE_SMALL, - SCREENSIZE_NORMAL = ACONFIGURATION_SCREENSIZE_NORMAL, - SCREENSIZE_LARGE = ACONFIGURATION_SCREENSIZE_LARGE, - SCREENSIZE_XLARGE = ACONFIGURATION_SCREENSIZE_XLARGE, - - // screenLayout bits for wide/long screen variation. - MASK_SCREENLONG = 0x30, - SHIFT_SCREENLONG = 4, - SCREENLONG_ANY = ACONFIGURATION_SCREENLONG_ANY << SHIFT_SCREENLONG, - SCREENLONG_NO = ACONFIGURATION_SCREENLONG_NO << SHIFT_SCREENLONG, - SCREENLONG_YES = ACONFIGURATION_SCREENLONG_YES << SHIFT_SCREENLONG, - }; - - enum { - // uiMode bits for the mode type. - MASK_UI_MODE_TYPE = 0x0f, - UI_MODE_TYPE_ANY = ACONFIGURATION_UI_MODE_TYPE_ANY, - UI_MODE_TYPE_NORMAL = ACONFIGURATION_UI_MODE_TYPE_NORMAL, - UI_MODE_TYPE_DESK = ACONFIGURATION_UI_MODE_TYPE_DESK, - UI_MODE_TYPE_CAR = ACONFIGURATION_UI_MODE_TYPE_CAR, - UI_MODE_TYPE_TELEVISION = ACONFIGURATION_UI_MODE_TYPE_TELEVISION, - - // uiMode bits for the night switch. - MASK_UI_MODE_NIGHT = 0x30, - SHIFT_UI_MODE_NIGHT = 4, - UI_MODE_NIGHT_ANY = ACONFIGURATION_UI_MODE_NIGHT_ANY << SHIFT_UI_MODE_NIGHT, - UI_MODE_NIGHT_NO = ACONFIGURATION_UI_MODE_NIGHT_NO << SHIFT_UI_MODE_NIGHT, - UI_MODE_NIGHT_YES = ACONFIGURATION_UI_MODE_NIGHT_YES << SHIFT_UI_MODE_NIGHT, - }; - - union { - struct { - uint8_t screenLayout; - uint8_t uiMode; - uint16_t smallestScreenWidthDp; - }; - uint32_t screenConfig; - }; - - union { - struct { - uint16_t screenWidthDp; - uint16_t screenHeightDp; - }; - uint32_t screenSizeDp; - }; - - inline void copyFromDeviceNoSwap(const ResTable_config& o) { - const size_t size = dtohl(o.size); - if (size >= sizeof(ResTable_config)) { - *this = o; - } else { - memcpy(this, &o, size); - memset(((uint8_t*)this)+size, 0, sizeof(ResTable_config)-size); - } - } - - inline void copyFromDtoH(const ResTable_config& o) { - copyFromDeviceNoSwap(o); - size = sizeof(ResTable_config); - mcc = dtohs(mcc); - mnc = dtohs(mnc); - density = dtohs(density); - screenWidth = dtohs(screenWidth); - screenHeight = dtohs(screenHeight); - sdkVersion = dtohs(sdkVersion); - minorVersion = dtohs(minorVersion); - smallestScreenWidthDp = dtohs(smallestScreenWidthDp); - screenWidthDp = dtohs(screenWidthDp); - screenHeightDp = dtohs(screenHeightDp); - } - - inline void swapHtoD() { - size = htodl(size); - mcc = htods(mcc); - mnc = htods(mnc); - density = htods(density); - screenWidth = htods(screenWidth); - screenHeight = htods(screenHeight); - sdkVersion = htods(sdkVersion); - minorVersion = htods(minorVersion); - smallestScreenWidthDp = htods(smallestScreenWidthDp); - screenWidthDp = htods(screenWidthDp); - screenHeightDp = htods(screenHeightDp); - } - - inline int compare(const ResTable_config& o) const { - int32_t diff = (int32_t)(imsi - o.imsi); - if (diff != 0) return diff; - diff = (int32_t)(locale - o.locale); - if (diff != 0) return diff; - diff = (int32_t)(screenType - o.screenType); - if (diff != 0) return diff; - diff = (int32_t)(input - o.input); - if (diff != 0) return diff; - diff = (int32_t)(screenSize - o.screenSize); - if (diff != 0) return diff; - diff = (int32_t)(version - o.version); - if (diff != 0) return diff; - diff = (int32_t)(screenLayout - o.screenLayout); - if (diff != 0) return diff; - diff = (int32_t)(uiMode - o.uiMode); - if (diff != 0) return diff; - diff = (int32_t)(smallestScreenWidthDp - o.smallestScreenWidthDp); - if (diff != 0) return diff; - diff = (int32_t)(screenSizeDp - o.screenSizeDp); - return (int)diff; - } - - // Flags indicating a set of config values. These flag constants must - // match the corresponding ones in android.content.pm.ActivityInfo and - // attrs_manifest.xml. - enum { - CONFIG_MCC = ACONFIGURATION_MCC, - CONFIG_MNC = ACONFIGURATION_MCC, - CONFIG_LOCALE = ACONFIGURATION_LOCALE, - CONFIG_TOUCHSCREEN = ACONFIGURATION_TOUCHSCREEN, - CONFIG_KEYBOARD = ACONFIGURATION_KEYBOARD, - CONFIG_KEYBOARD_HIDDEN = ACONFIGURATION_KEYBOARD_HIDDEN, - CONFIG_NAVIGATION = ACONFIGURATION_NAVIGATION, - CONFIG_ORIENTATION = ACONFIGURATION_ORIENTATION, - CONFIG_DENSITY = ACONFIGURATION_DENSITY, - CONFIG_SCREEN_SIZE = ACONFIGURATION_SCREEN_SIZE, - CONFIG_SMALLEST_SCREEN_SIZE = ACONFIGURATION_SMALLEST_SCREEN_SIZE, - CONFIG_VERSION = ACONFIGURATION_VERSION, - CONFIG_SCREEN_LAYOUT = ACONFIGURATION_SCREEN_LAYOUT, - CONFIG_UI_MODE = ACONFIGURATION_UI_MODE - }; - - // Compare two configuration, returning CONFIG_* flags set for each value - // that is different. - inline int diff(const ResTable_config& o) const { - int diffs = 0; - if (mcc != o.mcc) diffs |= CONFIG_MCC; - if (mnc != o.mnc) diffs |= CONFIG_MNC; - if (locale != o.locale) diffs |= CONFIG_LOCALE; - if (orientation != o.orientation) diffs |= CONFIG_ORIENTATION; - if (density != o.density) diffs |= CONFIG_DENSITY; - if (touchscreen != o.touchscreen) diffs |= CONFIG_TOUCHSCREEN; - if (((inputFlags^o.inputFlags)&(MASK_KEYSHIDDEN|MASK_NAVHIDDEN)) != 0) - diffs |= CONFIG_KEYBOARD_HIDDEN; - if (keyboard != o.keyboard) diffs |= CONFIG_KEYBOARD; - if (navigation != o.navigation) diffs |= CONFIG_NAVIGATION; - if (screenSize != o.screenSize) diffs |= CONFIG_SCREEN_SIZE; - if (version != o.version) diffs |= CONFIG_VERSION; - if (screenLayout != o.screenLayout) diffs |= CONFIG_SCREEN_LAYOUT; - if (uiMode != o.uiMode) diffs |= CONFIG_UI_MODE; - if (smallestScreenWidthDp != o.smallestScreenWidthDp) diffs |= CONFIG_SMALLEST_SCREEN_SIZE; - if (screenSizeDp != o.screenSizeDp) diffs |= CONFIG_SCREEN_SIZE; - return diffs; - } - - // Return true if 'this' is more specific than 'o'. - inline bool - isMoreSpecificThan(const ResTable_config& o) const { - // The order of the following tests defines the importance of one - // configuration parameter over another. Those tests first are more - // important, trumping any values in those following them. - if (imsi || o.imsi) { - if (mcc != o.mcc) { - if (!mcc) return false; - if (!o.mcc) return true; - } - - if (mnc != o.mnc) { - if (!mnc) return false; - if (!o.mnc) return true; - } - } - - if (locale || o.locale) { - if (language[0] != o.language[0]) { - if (!language[0]) return false; - if (!o.language[0]) return true; - } - - if (country[0] != o.country[0]) { - if (!country[0]) return false; - if (!o.country[0]) return true; - } - } - - if (smallestScreenWidthDp || o.smallestScreenWidthDp) { - if (smallestScreenWidthDp != o.smallestScreenWidthDp) { - if (!smallestScreenWidthDp) return false; - if (!o.smallestScreenWidthDp) return true; - } - } - - if (screenSizeDp || o.screenSizeDp) { - if (screenWidthDp != o.screenWidthDp) { - if (!screenWidthDp) return false; - if (!o.screenWidthDp) return true; - } - - if (screenHeightDp != o.screenHeightDp) { - if (!screenHeightDp) return false; - if (!o.screenHeightDp) return true; - } - } - - if (screenLayout || o.screenLayout) { - if (((screenLayout^o.screenLayout) & MASK_SCREENSIZE) != 0) { - if (!(screenLayout & MASK_SCREENSIZE)) return false; - if (!(o.screenLayout & MASK_SCREENSIZE)) return true; - } - if (((screenLayout^o.screenLayout) & MASK_SCREENLONG) != 0) { - if (!(screenLayout & MASK_SCREENLONG)) return false; - if (!(o.screenLayout & MASK_SCREENLONG)) return true; - } - } - - if (orientation != o.orientation) { - if (!orientation) return false; - if (!o.orientation) return true; - } - - if (uiMode || o.uiMode) { - if (((uiMode^o.uiMode) & MASK_UI_MODE_TYPE) != 0) { - if (!(uiMode & MASK_UI_MODE_TYPE)) return false; - if (!(o.uiMode & MASK_UI_MODE_TYPE)) return true; - } - if (((uiMode^o.uiMode) & MASK_UI_MODE_NIGHT) != 0) { - if (!(uiMode & MASK_UI_MODE_NIGHT)) return false; - if (!(o.uiMode & MASK_UI_MODE_NIGHT)) return true; - } - } - - // density is never 'more specific' - // as the default just equals 160 - - if (touchscreen != o.touchscreen) { - if (!touchscreen) return false; - if (!o.touchscreen) return true; - } - - if (input || o.input) { - if (((inputFlags^o.inputFlags) & MASK_KEYSHIDDEN) != 0) { - if (!(inputFlags & MASK_KEYSHIDDEN)) return false; - if (!(o.inputFlags & MASK_KEYSHIDDEN)) return true; - } - - if (((inputFlags^o.inputFlags) & MASK_NAVHIDDEN) != 0) { - if (!(inputFlags & MASK_NAVHIDDEN)) return false; - if (!(o.inputFlags & MASK_NAVHIDDEN)) return true; - } - - if (keyboard != o.keyboard) { - if (!keyboard) return false; - if (!o.keyboard) return true; - } - - if (navigation != o.navigation) { - if (!navigation) return false; - if (!o.navigation) return true; - } - } - - if (screenSize || o.screenSize) { - if (screenWidth != o.screenWidth) { - if (!screenWidth) return false; - if (!o.screenWidth) return true; - } - - if (screenHeight != o.screenHeight) { - if (!screenHeight) return false; - if (!o.screenHeight) return true; - } - } - - if (version || o.version) { - if (sdkVersion != o.sdkVersion) { - if (!sdkVersion) return false; - if (!o.sdkVersion) return true; - } - - if (minorVersion != o.minorVersion) { - if (!minorVersion) return false; - if (!o.minorVersion) return true; - } - } - return false; - } - - // Return true if 'this' is a better match than 'o' for the 'requested' - // configuration. This assumes that match() has already been used to - // remove any configurations that don't match the requested configuration - // at all; if they are not first filtered, non-matching results can be - // considered better than matching ones. - // The general rule per attribute: if the request cares about an attribute - // (it normally does), if the two (this and o) are equal it's a tie. If - // they are not equal then one must be generic because only generic and - // '==requested' will pass the match() call. So if this is not generic, - // it wins. If this IS generic, o wins (return false). - inline bool - isBetterThan(const ResTable_config& o, - const ResTable_config* requested) const { - if (requested) { - if (imsi || o.imsi) { - if ((mcc != o.mcc) && requested->mcc) { - return (mcc); - } - - if ((mnc != o.mnc) && requested->mnc) { - return (mnc); - } - } - - if (locale || o.locale) { - if ((language[0] != o.language[0]) && requested->language[0]) { - return (language[0]); - } - - if ((country[0] != o.country[0]) && requested->country[0]) { - return (country[0]); - } - } - - if (smallestScreenWidthDp || o.smallestScreenWidthDp) { - // The configuration closest to the actual size is best. - // We assume that larger configs have already been filtered - // out at this point. That means we just want the largest one. - return smallestScreenWidthDp >= o.smallestScreenWidthDp; - } - - if (screenSizeDp || o.screenSizeDp) { - // "Better" is based on the sum of the difference between both - // width and height from the requested dimensions. We are - // assuming the invalid configs (with smaller dimens) have - // already been filtered. Note that if a particular dimension - // is unspecified, we will end up with a large value (the - // difference between 0 and the requested dimension), which is - // good since we will prefer a config that has specified a - // dimension value. - int myDelta = 0, otherDelta = 0; - if (requested->screenWidthDp) { - myDelta += requested->screenWidthDp - screenWidthDp; - otherDelta += requested->screenWidthDp - o.screenWidthDp; - } - if (requested->screenHeightDp) { - myDelta += requested->screenHeightDp - screenHeightDp; - otherDelta += requested->screenHeightDp - o.screenHeightDp; - } - //LOGI("Comparing this %dx%d to other %dx%d in %dx%d: myDelta=%d otherDelta=%d", - // screenWidthDp, screenHeightDp, o.screenWidthDp, o.screenHeightDp, - // requested->screenWidthDp, requested->screenHeightDp, myDelta, otherDelta); - return (myDelta <= otherDelta); - } - - if (screenLayout || o.screenLayout) { - if (((screenLayout^o.screenLayout) & MASK_SCREENSIZE) != 0 - && (requested->screenLayout & MASK_SCREENSIZE)) { - // A little backwards compatibility here: undefined is - // considered equivalent to normal. But only if the - // requested size is at least normal; otherwise, small - // is better than the default. - int mySL = (screenLayout & MASK_SCREENSIZE); - int oSL = (o.screenLayout & MASK_SCREENSIZE); - int fixedMySL = mySL; - int fixedOSL = oSL; - if ((requested->screenLayout & MASK_SCREENSIZE) >= SCREENSIZE_NORMAL) { - if (fixedMySL == 0) fixedMySL = SCREENSIZE_NORMAL; - if (fixedOSL == 0) fixedOSL = SCREENSIZE_NORMAL; - } - // For screen size, the best match is the one that is - // closest to the requested screen size, but not over - // (the not over part is dealt with in match() below). - if (fixedMySL == fixedOSL) { - // If the two are the same, but 'this' is actually - // undefined, then the other is really a better match. - if (mySL == 0) return false; - return true; - } - return fixedMySL >= fixedOSL; - } - if (((screenLayout^o.screenLayout) & MASK_SCREENLONG) != 0 - && (requested->screenLayout & MASK_SCREENLONG)) { - return (screenLayout & MASK_SCREENLONG); - } - } - - if ((orientation != o.orientation) && requested->orientation) { - return (orientation); - } - - if (uiMode || o.uiMode) { - if (((uiMode^o.uiMode) & MASK_UI_MODE_TYPE) != 0 - && (requested->uiMode & MASK_UI_MODE_TYPE)) { - return (uiMode & MASK_UI_MODE_TYPE); - } - if (((uiMode^o.uiMode) & MASK_UI_MODE_NIGHT) != 0 - && (requested->uiMode & MASK_UI_MODE_NIGHT)) { - return (uiMode & MASK_UI_MODE_NIGHT); - } - } - - if (screenType || o.screenType) { - if (density != o.density) { - // density is tough. Any density is potentially useful - // because the system will scale it. Scaling down - // is generally better than scaling up. - // Default density counts as 160dpi (the system default) - // TODO - remove 160 constants - int h = (density?density:160); - int l = (o.density?o.density:160); - bool bImBigger = true; - if (l > h) { - int t = h; - h = l; - l = t; - bImBigger = false; - } - - int reqValue = (requested->density?requested->density:160); - if (reqValue >= h) { - // requested value higher than both l and h, give h - return bImBigger; - } - if (l >= reqValue) { - // requested value lower than both l and h, give l - return !bImBigger; - } - // saying that scaling down is 2x better than up - if (((2 * l) - reqValue) * h > reqValue * reqValue) { - return !bImBigger; - } else { - return bImBigger; - } - } - - if ((touchscreen != o.touchscreen) && requested->touchscreen) { - return (touchscreen); - } - } - - if (input || o.input) { - const int keysHidden = inputFlags & MASK_KEYSHIDDEN; - const int oKeysHidden = o.inputFlags & MASK_KEYSHIDDEN; - if (keysHidden != oKeysHidden) { - const int reqKeysHidden = - requested->inputFlags & MASK_KEYSHIDDEN; - if (reqKeysHidden) { - - if (!keysHidden) return false; - if (!oKeysHidden) return true; - // For compatibility, we count KEYSHIDDEN_NO as being - // the same as KEYSHIDDEN_SOFT. Here we disambiguate - // these by making an exact match more specific. - if (reqKeysHidden == keysHidden) return true; - if (reqKeysHidden == oKeysHidden) return false; - } - } - - const int navHidden = inputFlags & MASK_NAVHIDDEN; - const int oNavHidden = o.inputFlags & MASK_NAVHIDDEN; - if (navHidden != oNavHidden) { - const int reqNavHidden = - requested->inputFlags & MASK_NAVHIDDEN; - if (reqNavHidden) { - - if (!navHidden) return false; - if (!oNavHidden) return true; - } - } - - if ((keyboard != o.keyboard) && requested->keyboard) { - return (keyboard); - } - - if ((navigation != o.navigation) && requested->navigation) { - return (navigation); - } - } - - if (screenSize || o.screenSize) { - // "Better" is based on the sum of the difference between both - // width and height from the requested dimensions. We are - // assuming the invalid configs (with smaller sizes) have - // already been filtered. Note that if a particular dimension - // is unspecified, we will end up with a large value (the - // difference between 0 and the requested dimension), which is - // good since we will prefer a config that has specified a - // size value. - int myDelta = 0, otherDelta = 0; - if (requested->screenWidth) { - myDelta += requested->screenWidth - screenWidth; - otherDelta += requested->screenWidth - o.screenWidth; - } - if (requested->screenHeight) { - myDelta += requested->screenHeight - screenHeight; - otherDelta += requested->screenHeight - o.screenHeight; - } - return (myDelta <= otherDelta); - } - - if (version || o.version) { - if ((sdkVersion != o.sdkVersion) && requested->sdkVersion) { - return (sdkVersion > o.sdkVersion); - } - - if ((minorVersion != o.minorVersion) && - requested->minorVersion) { - return (minorVersion); - } - } - - return false; - } - return isMoreSpecificThan(o); - } - - // Return true if 'this' can be considered a match for the parameters in - // 'settings'. - // Note this is asymetric. A default piece of data will match every request - // but a request for the default should not match odd specifics - // (ie, request with no mcc should not match a particular mcc's data) - // settings is the requested settings - inline bool match(const ResTable_config& settings) const { - if (imsi != 0) { - if (mcc != 0 && mcc != settings.mcc) { - return false; - } - if (mnc != 0 && mnc != settings.mnc) { - return false; - } - } - if (locale != 0) { - if (language[0] != 0 - && (language[0] != settings.language[0] - || language[1] != settings.language[1])) { - return false; - } - if (country[0] != 0 - && (country[0] != settings.country[0] - || country[1] != settings.country[1])) { - return false; - } - } - if (screenConfig != 0) { - const int screenSize = screenLayout&MASK_SCREENSIZE; - const int setScreenSize = settings.screenLayout&MASK_SCREENSIZE; - // Any screen sizes for larger screens than the setting do not - // match. - if (screenSize != 0 && screenSize > setScreenSize) { - return false; - } - - const int screenLong = screenLayout&MASK_SCREENLONG; - const int setScreenLong = settings.screenLayout&MASK_SCREENLONG; - if (screenLong != 0 && screenLong != setScreenLong) { - return false; - } - - const int uiModeType = uiMode&MASK_UI_MODE_TYPE; - const int setUiModeType = settings.uiMode&MASK_UI_MODE_TYPE; - if (uiModeType != 0 && uiModeType != setUiModeType) { - return false; - } - - const int uiModeNight = uiMode&MASK_UI_MODE_NIGHT; - const int setUiModeNight = settings.uiMode&MASK_UI_MODE_NIGHT; - if (uiModeNight != 0 && uiModeNight != setUiModeNight) { - return false; - } - - if (smallestScreenWidthDp != 0 - && smallestScreenWidthDp > settings.smallestScreenWidthDp) { - return false; - } - } - if (screenSizeDp != 0) { - if (screenWidthDp != 0 && screenWidthDp > settings.screenWidthDp) { - //LOGI("Filtering out width %d in requested %d", screenWidthDp, settings.screenWidthDp); - return false; - } - if (screenHeightDp != 0 && screenHeightDp > settings.screenHeightDp) { - //LOGI("Filtering out height %d in requested %d", screenHeightDp, settings.screenHeightDp); - return false; - } - } - if (screenType != 0) { - if (orientation != 0 && orientation != settings.orientation) { - return false; - } - // density always matches - we can scale it. See isBetterThan - if (touchscreen != 0 && touchscreen != settings.touchscreen) { - return false; - } - } - if (input != 0) { - const int keysHidden = inputFlags&MASK_KEYSHIDDEN; - const int setKeysHidden = settings.inputFlags&MASK_KEYSHIDDEN; - if (keysHidden != 0 && keysHidden != setKeysHidden) { - // For compatibility, we count a request for KEYSHIDDEN_NO as also - // matching the more recent KEYSHIDDEN_SOFT. Basically - // KEYSHIDDEN_NO means there is some kind of keyboard available. - //LOGI("Matching keysHidden: have=%d, config=%d\n", keysHidden, setKeysHidden); - if (keysHidden != KEYSHIDDEN_NO || setKeysHidden != KEYSHIDDEN_SOFT) { - //LOGI("No match!"); - return false; - } - } - const int navHidden = inputFlags&MASK_NAVHIDDEN; - const int setNavHidden = settings.inputFlags&MASK_NAVHIDDEN; - if (navHidden != 0 && navHidden != setNavHidden) { - return false; - } - if (keyboard != 0 && keyboard != settings.keyboard) { - return false; - } - if (navigation != 0 && navigation != settings.navigation) { - return false; - } - } - if (screenSize != 0) { - if (screenWidth != 0 && screenWidth > settings.screenWidth) { - return false; - } - if (screenHeight != 0 && screenHeight > settings.screenHeight) { - return false; - } - } - if (version != 0) { - if (sdkVersion != 0 && sdkVersion > settings.sdkVersion) { - return false; - } - if (minorVersion != 0 && minorVersion != settings.minorVersion) { - return false; - } - } - return true; - } - - void getLocale(char str[6]) const { - memset(str, 0, 6); - if (language[0]) { - str[0] = language[0]; - str[1] = language[1]; - if (country[0]) { - str[2] = '_'; - str[3] = country[0]; - str[4] = country[1]; - } - } - } - - String8 toString() const { - char buf[200]; - sprintf(buf, "imsi=%d/%d lang=%c%c reg=%c%c orient=%d touch=%d dens=%d " - "kbd=%d nav=%d input=%d ssz=%dx%d sw%ddp w%ddp h%ddp sz=%d long=%d " - "ui=%d night=%d vers=%d.%d", - mcc, mnc, - language[0] ? language[0] : '-', language[1] ? language[1] : '-', - country[0] ? country[0] : '-', country[1] ? country[1] : '-', - orientation, touchscreen, density, keyboard, navigation, inputFlags, - screenWidth, screenHeight, smallestScreenWidthDp, screenWidthDp, screenHeightDp, - screenLayout&MASK_SCREENSIZE, screenLayout&MASK_SCREENLONG, - uiMode&MASK_UI_MODE_TYPE, uiMode&MASK_UI_MODE_NIGHT, - sdkVersion, minorVersion); - return String8(buf); - } -}; - -/** - * A specification of the resources defined by a particular type. - * - * There should be one of these chunks for each resource type. - * - * This structure is followed by an array of integers providing the set of - * configuation change flags (ResTable_config::CONFIG_*) that have multiple - * resources for that configuration. In addition, the high bit is set if that - * resource has been made public. - */ -struct ResTable_typeSpec -{ - struct ResChunk_header header; - - // The type identifier this chunk is holding. Type IDs start - // at 1 (corresponding to the value of the type bits in a - // resource identifier). 0 is invalid. - uint8_t id; - - // Must be 0. - uint8_t res0; - // Must be 0. - uint16_t res1; - - // Number of uint32_t entry configuration masks that follow. - uint32_t entryCount; - - enum { - // Additional flag indicating an entry is public. - SPEC_PUBLIC = 0x40000000 - }; -}; - -/** - * A collection of resource entries for a particular resource data - * type. Followed by an array of uint32_t defining the resource - * values, corresponding to the array of type strings in the - * ResTable_package::typeStrings string block. Each of these hold an - * index from entriesStart; a value of NO_ENTRY means that entry is - * not defined. - * - * There may be multiple of these chunks for a particular resource type, - * supply different configuration variations for the resource values of - * that type. - * - * It would be nice to have an additional ordered index of entries, so - * we can do a binary search if trying to find a resource by string name. - */ -struct ResTable_type -{ - struct ResChunk_header header; - - enum { - NO_ENTRY = 0xFFFFFFFF - }; - - // The type identifier this chunk is holding. Type IDs start - // at 1 (corresponding to the value of the type bits in a - // resource identifier). 0 is invalid. - uint8_t id; - - // Must be 0. - uint8_t res0; - // Must be 0. - uint16_t res1; - - // Number of uint32_t entry indices that follow. - uint32_t entryCount; - - // Offset from header where ResTable_entry data starts. - uint32_t entriesStart; - - // Configuration this collection of entries is designed for. - ResTable_config config; -}; - -/** - * This is the beginning of information about an entry in the resource - * table. It holds the reference to the name of this entry, and is - * immediately followed by one of: - * * A Res_value structure, if FLAG_COMPLEX is -not- set. - * * An array of ResTable_map structures, if FLAG_COMPLEX is set. - * These supply a set of name/value mappings of data. - */ -struct ResTable_entry -{ - // Number of bytes in this structure. - uint16_t size; - - enum { - // If set, this is a complex entry, holding a set of name/value - // mappings. It is followed by an array of ResTable_map structures. - FLAG_COMPLEX = 0x0001, - // If set, this resource has been declared public, so libraries - // are allowed to reference it. - FLAG_PUBLIC = 0x0002 - }; - uint16_t flags; - - // Reference into ResTable_package::keyStrings identifying this entry. - struct ResStringPool_ref key; -}; - -/** - * Extended form of a ResTable_entry for map entries, defining a parent map - * resource from which to inherit values. - */ -struct ResTable_map_entry : public ResTable_entry -{ - // Resource identifier of the parent mapping, or 0 if there is none. - ResTable_ref parent; - // Number of name/value pairs that follow for FLAG_COMPLEX. - uint32_t count; -}; - -/** - * A single name/value mapping that is part of a complex resource - * entry. - */ -struct ResTable_map -{ - // The resource identifier defining this mapping's name. For attribute - // resources, 'name' can be one of the following special resource types - // to supply meta-data about the attribute; for all other resource types - // it must be an attribute resource. - ResTable_ref name; - - // Special values for 'name' when defining attribute resources. - enum { - // This entry holds the attribute's type code. - ATTR_TYPE = Res_MAKEINTERNAL(0), - - // For integral attributes, this is the minimum value it can hold. - ATTR_MIN = Res_MAKEINTERNAL(1), - - // For integral attributes, this is the maximum value it can hold. - ATTR_MAX = Res_MAKEINTERNAL(2), - - // Localization of this resource is can be encouraged or required with - // an aapt flag if this is set - ATTR_L10N = Res_MAKEINTERNAL(3), - - // for plural support, see android.content.res.PluralRules#attrForQuantity(int) - ATTR_OTHER = Res_MAKEINTERNAL(4), - ATTR_ZERO = Res_MAKEINTERNAL(5), - ATTR_ONE = Res_MAKEINTERNAL(6), - ATTR_TWO = Res_MAKEINTERNAL(7), - ATTR_FEW = Res_MAKEINTERNAL(8), - ATTR_MANY = Res_MAKEINTERNAL(9) - - }; - - // Bit mask of allowed types, for use with ATTR_TYPE. - enum { - // No type has been defined for this attribute, use generic - // type handling. The low 16 bits are for types that can be - // handled generically; the upper 16 require additional information - // in the bag so can not be handled generically for TYPE_ANY. - TYPE_ANY = 0x0000FFFF, - - // Attribute holds a references to another resource. - TYPE_REFERENCE = 1<<0, - - // Attribute holds a generic string. - TYPE_STRING = 1<<1, - - // Attribute holds an integer value. ATTR_MIN and ATTR_MIN can - // optionally specify a constrained range of possible integer values. - TYPE_INTEGER = 1<<2, - - // Attribute holds a boolean integer. - TYPE_BOOLEAN = 1<<3, - - // Attribute holds a color value. - TYPE_COLOR = 1<<4, - - // Attribute holds a floating point value. - TYPE_FLOAT = 1<<5, - - // Attribute holds a dimension value, such as "20px". - TYPE_DIMENSION = 1<<6, - - // Attribute holds a fraction value, such as "20%". - TYPE_FRACTION = 1<<7, - - // Attribute holds an enumeration. The enumeration values are - // supplied as additional entries in the map. - TYPE_ENUM = 1<<16, - - // Attribute holds a bitmaks of flags. The flag bit values are - // supplied as additional entries in the map. - TYPE_FLAGS = 1<<17 - }; - - // Enum of localization modes, for use with ATTR_L10N. - enum { - L10N_NOT_REQUIRED = 0, - L10N_SUGGESTED = 1 - }; - - // This mapping's value. - Res_value value; -}; - -/** - * Convenience class for accessing data in a ResTable resource. - */ -class ResTable -{ -public: - ResTable(); - ResTable(const void* data, size_t size, void* cookie, - bool copyData=false); - ~ResTable(); - - status_t add(const void* data, size_t size, void* cookie, - bool copyData=false, const void* idmap = NULL); - status_t add(Asset* asset, void* cookie, - bool copyData=false, const void* idmap = NULL); - status_t add(ResTable* src); - - status_t getError() const; - - void uninit(); - - struct resource_name - { - const char16_t* package; - size_t packageLen; - const char16_t* type; - size_t typeLen; - const char16_t* name; - size_t nameLen; - }; - - bool getResourceName(uint32_t resID, resource_name* outName) const; - - /** - * Retrieve the value of a resource. If the resource is found, returns a - * value >= 0 indicating the table it is in (for use with - * getTableStringBlock() and getTableCookie()) and fills in 'outValue'. If - * not found, returns a negative error code. - * - * Note that this function does not do reference traversal. If you want - * to follow references to other resources to get the "real" value to - * use, you need to call resolveReference() after this function. - * - * @param resID The desired resoruce identifier. - * @param outValue Filled in with the resource data that was found. - * - * @return ssize_t Either a >= 0 table index or a negative error code. - */ - ssize_t getResource(uint32_t resID, Res_value* outValue, bool mayBeBag = false, - uint16_t density = 0, - uint32_t* outSpecFlags = NULL, - ResTable_config* outConfig = NULL) const; - - inline ssize_t getResource(const ResTable_ref& res, Res_value* outValue, - uint32_t* outSpecFlags=NULL) const { - return getResource(res.ident, outValue, false, 0, outSpecFlags, NULL); - } - - ssize_t resolveReference(Res_value* inOutValue, - ssize_t blockIndex, - uint32_t* outLastRef = NULL, - uint32_t* inoutTypeSpecFlags = NULL, - ResTable_config* outConfig = NULL) const; - - enum { - TMP_BUFFER_SIZE = 16 - }; - const char16_t* valueToString(const Res_value* value, size_t stringBlock, - char16_t tmpBuffer[TMP_BUFFER_SIZE], - size_t* outLen); - - struct bag_entry { - ssize_t stringBlock; - ResTable_map map; - }; - - /** - * Retrieve the bag of a resource. If the resoruce is found, returns the - * number of bags it contains and 'outBag' points to an array of their - * values. If not found, a negative error code is returned. - * - * Note that this function -does- do reference traversal of the bag data. - * - * @param resID The desired resource identifier. - * @param outBag Filled inm with a pointer to the bag mappings. - * - * @return ssize_t Either a >= 0 bag count of negative error code. - */ - ssize_t lockBag(uint32_t resID, const bag_entry** outBag) const; - - void unlockBag(const bag_entry* bag) const; - - void lock() const; - - ssize_t getBagLocked(uint32_t resID, const bag_entry** outBag, - uint32_t* outTypeSpecFlags=NULL) const; - - void unlock() const; - - class Theme { - public: - Theme(const ResTable& table); - ~Theme(); - - inline const ResTable& getResTable() const { return mTable; } - - status_t applyStyle(uint32_t resID, bool force=false); - status_t setTo(const Theme& other); - - /** - * Retrieve a value in the theme. If the theme defines this - * value, returns a value >= 0 indicating the table it is in - * (for use with getTableStringBlock() and getTableCookie) and - * fills in 'outValue'. If not found, returns a negative error - * code. - * - * Note that this function does not do reference traversal. If you want - * to follow references to other resources to get the "real" value to - * use, you need to call resolveReference() after this function. - * - * @param resID A resource identifier naming the desired theme - * attribute. - * @param outValue Filled in with the theme value that was - * found. - * - * @return ssize_t Either a >= 0 table index or a negative error code. - */ - ssize_t getAttribute(uint32_t resID, Res_value* outValue, - uint32_t* outTypeSpecFlags = NULL) const; - - /** - * This is like ResTable::resolveReference(), but also takes - * care of resolving attribute references to the theme. - */ - ssize_t resolveAttributeReference(Res_value* inOutValue, - ssize_t blockIndex, uint32_t* outLastRef = NULL, - uint32_t* inoutTypeSpecFlags = NULL, - ResTable_config* inoutConfig = NULL) const; - - void dumpToLog() const; - - private: - Theme(const Theme&); - Theme& operator=(const Theme&); - - struct theme_entry { - ssize_t stringBlock; - uint32_t typeSpecFlags; - Res_value value; - }; - struct type_info { - size_t numEntries; - theme_entry* entries; - }; - struct package_info { - size_t numTypes; - type_info types[]; - }; - - void free_package(package_info* pi); - package_info* copy_package(package_info* pi); - - const ResTable& mTable; - package_info* mPackages[Res_MAXPACKAGE]; - }; - - void setParameters(const ResTable_config* params); - void getParameters(ResTable_config* params) const; - - // Retrieve an identifier (which can be passed to getResource) - // for a given resource name. The 'name' can be fully qualified - // (:.) or the package or type components - // can be dropped if default values are supplied here. - // - // Returns 0 if no such resource was found, else a valid resource ID. - uint32_t identifierForName(const char16_t* name, size_t nameLen, - const char16_t* type = 0, size_t typeLen = 0, - const char16_t* defPackage = 0, - size_t defPackageLen = 0, - uint32_t* outTypeSpecFlags = NULL) const; - - static bool expandResourceRef(const uint16_t* refStr, size_t refLen, - String16* outPackage, - String16* outType, - String16* outName, - const String16* defType = NULL, - const String16* defPackage = NULL, - const char** outErrorMsg = NULL, - bool* outPublicOnly = NULL); - - static bool stringToInt(const char16_t* s, size_t len, Res_value* outValue); - static bool stringToFloat(const char16_t* s, size_t len, Res_value* outValue); - - // Used with stringToValue. - class Accessor - { - public: - inline virtual ~Accessor() { } - - virtual uint32_t getCustomResource(const String16& package, - const String16& type, - const String16& name) const = 0; - virtual uint32_t getCustomResourceWithCreation(const String16& package, - const String16& type, - const String16& name, - const bool createIfNeeded = false) = 0; - virtual uint32_t getRemappedPackage(uint32_t origPackage) const = 0; - virtual bool getAttributeType(uint32_t attrID, uint32_t* outType) = 0; - virtual bool getAttributeMin(uint32_t attrID, uint32_t* outMin) = 0; - virtual bool getAttributeMax(uint32_t attrID, uint32_t* outMax) = 0; - virtual bool getAttributeEnum(uint32_t attrID, - const char16_t* name, size_t nameLen, - Res_value* outValue) = 0; - virtual bool getAttributeFlags(uint32_t attrID, - const char16_t* name, size_t nameLen, - Res_value* outValue) = 0; - virtual uint32_t getAttributeL10N(uint32_t attrID) = 0; - virtual bool getLocalizationSetting() = 0; - virtual void reportError(void* accessorCookie, const char* fmt, ...) = 0; - }; - - // Convert a string to a resource value. Handles standard "@res", - // "#color", "123", and "0x1bd" types; performs escaping of strings. - // The resulting value is placed in 'outValue'; if it is a string type, - // 'outString' receives the string. If 'attrID' is supplied, the value is - // type checked against this attribute and it is used to perform enum - // evaluation. If 'acccessor' is supplied, it will be used to attempt to - // resolve resources that do not exist in this ResTable. If 'attrType' is - // supplied, the value will be type checked for this format if 'attrID' - // is not supplied or found. - bool stringToValue(Res_value* outValue, String16* outString, - const char16_t* s, size_t len, - bool preserveSpaces, bool coerceType, - uint32_t attrID = 0, - const String16* defType = NULL, - const String16* defPackage = NULL, - Accessor* accessor = NULL, - void* accessorCookie = NULL, - uint32_t attrType = ResTable_map::TYPE_ANY, - bool enforcePrivate = true) const; - - // Perform processing of escapes and quotes in a string. - static bool collectString(String16* outString, - const char16_t* s, size_t len, - bool preserveSpaces, - const char** outErrorMsg = NULL, - bool append = false); - - size_t getBasePackageCount() const; - const char16_t* getBasePackageName(size_t idx) const; - uint32_t getBasePackageId(size_t idx) const; - - size_t getTableCount() const; - const ResStringPool* getTableStringBlock(size_t index) const; - void* getTableCookie(size_t index) const; - - // Return the configurations (ResTable_config) that we know about - void getConfigurations(Vector* configs) const; - - void getLocales(Vector* locales) const; - - // Generate an idmap. - // - // Return value: on success: NO_ERROR; caller is responsible for free-ing - // outData (using free(3)). On failure, any status_t value other than - // NO_ERROR; the caller should not free outData. - status_t createIdmap(const ResTable& overlay, uint32_t originalCrc, uint32_t overlayCrc, - void** outData, size_t* outSize) const; - - enum { - IDMAP_HEADER_SIZE_BYTES = 3 * sizeof(uint32_t), - }; - // Retrieve idmap meta-data. - // - // This function only requires the idmap header (the first - // IDMAP_HEADER_SIZE_BYTES) bytes of an idmap file. - static bool getIdmapInfo(const void* idmap, size_t size, - uint32_t* pOriginalCrc, uint32_t* pOverlayCrc); - -#ifndef HAVE_ANDROID_OS - void print(bool inclValues) const; - static String8 normalizeForOutput(const char* input); -#endif - -private: - struct Header; - struct Type; - struct Package; - struct PackageGroup; - struct bag_set; - - status_t add(const void* data, size_t size, void* cookie, - Asset* asset, bool copyData, const Asset* idmap); - - ssize_t getResourcePackageIndex(uint32_t resID) const; - ssize_t getEntry( - const Package* package, int typeIndex, int entryIndex, - const ResTable_config* config, - const ResTable_type** outType, const ResTable_entry** outEntry, - const Type** outTypeClass) const; - status_t parsePackage( - const ResTable_package* const pkg, const Header* const header, uint32_t idmap_id); - - void print_value(const Package* pkg, const Res_value& value) const; - - mutable Mutex mLock; - - status_t mError; - - ResTable_config mParams; - - // Array of all resource tables. - Vector mHeaders; - - // Array of packages in all resource tables. - Vector mPackageGroups; - - // Mapping from resource package IDs to indices into the internal - // package array. - uint8_t mPackageMap[256]; -}; - -} // namespace android - -#endif // _LIBS_UTILS_RESOURCE_TYPES_H diff --git a/external/android/include/14/frameworks/base/include/utils/SharedBuffer.h b/external/android/include/14/frameworks/base/include/utils/SharedBuffer.h deleted file mode 100644 index 24508b0..0000000 --- a/external/android/include/14/frameworks/base/include/utils/SharedBuffer.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (C) 2005 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_SHARED_BUFFER_H -#define ANDROID_SHARED_BUFFER_H - -#include -#include - -// --------------------------------------------------------------------------- - -namespace android { - -class SharedBuffer -{ -public: - - /* flags to use with release() */ - enum { - eKeepStorage = 0x00000001 - }; - - /*! allocate a buffer of size 'size' and acquire() it. - * call release() to free it. - */ - static SharedBuffer* alloc(size_t size); - - /*! free the memory associated with the SharedBuffer. - * Fails if there are any users associated with this SharedBuffer. - * In other words, the buffer must have been release by all its - * users. - */ - static ssize_t dealloc(const SharedBuffer* released); - - //! get the SharedBuffer from the data pointer - static inline const SharedBuffer* sharedBuffer(const void* data); - - //! access the data for read - inline const void* data() const; - - //! access the data for read/write - inline void* data(); - - //! get size of the buffer - inline size_t size() const; - - //! get back a SharedBuffer object from its data - static inline SharedBuffer* bufferFromData(void* data); - - //! get back a SharedBuffer object from its data - static inline const SharedBuffer* bufferFromData(const void* data); - - //! get the size of a SharedBuffer object from its data - static inline size_t sizeFromData(const void* data); - - //! edit the buffer (get a writtable, or non-const, version of it) - SharedBuffer* edit() const; - - //! edit the buffer, resizing if needed - SharedBuffer* editResize(size_t size) const; - - //! like edit() but fails if a copy is required - SharedBuffer* attemptEdit() const; - - //! resize and edit the buffer, loose it's content. - SharedBuffer* reset(size_t size) const; - - //! acquire/release a reference on this buffer - void acquire() const; - - /*! release a reference on this buffer, with the option of not - * freeing the memory associated with it if it was the last reference - * returns the previous reference count - */ - int32_t release(uint32_t flags = 0) const; - - //! returns wether or not we're the only owner - inline bool onlyOwner() const; - - -private: - inline SharedBuffer() { } - inline ~SharedBuffer() { } - inline SharedBuffer(const SharedBuffer&); - - // 16 bytes. must be sized to preserve correct alingment. - mutable int32_t mRefs; - size_t mSize; - uint32_t mReserved[2]; -}; - -// --------------------------------------------------------------------------- - -const SharedBuffer* SharedBuffer::sharedBuffer(const void* data) { - return data ? reinterpret_cast(data)-1 : 0; -} - -const void* SharedBuffer::data() const { - return this + 1; -} - -void* SharedBuffer::data() { - return this + 1; -} - -size_t SharedBuffer::size() const { - return mSize; -} - -SharedBuffer* SharedBuffer::bufferFromData(void* data) -{ - return ((SharedBuffer*)data)-1; -} - -const SharedBuffer* SharedBuffer::bufferFromData(const void* data) -{ - return ((const SharedBuffer*)data)-1; -} - -size_t SharedBuffer::sizeFromData(const void* data) -{ - return (((const SharedBuffer*)data)-1)->mSize; -} - -bool SharedBuffer::onlyOwner() const { - return (mRefs == 1); -} - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_VECTOR_H diff --git a/external/android/include/14/frameworks/base/include/utils/Singleton.h b/external/android/include/14/frameworks/base/include/utils/Singleton.h deleted file mode 100644 index e1ee8eb..0000000 --- a/external/android/include/14/frameworks/base/include/utils/Singleton.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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_UTILS_SINGLETON_H -#define ANDROID_UTILS_SINGLETON_H - -#include -#include -#include - -namespace android { -// --------------------------------------------------------------------------- - -template -class Singleton -{ -public: - static TYPE& getInstance() { - Mutex::Autolock _l(sLock); - TYPE* instance = sInstance; - if (instance == 0) { - instance = new TYPE(); - sInstance = instance; - } - return *instance; - } - - static bool hasInstance() { - Mutex::Autolock _l(sLock); - return sInstance != 0; - } - -protected: - ~Singleton() { }; - Singleton() { }; - -private: - Singleton(const Singleton&); - Singleton& operator = (const Singleton&); - static Mutex sLock; - static TYPE* sInstance; -}; - -/* - * use ANDROID_SINGLETON_STATIC_INSTANCE(TYPE) in your implementation file - * (eg: .cpp) to create the static instance of Singleton<>'s attributes, - * and avoid to have a copy of them in each compilation units Singleton - * is used. - * NOTE: we use a version of Mutex ctor that takes a parameter, because - * for some unknown reason using the default ctor doesn't emit the variable! - */ - -#define ANDROID_SINGLETON_STATIC_INSTANCE(TYPE) \ - template class Singleton< TYPE >; \ - template<> Mutex Singleton< TYPE >::sLock(Mutex::PRIVATE); \ - template<> TYPE* Singleton< TYPE >::sInstance(0); - - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_UTILS_SINGLETON_H - diff --git a/external/android/include/14/frameworks/base/include/utils/SortedVector.h b/external/android/include/14/frameworks/base/include/utils/SortedVector.h deleted file mode 100644 index 0e98aeb..0000000 --- a/external/android/include/14/frameworks/base/include/utils/SortedVector.h +++ /dev/null @@ -1,283 +0,0 @@ -/* - * Copyright (C) 2005 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_SORTED_VECTOR_H -#define ANDROID_SORTED_VECTOR_H - -#include -#include -#include - -#include -#include -#include - -// --------------------------------------------------------------------------- - -namespace android { - -template -class SortedVector : private SortedVectorImpl -{ - friend class Vector; - -public: - typedef TYPE value_type; - - /*! - * Constructors and destructors - */ - - SortedVector(); - SortedVector(const SortedVector& rhs); - virtual ~SortedVector(); - - /*! copy operator */ - const SortedVector& operator = (const SortedVector& rhs) const; - SortedVector& operator = (const SortedVector& rhs); - - /* - * empty the vector - */ - - inline void clear() { VectorImpl::clear(); } - - /*! - * vector stats - */ - - //! returns number of items in the vector - inline size_t size() const { return VectorImpl::size(); } - //! returns wether or not the vector is empty - inline bool isEmpty() const { return VectorImpl::isEmpty(); } - //! returns how many items can be stored without reallocating the backing store - inline size_t capacity() const { return VectorImpl::capacity(); } - //! setst the capacity. capacity can never be reduced less than size() - inline ssize_t setCapacity(size_t size) { return VectorImpl::setCapacity(size); } - - /*! - * C-style array access - */ - - //! read-only C-style access - inline const TYPE* array() const; - - //! read-write C-style access. BE VERY CAREFUL when modifying the array - //! you ust keep it sorted! You usually don't use this function. - TYPE* editArray(); - - //! finds the index of an item - ssize_t indexOf(const TYPE& item) const; - - //! finds where this item should be inserted - size_t orderOf(const TYPE& item) const; - - - /*! - * accessors - */ - - //! read-only access to an item at a given index - inline const TYPE& operator [] (size_t index) const; - //! alternate name for operator [] - inline const TYPE& itemAt(size_t index) const; - //! stack-usage of the vector. returns the top of the stack (last element) - const TYPE& top() const; - //! same as operator [], but allows to access the vector backward (from the end) with a negative index - const TYPE& mirrorItemAt(ssize_t index) const; - - /*! - * modifing the array - */ - - //! add an item in the right place (and replace the one that is there) - ssize_t add(const TYPE& item); - - //! editItemAt() MUST NOT change the order of this item - TYPE& editItemAt(size_t index) { - return *( static_cast(VectorImpl::editItemLocation(index)) ); - } - - //! merges a vector into this one - ssize_t merge(const Vector& vector); - ssize_t merge(const SortedVector& vector); - - //! removes an item - ssize_t remove(const TYPE&); - - //! remove several items - inline ssize_t removeItemsAt(size_t index, size_t count = 1); - //! remove one item - inline ssize_t removeAt(size_t index) { return removeItemsAt(index); } - -protected: - virtual void do_construct(void* storage, size_t num) const; - virtual void do_destroy(void* storage, size_t num) const; - virtual void do_copy(void* dest, const void* from, size_t num) const; - virtual void do_splat(void* dest, const void* item, size_t num) const; - virtual void do_move_forward(void* dest, const void* from, size_t num) const; - virtual void do_move_backward(void* dest, const void* from, size_t num) const; - virtual int do_compare(const void* lhs, const void* rhs) const; -}; - - -// --------------------------------------------------------------------------- -// No user serviceable parts from here... -// --------------------------------------------------------------------------- - -template inline -SortedVector::SortedVector() - : SortedVectorImpl(sizeof(TYPE), - ((traits::has_trivial_ctor ? HAS_TRIVIAL_CTOR : 0) - |(traits::has_trivial_dtor ? HAS_TRIVIAL_DTOR : 0) - |(traits::has_trivial_copy ? HAS_TRIVIAL_COPY : 0)) - ) -{ -} - -template inline -SortedVector::SortedVector(const SortedVector& rhs) - : SortedVectorImpl(rhs) { -} - -template inline -SortedVector::~SortedVector() { - finish_vector(); -} - -template inline -SortedVector& SortedVector::operator = (const SortedVector& rhs) { - SortedVectorImpl::operator = (rhs); - return *this; -} - -template inline -const SortedVector& SortedVector::operator = (const SortedVector& rhs) const { - SortedVectorImpl::operator = (rhs); - return *this; -} - -template inline -const TYPE* SortedVector::array() const { - return static_cast(arrayImpl()); -} - -template inline -TYPE* SortedVector::editArray() { - return static_cast(editArrayImpl()); -} - - -template inline -const TYPE& SortedVector::operator[](size_t index) const { - assert( index inline -const TYPE& SortedVector::itemAt(size_t index) const { - return operator[](index); -} - -template inline -const TYPE& SortedVector::mirrorItemAt(ssize_t index) const { - assert( (index>0 ? index : -index) inline -const TYPE& SortedVector::top() const { - return *(array() + size() - 1); -} - -template inline -ssize_t SortedVector::add(const TYPE& item) { - return SortedVectorImpl::add(&item); -} - -template inline -ssize_t SortedVector::indexOf(const TYPE& item) const { - return SortedVectorImpl::indexOf(&item); -} - -template inline -size_t SortedVector::orderOf(const TYPE& item) const { - return SortedVectorImpl::orderOf(&item); -} - -template inline -ssize_t SortedVector::merge(const Vector& vector) { - return SortedVectorImpl::merge(reinterpret_cast(vector)); -} - -template inline -ssize_t SortedVector::merge(const SortedVector& vector) { - return SortedVectorImpl::merge(reinterpret_cast(vector)); -} - -template inline -ssize_t SortedVector::remove(const TYPE& item) { - return SortedVectorImpl::remove(&item); -} - -template inline -ssize_t SortedVector::removeItemsAt(size_t index, size_t count) { - return VectorImpl::removeItemsAt(index, count); -} - -// --------------------------------------------------------------------------- - -template -void SortedVector::do_construct(void* storage, size_t num) const { - construct_type( reinterpret_cast(storage), num ); -} - -template -void SortedVector::do_destroy(void* storage, size_t num) const { - destroy_type( reinterpret_cast(storage), num ); -} - -template -void SortedVector::do_copy(void* dest, const void* from, size_t num) const { - copy_type( reinterpret_cast(dest), reinterpret_cast(from), num ); -} - -template -void SortedVector::do_splat(void* dest, const void* item, size_t num) const { - splat_type( reinterpret_cast(dest), reinterpret_cast(item), num ); -} - -template -void SortedVector::do_move_forward(void* dest, const void* from, size_t num) const { - move_forward_type( reinterpret_cast(dest), reinterpret_cast(from), num ); -} - -template -void SortedVector::do_move_backward(void* dest, const void* from, size_t num) const { - move_backward_type( reinterpret_cast(dest), reinterpret_cast(from), num ); -} - -template -int SortedVector::do_compare(const void* lhs, const void* rhs) const { - return compare_type( *reinterpret_cast(lhs), *reinterpret_cast(rhs) ); -} - -}; // namespace android - - -// --------------------------------------------------------------------------- - -#endif // ANDROID_SORTED_VECTOR_H diff --git a/external/android/include/14/frameworks/base/include/utils/StopWatch.h b/external/android/include/14/frameworks/base/include/utils/StopWatch.h deleted file mode 100644 index 693dd3c..0000000 --- a/external/android/include/14/frameworks/base/include/utils/StopWatch.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2005 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_STOPWATCH_H -#define ANDROID_STOPWATCH_H - -#include -#include - -#include - -// --------------------------------------------------------------------------- - -namespace android { - -class StopWatch -{ -public: - StopWatch( const char *name, - int clock = SYSTEM_TIME_MONOTONIC, - uint32_t flags = 0); - ~StopWatch(); - - const char* name() const; - nsecs_t lap(); - nsecs_t elapsedTime() const; - - void reset(); - -private: - const char* mName; - int mClock; - uint32_t mFlags; - - struct lap_t { - nsecs_t soFar; - nsecs_t thisLap; - }; - - nsecs_t mStartTime; - lap_t mLaps[8]; - int mNumLaps; -}; - - -}; // namespace android - - -// --------------------------------------------------------------------------- - -#endif // ANDROID_STOPWATCH_H diff --git a/external/android/include/14/frameworks/base/include/utils/StreamingZipInflater.h b/external/android/include/14/frameworks/base/include/utils/StreamingZipInflater.h deleted file mode 100644 index 3ace5d5..0000000 --- a/external/android/include/14/frameworks/base/include/utils/StreamingZipInflater.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2010 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 __LIBS_STREAMINGZIPINFLATER_H -#define __LIBS_STREAMINGZIPINFLATER_H - -#include -#include -#include - -#include - -namespace android { - -class StreamingZipInflater { -public: - static const size_t INPUT_CHUNK_SIZE = 64 * 1024; - static const size_t OUTPUT_CHUNK_SIZE = 64 * 1024; - - // Flavor that pages in the compressed data from a fd - StreamingZipInflater(int fd, off64_t compDataStart, size_t uncompSize, size_t compSize); - - // Flavor that gets the compressed data from an in-memory buffer - StreamingZipInflater(class FileMap* dataMap, size_t uncompSize); - - ~StreamingZipInflater(); - - // read 'count' bytes of uncompressed data from the current position. outBuf may - // be NULL, in which case the data is consumed and discarded. - ssize_t read(void* outBuf, size_t count); - - // seeking backwards requires uncompressing fom the beginning, so is very - // expensive. seeking forwards only requires uncompressing from the current - // position to the destination. - off64_t seekAbsolute(off64_t absoluteInputPosition); - -private: - void initInflateState(); - int readNextChunk(); - - // where to find the uncompressed data - int mFd; - off64_t mInFileStart; // where the compressed data lives in the file - class FileMap* mDataMap; - - z_stream mInflateState; - bool mStreamNeedsInit; - - // output invariants for this asset - uint8_t* mOutBuf; // output buf for decompressed bytes - size_t mOutBufSize; // allocated size of mOutBuf - size_t mOutTotalSize; // total uncompressed size of the blob - - // current output state bookkeeping - off64_t mOutCurPosition; // current position in total offset - size_t mOutLastDecoded; // last decoded byte + 1 in mOutbuf - size_t mOutDeliverable; // next undelivered byte of decoded output in mOutBuf - - // input invariants - uint8_t* mInBuf; - size_t mInBufSize; // allocated size of mInBuf; - size_t mInTotalSize; // total size of compressed data for this blob - - // input state bookkeeping - size_t mInNextChunkOffset; // offset from start of blob at which the next input chunk lies - // the z_stream contains state about input block consumption -}; - -} - -#endif diff --git a/external/android/include/14/frameworks/base/include/utils/String16.h b/external/android/include/14/frameworks/base/include/utils/String16.h deleted file mode 100644 index 360f407..0000000 --- a/external/android/include/14/frameworks/base/include/utils/String16.h +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright (C) 2005 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_STRING16_H -#define ANDROID_STRING16_H - -#include -#include -#include - -// --------------------------------------------------------------------------- - -extern "C" { - -} - -// --------------------------------------------------------------------------- - -namespace android { - -// --------------------------------------------------------------------------- - -class String8; -class TextOutput; - -//! This is a string holding UTF-16 characters. -class String16 -{ -public: - String16(); - String16(const String16& o); - String16(const String16& o, - size_t len, - size_t begin=0); - explicit String16(const char16_t* o); - explicit String16(const char16_t* o, size_t len); - explicit String16(const String8& o); - explicit String16(const char* o); - explicit String16(const char* o, size_t len); - - ~String16(); - - inline const char16_t* string() const; - inline size_t size() const; - - inline const SharedBuffer* sharedBuffer() const; - - void setTo(const String16& other); - status_t setTo(const char16_t* other); - status_t setTo(const char16_t* other, size_t len); - status_t setTo(const String16& other, - size_t len, - size_t begin=0); - - status_t append(const String16& other); - status_t append(const char16_t* other, size_t len); - - inline String16& operator=(const String16& other); - - inline String16& operator+=(const String16& other); - inline String16 operator+(const String16& other) const; - - status_t insert(size_t pos, const char16_t* chrs); - status_t insert(size_t pos, - const char16_t* chrs, size_t len); - - ssize_t findFirst(char16_t c) const; - ssize_t findLast(char16_t c) const; - - bool startsWith(const String16& prefix) const; - bool startsWith(const char16_t* prefix) const; - - status_t makeLower(); - - status_t replaceAll(char16_t replaceThis, - char16_t withThis); - - status_t remove(size_t len, size_t begin=0); - - inline int compare(const String16& other) const; - - inline bool operator<(const String16& other) const; - inline bool operator<=(const String16& other) const; - inline bool operator==(const String16& other) const; - inline bool operator!=(const String16& other) const; - inline bool operator>=(const String16& other) const; - inline bool operator>(const String16& other) const; - - inline bool operator<(const char16_t* other) const; - inline bool operator<=(const char16_t* other) const; - inline bool operator==(const char16_t* other) const; - inline bool operator!=(const char16_t* other) const; - inline bool operator>=(const char16_t* other) const; - inline bool operator>(const char16_t* other) const; - - inline operator const char16_t*() const; - -private: - const char16_t* mString; -}; - -TextOutput& operator<<(TextOutput& to, const String16& val); - -// --------------------------------------------------------------------------- -// No user servicable parts below. - -inline int compare_type(const String16& lhs, const String16& rhs) -{ - return lhs.compare(rhs); -} - -inline int strictly_order_type(const String16& lhs, const String16& rhs) -{ - return compare_type(lhs, rhs) < 0; -} - -inline const char16_t* String16::string() const -{ - return mString; -} - -inline size_t String16::size() const -{ - return SharedBuffer::sizeFromData(mString)/sizeof(char16_t)-1; -} - -inline const SharedBuffer* String16::sharedBuffer() const -{ - return SharedBuffer::bufferFromData(mString); -} - -inline String16& String16::operator=(const String16& other) -{ - setTo(other); - return *this; -} - -inline String16& String16::operator+=(const String16& other) -{ - append(other); - return *this; -} - -inline String16 String16::operator+(const String16& other) const -{ - String16 tmp(*this); - tmp += other; - return tmp; -} - -inline int String16::compare(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()); -} - -inline bool String16::operator<(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()) < 0; -} - -inline bool String16::operator<=(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()) <= 0; -} - -inline bool String16::operator==(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()) == 0; -} - -inline bool String16::operator!=(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()) != 0; -} - -inline bool String16::operator>=(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()) >= 0; -} - -inline bool String16::operator>(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()) > 0; -} - -inline bool String16::operator<(const char16_t* other) const -{ - return strcmp16(mString, other) < 0; -} - -inline bool String16::operator<=(const char16_t* other) const -{ - return strcmp16(mString, other) <= 0; -} - -inline bool String16::operator==(const char16_t* other) const -{ - return strcmp16(mString, other) == 0; -} - -inline bool String16::operator!=(const char16_t* other) const -{ - return strcmp16(mString, other) != 0; -} - -inline bool String16::operator>=(const char16_t* other) const -{ - return strcmp16(mString, other) >= 0; -} - -inline bool String16::operator>(const char16_t* other) const -{ - return strcmp16(mString, other) > 0; -} - -inline String16::operator const char16_t*() const -{ - return mString; -} - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_STRING16_H diff --git a/external/android/include/14/frameworks/base/include/utils/String8.h b/external/android/include/14/frameworks/base/include/utils/String8.h deleted file mode 100644 index 4163697..0000000 --- a/external/android/include/14/frameworks/base/include/utils/String8.h +++ /dev/null @@ -1,383 +0,0 @@ -/* - * Copyright (C) 2005 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_STRING8_H -#define ANDROID_STRING8_H - -#include -#include -#include - -#include // for strcmp -#include - -// --------------------------------------------------------------------------- - -namespace android { - -class String16; -class TextOutput; - -//! This is a string holding UTF-8 characters. Does not allow the value more -// than 0x10FFFF, which is not valid unicode codepoint. -class String8 -{ -public: - String8(); - String8(const String8& o); - explicit String8(const char* o); - explicit String8(const char* o, size_t numChars); - - explicit String8(const String16& o); - explicit String8(const char16_t* o); - explicit String8(const char16_t* o, size_t numChars); - explicit String8(const char32_t* o); - explicit String8(const char32_t* o, size_t numChars); - ~String8(); - - static inline const String8 empty(); - - static String8 format(const char* fmt, ...) __attribute__((format (printf, 1, 2))); - static String8 formatV(const char* fmt, va_list args); - - inline const char* string() const; - inline size_t size() const; - inline size_t length() const; - inline size_t bytes() const; - inline bool isEmpty() const; - - inline const SharedBuffer* sharedBuffer() const; - - void clear(); - - void setTo(const String8& other); - status_t setTo(const char* other); - status_t setTo(const char* other, size_t numChars); - status_t setTo(const char16_t* other, size_t numChars); - status_t setTo(const char32_t* other, - size_t length); - - status_t append(const String8& other); - status_t append(const char* other); - status_t append(const char* other, size_t numChars); - - status_t appendFormat(const char* fmt, ...) - __attribute__((format (printf, 2, 3))); - status_t appendFormatV(const char* fmt, va_list args); - - // Note that this function takes O(N) time to calculate the value. - // No cache value is stored. - size_t getUtf32Length() const; - int32_t getUtf32At(size_t index, - size_t *next_index) const; - void getUtf32(char32_t* dst) const; - - inline String8& operator=(const String8& other); - inline String8& operator=(const char* other); - - inline String8& operator+=(const String8& other); - inline String8 operator+(const String8& other) const; - - inline String8& operator+=(const char* other); - inline String8 operator+(const char* other) const; - - inline int compare(const String8& other) const; - - inline bool operator<(const String8& other) const; - inline bool operator<=(const String8& other) const; - inline bool operator==(const String8& other) const; - inline bool operator!=(const String8& other) const; - inline bool operator>=(const String8& other) const; - inline bool operator>(const String8& other) const; - - inline bool operator<(const char* other) const; - inline bool operator<=(const char* other) const; - inline bool operator==(const char* other) const; - inline bool operator!=(const char* other) const; - inline bool operator>=(const char* other) const; - inline bool operator>(const char* other) const; - - inline operator const char*() const; - - char* lockBuffer(size_t size); - void unlockBuffer(); - status_t unlockBuffer(size_t size); - - // return the index of the first byte of other in this at or after - // start, or -1 if not found - ssize_t find(const char* other, size_t start = 0) const; - - void toLower(); - void toLower(size_t start, size_t numChars); - void toUpper(); - void toUpper(size_t start, size_t numChars); - - /* - * These methods operate on the string as if it were a path name. - */ - - /* - * Set the filename field to a specific value. - * - * Normalizes the filename, removing a trailing '/' if present. - */ - void setPathName(const char* name); - void setPathName(const char* name, size_t numChars); - - /* - * Get just the filename component. - * - * "/tmp/foo/bar.c" --> "bar.c" - */ - String8 getPathLeaf(void) const; - - /* - * Remove the last (file name) component, leaving just the directory - * name. - * - * "/tmp/foo/bar.c" --> "/tmp/foo" - * "/tmp" --> "" // ????? shouldn't this be "/" ???? XXX - * "bar.c" --> "" - */ - String8 getPathDir(void) const; - - /* - * Retrieve the front (root dir) component. Optionally also return the - * remaining components. - * - * "/tmp/foo/bar.c" --> "tmp" (remain = "foo/bar.c") - * "/tmp" --> "tmp" (remain = "") - * "bar.c" --> "bar.c" (remain = "") - */ - String8 walkPath(String8* outRemains = NULL) const; - - /* - * Return the filename extension. This is the last '.' and any number - * of characters that follow it. The '.' is included in case we - * decide to expand our definition of what constitutes an extension. - * - * "/tmp/foo/bar.c" --> ".c" - * "/tmp" --> "" - * "/tmp/foo.bar/baz" --> "" - * "foo.jpeg" --> ".jpeg" - * "foo." --> "" - */ - String8 getPathExtension(void) const; - - /* - * Return the path without the extension. Rules for what constitutes - * an extension are described in the comment for getPathExtension(). - * - * "/tmp/foo/bar.c" --> "/tmp/foo/bar" - */ - String8 getBasePath(void) const; - - /* - * Add a component to the pathname. We guarantee that there is - * exactly one path separator between the old path and the new. - * If there is no existing name, we just copy the new name in. - * - * If leaf is a fully qualified path (i.e. starts with '/', it - * replaces whatever was there before. - */ - String8& appendPath(const char* leaf); - String8& appendPath(const String8& leaf) { return appendPath(leaf.string()); } - - /* - * Like appendPath(), but does not affect this string. Returns a new one instead. - */ - String8 appendPathCopy(const char* leaf) const - { String8 p(*this); p.appendPath(leaf); return p; } - String8 appendPathCopy(const String8& leaf) const { return appendPathCopy(leaf.string()); } - - /* - * Converts all separators in this string to /, the default path separator. - * - * If the default OS separator is backslash, this converts all - * backslashes to slashes, in-place. Otherwise it does nothing. - * Returns self. - */ - String8& convertToResPath(); - -private: - status_t real_append(const char* other, size_t numChars); - char* find_extension(void) const; - - const char* mString; -}; - -TextOutput& operator<<(TextOutput& to, const String16& val); - -// --------------------------------------------------------------------------- -// No user servicable parts below. - -inline int compare_type(const String8& lhs, const String8& rhs) -{ - return lhs.compare(rhs); -} - -inline int strictly_order_type(const String8& lhs, const String8& rhs) -{ - return compare_type(lhs, rhs) < 0; -} - -inline const String8 String8::empty() { - return String8(); -} - -inline const char* String8::string() const -{ - return mString; -} - -inline size_t String8::length() const -{ - return SharedBuffer::sizeFromData(mString)-1; -} - -inline size_t String8::size() const -{ - return length(); -} - -inline bool String8::isEmpty() const -{ - return length() == 0; -} - -inline size_t String8::bytes() const -{ - return SharedBuffer::sizeFromData(mString)-1; -} - -inline const SharedBuffer* String8::sharedBuffer() const -{ - return SharedBuffer::bufferFromData(mString); -} - -inline String8& String8::operator=(const String8& other) -{ - setTo(other); - return *this; -} - -inline String8& String8::operator=(const char* other) -{ - setTo(other); - return *this; -} - -inline String8& String8::operator+=(const String8& other) -{ - append(other); - return *this; -} - -inline String8 String8::operator+(const String8& other) const -{ - String8 tmp(*this); - tmp += other; - return tmp; -} - -inline String8& String8::operator+=(const char* other) -{ - append(other); - return *this; -} - -inline String8 String8::operator+(const char* other) const -{ - String8 tmp(*this); - tmp += other; - return tmp; -} - -inline int String8::compare(const String8& other) const -{ - return strcmp(mString, other.mString); -} - -inline bool String8::operator<(const String8& other) const -{ - return strcmp(mString, other.mString) < 0; -} - -inline bool String8::operator<=(const String8& other) const -{ - return strcmp(mString, other.mString) <= 0; -} - -inline bool String8::operator==(const String8& other) const -{ - return strcmp(mString, other.mString) == 0; -} - -inline bool String8::operator!=(const String8& other) const -{ - return strcmp(mString, other.mString) != 0; -} - -inline bool String8::operator>=(const String8& other) const -{ - return strcmp(mString, other.mString) >= 0; -} - -inline bool String8::operator>(const String8& other) const -{ - return strcmp(mString, other.mString) > 0; -} - -inline bool String8::operator<(const char* other) const -{ - return strcmp(mString, other) < 0; -} - -inline bool String8::operator<=(const char* other) const -{ - return strcmp(mString, other) <= 0; -} - -inline bool String8::operator==(const char* other) const -{ - return strcmp(mString, other) == 0; -} - -inline bool String8::operator!=(const char* other) const -{ - return strcmp(mString, other) != 0; -} - -inline bool String8::operator>=(const char* other) const -{ - return strcmp(mString, other) >= 0; -} - -inline bool String8::operator>(const char* other) const -{ - return strcmp(mString, other) > 0; -} - -inline String8::operator const char*() const -{ - return mString; -} - -} // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_STRING8_H diff --git a/external/android/include/14/frameworks/base/include/utils/StringArray.h b/external/android/include/14/frameworks/base/include/utils/StringArray.h deleted file mode 100644 index c244587..0000000 --- a/external/android/include/14/frameworks/base/include/utils/StringArray.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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. - */ - -// -// Sortable array of strings. STL-ish, but STL-free. -// -#ifndef _LIBS_UTILS_STRING_ARRAY_H -#define _LIBS_UTILS_STRING_ARRAY_H - -#include -#include - -namespace android { - -// -// An expanding array of strings. Add, get, sort, delete. -// -class StringArray { -public: - StringArray(); - virtual ~StringArray(); - - // - // Add a string. A copy of the string is made. - // - bool push_back(const char* str); - - // - // Delete an entry. - // - void erase(int idx); - - // - // Sort the array. - // - void sort(int (*compare)(const void*, const void*)); - - // - // Pass this to the sort routine to do an ascending alphabetical sort. - // - static int cmpAscendingAlpha(const void* pstr1, const void* pstr2); - - // - // Get the #of items in the array. - // - inline int size(void) const { return mCurrent; } - - // - // Return entry N. - // [should use operator[] here] - // - const char* getEntry(int idx) const { - return (unsigned(idx) >= unsigned(mCurrent)) ? NULL : mArray[idx]; - } - - // - // Set entry N to specified string. - // [should use operator[] here] - // - void setEntry(int idx, const char* str); - -private: - int mMax; - int mCurrent; - char** mArray; -}; - -}; // namespace android - -#endif // _LIBS_UTILS_STRING_ARRAY_H diff --git a/external/android/include/14/frameworks/base/include/utils/StrongPointer.h b/external/android/include/14/frameworks/base/include/utils/StrongPointer.h deleted file mode 100644 index 49fa3a8..0000000 --- a/external/android/include/14/frameworks/base/include/utils/StrongPointer.h +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright (C) 2005 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_STRONG_POINTER_H -#define ANDROID_STRONG_POINTER_H - -#include - -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -class TextOutput; -TextOutput& printStrongPointer(TextOutput& to, const void* val); - -template class wp; - -// --------------------------------------------------------------------------- - -#define COMPARE(_op_) \ -inline bool operator _op_ (const sp& o) const { \ - return m_ptr _op_ o.m_ptr; \ -} \ -inline bool operator _op_ (const T* o) const { \ - return m_ptr _op_ o; \ -} \ -template \ -inline bool operator _op_ (const sp& o) const { \ - return m_ptr _op_ o.m_ptr; \ -} \ -template \ -inline bool operator _op_ (const U* o) const { \ - return m_ptr _op_ o; \ -} \ -inline bool operator _op_ (const wp& o) const { \ - return m_ptr _op_ o.m_ptr; \ -} \ -template \ -inline bool operator _op_ (const wp& o) const { \ - return m_ptr _op_ o.m_ptr; \ -} - -// --------------------------------------------------------------------------- - -template -class sp -{ -public: - inline sp() : m_ptr(0) { } - - sp(T* other); - sp(const sp& other); - template sp(U* other); - template sp(const sp& other); - - ~sp(); - - // Assignment - - sp& operator = (T* other); - sp& operator = (const sp& other); - - template sp& operator = (const sp& other); - template sp& operator = (U* other); - - //! Special optimization for use by ProcessState (and nobody else). - void force_set(T* other); - - // Reset - - void clear(); - - // Accessors - - inline T& operator* () const { return *m_ptr; } - inline T* operator-> () const { return m_ptr; } - inline T* get() const { return m_ptr; } - - // Operators - - COMPARE(==) - COMPARE(!=) - COMPARE(>) - COMPARE(<) - COMPARE(<=) - COMPARE(>=) - -private: - template friend class sp; - template friend class wp; - void set_pointer(T* ptr); - T* m_ptr; -}; - -#undef COMPARE - -template -TextOutput& operator<<(TextOutput& to, const sp& val); - -// --------------------------------------------------------------------------- -// No user serviceable parts below here. - -template -sp::sp(T* other) -: m_ptr(other) - { - if (other) other->incStrong(this); - } - -template -sp::sp(const sp& other) -: m_ptr(other.m_ptr) - { - if (m_ptr) m_ptr->incStrong(this); - } - -template template -sp::sp(U* other) : m_ptr(other) -{ - if (other) ((T*)other)->incStrong(this); -} - -template template -sp::sp(const sp& other) -: m_ptr(other.m_ptr) - { - if (m_ptr) m_ptr->incStrong(this); - } - -template -sp::~sp() -{ - if (m_ptr) m_ptr->decStrong(this); -} - -template -sp& sp::operator = (const sp& other) { - T* otherPtr(other.m_ptr); - if (otherPtr) otherPtr->incStrong(this); - if (m_ptr) m_ptr->decStrong(this); - m_ptr = otherPtr; - return *this; -} - -template -sp& sp::operator = (T* other) -{ - if (other) other->incStrong(this); - if (m_ptr) m_ptr->decStrong(this); - m_ptr = other; - return *this; -} - -template template -sp& sp::operator = (const sp& other) -{ - T* otherPtr(other.m_ptr); - if (otherPtr) otherPtr->incStrong(this); - if (m_ptr) m_ptr->decStrong(this); - m_ptr = otherPtr; - return *this; -} - -template template -sp& sp::operator = (U* other) -{ - if (other) ((T*)other)->incStrong(this); - if (m_ptr) m_ptr->decStrong(this); - m_ptr = other; - return *this; -} - -template -void sp::force_set(T* other) -{ - other->forceIncStrong(this); - m_ptr = other; -} - -template -void sp::clear() -{ - if (m_ptr) { - m_ptr->decStrong(this); - m_ptr = 0; - } -} - -template -void sp::set_pointer(T* ptr) { - m_ptr = ptr; -} - -template -inline TextOutput& operator<<(TextOutput& to, const sp& val) -{ - return printStrongPointer(to, val.get()); -} - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_STRONG_POINTER_H diff --git a/external/android/include/14/frameworks/base/include/utils/SystemClock.h b/external/android/include/14/frameworks/base/include/utils/SystemClock.h deleted file mode 100644 index 7c319be..0000000 --- a/external/android/include/14/frameworks/base/include/utils/SystemClock.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_UTILS_SYSTEMCLOCK_H -#define ANDROID_UTILS_SYSTEMCLOCK_H - -#include -#include - -namespace android { - -int setCurrentTimeMillis(int64_t millis); -int64_t uptimeMillis(); -int64_t elapsedRealtime(); - -}; // namespace android - -#endif // ANDROID_UTILS_SYSTEMCLOCK_H - diff --git a/external/android/include/14/frameworks/base/include/utils/TextOutput.h b/external/android/include/14/frameworks/base/include/utils/TextOutput.h deleted file mode 100644 index de2fbbe..0000000 --- a/external/android/include/14/frameworks/base/include/utils/TextOutput.h +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (C) 2006 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_TEXTOUTPUT_H -#define ANDROID_TEXTOUTPUT_H - -#include - -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -class TextOutput -{ -public: - TextOutput(); - virtual ~TextOutput(); - - virtual status_t print(const char* txt, size_t len) = 0; - virtual void moveIndent(int delta) = 0; - - class Bundle { - public: - inline Bundle(TextOutput& to) : mTO(to) { to.pushBundle(); } - inline ~Bundle() { mTO.popBundle(); } - private: - TextOutput& mTO; - }; - - virtual void pushBundle() = 0; - virtual void popBundle() = 0; -}; - -// --------------------------------------------------------------------------- - -// Text output stream for printing to the log (via utils/Log.h). -extern TextOutput& alog; - -// Text output stream for printing to stdout. -extern TextOutput& aout; - -// Text output stream for printing to stderr. -extern TextOutput& aerr; - -typedef TextOutput& (*TextOutputManipFunc)(TextOutput&); - -TextOutput& endl(TextOutput& to); -TextOutput& indent(TextOutput& to); -TextOutput& dedent(TextOutput& to); - -TextOutput& operator<<(TextOutput& to, const char* str); -TextOutput& operator<<(TextOutput& to, char); // writes raw character -TextOutput& operator<<(TextOutput& to, bool); -TextOutput& operator<<(TextOutput& to, int); -TextOutput& operator<<(TextOutput& to, long); -TextOutput& operator<<(TextOutput& to, unsigned int); -TextOutput& operator<<(TextOutput& to, unsigned long); -TextOutput& operator<<(TextOutput& to, long long); -TextOutput& operator<<(TextOutput& to, unsigned long long); -TextOutput& operator<<(TextOutput& to, float); -TextOutput& operator<<(TextOutput& to, double); -TextOutput& operator<<(TextOutput& to, TextOutputManipFunc func); -TextOutput& operator<<(TextOutput& to, const void*); - -class TypeCode -{ -public: - inline TypeCode(uint32_t code); - inline ~TypeCode(); - - inline uint32_t typeCode() const; - -private: - uint32_t mCode; -}; - -TextOutput& operator<<(TextOutput& to, const TypeCode& val); - -class HexDump -{ -public: - HexDump(const void *buf, size_t size, size_t bytesPerLine=16); - inline ~HexDump(); - - inline HexDump& setBytesPerLine(size_t bytesPerLine); - inline HexDump& setSingleLineCutoff(int32_t bytes); - inline HexDump& setAlignment(size_t alignment); - inline HexDump& setCArrayStyle(bool enabled); - - inline const void* buffer() const; - inline size_t size() const; - inline size_t bytesPerLine() const; - inline int32_t singleLineCutoff() const; - inline size_t alignment() const; - inline bool carrayStyle() const; - -private: - const void* mBuffer; - size_t mSize; - size_t mBytesPerLine; - int32_t mSingleLineCutoff; - size_t mAlignment; - bool mCArrayStyle; -}; - -TextOutput& operator<<(TextOutput& to, const HexDump& val); - -// --------------------------------------------------------------------------- -// No user servicable parts below. - -inline TextOutput& endl(TextOutput& to) -{ - to.print("\n", 1); - return to; -} - -inline TextOutput& indent(TextOutput& to) -{ - to.moveIndent(1); - return to; -} - -inline TextOutput& dedent(TextOutput& to) -{ - to.moveIndent(-1); - return to; -} - -inline TextOutput& operator<<(TextOutput& to, const char* str) -{ - to.print(str, strlen(str)); - return to; -} - -inline TextOutput& operator<<(TextOutput& to, char c) -{ - to.print(&c, 1); - return to; -} - -inline TextOutput& operator<<(TextOutput& to, TextOutputManipFunc func) -{ - return (*func)(to); -} - -inline TypeCode::TypeCode(uint32_t code) : mCode(code) { } -inline TypeCode::~TypeCode() { } -inline uint32_t TypeCode::typeCode() const { return mCode; } - -inline HexDump::~HexDump() { } - -inline HexDump& HexDump::setBytesPerLine(size_t bytesPerLine) { - mBytesPerLine = bytesPerLine; return *this; -} -inline HexDump& HexDump::setSingleLineCutoff(int32_t bytes) { - mSingleLineCutoff = bytes; return *this; -} -inline HexDump& HexDump::setAlignment(size_t alignment) { - mAlignment = alignment; return *this; -} -inline HexDump& HexDump::setCArrayStyle(bool enabled) { - mCArrayStyle = enabled; return *this; -} - -inline const void* HexDump::buffer() const { return mBuffer; } -inline size_t HexDump::size() const { return mSize; } -inline size_t HexDump::bytesPerLine() const { return mBytesPerLine; } -inline int32_t HexDump::singleLineCutoff() const { return mSingleLineCutoff; } -inline size_t HexDump::alignment() const { return mAlignment; } -inline bool HexDump::carrayStyle() const { return mCArrayStyle; } - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_TEXTOUTPUT_H diff --git a/external/android/include/14/frameworks/base/include/utils/Timers.h b/external/android/include/14/frameworks/base/include/utils/Timers.h deleted file mode 100644 index 8b4d322..0000000 --- a/external/android/include/14/frameworks/base/include/utils/Timers.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// Timer functions. -// -#ifndef _LIBS_UTILS_TIMERS_H -#define _LIBS_UTILS_TIMERS_H - -#include -#include -#include - -// ------------------------------------------------------------------ -// C API - -#ifdef __cplusplus -extern "C" { -#endif - -typedef int64_t nsecs_t; // nano-seconds - -static inline nsecs_t seconds_to_nanoseconds(nsecs_t secs) -{ - return secs*1000000000; -} - -static inline nsecs_t milliseconds_to_nanoseconds(nsecs_t secs) -{ - return secs*1000000; -} - -static inline nsecs_t microseconds_to_nanoseconds(nsecs_t secs) -{ - return secs*1000; -} - -static inline nsecs_t nanoseconds_to_seconds(nsecs_t secs) -{ - return secs/1000000000; -} - -static inline nsecs_t nanoseconds_to_milliseconds(nsecs_t secs) -{ - return secs/1000000; -} - -static inline nsecs_t nanoseconds_to_microseconds(nsecs_t secs) -{ - return secs/1000; -} - -static inline nsecs_t s2ns(nsecs_t v) {return seconds_to_nanoseconds(v);} -static inline nsecs_t ms2ns(nsecs_t v) {return milliseconds_to_nanoseconds(v);} -static inline nsecs_t us2ns(nsecs_t v) {return microseconds_to_nanoseconds(v);} -static inline nsecs_t ns2s(nsecs_t v) {return nanoseconds_to_seconds(v);} -static inline nsecs_t ns2ms(nsecs_t v) {return nanoseconds_to_milliseconds(v);} -static inline nsecs_t ns2us(nsecs_t v) {return nanoseconds_to_microseconds(v);} - -static inline nsecs_t seconds(nsecs_t v) { return s2ns(v); } -static inline nsecs_t milliseconds(nsecs_t v) { return ms2ns(v); } -static inline nsecs_t microseconds(nsecs_t v) { return us2ns(v); } - -enum { - SYSTEM_TIME_REALTIME = 0, // system-wide realtime clock - SYSTEM_TIME_MONOTONIC = 1, // monotonic time since unspecified starting point - SYSTEM_TIME_PROCESS = 2, // high-resolution per-process clock - SYSTEM_TIME_THREAD = 3 // high-resolution per-thread clock -}; - -// return the system-time according to the specified clock -#ifdef __cplusplus -nsecs_t systemTime(int clock = SYSTEM_TIME_MONOTONIC); -#else -nsecs_t systemTime(int clock); -#endif // def __cplusplus - -/** - * Returns the number of milliseconds to wait between the reference time and the timeout time. - * If the timeout is in the past relative to the reference time, returns 0. - * If the timeout is more than INT_MAX milliseconds in the future relative to the reference time, - * such as when timeoutTime == LLONG_MAX, returns -1 to indicate an infinite timeout delay. - * Otherwise, returns the difference between the reference time and timeout time - * rounded up to the next millisecond. - */ -int toMillisecondTimeoutDelay(nsecs_t referenceTime, nsecs_t timeoutTime); - -#ifdef __cplusplus -} // extern "C" -#endif - -// ------------------------------------------------------------------ -// C++ API - -#ifdef __cplusplus - -namespace android { -/* - * Time the duration of something. - * - * Includes some timeval manipulation functions. - */ -class DurationTimer { -public: - DurationTimer() {} - ~DurationTimer() {} - - // Start the timer. - void start(); - // Stop the timer. - void stop(); - // Get the duration in microseconds. - long long durationUsecs() const; - - // Subtract two timevals. Returns the difference (ptv1-ptv2) in - // microseconds. - static long long subtractTimevals(const struct timeval* ptv1, - const struct timeval* ptv2); - - // Add the specified amount of time to the timeval. - static void addToTimeval(struct timeval* ptv, long usec); - -private: - struct timeval mStartWhen; - struct timeval mStopWhen; -}; - -}; // android -#endif // def __cplusplus - -#endif // _LIBS_UTILS_TIMERS_H diff --git a/external/android/include/14/frameworks/base/include/utils/Tokenizer.h b/external/android/include/14/frameworks/base/include/utils/Tokenizer.h deleted file mode 100644 index c7db5fb..0000000 --- a/external/android/include/14/frameworks/base/include/utils/Tokenizer.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (C) 2010 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 _UTILS_TOKENIZER_H -#define _UTILS_TOKENIZER_H - -#include -#include -#include -#include - -namespace android { - -/** - * A simple tokenizer for loading and parsing ASCII text files line by line. - */ -class Tokenizer { - Tokenizer(const String8& filename, FileMap* fileMap, char* buffer, size_t length); - -public: - ~Tokenizer(); - - /** - * Opens a file and maps it into memory. - * - * Returns NO_ERROR and a tokenizer for the file, if successful. - * Otherwise returns an error and sets outTokenizer to NULL. - */ - static status_t open(const String8& filename, Tokenizer** outTokenizer); - - /** - * Returns true if at the end of the file. - */ - inline bool isEof() const { return mCurrent == getEnd(); } - - /** - * Returns true if at the end of the line or end of the file. - */ - inline bool isEol() const { return isEof() || *mCurrent == '\n'; } - - /** - * Gets the name of the file. - */ - inline String8 getFilename() const { return mFilename; } - - /** - * Gets a 1-based line number index for the current position. - */ - inline int32_t getLineNumber() const { return mLineNumber; } - - /** - * Formats a location string consisting of the filename and current line number. - * Returns a string like "MyFile.txt:33". - */ - String8 getLocation() const; - - /** - * Gets the character at the current position. - * Returns null at end of file. - */ - inline char peekChar() const { return isEof() ? '\0' : *mCurrent; } - - /** - * Gets the remainder of the current line as a string, excluding the newline character. - */ - String8 peekRemainderOfLine() const; - - /** - * Gets the character at the current position and advances past it. - * Returns null at end of file. - */ - inline char nextChar() { return isEof() ? '\0' : *(mCurrent++); } - - /** - * Gets the next token on this line stopping at the specified delimiters - * or the end of the line whichever comes first and advances past it. - * Also stops at embedded nulls. - * Returns the token or an empty string if the current character is a delimiter - * or is at the end of the line. - */ - String8 nextToken(const char* delimiters); - - /** - * Advances to the next line. - * Does nothing if already at the end of the file. - */ - void nextLine(); - - /** - * Skips over the specified delimiters in the line. - * Also skips embedded nulls. - */ - void skipDelimiters(const char* delimiters); - -private: - Tokenizer(const Tokenizer& other); // not copyable - - String8 mFilename; - FileMap* mFileMap; - char* mBuffer; - size_t mLength; - - const char* mCurrent; - int32_t mLineNumber; - - inline const char* getEnd() const { return mBuffer + mLength; } - -}; - -} // namespace android - -#endif // _UTILS_TOKENIZER_H diff --git a/external/android/include/14/frameworks/base/include/utils/TypeHelpers.h b/external/android/include/14/frameworks/base/include/utils/TypeHelpers.h deleted file mode 100644 index a1663f3..0000000 --- a/external/android/include/14/frameworks/base/include/utils/TypeHelpers.h +++ /dev/null @@ -1,250 +0,0 @@ -/* - * Copyright (C) 2005 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_TYPE_HELPERS_H -#define ANDROID_TYPE_HELPERS_H - -#include -#include -#include -#include - -// --------------------------------------------------------------------------- - -namespace android { - -/* - * Types traits - */ - -template struct trait_trivial_ctor { enum { value = false }; }; -template struct trait_trivial_dtor { enum { value = false }; }; -template struct trait_trivial_copy { enum { value = false }; }; -template struct trait_trivial_move { enum { value = false }; }; -template struct trait_pointer { enum { value = false }; }; -template struct trait_pointer { enum { value = true }; }; - -template -struct traits { - enum { - // whether this type is a pointer - is_pointer = trait_pointer::value, - // whether this type's constructor is a no-op - has_trivial_ctor = is_pointer || trait_trivial_ctor::value, - // whether this type's destructor is a no-op - has_trivial_dtor = is_pointer || trait_trivial_dtor::value, - // whether this type type can be copy-constructed with memcpy - has_trivial_copy = is_pointer || trait_trivial_copy::value, - // whether this type can be moved with memmove - has_trivial_move = is_pointer || trait_trivial_move::value - }; -}; - -template -struct aggregate_traits { - enum { - is_pointer = false, - has_trivial_ctor = - traits::has_trivial_ctor && traits::has_trivial_ctor, - has_trivial_dtor = - traits::has_trivial_dtor && traits::has_trivial_dtor, - has_trivial_copy = - traits::has_trivial_copy && traits::has_trivial_copy, - has_trivial_move = - traits::has_trivial_move && traits::has_trivial_move - }; -}; - -#define ANDROID_BASIC_TYPES_TRAITS( T ) \ - template<> struct trait_trivial_ctor< T > { enum { value = true }; }; \ - template<> struct trait_trivial_dtor< T > { enum { value = true }; }; \ - template<> struct trait_trivial_copy< T > { enum { value = true }; }; \ - template<> struct trait_trivial_move< T > { enum { value = true }; }; - -// --------------------------------------------------------------------------- - -/* - * basic types traits - */ - -ANDROID_BASIC_TYPES_TRAITS( void ) -ANDROID_BASIC_TYPES_TRAITS( bool ) -ANDROID_BASIC_TYPES_TRAITS( char ) -ANDROID_BASIC_TYPES_TRAITS( unsigned char ) -ANDROID_BASIC_TYPES_TRAITS( short ) -ANDROID_BASIC_TYPES_TRAITS( unsigned short ) -ANDROID_BASIC_TYPES_TRAITS( int ) -ANDROID_BASIC_TYPES_TRAITS( unsigned int ) -ANDROID_BASIC_TYPES_TRAITS( long ) -ANDROID_BASIC_TYPES_TRAITS( unsigned long ) -ANDROID_BASIC_TYPES_TRAITS( long long ) -ANDROID_BASIC_TYPES_TRAITS( unsigned long long ) -ANDROID_BASIC_TYPES_TRAITS( float ) -ANDROID_BASIC_TYPES_TRAITS( double ) - -// --------------------------------------------------------------------------- - - -/* - * compare and order types - */ - -template inline -int strictly_order_type(const TYPE& lhs, const TYPE& rhs) { - return (lhs < rhs) ? 1 : 0; -} - -template inline -int compare_type(const TYPE& lhs, const TYPE& rhs) { - return strictly_order_type(rhs, lhs) - strictly_order_type(lhs, rhs); -} - -/* - * create, destroy, copy and move types... - */ - -template inline -void construct_type(TYPE* p, size_t n) { - if (!traits::has_trivial_ctor) { - while (n--) { - new(p++) TYPE; - } - } -} - -template inline -void destroy_type(TYPE* p, size_t n) { - if (!traits::has_trivial_dtor) { - while (n--) { - p->~TYPE(); - p++; - } - } -} - -template inline -void copy_type(TYPE* d, const TYPE* s, size_t n) { - if (!traits::has_trivial_copy) { - while (n--) { - new(d) TYPE(*s); - d++, s++; - } - } else { - memcpy(d,s,n*sizeof(TYPE)); - } -} - -template inline -void splat_type(TYPE* where, const TYPE* what, size_t n) { - if (!traits::has_trivial_copy) { - while (n--) { - new(where) TYPE(*what); - where++; - } - } else { - while (n--) { - *where++ = *what; - } - } -} - -template inline -void move_forward_type(TYPE* d, const TYPE* s, size_t n = 1) { - if ((traits::has_trivial_dtor && traits::has_trivial_copy) - || traits::has_trivial_move) - { - memmove(d,s,n*sizeof(TYPE)); - } else { - d += n; - s += n; - while (n--) { - --d, --s; - if (!traits::has_trivial_copy) { - new(d) TYPE(*s); - } else { - *d = *s; - } - if (!traits::has_trivial_dtor) { - s->~TYPE(); - } - } - } -} - -template inline -void move_backward_type(TYPE* d, const TYPE* s, size_t n = 1) { - if ((traits::has_trivial_dtor && traits::has_trivial_copy) - || traits::has_trivial_move) - { - memmove(d,s,n*sizeof(TYPE)); - } else { - while (n--) { - if (!traits::has_trivial_copy) { - new(d) TYPE(*s); - } else { - *d = *s; - } - if (!traits::has_trivial_dtor) { - s->~TYPE(); - } - d++, s++; - } - } -} - -// --------------------------------------------------------------------------- - -/* - * a key/value pair - */ - -template -struct key_value_pair_t { - KEY key; - VALUE value; - key_value_pair_t() { } - key_value_pair_t(const key_value_pair_t& o) : key(o.key), value(o.value) { } - key_value_pair_t(const KEY& k, const VALUE& v) : key(k), value(v) { } - key_value_pair_t(const KEY& k) : key(k) { } - inline bool operator < (const key_value_pair_t& o) const { - return strictly_order_type(key, o.key); - } -}; - -template<> -template -struct trait_trivial_ctor< key_value_pair_t > -{ enum { value = aggregate_traits::has_trivial_ctor }; }; -template<> -template -struct trait_trivial_dtor< key_value_pair_t > -{ enum { value = aggregate_traits::has_trivial_dtor }; }; -template<> -template -struct trait_trivial_copy< key_value_pair_t > -{ enum { value = aggregate_traits::has_trivial_copy }; }; -template<> -template -struct trait_trivial_move< key_value_pair_t > -{ enum { value = aggregate_traits::has_trivial_move }; }; - -// --------------------------------------------------------------------------- - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_TYPE_HELPERS_H diff --git a/external/android/include/14/frameworks/base/include/utils/Unicode.h b/external/android/include/14/frameworks/base/include/utils/Unicode.h deleted file mode 100644 index 9273533..0000000 --- a/external/android/include/14/frameworks/base/include/utils/Unicode.h +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (C) 2005 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_UNICODE_H -#define ANDROID_UNICODE_H - -#include -#include - -extern "C" { - -typedef uint32_t char32_t; -typedef uint16_t char16_t; - -// Standard string functions on char16_t strings. -int strcmp16(const char16_t *, const char16_t *); -int strncmp16(const char16_t *s1, const char16_t *s2, size_t n); -size_t strlen16(const char16_t *); -size_t strnlen16(const char16_t *, size_t); -char16_t *strcpy16(char16_t *, const char16_t *); -char16_t *strncpy16(char16_t *, const char16_t *, size_t); - -// Version of comparison that supports embedded nulls. -// This is different than strncmp() because we don't stop -// at a nul character and consider the strings to be different -// if the lengths are different (thus we need to supply the -// lengths of both strings). This can also be used when -// your string is not nul-terminated as it will have the -// equivalent result as strcmp16 (unlike strncmp16). -int strzcmp16(const char16_t *s1, size_t n1, const char16_t *s2, size_t n2); - -// Version of strzcmp16 for comparing strings in different endianness. -int strzcmp16_h_n(const char16_t *s1H, size_t n1, const char16_t *s2N, size_t n2); - -// Standard string functions on char32_t strings. -size_t strlen32(const char32_t *); -size_t strnlen32(const char32_t *, size_t); - -/** - * Measure the length of a UTF-32 string in UTF-8. If the string is invalid - * such as containing a surrogate character, -1 will be returned. - */ -ssize_t utf32_to_utf8_length(const char32_t *src, size_t src_len); - -/** - * Stores a UTF-8 string converted from "src" in "dst", if "dst_length" is not - * large enough to store the string, the part of the "src" string is stored - * into "dst" as much as possible. See the examples for more detail. - * Returns the size actually used for storing the string. - * dst" is not null-terminated when dst_len is fully used (like strncpy). - * - * Example 1 - * "src" == \u3042\u3044 (\xE3\x81\x82\xE3\x81\x84) - * "src_len" == 2 - * "dst_len" >= 7 - * -> - * Returned value == 6 - * "dst" becomes \xE3\x81\x82\xE3\x81\x84\0 - * (note that "dst" is null-terminated) - * - * Example 2 - * "src" == \u3042\u3044 (\xE3\x81\x82\xE3\x81\x84) - * "src_len" == 2 - * "dst_len" == 5 - * -> - * Returned value == 3 - * "dst" becomes \xE3\x81\x82\0 - * (note that "dst" is null-terminated, but \u3044 is not stored in "dst" - * since "dst" does not have enough size to store the character) - * - * Example 3 - * "src" == \u3042\u3044 (\xE3\x81\x82\xE3\x81\x84) - * "src_len" == 2 - * "dst_len" == 6 - * -> - * Returned value == 6 - * "dst" becomes \xE3\x81\x82\xE3\x81\x84 - * (note that "dst" is NOT null-terminated, like strncpy) - */ -void utf32_to_utf8(const char32_t* src, size_t src_len, char* dst); - -/** - * Returns the unicode value at "index". - * Returns -1 when the index is invalid (equals to or more than "src_len"). - * If returned value is positive, it is able to be converted to char32_t, which - * is unsigned. Then, if "next_index" is not NULL, the next index to be used is - * stored in "next_index". "next_index" can be NULL. - */ -int32_t utf32_from_utf8_at(const char *src, size_t src_len, size_t index, size_t *next_index); - - -/** - * Returns the UTF-8 length of UTF-16 string "src". - */ -ssize_t utf16_to_utf8_length(const char16_t *src, size_t src_len); - -/** - * Converts a UTF-16 string to UTF-8. The destination buffer must be large - * enough to fit the UTF-16 as measured by utf16_to_utf8_length with an added - * NULL terminator. - */ -void utf16_to_utf8(const char16_t* src, size_t src_len, char* dst); - -/** - * Returns the length of "src" when "src" is valid UTF-8 string. - * Returns 0 if src is NULL or 0-length string. Returns -1 when the source - * is an invalid string. - * - * This function should be used to determine whether "src" is valid UTF-8 - * characters with valid unicode codepoints. "src" must be null-terminated. - * - * If you are going to use other utf8_to_... functions defined in this header - * with string which may not be valid UTF-8 with valid codepoint (form 0 to - * 0x10FFFF), you should use this function before calling others, since the - * other functions do not check whether the string is valid UTF-8 or not. - * - * If you do not care whether "src" is valid UTF-8 or not, you should use - * strlen() as usual, which should be much faster. - */ -ssize_t utf8_length(const char *src); - -/** - * Measure the length of a UTF-32 string. - */ -size_t utf8_to_utf32_length(const char *src, size_t src_len); - -/** - * Stores a UTF-32 string converted from "src" in "dst". "dst" must be large - * enough to store the entire converted string as measured by - * utf8_to_utf32_length plus space for a NULL terminator. - */ -void utf8_to_utf32(const char* src, size_t src_len, char32_t* dst); - -/** - * Returns the UTF-16 length of UTF-8 string "src". - */ -ssize_t utf8_to_utf16_length(const uint8_t* src, size_t srcLen); - -/** - * Convert UTF-8 to UTF-16 including surrogate pairs. - * Returns a pointer to the end of the string (where a null terminator might go - * if you wanted to add one). - */ -char16_t* utf8_to_utf16_no_null_terminator(const uint8_t* src, size_t srcLen, char16_t* dst); - -/** - * Convert UTF-8 to UTF-16 including surrogate pairs. The destination buffer - * must be large enough to hold the result as measured by utf8_to_utf16_length - * plus an added NULL terminator. - */ -void utf8_to_utf16(const uint8_t* src, size_t srcLen, char16_t* dst); - -} - -#endif diff --git a/external/android/include/14/frameworks/base/include/utils/Vector.h b/external/android/include/14/frameworks/base/include/utils/Vector.h deleted file mode 100644 index b908e2a..0000000 --- a/external/android/include/14/frameworks/base/include/utils/Vector.h +++ /dev/null @@ -1,421 +0,0 @@ -/* - * Copyright (C) 2005 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_VECTOR_H -#define ANDROID_VECTOR_H - -#include -#include -#include - -#include -#include -#include - -// --------------------------------------------------------------------------- - -namespace android { - -template -class SortedVector; - -/*! - * The main templated vector class ensuring type safety - * while making use of VectorImpl. - * This is the class users want to use. - */ - -template -class Vector : private VectorImpl -{ -public: - typedef TYPE value_type; - - /*! - * Constructors and destructors - */ - - Vector(); - Vector(const Vector& rhs); - explicit Vector(const SortedVector& rhs); - virtual ~Vector(); - - /*! copy operator */ - const Vector& operator = (const Vector& rhs) const; - Vector& operator = (const Vector& rhs); - - const Vector& operator = (const SortedVector& rhs) const; - Vector& operator = (const SortedVector& rhs); - - /* - * empty the vector - */ - - inline void clear() { VectorImpl::clear(); } - - /*! - * vector stats - */ - - //! returns number of items in the vector - inline size_t size() const { return VectorImpl::size(); } - //! returns wether or not the vector is empty - inline bool isEmpty() const { return VectorImpl::isEmpty(); } - //! returns how many items can be stored without reallocating the backing store - inline size_t capacity() const { return VectorImpl::capacity(); } - //! setst the capacity. capacity can never be reduced less than size() - inline ssize_t setCapacity(size_t size) { return VectorImpl::setCapacity(size); } - - /*! - * C-style array access - */ - - //! read-only C-style access - inline const TYPE* array() const; - //! read-write C-style access - TYPE* editArray(); - - /*! - * accessors - */ - - //! read-only access to an item at a given index - inline const TYPE& operator [] (size_t index) const; - //! alternate name for operator [] - inline const TYPE& itemAt(size_t index) const; - //! stack-usage of the vector. returns the top of the stack (last element) - const TYPE& top() const; - //! same as operator [], but allows to access the vector backward (from the end) with a negative index - const TYPE& mirrorItemAt(ssize_t index) const; - - /*! - * modifing the array - */ - - //! copy-on write support, grants write access to an item - TYPE& editItemAt(size_t index); - //! grants right acces to the top of the stack (last element) - TYPE& editTop(); - - /*! - * append/insert another vector - */ - - //! insert another vector at a given index - ssize_t insertVectorAt(const Vector& vector, size_t index); - - //! append another vector at the end of this one - ssize_t appendVector(const Vector& vector); - - - //! insert an array at a given index - ssize_t insertArrayAt(const TYPE* array, size_t index, size_t length); - - //! append an array at the end of this vector - ssize_t appendArray(const TYPE* array, size_t length); - - /*! - * add/insert/replace items - */ - - //! insert one or several items initialized with their default constructor - inline ssize_t insertAt(size_t index, size_t numItems = 1); - //! insert one or several items initialized from a prototype item - ssize_t insertAt(const TYPE& prototype_item, size_t index, size_t numItems = 1); - //! pop the top of the stack (removes the last element). No-op if the stack's empty - inline void pop(); - //! pushes an item initialized with its default constructor - inline void push(); - //! pushes an item on the top of the stack - void push(const TYPE& item); - //! same as push() but returns the index the item was added at (or an error) - inline ssize_t add(); - //! same as push() but returns the index the item was added at (or an error) - ssize_t add(const TYPE& item); - //! replace an item with a new one initialized with its default constructor - inline ssize_t replaceAt(size_t index); - //! replace an item with a new one - ssize_t replaceAt(const TYPE& item, size_t index); - - /*! - * remove items - */ - - //! remove several items - inline ssize_t removeItemsAt(size_t index, size_t count = 1); - //! remove one item - inline ssize_t removeAt(size_t index) { return removeItemsAt(index); } - - /*! - * sort (stable) the array - */ - - typedef int (*compar_t)(const TYPE* lhs, const TYPE* rhs); - typedef int (*compar_r_t)(const TYPE* lhs, const TYPE* rhs, void* state); - - inline status_t sort(compar_t cmp); - inline status_t sort(compar_r_t cmp, void* state); - - // for debugging only - inline size_t getItemSize() const { return itemSize(); } - - - /* - * these inlines add some level of compatibility with STL. eventually - * we should probably turn things around. - */ - typedef TYPE* iterator; - typedef TYPE const* const_iterator; - - inline iterator begin() { return editArray(); } - inline iterator end() { return editArray() + size(); } - inline const_iterator begin() const { return array(); } - inline const_iterator end() const { return array() + size(); } - inline void reserve(size_t n) { setCapacity(n); } - inline bool empty() const{ return isEmpty(); } - inline void push_back(const TYPE& item) { insertAt(item, size()); } - inline void push_front(const TYPE& item) { insertAt(item, 0); } - inline iterator erase(iterator pos) { - return begin() + removeItemsAt(pos-array()); - } - -protected: - virtual void do_construct(void* storage, size_t num) const; - virtual void do_destroy(void* storage, size_t num) const; - virtual void do_copy(void* dest, const void* from, size_t num) const; - virtual void do_splat(void* dest, const void* item, size_t num) const; - virtual void do_move_forward(void* dest, const void* from, size_t num) const; - virtual void do_move_backward(void* dest, const void* from, size_t num) const; -}; - - -// --------------------------------------------------------------------------- -// No user serviceable parts from here... -// --------------------------------------------------------------------------- - -template inline -Vector::Vector() - : VectorImpl(sizeof(TYPE), - ((traits::has_trivial_ctor ? HAS_TRIVIAL_CTOR : 0) - |(traits::has_trivial_dtor ? HAS_TRIVIAL_DTOR : 0) - |(traits::has_trivial_copy ? HAS_TRIVIAL_COPY : 0)) - ) -{ -} - -template inline -Vector::Vector(const Vector& rhs) - : VectorImpl(rhs) { -} - -template inline -Vector::Vector(const SortedVector& rhs) - : VectorImpl(static_cast(rhs)) { -} - -template inline -Vector::~Vector() { - finish_vector(); -} - -template inline -Vector& Vector::operator = (const Vector& rhs) { - VectorImpl::operator = (rhs); - return *this; -} - -template inline -const Vector& Vector::operator = (const Vector& rhs) const { - VectorImpl::operator = (static_cast(rhs)); - return *this; -} - -template inline -Vector& Vector::operator = (const SortedVector& rhs) { - VectorImpl::operator = (static_cast(rhs)); - return *this; -} - -template inline -const Vector& Vector::operator = (const SortedVector& rhs) const { - VectorImpl::operator = (rhs); - return *this; -} - -template inline -const TYPE* Vector::array() const { - return static_cast(arrayImpl()); -} - -template inline -TYPE* Vector::editArray() { - return static_cast(editArrayImpl()); -} - - -template inline -const TYPE& Vector::operator[](size_t index) const { - LOG_FATAL_IF( index>=size(), - "itemAt: index %d is past size %d", (int)index, (int)size() ); - return *(array() + index); -} - -template inline -const TYPE& Vector::itemAt(size_t index) const { - return operator[](index); -} - -template inline -const TYPE& Vector::mirrorItemAt(ssize_t index) const { - LOG_FATAL_IF( (index>0 ? index : -index)>=size(), - "mirrorItemAt: index %d is past size %d", - (int)index, (int)size() ); - return *(array() + ((index<0) ? (size()-index) : index)); -} - -template inline -const TYPE& Vector::top() const { - return *(array() + size() - 1); -} - -template inline -TYPE& Vector::editItemAt(size_t index) { - return *( static_cast(editItemLocation(index)) ); -} - -template inline -TYPE& Vector::editTop() { - return *( static_cast(editItemLocation(size()-1)) ); -} - -template inline -ssize_t Vector::insertVectorAt(const Vector& vector, size_t index) { - return VectorImpl::insertVectorAt(reinterpret_cast(vector), index); -} - -template inline -ssize_t Vector::appendVector(const Vector& vector) { - return VectorImpl::appendVector(reinterpret_cast(vector)); -} - -template inline -ssize_t Vector::insertArrayAt(const TYPE* array, size_t index, size_t length) { - return VectorImpl::insertArrayAt(array, index, length); -} - -template inline -ssize_t Vector::appendArray(const TYPE* array, size_t length) { - return VectorImpl::appendArray(array, length); -} - -template inline -ssize_t Vector::insertAt(const TYPE& item, size_t index, size_t numItems) { - return VectorImpl::insertAt(&item, index, numItems); -} - -template inline -void Vector::push(const TYPE& item) { - return VectorImpl::push(&item); -} - -template inline -ssize_t Vector::add(const TYPE& item) { - return VectorImpl::add(&item); -} - -template inline -ssize_t Vector::replaceAt(const TYPE& item, size_t index) { - return VectorImpl::replaceAt(&item, index); -} - -template inline -ssize_t Vector::insertAt(size_t index, size_t numItems) { - return VectorImpl::insertAt(index, numItems); -} - -template inline -void Vector::pop() { - VectorImpl::pop(); -} - -template inline -void Vector::push() { - VectorImpl::push(); -} - -template inline -ssize_t Vector::add() { - return VectorImpl::add(); -} - -template inline -ssize_t Vector::replaceAt(size_t index) { - return VectorImpl::replaceAt(index); -} - -template inline -ssize_t Vector::removeItemsAt(size_t index, size_t count) { - return VectorImpl::removeItemsAt(index, count); -} - -template inline -status_t Vector::sort(Vector::compar_t cmp) { - return VectorImpl::sort((VectorImpl::compar_t)cmp); -} - -template inline -status_t Vector::sort(Vector::compar_r_t cmp, void* state) { - return VectorImpl::sort((VectorImpl::compar_r_t)cmp, state); -} - -// --------------------------------------------------------------------------- - -template -void Vector::do_construct(void* storage, size_t num) const { - construct_type( reinterpret_cast(storage), num ); -} - -template -void Vector::do_destroy(void* storage, size_t num) const { - destroy_type( reinterpret_cast(storage), num ); -} - -template -void Vector::do_copy(void* dest, const void* from, size_t num) const { - copy_type( reinterpret_cast(dest), reinterpret_cast(from), num ); -} - -template -void Vector::do_splat(void* dest, const void* item, size_t num) const { - splat_type( reinterpret_cast(dest), reinterpret_cast(item), num ); -} - -template -void Vector::do_move_forward(void* dest, const void* from, size_t num) const { - move_forward_type( reinterpret_cast(dest), reinterpret_cast(from), num ); -} - -template -void Vector::do_move_backward(void* dest, const void* from, size_t num) const { - move_backward_type( reinterpret_cast(dest), reinterpret_cast(from), num ); -} - -}; // namespace android - - -// --------------------------------------------------------------------------- - -#endif // ANDROID_VECTOR_H diff --git a/external/android/include/14/frameworks/base/include/utils/VectorImpl.h b/external/android/include/14/frameworks/base/include/utils/VectorImpl.h deleted file mode 100644 index c4ec2ff..0000000 --- a/external/android/include/14/frameworks/base/include/utils/VectorImpl.h +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright (C) 2005 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_VECTOR_IMPL_H -#define ANDROID_VECTOR_IMPL_H - -#include -#include -#include -#include - -// --------------------------------------------------------------------------- -// No user serviceable parts in here... -// --------------------------------------------------------------------------- - -namespace android { - -/*! - * Implementation of the guts of the vector<> class - * this ensures backward binary compatibility and - * reduces code size. - * For performance reasons, we expose mStorage and mCount - * so these fields are set in stone. - * - */ - -class VectorImpl -{ -public: - enum { // flags passed to the ctor - HAS_TRIVIAL_CTOR = 0x00000001, - HAS_TRIVIAL_DTOR = 0x00000002, - HAS_TRIVIAL_COPY = 0x00000004, - }; - - VectorImpl(size_t itemSize, uint32_t flags); - VectorImpl(const VectorImpl& rhs); - virtual ~VectorImpl(); - - /*! must be called from subclasses destructor */ - void finish_vector(); - - VectorImpl& operator = (const VectorImpl& rhs); - - /*! C-style array access */ - inline const void* arrayImpl() const { return mStorage; } - void* editArrayImpl(); - - /*! vector stats */ - inline size_t size() const { return mCount; } - inline bool isEmpty() const { return mCount == 0; } - size_t capacity() const; - ssize_t setCapacity(size_t size); - - /*! append/insert another vector or array */ - ssize_t insertVectorAt(const VectorImpl& vector, size_t index); - ssize_t appendVector(const VectorImpl& vector); - ssize_t insertArrayAt(const void* array, size_t index, size_t length); - ssize_t appendArray(const void* array, size_t length); - - /*! add/insert/replace items */ - ssize_t insertAt(size_t where, size_t numItems = 1); - ssize_t insertAt(const void* item, size_t where, size_t numItems = 1); - void pop(); - void push(); - void push(const void* item); - ssize_t add(); - ssize_t add(const void* item); - ssize_t replaceAt(size_t index); - ssize_t replaceAt(const void* item, size_t index); - - /*! remove items */ - ssize_t removeItemsAt(size_t index, size_t count = 1); - void clear(); - - const void* itemLocation(size_t index) const; - void* editItemLocation(size_t index); - - typedef int (*compar_t)(const void* lhs, const void* rhs); - typedef int (*compar_r_t)(const void* lhs, const void* rhs, void* state); - status_t sort(compar_t cmp); - status_t sort(compar_r_t cmp, void* state); - -protected: - size_t itemSize() const; - void release_storage(); - - virtual void do_construct(void* storage, size_t num) const = 0; - virtual void do_destroy(void* storage, size_t num) const = 0; - virtual void do_copy(void* dest, const void* from, size_t num) const = 0; - virtual void do_splat(void* dest, const void* item, size_t num) const = 0; - virtual void do_move_forward(void* dest, const void* from, size_t num) const = 0; - virtual void do_move_backward(void* dest, const void* from, size_t num) const = 0; - - // take care of FBC... - virtual void reservedVectorImpl1(); - virtual void reservedVectorImpl2(); - virtual void reservedVectorImpl3(); - virtual void reservedVectorImpl4(); - virtual void reservedVectorImpl5(); - virtual void reservedVectorImpl6(); - virtual void reservedVectorImpl7(); - virtual void reservedVectorImpl8(); - -private: - void* _grow(size_t where, size_t amount); - void _shrink(size_t where, size_t amount); - - inline void _do_construct(void* storage, size_t num) const; - inline void _do_destroy(void* storage, size_t num) const; - inline void _do_copy(void* dest, const void* from, size_t num) const; - inline void _do_splat(void* dest, const void* item, size_t num) const; - inline void _do_move_forward(void* dest, const void* from, size_t num) const; - inline void _do_move_backward(void* dest, const void* from, size_t num) const; - - // These 2 fields are exposed in the inlines below, - // so they're set in stone. - void * mStorage; // base address of the vector - size_t mCount; // number of items - - const uint32_t mFlags; - const size_t mItemSize; -}; - - - -class SortedVectorImpl : public VectorImpl -{ -public: - SortedVectorImpl(size_t itemSize, uint32_t flags); - SortedVectorImpl(const VectorImpl& rhs); - virtual ~SortedVectorImpl(); - - SortedVectorImpl& operator = (const SortedVectorImpl& rhs); - - //! finds the index of an item - ssize_t indexOf(const void* item) const; - - //! finds where this item should be inserted - size_t orderOf(const void* item) const; - - //! add an item in the right place (or replaces it if there is one) - ssize_t add(const void* item); - - //! merges a vector into this one - ssize_t merge(const VectorImpl& vector); - ssize_t merge(const SortedVectorImpl& vector); - - //! removes an item - ssize_t remove(const void* item); - -protected: - virtual int do_compare(const void* lhs, const void* rhs) const = 0; - - // take care of FBC... - virtual void reservedSortedVectorImpl1(); - virtual void reservedSortedVectorImpl2(); - virtual void reservedSortedVectorImpl3(); - virtual void reservedSortedVectorImpl4(); - virtual void reservedSortedVectorImpl5(); - virtual void reservedSortedVectorImpl6(); - virtual void reservedSortedVectorImpl7(); - virtual void reservedSortedVectorImpl8(); - -private: - ssize_t _indexOrderOf(const void* item, size_t* order = 0) const; - - // these are made private, because they can't be used on a SortedVector - // (they don't have an implementation either) - ssize_t add(); - void pop(); - void push(); - void push(const void* item); - ssize_t insertVectorAt(const VectorImpl& vector, size_t index); - ssize_t appendVector(const VectorImpl& vector); - ssize_t insertArrayAt(const void* array, size_t index, size_t length); - ssize_t appendArray(const void* array, size_t length); - ssize_t insertAt(size_t where, size_t numItems = 1); - ssize_t insertAt(const void* item, size_t where, size_t numItems = 1); - ssize_t replaceAt(size_t index); - ssize_t replaceAt(const void* item, size_t index); -}; - -}; // namespace android - - -// --------------------------------------------------------------------------- - -#endif // ANDROID_VECTOR_IMPL_H diff --git a/external/android/include/14/frameworks/base/include/utils/ZipFileCRO.h b/external/android/include/14/frameworks/base/include/utils/ZipFileCRO.h deleted file mode 100644 index 3e42a95..0000000 --- a/external/android/include/14/frameworks/base/include/utils/ZipFileCRO.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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. - */ - -// -// C API for ead-only access to Zip archives, with minimal heap allocation. -// -#ifndef __LIBS_ZIPFILECRO_H -#define __LIBS_ZIPFILECRO_H - -#include -#include -#include - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Trivial typedef to ensure that ZipFileCRO is not treated as a simple integer. - */ -typedef void* ZipFileCRO; - -/* - * Trivial typedef to ensure that ZipEntryCRO is not treated as a simple - * integer. We use NULL to indicate an invalid value. - */ -typedef void* ZipEntryCRO; - -extern ZipFileCRO ZipFileXRO_open(const char* path); - -extern void ZipFileCRO_destroy(ZipFileCRO zip); - -extern ZipEntryCRO ZipFileCRO_findEntryByName(ZipFileCRO zip, - const char* fileName); - -extern bool ZipFileCRO_getEntryInfo(ZipFileCRO zip, ZipEntryCRO entry, - int* pMethod, size_t* pUncompLen, - size_t* pCompLen, off64_t* pOffset, long* pModWhen, long* pCrc32); - -extern bool ZipFileCRO_uncompressEntry(ZipFileCRO zip, ZipEntryCRO entry, int fd); - -#ifdef __cplusplus -} -#endif - -#endif /*__LIBS_ZIPFILECRO_H*/ diff --git a/external/android/include/14/frameworks/base/include/utils/ZipFileRO.h b/external/android/include/14/frameworks/base/include/utils/ZipFileRO.h deleted file mode 100644 index 547e36a..0000000 --- a/external/android/include/14/frameworks/base/include/utils/ZipFileRO.h +++ /dev/null @@ -1,262 +0,0 @@ -/* - * 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. - */ - -/* - * Read-only access to Zip archives, with minimal heap allocation. - * - * This is similar to the more-complete ZipFile class, but no attempt - * has been made to make them interchangeable. This class operates under - * a very different set of assumptions and constraints. - * - * One such assumption is that if you're getting file descriptors for - * use with this class as a child of a fork() operation, you must be on - * a pread() to guarantee correct operation. This is because pread() can - * atomically read at a file offset without worrying about a lock around an - * lseek() + read() pair. - */ -#ifndef __LIBS_ZIPFILERO_H -#define __LIBS_ZIPFILERO_H - -#include -#include -#include -#include - -#include -#include -#include -#include - -namespace android { - -/* - * Trivial typedef to ensure that ZipEntryRO is not treated as a simple - * integer. We use NULL to indicate an invalid value. - */ -typedef void* ZipEntryRO; - -/* - * Open a Zip archive for reading. - * - * We want "open" and "find entry by name" to be fast operations, and we - * want to use as little memory as possible. We memory-map the file, - * and load a hash table with pointers to the filenames (which aren't - * null-terminated). The other fields are at a fixed offset from the - * filename, so we don't need to extract those (but we do need to byte-read - * and endian-swap them every time we want them). - * - * To speed comparisons when doing a lookup by name, we could make the mapping - * "private" (copy-on-write) and null-terminate the filenames after verifying - * the record structure. However, this requires a private mapping of - * every page that the Central Directory touches. Easier to tuck a copy - * of the string length into the hash table entry. - * - * NOTE: If this is used on file descriptors inherited from a fork() operation, - * you must be on a platform that implements pread() to guarantee correctness - * on the shared file descriptors. - */ -class ZipFileRO { -public: - ZipFileRO() - : mFd(-1), mFileName(NULL), mFileLength(-1), - mDirectoryMap(NULL), - mNumEntries(-1), mDirectoryOffset(-1), - mHashTableSize(-1), mHashTable(NULL) - {} - - ~ZipFileRO(); - - /* - * Open an archive. - */ - status_t open(const char* zipFileName); - - /* - * Find an entry, by name. Returns the entry identifier, or NULL if - * not found. - * - * If two entries have the same name, one will be chosen at semi-random. - */ - ZipEntryRO findEntryByName(const char* fileName) const; - - /* - * Return the #of entries in the Zip archive. - */ - int getNumEntries(void) const { - return mNumEntries; - } - - /* - * Return the Nth entry. Zip file entries are not stored in sorted - * order, and updated entries may appear at the end, so anyone walking - * the archive needs to avoid making ordering assumptions. We take - * that further by returning the Nth non-empty entry in the hash table - * rather than the Nth entry in the archive. - * - * Valid values are [0..numEntries). - * - * [This is currently O(n). If it needs to be fast we can allocate an - * additional data structure or provide an iterator interface.] - */ - ZipEntryRO findEntryByIndex(int idx) const; - - /* - * Copy the filename into the supplied buffer. Returns 0 on success, - * -1 if "entry" is invalid, or the filename length if it didn't fit. The - * length, and the returned string, include the null-termination. - */ - int getEntryFileName(ZipEntryRO entry, char* buffer, int bufLen) const; - - /* - * Get the vital stats for an entry. Pass in NULL pointers for anything - * you don't need. - * - * "*pOffset" holds the Zip file offset of the entry's data. - * - * Returns "false" if "entry" is bogus or if the data in the Zip file - * appears to be bad. - */ - bool getEntryInfo(ZipEntryRO entry, int* pMethod, size_t* pUncompLen, - size_t* pCompLen, off64_t* pOffset, long* pModWhen, long* pCrc32) const; - - /* - * Create a new FileMap object that maps a subset of the archive. For - * an uncompressed entry this effectively provides a pointer to the - * actual data, for a compressed entry this provides the input buffer - * for inflate(). - */ - FileMap* createEntryFileMap(ZipEntryRO entry) const; - - /* - * Uncompress the data into a buffer. Depending on the compression - * format, this is either an "inflate" operation or a memcpy. - * - * Use "uncompLen" from getEntryInfo() to determine the required - * buffer size. - * - * Returns "true" on success. - */ - bool uncompressEntry(ZipEntryRO entry, void* buffer) const; - - /* - * Uncompress the data to an open file descriptor. - */ - bool uncompressEntry(ZipEntryRO entry, int fd) const; - - /* Zip compression methods we support */ - enum { - kCompressStored = 0, // no compression - kCompressDeflated = 8, // standard deflate - }; - - /* - * Utility function: uncompress deflated data, buffer to buffer. - */ - static bool inflateBuffer(void* outBuf, const void* inBuf, - size_t uncompLen, size_t compLen); - - /* - * Utility function: uncompress deflated data, buffer to fd. - */ - static bool inflateBuffer(int fd, const void* inBuf, - size_t uncompLen, size_t compLen); - - /* - * Utility function to convert ZIP's time format to a timespec struct. - */ - static inline void zipTimeToTimespec(long when, struct tm* timespec) { - const long date = when >> 16; - timespec->tm_year = ((date >> 9) & 0x7F) + 80; // Zip is years since 1980 - timespec->tm_mon = (date >> 5) & 0x0F; - timespec->tm_mday = date & 0x1F; - - timespec->tm_hour = (when >> 11) & 0x1F; - timespec->tm_min = (when >> 5) & 0x3F; - timespec->tm_sec = (when & 0x1F) << 1; - } - - /* - * Some basic functions for raw data manipulation. "LE" means - * Little Endian. - */ - static inline unsigned short get2LE(const unsigned char* buf) { - return buf[0] | (buf[1] << 8); - } - static inline unsigned long get4LE(const unsigned char* buf) { - return buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24); - } - -private: - /* these are private and not defined */ - ZipFileRO(const ZipFileRO& src); - ZipFileRO& operator=(const ZipFileRO& src); - - /* locate and parse the central directory */ - bool mapCentralDirectory(void); - - /* parse the archive, prepping internal structures */ - bool parseZipArchive(void); - - /* add a new entry to the hash table */ - void addToHash(const char* str, int strLen, unsigned int hash); - - /* compute string hash code */ - static unsigned int computeHash(const char* str, int len); - - /* convert a ZipEntryRO back to a hash table index */ - int entryToIndex(const ZipEntryRO entry) const; - - /* - * One entry in the hash table. - */ - typedef struct HashEntry { - const char* name; - unsigned short nameLen; - //unsigned int hash; - } HashEntry; - - /* open Zip archive */ - int mFd; - - /* Lock for handling the file descriptor (seeks, etc) */ - mutable Mutex mFdLock; - - /* zip file name */ - char* mFileName; - - /* length of file */ - size_t mFileLength; - - /* mapped file */ - FileMap* mDirectoryMap; - - /* number of entries in the Zip archive */ - int mNumEntries; - - /* CD directory offset in the Zip archive */ - off64_t mDirectoryOffset; - - /* - * We know how many entries are in the Zip archive, so we have a - * fixed-size hash table. We probe for an empty slot. - */ - int mHashTableSize; - HashEntry* mHashTable; -}; - -}; // namespace android - -#endif /*__LIBS_ZIPFILERO_H*/ diff --git a/external/android/include/14/frameworks/base/include/utils/ZipUtils.h b/external/android/include/14/frameworks/base/include/utils/ZipUtils.h deleted file mode 100644 index 42c42b6..0000000 --- a/external/android/include/14/frameworks/base/include/utils/ZipUtils.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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. - */ - -// -// Miscellaneous zip/gzip utility functions. -// -#ifndef __LIBS_ZIPUTILS_H -#define __LIBS_ZIPUTILS_H - -#include - -namespace android { - -/* - * Container class for utility functions, primarily for namespace reasons. - */ -class ZipUtils { -public: - /* - * General utility function for uncompressing "deflate" data from a file - * to a buffer. - */ - static bool inflateToBuffer(int fd, void* buf, long uncompressedLen, - long compressedLen); - static bool inflateToBuffer(FILE* fp, void* buf, long uncompressedLen, - long compressedLen); - - /* - * Someday we might want to make this generic and handle bzip2 ".bz2" - * files too. - * - * We could declare gzip to be a sub-class of zip that has exactly - * one always-compressed entry, but we currently want to treat Zip - * and gzip as distinct, so there's no value. - * - * The zlib library has some gzip utilities, but it has no interface - * for extracting the uncompressed length of the file (you do *not* - * want to gzseek to the end). - * - * Pass in a seeked file pointer for the gzip file. If this is a gzip - * file, we set our return values appropriately and return "true" with - * the file seeked to the start of the compressed data. - */ - static bool examineGzip(FILE* fp, int* pCompressionMethod, - long* pUncompressedLen, long* pCompressedLen, unsigned long* pCRC32); - -private: - ZipUtils() {} - ~ZipUtils() {} -}; - -}; // namespace android - -#endif /*__LIBS_ZIPUTILS_H*/ diff --git a/external/android/include/14/frameworks/base/include/utils/ashmem.h b/external/android/include/14/frameworks/base/include/utils/ashmem.h deleted file mode 100644 index 0854775..0000000 --- a/external/android/include/14/frameworks/base/include/utils/ashmem.h +++ /dev/null @@ -1,41 +0,0 @@ -/* utils/ashmem.h - ** - ** Copyright 2008 The Android Open Source Project - ** - ** This file is dual licensed. It may be redistributed and/or modified - ** under the terms of the Apache 2.0 License OR version 2 of the GNU - ** General Public License. - */ - -#ifndef _UTILS_ASHMEM_H -#define _UTILS_ASHMEM_H - -#include -#include - -#define ASHMEM_NAME_LEN 256 - -#define ASHMEM_NAME_DEF "dev/ashmem" - -/* Return values from ASHMEM_PIN: Was the mapping purged while unpinned? */ -#define ASHMEM_NOT_REAPED 0 -#define ASHMEM_WAS_REAPED 1 - -/* Return values from ASHMEM_UNPIN: Is the mapping now pinned or unpinned? */ -#define ASHMEM_NOW_UNPINNED 0 -#define ASHMEM_NOW_PINNED 1 - -#define __ASHMEMIOC 0x77 - -#define ASHMEM_SET_NAME _IOW(__ASHMEMIOC, 1, char[ASHMEM_NAME_LEN]) -#define ASHMEM_GET_NAME _IOR(__ASHMEMIOC, 2, char[ASHMEM_NAME_LEN]) -#define ASHMEM_SET_SIZE _IOW(__ASHMEMIOC, 3, size_t) -#define ASHMEM_GET_SIZE _IO(__ASHMEMIOC, 4) -#define ASHMEM_SET_PROT_MASK _IOW(__ASHMEMIOC, 5, unsigned long) -#define ASHMEM_GET_PROT_MASK _IO(__ASHMEMIOC, 6) -#define ASHMEM_PIN _IO(__ASHMEMIOC, 7) -#define ASHMEM_UNPIN _IO(__ASHMEMIOC, 8) -#define ASHMEM_ISPINNED _IO(__ASHMEMIOC, 9) -#define ASHMEM_PURGE_ALL_CACHES _IO(__ASHMEMIOC, 10) - -#endif /* _UTILS_ASHMEM_H */ diff --git a/external/android/include/14/frameworks/base/include/utils/misc.h b/external/android/include/14/frameworks/base/include/utils/misc.h deleted file mode 100644 index 23f2a4c..0000000 --- a/external/android/include/14/frameworks/base/include/utils/misc.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// Handy utility functions and portability code. -// -#ifndef _LIBS_UTILS_MISC_H -#define _LIBS_UTILS_MISC_H - -#include -#include - -namespace android { - -/* get #of elements in a static array */ -#ifndef NELEM -# define NELEM(x) ((int) (sizeof(x) / sizeof((x)[0]))) -#endif - -/* - * Make a copy of the string, using "new[]" instead of "malloc". Free the - * string with delete[]. - * - * Returns NULL if "str" is NULL. - */ -char* strdupNew(const char* str); - -/* - * Concatenate an argument vector into a single string. If argc is >= 0 - * it will be used; if it's < 0 then the last element in the arg vector - * must be NULL. - * - * This inserts a space between each argument. - * - * This does not automatically add double quotes around arguments with - * spaces in them. This practice is necessary for Win32, because Win32's - * CreateProcess call is stupid. - * - * The caller should delete[] the returned string. - */ -char* concatArgv(int argc, const char* const argv[]); - -/* - * Count up the number of arguments in "argv". The count does not include - * the final NULL entry. - */ -int countArgv(const char* const argv[]); - -/* - * Some utility functions for working with files. These could be made - * part of a "File" class. - */ -typedef enum FileType { - kFileTypeUnknown = 0, - kFileTypeNonexistent, // i.e. ENOENT - kFileTypeRegular, - kFileTypeDirectory, - kFileTypeCharDev, - kFileTypeBlockDev, - kFileTypeFifo, - kFileTypeSymlink, - kFileTypeSocket, -} FileType; -/* get the file's type; follows symlinks */ -FileType getFileType(const char* fileName); -/* get the file's modification date; returns -1 w/errno set on failure */ -time_t getFileModDate(const char* fileName); - -/* - * Round up to the nearest power of 2. Handy for hash tables. - */ -unsigned int roundUpPower2(unsigned int val); - -void strreverse(char* begin, char* end); -void k_itoa(int value, char* str, int base); -char* itoa(int val, int base); - -}; // namespace android - -#endif // _LIBS_UTILS_MISC_H diff --git a/external/android/include/14/frameworks/base/include/utils/threads.h b/external/android/include/14/frameworks/base/include/utils/threads.h deleted file mode 100644 index ab3e8cd..0000000 --- a/external/android/include/14/frameworks/base/include/utils/threads.h +++ /dev/null @@ -1,564 +0,0 @@ -/* - * 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 _LIBS_UTILS_THREADS_H -#define _LIBS_UTILS_THREADS_H - -#include -#include -#include -#include - -#if defined(HAVE_PTHREADS) -# include -#endif - -// ------------------------------------------------------------------ -// C API - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void* android_thread_id_t; - -typedef int (*android_thread_func_t)(void*); - -enum { - /* - * *********************************************** - * ** Keep in sync with android.os.Process.java ** - * *********************************************** - * - * This maps directly to the "nice" priorities we use in Android. - * A thread priority should be chosen inverse-proportionally to - * the amount of work the thread is expected to do. The more work - * a thread will do, the less favorable priority it should get so that - * it doesn't starve the system. Threads not behaving properly might - * be "punished" by the kernel. - * Use the levels below when appropriate. Intermediate values are - * acceptable, preferably use the {MORE|LESS}_FAVORABLE constants below. - */ - ANDROID_PRIORITY_LOWEST = 19, - - /* use for background tasks */ - ANDROID_PRIORITY_BACKGROUND = 10, - - /* most threads run at normal priority */ - ANDROID_PRIORITY_NORMAL = 0, - - /* threads currently running a UI that the user is interacting with */ - ANDROID_PRIORITY_FOREGROUND = -2, - - /* the main UI thread has a slightly more favorable priority */ - ANDROID_PRIORITY_DISPLAY = -4, - - /* ui service treads might want to run at a urgent display (uncommon) */ - ANDROID_PRIORITY_URGENT_DISPLAY = HAL_PRIORITY_URGENT_DISPLAY, - - /* all normal audio threads */ - ANDROID_PRIORITY_AUDIO = -16, - - /* service audio threads (uncommon) */ - ANDROID_PRIORITY_URGENT_AUDIO = -19, - - /* should never be used in practice. regular process might not - * be allowed to use this level */ - ANDROID_PRIORITY_HIGHEST = -20, - - ANDROID_PRIORITY_DEFAULT = ANDROID_PRIORITY_NORMAL, - ANDROID_PRIORITY_MORE_FAVORABLE = -1, - ANDROID_PRIORITY_LESS_FAVORABLE = +1, -}; - -enum { - ANDROID_TGROUP_DEFAULT = 0, - ANDROID_TGROUP_BG_NONINTERACT = 1, - ANDROID_TGROUP_FG_BOOST = 2, - ANDROID_TGROUP_MAX = ANDROID_TGROUP_FG_BOOST, -}; - -// Create and run a new thread. -extern int androidCreateThread(android_thread_func_t, void *); - -// Create thread with lots of parameters -extern int androidCreateThreadEtc(android_thread_func_t entryFunction, - void *userData, - const char* threadName, - int32_t threadPriority, - size_t threadStackSize, - android_thread_id_t *threadId); - -// Get some sort of unique identifier for the current thread. -extern android_thread_id_t androidGetThreadId(); - -// Low-level thread creation -- never creates threads that can -// interact with the Java VM. -extern int androidCreateRawThreadEtc(android_thread_func_t entryFunction, - void *userData, - const char* threadName, - int32_t threadPriority, - size_t threadStackSize, - android_thread_id_t *threadId); - -// Used by the Java Runtime to control how threads are created, so that -// they can be proper and lovely Java threads. -typedef int (*android_create_thread_fn)(android_thread_func_t entryFunction, - void *userData, - const char* threadName, - int32_t threadPriority, - size_t threadStackSize, - android_thread_id_t *threadId); - -extern void androidSetCreateThreadFunc(android_create_thread_fn func); - -// ------------------------------------------------------------------ -// Extra functions working with raw pids. - -// Get pid for the current thread. -extern pid_t androidGetTid(); - -// Change the scheduling group of a particular thread. The group -// should be one of the ANDROID_TGROUP constants. Returns BAD_VALUE if -// grp is out of range, else another non-zero value with errno set if -// the operation failed. Thread ID zero means current thread. -extern int androidSetThreadSchedulingGroup(pid_t tid, int grp); - -// Change the priority AND scheduling group of a particular thread. The priority -// should be one of the ANDROID_PRIORITY constants. Returns INVALID_OPERATION -// if the priority set failed, else another value if just the group set failed; -// in either case errno is set. Thread ID zero means current thread. -extern int androidSetThreadPriority(pid_t tid, int prio); - -// Get the current priority of a particular thread. Returns one of the -// ANDROID_PRIORITY constants or a negative result in case of error. -extern int androidGetThreadPriority(pid_t tid); - -// Get the current scheduling group of a particular thread. Normally returns -// one of the ANDROID_TGROUP constants other than ANDROID_TGROUP_DEFAULT. -// Returns ANDROID_TGROUP_DEFAULT if no pthread support (e.g. on host) or if -// scheduling groups are disabled. Returns INVALID_OPERATION if unexpected error. -// Thread ID zero means current thread. -extern int androidGetThreadSchedulingGroup(pid_t tid); - -#ifdef __cplusplus -} -#endif - -// ------------------------------------------------------------------ -// C++ API - -#ifdef __cplusplus - -#include -#include -#include - -namespace android { - -typedef android_thread_id_t thread_id_t; - -typedef android_thread_func_t thread_func_t; - -enum { - PRIORITY_LOWEST = ANDROID_PRIORITY_LOWEST, - PRIORITY_BACKGROUND = ANDROID_PRIORITY_BACKGROUND, - PRIORITY_NORMAL = ANDROID_PRIORITY_NORMAL, - PRIORITY_FOREGROUND = ANDROID_PRIORITY_FOREGROUND, - PRIORITY_DISPLAY = ANDROID_PRIORITY_DISPLAY, - PRIORITY_URGENT_DISPLAY = ANDROID_PRIORITY_URGENT_DISPLAY, - PRIORITY_AUDIO = ANDROID_PRIORITY_AUDIO, - PRIORITY_URGENT_AUDIO = ANDROID_PRIORITY_URGENT_AUDIO, - PRIORITY_HIGHEST = ANDROID_PRIORITY_HIGHEST, - PRIORITY_DEFAULT = ANDROID_PRIORITY_DEFAULT, - PRIORITY_MORE_FAVORABLE = ANDROID_PRIORITY_MORE_FAVORABLE, - PRIORITY_LESS_FAVORABLE = ANDROID_PRIORITY_LESS_FAVORABLE, -}; - -// Create and run a new thread. -inline bool createThread(thread_func_t f, void *a) { - return androidCreateThread(f, a) ? true : false; -} - -// Create thread with lots of parameters -inline bool createThreadEtc(thread_func_t entryFunction, - void *userData, - const char* threadName = "android:unnamed_thread", - int32_t threadPriority = PRIORITY_DEFAULT, - size_t threadStackSize = 0, - thread_id_t *threadId = 0) -{ - return androidCreateThreadEtc(entryFunction, userData, threadName, - threadPriority, threadStackSize, threadId) ? true : false; -} - -// Get some sort of unique identifier for the current thread. -inline thread_id_t getThreadId() { - return androidGetThreadId(); -} - -/*****************************************************************************/ - -/* - * Simple mutex class. The implementation is system-dependent. - * - * The mutex must be unlocked by the thread that locked it. They are not - * recursive, i.e. the same thread can't lock it multiple times. - */ -class Mutex { -public: - enum { - PRIVATE = 0, - SHARED = 1 - }; - - Mutex(); - Mutex(const char* name); - Mutex(int type, const char* name = NULL); - ~Mutex(); - - // lock or unlock the mutex - status_t lock(); - void unlock(); - - // lock if possible; returns 0 on success, error otherwise - status_t tryLock(); - - // Manages the mutex automatically. It'll be locked when Autolock is - // constructed and released when Autolock goes out of scope. - class Autolock { - public: - inline Autolock(Mutex& mutex) : mLock(mutex) { mLock.lock(); } - inline Autolock(Mutex* mutex) : mLock(*mutex) { mLock.lock(); } - inline ~Autolock() { mLock.unlock(); } - private: - Mutex& mLock; - }; - -private: - friend class Condition; - - // A mutex cannot be copied - Mutex(const Mutex&); - Mutex& operator = (const Mutex&); - -#if defined(HAVE_PTHREADS) - pthread_mutex_t mMutex; -#else - void _init(); - void* mState; -#endif -}; - -#if defined(HAVE_PTHREADS) - -inline Mutex::Mutex() { - pthread_mutex_init(&mMutex, NULL); -} -inline Mutex::Mutex(const char* name) { - pthread_mutex_init(&mMutex, NULL); -} -inline Mutex::Mutex(int type, const char* name) { - if (type == SHARED) { - pthread_mutexattr_t attr; - pthread_mutexattr_init(&attr); - pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED); - pthread_mutex_init(&mMutex, &attr); - pthread_mutexattr_destroy(&attr); - } else { - pthread_mutex_init(&mMutex, NULL); - } -} -inline Mutex::~Mutex() { - pthread_mutex_destroy(&mMutex); -} -inline status_t Mutex::lock() { - return -pthread_mutex_lock(&mMutex); -} -inline void Mutex::unlock() { - pthread_mutex_unlock(&mMutex); -} -inline status_t Mutex::tryLock() { - return -pthread_mutex_trylock(&mMutex); -} - -#endif // HAVE_PTHREADS - -/* - * Automatic mutex. Declare one of these at the top of a function. - * When the function returns, it will go out of scope, and release the - * mutex. - */ - -typedef Mutex::Autolock AutoMutex; - -/*****************************************************************************/ - -#if defined(HAVE_PTHREADS) - -/* - * Simple mutex class. The implementation is system-dependent. - * - * The mutex must be unlocked by the thread that locked it. They are not - * recursive, i.e. the same thread can't lock it multiple times. - */ -class RWLock { -public: - enum { - PRIVATE = 0, - SHARED = 1 - }; - - RWLock(); - RWLock(const char* name); - RWLock(int type, const char* name = NULL); - ~RWLock(); - - status_t readLock(); - status_t tryReadLock(); - status_t writeLock(); - status_t tryWriteLock(); - void unlock(); - - class AutoRLock { - public: - inline AutoRLock(RWLock& rwlock) : mLock(rwlock) { mLock.readLock(); } - inline ~AutoRLock() { mLock.unlock(); } - private: - RWLock& mLock; - }; - - class AutoWLock { - public: - inline AutoWLock(RWLock& rwlock) : mLock(rwlock) { mLock.writeLock(); } - inline ~AutoWLock() { mLock.unlock(); } - private: - RWLock& mLock; - }; - -private: - // A RWLock cannot be copied - RWLock(const RWLock&); - RWLock& operator = (const RWLock&); - - pthread_rwlock_t mRWLock; -}; - -inline RWLock::RWLock() { - pthread_rwlock_init(&mRWLock, NULL); -} -inline RWLock::RWLock(const char* name) { - pthread_rwlock_init(&mRWLock, NULL); -} -inline RWLock::RWLock(int type, const char* name) { - if (type == SHARED) { - pthread_rwlockattr_t attr; - pthread_rwlockattr_init(&attr); - pthread_rwlockattr_setpshared(&attr, PTHREAD_PROCESS_SHARED); - pthread_rwlock_init(&mRWLock, &attr); - pthread_rwlockattr_destroy(&attr); - } else { - pthread_rwlock_init(&mRWLock, NULL); - } -} -inline RWLock::~RWLock() { - pthread_rwlock_destroy(&mRWLock); -} -inline status_t RWLock::readLock() { - return -pthread_rwlock_rdlock(&mRWLock); -} -inline status_t RWLock::tryReadLock() { - return -pthread_rwlock_tryrdlock(&mRWLock); -} -inline status_t RWLock::writeLock() { - return -pthread_rwlock_wrlock(&mRWLock); -} -inline status_t RWLock::tryWriteLock() { - return -pthread_rwlock_trywrlock(&mRWLock); -} -inline void RWLock::unlock() { - pthread_rwlock_unlock(&mRWLock); -} - -#endif // HAVE_PTHREADS - -/*****************************************************************************/ - -/* - * Condition variable class. The implementation is system-dependent. - * - * Condition variables are paired up with mutexes. Lock the mutex, - * call wait(), then either re-wait() if things aren't quite what you want, - * or unlock the mutex and continue. All threads calling wait() must - * use the same mutex for a given Condition. - */ -class Condition { -public: - enum { - PRIVATE = 0, - SHARED = 1 - }; - - Condition(); - Condition(int type); - ~Condition(); - // Wait on the condition variable. Lock the mutex before calling. - status_t wait(Mutex& mutex); - // same with relative timeout - status_t waitRelative(Mutex& mutex, nsecs_t reltime); - // Signal the condition variable, allowing one thread to continue. - void signal(); - // Signal the condition variable, allowing all threads to continue. - void broadcast(); - -private: -#if defined(HAVE_PTHREADS) - pthread_cond_t mCond; -#else - void* mState; -#endif -}; - -#if defined(HAVE_PTHREADS) - -inline Condition::Condition() { - pthread_cond_init(&mCond, NULL); -} -inline Condition::Condition(int type) { - if (type == SHARED) { - pthread_condattr_t attr; - pthread_condattr_init(&attr); - pthread_condattr_setpshared(&attr, PTHREAD_PROCESS_SHARED); - pthread_cond_init(&mCond, &attr); - pthread_condattr_destroy(&attr); - } else { - pthread_cond_init(&mCond, NULL); - } -} -inline Condition::~Condition() { - pthread_cond_destroy(&mCond); -} -inline status_t Condition::wait(Mutex& mutex) { - return -pthread_cond_wait(&mCond, &mutex.mMutex); -} -inline status_t Condition::waitRelative(Mutex& mutex, nsecs_t reltime) { -#if defined(HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE) - struct timespec ts; - ts.tv_sec = reltime/1000000000; - ts.tv_nsec = reltime%1000000000; - return -pthread_cond_timedwait_relative_np(&mCond, &mutex.mMutex, &ts); -#else // HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE - struct timespec ts; -#if defined(HAVE_POSIX_CLOCKS) - clock_gettime(CLOCK_REALTIME, &ts); -#else // HAVE_POSIX_CLOCKS - // we don't support the clocks here. - struct timeval t; - gettimeofday(&t, NULL); - ts.tv_sec = t.tv_sec; - ts.tv_nsec= t.tv_usec*1000; -#endif // HAVE_POSIX_CLOCKS - ts.tv_sec += reltime/1000000000; - ts.tv_nsec+= reltime%1000000000; - if (ts.tv_nsec >= 1000000000) { - ts.tv_nsec -= 1000000000; - ts.tv_sec += 1; - } - return -pthread_cond_timedwait(&mCond, &mutex.mMutex, &ts); -#endif // HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE -} -inline void Condition::signal() { - pthread_cond_signal(&mCond); -} -inline void Condition::broadcast() { - pthread_cond_broadcast(&mCond); -} - -#endif // HAVE_PTHREADS - -/*****************************************************************************/ - -/* - * This is our spiffy thread object! - */ - -class Thread : virtual public RefBase -{ -public: - // Create a Thread object, but doesn't create or start the associated - // thread. See the run() method. - Thread(bool canCallJava = true); - virtual ~Thread(); - - // Start the thread in threadLoop() which needs to be implemented. - virtual status_t run( const char* name = 0, - int32_t priority = PRIORITY_DEFAULT, - size_t stack = 0); - - // Ask this object's thread to exit. This function is asynchronous, when the - // function returns the thread might still be running. Of course, this - // function can be called from a different thread. - virtual void requestExit(); - - // Good place to do one-time initializations - virtual status_t readyToRun(); - - // Call requestExit() and wait until this object's thread exits. - // BE VERY CAREFUL of deadlocks. In particular, it would be silly to call - // this function from this object's thread. Will return WOULD_BLOCK in - // that case. - status_t requestExitAndWait(); - - // Wait until this object's thread exits. Returns immediately if not yet running. - // Do not call from this object's thread; will return WOULD_BLOCK in that case. - status_t join(); - -protected: - // exitPending() returns true if requestExit() has been called. - bool exitPending() const; - -private: - // Derived class must implement threadLoop(). The thread starts its life - // here. There are two ways of using the Thread object: - // 1) loop: if threadLoop() returns true, it will be called again if - // requestExit() wasn't called. - // 2) once: if threadLoop() returns false, the thread will exit upon return. - virtual bool threadLoop() = 0; - -private: - Thread& operator=(const Thread&); - static int _threadLoop(void* user); - const bool mCanCallJava; - // always hold mLock when reading or writing - thread_id_t mThread; - mutable Mutex mLock; - Condition mThreadExitedCondition; - status_t mStatus; - // note that all accesses of mExitPending and mRunning need to hold mLock - volatile bool mExitPending; - volatile bool mRunning; - sp mHoldSelf; -#if HAVE_ANDROID_OS - int mTid; -#endif -}; - - -}; // namespace android - -#endif // __cplusplus - -#endif // _LIBS_UTILS_THREADS_H diff --git a/external/android/include/14/hardware/libhardware/include/hardware/audio.h b/external/android/include/14/hardware/libhardware/include/hardware/audio.h deleted file mode 100644 index 2d7f39d..0000000 --- a/external/android/include/14/hardware/libhardware/include/hardware/audio.h +++ /dev/null @@ -1,343 +0,0 @@ -/* - * Copyright (C) 2011 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_AUDIO_HAL_INTERFACE_H -#define ANDROID_AUDIO_HAL_INTERFACE_H - -#include -#include -#include -#include - -#include - -#include -#include -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define AUDIO_HARDWARE_MODULE_ID "audio" - -/** - * Name of the audio devices to open - */ -#define AUDIO_HARDWARE_INTERFACE "audio_hw_if" - -/**************************************/ - -/** - * standard audio parameters that the HAL may need to handle - */ - -/** - * audio device parameters - */ - -/* BT SCO Noise Reduction + Echo Cancellation parameters */ -#define AUDIO_PARAMETER_KEY_BT_NREC "bt_headset_nrec" -#define AUDIO_PARAMETER_VALUE_ON "on" -#define AUDIO_PARAMETER_VALUE_OFF "off" - -/* TTY mode selection */ -#define AUDIO_PARAMETER_KEY_TTY_MODE "tty_mode" -#define AUDIO_PARAMETER_VALUE_TTY_OFF "tty_off" -#define AUDIO_PARAMETER_VALUE_TTY_VCO "tty_vco" -#define AUDIO_PARAMETER_VALUE_TTY_HCO "tty_hco" -#define AUDIO_PARAMETER_VALUE_TTY_FULL "tty_full" - -/** - * audio stream parameters - */ - -#define AUDIO_PARAMETER_STREAM_ROUTING "routing" -#define AUDIO_PARAMETER_STREAM_FORMAT "format" -#define AUDIO_PARAMETER_STREAM_CHANNELS "channels" -#define AUDIO_PARAMETER_STREAM_FRAME_COUNT "frame_count" -#define AUDIO_PARAMETER_STREAM_INPUT_SOURCE "input_source" - -/**************************************/ - -/* common audio stream parameters and operations */ -struct audio_stream { - - /** - * sampling rate is in Hz - eg. 44100 - */ - uint32_t (*get_sample_rate)(const struct audio_stream *stream); - - /* currently unused - use set_parameters with key - * AUDIO_PARAMETER_STREAM_SAMPLING_RATE - */ - int (*set_sample_rate)(struct audio_stream *stream, uint32_t rate); - - /** - * size of output buffer in bytes - eg. 4800 - */ - size_t (*get_buffer_size)(const struct audio_stream *stream); - - /** - * the channel mask - - * e.g. AUDIO_CHANNEL_OUT_STEREO or AUDIO_CHANNEL_IN_STEREO - */ - uint32_t (*get_channels)(const struct audio_stream *stream); - - /** - * audio format - eg. AUDIO_FORMAT_PCM_16_BIT - */ - int (*get_format)(const struct audio_stream *stream); - - /* currently unused - use set_parameters with key - * AUDIO_PARAMETER_STREAM_FORMAT - */ - int (*set_format)(struct audio_stream *stream, int format); - - /** - * Put the audio hardware input/output into standby mode. - * Returns 0 on success and <0 on failure. - */ - int (*standby)(struct audio_stream *stream); - - /** dump the state of the audio input/output device */ - int (*dump)(const struct audio_stream *stream, int fd); - - audio_devices_t (*get_device)(const struct audio_stream *stream); - int (*set_device)(struct audio_stream *stream, audio_devices_t device); - - /** - * set/get audio stream parameters. The function accepts a list of - * parameter key value pairs in the form: key1=value1;key2=value2;... - * - * Some keys are reserved for standard parameters (See AudioParameter class) - * - * If the implementation does not accept a parameter change while - * the output is active but the parameter is acceptable otherwise, it must - * return -ENOSYS. - * - * The audio flinger will put the stream in standby and then change the - * parameter value. - */ - int (*set_parameters)(struct audio_stream *stream, const char *kv_pairs); - - /* - * Returns a pointer to a heap allocated string. The caller is responsible - * for freeing the memory for it. - */ - char * (*get_parameters)(const struct audio_stream *stream, - const char *keys); - int (*add_audio_effect)(const struct audio_stream *stream, - effect_handle_t effect); - int (*remove_audio_effect)(const struct audio_stream *stream, - effect_handle_t effect); -}; -typedef struct audio_stream audio_stream_t; - -/** - * audio_stream_out is the abstraction interface for the audio output hardware. - * - * It provides information about various properties of the audio output - * hardware driver. - */ - -struct audio_stream_out { - struct audio_stream common; - - /** - * return the audio hardware driver latency in milli seconds. - */ - uint32_t (*get_latency)(const struct audio_stream_out *stream); - - /** - * Use this method in situations where audio mixing is done in the - * hardware. This method serves as a direct interface with hardware, - * allowing you to directly set the volume as apposed to via the framework. - * This method might produce multiple PCM outputs or hardware accelerated - * codecs, such as MP3 or AAC. - */ - int (*set_volume)(struct audio_stream_out *stream, float left, float right); - - /** - * write audio buffer to driver. Returns number of bytes written - */ - ssize_t (*write)(struct audio_stream_out *stream, const void* buffer, - size_t bytes); - - /* return the number of audio frames written by the audio dsp to DAC since - * the output has exited standby - */ - int (*get_render_position)(const struct audio_stream_out *stream, - uint32_t *dsp_frames); -}; -typedef struct audio_stream_out audio_stream_out_t; - -struct audio_stream_in { - struct audio_stream common; - - /** set the input gain for the audio driver. This method is for - * for future use */ - int (*set_gain)(struct audio_stream_in *stream, float gain); - - /** read audio buffer in from audio driver */ - ssize_t (*read)(struct audio_stream_in *stream, void* buffer, - size_t bytes); - - /** - * Return the amount of input frames lost in the audio driver since the - * last call of this function. - * Audio driver is expected to reset the value to 0 and restart counting - * upon returning the current value by this function call. - * Such loss typically occurs when the user space process is blocked - * longer than the capacity of audio driver buffers. - * - * Unit: the number of input audio frames - */ - uint32_t (*get_input_frames_lost)(struct audio_stream_in *stream); -}; -typedef struct audio_stream_in audio_stream_in_t; - -/** - * return the frame size (number of bytes per sample). - */ -static inline uint32_t audio_stream_frame_size(struct audio_stream *s) -{ - int chan_samp_sz; - - switch (s->get_format(s)) { - case AUDIO_FORMAT_PCM_16_BIT: - chan_samp_sz = sizeof(int16_t); - break; - case AUDIO_FORMAT_PCM_8_BIT: - default: - chan_samp_sz = sizeof(int8_t); - break; - } - - return popcount(s->get_channels(s)) * chan_samp_sz; -} - - -/**********************************************************************/ - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -struct audio_module { - struct hw_module_t common; -}; - -struct audio_hw_device { - struct hw_device_t common; - - /** - * used by audio flinger to enumerate what devices are supported by - * each audio_hw_device implementation. - * - * Return value is a bitmask of 1 or more values of audio_devices_t - */ - uint32_t (*get_supported_devices)(const struct audio_hw_device *dev); - - /** - * check to see if the audio hardware interface has been initialized. - * returns 0 on success, -ENODEV on failure. - */ - int (*init_check)(const struct audio_hw_device *dev); - - /** set the audio volume of a voice call. Range is between 0.0 and 1.0 */ - int (*set_voice_volume)(struct audio_hw_device *dev, float volume); - - /** - * set the audio volume for all audio activities other than voice call. - * Range between 0.0 and 1.0. If any value other than 0 is returned, - * the software mixer will emulate this capability. - */ - int (*set_master_volume)(struct audio_hw_device *dev, float volume); - - /** - * setMode is called when the audio mode changes. AUDIO_MODE_NORMAL mode - * is for standard audio playback, AUDIO_MODE_RINGTONE when a ringtone is - * playing, and AUDIO_MODE_IN_CALL when a call is in progress. - */ - int (*set_mode)(struct audio_hw_device *dev, int mode); - - /* mic mute */ - int (*set_mic_mute)(struct audio_hw_device *dev, bool state); - int (*get_mic_mute)(const struct audio_hw_device *dev, bool *state); - - /* set/get global audio parameters */ - int (*set_parameters)(struct audio_hw_device *dev, const char *kv_pairs); - - /* - * Returns a pointer to a heap allocated string. The caller is responsible - * for freeing the memory for it. - */ - char * (*get_parameters)(const struct audio_hw_device *dev, - const char *keys); - - /* Returns audio input buffer size according to parameters passed or - * 0 if one of the parameters is not supported - */ - size_t (*get_input_buffer_size)(const struct audio_hw_device *dev, - uint32_t sample_rate, int format, - int channel_count); - - /** This method creates and opens the audio hardware output stream */ - int (*open_output_stream)(struct audio_hw_device *dev, uint32_t devices, - int *format, uint32_t *channels, - uint32_t *sample_rate, - struct audio_stream_out **out); - - void (*close_output_stream)(struct audio_hw_device *dev, - struct audio_stream_out* out); - - /** This method creates and opens the audio hardware input stream */ - int (*open_input_stream)(struct audio_hw_device *dev, uint32_t devices, - int *format, uint32_t *channels, - uint32_t *sample_rate, - audio_in_acoustics_t acoustics, - struct audio_stream_in **stream_in); - - void (*close_input_stream)(struct audio_hw_device *dev, - struct audio_stream_in *in); - - /** This method dumps the state of the audio hardware */ - int (*dump)(const struct audio_hw_device *dev, int fd); -}; -typedef struct audio_hw_device audio_hw_device_t; - -/** convenience API for opening and closing a supported device */ - -static inline int audio_hw_device_open(const struct hw_module_t* module, - struct audio_hw_device** device) -{ - return module->methods->open(module, AUDIO_HARDWARE_INTERFACE, - (struct hw_device_t**)device); -} - -static inline int audio_hw_device_close(struct audio_hw_device* device) -{ - return device->common.close(&device->common); -} - - -__END_DECLS - -#endif // ANDROID_AUDIO_INTERFACE_H diff --git a/external/android/include/14/hardware/libhardware/include/hardware/audio_effect.h b/external/android/include/14/hardware/libhardware/include/hardware/audio_effect.h deleted file mode 100644 index 5adab12..0000000 --- a/external/android/include/14/hardware/libhardware/include/hardware/audio_effect.h +++ /dev/null @@ -1,897 +0,0 @@ -/* - * Copyright (C) 2011 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_AUDIO_EFFECT_H -#define ANDROID_AUDIO_EFFECT_H - -#include -#include -#include -#include -#include - -#include - -#include - - -__BEGIN_DECLS - - -///////////////////////////////////////////////// -// Common Definitions -///////////////////////////////////////////////// - -// -//--- Effect descriptor structure effect_descriptor_t -// - -// Unique effect ID (can be generated from the following site: -// http://www.itu.int/ITU-T/asn1/uuid.html) -// This format is used for both "type" and "uuid" fields of the effect descriptor structure. -// - When used for effect type and the engine is implementing and effect corresponding to a standard -// OpenSL ES interface, this ID must be the one defined in OpenSLES_IID.h for that interface. -// - When used as uuid, it should be a unique UUID for this particular implementation. -typedef struct effect_uuid_s { - uint32_t timeLow; - uint16_t timeMid; - uint16_t timeHiAndVersion; - uint16_t clockSeq; - uint8_t node[6]; -} effect_uuid_t; - -// Maximum length of character strings in structures defines by this API. -#define EFFECT_STRING_LEN_MAX 64 - -// NULL UUID definition (matches SL_IID_NULL_) -#define EFFECT_UUID_INITIALIZER { 0xec7178ec, 0xe5e1, 0x4432, 0xa3f4, \ - { 0x46, 0x57, 0xe6, 0x79, 0x52, 0x10 } } -static const effect_uuid_t EFFECT_UUID_NULL_ = EFFECT_UUID_INITIALIZER; -const effect_uuid_t * const EFFECT_UUID_NULL = &EFFECT_UUID_NULL_; -const char * const EFFECT_UUID_NULL_STR = "ec7178ec-e5e1-4432-a3f4-4657e6795210"; - -// The effect descriptor contains necessary information to facilitate the enumeration of the effect -// engines present in a library. -typedef struct effect_descriptor_s { - effect_uuid_t type; // UUID of to the OpenSL ES interface implemented by this effect - effect_uuid_t uuid; // UUID for this particular implementation - uint32_t apiVersion; // Version of the effect control API implemented - uint32_t flags; // effect engine capabilities/requirements flags (see below) - uint16_t cpuLoad; // CPU load indication (see below) - uint16_t memoryUsage; // Data Memory usage (see below) - char name[EFFECT_STRING_LEN_MAX]; // human readable effect name - char implementor[EFFECT_STRING_LEN_MAX]; // human readable effect implementor name -} effect_descriptor_t; - -// CPU load and memory usage indication: each effect implementation must provide an indication of -// its CPU and memory usage for the audio effect framework to limit the number of effects -// instantiated at a given time on a given platform. -// The CPU load is expressed in 0.1 MIPS units as estimated on an ARM9E core (ARMv5TE) with 0 WS. -// The memory usage is expressed in KB and includes only dynamically allocated memory - -// Definitions for flags field of effect descriptor. -// +---------------------------+-----------+----------------------------------- -// | description | bits | values -// +---------------------------+-----------+----------------------------------- -// | connection mode | 0..2 | 0 insert: after track process -// | | | 1 auxiliary: connect to track auxiliary -// | | | output and use send level -// | | | 2 replace: replaces track process function; -// | | | must implement SRC, volume and mono to stereo. -// | | | 3 pre processing: applied below audio HAL on input -// | | | 4 post processing: applied below audio HAL on output -// | | | 5 - 7 reserved -// +---------------------------+-----------+----------------------------------- -// | insertion preference | 3..5 | 0 none -// | | | 1 first of the chain -// | | | 2 last of the chain -// | | | 3 exclusive (only effect in the insert chain) -// | | | 4..7 reserved -// +---------------------------+-----------+----------------------------------- -// | Volume management | 6..8 | 0 none -// | | | 1 implements volume control -// | | | 2 requires volume indication -// | | | 4 reserved -// +---------------------------+-----------+----------------------------------- -// | Device indication | 9..11 | 0 none -// | | | 1 requires device updates -// | | | 2, 4 reserved -// +---------------------------+-----------+----------------------------------- -// | Sample input mode | 12..13 | 1 direct: process() function or EFFECT_CMD_CONFIGURE -// | | | command must specify a buffer descriptor -// | | | 2 provider: process() function uses the -// | | | bufferProvider indicated by the -// | | | EFFECT_CMD_CONFIGURE command to request input. -// | | | buffers. -// | | | 3 both: both input modes are supported -// +---------------------------+-----------+----------------------------------- -// | Sample output mode | 14..15 | 1 direct: process() function or EFFECT_CMD_CONFIGURE -// | | | command must specify a buffer descriptor -// | | | 2 provider: process() function uses the -// | | | bufferProvider indicated by the -// | | | EFFECT_CMD_CONFIGURE command to request output -// | | | buffers. -// | | | 3 both: both output modes are supported -// +---------------------------+-----------+----------------------------------- -// | Hardware acceleration | 16..17 | 0 No hardware acceleration -// | | | 1 non tunneled hw acceleration: the process() function -// | | | reads the samples, send them to HW accelerated -// | | | effect processor, reads back the processed samples -// | | | and returns them to the output buffer. -// | | | 2 tunneled hw acceleration: the process() function is -// | | | transparent. The effect interface is only used to -// | | | control the effect engine. This mode is relevant for -// | | | global effects actually applied by the audio -// | | | hardware on the output stream. -// +---------------------------+-----------+----------------------------------- -// | Audio Mode indication | 18..19 | 0 none -// | | | 1 requires audio mode updates -// | | | 2..3 reserved -// +---------------------------+-----------+----------------------------------- - -// Insert mode -#define EFFECT_FLAG_TYPE_SHIFT 0 -#define EFFECT_FLAG_TYPE_SIZE 3 -#define EFFECT_FLAG_TYPE_MASK (((1 << EFFECT_FLAG_TYPE_SIZE) -1) \ - << EFFECT_FLAG_TYPE_SHIFT) -#define EFFECT_FLAG_TYPE_INSERT (0 << EFFECT_FLAG_TYPE_SHIFT) -#define EFFECT_FLAG_TYPE_AUXILIARY (1 << EFFECT_FLAG_TYPE_SHIFT) -#define EFFECT_FLAG_TYPE_REPLACE (2 << EFFECT_FLAG_TYPE_SHIFT) -#define EFFECT_FLAG_TYPE_PRE_PROC (3 << EFFECT_FLAG_TYPE_SHIFT) -#define EFFECT_FLAG_TYPE_POST_PROC (4 << EFFECT_FLAG_TYPE_SHIFT) - -// Insert preference -#define EFFECT_FLAG_INSERT_SHIFT (EFFECT_FLAG_TYPE_SHIFT + EFFECT_FLAG_TYPE_SIZE) -#define EFFECT_FLAG_INSERT_SIZE 3 -#define EFFECT_FLAG_INSERT_MASK (((1 << EFFECT_FLAG_INSERT_SIZE) -1) \ - << EFFECT_FLAG_INSERT_SHIFT) -#define EFFECT_FLAG_INSERT_ANY (0 << EFFECT_FLAG_INSERT_SHIFT) -#define EFFECT_FLAG_INSERT_FIRST (1 << EFFECT_FLAG_INSERT_SHIFT) -#define EFFECT_FLAG_INSERT_LAST (2 << EFFECT_FLAG_INSERT_SHIFT) -#define EFFECT_FLAG_INSERT_EXCLUSIVE (3 << EFFECT_FLAG_INSERT_SHIFT) - - -// Volume control -#define EFFECT_FLAG_VOLUME_SHIFT (EFFECT_FLAG_INSERT_SHIFT + EFFECT_FLAG_INSERT_SIZE) -#define EFFECT_FLAG_VOLUME_SIZE 3 -#define EFFECT_FLAG_VOLUME_MASK (((1 << EFFECT_FLAG_VOLUME_SIZE) -1) \ - << EFFECT_FLAG_VOLUME_SHIFT) -#define EFFECT_FLAG_VOLUME_CTRL (1 << EFFECT_FLAG_VOLUME_SHIFT) -#define EFFECT_FLAG_VOLUME_IND (2 << EFFECT_FLAG_VOLUME_SHIFT) -#define EFFECT_FLAG_VOLUME_NONE (0 << EFFECT_FLAG_VOLUME_SHIFT) - -// Device indication -#define EFFECT_FLAG_DEVICE_SHIFT (EFFECT_FLAG_VOLUME_SHIFT + EFFECT_FLAG_VOLUME_SIZE) -#define EFFECT_FLAG_DEVICE_SIZE 3 -#define EFFECT_FLAG_DEVICE_MASK (((1 << EFFECT_FLAG_DEVICE_SIZE) -1) \ - << EFFECT_FLAG_DEVICE_SHIFT) -#define EFFECT_FLAG_DEVICE_IND (1 << EFFECT_FLAG_DEVICE_SHIFT) -#define EFFECT_FLAG_DEVICE_NONE (0 << EFFECT_FLAG_DEVICE_SHIFT) - -// Sample input modes -#define EFFECT_FLAG_INPUT_SHIFT (EFFECT_FLAG_DEVICE_SHIFT + EFFECT_FLAG_DEVICE_SIZE) -#define EFFECT_FLAG_INPUT_SIZE 2 -#define EFFECT_FLAG_INPUT_MASK (((1 << EFFECT_FLAG_INPUT_SIZE) -1) \ - << EFFECT_FLAG_INPUT_SHIFT) -#define EFFECT_FLAG_INPUT_DIRECT (1 << EFFECT_FLAG_INPUT_SHIFT) -#define EFFECT_FLAG_INPUT_PROVIDER (2 << EFFECT_FLAG_INPUT_SHIFT) -#define EFFECT_FLAG_INPUT_BOTH (3 << EFFECT_FLAG_INPUT_SHIFT) - -// Sample output modes -#define EFFECT_FLAG_OUTPUT_SHIFT (EFFECT_FLAG_INPUT_SHIFT + EFFECT_FLAG_INPUT_SIZE) -#define EFFECT_FLAG_OUTPUT_SIZE 2 -#define EFFECT_FLAG_OUTPUT_MASK (((1 << EFFECT_FLAG_OUTPUT_SIZE) -1) \ - << EFFECT_FLAG_OUTPUT_SHIFT) -#define EFFECT_FLAG_OUTPUT_DIRECT (1 << EFFECT_FLAG_OUTPUT_SHIFT) -#define EFFECT_FLAG_OUTPUT_PROVIDER (2 << EFFECT_FLAG_OUTPUT_SHIFT) -#define EFFECT_FLAG_OUTPUT_BOTH (3 << EFFECT_FLAG_OUTPUT_SHIFT) - -// Hardware acceleration mode -#define EFFECT_FLAG_HW_ACC_SHIFT (EFFECT_FLAG_OUTPUT_SHIFT + EFFECT_FLAG_OUTPUT_SIZE) -#define EFFECT_FLAG_HW_ACC_SIZE 2 -#define EFFECT_FLAG_HW_ACC_MASK (((1 << EFFECT_FLAG_HW_ACC_SIZE) -1) \ - << EFFECT_FLAG_HW_ACC_SHIFT) -#define EFFECT_FLAG_HW_ACC_SIMPLE (1 << EFFECT_FLAG_HW_ACC_SHIFT) -#define EFFECT_FLAG_HW_ACC_TUNNEL (2 << EFFECT_FLAG_HW_ACC_SHIFT) - -// Audio mode indication -#define EFFECT_FLAG_AUDIO_MODE_SHIFT (EFFECT_FLAG_HW_ACC_SHIFT + EFFECT_FLAG_HW_ACC_SIZE) -#define EFFECT_FLAG_AUDIO_MODE_SIZE 2 -#define EFFECT_FLAG_AUDIO_MODE_MASK (((1 << EFFECT_FLAG_AUDIO_MODE_SIZE) -1) \ - << EFFECT_FLAG_AUDIO_MODE_SHIFT) -#define EFFECT_FLAG_AUDIO_MODE_IND (1 << EFFECT_FLAG_AUDIO_MODE_SHIFT) -#define EFFECT_FLAG_AUDIO_MODE_NONE (0 << EFFECT_FLAG_AUDIO_MODE_SHIFT) - - -#define EFFECT_MAKE_API_VERSION(M, m) (((M)<<16) | ((m) & 0xFFFF)) -#define EFFECT_API_VERSION_MAJOR(v) ((v)>>16) -#define EFFECT_API_VERSION_MINOR(v) ((m) & 0xFFFF) - - - -///////////////////////////////////////////////// -// Effect control interface -///////////////////////////////////////////////// - -// Effect control interface version 2.0 -#define EFFECT_CONTROL_API_VERSION EFFECT_MAKE_API_VERSION(2,0) - -// Effect control interface structure: effect_interface_s -// The effect control interface is exposed by each effect engine implementation. It consists of -// a set of functions controlling the configuration, activation and process of the engine. -// The functions are grouped in a structure of type effect_interface_s. -// -// Effect control interface handle: effect_handle_t -// The effect_handle_t serves two purposes regarding the implementation of the effect engine: -// - 1 it is the address of a pointer to an effect_interface_s structure where the functions -// of the effect control API for a particular effect are located. -// - 2 it is the address of the context of a particular effect instance. -// A typical implementation in the effect library would define a structure as follows: -// struct effect_module_s { -// const struct effect_interface_s *itfe; -// effect_config_t config; -// effect_context_t context; -// } -// The implementation of EffectCreate() function would then allocate a structure of this -// type and return its address as effect_handle_t -typedef struct effect_interface_s **effect_handle_t; - - -// Forward definition of type audio_buffer_t -typedef struct audio_buffer_s audio_buffer_t; - - - - - - -// Effect control interface definition -struct effect_interface_s { - //////////////////////////////////////////////////////////////////////////////// - // - // Function: process - // - // Description: Effect process function. Takes input samples as specified - // (count and location) in input buffer descriptor and output processed - // samples as specified in output buffer descriptor. If the buffer descriptor - // is not specified the function must use either the buffer or the - // buffer provider function installed by the EFFECT_CMD_CONFIGURE command. - // The effect framework will call the process() function after the EFFECT_CMD_ENABLE - // command is received and until the EFFECT_CMD_DISABLE is received. When the engine - // receives the EFFECT_CMD_DISABLE command it should turn off the effect gracefully - // and when done indicate that it is OK to stop calling the process() function by - // returning the -ENODATA status. - // - // NOTE: the process() function implementation should be "real-time safe" that is - // it should not perform blocking calls: malloc/free, sleep, read/write/open/close, - // pthread_cond_wait/pthread_mutex_lock... - // - // Input: - // self: handle to the effect interface this function - // is called on. - // inBuffer: buffer descriptor indicating where to read samples to process. - // If NULL, use the configuration passed by EFFECT_CMD_CONFIGURE command. - // - // outBuffer: buffer descriptor indicating where to write processed samples. - // If NULL, use the configuration passed by EFFECT_CMD_CONFIGURE command. - // - // Output: - // returned value: 0 successful operation - // -ENODATA the engine has finished the disable phase and the framework - // can stop calling process() - // -EINVAL invalid interface handle or - // invalid input/output buffer description - //////////////////////////////////////////////////////////////////////////////// - int32_t (*process)(effect_handle_t self, - audio_buffer_t *inBuffer, - audio_buffer_t *outBuffer); - //////////////////////////////////////////////////////////////////////////////// - // - // Function: command - // - // Description: Send a command and receive a response to/from effect engine. - // - // Input: - // self: handle to the effect interface this function - // is called on. - // cmdCode: command code: the command can be a standardized command defined in - // effect_command_e (see below) or a proprietary command. - // cmdSize: size of command in bytes - // pCmdData: pointer to command data - // pReplyData: pointer to reply data - // - // Input/Output: - // replySize: maximum size of reply data as input - // actual size of reply data as output - // - // Output: - // returned value: 0 successful operation - // -EINVAL invalid interface handle or - // invalid command/reply size or format according to command code - // The return code should be restricted to indicate problems related to the this - // API specification. Status related to the execution of a particular command should be - // indicated as part of the reply field. - // - // *pReplyData updated with command response - // - //////////////////////////////////////////////////////////////////////////////// - int32_t (*command)(effect_handle_t self, - uint32_t cmdCode, - uint32_t cmdSize, - void *pCmdData, - uint32_t *replySize, - void *pReplyData); - //////////////////////////////////////////////////////////////////////////////// - // - // Function: get_descriptor - // - // Description: Returns the effect descriptor - // - // Input: - // self: handle to the effect interface this function - // is called on. - // - // Input/Output: - // pDescriptor: address where to return the effect descriptor. - // - // Output: - // returned value: 0 successful operation. - // -EINVAL invalid interface handle or invalid pDescriptor - // *pDescriptor: updated with the effect descriptor. - // - //////////////////////////////////////////////////////////////////////////////// - int32_t (*get_descriptor)(effect_handle_t self, - effect_descriptor_t *pDescriptor); - //////////////////////////////////////////////////////////////////////////////// - // - // Function: process_reverse - // - // Description: Process reverse stream function. This function is used to pass - // a reference stream to the effect engine. If the engine does not need a reference - // stream, this function pointer can be set to NULL. - // This function would typically implemented by an Echo Canceler. - // - // Input: - // self: handle to the effect interface this function - // is called on. - // inBuffer: buffer descriptor indicating where to read samples to process. - // If NULL, use the configuration passed by EFFECT_CMD_CONFIGURE_REVERSE command. - // - // outBuffer: buffer descriptor indicating where to write processed samples. - // If NULL, use the configuration passed by EFFECT_CMD_CONFIGURE_REVERSE command. - // If the buffer and buffer provider in the configuration received by - // EFFECT_CMD_CONFIGURE_REVERSE are also NULL, do not return modified reverse - // stream data - // - // Output: - // returned value: 0 successful operation - // -ENODATA the engine has finished the disable phase and the framework - // can stop calling process_reverse() - // -EINVAL invalid interface handle or - // invalid input/output buffer description - //////////////////////////////////////////////////////////////////////////////// - int32_t (*process_reverse)(effect_handle_t self, - audio_buffer_t *inBuffer, - audio_buffer_t *outBuffer); -}; - - -// -//--- Standardized command codes for command() function -// -enum effect_command_e { - EFFECT_CMD_INIT, // initialize effect engine - EFFECT_CMD_CONFIGURE, // configure effect engine (see effect_config_t) - EFFECT_CMD_RESET, // reset effect engine - EFFECT_CMD_ENABLE, // enable effect process - EFFECT_CMD_DISABLE, // disable effect process - EFFECT_CMD_SET_PARAM, // set parameter immediately (see effect_param_t) - EFFECT_CMD_SET_PARAM_DEFERRED, // set parameter deferred - EFFECT_CMD_SET_PARAM_COMMIT, // commit previous set parameter deferred - EFFECT_CMD_GET_PARAM, // get parameter - EFFECT_CMD_SET_DEVICE, // set audio device (see audio.h, audio_devices_t) - EFFECT_CMD_SET_VOLUME, // set volume - EFFECT_CMD_SET_AUDIO_MODE, // set the audio mode (normal, ring, ...) - EFFECT_CMD_CONFIGURE_REVERSE, // configure effect engine reverse stream(see effect_config_t) - EFFECT_CMD_SET_INPUT_DEVICE, // set capture device (see audio.h, audio_devices_t) - EFFECT_CMD_FIRST_PROPRIETARY = 0x10000 // first proprietary command code -}; - -//================================================================================================== -// command: EFFECT_CMD_INIT -//-------------------------------------------------------------------------------------------------- -// description: -// Initialize effect engine: All configurations return to default -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_CONFIGURE -//-------------------------------------------------------------------------------------------------- -// description: -// Apply new audio parameters configurations for input and output buffers -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(effect_config_t) -// data: effect_config_t -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_RESET -//-------------------------------------------------------------------------------------------------- -// description: -// Reset the effect engine. Keep configuration but resets state and buffer content -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 0 -// data: N/A -//================================================================================================== -// command: EFFECT_CMD_ENABLE -//-------------------------------------------------------------------------------------------------- -// description: -// Enable the process. Called by the framework before the first call to process() -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_DISABLE -//-------------------------------------------------------------------------------------------------- -// description: -// Disable the process. Called by the framework after the last call to process() -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_SET_PARAM -//-------------------------------------------------------------------------------------------------- -// description: -// Set a parameter and apply it immediately -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(effect_param_t) + size of param and value -// data: effect_param_t + param + value. See effect_param_t definition below for value offset -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_SET_PARAM_DEFERRED -//-------------------------------------------------------------------------------------------------- -// description: -// Set a parameter but apply it only when receiving EFFECT_CMD_SET_PARAM_COMMIT command -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(effect_param_t) + size of param and value -// data: effect_param_t + param + value. See effect_param_t definition below for value offset -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 0 -// data: N/A -//================================================================================================== -// command: EFFECT_CMD_SET_PARAM_COMMIT -//-------------------------------------------------------------------------------------------------- -// description: -// Apply all previously received EFFECT_CMD_SET_PARAM_DEFERRED commands -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_GET_PARAM -//-------------------------------------------------------------------------------------------------- -// description: -// Get a parameter value -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(effect_param_t) + size of param -// data: effect_param_t + param -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(effect_param_t) + size of param and value -// data: effect_param_t + param + value. See effect_param_t definition below for value offset -//================================================================================================== -// command: EFFECT_CMD_SET_DEVICE -//-------------------------------------------------------------------------------------------------- -// description: -// Set the rendering device the audio output path is connected to. See audio.h, audio_devices_t -// for device values. -// The effect implementation must set EFFECT_FLAG_DEVICE_IND flag in its descriptor to receive this -// command when the device changes -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(uint32_t) -// data: uint32_t -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 0 -// data: N/A -//================================================================================================== -// command: EFFECT_CMD_SET_VOLUME -//-------------------------------------------------------------------------------------------------- -// description: -// Set and get volume. Used by audio framework to delegate volume control to effect engine. -// The effect implementation must set EFFECT_FLAG_VOLUME_IND or EFFECT_FLAG_VOLUME_CTRL flag in -// its descriptor to receive this command before every call to process() function -// If EFFECT_FLAG_VOLUME_CTRL flag is set in the effect descriptor, the effect engine must return -// the volume that should be applied before the effect is processed. The overall volume (the volume -// actually applied by the effect engine multiplied by the returned value) should match the value -// indicated in the command. -//-------------------------------------------------------------------------------------------------- -// command format: -// size: n * sizeof(uint32_t) -// data: volume for each channel defined in effect_config_t for output buffer expressed in -// 8.24 fixed point format -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: n * sizeof(uint32_t) / 0 -// data: - if EFFECT_FLAG_VOLUME_CTRL is set in effect descriptor: -// volume for each channel defined in effect_config_t for output buffer expressed in -// 8.24 fixed point format -// - if EFFECT_FLAG_VOLUME_CTRL is not set in effect descriptor: -// N/A -// It is legal to receive a null pointer as pReplyData in which case the effect framework has -// delegated volume control to another effect -//================================================================================================== -// command: EFFECT_CMD_SET_AUDIO_MODE -//-------------------------------------------------------------------------------------------------- -// description: -// Set the audio mode. The effect implementation must set EFFECT_FLAG_AUDIO_MODE_IND flag in its -// descriptor to receive this command when the audio mode changes. -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(uint32_t) -// data: audio_mode_e -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 0 -// data: N/A -//================================================================================================== -// command: EFFECT_CMD_CONFIGURE_REVERSE -//-------------------------------------------------------------------------------------------------- -// description: -// Apply new audio parameters configurations for input and output buffers of reverse stream -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(effect_config_t) -// data: effect_config_t -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_SET_INPUT_DEVICE -//-------------------------------------------------------------------------------------------------- -// description: -// Set the capture device the audio input path is connected to. See audio.h, audio_devices_t -// for device values. -// The effect implementation must set EFFECT_FLAG_DEVICE_IND flag in its descriptor to receive this -// command when the device changes -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(uint32_t) -// data: uint32_t -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 0 -// data: N/A -//================================================================================================== -// command: EFFECT_CMD_FIRST_PROPRIETARY -//-------------------------------------------------------------------------------------------------- -// description: -// All proprietary effect commands must use command codes above this value. The size and format of -// command and response fields is free in this case -//================================================================================================== - - -// Audio buffer descriptor used by process(), bufferProvider() functions and buffer_config_t -// structure. Multi-channel audio is always interleaved. The channel order is from LSB to MSB with -// regard to the channel mask definition in audio.h, audio_channels_t e.g : -// Stereo: left, right -// 5 point 1: front left, front right, front center, low frequency, back left, back right -// The buffer size is expressed in frame count, a frame being composed of samples for all -// channels at a given time. Frame size for unspecified format (AUDIO_FORMAT_OTHER) is 8 bit by -// definition -struct audio_buffer_s { - size_t frameCount; // number of frames in buffer - union { - void* raw; // raw pointer to start of buffer - int32_t* s32; // pointer to signed 32 bit data at start of buffer - int16_t* s16; // pointer to signed 16 bit data at start of buffer - uint8_t* u8; // pointer to unsigned 8 bit data at start of buffer - }; -}; - -// The buffer_provider_s structure contains functions that can be used -// by the effect engine process() function to query and release input -// or output audio buffer. -// The getBuffer() function is called to retrieve a buffer where data -// should read from or written to by process() function. -// The releaseBuffer() function MUST be called when the buffer retrieved -// with getBuffer() is not needed anymore. -// The process function should use the buffer provider mechanism to retrieve -// input or output buffer if the inBuffer or outBuffer passed as argument is NULL -// and the buffer configuration (buffer_config_t) given by the EFFECT_CMD_CONFIGURE -// command did not specify an audio buffer. - -typedef int32_t (* buffer_function_t)(void *cookie, audio_buffer_t *buffer); - -typedef struct buffer_provider_s { - buffer_function_t getBuffer; // retrieve next buffer - buffer_function_t releaseBuffer; // release used buffer - void *cookie; // for use by client of buffer provider functions -} buffer_provider_t; - - -// The buffer_config_s structure specifies the input or output audio format -// to be used by the effect engine. It is part of the effect_config_t -// structure that defines both input and output buffer configurations and is -// passed by the EFFECT_CMD_CONFIGURE or EFFECT_CMD_CONFIGURE_REVERSE command. -typedef struct buffer_config_s { - audio_buffer_t buffer; // buffer for use by process() function if not passed explicitly - uint32_t samplingRate; // sampling rate - uint32_t channels; // channel mask (see audio_channels_t in audio.h) - buffer_provider_t bufferProvider; // buffer provider - uint8_t format; // Audio format (see see audio_format_t in audio.h) - uint8_t accessMode; // read/write or accumulate in buffer (effect_buffer_access_e) - uint16_t mask; // indicates which of the above fields is valid -} buffer_config_t; - -// Values for "accessMode" field of buffer_config_t: -// overwrite, read only, accumulate (read/modify/write) -enum effect_buffer_access_e { - EFFECT_BUFFER_ACCESS_WRITE, - EFFECT_BUFFER_ACCESS_READ, - EFFECT_BUFFER_ACCESS_ACCUMULATE - -}; - -// Values for bit field "mask" in buffer_config_t. If a bit is set, the corresponding field -// in buffer_config_t must be taken into account when executing the EFFECT_CMD_CONFIGURE command -#define EFFECT_CONFIG_BUFFER 0x0001 // buffer field must be taken into account -#define EFFECT_CONFIG_SMP_RATE 0x0002 // samplingRate field must be taken into account -#define EFFECT_CONFIG_CHANNELS 0x0004 // channels field must be taken into account -#define EFFECT_CONFIG_FORMAT 0x0008 // format field must be taken into account -#define EFFECT_CONFIG_ACC_MODE 0x0010 // accessMode field must be taken into account -#define EFFECT_CONFIG_PROVIDER 0x0020 // bufferProvider field must be taken into account -#define EFFECT_CONFIG_ALL (EFFECT_CONFIG_BUFFER | EFFECT_CONFIG_SMP_RATE | \ - EFFECT_CONFIG_CHANNELS | EFFECT_CONFIG_FORMAT | \ - EFFECT_CONFIG_ACC_MODE | EFFECT_CONFIG_PROVIDER) - - -// effect_config_s structure describes the format of the pCmdData argument of EFFECT_CMD_CONFIGURE -// command to configure audio parameters and buffers for effect engine input and output. -typedef struct effect_config_s { - buffer_config_t inputCfg; - buffer_config_t outputCfg; -} effect_config_t; - - -// effect_param_s structure describes the format of the pCmdData argument of EFFECT_CMD_SET_PARAM -// command and pCmdData and pReplyData of EFFECT_CMD_GET_PARAM command. -// psize and vsize represent the actual size of parameter and value. -// -// NOTE: the start of value field inside the data field is always on a 32 bit boundary: -// -// +-----------+ -// | status | sizeof(int) -// +-----------+ -// | psize | sizeof(int) -// +-----------+ -// | vsize | sizeof(int) -// +-----------+ -// | | | | -// ~ parameter ~ > psize | -// | | | > ((psize - 1)/sizeof(int) + 1) * sizeof(int) -// +-----------+ | -// | padding | | -// +-----------+ -// | | | -// ~ value ~ > vsize -// | | | -// +-----------+ - -typedef struct effect_param_s { - int32_t status; // Transaction status (unused for command, used for reply) - uint32_t psize; // Parameter size - uint32_t vsize; // Value size - char data[]; // Start of Parameter + Value data -} effect_param_t; - - - -///////////////////////////////////////////////// -// Effect library interface -///////////////////////////////////////////////// - -// Effect library interface version 2.0 -#define EFFECT_LIBRARY_API_VERSION EFFECT_MAKE_API_VERSION(2,0) - -#define AUDIO_EFFECT_LIBRARY_TAG ((('A') << 24) | (('E') << 16) | (('L') << 8) | ('T')) - -// Every effect library must have a data structure named AUDIO_EFFECT_LIBRARY_INFO_SYM -// and the fields of this data structure must begin with audio_effect_library_t - -typedef struct audio_effect_library_s { - // tag must be initialized to AUDIO_EFFECT_LIBRARY_TAG - uint32_t tag; - // Version of the effect library API : 0xMMMMmmmm MMMM: Major, mmmm: minor - uint32_t version; - // Name of this library - const char *name; - // Author/owner/implementor of the library - const char *implementor; - - //////////////////////////////////////////////////////////////////////////////// - // - // Function: query_num_effects - // - // Description: Returns the number of different effects exposed by the - // library. Each effect must have a unique effect uuid (see - // effect_descriptor_t). This function together with EffectQueryEffect() - // is used to enumerate all effects present in the library. - // - // Input/Output: - // pNumEffects: address where the number of effects should be returned. - // - // Output: - // returned value: 0 successful operation. - // -ENODEV library failed to initialize - // -EINVAL invalid pNumEffects - // *pNumEffects: updated with number of effects in library - // - //////////////////////////////////////////////////////////////////////////////// - int32_t (*query_num_effects)(uint32_t *pNumEffects); - - //////////////////////////////////////////////////////////////////////////////// - // - // Function: query_effect - // - // Description: Returns the descriptor of the effect engine which index is - // given as argument. - // See effect_descriptor_t for details on effect descriptors. - // This function together with EffectQueryNumberEffects() is used to enumerate all - // effects present in the library. The enumeration sequence is: - // EffectQueryNumberEffects(&num_effects); - // for (i = 0; i < num_effects; i++) - // EffectQueryEffect(i,...); - // - // Input/Output: - // index: index of the effect - // pDescriptor: address where to return the effect descriptor. - // - // Output: - // returned value: 0 successful operation. - // -ENODEV library failed to initialize - // -EINVAL invalid pDescriptor or index - // -ENOSYS effect list has changed since last execution of - // EffectQueryNumberEffects() - // -ENOENT no more effect available - // *pDescriptor: updated with the effect descriptor. - // - //////////////////////////////////////////////////////////////////////////////// - int32_t (*query_effect)(uint32_t index, - effect_descriptor_t *pDescriptor); - - //////////////////////////////////////////////////////////////////////////////// - // - // Function: create_effect - // - // Description: Creates an effect engine of the specified implementation uuid and - // returns an effect control interface on this engine. The function will allocate the - // resources for an instance of the requested effect engine and return - // a handle on the effect control interface. - // - // Input: - // uuid: pointer to the effect uuid. - // sessionId: audio session to which this effect instance will be attached. All effects - // created with the same session ID are connected in series and process the same signal - // stream. Knowing that two effects are part of the same effect chain can help the - // library implement some kind of optimizations. - // ioId: identifies the output or input stream this effect is directed to at audio HAL. - // For future use especially with tunneled HW accelerated effects - // - // Input/Output: - // pHandle: address where to return the effect interface handle. - // - // Output: - // returned value: 0 successful operation. - // -ENODEV library failed to initialize - // -EINVAL invalid pEffectUuid or pHandle - // -ENOENT no effect with this uuid found - // *pHandle: updated with the effect interface handle. - // - //////////////////////////////////////////////////////////////////////////////// - int32_t (*create_effect)(effect_uuid_t *uuid, - int32_t sessionId, - int32_t ioId, - effect_handle_t *pHandle); - - //////////////////////////////////////////////////////////////////////////////// - // - // Function: release_effect - // - // Description: Releases the effect engine whose handle is given as argument. - // All resources allocated to this particular instance of the effect are - // released. - // - // Input: - // handle: handle on the effect interface to be released. - // - // Output: - // returned value: 0 successful operation. - // -ENODEV library failed to initialize - // -EINVAL invalid interface handle - // - //////////////////////////////////////////////////////////////////////////////// - int32_t (*release_effect)(effect_handle_t handle); - - //////////////////////////////////////////////////////////////////////////////// - // - // Function: get_descriptor - // - // Description: Returns the descriptor of the effect engine which implementation UUID is - // given as argument. - // - // Input/Output: - // uuid: pointer to the effect uuid. - // pDescriptor: address where to return the effect descriptor. - // - // Output: - // returned value: 0 successful operation. - // -ENODEV library failed to initialize - // -EINVAL invalid pDescriptor or uuid - // *pDescriptor: updated with the effect descriptor. - // - //////////////////////////////////////////////////////////////////////////////// - int32_t (*get_descriptor)(effect_uuid_t *uuid, - effect_descriptor_t *pDescriptor); -} audio_effect_library_t; - -// Name of the hal_module_info -#define AUDIO_EFFECT_LIBRARY_INFO_SYM AELI - -// Name of the hal_module_info as a string -#define AUDIO_EFFECT_LIBRARY_INFO_SYM_AS_STR "AELI" - -__END_DECLS - -#endif // ANDROID_AUDIO_EFFECT_H diff --git a/external/android/include/14/hardware/libhardware/include/hardware/audio_policy.h b/external/android/include/14/hardware/libhardware/include/hardware/audio_policy.h deleted file mode 100644 index fc56e5e..0000000 --- a/external/android/include/14/hardware/libhardware/include/hardware/audio_policy.h +++ /dev/null @@ -1,386 +0,0 @@ -/* - * Copyright (C) 2011 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_AUDIO_POLICY_INTERFACE_H -#define ANDROID_AUDIO_POLICY_INTERFACE_H - -#include -#include -#include - -#include - -#include -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define AUDIO_POLICY_HARDWARE_MODULE_ID "audio_policy" - -/** - * Name of the audio devices to open - */ -#define AUDIO_POLICY_INTERFACE "policy" - -/* ---------------------------------------------------------------------------- */ - -/* - * The audio_policy and audio_policy_service_ops structs define the - * communication interfaces between the platform specific audio policy manager - * and Android generic audio policy manager. - * The platform specific audio policy manager must implement methods of the - * audio_policy struct. - * This implementation makes use of the audio_policy_service_ops to control - * the activity and configuration of audio input and output streams. - * - * The platform specific audio policy manager is in charge of the audio - * routing and volume control policies for a given platform. - * The main roles of this module are: - * - keep track of current system state (removable device connections, phone - * state, user requests...). - * System state changes and user actions are notified to audio policy - * manager with methods of the audio_policy. - * - * - process get_output() queries received when AudioTrack objects are - * created: Those queries return a handler on an output that has been - * selected, configured and opened by the audio policy manager and that - * must be used by the AudioTrack when registering to the AudioFlinger - * with the createTrack() method. - * When the AudioTrack object is released, a release_output() query - * is received and the audio policy manager can decide to close or - * reconfigure the output depending on other streams using this output and - * current system state. - * - * - similarly process get_input() and release_input() queries received from - * AudioRecord objects and configure audio inputs. - * - process volume control requests: the stream volume is converted from - * an index value (received from UI) to a float value applicable to each - * output as a function of platform specific settings and current output - * route (destination device). It also make sure that streams are not - * muted if not allowed (e.g. camera shutter sound in some countries). - */ - -/* XXX: this should be defined OUTSIDE of frameworks/base */ -struct effect_descriptor_s; - -struct audio_policy { - /* - * configuration functions - */ - - /* indicate a change in device connection status */ - int (*set_device_connection_state)(struct audio_policy *pol, - audio_devices_t device, - audio_policy_dev_state_t state, - const char *device_address); - - /* retreive a device connection status */ - audio_policy_dev_state_t (*get_device_connection_state)( - const struct audio_policy *pol, - audio_devices_t device, - const char *device_address); - - /* indicate a change in phone state. Valid phones states are defined - * by audio_mode_t */ - void (*set_phone_state)(struct audio_policy *pol, int state); - - /* indicate a change in ringer mode */ - void (*set_ringer_mode)(struct audio_policy *pol, uint32_t mode, - uint32_t mask); - - /* force using a specific device category for the specified usage */ - void (*set_force_use)(struct audio_policy *pol, - audio_policy_force_use_t usage, - audio_policy_forced_cfg_t config); - - /* retreive current device category forced for a given usage */ - audio_policy_forced_cfg_t (*get_force_use)(const struct audio_policy *pol, - audio_policy_force_use_t usage); - - /* if can_mute is true, then audio streams that are marked ENFORCED_AUDIBLE - * can still be muted. */ - void (*set_can_mute_enforced_audible)(struct audio_policy *pol, - bool can_mute); - - /* check proper initialization */ - int (*init_check)(const struct audio_policy *pol); - - /* - * Audio routing query functions - */ - - /* request an output appriate for playback of the supplied stream type and - * parameters */ - audio_io_handle_t (*get_output)(struct audio_policy *pol, - audio_stream_type_t stream, - uint32_t samplingRate, - uint32_t format, - uint32_t channels, - audio_policy_output_flags_t flags); - - /* indicates to the audio policy manager that the output starts being used - * by corresponding stream. */ - int (*start_output)(struct audio_policy *pol, - audio_io_handle_t output, - audio_stream_type_t stream, - int session); - - /* indicates to the audio policy manager that the output stops being used - * by corresponding stream. */ - int (*stop_output)(struct audio_policy *pol, - audio_io_handle_t output, - audio_stream_type_t stream, - int session); - - /* releases the output. */ - void (*release_output)(struct audio_policy *pol, audio_io_handle_t output); - - /* request an input appriate for record from the supplied device with - * supplied parameters. */ - audio_io_handle_t (*get_input)(struct audio_policy *pol, int inputSource, - uint32_t samplingRate, - uint32_t format, - uint32_t channels, - audio_in_acoustics_t acoustics); - - /* indicates to the audio policy manager that the input starts being used */ - int (*start_input)(struct audio_policy *pol, audio_io_handle_t input); - - /* indicates to the audio policy manager that the input stops being used. */ - int (*stop_input)(struct audio_policy *pol, audio_io_handle_t input); - - /* releases the input. */ - void (*release_input)(struct audio_policy *pol, audio_io_handle_t input); - - /* - * volume control functions - */ - - /* initialises stream volume conversion parameters by specifying volume - * index range. */ - void (*init_stream_volume)(struct audio_policy *pol, - audio_stream_type_t stream, - int index_min, - int index_max); - - /* sets the new stream volume at a level corresponding to the supplied - * index */ - int (*set_stream_volume_index)(struct audio_policy *pol, - audio_stream_type_t stream, - int index); - - /* retreive current volume index for the specified stream */ - int (*get_stream_volume_index)(const struct audio_policy *pol, - audio_stream_type_t stream, - int *index); - - /* return the strategy corresponding to a given stream type */ - uint32_t (*get_strategy_for_stream)(const struct audio_policy *pol, - audio_stream_type_t stream); - - /* return the enabled output devices for the given stream type */ - uint32_t (*get_devices_for_stream)(const struct audio_policy *pol, - audio_stream_type_t stream); - - /* Audio effect management */ - audio_io_handle_t (*get_output_for_effect)(struct audio_policy *pol, - struct effect_descriptor_s *desc); - - int (*register_effect)(struct audio_policy *pol, - struct effect_descriptor_s *desc, - audio_io_handle_t output, - uint32_t strategy, - int session, - int id); - - int (*unregister_effect)(struct audio_policy *pol, int id); - - int (*set_effect_enabled)(struct audio_policy *pol, int id, bool enabled); - - bool (*is_stream_active)(const struct audio_policy *pol, - int stream, - uint32_t in_past_ms); - - /* dump state */ - int (*dump)(const struct audio_policy *pol, int fd); -}; - -struct audio_policy_service_ops { - /* - * Audio output Control functions - */ - - /* Opens an audio output with the requested parameters. - * - * The parameter values can indicate to use the default values in case the - * audio policy manager has no specific requirements for the output being - * opened. - * - * When the function returns, the parameter values reflect the actual - * values used by the audio hardware output stream. - * - * The audio policy manager can check if the proposed parameters are - * suitable or not and act accordingly. - */ - audio_io_handle_t (*open_output)(void *service, - uint32_t *pDevices, - uint32_t *pSamplingRate, - uint32_t *pFormat, - uint32_t *pChannels, - uint32_t *pLatencyMs, - audio_policy_output_flags_t flags); - - /* creates a special output that is duplicated to the two outputs passed as - * arguments. The duplication is performed by - * a special mixer thread in the AudioFlinger. - */ - audio_io_handle_t (*open_duplicate_output)(void *service, - audio_io_handle_t output1, - audio_io_handle_t output2); - - /* closes the output stream */ - int (*close_output)(void *service, audio_io_handle_t output); - - /* suspends the output. - * - * When an output is suspended, the corresponding audio hardware output - * stream is placed in standby and the AudioTracks attached to the mixer - * thread are still processed but the output mix is discarded. - */ - int (*suspend_output)(void *service, audio_io_handle_t output); - - /* restores a suspended output. */ - int (*restore_output)(void *service, audio_io_handle_t output); - - /* */ - /* Audio input Control functions */ - /* */ - - /* opens an audio input */ - audio_io_handle_t (*open_input)(void *service, - uint32_t *pDevices, - uint32_t *pSamplingRate, - uint32_t *pFormat, - uint32_t *pChannels, - uint32_t acoustics); - - /* closes an audio input */ - int (*close_input)(void *service, audio_io_handle_t input); - - /* */ - /* misc control functions */ - /* */ - - /* set a stream volume for a particular output. - * - * For the same user setting, a given stream type can have different - * volumes for each output (destination device) it is attached to. - */ - int (*set_stream_volume)(void *service, - audio_stream_type_t stream, - float volume, - audio_io_handle_t output, - int delay_ms); - - /* reroute a given stream type to the specified output */ - int (*set_stream_output)(void *service, - audio_stream_type_t stream, - audio_io_handle_t output); - - /* function enabling to send proprietary informations directly from audio - * policy manager to audio hardware interface. */ - void (*set_parameters)(void *service, - audio_io_handle_t io_handle, - const char *kv_pairs, - int delay_ms); - - /* function enabling to receive proprietary informations directly from - * audio hardware interface to audio policy manager. - * - * Returns a pointer to a heap allocated string. The caller is responsible - * for freeing the memory for it. - */ - - char * (*get_parameters)(void *service, audio_io_handle_t io_handle, - const char *keys); - - /* request the playback of a tone on the specified stream. - * used for instance to replace notification sounds when playing over a - * telephony device during a phone call. - */ - int (*start_tone)(void *service, - audio_policy_tone_t tone, - audio_stream_type_t stream); - - int (*stop_tone)(void *service); - - /* set down link audio volume. */ - int (*set_voice_volume)(void *service, - float volume, - int delay_ms); - - /* move effect to the specified output */ - int (*move_effects)(void *service, - int session, - audio_io_handle_t src_output, - audio_io_handle_t dst_output); -}; - -/**********************************************************************/ - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -typedef struct audio_policy_module { - struct hw_module_t common; -} audio_policy_module_t; - -struct audio_policy_device { - struct hw_device_t common; - - int (*create_audio_policy)(const struct audio_policy_device *device, - struct audio_policy_service_ops *aps_ops, - void *service, - struct audio_policy **ap); - - int (*destroy_audio_policy)(const struct audio_policy_device *device, - struct audio_policy *ap); -}; - -/** convenience API for opening and closing a supported device */ - -static inline int audio_policy_dev_open(const hw_module_t* module, - struct audio_policy_device** device) -{ - return module->methods->open(module, AUDIO_POLICY_INTERFACE, - (hw_device_t**)device); -} - -static inline int audio_policy_dev_close(struct audio_policy_device* device) -{ - return device->common.close(&device->common); -} - - -__END_DECLS - -#endif // ANDROID_AUDIO_POLICY_INTERFACE_H diff --git a/external/android/include/14/hardware/libhardware/include/hardware/camera.h b/external/android/include/14/hardware/libhardware/include/hardware/camera.h deleted file mode 100644 index 4d25023..0000000 --- a/external/android/include/14/hardware/libhardware/include/hardware/camera.h +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Copyright (C) 2010-2011 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. - */ - -// FIXME: add well-defined names for cameras - -#ifndef ANDROID_INCLUDE_CAMERA_H -#define ANDROID_INCLUDE_CAMERA_H - -#include -#include -#include -#include -#include -#include -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define CAMERA_HARDWARE_MODULE_ID "camera" - -struct camera_info { - /** - * The direction that the camera faces to. It should be CAMERA_FACING_BACK - * or CAMERA_FACING_FRONT. - */ - int facing; - - /** - * The orientation of the camera image. The value is the angle that the - * camera image needs to be rotated clockwise so it shows correctly on the - * display in its natural orientation. It should be 0, 90, 180, or 270. - * - * For example, suppose a device has a naturally tall screen. The - * back-facing camera sensor is mounted in landscape. You are looking at - * the screen. If the top side of the camera sensor is aligned with the - * right edge of the screen in natural orientation, the value should be - * 90. If the top side of a front-facing camera sensor is aligned with the - * right of the screen, the value should be 270. - */ - int orientation; -}; - -typedef struct camera_module { - hw_module_t common; - int (*get_number_of_cameras)(void); - int (*get_camera_info)(int camera_id, struct camera_info *info); -} camera_module_t; - -struct camera_memory; -typedef void (*camera_release_memory)(struct camera_memory *mem); - -typedef struct camera_memory { - void *data; - size_t size; - void *handle; - camera_release_memory release; -} camera_memory_t; - -typedef camera_memory_t* (*camera_request_memory)(int fd, size_t buf_size, unsigned int num_bufs, - void *user); - -typedef void (*camera_notify_callback)(int32_t msg_type, - int32_t ext1, - int32_t ext2, - void *user); - -typedef void (*camera_data_callback)(int32_t msg_type, - const camera_memory_t *data, unsigned int index, - camera_frame_metadata_t *metadata, void *user); - -typedef void (*camera_data_timestamp_callback)(int64_t timestamp, - int32_t msg_type, - const camera_memory_t *data, unsigned int index, - void *user); - -#define HAL_CAMERA_PREVIEW_WINDOW_TAG 0xcafed00d - -typedef struct preview_stream_ops { - int (*dequeue_buffer)(struct preview_stream_ops* w, - buffer_handle_t** buffer, int *stride); - int (*enqueue_buffer)(struct preview_stream_ops* w, - buffer_handle_t* buffer); - int (*cancel_buffer)(struct preview_stream_ops* w, - buffer_handle_t* buffer); - int (*set_buffer_count)(struct preview_stream_ops* w, int count); - int (*set_buffers_geometry)(struct preview_stream_ops* pw, - int w, int h, int format); - int (*set_crop)(struct preview_stream_ops *w, - int left, int top, int right, int bottom); - int (*set_usage)(struct preview_stream_ops* w, int usage); - int (*set_swap_interval)(struct preview_stream_ops *w, int interval); - int (*get_min_undequeued_buffer_count)(const struct preview_stream_ops *w, - int *count); - int (*lock_buffer)(struct preview_stream_ops* w, - buffer_handle_t* buffer); -} preview_stream_ops_t; - -struct camera_device; -typedef struct camera_device_ops { - /** Set the ANativeWindow to which preview frames are sent */ - int (*set_preview_window)(struct camera_device *, - struct preview_stream_ops *window); - - /** Set the notification and data callbacks */ - void (*set_callbacks)(struct camera_device *, - camera_notify_callback notify_cb, - camera_data_callback data_cb, - camera_data_timestamp_callback data_cb_timestamp, - camera_request_memory get_memory, - void *user); - - /** - * The following three functions all take a msg_type, which is a bitmask of - * the messages defined in include/ui/Camera.h - */ - - /** - * Enable a message, or set of messages. - */ - void (*enable_msg_type)(struct camera_device *, int32_t msg_type); - - /** - * Disable a message, or a set of messages. - * - * Once received a call to disableMsgType(CAMERA_MSG_VIDEO_FRAME), camera - * HAL should not rely on its client to call releaseRecordingFrame() to - * release video recording frames sent out by the cameral HAL before and - * after the disableMsgType(CAMERA_MSG_VIDEO_FRAME) call. Camera HAL - * clients must not modify/access any video recording frame after calling - * disableMsgType(CAMERA_MSG_VIDEO_FRAME). - */ - void (*disable_msg_type)(struct camera_device *, int32_t msg_type); - - /** - * Query whether a message, or a set of messages, is enabled. Note that - * this is operates as an AND, if any of the messages queried are off, this - * will return false. - */ - int (*msg_type_enabled)(struct camera_device *, int32_t msg_type); - - /** - * Start preview mode. - */ - int (*start_preview)(struct camera_device *); - - /** - * Stop a previously started preview. - */ - void (*stop_preview)(struct camera_device *); - - /** - * Returns true if preview is enabled. - */ - int (*preview_enabled)(struct camera_device *); - - /** - * Request the camera HAL to store meta data or real YUV data in the video - * buffers sent out via CAMERA_MSG_VIDEO_FRAME for a recording session. If - * it is not called, the default camera HAL behavior is to store real YUV - * data in the video buffers. - * - * This method should be called before startRecording() in order to be - * effective. - * - * If meta data is stored in the video buffers, it is up to the receiver of - * the video buffers to interpret the contents and to find the actual frame - * data with the help of the meta data in the buffer. How this is done is - * outside of the scope of this method. - * - * Some camera HALs may not support storing meta data in the video buffers, - * but all camera HALs should support storing real YUV data in the video - * buffers. If the camera HAL does not support storing the meta data in the - * video buffers when it is requested to do do, INVALID_OPERATION must be - * returned. It is very useful for the camera HAL to pass meta data rather - * than the actual frame data directly to the video encoder, since the - * amount of the uncompressed frame data can be very large if video size is - * large. - * - * @param enable if true to instruct the camera HAL to store - * meta data in the video buffers; false to instruct - * the camera HAL to store real YUV data in the video - * buffers. - * - * @return OK on success. - */ - int (*store_meta_data_in_buffers)(struct camera_device *, int enable); - - /** - * Start record mode. When a record image is available, a - * CAMERA_MSG_VIDEO_FRAME message is sent with the corresponding - * frame. Every record frame must be released by a camera HAL client via - * releaseRecordingFrame() before the client calls - * disableMsgType(CAMERA_MSG_VIDEO_FRAME). After the client calls - * disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is the camera HAL's - * responsibility to manage the life-cycle of the video recording frames, - * and the client must not modify/access any video recording frames. - */ - int (*start_recording)(struct camera_device *); - - /** - * Stop a previously started recording. - */ - void (*stop_recording)(struct camera_device *); - - /** - * Returns true if recording is enabled. - */ - int (*recording_enabled)(struct camera_device *); - - /** - * Release a record frame previously returned by CAMERA_MSG_VIDEO_FRAME. - * - * It is camera HAL client's responsibility to release video recording - * frames sent out by the camera HAL before the camera HAL receives a call - * to disableMsgType(CAMERA_MSG_VIDEO_FRAME). After it receives the call to - * disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is the camera HAL's - * responsibility to manage the life-cycle of the video recording frames. - */ - void (*release_recording_frame)(struct camera_device *, - const void *opaque); - - /** - * Start auto focus, the notification callback routine is called with - * CAMERA_MSG_FOCUS once when focusing is complete. autoFocus() will be - * called again if another auto focus is needed. - */ - int (*auto_focus)(struct camera_device *); - - /** - * Cancels auto-focus function. If the auto-focus is still in progress, - * this function will cancel it. Whether the auto-focus is in progress or - * not, this function will return the focus position to the default. If - * the camera does not support auto-focus, this is a no-op. - */ - int (*cancel_auto_focus)(struct camera_device *); - - /** - * Take a picture. - */ - int (*take_picture)(struct camera_device *); - - /** - * Cancel a picture that was started with takePicture. Calling this method - * when no picture is being taken is a no-op. - */ - int (*cancel_picture)(struct camera_device *); - - /** - * Set the camera parameters. This returns BAD_VALUE if any parameter is - * invalid or not supported. - */ - int (*set_parameters)(struct camera_device *, const char *parms); - - /** Retrieve the camera parameters. The buffer returned by the camera HAL - must be returned back to it with put_parameters, if put_parameters - is not NULL. - */ - char *(*get_parameters)(struct camera_device *); - - /** The camera HAL uses its own memory to pass us the parameters when we - call get_parameters. Use this function to return the memory back to - the camera HAL, if put_parameters is not NULL. If put_parameters - is NULL, then you have to use free() to release the memory. - */ - void (*put_parameters)(struct camera_device *, char *); - - /** - * Send command to camera driver. - */ - int (*send_command)(struct camera_device *, - int32_t cmd, int32_t arg1, int32_t arg2); - - /** - * Release the hardware resources owned by this object. Note that this is - * *not* done in the destructor. - */ - void (*release)(struct camera_device *); - - /** - * Dump state of the camera hardware - */ - int (*dump)(struct camera_device *, int fd); -} camera_device_ops_t; - -typedef struct camera_device { - hw_device_t common; - camera_device_ops_t *ops; - void *priv; -} camera_device_t; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_CAMERA_H */ diff --git a/external/android/include/14/hardware/libhardware/include/hardware/fb.h b/external/android/include/14/hardware/libhardware/include/hardware/fb.h deleted file mode 100644 index ba2f286..0000000 --- a/external/android/include/14/hardware/libhardware/include/hardware/fb.h +++ /dev/null @@ -1,164 +0,0 @@ -/* - * 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. - */ - - -#ifndef ANDROID_FB_INTERFACE_H -#define ANDROID_FB_INTERFACE_H - -#include -#include -#include - -#include - -#include - -__BEGIN_DECLS - -#define GRALLOC_HARDWARE_FB0 "fb0" - -/*****************************************************************************/ - - -/*****************************************************************************/ - -typedef struct framebuffer_device_t { - struct hw_device_t common; - - /* flags describing some attributes of the framebuffer */ - const uint32_t flags; - - /* dimensions of the framebuffer in pixels */ - const uint32_t width; - const uint32_t height; - - /* frambuffer stride in pixels */ - const int stride; - - /* framebuffer pixel format */ - const int format; - - /* resolution of the framebuffer's display panel in pixel per inch*/ - const float xdpi; - const float ydpi; - - /* framebuffer's display panel refresh rate in frames per second */ - const float fps; - - /* min swap interval supported by this framebuffer */ - const int minSwapInterval; - - /* max swap interval supported by this framebuffer */ - const int maxSwapInterval; - - int reserved[8]; - - /* - * requests a specific swap-interval (same definition than EGL) - * - * Returns 0 on success or -errno on error. - */ - int (*setSwapInterval)(struct framebuffer_device_t* window, - int interval); - - /* - * This hook is OPTIONAL. - * - * It is non NULL If the framebuffer driver supports "update-on-demand" - * and the given rectangle is the area of the screen that gets - * updated during (*post)(). - * - * This is useful on devices that are able to DMA only a portion of - * the screen to the display panel, upon demand -- as opposed to - * constantly refreshing the panel 60 times per second, for instance. - * - * Only the area defined by this rectangle is guaranteed to be valid, that - * is, the driver is not allowed to post anything outside of this - * rectangle. - * - * The rectangle evaluated during (*post)() and specifies which area - * of the buffer passed in (*post)() shall to be posted. - * - * return -EINVAL if width or height <=0, or if left or top < 0 - */ - int (*setUpdateRect)(struct framebuffer_device_t* window, - int left, int top, int width, int height); - - /* - * Post to the display (display it on the screen) - * The buffer must have been allocated with the - * GRALLOC_USAGE_HW_FB usage flag. - * buffer must be the same width and height as the display and must NOT - * be locked. - * - * The buffer is shown during the next VSYNC. - * - * If the same buffer is posted again (possibly after some other buffer), - * post() will block until the the first post is completed. - * - * Internally, post() is expected to lock the buffer so that a - * subsequent call to gralloc_module_t::(*lock)() with USAGE_RENDER or - * USAGE_*_WRITE will block until it is safe; that is typically once this - * buffer is shown and another buffer has been posted. - * - * Returns 0 on success or -errno on error. - */ - int (*post)(struct framebuffer_device_t* dev, buffer_handle_t buffer); - - - /* - * The (*compositionComplete)() method must be called after the - * compositor has finished issuing GL commands for client buffers. - */ - - int (*compositionComplete)(struct framebuffer_device_t* dev); - - /* - * This hook is OPTIONAL. - * - * If non NULL it will be caused by SurfaceFlinger on dumpsys - */ - void (*dump)(struct framebuffer_device_t* dev, char *buff, int buff_len); - - /* - * (*enableScreen)() is used to either blank (enable=0) or - * unblank (enable=1) the screen this framebuffer is attached to. - * - * Returns 0 on success or -errno on error. - */ - int (*enableScreen)(struct framebuffer_device_t* dev, int enable); - - void* reserved_proc[6]; - -} framebuffer_device_t; - - -/** convenience API for opening and closing a supported device */ - -static inline int framebuffer_open(const struct hw_module_t* module, - struct framebuffer_device_t** device) { - return module->methods->open(module, - GRALLOC_HARDWARE_FB0, (struct hw_device_t**)device); -} - -static inline int framebuffer_close(struct framebuffer_device_t* device) { - return device->common.close(&device->common); -} - - -__END_DECLS - -#endif // ANDROID_FB_INTERFACE_H diff --git a/external/android/include/14/hardware/libhardware/include/hardware/gps.h b/external/android/include/14/hardware/libhardware/include/hardware/gps.h deleted file mode 100644 index 69bfd50..0000000 --- a/external/android/include/14/hardware/libhardware/include/hardware/gps.h +++ /dev/null @@ -1,679 +0,0 @@ -/* - * Copyright (C) 2010 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_INCLUDE_HARDWARE_GPS_H -#define ANDROID_INCLUDE_HARDWARE_GPS_H - -#include -#include -#include -#include - -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define GPS_HARDWARE_MODULE_ID "gps" - - -/** Milliseconds since January 1, 1970 */ -typedef int64_t GpsUtcTime; - -/** Maximum number of SVs for gps_sv_status_callback(). */ -#define GPS_MAX_SVS 32 - -/** Requested operational mode for GPS operation. */ -typedef uint32_t GpsPositionMode; -// IMPORTANT: Note that the following values must match -// constants in GpsLocationProvider.java. -/** Mode for running GPS standalone (no assistance). */ -#define GPS_POSITION_MODE_STANDALONE 0 -/** AGPS MS-Based mode. */ -#define GPS_POSITION_MODE_MS_BASED 1 -/** AGPS MS-Assisted mode. */ -#define GPS_POSITION_MODE_MS_ASSISTED 2 - -/** Requested recurrence mode for GPS operation. */ -typedef uint32_t GpsPositionRecurrence; -// IMPORTANT: Note that the following values must match -// constants in GpsLocationProvider.java. -/** Receive GPS fixes on a recurring basis at a specified period. */ -#define GPS_POSITION_RECURRENCE_PERIODIC 0 -/** Request a single shot GPS fix. */ -#define GPS_POSITION_RECURRENCE_SINGLE 1 - -/** GPS status event values. */ -typedef uint16_t GpsStatusValue; -// IMPORTANT: Note that the following values must match -// constants in GpsLocationProvider.java. -/** GPS status unknown. */ -#define GPS_STATUS_NONE 0 -/** GPS has begun navigating. */ -#define GPS_STATUS_SESSION_BEGIN 1 -/** GPS has stopped navigating. */ -#define GPS_STATUS_SESSION_END 2 -/** GPS has powered on but is not navigating. */ -#define GPS_STATUS_ENGINE_ON 3 -/** GPS is powered off. */ -#define GPS_STATUS_ENGINE_OFF 4 - -/** Flags to indicate which values are valid in a GpsLocation. */ -typedef uint16_t GpsLocationFlags; -// IMPORTANT: Note that the following values must match -// constants in GpsLocationProvider.java. -/** GpsLocation has valid latitude and longitude. */ -#define GPS_LOCATION_HAS_LAT_LONG 0x0001 -/** GpsLocation has valid altitude. */ -#define GPS_LOCATION_HAS_ALTITUDE 0x0002 -/** GpsLocation has valid speed. */ -#define GPS_LOCATION_HAS_SPEED 0x0004 -/** GpsLocation has valid bearing. */ -#define GPS_LOCATION_HAS_BEARING 0x0008 -/** GpsLocation has valid accuracy. */ -#define GPS_LOCATION_HAS_ACCURACY 0x0010 - -/** Flags for the gps_set_capabilities callback. */ - -/** GPS HAL schedules fixes for GPS_POSITION_RECURRENCE_PERIODIC mode. - If this is not set, then the framework will use 1000ms for min_interval - and will start and call start() and stop() to schedule the GPS. - */ -#define GPS_CAPABILITY_SCHEDULING 0x0000001 -/** GPS supports MS-Based AGPS mode */ -#define GPS_CAPABILITY_MSB 0x0000002 -/** GPS supports MS-Assisted AGPS mode */ -#define GPS_CAPABILITY_MSA 0x0000004 -/** GPS supports single-shot fixes */ -#define GPS_CAPABILITY_SINGLE_SHOT 0x0000008 -/** GPS supports on demand time injection */ -#define GPS_CAPABILITY_ON_DEMAND_TIME 0x0000010 - -/** Flags used to specify which aiding data to delete - when calling delete_aiding_data(). */ -typedef uint16_t GpsAidingData; -// IMPORTANT: Note that the following values must match -// constants in GpsLocationProvider.java. -#define GPS_DELETE_EPHEMERIS 0x0001 -#define GPS_DELETE_ALMANAC 0x0002 -#define GPS_DELETE_POSITION 0x0004 -#define GPS_DELETE_TIME 0x0008 -#define GPS_DELETE_IONO 0x0010 -#define GPS_DELETE_UTC 0x0020 -#define GPS_DELETE_HEALTH 0x0040 -#define GPS_DELETE_SVDIR 0x0080 -#define GPS_DELETE_SVSTEER 0x0100 -#define GPS_DELETE_SADATA 0x0200 -#define GPS_DELETE_RTI 0x0400 -#define GPS_DELETE_CELLDB_INFO 0x8000 -#define GPS_DELETE_ALL 0xFFFF - -/** AGPS type */ -typedef uint16_t AGpsType; -#define AGPS_TYPE_SUPL 1 -#define AGPS_TYPE_C2K 2 - -typedef uint16_t AGpsSetIDType; -#define AGPS_SETID_TYPE_NONE 0 -#define AGPS_SETID_TYPE_IMSI 1 -#define AGPS_SETID_TYPE_MSISDN 2 - -/** - * String length constants - */ -#define GPS_NI_SHORT_STRING_MAXLEN 256 -#define GPS_NI_LONG_STRING_MAXLEN 2048 - -/** - * GpsNiType constants - */ -typedef uint32_t GpsNiType; -#define GPS_NI_TYPE_VOICE 1 -#define GPS_NI_TYPE_UMTS_SUPL 2 -#define GPS_NI_TYPE_UMTS_CTRL_PLANE 3 - -/** - * GpsNiNotifyFlags constants - */ -typedef uint32_t GpsNiNotifyFlags; -/** NI requires notification */ -#define GPS_NI_NEED_NOTIFY 0x0001 -/** NI requires verification */ -#define GPS_NI_NEED_VERIFY 0x0002 -/** NI requires privacy override, no notification/minimal trace */ -#define GPS_NI_PRIVACY_OVERRIDE 0x0004 - -/** - * GPS NI responses, used to define the response in - * NI structures - */ -typedef int GpsUserResponseType; -#define GPS_NI_RESPONSE_ACCEPT 1 -#define GPS_NI_RESPONSE_DENY 2 -#define GPS_NI_RESPONSE_NORESP 3 - -/** - * NI data encoding scheme - */ -typedef int GpsNiEncodingType; -#define GPS_ENC_NONE 0 -#define GPS_ENC_SUPL_GSM_DEFAULT 1 -#define GPS_ENC_SUPL_UTF8 2 -#define GPS_ENC_SUPL_UCS2 3 -#define GPS_ENC_UNKNOWN -1 - -/** AGPS status event values. */ -typedef uint16_t AGpsStatusValue; -/** GPS requests data connection for AGPS. */ -#define GPS_REQUEST_AGPS_DATA_CONN 1 -/** GPS releases the AGPS data connection. */ -#define GPS_RELEASE_AGPS_DATA_CONN 2 -/** AGPS data connection initiated */ -#define GPS_AGPS_DATA_CONNECTED 3 -/** AGPS data connection completed */ -#define GPS_AGPS_DATA_CONN_DONE 4 -/** AGPS data connection failed */ -#define GPS_AGPS_DATA_CONN_FAILED 5 - -#define AGPS_REF_LOCATION_TYPE_GSM_CELLID 1 -#define AGPS_REF_LOCATION_TYPE_UMTS_CELLID 2 -#define AGPS_REG_LOCATION_TYPE_MAC 3 - -/** Network types for update_network_state "type" parameter */ -#define AGPS_RIL_NETWORK_TYPE_MOBILE 0 -#define AGPS_RIL_NETWORK_TYPE_WIFI 1 -#define AGPS_RIL_NETWORK_TYPE_MOBILE_MMS 2 -#define AGPS_RIL_NETWORK_TYPE_MOBILE_SUPL 3 -#define AGPS_RIL_NETWORK_TTYPE_MOBILE_DUN 4 -#define AGPS_RIL_NETWORK_TTYPE_MOBILE_HIPRI 5 -#define AGPS_RIL_NETWORK_TTYPE_WIMAX 6 - -/** - * Name for the GPS XTRA interface. - */ -#define GPS_XTRA_INTERFACE "gps-xtra" - -/** - * Name for the GPS DEBUG interface. - */ -#define GPS_DEBUG_INTERFACE "gps-debug" - -/** - * Name for the AGPS interface. - */ -#define AGPS_INTERFACE "agps" - -/** - * Name for NI interface - */ -#define GPS_NI_INTERFACE "gps-ni" - -/** - * Name for the AGPS-RIL interface. - */ -#define AGPS_RIL_INTERFACE "agps_ril" - -/** Represents a location. */ -typedef struct { - /** set to sizeof(GpsLocation) */ - size_t size; - /** Contains GpsLocationFlags bits. */ - uint16_t flags; - /** Represents latitude in degrees. */ - double latitude; - /** Represents longitude in degrees. */ - double longitude; - /** Represents altitude in meters above the WGS 84 reference - * ellipsoid. */ - double altitude; - /** Represents speed in meters per second. */ - float speed; - /** Represents heading in degrees. */ - float bearing; - /** Represents expected accuracy in meters. */ - float accuracy; - /** Timestamp for the location fix. */ - GpsUtcTime timestamp; -} GpsLocation; - -/** Represents the status. */ -typedef struct { - /** set to sizeof(GpsStatus) */ - size_t size; - GpsStatusValue status; -} GpsStatus; - -/** Represents SV information. */ -typedef struct { - /** set to sizeof(GpsSvInfo) */ - size_t size; - /** Pseudo-random number for the SV. */ - int prn; - /** Signal to noise ratio. */ - float snr; - /** Elevation of SV in degrees. */ - float elevation; - /** Azimuth of SV in degrees. */ - float azimuth; -} GpsSvInfo; - -/** Represents SV status. */ -typedef struct { - /** set to sizeof(GpsSvStatus) */ - size_t size; - - /** Number of SVs currently visible. */ - int num_svs; - - /** Contains an array of SV information. */ - GpsSvInfo sv_list[GPS_MAX_SVS]; - - /** Represents a bit mask indicating which SVs - * have ephemeris data. - */ - uint32_t ephemeris_mask; - - /** Represents a bit mask indicating which SVs - * have almanac data. - */ - uint32_t almanac_mask; - - /** - * Represents a bit mask indicating which SVs - * were used for computing the most recent position fix. - */ - uint32_t used_in_fix_mask; -} GpsSvStatus; - -/* 2G and 3G */ -/* In 3G lac is discarded */ -typedef struct { - uint16_t type; - uint16_t mcc; - uint16_t mnc; - uint16_t lac; - uint32_t cid; -} AGpsRefLocationCellID; - -typedef struct { - uint8_t mac[6]; -} AGpsRefLocationMac; - -/** Represents ref locations */ -typedef struct { - uint16_t type; - union { - AGpsRefLocationCellID cellID; - AGpsRefLocationMac mac; - } u; -} AGpsRefLocation; - -/** Callback with location information. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* gps_location_callback)(GpsLocation* location); - -/** Callback with status information. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* gps_status_callback)(GpsStatus* status); - -/** Callback with SV status information. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* gps_sv_status_callback)(GpsSvStatus* sv_info); - -/** Callback for reporting NMEA sentences. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* gps_nmea_callback)(GpsUtcTime timestamp, const char* nmea, int length); - -/** Callback to inform framework of the GPS engine's capabilities. - * Capability parameter is a bit field of GPS_CAPABILITY_* flags. - */ -typedef void (* gps_set_capabilities)(uint32_t capabilities); - -/** Callback utility for acquiring the GPS wakelock. - * This can be used to prevent the CPU from suspending while handling GPS events. - */ -typedef void (* gps_acquire_wakelock)(); - -/** Callback utility for releasing the GPS wakelock. */ -typedef void (* gps_release_wakelock)(); - -/** Callback for requesting NTP time */ -typedef void (* gps_request_utc_time)(); - -/** Callback for creating a thread that can call into the Java framework code. - * This must be used to create any threads that report events up to the framework. - */ -typedef pthread_t (* gps_create_thread)(const char* name, void (*start)(void *), void* arg); - -/** GPS callback structure. */ -typedef struct { - /** set to sizeof(GpsCallbacks) */ - size_t size; - gps_location_callback location_cb; - gps_status_callback status_cb; - gps_sv_status_callback sv_status_cb; - gps_nmea_callback nmea_cb; - gps_set_capabilities set_capabilities_cb; - gps_acquire_wakelock acquire_wakelock_cb; - gps_release_wakelock release_wakelock_cb; - gps_create_thread create_thread_cb; - gps_request_utc_time request_utc_time_cb; -} GpsCallbacks; - - -/** Represents the standard GPS interface. */ -typedef struct { - /** set to sizeof(GpsInterface) */ - size_t size; - /** - * Opens the interface and provides the callback routines - * to the implemenation of this interface. - */ - int (*init)( GpsCallbacks* callbacks ); - - /** Starts navigating. */ - int (*start)( void ); - - /** Stops navigating. */ - int (*stop)( void ); - - /** Closes the interface. */ - void (*cleanup)( void ); - - /** Injects the current time. */ - int (*inject_time)(GpsUtcTime time, int64_t timeReference, - int uncertainty); - - /** Injects current location from another location provider - * (typically cell ID). - * latitude and longitude are measured in degrees - * expected accuracy is measured in meters - */ - int (*inject_location)(double latitude, double longitude, float accuracy); - - /** - * Specifies that the next call to start will not use the - * information defined in the flags. GPS_DELETE_ALL is passed for - * a cold start. - */ - void (*delete_aiding_data)(GpsAidingData flags); - - /** - * min_interval represents the time between fixes in milliseconds. - * preferred_accuracy represents the requested fix accuracy in meters. - * preferred_time represents the requested time to first fix in milliseconds. - */ - int (*set_position_mode)(GpsPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time); - - /** Get a pointer to extension information. */ - const void* (*get_extension)(const char* name); -} GpsInterface; - -/** Callback to request the client to download XTRA data. - * The client should download XTRA data and inject it by calling inject_xtra_data(). - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* gps_xtra_download_request)(); - -/** Callback structure for the XTRA interface. */ -typedef struct { - gps_xtra_download_request download_request_cb; - gps_create_thread create_thread_cb; -} GpsXtraCallbacks; - -/** Extended interface for XTRA support. */ -typedef struct { - /** set to sizeof(GpsXtraInterface) */ - size_t size; - /** - * Opens the XTRA interface and provides the callback routines - * to the implemenation of this interface. - */ - int (*init)( GpsXtraCallbacks* callbacks ); - /** Injects XTRA data into the GPS. */ - int (*inject_xtra_data)( char* data, int length ); -} GpsXtraInterface; - -/** Extended interface for DEBUG support. */ -typedef struct { - /** set to sizeof(GpsDebugInterface) */ - size_t size; - - /** - * This function should return any information that the native - * implementation wishes to include in a bugreport. - */ - size_t (*get_internal_state)(char* buffer, size_t bufferSize); -} GpsDebugInterface; - -/** Represents the status of AGPS. */ -typedef struct { - /** set to sizeof(AGpsStatus) */ - size_t size; - - AGpsType type; - AGpsStatusValue status; - uint32_t ipaddr; -} AGpsStatus; - -/** Callback with AGPS status information. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* agps_status_callback)(AGpsStatus* status); - -/** Callback structure for the AGPS interface. */ -typedef struct { - agps_status_callback status_cb; - gps_create_thread create_thread_cb; -} AGpsCallbacks; - - -/** Extended interface for AGPS support. */ -typedef struct { - /** set to sizeof(AGpsInterface) */ - size_t size; - - /** - * Opens the AGPS interface and provides the callback routines - * to the implemenation of this interface. - */ - void (*init)( AGpsCallbacks* callbacks ); - /** - * Notifies that a data connection is available and sets - * the name of the APN to be used for SUPL. - */ - int (*data_conn_open)( const char* apn ); - /** - * Notifies that the AGPS data connection has been closed. - */ - int (*data_conn_closed)(); - /** - * Notifies that a data connection is not available for AGPS. - */ - int (*data_conn_failed)(); - /** - * Sets the hostname and port for the AGPS server. - */ - int (*set_server)( AGpsType type, const char* hostname, int port ); -} AGpsInterface; - - -/** Represents an NI request */ -typedef struct { - /** set to sizeof(GpsNiNotification) */ - size_t size; - - /** - * An ID generated by HAL to associate NI notifications and UI - * responses - */ - int notification_id; - - /** - * An NI type used to distinguish different categories of NI - * events, such as GPS_NI_TYPE_VOICE, GPS_NI_TYPE_UMTS_SUPL, ... - */ - GpsNiType ni_type; - - /** - * Notification/verification options, combinations of GpsNiNotifyFlags constants - */ - GpsNiNotifyFlags notify_flags; - - /** - * Timeout period to wait for user response. - * Set to 0 for no time out limit. - */ - int timeout; - - /** - * Default response when time out. - */ - GpsUserResponseType default_response; - - /** - * Requestor ID - */ - char requestor_id[GPS_NI_SHORT_STRING_MAXLEN]; - - /** - * Notification message. It can also be used to store client_id in some cases - */ - char text[GPS_NI_LONG_STRING_MAXLEN]; - - /** - * Client name decoding scheme - */ - GpsNiEncodingType requestor_id_encoding; - - /** - * Client name decoding scheme - */ - GpsNiEncodingType text_encoding; - - /** - * A pointer to extra data. Format: - * key_1 = value_1 - * key_2 = value_2 - */ - char extras[GPS_NI_LONG_STRING_MAXLEN]; - -} GpsNiNotification; - -/** Callback with NI notification. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (*gps_ni_notify_callback)(GpsNiNotification *notification); - -/** GPS NI callback structure. */ -typedef struct -{ - /** - * Sends the notification request from HAL to GPSLocationProvider. - */ - gps_ni_notify_callback notify_cb; - gps_create_thread create_thread_cb; -} GpsNiCallbacks; - -/** - * Extended interface for Network-initiated (NI) support. - */ -typedef struct -{ - /** set to sizeof(GpsNiInterface) */ - size_t size; - - /** Registers the callbacks for HAL to use. */ - void (*init) (GpsNiCallbacks *callbacks); - - /** Sends a response to HAL. */ - void (*respond) (int notif_id, GpsUserResponseType user_response); -} GpsNiInterface; - -struct gps_device_t { - struct hw_device_t common; - - /** - * Set the provided lights to the provided values. - * - * Returns: 0 on succes, error code on failure. - */ - const GpsInterface* (*get_gps_interface)(struct gps_device_t* dev); -}; - -#define AGPS_RIL_REQUEST_SETID_IMSI (1<<0L) -#define AGPS_RIL_REQUEST_SETID_MSISDN (1<<1L) - -#define AGPS_RIL_REQUEST_REFLOC_CELLID (1<<0L) -#define AGPS_RIL_REQUEST_REFLOC_MAC (1<<1L) - -typedef void (*agps_ril_request_set_id)(uint32_t flags); -typedef void (*agps_ril_request_ref_loc)(uint32_t flags); - -typedef struct { - agps_ril_request_set_id request_setid; - agps_ril_request_ref_loc request_refloc; - gps_create_thread create_thread_cb; -} AGpsRilCallbacks; - -/** Extended interface for AGPS_RIL support. */ -typedef struct { - /** set to sizeof(AGpsRilInterface) */ - size_t size; - /** - * Opens the AGPS interface and provides the callback routines - * to the implemenation of this interface. - */ - void (*init)( AGpsRilCallbacks* callbacks ); - - /** - * Sets the reference location. - */ - void (*set_ref_location) (const AGpsRefLocation *agps_reflocation, size_t sz_struct); - /** - * Sets the set ID. - */ - void (*set_set_id) (AGpsSetIDType type, const char* setid); - - /** - * Send network initiated message. - */ - void (*ni_message) (uint8_t *msg, size_t len); - - /** - * Notify GPS of network status changes. - * These parameters match values in the android.net.NetworkInfo class. - */ - void (*update_network_state) (int connected, int type, int roaming, const char* extra_info); - - /** - * Notify GPS of network status changes. - * These parameters match values in the android.net.NetworkInfo class. - */ - void (*update_network_availability) (int avaiable, const char* apn); -} AGpsRilInterface; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_HARDWARE_GPS_H */ - diff --git a/external/android/include/14/hardware/libhardware/include/hardware/gralloc.h b/external/android/include/14/hardware/libhardware/include/hardware/gralloc.h deleted file mode 100644 index 9daad1c..0000000 --- a/external/android/include/14/hardware/libhardware/include/hardware/gralloc.h +++ /dev/null @@ -1,259 +0,0 @@ -/* - * 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. - */ - - -#ifndef ANDROID_GRALLOC_INTERFACE_H -#define ANDROID_GRALLOC_INTERFACE_H - -#include -#include - -#include -#include -#include - -#include - -#include -#include - -__BEGIN_DECLS - -#define GRALLOC_API_VERSION 1 - -/** - * The id of this module - */ -#define GRALLOC_HARDWARE_MODULE_ID "gralloc" - -/** - * Name of the graphics device to open - */ - -#define GRALLOC_HARDWARE_GPU0 "gpu0" - -enum { - /* buffer is never read in software */ - GRALLOC_USAGE_SW_READ_NEVER = 0x00000000, - /* buffer is rarely read in software */ - GRALLOC_USAGE_SW_READ_RARELY = 0x00000002, - /* buffer is often read in software */ - GRALLOC_USAGE_SW_READ_OFTEN = 0x00000003, - /* mask for the software read values */ - GRALLOC_USAGE_SW_READ_MASK = 0x0000000F, - - /* buffer is never written in software */ - GRALLOC_USAGE_SW_WRITE_NEVER = 0x00000000, - /* buffer is never written in software */ - GRALLOC_USAGE_SW_WRITE_RARELY = 0x00000020, - /* buffer is never written in software */ - GRALLOC_USAGE_SW_WRITE_OFTEN = 0x00000030, - /* mask for the software write values */ - GRALLOC_USAGE_SW_WRITE_MASK = 0x000000F0, - - /* buffer will be used as an OpenGL ES texture */ - GRALLOC_USAGE_HW_TEXTURE = 0x00000100, - /* buffer will be used as an OpenGL ES render target */ - GRALLOC_USAGE_HW_RENDER = 0x00000200, - /* buffer will be used by the 2D hardware blitter */ - GRALLOC_USAGE_HW_2D = 0x00000400, - /* buffer will be used by the HWComposer HAL module */ - GRALLOC_USAGE_HW_COMPOSER = 0x00000800, - /* buffer will be used with the framebuffer device */ - GRALLOC_USAGE_HW_FB = 0x00001000, - /* mask for the software usage bit-mask */ - GRALLOC_USAGE_HW_MASK = 0x00001F00, - - /* buffer should be displayed full-screen on an external display when - * possible - */ - GRALLOC_USAGE_EXTERNAL_DISP = 0x00002000, - - /* Must have a hardware-protected path to external display sink for - * this buffer. If a hardware-protected path is not available, then - * either don't composite only this buffer (preferred) to the - * external sink, or (less desirable) do not route the entire - * composition to the external sink. - */ - GRALLOC_USAGE_PROTECTED = 0x00004000, - - /* implementation-specific private usage flags */ - GRALLOC_USAGE_PRIVATE_0 = 0x10000000, - GRALLOC_USAGE_PRIVATE_1 = 0x20000000, - GRALLOC_USAGE_PRIVATE_2 = 0x40000000, - GRALLOC_USAGE_PRIVATE_3 = 0x80000000, - GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000, -}; - -/*****************************************************************************/ - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -typedef struct gralloc_module_t { - struct hw_module_t common; - - /* - * (*registerBuffer)() must be called before a buffer_handle_t that has not - * been created with (*alloc_device_t::alloc)() can be used. - * - * This is intended to be used with buffer_handle_t's that have been - * received in this process through IPC. - * - * This function checks that the handle is indeed a valid one and prepares - * it for use with (*lock)() and (*unlock)(). - * - * It is not necessary to call (*registerBuffer)() on a handle created - * with (*alloc_device_t::alloc)(). - * - * returns an error if this buffer_handle_t is not valid. - */ - int (*registerBuffer)(struct gralloc_module_t const* module, - buffer_handle_t handle); - - /* - * (*unregisterBuffer)() is called once this handle is no longer needed in - * this process. After this call, it is an error to call (*lock)(), - * (*unlock)(), or (*registerBuffer)(). - * - * This function doesn't close or free the handle itself; this is done - * by other means, usually through libcutils's native_handle_close() and - * native_handle_free(). - * - * It is an error to call (*unregisterBuffer)() on a buffer that wasn't - * explicitly registered first. - */ - int (*unregisterBuffer)(struct gralloc_module_t const* module, - buffer_handle_t handle); - - /* - * The (*lock)() method is called before a buffer is accessed for the - * specified usage. This call may block, for instance if the h/w needs - * to finish rendering or if CPU caches need to be synchronized. - * - * The caller promises to modify only pixels in the area specified - * by (l,t,w,h). - * - * The content of the buffer outside of the specified area is NOT modified - * by this call. - * - * If usage specifies GRALLOC_USAGE_SW_*, vaddr is filled with the address - * of the buffer in virtual memory. - * - * THREADING CONSIDERATIONS: - * - * It is legal for several different threads to lock a buffer from - * read access, none of the threads are blocked. - * - * However, locking a buffer simultaneously for write or read/write is - * undefined, but: - * - shall not result in termination of the process - * - shall not block the caller - * It is acceptable to return an error or to leave the buffer's content - * into an indeterminate state. - * - * If the buffer was created with a usage mask incompatible with the - * requested usage flags here, -EINVAL is returned. - * - */ - - int (*lock)(struct gralloc_module_t const* module, - buffer_handle_t handle, int usage, - int l, int t, int w, int h, - void** vaddr); - - - /* - * The (*unlock)() method must be called after all changes to the buffer - * are completed. - */ - - int (*unlock)(struct gralloc_module_t const* module, - buffer_handle_t handle); - - - /* reserved for future use */ - int (*perform)(struct gralloc_module_t const* module, - int operation, ... ); - - /* reserved for future use */ - void* reserved_proc[7]; -} gralloc_module_t; - -/*****************************************************************************/ - -/** - * Every device data structure must begin with hw_device_t - * followed by module specific public methods and attributes. - */ - -typedef struct alloc_device_t { - struct hw_device_t common; - - /* - * (*alloc)() Allocates a buffer in graphic memory with the requested - * parameters and returns a buffer_handle_t and the stride in pixels to - * allow the implementation to satisfy hardware constraints on the width - * of a pixmap (eg: it may have to be multiple of 8 pixels). - * The CALLER TAKES OWNERSHIP of the buffer_handle_t. - * - * Returns 0 on success or -errno on error. - */ - - int (*alloc)(struct alloc_device_t* dev, - int w, int h, int format, int usage, - buffer_handle_t* handle, int* stride); - - /* - * (*free)() Frees a previously allocated buffer. - * Behavior is undefined if the buffer is still mapped in any process, - * but shall not result in termination of the program or security breaches - * (allowing a process to get access to another process' buffers). - * THIS FUNCTION TAKES OWNERSHIP of the buffer_handle_t which becomes - * invalid after the call. - * - * Returns 0 on success or -errno on error. - */ - int (*free)(struct alloc_device_t* dev, - buffer_handle_t handle); - - /* This hook is OPTIONAL. - * - * If non NULL it will be caused by SurfaceFlinger on dumpsys - */ - void (*dump)(struct alloc_device_t *dev, char *buff, int buff_len); - - void* reserved_proc[7]; -} alloc_device_t; - - -/** convenience API for opening and closing a supported device */ - -static inline int gralloc_open(const struct hw_module_t* module, - struct alloc_device_t** device) { - return module->methods->open(module, - GRALLOC_HARDWARE_GPU0, (struct hw_device_t**)device); -} - -static inline int gralloc_close(struct alloc_device_t* device) { - return device->common.close(&device->common); -} - -__END_DECLS - -#endif // ANDROID_ALLOC_INTERFACE_H diff --git a/external/android/include/14/hardware/libhardware/include/hardware/hardware.h b/external/android/include/14/hardware/libhardware/include/hardware/hardware.h deleted file mode 100644 index 7774b2b..0000000 --- a/external/android/include/14/hardware/libhardware/include/hardware/hardware.h +++ /dev/null @@ -1,139 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_INCLUDE_HARDWARE_HARDWARE_H -#define ANDROID_INCLUDE_HARDWARE_HARDWARE_H - -#include -#include - -#include -#include - -__BEGIN_DECLS - -/* - * Value for the hw_module_t.tag field - */ - -#define MAKE_TAG_CONSTANT(A,B,C,D) (((A) << 24) | ((B) << 16) | ((C) << 8) | (D)) - -#define HARDWARE_MODULE_TAG MAKE_TAG_CONSTANT('H', 'W', 'M', 'T') -#define HARDWARE_DEVICE_TAG MAKE_TAG_CONSTANT('H', 'W', 'D', 'T') - -struct hw_module_t; -struct hw_module_methods_t; -struct hw_device_t; - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -typedef struct hw_module_t { - /** tag must be initialized to HARDWARE_MODULE_TAG */ - uint32_t tag; - - /** major version number for the module */ - uint16_t version_major; - - /** minor version number of the module */ - uint16_t version_minor; - - /** Identifier of module */ - const char *id; - - /** Name of this module */ - const char *name; - - /** Author/owner/implementor of the module */ - const char *author; - - /** Modules methods */ - struct hw_module_methods_t* methods; - - /** module's dso */ - void* dso; - - /** padding to 128 bytes, reserved for future use */ - uint32_t reserved[32-7]; - -} hw_module_t; - -typedef struct hw_module_methods_t { - /** Open a specific device */ - int (*open)(const struct hw_module_t* module, const char* id, - struct hw_device_t** device); - -} hw_module_methods_t; - -/** - * Every device data structure must begin with hw_device_t - * followed by module specific public methods and attributes. - */ -typedef struct hw_device_t { - /** tag must be initialized to HARDWARE_DEVICE_TAG */ - uint32_t tag; - - /** version number for hw_device_t */ - uint32_t version; - - /** reference to the module this device belongs to */ - struct hw_module_t* module; - - /** padding reserved for future use */ - uint32_t reserved[12]; - - /** Close this device */ - int (*close)(struct hw_device_t* device); - -} hw_device_t; - -/** - * Name of the hal_module_info - */ -#define HAL_MODULE_INFO_SYM HMI - -/** - * Name of the hal_module_info as a string - */ -#define HAL_MODULE_INFO_SYM_AS_STR "HMI" - -/** - * Get the module info associated with a module by id. - * - * @return: 0 == success, <0 == error and *module == NULL - */ -int hw_get_module(const char *id, const struct hw_module_t **module); - -/** - * Get the module info associated with a module instance by class 'class_id' - * and instance 'inst'. - * - * Some modules types necessitate multiple instances. For example audio supports - * multiple concurrent interfaces and thus 'audio' is the module class - * and 'primary' or 'a2dp' are module interfaces. This implies that the files - * providing these modules would be named audio.primary..so and - * audio.a2dp..so - * - * @return: 0 == success, <0 == error and *module == NULL - */ -int hw_get_module_by_class(const char *class_id, const char *inst, - const struct hw_module_t **module); - -__END_DECLS - -#endif /* ANDROID_INCLUDE_HARDWARE_HARDWARE_H */ diff --git a/external/android/include/14/hardware/libhardware/include/hardware/hwcomposer.h b/external/android/include/14/hardware/libhardware/include/hardware/hwcomposer.h deleted file mode 100644 index 0fa3512..0000000 --- a/external/android/include/14/hardware/libhardware/include/hardware/hwcomposer.h +++ /dev/null @@ -1,344 +0,0 @@ -/* - * Copyright (C) 2010 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_INCLUDE_HARDWARE_HWCOMPOSER_H -#define ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_H - -#include -#include - -#include -#include -#include - -__BEGIN_DECLS - -/*****************************************************************************/ - -#define HWC_API_VERSION 1 - -/** - * The id of this module - */ -#define HWC_HARDWARE_MODULE_ID "hwcomposer" - -/** - * Name of the sensors device to open - */ -#define HWC_HARDWARE_COMPOSER "composer" - - -enum { - /* hwc_composer_device_t::set failed in EGL */ - HWC_EGL_ERROR = -1 -}; - -/* - * hwc_layer_t::hints values - * Hints are set by the HAL and read by SurfaceFlinger - */ -enum { - /* - * HWC can set the HWC_HINT_TRIPLE_BUFFER hint to indicate to SurfaceFlinger - * that it should triple buffer this layer. Typically HWC does this when - * the layer will be unavailable for use for an extended period of time, - * e.g. if the display will be fetching data directly from the layer and - * the layer can not be modified until after the next set(). - */ - HWC_HINT_TRIPLE_BUFFER = 0x00000001, - - /* - * HWC sets HWC_HINT_CLEAR_FB to tell SurfaceFlinger that it should clear the - * framebuffer with transparent pixels where this layer would be. - * SurfaceFlinger will only honor this flag when the layer has no blending - * - */ - HWC_HINT_CLEAR_FB = 0x00000002 -}; - -/* - * hwc_layer_t::flags values - * Flags are set by SurfaceFlinger and read by the HAL - */ -enum { - /* - * HWC_SKIP_LAYER is set by SurfaceFlnger to indicate that the HAL - * shall not consider this layer for composition as it will be handled - * by SurfaceFlinger (just as if compositionType was set to HWC_OVERLAY). - */ - HWC_SKIP_LAYER = 0x00000001, -}; - -/* - * hwc_layer_t::compositionType values - */ -enum { - /* this layer is to be drawn into the framebuffer by SurfaceFlinger */ - HWC_FRAMEBUFFER = 0, - - /* this layer will be handled in the HWC */ - HWC_OVERLAY = 1, -}; - -/* - * hwc_layer_t::blending values - */ -enum { - /* no blending */ - HWC_BLENDING_NONE = 0x0100, - - /* ONE / ONE_MINUS_SRC_ALPHA */ - HWC_BLENDING_PREMULT = 0x0105, - - /* SRC_ALPHA / ONE_MINUS_SRC_ALPHA */ - HWC_BLENDING_COVERAGE = 0x0405 -}; - -/* - * hwc_layer_t::transform values - */ -enum { - /* flip source image horizontally */ - HWC_TRANSFORM_FLIP_H = HAL_TRANSFORM_FLIP_H, - /* flip source image vertically */ - HWC_TRANSFORM_FLIP_V = HAL_TRANSFORM_FLIP_V, - /* rotate source image 90 degrees clock-wise */ - HWC_TRANSFORM_ROT_90 = HAL_TRANSFORM_ROT_90, - /* rotate source image 180 degrees */ - HWC_TRANSFORM_ROT_180 = HAL_TRANSFORM_ROT_180, - /* rotate source image 270 degrees clock-wise */ - HWC_TRANSFORM_ROT_270 = HAL_TRANSFORM_ROT_270, -}; - -typedef struct hwc_rect { - int left; - int top; - int right; - int bottom; -} hwc_rect_t; - -typedef struct hwc_region { - size_t numRects; - hwc_rect_t const* rects; -} hwc_region_t; - -typedef struct hwc_layer { - /* - * initially set to HWC_FRAMEBUFFER, indicates the layer will - * be drawn into the framebuffer using OpenGL ES. - * The HWC can toggle this value to HWC_OVERLAY, to indicate - * it will handle the layer. - */ - int32_t compositionType; - - /* see hwc_layer_t::hints above */ - uint32_t hints; - - /* see hwc_layer_t::flags above */ - uint32_t flags; - - /* handle of buffer to compose. this handle is guaranteed to have been - * allocated with gralloc */ - buffer_handle_t handle; - - /* transformation to apply to the buffer during composition */ - uint32_t transform; - - /* blending to apply during composition */ - int32_t blending; - - /* area of the source to consider, the origin is the top-left corner of - * the buffer */ - hwc_rect_t sourceCrop; - - /* where to composite the sourceCrop onto the display. The sourceCrop - * is scaled using linear filtering to the displayFrame. The origin is the - * top-left corner of the screen. - */ - hwc_rect_t displayFrame; - - /* visible region in screen space. The origin is the - * top-left corner of the screen. - * The visible region INCLUDES areas overlapped by a translucent layer. - */ - hwc_region_t visibleRegionScreen; -} hwc_layer_t; - - -/* - * hwc_layer_list_t::flags values - */ -enum { - /* - * HWC_GEOMETRY_CHANGED is set by SurfaceFlinger to indicate that the list - * passed to (*prepare)() has changed by more than just the buffer handles. - */ - HWC_GEOMETRY_CHANGED = 0x00000001, -}; - -/* - * List of layers. - * The handle members of hwLayers elements must be unique. - */ -typedef struct hwc_layer_list { - uint32_t flags; - size_t numHwLayers; - hwc_layer_t hwLayers[0]; -} hwc_layer_list_t; - -/* This represents a display, typically an EGLDisplay object */ -typedef void* hwc_display_t; - -/* This represents a surface, typically an EGLSurface object */ -typedef void* hwc_surface_t; - - -/* see hwc_composer_device::registerProcs() - * Any of the callbacks can be NULL, in which case the corresponding - * functionality is not supported. - */ -typedef struct hwc_procs { - /* - * (*invalidate)() triggers a screen refresh, in particular prepare and set - * will be called shortly after this call is made. Note that there is - * NO GUARANTEE that the screen refresh will happen after invalidate() - * returns (in particular, it could happen before). - * invalidate() is GUARANTEED TO NOT CALL BACK into the h/w composer HAL and - * it is safe to call invalidate() from any of hwc_composer_device - * hooks, unless noted otherwise. - */ - void (*invalidate)(struct hwc_procs* procs); -} hwc_procs_t; - - -/*****************************************************************************/ - -typedef struct hwc_module { - struct hw_module_t common; -} hwc_module_t; - - -typedef struct hwc_composer_device { - struct hw_device_t common; - - /* - * (*prepare)() is called for each frame before composition and is used by - * SurfaceFlinger to determine what composition steps the HWC can handle. - * - * (*prepare)() can be called more than once, the last call prevails. - * - * The HWC responds by setting the compositionType field to either - * HWC_FRAMEBUFFER or HWC_OVERLAY. In the former case, the composition for - * this layer is handled by SurfaceFlinger with OpenGL ES, in the later - * case, the HWC will have to handle this layer's composition. - * - * (*prepare)() is called with HWC_GEOMETRY_CHANGED to indicate that the - * list's geometry has changed, that is, when more than just the buffer's - * handles have been updated. Typically this happens (but is not limited to) - * when a window is added, removed, resized or moved. - * - * a NULL list parameter or a numHwLayers of zero indicates that the - * entire composition will be handled by SurfaceFlinger with OpenGL ES. - * - * returns: 0 on success. An negative error code on error. If an error is - * returned, SurfaceFlinger will assume that none of the layer will be - * handled by the HWC. - */ - int (*prepare)(struct hwc_composer_device *dev, hwc_layer_list_t* list); - - - /* - * (*set)() is used in place of eglSwapBuffers(), and assumes the same - * functionality, except it also commits the work list atomically with - * the actual eglSwapBuffers(). - * - * The list parameter is guaranteed to be the same as the one returned - * from the last call to (*prepare)(). - * - * When this call returns the caller assumes that: - * - * - the display will be updated in the near future with the content - * of the work list, without artifacts during the transition from the - * previous frame. - * - * - all objects are available for immediate access or destruction, in - * particular, hwc_region_t::rects data and hwc_layer_t::layer's buffer. - * Note that this means that immediately accessing (potentially from a - * different process) a buffer used in this call will not result in - * screen corruption, the driver must apply proper synchronization or - * scheduling (eg: block the caller, such as gralloc_module_t::lock(), - * OpenGL ES, Camera, Codecs, etc..., or schedule the caller's work - * after the buffer is freed from the actual composition). - * - * a NULL list parameter or a numHwLayers of zero indicates that the - * entire composition has been handled by SurfaceFlinger with OpenGL ES. - * In this case, (*set)() behaves just like eglSwapBuffers(). - * - * returns: 0 on success. An negative error code on error: - * HWC_EGL_ERROR: eglGetError() will provide the proper error code - * Another code for non EGL errors. - * - */ - int (*set)(struct hwc_composer_device *dev, - hwc_display_t dpy, - hwc_surface_t sur, - hwc_layer_list_t* list); - /* - * This hook is OPTIONAL. - * - * If non NULL it will be called by SurfaceFlinger on dumpsys - */ - void (*dump)(struct hwc_composer_device* dev, char *buff, int buff_len); - - /* - * This hook is OPTIONAL. - * - * (*registerProcs)() registers a set of callbacks the h/w composer HAL - * can later use. It is FORBIDDEN to call any of the callbacks from - * within registerProcs(). registerProcs() must save the hwc_procs_t pointer - * which is needed when calling a registered callback. - * Each call to registerProcs replaces the previous set of callbacks. - * registerProcs is called with NULL to unregister all callbacks. - * - * Any of the callbacks can be NULL, in which case the corresponding - * functionality is not supported. - */ - void (*registerProcs)(struct hwc_composer_device* dev, - hwc_procs_t const* procs); - - void* reserved_proc[6]; - -} hwc_composer_device_t; - - -/** convenience API for opening and closing a device */ - -static inline int hwc_open(const struct hw_module_t* module, - hwc_composer_device_t** device) { - return module->methods->open(module, - HWC_HARDWARE_COMPOSER, (struct hw_device_t**)device); -} - -static inline int hwc_close(hwc_composer_device_t* device) { - return device->common.close(&device->common); -} - - -/*****************************************************************************/ - -__END_DECLS - -#endif /* ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_H */ diff --git a/external/android/include/14/hardware/libhardware/include/hardware/lights.h b/external/android/include/14/hardware/libhardware/include/hardware/lights.h deleted file mode 100644 index 2cf5519..0000000 --- a/external/android/include/14/hardware/libhardware/include/hardware/lights.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_LIGHTS_INTERFACE_H -#define ANDROID_LIGHTS_INTERFACE_H - -#include -#include -#include - -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define LIGHTS_HARDWARE_MODULE_ID "lights" - -/* - * These light IDs correspond to logical lights, not physical. - * So for example, if your INDICATOR light is in line with your - * BUTTONS, it might make sense to also light the INDICATOR - * light to a reasonable color when the BUTTONS are lit. - */ -#define LIGHT_ID_BACKLIGHT "backlight" -#define LIGHT_ID_KEYBOARD "keyboard" -#define LIGHT_ID_BUTTONS "buttons" -#define LIGHT_ID_BATTERY "battery" -#define LIGHT_ID_NOTIFICATIONS "notifications" -#define LIGHT_ID_ATTENTION "attention" - -/* - * These lights aren't currently supported by the higher - * layers, but could be someday, so we have the constants - * here now. - */ -#define LIGHT_ID_BLUETOOTH "bluetooth" -#define LIGHT_ID_WIFI "wifi" - -/* ************************************************************************ - * Flash modes for the flashMode field of light_state_t. - */ - -#define LIGHT_FLASH_NONE 0 - -/** - * To flash the light at a given rate, set flashMode to LIGHT_FLASH_TIMED, - * and then flashOnMS should be set to the number of milliseconds to turn - * the light on, followed by the number of milliseconds to turn the light - * off. - */ -#define LIGHT_FLASH_TIMED 1 - -/** - * To flash the light using hardware assist, set flashMode to - * the hardware mode. - */ -#define LIGHT_FLASH_HARDWARE 2 - -/** - * Light brightness is managed by a user setting. - */ -#define BRIGHTNESS_MODE_USER 0 - -/** - * Light brightness is managed by a light sensor. - */ -#define BRIGHTNESS_MODE_SENSOR 1 - -/** - * The parameters that can be set for a given light. - * - * Not all lights must support all parameters. If you - * can do something backward-compatible, you should. - */ -struct light_state_t { - /** - * The color of the LED in ARGB. - * - * Do your best here. - * - If your light can only do red or green, if they ask for blue, - * you should do green. - * - If you can only do a brightness ramp, then use this formula: - * unsigned char brightness = ((77*((color>>16)&0x00ff)) - * + (150*((color>>8)&0x00ff)) + (29*(color&0x00ff))) >> 8; - * - If you can only do on or off, 0 is off, anything else is on. - * - * The high byte should be ignored. Callers will set it to 0xff (which - * would correspond to 255 alpha). - */ - unsigned int color; - - /** - * See the LIGHT_FLASH_* constants - */ - int flashMode; - int flashOnMS; - int flashOffMS; - - /** - * Policy used by the framework to manage the light's brightness. - * Currently the values are BRIGHTNESS_MODE_USER and BRIGHTNESS_MODE_SENSOR. - */ - int brightnessMode; -}; - -struct light_device_t { - struct hw_device_t common; - - /** - * Set the provided lights to the provided values. - * - * Returns: 0 on succes, error code on failure. - */ - int (*set_light)(struct light_device_t* dev, - struct light_state_t const* state); -}; - - -__END_DECLS - -#endif // ANDROID_LIGHTS_INTERFACE_H - diff --git a/external/android/include/14/hardware/libhardware/include/hardware/qemu_pipe.h b/external/android/include/14/hardware/libhardware/include/hardware/qemu_pipe.h deleted file mode 100644 index 1a67022..0000000 --- a/external/android/include/14/hardware/libhardware/include/hardware/qemu_pipe.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011 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_INCLUDE_HARDWARE_QEMU_PIPE_H -#define ANDROID_INCLUDE_HARDWARE_QEMU_PIPE_H - -#include -#include -#include -#include -#include /* for pthread_once() */ -#include -#include -#include - -#ifndef D -# define D(...) do{}while(0) -#endif - -/* Try to open a new Qemu fast-pipe. This function returns a file descriptor - * that can be used to communicate with a named service managed by the - * emulator. - * - * This file descriptor can be used as a standard pipe/socket descriptor. - * - * 'pipeName' is the name of the emulator service you want to connect to. - * E.g. 'opengles' or 'camera'. - * - * On success, return a valid file descriptor - * Returns -1 on error, and errno gives the error code, e.g.: - * - * EINVAL -> unknown/unsupported pipeName - * ENOSYS -> fast pipes not available in this system. - * - * ENOSYS should never happen, except if you're trying to run within a - * misconfigured emulator. - * - * You should be able to open several pipes to the same pipe service, - * except for a few special cases (e.g. GSM modem), where EBUSY will be - * returned if more than one client tries to connect to it. - */ -static __inline__ int -qemu_pipe_open(const char* pipeName) -{ - char buff[256]; - int buffLen; - int fd, ret; - - if (pipeName == NULL || pipeName[0] == '\0') { - errno = EINVAL; - return -1; - } - - snprintf(buff, sizeof buff, "pipe:%s", pipeName); - - fd = open("/dev/qemu_pipe", O_RDWR); - if (fd < 0) { - D("%s: Could not open /dev/qemu_pipe: %s", __FUNCTION__, strerror(errno)); - //errno = ENOSYS; - return -1; - } - - buffLen = strlen(buff); - - ret = TEMP_FAILURE_RETRY(write(fd, buff, buffLen+1)); - if (ret != buffLen+1) { - D("%s: Could not connect to %s pipe service: %s", __FUNCTION__, pipeName, strerror(errno)); - if (ret == 0) { - errno = ECONNRESET; - } else if (ret > 0) { - errno = EINVAL; - } - return -1; - } - - return fd; -} - -#endif /* ANDROID_INCLUDE_HARDWARE_QEMUD_PIPE_H */ diff --git a/external/android/include/14/hardware/libhardware/include/hardware/qemud.h b/external/android/include/14/hardware/libhardware/include/hardware/qemud.h deleted file mode 100644 index 5c39f9c..0000000 --- a/external/android/include/14/hardware/libhardware/include/hardware/qemud.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_INCLUDE_HARDWARE_QEMUD_H -#define ANDROID_INCLUDE_HARDWARE_QEMUD_H - -#include -#include "qemu_pipe.h" - -/* the following is helper code that is used by the QEMU-specific - * hardware HAL modules to communicate with the emulator program - * through the 'qemud' multiplexing daemon, or through the qemud - * pipe. - * - * see the documentation comments for details in - * development/emulator/qemud/qemud.c - * - * all definitions here are built into the HAL module to avoid - * having to write a tiny shared library for this. - */ - -/* we expect the D macro to be defined to a function macro - * that sends its formatted string argument(s) to the log. - * If not, ignore the traces. - */ -#ifndef D -# define D(...) ((void)0) -#endif - -static __inline__ int -qemud_fd_write(int fd, const void* buff, int len) -{ - int len2; - do { - len2 = write(fd, buff, len); - } while (len2 < 0 && errno == EINTR); - return len2; -} - -static __inline__ int -qemud_fd_read(int fd, void* buff, int len) -{ - int len2; - do { - len2 = read(fd, buff, len); - } while (len2 < 0 && errno == EINTR); - return len2; -} - -static __inline__ int -qemud_channel_open(const char* name) -{ - int fd; - int namelen = strlen(name); - char answer[2]; - char pipe_name[256]; - - /* First, try to connect to the pipe. */ - snprintf(pipe_name, sizeof(pipe_name), "qemud:%s", name); - fd = qemu_pipe_open(pipe_name); - if (fd < 0) { - D("QEMUD pipe is not available for %s: %s", name, strerror(errno)); - /* If pipe is not available, connect to qemud control socket */ - fd = socket_local_client( "qemud", - ANDROID_SOCKET_NAMESPACE_RESERVED, - SOCK_STREAM ); - if (fd < 0) { - D("no qemud control socket: %s", strerror(errno)); - return -1; - } - - /* send service name to connect */ - if (qemud_fd_write(fd, name, namelen) != namelen) { - D("can't send service name to qemud: %s", - strerror(errno)); - close(fd); - return -1; - } - - /* read answer from daemon */ - if (qemud_fd_read(fd, answer, 2) != 2 || - answer[0] != 'O' || answer[1] != 'K') { - D("cant' connect to %s service through qemud", name); - close(fd); - return -1; - } - } - return fd; -} - -static __inline__ int -qemud_channel_send(int fd, const void* msg, int msglen) -{ - char header[5]; - - if (msglen < 0) - msglen = strlen((const char*)msg); - - if (msglen == 0) - return 0; - - snprintf(header, sizeof header, "%04x", msglen); - if (qemud_fd_write(fd, header, 4) != 4) { - D("can't write qemud frame header: %s", strerror(errno)); - return -1; - } - - if (qemud_fd_write(fd, msg, msglen) != msglen) { - D("can4t write qemud frame payload: %s", strerror(errno)); - return -1; - } - return 0; -} - -static __inline__ int -qemud_channel_recv(int fd, void* msg, int msgsize) -{ - char header[5]; - int size, avail; - - if (qemud_fd_read(fd, header, 4) != 4) { - D("can't read qemud frame header: %s", strerror(errno)); - return -1; - } - header[4] = 0; - if (sscanf(header, "%04x", &size) != 1) { - D("malformed qemud frame header: '%.*s'", 4, header); - return -1; - } - if (size > msgsize) - return -1; - - if (qemud_fd_read(fd, msg, size) != size) { - D("can't read qemud frame payload: %s", strerror(errno)); - return -1; - } - return size; -} - -#endif /* ANDROID_INCLUDE_HARDWARE_QEMUD_H */ diff --git a/external/android/include/14/hardware/libhardware/include/hardware/sensors.h b/external/android/include/14/hardware/libhardware/include/hardware/sensors.h deleted file mode 100644 index 7819a71..0000000 --- a/external/android/include/14/hardware/libhardware/include/hardware/sensors.h +++ /dev/null @@ -1,489 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_SENSORS_INTERFACE_H -#define ANDROID_SENSORS_INTERFACE_H - -#include -#include -#include - -#include -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define SENSORS_HARDWARE_MODULE_ID "sensors" - -/** - * Name of the sensors device to open - */ -#define SENSORS_HARDWARE_POLL "poll" - -/** - * Handles must be higher than SENSORS_HANDLE_BASE and must be unique. - * A Handle identifies a given sensors. The handle is used to activate - * and/or deactivate sensors. - * In this version of the API there can only be 256 handles. - */ -#define SENSORS_HANDLE_BASE 0 -#define SENSORS_HANDLE_BITS 8 -#define SENSORS_HANDLE_COUNT (1<0 - * ^ - * | - * +-----------+--> y>0 - * | | - * | | - * | | - * | | / z<0 - * | | / - * | | / - * O-----------+/ - * |[] [ ] []/ - * +----------/+ y<0 - * / - * / - * |/ z>0 (toward the sky) - * - * O: Origin (x=0,y=0,z=0) - * - * - * Orientation - * ----------- - * - * All values are angles in degrees. - * - * Orientation sensors return sensor events for all 3 axes at a constant - * rate defined by setDelay(). - * - * azimuth: angle between the magnetic north direction and the Y axis, around - * the Z axis (0<=azimuth<360). - * 0=North, 90=East, 180=South, 270=West - * - * pitch: Rotation around X axis (-180<=pitch<=180), with positive values when - * the z-axis moves toward the y-axis. - * - * roll: Rotation around Y axis (-90<=roll<=90), with positive values when - * the x-axis moves towards the z-axis. - * - * Note: For historical reasons the roll angle is positive in the clockwise - * direction (mathematically speaking, it should be positive in the - * counter-clockwise direction): - * - * Z - * ^ - * (+roll) .--> | - * / | - * | | roll: rotation around Y axis - * X <-------(.) - * Y - * note that +Y == -roll - * - * - * - * Note: This definition is different from yaw, pitch and roll used in aviation - * where the X axis is along the long side of the plane (tail to nose). - * - * - * Acceleration - * ------------ - * - * All values are in SI units (m/s^2) and measure the acceleration of the - * device minus the force of gravity. - * - * Acceleration sensors return sensor events for all 3 axes at a constant - * rate defined by setDelay(). - * - * x: Acceleration minus Gx on the x-axis - * y: Acceleration minus Gy on the y-axis - * z: Acceleration minus Gz on the z-axis - * - * Examples: - * When the device lies flat on a table and is pushed on its left side - * toward the right, the x acceleration value is positive. - * - * When the device lies flat on a table, the acceleration value is +9.81, - * which correspond to the acceleration of the device (0 m/s^2) minus the - * force of gravity (-9.81 m/s^2). - * - * When the device lies flat on a table and is pushed toward the sky, the - * acceleration value is greater than +9.81, which correspond to the - * acceleration of the device (+A m/s^2) minus the force of - * gravity (-9.81 m/s^2). - * - * - * Magnetic Field - * -------------- - * - * All values are in micro-Tesla (uT) and measure the ambient magnetic - * field in the X, Y and Z axis. - * - * Magnetic Field sensors return sensor events for all 3 axes at a constant - * rate defined by setDelay(). - * - * Gyroscope - * --------- - * All values are in radians/second and measure the rate of rotation - * around the X, Y and Z axis. The coordinate system is the same as is - * used for the acceleration sensor. Rotation is positive in the - * counter-clockwise direction (right-hand rule). That is, an observer - * looking from some positive location on the x, y or z axis at a device - * positioned on the origin would report positive rotation if the device - * appeared to be rotating counter clockwise. Note that this is the - * standard mathematical definition of positive rotation and does not agree - * with the definition of roll given earlier. - * The range should at least be 17.45 rad/s (ie: ~1000 deg/s). - * - * Proximity - * --------- - * - * The distance value is measured in centimeters. Note that some proximity - * sensors only support a binary "close" or "far" measurement. In this case, - * the sensor should report its maxRange value in the "far" state and a value - * less than maxRange in the "near" state. - * - * Proximity sensors report a value only when it changes and each time the - * sensor is enabled. setDelay() is ignored. - * - * Light - * ----- - * - * The light sensor value is returned in SI lux units. - * - * Light sensors report a value only when it changes and each time the - * sensor is enabled. setDelay() is ignored. - * - * Pressure - * -------- - * - * The pressure sensor value is returned in hectopascal (hPa) - * - * Pressure sensors report events at a constant rate defined by setDelay(). - * - * Gyro - * -------- - * - * The gyroscope sensor values are returned in degrees per second (dps) - * - * Gyroscope sensor report events at a constant rate defined by setDelay(). - * - * Gravity - * ------- - * A gravity output indicates the direction of and magnitude of gravity in the devices's - * coordinates. On Earth, the magnitude is 9.8. Units are m/s^2. The coordinate system - * is the same as is used for the acceleration sensor. - * When the device is at rest, the output of the gravity sensor should be identical - * to that of the accelerometer. - * - * Linear Acceleration - * ------------------- - * Indicates the linear acceleration of the device in device coordinates, not including gravity. - * This output is essentially Acceleration - Gravity. Units are m/s^2. The coordinate system is - * the same as is used for the acceleration sensor. - * The output of the accelerometer, gravity and linear-acceleration sensors must obey the - * following relation: - * - * acceleration = gravity + linear-acceleration - * - * - * Rotation Vector - * --------------- - * A rotation vector represents the orientation of the device as a combination - * of an angle and an axis, in which the device has rotated through an angle - * theta around an axis . The three elements of the rotation vector - * are , such that the magnitude - * of the rotation vector is equal to sin(theta/2), and the direction of the - * rotation vector is equal to the direction of the axis of rotation. The three - * elements of the rotation vector are equal to the last three components of a - * unit quaternion . - * Elements of the rotation vector are unitless. The x, y, and z axis are defined - * in the same was as for the acceleration sensor. - * - * The reference coordinate system is defined as a direct orthonormal basis, - * where: - * - * - X is defined as the vector product Y.Z (It is tangential to - * the ground at the device's current location and roughly points East). - * - * - Y is tangential to the ground at the device's current location and - * points towards the magnetic North Pole. - * - * - Z points towards the sky and is perpendicular to the ground. - * - * - * The rotation-vector is stored as: - * - * sensors_event_t.data[0] = x*sin(theta/2) - * sensors_event_t.data[1] = y*sin(theta/2) - * sensors_event_t.data[2] = z*sin(theta/2) - * sensors_event_t.data[3] = cos(theta/2) - * - * - * Relative Humidity - * ----------------- - * - * A relative humidity sensor measures relative ambient air humidity and - * returns a value in percent. - * - * Relative humidity sensors report a value only when it changes and each - * time the sensor is enabled. setDelay() is ignored. - * - * - * Ambient Temperature - * ------------------- - * - * The ambient (room) temperature in degree Celsius. - * - * Temperature sensors report a value only when it changes and each time the - * sensor is enabled. setDelay() is ignored. - * - */ - -typedef struct { - union { - float v[3]; - struct { - float x; - float y; - float z; - }; - struct { - float azimuth; - float pitch; - float roll; - }; - }; - int8_t status; - uint8_t reserved[3]; -} sensors_vec_t; - -/** - * Union of the various types of sensor data - * that can be returned. - */ -typedef struct sensors_event_t { - /* must be sizeof(struct sensors_event_t) */ - int32_t version; - - /* sensor identifier */ - int32_t sensor; - - /* sensor type */ - int32_t type; - - /* reserved */ - int32_t reserved0; - - /* time is in nanosecond */ - int64_t timestamp; - - union { - float data[16]; - - /* acceleration values are in meter per second per second (m/s^2) */ - sensors_vec_t acceleration; - - /* magnetic vector values are in micro-Tesla (uT) */ - sensors_vec_t magnetic; - - /* orientation values are in degrees */ - sensors_vec_t orientation; - - /* gyroscope values are in rad/s */ - sensors_vec_t gyro; - - /* temperature is in degrees centigrade (Celsius) */ - float temperature; - - /* distance in centimeters */ - float distance; - - /* light in SI lux units */ - float light; - - /* pressure in hectopascal (hPa) */ - float pressure; - - /* relative humidity in percent */ - float relative_humidity; - }; - uint32_t reserved1[4]; -} sensors_event_t; - - - -struct sensor_t; - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -struct sensors_module_t { - struct hw_module_t common; - - /** - * Enumerate all available sensors. The list is returned in "list". - * @return number of sensors in the list - */ - int (*get_sensors_list)(struct sensors_module_t* module, - struct sensor_t const** list); -}; - -struct sensor_t { - /* name of this sensors */ - const char* name; - /* vendor of the hardware part */ - const char* vendor; - /* version of the hardware part + driver. The value of this field is - * left to the implementation and doesn't have to be monotonically - * increasing. - */ - int version; - /* handle that identifies this sensors. This handle is used to activate - * and deactivate this sensor. The value of the handle must be 8 bits - * in this version of the API. - */ - int handle; - /* this sensor's type. */ - int type; - /* maximaum range of this sensor's value in SI units */ - float maxRange; - /* smallest difference between two values reported by this sensor */ - float resolution; - /* rough estimate of this sensor's power consumption in mA */ - float power; - /* minimum delay allowed between events in microseconds. A value of zero - * means that this sensor doesn't report events at a constant rate, but - * rather only when a new data is available */ - int32_t minDelay; - /* reserved fields, must be zero */ - void* reserved[8]; -}; - - -/** - * Every device data structure must begin with hw_device_t - * followed by module specific public methods and attributes. - */ -struct sensors_poll_device_t { - struct hw_device_t common; - - /** Activate/deactivate one sensor. - * - * @param handle is the handle of the sensor to change. - * @param enabled set to 1 to enable, or 0 to disable the sensor. - * - * @return 0 on success, negative errno code otherwise - */ - int (*activate)(struct sensors_poll_device_t *dev, - int handle, int enabled); - - /** - * Set the delay between sensor events in nanoseconds for a given sensor. - * It is an error to set a delay inferior to the value defined by - * sensor_t::minDelay. If sensor_t::minDelay is zero, setDelay() is - * ignored and returns 0. - * - * @return 0 if successful, < 0 on error - */ - int (*setDelay)(struct sensors_poll_device_t *dev, - int handle, int64_t ns); - - /** - * Returns an array of sensor data. - * This function must block until events are available. - * - * @return the number of events read on success, or -errno in case of an error. - * This function should never return 0 (no event). - * - */ - int (*poll)(struct sensors_poll_device_t *dev, - sensors_event_t* data, int count); -}; - -/** convenience API for opening and closing a device */ - -static inline int sensors_open(const struct hw_module_t* module, - struct sensors_poll_device_t** device) { - return module->methods->open(module, - SENSORS_HARDWARE_POLL, (struct hw_device_t**)device); -} - -static inline int sensors_close(struct sensors_poll_device_t* device) { - return device->common.close(&device->common); -} - -__END_DECLS - -#endif // ANDROID_SENSORS_INTERFACE_H diff --git a/external/android/include/14/system/core/include/cutils/abort_socket.h b/external/android/include/14/system/core/include/cutils/abort_socket.h deleted file mode 100644 index fbb1112..0000000 --- a/external/android/include/14/system/core/include/cutils/abort_socket.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 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. - */ - -/* Helper to perform abortable blocking operations on a socket: - * asocket_connect() - * asocket_accept() - * asocket_read() - * asocket_write() - * These calls are similar to the regular syscalls, but can be aborted with: - * asocket_abort() - * - * Calling close() on a regular POSIX socket does not abort blocked syscalls on - * that socket in other threads. - * - * After calling asocket_abort() the socket cannot be reused. - * - * Call asocket_destory() *after* all threads have finished with the socket to - * finish closing the socket and free the asocket structure. - * - * The helper is implemented by setting the socket non-blocking to initiate - * syscalls connect(), accept(), read(), write(), then using a blocking poll() - * on both the primary socket and a local pipe. This makes the poll() abortable - * by writing a byte to the local pipe in asocket_abort(). - * - * asocket_create() sets the fd to non-blocking mode. It must not be changed to - * blocking mode. - * - * Using asocket will triple the number of file descriptors required per - * socket, due to the local pipe. It may be possible to use a global pipe per - * process rather than per socket, but we have not been able to come up with a - * race-free implementation yet. - * - * All functions except asocket_init() and asocket_destroy() are thread safe. - */ - -#include -#include - -#ifndef __CUTILS_ABORT_SOCKET_H__ -#define __CUTILS_ABORT_SOCKET_H__ -#ifdef __cplusplus -extern "C" { -#endif - -struct asocket { - int fd; /* primary socket fd */ - int abort_fd[2]; /* pipe used to abort */ -}; - -/* Create an asocket from fd. - * Sets the socket to non-blocking mode. - * Returns NULL on error with errno set. - */ -struct asocket *asocket_init(int fd); - -/* Blocking socket I/O with timeout. - * Calling asocket_abort() from another thread will cause each of these - * functions to immediately return with value -1 and errno ECANCELED. - * timeout is in ms, use -1 to indicate no timeout. On timeout -1 is returned - * with errno ETIMEDOUT. - * EINTR is handled in-call. - * Other semantics are identical to the regular syscalls. - */ -int asocket_connect(struct asocket *s, const struct sockaddr *addr, - socklen_t addrlen, int timeout); - -int asocket_accept(struct asocket *s, struct sockaddr *addr, - socklen_t *addrlen, int timeout); - -int asocket_read(struct asocket *s, void *buf, size_t count, int timeout); - -int asocket_write(struct asocket *s, const void *buf, size_t count, - int timeout); - -/* Abort above calls and shutdown socket. - * Further I/O operations on this socket will immediately fail after this call. - * asocket_destroy() should be used to release resources once all threads - * have returned from blocking calls on the socket. - */ -void asocket_abort(struct asocket *s); - -/* Close socket and free asocket structure. - * Must not be called until all calls on this structure have completed. - */ -void asocket_destroy(struct asocket *s); - -#ifdef __cplusplus -} -#endif -#endif //__CUTILS_ABORT_SOCKET__H__ diff --git a/external/android/include/14/system/core/include/cutils/android_reboot.h b/external/android/include/14/system/core/include/cutils/android_reboot.h deleted file mode 100644 index 0c79be7..0000000 --- a/external/android/include/14/system/core/include/cutils/android_reboot.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2011, 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 __CUTILS_ANDROID_REBOOT_H__ -#define __CUTILS_ANDROID_REBOOT_H__ - -__BEGIN_DECLS - -/* Commands */ -#define ANDROID_RB_RESTART 0xDEAD0001 -#define ANDROID_RB_POWEROFF 0xDEAD0002 -#define ANDROID_RB_RESTART2 0xDEAD0003 - -/* Flags */ -#define ANDROID_RB_FLAG_NO_SYNC 0x1 -#define ANDROID_RB_FLAG_NO_REMOUNT_RO 0x2 - -int android_reboot(int cmd, int flags, char *arg); - -__END_DECLS - -#endif /* __CUTILS_ANDROID_REBOOT_H__ */ diff --git a/external/android/include/14/system/core/include/cutils/array.h b/external/android/include/14/system/core/include/cutils/array.h deleted file mode 100644 index c97ff34..0000000 --- a/external/android/include/14/system/core/include/cutils/array.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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. - */ - -/** - * A pointer array which intelligently expands its capacity ad needed. - */ - -#ifndef __ARRAY_H -#define __ARRAY_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -/** An array. */ -typedef struct Array Array; - -/** Constructs a new array. Returns NULL if we ran out of memory. */ -Array* arrayCreate(); - -/** Frees an array. Does not free elements themselves. */ -void arrayFree(Array* array); - -/** Adds a pointer. Returns 0 is successful, < 0 otherwise. */ -int arrayAdd(Array* array, void* pointer); - -/** Gets the pointer at the specified index. */ -void* arrayGet(Array* array, int index); - -/** Removes the pointer at the given index and returns it. */ -void* arrayRemove(Array* array, int index); - -/** Sets pointer at the given index. Returns old pointer. */ -void* arraySet(Array* array, int index, void* pointer); - -/** Sets the array size. Sets new pointers to NULL. Returns 0 if successful, < 0 otherwise . */ -int arraySetSize(Array* array, int size); - -/** Returns the size of the given array. */ -int arraySize(Array* array); - -/** - * Returns a pointer to a C-style array which will be valid until this array - * changes. - */ -const void** arrayUnwrap(Array* array); - -#ifdef __cplusplus -} -#endif - -#endif /* __ARRAY_H */ diff --git a/external/android/include/14/system/core/include/cutils/ashmem.h b/external/android/include/14/system/core/include/cutils/ashmem.h deleted file mode 100644 index 25b233e..0000000 --- a/external/android/include/14/system/core/include/cutils/ashmem.h +++ /dev/null @@ -1,45 +0,0 @@ -/* cutils/ashmem.h - ** - ** Copyright 2008 The Android Open Source Project - ** - ** This file is dual licensed. It may be redistributed and/or modified - ** under the terms of the Apache 2.0 License OR version 2 of the GNU - ** General Public License. - */ - -#ifndef _CUTILS_ASHMEM_H -#define _CUTILS_ASHMEM_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -int ashmem_create_region(const char *name, size_t size); -int ashmem_set_prot_region(int fd, int prot); -int ashmem_pin_region(int fd, size_t offset, size_t len); -int ashmem_unpin_region(int fd, size_t offset, size_t len); -int ashmem_get_size_region(int fd); - -#ifdef __cplusplus -} -#endif - -#ifndef __ASHMEMIOC /* in case someone included too */ - -#define ASHMEM_NAME_LEN 256 - -#define ASHMEM_NAME_DEF "dev/ashmem" - -/* Return values from ASHMEM_PIN: Was the mapping purged while unpinned? */ -#define ASHMEM_NOT_PURGED 0 -#define ASHMEM_WAS_PURGED 1 - -/* Return values from ASHMEM_UNPIN: Is the mapping now pinned or unpinned? */ -#define ASHMEM_IS_UNPINNED 0 -#define ASHMEM_IS_PINNED 1 - -#endif /* ! __ASHMEMIOC */ - -#endif /* _CUTILS_ASHMEM_H */ diff --git a/external/android/include/14/system/core/include/cutils/atomic-arm.h b/external/android/include/14/system/core/include/cutils/atomic-arm.h deleted file mode 100644 index 16fe512..0000000 --- a/external/android/include/14/system/core/include/cutils/atomic-arm.h +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Copyright (C) 2010 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_CUTILS_ATOMIC_ARM_H -#define ANDROID_CUTILS_ATOMIC_ARM_H - -#include -#include - -extern inline void android_compiler_barrier(void) -{ - __asm__ __volatile__ ("" : : : "memory"); -} - -#if ANDROID_SMP == 0 -extern inline void android_memory_barrier(void) -{ - android_compiler_barrier(); -} -extern inline void android_memory_store_barrier(void) -{ - android_compiler_barrier(); -} -#elif defined(__ARM_HAVE_DMB) -extern inline void android_memory_barrier(void) -{ - __asm__ __volatile__ ("dmb" : : : "memory"); -} -extern inline void android_memory_store_barrier(void) -{ - __asm__ __volatile__ ("dmb st" : : : "memory"); -} -#elif defined(__ARM_HAVE_LDREX_STREX) -extern inline void android_memory_barrier(void) -{ - __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory"); -} -extern inline void android_memory_store_barrier(void) -{ - android_memory_barrier(); -} -#else -extern inline void android_memory_barrier(void) -{ - typedef void (kuser_memory_barrier)(void); - (*(kuser_memory_barrier *)0xffff0fa0)(); -} -extern inline void android_memory_store_barrier(void) -{ - android_memory_barrier(); -} -#endif - -extern inline int32_t android_atomic_acquire_load(volatile const int32_t *ptr) -{ - int32_t value = *ptr; - android_memory_barrier(); - return value; -} - -extern inline int32_t android_atomic_release_load(volatile const int32_t *ptr) -{ - android_memory_barrier(); - return *ptr; -} - -extern inline void android_atomic_acquire_store(int32_t value, - volatile int32_t *ptr) -{ - *ptr = value; - android_memory_barrier(); -} - -extern inline void android_atomic_release_store(int32_t value, - volatile int32_t *ptr) -{ - android_memory_barrier(); - *ptr = value; -} - -#if defined(__thumb__) -extern int android_atomic_cas(int32_t old_value, int32_t new_value, - volatile int32_t *ptr); -#elif defined(__ARM_HAVE_LDREX_STREX) -extern inline int android_atomic_cas(int32_t old_value, int32_t new_value, - volatile int32_t *ptr) -{ - int32_t prev, status; - do { - __asm__ __volatile__ ("ldrex %0, [%3]\n" - "mov %1, #0\n" - "teq %0, %4\n" - "strexeq %1, %5, [%3]" - : "=&r" (prev), "=&r" (status), "+m"(*ptr) - : "r" (ptr), "Ir" (old_value), "r" (new_value) - : "cc"); - } while (__builtin_expect(status != 0, 0)); - return prev != old_value; -} -#else -extern inline int android_atomic_cas(int32_t old_value, int32_t new_value, - volatile int32_t *ptr) -{ - typedef int (kuser_cmpxchg)(int32_t, int32_t, volatile int32_t *); - int32_t prev, status; - prev = *ptr; - do { - status = (*(kuser_cmpxchg *)0xffff0fc0)(old_value, new_value, ptr); - if (__builtin_expect(status == 0, 1)) - return 0; - prev = *ptr; - } while (prev == old_value); - return 1; -} -#endif - -extern inline int android_atomic_acquire_cas(int32_t old_value, - int32_t new_value, - volatile int32_t *ptr) -{ - int status = android_atomic_cas(old_value, new_value, ptr); - android_memory_barrier(); - return status; -} - -extern inline int android_atomic_release_cas(int32_t old_value, - int32_t new_value, - volatile int32_t *ptr) -{ - android_memory_barrier(); - return android_atomic_cas(old_value, new_value, ptr); -} - - -#if defined(__thumb__) -extern int32_t android_atomic_add(int32_t increment, - volatile int32_t *ptr); -#elif defined(__ARM_HAVE_LDREX_STREX) -extern inline int32_t android_atomic_add(int32_t increment, - volatile int32_t *ptr) -{ - int32_t prev, tmp, status; - android_memory_barrier(); - do { - __asm__ __volatile__ ("ldrex %0, [%4]\n" - "add %1, %0, %5\n" - "strex %2, %1, [%4]" - : "=&r" (prev), "=&r" (tmp), - "=&r" (status), "+m" (*ptr) - : "r" (ptr), "Ir" (increment) - : "cc"); - } while (__builtin_expect(status != 0, 0)); - return prev; -} -#else -extern inline int32_t android_atomic_add(int32_t increment, - volatile int32_t *ptr) -{ - int32_t prev, status; - android_memory_barrier(); - do { - prev = *ptr; - status = android_atomic_cas(prev, prev + increment, ptr); - } while (__builtin_expect(status != 0, 0)); - return prev; -} -#endif - -extern inline int32_t android_atomic_inc(volatile int32_t *addr) -{ - return android_atomic_add(1, addr); -} - -extern inline int32_t android_atomic_dec(volatile int32_t *addr) -{ - return android_atomic_add(-1, addr); -} - -#if defined(__thumb__) -extern int32_t android_atomic_and(int32_t value, volatile int32_t *ptr); -#elif defined(__ARM_HAVE_LDREX_STREX) -extern inline int32_t android_atomic_and(int32_t value, volatile int32_t *ptr) -{ - int32_t prev, tmp, status; - android_memory_barrier(); - do { - __asm__ __volatile__ ("ldrex %0, [%4]\n" - "and %1, %0, %5\n" - "strex %2, %1, [%4]" - : "=&r" (prev), "=&r" (tmp), - "=&r" (status), "+m" (*ptr) - : "r" (ptr), "Ir" (value) - : "cc"); - } while (__builtin_expect(status != 0, 0)); - return prev; -} -#else -extern inline int32_t android_atomic_and(int32_t value, volatile int32_t *ptr) -{ - int32_t prev, status; - android_memory_barrier(); - do { - prev = *ptr; - status = android_atomic_cas(prev, prev & value, ptr); - } while (__builtin_expect(status != 0, 0)); - return prev; -} -#endif - -#if defined(__thumb__) -extern int32_t android_atomic_or(int32_t value, volatile int32_t *ptr); -#elif defined(__ARM_HAVE_LDREX_STREX) -extern inline int32_t android_atomic_or(int32_t value, volatile int32_t *ptr) -{ - int32_t prev, tmp, status; - android_memory_barrier(); - do { - __asm__ __volatile__ ("ldrex %0, [%4]\n" - "orr %1, %0, %5\n" - "strex %2, %1, [%4]" - : "=&r" (prev), "=&r" (tmp), - "=&r" (status), "+m" (*ptr) - : "r" (ptr), "Ir" (value) - : "cc"); - } while (__builtin_expect(status != 0, 0)); - return prev; -} -#else -extern inline int32_t android_atomic_or(int32_t value, volatile int32_t *ptr) -{ - int32_t prev, status; - android_memory_barrier(); - do { - prev = *ptr; - status = android_atomic_cas(prev, prev | value, ptr); - } while (__builtin_expect(status != 0, 0)); - return prev; -} -#endif - -#endif /* ANDROID_CUTILS_ATOMIC_ARM_H */ diff --git a/external/android/include/14/system/core/include/cutils/atomic-inline.h b/external/android/include/14/system/core/include/cutils/atomic-inline.h deleted file mode 100644 index 49f3e70..0000000 --- a/external/android/include/14/system/core/include/cutils/atomic-inline.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2010 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_CUTILS_ATOMIC_INLINE_H -#define ANDROID_CUTILS_ATOMIC_INLINE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Inline declarations and macros for some special-purpose atomic - * operations. These are intended for rare circumstances where a - * memory barrier needs to be issued inline rather than as a function - * call. - * - * Most code should not use these. - * - * Anything that does include this file must set ANDROID_SMP to either - * 0 or 1, indicating compilation for UP or SMP, respectively. - * - * Macros defined in this header: - * - * void ANDROID_MEMBAR_FULL(void) - * Full memory barrier. Provides a compiler reordering barrier, and - * on SMP systems emits an appropriate instruction. - */ - -#if !defined(ANDROID_SMP) -# error "Must define ANDROID_SMP before including atomic-inline.h" -#endif - -#if defined(__arm__) -#include -#elif defined(__i386__) || defined(__x86_64__) -#include -#elif defined(__sh__) -/* implementation is in atomic-android-sh.c */ -#else -#error atomic operations are unsupported -#endif - -#if ANDROID_SMP == 0 -#define ANDROID_MEMBAR_FULL android_compiler_barrier -#else -#define ANDROID_MEMBAR_FULL android_memory_barrier -#endif - -#if ANDROID_SMP == 0 -#define ANDROID_MEMBAR_STORE android_compiler_barrier -#else -#define ANDROID_MEMBAR_STORE android_memory_store_barrier -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* ANDROID_CUTILS_ATOMIC_INLINE_H */ diff --git a/external/android/include/14/system/core/include/cutils/atomic-x86.h b/external/android/include/14/system/core/include/cutils/atomic-x86.h deleted file mode 100644 index 438012e..0000000 --- a/external/android/include/14/system/core/include/cutils/atomic-x86.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (C) 2010 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_CUTILS_ATOMIC_X86_H -#define ANDROID_CUTILS_ATOMIC_X86_H - -#include - -extern inline void android_compiler_barrier(void) -{ - __asm__ __volatile__ ("" : : : "memory"); -} - -#if ANDROID_SMP == 0 -extern inline void android_memory_barrier(void) -{ - android_compiler_barrier(); -} -extern inline void android_memory_store_barrier(void) -{ - android_compiler_barrier(); -} -#else -extern inline void android_memory_barrier(void) -{ - __asm__ __volatile__ ("mfence" : : : "memory"); -} -extern inline void android_memory_store_barrier(void) -{ - android_compiler_barrier(); -} -#endif - -extern inline int32_t android_atomic_acquire_load(volatile const int32_t *ptr) -{ - int32_t value = *ptr; - android_compiler_barrier(); - return value; -} - -extern inline int32_t android_atomic_release_load(volatile const int32_t *ptr) -{ - android_memory_barrier(); - return *ptr; -} - -extern inline void android_atomic_acquire_store(int32_t value, - volatile int32_t *ptr) -{ - *ptr = value; - android_memory_barrier(); -} - -extern inline void android_atomic_release_store(int32_t value, - volatile int32_t *ptr) -{ - android_compiler_barrier(); - *ptr = value; -} - -extern inline int android_atomic_cas(int32_t old_value, int32_t new_value, - volatile int32_t *ptr) -{ - int32_t prev; - __asm__ __volatile__ ("lock; cmpxchgl %1, %2" - : "=a" (prev) - : "q" (new_value), "m" (*ptr), "0" (old_value) - : "memory"); - return prev != old_value; -} - -extern inline int android_atomic_acquire_cas(int32_t old_value, - int32_t new_value, - volatile int32_t *ptr) -{ - /* Loads are not reordered with other loads. */ - return android_atomic_cas(old_value, new_value, ptr); -} - -extern inline int android_atomic_release_cas(int32_t old_value, - int32_t new_value, - volatile int32_t *ptr) -{ - /* Stores are not reordered with other stores. */ - return android_atomic_cas(old_value, new_value, ptr); -} - -extern inline int32_t android_atomic_add(int32_t increment, - volatile int32_t *ptr) -{ - __asm__ __volatile__ ("lock; xaddl %0, %1" - : "+r" (increment), "+m" (*ptr) - : : "memory"); - /* increment now holds the old value of *ptr */ - return increment; -} - -extern inline int32_t android_atomic_inc(volatile int32_t *addr) -{ - return android_atomic_add(1, addr); -} - -extern inline int32_t android_atomic_dec(volatile int32_t *addr) -{ - return android_atomic_add(-1, addr); -} - -extern inline int32_t android_atomic_and(int32_t value, - volatile int32_t *ptr) -{ - int32_t prev, status; - do { - prev = *ptr; - status = android_atomic_cas(prev, prev & value, ptr); - } while (__builtin_expect(status != 0, 0)); - return prev; -} - -extern inline int32_t android_atomic_or(int32_t value, volatile int32_t *ptr) -{ - int32_t prev, status; - do { - prev = *ptr; - status = android_atomic_cas(prev, prev | value, ptr); - } while (__builtin_expect(status != 0, 0)); - return prev; -} - -#endif /* ANDROID_CUTILS_ATOMIC_X86_H */ diff --git a/external/android/include/14/system/core/include/cutils/atomic.h b/external/android/include/14/system/core/include/cutils/atomic.h deleted file mode 100644 index ae42eb8..0000000 --- a/external/android/include/14/system/core/include/cutils/atomic.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * 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_CUTILS_ATOMIC_H -#define ANDROID_CUTILS_ATOMIC_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * A handful of basic atomic operations. The appropriate pthread - * functions should be used instead of these whenever possible. - * - * The "acquire" and "release" terms can be defined intuitively in terms - * of the placement of memory barriers in a simple lock implementation: - * - wait until compare-and-swap(lock-is-free --> lock-is-held) succeeds - * - barrier - * - [do work] - * - barrier - * - store(lock-is-free) - * In very crude terms, the initial (acquire) barrier prevents any of the - * "work" from happening before the lock is held, and the later (release) - * barrier ensures that all of the work happens before the lock is released. - * (Think of cached writes, cache read-ahead, and instruction reordering - * around the CAS and store instructions.) - * - * The barriers must apply to both the compiler and the CPU. Note it is - * legal for instructions that occur before an "acquire" barrier to be - * moved down below it, and for instructions that occur after a "release" - * barrier to be moved up above it. - * - * The ARM-driven implementation we use here is short on subtlety, - * and actually requests a full barrier from the compiler and the CPU. - * The only difference between acquire and release is in whether they - * are issued before or after the atomic operation with which they - * are associated. To ease the transition to C/C++ atomic intrinsics, - * you should not rely on this, and instead assume that only the minimal - * acquire/release protection is provided. - * - * NOTE: all int32_t* values are expected to be aligned on 32-bit boundaries. - * If they are not, atomicity is not guaranteed. - */ - -/* - * Basic arithmetic and bitwise operations. These all provide a - * barrier with "release" ordering, and return the previous value. - * - * These have the same characteristics (e.g. what happens on overflow) - * as the equivalent non-atomic C operations. - */ -int32_t android_atomic_inc(volatile int32_t* addr); -int32_t android_atomic_dec(volatile int32_t* addr); -int32_t android_atomic_add(int32_t value, volatile int32_t* addr); -int32_t android_atomic_and(int32_t value, volatile int32_t* addr); -int32_t android_atomic_or(int32_t value, volatile int32_t* addr); - -/* - * Perform an atomic load with "acquire" or "release" ordering. - * - * This is only necessary if you need the memory barrier. A 32-bit read - * from a 32-bit aligned address is atomic on all supported platforms. - */ -int32_t android_atomic_acquire_load(volatile const int32_t* addr); -int32_t android_atomic_release_load(volatile const int32_t* addr); - -/* - * Perform an atomic store with "acquire" or "release" ordering. - * - * This is only necessary if you need the memory barrier. A 32-bit write - * to a 32-bit aligned address is atomic on all supported platforms. - */ -void android_atomic_acquire_store(int32_t value, volatile int32_t* addr); -void android_atomic_release_store(int32_t value, volatile int32_t* addr); - -/* - * Compare-and-set operation with "acquire" or "release" ordering. - * - * This returns zero if the new value was successfully stored, which will - * only happen when *addr == oldvalue. - * - * (The return value is inverted from implementations on other platforms, - * but matches the ARM ldrex/strex result.) - * - * Implementations that use the release CAS in a loop may be less efficient - * than possible, because we re-issue the memory barrier on each iteration. - */ -int android_atomic_acquire_cas(int32_t oldvalue, int32_t newvalue, - volatile int32_t* addr); -int android_atomic_release_cas(int32_t oldvalue, int32_t newvalue, - volatile int32_t* addr); - -/* - * Aliases for code using an older version of this header. These are now - * deprecated and should not be used. The definitions will be removed - * in a future release. - */ -#define android_atomic_write android_atomic_release_store -#define android_atomic_cmpxchg android_atomic_release_cas - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // ANDROID_CUTILS_ATOMIC_H diff --git a/external/android/include/14/system/core/include/cutils/bitops.h b/external/android/include/14/system/core/include/cutils/bitops.h deleted file mode 100644 index 1b3b762..0000000 --- a/external/android/include/14/system/core/include/cutils/bitops.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2011 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 __CUTILS_BITOPS_H -#define __CUTILS_BITOPS_H - -#include - -__BEGIN_DECLS - -static inline int popcount(unsigned int x) -{ - return __builtin_popcount(x); -} - -static inline int popcountl(unsigned long x) -{ - return __builtin_popcountl(x); -} - -static inline int popcountll(unsigned long long x) -{ - return __builtin_popcountll(x); -} - -__END_DECLS - -#endif /* __CUTILS_BITOPS_H */ diff --git a/external/android/include/14/system/core/include/cutils/compiler.h b/external/android/include/14/system/core/include/cutils/compiler.h deleted file mode 100644 index 09112d5..0000000 --- a/external/android/include/14/system/core/include/cutils/compiler.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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_CUTILS_COMPILER_H -#define ANDROID_CUTILS_COMPILER_H - -/* - * helps the compiler's optimizer predicting branches - */ - -#ifdef __cplusplus -# define CC_LIKELY( exp ) (__builtin_expect( !!(exp), true )) -# define CC_UNLIKELY( exp ) (__builtin_expect( !!(exp), false )) -#else -# define CC_LIKELY( exp ) (__builtin_expect( !!(exp), 1 )) -# define CC_UNLIKELY( exp ) (__builtin_expect( !!(exp), 0 )) -#endif - -#endif // ANDROID_CUTILS_COMPILER_H diff --git a/external/android/include/14/system/core/include/cutils/config_utils.h b/external/android/include/14/system/core/include/cutils/config_utils.h deleted file mode 100644 index 2dea6f1..0000000 --- a/external/android/include/14/system/core/include/cutils/config_utils.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2006 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 __CUTILS_CONFIG_UTILS_H -#define __CUTILS_CONFIG_UTILS_H - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct cnode cnode; - - -struct cnode -{ - cnode *next; - cnode *first_child; - cnode *last_child; - const char *name; - const char *value; -}; - -/* parse a text string into a config node tree */ -void config_load(cnode *root, char *data); - -/* parse a file into a config node tree */ -void config_load_file(cnode *root, const char *fn); - -/* create a single config node */ -cnode* config_node(const char *name, const char *value); - -/* locate a named child of a config node */ -cnode* config_find(cnode *root, const char *name); - -/* look up a child by name and return the boolean value */ -int config_bool(cnode *root, const char *name, int _default); - -/* look up a child by name and return the string value */ -const char* config_str(cnode *root, const char *name, const char *_default); - -/* add a named child to a config node (or modify it if it already exists) */ -void config_set(cnode *root, const char *name, const char *value); - -/* free a config node tree */ -void config_free(cnode *root); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/external/android/include/14/system/core/include/cutils/cpu_info.h b/external/android/include/14/system/core/include/cutils/cpu_info.h deleted file mode 100644 index 78c1884..0000000 --- a/external/android/include/14/system/core/include/cutils/cpu_info.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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 __CUTILS_CPU_INFO_H -#define __CUTILS_CPU_INFO_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* returns a string contiaining an ASCII representation of the CPU serial number, -** or NULL if cpu info not available. -** The string is a static variable, so don't call free() on it. -*/ -extern const char* get_cpu_serial_number(void); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_CPU_INFO_H */ diff --git a/external/android/include/14/system/core/include/cutils/dir_hash.h b/external/android/include/14/system/core/include/cutils/dir_hash.h deleted file mode 100644 index fbb4d02..0000000 --- a/external/android/include/14/system/core/include/cutils/dir_hash.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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. - */ - -typedef enum { - SHA_1, -} HashAlgorithm; - -int get_file_hash(HashAlgorithm algorithm, const char *path, - char *output_string, size_t max_output_string); - -int get_recursive_hash_manifest(HashAlgorithm algorithm, - const char *directory_path, - char **output_string); diff --git a/external/android/include/14/system/core/include/cutils/event_tag_map.h b/external/android/include/14/system/core/include/cutils/event_tag_map.h deleted file mode 100644 index 1653c61..0000000 --- a/external/android/include/14/system/core/include/cutils/event_tag_map.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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 _LIBS_CUTILS_EVENTTAGMAP_H -#define _LIBS_CUTILS_EVENTTAGMAP_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define EVENT_TAG_MAP_FILE "/system/etc/event-log-tags" - -struct EventTagMap; -typedef struct EventTagMap EventTagMap; - -/* - * Open the specified file as an event log tag map. - * - * Returns NULL on failure. - */ -EventTagMap* android_openEventTagMap(const char* fileName); - -/* - * Close the map. - */ -void android_closeEventTagMap(EventTagMap* map); - -/* - * Look up a tag by index. Returns the tag string, or NULL if not found. - */ -const char* android_lookupEventTag(const EventTagMap* map, int tag); - -#ifdef __cplusplus -} -#endif - -#endif /*_LIBS_CUTILS_EVENTTAGMAP_H*/ diff --git a/external/android/include/14/system/core/include/cutils/hashmap.h b/external/android/include/14/system/core/include/cutils/hashmap.h deleted file mode 100644 index 5cb344c..0000000 --- a/external/android/include/14/system/core/include/cutils/hashmap.h +++ /dev/null @@ -1,150 +0,0 @@ -/* - * 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. - */ - -/** - * Hash map. - */ - -#ifndef __HASHMAP_H -#define __HASHMAP_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** A hash map. */ -typedef struct Hashmap Hashmap; - -/** - * Creates a new hash map. Returns NULL if memory allocation fails. - * - * @param initialCapacity number of expected entries - * @param hash function which hashes keys - * @param equals function which compares keys for equality - */ -Hashmap* hashmapCreate(size_t initialCapacity, - int (*hash)(void* key), bool (*equals)(void* keyA, void* keyB)); - -/** - * Frees the hash map. Does not free the keys or values themselves. - */ -void hashmapFree(Hashmap* map); - -/** - * Hashes the memory pointed to by key with the given size. Useful for - * implementing hash functions. - */ -int hashmapHash(void* key, size_t keySize); - -/** - * Puts value for the given key in the map. Returns pre-existing value if - * any. - * - * If memory allocation fails, this function returns NULL, the map's size - * does not increase, and errno is set to ENOMEM. - */ -void* hashmapPut(Hashmap* map, void* key, void* value); - -/** - * Gets a value from the map. Returns NULL if no entry for the given key is - * found or if the value itself is NULL. - */ -void* hashmapGet(Hashmap* map, void* key); - -/** - * Returns true if the map contains an entry for the given key. - */ -bool hashmapContainsKey(Hashmap* map, void* key); - -/** - * Gets the value for a key. If a value is not found, this function gets a - * value and creates an entry using the given callback. - * - * If memory allocation fails, the callback is not called, this function - * returns NULL, and errno is set to ENOMEM. - */ -void* hashmapMemoize(Hashmap* map, void* key, - void* (*initialValue)(void* key, void* context), void* context); - -/** - * Removes an entry from the map. Returns the removed value or NULL if no - * entry was present. - */ -void* hashmapRemove(Hashmap* map, void* key); - -/** - * Gets the number of entries in this map. - */ -size_t hashmapSize(Hashmap* map); - -/** - * Invokes the given callback on each entry in the map. Stops iterating if - * the callback returns false. - */ -void hashmapForEach(Hashmap* map, - bool (*callback)(void* key, void* value, void* context), - void* context); - -/** - * Concurrency support. - */ - -/** - * Locks the hash map so only the current thread can access it. - */ -void hashmapLock(Hashmap* map); - -/** - * Unlocks the hash map so other threads can access it. - */ -void hashmapUnlock(Hashmap* map); - -/** - * Key utilities. - */ - -/** - * Hashes int keys. 'key' is a pointer to int. - */ -int hashmapIntHash(void* key); - -/** - * Compares two int keys for equality. - */ -bool hashmapIntEquals(void* keyA, void* keyB); - -/** - * For debugging. - */ - -/** - * Gets current capacity. - */ -size_t hashmapCurrentCapacity(Hashmap* map); - -/** - * Counts the number of entry collisions. - */ -size_t hashmapCountCollisions(Hashmap* map); - -#ifdef __cplusplus -} -#endif - -#endif /* __HASHMAP_H */ diff --git a/external/android/include/14/system/core/include/cutils/iosched_policy.h b/external/android/include/14/system/core/include/cutils/iosched_policy.h deleted file mode 100644 index 07c5d1f..0000000 --- a/external/android/include/14/system/core/include/cutils/iosched_policy.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 __CUTILS_IOSCHED_POLICY_H -#define __CUTILS_IOSCHED_POLICY_H - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - IoSchedClass_NONE, - IoSchedClass_RT, - IoSchedClass_BE, - IoSchedClass_IDLE, -} IoSchedClass; - -extern int android_set_ioprio(int pid, IoSchedClass clazz, int ioprio); -extern int android_get_ioprio(int pid, IoSchedClass *clazz, int *ioprio); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_IOSCHED_POLICY_H */ diff --git a/external/android/include/14/system/core/include/cutils/jstring.h b/external/android/include/14/system/core/include/cutils/jstring.h deleted file mode 100644 index ee0018f..0000000 --- a/external/android/include/14/system/core/include/cutils/jstring.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2006 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 __CUTILS_STRING16_H -#define __CUTILS_STRING16_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef uint16_t char16_t; - -extern char * strndup16to8 (const char16_t* s, size_t n); -extern size_t strnlen16to8 (const char16_t* s, size_t n); -extern char * strncpy16to8 (char *dest, const char16_t*s, size_t n); - -extern char16_t * strdup8to16 (const char* s, size_t *out_len); -extern size_t strlen8to16 (const char* utf8Str); -extern char16_t * strcpy8to16 (char16_t *dest, const char*s, size_t *out_len); -extern char16_t * strcpylen8to16 (char16_t *dest, const char*s, int length, - size_t *out_len); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_STRING16_H */ diff --git a/external/android/include/14/system/core/include/cutils/klog.h b/external/android/include/14/system/core/include/cutils/klog.h deleted file mode 100644 index 1335543..0000000 --- a/external/android/include/14/system/core/include/cutils/klog.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2010 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 _CUTILS_KLOG_H_ -#define _CUTILS_KLOG_H_ - -void klog_init(void); -void klog_set_level(int level); -void klog_close(void); -void klog_write(int level, const char *fmt, ...) - __attribute__ ((format(printf, 2, 3))); - -#define KLOG_ERROR(tag,x...) klog_write(3, "<3>" tag ": " x) -#define KLOG_WARNING(tag,x...) klog_write(4, "<4>" tag ": " x) -#define KLOG_NOTICE(tag,x...) klog_write(5, "<5>" tag ": " x) -#define KLOG_INFO(tag,x...) klog_write(6, "<6>" tag ": " x) -#define KLOG_DEBUG(tag,x...) klog_write(7, "<7>" tag ": " x) - -#define KLOG_DEFAULT_LEVEL 3 /* messages <= this level are logged */ - -#endif diff --git a/external/android/include/14/system/core/include/cutils/list.h b/external/android/include/14/system/core/include/cutils/list.h deleted file mode 100644 index eb5a3c8..0000000 --- a/external/android/include/14/system/core/include/cutils/list.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2010 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 _CUTILS_LIST_H_ -#define _CUTILS_LIST_H_ - -#include - -struct listnode -{ - struct listnode *next; - struct listnode *prev; -}; - -#define node_to_item(node, container, member) \ - (container *) (((char*) (node)) - offsetof(container, member)) - -#define list_declare(name) \ - struct listnode name = { \ - .next = &name, \ - .prev = &name, \ - } - -#define list_for_each(node, list) \ - for (node = (list)->next; node != (list); node = node->next) - -#define list_for_each_reverse(node, list) \ - for (node = (list)->prev; node != (list); node = node->prev) - -void list_init(struct listnode *list); -void list_add_tail(struct listnode *list, struct listnode *item); -void list_remove(struct listnode *item); - -#define list_empty(list) ((list) == (list)->next) -#define list_head(list) ((list)->next) -#define list_tail(list) ((list)->prev) - -#endif diff --git a/external/android/include/14/system/core/include/cutils/log.h b/external/android/include/14/system/core/include/cutils/log.h deleted file mode 100644 index 42d7382..0000000 --- a/external/android/include/14/system/core/include/cutils/log.h +++ /dev/null @@ -1,482 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// C/C++ logging functions. See the logging documentation for API details. -// -// We'd like these to be available from C code (in case we import some from -// somewhere), so this has a C interface. -// -// The output will be correct when the log file is shared between multiple -// threads and/or multiple processes so long as the operating system -// supports O_APPEND. These calls have mutex-protected data structures -// and so are NOT reentrant. Do not use LOG in a signal handler. -// -#ifndef _LIBS_CUTILS_LOG_H -#define _LIBS_CUTILS_LOG_H - -#include -#include -#include -#include -#ifdef HAVE_PTHREADS -#include -#endif -#include - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// --------------------------------------------------------------------- - -/* - * Normally we strip LOGV (VERBOSE messages) from release builds. - * You can modify this (for example with "#define LOG_NDEBUG 0" - * at the top of your source file) to change that behavior. - */ -#ifndef LOG_NDEBUG -#ifdef NDEBUG -#define LOG_NDEBUG 1 -#else -#define LOG_NDEBUG 0 -#endif -#endif - -/* - * This is the local tag used for the following simplified - * logging macros. You can change this preprocessor definition - * before using the other macros to change the tag. - */ -#ifndef LOG_TAG -#define LOG_TAG NULL -#endif - -// --------------------------------------------------------------------- - -/* - * Simplified macro to send a verbose log message using the current LOG_TAG. - */ -#ifndef LOGV -#if LOG_NDEBUG -#define LOGV(...) ((void)0) -#else -#define LOGV(...) ((void)LOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) -#endif -#endif - -#define CONDITION(cond) (__builtin_expect((cond)!=0, 0)) - -#ifndef LOGV_IF -#if LOG_NDEBUG -#define LOGV_IF(cond, ...) ((void)0) -#else -#define LOGV_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)LOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif -#endif - -/* - * Simplified macro to send a debug log message using the current LOG_TAG. - */ -#ifndef LOGD -#define LOGD(...) ((void)LOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef LOGD_IF -#define LOGD_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)LOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send an info log message using the current LOG_TAG. - */ -#ifndef LOGI -#define LOGI(...) ((void)LOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef LOGI_IF -#define LOGI_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)LOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send a warning log message using the current LOG_TAG. - */ -#ifndef LOGW -#define LOGW(...) ((void)LOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef LOGW_IF -#define LOGW_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)LOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send an error log message using the current LOG_TAG. - */ -#ifndef LOGE -#define LOGE(...) ((void)LOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef LOGE_IF -#define LOGE_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)LOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -// --------------------------------------------------------------------- - -/* - * Conditional based on whether the current LOG_TAG is enabled at - * verbose priority. - */ -#ifndef IF_LOGV -#if LOG_NDEBUG -#define IF_LOGV() if (false) -#else -#define IF_LOGV() IF_LOG(LOG_VERBOSE, LOG_TAG) -#endif -#endif - -/* - * Conditional based on whether the current LOG_TAG is enabled at - * debug priority. - */ -#ifndef IF_LOGD -#define IF_LOGD() IF_LOG(LOG_DEBUG, LOG_TAG) -#endif - -/* - * Conditional based on whether the current LOG_TAG is enabled at - * info priority. - */ -#ifndef IF_LOGI -#define IF_LOGI() IF_LOG(LOG_INFO, LOG_TAG) -#endif - -/* - * Conditional based on whether the current LOG_TAG is enabled at - * warn priority. - */ -#ifndef IF_LOGW -#define IF_LOGW() IF_LOG(LOG_WARN, LOG_TAG) -#endif - -/* - * Conditional based on whether the current LOG_TAG is enabled at - * error priority. - */ -#ifndef IF_LOGE -#define IF_LOGE() IF_LOG(LOG_ERROR, LOG_TAG) -#endif - - -// --------------------------------------------------------------------- - -/* - * Simplified macro to send a verbose system log message using the current LOG_TAG. - */ -#ifndef SLOGV -#if LOG_NDEBUG -#define SLOGV(...) ((void)0) -#else -#define SLOGV(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) -#endif -#endif - -#define CONDITION(cond) (__builtin_expect((cond)!=0, 0)) - -#ifndef SLOGV_IF -#if LOG_NDEBUG -#define SLOGV_IF(cond, ...) ((void)0) -#else -#define SLOGV_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif -#endif - -/* - * Simplified macro to send a debug system log message using the current LOG_TAG. - */ -#ifndef SLOGD -#define SLOGD(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef SLOGD_IF -#define SLOGD_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send an info system log message using the current LOG_TAG. - */ -#ifndef SLOGI -#define SLOGI(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef SLOGI_IF -#define SLOGI_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send a warning system log message using the current LOG_TAG. - */ -#ifndef SLOGW -#define SLOGW(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef SLOGW_IF -#define SLOGW_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send an error system log message using the current LOG_TAG. - */ -#ifndef SLOGE -#define SLOGE(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef SLOGE_IF -#define SLOGE_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - - - -// --------------------------------------------------------------------- - -/* - * Log a fatal error. If the given condition fails, this stops program - * execution like a normal assertion, but also generating the given message. - * It is NOT stripped from release builds. Note that the condition test - * is -inverted- from the normal assert() semantics. - */ -#ifndef LOG_ALWAYS_FATAL_IF -#define LOG_ALWAYS_FATAL_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)android_printAssert(#cond, LOG_TAG, ## __VA_ARGS__)) \ - : (void)0 ) -#endif - -#ifndef LOG_ALWAYS_FATAL -#define LOG_ALWAYS_FATAL(...) \ - ( ((void)android_printAssert(NULL, LOG_TAG, ## __VA_ARGS__)) ) -#endif - -/* - * Versions of LOG_ALWAYS_FATAL_IF and LOG_ALWAYS_FATAL that - * are stripped out of release builds. - */ -#if LOG_NDEBUG - -#ifndef LOG_FATAL_IF -#define LOG_FATAL_IF(cond, ...) ((void)0) -#endif -#ifndef LOG_FATAL -#define LOG_FATAL(...) ((void)0) -#endif - -#else - -#ifndef LOG_FATAL_IF -#define LOG_FATAL_IF(cond, ...) LOG_ALWAYS_FATAL_IF(cond, ## __VA_ARGS__) -#endif -#ifndef LOG_FATAL -#define LOG_FATAL(...) LOG_ALWAYS_FATAL(__VA_ARGS__) -#endif - -#endif - -/* - * Assertion that generates a log message when the assertion fails. - * Stripped out of release builds. Uses the current LOG_TAG. - */ -#ifndef LOG_ASSERT -#define LOG_ASSERT(cond, ...) LOG_FATAL_IF(!(cond), ## __VA_ARGS__) -//#define LOG_ASSERT(cond) LOG_FATAL_IF(!(cond), "Assertion failed: " #cond) -#endif - -// --------------------------------------------------------------------- - -/* - * Basic log message macro. - * - * Example: - * LOG(LOG_WARN, NULL, "Failed with error %d", errno); - * - * The second argument may be NULL or "" to indicate the "global" tag. - */ -#ifndef LOG -#define LOG(priority, tag, ...) \ - LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__) -#endif - -/* - * Log macro that allows you to specify a number for the priority. - */ -#ifndef LOG_PRI -#define LOG_PRI(priority, tag, ...) \ - android_printLog(priority, tag, __VA_ARGS__) -#endif - -/* - * Log macro that allows you to pass in a varargs ("args" is a va_list). - */ -#ifndef LOG_PRI_VA -#define LOG_PRI_VA(priority, tag, fmt, args) \ - android_vprintLog(priority, NULL, tag, fmt, args) -#endif - -/* - * Conditional given a desired logging priority and tag. - */ -#ifndef IF_LOG -#define IF_LOG(priority, tag) \ - if (android_testLog(ANDROID_##priority, tag)) -#endif - -// --------------------------------------------------------------------- - -/* - * Event logging. - */ - -/* - * Event log entry types. These must match up with the declarations in - * java/android/android/util/EventLog.java. - */ -typedef enum { - EVENT_TYPE_INT = 0, - EVENT_TYPE_LONG = 1, - EVENT_TYPE_STRING = 2, - EVENT_TYPE_LIST = 3, -} AndroidEventLogType; - - -#ifndef LOG_EVENT_INT -#define LOG_EVENT_INT(_tag, _value) { \ - int intBuf = _value; \ - (void) android_btWriteLog(_tag, EVENT_TYPE_INT, &intBuf, \ - sizeof(intBuf)); \ - } -#endif -#ifndef LOG_EVENT_LONG -#define LOG_EVENT_LONG(_tag, _value) { \ - long long longBuf = _value; \ - (void) android_btWriteLog(_tag, EVENT_TYPE_LONG, &longBuf, \ - sizeof(longBuf)); \ - } -#endif -#ifndef LOG_EVENT_STRING -#define LOG_EVENT_STRING(_tag, _value) \ - ((void) 0) /* not implemented -- must combine len with string */ -#endif -/* TODO: something for LIST */ - -/* - * =========================================================================== - * - * The stuff in the rest of this file should not be used directly. - */ - -#define android_printLog(prio, tag, fmt...) \ - __android_log_print(prio, tag, fmt) - -#define android_vprintLog(prio, cond, tag, fmt...) \ - __android_log_vprint(prio, tag, fmt) - -/* XXX Macros to work around syntax errors in places where format string - * arg is not passed to LOG_ASSERT, LOG_ALWAYS_FATAL or LOG_ALWAYS_FATAL_IF - * (happens only in debug builds). - */ - -/* Returns 2nd arg. Used to substitute default value if caller's vararg list - * is empty. - */ -#define __android_second(dummy, second, ...) second - -/* If passed multiple args, returns ',' followed by all but 1st arg, otherwise - * returns nothing. - */ -#define __android_rest(first, ...) , ## __VA_ARGS__ - -#define android_printAssert(cond, tag, fmt...) \ - __android_log_assert(cond, tag, \ - __android_second(0, ## fmt, NULL) __android_rest(fmt)) - -#define android_writeLog(prio, tag, text) \ - __android_log_write(prio, tag, text) - -#define android_bWriteLog(tag, payload, len) \ - __android_log_bwrite(tag, payload, len) -#define android_btWriteLog(tag, type, payload, len) \ - __android_log_btwrite(tag, type, payload, len) - -// TODO: remove these prototypes and their users -#define android_testLog(prio, tag) (1) -#define android_writevLog(vec,num) do{}while(0) -#define android_write1Log(str,len) do{}while (0) -#define android_setMinPriority(tag, prio) do{}while(0) -//#define android_logToCallback(func) do{}while(0) -#define android_logToFile(tag, file) (0) -#define android_logToFd(tag, fd) (0) - -typedef enum { - LOG_ID_MAIN = 0, - LOG_ID_RADIO = 1, - LOG_ID_EVENTS = 2, - LOG_ID_SYSTEM = 3, - - LOG_ID_MAX -} log_id_t; - -/* - * Send a simple string to the log. - */ -int __android_log_buf_write(int bufID, int prio, const char *tag, const char *text); -int __android_log_buf_print(int bufID, int prio, const char *tag, const char *fmt, ...); - - -#ifdef __cplusplus -} -#endif - -#endif // _LIBS_CUTILS_LOG_H diff --git a/external/android/include/14/system/core/include/cutils/logd.h b/external/android/include/14/system/core/include/cutils/logd.h deleted file mode 100644 index 8737639..0000000 --- a/external/android/include/14/system/core/include/cutils/logd.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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_CUTILS_LOGD_H -#define _ANDROID_CUTILS_LOGD_H - -/* the stable/frozen log-related definitions have been - * moved to this header, which is exposed by the NDK - */ -#include - -/* the rest is only used internally by the system */ -#include -#include -#include -#include -#include -#ifdef HAVE_PTHREADS -#include -#endif -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -int __android_log_bwrite(int32_t tag, const void *payload, size_t len); -int __android_log_btwrite(int32_t tag, char type, const void *payload, - size_t len); - -#ifdef __cplusplus -} -#endif - -#endif /* _LOGD_H */ diff --git a/external/android/include/14/system/core/include/cutils/logger.h b/external/android/include/14/system/core/include/cutils/logger.h deleted file mode 100644 index b60f7ad..0000000 --- a/external/android/include/14/system/core/include/cutils/logger.h +++ /dev/null @@ -1,47 +0,0 @@ -/* utils/logger.h -** -** Copyright 2007, The Android Open Source Project -** -** This file is dual licensed. It may be redistributed and/or modified -** under the terms of the Apache 2.0 License OR version 2 of the GNU -** General Public License. -*/ - -#ifndef _UTILS_LOGGER_H -#define _UTILS_LOGGER_H - -#include - -struct logger_entry { - uint16_t len; /* length of the payload */ - uint16_t __pad; /* no matter what, we get 2 bytes of padding */ - int32_t pid; /* generating process's pid */ - int32_t tid; /* generating process's tid */ - int32_t sec; /* seconds since Epoch */ - int32_t nsec; /* nanoseconds */ - char msg[0]; /* the entry's payload */ -}; - -#define LOGGER_LOG_MAIN "log/main" -#define LOGGER_LOG_RADIO "log/radio" -#define LOGGER_LOG_EVENTS "log/events" -#define LOGGER_LOG_SYSTEM "log/system" - -#define LOGGER_ENTRY_MAX_LEN (4*1024) -#define LOGGER_ENTRY_MAX_PAYLOAD \ - (LOGGER_ENTRY_MAX_LEN - sizeof(struct logger_entry)) - -#ifdef HAVE_IOCTL - -#include - -#define __LOGGERIO 0xAE - -#define LOGGER_GET_LOG_BUF_SIZE _IO(__LOGGERIO, 1) /* size of log */ -#define LOGGER_GET_LOG_LEN _IO(__LOGGERIO, 2) /* used log len */ -#define LOGGER_GET_NEXT_ENTRY_LEN _IO(__LOGGERIO, 3) /* next entry len */ -#define LOGGER_FLUSH_LOG _IO(__LOGGERIO, 4) /* flush log */ - -#endif // HAVE_IOCTL - -#endif /* _UTILS_LOGGER_H */ diff --git a/external/android/include/14/system/core/include/cutils/logprint.h b/external/android/include/14/system/core/include/cutils/logprint.h deleted file mode 100644 index 769c8a7..0000000 --- a/external/android/include/14/system/core/include/cutils/logprint.h +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (C) 2006 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 _LOGPRINT_H -#define _LOGPRINT_H - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - FORMAT_OFF = 0, - FORMAT_BRIEF, - FORMAT_PROCESS, - FORMAT_TAG, - FORMAT_THREAD, - FORMAT_RAW, - FORMAT_TIME, - FORMAT_THREADTIME, - FORMAT_LONG, -} AndroidLogPrintFormat; - -typedef struct AndroidLogFormat_t AndroidLogFormat; - -typedef struct AndroidLogEntry_t { - time_t tv_sec; - long tv_nsec; - android_LogPriority priority; - pid_t pid; - pthread_t tid; - const char * tag; - size_t messageLen; - const char * message; -} AndroidLogEntry; - -AndroidLogFormat *android_log_format_new(); - -void android_log_format_free(AndroidLogFormat *p_format); - -void android_log_setPrintFormat(AndroidLogFormat *p_format, - AndroidLogPrintFormat format); - -/** - * Returns FORMAT_OFF on invalid string - */ -AndroidLogPrintFormat android_log_formatFromString(const char *s); - -/** - * filterExpression: a single filter expression - * eg "AT:d" - * - * returns 0 on success and -1 on invalid expression - * - * Assumes single threaded execution - * - */ - -int android_log_addFilterRule(AndroidLogFormat *p_format, - const char *filterExpression); - - -/** - * filterString: a whitespace-separated set of filter expressions - * eg "AT:d *:i" - * - * returns 0 on success and -1 on invalid expression - * - * Assumes single threaded execution - * - */ - -int android_log_addFilterString(AndroidLogFormat *p_format, - const char *filterString); - - -/** - * returns 1 if this log line should be printed based on its priority - * and tag, and 0 if it should not - */ -int android_log_shouldPrintLine ( - AndroidLogFormat *p_format, const char *tag, android_LogPriority pri); - - -/** - * Splits a wire-format buffer into an AndroidLogEntry - * entry allocated by caller. Pointers will point directly into buf - * - * Returns 0 on success and -1 on invalid wire format (entry will be - * in unspecified state) - */ -int android_log_processLogBuffer(struct logger_entry *buf, - AndroidLogEntry *entry); - -/** - * Like android_log_processLogBuffer, but for binary logs. - * - * If "map" is non-NULL, it will be used to convert the log tag number - * into a string. - */ -int android_log_processBinaryLogBuffer(struct logger_entry *buf, - AndroidLogEntry *entry, const EventTagMap* map, char* messageBuf, - int messageBufLen); - - -/** - * Formats a log message into a buffer - * - * Uses defaultBuffer if it can, otherwise malloc()'s a new buffer - * If return value != defaultBuffer, caller must call free() - * Returns NULL on malloc error - */ - -char *android_log_formatLogLine ( - AndroidLogFormat *p_format, - char *defaultBuffer, - size_t defaultBufferSize, - const AndroidLogEntry *p_line, - size_t *p_outLength); - - -/** - * Either print or do not print log line, based on filter - * - * Assumes single threaded execution - * - */ -int android_log_printLogLine( - AndroidLogFormat *p_format, - int fd, - const AndroidLogEntry *entry); - - -#ifdef __cplusplus -} -#endif - - -#endif /*_LOGPRINT_H*/ diff --git a/external/android/include/14/system/core/include/cutils/memory.h b/external/android/include/14/system/core/include/cutils/memory.h deleted file mode 100644 index e725cdd..0000000 --- a/external/android/include/14/system/core/include/cutils/memory.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2006 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_CUTILS_MEMORY_H -#define ANDROID_CUTILS_MEMORY_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* size is given in bytes and must be multiple of 2 */ -void android_memset16(uint16_t* dst, uint16_t value, size_t size); - -/* size is given in bytes and must be multiple of 4 */ -void android_memset32(uint32_t* dst, uint32_t value, size_t size); - -#if !HAVE_STRLCPY -/* Declaration of strlcpy() for platforms that don't already have it. */ -size_t strlcpy(char *dst, const char *src, size_t size); -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // ANDROID_CUTILS_MEMORY_H diff --git a/external/android/include/14/system/core/include/cutils/misc.h b/external/android/include/14/system/core/include/cutils/misc.h deleted file mode 100644 index 2c48dfa..0000000 --- a/external/android/include/14/system/core/include/cutils/misc.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2006 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 __CUTILS_MISC_H -#define __CUTILS_MISC_H - -#ifdef __cplusplus -extern "C" { -#endif - - /* Load an entire file into a malloc'd chunk of memory - * that is length_of_file + 1 (null terminator). If - * sz is non-zero, return the size of the file via sz. - * Returns 0 on failure. - */ -extern void *load_file(const char *fn, unsigned *sz); - - /* Connects your process to the system debugger daemon - * so that on a crash it may be logged or interactively - * debugged (depending on system settings). - */ -extern void debuggerd_connect(void); - - - /* This is the range of UIDs (and GIDs) that are reserved - * for assigning to applications. - */ -#define FIRST_APPLICATION_UID 10000 -#define LAST_APPLICATION_UID 99999 - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_MISC_H */ diff --git a/external/android/include/14/system/core/include/cutils/mq.h b/external/android/include/14/system/core/include/cutils/mq.h deleted file mode 100644 index b27456d..0000000 --- a/external/android/include/14/system/core/include/cutils/mq.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * 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. - */ - -/** - * IPC messaging library. - */ - -#ifndef __MQ_H -#define __MQ_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** A message. */ -typedef struct MqMessage MqMessage; - -/** A destination to which messages can be sent. */ -typedef struct MqDestination MqDestination; - -/* Array of bytes. */ -typedef struct MqBytes MqBytes; - -/** - * Hears messages. - * - * @param destination to which the message was sent - * @param message the message to hear - */ -typedef void MqMessageListener(MqDestination* destination, MqMessage* message); - -/** - * Hears a destination close. - * - * @param destination that closed - */ -typedef void MqCloseListener(MqDestination* destination); - -/** Message functions. */ - -/** - * Creates a new Message. - * - * @param header as defined by user - * @param body as defined by user - * @param replyTo destination to which replies should be sent, NULL if none - */ -MqMessage* mqCreateMessage(MqBytes header, MqBytes body, - MqDestination* replyTo); - -/** Sends a message to a destination. */ -void mqSendMessage(MqMessage* message, MqDestination* destination); - -/** Destination functions. */ - -/** - * Creates a new destination. Acquires a reference implicitly. - * - * @param messageListener function to call when a message is recieved - * @param closeListener function to call when the destination closes - * @param userData user-specific data to associate with the destination. - * Retrieve using mqGetDestinationUserData(). - */ -MqDestination* mqCreateDestination(MqMessageListener* messageListener, - MqCloseListener* closeListener, void* userData); - -/** - * Gets user data which was associated with the given destination at - * construction time. - * - * It is only valid to call this function in the same process that the - * given destination was created in. - * This function returns a null pointer if you call it on a destination - * created in a remote process. - */ -void* mqGetUserData(MqDestination* destination); - -/** - * Returns 1 if the destination was created in this process, or 0 if - * the destination was created in a different process, in which case you have - * a remote stub. - */ -int mqIsDestinationLocal(MqDestination* destination); - -/** - * Increments the destination's reference count. - */ -void mqKeepDestination(MqDesintation* destination); - -/** - * Decrements the destination's reference count. - */ -void mqFreeDestination(MqDestination* desintation); - -/** Registry API. */ - -/** - * Gets the destination bound to a name. - */ -MqDestination* mqGetDestination(char* name); - -/** - * Binds a destination to a name. - */ -void mqPutDestination(char* name, MqDestination* desintation); - -#ifdef __cplusplus -} -#endif - -#endif /* __MQ_H */ diff --git a/external/android/include/14/system/core/include/cutils/mspace.h b/external/android/include/14/system/core/include/cutils/mspace.h deleted file mode 100644 index 93fe48e..0000000 --- a/external/android/include/14/system/core/include/cutils/mspace.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2006 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. - */ - -/* A wrapper file for dlmalloc.h that defines prototypes for the - * mspace_*() functions, which provide an interface for creating - * multiple heaps. - */ - -#ifndef MSPACE_H_ -#define MSPACE_H_ - -/* It's a pain getting the mallinfo stuff to work - * with Linux, OSX, and klibc, so just turn it off - * for now. - * TODO: make mallinfo work - */ -#define NO_MALLINFO 1 - -/* Allow setting the maximum heap footprint. - */ -#define USE_MAX_ALLOWED_FOOTPRINT 1 - -#define USE_CONTIGUOUS_MSPACES 1 -#if USE_CONTIGUOUS_MSPACES -#define HAVE_MMAP 0 -#define HAVE_MORECORE 1 -#define MORECORE_CONTIGUOUS 0 -#endif - -#define MSPACES 1 -#define ONLY_MSPACES 1 -#include "../../../../bionic/libc/bionic/dlmalloc.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - mspace_usable_size(void* p); - - Returns the number of bytes you can actually use in - an allocated chunk, which may be more than you requested (although - often not) due to alignment and minimum size constraints. - You can use this many bytes without worrying about - overwriting other allocated objects. This is not a particularly great - programming practice. mspace_usable_size can be more useful in - debugging and assertions, for example: - - p = mspace_malloc(msp, n); - assert(mspace_usable_size(msp, p) >= 256); -*/ -size_t mspace_usable_size(mspace, const void*); - -#if USE_CONTIGUOUS_MSPACES -/* - Similar to create_mspace(), but the underlying memory is - guaranteed to be contiguous. No more than max_capacity - bytes is ever allocated to the mspace. - */ -mspace create_contiguous_mspace(size_t starting_capacity, size_t max_capacity, - int locked); - -/* - Identical to create_contiguous_mspace, but labels the mapping 'mspace/name' - instead of 'mspace' -*/ -mspace create_contiguous_mspace_with_name(size_t starting_capacity, - size_t max_capacity, int locked, const char *name); - -/* - Identical to create_contiguous_mspace, but uses previously mapped memory. -*/ -mspace create_contiguous_mspace_with_base(size_t starting_capacity, - size_t max_capacity, int locked, void *base); - -size_t destroy_contiguous_mspace(mspace msp); - -/* - Returns the position of the "break" within the given mspace. -*/ -void *contiguous_mspace_sbrk0(mspace msp); -#endif - -/* - Call the handler for each block in the specified mspace. - chunkptr and chunklen refer to the heap-level chunk including - the chunk overhead, and userptr and userlen refer to the - user-usable part of the chunk. If the chunk is free, userptr - will be NULL and userlen will be 0. userlen is not guaranteed - to be the same value passed into malloc() for a given chunk; - it is >= the requested size. - */ -void mspace_walk_heap(mspace msp, - void(*handler)(const void *chunkptr, size_t chunklen, - const void *userptr, size_t userlen, void *arg), void *harg); - -/* - mspace_walk_free_pages(handler, harg) - - Calls the provided handler on each free region in the specified - mspace. The memory between start and end are guaranteed not to - contain any important data, so the handler is free to alter the - contents in any way. This can be used to advise the OS that large - free regions may be swapped out. - - The value in harg will be passed to each call of the handler. - */ -void mspace_walk_free_pages(mspace msp, - void(*handler)(void *start, void *end, void *arg), void *harg); - -#ifdef __cplusplus -}; /* end of extern "C" */ -#endif - -#endif /* MSPACE_H_ */ diff --git a/external/android/include/14/system/core/include/cutils/native_handle.h b/external/android/include/14/system/core/include/cutils/native_handle.h deleted file mode 100644 index 268c5d3..0000000 --- a/external/android/include/14/system/core/include/cutils/native_handle.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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 NATIVE_HANDLE_H_ -#define NATIVE_HANDLE_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct native_handle -{ - int version; /* sizeof(native_handle_t) */ - int numFds; /* number of file-descriptors at &data[0] */ - int numInts; /* number of ints at &data[numFds] */ - int data[0]; /* numFds + numInts ints */ -} native_handle_t; - -/* - * native_handle_close - * - * closes the file descriptors contained in this native_handle_t - * - * return 0 on success, or a negative error code on failure - * - */ -int native_handle_close(const native_handle_t* h); - - -/* - * native_handle_create - * - * creates a native_handle_t and initializes it. must be destroyed with - * native_handle_delete(). - * - */ -native_handle_t* native_handle_create(int numFds, int numInts); - -/* - * native_handle_delete - * - * frees a native_handle_t allocated with native_handle_create(). - * This ONLY frees the memory allocated for the native_handle_t, but doesn't - * close the file descriptors; which can be achieved with native_handle_close(). - * - * return 0 on success, or a negative error code on failure - * - */ -int native_handle_delete(native_handle_t* h); - - -#ifdef __cplusplus -} -#endif - -#endif /* NATIVE_HANDLE_H_ */ diff --git a/external/android/include/14/system/core/include/cutils/open_memstream.h b/external/android/include/14/system/core/include/cutils/open_memstream.h deleted file mode 100644 index b7998be..0000000 --- a/external/android/include/14/system/core/include/cutils/open_memstream.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2010 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 __CUTILS_OPEN_MEMSTREAM_H__ -#define __CUTILS_OPEN_MEMSTREAM_H__ - -#include - -#ifndef HAVE_OPEN_MEMSTREAM - -#ifdef __cplusplus -extern "C" { -#endif - -FILE* open_memstream(char** bufp, size_t* sizep); - -#ifdef __cplusplus -} -#endif - -#endif /*!HAVE_OPEN_MEMSTREAM*/ - -#endif /*__CUTILS_OPEN_MEMSTREAM_H__*/ diff --git a/external/android/include/14/system/core/include/cutils/partition_utils.h b/external/android/include/14/system/core/include/cutils/partition_utils.h deleted file mode 100644 index 597df92..0000000 --- a/external/android/include/14/system/core/include/cutils/partition_utils.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2011, 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 __CUTILS_PARTITION_WIPED_H__ -#define __CUTILS_PARTITION_WIPED_H__ - -__BEGIN_DECLS - -int partition_wiped(char *source); -void erase_footer(const char *dev_path, long long size); - -__END_DECLS - -#endif /* __CUTILS_PARTITION_WIPED_H__ */ diff --git a/external/android/include/14/system/core/include/cutils/process_name.h b/external/android/include/14/system/core/include/cutils/process_name.h deleted file mode 100644 index 1e72e5c..0000000 --- a/external/android/include/14/system/core/include/cutils/process_name.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ - -/** - * Gives the current process a name. - */ - -#ifndef __PROCESS_NAME_H -#define __PROCESS_NAME_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Sets the current process name. - * - * Warning: This leaks a string every time you call it. Use judiciously! - */ -void set_process_name(const char* process_name); - -/** Gets the current process name. */ -const char* get_process_name(void); - -#ifdef __cplusplus -} -#endif - -#endif /* __PROCESS_NAME_H */ diff --git a/external/android/include/14/system/core/include/cutils/properties.h b/external/android/include/14/system/core/include/cutils/properties.h deleted file mode 100644 index 25fd67a..0000000 --- a/external/android/include/14/system/core/include/cutils/properties.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2006 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 __CUTILS_PROPERTIES_H -#define __CUTILS_PROPERTIES_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* System properties are *small* name value pairs managed by the -** property service. If your data doesn't fit in the provided -** space it is not appropriate for a system property. -** -** WARNING: system/bionic/include/sys/system_properties.h also defines -** these, but with different names. (TODO: fix that) -*/ -#define PROPERTY_KEY_MAX 32 -#define PROPERTY_VALUE_MAX 92 - -/* property_get: returns the length of the value which will never be -** greater than PROPERTY_VALUE_MAX - 1 and will always be zero terminated. -** (the length does not include the terminating zero). -** -** If the property read fails or returns an empty value, the default -** value is used (if nonnull). -*/ -int property_get(const char *key, char *value, const char *default_value); - -/* property_set: returns 0 on success, < 0 on failure -*/ -int property_set(const char *key, const char *value); - -int property_list(void (*propfn)(const char *key, const char *value, void *cookie), void *cookie); - - -#ifdef HAVE_SYSTEM_PROPERTY_SERVER -/* - * We have an external property server instead of built-in libc support. - * Used by the simulator. - */ -#define SYSTEM_PROPERTY_PIPE_NAME "/tmp/android-sysprop" - -enum { - kSystemPropertyUnknown = 0, - kSystemPropertyGet, - kSystemPropertySet, - kSystemPropertyList -}; -#endif /*HAVE_SYSTEM_PROPERTY_SERVER*/ - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/external/android/include/14/system/core/include/cutils/qtaguid.h b/external/android/include/14/system/core/include/cutils/qtaguid.h deleted file mode 100644 index f8550fd..0000000 --- a/external/android/include/14/system/core/include/cutils/qtaguid.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2011 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 __CUTILS_QTAGUID_H -#define __CUTILS_QTAGUID_H - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Set tags (and owning UIDs) for network sockets. -*/ -extern int qtaguid_tagSocket(int sockfd, int tag, uid_t uid); - -/* - * Untag a network socket before closing. -*/ -extern int qtaguid_untagSocket(int sockfd); - -/* - * For the given uid, switch counter sets. - * The kernel only keeps a limited number of sets. - * 2 for now. - */ -extern int qtaguid_setCounterSet(int counterSetNum, uid_t uid); - -/* - * Delete all tag info that relates to the given tag an uid. - * If the tag is 0, then ALL info about the uid is freeded. - * The delete data also affects active tagged socketd, which are - * then untagged. - * The calling process can only operate on its own tags. - * Unless it is part of the happy AID_NET_BW_ACCT group. - * In which case it can clobber everything. - */ -extern int qtaguid_deleteTagData(int tag, uid_t uid); - -/* - * Enable/disable qtaguid functionnality at a lower level. - * When pacified, the kernel will accept commands but do nothing. - */ -extern int qtaguid_setPacifier(int on); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_QTAG_UID_H */ diff --git a/external/android/include/14/system/core/include/cutils/record_stream.h b/external/android/include/14/system/core/include/cutils/record_stream.h deleted file mode 100644 index bfac87a..0000000 --- a/external/android/include/14/system/core/include/cutils/record_stream.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2006 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. - */ - -/* - * A simple utility for reading fixed records out of a stream fd - */ - -#ifndef _CUTILS_RECORD_STREAM_H -#define _CUTILS_RECORD_STREAM_H - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef struct RecordStream RecordStream; - -extern RecordStream *record_stream_new(int fd, size_t maxRecordLen); -extern void record_stream_free(RecordStream *p_rs); - -extern int record_stream_get_next (RecordStream *p_rs, void ** p_outRecord, - size_t *p_outRecordLen); - -#ifdef __cplusplus -} -#endif - - -#endif /*_CUTILS_RECORD_STREAM_H*/ - diff --git a/external/android/include/14/system/core/include/cutils/sched_policy.h b/external/android/include/14/system/core/include/cutils/sched_policy.h deleted file mode 100644 index eaf3993..0000000 --- a/external/android/include/14/system/core/include/cutils/sched_policy.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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 __CUTILS_SCHED_POLICY_H -#define __CUTILS_SCHED_POLICY_H - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - SP_BACKGROUND = 0, - SP_FOREGROUND = 1, -} SchedPolicy; - -extern int set_sched_policy(int tid, SchedPolicy policy); -extern int get_sched_policy(int tid, SchedPolicy *policy); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_SCHED_POLICY_H */ diff --git a/external/android/include/14/system/core/include/cutils/selector.h b/external/android/include/14/system/core/include/cutils/selector.h deleted file mode 100644 index dfc2a9d..0000000 --- a/external/android/include/14/system/core/include/cutils/selector.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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. - */ - -/** - * Framework for multiplexing I/O. A selector manages a set of file - * descriptors and calls out to user-provided callback functions to read and - * write data and handle errors. - */ - -#ifndef __SELECTOR_H -#define __SELECTOR_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -/** - * Manages SelectableFds and invokes their callbacks at appropriate times. - */ -typedef struct Selector Selector; - -/** - * A selectable descriptor. Contains callbacks which the selector can invoke - * before calling select(), when the descriptor is readable or writable, and - * when the descriptor contains out-of-band data. Simply set a callback to - * NULL if you're not interested in that particular event. - * - * A selectable descriptor can indicate that it needs to be removed from the - * selector by setting the 'remove' flag. The selector will remove the - * descriptor at a later time and invoke the onRemove() callback. - * - * SelectableFd fields should only be modified from the selector loop. - */ -typedef struct SelectableFd SelectableFd; -struct SelectableFd { - - /** The file descriptor itself. */ - int fd; - - /** Pointer to user-specific data. Can be NULL. */ - void* data; - - /** - * Set this flag when you no longer wish to be selected. The selector - * will invoke onRemove() when the descriptor is actually removed. - */ - bool remove; - - /** - * Invoked by the selector before calling select. You can set up other - * callbacks from here as necessary. - */ - void (*beforeSelect)(SelectableFd* self); - - /** - * Invoked by the selector when the descriptor has data available. Set to - * NULL to indicate that you're not interested in reading. - */ - void (*onReadable)(SelectableFd* self); - - /** - * Invoked by the selector when the descriptor can accept data. Set to - * NULL to indicate that you're not interested in writing. - */ - void (*onWritable)(SelectableFd* self); - - /** - * Invoked by the selector when out-of-band (OOB) data is available. Set to - * NULL to indicate that you're not interested in OOB data. - */ - void (*onExcept)(SelectableFd* self); - - /** - * Invoked by the selector after the descriptor is removed from the - * selector but before the selector frees the SelectableFd memory. - */ - void (*onRemove)(SelectableFd* self); - - /** - * The selector which selected this fd. Set by the selector itself. - */ - Selector* selector; -}; - -/** - * Creates a new selector. - */ -Selector* selectorCreate(void); - -/** - * Creates a new selectable fd, adds it to the given selector and returns a - * pointer. Outside of 'selector' and 'fd', all fields are set to 0 or NULL - * by default. - * - * The selectable fd should only be modified from the selector loop thread. - */ -SelectableFd* selectorAdd(Selector* selector, int fd); - -/** - * Wakes up the selector even though no I/O events occurred. Use this - * to indicate that you're ready to write to a descriptor. - */ -void selectorWakeUp(Selector* selector); - -/** - * Loops continuously selecting file descriptors and firing events. - * Does not return. - */ -void selectorLoop(Selector* selector); - -#ifdef __cplusplus -} -#endif - -#endif /* __SELECTOR_H */ diff --git a/external/android/include/14/system/core/include/cutils/sockets.h b/external/android/include/14/system/core/include/cutils/sockets.h deleted file mode 100644 index 19cae0c..0000000 --- a/external/android/include/14/system/core/include/cutils/sockets.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2006 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 __CUTILS_SOCKETS_H -#define __CUTILS_SOCKETS_H - -#include -#include -#include -#include - -#ifdef HAVE_WINSOCK -#include -typedef int socklen_t; -#elif HAVE_SYS_SOCKET_H -#include -#endif - -#define ANDROID_SOCKET_ENV_PREFIX "ANDROID_SOCKET_" -#define ANDROID_SOCKET_DIR "/dev/socket" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * android_get_control_socket - simple helper function to get the file - * descriptor of our init-managed Unix domain socket. `name' is the name of the - * socket, as given in init.rc. Returns -1 on error. - * - * This is inline and not in libcutils proper because we want to use this in - * third-party daemons with minimal modification. - */ -static inline int android_get_control_socket(const char *name) -{ - char key[64] = ANDROID_SOCKET_ENV_PREFIX; - const char *val; - int fd; - - /* build our environment variable, counting cycles like a wolf ... */ -#if HAVE_STRLCPY - strlcpy(key + sizeof(ANDROID_SOCKET_ENV_PREFIX) - 1, - name, - sizeof(key) - sizeof(ANDROID_SOCKET_ENV_PREFIX)); -#else /* for the host, which may lack the almightly strncpy ... */ - strncpy(key + sizeof(ANDROID_SOCKET_ENV_PREFIX) - 1, - name, - sizeof(key) - sizeof(ANDROID_SOCKET_ENV_PREFIX)); - key[sizeof(key)-1] = '\0'; -#endif - - val = getenv(key); - if (!val) - return -1; - - errno = 0; - fd = strtol(val, NULL, 10); - if (errno) - return -1; - - return fd; -} - -/* - * See also android.os.LocalSocketAddress.Namespace - */ -// Linux "abstract" (non-filesystem) namespace -#define ANDROID_SOCKET_NAMESPACE_ABSTRACT 0 -// Android "reserved" (/dev/socket) namespace -#define ANDROID_SOCKET_NAMESPACE_RESERVED 1 -// Normal filesystem namespace -#define ANDROID_SOCKET_NAMESPACE_FILESYSTEM 2 - -extern int socket_loopback_client(int port, int type); -extern int socket_network_client(const char *host, int port, int type); -extern int socket_loopback_server(int port, int type); -extern int socket_local_server(const char *name, int namespaceId, int type); -extern int socket_local_server_bind(int s, const char *name, int namespaceId); -extern int socket_local_client_connect(int fd, - const char *name, int namespaceId, int type); -extern int socket_local_client(const char *name, int namespaceId, int type); -extern int socket_inaddr_any_server(int port, int type); - -/* - * socket_peer_is_trusted - Takes a socket which is presumed to be a - * connected local socket (e.g. AF_LOCAL) and returns whether the peer - * (the userid that owns the process on the other end of that socket) - * is one of the two trusted userids, root or shell. - * - * Note: This only works as advertised on the Android OS and always - * just returns true when called on other operating systems. - */ -extern bool socket_peer_is_trusted(int fd); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_SOCKETS_H */ diff --git a/external/android/include/14/system/core/include/cutils/str_parms.h b/external/android/include/14/system/core/include/cutils/str_parms.h deleted file mode 100644 index 247c996..0000000 --- a/external/android/include/14/system/core/include/cutils/str_parms.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2011 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 __CUTILS_STR_PARMS_H -#define __CUTILS_STR_PARMS_H - -#include - -struct str_parms; - -struct str_parms *str_parms_create(void); -struct str_parms *str_parms_create_str(const char *_string); -void str_parms_destroy(struct str_parms *str_parms); - -void str_parms_del(struct str_parms *str_parms, const char *key); - -int str_parms_add_str(struct str_parms *str_parms, const char *key, - const char *value); -int str_parms_add_int(struct str_parms *str_parms, const char *key, int value); - -int str_parms_add_float(struct str_parms *str_parms, const char *key, - float value); - -int str_parms_get_str(struct str_parms *str_parms, const char *key, - char *out_val, int len); -int str_parms_get_int(struct str_parms *str_parms, const char *key, - int *out_val); -int str_parms_get_float(struct str_parms *str_parms, const char *key, - float *out_val); - -char *str_parms_to_str(struct str_parms *str_parms); - -/* debug */ -void str_parms_dump(struct str_parms *str_parms); - -#endif /* __CUTILS_STR_PARMS_H */ diff --git a/external/android/include/14/system/core/include/cutils/threads.h b/external/android/include/14/system/core/include/cutils/threads.h deleted file mode 100644 index acf8f48..0000000 --- a/external/android/include/14/system/core/include/cutils/threads.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - * 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 _LIBS_CUTILS_THREADS_H -#define _LIBS_CUTILS_THREADS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/***********************************************************************/ -/***********************************************************************/ -/***** *****/ -/***** local thread storage *****/ -/***** *****/ -/***********************************************************************/ -/***********************************************************************/ - -#ifdef HAVE_PTHREADS - -#include - -typedef struct { - pthread_mutex_t lock; - int has_tls; - pthread_key_t tls; - -} thread_store_t; - -#define THREAD_STORE_INITIALIZER { PTHREAD_MUTEX_INITIALIZER, 0, 0 } - -#elif defined HAVE_WIN32_THREADS - -#include - -typedef struct { - int lock_init; - int has_tls; - DWORD tls; - CRITICAL_SECTION lock; - -} thread_store_t; - -#define THREAD_STORE_INITIALIZER { 0, 0, 0, {0, 0, 0, 0, 0, 0} } - -#else -# error "no thread_store_t implementation for your platform !!" -#endif - -typedef void (*thread_store_destruct_t)(void* value); - -extern void* thread_store_get(thread_store_t* store); - -extern void thread_store_set(thread_store_t* store, - void* value, - thread_store_destruct_t destroy); - -/***********************************************************************/ -/***********************************************************************/ -/***** *****/ -/***** mutexes *****/ -/***** *****/ -/***********************************************************************/ -/***********************************************************************/ - -#ifdef HAVE_PTHREADS - -typedef pthread_mutex_t mutex_t; - -#define MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER - -static __inline__ void mutex_lock(mutex_t* lock) -{ - pthread_mutex_lock(lock); -} -static __inline__ void mutex_unlock(mutex_t* lock) -{ - pthread_mutex_unlock(lock); -} -static __inline__ int mutex_init(mutex_t* lock) -{ - return pthread_mutex_init(lock, NULL); -} -static __inline__ void mutex_destroy(mutex_t* lock) -{ - pthread_mutex_destroy(lock); -} -#endif - -#ifdef HAVE_WIN32_THREADS -typedef struct { - int init; - CRITICAL_SECTION lock[1]; -} mutex_t; - -#define MUTEX_INITIALIZER { 0, {{ NULL, 0, 0, NULL, NULL, 0 }} } - -static __inline__ void mutex_lock(mutex_t* lock) -{ - if (!lock->init) { - lock->init = 1; - InitializeCriticalSection( lock->lock ); - lock->init = 2; - } else while (lock->init != 2) - Sleep(10); - - EnterCriticalSection(lock->lock); -} - -static __inline__ void mutex_unlock(mutex_t* lock) -{ - LeaveCriticalSection(lock->lock); -} -static __inline__ int mutex_init(mutex_t* lock) -{ - InitializeCriticalSection(lock->lock); - lock->init = 2; - return 0; -} -static __inline__ void mutex_destroy(mutex_t* lock) -{ - if (lock->init) { - lock->init = 0; - DeleteCriticalSection(lock->lock); - } -} -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* _LIBS_CUTILS_THREADS_H */ diff --git a/external/android/include/14/system/core/include/cutils/tztime.h b/external/android/include/14/system/core/include/cutils/tztime.h deleted file mode 100644 index cf103ca..0000000 --- a/external/android/include/14/system/core/include/cutils/tztime.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2006 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 _CUTILS_TZTIME_H -#define _CUTILS_TZTIME_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -time_t mktime_tz(struct tm * const tmp, char const * tz); -void localtime_tz(const time_t * const timep, struct tm * tmp, const char* tz); - -#ifndef HAVE_ANDROID_OS -/* the following is defined in in Bionic */ - -struct strftime_locale { - const char *mon[12]; /* short names */ - const char *month[12]; /* long names */ - const char *standalone_month[12]; /* long standalone names */ - const char *wday[7]; /* short names */ - const char *weekday[7]; /* long names */ - const char *X_fmt; - const char *x_fmt; - const char *c_fmt; - const char *am; - const char *pm; - const char *date_fmt; -}; - -size_t strftime_tz(char *s, size_t max, const char *format, const struct tm *tm, const struct strftime_locale *locale); - -#endif /* !HAVE_ANDROID_OS */ - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_TZTIME_H */ - diff --git a/external/android/include/14/system/core/include/cutils/uevent.h b/external/android/include/14/system/core/include/cutils/uevent.h deleted file mode 100644 index 4ebc300..0000000 --- a/external/android/include/14/system/core/include/cutils/uevent.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2011 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 __CUTILS_UEVENT_H -#define __CUTILS_UEVENT_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -int uevent_open_socket(int buf_sz, bool passcred); -ssize_t uevent_kernel_multicast_recv(int socket, void *buffer, size_t length); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_UEVENT_H */ diff --git a/external/android/include/14/system/core/include/cutils/uio.h b/external/android/include/14/system/core/include/cutils/uio.h deleted file mode 100644 index 01a74d2..0000000 --- a/external/android/include/14/system/core/include/cutils/uio.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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. - */ - -// -// implementation of sys/uio.h for platforms that don't have it (Win32) -// -#ifndef _LIBS_CUTILS_UIO_H -#define _LIBS_CUTILS_UIO_H - -#ifdef HAVE_SYS_UIO_H -#include -#else - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -struct iovec { - const void* iov_base; - size_t iov_len; -}; - -extern int readv( int fd, struct iovec* vecs, int count ); -extern int writev( int fd, const struct iovec* vecs, int count ); - -#ifdef __cplusplus -} -#endif - -#endif /* !HAVE_SYS_UIO_H */ - -#endif /* _LIBS_UTILS_UIO_H */ - diff --git a/external/android/include/14/system/core/include/cutils/zygote.h b/external/android/include/14/system/core/include/cutils/zygote.h deleted file mode 100644 index 22721a6..0000000 --- a/external/android/include/14/system/core/include/cutils/zygote.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 __CUTILS_ZYGOTE_H -#define __CUTILS_ZYGOTE_H - -#ifdef __cplusplus -extern "C" { -#endif - -int zygote_run_oneshot(int sendStdio, int argc, const char **argv); -int zygote_run(int argc, const char **argv); -int zygote_run_wait(int argc, const char **argv, void (*post_run_func)(int)); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_ZYGOTE_H */ diff --git a/external/android/include/14/system/core/include/pixelflinger/format.h b/external/android/include/14/system/core/include/pixelflinger/format.h deleted file mode 100644 index 82eeca4..0000000 --- a/external/android/include/14/system/core/include/pixelflinger/format.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (C) 2005 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_PIXELFLINGER_FORMAT_H -#define ANDROID_PIXELFLINGER_FORMAT_H - -#include -#include - -enum GGLPixelFormat { - // these constants need to match those - // in graphics/PixelFormat.java, ui/PixelFormat.h, BlitHardware.h - GGL_PIXEL_FORMAT_UNKNOWN = 0, - GGL_PIXEL_FORMAT_NONE = 0, - - GGL_PIXEL_FORMAT_RGBA_8888 = 1, // 4x8-bit ARGB - GGL_PIXEL_FORMAT_RGBX_8888 = 2, // 3x8-bit RGB stored in 32-bit chunks - GGL_PIXEL_FORMAT_RGB_888 = 3, // 3x8-bit RGB - GGL_PIXEL_FORMAT_RGB_565 = 4, // 16-bit RGB - GGL_PIXEL_FORMAT_BGRA_8888 = 5, // 4x8-bit BGRA - GGL_PIXEL_FORMAT_RGBA_5551 = 6, // 16-bit RGBA - GGL_PIXEL_FORMAT_RGBA_4444 = 7, // 16-bit RGBA - - GGL_PIXEL_FORMAT_A_8 = 8, // 8-bit A - GGL_PIXEL_FORMAT_L_8 = 9, // 8-bit L (R=G=B = L) - GGL_PIXEL_FORMAT_LA_88 = 0xA, // 16-bit LA - GGL_PIXEL_FORMAT_RGB_332 = 0xB, // 8-bit RGB (non paletted) - - // reserved range. don't use. - GGL_PIXEL_FORMAT_RESERVED_10 = 0x10, - GGL_PIXEL_FORMAT_RESERVED_11 = 0x11, - GGL_PIXEL_FORMAT_RESERVED_12 = 0x12, - GGL_PIXEL_FORMAT_RESERVED_13 = 0x13, - GGL_PIXEL_FORMAT_RESERVED_14 = 0x14, - GGL_PIXEL_FORMAT_RESERVED_15 = 0x15, - GGL_PIXEL_FORMAT_RESERVED_16 = 0x16, - GGL_PIXEL_FORMAT_RESERVED_17 = 0x17, - - // reserved/special formats - GGL_PIXEL_FORMAT_Z_16 = 0x18, - GGL_PIXEL_FORMAT_S_8 = 0x19, - GGL_PIXEL_FORMAT_SZ_24 = 0x1A, - GGL_PIXEL_FORMAT_SZ_8 = 0x1B, - - // reserved range. don't use. - GGL_PIXEL_FORMAT_RESERVED_20 = 0x20, - GGL_PIXEL_FORMAT_RESERVED_21 = 0x21, -}; - -enum GGLFormatComponents { - GGL_STENCIL_INDEX = 0x1901, - GGL_DEPTH_COMPONENT = 0x1902, - GGL_ALPHA = 0x1906, - GGL_RGB = 0x1907, - GGL_RGBA = 0x1908, - GGL_LUMINANCE = 0x1909, - GGL_LUMINANCE_ALPHA = 0x190A, -}; - -enum GGLFormatComponentIndex { - GGL_INDEX_ALPHA = 0, - GGL_INDEX_RED = 1, - GGL_INDEX_GREEN = 2, - GGL_INDEX_BLUE = 3, - GGL_INDEX_STENCIL = 0, - GGL_INDEX_DEPTH = 1, - GGL_INDEX_Y = 0, - GGL_INDEX_CB = 1, - GGL_INDEX_CR = 2, -}; - -typedef struct { -#ifdef __cplusplus - enum { - ALPHA = GGL_INDEX_ALPHA, - RED = GGL_INDEX_RED, - GREEN = GGL_INDEX_GREEN, - BLUE = GGL_INDEX_BLUE, - STENCIL = GGL_INDEX_STENCIL, - DEPTH = GGL_INDEX_DEPTH, - LUMA = GGL_INDEX_Y, - CHROMAB = GGL_INDEX_CB, - CHROMAR = GGL_INDEX_CR, - }; - inline uint32_t mask(int i) const { - return ((1<<(c[i].h-c[i].l))-1)< -#include - -#include - -// GGL types - -typedef int8_t GGLbyte; // b -typedef int16_t GGLshort; // s -typedef int32_t GGLint; // i -typedef ssize_t GGLsizei; // i -typedef int32_t GGLfixed; // x -typedef int32_t GGLclampx; // x -typedef float GGLfloat; // f -typedef float GGLclampf; // f -typedef double GGLdouble; // d -typedef double GGLclampd; // d -typedef uint8_t GGLubyte; // ub -typedef uint8_t GGLboolean; // ub -typedef uint16_t GGLushort; // us -typedef uint32_t GGLuint; // ui -typedef unsigned int GGLenum; // ui -typedef unsigned int GGLbitfield; // ui -typedef void GGLvoid; -typedef int32_t GGLfixed32; -typedef int32_t GGLcolor; -typedef int32_t GGLcoord; - -// ---------------------------------------------------------------------------- - -#define GGL_MAX_VIEWPORT_DIMS 4096 -#define GGL_MAX_TEXTURE_SIZE 4096 -#define GGL_MAX_ALIASED_POINT_SIZE 0x7FFFFFF -#define GGL_MAX_SMOOTH_POINT_SIZE 2048 -#define GGL_MAX_SMOOTH_LINE_WIDTH 2048 - -// ---------------------------------------------------------------------------- - -// All these names are compatible with their OpenGL equivalents -// some of them are listed only for completeness -enum GGLNames { - GGL_FALSE = 0, - GGL_TRUE = 1, - - // enable/disable - GGL_SCISSOR_TEST = 0x0C11, - GGL_TEXTURE_2D = 0x0DE1, - GGL_ALPHA_TEST = 0x0BC0, - GGL_BLEND = 0x0BE2, - GGL_COLOR_LOGIC_OP = 0x0BF2, - GGL_DITHER = 0x0BD0, - GGL_STENCIL_TEST = 0x0B90, - GGL_DEPTH_TEST = 0x0B71, - GGL_AA = 0x80000001, - GGL_W_LERP = 0x80000004, - GGL_POINT_SMOOTH_NICE = 0x80000005, - - // buffers, pixel drawing/reading - GGL_COLOR = 0x1800, - - // fog - GGL_FOG = 0x0B60, - - // shade model - GGL_FLAT = 0x1D00, - GGL_SMOOTH = 0x1D01, - - // Texture parameter name - GGL_TEXTURE_MIN_FILTER = 0x2801, - GGL_TEXTURE_MAG_FILTER = 0x2800, - GGL_TEXTURE_WRAP_S = 0x2802, - GGL_TEXTURE_WRAP_T = 0x2803, - GGL_TEXTURE_WRAP_R = 0x2804, - - // Texture Filter - GGL_NEAREST = 0x2600, - GGL_LINEAR = 0x2601, - GGL_NEAREST_MIPMAP_NEAREST = 0x2700, - GGL_LINEAR_MIPMAP_NEAREST = 0x2701, - GGL_NEAREST_MIPMAP_LINEAR = 0x2702, - GGL_LINEAR_MIPMAP_LINEAR = 0x2703, - - // Texture Wrap Mode - GGL_CLAMP = 0x2900, - GGL_REPEAT = 0x2901, - GGL_CLAMP_TO_EDGE = 0x812F, - - // Texture Env Mode - GGL_REPLACE = 0x1E01, - GGL_MODULATE = 0x2100, - GGL_DECAL = 0x2101, - GGL_ADD = 0x0104, - - // Texture Env Parameter - GGL_TEXTURE_ENV_MODE = 0x2200, - GGL_TEXTURE_ENV_COLOR = 0x2201, - - // Texture Env Target - GGL_TEXTURE_ENV = 0x2300, - - // Texture coord generation - GGL_TEXTURE_GEN_MODE = 0x2500, - GGL_S = 0x2000, - GGL_T = 0x2001, - GGL_R = 0x2002, - GGL_Q = 0x2003, - GGL_ONE_TO_ONE = 0x80000002, - GGL_AUTOMATIC = 0x80000003, - - // AlphaFunction - GGL_NEVER = 0x0200, - GGL_LESS = 0x0201, - GGL_EQUAL = 0x0202, - GGL_LEQUAL = 0x0203, - GGL_GREATER = 0x0204, - GGL_NOTEQUAL = 0x0205, - GGL_GEQUAL = 0x0206, - GGL_ALWAYS = 0x0207, - - // LogicOp - GGL_CLEAR = 0x1500, // 0 - GGL_AND = 0x1501, // s & d - GGL_AND_REVERSE = 0x1502, // s & ~d - GGL_COPY = 0x1503, // s - GGL_AND_INVERTED = 0x1504, // ~s & d - GGL_NOOP = 0x1505, // d - GGL_XOR = 0x1506, // s ^ d - GGL_OR = 0x1507, // s | d - GGL_NOR = 0x1508, // ~(s | d) - GGL_EQUIV = 0x1509, // ~(s ^ d) - GGL_INVERT = 0x150A, // ~d - GGL_OR_REVERSE = 0x150B, // s | ~d - GGL_COPY_INVERTED = 0x150C, // ~s - GGL_OR_INVERTED = 0x150D, // ~s | d - GGL_NAND = 0x150E, // ~(s & d) - GGL_SET = 0x150F, // 1 - - // blending equation & function - GGL_ZERO = 0, // SD - GGL_ONE = 1, // SD - GGL_SRC_COLOR = 0x0300, // D - GGL_ONE_MINUS_SRC_COLOR = 0x0301, // D - GGL_SRC_ALPHA = 0x0302, // SD - GGL_ONE_MINUS_SRC_ALPHA = 0x0303, // SD - GGL_DST_ALPHA = 0x0304, // SD - GGL_ONE_MINUS_DST_ALPHA = 0x0305, // SD - GGL_DST_COLOR = 0x0306, // S - GGL_ONE_MINUS_DST_COLOR = 0x0307, // S - GGL_SRC_ALPHA_SATURATE = 0x0308, // S - - // clear bits - GGL_DEPTH_BUFFER_BIT = 0x00000100, - GGL_STENCIL_BUFFER_BIT = 0x00000400, - GGL_COLOR_BUFFER_BIT = 0x00004000, - - // errors - GGL_NO_ERROR = 0, - GGL_INVALID_ENUM = 0x0500, - GGL_INVALID_VALUE = 0x0501, - GGL_INVALID_OPERATION = 0x0502, - GGL_STACK_OVERFLOW = 0x0503, - GGL_STACK_UNDERFLOW = 0x0504, - GGL_OUT_OF_MEMORY = 0x0505 -}; - -// ---------------------------------------------------------------------------- - -typedef struct { - GGLsizei version; // always set to sizeof(GGLSurface) - GGLuint width; // width in pixels - GGLuint height; // height in pixels - GGLint stride; // stride in pixels - GGLubyte* data; // pointer to the bits - GGLubyte format; // pixel format - GGLubyte rfu[3]; // must be zero - // these values are dependent on the used format - union { - GGLint compressedFormat; - GGLint vstride; - }; - void* reserved; -} GGLSurface; - - -typedef struct { - // immediate rendering - void (*pointx)(void *con, const GGLcoord* v, GGLcoord r); - void (*linex)(void *con, - const GGLcoord* v0, const GGLcoord* v1, GGLcoord width); - void (*recti)(void* c, GGLint l, GGLint t, GGLint r, GGLint b); - void (*trianglex)(void* c, - GGLcoord const* v0, GGLcoord const* v1, GGLcoord const* v2); - - // scissor - void (*scissor)(void* c, GGLint x, GGLint y, GGLsizei width, GGLsizei height); - - // Set the textures and color buffers - void (*activeTexture)(void* c, GGLuint tmu); - void (*bindTexture)(void* c, const GGLSurface* surface); - void (*colorBuffer)(void* c, const GGLSurface* surface); - void (*readBuffer)(void* c, const GGLSurface* surface); - void (*depthBuffer)(void* c, const GGLSurface* surface); - void (*bindTextureLod)(void* c, GGLuint tmu, const GGLSurface* surface); - - // enable/disable features - void (*enable)(void* c, GGLenum name); - void (*disable)(void* c, GGLenum name); - void (*enableDisable)(void* c, GGLenum name, GGLboolean en); - - // specify the fragment's color - void (*shadeModel)(void* c, GGLenum mode); - void (*color4xv)(void* c, const GGLclampx* color); - // specify color iterators (16.16) - void (*colorGrad12xv)(void* c, const GGLcolor* grad); - - // specify Z coordinate iterators (0.32) - void (*zGrad3xv)(void* c, const GGLfixed32* grad); - - // specify W coordinate iterators (16.16) - void (*wGrad3xv)(void* c, const GGLfixed* grad); - - // specify fog iterator & color (16.16) - void (*fogGrad3xv)(void* c, const GGLfixed* grad); - void (*fogColor3xv)(void* c, const GGLclampx* color); - - // specify blending parameters - void (*blendFunc)(void* c, GGLenum src, GGLenum dst); - void (*blendFuncSeparate)(void* c, GGLenum src, GGLenum dst, - GGLenum srcAlpha, GGLenum dstAplha); - - // texture environnement (REPLACE / MODULATE / DECAL / BLEND) - void (*texEnvi)(void* c, GGLenum target, - GGLenum pname, - GGLint param); - - void (*texEnvxv)(void* c, GGLenum target, - GGLenum pname, const GGLfixed* params); - - // texture parameters (Wrapping, filter) - void (*texParameteri)(void* c, GGLenum target, - GGLenum pname, - GGLint param); - - // texture iterators (16.16) - void (*texCoord2i)(void* c, GGLint s, GGLint t); - void (*texCoord2x)(void* c, GGLfixed s, GGLfixed t); - - // s, dsdx, dsdy, scale, t, dtdx, dtdy, tscale - // This api uses block floating-point for S and T texture coordinates. - // All values are given in 16.16, scaled by 'scale'. In other words, - // set scale to 0, for 16.16 values. - void (*texCoordGradScale8xv)(void* c, GGLint tmu, const int32_t* grad8); - - void (*texGeni)(void* c, GGLenum coord, GGLenum pname, GGLint param); - - // masking - void (*colorMask)(void* c, GGLboolean red, - GGLboolean green, - GGLboolean blue, - GGLboolean alpha); - - void (*depthMask)(void* c, GGLboolean flag); - - void (*stencilMask)(void* c, GGLuint mask); - - // alpha func - void (*alphaFuncx)(void* c, GGLenum func, GGLclampx ref); - - // depth func - void (*depthFunc)(void* c, GGLenum func); - - // logic op - void (*logicOp)(void* c, GGLenum opcode); - - // clear - void (*clear)(void* c, GGLbitfield mask); - void (*clearColorx)(void* c, - GGLclampx r, GGLclampx g, GGLclampx b, GGLclampx a); - void (*clearDepthx)(void* c, GGLclampx depth); - void (*clearStencil)(void* c, GGLint s); - - // framebuffer operations - void (*copyPixels)(void* c, GGLint x, GGLint y, - GGLsizei width, GGLsizei height, GGLenum type); - void (*rasterPos2x)(void* c, GGLfixed x, GGLfixed y); - void (*rasterPos2i)(void* c, GGLint x, GGLint y); -} GGLContext; - -// ---------------------------------------------------------------------------- - -#ifdef __cplusplus -extern "C" { -#endif - -// construct / destroy the context -ssize_t gglInit(GGLContext** context); -ssize_t gglUninit(GGLContext* context); - -GGLint gglBitBlit( - GGLContext* c, - int tmu, - GGLint crop[4], - GGLint where[4]); - -#ifdef __cplusplus -}; -#endif - -// ---------------------------------------------------------------------------- - -#endif // ANDROID_PIXELFLINGER_H diff --git a/external/android/include/14/system/core/include/system/audio.h b/external/android/include/14/system/core/include/system/audio.h deleted file mode 100644 index 52ba5e7..0000000 --- a/external/android/include/14/system/core/include/system/audio.h +++ /dev/null @@ -1,434 +0,0 @@ -/* - * Copyright (C) 2011 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_AUDIO_CORE_H -#define ANDROID_AUDIO_CORE_H - -#include -#include -#include -#include - -#include - -__BEGIN_DECLS - -/* The enums were moved here mostly from - * frameworks/base/include/media/AudioSystem.h - */ - -typedef int audio_io_handle_t; - -/* Audio stream types */ -typedef enum { - AUDIO_STREAM_DEFAULT = -1, - AUDIO_STREAM_VOICE_CALL = 0, - AUDIO_STREAM_SYSTEM = 1, - AUDIO_STREAM_RING = 2, - AUDIO_STREAM_MUSIC = 3, - AUDIO_STREAM_ALARM = 4, - AUDIO_STREAM_NOTIFICATION = 5, - AUDIO_STREAM_BLUETOOTH_SCO = 6, - AUDIO_STREAM_ENFORCED_AUDIBLE = 7, /* Sounds that cannot be muted by user and must be routed to speaker */ - AUDIO_STREAM_DTMF = 8, - AUDIO_STREAM_TTS = 9, - - AUDIO_STREAM_CNT, - AUDIO_STREAM_MAX = AUDIO_STREAM_CNT - 1, -} audio_stream_type_t; - -/* Do not change these values without updating their counterparts - * in media/java/android/media/MediaRecorder.java! - */ -typedef enum { - AUDIO_SOURCE_DEFAULT = 0, - AUDIO_SOURCE_MIC = 1, - AUDIO_SOURCE_VOICE_UPLINK = 2, - AUDIO_SOURCE_VOICE_DOWNLINK = 3, - AUDIO_SOURCE_VOICE_CALL = 4, - AUDIO_SOURCE_CAMCORDER = 5, - AUDIO_SOURCE_VOICE_RECOGNITION = 6, - AUDIO_SOURCE_VOICE_COMMUNICATION = 7, - - AUDIO_SOURCE_CNT, - AUDIO_SOURCE_MAX = AUDIO_SOURCE_CNT - 1, -} audio_source_t; - -/* special audio session values - * (XXX: should this be living in the audio effects land?) - */ -typedef enum { - /* session for effects attached to a particular output stream - * (value must be less than 0) - */ - AUDIO_SESSION_OUTPUT_STAGE = -1, - - /* session for effects applied to output mix. These effects can - * be moved by audio policy manager to another output stream - * (value must be 0) - */ - AUDIO_SESSION_OUTPUT_MIX = 0, -} audio_session_t; - -/* Audio sub formats (see enum audio_format). */ - -/* PCM sub formats */ -typedef enum { - AUDIO_FORMAT_PCM_SUB_16_BIT = 0x1, /* DO NOT CHANGE - PCM signed 16 bits */ - AUDIO_FORMAT_PCM_SUB_8_BIT = 0x2, /* DO NOT CHANGE - PCM unsigned 8 bits */ - AUDIO_FORMAT_PCM_SUB_32_BIT = 0x3, /* PCM signed .31 fixed point */ - AUDIO_FORMAT_PCM_SUB_8_24_BIT = 0x4, /* PCM signed 7.24 fixed point */ -} audio_format_pcm_sub_fmt_t; - -/* MP3 sub format field definition : can use 11 LSBs in the same way as MP3 - * frame header to specify bit rate, stereo mode, version... - */ -typedef enum { - AUDIO_FORMAT_MP3_SUB_NONE = 0x0, -} audio_format_mp3_sub_fmt_t; - -/* AMR NB/WB sub format field definition: specify frame block interleaving, - * bandwidth efficient or octet aligned, encoding mode for recording... - */ -typedef enum { - AUDIO_FORMAT_AMR_SUB_NONE = 0x0, -} audio_format_amr_sub_fmt_t; - -/* AAC sub format field definition: specify profile or bitrate for recording... */ -typedef enum { - AUDIO_FORMAT_AAC_SUB_NONE = 0x0, -} audio_format_aac_sub_fmt_t; - -/* VORBIS sub format field definition: specify quality for recording... */ -typedef enum { - AUDIO_FORMAT_VORBIS_SUB_NONE = 0x0, -} audio_format_vorbis_sub_fmt_t; - -/* Audio format consists in a main format field (upper 8 bits) and a sub format - * field (lower 24 bits). - * - * The main format indicates the main codec type. The sub format field - * indicates options and parameters for each format. The sub format is mainly - * used for record to indicate for instance the requested bitrate or profile. - * It can also be used for certain formats to give informations not present in - * the encoded audio stream (e.g. octet alignement for AMR). - */ -typedef enum { - AUDIO_FORMAT_INVALID = 0xFFFFFFFFUL, - AUDIO_FORMAT_DEFAULT = 0, - AUDIO_FORMAT_PCM = 0x00000000UL, /* DO NOT CHANGE */ - AUDIO_FORMAT_MP3 = 0x01000000UL, - AUDIO_FORMAT_AMR_NB = 0x02000000UL, - AUDIO_FORMAT_AMR_WB = 0x03000000UL, - AUDIO_FORMAT_AAC = 0x04000000UL, - AUDIO_FORMAT_HE_AAC_V1 = 0x05000000UL, - AUDIO_FORMAT_HE_AAC_V2 = 0x06000000UL, - AUDIO_FORMAT_VORBIS = 0x07000000UL, - AUDIO_FORMAT_MAIN_MASK = 0xFF000000UL, - AUDIO_FORMAT_SUB_MASK = 0x00FFFFFFUL, - - /* Aliases */ - AUDIO_FORMAT_PCM_16_BIT = (AUDIO_FORMAT_PCM | - AUDIO_FORMAT_PCM_SUB_16_BIT), - AUDIO_FORMAT_PCM_8_BIT = (AUDIO_FORMAT_PCM | - AUDIO_FORMAT_PCM_SUB_8_BIT), - AUDIO_FORMAT_PCM_32_BIT = (AUDIO_FORMAT_PCM | - AUDIO_FORMAT_PCM_SUB_32_BIT), - AUDIO_FORMAT_PCM_8_24_BIT = (AUDIO_FORMAT_PCM | - AUDIO_FORMAT_PCM_SUB_8_24_BIT), -} audio_format_t; - -typedef enum { - /* output channels */ - AUDIO_CHANNEL_OUT_FRONT_LEFT = 0x1, - AUDIO_CHANNEL_OUT_FRONT_RIGHT = 0x2, - AUDIO_CHANNEL_OUT_FRONT_CENTER = 0x4, - AUDIO_CHANNEL_OUT_LOW_FREQUENCY = 0x8, - AUDIO_CHANNEL_OUT_BACK_LEFT = 0x10, - AUDIO_CHANNEL_OUT_BACK_RIGHT = 0x20, - AUDIO_CHANNEL_OUT_FRONT_LEFT_OF_CENTER = 0x40, - AUDIO_CHANNEL_OUT_FRONT_RIGHT_OF_CENTER = 0x80, - AUDIO_CHANNEL_OUT_BACK_CENTER = 0x100, - AUDIO_CHANNEL_OUT_SIDE_LEFT = 0x200, - AUDIO_CHANNEL_OUT_SIDE_RIGHT = 0x400, - AUDIO_CHANNEL_OUT_TOP_CENTER = 0x800, - AUDIO_CHANNEL_OUT_TOP_FRONT_LEFT = 0x1000, - AUDIO_CHANNEL_OUT_TOP_FRONT_CENTER = 0x2000, - AUDIO_CHANNEL_OUT_TOP_FRONT_RIGHT = 0x4000, - AUDIO_CHANNEL_OUT_TOP_BACK_LEFT = 0x8000, - AUDIO_CHANNEL_OUT_TOP_BACK_CENTER = 0x10000, - AUDIO_CHANNEL_OUT_TOP_BACK_RIGHT = 0x20000, - - AUDIO_CHANNEL_OUT_MONO = AUDIO_CHANNEL_OUT_FRONT_LEFT, - AUDIO_CHANNEL_OUT_STEREO = (AUDIO_CHANNEL_OUT_FRONT_LEFT | - AUDIO_CHANNEL_OUT_FRONT_RIGHT), - AUDIO_CHANNEL_OUT_QUAD = (AUDIO_CHANNEL_OUT_FRONT_LEFT | - AUDIO_CHANNEL_OUT_FRONT_RIGHT | - AUDIO_CHANNEL_OUT_BACK_LEFT | - AUDIO_CHANNEL_OUT_BACK_RIGHT), - AUDIO_CHANNEL_OUT_SURROUND = (AUDIO_CHANNEL_OUT_FRONT_LEFT | - AUDIO_CHANNEL_OUT_FRONT_RIGHT | - AUDIO_CHANNEL_OUT_FRONT_CENTER | - AUDIO_CHANNEL_OUT_BACK_CENTER), - AUDIO_CHANNEL_OUT_5POINT1 = (AUDIO_CHANNEL_OUT_FRONT_LEFT | - AUDIO_CHANNEL_OUT_FRONT_RIGHT | - AUDIO_CHANNEL_OUT_FRONT_CENTER | - AUDIO_CHANNEL_OUT_LOW_FREQUENCY | - AUDIO_CHANNEL_OUT_BACK_LEFT | - AUDIO_CHANNEL_OUT_BACK_RIGHT), - // matches the correct AudioFormat.CHANNEL_OUT_7POINT1_SURROUND definition for 7.1 - AUDIO_CHANNEL_OUT_7POINT1 = (AUDIO_CHANNEL_OUT_FRONT_LEFT | - AUDIO_CHANNEL_OUT_FRONT_RIGHT | - AUDIO_CHANNEL_OUT_FRONT_CENTER | - AUDIO_CHANNEL_OUT_LOW_FREQUENCY | - AUDIO_CHANNEL_OUT_BACK_LEFT | - AUDIO_CHANNEL_OUT_BACK_RIGHT | - AUDIO_CHANNEL_OUT_SIDE_LEFT | - AUDIO_CHANNEL_OUT_SIDE_RIGHT), - AUDIO_CHANNEL_OUT_ALL = (AUDIO_CHANNEL_OUT_FRONT_LEFT | - AUDIO_CHANNEL_OUT_FRONT_RIGHT | - AUDIO_CHANNEL_OUT_FRONT_CENTER | - AUDIO_CHANNEL_OUT_LOW_FREQUENCY | - AUDIO_CHANNEL_OUT_BACK_LEFT | - AUDIO_CHANNEL_OUT_BACK_RIGHT | - AUDIO_CHANNEL_OUT_FRONT_LEFT_OF_CENTER | - AUDIO_CHANNEL_OUT_FRONT_RIGHT_OF_CENTER | - AUDIO_CHANNEL_OUT_BACK_CENTER| - AUDIO_CHANNEL_OUT_SIDE_LEFT| - AUDIO_CHANNEL_OUT_SIDE_RIGHT| - AUDIO_CHANNEL_OUT_TOP_CENTER| - AUDIO_CHANNEL_OUT_TOP_FRONT_LEFT| - AUDIO_CHANNEL_OUT_TOP_FRONT_CENTER| - AUDIO_CHANNEL_OUT_TOP_FRONT_RIGHT| - AUDIO_CHANNEL_OUT_TOP_BACK_LEFT| - AUDIO_CHANNEL_OUT_TOP_BACK_CENTER| - AUDIO_CHANNEL_OUT_TOP_BACK_RIGHT), - - /* input channels */ - AUDIO_CHANNEL_IN_LEFT = 0x4, - AUDIO_CHANNEL_IN_RIGHT = 0x8, - AUDIO_CHANNEL_IN_FRONT = 0x10, - AUDIO_CHANNEL_IN_BACK = 0x20, - AUDIO_CHANNEL_IN_LEFT_PROCESSED = 0x40, - AUDIO_CHANNEL_IN_RIGHT_PROCESSED = 0x80, - AUDIO_CHANNEL_IN_FRONT_PROCESSED = 0x100, - AUDIO_CHANNEL_IN_BACK_PROCESSED = 0x200, - AUDIO_CHANNEL_IN_PRESSURE = 0x400, - AUDIO_CHANNEL_IN_X_AXIS = 0x800, - AUDIO_CHANNEL_IN_Y_AXIS = 0x1000, - AUDIO_CHANNEL_IN_Z_AXIS = 0x2000, - AUDIO_CHANNEL_IN_VOICE_UPLINK = 0x4000, - AUDIO_CHANNEL_IN_VOICE_DNLINK = 0x8000, - - AUDIO_CHANNEL_IN_MONO = AUDIO_CHANNEL_IN_FRONT, - AUDIO_CHANNEL_IN_STEREO = (AUDIO_CHANNEL_IN_LEFT | AUDIO_CHANNEL_IN_RIGHT), - AUDIO_CHANNEL_IN_ALL = (AUDIO_CHANNEL_IN_LEFT | - AUDIO_CHANNEL_IN_RIGHT | - AUDIO_CHANNEL_IN_FRONT | - AUDIO_CHANNEL_IN_BACK| - AUDIO_CHANNEL_IN_LEFT_PROCESSED | - AUDIO_CHANNEL_IN_RIGHT_PROCESSED | - AUDIO_CHANNEL_IN_FRONT_PROCESSED | - AUDIO_CHANNEL_IN_BACK_PROCESSED| - AUDIO_CHANNEL_IN_PRESSURE | - AUDIO_CHANNEL_IN_X_AXIS | - AUDIO_CHANNEL_IN_Y_AXIS | - AUDIO_CHANNEL_IN_Z_AXIS | - AUDIO_CHANNEL_IN_VOICE_UPLINK | - AUDIO_CHANNEL_IN_VOICE_DNLINK), -} audio_channels_t; - -typedef enum { - AUDIO_MODE_INVALID = -2, - AUDIO_MODE_CURRENT = -1, - AUDIO_MODE_NORMAL = 0, - AUDIO_MODE_RINGTONE = 1, - AUDIO_MODE_IN_CALL = 2, - AUDIO_MODE_IN_COMMUNICATION = 3, - - AUDIO_MODE_CNT, - AUDIO_MODE_MAX = AUDIO_MODE_CNT - 1, -} audio_mode_t; - -typedef enum { - AUDIO_IN_ACOUSTICS_AGC_ENABLE = 0x0001, - AUDIO_IN_ACOUSTICS_AGC_DISABLE = 0, - AUDIO_IN_ACOUSTICS_NS_ENABLE = 0x0002, - AUDIO_IN_ACOUSTICS_NS_DISABLE = 0, - AUDIO_IN_ACOUSTICS_TX_IIR_ENABLE = 0x0004, - AUDIO_IN_ACOUSTICS_TX_DISABLE = 0, -} audio_in_acoustics_t; - -typedef enum { - /* output devices */ - AUDIO_DEVICE_OUT_EARPIECE = 0x1, - AUDIO_DEVICE_OUT_SPEAKER = 0x2, - AUDIO_DEVICE_OUT_WIRED_HEADSET = 0x4, - AUDIO_DEVICE_OUT_WIRED_HEADPHONE = 0x8, - AUDIO_DEVICE_OUT_BLUETOOTH_SCO = 0x10, - AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET = 0x20, - AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT = 0x40, - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP = 0x80, - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES = 0x100, - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER = 0x200, - AUDIO_DEVICE_OUT_AUX_DIGITAL = 0x400, - AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET = 0x800, - AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET = 0x1000, - AUDIO_DEVICE_OUT_DEFAULT = 0x8000, - AUDIO_DEVICE_OUT_ALL = (AUDIO_DEVICE_OUT_EARPIECE | - AUDIO_DEVICE_OUT_SPEAKER | - AUDIO_DEVICE_OUT_WIRED_HEADSET | - AUDIO_DEVICE_OUT_WIRED_HEADPHONE | - AUDIO_DEVICE_OUT_BLUETOOTH_SCO | - AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET | - AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT | - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP | - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES | - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER | - AUDIO_DEVICE_OUT_AUX_DIGITAL | - AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET | - AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET | - AUDIO_DEVICE_OUT_DEFAULT), - AUDIO_DEVICE_OUT_ALL_A2DP = (AUDIO_DEVICE_OUT_BLUETOOTH_A2DP | - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES | - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER), - AUDIO_DEVICE_OUT_ALL_SCO = (AUDIO_DEVICE_OUT_BLUETOOTH_SCO | - AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET | - AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT), - - /* input devices */ - AUDIO_DEVICE_IN_COMMUNICATION = 0x10000, - AUDIO_DEVICE_IN_AMBIENT = 0x20000, - AUDIO_DEVICE_IN_BUILTIN_MIC = 0x40000, - AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET = 0x80000, - AUDIO_DEVICE_IN_WIRED_HEADSET = 0x100000, - AUDIO_DEVICE_IN_AUX_DIGITAL = 0x200000, - AUDIO_DEVICE_IN_VOICE_CALL = 0x400000, - AUDIO_DEVICE_IN_BACK_MIC = 0x800000, - AUDIO_DEVICE_IN_DEFAULT = 0x80000000, - - AUDIO_DEVICE_IN_ALL = (AUDIO_DEVICE_IN_COMMUNICATION | - AUDIO_DEVICE_IN_AMBIENT | - AUDIO_DEVICE_IN_BUILTIN_MIC | - AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET | - AUDIO_DEVICE_IN_WIRED_HEADSET | - AUDIO_DEVICE_IN_AUX_DIGITAL | - AUDIO_DEVICE_IN_VOICE_CALL | - AUDIO_DEVICE_IN_BACK_MIC | - AUDIO_DEVICE_IN_DEFAULT), - AUDIO_DEVICE_IN_ALL_SCO = AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET, -} audio_devices_t; - -static inline bool audio_is_output_device(audio_devices_t device) -{ - if ((popcount(device) == 1) && ((device & ~AUDIO_DEVICE_OUT_ALL) == 0)) - return true; - else - return false; -} - -static inline bool audio_is_input_device(audio_devices_t device) -{ - if ((popcount(device) == 1) && ((device & ~AUDIO_DEVICE_IN_ALL) == 0)) - return true; - else - return false; -} - -static inline bool audio_is_a2dp_device(audio_devices_t device) -{ - if ((popcount(device) == 1) && (device & AUDIO_DEVICE_OUT_ALL_A2DP)) - return true; - else - return false; -} - -static inline bool audio_is_bluetooth_sco_device(audio_devices_t device) -{ - if ((popcount(device) == 1) && (device & (AUDIO_DEVICE_OUT_ALL_SCO | - AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET))) - return true; - else - return false; -} - -static inline bool audio_is_input_channel(uint32_t channel) -{ - if ((channel & ~AUDIO_CHANNEL_IN_ALL) == 0) - return true; - else - return false; -} - -static inline bool audio_is_output_channel(uint32_t channel) -{ - if ((channel & ~AUDIO_CHANNEL_OUT_ALL) == 0) - return true; - else - return false; -} - -static inline bool audio_is_valid_format(uint32_t format) -{ - switch (format & AUDIO_FORMAT_MAIN_MASK) { - case AUDIO_FORMAT_PCM: - if (format != AUDIO_FORMAT_PCM_16_BIT && - format != AUDIO_FORMAT_PCM_8_BIT) { - return false; - } - case AUDIO_FORMAT_MP3: - case AUDIO_FORMAT_AMR_NB: - case AUDIO_FORMAT_AMR_WB: - case AUDIO_FORMAT_AAC: - case AUDIO_FORMAT_HE_AAC_V1: - case AUDIO_FORMAT_HE_AAC_V2: - case AUDIO_FORMAT_VORBIS: - return true; - default: - return false; - } -} - -static inline bool audio_is_linear_pcm(uint32_t format) -{ - return ((format & AUDIO_FORMAT_MAIN_MASK) == AUDIO_FORMAT_PCM); -} - -static inline size_t audio_bytes_per_sample(uint32_t format) -{ - size_t size = 0; - - switch (format) { - case AUDIO_FORMAT_PCM_32_BIT: - case AUDIO_FORMAT_PCM_8_24_BIT: - size = sizeof(int32_t); - break; - case AUDIO_FORMAT_PCM_16_BIT: - size = sizeof(int16_t); - break; - case AUDIO_FORMAT_PCM_8_BIT: - size = sizeof(uint8_t); - break; - default: - break; - } - return size; -} - -__END_DECLS - -#endif // ANDROID_AUDIO_CORE_H diff --git a/external/android/include/14/system/core/include/system/audio_policy.h b/external/android/include/14/system/core/include/system/audio_policy.h deleted file mode 100644 index 1e0af7d..0000000 --- a/external/android/include/14/system/core/include/system/audio_policy.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (C) 2011 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_AUDIO_POLICY_CORE_H -#define ANDROID_AUDIO_POLICY_CORE_H - -#include -#include -#include - -#include - -__BEGIN_DECLS - -/* The enums were moved here mostly from - * frameworks/base/include/media/AudioSystem.h - */ - -/* request to open a direct output with get_output() (by opposition to - * sharing an output with other AudioTracks) - */ -typedef enum { - AUDIO_POLICY_OUTPUT_FLAG_INDIRECT = 0x0, - AUDIO_POLICY_OUTPUT_FLAG_DIRECT = 0x1 -} audio_policy_output_flags_t; - -/* device categories used for audio_policy->set_force_use() */ -typedef enum { - AUDIO_POLICY_FORCE_NONE, - AUDIO_POLICY_FORCE_SPEAKER, - AUDIO_POLICY_FORCE_HEADPHONES, - AUDIO_POLICY_FORCE_BT_SCO, - AUDIO_POLICY_FORCE_BT_A2DP, - AUDIO_POLICY_FORCE_WIRED_ACCESSORY, - AUDIO_POLICY_FORCE_BT_CAR_DOCK, - AUDIO_POLICY_FORCE_BT_DESK_DOCK, - AUDIO_POLICY_FORCE_ANALOG_DOCK, - AUDIO_POLICY_FORCE_DIGITAL_DOCK, - - AUDIO_POLICY_FORCE_CFG_CNT, - AUDIO_POLICY_FORCE_CFG_MAX = AUDIO_POLICY_FORCE_CFG_CNT - 1, - - AUDIO_POLICY_FORCE_DEFAULT = AUDIO_POLICY_FORCE_NONE, -} audio_policy_forced_cfg_t; - -/* usages used for audio_policy->set_force_use() */ -typedef enum { - AUDIO_POLICY_FORCE_FOR_COMMUNICATION, - AUDIO_POLICY_FORCE_FOR_MEDIA, - AUDIO_POLICY_FORCE_FOR_RECORD, - AUDIO_POLICY_FORCE_FOR_DOCK, - - AUDIO_POLICY_FORCE_USE_CNT, - AUDIO_POLICY_FORCE_USE_MAX = AUDIO_POLICY_FORCE_USE_CNT - 1, -} audio_policy_force_use_t; - -/* device connection states used for audio_policy->set_device_connection_state() - */ -typedef enum { - AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE, - AUDIO_POLICY_DEVICE_STATE_AVAILABLE, - - AUDIO_POLICY_DEVICE_STATE_CNT, - AUDIO_POLICY_DEVICE_STATE_MAX = AUDIO_POLICY_DEVICE_STATE_CNT - 1, -} audio_policy_dev_state_t; - -typedef enum { - /* Used to generate a tone to notify the user of a - * notification/alarm/ringtone while they are in a call. */ - AUDIO_POLICY_TONE_IN_CALL_NOTIFICATION = 0, - - AUDIO_POLICY_TONE_CNT, - AUDIO_POLICY_TONE_MAX = AUDIO_POLICY_TONE_CNT - 1, -} audio_policy_tone_t; - - -static inline bool audio_is_low_visibility(audio_stream_type_t stream) -{ - switch (stream) { - case AUDIO_STREAM_SYSTEM: - case AUDIO_STREAM_NOTIFICATION: - case AUDIO_STREAM_RING: - return true; - default: - return false; - } -} - - -__END_DECLS - -#endif // ANDROID_AUDIO_POLICY_CORE_H diff --git a/external/android/include/14/system/core/include/system/camera.h b/external/android/include/14/system/core/include/system/camera.h deleted file mode 100644 index cdfa256..0000000 --- a/external/android/include/14/system/core/include/system/camera.h +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Copyright (C) 2011 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 SYSTEM_CORE_INCLUDE_ANDROID_CAMERA_H -#define SYSTEM_CORE_INCLUDE_ANDROID_CAMERA_H - -#include -#include -#include -#include -#include -#include - -__BEGIN_DECLS - -/** - * A set of bit masks for specifying how the received preview frames are - * handled before the previewCallback() call. - * - * The least significant 3 bits of an "int" value are used for this purpose: - * - * ..... 0 0 0 - * ^ ^ ^ - * | | |---------> determine whether the callback is enabled or not - * | |-----------> determine whether the callback is one-shot or not - * |-------------> determine whether the frame is copied out or not - * - * WARNING: When a frame is sent directly without copying, it is the frame - * receiver's responsiblity to make sure that the frame data won't get - * corrupted by subsequent preview frames filled by the camera. This flag is - * recommended only when copying out data brings significant performance price - * and the handling/processing of the received frame data is always faster than - * the preview frame rate so that data corruption won't occur. - * - * For instance, - * 1. 0x00 disables the callback. In this case, copy out and one shot bits - * are ignored. - * 2. 0x01 enables a callback without copying out the received frames. A - * typical use case is the Camcorder application to avoid making costly - * frame copies. - * 3. 0x05 is enabling a callback with frame copied out repeatedly. A typical - * use case is the Camera application. - * 4. 0x07 is enabling a callback with frame copied out only once. A typical - * use case is the Barcode scanner application. - */ - -enum { - CAMERA_FRAME_CALLBACK_FLAG_ENABLE_MASK = 0x01, - CAMERA_FRAME_CALLBACK_FLAG_ONE_SHOT_MASK = 0x02, - CAMERA_FRAME_CALLBACK_FLAG_COPY_OUT_MASK = 0x04, - /** Typical use cases */ - CAMERA_FRAME_CALLBACK_FLAG_NOOP = 0x00, - CAMERA_FRAME_CALLBACK_FLAG_CAMCORDER = 0x01, - CAMERA_FRAME_CALLBACK_FLAG_CAMERA = 0x05, - CAMERA_FRAME_CALLBACK_FLAG_BARCODE_SCANNER = 0x07 -}; - -/** msgType in notifyCallback and dataCallback functions */ -enum { - CAMERA_MSG_ERROR = 0x0001, // notifyCallback - CAMERA_MSG_SHUTTER = 0x0002, // notifyCallback - CAMERA_MSG_FOCUS = 0x0004, // notifyCallback - CAMERA_MSG_ZOOM = 0x0008, // notifyCallback - CAMERA_MSG_PREVIEW_FRAME = 0x0010, // dataCallback - CAMERA_MSG_VIDEO_FRAME = 0x0020, // data_timestamp_callback - CAMERA_MSG_POSTVIEW_FRAME = 0x0040, // dataCallback - CAMERA_MSG_RAW_IMAGE = 0x0080, // dataCallback - CAMERA_MSG_COMPRESSED_IMAGE = 0x0100, // dataCallback - CAMERA_MSG_RAW_IMAGE_NOTIFY = 0x0200, // dataCallback - // Preview frame metadata. This can be combined with - // CAMERA_MSG_PREVIEW_FRAME in dataCallback. For example, the apps can - // request FRAME and METADATA. Or the apps can request only FRAME or only - // METADATA. - CAMERA_MSG_PREVIEW_METADATA = 0x0400, // dataCallback - CAMERA_MSG_ALL_MSGS = 0xFFFF -}; - -/** cmdType in sendCommand functions */ -enum { - CAMERA_CMD_START_SMOOTH_ZOOM = 1, - CAMERA_CMD_STOP_SMOOTH_ZOOM = 2, - - /** - * Set the clockwise rotation of preview display (setPreviewDisplay) in - * degrees. This affects the preview frames and the picture displayed after - * snapshot. This method is useful for portrait mode applications. Note - * that preview display of front-facing cameras is flipped horizontally - * before the rotation, that is, the image is reflected along the central - * vertical axis of the camera sensor. So the users can see themselves as - * looking into a mirror. - * - * This does not affect the order of byte array of - * CAMERA_MSG_PREVIEW_FRAME, CAMERA_MSG_VIDEO_FRAME, - * CAMERA_MSG_POSTVIEW_FRAME, CAMERA_MSG_RAW_IMAGE, or - * CAMERA_MSG_COMPRESSED_IMAGE. This is allowed to be set during preview - * since API level 14. - */ - CAMERA_CMD_SET_DISPLAY_ORIENTATION = 3, - - /** - * cmdType to disable/enable shutter sound. In sendCommand passing arg1 = - * 0 will disable, while passing arg1 = 1 will enable the shutter sound. - */ - CAMERA_CMD_ENABLE_SHUTTER_SOUND = 4, - - /* cmdType to play recording sound */ - CAMERA_CMD_PLAY_RECORDING_SOUND = 5, - - /** - * Start the face detection. This should be called after preview is started. - * The camera will notify the listener of CAMERA_MSG_FACE and the detected - * faces in the preview frame. The detected faces may be the same as the - * previous ones. Apps should call CAMERA_CMD_STOP_FACE_DETECTION to stop - * the face detection. This method is supported if CameraParameters - * KEY_MAX_NUM_HW_DETECTED_FACES or KEY_MAX_NUM_SW_DETECTED_FACES is - * bigger than 0. Hardware and software face detection should not be running - * at the same time. If the face detection has started, apps should not send - * this again. - * - * In hardware face detection mode, CameraParameters KEY_WHITE_BALANCE, - * KEY_FOCUS_AREAS and KEY_METERING_AREAS have no effect. - * - * arg1 is the face detection type. It can be CAMERA_FACE_DETECTION_HW or - * CAMERA_FACE_DETECTION_SW. - */ - CAMERA_CMD_START_FACE_DETECTION = 6, - - /** - * Stop the face detection. - */ - CAMERA_CMD_STOP_FACE_DETECTION = 7, -}; - -/** camera fatal errors */ -enum { - CAMERA_ERROR_UNKNOWN = 1, - CAMERA_ERROR_SERVER_DIED = 100 -}; - -enum { - /** The facing of the camera is opposite to that of the screen. */ - CAMERA_FACING_BACK = 0, - /** The facing of the camera is the same as that of the screen. */ - CAMERA_FACING_FRONT = 1 -}; - -enum { - /** Hardware face detection. It does not use much CPU. */ - CAMERA_FACE_DETECTION_HW = 0, - /** - * Software face detection. It uses some CPU. Applications must use - * Camera.setPreviewTexture for preview in this mode. - */ - CAMERA_FACE_DETECTION_SW = 1 -}; - -/** - * The information of a face from camera face detection. - */ -typedef struct camera_face { - /** - * Bounds of the face [left, top, right, bottom]. (-1000, -1000) represents - * the top-left of the camera field of view, and (1000, 1000) represents the - * bottom-right of the field of view. The width and height cannot be 0 or - * negative. This is supported by both hardware and software face detection. - * - * The direction is relative to the sensor orientation, that is, what the - * sensor sees. The direction is not affected by the rotation or mirroring - * of CAMERA_CMD_SET_DISPLAY_ORIENTATION. - */ - int32_t rect[4]; - - /** - * The confidence level of the face. The range is 1 to 100. 100 is the - * highest confidence. This is supported by both hardware and software - * face detection. - */ - int32_t score; - - /** - * An unique id per face while the face is visible to the tracker. If - * the face leaves the field-of-view and comes back, it will get a new - * id. If the value is 0, id is not supported. - */ - int32_t id; - - /** - * The coordinates of the center of the left eye. The range is -1000 to - * 1000. -2000, -2000 if this is not supported. - */ - int32_t left_eye[2]; - - /** - * The coordinates of the center of the right eye. The range is -1000 to - * 1000. -2000, -2000 if this is not supported. - */ - int32_t right_eye[2]; - - /** - * The coordinates of the center of the mouth. The range is -1000 to 1000. - * -2000, -2000 if this is not supported. - */ - int32_t mouth[2]; - -} camera_face_t; - -/** - * The metadata of the frame data. - */ -typedef struct camera_frame_metadata { - /** - * The number of detected faces in the frame. - */ - int32_t number_of_faces; - - /** - * An array of the detected faces. The length is number_of_faces. - */ - camera_face_t *faces; -} camera_frame_metadata_t; - -__END_DECLS - -#endif /* SYSTEM_CORE_INCLUDE_ANDROID_CAMERA_H */ diff --git a/external/android/include/14/system/core/include/system/graphics.h b/external/android/include/14/system/core/include/system/graphics.h deleted file mode 100644 index 729e92c..0000000 --- a/external/android/include/14/system/core/include/system/graphics.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (C) 2011 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 SYSTEM_CORE_INCLUDE_ANDROID_GRAPHICS_H -#define SYSTEM_CORE_INCLUDE_ANDROID_GRAPHICS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * If the HAL needs to create service threads to handle graphics related - * tasks, these threads need to run at HAL_PRIORITY_URGENT_DISPLAY priority - * if they can block the main rendering thread in any way. - * - * the priority of the current thread can be set with: - * - * #include - * setpriority(PRIO_PROCESS, 0, HAL_PRIORITY_URGENT_DISPLAY); - * - */ - -#define HAL_PRIORITY_URGENT_DISPLAY (-8) - -/** - * pixel format definitions - */ - -enum { - HAL_PIXEL_FORMAT_RGBA_8888 = 1, - HAL_PIXEL_FORMAT_RGBX_8888 = 2, - HAL_PIXEL_FORMAT_RGB_888 = 3, - HAL_PIXEL_FORMAT_RGB_565 = 4, - HAL_PIXEL_FORMAT_BGRA_8888 = 5, - HAL_PIXEL_FORMAT_RGBA_5551 = 6, - HAL_PIXEL_FORMAT_RGBA_4444 = 7, - - /* 0x8 - 0xFF range unavailable */ - - /* - * 0x100 - 0x1FF - * - * This range is reserved for pixel formats that are specific to the HAL - * implementation. Implementations can use any value in this range to - * communicate video pixel formats between their HAL modules. These formats - * must not have an alpha channel. Additionally, an EGLimage created from a - * gralloc buffer of one of these formats must be supported for use with the - * GL_OES_EGL_image_external OpenGL ES extension. - */ - - /* - * Android YUV format: - * - * This format is exposed outside of the HAL to software decoders and - * applications. EGLImageKHR must support it in conjunction with the - * OES_EGL_image_external extension. - * - * YV12 is a 4:2:0 YCrCb planar format comprised of a WxH Y plane followed - * by (W/2) x (H/2) Cr and Cb planes. - * - * This format assumes - * - an even width - * - an even height - * - a horizontal stride multiple of 16 pixels - * - a vertical stride equal to the height - * - * y_size = stride * height - * c_size = ALIGN(stride/2, 16) * height/2 - * size = y_size + c_size * 2 - * cr_offset = y_size - * cb_offset = y_size + c_size - * - */ - HAL_PIXEL_FORMAT_YV12 = 0x32315659, // YCrCb 4:2:0 Planar - - - - /* Legacy formats (deprecated), used by ImageFormat.java */ - HAL_PIXEL_FORMAT_YCbCr_422_SP = 0x10, // NV16 - HAL_PIXEL_FORMAT_YCrCb_420_SP = 0x11, // NV21 - HAL_PIXEL_FORMAT_YCbCr_422_I = 0x14, // YUY2 -}; - - -/** - * Transformation definitions - * - * IMPORTANT NOTE: - * HAL_TRANSFORM_ROT_90 is applied CLOCKWISE and AFTER HAL_TRANSFORM_FLIP_{H|V}. - * - */ - -enum { - /* flip source image horizontally (around the vertical axis) */ - HAL_TRANSFORM_FLIP_H = 0x01, - /* flip source image vertically (around the horizontal axis)*/ - HAL_TRANSFORM_FLIP_V = 0x02, - /* rotate source image 90 degrees clockwise */ - HAL_TRANSFORM_ROT_90 = 0x04, - /* rotate source image 180 degrees */ - HAL_TRANSFORM_ROT_180 = 0x03, - /* rotate source image 270 degrees clockwise */ - HAL_TRANSFORM_ROT_270 = 0x07, -}; - -#ifdef __cplusplus -} -#endif - -#endif /* SYSTEM_CORE_INCLUDE_ANDROID_GRAPHICS_H */ diff --git a/external/android/include/14/system/core/include/system/window.h b/external/android/include/14/system/core/include/system/window.h deleted file mode 100644 index 959bd23..0000000 --- a/external/android/include/14/system/core/include/system/window.h +++ /dev/null @@ -1,614 +0,0 @@ -/* - * Copyright (C) 2011 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 SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H -#define SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H - -#include -#include -#include -#include - -__BEGIN_DECLS - -/*****************************************************************************/ - -#define ANDROID_NATIVE_MAKE_CONSTANT(a,b,c,d) \ - (((unsigned)(a)<<24)|((unsigned)(b)<<16)|((unsigned)(c)<<8)|(unsigned)(d)) - -#define ANDROID_NATIVE_WINDOW_MAGIC \ - ANDROID_NATIVE_MAKE_CONSTANT('_','w','n','d') - -#define ANDROID_NATIVE_BUFFER_MAGIC \ - ANDROID_NATIVE_MAKE_CONSTANT('_','b','f','r') - -// --------------------------------------------------------------------------- - -typedef const native_handle_t* buffer_handle_t; - -// --------------------------------------------------------------------------- - -typedef struct android_native_rect_t -{ - int32_t left; - int32_t top; - int32_t right; - int32_t bottom; -} android_native_rect_t; - -// --------------------------------------------------------------------------- - -typedef struct android_native_base_t -{ - /* a magic value defined by the actual EGL native type */ - int magic; - - /* the sizeof() of the actual EGL native type */ - int version; - - void* reserved[4]; - - /* reference-counting interface */ - void (*incRef)(struct android_native_base_t* base); - void (*decRef)(struct android_native_base_t* base); -} android_native_base_t; - -typedef struct ANativeWindowBuffer -{ -#ifdef __cplusplus - ANativeWindowBuffer() { - common.magic = ANDROID_NATIVE_BUFFER_MAGIC; - common.version = sizeof(ANativeWindowBuffer); - memset(common.reserved, 0, sizeof(common.reserved)); - } - - // Implement the methods that sp expects so that it - // can be used to automatically refcount ANativeWindowBuffer's. - void incStrong(const void* id) const { - common.incRef(const_cast(&common)); - } - void decStrong(const void* id) const { - common.decRef(const_cast(&common)); - } -#endif - - struct android_native_base_t common; - - int width; - int height; - int stride; - int format; - int usage; - - void* reserved[2]; - - buffer_handle_t handle; - - void* reserved_proc[8]; -} ANativeWindowBuffer_t; - -// Old typedef for backwards compatibility. -typedef ANativeWindowBuffer_t android_native_buffer_t; - -// --------------------------------------------------------------------------- - -/* attributes queriable with query() */ -enum { - NATIVE_WINDOW_WIDTH = 0, - NATIVE_WINDOW_HEIGHT = 1, - NATIVE_WINDOW_FORMAT = 2, - - /* The minimum number of buffers that must remain un-dequeued after a buffer - * has been queued. This value applies only if set_buffer_count was used to - * override the number of buffers and if a buffer has since been queued. - * Users of the set_buffer_count ANativeWindow method should query this - * value before calling set_buffer_count. If it is necessary to have N - * buffers simultaneously dequeued as part of the steady-state operation, - * and this query returns M then N+M buffers should be requested via - * native_window_set_buffer_count. - * - * Note that this value does NOT apply until a single buffer has been - * queued. In particular this means that it is possible to: - * - * 1. Query M = min undequeued buffers - * 2. Set the buffer count to N + M - * 3. Dequeue all N + M buffers - * 4. Cancel M buffers - * 5. Queue, dequeue, queue, dequeue, ad infinitum - */ - NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS = 3, - - /* Check whether queueBuffer operations on the ANativeWindow send the buffer - * to the window compositor. The query sets the returned 'value' argument - * to 1 if the ANativeWindow DOES send queued buffers directly to the window - * compositor and 0 if the buffers do not go directly to the window - * compositor. - * - * This can be used to determine whether protected buffer content should be - * sent to the ANativeWindow. Note, however, that a result of 1 does NOT - * indicate that queued buffers will be protected from applications or users - * capturing their contents. If that behavior is desired then some other - * mechanism (e.g. the GRALLOC_USAGE_PROTECTED flag) should be used in - * conjunction with this query. - */ - NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER = 4, - - /* Get the concrete type of a ANativeWindow. See below for the list of - * possible return values. - * - * This query should not be used outside the Android framework and will - * likely be removed in the near future. - */ - NATIVE_WINDOW_CONCRETE_TYPE = 5, - - - /* - * Default width and height of the ANativeWindow, these are the dimensions - * of the window irrespective of the NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS - * call. - */ - NATIVE_WINDOW_DEFAULT_WIDTH = 6, - NATIVE_WINDOW_DEFAULT_HEIGHT = 7, - - /* - * transformation that will most-likely be applied to buffers. This is only - * a hint, the actual transformation applied might be different. - * - * INTENDED USE: - * - * The transform hint can be used by a producer, for instance the GLES - * driver, to pre-rotate the rendering such that the final transformation - * in the composer is identity. This can be very useful when used in - * conjunction with the h/w composer HAL, in situations where it - * cannot handle arbitrary rotations. - * - * 1. Before dequeuing a buffer, the GL driver (or any other ANW client) - * queries the ANW for NATIVE_WINDOW_TRANSFORM_HINT. - * - * 2. The GL driver overrides the width and height of the ANW to - * account for NATIVE_WINDOW_TRANSFORM_HINT. This is done by querying - * NATIVE_WINDOW_DEFAULT_{WIDTH | HEIGHT}, swapping the dimensions - * according to NATIVE_WINDOW_TRANSFORM_HINT and calling - * native_window_set_buffers_dimensions(). - * - * 3. The GL driver dequeues a buffer of the new pre-rotated size. - * - * 4. The GL driver renders to the buffer such that the image is - * already transformed, that is applying NATIVE_WINDOW_TRANSFORM_HINT - * to the rendering. - * - * 5. The GL driver calls native_window_set_transform to apply - * inverse transformation to the buffer it just rendered. - * In order to do this, the GL driver needs - * to calculate the inverse of NATIVE_WINDOW_TRANSFORM_HINT, this is - * done easily: - * - * int hintTransform, inverseTransform; - * query(..., NATIVE_WINDOW_TRANSFORM_HINT, &hintTransform); - * inverseTransform = hintTransform; - * if (hintTransform & HAL_TRANSFORM_ROT_90) - * inverseTransform ^= HAL_TRANSFORM_ROT_180; - * - * - * 6. The GL driver queues the pre-transformed buffer. - * - * 7. The composer combines the buffer transform with the display - * transform. If the buffer transform happens to cancel out the - * display transform then no rotation is needed. - * - */ - NATIVE_WINDOW_TRANSFORM_HINT = 8, -}; - -/* valid operations for the (*perform)() hook */ -enum { - NATIVE_WINDOW_SET_USAGE = 0, - NATIVE_WINDOW_CONNECT = 1, /* deprecated */ - NATIVE_WINDOW_DISCONNECT = 2, /* deprecated */ - NATIVE_WINDOW_SET_CROP = 3, - NATIVE_WINDOW_SET_BUFFER_COUNT = 4, - NATIVE_WINDOW_SET_BUFFERS_GEOMETRY = 5, /* deprecated */ - NATIVE_WINDOW_SET_BUFFERS_TRANSFORM = 6, - NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP = 7, - NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS = 8, - NATIVE_WINDOW_SET_BUFFERS_FORMAT = 9, - NATIVE_WINDOW_SET_SCALING_MODE = 10, - NATIVE_WINDOW_LOCK = 11, /* private */ - NATIVE_WINDOW_UNLOCK_AND_POST = 12, /* private */ - NATIVE_WINDOW_API_CONNECT = 13, /* private */ - NATIVE_WINDOW_API_DISCONNECT = 14, /* private */ -}; - -/* parameter for NATIVE_WINDOW_[API_][DIS]CONNECT */ -enum { - /* Buffers will be queued by EGL via eglSwapBuffers after being filled using - * OpenGL ES. - */ - NATIVE_WINDOW_API_EGL = 1, - - /* Buffers will be queued after being filled using the CPU - */ - NATIVE_WINDOW_API_CPU = 2, - - /* Buffers will be queued by Stagefright after being filled by a video - * decoder. The video decoder can either be a software or hardware decoder. - */ - NATIVE_WINDOW_API_MEDIA = 3, - - /* Buffers will be queued by the the camera HAL. - */ - NATIVE_WINDOW_API_CAMERA = 4, -}; - -/* parameter for NATIVE_WINDOW_SET_BUFFERS_TRANSFORM */ -enum { - /* flip source image horizontally */ - NATIVE_WINDOW_TRANSFORM_FLIP_H = HAL_TRANSFORM_FLIP_H , - /* flip source image vertically */ - NATIVE_WINDOW_TRANSFORM_FLIP_V = HAL_TRANSFORM_FLIP_V, - /* rotate source image 90 degrees clock-wise */ - NATIVE_WINDOW_TRANSFORM_ROT_90 = HAL_TRANSFORM_ROT_90, - /* rotate source image 180 degrees */ - NATIVE_WINDOW_TRANSFORM_ROT_180 = HAL_TRANSFORM_ROT_180, - /* rotate source image 270 degrees clock-wise */ - NATIVE_WINDOW_TRANSFORM_ROT_270 = HAL_TRANSFORM_ROT_270, -}; - -/* parameter for NATIVE_WINDOW_SET_SCALING_MODE */ -enum { - /* the window content is not updated (frozen) until a buffer of - * the window size is received (enqueued) - */ - NATIVE_WINDOW_SCALING_MODE_FREEZE = 0, - /* the buffer is scaled in both dimensions to match the window size */ - NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW = 1, -}; - -/* values returned by the NATIVE_WINDOW_CONCRETE_TYPE query */ -enum { - NATIVE_WINDOW_FRAMEBUFFER = 0, /* FramebufferNativeWindow */ - NATIVE_WINDOW_SURFACE = 1, /* Surface */ - NATIVE_WINDOW_SURFACE_TEXTURE_CLIENT = 2, /* SurfaceTextureClient */ -}; - -/* parameter for NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP - * - * Special timestamp value to indicate that timestamps should be auto-generated - * by the native window when queueBuffer is called. This is equal to INT64_MIN, - * defined directly to avoid problems with C99/C++ inclusion of stdint.h. - */ -static const int64_t NATIVE_WINDOW_TIMESTAMP_AUTO = (-9223372036854775807LL-1); - -struct ANativeWindow -{ -#ifdef __cplusplus - ANativeWindow() - : flags(0), minSwapInterval(0), maxSwapInterval(0), xdpi(0), ydpi(0) - { - common.magic = ANDROID_NATIVE_WINDOW_MAGIC; - common.version = sizeof(ANativeWindow); - memset(common.reserved, 0, sizeof(common.reserved)); - } - - /* Implement the methods that sp expects so that it - can be used to automatically refcount ANativeWindow's. */ - void incStrong(const void* id) const { - common.incRef(const_cast(&common)); - } - void decStrong(const void* id) const { - common.decRef(const_cast(&common)); - } -#endif - - struct android_native_base_t common; - - /* flags describing some attributes of this surface or its updater */ - const uint32_t flags; - - /* min swap interval supported by this updated */ - const int minSwapInterval; - - /* max swap interval supported by this updated */ - const int maxSwapInterval; - - /* horizontal and vertical resolution in DPI */ - const float xdpi; - const float ydpi; - - /* Some storage reserved for the OEM's driver. */ - intptr_t oem[4]; - - /* - * Set the swap interval for this surface. - * - * Returns 0 on success or -errno on error. - */ - int (*setSwapInterval)(struct ANativeWindow* window, - int interval); - - /* - * hook called by EGL to acquire a buffer. After this call, the buffer - * is not locked, so its content cannot be modified. - * this call may block if no buffers are available. - * - * Returns 0 on success or -errno on error. - */ - int (*dequeueBuffer)(struct ANativeWindow* window, - struct ANativeWindowBuffer** buffer); - - /* - * hook called by EGL to lock a buffer. This MUST be called before modifying - * the content of a buffer. The buffer must have been acquired with - * dequeueBuffer first. - * - * Returns 0 on success or -errno on error. - */ - int (*lockBuffer)(struct ANativeWindow* window, - struct ANativeWindowBuffer* buffer); - /* - * hook called by EGL when modifications to the render buffer are done. - * This unlocks and post the buffer. - * - * Buffers MUST be queued in the same order than they were dequeued. - * - * Returns 0 on success or -errno on error. - */ - int (*queueBuffer)(struct ANativeWindow* window, - struct ANativeWindowBuffer* buffer); - - /* - * hook used to retrieve information about the native window. - * - * Returns 0 on success or -errno on error. - */ - int (*query)(const struct ANativeWindow* window, - int what, int* value); - - /* - * hook used to perform various operations on the surface. - * (*perform)() is a generic mechanism to add functionality to - * ANativeWindow while keeping backward binary compatibility. - * - * DO NOT CALL THIS HOOK DIRECTLY. Instead, use the helper functions - * defined below. - * - * (*perform)() returns -ENOENT if the 'what' parameter is not supported - * by the surface's implementation. - * - * The valid operations are: - * NATIVE_WINDOW_SET_USAGE - * NATIVE_WINDOW_CONNECT (deprecated) - * NATIVE_WINDOW_DISCONNECT (deprecated) - * NATIVE_WINDOW_SET_CROP - * NATIVE_WINDOW_SET_BUFFER_COUNT - * NATIVE_WINDOW_SET_BUFFERS_GEOMETRY (deprecated) - * NATIVE_WINDOW_SET_BUFFERS_TRANSFORM - * NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP - * NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS - * NATIVE_WINDOW_SET_BUFFERS_FORMAT - * NATIVE_WINDOW_SET_SCALING_MODE - * NATIVE_WINDOW_LOCK (private) - * NATIVE_WINDOW_UNLOCK_AND_POST (private) - * NATIVE_WINDOW_API_CONNECT (private) - * NATIVE_WINDOW_API_DISCONNECT (private) - * - */ - - int (*perform)(struct ANativeWindow* window, - int operation, ... ); - - /* - * hook used to cancel a buffer that has been dequeued. - * No synchronization is performed between dequeue() and cancel(), so - * either external synchronization is needed, or these functions must be - * called from the same thread. - */ - int (*cancelBuffer)(struct ANativeWindow* window, - struct ANativeWindowBuffer* buffer); - - - void* reserved_proc[2]; -}; - - /* Backwards compatibility: use ANativeWindow (struct ANativeWindow in C). - * android_native_window_t is deprecated. - */ -typedef struct ANativeWindow ANativeWindow; -typedef struct ANativeWindow android_native_window_t; - -/* - * native_window_set_usage(..., usage) - * Sets the intended usage flags for the next buffers - * acquired with (*lockBuffer)() and on. - * By default (if this function is never called), a usage of - * GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE - * is assumed. - * Calling this function will usually cause following buffers to be - * reallocated. - */ - -static inline int native_window_set_usage( - struct ANativeWindow* window, int usage) -{ - return window->perform(window, NATIVE_WINDOW_SET_USAGE, usage); -} - -/* deprecated. Always returns 0. Don't call. */ -static inline int native_window_connect( - struct ANativeWindow* window, int api) { - return 0; -} - -/* deprecated. Always returns 0. Don't call. */ -static inline int native_window_disconnect( - struct ANativeWindow* window, int api) { - return 0; -} - -/* - * native_window_set_crop(..., crop) - * Sets which region of the next queued buffers needs to be considered. - * A buffer's crop region is scaled to match the surface's size. - * - * The specified crop region applies to all buffers queued after it is called. - * - * if 'crop' is NULL, subsequently queued buffers won't be cropped. - * - * An error is returned if for instance the crop region is invalid, - * out of the buffer's bound or if the window is invalid. - */ -static inline int native_window_set_crop( - struct ANativeWindow* window, - android_native_rect_t const * crop) -{ - return window->perform(window, NATIVE_WINDOW_SET_CROP, crop); -} - -/* - * native_window_set_buffer_count(..., count) - * Sets the number of buffers associated with this native window. - */ -static inline int native_window_set_buffer_count( - struct ANativeWindow* window, - size_t bufferCount) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFER_COUNT, bufferCount); -} - -/* - * native_window_set_buffers_geometry(..., int w, int h, int format) - * All buffers dequeued after this call will have the dimensions and format - * specified. A successful call to this function has the same effect as calling - * native_window_set_buffers_size and native_window_set_buffers_format. - * - * XXX: This function is deprecated. The native_window_set_buffers_dimensions - * and native_window_set_buffers_format functions should be used instead. - */ -static inline int native_window_set_buffers_geometry( - struct ANativeWindow* window, - int w, int h, int format) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_GEOMETRY, - w, h, format); -} - -/* - * native_window_set_buffers_dimensions(..., int w, int h) - * All buffers dequeued after this call will have the dimensions specified. - * In particular, all buffers will have a fixed-size, independent form the - * native-window size. They will be scaled according to the scaling mode - * (see native_window_set_scaling_mode) upon window composition. - * - * If w and h are 0, the normal behavior is restored. That is, dequeued buffers - * following this call will be sized to match the window's size. - * - * Calling this function will reset the window crop to a NULL value, which - * disables cropping of the buffers. - */ -static inline int native_window_set_buffers_dimensions( - struct ANativeWindow* window, - int w, int h) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS, - w, h); -} - -/* - * native_window_set_buffers_format(..., int format) - * All buffers dequeued after this call will have the format specified. - * - * If the specified format is 0, the default buffer format will be used. - */ -static inline int native_window_set_buffers_format( - struct ANativeWindow* window, - int format) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_FORMAT, format); -} - -/* - * native_window_set_buffers_transform(..., int transform) - * All buffers queued after this call will be displayed transformed according - * to the transform parameter specified. - */ -static inline int native_window_set_buffers_transform( - struct ANativeWindow* window, - int transform) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_TRANSFORM, - transform); -} - -/* - * native_window_set_buffers_timestamp(..., int64_t timestamp) - * All buffers queued after this call will be associated with the timestamp - * parameter specified. If the timestamp is set to NATIVE_WINDOW_TIMESTAMP_AUTO - * (the default), timestamps will be generated automatically when queueBuffer is - * called. The timestamp is measured in nanoseconds, and is normally monotonically - * increasing. The timestamp should be unaffected by time-of-day adjustments, - * and for a camera should be strictly monotonic but for a media player may be - * reset when the position is set. - */ -static inline int native_window_set_buffers_timestamp( - struct ANativeWindow* window, - int64_t timestamp) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP, - timestamp); -} - -/* - * native_window_set_scaling_mode(..., int mode) - * All buffers queued after this call will be associated with the scaling mode - * specified. - */ -static inline int native_window_set_scaling_mode( - struct ANativeWindow* window, - int mode) -{ - return window->perform(window, NATIVE_WINDOW_SET_SCALING_MODE, - mode); -} - - -/* - * native_window_api_connect(..., int api) - * connects an API to this window. only one API can be connected at a time. - * Returns -EINVAL if for some reason the window cannot be connected, which - * can happen if it's connected to some other API. - */ -static inline int native_window_api_connect( - struct ANativeWindow* window, int api) -{ - return window->perform(window, NATIVE_WINDOW_API_CONNECT, api); -} - -/* - * native_window_api_disconnect(..., int api) - * disconnect the API from this window. - * An error is returned if for instance the window wasn't connected in the - * first place. - */ -static inline int native_window_api_disconnect( - struct ANativeWindow* window, int api) -{ - return window->perform(window, NATIVE_WINDOW_API_DISCONNECT, api); -} - - -__END_DECLS - -#endif /* SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H */ diff --git a/external/android/include/16/frameworks/av/include/media/AudioEffect.h b/external/android/include/16/frameworks/av/include/media/AudioEffect.h deleted file mode 100644 index 05d834d..0000000 --- a/external/android/include/16/frameworks/av/include/media/AudioEffect.h +++ /dev/null @@ -1,456 +0,0 @@ -/* - * 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_AUDIOEFFECT_H -#define ANDROID_AUDIOEFFECT_H - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - -namespace android { - -// ---------------------------------------------------------------------------- - -class effect_param_cblk_t; - -// ---------------------------------------------------------------------------- - -class AudioEffect : public RefBase -{ -public: - - /* - * Static methods for effects enumeration. - */ - - /* - * Returns the number of effects available. This method together - * with queryEffect() is used to enumerate all effects: - * The enumeration sequence is: - * queryNumberEffects(&num_effects); - * for (i = 0; i < num_effects; i++) - * queryEffect(i,...); - * - * Parameters: - * numEffects: address where the number of effects should be returned. - * - * Returned status (from utils/Errors.h) can be: - * NO_ERROR successful operation. - * PERMISSION_DENIED could not get AudioFlinger interface - * NO_INIT effect library failed to initialize - * BAD_VALUE invalid numEffects pointer - * - * Returned value - * *numEffects: updated with number of effects available - */ - static status_t queryNumberEffects(uint32_t *numEffects); - - /* - * Returns an effect descriptor during effect - * enumeration. - * - * Parameters: - * index: index of the queried effect. - * descriptor: address where the effect descriptor should be returned. - * - * Returned status (from utils/Errors.h) can be: - * NO_ERROR successful operation. - * PERMISSION_DENIED could not get AudioFlinger interface - * NO_INIT effect library failed to initialize - * BAD_VALUE invalid descriptor pointer or index - * INVALID_OPERATION effect list has changed since last execution of queryNumberEffects() - * - * Returned value - * *descriptor: updated with effect descriptor - */ - static status_t queryEffect(uint32_t index, effect_descriptor_t *descriptor); - - - /* - * Returns the descriptor for the specified effect uuid. - * - * Parameters: - * uuid: pointer to effect uuid. - * descriptor: address where the effect descriptor should be returned. - * - * Returned status (from utils/Errors.h) can be: - * NO_ERROR successful operation. - * PERMISSION_DENIED could not get AudioFlinger interface - * NO_INIT effect library failed to initialize - * BAD_VALUE invalid uuid or descriptor pointers - * NAME_NOT_FOUND no effect with this uuid found - * - * Returned value - * *descriptor updated with effect descriptor - */ - static status_t getEffectDescriptor(const effect_uuid_t *uuid, - effect_descriptor_t *descriptor) /*const*/; - - - /* - * Returns a list of descriptors corresponding to the pre processings enabled by default - * on an AudioRecord with the supplied audio session ID. - * - * Parameters: - * audioSession: audio session ID. - * descriptors: address where the effect descriptors should be returned. - * count: as input, the maximum number of descriptor than should be returned - * as output, the number of descriptor returned if status is NO_ERROR or the actual - * number of enabled pre processings if status is NO_MEMORY - * - * Returned status (from utils/Errors.h) can be: - * NO_ERROR successful operation. - * NO_MEMORY the number of descriptor to return is more than the maximum number - * indicated by count. - * PERMISSION_DENIED could not get AudioFlinger interface - * NO_INIT effect library failed to initialize - * BAD_VALUE invalid audio session or descriptor pointers - * - * Returned value - * *descriptor updated with descriptors of pre processings enabled by default - * *count number of descriptors returned if returned status is N_ERROR. - * total number of pre processing enabled by default if returned status is - * NO_MEMORY. This happens if the count passed as input is less than the number - * of descriptors to return - */ - static status_t queryDefaultPreProcessing(int audioSession, - effect_descriptor_t *descriptors, - uint32_t *count); - - /* - * Events used by callback function (effect_callback_t). - */ - enum event_type { - EVENT_CONTROL_STATUS_CHANGED = 0, - EVENT_ENABLE_STATUS_CHANGED = 1, - EVENT_PARAMETER_CHANGED = 2, - EVENT_ERROR = 3 - }; - - /* Callback function notifying client application of a change in effect engine state or - * configuration. - * An effect engine can be shared by several applications but only one has the control - * of the engine activity and configuration at a time. - * The EVENT_CONTROL_STATUS_CHANGED event is received when an application loses or - * retrieves the control of the effect engine. Loss of control happens - * if another application requests the use of the engine by creating an AudioEffect for - * the same effect type but with a higher priority. Control is returned when the - * application having the control deletes its AudioEffect object. - * The EVENT_ENABLE_STATUS_CHANGED event is received by all applications not having the - * control of the effect engine when the effect is enabled or disabled. - * The EVENT_PARAMETER_CHANGED event is received by all applications not having the - * control of the effect engine when an effect parameter is changed. - * The EVENT_ERROR event is received when the media server process dies. - * - * Parameters: - * - * event: type of event notified (see enum AudioEffect::event_type). - * user: Pointer to context for use by the callback receiver. - * info: Pointer to optional parameter according to event type: - * - EVENT_CONTROL_STATUS_CHANGED: boolean indicating if control is granted (true) - * or stolen (false). - * - EVENT_ENABLE_STATUS_CHANGED: boolean indicating if effect is now enabled (true) - * or disabled (false). - * - EVENT_PARAMETER_CHANGED: pointer to a effect_param_t structure. - * - EVENT_ERROR: status_t indicating the error (DEAD_OBJECT when media server dies). - */ - - typedef void (*effect_callback_t)(int32_t event, void* user, void *info); - - - /* Constructor. - * AudioEffect is the base class for creating and controlling an effect engine from - * the application process. Creating an AudioEffect object will create the effect engine - * in the AudioFlinger if no engine of the specified type exists. If one exists, this engine - * will be used. The application creating the AudioEffect object (or a derived class like - * Reverb for instance) will either receive control of the effect engine or not, depending - * on the priority parameter. If priority is higher than the priority used by the current - * effect engine owner, the control will be transfered to the new application. Otherwise - * control will remain to the previous application. In this case, the new application will be - * notified of changes in effect engine state or control ownership by the effect callback. - * After creating the AudioEffect, the application must call the initCheck() method and - * check the creation status before trying to control the effect engine (see initCheck()). - * If the effect is to be applied to an AudioTrack or MediaPlayer only the application - * must specify the audio session ID corresponding to this player. - */ - - /* Simple Constructor. - */ - AudioEffect(); - - - /* Constructor. - * - * Parameters: - * - * type: type of effect created: can be null if uuid is specified. This corresponds to - * the OpenSL ES interface implemented by this effect. - * uuid: Uuid of effect created: can be null if type is specified. This uuid corresponds to - * a particular implementation of an effect type. - * priority: requested priority for effect control: the priority level corresponds to the - * value of priority parameter: negative values indicate lower priorities, positive values - * higher priorities, 0 being the normal priority. - * cbf: optional callback function (see effect_callback_t) - * user: pointer to context for use by the callback receiver. - * sessionID: audio session this effect is associated to. If 0, the effect will be global to - * the output mix. If not 0, the effect will be applied to all players - * (AudioTrack or MediaPLayer) within the same audio session. - * io: HAL audio output or input stream to which this effect must be attached. Leave at 0 for - * automatic output selection by AudioFlinger. - */ - - AudioEffect(const effect_uuid_t *type, - const effect_uuid_t *uuid = NULL, - int32_t priority = 0, - effect_callback_t cbf = NULL, - void* user = NULL, - int sessionId = 0, - audio_io_handle_t io = 0 - ); - - /* Constructor. - * Same as above but with type and uuid specified by character strings - */ - AudioEffect(const char *typeStr, - const char *uuidStr = NULL, - int32_t priority = 0, - effect_callback_t cbf = NULL, - void* user = NULL, - int sessionId = 0, - audio_io_handle_t io = 0 - ); - - /* Terminates the AudioEffect and unregisters it from AudioFlinger. - * The effect engine is also destroyed if this AudioEffect was the last controlling - * the engine. - */ - ~AudioEffect(); - - /* Initialize an uninitialized AudioEffect. - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR or ALREADY_EXISTS: successful initialization - * - INVALID_OPERATION: AudioEffect is already initialized - * - BAD_VALUE: invalid parameter - * - NO_INIT: audio flinger or audio hardware not initialized - * */ - status_t set(const effect_uuid_t *type, - const effect_uuid_t *uuid = NULL, - int32_t priority = 0, - effect_callback_t cbf = NULL, - void* user = NULL, - int sessionId = 0, - audio_io_handle_t io = 0 - ); - - /* Result of constructing the AudioEffect. This must be checked - * before using any AudioEffect API. - * initCheck() can return: - * - NO_ERROR: the effect engine is successfully created and the application has control. - * - ALREADY_EXISTS: the effect engine is successfully created but the application does not - * have control. - * - NO_INIT: the effect creation failed. - * - */ - status_t initCheck() const; - - - /* Returns the unique effect Id for the controlled effect engine. This ID is unique - * system wide and is used for instance in the case of auxiliary effects to attach - * the effect to an AudioTrack or MediaPlayer. - * - */ - int32_t id() const { return mId; } - - /* Returns a descriptor for the effect (see effect_descriptor_t in audio_effect.h). - */ - effect_descriptor_t descriptor() const; - - /* Returns effect control priority of this AudioEffect object. - */ - int32_t priority() const { return mPriority; } - - - /* Enables or disables the effect engine. - * - * Parameters: - * enabled: requested enable state. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the application does not have control of the effect engine or the - * effect is already in the requested state. - */ - virtual status_t setEnabled(bool enabled); - bool getEnabled() const; - - /* Sets a parameter value. - * - * Parameters: - * param: pointer to effect_param_t structure containing the parameter - * and its value (See audio_effect.h). - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation. - * - INVALID_OPERATION: the application does not have control of the effect engine. - * - BAD_VALUE: invalid parameter identifier or value. - * - DEAD_OBJECT: the effect engine has been deleted. - */ - virtual status_t setParameter(effect_param_t *param); - - /* Prepare a new parameter value that will be set by next call to - * setParameterCommit(). This method can be used to set multiple parameters - * in a synchronous manner or to avoid multiple binder calls for each - * parameter. - * - * Parameters: - * param: pointer to effect_param_t structure containing the parameter - * and its value (See audio_effect.h). - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation. - * - INVALID_OPERATION: the application does not have control of the effect engine. - * - NO_MEMORY: no more space available in shared memory used for deferred parameter - * setting. - */ - virtual status_t setParameterDeferred(effect_param_t *param); - - /* Commit all parameter values previously prepared by setParameterDeferred(). - * - * Parameters: - * none - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation. - * - INVALID_OPERATION: No new parameter values ready for commit. - * - BAD_VALUE: invalid parameter identifier or value: there is no indication - * as to which of the parameters caused this error. - * - DEAD_OBJECT: the effect engine has been deleted. - */ - virtual status_t setParameterCommit(); - - /* Gets a parameter value. - * - * Parameters: - * param: pointer to effect_param_t structure containing the parameter - * and the returned value (See audio_effect.h). - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation. - * - INVALID_OPERATION: the AudioEffect was not successfully initialized. - * - BAD_VALUE: invalid parameter identifier. - * - DEAD_OBJECT: the effect engine has been deleted. - */ - virtual status_t getParameter(effect_param_t *param); - - /* Sends a command and receives a response to/from effect engine. - * See audio_effect.h for details on effect command() function, valid command codes - * and formats. - */ - virtual status_t command(uint32_t cmdCode, - uint32_t cmdSize, - void *cmdData, - uint32_t *replySize, - void *replyData); - - - /* - * Utility functions. - */ - - /* Converts the string passed as first argument to the effect_uuid_t - * pointed to by second argument - */ - static status_t stringToGuid(const char *str, effect_uuid_t *guid); - /* Converts the effect_uuid_t pointed to by first argument to the - * string passed as second argument - */ - static status_t guidToString(const effect_uuid_t *guid, char *str, size_t maxLen); - -protected: - bool mEnabled; // enable state - int32_t mSessionId; // audio session ID - int32_t mPriority; // priority for effect control - status_t mStatus; // effect status - effect_callback_t mCbf; // callback function for status, control and - // parameter changes notifications - void* mUserData; // client context for callback function - effect_descriptor_t mDescriptor; // effect descriptor - int32_t mId; // system wide unique effect engine instance ID - Mutex mLock; // Mutex for mEnabled access - - // IEffectClient - virtual void controlStatusChanged(bool controlGranted); - virtual void enableStatusChanged(bool enabled); - virtual void commandExecuted(uint32_t cmdCode, - uint32_t cmdSize, - void *pCmdData, - uint32_t replySize, - void *pReplyData); - -private: - - // Implements the IEffectClient interface - class EffectClient : public android::BnEffectClient, public android::IBinder::DeathRecipient - { - public: - - EffectClient(AudioEffect *effect) : mEffect(effect){} - - // IEffectClient - virtual void controlStatusChanged(bool controlGranted) { - mEffect->controlStatusChanged(controlGranted); - } - virtual void enableStatusChanged(bool enabled) { - mEffect->enableStatusChanged(enabled); - } - virtual void commandExecuted(uint32_t cmdCode, - uint32_t cmdSize, - void *pCmdData, - uint32_t replySize, - void *pReplyData) { - mEffect->commandExecuted(cmdCode, cmdSize, pCmdData, replySize, pReplyData); - } - - // IBinder::DeathRecipient - virtual void binderDied(const wp& who) {mEffect->binderDied();} - - private: - AudioEffect *mEffect; - }; - - void binderDied(); - - sp mIEffect; // IEffect binder interface - sp mIEffectClient; // IEffectClient implementation - sp mCblkMemory; // shared memory for deferred parameter setting - effect_param_cblk_t* mCblk; // control block for deferred parameter setting -}; - - -}; // namespace android - -#endif // ANDROID_AUDIOEFFECT_H diff --git a/external/android/include/16/frameworks/av/include/media/AudioParameter.h b/external/android/include/16/frameworks/av/include/media/AudioParameter.h deleted file mode 100644 index 891bc4b..0000000 --- a/external/android/include/16/frameworks/av/include/media/AudioParameter.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2008-2011 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_AUDIOPARAMETER_H_ -#define ANDROID_AUDIOPARAMETER_H_ - -#include -#include -#include - -namespace android { - -class AudioParameter { - -public: - AudioParameter() {} - AudioParameter(const String8& keyValuePairs); - virtual ~AudioParameter(); - - // reserved parameter keys for changing standard parameters with setParameters() function. - // Using these keys is mandatory for AudioFlinger to properly monitor audio output/input - // configuration changes and act accordingly. - // keyRouting: to change audio routing, value is an int in audio_devices_t - // keySamplingRate: to change sampling rate routing, value is an int - // keyFormat: to change audio format, value is an int in audio_format_t - // keyChannels: to change audio channel configuration, value is an int in audio_channels_t - // keyFrameCount: to change audio output frame count, value is an int - // keyInputSource: to change audio input source, value is an int in audio_source_t - // (defined in media/mediarecorder.h) - // keyScreenState: either "on" or "off" - static const char * const keyRouting; - static const char * const keySamplingRate; - static const char * const keyFormat; - static const char * const keyChannels; - static const char * const keyFrameCount; - static const char * const keyInputSource; - static const char * const keyScreenState; - - String8 toString(); - - status_t add(const String8& key, const String8& value); - status_t addInt(const String8& key, const int value); - status_t addFloat(const String8& key, const float value); - - status_t remove(const String8& key); - - status_t get(const String8& key, String8& value); - status_t getInt(const String8& key, int& value); - status_t getFloat(const String8& key, float& value); - status_t getAt(size_t index, String8& key, String8& value); - - size_t size() { return mParameters.size(); } - -private: - String8 mKeyValuePairs; - KeyedVector mParameters; -}; - -}; // namespace android - -#endif /*ANDROID_AUDIOPARAMETER_H_*/ diff --git a/external/android/include/16/frameworks/av/include/media/AudioRecord.h b/external/android/include/16/frameworks/av/include/media/AudioRecord.h deleted file mode 100644 index ef77692..0000000 --- a/external/android/include/16/frameworks/av/include/media/AudioRecord.h +++ /dev/null @@ -1,402 +0,0 @@ -/* - * 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. - */ - -#ifndef AUDIORECORD_H_ -#define AUDIORECORD_H_ - -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include - -namespace android { - -class audio_track_cblk_t; - -// ---------------------------------------------------------------------------- - -class AudioRecord : virtual public RefBase -{ -public: - - static const int DEFAULT_SAMPLE_RATE = 8000; - - /* Events used by AudioRecord callback function (callback_t). - * - * to keep in sync with frameworks/base/media/java/android/media/AudioRecord.java - */ - enum event_type { - EVENT_MORE_DATA = 0, // Request to reqd more data from PCM buffer. - EVENT_OVERRUN = 1, // PCM buffer overrun occured. - EVENT_MARKER = 2, // Record head is at the specified marker position - // (See setMarkerPosition()). - EVENT_NEW_POS = 3, // Record head is at a new position - // (See setPositionUpdatePeriod()). - }; - - /* Create Buffer on the stack and pass it to obtainBuffer() - * and releaseBuffer(). - */ - - class Buffer - { - public: - enum { - MUTE = 0x00000001 - }; - uint32_t flags; - int channelCount; - audio_format_t format; - size_t frameCount; - size_t size; - union { - void* raw; - short* i16; - int8_t* i8; - }; - }; - - /* These are static methods to control the system-wide AudioFlinger - * only privileged processes can have access to them - */ - -// static status_t setMasterMute(bool mute); - - /* As a convenience, if a callback is supplied, a handler thread - * is automatically created with the appropriate priority. This thread - * invokes the callback when a new buffer becomes ready or an overrun condition occurs. - * Parameters: - * - * event: type of event notified (see enum AudioRecord::event_type). - * user: Pointer to context for use by the callback receiver. - * info: Pointer to optional parameter according to event type: - * - EVENT_MORE_DATA: pointer to AudioRecord::Buffer struct. The callback must not read - * more bytes than indicated by 'size' field and update 'size' if less bytes are - * read. - * - EVENT_OVERRUN: unused. - * - EVENT_MARKER: pointer to an uin32_t containing the marker position in frames. - * - EVENT_NEW_POS: pointer to an uin32_t containing the new position in frames. - */ - - typedef void (*callback_t)(int event, void* user, void *info); - - /* Returns the minimum frame count required for the successful creation of - * an AudioRecord object. - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - NO_INIT: audio server or audio hardware not initialized - * - BAD_VALUE: unsupported configuration - */ - - static status_t getMinFrameCount(int* frameCount, - uint32_t sampleRate, - audio_format_t format, - int channelCount); - - /* Constructs an uninitialized AudioRecord. No connection with - * AudioFlinger takes place. - */ - AudioRecord(); - - /* Creates an AudioRecord track and registers it with AudioFlinger. - * Once created, the track needs to be started before it can be used. - * Unspecified values are set to the audio hardware's current - * values. - * - * Parameters: - * - * inputSource: Select the audio input to record to (e.g. AUDIO_SOURCE_DEFAULT). - * sampleRate: Track sampling rate in Hz. - * format: Audio format (e.g AUDIO_FORMAT_PCM_16_BIT for signed - * 16 bits per sample). - * channelMask: Channel mask: see audio_channels_t. - * frameCount: Total size of track PCM buffer in frames. This defines the - * latency of the track. - * flags: A bitmask of acoustic values from enum record_flags. It enables - * AGC, NS, and IIR. - * cbf: Callback function. If not null, this function is called periodically - * to provide new PCM data. - * notificationFrames: The callback function is called each time notificationFrames PCM - * frames are ready in record track output buffer. - * user Context for use by the callback receiver. - */ - - // FIXME consider removing this alias and replacing it by audio_in_acoustics_t - // or removing the parameter entirely if it is unused - enum record_flags { - RECORD_AGC_ENABLE = AUDIO_IN_ACOUSTICS_AGC_ENABLE, - RECORD_NS_ENABLE = AUDIO_IN_ACOUSTICS_NS_ENABLE, - RECORD_IIR_ENABLE = AUDIO_IN_ACOUSTICS_TX_IIR_ENABLE, - }; - - AudioRecord(audio_source_t inputSource, - uint32_t sampleRate = 0, - audio_format_t format = AUDIO_FORMAT_DEFAULT, - uint32_t channelMask = AUDIO_CHANNEL_IN_MONO, - int frameCount = 0, - record_flags flags = (record_flags) 0, - callback_t cbf = NULL, - void* user = NULL, - int notificationFrames = 0, - int sessionId = 0); - - - /* Terminates the AudioRecord and unregisters it from AudioFlinger. - * Also destroys all resources assotiated with the AudioRecord. - */ - ~AudioRecord(); - - - /* Initialize an uninitialized AudioRecord. - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful intialization - * - INVALID_OPERATION: AudioRecord is already intitialized or record device is already in use - * - BAD_VALUE: invalid parameter (channels, format, sampleRate...) - * - NO_INIT: audio server or audio hardware not initialized - * - PERMISSION_DENIED: recording is not allowed for the requesting process - * */ - status_t set(audio_source_t inputSource = AUDIO_SOURCE_DEFAULT, - uint32_t sampleRate = 0, - audio_format_t format = AUDIO_FORMAT_DEFAULT, - uint32_t channelMask = AUDIO_CHANNEL_IN_MONO, - int frameCount = 0, - record_flags flags = (record_flags) 0, - callback_t cbf = NULL, - void* user = NULL, - int notificationFrames = 0, - bool threadCanCallJava = false, - int sessionId = 0); - - - /* Result of constructing the AudioRecord. This must be checked - * before using any AudioRecord API (except for set()), using - * an uninitialized AudioRecord produces undefined results. - * See set() method above for possible return codes. - */ - status_t initCheck() const; - - /* Returns this track's latency in milliseconds. - * This includes the latency due to AudioRecord buffer size - * and audio hardware driver. - */ - uint32_t latency() const; - - /* getters, see constructor */ - - audio_format_t format() const; - int channelCount() const; - int channels() const; - uint32_t frameCount() const; - size_t frameSize() const; - audio_source_t inputSource() const; - - - /* After it's created the track is not active. Call start() to - * make it active. If set, the callback will start being called. - * if event is not AudioSystem::SYNC_EVENT_NONE, the capture start will be delayed until - * the specified event occurs on the specified trigger session. - */ - status_t start(AudioSystem::sync_event_t event = AudioSystem::SYNC_EVENT_NONE, - int triggerSession = 0); - - /* Stop a track. If set, the callback will cease being called and - * obtainBuffer returns STOPPED. Note that obtainBuffer() still works - * and will fill up buffers until the pool is exhausted. - */ - status_t stop(); - bool stopped() const; - - /* get sample rate for this record track - */ - uint32_t getSampleRate() const; - - /* Sets marker position. When record reaches the number of frames specified, - * a callback with event type EVENT_MARKER is called. Calling setMarkerPosition - * with marker == 0 cancels marker notification callback. - * If the AudioRecord has been opened with no callback function associated, - * the operation will fail. - * - * Parameters: - * - * marker: marker position expressed in frames. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the AudioRecord has no callback installed. - */ - status_t setMarkerPosition(uint32_t marker); - status_t getMarkerPosition(uint32_t *marker) const; - - - /* Sets position update period. Every time the number of frames specified has been recorded, - * a callback with event type EVENT_NEW_POS is called. - * Calling setPositionUpdatePeriod with updatePeriod == 0 cancels new position notification - * callback. - * If the AudioRecord has been opened with no callback function associated, - * the operation will fail. - * - * Parameters: - * - * updatePeriod: position update notification period expressed in frames. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the AudioRecord has no callback installed. - */ - status_t setPositionUpdatePeriod(uint32_t updatePeriod); - status_t getPositionUpdatePeriod(uint32_t *updatePeriod) const; - - - /* Gets record head position. The position is the total number of frames - * recorded since record start. - * - * Parameters: - * - * position: Address where to return record head position within AudioRecord buffer. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - BAD_VALUE: position is NULL - */ - status_t getPosition(uint32_t *position) const; - - /* returns a handle on the audio input used by this AudioRecord. - * - * Parameters: - * none. - * - * Returned value: - * handle on audio hardware input - */ - audio_io_handle_t getInput() const; - - /* returns the audio session ID associated to this AudioRecord. - * - * Parameters: - * none. - * - * Returned value: - * AudioRecord session ID. - */ - int getSessionId() const; - - /* obtains a buffer of "frameCount" frames. The buffer must be - * filled entirely. If the track is stopped, obtainBuffer() returns - * STOPPED instead of NO_ERROR as long as there are buffers available, - * at which point NO_MORE_BUFFERS is returned. - * Buffers will be returned until the pool (buffercount()) - * is exhausted, at which point obtainBuffer() will either block - * or return WOULD_BLOCK depending on the value of the "blocking" - * parameter. - */ - - enum { - NO_MORE_BUFFERS = 0x80000001, - STOPPED = 1 - }; - - status_t obtainBuffer(Buffer* audioBuffer, int32_t waitCount); - void releaseBuffer(Buffer* audioBuffer); - - - /* As a convenience we provide a read() interface to the audio buffer. - * This is implemented on top of obtainBuffer/releaseBuffer. - */ - ssize_t read(void* buffer, size_t size); - - /* Return the amount of input frames lost in the audio driver since the last call of this - * function. Audio driver is expected to reset the value to 0 and restart counting upon - * returning the current value by this function call. Such loss typically occurs when the - * user space process is blocked longer than the capacity of audio driver buffers. - * Unit: the number of input audio frames - */ - unsigned int getInputFramesLost() const; - -private: - /* copying audio tracks is not allowed */ - AudioRecord(const AudioRecord& other); - AudioRecord& operator = (const AudioRecord& other); - - /* a small internal class to handle the callback */ - class ClientRecordThread : public Thread - { - public: - ClientRecordThread(AudioRecord& receiver, bool bCanCallJava = false); - private: - friend class AudioRecord; - virtual bool threadLoop(); - virtual status_t readyToRun(); - virtual void onFirstRef() {} - AudioRecord& mReceiver; - }; - - bool processAudioBuffer(const sp& thread); - status_t openRecord_l(uint32_t sampleRate, - audio_format_t format, - uint32_t channelMask, - int frameCount, - audio_io_handle_t input); - audio_io_handle_t getInput_l(); - status_t restoreRecord_l(audio_track_cblk_t*& cblk); - - sp mAudioRecord; - sp mCblkMemory; - sp mClientRecordThread; - status_t mReadyToRun; - mutable Mutex mLock; - Condition mCondition; - - uint32_t mFrameCount; - - audio_track_cblk_t* mCblk; - audio_format_t mFormat; - uint8_t mChannelCount; - audio_source_t mInputSource; - status_t mStatus; - uint32_t mLatency; - - volatile int32_t mActive; - - callback_t mCbf; - void* mUserData; - uint32_t mNotificationFrames; - uint32_t mRemainingFrames; - uint32_t mMarkerPosition; - bool mMarkerReached; - uint32_t mNewPosition; - uint32_t mUpdatePeriod; - record_flags mFlags; - uint32_t mChannelMask; - audio_io_handle_t mInput; - int mSessionId; - int mPreviousPriority; // before start() - SchedPolicy mPreviousSchedulingGroup; -}; - -}; // namespace android - -#endif /*AUDIORECORD_H_*/ diff --git a/external/android/include/16/frameworks/av/include/media/AudioSystem.h b/external/android/include/16/frameworks/av/include/media/AudioSystem.h deleted file mode 100644 index e2662f2..0000000 --- a/external/android/include/16/frameworks/av/include/media/AudioSystem.h +++ /dev/null @@ -1,293 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_AUDIOSYSTEM_H_ -#define ANDROID_AUDIOSYSTEM_H_ - -#include -#include -#include - -#include -#include - -/* XXX: Should be include by all the users instead */ -#include - -namespace android { - -typedef void (*audio_error_callback)(status_t err); - -class IAudioPolicyService; -class String8; - -class AudioSystem -{ -public: - - /* These are static methods to control the system-wide AudioFlinger - * only privileged processes can have access to them - */ - - // mute/unmute microphone - static status_t muteMicrophone(bool state); - static status_t isMicrophoneMuted(bool *state); - - // set/get master volume - static status_t setMasterVolume(float value); - static status_t getMasterVolume(float* volume); - - // mute/unmute audio outputs - static status_t setMasterMute(bool mute); - static status_t getMasterMute(bool* mute); - - // set/get stream volume on specified output - static status_t setStreamVolume(audio_stream_type_t stream, float value, - audio_io_handle_t output); - static status_t getStreamVolume(audio_stream_type_t stream, float* volume, - audio_io_handle_t output); - - // mute/unmute stream - static status_t setStreamMute(audio_stream_type_t stream, bool mute); - static status_t getStreamMute(audio_stream_type_t stream, bool* mute); - - // set audio mode in audio hardware - static status_t setMode(audio_mode_t mode); - - // returns true in *state if tracks are active on the specified stream or has been active - // in the past inPastMs milliseconds - static status_t isStreamActive(audio_stream_type_t stream, bool *state, uint32_t inPastMs = 0); - - // set/get audio hardware parameters. The function accepts a list of parameters - // key value pairs in the form: key1=value1;key2=value2;... - // Some keys are reserved for standard parameters (See AudioParameter class). - static status_t setParameters(audio_io_handle_t ioHandle, const String8& keyValuePairs); - static String8 getParameters(audio_io_handle_t ioHandle, const String8& keys); - - static void setErrorCallback(audio_error_callback cb); - - // helper function to obtain AudioFlinger service handle - static const sp& get_audio_flinger(); - - static float linearToLog(int volume); - static int logToLinear(float volume); - - static status_t getOutputSamplingRate(int* samplingRate, audio_stream_type_t stream = AUDIO_STREAM_DEFAULT); - static status_t getOutputFrameCount(int* frameCount, audio_stream_type_t stream = AUDIO_STREAM_DEFAULT); - static status_t getOutputLatency(uint32_t* latency, audio_stream_type_t stream = AUDIO_STREAM_DEFAULT); - static status_t getSamplingRate(audio_io_handle_t output, - audio_stream_type_t streamType, - int* samplingRate); - // returns the number of frames per audio HAL write buffer. Corresponds to - // audio_stream->get_buffer_size()/audio_stream_frame_size() - static status_t getFrameCount(audio_io_handle_t output, - audio_stream_type_t stream, - int* frameCount); - // returns the audio output stream latency in ms. Corresponds to - // audio_stream_out->get_latency() - static status_t getLatency(audio_io_handle_t output, - audio_stream_type_t stream, - uint32_t* latency); - - // DEPRECATED - static status_t getOutputSamplingRate(int* samplingRate, int stream = AUDIO_STREAM_DEFAULT); - - // DEPRECATED - static status_t getOutputFrameCount(int* frameCount, int stream = AUDIO_STREAM_DEFAULT); - - static bool routedToA2dpOutput(audio_stream_type_t streamType); - - static status_t getInputBufferSize(uint32_t sampleRate, audio_format_t format, int channelCount, - size_t* buffSize); - - static status_t setVoiceVolume(float volume); - - // return the number of audio frames written by AudioFlinger to audio HAL and - // audio dsp to DAC since the output on which the specified stream is playing - // has exited standby. - // returned status (from utils/Errors.h) can be: - // - NO_ERROR: successful operation, halFrames and dspFrames point to valid data - // - INVALID_OPERATION: Not supported on current hardware platform - // - BAD_VALUE: invalid parameter - // NOTE: this feature is not supported on all hardware platforms and it is - // necessary to check returned status before using the returned values. - static status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, audio_stream_type_t stream = AUDIO_STREAM_DEFAULT); - - static unsigned int getInputFramesLost(audio_io_handle_t ioHandle); - - static int newAudioSessionId(); - static void acquireAudioSessionId(int audioSession); - static void releaseAudioSessionId(int audioSession); - - // types of io configuration change events received with ioConfigChanged() - enum io_config_event { - OUTPUT_OPENED, - OUTPUT_CLOSED, - OUTPUT_CONFIG_CHANGED, - INPUT_OPENED, - INPUT_CLOSED, - INPUT_CONFIG_CHANGED, - STREAM_CONFIG_CHANGED, - NUM_CONFIG_EVENTS - }; - - // audio output descriptor used to cache output configurations in client process to avoid frequent calls - // through IAudioFlinger - class OutputDescriptor { - public: - OutputDescriptor() - : samplingRate(0), format(AUDIO_FORMAT_DEFAULT), channels(0), frameCount(0), latency(0) {} - - uint32_t samplingRate; - int32_t format; - int32_t channels; - size_t frameCount; - uint32_t latency; - }; - - // Events used to synchronize actions between audio sessions. - // For instance SYNC_EVENT_PRESENTATION_COMPLETE can be used to delay recording start until playback - // is complete on another audio session. - // See definitions in MediaSyncEvent.java - enum sync_event_t { - SYNC_EVENT_SAME = -1, // used internally to indicate restart with same event - SYNC_EVENT_NONE = 0, - SYNC_EVENT_PRESENTATION_COMPLETE, - - // - // Define new events here: SYNC_EVENT_START, SYNC_EVENT_STOP, SYNC_EVENT_TIME ... - // - SYNC_EVENT_CNT, - }; - - // Timeout for synchronous record start. Prevents from blocking the record thread forever - // if the trigger event is not fired. - static const uint32_t kSyncRecordStartTimeOutMs = 30000; - - // - // IAudioPolicyService interface (see AudioPolicyInterface for method descriptions) - // - static status_t setDeviceConnectionState(audio_devices_t device, audio_policy_dev_state_t state, const char *device_address); - static audio_policy_dev_state_t getDeviceConnectionState(audio_devices_t device, const char *device_address); - static status_t setPhoneState(audio_mode_t state); - static status_t setForceUse(audio_policy_force_use_t usage, audio_policy_forced_cfg_t config); - static audio_policy_forced_cfg_t getForceUse(audio_policy_force_use_t usage); - static audio_io_handle_t getOutput(audio_stream_type_t stream, - uint32_t samplingRate = 0, - audio_format_t format = AUDIO_FORMAT_DEFAULT, - uint32_t channels = AUDIO_CHANNEL_OUT_STEREO, - audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE); - static status_t startOutput(audio_io_handle_t output, - audio_stream_type_t stream, - int session = 0); - static status_t stopOutput(audio_io_handle_t output, - audio_stream_type_t stream, - int session = 0); - static void releaseOutput(audio_io_handle_t output); - static audio_io_handle_t getInput(audio_source_t inputSource, - uint32_t samplingRate = 0, - audio_format_t format = AUDIO_FORMAT_DEFAULT, - uint32_t channels = AUDIO_CHANNEL_IN_MONO, - audio_in_acoustics_t acoustics = (audio_in_acoustics_t)0, - int sessionId = 0); - static status_t startInput(audio_io_handle_t input); - static status_t stopInput(audio_io_handle_t input); - static void releaseInput(audio_io_handle_t input); - static status_t initStreamVolume(audio_stream_type_t stream, - int indexMin, - int indexMax); - static status_t setStreamVolumeIndex(audio_stream_type_t stream, - int index, - audio_devices_t device); - static status_t getStreamVolumeIndex(audio_stream_type_t stream, - int *index, - audio_devices_t device); - - static uint32_t getStrategyForStream(audio_stream_type_t stream); - static audio_devices_t getDevicesForStream(audio_stream_type_t stream); - - static audio_io_handle_t getOutputForEffect(effect_descriptor_t *desc); - static status_t registerEffect(effect_descriptor_t *desc, - audio_io_handle_t io, - uint32_t strategy, - int session, - int id); - static status_t unregisterEffect(int id); - static status_t setEffectEnabled(int id, bool enabled); - - // clear stream to output mapping cache (gStreamOutputMap) - // and output configuration cache (gOutputs) - static void clearAudioConfigCache(); - - static const sp& get_audio_policy_service(); - - // ---------------------------------------------------------------------------- - -private: - - class AudioFlingerClient: public IBinder::DeathRecipient, public BnAudioFlingerClient - { - public: - AudioFlingerClient() { - } - - // DeathRecipient - virtual void binderDied(const wp& who); - - // IAudioFlingerClient - - // indicate a change in the configuration of an output or input: keeps the cached - // values for output/input parameters up-to-date in client process - virtual void ioConfigChanged(int event, audio_io_handle_t ioHandle, const void *param2); - }; - - class AudioPolicyServiceClient: public IBinder::DeathRecipient - { - public: - AudioPolicyServiceClient() { - } - - // DeathRecipient - virtual void binderDied(const wp& who); - }; - - static sp gAudioFlingerClient; - static sp gAudioPolicyServiceClient; - friend class AudioFlingerClient; - friend class AudioPolicyServiceClient; - - static Mutex gLock; - static sp gAudioFlinger; - static audio_error_callback gAudioErrorCallback; - - static size_t gInBuffSize; - // previous parameters for recording buffer size queries - static uint32_t gPrevInSamplingRate; - static audio_format_t gPrevInFormat; - static int gPrevInChannelCount; - - static sp gAudioPolicyService; - - // mapping between stream types and outputs - static DefaultKeyedVector gStreamOutputMap; - // list of output descriptors containing cached parameters - // (sampling rate, framecount, channel count...) - static DefaultKeyedVector gOutputs; -}; - -}; // namespace android - -#endif /*ANDROID_AUDIOSYSTEM_H_*/ diff --git a/external/android/include/16/frameworks/av/include/media/AudioTrack.h b/external/android/include/16/frameworks/av/include/media/AudioTrack.h deleted file mode 100644 index 639d6d2..0000000 --- a/external/android/include/16/frameworks/av/include/media/AudioTrack.h +++ /dev/null @@ -1,568 +0,0 @@ -/* - * 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_AUDIOTRACK_H -#define ANDROID_AUDIOTRACK_H - -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class audio_track_cblk_t; - -// ---------------------------------------------------------------------------- - -class AudioTrack : virtual public RefBase -{ -public: - enum channel_index { - MONO = 0, - LEFT = 0, - RIGHT = 1 - }; - - /* Events used by AudioTrack callback function (audio_track_cblk_t). - */ - enum event_type { - EVENT_MORE_DATA = 0, // Request to write more data to PCM buffer. - EVENT_UNDERRUN = 1, // PCM buffer underrun occured. - EVENT_LOOP_END = 2, // Sample loop end was reached; playback restarted from loop start if loop count was not 0. - EVENT_MARKER = 3, // Playback head is at the specified marker position (See setMarkerPosition()). - EVENT_NEW_POS = 4, // Playback head is at a new position (See setPositionUpdatePeriod()). - EVENT_BUFFER_END = 5 // Playback head is at the end of the buffer. - }; - - /* Client should declare Buffer on the stack and pass address to obtainBuffer() - * and releaseBuffer(). See also callback_t for EVENT_MORE_DATA. - */ - - class Buffer - { - public: - enum { - MUTE = 0x00000001 - }; - uint32_t flags; // 0 or MUTE - audio_format_t format; // but AUDIO_FORMAT_PCM_8_BIT -> AUDIO_FORMAT_PCM_16_BIT - // accessed directly by WebKit ANP callback - int channelCount; // will be removed in the future, do not use - - size_t frameCount; // number of sample frames corresponding to size; - // on input it is the number of frames desired, - // on output is the number of frames actually filled - - size_t size; // input/output in byte units - union { - void* raw; - short* i16; // signed 16-bit - int8_t* i8; // unsigned 8-bit, offset by 0x80 - }; - }; - - - /* As a convenience, if a callback is supplied, a handler thread - * is automatically created with the appropriate priority. This thread - * invokes the callback when a new buffer becomes available or various conditions occur. - * Parameters: - * - * event: type of event notified (see enum AudioTrack::event_type). - * user: Pointer to context for use by the callback receiver. - * info: Pointer to optional parameter according to event type: - * - EVENT_MORE_DATA: pointer to AudioTrack::Buffer struct. The callback must not write - * more bytes than indicated by 'size' field and update 'size' if fewer bytes are - * written. - * - EVENT_UNDERRUN: unused. - * - EVENT_LOOP_END: pointer to an int indicating the number of loops remaining. - * - EVENT_MARKER: pointer to an uint32_t containing the marker position in frames. - * - EVENT_NEW_POS: pointer to an uint32_t containing the new position in frames. - * - EVENT_BUFFER_END: unused. - */ - - typedef void (*callback_t)(int event, void* user, void *info); - - /* Returns the minimum frame count required for the successful creation of - * an AudioTrack object. - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - NO_INIT: audio server or audio hardware not initialized - */ - - static status_t getMinFrameCount(int* frameCount, - audio_stream_type_t streamType = AUDIO_STREAM_DEFAULT, - uint32_t sampleRate = 0); - - /* Constructs an uninitialized AudioTrack. No connection with - * AudioFlinger takes place. - */ - AudioTrack(); - - /* Creates an audio track and registers it with AudioFlinger. - * Once created, the track needs to be started before it can be used. - * Unspecified values are set to the audio hardware's current - * values. - * - * Parameters: - * - * streamType: Select the type of audio stream this track is attached to - * (e.g. AUDIO_STREAM_MUSIC). - * sampleRate: Track sampling rate in Hz. - * format: Audio format (e.g AUDIO_FORMAT_PCM_16_BIT for signed - * 16 bits per sample). - * channelMask: Channel mask: see audio_channels_t. - * frameCount: Minimum size of track PCM buffer in frames. This defines the - * latency of the track. The actual size selected by the AudioTrack could be - * larger if the requested size is not compatible with current audio HAL - * latency. Zero means to use a default value. - * flags: See comments on audio_output_flags_t in . - * cbf: Callback function. If not null, this function is called periodically - * to request new PCM data. - * user: Context for use by the callback receiver. - * notificationFrames: The callback function is called each time notificationFrames PCM - * frames have been consumed from track input buffer. - * sessionId: Specific session ID, or zero to use default. - * threadCanCallJava: Whether callbacks are made from an attached thread and thus can call JNI. - * If not present in parameter list, then fixed at false. - */ - - AudioTrack( audio_stream_type_t streamType, - uint32_t sampleRate = 0, - audio_format_t format = AUDIO_FORMAT_DEFAULT, - int channelMask = 0, - int frameCount = 0, - audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE, - callback_t cbf = NULL, - void* user = NULL, - int notificationFrames = 0, - int sessionId = 0); - - // DEPRECATED - explicit AudioTrack( int streamType, - uint32_t sampleRate = 0, - int format = AUDIO_FORMAT_DEFAULT, - int channelMask = 0, - int frameCount = 0, - uint32_t flags = (uint32_t) AUDIO_OUTPUT_FLAG_NONE, - callback_t cbf = 0, - void* user = 0, - int notificationFrames = 0, - int sessionId = 0); - - /* Creates an audio track and registers it with AudioFlinger. With this constructor, - * the PCM data to be rendered by AudioTrack is passed in a shared memory buffer - * identified by the argument sharedBuffer. This prototype is for static buffer playback. - * PCM data must be present in memory before the AudioTrack is started. - * The write() and flush() methods are not supported in this case. - * It is recommended to pass a callback function to be notified of playback end by an - * EVENT_UNDERRUN event. - */ - - AudioTrack( audio_stream_type_t streamType, - uint32_t sampleRate = 0, - audio_format_t format = AUDIO_FORMAT_DEFAULT, - int channelMask = 0, - const sp& sharedBuffer = 0, - audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE, - callback_t cbf = NULL, - void* user = NULL, - int notificationFrames = 0, - int sessionId = 0); - - /* Terminates the AudioTrack and unregisters it from AudioFlinger. - * Also destroys all resources associated with the AudioTrack. - */ - ~AudioTrack(); - - - /* Initialize an uninitialized AudioTrack. - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful initialization - * - INVALID_OPERATION: AudioTrack is already initialized - * - BAD_VALUE: invalid parameter (channels, format, sampleRate...) - * - NO_INIT: audio server or audio hardware not initialized - * */ - status_t set(audio_stream_type_t streamType = AUDIO_STREAM_DEFAULT, - uint32_t sampleRate = 0, - audio_format_t format = AUDIO_FORMAT_DEFAULT, - int channelMask = 0, - int frameCount = 0, - audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE, - callback_t cbf = NULL, - void* user = NULL, - int notificationFrames = 0, - const sp& sharedBuffer = 0, - bool threadCanCallJava = false, - int sessionId = 0); - - - /* Result of constructing the AudioTrack. This must be checked - * before using any AudioTrack API (except for set()), because using - * an uninitialized AudioTrack produces undefined results. - * See set() method above for possible return codes. - */ - status_t initCheck() const; - - /* Returns this track's estimated latency in milliseconds. - * This includes the latency due to AudioTrack buffer size, AudioMixer (if any) - * and audio hardware driver. - */ - uint32_t latency() const; - - /* getters, see constructors and set() */ - - audio_stream_type_t streamType() const; - audio_format_t format() const; - int channelCount() const; - uint32_t frameCount() const; - - /* Return channelCount * (bit depth per channel / 8). - * channelCount is determined from channelMask, and bit depth comes from format. - */ - size_t frameSize() const; - - sp& sharedBuffer(); - - - /* After it's created the track is not active. Call start() to - * make it active. If set, the callback will start being called. - */ - void start(); - - /* Stop a track. If set, the callback will cease being called and - * obtainBuffer returns STOPPED. Note that obtainBuffer() still works - * and will fill up buffers until the pool is exhausted. - */ - void stop(); - bool stopped() const; - - /* Flush a stopped track. All pending buffers are discarded. - * This function has no effect if the track is not stopped. - */ - void flush(); - - /* Pause a track. If set, the callback will cease being called and - * obtainBuffer returns STOPPED. Note that obtainBuffer() still works - * and will fill up buffers until the pool is exhausted. - */ - void pause(); - - /* Mute or unmute this track. - * While muted, the callback, if set, is still called. - */ - void mute(bool); - bool muted() const; - - /* Set volume for this track, mostly used for games' sound effects - * left and right volumes. Levels must be >= 0.0 and <= 1.0. - */ - status_t setVolume(float left, float right); - void getVolume(float* left, float* right) const; - - /* Set the send level for this track. An auxiliary effect should be attached - * to the track with attachEffect(). Level must be >= 0.0 and <= 1.0. - */ - status_t setAuxEffectSendLevel(float level); - void getAuxEffectSendLevel(float* level) const; - - /* Set sample rate for this track, mostly used for games' sound effects - */ - status_t setSampleRate(int sampleRate); - uint32_t getSampleRate() const; - - /* Enables looping and sets the start and end points of looping. - * - * Parameters: - * - * loopStart: loop start expressed as the number of PCM frames played since AudioTrack start. - * loopEnd: loop end expressed as the number of PCM frames played since AudioTrack start. - * loopCount: number of loops to execute. Calling setLoop() with loopCount == 0 cancels any - * pending or active loop. loopCount = -1 means infinite looping. - * - * For proper operation the following condition must be respected: - * (loopEnd-loopStart) <= framecount() - */ - status_t setLoop(uint32_t loopStart, uint32_t loopEnd, int loopCount); - - /* Sets marker position. When playback reaches the number of frames specified, a callback with - * event type EVENT_MARKER is called. Calling setMarkerPosition with marker == 0 cancels marker - * notification callback. - * If the AudioTrack has been opened with no callback function associated, the operation will fail. - * - * Parameters: - * - * marker: marker position expressed in frames. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the AudioTrack has no callback installed. - */ - status_t setMarkerPosition(uint32_t marker); - status_t getMarkerPosition(uint32_t *marker) const; - - - /* Sets position update period. Every time the number of frames specified has been played, - * a callback with event type EVENT_NEW_POS is called. - * Calling setPositionUpdatePeriod with updatePeriod == 0 cancels new position notification - * callback. - * If the AudioTrack has been opened with no callback function associated, the operation will fail. - * - * Parameters: - * - * updatePeriod: position update notification period expressed in frames. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the AudioTrack has no callback installed. - */ - status_t setPositionUpdatePeriod(uint32_t updatePeriod); - status_t getPositionUpdatePeriod(uint32_t *updatePeriod) const; - - /* Sets playback head position within AudioTrack buffer. The new position is specified - * in number of frames. - * This method must be called with the AudioTrack in paused or stopped state. - * Note that the actual position set is modulo the AudioTrack buffer size in frames. - * Therefore using this method makes sense only when playing a "static" audio buffer - * as opposed to streaming. - * The getPosition() method on the other hand returns the total number of frames played since - * playback start. - * - * Parameters: - * - * position: New playback head position within AudioTrack buffer. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the AudioTrack is not stopped. - * - BAD_VALUE: The specified position is beyond the number of frames present in AudioTrack buffer - */ - status_t setPosition(uint32_t position); - status_t getPosition(uint32_t *position); - - /* Forces AudioTrack buffer full condition. When playing a static buffer, this method avoids - * rewriting the buffer before restarting playback after a stop. - * This method must be called with the AudioTrack in paused or stopped state. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the AudioTrack is not stopped. - */ - status_t reload(); - - /* Returns a handle on the audio output used by this AudioTrack. - * - * Parameters: - * none. - * - * Returned value: - * handle on audio hardware output - */ - audio_io_handle_t getOutput(); - - /* Returns the unique session ID associated with this track. - * - * Parameters: - * none. - * - * Returned value: - * AudioTrack session ID. - */ - int getSessionId() const; - - /* Attach track auxiliary output to specified effect. Use effectId = 0 - * to detach track from effect. - * - * Parameters: - * - * effectId: effectId obtained from AudioEffect::id(). - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the effect is not an auxiliary effect. - * - BAD_VALUE: The specified effect ID is invalid - */ - status_t attachAuxEffect(int effectId); - - /* Obtains a buffer of "frameCount" frames. The buffer must be - * filled entirely, and then released with releaseBuffer(). - * If the track is stopped, obtainBuffer() returns - * STOPPED instead of NO_ERROR as long as there are buffers available, - * at which point NO_MORE_BUFFERS is returned. - * Buffers will be returned until the pool (buffercount()) - * is exhausted, at which point obtainBuffer() will either block - * or return WOULD_BLOCK depending on the value of the "blocking" - * parameter. - * - * Interpretation of waitCount: - * +n limits wait time to n * WAIT_PERIOD_MS, - * -1 causes an (almost) infinite wait time, - * 0 non-blocking. - */ - - enum { - NO_MORE_BUFFERS = 0x80000001, // same name in AudioFlinger.h, ok to be different value - STOPPED = 1 - }; - - status_t obtainBuffer(Buffer* audioBuffer, int32_t waitCount); - - /* Release a filled buffer of "frameCount" frames for AudioFlinger to process. */ - void releaseBuffer(Buffer* audioBuffer); - - /* As a convenience we provide a write() interface to the audio buffer. - * This is implemented on top of obtainBuffer/releaseBuffer. For best - * performance use callbacks. Returns actual number of bytes written >= 0, - * or one of the following negative status codes: - * INVALID_OPERATION AudioTrack is configured for shared buffer mode - * BAD_VALUE size is invalid - * STOPPED AudioTrack was stopped during the write - * NO_MORE_BUFFERS when obtainBuffer() returns same - * or any other error code returned by IAudioTrack::start() or restoreTrack_l(). - */ - ssize_t write(const void* buffer, size_t size); - - /* - * Dumps the state of an audio track. - */ - status_t dump(int fd, const Vector& args) const; - -protected: - /* copying audio tracks is not allowed */ - AudioTrack(const AudioTrack& other); - AudioTrack& operator = (const AudioTrack& other); - - /* a small internal class to handle the callback */ - class AudioTrackThread : public Thread - { - public: - AudioTrackThread(AudioTrack& receiver, bool bCanCallJava = false); - - // Do not call Thread::requestExitAndWait() without first calling requestExit(). - // Thread::requestExitAndWait() is not virtual, and the implementation doesn't do enough. - virtual void requestExit(); - - void pause(); // suspend thread from execution at next loop boundary - void resume(); // allow thread to execute, if not requested to exit - - private: - friend class AudioTrack; - virtual bool threadLoop(); - virtual status_t readyToRun(); - virtual void onFirstRef(); - AudioTrack& mReceiver; - ~AudioTrackThread(); - Mutex mMyLock; // Thread::mLock is private - Condition mMyCond; // Thread::mThreadExitedCondition is private - bool mPaused; // whether thread is currently paused - }; - - // body of AudioTrackThread::threadLoop() - bool processAudioBuffer(const sp& thread); - - status_t createTrack_l(audio_stream_type_t streamType, - uint32_t sampleRate, - audio_format_t format, - uint32_t channelMask, - int frameCount, - audio_output_flags_t flags, - const sp& sharedBuffer, - audio_io_handle_t output); - void flush_l(); - status_t setLoop_l(uint32_t loopStart, uint32_t loopEnd, int loopCount); - audio_io_handle_t getOutput_l(); - status_t restoreTrack_l(audio_track_cblk_t*& cblk, bool fromStart); - bool stopped_l() const { return !mActive; } - - sp mAudioTrack; - sp mCblkMemory; - sp mAudioTrackThread; - - float mVolume[2]; - float mSendLevel; - uint32_t mFrameCount; - - audio_track_cblk_t* mCblk; - audio_format_t mFormat; - audio_stream_type_t mStreamType; - uint8_t mChannelCount; - uint8_t mMuted; - uint8_t mReserved; - uint32_t mChannelMask; - status_t mStatus; - uint32_t mLatency; - - bool mActive; // protected by mLock - - callback_t mCbf; // callback handler for events, or NULL - void* mUserData; - uint32_t mNotificationFramesReq; // requested number of frames between each notification callback - uint32_t mNotificationFramesAct; // actual number of frames between each notification callback - sp mSharedBuffer; - int mLoopCount; - uint32_t mRemainingFrames; - uint32_t mMarkerPosition; - bool mMarkerReached; - uint32_t mNewPosition; - uint32_t mUpdatePeriod; - bool mFlushed; // FIXME will be made obsolete by making flush() synchronous - audio_output_flags_t mFlags; - int mSessionId; - int mAuxEffectId; - mutable Mutex mLock; - status_t mRestoreStatus; - bool mIsTimed; - int mPreviousPriority; // before start() - SchedPolicy mPreviousSchedulingGroup; -}; - -class TimedAudioTrack : public AudioTrack -{ -public: - TimedAudioTrack(); - - /* allocate a shared memory buffer that can be passed to queueTimedBuffer */ - status_t allocateTimedBuffer(size_t size, sp* buffer); - - /* queue a buffer obtained via allocateTimedBuffer for playback at the - given timestamp. PTS units a microseconds on the media time timeline. - The media time transform (set with setMediaTimeTransform) set by the - audio producer will handle converting from media time to local time - (perhaps going through the common time timeline in the case of - synchronized multiroom audio case) */ - status_t queueTimedBuffer(const sp& buffer, int64_t pts); - - /* define a transform between media time and either common time or - local time */ - enum TargetTimeline {LOCAL_TIME, COMMON_TIME}; - status_t setMediaTimeTransform(const LinearTransform& xform, - TargetTimeline target); -}; - -}; // namespace android - -#endif // ANDROID_AUDIOTRACK_H diff --git a/external/android/include/16/frameworks/av/include/media/EffectsFactoryApi.h b/external/android/include/16/frameworks/av/include/media/EffectsFactoryApi.h deleted file mode 100644 index 65c26f4..0000000 --- a/external/android/include/16/frameworks/av/include/media/EffectsFactoryApi.h +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright (C) 2010 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_EFFECTSFACTORYAPI_H_ -#define ANDROID_EFFECTSFACTORYAPI_H_ - -#include -#include -#include -#include - -#if __cplusplus -extern "C" { -#endif - -///////////////////////////////////////////////// -// Effect factory interface -///////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectQueryNumberEffects -// -// Description: Returns the number of different effects in all loaded libraries. -// Each effect must have a different effect uuid (see -// effect_descriptor_t). This function together with EffectQueryEffect() -// is used to enumerate all effects present in all loaded libraries. -// Each time EffectQueryNumberEffects() is called, the factory must -// reset the index of the effect descriptor returned by next call to -// EffectQueryEffect() to restart enumeration from the beginning. -// -// Input/Output: -// pNumEffects: address where the number of effects should be returned. -// -// Output: -// returned value: 0 successful operation. -// -ENODEV factory failed to initialize -// -EINVAL invalid pNumEffects -// *pNumEffects: updated with number of effects in factory -// -//////////////////////////////////////////////////////////////////////////////// -int EffectQueryNumberEffects(uint32_t *pNumEffects); - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectQueryEffect -// -// Description: Returns a descriptor of the next available effect. -// See effect_descriptor_t for a details on effect descriptor. -// This function together with EffectQueryNumberEffects() is used to enumerate all -// effects present in all loaded libraries. The enumeration sequence is: -// EffectQueryNumberEffects(&num_effects); -// for (i = 0; i < num_effects; i++) -// EffectQueryEffect(i,...); -// -// Input/Output: -// pDescriptor: address where to return the effect descriptor. -// -// Output: -// returned value: 0 successful operation. -// -ENOENT no more effect available -// -ENODEV factory failed to initialize -// -EINVAL invalid pDescriptor -// -ENOSYS effect list has changed since last execution of EffectQueryNumberEffects() -// *pDescriptor: updated with the effect descriptor. -// -//////////////////////////////////////////////////////////////////////////////// -int EffectQueryEffect(uint32_t index, effect_descriptor_t *pDescriptor); - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectCreate -// -// Description: Creates an effect engine of the specified type and returns an -// effect control interface on this engine. The function will allocate the -// resources for an instance of the requested effect engine and return -// a handle on the effect control interface. -// -// Input: -// pEffectUuid: pointer to the effect uuid. -// sessionId: audio session to which this effect instance will be attached. All effects created -// with the same session ID are connected in series and process the same signal stream. -// Knowing that two effects are part of the same effect chain can help the library implement -// some kind of optimizations. -// ioId: identifies the output or input stream this effect is directed to at audio HAL. For future -// use especially with tunneled HW accelerated effects -// -// Input/Output: -// pHandle: address where to return the effect handle. -// -// Output: -// returned value: 0 successful operation. -// -ENODEV factory failed to initialize -// -EINVAL invalid pEffectUuid or pHandle -// -ENOENT no effect with this uuid found -// *pHandle: updated with the effect handle. -// -//////////////////////////////////////////////////////////////////////////////// -int EffectCreate(const effect_uuid_t *pEffectUuid, int32_t sessionId, int32_t ioId, effect_handle_t *pHandle); - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectRelease -// -// Description: Releases the effect engine whose handle is given as argument. -// All resources allocated to this particular instance of the effect are -// released. -// -// Input: -// handle: handle on the effect interface to be released. -// -// Output: -// returned value: 0 successful operation. -// -ENODEV factory failed to initialize -// -EINVAL invalid interface handle -// -//////////////////////////////////////////////////////////////////////////////// -int EffectRelease(effect_handle_t handle); - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectGetDescriptor -// -// Description: Returns the descriptor of the effect which uuid is pointed -// to by first argument. -// -// Input: -// pEffectUuid: pointer to the effect uuid. -// -// Input/Output: -// pDescriptor: address where to return the effect descriptor. -// -// Output: -// returned value: 0 successful operation. -// -ENODEV factory failed to initialize -// -EINVAL invalid pEffectUuid or pDescriptor -// -ENOENT no effect with this uuid found -// *pDescriptor: updated with the effect descriptor. -// -//////////////////////////////////////////////////////////////////////////////// -int EffectGetDescriptor(const effect_uuid_t *pEffectUuid, effect_descriptor_t *pDescriptor); - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectIsNullUuid -// -// Description: Helper function to compare effect uuid to EFFECT_UUID_NULL -// -// Input: -// pEffectUuid: pointer to effect uuid to compare to EFFECT_UUID_NULL. -// -// Output: -// returned value: 0 if uuid is different from EFFECT_UUID_NULL. -// 1 if uuid is equal to EFFECT_UUID_NULL. -// -//////////////////////////////////////////////////////////////////////////////// -int EffectIsNullUuid(const effect_uuid_t *pEffectUuid); - -#if __cplusplus -} // extern "C" -#endif - - -#endif /*ANDROID_EFFECTSFACTORYAPI_H_*/ diff --git a/external/android/include/16/frameworks/av/include/media/IAudioFlinger.h b/external/android/include/16/frameworks/av/include/media/IAudioFlinger.h deleted file mode 100644 index 86e228b..0000000 --- a/external/android/include/16/frameworks/av/include/media/IAudioFlinger.h +++ /dev/null @@ -1,204 +0,0 @@ -/* - * 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_IAUDIOFLINGER_H -#define ANDROID_IAUDIOFLINGER_H - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class IAudioFlinger : public IInterface -{ -public: - DECLARE_META_INTERFACE(AudioFlinger); - - // or-able bits shared by createTrack and openRecord, but not all combinations make sense - enum { - TRACK_DEFAULT = 0, // client requests a default AudioTrack - TRACK_TIMED = 1, // client requests a TimedAudioTrack - TRACK_FAST = 2, // client requests a fast AudioTrack - }; - typedef uint32_t track_flags_t; - - /* create an audio track and registers it with AudioFlinger. - * return null if the track cannot be created. - */ - virtual sp createTrack( - pid_t pid, - audio_stream_type_t streamType, - uint32_t sampleRate, - audio_format_t format, - uint32_t channelMask, - int frameCount, - track_flags_t flags, - const sp& sharedBuffer, - audio_io_handle_t output, - pid_t tid, // -1 means unused, otherwise must be valid non-0 - int *sessionId, - status_t *status) = 0; - - virtual sp openRecord( - pid_t pid, - audio_io_handle_t input, - uint32_t sampleRate, - audio_format_t format, - uint32_t channelMask, - int frameCount, - track_flags_t flags, - int *sessionId, - status_t *status) = 0; - - /* query the audio hardware state. This state never changes, - * and therefore can be cached. - */ - virtual uint32_t sampleRate(audio_io_handle_t output) const = 0; - virtual int channelCount(audio_io_handle_t output) const = 0; - virtual audio_format_t format(audio_io_handle_t output) const = 0; - virtual size_t frameCount(audio_io_handle_t output) const = 0; - - // return estimated latency in milliseconds - virtual uint32_t latency(audio_io_handle_t output) const = 0; - - /* set/get the audio hardware state. This will probably be used by - * the preference panel, mostly. - */ - virtual status_t setMasterVolume(float value) = 0; - virtual status_t setMasterMute(bool muted) = 0; - - virtual float masterVolume() const = 0; - virtual bool masterMute() const = 0; - - /* set/get stream type state. This will probably be used by - * the preference panel, mostly. - */ - virtual status_t setStreamVolume(audio_stream_type_t stream, float value, - audio_io_handle_t output) = 0; - virtual status_t setStreamMute(audio_stream_type_t stream, bool muted) = 0; - - virtual float streamVolume(audio_stream_type_t stream, - audio_io_handle_t output) const = 0; - virtual bool streamMute(audio_stream_type_t stream) const = 0; - - // set audio mode - virtual status_t setMode(audio_mode_t mode) = 0; - - // mic mute/state - virtual status_t setMicMute(bool state) = 0; - virtual bool getMicMute() const = 0; - - virtual status_t setParameters(audio_io_handle_t ioHandle, - const String8& keyValuePairs) = 0; - virtual String8 getParameters(audio_io_handle_t ioHandle, const String8& keys) const = 0; - - // register a current process for audio output change notifications - virtual void registerClient(const sp& client) = 0; - - // retrieve the audio recording buffer size - virtual size_t getInputBufferSize(uint32_t sampleRate, audio_format_t format, int channelCount) const = 0; - - virtual audio_io_handle_t openOutput(audio_module_handle_t module, - audio_devices_t *pDevices, - uint32_t *pSamplingRate, - audio_format_t *pFormat, - audio_channel_mask_t *pChannelMask, - uint32_t *pLatencyMs, - audio_output_flags_t flags) = 0; - virtual audio_io_handle_t openDuplicateOutput(audio_io_handle_t output1, - audio_io_handle_t output2) = 0; - virtual status_t closeOutput(audio_io_handle_t output) = 0; - virtual status_t suspendOutput(audio_io_handle_t output) = 0; - virtual status_t restoreOutput(audio_io_handle_t output) = 0; - - virtual audio_io_handle_t openInput(audio_module_handle_t module, - audio_devices_t *pDevices, - uint32_t *pSamplingRate, - audio_format_t *pFormat, - audio_channel_mask_t *pChannelMask) = 0; - virtual status_t closeInput(audio_io_handle_t input) = 0; - - virtual status_t setStreamOutput(audio_stream_type_t stream, audio_io_handle_t output) = 0; - - virtual status_t setVoiceVolume(float volume) = 0; - - virtual status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames, - audio_io_handle_t output) const = 0; - - virtual unsigned int getInputFramesLost(audio_io_handle_t ioHandle) const = 0; - - virtual int newAudioSessionId() = 0; - - virtual void acquireAudioSessionId(int audioSession) = 0; - virtual void releaseAudioSessionId(int audioSession) = 0; - - virtual status_t queryNumberEffects(uint32_t *numEffects) const = 0; - - virtual status_t queryEffect(uint32_t index, effect_descriptor_t *pDescriptor) const = 0; - - virtual status_t getEffectDescriptor(const effect_uuid_t *pEffectUUID, - effect_descriptor_t *pDescriptor) const = 0; - - virtual sp createEffect(pid_t pid, - effect_descriptor_t *pDesc, - const sp& client, - int32_t priority, - audio_io_handle_t output, - int sessionId, - status_t *status, - int *id, - int *enabled) = 0; - - virtual status_t moveEffects(int session, audio_io_handle_t srcOutput, - audio_io_handle_t dstOutput) = 0; - - virtual audio_module_handle_t loadHwModule(const char *name) = 0; -}; - - -// ---------------------------------------------------------------------------- - -class BnAudioFlinger : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IAUDIOFLINGER_H diff --git a/external/android/include/16/frameworks/av/include/media/IAudioFlingerClient.h b/external/android/include/16/frameworks/av/include/media/IAudioFlingerClient.h deleted file mode 100644 index 75a9971..0000000 --- a/external/android/include/16/frameworks/av/include/media/IAudioFlingerClient.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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_IAUDIOFLINGERCLIENT_H -#define ANDROID_IAUDIOFLINGERCLIENT_H - - -#include -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class IAudioFlingerClient : public IInterface -{ -public: - DECLARE_META_INTERFACE(AudioFlingerClient); - - // Notifies a change of audio input/output configuration. - virtual void ioConfigChanged(int event, audio_io_handle_t ioHandle, const void *param2) = 0; - -}; - - -// ---------------------------------------------------------------------------- - -class BnAudioFlingerClient : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IAUDIOFLINGERCLIENT_H diff --git a/external/android/include/16/frameworks/av/include/media/IAudioPolicyService.h b/external/android/include/16/frameworks/av/include/media/IAudioPolicyService.h deleted file mode 100644 index e160d70..0000000 --- a/external/android/include/16/frameworks/av/include/media/IAudioPolicyService.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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_IAUDIOPOLICYSERVICE_H -#define ANDROID_IAUDIOPOLICYSERVICE_H - -#include -#include -#include - -#include -#include -#include -#include - -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class IAudioPolicyService : public IInterface -{ -public: - DECLARE_META_INTERFACE(AudioPolicyService); - - // - // IAudioPolicyService interface (see AudioPolicyInterface for method descriptions) - // - virtual status_t setDeviceConnectionState(audio_devices_t device, - audio_policy_dev_state_t state, - const char *device_address) = 0; - virtual audio_policy_dev_state_t getDeviceConnectionState(audio_devices_t device, - const char *device_address) = 0; - virtual status_t setPhoneState(audio_mode_t state) = 0; - virtual status_t setForceUse(audio_policy_force_use_t usage, audio_policy_forced_cfg_t config) = 0; - virtual audio_policy_forced_cfg_t getForceUse(audio_policy_force_use_t usage) = 0; - virtual audio_io_handle_t getOutput(audio_stream_type_t stream, - uint32_t samplingRate = 0, - audio_format_t format = AUDIO_FORMAT_DEFAULT, - uint32_t channels = 0, - audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE) = 0; - virtual status_t startOutput(audio_io_handle_t output, - audio_stream_type_t stream, - int session = 0) = 0; - virtual status_t stopOutput(audio_io_handle_t output, - audio_stream_type_t stream, - int session = 0) = 0; - virtual void releaseOutput(audio_io_handle_t output) = 0; - virtual audio_io_handle_t getInput(audio_source_t inputSource, - uint32_t samplingRate = 0, - audio_format_t format = AUDIO_FORMAT_DEFAULT, - uint32_t channels = 0, - audio_in_acoustics_t acoustics = (audio_in_acoustics_t)0, - int audioSession = 0) = 0; - virtual status_t startInput(audio_io_handle_t input) = 0; - virtual status_t stopInput(audio_io_handle_t input) = 0; - virtual void releaseInput(audio_io_handle_t input) = 0; - virtual status_t initStreamVolume(audio_stream_type_t stream, - int indexMin, - int indexMax) = 0; - virtual status_t setStreamVolumeIndex(audio_stream_type_t stream, - int index, - audio_devices_t device) = 0; - virtual status_t getStreamVolumeIndex(audio_stream_type_t stream, - int *index, - audio_devices_t device) = 0; - virtual uint32_t getStrategyForStream(audio_stream_type_t stream) = 0; - virtual audio_devices_t getDevicesForStream(audio_stream_type_t stream) = 0; - virtual audio_io_handle_t getOutputForEffect(effect_descriptor_t *desc) = 0; - virtual status_t registerEffect(effect_descriptor_t *desc, - audio_io_handle_t io, - uint32_t strategy, - int session, - int id) = 0; - virtual status_t unregisterEffect(int id) = 0; - virtual status_t setEffectEnabled(int id, bool enabled) = 0; - virtual bool isStreamActive(audio_stream_type_t stream, uint32_t inPastMs = 0) const = 0; - virtual status_t queryDefaultPreProcessing(int audioSession, - effect_descriptor_t *descriptors, - uint32_t *count) = 0; -}; - - -// ---------------------------------------------------------------------------- - -class BnAudioPolicyService : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IAUDIOPOLICYSERVICE_H diff --git a/external/android/include/16/frameworks/av/include/media/IAudioRecord.h b/external/android/include/16/frameworks/av/include/media/IAudioRecord.h deleted file mode 100644 index ebc03ea..0000000 --- a/external/android/include/16/frameworks/av/include/media/IAudioRecord.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 IAUDIORECORD_H_ -#define IAUDIORECORD_H_ - -#include -#include - -#include -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class IAudioRecord : public IInterface -{ -public: - DECLARE_META_INTERFACE(AudioRecord); - - /* After it's created the track is not active. Call start() to - * make it active. - */ - virtual status_t start(int event, int triggerSession) = 0; - - /* Stop a track. If set, the callback will cease being called and - * obtainBuffer will return an error. Buffers that are already released - * will be processed, unless flush() is called. - */ - virtual void stop() = 0; - - /* get this tracks control block */ - virtual sp getCblk() const = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnAudioRecord : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif /*IAUDIORECORD_H_*/ diff --git a/external/android/include/16/frameworks/av/include/media/IAudioTrack.h b/external/android/include/16/frameworks/av/include/media/IAudioTrack.h deleted file mode 100644 index 9e0e389..0000000 --- a/external/android/include/16/frameworks/av/include/media/IAudioTrack.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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_IAUDIOTRACK_H -#define ANDROID_IAUDIOTRACK_H - -#include -#include - -#include -#include -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class IAudioTrack : public IInterface -{ -public: - DECLARE_META_INTERFACE(AudioTrack); - - /* Get this track's control block */ - virtual sp getCblk() const = 0; - - /* After it's created the track is not active. Call start() to - * make it active. - */ - virtual status_t start() = 0; - - /* Stop a track. If set, the callback will cease being called and - * obtainBuffer will return an error. Buffers that are already released - * will continue to be processed, unless/until flush() is called. - */ - virtual void stop() = 0; - - /* Flush a stopped or paused track. All pending/released buffers are discarded. - * This function has no effect if the track is not stopped or paused. - */ - virtual void flush() = 0; - - /* Mute or unmute this track. - * While muted, the callback, if set, is still called. - */ - virtual void mute(bool) = 0; - - /* Pause a track. If set, the callback will cease being called and - * obtainBuffer will return an error. Buffers that are already released - * will continue to be processed, unless/until flush() is called. - */ - virtual void pause() = 0; - - /* Attach track auxiliary output to specified effect. Use effectId = 0 - * to detach track from effect. - */ - virtual status_t attachAuxEffect(int effectId) = 0; - - - /* Allocate a shared memory buffer suitable for holding timed audio - samples */ - virtual status_t allocateTimedBuffer(size_t size, - sp* buffer) = 0; - - /* Queue a buffer obtained via allocateTimedBuffer for playback at the given - timestamp */ - virtual status_t queueTimedBuffer(const sp& buffer, - int64_t pts) = 0; - - /* Define the linear transform that will be applied to the timestamps - given to queueTimedBuffer (which are expressed in media time). - Target specifies whether this transform converts media time to local time - or Tungsten time. The values for target are defined in AudioTrack.h */ - virtual status_t setMediaTimeTransform(const LinearTransform& xform, - int target) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnAudioTrack : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IAUDIOTRACK_H diff --git a/external/android/include/16/frameworks/av/include/media/ICrypto.h b/external/android/include/16/frameworks/av/include/media/ICrypto.h deleted file mode 100644 index 61059bd..0000000 --- a/external/android/include/16/frameworks/av/include/media/ICrypto.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2012 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 -#include -#include - -#ifndef ANDROID_ICRYPTO_H_ - -#define ANDROID_ICRYPTO_H_ - -namespace android { - -struct AString; - -struct ICrypto : public IInterface { - DECLARE_META_INTERFACE(Crypto); - - virtual status_t initCheck() const = 0; - - virtual bool isCryptoSchemeSupported(const uint8_t uuid[16]) const = 0; - - virtual status_t createPlugin( - const uint8_t uuid[16], const void *data, size_t size) = 0; - - virtual status_t destroyPlugin() = 0; - - virtual bool requiresSecureDecoderComponent( - const char *mime) const = 0; - - virtual ssize_t decrypt( - bool secure, - const uint8_t key[16], - const uint8_t iv[16], - CryptoPlugin::Mode mode, - const void *srcPtr, - const CryptoPlugin::SubSample *subSamples, size_t numSubSamples, - void *dstPtr, - AString *errorDetailMsg) = 0; - -private: - DISALLOW_EVIL_CONSTRUCTORS(ICrypto); -}; - -struct BnCrypto : public BnInterface { - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -}; - -} // namespace android - -#endif // ANDROID_ICRYPTO_H_ - diff --git a/external/android/include/16/frameworks/av/include/media/IEffect.h b/external/android/include/16/frameworks/av/include/media/IEffect.h deleted file mode 100644 index ff04869..0000000 --- a/external/android/include/16/frameworks/av/include/media/IEffect.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2010 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_IEFFECT_H -#define ANDROID_IEFFECT_H - -#include -#include -#include -#include - -namespace android { - -class IEffect: public IInterface -{ -public: - DECLARE_META_INTERFACE(Effect); - - virtual status_t enable() = 0; - - virtual status_t disable() = 0; - - virtual status_t command(uint32_t cmdCode, - uint32_t cmdSize, - void *pCmdData, - uint32_t *pReplySize, - void *pReplyData) = 0; - - virtual void disconnect() = 0; - - virtual sp getCblk() const = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnEffect: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IEFFECT_H diff --git a/external/android/include/16/frameworks/av/include/media/IEffectClient.h b/external/android/include/16/frameworks/av/include/media/IEffectClient.h deleted file mode 100644 index 2f78c98..0000000 --- a/external/android/include/16/frameworks/av/include/media/IEffectClient.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2010 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_IEFFECTCLIENT_H -#define ANDROID_IEFFECTCLIENT_H - -#include -#include -#include -#include - -namespace android { - -class IEffectClient: public IInterface -{ -public: - DECLARE_META_INTERFACE(EffectClient); - - virtual void controlStatusChanged(bool controlGranted) = 0; - virtual void enableStatusChanged(bool enabled) = 0; - virtual void commandExecuted(uint32_t cmdCode, - uint32_t cmdSize, - void *pCmdData, - uint32_t replySize, - void *pReplyData) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnEffectClient: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IEFFECTCLIENT_H diff --git a/external/android/include/16/frameworks/av/include/media/IMediaDeathNotifier.h b/external/android/include/16/frameworks/av/include/media/IMediaDeathNotifier.h deleted file mode 100644 index bb3d0d8..0000000 --- a/external/android/include/16/frameworks/av/include/media/IMediaDeathNotifier.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2010 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_IMEDIADEATHNOTIFIER_H -#define ANDROID_IMEDIADEATHNOTIFIER_H - -#include -#include -#include - -namespace android { - -class IMediaDeathNotifier: virtual public RefBase -{ -public: - IMediaDeathNotifier() { addObitRecipient(this); } - virtual ~IMediaDeathNotifier() { removeObitRecipient(this); } - - virtual void died() = 0; - static const sp& getMediaPlayerService(); - -private: - IMediaDeathNotifier &operator=(const IMediaDeathNotifier &); - IMediaDeathNotifier(const IMediaDeathNotifier &); - - static void addObitRecipient(const wp& recipient); - static void removeObitRecipient(const wp& recipient); - - class DeathNotifier: public IBinder::DeathRecipient - { - public: - DeathNotifier() {} - virtual ~DeathNotifier(); - - virtual void binderDied(const wp& who); - }; - - friend class DeathNotifier; - - static Mutex sServiceLock; - static sp sMediaPlayerService; - static sp sDeathNotifier; - static SortedVector< wp > sObitRecipients; -}; - -}; // namespace android - -#endif // ANDROID_IMEDIADEATHNOTIFIER_H diff --git a/external/android/include/16/frameworks/av/include/media/IMediaMetadataRetriever.h b/external/android/include/16/frameworks/av/include/media/IMediaMetadataRetriever.h deleted file mode 100644 index 6dbb2d7..0000000 --- a/external/android/include/16/frameworks/av/include/media/IMediaMetadataRetriever.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -** -** 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. -*/ - -#ifndef ANDROID_IMEDIAMETADATARETRIEVER_H -#define ANDROID_IMEDIAMETADATARETRIEVER_H - -#include -#include -#include -#include -#include - -namespace android { - -class IMediaMetadataRetriever: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaMetadataRetriever); - virtual void disconnect() = 0; - - virtual status_t setDataSource( - const char *srcUrl, - const KeyedVector *headers = NULL) = 0; - - virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; - virtual sp getFrameAtTime(int64_t timeUs, int option) = 0; - virtual sp extractAlbumArt() = 0; - virtual const char* extractMetadata(int keyCode) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnMediaMetadataRetriever: public BnInterface -{ -public: - virtual status_t onTransact(uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IMEDIAMETADATARETRIEVER_H diff --git a/external/android/include/16/frameworks/av/include/media/IMediaPlayer.h b/external/android/include/16/frameworks/av/include/media/IMediaPlayer.h deleted file mode 100644 index 00facc5..0000000 --- a/external/android/include/16/frameworks/av/include/media/IMediaPlayer.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_IMEDIAPLAYER_H -#define ANDROID_IMEDIAPLAYER_H - -#include -#include -#include -#include -#include - -// Fwd decl to make sure everyone agrees that the scope of struct sockaddr_in is -// global, and not in android:: -struct sockaddr_in; - -namespace android { - -class Parcel; -class Surface; -class IStreamSource; -class ISurfaceTexture; - -class IMediaPlayer: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaPlayer); - - virtual void disconnect() = 0; - - virtual status_t setDataSource(const char *url, - const KeyedVector* headers) = 0; - virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; - virtual status_t setDataSource(const sp& source) = 0; - virtual status_t setVideoSurfaceTexture( - const sp& surfaceTexture) = 0; - virtual status_t prepareAsync() = 0; - virtual status_t start() = 0; - virtual status_t stop() = 0; - virtual status_t pause() = 0; - virtual status_t isPlaying(bool* state) = 0; - virtual status_t seekTo(int msec) = 0; - virtual status_t getCurrentPosition(int* msec) = 0; - virtual status_t getDuration(int* msec) = 0; - virtual status_t reset() = 0; - virtual status_t setAudioStreamType(audio_stream_type_t type) = 0; - virtual status_t setLooping(int loop) = 0; - virtual status_t setVolume(float leftVolume, float rightVolume) = 0; - virtual status_t setAuxEffectSendLevel(float level) = 0; - virtual status_t attachAuxEffect(int effectId) = 0; - virtual status_t setParameter(int key, const Parcel& request) = 0; - virtual status_t getParameter(int key, Parcel* reply) = 0; - virtual status_t setRetransmitEndpoint(const struct sockaddr_in* endpoint) = 0; - virtual status_t setNextPlayer(const sp& next) = 0; - - // Invoke a generic method on the player by using opaque parcels - // for the request and reply. - // @param request Parcel that must start with the media player - // interface token. - // @param[out] reply Parcel to hold the reply data. Cannot be null. - // @return OK if the invocation was made successfully. - virtual status_t invoke(const Parcel& request, Parcel *reply) = 0; - - // Set a new metadata filter. - // @param filter A set of allow and drop rules serialized in a Parcel. - // @return OK if the invocation was made successfully. - virtual status_t setMetadataFilter(const Parcel& filter) = 0; - - // Retrieve a set of metadata. - // @param update_only Include only the metadata that have changed - // since the last invocation of getMetadata. - // The set is built using the unfiltered - // notifications the native player sent to the - // MediaPlayerService during that period of - // time. If false, all the metadatas are considered. - // @param apply_filter If true, once the metadata set has been built based - // on the value update_only, the current filter is - // applied. - // @param[out] metadata On exit contains a set (possibly empty) of metadata. - // Valid only if the call returned OK. - // @return OK if the invocation was made successfully. - virtual status_t getMetadata(bool update_only, - bool apply_filter, - Parcel *metadata) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnMediaPlayer: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IMEDIAPLAYER_H diff --git a/external/android/include/16/frameworks/av/include/media/IMediaPlayerClient.h b/external/android/include/16/frameworks/av/include/media/IMediaPlayerClient.h deleted file mode 100644 index 8f1843e..0000000 --- a/external/android/include/16/frameworks/av/include/media/IMediaPlayerClient.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_IMEDIAPLAYERCLIENT_H -#define ANDROID_IMEDIAPLAYERCLIENT_H - -#include -#include -#include - -namespace android { - -class IMediaPlayerClient: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaPlayerClient); - - virtual void notify(int msg, int ext1, int ext2, const Parcel *obj) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnMediaPlayerClient: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IMEDIAPLAYERCLIENT_H diff --git a/external/android/include/16/frameworks/av/include/media/IMediaPlayerService.h b/external/android/include/16/frameworks/av/include/media/IMediaPlayerService.h deleted file mode 100644 index 76c45a0..0000000 --- a/external/android/include/16/frameworks/av/include/media/IMediaPlayerService.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_IMEDIAPLAYERSERVICE_H -#define ANDROID_IMEDIAPLAYERSERVICE_H - -#include // for status_t -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -namespace android { - -struct ICrypto; -class IMediaRecorder; -class IOMX; -struct IStreamSource; - -class IMediaPlayerService: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaPlayerService); - - virtual sp createMediaRecorder(pid_t pid) = 0; - virtual sp createMetadataRetriever(pid_t pid) = 0; - virtual sp create(pid_t pid, const sp& client, int audioSessionId = 0) = 0; - - virtual sp decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, audio_format_t* pFormat) = 0; - virtual sp decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, audio_format_t* pFormat) = 0; - virtual sp getOMX() = 0; - virtual sp makeCrypto() = 0; - - // codecs and audio devices usage tracking for the battery app - enum BatteryDataBits { - // tracking audio codec - kBatteryDataTrackAudio = 0x1, - // tracking video codec - kBatteryDataTrackVideo = 0x2, - // codec is started, otherwise codec is paused - kBatteryDataCodecStarted = 0x4, - // tracking decoder (for media player), - // otherwise tracking encoder (for media recorder) - kBatteryDataTrackDecoder = 0x8, - // start to play an audio on an audio device - kBatteryDataAudioFlingerStart = 0x10, - // stop/pause the audio playback - kBatteryDataAudioFlingerStop = 0x20, - // audio is rounted to speaker - kBatteryDataSpeakerOn = 0x40, - // audio is rounted to devices other than speaker - kBatteryDataOtherAudioDeviceOn = 0x80, - }; - - virtual void addBatteryData(uint32_t params) = 0; - virtual status_t pullBatteryData(Parcel* reply) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnMediaPlayerService: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IMEDIAPLAYERSERVICE_H diff --git a/external/android/include/16/frameworks/av/include/media/IMediaRecorder.h b/external/android/include/16/frameworks/av/include/media/IMediaRecorder.h deleted file mode 100644 index ec84e25..0000000 --- a/external/android/include/16/frameworks/av/include/media/IMediaRecorder.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - ** - ** Copyright 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. - */ - -#ifndef ANDROID_IMEDIARECORDER_H -#define ANDROID_IMEDIARECORDER_H - -#include - -namespace android { - -class Surface; -class ICamera; -class ICameraRecordingProxy; -class IMediaRecorderClient; -class ISurfaceTexture; - -class IMediaRecorder: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaRecorder); - - virtual status_t setCamera(const sp& camera, - const sp& proxy) = 0; - virtual status_t setPreviewSurface(const sp& surface) = 0; - virtual status_t setVideoSource(int vs) = 0; - virtual status_t setAudioSource(int as) = 0; - virtual status_t setOutputFormat(int of) = 0; - virtual status_t setVideoEncoder(int ve) = 0; - virtual status_t setAudioEncoder(int ae) = 0; - virtual status_t setOutputFile(const char* path) = 0; - virtual status_t setOutputFile(int fd, int64_t offset, int64_t length) = 0; - virtual status_t setVideoSize(int width, int height) = 0; - virtual status_t setVideoFrameRate(int frames_per_second) = 0; - virtual status_t setParameters(const String8& params) = 0; - virtual status_t setListener(const sp& listener) = 0; - virtual status_t prepare() = 0; - virtual status_t getMaxAmplitude(int* max) = 0; - virtual status_t start() = 0; - virtual status_t stop() = 0; - virtual status_t reset() = 0; - virtual status_t init() = 0; - virtual status_t close() = 0; - virtual status_t release() = 0; - virtual sp querySurfaceMediaSource() = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnMediaRecorder: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IMEDIARECORDER_H diff --git a/external/android/include/16/frameworks/av/include/media/IMediaRecorderClient.h b/external/android/include/16/frameworks/av/include/media/IMediaRecorderClient.h deleted file mode 100644 index e7d0229..0000000 --- a/external/android/include/16/frameworks/av/include/media/IMediaRecorderClient.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2010 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_IMEDIARECORDERCLIENT_H -#define ANDROID_IMEDIARECORDERCLIENT_H - -#include -#include -#include - -namespace android { - -class IMediaRecorderClient: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaRecorderClient); - - virtual void notify(int msg, int ext1, int ext2) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnMediaRecorderClient: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IMEDIARECORDERCLIENT_H diff --git a/external/android/include/16/frameworks/av/include/media/IOMX.h b/external/android/include/16/frameworks/av/include/media/IOMX.h deleted file mode 100644 index be1b2fc..0000000 --- a/external/android/include/16/frameworks/av/include/media/IOMX.h +++ /dev/null @@ -1,195 +0,0 @@ -/* - * 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_IOMX_H_ - -#define ANDROID_IOMX_H_ - -#include -#include -#include -#include - -#include -#include - -namespace android { - -class IMemory; -class IOMXObserver; -class IOMXRenderer; -class Surface; - -class IOMX : public IInterface { -public: - DECLARE_META_INTERFACE(OMX); - - typedef void *buffer_id; - typedef void *node_id; - - // Given a node_id and the calling process' pid, returns true iff - // the implementation of the OMX interface lives in the same - // process. - virtual bool livesLocally(node_id node, pid_t pid) = 0; - - struct ComponentInfo { - String8 mName; - List mRoles; - }; - virtual status_t listNodes(List *list) = 0; - - virtual status_t allocateNode( - const char *name, const sp &observer, - node_id *node) = 0; - - virtual status_t freeNode(node_id node) = 0; - - virtual status_t sendCommand( - node_id node, OMX_COMMANDTYPE cmd, OMX_S32 param) = 0; - - virtual status_t getParameter( - node_id node, OMX_INDEXTYPE index, - void *params, size_t size) = 0; - - virtual status_t setParameter( - node_id node, OMX_INDEXTYPE index, - const void *params, size_t size) = 0; - - virtual status_t getConfig( - node_id node, OMX_INDEXTYPE index, - void *params, size_t size) = 0; - - virtual status_t setConfig( - node_id node, OMX_INDEXTYPE index, - const void *params, size_t size) = 0; - - virtual status_t getState( - node_id node, OMX_STATETYPE* state) = 0; - - virtual status_t storeMetaDataInBuffers( - node_id node, OMX_U32 port_index, OMX_BOOL enable) = 0; - - virtual status_t enableGraphicBuffers( - node_id node, OMX_U32 port_index, OMX_BOOL enable) = 0; - - virtual status_t getGraphicBufferUsage( - node_id node, OMX_U32 port_index, OMX_U32* usage) = 0; - - virtual status_t useBuffer( - node_id node, OMX_U32 port_index, const sp ¶ms, - buffer_id *buffer) = 0; - - virtual status_t useGraphicBuffer( - node_id node, OMX_U32 port_index, - const sp &graphicBuffer, buffer_id *buffer) = 0; - - // This API clearly only makes sense if the caller lives in the - // same process as the callee, i.e. is the media_server, as the - // returned "buffer_data" pointer is just that, a pointer into local - // address space. - virtual status_t allocateBuffer( - node_id node, OMX_U32 port_index, size_t size, - buffer_id *buffer, void **buffer_data) = 0; - - virtual status_t allocateBufferWithBackup( - node_id node, OMX_U32 port_index, const sp ¶ms, - buffer_id *buffer) = 0; - - virtual status_t freeBuffer( - node_id node, OMX_U32 port_index, buffer_id buffer) = 0; - - virtual status_t fillBuffer(node_id node, buffer_id buffer) = 0; - - virtual status_t emptyBuffer( - node_id node, - buffer_id buffer, - OMX_U32 range_offset, OMX_U32 range_length, - OMX_U32 flags, OMX_TICKS timestamp) = 0; - - virtual status_t getExtensionIndex( - node_id node, - const char *parameter_name, - OMX_INDEXTYPE *index) = 0; -}; - -struct omx_message { - enum { - EVENT, - EMPTY_BUFFER_DONE, - FILL_BUFFER_DONE, - - } type; - - IOMX::node_id node; - - union { - // if type == EVENT - struct { - OMX_EVENTTYPE event; - OMX_U32 data1; - OMX_U32 data2; - } event_data; - - // if type == EMPTY_BUFFER_DONE - struct { - IOMX::buffer_id buffer; - } buffer_data; - - // if type == FILL_BUFFER_DONE - struct { - IOMX::buffer_id buffer; - OMX_U32 range_offset; - OMX_U32 range_length; - OMX_U32 flags; - OMX_TICKS timestamp; - OMX_PTR platform_private; - OMX_PTR data_ptr; - } extended_buffer_data; - - } u; -}; - -class IOMXObserver : public IInterface { -public: - DECLARE_META_INTERFACE(OMXObserver); - - virtual void onMessage(const omx_message &msg) = 0; -}; - -//////////////////////////////////////////////////////////////////////////////// - -class BnOMX : public BnInterface { -public: - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -}; - -class BnOMXObserver : public BnInterface { -public: - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -}; - -struct CodecProfileLevel { - OMX_U32 mProfile; - OMX_U32 mLevel; -}; - -} // namespace android - -#endif // ANDROID_IOMX_H_ diff --git a/external/android/include/16/frameworks/av/include/media/IStreamSource.h b/external/android/include/16/frameworks/av/include/media/IStreamSource.h deleted file mode 100644 index 19646b0..0000000 --- a/external/android/include/16/frameworks/av/include/media/IStreamSource.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 2010 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_ISTREAMSOURCE_H_ - -#define ANDROID_ISTREAMSOURCE_H_ - -#include - -namespace android { - -struct AMessage; -struct IMemory; -struct IStreamListener; - -struct IStreamSource : public IInterface { - DECLARE_META_INTERFACE(StreamSource); - - virtual void setListener(const sp &listener) = 0; - virtual void setBuffers(const Vector > &buffers) = 0; - - virtual void onBufferAvailable(size_t index) = 0; -}; - -struct IStreamListener : public IInterface { - DECLARE_META_INTERFACE(StreamListener); - - enum Command { - EOS, - DISCONTINUITY, - }; - - virtual void queueBuffer(size_t index, size_t size) = 0; - - // When signalling a discontinuity you can optionally - // specify an int64_t PTS timestamp in "msg". - // If present, rendering of data following the discontinuity - // will be suppressed until media time reaches this timestamp. - static const char *const kKeyResumeAtPTS; - - // When signalling a discontinuity you can optionally - // specify the type(s) of discontinuity, i.e. if the - // audio format has changed, the video format has changed, - // time has jumped or any combination thereof. - // To do so, include a non-zero int32_t value - // under the key "kKeyDiscontinuityMask" when issuing the DISCONTINUITY - // command. - // If there is a change in audio/video format, The new logical stream - // must start with proper codec initialization - // information for playback to continue, i.e. SPS and PPS in the case - // of AVC video etc. - // If this key is not present, only a time discontinuity is assumed. - // The value should be a bitmask of values from - // ATSParser::DiscontinuityType. - static const char *const kKeyDiscontinuityMask; - - virtual void issueCommand( - Command cmd, bool synchronous, const sp &msg = NULL) = 0; -}; - -//////////////////////////////////////////////////////////////////////////////// - -struct BnStreamSource : public BnInterface { - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -}; - -struct BnStreamListener : public BnInterface { - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -}; - -} // namespace android - -#endif // ANDROID_ISTREAMSOURCE_H_ diff --git a/external/android/include/16/frameworks/av/include/media/JetPlayer.h b/external/android/include/16/frameworks/av/include/media/JetPlayer.h deleted file mode 100644 index 0616bf0..0000000 --- a/external/android/include/16/frameworks/av/include/media/JetPlayer.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * 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. - */ - -#ifndef JETPLAYER_H_ -#define JETPLAYER_H_ - -#include - -#include -#include -#include - - -namespace android { - -typedef void (*jetevent_callback)(int eventType, int val1, int val2, void *cookie); - -class JetPlayer { - -public: - - // to keep in sync with the JetPlayer class constants - // defined in frameworks/base/media/java/android/media/JetPlayer.java - static const int JET_EVENT = 1; - static const int JET_USERID_UPDATE = 2; - static const int JET_NUMQUEUEDSEGMENT_UPDATE = 3; - static const int JET_PAUSE_UPDATE = 4; - - JetPlayer(void *javaJetPlayer, - int maxTracks = 32, - int trackBufferSize = 1200); - ~JetPlayer(); - int init(); - int release(); - - int loadFromFile(const char* url); - int loadFromFD(const int fd, const long long offset, const long long length); - int closeFile(); - int play(); - int pause(); - int queueSegment(int segmentNum, int libNum, int repeatCount, int transpose, - EAS_U32 muteFlags, EAS_U8 userID); - int setMuteFlags(EAS_U32 muteFlags, bool sync); - int setMuteFlag(int trackNum, bool muteFlag, bool sync); - int triggerClip(int clipId); - int clearQueue(); - - void setEventCallback(jetevent_callback callback); - - int getMaxTracks() { return mMaxTracks; }; - - -private: - int render(); - void fireUpdateOnStatusChange(); - void fireEventsFromJetQueue(); - - JetPlayer() {} // no default constructor - void dump(); - void dumpJetStatus(S_JET_STATUS* pJetStatus); - - jetevent_callback mEventCallback; - - void* mJavaJetPlayerRef; - Mutex mMutex; // mutex to sync the render and playback thread with the JET calls - pid_t mTid; - Condition mCondition; - volatile bool mRender; - bool mPaused; - - EAS_STATE mState; - int* mMemFailedVar; - - int mMaxTracks; // max number of MIDI tracks, usually 32 - EAS_DATA_HANDLE mEasData; - EAS_FILE_LOCATOR mEasJetFileLoc; - EAS_PCM* mAudioBuffer;// EAS renders the MIDI data into this buffer, - AudioTrack* mAudioTrack; // and we play it in this audio track - int mTrackBufferSize; - S_JET_STATUS mJetStatus; - S_JET_STATUS mPreviousJetStatus; - - char mJetFilePath[PATH_MAX]; - - class JetPlayerThread : public Thread { - public: - JetPlayerThread(JetPlayer *player) : mPlayer(player) { - } - - protected: - virtual ~JetPlayerThread() {} - - private: - JetPlayer *mPlayer; - - bool threadLoop() { - int result; - result = mPlayer->render(); - return false; - } - - JetPlayerThread(const JetPlayerThread &); - JetPlayerThread &operator=(const JetPlayerThread &); - }; - - sp mThread; - -}; // end class JetPlayer - -} // end namespace android - - - -#endif /*JETPLAYER_H_*/ diff --git a/external/android/include/16/frameworks/av/include/media/MediaMetadataRetrieverInterface.h b/external/android/include/16/frameworks/av/include/media/MediaMetadataRetrieverInterface.h deleted file mode 100644 index ecc3b65..0000000 --- a/external/android/include/16/frameworks/av/include/media/MediaMetadataRetrieverInterface.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -** -** 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. -*/ - -#ifndef ANDROID_MEDIAMETADATARETRIEVERINTERFACE_H -#define ANDROID_MEDIAMETADATARETRIEVERINTERFACE_H - -#include -#include -#include - -namespace android { - -// Abstract base class -class MediaMetadataRetrieverBase : public RefBase -{ -public: - MediaMetadataRetrieverBase() {} - virtual ~MediaMetadataRetrieverBase() {} - - virtual status_t setDataSource( - const char *url, - const KeyedVector *headers = NULL) = 0; - - virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; - virtual VideoFrame* getFrameAtTime(int64_t timeUs, int option) = 0; - virtual MediaAlbumArt* extractAlbumArt() = 0; - virtual const char* extractMetadata(int keyCode) = 0; -}; - -// MediaMetadataRetrieverInterface -class MediaMetadataRetrieverInterface : public MediaMetadataRetrieverBase -{ -public: - MediaMetadataRetrieverInterface() {} - - virtual ~MediaMetadataRetrieverInterface() {} - virtual VideoFrame* getFrameAtTime(int64_t timeUs, int option) { return NULL; } - virtual MediaAlbumArt* extractAlbumArt() { return NULL; } - virtual const char* extractMetadata(int keyCode) { return NULL; } -}; - -}; // namespace android - -#endif // ANDROID_MEDIAMETADATARETRIEVERINTERFACE_H diff --git a/external/android/include/16/frameworks/av/include/media/MediaPlayerInterface.h b/external/android/include/16/frameworks/av/include/media/MediaPlayerInterface.h deleted file mode 100644 index a70fe8c..0000000 --- a/external/android/include/16/frameworks/av/include/media/MediaPlayerInterface.h +++ /dev/null @@ -1,235 +0,0 @@ -/* - * 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_MEDIAPLAYERINTERFACE_H -#define ANDROID_MEDIAPLAYERINTERFACE_H - -#ifdef __cplusplus - -#include -#include -#include -#include -#include - -#include -#include -#include - -// Fwd decl to make sure everyone agrees that the scope of struct sockaddr_in is -// global, and not in android:: -struct sockaddr_in; - -namespace android { - -class Parcel; -class Surface; -class ISurfaceTexture; - -template class SortedVector; - -enum player_type { - PV_PLAYER = 1, - SONIVOX_PLAYER = 2, - STAGEFRIGHT_PLAYER = 3, - NU_PLAYER = 4, - // Test players are available only in the 'test' and 'eng' builds. - // The shared library with the test player is passed passed as an - // argument to the 'test:' url in the setDataSource call. - TEST_PLAYER = 5, - - AAH_RX_PLAYER = 100, - AAH_TX_PLAYER = 101, -}; - - -#define DEFAULT_AUDIOSINK_BUFFERCOUNT 4 -#define DEFAULT_AUDIOSINK_BUFFERSIZE 1200 -#define DEFAULT_AUDIOSINK_SAMPLERATE 44100 - -// when the channel mask isn't known, use the channel count to derive a mask in AudioSink::open() -#define CHANNEL_MASK_USE_CHANNEL_ORDER 0 - -// duration below which we do not allow deep audio buffering -#define AUDIO_SINK_MIN_DEEP_BUFFER_DURATION_US 5000000 - -// callback mechanism for passing messages to MediaPlayer object -typedef void (*notify_callback_f)(void* cookie, - int msg, int ext1, int ext2, const Parcel *obj); - -// abstract base class - use MediaPlayerInterface -class MediaPlayerBase : public RefBase -{ -public: - // AudioSink: abstraction layer for audio output - class AudioSink : public RefBase { - public: - // Callback returns the number of bytes actually written to the buffer. - typedef size_t (*AudioCallback)( - AudioSink *audioSink, void *buffer, size_t size, void *cookie); - - virtual ~AudioSink() {} - virtual bool ready() const = 0; // audio output is open and ready - virtual bool realtime() const = 0; // audio output is real-time output - virtual ssize_t bufferSize() const = 0; - virtual ssize_t frameCount() const = 0; - virtual ssize_t channelCount() const = 0; - virtual ssize_t frameSize() const = 0; - virtual uint32_t latency() const = 0; - virtual float msecsPerFrame() const = 0; - virtual status_t getPosition(uint32_t *position) const = 0; - virtual status_t getFramesWritten(uint32_t *frameswritten) const = 0; - virtual int getSessionId() const = 0; - - // If no callback is specified, use the "write" API below to submit - // audio data. - virtual status_t open( - uint32_t sampleRate, int channelCount, audio_channel_mask_t channelMask, - audio_format_t format=AUDIO_FORMAT_PCM_16_BIT, - int bufferCount=DEFAULT_AUDIOSINK_BUFFERCOUNT, - AudioCallback cb = NULL, - void *cookie = NULL, - audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE) = 0; - - virtual void start() = 0; - virtual ssize_t write(const void* buffer, size_t size) = 0; - virtual void stop() = 0; - virtual void flush() = 0; - virtual void pause() = 0; - virtual void close() = 0; - - virtual status_t setPlaybackRatePermille(int32_t rate) { return INVALID_OPERATION; } - virtual bool needsTrailingPadding() { return true; } - }; - - MediaPlayerBase() : mCookie(0), mNotify(0) {} - virtual ~MediaPlayerBase() {} - virtual status_t initCheck() = 0; - virtual bool hardwareOutput() = 0; - - virtual status_t setUID(uid_t uid) { - return INVALID_OPERATION; - } - - virtual status_t setDataSource( - const char *url, - const KeyedVector *headers = NULL) = 0; - - virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; - - virtual status_t setDataSource(const sp &source) { - return INVALID_OPERATION; - } - - // pass the buffered ISurfaceTexture to the media player service - virtual status_t setVideoSurfaceTexture( - const sp& surfaceTexture) = 0; - - virtual status_t prepare() = 0; - virtual status_t prepareAsync() = 0; - virtual status_t start() = 0; - virtual status_t stop() = 0; - virtual status_t pause() = 0; - virtual bool isPlaying() = 0; - virtual status_t seekTo(int msec) = 0; - virtual status_t getCurrentPosition(int *msec) = 0; - virtual status_t getDuration(int *msec) = 0; - virtual status_t reset() = 0; - virtual status_t setLooping(int loop) = 0; - virtual player_type playerType() = 0; - virtual status_t setParameter(int key, const Parcel &request) = 0; - virtual status_t getParameter(int key, Parcel *reply) = 0; - - // Right now, only the AAX TX player supports this functionality. For now, - // provide a default implementation which indicates a lack of support for - // this functionality to make life easier for all of the other media player - // maintainers out there. - virtual status_t setRetransmitEndpoint(const struct sockaddr_in* endpoint) { - return INVALID_OPERATION; - } - - // Invoke a generic method on the player by using opaque parcels - // for the request and reply. - // - // @param request Parcel that is positioned at the start of the - // data sent by the java layer. - // @param[out] reply Parcel to hold the reply data. Cannot be null. - // @return OK if the call was successful. - virtual status_t invoke(const Parcel& request, Parcel *reply) = 0; - - // The Client in the MetadataPlayerService calls this method on - // the native player to retrieve all or a subset of metadata. - // - // @param ids SortedList of metadata ID to be fetch. If empty, all - // the known metadata should be returned. - // @param[inout] records Parcel where the player appends its metadata. - // @return OK if the call was successful. - virtual status_t getMetadata(const media::Metadata::Filter& ids, - Parcel *records) { - return INVALID_OPERATION; - }; - - void setNotifyCallback( - void* cookie, notify_callback_f notifyFunc) { - Mutex::Autolock autoLock(mNotifyLock); - mCookie = cookie; mNotify = notifyFunc; - } - - void sendEvent(int msg, int ext1=0, int ext2=0, - const Parcel *obj=NULL) { - Mutex::Autolock autoLock(mNotifyLock); - if (mNotify) mNotify(mCookie, msg, ext1, ext2, obj); - } - - virtual status_t dump(int fd, const Vector &args) const { - return INVALID_OPERATION; - } - -private: - friend class MediaPlayerService; - - Mutex mNotifyLock; - void* mCookie; - notify_callback_f mNotify; -}; - -// Implement this class for media players that use the AudioFlinger software mixer -class MediaPlayerInterface : public MediaPlayerBase -{ -public: - virtual ~MediaPlayerInterface() { } - virtual bool hardwareOutput() { return false; } - virtual void setAudioSink(const sp& audioSink) { mAudioSink = audioSink; } -protected: - sp mAudioSink; -}; - -// Implement this class for media players that output audio directly to hardware -class MediaPlayerHWInterface : public MediaPlayerBase -{ -public: - virtual ~MediaPlayerHWInterface() {} - virtual bool hardwareOutput() { return true; } - virtual status_t setVolume(float leftVolume, float rightVolume) = 0; - virtual status_t setAudioStreamType(audio_stream_type_t streamType) = 0; -}; - -}; // namespace android - -#endif // __cplusplus - - -#endif // ANDROID_MEDIAPLAYERINTERFACE_H diff --git a/external/android/include/16/frameworks/av/include/media/MediaProfiles.h b/external/android/include/16/frameworks/av/include/media/MediaProfiles.h deleted file mode 100644 index 9fc962c..0000000 --- a/external/android/include/16/frameworks/av/include/media/MediaProfiles.h +++ /dev/null @@ -1,518 +0,0 @@ -/* - ** - ** Copyright 2010, 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_MEDIAPROFILES_H -#define ANDROID_MEDIAPROFILES_H - -#include -#include - -namespace android { - -enum camcorder_quality { - CAMCORDER_QUALITY_LIST_START = 0, - CAMCORDER_QUALITY_LOW = 0, - CAMCORDER_QUALITY_HIGH = 1, - CAMCORDER_QUALITY_QCIF = 2, - CAMCORDER_QUALITY_CIF = 3, - CAMCORDER_QUALITY_480P = 4, - CAMCORDER_QUALITY_720P = 5, - CAMCORDER_QUALITY_1080P = 6, - CAMCORDER_QUALITY_QVGA = 7, - CAMCORDER_QUALITY_LIST_END = 7, - - CAMCORDER_QUALITY_TIME_LAPSE_LIST_START = 1000, - CAMCORDER_QUALITY_TIME_LAPSE_LOW = 1000, - CAMCORDER_QUALITY_TIME_LAPSE_HIGH = 1001, - CAMCORDER_QUALITY_TIME_LAPSE_QCIF = 1002, - CAMCORDER_QUALITY_TIME_LAPSE_CIF = 1003, - CAMCORDER_QUALITY_TIME_LAPSE_480P = 1004, - CAMCORDER_QUALITY_TIME_LAPSE_720P = 1005, - CAMCORDER_QUALITY_TIME_LAPSE_1080P = 1006, - CAMCORDER_QUALITY_TIME_LAPSE_QVGA = 1007, - CAMCORDER_QUALITY_TIME_LAPSE_LIST_END = 1007, -}; - -/** - * Set CIF as default maximum import and export resolution of video editor. - * The maximum import and export resolutions are platform specific, - * which should be defined in media_profiles.xml. - * Set default maximum prefetch YUV frames to 6, which means video editor can - * queue up to 6 YUV frames in the video encoder source. - * This value is used to limit the amount of memory used by video editor - * engine when the encoder consumes YUV frames at a lower speed - * than video editor engine produces. - */ -enum videoeditor_capability { - VIDEOEDITOR_DEFAULT_MAX_INPUT_FRAME_WIDTH = 352, - VIDEOEDITOR_DEFUALT_MAX_INPUT_FRAME_HEIGHT = 288, - VIDEOEDITOR_DEFAULT_MAX_OUTPUT_FRAME_WIDTH = 352, - VIDEOEDITOR_DEFUALT_MAX_OUTPUT_FRAME_HEIGHT = 288, - VIDEOEDITOR_DEFAULT_MAX_PREFETCH_YUV_FRAMES = 6 -}; - -enum video_decoder { - VIDEO_DECODER_WMV, -}; - -enum audio_decoder { - AUDIO_DECODER_WMA, -}; - - -class MediaProfiles -{ -public: - - /** - * Returns the singleton instance for subsequence queries. - * or NULL if error. - */ - static MediaProfiles* getInstance(); - - /** - * Returns the value for the given param name for the given camera at - * the given quality level, or -1 if error. - * - * Supported param name are: - * duration - the recording duration. - * file.format - output file format. see mediarecorder.h for details - * vid.codec - video encoder. see mediarecorder.h for details. - * aud.codec - audio encoder. see mediarecorder.h for details. - * vid.width - video frame width - * vid.height - video frame height - * vid.fps - video frame rate - * vid.bps - video bit rate - * aud.bps - audio bit rate - * aud.hz - audio sample rate - * aud.ch - number of audio channels - */ - int getCamcorderProfileParamByName(const char *name, int cameraId, - camcorder_quality quality) const; - - /** - * Returns true if a profile for the given camera at the given quality exists, - * or false if not. - */ - bool hasCamcorderProfile(int cameraId, camcorder_quality quality) const; - - /** - * Returns the output file formats supported. - */ - Vector getOutputFileFormats() const; - - /** - * Returns the video encoders supported. - */ - Vector getVideoEncoders() const; - - /** - * Returns the value for the given param name for the given video encoder - * returned from getVideoEncoderByIndex or -1 if error. - * - * Supported param name are: - * enc.vid.width.min - min video frame width - * enc.vid.width.max - max video frame width - * enc.vid.height.min - min video frame height - * enc.vid.height.max - max video frame height - * enc.vid.bps.min - min bit rate in bits per second - * enc.vid.bps.max - max bit rate in bits per second - * enc.vid.fps.min - min frame rate in frames per second - * enc.vid.fps.max - max frame rate in frames per second - */ - int getVideoEncoderParamByName(const char *name, video_encoder codec) const; - - /** - * Returns the value for the given param name for the video editor cap - * param or -1 if error. - * Supported param name are: - * videoeditor.input.width.max - max input video frame width - * videoeditor.input.height.max - max input video frame height - * videoeditor.output.width.max - max output video frame width - * videoeditor.output.height.max - max output video frame height - * maxPrefetchYUVFrames - max prefetch YUV frames in video editor engine. This value is used - * to limit the memory consumption. - */ - int getVideoEditorCapParamByName(const char *name) const; - - /** - * Returns the value for the given param name for the video editor export codec format - * param or -1 if error. - * Supported param name are: - * videoeditor.export.profile - export video profile - * videoeditor.export.level - export video level - * Supported param codec are: - * 1 for h263 - * 2 for h264 - * 3 for mpeg4 - */ - int getVideoEditorExportParamByName(const char *name, int codec) const; - - /** - * Returns the audio encoders supported. - */ - Vector getAudioEncoders() const; - - /** - * Returns the value for the given param name for the given audio encoder - * returned from getAudioEncoderByIndex or -1 if error. - * - * Supported param name are: - * enc.aud.ch.min - min number of channels - * enc.aud.ch.max - max number of channels - * enc.aud.bps.min - min bit rate in bits per second - * enc.aud.bps.max - max bit rate in bits per second - * enc.aud.hz.min - min sample rate in samples per second - * enc.aud.hz.max - max sample rate in samples per second - */ - int getAudioEncoderParamByName(const char *name, audio_encoder codec) const; - - /** - * Returns the video decoders supported. - */ - Vector getVideoDecoders() const; - - /** - * Returns the audio decoders supported. - */ - Vector getAudioDecoders() const; - - /** - * Returns the number of image encoding quality levels supported. - */ - Vector getImageEncodingQualityLevels(int cameraId) const; - - /** - * Returns the start time offset (in ms) for the given camera Id. - * If the given camera Id does not exist, -1 will be returned. - */ - int getStartTimeOffsetMs(int cameraId) const; - -private: - enum { - // Camcorder profiles (high/low) and timelapse profiles (high/low) - kNumRequiredProfiles = 4, - }; - - MediaProfiles& operator=(const MediaProfiles&); // Don't call me - MediaProfiles(const MediaProfiles&); // Don't call me - MediaProfiles() { mVideoEditorCap = NULL; } // Dummy default constructor - ~MediaProfiles(); // Don't delete me - - struct VideoCodec { - VideoCodec(video_encoder codec, int bitRate, int frameWidth, int frameHeight, int frameRate) - : mCodec(codec), - mBitRate(bitRate), - mFrameWidth(frameWidth), - mFrameHeight(frameHeight), - mFrameRate(frameRate) {} - - VideoCodec(const VideoCodec& copy) { - mCodec = copy.mCodec; - mBitRate = copy.mBitRate; - mFrameWidth = copy.mFrameWidth; - mFrameHeight = copy.mFrameHeight; - mFrameRate = copy.mFrameRate; - } - - ~VideoCodec() {} - - video_encoder mCodec; - int mBitRate; - int mFrameWidth; - int mFrameHeight; - int mFrameRate; - }; - - struct AudioCodec { - AudioCodec(audio_encoder codec, int bitRate, int sampleRate, int channels) - : mCodec(codec), - mBitRate(bitRate), - mSampleRate(sampleRate), - mChannels(channels) {} - - AudioCodec(const AudioCodec& copy) { - mCodec = copy.mCodec; - mBitRate = copy.mBitRate; - mSampleRate = copy.mSampleRate; - mChannels = copy.mChannels; - } - - ~AudioCodec() {} - - audio_encoder mCodec; - int mBitRate; - int mSampleRate; - int mChannels; - }; - - struct CamcorderProfile { - CamcorderProfile() - : mCameraId(0), - mFileFormat(OUTPUT_FORMAT_THREE_GPP), - mQuality(CAMCORDER_QUALITY_HIGH), - mDuration(0), - mVideoCodec(0), - mAudioCodec(0) {} - - CamcorderProfile(const CamcorderProfile& copy) { - mCameraId = copy.mCameraId; - mFileFormat = copy.mFileFormat; - mQuality = copy.mQuality; - mDuration = copy.mDuration; - mVideoCodec = new VideoCodec(*copy.mVideoCodec); - mAudioCodec = new AudioCodec(*copy.mAudioCodec); - } - - ~CamcorderProfile() { - delete mVideoCodec; - delete mAudioCodec; - } - - int mCameraId; - output_format mFileFormat; - camcorder_quality mQuality; - int mDuration; - VideoCodec *mVideoCodec; - AudioCodec *mAudioCodec; - }; - - struct VideoEncoderCap { - // Ugly constructor - VideoEncoderCap(video_encoder codec, - int minBitRate, int maxBitRate, - int minFrameWidth, int maxFrameWidth, - int minFrameHeight, int maxFrameHeight, - int minFrameRate, int maxFrameRate) - : mCodec(codec), - mMinBitRate(minBitRate), mMaxBitRate(maxBitRate), - mMinFrameWidth(minFrameWidth), mMaxFrameWidth(maxFrameWidth), - mMinFrameHeight(minFrameHeight), mMaxFrameHeight(maxFrameHeight), - mMinFrameRate(minFrameRate), mMaxFrameRate(maxFrameRate) {} - - ~VideoEncoderCap() {} - - video_encoder mCodec; - int mMinBitRate, mMaxBitRate; - int mMinFrameWidth, mMaxFrameWidth; - int mMinFrameHeight, mMaxFrameHeight; - int mMinFrameRate, mMaxFrameRate; - }; - - struct AudioEncoderCap { - // Ugly constructor - AudioEncoderCap(audio_encoder codec, - int minBitRate, int maxBitRate, - int minSampleRate, int maxSampleRate, - int minChannels, int maxChannels) - : mCodec(codec), - mMinBitRate(minBitRate), mMaxBitRate(maxBitRate), - mMinSampleRate(minSampleRate), mMaxSampleRate(maxSampleRate), - mMinChannels(minChannels), mMaxChannels(maxChannels) {} - - ~AudioEncoderCap() {} - - audio_encoder mCodec; - int mMinBitRate, mMaxBitRate; - int mMinSampleRate, mMaxSampleRate; - int mMinChannels, mMaxChannels; - }; - - struct VideoDecoderCap { - VideoDecoderCap(video_decoder codec): mCodec(codec) {} - ~VideoDecoderCap() {} - - video_decoder mCodec; - }; - - struct AudioDecoderCap { - AudioDecoderCap(audio_decoder codec): mCodec(codec) {} - ~AudioDecoderCap() {} - - audio_decoder mCodec; - }; - - struct NameToTagMap { - const char* name; - int tag; - }; - - struct ImageEncodingQualityLevels { - int mCameraId; - Vector mLevels; - }; - struct ExportVideoProfile { - ExportVideoProfile(int codec, int profile, int level) - :mCodec(codec),mProfile(profile),mLevel(level) {} - ~ExportVideoProfile() {} - int mCodec; - int mProfile; - int mLevel; - }; - struct VideoEditorCap { - VideoEditorCap(int inFrameWidth, int inFrameHeight, - int outFrameWidth, int outFrameHeight, int frames) - : mMaxInputFrameWidth(inFrameWidth), - mMaxInputFrameHeight(inFrameHeight), - mMaxOutputFrameWidth(outFrameWidth), - mMaxOutputFrameHeight(outFrameHeight), - mMaxPrefetchYUVFrames(frames) {} - - ~VideoEditorCap() {} - - int mMaxInputFrameWidth; - int mMaxInputFrameHeight; - int mMaxOutputFrameWidth; - int mMaxOutputFrameHeight; - int mMaxPrefetchYUVFrames; - }; - - int getCamcorderProfileIndex(int cameraId, camcorder_quality quality) const; - void initRequiredProfileRefs(const Vector& cameraIds); - int getRequiredProfileRefIndex(int cameraId); - - // Debug - static void logVideoCodec(const VideoCodec& codec); - static void logAudioCodec(const AudioCodec& codec); - static void logVideoEncoderCap(const VideoEncoderCap& cap); - static void logAudioEncoderCap(const AudioEncoderCap& cap); - static void logVideoDecoderCap(const VideoDecoderCap& cap); - static void logAudioDecoderCap(const AudioDecoderCap& cap); - static void logVideoEditorCap(const VideoEditorCap& cap); - - // If the xml configuration file does exist, use the settings - // from the xml - static MediaProfiles* createInstanceFromXmlFile(const char *xml); - static output_format createEncoderOutputFileFormat(const char **atts); - static VideoCodec* createVideoCodec(const char **atts, MediaProfiles *profiles); - static AudioCodec* createAudioCodec(const char **atts, MediaProfiles *profiles); - static AudioDecoderCap* createAudioDecoderCap(const char **atts); - static VideoDecoderCap* createVideoDecoderCap(const char **atts); - static VideoEncoderCap* createVideoEncoderCap(const char **atts); - static AudioEncoderCap* createAudioEncoderCap(const char **atts); - static VideoEditorCap* createVideoEditorCap( - const char **atts, MediaProfiles *profiles); - static ExportVideoProfile* createExportVideoProfile(const char **atts); - - static CamcorderProfile* createCamcorderProfile( - int cameraId, const char **atts, Vector& cameraIds); - - static int getCameraId(const char **atts); - - void addStartTimeOffset(int cameraId, const char **atts); - - ImageEncodingQualityLevels* findImageEncodingQualityLevels(int cameraId) const; - void addImageEncodingQualityLevel(int cameraId, const char** atts); - - // Customized element tag handler for parsing the xml configuration file. - static void startElementHandler(void *userData, const char *name, const char **atts); - - // If the xml configuration file does not exist, use hard-coded values - static MediaProfiles* createDefaultInstance(); - - static CamcorderProfile *createDefaultCamcorderQcifProfile(camcorder_quality quality); - static CamcorderProfile *createDefaultCamcorderCifProfile(camcorder_quality quality); - static void createDefaultCamcorderLowProfiles( - MediaProfiles::CamcorderProfile **lowProfile, - MediaProfiles::CamcorderProfile **lowSpecificProfile); - static void createDefaultCamcorderHighProfiles( - MediaProfiles::CamcorderProfile **highProfile, - MediaProfiles::CamcorderProfile **highSpecificProfile); - - static CamcorderProfile *createDefaultCamcorderTimeLapseQcifProfile(camcorder_quality quality); - static CamcorderProfile *createDefaultCamcorderTimeLapse480pProfile(camcorder_quality quality); - static void createDefaultCamcorderTimeLapseLowProfiles( - MediaProfiles::CamcorderProfile **lowTimeLapseProfile, - MediaProfiles::CamcorderProfile **lowSpecificTimeLapseProfile); - static void createDefaultCamcorderTimeLapseHighProfiles( - MediaProfiles::CamcorderProfile **highTimeLapseProfile, - MediaProfiles::CamcorderProfile **highSpecificTimeLapseProfile); - - static void createDefaultCamcorderProfiles(MediaProfiles *profiles); - static void createDefaultVideoEncoders(MediaProfiles *profiles); - static void createDefaultAudioEncoders(MediaProfiles *profiles); - static void createDefaultVideoDecoders(MediaProfiles *profiles); - static void createDefaultAudioDecoders(MediaProfiles *profiles); - static void createDefaultEncoderOutputFileFormats(MediaProfiles *profiles); - static void createDefaultImageEncodingQualityLevels(MediaProfiles *profiles); - static void createDefaultImageDecodingMaxMemory(MediaProfiles *profiles); - static void createDefaultVideoEditorCap(MediaProfiles *profiles); - static void createDefaultExportVideoProfiles(MediaProfiles *profiles); - - static VideoEncoderCap* createDefaultH263VideoEncoderCap(); - static VideoEncoderCap* createDefaultM4vVideoEncoderCap(); - static AudioEncoderCap* createDefaultAmrNBEncoderCap(); - - static int findTagForName(const NameToTagMap *map, size_t nMappings, const char *name); - - /** - * Check on existing profiles with the following criteria: - * 1. Low quality profile must have the lowest video - * resolution product (width x height) - * 2. High quality profile must have the highest video - * resolution product (width x height) - * - * and add required low/high quality camcorder/timelapse - * profiles if they are not found. This allows to remove - * duplicate profile definitions in the media_profiles.xml - * file. - */ - void checkAndAddRequiredProfilesIfNecessary(); - - - // Mappings from name (for instance, codec name) to enum value - static const NameToTagMap sVideoEncoderNameMap[]; - static const NameToTagMap sAudioEncoderNameMap[]; - static const NameToTagMap sFileFormatMap[]; - static const NameToTagMap sVideoDecoderNameMap[]; - static const NameToTagMap sAudioDecoderNameMap[]; - static const NameToTagMap sCamcorderQualityNameMap[]; - - static bool sIsInitialized; - static MediaProfiles *sInstance; - static Mutex sLock; - int mCurrentCameraId; - - Vector mCamcorderProfiles; - Vector mAudioEncoders; - Vector mVideoEncoders; - Vector mAudioDecoders; - Vector mVideoDecoders; - Vector mEncoderOutputFileFormats; - Vector mImageEncodingQualityLevels; - KeyedVector mStartTimeOffsets; - - typedef struct { - bool mHasRefProfile; // Refers to an existing profile - int mRefProfileIndex; // Reference profile index - int mResolutionProduct; // width x height - } RequiredProfileRefInfo; // Required low and high profiles - - typedef struct { - RequiredProfileRefInfo mRefs[kNumRequiredProfiles]; - int mCameraId; - } RequiredProfiles; - - RequiredProfiles *mRequiredProfileRefs; - Vector mCameraIds; - VideoEditorCap* mVideoEditorCap; - Vector mVideoEditorExportProfiles; -}; - -}; // namespace android - -#endif // ANDROID_MEDIAPROFILES_H diff --git a/external/android/include/16/frameworks/av/include/media/MediaRecorderBase.h b/external/android/include/16/frameworks/av/include/media/MediaRecorderBase.h deleted file mode 100644 index ef799f5..0000000 --- a/external/android/include/16/frameworks/av/include/media/MediaRecorderBase.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 MEDIA_RECORDER_BASE_H_ - -#define MEDIA_RECORDER_BASE_H_ - -#include - -#include - -namespace android { - -class ICameraRecordingProxy; -class Surface; -class ISurfaceTexture; - -struct MediaRecorderBase { - MediaRecorderBase() {} - virtual ~MediaRecorderBase() {} - - virtual status_t init() = 0; - virtual status_t setAudioSource(audio_source_t as) = 0; - virtual status_t setVideoSource(video_source vs) = 0; - virtual status_t setOutputFormat(output_format of) = 0; - virtual status_t setAudioEncoder(audio_encoder ae) = 0; - virtual status_t setVideoEncoder(video_encoder ve) = 0; - virtual status_t setVideoSize(int width, int height) = 0; - virtual status_t setVideoFrameRate(int frames_per_second) = 0; - virtual status_t setCamera(const sp& camera, - const sp& proxy) = 0; - virtual status_t setPreviewSurface(const sp& surface) = 0; - virtual status_t setOutputFile(const char *path) = 0; - virtual status_t setOutputFile(int fd, int64_t offset, int64_t length) = 0; - virtual status_t setOutputFileAuxiliary(int fd) {return INVALID_OPERATION;} - virtual status_t setParameters(const String8& params) = 0; - virtual status_t setListener(const sp& listener) = 0; - virtual status_t prepare() = 0; - virtual status_t start() = 0; - virtual status_t stop() = 0; - virtual status_t close() = 0; - virtual status_t reset() = 0; - virtual status_t getMaxAmplitude(int *max) = 0; - virtual status_t dump(int fd, const Vector& args) const = 0; - virtual sp querySurfaceMediaSource() const = 0; - -private: - MediaRecorderBase(const MediaRecorderBase &); - MediaRecorderBase &operator=(const MediaRecorderBase &); -}; - -} // namespace android - -#endif // MEDIA_RECORDER_BASE_H_ diff --git a/external/android/include/16/frameworks/av/include/media/MemoryLeakTrackUtil.h b/external/android/include/16/frameworks/av/include/media/MemoryLeakTrackUtil.h deleted file mode 100644 index d2618aa..0000000 --- a/external/android/include/16/frameworks/av/include/media/MemoryLeakTrackUtil.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2011, 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 MEMORY_LEAK_TRACK_UTIL_H -#define MEMORY_LEAK_TRACK_UTIL_H - -namespace android { -/* - * Dump the memory address of the calling process to the given fd. - */ -extern void dumpMemoryAddresses(int fd); - -}; - -#endif // MEMORY_LEAK_TRACK_UTIL_H diff --git a/external/android/include/16/frameworks/av/include/media/Metadata.h b/external/android/include/16/frameworks/av/include/media/Metadata.h deleted file mode 100644 index 07567eb..0000000 --- a/external/android/include/16/frameworks/av/include/media/Metadata.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 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_MEDIA_METADATA_H__ -#define ANDROID_MEDIA_METADATA_H__ - -#include -#include -#include -#include - -namespace android { -class Parcel; - -namespace media { - -// Metadata is a class to build/serialize a set of metadata in a Parcel. -// -// This class should be kept in sync with android/media/Metadata.java. -// It provides all the metadata ids available and methods to build the -// header, add records and adjust the set size header field. -// -// Typical Usage: -// ============== -// Parcel p; -// media::Metadata data(&p); -// -// data.appendHeader(); -// data.appendBool(Metadata::kPauseAvailable, true); -// ... more append ... -// data.updateLength(); -// - -class Metadata { - public: - typedef int32_t Type; - typedef SortedVector Filter; - - static const Type kAny = 0; - - // Playback capabilities. - static const Type kPauseAvailable = 1; // Boolean - static const Type kSeekBackwardAvailable = 2; // Boolean - static const Type kSeekForwardAvailable = 3; // Boolean - static const Type kSeekAvailable = 4; // Boolean - - // Keep in sync with android/media/Metadata.java - static const Type kTitle = 5; // String - static const Type kComment = 6; // String - static const Type kCopyright = 7; // String - static const Type kAlbum = 8; // String - static const Type kArtist = 9; // String - static const Type kAuthor = 10; // String - static const Type kComposer = 11; // String - static const Type kGenre = 12; // String - static const Type kDate = 13; // Date - static const Type kDuration = 14; // Integer(millisec) - static const Type kCdTrackNum = 15; // Integer 1-based - static const Type kCdTrackMax = 16; // Integer - static const Type kRating = 17; // String - static const Type kAlbumArt = 18; // byte[] - static const Type kVideoFrame = 19; // Bitmap - - static const Type kBitRate = 20; // Integer, Aggregate rate of - // all the streams in bps. - - static const Type kAudioBitRate = 21; // Integer, bps - static const Type kVideoBitRate = 22; // Integer, bps - static const Type kAudioSampleRate = 23; // Integer, Hz - static const Type kVideoframeRate = 24; // Integer, Hz - - // See RFC2046 and RFC4281. - static const Type kMimeType = 25; // String - static const Type kAudioCodec = 26; // String - static const Type kVideoCodec = 27; // String - - static const Type kVideoHeight = 28; // Integer - static const Type kVideoWidth = 29; // Integer - static const Type kNumTracks = 30; // Integer - static const Type kDrmCrippled = 31; // Boolean - - // @param p[inout] The parcel to append the metadata records - // to. The global metadata header should have been set already. - explicit Metadata(Parcel *p); - ~Metadata(); - - // Rewind the underlying parcel, undoing all the changes. - void resetParcel(); - - // Append the size and 'META' marker. - bool appendHeader(); - - // Once all the records have been added, call this to update the - // lenght field in the header. - void updateLength(); - - // append* are methods to append metadata. - // @param key Is the metadata Id. - // @param val Is the value of the metadata. - // @return true if successful, false otherwise. - // TODO: add more as needed to handle other types. - bool appendBool(Type key, bool val); - bool appendInt32(Type key, int32_t val); - - private: - Metadata(const Metadata&); - Metadata& operator=(const Metadata&); - - - // Checks the key is valid and not already present. - bool checkKey(Type key); - - Parcel *mData; - size_t mBegin; -}; - -} // namespace android::media -} // namespace android - -#endif // ANDROID_MEDIA_METADATA_H__ diff --git a/external/android/include/16/frameworks/av/include/media/SoundPool.h b/external/android/include/16/frameworks/av/include/media/SoundPool.h deleted file mode 100644 index 002b045..0000000 --- a/external/android/include/16/frameworks/av/include/media/SoundPool.h +++ /dev/null @@ -1,238 +0,0 @@ -/* - * 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 SOUNDPOOL_H_ -#define SOUNDPOOL_H_ - -#include -#include -#include -#include -#include - -namespace android { - -static const int IDLE_PRIORITY = -1; - -// forward declarations -class SoundEvent; -class SoundPoolThread; -class SoundPool; - -// for queued events -class SoundPoolEvent { -public: - SoundPoolEvent(int msg, int arg1=0, int arg2=0) : - mMsg(msg), mArg1(arg1), mArg2(arg2) {} - int mMsg; - int mArg1; - int mArg2; - enum MessageType { INVALID, SAMPLE_LOADED }; -}; - -// callback function prototype -typedef void SoundPoolCallback(SoundPoolEvent event, SoundPool* soundPool, void* user); - -// tracks samples used by application -class Sample : public RefBase { -public: - enum sample_state { UNLOADED, LOADING, READY, UNLOADING }; - Sample(int sampleID, const char* url); - Sample(int sampleID, int fd, int64_t offset, int64_t length); - ~Sample(); - int sampleID() { return mSampleID; } - int numChannels() { return mNumChannels; } - int sampleRate() { return mSampleRate; } - audio_format_t format() { return mFormat; } - size_t size() { return mSize; } - int state() { return mState; } - uint8_t* data() { return static_cast(mData->pointer()); } - status_t doLoad(); - void startLoad() { mState = LOADING; } - sp getIMemory() { return mData; } - - // hack - void init(int numChannels, int sampleRate, audio_format_t format, size_t size, sp data ) { - mNumChannels = numChannels; mSampleRate = sampleRate; mFormat = format; mSize = size; mData = data; } - -private: - void init(); - - size_t mSize; - volatile int32_t mRefCount; - uint16_t mSampleID; - uint16_t mSampleRate; - uint8_t mState : 3; - uint8_t mNumChannels : 2; - audio_format_t mFormat; - int mFd; - int64_t mOffset; - int64_t mLength; - char* mUrl; - sp mData; -}; - -// stores pending events for stolen channels -class SoundEvent -{ -public: - SoundEvent() : mChannelID(0), mLeftVolume(0), mRightVolume(0), - mPriority(IDLE_PRIORITY), mLoop(0), mRate(0) {} - void set(const sp& sample, int channelID, float leftVolume, - float rightVolume, int priority, int loop, float rate); - sp sample() { return mSample; } - int channelID() { return mChannelID; } - float leftVolume() { return mLeftVolume; } - float rightVolume() { return mRightVolume; } - int priority() { return mPriority; } - int loop() { return mLoop; } - float rate() { return mRate; } - void clear() { mChannelID = 0; mSample.clear(); } - -protected: - sp mSample; - int mChannelID; - float mLeftVolume; - float mRightVolume; - int mPriority; - int mLoop; - float mRate; -}; - -// for channels aka AudioTracks -class SoundChannel : public SoundEvent { -public: - enum state { IDLE, RESUMING, STOPPING, PAUSED, PLAYING }; - SoundChannel() : mAudioTrack(NULL), mState(IDLE), mNumChannels(1), - mPos(0), mToggle(0), mAutoPaused(false) {} - ~SoundChannel(); - void init(SoundPool* soundPool); - void play(const sp& sample, int channelID, float leftVolume, float rightVolume, - int priority, int loop, float rate); - void setVolume_l(float leftVolume, float rightVolume); - void setVolume(float leftVolume, float rightVolume); - void stop_l(); - void stop(); - void pause(); - void autoPause(); - void resume(); - void autoResume(); - void setRate(float rate); - int state() { return mState; } - void setPriority(int priority) { mPriority = priority; } - void setLoop(int loop); - int numChannels() { return mNumChannels; } - void clearNextEvent() { mNextEvent.clear(); } - void nextEvent(); - int nextChannelID() { return mNextEvent.channelID(); } - void dump(); - -private: - static void callback(int event, void* user, void *info); - void process(int event, void *info, unsigned long toggle); - bool doStop_l(); - - SoundPool* mSoundPool; - AudioTrack* mAudioTrack; - SoundEvent mNextEvent; - Mutex mLock; - int mState; - int mNumChannels; - int mPos; - int mAudioBufferSize; - unsigned long mToggle; - bool mAutoPaused; -}; - -// application object for managing a pool of sounds -class SoundPool { - friend class SoundPoolThread; - friend class SoundChannel; -public: - SoundPool(int maxChannels, audio_stream_type_t streamType, int srcQuality); - ~SoundPool(); - int load(const char* url, int priority); - int load(int fd, int64_t offset, int64_t length, int priority); - bool unload(int sampleID); - int play(int sampleID, float leftVolume, float rightVolume, int priority, - int loop, float rate); - void pause(int channelID); - void autoPause(); - void resume(int channelID); - void autoResume(); - void stop(int channelID); - void setVolume(int channelID, float leftVolume, float rightVolume); - void setPriority(int channelID, int priority); - void setLoop(int channelID, int loop); - void setRate(int channelID, float rate); - audio_stream_type_t streamType() const { return mStreamType; } - int srcQuality() const { return mSrcQuality; } - - // called from SoundPoolThread - void sampleLoaded(int sampleID); - - // called from AudioTrack thread - void done_l(SoundChannel* channel); - - // callback function - void setCallback(SoundPoolCallback* callback, void* user); - void* getUserData() { return mUserData; } - -private: - SoundPool() {} // no default constructor - bool startThreads(); - void doLoad(sp& sample); - sp findSample(int sampleID) { return mSamples.valueFor(sampleID); } - SoundChannel* findChannel (int channelID); - SoundChannel* findNextChannel (int channelID); - SoundChannel* allocateChannel_l(int priority); - void moveToFront_l(SoundChannel* channel); - void notify(SoundPoolEvent event); - void dump(); - - // restart thread - void addToRestartList(SoundChannel* channel); - void addToStopList(SoundChannel* channel); - static int beginThread(void* arg); - int run(); - void quit(); - - Mutex mLock; - Mutex mRestartLock; - Condition mCondition; - SoundPoolThread* mDecodeThread; - SoundChannel* mChannelPool; - List mChannels; - List mRestart; - List mStop; - DefaultKeyedVector< int, sp > mSamples; - int mMaxChannels; - audio_stream_type_t mStreamType; - int mSrcQuality; - int mAllocated; - int mNextSampleID; - int mNextChannelID; - bool mQuit; - - // callback - Mutex mCallbackLock; - SoundPoolCallback* mCallback; - void* mUserData; -}; - -} // end namespace android - -#endif /*SOUNDPOOL_H_*/ diff --git a/external/android/include/16/frameworks/av/include/media/ToneGenerator.h b/external/android/include/16/frameworks/av/include/media/ToneGenerator.h deleted file mode 100644 index 29c8fd9..0000000 --- a/external/android/include/16/frameworks/av/include/media/ToneGenerator.h +++ /dev/null @@ -1,316 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_TONEGENERATOR_H_ -#define ANDROID_TONEGENERATOR_H_ - -#include -#include -#include -#include -#include - -namespace android { - -class ToneGenerator { -public: - - // List of all available tones - // This enum must be kept consistant with constants in ToneGenerator JAVA class - enum tone_type { - // DTMF tones ITU-T Recommendation Q.23 - TONE_DTMF_0 = 0, // 0 key: 1336Hz, 941Hz - TONE_DTMF_1, // 1 key: 1209Hz, 697Hz - TONE_DTMF_2, // 2 key: 1336Hz, 697Hz - TONE_DTMF_3, // 3 key: 1477Hz, 697Hz - TONE_DTMF_4, // 4 key: 1209Hz, 770Hz - TONE_DTMF_5, // 5 key: 1336Hz, 770Hz - TONE_DTMF_6, // 6 key: 1477Hz, 770Hz - TONE_DTMF_7, // 7 key: 1209Hz, 852Hz - TONE_DTMF_8, // 8 key: 1336Hz, 852Hz - TONE_DTMF_9, // 9 key: 1477Hz, 852Hz - TONE_DTMF_S, // * key: 1209Hz, 941Hz - TONE_DTMF_P, // # key: 1477Hz, 941Hz - TONE_DTMF_A, // A key: 1633Hz, 697Hz - TONE_DTMF_B, // B key: 1633Hz, 770Hz - TONE_DTMF_C, // C key: 1633Hz, 852Hz - TONE_DTMF_D, // D key: 1633Hz, 941Hz - // Call supervisory tones: 3GPP TS 22.001 (CEPT) - TONE_SUP_DIAL, // Dial tone: CEPT: 425Hz, continuous - FIRST_SUP_TONE = TONE_SUP_DIAL, - TONE_SUP_BUSY, // Busy tone, CEPT: 425Hz, 500ms ON, 500ms OFF... - TONE_SUP_CONGESTION, // Congestion tone CEPT, JAPAN: 425Hz, 200ms ON, 200ms OFF... - TONE_SUP_RADIO_ACK, // Radio path acknowlegment, CEPT, ANSI: 425Hz, 200ms ON - TONE_SUP_RADIO_NOTAVAIL, // Radio path not available: 425Hz, 200ms ON, 200 OFF 3 bursts - TONE_SUP_ERROR, // Error/Special info: 950Hz+1400Hz+1800Hz, 330ms ON, 1s OFF... - TONE_SUP_CALL_WAITING, // Call Waiting CEPT,JAPAN: 425Hz, 200ms ON, 600ms OFF, 200ms ON, 3s OFF... - TONE_SUP_RINGTONE, // Ring Tone CEPT, JAPAN: 425Hz, 1s ON, 4s OFF... - LAST_SUP_TONE = TONE_SUP_RINGTONE, - // Proprietary tones: 3GPP TS 31.111 - TONE_PROP_BEEP, // General beep: 400Hz+1200Hz, 35ms ON - TONE_PROP_ACK, // Positive Acknowlgement: 1200Hz, 100ms ON, 100ms OFF 2 bursts - TONE_PROP_NACK, // Negative Acknowlgement: 300Hz+400Hz+500Hz, 400ms ON - TONE_PROP_PROMPT, // Prompt tone: 400Hz+1200Hz, 200ms ON - TONE_PROP_BEEP2, // General double beep: 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms on - // Additional call supervisory tones: specified by IS-95 only - TONE_SUP_INTERCEPT, // Intercept tone: alternating 440 Hz and 620 Hz tones, each on for 250 ms. - TONE_SUP_INTERCEPT_ABBREV, // Abbreviated intercept: intercept tone limited to 4 seconds - TONE_SUP_CONGESTION_ABBREV, // Abbreviated congestion: congestion tone limited to 4 seconds - TONE_SUP_CONFIRM, // Confirm tone: a 350 Hz tone added to a 440 Hz tone repeated 3 times in a 100 ms on, 100 ms off cycle. - TONE_SUP_PIP, // Pip tone: four bursts of 480 Hz tone (0.1 s on, 0.1 s off). - - // CDMA Tones - TONE_CDMA_DIAL_TONE_LITE, - TONE_CDMA_NETWORK_USA_RINGBACK, - TONE_CDMA_INTERCEPT, - TONE_CDMA_ABBR_INTERCEPT, - TONE_CDMA_REORDER, - TONE_CDMA_ABBR_REORDER, - TONE_CDMA_NETWORK_BUSY, - TONE_CDMA_CONFIRM, - TONE_CDMA_ANSWER, - TONE_CDMA_NETWORK_CALLWAITING, - TONE_CDMA_PIP, - - // ISDN - TONE_CDMA_CALL_SIGNAL_ISDN_NORMAL, // ISDN Alert Normal - TONE_CDMA_CALL_SIGNAL_ISDN_INTERGROUP, // ISDN Intergroup - TONE_CDMA_CALL_SIGNAL_ISDN_SP_PRI, // ISDN SP PRI - TONE_CDMA_CALL_SIGNAL_ISDN_PAT3, // ISDN Alert PAT3 - TONE_CDMA_CALL_SIGNAL_ISDN_PING_RING, // ISDN Alert PING RING - TONE_CDMA_CALL_SIGNAL_ISDN_PAT5, // ISDN Alert PAT5 - TONE_CDMA_CALL_SIGNAL_ISDN_PAT6, // ISDN Alert PAT6 - TONE_CDMA_CALL_SIGNAL_ISDN_PAT7, // ISDN Alert PAT7 - // ISDN end - - // IS54 - TONE_CDMA_HIGH_L, // IS54 High Pitch Long - TONE_CDMA_MED_L, // IS54 Med Pitch Long - TONE_CDMA_LOW_L, // IS54 Low Pitch Long - TONE_CDMA_HIGH_SS, // IS54 High Pitch Short Short - TONE_CDMA_MED_SS, // IS54 Medium Pitch Short Short - TONE_CDMA_LOW_SS, // IS54 Low Pitch Short Short - TONE_CDMA_HIGH_SSL, // IS54 High Pitch Short Short Long - TONE_CDMA_MED_SSL, // IS54 Medium Pitch Short Short Long - TONE_CDMA_LOW_SSL, // IS54 Low Pitch Short Short Long - TONE_CDMA_HIGH_SS_2, // IS54 High Pitch Short Short 2 - TONE_CDMA_MED_SS_2, // IS54 Med Pitch Short Short 2 - TONE_CDMA_LOW_SS_2, // IS54 Low Pitch Short Short 2 - TONE_CDMA_HIGH_SLS, // IS54 High Pitch Short Long Short - TONE_CDMA_MED_SLS, // IS54 Med Pitch Short Long Short - TONE_CDMA_LOW_SLS, // IS54 Low Pitch Short Long Short - TONE_CDMA_HIGH_S_X4, // IS54 High Pitch Short Short Short Short - TONE_CDMA_MED_S_X4, // IS54 Med Pitch Short Short Short Short - TONE_CDMA_LOW_S_X4, // IS54 Low Pitch Short Short Short Short - TONE_CDMA_HIGH_PBX_L, // PBX High Pitch Long - TONE_CDMA_MED_PBX_L, // PBX Med Pitch Long - TONE_CDMA_LOW_PBX_L, // PBX Low Pitch Long - TONE_CDMA_HIGH_PBX_SS, // PBX High Short Short - TONE_CDMA_MED_PBX_SS, // PBX Med Short Short - TONE_CDMA_LOW_PBX_SS, // PBX Low Short Short - TONE_CDMA_HIGH_PBX_SSL, // PBX High Short Short Long - TONE_CDMA_MED_PBX_SSL, // PBX Med Short Short Long - TONE_CDMA_LOW_PBX_SSL, // PBX Low Short Short Long - TONE_CDMA_HIGH_PBX_SLS, // PBX High SLS - TONE_CDMA_MED_PBX_SLS, // PBX Med SLS - TONE_CDMA_LOW_PBX_SLS, // PBX Low SLS - TONE_CDMA_HIGH_PBX_S_X4, // PBX High SSSS - TONE_CDMA_MED_PBX_S_X4, // PBX Med SSSS - TONE_CDMA_LOW_PBX_S_X4, // PBX LOW SSSS - //IS54 end - // proprietary - TONE_CDMA_ALERT_NETWORK_LITE, - TONE_CDMA_ALERT_AUTOREDIAL_LITE, - TONE_CDMA_ONE_MIN_BEEP, - TONE_CDMA_KEYPAD_VOLUME_KEY_LITE, - TONE_CDMA_PRESSHOLDKEY_LITE, - TONE_CDMA_ALERT_INCALL_LITE, - TONE_CDMA_EMERGENCY_RINGBACK, - TONE_CDMA_ALERT_CALL_GUARD, - TONE_CDMA_SOFT_ERROR_LITE, - TONE_CDMA_CALLDROP_LITE, - // proprietary end - TONE_CDMA_NETWORK_BUSY_ONE_SHOT, - TONE_CDMA_ABBR_ALERT, - TONE_CDMA_SIGNAL_OFF, - //CDMA end - NUM_TONES, - NUM_SUP_TONES = LAST_SUP_TONE-FIRST_SUP_TONE+1 - }; - - ToneGenerator(audio_stream_type_t streamType, float volume, bool threadCanCallJava = false); - ~ToneGenerator(); - - bool startTone(tone_type toneType, int durationMs = -1); - void stopTone(); - - bool isInited() { return (mState == TONE_IDLE)?false:true;} - - // returns the audio session this ToneGenerator belongs to or 0 if an error occured. - int getSessionId() { return (mpAudioTrack == NULL) ? 0 : mpAudioTrack->getSessionId(); } - -private: - - enum tone_state { - TONE_IDLE, // ToneGenerator is being initialized or initialization failed - TONE_INIT, // ToneGenerator has been successfully initialized and is not playing - TONE_STARTING, // ToneGenerator is starting playing - TONE_PLAYING, // ToneGenerator is playing - TONE_STOPPING, // ToneGenerator is stoping - TONE_STOPPED, // ToneGenerator is stopped: the AudioTrack will be stopped - TONE_RESTARTING // A start request was received in active state (playing or stopping) - }; - - - // Region specific tones. - // These supervisory tones are different depending on the region (USA/CANADA, JAPAN, rest of the world). - // When a tone in the range [FIRST_SUP_TONE, LAST_SUP_TONE] is requested, the region is determined - // from system property gsm.operator.iso-country and the proper tone descriptor is selected with the - // help of sToneMappingTable[] - enum regional_tone_type { - // ANSI supervisory tones - TONE_ANSI_DIAL = NUM_TONES, // Dial tone: a continuous 350 Hz + 440 Hz tone. - TONE_ANSI_BUSY, // Busy tone on: a 480 Hz + 620 Hz tone repeated in a 500 ms on, 500 ms off cycle. - TONE_ANSI_CONGESTION, // Network congestion (reorder) tone on: a 480 Hz + 620 Hz tone repeated in a 250 ms on, 250 ms off cycle. - TONE_ANSI_CALL_WAITING, // Call waiting tone on: 440 Hz, on for 300 ms, 9,7 s off followed by - // (440 Hz, on for 100 ms off for 100 ms, on for 100 ms, 9,7s off and repeated as necessary). - TONE_ANSI_RINGTONE, // Ring Tone: a 440 Hz + 480 Hz tone repeated in a 2 s on, 4 s off pattern. - // JAPAN Supervisory tones - TONE_JAPAN_DIAL, // Dial tone: 400Hz, continuous - TONE_JAPAN_BUSY, // Busy tone: 400Hz, 500ms ON, 500ms OFF... - TONE_JAPAN_RADIO_ACK, // Radio path acknowlegment: 400Hz, 1s ON, 2s OFF... - NUM_ALTERNATE_TONES - }; - - enum region { - ANSI, - JAPAN, - CEPT, - NUM_REGIONS - }; - - static const unsigned char sToneMappingTable[NUM_REGIONS-1][NUM_SUP_TONES]; - - static const unsigned int TONEGEN_MAX_WAVES = 3; // Maximun number of sine waves in a tone segment - static const unsigned int TONEGEN_MAX_SEGMENTS = 12; // Maximun number of segments in a tone descriptor - static const unsigned int TONEGEN_INF = 0xFFFFFFFF; // Represents infinite time duration - static const float TONEGEN_GAIN = 0.9; // Default gain passed to WaveGenerator(). - - // ToneDescriptor class contains all parameters needed to generate a tone: - // - The array waveFreq[]: - // 1 for static tone descriptors: contains the frequencies of all individual waves making the multi-tone. - // 2 for active tone descritors: contains the indexes of the WaveGenerator objects in mWaveGens - // The number of sine waves varies from 1 to TONEGEN_MAX_WAVES. - // The first null value indicates that no more waves are needed. - // - The array segments[] is used to generate the tone pulses. A segment is a period of time - // during which the tone is ON or OFF. Segments with even index (starting from 0) - // correspond to tone ON state and segments with odd index to OFF state. - // The data stored in segments[] is the duration of the corresponding period in ms. - // The first segment encountered with a 0 duration indicates that no more segment follows. - // - loopCnt - Number of times to repeat a sequence of seqments after playing this - // - loopIndx - The segment index to go back and play is loopcnt > 0 - // - repeatCnt indicates the number of times the sequence described by segments[] array must be repeated. - // When the tone generator encounters the first 0 duration segment, it will compare repeatCnt to mCurCount. - // If mCurCount > repeatCnt, the tone is stopped automatically. Otherwise, tone sequence will be - // restarted from segment repeatSegment. - // - repeatSegment number of the first repeated segment when repeatCnt is not null - - class ToneSegment { - public: - unsigned int duration; - unsigned short waveFreq[TONEGEN_MAX_WAVES+1]; - unsigned short loopCnt; - unsigned short loopIndx; - }; - - class ToneDescriptor { - public: - ToneSegment segments[TONEGEN_MAX_SEGMENTS+1]; - unsigned long repeatCnt; - unsigned long repeatSegment; - }; - - static const ToneDescriptor sToneDescriptors[]; - - bool mThreadCanCallJava; - unsigned int mTotalSmp; // Total number of audio samples played (gives current time) - unsigned int mNextSegSmp; // Position of next segment transition expressed in samples - // NOTE: because mTotalSmp, mNextSegSmp are stored on 32 bit, current design will operate properly - // only if tone duration is less than about 27 Hours(@44100Hz sampling rate). If this time is exceeded, - // no crash will occur but tone sequence will show a glitch. - unsigned int mMaxSmp; // Maximum number of audio samples played (maximun tone duration) - int mDurationMs; // Maximum tone duration in ms - - unsigned short mCurSegment; // Current segment index in ToneDescriptor segments[] - unsigned short mCurCount; // Current sequence repeat count - volatile unsigned short mState; // ToneGenerator state (tone_state) - unsigned short mRegion; - const ToneDescriptor *mpToneDesc; // pointer to active tone descriptor - const ToneDescriptor *mpNewToneDesc; // pointer to next active tone descriptor - - unsigned short mLoopCounter; // Current tone loopback count - - int mSamplingRate; // AudioFlinger Sampling rate - AudioTrack *mpAudioTrack; // Pointer to audio track used for playback - Mutex mLock; // Mutex to control concurent access to ToneGenerator object from audio callback and application API - Mutex mCbkCondLock; // Mutex associated to mWaitCbkCond - Condition mWaitCbkCond; // condition enabling interface to wait for audio callback completion after a change is requested - float mVolume; // Volume applied to audio track - audio_stream_type_t mStreamType; // Audio stream used for output - unsigned int mProcessSize; // Size of audio blocks generated at a time by audioCallback() (in PCM frames). - - bool initAudioTrack(); - static void audioCallback(int event, void* user, void *info); - bool prepareWave(); - unsigned int numWaves(unsigned int segmentIdx); - void clearWaveGens(); - tone_type getToneForRegion(tone_type toneType); - - // WaveGenerator generates a single sine wave - class WaveGenerator { - public: - enum gen_command { - WAVEGEN_START, // Start/restart wave from phase 0 - WAVEGEN_CONT, // Continue wave from current phase - WAVEGEN_STOP // Stop wave on zero crossing - }; - - WaveGenerator(unsigned short samplingRate, unsigned short frequency, - float volume); - ~WaveGenerator(); - - void getSamples(short *outBuffer, unsigned int count, - unsigned int command); - - private: - static const short GEN_AMP = 32000; // amplitude of generator - static const short S_Q14 = 14; // shift for Q14 - static const short S_Q15 = 15; // shift for Q15 - - short mA1_Q14; // Q14 coefficient - // delay line of full amplitude generator - short mS1, mS2; // delay line S2 oldest - short mS2_0; // saved value for reinitialisation - short mAmplitude_Q15; // Q15 amplitude - }; - - KeyedVector mWaveGens; // list of active wave generators. -}; - -} -; // namespace android - -#endif /*ANDROID_TONEGENERATOR_H_*/ diff --git a/external/android/include/16/frameworks/av/include/media/Visualizer.h b/external/android/include/16/frameworks/av/include/media/Visualizer.h deleted file mode 100644 index fdec5ee..0000000 --- a/external/android/include/16/frameworks/av/include/media/Visualizer.h +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright (C) 2010 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_MEDIA_VISUALIZER_H -#define ANDROID_MEDIA_VISUALIZER_H - -#include -#include -#include - -/** - * The Visualizer class enables application to retrieve part of the currently playing audio for - * visualization purpose. It is not an audio recording interface and only returns partial and low - * quality audio content. However, to protect privacy of certain audio data (e.g voice mail) the use - * of the visualizer requires the permission android.permission.RECORD_AUDIO. - * The audio session ID passed to the constructor indicates which audio content should be - * visualized: - * - If the session is 0, the audio output mix is visualized - * - If the session is not 0, the audio from a particular MediaPlayer or AudioTrack - * using this audio session is visualized - * Two types of representation of audio content can be captured: - * - Waveform data: consecutive 8-bit (unsigned) mono samples by using the getWaveForm() method - * - Frequency data: 8-bit magnitude FFT by using the getFft() method - * - * The length of the capture can be retrieved or specified by calling respectively - * getCaptureSize() and setCaptureSize() methods. Note that the size of the FFT - * is half of the specified capture size but both sides of the spectrum are returned yielding in a - * number of bytes equal to the capture size. The capture size must be a power of 2 in the range - * returned by getMinCaptureSize() and getMaxCaptureSize(). - * In addition to the polling capture mode, a callback mode is also available by installing a - * callback function by use of the setCaptureCallBack() method. The rate at which the callback - * is called as well as the type of data returned is specified. - * Before capturing data, the Visualizer must be enabled by calling the setEnabled() method. - * When data capture is not needed any more, the Visualizer should be disabled. - */ - - -namespace android { - -// ---------------------------------------------------------------------------- - -class Visualizer: public AudioEffect { -public: - - enum callback_flags { - CAPTURE_WAVEFORM = 0x00000001, // capture callback returns a PCM wave form - CAPTURE_FFT = 0x00000002, // apture callback returns a frequency representation - CAPTURE_CALL_JAVA = 0x00000004 // the callback thread can call java - }; - - - /* Constructor. - * See AudioEffect constructor for details on parameters. - */ - Visualizer(int32_t priority = 0, - effect_callback_t cbf = NULL, - void* user = NULL, - int sessionId = 0); - - ~Visualizer(); - - virtual status_t setEnabled(bool enabled); - - // maximum capture size in samples - static uint32_t getMaxCaptureSize() { return VISUALIZER_CAPTURE_SIZE_MAX; } - // minimum capture size in samples - static uint32_t getMinCaptureSize() { return VISUALIZER_CAPTURE_SIZE_MIN; } - // maximum capture rate in millihertz - static uint32_t getMaxCaptureRate() { return CAPTURE_RATE_MAX; } - - // callback used to return periodic PCM or FFT captures to the application. Either one or both - // types of data are returned (PCM and FFT) according to flags indicated when installing the - // callback. When a type of data is not present, the corresponding size (waveformSize or - // fftSize) is 0. - typedef void (*capture_cbk_t)(void* user, - uint32_t waveformSize, - uint8_t *waveform, - uint32_t fftSize, - uint8_t *fft, - uint32_t samplingrate); - - // install a callback to receive periodic captures. The capture rate is specified in milliHertz - // and the capture format is according to flags (see callback_flags). - status_t setCaptureCallBack(capture_cbk_t cbk, void* user, uint32_t flags, uint32_t rate); - - // set the capture size capture size must be a power of two in the range - // [VISUALIZER_CAPTURE_SIZE_MAX. VISUALIZER_CAPTURE_SIZE_MIN] - // must be called when the visualizer is not enabled - status_t setCaptureSize(uint32_t size); - uint32_t getCaptureSize() { return mCaptureSize; } - - // returns the capture rate indicated when installing the callback - uint32_t getCaptureRate() { return mCaptureRate; } - - // returns the sampling rate of the audio being captured - uint32_t getSamplingRate() { return mSampleRate; } - - // set the way volume affects the captured data - // mode must one of VISUALIZER_SCALING_MODE_NORMALIZED, - // VISUALIZER_SCALING_MODE_AS_PLAYED - status_t setScalingMode(uint32_t mode); - uint32_t getScalingMode() { return mScalingMode; } - - // return a capture in PCM 8 bit unsigned format. The size of the capture is equal to - // getCaptureSize() - status_t getWaveForm(uint8_t *waveform); - - // return a capture in FFT 8 bit signed format. The size of the capture is equal to - // getCaptureSize() but the length of the FFT is half of the size (both parts of the spectrum - // are returned - status_t getFft(uint8_t *fft); - -protected: - // from IEffectClient - virtual void controlStatusChanged(bool controlGranted); - -private: - - static const uint32_t CAPTURE_RATE_MAX = 20000; - static const uint32_t CAPTURE_RATE_DEF = 10000; - static const uint32_t CAPTURE_SIZE_DEF = VISUALIZER_CAPTURE_SIZE_MAX; - - /* internal class to handle the callback */ - class CaptureThread : public Thread - { - public: - CaptureThread(Visualizer& receiver, uint32_t captureRate, bool bCanCallJava = false); - - private: - friend class Visualizer; - virtual bool threadLoop(); - virtual status_t readyToRun(); - virtual void onFirstRef(); - Visualizer& mReceiver; - Mutex mLock; - uint32_t mSleepTimeUs; - }; - - status_t doFft(uint8_t *fft, uint8_t *waveform); - void periodicCapture(); - uint32_t initCaptureSize(); - - Mutex mCaptureLock; - uint32_t mCaptureRate; - uint32_t mCaptureSize; - uint32_t mSampleRate; - uint32_t mScalingMode; - capture_cbk_t mCaptureCallBack; - void *mCaptureCbkUser; - sp mCaptureThread; - uint32_t mCaptureFlags; -}; - - -}; // namespace android - -#endif // ANDROID_MEDIA_VISUALIZER_H diff --git a/external/android/include/16/frameworks/av/include/media/mediametadataretriever.h b/external/android/include/16/frameworks/av/include/media/mediametadataretriever.h deleted file mode 100644 index 534afce..0000000 --- a/external/android/include/16/frameworks/av/include/media/mediametadataretriever.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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. - */ - - -#ifndef MEDIAMETADATARETRIEVER_H -#define MEDIAMETADATARETRIEVER_H - -#include // for status_t -#include -#include -#include - -namespace android { - -class IMediaPlayerService; -class IMediaMetadataRetriever; - -// Keep these in synch with the constants defined in MediaMetadataRetriever.java -// class. -enum { - METADATA_KEY_CD_TRACK_NUMBER = 0, - METADATA_KEY_ALBUM = 1, - METADATA_KEY_ARTIST = 2, - METADATA_KEY_AUTHOR = 3, - METADATA_KEY_COMPOSER = 4, - METADATA_KEY_DATE = 5, - METADATA_KEY_GENRE = 6, - METADATA_KEY_TITLE = 7, - METADATA_KEY_YEAR = 8, - METADATA_KEY_DURATION = 9, - METADATA_KEY_NUM_TRACKS = 10, - METADATA_KEY_WRITER = 11, - METADATA_KEY_MIMETYPE = 12, - METADATA_KEY_ALBUMARTIST = 13, - METADATA_KEY_DISC_NUMBER = 14, - METADATA_KEY_COMPILATION = 15, - METADATA_KEY_HAS_AUDIO = 16, - METADATA_KEY_HAS_VIDEO = 17, - METADATA_KEY_VIDEO_WIDTH = 18, - METADATA_KEY_VIDEO_HEIGHT = 19, - METADATA_KEY_BITRATE = 20, - METADATA_KEY_TIMED_TEXT_LANGUAGES = 21, - METADATA_KEY_IS_DRM = 22, - METADATA_KEY_LOCATION = 23, - - // Add more here... -}; - -class MediaMetadataRetriever: public RefBase -{ -public: - MediaMetadataRetriever(); - ~MediaMetadataRetriever(); - void disconnect(); - - status_t setDataSource( - const char *dataSourceUrl, - const KeyedVector *headers = NULL); - - status_t setDataSource(int fd, int64_t offset, int64_t length); - sp getFrameAtTime(int64_t timeUs, int option); - sp extractAlbumArt(); - const char* extractMetadata(int keyCode); - -private: - static const sp& getService(); - - class DeathNotifier: public IBinder::DeathRecipient - { - public: - DeathNotifier() {} - virtual ~DeathNotifier(); - virtual void binderDied(const wp& who); - }; - - static sp sDeathNotifier; - static Mutex sServiceLock; - static sp sService; - - Mutex mLock; - sp mRetriever; - -}; - -}; // namespace android - -#endif // MEDIAMETADATARETRIEVER_H diff --git a/external/android/include/16/frameworks/av/include/media/mediaplayer.h b/external/android/include/16/frameworks/av/include/media/mediaplayer.h deleted file mode 100644 index 1fad383..0000000 --- a/external/android/include/16/frameworks/av/include/media/mediaplayer.h +++ /dev/null @@ -1,269 +0,0 @@ -/* - * 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_MEDIAPLAYER_H -#define ANDROID_MEDIAPLAYER_H - -#include - -#include -#include -#include -#include -#include - -#include -#include - -class ANativeWindow; - -namespace android { - -class Surface; -class ISurfaceTexture; - -enum media_event_type { - MEDIA_NOP = 0, // interface test message - MEDIA_PREPARED = 1, - MEDIA_PLAYBACK_COMPLETE = 2, - MEDIA_BUFFERING_UPDATE = 3, - MEDIA_SEEK_COMPLETE = 4, - MEDIA_SET_VIDEO_SIZE = 5, - MEDIA_TIMED_TEXT = 99, - MEDIA_ERROR = 100, - MEDIA_INFO = 200, -}; - -// Generic error codes for the media player framework. Errors are fatal, the -// playback must abort. -// -// Errors are communicated back to the client using the -// MediaPlayerListener::notify method defined below. -// In this situation, 'notify' is invoked with the following: -// 'msg' is set to MEDIA_ERROR. -// 'ext1' should be a value from the enum media_error_type. -// 'ext2' contains an implementation dependant error code to provide -// more details. Should default to 0 when not used. -// -// The codes are distributed as follow: -// 0xx: Reserved -// 1xx: Android Player errors. Something went wrong inside the MediaPlayer. -// 2xx: Media errors (e.g Codec not supported). There is a problem with the -// media itself. -// 3xx: Runtime errors. Some extraordinary condition arose making the playback -// impossible. -// -enum media_error_type { - // 0xx - MEDIA_ERROR_UNKNOWN = 1, - // 1xx - MEDIA_ERROR_SERVER_DIED = 100, - // 2xx - MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK = 200, - // 3xx -}; - - -// Info and warning codes for the media player framework. These are non fatal, -// the playback is going on but there might be some user visible issues. -// -// Info and warning messages are communicated back to the client using the -// MediaPlayerListener::notify method defined below. In this situation, -// 'notify' is invoked with the following: -// 'msg' is set to MEDIA_INFO. -// 'ext1' should be a value from the enum media_info_type. -// 'ext2' contains an implementation dependant info code to provide -// more details. Should default to 0 when not used. -// -// The codes are distributed as follow: -// 0xx: Reserved -// 7xx: Android Player info/warning (e.g player lagging behind.) -// 8xx: Media info/warning (e.g media badly interleaved.) -// -enum media_info_type { - // 0xx - MEDIA_INFO_UNKNOWN = 1, - // The player was started because it was used as the next player for another - // player, which just completed playback - MEDIA_INFO_STARTED_AS_NEXT = 2, - // 7xx - // The video is too complex for the decoder: it can't decode frames fast - // enough. Possibly only the audio plays fine at this stage. - MEDIA_INFO_VIDEO_TRACK_LAGGING = 700, - // MediaPlayer is temporarily pausing playback internally in order to - // buffer more data. - MEDIA_INFO_BUFFERING_START = 701, - // MediaPlayer is resuming playback after filling buffers. - MEDIA_INFO_BUFFERING_END = 702, - // Bandwidth in recent past - MEDIA_INFO_NETWORK_BANDWIDTH = 703, - - // 8xx - // Bad interleaving means that a media has been improperly interleaved or not - // interleaved at all, e.g has all the video samples first then all the audio - // ones. Video is playing but a lot of disk seek may be happening. - MEDIA_INFO_BAD_INTERLEAVING = 800, - // The media is not seekable (e.g live stream). - MEDIA_INFO_NOT_SEEKABLE = 801, - // New media metadata is available. - MEDIA_INFO_METADATA_UPDATE = 802, - - //9xx - MEDIA_INFO_TIMED_TEXT_ERROR = 900, -}; - - - -enum media_player_states { - MEDIA_PLAYER_STATE_ERROR = 0, - MEDIA_PLAYER_IDLE = 1 << 0, - MEDIA_PLAYER_INITIALIZED = 1 << 1, - MEDIA_PLAYER_PREPARING = 1 << 2, - MEDIA_PLAYER_PREPARED = 1 << 3, - MEDIA_PLAYER_STARTED = 1 << 4, - MEDIA_PLAYER_PAUSED = 1 << 5, - MEDIA_PLAYER_STOPPED = 1 << 6, - MEDIA_PLAYER_PLAYBACK_COMPLETE = 1 << 7 -}; - -// Keep KEY_PARAMETER_* in sync with MediaPlayer.java. -// The same enum space is used for both set and get, in case there are future keys that -// can be both set and get. But as of now, all parameters are either set only or get only. -enum media_parameter_keys { - // Streaming/buffering parameters - KEY_PARAMETER_CACHE_STAT_COLLECT_FREQ_MS = 1100, // set only - - // Return a Parcel containing a single int, which is the channel count of the - // audio track, or zero for error (e.g. no audio track) or unknown. - KEY_PARAMETER_AUDIO_CHANNEL_COUNT = 1200, // get only - - // Playback rate expressed in permille (1000 is normal speed), saved as int32_t, with negative - // values used for rewinding or reverse playback. - KEY_PARAMETER_PLAYBACK_RATE_PERMILLE = 1300, // set only -}; - -// Keep INVOKE_ID_* in sync with MediaPlayer.java. -enum media_player_invoke_ids { - INVOKE_ID_GET_TRACK_INFO = 1, - INVOKE_ID_ADD_EXTERNAL_SOURCE = 2, - INVOKE_ID_ADD_EXTERNAL_SOURCE_FD = 3, - INVOKE_ID_SELECT_TRACK = 4, - INVOKE_ID_UNSELECT_TRACK = 5, - INVOKE_ID_SET_VIDEO_SCALING_MODE = 6, -}; - -// Keep MEDIA_TRACK_TYPE_* in sync with MediaPlayer.java. -enum media_track_type { - MEDIA_TRACK_TYPE_UNKNOWN = 0, - MEDIA_TRACK_TYPE_VIDEO = 1, - MEDIA_TRACK_TYPE_AUDIO = 2, - MEDIA_TRACK_TYPE_TIMEDTEXT = 3, -}; - -// ---------------------------------------------------------------------------- -// ref-counted object for callbacks -class MediaPlayerListener: virtual public RefBase -{ -public: - virtual void notify(int msg, int ext1, int ext2, const Parcel *obj) = 0; -}; - -class MediaPlayer : public BnMediaPlayerClient, - public virtual IMediaDeathNotifier -{ -public: - MediaPlayer(); - ~MediaPlayer(); - void died(); - void disconnect(); - - status_t setDataSource( - const char *url, - const KeyedVector *headers); - - status_t setDataSource(int fd, int64_t offset, int64_t length); - status_t setDataSource(const sp &source); - status_t setVideoSurfaceTexture( - const sp& surfaceTexture); - status_t setListener(const sp& listener); - status_t prepare(); - status_t prepareAsync(); - status_t start(); - status_t stop(); - status_t pause(); - bool isPlaying(); - status_t getVideoWidth(int *w); - status_t getVideoHeight(int *h); - status_t seekTo(int msec); - status_t getCurrentPosition(int *msec); - status_t getDuration(int *msec); - status_t reset(); - status_t setAudioStreamType(audio_stream_type_t type); - status_t setLooping(int loop); - bool isLooping(); - status_t setVolume(float leftVolume, float rightVolume); - void notify(int msg, int ext1, int ext2, const Parcel *obj = NULL); - static sp decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, audio_format_t* pFormat); - static sp decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, audio_format_t* pFormat); - status_t invoke(const Parcel& request, Parcel *reply); - status_t setMetadataFilter(const Parcel& filter); - status_t getMetadata(bool update_only, bool apply_filter, Parcel *metadata); - status_t setAudioSessionId(int sessionId); - int getAudioSessionId(); - status_t setAuxEffectSendLevel(float level); - status_t attachAuxEffect(int effectId); - status_t setParameter(int key, const Parcel& request); - status_t getParameter(int key, Parcel* reply); - status_t setRetransmitEndpoint(const char* addrString, uint16_t port); - status_t setNextMediaPlayer(const sp& player); - -private: - void clear_l(); - status_t seekTo_l(int msec); - status_t prepareAsync_l(); - status_t getDuration_l(int *msec); - status_t attachNewPlayer(const sp& player); - status_t reset_l(); - status_t doSetRetransmitEndpoint(const sp& player); - - sp mPlayer; - thread_id_t mLockThreadId; - Mutex mLock; - Mutex mNotifyLock; - Condition mSignal; - sp mListener; - void* mCookie; - media_player_states mCurrentState; - int mDuration; - int mCurrentPosition; - int mSeekPosition; - bool mPrepareSync; - status_t mPrepareStatus; - audio_stream_type_t mStreamType; - bool mLoop; - float mLeftVolume; - float mRightVolume; - int mVideoWidth; - int mVideoHeight; - int mAudioSessionId; - float mSendLevel; - struct sockaddr_in mRetransmitEndpoint; - bool mRetransmitEndpointValid; -}; - -}; // namespace android - -#endif // ANDROID_MEDIAPLAYER_H diff --git a/external/android/include/16/frameworks/av/include/media/mediarecorder.h b/external/android/include/16/frameworks/av/include/media/mediarecorder.h deleted file mode 100644 index 6d304e0..0000000 --- a/external/android/include/16/frameworks/av/include/media/mediarecorder.h +++ /dev/null @@ -1,257 +0,0 @@ -/* - ** 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. - */ - -#ifndef ANDROID_MEDIARECORDER_H -#define ANDROID_MEDIARECORDER_H - -#include -#include -#include -#include -#include -#include - -namespace android { - -class Surface; -class IMediaRecorder; -class ICamera; -class ICameraRecordingProxy; -class ISurfaceTexture; -class SurfaceTextureClient; - -typedef void (*media_completion_f)(status_t status, void *cookie); - -enum video_source { - VIDEO_SOURCE_DEFAULT = 0, - VIDEO_SOURCE_CAMERA = 1, - VIDEO_SOURCE_GRALLOC_BUFFER = 2, - - VIDEO_SOURCE_LIST_END // must be last - used to validate audio source type -}; - -//Please update media/java/android/media/MediaRecorder.java if the following is updated. -enum output_format { - OUTPUT_FORMAT_DEFAULT = 0, - OUTPUT_FORMAT_THREE_GPP = 1, - OUTPUT_FORMAT_MPEG_4 = 2, - - - OUTPUT_FORMAT_AUDIO_ONLY_START = 3, // Used in validating the output format. Should be the - // at the start of the audio only output formats. - - /* These are audio only file formats */ - OUTPUT_FORMAT_RAW_AMR = 3, //to be backward compatible - OUTPUT_FORMAT_AMR_NB = 3, - OUTPUT_FORMAT_AMR_WB = 4, - OUTPUT_FORMAT_AAC_ADIF = 5, - OUTPUT_FORMAT_AAC_ADTS = 6, - - /* Stream over a socket, limited to a single stream */ - OUTPUT_FORMAT_RTP_AVP = 7, - - /* H.264/AAC data encapsulated in MPEG2/TS */ - OUTPUT_FORMAT_MPEG2TS = 8, - - OUTPUT_FORMAT_LIST_END // must be last - used to validate format type -}; - -enum audio_encoder { - AUDIO_ENCODER_DEFAULT = 0, - AUDIO_ENCODER_AMR_NB = 1, - AUDIO_ENCODER_AMR_WB = 2, - AUDIO_ENCODER_AAC = 3, - AUDIO_ENCODER_HE_AAC = 4, - AUDIO_ENCODER_AAC_ELD = 5, - - AUDIO_ENCODER_LIST_END // must be the last - used to validate the audio encoder type -}; - -enum video_encoder { - VIDEO_ENCODER_DEFAULT = 0, - VIDEO_ENCODER_H263 = 1, - VIDEO_ENCODER_H264 = 2, - VIDEO_ENCODER_MPEG_4_SP = 3, - - VIDEO_ENCODER_LIST_END // must be the last - used to validate the video encoder type -}; - -/* - * The state machine of the media_recorder. - */ -enum media_recorder_states { - // Error state. - MEDIA_RECORDER_ERROR = 0, - - // Recorder was just created. - MEDIA_RECORDER_IDLE = 1 << 0, - - // Recorder has been initialized. - MEDIA_RECORDER_INITIALIZED = 1 << 1, - - // Configuration of the recorder has been completed. - MEDIA_RECORDER_DATASOURCE_CONFIGURED = 1 << 2, - - // Recorder is ready to start. - MEDIA_RECORDER_PREPARED = 1 << 3, - - // Recording is in progress. - MEDIA_RECORDER_RECORDING = 1 << 4, -}; - -// The "msg" code passed to the listener in notify. -enum media_recorder_event_type { - MEDIA_RECORDER_EVENT_LIST_START = 1, - MEDIA_RECORDER_EVENT_ERROR = 1, - MEDIA_RECORDER_EVENT_INFO = 2, - MEDIA_RECORDER_EVENT_LIST_END = 99, - - // Track related event types - MEDIA_RECORDER_TRACK_EVENT_LIST_START = 100, - MEDIA_RECORDER_TRACK_EVENT_ERROR = 100, - MEDIA_RECORDER_TRACK_EVENT_INFO = 101, - MEDIA_RECORDER_TRACK_EVENT_LIST_END = 1000, -}; - -/* - * The (part of) "what" code passed to the listener in notify. - * When the error or info type is track specific, the what has - * the following layout: - * the left-most 16-bit is meant for error or info type. - * the right-most 4-bit is meant for track id. - * the rest is reserved. - * - * | track id | reserved | error or info type | - * 31 28 16 0 - * - */ -enum media_recorder_error_type { - MEDIA_RECORDER_ERROR_UNKNOWN = 1, - - // Track related error type - MEDIA_RECORDER_TRACK_ERROR_LIST_START = 100, - MEDIA_RECORDER_TRACK_ERROR_GENERAL = 100, - MEDIA_RECORDER_ERROR_VIDEO_NO_SYNC_FRAME = 200, - MEDIA_RECORDER_TRACK_ERROR_LIST_END = 1000, -}; - -// The codes are distributed as follow: -// 0xx: Reserved -// 8xx: General info/warning -// -enum media_recorder_info_type { - MEDIA_RECORDER_INFO_UNKNOWN = 1, - - MEDIA_RECORDER_INFO_MAX_DURATION_REACHED = 800, - MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED = 801, - - // All track related informtional events start here - MEDIA_RECORDER_TRACK_INFO_LIST_START = 1000, - MEDIA_RECORDER_TRACK_INFO_COMPLETION_STATUS = 1000, - MEDIA_RECORDER_TRACK_INFO_PROGRESS_IN_TIME = 1001, - MEDIA_RECORDER_TRACK_INFO_TYPE = 1002, - MEDIA_RECORDER_TRACK_INFO_DURATION_MS = 1003, - - // The time to measure the max chunk duration - MEDIA_RECORDER_TRACK_INFO_MAX_CHUNK_DUR_MS = 1004, - - MEDIA_RECORDER_TRACK_INFO_ENCODED_FRAMES = 1005, - - // The time to measure how well the audio and video - // track data is interleaved. - MEDIA_RECORDER_TRACK_INTER_CHUNK_TIME_MS = 1006, - - // The time to measure system response. Note that - // the delay does not include the intentional delay - // we use to eliminate the recording sound. - MEDIA_RECORDER_TRACK_INFO_INITIAL_DELAY_MS = 1007, - - // The time used to compensate for initial A/V sync. - MEDIA_RECORDER_TRACK_INFO_START_OFFSET_MS = 1008, - - // Total number of bytes of the media data. - MEDIA_RECORDER_TRACK_INFO_DATA_KBYTES = 1009, - - MEDIA_RECORDER_TRACK_INFO_LIST_END = 2000, -}; - -// ---------------------------------------------------------------------------- -// ref-counted object for callbacks -class MediaRecorderListener: virtual public RefBase -{ -public: - virtual void notify(int msg, int ext1, int ext2) = 0; -}; - -class MediaRecorder : public BnMediaRecorderClient, - public virtual IMediaDeathNotifier -{ -public: - MediaRecorder(); - ~MediaRecorder(); - - void died(); - status_t initCheck(); - status_t setCamera(const sp& camera, const sp& proxy); - status_t setPreviewSurface(const sp& surface); - status_t setVideoSource(int vs); - status_t setAudioSource(int as); - status_t setOutputFormat(int of); - status_t setVideoEncoder(int ve); - status_t setAudioEncoder(int ae); - status_t setOutputFile(const char* path); - status_t setOutputFile(int fd, int64_t offset, int64_t length); - status_t setVideoSize(int width, int height); - status_t setVideoFrameRate(int frames_per_second); - status_t setParameters(const String8& params); - status_t setListener(const sp& listener); - status_t prepare(); - status_t getMaxAmplitude(int* max); - status_t start(); - status_t stop(); - status_t reset(); - status_t init(); - status_t close(); - status_t release(); - void notify(int msg, int ext1, int ext2); - sp querySurfaceMediaSourceFromMediaServer(); - -private: - void doCleanUp(); - status_t doReset(); - - sp mMediaRecorder; - sp mListener; - - // Reference toISurfaceTexture - // for encoding GL Frames. That is useful only when the - // video source is set to VIDEO_SOURCE_GRALLOC_BUFFER - sp mSurfaceMediaSource; - - media_recorder_states mCurrentState; - bool mIsAudioSourceSet; - bool mIsVideoSourceSet; - bool mIsAudioEncoderSet; - bool mIsVideoEncoderSet; - bool mIsOutputFileSet; - Mutex mLock; - Mutex mNotifyLock; -}; - -}; // namespace android - -#endif // ANDROID_MEDIARECORDER_H diff --git a/external/android/include/16/frameworks/av/include/media/mediascanner.h b/external/android/include/16/frameworks/av/include/media/mediascanner.h deleted file mode 100644 index a73403b..0000000 --- a/external/android/include/16/frameworks/av/include/media/mediascanner.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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. - */ - -#ifndef MEDIASCANNER_H -#define MEDIASCANNER_H - -#include -#include -#include -#include -#include - -struct dirent; - -namespace android { - -class MediaScannerClient; -class StringArray; - -enum MediaScanResult { - // This file or directory was scanned successfully. - MEDIA_SCAN_RESULT_OK, - // This file or directory was skipped because it was not found, could - // not be opened, was of an unsupported type, or was malfored in some way. - MEDIA_SCAN_RESULT_SKIPPED, - // The scan should be aborted due to a fatal error such as out of memory - // or an exception. - MEDIA_SCAN_RESULT_ERROR, -}; - -struct MediaScanner { - MediaScanner(); - virtual ~MediaScanner(); - - virtual MediaScanResult processFile( - const char *path, const char *mimeType, MediaScannerClient &client) = 0; - - virtual MediaScanResult processDirectory( - const char *path, MediaScannerClient &client); - - void setLocale(const char *locale); - - // extracts album art as a block of data - virtual char *extractAlbumArt(int fd) = 0; - -protected: - const char *locale() const; - -private: - // current locale (like "ja_JP"), created/destroyed with strdup()/free() - char *mLocale; - char *mSkipList; - int *mSkipIndex; - - MediaScanResult doProcessDirectory( - char *path, int pathRemaining, MediaScannerClient &client, bool noMedia); - MediaScanResult doProcessDirectoryEntry( - char *path, int pathRemaining, MediaScannerClient &client, bool noMedia, - struct dirent* entry, char* fileSpot); - void loadSkipList(); - bool shouldSkipDirectory(char *path); - - - MediaScanner(const MediaScanner &); - MediaScanner &operator=(const MediaScanner &); -}; - -class MediaScannerClient -{ -public: - MediaScannerClient(); - virtual ~MediaScannerClient(); - void setLocale(const char* locale); - void beginFile(); - status_t addStringTag(const char* name, const char* value); - void endFile(); - - virtual status_t scanFile(const char* path, long long lastModified, - long long fileSize, bool isDirectory, bool noMedia) = 0; - virtual status_t handleStringTag(const char* name, const char* value) = 0; - virtual status_t setMimeType(const char* mimeType) = 0; - -protected: - void convertValues(uint32_t encoding); - -protected: - // cached name and value strings, for native encoding support. - StringArray* mNames; - StringArray* mValues; - - // default encoding based on MediaScanner::mLocale string - uint32_t mLocaleEncoding; -}; - -}; // namespace android - -#endif // MEDIASCANNER_H diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/AACWriter.h b/external/android/include/16/frameworks/av/include/media/stagefright/AACWriter.h deleted file mode 100644 index df1b053..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/AACWriter.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2011 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 AAC_WRITER_H_ -#define AAC_WRITER_H_ - -#include -#include - -namespace android { - -struct MediaSource; -struct MetaData; - -struct AACWriter : public MediaWriter { - AACWriter(const char *filename); - AACWriter(int fd); - - status_t initCheck() const; - - virtual status_t addSource(const sp &source); - virtual bool reachedEOS(); - virtual status_t start(MetaData *params = NULL); - virtual status_t stop() { return reset(); } - virtual status_t pause(); - -protected: - virtual ~AACWriter(); - -private: - enum { - kAdtsHeaderLength = 7, // # of bytes for the adts header - kSamplesPerFrame = 1024, // # of samples in a frame - }; - - int mFd; - status_t mInitCheck; - sp mSource; - bool mStarted; - volatile bool mPaused; - volatile bool mResumed; - volatile bool mDone; - volatile bool mReachedEOS; - pthread_t mThread; - int64_t mEstimatedSizeBytes; - int64_t mEstimatedDurationUs; - int32_t mChannelCount; - int32_t mSampleRate; - int32_t mAACProfile; - int32_t mFrameDurationUs; - - static void *ThreadWrapper(void *); - status_t threadFunc(); - bool exceedsFileSizeLimit(); - bool exceedsFileDurationLimit(); - status_t writeAdtsHeader(uint32_t frameLength); - status_t reset(); - - DISALLOW_EVIL_CONSTRUCTORS(AACWriter); -}; - -} // namespace android - -#endif // AAC_WRITER_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/ACodec.h b/external/android/include/16/frameworks/av/include/media/stagefright/ACodec.h deleted file mode 100644 index 2371619..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/ACodec.h +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Copyright (C) 2010 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 A_CODEC_H_ - -#define A_CODEC_H_ - -#include -#include -#include -#include -#include -#include - -namespace android { - -struct ABuffer; -struct MemoryDealer; - -struct ACodec : public AHierarchicalStateMachine { - enum { - kWhatFillThisBuffer = 'fill', - kWhatDrainThisBuffer = 'drai', - kWhatEOS = 'eos ', - kWhatShutdownCompleted = 'scom', - kWhatFlushCompleted = 'fcom', - kWhatOutputFormatChanged = 'outC', - kWhatError = 'erro', - kWhatComponentAllocated = 'cAll', - kWhatComponentConfigured = 'cCon', - kWhatBuffersAllocated = 'allc', - }; - - ACodec(); - - void setNotificationMessage(const sp &msg); - void initiateSetup(const sp &msg); - void signalFlush(); - void signalResume(); - void initiateShutdown(bool keepComponentAllocated = false); - - void initiateAllocateComponent(const sp &msg); - void initiateConfigureComponent(const sp &msg); - void initiateStart(); - - struct PortDescription : public RefBase { - size_t countBuffers(); - IOMX::buffer_id bufferIDAt(size_t index) const; - sp bufferAt(size_t index) const; - - private: - friend struct ACodec; - - Vector mBufferIDs; - Vector > mBuffers; - - PortDescription(); - void addBuffer(IOMX::buffer_id id, const sp &buffer); - - DISALLOW_EVIL_CONSTRUCTORS(PortDescription); - }; - -protected: - virtual ~ACodec(); - -private: - struct BaseState; - struct UninitializedState; - struct LoadedState; - struct LoadedToIdleState; - struct IdleToExecutingState; - struct ExecutingState; - struct OutputPortSettingsChangedState; - struct ExecutingToIdleState; - struct IdleToLoadedState; - struct FlushingState; - - enum { - kWhatSetup = 'setu', - kWhatOMXMessage = 'omx ', - kWhatInputBufferFilled = 'inpF', - kWhatOutputBufferDrained = 'outD', - kWhatShutdown = 'shut', - kWhatFlush = 'flus', - kWhatResume = 'resm', - kWhatDrainDeferredMessages = 'drai', - kWhatAllocateComponent = 'allo', - kWhatConfigureComponent = 'conf', - kWhatStart = 'star', - }; - - enum { - kPortIndexInput = 0, - kPortIndexOutput = 1 - }; - - enum { - kFlagIsSecure = 1, - }; - - struct BufferInfo { - enum Status { - OWNED_BY_US, - OWNED_BY_COMPONENT, - OWNED_BY_UPSTREAM, - OWNED_BY_DOWNSTREAM, - OWNED_BY_NATIVE_WINDOW, - }; - - IOMX::buffer_id mBufferID; - Status mStatus; - - sp mData; - sp mGraphicBuffer; - }; - - sp mNotify; - - sp mUninitializedState; - sp mLoadedState; - sp mLoadedToIdleState; - sp mIdleToExecutingState; - sp mExecutingState; - sp mOutputPortSettingsChangedState; - sp mExecutingToIdleState; - sp mIdleToLoadedState; - sp mFlushingState; - sp mSkipCutBuffer; - - AString mComponentName; - uint32_t mFlags; - uint32_t mQuirks; - sp mOMX; - IOMX::node_id mNode; - sp mDealer[2]; - - sp mNativeWindow; - - Vector mBuffers[2]; - bool mPortEOS[2]; - status_t mInputEOSResult; - - List > mDeferredQueue; - - bool mSentFormat; - bool mIsEncoder; - - bool mShutdownInProgress; - - // If "mKeepComponentAllocated" we only transition back to Loaded state - // and do not release the component instance. - bool mKeepComponentAllocated; - - int32_t mEncoderDelay; - int32_t mEncoderPadding; - - bool mChannelMaskPresent; - int32_t mChannelMask; - - status_t allocateBuffersOnPort(OMX_U32 portIndex); - status_t freeBuffersOnPort(OMX_U32 portIndex); - status_t freeBuffer(OMX_U32 portIndex, size_t i); - - status_t allocateOutputBuffersFromNativeWindow(); - status_t cancelBufferToNativeWindow(BufferInfo *info); - status_t freeOutputBuffersNotOwnedByComponent(); - BufferInfo *dequeueBufferFromNativeWindow(); - - BufferInfo *findBufferByID( - uint32_t portIndex, IOMX::buffer_id bufferID, - ssize_t *index = NULL); - - status_t setComponentRole(bool isEncoder, const char *mime); - status_t configureCodec(const char *mime, const sp &msg); - - status_t setVideoPortFormatType( - OMX_U32 portIndex, - OMX_VIDEO_CODINGTYPE compressionFormat, - OMX_COLOR_FORMATTYPE colorFormat); - - status_t setSupportedOutputFormat(); - - status_t setupVideoDecoder( - const char *mime, int32_t width, int32_t height); - - status_t setupVideoEncoder( - const char *mime, const sp &msg); - - status_t setVideoFormatOnPort( - OMX_U32 portIndex, - int32_t width, int32_t height, - OMX_VIDEO_CODINGTYPE compressionFormat); - - status_t setupAACCodec( - bool encoder, - int32_t numChannels, int32_t sampleRate, int32_t bitRate, - int32_t aacProfile, bool isADTS); - - status_t selectAudioPortFormat( - OMX_U32 portIndex, OMX_AUDIO_CODINGTYPE desiredFormat); - - status_t setupAMRCodec(bool encoder, bool isWAMR, int32_t bitRate); - status_t setupG711Codec(bool encoder, int32_t numChannels); - - status_t setupFlacCodec( - bool encoder, int32_t numChannels, int32_t sampleRate, int32_t compressionLevel); - - status_t setupRawAudioFormat( - OMX_U32 portIndex, int32_t sampleRate, int32_t numChannels); - - status_t setMinBufferSize(OMX_U32 portIndex, size_t size); - - status_t setupMPEG4EncoderParameters(const sp &msg); - status_t setupH263EncoderParameters(const sp &msg); - status_t setupAVCEncoderParameters(const sp &msg); - - status_t verifySupportForProfileAndLevel(int32_t profile, int32_t level); - status_t configureBitrate(int32_t bitrate); - status_t setupErrorCorrectionParameters(); - - status_t initNativeWindow(); - - status_t pushBlankBuffersToNativeWindow(); - - // Returns true iff all buffers on the given port have status OWNED_BY_US. - bool allYourBuffersAreBelongToUs(OMX_U32 portIndex); - - bool allYourBuffersAreBelongToUs(); - - size_t countBuffersOwnedByComponent(OMX_U32 portIndex) const; - - void deferMessage(const sp &msg); - void processDeferredMessages(); - - void sendFormatChange(); - - void signalError( - OMX_ERRORTYPE error = OMX_ErrorUndefined, - status_t internalError = UNKNOWN_ERROR); - - DISALLOW_EVIL_CONSTRUCTORS(ACodec); -}; - -} // namespace android - -#endif // A_CODEC_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/AMRWriter.h b/external/android/include/16/frameworks/av/include/media/stagefright/AMRWriter.h deleted file mode 100644 index 392f968..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/AMRWriter.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2010 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 AMR_WRITER_H_ - -#define AMR_WRITER_H_ - -#include - -#include -#include - -namespace android { - -struct MediaSource; -struct MetaData; - -struct AMRWriter : public MediaWriter { - AMRWriter(const char *filename); - AMRWriter(int fd); - - status_t initCheck() const; - - virtual status_t addSource(const sp &source); - virtual bool reachedEOS(); - virtual status_t start(MetaData *params = NULL); - virtual status_t stop() { return reset(); } - virtual status_t pause(); - -protected: - virtual ~AMRWriter(); - -private: - int mFd; - status_t mInitCheck; - sp mSource; - bool mStarted; - volatile bool mPaused; - volatile bool mResumed; - volatile bool mDone; - volatile bool mReachedEOS; - pthread_t mThread; - int64_t mEstimatedSizeBytes; - int64_t mEstimatedDurationUs; - - static void *ThreadWrapper(void *); - status_t threadFunc(); - bool exceedsFileSizeLimit(); - bool exceedsFileDurationLimit(); - status_t reset(); - - AMRWriter(const AMRWriter &); - AMRWriter &operator=(const AMRWriter &); -}; - -} // namespace android - -#endif // AMR_WRITER_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/AudioPlayer.h b/external/android/include/16/frameworks/av/include/media/stagefright/AudioPlayer.h deleted file mode 100644 index 1dc408f..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/AudioPlayer.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * 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 AUDIO_PLAYER_H_ - -#define AUDIO_PLAYER_H_ - -#include -#include -#include -#include - -namespace android { - -class MediaSource; -class AudioTrack; -class AwesomePlayer; - -class AudioPlayer : public TimeSource { -public: - enum { - REACHED_EOS, - SEEK_COMPLETE - }; - - AudioPlayer(const sp &audioSink, - bool allowDeepBuffering = false, - AwesomePlayer *audioObserver = NULL); - - virtual ~AudioPlayer(); - - // Caller retains ownership of "source". - void setSource(const sp &source); - - // Return time in us. - virtual int64_t getRealTimeUs(); - - status_t start(bool sourceAlreadyStarted = false); - - void pause(bool playPendingSamples = false); - void resume(); - - // Returns the timestamp of the last buffer played (in us). - int64_t getMediaTimeUs(); - - // Returns true iff a mapping is established, i.e. the AudioPlayer - // has played at least one frame of audio. - bool getMediaTimeMapping(int64_t *realtime_us, int64_t *mediatime_us); - - status_t seekTo(int64_t time_us); - - bool isSeeking(); - bool reachedEOS(status_t *finalStatus); - - status_t setPlaybackRatePermille(int32_t ratePermille); - -private: - friend class VideoEditorAudioPlayer; - sp mSource; - AudioTrack *mAudioTrack; - - MediaBuffer *mInputBuffer; - - int mSampleRate; - int64_t mLatencyUs; - size_t mFrameSize; - - Mutex mLock; - int64_t mNumFramesPlayed; - int64_t mNumFramesPlayedSysTimeUs; - - int64_t mPositionTimeMediaUs; - int64_t mPositionTimeRealUs; - - bool mSeeking; - bool mReachedEOS; - status_t mFinalStatus; - int64_t mSeekTimeUs; - - bool mStarted; - - bool mIsFirstBuffer; - status_t mFirstBufferResult; - MediaBuffer *mFirstBuffer; - - sp mAudioSink; - bool mAllowDeepBuffering; // allow audio deep audio buffers. Helps with low power audio - // playback but implies high latency - AwesomePlayer *mObserver; - int64_t mPinnedTimeUs; - - static void AudioCallback(int event, void *user, void *info); - void AudioCallback(int event, void *info); - - static size_t AudioSinkCallback( - MediaPlayerBase::AudioSink *audioSink, - void *data, size_t size, void *me); - - size_t fillBuffer(void *data, size_t size); - - int64_t getRealTimeUsLocked() const; - - void reset(); - - uint32_t getNumFramesPendingPlayout() const; - - AudioPlayer(const AudioPlayer &); - AudioPlayer &operator=(const AudioPlayer &); -}; - -} // namespace android - -#endif // AUDIO_PLAYER_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/AudioSource.h b/external/android/include/16/frameworks/av/include/media/stagefright/AudioSource.h deleted file mode 100644 index f5466e8..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/AudioSource.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - * 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 AUDIO_SOURCE_H_ - -#define AUDIO_SOURCE_H_ - -#include -#include -#include -#include -#include - -#include - -namespace android { - -class AudioRecord; - -struct AudioSource : public MediaSource, public MediaBufferObserver { - // Note that the "channels" parameter is _not_ the number of channels, - // but a bitmask of audio_channels_t constants. - AudioSource( - audio_source_t inputSource, uint32_t sampleRate, - uint32_t channels = AUDIO_CHANNEL_IN_MONO); - - status_t initCheck() const; - - virtual status_t start(MetaData *params = NULL); - virtual status_t stop() { return reset(); } - virtual sp getFormat(); - - // Returns the maximum amplitude since last call. - int16_t getMaxAmplitude(); - - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL); - - status_t dataCallbackTimestamp(const AudioRecord::Buffer& buffer, int64_t timeUs); - virtual void signalBufferReturned(MediaBuffer *buffer); - -protected: - virtual ~AudioSource(); - -private: - enum { - kMaxBufferSize = 2048, - - // After the initial mute, we raise the volume linearly - // over kAutoRampDurationUs. - kAutoRampDurationUs = 300000, - - // This is the initial mute duration to suppress - // the video recording signal tone - kAutoRampStartUs = 0, - }; - - Mutex mLock; - Condition mFrameAvailableCondition; - Condition mFrameEncodingCompletionCondition; - - AudioRecord *mRecord; - status_t mInitCheck; - bool mStarted; - int32_t mSampleRate; - - bool mTrackMaxAmplitude; - int64_t mStartTimeUs; - int16_t mMaxAmplitude; - int64_t mPrevSampleTimeUs; - int64_t mInitialReadTimeUs; - int64_t mNumFramesReceived; - int64_t mNumClientOwnedBuffers; - - List mBuffersReceived; - - void trackMaxAmplitude(int16_t *data, int nSamples); - - // This is used to raise the volume from mute to the - // actual level linearly. - void rampVolume( - int32_t startFrame, int32_t rampDurationFrames, - uint8_t *data, size_t bytes); - - void queueInputBuffer_l(MediaBuffer *buffer, int64_t timeUs); - void releaseQueuedFrames_l(); - void waitOutstandingEncodingFrames_l(); - status_t reset(); - - AudioSource(const AudioSource &); - AudioSource &operator=(const AudioSource &); -}; - -} // namespace android - -#endif // AUDIO_SOURCE_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/CameraSource.h b/external/android/include/16/frameworks/av/include/media/stagefright/CameraSource.h deleted file mode 100644 index 5a35358..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/CameraSource.h +++ /dev/null @@ -1,232 +0,0 @@ -/* - * 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 CAMERA_SOURCE_H_ - -#define CAMERA_SOURCE_H_ - -#include -#include -#include -#include -#include -#include -#include - -namespace android { - -class IMemory; -class Camera; -class Surface; - -class CameraSource : public MediaSource, public MediaBufferObserver { -public: - /** - * Factory method to create a new CameraSource using the current - * settings (such as video size, frame rate, color format, etc) - * from the default camera. - * - * @return NULL on error. - */ - static CameraSource *Create(); - - /** - * Factory method to create a new CameraSource. - * - * @param camera the video input frame data source. If it is NULL, - * we will try to connect to the camera with the given - * cameraId. - * - * @param cameraId the id of the camera that the source will connect - * to if camera is NULL; otherwise ignored. - * - * @param videoSize the dimension (in pixels) of the video frame - * @param frameRate the target frames per second - * @param surface the preview surface for display where preview - * frames are sent to - * @param storeMetaDataInVideoBuffers true to request the camera - * source to store meta data in video buffers; false to - * request the camera source to store real YUV frame data - * in the video buffers. The camera source may not support - * storing meta data in video buffers, if so, a request - * to do that will NOT be honored. To find out whether - * meta data is actually being stored in video buffers - * during recording, call isMetaDataStoredInVideoBuffers(). - * - * @return NULL on error. - */ - static CameraSource *CreateFromCamera(const sp &camera, - const sp &proxy, - int32_t cameraId, - Size videoSize, - int32_t frameRate, - const sp& surface, - bool storeMetaDataInVideoBuffers = false); - - virtual ~CameraSource(); - - virtual status_t start(MetaData *params = NULL); - virtual status_t stop() { return reset(); } - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL); - - /** - * Check whether a CameraSource object is properly initialized. - * Must call this method before stop(). - * @return OK if initialization has successfully completed. - */ - virtual status_t initCheck() const; - - /** - * Returns the MetaData associated with the CameraSource, - * including: - * kKeyColorFormat: YUV color format of the video frames - * kKeyWidth, kKeyHeight: dimension (in pixels) of the video frames - * kKeySampleRate: frame rate in frames per second - * kKeyMIMEType: always fixed to be MEDIA_MIMETYPE_VIDEO_RAW - */ - virtual sp getFormat(); - - /** - * Tell whether this camera source stores meta data or real YUV - * frame data in video buffers. - * - * @return true if meta data is stored in the video - * buffers; false if real YUV data is stored in - * the video buffers. - */ - bool isMetaDataStoredInVideoBuffers() const; - - virtual void signalBufferReturned(MediaBuffer* buffer); - -protected: - class ProxyListener: public BnCameraRecordingProxyListener { - public: - ProxyListener(const sp& source); - virtual void dataCallbackTimestamp(int64_t timestampUs, int32_t msgType, - const sp &data); - - private: - sp mSource; - }; - - // isBinderAlive needs linkToDeath to work. - class DeathNotifier: public IBinder::DeathRecipient { - public: - DeathNotifier() {} - virtual void binderDied(const wp& who); - }; - - enum CameraFlags { - FLAGS_SET_CAMERA = 1L << 0, - FLAGS_HOT_CAMERA = 1L << 1, - }; - - int32_t mCameraFlags; - Size mVideoSize; - int32_t mVideoFrameRate; - int32_t mColorFormat; - status_t mInitCheck; - - sp mCamera; - sp mCameraRecordingProxy; - sp mDeathNotifier; - sp mSurface; - sp mMeta; - - int64_t mStartTimeUs; - int32_t mNumFramesReceived; - int64_t mLastFrameTimestampUs; - bool mStarted; - int32_t mNumFramesEncoded; - - // Time between capture of two frames. - int64_t mTimeBetweenFrameCaptureUs; - - CameraSource(const sp& camera, const sp& proxy, - int32_t cameraId, - Size videoSize, int32_t frameRate, - const sp& surface, - bool storeMetaDataInVideoBuffers); - - virtual void startCameraRecording(); - virtual void releaseRecordingFrame(const sp& frame); - - // Returns true if need to skip the current frame. - // Called from dataCallbackTimestamp. - virtual bool skipCurrentFrame(int64_t timestampUs) {return false;} - - // Callback called when still camera raw data is available. - virtual void dataCallback(int32_t msgType, const sp &data) {} - - virtual void dataCallbackTimestamp(int64_t timestampUs, int32_t msgType, - const sp &data); - -private: - friend class CameraSourceListener; - - Mutex mLock; - Condition mFrameAvailableCondition; - Condition mFrameCompleteCondition; - List > mFramesReceived; - List > mFramesBeingEncoded; - List mFrameTimes; - - int64_t mFirstFrameTimeUs; - int32_t mNumFramesDropped; - int32_t mNumGlitches; - int64_t mGlitchDurationThresholdUs; - bool mCollectStats; - bool mIsMetaDataStoredInVideoBuffers; - - void releaseQueuedFrames(); - void releaseOneRecordingFrame(const sp& frame); - - - status_t init(const sp& camera, const sp& proxy, - int32_t cameraId, Size videoSize, int32_t frameRate, - bool storeMetaDataInVideoBuffers); - - status_t initWithCameraAccess( - const sp& camera, const sp& proxy, - int32_t cameraId, Size videoSize, int32_t frameRate, - bool storeMetaDataInVideoBuffers); - - status_t isCameraAvailable(const sp& camera, - const sp& proxy, - int32_t cameraId); - status_t isCameraColorFormatSupported(const CameraParameters& params); - status_t configureCamera(CameraParameters* params, - int32_t width, int32_t height, - int32_t frameRate); - - status_t checkVideoSize(const CameraParameters& params, - int32_t width, int32_t height); - - status_t checkFrameRate(const CameraParameters& params, - int32_t frameRate); - - void stopCameraRecording(); - void releaseCamera(); - status_t reset(); - - CameraSource(const CameraSource &); - CameraSource &operator=(const CameraSource &); -}; - -} // namespace android - -#endif // CAMERA_SOURCE_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/CameraSourceTimeLapse.h b/external/android/include/16/frameworks/av/include/media/stagefright/CameraSourceTimeLapse.h deleted file mode 100644 index 0936da2..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/CameraSourceTimeLapse.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (C) 2010 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 CAMERA_SOURCE_TIME_LAPSE_H_ - -#define CAMERA_SOURCE_TIME_LAPSE_H_ - -#include - -#include -#include - -namespace android { - -class ICamera; -class IMemory; -class Camera; - -class CameraSourceTimeLapse : public CameraSource { -public: - static CameraSourceTimeLapse *CreateFromCamera( - const sp &camera, - const sp &proxy, - int32_t cameraId, - Size videoSize, - int32_t videoFrameRate, - const sp& surface, - int64_t timeBetweenTimeLapseFrameCaptureUs); - - virtual ~CameraSourceTimeLapse(); - - // If the frame capture interval is large, read will block for a long time. - // Due to the way the mediaRecorder framework works, a stop() call from - // mediaRecorder waits until the read returns, causing a long wait for - // stop() to return. To avoid this, we can make read() return a copy of the - // last read frame with the same time stamp frequently. This keeps the - // read() call from blocking too long. Calling this function quickly - // captures another frame, keeps its copy, and enables this mode of read() - // returning quickly. - void startQuickReadReturns(); - -private: - // size of the encoded video. - int32_t mVideoWidth; - int32_t mVideoHeight; - - // Time between two frames in final video (1/frameRate) - int64_t mTimeBetweenTimeLapseVideoFramesUs; - - // Real timestamp of the last encoded time lapse frame - int64_t mLastTimeLapseFrameRealTimestampUs; - - // Variable set in dataCallbackTimestamp() to help skipCurrentFrame() - // to know if current frame needs to be skipped. - bool mSkipCurrentFrame; - - // Lock for accessing mCameraIdle - Mutex mCameraIdleLock; - - // Condition variable to wait on if camera is is not yet idle. Once the - // camera gets idle, this variable will be signalled. - Condition mCameraIdleCondition; - - // True if camera is in preview mode and ready for takePicture(). - // False after a call to takePicture() but before the final compressed - // data callback has been called and preview has been restarted. - volatile bool mCameraIdle; - - // True if stop() is waiting for camera to get idle, i.e. for the last - // takePicture() to complete. This is needed so that dataCallbackTimestamp() - // can return immediately. - volatile bool mStopWaitingForIdleCamera; - - // Lock for accessing quick stop variables. - Mutex mQuickStopLock; - - // mQuickStop is set to true if we use quick read() returns, otherwise it is set - // to false. Once in this mode read() return a copy of the last read frame - // with the same time stamp. See startQuickReadReturns(). - volatile bool mQuickStop; - - // Forces the next frame passed to dataCallbackTimestamp() to be read - // as a time lapse frame. Used by startQuickReadReturns() so that the next - // frame wakes up any blocking read. - volatile bool mForceRead; - - // Stores a copy of the MediaBuffer read in the last read() call after - // mQuickStop was true. - MediaBuffer* mLastReadBufferCopy; - - // Status code for last read. - status_t mLastReadStatus; - - CameraSourceTimeLapse( - const sp &camera, - const sp &proxy, - int32_t cameraId, - Size videoSize, - int32_t videoFrameRate, - const sp& surface, - int64_t timeBetweenTimeLapseFrameCaptureUs); - - // Wrapper over CameraSource::signalBufferReturned() to implement quick stop. - // It only handles the case when mLastReadBufferCopy is signalled. Otherwise - // it calls the base class' function. - virtual void signalBufferReturned(MediaBuffer* buffer); - - // Wrapper over CameraSource::read() to implement quick stop. - virtual status_t read(MediaBuffer **buffer, const ReadOptions *options = NULL); - - // mSkipCurrentFrame is set to true in dataCallbackTimestamp() if the current - // frame needs to be skipped and this function just returns the value of mSkipCurrentFrame. - virtual bool skipCurrentFrame(int64_t timestampUs); - - // In the video camera case calls skipFrameAndModifyTimeStamp() to modify - // timestamp and set mSkipCurrentFrame. - // Then it calls the base CameraSource::dataCallbackTimestamp() - virtual void dataCallbackTimestamp(int64_t timestampUs, int32_t msgType, - const sp &data); - - // Convenience function to fill mLastReadBufferCopy from the just read - // buffer. - void fillLastReadBufferCopy(MediaBuffer& sourceBuffer); - - // If the passed in size (width x height) is a supported video/preview size, - // the function sets the camera's video/preview size to it and returns true. - // Otherwise returns false. - bool trySettingVideoSize(int32_t width, int32_t height); - - // When video camera is used for time lapse capture, returns true - // until enough time has passed for the next time lapse frame. When - // the frame needs to be encoded, it returns false and also modifies - // the time stamp to be one frame time ahead of the last encoded - // frame's time stamp. - bool skipFrameAndModifyTimeStamp(int64_t *timestampUs); - - // Wrapper to enter threadTimeLapseEntry() - static void *ThreadTimeLapseWrapper(void *me); - - // Creates a copy of source_data into a new memory of final type MemoryBase. - sp createIMemoryCopy(const sp &source_data); - - CameraSourceTimeLapse(const CameraSourceTimeLapse &); - CameraSourceTimeLapse &operator=(const CameraSourceTimeLapse &); -}; - -} // namespace android - -#endif // CAMERA_SOURCE_TIME_LAPSE_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/ColorConverter.h b/external/android/include/16/frameworks/av/include/media/stagefright/ColorConverter.h deleted file mode 100644 index 85ba920..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/ColorConverter.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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 COLOR_CONVERTER_H_ - -#define COLOR_CONVERTER_H_ - -#include - -#include -#include - -#include - -namespace android { - -struct ColorConverter { - ColorConverter(OMX_COLOR_FORMATTYPE from, OMX_COLOR_FORMATTYPE to); - ~ColorConverter(); - - bool isValid() const; - - status_t convert( - const void *srcBits, - size_t srcWidth, size_t srcHeight, - size_t srcCropLeft, size_t srcCropTop, - size_t srcCropRight, size_t srcCropBottom, - void *dstBits, - size_t dstWidth, size_t dstHeight, - size_t dstCropLeft, size_t dstCropTop, - size_t dstCropRight, size_t dstCropBottom); - -private: - struct BitmapParams { - BitmapParams( - void *bits, - size_t width, size_t height, - size_t cropLeft, size_t cropTop, - size_t cropRight, size_t cropBottom); - - size_t cropWidth() const; - size_t cropHeight() const; - - void *mBits; - size_t mWidth, mHeight; - size_t mCropLeft, mCropTop, mCropRight, mCropBottom; - }; - - OMX_COLOR_FORMATTYPE mSrcFormat, mDstFormat; - uint8_t *mClip; - - uint8_t *initClip(); - - status_t convertCbYCrY( - const BitmapParams &src, const BitmapParams &dst); - - status_t convertYUV420Planar( - const BitmapParams &src, const BitmapParams &dst); - - status_t convertQCOMYUV420SemiPlanar( - const BitmapParams &src, const BitmapParams &dst); - - status_t convertYUV420SemiPlanar( - const BitmapParams &src, const BitmapParams &dst); - - status_t convertTIYUV420PackedSemiPlanar( - const BitmapParams &src, const BitmapParams &dst); - - ColorConverter(const ColorConverter &); - ColorConverter &operator=(const ColorConverter &); -}; - -} // namespace android - -#endif // COLOR_CONVERTER_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/DataSource.h b/external/android/include/16/frameworks/av/include/media/stagefright/DataSource.h deleted file mode 100644 index 00d583e..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/DataSource.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * 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 DATA_SOURCE_H_ - -#define DATA_SOURCE_H_ - -#include - -#include -#include -#include -#include -#include -#include -#include - -namespace android { - -struct AMessage; -class String8; - -class DataSource : public RefBase { -public: - enum Flags { - kWantsPrefetching = 1, - kStreamedFromLocalHost = 2, - kIsCachingDataSource = 4, - kIsHTTPBasedSource = 8, - }; - - static sp CreateFromURI( - const char *uri, - const KeyedVector *headers = NULL); - - DataSource() {} - - virtual status_t initCheck() const = 0; - - virtual ssize_t readAt(off64_t offset, void *data, size_t size) = 0; - - // Convenience methods: - bool getUInt16(off64_t offset, uint16_t *x); - - // May return ERROR_UNSUPPORTED. - virtual status_t getSize(off64_t *size); - - virtual uint32_t flags() { - return 0; - } - - virtual status_t reconnectAtOffset(off64_t offset) { - return ERROR_UNSUPPORTED; - } - - //////////////////////////////////////////////////////////////////////////// - - bool sniff(String8 *mimeType, float *confidence, sp *meta); - - // The sniffer can optionally fill in "meta" with an AMessage containing - // a dictionary of values that helps the corresponding extractor initialize - // its state without duplicating effort already exerted by the sniffer. - typedef bool (*SnifferFunc)( - const sp &source, String8 *mimeType, - float *confidence, sp *meta); - - static void RegisterSniffer(SnifferFunc func); - static void RegisterDefaultSniffers(); - - // for DRM - virtual sp DrmInitialization(const char *mime = NULL) { - return NULL; - } - virtual void getDrmInfo(sp &handle, DrmManagerClient **client) {}; - - virtual String8 getUri() { - return String8(); - } - - virtual String8 getMIMEType() const; - -protected: - virtual ~DataSource() {} - -private: - static Mutex gSnifferMutex; - static List gSniffers; - - DataSource(const DataSource &); - DataSource &operator=(const DataSource &); -}; - -} // namespace android - -#endif // DATA_SOURCE_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/FileSource.h b/external/android/include/16/frameworks/av/include/media/stagefright/FileSource.h deleted file mode 100644 index d994cb3..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/FileSource.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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 FILE_SOURCE_H_ - -#define FILE_SOURCE_H_ - -#include - -#include -#include -#include -#include - -namespace android { - -class FileSource : public DataSource { -public: - FileSource(const char *filename); - FileSource(int fd, int64_t offset, int64_t length); - - virtual status_t initCheck() const; - - virtual ssize_t readAt(off64_t offset, void *data, size_t size); - - virtual status_t getSize(off64_t *size); - - virtual sp DrmInitialization(const char *mime); - - virtual void getDrmInfo(sp &handle, DrmManagerClient **client); - -protected: - virtual ~FileSource(); - -private: - int mFd; - int64_t mOffset; - int64_t mLength; - Mutex mLock; - - /*for DRM*/ - sp mDecryptHandle; - DrmManagerClient *mDrmManagerClient; - int64_t mDrmBufOffset; - int64_t mDrmBufSize; - unsigned char *mDrmBuf; - - ssize_t readAtDRM(off64_t offset, void *data, size_t size); - - FileSource(const FileSource &); - FileSource &operator=(const FileSource &); -}; - -} // namespace android - -#endif // FILE_SOURCE_H_ - diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/JPEGSource.h b/external/android/include/16/frameworks/av/include/media/stagefright/JPEGSource.h deleted file mode 100644 index 1b7e91b..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/JPEGSource.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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 JPEG_SOURCE_H_ - -#define JPEG_SOURCE_H_ - -#include - -namespace android { - -class DataSource; -class MediaBufferGroup; - -struct JPEGSource : public MediaSource { - JPEGSource(const sp &source); - - virtual status_t start(MetaData *params = NULL); - virtual status_t stop(); - virtual sp getFormat(); - - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL); - -protected: - virtual ~JPEGSource(); - -private: - sp mSource; - MediaBufferGroup *mGroup; - bool mStarted; - off64_t mSize; - int32_t mWidth, mHeight; - off64_t mOffset; - - status_t parseJPEG(); - - JPEGSource(const JPEGSource &); - JPEGSource &operator=(const JPEGSource &); -}; - -} // namespace android - -#endif // JPEG_SOURCE_H_ - diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/MPEG2TSWriter.h b/external/android/include/16/frameworks/av/include/media/stagefright/MPEG2TSWriter.h deleted file mode 100644 index a7c9ecf..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/MPEG2TSWriter.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (C) 2010 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 MPEG2TS_WRITER_H_ - -#define MPEG2TS_WRITER_H_ - -#include -#include -#include -#include - -namespace android { - -struct ABuffer; - -struct MPEG2TSWriter : public MediaWriter { - MPEG2TSWriter(int fd); - MPEG2TSWriter(const char *filename); - - MPEG2TSWriter( - void *cookie, - ssize_t (*write)(void *cookie, const void *data, size_t size)); - - virtual status_t addSource(const sp &source); - virtual status_t start(MetaData *param = NULL); - virtual status_t stop() { return reset(); } - virtual status_t pause(); - virtual bool reachedEOS(); - virtual status_t dump(int fd, const Vector& args); - - void onMessageReceived(const sp &msg); - -protected: - virtual ~MPEG2TSWriter(); - -private: - enum { - kWhatSourceNotify = 'noti' - }; - - struct SourceInfo; - - FILE *mFile; - - void *mWriteCookie; - ssize_t (*mWriteFunc)(void *cookie, const void *data, size_t size); - - sp mLooper; - sp > mReflector; - - bool mStarted; - - Vector > mSources; - size_t mNumSourcesDone; - - int64_t mNumTSPacketsWritten; - int64_t mNumTSPacketsBeforeMeta; - - void init(); - - void writeTS(); - void writeProgramAssociationTable(); - void writeProgramMap(); - void writeAccessUnit(int32_t sourceIndex, const sp &buffer); - - ssize_t internalWrite(const void *data, size_t size); - status_t reset(); - - DISALLOW_EVIL_CONSTRUCTORS(MPEG2TSWriter); -}; - -} // namespace android - -#endif // MPEG2TS_WRITER_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/MPEG4Writer.h b/external/android/include/16/frameworks/av/include/media/stagefright/MPEG4Writer.h deleted file mode 100644 index cd4e129..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/MPEG4Writer.h +++ /dev/null @@ -1,195 +0,0 @@ -/* - * 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 MPEG4_WRITER_H_ - -#define MPEG4_WRITER_H_ - -#include - -#include -#include -#include - -namespace android { - -class MediaBuffer; -class MediaSource; -class MetaData; - -class MPEG4Writer : public MediaWriter { -public: - MPEG4Writer(const char *filename); - MPEG4Writer(int fd); - - virtual status_t addSource(const sp &source); - virtual status_t start(MetaData *param = NULL); - virtual status_t stop() { return reset(); } - virtual status_t pause(); - virtual bool reachedEOS(); - virtual status_t dump(int fd, const Vector& args); - - void beginBox(const char *fourcc); - void writeInt8(int8_t x); - void writeInt16(int16_t x); - void writeInt32(int32_t x); - void writeInt64(int64_t x); - void writeCString(const char *s); - void writeFourcc(const char *fourcc); - void write(const void *data, size_t size); - inline size_t write(const void *ptr, size_t size, size_t nmemb); - void endBox(); - uint32_t interleaveDuration() const { return mInterleaveDurationUs; } - status_t setInterleaveDuration(uint32_t duration); - int32_t getTimeScale() const { return mTimeScale; } - - status_t setGeoData(int latitudex10000, int longitudex10000); - void setStartTimeOffsetMs(int ms) { mStartTimeOffsetMs = ms; } - int32_t getStartTimeOffsetMs() const { return mStartTimeOffsetMs; } - -protected: - virtual ~MPEG4Writer(); - -private: - class Track; - - int mFd; - status_t mInitCheck; - bool mUse4ByteNalLength; - bool mUse32BitOffset; - bool mIsFileSizeLimitExplicitlyRequested; - bool mPaused; - bool mStarted; // Writer thread + track threads started successfully - bool mWriterThreadStarted; // Only writer thread started successfully - off64_t mOffset; - off_t mMdatOffset; - uint8_t *mMoovBoxBuffer; - off64_t mMoovBoxBufferOffset; - bool mWriteMoovBoxToMemory; - off64_t mFreeBoxOffset; - bool mStreamableFile; - off64_t mEstimatedMoovBoxSize; - uint32_t mInterleaveDurationUs; - int32_t mTimeScale; - int64_t mStartTimestampUs; - int mLatitudex10000; - int mLongitudex10000; - bool mAreGeoTagsAvailable; - int32_t mStartTimeOffsetMs; - - Mutex mLock; - - List mTracks; - - List mBoxes; - - void setStartTimestampUs(int64_t timeUs); - int64_t getStartTimestampUs(); // Not const - status_t startTracks(MetaData *params); - size_t numTracks(); - int64_t estimateMoovBoxSize(int32_t bitRate); - - struct Chunk { - Track *mTrack; // Owner - int64_t mTimeStampUs; // Timestamp of the 1st sample - List mSamples; // Sample data - - // Convenient constructor - Chunk(): mTrack(NULL), mTimeStampUs(0) {} - - Chunk(Track *track, int64_t timeUs, List samples) - : mTrack(track), mTimeStampUs(timeUs), mSamples(samples) { - } - - }; - struct ChunkInfo { - Track *mTrack; // Owner - List mChunks; // Remaining chunks to be written - - // Previous chunk timestamp that has been written - int64_t mPrevChunkTimestampUs; - - // Max time interval between neighboring chunks - int64_t mMaxInterChunkDurUs; - - }; - - bool mIsFirstChunk; - volatile bool mDone; // Writer thread is done? - pthread_t mThread; // Thread id for the writer - List mChunkInfos; // Chunk infos - Condition mChunkReadyCondition; // Signal that chunks are available - - // Writer thread handling - status_t startWriterThread(); - void stopWriterThread(); - static void *ThreadWrapper(void *me); - void threadFunc(); - - // Buffer a single chunk to be written out later. - void bufferChunk(const Chunk& chunk); - - // Write all buffered chunks from all tracks - void writeAllChunks(); - - // Retrieve the proper chunk to write if there is one - // Return true if a chunk is found; otherwise, return false. - bool findChunkToWrite(Chunk *chunk); - - // Actually write the given chunk to the file. - void writeChunkToFile(Chunk* chunk); - - // Adjust other track media clock (presumably wall clock) - // based on audio track media clock with the drift time. - int64_t mDriftTimeUs; - void setDriftTimeUs(int64_t driftTimeUs); - int64_t getDriftTimeUs(); - - // Return whether the nal length is 4 bytes or 2 bytes - // Only makes sense for H.264/AVC - bool useNalLengthFour(); - - void lock(); - void unlock(); - - // Acquire lock before calling these methods - off64_t addSample_l(MediaBuffer *buffer); - off64_t addLengthPrefixedSample_l(MediaBuffer *buffer); - - bool exceedsFileSizeLimit(); - bool use32BitFileOffset() const; - bool exceedsFileDurationLimit(); - bool isFileStreamable() const; - void trackProgressStatus(size_t trackId, int64_t timeUs, status_t err = OK); - void writeCompositionMatrix(int32_t degrees); - void writeMvhdBox(int64_t durationUs); - void writeMoovBox(int64_t durationUs); - void writeFtypBox(MetaData *param); - void writeUdtaBox(); - void writeGeoDataBox(); - void writeLatitude(int degreex10000); - void writeLongitude(int degreex10000); - void sendSessionSummary(); - void release(); - status_t reset(); - - MPEG4Writer(const MPEG4Writer &); - MPEG4Writer &operator=(const MPEG4Writer &); -}; - -} // namespace android - -#endif // MPEG4_WRITER_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/MediaBuffer.h b/external/android/include/16/frameworks/av/include/media/stagefright/MediaBuffer.h deleted file mode 100644 index 3d79596..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/MediaBuffer.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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 MEDIA_BUFFER_H_ - -#define MEDIA_BUFFER_H_ - -#include - -#include -#include - -namespace android { - -struct ABuffer; -class GraphicBuffer; -class MediaBuffer; -class MediaBufferObserver; -class MetaData; - -class MediaBufferObserver { -public: - MediaBufferObserver() {} - virtual ~MediaBufferObserver() {} - - virtual void signalBufferReturned(MediaBuffer *buffer) = 0; - -private: - MediaBufferObserver(const MediaBufferObserver &); - MediaBufferObserver &operator=(const MediaBufferObserver &); -}; - -class MediaBuffer { -public: - // The underlying data remains the responsibility of the caller! - MediaBuffer(void *data, size_t size); - - MediaBuffer(size_t size); - - MediaBuffer(const sp& graphicBuffer); - - MediaBuffer(const sp &buffer); - - // Decrements the reference count and returns the buffer to its - // associated MediaBufferGroup if the reference count drops to 0. - void release(); - - // Increments the reference count. - void add_ref(); - - void *data() const; - size_t size() const; - - size_t range_offset() const; - size_t range_length() const; - - void set_range(size_t offset, size_t length); - - sp graphicBuffer() const; - - sp meta_data(); - - // Clears meta data and resets the range to the full extent. - void reset(); - - void setObserver(MediaBufferObserver *group); - - // Returns a clone of this MediaBuffer increasing its reference count. - // The clone references the same data but has its own range and - // MetaData. - MediaBuffer *clone(); - - int refcount() const; - -protected: - virtual ~MediaBuffer(); - -private: - friend class MediaBufferGroup; - friend class OMXDecoder; - - // For use by OMXDecoder, reference count must be 1, drop reference - // count to 0 without signalling the observer. - void claim(); - - MediaBufferObserver *mObserver; - MediaBuffer *mNextBuffer; - int mRefCount; - - void *mData; - size_t mSize, mRangeOffset, mRangeLength; - sp mGraphicBuffer; - sp mBuffer; - - bool mOwnsData; - - sp mMetaData; - - MediaBuffer *mOriginal; - - void setNextBuffer(MediaBuffer *buffer); - MediaBuffer *nextBuffer(); - - MediaBuffer(const MediaBuffer &); - MediaBuffer &operator=(const MediaBuffer &); -}; - -} // namespace android - -#endif // MEDIA_BUFFER_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/MediaBufferGroup.h b/external/android/include/16/frameworks/av/include/media/stagefright/MediaBufferGroup.h deleted file mode 100644 index 0488292..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/MediaBufferGroup.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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 MEDIA_BUFFER_GROUP_H_ - -#define MEDIA_BUFFER_GROUP_H_ - -#include -#include -#include - -namespace android { - -class MediaBuffer; -class MetaData; - -class MediaBufferGroup : public MediaBufferObserver { -public: - MediaBufferGroup(); - ~MediaBufferGroup(); - - void add_buffer(MediaBuffer *buffer); - - // Blocks until a buffer is available and returns it to the caller, - // the returned buffer will have a reference count of 1. - status_t acquire_buffer(MediaBuffer **buffer); - -protected: - virtual void signalBufferReturned(MediaBuffer *buffer); - -private: - friend class MediaBuffer; - - Mutex mLock; - Condition mCondition; - - MediaBuffer *mFirstBuffer, *mLastBuffer; - - MediaBufferGroup(const MediaBufferGroup &); - MediaBufferGroup &operator=(const MediaBufferGroup &); -}; - -} // namespace android - -#endif // MEDIA_BUFFER_GROUP_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/MediaCodec.h b/external/android/include/16/frameworks/av/include/media/stagefright/MediaCodec.h deleted file mode 100644 index e46e8e9..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/MediaCodec.h +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Copyright 2012, 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 MEDIA_CODEC_H_ - -#define MEDIA_CODEC_H_ - -#include -#include -#include -#include - -namespace android { - -struct ABuffer; -struct ACodec; -struct AMessage; -struct AString; -struct ICrypto; -struct SoftwareRenderer; -struct SurfaceTextureClient; - -struct MediaCodec : public AHandler { - enum ConfigureFlags { - CONFIGURE_FLAG_ENCODE = 1, - }; - - enum BufferFlags { - BUFFER_FLAG_SYNCFRAME = 1, - BUFFER_FLAG_CODECCONFIG = 2, - BUFFER_FLAG_EOS = 4, - }; - - static sp CreateByType( - const sp &looper, const char *mime, bool encoder); - - static sp CreateByComponentName( - const sp &looper, const char *name); - - status_t configure( - const sp &format, - const sp &nativeWindow, - const sp &crypto, - uint32_t flags); - - status_t start(); - - // Returns to a state in which the component remains allocated but - // unconfigured. - status_t stop(); - - // Client MUST call release before releasing final reference to this - // object. - status_t release(); - - status_t flush(); - - status_t queueInputBuffer( - size_t index, - size_t offset, - size_t size, - int64_t presentationTimeUs, - uint32_t flags, - AString *errorDetailMsg = NULL); - - status_t queueSecureInputBuffer( - size_t index, - size_t offset, - const CryptoPlugin::SubSample *subSamples, - size_t numSubSamples, - const uint8_t key[16], - const uint8_t iv[16], - CryptoPlugin::Mode mode, - int64_t presentationTimeUs, - uint32_t flags, - AString *errorDetailMsg = NULL); - - status_t dequeueInputBuffer(size_t *index, int64_t timeoutUs = 0ll); - - status_t dequeueOutputBuffer( - size_t *index, - size_t *offset, - size_t *size, - int64_t *presentationTimeUs, - uint32_t *flags, - int64_t timeoutUs = 0ll); - - status_t renderOutputBufferAndRelease(size_t index); - status_t releaseOutputBuffer(size_t index); - - status_t getOutputFormat(sp *format) const; - - status_t getInputBuffers(Vector > *buffers) const; - status_t getOutputBuffers(Vector > *buffers) const; - -protected: - virtual ~MediaCodec(); - virtual void onMessageReceived(const sp &msg); - -private: - enum State { - UNINITIALIZED, - INITIALIZING, - INITIALIZED, - CONFIGURING, - CONFIGURED, - STARTING, - STARTED, - FLUSHING, - STOPPING, - RELEASING, - }; - - enum { - kPortIndexInput = 0, - kPortIndexOutput = 1, - }; - - enum { - kWhatInit = 'init', - kWhatConfigure = 'conf', - kWhatStart = 'strt', - kWhatStop = 'stop', - kWhatRelease = 'rele', - kWhatDequeueInputBuffer = 'deqI', - kWhatQueueInputBuffer = 'queI', - kWhatDequeueOutputBuffer = 'deqO', - kWhatReleaseOutputBuffer = 'relO', - kWhatGetBuffers = 'getB', - kWhatFlush = 'flus', - kWhatGetOutputFormat = 'getO', - kWhatDequeueInputTimedOut = 'dITO', - kWhatDequeueOutputTimedOut = 'dOTO', - kWhatCodecNotify = 'codc', - }; - - enum { - kFlagIsSoftwareCodec = 1, - kFlagOutputFormatChanged = 2, - kFlagOutputBuffersChanged = 4, - kFlagStickyError = 8, - kFlagDequeueInputPending = 16, - kFlagDequeueOutputPending = 32, - kFlagIsSecure = 64, - }; - - struct BufferInfo { - void *mBufferID; - sp mData; - sp mEncryptedData; - sp mNotify; - bool mOwnedByClient; - }; - - State mState; - sp mLooper; - sp mCodecLooper; - sp mCodec; - uint32_t mReplyID; - uint32_t mFlags; - sp mNativeWindow; - SoftwareRenderer *mSoftRenderer; - sp mOutputFormat; - - List mAvailPortBuffers[2]; - Vector mPortBuffers[2]; - - int32_t mDequeueInputTimeoutGeneration; - uint32_t mDequeueInputReplyID; - - int32_t mDequeueOutputTimeoutGeneration; - uint32_t mDequeueOutputReplyID; - - sp mCrypto; - - List > mCSD; - - MediaCodec(const sp &looper); - - static status_t PostAndAwaitResponse( - const sp &msg, sp *response); - - status_t init(const char *name, bool nameIsType, bool encoder); - - void setState(State newState); - void returnBuffersToCodec(); - void returnBuffersToCodecOnPort(int32_t portIndex); - size_t updateBuffers(int32_t portIndex, const sp &msg); - status_t onQueueInputBuffer(const sp &msg); - status_t onReleaseOutputBuffer(const sp &msg); - ssize_t dequeuePortBuffer(int32_t portIndex); - - bool handleDequeueInputBuffer(uint32_t replyID, bool newRequest = false); - bool handleDequeueOutputBuffer(uint32_t replyID, bool newRequest = false); - void cancelPendingDequeueOperations(); - - void extractCSD(const sp &format); - status_t queueCSDInputBuffer(size_t bufferIndex); - - status_t setNativeWindow( - const sp &surfaceTextureClient); - - DISALLOW_EVIL_CONSTRUCTORS(MediaCodec); -}; - -} // namespace android - -#endif // MEDIA_CODEC_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/MediaCodecList.h b/external/android/include/16/frameworks/av/include/media/stagefright/MediaCodecList.h deleted file mode 100644 index dfb845b..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/MediaCodecList.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2012, 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 MEDIA_CODEC_LIST_H_ - -#define MEDIA_CODEC_LIST_H_ - -#include -#include - -#include -#include -#include -#include - -namespace android { - -struct MediaCodecList { - static const MediaCodecList *getInstance(); - - ssize_t findCodecByType( - const char *type, bool encoder, size_t startIndex = 0) const; - - ssize_t findCodecByName(const char *name) const; - - size_t countCodecs() const; - const char *getCodecName(size_t index) const; - bool isEncoder(size_t index) const; - bool codecHasQuirk(size_t index, const char *quirkName) const; - - status_t getSupportedTypes(size_t index, Vector *types) const; - - struct ProfileLevel { - uint32_t mProfile; - uint32_t mLevel; - }; - status_t getCodecCapabilities( - size_t index, const char *type, - Vector *profileLevels, - Vector *colorFormats) const; - -private: - enum Section { - SECTION_TOPLEVEL, - SECTION_DECODERS, - SECTION_DECODER, - SECTION_ENCODERS, - SECTION_ENCODER, - }; - - struct CodecInfo { - AString mName; - bool mIsEncoder; - uint32_t mTypes; - uint32_t mQuirks; - }; - - static MediaCodecList *sCodecList; - - status_t mInitCheck; - Section mCurrentSection; - int32_t mDepth; - - Vector mCodecInfos; - KeyedVector mCodecQuirks; - KeyedVector mTypes; - - MediaCodecList(); - ~MediaCodecList(); - - status_t initCheck() const; - void parseXMLFile(FILE *file); - - static void StartElementHandlerWrapper( - void *me, const char *name, const char **attrs); - - static void EndElementHandlerWrapper(void *me, const char *name); - - void startElementHandler(const char *name, const char **attrs); - void endElementHandler(const char *name); - - status_t addMediaCodecFromAttributes(bool encoder, const char **attrs); - void addMediaCodec(bool encoder, const char *name, const char *type = NULL); - - status_t addQuirk(const char **attrs); - status_t addTypeFromAttributes(const char **attrs); - void addType(const char *name); - - DISALLOW_EVIL_CONSTRUCTORS(MediaCodecList); -}; - -} // namespace android - -#endif // MEDIA_CODEC_LIST_H_ - diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/MediaDefs.h b/external/android/include/16/frameworks/av/include/media/stagefright/MediaDefs.h deleted file mode 100644 index 457d5d7..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/MediaDefs.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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 MEDIA_DEFS_H_ - -#define MEDIA_DEFS_H_ - -namespace android { - -extern const char *MEDIA_MIMETYPE_IMAGE_JPEG; - -extern const char *MEDIA_MIMETYPE_VIDEO_VPX; -extern const char *MEDIA_MIMETYPE_VIDEO_AVC; -extern const char *MEDIA_MIMETYPE_VIDEO_MPEG4; -extern const char *MEDIA_MIMETYPE_VIDEO_H263; -extern const char *MEDIA_MIMETYPE_VIDEO_MPEG2; -extern const char *MEDIA_MIMETYPE_VIDEO_RAW; - -extern const char *MEDIA_MIMETYPE_AUDIO_AMR_NB; -extern const char *MEDIA_MIMETYPE_AUDIO_AMR_WB; -extern const char *MEDIA_MIMETYPE_AUDIO_MPEG; // layer III -extern const char *MEDIA_MIMETYPE_AUDIO_MPEG_LAYER_I; -extern const char *MEDIA_MIMETYPE_AUDIO_MPEG_LAYER_II; -extern const char *MEDIA_MIMETYPE_AUDIO_AAC; -extern const char *MEDIA_MIMETYPE_AUDIO_QCELP; -extern const char *MEDIA_MIMETYPE_AUDIO_VORBIS; -extern const char *MEDIA_MIMETYPE_AUDIO_G711_ALAW; -extern const char *MEDIA_MIMETYPE_AUDIO_G711_MLAW; -extern const char *MEDIA_MIMETYPE_AUDIO_RAW; -extern const char *MEDIA_MIMETYPE_AUDIO_FLAC; -extern const char *MEDIA_MIMETYPE_AUDIO_AAC_ADTS; - -extern const char *MEDIA_MIMETYPE_CONTAINER_MPEG4; -extern const char *MEDIA_MIMETYPE_CONTAINER_WAV; -extern const char *MEDIA_MIMETYPE_CONTAINER_OGG; -extern const char *MEDIA_MIMETYPE_CONTAINER_MATROSKA; -extern const char *MEDIA_MIMETYPE_CONTAINER_MPEG2TS; -extern const char *MEDIA_MIMETYPE_CONTAINER_AVI; -extern const char *MEDIA_MIMETYPE_CONTAINER_MPEG2PS; - -extern const char *MEDIA_MIMETYPE_CONTAINER_WVM; - -extern const char *MEDIA_MIMETYPE_TEXT_3GPP; -extern const char *MEDIA_MIMETYPE_TEXT_SUBRIP; - -} // namespace android - -#endif // MEDIA_DEFS_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/MediaErrors.h b/external/android/include/16/frameworks/av/include/media/stagefright/MediaErrors.h deleted file mode 100644 index bb01467..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/MediaErrors.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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 MEDIA_ERRORS_H_ - -#define MEDIA_ERRORS_H_ - -#include - -namespace android { - -enum { - MEDIA_ERROR_BASE = -1000, - - ERROR_ALREADY_CONNECTED = MEDIA_ERROR_BASE, - ERROR_NOT_CONNECTED = MEDIA_ERROR_BASE - 1, - ERROR_UNKNOWN_HOST = MEDIA_ERROR_BASE - 2, - ERROR_CANNOT_CONNECT = MEDIA_ERROR_BASE - 3, - ERROR_IO = MEDIA_ERROR_BASE - 4, - ERROR_CONNECTION_LOST = MEDIA_ERROR_BASE - 5, - ERROR_MALFORMED = MEDIA_ERROR_BASE - 7, - ERROR_OUT_OF_RANGE = MEDIA_ERROR_BASE - 8, - ERROR_BUFFER_TOO_SMALL = MEDIA_ERROR_BASE - 9, - ERROR_UNSUPPORTED = MEDIA_ERROR_BASE - 10, - ERROR_END_OF_STREAM = MEDIA_ERROR_BASE - 11, - - // Not technically an error. - INFO_FORMAT_CHANGED = MEDIA_ERROR_BASE - 12, - INFO_DISCONTINUITY = MEDIA_ERROR_BASE - 13, - INFO_OUTPUT_BUFFERS_CHANGED = MEDIA_ERROR_BASE - 14, - - // The following constant values should be in sync with - // drm/drm_framework_common.h - DRM_ERROR_BASE = -2000, - - ERROR_DRM_UNKNOWN = DRM_ERROR_BASE, - ERROR_DRM_NO_LICENSE = DRM_ERROR_BASE - 1, - ERROR_DRM_LICENSE_EXPIRED = DRM_ERROR_BASE - 2, - ERROR_DRM_SESSION_NOT_OPENED = DRM_ERROR_BASE - 3, - ERROR_DRM_DECRYPT_UNIT_NOT_INITIALIZED = DRM_ERROR_BASE - 4, - ERROR_DRM_DECRYPT = DRM_ERROR_BASE - 5, - ERROR_DRM_CANNOT_HANDLE = DRM_ERROR_BASE - 6, - ERROR_DRM_TAMPER_DETECTED = DRM_ERROR_BASE - 7, - - ERROR_DRM_VENDOR_MAX = DRM_ERROR_BASE - 500, - ERROR_DRM_VENDOR_MIN = DRM_ERROR_BASE - 999, - - // Deprecated - ERROR_DRM_WV_VENDOR_MAX = ERROR_DRM_VENDOR_MAX, - ERROR_DRM_WV_VENDOR_MIN = ERROR_DRM_VENDOR_MIN, - - // Heartbeat Error Codes - HEARTBEAT_ERROR_BASE = -3000, - ERROR_HEARTBEAT_TERMINATE_REQUESTED = HEARTBEAT_ERROR_BASE, -}; - -} // namespace android - -#endif // MEDIA_ERRORS_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/MediaExtractor.h b/external/android/include/16/frameworks/av/include/media/stagefright/MediaExtractor.h deleted file mode 100644 index 94090ee..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/MediaExtractor.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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 MEDIA_EXTRACTOR_H_ - -#define MEDIA_EXTRACTOR_H_ - -#include - -namespace android { - -class DataSource; -class MediaSource; -class MetaData; - -class MediaExtractor : public RefBase { -public: - static sp Create( - const sp &source, const char *mime = NULL); - - virtual size_t countTracks() = 0; - virtual sp getTrack(size_t index) = 0; - - enum GetTrackMetaDataFlags { - kIncludeExtensiveMetaData = 1 - }; - virtual sp getTrackMetaData( - size_t index, uint32_t flags = 0) = 0; - - // Return container specific meta-data. The default implementation - // returns an empty metadata object. - virtual sp getMetaData(); - - enum Flags { - CAN_SEEK_BACKWARD = 1, // the "seek 10secs back button" - CAN_SEEK_FORWARD = 2, // the "seek 10secs forward button" - CAN_PAUSE = 4, - CAN_SEEK = 8, // the "seek bar" - }; - - // If subclasses do _not_ override this, the default is - // CAN_SEEK_BACKWARD | CAN_SEEK_FORWARD | CAN_SEEK | CAN_PAUSE - virtual uint32_t flags() const; - - // for DRM - void setDrmFlag(bool flag) { - mIsDrm = flag; - }; - bool getDrmFlag() { - return mIsDrm; - } - virtual char* getDrmTrackInfo(size_t trackID, int *len) { - return NULL; - } - -protected: - MediaExtractor() {} - virtual ~MediaExtractor() {} - -private: - bool mIsDrm; - - MediaExtractor(const MediaExtractor &); - MediaExtractor &operator=(const MediaExtractor &); -}; - -} // namespace android - -#endif // MEDIA_EXTRACTOR_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/MediaSource.h b/external/android/include/16/frameworks/av/include/media/stagefright/MediaSource.h deleted file mode 100644 index 3818e63..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/MediaSource.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - * 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 MEDIA_SOURCE_H_ - -#define MEDIA_SOURCE_H_ - -#include - -#include -#include -#include - -namespace android { - -class MediaBuffer; -class MetaData; - -struct MediaSource : public virtual RefBase { - MediaSource(); - - // To be called before any other methods on this object, except - // getFormat(). - virtual status_t start(MetaData *params = NULL) = 0; - - // Any blocking read call returns immediately with a result of NO_INIT. - // It is an error to call any methods other than start after this call - // returns. Any buffers the object may be holding onto at the time of - // the stop() call are released. - // Also, it is imperative that any buffers output by this object and - // held onto by callers be released before a call to stop() !!! - virtual status_t stop() = 0; - - // Returns the format of the data output by this media source. - virtual sp getFormat() = 0; - - struct ReadOptions; - - // Returns a new buffer of data. Call blocks until a - // buffer is available, an error is encountered of the end of the stream - // is reached. - // End of stream is signalled by a result of ERROR_END_OF_STREAM. - // A result of INFO_FORMAT_CHANGED indicates that the format of this - // MediaSource has changed mid-stream, the client can continue reading - // but should be prepared for buffers of the new configuration. - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL) = 0; - - // Options that modify read() behaviour. The default is to - // a) not request a seek - // b) not be late, i.e. lateness_us = 0 - struct ReadOptions { - enum SeekMode { - SEEK_PREVIOUS_SYNC, - SEEK_NEXT_SYNC, - SEEK_CLOSEST_SYNC, - SEEK_CLOSEST, - }; - - ReadOptions(); - - // Reset everything back to defaults. - void reset(); - - void setSeekTo(int64_t time_us, SeekMode mode = SEEK_CLOSEST_SYNC); - void clearSeekTo(); - bool getSeekTo(int64_t *time_us, SeekMode *mode) const; - - void setLateBy(int64_t lateness_us); - int64_t getLateBy() const; - - private: - enum Options { - kSeekTo_Option = 1, - }; - - uint32_t mOptions; - int64_t mSeekTimeUs; - SeekMode mSeekMode; - int64_t mLatenessUs; - }; - - // Causes this source to suspend pulling data from its upstream source - // until a subsequent read-with-seek. Currently only supported by - // OMXCodec. - virtual status_t pause() { - return ERROR_UNSUPPORTED; - } - - // The consumer of this media source requests that the given buffers - // are to be returned exclusively in response to read calls. - // This will be called after a successful start() and before the - // first read() call. - // Callee assumes ownership of the buffers if no error is returned. - virtual status_t setBuffers(const Vector &buffers) { - return ERROR_UNSUPPORTED; - } - -protected: - virtual ~MediaSource(); - -private: - MediaSource(const MediaSource &); - MediaSource &operator=(const MediaSource &); -}; - -} // namespace android - -#endif // MEDIA_SOURCE_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/MediaWriter.h b/external/android/include/16/frameworks/av/include/media/stagefright/MediaWriter.h deleted file mode 100644 index 5cc8dcf..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/MediaWriter.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2010 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 MEDIA_WRITER_H_ - -#define MEDIA_WRITER_H_ - -#include -#include - -namespace android { - -struct MediaSource; -struct MetaData; - -struct MediaWriter : public RefBase { - MediaWriter() - : mMaxFileSizeLimitBytes(0), - mMaxFileDurationLimitUs(0) { - } - - virtual status_t addSource(const sp &source) = 0; - virtual bool reachedEOS() = 0; - virtual status_t start(MetaData *params = NULL) = 0; - virtual status_t stop() = 0; - virtual status_t pause() = 0; - - virtual void setMaxFileSize(int64_t bytes) { mMaxFileSizeLimitBytes = bytes; } - virtual void setMaxFileDuration(int64_t durationUs) { mMaxFileDurationLimitUs = durationUs; } - virtual void setListener(const sp& listener) { - mListener = listener; - } - - virtual status_t dump(int fd, const Vector& args) { - return OK; - } - -protected: - virtual ~MediaWriter() {} - int64_t mMaxFileSizeLimitBytes; - int64_t mMaxFileDurationLimitUs; - sp mListener; - - void notify(int msg, int ext1, int ext2) { - if (mListener != NULL) { - mListener->notify(msg, ext1, ext2); - } - } -private: - MediaWriter(const MediaWriter &); - MediaWriter &operator=(const MediaWriter &); -}; - -} // namespace android - -#endif // MEDIA_WRITER_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/MetaData.h b/external/android/include/16/frameworks/av/include/media/stagefright/MetaData.h deleted file mode 100644 index 3c25a14..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/MetaData.h +++ /dev/null @@ -1,264 +0,0 @@ -/* - * 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 META_DATA_H_ - -#define META_DATA_H_ - -#include - -#include - -#include -#include -#include - -namespace android { - -// The following keys map to int32_t data unless indicated otherwise. -enum { - kKeyMIMEType = 'mime', // cstring - kKeyWidth = 'widt', // int32_t, image pixel - kKeyHeight = 'heig', // int32_t, image pixel - kKeyDisplayWidth = 'dWid', // int32_t, display/presentation - kKeyDisplayHeight = 'dHgt', // int32_t, display/presentation - - // a rectangle, if absent assumed to be (0, 0, width - 1, height - 1) - kKeyCropRect = 'crop', - - kKeyRotation = 'rotA', // int32_t (angle in degrees) - kKeyIFramesInterval = 'ifiv', // int32_t - kKeyStride = 'strd', // int32_t - kKeySliceHeight = 'slht', // int32_t - kKeyChannelCount = '#chn', // int32_t - kKeyChannelMask = 'chnm', // int32_t - kKeySampleRate = 'srte', // int32_t (audio sampling rate Hz) - kKeyFrameRate = 'frmR', // int32_t (video frame rate fps) - kKeyBitRate = 'brte', // int32_t (bps) - kKeyESDS = 'esds', // raw data - kKeyAACProfile = 'aacp', // int32_t - kKeyAVCC = 'avcc', // raw data - kKeyD263 = 'd263', // raw data - kKeyVorbisInfo = 'vinf', // raw data - kKeyVorbisBooks = 'vboo', // raw data - kKeyWantsNALFragments = 'NALf', - kKeyIsSyncFrame = 'sync', // int32_t (bool) - kKeyIsCodecConfig = 'conf', // int32_t (bool) - kKeyTime = 'time', // int64_t (usecs) - kKeyDecodingTime = 'decT', // int64_t (decoding timestamp in usecs) - kKeyNTPTime = 'ntpT', // uint64_t (ntp-timestamp) - kKeyTargetTime = 'tarT', // int64_t (usecs) - kKeyDriftTime = 'dftT', // int64_t (usecs) - kKeyAnchorTime = 'ancT', // int64_t (usecs) - kKeyDuration = 'dura', // int64_t (usecs) - kKeyColorFormat = 'colf', - kKeyPlatformPrivate = 'priv', // pointer - kKeyDecoderComponent = 'decC', // cstring - kKeyBufferID = 'bfID', - kKeyMaxInputSize = 'inpS', - kKeyThumbnailTime = 'thbT', // int64_t (usecs) - kKeyTrackID = 'trID', - kKeyIsDRM = 'idrm', // int32_t (bool) - kKeyEncoderDelay = 'encd', // int32_t (frames) - kKeyEncoderPadding = 'encp', // int32_t (frames) - - kKeyAlbum = 'albu', // cstring - kKeyArtist = 'arti', // cstring - kKeyAlbumArtist = 'aart', // cstring - kKeyComposer = 'comp', // cstring - kKeyGenre = 'genr', // cstring - kKeyTitle = 'titl', // cstring - kKeyYear = 'year', // cstring - kKeyAlbumArt = 'albA', // compressed image data - kKeyAlbumArtMIME = 'alAM', // cstring - kKeyAuthor = 'auth', // cstring - kKeyCDTrackNumber = 'cdtr', // cstring - kKeyDiscNumber = 'dnum', // cstring - kKeyDate = 'date', // cstring - kKeyWriter = 'writ', // cstring - kKeyCompilation = 'cpil', // cstring - kKeyLocation = 'loc ', // cstring - kKeyTimeScale = 'tmsl', // int32_t - - // video profile and level - kKeyVideoProfile = 'vprf', // int32_t - kKeyVideoLevel = 'vlev', // int32_t - - // Set this key to enable authoring files in 64-bit offset - kKey64BitFileOffset = 'fobt', // int32_t (bool) - kKey2ByteNalLength = '2NAL', // int32_t (bool) - - // Identify the file output format for authoring - // Please see for the supported - // file output formats. - kKeyFileType = 'ftyp', // int32_t - - // Track authoring progress status - // kKeyTrackTimeStatus is used to track progress in elapsed time - kKeyTrackTimeStatus = 'tktm', // int64_t - - kKeyNotRealTime = 'ntrt', // bool (int32_t) - - // Ogg files can be tagged to be automatically looping... - kKeyAutoLoop = 'autL', // bool (int32_t) - - kKeyValidSamples = 'valD', // int32_t - - kKeyIsUnreadable = 'unre', // bool (int32_t) - - // An indication that a video buffer has been rendered. - kKeyRendered = 'rend', // bool (int32_t) - - // The language code for this media - kKeyMediaLanguage = 'lang', // cstring - - // To store the timed text format data - kKeyTextFormatData = 'text', // raw data - - kKeyRequiresSecureBuffers = 'secu', // bool (int32_t) - - kKeyIsADTS = 'adts', // bool (int32_t) - - // If a MediaBuffer's data represents (at least partially) encrypted - // data, the following fields aid in decryption. - // The data can be thought of as pairs of plain and encrypted data - // fragments, i.e. plain and encrypted data alternate. - // The first fragment is by convention plain data (if that's not the - // case, simply specify plain fragment size of 0). - // kKeyEncryptedSizes and kKeyPlainSizes each map to an array of - // size_t values. The sum total of all size_t values of both arrays - // must equal the amount of data (i.e. MediaBuffer's range_length()). - // If both arrays are present, they must be of the same size. - // If only encrypted sizes are present it is assumed that all - // plain sizes are 0, i.e. all fragments are encrypted. - // To programmatically set these array, use the MetaData::setData API, i.e. - // const size_t encSizes[]; - // meta->setData( - // kKeyEncryptedSizes, 0 /* type */, encSizes, sizeof(encSizes)); - // A plain sizes array by itself makes no sense. - kKeyEncryptedSizes = 'encr', // size_t[] - kKeyPlainSizes = 'plai', // size_t[] - kKeyCryptoKey = 'cryK', // uint8_t[16] - kKeyCryptoIV = 'cryI', // uint8_t[16] - kKeyCryptoMode = 'cryM', // int32_t -}; - -enum { - kTypeESDS = 'esds', - kTypeAVCC = 'avcc', - kTypeD263 = 'd263', -}; - -class MetaData : public RefBase { -public: - MetaData(); - MetaData(const MetaData &from); - - enum Type { - TYPE_NONE = 'none', - TYPE_C_STRING = 'cstr', - TYPE_INT32 = 'in32', - TYPE_INT64 = 'in64', - TYPE_FLOAT = 'floa', - TYPE_POINTER = 'ptr ', - TYPE_RECT = 'rect', - }; - - void clear(); - bool remove(uint32_t key); - - bool setCString(uint32_t key, const char *value); - bool setInt32(uint32_t key, int32_t value); - bool setInt64(uint32_t key, int64_t value); - bool setFloat(uint32_t key, float value); - bool setPointer(uint32_t key, void *value); - - bool setRect( - uint32_t key, - int32_t left, int32_t top, - int32_t right, int32_t bottom); - - bool findCString(uint32_t key, const char **value); - bool findInt32(uint32_t key, int32_t *value); - bool findInt64(uint32_t key, int64_t *value); - bool findFloat(uint32_t key, float *value); - bool findPointer(uint32_t key, void **value); - - bool findRect( - uint32_t key, - int32_t *left, int32_t *top, - int32_t *right, int32_t *bottom); - - bool setData(uint32_t key, uint32_t type, const void *data, size_t size); - - bool findData(uint32_t key, uint32_t *type, - const void **data, size_t *size) const; - - void dumpToLog() const; - -protected: - virtual ~MetaData(); - -private: - struct typed_data { - typed_data(); - ~typed_data(); - - typed_data(const MetaData::typed_data &); - typed_data &operator=(const MetaData::typed_data &); - - void clear(); - void setData(uint32_t type, const void *data, size_t size); - void getData(uint32_t *type, const void **data, size_t *size) const; - String8 asString() const; - - private: - uint32_t mType; - size_t mSize; - - union { - void *ext_data; - float reservoir; - } u; - - bool usesReservoir() const { - return mSize <= sizeof(u.reservoir); - } - - void allocateStorage(size_t size); - void freeStorage(); - - void *storage() { - return usesReservoir() ? &u.reservoir : u.ext_data; - } - - const void *storage() const { - return usesReservoir() ? &u.reservoir : u.ext_data; - } - }; - - struct Rect { - int32_t mLeft, mTop, mRight, mBottom; - }; - - KeyedVector mItems; - - // MetaData &operator=(const MetaData &); -}; - -} // namespace android - -#endif // META_DATA_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/NativeWindowWrapper.h b/external/android/include/16/frameworks/av/include/media/stagefright/NativeWindowWrapper.h deleted file mode 100644 index 97cc0ce..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/NativeWindowWrapper.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2011 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 NATIVE_WINDOW_WRAPPER_H_ - -#define NATIVE_WINDOW_WRAPPER_H_ - -#include - -namespace android { - -// SurfaceTextureClient derives from ANativeWindow which derives from multiple -// base classes, in order to carry it in AMessages, we'll temporarily wrap it -// into a NativeWindowWrapper. - -struct NativeWindowWrapper : RefBase { - NativeWindowWrapper( - const sp &surfaceTextureClient) : - mSurfaceTextureClient(surfaceTextureClient) { } - - sp getNativeWindow() const { - return mSurfaceTextureClient; - } - - sp getSurfaceTextureClient() const { - return mSurfaceTextureClient; - } - -private: - const sp mSurfaceTextureClient; - - DISALLOW_EVIL_CONSTRUCTORS(NativeWindowWrapper); -}; - -} // namespace android - -#endif // NATIVE_WINDOW_WRAPPER_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/NuMediaExtractor.h b/external/android/include/16/frameworks/av/include/media/stagefright/NuMediaExtractor.h deleted file mode 100644 index c9c709c..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/NuMediaExtractor.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 2012, 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 NU_MEDIA_EXTRACTOR_H_ -#define NU_MEDIA_EXTRACTOR_H_ - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace android { - -struct ABuffer; -struct AMessage; -struct DataSource; -struct MediaBuffer; -struct MediaExtractor; -struct MediaSource; -struct MetaData; - -struct NuMediaExtractor : public RefBase { - enum SampleFlags { - SAMPLE_FLAG_SYNC = 1, - SAMPLE_FLAG_ENCRYPTED = 2, - }; - - NuMediaExtractor(); - - status_t setDataSource( - const char *path, - const KeyedVector *headers = NULL); - - status_t setDataSource(int fd, off64_t offset, off64_t size); - - size_t countTracks() const; - status_t getTrackFormat(size_t index, sp *format) const; - - status_t selectTrack(size_t index); - status_t unselectTrack(size_t index); - - status_t seekTo( - int64_t timeUs, - MediaSource::ReadOptions::SeekMode mode = - MediaSource::ReadOptions::SEEK_CLOSEST_SYNC); - - status_t advance(); - status_t readSampleData(const sp &buffer); - status_t getSampleTrackIndex(size_t *trackIndex); - status_t getSampleTime(int64_t *sampleTimeUs); - status_t getSampleMeta(sp *sampleMeta); - - bool getCachedDuration(int64_t *durationUs, bool *eos) const; - -protected: - virtual ~NuMediaExtractor(); - -private: - enum TrackFlags { - kIsVorbis = 1, - }; - - struct TrackInfo { - sp mSource; - size_t mTrackIndex; - status_t mFinalResult; - MediaBuffer *mSample; - int64_t mSampleTimeUs; - - uint32_t mTrackFlags; // bitmask of "TrackFlags" - }; - - mutable Mutex mLock; - - sp mDataSource; - - sp mImpl; - bool mIsWidevineExtractor; - - Vector mSelectedTracks; - int64_t mTotalBitrate; // in bits/sec - int64_t mDurationUs; - - ssize_t fetchTrackSamples( - int64_t seekTimeUs = -1ll, - MediaSource::ReadOptions::SeekMode mode = - MediaSource::ReadOptions::SEEK_CLOSEST_SYNC); - - void releaseTrackSamples(); - - bool getTotalBitrate(int64_t *bitRate) const; - void updateDurationAndBitrate(); - - DISALLOW_EVIL_CONSTRUCTORS(NuMediaExtractor); -}; - -} // namespace android - -#endif // NU_MEDIA_EXTRACTOR_H_ - diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/OMXClient.h b/external/android/include/16/frameworks/av/include/media/stagefright/OMXClient.h deleted file mode 100644 index 2f14d06..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/OMXClient.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 OMX_CLIENT_H_ - -#define OMX_CLIENT_H_ - -#include - -namespace android { - -class OMXClient { -public: - OMXClient(); - - status_t connect(); - void disconnect(); - - sp interface() { - return mOMX; - } - -private: - sp mOMX; - - OMXClient(const OMXClient &); - OMXClient &operator=(const OMXClient &); -}; - -} // namespace android - -#endif // OMX_CLIENT_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/OMXCodec.h b/external/android/include/16/frameworks/av/include/media/stagefright/OMXCodec.h deleted file mode 100644 index 81350ca..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/OMXCodec.h +++ /dev/null @@ -1,399 +0,0 @@ -/* - * 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 OMX_CODEC_H_ - -#define OMX_CODEC_H_ - -#include -#include -#include -#include -#include - -#include - -namespace android { - -struct MediaCodecList; -class MemoryDealer; -struct OMXCodecObserver; -struct CodecProfileLevel; -class SkipCutBuffer; - -struct OMXCodec : public MediaSource, - public MediaBufferObserver { - enum CreationFlags { - kPreferSoftwareCodecs = 1, - kIgnoreCodecSpecificData = 2, - - // The client wants to access the output buffer's video - // data for example for thumbnail extraction. - kClientNeedsFramebuffer = 4, - - // Request for software or hardware codecs. If request - // can not be fullfilled, Create() returns NULL. - kSoftwareCodecsOnly = 8, - kHardwareCodecsOnly = 16, - - // Store meta data in video buffers - kStoreMetaDataInVideoBuffers = 32, - - // Only submit one input buffer at one time. - kOnlySubmitOneInputBufferAtOneTime = 64, - - // Enable GRALLOC_USAGE_PROTECTED for output buffers from native window - kEnableGrallocUsageProtected = 128, - - // Secure decoding mode - kUseSecureInputBuffers = 256, - }; - static sp Create( - const sp &omx, - const sp &meta, bool createEncoder, - const sp &source, - const char *matchComponentName = NULL, - uint32_t flags = 0, - const sp &nativeWindow = NULL); - - static void setComponentRole( - const sp &omx, IOMX::node_id node, bool isEncoder, - const char *mime); - - virtual status_t start(MetaData *params = NULL); - virtual status_t stop(); - - virtual sp getFormat(); - - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL); - - virtual status_t pause(); - - // from MediaBufferObserver - virtual void signalBufferReturned(MediaBuffer *buffer); - - enum Quirks { - kNeedsFlushBeforeDisable = 1, - kWantsNALFragments = 2, - kRequiresLoadedToIdleAfterAllocation = 4, - kRequiresAllocateBufferOnInputPorts = 8, - kRequiresFlushCompleteEmulation = 16, - kRequiresAllocateBufferOnOutputPorts = 32, - kRequiresFlushBeforeShutdown = 64, - kDefersOutputBufferAllocation = 128, - kDecoderLiesAboutNumberOfChannels = 256, - kInputBufferSizesAreBogus = 512, - kSupportsMultipleFramesPerInputBuffer = 1024, - kAvoidMemcopyInputRecordingFrames = 2048, - kRequiresLargerEncoderOutputBuffer = 4096, - kOutputBuffersAreUnreadable = 8192, - }; - - // for use by ACodec - static void findMatchingCodecs( - const char *mime, - bool createEncoder, const char *matchComponentName, - uint32_t flags, - Vector *matchingCodecs, - Vector *matchingCodecQuirks = NULL); - - static uint32_t getComponentQuirks( - const MediaCodecList *list, size_t index); - - static bool findCodecQuirks(const char *componentName, uint32_t *quirks); - -protected: - virtual ~OMXCodec(); - -private: - - // Make sure mLock is accessible to OMXCodecObserver - friend class OMXCodecObserver; - - // Call this with mLock hold - void on_message(const omx_message &msg); - - enum State { - DEAD, - LOADED, - LOADED_TO_IDLE, - IDLE_TO_EXECUTING, - EXECUTING, - EXECUTING_TO_IDLE, - IDLE_TO_LOADED, - RECONFIGURING, - ERROR - }; - - enum { - kPortIndexInput = 0, - kPortIndexOutput = 1 - }; - - enum PortStatus { - ENABLED, - DISABLING, - DISABLED, - ENABLING, - SHUTTING_DOWN, - }; - - enum BufferStatus { - OWNED_BY_US, - OWNED_BY_COMPONENT, - OWNED_BY_NATIVE_WINDOW, - OWNED_BY_CLIENT, - }; - - struct BufferInfo { - IOMX::buffer_id mBuffer; - BufferStatus mStatus; - sp mMem; - size_t mSize; - void *mData; - MediaBuffer *mMediaBuffer; - }; - - struct CodecSpecificData { - size_t mSize; - uint8_t mData[1]; - }; - - sp mOMX; - bool mOMXLivesLocally; - IOMX::node_id mNode; - uint32_t mQuirks; - - // Flags specified in the creation of the codec. - uint32_t mFlags; - - bool mIsEncoder; - bool mIsVideo; - char *mMIME; - char *mComponentName; - sp mOutputFormat; - sp mSource; - Vector mCodecSpecificData; - size_t mCodecSpecificDataIndex; - - sp mDealer[2]; - - State mState; - Vector mPortBuffers[2]; - PortStatus mPortStatus[2]; - bool mInitialBufferSubmit; - bool mSignalledEOS; - status_t mFinalStatus; - bool mNoMoreOutputData; - bool mOutputPortSettingsHaveChanged; - int64_t mSeekTimeUs; - ReadOptions::SeekMode mSeekMode; - int64_t mTargetTimeUs; - bool mOutputPortSettingsChangedPending; - sp mSkipCutBuffer; - - MediaBuffer *mLeftOverBuffer; - - Mutex mLock; - Condition mAsyncCompletion; - - bool mPaused; - - sp mNativeWindow; - - // The index in each of the mPortBuffers arrays of the buffer that will be - // submitted to OMX next. This only applies when using buffers from a - // native window. - size_t mNextNativeBufferIndex[2]; - - // A list of indices into mPortStatus[kPortIndexOutput] filled with data. - List mFilledBuffers; - Condition mBufferFilled; - - // Used to record the decoding time for an output picture from - // a video encoder. - List mDecodingTimeList; - - OMXCodec(const sp &omx, IOMX::node_id node, - uint32_t quirks, uint32_t flags, - bool isEncoder, const char *mime, const char *componentName, - const sp &source, - const sp &nativeWindow); - - void addCodecSpecificData(const void *data, size_t size); - void clearCodecSpecificData(); - - void setComponentRole(); - - void setAMRFormat(bool isWAMR, int32_t bitRate); - - status_t setAACFormat( - int32_t numChannels, int32_t sampleRate, int32_t bitRate, - int32_t aacProfile, bool isADTS); - - void setG711Format(int32_t numChannels); - - status_t setVideoPortFormatType( - OMX_U32 portIndex, - OMX_VIDEO_CODINGTYPE compressionFormat, - OMX_COLOR_FORMATTYPE colorFormat); - - void setVideoInputFormat( - const char *mime, const sp& meta); - - status_t setupBitRate(int32_t bitRate); - status_t setupErrorCorrectionParameters(); - status_t setupH263EncoderParameters(const sp& meta); - status_t setupMPEG4EncoderParameters(const sp& meta); - status_t setupAVCEncoderParameters(const sp& meta); - status_t findTargetColorFormat( - const sp& meta, OMX_COLOR_FORMATTYPE *colorFormat); - - status_t isColorFormatSupported( - OMX_COLOR_FORMATTYPE colorFormat, int portIndex); - - // If profile/level is set in the meta data, its value in the meta - // data will be used; otherwise, the default value will be used. - status_t getVideoProfileLevel(const sp& meta, - const CodecProfileLevel& defaultProfileLevel, - CodecProfileLevel& profileLevel); - - status_t setVideoOutputFormat( - const char *mime, OMX_U32 width, OMX_U32 height); - - void setImageOutputFormat( - OMX_COLOR_FORMATTYPE format, OMX_U32 width, OMX_U32 height); - - void setJPEGInputFormat( - OMX_U32 width, OMX_U32 height, OMX_U32 compressedSize); - - void setMinBufferSize(OMX_U32 portIndex, OMX_U32 size); - - void setRawAudioFormat( - OMX_U32 portIndex, int32_t sampleRate, int32_t numChannels); - - status_t allocateBuffers(); - status_t allocateBuffersOnPort(OMX_U32 portIndex); - status_t allocateOutputBuffersFromNativeWindow(); - - status_t queueBufferToNativeWindow(BufferInfo *info); - status_t cancelBufferToNativeWindow(BufferInfo *info); - BufferInfo* dequeueBufferFromNativeWindow(); - status_t pushBlankBuffersToNativeWindow(); - - status_t freeBuffersOnPort( - OMX_U32 portIndex, bool onlyThoseWeOwn = false); - - status_t freeBuffer(OMX_U32 portIndex, size_t bufIndex); - - bool drainInputBuffer(IOMX::buffer_id buffer); - void fillOutputBuffer(IOMX::buffer_id buffer); - bool drainInputBuffer(BufferInfo *info); - void fillOutputBuffer(BufferInfo *info); - - void drainInputBuffers(); - void fillOutputBuffers(); - - bool drainAnyInputBuffer(); - BufferInfo *findInputBufferByDataPointer(void *ptr); - BufferInfo *findEmptyInputBuffer(); - - // Returns true iff a flush was initiated and a completion event is - // upcoming, false otherwise (A flush was not necessary as we own all - // the buffers on that port). - // This method will ONLY ever return false for a component with quirk - // "kRequiresFlushCompleteEmulation". - bool flushPortAsync(OMX_U32 portIndex); - - void disablePortAsync(OMX_U32 portIndex); - status_t enablePortAsync(OMX_U32 portIndex); - - static size_t countBuffersWeOwn(const Vector &buffers); - static bool isIntermediateState(State state); - - void onEvent(OMX_EVENTTYPE event, OMX_U32 data1, OMX_U32 data2); - void onCmdComplete(OMX_COMMANDTYPE cmd, OMX_U32 data); - void onStateChange(OMX_STATETYPE newState); - void onPortSettingsChanged(OMX_U32 portIndex); - - void setState(State newState); - - status_t init(); - void initOutputFormat(const sp &inputFormat); - status_t initNativeWindow(); - - void initNativeWindowCrop(); - - void dumpPortStatus(OMX_U32 portIndex); - - status_t configureCodec(const sp &meta); - - void restorePatchedDataPointer(BufferInfo *info); - - status_t applyRotation(); - status_t waitForBufferFilled_l(); - - int64_t getDecodingTimeUs(); - - status_t parseAVCCodecSpecificData( - const void *data, size_t size, - unsigned *profile, unsigned *level); - - OMXCodec(const OMXCodec &); - OMXCodec &operator=(const OMXCodec &); -}; - -struct CodecCapabilities { - String8 mComponentName; - Vector mProfileLevels; - Vector mColorFormats; -}; - -// Return a vector of componentNames with supported profile/level pairs -// supporting the given mime type, if queryDecoders==true, returns components -// that decode content of the given type, otherwise returns components -// that encode content of the given type. -// profile and level indications only make sense for h.263, mpeg4 and avc -// video. -// If hwCodecOnly==true, only returns hardware-based components, software and -// hardware otherwise. -// The profile/level values correspond to -// OMX_VIDEO_H263PROFILETYPE, OMX_VIDEO_MPEG4PROFILETYPE, -// OMX_VIDEO_AVCPROFILETYPE, OMX_VIDEO_H263LEVELTYPE, OMX_VIDEO_MPEG4LEVELTYPE -// and OMX_VIDEO_AVCLEVELTYPE respectively. - -status_t QueryCodecs( - const sp &omx, - const char *mimeType, bool queryDecoders, bool hwCodecOnly, - Vector *results); - -status_t QueryCodecs( - const sp &omx, - const char *mimeType, bool queryDecoders, - Vector *results); - -status_t QueryCodec( - const sp &omx, - const char *componentName, const char *mime, - bool isEncoder, - CodecCapabilities *caps); - -status_t getOMXChannelMapping(size_t numChannels, OMX_AUDIO_CHANNELTYPE map[]); - -} // namespace android - -#endif // OMX_CODEC_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/SkipCutBuffer.h b/external/android/include/16/frameworks/av/include/media/stagefright/SkipCutBuffer.h deleted file mode 100644 index 2653b53..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/SkipCutBuffer.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2012 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 SKIP_CUT_BUFFER_H_ - -#define SKIP_CUT_BUFFER_H_ - -#include -#include - -namespace android { - -/** - * utility class to cut the start and end off a stream of data in MediaBuffers - * - */ -class SkipCutBuffer: public RefBase { - public: - // 'skip' is the number of bytes to skip from the beginning - // 'cut' is the number of bytes to cut from the end - SkipCutBuffer(int32_t skip, int32_t cut); - - // Submit one MediaBuffer for skipping and cutting. This may consume all or - // some of the data in the buffer, or it may add data to it. - // After this, the caller should continue processing the buffer as usual. - void submit(MediaBuffer *buffer); - void submit(const sp& buffer); // same as above, but with an ABuffer - void clear(); - size_t size(); // how many bytes are currently stored in the buffer - - protected: - virtual ~SkipCutBuffer(); - - private: - void write(const char *src, size_t num); - size_t read(char *dst, size_t num); - int32_t mFrontPadding; - int32_t mBackPadding; - int32_t mWriteHead; - int32_t mReadHead; - int32_t mCapacity; - char* mCutBuffer; - DISALLOW_EVIL_CONSTRUCTORS(SkipCutBuffer); -}; - -} // namespace android - -#endif // OMX_CODEC_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/StagefrightMediaScanner.h b/external/android/include/16/frameworks/av/include/media/stagefright/StagefrightMediaScanner.h deleted file mode 100644 index 6510a59..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/StagefrightMediaScanner.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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 STAGEFRIGHT_MEDIA_SCANNER_H_ - -#define STAGEFRIGHT_MEDIA_SCANNER_H_ - -#include - -namespace android { - -struct StagefrightMediaScanner : public MediaScanner { - StagefrightMediaScanner(); - virtual ~StagefrightMediaScanner(); - - virtual MediaScanResult processFile( - const char *path, const char *mimeType, - MediaScannerClient &client); - - virtual char *extractAlbumArt(int fd); - -private: - StagefrightMediaScanner(const StagefrightMediaScanner &); - StagefrightMediaScanner &operator=(const StagefrightMediaScanner &); - - MediaScanResult processFileInternal( - const char *path, const char *mimeType, - MediaScannerClient &client); -}; - -} // namespace android - -#endif // STAGEFRIGHT_MEDIA_SCANNER_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/SurfaceMediaSource.h b/external/android/include/16/frameworks/av/include/media/stagefright/SurfaceMediaSource.h deleted file mode 100644 index 4a8e221..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/SurfaceMediaSource.h +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Copyright (C) 2011 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_GUI_SURFACEMEDIASOURCE_H -#define ANDROID_GUI_SURFACEMEDIASOURCE_H - -#include -#include - -#include -#include -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class IGraphicBufferAlloc; -class String8; -class GraphicBuffer; - -// ASSUMPTIONS -// 1. SurfaceMediaSource is initialized with width*height which -// can never change. However, deqeueue buffer does not currently -// enforce this as in BufferQueue, dequeue can be used by SurfaceTexture -// which can modify the default width and heght. Also neither the width -// nor height can be 0. -// 2. setSynchronousMode is never used (basically no one should call -// setSynchronousMode(false) -// 3. setCrop, setTransform, setScalingMode should never be used -// 4. queueBuffer returns a filled buffer to the SurfaceMediaSource. In addition, a -// timestamp must be provided for the buffer. The timestamp is in -// nanoseconds, and must be monotonically increasing. Its other semantics -// (zero point, etc) are client-dependent and should be documented by the -// client. -// 5. Once disconnected, SurfaceMediaSource can be reused (can not -// connect again) -// 6. Stop is a hard stop, the last few frames held by the encoder -// may be dropped. It is possible to wait for the buffers to be -// returned (but not implemented) - -class SurfaceMediaSource : public MediaSource, - public MediaBufferObserver, - protected BufferQueue::ConsumerListener { -public: - enum { MIN_UNDEQUEUED_BUFFERS = 4}; - - struct FrameAvailableListener : public virtual RefBase { - // onFrameAvailable() is called from queueBuffer() is the FIFO is - // empty. You can use SurfaceMediaSource::getQueuedCount() to - // figure out if there are more frames waiting. - // This is called without any lock held can be called concurrently by - // multiple threads. - virtual void onFrameAvailable() = 0; - }; - - SurfaceMediaSource(uint32_t bufferWidth, uint32_t bufferHeight); - - virtual ~SurfaceMediaSource(); - - // For the MediaSource interface for use by StageFrightRecorder: - virtual status_t start(MetaData *params = NULL); - - virtual status_t stop() { return reset(); } - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL); - virtual sp getFormat(); - - // Get / Set the frame rate used for encoding. Default fps = 30 - status_t setFrameRate(int32_t fps) ; - int32_t getFrameRate( ) const; - - // The call for the StageFrightRecorder to tell us that - // it is done using the MediaBuffer data so that its state - // can be set to FREE for dequeuing - virtual void signalBufferReturned(MediaBuffer* buffer); - // end of MediaSource interface - - // getTimestamp retrieves the timestamp associated with the image - // set by the most recent call to read() - // - // The timestamp is in nanoseconds, and is monotonically increasing. Its - // other semantics (zero point, etc) are source-dependent and should be - // documented by the source. - int64_t getTimestamp(); - - // setFrameAvailableListener sets the listener object that will be notified - // when a new frame becomes available. - void setFrameAvailableListener(const sp& listener); - - // dump our state in a String - void dump(String8& result) const; - void dump(String8& result, const char* prefix, char* buffer, - size_t SIZE) const; - - // isMetaDataStoredInVideoBuffers tells the encoder whether we will - // pass metadata through the buffers. Currently, it is force set to true - bool isMetaDataStoredInVideoBuffers() const; - - sp getBufferQueue() const { return mBufferQueue; } - -protected: - - // Implementation of the BufferQueue::ConsumerListener interface. These - // calls are used to notify the SurfaceTexture of asynchronous events in the - // BufferQueue. - virtual void onFrameAvailable(); - - // Used as a hook to BufferQueue::disconnect() - // This is called by the client side when it is done - // TODO: Currently, this also sets mStopped to true which - // is needed for unblocking the encoder which might be - // waiting to read more frames. So if on the client side, - // the same thread supplies the frames and also calls stop - // on the encoder, the client has to call disconnect before - // it calls stop. - // In the case of the camera, - // that need not be required since the thread supplying the - // frames is separate than the one calling stop. - virtual void onBuffersReleased(); - - static bool isExternalFormat(uint32_t format); - -private: - // mBufferQueue is the exchange point between the producer and - // this consumer - sp mBufferQueue; - - // mBufferSlot caches GraphicBuffers from the buffer queue - sp mBufferSlot[BufferQueue::NUM_BUFFER_SLOTS]; - - - // The permenent width and height of SMS buffers - int mWidth; - int mHeight; - - // mCurrentSlot is the buffer slot index of the buffer that is currently - // being used by buffer consumer - // (e.g. StageFrightRecorder in the case of SurfaceMediaSource or GLTexture - // in the case of SurfaceTexture). - // It is initialized to INVALID_BUFFER_SLOT, - // indicating that no buffer slot is currently bound to the texture. Note, - // however, that a value of INVALID_BUFFER_SLOT does not necessarily mean - // that no buffer is bound to the texture. A call to setBufferCount will - // reset mCurrentTexture to INVALID_BUFFER_SLOT. - int mCurrentSlot; - - // mCurrentBuffers is a list of the graphic buffers that are being used by - // buffer consumer (i.e. the video encoder). It's possible that these - // buffers are not associated with any buffer slots, so we must track them - // separately. Buffers are added to this list in read, and removed from - // this list in signalBufferReturned - Vector > mCurrentBuffers; - - // mCurrentTimestamp is the timestamp for the current texture. It - // gets set to mLastQueuedTimestamp each time updateTexImage is called. - int64_t mCurrentTimestamp; - - // mFrameAvailableListener is the listener object that will be called when a - // new frame becomes available. If it is not NULL it will be called from - // queueBuffer. - sp mFrameAvailableListener; - - // mMutex is the mutex used to prevent concurrent access to the member - // variables of SurfaceMediaSource objects. It must be locked whenever the - // member variables are accessed. - mutable Mutex mMutex; - - ////////////////////////// For MediaSource - // Set to a default of 30 fps if not specified by the client side - int32_t mFrameRate; - - // mStopped is a flag to check if the recording is going on - bool mStopped; - - // mNumFramesReceived indicates the number of frames recieved from - // the client side - int mNumFramesReceived; - // mNumFramesEncoded indicates the number of frames passed on to the - // encoder - int mNumFramesEncoded; - - // mFirstFrameTimestamp is the timestamp of the first received frame. - // It is used to offset the output timestamps so recording starts at time 0. - int64_t mFirstFrameTimestamp; - // mStartTimeNs is the start time passed into the source at start, used to - // offset timestamps. - int64_t mStartTimeNs; - - // mFrameAvailableCondition condition used to indicate whether there - // is a frame available for dequeuing - Condition mFrameAvailableCondition; - - status_t reset(); - - // Avoid copying and equating and default constructor - DISALLOW_IMPLICIT_CONSTRUCTORS(SurfaceMediaSource); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_SURFACEMEDIASOURCE_H diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/TimeSource.h b/external/android/include/16/frameworks/av/include/media/stagefright/TimeSource.h deleted file mode 100644 index 443673d..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/TimeSource.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 TIME_SOURCE_H_ - -#define TIME_SOURCE_H_ - -#include - -namespace android { - -class TimeSource { -public: - TimeSource() {} - virtual ~TimeSource() {} - - virtual int64_t getRealTimeUs() = 0; - -private: - TimeSource(const TimeSource &); - TimeSource &operator=(const TimeSource &); -}; - -class SystemTimeSource : public TimeSource { -public: - SystemTimeSource(); - - virtual int64_t getRealTimeUs(); - -private: - static int64_t GetSystemTimeUs(); - - int64_t mStartTimeUs; -}; - -} // namespace android - -#endif // TIME_SOURCE_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/Utils.h b/external/android/include/16/frameworks/av/include/media/stagefright/Utils.h deleted file mode 100644 index d87902e..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/Utils.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 UTILS_H_ - -#define UTILS_H_ - -#include -#include -#include - -namespace android { - -#define FOURCC(c1, c2, c3, c4) \ - (c1 << 24 | c2 << 16 | c3 << 8 | c4) - -uint16_t U16_AT(const uint8_t *ptr); -uint32_t U32_AT(const uint8_t *ptr); -uint64_t U64_AT(const uint8_t *ptr); - -uint16_t U16LE_AT(const uint8_t *ptr); -uint32_t U32LE_AT(const uint8_t *ptr); -uint64_t U64LE_AT(const uint8_t *ptr); - -uint64_t ntoh64(uint64_t x); -uint64_t hton64(uint64_t x); - -struct MetaData; -struct AMessage; -status_t convertMetaDataToMessage( - const sp &meta, sp *format); - -} // namespace android - -#endif // UTILS_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/YUVCanvas.h b/external/android/include/16/frameworks/av/include/media/stagefright/YUVCanvas.h deleted file mode 100644 index ff70923..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/YUVCanvas.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -// YUVCanvas holds a reference to a YUVImage on which it can do various -// drawing operations. It provides various utility functions for filling, -// cropping, etc. - - -#ifndef YUV_CANVAS_H_ - -#define YUV_CANVAS_H_ - -#include - -namespace android { - -class YUVImage; -class Rect; - -class YUVCanvas { -public: - - // Constructor takes in reference to a yuvImage on which it can do - // various drawing opreations. - YUVCanvas(YUVImage &yuvImage); - ~YUVCanvas(); - - // Fills the entire image with the given YUV values. - void FillYUV(uint8_t yValue, uint8_t uValue, uint8_t vValue); - - // Fills the rectangular region [startX,endX]x[startY,endY] with the given YUV values. - void FillYUVRectangle(const Rect& rect, - uint8_t yValue, uint8_t uValue, uint8_t vValue); - - // Copies the region [startX,endX]x[startY,endY] from srcImage into the - // canvas' target image (mYUVImage) starting at - // (destinationStartX,destinationStartY). - // Note that undefined behavior may occur if srcImage is same as the canvas' - // target image. - void CopyImageRect( - const Rect& srcRect, - int32_t destStartX, int32_t destStartY, - const YUVImage &srcImage); - - // Downsamples the srcImage into the canvas' target image (mYUVImage) - // The downsampling copies pixels from the source image starting at - // (srcOffsetX, srcOffsetY) to the target image, starting at (0, 0). - // For each X increment in the target image, skipX pixels are skipped - // in the source image. - // Similarly for each Y increment in the target image, skipY pixels - // are skipped in the source image. - void downsample( - int32_t srcOffsetX, int32_t srcOffsetY, - int32_t skipX, int32_t skipY, - const YUVImage &srcImage); - -private: - YUVImage& mYUVImage; - - YUVCanvas(const YUVCanvas &); - YUVCanvas &operator=(const YUVCanvas &); -}; - -} // namespace android - -#endif // YUV_CANVAS_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/YUVImage.h b/external/android/include/16/frameworks/av/include/media/stagefright/YUVImage.h deleted file mode 100644 index 4e98618..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/YUVImage.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -// A container class to hold YUV data and provide various utilities, -// e.g. to set/get pixel values. -// Supported formats: -// - YUV420 Planar -// - YUV420 Semi Planar -// -// Currently does not support variable strides. -// -// Implementation: Two simple abstractions are done to simplify access -// to YUV channels for different formats: -// - initializeYUVPointers() sets up pointers (mYdata, mUdata, mVdata) to -// point to the right start locations of the different channel data depending -// on the format. -// - getOffsets() returns the correct offset for the different channels -// depending on the format. -// Location of any pixel's YUV channels can then be easily computed using these. -// - -#ifndef YUV_IMAGE_H_ - -#define YUV_IMAGE_H_ - -#include -#include - -namespace android { - -class Rect; - -class YUVImage { -public: - // Supported YUV formats - enum YUVFormat { - YUV420Planar, - YUV420SemiPlanar - }; - - // Constructs an image with the given size, format. Also allocates and owns - // the required memory. - YUVImage(YUVFormat yuvFormat, int32_t width, int32_t height); - - // Constructs an image with the given size, format. The memory is provided - // by the caller and we don't own it. - YUVImage(YUVFormat yuvFormat, int32_t width, int32_t height, uint8_t *buffer); - - // Destructor to delete the memory if it owns it. - ~YUVImage(); - - // Returns the size of the buffer required to store the YUV data for the given - // format and geometry. Useful when the caller wants to allocate the requisite - // memory. - static size_t bufferSize(YUVFormat yuvFormat, int32_t width, int32_t height); - - int32_t width() const {return mWidth;} - int32_t height() const {return mHeight;} - - // Returns true if pixel is the range [0, width-1] x [0, height-1] - // and false otherwise. - bool validPixel(int32_t x, int32_t y) const; - - // Get the pixel YUV value at pixel (x,y). - // Note that the range of x is [0, width-1] and the range of y is [0, height-1]. - // Returns true if get was successful and false otherwise. - bool getPixelValue(int32_t x, int32_t y, - uint8_t *yPtr, uint8_t *uPtr, uint8_t *vPtr) const; - - // Set the pixel YUV value at pixel (x,y). - // Note that the range of x is [0, width-1] and the range of y is [0, height-1]. - // Returns true if set was successful and false otherwise. - bool setPixelValue(int32_t x, int32_t y, - uint8_t yValue, uint8_t uValue, uint8_t vValue); - - // Uses memcpy to copy an entire row of data - static void fastCopyRectangle420Planar( - const Rect& srcRect, - int32_t destStartX, int32_t destStartY, - const YUVImage &srcImage, YUVImage &destImage); - - // Uses memcpy to copy an entire row of data - static void fastCopyRectangle420SemiPlanar( - const Rect& srcRect, - int32_t destStartX, int32_t destStartY, - const YUVImage &srcImage, YUVImage &destImage); - - // Tries to use memcopy to copy entire rows of data. - // Returns false if fast copy is not possible for the passed image formats. - static bool fastCopyRectangle( - const Rect& srcRect, - int32_t destStartX, int32_t destStartY, - const YUVImage &srcImage, YUVImage &destImage); - - // Convert the given YUV value to RGB. - void yuv2rgb(uint8_t yValue, uint8_t uValue, uint8_t vValue, - uint8_t *r, uint8_t *g, uint8_t *b) const; - - // Write the image to a human readable PPM file. - // Returns true if write was succesful and false otherwise. - bool writeToPPM(const char *filename) const; - -private: - // YUV Format of the image. - YUVFormat mYUVFormat; - - int32_t mWidth; - int32_t mHeight; - - // Pointer to the memory buffer. - uint8_t *mBuffer; - - // Boolean telling whether we own the memory buffer. - bool mOwnBuffer; - - // Pointer to start of the Y data plane. - uint8_t *mYdata; - - // Pointer to start of the U data plane. Note that in case of interleaved formats like - // YUV420 semiplanar, mUdata points to the start of the U data in the UV plane. - uint8_t *mUdata; - - // Pointer to start of the V data plane. Note that in case of interleaved formats like - // YUV420 semiplanar, mVdata points to the start of the V data in the UV plane. - uint8_t *mVdata; - - // Initialize the pointers mYdata, mUdata, mVdata to point to the right locations for - // the given format and geometry. - // Returns true if initialize was succesful and false otherwise. - bool initializeYUVPointers(); - - // For the given pixel location, this returns the offset of the location of y, u and v - // data from the corresponding base pointers -- mYdata, mUdata, mVdata. - // Note that the range of x is [0, width-1] and the range of y is [0, height-1]. - // Returns true if getting offsets was succesful and false otherwise. - bool getOffsets(int32_t x, int32_t y, - int32_t *yOffset, int32_t *uOffset, int32_t *vOffset) const; - - // Returns the offset increments incurred in going from one data row to the next data row - // for the YUV channels. Note that this corresponds to data rows and not pixel rows. - // E.g. depending on formats, U/V channels may have only one data row corresponding - // to two pixel rows. - bool getOffsetIncrementsPerDataRow( - int32_t *yDataOffsetIncrement, - int32_t *uDataOffsetIncrement, - int32_t *vDataOffsetIncrement) const; - - // Given the offset return the address of the corresponding channel's data. - uint8_t* getYAddress(int32_t offset) const; - uint8_t* getUAddress(int32_t offset) const; - uint8_t* getVAddress(int32_t offset) const; - - // Given the pixel location, returns the address of the corresponding channel's data. - // Note that the range of x is [0, width-1] and the range of y is [0, height-1]. - bool getYUVAddresses(int32_t x, int32_t y, - uint8_t **yAddr, uint8_t **uAddr, uint8_t **vAddr) const; - - // Disallow implicit casting and copying. - YUVImage(const YUVImage &); - YUVImage &operator=(const YUVImage &); -}; - -} // namespace android - -#endif // YUV_IMAGE_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/AAtomizer.h b/external/android/include/16/frameworks/av/include/media/stagefright/foundation/AAtomizer.h deleted file mode 100644 index 5f3a678..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/AAtomizer.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2010 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 A_ATOMIZER_H_ - -#define A_ATOMIZER_H_ - -#include - -#include -#include -#include -#include -#include - -namespace android { - -struct AAtomizer { - static const char *Atomize(const char *name); - -private: - static AAtomizer gAtomizer; - - Mutex mLock; - Vector > mAtoms; - - AAtomizer(); - - const char *atomize(const char *name); - - static uint32_t Hash(const char *s); - - DISALLOW_EVIL_CONSTRUCTORS(AAtomizer); -}; - -} // namespace android - -#endif // A_ATOMIZER_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/ABase.h b/external/android/include/16/frameworks/av/include/media/stagefright/foundation/ABase.h deleted file mode 100644 index 9eceea3..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/ABase.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2010 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 A_BASE_H_ - -#define A_BASE_H_ - -#define DISALLOW_EVIL_CONSTRUCTORS(name) \ - name(const name &); \ - name &operator=(const name &) - -#endif // A_BASE_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/ABitReader.h b/external/android/include/16/frameworks/av/include/media/stagefright/foundation/ABitReader.h deleted file mode 100644 index 5510b12..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/ABitReader.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2010 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 A_BIT_READER_H_ - -#define A_BIT_READER_H_ - -#include - -#include -#include - -namespace android { - -struct ABitReader { - ABitReader(const uint8_t *data, size_t size); - - uint32_t getBits(size_t n); - void skipBits(size_t n); - - void putBits(uint32_t x, size_t n); - - size_t numBitsLeft() const; - - const uint8_t *data() const; - -private: - const uint8_t *mData; - size_t mSize; - - uint32_t mReservoir; // left-aligned bits - size_t mNumBitsLeft; - - void fillReservoir(); - - DISALLOW_EVIL_CONSTRUCTORS(ABitReader); -}; - -} // namespace android - -#endif // A_BIT_READER_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/ABuffer.h b/external/android/include/16/frameworks/av/include/media/stagefright/foundation/ABuffer.h deleted file mode 100644 index 28f0aed..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/ABuffer.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2010 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 A_BUFFER_H_ - -#define A_BUFFER_H_ - -#include -#include - -#include -#include - -namespace android { - -struct AMessage; - -struct ABuffer : public RefBase { - ABuffer(size_t capacity); - ABuffer(void *data, size_t capacity); - - void setFarewellMessage(const sp msg); - - uint8_t *base() { return (uint8_t *)mData; } - uint8_t *data() { return (uint8_t *)mData + mRangeOffset; } - size_t capacity() const { return mCapacity; } - size_t size() const { return mRangeLength; } - size_t offset() const { return mRangeOffset; } - - void setRange(size_t offset, size_t size); - - void setInt32Data(int32_t data) { mInt32Data = data; } - int32_t int32Data() const { return mInt32Data; } - - sp meta(); - -protected: - virtual ~ABuffer(); - -private: - sp mFarewell; - sp mMeta; - - void *mData; - size_t mCapacity; - size_t mRangeOffset; - size_t mRangeLength; - - int32_t mInt32Data; - - bool mOwnsData; - - DISALLOW_EVIL_CONSTRUCTORS(ABuffer); -}; - -} // namespace android - -#endif // A_BUFFER_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/ADebug.h b/external/android/include/16/frameworks/av/include/media/stagefright/foundation/ADebug.h deleted file mode 100644 index 450dcfe..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/ADebug.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2010 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 A_DEBUG_H_ - -#define A_DEBUG_H_ - -#include - -#include -#include -#include - -namespace android { - -#define LITERAL_TO_STRING_INTERNAL(x) #x -#define LITERAL_TO_STRING(x) LITERAL_TO_STRING_INTERNAL(x) - -#define CHECK(condition) \ - LOG_ALWAYS_FATAL_IF( \ - !(condition), \ - "%s", \ - __FILE__ ":" LITERAL_TO_STRING(__LINE__) \ - " CHECK(" #condition ") failed.") - -#define MAKE_COMPARATOR(suffix,op) \ - template \ - AString Compare_##suffix(const A &a, const B &b) { \ - AString res; \ - if (!(a op b)) { \ - res.append(a); \ - res.append(" vs. "); \ - res.append(b); \ - } \ - return res; \ - } - -MAKE_COMPARATOR(EQ,==) -MAKE_COMPARATOR(NE,!=) -MAKE_COMPARATOR(LE,<=) -MAKE_COMPARATOR(GE,>=) -MAKE_COMPARATOR(LT,<) -MAKE_COMPARATOR(GT,>) - -#define CHECK_OP(x,y,suffix,op) \ - do { \ - AString ___res = Compare_##suffix(x, y); \ - if (!___res.empty()) { \ - AString ___full = \ - __FILE__ ":" LITERAL_TO_STRING(__LINE__) \ - " CHECK_" #suffix "( " #x "," #y ") failed: "; \ - ___full.append(___res); \ - \ - LOG_ALWAYS_FATAL("%s", ___full.c_str()); \ - } \ - } while (false) - -#define CHECK_EQ(x,y) CHECK_OP(x,y,EQ,==) -#define CHECK_NE(x,y) CHECK_OP(x,y,NE,!=) -#define CHECK_LE(x,y) CHECK_OP(x,y,LE,<=) -#define CHECK_LT(x,y) CHECK_OP(x,y,LT,<) -#define CHECK_GE(x,y) CHECK_OP(x,y,GE,>=) -#define CHECK_GT(x,y) CHECK_OP(x,y,GT,>) - -#define TRESPASS() \ - LOG_ALWAYS_FATAL( \ - __FILE__ ":" LITERAL_TO_STRING(__LINE__) \ - " Should not be here."); - -} // namespace android - -#endif // A_DEBUG_H_ - diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/AHandler.h b/external/android/include/16/frameworks/av/include/media/stagefright/foundation/AHandler.h deleted file mode 100644 index b008b54..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/AHandler.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2010 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 A_HANDLER_H_ - -#define A_HANDLER_H_ - -#include -#include - -namespace android { - -struct AMessage; - -struct AHandler : public RefBase { - AHandler() - : mID(0) { - } - - ALooper::handler_id id() const { - return mID; - } - - sp looper(); - -protected: - virtual void onMessageReceived(const sp &msg) = 0; - -private: - friend struct ALooperRoster; - - ALooper::handler_id mID; - - void setID(ALooper::handler_id id) { - mID = id; - } - - DISALLOW_EVIL_CONSTRUCTORS(AHandler); -}; - -} // namespace android - -#endif // A_HANDLER_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/AHandlerReflector.h b/external/android/include/16/frameworks/av/include/media/stagefright/foundation/AHandlerReflector.h deleted file mode 100644 index 9d201b5..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/AHandlerReflector.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2010 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 A_HANDLER_REFLECTOR_H_ - -#define A_HANDLER_REFLECTOR_H_ - -#include - -namespace android { - -template -struct AHandlerReflector : public AHandler { - AHandlerReflector(T *target) - : mTarget(target) { - } - -protected: - virtual void onMessageReceived(const sp &msg) { - sp target = mTarget.promote(); - if (target != NULL) { - target->onMessageReceived(msg); - } - } - -private: - wp mTarget; - - AHandlerReflector(const AHandlerReflector &); - AHandlerReflector &operator=(const AHandlerReflector &); -}; - -} // namespace android - -#endif // A_HANDLER_REFLECTOR_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/AHierarchicalStateMachine.h b/external/android/include/16/frameworks/av/include/media/stagefright/foundation/AHierarchicalStateMachine.h deleted file mode 100644 index d2e6b28..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/AHierarchicalStateMachine.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2010 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 A_HIERARCHICAL_STATE_MACHINE_H_ - -#define A_HIERARCHICAL_STATE_MACHINE_H_ - -#include - -namespace android { - -struct AState : public RefBase { - AState(const sp &parentState = NULL); - - sp parentState(); - -protected: - virtual ~AState(); - - virtual void stateEntered(); - virtual void stateExited(); - - virtual bool onMessageReceived(const sp &msg) = 0; - -private: - friend struct AHierarchicalStateMachine; - - sp mParentState; - - DISALLOW_EVIL_CONSTRUCTORS(AState); -}; - -struct AHierarchicalStateMachine : public AHandler { - AHierarchicalStateMachine(); - -protected: - virtual ~AHierarchicalStateMachine(); - - virtual void onMessageReceived(const sp &msg); - - // Only to be called in response to a message. - void changeState(const sp &state); - -private: - sp mState; - - DISALLOW_EVIL_CONSTRUCTORS(AHierarchicalStateMachine); -}; - -} // namespace android - -#endif // A_HIERARCHICAL_STATE_MACHINE_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/ALooper.h b/external/android/include/16/frameworks/av/include/media/stagefright/foundation/ALooper.h deleted file mode 100644 index 70e0c5e..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/ALooper.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2010 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 A_LOOPER_H_ - -#define A_LOOPER_H_ - -#include -#include -#include -#include -#include -#include -#include - -namespace android { - -struct AHandler; -struct AMessage; - -struct ALooper : public RefBase { - typedef int32_t event_id; - typedef int32_t handler_id; - - ALooper(); - - // Takes effect in a subsequent call to start(). - void setName(const char *name); - - handler_id registerHandler(const sp &handler); - void unregisterHandler(handler_id handlerID); - - status_t start( - bool runOnCallingThread = false, - bool canCallJava = false, - int32_t priority = PRIORITY_DEFAULT - ); - - status_t stop(); - - static int64_t GetNowUs(); - -protected: - virtual ~ALooper(); - -private: - friend struct ALooperRoster; - - struct Event { - int64_t mWhenUs; - sp mMessage; - }; - - Mutex mLock; - Condition mQueueChangedCondition; - - AString mName; - - List mEventQueue; - - struct LooperThread; - sp mThread; - bool mRunningLocally; - - void post(const sp &msg, int64_t delayUs); - bool loop(); - - DISALLOW_EVIL_CONSTRUCTORS(ALooper); -}; - -} // namespace android - -#endif // A_LOOPER_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/ALooperRoster.h b/external/android/include/16/frameworks/av/include/media/stagefright/foundation/ALooperRoster.h deleted file mode 100644 index 2e5fd73..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/ALooperRoster.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2010 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 A_LOOPER_ROSTER_H_ - -#define A_LOOPER_ROSTER_H_ - -#include -#include - -namespace android { - -struct ALooperRoster { - ALooperRoster(); - - ALooper::handler_id registerHandler( - const sp looper, const sp &handler); - - void unregisterHandler(ALooper::handler_id handlerID); - - status_t postMessage(const sp &msg, int64_t delayUs = 0); - void deliverMessage(const sp &msg); - - status_t postAndAwaitResponse( - const sp &msg, sp *response); - - void postReply(uint32_t replyID, const sp &reply); - - sp findLooper(ALooper::handler_id handlerID); - -private: - struct HandlerInfo { - wp mLooper; - wp mHandler; - }; - - Mutex mLock; - KeyedVector mHandlers; - ALooper::handler_id mNextHandlerID; - uint32_t mNextReplyID; - Condition mRepliesCondition; - - KeyedVector > mReplies; - - status_t postMessage_l(const sp &msg, int64_t delayUs); - - DISALLOW_EVIL_CONSTRUCTORS(ALooperRoster); -}; - -} // namespace android - -#endif // A_LOOPER_ROSTER_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/AMessage.h b/external/android/include/16/frameworks/av/include/media/stagefright/foundation/AMessage.h deleted file mode 100644 index 7e823eb..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/AMessage.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (C) 2010 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 A_MESSAGE_H_ - -#define A_MESSAGE_H_ - -#include -#include -#include -#include - -namespace android { - -struct ABuffer; -struct AString; -struct Parcel; - -struct AMessage : public RefBase { - AMessage(uint32_t what = 0, ALooper::handler_id target = 0); - - static sp FromParcel(const Parcel &parcel); - void writeToParcel(Parcel *parcel) const; - - void setWhat(uint32_t what); - uint32_t what() const; - - void setTarget(ALooper::handler_id target); - ALooper::handler_id target() const; - - void clear(); - - void setInt32(const char *name, int32_t value); - void setInt64(const char *name, int64_t value); - void setSize(const char *name, size_t value); - void setFloat(const char *name, float value); - void setDouble(const char *name, double value); - void setPointer(const char *name, void *value); - void setString(const char *name, const char *s, ssize_t len = -1); - void setObject(const char *name, const sp &obj); - void setBuffer(const char *name, const sp &buffer); - void setMessage(const char *name, const sp &obj); - - void setRect( - const char *name, - int32_t left, int32_t top, int32_t right, int32_t bottom); - - bool findInt32(const char *name, int32_t *value) const; - bool findInt64(const char *name, int64_t *value) const; - bool findSize(const char *name, size_t *value) const; - bool findFloat(const char *name, float *value) const; - bool findDouble(const char *name, double *value) const; - bool findPointer(const char *name, void **value) const; - bool findString(const char *name, AString *value) const; - bool findObject(const char *name, sp *obj) const; - bool findBuffer(const char *name, sp *buffer) const; - bool findMessage(const char *name, sp *obj) const; - - bool findRect( - const char *name, - int32_t *left, int32_t *top, int32_t *right, int32_t *bottom) const; - - void post(int64_t delayUs = 0); - - // Posts the message to its target and waits for a response (or error) - // before returning. - status_t postAndAwaitResponse(sp *response); - - // If this returns true, the sender of this message is synchronously - // awaiting a response, the "replyID" can be used to send the response - // via "postReply" below. - bool senderAwaitsResponse(uint32_t *replyID) const; - - void postReply(uint32_t replyID); - - // Performs a deep-copy of "this", contained messages are in turn "dup'ed". - // Warning: RefBase items, i.e. "objects" are _not_ copied but only have - // their refcount incremented. - sp dup() const; - - AString debugString(int32_t indent = 0) const; - - enum Type { - kTypeInt32, - kTypeInt64, - kTypeSize, - kTypeFloat, - kTypeDouble, - kTypePointer, - kTypeString, - kTypeObject, - kTypeMessage, - kTypeRect, - kTypeBuffer, - }; - - size_t countEntries() const; - const char *getEntryNameAt(size_t index, Type *type) const; - -protected: - virtual ~AMessage(); - -private: - uint32_t mWhat; - ALooper::handler_id mTarget; - - struct Rect { - int32_t mLeft, mTop, mRight, mBottom; - }; - - struct Item { - union { - int32_t int32Value; - int64_t int64Value; - size_t sizeValue; - float floatValue; - double doubleValue; - void *ptrValue; - RefBase *refValue; - AString *stringValue; - Rect rectValue; - } u; - const char *mName; - Type mType; - }; - - enum { - kMaxNumItems = 64 - }; - Item mItems[kMaxNumItems]; - size_t mNumItems; - - Item *allocateItem(const char *name); - void freeItem(Item *item); - const Item *findItem(const char *name, Type type) const; - - void setObjectInternal( - const char *name, const sp &obj, Type type); - - DISALLOW_EVIL_CONSTRUCTORS(AMessage); -}; - -} // namespace android - -#endif // A_MESSAGE_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/AString.h b/external/android/include/16/frameworks/av/include/media/stagefright/foundation/AString.h deleted file mode 100644 index 0f8f1e1..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/AString.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (C) 2010 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 A_STRING_H_ - -#define A_STRING_H_ - -#include - -namespace android { - -struct AString { - AString(); - AString(const char *s); - AString(const char *s, size_t size); - AString(const AString &from); - AString(const AString &from, size_t offset, size_t n); - ~AString(); - - AString &operator=(const AString &from); - void setTo(const char *s); - void setTo(const char *s, size_t size); - void setTo(const AString &from, size_t offset, size_t n); - - size_t size() const; - const char *c_str() const; - - bool empty() const; - - void clear(); - void trim(); - void erase(size_t start, size_t n); - - void append(char c) { append(&c, 1); } - void append(const char *s); - void append(const char *s, size_t size); - void append(const AString &from); - void append(const AString &from, size_t offset, size_t n); - void append(int x); - void append(unsigned x); - void append(long x); - void append(unsigned long x); - void append(long long x); - void append(unsigned long long x); - void append(float x); - void append(double x); - void append(void *x); - - void insert(const AString &from, size_t insertionPos); - void insert(const char *from, size_t size, size_t insertionPos); - - ssize_t find(const char *substring, size_t start = 0) const; - - size_t hash() const; - - bool operator==(const AString &other) const; - bool operator<(const AString &other) const; - bool operator>(const AString &other) const; - - int compare(const AString &other) const; - - bool startsWith(const char *prefix) const; - bool endsWith(const char *suffix) const; - - void tolower(); - -private: - static const char *kEmptyString; - - char *mData; - size_t mSize; - size_t mAllocSize; - - void makeMutable(); -}; - -AString StringPrintf(const char *format, ...); - -} // namespace android - -#endif // A_STRING_H_ - diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/base64.h b/external/android/include/16/frameworks/av/include/media/stagefright/foundation/base64.h deleted file mode 100644 index e340b89..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/base64.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2010 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 BASE_64_H_ - -#define BASE_64_H_ - -#include - -namespace android { - -struct ABuffer; -struct AString; - -sp decodeBase64(const AString &s); -void encodeBase64(const void *data, size_t size, AString *out); - -} // namespace android - -#endif // BASE_64_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/hexdump.h b/external/android/include/16/frameworks/av/include/media/stagefright/foundation/hexdump.h deleted file mode 100644 index f6083a9..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/foundation/hexdump.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2010 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 HEXDUMP_H_ - -#define HEXDUMP_H_ - -#include - -namespace android { - -void hexdump(const void *_data, size_t size); - -} // namespace android - -#endif // HEXDUMP_H_ diff --git a/external/android/include/16/frameworks/av/include/media/stagefright/timedtext/TimedTextDriver.h b/external/android/include/16/frameworks/av/include/media/stagefright/timedtext/TimedTextDriver.h deleted file mode 100644 index cde551b..0000000 --- a/external/android/include/16/frameworks/av/include/media/stagefright/timedtext/TimedTextDriver.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (C) 2012 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 TIMED_TEXT_DRIVER_H_ -#define TIMED_TEXT_DRIVER_H_ - -#include // for DISALLOW_* macro -#include // for status_t -#include -#include - -namespace android { - -class ALooper; -class MediaPlayerBase; -class MediaSource; -class Parcel; -class TimedTextPlayer; -class TimedTextSource; -class DataSource; - -class TimedTextDriver { -public: - TimedTextDriver(const wp &listener); - - ~TimedTextDriver(); - - status_t start(); - status_t pause(); - status_t selectTrack(size_t index); - status_t unselectTrack(size_t index); - - status_t seekToAsync(int64_t timeUs); - - status_t addInBandTextSource( - size_t trackIndex, const sp& source); - - status_t addOutOfBandTextSource( - size_t trackIndex, const char *uri, const char *mimeType); - - // Caller owns the file desriptor and caller is responsible for closing it. - status_t addOutOfBandTextSource( - size_t trackIndex, int fd, off64_t offset, - off64_t length, const char *mimeType); - - void getExternalTrackInfo(Parcel *parcel); - size_t countExternalTracks() const; - -private: - Mutex mLock; - - enum State { - UNINITIALIZED, - PLAYING, - PAUSED, - }; - - enum TextSourceType { - TEXT_SOURCE_TYPE_IN_BAND = 0, - TEXT_SOURCE_TYPE_OUT_OF_BAND, - }; - - sp mLooper; - sp mPlayer; - wp mListener; - - // Variables to be guarded by mLock. - State mState; - size_t mCurrentTrackIndex; - KeyedVector > mTextSourceVector; - Vector mTextSourceTypeVector; - - // -- End of variables to be guarded by mLock - - status_t selectTrack_l(size_t index); - - status_t createOutOfBandTextSource( - size_t trackIndex, const char* mimeType, - const sp& dataSource); - - DISALLOW_EVIL_CONSTRUCTORS(TimedTextDriver); -}; - -} // namespace android - -#endif // TIMED_TEXT_DRIVER_H_ diff --git a/external/android/include/16/frameworks/native/include/binder/Binder.h b/external/android/include/16/frameworks/native/include/binder/Binder.h deleted file mode 100644 index ba3ac4b..0000000 --- a/external/android/include/16/frameworks/native/include/binder/Binder.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_BINDER_H -#define ANDROID_BINDER_H - -#include - -// --------------------------------------------------------------------------- -namespace android { - -class BBinder : public IBinder -{ -public: - BBinder(); - - virtual const String16& getInterfaceDescriptor() const; - virtual bool isBinderAlive() const; - virtual status_t pingBinder(); - virtual status_t dump(int fd, const Vector& args); - - virtual status_t transact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); - - virtual status_t linkToDeath(const sp& recipient, - void* cookie = NULL, - uint32_t flags = 0); - - virtual status_t unlinkToDeath( const wp& recipient, - void* cookie = NULL, - uint32_t flags = 0, - wp* outRecipient = NULL); - - virtual void attachObject( const void* objectID, - void* object, - void* cleanupCookie, - object_cleanup_func func); - virtual void* findObject(const void* objectID) const; - virtual void detachObject(const void* objectID); - - virtual BBinder* localBinder(); - -protected: - virtual ~BBinder(); - - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); - -private: - BBinder(const BBinder& o); - BBinder& operator=(const BBinder& o); - - class Extras; - - Extras* mExtras; - void* mReserved0; -}; - -// --------------------------------------------------------------------------- - -class BpRefBase : public virtual RefBase -{ -protected: - BpRefBase(const sp& o); - virtual ~BpRefBase(); - virtual void onFirstRef(); - virtual void onLastStrongRef(const void* id); - virtual bool onIncStrongAttempted(uint32_t flags, const void* id); - - inline IBinder* remote() { return mRemote; } - inline IBinder* remote() const { return mRemote; } - -private: - BpRefBase(const BpRefBase& o); - BpRefBase& operator=(const BpRefBase& o); - - IBinder* const mRemote; - RefBase::weakref_type* mRefs; - volatile int32_t mState; -}; - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_BINDER_H diff --git a/external/android/include/16/frameworks/native/include/binder/BinderService.h b/external/android/include/16/frameworks/native/include/binder/BinderService.h deleted file mode 100644 index 6460268..0000000 --- a/external/android/include/16/frameworks/native/include/binder/BinderService.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2010 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_BINDER_SERVICE_H -#define ANDROID_BINDER_SERVICE_H - -#include - -#include -#include - -#include -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -template -class BinderService -{ -public: - static status_t publish(bool allowIsolated = false) { - sp sm(defaultServiceManager()); - return sm->addService(String16(SERVICE::getServiceName()), new SERVICE(), allowIsolated); - } - - static void publishAndJoinThreadPool(bool allowIsolated = false) { - sp sm(defaultServiceManager()); - sm->addService(String16(SERVICE::getServiceName()), new SERVICE(), allowIsolated); - ProcessState::self()->startThreadPool(); - IPCThreadState::self()->joinThreadPool(); - } - - static void instantiate() { publish(); } - - static status_t shutdown() { - return NO_ERROR; - } -}; - - -}; // namespace android -// --------------------------------------------------------------------------- -#endif // ANDROID_BINDER_SERVICE_H diff --git a/external/android/include/16/frameworks/native/include/binder/BpBinder.h b/external/android/include/16/frameworks/native/include/binder/BpBinder.h deleted file mode 100644 index 7ef93aa..0000000 --- a/external/android/include/16/frameworks/native/include/binder/BpBinder.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (C) 2005 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_BPBINDER_H -#define ANDROID_BPBINDER_H - -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -class BpBinder : public IBinder -{ -public: - BpBinder(int32_t handle); - - inline int32_t handle() const { return mHandle; } - - virtual const String16& getInterfaceDescriptor() const; - virtual bool isBinderAlive() const; - virtual status_t pingBinder(); - virtual status_t dump(int fd, const Vector& args); - - virtual status_t transact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); - - virtual status_t linkToDeath(const sp& recipient, - void* cookie = NULL, - uint32_t flags = 0); - virtual status_t unlinkToDeath( const wp& recipient, - void* cookie = NULL, - uint32_t flags = 0, - wp* outRecipient = NULL); - - virtual void attachObject( const void* objectID, - void* object, - void* cleanupCookie, - object_cleanup_func func); - virtual void* findObject(const void* objectID) const; - virtual void detachObject(const void* objectID); - - virtual BpBinder* remoteBinder(); - - status_t setConstantData(const void* data, size_t size); - void sendObituary(); - - class ObjectManager - { - public: - ObjectManager(); - ~ObjectManager(); - - void attach( const void* objectID, - void* object, - void* cleanupCookie, - IBinder::object_cleanup_func func); - void* find(const void* objectID) const; - void detach(const void* objectID); - - void kill(); - - private: - ObjectManager(const ObjectManager&); - ObjectManager& operator=(const ObjectManager&); - - struct entry_t - { - void* object; - void* cleanupCookie; - IBinder::object_cleanup_func func; - }; - - KeyedVector mObjects; - }; - -protected: - virtual ~BpBinder(); - virtual void onFirstRef(); - virtual void onLastStrongRef(const void* id); - virtual bool onIncStrongAttempted(uint32_t flags, const void* id); - -private: - const int32_t mHandle; - - struct Obituary { - wp recipient; - void* cookie; - uint32_t flags; - }; - - void reportOneDeath(const Obituary& obit); - bool isDescriptorCached() const; - - mutable Mutex mLock; - volatile int32_t mAlive; - volatile int32_t mObitsSent; - Vector* mObituaries; - ObjectManager mObjects; - Parcel* mConstantData; - mutable String16 mDescriptorCache; -}; - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_BPBINDER_H diff --git a/external/android/include/16/frameworks/native/include/binder/IBinder.h b/external/android/include/16/frameworks/native/include/binder/IBinder.h deleted file mode 100644 index 8b84951..0000000 --- a/external/android/include/16/frameworks/native/include/binder/IBinder.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_IBINDER_H -#define ANDROID_IBINDER_H - -#include -#include -#include -#include - - -#define B_PACK_CHARS(c1, c2, c3, c4) \ - ((((c1)<<24)) | (((c2)<<16)) | (((c3)<<8)) | (c4)) - -// --------------------------------------------------------------------------- -namespace android { - -class BBinder; -class BpBinder; -class IInterface; -class Parcel; - -/** - * Base class and low-level protocol for a remotable object. - * You can derive from this class to create an object for which other - * processes can hold references to it. Communication between processes - * (method calls, property get and set) is down through a low-level - * protocol implemented on top of the transact() API. - */ -class IBinder : public virtual RefBase -{ -public: - enum { - FIRST_CALL_TRANSACTION = 0x00000001, - LAST_CALL_TRANSACTION = 0x00ffffff, - - PING_TRANSACTION = B_PACK_CHARS('_','P','N','G'), - DUMP_TRANSACTION = B_PACK_CHARS('_','D','M','P'), - INTERFACE_TRANSACTION = B_PACK_CHARS('_', 'N', 'T', 'F'), - SYSPROPS_TRANSACTION = B_PACK_CHARS('_', 'S', 'P', 'R'), - - // Corresponds to TF_ONE_WAY -- an asynchronous call. - FLAG_ONEWAY = 0x00000001 - }; - - IBinder(); - - /** - * Check if this IBinder implements the interface named by - * @a descriptor. If it does, the base pointer to it is returned, - * which you can safely static_cast<> to the concrete C++ interface. - */ - virtual sp queryLocalInterface(const String16& descriptor); - - /** - * Return the canonical name of the interface provided by this IBinder - * object. - */ - virtual const String16& getInterfaceDescriptor() const = 0; - - virtual bool isBinderAlive() const = 0; - virtual status_t pingBinder() = 0; - virtual status_t dump(int fd, const Vector& args) = 0; - - virtual status_t transact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0) = 0; - - /** - * This method allows you to add data that is transported through - * IPC along with your IBinder pointer. When implementing a Binder - * object, override it to write your desired data in to @a outData. - * You can then call getConstantData() on your IBinder to retrieve - * that data, from any process. You MUST return the number of bytes - * written in to the parcel (including padding). - */ - class DeathRecipient : public virtual RefBase - { - public: - virtual void binderDied(const wp& who) = 0; - }; - - /** - * Register the @a recipient for a notification if this binder - * goes away. If this binder object unexpectedly goes away - * (typically because its hosting process has been killed), - * then DeathRecipient::binderDied() will be called with a reference - * to this. - * - * The @a cookie is optional -- if non-NULL, it should be a - * memory address that you own (that is, you know it is unique). - * - * @note You will only receive death notifications for remote binders, - * as local binders by definition can't die without you dying as well. - * Trying to use this function on a local binder will result in an - * INVALID_OPERATION code being returned and nothing happening. - * - * @note This link always holds a weak reference to its recipient. - * - * @note You will only receive a weak reference to the dead - * binder. You should not try to promote this to a strong reference. - * (Nor should you need to, as there is nothing useful you can - * directly do with it now that it has passed on.) - */ - virtual status_t linkToDeath(const sp& recipient, - void* cookie = NULL, - uint32_t flags = 0) = 0; - - /** - * Remove a previously registered death notification. - * The @a recipient will no longer be called if this object - * dies. The @a cookie is optional. If non-NULL, you can - * supply a NULL @a recipient, and the recipient previously - * added with that cookie will be unlinked. - */ - virtual status_t unlinkToDeath( const wp& recipient, - void* cookie = NULL, - uint32_t flags = 0, - wp* outRecipient = NULL) = 0; - - virtual bool checkSubclass(const void* subclassID) const; - - typedef void (*object_cleanup_func)(const void* id, void* obj, void* cleanupCookie); - - virtual void attachObject( const void* objectID, - void* object, - void* cleanupCookie, - object_cleanup_func func) = 0; - virtual void* findObject(const void* objectID) const = 0; - virtual void detachObject(const void* objectID) = 0; - - virtual BBinder* localBinder(); - virtual BpBinder* remoteBinder(); - -protected: - virtual ~IBinder(); - -private: -}; - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_IBINDER_H diff --git a/external/android/include/16/frameworks/native/include/binder/IInterface.h b/external/android/include/16/frameworks/native/include/binder/IInterface.h deleted file mode 100644 index 5f9f69c..0000000 --- a/external/android/include/16/frameworks/native/include/binder/IInterface.h +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (C) 2005 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_IINTERFACE_H -#define ANDROID_IINTERFACE_H - -#include - -namespace android { - -// ---------------------------------------------------------------------- - -class IInterface : public virtual RefBase -{ -public: - IInterface(); - sp asBinder(); - sp asBinder() const; - -protected: - virtual ~IInterface(); - virtual IBinder* onAsBinder() = 0; -}; - -// ---------------------------------------------------------------------- - -template -inline sp interface_cast(const sp& obj) -{ - return INTERFACE::asInterface(obj); -} - -// ---------------------------------------------------------------------- - -template -class BnInterface : public INTERFACE, public BBinder -{ -public: - virtual sp queryLocalInterface(const String16& _descriptor); - virtual const String16& getInterfaceDescriptor() const; - -protected: - virtual IBinder* onAsBinder(); -}; - -// ---------------------------------------------------------------------- - -template -class BpInterface : public INTERFACE, public BpRefBase -{ -public: - BpInterface(const sp& remote); - -protected: - virtual IBinder* onAsBinder(); -}; - -// ---------------------------------------------------------------------- - -#define DECLARE_META_INTERFACE(INTERFACE) \ - static const android::String16 descriptor; \ - static android::sp asInterface( \ - const android::sp& obj); \ - virtual const android::String16& getInterfaceDescriptor() const; \ - I##INTERFACE(); \ - virtual ~I##INTERFACE(); \ - - -#define IMPLEMENT_META_INTERFACE(INTERFACE, NAME) \ - const android::String16 I##INTERFACE::descriptor(NAME); \ - const android::String16& \ - I##INTERFACE::getInterfaceDescriptor() const { \ - return I##INTERFACE::descriptor; \ - } \ - android::sp I##INTERFACE::asInterface( \ - const android::sp& obj) \ - { \ - android::sp intr; \ - if (obj != NULL) { \ - intr = static_cast( \ - obj->queryLocalInterface( \ - I##INTERFACE::descriptor).get()); \ - if (intr == NULL) { \ - intr = new Bp##INTERFACE(obj); \ - } \ - } \ - return intr; \ - } \ - I##INTERFACE::I##INTERFACE() { } \ - I##INTERFACE::~I##INTERFACE() { } \ - - -#define CHECK_INTERFACE(interface, data, reply) \ - if (!data.checkInterface(this)) { return PERMISSION_DENIED; } \ - - -// ---------------------------------------------------------------------- -// No user-serviceable parts after this... - -template -inline sp BnInterface::queryLocalInterface( - const String16& _descriptor) -{ - if (_descriptor == INTERFACE::descriptor) return this; - return NULL; -} - -template -inline const String16& BnInterface::getInterfaceDescriptor() const -{ - return INTERFACE::getInterfaceDescriptor(); -} - -template -IBinder* BnInterface::onAsBinder() -{ - return this; -} - -template -inline BpInterface::BpInterface(const sp& remote) - : BpRefBase(remote) -{ -} - -template -inline IBinder* BpInterface::onAsBinder() -{ - return remote(); -} - -// ---------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IINTERFACE_H diff --git a/external/android/include/16/frameworks/native/include/binder/IMemory.h b/external/android/include/16/frameworks/native/include/binder/IMemory.h deleted file mode 100644 index 2d0db00..0000000 --- a/external/android/include/16/frameworks/native/include/binder/IMemory.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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_IMEMORY_H -#define ANDROID_IMEMORY_H - -#include -#include -#include - -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class IMemoryHeap : public IInterface -{ -public: - DECLARE_META_INTERFACE(MemoryHeap); - - // flags returned by getFlags() - enum { - READ_ONLY = 0x00000001 - }; - - virtual int getHeapID() const = 0; - virtual void* getBase() const = 0; - virtual size_t getSize() const = 0; - virtual uint32_t getFlags() const = 0; - virtual uint32_t getOffset() const = 0; - - // these are there just for backward source compatibility - int32_t heapID() const { return getHeapID(); } - void* base() const { return getBase(); } - size_t virtualSize() const { return getSize(); } -}; - -class BnMemoryHeap : public BnInterface -{ -public: - virtual status_t onTransact( - uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); - - BnMemoryHeap(); -protected: - virtual ~BnMemoryHeap(); -}; - -// ---------------------------------------------------------------------------- - -class IMemory : public IInterface -{ -public: - DECLARE_META_INTERFACE(Memory); - - virtual sp getMemory(ssize_t* offset=0, size_t* size=0) const = 0; - - // helpers - void* fastPointer(const sp& heap, ssize_t offset) const; - void* pointer() const; - size_t size() const; - ssize_t offset() const; -}; - -class BnMemory : public BnInterface -{ -public: - virtual status_t onTransact( - uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); - - BnMemory(); -protected: - virtual ~BnMemory(); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IMEMORY_H diff --git a/external/android/include/16/frameworks/native/include/binder/IPCThreadState.h b/external/android/include/16/frameworks/native/include/binder/IPCThreadState.h deleted file mode 100644 index 691ba2f..0000000 --- a/external/android/include/16/frameworks/native/include/binder/IPCThreadState.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (C) 2005 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_IPC_THREAD_STATE_H -#define ANDROID_IPC_THREAD_STATE_H - -#include -#include -#include -#include - -#ifdef HAVE_WIN32_PROC -typedef int uid_t; -#endif - -// --------------------------------------------------------------------------- -namespace android { - -class IPCThreadState -{ -public: - static IPCThreadState* self(); - static IPCThreadState* selfOrNull(); // self(), but won't instantiate - - sp process(); - - status_t clearLastError(); - - int getCallingPid(); - int getCallingUid(); - int getOrigCallingUid(); - - void setStrictModePolicy(int32_t policy); - int32_t getStrictModePolicy() const; - - void setLastTransactionBinderFlags(int32_t flags); - int32_t getLastTransactionBinderFlags() const; - - int64_t clearCallingIdentity(); - void restoreCallingIdentity(int64_t token); - - void flushCommands(); - - void joinThreadPool(bool isMain = true); - - // Stop the local process. - void stopProcess(bool immediate = true); - - status_t transact(int32_t handle, - uint32_t code, const Parcel& data, - Parcel* reply, uint32_t flags); - - void incStrongHandle(int32_t handle); - void decStrongHandle(int32_t handle); - void incWeakHandle(int32_t handle); - void decWeakHandle(int32_t handle); - status_t attemptIncStrongHandle(int32_t handle); - static void expungeHandle(int32_t handle, IBinder* binder); - status_t requestDeathNotification( int32_t handle, - BpBinder* proxy); - status_t clearDeathNotification( int32_t handle, - BpBinder* proxy); - - static void shutdown(); - - // Call this to disable switching threads to background scheduling when - // receiving incoming IPC calls. This is specifically here for the - // Android system process, since it expects to have background apps calling - // in to it but doesn't want to acquire locks in its services while in - // the background. - static void disableBackgroundScheduling(bool disable); - -private: - IPCThreadState(); - ~IPCThreadState(); - - status_t sendReply(const Parcel& reply, uint32_t flags); - status_t waitForResponse(Parcel *reply, - status_t *acquireResult=NULL); - status_t talkWithDriver(bool doReceive=true); - status_t writeTransactionData(int32_t cmd, - uint32_t binderFlags, - int32_t handle, - uint32_t code, - const Parcel& data, - status_t* statusBuffer); - status_t executeCommand(int32_t command); - - void clearCaller(); - - static void threadDestructor(void *st); - static void freeBuffer(Parcel* parcel, - const uint8_t* data, size_t dataSize, - const size_t* objects, size_t objectsSize, - void* cookie); - - const sp mProcess; - const pid_t mMyThreadId; - Vector mPendingStrongDerefs; - Vector mPendingWeakDerefs; - - Parcel mIn; - Parcel mOut; - status_t mLastError; - pid_t mCallingPid; - uid_t mCallingUid; - uid_t mOrigCallingUid; - int32_t mStrictModePolicy; - int32_t mLastTransactionBinderFlags; -}; - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_IPC_THREAD_STATE_H diff --git a/external/android/include/16/frameworks/native/include/binder/IPermissionController.h b/external/android/include/16/frameworks/native/include/binder/IPermissionController.h deleted file mode 100644 index f9d371b..0000000 --- a/external/android/include/16/frameworks/native/include/binder/IPermissionController.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2005 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_IPERMISSION_CONTROLLER_H -#define ANDROID_IPERMISSION_CONTROLLER_H - -#include - -namespace android { - -// ---------------------------------------------------------------------- - -class IPermissionController : public IInterface -{ -public: - DECLARE_META_INTERFACE(PermissionController); - - virtual bool checkPermission(const String16& permission, - int32_t pid, int32_t uid) = 0; - - enum { - CHECK_PERMISSION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION - }; -}; - -// ---------------------------------------------------------------------- - -class BnPermissionController : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IPERMISSION_CONTROLLER_H - diff --git a/external/android/include/16/frameworks/native/include/binder/IServiceManager.h b/external/android/include/16/frameworks/native/include/binder/IServiceManager.h deleted file mode 100644 index 2c297d6..0000000 --- a/external/android/include/16/frameworks/native/include/binder/IServiceManager.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2005 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_ISERVICE_MANAGER_H -#define ANDROID_ISERVICE_MANAGER_H - -#include -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------- - -class IServiceManager : public IInterface -{ -public: - DECLARE_META_INTERFACE(ServiceManager); - - /** - * Retrieve an existing service, blocking for a few seconds - * if it doesn't yet exist. - */ - virtual sp getService( const String16& name) const = 0; - - /** - * Retrieve an existing service, non-blocking. - */ - virtual sp checkService( const String16& name) const = 0; - - /** - * Register a service. - */ - virtual status_t addService( const String16& name, - const sp& service, - bool allowIsolated = false) = 0; - - /** - * Return list of all existing services. - */ - virtual Vector listServices() = 0; - - enum { - GET_SERVICE_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION, - CHECK_SERVICE_TRANSACTION, - ADD_SERVICE_TRANSACTION, - LIST_SERVICES_TRANSACTION, - }; -}; - -sp defaultServiceManager(); - -template -status_t getService(const String16& name, sp* outService) -{ - const sp sm = defaultServiceManager(); - if (sm != NULL) { - *outService = interface_cast(sm->getService(name)); - if ((*outService) != NULL) return NO_ERROR; - } - return NAME_NOT_FOUND; -} - -bool checkCallingPermission(const String16& permission); -bool checkCallingPermission(const String16& permission, - int32_t* outPid, int32_t* outUid); -bool checkPermission(const String16& permission, pid_t pid, uid_t uid); - - -// ---------------------------------------------------------------------- - -class BnServiceManager : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_ISERVICE_MANAGER_H - diff --git a/external/android/include/16/frameworks/native/include/binder/MemoryBase.h b/external/android/include/16/frameworks/native/include/binder/MemoryBase.h deleted file mode 100644 index 463e26d..0000000 --- a/external/android/include/16/frameworks/native/include/binder/MemoryBase.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_MEMORY_BASE_H -#define ANDROID_MEMORY_BASE_H - -#include -#include - -#include - - -namespace android { - -// --------------------------------------------------------------------------- - -class MemoryBase : public BnMemory -{ -public: - MemoryBase(const sp& heap, ssize_t offset, size_t size); - virtual ~MemoryBase(); - virtual sp getMemory(ssize_t* offset, size_t* size) const; - -protected: - size_t getSize() const { return mSize; } - ssize_t getOffset() const { return mOffset; } - const sp& getHeap() const { return mHeap; } - -private: - size_t mSize; - ssize_t mOffset; - sp mHeap; -}; - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_MEMORY_BASE_H diff --git a/external/android/include/16/frameworks/native/include/binder/MemoryDealer.h b/external/android/include/16/frameworks/native/include/binder/MemoryDealer.h deleted file mode 100644 index 170f20d..0000000 --- a/external/android/include/16/frameworks/native/include/binder/MemoryDealer.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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_MEMORY_DEALER_H -#define ANDROID_MEMORY_DEALER_H - - -#include -#include - -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class SimpleBestFitAllocator; - -// ---------------------------------------------------------------------------- - -class MemoryDealer : public RefBase -{ -public: - MemoryDealer(size_t size, const char* name = 0); - - virtual sp allocate(size_t size); - virtual void deallocate(size_t offset); - virtual void dump(const char* what) const; - - sp getMemoryHeap() const { return heap(); } - -protected: - virtual ~MemoryDealer(); - -private: - const sp& heap() const; - SimpleBestFitAllocator* allocator() const; - - sp mHeap; - SimpleBestFitAllocator* mAllocator; -}; - - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_MEMORY_DEALER_H diff --git a/external/android/include/16/frameworks/native/include/binder/MemoryHeapBase.h b/external/android/include/16/frameworks/native/include/binder/MemoryHeapBase.h deleted file mode 100644 index bbbda9c..0000000 --- a/external/android/include/16/frameworks/native/include/binder/MemoryHeapBase.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_MEMORY_HEAP_BASE_H -#define ANDROID_MEMORY_HEAP_BASE_H - -#include -#include - -#include - - -namespace android { - -// --------------------------------------------------------------------------- - -class MemoryHeapBase : public virtual BnMemoryHeap -{ -public: - enum { - READ_ONLY = IMemoryHeap::READ_ONLY, - // memory won't be mapped locally, but will be mapped in the remote - // process. - DONT_MAP_LOCALLY = 0x00000100, - NO_CACHING = 0x00000200 - }; - - /* - * maps the memory referenced by fd. but DOESN'T take ownership - * of the filedescriptor (it makes a copy with dup() - */ - MemoryHeapBase(int fd, size_t size, uint32_t flags = 0, uint32_t offset = 0); - - /* - * maps memory from the given device - */ - MemoryHeapBase(const char* device, size_t size = 0, uint32_t flags = 0); - - /* - * maps memory from ashmem, with the given name for debugging - */ - MemoryHeapBase(size_t size, uint32_t flags = 0, char const* name = NULL); - - virtual ~MemoryHeapBase(); - - /* implement IMemoryHeap interface */ - virtual int getHeapID() const; - virtual void* getBase() const; - virtual size_t getSize() const; - virtual uint32_t getFlags() const; - virtual uint32_t getOffset() const; - - const char* getDevice() const; - - /* this closes this heap -- use carefully */ - void dispose(); - - /* this is only needed as a workaround, use only if you know - * what you are doing */ - status_t setDevice(const char* device) { - if (mDevice == 0) - mDevice = device; - return mDevice ? NO_ERROR : ALREADY_EXISTS; - } - -protected: - MemoryHeapBase(); - // init() takes ownership of fd - status_t init(int fd, void *base, int size, - int flags = 0, const char* device = NULL); - -private: - status_t mapfd(int fd, size_t size, uint32_t offset = 0); - - int mFD; - size_t mSize; - void* mBase; - uint32_t mFlags; - const char* mDevice; - bool mNeedUnmap; - uint32_t mOffset; -}; - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_MEMORY_HEAP_BASE_H diff --git a/external/android/include/16/frameworks/native/include/binder/Parcel.h b/external/android/include/16/frameworks/native/include/binder/Parcel.h deleted file mode 100644 index 33b2f00..0000000 --- a/external/android/include/16/frameworks/native/include/binder/Parcel.h +++ /dev/null @@ -1,297 +0,0 @@ -/* - * Copyright (C) 2005 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_PARCEL_H -#define ANDROID_PARCEL_H - -#include -#include -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -class Flattenable; -class IBinder; -class IPCThreadState; -class ProcessState; -class String8; -class TextOutput; - -struct flat_binder_object; // defined in support_p/binder_module.h - -class Parcel -{ -public: - class ReadableBlob; - class WritableBlob; - - Parcel(); - ~Parcel(); - - const uint8_t* data() const; - size_t dataSize() const; - size_t dataAvail() const; - size_t dataPosition() const; - size_t dataCapacity() const; - - status_t setDataSize(size_t size); - void setDataPosition(size_t pos) const; - status_t setDataCapacity(size_t size); - - status_t setData(const uint8_t* buffer, size_t len); - - status_t appendFrom(const Parcel *parcel, - size_t start, size_t len); - - bool pushAllowFds(bool allowFds); - void restoreAllowFds(bool lastValue); - - bool hasFileDescriptors() const; - - // Writes the RPC header. - status_t writeInterfaceToken(const String16& interface); - - // Parses the RPC header, returning true if the interface name - // in the header matches the expected interface from the caller. - // - // Additionally, enforceInterface does part of the work of - // propagating the StrictMode policy mask, populating the current - // IPCThreadState, which as an optimization may optionally be - // passed in. - bool enforceInterface(const String16& interface, - IPCThreadState* threadState = NULL) const; - bool checkInterface(IBinder*) const; - - void freeData(); - - const size_t* objects() const; - size_t objectsCount() const; - - status_t errorCheck() const; - void setError(status_t err); - - status_t write(const void* data, size_t len); - void* writeInplace(size_t len); - status_t writeUnpadded(const void* data, size_t len); - status_t writeInt32(int32_t val); - status_t writeInt64(int64_t val); - status_t writeFloat(float val); - status_t writeDouble(double val); - status_t writeIntPtr(intptr_t val); - status_t writeCString(const char* str); - status_t writeString8(const String8& str); - status_t writeString16(const String16& str); - status_t writeString16(const char16_t* str, size_t len); - status_t writeStrongBinder(const sp& val); - status_t writeWeakBinder(const wp& val); - status_t write(const Flattenable& val); - - // Place a native_handle into the parcel (the native_handle's file- - // descriptors are dup'ed, so it is safe to delete the native_handle - // when this function returns). - // Doesn't take ownership of the native_handle. - status_t writeNativeHandle(const native_handle* handle); - - // Place a file descriptor into the parcel. The given fd must remain - // valid for the lifetime of the parcel. - // The Parcel does not take ownership of the given fd unless you ask it to. - status_t writeFileDescriptor(int fd, bool takeOwnership = false); - - // Place a file descriptor into the parcel. A dup of the fd is made, which - // will be closed once the parcel is destroyed. - status_t writeDupFileDescriptor(int fd); - - // Writes a blob to the parcel. - // If the blob is small, then it is stored in-place, otherwise it is - // transferred by way of an anonymous shared memory region. - // The caller should call release() on the blob after writing its contents. - status_t writeBlob(size_t len, WritableBlob* outBlob); - - status_t writeObject(const flat_binder_object& val, bool nullMetaData); - - // Like Parcel.java's writeNoException(). Just writes a zero int32. - // Currently the native implementation doesn't do any of the StrictMode - // stack gathering and serialization that the Java implementation does. - status_t writeNoException(); - - void remove(size_t start, size_t amt); - - status_t read(void* outData, size_t len) const; - const void* readInplace(size_t len) const; - int32_t readInt32() const; - status_t readInt32(int32_t *pArg) const; - int64_t readInt64() const; - status_t readInt64(int64_t *pArg) const; - float readFloat() const; - status_t readFloat(float *pArg) const; - double readDouble() const; - status_t readDouble(double *pArg) const; - intptr_t readIntPtr() const; - status_t readIntPtr(intptr_t *pArg) const; - - const char* readCString() const; - String8 readString8() const; - String16 readString16() const; - const char16_t* readString16Inplace(size_t* outLen) const; - sp readStrongBinder() const; - wp readWeakBinder() const; - status_t read(Flattenable& val) const; - - // Like Parcel.java's readExceptionCode(). Reads the first int32 - // off of a Parcel's header, returning 0 or the negative error - // code on exceptions, but also deals with skipping over rich - // response headers. Callers should use this to read & parse the - // response headers rather than doing it by hand. - int32_t readExceptionCode() const; - - // Retrieve native_handle from the parcel. This returns a copy of the - // parcel's native_handle (the caller takes ownership). The caller - // must free the native_handle with native_handle_close() and - // native_handle_delete(). - native_handle* readNativeHandle() const; - - - // Retrieve a file descriptor from the parcel. This returns the raw fd - // in the parcel, which you do not own -- use dup() to get your own copy. - int readFileDescriptor() const; - - // Reads a blob from the parcel. - // The caller should call release() on the blob after reading its contents. - status_t readBlob(size_t len, ReadableBlob* outBlob) const; - - const flat_binder_object* readObject(bool nullMetaData) const; - - // Explicitly close all file descriptors in the parcel. - void closeFileDescriptors(); - - typedef void (*release_func)(Parcel* parcel, - const uint8_t* data, size_t dataSize, - const size_t* objects, size_t objectsSize, - void* cookie); - - const uint8_t* ipcData() const; - size_t ipcDataSize() const; - const size_t* ipcObjects() const; - size_t ipcObjectsCount() const; - void ipcSetDataReference(const uint8_t* data, size_t dataSize, - const size_t* objects, size_t objectsCount, - release_func relFunc, void* relCookie); - - void print(TextOutput& to, uint32_t flags = 0) const; - -private: - Parcel(const Parcel& o); - Parcel& operator=(const Parcel& o); - - status_t finishWrite(size_t len); - void releaseObjects(); - void acquireObjects(); - status_t growData(size_t len); - status_t restartWrite(size_t desired); - status_t continueWrite(size_t desired); - void freeDataNoInit(); - void initState(); - void scanForFds() const; - - template - status_t readAligned(T *pArg) const; - - template T readAligned() const; - - template - status_t writeAligned(T val); - - status_t mError; - uint8_t* mData; - size_t mDataSize; - size_t mDataCapacity; - mutable size_t mDataPos; - size_t* mObjects; - size_t mObjectsSize; - size_t mObjectsCapacity; - mutable size_t mNextObjectHint; - - mutable bool mFdsKnown; - mutable bool mHasFds; - bool mAllowFds; - - release_func mOwner; - void* mOwnerCookie; - - class Blob { - public: - Blob(); - ~Blob(); - - void release(); - inline size_t size() const { return mSize; } - - protected: - void init(bool mapped, void* data, size_t size); - void clear(); - - bool mMapped; - void* mData; - size_t mSize; - }; - -public: - class ReadableBlob : public Blob { - friend class Parcel; - public: - inline const void* data() const { return mData; } - }; - - class WritableBlob : public Blob { - friend class Parcel; - public: - inline void* data() { return mData; } - }; -}; - -// --------------------------------------------------------------------------- - -inline TextOutput& operator<<(TextOutput& to, const Parcel& parcel) -{ - parcel.print(to); - return to; -} - -// --------------------------------------------------------------------------- - -// Generic acquire and release of objects. -void acquire_object(const sp& proc, - const flat_binder_object& obj, const void* who); -void release_object(const sp& proc, - const flat_binder_object& obj, const void* who); - -void flatten_binder(const sp& proc, - const sp& binder, flat_binder_object* out); -void flatten_binder(const sp& proc, - const wp& binder, flat_binder_object* out); -status_t unflatten_binder(const sp& proc, - const flat_binder_object& flat, sp* out); -status_t unflatten_binder(const sp& proc, - const flat_binder_object& flat, wp* out); - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_PARCEL_H diff --git a/external/android/include/16/frameworks/native/include/binder/PermissionCache.h b/external/android/include/16/frameworks/native/include/binder/PermissionCache.h deleted file mode 100644 index 1171d48..0000000 --- a/external/android/include/16/frameworks/native/include/binder/PermissionCache.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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 BINDER_PERMISSION_H -#define BINDER_PERMISSION_H - -#include -#include - -#include -#include - -namespace android { -// --------------------------------------------------------------------------- - -/* - * PermissionCache caches permission checks for a given uid. - * - * Currently the cache is not updated when there is a permission change, - * for instance when an application is uninstalled. - * - * IMPORTANT: for the reason stated above, only system permissions are safe - * to cache. This restriction may be lifted at a later time. - * - */ - -class PermissionCache : Singleton { - struct Entry { - String16 name; - uid_t uid; - bool granted; - inline bool operator < (const Entry& e) const { - return (uid == e.uid) ? (name < e.name) : (uid < e.uid); - } - }; - mutable Mutex mLock; - // we pool all the permission names we see, as many permissions checks - // will have identical names - SortedVector< String16 > mPermissionNamesPool; - // this is our cache per say. it stores pooled names. - SortedVector< Entry > mCache; - - // free the whole cache, but keep the permission name pool - void purge(); - - status_t check(bool* granted, - const String16& permission, uid_t uid) const; - - void cache(const String16& permission, uid_t uid, bool granted); - -public: - PermissionCache(); - - static bool checkCallingPermission(const String16& permission); - - static bool checkCallingPermission(const String16& permission, - int32_t* outPid, int32_t* outUid); - - static bool checkPermission(const String16& permission, - pid_t pid, uid_t uid); -}; - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif /* BINDER_PERMISSION_H */ diff --git a/external/android/include/16/frameworks/native/include/binder/ProcessState.h b/external/android/include/16/frameworks/native/include/binder/ProcessState.h deleted file mode 100644 index 8caf1af..0000000 --- a/external/android/include/16/frameworks/native/include/binder/ProcessState.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (C) 2005 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_PROCESS_STATE_H -#define ANDROID_PROCESS_STATE_H - -#include -#include -#include -#include - -#include - -// --------------------------------------------------------------------------- -namespace android { - -// Global variables -extern int mArgC; -extern const char* const* mArgV; -extern int mArgLen; - -class IPCThreadState; - -class ProcessState : public virtual RefBase -{ -public: - static sp self(); - - void setContextObject(const sp& object); - sp getContextObject(const sp& caller); - - void setContextObject(const sp& object, - const String16& name); - sp getContextObject(const String16& name, - const sp& caller); - - void startThreadPool(); - - typedef bool (*context_check_func)(const String16& name, - const sp& caller, - void* userData); - - bool isContextManager(void) const; - bool becomeContextManager( - context_check_func checkFunc, - void* userData); - - sp getStrongProxyForHandle(int32_t handle); - wp getWeakProxyForHandle(int32_t handle); - void expungeHandle(int32_t handle, IBinder* binder); - - void setArgs(int argc, const char* const argv[]); - int getArgC() const; - const char* const* getArgV() const; - - void setArgV0(const char* txt); - - void spawnPooledThread(bool isMain); - - status_t setThreadPoolMaxThreadCount(size_t maxThreads); - -private: - friend class IPCThreadState; - - ProcessState(); - ~ProcessState(); - - ProcessState(const ProcessState& o); - ProcessState& operator=(const ProcessState& o); - - struct handle_entry { - IBinder* binder; - RefBase::weakref_type* refs; - }; - - handle_entry* lookupHandleLocked(int32_t handle); - - int mDriverFD; - void* mVMStart; - - mutable Mutex mLock; // protects everything below. - - VectormHandleToObject; - - bool mManagesContexts; - context_check_func mBinderContextCheckFunc; - void* mBinderContextUserData; - - KeyedVector > - mContexts; - - - String8 mRootDir; - bool mThreadPoolStarted; - volatile int32_t mThreadPoolSeq; -}; - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_PROCESS_STATE_H diff --git a/external/android/include/16/frameworks/native/include/gui/BitTube.h b/external/android/include/16/frameworks/native/include/gui/BitTube.h deleted file mode 100644 index 3022d05..0000000 --- a/external/android/include/16/frameworks/native/include/gui/BitTube.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_SENSOR_CHANNEL_H -#define ANDROID_GUI_SENSOR_CHANNEL_H - -#include -#include - -#include -#include -#include - - -namespace android { -// ---------------------------------------------------------------------------- -class Parcel; - -class BitTube : public RefBase -{ -public: - - BitTube(); - BitTube(const Parcel& data); - virtual ~BitTube(); - - status_t initCheck() const; - int getFd() const; - ssize_t write(void const* vaddr, size_t size); - ssize_t read(void* vaddr, size_t size); - - status_t writeToParcel(Parcel* reply) const; - - template - static ssize_t sendObjects(const sp& tube, - T const* events, size_t count) { - return sendObjects(tube, events, count, sizeof(T)); - } - - template - static ssize_t recvObjects(const sp& tube, - T* events, size_t count) { - return recvObjects(tube, events, count, sizeof(T)); - } - -private: - int mSendFd; - mutable int mReceiveFd; - - static ssize_t sendObjects(const sp& tube, - void const* events, size_t count, size_t objSize); - - static ssize_t recvObjects(const sp& tube, - void* events, size_t count, size_t objSize); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_SENSOR_CHANNEL_H diff --git a/external/android/include/16/frameworks/native/include/gui/BufferQueue.h b/external/android/include/16/frameworks/native/include/gui/BufferQueue.h deleted file mode 100644 index 1c80d0c..0000000 --- a/external/android/include/16/frameworks/native/include/gui/BufferQueue.h +++ /dev/null @@ -1,490 +0,0 @@ -/* - * Copyright (C) 2012 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_GUI_BUFFERQUEUE_H -#define ANDROID_GUI_BUFFERQUEUE_H - -#include -#include - -#include -#include - -#include - -#include -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class BufferQueue : public BnSurfaceTexture { -public: - enum { MIN_UNDEQUEUED_BUFFERS = 2 }; - enum { NUM_BUFFER_SLOTS = 32 }; - enum { NO_CONNECTED_API = 0 }; - enum { INVALID_BUFFER_SLOT = -1 }; - enum { STALE_BUFFER_SLOT = 1, NO_BUFFER_AVAILABLE }; - - // ConsumerListener is the interface through which the BufferQueue notifies - // the consumer of events that the consumer may wish to react to. Because - // the consumer will generally have a mutex that is locked during calls from - // teh consumer to the BufferQueue, these calls from the BufferQueue to the - // consumer *MUST* be called only when the BufferQueue mutex is NOT locked. - struct ConsumerListener : public virtual RefBase { - // onFrameAvailable is called from queueBuffer each time an additional - // frame becomes available for consumption. This means that frames that - // are queued while in asynchronous mode only trigger the callback if no - // previous frames are pending. Frames queued while in synchronous mode - // always trigger the callback. - // - // This is called without any lock held and can be called concurrently - // by multiple threads. - virtual void onFrameAvailable() = 0; - - // onBuffersReleased is called to notify the buffer consumer that the - // BufferQueue has released its references to one or more GraphicBuffers - // contained in its slots. The buffer consumer should then call - // BufferQueue::getReleasedBuffers to retrieve the list of buffers - // - // This is called without any lock held and can be called concurrently - // by multiple threads. - virtual void onBuffersReleased() = 0; - }; - - // ProxyConsumerListener is a ConsumerListener implementation that keeps a weak - // reference to the actual consumer object. It forwards all calls to that - // consumer object so long as it exists. - // - // This class exists to avoid having a circular reference between the - // BufferQueue object and the consumer object. The reason this can't be a weak - // reference in the BufferQueue class is because we're planning to expose the - // consumer side of a BufferQueue as a binder interface, which doesn't support - // weak references. - class ProxyConsumerListener : public BufferQueue::ConsumerListener { - public: - - ProxyConsumerListener(const wp& consumerListener); - virtual ~ProxyConsumerListener(); - virtual void onFrameAvailable(); - virtual void onBuffersReleased(); - - private: - - // mConsumerListener is a weak reference to the ConsumerListener. This is - // the raison d'etre of ProxyConsumerListener. - wp mConsumerListener; - }; - - - // BufferQueue manages a pool of gralloc memory slots to be used - // by producers and consumers. - // allowSynchronousMode specifies whether or not synchronous mode can be - // enabled. - // bufferCount sets the minimum number of undequeued buffers for this queue - BufferQueue( bool allowSynchronousMode = true, int bufferCount = MIN_UNDEQUEUED_BUFFERS); - virtual ~BufferQueue(); - - virtual int query(int what, int* value); - - // setBufferCount updates the number of available buffer slots. After - // calling this all buffer slots are both unallocated and owned by the - // BufferQueue object (i.e. they are not owned by the client). - virtual status_t setBufferCount(int bufferCount); - - virtual status_t requestBuffer(int slot, sp* buf); - - // dequeueBuffer gets the next buffer slot index for the client to use. If a - // buffer slot is available then that slot index is written to the location - // pointed to by the buf argument and a status of OK is returned. If no - // slot is available then a status of -EBUSY is returned and buf is - // unmodified. - // The width and height parameters must be no greater than the minimum of - // GL_MAX_VIEWPORT_DIMS and GL_MAX_TEXTURE_SIZE (see: glGetIntegerv). - // An error due to invalid dimensions might not be reported until - // updateTexImage() is called. - virtual status_t dequeueBuffer(int *buf, uint32_t width, uint32_t height, - uint32_t format, uint32_t usage); - - // queueBuffer returns a filled buffer to the BufferQueue. In addition, a - // timestamp must be provided for the buffer. The timestamp is in - // nanoseconds, and must be monotonically increasing. Its other semantics - // (zero point, etc) are client-dependent and should be documented by the - // client. - virtual status_t queueBuffer(int buf, - const QueueBufferInput& input, QueueBufferOutput* output); - - virtual void cancelBuffer(int buf); - - // setSynchronousMode set whether dequeueBuffer is synchronous or - // asynchronous. In synchronous mode, dequeueBuffer blocks until - // a buffer is available, the currently bound buffer can be dequeued and - // queued buffers will be retired in order. - // The default mode is asynchronous. - virtual status_t setSynchronousMode(bool enabled); - - // connect attempts to connect a producer client API to the BufferQueue. - // This must be called before any other ISurfaceTexture methods are called - // except for getAllocator. - // - // This method will fail if the connect was previously called on the - // BufferQueue and no corresponding disconnect call was made. - virtual status_t connect(int api, QueueBufferOutput* output); - - // disconnect attempts to disconnect a producer client API from the - // BufferQueue. Calling this method will cause any subsequent calls to other - // ISurfaceTexture methods to fail except for getAllocator and connect. - // Successfully calling connect after this will allow the other methods to - // succeed again. - // - // This method will fail if the the BufferQueue is not currently - // connected to the specified client API. - virtual status_t disconnect(int api); - - // dump our state in a String - virtual void dump(String8& result) const; - virtual void dump(String8& result, const char* prefix, char* buffer, size_t SIZE) const; - - // public facing structure for BufferSlot - struct BufferItem { - - BufferItem() - : - mTransform(0), - mScalingMode(NATIVE_WINDOW_SCALING_MODE_FREEZE), - mTimestamp(0), - mFrameNumber(0), - mBuf(INVALID_BUFFER_SLOT) { - mCrop.makeInvalid(); - } - // mGraphicBuffer points to the buffer allocated for this slot or is NULL - // if no buffer has been allocated. - sp mGraphicBuffer; - - // mCrop is the current crop rectangle for this buffer slot. - Rect mCrop; - - // mTransform is the current transform flags for this buffer slot. - uint32_t mTransform; - - // mScalingMode is the current scaling mode for this buffer slot. - uint32_t mScalingMode; - - // mTimestamp is the current timestamp for this buffer slot. This gets - // to set by queueBuffer each time this slot is queued. - int64_t mTimestamp; - - // mFrameNumber is the number of the queued frame for this slot. - uint64_t mFrameNumber; - - // mBuf is the slot index of this buffer - int mBuf; - }; - - // The following public functions is the consumer facing interface - - // acquireBuffer attempts to acquire ownership of the next pending buffer in - // the BufferQueue. If no buffer is pending then it returns -EINVAL. If a - // buffer is successfully acquired, the information about the buffer is - // returned in BufferItem. If the buffer returned had previously been - // acquired then the BufferItem::mGraphicBuffer field of buffer is set to - // NULL and it is assumed that the consumer still holds a reference to the - // buffer. - status_t acquireBuffer(BufferItem *buffer); - - // releaseBuffer releases a buffer slot from the consumer back to the - // BufferQueue pending a fence sync. - // - // Note that the dependencies on EGL will be removed once we switch to using - // the Android HW Sync HAL. - status_t releaseBuffer(int buf, EGLDisplay display, EGLSyncKHR fence); - - // consumerConnect connects a consumer to the BufferQueue. Only one - // consumer may be connected, and when that consumer disconnects the - // BufferQueue is placed into the "abandoned" state, causing most - // interactions with the BufferQueue by the producer to fail. - status_t consumerConnect(const sp& consumer); - - // consumerDisconnect disconnects a consumer from the BufferQueue. All - // buffers will be freed and the BufferQueue is placed in the "abandoned" - // state, causing most interactions with the BufferQueue by the producer to - // fail. - status_t consumerDisconnect(); - - // getReleasedBuffers sets the value pointed to by slotMask to a bit mask - // indicating which buffer slots the have been released by the BufferQueue - // but have not yet been released by the consumer. - status_t getReleasedBuffers(uint32_t* slotMask); - - // setDefaultBufferSize is used to set the size of buffers returned by - // requestBuffers when a with and height of zero is requested. - status_t setDefaultBufferSize(uint32_t w, uint32_t h); - - // setBufferCountServer set the buffer count. If the client has requested - // a buffer count using setBufferCount, the server-buffer count will - // take effect once the client sets the count back to zero. - status_t setBufferCountServer(int bufferCount); - - // isSynchronousMode returns whether the SurfaceTexture is currently in - // synchronous mode. - bool isSynchronousMode() const; - - // setConsumerName sets the name used in logging - void setConsumerName(const String8& name); - - // setDefaultBufferFormat allows the BufferQueue to create - // GraphicBuffers of a defaultFormat if no format is specified - // in dequeueBuffer - status_t setDefaultBufferFormat(uint32_t defaultFormat); - - // setConsumerUsageBits will turn on additional usage bits for dequeueBuffer - status_t setConsumerUsageBits(uint32_t usage); - - // setTransformHint bakes in rotation to buffers so overlays can be used - status_t setTransformHint(uint32_t hint); - -private: - // freeBufferLocked frees the resources (both GraphicBuffer and EGLImage) - // for the given slot. - void freeBufferLocked(int index); - - // freeAllBuffersLocked frees the resources (both GraphicBuffer and - // EGLImage) for all slots. - void freeAllBuffersLocked(); - - // freeAllBuffersExceptHeadLocked frees the resources (both GraphicBuffer - // and EGLImage) for all slots except the head of mQueue - void freeAllBuffersExceptHeadLocked(); - - // drainQueueLocked drains the buffer queue if we're in synchronous mode - // returns immediately otherwise. It returns NO_INIT if the BufferQueue - // became abandoned or disconnected during this call. - status_t drainQueueLocked(); - - // drainQueueAndFreeBuffersLocked drains the buffer queue if we're in - // synchronous mode and free all buffers. In asynchronous mode, all buffers - // are freed except the current buffer. - status_t drainQueueAndFreeBuffersLocked(); - - status_t setBufferCountServerLocked(int bufferCount); - - struct BufferSlot { - - BufferSlot() - : mEglDisplay(EGL_NO_DISPLAY), - mBufferState(BufferSlot::FREE), - mRequestBufferCalled(false), - mTransform(0), - mScalingMode(NATIVE_WINDOW_SCALING_MODE_FREEZE), - mTimestamp(0), - mFrameNumber(0), - mFence(EGL_NO_SYNC_KHR), - mAcquireCalled(false), - mNeedsCleanupOnRelease(false) { - mCrop.makeInvalid(); - } - - // mGraphicBuffer points to the buffer allocated for this slot or is NULL - // if no buffer has been allocated. - sp mGraphicBuffer; - - // mEglDisplay is the EGLDisplay used to create mEglImage. - EGLDisplay mEglDisplay; - - // BufferState represents the different states in which a buffer slot - // can be. - enum BufferState { - // FREE indicates that the buffer is not currently being used and - // will not be used in the future until it gets dequeued and - // subsequently queued by the client. - // aka "owned by BufferQueue, ready to be dequeued" - FREE = 0, - - // DEQUEUED indicates that the buffer has been dequeued by the - // client, but has not yet been queued or canceled. The buffer is - // considered 'owned' by the client, and the server should not use - // it for anything. - // - // Note that when in synchronous-mode (mSynchronousMode == true), - // the buffer that's currently attached to the texture may be - // dequeued by the client. That means that the current buffer can - // be in either the DEQUEUED or QUEUED state. In asynchronous mode, - // however, the current buffer is always in the QUEUED state. - // aka "owned by producer, ready to be queued" - DEQUEUED = 1, - - // QUEUED indicates that the buffer has been queued by the client, - // and has not since been made available for the client to dequeue. - // Attaching the buffer to the texture does NOT transition the - // buffer away from the QUEUED state. However, in Synchronous mode - // the current buffer may be dequeued by the client under some - // circumstances. See the note about the current buffer in the - // documentation for DEQUEUED. - // aka "owned by BufferQueue, ready to be acquired" - QUEUED = 2, - - // aka "owned by consumer, ready to be released" - ACQUIRED = 3 - }; - - // mBufferState is the current state of this buffer slot. - BufferState mBufferState; - - // mRequestBufferCalled is used for validating that the client did - // call requestBuffer() when told to do so. Technically this is not - // needed but useful for debugging and catching client bugs. - bool mRequestBufferCalled; - - // mCrop is the current crop rectangle for this buffer slot. - Rect mCrop; - - // mTransform is the current transform flags for this buffer slot. - uint32_t mTransform; - - // mScalingMode is the current scaling mode for this buffer slot. - uint32_t mScalingMode; - - // mTimestamp is the current timestamp for this buffer slot. This gets - // to set by queueBuffer each time this slot is queued. - int64_t mTimestamp; - - // mFrameNumber is the number of the queued frame for this slot. - uint64_t mFrameNumber; - - // mFence is the EGL sync object that must signal before the buffer - // associated with this buffer slot may be dequeued. It is initialized - // to EGL_NO_SYNC_KHR when the buffer is created and (optionally, based - // on a compile-time option) set to a new sync object in updateTexImage. - EGLSyncKHR mFence; - - // Indicates whether this buffer has been seen by a consumer yet - bool mAcquireCalled; - - // Indicates whether this buffer needs to be cleaned up by consumer - bool mNeedsCleanupOnRelease; - }; - - // mSlots is the array of buffer slots that must be mirrored on the client - // side. This allows buffer ownership to be transferred between the client - // and server without sending a GraphicBuffer over binder. The entire array - // is initialized to NULL at construction time, and buffers are allocated - // for a slot when requestBuffer is called with that slot's index. - BufferSlot mSlots[NUM_BUFFER_SLOTS]; - - // mDefaultWidth holds the default width of allocated buffers. It is used - // in requestBuffers() if a width and height of zero is specified. - uint32_t mDefaultWidth; - - // mDefaultHeight holds the default height of allocated buffers. It is used - // in requestBuffers() if a width and height of zero is specified. - uint32_t mDefaultHeight; - - // mPixelFormat holds the pixel format of allocated buffers. It is used - // in requestBuffers() if a format of zero is specified. - uint32_t mPixelFormat; - - // mMinUndequeuedBuffers is a constraint on the number of buffers - // not dequeued at any time - int mMinUndequeuedBuffers; - - // mMinAsyncBufferSlots is a constraint on the minimum mBufferCount - // when this BufferQueue is in asynchronous mode - int mMinAsyncBufferSlots; - - // mMinSyncBufferSlots is a constraint on the minimum mBufferCount - // when this BufferQueue is in synchronous mode - int mMinSyncBufferSlots; - - // mBufferCount is the number of buffer slots that the client and server - // must maintain. It defaults to MIN_ASYNC_BUFFER_SLOTS and can be changed - // by calling setBufferCount or setBufferCountServer - int mBufferCount; - - // mClientBufferCount is the number of buffer slots requested by the client. - // The default is zero, which means the client doesn't care how many buffers - // there is. - int mClientBufferCount; - - // mServerBufferCount buffer count requested by the server-side - int mServerBufferCount; - - // mGraphicBufferAlloc is the connection to SurfaceFlinger that is used to - // allocate new GraphicBuffer objects. - sp mGraphicBufferAlloc; - - // mConsumerListener is used to notify the connected consumer of - // asynchronous events that it may wish to react to. It is initially set - // to NULL and is written by consumerConnect and consumerDisconnect. - sp mConsumerListener; - - // mSynchronousMode whether we're in synchronous mode or not - bool mSynchronousMode; - - // mAllowSynchronousMode whether we allow synchronous mode or not - const bool mAllowSynchronousMode; - - // mConnectedApi indicates the API that is currently connected to this - // BufferQueue. It defaults to NO_CONNECTED_API (= 0), and gets updated - // by the connect and disconnect methods. - int mConnectedApi; - - // mDequeueCondition condition used for dequeueBuffer in synchronous mode - mutable Condition mDequeueCondition; - - // mQueue is a FIFO of queued buffers used in synchronous mode - typedef Vector Fifo; - Fifo mQueue; - - // mAbandoned indicates that the BufferQueue will no longer be used to - // consume images buffers pushed to it using the ISurfaceTexture interface. - // It is initialized to false, and set to true in the abandon method. A - // BufferQueue that has been abandoned will return the NO_INIT error from - // all ISurfaceTexture methods capable of returning an error. - bool mAbandoned; - - // mName is a string used to identify the BufferQueue in log messages. - // It is set by the setName method. - String8 mConsumerName; - - // mMutex is the mutex used to prevent concurrent access to the member - // variables of BufferQueue objects. It must be locked whenever the - // member variables are accessed. - mutable Mutex mMutex; - - // mFrameCounter is the free running counter, incremented for every buffer queued - // with the surface Texture. - uint64_t mFrameCounter; - - // mBufferHasBeenQueued is true once a buffer has been queued. It is reset - // by changing the buffer count. - bool mBufferHasBeenQueued; - - // mDefaultBufferFormat can be set so it will override - // the buffer format when it isn't specified in dequeueBuffer - uint32_t mDefaultBufferFormat; - - // mConsumerUsageBits contains flags the consumer wants for GraphicBuffers - uint32_t mConsumerUsageBits; - - // mTransformHint is used to optimize for screen rotations - uint32_t mTransformHint; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_BUFFERQUEUE_H diff --git a/external/android/include/16/frameworks/native/include/gui/DisplayEventReceiver.h b/external/android/include/16/frameworks/native/include/gui/DisplayEventReceiver.h deleted file mode 100644 index e631cca..0000000 --- a/external/android/include/16/frameworks/native/include/gui/DisplayEventReceiver.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (C) 2011 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_GUI_DISPLAY_EVENT_H -#define ANDROID_GUI_DISPLAY_EVENT_H - -#include -#include - -#include -#include -#include - -#include - -// ---------------------------------------------------------------------------- - -namespace android { - -// ---------------------------------------------------------------------------- - -class BitTube; -class IDisplayEventConnection; - -// ---------------------------------------------------------------------------- - -class DisplayEventReceiver { -public: - enum { - DISPLAY_EVENT_VSYNC = 'vsyn' - }; - - struct Event { - - struct Header { - uint32_t type; - nsecs_t timestamp; - }; - - struct VSync { - uint32_t count; - }; - - Header header; - union { - VSync vsync; - }; - }; - -public: - /* - * DisplayEventReceiver creates and registers an event connection with - * SurfaceFlinger. VSync events are disabled by default. Call setVSyncRate - * or requestNextVsync to receive them. - * Other events start being delivered immediately. - */ - DisplayEventReceiver(); - - /* - * ~DisplayEventReceiver severs the connection with SurfaceFlinger, new events - * stop being delivered immediately. Note that the queue could have - * some events pending. These will be delivered. - */ - ~DisplayEventReceiver(); - - /* - * initCheck returns the state of DisplayEventReceiver after construction. - */ - status_t initCheck() const; - - /* - * getFd returns the file descriptor to use to receive events. - * OWNERSHIP IS RETAINED by DisplayEventReceiver. DO NOT CLOSE this - * file-descriptor. - */ - int getFd() const; - - /* - * getEvents reads events from the queue and returns how many events were - * read. Returns 0 if there are no more events or a negative error code. - * If NOT_ENOUGH_DATA is returned, the object has become invalid forever, it - * should be destroyed and getEvents() shouldn't be called again. - */ - ssize_t getEvents(Event* events, size_t count); - static ssize_t getEvents(const sp& dataChannel, - Event* events, size_t count); - - /* - * sendEvents write events to the queue and returns how many events were - * written. - */ - static ssize_t sendEvents(const sp& dataChannel, - Event const* events, size_t count); - - /* - * setVsyncRate() sets the Event::VSync delivery rate. A value of - * 1 returns every Event::VSync. A value of 2 returns every other event, - * etc... a value of 0 returns no event unless requestNextVsync() has - * been called. - */ - status_t setVsyncRate(uint32_t count); - - /* - * requestNextVsync() schedules the next Event::VSync. It has no effect - * if the vsync rate is > 0. - */ - status_t requestNextVsync(); - -private: - sp mEventConnection; - sp mDataChannel; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_DISPLAY_EVENT_H diff --git a/external/android/include/16/frameworks/native/include/gui/DummyConsumer.h b/external/android/include/16/frameworks/native/include/gui/DummyConsumer.h deleted file mode 100644 index 7fe4d40..0000000 --- a/external/android/include/16/frameworks/native/include/gui/DummyConsumer.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2012 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_GUI_DUMMYCONSUMER_H -#define ANDROID_GUI_DUMMYCONSUMER_H - -#include - -namespace android { -// ---------------------------------------------------------------------------- - - -// The DummyConsumer does not keep a reference to BufferQueue -// unlike SurfaceTexture. This prevents a circular reference from -// forming without having to use a ProxyConsumerListener -class DummyConsumer : public BufferQueue::ConsumerListener { -public: - DummyConsumer(); - virtual ~DummyConsumer(); -protected: - - // Implementation of the BufferQueue::ConsumerListener interface. These - // calls are used to notify the SurfaceTexture of asynchronous events in the - // BufferQueue. - virtual void onFrameAvailable(); - virtual void onBuffersReleased(); - -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_DUMMYCONSUMER_H diff --git a/external/android/include/16/frameworks/native/include/gui/IDisplayEventConnection.h b/external/android/include/16/frameworks/native/include/gui/IDisplayEventConnection.h deleted file mode 100644 index 86247de..0000000 --- a/external/android/include/16/frameworks/native/include/gui/IDisplayEventConnection.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2011 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_GUI_IDISPLAY_EVENT_CONNECTION_H -#define ANDROID_GUI_IDISPLAY_EVENT_CONNECTION_H - -#include -#include - -#include -#include - -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class BitTube; - -class IDisplayEventConnection : public IInterface -{ -public: - - DECLARE_META_INTERFACE(DisplayEventConnection); - - /* - * getDataChannel() returns a BitTube where to receive the events from - */ - virtual sp getDataChannel() const = 0; - - /* - * setVsyncRate() sets the vsync event delivery rate. A value of - * 1 returns every vsync events. A value of 2 returns every other events, - * etc... a value of 0 returns no event unless requestNextVsync() has - * been called. - */ - virtual void setVsyncRate(uint32_t count) = 0; - - /* - * requestNextVsync() schedules the next vsync event. It has no effect - * if the vsync rate is > 0. - */ - virtual void requestNextVsync() = 0; // asynchronous -}; - -// ---------------------------------------------------------------------------- - -class BnDisplayEventConnection : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_IDISPLAY_EVENT_CONNECTION_H diff --git a/external/android/include/16/frameworks/native/include/gui/IGraphicBufferAlloc.h b/external/android/include/16/frameworks/native/include/gui/IGraphicBufferAlloc.h deleted file mode 100644 index cee41d9..0000000 --- a/external/android/include/16/frameworks/native/include/gui/IGraphicBufferAlloc.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2011 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_GUI_IGRAPHIC_BUFFER_ALLOC_H -#define ANDROID_GUI_IGRAPHIC_BUFFER_ALLOC_H - -#include -#include - -#include -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class GraphicBuffer; - -class IGraphicBufferAlloc : public IInterface -{ -public: - DECLARE_META_INTERFACE(GraphicBufferAlloc); - - /* Create a new GraphicBuffer for the client to use. - */ - virtual sp createGraphicBuffer(uint32_t w, uint32_t h, - PixelFormat format, uint32_t usage, status_t* error) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnGraphicBufferAlloc : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_GUI_IGRAPHIC_BUFFER_ALLOC_H diff --git a/external/android/include/16/frameworks/native/include/gui/ISensorEventConnection.h b/external/android/include/16/frameworks/native/include/gui/ISensorEventConnection.h deleted file mode 100644 index 749065e..0000000 --- a/external/android/include/16/frameworks/native/include/gui/ISensorEventConnection.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_ISENSOR_EVENT_CONNECTION_H -#define ANDROID_GUI_ISENSOR_EVENT_CONNECTION_H - -#include -#include - -#include -#include - -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class BitTube; - -class ISensorEventConnection : public IInterface -{ -public: - DECLARE_META_INTERFACE(SensorEventConnection); - - virtual sp getSensorChannel() const = 0; - virtual status_t enableDisable(int handle, bool enabled) = 0; - virtual status_t setEventRate(int handle, nsecs_t ns) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnSensorEventConnection : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_ISENSOR_EVENT_CONNECTION_H diff --git a/external/android/include/16/frameworks/native/include/gui/ISensorServer.h b/external/android/include/16/frameworks/native/include/gui/ISensorServer.h deleted file mode 100644 index 9c8afc5..0000000 --- a/external/android/include/16/frameworks/native/include/gui/ISensorServer.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_ISENSORSERVER_H -#define ANDROID_GUI_ISENSORSERVER_H - -#include -#include - -#include -#include - -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class Sensor; -class ISensorEventConnection; - -class ISensorServer : public IInterface -{ -public: - DECLARE_META_INTERFACE(SensorServer); - - virtual Vector getSensorList() = 0; - virtual sp createSensorEventConnection() = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnSensorServer : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_ISENSORSERVER_H diff --git a/external/android/include/16/frameworks/native/include/gui/ISurface.h b/external/android/include/16/frameworks/native/include/gui/ISurface.h deleted file mode 100644 index c0ff9fc..0000000 --- a/external/android/include/16/frameworks/native/include/gui/ISurface.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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_GUI_ISURFACE_H -#define ANDROID_GUI_ISURFACE_H - -#include -#include - -#include -#include - -#include - -#include - -namespace android { - -typedef int32_t SurfaceID; - -class ISurfaceTexture; - -class ISurface : public IInterface -{ -protected: - enum { - GET_SURFACE_TEXTURE = IBinder::FIRST_CALL_TRANSACTION, - }; - -public: - DECLARE_META_INTERFACE(Surface); - - virtual sp getSurfaceTexture() const = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnSurface : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_GUI_ISURFACE_H diff --git a/external/android/include/16/frameworks/native/include/gui/ISurfaceComposer.h b/external/android/include/16/frameworks/native/include/gui/ISurfaceComposer.h deleted file mode 100644 index 7320e4d..0000000 --- a/external/android/include/16/frameworks/native/include/gui/ISurfaceComposer.h +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright (C) 2006 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_GUI_ISURFACE_COMPOSER_H -#define ANDROID_GUI_ISURFACE_COMPOSER_H - -#include -#include - -#include -#include - -#include - -#include - -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class ComposerState; -class IDisplayEventConnection; -class IMemoryHeap; - -class ISurfaceComposer : public IInterface -{ -public: - DECLARE_META_INTERFACE(SurfaceComposer); - - enum { // (keep in sync with Surface.java) - eHidden = 0x00000004, - eDestroyBackbuffer = 0x00000020, - eSecure = 0x00000080, - eNonPremultiplied = 0x00000100, - eOpaque = 0x00000400, - eProtectedByApp = 0x00000800, - eProtectedByDRM = 0x00001000, - - eFXSurfaceNormal = 0x00000000, - eFXSurfaceBlur = 0x00010000, - eFXSurfaceDim = 0x00020000, - eFXSurfaceScreenshot= 0x00030000, - eFXSurfaceMask = 0x000F0000, - }; - - enum { - ePositionChanged = 0x00000001, - eLayerChanged = 0x00000002, - eSizeChanged = 0x00000004, - eAlphaChanged = 0x00000008, - eMatrixChanged = 0x00000010, - eTransparentRegionChanged = 0x00000020, - eVisibilityChanged = 0x00000040, - eFreezeTintChanged = 0x00000080, - eCropChanged = 0x00000100, - }; - - enum { - eLayerHidden = 0x01, - eLayerFrozen = 0x02, - eLayerDither = 0x04, - eLayerFilter = 0x08, - eLayerBlurFreeze = 0x10 - }; - - enum { - eOrientationDefault = 0, - eOrientation90 = 1, - eOrientation180 = 2, - eOrientation270 = 3, - eOrientationUnchanged = 4, - eOrientationSwapMask = 0x01 - }; - - enum { - eSynchronous = 0x01, - }; - - enum { - eElectronBeamAnimationOn = 0x01, - eElectronBeamAnimationOff = 0x10 - }; - - /* create connection with surface flinger, requires - * ACCESS_SURFACE_FLINGER permission - */ - virtual sp createConnection() = 0; - - /* create a graphic buffer allocator - */ - virtual sp createGraphicBufferAlloc() = 0; - - /* retrieve the control block */ - virtual sp getCblk() const = 0; - - /* open/close transactions. requires ACCESS_SURFACE_FLINGER permission */ - virtual void setTransactionState(const Vector& state, - int orientation, uint32_t flags) = 0; - - /* signal that we're done booting. - * Requires ACCESS_SURFACE_FLINGER permission - */ - virtual void bootFinished() = 0; - - /* Capture the specified screen. requires READ_FRAME_BUFFER permission - * This function will fail if there is a secure window on screen. - */ - virtual status_t captureScreen(DisplayID dpy, - sp* heap, - uint32_t* width, uint32_t* height, PixelFormat* format, - uint32_t reqWidth, uint32_t reqHeight, - uint32_t minLayerZ, uint32_t maxLayerZ) = 0; - - /* triggers screen off animation */ - virtual status_t turnElectronBeamOff(int32_t mode) = 0; - - /* triggers screen on animation */ - virtual status_t turnElectronBeamOn(int32_t mode) = 0; - - /* verify that an ISurfaceTexture was created by SurfaceFlinger. - */ - virtual bool authenticateSurfaceTexture( - const sp& surface) const = 0; - - /* return an IDisplayEventConnection */ - virtual sp createDisplayEventConnection() = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnSurfaceComposer : public BnInterface -{ -public: - enum { - // Note: BOOT_FINISHED must remain this value, it is called from - // Java by ActivityManagerService. - BOOT_FINISHED = IBinder::FIRST_CALL_TRANSACTION, - CREATE_CONNECTION, - CREATE_GRAPHIC_BUFFER_ALLOC, - GET_CBLK, - SET_TRANSACTION_STATE, - SET_ORIENTATION, - CAPTURE_SCREEN, - TURN_ELECTRON_BEAM_OFF, - TURN_ELECTRON_BEAM_ON, - AUTHENTICATE_SURFACE, - CREATE_DISPLAY_EVENT_CONNECTION, - }; - - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_GUI_ISURFACE_COMPOSER_H diff --git a/external/android/include/16/frameworks/native/include/gui/ISurfaceComposerClient.h b/external/android/include/16/frameworks/native/include/gui/ISurfaceComposerClient.h deleted file mode 100644 index c793933..0000000 --- a/external/android/include/16/frameworks/native/include/gui/ISurfaceComposerClient.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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_GUI_ISURFACE_COMPOSER_CLIENT_H -#define ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H - -#include -#include - -#include -#include - -#include - -#include - -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -typedef int32_t DisplayID; - -// ---------------------------------------------------------------------------- - -class ISurfaceComposerClient : public IInterface -{ -public: - DECLARE_META_INTERFACE(SurfaceComposerClient); - - struct surface_data_t { - int32_t token; - int32_t identity; - status_t readFromParcel(const Parcel& parcel); - status_t writeToParcel(Parcel* parcel) const; - }; - - /* - * Requires ACCESS_SURFACE_FLINGER permission - */ - virtual sp createSurface( surface_data_t* data, - const String8& name, - DisplayID display, - uint32_t w, - uint32_t h, - PixelFormat format, - uint32_t flags) = 0; - - /* - * Requires ACCESS_SURFACE_FLINGER permission - */ - virtual status_t destroySurface(SurfaceID sid) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnSurfaceComposerClient : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H diff --git a/external/android/include/16/frameworks/native/include/gui/ISurfaceTexture.h b/external/android/include/16/frameworks/native/include/gui/ISurfaceTexture.h deleted file mode 100644 index 1e33764..0000000 --- a/external/android/include/16/frameworks/native/include/gui/ISurfaceTexture.h +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_ISURFACETEXTURE_H -#define ANDROID_GUI_ISURFACETEXTURE_H - -#include -#include - -#include -#include - -#include - -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class SurfaceTextureClient; - -class ISurfaceTexture : public IInterface -{ -public: - DECLARE_META_INTERFACE(SurfaceTexture); - -protected: - friend class SurfaceTextureClient; - - enum { - BUFFER_NEEDS_REALLOCATION = 0x1, - RELEASE_ALL_BUFFERS = 0x2, - }; - - // requestBuffer requests a new buffer for the given index. The server (i.e. - // the ISurfaceTexture implementation) assigns the newly created buffer to - // the given slot index, and the client is expected to mirror the - // slot->buffer mapping so that it's not necessary to transfer a - // GraphicBuffer for every dequeue operation. - virtual status_t requestBuffer(int slot, sp* buf) = 0; - - // setBufferCount sets the number of buffer slots available. Calling this - // will also cause all buffer slots to be emptied. The caller should empty - // its mirrored copy of the buffer slots when calling this method. - virtual status_t setBufferCount(int bufferCount) = 0; - - // dequeueBuffer requests a new buffer slot for the client to use. Ownership - // of the slot is transfered to the client, meaning that the server will not - // use the contents of the buffer associated with that slot. The slot index - // returned may or may not contain a buffer. If the slot is empty the client - // should call requestBuffer to assign a new buffer to that slot. The client - // is expected to either call cancelBuffer on the dequeued slot or to fill - // in the contents of its associated buffer contents and call queueBuffer. - // If dequeueBuffer return BUFFER_NEEDS_REALLOCATION, the client is - // expected to call requestBuffer immediately. - virtual status_t dequeueBuffer(int *slot, uint32_t w, uint32_t h, - uint32_t format, uint32_t usage) = 0; - - // queueBuffer indicates that the client has finished filling in the - // contents of the buffer associated with slot and transfers ownership of - // that slot back to the server. It is not valid to call queueBuffer on a - // slot that is not owned by the client or one for which a buffer associated - // via requestBuffer. In addition, a timestamp must be provided by the - // client for this buffer. The timestamp is measured in nanoseconds, and - // must be monotonically increasing. Its other properties (zero point, etc) - // are client-dependent, and should be documented by the client. - // - // outWidth, outHeight and outTransform are filled with the default width - // and height of the window and current transform applied to buffers, - // respectively. - - // QueueBufferInput must be a POD structure - struct QueueBufferInput { - inline QueueBufferInput(int64_t timestamp, - const Rect& crop, int scalingMode, uint32_t transform) - : timestamp(timestamp), crop(crop), scalingMode(scalingMode), - transform(transform) { } - inline void deflate(int64_t* outTimestamp, Rect* outCrop, - int* outScalingMode, uint32_t* outTransform) const { - *outTimestamp = timestamp; - *outCrop = crop; - *outScalingMode = scalingMode; - *outTransform = transform; - } - private: - int64_t timestamp; - Rect crop; - int scalingMode; - uint32_t transform; - }; - - // QueueBufferOutput must be a POD structure - struct QueueBufferOutput { - inline QueueBufferOutput() { } - inline void deflate(uint32_t* outWidth, - uint32_t* outHeight, - uint32_t* outTransformHint, - uint32_t* outNumPendingBuffers) const { - *outWidth = width; - *outHeight = height; - *outTransformHint = transformHint; - *outNumPendingBuffers = numPendingBuffers; - } - inline void inflate(uint32_t inWidth, uint32_t inHeight, - uint32_t inTransformHint, uint32_t inNumPendingBuffers) { - width = inWidth; - height = inHeight; - transformHint = inTransformHint; - numPendingBuffers = inNumPendingBuffers; - } - private: - uint32_t width; - uint32_t height; - uint32_t transformHint; - uint32_t numPendingBuffers; - }; - - virtual status_t queueBuffer(int slot, - const QueueBufferInput& input, QueueBufferOutput* output) = 0; - - // cancelBuffer indicates that the client does not wish to fill in the - // buffer associated with slot and transfers ownership of the slot back to - // the server. - virtual void cancelBuffer(int slot) = 0; - - // query retrieves some information for this surface - // 'what' tokens allowed are that of android_natives.h - virtual int query(int what, int* value) = 0; - - // setSynchronousMode set whether dequeueBuffer is synchronous or - // asynchronous. In synchronous mode, dequeueBuffer blocks until - // a buffer is available, the currently bound buffer can be dequeued and - // queued buffers will be retired in order. - // The default mode is asynchronous. - virtual status_t setSynchronousMode(bool enabled) = 0; - - // connect attempts to connect a client API to the SurfaceTexture. This - // must be called before any other ISurfaceTexture methods are called except - // for getAllocator. - // - // This method will fail if the connect was previously called on the - // SurfaceTexture and no corresponding disconnect call was made. - // - // outWidth, outHeight and outTransform are filled with the default width - // and height of the window and current transform applied to buffers, - // respectively. - virtual status_t connect(int api, QueueBufferOutput* output) = 0; - - // disconnect attempts to disconnect a client API from the SurfaceTexture. - // Calling this method will cause any subsequent calls to other - // ISurfaceTexture methods to fail except for getAllocator and connect. - // Successfully calling connect after this will allow the other methods to - // succeed again. - // - // This method will fail if the the SurfaceTexture is not currently - // connected to the specified client API. - virtual status_t disconnect(int api) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnSurfaceTexture : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_ISURFACETEXTURE_H diff --git a/external/android/include/16/frameworks/native/include/gui/Sensor.h b/external/android/include/16/frameworks/native/include/gui/Sensor.h deleted file mode 100644 index e59757a..0000000 --- a/external/android/include/16/frameworks/native/include/gui/Sensor.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_SENSOR_H -#define ANDROID_GUI_SENSOR_H - -#include -#include - -#include -#include -#include -#include - -#include - -#include - -// ---------------------------------------------------------------------------- -// Concrete types for the NDK -struct ASensor { }; - -// ---------------------------------------------------------------------------- -namespace android { -// ---------------------------------------------------------------------------- - -class Parcel; - -// ---------------------------------------------------------------------------- - -class Sensor : public ASensor, public Flattenable -{ -public: - enum { - TYPE_ACCELEROMETER = ASENSOR_TYPE_ACCELEROMETER, - TYPE_MAGNETIC_FIELD = ASENSOR_TYPE_MAGNETIC_FIELD, - TYPE_GYROSCOPE = ASENSOR_TYPE_GYROSCOPE, - TYPE_LIGHT = ASENSOR_TYPE_LIGHT, - TYPE_PROXIMITY = ASENSOR_TYPE_PROXIMITY - }; - - Sensor(); - Sensor(struct sensor_t const* hwSensor); - virtual ~Sensor(); - - const String8& getName() const; - const String8& getVendor() const; - int32_t getHandle() const; - int32_t getType() const; - float getMinValue() const; - float getMaxValue() const; - float getResolution() const; - float getPowerUsage() const; - int32_t getMinDelay() const; - nsecs_t getMinDelayNs() const; - int32_t getVersion() const; - - // Flattenable interface - virtual size_t getFlattenedSize() const; - virtual size_t getFdCount() const; - virtual status_t flatten(void* buffer, size_t size, - int fds[], size_t count) const; - virtual status_t unflatten(void const* buffer, size_t size, - int fds[], size_t count); - -private: - String8 mName; - String8 mVendor; - int32_t mHandle; - int32_t mType; - float mMinValue; - float mMaxValue; - float mResolution; - float mPower; - int32_t mMinDelay; - int32_t mVersion; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_SENSOR_H diff --git a/external/android/include/16/frameworks/native/include/gui/SensorEventQueue.h b/external/android/include/16/frameworks/native/include/gui/SensorEventQueue.h deleted file mode 100644 index 759b5cb..0000000 --- a/external/android/include/16/frameworks/native/include/gui/SensorEventQueue.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2010 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_SENSOR_EVENT_QUEUE_H -#define ANDROID_SENSOR_EVENT_QUEUE_H - -#include -#include - -#include -#include -#include - -#include - -// ---------------------------------------------------------------------------- - -struct ALooper; -struct ASensorEvent; - -// Concrete types for the NDK -struct ASensorEventQueue { - ALooper* looper; -}; - -// ---------------------------------------------------------------------------- -namespace android { -// ---------------------------------------------------------------------------- - -class ISensorEventConnection; -class Sensor; -class Looper; - -// ---------------------------------------------------------------------------- - -class SensorEventQueue : public ASensorEventQueue, public RefBase -{ -public: - SensorEventQueue(const sp& connection); - virtual ~SensorEventQueue(); - virtual void onFirstRef(); - - int getFd() const; - - static ssize_t write(const sp& tube, - ASensorEvent const* events, size_t numEvents); - - ssize_t read(ASensorEvent* events, size_t numEvents); - - status_t waitForEvent() const; - status_t wake() const; - - status_t enableSensor(Sensor const* sensor) const; - status_t disableSensor(Sensor const* sensor) const; - status_t setEventRate(Sensor const* sensor, nsecs_t ns) const; - - // these are here only to support SensorManager.java - status_t enableSensor(int32_t handle, int32_t us) const; - status_t disableSensor(int32_t handle) const; - -private: - sp getLooper() const; - sp mSensorEventConnection; - sp mSensorChannel; - mutable Mutex mLock; - mutable sp mLooper; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_SENSOR_EVENT_QUEUE_H diff --git a/external/android/include/16/frameworks/native/include/gui/SensorManager.h b/external/android/include/16/frameworks/native/include/gui/SensorManager.h deleted file mode 100644 index 3176462..0000000 --- a/external/android/include/16/frameworks/native/include/gui/SensorManager.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_SENSOR_MANAGER_H -#define ANDROID_GUI_SENSOR_MANAGER_H - -#include -#include - -#include - -#include -#include -#include -#include - -#include - -// ---------------------------------------------------------------------------- -// Concrete types for the NDK -struct ASensorManager { }; - -// ---------------------------------------------------------------------------- -namespace android { -// ---------------------------------------------------------------------------- - -class ISensorServer; -class Sensor; -class SensorEventQueue; - -// ---------------------------------------------------------------------------- - -class SensorManager : - public ASensorManager, - public Singleton -{ -public: - SensorManager(); - ~SensorManager(); - - ssize_t getSensorList(Sensor const* const** list) const; - Sensor const* getDefaultSensor(int type); - sp createEventQueue(); - -private: - // DeathRecipient interface - void sensorManagerDied(); - - status_t assertStateLocked() const; - -private: - mutable Mutex mLock; - mutable sp mSensorServer; - mutable Sensor const** mSensorList; - mutable Vector mSensors; - mutable sp mDeathObserver; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_SENSOR_MANAGER_H diff --git a/external/android/include/16/frameworks/native/include/gui/Surface.h b/external/android/include/16/frameworks/native/include/gui/Surface.h deleted file mode 100644 index 50bdf71..0000000 --- a/external/android/include/16/frameworks/native/include/gui/Surface.h +++ /dev/null @@ -1,176 +0,0 @@ -/* - * 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_GUI_SURFACE_H -#define ANDROID_GUI_SURFACE_H - -#include -#include - -#include -#include -#include - -#include -#include - -#include -#include -#include - -#define ANDROID_VIEW_SURFACE_JNI_ID "mNativeSurface" - -namespace android { - -// --------------------------------------------------------------------------- - -class ISurfaceTexture; -class Surface; -class SurfaceComposerClient; - -// --------------------------------------------------------------------------- - -class SurfaceControl : public RefBase -{ -public: - static bool isValid(const sp& surface) { - return (surface != 0) && surface->isValid(); - } - bool isValid() { - return mToken>=0 && mClient!=0; - } - static bool isSameSurface( - const sp& lhs, const sp& rhs); - - uint32_t getIdentity() const { return mIdentity; } - - // release surface data from java - void clear(); - - status_t setLayer(int32_t layer); - status_t setPosition(int32_t x, int32_t y); - status_t setSize(uint32_t w, uint32_t h); - status_t hide(); - status_t show(int32_t layer = -1); - status_t freeze(); - status_t unfreeze(); - status_t setFlags(uint32_t flags, uint32_t mask); - status_t setTransparentRegionHint(const Region& transparent); - status_t setAlpha(float alpha=1.0f); - status_t setMatrix(float dsdx, float dtdx, float dsdy, float dtdy); - status_t setFreezeTint(uint32_t tint); - status_t setCrop(const Rect& crop); - - static status_t writeSurfaceToParcel( - const sp& control, Parcel* parcel); - - sp getSurface() const; - -private: - // can't be copied - SurfaceControl& operator = (SurfaceControl& rhs); - SurfaceControl(const SurfaceControl& rhs); - - friend class SurfaceComposerClient; - friend class Surface; - - SurfaceControl( - const sp& client, - const sp& surface, - const ISurfaceComposerClient::surface_data_t& data); - - ~SurfaceControl(); - - status_t validate() const; - void destroy(); - - sp mClient; - sp mSurface; - SurfaceID mToken; - uint32_t mIdentity; - mutable Mutex mLock; - - mutable sp mSurfaceData; -}; - -// --------------------------------------------------------------------------- - -class Surface : public SurfaceTextureClient -{ -public: - struct SurfaceInfo { - uint32_t w; - uint32_t h; - uint32_t s; - uint32_t usage; - PixelFormat format; - void* bits; - uint32_t reserved[2]; - }; - - explicit Surface(const sp& st); - - static status_t writeToParcel(const sp& control, Parcel* parcel); - - static sp readFromParcel(const Parcel& data); - static bool isValid(const sp& surface) { - return (surface != 0) && surface->isValid(); - } - - bool isValid(); - uint32_t getIdentity() const { return mIdentity; } - sp getSurfaceTexture(); - - // the lock/unlock APIs must be used from the same thread - status_t lock(SurfaceInfo* info, Region* dirty = NULL); - status_t unlockAndPost(); - - sp asBinder() const; - -private: - // this is just to be able to write some unit tests - friend class Test; - friend class SurfaceControl; - - // can't be copied - Surface& operator = (Surface& rhs); - Surface(const Surface& rhs); - - explicit Surface(const sp& control); - Surface(const Parcel& data, const sp& ref); - ~Surface(); - - /* - * private stuff... - */ - void init(const sp& surfaceTexture); - - static void cleanCachedSurfacesLocked(); - - virtual int query(int what, int* value) const; - - // constants - sp mSurface; - uint32_t mIdentity; - - // A cache of Surface objects that have been deserialized into this process. - static Mutex sCachedSurfacesLock; - static DefaultKeyedVector, wp > sCachedSurfaces; -}; - -}; // namespace android - -#endif // ANDROID_GUI_SURFACE_H diff --git a/external/android/include/16/frameworks/native/include/gui/SurfaceComposerClient.h b/external/android/include/16/frameworks/native/include/gui/SurfaceComposerClient.h deleted file mode 100644 index 3bd10de..0000000 --- a/external/android/include/16/frameworks/native/include/gui/SurfaceComposerClient.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - * 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_GUI_SURFACE_COMPOSER_CLIENT_H -#define ANDROID_GUI_SURFACE_COMPOSER_CLIENT_H - -#include -#include - -#include - -#include -#include -#include -#include - -#include - -#include - -namespace android { - -// --------------------------------------------------------------------------- - -class DisplayInfo; -class Composer; -class IMemoryHeap; -class ISurfaceComposerClient; -class Region; - -// --------------------------------------------------------------------------- - -class SurfaceComposerClient : public RefBase -{ - friend class Composer; -public: - SurfaceComposerClient(); - virtual ~SurfaceComposerClient(); - - // Always make sure we could initialize - status_t initCheck() const; - - // Return the connection of this client - sp connection() const; - - // Forcibly remove connection before all references have gone away. - void dispose(); - - // ------------------------------------------------------------------------ - // surface creation / destruction - - //! Create a surface - sp createSurface( - const String8& name,// name of the surface - DisplayID display, // Display to create this surface on - uint32_t w, // width in pixel - uint32_t h, // height in pixel - PixelFormat format, // pixel-format desired - uint32_t flags = 0 // usage flags - ); - - sp createSurface( - DisplayID display, // Display to create this surface on - uint32_t w, // width in pixel - uint32_t h, // height in pixel - PixelFormat format, // pixel-format desired - uint32_t flags = 0 // usage flags - ); - - - // ------------------------------------------------------------------------ - // Composer parameters - // All composer parameters must be changed within a transaction - // several surfaces can be updated in one transaction, all changes are - // committed at once when the transaction is closed. - // closeGlobalTransaction() usually requires an IPC with the server. - - //! Open a composer transaction on all active SurfaceComposerClients. - static void openGlobalTransaction(); - - //! Close a composer transaction on all active SurfaceComposerClients. - static void closeGlobalTransaction(bool synchronous = false); - - //! Freeze the specified display but not transactions. - static status_t freezeDisplay(DisplayID dpy, uint32_t flags = 0); - - //! Resume updates on the specified display. - static status_t unfreezeDisplay(DisplayID dpy, uint32_t flags = 0); - - //! Set the orientation of the given display - static int setOrientation(DisplayID dpy, int orientation, uint32_t flags); - - // Query the number of displays - static ssize_t getNumberOfDisplays(); - - // Get information about a display - static status_t getDisplayInfo(DisplayID dpy, DisplayInfo* info); - static ssize_t getDisplayWidth(DisplayID dpy); - static ssize_t getDisplayHeight(DisplayID dpy); - static ssize_t getDisplayOrientation(DisplayID dpy); - - status_t linkToComposerDeath(const sp& recipient, - void* cookie = NULL, uint32_t flags = 0); - - status_t hide(SurfaceID id); - status_t show(SurfaceID id, int32_t layer = -1); - status_t freeze(SurfaceID id); - status_t unfreeze(SurfaceID id); - status_t setFlags(SurfaceID id, uint32_t flags, uint32_t mask); - status_t setTransparentRegionHint(SurfaceID id, const Region& transparent); - status_t setLayer(SurfaceID id, int32_t layer); - status_t setAlpha(SurfaceID id, float alpha=1.0f); - status_t setFreezeTint(SurfaceID id, uint32_t tint); - status_t setMatrix(SurfaceID id, float dsdx, float dtdx, float dsdy, float dtdy); - status_t setPosition(SurfaceID id, float x, float y); - status_t setSize(SurfaceID id, uint32_t w, uint32_t h); - status_t setCrop(SurfaceID id, const Rect& crop); - status_t destroySurface(SurfaceID sid); - -private: - virtual void onFirstRef(); - Composer& getComposer(); - - mutable Mutex mLock; - status_t mStatus; - sp mClient; - Composer& mComposer; -}; - -// --------------------------------------------------------------------------- - -class ScreenshotClient -{ - sp mHeap; - uint32_t mWidth; - uint32_t mHeight; - PixelFormat mFormat; -public: - ScreenshotClient(); - - // frees the previous screenshot and capture a new one - status_t update(); - status_t update(uint32_t reqWidth, uint32_t reqHeight); - status_t update(uint32_t reqWidth, uint32_t reqHeight, - uint32_t minLayerZ, uint32_t maxLayerZ); - - // release memory occupied by the screenshot - void release(); - - // pixels are valid until this object is freed or - // release() or update() is called - void const* getPixels() const; - - uint32_t getWidth() const; - uint32_t getHeight() const; - PixelFormat getFormat() const; - uint32_t getStride() const; - // size of allocated memory in bytes - size_t getSize() const; -}; - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_SURFACE_COMPOSER_CLIENT_H diff --git a/external/android/include/16/frameworks/native/include/gui/SurfaceTexture.h b/external/android/include/16/frameworks/native/include/gui/SurfaceTexture.h deleted file mode 100644 index 2635e2f..0000000 --- a/external/android/include/16/frameworks/native/include/gui/SurfaceTexture.h +++ /dev/null @@ -1,420 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_SURFACETEXTURE_H -#define ANDROID_GUI_SURFACETEXTURE_H - -#include -#include -#include -#include - -#include -#include - -#include - -#include -#include -#include - -#define ANDROID_GRAPHICS_SURFACETEXTURE_JNI_ID "mSurfaceTexture" - -namespace android { -// ---------------------------------------------------------------------------- - - -class String8; - -class SurfaceTexture : public virtual RefBase, - protected BufferQueue::ConsumerListener { -public: - struct FrameAvailableListener : public virtual RefBase { - // onFrameAvailable() is called each time an additional frame becomes - // available for consumption. This means that frames that are queued - // while in asynchronous mode only trigger the callback if no previous - // frames are pending. Frames queued while in synchronous mode always - // trigger the callback. - // - // This is called without any lock held and can be called concurrently - // by multiple threads. - virtual void onFrameAvailable() = 0; - }; - - // SurfaceTexture constructs a new SurfaceTexture object. tex indicates the - // name of the OpenGL ES texture to which images are to be streamed. - // allowSynchronousMode specifies whether or not synchronous mode can be - // enabled. texTarget specifies the OpenGL ES texture target to which the - // texture will be bound in updateTexImage. useFenceSync specifies whether - // fences should be used to synchronize access to buffers if that behavior - // is enabled at compile-time. A custom bufferQueue can be specified - // if behavior for queue/dequeue/connect etc needs to be customized. - // Otherwise a default BufferQueue will be created and used. - // - // For legacy reasons, the SurfaceTexture is created in a state where it is - // considered attached to an OpenGL ES context for the purposes of the - // attachToContext and detachFromContext methods. However, despite being - // considered "attached" to a context, the specific OpenGL ES context - // doesn't get latched until the first call to updateTexImage. After that - // point, all calls to updateTexImage must be made with the same OpenGL ES - // context current. - // - // A SurfaceTexture may be detached from one OpenGL ES context and then - // attached to a different context using the detachFromContext and - // attachToContext methods, respectively. The intention of these methods is - // purely to allow a SurfaceTexture to be transferred from one consumer - // context to another. If such a transfer is not needed there is no - // requirement that either of these methods be called. - SurfaceTexture(GLuint tex, bool allowSynchronousMode = true, - GLenum texTarget = GL_TEXTURE_EXTERNAL_OES, bool useFenceSync = true, - const sp &bufferQueue = 0); - - virtual ~SurfaceTexture(); - - // updateTexImage sets the image contents of the target texture to that of - // the most recently queued buffer. - // - // This call may only be made while the OpenGL ES context to which the - // target texture belongs is bound to the calling thread. - status_t updateTexImage(); - - // setBufferCountServer set the buffer count. If the client has requested - // a buffer count using setBufferCount, the server-buffer count will - // take effect once the client sets the count back to zero. - status_t setBufferCountServer(int bufferCount); - - // getTransformMatrix retrieves the 4x4 texture coordinate transform matrix - // associated with the texture image set by the most recent call to - // updateTexImage. - // - // This transform matrix maps 2D homogeneous texture coordinates of the form - // (s, t, 0, 1) with s and t in the inclusive range [0, 1] to the texture - // coordinate that should be used to sample that location from the texture. - // Sampling the texture outside of the range of this transform is undefined. - // - // This transform is necessary to compensate for transforms that the stream - // content producer may implicitly apply to the content. By forcing users of - // a SurfaceTexture to apply this transform we avoid performing an extra - // copy of the data that would be needed to hide the transform from the - // user. - // - // The matrix is stored in column-major order so that it may be passed - // directly to OpenGL ES via the glLoadMatrixf or glUniformMatrix4fv - // functions. - void getTransformMatrix(float mtx[16]); - - // getTimestamp retrieves the timestamp associated with the texture image - // set by the most recent call to updateTexImage. - // - // The timestamp is in nanoseconds, and is monotonically increasing. Its - // other semantics (zero point, etc) are source-dependent and should be - // documented by the source. - int64_t getTimestamp(); - - // setFrameAvailableListener sets the listener object that will be notified - // when a new frame becomes available. - void setFrameAvailableListener(const sp& listener); - - // getAllocator retrieves the binder object that must be referenced as long - // as the GraphicBuffers dequeued from this SurfaceTexture are referenced. - // Holding this binder reference prevents SurfaceFlinger from freeing the - // buffers before the client is done with them. - sp getAllocator(); - - // setDefaultBufferSize is used to set the size of buffers returned by - // requestBuffers when a with and height of zero is requested. - // A call to setDefaultBufferSize() may trigger requestBuffers() to - // be called from the client. - // The width and height parameters must be no greater than the minimum of - // GL_MAX_VIEWPORT_DIMS and GL_MAX_TEXTURE_SIZE (see: glGetIntegerv). - // An error due to invalid dimensions might not be reported until - // updateTexImage() is called. - status_t setDefaultBufferSize(uint32_t width, uint32_t height); - - // setFilteringEnabled sets whether the transform matrix should be computed - // for use with bilinear filtering. - void setFilteringEnabled(bool enabled); - - // getCurrentBuffer returns the buffer associated with the current image. - sp getCurrentBuffer() const; - - // getCurrentTextureTarget returns the texture target of the current - // texture as returned by updateTexImage(). - GLenum getCurrentTextureTarget() const; - - // getCurrentCrop returns the cropping rectangle of the current buffer. - Rect getCurrentCrop() const; - - // getCurrentTransform returns the transform of the current buffer. - uint32_t getCurrentTransform() const; - - // getCurrentScalingMode returns the scaling mode of the current buffer. - uint32_t getCurrentScalingMode() const; - - // isSynchronousMode returns whether the SurfaceTexture is currently in - // synchronous mode. - bool isSynchronousMode() const; - - // abandon frees all the buffers and puts the SurfaceTexture into the - // 'abandoned' state. Once put in this state the SurfaceTexture can never - // leave it. When in the 'abandoned' state, all methods of the - // ISurfaceTexture interface will fail with the NO_INIT error. - // - // Note that while calling this method causes all the buffers to be freed - // from the perspective of the the SurfaceTexture, if there are additional - // references on the buffers (e.g. if a buffer is referenced by a client or - // by OpenGL ES as a texture) then those buffer will remain allocated. - void abandon(); - - // set the name of the SurfaceTexture that will be used to identify it in - // log messages. - void setName(const String8& name); - - // These functions call the corresponding BufferQueue implementation - // so the refactoring can proceed smoothly - status_t setDefaultBufferFormat(uint32_t defaultFormat); - status_t setConsumerUsageBits(uint32_t usage); - status_t setTransformHint(uint32_t hint); - virtual status_t setSynchronousMode(bool enabled); - - // getBufferQueue returns the BufferQueue object to which this - // SurfaceTexture is connected. - sp getBufferQueue() const; - - // detachFromContext detaches the SurfaceTexture from the calling thread's - // current OpenGL ES context. This context must be the same as the context - // that was current for previous calls to updateTexImage. - // - // Detaching a SurfaceTexture from an OpenGL ES context will result in the - // deletion of the OpenGL ES texture object into which the images were being - // streamed. After a SurfaceTexture has been detached from the OpenGL ES - // context calls to updateTexImage will fail returning INVALID_OPERATION - // until the SurfaceTexture is attached to a new OpenGL ES context using the - // attachToContext method. - status_t detachFromContext(); - - // attachToContext attaches a SurfaceTexture that is currently in the - // 'detached' state to the current OpenGL ES context. A SurfaceTexture is - // in the 'detached' state iff detachFromContext has successfully been - // called and no calls to attachToContext have succeeded since the last - // detachFromContext call. Calls to attachToContext made on a - // SurfaceTexture that is not in the 'detached' state will result in an - // INVALID_OPERATION error. - // - // The tex argument specifies the OpenGL ES texture object name in the - // new context into which the image contents will be streamed. A successful - // call to attachToContext will result in this texture object being bound to - // the texture target and populated with the image contents that were - // current at the time of the last call to detachFromContext. - status_t attachToContext(GLuint tex); - - // dump our state in a String - virtual void dump(String8& result) const; - virtual void dump(String8& result, const char* prefix, char* buffer, size_t SIZE) const; - -protected: - - // Implementation of the BufferQueue::ConsumerListener interface. These - // calls are used to notify the SurfaceTexture of asynchronous events in the - // BufferQueue. - virtual void onFrameAvailable(); - virtual void onBuffersReleased(); - - static bool isExternalFormat(uint32_t format); - -private: - // this version of updateTexImage() takes a functor used to reject or not - // the newly acquired buffer. - // this API is TEMPORARY and intended to be used by SurfaceFlinger only, - // which is why class Layer is made a friend of SurfaceTexture below. - class BufferRejecter { - friend class SurfaceTexture; - virtual bool reject(const sp& buf, - const BufferQueue::BufferItem& item) = 0; - protected: - virtual ~BufferRejecter() { } - }; - friend class Layer; - status_t updateTexImage(BufferRejecter* rejecter); - - // createImage creates a new EGLImage from a GraphicBuffer. - EGLImageKHR createImage(EGLDisplay dpy, - const sp& graphicBuffer); - - // freeBufferLocked frees up the given buffer slot. If the slot has been - // initialized this will release the reference to the GraphicBuffer in that - // slot and destroy the EGLImage in that slot. Otherwise it has no effect. - // - // This method must be called with mMutex locked. - void freeBufferLocked(int slotIndex); - - // computeCurrentTransformMatrix computes the transform matrix for the - // current texture. It uses mCurrentTransform and the current GraphicBuffer - // to compute this matrix and stores it in mCurrentTransformMatrix. - void computeCurrentTransformMatrix(); - - // syncForReleaseLocked performs the synchronization needed to release the - // current slot from an OpenGL ES context. If needed it will set the - // current slot's fence to guard against a producer accessing the buffer - // before the outstanding accesses have completed. - status_t syncForReleaseLocked(EGLDisplay dpy); - - // The default consumer usage flags that SurfaceTexture always sets on its - // BufferQueue instance; these will be OR:d with any additional flags passed - // from the SurfaceTexture user. In particular, SurfaceTexture will always - // consume buffers as hardware textures. - static const uint32_t DEFAULT_USAGE_FLAGS = GraphicBuffer::USAGE_HW_TEXTURE; - - // mCurrentTextureBuf is the graphic buffer of the current texture. It's - // possible that this buffer is not associated with any buffer slot, so we - // must track it separately in order to support the getCurrentBuffer method. - sp mCurrentTextureBuf; - - // mCurrentCrop is the crop rectangle that applies to the current texture. - // It gets set each time updateTexImage is called. - Rect mCurrentCrop; - - // mCurrentTransform is the transform identifier for the current texture. It - // gets set each time updateTexImage is called. - uint32_t mCurrentTransform; - - // mCurrentScalingMode is the scaling mode for the current texture. It gets - // set to each time updateTexImage is called. - uint32_t mCurrentScalingMode; - - // mCurrentTransformMatrix is the transform matrix for the current texture. - // It gets computed by computeTransformMatrix each time updateTexImage is - // called. - float mCurrentTransformMatrix[16]; - - // mCurrentTimestamp is the timestamp for the current texture. It - // gets set each time updateTexImage is called. - int64_t mCurrentTimestamp; - - uint32_t mDefaultWidth, mDefaultHeight; - - // mFilteringEnabled indicates whether the transform matrix is computed for - // use with bilinear filtering. It defaults to true and is changed by - // setFilteringEnabled(). - bool mFilteringEnabled; - - // mTexName is the name of the OpenGL texture to which streamed images will - // be bound when updateTexImage is called. It is set at construction time - // and can be changed with a call to attachToContext. - GLuint mTexName; - - // mUseFenceSync indicates whether creation of the EGL_KHR_fence_sync - // extension should be used to prevent buffers from being dequeued before - // it's safe for them to be written. It gets set at construction time and - // never changes. - const bool mUseFenceSync; - - // mTexTarget is the GL texture target with which the GL texture object is - // associated. It is set in the constructor and never changed. It is - // almost always GL_TEXTURE_EXTERNAL_OES except for one use case in Android - // Browser. In that case it is set to GL_TEXTURE_2D to allow - // glCopyTexSubImage to read from the texture. This is a hack to work - // around a GL driver limitation on the number of FBO attachments, which the - // browser's tile cache exceeds. - const GLenum mTexTarget; - - // EGLSlot contains the information and object references that - // SurfaceTexture maintains about a BufferQueue buffer slot. - struct EGLSlot { - EGLSlot() - : mEglImage(EGL_NO_IMAGE_KHR), - mFence(EGL_NO_SYNC_KHR) { - } - - sp mGraphicBuffer; - - // mEglImage is the EGLImage created from mGraphicBuffer. - EGLImageKHR mEglImage; - - // mFence is the EGL sync object that must signal before the buffer - // associated with this buffer slot may be dequeued. It is initialized - // to EGL_NO_SYNC_KHR when the buffer is created and (optionally, based - // on a compile-time option) set to a new sync object in updateTexImage. - EGLSyncKHR mFence; - }; - - // mEglDisplay is the EGLDisplay with which this SurfaceTexture is currently - // associated. It is intialized to EGL_NO_DISPLAY and gets set to the - // current display when updateTexImage is called for the first time and when - // attachToContext is called. - EGLDisplay mEglDisplay; - - // mEglContext is the OpenGL ES context with which this SurfaceTexture is - // currently associated. It is initialized to EGL_NO_CONTEXT and gets set - // to the current GL context when updateTexImage is called for the first - // time and when attachToContext is called. - EGLContext mEglContext; - - // mEGLSlots stores the buffers that have been allocated by the BufferQueue - // for each buffer slot. It is initialized to null pointers, and gets - // filled in with the result of BufferQueue::acquire when the - // client dequeues a buffer from a - // slot that has not yet been used. The buffer allocated to a slot will also - // be replaced if the requested buffer usage or geometry differs from that - // of the buffer allocated to a slot. - EGLSlot mEGLSlots[BufferQueue::NUM_BUFFER_SLOTS]; - - // mAbandoned indicates that the BufferQueue will no longer be used to - // consume images buffers pushed to it using the ISurfaceTexture interface. - // It is initialized to false, and set to true in the abandon method. A - // BufferQueue that has been abandoned will return the NO_INIT error from - // all ISurfaceTexture methods capable of returning an error. - bool mAbandoned; - - // mName is a string used to identify the SurfaceTexture in log messages. - // It can be set by the setName method. - String8 mName; - - // mFrameAvailableListener is the listener object that will be called when a - // new frame becomes available. If it is not NULL it will be called from - // queueBuffer. - sp mFrameAvailableListener; - - // mCurrentTexture is the buffer slot index of the buffer that is currently - // bound to the OpenGL texture. It is initialized to INVALID_BUFFER_SLOT, - // indicating that no buffer slot is currently bound to the texture. Note, - // however, that a value of INVALID_BUFFER_SLOT does not necessarily mean - // that no buffer is bound to the texture. A call to setBufferCount will - // reset mCurrentTexture to INVALID_BUFFER_SLOT. - int mCurrentTexture; - - // The SurfaceTexture has-a BufferQueue and is responsible for creating this object - // if none is supplied - sp mBufferQueue; - - // mAttached indicates whether the SurfaceTexture is currently attached to - // an OpenGL ES context. For legacy reasons, this is initialized to true, - // indicating that the SurfaceTexture is considered to be attached to - // whatever context is current at the time of the first updateTexImage call. - // It is set to false by detachFromContext, and then set to true again by - // attachToContext. - bool mAttached; - - // mMutex is the mutex used to prevent concurrent access to the member - // variables of SurfaceTexture objects. It must be locked whenever the - // member variables are accessed. - mutable Mutex mMutex; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_SURFACETEXTURE_H diff --git a/external/android/include/16/frameworks/native/include/gui/SurfaceTextureClient.h b/external/android/include/16/frameworks/native/include/gui/SurfaceTextureClient.h deleted file mode 100644 index 8fa85b6..0000000 --- a/external/android/include/16/frameworks/native/include/gui/SurfaceTextureClient.h +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_SURFACETEXTURECLIENT_H -#define ANDROID_GUI_SURFACETEXTURECLIENT_H - -#include -#include -#include - -#include -#include - -#include -#include -#include - -struct ANativeWindow_Buffer; - -namespace android { - -class Surface; - -class SurfaceTextureClient - : public ANativeObjectBase -{ -public: - - SurfaceTextureClient(const sp& surfaceTexture); - - // SurfaceTextureClient is overloaded to assist in refactoring ST and BQ. - // SurfaceTexture is no longer an ISurfaceTexture, so client code - // calling the original constructor will fail. Thus this convenience method - // passes in the surfaceTexture's bufferQueue to the init method. - SurfaceTextureClient(const sp& surfaceTexture); - - sp getISurfaceTexture() const; - -protected: - SurfaceTextureClient(); - virtual ~SurfaceTextureClient(); - void setISurfaceTexture(const sp& surfaceTexture); - -private: - // can't be copied - SurfaceTextureClient& operator = (const SurfaceTextureClient& rhs); - SurfaceTextureClient(const SurfaceTextureClient& rhs); - void init(); - - // ANativeWindow hooks - static int hook_cancelBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer); - static int hook_dequeueBuffer(ANativeWindow* window, ANativeWindowBuffer** buffer); - static int hook_lockBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer); - static int hook_perform(ANativeWindow* window, int operation, ...); - static int hook_query(const ANativeWindow* window, int what, int* value); - static int hook_queueBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer); - static int hook_setSwapInterval(ANativeWindow* window, int interval); - - int dispatchConnect(va_list args); - int dispatchDisconnect(va_list args); - int dispatchSetBufferCount(va_list args); - int dispatchSetBuffersGeometry(va_list args); - int dispatchSetBuffersDimensions(va_list args); - int dispatchSetBuffersUserDimensions(va_list args); - int dispatchSetBuffersFormat(va_list args); - int dispatchSetScalingMode(va_list args); - int dispatchSetBuffersTransform(va_list args); - int dispatchSetBuffersTimestamp(va_list args); - int dispatchSetCrop(va_list args); - int dispatchSetPostTransformCrop(va_list args); - int dispatchSetUsage(va_list args); - int dispatchLock(va_list args); - int dispatchUnlockAndPost(va_list args); - -protected: - virtual int cancelBuffer(ANativeWindowBuffer* buffer); - virtual int dequeueBuffer(ANativeWindowBuffer** buffer); - virtual int lockBuffer(ANativeWindowBuffer* buffer); - virtual int perform(int operation, va_list args); - virtual int query(int what, int* value) const; - virtual int queueBuffer(ANativeWindowBuffer* buffer); - virtual int setSwapInterval(int interval); - - virtual int connect(int api); - virtual int disconnect(int api); - virtual int setBufferCount(int bufferCount); - virtual int setBuffersDimensions(int w, int h); - virtual int setBuffersUserDimensions(int w, int h); - virtual int setBuffersFormat(int format); - virtual int setScalingMode(int mode); - virtual int setBuffersTransform(int transform); - virtual int setBuffersTimestamp(int64_t timestamp); - virtual int setCrop(Rect const* rect); - virtual int setUsage(uint32_t reqUsage); - virtual int lock(ANativeWindow_Buffer* outBuffer, ARect* inOutDirtyBounds); - virtual int unlockAndPost(); - - enum { NUM_BUFFER_SLOTS = BufferQueue::NUM_BUFFER_SLOTS }; - enum { DEFAULT_FORMAT = PIXEL_FORMAT_RGBA_8888 }; - -private: - void freeAllBuffers(); - int getSlotFromBufferLocked(android_native_buffer_t* buffer) const; - - struct BufferSlot { - sp buffer; - Region dirtyRegion; - }; - - // mSurfaceTexture is the interface to the surface texture server. All - // operations on the surface texture client ultimately translate into - // interactions with the server using this interface. - sp mSurfaceTexture; - - // mSlots stores the buffers that have been allocated for each buffer slot. - // It is initialized to null pointers, and gets filled in with the result of - // ISurfaceTexture::requestBuffer when the client dequeues a buffer from a - // slot that has not yet been used. The buffer allocated to a slot will also - // be replaced if the requested buffer usage or geometry differs from that - // of the buffer allocated to a slot. - BufferSlot mSlots[NUM_BUFFER_SLOTS]; - - // mReqWidth is the buffer width that will be requested at the next dequeue - // operation. It is initialized to 1. - uint32_t mReqWidth; - - // mReqHeight is the buffer height that will be requested at the next - // dequeue operation. It is initialized to 1. - uint32_t mReqHeight; - - // mReqFormat is the buffer pixel format that will be requested at the next - // deuque operation. It is initialized to PIXEL_FORMAT_RGBA_8888. - uint32_t mReqFormat; - - // mReqUsage is the set of buffer usage flags that will be requested - // at the next deuque operation. It is initialized to 0. - uint32_t mReqUsage; - - // mTimestamp is the timestamp that will be used for the next buffer queue - // operation. It defaults to NATIVE_WINDOW_TIMESTAMP_AUTO, which means that - // a timestamp is auto-generated when queueBuffer is called. - int64_t mTimestamp; - - // mCrop is the crop rectangle that will be used for the next buffer - // that gets queued. It is set by calling setCrop. - Rect mCrop; - - // mScalingMode is the scaling mode that will be used for the next - // buffers that get queued. It is set by calling setScalingMode. - int mScalingMode; - - // mTransform is the transform identifier that will be used for the next - // buffer that gets queued. It is set by calling setTransform. - uint32_t mTransform; - - // mDefaultWidth is default width of the buffers, regardless of the - // native_window_set_buffers_dimensions call. - uint32_t mDefaultWidth; - - // mDefaultHeight is default height of the buffers, regardless of the - // native_window_set_buffers_dimensions call. - uint32_t mDefaultHeight; - - // mUserWidth, if non-zero, is an application-specified override - // of mDefaultWidth. This is lower priority than the width set by - // native_window_set_buffers_dimensions. - uint32_t mUserWidth; - - // mUserHeight, if non-zero, is an application-specified override - // of mDefaultHeight. This is lower priority than the height set - // by native_window_set_buffers_dimensions. - uint32_t mUserHeight; - - // mTransformHint is the transform probably applied to buffers of this - // window. this is only a hint, actual transform may differ. - uint32_t mTransformHint; - - // mConsumerRunningBehind whether the consumer is running more than - // one buffer behind the producer. - mutable bool mConsumerRunningBehind; - - // mMutex is the mutex used to prevent concurrent access to the member - // variables of SurfaceTexture objects. It must be locked whenever the - // member variables are accessed. - mutable Mutex mMutex; - - // must be used from the lock/unlock thread - sp mLockedBuffer; - sp mPostedBuffer; - bool mConnectedToCpu; - - // must be accessed from lock/unlock thread only - Region mDirtyRegion; -}; - -}; // namespace android - -#endif // ANDROID_GUI_SURFACETEXTURECLIENT_H diff --git a/external/android/include/16/frameworks/native/include/media/editor/II420ColorConverter.h b/external/android/include/16/frameworks/native/include/media/editor/II420ColorConverter.h deleted file mode 100644 index 33af61f..0000000 --- a/external/android/include/16/frameworks/native/include/media/editor/II420ColorConverter.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (C) 2011 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 II420_COLOR_CONVERTER_H - -#define II420_COLOR_CONVERTER_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct II420ColorConverter { - - /* - * getDecoderOutputFormat - * Returns the color format (OMX_COLOR_FORMATTYPE) of the decoder output. - * If it is I420 (OMX_COLOR_FormatYUV420Planar), no conversion is needed, - * and convertDecoderOutputToI420() can be a no-op. - */ - int (*getDecoderOutputFormat)(); - - /* - * convertDecoderOutputToI420 - * @Desc Converts from the decoder output format to I420 format. - * @note Caller (e.g. VideoEditor) owns the buffers - * @param decoderBits (IN) Pointer to the buffer contains decoder output - * @param decoderWidth (IN) Buffer width, as reported by the decoder - * metadata (kKeyWidth) - * @param decoderHeight (IN) Buffer height, as reported by the decoder - * metadata (kKeyHeight) - * @param decoderRect (IN) The rectangle of the actual frame, as - * reported by decoder metadata (kKeyCropRect) - * @param dstBits (OUT) Pointer to the output I420 buffer - * @return -1 Any error - * @return 0 No Error - */ - int (*convertDecoderOutputToI420)( - void* decoderBits, int decoderWidth, int decoderHeight, - ARect decoderRect, void* dstBits); - - /* - * getEncoderIntputFormat - * Returns the color format (OMX_COLOR_FORMATTYPE) of the encoder input. - * If it is I420 (OMX_COLOR_FormatYUV420Planar), no conversion is needed, - * and convertI420ToEncoderInput() and getEncoderInputBufferInfo() can - * be no-ops. - */ - int (*getEncoderInputFormat)(); - - /* convertI420ToEncoderInput - * @Desc This function converts from I420 to the encoder input format - * @note Caller (e.g. VideoEditor) owns the buffers - * @param srcBits (IN) Pointer to the input I420 buffer - * @param srcWidth (IN) Width of the I420 frame - * @param srcHeight (IN) Height of the I420 frame - * @param encoderWidth (IN) Encoder buffer width, as calculated by - * getEncoderBufferInfo() - * @param encoderHeight (IN) Encoder buffer height, as calculated by - * getEncoderBufferInfo() - * @param encoderRect (IN) Rect coordinates of the actual frame inside - * the encoder buffer, as calculated by - * getEncoderBufferInfo(). - * @param encoderBits (OUT) Pointer to the output buffer. The size of - * this buffer is calculated by - * getEncoderBufferInfo() - * @return -1 Any error - * @return 0 No Error - */ - int (*convertI420ToEncoderInput)( - void* srcBits, int srcWidth, int srcHeight, - int encoderWidth, int encoderHeight, ARect encoderRect, - void* encoderBits); - - /* getEncoderInputBufferInfo - * @Desc This function returns metadata for the encoder input buffer - * based on the actual I420 frame width and height. - * @note This API should be be used to obtain the necessary information - * before calling convertI420ToEncoderInput(). - * VideoEditor knows only the width and height of the I420 buffer, - * but it also needs know the width, height, and size of the - * encoder input buffer. The encoder input buffer width and height - * are used to set the metadata for the encoder. - * @param srcWidth (IN) Width of the I420 frame - * @param srcHeight (IN) Height of the I420 frame - * @param encoderWidth (OUT) Encoder buffer width needed - * @param encoderHeight (OUT) Encoder buffer height needed - * @param encoderRect (OUT) Rect coordinates of the actual frame inside - * the encoder buffer - * @param encoderBufferSize (OUT) The size of the buffer that need to be - * allocated by the caller before invoking - * convertI420ToEncoderInput(). - * @return -1 Any error - * @return 0 No Error - */ - int (*getEncoderInputBufferInfo)( - int srcWidth, int srcHeight, - int* encoderWidth, int* encoderHeight, - ARect* encoderRect, int* encoderBufferSize); - -} II420ColorConverter; - -/* The only function that the shared library needs to expose: It fills the - function pointers in II420ColorConverter */ -void getI420ColorConverter(II420ColorConverter *converter); - -#if defined(__cplusplus) -} -#endif - -#endif // II420_COLOR_CONVERTER_H diff --git a/external/android/include/16/frameworks/native/include/media/hardware/CryptoAPI.h b/external/android/include/16/frameworks/native/include/media/hardware/CryptoAPI.h deleted file mode 100644 index 44a0040..0000000 --- a/external/android/include/16/frameworks/native/include/media/hardware/CryptoAPI.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2012 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 - -#ifndef CRYPTO_API_H_ - -#define CRYPTO_API_H_ - -namespace android { - -struct AString; -struct CryptoPlugin; - -struct CryptoFactory { - CryptoFactory() {} - virtual ~CryptoFactory() {} - - virtual bool isCryptoSchemeSupported(const uint8_t uuid[16]) const = 0; - - virtual status_t createPlugin( - const uint8_t uuid[16], const void *data, size_t size, - CryptoPlugin **plugin) = 0; - -private: - CryptoFactory(const CryptoFactory &); - CryptoFactory &operator=(const CryptoFactory &); -}; - -struct CryptoPlugin { - enum Mode { - kMode_Unencrypted = 0, - kMode_AES_CTR = 1, - - // Neither key nor iv are being used in this mode. - // Each subsample is encrypted w/ an iv of all zeroes. - kMode_AES_WV = 2, // FIX constant - }; - - struct SubSample { - size_t mNumBytesOfClearData; - size_t mNumBytesOfEncryptedData; - }; - - CryptoPlugin() {} - virtual ~CryptoPlugin() {} - - // If this method returns false, a non-secure decoder will be used to - // decode the data after decryption. The decrypt API below will have - // to support insecure decryption of the data (secure = false) for - // media data of the given mime type. - virtual bool requiresSecureDecoderComponent(const char *mime) const = 0; - - // If the error returned falls into the range - // ERROR_DRM_VENDOR_MIN..ERROR_DRM_VENDOR_MAX, errorDetailMsg should be - // filled in with an appropriate string. - // At the java level these special errors will then trigger a - // MediaCodec.CryptoException that gives clients access to both - // the error code and the errorDetailMsg. - // Returns a non-negative result to indicate the number of bytes written - // to the dstPtr, or a negative result to indicate an error. - virtual ssize_t decrypt( - bool secure, - const uint8_t key[16], - const uint8_t iv[16], - Mode mode, - const void *srcPtr, - const SubSample *subSamples, size_t numSubSamples, - void *dstPtr, - AString *errorDetailMsg) = 0; - -private: - CryptoPlugin(const CryptoPlugin &); - CryptoPlugin &operator=(const CryptoPlugin &); -}; - -} // namespace android - -extern "C" { - extern android::CryptoFactory *createCryptoFactory(); -} - -#endif // CRYPTO_API_H_ diff --git a/external/android/include/16/frameworks/native/include/media/hardware/HardwareAPI.h b/external/android/include/16/frameworks/native/include/media/hardware/HardwareAPI.h deleted file mode 100644 index 6d5b727..0000000 --- a/external/android/include/16/frameworks/native/include/media/hardware/HardwareAPI.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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 HARDWARE_API_H_ - -#define HARDWARE_API_H_ - -#include -#include -#include - -#include - -namespace android { - -// A pointer to this struct is passed to the OMX_SetParameter when the extension -// index for the 'OMX.google.android.index.enableAndroidNativeBuffers' extension -// is given. -// -// When Android native buffer use is disabled for a port (the default state), -// the OMX node should operate as normal, and expect UseBuffer calls to set its -// buffers. This is the mode that will be used when CPU access to the buffer is -// required. -// -// When Android native buffer use has been enabled for a given port, the video -// color format for the port is to be interpreted as an Android pixel format -// rather than an OMX color format. The node should then expect to receive -// UseAndroidNativeBuffer calls (via OMX_SetParameter) rather than UseBuffer -// calls for that port. -struct EnableAndroidNativeBuffersParams { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL enable; -}; - -// A pointer to this struct is passed to OMX_SetParameter() when the extension -// index "OMX.google.android.index.storeMetaDataInBuffers" -// is given. -// -// When meta data is stored in the video buffers passed between OMX clients -// and OMX components, interpretation of the buffer data is up to the -// buffer receiver, and the data may or may not be the actual video data, but -// some information helpful for the receiver to locate the actual data. -// The buffer receiver thus needs to know how to interpret what is stored -// in these buffers, with mechanisms pre-determined externally. How to -// interpret the meta data is outside of the scope of this method. -// -// Currently, this is specifically used to pass meta data from video source -// (camera component, for instance) to video encoder to avoid memcpying of -// input video frame data. To do this, bStoreMetaDta is set to OMX_TRUE. -// If bStoreMetaData is set to false, real YUV frame data will be stored -// in the buffers. In addition, if no OMX_SetParameter() call is made -// with the corresponding extension index, real YUV data is stored -// in the buffers. -struct StoreMetaDataInBuffersParams { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL bStoreMetaData; -}; - -// A pointer to this struct is passed to OMX_SetParameter when the extension -// index for the 'OMX.google.android.index.useAndroidNativeBuffer' extension is -// given. This call will only be performed if a prior call was made with the -// 'OMX.google.android.index.enableAndroidNativeBuffers' extension index, -// enabling use of Android native buffers. -struct UseAndroidNativeBufferParams { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_PTR pAppPrivate; - OMX_BUFFERHEADERTYPE **bufferHeader; - const sp& nativeBuffer; -}; - -// A pointer to this struct is passed to OMX_GetParameter when the extension -// index for the 'OMX.google.android.index.getAndroidNativeBufferUsage' -// extension is given. The usage bits returned from this query will be used to -// allocate the Gralloc buffers that get passed to the useAndroidNativeBuffer -// command. -struct GetAndroidNativeBufferUsageParams { - OMX_U32 nSize; // IN - OMX_VERSIONTYPE nVersion; // IN - OMX_U32 nPortIndex; // IN - OMX_U32 nUsage; // OUT -}; - -// An enum OMX_COLOR_FormatAndroidOpaque to indicate an opaque colorformat -// is declared in media/stagefright/openmax/OMX_IVCommon.h -// This will inform the encoder that the actual -// colorformat will be relayed by the GRalloc Buffers. -// OMX_COLOR_FormatAndroidOpaque = 0x7F000001, - - -} // namespace android - -extern android::OMXPluginBase *createOMXPlugin(); - -#endif // HARDWARE_API_H_ diff --git a/external/android/include/16/frameworks/native/include/media/hardware/MetadataBufferType.h b/external/android/include/16/frameworks/native/include/media/hardware/MetadataBufferType.h deleted file mode 100644 index 4eaf8ac..0000000 --- a/external/android/include/16/frameworks/native/include/media/hardware/MetadataBufferType.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2011 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 METADATA_BUFFER_TYPE_H -#define METADATA_BUFFER_TYPE_H - -#ifdef __cplusplus -extern "C" { -namespace android { -#endif - -/* - * MetadataBufferType defines the type of the metadata buffers that - * can be passed to video encoder component for encoding, via Stagefright - * media recording framework. To see how to work with the metadata buffers - * in media recording framework, please consult HardwareAPI.h - * - * The creator of metadata buffers and video encoder share common knowledge - * on what is actually being stored in these metadata buffers, and - * how the information can be used by the video encoder component - * to locate the actual pixel data as the source input for video - * encoder, plus whatever other information that is necessary. Stagefright - * media recording framework does not need to know anything specific about the - * metadata buffers, except for receving each individual metadata buffer - * as the source input, making a copy of the metadata buffer, and passing the - * copy via OpenMAX API to the video encoder component. - * - * The creator of the metadata buffers must ensure that the first - * 4 bytes in every metadata buffer indicates its buffer type, - * and the rest of the metadata buffer contains the - * actual metadata information. When a video encoder component receives - * a metadata buffer, it uses the first 4 bytes in that buffer to find - * out the type of the metadata buffer, and takes action appropriate - * to that type of metadata buffers (for instance, locate the actual - * pixel data input and then encoding the input data to produce a - * compressed output buffer). - * - * The following shows the layout of a metadata buffer, - * where buffer type is a 4-byte field of MetadataBufferType, - * and the payload is the metadata information. - * - * -------------------------------------------------------------- - * | buffer type | payload | - * -------------------------------------------------------------- - * - */ -typedef enum { - - /* - * kMetadataBufferTypeCameraSource is used to indicate that - * the source of the metadata buffer is the camera component. - */ - kMetadataBufferTypeCameraSource = 0, - - /* - * kMetadataBufferTypeGrallocSource is used to indicate that - * the payload of the metadata buffers can be interpreted as - * a buffer_handle_t. - * So in this case,the metadata that the encoder receives - * will have a byte stream that consists of two parts: - * 1. First, there is an integer indicating that it is a GRAlloc - * source (kMetadataBufferTypeGrallocSource) - * 2. This is followed by the buffer_handle_t that is a handle to the - * GRalloc buffer. The encoder needs to interpret this GRalloc handle - * and encode the frames. - * -------------------------------------------------------------- - * | kMetadataBufferTypeGrallocSource | sizeof(buffer_handle_t) | - * -------------------------------------------------------------- - */ - kMetadataBufferTypeGrallocSource = 1, - - // Add more here... - -} MetadataBufferType; - -#ifdef __cplusplus -} // namespace android -} -#endif - -#endif // METADATA_BUFFER_TYPE_H diff --git a/external/android/include/16/frameworks/native/include/media/hardware/OMXPluginBase.h b/external/android/include/16/frameworks/native/include/media/hardware/OMXPluginBase.h deleted file mode 100644 index 7bf4147..0000000 --- a/external/android/include/16/frameworks/native/include/media/hardware/OMXPluginBase.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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 OMX_PLUGIN_BASE_H_ - -#define OMX_PLUGIN_BASE_H_ - -#include - -#include - -#include -#include - -namespace android { - -struct OMXPluginBase { - OMXPluginBase() {} - virtual ~OMXPluginBase() {} - - virtual OMX_ERRORTYPE makeComponentInstance( - const char *name, - const OMX_CALLBACKTYPE *callbacks, - OMX_PTR appData, - OMX_COMPONENTTYPE **component) = 0; - - virtual OMX_ERRORTYPE destroyComponentInstance( - OMX_COMPONENTTYPE *component) = 0; - - virtual OMX_ERRORTYPE enumerateComponents( - OMX_STRING name, - size_t size, - OMX_U32 index) = 0; - - virtual OMX_ERRORTYPE getRolesOfComponent( - const char *name, - Vector *roles) = 0; - -private: - OMXPluginBase(const OMXPluginBase &); - OMXPluginBase &operator=(const OMXPluginBase &); -}; - -} // namespace android - -#endif // OMX_PLUGIN_BASE_H_ diff --git a/external/android/include/16/frameworks/native/include/media/openmax/OMX_Audio.h b/external/android/include/16/frameworks/native/include/media/openmax/OMX_Audio.h deleted file mode 100644 index 89ce0fc..0000000 --- a/external/android/include/16/frameworks/native/include/media/openmax/OMX_Audio.h +++ /dev/null @@ -1,1342 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** @file OMX_Audio.h - OpenMax IL version 1.1.2 - * The structures needed by Audio components to exchange - * parameters and configuration data with the componenmilts. - */ - -#ifndef OMX_Audio_h -#define OMX_Audio_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/* Each OMX header must include all required header files to allow the - * header to compile without errors. The includes below are required - * for this header file to compile successfully - */ - -#include - -/** @defgroup midi MIDI - * @ingroup audio - */ - -/** @defgroup effects Audio effects - * @ingroup audio - */ - -/** @defgroup audio OpenMAX IL Audio Domain - * Structures for OpenMAX IL Audio domain - * @{ - */ - -/** Enumeration used to define the possible audio codings. - * If "OMX_AUDIO_CodingUnused" is selected, the coding selection must - * be done in a vendor specific way. Since this is for an audio - * processing element this enum is relevant. However, for another - * type of component other enums would be in this area. - */ -typedef enum OMX_AUDIO_CODINGTYPE { - OMX_AUDIO_CodingUnused = 0, /**< Placeholder value when coding is N/A */ - OMX_AUDIO_CodingAutoDetect, /**< auto detection of audio format */ - OMX_AUDIO_CodingPCM, /**< Any variant of PCM coding */ - OMX_AUDIO_CodingADPCM, /**< Any variant of ADPCM encoded data */ - OMX_AUDIO_CodingAMR, /**< Any variant of AMR encoded data */ - OMX_AUDIO_CodingGSMFR, /**< Any variant of GSM fullrate (i.e. GSM610) */ - OMX_AUDIO_CodingGSMEFR, /**< Any variant of GSM Enhanced Fullrate encoded data*/ - OMX_AUDIO_CodingGSMHR, /**< Any variant of GSM Halfrate encoded data */ - OMX_AUDIO_CodingPDCFR, /**< Any variant of PDC Fullrate encoded data */ - OMX_AUDIO_CodingPDCEFR, /**< Any variant of PDC Enhanced Fullrate encoded data */ - OMX_AUDIO_CodingPDCHR, /**< Any variant of PDC Halfrate encoded data */ - OMX_AUDIO_CodingTDMAFR, /**< Any variant of TDMA Fullrate encoded data (TIA/EIA-136-420) */ - OMX_AUDIO_CodingTDMAEFR, /**< Any variant of TDMA Enhanced Fullrate encoded data (TIA/EIA-136-410) */ - OMX_AUDIO_CodingQCELP8, /**< Any variant of QCELP 8kbps encoded data */ - OMX_AUDIO_CodingQCELP13, /**< Any variant of QCELP 13kbps encoded data */ - OMX_AUDIO_CodingEVRC, /**< Any variant of EVRC encoded data */ - OMX_AUDIO_CodingSMV, /**< Any variant of SMV encoded data */ - OMX_AUDIO_CodingG711, /**< Any variant of G.711 encoded data */ - OMX_AUDIO_CodingG723, /**< Any variant of G.723 dot 1 encoded data */ - OMX_AUDIO_CodingG726, /**< Any variant of G.726 encoded data */ - OMX_AUDIO_CodingG729, /**< Any variant of G.729 encoded data */ - OMX_AUDIO_CodingAAC, /**< Any variant of AAC encoded data */ - OMX_AUDIO_CodingMP3, /**< Any variant of MP3 encoded data */ - OMX_AUDIO_CodingSBC, /**< Any variant of SBC encoded data */ - OMX_AUDIO_CodingVORBIS, /**< Any variant of VORBIS encoded data */ - OMX_AUDIO_CodingWMA, /**< Any variant of WMA encoded data */ - OMX_AUDIO_CodingRA, /**< Any variant of RA encoded data */ - OMX_AUDIO_CodingMIDI, /**< Any variant of MIDI encoded data */ - OMX_AUDIO_CodingFLAC, /**< Any variant of FLAC encoded data */ - OMX_AUDIO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_CodingMax = 0x7FFFFFFF -} OMX_AUDIO_CODINGTYPE; - - -/** The PortDefinition structure is used to define all of the parameters - * necessary for the compliant component to setup an input or an output audio - * path. If additional information is needed to define the parameters of the - * port (such as frequency), additional structures must be sent such as the - * OMX_AUDIO_PARAM_PCMMODETYPE structure to supply the extra parameters for the port. - */ -typedef struct OMX_AUDIO_PORTDEFINITIONTYPE { - OMX_STRING cMIMEType; /**< MIME type of data for the port */ - OMX_NATIVE_DEVICETYPE pNativeRender; /** < platform specific reference - for an output device, - otherwise this field is 0 */ - OMX_BOOL bFlagErrorConcealment; /**< Turns on error concealment if it is - supported by the OMX component */ - OMX_AUDIO_CODINGTYPE eEncoding; /**< Type of data expected for this - port (e.g. PCM, AMR, MP3, etc) */ -} OMX_AUDIO_PORTDEFINITIONTYPE; - - -/** Port format parameter. This structure is used to enumerate - * the various data input/output format supported by the port. - */ -typedef struct OMX_AUDIO_PARAM_PORTFORMATTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Indicates which port to set */ - OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */ - OMX_AUDIO_CODINGTYPE eEncoding; /**< Type of data expected for this port (e.g. PCM, AMR, MP3, etc) */ -} OMX_AUDIO_PARAM_PORTFORMATTYPE; - - -/** PCM mode type */ -typedef enum OMX_AUDIO_PCMMODETYPE { - OMX_AUDIO_PCMModeLinear = 0, /**< Linear PCM encoded data */ - OMX_AUDIO_PCMModeALaw, /**< A law PCM encoded data (G.711) */ - OMX_AUDIO_PCMModeMULaw, /**< Mu law PCM encoded data (G.711) */ - OMX_AUDIO_PCMModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_PCMModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_PCMModeMax = 0x7FFFFFFF -} OMX_AUDIO_PCMMODETYPE; - - -typedef enum OMX_AUDIO_CHANNELTYPE { - OMX_AUDIO_ChannelNone = 0x0, /**< Unused or empty */ - OMX_AUDIO_ChannelLF = 0x1, /**< Left front */ - OMX_AUDIO_ChannelRF = 0x2, /**< Right front */ - OMX_AUDIO_ChannelCF = 0x3, /**< Center front */ - OMX_AUDIO_ChannelLS = 0x4, /**< Left surround */ - OMX_AUDIO_ChannelRS = 0x5, /**< Right surround */ - OMX_AUDIO_ChannelLFE = 0x6, /**< Low frequency effects */ - OMX_AUDIO_ChannelCS = 0x7, /**< Back surround */ - OMX_AUDIO_ChannelLR = 0x8, /**< Left rear. */ - OMX_AUDIO_ChannelRR = 0x9, /**< Right rear. */ - OMX_AUDIO_ChannelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_ChannelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_ChannelMax = 0x7FFFFFFF -} OMX_AUDIO_CHANNELTYPE; - -#define OMX_AUDIO_MAXCHANNELS 16 /**< maximum number distinct audio channels that a buffer may contain */ -#define OMX_MIN_PCMPAYLOAD_MSEC 5 /**< Minimum audio buffer payload size for uncompressed (PCM) audio */ - -/** PCM format description */ -typedef struct OMX_AUDIO_PARAM_PCMMODETYPE { - OMX_U32 nSize; /**< Size of this structure, in Bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels (e.g. 2 for stereo) */ - OMX_NUMERICALDATATYPE eNumData; /**< indicates PCM data as signed or unsigned */ - OMX_ENDIANTYPE eEndian; /**< indicates PCM data as little or big endian */ - OMX_BOOL bInterleaved; /**< True for normal interleaved data; false for - non-interleaved data (e.g. block data) */ - OMX_U32 nBitPerSample; /**< Bit per sample */ - OMX_U32 nSamplingRate; /**< Sampling rate of the source data. Use 0 for - variable or unknown sampling rate. */ - OMX_AUDIO_PCMMODETYPE ePCMMode; /**< PCM mode enumeration */ - OMX_AUDIO_CHANNELTYPE eChannelMapping[OMX_AUDIO_MAXCHANNELS]; /**< Slot i contains channel defined by eChannelMap[i] */ - -} OMX_AUDIO_PARAM_PCMMODETYPE; - - -/** Audio channel mode. This is used by both AAC and MP3, although the names are more appropriate - * for the MP3. For example, JointStereo for MP3 is CouplingChannels for AAC. - */ -typedef enum OMX_AUDIO_CHANNELMODETYPE { - OMX_AUDIO_ChannelModeStereo = 0, /**< 2 channels, the bitrate allocation between those - two channels changes accordingly to each channel information */ - OMX_AUDIO_ChannelModeJointStereo, /**< mode that takes advantage of what is common between - 2 channels for higher compression gain */ - OMX_AUDIO_ChannelModeDual, /**< 2 mono-channels, each channel is encoded with half - the bitrate of the overall bitrate */ - OMX_AUDIO_ChannelModeMono, /**< Mono channel mode */ - OMX_AUDIO_ChannelModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_ChannelModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_ChannelModeMax = 0x7FFFFFFF -} OMX_AUDIO_CHANNELMODETYPE; - - -typedef enum OMX_AUDIO_MP3STREAMFORMATTYPE { - OMX_AUDIO_MP3StreamFormatMP1Layer3 = 0, /**< MP3 Audio MPEG 1 Layer 3 Stream format */ - OMX_AUDIO_MP3StreamFormatMP2Layer3, /**< MP3 Audio MPEG 2 Layer 3 Stream format */ - OMX_AUDIO_MP3StreamFormatMP2_5Layer3, /**< MP3 Audio MPEG2.5 Layer 3 Stream format */ - OMX_AUDIO_MP3StreamFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_MP3StreamFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_MP3StreamFormatMax = 0x7FFFFFFF -} OMX_AUDIO_MP3STREAMFORMATTYPE; - -/** MP3 params */ -typedef struct OMX_AUDIO_PARAM_MP3TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable - rate or unknown bit rates */ - OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for - variable or unknown sampling rate. */ - OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should - limit the audio signal. Use 0 to let encoder decide */ - OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */ - OMX_AUDIO_MP3STREAMFORMATTYPE eFormat; /**< MP3 stream format */ -} OMX_AUDIO_PARAM_MP3TYPE; - - -typedef enum OMX_AUDIO_AACSTREAMFORMATTYPE { - OMX_AUDIO_AACStreamFormatMP2ADTS = 0, /**< AAC Audio Data Transport Stream 2 format */ - OMX_AUDIO_AACStreamFormatMP4ADTS, /**< AAC Audio Data Transport Stream 4 format */ - OMX_AUDIO_AACStreamFormatMP4LOAS, /**< AAC Low Overhead Audio Stream format */ - OMX_AUDIO_AACStreamFormatMP4LATM, /**< AAC Low overhead Audio Transport Multiplex */ - OMX_AUDIO_AACStreamFormatADIF, /**< AAC Audio Data Interchange Format */ - OMX_AUDIO_AACStreamFormatMP4FF, /**< AAC inside MPEG-4/ISO File Format */ - OMX_AUDIO_AACStreamFormatRAW, /**< AAC Raw Format */ - OMX_AUDIO_AACStreamFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_AACStreamFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_AACStreamFormatMax = 0x7FFFFFFF -} OMX_AUDIO_AACSTREAMFORMATTYPE; - - -/** AAC mode type. Note that the term profile is used with the MPEG-2 - * standard and the term object type and profile is used with MPEG-4 */ -typedef enum OMX_AUDIO_AACPROFILETYPE{ - OMX_AUDIO_AACObjectNull = 0, /**< Null, not used */ - OMX_AUDIO_AACObjectMain = 1, /**< AAC Main object */ - OMX_AUDIO_AACObjectLC, /**< AAC Low Complexity object (AAC profile) */ - OMX_AUDIO_AACObjectSSR, /**< AAC Scalable Sample Rate object */ - OMX_AUDIO_AACObjectLTP, /**< AAC Long Term Prediction object */ - OMX_AUDIO_AACObjectHE, /**< AAC High Efficiency (object type SBR, HE-AAC profile) */ - OMX_AUDIO_AACObjectScalable, /**< AAC Scalable object */ - OMX_AUDIO_AACObjectERLC = 17, /**< ER AAC Low Complexity object (Error Resilient AAC-LC) */ - OMX_AUDIO_AACObjectLD = 23, /**< AAC Low Delay object (Error Resilient) */ - OMX_AUDIO_AACObjectHE_PS = 29, /**< AAC High Efficiency with Parametric Stereo coding (HE-AAC v2, object type PS) */ - OMX_AUDIO_AACObjectELD = 39, /** AAC Enhanced Low Delay. NOTE: Pending Khronos standardization **/ - OMX_AUDIO_AACObjectKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_AACObjectVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_AACObjectMax = 0x7FFFFFFF -} OMX_AUDIO_AACPROFILETYPE; - - -/** AAC tool usage (for nAACtools in OMX_AUDIO_PARAM_AACPROFILETYPE). - * Required for encoder configuration and optional as decoder info output. - * For MP3, OMX_AUDIO_CHANNELMODETYPE is sufficient. */ -#define OMX_AUDIO_AACToolNone 0x00000000 /**< no AAC tools allowed (encoder config) or active (decoder info output) */ -#define OMX_AUDIO_AACToolMS 0x00000001 /**< MS: Mid/side joint coding tool allowed or active */ -#define OMX_AUDIO_AACToolIS 0x00000002 /**< IS: Intensity stereo tool allowed or active */ -#define OMX_AUDIO_AACToolTNS 0x00000004 /**< TNS: Temporal Noise Shaping tool allowed or active */ -#define OMX_AUDIO_AACToolPNS 0x00000008 /**< PNS: MPEG-4 Perceptual Noise substitution tool allowed or active */ -#define OMX_AUDIO_AACToolLTP 0x00000010 /**< LTP: MPEG-4 Long Term Prediction tool allowed or active */ -#define OMX_AUDIO_AACToolAll 0x7FFFFFFF /**< all AAC tools allowed or active (*/ - -/** MPEG-4 AAC error resilience (ER) tool usage (for nAACERtools in OMX_AUDIO_PARAM_AACPROFILETYPE). - * Required for ER encoder configuration and optional as decoder info output */ -#define OMX_AUDIO_AACERNone 0x00000000 /**< no AAC ER tools allowed/used */ -#define OMX_AUDIO_AACERVCB11 0x00000001 /**< VCB11: Virtual Code Books for AAC section data */ -#define OMX_AUDIO_AACERRVLC 0x00000002 /**< RVLC: Reversible Variable Length Coding */ -#define OMX_AUDIO_AACERHCR 0x00000004 /**< HCR: Huffman Codeword Reordering */ -#define OMX_AUDIO_AACERAll 0x7FFFFFFF /**< all AAC ER tools allowed/used */ - - -/** AAC params */ -typedef struct OMX_AUDIO_PARAM_AACPROFILETYPE { - OMX_U32 nSize; /**< Size of this structure, in Bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for - variable or unknown sampling rate. */ - OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable - rate or unknown bit rates */ - OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should - limit the audio signal. Use 0 to let encoder decide */ - OMX_U32 nFrameLength; /**< Frame length (in audio samples per channel) of the codec. - Can be 1024 or 960 (AAC-LC), 2048 (HE-AAC), 480 or 512 (AAC-LD). - Use 0 to let encoder decide */ - OMX_U32 nAACtools; /**< AAC tool usage */ - OMX_U32 nAACERtools; /**< MPEG-4 AAC error resilience tool usage */ - OMX_AUDIO_AACPROFILETYPE eAACProfile; /**< AAC profile enumeration */ - OMX_AUDIO_AACSTREAMFORMATTYPE eAACStreamFormat; /**< AAC stream format enumeration */ - OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */ -} OMX_AUDIO_PARAM_AACPROFILETYPE; - - -/** VORBIS params */ -typedef struct OMX_AUDIO_PARAM_VORBISTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nBitRate; /**< Bit rate of the encoded data data. Use 0 for variable - rate or unknown bit rates. Encoding is set to the - bitrate closest to specified value (in bps) */ - OMX_U32 nMinBitRate; /**< Sets minimum bitrate (in bps). */ - OMX_U32 nMaxBitRate; /**< Sets maximum bitrate (in bps). */ - - OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for - variable or unknown sampling rate. */ - OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should - limit the audio signal. Use 0 to let encoder decide */ - OMX_S32 nQuality; /**< Sets encoding quality to n, between -1 (low) and 10 (high). - In the default mode of operation, teh quality level is 3. - Normal quality range is 0 - 10. */ - OMX_BOOL bManaged; /**< Set bitrate management mode. This turns off the - normal VBR encoding, but allows hard or soft bitrate - constraints to be enforced by the encoder. This mode can - be slower, and may also be lower quality. It is - primarily useful for streaming. */ - OMX_BOOL bDownmix; /**< Downmix input from stereo to mono (has no effect on - non-stereo streams). Useful for lower-bitrate encoding. */ -} OMX_AUDIO_PARAM_VORBISTYPE; - - -/** FLAC params */ -typedef struct OMX_AUDIO_PARAM_FLACTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for - unknown sampling rate. */ - OMX_U32 nCompressionLevel;/**< FLAC compression level, from 0 (fastest compression) - to 8 (highest compression */ -} OMX_AUDIO_PARAM_FLACTYPE; - - -/** WMA Version */ -typedef enum OMX_AUDIO_WMAFORMATTYPE { - OMX_AUDIO_WMAFormatUnused = 0, /**< format unused or unknown */ - OMX_AUDIO_WMAFormat7, /**< Windows Media Audio format 7 */ - OMX_AUDIO_WMAFormat8, /**< Windows Media Audio format 8 */ - OMX_AUDIO_WMAFormat9, /**< Windows Media Audio format 9 */ - OMX_AUDIO_WMAFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_WMAFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_WMAFormatMax = 0x7FFFFFFF -} OMX_AUDIO_WMAFORMATTYPE; - - -/** WMA Profile */ -typedef enum OMX_AUDIO_WMAPROFILETYPE { - OMX_AUDIO_WMAProfileUnused = 0, /**< profile unused or unknown */ - OMX_AUDIO_WMAProfileL1, /**< Windows Media audio version 9 profile L1 */ - OMX_AUDIO_WMAProfileL2, /**< Windows Media audio version 9 profile L2 */ - OMX_AUDIO_WMAProfileL3, /**< Windows Media audio version 9 profile L3 */ - OMX_AUDIO_WMAProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_WMAProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_WMAProfileMax = 0x7FFFFFFF -} OMX_AUDIO_WMAPROFILETYPE; - - -/** WMA params */ -typedef struct OMX_AUDIO_PARAM_WMATYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U16 nChannels; /**< Number of channels */ - OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable - rate or unknown bit rates */ - OMX_AUDIO_WMAFORMATTYPE eFormat; /**< Version of WMA stream / data */ - OMX_AUDIO_WMAPROFILETYPE eProfile; /**< Profile of WMA stream / data */ - OMX_U32 nSamplingRate; /**< Sampling rate of the source data */ - OMX_U16 nBlockAlign; /**< is the block alignment, or block size, in bytes of the audio codec */ - OMX_U16 nEncodeOptions; /**< WMA Type-specific data */ - OMX_U32 nSuperBlockAlign; /**< WMA Type-specific data */ -} OMX_AUDIO_PARAM_WMATYPE; - -/** - * RealAudio format - */ -typedef enum OMX_AUDIO_RAFORMATTYPE { - OMX_AUDIO_RAFormatUnused = 0, /**< Format unused or unknown */ - OMX_AUDIO_RA8, /**< RealAudio 8 codec */ - OMX_AUDIO_RA9, /**< RealAudio 9 codec */ - OMX_AUDIO_RA10_AAC, /**< MPEG-4 AAC codec for bitrates of more than 128kbps */ - OMX_AUDIO_RA10_CODEC, /**< RealAudio codec for bitrates less than 128 kbps */ - OMX_AUDIO_RA10_LOSSLESS, /**< RealAudio Lossless */ - OMX_AUDIO_RA10_MULTICHANNEL, /**< RealAudio Multichannel */ - OMX_AUDIO_RA10_VOICE, /**< RealAudio Voice for bitrates below 15 kbps */ - OMX_AUDIO_RAFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_RAFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_RAFormatMax = 0x7FFFFFFF -} OMX_AUDIO_RAFORMATTYPE; - -/** RA (Real Audio) params */ -typedef struct OMX_AUDIO_PARAM_RATYPE { - OMX_U32 nSize; /**< Size of this structure, in Bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nSamplingRate; /**< is the sampling rate of the source data */ - OMX_U32 nBitsPerFrame; /**< is the value for bits per frame */ - OMX_U32 nSamplePerFrame; /**< is the value for samples per frame */ - OMX_U32 nCouplingQuantBits; /**< is the number of coupling quantization bits in the stream */ - OMX_U32 nCouplingStartRegion; /**< is the coupling start region in the stream */ - OMX_U32 nNumRegions; /**< is the number of regions value */ - OMX_AUDIO_RAFORMATTYPE eFormat; /**< is the RealAudio audio format */ -} OMX_AUDIO_PARAM_RATYPE; - - -/** SBC Allocation Method Type */ -typedef enum OMX_AUDIO_SBCALLOCMETHODTYPE { - OMX_AUDIO_SBCAllocMethodLoudness, /**< Loudness allocation method */ - OMX_AUDIO_SBCAllocMethodSNR, /**< SNR allocation method */ - OMX_AUDIO_SBCAllocMethodKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_SBCAllocMethodVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_SBCAllocMethodMax = 0x7FFFFFFF -} OMX_AUDIO_SBCALLOCMETHODTYPE; - - -/** SBC params */ -typedef struct OMX_AUDIO_PARAM_SBCTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable - rate or unknown bit rates */ - OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for - variable or unknown sampling rate. */ - OMX_U32 nBlocks; /**< Number of blocks */ - OMX_U32 nSubbands; /**< Number of subbands */ - OMX_U32 nBitPool; /**< Bitpool value */ - OMX_BOOL bEnableBitrate; /**< Use bitrate value instead of bitpool */ - OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */ - OMX_AUDIO_SBCALLOCMETHODTYPE eSBCAllocType; /**< SBC Allocation method type */ -} OMX_AUDIO_PARAM_SBCTYPE; - - -/** ADPCM stream format parameters */ -typedef struct OMX_AUDIO_PARAM_ADPCMTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_U32 nBitsPerSample; /**< Number of bits in each sample */ - OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for - variable or unknown sampling rate. */ -} OMX_AUDIO_PARAM_ADPCMTYPE; - - -/** G723 rate */ -typedef enum OMX_AUDIO_G723RATE { - OMX_AUDIO_G723ModeUnused = 0, /**< AMRNB Mode unused / unknown */ - OMX_AUDIO_G723ModeLow, /**< 5300 bps */ - OMX_AUDIO_G723ModeHigh, /**< 6300 bps */ - OMX_AUDIO_G723ModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_G723ModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_G723ModeMax = 0x7FFFFFFF -} OMX_AUDIO_G723RATE; - - -/** G723 - Sample rate must be 8 KHz */ -typedef struct OMX_AUDIO_PARAM_G723TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_AUDIO_G723RATE eBitRate; /**< todo: Should this be moved to a config? */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ - OMX_BOOL bPostFilter; /**< Enable Post Filter */ -} OMX_AUDIO_PARAM_G723TYPE; - - -/** ITU G726 (ADPCM) rate */ -typedef enum OMX_AUDIO_G726MODE { - OMX_AUDIO_G726ModeUnused = 0, /**< G726 Mode unused / unknown */ - OMX_AUDIO_G726Mode16, /**< 16 kbps */ - OMX_AUDIO_G726Mode24, /**< 24 kbps */ - OMX_AUDIO_G726Mode32, /**< 32 kbps, most common rate, also G721 */ - OMX_AUDIO_G726Mode40, /**< 40 kbps */ - OMX_AUDIO_G726ModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_G726ModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_G726ModeMax = 0x7FFFFFFF -} OMX_AUDIO_G726MODE; - - -/** G.726 stream format parameters - must be at 8KHz */ -typedef struct OMX_AUDIO_PARAM_G726TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_AUDIO_G726MODE eG726Mode; -} OMX_AUDIO_PARAM_G726TYPE; - - -/** G729 coder type */ -typedef enum OMX_AUDIO_G729TYPE { - OMX_AUDIO_G729 = 0, /**< ITU G.729 encoded data */ - OMX_AUDIO_G729A, /**< ITU G.729 annex A encoded data */ - OMX_AUDIO_G729B, /**< ITU G.729 with annex B encoded data */ - OMX_AUDIO_G729AB, /**< ITU G.729 annexes A and B encoded data */ - OMX_AUDIO_G729KhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_G729VendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_G729Max = 0x7FFFFFFF -} OMX_AUDIO_G729TYPE; - - -/** G729 stream format parameters - fixed 6KHz sample rate */ -typedef struct OMX_AUDIO_PARAM_G729TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_AUDIO_G729TYPE eBitType; -} OMX_AUDIO_PARAM_G729TYPE; - - -/** AMR Frame format */ -typedef enum OMX_AUDIO_AMRFRAMEFORMATTYPE { - OMX_AUDIO_AMRFrameFormatConformance = 0, /**< Frame Format is AMR Conformance - (Standard) Format */ - OMX_AUDIO_AMRFrameFormatIF1, /**< Frame Format is AMR Interface - Format 1 */ - OMX_AUDIO_AMRFrameFormatIF2, /**< Frame Format is AMR Interface - Format 2*/ - OMX_AUDIO_AMRFrameFormatFSF, /**< Frame Format is AMR File Storage - Format */ - OMX_AUDIO_AMRFrameFormatRTPPayload, /**< Frame Format is AMR Real-Time - Transport Protocol Payload Format */ - OMX_AUDIO_AMRFrameFormatITU, /**< Frame Format is ITU Format (added at Motorola request) */ - OMX_AUDIO_AMRFrameFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_AMRFrameFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_AMRFrameFormatMax = 0x7FFFFFFF -} OMX_AUDIO_AMRFRAMEFORMATTYPE; - - -/** AMR band mode */ -typedef enum OMX_AUDIO_AMRBANDMODETYPE { - OMX_AUDIO_AMRBandModeUnused = 0, /**< AMRNB Mode unused / unknown */ - OMX_AUDIO_AMRBandModeNB0, /**< AMRNB Mode 0 = 4750 bps */ - OMX_AUDIO_AMRBandModeNB1, /**< AMRNB Mode 1 = 5150 bps */ - OMX_AUDIO_AMRBandModeNB2, /**< AMRNB Mode 2 = 5900 bps */ - OMX_AUDIO_AMRBandModeNB3, /**< AMRNB Mode 3 = 6700 bps */ - OMX_AUDIO_AMRBandModeNB4, /**< AMRNB Mode 4 = 7400 bps */ - OMX_AUDIO_AMRBandModeNB5, /**< AMRNB Mode 5 = 7950 bps */ - OMX_AUDIO_AMRBandModeNB6, /**< AMRNB Mode 6 = 10200 bps */ - OMX_AUDIO_AMRBandModeNB7, /**< AMRNB Mode 7 = 12200 bps */ - OMX_AUDIO_AMRBandModeWB0, /**< AMRWB Mode 0 = 6600 bps */ - OMX_AUDIO_AMRBandModeWB1, /**< AMRWB Mode 1 = 8850 bps */ - OMX_AUDIO_AMRBandModeWB2, /**< AMRWB Mode 2 = 12650 bps */ - OMX_AUDIO_AMRBandModeWB3, /**< AMRWB Mode 3 = 14250 bps */ - OMX_AUDIO_AMRBandModeWB4, /**< AMRWB Mode 4 = 15850 bps */ - OMX_AUDIO_AMRBandModeWB5, /**< AMRWB Mode 5 = 18250 bps */ - OMX_AUDIO_AMRBandModeWB6, /**< AMRWB Mode 6 = 19850 bps */ - OMX_AUDIO_AMRBandModeWB7, /**< AMRWB Mode 7 = 23050 bps */ - OMX_AUDIO_AMRBandModeWB8, /**< AMRWB Mode 8 = 23850 bps */ - OMX_AUDIO_AMRBandModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_AMRBandModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_AMRBandModeMax = 0x7FFFFFFF -} OMX_AUDIO_AMRBANDMODETYPE; - - -/** AMR Discontinuous Transmission mode */ -typedef enum OMX_AUDIO_AMRDTXMODETYPE { - OMX_AUDIO_AMRDTXModeOff = 0, /**< AMR Discontinuous Transmission Mode is disabled */ - OMX_AUDIO_AMRDTXModeOnVAD1, /**< AMR Discontinuous Transmission Mode using - Voice Activity Detector 1 (VAD1) is enabled */ - OMX_AUDIO_AMRDTXModeOnVAD2, /**< AMR Discontinuous Transmission Mode using - Voice Activity Detector 2 (VAD2) is enabled */ - OMX_AUDIO_AMRDTXModeOnAuto, /**< The codec will automatically select between - Off, VAD1 or VAD2 modes */ - - OMX_AUDIO_AMRDTXasEFR, /**< DTX as EFR instead of AMR standard (3GPP 26.101, frame type =8,9,10) */ - - OMX_AUDIO_AMRDTXModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_AMRDTXModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_AMRDTXModeMax = 0x7FFFFFFF -} OMX_AUDIO_AMRDTXMODETYPE; - - -/** AMR params */ -typedef struct OMX_AUDIO_PARAM_AMRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nBitRate; /**< Bit rate read only field */ - OMX_AUDIO_AMRBANDMODETYPE eAMRBandMode; /**< AMR Band Mode enumeration */ - OMX_AUDIO_AMRDTXMODETYPE eAMRDTXMode; /**< AMR DTX Mode enumeration */ - OMX_AUDIO_AMRFRAMEFORMATTYPE eAMRFrameFormat; /**< AMR frame format enumeration */ -} OMX_AUDIO_PARAM_AMRTYPE; - - -/** GSM_FR (ETSI 06.10, 3GPP 46.010) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_GSMFRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_GSMFRTYPE; - - -/** GSM-HR (ETSI 06.20, 3GPP 46.020) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_GSMHRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_GSMHRTYPE; - - -/** GSM-EFR (ETSI 06.60, 3GPP 46.060) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_GSMEFRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_GSMEFRTYPE; - - -/** TDMA FR (TIA/EIA-136-420, VSELP 7.95kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_TDMAFRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_TDMAFRTYPE; - - -/** TDMA EFR (TIA/EIA-136-410, ACELP 7.4kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_TDMAEFRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_TDMAEFRTYPE; - - -/** PDC FR ( RCR-27, VSELP 6.7kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_PDCFRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_PDCFRTYPE; - - -/** PDC EFR ( RCR-27, ACELP 6.7kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_PDCEFRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_PDCEFRTYPE; - -/** PDC HR ( RCR-27, PSI-CELP 3.45kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_PDCHRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_PDCHRTYPE; - - -/** CDMA Rate types */ -typedef enum OMX_AUDIO_CDMARATETYPE { - OMX_AUDIO_CDMARateBlank = 0, /**< CDMA encoded frame is blank */ - OMX_AUDIO_CDMARateFull, /**< CDMA encoded frame in full rate */ - OMX_AUDIO_CDMARateHalf, /**< CDMA encoded frame in half rate */ - OMX_AUDIO_CDMARateQuarter, /**< CDMA encoded frame in quarter rate */ - OMX_AUDIO_CDMARateEighth, /**< CDMA encoded frame in eighth rate (DTX)*/ - OMX_AUDIO_CDMARateErasure, /**< CDMA erasure frame */ - OMX_AUDIO_CDMARateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_CDMARateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_CDMARateMax = 0x7FFFFFFF -} OMX_AUDIO_CDMARATETYPE; - - -/** QCELP8 (TIA/EIA-96, up to 8kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_QCELP8TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable - rate or unknown bit rates */ - OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */ - OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */ - OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */ -} OMX_AUDIO_PARAM_QCELP8TYPE; - - -/** QCELP13 ( CDMA, EIA/TIA-733, 13.3kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_QCELP13TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */ - OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */ - OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */ -} OMX_AUDIO_PARAM_QCELP13TYPE; - - -/** EVRC ( CDMA, EIA/TIA-127, RCELP up to 8.55kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_EVRCTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_AUDIO_CDMARATETYPE eCDMARate; /**< actual Frame rate */ - OMX_BOOL bRATE_REDUCon; /**< RATE_REDUCtion is requested for this frame */ - OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */ - OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */ - OMX_BOOL bHiPassFilter; /**< Enable encoder's High Pass Filter */ - OMX_BOOL bNoiseSuppressor; /**< Enable encoder's noise suppressor pre-processing */ - OMX_BOOL bPostFilter; /**< Enable decoder's post Filter */ -} OMX_AUDIO_PARAM_EVRCTYPE; - - -/** SMV ( up to 8.55kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_SMVTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */ - OMX_BOOL bRATE_REDUCon; /**< RATE_REDUCtion is requested for this frame */ - OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 ??*/ - OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 ??*/ - OMX_BOOL bHiPassFilter; /**< Enable encoder's High Pass Filter ??*/ - OMX_BOOL bNoiseSuppressor; /**< Enable encoder's noise suppressor pre-processing */ - OMX_BOOL bPostFilter; /**< Enable decoder's post Filter ??*/ -} OMX_AUDIO_PARAM_SMVTYPE; - - -/** MIDI Format - * @ingroup midi - */ -typedef enum OMX_AUDIO_MIDIFORMATTYPE -{ - OMX_AUDIO_MIDIFormatUnknown = 0, /**< MIDI Format unknown or don't care */ - OMX_AUDIO_MIDIFormatSMF0, /**< Standard MIDI File Type 0 */ - OMX_AUDIO_MIDIFormatSMF1, /**< Standard MIDI File Type 1 */ - OMX_AUDIO_MIDIFormatSMF2, /**< Standard MIDI File Type 2 */ - OMX_AUDIO_MIDIFormatSPMIDI, /**< SP-MIDI */ - OMX_AUDIO_MIDIFormatXMF0, /**< eXtensible Music Format type 0 */ - OMX_AUDIO_MIDIFormatXMF1, /**< eXtensible Music Format type 1 */ - OMX_AUDIO_MIDIFormatMobileXMF, /**< Mobile XMF (eXtensible Music Format type 2) */ - OMX_AUDIO_MIDIFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_MIDIFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_MIDIFormatMax = 0x7FFFFFFF -} OMX_AUDIO_MIDIFORMATTYPE; - - -/** MIDI params - * @ingroup midi - */ -typedef struct OMX_AUDIO_PARAM_MIDITYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nFileSize; /**< size of the MIDI file in bytes, where the entire - MIDI file passed in, otherwise if 0x0, the MIDI data - is merged and streamed (instead of passed as an - entire MIDI file) */ - OMX_BU32 sMaxPolyphony; /**< Specifies the maximum simultaneous polyphonic - voices. A value of zero indicates that the default - polyphony of the device is used */ - OMX_BOOL bLoadDefaultSound; /**< Whether to load default sound - bank at initialization */ - OMX_AUDIO_MIDIFORMATTYPE eMidiFormat; /**< Version of the MIDI file */ -} OMX_AUDIO_PARAM_MIDITYPE; - - -/** Type of the MIDI sound bank - * @ingroup midi - */ -typedef enum OMX_AUDIO_MIDISOUNDBANKTYPE { - OMX_AUDIO_MIDISoundBankUnused = 0, /**< unused/unknown soundbank type */ - OMX_AUDIO_MIDISoundBankDLS1, /**< DLS version 1 */ - OMX_AUDIO_MIDISoundBankDLS2, /**< DLS version 2 */ - OMX_AUDIO_MIDISoundBankMobileDLSBase, /**< Mobile DLS, using the base functionality */ - OMX_AUDIO_MIDISoundBankMobileDLSPlusOptions, /**< Mobile DLS, using the specification-defined optional feature set */ - OMX_AUDIO_MIDISoundBankKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_MIDISoundBankVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_MIDISoundBankMax = 0x7FFFFFFF -} OMX_AUDIO_MIDISOUNDBANKTYPE; - - -/** Bank Layout describes how bank MSB & LSB are used in the DLS instrument definitions sound bank - * @ingroup midi - */ -typedef enum OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE { - OMX_AUDIO_MIDISoundBankLayoutUnused = 0, /**< unused/unknown soundbank type */ - OMX_AUDIO_MIDISoundBankLayoutGM, /**< GS layout (based on bank MSB 0x00) */ - OMX_AUDIO_MIDISoundBankLayoutGM2, /**< General MIDI 2 layout (using MSB 0x78/0x79, LSB 0x00) */ - OMX_AUDIO_MIDISoundBankLayoutUser, /**< Does not conform to any bank numbering standards */ - OMX_AUDIO_MIDISoundBankLayoutKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_MIDISoundBankLayoutVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_MIDISoundBankLayoutMax = 0x7FFFFFFF -} OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE; - - -/** MIDI params to load/unload user soundbank - * @ingroup midi - */ -typedef struct OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nDLSIndex; /**< DLS file index to be loaded */ - OMX_U32 nDLSSize; /**< Size in bytes */ - OMX_PTR pDLSData; /**< Pointer to DLS file data */ - OMX_AUDIO_MIDISOUNDBANKTYPE eMidiSoundBank; /**< Midi sound bank type enumeration */ - OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE eMidiSoundBankLayout; /**< Midi sound bank layout enumeration */ -} OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE; - - -/** Structure for Live MIDI events and MIP messages. - * (MIP = Maximum Instantaneous Polyphony; part of the SP-MIDI standard.) - * @ingroup midi - */ -typedef struct OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port that this structure applies to */ - OMX_U32 nMidiEventSize; /**< Size of immediate MIDI events or MIP message in bytes */ - OMX_U8 nMidiEvents[1]; /**< MIDI event array to be rendered immediately, or an - array for the MIP message buffer, where the size is - indicated by nMidiEventSize */ -} OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE; - - -/** MIDI sound bank/ program pair in a given channel - * @ingroup midi - */ -typedef struct OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port that this structure applies to */ - OMX_U32 nChannel; /**< Valid channel values range from 1 to 16 */ - OMX_U16 nIDProgram; /**< Valid program ID range is 1 to 128 */ - OMX_U16 nIDSoundBank; /**< Sound bank ID */ - OMX_U32 nUserSoundBankIndex;/**< User soundbank index, easier to access soundbanks - by index if multiple banks are present */ -} OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE; - - -/** MIDI control - * @ingroup midi - */ -typedef struct OMX_AUDIO_CONFIG_MIDICONTROLTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BS32 sPitchTransposition; /**< Pitch transposition in semitones, stored as Q22.10 - format based on JAVA MMAPI (JSR-135) requirement */ - OMX_BU32 sPlayBackRate; /**< Relative playback rate, stored as Q14.17 fixed-point - number based on JSR-135 requirement */ - OMX_BU32 sTempo ; /**< Tempo in beats per minute (BPM), stored as Q22.10 - fixed-point number based on JSR-135 requirement */ - OMX_U32 nMaxPolyphony; /**< Specifies the maximum simultaneous polyphonic - voices. A value of zero indicates that the default - polyphony of the device is used */ - OMX_U32 nNumRepeat; /**< Number of times to repeat playback */ - OMX_U32 nStopTime; /**< Time in milliseconds to indicate when playback - will stop automatically. Set to zero if not used */ - OMX_U16 nChannelMuteMask; /**< 16 bit mask for channel mute status */ - OMX_U16 nChannelSoloMask; /**< 16 bit mask for channel solo status */ - OMX_U32 nTrack0031MuteMask; /**< 32 bit mask for track mute status. Note: This is for tracks 0-31 */ - OMX_U32 nTrack3263MuteMask; /**< 32 bit mask for track mute status. Note: This is for tracks 32-63 */ - OMX_U32 nTrack0031SoloMask; /**< 32 bit mask for track solo status. Note: This is for tracks 0-31 */ - OMX_U32 nTrack3263SoloMask; /**< 32 bit mask for track solo status. Note: This is for tracks 32-63 */ - -} OMX_AUDIO_CONFIG_MIDICONTROLTYPE; - - -/** MIDI Playback States - * @ingroup midi - */ -typedef enum OMX_AUDIO_MIDIPLAYBACKSTATETYPE { - OMX_AUDIO_MIDIPlayBackStateUnknown = 0, /**< Unknown state or state does not map to - other defined states */ - OMX_AUDIO_MIDIPlayBackStateClosedEngaged, /**< No MIDI resource is currently open. - The MIDI engine is currently processing - MIDI events. */ - OMX_AUDIO_MIDIPlayBackStateParsing, /**< A MIDI resource is open and is being - primed. The MIDI engine is currently - processing MIDI events. */ - OMX_AUDIO_MIDIPlayBackStateOpenEngaged, /**< A MIDI resource is open and primed but - not playing. The MIDI engine is currently - processing MIDI events. The transition to - this state is only possible from the - OMX_AUDIO_MIDIPlayBackStatePlaying state, - when the 'playback head' reaches the end - of media data or the playback stops due - to stop time set.*/ - OMX_AUDIO_MIDIPlayBackStatePlaying, /**< A MIDI resource is open and currently - playing. The MIDI engine is currently - processing MIDI events.*/ - OMX_AUDIO_MIDIPlayBackStatePlayingPartially, /**< Best-effort playback due to SP-MIDI/DLS - resource constraints */ - OMX_AUDIO_MIDIPlayBackStatePlayingSilently, /**< Due to system resource constraints and - SP-MIDI content constraints, there is - no audible MIDI content during playback - currently. The situation may change if - resources are freed later.*/ - OMX_AUDIO_MIDIPlayBackStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_MIDIPlayBackStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_MIDIPlayBackStateMax = 0x7FFFFFFF -} OMX_AUDIO_MIDIPLAYBACKSTATETYPE; - - -/** MIDI status - * @ingroup midi - */ -typedef struct OMX_AUDIO_CONFIG_MIDISTATUSTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U16 nNumTracks; /**< Number of MIDI tracks in the file, read only field. - NOTE: May not return a meaningful value until the entire - file is parsed and buffered. */ - OMX_U32 nDuration; /**< The length of the currently open MIDI resource - in milliseconds. NOTE: May not return a meaningful value - until the entire file is parsed and buffered. */ - OMX_U32 nPosition; /**< Current Position of the MIDI resource being played - in milliseconds */ - OMX_BOOL bVibra; /**< Does Vibra track exist? NOTE: May not return a meaningful - value until the entire file is parsed and buffered. */ - OMX_U32 nNumMetaEvents; /**< Total number of MIDI Meta Events in the currently - open MIDI resource. NOTE: May not return a meaningful value - until the entire file is parsed and buffered. */ - OMX_U32 nNumActiveVoices; /**< Number of active voices in the currently playing - MIDI resource. NOTE: May not return a meaningful value until - the entire file is parsed and buffered. */ - OMX_AUDIO_MIDIPLAYBACKSTATETYPE eMIDIPlayBackState; /**< MIDI playback state enumeration, read only field */ -} OMX_AUDIO_CONFIG_MIDISTATUSTYPE; - - -/** MIDI Meta Event structure one per Meta Event. - * MIDI Meta Events are like audio metadata, except that they are interspersed - * with the MIDI content throughout the file and are not localized in the header. - * As such, it is necessary to retrieve information about these Meta Events from - * the engine, as it encounters these Meta Events within the MIDI content. - * For example, SMF files can have up to 14 types of MIDI Meta Events (copyright, - * author, default tempo, etc.) scattered throughout the file. - * @ingroup midi - */ -typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE{ - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nIndex; /**< Index of Meta Event */ - OMX_U8 nMetaEventType; /**< Meta Event Type, 7bits (i.e. 0 - 127) */ - OMX_U32 nMetaEventSize; /**< size of the Meta Event in bytes */ - OMX_U32 nTrack; /**< track number for the meta event */ - OMX_U32 nPosition; /**< Position of the meta-event in milliseconds */ -} OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE; - - -/** MIDI Meta Event Data structure - one per Meta Event. - * @ingroup midi - */ -typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE{ - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nIndex; /**< Index of Meta Event */ - OMX_U32 nMetaEventSize; /**< size of the Meta Event in bytes */ - OMX_U8 nData[1]; /**< array of one or more bytes of meta data - as indicated by the nMetaEventSize field */ -} OMX_AUDIO_CONFIG__MIDIMETAEVENTDATATYPE; - - -/** Audio Volume adjustment for a port */ -typedef struct OMX_AUDIO_CONFIG_VOLUMETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port index indicating which port to - set. Select the input port to set - just that port's volume. Select the - output port to adjust the master - volume. */ - OMX_BOOL bLinear; /**< Is the volume to be set in linear (0.100) - or logarithmic scale (mB) */ - OMX_BS32 sVolume; /**< Volume linear setting in the 0..100 range, OR - Volume logarithmic setting for this port. The values - for volume are in mB (millibels = 1/100 dB) relative - to a gain of 1 (e.g. the output is the same as the - input level). Values are in mB from nMax - (maximum volume) to nMin mB (typically negative). - Since the volume is "voltage" - and not a "power", it takes a setting of - -600 mB to decrease the volume by 1/2. If - a component cannot accurately set the - volume to the requested value, it must - set the volume to the closest value BELOW - the requested value. When getting the - volume setting, the current actual volume - must be returned. */ -} OMX_AUDIO_CONFIG_VOLUMETYPE; - - -/** Audio Volume adjustment for a channel */ -typedef struct OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port index indicating which port to - set. Select the input port to set - just that port's volume. Select the - output port to adjust the master - volume. */ - OMX_U32 nChannel; /**< channel to select from 0 to N-1, - using OMX_ALL to apply volume settings - to all channels */ - OMX_BOOL bLinear; /**< Is the volume to be set in linear (0.100) or - logarithmic scale (mB) */ - OMX_BS32 sVolume; /**< Volume linear setting in the 0..100 range, OR - Volume logarithmic setting for this port. - The values for volume are in mB - (millibels = 1/100 dB) relative to a gain - of 1 (e.g. the output is the same as the - input level). Values are in mB from nMax - (maximum volume) to nMin mB (typically negative). - Since the volume is "voltage" - and not a "power", it takes a setting of - -600 mB to decrease the volume by 1/2. If - a component cannot accurately set the - volume to the requested value, it must - set the volume to the closest value BELOW - the requested value. When getting the - volume setting, the current actual volume - must be returned. */ - OMX_BOOL bIsMIDI; /**< TRUE if nChannel refers to a MIDI channel, - FALSE otherwise */ -} OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE; - - -/** Audio balance setting */ -typedef struct OMX_AUDIO_CONFIG_BALANCETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port index indicating which port to - set. Select the input port to set - just that port's balance. Select the - output port to adjust the master - balance. */ - OMX_S32 nBalance; /**< balance setting for this port - (-100 to 100, where -100 indicates - all left, and no right */ -} OMX_AUDIO_CONFIG_BALANCETYPE; - - -/** Audio Port mute */ -typedef struct OMX_AUDIO_CONFIG_MUTETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port index indicating which port to - set. Select the input port to set - just that port's mute. Select the - output port to adjust the master - mute. */ - OMX_BOOL bMute; /**< Mute setting for this port */ -} OMX_AUDIO_CONFIG_MUTETYPE; - - -/** Audio Channel mute */ -typedef struct OMX_AUDIO_CONFIG_CHANNELMUTETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannel; /**< channel to select from 0 to N-1, - using OMX_ALL to apply mute settings - to all channels */ - OMX_BOOL bMute; /**< Mute setting for this channel */ - OMX_BOOL bIsMIDI; /**< TRUE if nChannel refers to a MIDI channel, - FALSE otherwise */ -} OMX_AUDIO_CONFIG_CHANNELMUTETYPE; - - - -/** Enable / Disable for loudness control, which boosts bass and to a - * smaller extent high end frequencies to compensate for hearing - * ability at the extreme ends of the audio spectrum - */ -typedef struct OMX_AUDIO_CONFIG_LOUDNESSTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bLoudness; /**< Enable/disable for loudness */ -} OMX_AUDIO_CONFIG_LOUDNESSTYPE; - - -/** Enable / Disable for bass, which controls low frequencies - */ -typedef struct OMX_AUDIO_CONFIG_BASSTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bEnable; /**< Enable/disable for bass control */ - OMX_S32 nBass; /**< bass setting for the port, as a - continuous value from -100 to 100 - (0 means no change in bass level)*/ -} OMX_AUDIO_CONFIG_BASSTYPE; - - -/** Enable / Disable for treble, which controls high frequencies tones - */ -typedef struct OMX_AUDIO_CONFIG_TREBLETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bEnable; /**< Enable/disable for treble control */ - OMX_S32 nTreble; /**< treble setting for the port, as a - continuous value from -100 to 100 - (0 means no change in treble level) */ -} OMX_AUDIO_CONFIG_TREBLETYPE; - - -/** An equalizer is typically used for two reasons: to compensate for an - * sub-optimal frequency response of a system to make it sound more natural - * or to create intentionally some unnatural coloring to the sound to create - * an effect. - * @ingroup effects - */ -typedef struct OMX_AUDIO_CONFIG_EQUALIZERTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bEnable; /**< Enable/disable for equalizer */ - OMX_BU32 sBandIndex; /**< Band number to be set. Upper Limit is - N-1, where N is the number of bands, lower limit is 0 */ - OMX_BU32 sCenterFreq; /**< Center frequecies in Hz. This is a - read only element and is used to determine - the lower, center and upper frequency of - this band. */ - OMX_BS32 sBandLevel; /**< band level in millibels */ -} OMX_AUDIO_CONFIG_EQUALIZERTYPE; - - -/** Stereo widening mode type - * @ingroup effects - */ -typedef enum OMX_AUDIO_STEREOWIDENINGTYPE { - OMX_AUDIO_StereoWideningHeadphones, /**< Stereo widening for loudspeakers */ - OMX_AUDIO_StereoWideningLoudspeakers, /**< Stereo widening for closely spaced loudspeakers */ - OMX_AUDIO_StereoWideningKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_StereoWideningVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_StereoWideningMax = 0x7FFFFFFF -} OMX_AUDIO_STEREOWIDENINGTYPE; - - -/** Control for stereo widening, which is a special 2-channel - * case of the audio virtualizer effect. For example, for 5.1-channel - * output, it translates to virtual surround sound. - * @ingroup effects - */ -typedef struct OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bEnable; /**< Enable/disable for stereo widening control */ - OMX_AUDIO_STEREOWIDENINGTYPE eWideningType; /**< Stereo widening algorithm type */ - OMX_U32 nStereoWidening; /**< stereo widening setting for the port, - as a continuous value from 0 to 100 */ -} OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE; - - -/** The chorus effect (or ``choralizer'') is any signal processor which makes - * one sound source (such as a voice) sound like many such sources singing - * (or playing) in unison. Since performance in unison is never exact, chorus - * effects simulate this by making independently modified copies of the input - * signal. Modifications may include (1) delay, (2) frequency shift, and - * (3) amplitude modulation. - * @ingroup effects - */ -typedef struct OMX_AUDIO_CONFIG_CHORUSTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bEnable; /**< Enable/disable for chorus */ - OMX_BU32 sDelay; /**< average delay in milliseconds */ - OMX_BU32 sModulationRate; /**< rate of modulation in millihertz */ - OMX_U32 nModulationDepth; /**< depth of modulation as a percentage of - delay (i.e. 0 to 100) */ - OMX_BU32 nFeedback; /**< Feedback from chorus output to input in percentage */ -} OMX_AUDIO_CONFIG_CHORUSTYPE; - - -/** Reverberation is part of the reflected sound that follows the early - * reflections. In a typical room, this consists of a dense succession of - * echoes whose energy decays exponentially. The reverberation effect structure - * as defined here includes both (early) reflections as well as (late) reverberations. - * @ingroup effects - */ -typedef struct OMX_AUDIO_CONFIG_REVERBERATIONTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bEnable; /**< Enable/disable for reverberation control */ - OMX_BS32 sRoomLevel; /**< Intensity level for the whole room effect - (i.e. both early reflections and late - reverberation) in millibels */ - OMX_BS32 sRoomHighFreqLevel; /**< Attenuation at high frequencies - relative to the intensity at low - frequencies in millibels */ - OMX_BS32 sReflectionsLevel; /**< Intensity level of early reflections - (relative to room value), in millibels */ - OMX_BU32 sReflectionsDelay; /**< Delay time of the first reflection relative - to the direct path, in milliseconds */ - OMX_BS32 sReverbLevel; /**< Intensity level of late reverberation - relative to room level, in millibels */ - OMX_BU32 sReverbDelay; /**< Time delay from the first early reflection - to the beginning of the late reverberation - section, in milliseconds */ - OMX_BU32 sDecayTime; /**< Late reverberation decay time at low - frequencies, in milliseconds */ - OMX_BU32 nDecayHighFreqRatio; /**< Ratio of high frequency decay time relative - to low frequency decay time in percent */ - OMX_U32 nDensity; /**< Modal density in the late reverberation decay, - in percent (i.e. 0 - 100) */ - OMX_U32 nDiffusion; /**< Echo density in the late reverberation decay, - in percent (i.e. 0 - 100) */ - OMX_BU32 sReferenceHighFreq; /**< Reference high frequency in Hertz. This is - the frequency used as the reference for all - the high-frequency settings above */ - -} OMX_AUDIO_CONFIG_REVERBERATIONTYPE; - - -/** Possible settings for the Echo Cancelation structure to use - * @ingroup effects - */ -typedef enum OMX_AUDIO_ECHOCANTYPE { - OMX_AUDIO_EchoCanOff = 0, /**< Echo Cancellation is disabled */ - OMX_AUDIO_EchoCanNormal, /**< Echo Cancellation normal operation - - echo from plastics and face */ - OMX_AUDIO_EchoCanHFree, /**< Echo Cancellation optimized for - Hands Free operation */ - OMX_AUDIO_EchoCanCarKit, /**< Echo Cancellation optimized for - Car Kit (longer echo) */ - OMX_AUDIO_EchoCanKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_EchoCanVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_EchoCanMax = 0x7FFFFFFF -} OMX_AUDIO_ECHOCANTYPE; - - -/** Enable / Disable for echo cancelation, which removes undesired echo's - * from the audio - * @ingroup effects - */ -typedef struct OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_AUDIO_ECHOCANTYPE eEchoCancelation; /**< Echo cancelation settings */ -} OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE; - - -/** Enable / Disable for noise reduction, which undesired noise from - * the audio - * @ingroup effects - */ -typedef struct OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bNoiseReduction; /**< Enable/disable for noise reduction */ -} OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE; - -/** @} */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ diff --git a/external/android/include/16/frameworks/native/include/media/openmax/OMX_Component.h b/external/android/include/16/frameworks/native/include/media/openmax/OMX_Component.h deleted file mode 100644 index b5b784e..0000000 --- a/external/android/include/16/frameworks/native/include/media/openmax/OMX_Component.h +++ /dev/null @@ -1,596 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** OMX_Component.h - OpenMax IL version 1.1.2 - * The OMX_Component header file contains the definitions used to define - * the public interface of a component. This header file is intended to - * be used by both the application and the component. - */ - -#ifndef OMX_Component_h -#define OMX_Component_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - - -/* Each OMX header must include all required header files to allow the - * header to compile without errors. The includes below are required - * for this header file to compile successfully - */ - -#include -#include -#include -#include - -/** @ingroup comp */ -typedef enum OMX_PORTDOMAINTYPE { - OMX_PortDomainAudio, - OMX_PortDomainVideo, - OMX_PortDomainImage, - OMX_PortDomainOther, - OMX_PortDomainKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_PortDomainVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_PortDomainMax = 0x7ffffff -} OMX_PORTDOMAINTYPE; - -/** @ingroup comp */ -typedef struct OMX_PARAM_PORTDEFINITIONTYPE { - OMX_U32 nSize; /**< Size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port number the structure applies to */ - OMX_DIRTYPE eDir; /**< Direction (input or output) of this port */ - OMX_U32 nBufferCountActual; /**< The actual number of buffers allocated on this port */ - OMX_U32 nBufferCountMin; /**< The minimum number of buffers this port requires */ - OMX_U32 nBufferSize; /**< Size, in bytes, for buffers to be used for this channel */ - OMX_BOOL bEnabled; /**< Ports default to enabled and are enabled/disabled by - OMX_CommandPortEnable/OMX_CommandPortDisable. - When disabled a port is unpopulated. A disabled port - is not populated with buffers on a transition to IDLE. */ - OMX_BOOL bPopulated; /**< Port is populated with all of its buffers as indicated by - nBufferCountActual. A disabled port is always unpopulated. - An enabled port is populated on a transition to OMX_StateIdle - and unpopulated on a transition to loaded. */ - OMX_PORTDOMAINTYPE eDomain; /**< Domain of the port. Determines the contents of metadata below. */ - union { - OMX_AUDIO_PORTDEFINITIONTYPE audio; - OMX_VIDEO_PORTDEFINITIONTYPE video; - OMX_IMAGE_PORTDEFINITIONTYPE image; - OMX_OTHER_PORTDEFINITIONTYPE other; - } format; - OMX_BOOL bBuffersContiguous; - OMX_U32 nBufferAlignment; -} OMX_PARAM_PORTDEFINITIONTYPE; - -/** @ingroup comp */ -typedef struct OMX_PARAM_U32TYPE { - OMX_U32 nSize; /**< Size of this structure, in Bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nU32; /**< U32 value */ -} OMX_PARAM_U32TYPE; - -/** @ingroup rpm */ -typedef enum OMX_SUSPENSIONPOLICYTYPE { - OMX_SuspensionDisabled, /**< No suspension; v1.0 behavior */ - OMX_SuspensionEnabled, /**< Suspension allowed */ - OMX_SuspensionPolicyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_SuspensionPolicyStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_SuspensionPolicyMax = 0x7fffffff -} OMX_SUSPENSIONPOLICYTYPE; - -/** @ingroup rpm */ -typedef struct OMX_PARAM_SUSPENSIONPOLICYTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_SUSPENSIONPOLICYTYPE ePolicy; -} OMX_PARAM_SUSPENSIONPOLICYTYPE; - -/** @ingroup rpm */ -typedef enum OMX_SUSPENSIONTYPE { - OMX_NotSuspended, /**< component is not suspended */ - OMX_Suspended, /**< component is suspended */ - OMX_SuspensionKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_SuspensionVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_SuspendMax = 0x7FFFFFFF -} OMX_SUSPENSIONTYPE; - -/** @ingroup rpm */ -typedef struct OMX_PARAM_SUSPENSIONTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_SUSPENSIONTYPE eType; -} OMX_PARAM_SUSPENSIONTYPE ; - -typedef struct OMX_CONFIG_BOOLEANTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_BOOL bEnabled; -} OMX_CONFIG_BOOLEANTYPE; - -/* Parameter specifying the content uri to use. */ -/** @ingroup cp */ -typedef struct OMX_PARAM_CONTENTURITYPE -{ - OMX_U32 nSize; /**< size of the structure in bytes, including - actual URI name */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U8 contentURI[1]; /**< The URI name */ -} OMX_PARAM_CONTENTURITYPE; - -/* Parameter specifying the pipe to use. */ -/** @ingroup cp */ -typedef struct OMX_PARAM_CONTENTPIPETYPE -{ - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_HANDLETYPE hPipe; /**< The pipe handle*/ -} OMX_PARAM_CONTENTPIPETYPE; - -/** @ingroup rpm */ -typedef struct OMX_RESOURCECONCEALMENTTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_BOOL bResourceConcealmentForbidden; /**< disallow the use of resource concealment - methods (like degrading algorithm quality to - lower resource consumption or functional bypass) - on a component as a resolution to resource conflicts. */ -} OMX_RESOURCECONCEALMENTTYPE; - - -/** @ingroup metadata */ -typedef enum OMX_METADATACHARSETTYPE { - OMX_MetadataCharsetUnknown = 0, - OMX_MetadataCharsetASCII, - OMX_MetadataCharsetBinary, - OMX_MetadataCharsetCodePage1252, - OMX_MetadataCharsetUTF8, - OMX_MetadataCharsetJavaConformantUTF8, - OMX_MetadataCharsetUTF7, - OMX_MetadataCharsetImapUTF7, - OMX_MetadataCharsetUTF16LE, - OMX_MetadataCharsetUTF16BE, - OMX_MetadataCharsetGB12345, - OMX_MetadataCharsetHZGB2312, - OMX_MetadataCharsetGB2312, - OMX_MetadataCharsetGB18030, - OMX_MetadataCharsetGBK, - OMX_MetadataCharsetBig5, - OMX_MetadataCharsetISO88591, - OMX_MetadataCharsetISO88592, - OMX_MetadataCharsetISO88593, - OMX_MetadataCharsetISO88594, - OMX_MetadataCharsetISO88595, - OMX_MetadataCharsetISO88596, - OMX_MetadataCharsetISO88597, - OMX_MetadataCharsetISO88598, - OMX_MetadataCharsetISO88599, - OMX_MetadataCharsetISO885910, - OMX_MetadataCharsetISO885913, - OMX_MetadataCharsetISO885914, - OMX_MetadataCharsetISO885915, - OMX_MetadataCharsetShiftJIS, - OMX_MetadataCharsetISO2022JP, - OMX_MetadataCharsetISO2022JP1, - OMX_MetadataCharsetISOEUCJP, - OMX_MetadataCharsetSMS7Bit, - OMX_MetadataCharsetKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_MetadataCharsetVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_MetadataCharsetTypeMax= 0x7FFFFFFF -} OMX_METADATACHARSETTYPE; - -/** @ingroup metadata */ -typedef enum OMX_METADATASCOPETYPE -{ - OMX_MetadataScopeAllLevels, - OMX_MetadataScopeTopLevel, - OMX_MetadataScopePortLevel, - OMX_MetadataScopeNodeLevel, - OMX_MetadataScopeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_MetadataScopeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_MetadataScopeTypeMax = 0x7fffffff -} OMX_METADATASCOPETYPE; - -/** @ingroup metadata */ -typedef enum OMX_METADATASEARCHMODETYPE -{ - OMX_MetadataSearchValueSizeByIndex, - OMX_MetadataSearchItemByIndex, - OMX_MetadataSearchNextItemByKey, - OMX_MetadataSearchKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_MetadataSearchVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_MetadataSearchTypeMax = 0x7fffffff -} OMX_METADATASEARCHMODETYPE; -/** @ingroup metadata */ -typedef struct OMX_CONFIG_METADATAITEMCOUNTTYPE -{ - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_METADATASCOPETYPE eScopeMode; - OMX_U32 nScopeSpecifier; - OMX_U32 nMetadataItemCount; -} OMX_CONFIG_METADATAITEMCOUNTTYPE; - -/** @ingroup metadata */ -typedef struct OMX_CONFIG_METADATAITEMTYPE -{ - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_METADATASCOPETYPE eScopeMode; - OMX_U32 nScopeSpecifier; - OMX_U32 nMetadataItemIndex; - OMX_METADATASEARCHMODETYPE eSearchMode; - OMX_METADATACHARSETTYPE eKeyCharset; - OMX_U8 nKeySizeUsed; - OMX_U8 nKey[128]; - OMX_METADATACHARSETTYPE eValueCharset; - OMX_STRING sLanguageCountry; - OMX_U32 nValueMaxSize; - OMX_U32 nValueSizeUsed; - OMX_U8 nValue[1]; -} OMX_CONFIG_METADATAITEMTYPE; - -/* @ingroup metadata */ -typedef struct OMX_CONFIG_CONTAINERNODECOUNTTYPE -{ - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_BOOL bAllKeys; - OMX_U32 nParentNodeID; - OMX_U32 nNumNodes; -} OMX_CONFIG_CONTAINERNODECOUNTTYPE; - -/** @ingroup metadata */ -typedef struct OMX_CONFIG_CONTAINERNODEIDTYPE -{ - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_BOOL bAllKeys; - OMX_U32 nParentNodeID; - OMX_U32 nNodeIndex; - OMX_U32 nNodeID; - OMX_STRING cNodeName; - OMX_BOOL bIsLeafType; -} OMX_CONFIG_CONTAINERNODEIDTYPE; - -/** @ingroup metadata */ -typedef struct OMX_PARAM_METADATAFILTERTYPE -{ - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_BOOL bAllKeys; /* if true then this structure refers to all keys and - * the three key fields below are ignored */ - OMX_METADATACHARSETTYPE eKeyCharset; - OMX_U32 nKeySizeUsed; - OMX_U8 nKey [128]; - OMX_U32 nLanguageCountrySizeUsed; - OMX_U8 nLanguageCountry[128]; - OMX_BOOL bEnabled; /* if true then key is part of filter (e.g. - * retained for query later). If false then - * key is not part of filter */ -} OMX_PARAM_METADATAFILTERTYPE; - -/** The OMX_HANDLETYPE structure defines the component handle. The component - * handle is used to access all of the component's public methods and also - * contains pointers to the component's private data area. The component - * handle is initialized by the OMX core (with help from the component) - * during the process of loading the component. After the component is - * successfully loaded, the application can safely access any of the - * component's public functions (although some may return an error because - * the state is inappropriate for the access). - * - * @ingroup comp - */ -typedef struct OMX_COMPONENTTYPE -{ - /** The size of this structure, in bytes. It is the responsibility - of the allocator of this structure to fill in this value. Since - this structure is allocated by the GetHandle function, this - function will fill in this value. */ - OMX_U32 nSize; - - /** nVersion is the version of the OMX specification that the structure - is built against. It is the responsibility of the creator of this - structure to initialize this value and every user of this structure - should verify that it knows how to use the exact version of - this structure found herein. */ - OMX_VERSIONTYPE nVersion; - - /** pComponentPrivate is a pointer to the component private data area. - This member is allocated and initialized by the component when the - component is first loaded. The application should not access this - data area. */ - OMX_PTR pComponentPrivate; - - /** pApplicationPrivate is a pointer that is a parameter to the - OMX_GetHandle method, and contains an application private value - provided by the IL client. This application private data is - returned to the IL Client by OMX in all callbacks */ - OMX_PTR pApplicationPrivate; - - /** refer to OMX_GetComponentVersion in OMX_core.h or the OMX IL - specification for details on the GetComponentVersion method. - */ - OMX_ERRORTYPE (*GetComponentVersion)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_OUT OMX_STRING pComponentName, - OMX_OUT OMX_VERSIONTYPE* pComponentVersion, - OMX_OUT OMX_VERSIONTYPE* pSpecVersion, - OMX_OUT OMX_UUIDTYPE* pComponentUUID); - - /** refer to OMX_SendCommand in OMX_core.h or the OMX IL - specification for details on the SendCommand method. - */ - OMX_ERRORTYPE (*SendCommand)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_COMMANDTYPE Cmd, - OMX_IN OMX_U32 nParam1, - OMX_IN OMX_PTR pCmdData); - - /** refer to OMX_GetParameter in OMX_core.h or the OMX IL - specification for details on the GetParameter method. - */ - OMX_ERRORTYPE (*GetParameter)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_INDEXTYPE nParamIndex, - OMX_INOUT OMX_PTR pComponentParameterStructure); - - - /** refer to OMX_SetParameter in OMX_core.h or the OMX IL - specification for details on the SetParameter method. - */ - OMX_ERRORTYPE (*SetParameter)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_INDEXTYPE nIndex, - OMX_IN OMX_PTR pComponentParameterStructure); - - - /** refer to OMX_GetConfig in OMX_core.h or the OMX IL - specification for details on the GetConfig method. - */ - OMX_ERRORTYPE (*GetConfig)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_INDEXTYPE nIndex, - OMX_INOUT OMX_PTR pComponentConfigStructure); - - - /** refer to OMX_SetConfig in OMX_core.h or the OMX IL - specification for details on the SetConfig method. - */ - OMX_ERRORTYPE (*SetConfig)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_INDEXTYPE nIndex, - OMX_IN OMX_PTR pComponentConfigStructure); - - - /** refer to OMX_GetExtensionIndex in OMX_core.h or the OMX IL - specification for details on the GetExtensionIndex method. - */ - OMX_ERRORTYPE (*GetExtensionIndex)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_STRING cParameterName, - OMX_OUT OMX_INDEXTYPE* pIndexType); - - - /** refer to OMX_GetState in OMX_core.h or the OMX IL - specification for details on the GetState method. - */ - OMX_ERRORTYPE (*GetState)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_OUT OMX_STATETYPE* pState); - - - /** The ComponentTunnelRequest method will interact with another OMX - component to determine if tunneling is possible and to setup the - tunneling. The return codes for this method can be used to - determine if tunneling is not possible, or if tunneling is not - supported. - - Base profile components (i.e. non-interop) do not support this - method and should return OMX_ErrorNotImplemented - - The interop profile component MUST support tunneling to another - interop profile component with a compatible port parameters. - A component may also support proprietary communication. - - If proprietary communication is supported the negotiation of - proprietary communication is done outside of OMX in a vendor - specific way. It is only required that the proper result be - returned and the details of how the setup is done is left - to the component implementation. - - When this method is invoked when nPort in an output port, the - component will: - 1. Populate the pTunnelSetup structure with the output port's - requirements and constraints for the tunnel. - - When this method is invoked when nPort in an input port, the - component will: - 1. Query the necessary parameters from the output port to - determine if the ports are compatible for tunneling - 2. If the ports are compatible, the component should store - the tunnel step provided by the output port - 3. Determine which port (either input or output) is the buffer - supplier, and call OMX_SetParameter on the output port to - indicate this selection. - - The component will return from this call within 5 msec. - - @param [in] hComp - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle method. - @param [in] nPort - nPort is used to select the port on the component to be used - for tunneling. - @param [in] hTunneledComp - Handle of the component to tunnel with. This is the component - handle returned by the call to the OMX_GetHandle method. When - this parameter is 0x0 the component should setup the port for - communication with the application / IL Client. - @param [in] nPortOutput - nPortOutput is used indicate the port the component should - tunnel with. - @param [in] pTunnelSetup - Pointer to the tunnel setup structure. When nPort is an output port - the component should populate the fields of this structure. When - When nPort is an input port the component should review the setup - provided by the component with the output port. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup tun - */ - - OMX_ERRORTYPE (*ComponentTunnelRequest)( - OMX_IN OMX_HANDLETYPE hComp, - OMX_IN OMX_U32 nPort, - OMX_IN OMX_HANDLETYPE hTunneledComp, - OMX_IN OMX_U32 nTunneledPort, - OMX_INOUT OMX_TUNNELSETUPTYPE* pTunnelSetup); - - /** refer to OMX_UseBuffer in OMX_core.h or the OMX IL - specification for details on the UseBuffer method. - @ingroup buf - */ - OMX_ERRORTYPE (*UseBuffer)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr, - OMX_IN OMX_U32 nPortIndex, - OMX_IN OMX_PTR pAppPrivate, - OMX_IN OMX_U32 nSizeBytes, - OMX_IN OMX_U8* pBuffer); - - /** refer to OMX_AllocateBuffer in OMX_core.h or the OMX IL - specification for details on the AllocateBuffer method. - @ingroup buf - */ - OMX_ERRORTYPE (*AllocateBuffer)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_INOUT OMX_BUFFERHEADERTYPE** ppBuffer, - OMX_IN OMX_U32 nPortIndex, - OMX_IN OMX_PTR pAppPrivate, - OMX_IN OMX_U32 nSizeBytes); - - /** refer to OMX_FreeBuffer in OMX_core.h or the OMX IL - specification for details on the FreeBuffer method. - @ingroup buf - */ - OMX_ERRORTYPE (*FreeBuffer)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_U32 nPortIndex, - OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); - - /** refer to OMX_EmptyThisBuffer in OMX_core.h or the OMX IL - specification for details on the EmptyThisBuffer method. - @ingroup buf - */ - OMX_ERRORTYPE (*EmptyThisBuffer)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); - - /** refer to OMX_FillThisBuffer in OMX_core.h or the OMX IL - specification for details on the FillThisBuffer method. - @ingroup buf - */ - OMX_ERRORTYPE (*FillThisBuffer)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); - - /** The SetCallbacks method is used by the core to specify the callback - structure from the application to the component. This is a blocking - call. The component will return from this call within 5 msec. - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the GetHandle function. - @param [in] pCallbacks - pointer to an OMX_CALLBACKTYPE structure used to provide the - callback information to the component - @param [in] pAppData - pointer to an application defined value. It is anticipated that - the application will pass a pointer to a data structure or a "this - pointer" in this area to allow the callback (in the application) - to determine the context of the call - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - */ - OMX_ERRORTYPE (*SetCallbacks)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_CALLBACKTYPE* pCallbacks, - OMX_IN OMX_PTR pAppData); - - /** ComponentDeInit method is used to deinitialize the component - providing a means to free any resources allocated at component - initialization. NOTE: After this call the component handle is - not valid for further use. - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the GetHandle function. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - */ - OMX_ERRORTYPE (*ComponentDeInit)( - OMX_IN OMX_HANDLETYPE hComponent); - - /** @ingroup buf */ - OMX_ERRORTYPE (*UseEGLImage)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr, - OMX_IN OMX_U32 nPortIndex, - OMX_IN OMX_PTR pAppPrivate, - OMX_IN void* eglImage); - - OMX_ERRORTYPE (*ComponentRoleEnum)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_OUT OMX_U8 *cRole, - OMX_IN OMX_U32 nIndex); - -} OMX_COMPONENTTYPE; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ diff --git a/external/android/include/16/frameworks/native/include/media/openmax/OMX_ContentPipe.h b/external/android/include/16/frameworks/native/include/media/openmax/OMX_ContentPipe.h deleted file mode 100644 index ee9e4db..0000000 --- a/external/android/include/16/frameworks/native/include/media/openmax/OMX_ContentPipe.h +++ /dev/null @@ -1,212 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** OMX_ContentPipe.h - OpenMax IL version 1.1.2 - * The OMX_ContentPipe header file contains the definitions used to define - * the public interface for content piples. This header file is intended to - * be used by the component. - */ - -#ifndef OMX_CONTENTPIPE_H -#define OMX_CONTENTPIPE_H - -#ifndef KD_EACCES -/* OpenKODE error codes. CPResult values may be zero (indicating success - or one of the following values) */ -#define KD_EACCES (1) -#define KD_EADDRINUSE (2) -#define KD_EAGAIN (5) -#define KD_EBADF (7) -#define KD_EBUSY (8) -#define KD_ECONNREFUSED (9) -#define KD_ECONNRESET (10) -#define KD_EDEADLK (11) -#define KD_EDESTADDRREQ (12) -#define KD_ERANGE (35) -#define KD_EEXIST (13) -#define KD_EFBIG (14) -#define KD_EHOSTUNREACH (15) -#define KD_EINVAL (17) -#define KD_EIO (18) -#define KD_EISCONN (20) -#define KD_EISDIR (21) -#define KD_EMFILE (22) -#define KD_ENAMETOOLONG (23) -#define KD_ENOENT (24) -#define KD_ENOMEM (25) -#define KD_ENOSPC (26) -#define KD_ENOSYS (27) -#define KD_ENOTCONN (28) -#define KD_EPERM (33) -#define KD_ETIMEDOUT (36) -#define KD_EILSEQ (19) -#endif - -/** Map types from OMX standard types only here so interface is as generic as possible. */ -typedef OMX_U32 CPresult; -typedef char * CPstring; -typedef void * CPhandle; -typedef OMX_U32 CPuint; -typedef OMX_S32 CPint; -typedef char CPbyte; -typedef OMX_BOOL CPbool; - -/** enumeration of origin types used in the CP_PIPETYPE's Seek function - * @ingroup cp - */ -typedef enum CP_ORIGINTYPE { - CP_OriginBegin, - CP_OriginCur, - CP_OriginEnd, - CP_OriginKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - CP_OriginVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - CP_OriginMax = 0X7FFFFFFF -} CP_ORIGINTYPE; - -/** enumeration of contact access types used in the CP_PIPETYPE's Open function - * @ingroup cp - */ -typedef enum CP_ACCESSTYPE { - CP_AccessRead, - CP_AccessWrite, - CP_AccessReadWrite , - CP_AccessKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - CP_AccessVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - CP_AccessMax = 0X7FFFFFFF -} CP_ACCESSTYPE; - -/** enumeration of results returned by the CP_PIPETYPE's CheckAvailableBytes function - * @ingroup cp - */ -typedef enum CP_CHECKBYTESRESULTTYPE -{ - CP_CheckBytesOk, /**< There are at least the request number - of bytes available */ - CP_CheckBytesNotReady, /**< The pipe is still retrieving bytes - and presently lacks sufficient bytes. - Client will be called when they are - sufficient bytes are available. */ - CP_CheckBytesInsufficientBytes , /**< The pipe has retrieved all bytes - but those available are less than those - requested */ - CP_CheckBytesAtEndOfStream, /**< The pipe has reached the end of stream - and no more bytes are available. */ - CP_CheckBytesOutOfBuffers, /**< All read/write buffers are currently in use. */ - CP_CheckBytesKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - CP_CheckBytesVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - CP_CheckBytesMax = 0X7FFFFFFF -} CP_CHECKBYTESRESULTTYPE; - -/** enumeration of content pipe events sent to the client callback. - * @ingroup cp - */ -typedef enum CP_EVENTTYPE{ - CP_BytesAvailable, /** bytes requested in a CheckAvailableBytes call are now available*/ - CP_Overflow, /** enumeration of content pipe events sent to the client callback*/ - CP_PipeDisconnected , /** enumeration of content pipe events sent to the client callback*/ - CP_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - CP_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - CP_EventMax = 0X7FFFFFFF -} CP_EVENTTYPE; - -/** content pipe definition - * @ingroup cp - */ -typedef struct CP_PIPETYPE -{ - /** Open a content stream for reading or writing. */ - CPresult (*Open)( CPhandle* hContent, CPstring szURI, CP_ACCESSTYPE eAccess ); - - /** Close a content stream. */ - CPresult (*Close)( CPhandle hContent ); - - /** Create a content source and open it for writing. */ - CPresult (*Create)( CPhandle *hContent, CPstring szURI ); - - /** Check the that specified number of bytes are available for reading or writing (depending on access type).*/ - CPresult (*CheckAvailableBytes)( CPhandle hContent, CPuint nBytesRequested, CP_CHECKBYTESRESULTTYPE *eResult ); - - /** Seek to certain position in the content relative to the specified origin. */ - CPresult (*SetPosition)( CPhandle hContent, CPint nOffset, CP_ORIGINTYPE eOrigin); - - /** Retrieve the current position relative to the start of the content. */ - CPresult (*GetPosition)( CPhandle hContent, CPuint *pPosition); - - /** Retrieve data of the specified size from the content stream (advance content pointer by size of data). - Note: pipe client provides pointer. This function is appropriate for small high frequency reads. */ - CPresult (*Read)( CPhandle hContent, CPbyte *pData, CPuint nSize); - - /** Retrieve a buffer allocated by the pipe that contains the requested number of bytes. - Buffer contains the next block of bytes, as specified by nSize, of the content. nSize also - returns the size of the block actually read. Content pointer advances the by the returned size. - Note: pipe provides pointer. This function is appropriate for large reads. The client must call - ReleaseReadBuffer when done with buffer. - - In some cases the requested block may not reside in contiguous memory within the - pipe implementation. For instance if the pipe leverages a circular buffer then the requested - block may straddle the boundary of the circular buffer. By default a pipe implementation - performs a copy in this case to provide the block to the pipe client in one contiguous buffer. - If, however, the client sets bForbidCopy, then the pipe returns only those bytes preceding the memory - boundary. Here the client may retrieve the data in segments over successive calls. */ - CPresult (*ReadBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint *nSize, CPbool bForbidCopy); - - /** Release a buffer obtained by ReadBuffer back to the pipe. */ - CPresult (*ReleaseReadBuffer)(CPhandle hContent, CPbyte *pBuffer); - - /** Write data of the specified size to the content (advance content pointer by size of data). - Note: pipe client provides pointer. This function is appropriate for small high frequency writes. */ - CPresult (*Write)( CPhandle hContent, CPbyte *data, CPuint nSize); - - /** Retrieve a buffer allocated by the pipe used to write data to the content. - Client will fill buffer with output data. Note: pipe provides pointer. This function is appropriate - for large writes. The client must call WriteBuffer when done it has filled the buffer with data.*/ - CPresult (*GetWriteBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint nSize); - - /** Deliver a buffer obtained via GetWriteBuffer to the pipe. Pipe will write the - the contents of the buffer to content and advance content pointer by the size of the buffer */ - CPresult (*WriteBuffer)( CPhandle hContent, CPbyte *pBuffer, CPuint nFilledSize); - - /** Register a per-handle client callback with the content pipe. */ - CPresult (*RegisterCallback)( CPhandle hContent, CPresult (*ClientCallback)(CP_EVENTTYPE eEvent, CPuint iParam)); - -} CP_PIPETYPE; - -#endif - diff --git a/external/android/include/16/frameworks/native/include/media/openmax/OMX_Core.h b/external/android/include/16/frameworks/native/include/media/openmax/OMX_Core.h deleted file mode 100644 index 9fb0f6f..0000000 --- a/external/android/include/16/frameworks/native/include/media/openmax/OMX_Core.h +++ /dev/null @@ -1,1448 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** OMX_Core.h - OpenMax IL version 1.1.2 - * The OMX_Core header file contains the definitions used by both the - * application and the component to access common items. - */ - -#ifndef OMX_Core_h -#define OMX_Core_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/* Each OMX header shall include all required header files to allow the - * header to compile without errors. The includes below are required - * for this header file to compile successfully - */ - -#include - - -/** The OMX_COMMANDTYPE enumeration is used to specify the action in the - * OMX_SendCommand macro. - * @ingroup core - */ -typedef enum OMX_COMMANDTYPE -{ - OMX_CommandStateSet, /**< Change the component state */ - OMX_CommandFlush, /**< Flush the data queue(s) of a component */ - OMX_CommandPortDisable, /**< Disable a port on a component. */ - OMX_CommandPortEnable, /**< Enable a port on a component. */ - OMX_CommandMarkBuffer, /**< Mark a component/buffer for observation */ - OMX_CommandKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_CommandVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_CommandMax = 0X7FFFFFFF -} OMX_COMMANDTYPE; - - - -/** The OMX_STATETYPE enumeration is used to indicate or change the component - * state. This enumeration reflects the current state of the component when - * used with the OMX_GetState macro or becomes the parameter in a state change - * command when used with the OMX_SendCommand macro. - * - * The component will be in the Loaded state after the component is initially - * loaded into memory. In the Loaded state, the component is not allowed to - * allocate or hold resources other than to build it's internal parameter - * and configuration tables. The application will send one or more - * SetParameters/GetParameters and SetConfig/GetConfig commands to the - * component and the component will record each of these parameter and - * configuration changes for use later. When the application sends the - * Idle command, the component will acquire the resources needed for the - * specified configuration and will transition to the idle state if the - * allocation is successful. If the component cannot successfully - * transition to the idle state for any reason, the state of the component - * shall be fully rolled back to the Loaded state (e.g. all allocated - * resources shall be released). When the component receives the command - * to go to the Executing state, it shall begin processing buffers by - * sending all input buffers it holds to the application. While - * the component is in the Idle state, the application may also send the - * Pause command. If the component receives the pause command while in the - * Idle state, the component shall send all input buffers it holds to the - * application, but shall not begin processing buffers. This will allow the - * application to prefill buffers. - * - * @ingroup comp - */ - -typedef enum OMX_STATETYPE -{ - OMX_StateInvalid, /**< component has detected that it's internal data - structures are corrupted to the point that - it cannot determine it's state properly */ - OMX_StateLoaded, /**< component has been loaded but has not completed - initialization. The OMX_SetParameter macro - and the OMX_GetParameter macro are the only - valid macros allowed to be sent to the - component in this state. */ - OMX_StateIdle, /**< component initialization has been completed - successfully and the component is ready to - to start. */ - OMX_StateExecuting, /**< component has accepted the start command and - is processing data (if data is available) */ - OMX_StatePause, /**< component has received pause command */ - OMX_StateWaitForResources, /**< component is waiting for resources, either after - preemption or before it gets the resources requested. - See specification for complete details. */ - OMX_StateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_StateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_StateMax = 0X7FFFFFFF -} OMX_STATETYPE; - -/** The OMX_ERRORTYPE enumeration defines the standard OMX Errors. These - * errors should cover most of the common failure cases. However, - * vendors are free to add additional error messages of their own as - * long as they follow these rules: - * 1. Vendor error messages shall be in the range of 0x90000000 to - * 0x9000FFFF. - * 2. Vendor error messages shall be defined in a header file provided - * with the component. No error messages are allowed that are - * not defined. - */ -typedef enum OMX_ERRORTYPE -{ - OMX_ErrorNone = 0, - - /** There were insufficient resources to perform the requested operation */ - OMX_ErrorInsufficientResources = (OMX_S32) 0x80001000, - - /** There was an error, but the cause of the error could not be determined */ - OMX_ErrorUndefined = (OMX_S32) 0x80001001, - - /** The component name string was not valid */ - OMX_ErrorInvalidComponentName = (OMX_S32) 0x80001002, - - /** No component with the specified name string was found */ - OMX_ErrorComponentNotFound = (OMX_S32) 0x80001003, - - /** The component specified did not have a "OMX_ComponentInit" or - "OMX_ComponentDeInit entry point */ - OMX_ErrorInvalidComponent = (OMX_S32) 0x80001004, - - /** One or more parameters were not valid */ - OMX_ErrorBadParameter = (OMX_S32) 0x80001005, - - /** The requested function is not implemented */ - OMX_ErrorNotImplemented = (OMX_S32) 0x80001006, - - /** The buffer was emptied before the next buffer was ready */ - OMX_ErrorUnderflow = (OMX_S32) 0x80001007, - - /** The buffer was not available when it was needed */ - OMX_ErrorOverflow = (OMX_S32) 0x80001008, - - /** The hardware failed to respond as expected */ - OMX_ErrorHardware = (OMX_S32) 0x80001009, - - /** The component is in the state OMX_StateInvalid */ - OMX_ErrorInvalidState = (OMX_S32) 0x8000100A, - - /** Stream is found to be corrupt */ - OMX_ErrorStreamCorrupt = (OMX_S32) 0x8000100B, - - /** Ports being connected are not compatible */ - OMX_ErrorPortsNotCompatible = (OMX_S32) 0x8000100C, - - /** Resources allocated to an idle component have been - lost resulting in the component returning to the loaded state */ - OMX_ErrorResourcesLost = (OMX_S32) 0x8000100D, - - /** No more indicies can be enumerated */ - OMX_ErrorNoMore = (OMX_S32) 0x8000100E, - - /** The component detected a version mismatch */ - OMX_ErrorVersionMismatch = (OMX_S32) 0x8000100F, - - /** The component is not ready to return data at this time */ - OMX_ErrorNotReady = (OMX_S32) 0x80001010, - - /** There was a timeout that occurred */ - OMX_ErrorTimeout = (OMX_S32) 0x80001011, - - /** This error occurs when trying to transition into the state you are already in */ - OMX_ErrorSameState = (OMX_S32) 0x80001012, - - /** Resources allocated to an executing or paused component have been - preempted, causing the component to return to the idle state */ - OMX_ErrorResourcesPreempted = (OMX_S32) 0x80001013, - - /** A non-supplier port sends this error to the IL client (via the EventHandler callback) - during the allocation of buffers (on a transition from the LOADED to the IDLE state or - on a port restart) when it deems that it has waited an unusually long time for the supplier - to send it an allocated buffer via a UseBuffer call. */ - OMX_ErrorPortUnresponsiveDuringAllocation = (OMX_S32) 0x80001014, - - /** A non-supplier port sends this error to the IL client (via the EventHandler callback) - during the deallocation of buffers (on a transition from the IDLE to LOADED state or - on a port stop) when it deems that it has waited an unusually long time for the supplier - to request the deallocation of a buffer header via a FreeBuffer call. */ - OMX_ErrorPortUnresponsiveDuringDeallocation = (OMX_S32) 0x80001015, - - /** A supplier port sends this error to the IL client (via the EventHandler callback) - during the stopping of a port (either on a transition from the IDLE to LOADED - state or a port stop) when it deems that it has waited an unusually long time for - the non-supplier to return a buffer via an EmptyThisBuffer or FillThisBuffer call. */ - OMX_ErrorPortUnresponsiveDuringStop = (OMX_S32) 0x80001016, - - /** Attempting a state transtion that is not allowed */ - OMX_ErrorIncorrectStateTransition = (OMX_S32) 0x80001017, - - /* Attempting a command that is not allowed during the present state. */ - OMX_ErrorIncorrectStateOperation = (OMX_S32) 0x80001018, - - /** The values encapsulated in the parameter or config structure are not supported. */ - OMX_ErrorUnsupportedSetting = (OMX_S32) 0x80001019, - - /** The parameter or config indicated by the given index is not supported. */ - OMX_ErrorUnsupportedIndex = (OMX_S32) 0x8000101A, - - /** The port index supplied is incorrect. */ - OMX_ErrorBadPortIndex = (OMX_S32) 0x8000101B, - - /** The port has lost one or more of its buffers and it thus unpopulated. */ - OMX_ErrorPortUnpopulated = (OMX_S32) 0x8000101C, - - /** Component suspended due to temporary loss of resources */ - OMX_ErrorComponentSuspended = (OMX_S32) 0x8000101D, - - /** Component suspended due to an inability to acquire dynamic resources */ - OMX_ErrorDynamicResourcesUnavailable = (OMX_S32) 0x8000101E, - - /** When the macroblock error reporting is enabled the component returns new error - for every frame that has errors */ - OMX_ErrorMbErrorsInFrame = (OMX_S32) 0x8000101F, - - /** A component reports this error when it cannot parse or determine the format of an input stream. */ - OMX_ErrorFormatNotDetected = (OMX_S32) 0x80001020, - - /** The content open operation failed. */ - OMX_ErrorContentPipeOpenFailed = (OMX_S32) 0x80001021, - - /** The content creation operation failed. */ - OMX_ErrorContentPipeCreationFailed = (OMX_S32) 0x80001022, - - /** Separate table information is being used */ - OMX_ErrorSeperateTablesUsed = (OMX_S32) 0x80001023, - - /** Tunneling is unsupported by the component*/ - OMX_ErrorTunnelingUnsupported = (OMX_S32) 0x80001024, - - OMX_ErrorKhronosExtensions = (OMX_S32)0x8F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_ErrorVendorStartUnused = (OMX_S32)0x90000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_ErrorMax = 0x7FFFFFFF -} OMX_ERRORTYPE; - -/** @ingroup core */ -typedef OMX_ERRORTYPE (* OMX_COMPONENTINITTYPE)(OMX_IN OMX_HANDLETYPE hComponent); - -/** @ingroup core */ -typedef struct OMX_COMPONENTREGISTERTYPE -{ - const char * pName; /* Component name, 128 byte limit (including '\0') applies */ - OMX_COMPONENTINITTYPE pInitialize; /* Component instance initialization function */ -} OMX_COMPONENTREGISTERTYPE; - -/** @ingroup core */ -extern OMX_COMPONENTREGISTERTYPE OMX_ComponentRegistered[]; - -/** @ingroup rpm */ -typedef struct OMX_PRIORITYMGMTTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nGroupPriority; /**< Priority of the component group */ - OMX_U32 nGroupID; /**< ID of the component group */ -} OMX_PRIORITYMGMTTYPE; - -/* Component name and Role names are limited to 128 characters including the terminating '\0'. */ -#define OMX_MAX_STRINGNAME_SIZE 128 - -/** @ingroup comp */ -typedef struct OMX_PARAM_COMPONENTROLETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U8 cRole[OMX_MAX_STRINGNAME_SIZE]; /**< name of standard component which defines component role */ -} OMX_PARAM_COMPONENTROLETYPE; - -/** End of Stream Buffer Flag: - * - * A component sets EOS when it has no more data to emit on a particular - * output port. Thus an output port shall set EOS on the last buffer it - * emits. A component's determination of when an output port should - * cease sending data is implemenation specific. - * @ingroup buf - */ - -#define OMX_BUFFERFLAG_EOS 0x00000001 - -/** Start Time Buffer Flag: - * - * The source of a stream (e.g. a demux component) sets the STARTTIME - * flag on the buffer that contains the starting timestamp for the - * stream. The starting timestamp corresponds to the first data that - * should be displayed at startup or after a seek. - * The first timestamp of the stream is not necessarily the start time. - * For instance, in the case of a seek to a particular video frame, - * the target frame may be an interframe. Thus the first buffer of - * the stream will be the intra-frame preceding the target frame and - * the starttime will occur with the target frame (with any other - * required frames required to reconstruct the target intervening). - * - * The STARTTIME flag is directly associated with the buffer's - * timestamp ' thus its association to buffer data and its - * propagation is identical to the timestamp's. - * - * When a Sync Component client receives a buffer with the - * STARTTIME flag it shall perform a SetConfig on its sync port - * using OMX_ConfigTimeClientStartTime and passing the buffer's - * timestamp. - * - * @ingroup buf - */ - -#define OMX_BUFFERFLAG_STARTTIME 0x00000002 - - - -/** Decode Only Buffer Flag: - * - * The source of a stream (e.g. a demux component) sets the DECODEONLY - * flag on any buffer that should shall be decoded but should not be - * displayed. This flag is used, for instance, when a source seeks to - * a target interframe that requires the decode of frames preceding the - * target to facilitate the target's reconstruction. In this case the - * source would emit the frames preceding the target downstream - * but mark them as decode only. - * - * The DECODEONLY is associated with buffer data and propagated in a - * manner identical to the buffer timestamp. - * - * A component that renders data should ignore all buffers with - * the DECODEONLY flag set. - * - * @ingroup buf - */ - -#define OMX_BUFFERFLAG_DECODEONLY 0x00000004 - - -/* Data Corrupt Flag: This flag is set when the IL client believes the data in the associated buffer is corrupt - * @ingroup buf - */ - -#define OMX_BUFFERFLAG_DATACORRUPT 0x00000008 - -/* End of Frame: The buffer contains exactly one end of frame and no data - * occurs after the end of frame. This flag is an optional hint. The absence - * of this flag does not imply the absence of an end of frame within the buffer. - * @ingroup buf -*/ -#define OMX_BUFFERFLAG_ENDOFFRAME 0x00000010 - -/* Sync Frame Flag: This flag is set when the buffer content contains a coded sync frame ' - * a frame that has no dependency on any other frame information - * @ingroup buf - */ -#define OMX_BUFFERFLAG_SYNCFRAME 0x00000020 - -/* Extra data present flag: there is extra data appended to the data stream - * residing in the buffer - * @ingroup buf - */ -#define OMX_BUFFERFLAG_EXTRADATA 0x00000040 - -/** Codec Config Buffer Flag: -* OMX_BUFFERFLAG_CODECCONFIG is an optional flag that is set by an -* output port when all bytes in the buffer form part or all of a set of -* codec specific configuration data. Examples include SPS/PPS nal units -* for OMX_VIDEO_CodingAVC or AudioSpecificConfig data for -* OMX_AUDIO_CodingAAC. Any component that for a given stream sets -* OMX_BUFFERFLAG_CODECCONFIG shall not mix codec configuration bytes -* with frame data in the same buffer, and shall send all buffers -* containing codec configuration bytes before any buffers containing -* frame data that those configurations bytes describe. -* If the stream format for a particular codec has a frame specific -* header at the start of each frame, for example OMX_AUDIO_CodingMP3 or -* OMX_AUDIO_CodingAAC in ADTS mode, then these shall be presented as -* normal without setting OMX_BUFFERFLAG_CODECCONFIG. - * @ingroup buf - */ -#define OMX_BUFFERFLAG_CODECCONFIG 0x00000080 - - - -/** @ingroup buf */ -typedef struct OMX_BUFFERHEADERTYPE -{ - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U8* pBuffer; /**< Pointer to actual block of memory - that is acting as the buffer */ - OMX_U32 nAllocLen; /**< size of the buffer allocated, in bytes */ - OMX_U32 nFilledLen; /**< number of bytes currently in the - buffer */ - OMX_U32 nOffset; /**< start offset of valid data in bytes from - the start of the buffer */ - OMX_PTR pAppPrivate; /**< pointer to any data the application - wants to associate with this buffer */ - OMX_PTR pPlatformPrivate; /**< pointer to any data the platform - wants to associate with this buffer */ - OMX_PTR pInputPortPrivate; /**< pointer to any data the input port - wants to associate with this buffer */ - OMX_PTR pOutputPortPrivate; /**< pointer to any data the output port - wants to associate with this buffer */ - OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will generate a - mark event upon processing this buffer. */ - OMX_PTR pMarkData; /**< Application specific data associated with - the mark sent on a mark event to disambiguate - this mark from others. */ - OMX_U32 nTickCount; /**< Optional entry that the component and - application can update with a tick count - when they access the component. This - value should be in microseconds. Since - this is a value relative to an arbitrary - starting point, this value cannot be used - to determine absolute time. This is an - optional entry and not all components - will update it.*/ - OMX_TICKS nTimeStamp; /**< Timestamp corresponding to the sample - starting at the first logical sample - boundary in the buffer. Timestamps of - successive samples within the buffer may - be inferred by adding the duration of the - of the preceding buffer to the timestamp - of the preceding buffer.*/ - OMX_U32 nFlags; /**< buffer specific flags */ - OMX_U32 nOutputPortIndex; /**< The index of the output port (if any) using - this buffer */ - OMX_U32 nInputPortIndex; /**< The index of the input port (if any) using - this buffer */ -} OMX_BUFFERHEADERTYPE; - -/** The OMX_EXTRADATATYPE enumeration is used to define the - * possible extra data payload types. - * NB: this enum is binary backwards compatible with the previous - * OMX_EXTRADATA_QUANT define. This should be replaced with - * OMX_ExtraDataQuantization. - */ -typedef enum OMX_EXTRADATATYPE -{ - OMX_ExtraDataNone = 0, /**< Indicates that no more extra data sections follow */ - OMX_ExtraDataQuantization, /**< The data payload contains quantization data */ - OMX_ExtraDataKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_ExtraDataVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_ExtraDataMax = 0x7FFFFFFF -} OMX_EXTRADATATYPE; - - -typedef struct OMX_OTHER_EXTRADATATYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_EXTRADATATYPE eType; /* Extra Data type */ - OMX_U32 nDataSize; /* Size of the supporting data to follow */ - OMX_U8 data[1]; /* Supporting data hint */ -} OMX_OTHER_EXTRADATATYPE; - -/** @ingroup comp */ -typedef struct OMX_PORT_PARAM_TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPorts; /**< The number of ports for this component */ - OMX_U32 nStartPortNumber; /** first port number for this type of port */ -} OMX_PORT_PARAM_TYPE; - -/** @ingroup comp */ -typedef enum OMX_EVENTTYPE -{ - OMX_EventCmdComplete, /**< component has sucessfully completed a command */ - OMX_EventError, /**< component has detected an error condition */ - OMX_EventMark, /**< component has detected a buffer mark */ - OMX_EventPortSettingsChanged, /**< component is reported a port settings change */ - OMX_EventBufferFlag, /**< component has detected an EOS */ - OMX_EventResourcesAcquired, /**< component has been granted resources and is - automatically starting the state change from - OMX_StateWaitForResources to OMX_StateIdle. */ - OMX_EventComponentResumed, /**< Component resumed due to reacquisition of resources */ - OMX_EventDynamicResourcesAvailable, /**< Component has acquired previously unavailable dynamic resources */ - OMX_EventPortFormatDetected, /**< Component has detected a supported format. */ - OMX_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_EventMax = 0x7FFFFFFF -} OMX_EVENTTYPE; - -typedef struct OMX_CALLBACKTYPE -{ - /** The EventHandler method is used to notify the application when an - event of interest occurs. Events are defined in the OMX_EVENTTYPE - enumeration. Please see that enumeration for details of what will - be returned for each type of event. Callbacks should not return - an error to the component, so if an error occurs, the application - shall handle it internally. This is a blocking call. - - The application should return from this call within 5 msec to avoid - blocking the component for an excessively long period of time. - - @param hComponent - handle of the component to access. This is the component - handle returned by the call to the GetHandle function. - @param pAppData - pointer to an application defined value that was provided in the - pAppData parameter to the OMX_GetHandle method for the component. - This application defined value is provided so that the application - can have a component specific context when receiving the callback. - @param eEvent - Event that the component wants to notify the application about. - @param nData1 - nData will be the OMX_ERRORTYPE for an error event and will be - an OMX_COMMANDTYPE for a command complete event and OMX_INDEXTYPE for a OMX_PortSettingsChanged event. - @param nData2 - nData2 will hold further information related to the event. Can be OMX_STATETYPE for - a OMX_CommandStateSet command or port index for a OMX_PortSettingsChanged event. - Default value is 0 if not used. ) - @param pEventData - Pointer to additional event-specific data (see spec for meaning). - */ - - OMX_ERRORTYPE (*EventHandler)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_PTR pAppData, - OMX_IN OMX_EVENTTYPE eEvent, - OMX_IN OMX_U32 nData1, - OMX_IN OMX_U32 nData2, - OMX_IN OMX_PTR pEventData); - - /** The EmptyBufferDone method is used to return emptied buffers from an - input port back to the application for reuse. This is a blocking call - so the application should not attempt to refill the buffers during this - call, but should queue them and refill them in another thread. There - is no error return, so the application shall handle any errors generated - internally. - - The application should return from this call within 5 msec. - - @param hComponent - handle of the component to access. This is the component - handle returned by the call to the GetHandle function. - @param pAppData - pointer to an application defined value that was provided in the - pAppData parameter to the OMX_GetHandle method for the component. - This application defined value is provided so that the application - can have a component specific context when receiving the callback. - @param pBuffer - pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer - or AllocateBuffer indicating the buffer that was emptied. - @ingroup buf - */ - OMX_ERRORTYPE (*EmptyBufferDone)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_PTR pAppData, - OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); - - /** The FillBufferDone method is used to return filled buffers from an - output port back to the application for emptying and then reuse. - This is a blocking call so the application should not attempt to - empty the buffers during this call, but should queue the buffers - and empty them in another thread. There is no error return, so - the application shall handle any errors generated internally. The - application shall also update the buffer header to indicate the - number of bytes placed into the buffer. - - The application should return from this call within 5 msec. - - @param hComponent - handle of the component to access. This is the component - handle returned by the call to the GetHandle function. - @param pAppData - pointer to an application defined value that was provided in the - pAppData parameter to the OMX_GetHandle method for the component. - This application defined value is provided so that the application - can have a component specific context when receiving the callback. - @param pBuffer - pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer - or AllocateBuffer indicating the buffer that was filled. - @ingroup buf - */ - OMX_ERRORTYPE (*FillBufferDone)( - OMX_OUT OMX_HANDLETYPE hComponent, - OMX_OUT OMX_PTR pAppData, - OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer); - -} OMX_CALLBACKTYPE; - -/** The OMX_BUFFERSUPPLIERTYPE enumeration is used to dictate port supplier - preference when tunneling between two ports. - @ingroup tun buf -*/ -typedef enum OMX_BUFFERSUPPLIERTYPE -{ - OMX_BufferSupplyUnspecified = 0x0, /**< port supplying the buffers is unspecified, - or don't care */ - OMX_BufferSupplyInput, /**< input port supplies the buffers */ - OMX_BufferSupplyOutput, /**< output port supplies the buffers */ - OMX_BufferSupplyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_BufferSupplyVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_BufferSupplyMax = 0x7FFFFFFF -} OMX_BUFFERSUPPLIERTYPE; - - -/** buffer supplier parameter - * @ingroup tun - */ -typedef struct OMX_PARAM_BUFFERSUPPLIERTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BUFFERSUPPLIERTYPE eBufferSupplier; /**< buffer supplier */ -} OMX_PARAM_BUFFERSUPPLIERTYPE; - - -/**< indicates that buffers received by an input port of a tunnel - may not modify the data in the buffers - @ingroup tun - */ -#define OMX_PORTTUNNELFLAG_READONLY 0x00000001 - - -/** The OMX_TUNNELSETUPTYPE structure is used to pass data from an output - port to an input port as part the two ComponentTunnelRequest calls - resulting from a OMX_SetupTunnel call from the IL Client. - @ingroup tun - */ -typedef struct OMX_TUNNELSETUPTYPE -{ - OMX_U32 nTunnelFlags; /**< bit flags for tunneling */ - OMX_BUFFERSUPPLIERTYPE eSupplier; /**< supplier preference */ -} OMX_TUNNELSETUPTYPE; - -/* OMX Component headers is included to enable the core to use - macros for functions into the component for OMX release 1.0. - Developers should not access any structures or data from within - the component header directly */ -/* TO BE REMOVED - #include */ - -/** GetComponentVersion will return information about the component. - This is a blocking call. This macro will go directly from the - application to the component (via a core macro). The - component will return from this call within 5 msec. - @param [in] hComponent - handle of component to execute the command - @param [out] pComponentName - pointer to an empty string of length 128 bytes. The component - will write its name into this string. The name will be - terminated by a single zero byte. The name of a component will - be 127 bytes or less to leave room for the trailing zero byte. - An example of a valid component name is "OMX.ABC.ChannelMixer\0". - @param [out] pComponentVersion - pointer to an OMX Version structure that the component will fill - in. The component will fill in a value that indicates the - component version. NOTE: the component version is NOT the same - as the OMX Specification version (found in all structures). The - component version is defined by the vendor of the component and - its value is entirely up to the component vendor. - @param [out] pSpecVersion - pointer to an OMX Version structure that the component will fill - in. The SpecVersion is the version of the specification that the - component was built against. Please note that this value may or - may not match the structure's version. For example, if the - component was built against the 2.0 specification, but the - application (which creates the structure is built against the - 1.0 specification the versions would be different. - @param [out] pComponentUUID - pointer to the UUID of the component which will be filled in by - the component. The UUID is a unique identifier that is set at - RUN time for the component and is unique to each instantion of - the component. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_GetComponentVersion( \ - hComponent, \ - pComponentName, \ - pComponentVersion, \ - pSpecVersion, \ - pComponentUUID) \ - ((OMX_COMPONENTTYPE*)hComponent)->GetComponentVersion( \ - hComponent, \ - pComponentName, \ - pComponentVersion, \ - pSpecVersion, \ - pComponentUUID) /* Macro End */ - - -/** Send a command to the component. This call is a non-blocking call. - The component should check the parameters and then queue the command - to the component thread to be executed. The component thread shall - send the EventHandler() callback at the conclusion of the command. - This macro will go directly from the application to the component (via - a core macro). The component will return from this call within 5 msec. - - When the command is "OMX_CommandStateSet" the component will queue a - state transition to the new state idenfied in nParam. - - When the command is "OMX_CommandFlush", to flush a port's buffer queues, - the command will force the component to return all buffers NOT CURRENTLY - BEING PROCESSED to the application, in the order in which the buffers - were received. - - When the command is "OMX_CommandPortDisable" or - "OMX_CommandPortEnable", the component's port (given by the value of - nParam) will be stopped or restarted. - - When the command "OMX_CommandMarkBuffer" is used to mark a buffer, the - pCmdData will point to a OMX_MARKTYPE structure containing the component - handle of the component to examine the buffer chain for the mark. nParam1 - contains the index of the port on which the buffer mark is applied. - - Specification text for more details. - - @param [in] hComponent - handle of component to execute the command - @param [in] Cmd - Command for the component to execute - @param [in] nParam - Parameter for the command to be executed. When Cmd has the value - OMX_CommandStateSet, value is a member of OMX_STATETYPE. When Cmd has - the value OMX_CommandFlush, value of nParam indicates which port(s) - to flush. -1 is used to flush all ports a single port index will - only flush that port. When Cmd has the value "OMX_CommandPortDisable" - or "OMX_CommandPortEnable", the component's port is given by - the value of nParam. When Cmd has the value "OMX_CommandMarkBuffer" - the components pot is given by the value of nParam. - @param [in] pCmdData - Parameter pointing to the OMX_MARKTYPE structure when Cmd has the value - "OMX_CommandMarkBuffer". - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_SendCommand( \ - hComponent, \ - Cmd, \ - nParam, \ - pCmdData) \ - ((OMX_COMPONENTTYPE*)hComponent)->SendCommand( \ - hComponent, \ - Cmd, \ - nParam, \ - pCmdData) /* Macro End */ - - -/** The OMX_GetParameter macro will get one of the current parameter - settings from the component. This macro cannot only be invoked when - the component is in the OMX_StateInvalid state. The nParamIndex - parameter is used to indicate which structure is being requested from - the component. The application shall allocate the correct structure - and shall fill in the structure size and version information before - invoking this macro. When the parameter applies to a port, the - caller shall fill in the appropriate nPortIndex value indicating the - port on which the parameter applies. If the component has not had - any settings changed, then the component should return a set of - valid DEFAULT parameters for the component. This is a blocking - call. - - The component should return from this call within 20 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] nParamIndex - Index of the structure to be filled. This value is from the - OMX_INDEXTYPE enumeration. - @param [in,out] pComponentParameterStructure - Pointer to application allocated structure to be filled by the - component. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_GetParameter( \ - hComponent, \ - nParamIndex, \ - pComponentParameterStructure) \ - ((OMX_COMPONENTTYPE*)hComponent)->GetParameter( \ - hComponent, \ - nParamIndex, \ - pComponentParameterStructure) /* Macro End */ - - -/** The OMX_SetParameter macro will send an initialization parameter - structure to a component. Each structure shall be sent one at a time, - in a separate invocation of the macro. This macro can only be - invoked when the component is in the OMX_StateLoaded state, or the - port is disabled (when the parameter applies to a port). The - nParamIndex parameter is used to indicate which structure is being - passed to the component. The application shall allocate the - correct structure and shall fill in the structure size and version - information (as well as the actual data) before invoking this macro. - The application is free to dispose of this structure after the call - as the component is required to copy any data it shall retain. This - is a blocking call. - - The component should return from this call within 20 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] nIndex - Index of the structure to be sent. This value is from the - OMX_INDEXTYPE enumeration. - @param [in] pComponentParameterStructure - pointer to application allocated structure to be used for - initialization by the component. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_SetParameter( \ - hComponent, \ - nParamIndex, \ - pComponentParameterStructure) \ - ((OMX_COMPONENTTYPE*)hComponent)->SetParameter( \ - hComponent, \ - nParamIndex, \ - pComponentParameterStructure) /* Macro End */ - - -/** The OMX_GetConfig macro will get one of the configuration structures - from a component. This macro can be invoked anytime after the - component has been loaded. The nParamIndex call parameter is used to - indicate which structure is being requested from the component. The - application shall allocate the correct structure and shall fill in the - structure size and version information before invoking this macro. - If the component has not had this configuration parameter sent before, - then the component should return a set of valid DEFAULT values for the - component. This is a blocking call. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] nIndex - Index of the structure to be filled. This value is from the - OMX_INDEXTYPE enumeration. - @param [in,out] pComponentConfigStructure - pointer to application allocated structure to be filled by the - component. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp -*/ -#define OMX_GetConfig( \ - hComponent, \ - nConfigIndex, \ - pComponentConfigStructure) \ - ((OMX_COMPONENTTYPE*)hComponent)->GetConfig( \ - hComponent, \ - nConfigIndex, \ - pComponentConfigStructure) /* Macro End */ - - -/** The OMX_SetConfig macro will send one of the configuration - structures to a component. Each structure shall be sent one at a time, - each in a separate invocation of the macro. This macro can be invoked - anytime after the component has been loaded. The application shall - allocate the correct structure and shall fill in the structure size - and version information (as well as the actual data) before invoking - this macro. The application is free to dispose of this structure after - the call as the component is required to copy any data it shall retain. - This is a blocking call. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] nConfigIndex - Index of the structure to be sent. This value is from the - OMX_INDEXTYPE enumeration above. - @param [in] pComponentConfigStructure - pointer to application allocated structure to be used for - initialization by the component. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_SetConfig( \ - hComponent, \ - nConfigIndex, \ - pComponentConfigStructure) \ - ((OMX_COMPONENTTYPE*)hComponent)->SetConfig( \ - hComponent, \ - nConfigIndex, \ - pComponentConfigStructure) /* Macro End */ - - -/** The OMX_GetExtensionIndex macro will invoke a component to translate - a vendor specific configuration or parameter string into an OMX - structure index. There is no requirement for the vendor to support - this command for the indexes already found in the OMX_INDEXTYPE - enumeration (this is done to save space in small components). The - component shall support all vendor supplied extension indexes not found - in the master OMX_INDEXTYPE enumeration. This is a blocking call. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the GetHandle function. - @param [in] cParameterName - OMX_STRING that shall be less than 128 characters long including - the trailing null byte. This is the string that will get - translated by the component into a configuration index. - @param [out] pIndexType - a pointer to a OMX_INDEXTYPE to receive the index value. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_GetExtensionIndex( \ - hComponent, \ - cParameterName, \ - pIndexType) \ - ((OMX_COMPONENTTYPE*)hComponent)->GetExtensionIndex( \ - hComponent, \ - cParameterName, \ - pIndexType) /* Macro End */ - - -/** The OMX_GetState macro will invoke the component to get the current - state of the component and place the state value into the location - pointed to by pState. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [out] pState - pointer to the location to receive the state. The value returned - is one of the OMX_STATETYPE members - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_GetState( \ - hComponent, \ - pState) \ - ((OMX_COMPONENTTYPE*)hComponent)->GetState( \ - hComponent, \ - pState) /* Macro End */ - - -/** The OMX_UseBuffer macro will request that the component use - a buffer (and allocate its own buffer header) already allocated - by another component, or by the IL Client. This is a blocking - call. - - The component should return from this call within 20 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [out] ppBuffer - pointer to an OMX_BUFFERHEADERTYPE structure used to receive the - pointer to the buffer header - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp buf - */ - -#define OMX_UseBuffer( \ - hComponent, \ - ppBufferHdr, \ - nPortIndex, \ - pAppPrivate, \ - nSizeBytes, \ - pBuffer) \ - ((OMX_COMPONENTTYPE*)hComponent)->UseBuffer( \ - hComponent, \ - ppBufferHdr, \ - nPortIndex, \ - pAppPrivate, \ - nSizeBytes, \ - pBuffer) - - -/** The OMX_AllocateBuffer macro will request that the component allocate - a new buffer and buffer header. The component will allocate the - buffer and the buffer header and return a pointer to the buffer - header. This is a blocking call. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [out] ppBuffer - pointer to an OMX_BUFFERHEADERTYPE structure used to receive - the pointer to the buffer header - @param [in] nPortIndex - nPortIndex is used to select the port on the component the buffer will - be used with. The port can be found by using the nPortIndex - value as an index into the Port Definition array of the component. - @param [in] pAppPrivate - pAppPrivate is used to initialize the pAppPrivate member of the - buffer header structure. - @param [in] nSizeBytes - size of the buffer to allocate. Used when bAllocateNew is true. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp buf - */ -#define OMX_AllocateBuffer( \ - hComponent, \ - ppBuffer, \ - nPortIndex, \ - pAppPrivate, \ - nSizeBytes) \ - ((OMX_COMPONENTTYPE*)hComponent)->AllocateBuffer( \ - hComponent, \ - ppBuffer, \ - nPortIndex, \ - pAppPrivate, \ - nSizeBytes) /* Macro End */ - - -/** The OMX_FreeBuffer macro will release a buffer header from the component - which was allocated using either OMX_AllocateBuffer or OMX_UseBuffer. If - the component allocated the buffer (see the OMX_UseBuffer macro) then - the component shall free the buffer and buffer header. This is a - blocking call. - - The component should return from this call within 20 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] nPortIndex - nPortIndex is used to select the port on the component the buffer will - be used with. - @param [in] pBuffer - pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer - or AllocateBuffer. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp buf - */ -#define OMX_FreeBuffer( \ - hComponent, \ - nPortIndex, \ - pBuffer) \ - ((OMX_COMPONENTTYPE*)hComponent)->FreeBuffer( \ - hComponent, \ - nPortIndex, \ - pBuffer) /* Macro End */ - - -/** The OMX_EmptyThisBuffer macro will send a buffer full of data to an - input port of a component. The buffer will be emptied by the component - and returned to the application via the EmptyBufferDone call back. - This is a non-blocking call in that the component will record the buffer - and return immediately and then empty the buffer, later, at the proper - time. As expected, this macro may be invoked only while the component - is in the OMX_StateExecuting. If nPortIndex does not specify an input - port, the component shall return an error. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] pBuffer - pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer - or AllocateBuffer. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp buf - */ -#define OMX_EmptyThisBuffer( \ - hComponent, \ - pBuffer) \ - ((OMX_COMPONENTTYPE*)hComponent)->EmptyThisBuffer( \ - hComponent, \ - pBuffer) /* Macro End */ - - -/** The OMX_FillThisBuffer macro will send an empty buffer to an - output port of a component. The buffer will be filled by the component - and returned to the application via the FillBufferDone call back. - This is a non-blocking call in that the component will record the buffer - and return immediately and then fill the buffer, later, at the proper - time. As expected, this macro may be invoked only while the component - is in the OMX_ExecutingState. If nPortIndex does not specify an output - port, the component shall return an error. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] pBuffer - pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer - or AllocateBuffer. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp buf - */ -#define OMX_FillThisBuffer( \ - hComponent, \ - pBuffer) \ - ((OMX_COMPONENTTYPE*)hComponent)->FillThisBuffer( \ - hComponent, \ - pBuffer) /* Macro End */ - - - -/** The OMX_UseEGLImage macro will request that the component use - a EGLImage provided by EGL (and allocate its own buffer header) - This is a blocking call. - - The component should return from this call within 20 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [out] ppBuffer - pointer to an OMX_BUFFERHEADERTYPE structure used to receive the - pointer to the buffer header. Note that the memory location used - for this buffer is NOT visible to the IL Client. - @param [in] nPortIndex - nPortIndex is used to select the port on the component the buffer will - be used with. The port can be found by using the nPortIndex - value as an index into the Port Definition array of the component. - @param [in] pAppPrivate - pAppPrivate is used to initialize the pAppPrivate member of the - buffer header structure. - @param [in] eglImage - eglImage contains the handle of the EGLImage to use as a buffer on the - specified port. The component is expected to validate properties of - the EGLImage against the configuration of the port to ensure the component - can use the EGLImage as a buffer. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp buf - */ -#define OMX_UseEGLImage( \ - hComponent, \ - ppBufferHdr, \ - nPortIndex, \ - pAppPrivate, \ - eglImage) \ - ((OMX_COMPONENTTYPE*)hComponent)->UseEGLImage( \ - hComponent, \ - ppBufferHdr, \ - nPortIndex, \ - pAppPrivate, \ - eglImage) - -/** The OMX_Init method is used to initialize the OMX core. It shall be the - first call made into OMX and it should only be executed one time without - an interviening OMX_Deinit call. - - The core should return from this call within 20 msec. - - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Init(void); - - -/** The OMX_Deinit method is used to deinitialize the OMX core. It shall be - the last call made into OMX. In the event that the core determines that - thare are components loaded when this call is made, the core may return - with an error rather than try to unload the components. - - The core should return from this call within 20 msec. - - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Deinit(void); - - -/** The OMX_ComponentNameEnum method will enumerate through all the names of - recognised valid components in the system. This function is provided - as a means to detect all the components in the system run-time. There is - no strict ordering to the enumeration order of component names, although - each name will only be enumerated once. If the OMX core supports run-time - installation of new components, it is only requried to detect newly - installed components when the first call to enumerate component names - is made (i.e. when nIndex is 0x0). - - The core should return from this call in 20 msec. - - @param [out] cComponentName - pointer to a null terminated string with the component name. The - names of the components are strings less than 127 bytes in length - plus the trailing null for a maximum size of 128 bytes. An example - of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are - assigned by the vendor, but shall start with "OMX." and then have - the Vendor designation next. - @param [in] nNameLength - number of characters in the cComponentName string. With all - component name strings restricted to less than 128 characters - (including the trailing null) it is recomended that the caller - provide a input string for the cComponentName of 128 characters. - @param [in] nIndex - number containing the enumeration index for the component. - Multiple calls to OMX_ComponentNameEnum with increasing values - of nIndex will enumerate through the component names in the - system until OMX_ErrorNoMore is returned. The value of nIndex - is 0 to (N-1), where N is the number of valid installed components - in the system. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. When the value of nIndex exceeds the number of - components in the system minus 1, OMX_ErrorNoMore will be - returned. Otherwise the appropriate OMX error will be returned. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_ComponentNameEnum( - OMX_OUT OMX_STRING cComponentName, - OMX_IN OMX_U32 nNameLength, - OMX_IN OMX_U32 nIndex); - - -/** The OMX_GetHandle method will locate the component specified by the - component name given, load that component into memory and then invoke - the component's methods to create an instance of the component. - - The core should return from this call within 20 msec. - - @param [out] pHandle - pointer to an OMX_HANDLETYPE pointer to be filled in by this method. - @param [in] cComponentName - pointer to a null terminated string with the component name. The - names of the components are strings less than 127 bytes in length - plus the trailing null for a maximum size of 128 bytes. An example - of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are - assigned by the vendor, but shall start with "OMX." and then have - the Vendor designation next. - @param [in] pAppData - pointer to an application defined value that will be returned - during callbacks so that the application can identify the source - of the callback. - @param [in] pCallBacks - pointer to a OMX_CALLBACKTYPE structure that will be passed to the - component to initialize it with. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_GetHandle( - OMX_OUT OMX_HANDLETYPE* pHandle, - OMX_IN OMX_STRING cComponentName, - OMX_IN OMX_PTR pAppData, - OMX_IN OMX_CALLBACKTYPE* pCallBacks); - - -/** The OMX_FreeHandle method will free a handle allocated by the OMX_GetHandle - method. If the component reference count goes to zero, the component will - be unloaded from memory. - - The core should return from this call within 20 msec when the component is - in the OMX_StateLoaded state. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the GetHandle function. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_FreeHandle( - OMX_IN OMX_HANDLETYPE hComponent); - - - -/** The OMX_SetupTunnel method will handle the necessary calls to the components - to setup the specified tunnel the two components. NOTE: This is - an actual method (not a #define macro). This method will make calls into - the component ComponentTunnelRequest method to do the actual tunnel - connection. - - The ComponentTunnelRequest method on both components will be called. - This method shall not be called unless the component is in the - OMX_StateLoaded state except when the ports used for the tunnel are - disabled. In this case, the component may be in the OMX_StateExecuting, - OMX_StatePause, or OMX_StateIdle states. - - The core should return from this call within 20 msec. - - @param [in] hOutput - Handle of the component to be accessed. Also this is the handle - of the component whose port, specified in the nPortOutput parameter - will be used the source for the tunnel. This is the component handle - returned by the call to the OMX_GetHandle function. There is a - requirement that hOutput be the source for the data when - tunelling (i.e. nPortOutput is an output port). If 0x0, the component - specified in hInput will have it's port specified in nPortInput - setup for communication with the application / IL client. - @param [in] nPortOutput - nPortOutput is used to select the source port on component to be - used in the tunnel. - @param [in] hInput - This is the component to setup the tunnel with. This is the handle - of the component whose port, specified in the nPortInput parameter - will be used the destination for the tunnel. This is the component handle - returned by the call to the OMX_GetHandle function. There is a - requirement that hInput be the destination for the data when - tunelling (i.e. nPortInut is an input port). If 0x0, the component - specified in hOutput will have it's port specified in nPortPOutput - setup for communication with the application / IL client. - @param [in] nPortInput - nPortInput is used to select the destination port on component to be - used in the tunnel. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - When OMX_ErrorNotImplemented is returned, one or both components is - a non-interop component and does not support tunneling. - - On failure, the ports of both components are setup for communication - with the application / IL Client. - @ingroup core tun - */ -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_SetupTunnel( - OMX_IN OMX_HANDLETYPE hOutput, - OMX_IN OMX_U32 nPortOutput, - OMX_IN OMX_HANDLETYPE hInput, - OMX_IN OMX_U32 nPortInput); - -/** @ingroup cp */ -OMX_API OMX_ERRORTYPE OMX_GetContentPipe( - OMX_OUT OMX_HANDLETYPE *hPipe, - OMX_IN OMX_STRING szURI); - -/** The OMX_GetComponentsOfRole method will return the number of components that support the given - role and (if the compNames field is non-NULL) the names of those components. The call will fail if - an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the - client should: - * first call this function with the compNames field NULL to determine the number of component names - * second call this function with the compNames field pointing to an array of names allocated - according to the number returned by the first call. - - The core should return from this call within 5 msec. - - @param [in] role - This is generic standard component name consisting only of component class - name and the type within that class (e.g. 'audio_decoder.aac'). - @param [inout] pNumComps - This is used both as input and output. - - If compNames is NULL, the input is ignored and the output specifies how many components support - the given role. - - If compNames is not NULL, on input it bounds the size of the input structure and - on output, it specifies the number of components string names listed within the compNames parameter. - @param [inout] compNames - If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings which accepts - a list of the names of all physical components that implement the specified standard component name. - Each name is NULL terminated. numComps indicates the number of names. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_GetComponentsOfRole ( - OMX_IN OMX_STRING role, - OMX_INOUT OMX_U32 *pNumComps, - OMX_INOUT OMX_U8 **compNames); - -/** The OMX_GetRolesOfComponent method will return the number of roles supported by the given - component and (if the roles field is non-NULL) the names of those roles. The call will fail if - an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the - client should: - * first call this function with the roles field NULL to determine the number of role names - * second call this function with the roles field pointing to an array of names allocated - according to the number returned by the first call. - - The core should return from this call within 5 msec. - - @param [in] compName - This is the name of the component being queried about. - @param [inout] pNumRoles - This is used both as input and output. - - If roles is NULL, the input is ignored and the output specifies how many roles the component supports. - - If compNames is not NULL, on input it bounds the size of the input structure and - on output, it specifies the number of roles string names listed within the roles parameter. - @param [out] roles - If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings - which accepts a list of the names of all standard components roles implemented on the - specified component name. numComps indicates the number of names. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_GetRolesOfComponent ( - OMX_IN OMX_STRING compName, - OMX_INOUT OMX_U32 *pNumRoles, - OMX_OUT OMX_U8 **roles); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ - diff --git a/external/android/include/16/frameworks/native/include/media/openmax/OMX_IVCommon.h b/external/android/include/16/frameworks/native/include/media/openmax/OMX_IVCommon.h deleted file mode 100644 index 8bb4ded..0000000 --- a/external/android/include/16/frameworks/native/include/media/openmax/OMX_IVCommon.h +++ /dev/null @@ -1,947 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/** - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** - * @file OMX_IVCommon.h - OpenMax IL version 1.1.2 - * The structures needed by Video and Image components to exchange - * parameters and configuration data with the components. - */ -#ifndef OMX_IVCommon_h -#define OMX_IVCommon_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/** - * Each OMX header must include all required header files to allow the header - * to compile without errors. The includes below are required for this header - * file to compile successfully - */ - -#include - -/** @defgroup iv OpenMAX IL Imaging and Video Domain - * Common structures for OpenMAX IL Imaging and Video domains - * @{ - */ - - -/** - * Enumeration defining possible uncompressed image/video formats. - * - * ENUMS: - * Unused : Placeholder value when format is N/A - * Monochrome : black and white - * 8bitRGB332 : Red 7:5, Green 4:2, Blue 1:0 - * 12bitRGB444 : Red 11:8, Green 7:4, Blue 3:0 - * 16bitARGB4444 : Alpha 15:12, Red 11:8, Green 7:4, Blue 3:0 - * 16bitARGB1555 : Alpha 15, Red 14:10, Green 9:5, Blue 4:0 - * 16bitRGB565 : Red 15:11, Green 10:5, Blue 4:0 - * 16bitBGR565 : Blue 15:11, Green 10:5, Red 4:0 - * 18bitRGB666 : Red 17:12, Green 11:6, Blue 5:0 - * 18bitARGB1665 : Alpha 17, Red 16:11, Green 10:5, Blue 4:0 - * 19bitARGB1666 : Alpha 18, Red 17:12, Green 11:6, Blue 5:0 - * 24bitRGB888 : Red 24:16, Green 15:8, Blue 7:0 - * 24bitBGR888 : Blue 24:16, Green 15:8, Red 7:0 - * 24bitARGB1887 : Alpha 23, Red 22:15, Green 14:7, Blue 6:0 - * 25bitARGB1888 : Alpha 24, Red 23:16, Green 15:8, Blue 7:0 - * 32bitBGRA8888 : Blue 31:24, Green 23:16, Red 15:8, Alpha 7:0 - * 32bitARGB8888 : Alpha 31:24, Red 23:16, Green 15:8, Blue 7:0 - * YUV411Planar : U,Y are subsampled by a factor of 4 horizontally - * YUV411PackedPlanar : packed per payload in planar slices - * YUV420Planar : Three arrays Y,U,V. - * YUV420PackedPlanar : packed per payload in planar slices - * YUV420SemiPlanar : Two arrays, one is all Y, the other is U and V - * YUV422Planar : Three arrays Y,U,V. - * YUV422PackedPlanar : packed per payload in planar slices - * YUV422SemiPlanar : Two arrays, one is all Y, the other is U and V - * YCbYCr : Organized as 16bit YUYV (i.e. YCbYCr) - * YCrYCb : Organized as 16bit YVYU (i.e. YCrYCb) - * CbYCrY : Organized as 16bit UYVY (i.e. CbYCrY) - * CrYCbY : Organized as 16bit VYUY (i.e. CrYCbY) - * YUV444Interleaved : Each pixel contains equal parts YUV - * RawBayer8bit : SMIA camera output format - * RawBayer10bit : SMIA camera output format - * RawBayer8bitcompressed : SMIA camera output format - */ -typedef enum OMX_COLOR_FORMATTYPE { - OMX_COLOR_FormatUnused, - OMX_COLOR_FormatMonochrome, - OMX_COLOR_Format8bitRGB332, - OMX_COLOR_Format12bitRGB444, - OMX_COLOR_Format16bitARGB4444, - OMX_COLOR_Format16bitARGB1555, - OMX_COLOR_Format16bitRGB565, - OMX_COLOR_Format16bitBGR565, - OMX_COLOR_Format18bitRGB666, - OMX_COLOR_Format18bitARGB1665, - OMX_COLOR_Format19bitARGB1666, - OMX_COLOR_Format24bitRGB888, - OMX_COLOR_Format24bitBGR888, - OMX_COLOR_Format24bitARGB1887, - OMX_COLOR_Format25bitARGB1888, - OMX_COLOR_Format32bitBGRA8888, - OMX_COLOR_Format32bitARGB8888, - OMX_COLOR_FormatYUV411Planar, - OMX_COLOR_FormatYUV411PackedPlanar, - OMX_COLOR_FormatYUV420Planar, - OMX_COLOR_FormatYUV420PackedPlanar, - OMX_COLOR_FormatYUV420SemiPlanar, - OMX_COLOR_FormatYUV422Planar, - OMX_COLOR_FormatYUV422PackedPlanar, - OMX_COLOR_FormatYUV422SemiPlanar, - OMX_COLOR_FormatYCbYCr, - OMX_COLOR_FormatYCrYCb, - OMX_COLOR_FormatCbYCrY, - OMX_COLOR_FormatCrYCbY, - OMX_COLOR_FormatYUV444Interleaved, - OMX_COLOR_FormatRawBayer8bit, - OMX_COLOR_FormatRawBayer10bit, - OMX_COLOR_FormatRawBayer8bitcompressed, - OMX_COLOR_FormatL2, - OMX_COLOR_FormatL4, - OMX_COLOR_FormatL8, - OMX_COLOR_FormatL16, - OMX_COLOR_FormatL24, - OMX_COLOR_FormatL32, - OMX_COLOR_FormatYUV420PackedSemiPlanar, - OMX_COLOR_FormatYUV422PackedSemiPlanar, - OMX_COLOR_Format18BitBGR666, - OMX_COLOR_Format24BitARGB6666, - OMX_COLOR_Format24BitABGR6666, - OMX_COLOR_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_COLOR_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - /** - -/** @defgroup imaging OpenMAX IL Imaging Domain - * @ingroup iv - * Structures for OpenMAX IL Imaging domain - * @{ - */ - -/** - * Enumeration used to define the possible image compression coding. - */ -typedef enum OMX_IMAGE_CODINGTYPE { - OMX_IMAGE_CodingUnused, /**< Value when format is N/A */ - OMX_IMAGE_CodingAutoDetect, /**< Auto detection of image format */ - OMX_IMAGE_CodingJPEG, /**< JPEG/JFIF image format */ - OMX_IMAGE_CodingJPEG2K, /**< JPEG 2000 image format */ - OMX_IMAGE_CodingEXIF, /**< EXIF image format */ - OMX_IMAGE_CodingTIFF, /**< TIFF image format */ - OMX_IMAGE_CodingGIF, /**< Graphics image format */ - OMX_IMAGE_CodingPNG, /**< PNG image format */ - OMX_IMAGE_CodingLZW, /**< LZW image format */ - OMX_IMAGE_CodingBMP, /**< Windows Bitmap format */ - OMX_IMAGE_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_IMAGE_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_IMAGE_CodingMax = 0x7FFFFFFF -} OMX_IMAGE_CODINGTYPE; - - -/** - * Data structure used to define an image path. The number of image paths - * for input and output will vary by type of the image component. - * - * Input (aka Source) : Zero Inputs, one Output, - * Splitter : One Input, 2 or more Outputs, - * Processing Element : One Input, one output, - * Mixer : 2 or more inputs, one output, - * Output (aka Sink) : One Input, zero outputs. - * - * The PortDefinition structure is used to define all of the parameters - * necessary for the compliant component to setup an input or an output - * image path. If additional vendor specific data is required, it should - * be transmitted to the component using the CustomCommand function. - * Compliant components will prepopulate this structure with optimal - * values during the OMX_GetParameter() command. - * - * STRUCT MEMBERS: - * cMIMEType : MIME type of data for the port - * pNativeRender : Platform specific reference for a display if a - * sync, otherwise this field is 0 - * nFrameWidth : Width of frame to be used on port if - * uncompressed format is used. Use 0 for - * unknown, don't care or variable - * nFrameHeight : Height of frame to be used on port if - * uncompressed format is used. Use 0 for - * unknown, don't care or variable - * nStride : Number of bytes per span of an image (i.e. - * indicates the number of bytes to get from - * span N to span N+1, where negative stride - * indicates the image is bottom up - * nSliceHeight : Height used when encoding in slices - * bFlagErrorConcealment : Turns on error concealment if it is supported by - * the OMX component - * eCompressionFormat : Compression format used in this instance of - * the component. When OMX_IMAGE_CodingUnused is - * specified, eColorFormat is valid - * eColorFormat : Decompressed format used by this component - * pNativeWindow : Platform specific reference for a window object if a - * display sink , otherwise this field is 0x0. - */ -typedef struct OMX_IMAGE_PORTDEFINITIONTYPE { - OMX_STRING cMIMEType; - OMX_NATIVE_DEVICETYPE pNativeRender; - OMX_U32 nFrameWidth; - OMX_U32 nFrameHeight; - OMX_S32 nStride; - OMX_U32 nSliceHeight; - OMX_BOOL bFlagErrorConcealment; - OMX_IMAGE_CODINGTYPE eCompressionFormat; - OMX_COLOR_FORMATTYPE eColorFormat; - OMX_NATIVE_WINDOWTYPE pNativeWindow; -} OMX_IMAGE_PORTDEFINITIONTYPE; - - -/** - * Port format parameter. This structure is used to enumerate the various - * data input/output format supported by the port. - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Indicates which port to set - * nIndex : Indicates the enumeration index for the format from - * 0x0 to N-1 - * eCompressionFormat : Compression format used in this instance of the - * component. When OMX_IMAGE_CodingUnused is specified, - * eColorFormat is valid - * eColorFormat : Decompressed format used by this component - */ -typedef struct OMX_IMAGE_PARAM_PORTFORMATTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nIndex; - OMX_IMAGE_CODINGTYPE eCompressionFormat; - OMX_COLOR_FORMATTYPE eColorFormat; -} OMX_IMAGE_PARAM_PORTFORMATTYPE; - - -/** - * Flash control type - * - * ENUMS - * Torch : Flash forced constantly on - */ -typedef enum OMX_IMAGE_FLASHCONTROLTYPE { - OMX_IMAGE_FlashControlOn = 0, - OMX_IMAGE_FlashControlOff, - OMX_IMAGE_FlashControlAuto, - OMX_IMAGE_FlashControlRedEyeReduction, - OMX_IMAGE_FlashControlFillin, - OMX_IMAGE_FlashControlTorch, - OMX_IMAGE_FlashControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_IMAGE_FlashControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_IMAGE_FlashControlMax = 0x7FFFFFFF -} OMX_IMAGE_FLASHCONTROLTYPE; - - -/** - * Flash control configuration - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eFlashControl : Flash control type - */ -typedef struct OMX_IMAGE_PARAM_FLASHCONTROLTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_IMAGE_FLASHCONTROLTYPE eFlashControl; -} OMX_IMAGE_PARAM_FLASHCONTROLTYPE; - - -/** - * Focus control type - */ -typedef enum OMX_IMAGE_FOCUSCONTROLTYPE { - OMX_IMAGE_FocusControlOn = 0, - OMX_IMAGE_FocusControlOff, - OMX_IMAGE_FocusControlAuto, - OMX_IMAGE_FocusControlAutoLock, - OMX_IMAGE_FocusControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_IMAGE_FocusControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_IMAGE_FocusControlMax = 0x7FFFFFFF -} OMX_IMAGE_FOCUSCONTROLTYPE; - - -/** - * Focus control configuration - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eFocusControl : Focus control - * nFocusSteps : Focus can take on values from 0 mm to infinity. - * Interest is only in number of steps over this range. - * nFocusStepIndex : Current focus step index - */ -typedef struct OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_IMAGE_FOCUSCONTROLTYPE eFocusControl; - OMX_U32 nFocusSteps; - OMX_U32 nFocusStepIndex; -} OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE; - - -/** - * Q Factor for JPEG compression, which controls the tradeoff between image - * quality and size. Q Factor provides a more simple means of controlling - * JPEG compression quality, without directly programming Quantization - * tables for chroma and luma - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nQFactor : JPEG Q factor value in the range of 1-100. A factor of 1 - * produces the smallest, worst quality images, and a factor - * of 100 produces the largest, best quality images. A - * typical default is 75 for small good quality images - */ -typedef struct OMX_IMAGE_PARAM_QFACTORTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nQFactor; -} OMX_IMAGE_PARAM_QFACTORTYPE; - -/** - * Quantization table type - */ - -typedef enum OMX_IMAGE_QUANTIZATIONTABLETYPE { - OMX_IMAGE_QuantizationTableLuma = 0, - OMX_IMAGE_QuantizationTableChroma, - OMX_IMAGE_QuantizationTableChromaCb, - OMX_IMAGE_QuantizationTableChromaCr, - OMX_IMAGE_QuantizationTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_IMAGE_QuantizationTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_IMAGE_QuantizationTableMax = 0x7FFFFFFF -} OMX_IMAGE_QUANTIZATIONTABLETYPE; - -/** - * JPEG quantization tables are used to determine DCT compression for - * YUV data, as an alternative to specifying Q factor, providing exact - * control of compression - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eQuantizationTable : Quantization table type - * nQuantizationMatrix[64] : JPEG quantization table of coefficients stored - * in increasing columns then by rows of data (i.e. - * row 1, ... row 8). Quantization values are in - * the range 0-255 and stored in linear order - * (i.e. the component will zig-zag the - * quantization table data if required internally) - */ -typedef struct OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_IMAGE_QUANTIZATIONTABLETYPE eQuantizationTable; - OMX_U8 nQuantizationMatrix[64]; -} OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE; - - -/** - * Huffman table type, the same Huffman table is applied for chroma and - * luma component - */ -typedef enum OMX_IMAGE_HUFFMANTABLETYPE { - OMX_IMAGE_HuffmanTableAC = 0, - OMX_IMAGE_HuffmanTableDC, - OMX_IMAGE_HuffmanTableACLuma, - OMX_IMAGE_HuffmanTableACChroma, - OMX_IMAGE_HuffmanTableDCLuma, - OMX_IMAGE_HuffmanTableDCChroma, - OMX_IMAGE_HuffmanTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_IMAGE_HuffmanTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_IMAGE_HuffmanTableMax = 0x7FFFFFFF -} OMX_IMAGE_HUFFMANTABLETYPE; - -/** - * JPEG Huffman table - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eHuffmanTable : Huffman table type - * nNumberOfHuffmanCodeOfLength[16] : 0-16, number of Huffman codes of each - * possible length - * nHuffmanTable[256] : 0-255, the size used for AC and DC - * HuffmanTable are 16 and 162 - */ -typedef struct OMX_IMAGE_PARAM_HUFFMANTTABLETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_IMAGE_HUFFMANTABLETYPE eHuffmanTable; - OMX_U8 nNumberOfHuffmanCodeOfLength[16]; - OMX_U8 nHuffmanTable[256]; -}OMX_IMAGE_PARAM_HUFFMANTTABLETYPE; - -/** @} */ -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ diff --git a/external/android/include/16/frameworks/native/include/media/openmax/OMX_Index.h b/external/android/include/16/frameworks/native/include/media/openmax/OMX_Index.h deleted file mode 100644 index be9a1a6..0000000 --- a/external/android/include/16/frameworks/native/include/media/openmax/OMX_Index.h +++ /dev/null @@ -1,276 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** @file OMX_Index.h - OpenMax IL version 1.1.2 - * The OMX_Index header file contains the definitions for both applications - * and components . - */ - - -#ifndef OMX_Index_h -#define OMX_Index_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/* Each OMX header must include all required header files to allow the - * header to compile without errors. The includes below are required - * for this header file to compile successfully - */ -#include - - -/** The OMX_INDEXTYPE enumeration is used to select a structure when either - * getting or setting parameters and/or configuration data. Each entry in - * this enumeration maps to an OMX specified structure. When the - * OMX_GetParameter, OMX_SetParameter, OMX_GetConfig or OMX_SetConfig methods - * are used, the second parameter will always be an entry from this enumeration - * and the third entry will be the structure shown in the comments for the entry. - * For example, if the application is initializing a cropping function, the - * OMX_SetConfig command would have OMX_IndexConfigCommonInputCrop as the second parameter - * and would send a pointer to an initialized OMX_RECTTYPE structure as the - * third parameter. - * - * The enumeration entries named with the OMX_Config prefix are sent using - * the OMX_SetConfig command and the enumeration entries named with the - * OMX_PARAM_ prefix are sent using the OMX_SetParameter command. - */ -typedef enum OMX_INDEXTYPE { - - OMX_IndexComponentStartUnused = 0x01000000, - OMX_IndexParamPriorityMgmt, /**< reference: OMX_PRIORITYMGMTTYPE */ - OMX_IndexParamAudioInit, /**< reference: OMX_PORT_PARAM_TYPE */ - OMX_IndexParamImageInit, /**< reference: OMX_PORT_PARAM_TYPE */ - OMX_IndexParamVideoInit, /**< reference: OMX_PORT_PARAM_TYPE */ - OMX_IndexParamOtherInit, /**< reference: OMX_PORT_PARAM_TYPE */ - OMX_IndexParamNumAvailableStreams, /**< reference: OMX_PARAM_U32TYPE */ - OMX_IndexParamActiveStream, /**< reference: OMX_PARAM_U32TYPE */ - OMX_IndexParamSuspensionPolicy, /**< reference: OMX_PARAM_SUSPENSIONPOLICYTYPE */ - OMX_IndexParamComponentSuspended, /**< reference: OMX_PARAM_SUSPENSIONTYPE */ - OMX_IndexConfigCapturing, /**< reference: OMX_CONFIG_BOOLEANTYPE */ - OMX_IndexConfigCaptureMode, /**< reference: OMX_CONFIG_CAPTUREMODETYPE */ - OMX_IndexAutoPauseAfterCapture, /**< reference: OMX_CONFIG_BOOLEANTYPE */ - OMX_IndexParamContentURI, /**< reference: OMX_PARAM_CONTENTURITYPE */ - OMX_IndexParamCustomContentPipe, /**< reference: OMX_PARAM_CONTENTPIPETYPE */ - OMX_IndexParamDisableResourceConcealment, /**< reference: OMX_RESOURCECONCEALMENTTYPE */ - OMX_IndexConfigMetadataItemCount, /**< reference: OMX_CONFIG_METADATAITEMCOUNTTYPE */ - OMX_IndexConfigContainerNodeCount, /**< reference: OMX_CONFIG_CONTAINERNODECOUNTTYPE */ - OMX_IndexConfigMetadataItem, /**< reference: OMX_CONFIG_METADATAITEMTYPE */ - OMX_IndexConfigCounterNodeID, /**< reference: OMX_CONFIG_CONTAINERNODEIDTYPE */ - OMX_IndexParamMetadataFilterType, /**< reference: OMX_PARAM_METADATAFILTERTYPE */ - OMX_IndexParamMetadataKeyFilter, /**< reference: OMX_PARAM_METADATAFILTERTYPE */ - OMX_IndexConfigPriorityMgmt, /**< reference: OMX_PRIORITYMGMTTYPE */ - OMX_IndexParamStandardComponentRole, /**< reference: OMX_PARAM_COMPONENTROLETYPE */ - - OMX_IndexPortStartUnused = 0x02000000, - OMX_IndexParamPortDefinition, /**< reference: OMX_PARAM_PORTDEFINITIONTYPE */ - OMX_IndexParamCompBufferSupplier, /**< reference: OMX_PARAM_BUFFERSUPPLIERTYPE */ - OMX_IndexReservedStartUnused = 0x03000000, - - /* Audio parameters and configurations */ - OMX_IndexAudioStartUnused = 0x04000000, - OMX_IndexParamAudioPortFormat, /**< reference: OMX_AUDIO_PARAM_PORTFORMATTYPE */ - OMX_IndexParamAudioPcm, /**< reference: OMX_AUDIO_PARAM_PCMMODETYPE */ - OMX_IndexParamAudioAac, /**< reference: OMX_AUDIO_PARAM_AACPROFILETYPE */ - OMX_IndexParamAudioRa, /**< reference: OMX_AUDIO_PARAM_RATYPE */ - OMX_IndexParamAudioMp3, /**< reference: OMX_AUDIO_PARAM_MP3TYPE */ - OMX_IndexParamAudioAdpcm, /**< reference: OMX_AUDIO_PARAM_ADPCMTYPE */ - OMX_IndexParamAudioG723, /**< reference: OMX_AUDIO_PARAM_G723TYPE */ - OMX_IndexParamAudioG729, /**< reference: OMX_AUDIO_PARAM_G729TYPE */ - OMX_IndexParamAudioAmr, /**< reference: OMX_AUDIO_PARAM_AMRTYPE */ - OMX_IndexParamAudioWma, /**< reference: OMX_AUDIO_PARAM_WMATYPE */ - OMX_IndexParamAudioSbc, /**< reference: OMX_AUDIO_PARAM_SBCTYPE */ - OMX_IndexParamAudioMidi, /**< reference: OMX_AUDIO_PARAM_MIDITYPE */ - OMX_IndexParamAudioGsm_FR, /**< reference: OMX_AUDIO_PARAM_GSMFRTYPE */ - OMX_IndexParamAudioMidiLoadUserSound, /**< reference: OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE */ - OMX_IndexParamAudioG726, /**< reference: OMX_AUDIO_PARAM_G726TYPE */ - OMX_IndexParamAudioGsm_EFR, /**< reference: OMX_AUDIO_PARAM_GSMEFRTYPE */ - OMX_IndexParamAudioGsm_HR, /**< reference: OMX_AUDIO_PARAM_GSMHRTYPE */ - OMX_IndexParamAudioPdc_FR, /**< reference: OMX_AUDIO_PARAM_PDCFRTYPE */ - OMX_IndexParamAudioPdc_EFR, /**< reference: OMX_AUDIO_PARAM_PDCEFRTYPE */ - OMX_IndexParamAudioPdc_HR, /**< reference: OMX_AUDIO_PARAM_PDCHRTYPE */ - OMX_IndexParamAudioTdma_FR, /**< reference: OMX_AUDIO_PARAM_TDMAFRTYPE */ - OMX_IndexParamAudioTdma_EFR, /**< reference: OMX_AUDIO_PARAM_TDMAEFRTYPE */ - OMX_IndexParamAudioQcelp8, /**< reference: OMX_AUDIO_PARAM_QCELP8TYPE */ - OMX_IndexParamAudioQcelp13, /**< reference: OMX_AUDIO_PARAM_QCELP13TYPE */ - OMX_IndexParamAudioEvrc, /**< reference: OMX_AUDIO_PARAM_EVRCTYPE */ - OMX_IndexParamAudioSmv, /**< reference: OMX_AUDIO_PARAM_SMVTYPE */ - OMX_IndexParamAudioVorbis, /**< reference: OMX_AUDIO_PARAM_VORBISTYPE */ - OMX_IndexParamAudioFlac, /**< reference: OMX_AUDIO_PARAM_FLACTYPE */ - - OMX_IndexConfigAudioMidiImmediateEvent, /**< reference: OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE */ - OMX_IndexConfigAudioMidiControl, /**< reference: OMX_AUDIO_CONFIG_MIDICONTROLTYPE */ - OMX_IndexConfigAudioMidiSoundBankProgram, /**< reference: OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE */ - OMX_IndexConfigAudioMidiStatus, /**< reference: OMX_AUDIO_CONFIG_MIDISTATUSTYPE */ - OMX_IndexConfigAudioMidiMetaEvent, /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE */ - OMX_IndexConfigAudioMidiMetaEventData, /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE */ - OMX_IndexConfigAudioVolume, /**< reference: OMX_AUDIO_CONFIG_VOLUMETYPE */ - OMX_IndexConfigAudioBalance, /**< reference: OMX_AUDIO_CONFIG_BALANCETYPE */ - OMX_IndexConfigAudioChannelMute, /**< reference: OMX_AUDIO_CONFIG_CHANNELMUTETYPE */ - OMX_IndexConfigAudioMute, /**< reference: OMX_AUDIO_CONFIG_MUTETYPE */ - OMX_IndexConfigAudioLoudness, /**< reference: OMX_AUDIO_CONFIG_LOUDNESSTYPE */ - OMX_IndexConfigAudioEchoCancelation, /**< reference: OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE */ - OMX_IndexConfigAudioNoiseReduction, /**< reference: OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE */ - OMX_IndexConfigAudioBass, /**< reference: OMX_AUDIO_CONFIG_BASSTYPE */ - OMX_IndexConfigAudioTreble, /**< reference: OMX_AUDIO_CONFIG_TREBLETYPE */ - OMX_IndexConfigAudioStereoWidening, /**< reference: OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE */ - OMX_IndexConfigAudioChorus, /**< reference: OMX_AUDIO_CONFIG_CHORUSTYPE */ - OMX_IndexConfigAudioEqualizer, /**< reference: OMX_AUDIO_CONFIG_EQUALIZERTYPE */ - OMX_IndexConfigAudioReverberation, /**< reference: OMX_AUDIO_CONFIG_REVERBERATIONTYPE */ - OMX_IndexConfigAudioChannelVolume, /**< reference: OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE */ - - /* Image specific parameters and configurations */ - OMX_IndexImageStartUnused = 0x05000000, - OMX_IndexParamImagePortFormat, /**< reference: OMX_IMAGE_PARAM_PORTFORMATTYPE */ - OMX_IndexParamFlashControl, /**< reference: OMX_IMAGE_PARAM_FLASHCONTROLTYPE */ - OMX_IndexConfigFocusControl, /**< reference: OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE */ - OMX_IndexParamQFactor, /**< reference: OMX_IMAGE_PARAM_QFACTORTYPE */ - OMX_IndexParamQuantizationTable, /**< reference: OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE */ - OMX_IndexParamHuffmanTable, /**< reference: OMX_IMAGE_PARAM_HUFFMANTTABLETYPE */ - OMX_IndexConfigFlashControl, /**< reference: OMX_IMAGE_PARAM_FLASHCONTROLTYPE */ - - /* Video specific parameters and configurations */ - OMX_IndexVideoStartUnused = 0x06000000, - OMX_IndexParamVideoPortFormat, /**< reference: OMX_VIDEO_PARAM_PORTFORMATTYPE */ - OMX_IndexParamVideoQuantization, /**< reference: OMX_VIDEO_PARAM_QUANTIZATIONTYPE */ - OMX_IndexParamVideoFastUpdate, /**< reference: OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE */ - OMX_IndexParamVideoBitrate, /**< reference: OMX_VIDEO_PARAM_BITRATETYPE */ - OMX_IndexParamVideoMotionVector, /**< reference: OMX_VIDEO_PARAM_MOTIONVECTORTYPE */ - OMX_IndexParamVideoIntraRefresh, /**< reference: OMX_VIDEO_PARAM_INTRAREFRESHTYPE */ - OMX_IndexParamVideoErrorCorrection, /**< reference: OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE */ - OMX_IndexParamVideoVBSMC, /**< reference: OMX_VIDEO_PARAM_VBSMCTYPE */ - OMX_IndexParamVideoMpeg2, /**< reference: OMX_VIDEO_PARAM_MPEG2TYPE */ - OMX_IndexParamVideoMpeg4, /**< reference: OMX_VIDEO_PARAM_MPEG4TYPE */ - OMX_IndexParamVideoWmv, /**< reference: OMX_VIDEO_PARAM_WMVTYPE */ - OMX_IndexParamVideoRv, /**< reference: OMX_VIDEO_PARAM_RVTYPE */ - OMX_IndexParamVideoAvc, /**< reference: OMX_VIDEO_PARAM_AVCTYPE */ - OMX_IndexParamVideoH263, /**< reference: OMX_VIDEO_PARAM_H263TYPE */ - OMX_IndexParamVideoProfileLevelQuerySupported, /**< reference: OMX_VIDEO_PARAM_PROFILELEVELTYPE */ - OMX_IndexParamVideoProfileLevelCurrent, /**< reference: OMX_VIDEO_PARAM_PROFILELEVELTYPE */ - OMX_IndexConfigVideoBitrate, /**< reference: OMX_VIDEO_CONFIG_BITRATETYPE */ - OMX_IndexConfigVideoFramerate, /**< reference: OMX_CONFIG_FRAMERATETYPE */ - OMX_IndexConfigVideoIntraVOPRefresh, /**< reference: OMX_CONFIG_INTRAREFRESHVOPTYPE */ - OMX_IndexConfigVideoIntraMBRefresh, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */ - OMX_IndexConfigVideoMBErrorReporting, /**< reference: OMX_CONFIG_MBERRORREPORTINGTYPE */ - OMX_IndexParamVideoMacroblocksPerFrame, /**< reference: OMX_PARAM_MACROBLOCKSTYPE */ - OMX_IndexConfigVideoMacroBlockErrorMap, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */ - OMX_IndexParamVideoSliceFMO, /**< reference: OMX_VIDEO_PARAM_AVCSLICEFMO */ - OMX_IndexConfigVideoAVCIntraPeriod, /**< reference: OMX_VIDEO_CONFIG_AVCINTRAPERIOD */ - OMX_IndexConfigVideoNalSize, /**< reference: OMX_VIDEO_CONFIG_NALSIZE */ - - /* Image & Video common Configurations */ - OMX_IndexCommonStartUnused = 0x07000000, - OMX_IndexParamCommonDeblocking, /**< reference: OMX_PARAM_DEBLOCKINGTYPE */ - OMX_IndexParamCommonSensorMode, /**< reference: OMX_PARAM_SENSORMODETYPE */ - OMX_IndexParamCommonInterleave, /**< reference: OMX_PARAM_INTERLEAVETYPE */ - OMX_IndexConfigCommonColorFormatConversion, /**< reference: OMX_CONFIG_COLORCONVERSIONTYPE */ - OMX_IndexConfigCommonScale, /**< reference: OMX_CONFIG_SCALEFACTORTYPE */ - OMX_IndexConfigCommonImageFilter, /**< reference: OMX_CONFIG_IMAGEFILTERTYPE */ - OMX_IndexConfigCommonColorEnhancement, /**< reference: OMX_CONFIG_COLORENHANCEMENTTYPE */ - OMX_IndexConfigCommonColorKey, /**< reference: OMX_CONFIG_COLORKEYTYPE */ - OMX_IndexConfigCommonColorBlend, /**< reference: OMX_CONFIG_COLORBLENDTYPE */ - OMX_IndexConfigCommonFrameStabilisation,/**< reference: OMX_CONFIG_FRAMESTABTYPE */ - OMX_IndexConfigCommonRotate, /**< reference: OMX_CONFIG_ROTATIONTYPE */ - OMX_IndexConfigCommonMirror, /**< reference: OMX_CONFIG_MIRRORTYPE */ - OMX_IndexConfigCommonOutputPosition, /**< reference: OMX_CONFIG_POINTTYPE */ - OMX_IndexConfigCommonInputCrop, /**< reference: OMX_CONFIG_RECTTYPE */ - OMX_IndexConfigCommonOutputCrop, /**< reference: OMX_CONFIG_RECTTYPE */ - OMX_IndexConfigCommonDigitalZoom, /**< reference: OMX_CONFIG_SCALEFACTORTYPE */ - OMX_IndexConfigCommonOpticalZoom, /**< reference: OMX_CONFIG_SCALEFACTORTYPE*/ - OMX_IndexConfigCommonWhiteBalance, /**< reference: OMX_CONFIG_WHITEBALCONTROLTYPE */ - OMX_IndexConfigCommonExposure, /**< reference: OMX_CONFIG_EXPOSURECONTROLTYPE */ - OMX_IndexConfigCommonContrast, /**< reference: OMX_CONFIG_CONTRASTTYPE */ - OMX_IndexConfigCommonBrightness, /**< reference: OMX_CONFIG_BRIGHTNESSTYPE */ - OMX_IndexConfigCommonBacklight, /**< reference: OMX_CONFIG_BACKLIGHTTYPE */ - OMX_IndexConfigCommonGamma, /**< reference: OMX_CONFIG_GAMMATYPE */ - OMX_IndexConfigCommonSaturation, /**< reference: OMX_CONFIG_SATURATIONTYPE */ - OMX_IndexConfigCommonLightness, /**< reference: OMX_CONFIG_LIGHTNESSTYPE */ - OMX_IndexConfigCommonExclusionRect, /**< reference: OMX_CONFIG_RECTTYPE */ - OMX_IndexConfigCommonDithering, /**< reference: OMX_CONFIG_DITHERTYPE */ - OMX_IndexConfigCommonPlaneBlend, /**< reference: OMX_CONFIG_PLANEBLENDTYPE */ - OMX_IndexConfigCommonExposureValue, /**< reference: OMX_CONFIG_EXPOSUREVALUETYPE */ - OMX_IndexConfigCommonOutputSize, /**< reference: OMX_FRAMESIZETYPE */ - OMX_IndexParamCommonExtraQuantData, /**< reference: OMX_OTHER_EXTRADATATYPE */ - OMX_IndexConfigCommonFocusRegion, /**< reference: OMX_CONFIG_FOCUSREGIONTYPE */ - OMX_IndexConfigCommonFocusStatus, /**< reference: OMX_PARAM_FOCUSSTATUSTYPE */ - OMX_IndexConfigCommonTransitionEffect, /**< reference: OMX_CONFIG_TRANSITIONEFFECTTYPE */ - - /* Reserved Configuration range */ - OMX_IndexOtherStartUnused = 0x08000000, - OMX_IndexParamOtherPortFormat, /**< reference: OMX_OTHER_PARAM_PORTFORMATTYPE */ - OMX_IndexConfigOtherPower, /**< reference: OMX_OTHER_CONFIG_POWERTYPE */ - OMX_IndexConfigOtherStats, /**< reference: OMX_OTHER_CONFIG_STATSTYPE */ - - - /* Reserved Time range */ - OMX_IndexTimeStartUnused = 0x09000000, - OMX_IndexConfigTimeScale, /**< reference: OMX_TIME_CONFIG_SCALETYPE */ - OMX_IndexConfigTimeClockState, /**< reference: OMX_TIME_CONFIG_CLOCKSTATETYPE */ - OMX_IndexConfigTimeActiveRefClock, /**< reference: OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE */ - OMX_IndexConfigTimeCurrentMediaTime, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only) */ - OMX_IndexConfigTimeCurrentWallTime, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only) */ - OMX_IndexConfigTimeCurrentAudioReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */ - OMX_IndexConfigTimeCurrentVideoReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */ - OMX_IndexConfigTimeMediaTimeRequest, /**< reference: OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE (write only) */ - OMX_IndexConfigTimeClientStartTime, /** - - -/** - * Enumeration of possible data types which match to multiple domains or no - * domain at all. For types which are vendor specific, a value above - * OMX_OTHER_VENDORTSTART should be used. - */ -typedef enum OMX_OTHER_FORMATTYPE { - OMX_OTHER_FormatTime = 0, /**< Transmission of various timestamps, elapsed time, - time deltas, etc */ - OMX_OTHER_FormatPower, /**< Perhaps used for enabling/disabling power - management, setting clocks? */ - OMX_OTHER_FormatStats, /**< Could be things such as frame rate, frames - dropped, etc */ - OMX_OTHER_FormatBinary, /**< Arbitrary binary data */ - OMX_OTHER_FormatVendorReserved = 1000, /**< Starting value for vendor specific - formats */ - - OMX_OTHER_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_OTHER_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_OTHER_FormatMax = 0x7FFFFFFF -} OMX_OTHER_FORMATTYPE; - -/** - * Enumeration of seek modes. - */ -typedef enum OMX_TIME_SEEKMODETYPE { - OMX_TIME_SeekModeFast = 0, /**< Prefer seeking to an approximation - * of the requested seek position over - * the actual seek position if it - * results in a faster seek. */ - OMX_TIME_SeekModeAccurate, /**< Prefer seeking to the actual seek - * position over an approximation - * of the requested seek position even - * if it results in a slower seek. */ - OMX_TIME_SeekModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_TIME_SeekModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_TIME_SeekModeMax = 0x7FFFFFFF -} OMX_TIME_SEEKMODETYPE; - -/* Structure representing the seekmode of the component */ -typedef struct OMX_TIME_CONFIG_SEEKMODETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_TIME_SEEKMODETYPE eType; /**< The seek mode */ -} OMX_TIME_CONFIG_SEEKMODETYPE; - -/** Structure representing a time stamp used with the following configs - * on the Clock Component (CC): - * - * OMX_IndexConfigTimeCurrentWallTime: query of the CC’s current wall - * time - * OMX_IndexConfigTimeCurrentMediaTime: query of the CC’s current media - * time - * OMX_IndexConfigTimeCurrentAudioReference and - * OMX_IndexConfigTimeCurrentVideoReference: audio/video reference - * clock sending SC its reference time - * OMX_IndexConfigTimeClientStartTime: a Clock Component client sends - * this structure to the Clock Component via a SetConfig on its - * client port when it receives a buffer with - * OMX_BUFFERFLAG_STARTTIME set. It must use the timestamp - * specified by that buffer for nStartTimestamp. - * - * It’s also used with the following config on components in general: - * - * OMX_IndexConfigTimePosition: IL client querying component position - * (GetConfig) or commanding a component to seek to the given location - * (SetConfig) - */ -typedef struct OMX_TIME_CONFIG_TIMESTAMPTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version - * information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_TICKS nTimestamp; /**< timestamp .*/ -} OMX_TIME_CONFIG_TIMESTAMPTYPE; - -/** Enumeration of possible reference clocks to the media time. */ -typedef enum OMX_TIME_UPDATETYPE { - OMX_TIME_UpdateRequestFulfillment, /**< Update is the fulfillment of a media time request. */ - OMX_TIME_UpdateScaleChanged, /**< Update was generated because the scale chagned. */ - OMX_TIME_UpdateClockStateChanged, /**< Update was generated because the clock state changed. */ - OMX_TIME_UpdateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_TIME_UpdateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_TIME_UpdateMax = 0x7FFFFFFF -} OMX_TIME_UPDATETYPE; - -/** Enumeration of possible reference clocks to the media time. */ -typedef enum OMX_TIME_REFCLOCKTYPE { - OMX_TIME_RefClockNone, /**< Use no references. */ - OMX_TIME_RefClockAudio, /**< Use references sent through OMX_IndexConfigTimeCurrentAudioReference */ - OMX_TIME_RefClockVideo, /**< Use references sent through OMX_IndexConfigTimeCurrentVideoReference */ - OMX_TIME_RefClockKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_TIME_RefClockVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_TIME_RefClockMax = 0x7FFFFFFF -} OMX_TIME_REFCLOCKTYPE; - -/** Enumeration of clock states. */ -typedef enum OMX_TIME_CLOCKSTATE { - OMX_TIME_ClockStateRunning, /**< Clock running. */ - OMX_TIME_ClockStateWaitingForStartTime, /**< Clock waiting until the - * prescribed clients emit their - * start time. */ - OMX_TIME_ClockStateStopped, /**< Clock stopped. */ - OMX_TIME_ClockStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_TIME_ClockStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_TIME_ClockStateMax = 0x7FFFFFFF -} OMX_TIME_CLOCKSTATE; - -/** Structure representing a media time request to the clock component. - * - * A client component sends this structure to the Clock Component via a SetConfig - * on its client port to specify a media timestamp the Clock Component - * should emit. The Clock Component should fulfill the request by sending a - * OMX_TIME_MEDIATIMETYPE when its media clock matches the requested - * timestamp. - * - * The client may require a media time request be fulfilled slightly - * earlier than the media time specified. In this case the client specifies - * an offset which is equal to the difference between wall time corresponding - * to the requested media time and the wall time when it will be - * fulfilled. - * - * A client component may uses these requests and the OMX_TIME_MEDIATIMETYPE to - * time events according to timestamps. If a client must perform an operation O at - * a time T (e.g. deliver a video frame at its corresponding timestamp), it makes a - * media time request at T (perhaps specifying an offset to ensure the request fulfillment - * is a little early). When the clock component passes the resulting OMX_TIME_MEDIATIMETYPE - * structure back to the client component, the client may perform operation O (perhaps having - * to wait a slight amount more time itself as specified by the return values). - */ - -typedef struct OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_PTR pClientPrivate; /**< Client private data to disabiguate this media time - * from others (e.g. the number of the frame to deliver). - * Duplicated in the media time structure that fulfills - * this request. A value of zero is reserved for time scale - * updates. */ - OMX_TICKS nMediaTimestamp; /**< Media timestamp requested.*/ - OMX_TICKS nOffset; /**< Amount of wall clock time by which this - * request should be fulfilled early */ -} OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE; - -/**< Structure sent from the clock component client either when fulfilling - * a media time request or when the time scale has changed. - * - * In the former case the Clock Component fills this structure and times its emission - * to a client component (via the client port) according to the corresponding media - * time request sent by the client. The Clock Component should time the emission to occur - * when the requested timestamp matches the Clock Component's media time but also the - * prescribed offset early. - * - * Upon scale changes the clock component clears the nClientPrivate data, sends the current - * media time and sets the nScale to the new scale via the client port. It emits a - * OMX_TIME_MEDIATIMETYPE to all clients independent of any requests. This allows clients to - * alter processing to accomodate scaling. For instance a video component might skip inter-frames - * in the case of extreme fastforward. Likewise an audio component might add or remove samples - * from an audio frame to scale audio data. - * - * It is expected that some clock components may not be able to fulfill requests - * at exactly the prescribed time. This is acceptable so long as the request is - * fulfilled at least as early as described and not later. This structure provides - * fields the client may use to wait for the remaining time. - * - * The client may use either the nOffset or nWallTimeAtMedia fields to determine the - * wall time until the nMediaTimestamp actually occurs. In the latter case the - * client can get a more accurate value for offset by getting the current wall - * from the cloc component and subtracting it from nWallTimeAtMedia. - */ - -typedef struct OMX_TIME_MEDIATIMETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nClientPrivate; /**< Client private data to disabiguate this media time - * from others. Copied from the media time request. - * A value of zero is reserved for time scale updates. */ - OMX_TIME_UPDATETYPE eUpdateType; /**< Reason for the update */ - OMX_TICKS nMediaTimestamp; /**< Media time requested. If no media time was - * requested then this is the current media time. */ - OMX_TICKS nOffset; /**< Amount of wall clock time by which this - * request was actually fulfilled early */ - - OMX_TICKS nWallTimeAtMediaTime; /**< Wall time corresponding to nMediaTimeStamp. - * A client may compare this value to current - * media time obtained from the Clock Component to determine - * the wall time until the media timestamp is really - * current. */ - OMX_S32 xScale; /**< Current media time scale in Q16 format. */ - OMX_TIME_CLOCKSTATE eState; /* Seeking Change. Added 7/12.*/ - /**< State of the media time. */ -} OMX_TIME_MEDIATIMETYPE; - -/** Structure representing the current media time scale factor. Applicable only to clock - * component, other components see scale changes via OMX_TIME_MEDIATIMETYPE buffers sent via - * the clock component client ports. Upon recieving this config the clock component changes - * the rate by which the media time increases or decreases effectively implementing trick modes. - */ -typedef struct OMX_TIME_CONFIG_SCALETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_S32 xScale; /**< This is a value in Q16 format which is used for - * scaling the media time */ -} OMX_TIME_CONFIG_SCALETYPE; - -/** Bits used to identify a clock port. Used in OMX_TIME_CONFIG_CLOCKSTATETYPE’s nWaitMask field */ -#define OMX_CLOCKPORT0 0x00000001 -#define OMX_CLOCKPORT1 0x00000002 -#define OMX_CLOCKPORT2 0x00000004 -#define OMX_CLOCKPORT3 0x00000008 -#define OMX_CLOCKPORT4 0x00000010 -#define OMX_CLOCKPORT5 0x00000020 -#define OMX_CLOCKPORT6 0x00000040 -#define OMX_CLOCKPORT7 0x00000080 - -/** Structure representing the current mode of the media clock. - * IL Client uses this config to change or query the mode of the - * media clock of the clock component. Applicable only to clock - * component. - * - * On a SetConfig if eState is OMX_TIME_ClockStateRunning media time - * starts immediately at the prescribed start time. If - * OMX_TIME_ClockStateWaitingForStartTime the Clock Component ignores - * the given nStartTime and waits for all clients specified in the - * nWaitMask to send starttimes (via - * OMX_IndexConfigTimeClientStartTime). The Clock Component then starts - * the media clock using the earliest start time supplied. */ -typedef struct OMX_TIME_CONFIG_CLOCKSTATETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version - * information */ - OMX_TIME_CLOCKSTATE eState; /**< State of the media time. */ - OMX_TICKS nStartTime; /**< Start time of the media time. */ - OMX_TICKS nOffset; /**< Time to offset the media time by - * (e.g. preroll). Media time will be - * reported to be nOffset ticks earlier. - */ - OMX_U32 nWaitMask; /**< Mask of OMX_CLOCKPORT values. */ -} OMX_TIME_CONFIG_CLOCKSTATETYPE; - -/** Structure representing the reference clock currently being used to - * compute media time. IL client uses this config to change or query the - * clock component's active reference clock */ -typedef struct OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_TIME_REFCLOCKTYPE eClock; /**< Reference clock used to compute media time */ -} OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE; - -/** Descriptor for setting specifics of power type. - * Note: this structure is listed for backwards compatibility. */ -typedef struct OMX_OTHER_CONFIG_POWERTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_BOOL bEnablePM; /**< Flag to enable Power Management */ -} OMX_OTHER_CONFIG_POWERTYPE; - - -/** Descriptor for setting specifics of stats type. - * Note: this structure is listed for backwards compatibility. */ -typedef struct OMX_OTHER_CONFIG_STATSTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - /* what goes here */ -} OMX_OTHER_CONFIG_STATSTYPE; - - -/** - * The PortDefinition structure is used to define all of the parameters - * necessary for the compliant component to setup an input or an output other - * path. - */ -typedef struct OMX_OTHER_PORTDEFINITIONTYPE { - OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */ -} OMX_OTHER_PORTDEFINITIONTYPE; - -/** Port format parameter. This structure is used to enumerate - * the various data input/output format supported by the port. - */ -typedef struct OMX_OTHER_PARAM_PORTFORMATTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Indicates which port to set */ - OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */ - OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */ -} OMX_OTHER_PARAM_PORTFORMATTYPE; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ diff --git a/external/android/include/16/frameworks/native/include/media/openmax/OMX_Types.h b/external/android/include/16/frameworks/native/include/media/openmax/OMX_Types.h deleted file mode 100644 index 03fd4bc..0000000 --- a/external/android/include/16/frameworks/native/include/media/openmax/OMX_Types.h +++ /dev/null @@ -1,365 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** OMX_Types.h - OpenMax IL version 1.1.2 - * The OMX_Types header file contains the primitive type definitions used by - * the core, the application and the component. This file may need to be - * modified to be used on systems that do not have "char" set to 8 bits, - * "short" set to 16 bits and "long" set to 32 bits. - */ - -#ifndef OMX_Types_h -#define OMX_Types_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/** The OMX_API and OMX_APIENTRY are platform specific definitions used - * to declare OMX function prototypes. They are modified to meet the - * requirements for a particular platform */ -#ifdef __SYMBIAN32__ -# ifdef __OMX_EXPORTS -# define OMX_API __declspec(dllexport) -# else -# ifdef _WIN32 -# define OMX_API __declspec(dllexport) -# else -# define OMX_API __declspec(dllimport) -# endif -# endif -#else -# ifdef _WIN32 -# ifdef __OMX_EXPORTS -# define OMX_API __declspec(dllexport) -# else -//# define OMX_API __declspec(dllimport) -#define OMX_API -# endif -# else -# ifdef __OMX_EXPORTS -# define OMX_API -# else -# define OMX_API extern -# endif -# endif -#endif - -#ifndef OMX_APIENTRY -#define OMX_APIENTRY -#endif - -/** OMX_IN is used to identify inputs to an OMX function. This designation - will also be used in the case of a pointer that points to a parameter - that is used as an output. */ -#ifndef OMX_IN -#define OMX_IN -#endif - -/** OMX_OUT is used to identify outputs from an OMX function. This - designation will also be used in the case of a pointer that points - to a parameter that is used as an input. */ -#ifndef OMX_OUT -#define OMX_OUT -#endif - - -/** OMX_INOUT is used to identify parameters that may be either inputs or - outputs from an OMX function at the same time. This designation will - also be used in the case of a pointer that points to a parameter that - is used both as an input and an output. */ -#ifndef OMX_INOUT -#define OMX_INOUT -#endif - -/** OMX_ALL is used to as a wildcard to select all entities of the same type - * when specifying the index, or referring to a object by an index. (i.e. - * use OMX_ALL to indicate all N channels). When used as a port index - * for a config or parameter this OMX_ALL denotes that the config or - * parameter applies to the entire component not just one port. */ -#define OMX_ALL 0xFFFFFFFF - -/** In the following we define groups that help building doxygen documentation */ - -/** @defgroup core OpenMAX IL core - * Functions and structure related to the OMX IL core - */ - - /** @defgroup comp OpenMAX IL component - * Functions and structure related to the OMX IL component - */ - -/** @defgroup rpm Resource and Policy Management - * Structures for resource and policy management of components - */ - -/** @defgroup buf Buffer Management - * Buffer handling functions and structures - */ - -/** @defgroup tun Tunneling - * @ingroup core comp - * Structures and functions to manage tunnels among component ports - */ - -/** @defgroup cp Content Pipes - * @ingroup core - */ - - /** @defgroup metadata Metadata handling - * - */ - -/** OMX_U8 is an 8 bit unsigned quantity that is byte aligned */ -typedef unsigned char OMX_U8; - -/** OMX_S8 is an 8 bit signed quantity that is byte aligned */ -typedef signed char OMX_S8; - -/** OMX_U16 is a 16 bit unsigned quantity that is 16 bit word aligned */ -typedef unsigned short OMX_U16; - -/** OMX_S16 is a 16 bit signed quantity that is 16 bit word aligned */ -typedef signed short OMX_S16; - -/** OMX_U32 is a 32 bit unsigned quantity that is 32 bit word aligned */ -typedef unsigned long OMX_U32; - -/** OMX_S32 is a 32 bit signed quantity that is 32 bit word aligned */ -typedef signed long OMX_S32; - - -/* Users with compilers that cannot accept the "long long" designation should - define the OMX_SKIP64BIT macro. It should be noted that this may cause - some components to fail to compile if the component was written to require - 64 bit integral types. However, these components would NOT compile anyway - since the compiler does not support the way the component was written. -*/ -#ifndef OMX_SKIP64BIT -#ifdef __SYMBIAN32__ -/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */ -typedef unsigned long long OMX_U64; - -/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */ -typedef signed long long OMX_S64; - -#elif defined(WIN32) - -/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */ -typedef unsigned __int64 OMX_U64; - -/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */ -typedef signed __int64 OMX_S64; - -#else /* WIN32 */ - -/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */ -typedef unsigned long long OMX_U64; - -/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */ -typedef signed long long OMX_S64; - -#endif /* WIN32 */ -#endif - - -/** The OMX_BOOL type is intended to be used to represent a true or a false - value when passing parameters to and from the OMX core and components. The - OMX_BOOL is a 32 bit quantity and is aligned on a 32 bit word boundary. - */ -typedef enum OMX_BOOL { - OMX_FALSE = 0, - OMX_TRUE = !OMX_FALSE, - OMX_BOOL_MAX = 0x7FFFFFFF -} OMX_BOOL; - -/** The OMX_PTR type is intended to be used to pass pointers between the OMX - applications and the OMX Core and components. This is a 32 bit pointer and - is aligned on a 32 bit boundary. - */ -typedef void* OMX_PTR; - -/** The OMX_STRING type is intended to be used to pass "C" type strings between - the application and the core and component. The OMX_STRING type is a 32 - bit pointer to a zero terminated string. The pointer is word aligned and - the string is byte aligned. - */ -typedef char* OMX_STRING; - -/** The OMX_BYTE type is intended to be used to pass arrays of bytes such as - buffers between the application and the component and core. The OMX_BYTE - type is a 32 bit pointer to a zero terminated string. The pointer is word - aligned and the string is byte aligned. - */ -typedef unsigned char* OMX_BYTE; - -/** OMX_UUIDTYPE is a very long unique identifier to uniquely identify - at runtime. This identifier should be generated by a component in a way - that guarantees that every instance of the identifier running on the system - is unique. */ -typedef unsigned char OMX_UUIDTYPE[128]; - -/** The OMX_DIRTYPE enumeration is used to indicate if a port is an input or - an output port. This enumeration is common across all component types. - */ -typedef enum OMX_DIRTYPE -{ - OMX_DirInput, /**< Port is an input port */ - OMX_DirOutput, /**< Port is an output port */ - OMX_DirMax = 0x7FFFFFFF -} OMX_DIRTYPE; - -/** The OMX_ENDIANTYPE enumeration is used to indicate the bit ordering - for numerical data (i.e. big endian, or little endian). - */ -typedef enum OMX_ENDIANTYPE -{ - OMX_EndianBig, /**< big endian */ - OMX_EndianLittle, /**< little endian */ - OMX_EndianMax = 0x7FFFFFFF -} OMX_ENDIANTYPE; - - -/** The OMX_NUMERICALDATATYPE enumeration is used to indicate if data - is signed or unsigned - */ -typedef enum OMX_NUMERICALDATATYPE -{ - OMX_NumericalDataSigned, /**< signed data */ - OMX_NumericalDataUnsigned, /**< unsigned data */ - OMX_NumercialDataMax = 0x7FFFFFFF -} OMX_NUMERICALDATATYPE; - - -/** Unsigned bounded value type */ -typedef struct OMX_BU32 { - OMX_U32 nValue; /**< actual value */ - OMX_U32 nMin; /**< minimum for value (i.e. nValue >= nMin) */ - OMX_U32 nMax; /**< maximum for value (i.e. nValue <= nMax) */ -} OMX_BU32; - - -/** Signed bounded value type */ -typedef struct OMX_BS32 { - OMX_S32 nValue; /**< actual value */ - OMX_S32 nMin; /**< minimum for value (i.e. nValue >= nMin) */ - OMX_S32 nMax; /**< maximum for value (i.e. nValue <= nMax) */ -} OMX_BS32; - - -/** Structure representing some time or duration in microseconds. This structure - * must be interpreted as a signed 64 bit value. The quantity is signed to accommodate - * negative deltas and preroll scenarios. The quantity is represented in microseconds - * to accomodate high resolution timestamps (e.g. DVD presentation timestamps based - * on a 90kHz clock) and to allow more accurate and synchronized delivery (e.g. - * individual audio samples delivered at 192 kHz). The quantity is 64 bit to - * accommodate a large dynamic range (signed 32 bit values would allow only for plus - * or minus 35 minutes). - * - * Implementations with limited precision may convert the signed 64 bit value to - * a signed 32 bit value internally but risk loss of precision. - */ -#ifndef OMX_SKIP64BIT -typedef OMX_S64 OMX_TICKS; -#else -typedef struct OMX_TICKS -{ - OMX_U32 nLowPart; /** low bits of the signed 64 bit tick value */ - OMX_U32 nHighPart; /** high bits of the signed 64 bit tick value */ -} OMX_TICKS; -#endif -#define OMX_TICKS_PER_SECOND 1000000 - -/** Define the public interface for the OMX Handle. The core will not use - this value internally, but the application should only use this value. - */ -typedef void* OMX_HANDLETYPE; - -typedef struct OMX_MARKTYPE -{ - OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will - generate a mark event upon - processing the mark. */ - OMX_PTR pMarkData; /**< Application specific data associated with - the mark sent on a mark event to disambiguate - this mark from others. */ -} OMX_MARKTYPE; - - -/** OMX_NATIVE_DEVICETYPE is used to map a OMX video port to the - * platform & operating specific object used to reference the display - * or can be used by a audio port for native audio rendering */ -typedef void* OMX_NATIVE_DEVICETYPE; - -/** OMX_NATIVE_WINDOWTYPE is used to map a OMX video port to the - * platform & operating specific object used to reference the window */ -typedef void* OMX_NATIVE_WINDOWTYPE; - -/** The OMX_VERSIONTYPE union is used to specify the version for - a structure or component. For a component, the version is entirely - specified by the component vendor. Components doing the same function - from different vendors may or may not have the same version. For - structures, the version shall be set by the entity that allocates the - structure. For structures specified in the OMX 1.1 specification, the - value of the version shall be set to 1.1.0.0 in all cases. Access to the - OMX_VERSIONTYPE can be by a single 32 bit access (e.g. by nVersion) or - by accessing one of the structure elements to, for example, check only - the Major revision. - */ -typedef union OMX_VERSIONTYPE -{ - struct - { - OMX_U8 nVersionMajor; /**< Major version accessor element */ - OMX_U8 nVersionMinor; /**< Minor version accessor element */ - OMX_U8 nRevision; /**< Revision version accessor element */ - OMX_U8 nStep; /**< Step version accessor element */ - } s; - OMX_U32 nVersion; /**< 32 bit value to make accessing the - version easily done in a single word - size copy/compare operation */ -} OMX_VERSIONTYPE; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ diff --git a/external/android/include/16/frameworks/native/include/media/openmax/OMX_Video.h b/external/android/include/16/frameworks/native/include/media/openmax/OMX_Video.h deleted file mode 100644 index 4f8485d..0000000 --- a/external/android/include/16/frameworks/native/include/media/openmax/OMX_Video.h +++ /dev/null @@ -1,1078 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/** - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** - * @file OMX_Video.h - OpenMax IL version 1.1.2 - * The structures is needed by Video components to exchange parameters - * and configuration data with OMX components. - */ -#ifndef OMX_Video_h -#define OMX_Video_h - -/** @defgroup video OpenMAX IL Video Domain - * @ingroup iv - * Structures for OpenMAX IL Video domain - * @{ - */ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/** - * Each OMX header must include all required header files to allow the - * header to compile without errors. The includes below are required - * for this header file to compile successfully - */ - -#include - - -/** - * Enumeration used to define the possible video compression codings. - * NOTE: This essentially refers to file extensions. If the coding is - * being used to specify the ENCODE type, then additional work - * must be done to configure the exact flavor of the compression - * to be used. For decode cases where the user application can - * not differentiate between MPEG-4 and H.264 bit streams, it is - * up to the codec to handle this. - */ -typedef enum OMX_VIDEO_CODINGTYPE { - OMX_VIDEO_CodingUnused, /**< Value when coding is N/A */ - OMX_VIDEO_CodingAutoDetect, /**< Autodetection of coding type */ - OMX_VIDEO_CodingMPEG2, /**< AKA: H.262 */ - OMX_VIDEO_CodingH263, /**< H.263 */ - OMX_VIDEO_CodingMPEG4, /**< MPEG-4 */ - OMX_VIDEO_CodingWMV, /**< all versions of Windows Media Video */ - OMX_VIDEO_CodingRV, /**< all versions of Real Video */ - OMX_VIDEO_CodingAVC, /**< H.264/AVC */ - OMX_VIDEO_CodingMJPEG, /**< Motion JPEG */ - OMX_VIDEO_CodingVPX, /**< Google VPX, formerly known as On2 VP8 */ - OMX_VIDEO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_CodingMax = 0x7FFFFFFF -} OMX_VIDEO_CODINGTYPE; - - -/** - * Data structure used to define a video path. The number of Video paths for - * input and output will vary by type of the Video component. - * - * Input (aka Source) : zero Inputs, one Output, - * Splitter : one Input, 2 or more Outputs, - * Processing Element : one Input, one output, - * Mixer : 2 or more inputs, one output, - * Output (aka Sink) : one Input, zero outputs. - * - * The PortDefinition structure is used to define all of the parameters - * necessary for the compliant component to setup an input or an output video - * path. If additional vendor specific data is required, it should be - * transmitted to the component using the CustomCommand function. Compliant - * components will prepopulate this structure with optimal values during the - * GetDefaultInitParams command. - * - * STRUCT MEMBERS: - * cMIMEType : MIME type of data for the port - * pNativeRender : Platform specific reference for a display if a - * sync, otherwise this field is 0 - * nFrameWidth : Width of frame to be used on channel if - * uncompressed format is used. Use 0 for unknown, - * don't care or variable - * nFrameHeight : Height of frame to be used on channel if - * uncompressed format is used. Use 0 for unknown, - * don't care or variable - * nStride : Number of bytes per span of an image - * (i.e. indicates the number of bytes to get - * from span N to span N+1, where negative stride - * indicates the image is bottom up - * nSliceHeight : Height used when encoding in slices - * nBitrate : Bit rate of frame to be used on channel if - * compressed format is used. Use 0 for unknown, - * don't care or variable - * xFramerate : Frame rate to be used on channel if uncompressed - * format is used. Use 0 for unknown, don't care or - * variable. Units are Q16 frames per second. - * bFlagErrorConcealment : Turns on error concealment if it is supported by - * the OMX component - * eCompressionFormat : Compression format used in this instance of the - * component. When OMX_VIDEO_CodingUnused is - * specified, eColorFormat is used - * eColorFormat : Decompressed format used by this component - * pNativeWindow : Platform specific reference for a window object if a - * display sink , otherwise this field is 0x0. - */ -typedef struct OMX_VIDEO_PORTDEFINITIONTYPE { - OMX_STRING cMIMEType; - OMX_NATIVE_DEVICETYPE pNativeRender; - OMX_U32 nFrameWidth; - OMX_U32 nFrameHeight; - OMX_S32 nStride; - OMX_U32 nSliceHeight; - OMX_U32 nBitrate; - OMX_U32 xFramerate; - OMX_BOOL bFlagErrorConcealment; - OMX_VIDEO_CODINGTYPE eCompressionFormat; - OMX_COLOR_FORMATTYPE eColorFormat; - OMX_NATIVE_WINDOWTYPE pNativeWindow; -} OMX_VIDEO_PORTDEFINITIONTYPE; - -/** - * Port format parameter. This structure is used to enumerate the various - * data input/output format supported by the port. - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Indicates which port to set - * nIndex : Indicates the enumeration index for the format from - * 0x0 to N-1 - * eCompressionFormat : Compression format used in this instance of the - * component. When OMX_VIDEO_CodingUnused is specified, - * eColorFormat is used - * eColorFormat : Decompressed format used by this component - * xFrameRate : Indicates the video frame rate in Q16 format - */ -typedef struct OMX_VIDEO_PARAM_PORTFORMATTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nIndex; - OMX_VIDEO_CODINGTYPE eCompressionFormat; - OMX_COLOR_FORMATTYPE eColorFormat; - OMX_U32 xFramerate; -} OMX_VIDEO_PARAM_PORTFORMATTYPE; - - -/** - * This is a structure for configuring video compression quantization - * parameter values. Codecs may support different QP values for different - * frame types. - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version info - * nPortIndex : Port that this structure applies to - * nQpI : QP value to use for index frames - * nQpP : QP value to use for P frames - * nQpB : QP values to use for bidirectional frames - */ -typedef struct OMX_VIDEO_PARAM_QUANTIZATIONTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nQpI; - OMX_U32 nQpP; - OMX_U32 nQpB; -} OMX_VIDEO_PARAM_QUANTIZATIONTYPE; - - -/** - * Structure for configuration of video fast update parameters. - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version info - * nPortIndex : Port that this structure applies to - * bEnableVFU : Enable/Disable video fast update - * nFirstGOB : Specifies the number of the first macroblock row - * nFirstMB : specifies the first MB relative to the specified first GOB - * nNumMBs : Specifies the number of MBs to be refreshed from nFirstGOB - * and nFirstMB - */ -typedef struct OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL bEnableVFU; - OMX_U32 nFirstGOB; - OMX_U32 nFirstMB; - OMX_U32 nNumMBs; -} OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE; - - -/** - * Enumeration of possible bitrate control types - */ -typedef enum OMX_VIDEO_CONTROLRATETYPE { - OMX_Video_ControlRateDisable, - OMX_Video_ControlRateVariable, - OMX_Video_ControlRateConstant, - OMX_Video_ControlRateVariableSkipFrames, - OMX_Video_ControlRateConstantSkipFrames, - OMX_Video_ControlRateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_Video_ControlRateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_Video_ControlRateMax = 0x7FFFFFFF -} OMX_VIDEO_CONTROLRATETYPE; - - -/** - * Structure for configuring bitrate mode of a codec. - * - * STRUCT MEMBERS: - * nSize : Size of the struct in bytes - * nVersion : OMX spec version info - * nPortIndex : Port that this struct applies to - * eControlRate : Control rate type enum - * nTargetBitrate : Target bitrate to encode with - */ -typedef struct OMX_VIDEO_PARAM_BITRATETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_VIDEO_CONTROLRATETYPE eControlRate; - OMX_U32 nTargetBitrate; -} OMX_VIDEO_PARAM_BITRATETYPE; - - -/** - * Enumeration of possible motion vector (MV) types - */ -typedef enum OMX_VIDEO_MOTIONVECTORTYPE { - OMX_Video_MotionVectorPixel, - OMX_Video_MotionVectorHalfPel, - OMX_Video_MotionVectorQuarterPel, - OMX_Video_MotionVectorEighthPel, - OMX_Video_MotionVectorKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_Video_MotionVectorVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_Video_MotionVectorMax = 0x7FFFFFFF -} OMX_VIDEO_MOTIONVECTORTYPE; - - -/** - * Structure for configuring the number of motion vectors used as well - * as their accuracy. - * - * STRUCT MEMBERS: - * nSize : Size of the struct in bytes - * nVersion : OMX spec version info - * nPortIndex : port that this structure applies to - * eAccuracy : Enumerated MV accuracy - * bUnrestrictedMVs : Allow unrestricted MVs - * bFourMV : Allow use of 4 MVs - * sXSearchRange : Search range in horizontal direction for MVs - * sYSearchRange : Search range in vertical direction for MVs - */ -typedef struct OMX_VIDEO_PARAM_MOTIONVECTORTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_VIDEO_MOTIONVECTORTYPE eAccuracy; - OMX_BOOL bUnrestrictedMVs; - OMX_BOOL bFourMV; - OMX_S32 sXSearchRange; - OMX_S32 sYSearchRange; -} OMX_VIDEO_PARAM_MOTIONVECTORTYPE; - - -/** - * Enumeration of possible methods to use for Intra Refresh - */ -typedef enum OMX_VIDEO_INTRAREFRESHTYPE { - OMX_VIDEO_IntraRefreshCyclic, - OMX_VIDEO_IntraRefreshAdaptive, - OMX_VIDEO_IntraRefreshBoth, - OMX_VIDEO_IntraRefreshKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_IntraRefreshVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_IntraRefreshMax = 0x7FFFFFFF -} OMX_VIDEO_INTRAREFRESHTYPE; - - -/** - * Structure for configuring intra refresh mode - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eRefreshMode : Cyclic, Adaptive, or Both - * nAirMBs : Number of intra macroblocks to refresh in a frame when - * AIR is enabled - * nAirRef : Number of times a motion marked macroblock has to be - * intra coded - * nCirMBs : Number of consecutive macroblocks to be coded as "intra" - * when CIR is enabled - */ -typedef struct OMX_VIDEO_PARAM_INTRAREFRESHTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_VIDEO_INTRAREFRESHTYPE eRefreshMode; - OMX_U32 nAirMBs; - OMX_U32 nAirRef; - OMX_U32 nCirMBs; -} OMX_VIDEO_PARAM_INTRAREFRESHTYPE; - - -/** - * Structure for enabling various error correction methods for video - * compression. - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * bEnableHEC : Enable/disable header extension codes (HEC) - * bEnableResync : Enable/disable resynchronization markers - * nResynchMarkerSpacing : Resynch markers interval (in bits) to be - * applied in the stream - * bEnableDataPartitioning : Enable/disable data partitioning - * bEnableRVLC : Enable/disable reversible variable length - * coding - */ -typedef struct OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL bEnableHEC; - OMX_BOOL bEnableResync; - OMX_U32 nResynchMarkerSpacing; - OMX_BOOL bEnableDataPartitioning; - OMX_BOOL bEnableRVLC; -} OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE; - - -/** - * Configuration of variable block-size motion compensation (VBSMC) - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * b16x16 : Enable inter block search 16x16 - * b16x8 : Enable inter block search 16x8 - * b8x16 : Enable inter block search 8x16 - * b8x8 : Enable inter block search 8x8 - * b8x4 : Enable inter block search 8x4 - * b4x8 : Enable inter block search 4x8 - * b4x4 : Enable inter block search 4x4 - */ -typedef struct OMX_VIDEO_PARAM_VBSMCTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL b16x16; - OMX_BOOL b16x8; - OMX_BOOL b8x16; - OMX_BOOL b8x8; - OMX_BOOL b8x4; - OMX_BOOL b4x8; - OMX_BOOL b4x4; -} OMX_VIDEO_PARAM_VBSMCTYPE; - - -/** - * H.263 profile types, each profile indicates support for various - * performance bounds and different annexes. - * - * ENUMS: - * Baseline : Baseline Profile: H.263 (V1), no optional modes - * H320 Coding : H.320 Coding Efficiency Backward Compatibility - * Profile: H.263+ (V2), includes annexes I, J, L.4 - * and T - * BackwardCompatible : Backward Compatibility Profile: H.263 (V1), - * includes annex F - * ISWV2 : Interactive Streaming Wireless Profile: H.263+ - * (V2), includes annexes I, J, K and T - * ISWV3 : Interactive Streaming Wireless Profile: H.263++ - * (V3), includes profile 3 and annexes V and W.6.3.8 - * HighCompression : Conversational High Compression Profile: H.263++ - * (V3), includes profiles 1 & 2 and annexes D and U - * Internet : Conversational Internet Profile: H.263++ (V3), - * includes profile 5 and annex K - * Interlace : Conversational Interlace Profile: H.263++ (V3), - * includes profile 5 and annex W.6.3.11 - * HighLatency : High Latency Profile: H.263++ (V3), includes - * profile 6 and annexes O.1 and P.5 - */ -typedef enum OMX_VIDEO_H263PROFILETYPE { - OMX_VIDEO_H263ProfileBaseline = 0x01, - OMX_VIDEO_H263ProfileH320Coding = 0x02, - OMX_VIDEO_H263ProfileBackwardCompatible = 0x04, - OMX_VIDEO_H263ProfileISWV2 = 0x08, - OMX_VIDEO_H263ProfileISWV3 = 0x10, - OMX_VIDEO_H263ProfileHighCompression = 0x20, - OMX_VIDEO_H263ProfileInternet = 0x40, - OMX_VIDEO_H263ProfileInterlace = 0x80, - OMX_VIDEO_H263ProfileHighLatency = 0x100, - OMX_VIDEO_H263ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_H263ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_H263ProfileMax = 0x7FFFFFFF -} OMX_VIDEO_H263PROFILETYPE; - - -/** - * H.263 level types, each level indicates support for various frame sizes, - * bit rates, decoder frame rates. - */ -typedef enum OMX_VIDEO_H263LEVELTYPE { - OMX_VIDEO_H263Level10 = 0x01, - OMX_VIDEO_H263Level20 = 0x02, - OMX_VIDEO_H263Level30 = 0x04, - OMX_VIDEO_H263Level40 = 0x08, - OMX_VIDEO_H263Level45 = 0x10, - OMX_VIDEO_H263Level50 = 0x20, - OMX_VIDEO_H263Level60 = 0x40, - OMX_VIDEO_H263Level70 = 0x80, - OMX_VIDEO_H263LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_H263LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_H263LevelMax = 0x7FFFFFFF -} OMX_VIDEO_H263LEVELTYPE; - - -/** - * Specifies the picture type. These values should be OR'd to signal all - * pictures types which are allowed. - * - * ENUMS: - * Generic Picture Types: I, P and B - * H.263 Specific Picture Types: SI and SP - * H.264 Specific Picture Types: EI and EP - * MPEG-4 Specific Picture Types: S - */ -typedef enum OMX_VIDEO_PICTURETYPE { - OMX_VIDEO_PictureTypeI = 0x01, - OMX_VIDEO_PictureTypeP = 0x02, - OMX_VIDEO_PictureTypeB = 0x04, - OMX_VIDEO_PictureTypeSI = 0x08, - OMX_VIDEO_PictureTypeSP = 0x10, - OMX_VIDEO_PictureTypeEI = 0x11, - OMX_VIDEO_PictureTypeEP = 0x12, - OMX_VIDEO_PictureTypeS = 0x14, - OMX_VIDEO_PictureTypeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_PictureTypeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_PictureTypeMax = 0x7FFFFFFF -} OMX_VIDEO_PICTURETYPE; - - -/** - * H.263 Params - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nPFrames : Number of P frames between each I frame - * nBFrames : Number of B frames between each I frame - * eProfile : H.263 profile(s) to use - * eLevel : H.263 level(s) to use - * bPLUSPTYPEAllowed : Indicating that it is allowed to use PLUSPTYPE - * (specified in the 1998 version of H.263) to - * indicate custom picture sizes or clock - * frequencies - * nAllowedPictureTypes : Specifies the picture types allowed in the - * bitstream - * bForceRoundingTypeToZero : value of the RTYPE bit (bit 6 of MPPTYPE) is - * not constrained. It is recommended to change - * the value of the RTYPE bit for each reference - * picture in error-free communication - * nPictureHeaderRepetition : Specifies the frequency of picture header - * repetition - * nGOBHeaderInterval : Specifies the interval of non-empty GOB - * headers in units of GOBs - */ -typedef struct OMX_VIDEO_PARAM_H263TYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nPFrames; - OMX_U32 nBFrames; - OMX_VIDEO_H263PROFILETYPE eProfile; - OMX_VIDEO_H263LEVELTYPE eLevel; - OMX_BOOL bPLUSPTYPEAllowed; - OMX_U32 nAllowedPictureTypes; - OMX_BOOL bForceRoundingTypeToZero; - OMX_U32 nPictureHeaderRepetition; - OMX_U32 nGOBHeaderInterval; -} OMX_VIDEO_PARAM_H263TYPE; - - -/** - * MPEG-2 profile types, each profile indicates support for various - * performance bounds and different annexes. - */ -typedef enum OMX_VIDEO_MPEG2PROFILETYPE { - OMX_VIDEO_MPEG2ProfileSimple = 0, /**< Simple Profile */ - OMX_VIDEO_MPEG2ProfileMain, /**< Main Profile */ - OMX_VIDEO_MPEG2Profile422, /**< 4:2:2 Profile */ - OMX_VIDEO_MPEG2ProfileSNR, /**< SNR Profile */ - OMX_VIDEO_MPEG2ProfileSpatial, /**< Spatial Profile */ - OMX_VIDEO_MPEG2ProfileHigh, /**< High Profile */ - OMX_VIDEO_MPEG2ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_MPEG2ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_MPEG2ProfileMax = 0x7FFFFFFF -} OMX_VIDEO_MPEG2PROFILETYPE; - - -/** - * MPEG-2 level types, each level indicates support for various frame - * sizes, bit rates, decoder frame rates. No need - */ -typedef enum OMX_VIDEO_MPEG2LEVELTYPE { - OMX_VIDEO_MPEG2LevelLL = 0, /**< Low Level */ - OMX_VIDEO_MPEG2LevelML, /**< Main Level */ - OMX_VIDEO_MPEG2LevelH14, /**< High 1440 */ - OMX_VIDEO_MPEG2LevelHL, /**< High Level */ - OMX_VIDEO_MPEG2LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_MPEG2LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_MPEG2LevelMax = 0x7FFFFFFF -} OMX_VIDEO_MPEG2LEVELTYPE; - - -/** - * MPEG-2 params - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nPFrames : Number of P frames between each I frame - * nBFrames : Number of B frames between each I frame - * eProfile : MPEG-2 profile(s) to use - * eLevel : MPEG-2 levels(s) to use - */ -typedef struct OMX_VIDEO_PARAM_MPEG2TYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nPFrames; - OMX_U32 nBFrames; - OMX_VIDEO_MPEG2PROFILETYPE eProfile; - OMX_VIDEO_MPEG2LEVELTYPE eLevel; -} OMX_VIDEO_PARAM_MPEG2TYPE; - - -/** - * MPEG-4 profile types, each profile indicates support for various - * performance bounds and different annexes. - * - * ENUMS: - * - Simple Profile, Levels 1-3 - * - Simple Scalable Profile, Levels 1-2 - * - Core Profile, Levels 1-2 - * - Main Profile, Levels 2-4 - * - N-bit Profile, Level 2 - * - Scalable Texture Profile, Level 1 - * - Simple Face Animation Profile, Levels 1-2 - * - Simple Face and Body Animation (FBA) Profile, Levels 1-2 - * - Basic Animated Texture Profile, Levels 1-2 - * - Hybrid Profile, Levels 1-2 - * - Advanced Real Time Simple Profiles, Levels 1-4 - * - Core Scalable Profile, Levels 1-3 - * - Advanced Coding Efficiency Profile, Levels 1-4 - * - Advanced Core Profile, Levels 1-2 - * - Advanced Scalable Texture, Levels 2-3 - */ -typedef enum OMX_VIDEO_MPEG4PROFILETYPE { - OMX_VIDEO_MPEG4ProfileSimple = 0x01, - OMX_VIDEO_MPEG4ProfileSimpleScalable = 0x02, - OMX_VIDEO_MPEG4ProfileCore = 0x04, - OMX_VIDEO_MPEG4ProfileMain = 0x08, - OMX_VIDEO_MPEG4ProfileNbit = 0x10, - OMX_VIDEO_MPEG4ProfileScalableTexture = 0x20, - OMX_VIDEO_MPEG4ProfileSimpleFace = 0x40, - OMX_VIDEO_MPEG4ProfileSimpleFBA = 0x80, - OMX_VIDEO_MPEG4ProfileBasicAnimated = 0x100, - OMX_VIDEO_MPEG4ProfileHybrid = 0x200, - OMX_VIDEO_MPEG4ProfileAdvancedRealTime = 0x400, - OMX_VIDEO_MPEG4ProfileCoreScalable = 0x800, - OMX_VIDEO_MPEG4ProfileAdvancedCoding = 0x1000, - OMX_VIDEO_MPEG4ProfileAdvancedCore = 0x2000, - OMX_VIDEO_MPEG4ProfileAdvancedScalable = 0x4000, - OMX_VIDEO_MPEG4ProfileAdvancedSimple = 0x8000, - OMX_VIDEO_MPEG4ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_MPEG4ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_MPEG4ProfileMax = 0x7FFFFFFF -} OMX_VIDEO_MPEG4PROFILETYPE; - - -/** - * MPEG-4 level types, each level indicates support for various frame - * sizes, bit rates, decoder frame rates. No need - */ -typedef enum OMX_VIDEO_MPEG4LEVELTYPE { - OMX_VIDEO_MPEG4Level0 = 0x01, /**< Level 0 */ - OMX_VIDEO_MPEG4Level0b = 0x02, /**< Level 0b */ - OMX_VIDEO_MPEG4Level1 = 0x04, /**< Level 1 */ - OMX_VIDEO_MPEG4Level2 = 0x08, /**< Level 2 */ - OMX_VIDEO_MPEG4Level3 = 0x10, /**< Level 3 */ - OMX_VIDEO_MPEG4Level4 = 0x20, /**< Level 4 */ - OMX_VIDEO_MPEG4Level4a = 0x40, /**< Level 4a */ - OMX_VIDEO_MPEG4Level5 = 0x80, /**< Level 5 */ - OMX_VIDEO_MPEG4LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_MPEG4LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_MPEG4LevelMax = 0x7FFFFFFF -} OMX_VIDEO_MPEG4LEVELTYPE; - - -/** - * MPEG-4 configuration. This structure handles configuration options - * which are specific to MPEG4 algorithms - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nSliceHeaderSpacing : Number of macroblocks between slice header (H263+ - * Annex K). Put zero if not used - * bSVH : Enable Short Video Header mode - * bGov : Flag to enable GOV - * nPFrames : Number of P frames between each I frame (also called - * GOV period) - * nBFrames : Number of B frames between each I frame - * nIDCVLCThreshold : Value of intra DC VLC threshold - * bACPred : Flag to use ac prediction - * nMaxPacketSize : Maximum size of packet in bytes. - * nTimeIncRes : Used to pass VOP time increment resolution for MPEG4. - * Interpreted as described in MPEG4 standard. - * eProfile : MPEG-4 profile(s) to use. - * eLevel : MPEG-4 level(s) to use. - * nAllowedPictureTypes : Specifies the picture types allowed in the bitstream - * nHeaderExtension : Specifies the number of consecutive video packet - * headers within a VOP - * bReversibleVLC : Specifies whether reversible variable length coding - * is in use - */ -typedef struct OMX_VIDEO_PARAM_MPEG4TYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nSliceHeaderSpacing; - OMX_BOOL bSVH; - OMX_BOOL bGov; - OMX_U32 nPFrames; - OMX_U32 nBFrames; - OMX_U32 nIDCVLCThreshold; - OMX_BOOL bACPred; - OMX_U32 nMaxPacketSize; - OMX_U32 nTimeIncRes; - OMX_VIDEO_MPEG4PROFILETYPE eProfile; - OMX_VIDEO_MPEG4LEVELTYPE eLevel; - OMX_U32 nAllowedPictureTypes; - OMX_U32 nHeaderExtension; - OMX_BOOL bReversibleVLC; -} OMX_VIDEO_PARAM_MPEG4TYPE; - - -/** - * WMV Versions - */ -typedef enum OMX_VIDEO_WMVFORMATTYPE { - OMX_VIDEO_WMVFormatUnused = 0x01, /**< Format unused or unknown */ - OMX_VIDEO_WMVFormat7 = 0x02, /**< Windows Media Video format 7 */ - OMX_VIDEO_WMVFormat8 = 0x04, /**< Windows Media Video format 8 */ - OMX_VIDEO_WMVFormat9 = 0x08, /**< Windows Media Video format 9 */ - OMX_VIDEO_WMFFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_WMFFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_WMVFormatMax = 0x7FFFFFFF -} OMX_VIDEO_WMVFORMATTYPE; - - -/** - * WMV Params - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eFormat : Version of WMV stream / data - */ -typedef struct OMX_VIDEO_PARAM_WMVTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_VIDEO_WMVFORMATTYPE eFormat; -} OMX_VIDEO_PARAM_WMVTYPE; - - -/** - * Real Video Version - */ -typedef enum OMX_VIDEO_RVFORMATTYPE { - OMX_VIDEO_RVFormatUnused = 0, /**< Format unused or unknown */ - OMX_VIDEO_RVFormat8, /**< Real Video format 8 */ - OMX_VIDEO_RVFormat9, /**< Real Video format 9 */ - OMX_VIDEO_RVFormatG2, /**< Real Video Format G2 */ - OMX_VIDEO_RVFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_RVFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_RVFormatMax = 0x7FFFFFFF -} OMX_VIDEO_RVFORMATTYPE; - - -/** - * Real Video Params - * - * STUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eFormat : Version of RV stream / data - * nBitsPerPixel : Bits per pixel coded in the frame - * nPaddedWidth : Padded width in pixel of a video frame - * nPaddedHeight : Padded Height in pixels of a video frame - * nFrameRate : Rate of video in frames per second - * nBitstreamFlags : Flags which internal information about the bitstream - * nBitstreamVersion : Bitstream version - * nMaxEncodeFrameSize: Max encoded frame size - * bEnablePostFilter : Turn on/off post filter - * bEnableTemporalInterpolation : Turn on/off temporal interpolation - * bEnableLatencyMode : When enabled, the decoder does not display a decoded - * frame until it has detected that no enhancement layer - * frames or dependent B frames will be coming. This - * detection usually occurs when a subsequent non-B - * frame is encountered - */ -typedef struct OMX_VIDEO_PARAM_RVTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_VIDEO_RVFORMATTYPE eFormat; - OMX_U16 nBitsPerPixel; - OMX_U16 nPaddedWidth; - OMX_U16 nPaddedHeight; - OMX_U32 nFrameRate; - OMX_U32 nBitstreamFlags; - OMX_U32 nBitstreamVersion; - OMX_U32 nMaxEncodeFrameSize; - OMX_BOOL bEnablePostFilter; - OMX_BOOL bEnableTemporalInterpolation; - OMX_BOOL bEnableLatencyMode; -} OMX_VIDEO_PARAM_RVTYPE; - - -/** - * AVC profile types, each profile indicates support for various - * performance bounds and different annexes. - */ -typedef enum OMX_VIDEO_AVCPROFILETYPE { - OMX_VIDEO_AVCProfileBaseline = 0x01, /**< Baseline profile */ - OMX_VIDEO_AVCProfileMain = 0x02, /**< Main profile */ - OMX_VIDEO_AVCProfileExtended = 0x04, /**< Extended profile */ - OMX_VIDEO_AVCProfileHigh = 0x08, /**< High profile */ - OMX_VIDEO_AVCProfileHigh10 = 0x10, /**< High 10 profile */ - OMX_VIDEO_AVCProfileHigh422 = 0x20, /**< High 4:2:2 profile */ - OMX_VIDEO_AVCProfileHigh444 = 0x40, /**< High 4:4:4 profile */ - OMX_VIDEO_AVCProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_AVCProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_AVCProfileMax = 0x7FFFFFFF -} OMX_VIDEO_AVCPROFILETYPE; - - -/** - * AVC level types, each level indicates support for various frame sizes, - * bit rates, decoder frame rates. No need - */ -typedef enum OMX_VIDEO_AVCLEVELTYPE { - OMX_VIDEO_AVCLevel1 = 0x01, /**< Level 1 */ - OMX_VIDEO_AVCLevel1b = 0x02, /**< Level 1b */ - OMX_VIDEO_AVCLevel11 = 0x04, /**< Level 1.1 */ - OMX_VIDEO_AVCLevel12 = 0x08, /**< Level 1.2 */ - OMX_VIDEO_AVCLevel13 = 0x10, /**< Level 1.3 */ - OMX_VIDEO_AVCLevel2 = 0x20, /**< Level 2 */ - OMX_VIDEO_AVCLevel21 = 0x40, /**< Level 2.1 */ - OMX_VIDEO_AVCLevel22 = 0x80, /**< Level 2.2 */ - OMX_VIDEO_AVCLevel3 = 0x100, /**< Level 3 */ - OMX_VIDEO_AVCLevel31 = 0x200, /**< Level 3.1 */ - OMX_VIDEO_AVCLevel32 = 0x400, /**< Level 3.2 */ - OMX_VIDEO_AVCLevel4 = 0x800, /**< Level 4 */ - OMX_VIDEO_AVCLevel41 = 0x1000, /**< Level 4.1 */ - OMX_VIDEO_AVCLevel42 = 0x2000, /**< Level 4.2 */ - OMX_VIDEO_AVCLevel5 = 0x4000, /**< Level 5 */ - OMX_VIDEO_AVCLevel51 = 0x8000, /**< Level 5.1 */ - OMX_VIDEO_AVCLevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_AVCLevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_AVCLevelMax = 0x7FFFFFFF -} OMX_VIDEO_AVCLEVELTYPE; - - -/** - * AVC loop filter modes - * - * OMX_VIDEO_AVCLoopFilterEnable : Enable - * OMX_VIDEO_AVCLoopFilterDisable : Disable - * OMX_VIDEO_AVCLoopFilterDisableSliceBoundary : Disabled on slice boundaries - */ -typedef enum OMX_VIDEO_AVCLOOPFILTERTYPE { - OMX_VIDEO_AVCLoopFilterEnable = 0, - OMX_VIDEO_AVCLoopFilterDisable, - OMX_VIDEO_AVCLoopFilterDisableSliceBoundary, - OMX_VIDEO_AVCLoopFilterKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_AVCLoopFilterVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_AVCLoopFilterMax = 0x7FFFFFFF -} OMX_VIDEO_AVCLOOPFILTERTYPE; - - -/** - * AVC params - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nSliceHeaderSpacing : Number of macroblocks between slice header, put - * zero if not used - * nPFrames : Number of P frames between each I frame - * nBFrames : Number of B frames between each I frame - * bUseHadamard : Enable/disable Hadamard transform - * nRefFrames : Max number of reference frames to use for inter - * motion search (1-16) - * nRefIdxTrailing : Pic param set ref frame index (index into ref - * frame buffer of trailing frames list), B frame - * support - * nRefIdxForward : Pic param set ref frame index (index into ref - * frame buffer of forward frames list), B frame - * support - * bEnableUEP : Enable/disable unequal error protection. This - * is only valid of data partitioning is enabled. - * bEnableFMO : Enable/disable flexible macroblock ordering - * bEnableASO : Enable/disable arbitrary slice ordering - * bEnableRS : Enable/disable sending of redundant slices - * eProfile : AVC profile(s) to use - * eLevel : AVC level(s) to use - * nAllowedPictureTypes : Specifies the picture types allowed in the - * bitstream - * bFrameMBsOnly : specifies that every coded picture of the - * coded video sequence is a coded frame - * containing only frame macroblocks - * bMBAFF : Enable/disable switching between frame and - * field macroblocks within a picture - * bEntropyCodingCABAC : Entropy decoding method to be applied for the - * syntax elements for which two descriptors appear - * in the syntax tables - * bWeightedPPrediction : Enable/disable weighted prediction shall not - * be applied to P and SP slices - * nWeightedBipredicitonMode : Default weighted prediction is applied to B - * slices - * bconstIpred : Enable/disable intra prediction - * bDirect8x8Inference : Specifies the method used in the derivation - * process for luma motion vectors for B_Skip, - * B_Direct_16x16 and B_Direct_8x8 as specified - * in subclause 8.4.1.2 of the AVC spec - * bDirectSpatialTemporal : Flag indicating spatial or temporal direct - * mode used in B slice coding (related to - * bDirect8x8Inference) . Spatial direct mode is - * more common and should be the default. - * nCabacInitIdx : Index used to init CABAC contexts - * eLoopFilterMode : Enable/disable loop filter - */ -typedef struct OMX_VIDEO_PARAM_AVCTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nSliceHeaderSpacing; - OMX_U32 nPFrames; - OMX_U32 nBFrames; - OMX_BOOL bUseHadamard; - OMX_U32 nRefFrames; - OMX_U32 nRefIdx10ActiveMinus1; - OMX_U32 nRefIdx11ActiveMinus1; - OMX_BOOL bEnableUEP; - OMX_BOOL bEnableFMO; - OMX_BOOL bEnableASO; - OMX_BOOL bEnableRS; - OMX_VIDEO_AVCPROFILETYPE eProfile; - OMX_VIDEO_AVCLEVELTYPE eLevel; - OMX_U32 nAllowedPictureTypes; - OMX_BOOL bFrameMBsOnly; - OMX_BOOL bMBAFF; - OMX_BOOL bEntropyCodingCABAC; - OMX_BOOL bWeightedPPrediction; - OMX_U32 nWeightedBipredicitonMode; - OMX_BOOL bconstIpred ; - OMX_BOOL bDirect8x8Inference; - OMX_BOOL bDirectSpatialTemporal; - OMX_U32 nCabacInitIdc; - OMX_VIDEO_AVCLOOPFILTERTYPE eLoopFilterMode; -} OMX_VIDEO_PARAM_AVCTYPE; - -typedef struct OMX_VIDEO_PARAM_PROFILELEVELTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 eProfile; /**< type is OMX_VIDEO_AVCPROFILETYPE, OMX_VIDEO_H263PROFILETYPE, - or OMX_VIDEO_MPEG4PROFILETYPE depending on context */ - OMX_U32 eLevel; /**< type is OMX_VIDEO_AVCLEVELTYPE, OMX_VIDEO_H263LEVELTYPE, - or OMX_VIDEO_MPEG4PROFILETYPE depending on context */ - OMX_U32 nProfileIndex; /**< Used to query for individual profile support information, - This parameter is valid only for - OMX_IndexParamVideoProfileLevelQuerySupported index, - For all other indices this parameter is to be ignored. */ -} OMX_VIDEO_PARAM_PROFILELEVELTYPE; - -/** - * Structure for dynamically configuring bitrate mode of a codec. - * - * STRUCT MEMBERS: - * nSize : Size of the struct in bytes - * nVersion : OMX spec version info - * nPortIndex : Port that this struct applies to - * nEncodeBitrate : Target average bitrate to be generated in bps - */ -typedef struct OMX_VIDEO_CONFIG_BITRATETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nEncodeBitrate; -} OMX_VIDEO_CONFIG_BITRATETYPE; - -/** - * Defines Encoder Frame Rate setting - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * xEncodeFramerate : Encoding framerate represented in Q16 format - */ -typedef struct OMX_CONFIG_FRAMERATETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 xEncodeFramerate; /* Q16 format */ -} OMX_CONFIG_FRAMERATETYPE; - -typedef struct OMX_CONFIG_INTRAREFRESHVOPTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL IntraRefreshVOP; -} OMX_CONFIG_INTRAREFRESHVOPTYPE; - -typedef struct OMX_CONFIG_MACROBLOCKERRORMAPTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nErrMapSize; /* Size of the Error Map in bytes */ - OMX_U8 ErrMap[1]; /* Error map hint */ -} OMX_CONFIG_MACROBLOCKERRORMAPTYPE; - -typedef struct OMX_CONFIG_MBERRORREPORTINGTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL bEnabled; -} OMX_CONFIG_MBERRORREPORTINGTYPE; - -typedef struct OMX_PARAM_MACROBLOCKSTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nMacroblocks; -} OMX_PARAM_MACROBLOCKSTYPE; - -/** - * AVC Slice Mode modes - * - * OMX_VIDEO_SLICEMODE_AVCDefault : Normal frame encoding, one slice per frame - * OMX_VIDEO_SLICEMODE_AVCMBSlice : NAL mode, number of MBs per frame - * OMX_VIDEO_SLICEMODE_AVCByteSlice : NAL mode, number of bytes per frame - */ -typedef enum OMX_VIDEO_AVCSLICEMODETYPE { - OMX_VIDEO_SLICEMODE_AVCDefault = 0, - OMX_VIDEO_SLICEMODE_AVCMBSlice, - OMX_VIDEO_SLICEMODE_AVCByteSlice, - OMX_VIDEO_SLICEMODE_AVCKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_SLICEMODE_AVCVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_SLICEMODE_AVCLevelMax = 0x7FFFFFFF -} OMX_VIDEO_AVCSLICEMODETYPE; - -/** - * AVC FMO Slice Mode Params - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nNumSliceGroups : Specifies the number of slice groups - * nSliceGroupMapType : Specifies the type of slice groups - * eSliceMode : Specifies the type of slice - */ -typedef struct OMX_VIDEO_PARAM_AVCSLICEFMO { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U8 nNumSliceGroups; - OMX_U8 nSliceGroupMapType; - OMX_VIDEO_AVCSLICEMODETYPE eSliceMode; -} OMX_VIDEO_PARAM_AVCSLICEFMO; - -/** - * AVC IDR Period Configs - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nIDRPeriod : Specifies periodicity of IDR frames - * nPFrames : Specifies internal of coding Intra frames - */ -typedef struct OMX_VIDEO_CONFIG_AVCINTRAPERIOD { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nIDRPeriod; - OMX_U32 nPFrames; -} OMX_VIDEO_CONFIG_AVCINTRAPERIOD; - -/** - * AVC NAL Size Configs - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nNaluBytes : Specifies the NAL unit size - */ -typedef struct OMX_VIDEO_CONFIG_NALSIZE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nNaluBytes; -} OMX_VIDEO_CONFIG_NALSIZE; - -/** @} */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ - diff --git a/external/android/include/16/frameworks/native/include/ui/ANativeObjectBase.h b/external/android/include/16/frameworks/native/include/ui/ANativeObjectBase.h deleted file mode 100644 index 76e850f..0000000 --- a/external/android/include/16/frameworks/native/include/ui/ANativeObjectBase.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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_ANDROID_NATIVES_H -#define ANDROID_ANDROID_NATIVES_H - -#include -#include - -#include -#include - -// --------------------------------------------------------------------------- - -/* FIXME: this is legacy for pixmaps */ -typedef struct egl_native_pixmap_t -{ - int32_t version; /* must be 32 */ - int32_t width; - int32_t height; - int32_t stride; - uint8_t* data; - uint8_t format; - uint8_t rfu[3]; - union { - uint32_t compressedFormat; - int32_t vstride; - }; - int32_t reserved; -} egl_native_pixmap_t; - -/*****************************************************************************/ - -#ifdef __cplusplus - -#include - -namespace android { - -/* - * This helper class turns a ANativeXXX object type into a C++ - * reference-counted object; with proper type conversions. - */ -template -class ANativeObjectBase : public NATIVE_TYPE, public REF -{ -public: - // Disambiguate between the incStrong in REF and NATIVE_TYPE - void incStrong(const void* id) const { - REF::incStrong(id); - } - void decStrong(const void* id) const { - REF::decStrong(id); - } - -protected: - typedef ANativeObjectBase BASE; - ANativeObjectBase() : NATIVE_TYPE(), REF() { - NATIVE_TYPE::common.incRef = incRef; - NATIVE_TYPE::common.decRef = decRef; - } - static inline TYPE* getSelf(NATIVE_TYPE* self) { - return static_cast(self); - } - static inline TYPE const* getSelf(NATIVE_TYPE const* self) { - return static_cast(self); - } - static inline TYPE* getSelf(android_native_base_t* base) { - return getSelf(reinterpret_cast(base)); - } - static inline TYPE const * getSelf(android_native_base_t const* base) { - return getSelf(reinterpret_cast(base)); - } - static void incRef(android_native_base_t* base) { - ANativeObjectBase* self = getSelf(base); - self->incStrong(self); - } - static void decRef(android_native_base_t* base) { - ANativeObjectBase* self = getSelf(base); - self->decStrong(self); - } -}; - -} // namespace android -#endif // __cplusplus - -/*****************************************************************************/ - -#endif /* ANDROID_ANDROID_NATIVES_H */ diff --git a/external/android/include/16/frameworks/native/include/ui/DisplayInfo.h b/external/android/include/16/frameworks/native/include/ui/DisplayInfo.h deleted file mode 100644 index edd28a6..0000000 --- a/external/android/include/16/frameworks/native/include/ui/DisplayInfo.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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_UI_DISPLAY_INFO_H -#define ANDROID_UI_DISPLAY_INFO_H - -#include -#include - -#include - -namespace android { - -struct DisplayInfo { - uint32_t w; - uint32_t h; - PixelFormatInfo pixelFormatInfo; - uint8_t orientation; - uint8_t reserved[3]; - float fps; - float density; - float xdpi; - float ydpi; -}; - -/* Display orientations as defined in Surface.java and ISurfaceComposer.h. */ -enum { - DISPLAY_ORIENTATION_0 = 0, - DISPLAY_ORIENTATION_90 = 1, - DISPLAY_ORIENTATION_180 = 2, - DISPLAY_ORIENTATION_270 = 3 -}; - - -}; // namespace android - -#endif // ANDROID_COMPOSER_DISPLAY_INFO_H - diff --git a/external/android/include/16/frameworks/native/include/ui/FramebufferNativeWindow.h b/external/android/include/16/frameworks/native/include/ui/FramebufferNativeWindow.h deleted file mode 100644 index b202b95..0000000 --- a/external/android/include/16/frameworks/native/include/ui/FramebufferNativeWindow.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * 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_FRAMEBUFFER_NATIVE_WINDOW_H -#define ANDROID_FRAMEBUFFER_NATIVE_WINDOW_H - -#include -#include - -#include - -#include -#include - -#include -#include - -#define NUM_FRAME_BUFFERS 2 - -extern "C" EGLNativeWindowType android_createDisplaySurface(void); - -// --------------------------------------------------------------------------- -namespace android { -// --------------------------------------------------------------------------- - -class Surface; -class NativeBuffer; - -// --------------------------------------------------------------------------- - -class FramebufferNativeWindow - : public ANativeObjectBase< - ANativeWindow, - FramebufferNativeWindow, - LightRefBase > -{ -public: - FramebufferNativeWindow(); - - framebuffer_device_t const * getDevice() const { return fbDev; } - - bool isUpdateOnDemand() const { return mUpdateOnDemand; } - status_t setUpdateRectangle(const Rect& updateRect); - status_t compositionComplete(); - - void dump(String8& result); - - // for debugging only - int getCurrentBufferIndex() const; - -private: - friend class LightRefBase; - ~FramebufferNativeWindow(); // this class cannot be overloaded - static int setSwapInterval(ANativeWindow* window, int interval); - static int dequeueBuffer(ANativeWindow* window, ANativeWindowBuffer** buffer); - static int lockBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer); - static int queueBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer); - static int query(const ANativeWindow* window, int what, int* value); - static int perform(ANativeWindow* window, int operation, ...); - - framebuffer_device_t* fbDev; - alloc_device_t* grDev; - - sp buffers[NUM_FRAME_BUFFERS]; - sp front; - - mutable Mutex mutex; - Condition mCondition; - int32_t mNumBuffers; - int32_t mNumFreeBuffers; - int32_t mBufferHead; - int32_t mCurrentBufferIndex; - bool mUpdateOnDemand; -}; - -// --------------------------------------------------------------------------- -}; // namespace android -// --------------------------------------------------------------------------- - -#endif // ANDROID_FRAMEBUFFER_NATIVE_WINDOW_H - diff --git a/external/android/include/16/frameworks/native/include/ui/GraphicBuffer.h b/external/android/include/16/frameworks/native/include/ui/GraphicBuffer.h deleted file mode 100644 index f318cd8..0000000 --- a/external/android/include/16/frameworks/native/include/ui/GraphicBuffer.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * 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_GRAPHIC_BUFFER_H -#define ANDROID_GRAPHIC_BUFFER_H - -#include -#include - -#include -#include -#include -#include - - -struct ANativeWindowBuffer; - -namespace android { - -class GraphicBufferMapper; - -// =========================================================================== -// GraphicBuffer -// =========================================================================== - -class GraphicBuffer - : public ANativeObjectBase< - ANativeWindowBuffer, - GraphicBuffer, - LightRefBase >, public Flattenable -{ -public: - - enum { - USAGE_SW_READ_NEVER = GRALLOC_USAGE_SW_READ_NEVER, - USAGE_SW_READ_RARELY = GRALLOC_USAGE_SW_READ_RARELY, - USAGE_SW_READ_OFTEN = GRALLOC_USAGE_SW_READ_OFTEN, - USAGE_SW_READ_MASK = GRALLOC_USAGE_SW_READ_MASK, - - USAGE_SW_WRITE_NEVER = GRALLOC_USAGE_SW_WRITE_NEVER, - USAGE_SW_WRITE_RARELY = GRALLOC_USAGE_SW_WRITE_RARELY, - USAGE_SW_WRITE_OFTEN = GRALLOC_USAGE_SW_WRITE_OFTEN, - USAGE_SW_WRITE_MASK = GRALLOC_USAGE_SW_WRITE_MASK, - - USAGE_SOFTWARE_MASK = USAGE_SW_READ_MASK|USAGE_SW_WRITE_MASK, - - USAGE_PROTECTED = GRALLOC_USAGE_PROTECTED, - - USAGE_HW_TEXTURE = GRALLOC_USAGE_HW_TEXTURE, - USAGE_HW_RENDER = GRALLOC_USAGE_HW_RENDER, - USAGE_HW_2D = GRALLOC_USAGE_HW_2D, - USAGE_HW_COMPOSER = GRALLOC_USAGE_HW_COMPOSER, - USAGE_HW_VIDEO_ENCODER = GRALLOC_USAGE_HW_VIDEO_ENCODER, - USAGE_HW_MASK = GRALLOC_USAGE_HW_MASK - }; - - GraphicBuffer(); - - // creates w * h buffer - GraphicBuffer(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage); - - // create a buffer from an existing handle - GraphicBuffer(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage, - uint32_t stride, native_handle_t* handle, bool keepOwnership); - - // create a buffer from an existing ANativeWindowBuffer - GraphicBuffer(ANativeWindowBuffer* buffer, bool keepOwnership); - - // return status - status_t initCheck() const; - - uint32_t getWidth() const { return width; } - uint32_t getHeight() const { return height; } - uint32_t getStride() const { return stride; } - uint32_t getUsage() const { return usage; } - PixelFormat getPixelFormat() const { return format; } - Rect getBounds() const { return Rect(width, height); } - - status_t reallocate(uint32_t w, uint32_t h, PixelFormat f, uint32_t usage); - - status_t lock(uint32_t usage, void** vaddr); - status_t lock(uint32_t usage, const Rect& rect, void** vaddr); - status_t unlock(); - - ANativeWindowBuffer* getNativeBuffer() const; - - void setIndex(int index); - int getIndex() const; - - // for debugging - static void dumpAllocationsToSystemLog(); - -private: - virtual ~GraphicBuffer(); - - enum { - ownNone = 0, - ownHandle = 1, - ownData = 2, - }; - - inline const GraphicBufferMapper& getBufferMapper() const { - return mBufferMapper; - } - inline GraphicBufferMapper& getBufferMapper() { - return mBufferMapper; - } - uint8_t mOwner; - -private: - friend class Surface; - friend class BpSurface; - friend class BnSurface; - friend class SurfaceTextureClient; - friend class LightRefBase; - GraphicBuffer(const GraphicBuffer& rhs); - GraphicBuffer& operator = (const GraphicBuffer& rhs); - const GraphicBuffer& operator = (const GraphicBuffer& rhs) const; - - status_t initSize(uint32_t w, uint32_t h, PixelFormat format, - uint32_t usage); - - void free_handle(); - - // Flattenable interface - size_t getFlattenedSize() const; - size_t getFdCount() const; - status_t flatten(void* buffer, size_t size, - int fds[], size_t count) const; - status_t unflatten(void const* buffer, size_t size, - int fds[], size_t count); - - - GraphicBufferMapper& mBufferMapper; - ssize_t mInitCheck; - int mIndex; - - // If we're wrapping another buffer then this reference will make sure it - // doesn't get freed. - sp mWrappedBuffer; -}; - -}; // namespace android - -#endif // ANDROID_GRAPHIC_BUFFER_H diff --git a/external/android/include/16/frameworks/native/include/ui/GraphicBufferAllocator.h b/external/android/include/16/frameworks/native/include/ui/GraphicBufferAllocator.h deleted file mode 100644 index dffa788..0000000 --- a/external/android/include/16/frameworks/native/include/ui/GraphicBufferAllocator.h +++ /dev/null @@ -1,96 +0,0 @@ -/* -** -** Copyright 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_BUFFER_ALLOCATOR_H -#define ANDROID_BUFFER_ALLOCATOR_H - -#include - -#include - -#include -#include -#include -#include - -#include - -#include - - -namespace android { -// --------------------------------------------------------------------------- - -class String8; - -class GraphicBufferAllocator : public Singleton -{ -public: - enum { - USAGE_SW_READ_NEVER = GRALLOC_USAGE_SW_READ_NEVER, - USAGE_SW_READ_RARELY = GRALLOC_USAGE_SW_READ_RARELY, - USAGE_SW_READ_OFTEN = GRALLOC_USAGE_SW_READ_OFTEN, - USAGE_SW_READ_MASK = GRALLOC_USAGE_SW_READ_MASK, - - USAGE_SW_WRITE_NEVER = GRALLOC_USAGE_SW_WRITE_NEVER, - USAGE_SW_WRITE_RARELY = GRALLOC_USAGE_SW_WRITE_RARELY, - USAGE_SW_WRITE_OFTEN = GRALLOC_USAGE_SW_WRITE_OFTEN, - USAGE_SW_WRITE_MASK = GRALLOC_USAGE_SW_WRITE_MASK, - - USAGE_SOFTWARE_MASK = USAGE_SW_READ_MASK|USAGE_SW_WRITE_MASK, - - USAGE_HW_TEXTURE = GRALLOC_USAGE_HW_TEXTURE, - USAGE_HW_RENDER = GRALLOC_USAGE_HW_RENDER, - USAGE_HW_2D = GRALLOC_USAGE_HW_2D, - USAGE_HW_MASK = GRALLOC_USAGE_HW_MASK - }; - - static inline GraphicBufferAllocator& get() { return getInstance(); } - - - status_t alloc(uint32_t w, uint32_t h, PixelFormat format, int usage, - buffer_handle_t* handle, int32_t* stride); - - status_t free(buffer_handle_t handle); - - void dump(String8& res) const; - static void dumpToSystemLog(); - -private: - struct alloc_rec_t { - uint32_t w; - uint32_t h; - uint32_t s; - PixelFormat format; - uint32_t usage; - size_t size; - }; - - static Mutex sLock; - static KeyedVector sAllocList; - - friend class Singleton; - GraphicBufferAllocator(); - ~GraphicBufferAllocator(); - - alloc_device_t *mAllocDev; -}; - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_BUFFER_ALLOCATOR_H diff --git a/external/android/include/16/frameworks/native/include/ui/GraphicBufferMapper.h b/external/android/include/16/frameworks/native/include/ui/GraphicBufferMapper.h deleted file mode 100644 index 697a02a..0000000 --- a/external/android/include/16/frameworks/native/include/ui/GraphicBufferMapper.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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_UI_BUFFER_MAPPER_H -#define ANDROID_UI_BUFFER_MAPPER_H - -#include -#include - -#include - -#include - - -struct gralloc_module_t; - -namespace android { - -// --------------------------------------------------------------------------- - -class Rect; - -class GraphicBufferMapper : public Singleton -{ -public: - static inline GraphicBufferMapper& get() { return getInstance(); } - - status_t registerBuffer(buffer_handle_t handle); - - status_t unregisterBuffer(buffer_handle_t handle); - - status_t lock(buffer_handle_t handle, - int usage, const Rect& bounds, void** vaddr); - - status_t unlock(buffer_handle_t handle); - - // dumps information about the mapping of this handle - void dump(buffer_handle_t handle); - -private: - friend class Singleton; - GraphicBufferMapper(); - gralloc_module_t const *mAllocMod; -}; - -// --------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_UI_BUFFER_MAPPER_H - diff --git a/external/android/include/16/frameworks/native/include/ui/PixelFormat.h b/external/android/include/16/frameworks/native/include/ui/PixelFormat.h deleted file mode 100644 index 9f3e267..0000000 --- a/external/android/include/16/frameworks/native/include/ui/PixelFormat.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// - -// Pixel formats used across the system. -// These formats might not all be supported by all renderers, for instance -// skia or SurfaceFlinger are not required to support all of these formats -// (either as source or destination) - - -#ifndef UI_PIXELFORMAT_H -#define UI_PIXELFORMAT_H - -#include -#include -#include -#include - -namespace android { - -enum { - // - // these constants need to match those - // in graphics/PixelFormat.java & pixelflinger/format.h - // - PIXEL_FORMAT_UNKNOWN = 0, - PIXEL_FORMAT_NONE = 0, - - // logical pixel formats used by the SurfaceFlinger ----------------------- - PIXEL_FORMAT_CUSTOM = -4, - // Custom pixel-format described by a PixelFormatInfo structure - - PIXEL_FORMAT_TRANSLUCENT = -3, - // System chooses a format that supports translucency (many alpha bits) - - PIXEL_FORMAT_TRANSPARENT = -2, - // System chooses a format that supports transparency - // (at least 1 alpha bit) - - PIXEL_FORMAT_OPAQUE = -1, - // System chooses an opaque format (no alpha bits required) - - // real pixel formats supported for rendering ----------------------------- - - PIXEL_FORMAT_RGBA_8888 = HAL_PIXEL_FORMAT_RGBA_8888, // 4x8-bit RGBA - PIXEL_FORMAT_RGBX_8888 = HAL_PIXEL_FORMAT_RGBX_8888, // 4x8-bit RGB0 - PIXEL_FORMAT_RGB_888 = HAL_PIXEL_FORMAT_RGB_888, // 3x8-bit RGB - PIXEL_FORMAT_RGB_565 = HAL_PIXEL_FORMAT_RGB_565, // 16-bit RGB - PIXEL_FORMAT_BGRA_8888 = HAL_PIXEL_FORMAT_BGRA_8888, // 4x8-bit BGRA - PIXEL_FORMAT_RGBA_5551 = HAL_PIXEL_FORMAT_RGBA_5551, // 16-bit ARGB - PIXEL_FORMAT_RGBA_4444 = HAL_PIXEL_FORMAT_RGBA_4444, // 16-bit ARGB - PIXEL_FORMAT_A_8 = 8, // 8-bit A -}; - -typedef int32_t PixelFormat; - -struct PixelFormatInfo { - enum { - INDEX_ALPHA = 0, - INDEX_RED = 1, - INDEX_GREEN = 2, - INDEX_BLUE = 3 - }; - - enum { // components - ALPHA = 1, - RGB = 2, - RGBA = 3, - L = 4, - LA = 5, - OTHER = 0xFF - }; - - struct szinfo { - uint8_t h; - uint8_t l; - }; - - inline PixelFormatInfo() : version(sizeof(PixelFormatInfo)) { } - size_t getScanlineSize(unsigned int width) const; - size_t getSize(size_t ci) const { - return (ci <= 3) ? (cinfo[ci].h - cinfo[ci].l) : 0; - } - size_t version; - PixelFormat format; - size_t bytesPerPixel; - size_t bitsPerPixel; - union { - szinfo cinfo[4]; - struct { - uint8_t h_alpha; - uint8_t l_alpha; - uint8_t h_red; - uint8_t l_red; - uint8_t h_green; - uint8_t l_green; - uint8_t h_blue; - uint8_t l_blue; - }; - }; - uint8_t components; - uint8_t reserved0[3]; - uint32_t reserved1; -}; - -// Consider caching the results of these functions are they're not -// guaranteed to be fast. -ssize_t bytesPerPixel(PixelFormat format); -ssize_t bitsPerPixel(PixelFormat format); -status_t getPixelFormatInfo(PixelFormat format, PixelFormatInfo* info); - -}; // namespace android - -#endif // UI_PIXELFORMAT_H diff --git a/external/android/include/16/frameworks/native/include/ui/Point.h b/external/android/include/16/frameworks/native/include/ui/Point.h deleted file mode 100644 index 1653120..0000000 --- a/external/android/include/16/frameworks/native/include/ui/Point.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (C) 2006 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_UI_POINT -#define ANDROID_UI_POINT - -#include - -namespace android { - -class Point -{ -public: - int x; - int y; - - // we don't provide copy-ctor and operator= on purpose - // because we want the compiler generated versions - - // Default constructor doesn't initialize the Point - inline Point() { - } - inline Point(int x, int y) : x(x), y(y) { - } - - inline bool operator == (const Point& rhs) const { - return (x == rhs.x) && (y == rhs.y); - } - inline bool operator != (const Point& rhs) const { - return !operator == (rhs); - } - - inline bool isOrigin() const { - return !(x|y); - } - - // operator < defines an order which allows to use points in sorted - // vectors. - bool operator < (const Point& rhs) const { - return y -#include - -#include - -namespace android { - -class Rect : public ARect -{ -public: - typedef ARect::value_type value_type; - - // we don't provide copy-ctor and operator= on purpose - // because we want the compiler generated versions - - inline Rect() { - } - inline Rect(int32_t w, int32_t h) { - left = top = 0; right = w; bottom = h; - } - inline Rect(int32_t l, int32_t t, int32_t r, int32_t b) { - left = l; top = t; right = r; bottom = b; - } - inline Rect(const Point& lt, const Point& rb) { - left = lt.x; top = lt.y; right = rb.x; bottom = rb.y; - } - - void makeInvalid(); - - inline void clear() { - left = top = right = bottom = 0; - } - - // a valid rectangle has a non negative width and height - inline bool isValid() const { - return (width()>=0) && (height()>=0); - } - - // an empty rect has a zero width or height, or is invalid - inline bool isEmpty() const { - return (width()<=0) || (height()<=0); - } - - inline void set(const Rect& rhs) { - operator = (rhs); - } - - // rectangle's width - inline int32_t getWidth() const { - return right-left; - } - - // rectangle's height - inline int32_t getHeight() const { - return bottom-top; - } - - inline Rect getBounds() const { - return Rect(right-left, bottom-top); - } - - inline int32_t width() const { return getWidth(); } - inline int32_t height() const { return getHeight(); } - - void setLeftTop(const Point& lt) { - left = lt.x; - top = lt.y; - } - - void setRightBottom(const Point& rb) { - right = rb.x; - bottom = rb.y; - } - - // the following 4 functions return the 4 corners of the rect as Point - Point leftTop() const { - return Point(left, top); - } - Point rightBottom() const { - return Point(right, bottom); - } - Point rightTop() const { - return Point(right, top); - } - Point leftBottom() const { - return Point(left, bottom); - } - - // comparisons - inline bool operator == (const Rect& rhs) const { - return (left == rhs.left) && (top == rhs.top) && - (right == rhs.right) && (bottom == rhs.bottom); - } - - inline bool operator != (const Rect& rhs) const { - return !operator == (rhs); - } - - // operator < defines an order which allows to use rectangles in sorted - // vectors. - bool operator < (const Rect& rhs) const; - - Rect& offsetToOrigin() { - right -= left; - bottom -= top; - left = top = 0; - return *this; - } - Rect& offsetTo(const Point& p) { - return offsetTo(p.x, p.y); - } - Rect& offsetBy(const Point& dp) { - return offsetBy(dp.x, dp.y); - } - Rect& operator += (const Point& rhs) { - return offsetBy(rhs.x, rhs.y); - } - Rect& operator -= (const Point& rhs) { - return offsetBy(-rhs.x, -rhs.y); - } - const Rect operator + (const Point& rhs) const; - const Rect operator - (const Point& rhs) const; - - void translate(int32_t dx, int32_t dy) { // legacy, don't use. - offsetBy(dx, dy); - } - - Rect& offsetTo(int32_t x, int32_t y); - Rect& offsetBy(int32_t x, int32_t y); - bool intersect(const Rect& with, Rect* result) const; - - // Create a new Rect by transforming this one using a graphics HAL - // transform. This rectangle is defined in a coordinate space starting at - // the origin and extending to (width, height). If the transform includes - // a ROT90 then the output rectangle is defined in a space extending to - // (height, width). Otherwise the output rectangle is in the same space as - // the input. - Rect transform(uint32_t xform, int32_t width, int32_t height) const; -}; - -ANDROID_BASIC_TYPES_TRAITS(Rect) - -}; // namespace android - -#endif // ANDROID_UI_RECT diff --git a/external/android/include/16/frameworks/native/include/ui/Region.h b/external/android/include/16/frameworks/native/include/ui/Region.h deleted file mode 100644 index f242f18..0000000 --- a/external/android/include/16/frameworks/native/include/ui/Region.h +++ /dev/null @@ -1,202 +0,0 @@ -/* - * 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_UI_REGION_H -#define ANDROID_UI_REGION_H - -#include -#include - -#include - -#include - -namespace android { -// --------------------------------------------------------------------------- - -class String8; - -// --------------------------------------------------------------------------- -class Region -{ -public: - Region(); - Region(const Region& rhs); - explicit Region(const Rect& rhs); - explicit Region(const void* buffer); - ~Region(); - - Region& operator = (const Region& rhs); - - inline bool isEmpty() const { return mBounds.isEmpty(); } - inline bool isRect() const { return mStorage.isEmpty(); } - - inline Rect getBounds() const { return mBounds; } - inline Rect bounds() const { return getBounds(); } - - // the region becomes its bounds - Region& makeBoundsSelf(); - - void clear(); - void set(const Rect& r); - void set(uint32_t w, uint32_t h); - - Region& orSelf(const Rect& rhs); - Region& xorSelf(const Rect& rhs); - Region& andSelf(const Rect& rhs); - Region& subtractSelf(const Rect& rhs); - - // boolean operators, applied on this - Region& orSelf(const Region& rhs); - Region& xorSelf(const Region& rhs); - Region& andSelf(const Region& rhs); - Region& subtractSelf(const Region& rhs); - - // boolean operators - const Region merge(const Rect& rhs) const; - const Region mergeExclusive(const Rect& rhs) const; - const Region intersect(const Rect& rhs) const; - const Region subtract(const Rect& rhs) const; - - // boolean operators - const Region merge(const Region& rhs) const; - const Region mergeExclusive(const Region& rhs) const; - const Region intersect(const Region& rhs) const; - const Region subtract(const Region& rhs) const; - - // these translate rhs first - Region& translateSelf(int dx, int dy); - Region& orSelf(const Region& rhs, int dx, int dy); - Region& xorSelf(const Region& rhs, int dx, int dy); - Region& andSelf(const Region& rhs, int dx, int dy); - Region& subtractSelf(const Region& rhs, int dx, int dy); - - // these translate rhs first - const Region translate(int dx, int dy) const; - const Region merge(const Region& rhs, int dx, int dy) const; - const Region mergeExclusive(const Region& rhs, int dx, int dy) const; - const Region intersect(const Region& rhs, int dx, int dy) const; - const Region subtract(const Region& rhs, int dx, int dy) const; - - // convenience operators overloads - inline const Region operator | (const Region& rhs) const; - inline const Region operator ^ (const Region& rhs) const; - inline const Region operator & (const Region& rhs) const; - inline const Region operator - (const Region& rhs) const; - inline const Region operator + (const Point& pt) const; - - inline Region& operator |= (const Region& rhs); - inline Region& operator ^= (const Region& rhs); - inline Region& operator &= (const Region& rhs); - inline Region& operator -= (const Region& rhs); - inline Region& operator += (const Point& pt); - - - /* various ways to access the rectangle list */ - - typedef Rect const* const_iterator; - - const_iterator begin() const; - const_iterator end() const; - - /* no user serviceable parts here... */ - - size_t getRects(Vector& rectList) const; - Rect const* getArray(size_t* count) const; - - - // add a rectangle to the internal list. This rectangle must - // be sorted in Y and X and must not make the region invalid. - void addRectUnchecked(int l, int t, int r, int b); - - // flatten/unflatten a region to/from a raw buffer - ssize_t write(void* buffer, size_t size) const; - static ssize_t writeEmpty(void* buffer, size_t size); - - ssize_t read(const void* buffer); - static bool isEmpty(void* buffer); - - void dump(String8& out, const char* what, uint32_t flags=0) const; - void dump(const char* what, uint32_t flags=0) const; - -private: - class rasterizer; - friend class rasterizer; - - Region& operationSelf(const Rect& r, int op); - Region& operationSelf(const Region& r, int op); - Region& operationSelf(const Region& r, int dx, int dy, int op); - const Region operation(const Rect& rhs, int op) const; - const Region operation(const Region& rhs, int op) const; - const Region operation(const Region& rhs, int dx, int dy, int op) const; - - static void boolean_operation(int op, Region& dst, - const Region& lhs, const Region& rhs, int dx, int dy); - static void boolean_operation(int op, Region& dst, - const Region& lhs, const Rect& rhs, int dx, int dy); - - static void boolean_operation(int op, Region& dst, - const Region& lhs, const Region& rhs); - static void boolean_operation(int op, Region& dst, - const Region& lhs, const Rect& rhs); - - static void translate(Region& reg, int dx, int dy); - static void translate(Region& dst, const Region& reg, int dx, int dy); - - static bool validate(const Region& reg, const char* name); - - Rect mBounds; - Vector mStorage; -}; - - -const Region Region::operator | (const Region& rhs) const { - return merge(rhs); -} -const Region Region::operator ^ (const Region& rhs) const { - return mergeExclusive(rhs); -} -const Region Region::operator & (const Region& rhs) const { - return intersect(rhs); -} -const Region Region::operator - (const Region& rhs) const { - return subtract(rhs); -} -const Region Region::operator + (const Point& pt) const { - return translate(pt.x, pt.y); -} - - -Region& Region::operator |= (const Region& rhs) { - return orSelf(rhs); -} -Region& Region::operator ^= (const Region& rhs) { - return xorSelf(rhs); -} -Region& Region::operator &= (const Region& rhs) { - return andSelf(rhs); -} -Region& Region::operator -= (const Region& rhs) { - return subtractSelf(rhs); -} -Region& Region::operator += (const Point& pt) { - return translateSelf(pt.x, pt.y); -} -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_UI_REGION_H - diff --git a/external/android/include/16/frameworks/native/include/utils/AndroidThreads.h b/external/android/include/16/frameworks/native/include/utils/AndroidThreads.h deleted file mode 100644 index f67648f..0000000 --- a/external/android/include/16/frameworks/native/include/utils/AndroidThreads.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - * 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 _LIBS_UTILS_ANDROID_THREADS_H -#define _LIBS_UTILS_ANDROID_THREADS_H - -#include -#include - -#if defined(HAVE_PTHREADS) -# include -#endif - -#include - -// --------------------------------------------------------------------------- -// C API - -#ifdef __cplusplus -extern "C" { -#endif - -// Create and run a new thread. -extern int androidCreateThread(android_thread_func_t, void *); - -// Create thread with lots of parameters -extern int androidCreateThreadEtc(android_thread_func_t entryFunction, - void *userData, - const char* threadName, - int32_t threadPriority, - size_t threadStackSize, - android_thread_id_t *threadId); - -// Get some sort of unique identifier for the current thread. -extern android_thread_id_t androidGetThreadId(); - -// Low-level thread creation -- never creates threads that can -// interact with the Java VM. -extern int androidCreateRawThreadEtc(android_thread_func_t entryFunction, - void *userData, - const char* threadName, - int32_t threadPriority, - size_t threadStackSize, - android_thread_id_t *threadId); - -// Used by the Java Runtime to control how threads are created, so that -// they can be proper and lovely Java threads. -typedef int (*android_create_thread_fn)(android_thread_func_t entryFunction, - void *userData, - const char* threadName, - int32_t threadPriority, - size_t threadStackSize, - android_thread_id_t *threadId); - -extern void androidSetCreateThreadFunc(android_create_thread_fn func); - -// ------------------------------------------------------------------ -// Extra functions working with raw pids. - -// Get pid for the current thread. -extern pid_t androidGetTid(); - -#ifdef HAVE_ANDROID_OS -// Change the priority AND scheduling group of a particular thread. The priority -// should be one of the ANDROID_PRIORITY constants. Returns INVALID_OPERATION -// if the priority set failed, else another value if just the group set failed; -// in either case errno is set. Thread ID zero means current thread. -extern int androidSetThreadPriority(pid_t tid, int prio); - -// Get the current priority of a particular thread. Returns one of the -// ANDROID_PRIORITY constants or a negative result in case of error. -extern int androidGetThreadPriority(pid_t tid); -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -// ---------------------------------------------------------------------------- -// C++ API -#ifdef __cplusplus -namespace android { -// ---------------------------------------------------------------------------- - -// Create and run a new thread. -inline bool createThread(thread_func_t f, void *a) { - return androidCreateThread(f, a) ? true : false; -} - -// Create thread with lots of parameters -inline bool createThreadEtc(thread_func_t entryFunction, - void *userData, - const char* threadName = "android:unnamed_thread", - int32_t threadPriority = PRIORITY_DEFAULT, - size_t threadStackSize = 0, - thread_id_t *threadId = 0) -{ - return androidCreateThreadEtc(entryFunction, userData, threadName, - threadPriority, threadStackSize, threadId) ? true : false; -} - -// Get some sort of unique identifier for the current thread. -inline thread_id_t getThreadId() { - return androidGetThreadId(); -} - -// ---------------------------------------------------------------------------- -}; // namespace android -#endif // __cplusplus -// ---------------------------------------------------------------------------- - -#endif // _LIBS_UTILS_ANDROID_THREADS_H diff --git a/external/android/include/16/frameworks/native/include/utils/Atomic.h b/external/android/include/16/frameworks/native/include/utils/Atomic.h deleted file mode 100644 index 7eb476c..0000000 --- a/external/android/include/16/frameworks/native/include/utils/Atomic.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2005 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_UTILS_ATOMIC_H -#define ANDROID_UTILS_ATOMIC_H - -#include - -#endif // ANDROID_UTILS_ATOMIC_H diff --git a/external/android/include/16/frameworks/native/include/utils/BasicHashtable.h b/external/android/include/16/frameworks/native/include/utils/BasicHashtable.h deleted file mode 100644 index fdf9738..0000000 --- a/external/android/include/16/frameworks/native/include/utils/BasicHashtable.h +++ /dev/null @@ -1,393 +0,0 @@ -/* - * Copyright (C) 2011 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_BASIC_HASHTABLE_H -#define ANDROID_BASIC_HASHTABLE_H - -#include -#include -#include -#include - -namespace android { - -/* Implementation type. Nothing to see here. */ -class BasicHashtableImpl { -protected: - struct Bucket { - // The collision flag indicates that the bucket is part of a collision chain - // such that at least two entries both hash to this bucket. When true, we - // may need to seek further along the chain to find the entry. - static const uint32_t COLLISION = 0x80000000UL; - - // The present flag indicates that the bucket contains an initialized entry value. - static const uint32_t PRESENT = 0x40000000UL; - - // Mask for 30 bits worth of the hash code that are stored within the bucket to - // speed up lookups and rehashing by eliminating the need to recalculate the - // hash code of the entry's key. - static const uint32_t HASH_MASK = 0x3fffffffUL; - - // Combined value that stores the collision and present flags as well as - // a 30 bit hash code. - uint32_t cookie; - - // Storage for the entry begins here. - char entry[0]; - }; - - BasicHashtableImpl(size_t entrySize, bool hasTrivialDestructor, - size_t minimumInitialCapacity, float loadFactor); - BasicHashtableImpl(const BasicHashtableImpl& other); - - void dispose(); - - inline void edit() { - if (mBuckets && !SharedBuffer::bufferFromData(mBuckets)->onlyOwner()) { - clone(); - } - } - - void setTo(const BasicHashtableImpl& other); - void clear(); - - ssize_t next(ssize_t index) const; - ssize_t find(ssize_t index, hash_t hash, const void* __restrict__ key) const; - size_t add(hash_t hash, const void* __restrict__ entry); - void removeAt(size_t index); - void rehash(size_t minimumCapacity, float loadFactor); - - const size_t mBucketSize; // number of bytes per bucket including the entry - const bool mHasTrivialDestructor; // true if the entry type does not require destruction - size_t mCapacity; // number of buckets that can be filled before exceeding load factor - float mLoadFactor; // load factor - size_t mSize; // number of elements actually in the table - size_t mFilledBuckets; // number of buckets for which collision or present is true - size_t mBucketCount; // number of slots in the mBuckets array - void* mBuckets; // array of buckets, as a SharedBuffer - - inline const Bucket& bucketAt(const void* __restrict__ buckets, size_t index) const { - return *reinterpret_cast( - static_cast(buckets) + index * mBucketSize); - } - - inline Bucket& bucketAt(void* __restrict__ buckets, size_t index) const { - return *reinterpret_cast(static_cast(buckets) + index * mBucketSize); - } - - virtual bool compareBucketKey(const Bucket& bucket, const void* __restrict__ key) const = 0; - virtual void initializeBucketEntry(Bucket& bucket, const void* __restrict__ entry) const = 0; - virtual void destroyBucketEntry(Bucket& bucket) const = 0; - -private: - void clone(); - - // Allocates a bucket array as a SharedBuffer. - void* allocateBuckets(size_t count) const; - - // Releases a bucket array's associated SharedBuffer. - void releaseBuckets(void* __restrict__ buckets, size_t count) const; - - // Destroys the contents of buckets (invokes destroyBucketEntry for each - // populated bucket if needed). - void destroyBuckets(void* __restrict__ buckets, size_t count) const; - - // Copies the content of buckets (copies the cookie and invokes copyBucketEntry - // for each populated bucket if needed). - void copyBuckets(const void* __restrict__ fromBuckets, - void* __restrict__ toBuckets, size_t count) const; - - // Determines the appropriate size of a bucket array to store a certain minimum - // number of entries and returns its effective capacity. - static void determineCapacity(size_t minimumCapacity, float loadFactor, - size_t* __restrict__ outBucketCount, size_t* __restrict__ outCapacity); - - // Trim a hash code to 30 bits to match what we store in the bucket's cookie. - inline static hash_t trimHash(hash_t hash) { - return (hash & Bucket::HASH_MASK) ^ (hash >> 30); - } - - // Returns the index of the first bucket that is in the collision chain - // for the specified hash code, given the total number of buckets. - // (Primary hash) - inline static size_t chainStart(hash_t hash, size_t count) { - return hash % count; - } - - // Returns the increment to add to a bucket index to seek to the next bucket - // in the collision chain for the specified hash code, given the total number of buckets. - // (Secondary hash) - inline static size_t chainIncrement(hash_t hash, size_t count) { - return ((hash >> 7) | (hash << 25)) % (count - 1) + 1; - } - - // Returns the index of the next bucket that is in the collision chain - // that is defined by the specified increment, given the total number of buckets. - inline static size_t chainSeek(size_t index, size_t increment, size_t count) { - return (index + increment) % count; - } -}; - -/* - * A BasicHashtable stores entries that are indexed by hash code in place - * within an array. The basic operations are finding entries by key, - * adding new entries and removing existing entries. - * - * This class provides a very limited set of operations with simple semantics. - * It is intended to be used as a building block to construct more complex - * and interesting data structures such as HashMap. Think very hard before - * adding anything extra to BasicHashtable, it probably belongs at a - * higher level of abstraction. - * - * TKey: The key type. - * TEntry: The entry type which is what is actually stored in the array. - * - * TKey must support the following contract: - * bool operator==(const TKey& other) const; // return true if equal - * bool operator!=(const TKey& other) const; // return true if unequal - * - * TEntry must support the following contract: - * const TKey& getKey() const; // get the key from the entry - * - * This class supports storing entries with duplicate keys. Of course, it can't - * tell them apart during removal so only the first entry will be removed. - * We do this because it means that operations like add() can't fail. - */ -template -class BasicHashtable : private BasicHashtableImpl { -public: - /* Creates a hashtable with the specified minimum initial capacity. - * The underlying array will be created when the first entry is added. - * - * minimumInitialCapacity: The minimum initial capacity for the hashtable. - * Default is 0. - * loadFactor: The desired load factor for the hashtable, between 0 and 1. - * Default is 0.75. - */ - BasicHashtable(size_t minimumInitialCapacity = 0, float loadFactor = 0.75f); - - /* Copies a hashtable. - * The underlying storage is shared copy-on-write. - */ - BasicHashtable(const BasicHashtable& other); - - /* Clears and destroys the hashtable. - */ - virtual ~BasicHashtable(); - - /* Making this hashtable a copy of the other hashtable. - * The underlying storage is shared copy-on-write. - * - * other: The hashtable to copy. - */ - inline BasicHashtable& operator =(const BasicHashtable & other) { - setTo(other); - return *this; - } - - /* Returns the number of entries in the hashtable. - */ - inline size_t size() const { - return mSize; - } - - /* Returns the capacity of the hashtable, which is the number of elements that can - * added to the hashtable without requiring it to be grown. - */ - inline size_t capacity() const { - return mCapacity; - } - - /* Returns the number of buckets that the hashtable has, which is the size of its - * underlying array. - */ - inline size_t bucketCount() const { - return mBucketCount; - } - - /* Returns the load factor of the hashtable. */ - inline float loadFactor() const { - return mLoadFactor; - }; - - /* Returns a const reference to the entry at the specified index. - * - * index: The index of the entry to retrieve. Must be a valid index within - * the bounds of the hashtable. - */ - inline const TEntry& entryAt(size_t index) const { - return entryFor(bucketAt(mBuckets, index)); - } - - /* Returns a non-const reference to the entry at the specified index. - * - * index: The index of the entry to edit. Must be a valid index within - * the bounds of the hashtable. - */ - inline TEntry& editEntryAt(size_t index) { - edit(); - return entryFor(bucketAt(mBuckets, index)); - } - - /* Clears the hashtable. - * All entries in the hashtable are destroyed immediately. - * If you need to do something special with the entries in the hashtable then iterate - * over them and do what you need before clearing the hashtable. - */ - inline void clear() { - BasicHashtableImpl::clear(); - } - - /* Returns the index of the next entry in the hashtable given the index of a previous entry. - * If the given index is -1, then returns the index of the first entry in the hashtable, - * if there is one, or -1 otherwise. - * If the given index is not -1, then returns the index of the next entry in the hashtable, - * in strictly increasing order, or -1 if there are none left. - * - * index: The index of the previous entry that was iterated, or -1 to begin - * iteration at the beginning of the hashtable. - */ - inline ssize_t next(ssize_t index) const { - return BasicHashtableImpl::next(index); - } - - /* Finds the index of an entry with the specified key. - * If the given index is -1, then returns the index of the first matching entry, - * otherwise returns the index of the next matching entry. - * If the hashtable contains multiple entries with keys that match the requested - * key, then the sequence of entries returned is arbitrary. - * Returns -1 if no entry was found. - * - * index: The index of the previous entry with the specified key, or -1 to - * find the first matching entry. - * hash: The hashcode of the key. - * key: The key. - */ - inline ssize_t find(ssize_t index, hash_t hash, const TKey& key) const { - return BasicHashtableImpl::find(index, hash, &key); - } - - /* Adds the entry to the hashtable. - * Returns the index of the newly added entry. - * If an entry with the same key already exists, then a duplicate entry is added. - * If the entry will not fit, then the hashtable's capacity is increased and - * its contents are rehashed. See rehash(). - * - * hash: The hashcode of the key. - * entry: The entry to add. - */ - inline size_t add(hash_t hash, const TEntry& entry) { - return BasicHashtableImpl::add(hash, &entry); - } - - /* Removes the entry with the specified index from the hashtable. - * The entry is destroyed immediately. - * The index must be valid. - * - * The hashtable is not compacted after an item is removed, so it is legal - * to continue iterating over the hashtable using next() or find(). - * - * index: The index of the entry to remove. Must be a valid index within the - * bounds of the hashtable, and it must refer to an existing entry. - */ - inline void removeAt(size_t index) { - BasicHashtableImpl::removeAt(index); - } - - /* Rehashes the contents of the hashtable. - * Grows the hashtable to at least the specified minimum capacity or the - * current number of elements, whichever is larger. - * - * Rehashing causes all entries to be copied and the entry indices may change. - * Although the hash codes are cached by the hashtable, rehashing can be an - * expensive operation and should be avoided unless the hashtable's size - * needs to be changed. - * - * Rehashing is the only way to change the capacity or load factor of the - * hashtable once it has been created. It can be used to compact the - * hashtable by choosing a minimum capacity that is smaller than the current - * capacity (such as 0). - * - * minimumCapacity: The desired minimum capacity after rehashing. - * loadFactor: The desired load factor after rehashing. - */ - inline void rehash(size_t minimumCapacity, float loadFactor) { - BasicHashtableImpl::rehash(minimumCapacity, loadFactor); - } - -protected: - static inline const TEntry& entryFor(const Bucket& bucket) { - return reinterpret_cast(bucket.entry); - } - - static inline TEntry& entryFor(Bucket& bucket) { - return reinterpret_cast(bucket.entry); - } - - virtual bool compareBucketKey(const Bucket& bucket, const void* __restrict__ key) const; - virtual void initializeBucketEntry(Bucket& bucket, const void* __restrict__ entry) const; - virtual void destroyBucketEntry(Bucket& bucket) const; - -private: - // For dumping the raw contents of a hashtable during testing. - friend class BasicHashtableTest; - inline uint32_t cookieAt(size_t index) const { - return bucketAt(mBuckets, index).cookie; - } -}; - -template -BasicHashtable::BasicHashtable(size_t minimumInitialCapacity, float loadFactor) : - BasicHashtableImpl(sizeof(TEntry), traits::has_trivial_dtor, - minimumInitialCapacity, loadFactor) { -} - -template -BasicHashtable::BasicHashtable(const BasicHashtable& other) : - BasicHashtableImpl(other) { -} - -template -BasicHashtable::~BasicHashtable() { - dispose(); -} - -template -bool BasicHashtable::compareBucketKey(const Bucket& bucket, - const void* __restrict__ key) const { - return entryFor(bucket).getKey() == *static_cast(key); -} - -template -void BasicHashtable::initializeBucketEntry(Bucket& bucket, - const void* __restrict__ entry) const { - if (!traits::has_trivial_copy) { - new (&entryFor(bucket)) TEntry(*(static_cast(entry))); - } else { - memcpy(&entryFor(bucket), entry, sizeof(TEntry)); - } -} - -template -void BasicHashtable::destroyBucketEntry(Bucket& bucket) const { - if (!traits::has_trivial_dtor) { - entryFor(bucket).~TEntry(); - } -} - -}; // namespace android - -#endif // ANDROID_BASIC_HASHTABLE_H diff --git a/external/android/include/16/frameworks/native/include/utils/BitSet.h b/external/android/include/16/frameworks/native/include/utils/BitSet.h deleted file mode 100644 index e189d0c..0000000 --- a/external/android/include/16/frameworks/native/include/utils/BitSet.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 2010 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 UTILS_BITSET_H -#define UTILS_BITSET_H - -#include -#include - -/* - * Contains some bit manipulation helpers. - */ - -namespace android { - -// A simple set of 32 bits that can be individually marked or cleared. -struct BitSet32 { - uint32_t value; - - inline BitSet32() : value(0) { } - explicit inline BitSet32(uint32_t value) : value(value) { } - - // Gets the value associated with a particular bit index. - static inline uint32_t valueForBit(uint32_t n) { return 0x80000000 >> n; } - - // Clears the bit set. - inline void clear() { value = 0; } - - // Returns the number of marked bits in the set. - inline uint32_t count() const { return __builtin_popcount(value); } - - // Returns true if the bit set does not contain any marked bits. - inline bool isEmpty() const { return ! value; } - - // Returns true if the bit set does not contain any unmarked bits. - inline bool isFull() const { return value == 0xffffffff; } - - // Returns true if the specified bit is marked. - inline bool hasBit(uint32_t n) const { return value & valueForBit(n); } - - // Marks the specified bit. - inline void markBit(uint32_t n) { value |= valueForBit(n); } - - // Clears the specified bit. - inline void clearBit(uint32_t n) { value &= ~ valueForBit(n); } - - // Finds the first marked bit in the set. - // Result is undefined if all bits are unmarked. - inline uint32_t firstMarkedBit() const { return __builtin_clz(value); } - - // Finds the first unmarked bit in the set. - // Result is undefined if all bits are marked. - inline uint32_t firstUnmarkedBit() const { return __builtin_clz(~ value); } - - // Finds the last marked bit in the set. - // Result is undefined if all bits are unmarked. - inline uint32_t lastMarkedBit() const { return 31 - __builtin_ctz(value); } - - // Finds the first marked bit in the set and clears it. Returns the bit index. - // Result is undefined if all bits are unmarked. - inline uint32_t clearFirstMarkedBit() { - uint32_t n = firstMarkedBit(); - clearBit(n); - return n; - } - - // Finds the first unmarked bit in the set and marks it. Returns the bit index. - // Result is undefined if all bits are marked. - inline uint32_t markFirstUnmarkedBit() { - uint32_t n = firstUnmarkedBit(); - markBit(n); - return n; - } - - // Finds the last marked bit in the set and clears it. Returns the bit index. - // Result is undefined if all bits are unmarked. - inline uint32_t clearLastMarkedBit() { - uint32_t n = lastMarkedBit(); - clearBit(n); - return n; - } - - // Gets the index of the specified bit in the set, which is the number of - // marked bits that appear before the specified bit. - inline uint32_t getIndexOfBit(uint32_t n) const { - return __builtin_popcount(value & ~(0xffffffffUL >> n)); - } - - inline bool operator== (const BitSet32& other) const { return value == other.value; } - inline bool operator!= (const BitSet32& other) const { return value != other.value; } -}; - -ANDROID_BASIC_TYPES_TRAITS(BitSet32) - -} // namespace android - -#endif // UTILS_BITSET_H diff --git a/external/android/include/16/frameworks/native/include/utils/BlobCache.h b/external/android/include/16/frameworks/native/include/utils/BlobCache.h deleted file mode 100644 index 4f342a2..0000000 --- a/external/android/include/16/frameworks/native/include/utils/BlobCache.h +++ /dev/null @@ -1,251 +0,0 @@ -/* - ** Copyright 2011, 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_BLOB_CACHE_H -#define ANDROID_BLOB_CACHE_H - -#include - -#include -#include -#include -#include - -namespace android { - -// A BlobCache is an in-memory cache for binary key/value pairs. A BlobCache -// does NOT provide any thread-safety guarantees. -// -// The cache contents can be serialized to an in-memory buffer or mmap'd file -// and then reloaded in a subsequent execution of the program. This -// serialization is non-portable and the data should only be used by the device -// that generated it. -class BlobCache : public RefBase, public Flattenable { -public: - - // Create an empty blob cache. The blob cache will cache key/value pairs - // with key and value sizes less than or equal to maxKeySize and - // maxValueSize, respectively. The total combined size of ALL cache entries - // (key sizes plus value sizes) will not exceed maxTotalSize. - BlobCache(size_t maxKeySize, size_t maxValueSize, size_t maxTotalSize); - - // set inserts a new binary value into the cache and associates it with the - // given binary key. If the key or value are too large for the cache then - // the cache remains unchanged. This includes the case where a different - // value was previously associated with the given key - the old value will - // remain in the cache. If the given key and value are small enough to be - // put in the cache (based on the maxKeySize, maxValueSize, and maxTotalSize - // values specified to the BlobCache constructor), then the key/value pair - // will be in the cache after set returns. Note, however, that a subsequent - // call to set may evict old key/value pairs from the cache. - // - // Preconditions: - // key != NULL - // 0 < keySize - // value != NULL - // 0 < valueSize - void set(const void* key, size_t keySize, const void* value, - size_t valueSize); - - // get retrieves from the cache the binary value associated with a given - // binary key. If the key is present in the cache then the length of the - // binary value associated with that key is returned. If the value argument - // is non-NULL and the size of the cached value is less than valueSize bytes - // then the cached value is copied into the buffer pointed to by the value - // argument. If the key is not present in the cache then 0 is returned and - // the buffer pointed to by the value argument is not modified. - // - // Note that when calling get multiple times with the same key, the later - // calls may fail, returning 0, even if earlier calls succeeded. The return - // value must be checked for each call. - // - // Preconditions: - // key != NULL - // 0 < keySize - // 0 <= valueSize - size_t get(const void* key, size_t keySize, void* value, size_t valueSize); - - // getFlattenedSize returns the number of bytes needed to store the entire - // serialized cache. - virtual size_t getFlattenedSize() const; - - // getFdCount returns the number of file descriptors that will result from - // flattening the cache. This will always return 0 so as to allow the - // flattened cache to be saved to disk and then later restored. - virtual size_t getFdCount() const; - - // flatten serializes the current contents of the cache into the memory - // pointed to by 'buffer'. The serialized cache contents can later be - // loaded into a BlobCache object using the unflatten method. The contents - // of the BlobCache object will not be modified. - // - // Preconditions: - // size >= this.getFlattenedSize() - // count == 0 - virtual status_t flatten(void* buffer, size_t size, int fds[], - size_t count) const; - - // unflatten replaces the contents of the cache with the serialized cache - // contents in the memory pointed to by 'buffer'. The previous contents of - // the BlobCache will be evicted from the cache. If an error occurs while - // unflattening the serialized cache contents then the BlobCache will be - // left in an empty state. - // - // Preconditions: - // count == 0 - virtual status_t unflatten(void const* buffer, size_t size, int fds[], - size_t count); - -private: - // Copying is disallowed. - BlobCache(const BlobCache&); - void operator=(const BlobCache&); - - // A random function helper to get around MinGW not having nrand48() - long int blob_random(); - - // clean evicts a randomly chosen set of entries from the cache such that - // the total size of all remaining entries is less than mMaxTotalSize/2. - void clean(); - - // isCleanable returns true if the cache is full enough for the clean method - // to have some effect, and false otherwise. - bool isCleanable() const; - - // A Blob is an immutable sized unstructured data blob. - class Blob : public RefBase { - public: - Blob(const void* data, size_t size, bool copyData); - ~Blob(); - - bool operator<(const Blob& rhs) const; - - const void* getData() const; - size_t getSize() const; - - private: - // Copying is not allowed. - Blob(const Blob&); - void operator=(const Blob&); - - // mData points to the buffer containing the blob data. - const void* mData; - - // mSize is the size of the blob data in bytes. - size_t mSize; - - // mOwnsData indicates whether or not this Blob object should free the - // memory pointed to by mData when the Blob gets destructed. - bool mOwnsData; - }; - - // A CacheEntry is a single key/value pair in the cache. - class CacheEntry { - public: - CacheEntry(); - CacheEntry(const sp& key, const sp& value); - CacheEntry(const CacheEntry& ce); - - bool operator<(const CacheEntry& rhs) const; - const CacheEntry& operator=(const CacheEntry&); - - sp getKey() const; - sp getValue() const; - - void setValue(const sp& value); - - private: - - // mKey is the key that identifies the cache entry. - sp mKey; - - // mValue is the cached data associated with the key. - sp mValue; - }; - - // A Header is the header for the entire BlobCache serialization format. No - // need to make this portable, so we simply write the struct out. - struct Header { - // mMagicNumber is the magic number that identifies the data as - // serialized BlobCache contents. It must always contain 'Blb$'. - uint32_t mMagicNumber; - - // mBlobCacheVersion is the serialization format version. - uint32_t mBlobCacheVersion; - - // mDeviceVersion is the device-specific version of the cache. This can - // be used to invalidate the cache. - uint32_t mDeviceVersion; - - // mNumEntries is number of cache entries following the header in the - // data. - size_t mNumEntries; - }; - - // An EntryHeader is the header for a serialized cache entry. No need to - // make this portable, so we simply write the struct out. Each EntryHeader - // is followed imediately by the key data and then the value data. - // - // The beginning of each serialized EntryHeader is 4-byte aligned, so the - // number of bytes that a serialized cache entry will occupy is: - // - // ((sizeof(EntryHeader) + keySize + valueSize) + 3) & ~3 - // - struct EntryHeader { - // mKeySize is the size of the entry key in bytes. - size_t mKeySize; - - // mValueSize is the size of the entry value in bytes. - size_t mValueSize; - - // mData contains both the key and value data for the cache entry. The - // key comes first followed immediately by the value. - uint8_t mData[]; - }; - - // mMaxKeySize is the maximum key size that will be cached. Calls to - // BlobCache::set with a keySize parameter larger than mMaxKeySize will - // simply not add the key/value pair to the cache. - const size_t mMaxKeySize; - - // mMaxValueSize is the maximum value size that will be cached. Calls to - // BlobCache::set with a valueSize parameter larger than mMaxValueSize will - // simply not add the key/value pair to the cache. - const size_t mMaxValueSize; - - // mMaxTotalSize is the maximum size that all cache entries can occupy. This - // includes space for both keys and values. When a call to BlobCache::set - // would otherwise cause this limit to be exceeded, either the key/value - // pair passed to BlobCache::set will not be cached or other cache entries - // will be evicted from the cache to make room for the new entry. - const size_t mMaxTotalSize; - - // mTotalSize is the total combined size of all keys and values currently in - // the cache. - size_t mTotalSize; - - // mRandState is the pseudo-random number generator state. It is passed to - // nrand48 to generate random numbers when needed. - unsigned short mRandState[3]; - - // mCacheEntries stores all the cache entries that are resident in memory. - // Cache entries are added to it by the 'set' method. - SortedVector mCacheEntries; -}; - -} - -#endif // ANDROID_BLOB_CACHE_H diff --git a/external/android/include/16/frameworks/native/include/utils/BufferedTextOutput.h b/external/android/include/16/frameworks/native/include/utils/BufferedTextOutput.h deleted file mode 100644 index 69c6240..0000000 --- a/external/android/include/16/frameworks/native/include/utils/BufferedTextOutput.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2006 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_BUFFEREDTEXTOUTPUT_H -#define ANDROID_BUFFEREDTEXTOUTPUT_H - -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -class BufferedTextOutput : public TextOutput -{ -public: - //** Flags for constructor */ - enum { - MULTITHREADED = 0x0001 - }; - - BufferedTextOutput(uint32_t flags = 0); - virtual ~BufferedTextOutput(); - - virtual status_t print(const char* txt, size_t len); - virtual void moveIndent(int delta); - - virtual void pushBundle(); - virtual void popBundle(); - -protected: - virtual status_t writeLines(const struct iovec& vec, size_t N) = 0; - -private: - struct BufferState; - struct ThreadState; - - static ThreadState*getThreadState(); - static void threadDestructor(void *st); - - BufferState*getBuffer() const; - - uint32_t mFlags; - const int32_t mSeq; - const int32_t mIndex; - - Mutex mLock; - BufferState* mGlobalState; -}; - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_BUFFEREDTEXTOUTPUT_H diff --git a/external/android/include/16/frameworks/native/include/utils/ByteOrder.h b/external/android/include/16/frameworks/native/include/utils/ByteOrder.h deleted file mode 100644 index baa3a83..0000000 --- a/external/android/include/16/frameworks/native/include/utils/ByteOrder.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2006 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 _LIBS_UTILS_BYTE_ORDER_H -#define _LIBS_UTILS_BYTE_ORDER_H - -#include -#include -#ifdef HAVE_WINSOCK -#include -#else -#include -#endif - -/* - * These macros are like the hton/ntoh byte swapping macros, - * except they allow you to swap to and from the "device" byte - * order. The device byte order is the endianness of the target - * device -- for the ARM CPUs we use today, this is little endian. - * - * Note that the byte swapping functions have not been optimized - * much; performance is currently not an issue for them since the - * intent is to allow us to avoid byte swapping on the device. - */ - -static inline uint32_t android_swap_long(uint32_t v) -{ - return (v<<24) | ((v<<8)&0x00FF0000) | ((v>>8)&0x0000FF00) | (v>>24); -} - -static inline uint16_t android_swap_short(uint16_t v) -{ - return (v<<8) | (v>>8); -} - -#define DEVICE_BYTE_ORDER LITTLE_ENDIAN - -#if BYTE_ORDER == DEVICE_BYTE_ORDER - -#define dtohl(x) (x) -#define dtohs(x) (x) -#define htodl(x) (x) -#define htods(x) (x) - -#else - -#define dtohl(x) (android_swap_long(x)) -#define dtohs(x) (android_swap_short(x)) -#define htodl(x) (android_swap_long(x)) -#define htods(x) (android_swap_short(x)) - -#endif - -#if BYTE_ORDER == LITTLE_ENDIAN -#define fromlel(x) (x) -#define fromles(x) (x) -#define tolel(x) (x) -#define toles(x) (x) -#else -#define fromlel(x) (android_swap_long(x)) -#define fromles(x) (android_swap_short(x)) -#define tolel(x) (android_swap_long(x)) -#define toles(x) (android_swap_short(x)) -#endif - -#endif // _LIBS_UTILS_BYTE_ORDER_H diff --git a/external/android/include/16/frameworks/native/include/utils/CallStack.h b/external/android/include/16/frameworks/native/include/utils/CallStack.h deleted file mode 100644 index 079e20c..0000000 --- a/external/android/include/16/frameworks/native/include/utils/CallStack.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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_CALLSTACK_H -#define ANDROID_CALLSTACK_H - -#include -#include - -#include -#include - -// --------------------------------------------------------------------------- - -namespace android { - -class CallStack -{ -public: - enum { - MAX_DEPTH = 31 - }; - - CallStack(); - CallStack(const CallStack& rhs); - ~CallStack(); - - CallStack& operator = (const CallStack& rhs); - - bool operator == (const CallStack& rhs) const; - bool operator != (const CallStack& rhs) const; - bool operator < (const CallStack& rhs) const; - bool operator >= (const CallStack& rhs) const; - bool operator > (const CallStack& rhs) const; - bool operator <= (const CallStack& rhs) const; - - const void* operator [] (int index) const; - - void clear(); - - void update(int32_t ignoreDepth=1, int32_t maxDepth=MAX_DEPTH); - - // Dump a stack trace to the log - void dump(const char* prefix = 0) const; - - // Return a string (possibly very long) containing the complete stack trace - String8 toString(const char* prefix = 0) const; - - size_t size() const { return mCount; } - -private: - size_t mCount; - backtrace_frame_t mStack[MAX_DEPTH]; -}; - -}; // namespace android - - -// --------------------------------------------------------------------------- - -#endif // ANDROID_CALLSTACK_H diff --git a/external/android/include/16/frameworks/native/include/utils/Compat.h b/external/android/include/16/frameworks/native/include/utils/Compat.h deleted file mode 100644 index 1819266..0000000 --- a/external/android/include/16/frameworks/native/include/utils/Compat.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2010 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 __LIB_UTILS_COMPAT_H -#define __LIB_UTILS_COMPAT_H - -#include - -/* Compatibility definitions for non-Linux (i.e., BSD-based) hosts. */ -#ifndef HAVE_OFF64_T -#if _FILE_OFFSET_BITS < 64 -#error "_FILE_OFFSET_BITS < 64; large files are not supported on this platform" -#endif /* _FILE_OFFSET_BITS < 64 */ - -typedef off_t off64_t; - -static inline off64_t lseek64(int fd, off64_t offset, int whence) { - return lseek(fd, offset, whence); -} - -#ifdef HAVE_PREAD -static inline ssize_t pread64(int fd, void* buf, size_t nbytes, off64_t offset) { - return pread(fd, buf, nbytes, offset); -} -#endif - -#endif /* !HAVE_OFF64_T */ - -#endif /* __LIB_UTILS_COMPAT_H */ diff --git a/external/android/include/16/frameworks/native/include/utils/Condition.h b/external/android/include/16/frameworks/native/include/utils/Condition.h deleted file mode 100644 index 8852d53..0000000 --- a/external/android/include/16/frameworks/native/include/utils/Condition.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * 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 _LIBS_UTILS_CONDITION_H -#define _LIBS_UTILS_CONDITION_H - -#include -#include -#include - -#if defined(HAVE_PTHREADS) -# include -#endif - -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { -// --------------------------------------------------------------------------- - -/* - * Condition variable class. The implementation is system-dependent. - * - * Condition variables are paired up with mutexes. Lock the mutex, - * call wait(), then either re-wait() if things aren't quite what you want, - * or unlock the mutex and continue. All threads calling wait() must - * use the same mutex for a given Condition. - */ -class Condition { -public: - enum { - PRIVATE = 0, - SHARED = 1 - }; - - Condition(); - Condition(int type); - ~Condition(); - // Wait on the condition variable. Lock the mutex before calling. - status_t wait(Mutex& mutex); - // same with relative timeout - status_t waitRelative(Mutex& mutex, nsecs_t reltime); - // Signal the condition variable, allowing one thread to continue. - void signal(); - // Signal the condition variable, allowing all threads to continue. - void broadcast(); - -private: -#if defined(HAVE_PTHREADS) - pthread_cond_t mCond; -#else - void* mState; -#endif -}; - -// --------------------------------------------------------------------------- - -#if defined(HAVE_PTHREADS) - -inline Condition::Condition() { - pthread_cond_init(&mCond, NULL); -} -inline Condition::Condition(int type) { - if (type == SHARED) { - pthread_condattr_t attr; - pthread_condattr_init(&attr); - pthread_condattr_setpshared(&attr, PTHREAD_PROCESS_SHARED); - pthread_cond_init(&mCond, &attr); - pthread_condattr_destroy(&attr); - } else { - pthread_cond_init(&mCond, NULL); - } -} -inline Condition::~Condition() { - pthread_cond_destroy(&mCond); -} -inline status_t Condition::wait(Mutex& mutex) { - return -pthread_cond_wait(&mCond, &mutex.mMutex); -} -inline status_t Condition::waitRelative(Mutex& mutex, nsecs_t reltime) { -#if defined(HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE) - struct timespec ts; - ts.tv_sec = reltime/1000000000; - ts.tv_nsec = reltime%1000000000; - return -pthread_cond_timedwait_relative_np(&mCond, &mutex.mMutex, &ts); -#else // HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE - struct timespec ts; -#if defined(HAVE_POSIX_CLOCKS) - clock_gettime(CLOCK_REALTIME, &ts); -#else // HAVE_POSIX_CLOCKS - // we don't support the clocks here. - struct timeval t; - gettimeofday(&t, NULL); - ts.tv_sec = t.tv_sec; - ts.tv_nsec= t.tv_usec*1000; -#endif // HAVE_POSIX_CLOCKS - ts.tv_sec += reltime/1000000000; - ts.tv_nsec+= reltime%1000000000; - if (ts.tv_nsec >= 1000000000) { - ts.tv_nsec -= 1000000000; - ts.tv_sec += 1; - } - return -pthread_cond_timedwait(&mCond, &mutex.mMutex, &ts); -#endif // HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE -} -inline void Condition::signal() { - pthread_cond_signal(&mCond); -} -inline void Condition::broadcast() { - pthread_cond_broadcast(&mCond); -} - -#endif // HAVE_PTHREADS - -// --------------------------------------------------------------------------- -}; // namespace android -// --------------------------------------------------------------------------- - -#endif // _LIBS_UTILS_CONDITON_H diff --git a/external/android/include/16/frameworks/native/include/utils/Debug.h b/external/android/include/16/frameworks/native/include/utils/Debug.h deleted file mode 100644 index d9ed32d..0000000 --- a/external/android/include/16/frameworks/native/include/utils/Debug.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2005 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_DEBUG_H -#define ANDROID_DEBUG_H - -#include -#include - -namespace android { -// --------------------------------------------------------------------------- - -#ifdef __cplusplus -template struct CompileTimeAssert; -template<> struct CompileTimeAssert {}; -#define COMPILE_TIME_ASSERT(_exp) \ - template class CompileTimeAssert< (_exp) >; -#endif -#define COMPILE_TIME_ASSERT_FUNCTION_SCOPE(_exp) \ - CompileTimeAssert<( _exp )>(); - -// --------------------------------------------------------------------------- - -#ifdef __cplusplus -template struct CompileTimeIfElse; -template -struct CompileTimeIfElse { typedef LHS TYPE; }; -template -struct CompileTimeIfElse { typedef RHS TYPE; }; -#endif - -// --------------------------------------------------------------------------- - -#ifdef __cplusplus -extern "C" { -#endif - -const char* stringForIndent(int32_t indentLevel); - -typedef void (*debugPrintFunc)(void* cookie, const char* txt); - -void printTypeCode(uint32_t typeCode, - debugPrintFunc func = 0, void* cookie = 0); - -void printHexData(int32_t indent, const void *buf, size_t length, - size_t bytesPerLine=16, int32_t singleLineBytesCutoff=16, - size_t alignment=0, bool cArrayStyle=false, - debugPrintFunc func = 0, void* cookie = 0); - -#ifdef __cplusplus -} -#endif - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_DEBUG_H diff --git a/external/android/include/16/frameworks/native/include/utils/Endian.h b/external/android/include/16/frameworks/native/include/utils/Endian.h deleted file mode 100644 index 19f2504..0000000 --- a/external/android/include/16/frameworks/native/include/utils/Endian.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// Android endian-ness defines. -// -#ifndef _LIBS_UTILS_ENDIAN_H -#define _LIBS_UTILS_ENDIAN_H - -#if defined(HAVE_ENDIAN_H) - -#include - -#else /*not HAVE_ENDIAN_H*/ - -#define __BIG_ENDIAN 0x1000 -#define __LITTLE_ENDIAN 0x0001 - -#if defined(HAVE_LITTLE_ENDIAN) -# define __BYTE_ORDER __LITTLE_ENDIAN -#else -# define __BYTE_ORDER __BIG_ENDIAN -#endif - -#endif /*not HAVE_ENDIAN_H*/ - -#endif /*_LIBS_UTILS_ENDIAN_H*/ diff --git a/external/android/include/16/frameworks/native/include/utils/Errors.h b/external/android/include/16/frameworks/native/include/utils/Errors.h deleted file mode 100644 index 0b75b19..0000000 --- a/external/android/include/16/frameworks/native/include/utils/Errors.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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_ERRORS_H -#define ANDROID_ERRORS_H - -#include -#include - -namespace android { - -// use this type to return error codes -#ifdef HAVE_MS_C_RUNTIME -typedef int status_t; -#else -typedef int32_t status_t; -#endif - -/* the MS C runtime lacks a few error codes */ - -/* - * Error codes. - * All error codes are negative values. - */ - -// Win32 #defines NO_ERROR as well. It has the same value, so there's no -// real conflict, though it's a bit awkward. -#ifdef _WIN32 -# undef NO_ERROR -#endif - -enum { - OK = 0, // Everything's swell. - NO_ERROR = 0, // No errors. - - UNKNOWN_ERROR = 0x80000000, - - NO_MEMORY = -ENOMEM, - INVALID_OPERATION = -ENOSYS, - BAD_VALUE = -EINVAL, - BAD_TYPE = 0x80000001, - NAME_NOT_FOUND = -ENOENT, - PERMISSION_DENIED = -EPERM, - NO_INIT = -ENODEV, - ALREADY_EXISTS = -EEXIST, - DEAD_OBJECT = -EPIPE, - FAILED_TRANSACTION = 0x80000002, - JPARKS_BROKE_IT = -EPIPE, -#if !defined(HAVE_MS_C_RUNTIME) - BAD_INDEX = -EOVERFLOW, - NOT_ENOUGH_DATA = -ENODATA, - WOULD_BLOCK = -EWOULDBLOCK, - TIMED_OUT = -ETIMEDOUT, - UNKNOWN_TRANSACTION = -EBADMSG, -#else - BAD_INDEX = -E2BIG, - NOT_ENOUGH_DATA = 0x80000003, - WOULD_BLOCK = 0x80000004, - TIMED_OUT = 0x80000005, - UNKNOWN_TRANSACTION = 0x80000006, -#endif - FDS_NOT_ALLOWED = 0x80000007, -}; - -// Restore define; enumeration is in "android" namespace, so the value defined -// there won't work for Win32 code in a different namespace. -#ifdef _WIN32 -# define NO_ERROR 0L -#endif - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_ERRORS_H diff --git a/external/android/include/16/frameworks/native/include/utils/FileMap.h b/external/android/include/16/frameworks/native/include/utils/FileMap.h deleted file mode 100644 index dfe6d51..0000000 --- a/external/android/include/16/frameworks/native/include/utils/FileMap.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (C) 2006 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. - */ - -// -// Encapsulate a shared file mapping. -// -#ifndef __LIBS_FILE_MAP_H -#define __LIBS_FILE_MAP_H - -#include - -#include - -#ifdef HAVE_WIN32_FILEMAP -#include -#endif - -namespace android { - -/* - * This represents a memory-mapped file. It might be the entire file or - * only part of it. This requires a little bookkeeping because the mapping - * needs to be aligned on page boundaries, and in some cases we'd like to - * have multiple references to the mapped area without creating additional - * maps. - * - * This always uses MAP_SHARED. - * - * TODO: we should be able to create a new FileMap that is a subset of - * an existing FileMap and shares the underlying mapped pages. Requires - * completing the refcounting stuff and possibly introducing the notion - * of a FileMap hierarchy. - */ -class FileMap { -public: - FileMap(void); - - /* - * Create a new mapping on an open file. - * - * Closing the file descriptor does not unmap the pages, so we don't - * claim ownership of the fd. - * - * Returns "false" on failure. - */ - bool create(const char* origFileName, int fd, - off64_t offset, size_t length, bool readOnly); - - /* - * Return the name of the file this map came from, if known. - */ - const char* getFileName(void) const { return mFileName; } - - /* - * Get a pointer to the piece of the file we requested. - */ - void* getDataPtr(void) const { return mDataPtr; } - - /* - * Get the length we requested. - */ - size_t getDataLength(void) const { return mDataLength; } - - /* - * Get the data offset used to create this map. - */ - off64_t getDataOffset(void) const { return mDataOffset; } - - /* - * Get a "copy" of the object. - */ - FileMap* acquire(void) { mRefCount++; return this; } - - /* - * Call this when mapping is no longer needed. - */ - void release(void) { - if (--mRefCount <= 0) - delete this; - } - - /* - * This maps directly to madvise() values, but allows us to avoid - * including everywhere. - */ - enum MapAdvice { - NORMAL, RANDOM, SEQUENTIAL, WILLNEED, DONTNEED - }; - - /* - * Apply an madvise() call to the entire file. - * - * Returns 0 on success, -1 on failure. - */ - int advise(MapAdvice advice); - -protected: - // don't delete objects; call release() - ~FileMap(void); - -private: - // these are not implemented - FileMap(const FileMap& src); - const FileMap& operator=(const FileMap& src); - - int mRefCount; // reference count - char* mFileName; // original file name, if known - void* mBasePtr; // base of mmap area; page aligned - size_t mBaseLength; // length, measured from "mBasePtr" - off64_t mDataOffset; // offset used when map was created - void* mDataPtr; // start of requested data, offset from base - size_t mDataLength; // length, measured from "mDataPtr" -#ifdef HAVE_WIN32_FILEMAP - HANDLE mFileHandle; // Win32 file handle - HANDLE mFileMapping; // Win32 file mapping handle -#endif - - static long mPageSize; -}; - -}; // namespace android - -#endif // __LIBS_FILE_MAP_H diff --git a/external/android/include/16/frameworks/native/include/utils/Flattenable.h b/external/android/include/16/frameworks/native/include/utils/Flattenable.h deleted file mode 100644 index 852be3b..0000000 --- a/external/android/include/16/frameworks/native/include/utils/Flattenable.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2010 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_UTILS_FLATTENABLE_H -#define ANDROID_UTILS_FLATTENABLE_H - - -#include -#include -#include - -namespace android { - -class Flattenable -{ -public: - // size in bytes of the flattened object - virtual size_t getFlattenedSize() const = 0; - - // number of file descriptors to flatten - virtual size_t getFdCount() const = 0; - - // flattens the object into buffer. - // size should be at least of getFlattenedSize() - // file descriptors are written in the fds[] array but ownership is - // not transfered (ie: they must be dupped by the caller of - // flatten() if needed). - virtual status_t flatten(void* buffer, size_t size, - int fds[], size_t count) const = 0; - - // unflattens the object from buffer. - // size should be equal to the value of getFlattenedSize() when the - // object was flattened. - // unflattened file descriptors are found in the fds[] array and - // don't need to be dupped(). ie: the caller of unflatten doesn't - // keep ownership. If a fd is not retained by unflatten() it must be - // explicitly closed. - virtual status_t unflatten(void const* buffer, size_t size, - int fds[], size_t count) = 0; - -protected: - virtual ~Flattenable() = 0; - -}; - -}; // namespace android - - -#endif /* ANDROID_UTILS_FLATTENABLE_H */ diff --git a/external/android/include/16/frameworks/native/include/utils/Functor.h b/external/android/include/16/frameworks/native/include/utils/Functor.h deleted file mode 100644 index e24ded4..0000000 --- a/external/android/include/16/frameworks/native/include/utils/Functor.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2011 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_FUNCTOR_H -#define ANDROID_FUNCTOR_H - -#include - -namespace android { - -class Functor { -public: - Functor() {} - virtual ~Functor() {} - virtual status_t operator ()(int what, void* data) { return NO_ERROR; } -}; - -}; // namespace android - -#endif // ANDROID_FUNCTOR_H diff --git a/external/android/include/16/frameworks/native/include/utils/GenerationCache.h b/external/android/include/16/frameworks/native/include/utils/GenerationCache.h deleted file mode 100644 index 40722d1..0000000 --- a/external/android/include/16/frameworks/native/include/utils/GenerationCache.h +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Copyright (C) 2010 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_UTILS_GENERATION_CACHE_H -#define ANDROID_UTILS_GENERATION_CACHE_H - -#include -#include - -namespace android { - -/** - * GenerationCache callback used when an item is removed - */ -template -class OnEntryRemoved { -public: - virtual ~OnEntryRemoved() { }; - virtual void operator()(EntryKey& key, EntryValue& value) = 0; -}; // class OnEntryRemoved - -template -struct Entry: public LightRefBase > { - Entry(const Entry& e) : - key(e.key), value(e.value), - parent(e.parent), child(e.child) { } - Entry(const EntryKey& key, const EntryValue& value) : - key(key), value(value) { } - - EntryKey key; - EntryValue value; - - sp > parent; // next older entry - sp > child; // next younger entry -}; // struct Entry - -/** - * A LRU type cache - */ -template -class GenerationCache { -public: - GenerationCache(uint32_t maxCapacity); - virtual ~GenerationCache(); - - enum Capacity { - kUnlimitedCapacity, - }; - - void setOnEntryRemovedListener(OnEntryRemoved* listener); - - size_t size() const; - - void clear(); - - bool contains(const K& key) const; - const K& getKeyAt(size_t index) const; - const V& getValueAt(size_t index) const; - - const V& get(const K& key); - bool put(const K& key, const V& value); - - void removeAt(ssize_t index); - bool remove(const K& key); - bool removeOldest(); - -private: - KeyedVector > > mCache; - uint32_t mMaxCapacity; - - OnEntryRemoved* mListener; - - sp > mOldest; - sp > mYoungest; - - void attachToCache(const sp >& entry); - void detachFromCache(const sp >& entry); - - const V mNullValue; -}; // class GenerationCache - -template -GenerationCache::GenerationCache(uint32_t maxCapacity): mMaxCapacity(maxCapacity), - mListener(NULL), mNullValue(NULL) { -}; - -template -GenerationCache::~GenerationCache() { - clear(); -}; - -template -uint32_t GenerationCache::size() const { - return mCache.size(); -} - -/** - * Should be set by the user of the Cache so that the callback is called whenever an item is - * removed from the cache - */ -template -void GenerationCache::setOnEntryRemovedListener(OnEntryRemoved* listener) { - mListener = listener; -} - -template -void GenerationCache::clear() { - if (mListener) { - for (uint32_t i = 0; i < mCache.size(); i++) { - sp > entry = mCache.valueAt(i); - if (mListener) { - (*mListener)(entry->key, entry->value); - } - } - } - mCache.clear(); - mYoungest.clear(); - mOldest.clear(); -} - -template -bool GenerationCache::contains(const K& key) const { - return mCache.indexOfKey(key) >= 0; -} - -template -const K& GenerationCache::getKeyAt(size_t index) const { - return mCache.keyAt(index); -} - -template -const V& GenerationCache::getValueAt(size_t index) const { - return mCache.valueAt(index)->value; -} - -template -const V& GenerationCache::get(const K& key) { - ssize_t index = mCache.indexOfKey(key); - if (index >= 0) { - const sp >& entry = mCache.valueAt(index); - detachFromCache(entry); - attachToCache(entry); - return entry->value; - } - - return mNullValue; -} - -template -bool GenerationCache::put(const K& key, const V& value) { - if (mMaxCapacity != kUnlimitedCapacity && mCache.size() >= mMaxCapacity) { - removeOldest(); - } - - ssize_t index = mCache.indexOfKey(key); - if (index < 0) { - sp > entry = new Entry(key, value); - mCache.add(key, entry); - attachToCache(entry); - return true; - } - - return false; -} - -template -bool GenerationCache::remove(const K& key) { - ssize_t index = mCache.indexOfKey(key); - if (index >= 0) { - removeAt(index); - return true; - } - - return false; -} - -template -void GenerationCache::removeAt(ssize_t index) { - sp > entry = mCache.valueAt(index); - if (mListener) { - (*mListener)(entry->key, entry->value); - } - mCache.removeItemsAt(index, 1); - detachFromCache(entry); -} - -template -bool GenerationCache::removeOldest() { - if (mOldest.get()) { - ssize_t index = mCache.indexOfKey(mOldest->key); - if (index >= 0) { - removeAt(index); - return true; - } - ALOGE("GenerationCache: removeOldest failed to find the item in the cache " - "with the given key, but we know it must be in there. " - "Is the key comparator kaput?"); - } - - return false; -} - -template -void GenerationCache::attachToCache(const sp >& entry) { - if (!mYoungest.get()) { - mYoungest = mOldest = entry; - } else { - entry->parent = mYoungest; - mYoungest->child = entry; - mYoungest = entry; - } -} - -template -void GenerationCache::detachFromCache(const sp >& entry) { - if (entry->parent.get()) { - entry->parent->child = entry->child; - } else { - mOldest = entry->child; - } - - if (entry->child.get()) { - entry->child->parent = entry->parent; - } else { - mYoungest = entry->parent; - } - - entry->parent.clear(); - entry->child.clear(); -} - -}; // namespace android - -#endif // ANDROID_UTILS_GENERATION_CACHE_H diff --git a/external/android/include/16/frameworks/native/include/utils/KeyedVector.h b/external/android/include/16/frameworks/native/include/utils/KeyedVector.h deleted file mode 100644 index 20575ee..0000000 --- a/external/android/include/16/frameworks/native/include/utils/KeyedVector.h +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (C) 2005 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_KEYED_VECTOR_H -#define ANDROID_KEYED_VECTOR_H - -#include -#include -#include - -#include -#include -#include - -// --------------------------------------------------------------------------- - -namespace android { - -template -class KeyedVector -{ -public: - typedef KEY key_type; - typedef VALUE value_type; - - inline KeyedVector(); - - /* - * empty the vector - */ - - inline void clear() { mVector.clear(); } - - /*! - * vector stats - */ - - //! returns number of items in the vector - inline size_t size() const { return mVector.size(); } - //! returns wether or not the vector is empty - inline bool isEmpty() const { return mVector.isEmpty(); } - //! returns how many items can be stored without reallocating the backing store - inline size_t capacity() const { return mVector.capacity(); } - //! setst the capacity. capacity can never be reduced less than size() - inline ssize_t setCapacity(size_t size) { return mVector.setCapacity(size); } - - /*! - * accessors - */ - const VALUE& valueFor(const KEY& key) const; - const VALUE& valueAt(size_t index) const; - const KEY& keyAt(size_t index) const; - ssize_t indexOfKey(const KEY& key) const; - - /*! - * modifying the array - */ - - VALUE& editValueFor(const KEY& key); - VALUE& editValueAt(size_t index); - - /*! - * add/insert/replace items - */ - - ssize_t add(const KEY& key, const VALUE& item); - ssize_t replaceValueFor(const KEY& key, const VALUE& item); - ssize_t replaceValueAt(size_t index, const VALUE& item); - - /*! - * remove items - */ - - ssize_t removeItem(const KEY& key); - ssize_t removeItemsAt(size_t index, size_t count = 1); - -private: - SortedVector< key_value_pair_t > mVector; -}; - -// KeyedVector can be trivially moved using memcpy() because its -// underlying SortedVector can be trivially moved. -template struct trait_trivial_move > { - enum { value = trait_trivial_move > >::value }; -}; - - -// --------------------------------------------------------------------------- - -/** - * Variation of KeyedVector that holds a default value to return when - * valueFor() is called with a key that doesn't exist. - */ -template -class DefaultKeyedVector : public KeyedVector -{ -public: - inline DefaultKeyedVector(const VALUE& defValue = VALUE()); - const VALUE& valueFor(const KEY& key) const; - -private: - VALUE mDefault; -}; - -// --------------------------------------------------------------------------- - -template inline -KeyedVector::KeyedVector() -{ -} - -template inline -ssize_t KeyedVector::indexOfKey(const KEY& key) const { - return mVector.indexOf( key_value_pair_t(key) ); -} - -template inline -const VALUE& KeyedVector::valueFor(const KEY& key) const { - ssize_t i = this->indexOfKey(key); - assert(i>=0); - return mVector.itemAt(i).value; -} - -template inline -const VALUE& KeyedVector::valueAt(size_t index) const { - return mVector.itemAt(index).value; -} - -template inline -const KEY& KeyedVector::keyAt(size_t index) const { - return mVector.itemAt(index).key; -} - -template inline -VALUE& KeyedVector::editValueFor(const KEY& key) { - ssize_t i = this->indexOfKey(key); - assert(i>=0); - return mVector.editItemAt(i).value; -} - -template inline -VALUE& KeyedVector::editValueAt(size_t index) { - return mVector.editItemAt(index).value; -} - -template inline -ssize_t KeyedVector::add(const KEY& key, const VALUE& value) { - return mVector.add( key_value_pair_t(key, value) ); -} - -template inline -ssize_t KeyedVector::replaceValueFor(const KEY& key, const VALUE& value) { - key_value_pair_t pair(key, value); - mVector.remove(pair); - return mVector.add(pair); -} - -template inline -ssize_t KeyedVector::replaceValueAt(size_t index, const VALUE& item) { - if (index inline -ssize_t KeyedVector::removeItem(const KEY& key) { - return mVector.remove(key_value_pair_t(key)); -} - -template inline -ssize_t KeyedVector::removeItemsAt(size_t index, size_t count) { - return mVector.removeItemsAt(index, count); -} - -// --------------------------------------------------------------------------- - -template inline -DefaultKeyedVector::DefaultKeyedVector(const VALUE& defValue) - : mDefault(defValue) -{ -} - -template inline -const VALUE& DefaultKeyedVector::valueFor(const KEY& key) const { - ssize_t i = this->indexOfKey(key); - return i >= 0 ? KeyedVector::valueAt(i) : mDefault; -} - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_KEYED_VECTOR_H diff --git a/external/android/include/16/frameworks/native/include/utils/LinearTransform.h b/external/android/include/16/frameworks/native/include/utils/LinearTransform.h deleted file mode 100644 index 04cb355..0000000 --- a/external/android/include/16/frameworks/native/include/utils/LinearTransform.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2011 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 _LIBS_UTILS_LINEAR_TRANSFORM_H -#define _LIBS_UTILS_LINEAR_TRANSFORM_H - -#include - -namespace android { - -// LinearTransform defines a structure which hold the definition of a -// transformation from single dimensional coordinate system A into coordinate -// system B (and back again). Values in A and in B are 64 bit, the linear -// scale factor is expressed as a rational number using two 32 bit values. -// -// Specifically, let -// f(a) = b -// F(b) = f^-1(b) = a -// then -// -// f(a) = (((a - a_zero) * a_to_b_numer) / a_to_b_denom) + b_zero; -// -// and -// -// F(b) = (((b - b_zero) * a_to_b_denom) / a_to_b_numer) + a_zero; -// -struct LinearTransform { - int64_t a_zero; - int64_t b_zero; - int32_t a_to_b_numer; - uint32_t a_to_b_denom; - - // Transform from A->B - // Returns true on success, or false in the case of a singularity or an - // overflow. - bool doForwardTransform(int64_t a_in, int64_t* b_out) const; - - // Transform from B->A - // Returns true on success, or false in the case of a singularity or an - // overflow. - bool doReverseTransform(int64_t b_in, int64_t* a_out) const; - - // Helpers which will reduce the fraction N/D using Euclid's method. - template static void reduce(T* N, T* D); - static void reduce(int32_t* N, uint32_t* D); -}; - - -} - -#endif // _LIBS_UTILS_LINEAR_TRANSFORM_H diff --git a/external/android/include/16/frameworks/native/include/utils/List.h b/external/android/include/16/frameworks/native/include/utils/List.h deleted file mode 100644 index 403cd7f..0000000 --- a/external/android/include/16/frameworks/native/include/utils/List.h +++ /dev/null @@ -1,332 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// Templated list class. Normally we'd use STL, but we don't have that. -// This class mimics STL's interfaces. -// -// Objects are copied into the list with the '=' operator or with copy- -// construction, so if the compiler's auto-generated versions won't work for -// you, define your own. -// -// The only class you want to use from here is "List". -// -#ifndef _LIBS_UTILS_LIST_H -#define _LIBS_UTILS_LIST_H - -#include -#include - -namespace android { - -/* - * Doubly-linked list. Instantiate with "List myList". - * - * Objects added to the list are copied using the assignment operator, - * so this must be defined. - */ -template -class List -{ -protected: - /* - * One element in the list. - */ - class _Node { - public: - explicit _Node(const T& val) : mVal(val) {} - ~_Node() {} - inline T& getRef() { return mVal; } - inline const T& getRef() const { return mVal; } - inline _Node* getPrev() const { return mpPrev; } - inline _Node* getNext() const { return mpNext; } - inline void setVal(const T& val) { mVal = val; } - inline void setPrev(_Node* ptr) { mpPrev = ptr; } - inline void setNext(_Node* ptr) { mpNext = ptr; } - private: - friend class List; - friend class _ListIterator; - T mVal; - _Node* mpPrev; - _Node* mpNext; - }; - - /* - * Iterator for walking through the list. - */ - - template - struct CONST_ITERATOR { - typedef _Node const * NodePtr; - typedef const TYPE Type; - }; - - template - struct NON_CONST_ITERATOR { - typedef _Node* NodePtr; - typedef TYPE Type; - }; - - template< - typename U, - template class Constness - > - class _ListIterator { - typedef _ListIterator _Iter; - typedef typename Constness::NodePtr _NodePtr; - typedef typename Constness::Type _Type; - - explicit _ListIterator(_NodePtr ptr) : mpNode(ptr) {} - - public: - _ListIterator() {} - _ListIterator(const _Iter& rhs) : mpNode(rhs.mpNode) {} - ~_ListIterator() {} - - // this will handle conversions from iterator to const_iterator - // (and also all convertible iterators) - // Here, in this implementation, the iterators can be converted - // if the nodes can be converted - template explicit - _ListIterator(const V& rhs) : mpNode(rhs.mpNode) {} - - - /* - * Dereference operator. Used to get at the juicy insides. - */ - _Type& operator*() const { return mpNode->getRef(); } - _Type* operator->() const { return &(mpNode->getRef()); } - - /* - * Iterator comparison. - */ - inline bool operator==(const _Iter& right) const { - return mpNode == right.mpNode; } - - inline bool operator!=(const _Iter& right) const { - return mpNode != right.mpNode; } - - /* - * handle comparisons between iterator and const_iterator - */ - template - inline bool operator==(const OTHER& right) const { - return mpNode == right.mpNode; } - - template - inline bool operator!=(const OTHER& right) const { - return mpNode != right.mpNode; } - - /* - * Incr/decr, used to move through the list. - */ - inline _Iter& operator++() { // pre-increment - mpNode = mpNode->getNext(); - return *this; - } - const _Iter operator++(int) { // post-increment - _Iter tmp(*this); - mpNode = mpNode->getNext(); - return tmp; - } - inline _Iter& operator--() { // pre-increment - mpNode = mpNode->getPrev(); - return *this; - } - const _Iter operator--(int) { // post-increment - _Iter tmp(*this); - mpNode = mpNode->getPrev(); - return tmp; - } - - inline _NodePtr getNode() const { return mpNode; } - - _NodePtr mpNode; /* should be private, but older gcc fails */ - private: - friend class List; - }; - -public: - List() { - prep(); - } - List(const List& src) { // copy-constructor - prep(); - insert(begin(), src.begin(), src.end()); - } - virtual ~List() { - clear(); - delete[] (unsigned char*) mpMiddle; - } - - typedef _ListIterator iterator; - typedef _ListIterator const_iterator; - - List& operator=(const List& right); - - /* returns true if the list is empty */ - inline bool empty() const { return mpMiddle->getNext() == mpMiddle; } - - /* return #of elements in list */ - size_t size() const { - return size_t(distance(begin(), end())); - } - - /* - * Return the first element or one past the last element. The - * _Node* we're returning is converted to an "iterator" by a - * constructor in _ListIterator. - */ - inline iterator begin() { - return iterator(mpMiddle->getNext()); - } - inline const_iterator begin() const { - return const_iterator(const_cast<_Node const*>(mpMiddle->getNext())); - } - inline iterator end() { - return iterator(mpMiddle); - } - inline const_iterator end() const { - return const_iterator(const_cast<_Node const*>(mpMiddle)); - } - - /* add the object to the head or tail of the list */ - void push_front(const T& val) { insert(begin(), val); } - void push_back(const T& val) { insert(end(), val); } - - /* insert before the current node; returns iterator at new node */ - iterator insert(iterator posn, const T& val) - { - _Node* newNode = new _Node(val); // alloc & copy-construct - newNode->setNext(posn.getNode()); - newNode->setPrev(posn.getNode()->getPrev()); - posn.getNode()->getPrev()->setNext(newNode); - posn.getNode()->setPrev(newNode); - return iterator(newNode); - } - - /* insert a range of elements before the current node */ - void insert(iterator posn, const_iterator first, const_iterator last) { - for ( ; first != last; ++first) - insert(posn, *first); - } - - /* remove one entry; returns iterator at next node */ - iterator erase(iterator posn) { - _Node* pNext = posn.getNode()->getNext(); - _Node* pPrev = posn.getNode()->getPrev(); - pPrev->setNext(pNext); - pNext->setPrev(pPrev); - delete posn.getNode(); - return iterator(pNext); - } - - /* remove a range of elements */ - iterator erase(iterator first, iterator last) { - while (first != last) - erase(first++); // don't erase than incr later! - return iterator(last); - } - - /* remove all contents of the list */ - void clear() { - _Node* pCurrent = mpMiddle->getNext(); - _Node* pNext; - - while (pCurrent != mpMiddle) { - pNext = pCurrent->getNext(); - delete pCurrent; - pCurrent = pNext; - } - mpMiddle->setPrev(mpMiddle); - mpMiddle->setNext(mpMiddle); - } - - /* - * Measure the distance between two iterators. On exist, "first" - * will be equal to "last". The iterators must refer to the same - * list. - * - * FIXME: This is actually a generic iterator function. It should be a - * template function at the top-level with specializations for things like - * vector<>, which can just do pointer math). Here we limit it to - * _ListIterator of the same type but different constness. - */ - template< - typename U, - template class CL, - template class CR - > - ptrdiff_t distance( - _ListIterator first, _ListIterator last) const - { - ptrdiff_t count = 0; - while (first != last) { - ++first; - ++count; - } - return count; - } - -private: - /* - * I want a _Node but don't need it to hold valid data. More - * to the point, I don't want T's constructor to fire, since it - * might have side-effects or require arguments. So, we do this - * slightly uncouth storage alloc. - */ - void prep() { - mpMiddle = (_Node*) new unsigned char[sizeof(_Node)]; - mpMiddle->setPrev(mpMiddle); - mpMiddle->setNext(mpMiddle); - } - - /* - * This node plays the role of "pointer to head" and "pointer to tail". - * It sits in the middle of a circular list of nodes. The iterator - * runs around the circle until it encounters this one. - */ - _Node* mpMiddle; -}; - -/* - * Assignment operator. - * - * The simplest way to do this would be to clear out the target list and - * fill it with the source. However, we can speed things along by - * re-using existing elements. - */ -template -List& List::operator=(const List& right) -{ - if (this == &right) - return *this; // self-assignment - iterator firstDst = begin(); - iterator lastDst = end(); - const_iterator firstSrc = right.begin(); - const_iterator lastSrc = right.end(); - while (firstSrc != lastSrc && firstDst != lastDst) - *firstDst++ = *firstSrc++; - if (firstSrc == lastSrc) // ran out of elements in source? - erase(firstDst, lastDst); // yes, erase any extras - else - insert(lastDst, firstSrc, lastSrc); // copy remaining over - return *this; -} - -}; // namespace android - -#endif // _LIBS_UTILS_LIST_H diff --git a/external/android/include/16/frameworks/native/include/utils/Log.h b/external/android/include/16/frameworks/native/include/utils/Log.h deleted file mode 100644 index 3c6cc8b..0000000 --- a/external/android/include/16/frameworks/native/include/utils/Log.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// C/C++ logging functions. See the logging documentation for API details. -// -// We'd like these to be available from C code (in case we import some from -// somewhere), so this has a C interface. -// -// The output will be correct when the log file is shared between multiple -// threads and/or multiple processes so long as the operating system -// supports O_APPEND. These calls have mutex-protected data structures -// and so are NOT reentrant. Do not use LOG in a signal handler. -// -#ifndef _LIBS_UTILS_LOG_H -#define _LIBS_UTILS_LOG_H - -#include - -#endif // _LIBS_UTILS_LOG_H diff --git a/external/android/include/16/frameworks/native/include/utils/Looper.h b/external/android/include/16/frameworks/native/include/utils/Looper.h deleted file mode 100644 index d4a0067..0000000 --- a/external/android/include/16/frameworks/native/include/utils/Looper.h +++ /dev/null @@ -1,377 +0,0 @@ -/* - * Copyright (C) 2010 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 UTILS_LOOPER_H -#define UTILS_LOOPER_H - -#include -#include -#include -#include - -#include - -#include - -/* - * Declare a concrete type for the NDK's looper forward declaration. - */ -struct ALooper { -}; - -namespace android { - -/** - * A message that can be posted to a Looper. - */ -struct Message { - Message() : what(0) { } - Message(int what) : what(what) { } - - /* The message type. (interpretation is left up to the handler) */ - int what; -}; - - -/** - * Interface for a Looper message handler. - * - * The Looper holds a strong reference to the message handler whenever it has - * a message to deliver to it. Make sure to call Looper::removeMessages - * to remove any pending messages destined for the handler so that the handler - * can be destroyed. - */ -class MessageHandler : public virtual RefBase { -protected: - virtual ~MessageHandler() { } - -public: - /** - * Handles a message. - */ - virtual void handleMessage(const Message& message) = 0; -}; - - -/** - * A simple proxy that holds a weak reference to a message handler. - */ -class WeakMessageHandler : public MessageHandler { -protected: - virtual ~WeakMessageHandler(); - -public: - WeakMessageHandler(const wp& handler); - virtual void handleMessage(const Message& message); - -private: - wp mHandler; -}; - - -/** - * A looper callback. - */ -class LooperCallback : public virtual RefBase { -protected: - virtual ~LooperCallback() { } - -public: - /** - * Handles a poll event for the given file descriptor. - * It is given the file descriptor it is associated with, - * a bitmask of the poll events that were triggered (typically ALOOPER_EVENT_INPUT), - * and the data pointer that was originally supplied. - * - * Implementations should return 1 to continue receiving callbacks, or 0 - * to have this file descriptor and callback unregistered from the looper. - */ - virtual int handleEvent(int fd, int events, void* data) = 0; -}; - - -/** - * Wraps a ALooper_callbackFunc function pointer. - */ -class SimpleLooperCallback : public LooperCallback { -protected: - virtual ~SimpleLooperCallback(); - -public: - SimpleLooperCallback(ALooper_callbackFunc callback); - virtual int handleEvent(int fd, int events, void* data); - -private: - ALooper_callbackFunc mCallback; -}; - - -/** - * A polling loop that supports monitoring file descriptor events, optionally - * using callbacks. The implementation uses epoll() internally. - * - * A looper can be associated with a thread although there is no requirement that it must be. - */ -class Looper : public ALooper, public RefBase { -protected: - virtual ~Looper(); - -public: - /** - * Creates a looper. - * - * If allowNonCallbaks is true, the looper will allow file descriptors to be - * registered without associated callbacks. This assumes that the caller of - * pollOnce() is prepared to handle callback-less events itself. - */ - Looper(bool allowNonCallbacks); - - /** - * Returns whether this looper instance allows the registration of file descriptors - * using identifiers instead of callbacks. - */ - bool getAllowNonCallbacks() const; - - /** - * Waits for events to be available, with optional timeout in milliseconds. - * Invokes callbacks for all file descriptors on which an event occurred. - * - * If the timeout is zero, returns immediately without blocking. - * If the timeout is negative, waits indefinitely until an event appears. - * - * Returns ALOOPER_POLL_WAKE if the poll was awoken using wake() before - * the timeout expired and no callbacks were invoked and no other file - * descriptors were ready. - * - * Returns ALOOPER_POLL_CALLBACK if one or more callbacks were invoked. - * - * Returns ALOOPER_POLL_TIMEOUT if there was no data before the given - * timeout expired. - * - * Returns ALOOPER_POLL_ERROR if an error occurred. - * - * Returns a value >= 0 containing an identifier if its file descriptor has data - * and it has no callback function (requiring the caller here to handle it). - * In this (and only this) case outFd, outEvents and outData will contain the poll - * events and data associated with the fd, otherwise they will be set to NULL. - * - * This method does not return until it has finished invoking the appropriate callbacks - * for all file descriptors that were signalled. - */ - int pollOnce(int timeoutMillis, int* outFd, int* outEvents, void** outData); - inline int pollOnce(int timeoutMillis) { - return pollOnce(timeoutMillis, NULL, NULL, NULL); - } - - /** - * Like pollOnce(), but performs all pending callbacks until all - * data has been consumed or a file descriptor is available with no callback. - * This function will never return ALOOPER_POLL_CALLBACK. - */ - int pollAll(int timeoutMillis, int* outFd, int* outEvents, void** outData); - inline int pollAll(int timeoutMillis) { - return pollAll(timeoutMillis, NULL, NULL, NULL); - } - - /** - * Wakes the poll asynchronously. - * - * This method can be called on any thread. - * This method returns immediately. - */ - void wake(); - - /** - * Adds a new file descriptor to be polled by the looper. - * If the same file descriptor was previously added, it is replaced. - * - * "fd" is the file descriptor to be added. - * "ident" is an identifier for this event, which is returned from pollOnce(). - * The identifier must be >= 0, or ALOOPER_POLL_CALLBACK if providing a non-NULL callback. - * "events" are the poll events to wake up on. Typically this is ALOOPER_EVENT_INPUT. - * "callback" is the function to call when there is an event on the file descriptor. - * "data" is a private data pointer to supply to the callback. - * - * There are two main uses of this function: - * - * (1) If "callback" is non-NULL, then this function will be called when there is - * data on the file descriptor. It should execute any events it has pending, - * appropriately reading from the file descriptor. The 'ident' is ignored in this case. - * - * (2) If "callback" is NULL, the 'ident' will be returned by ALooper_pollOnce - * when its file descriptor has data available, requiring the caller to take - * care of processing it. - * - * Returns 1 if the file descriptor was added, 0 if the arguments were invalid. - * - * This method can be called on any thread. - * This method may block briefly if it needs to wake the poll. - * - * The callback may either be specified as a bare function pointer or as a smart - * pointer callback object. The smart pointer should be preferred because it is - * easier to avoid races when the callback is removed from a different thread. - * See removeFd() for details. - */ - int addFd(int fd, int ident, int events, ALooper_callbackFunc callback, void* data); - int addFd(int fd, int ident, int events, const sp& callback, void* data); - - /** - * Removes a previously added file descriptor from the looper. - * - * When this method returns, it is safe to close the file descriptor since the looper - * will no longer have a reference to it. However, it is possible for the callback to - * already be running or for it to run one last time if the file descriptor was already - * signalled. Calling code is responsible for ensuring that this case is safely handled. - * For example, if the callback takes care of removing itself during its own execution either - * by returning 0 or by calling this method, then it can be guaranteed to not be invoked - * again at any later time unless registered anew. - * - * A simple way to avoid this problem is to use the version of addFd() that takes - * a sp instead of a bare function pointer. The LooperCallback will - * be released at the appropriate time by the Looper. - * - * Returns 1 if the file descriptor was removed, 0 if none was previously registered. - * - * This method can be called on any thread. - * This method may block briefly if it needs to wake the poll. - */ - int removeFd(int fd); - - /** - * Enqueues a message to be processed by the specified handler. - * - * The handler must not be null. - * This method can be called on any thread. - */ - void sendMessage(const sp& handler, const Message& message); - - /** - * Enqueues a message to be processed by the specified handler after all pending messages - * after the specified delay. - * - * The time delay is specified in uptime nanoseconds. - * The handler must not be null. - * This method can be called on any thread. - */ - void sendMessageDelayed(nsecs_t uptimeDelay, const sp& handler, - const Message& message); - - /** - * Enqueues a message to be processed by the specified handler after all pending messages - * at the specified time. - * - * The time is specified in uptime nanoseconds. - * The handler must not be null. - * This method can be called on any thread. - */ - void sendMessageAtTime(nsecs_t uptime, const sp& handler, - const Message& message); - - /** - * Removes all messages for the specified handler from the queue. - * - * The handler must not be null. - * This method can be called on any thread. - */ - void removeMessages(const sp& handler); - - /** - * Removes all messages of a particular type for the specified handler from the queue. - * - * The handler must not be null. - * This method can be called on any thread. - */ - void removeMessages(const sp& handler, int what); - - /** - * Prepares a looper associated with the calling thread, and returns it. - * If the thread already has a looper, it is returned. Otherwise, a new - * one is created, associated with the thread, and returned. - * - * The opts may be ALOOPER_PREPARE_ALLOW_NON_CALLBACKS or 0. - */ - static sp prepare(int opts); - - /** - * Sets the given looper to be associated with the calling thread. - * If another looper is already associated with the thread, it is replaced. - * - * If "looper" is NULL, removes the currently associated looper. - */ - static void setForThread(const sp& looper); - - /** - * Returns the looper associated with the calling thread, or NULL if - * there is not one. - */ - static sp getForThread(); - -private: - struct Request { - int fd; - int ident; - sp callback; - void* data; - }; - - struct Response { - int events; - Request request; - }; - - struct MessageEnvelope { - MessageEnvelope() : uptime(0) { } - - MessageEnvelope(nsecs_t uptime, const sp handler, - const Message& message) : uptime(uptime), handler(handler), message(message) { - } - - nsecs_t uptime; - sp handler; - Message message; - }; - - const bool mAllowNonCallbacks; // immutable - - int mWakeReadPipeFd; // immutable - int mWakeWritePipeFd; // immutable - Mutex mLock; - - Vector mMessageEnvelopes; // guarded by mLock - bool mSendingMessage; // guarded by mLock - - int mEpollFd; // immutable - - // Locked list of file descriptor monitoring requests. - KeyedVector mRequests; // guarded by mLock - - // This state is only used privately by pollOnce and does not require a lock since - // it runs on a single thread. - Vector mResponses; - size_t mResponseIndex; - nsecs_t mNextMessageUptime; // set to LLONG_MAX when none - - int pollInner(int timeoutMillis); - void awoken(); - void pushResponse(int events, const Request& request); - - static void initTLSKey(); - static void threadDestructor(void *st); -}; - -} // namespace android - -#endif // UTILS_LOOPER_H diff --git a/external/android/include/16/frameworks/native/include/utils/Mutex.h b/external/android/include/16/frameworks/native/include/utils/Mutex.h deleted file mode 100644 index de6fb39..0000000 --- a/external/android/include/16/frameworks/native/include/utils/Mutex.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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 _LIBS_UTILS_MUTEX_H -#define _LIBS_UTILS_MUTEX_H - -#include -#include -#include - -#if defined(HAVE_PTHREADS) -# include -#endif - -#include - -// --------------------------------------------------------------------------- -namespace android { -// --------------------------------------------------------------------------- - -class Condition; - -/* - * Simple mutex class. The implementation is system-dependent. - * - * The mutex must be unlocked by the thread that locked it. They are not - * recursive, i.e. the same thread can't lock it multiple times. - */ -class Mutex { -public: - enum { - PRIVATE = 0, - SHARED = 1 - }; - - Mutex(); - Mutex(const char* name); - Mutex(int type, const char* name = NULL); - ~Mutex(); - - // lock or unlock the mutex - status_t lock(); - void unlock(); - - // lock if possible; returns 0 on success, error otherwise - status_t tryLock(); - - // Manages the mutex automatically. It'll be locked when Autolock is - // constructed and released when Autolock goes out of scope. - class Autolock { - public: - inline Autolock(Mutex& mutex) : mLock(mutex) { mLock.lock(); } - inline Autolock(Mutex* mutex) : mLock(*mutex) { mLock.lock(); } - inline ~Autolock() { mLock.unlock(); } - private: - Mutex& mLock; - }; - -private: - friend class Condition; - - // A mutex cannot be copied - Mutex(const Mutex&); - Mutex& operator = (const Mutex&); - -#if defined(HAVE_PTHREADS) - pthread_mutex_t mMutex; -#else - void _init(); - void* mState; -#endif -}; - -// --------------------------------------------------------------------------- - -#if defined(HAVE_PTHREADS) - -inline Mutex::Mutex() { - pthread_mutex_init(&mMutex, NULL); -} -inline Mutex::Mutex(const char* name) { - pthread_mutex_init(&mMutex, NULL); -} -inline Mutex::Mutex(int type, const char* name) { - if (type == SHARED) { - pthread_mutexattr_t attr; - pthread_mutexattr_init(&attr); - pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED); - pthread_mutex_init(&mMutex, &attr); - pthread_mutexattr_destroy(&attr); - } else { - pthread_mutex_init(&mMutex, NULL); - } -} -inline Mutex::~Mutex() { - pthread_mutex_destroy(&mMutex); -} -inline status_t Mutex::lock() { - return -pthread_mutex_lock(&mMutex); -} -inline void Mutex::unlock() { - pthread_mutex_unlock(&mMutex); -} -inline status_t Mutex::tryLock() { - return -pthread_mutex_trylock(&mMutex); -} - -#endif // HAVE_PTHREADS - -// --------------------------------------------------------------------------- - -/* - * Automatic mutex. Declare one of these at the top of a function. - * When the function returns, it will go out of scope, and release the - * mutex. - */ - -typedef Mutex::Autolock AutoMutex; - -// --------------------------------------------------------------------------- -}; // namespace android -// --------------------------------------------------------------------------- - -#endif // _LIBS_UTILS_MUTEX_H diff --git a/external/android/include/16/frameworks/native/include/utils/PropertyMap.h b/external/android/include/16/frameworks/native/include/utils/PropertyMap.h deleted file mode 100644 index a9e674f..0000000 --- a/external/android/include/16/frameworks/native/include/utils/PropertyMap.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (C) 2010 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 _UTILS_PROPERTY_MAP_H -#define _UTILS_PROPERTY_MAP_H - -#include -#include -#include -#include - -namespace android { - -/* - * Provides a mechanism for passing around string-based property key / value pairs - * and loading them from property files. - * - * The property files have the following simple structure: - * - * # Comment - * key = value - * - * Keys and values are any sequence of printable ASCII characters. - * The '=' separates the key from the value. - * The key and value may not contain whitespace. - * - * The '\' character is reserved for escape sequences and is not currently supported. - * The '"" character is reserved for quoting and is not currently supported. - * Files that contain the '\' or '"' character will fail to parse. - * - * The file must not contain duplicate keys. - * - * TODO Support escape sequences and quoted values when needed. - */ -class PropertyMap { -public: - /* Creates an empty property map. */ - PropertyMap(); - ~PropertyMap(); - - /* Clears the property map. */ - void clear(); - - /* Adds a property. - * Replaces the property with the same key if it is already present. - */ - void addProperty(const String8& key, const String8& value); - - /* Returns true if the property map contains the specified key. */ - bool hasProperty(const String8& key) const; - - /* Gets the value of a property and parses it. - * Returns true and sets outValue if the key was found and its value was parsed successfully. - * Otherwise returns false and does not modify outValue. (Also logs a warning.) - */ - bool tryGetProperty(const String8& key, String8& outValue) const; - bool tryGetProperty(const String8& key, bool& outValue) const; - bool tryGetProperty(const String8& key, int32_t& outValue) const; - bool tryGetProperty(const String8& key, float& outValue) const; - - /* Adds all values from the specified property map. */ - void addAll(const PropertyMap* map); - - /* Gets the underlying property map. */ - inline const KeyedVector& getProperties() const { return mProperties; } - - /* Loads a property map from a file. */ - static status_t load(const String8& filename, PropertyMap** outMap); - -private: - class Parser { - PropertyMap* mMap; - Tokenizer* mTokenizer; - - public: - Parser(PropertyMap* map, Tokenizer* tokenizer); - ~Parser(); - status_t parse(); - - private: - status_t parseType(); - status_t parseKey(); - status_t parseKeyProperty(); - status_t parseModifier(const String8& token, int32_t* outMetaState); - status_t parseCharacterLiteral(char16_t* outCharacter); - }; - - KeyedVector mProperties; -}; - -} // namespace android - -#endif // _UTILS_PROPERTY_MAP_H diff --git a/external/android/include/16/frameworks/native/include/utils/RWLock.h b/external/android/include/16/frameworks/native/include/utils/RWLock.h deleted file mode 100644 index a5abea2..0000000 --- a/external/android/include/16/frameworks/native/include/utils/RWLock.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * 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 _LIBS_UTILS_RWLOCK_H -#define _LIBS_UTILS_RWLOCK_H - -#include -#include - -#if defined(HAVE_PTHREADS) -# include -#endif - -#include -#include - -// --------------------------------------------------------------------------- -namespace android { -// --------------------------------------------------------------------------- - -#if defined(HAVE_PTHREADS) - -/* - * Simple mutex class. The implementation is system-dependent. - * - * The mutex must be unlocked by the thread that locked it. They are not - * recursive, i.e. the same thread can't lock it multiple times. - */ -class RWLock { -public: - enum { - PRIVATE = 0, - SHARED = 1 - }; - - RWLock(); - RWLock(const char* name); - RWLock(int type, const char* name = NULL); - ~RWLock(); - - status_t readLock(); - status_t tryReadLock(); - status_t writeLock(); - status_t tryWriteLock(); - void unlock(); - - class AutoRLock { - public: - inline AutoRLock(RWLock& rwlock) : mLock(rwlock) { mLock.readLock(); } - inline ~AutoRLock() { mLock.unlock(); } - private: - RWLock& mLock; - }; - - class AutoWLock { - public: - inline AutoWLock(RWLock& rwlock) : mLock(rwlock) { mLock.writeLock(); } - inline ~AutoWLock() { mLock.unlock(); } - private: - RWLock& mLock; - }; - -private: - // A RWLock cannot be copied - RWLock(const RWLock&); - RWLock& operator = (const RWLock&); - - pthread_rwlock_t mRWLock; -}; - -inline RWLock::RWLock() { - pthread_rwlock_init(&mRWLock, NULL); -} -inline RWLock::RWLock(const char* name) { - pthread_rwlock_init(&mRWLock, NULL); -} -inline RWLock::RWLock(int type, const char* name) { - if (type == SHARED) { - pthread_rwlockattr_t attr; - pthread_rwlockattr_init(&attr); - pthread_rwlockattr_setpshared(&attr, PTHREAD_PROCESS_SHARED); - pthread_rwlock_init(&mRWLock, &attr); - pthread_rwlockattr_destroy(&attr); - } else { - pthread_rwlock_init(&mRWLock, NULL); - } -} -inline RWLock::~RWLock() { - pthread_rwlock_destroy(&mRWLock); -} -inline status_t RWLock::readLock() { - return -pthread_rwlock_rdlock(&mRWLock); -} -inline status_t RWLock::tryReadLock() { - return -pthread_rwlock_tryrdlock(&mRWLock); -} -inline status_t RWLock::writeLock() { - return -pthread_rwlock_wrlock(&mRWLock); -} -inline status_t RWLock::tryWriteLock() { - return -pthread_rwlock_trywrlock(&mRWLock); -} -inline void RWLock::unlock() { - pthread_rwlock_unlock(&mRWLock); -} - -#endif // HAVE_PTHREADS - -// --------------------------------------------------------------------------- -}; // namespace android -// --------------------------------------------------------------------------- - -#endif // _LIBS_UTILS_RWLOCK_H diff --git a/external/android/include/16/frameworks/native/include/utils/RefBase.h b/external/android/include/16/frameworks/native/include/utils/RefBase.h deleted file mode 100644 index 99f5182..0000000 --- a/external/android/include/16/frameworks/native/include/utils/RefBase.h +++ /dev/null @@ -1,529 +0,0 @@ -/* - * Copyright (C) 2005 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_REF_BASE_H -#define ANDROID_REF_BASE_H - -#include - -#include -#include -#include -#include - -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -class TextOutput; -TextOutput& printWeakPointer(TextOutput& to, const void* val); - -// --------------------------------------------------------------------------- - -#define COMPARE_WEAK(_op_) \ -inline bool operator _op_ (const sp& o) const { \ - return m_ptr _op_ o.m_ptr; \ -} \ -inline bool operator _op_ (const T* o) const { \ - return m_ptr _op_ o; \ -} \ -template \ -inline bool operator _op_ (const sp& o) const { \ - return m_ptr _op_ o.m_ptr; \ -} \ -template \ -inline bool operator _op_ (const U* o) const { \ - return m_ptr _op_ o; \ -} - -// --------------------------------------------------------------------------- -class ReferenceMover; -class ReferenceConverterBase { -public: - virtual size_t getReferenceTypeSize() const = 0; - virtual void* getReferenceBase(void const*) const = 0; - inline virtual ~ReferenceConverterBase() { } -}; - -// --------------------------------------------------------------------------- - -class RefBase -{ -public: - void incStrong(const void* id) const; - void decStrong(const void* id) const; - - void forceIncStrong(const void* id) const; - - //! DEBUGGING ONLY: Get current strong ref count. - int32_t getStrongCount() const; - - class weakref_type - { - public: - RefBase* refBase() const; - - void incWeak(const void* id); - void decWeak(const void* id); - - // acquires a strong reference if there is already one. - bool attemptIncStrong(const void* id); - - // acquires a weak reference if there is already one. - // This is not always safe. see ProcessState.cpp and BpBinder.cpp - // for proper use. - bool attemptIncWeak(const void* id); - - //! DEBUGGING ONLY: Get current weak ref count. - int32_t getWeakCount() const; - - //! DEBUGGING ONLY: Print references held on object. - void printRefs() const; - - //! DEBUGGING ONLY: Enable tracking for this object. - // enable -- enable/disable tracking - // retain -- when tracking is enable, if true, then we save a stack trace - // for each reference and dereference; when retain == false, we - // match up references and dereferences and keep only the - // outstanding ones. - - void trackMe(bool enable, bool retain); - }; - - weakref_type* createWeak(const void* id) const; - - weakref_type* getWeakRefs() const; - - //! DEBUGGING ONLY: Print references held on object. - inline void printRefs() const { getWeakRefs()->printRefs(); } - - //! DEBUGGING ONLY: Enable tracking of object. - inline void trackMe(bool enable, bool retain) - { - getWeakRefs()->trackMe(enable, retain); - } - - typedef RefBase basetype; - -protected: - RefBase(); - virtual ~RefBase(); - - //! Flags for extendObjectLifetime() - enum { - OBJECT_LIFETIME_STRONG = 0x0000, - OBJECT_LIFETIME_WEAK = 0x0001, - OBJECT_LIFETIME_MASK = 0x0001 - }; - - void extendObjectLifetime(int32_t mode); - - //! Flags for onIncStrongAttempted() - enum { - FIRST_INC_STRONG = 0x0001 - }; - - virtual void onFirstRef(); - virtual void onLastStrongRef(const void* id); - virtual bool onIncStrongAttempted(uint32_t flags, const void* id); - virtual void onLastWeakRef(const void* id); - -private: - friend class ReferenceMover; - static void moveReferences(void* d, void const* s, size_t n, - const ReferenceConverterBase& caster); - -private: - friend class weakref_type; - class weakref_impl; - - RefBase(const RefBase& o); - RefBase& operator=(const RefBase& o); - - weakref_impl* const mRefs; -}; - -// --------------------------------------------------------------------------- - -template -class LightRefBase -{ -public: - inline LightRefBase() : mCount(0) { } - inline void incStrong(const void* id) const { - android_atomic_inc(&mCount); - } - inline void decStrong(const void* id) const { - if (android_atomic_dec(&mCount) == 1) { - delete static_cast(this); - } - } - //! DEBUGGING ONLY: Get current strong ref count. - inline int32_t getStrongCount() const { - return mCount; - } - - typedef LightRefBase basetype; - -protected: - inline ~LightRefBase() { } - -private: - friend class ReferenceMover; - inline static void moveReferences(void* d, void const* s, size_t n, - const ReferenceConverterBase& caster) { } - -private: - mutable volatile int32_t mCount; -}; - -// --------------------------------------------------------------------------- - -template -class wp -{ -public: - typedef typename RefBase::weakref_type weakref_type; - - inline wp() : m_ptr(0) { } - - wp(T* other); - wp(const wp& other); - wp(const sp& other); - template wp(U* other); - template wp(const sp& other); - template wp(const wp& other); - - ~wp(); - - // Assignment - - wp& operator = (T* other); - wp& operator = (const wp& other); - wp& operator = (const sp& other); - - template wp& operator = (U* other); - template wp& operator = (const wp& other); - template wp& operator = (const sp& other); - - void set_object_and_refs(T* other, weakref_type* refs); - - // promotion to sp - - sp promote() const; - - // Reset - - void clear(); - - // Accessors - - inline weakref_type* get_refs() const { return m_refs; } - - inline T* unsafe_get() const { return m_ptr; } - - // Operators - - COMPARE_WEAK(==) - COMPARE_WEAK(!=) - COMPARE_WEAK(>) - COMPARE_WEAK(<) - COMPARE_WEAK(<=) - COMPARE_WEAK(>=) - - inline bool operator == (const wp& o) const { - return (m_ptr == o.m_ptr) && (m_refs == o.m_refs); - } - template - inline bool operator == (const wp& o) const { - return m_ptr == o.m_ptr; - } - - inline bool operator > (const wp& o) const { - return (m_ptr == o.m_ptr) ? (m_refs > o.m_refs) : (m_ptr > o.m_ptr); - } - template - inline bool operator > (const wp& o) const { - return (m_ptr == o.m_ptr) ? (m_refs > o.m_refs) : (m_ptr > o.m_ptr); - } - - inline bool operator < (const wp& o) const { - return (m_ptr == o.m_ptr) ? (m_refs < o.m_refs) : (m_ptr < o.m_ptr); - } - template - inline bool operator < (const wp& o) const { - return (m_ptr == o.m_ptr) ? (m_refs < o.m_refs) : (m_ptr < o.m_ptr); - } - inline bool operator != (const wp& o) const { return m_refs != o.m_refs; } - template inline bool operator != (const wp& o) const { return !operator == (o); } - inline bool operator <= (const wp& o) const { return !operator > (o); } - template inline bool operator <= (const wp& o) const { return !operator > (o); } - inline bool operator >= (const wp& o) const { return !operator < (o); } - template inline bool operator >= (const wp& o) const { return !operator < (o); } - -private: - template friend class sp; - template friend class wp; - - T* m_ptr; - weakref_type* m_refs; -}; - -template -TextOutput& operator<<(TextOutput& to, const wp& val); - -#undef COMPARE_WEAK - -// --------------------------------------------------------------------------- -// No user serviceable parts below here. - -template -wp::wp(T* other) - : m_ptr(other) -{ - if (other) m_refs = other->createWeak(this); -} - -template -wp::wp(const wp& other) - : m_ptr(other.m_ptr), m_refs(other.m_refs) -{ - if (m_ptr) m_refs->incWeak(this); -} - -template -wp::wp(const sp& other) - : m_ptr(other.m_ptr) -{ - if (m_ptr) { - m_refs = m_ptr->createWeak(this); - } -} - -template template -wp::wp(U* other) - : m_ptr(other) -{ - if (other) m_refs = other->createWeak(this); -} - -template template -wp::wp(const wp& other) - : m_ptr(other.m_ptr) -{ - if (m_ptr) { - m_refs = other.m_refs; - m_refs->incWeak(this); - } -} - -template template -wp::wp(const sp& other) - : m_ptr(other.m_ptr) -{ - if (m_ptr) { - m_refs = m_ptr->createWeak(this); - } -} - -template -wp::~wp() -{ - if (m_ptr) m_refs->decWeak(this); -} - -template -wp& wp::operator = (T* other) -{ - weakref_type* newRefs = - other ? other->createWeak(this) : 0; - if (m_ptr) m_refs->decWeak(this); - m_ptr = other; - m_refs = newRefs; - return *this; -} - -template -wp& wp::operator = (const wp& other) -{ - weakref_type* otherRefs(other.m_refs); - T* otherPtr(other.m_ptr); - if (otherPtr) otherRefs->incWeak(this); - if (m_ptr) m_refs->decWeak(this); - m_ptr = otherPtr; - m_refs = otherRefs; - return *this; -} - -template -wp& wp::operator = (const sp& other) -{ - weakref_type* newRefs = - other != NULL ? other->createWeak(this) : 0; - T* otherPtr(other.m_ptr); - if (m_ptr) m_refs->decWeak(this); - m_ptr = otherPtr; - m_refs = newRefs; - return *this; -} - -template template -wp& wp::operator = (U* other) -{ - weakref_type* newRefs = - other ? other->createWeak(this) : 0; - if (m_ptr) m_refs->decWeak(this); - m_ptr = other; - m_refs = newRefs; - return *this; -} - -template template -wp& wp::operator = (const wp& other) -{ - weakref_type* otherRefs(other.m_refs); - U* otherPtr(other.m_ptr); - if (otherPtr) otherRefs->incWeak(this); - if (m_ptr) m_refs->decWeak(this); - m_ptr = otherPtr; - m_refs = otherRefs; - return *this; -} - -template template -wp& wp::operator = (const sp& other) -{ - weakref_type* newRefs = - other != NULL ? other->createWeak(this) : 0; - U* otherPtr(other.m_ptr); - if (m_ptr) m_refs->decWeak(this); - m_ptr = otherPtr; - m_refs = newRefs; - return *this; -} - -template -void wp::set_object_and_refs(T* other, weakref_type* refs) -{ - if (other) refs->incWeak(this); - if (m_ptr) m_refs->decWeak(this); - m_ptr = other; - m_refs = refs; -} - -template -sp wp::promote() const -{ - sp result; - if (m_ptr && m_refs->attemptIncStrong(&result)) { - result.set_pointer(m_ptr); - } - return result; -} - -template -void wp::clear() -{ - if (m_ptr) { - m_refs->decWeak(this); - m_ptr = 0; - } -} - -template -inline TextOutput& operator<<(TextOutput& to, const wp& val) -{ - return printWeakPointer(to, val.unsafe_get()); -} - -// --------------------------------------------------------------------------- - -// this class just serves as a namespace so TYPE::moveReferences can stay -// private. - -class ReferenceMover { - // StrongReferenceCast and WeakReferenceCast do the impedance matching - // between the generic (void*) implementation in Refbase and the strongly typed - // template specializations below. - - template - struct StrongReferenceCast : public ReferenceConverterBase { - virtual size_t getReferenceTypeSize() const { return sizeof( sp ); } - virtual void* getReferenceBase(void const* p) const { - sp const* sptr(reinterpret_cast const*>(p)); - return static_cast(sptr->get()); - } - }; - - template - struct WeakReferenceCast : public ReferenceConverterBase { - virtual size_t getReferenceTypeSize() const { return sizeof( wp ); } - virtual void* getReferenceBase(void const* p) const { - wp const* sptr(reinterpret_cast const*>(p)); - return static_cast(sptr->unsafe_get()); - } - }; - -public: - template static inline - void move_references(sp* d, sp const* s, size_t n) { - memmove(d, s, n*sizeof(sp)); - StrongReferenceCast caster; - TYPE::moveReferences(d, s, n, caster); - } - template static inline - void move_references(wp* d, wp const* s, size_t n) { - memmove(d, s, n*sizeof(wp)); - WeakReferenceCast caster; - TYPE::moveReferences(d, s, n, caster); - } -}; - -// specialization for moving sp<> and wp<> types. -// these are used by the [Sorted|Keyed]Vector<> implementations -// sp<> and wp<> need to be handled specially, because they do not -// have trivial copy operation in the general case (see RefBase.cpp -// when DEBUG ops are enabled), but can be implemented very -// efficiently in most cases. - -template inline -void move_forward_type(sp* d, sp const* s, size_t n) { - ReferenceMover::move_references(d, s, n); -} - -template inline -void move_backward_type(sp* d, sp const* s, size_t n) { - ReferenceMover::move_references(d, s, n); -} - -template inline -void move_forward_type(wp* d, wp const* s, size_t n) { - ReferenceMover::move_references(d, s, n); -} - -template inline -void move_backward_type(wp* d, wp const* s, size_t n) { - ReferenceMover::move_references(d, s, n); -} - - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_REF_BASE_H diff --git a/external/android/include/16/frameworks/native/include/utils/SharedBuffer.h b/external/android/include/16/frameworks/native/include/utils/SharedBuffer.h deleted file mode 100644 index 24508b0..0000000 --- a/external/android/include/16/frameworks/native/include/utils/SharedBuffer.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (C) 2005 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_SHARED_BUFFER_H -#define ANDROID_SHARED_BUFFER_H - -#include -#include - -// --------------------------------------------------------------------------- - -namespace android { - -class SharedBuffer -{ -public: - - /* flags to use with release() */ - enum { - eKeepStorage = 0x00000001 - }; - - /*! allocate a buffer of size 'size' and acquire() it. - * call release() to free it. - */ - static SharedBuffer* alloc(size_t size); - - /*! free the memory associated with the SharedBuffer. - * Fails if there are any users associated with this SharedBuffer. - * In other words, the buffer must have been release by all its - * users. - */ - static ssize_t dealloc(const SharedBuffer* released); - - //! get the SharedBuffer from the data pointer - static inline const SharedBuffer* sharedBuffer(const void* data); - - //! access the data for read - inline const void* data() const; - - //! access the data for read/write - inline void* data(); - - //! get size of the buffer - inline size_t size() const; - - //! get back a SharedBuffer object from its data - static inline SharedBuffer* bufferFromData(void* data); - - //! get back a SharedBuffer object from its data - static inline const SharedBuffer* bufferFromData(const void* data); - - //! get the size of a SharedBuffer object from its data - static inline size_t sizeFromData(const void* data); - - //! edit the buffer (get a writtable, or non-const, version of it) - SharedBuffer* edit() const; - - //! edit the buffer, resizing if needed - SharedBuffer* editResize(size_t size) const; - - //! like edit() but fails if a copy is required - SharedBuffer* attemptEdit() const; - - //! resize and edit the buffer, loose it's content. - SharedBuffer* reset(size_t size) const; - - //! acquire/release a reference on this buffer - void acquire() const; - - /*! release a reference on this buffer, with the option of not - * freeing the memory associated with it if it was the last reference - * returns the previous reference count - */ - int32_t release(uint32_t flags = 0) const; - - //! returns wether or not we're the only owner - inline bool onlyOwner() const; - - -private: - inline SharedBuffer() { } - inline ~SharedBuffer() { } - inline SharedBuffer(const SharedBuffer&); - - // 16 bytes. must be sized to preserve correct alingment. - mutable int32_t mRefs; - size_t mSize; - uint32_t mReserved[2]; -}; - -// --------------------------------------------------------------------------- - -const SharedBuffer* SharedBuffer::sharedBuffer(const void* data) { - return data ? reinterpret_cast(data)-1 : 0; -} - -const void* SharedBuffer::data() const { - return this + 1; -} - -void* SharedBuffer::data() { - return this + 1; -} - -size_t SharedBuffer::size() const { - return mSize; -} - -SharedBuffer* SharedBuffer::bufferFromData(void* data) -{ - return ((SharedBuffer*)data)-1; -} - -const SharedBuffer* SharedBuffer::bufferFromData(const void* data) -{ - return ((const SharedBuffer*)data)-1; -} - -size_t SharedBuffer::sizeFromData(const void* data) -{ - return (((const SharedBuffer*)data)-1)->mSize; -} - -bool SharedBuffer::onlyOwner() const { - return (mRefs == 1); -} - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_VECTOR_H diff --git a/external/android/include/16/frameworks/native/include/utils/Singleton.h b/external/android/include/16/frameworks/native/include/utils/Singleton.h deleted file mode 100644 index a42ce21..0000000 --- a/external/android/include/16/frameworks/native/include/utils/Singleton.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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_UTILS_SINGLETON_H -#define ANDROID_UTILS_SINGLETON_H - -#include -#include -#include -#include - -namespace android { -// --------------------------------------------------------------------------- - -template -class ANDROID_API Singleton -{ -public: - static TYPE& getInstance() { - Mutex::Autolock _l(sLock); - TYPE* instance = sInstance; - if (instance == 0) { - instance = new TYPE(); - sInstance = instance; - } - return *instance; - } - - static bool hasInstance() { - Mutex::Autolock _l(sLock); - return sInstance != 0; - } - -protected: - ~Singleton() { }; - Singleton() { }; - -private: - Singleton(const Singleton&); - Singleton& operator = (const Singleton&); - static Mutex sLock; - static TYPE* sInstance; -}; - -/* - * use ANDROID_SINGLETON_STATIC_INSTANCE(TYPE) in your implementation file - * (eg: .cpp) to create the static instance of Singleton<>'s attributes, - * and avoid to have a copy of them in each compilation units Singleton - * is used. - * NOTE: we use a version of Mutex ctor that takes a parameter, because - * for some unknown reason using the default ctor doesn't emit the variable! - */ - -#define ANDROID_SINGLETON_STATIC_INSTANCE(TYPE) \ - template class Singleton< TYPE >; \ - template<> Mutex Singleton< TYPE >::sLock(Mutex::PRIVATE); \ - template<> TYPE* Singleton< TYPE >::sInstance(0); - - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_UTILS_SINGLETON_H - diff --git a/external/android/include/16/frameworks/native/include/utils/SortedVector.h b/external/android/include/16/frameworks/native/include/utils/SortedVector.h deleted file mode 100644 index 2445525..0000000 --- a/external/android/include/16/frameworks/native/include/utils/SortedVector.h +++ /dev/null @@ -1,286 +0,0 @@ -/* - * Copyright (C) 2005 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_SORTED_VECTOR_H -#define ANDROID_SORTED_VECTOR_H - -#include -#include -#include - -#include -#include -#include - -// --------------------------------------------------------------------------- - -namespace android { - -template -class SortedVector : private SortedVectorImpl -{ - friend class Vector; - -public: - typedef TYPE value_type; - - /*! - * Constructors and destructors - */ - - SortedVector(); - SortedVector(const SortedVector& rhs); - virtual ~SortedVector(); - - /*! copy operator */ - const SortedVector& operator = (const SortedVector& rhs) const; - SortedVector& operator = (const SortedVector& rhs); - - /* - * empty the vector - */ - - inline void clear() { VectorImpl::clear(); } - - /*! - * vector stats - */ - - //! returns number of items in the vector - inline size_t size() const { return VectorImpl::size(); } - //! returns wether or not the vector is empty - inline bool isEmpty() const { return VectorImpl::isEmpty(); } - //! returns how many items can be stored without reallocating the backing store - inline size_t capacity() const { return VectorImpl::capacity(); } - //! setst the capacity. capacity can never be reduced less than size() - inline ssize_t setCapacity(size_t size) { return VectorImpl::setCapacity(size); } - - /*! - * C-style array access - */ - - //! read-only C-style access - inline const TYPE* array() const; - - //! read-write C-style access. BE VERY CAREFUL when modifying the array - //! you ust keep it sorted! You usually don't use this function. - TYPE* editArray(); - - //! finds the index of an item - ssize_t indexOf(const TYPE& item) const; - - //! finds where this item should be inserted - size_t orderOf(const TYPE& item) const; - - - /*! - * accessors - */ - - //! read-only access to an item at a given index - inline const TYPE& operator [] (size_t index) const; - //! alternate name for operator [] - inline const TYPE& itemAt(size_t index) const; - //! stack-usage of the vector. returns the top of the stack (last element) - const TYPE& top() const; - //! same as operator [], but allows to access the vector backward (from the end) with a negative index - const TYPE& mirrorItemAt(ssize_t index) const; - - /*! - * modifing the array - */ - - //! add an item in the right place (and replace the one that is there) - ssize_t add(const TYPE& item); - - //! editItemAt() MUST NOT change the order of this item - TYPE& editItemAt(size_t index) { - return *( static_cast(VectorImpl::editItemLocation(index)) ); - } - - //! merges a vector into this one - ssize_t merge(const Vector& vector); - ssize_t merge(const SortedVector& vector); - - //! removes an item - ssize_t remove(const TYPE&); - - //! remove several items - inline ssize_t removeItemsAt(size_t index, size_t count = 1); - //! remove one item - inline ssize_t removeAt(size_t index) { return removeItemsAt(index); } - -protected: - virtual void do_construct(void* storage, size_t num) const; - virtual void do_destroy(void* storage, size_t num) const; - virtual void do_copy(void* dest, const void* from, size_t num) const; - virtual void do_splat(void* dest, const void* item, size_t num) const; - virtual void do_move_forward(void* dest, const void* from, size_t num) const; - virtual void do_move_backward(void* dest, const void* from, size_t num) const; - virtual int do_compare(const void* lhs, const void* rhs) const; -}; - -// SortedVector can be trivially moved using memcpy() because moving does not -// require any change to the underlying SharedBuffer contents or reference count. -template struct trait_trivial_move > { enum { value = true }; }; - -// --------------------------------------------------------------------------- -// No user serviceable parts from here... -// --------------------------------------------------------------------------- - -template inline -SortedVector::SortedVector() - : SortedVectorImpl(sizeof(TYPE), - ((traits::has_trivial_ctor ? HAS_TRIVIAL_CTOR : 0) - |(traits::has_trivial_dtor ? HAS_TRIVIAL_DTOR : 0) - |(traits::has_trivial_copy ? HAS_TRIVIAL_COPY : 0)) - ) -{ -} - -template inline -SortedVector::SortedVector(const SortedVector& rhs) - : SortedVectorImpl(rhs) { -} - -template inline -SortedVector::~SortedVector() { - finish_vector(); -} - -template inline -SortedVector& SortedVector::operator = (const SortedVector& rhs) { - SortedVectorImpl::operator = (rhs); - return *this; -} - -template inline -const SortedVector& SortedVector::operator = (const SortedVector& rhs) const { - SortedVectorImpl::operator = (rhs); - return *this; -} - -template inline -const TYPE* SortedVector::array() const { - return static_cast(arrayImpl()); -} - -template inline -TYPE* SortedVector::editArray() { - return static_cast(editArrayImpl()); -} - - -template inline -const TYPE& SortedVector::operator[](size_t index) const { - assert( index inline -const TYPE& SortedVector::itemAt(size_t index) const { - return operator[](index); -} - -template inline -const TYPE& SortedVector::mirrorItemAt(ssize_t index) const { - assert( (index>0 ? index : -index) inline -const TYPE& SortedVector::top() const { - return *(array() + size() - 1); -} - -template inline -ssize_t SortedVector::add(const TYPE& item) { - return SortedVectorImpl::add(&item); -} - -template inline -ssize_t SortedVector::indexOf(const TYPE& item) const { - return SortedVectorImpl::indexOf(&item); -} - -template inline -size_t SortedVector::orderOf(const TYPE& item) const { - return SortedVectorImpl::orderOf(&item); -} - -template inline -ssize_t SortedVector::merge(const Vector& vector) { - return SortedVectorImpl::merge(reinterpret_cast(vector)); -} - -template inline -ssize_t SortedVector::merge(const SortedVector& vector) { - return SortedVectorImpl::merge(reinterpret_cast(vector)); -} - -template inline -ssize_t SortedVector::remove(const TYPE& item) { - return SortedVectorImpl::remove(&item); -} - -template inline -ssize_t SortedVector::removeItemsAt(size_t index, size_t count) { - return VectorImpl::removeItemsAt(index, count); -} - -// --------------------------------------------------------------------------- - -template -void SortedVector::do_construct(void* storage, size_t num) const { - construct_type( reinterpret_cast(storage), num ); -} - -template -void SortedVector::do_destroy(void* storage, size_t num) const { - destroy_type( reinterpret_cast(storage), num ); -} - -template -void SortedVector::do_copy(void* dest, const void* from, size_t num) const { - copy_type( reinterpret_cast(dest), reinterpret_cast(from), num ); -} - -template -void SortedVector::do_splat(void* dest, const void* item, size_t num) const { - splat_type( reinterpret_cast(dest), reinterpret_cast(item), num ); -} - -template -void SortedVector::do_move_forward(void* dest, const void* from, size_t num) const { - move_forward_type( reinterpret_cast(dest), reinterpret_cast(from), num ); -} - -template -void SortedVector::do_move_backward(void* dest, const void* from, size_t num) const { - move_backward_type( reinterpret_cast(dest), reinterpret_cast(from), num ); -} - -template -int SortedVector::do_compare(const void* lhs, const void* rhs) const { - return compare_type( *reinterpret_cast(lhs), *reinterpret_cast(rhs) ); -} - -}; // namespace android - - -// --------------------------------------------------------------------------- - -#endif // ANDROID_SORTED_VECTOR_H diff --git a/external/android/include/16/frameworks/native/include/utils/StopWatch.h b/external/android/include/16/frameworks/native/include/utils/StopWatch.h deleted file mode 100644 index 693dd3c..0000000 --- a/external/android/include/16/frameworks/native/include/utils/StopWatch.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2005 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_STOPWATCH_H -#define ANDROID_STOPWATCH_H - -#include -#include - -#include - -// --------------------------------------------------------------------------- - -namespace android { - -class StopWatch -{ -public: - StopWatch( const char *name, - int clock = SYSTEM_TIME_MONOTONIC, - uint32_t flags = 0); - ~StopWatch(); - - const char* name() const; - nsecs_t lap(); - nsecs_t elapsedTime() const; - - void reset(); - -private: - const char* mName; - int mClock; - uint32_t mFlags; - - struct lap_t { - nsecs_t soFar; - nsecs_t thisLap; - }; - - nsecs_t mStartTime; - lap_t mLaps[8]; - int mNumLaps; -}; - - -}; // namespace android - - -// --------------------------------------------------------------------------- - -#endif // ANDROID_STOPWATCH_H diff --git a/external/android/include/16/frameworks/native/include/utils/String16.h b/external/android/include/16/frameworks/native/include/utils/String16.h deleted file mode 100644 index fe06c57..0000000 --- a/external/android/include/16/frameworks/native/include/utils/String16.h +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Copyright (C) 2005 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_STRING16_H -#define ANDROID_STRING16_H - -#include -#include -#include -#include - -// --------------------------------------------------------------------------- - -extern "C" { - -} - -// --------------------------------------------------------------------------- - -namespace android { - -// --------------------------------------------------------------------------- - -class String8; -class TextOutput; - -//! This is a string holding UTF-16 characters. -class String16 -{ -public: - String16(); - String16(const String16& o); - String16(const String16& o, - size_t len, - size_t begin=0); - explicit String16(const char16_t* o); - explicit String16(const char16_t* o, size_t len); - explicit String16(const String8& o); - explicit String16(const char* o); - explicit String16(const char* o, size_t len); - - ~String16(); - - inline const char16_t* string() const; - inline size_t size() const; - - inline const SharedBuffer* sharedBuffer() const; - - void setTo(const String16& other); - status_t setTo(const char16_t* other); - status_t setTo(const char16_t* other, size_t len); - status_t setTo(const String16& other, - size_t len, - size_t begin=0); - - status_t append(const String16& other); - status_t append(const char16_t* other, size_t len); - - inline String16& operator=(const String16& other); - - inline String16& operator+=(const String16& other); - inline String16 operator+(const String16& other) const; - - status_t insert(size_t pos, const char16_t* chrs); - status_t insert(size_t pos, - const char16_t* chrs, size_t len); - - ssize_t findFirst(char16_t c) const; - ssize_t findLast(char16_t c) const; - - bool startsWith(const String16& prefix) const; - bool startsWith(const char16_t* prefix) const; - - status_t makeLower(); - - status_t replaceAll(char16_t replaceThis, - char16_t withThis); - - status_t remove(size_t len, size_t begin=0); - - inline int compare(const String16& other) const; - - inline bool operator<(const String16& other) const; - inline bool operator<=(const String16& other) const; - inline bool operator==(const String16& other) const; - inline bool operator!=(const String16& other) const; - inline bool operator>=(const String16& other) const; - inline bool operator>(const String16& other) const; - - inline bool operator<(const char16_t* other) const; - inline bool operator<=(const char16_t* other) const; - inline bool operator==(const char16_t* other) const; - inline bool operator!=(const char16_t* other) const; - inline bool operator>=(const char16_t* other) const; - inline bool operator>(const char16_t* other) const; - - inline operator const char16_t*() const; - -private: - const char16_t* mString; -}; - -// String16 can be trivially moved using memcpy() because moving does not -// require any change to the underlying SharedBuffer contents or reference count. -ANDROID_TRIVIAL_MOVE_TRAIT(String16) - -TextOutput& operator<<(TextOutput& to, const String16& val); - -// --------------------------------------------------------------------------- -// No user servicable parts below. - -inline int compare_type(const String16& lhs, const String16& rhs) -{ - return lhs.compare(rhs); -} - -inline int strictly_order_type(const String16& lhs, const String16& rhs) -{ - return compare_type(lhs, rhs) < 0; -} - -inline const char16_t* String16::string() const -{ - return mString; -} - -inline size_t String16::size() const -{ - return SharedBuffer::sizeFromData(mString)/sizeof(char16_t)-1; -} - -inline const SharedBuffer* String16::sharedBuffer() const -{ - return SharedBuffer::bufferFromData(mString); -} - -inline String16& String16::operator=(const String16& other) -{ - setTo(other); - return *this; -} - -inline String16& String16::operator+=(const String16& other) -{ - append(other); - return *this; -} - -inline String16 String16::operator+(const String16& other) const -{ - String16 tmp(*this); - tmp += other; - return tmp; -} - -inline int String16::compare(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()); -} - -inline bool String16::operator<(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()) < 0; -} - -inline bool String16::operator<=(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()) <= 0; -} - -inline bool String16::operator==(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()) == 0; -} - -inline bool String16::operator!=(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()) != 0; -} - -inline bool String16::operator>=(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()) >= 0; -} - -inline bool String16::operator>(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()) > 0; -} - -inline bool String16::operator<(const char16_t* other) const -{ - return strcmp16(mString, other) < 0; -} - -inline bool String16::operator<=(const char16_t* other) const -{ - return strcmp16(mString, other) <= 0; -} - -inline bool String16::operator==(const char16_t* other) const -{ - return strcmp16(mString, other) == 0; -} - -inline bool String16::operator!=(const char16_t* other) const -{ - return strcmp16(mString, other) != 0; -} - -inline bool String16::operator>=(const char16_t* other) const -{ - return strcmp16(mString, other) >= 0; -} - -inline bool String16::operator>(const char16_t* other) const -{ - return strcmp16(mString, other) > 0; -} - -inline String16::operator const char16_t*() const -{ - return mString; -} - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_STRING16_H diff --git a/external/android/include/16/frameworks/native/include/utils/String8.h b/external/android/include/16/frameworks/native/include/utils/String8.h deleted file mode 100644 index 335e7f1..0000000 --- a/external/android/include/16/frameworks/native/include/utils/String8.h +++ /dev/null @@ -1,388 +0,0 @@ -/* - * Copyright (C) 2005 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_STRING8_H -#define ANDROID_STRING8_H - -#include -#include -#include -#include - -#include // for strcmp -#include - -// --------------------------------------------------------------------------- - -namespace android { - -class String16; -class TextOutput; - -//! This is a string holding UTF-8 characters. Does not allow the value more -// than 0x10FFFF, which is not valid unicode codepoint. -class String8 -{ -public: - String8(); - String8(const String8& o); - explicit String8(const char* o); - explicit String8(const char* o, size_t numChars); - - explicit String8(const String16& o); - explicit String8(const char16_t* o); - explicit String8(const char16_t* o, size_t numChars); - explicit String8(const char32_t* o); - explicit String8(const char32_t* o, size_t numChars); - ~String8(); - - static inline const String8 empty(); - - static String8 format(const char* fmt, ...) __attribute__((format (printf, 1, 2))); - static String8 formatV(const char* fmt, va_list args); - - inline const char* string() const; - inline size_t size() const; - inline size_t length() const; - inline size_t bytes() const; - inline bool isEmpty() const; - - inline const SharedBuffer* sharedBuffer() const; - - void clear(); - - void setTo(const String8& other); - status_t setTo(const char* other); - status_t setTo(const char* other, size_t numChars); - status_t setTo(const char16_t* other, size_t numChars); - status_t setTo(const char32_t* other, - size_t length); - - status_t append(const String8& other); - status_t append(const char* other); - status_t append(const char* other, size_t numChars); - - status_t appendFormat(const char* fmt, ...) - __attribute__((format (printf, 2, 3))); - status_t appendFormatV(const char* fmt, va_list args); - - // Note that this function takes O(N) time to calculate the value. - // No cache value is stored. - size_t getUtf32Length() const; - int32_t getUtf32At(size_t index, - size_t *next_index) const; - void getUtf32(char32_t* dst) const; - - inline String8& operator=(const String8& other); - inline String8& operator=(const char* other); - - inline String8& operator+=(const String8& other); - inline String8 operator+(const String8& other) const; - - inline String8& operator+=(const char* other); - inline String8 operator+(const char* other) const; - - inline int compare(const String8& other) const; - - inline bool operator<(const String8& other) const; - inline bool operator<=(const String8& other) const; - inline bool operator==(const String8& other) const; - inline bool operator!=(const String8& other) const; - inline bool operator>=(const String8& other) const; - inline bool operator>(const String8& other) const; - - inline bool operator<(const char* other) const; - inline bool operator<=(const char* other) const; - inline bool operator==(const char* other) const; - inline bool operator!=(const char* other) const; - inline bool operator>=(const char* other) const; - inline bool operator>(const char* other) const; - - inline operator const char*() const; - - char* lockBuffer(size_t size); - void unlockBuffer(); - status_t unlockBuffer(size_t size); - - // return the index of the first byte of other in this at or after - // start, or -1 if not found - ssize_t find(const char* other, size_t start = 0) const; - - void toLower(); - void toLower(size_t start, size_t numChars); - void toUpper(); - void toUpper(size_t start, size_t numChars); - - /* - * These methods operate on the string as if it were a path name. - */ - - /* - * Set the filename field to a specific value. - * - * Normalizes the filename, removing a trailing '/' if present. - */ - void setPathName(const char* name); - void setPathName(const char* name, size_t numChars); - - /* - * Get just the filename component. - * - * "/tmp/foo/bar.c" --> "bar.c" - */ - String8 getPathLeaf(void) const; - - /* - * Remove the last (file name) component, leaving just the directory - * name. - * - * "/tmp/foo/bar.c" --> "/tmp/foo" - * "/tmp" --> "" // ????? shouldn't this be "/" ???? XXX - * "bar.c" --> "" - */ - String8 getPathDir(void) const; - - /* - * Retrieve the front (root dir) component. Optionally also return the - * remaining components. - * - * "/tmp/foo/bar.c" --> "tmp" (remain = "foo/bar.c") - * "/tmp" --> "tmp" (remain = "") - * "bar.c" --> "bar.c" (remain = "") - */ - String8 walkPath(String8* outRemains = NULL) const; - - /* - * Return the filename extension. This is the last '.' and any number - * of characters that follow it. The '.' is included in case we - * decide to expand our definition of what constitutes an extension. - * - * "/tmp/foo/bar.c" --> ".c" - * "/tmp" --> "" - * "/tmp/foo.bar/baz" --> "" - * "foo.jpeg" --> ".jpeg" - * "foo." --> "" - */ - String8 getPathExtension(void) const; - - /* - * Return the path without the extension. Rules for what constitutes - * an extension are described in the comment for getPathExtension(). - * - * "/tmp/foo/bar.c" --> "/tmp/foo/bar" - */ - String8 getBasePath(void) const; - - /* - * Add a component to the pathname. We guarantee that there is - * exactly one path separator between the old path and the new. - * If there is no existing name, we just copy the new name in. - * - * If leaf is a fully qualified path (i.e. starts with '/', it - * replaces whatever was there before. - */ - String8& appendPath(const char* leaf); - String8& appendPath(const String8& leaf) { return appendPath(leaf.string()); } - - /* - * Like appendPath(), but does not affect this string. Returns a new one instead. - */ - String8 appendPathCopy(const char* leaf) const - { String8 p(*this); p.appendPath(leaf); return p; } - String8 appendPathCopy(const String8& leaf) const { return appendPathCopy(leaf.string()); } - - /* - * Converts all separators in this string to /, the default path separator. - * - * If the default OS separator is backslash, this converts all - * backslashes to slashes, in-place. Otherwise it does nothing. - * Returns self. - */ - String8& convertToResPath(); - -private: - status_t real_append(const char* other, size_t numChars); - char* find_extension(void) const; - - const char* mString; -}; - -// String8 can be trivially moved using memcpy() because moving does not -// require any change to the underlying SharedBuffer contents or reference count. -ANDROID_TRIVIAL_MOVE_TRAIT(String8) - -TextOutput& operator<<(TextOutput& to, const String16& val); - -// --------------------------------------------------------------------------- -// No user servicable parts below. - -inline int compare_type(const String8& lhs, const String8& rhs) -{ - return lhs.compare(rhs); -} - -inline int strictly_order_type(const String8& lhs, const String8& rhs) -{ - return compare_type(lhs, rhs) < 0; -} - -inline const String8 String8::empty() { - return String8(); -} - -inline const char* String8::string() const -{ - return mString; -} - -inline size_t String8::length() const -{ - return SharedBuffer::sizeFromData(mString)-1; -} - -inline size_t String8::size() const -{ - return length(); -} - -inline bool String8::isEmpty() const -{ - return length() == 0; -} - -inline size_t String8::bytes() const -{ - return SharedBuffer::sizeFromData(mString)-1; -} - -inline const SharedBuffer* String8::sharedBuffer() const -{ - return SharedBuffer::bufferFromData(mString); -} - -inline String8& String8::operator=(const String8& other) -{ - setTo(other); - return *this; -} - -inline String8& String8::operator=(const char* other) -{ - setTo(other); - return *this; -} - -inline String8& String8::operator+=(const String8& other) -{ - append(other); - return *this; -} - -inline String8 String8::operator+(const String8& other) const -{ - String8 tmp(*this); - tmp += other; - return tmp; -} - -inline String8& String8::operator+=(const char* other) -{ - append(other); - return *this; -} - -inline String8 String8::operator+(const char* other) const -{ - String8 tmp(*this); - tmp += other; - return tmp; -} - -inline int String8::compare(const String8& other) const -{ - return strcmp(mString, other.mString); -} - -inline bool String8::operator<(const String8& other) const -{ - return strcmp(mString, other.mString) < 0; -} - -inline bool String8::operator<=(const String8& other) const -{ - return strcmp(mString, other.mString) <= 0; -} - -inline bool String8::operator==(const String8& other) const -{ - return strcmp(mString, other.mString) == 0; -} - -inline bool String8::operator!=(const String8& other) const -{ - return strcmp(mString, other.mString) != 0; -} - -inline bool String8::operator>=(const String8& other) const -{ - return strcmp(mString, other.mString) >= 0; -} - -inline bool String8::operator>(const String8& other) const -{ - return strcmp(mString, other.mString) > 0; -} - -inline bool String8::operator<(const char* other) const -{ - return strcmp(mString, other) < 0; -} - -inline bool String8::operator<=(const char* other) const -{ - return strcmp(mString, other) <= 0; -} - -inline bool String8::operator==(const char* other) const -{ - return strcmp(mString, other) == 0; -} - -inline bool String8::operator!=(const char* other) const -{ - return strcmp(mString, other) != 0; -} - -inline bool String8::operator>=(const char* other) const -{ - return strcmp(mString, other) >= 0; -} - -inline bool String8::operator>(const char* other) const -{ - return strcmp(mString, other) > 0; -} - -inline String8::operator const char*() const -{ - return mString; -} - -} // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_STRING8_H diff --git a/external/android/include/16/frameworks/native/include/utils/StringArray.h b/external/android/include/16/frameworks/native/include/utils/StringArray.h deleted file mode 100644 index c244587..0000000 --- a/external/android/include/16/frameworks/native/include/utils/StringArray.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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. - */ - -// -// Sortable array of strings. STL-ish, but STL-free. -// -#ifndef _LIBS_UTILS_STRING_ARRAY_H -#define _LIBS_UTILS_STRING_ARRAY_H - -#include -#include - -namespace android { - -// -// An expanding array of strings. Add, get, sort, delete. -// -class StringArray { -public: - StringArray(); - virtual ~StringArray(); - - // - // Add a string. A copy of the string is made. - // - bool push_back(const char* str); - - // - // Delete an entry. - // - void erase(int idx); - - // - // Sort the array. - // - void sort(int (*compare)(const void*, const void*)); - - // - // Pass this to the sort routine to do an ascending alphabetical sort. - // - static int cmpAscendingAlpha(const void* pstr1, const void* pstr2); - - // - // Get the #of items in the array. - // - inline int size(void) const { return mCurrent; } - - // - // Return entry N. - // [should use operator[] here] - // - const char* getEntry(int idx) const { - return (unsigned(idx) >= unsigned(mCurrent)) ? NULL : mArray[idx]; - } - - // - // Set entry N to specified string. - // [should use operator[] here] - // - void setEntry(int idx, const char* str); - -private: - int mMax; - int mCurrent; - char** mArray; -}; - -}; // namespace android - -#endif // _LIBS_UTILS_STRING_ARRAY_H diff --git a/external/android/include/16/frameworks/native/include/utils/StrongPointer.h b/external/android/include/16/frameworks/native/include/utils/StrongPointer.h deleted file mode 100644 index 49fa3a8..0000000 --- a/external/android/include/16/frameworks/native/include/utils/StrongPointer.h +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright (C) 2005 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_STRONG_POINTER_H -#define ANDROID_STRONG_POINTER_H - -#include - -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -class TextOutput; -TextOutput& printStrongPointer(TextOutput& to, const void* val); - -template class wp; - -// --------------------------------------------------------------------------- - -#define COMPARE(_op_) \ -inline bool operator _op_ (const sp& o) const { \ - return m_ptr _op_ o.m_ptr; \ -} \ -inline bool operator _op_ (const T* o) const { \ - return m_ptr _op_ o; \ -} \ -template \ -inline bool operator _op_ (const sp& o) const { \ - return m_ptr _op_ o.m_ptr; \ -} \ -template \ -inline bool operator _op_ (const U* o) const { \ - return m_ptr _op_ o; \ -} \ -inline bool operator _op_ (const wp& o) const { \ - return m_ptr _op_ o.m_ptr; \ -} \ -template \ -inline bool operator _op_ (const wp& o) const { \ - return m_ptr _op_ o.m_ptr; \ -} - -// --------------------------------------------------------------------------- - -template -class sp -{ -public: - inline sp() : m_ptr(0) { } - - sp(T* other); - sp(const sp& other); - template sp(U* other); - template sp(const sp& other); - - ~sp(); - - // Assignment - - sp& operator = (T* other); - sp& operator = (const sp& other); - - template sp& operator = (const sp& other); - template sp& operator = (U* other); - - //! Special optimization for use by ProcessState (and nobody else). - void force_set(T* other); - - // Reset - - void clear(); - - // Accessors - - inline T& operator* () const { return *m_ptr; } - inline T* operator-> () const { return m_ptr; } - inline T* get() const { return m_ptr; } - - // Operators - - COMPARE(==) - COMPARE(!=) - COMPARE(>) - COMPARE(<) - COMPARE(<=) - COMPARE(>=) - -private: - template friend class sp; - template friend class wp; - void set_pointer(T* ptr); - T* m_ptr; -}; - -#undef COMPARE - -template -TextOutput& operator<<(TextOutput& to, const sp& val); - -// --------------------------------------------------------------------------- -// No user serviceable parts below here. - -template -sp::sp(T* other) -: m_ptr(other) - { - if (other) other->incStrong(this); - } - -template -sp::sp(const sp& other) -: m_ptr(other.m_ptr) - { - if (m_ptr) m_ptr->incStrong(this); - } - -template template -sp::sp(U* other) : m_ptr(other) -{ - if (other) ((T*)other)->incStrong(this); -} - -template template -sp::sp(const sp& other) -: m_ptr(other.m_ptr) - { - if (m_ptr) m_ptr->incStrong(this); - } - -template -sp::~sp() -{ - if (m_ptr) m_ptr->decStrong(this); -} - -template -sp& sp::operator = (const sp& other) { - T* otherPtr(other.m_ptr); - if (otherPtr) otherPtr->incStrong(this); - if (m_ptr) m_ptr->decStrong(this); - m_ptr = otherPtr; - return *this; -} - -template -sp& sp::operator = (T* other) -{ - if (other) other->incStrong(this); - if (m_ptr) m_ptr->decStrong(this); - m_ptr = other; - return *this; -} - -template template -sp& sp::operator = (const sp& other) -{ - T* otherPtr(other.m_ptr); - if (otherPtr) otherPtr->incStrong(this); - if (m_ptr) m_ptr->decStrong(this); - m_ptr = otherPtr; - return *this; -} - -template template -sp& sp::operator = (U* other) -{ - if (other) ((T*)other)->incStrong(this); - if (m_ptr) m_ptr->decStrong(this); - m_ptr = other; - return *this; -} - -template -void sp::force_set(T* other) -{ - other->forceIncStrong(this); - m_ptr = other; -} - -template -void sp::clear() -{ - if (m_ptr) { - m_ptr->decStrong(this); - m_ptr = 0; - } -} - -template -void sp::set_pointer(T* ptr) { - m_ptr = ptr; -} - -template -inline TextOutput& operator<<(TextOutput& to, const sp& val) -{ - return printStrongPointer(to, val.get()); -} - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_STRONG_POINTER_H diff --git a/external/android/include/16/frameworks/native/include/utils/SystemClock.h b/external/android/include/16/frameworks/native/include/utils/SystemClock.h deleted file mode 100644 index 7c319be..0000000 --- a/external/android/include/16/frameworks/native/include/utils/SystemClock.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_UTILS_SYSTEMCLOCK_H -#define ANDROID_UTILS_SYSTEMCLOCK_H - -#include -#include - -namespace android { - -int setCurrentTimeMillis(int64_t millis); -int64_t uptimeMillis(); -int64_t elapsedRealtime(); - -}; // namespace android - -#endif // ANDROID_UTILS_SYSTEMCLOCK_H - diff --git a/external/android/include/16/frameworks/native/include/utils/TextOutput.h b/external/android/include/16/frameworks/native/include/utils/TextOutput.h deleted file mode 100644 index de2fbbe..0000000 --- a/external/android/include/16/frameworks/native/include/utils/TextOutput.h +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (C) 2006 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_TEXTOUTPUT_H -#define ANDROID_TEXTOUTPUT_H - -#include - -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -class TextOutput -{ -public: - TextOutput(); - virtual ~TextOutput(); - - virtual status_t print(const char* txt, size_t len) = 0; - virtual void moveIndent(int delta) = 0; - - class Bundle { - public: - inline Bundle(TextOutput& to) : mTO(to) { to.pushBundle(); } - inline ~Bundle() { mTO.popBundle(); } - private: - TextOutput& mTO; - }; - - virtual void pushBundle() = 0; - virtual void popBundle() = 0; -}; - -// --------------------------------------------------------------------------- - -// Text output stream for printing to the log (via utils/Log.h). -extern TextOutput& alog; - -// Text output stream for printing to stdout. -extern TextOutput& aout; - -// Text output stream for printing to stderr. -extern TextOutput& aerr; - -typedef TextOutput& (*TextOutputManipFunc)(TextOutput&); - -TextOutput& endl(TextOutput& to); -TextOutput& indent(TextOutput& to); -TextOutput& dedent(TextOutput& to); - -TextOutput& operator<<(TextOutput& to, const char* str); -TextOutput& operator<<(TextOutput& to, char); // writes raw character -TextOutput& operator<<(TextOutput& to, bool); -TextOutput& operator<<(TextOutput& to, int); -TextOutput& operator<<(TextOutput& to, long); -TextOutput& operator<<(TextOutput& to, unsigned int); -TextOutput& operator<<(TextOutput& to, unsigned long); -TextOutput& operator<<(TextOutput& to, long long); -TextOutput& operator<<(TextOutput& to, unsigned long long); -TextOutput& operator<<(TextOutput& to, float); -TextOutput& operator<<(TextOutput& to, double); -TextOutput& operator<<(TextOutput& to, TextOutputManipFunc func); -TextOutput& operator<<(TextOutput& to, const void*); - -class TypeCode -{ -public: - inline TypeCode(uint32_t code); - inline ~TypeCode(); - - inline uint32_t typeCode() const; - -private: - uint32_t mCode; -}; - -TextOutput& operator<<(TextOutput& to, const TypeCode& val); - -class HexDump -{ -public: - HexDump(const void *buf, size_t size, size_t bytesPerLine=16); - inline ~HexDump(); - - inline HexDump& setBytesPerLine(size_t bytesPerLine); - inline HexDump& setSingleLineCutoff(int32_t bytes); - inline HexDump& setAlignment(size_t alignment); - inline HexDump& setCArrayStyle(bool enabled); - - inline const void* buffer() const; - inline size_t size() const; - inline size_t bytesPerLine() const; - inline int32_t singleLineCutoff() const; - inline size_t alignment() const; - inline bool carrayStyle() const; - -private: - const void* mBuffer; - size_t mSize; - size_t mBytesPerLine; - int32_t mSingleLineCutoff; - size_t mAlignment; - bool mCArrayStyle; -}; - -TextOutput& operator<<(TextOutput& to, const HexDump& val); - -// --------------------------------------------------------------------------- -// No user servicable parts below. - -inline TextOutput& endl(TextOutput& to) -{ - to.print("\n", 1); - return to; -} - -inline TextOutput& indent(TextOutput& to) -{ - to.moveIndent(1); - return to; -} - -inline TextOutput& dedent(TextOutput& to) -{ - to.moveIndent(-1); - return to; -} - -inline TextOutput& operator<<(TextOutput& to, const char* str) -{ - to.print(str, strlen(str)); - return to; -} - -inline TextOutput& operator<<(TextOutput& to, char c) -{ - to.print(&c, 1); - return to; -} - -inline TextOutput& operator<<(TextOutput& to, TextOutputManipFunc func) -{ - return (*func)(to); -} - -inline TypeCode::TypeCode(uint32_t code) : mCode(code) { } -inline TypeCode::~TypeCode() { } -inline uint32_t TypeCode::typeCode() const { return mCode; } - -inline HexDump::~HexDump() { } - -inline HexDump& HexDump::setBytesPerLine(size_t bytesPerLine) { - mBytesPerLine = bytesPerLine; return *this; -} -inline HexDump& HexDump::setSingleLineCutoff(int32_t bytes) { - mSingleLineCutoff = bytes; return *this; -} -inline HexDump& HexDump::setAlignment(size_t alignment) { - mAlignment = alignment; return *this; -} -inline HexDump& HexDump::setCArrayStyle(bool enabled) { - mCArrayStyle = enabled; return *this; -} - -inline const void* HexDump::buffer() const { return mBuffer; } -inline size_t HexDump::size() const { return mSize; } -inline size_t HexDump::bytesPerLine() const { return mBytesPerLine; } -inline int32_t HexDump::singleLineCutoff() const { return mSingleLineCutoff; } -inline size_t HexDump::alignment() const { return mAlignment; } -inline bool HexDump::carrayStyle() const { return mCArrayStyle; } - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_TEXTOUTPUT_H diff --git a/external/android/include/16/frameworks/native/include/utils/Thread.h b/external/android/include/16/frameworks/native/include/utils/Thread.h deleted file mode 100644 index 4a34abd..0000000 --- a/external/android/include/16/frameworks/native/include/utils/Thread.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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 _LIBS_UTILS_THREAD_H -#define _LIBS_UTILS_THREAD_H - -#include -#include -#include - -#if defined(HAVE_PTHREADS) -# include -#endif - -#include -#include -#include -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { -// --------------------------------------------------------------------------- - -class Thread : virtual public RefBase -{ -public: - // Create a Thread object, but doesn't create or start the associated - // thread. See the run() method. - Thread(bool canCallJava = true); - virtual ~Thread(); - - // Start the thread in threadLoop() which needs to be implemented. - virtual status_t run( const char* name = 0, - int32_t priority = PRIORITY_DEFAULT, - size_t stack = 0); - - // Ask this object's thread to exit. This function is asynchronous, when the - // function returns the thread might still be running. Of course, this - // function can be called from a different thread. - virtual void requestExit(); - - // Good place to do one-time initializations - virtual status_t readyToRun(); - - // Call requestExit() and wait until this object's thread exits. - // BE VERY CAREFUL of deadlocks. In particular, it would be silly to call - // this function from this object's thread. Will return WOULD_BLOCK in - // that case. - status_t requestExitAndWait(); - - // Wait until this object's thread exits. Returns immediately if not yet running. - // Do not call from this object's thread; will return WOULD_BLOCK in that case. - status_t join(); - -#ifdef HAVE_ANDROID_OS - // Return the thread's kernel ID, same as the thread itself calling gettid() or - // androidGetTid(), or -1 if the thread is not running. - pid_t getTid() const; -#endif - -protected: - // exitPending() returns true if requestExit() has been called. - bool exitPending() const; - -private: - // Derived class must implement threadLoop(). The thread starts its life - // here. There are two ways of using the Thread object: - // 1) loop: if threadLoop() returns true, it will be called again if - // requestExit() wasn't called. - // 2) once: if threadLoop() returns false, the thread will exit upon return. - virtual bool threadLoop() = 0; - -private: - Thread& operator=(const Thread&); - static int _threadLoop(void* user); - const bool mCanCallJava; - // always hold mLock when reading or writing - thread_id_t mThread; - mutable Mutex mLock; - Condition mThreadExitedCondition; - status_t mStatus; - // note that all accesses of mExitPending and mRunning need to hold mLock - volatile bool mExitPending; - volatile bool mRunning; - sp mHoldSelf; -#ifdef HAVE_ANDROID_OS - // legacy for debugging, not used by getTid() as it is set by the child thread - // and so is not initialized until the child reaches that point - pid_t mTid; -#endif -}; - - -}; // namespace android - -// --------------------------------------------------------------------------- -#endif // _LIBS_UTILS_THREAD_H -// --------------------------------------------------------------------------- diff --git a/external/android/include/16/frameworks/native/include/utils/ThreadDefs.h b/external/android/include/16/frameworks/native/include/utils/ThreadDefs.h deleted file mode 100644 index a8f8eb3..0000000 --- a/external/android/include/16/frameworks/native/include/utils/ThreadDefs.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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 _LIBS_UTILS_THREAD_DEFS_H -#define _LIBS_UTILS_THREAD_DEFS_H - -#include -#include -#include - -// --------------------------------------------------------------------------- -// C API - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void* android_thread_id_t; - -typedef int (*android_thread_func_t)(void*); - -enum { - /* - * *********************************************** - * ** Keep in sync with android.os.Process.java ** - * *********************************************** - * - * This maps directly to the "nice" priorities we use in Android. - * A thread priority should be chosen inverse-proportionally to - * the amount of work the thread is expected to do. The more work - * a thread will do, the less favorable priority it should get so that - * it doesn't starve the system. Threads not behaving properly might - * be "punished" by the kernel. - * Use the levels below when appropriate. Intermediate values are - * acceptable, preferably use the {MORE|LESS}_FAVORABLE constants below. - */ - ANDROID_PRIORITY_LOWEST = 19, - - /* use for background tasks */ - ANDROID_PRIORITY_BACKGROUND = 10, - - /* most threads run at normal priority */ - ANDROID_PRIORITY_NORMAL = 0, - - /* threads currently running a UI that the user is interacting with */ - ANDROID_PRIORITY_FOREGROUND = -2, - - /* the main UI thread has a slightly more favorable priority */ - ANDROID_PRIORITY_DISPLAY = -4, - - /* ui service treads might want to run at a urgent display (uncommon) */ - ANDROID_PRIORITY_URGENT_DISPLAY = HAL_PRIORITY_URGENT_DISPLAY, - - /* all normal audio threads */ - ANDROID_PRIORITY_AUDIO = -16, - - /* service audio threads (uncommon) */ - ANDROID_PRIORITY_URGENT_AUDIO = -19, - - /* should never be used in practice. regular process might not - * be allowed to use this level */ - ANDROID_PRIORITY_HIGHEST = -20, - - ANDROID_PRIORITY_DEFAULT = ANDROID_PRIORITY_NORMAL, - ANDROID_PRIORITY_MORE_FAVORABLE = -1, - ANDROID_PRIORITY_LESS_FAVORABLE = +1, -}; - -#ifdef __cplusplus -} // extern "C" -#endif - -// --------------------------------------------------------------------------- -// C++ API -#ifdef __cplusplus -namespace android { -// --------------------------------------------------------------------------- - -typedef android_thread_id_t thread_id_t; -typedef android_thread_func_t thread_func_t; - -enum { - PRIORITY_LOWEST = ANDROID_PRIORITY_LOWEST, - PRIORITY_BACKGROUND = ANDROID_PRIORITY_BACKGROUND, - PRIORITY_NORMAL = ANDROID_PRIORITY_NORMAL, - PRIORITY_FOREGROUND = ANDROID_PRIORITY_FOREGROUND, - PRIORITY_DISPLAY = ANDROID_PRIORITY_DISPLAY, - PRIORITY_URGENT_DISPLAY = ANDROID_PRIORITY_URGENT_DISPLAY, - PRIORITY_AUDIO = ANDROID_PRIORITY_AUDIO, - PRIORITY_URGENT_AUDIO = ANDROID_PRIORITY_URGENT_AUDIO, - PRIORITY_HIGHEST = ANDROID_PRIORITY_HIGHEST, - PRIORITY_DEFAULT = ANDROID_PRIORITY_DEFAULT, - PRIORITY_MORE_FAVORABLE = ANDROID_PRIORITY_MORE_FAVORABLE, - PRIORITY_LESS_FAVORABLE = ANDROID_PRIORITY_LESS_FAVORABLE, -}; - -// --------------------------------------------------------------------------- -}; // namespace android -#endif // __cplusplus -// --------------------------------------------------------------------------- - - -#endif // _LIBS_UTILS_THREAD_DEFS_H diff --git a/external/android/include/16/frameworks/native/include/utils/Timers.h b/external/android/include/16/frameworks/native/include/utils/Timers.h deleted file mode 100644 index 8b4d322..0000000 --- a/external/android/include/16/frameworks/native/include/utils/Timers.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// Timer functions. -// -#ifndef _LIBS_UTILS_TIMERS_H -#define _LIBS_UTILS_TIMERS_H - -#include -#include -#include - -// ------------------------------------------------------------------ -// C API - -#ifdef __cplusplus -extern "C" { -#endif - -typedef int64_t nsecs_t; // nano-seconds - -static inline nsecs_t seconds_to_nanoseconds(nsecs_t secs) -{ - return secs*1000000000; -} - -static inline nsecs_t milliseconds_to_nanoseconds(nsecs_t secs) -{ - return secs*1000000; -} - -static inline nsecs_t microseconds_to_nanoseconds(nsecs_t secs) -{ - return secs*1000; -} - -static inline nsecs_t nanoseconds_to_seconds(nsecs_t secs) -{ - return secs/1000000000; -} - -static inline nsecs_t nanoseconds_to_milliseconds(nsecs_t secs) -{ - return secs/1000000; -} - -static inline nsecs_t nanoseconds_to_microseconds(nsecs_t secs) -{ - return secs/1000; -} - -static inline nsecs_t s2ns(nsecs_t v) {return seconds_to_nanoseconds(v);} -static inline nsecs_t ms2ns(nsecs_t v) {return milliseconds_to_nanoseconds(v);} -static inline nsecs_t us2ns(nsecs_t v) {return microseconds_to_nanoseconds(v);} -static inline nsecs_t ns2s(nsecs_t v) {return nanoseconds_to_seconds(v);} -static inline nsecs_t ns2ms(nsecs_t v) {return nanoseconds_to_milliseconds(v);} -static inline nsecs_t ns2us(nsecs_t v) {return nanoseconds_to_microseconds(v);} - -static inline nsecs_t seconds(nsecs_t v) { return s2ns(v); } -static inline nsecs_t milliseconds(nsecs_t v) { return ms2ns(v); } -static inline nsecs_t microseconds(nsecs_t v) { return us2ns(v); } - -enum { - SYSTEM_TIME_REALTIME = 0, // system-wide realtime clock - SYSTEM_TIME_MONOTONIC = 1, // monotonic time since unspecified starting point - SYSTEM_TIME_PROCESS = 2, // high-resolution per-process clock - SYSTEM_TIME_THREAD = 3 // high-resolution per-thread clock -}; - -// return the system-time according to the specified clock -#ifdef __cplusplus -nsecs_t systemTime(int clock = SYSTEM_TIME_MONOTONIC); -#else -nsecs_t systemTime(int clock); -#endif // def __cplusplus - -/** - * Returns the number of milliseconds to wait between the reference time and the timeout time. - * If the timeout is in the past relative to the reference time, returns 0. - * If the timeout is more than INT_MAX milliseconds in the future relative to the reference time, - * such as when timeoutTime == LLONG_MAX, returns -1 to indicate an infinite timeout delay. - * Otherwise, returns the difference between the reference time and timeout time - * rounded up to the next millisecond. - */ -int toMillisecondTimeoutDelay(nsecs_t referenceTime, nsecs_t timeoutTime); - -#ifdef __cplusplus -} // extern "C" -#endif - -// ------------------------------------------------------------------ -// C++ API - -#ifdef __cplusplus - -namespace android { -/* - * Time the duration of something. - * - * Includes some timeval manipulation functions. - */ -class DurationTimer { -public: - DurationTimer() {} - ~DurationTimer() {} - - // Start the timer. - void start(); - // Stop the timer. - void stop(); - // Get the duration in microseconds. - long long durationUsecs() const; - - // Subtract two timevals. Returns the difference (ptv1-ptv2) in - // microseconds. - static long long subtractTimevals(const struct timeval* ptv1, - const struct timeval* ptv2); - - // Add the specified amount of time to the timeval. - static void addToTimeval(struct timeval* ptv, long usec); - -private: - struct timeval mStartWhen; - struct timeval mStopWhen; -}; - -}; // android -#endif // def __cplusplus - -#endif // _LIBS_UTILS_TIMERS_H diff --git a/external/android/include/16/frameworks/native/include/utils/Tokenizer.h b/external/android/include/16/frameworks/native/include/utils/Tokenizer.h deleted file mode 100644 index bb25f37..0000000 --- a/external/android/include/16/frameworks/native/include/utils/Tokenizer.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (C) 2010 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 _UTILS_TOKENIZER_H -#define _UTILS_TOKENIZER_H - -#include -#include -#include -#include - -namespace android { - -/** - * A simple tokenizer for loading and parsing ASCII text files line by line. - */ -class Tokenizer { - Tokenizer(const String8& filename, FileMap* fileMap, char* buffer, - bool ownBuffer, size_t length); - -public: - ~Tokenizer(); - - /** - * Opens a file and maps it into memory. - * - * Returns NO_ERROR and a tokenizer for the file, if successful. - * Otherwise returns an error and sets outTokenizer to NULL. - */ - static status_t open(const String8& filename, Tokenizer** outTokenizer); - - /** - * Prepares to tokenize the contents of a string. - * - * Returns NO_ERROR and a tokenizer for the string, if successful. - * Otherwise returns an error and sets outTokenizer to NULL. - */ - static status_t fromContents(const String8& filename, - const char* contents, Tokenizer** outTokenizer); - - /** - * Returns true if at the end of the file. - */ - inline bool isEof() const { return mCurrent == getEnd(); } - - /** - * Returns true if at the end of the line or end of the file. - */ - inline bool isEol() const { return isEof() || *mCurrent == '\n'; } - - /** - * Gets the name of the file. - */ - inline String8 getFilename() const { return mFilename; } - - /** - * Gets a 1-based line number index for the current position. - */ - inline int32_t getLineNumber() const { return mLineNumber; } - - /** - * Formats a location string consisting of the filename and current line number. - * Returns a string like "MyFile.txt:33". - */ - String8 getLocation() const; - - /** - * Gets the character at the current position. - * Returns null at end of file. - */ - inline char peekChar() const { return isEof() ? '\0' : *mCurrent; } - - /** - * Gets the remainder of the current line as a string, excluding the newline character. - */ - String8 peekRemainderOfLine() const; - - /** - * Gets the character at the current position and advances past it. - * Returns null at end of file. - */ - inline char nextChar() { return isEof() ? '\0' : *(mCurrent++); } - - /** - * Gets the next token on this line stopping at the specified delimiters - * or the end of the line whichever comes first and advances past it. - * Also stops at embedded nulls. - * Returns the token or an empty string if the current character is a delimiter - * or is at the end of the line. - */ - String8 nextToken(const char* delimiters); - - /** - * Advances to the next line. - * Does nothing if already at the end of the file. - */ - void nextLine(); - - /** - * Skips over the specified delimiters in the line. - * Also skips embedded nulls. - */ - void skipDelimiters(const char* delimiters); - -private: - Tokenizer(const Tokenizer& other); // not copyable - - String8 mFilename; - FileMap* mFileMap; - char* mBuffer; - bool mOwnBuffer; - size_t mLength; - - const char* mCurrent; - int32_t mLineNumber; - - inline const char* getEnd() const { return mBuffer + mLength; } - -}; - -} // namespace android - -#endif // _UTILS_TOKENIZER_H diff --git a/external/android/include/16/frameworks/native/include/utils/Trace.h b/external/android/include/16/frameworks/native/include/utils/Trace.h deleted file mode 100644 index 4219206..0000000 --- a/external/android/include/16/frameworks/native/include/utils/Trace.h +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright (C) 2012 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_TRACE_H -#define ANDROID_TRACE_H - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -// The ATRACE_TAG macro can be defined before including this header to trace -// using one of the tags defined below. It must be defined to one of the -// following ATRACE_TAG_* macros. The trace tag is used to filter tracing in -// userland to avoid some of the runtime cost of tracing when it is not desired. -// -// Defining ATRACE_TAG to be ATRACE_TAG_ALWAYS will result in the tracing always -// being enabled - this should ONLY be done for debug code, as userland tracing -// has a performance cost even when the trace is not being recorded. Defining -// ATRACE_TAG to be ATRACE_TAG_NEVER or leaving ATRACE_TAG undefined will result -// in the tracing always being disabled. -// -// These tags must be kept in sync with frameworks/base/core/java/android/os/Trace.java. -#define ATRACE_TAG_NEVER 0 // The "never" tag is never enabled. -#define ATRACE_TAG_ALWAYS (1<<0) // The "always" tag is always enabled. -#define ATRACE_TAG_GRAPHICS (1<<1) -#define ATRACE_TAG_INPUT (1<<2) -#define ATRACE_TAG_VIEW (1<<3) -#define ATRACE_TAG_WEBVIEW (1<<4) -#define ATRACE_TAG_WINDOW_MANAGER (1<<5) -#define ATRACE_TAG_ACTIVITY_MANAGER (1<<6) -#define ATRACE_TAG_SYNC_MANAGER (1<<7) -#define ATRACE_TAG_AUDIO (1<<8) -#define ATRACE_TAG_VIDEO (1<<9) -#define ATRACE_TAG_LAST ATRACE_TAG_VIDEO - -#define ATRACE_TAG_VALID_MASK ((ATRACE_TAG_LAST - 1) | ATRACE_TAG_LAST) - -#ifndef ATRACE_TAG -#define ATRACE_TAG ATRACE_TAG_NEVER -#elif ATRACE_TAG > ATRACE_TAG_LAST -#error ATRACE_TAG must be defined to be one of the tags defined in utils/Trace.h -#endif - -// ATRACE_CALL traces the beginning and end of the current function. To trace -// the correct start and end times this macro should be the first line of the -// function body. -#define ATRACE_CALL() android::ScopedTrace ___tracer(ATRACE_TAG, __FUNCTION__) - -// ATRACE_INT traces a named integer value. This can be used to track how the -// value changes over time in a trace. -#define ATRACE_INT(name, value) android::Tracer::traceCounter(ATRACE_TAG, name, value) - -// ATRACE_ENABLED returns true if the trace tag is enabled. It can be used as a -// guard condition around more expensive trace calculations. -#define ATRACE_ENABLED() android::Tracer::isTagEnabled(ATRACE_TAG) - -namespace android { - -class Tracer { - -public: - - static uint64_t getEnabledTags() { - initIfNeeded(); - return sEnabledTags; - } - - static inline bool isTagEnabled(uint64_t tag) { - initIfNeeded(); - return sEnabledTags & tag; - } - - static inline void traceCounter(uint64_t tag, const char* name, - int32_t value) { - if (CC_UNLIKELY(isTagEnabled(tag))) { - char buf[1024]; - snprintf(buf, 1024, "C|%d|%s|%d", getpid(), name, value); - write(sTraceFD, buf, strlen(buf)); - } - } - - static inline void traceBegin(uint64_t tag, const char* name) { - if (CC_UNLIKELY(isTagEnabled(tag))) { - char buf[1024]; - size_t len = snprintf(buf, 1024, "B|%d|%s", getpid(), name); - write(sTraceFD, buf, len); - } - } - - static inline void traceEnd(uint64_t tag) { - if (CC_UNLIKELY(isTagEnabled(tag))) { - char buf = 'E'; - write(sTraceFD, &buf, 1); - } - } - -private: - - static inline void initIfNeeded() { - if (!android_atomic_acquire_load(&sIsReady)) { - init(); - } - } - - static void changeCallback(); - - // init opens the trace marker file for writing and reads the - // atrace.tags.enableflags system property. It does this only the first - // time it is run, using sMutex for synchronization. - static void init(); - - // retrieve the current value of the system property. - static void loadSystemProperty(); - - // sIsReady is a boolean value indicating whether a call to init() has - // completed in this process. It is initialized to 0 and set to 1 when the - // first init() call completes. It is set to 1 even if a failure occurred - // in init (e.g. the trace marker file couldn't be opened). - // - // This should be checked by all tracing functions using an atomic acquire - // load operation before calling init(). This check avoids the need to lock - // a mutex each time a trace function gets called. - static volatile int32_t sIsReady; - - // sTraceFD is the file descriptor used to write to the kernel's trace - // buffer. It is initialized to -1 and set to an open file descriptor in - // init() while a lock on sMutex is held. - // - // This should only be used by a trace function after init() has - // successfully completed. - static int sTraceFD; - - // sEnabledTags is the set of tag bits for which tracing is currently - // enabled. It is initialized to 0 and set based on the - // atrace.tags.enableflags system property in init() while a lock on sMutex - // is held. - // - // This should only be used by a trace function after init() has - // successfully completed. - // - // This value is only ever non-zero when tracing is initialized and sTraceFD is not -1. - static uint64_t sEnabledTags; - - // sMutex is used to protect the execution of init(). - static Mutex sMutex; -}; - -class ScopedTrace { - -public: - inline ScopedTrace(uint64_t tag, const char* name) : - mTag(tag) { - Tracer::traceBegin(mTag, name); - } - - inline ~ScopedTrace() { - Tracer::traceEnd(mTag); - } - -private: - - uint64_t mTag; -}; - -}; // namespace android - -#endif // ANDROID_TRACE_H diff --git a/external/android/include/16/frameworks/native/include/utils/TypeHelpers.h b/external/android/include/16/frameworks/native/include/utils/TypeHelpers.h deleted file mode 100644 index 2bf33c3..0000000 --- a/external/android/include/16/frameworks/native/include/utils/TypeHelpers.h +++ /dev/null @@ -1,302 +0,0 @@ -/* - * Copyright (C) 2005 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_TYPE_HELPERS_H -#define ANDROID_TYPE_HELPERS_H - -#include -#include -#include -#include - -// --------------------------------------------------------------------------- - -namespace android { - -/* - * Types traits - */ - -template struct trait_trivial_ctor { enum { value = false }; }; -template struct trait_trivial_dtor { enum { value = false }; }; -template struct trait_trivial_copy { enum { value = false }; }; -template struct trait_trivial_move { enum { value = false }; }; -template struct trait_pointer { enum { value = false }; }; -template struct trait_pointer { enum { value = true }; }; - -template -struct traits { - enum { - // whether this type is a pointer - is_pointer = trait_pointer::value, - // whether this type's constructor is a no-op - has_trivial_ctor = is_pointer || trait_trivial_ctor::value, - // whether this type's destructor is a no-op - has_trivial_dtor = is_pointer || trait_trivial_dtor::value, - // whether this type type can be copy-constructed with memcpy - has_trivial_copy = is_pointer || trait_trivial_copy::value, - // whether this type can be moved with memmove - has_trivial_move = is_pointer || trait_trivial_move::value - }; -}; - -template -struct aggregate_traits { - enum { - is_pointer = false, - has_trivial_ctor = - traits::has_trivial_ctor && traits::has_trivial_ctor, - has_trivial_dtor = - traits::has_trivial_dtor && traits::has_trivial_dtor, - has_trivial_copy = - traits::has_trivial_copy && traits::has_trivial_copy, - has_trivial_move = - traits::has_trivial_move && traits::has_trivial_move - }; -}; - -#define ANDROID_TRIVIAL_CTOR_TRAIT( T ) \ - template<> struct trait_trivial_ctor< T > { enum { value = true }; }; - -#define ANDROID_TRIVIAL_DTOR_TRAIT( T ) \ - template<> struct trait_trivial_dtor< T > { enum { value = true }; }; - -#define ANDROID_TRIVIAL_COPY_TRAIT( T ) \ - template<> struct trait_trivial_copy< T > { enum { value = true }; }; - -#define ANDROID_TRIVIAL_MOVE_TRAIT( T ) \ - template<> struct trait_trivial_move< T > { enum { value = true }; }; - -#define ANDROID_BASIC_TYPES_TRAITS( T ) \ - ANDROID_TRIVIAL_CTOR_TRAIT( T ) \ - ANDROID_TRIVIAL_DTOR_TRAIT( T ) \ - ANDROID_TRIVIAL_COPY_TRAIT( T ) \ - ANDROID_TRIVIAL_MOVE_TRAIT( T ) - -// --------------------------------------------------------------------------- - -/* - * basic types traits - */ - -ANDROID_BASIC_TYPES_TRAITS( void ) -ANDROID_BASIC_TYPES_TRAITS( bool ) -ANDROID_BASIC_TYPES_TRAITS( char ) -ANDROID_BASIC_TYPES_TRAITS( unsigned char ) -ANDROID_BASIC_TYPES_TRAITS( short ) -ANDROID_BASIC_TYPES_TRAITS( unsigned short ) -ANDROID_BASIC_TYPES_TRAITS( int ) -ANDROID_BASIC_TYPES_TRAITS( unsigned int ) -ANDROID_BASIC_TYPES_TRAITS( long ) -ANDROID_BASIC_TYPES_TRAITS( unsigned long ) -ANDROID_BASIC_TYPES_TRAITS( long long ) -ANDROID_BASIC_TYPES_TRAITS( unsigned long long ) -ANDROID_BASIC_TYPES_TRAITS( float ) -ANDROID_BASIC_TYPES_TRAITS( double ) - -// --------------------------------------------------------------------------- - - -/* - * compare and order types - */ - -template inline -int strictly_order_type(const TYPE& lhs, const TYPE& rhs) { - return (lhs < rhs) ? 1 : 0; -} - -template inline -int compare_type(const TYPE& lhs, const TYPE& rhs) { - return strictly_order_type(rhs, lhs) - strictly_order_type(lhs, rhs); -} - -/* - * create, destroy, copy and move types... - */ - -template inline -void construct_type(TYPE* p, size_t n) { - if (!traits::has_trivial_ctor) { - while (n--) { - new(p++) TYPE; - } - } -} - -template inline -void destroy_type(TYPE* p, size_t n) { - if (!traits::has_trivial_dtor) { - while (n--) { - p->~TYPE(); - p++; - } - } -} - -template inline -void copy_type(TYPE* d, const TYPE* s, size_t n) { - if (!traits::has_trivial_copy) { - while (n--) { - new(d) TYPE(*s); - d++, s++; - } - } else { - memcpy(d,s,n*sizeof(TYPE)); - } -} - -template inline -void splat_type(TYPE* where, const TYPE* what, size_t n) { - if (!traits::has_trivial_copy) { - while (n--) { - new(where) TYPE(*what); - where++; - } - } else { - while (n--) { - *where++ = *what; - } - } -} - -template inline -void move_forward_type(TYPE* d, const TYPE* s, size_t n = 1) { - if ((traits::has_trivial_dtor && traits::has_trivial_copy) - || traits::has_trivial_move) - { - memmove(d,s,n*sizeof(TYPE)); - } else { - d += n; - s += n; - while (n--) { - --d, --s; - if (!traits::has_trivial_copy) { - new(d) TYPE(*s); - } else { - *d = *s; - } - if (!traits::has_trivial_dtor) { - s->~TYPE(); - } - } - } -} - -template inline -void move_backward_type(TYPE* d, const TYPE* s, size_t n = 1) { - if ((traits::has_trivial_dtor && traits::has_trivial_copy) - || traits::has_trivial_move) - { - memmove(d,s,n*sizeof(TYPE)); - } else { - while (n--) { - if (!traits::has_trivial_copy) { - new(d) TYPE(*s); - } else { - *d = *s; - } - if (!traits::has_trivial_dtor) { - s->~TYPE(); - } - d++, s++; - } - } -} - -// --------------------------------------------------------------------------- - -/* - * a key/value pair - */ - -template -struct key_value_pair_t { - typedef KEY key_t; - typedef VALUE value_t; - - KEY key; - VALUE value; - key_value_pair_t() { } - key_value_pair_t(const key_value_pair_t& o) : key(o.key), value(o.value) { } - key_value_pair_t(const KEY& k, const VALUE& v) : key(k), value(v) { } - key_value_pair_t(const KEY& k) : key(k) { } - inline bool operator < (const key_value_pair_t& o) const { - return strictly_order_type(key, o.key); - } - inline const KEY& getKey() const { - return key; - } - inline const VALUE& getValue() const { - return value; - } -}; - -template -struct trait_trivial_ctor< key_value_pair_t > -{ enum { value = aggregate_traits::has_trivial_ctor }; }; -template -struct trait_trivial_dtor< key_value_pair_t > -{ enum { value = aggregate_traits::has_trivial_dtor }; }; -template -struct trait_trivial_copy< key_value_pair_t > -{ enum { value = aggregate_traits::has_trivial_copy }; }; -template -struct trait_trivial_move< key_value_pair_t > -{ enum { value = aggregate_traits::has_trivial_move }; }; - -// --------------------------------------------------------------------------- - -/* - * Hash codes. - */ -typedef uint32_t hash_t; - -template -hash_t hash_type(const TKey& key); - -/* Built-in hash code specializations. - * Assumes pointers are 32bit. */ -#define ANDROID_INT32_HASH(T) \ - template <> inline hash_t hash_type(const T& value) { return hash_t(value); } -#define ANDROID_INT64_HASH(T) \ - template <> inline hash_t hash_type(const T& value) { \ - return hash_t((value >> 32) ^ value); } -#define ANDROID_REINTERPRET_HASH(T, R) \ - template <> inline hash_t hash_type(const T& value) { \ - return hash_type(*reinterpret_cast(&value)); } - -ANDROID_INT32_HASH(bool) -ANDROID_INT32_HASH(int8_t) -ANDROID_INT32_HASH(uint8_t) -ANDROID_INT32_HASH(int16_t) -ANDROID_INT32_HASH(uint16_t) -ANDROID_INT32_HASH(int32_t) -ANDROID_INT32_HASH(uint32_t) -ANDROID_INT64_HASH(int64_t) -ANDROID_INT64_HASH(uint64_t) -ANDROID_REINTERPRET_HASH(float, uint32_t) -ANDROID_REINTERPRET_HASH(double, uint64_t) - -template inline hash_t hash_type(const T*& value) { - return hash_type(uintptr_t(value)); -} - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_TYPE_HELPERS_H diff --git a/external/android/include/16/frameworks/native/include/utils/Unicode.h b/external/android/include/16/frameworks/native/include/utils/Unicode.h deleted file mode 100644 index 9273533..0000000 --- a/external/android/include/16/frameworks/native/include/utils/Unicode.h +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (C) 2005 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_UNICODE_H -#define ANDROID_UNICODE_H - -#include -#include - -extern "C" { - -typedef uint32_t char32_t; -typedef uint16_t char16_t; - -// Standard string functions on char16_t strings. -int strcmp16(const char16_t *, const char16_t *); -int strncmp16(const char16_t *s1, const char16_t *s2, size_t n); -size_t strlen16(const char16_t *); -size_t strnlen16(const char16_t *, size_t); -char16_t *strcpy16(char16_t *, const char16_t *); -char16_t *strncpy16(char16_t *, const char16_t *, size_t); - -// Version of comparison that supports embedded nulls. -// This is different than strncmp() because we don't stop -// at a nul character and consider the strings to be different -// if the lengths are different (thus we need to supply the -// lengths of both strings). This can also be used when -// your string is not nul-terminated as it will have the -// equivalent result as strcmp16 (unlike strncmp16). -int strzcmp16(const char16_t *s1, size_t n1, const char16_t *s2, size_t n2); - -// Version of strzcmp16 for comparing strings in different endianness. -int strzcmp16_h_n(const char16_t *s1H, size_t n1, const char16_t *s2N, size_t n2); - -// Standard string functions on char32_t strings. -size_t strlen32(const char32_t *); -size_t strnlen32(const char32_t *, size_t); - -/** - * Measure the length of a UTF-32 string in UTF-8. If the string is invalid - * such as containing a surrogate character, -1 will be returned. - */ -ssize_t utf32_to_utf8_length(const char32_t *src, size_t src_len); - -/** - * Stores a UTF-8 string converted from "src" in "dst", if "dst_length" is not - * large enough to store the string, the part of the "src" string is stored - * into "dst" as much as possible. See the examples for more detail. - * Returns the size actually used for storing the string. - * dst" is not null-terminated when dst_len is fully used (like strncpy). - * - * Example 1 - * "src" == \u3042\u3044 (\xE3\x81\x82\xE3\x81\x84) - * "src_len" == 2 - * "dst_len" >= 7 - * -> - * Returned value == 6 - * "dst" becomes \xE3\x81\x82\xE3\x81\x84\0 - * (note that "dst" is null-terminated) - * - * Example 2 - * "src" == \u3042\u3044 (\xE3\x81\x82\xE3\x81\x84) - * "src_len" == 2 - * "dst_len" == 5 - * -> - * Returned value == 3 - * "dst" becomes \xE3\x81\x82\0 - * (note that "dst" is null-terminated, but \u3044 is not stored in "dst" - * since "dst" does not have enough size to store the character) - * - * Example 3 - * "src" == \u3042\u3044 (\xE3\x81\x82\xE3\x81\x84) - * "src_len" == 2 - * "dst_len" == 6 - * -> - * Returned value == 6 - * "dst" becomes \xE3\x81\x82\xE3\x81\x84 - * (note that "dst" is NOT null-terminated, like strncpy) - */ -void utf32_to_utf8(const char32_t* src, size_t src_len, char* dst); - -/** - * Returns the unicode value at "index". - * Returns -1 when the index is invalid (equals to or more than "src_len"). - * If returned value is positive, it is able to be converted to char32_t, which - * is unsigned. Then, if "next_index" is not NULL, the next index to be used is - * stored in "next_index". "next_index" can be NULL. - */ -int32_t utf32_from_utf8_at(const char *src, size_t src_len, size_t index, size_t *next_index); - - -/** - * Returns the UTF-8 length of UTF-16 string "src". - */ -ssize_t utf16_to_utf8_length(const char16_t *src, size_t src_len); - -/** - * Converts a UTF-16 string to UTF-8. The destination buffer must be large - * enough to fit the UTF-16 as measured by utf16_to_utf8_length with an added - * NULL terminator. - */ -void utf16_to_utf8(const char16_t* src, size_t src_len, char* dst); - -/** - * Returns the length of "src" when "src" is valid UTF-8 string. - * Returns 0 if src is NULL or 0-length string. Returns -1 when the source - * is an invalid string. - * - * This function should be used to determine whether "src" is valid UTF-8 - * characters with valid unicode codepoints. "src" must be null-terminated. - * - * If you are going to use other utf8_to_... functions defined in this header - * with string which may not be valid UTF-8 with valid codepoint (form 0 to - * 0x10FFFF), you should use this function before calling others, since the - * other functions do not check whether the string is valid UTF-8 or not. - * - * If you do not care whether "src" is valid UTF-8 or not, you should use - * strlen() as usual, which should be much faster. - */ -ssize_t utf8_length(const char *src); - -/** - * Measure the length of a UTF-32 string. - */ -size_t utf8_to_utf32_length(const char *src, size_t src_len); - -/** - * Stores a UTF-32 string converted from "src" in "dst". "dst" must be large - * enough to store the entire converted string as measured by - * utf8_to_utf32_length plus space for a NULL terminator. - */ -void utf8_to_utf32(const char* src, size_t src_len, char32_t* dst); - -/** - * Returns the UTF-16 length of UTF-8 string "src". - */ -ssize_t utf8_to_utf16_length(const uint8_t* src, size_t srcLen); - -/** - * Convert UTF-8 to UTF-16 including surrogate pairs. - * Returns a pointer to the end of the string (where a null terminator might go - * if you wanted to add one). - */ -char16_t* utf8_to_utf16_no_null_terminator(const uint8_t* src, size_t srcLen, char16_t* dst); - -/** - * Convert UTF-8 to UTF-16 including surrogate pairs. The destination buffer - * must be large enough to hold the result as measured by utf8_to_utf16_length - * plus an added NULL terminator. - */ -void utf8_to_utf16(const uint8_t* src, size_t srcLen, char16_t* dst); - -} - -#endif diff --git a/external/android/include/16/frameworks/native/include/utils/UniquePtr.h b/external/android/include/16/frameworks/native/include/utils/UniquePtr.h deleted file mode 100644 index bc62fe6..0000000 --- a/external/android/include/16/frameworks/native/include/utils/UniquePtr.h +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -/* === NOTE === NOTE === NOTE === NOTE === NOTE === NOTE === NOTE === NOTE === - * - * THIS IS A COPY OF libcore/include/UniquePtr.h AND AS SUCH THAT IS THE - * CANONICAL SOURCE OF THIS FILE. PLEASE KEEP THEM IN SYNC. - * - * === NOTE === NOTE === NOTE === NOTE === NOTE === NOTE === NOTE === NOTE === - */ - -#ifndef UNIQUE_PTR_H_included -#define UNIQUE_PTR_H_included - -#include // For NULL. - -// Default deleter for pointer types. -template -struct DefaultDelete { - enum { type_must_be_complete = sizeof(T) }; - DefaultDelete() {} - void operator()(T* p) const { - delete p; - } -}; - -// Default deleter for array types. -template -struct DefaultDelete { - enum { type_must_be_complete = sizeof(T) }; - void operator()(T* p) const { - delete[] p; - } -}; - -// A smart pointer that deletes the given pointer on destruction. -// Equivalent to C++0x's std::unique_ptr (a combination of boost::scoped_ptr -// and boost::scoped_array). -// Named to be in keeping with Android style but also to avoid -// collision with any other implementation, until we can switch over -// to unique_ptr. -// Use thus: -// UniquePtr c(new C); -template > -class UniquePtr { -public: - // Construct a new UniquePtr, taking ownership of the given raw pointer. - explicit UniquePtr(T* ptr = NULL) : mPtr(ptr) { - } - - ~UniquePtr() { - reset(); - } - - // Accessors. - T& operator*() const { return *mPtr; } - T* operator->() const { return mPtr; } - T* get() const { return mPtr; } - - // Returns the raw pointer and hands over ownership to the caller. - // The pointer will not be deleted by UniquePtr. - T* release() __attribute__((warn_unused_result)) { - T* result = mPtr; - mPtr = NULL; - return result; - } - - // Takes ownership of the given raw pointer. - // If this smart pointer previously owned a different raw pointer, that - // raw pointer will be freed. - void reset(T* ptr = NULL) { - if (ptr != mPtr) { - D()(mPtr); - mPtr = ptr; - } - } - -private: - // The raw pointer. - T* mPtr; - - // Comparing unique pointers is probably a mistake, since they're unique. - template bool operator==(const UniquePtr& p) const; - template bool operator!=(const UniquePtr& p) const; - - // Disallow copy and assignment. - UniquePtr(const UniquePtr&); - void operator=(const UniquePtr&); -}; - -// Partial specialization for array types. Like std::unique_ptr, this removes -// operator* and operator-> but adds operator[]. -template -class UniquePtr { -public: - explicit UniquePtr(T* ptr = NULL) : mPtr(ptr) { - } - - ~UniquePtr() { - reset(); - } - - T& operator[](size_t i) const { - return mPtr[i]; - } - T* get() const { return mPtr; } - - T* release() __attribute__((warn_unused_result)) { - T* result = mPtr; - mPtr = NULL; - return result; - } - - void reset(T* ptr = NULL) { - if (ptr != mPtr) { - D()(mPtr); - mPtr = ptr; - } - } - -private: - T* mPtr; - - // Disallow copy and assignment. - UniquePtr(const UniquePtr&); - void operator=(const UniquePtr&); -}; - -#if UNIQUE_PTR_TESTS - -// Run these tests with: -// g++ -g -DUNIQUE_PTR_TESTS -x c++ UniquePtr.h && ./a.out - -#include - -static void assert(bool b) { - if (!b) { - fprintf(stderr, "FAIL\n"); - abort(); - } - fprintf(stderr, "OK\n"); -} -static int cCount = 0; -struct C { - C() { ++cCount; } - ~C() { --cCount; } -}; -static bool freed = false; -struct Freer { - void operator()(int* p) { - assert(*p == 123); - free(p); - freed = true; - } -}; - -int main(int argc, char* argv[]) { - // - // UniquePtr tests... - // - - // Can we free a single object? - { - UniquePtr c(new C); - assert(cCount == 1); - } - assert(cCount == 0); - // Does release work? - C* rawC; - { - UniquePtr c(new C); - assert(cCount == 1); - rawC = c.release(); - } - assert(cCount == 1); - delete rawC; - // Does reset work? - { - UniquePtr c(new C); - assert(cCount == 1); - c.reset(new C); - assert(cCount == 1); - } - assert(cCount == 0); - - // - // UniquePtr tests... - // - - // Can we free an array? - { - UniquePtr cs(new C[4]); - assert(cCount == 4); - } - assert(cCount == 0); - // Does release work? - { - UniquePtr c(new C[4]); - assert(cCount == 4); - rawC = c.release(); - } - assert(cCount == 4); - delete[] rawC; - // Does reset work? - { - UniquePtr c(new C[4]); - assert(cCount == 4); - c.reset(new C[2]); - assert(cCount == 2); - } - assert(cCount == 0); - - // - // Custom deleter tests... - // - assert(!freed); - { - UniquePtr i(reinterpret_cast(malloc(sizeof(int)))); - *i = 123; - } - assert(freed); - return 0; -} -#endif - -#endif // UNIQUE_PTR_H_included diff --git a/external/android/include/16/frameworks/native/include/utils/Vector.h b/external/android/include/16/frameworks/native/include/utils/Vector.h deleted file mode 100644 index e39a5b7..0000000 --- a/external/android/include/16/frameworks/native/include/utils/Vector.h +++ /dev/null @@ -1,424 +0,0 @@ -/* - * Copyright (C) 2005 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_VECTOR_H -#define ANDROID_VECTOR_H - -#include -#include -#include - -#include -#include -#include - -// --------------------------------------------------------------------------- - -namespace android { - -template -class SortedVector; - -/*! - * The main templated vector class ensuring type safety - * while making use of VectorImpl. - * This is the class users want to use. - */ - -template -class Vector : private VectorImpl -{ -public: - typedef TYPE value_type; - - /*! - * Constructors and destructors - */ - - Vector(); - Vector(const Vector& rhs); - explicit Vector(const SortedVector& rhs); - virtual ~Vector(); - - /*! copy operator */ - const Vector& operator = (const Vector& rhs) const; - Vector& operator = (const Vector& rhs); - - const Vector& operator = (const SortedVector& rhs) const; - Vector& operator = (const SortedVector& rhs); - - /* - * empty the vector - */ - - inline void clear() { VectorImpl::clear(); } - - /*! - * vector stats - */ - - //! returns number of items in the vector - inline size_t size() const { return VectorImpl::size(); } - //! returns wether or not the vector is empty - inline bool isEmpty() const { return VectorImpl::isEmpty(); } - //! returns how many items can be stored without reallocating the backing store - inline size_t capacity() const { return VectorImpl::capacity(); } - //! setst the capacity. capacity can never be reduced less than size() - inline ssize_t setCapacity(size_t size) { return VectorImpl::setCapacity(size); } - - /*! - * C-style array access - */ - - //! read-only C-style access - inline const TYPE* array() const; - //! read-write C-style access - TYPE* editArray(); - - /*! - * accessors - */ - - //! read-only access to an item at a given index - inline const TYPE& operator [] (size_t index) const; - //! alternate name for operator [] - inline const TYPE& itemAt(size_t index) const; - //! stack-usage of the vector. returns the top of the stack (last element) - const TYPE& top() const; - //! same as operator [], but allows to access the vector backward (from the end) with a negative index - const TYPE& mirrorItemAt(ssize_t index) const; - - /*! - * modifing the array - */ - - //! copy-on write support, grants write access to an item - TYPE& editItemAt(size_t index); - //! grants right acces to the top of the stack (last element) - TYPE& editTop(); - - /*! - * append/insert another vector - */ - - //! insert another vector at a given index - ssize_t insertVectorAt(const Vector& vector, size_t index); - - //! append another vector at the end of this one - ssize_t appendVector(const Vector& vector); - - - //! insert an array at a given index - ssize_t insertArrayAt(const TYPE* array, size_t index, size_t length); - - //! append an array at the end of this vector - ssize_t appendArray(const TYPE* array, size_t length); - - /*! - * add/insert/replace items - */ - - //! insert one or several items initialized with their default constructor - inline ssize_t insertAt(size_t index, size_t numItems = 1); - //! insert one or several items initialized from a prototype item - ssize_t insertAt(const TYPE& prototype_item, size_t index, size_t numItems = 1); - //! pop the top of the stack (removes the last element). No-op if the stack's empty - inline void pop(); - //! pushes an item initialized with its default constructor - inline void push(); - //! pushes an item on the top of the stack - void push(const TYPE& item); - //! same as push() but returns the index the item was added at (or an error) - inline ssize_t add(); - //! same as push() but returns the index the item was added at (or an error) - ssize_t add(const TYPE& item); - //! replace an item with a new one initialized with its default constructor - inline ssize_t replaceAt(size_t index); - //! replace an item with a new one - ssize_t replaceAt(const TYPE& item, size_t index); - - /*! - * remove items - */ - - //! remove several items - inline ssize_t removeItemsAt(size_t index, size_t count = 1); - //! remove one item - inline ssize_t removeAt(size_t index) { return removeItemsAt(index); } - - /*! - * sort (stable) the array - */ - - typedef int (*compar_t)(const TYPE* lhs, const TYPE* rhs); - typedef int (*compar_r_t)(const TYPE* lhs, const TYPE* rhs, void* state); - - inline status_t sort(compar_t cmp); - inline status_t sort(compar_r_t cmp, void* state); - - // for debugging only - inline size_t getItemSize() const { return itemSize(); } - - - /* - * these inlines add some level of compatibility with STL. eventually - * we should probably turn things around. - */ - typedef TYPE* iterator; - typedef TYPE const* const_iterator; - - inline iterator begin() { return editArray(); } - inline iterator end() { return editArray() + size(); } - inline const_iterator begin() const { return array(); } - inline const_iterator end() const { return array() + size(); } - inline void reserve(size_t n) { setCapacity(n); } - inline bool empty() const{ return isEmpty(); } - inline void push_back(const TYPE& item) { insertAt(item, size(), 1); } - inline void push_front(const TYPE& item) { insertAt(item, 0, 1); } - inline iterator erase(iterator pos) { - return begin() + removeItemsAt(pos-array()); - } - -protected: - virtual void do_construct(void* storage, size_t num) const; - virtual void do_destroy(void* storage, size_t num) const; - virtual void do_copy(void* dest, const void* from, size_t num) const; - virtual void do_splat(void* dest, const void* item, size_t num) const; - virtual void do_move_forward(void* dest, const void* from, size_t num) const; - virtual void do_move_backward(void* dest, const void* from, size_t num) const; -}; - -// Vector can be trivially moved using memcpy() because moving does not -// require any change to the underlying SharedBuffer contents or reference count. -template struct trait_trivial_move > { enum { value = true }; }; - -// --------------------------------------------------------------------------- -// No user serviceable parts from here... -// --------------------------------------------------------------------------- - -template inline -Vector::Vector() - : VectorImpl(sizeof(TYPE), - ((traits::has_trivial_ctor ? HAS_TRIVIAL_CTOR : 0) - |(traits::has_trivial_dtor ? HAS_TRIVIAL_DTOR : 0) - |(traits::has_trivial_copy ? HAS_TRIVIAL_COPY : 0)) - ) -{ -} - -template inline -Vector::Vector(const Vector& rhs) - : VectorImpl(rhs) { -} - -template inline -Vector::Vector(const SortedVector& rhs) - : VectorImpl(static_cast(rhs)) { -} - -template inline -Vector::~Vector() { - finish_vector(); -} - -template inline -Vector& Vector::operator = (const Vector& rhs) { - VectorImpl::operator = (rhs); - return *this; -} - -template inline -const Vector& Vector::operator = (const Vector& rhs) const { - VectorImpl::operator = (static_cast(rhs)); - return *this; -} - -template inline -Vector& Vector::operator = (const SortedVector& rhs) { - VectorImpl::operator = (static_cast(rhs)); - return *this; -} - -template inline -const Vector& Vector::operator = (const SortedVector& rhs) const { - VectorImpl::operator = (rhs); - return *this; -} - -template inline -const TYPE* Vector::array() const { - return static_cast(arrayImpl()); -} - -template inline -TYPE* Vector::editArray() { - return static_cast(editArrayImpl()); -} - - -template inline -const TYPE& Vector::operator[](size_t index) const { - LOG_FATAL_IF( index>=size(), - "itemAt: index %d is past size %d", (int)index, (int)size() ); - return *(array() + index); -} - -template inline -const TYPE& Vector::itemAt(size_t index) const { - return operator[](index); -} - -template inline -const TYPE& Vector::mirrorItemAt(ssize_t index) const { - LOG_FATAL_IF( (index>0 ? index : -index)>=size(), - "mirrorItemAt: index %d is past size %d", - (int)index, (int)size() ); - return *(array() + ((index<0) ? (size()-index) : index)); -} - -template inline -const TYPE& Vector::top() const { - return *(array() + size() - 1); -} - -template inline -TYPE& Vector::editItemAt(size_t index) { - return *( static_cast(editItemLocation(index)) ); -} - -template inline -TYPE& Vector::editTop() { - return *( static_cast(editItemLocation(size()-1)) ); -} - -template inline -ssize_t Vector::insertVectorAt(const Vector& vector, size_t index) { - return VectorImpl::insertVectorAt(reinterpret_cast(vector), index); -} - -template inline -ssize_t Vector::appendVector(const Vector& vector) { - return VectorImpl::appendVector(reinterpret_cast(vector)); -} - -template inline -ssize_t Vector::insertArrayAt(const TYPE* array, size_t index, size_t length) { - return VectorImpl::insertArrayAt(array, index, length); -} - -template inline -ssize_t Vector::appendArray(const TYPE* array, size_t length) { - return VectorImpl::appendArray(array, length); -} - -template inline -ssize_t Vector::insertAt(const TYPE& item, size_t index, size_t numItems) { - return VectorImpl::insertAt(&item, index, numItems); -} - -template inline -void Vector::push(const TYPE& item) { - return VectorImpl::push(&item); -} - -template inline -ssize_t Vector::add(const TYPE& item) { - return VectorImpl::add(&item); -} - -template inline -ssize_t Vector::replaceAt(const TYPE& item, size_t index) { - return VectorImpl::replaceAt(&item, index); -} - -template inline -ssize_t Vector::insertAt(size_t index, size_t numItems) { - return VectorImpl::insertAt(index, numItems); -} - -template inline -void Vector::pop() { - VectorImpl::pop(); -} - -template inline -void Vector::push() { - VectorImpl::push(); -} - -template inline -ssize_t Vector::add() { - return VectorImpl::add(); -} - -template inline -ssize_t Vector::replaceAt(size_t index) { - return VectorImpl::replaceAt(index); -} - -template inline -ssize_t Vector::removeItemsAt(size_t index, size_t count) { - return VectorImpl::removeItemsAt(index, count); -} - -template inline -status_t Vector::sort(Vector::compar_t cmp) { - return VectorImpl::sort((VectorImpl::compar_t)cmp); -} - -template inline -status_t Vector::sort(Vector::compar_r_t cmp, void* state) { - return VectorImpl::sort((VectorImpl::compar_r_t)cmp, state); -} - -// --------------------------------------------------------------------------- - -template -void Vector::do_construct(void* storage, size_t num) const { - construct_type( reinterpret_cast(storage), num ); -} - -template -void Vector::do_destroy(void* storage, size_t num) const { - destroy_type( reinterpret_cast(storage), num ); -} - -template -void Vector::do_copy(void* dest, const void* from, size_t num) const { - copy_type( reinterpret_cast(dest), reinterpret_cast(from), num ); -} - -template -void Vector::do_splat(void* dest, const void* item, size_t num) const { - splat_type( reinterpret_cast(dest), reinterpret_cast(item), num ); -} - -template -void Vector::do_move_forward(void* dest, const void* from, size_t num) const { - move_forward_type( reinterpret_cast(dest), reinterpret_cast(from), num ); -} - -template -void Vector::do_move_backward(void* dest, const void* from, size_t num) const { - move_backward_type( reinterpret_cast(dest), reinterpret_cast(from), num ); -} - -}; // namespace android - - -// --------------------------------------------------------------------------- - -#endif // ANDROID_VECTOR_H diff --git a/external/android/include/16/frameworks/native/include/utils/VectorImpl.h b/external/android/include/16/frameworks/native/include/utils/VectorImpl.h deleted file mode 100644 index c4ec2ff..0000000 --- a/external/android/include/16/frameworks/native/include/utils/VectorImpl.h +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright (C) 2005 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_VECTOR_IMPL_H -#define ANDROID_VECTOR_IMPL_H - -#include -#include -#include -#include - -// --------------------------------------------------------------------------- -// No user serviceable parts in here... -// --------------------------------------------------------------------------- - -namespace android { - -/*! - * Implementation of the guts of the vector<> class - * this ensures backward binary compatibility and - * reduces code size. - * For performance reasons, we expose mStorage and mCount - * so these fields are set in stone. - * - */ - -class VectorImpl -{ -public: - enum { // flags passed to the ctor - HAS_TRIVIAL_CTOR = 0x00000001, - HAS_TRIVIAL_DTOR = 0x00000002, - HAS_TRIVIAL_COPY = 0x00000004, - }; - - VectorImpl(size_t itemSize, uint32_t flags); - VectorImpl(const VectorImpl& rhs); - virtual ~VectorImpl(); - - /*! must be called from subclasses destructor */ - void finish_vector(); - - VectorImpl& operator = (const VectorImpl& rhs); - - /*! C-style array access */ - inline const void* arrayImpl() const { return mStorage; } - void* editArrayImpl(); - - /*! vector stats */ - inline size_t size() const { return mCount; } - inline bool isEmpty() const { return mCount == 0; } - size_t capacity() const; - ssize_t setCapacity(size_t size); - - /*! append/insert another vector or array */ - ssize_t insertVectorAt(const VectorImpl& vector, size_t index); - ssize_t appendVector(const VectorImpl& vector); - ssize_t insertArrayAt(const void* array, size_t index, size_t length); - ssize_t appendArray(const void* array, size_t length); - - /*! add/insert/replace items */ - ssize_t insertAt(size_t where, size_t numItems = 1); - ssize_t insertAt(const void* item, size_t where, size_t numItems = 1); - void pop(); - void push(); - void push(const void* item); - ssize_t add(); - ssize_t add(const void* item); - ssize_t replaceAt(size_t index); - ssize_t replaceAt(const void* item, size_t index); - - /*! remove items */ - ssize_t removeItemsAt(size_t index, size_t count = 1); - void clear(); - - const void* itemLocation(size_t index) const; - void* editItemLocation(size_t index); - - typedef int (*compar_t)(const void* lhs, const void* rhs); - typedef int (*compar_r_t)(const void* lhs, const void* rhs, void* state); - status_t sort(compar_t cmp); - status_t sort(compar_r_t cmp, void* state); - -protected: - size_t itemSize() const; - void release_storage(); - - virtual void do_construct(void* storage, size_t num) const = 0; - virtual void do_destroy(void* storage, size_t num) const = 0; - virtual void do_copy(void* dest, const void* from, size_t num) const = 0; - virtual void do_splat(void* dest, const void* item, size_t num) const = 0; - virtual void do_move_forward(void* dest, const void* from, size_t num) const = 0; - virtual void do_move_backward(void* dest, const void* from, size_t num) const = 0; - - // take care of FBC... - virtual void reservedVectorImpl1(); - virtual void reservedVectorImpl2(); - virtual void reservedVectorImpl3(); - virtual void reservedVectorImpl4(); - virtual void reservedVectorImpl5(); - virtual void reservedVectorImpl6(); - virtual void reservedVectorImpl7(); - virtual void reservedVectorImpl8(); - -private: - void* _grow(size_t where, size_t amount); - void _shrink(size_t where, size_t amount); - - inline void _do_construct(void* storage, size_t num) const; - inline void _do_destroy(void* storage, size_t num) const; - inline void _do_copy(void* dest, const void* from, size_t num) const; - inline void _do_splat(void* dest, const void* item, size_t num) const; - inline void _do_move_forward(void* dest, const void* from, size_t num) const; - inline void _do_move_backward(void* dest, const void* from, size_t num) const; - - // These 2 fields are exposed in the inlines below, - // so they're set in stone. - void * mStorage; // base address of the vector - size_t mCount; // number of items - - const uint32_t mFlags; - const size_t mItemSize; -}; - - - -class SortedVectorImpl : public VectorImpl -{ -public: - SortedVectorImpl(size_t itemSize, uint32_t flags); - SortedVectorImpl(const VectorImpl& rhs); - virtual ~SortedVectorImpl(); - - SortedVectorImpl& operator = (const SortedVectorImpl& rhs); - - //! finds the index of an item - ssize_t indexOf(const void* item) const; - - //! finds where this item should be inserted - size_t orderOf(const void* item) const; - - //! add an item in the right place (or replaces it if there is one) - ssize_t add(const void* item); - - //! merges a vector into this one - ssize_t merge(const VectorImpl& vector); - ssize_t merge(const SortedVectorImpl& vector); - - //! removes an item - ssize_t remove(const void* item); - -protected: - virtual int do_compare(const void* lhs, const void* rhs) const = 0; - - // take care of FBC... - virtual void reservedSortedVectorImpl1(); - virtual void reservedSortedVectorImpl2(); - virtual void reservedSortedVectorImpl3(); - virtual void reservedSortedVectorImpl4(); - virtual void reservedSortedVectorImpl5(); - virtual void reservedSortedVectorImpl6(); - virtual void reservedSortedVectorImpl7(); - virtual void reservedSortedVectorImpl8(); - -private: - ssize_t _indexOrderOf(const void* item, size_t* order = 0) const; - - // these are made private, because they can't be used on a SortedVector - // (they don't have an implementation either) - ssize_t add(); - void pop(); - void push(); - void push(const void* item); - ssize_t insertVectorAt(const VectorImpl& vector, size_t index); - ssize_t appendVector(const VectorImpl& vector); - ssize_t insertArrayAt(const void* array, size_t index, size_t length); - ssize_t appendArray(const void* array, size_t length); - ssize_t insertAt(size_t where, size_t numItems = 1); - ssize_t insertAt(const void* item, size_t where, size_t numItems = 1); - ssize_t replaceAt(size_t index); - ssize_t replaceAt(const void* item, size_t index); -}; - -}; // namespace android - - -// --------------------------------------------------------------------------- - -#endif // ANDROID_VECTOR_IMPL_H diff --git a/external/android/include/16/frameworks/native/include/utils/WorkQueue.h b/external/android/include/16/frameworks/native/include/utils/WorkQueue.h deleted file mode 100644 index e3c75b2..0000000 --- a/external/android/include/16/frameworks/native/include/utils/WorkQueue.h +++ /dev/null @@ -1,119 +0,0 @@ -/*] - * Copyright (C) 2012 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 _LIBS_UTILS_WORK_QUEUE_H -#define _LIBS_UTILS_WORK_QUEUE_H - -#include -#include -#include - -namespace android { - -/* - * A threaded work queue. - * - * This class is designed to make it easy to run a bunch of isolated work - * units in parallel, using up to the specified number of threads. - * To use it, write a loop to post work units to the work queue, then synchronize - * on the queue at the end. - */ -class WorkQueue { -public: - class WorkUnit { - public: - WorkUnit() { } - virtual ~WorkUnit() { } - - /* - * Runs the work unit. - * If the result is 'true' then the work queue continues scheduling work as usual. - * If the result is 'false' then the work queue is canceled. - */ - virtual bool run() = 0; - }; - - /* Creates a work queue with the specified maximum number of work threads. */ - WorkQueue(size_t maxThreads, bool canCallJava = true); - - /* Destroys the work queue. - * Cancels pending work and waits for all remaining threads to complete. - */ - ~WorkQueue(); - - /* Posts a work unit to run later. - * If the work queue has been canceled or is already finished, returns INVALID_OPERATION - * and does not take ownership of the work unit (caller must destroy it itself). - * Otherwise, returns OK and takes ownership of the work unit (the work queue will - * destroy it automatically). - * - * For flow control, this method blocks when the size of the pending work queue is more - * 'backlog' times the number of threads. This condition reduces the rate of entry into - * the pending work queue and prevents it from growing much more rapidly than the - * work threads can actually handle. - * - * If 'backlog' is 0, then no throttle is applied. - */ - status_t schedule(WorkUnit* workUnit, size_t backlog = 2); - - /* Cancels all pending work. - * If the work queue is already finished, returns INVALID_OPERATION. - * If the work queue is already canceled, returns OK and does nothing else. - * Otherwise, returns OK, discards all pending work units and prevents additional - * work units from being scheduled. - * - * Call finish() after cancel() to wait for all remaining work to complete. - */ - status_t cancel(); - - /* Waits for all work to complete. - * If the work queue is already finished, returns INVALID_OPERATION. - * Otherwise, waits for all work to complete and returns OK. - */ - status_t finish(); - -private: - class WorkThread : public Thread { - public: - WorkThread(WorkQueue* workQueue, bool canCallJava); - virtual ~WorkThread(); - - private: - virtual bool threadLoop(); - - WorkQueue* const mWorkQueue; - }; - - status_t cancelLocked(); - bool threadLoop(); // called from each work thread - - const size_t mMaxThreads; - const bool mCanCallJava; - - Mutex mLock; - Condition mWorkChangedCondition; - Condition mWorkDequeuedCondition; - - bool mCanceled; - bool mFinished; - size_t mIdleThreads; - Vector > mWorkThreads; - Vector mWorkUnits; -}; - -}; // namespace android - -#endif // _LIBS_UTILS_WORK_QUEUE_H diff --git a/external/android/include/16/frameworks/native/include/utils/ZipFileCRO.h b/external/android/include/16/frameworks/native/include/utils/ZipFileCRO.h deleted file mode 100644 index 3e42a95..0000000 --- a/external/android/include/16/frameworks/native/include/utils/ZipFileCRO.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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. - */ - -// -// C API for ead-only access to Zip archives, with minimal heap allocation. -// -#ifndef __LIBS_ZIPFILECRO_H -#define __LIBS_ZIPFILECRO_H - -#include -#include -#include - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Trivial typedef to ensure that ZipFileCRO is not treated as a simple integer. - */ -typedef void* ZipFileCRO; - -/* - * Trivial typedef to ensure that ZipEntryCRO is not treated as a simple - * integer. We use NULL to indicate an invalid value. - */ -typedef void* ZipEntryCRO; - -extern ZipFileCRO ZipFileXRO_open(const char* path); - -extern void ZipFileCRO_destroy(ZipFileCRO zip); - -extern ZipEntryCRO ZipFileCRO_findEntryByName(ZipFileCRO zip, - const char* fileName); - -extern bool ZipFileCRO_getEntryInfo(ZipFileCRO zip, ZipEntryCRO entry, - int* pMethod, size_t* pUncompLen, - size_t* pCompLen, off64_t* pOffset, long* pModWhen, long* pCrc32); - -extern bool ZipFileCRO_uncompressEntry(ZipFileCRO zip, ZipEntryCRO entry, int fd); - -#ifdef __cplusplus -} -#endif - -#endif /*__LIBS_ZIPFILECRO_H*/ diff --git a/external/android/include/16/frameworks/native/include/utils/ZipFileRO.h b/external/android/include/16/frameworks/native/include/utils/ZipFileRO.h deleted file mode 100644 index 547e36a..0000000 --- a/external/android/include/16/frameworks/native/include/utils/ZipFileRO.h +++ /dev/null @@ -1,262 +0,0 @@ -/* - * 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. - */ - -/* - * Read-only access to Zip archives, with minimal heap allocation. - * - * This is similar to the more-complete ZipFile class, but no attempt - * has been made to make them interchangeable. This class operates under - * a very different set of assumptions and constraints. - * - * One such assumption is that if you're getting file descriptors for - * use with this class as a child of a fork() operation, you must be on - * a pread() to guarantee correct operation. This is because pread() can - * atomically read at a file offset without worrying about a lock around an - * lseek() + read() pair. - */ -#ifndef __LIBS_ZIPFILERO_H -#define __LIBS_ZIPFILERO_H - -#include -#include -#include -#include - -#include -#include -#include -#include - -namespace android { - -/* - * Trivial typedef to ensure that ZipEntryRO is not treated as a simple - * integer. We use NULL to indicate an invalid value. - */ -typedef void* ZipEntryRO; - -/* - * Open a Zip archive for reading. - * - * We want "open" and "find entry by name" to be fast operations, and we - * want to use as little memory as possible. We memory-map the file, - * and load a hash table with pointers to the filenames (which aren't - * null-terminated). The other fields are at a fixed offset from the - * filename, so we don't need to extract those (but we do need to byte-read - * and endian-swap them every time we want them). - * - * To speed comparisons when doing a lookup by name, we could make the mapping - * "private" (copy-on-write) and null-terminate the filenames after verifying - * the record structure. However, this requires a private mapping of - * every page that the Central Directory touches. Easier to tuck a copy - * of the string length into the hash table entry. - * - * NOTE: If this is used on file descriptors inherited from a fork() operation, - * you must be on a platform that implements pread() to guarantee correctness - * on the shared file descriptors. - */ -class ZipFileRO { -public: - ZipFileRO() - : mFd(-1), mFileName(NULL), mFileLength(-1), - mDirectoryMap(NULL), - mNumEntries(-1), mDirectoryOffset(-1), - mHashTableSize(-1), mHashTable(NULL) - {} - - ~ZipFileRO(); - - /* - * Open an archive. - */ - status_t open(const char* zipFileName); - - /* - * Find an entry, by name. Returns the entry identifier, or NULL if - * not found. - * - * If two entries have the same name, one will be chosen at semi-random. - */ - ZipEntryRO findEntryByName(const char* fileName) const; - - /* - * Return the #of entries in the Zip archive. - */ - int getNumEntries(void) const { - return mNumEntries; - } - - /* - * Return the Nth entry. Zip file entries are not stored in sorted - * order, and updated entries may appear at the end, so anyone walking - * the archive needs to avoid making ordering assumptions. We take - * that further by returning the Nth non-empty entry in the hash table - * rather than the Nth entry in the archive. - * - * Valid values are [0..numEntries). - * - * [This is currently O(n). If it needs to be fast we can allocate an - * additional data structure or provide an iterator interface.] - */ - ZipEntryRO findEntryByIndex(int idx) const; - - /* - * Copy the filename into the supplied buffer. Returns 0 on success, - * -1 if "entry" is invalid, or the filename length if it didn't fit. The - * length, and the returned string, include the null-termination. - */ - int getEntryFileName(ZipEntryRO entry, char* buffer, int bufLen) const; - - /* - * Get the vital stats for an entry. Pass in NULL pointers for anything - * you don't need. - * - * "*pOffset" holds the Zip file offset of the entry's data. - * - * Returns "false" if "entry" is bogus or if the data in the Zip file - * appears to be bad. - */ - bool getEntryInfo(ZipEntryRO entry, int* pMethod, size_t* pUncompLen, - size_t* pCompLen, off64_t* pOffset, long* pModWhen, long* pCrc32) const; - - /* - * Create a new FileMap object that maps a subset of the archive. For - * an uncompressed entry this effectively provides a pointer to the - * actual data, for a compressed entry this provides the input buffer - * for inflate(). - */ - FileMap* createEntryFileMap(ZipEntryRO entry) const; - - /* - * Uncompress the data into a buffer. Depending on the compression - * format, this is either an "inflate" operation or a memcpy. - * - * Use "uncompLen" from getEntryInfo() to determine the required - * buffer size. - * - * Returns "true" on success. - */ - bool uncompressEntry(ZipEntryRO entry, void* buffer) const; - - /* - * Uncompress the data to an open file descriptor. - */ - bool uncompressEntry(ZipEntryRO entry, int fd) const; - - /* Zip compression methods we support */ - enum { - kCompressStored = 0, // no compression - kCompressDeflated = 8, // standard deflate - }; - - /* - * Utility function: uncompress deflated data, buffer to buffer. - */ - static bool inflateBuffer(void* outBuf, const void* inBuf, - size_t uncompLen, size_t compLen); - - /* - * Utility function: uncompress deflated data, buffer to fd. - */ - static bool inflateBuffer(int fd, const void* inBuf, - size_t uncompLen, size_t compLen); - - /* - * Utility function to convert ZIP's time format to a timespec struct. - */ - static inline void zipTimeToTimespec(long when, struct tm* timespec) { - const long date = when >> 16; - timespec->tm_year = ((date >> 9) & 0x7F) + 80; // Zip is years since 1980 - timespec->tm_mon = (date >> 5) & 0x0F; - timespec->tm_mday = date & 0x1F; - - timespec->tm_hour = (when >> 11) & 0x1F; - timespec->tm_min = (when >> 5) & 0x3F; - timespec->tm_sec = (when & 0x1F) << 1; - } - - /* - * Some basic functions for raw data manipulation. "LE" means - * Little Endian. - */ - static inline unsigned short get2LE(const unsigned char* buf) { - return buf[0] | (buf[1] << 8); - } - static inline unsigned long get4LE(const unsigned char* buf) { - return buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24); - } - -private: - /* these are private and not defined */ - ZipFileRO(const ZipFileRO& src); - ZipFileRO& operator=(const ZipFileRO& src); - - /* locate and parse the central directory */ - bool mapCentralDirectory(void); - - /* parse the archive, prepping internal structures */ - bool parseZipArchive(void); - - /* add a new entry to the hash table */ - void addToHash(const char* str, int strLen, unsigned int hash); - - /* compute string hash code */ - static unsigned int computeHash(const char* str, int len); - - /* convert a ZipEntryRO back to a hash table index */ - int entryToIndex(const ZipEntryRO entry) const; - - /* - * One entry in the hash table. - */ - typedef struct HashEntry { - const char* name; - unsigned short nameLen; - //unsigned int hash; - } HashEntry; - - /* open Zip archive */ - int mFd; - - /* Lock for handling the file descriptor (seeks, etc) */ - mutable Mutex mFdLock; - - /* zip file name */ - char* mFileName; - - /* length of file */ - size_t mFileLength; - - /* mapped file */ - FileMap* mDirectoryMap; - - /* number of entries in the Zip archive */ - int mNumEntries; - - /* CD directory offset in the Zip archive */ - off64_t mDirectoryOffset; - - /* - * We know how many entries are in the Zip archive, so we have a - * fixed-size hash table. We probe for an empty slot. - */ - int mHashTableSize; - HashEntry* mHashTable; -}; - -}; // namespace android - -#endif /*__LIBS_ZIPFILERO_H*/ diff --git a/external/android/include/16/frameworks/native/include/utils/ZipUtils.h b/external/android/include/16/frameworks/native/include/utils/ZipUtils.h deleted file mode 100644 index 42c42b6..0000000 --- a/external/android/include/16/frameworks/native/include/utils/ZipUtils.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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. - */ - -// -// Miscellaneous zip/gzip utility functions. -// -#ifndef __LIBS_ZIPUTILS_H -#define __LIBS_ZIPUTILS_H - -#include - -namespace android { - -/* - * Container class for utility functions, primarily for namespace reasons. - */ -class ZipUtils { -public: - /* - * General utility function for uncompressing "deflate" data from a file - * to a buffer. - */ - static bool inflateToBuffer(int fd, void* buf, long uncompressedLen, - long compressedLen); - static bool inflateToBuffer(FILE* fp, void* buf, long uncompressedLen, - long compressedLen); - - /* - * Someday we might want to make this generic and handle bzip2 ".bz2" - * files too. - * - * We could declare gzip to be a sub-class of zip that has exactly - * one always-compressed entry, but we currently want to treat Zip - * and gzip as distinct, so there's no value. - * - * The zlib library has some gzip utilities, but it has no interface - * for extracting the uncompressed length of the file (you do *not* - * want to gzseek to the end). - * - * Pass in a seeked file pointer for the gzip file. If this is a gzip - * file, we set our return values appropriately and return "true" with - * the file seeked to the start of the compressed data. - */ - static bool examineGzip(FILE* fp, int* pCompressionMethod, - long* pUncompressedLen, long* pCompressedLen, unsigned long* pCRC32); - -private: - ZipUtils() {} - ~ZipUtils() {} -}; - -}; // namespace android - -#endif /*__LIBS_ZIPUTILS_H*/ diff --git a/external/android/include/16/frameworks/native/include/utils/ashmem.h b/external/android/include/16/frameworks/native/include/utils/ashmem.h deleted file mode 100644 index 0854775..0000000 --- a/external/android/include/16/frameworks/native/include/utils/ashmem.h +++ /dev/null @@ -1,41 +0,0 @@ -/* utils/ashmem.h - ** - ** Copyright 2008 The Android Open Source Project - ** - ** This file is dual licensed. It may be redistributed and/or modified - ** under the terms of the Apache 2.0 License OR version 2 of the GNU - ** General Public License. - */ - -#ifndef _UTILS_ASHMEM_H -#define _UTILS_ASHMEM_H - -#include -#include - -#define ASHMEM_NAME_LEN 256 - -#define ASHMEM_NAME_DEF "dev/ashmem" - -/* Return values from ASHMEM_PIN: Was the mapping purged while unpinned? */ -#define ASHMEM_NOT_REAPED 0 -#define ASHMEM_WAS_REAPED 1 - -/* Return values from ASHMEM_UNPIN: Is the mapping now pinned or unpinned? */ -#define ASHMEM_NOW_UNPINNED 0 -#define ASHMEM_NOW_PINNED 1 - -#define __ASHMEMIOC 0x77 - -#define ASHMEM_SET_NAME _IOW(__ASHMEMIOC, 1, char[ASHMEM_NAME_LEN]) -#define ASHMEM_GET_NAME _IOR(__ASHMEMIOC, 2, char[ASHMEM_NAME_LEN]) -#define ASHMEM_SET_SIZE _IOW(__ASHMEMIOC, 3, size_t) -#define ASHMEM_GET_SIZE _IO(__ASHMEMIOC, 4) -#define ASHMEM_SET_PROT_MASK _IOW(__ASHMEMIOC, 5, unsigned long) -#define ASHMEM_GET_PROT_MASK _IO(__ASHMEMIOC, 6) -#define ASHMEM_PIN _IO(__ASHMEMIOC, 7) -#define ASHMEM_UNPIN _IO(__ASHMEMIOC, 8) -#define ASHMEM_ISPINNED _IO(__ASHMEMIOC, 9) -#define ASHMEM_PURGE_ALL_CACHES _IO(__ASHMEMIOC, 10) - -#endif /* _UTILS_ASHMEM_H */ diff --git a/external/android/include/16/frameworks/native/include/utils/misc.h b/external/android/include/16/frameworks/native/include/utils/misc.h deleted file mode 100644 index d7d5bc1..0000000 --- a/external/android/include/16/frameworks/native/include/utils/misc.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// Handy utility functions and portability code. -// -#ifndef _LIBS_UTILS_MISC_H -#define _LIBS_UTILS_MISC_H - -#include -#include - -namespace android { - -/* get #of elements in a static array */ -#ifndef NELEM -# define NELEM(x) ((int) (sizeof(x) / sizeof((x)[0]))) -#endif - -/* - * Make a copy of the string, using "new[]" instead of "malloc". Free the - * string with delete[]. - * - * Returns NULL if "str" is NULL. - */ -char* strdupNew(const char* str); - -/* - * Concatenate an argument vector into a single string. If argc is >= 0 - * it will be used; if it's < 0 then the last element in the arg vector - * must be NULL. - * - * This inserts a space between each argument. - * - * This does not automatically add double quotes around arguments with - * spaces in them. This practice is necessary for Win32, because Win32's - * CreateProcess call is stupid. - * - * The caller should delete[] the returned string. - */ -char* concatArgv(int argc, const char* const argv[]); - -/* - * Count up the number of arguments in "argv". The count does not include - * the final NULL entry. - */ -int countArgv(const char* const argv[]); - -/* - * Some utility functions for working with files. These could be made - * part of a "File" class. - */ -typedef enum FileType { - kFileTypeUnknown = 0, - kFileTypeNonexistent, // i.e. ENOENT - kFileTypeRegular, - kFileTypeDirectory, - kFileTypeCharDev, - kFileTypeBlockDev, - kFileTypeFifo, - kFileTypeSymlink, - kFileTypeSocket, -} FileType; -/* get the file's type; follows symlinks */ -FileType getFileType(const char* fileName); -/* get the file's modification date; returns -1 w/errno set on failure */ -time_t getFileModDate(const char* fileName); - -/* - * Round up to the nearest power of 2. Handy for hash tables. - */ -unsigned int roundUpPower2(unsigned int val); - -void strreverse(char* begin, char* end); -void k_itoa(int value, char* str, int base); -char* itoa(int val, int base); - -typedef void (*sysprop_change_callback)(void); -void add_sysprop_change_callback(sysprop_change_callback cb, int priority); -void report_sysprop_change(); - -}; // namespace android - -#endif // _LIBS_UTILS_MISC_H diff --git a/external/android/include/16/frameworks/native/include/utils/threads.h b/external/android/include/16/frameworks/native/include/utils/threads.h deleted file mode 100644 index 9de3382..0000000 --- a/external/android/include/16/frameworks/native/include/utils/threads.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 _LIBS_UTILS_THREADS_H -#define _LIBS_UTILS_THREADS_H - -/* - * Please, DO NOT USE! - * - * This file is here only for legacy reasons. Instead, include directly - * the headers you need below. - * - */ - -#include - -#ifdef __cplusplus -#include -#include -#include -#include -#include -#endif - -#endif // _LIBS_UTILS_THREADS_H diff --git a/external/android/include/16/hardware/libhardware/include/hardware/audio.h b/external/android/include/16/hardware/libhardware/include/hardware/audio.h deleted file mode 100644 index 01d79b2..0000000 --- a/external/android/include/16/hardware/libhardware/include/hardware/audio.h +++ /dev/null @@ -1,430 +0,0 @@ -/* - * Copyright (C) 2011 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_AUDIO_HAL_INTERFACE_H -#define ANDROID_AUDIO_HAL_INTERFACE_H - -#include -#include -#include -#include - -#include - -#include -#include -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define AUDIO_HARDWARE_MODULE_ID "audio" - -/** - * Name of the audio devices to open - */ -#define AUDIO_HARDWARE_INTERFACE "audio_hw_if" - - -/* Use version 0.1 to be compatible with first generation of audio hw module with version_major - * hardcoded to 1. No audio module API change. - */ -#define AUDIO_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) -#define AUDIO_MODULE_API_VERSION_CURRENT AUDIO_MODULE_API_VERSION_0_1 - -/* First generation of audio devices had version hardcoded to 0. all devices with versions < 1.0 - * will be considered of first generation API. - */ -#define AUDIO_DEVICE_API_VERSION_0_0 HARDWARE_DEVICE_API_VERSION(0, 0) -#define AUDIO_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0) -#define AUDIO_DEVICE_API_VERSION_CURRENT AUDIO_DEVICE_API_VERSION_1_0 - -/** - * List of known audio HAL modules. This is the base name of the audio HAL - * library composed of the "audio." prefix, one of the base names below and - * a suffix specific to the device. - * e.g: audio.primary.goldfish.so or audio.a2dp.default.so - */ - -#define AUDIO_HARDWARE_MODULE_ID_PRIMARY "primary" -#define AUDIO_HARDWARE_MODULE_ID_A2DP "a2dp" -#define AUDIO_HARDWARE_MODULE_ID_USB "usb" - -/**************************************/ - -/** - * standard audio parameters that the HAL may need to handle - */ - -/** - * audio device parameters - */ - -/* BT SCO Noise Reduction + Echo Cancellation parameters */ -#define AUDIO_PARAMETER_KEY_BT_NREC "bt_headset_nrec" -#define AUDIO_PARAMETER_VALUE_ON "on" -#define AUDIO_PARAMETER_VALUE_OFF "off" - -/* TTY mode selection */ -#define AUDIO_PARAMETER_KEY_TTY_MODE "tty_mode" -#define AUDIO_PARAMETER_VALUE_TTY_OFF "tty_off" -#define AUDIO_PARAMETER_VALUE_TTY_VCO "tty_vco" -#define AUDIO_PARAMETER_VALUE_TTY_HCO "tty_hco" -#define AUDIO_PARAMETER_VALUE_TTY_FULL "tty_full" - -/* A2DP sink address set by framework */ -#define AUDIO_PARAMETER_A2DP_SINK_ADDRESS "a2dp_sink_address" - -/* Screen state */ -#define AUDIO_PARAMETER_KEY_SCREEN_STATE "screen_state" - -/** - * audio stream parameters - */ - -#define AUDIO_PARAMETER_STREAM_ROUTING "routing" // audio_devices_t -#define AUDIO_PARAMETER_STREAM_FORMAT "format" // audio_format_t -#define AUDIO_PARAMETER_STREAM_CHANNELS "channels" // audio_channel_mask_t -#define AUDIO_PARAMETER_STREAM_FRAME_COUNT "frame_count" // size_t -#define AUDIO_PARAMETER_STREAM_INPUT_SOURCE "input_source" // audio_source_t -#define AUDIO_PARAMETER_STREAM_SAMPLING_RATE "sampling_rate" // uint32_t - -/* Query supported formats. The response is a '|' separated list of strings from - * audio_format_t enum e.g: "sup_formats=AUDIO_FORMAT_PCM_16_BIT" */ -#define AUDIO_PARAMETER_STREAM_SUP_FORMATS "sup_formats" -/* Query supported channel masks. The response is a '|' separated list of strings from - * audio_channel_mask_t enum e.g: "sup_channels=AUDIO_CHANNEL_OUT_STEREO|AUDIO_CHANNEL_OUT_MONO" */ -#define AUDIO_PARAMETER_STREAM_SUP_CHANNELS "sup_channels" -/* Query supported sampling rates. The response is a '|' separated list of integer values e.g: - * "sup_sampling_rates=44100|48000" */ -#define AUDIO_PARAMETER_STREAM_SUP_SAMPLING_RATES "sup_sampling_rates" - - -/**************************************/ - -/* common audio stream configuration parameters */ -struct audio_config { - uint32_t sample_rate; - audio_channel_mask_t channel_mask; - audio_format_t format; -}; - -typedef struct audio_config audio_config_t; - -/* common audio stream parameters and operations */ -struct audio_stream { - - /** - * Return the sampling rate in Hz - eg. 44100. - */ - uint32_t (*get_sample_rate)(const struct audio_stream *stream); - - /* currently unused - use set_parameters with key - * AUDIO_PARAMETER_STREAM_SAMPLING_RATE - */ - int (*set_sample_rate)(struct audio_stream *stream, uint32_t rate); - - /** - * Return size of input/output buffer in bytes for this stream - eg. 4800. - * It should be a multiple of the frame size. See also get_input_buffer_size. - */ - size_t (*get_buffer_size)(const struct audio_stream *stream); - - /** - * Return the channel mask - - * e.g. AUDIO_CHANNEL_OUT_STEREO or AUDIO_CHANNEL_IN_STEREO - */ - audio_channel_mask_t (*get_channels)(const struct audio_stream *stream); - - /** - * Return the audio format - e.g. AUDIO_FORMAT_PCM_16_BIT - */ - audio_format_t (*get_format)(const struct audio_stream *stream); - - /* currently unused - use set_parameters with key - * AUDIO_PARAMETER_STREAM_FORMAT - */ - int (*set_format)(struct audio_stream *stream, audio_format_t format); - - /** - * Put the audio hardware input/output into standby mode. - * Driver should exit from standby mode at the next I/O operation. - * Returns 0 on success and <0 on failure. - */ - int (*standby)(struct audio_stream *stream); - - /** dump the state of the audio input/output device */ - int (*dump)(const struct audio_stream *stream, int fd); - - /** Return the set of device(s) which this stream is connected to */ - audio_devices_t (*get_device)(const struct audio_stream *stream); - - /** - * Currently unused - set_device() corresponds to set_parameters() with key - * AUDIO_PARAMETER_STREAM_ROUTING for both input and output. - * AUDIO_PARAMETER_STREAM_INPUT_SOURCE is an additional information used by - * input streams only. - */ - int (*set_device)(struct audio_stream *stream, audio_devices_t device); - - /** - * set/get audio stream parameters. The function accepts a list of - * parameter key value pairs in the form: key1=value1;key2=value2;... - * - * Some keys are reserved for standard parameters (See AudioParameter class) - * - * If the implementation does not accept a parameter change while - * the output is active but the parameter is acceptable otherwise, it must - * return -ENOSYS. - * - * The audio flinger will put the stream in standby and then change the - * parameter value. - */ - int (*set_parameters)(struct audio_stream *stream, const char *kv_pairs); - - /* - * Returns a pointer to a heap allocated string. The caller is responsible - * for freeing the memory for it using free(). - */ - char * (*get_parameters)(const struct audio_stream *stream, - const char *keys); - int (*add_audio_effect)(const struct audio_stream *stream, - effect_handle_t effect); - int (*remove_audio_effect)(const struct audio_stream *stream, - effect_handle_t effect); -}; -typedef struct audio_stream audio_stream_t; - -/** - * audio_stream_out is the abstraction interface for the audio output hardware. - * - * It provides information about various properties of the audio output - * hardware driver. - */ - -struct audio_stream_out { - struct audio_stream common; - - /** - * Return the audio hardware driver estimated latency in milliseconds. - */ - uint32_t (*get_latency)(const struct audio_stream_out *stream); - - /** - * Use this method in situations where audio mixing is done in the - * hardware. This method serves as a direct interface with hardware, - * allowing you to directly set the volume as apposed to via the framework. - * This method might produce multiple PCM outputs or hardware accelerated - * codecs, such as MP3 or AAC. - */ - int (*set_volume)(struct audio_stream_out *stream, float left, float right); - - /** - * Write audio buffer to driver. Returns number of bytes written, or a - * negative status_t. If at least one frame was written successfully prior to the error, - * it is suggested that the driver return that successful (short) byte count - * and then return an error in the subsequent call. - */ - ssize_t (*write)(struct audio_stream_out *stream, const void* buffer, - size_t bytes); - - /* return the number of audio frames written by the audio dsp to DAC since - * the output has exited standby - */ - int (*get_render_position)(const struct audio_stream_out *stream, - uint32_t *dsp_frames); - - /** - * get the local time at which the next write to the audio driver will be presented. - * The units are microseconds, where the epoch is decided by the local audio HAL. - */ - int (*get_next_write_timestamp)(const struct audio_stream_out *stream, - int64_t *timestamp); - -}; -typedef struct audio_stream_out audio_stream_out_t; - -struct audio_stream_in { - struct audio_stream common; - - /** set the input gain for the audio driver. This method is for - * for future use */ - int (*set_gain)(struct audio_stream_in *stream, float gain); - - /** Read audio buffer in from audio driver. Returns number of bytes read, or a - * negative status_t. If at least one frame was read prior to the error, - * read should return that byte count and then return an error in the subsequent call. - */ - ssize_t (*read)(struct audio_stream_in *stream, void* buffer, - size_t bytes); - - /** - * Return the amount of input frames lost in the audio driver since the - * last call of this function. - * Audio driver is expected to reset the value to 0 and restart counting - * upon returning the current value by this function call. - * Such loss typically occurs when the user space process is blocked - * longer than the capacity of audio driver buffers. - * - * Unit: the number of input audio frames - */ - uint32_t (*get_input_frames_lost)(struct audio_stream_in *stream); -}; -typedef struct audio_stream_in audio_stream_in_t; - -/** - * return the frame size (number of bytes per sample). - */ -static inline size_t audio_stream_frame_size(struct audio_stream *s) -{ - size_t chan_samp_sz; - - switch (s->get_format(s)) { - case AUDIO_FORMAT_PCM_16_BIT: - chan_samp_sz = sizeof(int16_t); - break; - case AUDIO_FORMAT_PCM_8_BIT: - default: - chan_samp_sz = sizeof(int8_t); - break; - } - - return popcount(s->get_channels(s)) * chan_samp_sz; -} - - -/**********************************************************************/ - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -struct audio_module { - struct hw_module_t common; -}; - -struct audio_hw_device { - struct hw_device_t common; - - /** - * used by audio flinger to enumerate what devices are supported by - * each audio_hw_device implementation. - * - * Return value is a bitmask of 1 or more values of audio_devices_t - */ - uint32_t (*get_supported_devices)(const struct audio_hw_device *dev); - - /** - * check to see if the audio hardware interface has been initialized. - * returns 0 on success, -ENODEV on failure. - */ - int (*init_check)(const struct audio_hw_device *dev); - - /** set the audio volume of a voice call. Range is between 0.0 and 1.0 */ - int (*set_voice_volume)(struct audio_hw_device *dev, float volume); - - /** - * set the audio volume for all audio activities other than voice call. - * Range between 0.0 and 1.0. If any value other than 0 is returned, - * the software mixer will emulate this capability. - */ - int (*set_master_volume)(struct audio_hw_device *dev, float volume); - - /** - * Get the current master volume value for the HAL, if the HAL supports - * master volume control. AudioFlinger will query this value from the - * primary audio HAL when the service starts and use the value for setting - * the initial master volume across all HALs. HALs which do not support - * this method should may leave it set to NULL. - */ - int (*get_master_volume)(struct audio_hw_device *dev, float *volume); - - /** - * set_mode is called when the audio mode changes. AUDIO_MODE_NORMAL mode - * is for standard audio playback, AUDIO_MODE_RINGTONE when a ringtone is - * playing, and AUDIO_MODE_IN_CALL when a call is in progress. - */ - int (*set_mode)(struct audio_hw_device *dev, audio_mode_t mode); - - /* mic mute */ - int (*set_mic_mute)(struct audio_hw_device *dev, bool state); - int (*get_mic_mute)(const struct audio_hw_device *dev, bool *state); - - /* set/get global audio parameters */ - int (*set_parameters)(struct audio_hw_device *dev, const char *kv_pairs); - - /* - * Returns a pointer to a heap allocated string. The caller is responsible - * for freeing the memory for it using free(). - */ - char * (*get_parameters)(const struct audio_hw_device *dev, - const char *keys); - - /* Returns audio input buffer size according to parameters passed or - * 0 if one of the parameters is not supported. - * See also get_buffer_size which is for a particular stream. - */ - size_t (*get_input_buffer_size)(const struct audio_hw_device *dev, - const struct audio_config *config); - - /** This method creates and opens the audio hardware output stream */ - int (*open_output_stream)(struct audio_hw_device *dev, - audio_io_handle_t handle, - audio_devices_t devices, - audio_output_flags_t flags, - struct audio_config *config, - struct audio_stream_out **stream_out); - - void (*close_output_stream)(struct audio_hw_device *dev, - struct audio_stream_out* stream_out); - - /** This method creates and opens the audio hardware input stream */ - int (*open_input_stream)(struct audio_hw_device *dev, - audio_io_handle_t handle, - audio_devices_t devices, - struct audio_config *config, - struct audio_stream_in **stream_in); - - void (*close_input_stream)(struct audio_hw_device *dev, - struct audio_stream_in *stream_in); - - /** This method dumps the state of the audio hardware */ - int (*dump)(const struct audio_hw_device *dev, int fd); -}; -typedef struct audio_hw_device audio_hw_device_t; - -/** convenience API for opening and closing a supported device */ - -static inline int audio_hw_device_open(const struct hw_module_t* module, - struct audio_hw_device** device) -{ - return module->methods->open(module, AUDIO_HARDWARE_INTERFACE, - (struct hw_device_t**)device); -} - -static inline int audio_hw_device_close(struct audio_hw_device* device) -{ - return device->common.close(&device->common); -} - - -__END_DECLS - -#endif // ANDROID_AUDIO_INTERFACE_H diff --git a/external/android/include/16/hardware/libhardware/include/hardware/audio_effect.h b/external/android/include/16/hardware/libhardware/include/hardware/audio_effect.h deleted file mode 100644 index 65eba36..0000000 --- a/external/android/include/16/hardware/libhardware/include/hardware/audio_effect.h +++ /dev/null @@ -1,1002 +0,0 @@ -/* - * Copyright (C) 2011 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_AUDIO_EFFECT_H -#define ANDROID_AUDIO_EFFECT_H - -#include -#include -#include -#include -#include - -#include - -#include - - -__BEGIN_DECLS - - -///////////////////////////////////////////////// -// Common Definitions -///////////////////////////////////////////////// - -// -//--- Effect descriptor structure effect_descriptor_t -// - -// Unique effect ID (can be generated from the following site: -// http://www.itu.int/ITU-T/asn1/uuid.html) -// This format is used for both "type" and "uuid" fields of the effect descriptor structure. -// - When used for effect type and the engine is implementing and effect corresponding to a standard -// OpenSL ES interface, this ID must be the one defined in OpenSLES_IID.h for that interface. -// - When used as uuid, it should be a unique UUID for this particular implementation. -typedef struct effect_uuid_s { - uint32_t timeLow; - uint16_t timeMid; - uint16_t timeHiAndVersion; - uint16_t clockSeq; - uint8_t node[6]; -} effect_uuid_t; - -// Maximum length of character strings in structures defines by this API. -#define EFFECT_STRING_LEN_MAX 64 - -// NULL UUID definition (matches SL_IID_NULL_) -#define EFFECT_UUID_INITIALIZER { 0xec7178ec, 0xe5e1, 0x4432, 0xa3f4, \ - { 0x46, 0x57, 0xe6, 0x79, 0x52, 0x10 } } -static const effect_uuid_t EFFECT_UUID_NULL_ = EFFECT_UUID_INITIALIZER; -const effect_uuid_t * const EFFECT_UUID_NULL = &EFFECT_UUID_NULL_; -const char * const EFFECT_UUID_NULL_STR = "ec7178ec-e5e1-4432-a3f4-4657e6795210"; - -// The effect descriptor contains necessary information to facilitate the enumeration of the effect -// engines present in a library. -typedef struct effect_descriptor_s { - effect_uuid_t type; // UUID of to the OpenSL ES interface implemented by this effect - effect_uuid_t uuid; // UUID for this particular implementation - uint32_t apiVersion; // Version of the effect control API implemented - uint32_t flags; // effect engine capabilities/requirements flags (see below) - uint16_t cpuLoad; // CPU load indication (see below) - uint16_t memoryUsage; // Data Memory usage (see below) - char name[EFFECT_STRING_LEN_MAX]; // human readable effect name - char implementor[EFFECT_STRING_LEN_MAX]; // human readable effect implementor name -} effect_descriptor_t; - -// CPU load and memory usage indication: each effect implementation must provide an indication of -// its CPU and memory usage for the audio effect framework to limit the number of effects -// instantiated at a given time on a given platform. -// The CPU load is expressed in 0.1 MIPS units as estimated on an ARM9E core (ARMv5TE) with 0 WS. -// The memory usage is expressed in KB and includes only dynamically allocated memory - -// Definitions for flags field of effect descriptor. -// +---------------------------+-----------+----------------------------------- -// | description | bits | values -// +---------------------------+-----------+----------------------------------- -// | connection mode | 0..2 | 0 insert: after track process -// | | | 1 auxiliary: connect to track auxiliary -// | | | output and use send level -// | | | 2 replace: replaces track process function; -// | | | must implement SRC, volume and mono to stereo. -// | | | 3 pre processing: applied below audio HAL on input -// | | | 4 post processing: applied below audio HAL on output -// | | | 5 - 7 reserved -// +---------------------------+-----------+----------------------------------- -// | insertion preference | 3..5 | 0 none -// | | | 1 first of the chain -// | | | 2 last of the chain -// | | | 3 exclusive (only effect in the insert chain) -// | | | 4..7 reserved -// +---------------------------+-----------+----------------------------------- -// | Volume management | 6..8 | 0 none -// | | | 1 implements volume control -// | | | 2 requires volume indication -// | | | 4 reserved -// +---------------------------+-----------+----------------------------------- -// | Device indication | 9..11 | 0 none -// | | | 1 requires device updates -// | | | 2, 4 reserved -// +---------------------------+-----------+----------------------------------- -// | Sample input mode | 12..13 | 1 direct: process() function or EFFECT_CMD_SET_CONFIG -// | | | command must specify a buffer descriptor -// | | | 2 provider: process() function uses the -// | | | bufferProvider indicated by the -// | | | EFFECT_CMD_SET_CONFIG command to request input. -// | | | buffers. -// | | | 3 both: both input modes are supported -// +---------------------------+-----------+----------------------------------- -// | Sample output mode | 14..15 | 1 direct: process() function or EFFECT_CMD_SET_CONFIG -// | | | command must specify a buffer descriptor -// | | | 2 provider: process() function uses the -// | | | bufferProvider indicated by the -// | | | EFFECT_CMD_SET_CONFIG command to request output -// | | | buffers. -// | | | 3 both: both output modes are supported -// +---------------------------+-----------+----------------------------------- -// | Hardware acceleration | 16..17 | 0 No hardware acceleration -// | | | 1 non tunneled hw acceleration: the process() function -// | | | reads the samples, send them to HW accelerated -// | | | effect processor, reads back the processed samples -// | | | and returns them to the output buffer. -// | | | 2 tunneled hw acceleration: the process() function is -// | | | transparent. The effect interface is only used to -// | | | control the effect engine. This mode is relevant for -// | | | global effects actually applied by the audio -// | | | hardware on the output stream. -// +---------------------------+-----------+----------------------------------- -// | Audio Mode indication | 18..19 | 0 none -// | | | 1 requires audio mode updates -// | | | 2..3 reserved -// +---------------------------+-----------+----------------------------------- - -// Insert mode -#define EFFECT_FLAG_TYPE_SHIFT 0 -#define EFFECT_FLAG_TYPE_SIZE 3 -#define EFFECT_FLAG_TYPE_MASK (((1 << EFFECT_FLAG_TYPE_SIZE) -1) \ - << EFFECT_FLAG_TYPE_SHIFT) -#define EFFECT_FLAG_TYPE_INSERT (0 << EFFECT_FLAG_TYPE_SHIFT) -#define EFFECT_FLAG_TYPE_AUXILIARY (1 << EFFECT_FLAG_TYPE_SHIFT) -#define EFFECT_FLAG_TYPE_REPLACE (2 << EFFECT_FLAG_TYPE_SHIFT) -#define EFFECT_FLAG_TYPE_PRE_PROC (3 << EFFECT_FLAG_TYPE_SHIFT) -#define EFFECT_FLAG_TYPE_POST_PROC (4 << EFFECT_FLAG_TYPE_SHIFT) - -// Insert preference -#define EFFECT_FLAG_INSERT_SHIFT (EFFECT_FLAG_TYPE_SHIFT + EFFECT_FLAG_TYPE_SIZE) -#define EFFECT_FLAG_INSERT_SIZE 3 -#define EFFECT_FLAG_INSERT_MASK (((1 << EFFECT_FLAG_INSERT_SIZE) -1) \ - << EFFECT_FLAG_INSERT_SHIFT) -#define EFFECT_FLAG_INSERT_ANY (0 << EFFECT_FLAG_INSERT_SHIFT) -#define EFFECT_FLAG_INSERT_FIRST (1 << EFFECT_FLAG_INSERT_SHIFT) -#define EFFECT_FLAG_INSERT_LAST (2 << EFFECT_FLAG_INSERT_SHIFT) -#define EFFECT_FLAG_INSERT_EXCLUSIVE (3 << EFFECT_FLAG_INSERT_SHIFT) - - -// Volume control -#define EFFECT_FLAG_VOLUME_SHIFT (EFFECT_FLAG_INSERT_SHIFT + EFFECT_FLAG_INSERT_SIZE) -#define EFFECT_FLAG_VOLUME_SIZE 3 -#define EFFECT_FLAG_VOLUME_MASK (((1 << EFFECT_FLAG_VOLUME_SIZE) -1) \ - << EFFECT_FLAG_VOLUME_SHIFT) -#define EFFECT_FLAG_VOLUME_CTRL (1 << EFFECT_FLAG_VOLUME_SHIFT) -#define EFFECT_FLAG_VOLUME_IND (2 << EFFECT_FLAG_VOLUME_SHIFT) -#define EFFECT_FLAG_VOLUME_NONE (0 << EFFECT_FLAG_VOLUME_SHIFT) - -// Device indication -#define EFFECT_FLAG_DEVICE_SHIFT (EFFECT_FLAG_VOLUME_SHIFT + EFFECT_FLAG_VOLUME_SIZE) -#define EFFECT_FLAG_DEVICE_SIZE 3 -#define EFFECT_FLAG_DEVICE_MASK (((1 << EFFECT_FLAG_DEVICE_SIZE) -1) \ - << EFFECT_FLAG_DEVICE_SHIFT) -#define EFFECT_FLAG_DEVICE_IND (1 << EFFECT_FLAG_DEVICE_SHIFT) -#define EFFECT_FLAG_DEVICE_NONE (0 << EFFECT_FLAG_DEVICE_SHIFT) - -// Sample input modes -#define EFFECT_FLAG_INPUT_SHIFT (EFFECT_FLAG_DEVICE_SHIFT + EFFECT_FLAG_DEVICE_SIZE) -#define EFFECT_FLAG_INPUT_SIZE 2 -#define EFFECT_FLAG_INPUT_MASK (((1 << EFFECT_FLAG_INPUT_SIZE) -1) \ - << EFFECT_FLAG_INPUT_SHIFT) -#define EFFECT_FLAG_INPUT_DIRECT (1 << EFFECT_FLAG_INPUT_SHIFT) -#define EFFECT_FLAG_INPUT_PROVIDER (2 << EFFECT_FLAG_INPUT_SHIFT) -#define EFFECT_FLAG_INPUT_BOTH (3 << EFFECT_FLAG_INPUT_SHIFT) - -// Sample output modes -#define EFFECT_FLAG_OUTPUT_SHIFT (EFFECT_FLAG_INPUT_SHIFT + EFFECT_FLAG_INPUT_SIZE) -#define EFFECT_FLAG_OUTPUT_SIZE 2 -#define EFFECT_FLAG_OUTPUT_MASK (((1 << EFFECT_FLAG_OUTPUT_SIZE) -1) \ - << EFFECT_FLAG_OUTPUT_SHIFT) -#define EFFECT_FLAG_OUTPUT_DIRECT (1 << EFFECT_FLAG_OUTPUT_SHIFT) -#define EFFECT_FLAG_OUTPUT_PROVIDER (2 << EFFECT_FLAG_OUTPUT_SHIFT) -#define EFFECT_FLAG_OUTPUT_BOTH (3 << EFFECT_FLAG_OUTPUT_SHIFT) - -// Hardware acceleration mode -#define EFFECT_FLAG_HW_ACC_SHIFT (EFFECT_FLAG_OUTPUT_SHIFT + EFFECT_FLAG_OUTPUT_SIZE) -#define EFFECT_FLAG_HW_ACC_SIZE 2 -#define EFFECT_FLAG_HW_ACC_MASK (((1 << EFFECT_FLAG_HW_ACC_SIZE) -1) \ - << EFFECT_FLAG_HW_ACC_SHIFT) -#define EFFECT_FLAG_HW_ACC_SIMPLE (1 << EFFECT_FLAG_HW_ACC_SHIFT) -#define EFFECT_FLAG_HW_ACC_TUNNEL (2 << EFFECT_FLAG_HW_ACC_SHIFT) - -// Audio mode indication -#define EFFECT_FLAG_AUDIO_MODE_SHIFT (EFFECT_FLAG_HW_ACC_SHIFT + EFFECT_FLAG_HW_ACC_SIZE) -#define EFFECT_FLAG_AUDIO_MODE_SIZE 2 -#define EFFECT_FLAG_AUDIO_MODE_MASK (((1 << EFFECT_FLAG_AUDIO_MODE_SIZE) -1) \ - << EFFECT_FLAG_AUDIO_MODE_SHIFT) -#define EFFECT_FLAG_AUDIO_MODE_IND (1 << EFFECT_FLAG_AUDIO_MODE_SHIFT) -#define EFFECT_FLAG_AUDIO_MODE_NONE (0 << EFFECT_FLAG_AUDIO_MODE_SHIFT) - - -#define EFFECT_MAKE_API_VERSION(M, m) (((M)<<16) | ((m) & 0xFFFF)) -#define EFFECT_API_VERSION_MAJOR(v) ((v)>>16) -#define EFFECT_API_VERSION_MINOR(v) ((m) & 0xFFFF) - - - -///////////////////////////////////////////////// -// Effect control interface -///////////////////////////////////////////////// - -// Effect control interface version 2.0 -#define EFFECT_CONTROL_API_VERSION EFFECT_MAKE_API_VERSION(2,0) - -// Effect control interface structure: effect_interface_s -// The effect control interface is exposed by each effect engine implementation. It consists of -// a set of functions controlling the configuration, activation and process of the engine. -// The functions are grouped in a structure of type effect_interface_s. -// -// Effect control interface handle: effect_handle_t -// The effect_handle_t serves two purposes regarding the implementation of the effect engine: -// - 1 it is the address of a pointer to an effect_interface_s structure where the functions -// of the effect control API for a particular effect are located. -// - 2 it is the address of the context of a particular effect instance. -// A typical implementation in the effect library would define a structure as follows: -// struct effect_module_s { -// const struct effect_interface_s *itfe; -// effect_config_t config; -// effect_context_t context; -// } -// The implementation of EffectCreate() function would then allocate a structure of this -// type and return its address as effect_handle_t -typedef struct effect_interface_s **effect_handle_t; - - -// Forward definition of type audio_buffer_t -typedef struct audio_buffer_s audio_buffer_t; - - - - - - -// Effect control interface definition -struct effect_interface_s { - //////////////////////////////////////////////////////////////////////////////// - // - // Function: process - // - // Description: Effect process function. Takes input samples as specified - // (count and location) in input buffer descriptor and output processed - // samples as specified in output buffer descriptor. If the buffer descriptor - // is not specified the function must use either the buffer or the - // buffer provider function installed by the EFFECT_CMD_SET_CONFIG command. - // The effect framework will call the process() function after the EFFECT_CMD_ENABLE - // command is received and until the EFFECT_CMD_DISABLE is received. When the engine - // receives the EFFECT_CMD_DISABLE command it should turn off the effect gracefully - // and when done indicate that it is OK to stop calling the process() function by - // returning the -ENODATA status. - // - // NOTE: the process() function implementation should be "real-time safe" that is - // it should not perform blocking calls: malloc/free, sleep, read/write/open/close, - // pthread_cond_wait/pthread_mutex_lock... - // - // Input: - // self: handle to the effect interface this function - // is called on. - // inBuffer: buffer descriptor indicating where to read samples to process. - // If NULL, use the configuration passed by EFFECT_CMD_SET_CONFIG command. - // - // outBuffer: buffer descriptor indicating where to write processed samples. - // If NULL, use the configuration passed by EFFECT_CMD_SET_CONFIG command. - // - // Output: - // returned value: 0 successful operation - // -ENODATA the engine has finished the disable phase and the framework - // can stop calling process() - // -EINVAL invalid interface handle or - // invalid input/output buffer description - //////////////////////////////////////////////////////////////////////////////// - int32_t (*process)(effect_handle_t self, - audio_buffer_t *inBuffer, - audio_buffer_t *outBuffer); - //////////////////////////////////////////////////////////////////////////////// - // - // Function: command - // - // Description: Send a command and receive a response to/from effect engine. - // - // Input: - // self: handle to the effect interface this function - // is called on. - // cmdCode: command code: the command can be a standardized command defined in - // effect_command_e (see below) or a proprietary command. - // cmdSize: size of command in bytes - // pCmdData: pointer to command data - // pReplyData: pointer to reply data - // - // Input/Output: - // replySize: maximum size of reply data as input - // actual size of reply data as output - // - // Output: - // returned value: 0 successful operation - // -EINVAL invalid interface handle or - // invalid command/reply size or format according to command code - // The return code should be restricted to indicate problems related to the this - // API specification. Status related to the execution of a particular command should be - // indicated as part of the reply field. - // - // *pReplyData updated with command response - // - //////////////////////////////////////////////////////////////////////////////// - int32_t (*command)(effect_handle_t self, - uint32_t cmdCode, - uint32_t cmdSize, - void *pCmdData, - uint32_t *replySize, - void *pReplyData); - //////////////////////////////////////////////////////////////////////////////// - // - // Function: get_descriptor - // - // Description: Returns the effect descriptor - // - // Input: - // self: handle to the effect interface this function - // is called on. - // - // Input/Output: - // pDescriptor: address where to return the effect descriptor. - // - // Output: - // returned value: 0 successful operation. - // -EINVAL invalid interface handle or invalid pDescriptor - // *pDescriptor: updated with the effect descriptor. - // - //////////////////////////////////////////////////////////////////////////////// - int32_t (*get_descriptor)(effect_handle_t self, - effect_descriptor_t *pDescriptor); - //////////////////////////////////////////////////////////////////////////////// - // - // Function: process_reverse - // - // Description: Process reverse stream function. This function is used to pass - // a reference stream to the effect engine. If the engine does not need a reference - // stream, this function pointer can be set to NULL. - // This function would typically implemented by an Echo Canceler. - // - // Input: - // self: handle to the effect interface this function - // is called on. - // inBuffer: buffer descriptor indicating where to read samples to process. - // If NULL, use the configuration passed by EFFECT_CMD_SET_CONFIG_REVERSE command. - // - // outBuffer: buffer descriptor indicating where to write processed samples. - // If NULL, use the configuration passed by EFFECT_CMD_SET_CONFIG_REVERSE command. - // If the buffer and buffer provider in the configuration received by - // EFFECT_CMD_SET_CONFIG_REVERSE are also NULL, do not return modified reverse - // stream data - // - // Output: - // returned value: 0 successful operation - // -ENODATA the engine has finished the disable phase and the framework - // can stop calling process_reverse() - // -EINVAL invalid interface handle or - // invalid input/output buffer description - //////////////////////////////////////////////////////////////////////////////// - int32_t (*process_reverse)(effect_handle_t self, - audio_buffer_t *inBuffer, - audio_buffer_t *outBuffer); -}; - - -// -//--- Standardized command codes for command() function -// -enum effect_command_e { - EFFECT_CMD_INIT, // initialize effect engine - EFFECT_CMD_SET_CONFIG, // configure effect engine (see effect_config_t) - EFFECT_CMD_RESET, // reset effect engine - EFFECT_CMD_ENABLE, // enable effect process - EFFECT_CMD_DISABLE, // disable effect process - EFFECT_CMD_SET_PARAM, // set parameter immediately (see effect_param_t) - EFFECT_CMD_SET_PARAM_DEFERRED, // set parameter deferred - EFFECT_CMD_SET_PARAM_COMMIT, // commit previous set parameter deferred - EFFECT_CMD_GET_PARAM, // get parameter - EFFECT_CMD_SET_DEVICE, // set audio device (see audio.h, audio_devices_t) - EFFECT_CMD_SET_VOLUME, // set volume - EFFECT_CMD_SET_AUDIO_MODE, // set the audio mode (normal, ring, ...) - EFFECT_CMD_SET_CONFIG_REVERSE, // configure effect engine reverse stream(see effect_config_t) - EFFECT_CMD_SET_INPUT_DEVICE, // set capture device (see audio.h, audio_devices_t) - EFFECT_CMD_GET_CONFIG, // read effect engine configuration - EFFECT_CMD_GET_CONFIG_REVERSE, // read configure effect engine reverse stream configuration - EFFECT_CMD_GET_FEATURE_SUPPORTED_CONFIGS,// get all supported configurations for a feature. - EFFECT_CMD_GET_FEATURE_CONFIG, // get current feature configuration - EFFECT_CMD_SET_FEATURE_CONFIG, // set current feature configuration - EFFECT_CMD_FIRST_PROPRIETARY = 0x10000 // first proprietary command code -}; - -//================================================================================================== -// command: EFFECT_CMD_INIT -//-------------------------------------------------------------------------------------------------- -// description: -// Initialize effect engine: All configurations return to default -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_SET_CONFIG -//-------------------------------------------------------------------------------------------------- -// description: -// Apply new audio parameters configurations for input and output buffers -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(effect_config_t) -// data: effect_config_t -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_RESET -//-------------------------------------------------------------------------------------------------- -// description: -// Reset the effect engine. Keep configuration but resets state and buffer content -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 0 -// data: N/A -//================================================================================================== -// command: EFFECT_CMD_ENABLE -//-------------------------------------------------------------------------------------------------- -// description: -// Enable the process. Called by the framework before the first call to process() -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_DISABLE -//-------------------------------------------------------------------------------------------------- -// description: -// Disable the process. Called by the framework after the last call to process() -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_SET_PARAM -//-------------------------------------------------------------------------------------------------- -// description: -// Set a parameter and apply it immediately -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(effect_param_t) + size of param and value -// data: effect_param_t + param + value. See effect_param_t definition below for value offset -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_SET_PARAM_DEFERRED -//-------------------------------------------------------------------------------------------------- -// description: -// Set a parameter but apply it only when receiving EFFECT_CMD_SET_PARAM_COMMIT command -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(effect_param_t) + size of param and value -// data: effect_param_t + param + value. See effect_param_t definition below for value offset -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 0 -// data: N/A -//================================================================================================== -// command: EFFECT_CMD_SET_PARAM_COMMIT -//-------------------------------------------------------------------------------------------------- -// description: -// Apply all previously received EFFECT_CMD_SET_PARAM_DEFERRED commands -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_GET_PARAM -//-------------------------------------------------------------------------------------------------- -// description: -// Get a parameter value -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(effect_param_t) + size of param -// data: effect_param_t + param -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(effect_param_t) + size of param and value -// data: effect_param_t + param + value. See effect_param_t definition below for value offset -//================================================================================================== -// command: EFFECT_CMD_SET_DEVICE -//-------------------------------------------------------------------------------------------------- -// description: -// Set the rendering device the audio output path is connected to. See audio.h, audio_devices_t -// for device values. -// The effect implementation must set EFFECT_FLAG_DEVICE_IND flag in its descriptor to receive this -// command when the device changes -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(uint32_t) -// data: uint32_t -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 0 -// data: N/A -//================================================================================================== -// command: EFFECT_CMD_SET_VOLUME -//-------------------------------------------------------------------------------------------------- -// description: -// Set and get volume. Used by audio framework to delegate volume control to effect engine. -// The effect implementation must set EFFECT_FLAG_VOLUME_IND or EFFECT_FLAG_VOLUME_CTRL flag in -// its descriptor to receive this command before every call to process() function -// If EFFECT_FLAG_VOLUME_CTRL flag is set in the effect descriptor, the effect engine must return -// the volume that should be applied before the effect is processed. The overall volume (the volume -// actually applied by the effect engine multiplied by the returned value) should match the value -// indicated in the command. -//-------------------------------------------------------------------------------------------------- -// command format: -// size: n * sizeof(uint32_t) -// data: volume for each channel defined in effect_config_t for output buffer expressed in -// 8.24 fixed point format -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: n * sizeof(uint32_t) / 0 -// data: - if EFFECT_FLAG_VOLUME_CTRL is set in effect descriptor: -// volume for each channel defined in effect_config_t for output buffer expressed in -// 8.24 fixed point format -// - if EFFECT_FLAG_VOLUME_CTRL is not set in effect descriptor: -// N/A -// It is legal to receive a null pointer as pReplyData in which case the effect framework has -// delegated volume control to another effect -//================================================================================================== -// command: EFFECT_CMD_SET_AUDIO_MODE -//-------------------------------------------------------------------------------------------------- -// description: -// Set the audio mode. The effect implementation must set EFFECT_FLAG_AUDIO_MODE_IND flag in its -// descriptor to receive this command when the audio mode changes. -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(uint32_t) -// data: audio_mode_t -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 0 -// data: N/A -//================================================================================================== -// command: EFFECT_CMD_SET_CONFIG_REVERSE -//-------------------------------------------------------------------------------------------------- -// description: -// Apply new audio parameters configurations for input and output buffers of reverse stream. -// An example of reverse stream is the echo reference supplied to an Acoustic Echo Canceler. -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(effect_config_t) -// data: effect_config_t -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_SET_INPUT_DEVICE -//-------------------------------------------------------------------------------------------------- -// description: -// Set the capture device the audio input path is connected to. See audio.h, audio_devices_t -// for device values. -// The effect implementation must set EFFECT_FLAG_DEVICE_IND flag in its descriptor to receive this -// command when the device changes -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(uint32_t) -// data: uint32_t -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 0 -// data: N/A -//================================================================================================== -// command: EFFECT_CMD_GET_CONFIG -//-------------------------------------------------------------------------------------------------- -// description: -// Read audio parameters configurations for input and output buffers -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(effect_config_t) -// data: effect_config_t -//================================================================================================== -// command: EFFECT_CMD_GET_CONFIG_REVERSE -//-------------------------------------------------------------------------------------------------- -// description: -// Read audio parameters configurations for input and output buffers of reverse stream -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(effect_config_t) -// data: effect_config_t -//================================================================================================== -// command: EFFECT_CMD_GET_FEATURE_SUPPORTED_CONFIGS -//-------------------------------------------------------------------------------------------------- -// description: -// Queries for supported configurations for a particular feature (e.g. get the supported -// combinations of main and auxiliary channels for a noise suppressor). -// The command parameter is the feature identifier (See effect_feature_e for a list of defined -// features) followed by the maximum number of configuration descriptor to return. -// The reply is composed of: -// - status (uint32_t): -// - 0 if feature is supported -// - -ENOSYS if the feature is not supported, -// - -ENOMEM if the feature is supported but the total number of supported configurations -// exceeds the maximum number indicated by the caller. -// - total number of supported configurations (uint32_t) -// - an array of configuration descriptors. -// The actual number of descriptors returned must not exceed the maximum number indicated by -// the caller. -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 2 x sizeof(uint32_t) -// data: effect_feature_e + maximum number of configurations to return -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 2 x sizeof(uint32_t) + n x sizeof () -// data: status + total number of configurations supported + array of n config descriptors -//================================================================================================== -// command: EFFECT_CMD_GET_FEATURE_CONFIG -//-------------------------------------------------------------------------------------------------- -// description: -// Retrieves current configuration for a given feature. -// The reply status is: -// - 0 if feature is supported -// - -ENOSYS if the feature is not supported, -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(uint32_t) -// data: effect_feature_e -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(uint32_t) + sizeof () -// data: status + config descriptor -//================================================================================================== -// command: EFFECT_CMD_SET_FEATURE_CONFIG -//-------------------------------------------------------------------------------------------------- -// description: -// Sets current configuration for a given feature. -// The reply status is: -// - 0 if feature is supported -// - -ENOSYS if the feature is not supported, -// - -EINVAL if the configuration is invalid -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(uint32_t) + sizeof () -// data: effect_feature_e + config descriptor -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(uint32_t) -// data: status -//================================================================================================== -// command: EFFECT_CMD_FIRST_PROPRIETARY -//-------------------------------------------------------------------------------------------------- -// description: -// All proprietary effect commands must use command codes above this value. The size and format of -// command and response fields is free in this case -//================================================================================================== - - -// Audio buffer descriptor used by process(), bufferProvider() functions and buffer_config_t -// structure. Multi-channel audio is always interleaved. The channel order is from LSB to MSB with -// regard to the channel mask definition in audio.h, audio_channel_mask_t e.g : -// Stereo: left, right -// 5 point 1: front left, front right, front center, low frequency, back left, back right -// The buffer size is expressed in frame count, a frame being composed of samples for all -// channels at a given time. Frame size for unspecified format (AUDIO_FORMAT_OTHER) is 8 bit by -// definition -struct audio_buffer_s { - size_t frameCount; // number of frames in buffer - union { - void* raw; // raw pointer to start of buffer - int32_t* s32; // pointer to signed 32 bit data at start of buffer - int16_t* s16; // pointer to signed 16 bit data at start of buffer - uint8_t* u8; // pointer to unsigned 8 bit data at start of buffer - }; -}; - -// The buffer_provider_s structure contains functions that can be used -// by the effect engine process() function to query and release input -// or output audio buffer. -// The getBuffer() function is called to retrieve a buffer where data -// should read from or written to by process() function. -// The releaseBuffer() function MUST be called when the buffer retrieved -// with getBuffer() is not needed anymore. -// The process function should use the buffer provider mechanism to retrieve -// input or output buffer if the inBuffer or outBuffer passed as argument is NULL -// and the buffer configuration (buffer_config_t) given by the EFFECT_CMD_SET_CONFIG -// command did not specify an audio buffer. - -typedef int32_t (* buffer_function_t)(void *cookie, audio_buffer_t *buffer); - -typedef struct buffer_provider_s { - buffer_function_t getBuffer; // retrieve next buffer - buffer_function_t releaseBuffer; // release used buffer - void *cookie; // for use by client of buffer provider functions -} buffer_provider_t; - - -// The buffer_config_s structure specifies the input or output audio format -// to be used by the effect engine. It is part of the effect_config_t -// structure that defines both input and output buffer configurations and is -// passed by the EFFECT_CMD_SET_CONFIG or EFFECT_CMD_SET_CONFIG_REVERSE command. -typedef struct buffer_config_s { - audio_buffer_t buffer; // buffer for use by process() function if not passed explicitly - uint32_t samplingRate; // sampling rate - uint32_t channels; // channel mask (see audio_channel_mask_t in audio.h) - buffer_provider_t bufferProvider; // buffer provider - uint8_t format; // Audio format (see see audio_format_t in audio.h) - uint8_t accessMode; // read/write or accumulate in buffer (effect_buffer_access_e) - uint16_t mask; // indicates which of the above fields is valid -} buffer_config_t; - -// Values for "accessMode" field of buffer_config_t: -// overwrite, read only, accumulate (read/modify/write) -enum effect_buffer_access_e { - EFFECT_BUFFER_ACCESS_WRITE, - EFFECT_BUFFER_ACCESS_READ, - EFFECT_BUFFER_ACCESS_ACCUMULATE - -}; - -// feature identifiers for EFFECT_CMD_GET_FEATURE_SUPPORTED_CONFIGS command -enum effect_feature_e { - EFFECT_FEATURE_AUX_CHANNELS, // supports auxiliary channels (e.g. dual mic noise suppressor) - EFFECT_FEATURE_CNT -}; - -// EFFECT_FEATURE_AUX_CHANNELS feature configuration descriptor. Describe a combination -// of main and auxiliary channels supported -typedef struct channel_config_s { - uint32_t main_channels; // channel mask for main channels - uint32_t aux_channels; // channel mask for auxiliary channels -} channel_config_t; - - -// Values for bit field "mask" in buffer_config_t. If a bit is set, the corresponding field -// in buffer_config_t must be taken into account when executing the EFFECT_CMD_SET_CONFIG command -#define EFFECT_CONFIG_BUFFER 0x0001 // buffer field must be taken into account -#define EFFECT_CONFIG_SMP_RATE 0x0002 // samplingRate field must be taken into account -#define EFFECT_CONFIG_CHANNELS 0x0004 // channels field must be taken into account -#define EFFECT_CONFIG_FORMAT 0x0008 // format field must be taken into account -#define EFFECT_CONFIG_ACC_MODE 0x0010 // accessMode field must be taken into account -#define EFFECT_CONFIG_PROVIDER 0x0020 // bufferProvider field must be taken into account -#define EFFECT_CONFIG_ALL (EFFECT_CONFIG_BUFFER | EFFECT_CONFIG_SMP_RATE | \ - EFFECT_CONFIG_CHANNELS | EFFECT_CONFIG_FORMAT | \ - EFFECT_CONFIG_ACC_MODE | EFFECT_CONFIG_PROVIDER) - - -// effect_config_s structure describes the format of the pCmdData argument of EFFECT_CMD_SET_CONFIG -// command to configure audio parameters and buffers for effect engine input and output. -typedef struct effect_config_s { - buffer_config_t inputCfg; - buffer_config_t outputCfg; -} effect_config_t; - - -// effect_param_s structure describes the format of the pCmdData argument of EFFECT_CMD_SET_PARAM -// command and pCmdData and pReplyData of EFFECT_CMD_GET_PARAM command. -// psize and vsize represent the actual size of parameter and value. -// -// NOTE: the start of value field inside the data field is always on a 32 bit boundary: -// -// +-----------+ -// | status | sizeof(int) -// +-----------+ -// | psize | sizeof(int) -// +-----------+ -// | vsize | sizeof(int) -// +-----------+ -// | | | | -// ~ parameter ~ > psize | -// | | | > ((psize - 1)/sizeof(int) + 1) * sizeof(int) -// +-----------+ | -// | padding | | -// +-----------+ -// | | | -// ~ value ~ > vsize -// | | | -// +-----------+ - -typedef struct effect_param_s { - int32_t status; // Transaction status (unused for command, used for reply) - uint32_t psize; // Parameter size - uint32_t vsize; // Value size - char data[]; // Start of Parameter + Value data -} effect_param_t; - - - -///////////////////////////////////////////////// -// Effect library interface -///////////////////////////////////////////////// - -// Effect library interface version 2.0 -#define EFFECT_LIBRARY_API_VERSION EFFECT_MAKE_API_VERSION(2,0) - -#define AUDIO_EFFECT_LIBRARY_TAG ((('A') << 24) | (('E') << 16) | (('L') << 8) | ('T')) - -// Every effect library must have a data structure named AUDIO_EFFECT_LIBRARY_INFO_SYM -// and the fields of this data structure must begin with audio_effect_library_t - -typedef struct audio_effect_library_s { - // tag must be initialized to AUDIO_EFFECT_LIBRARY_TAG - uint32_t tag; - // Version of the effect library API : 0xMMMMmmmm MMMM: Major, mmmm: minor - uint32_t version; - // Name of this library - const char *name; - // Author/owner/implementor of the library - const char *implementor; - - //////////////////////////////////////////////////////////////////////////////// - // - // Function: query_num_effects - // - // Description: Returns the number of different effects exposed by the - // library. Each effect must have a unique effect uuid (see - // effect_descriptor_t). This function together with EffectQueryEffect() - // is used to enumerate all effects present in the library. - // - // Input/Output: - // pNumEffects: address where the number of effects should be returned. - // - // Output: - // returned value: 0 successful operation. - // -ENODEV library failed to initialize - // -EINVAL invalid pNumEffects - // *pNumEffects: updated with number of effects in library - // - //////////////////////////////////////////////////////////////////////////////// - int32_t (*query_num_effects)(uint32_t *pNumEffects); - - //////////////////////////////////////////////////////////////////////////////// - // - // Function: query_effect - // - // Description: Returns the descriptor of the effect engine which index is - // given as argument. - // See effect_descriptor_t for details on effect descriptors. - // This function together with EffectQueryNumberEffects() is used to enumerate all - // effects present in the library. The enumeration sequence is: - // EffectQueryNumberEffects(&num_effects); - // for (i = 0; i < num_effects; i++) - // EffectQueryEffect(i,...); - // - // Input/Output: - // index: index of the effect - // pDescriptor: address where to return the effect descriptor. - // - // Output: - // returned value: 0 successful operation. - // -ENODEV library failed to initialize - // -EINVAL invalid pDescriptor or index - // -ENOSYS effect list has changed since last execution of - // EffectQueryNumberEffects() - // -ENOENT no more effect available - // *pDescriptor: updated with the effect descriptor. - // - //////////////////////////////////////////////////////////////////////////////// - int32_t (*query_effect)(uint32_t index, - effect_descriptor_t *pDescriptor); - - //////////////////////////////////////////////////////////////////////////////// - // - // Function: create_effect - // - // Description: Creates an effect engine of the specified implementation uuid and - // returns an effect control interface on this engine. The function will allocate the - // resources for an instance of the requested effect engine and return - // a handle on the effect control interface. - // - // Input: - // uuid: pointer to the effect uuid. - // sessionId: audio session to which this effect instance will be attached. All effects - // created with the same session ID are connected in series and process the same signal - // stream. Knowing that two effects are part of the same effect chain can help the - // library implement some kind of optimizations. - // ioId: identifies the output or input stream this effect is directed to at audio HAL. - // For future use especially with tunneled HW accelerated effects - // - // Input/Output: - // pHandle: address where to return the effect interface handle. - // - // Output: - // returned value: 0 successful operation. - // -ENODEV library failed to initialize - // -EINVAL invalid pEffectUuid or pHandle - // -ENOENT no effect with this uuid found - // *pHandle: updated with the effect interface handle. - // - //////////////////////////////////////////////////////////////////////////////// - int32_t (*create_effect)(const effect_uuid_t *uuid, - int32_t sessionId, - int32_t ioId, - effect_handle_t *pHandle); - - //////////////////////////////////////////////////////////////////////////////// - // - // Function: release_effect - // - // Description: Releases the effect engine whose handle is given as argument. - // All resources allocated to this particular instance of the effect are - // released. - // - // Input: - // handle: handle on the effect interface to be released. - // - // Output: - // returned value: 0 successful operation. - // -ENODEV library failed to initialize - // -EINVAL invalid interface handle - // - //////////////////////////////////////////////////////////////////////////////// - int32_t (*release_effect)(effect_handle_t handle); - - //////////////////////////////////////////////////////////////////////////////// - // - // Function: get_descriptor - // - // Description: Returns the descriptor of the effect engine which implementation UUID is - // given as argument. - // - // Input/Output: - // uuid: pointer to the effect uuid. - // pDescriptor: address where to return the effect descriptor. - // - // Output: - // returned value: 0 successful operation. - // -ENODEV library failed to initialize - // -EINVAL invalid pDescriptor or uuid - // *pDescriptor: updated with the effect descriptor. - // - //////////////////////////////////////////////////////////////////////////////// - int32_t (*get_descriptor)(const effect_uuid_t *uuid, - effect_descriptor_t *pDescriptor); -} audio_effect_library_t; - -// Name of the hal_module_info -#define AUDIO_EFFECT_LIBRARY_INFO_SYM AELI - -// Name of the hal_module_info as a string -#define AUDIO_EFFECT_LIBRARY_INFO_SYM_AS_STR "AELI" - -__END_DECLS - -#endif // ANDROID_AUDIO_EFFECT_H diff --git a/external/android/include/16/hardware/libhardware/include/hardware/audio_policy.h b/external/android/include/16/hardware/libhardware/include/hardware/audio_policy.h deleted file mode 100644 index 78a1a62..0000000 --- a/external/android/include/16/hardware/libhardware/include/hardware/audio_policy.h +++ /dev/null @@ -1,439 +0,0 @@ -/* - * Copyright (C) 2011 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_AUDIO_POLICY_INTERFACE_H -#define ANDROID_AUDIO_POLICY_INTERFACE_H - -#include -#include -#include - -#include - -#include -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define AUDIO_POLICY_HARDWARE_MODULE_ID "audio_policy" - -/** - * Name of the audio devices to open - */ -#define AUDIO_POLICY_INTERFACE "policy" - -/* ---------------------------------------------------------------------------- */ - -/* - * The audio_policy and audio_policy_service_ops structs define the - * communication interfaces between the platform specific audio policy manager - * and Android generic audio policy manager. - * The platform specific audio policy manager must implement methods of the - * audio_policy struct. - * This implementation makes use of the audio_policy_service_ops to control - * the activity and configuration of audio input and output streams. - * - * The platform specific audio policy manager is in charge of the audio - * routing and volume control policies for a given platform. - * The main roles of this module are: - * - keep track of current system state (removable device connections, phone - * state, user requests...). - * System state changes and user actions are notified to audio policy - * manager with methods of the audio_policy. - * - * - process get_output() queries received when AudioTrack objects are - * created: Those queries return a handler on an output that has been - * selected, configured and opened by the audio policy manager and that - * must be used by the AudioTrack when registering to the AudioFlinger - * with the createTrack() method. - * When the AudioTrack object is released, a release_output() query - * is received and the audio policy manager can decide to close or - * reconfigure the output depending on other streams using this output and - * current system state. - * - * - similarly process get_input() and release_input() queries received from - * AudioRecord objects and configure audio inputs. - * - process volume control requests: the stream volume is converted from - * an index value (received from UI) to a float value applicable to each - * output as a function of platform specific settings and current output - * route (destination device). It also make sure that streams are not - * muted if not allowed (e.g. camera shutter sound in some countries). - */ - -/* XXX: this should be defined OUTSIDE of frameworks/base */ -struct effect_descriptor_s; - -struct audio_policy { - /* - * configuration functions - */ - - /* indicate a change in device connection status */ - int (*set_device_connection_state)(struct audio_policy *pol, - audio_devices_t device, - audio_policy_dev_state_t state, - const char *device_address); - - /* retrieve a device connection status */ - audio_policy_dev_state_t (*get_device_connection_state)( - const struct audio_policy *pol, - audio_devices_t device, - const char *device_address); - - /* indicate a change in phone state. Valid phones states are defined - * by audio_mode_t */ - void (*set_phone_state)(struct audio_policy *pol, audio_mode_t state); - - /* deprecated, never called (was "indicate a change in ringer mode") */ - void (*set_ringer_mode)(struct audio_policy *pol, uint32_t mode, - uint32_t mask); - - /* force using a specific device category for the specified usage */ - void (*set_force_use)(struct audio_policy *pol, - audio_policy_force_use_t usage, - audio_policy_forced_cfg_t config); - - /* retrieve current device category forced for a given usage */ - audio_policy_forced_cfg_t (*get_force_use)(const struct audio_policy *pol, - audio_policy_force_use_t usage); - - /* if can_mute is true, then audio streams that are marked ENFORCED_AUDIBLE - * can still be muted. */ - void (*set_can_mute_enforced_audible)(struct audio_policy *pol, - bool can_mute); - - /* check proper initialization */ - int (*init_check)(const struct audio_policy *pol); - - /* - * Audio routing query functions - */ - - /* request an output appropriate for playback of the supplied stream type and - * parameters */ - audio_io_handle_t (*get_output)(struct audio_policy *pol, - audio_stream_type_t stream, - uint32_t samplingRate, - audio_format_t format, - uint32_t channels, - audio_output_flags_t flags); - - /* indicates to the audio policy manager that the output starts being used - * by corresponding stream. */ - int (*start_output)(struct audio_policy *pol, - audio_io_handle_t output, - audio_stream_type_t stream, - int session); - - /* indicates to the audio policy manager that the output stops being used - * by corresponding stream. */ - int (*stop_output)(struct audio_policy *pol, - audio_io_handle_t output, - audio_stream_type_t stream, - int session); - - /* releases the output. */ - void (*release_output)(struct audio_policy *pol, audio_io_handle_t output); - - /* request an input appropriate for record from the supplied device with - * supplied parameters. */ - audio_io_handle_t (*get_input)(struct audio_policy *pol, audio_source_t inputSource, - uint32_t samplingRate, - audio_format_t format, - uint32_t channels, - audio_in_acoustics_t acoustics); - - /* indicates to the audio policy manager that the input starts being used */ - int (*start_input)(struct audio_policy *pol, audio_io_handle_t input); - - /* indicates to the audio policy manager that the input stops being used. */ - int (*stop_input)(struct audio_policy *pol, audio_io_handle_t input); - - /* releases the input. */ - void (*release_input)(struct audio_policy *pol, audio_io_handle_t input); - - /* - * volume control functions - */ - - /* initialises stream volume conversion parameters by specifying volume - * index range. The index range for each stream is defined by AudioService. */ - void (*init_stream_volume)(struct audio_policy *pol, - audio_stream_type_t stream, - int index_min, - int index_max); - - /* sets the new stream volume at a level corresponding to the supplied - * index. The index is within the range specified by init_stream_volume() */ - int (*set_stream_volume_index)(struct audio_policy *pol, - audio_stream_type_t stream, - int index); - - /* retrieve current volume index for the specified stream */ - int (*get_stream_volume_index)(const struct audio_policy *pol, - audio_stream_type_t stream, - int *index); - - /* sets the new stream volume at a level corresponding to the supplied - * index for the specified device. - * The index is within the range specified by init_stream_volume() */ - int (*set_stream_volume_index_for_device)(struct audio_policy *pol, - audio_stream_type_t stream, - int index, - audio_devices_t device); - - /* retrieve current volume index for the specified stream for the specified device */ - int (*get_stream_volume_index_for_device)(const struct audio_policy *pol, - audio_stream_type_t stream, - int *index, - audio_devices_t device); - - /* return the strategy corresponding to a given stream type */ - uint32_t (*get_strategy_for_stream)(const struct audio_policy *pol, - audio_stream_type_t stream); - - /* return the enabled output devices for the given stream type */ - audio_devices_t (*get_devices_for_stream)(const struct audio_policy *pol, - audio_stream_type_t stream); - - /* Audio effect management */ - audio_io_handle_t (*get_output_for_effect)(struct audio_policy *pol, - struct effect_descriptor_s *desc); - - int (*register_effect)(struct audio_policy *pol, - struct effect_descriptor_s *desc, - audio_io_handle_t output, - uint32_t strategy, - int session, - int id); - - int (*unregister_effect)(struct audio_policy *pol, int id); - - int (*set_effect_enabled)(struct audio_policy *pol, int id, bool enabled); - - bool (*is_stream_active)(const struct audio_policy *pol, - audio_stream_type_t stream, - uint32_t in_past_ms); - - /* dump state */ - int (*dump)(const struct audio_policy *pol, int fd); -}; - -/* audio hw module handle used by load_hw_module(), open_output_on_module() - * and open_input_on_module() */ -typedef int audio_module_handle_t; - -struct audio_policy_service_ops { - /* - * Audio output Control functions - */ - - /* Opens an audio output with the requested parameters. - * - * The parameter values can indicate to use the default values in case the - * audio policy manager has no specific requirements for the output being - * opened. - * - * When the function returns, the parameter values reflect the actual - * values used by the audio hardware output stream. - * - * The audio policy manager can check if the proposed parameters are - * suitable or not and act accordingly. - */ - audio_io_handle_t (*open_output)(void *service, - audio_devices_t *pDevices, - uint32_t *pSamplingRate, - audio_format_t *pFormat, - audio_channel_mask_t *pChannelMask, - uint32_t *pLatencyMs, - audio_output_flags_t flags); - - /* creates a special output that is duplicated to the two outputs passed as - * arguments. The duplication is performed by - * a special mixer thread in the AudioFlinger. - */ - audio_io_handle_t (*open_duplicate_output)(void *service, - audio_io_handle_t output1, - audio_io_handle_t output2); - - /* closes the output stream */ - int (*close_output)(void *service, audio_io_handle_t output); - - /* suspends the output. - * - * When an output is suspended, the corresponding audio hardware output - * stream is placed in standby and the AudioTracks attached to the mixer - * thread are still processed but the output mix is discarded. - */ - int (*suspend_output)(void *service, audio_io_handle_t output); - - /* restores a suspended output. */ - int (*restore_output)(void *service, audio_io_handle_t output); - - /* */ - /* Audio input Control functions */ - /* */ - - /* opens an audio input */ - audio_io_handle_t (*open_input)(void *service, - audio_devices_t *pDevices, - uint32_t *pSamplingRate, - audio_format_t *pFormat, - audio_channel_mask_t *pChannelMask, - audio_in_acoustics_t acoustics); - - /* closes an audio input */ - int (*close_input)(void *service, audio_io_handle_t input); - - /* */ - /* misc control functions */ - /* */ - - /* set a stream volume for a particular output. - * - * For the same user setting, a given stream type can have different - * volumes for each output (destination device) it is attached to. - */ - int (*set_stream_volume)(void *service, - audio_stream_type_t stream, - float volume, - audio_io_handle_t output, - int delay_ms); - - /* reroute a given stream type to the specified output */ - int (*set_stream_output)(void *service, - audio_stream_type_t stream, - audio_io_handle_t output); - - /* function enabling to send proprietary informations directly from audio - * policy manager to audio hardware interface. */ - void (*set_parameters)(void *service, - audio_io_handle_t io_handle, - const char *kv_pairs, - int delay_ms); - - /* function enabling to receive proprietary informations directly from - * audio hardware interface to audio policy manager. - * - * Returns a pointer to a heap allocated string. The caller is responsible - * for freeing the memory for it using free(). - */ - - char * (*get_parameters)(void *service, audio_io_handle_t io_handle, - const char *keys); - - /* request the playback of a tone on the specified stream. - * used for instance to replace notification sounds when playing over a - * telephony device during a phone call. - */ - int (*start_tone)(void *service, - audio_policy_tone_t tone, - audio_stream_type_t stream); - - int (*stop_tone)(void *service); - - /* set down link audio volume. */ - int (*set_voice_volume)(void *service, - float volume, - int delay_ms); - - /* move effect to the specified output */ - int (*move_effects)(void *service, - int session, - audio_io_handle_t src_output, - audio_io_handle_t dst_output); - - /* loads an audio hw module. - * - * The module name passed is the base name of the HW module library, e.g "primary" or "a2dp". - * The function returns a handle on the module that will be used to specify a particular - * module when calling open_output_on_module() or open_input_on_module() - */ - audio_module_handle_t (*load_hw_module)(void *service, - const char *name); - - /* Opens an audio output on a particular HW module. - * - * Same as open_output() but specifying a specific HW module on which the output must be opened. - */ - audio_io_handle_t (*open_output_on_module)(void *service, - audio_module_handle_t module, - audio_devices_t *pDevices, - uint32_t *pSamplingRate, - audio_format_t *pFormat, - audio_channel_mask_t *pChannelMask, - uint32_t *pLatencyMs, - audio_output_flags_t flags); - - /* Opens an audio input on a particular HW module. - * - * Same as open_input() but specifying a specific HW module on which the input must be opened. - * Also removed deprecated acoustics parameter - */ - audio_io_handle_t (*open_input_on_module)(void *service, - audio_module_handle_t module, - audio_devices_t *pDevices, - uint32_t *pSamplingRate, - audio_format_t *pFormat, - audio_channel_mask_t *pChannelMask); - -}; - -/**********************************************************************/ - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -typedef struct audio_policy_module { - struct hw_module_t common; -} audio_policy_module_t; - -struct audio_policy_device { - struct hw_device_t common; - - int (*create_audio_policy)(const struct audio_policy_device *device, - struct audio_policy_service_ops *aps_ops, - void *service, - struct audio_policy **ap); - - int (*destroy_audio_policy)(const struct audio_policy_device *device, - struct audio_policy *ap); -}; - -/** convenience API for opening and closing a supported device */ - -static inline int audio_policy_dev_open(const hw_module_t* module, - struct audio_policy_device** device) -{ - return module->methods->open(module, AUDIO_POLICY_INTERFACE, - (hw_device_t**)device); -} - -static inline int audio_policy_dev_close(struct audio_policy_device* device) -{ - return device->common.close(&device->common); -} - - -__END_DECLS - -#endif // ANDROID_AUDIO_POLICY_INTERFACE_H diff --git a/external/android/include/16/hardware/libhardware/include/hardware/camera.h b/external/android/include/16/hardware/libhardware/include/hardware/camera.h deleted file mode 100644 index b7182f8..0000000 --- a/external/android/include/16/hardware/libhardware/include/hardware/camera.h +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Copyright (C) 2010-2011 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_INCLUDE_CAMERA_H -#define ANDROID_INCLUDE_CAMERA_H - -#include "camera_common.h" - -/** - * Camera device HAL, initial version [ CAMERA_DEVICE_API_VERSION_1_0 ] - * - * Supports the android.hardware.Camera API. - * - * Camera devices that support this version of the HAL must return a value in - * the range HARDWARE_DEVICE_API_VERSION(0,0)-(1,FF) in - * camera_device_t.common.version. CAMERA_DEVICE_API_VERSION_1_0 is the - * recommended value. - * - * Camera modules that implement version 2.0 or higher of camera_module_t must - * also return the value of camera_device_t.common.version in - * camera_info_t.device_version. - * - * See camera_common.h for more details. - */ - -__BEGIN_DECLS - -struct camera_memory; -typedef void (*camera_release_memory)(struct camera_memory *mem); - -typedef struct camera_memory { - void *data; - size_t size; - void *handle; - camera_release_memory release; -} camera_memory_t; - -typedef camera_memory_t* (*camera_request_memory)(int fd, size_t buf_size, unsigned int num_bufs, - void *user); - -typedef void (*camera_notify_callback)(int32_t msg_type, - int32_t ext1, - int32_t ext2, - void *user); - -typedef void (*camera_data_callback)(int32_t msg_type, - const camera_memory_t *data, unsigned int index, - camera_frame_metadata_t *metadata, void *user); - -typedef void (*camera_data_timestamp_callback)(int64_t timestamp, - int32_t msg_type, - const camera_memory_t *data, unsigned int index, - void *user); - -#define HAL_CAMERA_PREVIEW_WINDOW_TAG 0xcafed00d - -typedef struct preview_stream_ops { - int (*dequeue_buffer)(struct preview_stream_ops* w, - buffer_handle_t** buffer, int *stride); - int (*enqueue_buffer)(struct preview_stream_ops* w, - buffer_handle_t* buffer); - int (*cancel_buffer)(struct preview_stream_ops* w, - buffer_handle_t* buffer); - int (*set_buffer_count)(struct preview_stream_ops* w, int count); - int (*set_buffers_geometry)(struct preview_stream_ops* pw, - int w, int h, int format); - int (*set_crop)(struct preview_stream_ops *w, - int left, int top, int right, int bottom); - int (*set_usage)(struct preview_stream_ops* w, int usage); - int (*set_swap_interval)(struct preview_stream_ops *w, int interval); - int (*get_min_undequeued_buffer_count)(const struct preview_stream_ops *w, - int *count); - int (*lock_buffer)(struct preview_stream_ops* w, - buffer_handle_t* buffer); - // Timestamps are measured in nanoseconds, and must be comparable - // and monotonically increasing between two frames in the same - // preview stream. They do not need to be comparable between - // consecutive or parallel preview streams, cameras, or app runs. - int (*set_timestamp)(struct preview_stream_ops *w, int64_t timestamp); -} preview_stream_ops_t; - -struct camera_device; -typedef struct camera_device_ops { - /** Set the ANativeWindow to which preview frames are sent */ - int (*set_preview_window)(struct camera_device *, - struct preview_stream_ops *window); - - /** Set the notification and data callbacks */ - void (*set_callbacks)(struct camera_device *, - camera_notify_callback notify_cb, - camera_data_callback data_cb, - camera_data_timestamp_callback data_cb_timestamp, - camera_request_memory get_memory, - void *user); - - /** - * The following three functions all take a msg_type, which is a bitmask of - * the messages defined in include/ui/Camera.h - */ - - /** - * Enable a message, or set of messages. - */ - void (*enable_msg_type)(struct camera_device *, int32_t msg_type); - - /** - * Disable a message, or a set of messages. - * - * Once received a call to disableMsgType(CAMERA_MSG_VIDEO_FRAME), camera - * HAL should not rely on its client to call releaseRecordingFrame() to - * release video recording frames sent out by the cameral HAL before and - * after the disableMsgType(CAMERA_MSG_VIDEO_FRAME) call. Camera HAL - * clients must not modify/access any video recording frame after calling - * disableMsgType(CAMERA_MSG_VIDEO_FRAME). - */ - void (*disable_msg_type)(struct camera_device *, int32_t msg_type); - - /** - * Query whether a message, or a set of messages, is enabled. Note that - * this is operates as an AND, if any of the messages queried are off, this - * will return false. - */ - int (*msg_type_enabled)(struct camera_device *, int32_t msg_type); - - /** - * Start preview mode. - */ - int (*start_preview)(struct camera_device *); - - /** - * Stop a previously started preview. - */ - void (*stop_preview)(struct camera_device *); - - /** - * Returns true if preview is enabled. - */ - int (*preview_enabled)(struct camera_device *); - - /** - * Request the camera HAL to store meta data or real YUV data in the video - * buffers sent out via CAMERA_MSG_VIDEO_FRAME for a recording session. If - * it is not called, the default camera HAL behavior is to store real YUV - * data in the video buffers. - * - * This method should be called before startRecording() in order to be - * effective. - * - * If meta data is stored in the video buffers, it is up to the receiver of - * the video buffers to interpret the contents and to find the actual frame - * data with the help of the meta data in the buffer. How this is done is - * outside of the scope of this method. - * - * Some camera HALs may not support storing meta data in the video buffers, - * but all camera HALs should support storing real YUV data in the video - * buffers. If the camera HAL does not support storing the meta data in the - * video buffers when it is requested to do do, INVALID_OPERATION must be - * returned. It is very useful for the camera HAL to pass meta data rather - * than the actual frame data directly to the video encoder, since the - * amount of the uncompressed frame data can be very large if video size is - * large. - * - * @param enable if true to instruct the camera HAL to store - * meta data in the video buffers; false to instruct - * the camera HAL to store real YUV data in the video - * buffers. - * - * @return OK on success. - */ - int (*store_meta_data_in_buffers)(struct camera_device *, int enable); - - /** - * Start record mode. When a record image is available, a - * CAMERA_MSG_VIDEO_FRAME message is sent with the corresponding - * frame. Every record frame must be released by a camera HAL client via - * releaseRecordingFrame() before the client calls - * disableMsgType(CAMERA_MSG_VIDEO_FRAME). After the client calls - * disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is the camera HAL's - * responsibility to manage the life-cycle of the video recording frames, - * and the client must not modify/access any video recording frames. - */ - int (*start_recording)(struct camera_device *); - - /** - * Stop a previously started recording. - */ - void (*stop_recording)(struct camera_device *); - - /** - * Returns true if recording is enabled. - */ - int (*recording_enabled)(struct camera_device *); - - /** - * Release a record frame previously returned by CAMERA_MSG_VIDEO_FRAME. - * - * It is camera HAL client's responsibility to release video recording - * frames sent out by the camera HAL before the camera HAL receives a call - * to disableMsgType(CAMERA_MSG_VIDEO_FRAME). After it receives the call to - * disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is the camera HAL's - * responsibility to manage the life-cycle of the video recording frames. - */ - void (*release_recording_frame)(struct camera_device *, - const void *opaque); - - /** - * Start auto focus, the notification callback routine is called with - * CAMERA_MSG_FOCUS once when focusing is complete. autoFocus() will be - * called again if another auto focus is needed. - */ - int (*auto_focus)(struct camera_device *); - - /** - * Cancels auto-focus function. If the auto-focus is still in progress, - * this function will cancel it. Whether the auto-focus is in progress or - * not, this function will return the focus position to the default. If - * the camera does not support auto-focus, this is a no-op. - */ - int (*cancel_auto_focus)(struct camera_device *); - - /** - * Take a picture. - */ - int (*take_picture)(struct camera_device *); - - /** - * Cancel a picture that was started with takePicture. Calling this method - * when no picture is being taken is a no-op. - */ - int (*cancel_picture)(struct camera_device *); - - /** - * Set the camera parameters. This returns BAD_VALUE if any parameter is - * invalid or not supported. - */ - int (*set_parameters)(struct camera_device *, const char *parms); - - /** Retrieve the camera parameters. The buffer returned by the camera HAL - must be returned back to it with put_parameters, if put_parameters - is not NULL. - */ - char *(*get_parameters)(struct camera_device *); - - /** The camera HAL uses its own memory to pass us the parameters when we - call get_parameters. Use this function to return the memory back to - the camera HAL, if put_parameters is not NULL. If put_parameters - is NULL, then you have to use free() to release the memory. - */ - void (*put_parameters)(struct camera_device *, char *); - - /** - * Send command to camera driver. - */ - int (*send_command)(struct camera_device *, - int32_t cmd, int32_t arg1, int32_t arg2); - - /** - * Release the hardware resources owned by this object. Note that this is - * *not* done in the destructor. - */ - void (*release)(struct camera_device *); - - /** - * Dump state of the camera hardware - */ - int (*dump)(struct camera_device *, int fd); -} camera_device_ops_t; - -typedef struct camera_device { - /** - * camera_device.common.version must be in the range - * HARDWARE_DEVICE_API_VERSION(0,0)-(1,FF). CAMERA_DEVICE_API_VERSION_1_0 is - * recommended. - */ - hw_device_t common; - camera_device_ops_t *ops; - void *priv; -} camera_device_t; - -__END_DECLS - -#endif /* #ifdef ANDROID_INCLUDE_CAMERA_H */ diff --git a/external/android/include/16/hardware/libhardware/include/hardware/camera2.h b/external/android/include/16/hardware/libhardware/include/hardware/camera2.h deleted file mode 100644 index 36f2a9e..0000000 --- a/external/android/include/16/hardware/libhardware/include/hardware/camera2.h +++ /dev/null @@ -1,311 +0,0 @@ -/* - * Copyright (C) 2012 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_INCLUDE_CAMERA2_H -#define ANDROID_INCLUDE_CAMERA2_H - -#include "camera_common.h" - -/** - * Camera device HAL 2.0 [ CAMERA_DEVICE_API_VERSION_2_0 ] - * - * EXPERIMENTAL. - * - * Supports both the android.hardware.ProCamera and - * android.hardware.Camera APIs. - * - * Camera devices that support this version of the HAL must return - * CAMERA_DEVICE_API_VERSION_2_0 in camera_device_t.common.version and in - * camera_info_t.device_version (from camera_module_t.get_camera_info). - * - * Camera modules that may contain version 2.0 devices must implement at least - * version 2.0 of the camera module interface (as defined by - * camera_module_t.common.module_api_version). - * - * See camera_common.h for more details. - * - */ - -__BEGIN_DECLS - -struct camera2_device; - -/** - * Output image stream queue management - */ - -typedef struct camera2_stream_ops { - int (*dequeue_buffer)(struct camera2_stream_ops* w, - buffer_handle_t** buffer, int *stride); - int (*enqueue_buffer)(struct camera2_stream_ops* w, - buffer_handle_t* buffer); - int (*cancel_buffer)(struct camera2_stream_ops* w, - buffer_handle_t* buffer); - int (*set_buffer_count)(struct camera2_stream_ops* w, int count); - int (*set_buffers_geometry)(struct camera2_stream_ops* pw, - int w, int h, int format); - int (*set_crop)(struct camera2_stream_ops *w, - int left, int top, int right, int bottom); - // Timestamps are measured in nanoseconds, and must be comparable - // and monotonically increasing between two frames in the same - // preview stream. They do not need to be comparable between - // consecutive or parallel preview streams, cameras, or app runs. - // The timestamp must be the time at the start of image exposure. - int (*set_timestamp)(struct camera2_stream_ops *w, int64_t timestamp); - int (*set_usage)(struct camera2_stream_ops* w, int usage); - int (*get_min_undequeued_buffer_count)(const struct camera2_stream_ops *w, - int *count); - int (*lock_buffer)(struct camera2_stream_ops* w, - buffer_handle_t* buffer); -} camera2_stream_ops_t; - -/** - * Metadata queue management, used for requests sent to HAL module, and for - * frames produced by the HAL. - * - * Queue protocol: - * - * The source holds the queue and its contents. At start, the queue is empty. - * - * 1. When the first metadata buffer is placed into the queue, the source must - * signal the destination by calling notify_queue_not_empty(). - * - * 2. After receiving notify_queue_not_empty, the destination must call - * dequeue() once it's ready to handle the next buffer. - * - * 3. Once the destination has processed a buffer, it should try to dequeue - * another buffer. If there are no more buffers available, dequeue() will - * return NULL. In this case, when a buffer becomes available, the source - * must call notify_queue_not_empty() again. If the destination receives a - * NULL return from dequeue, it does not need to query the queue again until - * a notify_queue_not_empty() call is received from the source. - * - * 4. If the destination calls buffer_count() and receives 0, this does not mean - * that the source will provide a notify_queue_not_empty() call. The source - * must only provide such a call after the destination has received a NULL - * from dequeue, or on initial startup. - * - * 5. The dequeue() call in response to notify_queue_not_empty() may be on the - * same thread as the notify_queue_not_empty() call. The source must not - * deadlock in that case. - */ - -typedef struct camera2_metadata_queue_src_ops { - /** - * Get count of buffers in queue - */ - int (*buffer_count)(camera2_metadata_queue_src_ops *q); - - /** - * Get a metadata buffer from the source. Returns OK if a request is - * available, placing a pointer to it in next_request. - */ - int (*dequeue)(camera2_metadata_queue_src_ops *q, - camera_metadata_t **buffer); - /** - * Return a metadata buffer to the source once it has been used - */ - int (*free)(camera2_metadata_queue_src_ops *q, - camera_metadata_t *old_buffer); - -} camera2_metadata_queue_src_ops_t; - -typedef struct camera2_metadata_queue_dst_ops { - /** - * Notify destination that the queue is no longer empty - */ - int (*notify_queue_not_empty)(struct camera2_metadata_queue_dst_ops *); - -} camera2_metadata_queue_dst_ops_t; - -/* Defined in camera_metadata.h */ -typedef struct vendor_tag_query_ops vendor_tag_query_ops_t; - -/** - * Asynchronous notification callback from the HAL, fired for various - * reasons. Only for information independent of frame capture, or that require - * specific timing. - */ -typedef void (*camera2_notify_callback)(int32_t msg_type, - int32_t ext1, - int32_t ext2, - void *user); - -/** - * Possible message types for camera2_notify_callback - */ -enum { - /** - * A serious error has occurred. Argument ext1 contains the error code, and - * ext2 and user contain any error-specific information. - */ - CAMERA2_MSG_ERROR = 0x0001, - /** - * The exposure of a given request has begun. Argument ext1 contains the - * request id. - */ - CAMERA2_MSG_SHUTTER = 0x0002 -}; - -/** - * Error codes for CAMERA_MSG_ERROR - */ -enum { - /** - * A serious failure occured. Camera device may not work without reboot, and - * no further frames or buffer streams will be produced by the - * device. Device should be treated as closed. - */ - CAMERA2_MSG_ERROR_HARDWARE_FAULT = 0x0001, - /** - * A serious failure occured. No further frames or buffer streams will be - * produced by the device. Device should be treated as closed. The client - * must reopen the device to use it again. - */ - CAMERA2_MSG_ERROR_DEVICE_FAULT = 0x0002, - /** - * The camera service has failed. Device should be treated as released. The client - * must reopen the device to use it again. - */ - CAMERA2_MSG_ERROR_SERVER_FAULT = 0x0003 -}; - -typedef struct camera2_device_ops { - /** - * Input request queue methods - */ - int (*set_request_queue_src_ops)(struct camera2_device *, - camera2_metadata_queue_src_ops *queue_src_ops); - - int (*get_request_queue_dst_ops)(struct camera2_device *, - camera2_metadata_queue_dst_ops **queue_dst_ops); - - /** - * Input reprocessing queue methods - */ - int (*set_reprocess_queue_ops)(struct camera2_device *, - camera2_metadata_queue_src_ops *queue_src_ops); - - int (*get_reprocess_queue_dst_ops)(struct camera2_device *, - camera2_metadata_queue_dst_ops **queue_dst_ops); - - /** - * Output frame queue methods - */ - int (*set_frame_queue_dst_ops)(struct camera2_device *, - camera2_metadata_queue_dst_ops *queue_dst_ops); - - int (*get_frame_queue_src_ops)(struct camera2_device *, - camera2_metadata_queue_src_ops **queue_dst_ops); - - /** - * Pass in notification methods - */ - int (*set_notify_callback)(struct camera2_device *, - camera2_notify_callback notify_cb); - - /** - * Number of camera frames being processed by the device - * at the moment (frames that have had their request dequeued, - * but have not yet been enqueued onto output pipeline(s) ) - */ - int (*get_in_progress_count)(struct camera2_device *); - - /** - * Flush all in-progress captures. This includes all dequeued requests - * (regular or reprocessing) that have not yet placed any outputs into a - * stream or the frame queue. Partially completed captures must be completed - * normally. No new requests may be dequeued from the request or - * reprocessing queues until the flush completes. - */ - int (*flush_captures_in_progress)(struct camera2_device *); - - /** - * Camera stream management - */ - - /** - * Operations on the input reprocessing stream - */ - int (*get_reprocess_stream_ops)(struct camera2_device *, - camera2_stream_ops_t **stream_ops); - - /** - * Get the number of streams that can be simultaneously allocated. - * A request may include any allocated pipeline for its output, without - * causing a substantial delay in frame production. - */ - int (*get_stream_slot_count)(struct camera2_device *); - - /** - * Allocate a new stream for use. Requires specifying which pipeline slot - * to use. Specifies the buffer width, height, and format. - * Error conditions: - * - Allocating an already-allocated slot without first releasing it - * - Requesting a width/height/format combination not listed as supported - * - Requesting a pipeline slot >= pipeline slot count. - */ - int (*allocate_stream)( - struct camera2_device *, - uint32_t stream_slot, - uint32_t width, - uint32_t height, - uint32_t format, - camera2_stream_ops_t *camera2_stream_ops); - - /** - * Release a stream. Returns an error if called when - * get_in_progress_count is non-zero, or if the pipeline slot is not - * allocated. - */ - int (*release_stream)( - struct camera2_device *, - uint32_t stream_slot); - - /** - * Get methods to query for vendor extension metadata tag infomation. May - * set ops to NULL if no vendor extension tags are defined. - */ - int (*get_metadata_vendor_tag_ops)(struct camera2_device*, - vendor_tag_query_ops_t **ops); - - /** - * Release the camera hardware. Requests that are in flight will be - * canceled. No further buffers will be pushed into any allocated pipelines - * once this call returns. - */ - void (*release)(struct camera2_device *); - - /** - * Dump state of the camera hardware - */ - int (*dump)(struct camera2_device *, int fd); - -} camera2_device_ops_t; - -typedef struct camera2_device { - /** - * common.version must equal CAMERA_DEVICE_API_VERSION_2_0 to identify - * this device as implementing version 2.0 of the camera device HAL. - */ - hw_device_t common; - camera2_device_ops_t *ops; - void *priv; -} camera2_device_t; - -__END_DECLS - -#endif /* #ifdef ANDROID_INCLUDE_CAMERA2_H */ diff --git a/external/android/include/16/hardware/libhardware/include/hardware/camera_common.h b/external/android/include/16/hardware/libhardware/include/hardware/camera_common.h deleted file mode 100644 index 5459b6c..0000000 --- a/external/android/include/16/hardware/libhardware/include/hardware/camera_common.h +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (C) 2012 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. - */ - -// FIXME: add well-defined names for cameras - -#ifndef ANDROID_INCLUDE_CAMERA_COMMON_H -#define ANDROID_INCLUDE_CAMERA_COMMON_H - -#include -#include -#include -#include -#include -#include -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define CAMERA_HARDWARE_MODULE_ID "camera" - -/** - * Module versioning information for the Camera hardware module, based on - * camera_module_t.common.module_api_version. The two most significant hex - * digits represent the major version, and the two least significant represent - * the minor version. - * - ******************************************************************************* - * Versions: 0.X - 1.X [CAMERA_MODULE_API_VERSION_1_0] - * - * Camera modules that report these version numbers implement the initial - * camera module HAL interface. All camera devices openable through this - * module support only version 1 of the camera device HAL. The device_version - * and static_camera_characteristics fields of camera_info are not valid. Only - * the android.hardware.Camera API can be supported by this module and its - * devices. - * - ******************************************************************************* - * Version: 2.0 [CAMERA_MODULE_API_VERSION_2_0] - * - * Camera modules that report this version number implement the second version - * of the camera module HAL interface. Camera devices openable through this - * module may support either version 1.0 or version 2.0 of the camera device - * HAL interface. The device_version field of camera_info is always valid; the - * static_camera_characteristics field of camera_info is valid if the - * device_version field is 2.0 or higher. - */ - -/** - * Predefined macros for currently-defined version numbers - */ - -/** - * All module versions <= HARDWARE_MODULE_API_VERSION(1, 0xFF) must be treated - * as CAMERA_MODULE_API_VERSION_1_0 - */ -#define CAMERA_MODULE_API_VERSION_1_0 HARDWARE_MODULE_API_VERSION(1, 0) -#define CAMERA_MODULE_API_VERSION_2_0 HARDWARE_MODULE_API_VERSION(2, 0) - -#define CAMERA_MODULE_API_VERSION_CURRENT CAMERA_MODULE_API_VERSION_2_0 - -/** - * All device versions <= HARDWARE_DEVICE_API_VERSION(1, 0xFF) must be treated - * as CAMERA_DEVICE_API_VERSION_1_0 - */ -#define CAMERA_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0) -#define CAMERA_DEVICE_API_VERSION_2_0 HARDWARE_DEVICE_API_VERSION(2, 0) - -// Device version 2.0 is experimental -#define CAMERA_DEVICE_API_VERSION_CURRENT CAMERA_DEVICE_API_VERSION_1_0 - -/** - * Defined in /system/media/camera/include/system/camera_metadata.h - */ -typedef struct camera_metadata camera_metadata_t; - -struct camera_info { - /** - * The direction that the camera faces to. It should be CAMERA_FACING_BACK - * or CAMERA_FACING_FRONT. - * - * Version information: - * Valid in all camera_module versions - */ - int facing; - - /** - * The orientation of the camera image. The value is the angle that the - * camera image needs to be rotated clockwise so it shows correctly on the - * display in its natural orientation. It should be 0, 90, 180, or 270. - * - * For example, suppose a device has a naturally tall screen. The - * back-facing camera sensor is mounted in landscape. You are looking at - * the screen. If the top side of the camera sensor is aligned with the - * right edge of the screen in natural orientation, the value should be - * 90. If the top side of a front-facing camera sensor is aligned with the - * right of the screen, the value should be 270. - * - * Version information: - * Valid in all camera_module versions - */ - int orientation; - - /** - * The value of camera_device_t.common.version. - * - * Version information (based on camera_module_t.common.module_api_version): - * - * CAMERA_MODULE_API_VERSION_1_0: - * - * Not valid. Can be assumed to be CAMERA_DEVICE_API_VERSION_1_0. Do - * not read this field. - * - * CAMERA_MODULE_API_VERSION_2_0: - * - * Always valid - * - */ - uint32_t device_version; - - /** - * The camera's fixed characteristics, which include all camera metadata in - * the android.*.info.* sections. - * - * Version information (based on camera_module_t.common.module_api_version): - * - * CAMERA_MODULE_API_VERSION_1_0: - * - * Not valid. Extra characteristics are not available. Do not read this - * field. - * - * CAMERA_MODULE_API_VERSION_2_0: - * - * Valid if device_version >= CAMERA_DEVICE_API_VERSION_2_0. Do not read - * otherwise. - * - */ - camera_metadata_t *static_camera_characteristics; -}; - -typedef struct camera_module { - hw_module_t common; - int (*get_number_of_cameras)(void); - int (*get_camera_info)(int camera_id, struct camera_info *info); -} camera_module_t; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_CAMERA_COMMON_H */ diff --git a/external/android/include/16/hardware/libhardware/include/hardware/fb.h b/external/android/include/16/hardware/libhardware/include/hardware/fb.h deleted file mode 100644 index ba2f286..0000000 --- a/external/android/include/16/hardware/libhardware/include/hardware/fb.h +++ /dev/null @@ -1,164 +0,0 @@ -/* - * 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. - */ - - -#ifndef ANDROID_FB_INTERFACE_H -#define ANDROID_FB_INTERFACE_H - -#include -#include -#include - -#include - -#include - -__BEGIN_DECLS - -#define GRALLOC_HARDWARE_FB0 "fb0" - -/*****************************************************************************/ - - -/*****************************************************************************/ - -typedef struct framebuffer_device_t { - struct hw_device_t common; - - /* flags describing some attributes of the framebuffer */ - const uint32_t flags; - - /* dimensions of the framebuffer in pixels */ - const uint32_t width; - const uint32_t height; - - /* frambuffer stride in pixels */ - const int stride; - - /* framebuffer pixel format */ - const int format; - - /* resolution of the framebuffer's display panel in pixel per inch*/ - const float xdpi; - const float ydpi; - - /* framebuffer's display panel refresh rate in frames per second */ - const float fps; - - /* min swap interval supported by this framebuffer */ - const int minSwapInterval; - - /* max swap interval supported by this framebuffer */ - const int maxSwapInterval; - - int reserved[8]; - - /* - * requests a specific swap-interval (same definition than EGL) - * - * Returns 0 on success or -errno on error. - */ - int (*setSwapInterval)(struct framebuffer_device_t* window, - int interval); - - /* - * This hook is OPTIONAL. - * - * It is non NULL If the framebuffer driver supports "update-on-demand" - * and the given rectangle is the area of the screen that gets - * updated during (*post)(). - * - * This is useful on devices that are able to DMA only a portion of - * the screen to the display panel, upon demand -- as opposed to - * constantly refreshing the panel 60 times per second, for instance. - * - * Only the area defined by this rectangle is guaranteed to be valid, that - * is, the driver is not allowed to post anything outside of this - * rectangle. - * - * The rectangle evaluated during (*post)() and specifies which area - * of the buffer passed in (*post)() shall to be posted. - * - * return -EINVAL if width or height <=0, or if left or top < 0 - */ - int (*setUpdateRect)(struct framebuffer_device_t* window, - int left, int top, int width, int height); - - /* - * Post to the display (display it on the screen) - * The buffer must have been allocated with the - * GRALLOC_USAGE_HW_FB usage flag. - * buffer must be the same width and height as the display and must NOT - * be locked. - * - * The buffer is shown during the next VSYNC. - * - * If the same buffer is posted again (possibly after some other buffer), - * post() will block until the the first post is completed. - * - * Internally, post() is expected to lock the buffer so that a - * subsequent call to gralloc_module_t::(*lock)() with USAGE_RENDER or - * USAGE_*_WRITE will block until it is safe; that is typically once this - * buffer is shown and another buffer has been posted. - * - * Returns 0 on success or -errno on error. - */ - int (*post)(struct framebuffer_device_t* dev, buffer_handle_t buffer); - - - /* - * The (*compositionComplete)() method must be called after the - * compositor has finished issuing GL commands for client buffers. - */ - - int (*compositionComplete)(struct framebuffer_device_t* dev); - - /* - * This hook is OPTIONAL. - * - * If non NULL it will be caused by SurfaceFlinger on dumpsys - */ - void (*dump)(struct framebuffer_device_t* dev, char *buff, int buff_len); - - /* - * (*enableScreen)() is used to either blank (enable=0) or - * unblank (enable=1) the screen this framebuffer is attached to. - * - * Returns 0 on success or -errno on error. - */ - int (*enableScreen)(struct framebuffer_device_t* dev, int enable); - - void* reserved_proc[6]; - -} framebuffer_device_t; - - -/** convenience API for opening and closing a supported device */ - -static inline int framebuffer_open(const struct hw_module_t* module, - struct framebuffer_device_t** device) { - return module->methods->open(module, - GRALLOC_HARDWARE_FB0, (struct hw_device_t**)device); -} - -static inline int framebuffer_close(struct framebuffer_device_t* device) { - return device->common.close(&device->common); -} - - -__END_DECLS - -#endif // ANDROID_FB_INTERFACE_H diff --git a/external/android/include/16/hardware/libhardware/include/hardware/gps.h b/external/android/include/16/hardware/libhardware/include/hardware/gps.h deleted file mode 100644 index 69bfd50..0000000 --- a/external/android/include/16/hardware/libhardware/include/hardware/gps.h +++ /dev/null @@ -1,679 +0,0 @@ -/* - * Copyright (C) 2010 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_INCLUDE_HARDWARE_GPS_H -#define ANDROID_INCLUDE_HARDWARE_GPS_H - -#include -#include -#include -#include - -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define GPS_HARDWARE_MODULE_ID "gps" - - -/** Milliseconds since January 1, 1970 */ -typedef int64_t GpsUtcTime; - -/** Maximum number of SVs for gps_sv_status_callback(). */ -#define GPS_MAX_SVS 32 - -/** Requested operational mode for GPS operation. */ -typedef uint32_t GpsPositionMode; -// IMPORTANT: Note that the following values must match -// constants in GpsLocationProvider.java. -/** Mode for running GPS standalone (no assistance). */ -#define GPS_POSITION_MODE_STANDALONE 0 -/** AGPS MS-Based mode. */ -#define GPS_POSITION_MODE_MS_BASED 1 -/** AGPS MS-Assisted mode. */ -#define GPS_POSITION_MODE_MS_ASSISTED 2 - -/** Requested recurrence mode for GPS operation. */ -typedef uint32_t GpsPositionRecurrence; -// IMPORTANT: Note that the following values must match -// constants in GpsLocationProvider.java. -/** Receive GPS fixes on a recurring basis at a specified period. */ -#define GPS_POSITION_RECURRENCE_PERIODIC 0 -/** Request a single shot GPS fix. */ -#define GPS_POSITION_RECURRENCE_SINGLE 1 - -/** GPS status event values. */ -typedef uint16_t GpsStatusValue; -// IMPORTANT: Note that the following values must match -// constants in GpsLocationProvider.java. -/** GPS status unknown. */ -#define GPS_STATUS_NONE 0 -/** GPS has begun navigating. */ -#define GPS_STATUS_SESSION_BEGIN 1 -/** GPS has stopped navigating. */ -#define GPS_STATUS_SESSION_END 2 -/** GPS has powered on but is not navigating. */ -#define GPS_STATUS_ENGINE_ON 3 -/** GPS is powered off. */ -#define GPS_STATUS_ENGINE_OFF 4 - -/** Flags to indicate which values are valid in a GpsLocation. */ -typedef uint16_t GpsLocationFlags; -// IMPORTANT: Note that the following values must match -// constants in GpsLocationProvider.java. -/** GpsLocation has valid latitude and longitude. */ -#define GPS_LOCATION_HAS_LAT_LONG 0x0001 -/** GpsLocation has valid altitude. */ -#define GPS_LOCATION_HAS_ALTITUDE 0x0002 -/** GpsLocation has valid speed. */ -#define GPS_LOCATION_HAS_SPEED 0x0004 -/** GpsLocation has valid bearing. */ -#define GPS_LOCATION_HAS_BEARING 0x0008 -/** GpsLocation has valid accuracy. */ -#define GPS_LOCATION_HAS_ACCURACY 0x0010 - -/** Flags for the gps_set_capabilities callback. */ - -/** GPS HAL schedules fixes for GPS_POSITION_RECURRENCE_PERIODIC mode. - If this is not set, then the framework will use 1000ms for min_interval - and will start and call start() and stop() to schedule the GPS. - */ -#define GPS_CAPABILITY_SCHEDULING 0x0000001 -/** GPS supports MS-Based AGPS mode */ -#define GPS_CAPABILITY_MSB 0x0000002 -/** GPS supports MS-Assisted AGPS mode */ -#define GPS_CAPABILITY_MSA 0x0000004 -/** GPS supports single-shot fixes */ -#define GPS_CAPABILITY_SINGLE_SHOT 0x0000008 -/** GPS supports on demand time injection */ -#define GPS_CAPABILITY_ON_DEMAND_TIME 0x0000010 - -/** Flags used to specify which aiding data to delete - when calling delete_aiding_data(). */ -typedef uint16_t GpsAidingData; -// IMPORTANT: Note that the following values must match -// constants in GpsLocationProvider.java. -#define GPS_DELETE_EPHEMERIS 0x0001 -#define GPS_DELETE_ALMANAC 0x0002 -#define GPS_DELETE_POSITION 0x0004 -#define GPS_DELETE_TIME 0x0008 -#define GPS_DELETE_IONO 0x0010 -#define GPS_DELETE_UTC 0x0020 -#define GPS_DELETE_HEALTH 0x0040 -#define GPS_DELETE_SVDIR 0x0080 -#define GPS_DELETE_SVSTEER 0x0100 -#define GPS_DELETE_SADATA 0x0200 -#define GPS_DELETE_RTI 0x0400 -#define GPS_DELETE_CELLDB_INFO 0x8000 -#define GPS_DELETE_ALL 0xFFFF - -/** AGPS type */ -typedef uint16_t AGpsType; -#define AGPS_TYPE_SUPL 1 -#define AGPS_TYPE_C2K 2 - -typedef uint16_t AGpsSetIDType; -#define AGPS_SETID_TYPE_NONE 0 -#define AGPS_SETID_TYPE_IMSI 1 -#define AGPS_SETID_TYPE_MSISDN 2 - -/** - * String length constants - */ -#define GPS_NI_SHORT_STRING_MAXLEN 256 -#define GPS_NI_LONG_STRING_MAXLEN 2048 - -/** - * GpsNiType constants - */ -typedef uint32_t GpsNiType; -#define GPS_NI_TYPE_VOICE 1 -#define GPS_NI_TYPE_UMTS_SUPL 2 -#define GPS_NI_TYPE_UMTS_CTRL_PLANE 3 - -/** - * GpsNiNotifyFlags constants - */ -typedef uint32_t GpsNiNotifyFlags; -/** NI requires notification */ -#define GPS_NI_NEED_NOTIFY 0x0001 -/** NI requires verification */ -#define GPS_NI_NEED_VERIFY 0x0002 -/** NI requires privacy override, no notification/minimal trace */ -#define GPS_NI_PRIVACY_OVERRIDE 0x0004 - -/** - * GPS NI responses, used to define the response in - * NI structures - */ -typedef int GpsUserResponseType; -#define GPS_NI_RESPONSE_ACCEPT 1 -#define GPS_NI_RESPONSE_DENY 2 -#define GPS_NI_RESPONSE_NORESP 3 - -/** - * NI data encoding scheme - */ -typedef int GpsNiEncodingType; -#define GPS_ENC_NONE 0 -#define GPS_ENC_SUPL_GSM_DEFAULT 1 -#define GPS_ENC_SUPL_UTF8 2 -#define GPS_ENC_SUPL_UCS2 3 -#define GPS_ENC_UNKNOWN -1 - -/** AGPS status event values. */ -typedef uint16_t AGpsStatusValue; -/** GPS requests data connection for AGPS. */ -#define GPS_REQUEST_AGPS_DATA_CONN 1 -/** GPS releases the AGPS data connection. */ -#define GPS_RELEASE_AGPS_DATA_CONN 2 -/** AGPS data connection initiated */ -#define GPS_AGPS_DATA_CONNECTED 3 -/** AGPS data connection completed */ -#define GPS_AGPS_DATA_CONN_DONE 4 -/** AGPS data connection failed */ -#define GPS_AGPS_DATA_CONN_FAILED 5 - -#define AGPS_REF_LOCATION_TYPE_GSM_CELLID 1 -#define AGPS_REF_LOCATION_TYPE_UMTS_CELLID 2 -#define AGPS_REG_LOCATION_TYPE_MAC 3 - -/** Network types for update_network_state "type" parameter */ -#define AGPS_RIL_NETWORK_TYPE_MOBILE 0 -#define AGPS_RIL_NETWORK_TYPE_WIFI 1 -#define AGPS_RIL_NETWORK_TYPE_MOBILE_MMS 2 -#define AGPS_RIL_NETWORK_TYPE_MOBILE_SUPL 3 -#define AGPS_RIL_NETWORK_TTYPE_MOBILE_DUN 4 -#define AGPS_RIL_NETWORK_TTYPE_MOBILE_HIPRI 5 -#define AGPS_RIL_NETWORK_TTYPE_WIMAX 6 - -/** - * Name for the GPS XTRA interface. - */ -#define GPS_XTRA_INTERFACE "gps-xtra" - -/** - * Name for the GPS DEBUG interface. - */ -#define GPS_DEBUG_INTERFACE "gps-debug" - -/** - * Name for the AGPS interface. - */ -#define AGPS_INTERFACE "agps" - -/** - * Name for NI interface - */ -#define GPS_NI_INTERFACE "gps-ni" - -/** - * Name for the AGPS-RIL interface. - */ -#define AGPS_RIL_INTERFACE "agps_ril" - -/** Represents a location. */ -typedef struct { - /** set to sizeof(GpsLocation) */ - size_t size; - /** Contains GpsLocationFlags bits. */ - uint16_t flags; - /** Represents latitude in degrees. */ - double latitude; - /** Represents longitude in degrees. */ - double longitude; - /** Represents altitude in meters above the WGS 84 reference - * ellipsoid. */ - double altitude; - /** Represents speed in meters per second. */ - float speed; - /** Represents heading in degrees. */ - float bearing; - /** Represents expected accuracy in meters. */ - float accuracy; - /** Timestamp for the location fix. */ - GpsUtcTime timestamp; -} GpsLocation; - -/** Represents the status. */ -typedef struct { - /** set to sizeof(GpsStatus) */ - size_t size; - GpsStatusValue status; -} GpsStatus; - -/** Represents SV information. */ -typedef struct { - /** set to sizeof(GpsSvInfo) */ - size_t size; - /** Pseudo-random number for the SV. */ - int prn; - /** Signal to noise ratio. */ - float snr; - /** Elevation of SV in degrees. */ - float elevation; - /** Azimuth of SV in degrees. */ - float azimuth; -} GpsSvInfo; - -/** Represents SV status. */ -typedef struct { - /** set to sizeof(GpsSvStatus) */ - size_t size; - - /** Number of SVs currently visible. */ - int num_svs; - - /** Contains an array of SV information. */ - GpsSvInfo sv_list[GPS_MAX_SVS]; - - /** Represents a bit mask indicating which SVs - * have ephemeris data. - */ - uint32_t ephemeris_mask; - - /** Represents a bit mask indicating which SVs - * have almanac data. - */ - uint32_t almanac_mask; - - /** - * Represents a bit mask indicating which SVs - * were used for computing the most recent position fix. - */ - uint32_t used_in_fix_mask; -} GpsSvStatus; - -/* 2G and 3G */ -/* In 3G lac is discarded */ -typedef struct { - uint16_t type; - uint16_t mcc; - uint16_t mnc; - uint16_t lac; - uint32_t cid; -} AGpsRefLocationCellID; - -typedef struct { - uint8_t mac[6]; -} AGpsRefLocationMac; - -/** Represents ref locations */ -typedef struct { - uint16_t type; - union { - AGpsRefLocationCellID cellID; - AGpsRefLocationMac mac; - } u; -} AGpsRefLocation; - -/** Callback with location information. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* gps_location_callback)(GpsLocation* location); - -/** Callback with status information. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* gps_status_callback)(GpsStatus* status); - -/** Callback with SV status information. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* gps_sv_status_callback)(GpsSvStatus* sv_info); - -/** Callback for reporting NMEA sentences. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* gps_nmea_callback)(GpsUtcTime timestamp, const char* nmea, int length); - -/** Callback to inform framework of the GPS engine's capabilities. - * Capability parameter is a bit field of GPS_CAPABILITY_* flags. - */ -typedef void (* gps_set_capabilities)(uint32_t capabilities); - -/** Callback utility for acquiring the GPS wakelock. - * This can be used to prevent the CPU from suspending while handling GPS events. - */ -typedef void (* gps_acquire_wakelock)(); - -/** Callback utility for releasing the GPS wakelock. */ -typedef void (* gps_release_wakelock)(); - -/** Callback for requesting NTP time */ -typedef void (* gps_request_utc_time)(); - -/** Callback for creating a thread that can call into the Java framework code. - * This must be used to create any threads that report events up to the framework. - */ -typedef pthread_t (* gps_create_thread)(const char* name, void (*start)(void *), void* arg); - -/** GPS callback structure. */ -typedef struct { - /** set to sizeof(GpsCallbacks) */ - size_t size; - gps_location_callback location_cb; - gps_status_callback status_cb; - gps_sv_status_callback sv_status_cb; - gps_nmea_callback nmea_cb; - gps_set_capabilities set_capabilities_cb; - gps_acquire_wakelock acquire_wakelock_cb; - gps_release_wakelock release_wakelock_cb; - gps_create_thread create_thread_cb; - gps_request_utc_time request_utc_time_cb; -} GpsCallbacks; - - -/** Represents the standard GPS interface. */ -typedef struct { - /** set to sizeof(GpsInterface) */ - size_t size; - /** - * Opens the interface and provides the callback routines - * to the implemenation of this interface. - */ - int (*init)( GpsCallbacks* callbacks ); - - /** Starts navigating. */ - int (*start)( void ); - - /** Stops navigating. */ - int (*stop)( void ); - - /** Closes the interface. */ - void (*cleanup)( void ); - - /** Injects the current time. */ - int (*inject_time)(GpsUtcTime time, int64_t timeReference, - int uncertainty); - - /** Injects current location from another location provider - * (typically cell ID). - * latitude and longitude are measured in degrees - * expected accuracy is measured in meters - */ - int (*inject_location)(double latitude, double longitude, float accuracy); - - /** - * Specifies that the next call to start will not use the - * information defined in the flags. GPS_DELETE_ALL is passed for - * a cold start. - */ - void (*delete_aiding_data)(GpsAidingData flags); - - /** - * min_interval represents the time between fixes in milliseconds. - * preferred_accuracy represents the requested fix accuracy in meters. - * preferred_time represents the requested time to first fix in milliseconds. - */ - int (*set_position_mode)(GpsPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time); - - /** Get a pointer to extension information. */ - const void* (*get_extension)(const char* name); -} GpsInterface; - -/** Callback to request the client to download XTRA data. - * The client should download XTRA data and inject it by calling inject_xtra_data(). - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* gps_xtra_download_request)(); - -/** Callback structure for the XTRA interface. */ -typedef struct { - gps_xtra_download_request download_request_cb; - gps_create_thread create_thread_cb; -} GpsXtraCallbacks; - -/** Extended interface for XTRA support. */ -typedef struct { - /** set to sizeof(GpsXtraInterface) */ - size_t size; - /** - * Opens the XTRA interface and provides the callback routines - * to the implemenation of this interface. - */ - int (*init)( GpsXtraCallbacks* callbacks ); - /** Injects XTRA data into the GPS. */ - int (*inject_xtra_data)( char* data, int length ); -} GpsXtraInterface; - -/** Extended interface for DEBUG support. */ -typedef struct { - /** set to sizeof(GpsDebugInterface) */ - size_t size; - - /** - * This function should return any information that the native - * implementation wishes to include in a bugreport. - */ - size_t (*get_internal_state)(char* buffer, size_t bufferSize); -} GpsDebugInterface; - -/** Represents the status of AGPS. */ -typedef struct { - /** set to sizeof(AGpsStatus) */ - size_t size; - - AGpsType type; - AGpsStatusValue status; - uint32_t ipaddr; -} AGpsStatus; - -/** Callback with AGPS status information. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* agps_status_callback)(AGpsStatus* status); - -/** Callback structure for the AGPS interface. */ -typedef struct { - agps_status_callback status_cb; - gps_create_thread create_thread_cb; -} AGpsCallbacks; - - -/** Extended interface for AGPS support. */ -typedef struct { - /** set to sizeof(AGpsInterface) */ - size_t size; - - /** - * Opens the AGPS interface and provides the callback routines - * to the implemenation of this interface. - */ - void (*init)( AGpsCallbacks* callbacks ); - /** - * Notifies that a data connection is available and sets - * the name of the APN to be used for SUPL. - */ - int (*data_conn_open)( const char* apn ); - /** - * Notifies that the AGPS data connection has been closed. - */ - int (*data_conn_closed)(); - /** - * Notifies that a data connection is not available for AGPS. - */ - int (*data_conn_failed)(); - /** - * Sets the hostname and port for the AGPS server. - */ - int (*set_server)( AGpsType type, const char* hostname, int port ); -} AGpsInterface; - - -/** Represents an NI request */ -typedef struct { - /** set to sizeof(GpsNiNotification) */ - size_t size; - - /** - * An ID generated by HAL to associate NI notifications and UI - * responses - */ - int notification_id; - - /** - * An NI type used to distinguish different categories of NI - * events, such as GPS_NI_TYPE_VOICE, GPS_NI_TYPE_UMTS_SUPL, ... - */ - GpsNiType ni_type; - - /** - * Notification/verification options, combinations of GpsNiNotifyFlags constants - */ - GpsNiNotifyFlags notify_flags; - - /** - * Timeout period to wait for user response. - * Set to 0 for no time out limit. - */ - int timeout; - - /** - * Default response when time out. - */ - GpsUserResponseType default_response; - - /** - * Requestor ID - */ - char requestor_id[GPS_NI_SHORT_STRING_MAXLEN]; - - /** - * Notification message. It can also be used to store client_id in some cases - */ - char text[GPS_NI_LONG_STRING_MAXLEN]; - - /** - * Client name decoding scheme - */ - GpsNiEncodingType requestor_id_encoding; - - /** - * Client name decoding scheme - */ - GpsNiEncodingType text_encoding; - - /** - * A pointer to extra data. Format: - * key_1 = value_1 - * key_2 = value_2 - */ - char extras[GPS_NI_LONG_STRING_MAXLEN]; - -} GpsNiNotification; - -/** Callback with NI notification. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (*gps_ni_notify_callback)(GpsNiNotification *notification); - -/** GPS NI callback structure. */ -typedef struct -{ - /** - * Sends the notification request from HAL to GPSLocationProvider. - */ - gps_ni_notify_callback notify_cb; - gps_create_thread create_thread_cb; -} GpsNiCallbacks; - -/** - * Extended interface for Network-initiated (NI) support. - */ -typedef struct -{ - /** set to sizeof(GpsNiInterface) */ - size_t size; - - /** Registers the callbacks for HAL to use. */ - void (*init) (GpsNiCallbacks *callbacks); - - /** Sends a response to HAL. */ - void (*respond) (int notif_id, GpsUserResponseType user_response); -} GpsNiInterface; - -struct gps_device_t { - struct hw_device_t common; - - /** - * Set the provided lights to the provided values. - * - * Returns: 0 on succes, error code on failure. - */ - const GpsInterface* (*get_gps_interface)(struct gps_device_t* dev); -}; - -#define AGPS_RIL_REQUEST_SETID_IMSI (1<<0L) -#define AGPS_RIL_REQUEST_SETID_MSISDN (1<<1L) - -#define AGPS_RIL_REQUEST_REFLOC_CELLID (1<<0L) -#define AGPS_RIL_REQUEST_REFLOC_MAC (1<<1L) - -typedef void (*agps_ril_request_set_id)(uint32_t flags); -typedef void (*agps_ril_request_ref_loc)(uint32_t flags); - -typedef struct { - agps_ril_request_set_id request_setid; - agps_ril_request_ref_loc request_refloc; - gps_create_thread create_thread_cb; -} AGpsRilCallbacks; - -/** Extended interface for AGPS_RIL support. */ -typedef struct { - /** set to sizeof(AGpsRilInterface) */ - size_t size; - /** - * Opens the AGPS interface and provides the callback routines - * to the implemenation of this interface. - */ - void (*init)( AGpsRilCallbacks* callbacks ); - - /** - * Sets the reference location. - */ - void (*set_ref_location) (const AGpsRefLocation *agps_reflocation, size_t sz_struct); - /** - * Sets the set ID. - */ - void (*set_set_id) (AGpsSetIDType type, const char* setid); - - /** - * Send network initiated message. - */ - void (*ni_message) (uint8_t *msg, size_t len); - - /** - * Notify GPS of network status changes. - * These parameters match values in the android.net.NetworkInfo class. - */ - void (*update_network_state) (int connected, int type, int roaming, const char* extra_info); - - /** - * Notify GPS of network status changes. - * These parameters match values in the android.net.NetworkInfo class. - */ - void (*update_network_availability) (int avaiable, const char* apn); -} AGpsRilInterface; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_HARDWARE_GPS_H */ - diff --git a/external/android/include/16/hardware/libhardware/include/hardware/gralloc.h b/external/android/include/16/hardware/libhardware/include/hardware/gralloc.h deleted file mode 100644 index 2dbd1fa..0000000 --- a/external/android/include/16/hardware/libhardware/include/hardware/gralloc.h +++ /dev/null @@ -1,261 +0,0 @@ -/* - * 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. - */ - - -#ifndef ANDROID_GRALLOC_INTERFACE_H -#define ANDROID_GRALLOC_INTERFACE_H - -#include -#include - -#include -#include -#include - -#include - -#include -#include - -__BEGIN_DECLS - -#define GRALLOC_API_VERSION 1 - -/** - * The id of this module - */ -#define GRALLOC_HARDWARE_MODULE_ID "gralloc" - -/** - * Name of the graphics device to open - */ - -#define GRALLOC_HARDWARE_GPU0 "gpu0" - -enum { - /* buffer is never read in software */ - GRALLOC_USAGE_SW_READ_NEVER = 0x00000000, - /* buffer is rarely read in software */ - GRALLOC_USAGE_SW_READ_RARELY = 0x00000002, - /* buffer is often read in software */ - GRALLOC_USAGE_SW_READ_OFTEN = 0x00000003, - /* mask for the software read values */ - GRALLOC_USAGE_SW_READ_MASK = 0x0000000F, - - /* buffer is never written in software */ - GRALLOC_USAGE_SW_WRITE_NEVER = 0x00000000, - /* buffer is never written in software */ - GRALLOC_USAGE_SW_WRITE_RARELY = 0x00000020, - /* buffer is never written in software */ - GRALLOC_USAGE_SW_WRITE_OFTEN = 0x00000030, - /* mask for the software write values */ - GRALLOC_USAGE_SW_WRITE_MASK = 0x000000F0, - - /* buffer will be used as an OpenGL ES texture */ - GRALLOC_USAGE_HW_TEXTURE = 0x00000100, - /* buffer will be used as an OpenGL ES render target */ - GRALLOC_USAGE_HW_RENDER = 0x00000200, - /* buffer will be used by the 2D hardware blitter */ - GRALLOC_USAGE_HW_2D = 0x00000400, - /* buffer will be used by the HWComposer HAL module */ - GRALLOC_USAGE_HW_COMPOSER = 0x00000800, - /* buffer will be used with the framebuffer device */ - GRALLOC_USAGE_HW_FB = 0x00001000, - /* buffer will be used with the HW video encoder */ - GRALLOC_USAGE_HW_VIDEO_ENCODER = 0x00010000, - /* mask for the software usage bit-mask */ - GRALLOC_USAGE_HW_MASK = 0x00011F00, - - /* buffer should be displayed full-screen on an external display when - * possible - */ - GRALLOC_USAGE_EXTERNAL_DISP = 0x00002000, - - /* Must have a hardware-protected path to external display sink for - * this buffer. If a hardware-protected path is not available, then - * either don't composite only this buffer (preferred) to the - * external sink, or (less desirable) do not route the entire - * composition to the external sink. - */ - GRALLOC_USAGE_PROTECTED = 0x00004000, - - /* implementation-specific private usage flags */ - GRALLOC_USAGE_PRIVATE_0 = 0x10000000, - GRALLOC_USAGE_PRIVATE_1 = 0x20000000, - GRALLOC_USAGE_PRIVATE_2 = 0x40000000, - GRALLOC_USAGE_PRIVATE_3 = 0x80000000, - GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000, -}; - -/*****************************************************************************/ - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -typedef struct gralloc_module_t { - struct hw_module_t common; - - /* - * (*registerBuffer)() must be called before a buffer_handle_t that has not - * been created with (*alloc_device_t::alloc)() can be used. - * - * This is intended to be used with buffer_handle_t's that have been - * received in this process through IPC. - * - * This function checks that the handle is indeed a valid one and prepares - * it for use with (*lock)() and (*unlock)(). - * - * It is not necessary to call (*registerBuffer)() on a handle created - * with (*alloc_device_t::alloc)(). - * - * returns an error if this buffer_handle_t is not valid. - */ - int (*registerBuffer)(struct gralloc_module_t const* module, - buffer_handle_t handle); - - /* - * (*unregisterBuffer)() is called once this handle is no longer needed in - * this process. After this call, it is an error to call (*lock)(), - * (*unlock)(), or (*registerBuffer)(). - * - * This function doesn't close or free the handle itself; this is done - * by other means, usually through libcutils's native_handle_close() and - * native_handle_free(). - * - * It is an error to call (*unregisterBuffer)() on a buffer that wasn't - * explicitly registered first. - */ - int (*unregisterBuffer)(struct gralloc_module_t const* module, - buffer_handle_t handle); - - /* - * The (*lock)() method is called before a buffer is accessed for the - * specified usage. This call may block, for instance if the h/w needs - * to finish rendering or if CPU caches need to be synchronized. - * - * The caller promises to modify only pixels in the area specified - * by (l,t,w,h). - * - * The content of the buffer outside of the specified area is NOT modified - * by this call. - * - * If usage specifies GRALLOC_USAGE_SW_*, vaddr is filled with the address - * of the buffer in virtual memory. - * - * THREADING CONSIDERATIONS: - * - * It is legal for several different threads to lock a buffer from - * read access, none of the threads are blocked. - * - * However, locking a buffer simultaneously for write or read/write is - * undefined, but: - * - shall not result in termination of the process - * - shall not block the caller - * It is acceptable to return an error or to leave the buffer's content - * into an indeterminate state. - * - * If the buffer was created with a usage mask incompatible with the - * requested usage flags here, -EINVAL is returned. - * - */ - - int (*lock)(struct gralloc_module_t const* module, - buffer_handle_t handle, int usage, - int l, int t, int w, int h, - void** vaddr); - - - /* - * The (*unlock)() method must be called after all changes to the buffer - * are completed. - */ - - int (*unlock)(struct gralloc_module_t const* module, - buffer_handle_t handle); - - - /* reserved for future use */ - int (*perform)(struct gralloc_module_t const* module, - int operation, ... ); - - /* reserved for future use */ - void* reserved_proc[7]; -} gralloc_module_t; - -/*****************************************************************************/ - -/** - * Every device data structure must begin with hw_device_t - * followed by module specific public methods and attributes. - */ - -typedef struct alloc_device_t { - struct hw_device_t common; - - /* - * (*alloc)() Allocates a buffer in graphic memory with the requested - * parameters and returns a buffer_handle_t and the stride in pixels to - * allow the implementation to satisfy hardware constraints on the width - * of a pixmap (eg: it may have to be multiple of 8 pixels). - * The CALLER TAKES OWNERSHIP of the buffer_handle_t. - * - * Returns 0 on success or -errno on error. - */ - - int (*alloc)(struct alloc_device_t* dev, - int w, int h, int format, int usage, - buffer_handle_t* handle, int* stride); - - /* - * (*free)() Frees a previously allocated buffer. - * Behavior is undefined if the buffer is still mapped in any process, - * but shall not result in termination of the program or security breaches - * (allowing a process to get access to another process' buffers). - * THIS FUNCTION TAKES OWNERSHIP of the buffer_handle_t which becomes - * invalid after the call. - * - * Returns 0 on success or -errno on error. - */ - int (*free)(struct alloc_device_t* dev, - buffer_handle_t handle); - - /* This hook is OPTIONAL. - * - * If non NULL it will be caused by SurfaceFlinger on dumpsys - */ - void (*dump)(struct alloc_device_t *dev, char *buff, int buff_len); - - void* reserved_proc[7]; -} alloc_device_t; - - -/** convenience API for opening and closing a supported device */ - -static inline int gralloc_open(const struct hw_module_t* module, - struct alloc_device_t** device) { - return module->methods->open(module, - GRALLOC_HARDWARE_GPU0, (struct hw_device_t**)device); -} - -static inline int gralloc_close(struct alloc_device_t* device) { - return device->common.close(&device->common); -} - -__END_DECLS - -#endif // ANDROID_GRALLOC_INTERFACE_H diff --git a/external/android/include/16/hardware/libhardware/include/hardware/hardware.h b/external/android/include/16/hardware/libhardware/include/hardware/hardware.h deleted file mode 100644 index 78c4572..0000000 --- a/external/android/include/16/hardware/libhardware/include/hardware/hardware.h +++ /dev/null @@ -1,222 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_INCLUDE_HARDWARE_HARDWARE_H -#define ANDROID_INCLUDE_HARDWARE_HARDWARE_H - -#include -#include - -#include -#include - -__BEGIN_DECLS - -/* - * Value for the hw_module_t.tag field - */ - -#define MAKE_TAG_CONSTANT(A,B,C,D) (((A) << 24) | ((B) << 16) | ((C) << 8) | (D)) - -#define HARDWARE_MODULE_TAG MAKE_TAG_CONSTANT('H', 'W', 'M', 'T') -#define HARDWARE_DEVICE_TAG MAKE_TAG_CONSTANT('H', 'W', 'D', 'T') - -#define HARDWARE_MAKE_API_VERSION(maj,min) \ - ((((maj) & 0xff) << 8) | ((min) & 0xff)) - -/* - * The current HAL API version. - * - * All module implementations must set the hw_module_t.hal_api_version field - * to this value when declaring the module with HAL_MODULE_INFO_SYM. - * - * Note that previous implementations have always set this field to 0. - * Therefore, libhardware HAL API will always consider versions 0.0 and 1.0 - * to be 100% binary compatible. - * - */ -#define HARDWARE_HAL_API_VERSION HARDWARE_MAKE_API_VERSION(1, 0) - -/* - * Helper macros for module implementors. - * - * The derived modules should provide convenience macros for supported - * versions so that implementations can explicitly specify module/device - * versions at definition time. - * - * Use this macro to set the hw_module_t.module_api_version field. - */ -#define HARDWARE_MODULE_API_VERSION(maj,min) HARDWARE_MAKE_API_VERSION(maj,min) - -/* - * Use this macro to set the hw_device_t.version field - */ -#define HARDWARE_DEVICE_API_VERSION(maj,min) HARDWARE_MAKE_API_VERSION(maj,min) - -struct hw_module_t; -struct hw_module_methods_t; -struct hw_device_t; - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -typedef struct hw_module_t { - /** tag must be initialized to HARDWARE_MODULE_TAG */ - uint32_t tag; - - /** - * The API version of the implemented module. The module owner is - * responsible for updating the version when a module interface has - * changed. - * - * The derived modules such as gralloc and audio own and manage this field. - * The module user must interpret the version field to decide whether or - * not to inter-operate with the supplied module implementation. - * For example, SurfaceFlinger is responsible for making sure that - * it knows how to manage different versions of the gralloc-module API, - * and AudioFlinger must know how to do the same for audio-module API. - * - * The module API version should include a major and a minor component. - * For example, version 1.0 could be represented as 0x0100. This format - * implies that versions 0x0100-0x01ff are all API-compatible. - * - * In the future, libhardware will expose a hw_get_module_version() - * (or equivalent) function that will take minimum/maximum supported - * versions as arguments and would be able to reject modules with - * versions outside of the supplied range. - */ - uint16_t module_api_version; -#define version_major module_api_version - /** - * version_major/version_minor defines are supplied here for temporary - * source code compatibility. They will be removed in the next version. - * ALL clients must convert to the new version format. - */ - - /** - * The API version of the HAL module interface. This is meant to - * version the hw_module_t, hw_module_methods_t, and hw_device_t - * structures and definitions. - * - * The HAL interface owns this field. Module users/implementations - * must NOT rely on this value for version information. - * - * Presently, 0 is the only valid value. - */ - uint16_t hal_api_version; -#define version_minor hal_api_version - - /** Identifier of module */ - const char *id; - - /** Name of this module */ - const char *name; - - /** Author/owner/implementor of the module */ - const char *author; - - /** Modules methods */ - struct hw_module_methods_t* methods; - - /** module's dso */ - void* dso; - - /** padding to 128 bytes, reserved for future use */ - uint32_t reserved[32-7]; - -} hw_module_t; - -typedef struct hw_module_methods_t { - /** Open a specific device */ - int (*open)(const struct hw_module_t* module, const char* id, - struct hw_device_t** device); - -} hw_module_methods_t; - -/** - * Every device data structure must begin with hw_device_t - * followed by module specific public methods and attributes. - */ -typedef struct hw_device_t { - /** tag must be initialized to HARDWARE_DEVICE_TAG */ - uint32_t tag; - - /** - * Version of the module-specific device API. This value is used by - * the derived-module user to manage different device implementations. - * - * The module user is responsible for checking the module_api_version - * and device version fields to ensure that the user is capable of - * communicating with the specific module implementation. - * - * One module can support multiple devices with different versions. This - * can be useful when a device interface changes in an incompatible way - * but it is still necessary to support older implementations at the same - * time. One such example is the Camera 2.0 API. - * - * This field is interpreted by the module user and is ignored by the - * HAL interface itself. - */ - uint32_t version; - - /** reference to the module this device belongs to */ - struct hw_module_t* module; - - /** padding reserved for future use */ - uint32_t reserved[12]; - - /** Close this device */ - int (*close)(struct hw_device_t* device); - -} hw_device_t; - -/** - * Name of the hal_module_info - */ -#define HAL_MODULE_INFO_SYM HMI - -/** - * Name of the hal_module_info as a string - */ -#define HAL_MODULE_INFO_SYM_AS_STR "HMI" - -/** - * Get the module info associated with a module by id. - * - * @return: 0 == success, <0 == error and *module == NULL - */ -int hw_get_module(const char *id, const struct hw_module_t **module); - -/** - * Get the module info associated with a module instance by class 'class_id' - * and instance 'inst'. - * - * Some modules types necessitate multiple instances. For example audio supports - * multiple concurrent interfaces and thus 'audio' is the module class - * and 'primary' or 'a2dp' are module interfaces. This implies that the files - * providing these modules would be named audio.primary..so and - * audio.a2dp..so - * - * @return: 0 == success, <0 == error and *module == NULL - */ -int hw_get_module_by_class(const char *class_id, const char *inst, - const struct hw_module_t **module); - -__END_DECLS - -#endif /* ANDROID_INCLUDE_HARDWARE_HARDWARE_H */ diff --git a/external/android/include/16/hardware/libhardware/include/hardware/hwcomposer.h b/external/android/include/16/hardware/libhardware/include/hardware/hwcomposer.h deleted file mode 100644 index 98e665c..0000000 --- a/external/android/include/16/hardware/libhardware/include/hardware/hwcomposer.h +++ /dev/null @@ -1,380 +0,0 @@ -/* - * Copyright (C) 2010 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_INCLUDE_HARDWARE_HWCOMPOSER_H -#define ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_H - -#include -#include - -#include -#include -#include - -#include - -__BEGIN_DECLS - -/*****************************************************************************/ - -// for compatibility -#define HWC_MODULE_API_VERSION HWC_MODULE_API_VERSION_0_1 -#define HWC_DEVICE_API_VERSION HWC_DEVICE_API_VERSION_0_1 -#define HWC_API_VERSION HWC_DEVICE_API_VERSION - -/** - * The id of this module - */ -#define HWC_HARDWARE_MODULE_ID "hwcomposer" - -/** - * Name of the sensors device to open - */ -#define HWC_HARDWARE_COMPOSER "composer" - - -struct hwc_composer_device; - -/* - * availability: HWC_DEVICE_API_VERSION_0_3 - * - * struct hwc_methods cannot be embedded in other structures as - * sizeof(struct hwc_methods) cannot be relied upon. - * - */ -typedef struct hwc_methods { - - /************************************************************************* - * HWC_DEVICE_API_VERSION_0_3 - *************************************************************************/ - - /* - * eventControl(..., event, enabled) - * Enables or disables h/w composer events. - * - * eventControl can be called from any thread and takes effect - * immediately. - * - * Supported events are: - * HWC_EVENT_VSYNC - * - * returns -EINVAL if the "event" parameter is not one of the value above - * or if the "enabled" parameter is not 0 or 1. - */ - - int (*eventControl)( - struct hwc_composer_device* dev, int event, int enabled); - -} hwc_methods_t; - -typedef struct hwc_rect { - int left; - int top; - int right; - int bottom; -} hwc_rect_t; - -typedef struct hwc_region { - size_t numRects; - hwc_rect_t const* rects; -} hwc_region_t; - -typedef struct hwc_color { - uint8_t r; - uint8_t g; - uint8_t b; - uint8_t a; -} hwc_color_t; - -typedef struct hwc_layer { - /* - * initially set to HWC_FRAMEBUFFER or HWC_BACKGROUND. - * HWC_FRAMEBUFFER - * indicates the layer will be drawn into the framebuffer - * using OpenGL ES. - * The HWC can toggle this value to HWC_OVERLAY, to indicate - * it will handle the layer. - * - * HWC_BACKGROUND - * indicates this is a special "background" layer. The only valid - * field is backgroundColor. HWC_BACKGROUND can only be used with - * HWC_API_VERSION >= 0.2 - * The HWC can toggle this value to HWC_FRAMEBUFFER, to indicate - * it CANNOT handle the background color - * - */ - int32_t compositionType; - - /* see hwc_layer_t::hints above */ - uint32_t hints; - - /* see hwc_layer_t::flags above */ - uint32_t flags; - - union { - /* color of the background. hwc_color_t.a is ignored */ - hwc_color_t backgroundColor; - - struct { - /* handle of buffer to compose. This handle is guaranteed to have been - * allocated from gralloc using the GRALLOC_USAGE_HW_COMPOSER usage flag. If - * the layer's handle is unchanged across two consecutive prepare calls and - * the HWC_GEOMETRY_CHANGED flag is not set for the second call then the - * HWComposer implementation may assume that the contents of the buffer have - * not changed. */ - buffer_handle_t handle; - - /* transformation to apply to the buffer during composition */ - uint32_t transform; - - /* blending to apply during composition */ - int32_t blending; - - /* area of the source to consider, the origin is the top-left corner of - * the buffer */ - hwc_rect_t sourceCrop; - - /* where to composite the sourceCrop onto the display. The sourceCrop - * is scaled using linear filtering to the displayFrame. The origin is the - * top-left corner of the screen. - */ - hwc_rect_t displayFrame; - - /* visible region in screen space. The origin is the - * top-left corner of the screen. - * The visible region INCLUDES areas overlapped by a translucent layer. - */ - hwc_region_t visibleRegionScreen; - }; - }; -} hwc_layer_t; - - -/* - * hwc_layer_list_t::flags values - */ -enum { - /* - * HWC_GEOMETRY_CHANGED is set by SurfaceFlinger to indicate that the list - * passed to (*prepare)() has changed by more than just the buffer handles. - */ - HWC_GEOMETRY_CHANGED = 0x00000001, -}; - -/* - * List of layers. - * The handle members of hwLayers elements must be unique. - */ -typedef struct hwc_layer_list { - uint32_t flags; - size_t numHwLayers; - hwc_layer_t hwLayers[0]; -} hwc_layer_list_t; - -/* This represents a display, typically an EGLDisplay object */ -typedef void* hwc_display_t; - -/* This represents a surface, typically an EGLSurface object */ -typedef void* hwc_surface_t; - - -/* see hwc_composer_device::registerProcs() - * Any of the callbacks can be NULL, in which case the corresponding - * functionality is not supported. - */ -typedef struct hwc_procs { - /* - * (*invalidate)() triggers a screen refresh, in particular prepare and set - * will be called shortly after this call is made. Note that there is - * NO GUARANTEE that the screen refresh will happen after invalidate() - * returns (in particular, it could happen before). - * invalidate() is GUARANTEED TO NOT CALL BACK into the h/w composer HAL and - * it is safe to call invalidate() from any of hwc_composer_device - * hooks, unless noted otherwise. - */ - void (*invalidate)(struct hwc_procs* procs); - - /* - * (*vsync)() is called by the h/w composer HAL when a vsync event is - * received and HWC_EVENT_VSYNC is enabled (see: hwc_event_control). - * - * the "zero" parameter must always be 0. - * the "timestamp" parameter is the system monotonic clock timestamp in - * nanosecond of when the vsync event happened. - * - * vsync() is GUARANTEED TO NOT CALL BACK into the h/w composer HAL. - * - * It is expected that vsync() is called from a thread of at least - * HAL_PRIORITY_URGENT_DISPLAY with as little latency as possible, - * typically less than 0.5 ms. - * - * It is a (silent) error to have HWC_EVENT_VSYNC enabled when calling - * hwc_composer_device.set(..., 0, 0, 0) (screen off). The implementation - * can either stop or continue to process VSYNC events, but must not - * crash or cause other problems. - * - */ - void (*vsync)(struct hwc_procs* procs, int zero, int64_t timestamp); -} hwc_procs_t; - - -/*****************************************************************************/ - -typedef struct hwc_module { - struct hw_module_t common; -} hwc_module_t; - - -typedef struct hwc_composer_device { - struct hw_device_t common; - - /* - * (*prepare)() is called for each frame before composition and is used by - * SurfaceFlinger to determine what composition steps the HWC can handle. - * - * (*prepare)() can be called more than once, the last call prevails. - * - * The HWC responds by setting the compositionType field to either - * HWC_FRAMEBUFFER or HWC_OVERLAY. In the former case, the composition for - * this layer is handled by SurfaceFlinger with OpenGL ES, in the later - * case, the HWC will have to handle this layer's composition. - * - * (*prepare)() is called with HWC_GEOMETRY_CHANGED to indicate that the - * list's geometry has changed, that is, when more than just the buffer's - * handles have been updated. Typically this happens (but is not limited to) - * when a window is added, removed, resized or moved. - * - * a NULL list parameter or a numHwLayers of zero indicates that the - * entire composition will be handled by SurfaceFlinger with OpenGL ES. - * - * returns: 0 on success. An negative error code on error. If an error is - * returned, SurfaceFlinger will assume that none of the layer will be - * handled by the HWC. - */ - int (*prepare)(struct hwc_composer_device *dev, hwc_layer_list_t* list); - - - /* - * (*set)() is used in place of eglSwapBuffers(), and assumes the same - * functionality, except it also commits the work list atomically with - * the actual eglSwapBuffers(). - * - * The list parameter is guaranteed to be the same as the one returned - * from the last call to (*prepare)(). - * - * When this call returns the caller assumes that: - * - * - the display will be updated in the near future with the content - * of the work list, without artifacts during the transition from the - * previous frame. - * - * - all objects are available for immediate access or destruction, in - * particular, hwc_region_t::rects data and hwc_layer_t::layer's buffer. - * Note that this means that immediately accessing (potentially from a - * different process) a buffer used in this call will not result in - * screen corruption, the driver must apply proper synchronization or - * scheduling (eg: block the caller, such as gralloc_module_t::lock(), - * OpenGL ES, Camera, Codecs, etc..., or schedule the caller's work - * after the buffer is freed from the actual composition). - * - * a NULL list parameter or a numHwLayers of zero indicates that the - * entire composition has been handled by SurfaceFlinger with OpenGL ES. - * In this case, (*set)() behaves just like eglSwapBuffers(). - * - * dpy, sur, and list are set to NULL to indicate that the screen is - * turning off. This happens WITHOUT prepare() being called first. - * This is a good time to free h/w resources and/or power - * the relevant h/w blocks down. - * - * IMPORTANT NOTE: there is an implicit layer containing opaque black - * pixels behind all the layers in the list. - * It is the responsibility of the hwcomposer module to make - * sure black pixels are output (or blended from). - * - * returns: 0 on success. An negative error code on error: - * HWC_EGL_ERROR: eglGetError() will provide the proper error code - * Another code for non EGL errors. - * - */ - int (*set)(struct hwc_composer_device *dev, - hwc_display_t dpy, - hwc_surface_t sur, - hwc_layer_list_t* list); - /* - * This field is OPTIONAL and can be NULL. - * - * If non NULL it will be called by SurfaceFlinger on dumpsys - */ - void (*dump)(struct hwc_composer_device* dev, char *buff, int buff_len); - - /* - * This field is OPTIONAL and can be NULL. - * - * (*registerProcs)() registers a set of callbacks the h/w composer HAL - * can later use. It is FORBIDDEN to call any of the callbacks from - * within registerProcs(). registerProcs() must save the hwc_procs_t pointer - * which is needed when calling a registered callback. - * Each call to registerProcs replaces the previous set of callbacks. - * registerProcs is called with NULL to unregister all callbacks. - * - * Any of the callbacks can be NULL, in which case the corresponding - * functionality is not supported. - */ - void (*registerProcs)(struct hwc_composer_device* dev, - hwc_procs_t const* procs); - - /* - * This field is OPTIONAL and can be NULL. - * availability: HWC_DEVICE_API_VERSION_0_2 - * - * Used to retrieve information about the h/w composer - * - * Returns 0 on success or -errno on error. - */ - int (*query)(struct hwc_composer_device* dev, int what, int* value); - - /* - * Reserved for future use. Must be NULL. - */ - void* reserved_proc[4]; - - /* - * This field is OPTIONAL and can be NULL. - * availability: HWC_DEVICE_API_VERSION_0_3 - */ - hwc_methods_t const *methods; - -} hwc_composer_device_t; - - -/** convenience API for opening and closing a device */ - -static inline int hwc_open(const struct hw_module_t* module, - hwc_composer_device_t** device) { - return module->methods->open(module, - HWC_HARDWARE_COMPOSER, (struct hw_device_t**)device); -} - -static inline int hwc_close(hwc_composer_device_t* device) { - return device->common.close(&device->common); -} - - -/*****************************************************************************/ - -__END_DECLS - -#endif /* ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_H */ diff --git a/external/android/include/16/hardware/libhardware/include/hardware/hwcomposer_defs.h b/external/android/include/16/hardware/libhardware/include/hardware/hwcomposer_defs.h deleted file mode 100644 index 99465d3..0000000 --- a/external/android/include/16/hardware/libhardware/include/hardware/hwcomposer_defs.h +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (C) 2010 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_INCLUDE_HARDWARE_HWCOMPOSER_DEFS_H -#define ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_DEFS_H - -#include -#include - -#include -#include -#include - -__BEGIN_DECLS - -/*****************************************************************************/ - -#define HWC_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) - -#define HWC_DEVICE_API_VERSION_0_1 HARDWARE_DEVICE_API_VERSION(0, 1) -#define HWC_DEVICE_API_VERSION_0_2 HARDWARE_DEVICE_API_VERSION(0, 2) -#define HWC_DEVICE_API_VERSION_0_3 HARDWARE_DEVICE_API_VERSION(0, 3) - - -enum { - /* hwc_composer_device_t::set failed in EGL */ - HWC_EGL_ERROR = -1 -}; - -/* - * hwc_layer_t::hints values - * Hints are set by the HAL and read by SurfaceFlinger - */ -enum { - /* - * HWC can set the HWC_HINT_TRIPLE_BUFFER hint to indicate to SurfaceFlinger - * that it should triple buffer this layer. Typically HWC does this when - * the layer will be unavailable for use for an extended period of time, - * e.g. if the display will be fetching data directly from the layer and - * the layer can not be modified until after the next set(). - */ - HWC_HINT_TRIPLE_BUFFER = 0x00000001, - - /* - * HWC sets HWC_HINT_CLEAR_FB to tell SurfaceFlinger that it should clear the - * framebuffer with transparent pixels where this layer would be. - * SurfaceFlinger will only honor this flag when the layer has no blending - * - */ - HWC_HINT_CLEAR_FB = 0x00000002 -}; - -/* - * hwc_layer_t::flags values - * Flags are set by SurfaceFlinger and read by the HAL - */ -enum { - /* - * HWC_SKIP_LAYER is set by SurfaceFlnger to indicate that the HAL - * shall not consider this layer for composition as it will be handled - * by SurfaceFlinger (just as if compositionType was set to HWC_OVERLAY). - */ - HWC_SKIP_LAYER = 0x00000001, -}; - -/* - * hwc_layer_t::compositionType values - */ -enum { - /* this layer is to be drawn into the framebuffer by SurfaceFlinger */ - HWC_FRAMEBUFFER = 0, - - /* this layer will be handled in the HWC */ - HWC_OVERLAY = 1, - - /* this is the background layer. it's used to set the background color. - * there is only a single background layer */ - HWC_BACKGROUND = 2, -}; - -/* - * hwc_layer_t::blending values - */ -enum { - /* no blending */ - HWC_BLENDING_NONE = 0x0100, - - /* ONE / ONE_MINUS_SRC_ALPHA */ - HWC_BLENDING_PREMULT = 0x0105, - - /* SRC_ALPHA / ONE_MINUS_SRC_ALPHA */ - HWC_BLENDING_COVERAGE = 0x0405 -}; - -/* - * hwc_layer_t::transform values - */ -enum { - /* flip source image horizontally */ - HWC_TRANSFORM_FLIP_H = HAL_TRANSFORM_FLIP_H, - /* flip source image vertically */ - HWC_TRANSFORM_FLIP_V = HAL_TRANSFORM_FLIP_V, - /* rotate source image 90 degrees clock-wise */ - HWC_TRANSFORM_ROT_90 = HAL_TRANSFORM_ROT_90, - /* rotate source image 180 degrees */ - HWC_TRANSFORM_ROT_180 = HAL_TRANSFORM_ROT_180, - /* rotate source image 270 degrees clock-wise */ - HWC_TRANSFORM_ROT_270 = HAL_TRANSFORM_ROT_270, -}; - -/* attributes queriable with query() */ -enum { - /* - * availability: HWC_DEVICE_API_VERSION_0_2 - * must return 1 if the background layer is supported, 0 otherwise - */ - HWC_BACKGROUND_LAYER_SUPPORTED = 0, - - /* - * availability: HWC_DEVICE_API_VERSION_0_3 - * returns the vsync period in nanosecond - */ - HWC_VSYNC_PERIOD = 1, -}; - -/* Allowed events for hwc_methods::eventControl() */ -enum { - HWC_EVENT_VSYNC = 0 -}; - -/*****************************************************************************/ - -__END_DECLS - -#endif /* ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_DEFS_H */ diff --git a/external/android/include/16/hardware/libhardware/include/hardware/keymaster.h b/external/android/include/16/hardware/libhardware/include/hardware/keymaster.h deleted file mode 100644 index e0014c8..0000000 --- a/external/android/include/16/hardware/libhardware/include/hardware/keymaster.h +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright (C) 2011 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_HARDWARE_KEYMASTER_H -#define ANDROID_HARDWARE_KEYMASTER_H - -#include -#include -#include - -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define KEYSTORE_HARDWARE_MODULE_ID "keystore" - -#define KEYSTORE_KEYMASTER "keymaster" - -/** - * The API level of this version of the header. The allows the implementing - * module to recognize which API level of the client it is dealing with in - * the case of pre-compiled binary clients. - */ -#define KEYMASTER_API_VERSION 1 - -/** - * Flags for keymaster_device::flags - */ -enum { - /* - * Indicates this keymaster implementation does not have hardware that - * keeps private keys out of user space. - * - * This should not be implemented on anything other than the default - * implementation. - */ - KEYMASTER_SOFTWARE_ONLY = 0x00000001, -}; - -struct keystore_module { - hw_module_t common; -}; - -/** - * Asymmetric key pair types. - */ -typedef enum { - TYPE_RSA = 1, -} keymaster_keypair_t; - -/** - * Parameters needed to generate an RSA key. - */ -typedef struct { - uint32_t modulus_size; - uint64_t public_exponent; -} keymaster_rsa_keygen_params_t; - -/** - * Digest type used for RSA operations. - */ -typedef enum { - DIGEST_NONE, -} keymaster_rsa_digest_t; - -/** - * Type of padding used for RSA operations. - */ -typedef enum { - PADDING_NONE, -} keymaster_rsa_padding_t; - -typedef struct { - keymaster_rsa_digest_t digest_type; - keymaster_rsa_padding_t padding_type; -} keymaster_rsa_sign_params_t; - -/** - * The parameters that can be set for a given keymaster implementation. - */ -struct keymaster_device { - struct hw_device_t common; - - uint32_t client_version; - - /** - * See flags defined for keymaster_device::flags above. - */ - uint32_t flags; - - void* context; - - /** - * Generates a public and private key. The key-blob returned is opaque - * and must subsequently provided for signing and verification. - * - * Returns: 0 on success or an error code less than 0. - */ - int (*generate_keypair)(const struct keymaster_device* dev, - const keymaster_keypair_t key_type, const void* key_params, - uint8_t** key_blob, size_t* key_blob_length); - - /** - * Imports a public and private key pair. The imported keys will be in - * PKCS#8 format with DER encoding (Java standard). The key-blob - * returned is opaque and will be subsequently provided for signing - * and verification. - * - * Returns: 0 on success or an error code less than 0. - */ - int (*import_keypair)(const struct keymaster_device* dev, - const uint8_t* key, const size_t key_length, - uint8_t** key_blob, size_t* key_blob_length); - - /** - * Gets the public key part of a key pair. The public key must be in - * X.509 format (Java standard) encoded byte array. - * - * Returns: 0 on success or an error code less than 0. - * On error, x509_data should not be allocated. - */ - int (*get_keypair_public)(const struct keymaster_device* dev, - const uint8_t* key_blob, const size_t key_blob_length, - uint8_t** x509_data, size_t* x509_data_length); - - /** - * Deletes the key pair associated with the key blob. - * - * This function is optional and should be set to NULL if it is not - * implemented. - * - * Returns 0 on success or an error code less than 0. - */ - int (*delete_keypair)(const struct keymaster_device* dev, - const uint8_t* key_blob, const size_t key_blob_length); - - /** - * Deletes all keys in the hardware keystore. Used when keystore is - * reset completely. - * - * This function is optional and should be set to NULL if it is not - * implemented. - * - * Returns 0 on success or an error code less than 0. - */ - int (*delete_all)(const struct keymaster_device* dev); - - /** - * Signs data using a key-blob generated before. This can use either - * an asymmetric key or a secret key. - * - * Returns: 0 on success or an error code less than 0. - */ - int (*sign_data)(const struct keymaster_device* dev, - const void* signing_params, - const uint8_t* key_blob, const size_t key_blob_length, - const uint8_t* data, const size_t data_length, - uint8_t** signed_data, size_t* signed_data_length); - - /** - * Verifies data signed with a key-blob. This can use either - * an asymmetric key or a secret key. - * - * Returns: 0 on successful verification or an error code less than 0. - */ - int (*verify_data)(const struct keymaster_device* dev, - const void* signing_params, - const uint8_t* key_blob, const size_t key_blob_length, - const uint8_t* signed_data, const size_t signed_data_length, - const uint8_t* signature, const size_t signature_length); -}; -typedef struct keymaster_device keymaster_device_t; - - -/* Convenience API for opening and closing keymaster devices */ - -static inline int keymaster_open(const struct hw_module_t* module, - keymaster_device_t** device) -{ - int rc = module->methods->open(module, KEYSTORE_KEYMASTER, - (struct hw_device_t**) device); - - if (!rc) { - (*device)->client_version = KEYMASTER_API_VERSION; - } - - return rc; -} - -static inline int keymaster_close(keymaster_device_t* device) -{ - return device->common.close(&device->common); -} - -__END_DECLS - -#endif // ANDROID_HARDWARE_KEYMASTER_H - diff --git a/external/android/include/16/hardware/libhardware/include/hardware/lights.h b/external/android/include/16/hardware/libhardware/include/hardware/lights.h deleted file mode 100644 index 2cf5519..0000000 --- a/external/android/include/16/hardware/libhardware/include/hardware/lights.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_LIGHTS_INTERFACE_H -#define ANDROID_LIGHTS_INTERFACE_H - -#include -#include -#include - -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define LIGHTS_HARDWARE_MODULE_ID "lights" - -/* - * These light IDs correspond to logical lights, not physical. - * So for example, if your INDICATOR light is in line with your - * BUTTONS, it might make sense to also light the INDICATOR - * light to a reasonable color when the BUTTONS are lit. - */ -#define LIGHT_ID_BACKLIGHT "backlight" -#define LIGHT_ID_KEYBOARD "keyboard" -#define LIGHT_ID_BUTTONS "buttons" -#define LIGHT_ID_BATTERY "battery" -#define LIGHT_ID_NOTIFICATIONS "notifications" -#define LIGHT_ID_ATTENTION "attention" - -/* - * These lights aren't currently supported by the higher - * layers, but could be someday, so we have the constants - * here now. - */ -#define LIGHT_ID_BLUETOOTH "bluetooth" -#define LIGHT_ID_WIFI "wifi" - -/* ************************************************************************ - * Flash modes for the flashMode field of light_state_t. - */ - -#define LIGHT_FLASH_NONE 0 - -/** - * To flash the light at a given rate, set flashMode to LIGHT_FLASH_TIMED, - * and then flashOnMS should be set to the number of milliseconds to turn - * the light on, followed by the number of milliseconds to turn the light - * off. - */ -#define LIGHT_FLASH_TIMED 1 - -/** - * To flash the light using hardware assist, set flashMode to - * the hardware mode. - */ -#define LIGHT_FLASH_HARDWARE 2 - -/** - * Light brightness is managed by a user setting. - */ -#define BRIGHTNESS_MODE_USER 0 - -/** - * Light brightness is managed by a light sensor. - */ -#define BRIGHTNESS_MODE_SENSOR 1 - -/** - * The parameters that can be set for a given light. - * - * Not all lights must support all parameters. If you - * can do something backward-compatible, you should. - */ -struct light_state_t { - /** - * The color of the LED in ARGB. - * - * Do your best here. - * - If your light can only do red or green, if they ask for blue, - * you should do green. - * - If you can only do a brightness ramp, then use this formula: - * unsigned char brightness = ((77*((color>>16)&0x00ff)) - * + (150*((color>>8)&0x00ff)) + (29*(color&0x00ff))) >> 8; - * - If you can only do on or off, 0 is off, anything else is on. - * - * The high byte should be ignored. Callers will set it to 0xff (which - * would correspond to 255 alpha). - */ - unsigned int color; - - /** - * See the LIGHT_FLASH_* constants - */ - int flashMode; - int flashOnMS; - int flashOffMS; - - /** - * Policy used by the framework to manage the light's brightness. - * Currently the values are BRIGHTNESS_MODE_USER and BRIGHTNESS_MODE_SENSOR. - */ - int brightnessMode; -}; - -struct light_device_t { - struct hw_device_t common; - - /** - * Set the provided lights to the provided values. - * - * Returns: 0 on succes, error code on failure. - */ - int (*set_light)(struct light_device_t* dev, - struct light_state_t const* state); -}; - - -__END_DECLS - -#endif // ANDROID_LIGHTS_INTERFACE_H - diff --git a/external/android/include/16/hardware/libhardware/include/hardware/local_time_hal.h b/external/android/include/16/hardware/libhardware/include/hardware/local_time_hal.h deleted file mode 100644 index 6b6a317..0000000 --- a/external/android/include/16/hardware/libhardware/include/hardware/local_time_hal.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (C) 2011 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_LOCAL_TIME_HAL_INTERFACE_H -#define ANDROID_LOCAL_TIME_HAL_INTERFACE_H - -#include - -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define LOCAL_TIME_HARDWARE_MODULE_ID "local_time" - -/** - * Name of the local time devices to open - */ -#define LOCAL_TIME_HARDWARE_INTERFACE "local_time_hw_if" - -/**********************************************************************/ - -/** - * A structure used to collect low level sync data in a lab environment. Most - * HAL implementations will never need this structure. - */ -struct local_time_debug_event { - int64_t local_timesync_event_id; - int64_t local_time; -}; - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -struct local_time_module { - struct hw_module_t common; -}; - -struct local_time_hw_device { - struct hw_device_t common; - - /** - * - * Returns the current value of the system wide local time counter - */ - int64_t (*get_local_time)(struct local_time_hw_device* dev); - - /** - * - * Returns the nominal frequency (in hertz) of the system wide local time - * counter - */ - uint64_t (*get_local_freq)(struct local_time_hw_device* dev); - - /** - * - * Sets the HW slew rate of oscillator which drives the system wide local - * time counter. On success, platforms should return 0. Platforms which - * do not support HW slew should leave this method set to NULL. - * - * Valid values for rate range from MIN_INT16 to MAX_INT16. Platform - * implementations should attempt map this range linearly to the min/max - * slew rate of their hardware. - */ - int (*set_local_slew)(struct local_time_hw_device* dev, int16_t rate); - - /** - * - * A method used to collect low level sync data in a lab environments. - * Most HAL implementations will simply set this member to NULL, or return - * -EINVAL to indicate that this functionality is not supported. - * Production HALs should never support this method. - */ - int (*get_debug_log)(struct local_time_hw_device* dev, - struct local_time_debug_event* records, - int max_records); -}; - -typedef struct local_time_hw_device local_time_hw_device_t; - -/** convenience API for opening and closing a supported device */ - -static inline int local_time_hw_device_open( - const struct hw_module_t* module, - struct local_time_hw_device** device) -{ - return module->methods->open(module, LOCAL_TIME_HARDWARE_INTERFACE, - (struct hw_device_t**)device); -} - -static inline int local_time_hw_device_close(struct local_time_hw_device* device) -{ - return device->common.close(&device->common); -} - - -__END_DECLS - -#endif // ANDROID_LOCAL_TIME_INTERFACE_H diff --git a/external/android/include/16/hardware/libhardware/include/hardware/nfc.h b/external/android/include/16/hardware/libhardware/include/hardware/nfc.h deleted file mode 100644 index 74b3cfb..0000000 --- a/external/android/include/16/hardware/libhardware/include/hardware/nfc.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2011 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_NFC_HAL_INTERFACE_H -#define ANDROID_NFC_HAL_INTERFACE_H - -#include -#include -#include -#include - -#include - -__BEGIN_DECLS - -#define NFC_HARDWARE_MODULE_ID "nfc" - -/* - * Begin PN544 specific HAL - */ -#define NFC_PN544_CONTROLLER "pn544" - -typedef struct nfc_module_t { - struct hw_module_t common; -} nfc_module_t; - -/* - * PN544 linktypes. - * UART - * I2C - * USB (uses UART DAL) - */ -typedef enum { - PN544_LINK_TYPE_UART, - PN544_LINK_TYPE_I2C, - PN544_LINK_TYPE_USB, - PN544_LINK_TYPE_INVALID, -} nfc_pn544_linktype; - -typedef struct { - struct hw_device_t common; - - /* The number of EEPROM registers to write */ - uint32_t num_eeprom_settings; - - /* The actual EEPROM settings - * For PN544, each EEPROM setting is a 4-byte entry, - * of the format [0x00, addr_msb, addr_lsb, value]. - */ - uint8_t* eeprom_settings; - - /* The link type to which the PN544 is connected */ - nfc_pn544_linktype linktype; - - /* The device node to which the PN544 is connected */ - const char* device_node; - - /* On Crespo we had an I2C issue that would cause us to sometimes read - * the I2C slave address (0x57) over the bus. libnfc contains - * a hack to ignore this byte and try to read the length byte - * again. - * Set to 0 to disable the workaround, 1 to enable it. - */ - uint8_t enable_i2c_workaround; - /* I2C slave address. Multiple I2C addresses are - * possible for PN544 module. Configure address according to - * board design. - */ - uint8_t i2c_device_address; -} nfc_pn544_device_t; - -static inline int nfc_pn544_open(const struct hw_module_t* module, - nfc_pn544_device_t** dev) { - return module->methods->open(module, NFC_PN544_CONTROLLER, - (struct hw_device_t**) dev); -} - -static inline int nfc_pn544_close(nfc_pn544_device_t* dev) { - return dev->common.close(&dev->common); -} -/* - * End PN544 specific HAL - */ - -__END_DECLS - -#endif // ANDROID_NFC_HAL_INTERFACE_H diff --git a/external/android/include/16/hardware/libhardware/include/hardware/power.h b/external/android/include/16/hardware/libhardware/include/hardware/power.h deleted file mode 100644 index 6c55061..0000000 --- a/external/android/include/16/hardware/libhardware/include/hardware/power.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (C) 2012 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_INCLUDE_HARDWARE_POWER_H -#define ANDROID_INCLUDE_HARDWARE_POWER_H - -#include -#include -#include - -#include - -__BEGIN_DECLS - -#define POWER_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) -#define POWER_MODULE_API_VERSION_0_2 HARDWARE_MODULE_API_VERSION(0, 2) - - -/** - * The id of this module - */ -#define POWER_HARDWARE_MODULE_ID "power" - -/* - * Power hint identifiers passed to (*powerHint) - */ - -typedef enum { - POWER_HINT_VSYNC = 0x00000001, - POWER_HINT_INTERACTION = 0x00000002, -} power_hint_t; - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -typedef struct power_module { - struct hw_module_t common; - - /* - * (*init)() performs power management setup actions at runtime - * startup, such as to set default cpufreq parameters. This is - * called only by the Power HAL instance loaded by - * PowerManagerService. - */ - void (*init)(struct power_module *module); - - /* - * (*setInteractive)() performs power management actions upon the - * system entering interactive state (that is, the system is awake - * and ready for interaction, often with UI devices such as - * display and touchscreen enabled) or non-interactive state (the - * system appears asleep, display usually turned off). The - * non-interactive state is usually entered after a period of - * inactivity, in order to conserve battery power during - * such inactive periods. - * - * Typical actions are to turn on or off devices and adjust - * cpufreq parameters. This function may also call the - * appropriate interfaces to allow the kernel to suspend the - * system to low-power sleep state when entering non-interactive - * state, and to disallow low-power suspend when the system is in - * interactive state. When low-power suspend state is allowed, the - * kernel may suspend the system whenever no wakelocks are held. - * - * on is non-zero when the system is transitioning to an - * interactive / awake state, and zero when transitioning to a - * non-interactive / asleep state. - * - * This function is called to enter non-interactive state after - * turning off the screen (if present), and called to enter - * interactive state prior to turning on the screen. - */ - void (*setInteractive)(struct power_module *module, int on); - - /* - * (*powerHint) is called to pass hints on power requirements, which - * may result in adjustment of power/performance parameters of the - * cpufreq governor and other controls. The possible hints are: - * - * POWER_HINT_VSYNC - * - * Foreground app has started or stopped requesting a VSYNC pulse - * from SurfaceFlinger. If the app has started requesting VSYNC - * then CPU and GPU load is expected soon, and it may be appropriate - * to raise speeds of CPU, memory bus, etc. The data parameter is - * non-zero to indicate VSYNC pulse is now requested, or zero for - * VSYNC pulse no longer requested. - * - * POWER_HINT_INTERACTION - * - * User is interacting with the device, for example, touchscreen - * events are incoming. CPU and GPU load may be expected soon, - * and it may be appropriate to raise speeds of CPU, memory bus, - * etc. The data parameter is unused. - * - * A particular platform may choose to ignore any hint. - * - * availability: version 0.2 - * - */ - void (*powerHint)(struct power_module *module, power_hint_t hint, - void *data); -} power_module_t; - - -__END_DECLS - -#endif // ANDROID_INCLUDE_HARDWARE_POWER_H diff --git a/external/android/include/16/hardware/libhardware/include/hardware/qemu_pipe.h b/external/android/include/16/hardware/libhardware/include/hardware/qemu_pipe.h deleted file mode 100644 index 1a67022..0000000 --- a/external/android/include/16/hardware/libhardware/include/hardware/qemu_pipe.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011 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_INCLUDE_HARDWARE_QEMU_PIPE_H -#define ANDROID_INCLUDE_HARDWARE_QEMU_PIPE_H - -#include -#include -#include -#include -#include /* for pthread_once() */ -#include -#include -#include - -#ifndef D -# define D(...) do{}while(0) -#endif - -/* Try to open a new Qemu fast-pipe. This function returns a file descriptor - * that can be used to communicate with a named service managed by the - * emulator. - * - * This file descriptor can be used as a standard pipe/socket descriptor. - * - * 'pipeName' is the name of the emulator service you want to connect to. - * E.g. 'opengles' or 'camera'. - * - * On success, return a valid file descriptor - * Returns -1 on error, and errno gives the error code, e.g.: - * - * EINVAL -> unknown/unsupported pipeName - * ENOSYS -> fast pipes not available in this system. - * - * ENOSYS should never happen, except if you're trying to run within a - * misconfigured emulator. - * - * You should be able to open several pipes to the same pipe service, - * except for a few special cases (e.g. GSM modem), where EBUSY will be - * returned if more than one client tries to connect to it. - */ -static __inline__ int -qemu_pipe_open(const char* pipeName) -{ - char buff[256]; - int buffLen; - int fd, ret; - - if (pipeName == NULL || pipeName[0] == '\0') { - errno = EINVAL; - return -1; - } - - snprintf(buff, sizeof buff, "pipe:%s", pipeName); - - fd = open("/dev/qemu_pipe", O_RDWR); - if (fd < 0) { - D("%s: Could not open /dev/qemu_pipe: %s", __FUNCTION__, strerror(errno)); - //errno = ENOSYS; - return -1; - } - - buffLen = strlen(buff); - - ret = TEMP_FAILURE_RETRY(write(fd, buff, buffLen+1)); - if (ret != buffLen+1) { - D("%s: Could not connect to %s pipe service: %s", __FUNCTION__, pipeName, strerror(errno)); - if (ret == 0) { - errno = ECONNRESET; - } else if (ret > 0) { - errno = EINVAL; - } - return -1; - } - - return fd; -} - -#endif /* ANDROID_INCLUDE_HARDWARE_QEMUD_PIPE_H */ diff --git a/external/android/include/16/hardware/libhardware/include/hardware/qemud.h b/external/android/include/16/hardware/libhardware/include/hardware/qemud.h deleted file mode 100644 index 5c39f9c..0000000 --- a/external/android/include/16/hardware/libhardware/include/hardware/qemud.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_INCLUDE_HARDWARE_QEMUD_H -#define ANDROID_INCLUDE_HARDWARE_QEMUD_H - -#include -#include "qemu_pipe.h" - -/* the following is helper code that is used by the QEMU-specific - * hardware HAL modules to communicate with the emulator program - * through the 'qemud' multiplexing daemon, or through the qemud - * pipe. - * - * see the documentation comments for details in - * development/emulator/qemud/qemud.c - * - * all definitions here are built into the HAL module to avoid - * having to write a tiny shared library for this. - */ - -/* we expect the D macro to be defined to a function macro - * that sends its formatted string argument(s) to the log. - * If not, ignore the traces. - */ -#ifndef D -# define D(...) ((void)0) -#endif - -static __inline__ int -qemud_fd_write(int fd, const void* buff, int len) -{ - int len2; - do { - len2 = write(fd, buff, len); - } while (len2 < 0 && errno == EINTR); - return len2; -} - -static __inline__ int -qemud_fd_read(int fd, void* buff, int len) -{ - int len2; - do { - len2 = read(fd, buff, len); - } while (len2 < 0 && errno == EINTR); - return len2; -} - -static __inline__ int -qemud_channel_open(const char* name) -{ - int fd; - int namelen = strlen(name); - char answer[2]; - char pipe_name[256]; - - /* First, try to connect to the pipe. */ - snprintf(pipe_name, sizeof(pipe_name), "qemud:%s", name); - fd = qemu_pipe_open(pipe_name); - if (fd < 0) { - D("QEMUD pipe is not available for %s: %s", name, strerror(errno)); - /* If pipe is not available, connect to qemud control socket */ - fd = socket_local_client( "qemud", - ANDROID_SOCKET_NAMESPACE_RESERVED, - SOCK_STREAM ); - if (fd < 0) { - D("no qemud control socket: %s", strerror(errno)); - return -1; - } - - /* send service name to connect */ - if (qemud_fd_write(fd, name, namelen) != namelen) { - D("can't send service name to qemud: %s", - strerror(errno)); - close(fd); - return -1; - } - - /* read answer from daemon */ - if (qemud_fd_read(fd, answer, 2) != 2 || - answer[0] != 'O' || answer[1] != 'K') { - D("cant' connect to %s service through qemud", name); - close(fd); - return -1; - } - } - return fd; -} - -static __inline__ int -qemud_channel_send(int fd, const void* msg, int msglen) -{ - char header[5]; - - if (msglen < 0) - msglen = strlen((const char*)msg); - - if (msglen == 0) - return 0; - - snprintf(header, sizeof header, "%04x", msglen); - if (qemud_fd_write(fd, header, 4) != 4) { - D("can't write qemud frame header: %s", strerror(errno)); - return -1; - } - - if (qemud_fd_write(fd, msg, msglen) != msglen) { - D("can4t write qemud frame payload: %s", strerror(errno)); - return -1; - } - return 0; -} - -static __inline__ int -qemud_channel_recv(int fd, void* msg, int msgsize) -{ - char header[5]; - int size, avail; - - if (qemud_fd_read(fd, header, 4) != 4) { - D("can't read qemud frame header: %s", strerror(errno)); - return -1; - } - header[4] = 0; - if (sscanf(header, "%04x", &size) != 1) { - D("malformed qemud frame header: '%.*s'", 4, header); - return -1; - } - if (size > msgsize) - return -1; - - if (qemud_fd_read(fd, msg, size) != size) { - D("can't read qemud frame payload: %s", strerror(errno)); - return -1; - } - return size; -} - -#endif /* ANDROID_INCLUDE_HARDWARE_QEMUD_H */ diff --git a/external/android/include/16/hardware/libhardware/include/hardware/sensors.h b/external/android/include/16/hardware/libhardware/include/hardware/sensors.h deleted file mode 100644 index af6bced..0000000 --- a/external/android/include/16/hardware/libhardware/include/hardware/sensors.h +++ /dev/null @@ -1,485 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_SENSORS_INTERFACE_H -#define ANDROID_SENSORS_INTERFACE_H - -#include -#include -#include - -#include -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define SENSORS_HARDWARE_MODULE_ID "sensors" - -/** - * Name of the sensors device to open - */ -#define SENSORS_HARDWARE_POLL "poll" - -/** - * Handles must be higher than SENSORS_HANDLE_BASE and must be unique. - * A Handle identifies a given sensors. The handle is used to activate - * and/or deactivate sensors. - * In this version of the API there can only be 256 handles. - */ -#define SENSORS_HANDLE_BASE 0 -#define SENSORS_HANDLE_BITS 8 -#define SENSORS_HANDLE_COUNT (1<0 - * ^ - * | - * +-----------+--> y>0 - * | | - * | | - * | | - * | | / z<0 - * | | / - * | | / - * O-----------+/ - * |[] [ ] []/ - * +----------/+ y<0 - * / - * / - * |/ z>0 (toward the sky) - * - * O: Origin (x=0,y=0,z=0) - * - * - * SENSOR_TYPE_ORIENTATION - * ----------------------- - * - * All values are angles in degrees. - * - * Orientation sensors return sensor events for all 3 axes at a constant - * rate defined by setDelay(). - * - * azimuth: angle between the magnetic north direction and the Y axis, around - * the Z axis (0<=azimuth<360). - * 0=North, 90=East, 180=South, 270=West - * - * pitch: Rotation around X axis (-180<=pitch<=180), with positive values when - * the z-axis moves toward the y-axis. - * - * roll: Rotation around Y axis (-90<=roll<=90), with positive values when - * the x-axis moves towards the z-axis. - * - * Note: For historical reasons the roll angle is positive in the clockwise - * direction (mathematically speaking, it should be positive in the - * counter-clockwise direction): - * - * Z - * ^ - * (+roll) .--> | - * / | - * | | roll: rotation around Y axis - * X <-------(.) - * Y - * note that +Y == -roll - * - * - * - * Note: This definition is different from yaw, pitch and roll used in aviation - * where the X axis is along the long side of the plane (tail to nose). - * - * - * SENSOR_TYPE_ACCELEROMETER - * ------------------------- - * - * All values are in SI units (m/s^2) and measure the acceleration of the - * device minus the force of gravity. - * - * Acceleration sensors return sensor events for all 3 axes at a constant - * rate defined by setDelay(). - * - * x: Acceleration minus Gx on the x-axis - * y: Acceleration minus Gy on the y-axis - * z: Acceleration minus Gz on the z-axis - * - * Examples: - * When the device lies flat on a table and is pushed on its left side - * toward the right, the x acceleration value is positive. - * - * When the device lies flat on a table, the acceleration value is +9.81, - * which correspond to the acceleration of the device (0 m/s^2) minus the - * force of gravity (-9.81 m/s^2). - * - * When the device lies flat on a table and is pushed toward the sky, the - * acceleration value is greater than +9.81, which correspond to the - * acceleration of the device (+A m/s^2) minus the force of - * gravity (-9.81 m/s^2). - * - * - * SENSOR_TYPE_MAGNETIC_FIELD - * -------------------------- - * - * All values are in micro-Tesla (uT) and measure the ambient magnetic - * field in the X, Y and Z axis. - * - * Magnetic Field sensors return sensor events for all 3 axes at a constant - * rate defined by setDelay(). - * - * SENSOR_TYPE_GYROSCOPE - * --------------------- - * - * All values are in radians/second and measure the rate of rotation - * around the X, Y and Z axis. The coordinate system is the same as is - * used for the acceleration sensor. Rotation is positive in the - * counter-clockwise direction (right-hand rule). That is, an observer - * looking from some positive location on the x, y or z axis at a device - * positioned on the origin would report positive rotation if the device - * appeared to be rotating counter clockwise. Note that this is the - * standard mathematical definition of positive rotation and does not agree - * with the definition of roll given earlier. - * The range should at least be 17.45 rad/s (ie: ~1000 deg/s). - * - * SENSOR_TYPE_PROXIMITY - * ---------------------- - * - * The distance value is measured in centimeters. Note that some proximity - * sensors only support a binary "close" or "far" measurement. In this case, - * the sensor should report its maxRange value in the "far" state and a value - * less than maxRange in the "near" state. - * - * Proximity sensors report a value only when it changes and each time the - * sensor is enabled. - * - * SENSOR_TYPE_LIGHT - * ----------------- - * - * The light sensor value is returned in SI lux units. - * - * Light sensors report a value only when it changes and each time the - * sensor is enabled. - * - * SENSOR_TYPE_PRESSURE - * -------------------- - * - * The pressure sensor return the athmospheric pressure in hectopascal (hPa) - * - * Pressure sensors report events at a constant rate defined by setDelay(). - * - * SENSOR_TYPE_GRAVITY - * ------------------- - * - * A gravity output indicates the direction of and magnitude of gravity in - * the devices's coordinates. On Earth, the magnitude is 9.8 m/s^2. - * Units are m/s^2. The coordinate system is the same as is used for the - * acceleration sensor. When the device is at rest, the output of the - * gravity sensor should be identical to that of the accelerometer. - * - * SENSOR_TYPE_LINEAR_ACCELERATION - * -------------------------------- - * - * Indicates the linear acceleration of the device in device coordinates, - * not including gravity. - * This output is essentially Acceleration - Gravity. Units are m/s^2. - * The coordinate system is the same as is used for the acceleration sensor. - * - * - * SENSOR_TYPE_ROTATION_VECTOR - * --------------------------- - * - * A rotation vector represents the orientation of the device as a combination - * of an angle and an axis, in which the device has rotated through an angle - * theta around an axis . The three elements of the rotation vector - * are , such that the magnitude - * of the rotation vector is equal to sin(theta/2), and the direction of the - * rotation vector is equal to the direction of the axis of rotation. The three - * elements of the rotation vector are equal to the last three components of a - * unit quaternion . - * Elements of the rotation vector are unitless. The x, y, and z axis are defined - * in the same was as for the acceleration sensor. - * - * The reference coordinate system is defined as a direct orthonormal basis, - * where: - * - * - X is defined as the vector product Y.Z (It is tangential to - * the ground at the device's current location and roughly points East). - * - * - Y is tangential to the ground at the device's current location and - * points towards the magnetic North Pole. - * - * - Z points towards the sky and is perpendicular to the ground. - * - * - * The rotation-vector is stored as: - * - * sensors_event_t.data[0] = x*sin(theta/2) - * sensors_event_t.data[1] = y*sin(theta/2) - * sensors_event_t.data[2] = z*sin(theta/2) - * sensors_event_t.data[3] = cos(theta/2) - * - * - * SENSOR_TYPE_RELATIVE_HUMIDITY - * ------------------------------ - * - * A relative humidity sensor measures relative ambient air humidity and - * returns a value in percent. - * - * Relative humidity sensors report a value only when it changes and each - * time the sensor is enabled. - * - * - * SENSOR_TYPE_AMBIENT_TEMPERATURE - * ------------------------------- - * - * The ambient (room) temperature in degree Celsius. - * - * Temperature sensors report a value only when it changes and each time the - * sensor is enabled. - * - */ - -typedef struct { - union { - float v[3]; - struct { - float x; - float y; - float z; - }; - struct { - float azimuth; - float pitch; - float roll; - }; - }; - int8_t status; - uint8_t reserved[3]; -} sensors_vec_t; - -/** - * Union of the various types of sensor data - * that can be returned. - */ -typedef struct sensors_event_t { - /* must be sizeof(struct sensors_event_t) */ - int32_t version; - - /* sensor identifier */ - int32_t sensor; - - /* sensor type */ - int32_t type; - - /* reserved */ - int32_t reserved0; - - /* time is in nanosecond */ - int64_t timestamp; - - union { - float data[16]; - - /* acceleration values are in meter per second per second (m/s^2) */ - sensors_vec_t acceleration; - - /* magnetic vector values are in micro-Tesla (uT) */ - sensors_vec_t magnetic; - - /* orientation values are in degrees */ - sensors_vec_t orientation; - - /* gyroscope values are in rad/s */ - sensors_vec_t gyro; - - /* temperature is in degrees centigrade (Celsius) */ - float temperature; - - /* distance in centimeters */ - float distance; - - /* light in SI lux units */ - float light; - - /* pressure in hectopascal (hPa) */ - float pressure; - - /* relative humidity in percent */ - float relative_humidity; - }; - uint32_t reserved1[4]; -} sensors_event_t; - - - -struct sensor_t; - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -struct sensors_module_t { - struct hw_module_t common; - - /** - * Enumerate all available sensors. The list is returned in "list". - * @return number of sensors in the list - */ - int (*get_sensors_list)(struct sensors_module_t* module, - struct sensor_t const** list); -}; - -struct sensor_t { - /* name of this sensors */ - const char* name; - /* vendor of the hardware part */ - const char* vendor; - /* version of the hardware part + driver. The value of this field - * must increase when the driver is updated in a way that changes the - * output of this sensor. This is important for fused sensors when the - * fusion algorithm is updated. - */ - int version; - /* handle that identifies this sensors. This handle is used to activate - * and deactivate this sensor. The value of the handle must be 8 bits - * in this version of the API. - */ - int handle; - /* this sensor's type. */ - int type; - /* maximaum range of this sensor's value in SI units */ - float maxRange; - /* smallest difference between two values reported by this sensor */ - float resolution; - /* rough estimate of this sensor's power consumption in mA */ - float power; - /* minimum delay allowed between events in microseconds. A value of zero - * means that this sensor doesn't report events at a constant rate, but - * rather only when a new data is available */ - int32_t minDelay; - /* reserved fields, must be zero */ - void* reserved[8]; -}; - - -/** - * Every device data structure must begin with hw_device_t - * followed by module specific public methods and attributes. - */ -struct sensors_poll_device_t { - struct hw_device_t common; - - /** Activate/deactivate one sensor. - * - * @param handle is the handle of the sensor to change. - * @param enabled set to 1 to enable, or 0 to disable the sensor. - * - * @return 0 on success, negative errno code otherwise - */ - int (*activate)(struct sensors_poll_device_t *dev, - int handle, int enabled); - - /** - * Set the delay between sensor events in nanoseconds for a given sensor. - * - * If the requested value is less than sensor_t::minDelay, then it's - * silently clamped to sensor_t::minDelay unless sensor_t::minDelay is - * 0, in which case it is clamped to >= 1ms. - * - * @return 0 if successful, < 0 on error - */ - int (*setDelay)(struct sensors_poll_device_t *dev, - int handle, int64_t ns); - - /** - * Returns an array of sensor data. - * This function must block until events are available. - * - * @return the number of events read on success, or -errno in case of an error. - * This function should never return 0 (no event). - * - */ - int (*poll)(struct sensors_poll_device_t *dev, - sensors_event_t* data, int count); -}; - -/** convenience API for opening and closing a device */ - -static inline int sensors_open(const struct hw_module_t* module, - struct sensors_poll_device_t** device) { - return module->methods->open(module, - SENSORS_HARDWARE_POLL, (struct hw_device_t**)device); -} - -static inline int sensors_close(struct sensors_poll_device_t* device) { - return device->common.close(&device->common); -} - -__END_DECLS - -#endif // ANDROID_SENSORS_INTERFACE_H diff --git a/external/android/include/16/system/core/include/cutils/abort_socket.h b/external/android/include/16/system/core/include/cutils/abort_socket.h deleted file mode 100644 index fbb1112..0000000 --- a/external/android/include/16/system/core/include/cutils/abort_socket.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 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. - */ - -/* Helper to perform abortable blocking operations on a socket: - * asocket_connect() - * asocket_accept() - * asocket_read() - * asocket_write() - * These calls are similar to the regular syscalls, but can be aborted with: - * asocket_abort() - * - * Calling close() on a regular POSIX socket does not abort blocked syscalls on - * that socket in other threads. - * - * After calling asocket_abort() the socket cannot be reused. - * - * Call asocket_destory() *after* all threads have finished with the socket to - * finish closing the socket and free the asocket structure. - * - * The helper is implemented by setting the socket non-blocking to initiate - * syscalls connect(), accept(), read(), write(), then using a blocking poll() - * on both the primary socket and a local pipe. This makes the poll() abortable - * by writing a byte to the local pipe in asocket_abort(). - * - * asocket_create() sets the fd to non-blocking mode. It must not be changed to - * blocking mode. - * - * Using asocket will triple the number of file descriptors required per - * socket, due to the local pipe. It may be possible to use a global pipe per - * process rather than per socket, but we have not been able to come up with a - * race-free implementation yet. - * - * All functions except asocket_init() and asocket_destroy() are thread safe. - */ - -#include -#include - -#ifndef __CUTILS_ABORT_SOCKET_H__ -#define __CUTILS_ABORT_SOCKET_H__ -#ifdef __cplusplus -extern "C" { -#endif - -struct asocket { - int fd; /* primary socket fd */ - int abort_fd[2]; /* pipe used to abort */ -}; - -/* Create an asocket from fd. - * Sets the socket to non-blocking mode. - * Returns NULL on error with errno set. - */ -struct asocket *asocket_init(int fd); - -/* Blocking socket I/O with timeout. - * Calling asocket_abort() from another thread will cause each of these - * functions to immediately return with value -1 and errno ECANCELED. - * timeout is in ms, use -1 to indicate no timeout. On timeout -1 is returned - * with errno ETIMEDOUT. - * EINTR is handled in-call. - * Other semantics are identical to the regular syscalls. - */ -int asocket_connect(struct asocket *s, const struct sockaddr *addr, - socklen_t addrlen, int timeout); - -int asocket_accept(struct asocket *s, struct sockaddr *addr, - socklen_t *addrlen, int timeout); - -int asocket_read(struct asocket *s, void *buf, size_t count, int timeout); - -int asocket_write(struct asocket *s, const void *buf, size_t count, - int timeout); - -/* Abort above calls and shutdown socket. - * Further I/O operations on this socket will immediately fail after this call. - * asocket_destroy() should be used to release resources once all threads - * have returned from blocking calls on the socket. - */ -void asocket_abort(struct asocket *s); - -/* Close socket and free asocket structure. - * Must not be called until all calls on this structure have completed. - */ -void asocket_destroy(struct asocket *s); - -#ifdef __cplusplus -} -#endif -#endif //__CUTILS_ABORT_SOCKET__H__ diff --git a/external/android/include/16/system/core/include/cutils/android_reboot.h b/external/android/include/16/system/core/include/cutils/android_reboot.h deleted file mode 100644 index 0c79be7..0000000 --- a/external/android/include/16/system/core/include/cutils/android_reboot.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2011, 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 __CUTILS_ANDROID_REBOOT_H__ -#define __CUTILS_ANDROID_REBOOT_H__ - -__BEGIN_DECLS - -/* Commands */ -#define ANDROID_RB_RESTART 0xDEAD0001 -#define ANDROID_RB_POWEROFF 0xDEAD0002 -#define ANDROID_RB_RESTART2 0xDEAD0003 - -/* Flags */ -#define ANDROID_RB_FLAG_NO_SYNC 0x1 -#define ANDROID_RB_FLAG_NO_REMOUNT_RO 0x2 - -int android_reboot(int cmd, int flags, char *arg); - -__END_DECLS - -#endif /* __CUTILS_ANDROID_REBOOT_H__ */ diff --git a/external/android/include/16/system/core/include/cutils/array.h b/external/android/include/16/system/core/include/cutils/array.h deleted file mode 100644 index c97ff34..0000000 --- a/external/android/include/16/system/core/include/cutils/array.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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. - */ - -/** - * A pointer array which intelligently expands its capacity ad needed. - */ - -#ifndef __ARRAY_H -#define __ARRAY_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -/** An array. */ -typedef struct Array Array; - -/** Constructs a new array. Returns NULL if we ran out of memory. */ -Array* arrayCreate(); - -/** Frees an array. Does not free elements themselves. */ -void arrayFree(Array* array); - -/** Adds a pointer. Returns 0 is successful, < 0 otherwise. */ -int arrayAdd(Array* array, void* pointer); - -/** Gets the pointer at the specified index. */ -void* arrayGet(Array* array, int index); - -/** Removes the pointer at the given index and returns it. */ -void* arrayRemove(Array* array, int index); - -/** Sets pointer at the given index. Returns old pointer. */ -void* arraySet(Array* array, int index, void* pointer); - -/** Sets the array size. Sets new pointers to NULL. Returns 0 if successful, < 0 otherwise . */ -int arraySetSize(Array* array, int size); - -/** Returns the size of the given array. */ -int arraySize(Array* array); - -/** - * Returns a pointer to a C-style array which will be valid until this array - * changes. - */ -const void** arrayUnwrap(Array* array); - -#ifdef __cplusplus -} -#endif - -#endif /* __ARRAY_H */ diff --git a/external/android/include/16/system/core/include/cutils/ashmem.h b/external/android/include/16/system/core/include/cutils/ashmem.h deleted file mode 100644 index 25b233e..0000000 --- a/external/android/include/16/system/core/include/cutils/ashmem.h +++ /dev/null @@ -1,45 +0,0 @@ -/* cutils/ashmem.h - ** - ** Copyright 2008 The Android Open Source Project - ** - ** This file is dual licensed. It may be redistributed and/or modified - ** under the terms of the Apache 2.0 License OR version 2 of the GNU - ** General Public License. - */ - -#ifndef _CUTILS_ASHMEM_H -#define _CUTILS_ASHMEM_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -int ashmem_create_region(const char *name, size_t size); -int ashmem_set_prot_region(int fd, int prot); -int ashmem_pin_region(int fd, size_t offset, size_t len); -int ashmem_unpin_region(int fd, size_t offset, size_t len); -int ashmem_get_size_region(int fd); - -#ifdef __cplusplus -} -#endif - -#ifndef __ASHMEMIOC /* in case someone included too */ - -#define ASHMEM_NAME_LEN 256 - -#define ASHMEM_NAME_DEF "dev/ashmem" - -/* Return values from ASHMEM_PIN: Was the mapping purged while unpinned? */ -#define ASHMEM_NOT_PURGED 0 -#define ASHMEM_WAS_PURGED 1 - -/* Return values from ASHMEM_UNPIN: Is the mapping now pinned or unpinned? */ -#define ASHMEM_IS_UNPINNED 0 -#define ASHMEM_IS_PINNED 1 - -#endif /* ! __ASHMEMIOC */ - -#endif /* _CUTILS_ASHMEM_H */ diff --git a/external/android/include/16/system/core/include/cutils/atomic-arm.h b/external/android/include/16/system/core/include/cutils/atomic-arm.h deleted file mode 100644 index 16fe512..0000000 --- a/external/android/include/16/system/core/include/cutils/atomic-arm.h +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Copyright (C) 2010 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_CUTILS_ATOMIC_ARM_H -#define ANDROID_CUTILS_ATOMIC_ARM_H - -#include -#include - -extern inline void android_compiler_barrier(void) -{ - __asm__ __volatile__ ("" : : : "memory"); -} - -#if ANDROID_SMP == 0 -extern inline void android_memory_barrier(void) -{ - android_compiler_barrier(); -} -extern inline void android_memory_store_barrier(void) -{ - android_compiler_barrier(); -} -#elif defined(__ARM_HAVE_DMB) -extern inline void android_memory_barrier(void) -{ - __asm__ __volatile__ ("dmb" : : : "memory"); -} -extern inline void android_memory_store_barrier(void) -{ - __asm__ __volatile__ ("dmb st" : : : "memory"); -} -#elif defined(__ARM_HAVE_LDREX_STREX) -extern inline void android_memory_barrier(void) -{ - __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory"); -} -extern inline void android_memory_store_barrier(void) -{ - android_memory_barrier(); -} -#else -extern inline void android_memory_barrier(void) -{ - typedef void (kuser_memory_barrier)(void); - (*(kuser_memory_barrier *)0xffff0fa0)(); -} -extern inline void android_memory_store_barrier(void) -{ - android_memory_barrier(); -} -#endif - -extern inline int32_t android_atomic_acquire_load(volatile const int32_t *ptr) -{ - int32_t value = *ptr; - android_memory_barrier(); - return value; -} - -extern inline int32_t android_atomic_release_load(volatile const int32_t *ptr) -{ - android_memory_barrier(); - return *ptr; -} - -extern inline void android_atomic_acquire_store(int32_t value, - volatile int32_t *ptr) -{ - *ptr = value; - android_memory_barrier(); -} - -extern inline void android_atomic_release_store(int32_t value, - volatile int32_t *ptr) -{ - android_memory_barrier(); - *ptr = value; -} - -#if defined(__thumb__) -extern int android_atomic_cas(int32_t old_value, int32_t new_value, - volatile int32_t *ptr); -#elif defined(__ARM_HAVE_LDREX_STREX) -extern inline int android_atomic_cas(int32_t old_value, int32_t new_value, - volatile int32_t *ptr) -{ - int32_t prev, status; - do { - __asm__ __volatile__ ("ldrex %0, [%3]\n" - "mov %1, #0\n" - "teq %0, %4\n" - "strexeq %1, %5, [%3]" - : "=&r" (prev), "=&r" (status), "+m"(*ptr) - : "r" (ptr), "Ir" (old_value), "r" (new_value) - : "cc"); - } while (__builtin_expect(status != 0, 0)); - return prev != old_value; -} -#else -extern inline int android_atomic_cas(int32_t old_value, int32_t new_value, - volatile int32_t *ptr) -{ - typedef int (kuser_cmpxchg)(int32_t, int32_t, volatile int32_t *); - int32_t prev, status; - prev = *ptr; - do { - status = (*(kuser_cmpxchg *)0xffff0fc0)(old_value, new_value, ptr); - if (__builtin_expect(status == 0, 1)) - return 0; - prev = *ptr; - } while (prev == old_value); - return 1; -} -#endif - -extern inline int android_atomic_acquire_cas(int32_t old_value, - int32_t new_value, - volatile int32_t *ptr) -{ - int status = android_atomic_cas(old_value, new_value, ptr); - android_memory_barrier(); - return status; -} - -extern inline int android_atomic_release_cas(int32_t old_value, - int32_t new_value, - volatile int32_t *ptr) -{ - android_memory_barrier(); - return android_atomic_cas(old_value, new_value, ptr); -} - - -#if defined(__thumb__) -extern int32_t android_atomic_add(int32_t increment, - volatile int32_t *ptr); -#elif defined(__ARM_HAVE_LDREX_STREX) -extern inline int32_t android_atomic_add(int32_t increment, - volatile int32_t *ptr) -{ - int32_t prev, tmp, status; - android_memory_barrier(); - do { - __asm__ __volatile__ ("ldrex %0, [%4]\n" - "add %1, %0, %5\n" - "strex %2, %1, [%4]" - : "=&r" (prev), "=&r" (tmp), - "=&r" (status), "+m" (*ptr) - : "r" (ptr), "Ir" (increment) - : "cc"); - } while (__builtin_expect(status != 0, 0)); - return prev; -} -#else -extern inline int32_t android_atomic_add(int32_t increment, - volatile int32_t *ptr) -{ - int32_t prev, status; - android_memory_barrier(); - do { - prev = *ptr; - status = android_atomic_cas(prev, prev + increment, ptr); - } while (__builtin_expect(status != 0, 0)); - return prev; -} -#endif - -extern inline int32_t android_atomic_inc(volatile int32_t *addr) -{ - return android_atomic_add(1, addr); -} - -extern inline int32_t android_atomic_dec(volatile int32_t *addr) -{ - return android_atomic_add(-1, addr); -} - -#if defined(__thumb__) -extern int32_t android_atomic_and(int32_t value, volatile int32_t *ptr); -#elif defined(__ARM_HAVE_LDREX_STREX) -extern inline int32_t android_atomic_and(int32_t value, volatile int32_t *ptr) -{ - int32_t prev, tmp, status; - android_memory_barrier(); - do { - __asm__ __volatile__ ("ldrex %0, [%4]\n" - "and %1, %0, %5\n" - "strex %2, %1, [%4]" - : "=&r" (prev), "=&r" (tmp), - "=&r" (status), "+m" (*ptr) - : "r" (ptr), "Ir" (value) - : "cc"); - } while (__builtin_expect(status != 0, 0)); - return prev; -} -#else -extern inline int32_t android_atomic_and(int32_t value, volatile int32_t *ptr) -{ - int32_t prev, status; - android_memory_barrier(); - do { - prev = *ptr; - status = android_atomic_cas(prev, prev & value, ptr); - } while (__builtin_expect(status != 0, 0)); - return prev; -} -#endif - -#if defined(__thumb__) -extern int32_t android_atomic_or(int32_t value, volatile int32_t *ptr); -#elif defined(__ARM_HAVE_LDREX_STREX) -extern inline int32_t android_atomic_or(int32_t value, volatile int32_t *ptr) -{ - int32_t prev, tmp, status; - android_memory_barrier(); - do { - __asm__ __volatile__ ("ldrex %0, [%4]\n" - "orr %1, %0, %5\n" - "strex %2, %1, [%4]" - : "=&r" (prev), "=&r" (tmp), - "=&r" (status), "+m" (*ptr) - : "r" (ptr), "Ir" (value) - : "cc"); - } while (__builtin_expect(status != 0, 0)); - return prev; -} -#else -extern inline int32_t android_atomic_or(int32_t value, volatile int32_t *ptr) -{ - int32_t prev, status; - android_memory_barrier(); - do { - prev = *ptr; - status = android_atomic_cas(prev, prev | value, ptr); - } while (__builtin_expect(status != 0, 0)); - return prev; -} -#endif - -#endif /* ANDROID_CUTILS_ATOMIC_ARM_H */ diff --git a/external/android/include/16/system/core/include/cutils/atomic-inline.h b/external/android/include/16/system/core/include/cutils/atomic-inline.h deleted file mode 100644 index 49f3e70..0000000 --- a/external/android/include/16/system/core/include/cutils/atomic-inline.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2010 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_CUTILS_ATOMIC_INLINE_H -#define ANDROID_CUTILS_ATOMIC_INLINE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Inline declarations and macros for some special-purpose atomic - * operations. These are intended for rare circumstances where a - * memory barrier needs to be issued inline rather than as a function - * call. - * - * Most code should not use these. - * - * Anything that does include this file must set ANDROID_SMP to either - * 0 or 1, indicating compilation for UP or SMP, respectively. - * - * Macros defined in this header: - * - * void ANDROID_MEMBAR_FULL(void) - * Full memory barrier. Provides a compiler reordering barrier, and - * on SMP systems emits an appropriate instruction. - */ - -#if !defined(ANDROID_SMP) -# error "Must define ANDROID_SMP before including atomic-inline.h" -#endif - -#if defined(__arm__) -#include -#elif defined(__i386__) || defined(__x86_64__) -#include -#elif defined(__sh__) -/* implementation is in atomic-android-sh.c */ -#else -#error atomic operations are unsupported -#endif - -#if ANDROID_SMP == 0 -#define ANDROID_MEMBAR_FULL android_compiler_barrier -#else -#define ANDROID_MEMBAR_FULL android_memory_barrier -#endif - -#if ANDROID_SMP == 0 -#define ANDROID_MEMBAR_STORE android_compiler_barrier -#else -#define ANDROID_MEMBAR_STORE android_memory_store_barrier -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* ANDROID_CUTILS_ATOMIC_INLINE_H */ diff --git a/external/android/include/16/system/core/include/cutils/atomic-x86.h b/external/android/include/16/system/core/include/cutils/atomic-x86.h deleted file mode 100644 index 438012e..0000000 --- a/external/android/include/16/system/core/include/cutils/atomic-x86.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (C) 2010 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_CUTILS_ATOMIC_X86_H -#define ANDROID_CUTILS_ATOMIC_X86_H - -#include - -extern inline void android_compiler_barrier(void) -{ - __asm__ __volatile__ ("" : : : "memory"); -} - -#if ANDROID_SMP == 0 -extern inline void android_memory_barrier(void) -{ - android_compiler_barrier(); -} -extern inline void android_memory_store_barrier(void) -{ - android_compiler_barrier(); -} -#else -extern inline void android_memory_barrier(void) -{ - __asm__ __volatile__ ("mfence" : : : "memory"); -} -extern inline void android_memory_store_barrier(void) -{ - android_compiler_barrier(); -} -#endif - -extern inline int32_t android_atomic_acquire_load(volatile const int32_t *ptr) -{ - int32_t value = *ptr; - android_compiler_barrier(); - return value; -} - -extern inline int32_t android_atomic_release_load(volatile const int32_t *ptr) -{ - android_memory_barrier(); - return *ptr; -} - -extern inline void android_atomic_acquire_store(int32_t value, - volatile int32_t *ptr) -{ - *ptr = value; - android_memory_barrier(); -} - -extern inline void android_atomic_release_store(int32_t value, - volatile int32_t *ptr) -{ - android_compiler_barrier(); - *ptr = value; -} - -extern inline int android_atomic_cas(int32_t old_value, int32_t new_value, - volatile int32_t *ptr) -{ - int32_t prev; - __asm__ __volatile__ ("lock; cmpxchgl %1, %2" - : "=a" (prev) - : "q" (new_value), "m" (*ptr), "0" (old_value) - : "memory"); - return prev != old_value; -} - -extern inline int android_atomic_acquire_cas(int32_t old_value, - int32_t new_value, - volatile int32_t *ptr) -{ - /* Loads are not reordered with other loads. */ - return android_atomic_cas(old_value, new_value, ptr); -} - -extern inline int android_atomic_release_cas(int32_t old_value, - int32_t new_value, - volatile int32_t *ptr) -{ - /* Stores are not reordered with other stores. */ - return android_atomic_cas(old_value, new_value, ptr); -} - -extern inline int32_t android_atomic_add(int32_t increment, - volatile int32_t *ptr) -{ - __asm__ __volatile__ ("lock; xaddl %0, %1" - : "+r" (increment), "+m" (*ptr) - : : "memory"); - /* increment now holds the old value of *ptr */ - return increment; -} - -extern inline int32_t android_atomic_inc(volatile int32_t *addr) -{ - return android_atomic_add(1, addr); -} - -extern inline int32_t android_atomic_dec(volatile int32_t *addr) -{ - return android_atomic_add(-1, addr); -} - -extern inline int32_t android_atomic_and(int32_t value, - volatile int32_t *ptr) -{ - int32_t prev, status; - do { - prev = *ptr; - status = android_atomic_cas(prev, prev & value, ptr); - } while (__builtin_expect(status != 0, 0)); - return prev; -} - -extern inline int32_t android_atomic_or(int32_t value, volatile int32_t *ptr) -{ - int32_t prev, status; - do { - prev = *ptr; - status = android_atomic_cas(prev, prev | value, ptr); - } while (__builtin_expect(status != 0, 0)); - return prev; -} - -#endif /* ANDROID_CUTILS_ATOMIC_X86_H */ diff --git a/external/android/include/16/system/core/include/cutils/atomic.h b/external/android/include/16/system/core/include/cutils/atomic.h deleted file mode 100644 index ae42eb8..0000000 --- a/external/android/include/16/system/core/include/cutils/atomic.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * 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_CUTILS_ATOMIC_H -#define ANDROID_CUTILS_ATOMIC_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * A handful of basic atomic operations. The appropriate pthread - * functions should be used instead of these whenever possible. - * - * The "acquire" and "release" terms can be defined intuitively in terms - * of the placement of memory barriers in a simple lock implementation: - * - wait until compare-and-swap(lock-is-free --> lock-is-held) succeeds - * - barrier - * - [do work] - * - barrier - * - store(lock-is-free) - * In very crude terms, the initial (acquire) barrier prevents any of the - * "work" from happening before the lock is held, and the later (release) - * barrier ensures that all of the work happens before the lock is released. - * (Think of cached writes, cache read-ahead, and instruction reordering - * around the CAS and store instructions.) - * - * The barriers must apply to both the compiler and the CPU. Note it is - * legal for instructions that occur before an "acquire" barrier to be - * moved down below it, and for instructions that occur after a "release" - * barrier to be moved up above it. - * - * The ARM-driven implementation we use here is short on subtlety, - * and actually requests a full barrier from the compiler and the CPU. - * The only difference between acquire and release is in whether they - * are issued before or after the atomic operation with which they - * are associated. To ease the transition to C/C++ atomic intrinsics, - * you should not rely on this, and instead assume that only the minimal - * acquire/release protection is provided. - * - * NOTE: all int32_t* values are expected to be aligned on 32-bit boundaries. - * If they are not, atomicity is not guaranteed. - */ - -/* - * Basic arithmetic and bitwise operations. These all provide a - * barrier with "release" ordering, and return the previous value. - * - * These have the same characteristics (e.g. what happens on overflow) - * as the equivalent non-atomic C operations. - */ -int32_t android_atomic_inc(volatile int32_t* addr); -int32_t android_atomic_dec(volatile int32_t* addr); -int32_t android_atomic_add(int32_t value, volatile int32_t* addr); -int32_t android_atomic_and(int32_t value, volatile int32_t* addr); -int32_t android_atomic_or(int32_t value, volatile int32_t* addr); - -/* - * Perform an atomic load with "acquire" or "release" ordering. - * - * This is only necessary if you need the memory barrier. A 32-bit read - * from a 32-bit aligned address is atomic on all supported platforms. - */ -int32_t android_atomic_acquire_load(volatile const int32_t* addr); -int32_t android_atomic_release_load(volatile const int32_t* addr); - -/* - * Perform an atomic store with "acquire" or "release" ordering. - * - * This is only necessary if you need the memory barrier. A 32-bit write - * to a 32-bit aligned address is atomic on all supported platforms. - */ -void android_atomic_acquire_store(int32_t value, volatile int32_t* addr); -void android_atomic_release_store(int32_t value, volatile int32_t* addr); - -/* - * Compare-and-set operation with "acquire" or "release" ordering. - * - * This returns zero if the new value was successfully stored, which will - * only happen when *addr == oldvalue. - * - * (The return value is inverted from implementations on other platforms, - * but matches the ARM ldrex/strex result.) - * - * Implementations that use the release CAS in a loop may be less efficient - * than possible, because we re-issue the memory barrier on each iteration. - */ -int android_atomic_acquire_cas(int32_t oldvalue, int32_t newvalue, - volatile int32_t* addr); -int android_atomic_release_cas(int32_t oldvalue, int32_t newvalue, - volatile int32_t* addr); - -/* - * Aliases for code using an older version of this header. These are now - * deprecated and should not be used. The definitions will be removed - * in a future release. - */ -#define android_atomic_write android_atomic_release_store -#define android_atomic_cmpxchg android_atomic_release_cas - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // ANDROID_CUTILS_ATOMIC_H diff --git a/external/android/include/16/system/core/include/cutils/bitops.h b/external/android/include/16/system/core/include/cutils/bitops.h deleted file mode 100644 index 1b3b762..0000000 --- a/external/android/include/16/system/core/include/cutils/bitops.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2011 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 __CUTILS_BITOPS_H -#define __CUTILS_BITOPS_H - -#include - -__BEGIN_DECLS - -static inline int popcount(unsigned int x) -{ - return __builtin_popcount(x); -} - -static inline int popcountl(unsigned long x) -{ - return __builtin_popcountl(x); -} - -static inline int popcountll(unsigned long long x) -{ - return __builtin_popcountll(x); -} - -__END_DECLS - -#endif /* __CUTILS_BITOPS_H */ diff --git a/external/android/include/16/system/core/include/cutils/compiler.h b/external/android/include/16/system/core/include/cutils/compiler.h deleted file mode 100644 index 70f884a..0000000 --- a/external/android/include/16/system/core/include/cutils/compiler.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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_CUTILS_COMPILER_H -#define ANDROID_CUTILS_COMPILER_H - -/* - * helps the compiler's optimizer predicting branches - */ - -#ifdef __cplusplus -# define CC_LIKELY( exp ) (__builtin_expect( !!(exp), true )) -# define CC_UNLIKELY( exp ) (__builtin_expect( !!(exp), false )) -#else -# define CC_LIKELY( exp ) (__builtin_expect( !!(exp), 1 )) -# define CC_UNLIKELY( exp ) (__builtin_expect( !!(exp), 0 )) -#endif - -/** - * exports marked symbols - * - * if used on a C++ class declaration, this macro must be inserted - * after the "class" keyword. For instance: - * - * template - * class ANDROID_API Singleton { } - */ - -#define ANDROID_API __attribute__((visibility("default"))) - -#endif // ANDROID_CUTILS_COMPILER_H diff --git a/external/android/include/16/system/core/include/cutils/config_utils.h b/external/android/include/16/system/core/include/cutils/config_utils.h deleted file mode 100644 index 2dea6f1..0000000 --- a/external/android/include/16/system/core/include/cutils/config_utils.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2006 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 __CUTILS_CONFIG_UTILS_H -#define __CUTILS_CONFIG_UTILS_H - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct cnode cnode; - - -struct cnode -{ - cnode *next; - cnode *first_child; - cnode *last_child; - const char *name; - const char *value; -}; - -/* parse a text string into a config node tree */ -void config_load(cnode *root, char *data); - -/* parse a file into a config node tree */ -void config_load_file(cnode *root, const char *fn); - -/* create a single config node */ -cnode* config_node(const char *name, const char *value); - -/* locate a named child of a config node */ -cnode* config_find(cnode *root, const char *name); - -/* look up a child by name and return the boolean value */ -int config_bool(cnode *root, const char *name, int _default); - -/* look up a child by name and return the string value */ -const char* config_str(cnode *root, const char *name, const char *_default); - -/* add a named child to a config node (or modify it if it already exists) */ -void config_set(cnode *root, const char *name, const char *value); - -/* free a config node tree */ -void config_free(cnode *root); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/external/android/include/16/system/core/include/cutils/cpu_info.h b/external/android/include/16/system/core/include/cutils/cpu_info.h deleted file mode 100644 index 78c1884..0000000 --- a/external/android/include/16/system/core/include/cutils/cpu_info.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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 __CUTILS_CPU_INFO_H -#define __CUTILS_CPU_INFO_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* returns a string contiaining an ASCII representation of the CPU serial number, -** or NULL if cpu info not available. -** The string is a static variable, so don't call free() on it. -*/ -extern const char* get_cpu_serial_number(void); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_CPU_INFO_H */ diff --git a/external/android/include/16/system/core/include/cutils/debugger.h b/external/android/include/16/system/core/include/cutils/debugger.h deleted file mode 100644 index 5a8e796..0000000 --- a/external/android/include/16/system/core/include/cutils/debugger.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2012 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 __CUTILS_DEBUGGER_H -#define __CUTILS_DEBUGGER_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define DEBUGGER_SOCKET_NAME "android:debuggerd" - -typedef enum { - // dump a crash - DEBUGGER_ACTION_CRASH, - // dump a tombstone file - DEBUGGER_ACTION_DUMP_TOMBSTONE, - // dump a backtrace only back to the socket - DEBUGGER_ACTION_DUMP_BACKTRACE, -} debugger_action_t; - -/* message sent over the socket */ -typedef struct { - debugger_action_t action; - pid_t tid; -} debugger_msg_t; - -/* Dumps a process backtrace, registers, and stack to a tombstone file (requires root). - * Stores the tombstone path in the provided buffer. - * Returns 0 on success, -1 on error. - */ -int dump_tombstone(pid_t tid, char* pathbuf, size_t pathlen); - -/* Dumps a process backtrace only to the specified file (requires root). - * Returns 0 on success, -1 on error. - */ -int dump_backtrace_to_file(pid_t tid, int fd); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_DEBUGGER_H */ diff --git a/external/android/include/16/system/core/include/cutils/dir_hash.h b/external/android/include/16/system/core/include/cutils/dir_hash.h deleted file mode 100644 index fbb4d02..0000000 --- a/external/android/include/16/system/core/include/cutils/dir_hash.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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. - */ - -typedef enum { - SHA_1, -} HashAlgorithm; - -int get_file_hash(HashAlgorithm algorithm, const char *path, - char *output_string, size_t max_output_string); - -int get_recursive_hash_manifest(HashAlgorithm algorithm, - const char *directory_path, - char **output_string); diff --git a/external/android/include/16/system/core/include/cutils/event_tag_map.h b/external/android/include/16/system/core/include/cutils/event_tag_map.h deleted file mode 100644 index 1653c61..0000000 --- a/external/android/include/16/system/core/include/cutils/event_tag_map.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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 _LIBS_CUTILS_EVENTTAGMAP_H -#define _LIBS_CUTILS_EVENTTAGMAP_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define EVENT_TAG_MAP_FILE "/system/etc/event-log-tags" - -struct EventTagMap; -typedef struct EventTagMap EventTagMap; - -/* - * Open the specified file as an event log tag map. - * - * Returns NULL on failure. - */ -EventTagMap* android_openEventTagMap(const char* fileName); - -/* - * Close the map. - */ -void android_closeEventTagMap(EventTagMap* map); - -/* - * Look up a tag by index. Returns the tag string, or NULL if not found. - */ -const char* android_lookupEventTag(const EventTagMap* map, int tag); - -#ifdef __cplusplus -} -#endif - -#endif /*_LIBS_CUTILS_EVENTTAGMAP_H*/ diff --git a/external/android/include/16/system/core/include/cutils/hashmap.h b/external/android/include/16/system/core/include/cutils/hashmap.h deleted file mode 100644 index 5cb344c..0000000 --- a/external/android/include/16/system/core/include/cutils/hashmap.h +++ /dev/null @@ -1,150 +0,0 @@ -/* - * 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. - */ - -/** - * Hash map. - */ - -#ifndef __HASHMAP_H -#define __HASHMAP_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** A hash map. */ -typedef struct Hashmap Hashmap; - -/** - * Creates a new hash map. Returns NULL if memory allocation fails. - * - * @param initialCapacity number of expected entries - * @param hash function which hashes keys - * @param equals function which compares keys for equality - */ -Hashmap* hashmapCreate(size_t initialCapacity, - int (*hash)(void* key), bool (*equals)(void* keyA, void* keyB)); - -/** - * Frees the hash map. Does not free the keys or values themselves. - */ -void hashmapFree(Hashmap* map); - -/** - * Hashes the memory pointed to by key with the given size. Useful for - * implementing hash functions. - */ -int hashmapHash(void* key, size_t keySize); - -/** - * Puts value for the given key in the map. Returns pre-existing value if - * any. - * - * If memory allocation fails, this function returns NULL, the map's size - * does not increase, and errno is set to ENOMEM. - */ -void* hashmapPut(Hashmap* map, void* key, void* value); - -/** - * Gets a value from the map. Returns NULL if no entry for the given key is - * found or if the value itself is NULL. - */ -void* hashmapGet(Hashmap* map, void* key); - -/** - * Returns true if the map contains an entry for the given key. - */ -bool hashmapContainsKey(Hashmap* map, void* key); - -/** - * Gets the value for a key. If a value is not found, this function gets a - * value and creates an entry using the given callback. - * - * If memory allocation fails, the callback is not called, this function - * returns NULL, and errno is set to ENOMEM. - */ -void* hashmapMemoize(Hashmap* map, void* key, - void* (*initialValue)(void* key, void* context), void* context); - -/** - * Removes an entry from the map. Returns the removed value or NULL if no - * entry was present. - */ -void* hashmapRemove(Hashmap* map, void* key); - -/** - * Gets the number of entries in this map. - */ -size_t hashmapSize(Hashmap* map); - -/** - * Invokes the given callback on each entry in the map. Stops iterating if - * the callback returns false. - */ -void hashmapForEach(Hashmap* map, - bool (*callback)(void* key, void* value, void* context), - void* context); - -/** - * Concurrency support. - */ - -/** - * Locks the hash map so only the current thread can access it. - */ -void hashmapLock(Hashmap* map); - -/** - * Unlocks the hash map so other threads can access it. - */ -void hashmapUnlock(Hashmap* map); - -/** - * Key utilities. - */ - -/** - * Hashes int keys. 'key' is a pointer to int. - */ -int hashmapIntHash(void* key); - -/** - * Compares two int keys for equality. - */ -bool hashmapIntEquals(void* keyA, void* keyB); - -/** - * For debugging. - */ - -/** - * Gets current capacity. - */ -size_t hashmapCurrentCapacity(Hashmap* map); - -/** - * Counts the number of entry collisions. - */ -size_t hashmapCountCollisions(Hashmap* map); - -#ifdef __cplusplus -} -#endif - -#endif /* __HASHMAP_H */ diff --git a/external/android/include/16/system/core/include/cutils/iosched_policy.h b/external/android/include/16/system/core/include/cutils/iosched_policy.h deleted file mode 100644 index 07c5d1f..0000000 --- a/external/android/include/16/system/core/include/cutils/iosched_policy.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 __CUTILS_IOSCHED_POLICY_H -#define __CUTILS_IOSCHED_POLICY_H - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - IoSchedClass_NONE, - IoSchedClass_RT, - IoSchedClass_BE, - IoSchedClass_IDLE, -} IoSchedClass; - -extern int android_set_ioprio(int pid, IoSchedClass clazz, int ioprio); -extern int android_get_ioprio(int pid, IoSchedClass *clazz, int *ioprio); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_IOSCHED_POLICY_H */ diff --git a/external/android/include/16/system/core/include/cutils/jstring.h b/external/android/include/16/system/core/include/cutils/jstring.h deleted file mode 100644 index ee0018f..0000000 --- a/external/android/include/16/system/core/include/cutils/jstring.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2006 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 __CUTILS_STRING16_H -#define __CUTILS_STRING16_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef uint16_t char16_t; - -extern char * strndup16to8 (const char16_t* s, size_t n); -extern size_t strnlen16to8 (const char16_t* s, size_t n); -extern char * strncpy16to8 (char *dest, const char16_t*s, size_t n); - -extern char16_t * strdup8to16 (const char* s, size_t *out_len); -extern size_t strlen8to16 (const char* utf8Str); -extern char16_t * strcpy8to16 (char16_t *dest, const char*s, size_t *out_len); -extern char16_t * strcpylen8to16 (char16_t *dest, const char*s, int length, - size_t *out_len); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_STRING16_H */ diff --git a/external/android/include/16/system/core/include/cutils/klog.h b/external/android/include/16/system/core/include/cutils/klog.h deleted file mode 100644 index 1335543..0000000 --- a/external/android/include/16/system/core/include/cutils/klog.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2010 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 _CUTILS_KLOG_H_ -#define _CUTILS_KLOG_H_ - -void klog_init(void); -void klog_set_level(int level); -void klog_close(void); -void klog_write(int level, const char *fmt, ...) - __attribute__ ((format(printf, 2, 3))); - -#define KLOG_ERROR(tag,x...) klog_write(3, "<3>" tag ": " x) -#define KLOG_WARNING(tag,x...) klog_write(4, "<4>" tag ": " x) -#define KLOG_NOTICE(tag,x...) klog_write(5, "<5>" tag ": " x) -#define KLOG_INFO(tag,x...) klog_write(6, "<6>" tag ": " x) -#define KLOG_DEBUG(tag,x...) klog_write(7, "<7>" tag ": " x) - -#define KLOG_DEFAULT_LEVEL 3 /* messages <= this level are logged */ - -#endif diff --git a/external/android/include/16/system/core/include/cutils/list.h b/external/android/include/16/system/core/include/cutils/list.h deleted file mode 100644 index 3881fc9..0000000 --- a/external/android/include/16/system/core/include/cutils/list.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2010 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 _CUTILS_LIST_H_ -#define _CUTILS_LIST_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -struct listnode -{ - struct listnode *next; - struct listnode *prev; -}; - -#define node_to_item(node, container, member) \ - (container *) (((char*) (node)) - offsetof(container, member)) - -#define list_declare(name) \ - struct listnode name = { \ - .next = &name, \ - .prev = &name, \ - } - -#define list_for_each(node, list) \ - for (node = (list)->next; node != (list); node = node->next) - -#define list_for_each_reverse(node, list) \ - for (node = (list)->prev; node != (list); node = node->prev) - -void list_init(struct listnode *list); -void list_add_tail(struct listnode *list, struct listnode *item); -void list_remove(struct listnode *item); - -#define list_empty(list) ((list) == (list)->next) -#define list_head(list) ((list)->next) -#define list_tail(list) ((list)->prev) - -#ifdef __cplusplus -}; -#endif /* __cplusplus */ - -#endif diff --git a/external/android/include/16/system/core/include/cutils/log.h b/external/android/include/16/system/core/include/cutils/log.h deleted file mode 100644 index 878952e..0000000 --- a/external/android/include/16/system/core/include/cutils/log.h +++ /dev/null @@ -1,482 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// C/C++ logging functions. See the logging documentation for API details. -// -// We'd like these to be available from C code (in case we import some from -// somewhere), so this has a C interface. -// -// The output will be correct when the log file is shared between multiple -// threads and/or multiple processes so long as the operating system -// supports O_APPEND. These calls have mutex-protected data structures -// and so are NOT reentrant. Do not use LOG in a signal handler. -// -#ifndef _LIBS_CUTILS_LOG_H -#define _LIBS_CUTILS_LOG_H - -#include -#include -#include -#include -#ifdef HAVE_PTHREADS -#include -#endif -#include - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// --------------------------------------------------------------------- - -/* - * Normally we strip ALOGV (VERBOSE messages) from release builds. - * You can modify this (for example with "#define LOG_NDEBUG 0" - * at the top of your source file) to change that behavior. - */ -#ifndef LOG_NDEBUG -#ifdef NDEBUG -#define LOG_NDEBUG 1 -#else -#define LOG_NDEBUG 0 -#endif -#endif - -/* - * This is the local tag used for the following simplified - * logging macros. You can change this preprocessor definition - * before using the other macros to change the tag. - */ -#ifndef LOG_TAG -#define LOG_TAG NULL -#endif - -// --------------------------------------------------------------------- - -/* - * Simplified macro to send a verbose log message using the current LOG_TAG. - */ -#ifndef ALOGV -#if LOG_NDEBUG -#define ALOGV(...) ((void)0) -#else -#define ALOGV(...) ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) -#endif -#endif - -#define CONDITION(cond) (__builtin_expect((cond)!=0, 0)) - -#ifndef ALOGV_IF -#if LOG_NDEBUG -#define ALOGV_IF(cond, ...) ((void)0) -#else -#define ALOGV_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif -#endif - -/* - * Simplified macro to send a debug log message using the current LOG_TAG. - */ -#ifndef ALOGD -#define ALOGD(...) ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef ALOGD_IF -#define ALOGD_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send an info log message using the current LOG_TAG. - */ -#ifndef ALOGI -#define ALOGI(...) ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef ALOGI_IF -#define ALOGI_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send a warning log message using the current LOG_TAG. - */ -#ifndef ALOGW -#define ALOGW(...) ((void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef ALOGW_IF -#define ALOGW_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send an error log message using the current LOG_TAG. - */ -#ifndef ALOGE -#define ALOGE(...) ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef ALOGE_IF -#define ALOGE_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -// --------------------------------------------------------------------- - -/* - * Conditional based on whether the current LOG_TAG is enabled at - * verbose priority. - */ -#ifndef IF_ALOGV -#if LOG_NDEBUG -#define IF_ALOGV() if (false) -#else -#define IF_ALOGV() IF_ALOG(LOG_VERBOSE, LOG_TAG) -#endif -#endif - -/* - * Conditional based on whether the current LOG_TAG is enabled at - * debug priority. - */ -#ifndef IF_ALOGD -#define IF_ALOGD() IF_ALOG(LOG_DEBUG, LOG_TAG) -#endif - -/* - * Conditional based on whether the current LOG_TAG is enabled at - * info priority. - */ -#ifndef IF_ALOGI -#define IF_ALOGI() IF_ALOG(LOG_INFO, LOG_TAG) -#endif - -/* - * Conditional based on whether the current LOG_TAG is enabled at - * warn priority. - */ -#ifndef IF_ALOGW -#define IF_ALOGW() IF_ALOG(LOG_WARN, LOG_TAG) -#endif - -/* - * Conditional based on whether the current LOG_TAG is enabled at - * error priority. - */ -#ifndef IF_ALOGE -#define IF_ALOGE() IF_ALOG(LOG_ERROR, LOG_TAG) -#endif - - -// --------------------------------------------------------------------- - -/* - * Simplified macro to send a verbose system log message using the current LOG_TAG. - */ -#ifndef SLOGV -#if LOG_NDEBUG -#define SLOGV(...) ((void)0) -#else -#define SLOGV(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) -#endif -#endif - -#define CONDITION(cond) (__builtin_expect((cond)!=0, 0)) - -#ifndef SLOGV_IF -#if LOG_NDEBUG -#define SLOGV_IF(cond, ...) ((void)0) -#else -#define SLOGV_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif -#endif - -/* - * Simplified macro to send a debug system log message using the current LOG_TAG. - */ -#ifndef SLOGD -#define SLOGD(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef SLOGD_IF -#define SLOGD_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send an info system log message using the current LOG_TAG. - */ -#ifndef SLOGI -#define SLOGI(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef SLOGI_IF -#define SLOGI_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send a warning system log message using the current LOG_TAG. - */ -#ifndef SLOGW -#define SLOGW(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef SLOGW_IF -#define SLOGW_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send an error system log message using the current LOG_TAG. - */ -#ifndef SLOGE -#define SLOGE(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef SLOGE_IF -#define SLOGE_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - - - -// --------------------------------------------------------------------- - -/* - * Log a fatal error. If the given condition fails, this stops program - * execution like a normal assertion, but also generating the given message. - * It is NOT stripped from release builds. Note that the condition test - * is -inverted- from the normal assert() semantics. - */ -#ifndef LOG_ALWAYS_FATAL_IF -#define LOG_ALWAYS_FATAL_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)android_printAssert(#cond, LOG_TAG, ## __VA_ARGS__)) \ - : (void)0 ) -#endif - -#ifndef LOG_ALWAYS_FATAL -#define LOG_ALWAYS_FATAL(...) \ - ( ((void)android_printAssert(NULL, LOG_TAG, ## __VA_ARGS__)) ) -#endif - -/* - * Versions of LOG_ALWAYS_FATAL_IF and LOG_ALWAYS_FATAL that - * are stripped out of release builds. - */ -#if LOG_NDEBUG - -#ifndef LOG_FATAL_IF -#define LOG_FATAL_IF(cond, ...) ((void)0) -#endif -#ifndef LOG_FATAL -#define LOG_FATAL(...) ((void)0) -#endif - -#else - -#ifndef LOG_FATAL_IF -#define LOG_FATAL_IF(cond, ...) LOG_ALWAYS_FATAL_IF(cond, ## __VA_ARGS__) -#endif -#ifndef LOG_FATAL -#define LOG_FATAL(...) LOG_ALWAYS_FATAL(__VA_ARGS__) -#endif - -#endif - -/* - * Assertion that generates a log message when the assertion fails. - * Stripped out of release builds. Uses the current LOG_TAG. - */ -#ifndef ALOG_ASSERT -#define ALOG_ASSERT(cond, ...) LOG_FATAL_IF(!(cond), ## __VA_ARGS__) -//#define ALOG_ASSERT(cond) LOG_FATAL_IF(!(cond), "Assertion failed: " #cond) -#endif - -// --------------------------------------------------------------------- - -/* - * Basic log message macro. - * - * Example: - * ALOG(LOG_WARN, NULL, "Failed with error %d", errno); - * - * The second argument may be NULL or "" to indicate the "global" tag. - */ -#ifndef ALOG -#define ALOG(priority, tag, ...) \ - LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__) -#endif - -/* - * Log macro that allows you to specify a number for the priority. - */ -#ifndef LOG_PRI -#define LOG_PRI(priority, tag, ...) \ - android_printLog(priority, tag, __VA_ARGS__) -#endif - -/* - * Log macro that allows you to pass in a varargs ("args" is a va_list). - */ -#ifndef LOG_PRI_VA -#define LOG_PRI_VA(priority, tag, fmt, args) \ - android_vprintLog(priority, NULL, tag, fmt, args) -#endif - -/* - * Conditional given a desired logging priority and tag. - */ -#ifndef IF_ALOG -#define IF_ALOG(priority, tag) \ - if (android_testLog(ANDROID_##priority, tag)) -#endif - -// --------------------------------------------------------------------- - -/* - * Event logging. - */ - -/* - * Event log entry types. These must match up with the declarations in - * java/android/android/util/EventLog.java. - */ -typedef enum { - EVENT_TYPE_INT = 0, - EVENT_TYPE_LONG = 1, - EVENT_TYPE_STRING = 2, - EVENT_TYPE_LIST = 3, -} AndroidEventLogType; - - -#ifndef LOG_EVENT_INT -#define LOG_EVENT_INT(_tag, _value) { \ - int intBuf = _value; \ - (void) android_btWriteLog(_tag, EVENT_TYPE_INT, &intBuf, \ - sizeof(intBuf)); \ - } -#endif -#ifndef LOG_EVENT_LONG -#define LOG_EVENT_LONG(_tag, _value) { \ - long long longBuf = _value; \ - (void) android_btWriteLog(_tag, EVENT_TYPE_LONG, &longBuf, \ - sizeof(longBuf)); \ - } -#endif -#ifndef LOG_EVENT_STRING -#define LOG_EVENT_STRING(_tag, _value) \ - ((void) 0) /* not implemented -- must combine len with string */ -#endif -/* TODO: something for LIST */ - -/* - * =========================================================================== - * - * The stuff in the rest of this file should not be used directly. - */ - -#define android_printLog(prio, tag, fmt...) \ - __android_log_print(prio, tag, fmt) - -#define android_vprintLog(prio, cond, tag, fmt...) \ - __android_log_vprint(prio, tag, fmt) - -/* XXX Macros to work around syntax errors in places where format string - * arg is not passed to ALOG_ASSERT, LOG_ALWAYS_FATAL or LOG_ALWAYS_FATAL_IF - * (happens only in debug builds). - */ - -/* Returns 2nd arg. Used to substitute default value if caller's vararg list - * is empty. - */ -#define __android_second(dummy, second, ...) second - -/* If passed multiple args, returns ',' followed by all but 1st arg, otherwise - * returns nothing. - */ -#define __android_rest(first, ...) , ## __VA_ARGS__ - -#define android_printAssert(cond, tag, fmt...) \ - __android_log_assert(cond, tag, \ - __android_second(0, ## fmt, NULL) __android_rest(fmt)) - -#define android_writeLog(prio, tag, text) \ - __android_log_write(prio, tag, text) - -#define android_bWriteLog(tag, payload, len) \ - __android_log_bwrite(tag, payload, len) -#define android_btWriteLog(tag, type, payload, len) \ - __android_log_btwrite(tag, type, payload, len) - -// TODO: remove these prototypes and their users -#define android_testLog(prio, tag) (1) -#define android_writevLog(vec,num) do{}while(0) -#define android_write1Log(str,len) do{}while (0) -#define android_setMinPriority(tag, prio) do{}while(0) -//#define android_logToCallback(func) do{}while(0) -#define android_logToFile(tag, file) (0) -#define android_logToFd(tag, fd) (0) - -typedef enum { - LOG_ID_MAIN = 0, - LOG_ID_RADIO = 1, - LOG_ID_EVENTS = 2, - LOG_ID_SYSTEM = 3, - - LOG_ID_MAX -} log_id_t; - -/* - * Send a simple string to the log. - */ -int __android_log_buf_write(int bufID, int prio, const char *tag, const char *text); -int __android_log_buf_print(int bufID, int prio, const char *tag, const char *fmt, ...); - - -#ifdef __cplusplus -} -#endif - -#endif // _LIBS_CUTILS_LOG_H diff --git a/external/android/include/16/system/core/include/cutils/logd.h b/external/android/include/16/system/core/include/cutils/logd.h deleted file mode 100644 index 8737639..0000000 --- a/external/android/include/16/system/core/include/cutils/logd.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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_CUTILS_LOGD_H -#define _ANDROID_CUTILS_LOGD_H - -/* the stable/frozen log-related definitions have been - * moved to this header, which is exposed by the NDK - */ -#include - -/* the rest is only used internally by the system */ -#include -#include -#include -#include -#include -#ifdef HAVE_PTHREADS -#include -#endif -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -int __android_log_bwrite(int32_t tag, const void *payload, size_t len); -int __android_log_btwrite(int32_t tag, char type, const void *payload, - size_t len); - -#ifdef __cplusplus -} -#endif - -#endif /* _LOGD_H */ diff --git a/external/android/include/16/system/core/include/cutils/logger.h b/external/android/include/16/system/core/include/cutils/logger.h deleted file mode 100644 index 04f3fb0..0000000 --- a/external/android/include/16/system/core/include/cutils/logger.h +++ /dev/null @@ -1,81 +0,0 @@ -/* utils/logger.h -** -** Copyright 2007, The Android Open Source Project -** -** This file is dual licensed. It may be redistributed and/or modified -** under the terms of the Apache 2.0 License OR version 2 of the GNU -** General Public License. -*/ - -#ifndef _UTILS_LOGGER_H -#define _UTILS_LOGGER_H - -#include - -/* - * The userspace structure for version 1 of the logger_entry ABI. - * This structure is returned to userspace by the kernel logger - * driver unless an upgrade to a newer ABI version is requested. - */ -struct logger_entry { - uint16_t len; /* length of the payload */ - uint16_t __pad; /* no matter what, we get 2 bytes of padding */ - int32_t pid; /* generating process's pid */ - int32_t tid; /* generating process's tid */ - int32_t sec; /* seconds since Epoch */ - int32_t nsec; /* nanoseconds */ - char msg[0]; /* the entry's payload */ -}; - -/* - * The userspace structure for version 2 of the logger_entry ABI. - * This structure is returned to userspace if ioctl(LOGGER_SET_VERSION) - * is called with version==2 - */ -struct logger_entry_v2 { - uint16_t len; /* length of the payload */ - uint16_t hdr_size; /* sizeof(struct logger_entry_v2) */ - int32_t pid; /* generating process's pid */ - int32_t tid; /* generating process's tid */ - int32_t sec; /* seconds since Epoch */ - int32_t nsec; /* nanoseconds */ - uint32_t euid; /* effective UID of logger */ - char msg[0]; /* the entry's payload */ -}; - -#define LOGGER_LOG_MAIN "log/main" -#define LOGGER_LOG_RADIO "log/radio" -#define LOGGER_LOG_EVENTS "log/events" -#define LOGGER_LOG_SYSTEM "log/system" - -/* - * The maximum size of the log entry payload that can be - * written to the kernel logger driver. An attempt to write - * more than this amount to /dev/log/* will result in a - * truncated log entry. - */ -#define LOGGER_ENTRY_MAX_PAYLOAD 4076 - -/* - * The maximum size of a log entry which can be read from the - * kernel logger driver. An attempt to read less than this amount - * may result in read() returning EINVAL. - */ -#define LOGGER_ENTRY_MAX_LEN (5*1024) - -#ifdef HAVE_IOCTL - -#include - -#define __LOGGERIO 0xAE - -#define LOGGER_GET_LOG_BUF_SIZE _IO(__LOGGERIO, 1) /* size of log */ -#define LOGGER_GET_LOG_LEN _IO(__LOGGERIO, 2) /* used log len */ -#define LOGGER_GET_NEXT_ENTRY_LEN _IO(__LOGGERIO, 3) /* next entry len */ -#define LOGGER_FLUSH_LOG _IO(__LOGGERIO, 4) /* flush log */ -#define LOGGER_GET_VERSION _IO(__LOGGERIO, 5) /* abi version */ -#define LOGGER_SET_VERSION _IO(__LOGGERIO, 6) /* abi version */ - -#endif // HAVE_IOCTL - -#endif /* _UTILS_LOGGER_H */ diff --git a/external/android/include/16/system/core/include/cutils/logprint.h b/external/android/include/16/system/core/include/cutils/logprint.h deleted file mode 100644 index 2b1e1c5..0000000 --- a/external/android/include/16/system/core/include/cutils/logprint.h +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (C) 2006 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 _LOGPRINT_H -#define _LOGPRINT_H - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - FORMAT_OFF = 0, - FORMAT_BRIEF, - FORMAT_PROCESS, - FORMAT_TAG, - FORMAT_THREAD, - FORMAT_RAW, - FORMAT_TIME, - FORMAT_THREADTIME, - FORMAT_LONG, -} AndroidLogPrintFormat; - -typedef struct AndroidLogFormat_t AndroidLogFormat; - -typedef struct AndroidLogEntry_t { - time_t tv_sec; - long tv_nsec; - android_LogPriority priority; - int32_t pid; - int32_t tid; - const char * tag; - size_t messageLen; - const char * message; -} AndroidLogEntry; - -AndroidLogFormat *android_log_format_new(); - -void android_log_format_free(AndroidLogFormat *p_format); - -void android_log_setPrintFormat(AndroidLogFormat *p_format, - AndroidLogPrintFormat format); - -/** - * Returns FORMAT_OFF on invalid string - */ -AndroidLogPrintFormat android_log_formatFromString(const char *s); - -/** - * filterExpression: a single filter expression - * eg "AT:d" - * - * returns 0 on success and -1 on invalid expression - * - * Assumes single threaded execution - * - */ - -int android_log_addFilterRule(AndroidLogFormat *p_format, - const char *filterExpression); - - -/** - * filterString: a whitespace-separated set of filter expressions - * eg "AT:d *:i" - * - * returns 0 on success and -1 on invalid expression - * - * Assumes single threaded execution - * - */ - -int android_log_addFilterString(AndroidLogFormat *p_format, - const char *filterString); - - -/** - * returns 1 if this log line should be printed based on its priority - * and tag, and 0 if it should not - */ -int android_log_shouldPrintLine ( - AndroidLogFormat *p_format, const char *tag, android_LogPriority pri); - - -/** - * Splits a wire-format buffer into an AndroidLogEntry - * entry allocated by caller. Pointers will point directly into buf - * - * Returns 0 on success and -1 on invalid wire format (entry will be - * in unspecified state) - */ -int android_log_processLogBuffer(struct logger_entry *buf, - AndroidLogEntry *entry); - -/** - * Like android_log_processLogBuffer, but for binary logs. - * - * If "map" is non-NULL, it will be used to convert the log tag number - * into a string. - */ -int android_log_processBinaryLogBuffer(struct logger_entry *buf, - AndroidLogEntry *entry, const EventTagMap* map, char* messageBuf, - int messageBufLen); - - -/** - * Formats a log message into a buffer - * - * Uses defaultBuffer if it can, otherwise malloc()'s a new buffer - * If return value != defaultBuffer, caller must call free() - * Returns NULL on malloc error - */ - -char *android_log_formatLogLine ( - AndroidLogFormat *p_format, - char *defaultBuffer, - size_t defaultBufferSize, - const AndroidLogEntry *p_line, - size_t *p_outLength); - - -/** - * Either print or do not print log line, based on filter - * - * Assumes single threaded execution - * - */ -int android_log_printLogLine( - AndroidLogFormat *p_format, - int fd, - const AndroidLogEntry *entry); - - -#ifdef __cplusplus -} -#endif - - -#endif /*_LOGPRINT_H*/ diff --git a/external/android/include/16/system/core/include/cutils/memory.h b/external/android/include/16/system/core/include/cutils/memory.h deleted file mode 100644 index e725cdd..0000000 --- a/external/android/include/16/system/core/include/cutils/memory.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2006 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_CUTILS_MEMORY_H -#define ANDROID_CUTILS_MEMORY_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* size is given in bytes and must be multiple of 2 */ -void android_memset16(uint16_t* dst, uint16_t value, size_t size); - -/* size is given in bytes and must be multiple of 4 */ -void android_memset32(uint32_t* dst, uint32_t value, size_t size); - -#if !HAVE_STRLCPY -/* Declaration of strlcpy() for platforms that don't already have it. */ -size_t strlcpy(char *dst, const char *src, size_t size); -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // ANDROID_CUTILS_MEMORY_H diff --git a/external/android/include/16/system/core/include/cutils/misc.h b/external/android/include/16/system/core/include/cutils/misc.h deleted file mode 100644 index 2c48dfa..0000000 --- a/external/android/include/16/system/core/include/cutils/misc.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2006 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 __CUTILS_MISC_H -#define __CUTILS_MISC_H - -#ifdef __cplusplus -extern "C" { -#endif - - /* Load an entire file into a malloc'd chunk of memory - * that is length_of_file + 1 (null terminator). If - * sz is non-zero, return the size of the file via sz. - * Returns 0 on failure. - */ -extern void *load_file(const char *fn, unsigned *sz); - - /* Connects your process to the system debugger daemon - * so that on a crash it may be logged or interactively - * debugged (depending on system settings). - */ -extern void debuggerd_connect(void); - - - /* This is the range of UIDs (and GIDs) that are reserved - * for assigning to applications. - */ -#define FIRST_APPLICATION_UID 10000 -#define LAST_APPLICATION_UID 99999 - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_MISC_H */ diff --git a/external/android/include/16/system/core/include/cutils/mq.h b/external/android/include/16/system/core/include/cutils/mq.h deleted file mode 100644 index b27456d..0000000 --- a/external/android/include/16/system/core/include/cutils/mq.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * 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. - */ - -/** - * IPC messaging library. - */ - -#ifndef __MQ_H -#define __MQ_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** A message. */ -typedef struct MqMessage MqMessage; - -/** A destination to which messages can be sent. */ -typedef struct MqDestination MqDestination; - -/* Array of bytes. */ -typedef struct MqBytes MqBytes; - -/** - * Hears messages. - * - * @param destination to which the message was sent - * @param message the message to hear - */ -typedef void MqMessageListener(MqDestination* destination, MqMessage* message); - -/** - * Hears a destination close. - * - * @param destination that closed - */ -typedef void MqCloseListener(MqDestination* destination); - -/** Message functions. */ - -/** - * Creates a new Message. - * - * @param header as defined by user - * @param body as defined by user - * @param replyTo destination to which replies should be sent, NULL if none - */ -MqMessage* mqCreateMessage(MqBytes header, MqBytes body, - MqDestination* replyTo); - -/** Sends a message to a destination. */ -void mqSendMessage(MqMessage* message, MqDestination* destination); - -/** Destination functions. */ - -/** - * Creates a new destination. Acquires a reference implicitly. - * - * @param messageListener function to call when a message is recieved - * @param closeListener function to call when the destination closes - * @param userData user-specific data to associate with the destination. - * Retrieve using mqGetDestinationUserData(). - */ -MqDestination* mqCreateDestination(MqMessageListener* messageListener, - MqCloseListener* closeListener, void* userData); - -/** - * Gets user data which was associated with the given destination at - * construction time. - * - * It is only valid to call this function in the same process that the - * given destination was created in. - * This function returns a null pointer if you call it on a destination - * created in a remote process. - */ -void* mqGetUserData(MqDestination* destination); - -/** - * Returns 1 if the destination was created in this process, or 0 if - * the destination was created in a different process, in which case you have - * a remote stub. - */ -int mqIsDestinationLocal(MqDestination* destination); - -/** - * Increments the destination's reference count. - */ -void mqKeepDestination(MqDesintation* destination); - -/** - * Decrements the destination's reference count. - */ -void mqFreeDestination(MqDestination* desintation); - -/** Registry API. */ - -/** - * Gets the destination bound to a name. - */ -MqDestination* mqGetDestination(char* name); - -/** - * Binds a destination to a name. - */ -void mqPutDestination(char* name, MqDestination* desintation); - -#ifdef __cplusplus -} -#endif - -#endif /* __MQ_H */ diff --git a/external/android/include/16/system/core/include/cutils/mspace.h b/external/android/include/16/system/core/include/cutils/mspace.h deleted file mode 100644 index 93fe48e..0000000 --- a/external/android/include/16/system/core/include/cutils/mspace.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2006 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. - */ - -/* A wrapper file for dlmalloc.h that defines prototypes for the - * mspace_*() functions, which provide an interface for creating - * multiple heaps. - */ - -#ifndef MSPACE_H_ -#define MSPACE_H_ - -/* It's a pain getting the mallinfo stuff to work - * with Linux, OSX, and klibc, so just turn it off - * for now. - * TODO: make mallinfo work - */ -#define NO_MALLINFO 1 - -/* Allow setting the maximum heap footprint. - */ -#define USE_MAX_ALLOWED_FOOTPRINT 1 - -#define USE_CONTIGUOUS_MSPACES 1 -#if USE_CONTIGUOUS_MSPACES -#define HAVE_MMAP 0 -#define HAVE_MORECORE 1 -#define MORECORE_CONTIGUOUS 0 -#endif - -#define MSPACES 1 -#define ONLY_MSPACES 1 -#include "../../../../bionic/libc/bionic/dlmalloc.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - mspace_usable_size(void* p); - - Returns the number of bytes you can actually use in - an allocated chunk, which may be more than you requested (although - often not) due to alignment and minimum size constraints. - You can use this many bytes without worrying about - overwriting other allocated objects. This is not a particularly great - programming practice. mspace_usable_size can be more useful in - debugging and assertions, for example: - - p = mspace_malloc(msp, n); - assert(mspace_usable_size(msp, p) >= 256); -*/ -size_t mspace_usable_size(mspace, const void*); - -#if USE_CONTIGUOUS_MSPACES -/* - Similar to create_mspace(), but the underlying memory is - guaranteed to be contiguous. No more than max_capacity - bytes is ever allocated to the mspace. - */ -mspace create_contiguous_mspace(size_t starting_capacity, size_t max_capacity, - int locked); - -/* - Identical to create_contiguous_mspace, but labels the mapping 'mspace/name' - instead of 'mspace' -*/ -mspace create_contiguous_mspace_with_name(size_t starting_capacity, - size_t max_capacity, int locked, const char *name); - -/* - Identical to create_contiguous_mspace, but uses previously mapped memory. -*/ -mspace create_contiguous_mspace_with_base(size_t starting_capacity, - size_t max_capacity, int locked, void *base); - -size_t destroy_contiguous_mspace(mspace msp); - -/* - Returns the position of the "break" within the given mspace. -*/ -void *contiguous_mspace_sbrk0(mspace msp); -#endif - -/* - Call the handler for each block in the specified mspace. - chunkptr and chunklen refer to the heap-level chunk including - the chunk overhead, and userptr and userlen refer to the - user-usable part of the chunk. If the chunk is free, userptr - will be NULL and userlen will be 0. userlen is not guaranteed - to be the same value passed into malloc() for a given chunk; - it is >= the requested size. - */ -void mspace_walk_heap(mspace msp, - void(*handler)(const void *chunkptr, size_t chunklen, - const void *userptr, size_t userlen, void *arg), void *harg); - -/* - mspace_walk_free_pages(handler, harg) - - Calls the provided handler on each free region in the specified - mspace. The memory between start and end are guaranteed not to - contain any important data, so the handler is free to alter the - contents in any way. This can be used to advise the OS that large - free regions may be swapped out. - - The value in harg will be passed to each call of the handler. - */ -void mspace_walk_free_pages(mspace msp, - void(*handler)(void *start, void *end, void *arg), void *harg); - -#ifdef __cplusplus -}; /* end of extern "C" */ -#endif - -#endif /* MSPACE_H_ */ diff --git a/external/android/include/16/system/core/include/cutils/native_handle.h b/external/android/include/16/system/core/include/cutils/native_handle.h deleted file mode 100644 index 268c5d3..0000000 --- a/external/android/include/16/system/core/include/cutils/native_handle.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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 NATIVE_HANDLE_H_ -#define NATIVE_HANDLE_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct native_handle -{ - int version; /* sizeof(native_handle_t) */ - int numFds; /* number of file-descriptors at &data[0] */ - int numInts; /* number of ints at &data[numFds] */ - int data[0]; /* numFds + numInts ints */ -} native_handle_t; - -/* - * native_handle_close - * - * closes the file descriptors contained in this native_handle_t - * - * return 0 on success, or a negative error code on failure - * - */ -int native_handle_close(const native_handle_t* h); - - -/* - * native_handle_create - * - * creates a native_handle_t and initializes it. must be destroyed with - * native_handle_delete(). - * - */ -native_handle_t* native_handle_create(int numFds, int numInts); - -/* - * native_handle_delete - * - * frees a native_handle_t allocated with native_handle_create(). - * This ONLY frees the memory allocated for the native_handle_t, but doesn't - * close the file descriptors; which can be achieved with native_handle_close(). - * - * return 0 on success, or a negative error code on failure - * - */ -int native_handle_delete(native_handle_t* h); - - -#ifdef __cplusplus -} -#endif - -#endif /* NATIVE_HANDLE_H_ */ diff --git a/external/android/include/16/system/core/include/cutils/open_memstream.h b/external/android/include/16/system/core/include/cutils/open_memstream.h deleted file mode 100644 index b7998be..0000000 --- a/external/android/include/16/system/core/include/cutils/open_memstream.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2010 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 __CUTILS_OPEN_MEMSTREAM_H__ -#define __CUTILS_OPEN_MEMSTREAM_H__ - -#include - -#ifndef HAVE_OPEN_MEMSTREAM - -#ifdef __cplusplus -extern "C" { -#endif - -FILE* open_memstream(char** bufp, size_t* sizep); - -#ifdef __cplusplus -} -#endif - -#endif /*!HAVE_OPEN_MEMSTREAM*/ - -#endif /*__CUTILS_OPEN_MEMSTREAM_H__*/ diff --git a/external/android/include/16/system/core/include/cutils/partition_utils.h b/external/android/include/16/system/core/include/cutils/partition_utils.h deleted file mode 100644 index 597df92..0000000 --- a/external/android/include/16/system/core/include/cutils/partition_utils.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2011, 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 __CUTILS_PARTITION_WIPED_H__ -#define __CUTILS_PARTITION_WIPED_H__ - -__BEGIN_DECLS - -int partition_wiped(char *source); -void erase_footer(const char *dev_path, long long size); - -__END_DECLS - -#endif /* __CUTILS_PARTITION_WIPED_H__ */ diff --git a/external/android/include/16/system/core/include/cutils/process_name.h b/external/android/include/16/system/core/include/cutils/process_name.h deleted file mode 100644 index 1e72e5c..0000000 --- a/external/android/include/16/system/core/include/cutils/process_name.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ - -/** - * Gives the current process a name. - */ - -#ifndef __PROCESS_NAME_H -#define __PROCESS_NAME_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Sets the current process name. - * - * Warning: This leaks a string every time you call it. Use judiciously! - */ -void set_process_name(const char* process_name); - -/** Gets the current process name. */ -const char* get_process_name(void); - -#ifdef __cplusplus -} -#endif - -#endif /* __PROCESS_NAME_H */ diff --git a/external/android/include/16/system/core/include/cutils/properties.h b/external/android/include/16/system/core/include/cutils/properties.h deleted file mode 100644 index 25fd67a..0000000 --- a/external/android/include/16/system/core/include/cutils/properties.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2006 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 __CUTILS_PROPERTIES_H -#define __CUTILS_PROPERTIES_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* System properties are *small* name value pairs managed by the -** property service. If your data doesn't fit in the provided -** space it is not appropriate for a system property. -** -** WARNING: system/bionic/include/sys/system_properties.h also defines -** these, but with different names. (TODO: fix that) -*/ -#define PROPERTY_KEY_MAX 32 -#define PROPERTY_VALUE_MAX 92 - -/* property_get: returns the length of the value which will never be -** greater than PROPERTY_VALUE_MAX - 1 and will always be zero terminated. -** (the length does not include the terminating zero). -** -** If the property read fails or returns an empty value, the default -** value is used (if nonnull). -*/ -int property_get(const char *key, char *value, const char *default_value); - -/* property_set: returns 0 on success, < 0 on failure -*/ -int property_set(const char *key, const char *value); - -int property_list(void (*propfn)(const char *key, const char *value, void *cookie), void *cookie); - - -#ifdef HAVE_SYSTEM_PROPERTY_SERVER -/* - * We have an external property server instead of built-in libc support. - * Used by the simulator. - */ -#define SYSTEM_PROPERTY_PIPE_NAME "/tmp/android-sysprop" - -enum { - kSystemPropertyUnknown = 0, - kSystemPropertyGet, - kSystemPropertySet, - kSystemPropertyList -}; -#endif /*HAVE_SYSTEM_PROPERTY_SERVER*/ - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/external/android/include/16/system/core/include/cutils/qsort_r_compat.h b/external/android/include/16/system/core/include/cutils/qsort_r_compat.h deleted file mode 100644 index 479a1ab..0000000 --- a/external/android/include/16/system/core/include/cutils/qsort_r_compat.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2012 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. - */ - -/* - * Provides a portable version of qsort_r, called qsort_r_compat, which is a - * reentrant variant of qsort that passes a user data pointer to its comparator. - * This implementation follows the BSD parameter convention. - */ - -#ifndef _LIBS_CUTILS_QSORT_R_COMPAT_H -#define _LIBS_CUTILS_QSORT_R_COMPAT_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -void qsort_r_compat(void* base, size_t nel, size_t width, void* thunk, - int (*compar)(void*, const void* , const void* )); - -#ifdef __cplusplus -} -#endif - -#endif // _LIBS_CUTILS_QSORT_R_COMPAT_H diff --git a/external/android/include/16/system/core/include/cutils/qtaguid.h b/external/android/include/16/system/core/include/cutils/qtaguid.h deleted file mode 100644 index f8550fd..0000000 --- a/external/android/include/16/system/core/include/cutils/qtaguid.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2011 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 __CUTILS_QTAGUID_H -#define __CUTILS_QTAGUID_H - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Set tags (and owning UIDs) for network sockets. -*/ -extern int qtaguid_tagSocket(int sockfd, int tag, uid_t uid); - -/* - * Untag a network socket before closing. -*/ -extern int qtaguid_untagSocket(int sockfd); - -/* - * For the given uid, switch counter sets. - * The kernel only keeps a limited number of sets. - * 2 for now. - */ -extern int qtaguid_setCounterSet(int counterSetNum, uid_t uid); - -/* - * Delete all tag info that relates to the given tag an uid. - * If the tag is 0, then ALL info about the uid is freeded. - * The delete data also affects active tagged socketd, which are - * then untagged. - * The calling process can only operate on its own tags. - * Unless it is part of the happy AID_NET_BW_ACCT group. - * In which case it can clobber everything. - */ -extern int qtaguid_deleteTagData(int tag, uid_t uid); - -/* - * Enable/disable qtaguid functionnality at a lower level. - * When pacified, the kernel will accept commands but do nothing. - */ -extern int qtaguid_setPacifier(int on); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_QTAG_UID_H */ diff --git a/external/android/include/16/system/core/include/cutils/record_stream.h b/external/android/include/16/system/core/include/cutils/record_stream.h deleted file mode 100644 index bfac87a..0000000 --- a/external/android/include/16/system/core/include/cutils/record_stream.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2006 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. - */ - -/* - * A simple utility for reading fixed records out of a stream fd - */ - -#ifndef _CUTILS_RECORD_STREAM_H -#define _CUTILS_RECORD_STREAM_H - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef struct RecordStream RecordStream; - -extern RecordStream *record_stream_new(int fd, size_t maxRecordLen); -extern void record_stream_free(RecordStream *p_rs); - -extern int record_stream_get_next (RecordStream *p_rs, void ** p_outRecord, - size_t *p_outRecordLen); - -#ifdef __cplusplus -} -#endif - - -#endif /*_CUTILS_RECORD_STREAM_H*/ - diff --git a/external/android/include/16/system/core/include/cutils/sched_policy.h b/external/android/include/16/system/core/include/cutils/sched_policy.h deleted file mode 100644 index ba84ce3..0000000 --- a/external/android/include/16/system/core/include/cutils/sched_policy.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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 __CUTILS_SCHED_POLICY_H -#define __CUTILS_SCHED_POLICY_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* Keep in sync with THREAD_GROUP_* in frameworks/base/core/java/android/os/Process.java */ -typedef enum { - SP_DEFAULT = -1, - SP_BACKGROUND = 0, - SP_FOREGROUND = 1, - SP_SYSTEM = 2, // can't be used with set_sched_policy() - SP_AUDIO_APP = 3, - SP_AUDIO_SYS = 4, - SP_CNT, - SP_MAX = SP_CNT - 1, - SP_SYSTEM_DEFAULT = SP_FOREGROUND, -} SchedPolicy; - -/* Assign thread tid to the cgroup associated with the specified policy. - * If the thread is a thread group leader, that is it's gettid() == getpid(), - * then the other threads in the same thread group are _not_ affected. - * On platforms which support gettid(), zero tid means current thread. - * Return value: 0 for success, or -errno for error. - */ -extern int set_sched_policy(int tid, SchedPolicy policy); - -/* Return the policy associated with the cgroup of thread tid via policy pointer. - * On platforms which support gettid(), zero tid means current thread. - * Return value: 0 for success, or -1 for error and set errno. - */ -extern int get_sched_policy(int tid, SchedPolicy *policy); - -/* Return a displayable string corresponding to policy. - * Return value: non-NULL NUL-terminated name of unspecified length; - * the caller is responsible for displaying the useful part of the string. - */ -extern const char *get_sched_policy_name(SchedPolicy policy); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_SCHED_POLICY_H */ diff --git a/external/android/include/16/system/core/include/cutils/selector.h b/external/android/include/16/system/core/include/cutils/selector.h deleted file mode 100644 index dfc2a9d..0000000 --- a/external/android/include/16/system/core/include/cutils/selector.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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. - */ - -/** - * Framework for multiplexing I/O. A selector manages a set of file - * descriptors and calls out to user-provided callback functions to read and - * write data and handle errors. - */ - -#ifndef __SELECTOR_H -#define __SELECTOR_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -/** - * Manages SelectableFds and invokes their callbacks at appropriate times. - */ -typedef struct Selector Selector; - -/** - * A selectable descriptor. Contains callbacks which the selector can invoke - * before calling select(), when the descriptor is readable or writable, and - * when the descriptor contains out-of-band data. Simply set a callback to - * NULL if you're not interested in that particular event. - * - * A selectable descriptor can indicate that it needs to be removed from the - * selector by setting the 'remove' flag. The selector will remove the - * descriptor at a later time and invoke the onRemove() callback. - * - * SelectableFd fields should only be modified from the selector loop. - */ -typedef struct SelectableFd SelectableFd; -struct SelectableFd { - - /** The file descriptor itself. */ - int fd; - - /** Pointer to user-specific data. Can be NULL. */ - void* data; - - /** - * Set this flag when you no longer wish to be selected. The selector - * will invoke onRemove() when the descriptor is actually removed. - */ - bool remove; - - /** - * Invoked by the selector before calling select. You can set up other - * callbacks from here as necessary. - */ - void (*beforeSelect)(SelectableFd* self); - - /** - * Invoked by the selector when the descriptor has data available. Set to - * NULL to indicate that you're not interested in reading. - */ - void (*onReadable)(SelectableFd* self); - - /** - * Invoked by the selector when the descriptor can accept data. Set to - * NULL to indicate that you're not interested in writing. - */ - void (*onWritable)(SelectableFd* self); - - /** - * Invoked by the selector when out-of-band (OOB) data is available. Set to - * NULL to indicate that you're not interested in OOB data. - */ - void (*onExcept)(SelectableFd* self); - - /** - * Invoked by the selector after the descriptor is removed from the - * selector but before the selector frees the SelectableFd memory. - */ - void (*onRemove)(SelectableFd* self); - - /** - * The selector which selected this fd. Set by the selector itself. - */ - Selector* selector; -}; - -/** - * Creates a new selector. - */ -Selector* selectorCreate(void); - -/** - * Creates a new selectable fd, adds it to the given selector and returns a - * pointer. Outside of 'selector' and 'fd', all fields are set to 0 or NULL - * by default. - * - * The selectable fd should only be modified from the selector loop thread. - */ -SelectableFd* selectorAdd(Selector* selector, int fd); - -/** - * Wakes up the selector even though no I/O events occurred. Use this - * to indicate that you're ready to write to a descriptor. - */ -void selectorWakeUp(Selector* selector); - -/** - * Loops continuously selecting file descriptors and firing events. - * Does not return. - */ -void selectorLoop(Selector* selector); - -#ifdef __cplusplus -} -#endif - -#endif /* __SELECTOR_H */ diff --git a/external/android/include/16/system/core/include/cutils/sockets.h b/external/android/include/16/system/core/include/cutils/sockets.h deleted file mode 100644 index 19cae0c..0000000 --- a/external/android/include/16/system/core/include/cutils/sockets.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2006 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 __CUTILS_SOCKETS_H -#define __CUTILS_SOCKETS_H - -#include -#include -#include -#include - -#ifdef HAVE_WINSOCK -#include -typedef int socklen_t; -#elif HAVE_SYS_SOCKET_H -#include -#endif - -#define ANDROID_SOCKET_ENV_PREFIX "ANDROID_SOCKET_" -#define ANDROID_SOCKET_DIR "/dev/socket" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * android_get_control_socket - simple helper function to get the file - * descriptor of our init-managed Unix domain socket. `name' is the name of the - * socket, as given in init.rc. Returns -1 on error. - * - * This is inline and not in libcutils proper because we want to use this in - * third-party daemons with minimal modification. - */ -static inline int android_get_control_socket(const char *name) -{ - char key[64] = ANDROID_SOCKET_ENV_PREFIX; - const char *val; - int fd; - - /* build our environment variable, counting cycles like a wolf ... */ -#if HAVE_STRLCPY - strlcpy(key + sizeof(ANDROID_SOCKET_ENV_PREFIX) - 1, - name, - sizeof(key) - sizeof(ANDROID_SOCKET_ENV_PREFIX)); -#else /* for the host, which may lack the almightly strncpy ... */ - strncpy(key + sizeof(ANDROID_SOCKET_ENV_PREFIX) - 1, - name, - sizeof(key) - sizeof(ANDROID_SOCKET_ENV_PREFIX)); - key[sizeof(key)-1] = '\0'; -#endif - - val = getenv(key); - if (!val) - return -1; - - errno = 0; - fd = strtol(val, NULL, 10); - if (errno) - return -1; - - return fd; -} - -/* - * See also android.os.LocalSocketAddress.Namespace - */ -// Linux "abstract" (non-filesystem) namespace -#define ANDROID_SOCKET_NAMESPACE_ABSTRACT 0 -// Android "reserved" (/dev/socket) namespace -#define ANDROID_SOCKET_NAMESPACE_RESERVED 1 -// Normal filesystem namespace -#define ANDROID_SOCKET_NAMESPACE_FILESYSTEM 2 - -extern int socket_loopback_client(int port, int type); -extern int socket_network_client(const char *host, int port, int type); -extern int socket_loopback_server(int port, int type); -extern int socket_local_server(const char *name, int namespaceId, int type); -extern int socket_local_server_bind(int s, const char *name, int namespaceId); -extern int socket_local_client_connect(int fd, - const char *name, int namespaceId, int type); -extern int socket_local_client(const char *name, int namespaceId, int type); -extern int socket_inaddr_any_server(int port, int type); - -/* - * socket_peer_is_trusted - Takes a socket which is presumed to be a - * connected local socket (e.g. AF_LOCAL) and returns whether the peer - * (the userid that owns the process on the other end of that socket) - * is one of the two trusted userids, root or shell. - * - * Note: This only works as advertised on the Android OS and always - * just returns true when called on other operating systems. - */ -extern bool socket_peer_is_trusted(int fd); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_SOCKETS_H */ diff --git a/external/android/include/16/system/core/include/cutils/str_parms.h b/external/android/include/16/system/core/include/cutils/str_parms.h deleted file mode 100644 index 247c996..0000000 --- a/external/android/include/16/system/core/include/cutils/str_parms.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2011 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 __CUTILS_STR_PARMS_H -#define __CUTILS_STR_PARMS_H - -#include - -struct str_parms; - -struct str_parms *str_parms_create(void); -struct str_parms *str_parms_create_str(const char *_string); -void str_parms_destroy(struct str_parms *str_parms); - -void str_parms_del(struct str_parms *str_parms, const char *key); - -int str_parms_add_str(struct str_parms *str_parms, const char *key, - const char *value); -int str_parms_add_int(struct str_parms *str_parms, const char *key, int value); - -int str_parms_add_float(struct str_parms *str_parms, const char *key, - float value); - -int str_parms_get_str(struct str_parms *str_parms, const char *key, - char *out_val, int len); -int str_parms_get_int(struct str_parms *str_parms, const char *key, - int *out_val); -int str_parms_get_float(struct str_parms *str_parms, const char *key, - float *out_val); - -char *str_parms_to_str(struct str_parms *str_parms); - -/* debug */ -void str_parms_dump(struct str_parms *str_parms); - -#endif /* __CUTILS_STR_PARMS_H */ diff --git a/external/android/include/16/system/core/include/cutils/threads.h b/external/android/include/16/system/core/include/cutils/threads.h deleted file mode 100644 index acf8f48..0000000 --- a/external/android/include/16/system/core/include/cutils/threads.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - * 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 _LIBS_CUTILS_THREADS_H -#define _LIBS_CUTILS_THREADS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/***********************************************************************/ -/***********************************************************************/ -/***** *****/ -/***** local thread storage *****/ -/***** *****/ -/***********************************************************************/ -/***********************************************************************/ - -#ifdef HAVE_PTHREADS - -#include - -typedef struct { - pthread_mutex_t lock; - int has_tls; - pthread_key_t tls; - -} thread_store_t; - -#define THREAD_STORE_INITIALIZER { PTHREAD_MUTEX_INITIALIZER, 0, 0 } - -#elif defined HAVE_WIN32_THREADS - -#include - -typedef struct { - int lock_init; - int has_tls; - DWORD tls; - CRITICAL_SECTION lock; - -} thread_store_t; - -#define THREAD_STORE_INITIALIZER { 0, 0, 0, {0, 0, 0, 0, 0, 0} } - -#else -# error "no thread_store_t implementation for your platform !!" -#endif - -typedef void (*thread_store_destruct_t)(void* value); - -extern void* thread_store_get(thread_store_t* store); - -extern void thread_store_set(thread_store_t* store, - void* value, - thread_store_destruct_t destroy); - -/***********************************************************************/ -/***********************************************************************/ -/***** *****/ -/***** mutexes *****/ -/***** *****/ -/***********************************************************************/ -/***********************************************************************/ - -#ifdef HAVE_PTHREADS - -typedef pthread_mutex_t mutex_t; - -#define MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER - -static __inline__ void mutex_lock(mutex_t* lock) -{ - pthread_mutex_lock(lock); -} -static __inline__ void mutex_unlock(mutex_t* lock) -{ - pthread_mutex_unlock(lock); -} -static __inline__ int mutex_init(mutex_t* lock) -{ - return pthread_mutex_init(lock, NULL); -} -static __inline__ void mutex_destroy(mutex_t* lock) -{ - pthread_mutex_destroy(lock); -} -#endif - -#ifdef HAVE_WIN32_THREADS -typedef struct { - int init; - CRITICAL_SECTION lock[1]; -} mutex_t; - -#define MUTEX_INITIALIZER { 0, {{ NULL, 0, 0, NULL, NULL, 0 }} } - -static __inline__ void mutex_lock(mutex_t* lock) -{ - if (!lock->init) { - lock->init = 1; - InitializeCriticalSection( lock->lock ); - lock->init = 2; - } else while (lock->init != 2) - Sleep(10); - - EnterCriticalSection(lock->lock); -} - -static __inline__ void mutex_unlock(mutex_t* lock) -{ - LeaveCriticalSection(lock->lock); -} -static __inline__ int mutex_init(mutex_t* lock) -{ - InitializeCriticalSection(lock->lock); - lock->init = 2; - return 0; -} -static __inline__ void mutex_destroy(mutex_t* lock) -{ - if (lock->init) { - lock->init = 0; - DeleteCriticalSection(lock->lock); - } -} -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* _LIBS_CUTILS_THREADS_H */ diff --git a/external/android/include/16/system/core/include/cutils/tztime.h b/external/android/include/16/system/core/include/cutils/tztime.h deleted file mode 100644 index 36ac25d..0000000 --- a/external/android/include/16/system/core/include/cutils/tztime.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2006 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 _CUTILS_TZTIME_H -#define _CUTILS_TZTIME_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -time_t mktime_tz(struct tm * const tmp, char const * tz); -void localtime_tz(const time_t * const timep, struct tm * tmp, const char* tz); - -#ifdef HAVE_ANDROID_OS - -/* the following is defined in the Bionic C library on Android, but the - * declarations are only available through a platform-private header - */ -#include - -#else /* !HAVE_ANDROID_OS */ - -struct strftime_locale { - const char *mon[12]; /* short names */ - const char *month[12]; /* long names */ - const char *standalone_month[12]; /* long standalone names */ - const char *wday[7]; /* short names */ - const char *weekday[7]; /* long names */ - const char *X_fmt; - const char *x_fmt; - const char *c_fmt; - const char *am; - const char *pm; - const char *date_fmt; -}; - -size_t strftime_tz(char *s, size_t max, const char *format, const struct tm *tm, const struct strftime_locale *locale); - -#endif /* !HAVE_ANDROID_OS */ - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_TZTIME_H */ - diff --git a/external/android/include/16/system/core/include/cutils/uevent.h b/external/android/include/16/system/core/include/cutils/uevent.h deleted file mode 100644 index 4cca7e5..0000000 --- a/external/android/include/16/system/core/include/cutils/uevent.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2011 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 __CUTILS_UEVENT_H -#define __CUTILS_UEVENT_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -int uevent_open_socket(int buf_sz, bool passcred); -ssize_t uevent_kernel_multicast_recv(int socket, void *buffer, size_t length); -ssize_t uevent_kernel_multicast_uid_recv(int socket, void *buffer, size_t length, uid_t *uid); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_UEVENT_H */ diff --git a/external/android/include/16/system/core/include/cutils/uio.h b/external/android/include/16/system/core/include/cutils/uio.h deleted file mode 100644 index 01a74d2..0000000 --- a/external/android/include/16/system/core/include/cutils/uio.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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. - */ - -// -// implementation of sys/uio.h for platforms that don't have it (Win32) -// -#ifndef _LIBS_CUTILS_UIO_H -#define _LIBS_CUTILS_UIO_H - -#ifdef HAVE_SYS_UIO_H -#include -#else - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -struct iovec { - const void* iov_base; - size_t iov_len; -}; - -extern int readv( int fd, struct iovec* vecs, int count ); -extern int writev( int fd, const struct iovec* vecs, int count ); - -#ifdef __cplusplus -} -#endif - -#endif /* !HAVE_SYS_UIO_H */ - -#endif /* _LIBS_UTILS_UIO_H */ - diff --git a/external/android/include/16/system/core/include/cutils/zygote.h b/external/android/include/16/system/core/include/cutils/zygote.h deleted file mode 100644 index 22721a6..0000000 --- a/external/android/include/16/system/core/include/cutils/zygote.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 __CUTILS_ZYGOTE_H -#define __CUTILS_ZYGOTE_H - -#ifdef __cplusplus -extern "C" { -#endif - -int zygote_run_oneshot(int sendStdio, int argc, const char **argv); -int zygote_run(int argc, const char **argv); -int zygote_run_wait(int argc, const char **argv, void (*post_run_func)(int)); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_ZYGOTE_H */ diff --git a/external/android/include/16/system/core/include/system/audio.h b/external/android/include/16/system/core/include/system/audio.h deleted file mode 100644 index 3807317..0000000 --- a/external/android/include/16/system/core/include/system/audio.h +++ /dev/null @@ -1,518 +0,0 @@ -/* - * Copyright (C) 2011 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_AUDIO_CORE_H -#define ANDROID_AUDIO_CORE_H - -#include -#include -#include -#include - -#include - -__BEGIN_DECLS - -/* The enums were moved here mostly from - * frameworks/base/include/media/AudioSystem.h - */ - -typedef int audio_io_handle_t; - -/* Audio stream types */ -typedef enum { - AUDIO_STREAM_DEFAULT = -1, - AUDIO_STREAM_VOICE_CALL = 0, - AUDIO_STREAM_SYSTEM = 1, - AUDIO_STREAM_RING = 2, - AUDIO_STREAM_MUSIC = 3, - AUDIO_STREAM_ALARM = 4, - AUDIO_STREAM_NOTIFICATION = 5, - AUDIO_STREAM_BLUETOOTH_SCO = 6, - AUDIO_STREAM_ENFORCED_AUDIBLE = 7, /* Sounds that cannot be muted by user and must be routed to speaker */ - AUDIO_STREAM_DTMF = 8, - AUDIO_STREAM_TTS = 9, - - AUDIO_STREAM_CNT, - AUDIO_STREAM_MAX = AUDIO_STREAM_CNT - 1, -} audio_stream_type_t; - -/* Do not change these values without updating their counterparts - * in media/java/android/media/MediaRecorder.java! - */ -typedef enum { - AUDIO_SOURCE_DEFAULT = 0, - AUDIO_SOURCE_MIC = 1, - AUDIO_SOURCE_VOICE_UPLINK = 2, - AUDIO_SOURCE_VOICE_DOWNLINK = 3, - AUDIO_SOURCE_VOICE_CALL = 4, - AUDIO_SOURCE_CAMCORDER = 5, - AUDIO_SOURCE_VOICE_RECOGNITION = 6, - AUDIO_SOURCE_VOICE_COMMUNICATION = 7, - - AUDIO_SOURCE_CNT, - AUDIO_SOURCE_MAX = AUDIO_SOURCE_CNT - 1, -} audio_source_t; - -/* special audio session values - * (XXX: should this be living in the audio effects land?) - */ -typedef enum { - /* session for effects attached to a particular output stream - * (value must be less than 0) - */ - AUDIO_SESSION_OUTPUT_STAGE = -1, - - /* session for effects applied to output mix. These effects can - * be moved by audio policy manager to another output stream - * (value must be 0) - */ - AUDIO_SESSION_OUTPUT_MIX = 0, -} audio_session_t; - -/* Audio sub formats (see enum audio_format). */ - -/* PCM sub formats */ -typedef enum { - AUDIO_FORMAT_PCM_SUB_16_BIT = 0x1, /* DO NOT CHANGE - PCM signed 16 bits */ - AUDIO_FORMAT_PCM_SUB_8_BIT = 0x2, /* DO NOT CHANGE - PCM unsigned 8 bits */ - AUDIO_FORMAT_PCM_SUB_32_BIT = 0x3, /* PCM signed .31 fixed point */ - AUDIO_FORMAT_PCM_SUB_8_24_BIT = 0x4, /* PCM signed 7.24 fixed point */ -} audio_format_pcm_sub_fmt_t; - -/* MP3 sub format field definition : can use 11 LSBs in the same way as MP3 - * frame header to specify bit rate, stereo mode, version... - */ -typedef enum { - AUDIO_FORMAT_MP3_SUB_NONE = 0x0, -} audio_format_mp3_sub_fmt_t; - -/* AMR NB/WB sub format field definition: specify frame block interleaving, - * bandwidth efficient or octet aligned, encoding mode for recording... - */ -typedef enum { - AUDIO_FORMAT_AMR_SUB_NONE = 0x0, -} audio_format_amr_sub_fmt_t; - -/* AAC sub format field definition: specify profile or bitrate for recording... */ -typedef enum { - AUDIO_FORMAT_AAC_SUB_NONE = 0x0, -} audio_format_aac_sub_fmt_t; - -/* VORBIS sub format field definition: specify quality for recording... */ -typedef enum { - AUDIO_FORMAT_VORBIS_SUB_NONE = 0x0, -} audio_format_vorbis_sub_fmt_t; - -/* Audio format consists in a main format field (upper 8 bits) and a sub format - * field (lower 24 bits). - * - * The main format indicates the main codec type. The sub format field - * indicates options and parameters for each format. The sub format is mainly - * used for record to indicate for instance the requested bitrate or profile. - * It can also be used for certain formats to give informations not present in - * the encoded audio stream (e.g. octet alignement for AMR). - */ -typedef enum { - AUDIO_FORMAT_INVALID = 0xFFFFFFFFUL, - AUDIO_FORMAT_DEFAULT = 0, - AUDIO_FORMAT_PCM = 0x00000000UL, /* DO NOT CHANGE */ - AUDIO_FORMAT_MP3 = 0x01000000UL, - AUDIO_FORMAT_AMR_NB = 0x02000000UL, - AUDIO_FORMAT_AMR_WB = 0x03000000UL, - AUDIO_FORMAT_AAC = 0x04000000UL, - AUDIO_FORMAT_HE_AAC_V1 = 0x05000000UL, - AUDIO_FORMAT_HE_AAC_V2 = 0x06000000UL, - AUDIO_FORMAT_VORBIS = 0x07000000UL, - AUDIO_FORMAT_MAIN_MASK = 0xFF000000UL, - AUDIO_FORMAT_SUB_MASK = 0x00FFFFFFUL, - - /* Aliases */ - AUDIO_FORMAT_PCM_16_BIT = (AUDIO_FORMAT_PCM | - AUDIO_FORMAT_PCM_SUB_16_BIT), - AUDIO_FORMAT_PCM_8_BIT = (AUDIO_FORMAT_PCM | - AUDIO_FORMAT_PCM_SUB_8_BIT), - AUDIO_FORMAT_PCM_32_BIT = (AUDIO_FORMAT_PCM | - AUDIO_FORMAT_PCM_SUB_32_BIT), - AUDIO_FORMAT_PCM_8_24_BIT = (AUDIO_FORMAT_PCM | - AUDIO_FORMAT_PCM_SUB_8_24_BIT), -} audio_format_t; - -typedef enum { - /* output channels */ - AUDIO_CHANNEL_OUT_FRONT_LEFT = 0x1, - AUDIO_CHANNEL_OUT_FRONT_RIGHT = 0x2, - AUDIO_CHANNEL_OUT_FRONT_CENTER = 0x4, - AUDIO_CHANNEL_OUT_LOW_FREQUENCY = 0x8, - AUDIO_CHANNEL_OUT_BACK_LEFT = 0x10, - AUDIO_CHANNEL_OUT_BACK_RIGHT = 0x20, - AUDIO_CHANNEL_OUT_FRONT_LEFT_OF_CENTER = 0x40, - AUDIO_CHANNEL_OUT_FRONT_RIGHT_OF_CENTER = 0x80, - AUDIO_CHANNEL_OUT_BACK_CENTER = 0x100, - AUDIO_CHANNEL_OUT_SIDE_LEFT = 0x200, - AUDIO_CHANNEL_OUT_SIDE_RIGHT = 0x400, - AUDIO_CHANNEL_OUT_TOP_CENTER = 0x800, - AUDIO_CHANNEL_OUT_TOP_FRONT_LEFT = 0x1000, - AUDIO_CHANNEL_OUT_TOP_FRONT_CENTER = 0x2000, - AUDIO_CHANNEL_OUT_TOP_FRONT_RIGHT = 0x4000, - AUDIO_CHANNEL_OUT_TOP_BACK_LEFT = 0x8000, - AUDIO_CHANNEL_OUT_TOP_BACK_CENTER = 0x10000, - AUDIO_CHANNEL_OUT_TOP_BACK_RIGHT = 0x20000, - - AUDIO_CHANNEL_OUT_MONO = AUDIO_CHANNEL_OUT_FRONT_LEFT, - AUDIO_CHANNEL_OUT_STEREO = (AUDIO_CHANNEL_OUT_FRONT_LEFT | - AUDIO_CHANNEL_OUT_FRONT_RIGHT), - AUDIO_CHANNEL_OUT_QUAD = (AUDIO_CHANNEL_OUT_FRONT_LEFT | - AUDIO_CHANNEL_OUT_FRONT_RIGHT | - AUDIO_CHANNEL_OUT_BACK_LEFT | - AUDIO_CHANNEL_OUT_BACK_RIGHT), - AUDIO_CHANNEL_OUT_SURROUND = (AUDIO_CHANNEL_OUT_FRONT_LEFT | - AUDIO_CHANNEL_OUT_FRONT_RIGHT | - AUDIO_CHANNEL_OUT_FRONT_CENTER | - AUDIO_CHANNEL_OUT_BACK_CENTER), - AUDIO_CHANNEL_OUT_5POINT1 = (AUDIO_CHANNEL_OUT_FRONT_LEFT | - AUDIO_CHANNEL_OUT_FRONT_RIGHT | - AUDIO_CHANNEL_OUT_FRONT_CENTER | - AUDIO_CHANNEL_OUT_LOW_FREQUENCY | - AUDIO_CHANNEL_OUT_BACK_LEFT | - AUDIO_CHANNEL_OUT_BACK_RIGHT), - // matches the correct AudioFormat.CHANNEL_OUT_7POINT1_SURROUND definition for 7.1 - AUDIO_CHANNEL_OUT_7POINT1 = (AUDIO_CHANNEL_OUT_FRONT_LEFT | - AUDIO_CHANNEL_OUT_FRONT_RIGHT | - AUDIO_CHANNEL_OUT_FRONT_CENTER | - AUDIO_CHANNEL_OUT_LOW_FREQUENCY | - AUDIO_CHANNEL_OUT_BACK_LEFT | - AUDIO_CHANNEL_OUT_BACK_RIGHT | - AUDIO_CHANNEL_OUT_SIDE_LEFT | - AUDIO_CHANNEL_OUT_SIDE_RIGHT), - AUDIO_CHANNEL_OUT_ALL = (AUDIO_CHANNEL_OUT_FRONT_LEFT | - AUDIO_CHANNEL_OUT_FRONT_RIGHT | - AUDIO_CHANNEL_OUT_FRONT_CENTER | - AUDIO_CHANNEL_OUT_LOW_FREQUENCY | - AUDIO_CHANNEL_OUT_BACK_LEFT | - AUDIO_CHANNEL_OUT_BACK_RIGHT | - AUDIO_CHANNEL_OUT_FRONT_LEFT_OF_CENTER | - AUDIO_CHANNEL_OUT_FRONT_RIGHT_OF_CENTER | - AUDIO_CHANNEL_OUT_BACK_CENTER| - AUDIO_CHANNEL_OUT_SIDE_LEFT| - AUDIO_CHANNEL_OUT_SIDE_RIGHT| - AUDIO_CHANNEL_OUT_TOP_CENTER| - AUDIO_CHANNEL_OUT_TOP_FRONT_LEFT| - AUDIO_CHANNEL_OUT_TOP_FRONT_CENTER| - AUDIO_CHANNEL_OUT_TOP_FRONT_RIGHT| - AUDIO_CHANNEL_OUT_TOP_BACK_LEFT| - AUDIO_CHANNEL_OUT_TOP_BACK_CENTER| - AUDIO_CHANNEL_OUT_TOP_BACK_RIGHT), - - /* input channels */ - AUDIO_CHANNEL_IN_LEFT = 0x4, - AUDIO_CHANNEL_IN_RIGHT = 0x8, - AUDIO_CHANNEL_IN_FRONT = 0x10, - AUDIO_CHANNEL_IN_BACK = 0x20, - AUDIO_CHANNEL_IN_LEFT_PROCESSED = 0x40, - AUDIO_CHANNEL_IN_RIGHT_PROCESSED = 0x80, - AUDIO_CHANNEL_IN_FRONT_PROCESSED = 0x100, - AUDIO_CHANNEL_IN_BACK_PROCESSED = 0x200, - AUDIO_CHANNEL_IN_PRESSURE = 0x400, - AUDIO_CHANNEL_IN_X_AXIS = 0x800, - AUDIO_CHANNEL_IN_Y_AXIS = 0x1000, - AUDIO_CHANNEL_IN_Z_AXIS = 0x2000, - AUDIO_CHANNEL_IN_VOICE_UPLINK = 0x4000, - AUDIO_CHANNEL_IN_VOICE_DNLINK = 0x8000, - - AUDIO_CHANNEL_IN_MONO = AUDIO_CHANNEL_IN_FRONT, - AUDIO_CHANNEL_IN_STEREO = (AUDIO_CHANNEL_IN_LEFT | AUDIO_CHANNEL_IN_RIGHT), - AUDIO_CHANNEL_IN_ALL = (AUDIO_CHANNEL_IN_LEFT | - AUDIO_CHANNEL_IN_RIGHT | - AUDIO_CHANNEL_IN_FRONT | - AUDIO_CHANNEL_IN_BACK| - AUDIO_CHANNEL_IN_LEFT_PROCESSED | - AUDIO_CHANNEL_IN_RIGHT_PROCESSED | - AUDIO_CHANNEL_IN_FRONT_PROCESSED | - AUDIO_CHANNEL_IN_BACK_PROCESSED| - AUDIO_CHANNEL_IN_PRESSURE | - AUDIO_CHANNEL_IN_X_AXIS | - AUDIO_CHANNEL_IN_Y_AXIS | - AUDIO_CHANNEL_IN_Z_AXIS | - AUDIO_CHANNEL_IN_VOICE_UPLINK | - AUDIO_CHANNEL_IN_VOICE_DNLINK), -}; - -typedef uint32_t audio_channel_mask_t; - -typedef enum { - AUDIO_MODE_INVALID = -2, - AUDIO_MODE_CURRENT = -1, - AUDIO_MODE_NORMAL = 0, - AUDIO_MODE_RINGTONE = 1, - AUDIO_MODE_IN_CALL = 2, - AUDIO_MODE_IN_COMMUNICATION = 3, - - AUDIO_MODE_CNT, - AUDIO_MODE_MAX = AUDIO_MODE_CNT - 1, -} audio_mode_t; - -typedef enum { - AUDIO_IN_ACOUSTICS_AGC_ENABLE = 0x0001, - AUDIO_IN_ACOUSTICS_AGC_DISABLE = 0, - AUDIO_IN_ACOUSTICS_NS_ENABLE = 0x0002, - AUDIO_IN_ACOUSTICS_NS_DISABLE = 0, - AUDIO_IN_ACOUSTICS_TX_IIR_ENABLE = 0x0004, - AUDIO_IN_ACOUSTICS_TX_DISABLE = 0, -} audio_in_acoustics_t; - -typedef enum { - /* output devices */ - AUDIO_DEVICE_OUT_EARPIECE = 0x1, - AUDIO_DEVICE_OUT_SPEAKER = 0x2, - AUDIO_DEVICE_OUT_WIRED_HEADSET = 0x4, - AUDIO_DEVICE_OUT_WIRED_HEADPHONE = 0x8, - AUDIO_DEVICE_OUT_BLUETOOTH_SCO = 0x10, - AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET = 0x20, - AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT = 0x40, - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP = 0x80, - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES = 0x100, - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER = 0x200, - AUDIO_DEVICE_OUT_AUX_DIGITAL = 0x400, - AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET = 0x800, - AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET = 0x1000, - AUDIO_DEVICE_OUT_USB_ACCESSORY = 0x2000, - AUDIO_DEVICE_OUT_USB_DEVICE = 0x4000, - AUDIO_DEVICE_OUT_DEFAULT = 0x8000, - AUDIO_DEVICE_OUT_ALL = (AUDIO_DEVICE_OUT_EARPIECE | - AUDIO_DEVICE_OUT_SPEAKER | - AUDIO_DEVICE_OUT_WIRED_HEADSET | - AUDIO_DEVICE_OUT_WIRED_HEADPHONE | - AUDIO_DEVICE_OUT_BLUETOOTH_SCO | - AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET | - AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT | - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP | - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES | - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER | - AUDIO_DEVICE_OUT_AUX_DIGITAL | - AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET | - AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET | - AUDIO_DEVICE_OUT_USB_ACCESSORY | - AUDIO_DEVICE_OUT_USB_DEVICE | - AUDIO_DEVICE_OUT_DEFAULT), - AUDIO_DEVICE_OUT_ALL_A2DP = (AUDIO_DEVICE_OUT_BLUETOOTH_A2DP | - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES | - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER), - AUDIO_DEVICE_OUT_ALL_SCO = (AUDIO_DEVICE_OUT_BLUETOOTH_SCO | - AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET | - AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT), - AUDIO_DEVICE_OUT_ALL_USB = (AUDIO_DEVICE_OUT_USB_ACCESSORY | - AUDIO_DEVICE_OUT_USB_DEVICE), - - /* input devices */ - AUDIO_DEVICE_IN_COMMUNICATION = 0x10000, - AUDIO_DEVICE_IN_AMBIENT = 0x20000, - AUDIO_DEVICE_IN_BUILTIN_MIC = 0x40000, - AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET = 0x80000, - AUDIO_DEVICE_IN_WIRED_HEADSET = 0x100000, - AUDIO_DEVICE_IN_AUX_DIGITAL = 0x200000, - AUDIO_DEVICE_IN_VOICE_CALL = 0x400000, - AUDIO_DEVICE_IN_BACK_MIC = 0x800000, - AUDIO_DEVICE_IN_DEFAULT = 0x80000000, - - AUDIO_DEVICE_IN_ALL = (AUDIO_DEVICE_IN_COMMUNICATION | - AUDIO_DEVICE_IN_AMBIENT | - AUDIO_DEVICE_IN_BUILTIN_MIC | - AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET | - AUDIO_DEVICE_IN_WIRED_HEADSET | - AUDIO_DEVICE_IN_AUX_DIGITAL | - AUDIO_DEVICE_IN_VOICE_CALL | - AUDIO_DEVICE_IN_BACK_MIC | - AUDIO_DEVICE_IN_DEFAULT), - AUDIO_DEVICE_IN_ALL_SCO = AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET, -} audio_devices_t; - -/* the audio output flags serve two purposes: - * - when an AudioTrack is created they indicate a "wish" to be connected to an - * output stream with attributes corresponding to the specified flags - * - when present in an output profile descriptor listed for a particular audio - * hardware module, they indicate that an output stream can be opened that - * supports the attributes indicated by the flags. - * the audio policy manager will try to match the flags in the request - * (when getOuput() is called) to an available output stream. - */ -typedef enum { - AUDIO_OUTPUT_FLAG_NONE = 0x0, // no attributes - AUDIO_OUTPUT_FLAG_DIRECT = 0x1, // this output directly connects a track - // to one output stream: no software mixer - AUDIO_OUTPUT_FLAG_PRIMARY = 0x2, // this output is the primary output of - // the device. It is unique and must be - // present. It is opened by default and - // receives routing, audio mode and volume - // controls related to voice calls. - AUDIO_OUTPUT_FLAG_FAST = 0x4, // output supports "fast tracks", - // defined elsewhere - AUDIO_OUTPUT_FLAG_DEEP_BUFFER = 0x8 // use deep audio buffers -} audio_output_flags_t; - -static inline bool audio_is_output_device(audio_devices_t device) -{ - if ((popcount(device) == 1) && ((device & ~AUDIO_DEVICE_OUT_ALL) == 0)) - return true; - else - return false; -} - -static inline bool audio_is_input_device(audio_devices_t device) -{ - if ((popcount(device) == 1) && ((device & ~AUDIO_DEVICE_IN_ALL) == 0)) - return true; - else - return false; -} - -static inline bool audio_is_a2dp_device(audio_devices_t device) -{ - if ((popcount(device) == 1) && (device & AUDIO_DEVICE_OUT_ALL_A2DP)) - return true; - else - return false; -} - -static inline bool audio_is_bluetooth_sco_device(audio_devices_t device) -{ - if ((popcount(device) == 1) && (device & (AUDIO_DEVICE_OUT_ALL_SCO | - AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET))) - return true; - else - return false; -} - -static inline bool audio_is_usb_device(audio_devices_t device) -{ - if ((popcount(device) == 1) && (device & AUDIO_DEVICE_OUT_ALL_USB)) - return true; - else - return false; -} - -static inline bool audio_is_input_channel(uint32_t channel) -{ - if ((channel & ~AUDIO_CHANNEL_IN_ALL) == 0) - return true; - else - return false; -} - -static inline bool audio_is_output_channel(uint32_t channel) -{ - if ((channel & ~AUDIO_CHANNEL_OUT_ALL) == 0) - return true; - else - return false; -} - -/* Derive an output channel mask from a channel count. - * This is to be used when the content channel mask is unknown. The 1, 2, 4, 5, 6, 7 and 8 channel - * cases are mapped to the standard game/home-theater layouts, but note that 4 is mapped to quad, - * and not stereo + FC + mono surround. A channel count of 3 is arbitrarily mapped to stereo + FC - * for continuity with stereo. - * Returns the matching channel mask, or 0 if the number of channels exceeds that of the - * configurations for which a default channel mask is defined. - */ -static inline audio_channel_mask_t audio_channel_out_mask_from_count(uint32_t channel_count) -{ - switch(channel_count) { - case 1: - return AUDIO_CHANNEL_OUT_MONO; - case 2: - return AUDIO_CHANNEL_OUT_STEREO; - case 3: - return (AUDIO_CHANNEL_OUT_STEREO | AUDIO_CHANNEL_OUT_FRONT_CENTER); - case 4: // 4.0 - return AUDIO_CHANNEL_OUT_QUAD; - case 5: // 5.0 - return (AUDIO_CHANNEL_OUT_QUAD | AUDIO_CHANNEL_OUT_FRONT_CENTER); - case 6: // 5.1 - return AUDIO_CHANNEL_OUT_5POINT1; - case 7: // 6.1 - return (AUDIO_CHANNEL_OUT_5POINT1 | AUDIO_CHANNEL_OUT_BACK_CENTER); - case 8: - return AUDIO_CHANNEL_OUT_7POINT1; - default: - return 0; - } -} - -/* Similar to above, but for input. Currently handles only mono and stereo. */ -static inline audio_channel_mask_t audio_channel_in_mask_from_count(uint32_t channel_count) -{ - switch (channel_count) { - case 1: - return AUDIO_CHANNEL_IN_MONO; - case 2: - return AUDIO_CHANNEL_IN_STEREO; - default: - return 0; - } -} - -static inline bool audio_is_valid_format(audio_format_t format) -{ - switch (format & AUDIO_FORMAT_MAIN_MASK) { - case AUDIO_FORMAT_PCM: - if (format != AUDIO_FORMAT_PCM_16_BIT && - format != AUDIO_FORMAT_PCM_8_BIT) { - return false; - } - case AUDIO_FORMAT_MP3: - case AUDIO_FORMAT_AMR_NB: - case AUDIO_FORMAT_AMR_WB: - case AUDIO_FORMAT_AAC: - case AUDIO_FORMAT_HE_AAC_V1: - case AUDIO_FORMAT_HE_AAC_V2: - case AUDIO_FORMAT_VORBIS: - return true; - default: - return false; - } -} - -static inline bool audio_is_linear_pcm(audio_format_t format) -{ - return ((format & AUDIO_FORMAT_MAIN_MASK) == AUDIO_FORMAT_PCM); -} - -static inline size_t audio_bytes_per_sample(audio_format_t format) -{ - size_t size = 0; - - switch (format) { - case AUDIO_FORMAT_PCM_32_BIT: - case AUDIO_FORMAT_PCM_8_24_BIT: - size = sizeof(int32_t); - break; - case AUDIO_FORMAT_PCM_16_BIT: - size = sizeof(int16_t); - break; - case AUDIO_FORMAT_PCM_8_BIT: - size = sizeof(uint8_t); - break; - default: - break; - } - return size; -} - -__END_DECLS - -#endif // ANDROID_AUDIO_CORE_H diff --git a/external/android/include/16/system/core/include/system/audio_policy.h b/external/android/include/16/system/core/include/system/audio_policy.h deleted file mode 100644 index 91b8e9c..0000000 --- a/external/android/include/16/system/core/include/system/audio_policy.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (C) 2011 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_AUDIO_POLICY_CORE_H -#define ANDROID_AUDIO_POLICY_CORE_H - -#include -#include -#include - -#include - -__BEGIN_DECLS - -/* The enums were moved here mostly from - * frameworks/base/include/media/AudioSystem.h - */ - -/* device categories used for audio_policy->set_force_use() */ -typedef enum { - AUDIO_POLICY_FORCE_NONE, - AUDIO_POLICY_FORCE_SPEAKER, - AUDIO_POLICY_FORCE_HEADPHONES, - AUDIO_POLICY_FORCE_BT_SCO, - AUDIO_POLICY_FORCE_BT_A2DP, - AUDIO_POLICY_FORCE_WIRED_ACCESSORY, - AUDIO_POLICY_FORCE_BT_CAR_DOCK, - AUDIO_POLICY_FORCE_BT_DESK_DOCK, - AUDIO_POLICY_FORCE_ANALOG_DOCK, - AUDIO_POLICY_FORCE_DIGITAL_DOCK, - AUDIO_POLICY_FORCE_NO_BT_A2DP, /* A2DP sink is not preferred to speaker or wired HS */ - - AUDIO_POLICY_FORCE_CFG_CNT, - AUDIO_POLICY_FORCE_CFG_MAX = AUDIO_POLICY_FORCE_CFG_CNT - 1, - - AUDIO_POLICY_FORCE_DEFAULT = AUDIO_POLICY_FORCE_NONE, -} audio_policy_forced_cfg_t; - -/* usages used for audio_policy->set_force_use() */ -typedef enum { - AUDIO_POLICY_FORCE_FOR_COMMUNICATION, - AUDIO_POLICY_FORCE_FOR_MEDIA, - AUDIO_POLICY_FORCE_FOR_RECORD, - AUDIO_POLICY_FORCE_FOR_DOCK, - - AUDIO_POLICY_FORCE_USE_CNT, - AUDIO_POLICY_FORCE_USE_MAX = AUDIO_POLICY_FORCE_USE_CNT - 1, -} audio_policy_force_use_t; - -/* device connection states used for audio_policy->set_device_connection_state() - */ -typedef enum { - AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE, - AUDIO_POLICY_DEVICE_STATE_AVAILABLE, - - AUDIO_POLICY_DEVICE_STATE_CNT, - AUDIO_POLICY_DEVICE_STATE_MAX = AUDIO_POLICY_DEVICE_STATE_CNT - 1, -} audio_policy_dev_state_t; - -typedef enum { - /* Used to generate a tone to notify the user of a - * notification/alarm/ringtone while they are in a call. */ - AUDIO_POLICY_TONE_IN_CALL_NOTIFICATION = 0, - - AUDIO_POLICY_TONE_CNT, - AUDIO_POLICY_TONE_MAX = AUDIO_POLICY_TONE_CNT - 1, -} audio_policy_tone_t; - - -static inline bool audio_is_low_visibility(audio_stream_type_t stream) -{ - switch (stream) { - case AUDIO_STREAM_SYSTEM: - case AUDIO_STREAM_NOTIFICATION: - case AUDIO_STREAM_RING: - return true; - default: - return false; - } -} - - -__END_DECLS - -#endif // ANDROID_AUDIO_POLICY_CORE_H diff --git a/external/android/include/16/system/core/include/system/camera.h b/external/android/include/16/system/core/include/system/camera.h deleted file mode 100644 index e4cacc5..0000000 --- a/external/android/include/16/system/core/include/system/camera.h +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Copyright (C) 2011 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 SYSTEM_CORE_INCLUDE_ANDROID_CAMERA_H -#define SYSTEM_CORE_INCLUDE_ANDROID_CAMERA_H - -#include -#include -#include -#include -#include -#include - -__BEGIN_DECLS - -/** - * A set of bit masks for specifying how the received preview frames are - * handled before the previewCallback() call. - * - * The least significant 3 bits of an "int" value are used for this purpose: - * - * ..... 0 0 0 - * ^ ^ ^ - * | | |---------> determine whether the callback is enabled or not - * | |-----------> determine whether the callback is one-shot or not - * |-------------> determine whether the frame is copied out or not - * - * WARNING: When a frame is sent directly without copying, it is the frame - * receiver's responsiblity to make sure that the frame data won't get - * corrupted by subsequent preview frames filled by the camera. This flag is - * recommended only when copying out data brings significant performance price - * and the handling/processing of the received frame data is always faster than - * the preview frame rate so that data corruption won't occur. - * - * For instance, - * 1. 0x00 disables the callback. In this case, copy out and one shot bits - * are ignored. - * 2. 0x01 enables a callback without copying out the received frames. A - * typical use case is the Camcorder application to avoid making costly - * frame copies. - * 3. 0x05 is enabling a callback with frame copied out repeatedly. A typical - * use case is the Camera application. - * 4. 0x07 is enabling a callback with frame copied out only once. A typical - * use case is the Barcode scanner application. - */ - -enum { - CAMERA_FRAME_CALLBACK_FLAG_ENABLE_MASK = 0x01, - CAMERA_FRAME_CALLBACK_FLAG_ONE_SHOT_MASK = 0x02, - CAMERA_FRAME_CALLBACK_FLAG_COPY_OUT_MASK = 0x04, - /** Typical use cases */ - CAMERA_FRAME_CALLBACK_FLAG_NOOP = 0x00, - CAMERA_FRAME_CALLBACK_FLAG_CAMCORDER = 0x01, - CAMERA_FRAME_CALLBACK_FLAG_CAMERA = 0x05, - CAMERA_FRAME_CALLBACK_FLAG_BARCODE_SCANNER = 0x07 -}; - -/** msgType in notifyCallback and dataCallback functions */ -enum { - CAMERA_MSG_ERROR = 0x0001, // notifyCallback - CAMERA_MSG_SHUTTER = 0x0002, // notifyCallback - CAMERA_MSG_FOCUS = 0x0004, // notifyCallback - CAMERA_MSG_ZOOM = 0x0008, // notifyCallback - CAMERA_MSG_PREVIEW_FRAME = 0x0010, // dataCallback - CAMERA_MSG_VIDEO_FRAME = 0x0020, // data_timestamp_callback - CAMERA_MSG_POSTVIEW_FRAME = 0x0040, // dataCallback - CAMERA_MSG_RAW_IMAGE = 0x0080, // dataCallback - CAMERA_MSG_COMPRESSED_IMAGE = 0x0100, // dataCallback - CAMERA_MSG_RAW_IMAGE_NOTIFY = 0x0200, // dataCallback - // Preview frame metadata. This can be combined with - // CAMERA_MSG_PREVIEW_FRAME in dataCallback. For example, the apps can - // request FRAME and METADATA. Or the apps can request only FRAME or only - // METADATA. - CAMERA_MSG_PREVIEW_METADATA = 0x0400, // dataCallback - // Notify on autofocus start and stop. This is useful in continuous - // autofocus - FOCUS_MODE_CONTINUOUS_VIDEO and FOCUS_MODE_CONTINUOUS_PICTURE. - CAMERA_MSG_FOCUS_MOVE = 0x0800, // notifyCallback - CAMERA_MSG_ALL_MSGS = 0xFFFF -}; - -/** cmdType in sendCommand functions */ -enum { - CAMERA_CMD_START_SMOOTH_ZOOM = 1, - CAMERA_CMD_STOP_SMOOTH_ZOOM = 2, - - /** - * Set the clockwise rotation of preview display (setPreviewDisplay) in - * degrees. This affects the preview frames and the picture displayed after - * snapshot. This method is useful for portrait mode applications. Note - * that preview display of front-facing cameras is flipped horizontally - * before the rotation, that is, the image is reflected along the central - * vertical axis of the camera sensor. So the users can see themselves as - * looking into a mirror. - * - * This does not affect the order of byte array of - * CAMERA_MSG_PREVIEW_FRAME, CAMERA_MSG_VIDEO_FRAME, - * CAMERA_MSG_POSTVIEW_FRAME, CAMERA_MSG_RAW_IMAGE, or - * CAMERA_MSG_COMPRESSED_IMAGE. This is allowed to be set during preview - * since API level 14. - */ - CAMERA_CMD_SET_DISPLAY_ORIENTATION = 3, - - /** - * cmdType to disable/enable shutter sound. In sendCommand passing arg1 = - * 0 will disable, while passing arg1 = 1 will enable the shutter sound. - */ - CAMERA_CMD_ENABLE_SHUTTER_SOUND = 4, - - /* cmdType to play recording sound */ - CAMERA_CMD_PLAY_RECORDING_SOUND = 5, - - /** - * Start the face detection. This should be called after preview is started. - * The camera will notify the listener of CAMERA_MSG_FACE and the detected - * faces in the preview frame. The detected faces may be the same as the - * previous ones. Apps should call CAMERA_CMD_STOP_FACE_DETECTION to stop - * the face detection. This method is supported if CameraParameters - * KEY_MAX_NUM_HW_DETECTED_FACES or KEY_MAX_NUM_SW_DETECTED_FACES is - * bigger than 0. Hardware and software face detection should not be running - * at the same time. If the face detection has started, apps should not send - * this again. - * - * In hardware face detection mode, CameraParameters KEY_WHITE_BALANCE, - * KEY_FOCUS_AREAS and KEY_METERING_AREAS have no effect. - * - * arg1 is the face detection type. It can be CAMERA_FACE_DETECTION_HW or - * CAMERA_FACE_DETECTION_SW. If the type of face detection requested is not - * supported, the HAL must return BAD_VALUE. - */ - CAMERA_CMD_START_FACE_DETECTION = 6, - - /** - * Stop the face detection. - */ - CAMERA_CMD_STOP_FACE_DETECTION = 7, - - /** - * Enable/disable focus move callback (CAMERA_MSG_FOCUS_MOVE). Passing - * arg1 = 0 will disable, while passing arg1 = 1 will enable the callback. - */ - CAMERA_CMD_ENABLE_FOCUS_MOVE_MSG = 8, - - /** - * Ping camera service to see if camera hardware is released. - * - * When any camera method returns error, the client can use ping command - * to see if the camera has been taken away by other clients. If the result - * is NO_ERROR, it means the camera hardware is not released. If the result - * is not NO_ERROR, the camera has been released and the existing client - * can silently finish itself or show a dialog. - */ - CAMERA_CMD_PING = 9, -}; - -/** camera fatal errors */ -enum { - CAMERA_ERROR_UNKNOWN = 1, - /** - * Camera was released because another client has connected to the camera. - * The original client should call Camera::disconnect immediately after - * getting this notification. Otherwise, the camera will be released by - * camera service in a short time. The client should not call any method - * (except disconnect and sending CAMERA_CMD_PING) after getting this. - */ - CAMERA_ERROR_RELEASED = 2, - CAMERA_ERROR_SERVER_DIED = 100 -}; - -enum { - /** The facing of the camera is opposite to that of the screen. */ - CAMERA_FACING_BACK = 0, - /** The facing of the camera is the same as that of the screen. */ - CAMERA_FACING_FRONT = 1 -}; - -enum { - /** Hardware face detection. It does not use much CPU. */ - CAMERA_FACE_DETECTION_HW = 0, - /** - * Software face detection. It uses some CPU. Applications must use - * Camera.setPreviewTexture for preview in this mode. - */ - CAMERA_FACE_DETECTION_SW = 1 -}; - -/** - * The information of a face from camera face detection. - */ -typedef struct camera_face { - /** - * Bounds of the face [left, top, right, bottom]. (-1000, -1000) represents - * the top-left of the camera field of view, and (1000, 1000) represents the - * bottom-right of the field of view. The width and height cannot be 0 or - * negative. This is supported by both hardware and software face detection. - * - * The direction is relative to the sensor orientation, that is, what the - * sensor sees. The direction is not affected by the rotation or mirroring - * of CAMERA_CMD_SET_DISPLAY_ORIENTATION. - */ - int32_t rect[4]; - - /** - * The confidence level of the face. The range is 1 to 100. 100 is the - * highest confidence. This is supported by both hardware and software - * face detection. - */ - int32_t score; - - /** - * An unique id per face while the face is visible to the tracker. If - * the face leaves the field-of-view and comes back, it will get a new - * id. If the value is 0, id is not supported. - */ - int32_t id; - - /** - * The coordinates of the center of the left eye. The range is -1000 to - * 1000. -2000, -2000 if this is not supported. - */ - int32_t left_eye[2]; - - /** - * The coordinates of the center of the right eye. The range is -1000 to - * 1000. -2000, -2000 if this is not supported. - */ - int32_t right_eye[2]; - - /** - * The coordinates of the center of the mouth. The range is -1000 to 1000. - * -2000, -2000 if this is not supported. - */ - int32_t mouth[2]; - -} camera_face_t; - -/** - * The metadata of the frame data. - */ -typedef struct camera_frame_metadata { - /** - * The number of detected faces in the frame. - */ - int32_t number_of_faces; - - /** - * An array of the detected faces. The length is number_of_faces. - */ - camera_face_t *faces; -} camera_frame_metadata_t; - -__END_DECLS - -#endif /* SYSTEM_CORE_INCLUDE_ANDROID_CAMERA_H */ diff --git a/external/android/include/16/system/core/include/system/graphics.h b/external/android/include/16/system/core/include/system/graphics.h deleted file mode 100644 index 24e2bfb..0000000 --- a/external/android/include/16/system/core/include/system/graphics.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (C) 2011 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 SYSTEM_CORE_INCLUDE_ANDROID_GRAPHICS_H -#define SYSTEM_CORE_INCLUDE_ANDROID_GRAPHICS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * If the HAL needs to create service threads to handle graphics related - * tasks, these threads need to run at HAL_PRIORITY_URGENT_DISPLAY priority - * if they can block the main rendering thread in any way. - * - * the priority of the current thread can be set with: - * - * #include - * setpriority(PRIO_PROCESS, 0, HAL_PRIORITY_URGENT_DISPLAY); - * - */ - -#define HAL_PRIORITY_URGENT_DISPLAY (-8) - -/** - * pixel format definitions - */ - -enum { - HAL_PIXEL_FORMAT_RGBA_8888 = 1, - HAL_PIXEL_FORMAT_RGBX_8888 = 2, - HAL_PIXEL_FORMAT_RGB_888 = 3, - HAL_PIXEL_FORMAT_RGB_565 = 4, - HAL_PIXEL_FORMAT_BGRA_8888 = 5, - HAL_PIXEL_FORMAT_RGBA_5551 = 6, - HAL_PIXEL_FORMAT_RGBA_4444 = 7, - - /* 0x8 - 0xFF range unavailable */ - - /* - * 0x100 - 0x1FF - * - * This range is reserved for pixel formats that are specific to the HAL - * implementation. Implementations can use any value in this range to - * communicate video pixel formats between their HAL modules. These formats - * must not have an alpha channel. Additionally, an EGLimage created from a - * gralloc buffer of one of these formats must be supported for use with the - * GL_OES_EGL_image_external OpenGL ES extension. - */ - - /* - * Android YUV format: - * - * This format is exposed outside of the HAL to software decoders and - * applications. EGLImageKHR must support it in conjunction with the - * OES_EGL_image_external extension. - * - * YV12 is a 4:2:0 YCrCb planar format comprised of a WxH Y plane followed - * by (W/2) x (H/2) Cr and Cb planes. - * - * This format assumes - * - an even width - * - an even height - * - a horizontal stride multiple of 16 pixels - * - a vertical stride equal to the height - * - * y_size = stride * height - * c_stride = ALIGN(stride/2, 16) - * c_size = c_stride * height/2 - * size = y_size + c_size * 2 - * cr_offset = y_size - * cb_offset = y_size + c_size - * - */ - HAL_PIXEL_FORMAT_YV12 = 0x32315659, // YCrCb 4:2:0 Planar - - /* - * Android RAW sensor format: - * - * This format is exposed outside of the HAL to applications. - * - * RAW_SENSOR is a single-channel 16-bit format, typically representing raw - * Bayer-pattern images from an image sensor, with minimal processing. - * - * The exact pixel layout of the data in the buffer is sensor-dependent, and - * needs to be queried from the camera device. - * - * Generally, not all 16 bits are used; more common values are 10 or 12 - * bits. All parameters to interpret the raw data (black and white points, - * color space, etc) must be queried from the camera device. - * - * This format assumes - * - an even width - * - an even height - * - a horizontal stride multiple of 16 pixels (32 bytes). - */ - HAL_PIXEL_FORMAT_RAW_SENSOR = 0x20, - - /* Legacy formats (deprecated), used by ImageFormat.java */ - HAL_PIXEL_FORMAT_YCbCr_422_SP = 0x10, // NV16 - HAL_PIXEL_FORMAT_YCrCb_420_SP = 0x11, // NV21 - HAL_PIXEL_FORMAT_YCbCr_422_I = 0x14, // YUY2 -}; - - -/** - * Transformation definitions - * - * IMPORTANT NOTE: - * HAL_TRANSFORM_ROT_90 is applied CLOCKWISE and AFTER HAL_TRANSFORM_FLIP_{H|V}. - * - */ - -enum { - /* flip source image horizontally (around the vertical axis) */ - HAL_TRANSFORM_FLIP_H = 0x01, - /* flip source image vertically (around the horizontal axis)*/ - HAL_TRANSFORM_FLIP_V = 0x02, - /* rotate source image 90 degrees clockwise */ - HAL_TRANSFORM_ROT_90 = 0x04, - /* rotate source image 180 degrees */ - HAL_TRANSFORM_ROT_180 = 0x03, - /* rotate source image 270 degrees clockwise */ - HAL_TRANSFORM_ROT_270 = 0x07, -}; - -#ifdef __cplusplus -} -#endif - -#endif /* SYSTEM_CORE_INCLUDE_ANDROID_GRAPHICS_H */ diff --git a/external/android/include/16/system/core/include/system/window.h b/external/android/include/16/system/core/include/system/window.h deleted file mode 100644 index 8e00bcd..0000000 --- a/external/android/include/16/system/core/include/system/window.h +++ /dev/null @@ -1,723 +0,0 @@ -/* - * Copyright (C) 2011 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 SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H -#define SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H - -#include -#include -#include -#include -#include - -__BEGIN_DECLS - -/*****************************************************************************/ - -#define ANDROID_NATIVE_MAKE_CONSTANT(a,b,c,d) \ - (((unsigned)(a)<<24)|((unsigned)(b)<<16)|((unsigned)(c)<<8)|(unsigned)(d)) - -#define ANDROID_NATIVE_WINDOW_MAGIC \ - ANDROID_NATIVE_MAKE_CONSTANT('_','w','n','d') - -#define ANDROID_NATIVE_BUFFER_MAGIC \ - ANDROID_NATIVE_MAKE_CONSTANT('_','b','f','r') - -// --------------------------------------------------------------------------- - -typedef const native_handle_t* buffer_handle_t; - -// --------------------------------------------------------------------------- - -typedef struct android_native_rect_t -{ - int32_t left; - int32_t top; - int32_t right; - int32_t bottom; -} android_native_rect_t; - -// --------------------------------------------------------------------------- - -typedef struct android_native_base_t -{ - /* a magic value defined by the actual EGL native type */ - int magic; - - /* the sizeof() of the actual EGL native type */ - int version; - - void* reserved[4]; - - /* reference-counting interface */ - void (*incRef)(struct android_native_base_t* base); - void (*decRef)(struct android_native_base_t* base); -} android_native_base_t; - -typedef struct ANativeWindowBuffer -{ -#ifdef __cplusplus - ANativeWindowBuffer() { - common.magic = ANDROID_NATIVE_BUFFER_MAGIC; - common.version = sizeof(ANativeWindowBuffer); - memset(common.reserved, 0, sizeof(common.reserved)); - } - - // Implement the methods that sp expects so that it - // can be used to automatically refcount ANativeWindowBuffer's. - void incStrong(const void* id) const { - common.incRef(const_cast(&common)); - } - void decStrong(const void* id) const { - common.decRef(const_cast(&common)); - } -#endif - - struct android_native_base_t common; - - int width; - int height; - int stride; - int format; - int usage; - - void* reserved[2]; - - buffer_handle_t handle; - - void* reserved_proc[8]; -} ANativeWindowBuffer_t; - -// Old typedef for backwards compatibility. -typedef ANativeWindowBuffer_t android_native_buffer_t; - -// --------------------------------------------------------------------------- - -/* attributes queriable with query() */ -enum { - NATIVE_WINDOW_WIDTH = 0, - NATIVE_WINDOW_HEIGHT = 1, - NATIVE_WINDOW_FORMAT = 2, - - /* The minimum number of buffers that must remain un-dequeued after a buffer - * has been queued. This value applies only if set_buffer_count was used to - * override the number of buffers and if a buffer has since been queued. - * Users of the set_buffer_count ANativeWindow method should query this - * value before calling set_buffer_count. If it is necessary to have N - * buffers simultaneously dequeued as part of the steady-state operation, - * and this query returns M then N+M buffers should be requested via - * native_window_set_buffer_count. - * - * Note that this value does NOT apply until a single buffer has been - * queued. In particular this means that it is possible to: - * - * 1. Query M = min undequeued buffers - * 2. Set the buffer count to N + M - * 3. Dequeue all N + M buffers - * 4. Cancel M buffers - * 5. Queue, dequeue, queue, dequeue, ad infinitum - */ - NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS = 3, - - /* Check whether queueBuffer operations on the ANativeWindow send the buffer - * to the window compositor. The query sets the returned 'value' argument - * to 1 if the ANativeWindow DOES send queued buffers directly to the window - * compositor and 0 if the buffers do not go directly to the window - * compositor. - * - * This can be used to determine whether protected buffer content should be - * sent to the ANativeWindow. Note, however, that a result of 1 does NOT - * indicate that queued buffers will be protected from applications or users - * capturing their contents. If that behavior is desired then some other - * mechanism (e.g. the GRALLOC_USAGE_PROTECTED flag) should be used in - * conjunction with this query. - */ - NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER = 4, - - /* Get the concrete type of a ANativeWindow. See below for the list of - * possible return values. - * - * This query should not be used outside the Android framework and will - * likely be removed in the near future. - */ - NATIVE_WINDOW_CONCRETE_TYPE = 5, - - - /* - * Default width and height of ANativeWindow buffers, these are the - * dimensions of the window buffers irrespective of the - * NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS call and match the native window - * size unless overridden by NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS. - */ - NATIVE_WINDOW_DEFAULT_WIDTH = 6, - NATIVE_WINDOW_DEFAULT_HEIGHT = 7, - - /* - * transformation that will most-likely be applied to buffers. This is only - * a hint, the actual transformation applied might be different. - * - * INTENDED USE: - * - * The transform hint can be used by a producer, for instance the GLES - * driver, to pre-rotate the rendering such that the final transformation - * in the composer is identity. This can be very useful when used in - * conjunction with the h/w composer HAL, in situations where it - * cannot handle arbitrary rotations. - * - * 1. Before dequeuing a buffer, the GL driver (or any other ANW client) - * queries the ANW for NATIVE_WINDOW_TRANSFORM_HINT. - * - * 2. The GL driver overrides the width and height of the ANW to - * account for NATIVE_WINDOW_TRANSFORM_HINT. This is done by querying - * NATIVE_WINDOW_DEFAULT_{WIDTH | HEIGHT}, swapping the dimensions - * according to NATIVE_WINDOW_TRANSFORM_HINT and calling - * native_window_set_buffers_dimensions(). - * - * 3. The GL driver dequeues a buffer of the new pre-rotated size. - * - * 4. The GL driver renders to the buffer such that the image is - * already transformed, that is applying NATIVE_WINDOW_TRANSFORM_HINT - * to the rendering. - * - * 5. The GL driver calls native_window_set_transform to apply - * inverse transformation to the buffer it just rendered. - * In order to do this, the GL driver needs - * to calculate the inverse of NATIVE_WINDOW_TRANSFORM_HINT, this is - * done easily: - * - * int hintTransform, inverseTransform; - * query(..., NATIVE_WINDOW_TRANSFORM_HINT, &hintTransform); - * inverseTransform = hintTransform; - * if (hintTransform & HAL_TRANSFORM_ROT_90) - * inverseTransform ^= HAL_TRANSFORM_ROT_180; - * - * - * 6. The GL driver queues the pre-transformed buffer. - * - * 7. The composer combines the buffer transform with the display - * transform. If the buffer transform happens to cancel out the - * display transform then no rotation is needed. - * - */ - NATIVE_WINDOW_TRANSFORM_HINT = 8, - - /* - * Boolean that indicates whether the consumer is running more than - * one buffer behind the producer. - */ - NATIVE_WINDOW_CONSUMER_RUNNING_BEHIND = 9 -}; - -/* Valid operations for the (*perform)() hook. - * - * Values marked as 'deprecated' are supported, but have been superceded by - * other functionality. - * - * Values marked as 'private' should be considered private to the framework. - * HAL implementation code with access to an ANativeWindow should not use these, - * as it may not interact properly with the framework's use of the - * ANativeWindow. - */ -enum { - NATIVE_WINDOW_SET_USAGE = 0, - NATIVE_WINDOW_CONNECT = 1, /* deprecated */ - NATIVE_WINDOW_DISCONNECT = 2, /* deprecated */ - NATIVE_WINDOW_SET_CROP = 3, /* private */ - NATIVE_WINDOW_SET_BUFFER_COUNT = 4, - NATIVE_WINDOW_SET_BUFFERS_GEOMETRY = 5, /* deprecated */ - NATIVE_WINDOW_SET_BUFFERS_TRANSFORM = 6, - NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP = 7, - NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS = 8, - NATIVE_WINDOW_SET_BUFFERS_FORMAT = 9, - NATIVE_WINDOW_SET_SCALING_MODE = 10, /* private */ - NATIVE_WINDOW_LOCK = 11, /* private */ - NATIVE_WINDOW_UNLOCK_AND_POST = 12, /* private */ - NATIVE_WINDOW_API_CONNECT = 13, /* private */ - NATIVE_WINDOW_API_DISCONNECT = 14, /* private */ - NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS = 15, /* private */ - NATIVE_WINDOW_SET_POST_TRANSFORM_CROP = 16, /* private */ -}; - -/* parameter for NATIVE_WINDOW_[API_][DIS]CONNECT */ -enum { - /* Buffers will be queued by EGL via eglSwapBuffers after being filled using - * OpenGL ES. - */ - NATIVE_WINDOW_API_EGL = 1, - - /* Buffers will be queued after being filled using the CPU - */ - NATIVE_WINDOW_API_CPU = 2, - - /* Buffers will be queued by Stagefright after being filled by a video - * decoder. The video decoder can either be a software or hardware decoder. - */ - NATIVE_WINDOW_API_MEDIA = 3, - - /* Buffers will be queued by the the camera HAL. - */ - NATIVE_WINDOW_API_CAMERA = 4, -}; - -/* parameter for NATIVE_WINDOW_SET_BUFFERS_TRANSFORM */ -enum { - /* flip source image horizontally */ - NATIVE_WINDOW_TRANSFORM_FLIP_H = HAL_TRANSFORM_FLIP_H , - /* flip source image vertically */ - NATIVE_WINDOW_TRANSFORM_FLIP_V = HAL_TRANSFORM_FLIP_V, - /* rotate source image 90 degrees clock-wise */ - NATIVE_WINDOW_TRANSFORM_ROT_90 = HAL_TRANSFORM_ROT_90, - /* rotate source image 180 degrees */ - NATIVE_WINDOW_TRANSFORM_ROT_180 = HAL_TRANSFORM_ROT_180, - /* rotate source image 270 degrees clock-wise */ - NATIVE_WINDOW_TRANSFORM_ROT_270 = HAL_TRANSFORM_ROT_270, -}; - -/* parameter for NATIVE_WINDOW_SET_SCALING_MODE */ -enum { - /* the window content is not updated (frozen) until a buffer of - * the window size is received (enqueued) - */ - NATIVE_WINDOW_SCALING_MODE_FREEZE = 0, - /* the buffer is scaled in both dimensions to match the window size */ - NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW = 1, - /* the buffer is scaled uniformly such that the smaller dimension - * of the buffer matches the window size (cropping in the process) - */ - NATIVE_WINDOW_SCALING_MODE_SCALE_CROP = 2, - /* the window is clipped to the size of the buffer's crop rectangle; pixels - * outside the crop rectangle are treated as if they are completely - * transparent. - */ - NATIVE_WINDOW_SCALING_MODE_NO_SCALE_CROP = 3, -}; - -/* values returned by the NATIVE_WINDOW_CONCRETE_TYPE query */ -enum { - NATIVE_WINDOW_FRAMEBUFFER = 0, /* FramebufferNativeWindow */ - NATIVE_WINDOW_SURFACE = 1, /* Surface */ - NATIVE_WINDOW_SURFACE_TEXTURE_CLIENT = 2, /* SurfaceTextureClient */ -}; - -/* parameter for NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP - * - * Special timestamp value to indicate that timestamps should be auto-generated - * by the native window when queueBuffer is called. This is equal to INT64_MIN, - * defined directly to avoid problems with C99/C++ inclusion of stdint.h. - */ -static const int64_t NATIVE_WINDOW_TIMESTAMP_AUTO = (-9223372036854775807LL-1); - -struct ANativeWindow -{ -#ifdef __cplusplus - ANativeWindow() - : flags(0), minSwapInterval(0), maxSwapInterval(0), xdpi(0), ydpi(0) - { - common.magic = ANDROID_NATIVE_WINDOW_MAGIC; - common.version = sizeof(ANativeWindow); - memset(common.reserved, 0, sizeof(common.reserved)); - } - - /* Implement the methods that sp expects so that it - can be used to automatically refcount ANativeWindow's. */ - void incStrong(const void* id) const { - common.incRef(const_cast(&common)); - } - void decStrong(const void* id) const { - common.decRef(const_cast(&common)); - } -#endif - - struct android_native_base_t common; - - /* flags describing some attributes of this surface or its updater */ - const uint32_t flags; - - /* min swap interval supported by this updated */ - const int minSwapInterval; - - /* max swap interval supported by this updated */ - const int maxSwapInterval; - - /* horizontal and vertical resolution in DPI */ - const float xdpi; - const float ydpi; - - /* Some storage reserved for the OEM's driver. */ - intptr_t oem[4]; - - /* - * Set the swap interval for this surface. - * - * Returns 0 on success or -errno on error. - */ - int (*setSwapInterval)(struct ANativeWindow* window, - int interval); - - /* - * Hook called by EGL to acquire a buffer. After this call, the buffer - * is not locked, so its content cannot be modified. This call may block if - * no buffers are available. - * - * The window holds a reference to the buffer between dequeueBuffer and - * either queueBuffer or cancelBuffer, so clients only need their own - * reference if they might use the buffer after queueing or canceling it. - * Holding a reference to a buffer after queueing or canceling it is only - * allowed if a specific buffer count has been set. - * - * Returns 0 on success or -errno on error. - */ - int (*dequeueBuffer)(struct ANativeWindow* window, - struct ANativeWindowBuffer** buffer); - - /* - * hook called by EGL to lock a buffer. This MUST be called before modifying - * the content of a buffer. The buffer must have been acquired with - * dequeueBuffer first. - * - * Returns 0 on success or -errno on error. - */ - int (*lockBuffer)(struct ANativeWindow* window, - struct ANativeWindowBuffer* buffer); - /* - * Hook called by EGL when modifications to the render buffer are done. - * This unlocks and post the buffer. - * - * The window holds a reference to the buffer between dequeueBuffer and - * either queueBuffer or cancelBuffer, so clients only need their own - * reference if they might use the buffer after queueing or canceling it. - * Holding a reference to a buffer after queueing or canceling it is only - * allowed if a specific buffer count has been set. - * - * Buffers MUST be queued in the same order than they were dequeued. - * - * Returns 0 on success or -errno on error. - */ - int (*queueBuffer)(struct ANativeWindow* window, - struct ANativeWindowBuffer* buffer); - - /* - * hook used to retrieve information about the native window. - * - * Returns 0 on success or -errno on error. - */ - int (*query)(const struct ANativeWindow* window, - int what, int* value); - - /* - * hook used to perform various operations on the surface. - * (*perform)() is a generic mechanism to add functionality to - * ANativeWindow while keeping backward binary compatibility. - * - * DO NOT CALL THIS HOOK DIRECTLY. Instead, use the helper functions - * defined below. - * - * (*perform)() returns -ENOENT if the 'what' parameter is not supported - * by the surface's implementation. - * - * The valid operations are: - * NATIVE_WINDOW_SET_USAGE - * NATIVE_WINDOW_CONNECT (deprecated) - * NATIVE_WINDOW_DISCONNECT (deprecated) - * NATIVE_WINDOW_SET_CROP (private) - * NATIVE_WINDOW_SET_BUFFER_COUNT - * NATIVE_WINDOW_SET_BUFFERS_GEOMETRY (deprecated) - * NATIVE_WINDOW_SET_BUFFERS_TRANSFORM - * NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP - * NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS - * NATIVE_WINDOW_SET_BUFFERS_FORMAT - * NATIVE_WINDOW_SET_SCALING_MODE (private) - * NATIVE_WINDOW_LOCK (private) - * NATIVE_WINDOW_UNLOCK_AND_POST (private) - * NATIVE_WINDOW_API_CONNECT (private) - * NATIVE_WINDOW_API_DISCONNECT (private) - * NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS (private) - * NATIVE_WINDOW_SET_POST_TRANSFORM_CROP (private) - * - */ - - int (*perform)(struct ANativeWindow* window, - int operation, ... ); - - /* - * Hook used to cancel a buffer that has been dequeued. - * No synchronization is performed between dequeue() and cancel(), so - * either external synchronization is needed, or these functions must be - * called from the same thread. - * - * The window holds a reference to the buffer between dequeueBuffer and - * either queueBuffer or cancelBuffer, so clients only need their own - * reference if they might use the buffer after queueing or canceling it. - * Holding a reference to a buffer after queueing or canceling it is only - * allowed if a specific buffer count has been set. - */ - int (*cancelBuffer)(struct ANativeWindow* window, - struct ANativeWindowBuffer* buffer); - - - void* reserved_proc[2]; -}; - - /* Backwards compatibility: use ANativeWindow (struct ANativeWindow in C). - * android_native_window_t is deprecated. - */ -typedef struct ANativeWindow ANativeWindow; -typedef struct ANativeWindow android_native_window_t; - -/* - * native_window_set_usage(..., usage) - * Sets the intended usage flags for the next buffers - * acquired with (*lockBuffer)() and on. - * By default (if this function is never called), a usage of - * GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE - * is assumed. - * Calling this function will usually cause following buffers to be - * reallocated. - */ - -static inline int native_window_set_usage( - struct ANativeWindow* window, int usage) -{ - return window->perform(window, NATIVE_WINDOW_SET_USAGE, usage); -} - -/* deprecated. Always returns 0. Don't call. */ -static inline int native_window_connect( - struct ANativeWindow* window, int api) { - return 0; -} - -/* deprecated. Always returns 0. Don't call. */ -static inline int native_window_disconnect( - struct ANativeWindow* window, int api) { - return 0; -} - -/* - * native_window_set_crop(..., crop) - * Sets which region of the next queued buffers needs to be considered. - * Depending on the scaling mode, a buffer's crop region is scaled and/or - * cropped to match the surface's size. This function sets the crop in - * pre-transformed buffer pixel coordinates. - * - * The specified crop region applies to all buffers queued after it is called. - * - * If 'crop' is NULL, subsequently queued buffers won't be cropped. - * - * An error is returned if for instance the crop region is invalid, out of the - * buffer's bound or if the window is invalid. - */ -static inline int native_window_set_crop( - struct ANativeWindow* window, - android_native_rect_t const * crop) -{ - return window->perform(window, NATIVE_WINDOW_SET_CROP, crop); -} - -/* - * native_window_set_post_transform_crop(..., crop) - * Sets which region of the next queued buffers needs to be considered. - * Depending on the scaling mode, a buffer's crop region is scaled and/or - * cropped to match the surface's size. This function sets the crop in - * post-transformed pixel coordinates. - * - * The specified crop region applies to all buffers queued after it is called. - * - * If 'crop' is NULL, subsequently queued buffers won't be cropped. - * - * An error is returned if for instance the crop region is invalid, out of the - * buffer's bound or if the window is invalid. - */ -static inline int native_window_set_post_transform_crop( - struct ANativeWindow* window, - android_native_rect_t const * crop) -{ - return window->perform(window, NATIVE_WINDOW_SET_POST_TRANSFORM_CROP, crop); -} - -/* - * native_window_set_active_rect(..., active_rect) - * - * This function is deprectated and will be removed soon. For now it simply - * sets the post-transform crop for compatibility while multi-project commits - * get checked. - */ -static inline int native_window_set_active_rect( - struct ANativeWindow* window, - android_native_rect_t const * active_rect) -{ - return native_window_set_post_transform_crop(window, active_rect); -} - -/* - * native_window_set_buffer_count(..., count) - * Sets the number of buffers associated with this native window. - */ -static inline int native_window_set_buffer_count( - struct ANativeWindow* window, - size_t bufferCount) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFER_COUNT, bufferCount); -} - -/* - * native_window_set_buffers_geometry(..., int w, int h, int format) - * All buffers dequeued after this call will have the dimensions and format - * specified. A successful call to this function has the same effect as calling - * native_window_set_buffers_size and native_window_set_buffers_format. - * - * XXX: This function is deprecated. The native_window_set_buffers_dimensions - * and native_window_set_buffers_format functions should be used instead. - */ -static inline int native_window_set_buffers_geometry( - struct ANativeWindow* window, - int w, int h, int format) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_GEOMETRY, - w, h, format); -} - -/* - * native_window_set_buffers_dimensions(..., int w, int h) - * All buffers dequeued after this call will have the dimensions specified. - * In particular, all buffers will have a fixed-size, independent from the - * native-window size. They will be scaled according to the scaling mode - * (see native_window_set_scaling_mode) upon window composition. - * - * If w and h are 0, the normal behavior is restored. That is, dequeued buffers - * following this call will be sized to match the window's size. - * - * Calling this function will reset the window crop to a NULL value, which - * disables cropping of the buffers. - */ -static inline int native_window_set_buffers_dimensions( - struct ANativeWindow* window, - int w, int h) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS, - w, h); -} - -/* - * native_window_set_buffers_user_dimensions(..., int w, int h) - * - * Sets the user buffer size for the window, which overrides the - * window's size. All buffers dequeued after this call will have the - * dimensions specified unless overridden by - * native_window_set_buffers_dimensions. All buffers will have a - * fixed-size, independent from the native-window size. They will be - * scaled according to the scaling mode (see - * native_window_set_scaling_mode) upon window composition. - * - * If w and h are 0, the normal behavior is restored. That is, the - * default buffer size will match the windows's size. - * - * Calling this function will reset the window crop to a NULL value, which - * disables cropping of the buffers. - */ -static inline int native_window_set_buffers_user_dimensions( - struct ANativeWindow* window, - int w, int h) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS, - w, h); -} - -/* - * native_window_set_buffers_format(..., int format) - * All buffers dequeued after this call will have the format specified. - * - * If the specified format is 0, the default buffer format will be used. - */ -static inline int native_window_set_buffers_format( - struct ANativeWindow* window, - int format) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_FORMAT, format); -} - -/* - * native_window_set_buffers_transform(..., int transform) - * All buffers queued after this call will be displayed transformed according - * to the transform parameter specified. - */ -static inline int native_window_set_buffers_transform( - struct ANativeWindow* window, - int transform) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_TRANSFORM, - transform); -} - -/* - * native_window_set_buffers_timestamp(..., int64_t timestamp) - * All buffers queued after this call will be associated with the timestamp - * parameter specified. If the timestamp is set to NATIVE_WINDOW_TIMESTAMP_AUTO - * (the default), timestamps will be generated automatically when queueBuffer is - * called. The timestamp is measured in nanoseconds, and is normally monotonically - * increasing. The timestamp should be unaffected by time-of-day adjustments, - * and for a camera should be strictly monotonic but for a media player may be - * reset when the position is set. - */ -static inline int native_window_set_buffers_timestamp( - struct ANativeWindow* window, - int64_t timestamp) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP, - timestamp); -} - -/* - * native_window_set_scaling_mode(..., int mode) - * All buffers queued after this call will be associated with the scaling mode - * specified. - */ -static inline int native_window_set_scaling_mode( - struct ANativeWindow* window, - int mode) -{ - return window->perform(window, NATIVE_WINDOW_SET_SCALING_MODE, - mode); -} - -/* - * native_window_api_connect(..., int api) - * connects an API to this window. only one API can be connected at a time. - * Returns -EINVAL if for some reason the window cannot be connected, which - * can happen if it's connected to some other API. - */ -static inline int native_window_api_connect( - struct ANativeWindow* window, int api) -{ - return window->perform(window, NATIVE_WINDOW_API_CONNECT, api); -} - -/* - * native_window_api_disconnect(..., int api) - * disconnect the API from this window. - * An error is returned if for instance the window wasn't connected in the - * first place. - */ -static inline int native_window_api_disconnect( - struct ANativeWindow* window, int api) -{ - return window->perform(window, NATIVE_WINDOW_API_DISCONNECT, api); -} - - -__END_DECLS - -#endif /* SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H */ diff --git a/external/android/include/18/frameworks/av/include/media/AudioBufferProvider.h b/external/android/include/18/frameworks/av/include/media/AudioBufferProvider.h deleted file mode 100644 index 43e4de7..0000000 --- a/external/android/include/18/frameworks/av/include/media/AudioBufferProvider.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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_AUDIO_BUFFER_PROVIDER_H -#define ANDROID_AUDIO_BUFFER_PROVIDER_H - -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class AudioBufferProvider -{ -public: - - struct Buffer { - Buffer() : raw(NULL), frameCount(0) { } - union { - void* raw; - short* i16; - int8_t* i8; - }; - size_t frameCount; - }; - - virtual ~AudioBufferProvider() {} - - // value representing an invalid presentation timestamp - static const int64_t kInvalidPTS = 0x7FFFFFFFFFFFFFFFLL; // is too painful - - // pts is the local time when the next sample yielded by getNextBuffer - // will be rendered. - // Pass kInvalidPTS if the PTS is unknown or not applicable. - virtual status_t getNextBuffer(Buffer* buffer, int64_t pts = kInvalidPTS) = 0; - - virtual void releaseBuffer(Buffer* buffer) = 0; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_AUDIO_BUFFER_PROVIDER_H diff --git a/external/android/include/18/frameworks/av/include/media/AudioEffect.h b/external/android/include/18/frameworks/av/include/media/AudioEffect.h deleted file mode 100644 index 05d834d..0000000 --- a/external/android/include/18/frameworks/av/include/media/AudioEffect.h +++ /dev/null @@ -1,456 +0,0 @@ -/* - * 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_AUDIOEFFECT_H -#define ANDROID_AUDIOEFFECT_H - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - -namespace android { - -// ---------------------------------------------------------------------------- - -class effect_param_cblk_t; - -// ---------------------------------------------------------------------------- - -class AudioEffect : public RefBase -{ -public: - - /* - * Static methods for effects enumeration. - */ - - /* - * Returns the number of effects available. This method together - * with queryEffect() is used to enumerate all effects: - * The enumeration sequence is: - * queryNumberEffects(&num_effects); - * for (i = 0; i < num_effects; i++) - * queryEffect(i,...); - * - * Parameters: - * numEffects: address where the number of effects should be returned. - * - * Returned status (from utils/Errors.h) can be: - * NO_ERROR successful operation. - * PERMISSION_DENIED could not get AudioFlinger interface - * NO_INIT effect library failed to initialize - * BAD_VALUE invalid numEffects pointer - * - * Returned value - * *numEffects: updated with number of effects available - */ - static status_t queryNumberEffects(uint32_t *numEffects); - - /* - * Returns an effect descriptor during effect - * enumeration. - * - * Parameters: - * index: index of the queried effect. - * descriptor: address where the effect descriptor should be returned. - * - * Returned status (from utils/Errors.h) can be: - * NO_ERROR successful operation. - * PERMISSION_DENIED could not get AudioFlinger interface - * NO_INIT effect library failed to initialize - * BAD_VALUE invalid descriptor pointer or index - * INVALID_OPERATION effect list has changed since last execution of queryNumberEffects() - * - * Returned value - * *descriptor: updated with effect descriptor - */ - static status_t queryEffect(uint32_t index, effect_descriptor_t *descriptor); - - - /* - * Returns the descriptor for the specified effect uuid. - * - * Parameters: - * uuid: pointer to effect uuid. - * descriptor: address where the effect descriptor should be returned. - * - * Returned status (from utils/Errors.h) can be: - * NO_ERROR successful operation. - * PERMISSION_DENIED could not get AudioFlinger interface - * NO_INIT effect library failed to initialize - * BAD_VALUE invalid uuid or descriptor pointers - * NAME_NOT_FOUND no effect with this uuid found - * - * Returned value - * *descriptor updated with effect descriptor - */ - static status_t getEffectDescriptor(const effect_uuid_t *uuid, - effect_descriptor_t *descriptor) /*const*/; - - - /* - * Returns a list of descriptors corresponding to the pre processings enabled by default - * on an AudioRecord with the supplied audio session ID. - * - * Parameters: - * audioSession: audio session ID. - * descriptors: address where the effect descriptors should be returned. - * count: as input, the maximum number of descriptor than should be returned - * as output, the number of descriptor returned if status is NO_ERROR or the actual - * number of enabled pre processings if status is NO_MEMORY - * - * Returned status (from utils/Errors.h) can be: - * NO_ERROR successful operation. - * NO_MEMORY the number of descriptor to return is more than the maximum number - * indicated by count. - * PERMISSION_DENIED could not get AudioFlinger interface - * NO_INIT effect library failed to initialize - * BAD_VALUE invalid audio session or descriptor pointers - * - * Returned value - * *descriptor updated with descriptors of pre processings enabled by default - * *count number of descriptors returned if returned status is N_ERROR. - * total number of pre processing enabled by default if returned status is - * NO_MEMORY. This happens if the count passed as input is less than the number - * of descriptors to return - */ - static status_t queryDefaultPreProcessing(int audioSession, - effect_descriptor_t *descriptors, - uint32_t *count); - - /* - * Events used by callback function (effect_callback_t). - */ - enum event_type { - EVENT_CONTROL_STATUS_CHANGED = 0, - EVENT_ENABLE_STATUS_CHANGED = 1, - EVENT_PARAMETER_CHANGED = 2, - EVENT_ERROR = 3 - }; - - /* Callback function notifying client application of a change in effect engine state or - * configuration. - * An effect engine can be shared by several applications but only one has the control - * of the engine activity and configuration at a time. - * The EVENT_CONTROL_STATUS_CHANGED event is received when an application loses or - * retrieves the control of the effect engine. Loss of control happens - * if another application requests the use of the engine by creating an AudioEffect for - * the same effect type but with a higher priority. Control is returned when the - * application having the control deletes its AudioEffect object. - * The EVENT_ENABLE_STATUS_CHANGED event is received by all applications not having the - * control of the effect engine when the effect is enabled or disabled. - * The EVENT_PARAMETER_CHANGED event is received by all applications not having the - * control of the effect engine when an effect parameter is changed. - * The EVENT_ERROR event is received when the media server process dies. - * - * Parameters: - * - * event: type of event notified (see enum AudioEffect::event_type). - * user: Pointer to context for use by the callback receiver. - * info: Pointer to optional parameter according to event type: - * - EVENT_CONTROL_STATUS_CHANGED: boolean indicating if control is granted (true) - * or stolen (false). - * - EVENT_ENABLE_STATUS_CHANGED: boolean indicating if effect is now enabled (true) - * or disabled (false). - * - EVENT_PARAMETER_CHANGED: pointer to a effect_param_t structure. - * - EVENT_ERROR: status_t indicating the error (DEAD_OBJECT when media server dies). - */ - - typedef void (*effect_callback_t)(int32_t event, void* user, void *info); - - - /* Constructor. - * AudioEffect is the base class for creating and controlling an effect engine from - * the application process. Creating an AudioEffect object will create the effect engine - * in the AudioFlinger if no engine of the specified type exists. If one exists, this engine - * will be used. The application creating the AudioEffect object (or a derived class like - * Reverb for instance) will either receive control of the effect engine or not, depending - * on the priority parameter. If priority is higher than the priority used by the current - * effect engine owner, the control will be transfered to the new application. Otherwise - * control will remain to the previous application. In this case, the new application will be - * notified of changes in effect engine state or control ownership by the effect callback. - * After creating the AudioEffect, the application must call the initCheck() method and - * check the creation status before trying to control the effect engine (see initCheck()). - * If the effect is to be applied to an AudioTrack or MediaPlayer only the application - * must specify the audio session ID corresponding to this player. - */ - - /* Simple Constructor. - */ - AudioEffect(); - - - /* Constructor. - * - * Parameters: - * - * type: type of effect created: can be null if uuid is specified. This corresponds to - * the OpenSL ES interface implemented by this effect. - * uuid: Uuid of effect created: can be null if type is specified. This uuid corresponds to - * a particular implementation of an effect type. - * priority: requested priority for effect control: the priority level corresponds to the - * value of priority parameter: negative values indicate lower priorities, positive values - * higher priorities, 0 being the normal priority. - * cbf: optional callback function (see effect_callback_t) - * user: pointer to context for use by the callback receiver. - * sessionID: audio session this effect is associated to. If 0, the effect will be global to - * the output mix. If not 0, the effect will be applied to all players - * (AudioTrack or MediaPLayer) within the same audio session. - * io: HAL audio output or input stream to which this effect must be attached. Leave at 0 for - * automatic output selection by AudioFlinger. - */ - - AudioEffect(const effect_uuid_t *type, - const effect_uuid_t *uuid = NULL, - int32_t priority = 0, - effect_callback_t cbf = NULL, - void* user = NULL, - int sessionId = 0, - audio_io_handle_t io = 0 - ); - - /* Constructor. - * Same as above but with type and uuid specified by character strings - */ - AudioEffect(const char *typeStr, - const char *uuidStr = NULL, - int32_t priority = 0, - effect_callback_t cbf = NULL, - void* user = NULL, - int sessionId = 0, - audio_io_handle_t io = 0 - ); - - /* Terminates the AudioEffect and unregisters it from AudioFlinger. - * The effect engine is also destroyed if this AudioEffect was the last controlling - * the engine. - */ - ~AudioEffect(); - - /* Initialize an uninitialized AudioEffect. - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR or ALREADY_EXISTS: successful initialization - * - INVALID_OPERATION: AudioEffect is already initialized - * - BAD_VALUE: invalid parameter - * - NO_INIT: audio flinger or audio hardware not initialized - * */ - status_t set(const effect_uuid_t *type, - const effect_uuid_t *uuid = NULL, - int32_t priority = 0, - effect_callback_t cbf = NULL, - void* user = NULL, - int sessionId = 0, - audio_io_handle_t io = 0 - ); - - /* Result of constructing the AudioEffect. This must be checked - * before using any AudioEffect API. - * initCheck() can return: - * - NO_ERROR: the effect engine is successfully created and the application has control. - * - ALREADY_EXISTS: the effect engine is successfully created but the application does not - * have control. - * - NO_INIT: the effect creation failed. - * - */ - status_t initCheck() const; - - - /* Returns the unique effect Id for the controlled effect engine. This ID is unique - * system wide and is used for instance in the case of auxiliary effects to attach - * the effect to an AudioTrack or MediaPlayer. - * - */ - int32_t id() const { return mId; } - - /* Returns a descriptor for the effect (see effect_descriptor_t in audio_effect.h). - */ - effect_descriptor_t descriptor() const; - - /* Returns effect control priority of this AudioEffect object. - */ - int32_t priority() const { return mPriority; } - - - /* Enables or disables the effect engine. - * - * Parameters: - * enabled: requested enable state. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the application does not have control of the effect engine or the - * effect is already in the requested state. - */ - virtual status_t setEnabled(bool enabled); - bool getEnabled() const; - - /* Sets a parameter value. - * - * Parameters: - * param: pointer to effect_param_t structure containing the parameter - * and its value (See audio_effect.h). - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation. - * - INVALID_OPERATION: the application does not have control of the effect engine. - * - BAD_VALUE: invalid parameter identifier or value. - * - DEAD_OBJECT: the effect engine has been deleted. - */ - virtual status_t setParameter(effect_param_t *param); - - /* Prepare a new parameter value that will be set by next call to - * setParameterCommit(). This method can be used to set multiple parameters - * in a synchronous manner or to avoid multiple binder calls for each - * parameter. - * - * Parameters: - * param: pointer to effect_param_t structure containing the parameter - * and its value (See audio_effect.h). - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation. - * - INVALID_OPERATION: the application does not have control of the effect engine. - * - NO_MEMORY: no more space available in shared memory used for deferred parameter - * setting. - */ - virtual status_t setParameterDeferred(effect_param_t *param); - - /* Commit all parameter values previously prepared by setParameterDeferred(). - * - * Parameters: - * none - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation. - * - INVALID_OPERATION: No new parameter values ready for commit. - * - BAD_VALUE: invalid parameter identifier or value: there is no indication - * as to which of the parameters caused this error. - * - DEAD_OBJECT: the effect engine has been deleted. - */ - virtual status_t setParameterCommit(); - - /* Gets a parameter value. - * - * Parameters: - * param: pointer to effect_param_t structure containing the parameter - * and the returned value (See audio_effect.h). - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation. - * - INVALID_OPERATION: the AudioEffect was not successfully initialized. - * - BAD_VALUE: invalid parameter identifier. - * - DEAD_OBJECT: the effect engine has been deleted. - */ - virtual status_t getParameter(effect_param_t *param); - - /* Sends a command and receives a response to/from effect engine. - * See audio_effect.h for details on effect command() function, valid command codes - * and formats. - */ - virtual status_t command(uint32_t cmdCode, - uint32_t cmdSize, - void *cmdData, - uint32_t *replySize, - void *replyData); - - - /* - * Utility functions. - */ - - /* Converts the string passed as first argument to the effect_uuid_t - * pointed to by second argument - */ - static status_t stringToGuid(const char *str, effect_uuid_t *guid); - /* Converts the effect_uuid_t pointed to by first argument to the - * string passed as second argument - */ - static status_t guidToString(const effect_uuid_t *guid, char *str, size_t maxLen); - -protected: - bool mEnabled; // enable state - int32_t mSessionId; // audio session ID - int32_t mPriority; // priority for effect control - status_t mStatus; // effect status - effect_callback_t mCbf; // callback function for status, control and - // parameter changes notifications - void* mUserData; // client context for callback function - effect_descriptor_t mDescriptor; // effect descriptor - int32_t mId; // system wide unique effect engine instance ID - Mutex mLock; // Mutex for mEnabled access - - // IEffectClient - virtual void controlStatusChanged(bool controlGranted); - virtual void enableStatusChanged(bool enabled); - virtual void commandExecuted(uint32_t cmdCode, - uint32_t cmdSize, - void *pCmdData, - uint32_t replySize, - void *pReplyData); - -private: - - // Implements the IEffectClient interface - class EffectClient : public android::BnEffectClient, public android::IBinder::DeathRecipient - { - public: - - EffectClient(AudioEffect *effect) : mEffect(effect){} - - // IEffectClient - virtual void controlStatusChanged(bool controlGranted) { - mEffect->controlStatusChanged(controlGranted); - } - virtual void enableStatusChanged(bool enabled) { - mEffect->enableStatusChanged(enabled); - } - virtual void commandExecuted(uint32_t cmdCode, - uint32_t cmdSize, - void *pCmdData, - uint32_t replySize, - void *pReplyData) { - mEffect->commandExecuted(cmdCode, cmdSize, pCmdData, replySize, pReplyData); - } - - // IBinder::DeathRecipient - virtual void binderDied(const wp& who) {mEffect->binderDied();} - - private: - AudioEffect *mEffect; - }; - - void binderDied(); - - sp mIEffect; // IEffect binder interface - sp mIEffectClient; // IEffectClient implementation - sp mCblkMemory; // shared memory for deferred parameter setting - effect_param_cblk_t* mCblk; // control block for deferred parameter setting -}; - - -}; // namespace android - -#endif // ANDROID_AUDIOEFFECT_H diff --git a/external/android/include/18/frameworks/av/include/media/AudioParameter.h b/external/android/include/18/frameworks/av/include/media/AudioParameter.h deleted file mode 100644 index 891bc4b..0000000 --- a/external/android/include/18/frameworks/av/include/media/AudioParameter.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2008-2011 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_AUDIOPARAMETER_H_ -#define ANDROID_AUDIOPARAMETER_H_ - -#include -#include -#include - -namespace android { - -class AudioParameter { - -public: - AudioParameter() {} - AudioParameter(const String8& keyValuePairs); - virtual ~AudioParameter(); - - // reserved parameter keys for changing standard parameters with setParameters() function. - // Using these keys is mandatory for AudioFlinger to properly monitor audio output/input - // configuration changes and act accordingly. - // keyRouting: to change audio routing, value is an int in audio_devices_t - // keySamplingRate: to change sampling rate routing, value is an int - // keyFormat: to change audio format, value is an int in audio_format_t - // keyChannels: to change audio channel configuration, value is an int in audio_channels_t - // keyFrameCount: to change audio output frame count, value is an int - // keyInputSource: to change audio input source, value is an int in audio_source_t - // (defined in media/mediarecorder.h) - // keyScreenState: either "on" or "off" - static const char * const keyRouting; - static const char * const keySamplingRate; - static const char * const keyFormat; - static const char * const keyChannels; - static const char * const keyFrameCount; - static const char * const keyInputSource; - static const char * const keyScreenState; - - String8 toString(); - - status_t add(const String8& key, const String8& value); - status_t addInt(const String8& key, const int value); - status_t addFloat(const String8& key, const float value); - - status_t remove(const String8& key); - - status_t get(const String8& key, String8& value); - status_t getInt(const String8& key, int& value); - status_t getFloat(const String8& key, float& value); - status_t getAt(size_t index, String8& key, String8& value); - - size_t size() { return mParameters.size(); } - -private: - String8 mKeyValuePairs; - KeyedVector mParameters; -}; - -}; // namespace android - -#endif /*ANDROID_AUDIOPARAMETER_H_*/ diff --git a/external/android/include/18/frameworks/av/include/media/AudioRecord.h b/external/android/include/18/frameworks/av/include/media/AudioRecord.h deleted file mode 100644 index 38c6548..0000000 --- a/external/android/include/18/frameworks/av/include/media/AudioRecord.h +++ /dev/null @@ -1,403 +0,0 @@ -/* - * 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. - */ - -#ifndef AUDIORECORD_H_ -#define AUDIORECORD_H_ - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace android { - -class audio_track_cblk_t; -class AudioRecordClientProxy; - -// ---------------------------------------------------------------------------- - -class AudioRecord : virtual public RefBase -{ -public: - - static const int DEFAULT_SAMPLE_RATE = 8000; - - /* Events used by AudioRecord callback function (callback_t). - * Keep in sync with frameworks/base/media/java/android/media/AudioRecord.java NATIVE_EVENT_*. - */ - enum event_type { - EVENT_MORE_DATA = 0, // Request to read more data from PCM buffer. - EVENT_OVERRUN = 1, // PCM buffer overrun occurred. - EVENT_MARKER = 2, // Record head is at the specified marker position - // (See setMarkerPosition()). - EVENT_NEW_POS = 3, // Record head is at a new position - // (See setPositionUpdatePeriod()). - }; - - /* Client should declare Buffer on the stack and pass address to obtainBuffer() - * and releaseBuffer(). See also callback_t for EVENT_MORE_DATA. - */ - - class Buffer - { - public: - size_t frameCount; // number of sample frames corresponding to size; - // on input it is the number of frames available, - // on output is the number of frames actually drained - - size_t size; // total size in bytes == frameCount * frameSize - union { - void* raw; - short* i16; // signed 16-bit - int8_t* i8; // unsigned 8-bit, offset by 0x80 - }; - }; - - /* As a convenience, if a callback is supplied, a handler thread - * is automatically created with the appropriate priority. This thread - * invokes the callback when a new buffer becomes ready or various conditions occur. - * Parameters: - * - * event: type of event notified (see enum AudioRecord::event_type). - * user: Pointer to context for use by the callback receiver. - * info: Pointer to optional parameter according to event type: - * - EVENT_MORE_DATA: pointer to AudioRecord::Buffer struct. The callback must not read - * more bytes than indicated by 'size' field and update 'size' if fewer bytes are - * consumed. - * - EVENT_OVERRUN: unused. - * - EVENT_MARKER: pointer to const uint32_t containing the marker position in frames. - * - EVENT_NEW_POS: pointer to const uint32_t containing the new position in frames. - */ - - typedef void (*callback_t)(int event, void* user, void *info); - - /* Returns the minimum frame count required for the successful creation of - * an AudioRecord object. - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - NO_INIT: audio server or audio hardware not initialized - * - BAD_VALUE: unsupported configuration - */ - - static status_t getMinFrameCount(size_t* frameCount, - uint32_t sampleRate, - audio_format_t format, - audio_channel_mask_t channelMask); - - /* Constructs an uninitialized AudioRecord. No connection with - * AudioFlinger takes place. - */ - AudioRecord(); - - /* Creates an AudioRecord object and registers it with AudioFlinger. - * Once created, the track needs to be started before it can be used. - * Unspecified values are set to the audio hardware's current - * values. - * - * Parameters: - * - * inputSource: Select the audio input to record to (e.g. AUDIO_SOURCE_DEFAULT). - * sampleRate: Track sampling rate in Hz. - * format: Audio format (e.g AUDIO_FORMAT_PCM_16_BIT for signed - * 16 bits per sample). - * channelMask: Channel mask. - * frameCount: Minimum size of track PCM buffer in frames. This defines the - * application's contribution to the - * latency of the track. The actual size selected by the AudioRecord could - * be larger if the requested size is not compatible with current audio HAL - * latency. Zero means to use a default value. - * cbf: Callback function. If not null, this function is called periodically - * to consume new PCM data. - * user: Context for use by the callback receiver. - * notificationFrames: The callback function is called each time notificationFrames PCM - * frames are ready in record track output buffer. - * sessionId: Not yet supported. - */ - - AudioRecord(audio_source_t inputSource, - uint32_t sampleRate = 0, - audio_format_t format = AUDIO_FORMAT_DEFAULT, - audio_channel_mask_t channelMask = AUDIO_CHANNEL_IN_MONO, - int frameCount = 0, - callback_t cbf = NULL, - void* user = NULL, - int notificationFrames = 0, - int sessionId = 0); - - - /* Terminates the AudioRecord and unregisters it from AudioFlinger. - * Also destroys all resources associated with the AudioRecord. - */ - ~AudioRecord(); - - - /* Initialize an uninitialized AudioRecord. - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful intialization - * - INVALID_OPERATION: AudioRecord is already intitialized or record device is already in use - * - BAD_VALUE: invalid parameter (channels, format, sampleRate...) - * - NO_INIT: audio server or audio hardware not initialized - * - PERMISSION_DENIED: recording is not allowed for the requesting process - */ - status_t set(audio_source_t inputSource = AUDIO_SOURCE_DEFAULT, - uint32_t sampleRate = 0, - audio_format_t format = AUDIO_FORMAT_DEFAULT, - audio_channel_mask_t channelMask = AUDIO_CHANNEL_IN_MONO, - int frameCount = 0, - callback_t cbf = NULL, - void* user = NULL, - int notificationFrames = 0, - bool threadCanCallJava = false, - int sessionId = 0); - - - /* Result of constructing the AudioRecord. This must be checked - * before using any AudioRecord API (except for set()), because using - * an uninitialized AudioRecord produces undefined results. - * See set() method above for possible return codes. - */ - status_t initCheck() const; - - /* Returns this track's estimated latency in milliseconds. - * This includes the latency due to AudioRecord buffer size, - * and audio hardware driver. - */ - uint32_t latency() const; - - /* getters, see constructor and set() */ - - audio_format_t format() const; - uint32_t channelCount() const; - size_t frameCount() const; - size_t frameSize() const { return mFrameSize; } - audio_source_t inputSource() const; - - - /* After it's created the track is not active. Call start() to - * make it active. If set, the callback will start being called. - * If event is not AudioSystem::SYNC_EVENT_NONE, the capture start will be delayed until - * the specified event occurs on the specified trigger session. - */ - status_t start(AudioSystem::sync_event_t event = AudioSystem::SYNC_EVENT_NONE, - int triggerSession = 0); - - /* Stop a track. If set, the callback will cease being called and - * obtainBuffer returns STOPPED. Note that obtainBuffer() still works - * and will drain buffers until the pool is exhausted. - */ - void stop(); - bool stopped() const; - - /* Get sample rate for this record track in Hz. - */ - uint32_t getSampleRate() const; - - /* Sets marker position. When record reaches the number of frames specified, - * a callback with event type EVENT_MARKER is called. Calling setMarkerPosition - * with marker == 0 cancels marker notification callback. - * If the AudioRecord has been opened with no callback function associated, - * the operation will fail. - * - * Parameters: - * - * marker: marker position expressed in frames. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the AudioRecord has no callback installed. - */ - status_t setMarkerPosition(uint32_t marker); - status_t getMarkerPosition(uint32_t *marker) const; - - - /* Sets position update period. Every time the number of frames specified has been recorded, - * a callback with event type EVENT_NEW_POS is called. - * Calling setPositionUpdatePeriod with updatePeriod == 0 cancels new position notification - * callback. - * If the AudioRecord has been opened with no callback function associated, - * the operation will fail. - * - * Parameters: - * - * updatePeriod: position update notification period expressed in frames. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the AudioRecord has no callback installed. - */ - status_t setPositionUpdatePeriod(uint32_t updatePeriod); - status_t getPositionUpdatePeriod(uint32_t *updatePeriod) const; - - - /* Gets record head position. The position is the total number of frames - * recorded since record start. - * - * Parameters: - * - * position: Address where to return record head position within AudioRecord buffer. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - BAD_VALUE: position is NULL - */ - status_t getPosition(uint32_t *position) const; - - /* Returns a handle on the audio input used by this AudioRecord. - * - * Parameters: - * none. - * - * Returned value: - * handle on audio hardware input - */ - audio_io_handle_t getInput() const; - - /* Returns the audio session ID associated with this AudioRecord. - * - * Parameters: - * none. - * - * Returned value: - * AudioRecord session ID. - */ - int getSessionId() const; - - /* Obtains a buffer of "frameCount" frames. The buffer must be - * drained entirely, and then released with releaseBuffer(). - * If the track is stopped, obtainBuffer() returns - * STOPPED instead of NO_ERROR as long as there are buffers available, - * at which point NO_MORE_BUFFERS is returned. - * Buffers will be returned until the pool - * is exhausted, at which point obtainBuffer() will either block - * or return WOULD_BLOCK depending on the value of the "blocking" - * parameter. - * - * Interpretation of waitCount: - * +n limits wait time to n * WAIT_PERIOD_MS, - * -1 causes an (almost) infinite wait time, - * 0 non-blocking. - */ - - enum { - NO_MORE_BUFFERS = 0x80000001, // same name in AudioFlinger.h, ok to be different value - STOPPED = 1 - }; - - status_t obtainBuffer(Buffer* audioBuffer, int32_t waitCount); - - /* Release an emptied buffer of "frameCount" frames for AudioFlinger to re-fill. */ - void releaseBuffer(Buffer* audioBuffer); - - - /* As a convenience we provide a read() interface to the audio buffer. - * This is implemented on top of obtainBuffer/releaseBuffer. - */ - ssize_t read(void* buffer, size_t size); - - /* Return the number of input frames lost in the audio driver since the last call of this - * function. Audio driver is expected to reset the value to 0 and restart counting upon - * returning the current value by this function call. Such loss typically occurs when the - * user space process is blocked longer than the capacity of audio driver buffers. - * Units: the number of input audio frames. - */ - unsigned int getInputFramesLost() const; - -private: - /* copying audio record objects is not allowed */ - AudioRecord(const AudioRecord& other); - AudioRecord& operator = (const AudioRecord& other); - - /* a small internal class to handle the callback */ - class AudioRecordThread : public Thread - { - public: - AudioRecordThread(AudioRecord& receiver, bool bCanCallJava = false); - - // Do not call Thread::requestExitAndWait() without first calling requestExit(). - // Thread::requestExitAndWait() is not virtual, and the implementation doesn't do enough. - virtual void requestExit(); - - void pause(); // suspend thread from execution at next loop boundary - void resume(); // allow thread to execute, if not requested to exit - - private: - friend class AudioRecord; - virtual bool threadLoop(); - AudioRecord& mReceiver; - virtual ~AudioRecordThread(); - Mutex mMyLock; // Thread::mLock is private - Condition mMyCond; // Thread::mThreadExitedCondition is private - bool mPaused; // whether thread is currently paused - }; - - // body of AudioRecordThread::threadLoop() - bool processAudioBuffer(const sp& thread); - - status_t openRecord_l(uint32_t sampleRate, - audio_format_t format, - size_t frameCount, - audio_io_handle_t input); - audio_io_handle_t getInput_l(); - status_t restoreRecord_l(audio_track_cblk_t*& cblk); - - sp mAudioRecordThread; - mutable Mutex mLock; - - bool mActive; // protected by mLock - - // for client callback handler - callback_t mCbf; // callback handler for events, or NULL - void* mUserData; - - // for notification APIs - uint32_t mNotificationFrames; - uint32_t mRemainingFrames; - uint32_t mMarkerPosition; // in frames - bool mMarkerReached; - uint32_t mNewPosition; // in frames - uint32_t mUpdatePeriod; // in ms - - // constant after constructor or set() - uint32_t mSampleRate; - size_t mFrameCount; - audio_format_t mFormat; - uint8_t mChannelCount; - size_t mFrameSize; // app-level frame size == AudioFlinger frame size - audio_source_t mInputSource; - status_t mStatus; - uint32_t mLatency; - audio_channel_mask_t mChannelMask; - audio_io_handle_t mInput; // returned by AudioSystem::getInput() - int mSessionId; - - // may be changed if IAudioRecord object is re-created - sp mAudioRecord; - sp mCblkMemory; - audio_track_cblk_t* mCblk; - void* mBuffers; // starting address of buffers in shared memory - - int mPreviousPriority; // before start() - SchedPolicy mPreviousSchedulingGroup; - AudioRecordClientProxy* mProxy; -}; - -}; // namespace android - -#endif /*AUDIORECORD_H_*/ diff --git a/external/android/include/18/frameworks/av/include/media/AudioSystem.h b/external/android/include/18/frameworks/av/include/media/AudioSystem.h deleted file mode 100644 index b11c812..0000000 --- a/external/android/include/18/frameworks/av/include/media/AudioSystem.h +++ /dev/null @@ -1,304 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_AUDIOSYSTEM_H_ -#define ANDROID_AUDIOSYSTEM_H_ - -#include -#include -#include - -#include -#include - -/* XXX: Should be include by all the users instead */ -#include - -namespace android { - -typedef void (*audio_error_callback)(status_t err); - -class IAudioPolicyService; -class String8; - -class AudioSystem -{ -public: - - /* These are static methods to control the system-wide AudioFlinger - * only privileged processes can have access to them - */ - - // mute/unmute microphone - static status_t muteMicrophone(bool state); - static status_t isMicrophoneMuted(bool *state); - - // set/get master volume - static status_t setMasterVolume(float value); - static status_t getMasterVolume(float* volume); - - // mute/unmute audio outputs - static status_t setMasterMute(bool mute); - static status_t getMasterMute(bool* mute); - - // set/get stream volume on specified output - static status_t setStreamVolume(audio_stream_type_t stream, float value, - audio_io_handle_t output); - static status_t getStreamVolume(audio_stream_type_t stream, float* volume, - audio_io_handle_t output); - - // mute/unmute stream - static status_t setStreamMute(audio_stream_type_t stream, bool mute); - static status_t getStreamMute(audio_stream_type_t stream, bool* mute); - - // set audio mode in audio hardware - static status_t setMode(audio_mode_t mode); - - // returns true in *state if tracks are active on the specified stream or have been active - // in the past inPastMs milliseconds - static status_t isStreamActive(audio_stream_type_t stream, bool *state, uint32_t inPastMs = 0); - // returns true in *state if tracks are active for what qualifies as remote playback - // on the specified stream or have been active in the past inPastMs milliseconds. Remote - // playback isn't mutually exclusive with local playback. - static status_t isStreamActiveRemotely(audio_stream_type_t stream, bool *state, - uint32_t inPastMs = 0); - // returns true in *state if a recorder is currently recording with the specified source - static status_t isSourceActive(audio_source_t source, bool *state); - - // set/get audio hardware parameters. The function accepts a list of parameters - // key value pairs in the form: key1=value1;key2=value2;... - // Some keys are reserved for standard parameters (See AudioParameter class). - static status_t setParameters(audio_io_handle_t ioHandle, const String8& keyValuePairs); - static String8 getParameters(audio_io_handle_t ioHandle, const String8& keys); - - static void setErrorCallback(audio_error_callback cb); - - // helper function to obtain AudioFlinger service handle - static const sp& get_audio_flinger(); - - static float linearToLog(int volume); - static int logToLinear(float volume); - - static status_t getOutputSamplingRate(uint32_t* samplingRate, - audio_stream_type_t stream = AUDIO_STREAM_DEFAULT); - static status_t getOutputFrameCount(size_t* frameCount, - audio_stream_type_t stream = AUDIO_STREAM_DEFAULT); - static status_t getOutputLatency(uint32_t* latency, - audio_stream_type_t stream = AUDIO_STREAM_DEFAULT); - static status_t getSamplingRate(audio_io_handle_t output, - audio_stream_type_t streamType, - uint32_t* samplingRate); - // returns the number of frames per audio HAL write buffer. Corresponds to - // audio_stream->get_buffer_size()/audio_stream_frame_size() - static status_t getFrameCount(audio_io_handle_t output, - audio_stream_type_t stream, - size_t* frameCount); - // returns the audio output stream latency in ms. Corresponds to - // audio_stream_out->get_latency() - static status_t getLatency(audio_io_handle_t output, - audio_stream_type_t stream, - uint32_t* latency); - - static bool routedToA2dpOutput(audio_stream_type_t streamType); - - static status_t getInputBufferSize(uint32_t sampleRate, audio_format_t format, - audio_channel_mask_t channelMask, size_t* buffSize); - - static status_t setVoiceVolume(float volume); - - // return the number of audio frames written by AudioFlinger to audio HAL and - // audio dsp to DAC since the output on which the specified stream is playing - // has exited standby. - // returned status (from utils/Errors.h) can be: - // - NO_ERROR: successful operation, halFrames and dspFrames point to valid data - // - INVALID_OPERATION: Not supported on current hardware platform - // - BAD_VALUE: invalid parameter - // NOTE: this feature is not supported on all hardware platforms and it is - // necessary to check returned status before using the returned values. - static status_t getRenderPosition(size_t *halFrames, size_t *dspFrames, - audio_stream_type_t stream = AUDIO_STREAM_DEFAULT); - - // return the number of input frames lost by HAL implementation, or 0 if the handle is invalid - static size_t getInputFramesLost(audio_io_handle_t ioHandle); - - static int newAudioSessionId(); - static void acquireAudioSessionId(int audioSession); - static void releaseAudioSessionId(int audioSession); - - // types of io configuration change events received with ioConfigChanged() - enum io_config_event { - OUTPUT_OPENED, - OUTPUT_CLOSED, - OUTPUT_CONFIG_CHANGED, - INPUT_OPENED, - INPUT_CLOSED, - INPUT_CONFIG_CHANGED, - STREAM_CONFIG_CHANGED, - NUM_CONFIG_EVENTS - }; - - // audio output descriptor used to cache output configurations in client process to avoid - // frequent calls through IAudioFlinger - class OutputDescriptor { - public: - OutputDescriptor() - : samplingRate(0), format(AUDIO_FORMAT_DEFAULT), channels(0), frameCount(0), latency(0) {} - - uint32_t samplingRate; - int32_t format; - int32_t channels; - size_t frameCount; - uint32_t latency; - }; - - // Events used to synchronize actions between audio sessions. - // For instance SYNC_EVENT_PRESENTATION_COMPLETE can be used to delay recording start until - // playback is complete on another audio session. - // See definitions in MediaSyncEvent.java - enum sync_event_t { - SYNC_EVENT_SAME = -1, // used internally to indicate restart with same event - SYNC_EVENT_NONE = 0, - SYNC_EVENT_PRESENTATION_COMPLETE, - - // - // Define new events here: SYNC_EVENT_START, SYNC_EVENT_STOP, SYNC_EVENT_TIME ... - // - SYNC_EVENT_CNT, - }; - - // Timeout for synchronous record start. Prevents from blocking the record thread forever - // if the trigger event is not fired. - static const uint32_t kSyncRecordStartTimeOutMs = 30000; - - // - // IAudioPolicyService interface (see AudioPolicyInterface for method descriptions) - // - static status_t setDeviceConnectionState(audio_devices_t device, audio_policy_dev_state_t state, - const char *device_address); - static audio_policy_dev_state_t getDeviceConnectionState(audio_devices_t device, - const char *device_address); - static status_t setPhoneState(audio_mode_t state); - static status_t setForceUse(audio_policy_force_use_t usage, audio_policy_forced_cfg_t config); - static audio_policy_forced_cfg_t getForceUse(audio_policy_force_use_t usage); - static audio_io_handle_t getOutput(audio_stream_type_t stream, - uint32_t samplingRate = 0, - audio_format_t format = AUDIO_FORMAT_DEFAULT, - audio_channel_mask_t channelMask = AUDIO_CHANNEL_OUT_STEREO, - audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE); - static status_t startOutput(audio_io_handle_t output, - audio_stream_type_t stream, - int session = 0); - static status_t stopOutput(audio_io_handle_t output, - audio_stream_type_t stream, - int session = 0); - static void releaseOutput(audio_io_handle_t output); - static audio_io_handle_t getInput(audio_source_t inputSource, - uint32_t samplingRate = 0, - audio_format_t format = AUDIO_FORMAT_DEFAULT, - audio_channel_mask_t channelMask = AUDIO_CHANNEL_IN_MONO, - int sessionId = 0); - static status_t startInput(audio_io_handle_t input); - static status_t stopInput(audio_io_handle_t input); - static void releaseInput(audio_io_handle_t input); - static status_t initStreamVolume(audio_stream_type_t stream, - int indexMin, - int indexMax); - static status_t setStreamVolumeIndex(audio_stream_type_t stream, - int index, - audio_devices_t device); - static status_t getStreamVolumeIndex(audio_stream_type_t stream, - int *index, - audio_devices_t device); - - static uint32_t getStrategyForStream(audio_stream_type_t stream); - static audio_devices_t getDevicesForStream(audio_stream_type_t stream); - - static audio_io_handle_t getOutputForEffect(const effect_descriptor_t *desc); - static status_t registerEffect(const effect_descriptor_t *desc, - audio_io_handle_t io, - uint32_t strategy, - int session, - int id); - static status_t unregisterEffect(int id); - static status_t setEffectEnabled(int id, bool enabled); - - // clear stream to output mapping cache (gStreamOutputMap) - // and output configuration cache (gOutputs) - static void clearAudioConfigCache(); - - static const sp& get_audio_policy_service(); - - // helpers for android.media.AudioManager.getProperty(), see description there for meaning - static uint32_t getPrimaryOutputSamplingRate(); - static size_t getPrimaryOutputFrameCount(); - - // ---------------------------------------------------------------------------- - -private: - - class AudioFlingerClient: public IBinder::DeathRecipient, public BnAudioFlingerClient - { - public: - AudioFlingerClient() { - } - - // DeathRecipient - virtual void binderDied(const wp& who); - - // IAudioFlingerClient - - // indicate a change in the configuration of an output or input: keeps the cached - // values for output/input parameters up-to-date in client process - virtual void ioConfigChanged(int event, audio_io_handle_t ioHandle, const void *param2); - }; - - class AudioPolicyServiceClient: public IBinder::DeathRecipient - { - public: - AudioPolicyServiceClient() { - } - - // DeathRecipient - virtual void binderDied(const wp& who); - }; - - static sp gAudioFlingerClient; - static sp gAudioPolicyServiceClient; - friend class AudioFlingerClient; - friend class AudioPolicyServiceClient; - - static Mutex gLock; - static sp gAudioFlinger; - static audio_error_callback gAudioErrorCallback; - - static size_t gInBuffSize; - // previous parameters for recording buffer size queries - static uint32_t gPrevInSamplingRate; - static audio_format_t gPrevInFormat; - static audio_channel_mask_t gPrevInChannelMask; - - static sp gAudioPolicyService; - - // mapping between stream types and outputs - static DefaultKeyedVector gStreamOutputMap; - // list of output descriptors containing cached parameters - // (sampling rate, framecount, channel count...) - static DefaultKeyedVector gOutputs; -}; - -}; // namespace android - -#endif /*ANDROID_AUDIOSYSTEM_H_*/ diff --git a/external/android/include/18/frameworks/av/include/media/AudioTrack.h b/external/android/include/18/frameworks/av/include/media/AudioTrack.h deleted file mode 100644 index 64f82bb..0000000 --- a/external/android/include/18/frameworks/av/include/media/AudioTrack.h +++ /dev/null @@ -1,630 +0,0 @@ -/* - * 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_AUDIOTRACK_H -#define ANDROID_AUDIOTRACK_H - -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class audio_track_cblk_t; -class AudioTrackClientProxy; - -// ---------------------------------------------------------------------------- - -class AudioTrack : virtual public RefBase -{ -public: - enum channel_index { - MONO = 0, - LEFT = 0, - RIGHT = 1 - }; - - /* Events used by AudioTrack callback function (audio_track_cblk_t). - * Keep in sync with frameworks/base/media/java/android/media/AudioTrack.java NATIVE_EVENT_*. - */ - enum event_type { - EVENT_MORE_DATA = 0, // Request to write more data to buffer. - // If this event is delivered but the callback handler - // does not want to write more data, the handler must explicitly - // ignore the event by setting frameCount to zero. - EVENT_UNDERRUN = 1, // Buffer underrun occurred. - EVENT_LOOP_END = 2, // Sample loop end was reached; playback restarted from - // loop start if loop count was not 0. - EVENT_MARKER = 3, // Playback head is at the specified marker position - // (See setMarkerPosition()). - EVENT_NEW_POS = 4, // Playback head is at a new position - // (See setPositionUpdatePeriod()). - EVENT_BUFFER_END = 5 // Playback head is at the end of the buffer. - }; - - /* Client should declare Buffer on the stack and pass address to obtainBuffer() - * and releaseBuffer(). See also callback_t for EVENT_MORE_DATA. - */ - - class Buffer - { - public: - size_t frameCount; // number of sample frames corresponding to size; - // on input it is the number of frames desired, - // on output is the number of frames actually filled - - size_t size; // input/output in byte units - union { - void* raw; - short* i16; // signed 16-bit - int8_t* i8; // unsigned 8-bit, offset by 0x80 - }; - }; - - - /* As a convenience, if a callback is supplied, a handler thread - * is automatically created with the appropriate priority. This thread - * invokes the callback when a new buffer becomes available or various conditions occur. - * Parameters: - * - * event: type of event notified (see enum AudioTrack::event_type). - * user: Pointer to context for use by the callback receiver. - * info: Pointer to optional parameter according to event type: - * - EVENT_MORE_DATA: pointer to AudioTrack::Buffer struct. The callback must not write - * more bytes than indicated by 'size' field and update 'size' if fewer bytes are - * written. - * - EVENT_UNDERRUN: unused. - * - EVENT_LOOP_END: pointer to an int indicating the number of loops remaining. - * - EVENT_MARKER: pointer to an uint32_t containing the marker position in frames. - * - EVENT_NEW_POS: pointer to an uint32_t containing the new position in frames. - * - EVENT_BUFFER_END: unused. - */ - - typedef void (*callback_t)(int event, void* user, void *info); - - /* Returns the minimum frame count required for the successful creation of - * an AudioTrack object. - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - NO_INIT: audio server or audio hardware not initialized - */ - - static status_t getMinFrameCount(size_t* frameCount, - audio_stream_type_t streamType = AUDIO_STREAM_DEFAULT, - uint32_t sampleRate = 0); - - /* Constructs an uninitialized AudioTrack. No connection with - * AudioFlinger takes place. Use set() after this. - */ - AudioTrack(); - - /* Creates an AudioTrack object and registers it with AudioFlinger. - * Once created, the track needs to be started before it can be used. - * Unspecified values are set to appropriate default values. - * With this constructor, the track is configured for streaming mode. - * Data to be rendered is supplied by write() or by the callback EVENT_MORE_DATA. - * Intermixing a combination of write() and non-ignored EVENT_MORE_DATA is deprecated. - * - * Parameters: - * - * streamType: Select the type of audio stream this track is attached to - * (e.g. AUDIO_STREAM_MUSIC). - * sampleRate: Track sampling rate in Hz. - * format: Audio format (e.g AUDIO_FORMAT_PCM_16_BIT for signed - * 16 bits per sample). - * channelMask: Channel mask. - * frameCount: Minimum size of track PCM buffer in frames. This defines the - * application's contribution to the - * latency of the track. The actual size selected by the AudioTrack could be - * larger if the requested size is not compatible with current audio HAL - * configuration. Zero means to use a default value. - * flags: See comments on audio_output_flags_t in . - * cbf: Callback function. If not null, this function is called periodically - * to provide new data and inform of marker, position updates, etc. - * user: Context for use by the callback receiver. - * notificationFrames: The callback function is called each time notificationFrames PCM - * frames have been consumed from track input buffer. - * sessionId: Specific session ID, or zero to use default. - * threadCanCallJava: Whether callbacks are made from an attached thread and thus can call JNI. - * If not present in parameter list, then fixed at false. - */ - - AudioTrack( audio_stream_type_t streamType, - uint32_t sampleRate = 0, - audio_format_t format = AUDIO_FORMAT_DEFAULT, - audio_channel_mask_t channelMask = 0, - int frameCount = 0, - audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE, - callback_t cbf = NULL, - void* user = NULL, - int notificationFrames = 0, - int sessionId = 0); - - /* Creates an audio track and registers it with AudioFlinger. - * With this constructor, the track is configured for static buffer mode. - * The format must not be 8-bit linear PCM. - * Data to be rendered is passed in a shared memory buffer - * identified by the argument sharedBuffer, which must be non-0. - * The memory should be initialized to the desired data before calling start(). - * The write() method is not supported in this case. - * It is recommended to pass a callback function to be notified of playback end by an - * EVENT_UNDERRUN event. - * FIXME EVENT_MORE_DATA still occurs; it must be ignored. - */ - - AudioTrack( audio_stream_type_t streamType, - uint32_t sampleRate = 0, - audio_format_t format = AUDIO_FORMAT_DEFAULT, - audio_channel_mask_t channelMask = 0, - const sp& sharedBuffer = 0, - audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE, - callback_t cbf = NULL, - void* user = NULL, - int notificationFrames = 0, - int sessionId = 0); - - /* Terminates the AudioTrack and unregisters it from AudioFlinger. - * Also destroys all resources associated with the AudioTrack. - */ - ~AudioTrack(); - - /* Initialize an uninitialized AudioTrack. - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful initialization - * - INVALID_OPERATION: AudioTrack is already initialized - * - BAD_VALUE: invalid parameter (channelMask, format, sampleRate...) - * - NO_INIT: audio server or audio hardware not initialized - * If sharedBuffer is non-0, the frameCount parameter is ignored and - * replaced by the shared buffer's total allocated size in frame units. - */ - status_t set(audio_stream_type_t streamType = AUDIO_STREAM_DEFAULT, - uint32_t sampleRate = 0, - audio_format_t format = AUDIO_FORMAT_DEFAULT, - audio_channel_mask_t channelMask = 0, - int frameCount = 0, - audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE, - callback_t cbf = NULL, - void* user = NULL, - int notificationFrames = 0, - const sp& sharedBuffer = 0, - bool threadCanCallJava = false, - int sessionId = 0); - - /* Result of constructing the AudioTrack. This must be checked - * before using any AudioTrack API (except for set()), because using - * an uninitialized AudioTrack produces undefined results. - * See set() method above for possible return codes. - */ - status_t initCheck() const { return mStatus; } - - /* Returns this track's estimated latency in milliseconds. - * This includes the latency due to AudioTrack buffer size, AudioMixer (if any) - * and audio hardware driver. - */ - uint32_t latency() const { return mLatency; } - - /* getters, see constructors and set() */ - - audio_stream_type_t streamType() const { return mStreamType; } - audio_format_t format() const { return mFormat; } - - /* Return frame size in bytes, which for linear PCM is channelCount * (bit depth per channel / 8). - * channelCount is determined from channelMask, and bit depth comes from format. - * For non-linear formats, the frame size is typically 1 byte. - */ - uint32_t channelCount() const { return mChannelCount; } - - uint32_t frameCount() const { return mFrameCount; } - size_t frameSize() const { return mFrameSize; } - - /* Return the static buffer specified in constructor or set(), or 0 for streaming mode */ - sp sharedBuffer() const { return mSharedBuffer; } - - /* After it's created the track is not active. Call start() to - * make it active. If set, the callback will start being called. - * If the track was previously paused, volume is ramped up over the first mix buffer. - */ - void start(); - - /* Stop a track. - * In static buffer mode, the track is stopped immediately. - * In streaming mode, the callback will cease being called and - * obtainBuffer returns STOPPED. Note that obtainBuffer() still works - * and will fill up buffers until the pool is exhausted. - * The stop does not occur immediately: any data remaining in the buffer - * is first drained, mixed, and output, and only then is the track marked as stopped. - */ - void stop(); - bool stopped() const; - - /* Flush a stopped or paused track. All previously buffered data is discarded immediately. - * This has the effect of draining the buffers without mixing or output. - * Flush is intended for streaming mode, for example before switching to non-contiguous content. - * This function is a no-op if the track is not stopped or paused, or uses a static buffer. - */ - void flush(); - - /* Pause a track. After pause, the callback will cease being called and - * obtainBuffer returns STOPPED. Note that obtainBuffer() still works - * and will fill up buffers until the pool is exhausted. - * Volume is ramped down over the next mix buffer following the pause request, - * and then the track is marked as paused. It can be resumed with ramp up by start(). - */ - void pause(); - - /* Set volume for this track, mostly used for games' sound effects - * left and right volumes. Levels must be >= 0.0 and <= 1.0. - * This is the older API. New applications should use setVolume(float) when possible. - */ - status_t setVolume(float left, float right); - - /* Set volume for all channels. This is the preferred API for new applications, - * especially for multi-channel content. - */ - status_t setVolume(float volume); - - /* Set the send level for this track. An auxiliary effect should be attached - * to the track with attachEffect(). Level must be >= 0.0 and <= 1.0. - */ - status_t setAuxEffectSendLevel(float level); - void getAuxEffectSendLevel(float* level) const; - - /* Set sample rate for this track in Hz, mostly used for games' sound effects - */ - status_t setSampleRate(uint32_t sampleRate); - - /* Return current sample rate in Hz, or 0 if unknown */ - uint32_t getSampleRate() const; - - /* Enables looping and sets the start and end points of looping. - * Only supported for static buffer mode. - * - * Parameters: - * - * loopStart: loop start expressed as the number of PCM frames played since AudioTrack start. - * loopEnd: loop end expressed as the number of PCM frames played since AudioTrack start. - * loopCount: number of loops to execute. Calling setLoop() with loopCount == 0 cancels any - * pending or active loop. loopCount = -1 means infinite looping. - * - * For proper operation the following condition must be respected: - * (loopEnd-loopStart) <= framecount() - */ - status_t setLoop(uint32_t loopStart, uint32_t loopEnd, int loopCount); - - /* Sets marker position. When playback reaches the number of frames specified, a callback with - * event type EVENT_MARKER is called. Calling setMarkerPosition with marker == 0 cancels marker - * notification callback. To set a marker at a position which would compute as 0, - * a workaround is to the set the marker at a nearby position such as -1 or 1. - * If the AudioTrack has been opened with no callback function associated, the operation will - * fail. - * - * Parameters: - * - * marker: marker position expressed in wrapping (overflow) frame units, - * like the return value of getPosition(). - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the AudioTrack has no callback installed. - */ - status_t setMarkerPosition(uint32_t marker); - status_t getMarkerPosition(uint32_t *marker) const; - - /* Sets position update period. Every time the number of frames specified has been played, - * a callback with event type EVENT_NEW_POS is called. - * Calling setPositionUpdatePeriod with updatePeriod == 0 cancels new position notification - * callback. - * If the AudioTrack has been opened with no callback function associated, the operation will - * fail. - * Extremely small values may be rounded up to a value the implementation can support. - * - * Parameters: - * - * updatePeriod: position update notification period expressed in frames. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the AudioTrack has no callback installed. - */ - status_t setPositionUpdatePeriod(uint32_t updatePeriod); - status_t getPositionUpdatePeriod(uint32_t *updatePeriod) const; - - /* Sets playback head position within AudioTrack buffer. The new position is specified - * in number of frames. - * This method must be called with the AudioTrack in paused or stopped state. - * Note that the actual position set is modulo the AudioTrack buffer size in frames. - * Therefore using this method makes sense only when playing a "static" audio buffer - * as opposed to streaming. - * The getPosition() method on the other hand returns the total number of frames played since - * playback start. - * - * Parameters: - * - * position: New playback head position within AudioTrack buffer. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the AudioTrack is not stopped or paused, or is streaming mode. - * - BAD_VALUE: The specified position is beyond the number of frames present in AudioTrack - * buffer - */ - status_t setPosition(uint32_t position); - - /* Return the total number of frames played since playback start. - * The counter will wrap (overflow) periodically, e.g. every ~27 hours at 44.1 kHz. - * It is reset to zero by flush(), reload(), and stop(). - */ - status_t getPosition(uint32_t *position); - - /* Forces AudioTrack buffer full condition. When playing a static buffer, this method avoids - * rewriting the buffer before restarting playback after a stop. - * This method must be called with the AudioTrack in paused or stopped state. - * Not allowed in streaming mode. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the AudioTrack is not stopped or paused, or is streaming mode. - */ - status_t reload(); - - /* Returns a handle on the audio output used by this AudioTrack. - * - * Parameters: - * none. - * - * Returned value: - * handle on audio hardware output - */ - audio_io_handle_t getOutput(); - - /* Returns the unique session ID associated with this track. - * - * Parameters: - * none. - * - * Returned value: - * AudioTrack session ID. - */ - int getSessionId() const { return mSessionId; } - - /* Attach track auxiliary output to specified effect. Use effectId = 0 - * to detach track from effect. - * - * Parameters: - * - * effectId: effectId obtained from AudioEffect::id(). - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the effect is not an auxiliary effect. - * - BAD_VALUE: The specified effect ID is invalid - */ - status_t attachAuxEffect(int effectId); - - /* Obtains a buffer of "frameCount" frames. The buffer must be - * filled entirely, and then released with releaseBuffer(). - * If the track is stopped, obtainBuffer() returns - * STOPPED instead of NO_ERROR as long as there are buffers available, - * at which point NO_MORE_BUFFERS is returned. - * Buffers will be returned until the pool - * is exhausted, at which point obtainBuffer() will either block - * or return WOULD_BLOCK depending on the value of the "blocking" - * parameter. - * - * obtainBuffer() and releaseBuffer() are deprecated for direct use by applications, - * which should use write() or callback EVENT_MORE_DATA instead. - * - * Interpretation of waitCount: - * +n limits wait time to n * WAIT_PERIOD_MS, - * -1 causes an (almost) infinite wait time, - * 0 non-blocking. - * - * Buffer fields - * On entry: - * frameCount number of frames requested - * After error return: - * frameCount 0 - * size 0 - * raw undefined - * After successful return: - * frameCount actual number of frames available, <= number requested - * size actual number of bytes available - * raw pointer to the buffer - */ - - enum { - NO_MORE_BUFFERS = 0x80000001, // same name in AudioFlinger.h, ok to be different value - STOPPED = 1 - }; - - status_t obtainBuffer(Buffer* audioBuffer, int32_t waitCount); - - /* Release a filled buffer of "frameCount" frames for AudioFlinger to process. */ - void releaseBuffer(Buffer* audioBuffer); - - /* As a convenience we provide a write() interface to the audio buffer. - * This is implemented on top of obtainBuffer/releaseBuffer. For best - * performance use callbacks. Returns actual number of bytes written >= 0, - * or one of the following negative status codes: - * INVALID_OPERATION AudioTrack is configured for shared buffer mode - * BAD_VALUE size is invalid - * STOPPED AudioTrack was stopped during the write - * NO_MORE_BUFFERS when obtainBuffer() returns same - * or any other error code returned by IAudioTrack::start() or restoreTrack_l(). - * Not supported for static buffer mode. - */ - ssize_t write(const void* buffer, size_t size); - - /* - * Dumps the state of an audio track. - */ - status_t dump(int fd, const Vector& args) const; - -protected: - /* copying audio tracks is not allowed */ - AudioTrack(const AudioTrack& other); - AudioTrack& operator = (const AudioTrack& other); - - /* a small internal class to handle the callback */ - class AudioTrackThread : public Thread - { - public: - AudioTrackThread(AudioTrack& receiver, bool bCanCallJava = false); - - // Do not call Thread::requestExitAndWait() without first calling requestExit(). - // Thread::requestExitAndWait() is not virtual, and the implementation doesn't do enough. - virtual void requestExit(); - - void pause(); // suspend thread from execution at next loop boundary - void resume(); // allow thread to execute, if not requested to exit - - private: - friend class AudioTrack; - virtual bool threadLoop(); - AudioTrack& mReceiver; - ~AudioTrackThread(); - Mutex mMyLock; // Thread::mLock is private - Condition mMyCond; // Thread::mThreadExitedCondition is private - bool mPaused; // whether thread is currently paused - }; - - // body of AudioTrackThread::threadLoop() - bool processAudioBuffer(const sp& thread); - - // caller must hold lock on mLock for all _l methods - status_t createTrack_l(audio_stream_type_t streamType, - uint32_t sampleRate, - audio_format_t format, - size_t frameCount, - audio_output_flags_t flags, - const sp& sharedBuffer, - audio_io_handle_t output); - - // can only be called when !mActive - void flush_l(); - - status_t setLoop_l(uint32_t loopStart, uint32_t loopEnd, int loopCount); - audio_io_handle_t getOutput_l(); - status_t restoreTrack_l(audio_track_cblk_t*& cblk, bool fromStart); - bool stopped_l() const { return !mActive; } - - sp mAudioTrack; - sp mCblkMemory; - sp mAudioTrackThread; - - float mVolume[2]; - float mSendLevel; - uint32_t mSampleRate; - size_t mFrameCount; // corresponds to current IAudioTrack - size_t mReqFrameCount; // frame count to request the next time a new - // IAudioTrack is needed - - audio_track_cblk_t* mCblk; // re-load after mLock.unlock() - - // Starting address of buffers in shared memory. If there is a shared buffer, mBuffers - // is the value of pointer() for the shared buffer, otherwise mBuffers points - // immediately after the control block. This address is for the mapping within client - // address space. AudioFlinger::TrackBase::mBuffer is for the server address space. - void* mBuffers; - - audio_format_t mFormat; // as requested by client, not forced to 16-bit - audio_stream_type_t mStreamType; - uint32_t mChannelCount; - audio_channel_mask_t mChannelMask; - - // mFrameSize is equal to mFrameSizeAF for non-PCM or 16-bit PCM data. - // For 8-bit PCM data, mFrameSizeAF is - // twice as large because data is expanded to 16-bit before being stored in buffer. - size_t mFrameSize; // app-level frame size - size_t mFrameSizeAF; // AudioFlinger frame size - - status_t mStatus; - uint32_t mLatency; - - bool mActive; // protected by mLock - - callback_t mCbf; // callback handler for events, or NULL - void* mUserData; // for client callback handler - - // for notification APIs - uint32_t mNotificationFramesReq; // requested number of frames between each - // notification callback - uint32_t mNotificationFramesAct; // actual number of frames between each - // notification callback - sp mSharedBuffer; - int mLoopCount; - uint32_t mRemainingFrames; - uint32_t mMarkerPosition; // in wrapping (overflow) frame units - bool mMarkerReached; - uint32_t mNewPosition; // in frames - uint32_t mUpdatePeriod; // in frames - - bool mFlushed; // FIXME will be made obsolete by making flush() synchronous - audio_output_flags_t mFlags; - int mSessionId; - int mAuxEffectId; - - // When locking both mLock and mCblk->lock, must lock in this order to avoid deadlock: - // 1. mLock - // 2. mCblk->lock - // It is OK to lock only mCblk->lock. - mutable Mutex mLock; - - bool mIsTimed; - int mPreviousPriority; // before start() - SchedPolicy mPreviousSchedulingGroup; - AudioTrackClientProxy* mProxy; - bool mAwaitBoost; // thread should wait for priority boost before running -}; - -class TimedAudioTrack : public AudioTrack -{ -public: - TimedAudioTrack(); - - /* allocate a shared memory buffer that can be passed to queueTimedBuffer */ - status_t allocateTimedBuffer(size_t size, sp* buffer); - - /* queue a buffer obtained via allocateTimedBuffer for playback at the - given timestamp. PTS units are microseconds on the media time timeline. - The media time transform (set with setMediaTimeTransform) set by the - audio producer will handle converting from media time to local time - (perhaps going through the common time timeline in the case of - synchronized multiroom audio case) */ - status_t queueTimedBuffer(const sp& buffer, int64_t pts); - - /* define a transform between media time and either common time or - local time */ - enum TargetTimeline {LOCAL_TIME, COMMON_TIME}; - status_t setMediaTimeTransform(const LinearTransform& xform, - TargetTimeline target); -}; - -}; // namespace android - -#endif // ANDROID_AUDIOTRACK_H diff --git a/external/android/include/18/frameworks/av/include/media/EffectsFactoryApi.h b/external/android/include/18/frameworks/av/include/media/EffectsFactoryApi.h deleted file mode 100644 index b1ed7b0..0000000 --- a/external/android/include/18/frameworks/av/include/media/EffectsFactoryApi.h +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright (C) 2010 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_EFFECTSFACTORYAPI_H_ -#define ANDROID_EFFECTSFACTORYAPI_H_ - -#include -#include -#include -#include - -#if __cplusplus -extern "C" { -#endif - -///////////////////////////////////////////////// -// Effect factory interface -///////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectQueryNumberEffects -// -// Description: Returns the number of different effects in all loaded libraries. -// Each effect must have a different effect uuid (see -// effect_descriptor_t). This function together with EffectQueryEffect() -// is used to enumerate all effects present in all loaded libraries. -// Each time EffectQueryNumberEffects() is called, the factory must -// reset the index of the effect descriptor returned by next call to -// EffectQueryEffect() to restart enumeration from the beginning. -// -// Input/Output: -// pNumEffects: address where the number of effects should be returned. -// -// Output: -// returned value: 0 successful operation. -// -ENODEV factory failed to initialize -// -EINVAL invalid pNumEffects -// *pNumEffects: updated with number of effects in factory -// -//////////////////////////////////////////////////////////////////////////////// -int EffectQueryNumberEffects(uint32_t *pNumEffects); - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectQueryEffect -// -// Description: Returns a descriptor of the next available effect. -// See effect_descriptor_t for a details on effect descriptor. -// This function together with EffectQueryNumberEffects() is used to enumerate all -// effects present in all loaded libraries. The enumeration sequence is: -// EffectQueryNumberEffects(&num_effects); -// for (i = 0; i < num_effects; i++) -// EffectQueryEffect(i,...); -// -// Input/Output: -// pDescriptor: address where to return the effect descriptor. -// -// Output: -// returned value: 0 successful operation. -// -ENOENT no more effect available -// -ENODEV factory failed to initialize -// -EINVAL invalid pDescriptor -// -ENOSYS effect list has changed since last execution of -// EffectQueryNumberEffects() -// *pDescriptor: updated with the effect descriptor. -// -//////////////////////////////////////////////////////////////////////////////// -int EffectQueryEffect(uint32_t index, effect_descriptor_t *pDescriptor); - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectCreate -// -// Description: Creates an effect engine of the specified type and returns an -// effect control interface on this engine. The function will allocate the -// resources for an instance of the requested effect engine and return -// a handle on the effect control interface. -// -// Input: -// pEffectUuid: pointer to the effect uuid. -// sessionId: audio session to which this effect instance will be attached. All effects -// created with the same session ID are connected in series and process the same signal -// stream. Knowing that two effects are part of the same effect chain can help the -// library implement some kind of optimizations. -// ioId: identifies the output or input stream this effect is directed to at audio HAL. -// For future use especially with tunneled HW accelerated effects -// -// Input/Output: -// pHandle: address where to return the effect handle. -// -// Output: -// returned value: 0 successful operation. -// -ENODEV factory failed to initialize -// -EINVAL invalid pEffectUuid or pHandle -// -ENOENT no effect with this uuid found -// *pHandle: updated with the effect handle. -// -//////////////////////////////////////////////////////////////////////////////// -int EffectCreate(const effect_uuid_t *pEffectUuid, int32_t sessionId, int32_t ioId, - effect_handle_t *pHandle); - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectRelease -// -// Description: Releases the effect engine whose handle is given as argument. -// All resources allocated to this particular instance of the effect are -// released. -// -// Input: -// handle: handle on the effect interface to be released. -// -// Output: -// returned value: 0 successful operation. -// -ENODEV factory failed to initialize -// -EINVAL invalid interface handle -// -//////////////////////////////////////////////////////////////////////////////// -int EffectRelease(effect_handle_t handle); - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectGetDescriptor -// -// Description: Returns the descriptor of the effect which uuid is pointed -// to by first argument. -// -// Input: -// pEffectUuid: pointer to the effect uuid. -// -// Input/Output: -// pDescriptor: address where to return the effect descriptor. -// -// Output: -// returned value: 0 successful operation. -// -ENODEV factory failed to initialize -// -EINVAL invalid pEffectUuid or pDescriptor -// -ENOENT no effect with this uuid found -// *pDescriptor: updated with the effect descriptor. -// -//////////////////////////////////////////////////////////////////////////////// -int EffectGetDescriptor(const effect_uuid_t *pEffectUuid, effect_descriptor_t *pDescriptor); - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectIsNullUuid -// -// Description: Helper function to compare effect uuid to EFFECT_UUID_NULL -// -// Input: -// pEffectUuid: pointer to effect uuid to compare to EFFECT_UUID_NULL. -// -// Output: -// returned value: 0 if uuid is different from EFFECT_UUID_NULL. -// 1 if uuid is equal to EFFECT_UUID_NULL. -// -//////////////////////////////////////////////////////////////////////////////// -int EffectIsNullUuid(const effect_uuid_t *pEffectUuid); - -#if __cplusplus -} // extern "C" -#endif - - -#endif /*ANDROID_EFFECTSFACTORYAPI_H_*/ diff --git a/external/android/include/18/frameworks/av/include/media/ExtendedAudioBufferProvider.h b/external/android/include/18/frameworks/av/include/media/ExtendedAudioBufferProvider.h deleted file mode 100644 index 00c4444..0000000 --- a/external/android/include/18/frameworks/av/include/media/ExtendedAudioBufferProvider.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2012 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_EXTENDED_AUDIO_BUFFER_PROVIDER_H -#define ANDROID_EXTENDED_AUDIO_BUFFER_PROVIDER_H - -#include - -namespace android { - -class ExtendedAudioBufferProvider : public AudioBufferProvider { -public: - virtual size_t framesReady() const = 0; // see description at AudioFlinger.h -}; - -} // namespace android - -#endif // ANDROID_EXTENDED_AUDIO_BUFFER_PROVIDER_H diff --git a/external/android/include/18/frameworks/av/include/media/IAudioFlinger.h b/external/android/include/18/frameworks/av/include/media/IAudioFlinger.h deleted file mode 100644 index 9c3067e..0000000 --- a/external/android/include/18/frameworks/av/include/media/IAudioFlinger.h +++ /dev/null @@ -1,214 +0,0 @@ -/* - * 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_IAUDIOFLINGER_H -#define ANDROID_IAUDIOFLINGER_H - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class IAudioFlinger : public IInterface -{ -public: - DECLARE_META_INTERFACE(AudioFlinger); - - // or-able bits shared by createTrack and openRecord, but not all combinations make sense - enum { - TRACK_DEFAULT = 0, // client requests a default AudioTrack - TRACK_TIMED = 1, // client requests a TimedAudioTrack - TRACK_FAST = 2, // client requests a fast AudioTrack or AudioRecord - }; - typedef uint32_t track_flags_t; - - /* create an audio track and registers it with AudioFlinger. - * return null if the track cannot be created. - */ - virtual sp createTrack( - audio_stream_type_t streamType, - uint32_t sampleRate, - audio_format_t format, - audio_channel_mask_t channelMask, - size_t frameCount, - track_flags_t *flags, - const sp& sharedBuffer, - audio_io_handle_t output, - pid_t tid, // -1 means unused, otherwise must be valid non-0 - int *sessionId, - status_t *status) = 0; - - virtual sp openRecord( - audio_io_handle_t input, - uint32_t sampleRate, - audio_format_t format, - audio_channel_mask_t channelMask, - size_t frameCount, - track_flags_t flags, - pid_t tid, // -1 means unused, otherwise must be valid non-0 - int *sessionId, - status_t *status) = 0; - - /* query the audio hardware state. This state never changes, - * and therefore can be cached. - */ - virtual uint32_t sampleRate(audio_io_handle_t output) const = 0; -#if 0 - virtual int channelCount(audio_io_handle_t output) const = 0; -#endif - virtual audio_format_t format(audio_io_handle_t output) const = 0; - virtual size_t frameCount(audio_io_handle_t output) const = 0; - - // return estimated latency in milliseconds - virtual uint32_t latency(audio_io_handle_t output) const = 0; - - /* set/get the audio hardware state. This will probably be used by - * the preference panel, mostly. - */ - virtual status_t setMasterVolume(float value) = 0; - virtual status_t setMasterMute(bool muted) = 0; - - virtual float masterVolume() const = 0; - virtual bool masterMute() const = 0; - - /* set/get stream type state. This will probably be used by - * the preference panel, mostly. - */ - virtual status_t setStreamVolume(audio_stream_type_t stream, float value, - audio_io_handle_t output) = 0; - virtual status_t setStreamMute(audio_stream_type_t stream, bool muted) = 0; - - virtual float streamVolume(audio_stream_type_t stream, - audio_io_handle_t output) const = 0; - virtual bool streamMute(audio_stream_type_t stream) const = 0; - - // set audio mode - virtual status_t setMode(audio_mode_t mode) = 0; - - // mic mute/state - virtual status_t setMicMute(bool state) = 0; - virtual bool getMicMute() const = 0; - - virtual status_t setParameters(audio_io_handle_t ioHandle, - const String8& keyValuePairs) = 0; - virtual String8 getParameters(audio_io_handle_t ioHandle, const String8& keys) - const = 0; - - // register a current process for audio output change notifications - virtual void registerClient(const sp& client) = 0; - - // retrieve the audio recording buffer size - virtual size_t getInputBufferSize(uint32_t sampleRate, audio_format_t format, - audio_channel_mask_t channelMask) const = 0; - - virtual audio_io_handle_t openOutput(audio_module_handle_t module, - audio_devices_t *pDevices, - uint32_t *pSamplingRate, - audio_format_t *pFormat, - audio_channel_mask_t *pChannelMask, - uint32_t *pLatencyMs, - audio_output_flags_t flags) = 0; - virtual audio_io_handle_t openDuplicateOutput(audio_io_handle_t output1, - audio_io_handle_t output2) = 0; - virtual status_t closeOutput(audio_io_handle_t output) = 0; - virtual status_t suspendOutput(audio_io_handle_t output) = 0; - virtual status_t restoreOutput(audio_io_handle_t output) = 0; - - virtual audio_io_handle_t openInput(audio_module_handle_t module, - audio_devices_t *pDevices, - uint32_t *pSamplingRate, - audio_format_t *pFormat, - audio_channel_mask_t *pChannelMask) = 0; - virtual status_t closeInput(audio_io_handle_t input) = 0; - - virtual status_t setStreamOutput(audio_stream_type_t stream, audio_io_handle_t output) = 0; - - virtual status_t setVoiceVolume(float volume) = 0; - - virtual status_t getRenderPosition(size_t *halFrames, size_t *dspFrames, - audio_io_handle_t output) const = 0; - - virtual size_t getInputFramesLost(audio_io_handle_t ioHandle) const = 0; - - virtual int newAudioSessionId() = 0; - - virtual void acquireAudioSessionId(int audioSession) = 0; - virtual void releaseAudioSessionId(int audioSession) = 0; - - virtual status_t queryNumberEffects(uint32_t *numEffects) const = 0; - - virtual status_t queryEffect(uint32_t index, effect_descriptor_t *pDescriptor) const = 0; - - virtual status_t getEffectDescriptor(const effect_uuid_t *pEffectUUID, - effect_descriptor_t *pDescriptor) const = 0; - - virtual sp createEffect( - effect_descriptor_t *pDesc, - const sp& client, - int32_t priority, - audio_io_handle_t output, - int sessionId, - status_t *status, - int *id, - int *enabled) = 0; - - virtual status_t moveEffects(int session, audio_io_handle_t srcOutput, - audio_io_handle_t dstOutput) = 0; - - virtual audio_module_handle_t loadHwModule(const char *name) = 0; - - // helpers for android.media.AudioManager.getProperty(), see description there for meaning - // FIXME move these APIs to AudioPolicy to permit a more accurate implementation - // that looks on primary device for a stream with fast flag, primary flag, or first one. - virtual uint32_t getPrimaryOutputSamplingRate() = 0; - virtual size_t getPrimaryOutputFrameCount() = 0; - -}; - - -// ---------------------------------------------------------------------------- - -class BnAudioFlinger : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IAUDIOFLINGER_H diff --git a/external/android/include/18/frameworks/av/include/media/IAudioFlingerClient.h b/external/android/include/18/frameworks/av/include/media/IAudioFlingerClient.h deleted file mode 100644 index 75a9971..0000000 --- a/external/android/include/18/frameworks/av/include/media/IAudioFlingerClient.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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_IAUDIOFLINGERCLIENT_H -#define ANDROID_IAUDIOFLINGERCLIENT_H - - -#include -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class IAudioFlingerClient : public IInterface -{ -public: - DECLARE_META_INTERFACE(AudioFlingerClient); - - // Notifies a change of audio input/output configuration. - virtual void ioConfigChanged(int event, audio_io_handle_t ioHandle, const void *param2) = 0; - -}; - - -// ---------------------------------------------------------------------------- - -class BnAudioFlingerClient : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IAUDIOFLINGERCLIENT_H diff --git a/external/android/include/18/frameworks/av/include/media/IAudioPolicyService.h b/external/android/include/18/frameworks/av/include/media/IAudioPolicyService.h deleted file mode 100644 index b5ad4ef..0000000 --- a/external/android/include/18/frameworks/av/include/media/IAudioPolicyService.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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_IAUDIOPOLICYSERVICE_H -#define ANDROID_IAUDIOPOLICYSERVICE_H - -#include -#include -#include - -#include -#include -#include -#include - -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class IAudioPolicyService : public IInterface -{ -public: - DECLARE_META_INTERFACE(AudioPolicyService); - - // - // IAudioPolicyService interface (see AudioPolicyInterface for method descriptions) - // - virtual status_t setDeviceConnectionState(audio_devices_t device, - audio_policy_dev_state_t state, - const char *device_address) = 0; - virtual audio_policy_dev_state_t getDeviceConnectionState(audio_devices_t device, - const char *device_address) = 0; - virtual status_t setPhoneState(audio_mode_t state) = 0; - virtual status_t setForceUse(audio_policy_force_use_t usage, - audio_policy_forced_cfg_t config) = 0; - virtual audio_policy_forced_cfg_t getForceUse(audio_policy_force_use_t usage) = 0; - virtual audio_io_handle_t getOutput(audio_stream_type_t stream, - uint32_t samplingRate = 0, - audio_format_t format = AUDIO_FORMAT_DEFAULT, - audio_channel_mask_t channelMask = 0, - audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE) = 0; - virtual status_t startOutput(audio_io_handle_t output, - audio_stream_type_t stream, - int session = 0) = 0; - virtual status_t stopOutput(audio_io_handle_t output, - audio_stream_type_t stream, - int session = 0) = 0; - virtual void releaseOutput(audio_io_handle_t output) = 0; - virtual audio_io_handle_t getInput(audio_source_t inputSource, - uint32_t samplingRate = 0, - audio_format_t format = AUDIO_FORMAT_DEFAULT, - audio_channel_mask_t channelMask = 0, - int audioSession = 0) = 0; - virtual status_t startInput(audio_io_handle_t input) = 0; - virtual status_t stopInput(audio_io_handle_t input) = 0; - virtual void releaseInput(audio_io_handle_t input) = 0; - virtual status_t initStreamVolume(audio_stream_type_t stream, - int indexMin, - int indexMax) = 0; - virtual status_t setStreamVolumeIndex(audio_stream_type_t stream, - int index, - audio_devices_t device) = 0; - virtual status_t getStreamVolumeIndex(audio_stream_type_t stream, - int *index, - audio_devices_t device) = 0; - virtual uint32_t getStrategyForStream(audio_stream_type_t stream) = 0; - virtual audio_devices_t getDevicesForStream(audio_stream_type_t stream) = 0; - virtual audio_io_handle_t getOutputForEffect(const effect_descriptor_t *desc) = 0; - virtual status_t registerEffect(const effect_descriptor_t *desc, - audio_io_handle_t io, - uint32_t strategy, - int session, - int id) = 0; - virtual status_t unregisterEffect(int id) = 0; - virtual status_t setEffectEnabled(int id, bool enabled) = 0; - virtual bool isStreamActive(audio_stream_type_t stream, uint32_t inPastMs = 0) const = 0; - virtual bool isStreamActiveRemotely(audio_stream_type_t stream, uint32_t inPastMs = 0) - const = 0; - virtual bool isSourceActive(audio_source_t source) const = 0; - virtual status_t queryDefaultPreProcessing(int audioSession, - effect_descriptor_t *descriptors, - uint32_t *count) = 0; -}; - - -// ---------------------------------------------------------------------------- - -class BnAudioPolicyService : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IAUDIOPOLICYSERVICE_H diff --git a/external/android/include/18/frameworks/av/include/media/IAudioRecord.h b/external/android/include/18/frameworks/av/include/media/IAudioRecord.h deleted file mode 100644 index d6e3141..0000000 --- a/external/android/include/18/frameworks/av/include/media/IAudioRecord.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 IAUDIORECORD_H_ -#define IAUDIORECORD_H_ - -#include -#include - -#include -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class IAudioRecord : public IInterface -{ -public: - DECLARE_META_INTERFACE(AudioRecord); - - /* After it's created the track is not active. Call start() to - * make it active. - */ - virtual status_t start(int /*AudioSystem::sync_event_t*/ event, int triggerSession) = 0; - - /* Stop a track. If set, the callback will cease being called and - * obtainBuffer will return an error. Buffers that are already released - * will be processed, unless flush() is called. - */ - virtual void stop() = 0; - - /* get this tracks control block */ - virtual sp getCblk() const = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnAudioRecord : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif /*IAUDIORECORD_H_*/ diff --git a/external/android/include/18/frameworks/av/include/media/IAudioTrack.h b/external/android/include/18/frameworks/av/include/media/IAudioTrack.h deleted file mode 100644 index 144be0e..0000000 --- a/external/android/include/18/frameworks/av/include/media/IAudioTrack.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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_IAUDIOTRACK_H -#define ANDROID_IAUDIOTRACK_H - -#include -#include - -#include -#include -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class IAudioTrack : public IInterface -{ -public: - DECLARE_META_INTERFACE(AudioTrack); - - /* Get this track's control block */ - virtual sp getCblk() const = 0; - - /* After it's created the track is not active. Call start() to - * make it active. - */ - virtual status_t start() = 0; - - /* Stop a track. If set, the callback will cease being called and - * obtainBuffer will return an error. Buffers that are already released - * will continue to be processed, unless/until flush() is called. - */ - virtual void stop() = 0; - - /* Flush a stopped or paused track. All pending/released buffers are discarded. - * This function has no effect if the track is not stopped or paused. - */ - virtual void flush() = 0; - - /* Pause a track. If set, the callback will cease being called and - * obtainBuffer will return an error. Buffers that are already released - * will continue to be processed, unless/until flush() is called. - */ - virtual void pause() = 0; - - /* Attach track auxiliary output to specified effect. Use effectId = 0 - * to detach track from effect. - */ - virtual status_t attachAuxEffect(int effectId) = 0; - - - /* Allocate a shared memory buffer suitable for holding timed audio - samples */ - virtual status_t allocateTimedBuffer(size_t size, - sp* buffer) = 0; - - /* Queue a buffer obtained via allocateTimedBuffer for playback at the given - timestamp */ - virtual status_t queueTimedBuffer(const sp& buffer, - int64_t pts) = 0; - - /* Define the linear transform that will be applied to the timestamps - given to queueTimedBuffer (which are expressed in media time). - Target specifies whether this transform converts media time to local time - or Tungsten time. The values for target are defined in AudioTrack.h */ - virtual status_t setMediaTimeTransform(const LinearTransform& xform, - int target) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnAudioTrack : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IAUDIOTRACK_H diff --git a/external/android/include/18/frameworks/av/include/media/ICrypto.h b/external/android/include/18/frameworks/av/include/media/ICrypto.h deleted file mode 100644 index 9dcb8d9..0000000 --- a/external/android/include/18/frameworks/av/include/media/ICrypto.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2012 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 -#include -#include - -#ifndef ANDROID_ICRYPTO_H_ - -#define ANDROID_ICRYPTO_H_ - -namespace android { - -struct AString; - -struct ICrypto : public IInterface { - DECLARE_META_INTERFACE(Crypto); - - virtual status_t initCheck() const = 0; - - virtual bool isCryptoSchemeSupported(const uint8_t uuid[16]) = 0; - - virtual status_t createPlugin( - const uint8_t uuid[16], const void *data, size_t size) = 0; - - virtual status_t destroyPlugin() = 0; - - virtual bool requiresSecureDecoderComponent( - const char *mime) const = 0; - - virtual ssize_t decrypt( - bool secure, - const uint8_t key[16], - const uint8_t iv[16], - CryptoPlugin::Mode mode, - const void *srcPtr, - const CryptoPlugin::SubSample *subSamples, size_t numSubSamples, - void *dstPtr, - AString *errorDetailMsg) = 0; - -private: - DISALLOW_EVIL_CONSTRUCTORS(ICrypto); -}; - -struct BnCrypto : public BnInterface { - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -}; - -} // namespace android - -#endif // ANDROID_ICRYPTO_H_ - diff --git a/external/android/include/18/frameworks/av/include/media/IDrm.h b/external/android/include/18/frameworks/av/include/media/IDrm.h deleted file mode 100644 index d630c40..0000000 --- a/external/android/include/18/frameworks/av/include/media/IDrm.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2013 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 -#include -#include -#include - -#ifndef ANDROID_IDRM_H_ - -#define ANDROID_IDRM_H_ - -namespace android { - -struct AString; - -struct IDrm : public IInterface { - DECLARE_META_INTERFACE(Drm); - - virtual status_t initCheck() const = 0; - - virtual bool isCryptoSchemeSupported(const uint8_t uuid[16]) = 0; - - virtual status_t createPlugin(const uint8_t uuid[16]) = 0; - - virtual status_t destroyPlugin() = 0; - - virtual status_t openSession(Vector &sessionId) = 0; - - virtual status_t closeSession(Vector const &sessionId) = 0; - - virtual status_t - getKeyRequest(Vector const &sessionId, - Vector const &initData, - String8 const &mimeType, DrmPlugin::KeyType keyType, - KeyedVector const &optionalParameters, - Vector &request, String8 &defaultUrl) = 0; - - virtual status_t provideKeyResponse(Vector const &sessionId, - Vector const &response, - Vector &keySetId) = 0; - - virtual status_t removeKeys(Vector const &keySetId) = 0; - - virtual status_t restoreKeys(Vector const &sessionId, - Vector const &keySetId) = 0; - - virtual status_t queryKeyStatus(Vector const &sessionId, - KeyedVector &infoMap) const = 0; - - virtual status_t getProvisionRequest(Vector &request, - String8 &defaulUrl) = 0; - - virtual status_t provideProvisionResponse(Vector const &response) = 0; - - virtual status_t getSecureStops(List > &secureStops) = 0; - - virtual status_t releaseSecureStops(Vector const &ssRelease) = 0; - - virtual status_t getPropertyString(String8 const &name, String8 &value) const = 0; - virtual status_t getPropertyByteArray(String8 const &name, - Vector &value) const = 0; - virtual status_t setPropertyString(String8 const &name, - String8 const &value ) const = 0; - virtual status_t setPropertyByteArray(String8 const &name, - Vector const &value) const = 0; - - virtual status_t setCipherAlgorithm(Vector const &sessionId, - String8 const &algorithm) = 0; - - virtual status_t setMacAlgorithm(Vector const &sessionId, - String8 const &algorithm) = 0; - - virtual status_t encrypt(Vector const &sessionId, - Vector const &keyId, - Vector const &input, - Vector const &iv, - Vector &output) = 0; - - virtual status_t decrypt(Vector const &sessionId, - Vector const &keyId, - Vector const &input, - Vector const &iv, - Vector &output) = 0; - - virtual status_t sign(Vector const &sessionId, - Vector const &keyId, - Vector const &message, - Vector &signature) = 0; - - virtual status_t verify(Vector const &sessionId, - Vector const &keyId, - Vector const &message, - Vector const &signature, - bool &match) = 0; - - virtual status_t setListener(const sp& listener) = 0; - -private: - DISALLOW_EVIL_CONSTRUCTORS(IDrm); -}; - -struct BnDrm : public BnInterface { - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -private: - void readVector(const Parcel &data, Vector &vector) const; - void writeVector(Parcel *reply, Vector const &vector) const; -}; - -} // namespace android - -#endif // ANDROID_IDRM_H_ - diff --git a/external/android/include/18/frameworks/av/include/media/IDrmClient.h b/external/android/include/18/frameworks/av/include/media/IDrmClient.h deleted file mode 100644 index 3b2fc7c..0000000 --- a/external/android/include/18/frameworks/av/include/media/IDrmClient.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2013 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_IDRMCLIENT_H -#define ANDROID_IDRMCLIENT_H - -#include -#include -#include -#include - -namespace android { - -class IDrmClient: public IInterface -{ -public: - DECLARE_META_INTERFACE(DrmClient); - - virtual void notify(DrmPlugin::EventType eventType, int extra, const Parcel *obj) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnDrmClient: public BnInterface -{ -public: - virtual status_t onTransact(uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IDRMCLIENT_H diff --git a/external/android/include/18/frameworks/av/include/media/IEffect.h b/external/android/include/18/frameworks/av/include/media/IEffect.h deleted file mode 100644 index ff04869..0000000 --- a/external/android/include/18/frameworks/av/include/media/IEffect.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2010 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_IEFFECT_H -#define ANDROID_IEFFECT_H - -#include -#include -#include -#include - -namespace android { - -class IEffect: public IInterface -{ -public: - DECLARE_META_INTERFACE(Effect); - - virtual status_t enable() = 0; - - virtual status_t disable() = 0; - - virtual status_t command(uint32_t cmdCode, - uint32_t cmdSize, - void *pCmdData, - uint32_t *pReplySize, - void *pReplyData) = 0; - - virtual void disconnect() = 0; - - virtual sp getCblk() const = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnEffect: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IEFFECT_H diff --git a/external/android/include/18/frameworks/av/include/media/IEffectClient.h b/external/android/include/18/frameworks/av/include/media/IEffectClient.h deleted file mode 100644 index 2f78c98..0000000 --- a/external/android/include/18/frameworks/av/include/media/IEffectClient.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2010 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_IEFFECTCLIENT_H -#define ANDROID_IEFFECTCLIENT_H - -#include -#include -#include -#include - -namespace android { - -class IEffectClient: public IInterface -{ -public: - DECLARE_META_INTERFACE(EffectClient); - - virtual void controlStatusChanged(bool controlGranted) = 0; - virtual void enableStatusChanged(bool enabled) = 0; - virtual void commandExecuted(uint32_t cmdCode, - uint32_t cmdSize, - void *pCmdData, - uint32_t replySize, - void *pReplyData) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnEffectClient: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IEFFECTCLIENT_H diff --git a/external/android/include/18/frameworks/av/include/media/IHDCP.h b/external/android/include/18/frameworks/av/include/media/IHDCP.h deleted file mode 100644 index 6d27b18..0000000 --- a/external/android/include/18/frameworks/av/include/media/IHDCP.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2012 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 -#include -#include - -namespace android { - -struct IHDCPObserver : public IInterface { - DECLARE_META_INTERFACE(HDCPObserver); - - virtual void notify( - int msg, int ext1, int ext2, const Parcel *obj) = 0; - -private: - DISALLOW_EVIL_CONSTRUCTORS(IHDCPObserver); -}; - -struct IHDCP : public IInterface { - DECLARE_META_INTERFACE(HDCP); - - // Called to specify the observer that receives asynchronous notifications - // from the HDCP implementation to signal completion/failure of asynchronous - // operations (such as initialization) or out of band events. - virtual status_t setObserver(const sp &observer) = 0; - - // Request to setup an HDCP session with the specified host listening - // on the specified port. - virtual status_t initAsync(const char *host, unsigned port) = 0; - - // Request to shutdown the active HDCP session. - virtual status_t shutdownAsync() = 0; - - // ENCRYPTION only: - // Encrypt data according to the HDCP spec. "size" bytes of data are - // available at "inData" (virtual address), "size" may not be a multiple - // of 128 bits (16 bytes). An equal number of encrypted bytes should be - // written to the buffer at "outData" (virtual address). - // This operation is to be synchronous, i.e. this call does not return - // until outData contains size bytes of encrypted data. - // streamCTR will be assigned by the caller (to 0 for the first PES stream, - // 1 for the second and so on) - // inputCTR _will_be_maintained_by_the_callee_ for each PES stream. - virtual status_t encrypt( - const void *inData, size_t size, uint32_t streamCTR, - uint64_t *outInputCTR, void *outData) = 0; - - // DECRYPTION only: - // Decrypt data according to the HDCP spec. - // "size" bytes of encrypted data are available at "inData" - // (virtual address), "size" may not be a multiple of 128 bits (16 bytes). - // An equal number of decrypted bytes should be written to the buffer - // at "outData" (virtual address). - // This operation is to be synchronous, i.e. this call does not return - // until outData contains size bytes of decrypted data. - // Both streamCTR and inputCTR will be provided by the caller. - virtual status_t decrypt( - const void *inData, size_t size, - uint32_t streamCTR, uint64_t inputCTR, - void *outData) = 0; - -private: - DISALLOW_EVIL_CONSTRUCTORS(IHDCP); -}; - -struct BnHDCPObserver : public BnInterface { - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -}; - -struct BnHDCP : public BnInterface { - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -}; - -} // namespace android - - diff --git a/external/android/include/18/frameworks/av/include/media/IMediaDeathNotifier.h b/external/android/include/18/frameworks/av/include/media/IMediaDeathNotifier.h deleted file mode 100644 index bb3d0d8..0000000 --- a/external/android/include/18/frameworks/av/include/media/IMediaDeathNotifier.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2010 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_IMEDIADEATHNOTIFIER_H -#define ANDROID_IMEDIADEATHNOTIFIER_H - -#include -#include -#include - -namespace android { - -class IMediaDeathNotifier: virtual public RefBase -{ -public: - IMediaDeathNotifier() { addObitRecipient(this); } - virtual ~IMediaDeathNotifier() { removeObitRecipient(this); } - - virtual void died() = 0; - static const sp& getMediaPlayerService(); - -private: - IMediaDeathNotifier &operator=(const IMediaDeathNotifier &); - IMediaDeathNotifier(const IMediaDeathNotifier &); - - static void addObitRecipient(const wp& recipient); - static void removeObitRecipient(const wp& recipient); - - class DeathNotifier: public IBinder::DeathRecipient - { - public: - DeathNotifier() {} - virtual ~DeathNotifier(); - - virtual void binderDied(const wp& who); - }; - - friend class DeathNotifier; - - static Mutex sServiceLock; - static sp sMediaPlayerService; - static sp sDeathNotifier; - static SortedVector< wp > sObitRecipients; -}; - -}; // namespace android - -#endif // ANDROID_IMEDIADEATHNOTIFIER_H diff --git a/external/android/include/18/frameworks/av/include/media/IMediaLogService.h b/external/android/include/18/frameworks/av/include/media/IMediaLogService.h deleted file mode 100644 index 1f5777e..0000000 --- a/external/android/include/18/frameworks/av/include/media/IMediaLogService.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2013 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_IMEDIALOGSERVICE_H -#define ANDROID_IMEDIALOGSERVICE_H - -#include -#include -#include - -namespace android { - -class IMediaLogService: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaLogService); - - virtual void registerWriter(const sp& shared, size_t size, const char *name) = 0; - virtual void unregisterWriter(const sp& shared) = 0; - -}; - -class BnMediaLogService: public BnInterface -{ -public: - virtual status_t onTransact(uint32_t code, const Parcel& data, Parcel* reply, - uint32_t flags = 0); -}; - -} // namespace android - -#endif // ANDROID_IMEDIALOGSERVICE_H diff --git a/external/android/include/18/frameworks/av/include/media/IMediaMetadataRetriever.h b/external/android/include/18/frameworks/av/include/media/IMediaMetadataRetriever.h deleted file mode 100644 index 6dbb2d7..0000000 --- a/external/android/include/18/frameworks/av/include/media/IMediaMetadataRetriever.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -** -** 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. -*/ - -#ifndef ANDROID_IMEDIAMETADATARETRIEVER_H -#define ANDROID_IMEDIAMETADATARETRIEVER_H - -#include -#include -#include -#include -#include - -namespace android { - -class IMediaMetadataRetriever: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaMetadataRetriever); - virtual void disconnect() = 0; - - virtual status_t setDataSource( - const char *srcUrl, - const KeyedVector *headers = NULL) = 0; - - virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; - virtual sp getFrameAtTime(int64_t timeUs, int option) = 0; - virtual sp extractAlbumArt() = 0; - virtual const char* extractMetadata(int keyCode) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnMediaMetadataRetriever: public BnInterface -{ -public: - virtual status_t onTransact(uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IMEDIAMETADATARETRIEVER_H diff --git a/external/android/include/18/frameworks/av/include/media/IMediaPlayer.h b/external/android/include/18/frameworks/av/include/media/IMediaPlayer.h deleted file mode 100644 index 0cbd269..0000000 --- a/external/android/include/18/frameworks/av/include/media/IMediaPlayer.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_IMEDIAPLAYER_H -#define ANDROID_IMEDIAPLAYER_H - -#include -#include -#include -#include -#include - -// Fwd decl to make sure everyone agrees that the scope of struct sockaddr_in is -// global, and not in android:: -struct sockaddr_in; - -namespace android { - -class Parcel; -class Surface; -class IStreamSource; -class IGraphicBufferProducer; - -class IMediaPlayer: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaPlayer); - - virtual void disconnect() = 0; - - virtual status_t setDataSource(const char *url, - const KeyedVector* headers) = 0; - virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; - virtual status_t setDataSource(const sp& source) = 0; - virtual status_t setVideoSurfaceTexture( - const sp& bufferProducer) = 0; - virtual status_t prepareAsync() = 0; - virtual status_t start() = 0; - virtual status_t stop() = 0; - virtual status_t pause() = 0; - virtual status_t isPlaying(bool* state) = 0; - virtual status_t seekTo(int msec) = 0; - virtual status_t getCurrentPosition(int* msec) = 0; - virtual status_t getDuration(int* msec) = 0; - virtual status_t reset() = 0; - virtual status_t setAudioStreamType(audio_stream_type_t type) = 0; - virtual status_t setLooping(int loop) = 0; - virtual status_t setVolume(float leftVolume, float rightVolume) = 0; - virtual status_t setAuxEffectSendLevel(float level) = 0; - virtual status_t attachAuxEffect(int effectId) = 0; - virtual status_t setParameter(int key, const Parcel& request) = 0; - virtual status_t getParameter(int key, Parcel* reply) = 0; - virtual status_t setRetransmitEndpoint(const struct sockaddr_in* endpoint) = 0; - virtual status_t getRetransmitEndpoint(struct sockaddr_in* endpoint) = 0; - virtual status_t setNextPlayer(const sp& next) = 0; - - // Invoke a generic method on the player by using opaque parcels - // for the request and reply. - // @param request Parcel that must start with the media player - // interface token. - // @param[out] reply Parcel to hold the reply data. Cannot be null. - // @return OK if the invocation was made successfully. - virtual status_t invoke(const Parcel& request, Parcel *reply) = 0; - - // Set a new metadata filter. - // @param filter A set of allow and drop rules serialized in a Parcel. - // @return OK if the invocation was made successfully. - virtual status_t setMetadataFilter(const Parcel& filter) = 0; - - // Retrieve a set of metadata. - // @param update_only Include only the metadata that have changed - // since the last invocation of getMetadata. - // The set is built using the unfiltered - // notifications the native player sent to the - // MediaPlayerService during that period of - // time. If false, all the metadatas are considered. - // @param apply_filter If true, once the metadata set has been built based - // on the value update_only, the current filter is - // applied. - // @param[out] metadata On exit contains a set (possibly empty) of metadata. - // Valid only if the call returned OK. - // @return OK if the invocation was made successfully. - virtual status_t getMetadata(bool update_only, - bool apply_filter, - Parcel *metadata) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnMediaPlayer: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IMEDIAPLAYER_H diff --git a/external/android/include/18/frameworks/av/include/media/IMediaPlayerClient.h b/external/android/include/18/frameworks/av/include/media/IMediaPlayerClient.h deleted file mode 100644 index 8f1843e..0000000 --- a/external/android/include/18/frameworks/av/include/media/IMediaPlayerClient.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_IMEDIAPLAYERCLIENT_H -#define ANDROID_IMEDIAPLAYERCLIENT_H - -#include -#include -#include - -namespace android { - -class IMediaPlayerClient: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaPlayerClient); - - virtual void notify(int msg, int ext1, int ext2, const Parcel *obj) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnMediaPlayerClient: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IMEDIAPLAYERCLIENT_H diff --git a/external/android/include/18/frameworks/av/include/media/IMediaPlayerService.h b/external/android/include/18/frameworks/av/include/media/IMediaPlayerService.h deleted file mode 100644 index fef7af2..0000000 --- a/external/android/include/18/frameworks/av/include/media/IMediaPlayerService.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_IMEDIAPLAYERSERVICE_H -#define ANDROID_IMEDIAPLAYERSERVICE_H - -#include // for status_t -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -namespace android { - -struct ICrypto; -struct IDrm; -struct IHDCP; -class IMediaRecorder; -class IOMX; -class IRemoteDisplay; -class IRemoteDisplayClient; -struct IStreamSource; - -class IMediaPlayerService: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaPlayerService); - - virtual sp createMediaRecorder() = 0; - virtual sp createMetadataRetriever() = 0; - virtual sp create(const sp& client, int audioSessionId = 0) = 0; - - virtual sp decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, audio_format_t* pFormat) = 0; - virtual sp decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, audio_format_t* pFormat) = 0; - virtual sp getOMX() = 0; - virtual sp makeCrypto() = 0; - virtual sp makeDrm() = 0; - virtual sp makeHDCP(bool createEncryptionModule) = 0; - - // Connects to a remote display. - // 'iface' specifies the address of the local interface on which to listen for - // a connection from the remote display as an ip address and port number - // of the form "x.x.x.x:y". The media server should call back into the provided remote - // display client when display connection, disconnection or errors occur. - // The assumption is that at most one remote display will be connected to the - // provided interface at a time. - virtual sp listenForRemoteDisplay(const sp& client, - const String8& iface) = 0; - - // codecs and audio devices usage tracking for the battery app - enum BatteryDataBits { - // tracking audio codec - kBatteryDataTrackAudio = 0x1, - // tracking video codec - kBatteryDataTrackVideo = 0x2, - // codec is started, otherwise codec is paused - kBatteryDataCodecStarted = 0x4, - // tracking decoder (for media player), - // otherwise tracking encoder (for media recorder) - kBatteryDataTrackDecoder = 0x8, - // start to play an audio on an audio device - kBatteryDataAudioFlingerStart = 0x10, - // stop/pause the audio playback - kBatteryDataAudioFlingerStop = 0x20, - // audio is rounted to speaker - kBatteryDataSpeakerOn = 0x40, - // audio is rounted to devices other than speaker - kBatteryDataOtherAudioDeviceOn = 0x80, - }; - - virtual void addBatteryData(uint32_t params) = 0; - virtual status_t pullBatteryData(Parcel* reply) = 0; - - virtual status_t updateProxyConfig( - const char *host, int32_t port, const char *exclusionList) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnMediaPlayerService: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IMEDIAPLAYERSERVICE_H diff --git a/external/android/include/18/frameworks/av/include/media/IMediaRecorder.h b/external/android/include/18/frameworks/av/include/media/IMediaRecorder.h deleted file mode 100644 index 3e67550..0000000 --- a/external/android/include/18/frameworks/av/include/media/IMediaRecorder.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - ** - ** Copyright 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. - */ - -#ifndef ANDROID_IMEDIARECORDER_H -#define ANDROID_IMEDIARECORDER_H - -#include - -namespace android { - -class Surface; -class ICamera; -class ICameraRecordingProxy; -class IMediaRecorderClient; -class IGraphicBufferProducer; - -class IMediaRecorder: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaRecorder); - - virtual status_t setCamera(const sp& camera, - const sp& proxy) = 0; - virtual status_t setPreviewSurface(const sp& surface) = 0; - virtual status_t setVideoSource(int vs) = 0; - virtual status_t setAudioSource(int as) = 0; - virtual status_t setOutputFormat(int of) = 0; - virtual status_t setVideoEncoder(int ve) = 0; - virtual status_t setAudioEncoder(int ae) = 0; - virtual status_t setOutputFile(const char* path) = 0; - virtual status_t setOutputFile(int fd, int64_t offset, int64_t length) = 0; - virtual status_t setVideoSize(int width, int height) = 0; - virtual status_t setVideoFrameRate(int frames_per_second) = 0; - virtual status_t setParameters(const String8& params) = 0; - virtual status_t setListener(const sp& listener) = 0; - virtual status_t setClientName(const String16& clientName) = 0; - virtual status_t prepare() = 0; - virtual status_t getMaxAmplitude(int* max) = 0; - virtual status_t start() = 0; - virtual status_t stop() = 0; - virtual status_t reset() = 0; - virtual status_t init() = 0; - virtual status_t close() = 0; - virtual status_t release() = 0; - virtual sp querySurfaceMediaSource() = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnMediaRecorder: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IMEDIARECORDER_H diff --git a/external/android/include/18/frameworks/av/include/media/IMediaRecorderClient.h b/external/android/include/18/frameworks/av/include/media/IMediaRecorderClient.h deleted file mode 100644 index e7d0229..0000000 --- a/external/android/include/18/frameworks/av/include/media/IMediaRecorderClient.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2010 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_IMEDIARECORDERCLIENT_H -#define ANDROID_IMEDIARECORDERCLIENT_H - -#include -#include -#include - -namespace android { - -class IMediaRecorderClient: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaRecorderClient); - - virtual void notify(int msg, int ext1, int ext2) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnMediaRecorderClient: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IMEDIARECORDERCLIENT_H diff --git a/external/android/include/18/frameworks/av/include/media/IOMX.h b/external/android/include/18/frameworks/av/include/media/IOMX.h deleted file mode 100644 index 0b1d1e4..0000000 --- a/external/android/include/18/frameworks/av/include/media/IOMX.h +++ /dev/null @@ -1,202 +0,0 @@ -/* - * 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_IOMX_H_ - -#define ANDROID_IOMX_H_ - -#include -#include -#include -#include -#include - -#include -#include - -namespace android { - -class IMemory; -class IOMXObserver; -class IOMXRenderer; -class Surface; - -class IOMX : public IInterface { -public: - DECLARE_META_INTERFACE(OMX); - - typedef void *buffer_id; - typedef void *node_id; - - // Given a node_id and the calling process' pid, returns true iff - // the implementation of the OMX interface lives in the same - // process. - virtual bool livesLocally(node_id node, pid_t pid) = 0; - - struct ComponentInfo { - String8 mName; - List mRoles; - }; - virtual status_t listNodes(List *list) = 0; - - virtual status_t allocateNode( - const char *name, const sp &observer, - node_id *node) = 0; - - virtual status_t freeNode(node_id node) = 0; - - virtual status_t sendCommand( - node_id node, OMX_COMMANDTYPE cmd, OMX_S32 param) = 0; - - virtual status_t getParameter( - node_id node, OMX_INDEXTYPE index, - void *params, size_t size) = 0; - - virtual status_t setParameter( - node_id node, OMX_INDEXTYPE index, - const void *params, size_t size) = 0; - - virtual status_t getConfig( - node_id node, OMX_INDEXTYPE index, - void *params, size_t size) = 0; - - virtual status_t setConfig( - node_id node, OMX_INDEXTYPE index, - const void *params, size_t size) = 0; - - virtual status_t getState( - node_id node, OMX_STATETYPE* state) = 0; - - virtual status_t storeMetaDataInBuffers( - node_id node, OMX_U32 port_index, OMX_BOOL enable) = 0; - - virtual status_t enableGraphicBuffers( - node_id node, OMX_U32 port_index, OMX_BOOL enable) = 0; - - virtual status_t getGraphicBufferUsage( - node_id node, OMX_U32 port_index, OMX_U32* usage) = 0; - - virtual status_t useBuffer( - node_id node, OMX_U32 port_index, const sp ¶ms, - buffer_id *buffer) = 0; - - virtual status_t useGraphicBuffer( - node_id node, OMX_U32 port_index, - const sp &graphicBuffer, buffer_id *buffer) = 0; - - virtual status_t createInputSurface( - node_id node, OMX_U32 port_index, - sp *bufferProducer) = 0; - - virtual status_t signalEndOfInputStream(node_id node) = 0; - - // This API clearly only makes sense if the caller lives in the - // same process as the callee, i.e. is the media_server, as the - // returned "buffer_data" pointer is just that, a pointer into local - // address space. - virtual status_t allocateBuffer( - node_id node, OMX_U32 port_index, size_t size, - buffer_id *buffer, void **buffer_data) = 0; - - virtual status_t allocateBufferWithBackup( - node_id node, OMX_U32 port_index, const sp ¶ms, - buffer_id *buffer) = 0; - - virtual status_t freeBuffer( - node_id node, OMX_U32 port_index, buffer_id buffer) = 0; - - virtual status_t fillBuffer(node_id node, buffer_id buffer) = 0; - - virtual status_t emptyBuffer( - node_id node, - buffer_id buffer, - OMX_U32 range_offset, OMX_U32 range_length, - OMX_U32 flags, OMX_TICKS timestamp) = 0; - - virtual status_t getExtensionIndex( - node_id node, - const char *parameter_name, - OMX_INDEXTYPE *index) = 0; -}; - -struct omx_message { - enum { - EVENT, - EMPTY_BUFFER_DONE, - FILL_BUFFER_DONE, - - } type; - - IOMX::node_id node; - - union { - // if type == EVENT - struct { - OMX_EVENTTYPE event; - OMX_U32 data1; - OMX_U32 data2; - } event_data; - - // if type == EMPTY_BUFFER_DONE - struct { - IOMX::buffer_id buffer; - } buffer_data; - - // if type == FILL_BUFFER_DONE - struct { - IOMX::buffer_id buffer; - OMX_U32 range_offset; - OMX_U32 range_length; - OMX_U32 flags; - OMX_TICKS timestamp; - OMX_PTR platform_private; - OMX_PTR data_ptr; - } extended_buffer_data; - - } u; -}; - -class IOMXObserver : public IInterface { -public: - DECLARE_META_INTERFACE(OMXObserver); - - virtual void onMessage(const omx_message &msg) = 0; -}; - -//////////////////////////////////////////////////////////////////////////////// - -class BnOMX : public BnInterface { -public: - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -}; - -class BnOMXObserver : public BnInterface { -public: - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -}; - -struct CodecProfileLevel { - OMX_U32 mProfile; - OMX_U32 mLevel; -}; - -} // namespace android - -#endif // ANDROID_IOMX_H_ diff --git a/external/android/include/18/frameworks/av/include/media/IRemoteDisplay.h b/external/android/include/18/frameworks/av/include/media/IRemoteDisplay.h deleted file mode 100644 index c8baae9..0000000 --- a/external/android/include/18/frameworks/av/include/media/IRemoteDisplay.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2012 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_IREMOTEDISPLAY_H -#define ANDROID_IREMOTEDISPLAY_H - -#include -#include - -#include -#include -#include - -namespace android { - -/* - * Represents a remote display, such as a Wifi display. - * - * When the remote display is created, it may not yet be connected to the - * display. The remote display asynchronously reports events such as successful - * connection, disconnection and errors to an IRemoteDisplayClient interface provided by - * the client. - */ -class IRemoteDisplay : public IInterface -{ -public: - DECLARE_META_INTERFACE(RemoteDisplay); - - virtual status_t pause() = 0; - virtual status_t resume() = 0; - - // Disconnects the remote display and stops listening for new connections. - virtual status_t dispose() = 0; -}; - - -// ---------------------------------------------------------------------------- - -class BnRemoteDisplay : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IREMOTEDISPLAY_H diff --git a/external/android/include/18/frameworks/av/include/media/IRemoteDisplayClient.h b/external/android/include/18/frameworks/av/include/media/IRemoteDisplayClient.h deleted file mode 100644 index 7b0fa9e..0000000 --- a/external/android/include/18/frameworks/av/include/media/IRemoteDisplayClient.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2012 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_IREMOTEDISPLAYCLIENT_H -#define ANDROID_IREMOTEDISPLAYCLIENT_H - -#include -#include - -#include -#include -#include - -namespace android { - -class IGraphicBufferProducer; - -class IRemoteDisplayClient : public IInterface -{ -public: - DECLARE_META_INTERFACE(RemoteDisplayClient); - - enum { - // Flag: The remote display is using a secure transport protocol such as HDCP. - kDisplayFlagSecure = 1 << 0, - }; - - enum { - // Error: An unknown / generic error occurred. - kDisplayErrorUnknown = 1, - // Error: The connection was dropped unexpectedly. - kDisplayErrorConnectionDropped = 2, - }; - - // Indicates that the remote display has been connected successfully. - // Provides a surface texture that the client should use to stream buffers to - // the remote display. - virtual void onDisplayConnected(const sp& bufferProducer, - uint32_t width, uint32_t height, uint32_t flags) = 0; // one-way - - // Indicates that the remote display has been disconnected normally. - // This method should only be called once the client has called 'dispose()' - // on the IRemoteDisplay. - // It is currently an error for the display to disconnect for any other reason. - virtual void onDisplayDisconnected() = 0; // one-way - - // Indicates that a connection could not be established to the remote display - // or an unrecoverable error occurred and the connection was severed. - virtual void onDisplayError(int32_t error) = 0; // one-way -}; - - -// ---------------------------------------------------------------------------- - -class BnRemoteDisplayClient : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IREMOTEDISPLAYCLIENT_H diff --git a/external/android/include/18/frameworks/av/include/media/IStreamSource.h b/external/android/include/18/frameworks/av/include/media/IStreamSource.h deleted file mode 100644 index 677119b..0000000 --- a/external/android/include/18/frameworks/av/include/media/IStreamSource.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (C) 2010 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_ISTREAMSOURCE_H_ - -#define ANDROID_ISTREAMSOURCE_H_ - -#include - -namespace android { - -struct AMessage; -struct IMemory; -struct IStreamListener; - -struct IStreamSource : public IInterface { - DECLARE_META_INTERFACE(StreamSource); - - virtual void setListener(const sp &listener) = 0; - virtual void setBuffers(const Vector > &buffers) = 0; - - virtual void onBufferAvailable(size_t index) = 0; - - enum { - // Video PES packets contain exactly one (aligned) access unit. - kFlagAlignedVideoData = 1, - - // Timestamps are in ALooper::GetNowUs() units. - kFlagIsRealTimeData = 2, - }; - virtual uint32_t flags() const { return 0; } -}; - -struct IStreamListener : public IInterface { - DECLARE_META_INTERFACE(StreamListener); - - enum Command { - EOS, - DISCONTINUITY, - }; - - virtual void queueBuffer(size_t index, size_t size) = 0; - - // When signalling a discontinuity you can optionally - // specify an int64_t PTS timestamp in "msg". - // If present, rendering of data following the discontinuity - // will be suppressed until media time reaches this timestamp. - static const char *const kKeyResumeAtPTS; - - // When signalling a discontinuity you can optionally - // specify the type(s) of discontinuity, i.e. if the - // audio format has changed, the video format has changed, - // time has jumped or any combination thereof. - // To do so, include a non-zero int32_t value - // under the key "kKeyDiscontinuityMask" when issuing the DISCONTINUITY - // command. - // If there is a change in audio/video format, The new logical stream - // must start with proper codec initialization - // information for playback to continue, i.e. SPS and PPS in the case - // of AVC video etc. - // If this key is not present, only a time discontinuity is assumed. - // The value should be a bitmask of values from - // ATSParser::DiscontinuityType. - static const char *const kKeyDiscontinuityMask; - - // Optionally signalled as part of a discontinuity that includes - // DISCONTINUITY_TIME. It indicates the media time (in us) to be associated - // with the next PTS occuring in the stream. The value is of type int64_t. - static const char *const kKeyMediaTimeUs; - - virtual void issueCommand( - Command cmd, bool synchronous, const sp &msg = NULL) = 0; -}; - -//////////////////////////////////////////////////////////////////////////////// - -struct BnStreamSource : public BnInterface { - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -}; - -struct BnStreamListener : public BnInterface { - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -}; - -} // namespace android - -#endif // ANDROID_ISTREAMSOURCE_H_ diff --git a/external/android/include/18/frameworks/av/include/media/JetPlayer.h b/external/android/include/18/frameworks/av/include/media/JetPlayer.h deleted file mode 100644 index 0616bf0..0000000 --- a/external/android/include/18/frameworks/av/include/media/JetPlayer.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * 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. - */ - -#ifndef JETPLAYER_H_ -#define JETPLAYER_H_ - -#include - -#include -#include -#include - - -namespace android { - -typedef void (*jetevent_callback)(int eventType, int val1, int val2, void *cookie); - -class JetPlayer { - -public: - - // to keep in sync with the JetPlayer class constants - // defined in frameworks/base/media/java/android/media/JetPlayer.java - static const int JET_EVENT = 1; - static const int JET_USERID_UPDATE = 2; - static const int JET_NUMQUEUEDSEGMENT_UPDATE = 3; - static const int JET_PAUSE_UPDATE = 4; - - JetPlayer(void *javaJetPlayer, - int maxTracks = 32, - int trackBufferSize = 1200); - ~JetPlayer(); - int init(); - int release(); - - int loadFromFile(const char* url); - int loadFromFD(const int fd, const long long offset, const long long length); - int closeFile(); - int play(); - int pause(); - int queueSegment(int segmentNum, int libNum, int repeatCount, int transpose, - EAS_U32 muteFlags, EAS_U8 userID); - int setMuteFlags(EAS_U32 muteFlags, bool sync); - int setMuteFlag(int trackNum, bool muteFlag, bool sync); - int triggerClip(int clipId); - int clearQueue(); - - void setEventCallback(jetevent_callback callback); - - int getMaxTracks() { return mMaxTracks; }; - - -private: - int render(); - void fireUpdateOnStatusChange(); - void fireEventsFromJetQueue(); - - JetPlayer() {} // no default constructor - void dump(); - void dumpJetStatus(S_JET_STATUS* pJetStatus); - - jetevent_callback mEventCallback; - - void* mJavaJetPlayerRef; - Mutex mMutex; // mutex to sync the render and playback thread with the JET calls - pid_t mTid; - Condition mCondition; - volatile bool mRender; - bool mPaused; - - EAS_STATE mState; - int* mMemFailedVar; - - int mMaxTracks; // max number of MIDI tracks, usually 32 - EAS_DATA_HANDLE mEasData; - EAS_FILE_LOCATOR mEasJetFileLoc; - EAS_PCM* mAudioBuffer;// EAS renders the MIDI data into this buffer, - AudioTrack* mAudioTrack; // and we play it in this audio track - int mTrackBufferSize; - S_JET_STATUS mJetStatus; - S_JET_STATUS mPreviousJetStatus; - - char mJetFilePath[PATH_MAX]; - - class JetPlayerThread : public Thread { - public: - JetPlayerThread(JetPlayer *player) : mPlayer(player) { - } - - protected: - virtual ~JetPlayerThread() {} - - private: - JetPlayer *mPlayer; - - bool threadLoop() { - int result; - result = mPlayer->render(); - return false; - } - - JetPlayerThread(const JetPlayerThread &); - JetPlayerThread &operator=(const JetPlayerThread &); - }; - - sp mThread; - -}; // end class JetPlayer - -} // end namespace android - - - -#endif /*JETPLAYER_H_*/ diff --git a/external/android/include/18/frameworks/av/include/media/MediaMetadataRetrieverInterface.h b/external/android/include/18/frameworks/av/include/media/MediaMetadataRetrieverInterface.h deleted file mode 100644 index ecc3b65..0000000 --- a/external/android/include/18/frameworks/av/include/media/MediaMetadataRetrieverInterface.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -** -** 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. -*/ - -#ifndef ANDROID_MEDIAMETADATARETRIEVERINTERFACE_H -#define ANDROID_MEDIAMETADATARETRIEVERINTERFACE_H - -#include -#include -#include - -namespace android { - -// Abstract base class -class MediaMetadataRetrieverBase : public RefBase -{ -public: - MediaMetadataRetrieverBase() {} - virtual ~MediaMetadataRetrieverBase() {} - - virtual status_t setDataSource( - const char *url, - const KeyedVector *headers = NULL) = 0; - - virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; - virtual VideoFrame* getFrameAtTime(int64_t timeUs, int option) = 0; - virtual MediaAlbumArt* extractAlbumArt() = 0; - virtual const char* extractMetadata(int keyCode) = 0; -}; - -// MediaMetadataRetrieverInterface -class MediaMetadataRetrieverInterface : public MediaMetadataRetrieverBase -{ -public: - MediaMetadataRetrieverInterface() {} - - virtual ~MediaMetadataRetrieverInterface() {} - virtual VideoFrame* getFrameAtTime(int64_t timeUs, int option) { return NULL; } - virtual MediaAlbumArt* extractAlbumArt() { return NULL; } - virtual const char* extractMetadata(int keyCode) { return NULL; } -}; - -}; // namespace android - -#endif // ANDROID_MEDIAMETADATARETRIEVERINTERFACE_H diff --git a/external/android/include/18/frameworks/av/include/media/MediaPlayerInterface.h b/external/android/include/18/frameworks/av/include/media/MediaPlayerInterface.h deleted file mode 100644 index 9a75f81..0000000 --- a/external/android/include/18/frameworks/av/include/media/MediaPlayerInterface.h +++ /dev/null @@ -1,240 +0,0 @@ -/* - * 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_MEDIAPLAYERINTERFACE_H -#define ANDROID_MEDIAPLAYERINTERFACE_H - -#ifdef __cplusplus - -#include -#include -#include -#include -#include - -#include -#include -#include - -// Fwd decl to make sure everyone agrees that the scope of struct sockaddr_in is -// global, and not in android:: -struct sockaddr_in; - -namespace android { - -class Parcel; -class Surface; -class IGraphicBufferProducer; - -template class SortedVector; - -enum player_type { - PV_PLAYER = 1, - SONIVOX_PLAYER = 2, - STAGEFRIGHT_PLAYER = 3, - NU_PLAYER = 4, - // Test players are available only in the 'test' and 'eng' builds. - // The shared library with the test player is passed passed as an - // argument to the 'test:' url in the setDataSource call. - TEST_PLAYER = 5, -}; - - -#define DEFAULT_AUDIOSINK_BUFFERCOUNT 4 -#define DEFAULT_AUDIOSINK_BUFFERSIZE 1200 -#define DEFAULT_AUDIOSINK_SAMPLERATE 44100 - -// when the channel mask isn't known, use the channel count to derive a mask in AudioSink::open() -#define CHANNEL_MASK_USE_CHANNEL_ORDER 0 - -// duration below which we do not allow deep audio buffering -#define AUDIO_SINK_MIN_DEEP_BUFFER_DURATION_US 5000000 - -// callback mechanism for passing messages to MediaPlayer object -typedef void (*notify_callback_f)(void* cookie, - int msg, int ext1, int ext2, const Parcel *obj); - -// abstract base class - use MediaPlayerInterface -class MediaPlayerBase : public RefBase -{ -public: - // AudioSink: abstraction layer for audio output - class AudioSink : public RefBase { - public: - // Callback returns the number of bytes actually written to the buffer. - typedef size_t (*AudioCallback)( - AudioSink *audioSink, void *buffer, size_t size, void *cookie); - - virtual ~AudioSink() {} - virtual bool ready() const = 0; // audio output is open and ready - virtual bool realtime() const = 0; // audio output is real-time output - virtual ssize_t bufferSize() const = 0; - virtual ssize_t frameCount() const = 0; - virtual ssize_t channelCount() const = 0; - virtual ssize_t frameSize() const = 0; - virtual uint32_t latency() const = 0; - virtual float msecsPerFrame() const = 0; - virtual status_t getPosition(uint32_t *position) const = 0; - virtual status_t getFramesWritten(uint32_t *frameswritten) const = 0; - virtual int getSessionId() const = 0; - - // If no callback is specified, use the "write" API below to submit - // audio data. - virtual status_t open( - uint32_t sampleRate, int channelCount, audio_channel_mask_t channelMask, - audio_format_t format=AUDIO_FORMAT_PCM_16_BIT, - int bufferCount=DEFAULT_AUDIOSINK_BUFFERCOUNT, - AudioCallback cb = NULL, - void *cookie = NULL, - audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE) = 0; - - virtual void start() = 0; - virtual ssize_t write(const void* buffer, size_t size) = 0; - virtual void stop() = 0; - virtual void flush() = 0; - virtual void pause() = 0; - virtual void close() = 0; - - virtual status_t setPlaybackRatePermille(int32_t rate) { return INVALID_OPERATION; } - virtual bool needsTrailingPadding() { return true; } - }; - - MediaPlayerBase() : mCookie(0), mNotify(0) {} - virtual ~MediaPlayerBase() {} - virtual status_t initCheck() = 0; - virtual bool hardwareOutput() = 0; - - virtual status_t setUID(uid_t uid) { - return INVALID_OPERATION; - } - - virtual status_t setDataSource( - const char *url, - const KeyedVector *headers = NULL) = 0; - - virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; - - virtual status_t setDataSource(const sp &source) { - return INVALID_OPERATION; - } - - // pass the buffered IGraphicBufferProducer to the media player service - virtual status_t setVideoSurfaceTexture( - const sp& bufferProducer) = 0; - - virtual status_t prepare() = 0; - virtual status_t prepareAsync() = 0; - virtual status_t start() = 0; - virtual status_t stop() = 0; - virtual status_t pause() = 0; - virtual bool isPlaying() = 0; - virtual status_t seekTo(int msec) = 0; - virtual status_t getCurrentPosition(int *msec) = 0; - virtual status_t getDuration(int *msec) = 0; - virtual status_t reset() = 0; - virtual status_t setLooping(int loop) = 0; - virtual player_type playerType() = 0; - virtual status_t setParameter(int key, const Parcel &request) = 0; - virtual status_t getParameter(int key, Parcel *reply) = 0; - - // default no-op implementation of optional extensions - virtual status_t setRetransmitEndpoint(const struct sockaddr_in* endpoint) { - return INVALID_OPERATION; - } - virtual status_t getRetransmitEndpoint(struct sockaddr_in* endpoint) { - return INVALID_OPERATION; - } - virtual status_t setNextPlayer(const sp& next) { - return OK; - } - - // Invoke a generic method on the player by using opaque parcels - // for the request and reply. - // - // @param request Parcel that is positioned at the start of the - // data sent by the java layer. - // @param[out] reply Parcel to hold the reply data. Cannot be null. - // @return OK if the call was successful. - virtual status_t invoke(const Parcel& request, Parcel *reply) = 0; - - // The Client in the MetadataPlayerService calls this method on - // the native player to retrieve all or a subset of metadata. - // - // @param ids SortedList of metadata ID to be fetch. If empty, all - // the known metadata should be returned. - // @param[inout] records Parcel where the player appends its metadata. - // @return OK if the call was successful. - virtual status_t getMetadata(const media::Metadata::Filter& ids, - Parcel *records) { - return INVALID_OPERATION; - }; - - void setNotifyCallback( - void* cookie, notify_callback_f notifyFunc) { - Mutex::Autolock autoLock(mNotifyLock); - mCookie = cookie; mNotify = notifyFunc; - } - - void sendEvent(int msg, int ext1=0, int ext2=0, - const Parcel *obj=NULL) { - Mutex::Autolock autoLock(mNotifyLock); - if (mNotify) mNotify(mCookie, msg, ext1, ext2, obj); - } - - virtual status_t dump(int fd, const Vector &args) const { - return INVALID_OPERATION; - } - - virtual status_t updateProxyConfig( - const char *host, int32_t port, const char *exclusionList) { - return INVALID_OPERATION; - } - -private: - friend class MediaPlayerService; - - Mutex mNotifyLock; - void* mCookie; - notify_callback_f mNotify; -}; - -// Implement this class for media players that use the AudioFlinger software mixer -class MediaPlayerInterface : public MediaPlayerBase -{ -public: - virtual ~MediaPlayerInterface() { } - virtual bool hardwareOutput() { return false; } - virtual void setAudioSink(const sp& audioSink) { mAudioSink = audioSink; } -protected: - sp mAudioSink; -}; - -// Implement this class for media players that output audio directly to hardware -class MediaPlayerHWInterface : public MediaPlayerBase -{ -public: - virtual ~MediaPlayerHWInterface() {} - virtual bool hardwareOutput() { return true; } - virtual status_t setVolume(float leftVolume, float rightVolume) = 0; - virtual status_t setAudioStreamType(audio_stream_type_t streamType) = 0; -}; - -}; // namespace android - -#endif // __cplusplus - - -#endif // ANDROID_MEDIAPLAYERINTERFACE_H diff --git a/external/android/include/18/frameworks/av/include/media/MediaProfiles.h b/external/android/include/18/frameworks/av/include/media/MediaProfiles.h deleted file mode 100644 index 9fc962c..0000000 --- a/external/android/include/18/frameworks/av/include/media/MediaProfiles.h +++ /dev/null @@ -1,518 +0,0 @@ -/* - ** - ** Copyright 2010, 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_MEDIAPROFILES_H -#define ANDROID_MEDIAPROFILES_H - -#include -#include - -namespace android { - -enum camcorder_quality { - CAMCORDER_QUALITY_LIST_START = 0, - CAMCORDER_QUALITY_LOW = 0, - CAMCORDER_QUALITY_HIGH = 1, - CAMCORDER_QUALITY_QCIF = 2, - CAMCORDER_QUALITY_CIF = 3, - CAMCORDER_QUALITY_480P = 4, - CAMCORDER_QUALITY_720P = 5, - CAMCORDER_QUALITY_1080P = 6, - CAMCORDER_QUALITY_QVGA = 7, - CAMCORDER_QUALITY_LIST_END = 7, - - CAMCORDER_QUALITY_TIME_LAPSE_LIST_START = 1000, - CAMCORDER_QUALITY_TIME_LAPSE_LOW = 1000, - CAMCORDER_QUALITY_TIME_LAPSE_HIGH = 1001, - CAMCORDER_QUALITY_TIME_LAPSE_QCIF = 1002, - CAMCORDER_QUALITY_TIME_LAPSE_CIF = 1003, - CAMCORDER_QUALITY_TIME_LAPSE_480P = 1004, - CAMCORDER_QUALITY_TIME_LAPSE_720P = 1005, - CAMCORDER_QUALITY_TIME_LAPSE_1080P = 1006, - CAMCORDER_QUALITY_TIME_LAPSE_QVGA = 1007, - CAMCORDER_QUALITY_TIME_LAPSE_LIST_END = 1007, -}; - -/** - * Set CIF as default maximum import and export resolution of video editor. - * The maximum import and export resolutions are platform specific, - * which should be defined in media_profiles.xml. - * Set default maximum prefetch YUV frames to 6, which means video editor can - * queue up to 6 YUV frames in the video encoder source. - * This value is used to limit the amount of memory used by video editor - * engine when the encoder consumes YUV frames at a lower speed - * than video editor engine produces. - */ -enum videoeditor_capability { - VIDEOEDITOR_DEFAULT_MAX_INPUT_FRAME_WIDTH = 352, - VIDEOEDITOR_DEFUALT_MAX_INPUT_FRAME_HEIGHT = 288, - VIDEOEDITOR_DEFAULT_MAX_OUTPUT_FRAME_WIDTH = 352, - VIDEOEDITOR_DEFUALT_MAX_OUTPUT_FRAME_HEIGHT = 288, - VIDEOEDITOR_DEFAULT_MAX_PREFETCH_YUV_FRAMES = 6 -}; - -enum video_decoder { - VIDEO_DECODER_WMV, -}; - -enum audio_decoder { - AUDIO_DECODER_WMA, -}; - - -class MediaProfiles -{ -public: - - /** - * Returns the singleton instance for subsequence queries. - * or NULL if error. - */ - static MediaProfiles* getInstance(); - - /** - * Returns the value for the given param name for the given camera at - * the given quality level, or -1 if error. - * - * Supported param name are: - * duration - the recording duration. - * file.format - output file format. see mediarecorder.h for details - * vid.codec - video encoder. see mediarecorder.h for details. - * aud.codec - audio encoder. see mediarecorder.h for details. - * vid.width - video frame width - * vid.height - video frame height - * vid.fps - video frame rate - * vid.bps - video bit rate - * aud.bps - audio bit rate - * aud.hz - audio sample rate - * aud.ch - number of audio channels - */ - int getCamcorderProfileParamByName(const char *name, int cameraId, - camcorder_quality quality) const; - - /** - * Returns true if a profile for the given camera at the given quality exists, - * or false if not. - */ - bool hasCamcorderProfile(int cameraId, camcorder_quality quality) const; - - /** - * Returns the output file formats supported. - */ - Vector getOutputFileFormats() const; - - /** - * Returns the video encoders supported. - */ - Vector getVideoEncoders() const; - - /** - * Returns the value for the given param name for the given video encoder - * returned from getVideoEncoderByIndex or -1 if error. - * - * Supported param name are: - * enc.vid.width.min - min video frame width - * enc.vid.width.max - max video frame width - * enc.vid.height.min - min video frame height - * enc.vid.height.max - max video frame height - * enc.vid.bps.min - min bit rate in bits per second - * enc.vid.bps.max - max bit rate in bits per second - * enc.vid.fps.min - min frame rate in frames per second - * enc.vid.fps.max - max frame rate in frames per second - */ - int getVideoEncoderParamByName(const char *name, video_encoder codec) const; - - /** - * Returns the value for the given param name for the video editor cap - * param or -1 if error. - * Supported param name are: - * videoeditor.input.width.max - max input video frame width - * videoeditor.input.height.max - max input video frame height - * videoeditor.output.width.max - max output video frame width - * videoeditor.output.height.max - max output video frame height - * maxPrefetchYUVFrames - max prefetch YUV frames in video editor engine. This value is used - * to limit the memory consumption. - */ - int getVideoEditorCapParamByName(const char *name) const; - - /** - * Returns the value for the given param name for the video editor export codec format - * param or -1 if error. - * Supported param name are: - * videoeditor.export.profile - export video profile - * videoeditor.export.level - export video level - * Supported param codec are: - * 1 for h263 - * 2 for h264 - * 3 for mpeg4 - */ - int getVideoEditorExportParamByName(const char *name, int codec) const; - - /** - * Returns the audio encoders supported. - */ - Vector getAudioEncoders() const; - - /** - * Returns the value for the given param name for the given audio encoder - * returned from getAudioEncoderByIndex or -1 if error. - * - * Supported param name are: - * enc.aud.ch.min - min number of channels - * enc.aud.ch.max - max number of channels - * enc.aud.bps.min - min bit rate in bits per second - * enc.aud.bps.max - max bit rate in bits per second - * enc.aud.hz.min - min sample rate in samples per second - * enc.aud.hz.max - max sample rate in samples per second - */ - int getAudioEncoderParamByName(const char *name, audio_encoder codec) const; - - /** - * Returns the video decoders supported. - */ - Vector getVideoDecoders() const; - - /** - * Returns the audio decoders supported. - */ - Vector getAudioDecoders() const; - - /** - * Returns the number of image encoding quality levels supported. - */ - Vector getImageEncodingQualityLevels(int cameraId) const; - - /** - * Returns the start time offset (in ms) for the given camera Id. - * If the given camera Id does not exist, -1 will be returned. - */ - int getStartTimeOffsetMs(int cameraId) const; - -private: - enum { - // Camcorder profiles (high/low) and timelapse profiles (high/low) - kNumRequiredProfiles = 4, - }; - - MediaProfiles& operator=(const MediaProfiles&); // Don't call me - MediaProfiles(const MediaProfiles&); // Don't call me - MediaProfiles() { mVideoEditorCap = NULL; } // Dummy default constructor - ~MediaProfiles(); // Don't delete me - - struct VideoCodec { - VideoCodec(video_encoder codec, int bitRate, int frameWidth, int frameHeight, int frameRate) - : mCodec(codec), - mBitRate(bitRate), - mFrameWidth(frameWidth), - mFrameHeight(frameHeight), - mFrameRate(frameRate) {} - - VideoCodec(const VideoCodec& copy) { - mCodec = copy.mCodec; - mBitRate = copy.mBitRate; - mFrameWidth = copy.mFrameWidth; - mFrameHeight = copy.mFrameHeight; - mFrameRate = copy.mFrameRate; - } - - ~VideoCodec() {} - - video_encoder mCodec; - int mBitRate; - int mFrameWidth; - int mFrameHeight; - int mFrameRate; - }; - - struct AudioCodec { - AudioCodec(audio_encoder codec, int bitRate, int sampleRate, int channels) - : mCodec(codec), - mBitRate(bitRate), - mSampleRate(sampleRate), - mChannels(channels) {} - - AudioCodec(const AudioCodec& copy) { - mCodec = copy.mCodec; - mBitRate = copy.mBitRate; - mSampleRate = copy.mSampleRate; - mChannels = copy.mChannels; - } - - ~AudioCodec() {} - - audio_encoder mCodec; - int mBitRate; - int mSampleRate; - int mChannels; - }; - - struct CamcorderProfile { - CamcorderProfile() - : mCameraId(0), - mFileFormat(OUTPUT_FORMAT_THREE_GPP), - mQuality(CAMCORDER_QUALITY_HIGH), - mDuration(0), - mVideoCodec(0), - mAudioCodec(0) {} - - CamcorderProfile(const CamcorderProfile& copy) { - mCameraId = copy.mCameraId; - mFileFormat = copy.mFileFormat; - mQuality = copy.mQuality; - mDuration = copy.mDuration; - mVideoCodec = new VideoCodec(*copy.mVideoCodec); - mAudioCodec = new AudioCodec(*copy.mAudioCodec); - } - - ~CamcorderProfile() { - delete mVideoCodec; - delete mAudioCodec; - } - - int mCameraId; - output_format mFileFormat; - camcorder_quality mQuality; - int mDuration; - VideoCodec *mVideoCodec; - AudioCodec *mAudioCodec; - }; - - struct VideoEncoderCap { - // Ugly constructor - VideoEncoderCap(video_encoder codec, - int minBitRate, int maxBitRate, - int minFrameWidth, int maxFrameWidth, - int minFrameHeight, int maxFrameHeight, - int minFrameRate, int maxFrameRate) - : mCodec(codec), - mMinBitRate(minBitRate), mMaxBitRate(maxBitRate), - mMinFrameWidth(minFrameWidth), mMaxFrameWidth(maxFrameWidth), - mMinFrameHeight(minFrameHeight), mMaxFrameHeight(maxFrameHeight), - mMinFrameRate(minFrameRate), mMaxFrameRate(maxFrameRate) {} - - ~VideoEncoderCap() {} - - video_encoder mCodec; - int mMinBitRate, mMaxBitRate; - int mMinFrameWidth, mMaxFrameWidth; - int mMinFrameHeight, mMaxFrameHeight; - int mMinFrameRate, mMaxFrameRate; - }; - - struct AudioEncoderCap { - // Ugly constructor - AudioEncoderCap(audio_encoder codec, - int minBitRate, int maxBitRate, - int minSampleRate, int maxSampleRate, - int minChannels, int maxChannels) - : mCodec(codec), - mMinBitRate(minBitRate), mMaxBitRate(maxBitRate), - mMinSampleRate(minSampleRate), mMaxSampleRate(maxSampleRate), - mMinChannels(minChannels), mMaxChannels(maxChannels) {} - - ~AudioEncoderCap() {} - - audio_encoder mCodec; - int mMinBitRate, mMaxBitRate; - int mMinSampleRate, mMaxSampleRate; - int mMinChannels, mMaxChannels; - }; - - struct VideoDecoderCap { - VideoDecoderCap(video_decoder codec): mCodec(codec) {} - ~VideoDecoderCap() {} - - video_decoder mCodec; - }; - - struct AudioDecoderCap { - AudioDecoderCap(audio_decoder codec): mCodec(codec) {} - ~AudioDecoderCap() {} - - audio_decoder mCodec; - }; - - struct NameToTagMap { - const char* name; - int tag; - }; - - struct ImageEncodingQualityLevels { - int mCameraId; - Vector mLevels; - }; - struct ExportVideoProfile { - ExportVideoProfile(int codec, int profile, int level) - :mCodec(codec),mProfile(profile),mLevel(level) {} - ~ExportVideoProfile() {} - int mCodec; - int mProfile; - int mLevel; - }; - struct VideoEditorCap { - VideoEditorCap(int inFrameWidth, int inFrameHeight, - int outFrameWidth, int outFrameHeight, int frames) - : mMaxInputFrameWidth(inFrameWidth), - mMaxInputFrameHeight(inFrameHeight), - mMaxOutputFrameWidth(outFrameWidth), - mMaxOutputFrameHeight(outFrameHeight), - mMaxPrefetchYUVFrames(frames) {} - - ~VideoEditorCap() {} - - int mMaxInputFrameWidth; - int mMaxInputFrameHeight; - int mMaxOutputFrameWidth; - int mMaxOutputFrameHeight; - int mMaxPrefetchYUVFrames; - }; - - int getCamcorderProfileIndex(int cameraId, camcorder_quality quality) const; - void initRequiredProfileRefs(const Vector& cameraIds); - int getRequiredProfileRefIndex(int cameraId); - - // Debug - static void logVideoCodec(const VideoCodec& codec); - static void logAudioCodec(const AudioCodec& codec); - static void logVideoEncoderCap(const VideoEncoderCap& cap); - static void logAudioEncoderCap(const AudioEncoderCap& cap); - static void logVideoDecoderCap(const VideoDecoderCap& cap); - static void logAudioDecoderCap(const AudioDecoderCap& cap); - static void logVideoEditorCap(const VideoEditorCap& cap); - - // If the xml configuration file does exist, use the settings - // from the xml - static MediaProfiles* createInstanceFromXmlFile(const char *xml); - static output_format createEncoderOutputFileFormat(const char **atts); - static VideoCodec* createVideoCodec(const char **atts, MediaProfiles *profiles); - static AudioCodec* createAudioCodec(const char **atts, MediaProfiles *profiles); - static AudioDecoderCap* createAudioDecoderCap(const char **atts); - static VideoDecoderCap* createVideoDecoderCap(const char **atts); - static VideoEncoderCap* createVideoEncoderCap(const char **atts); - static AudioEncoderCap* createAudioEncoderCap(const char **atts); - static VideoEditorCap* createVideoEditorCap( - const char **atts, MediaProfiles *profiles); - static ExportVideoProfile* createExportVideoProfile(const char **atts); - - static CamcorderProfile* createCamcorderProfile( - int cameraId, const char **atts, Vector& cameraIds); - - static int getCameraId(const char **atts); - - void addStartTimeOffset(int cameraId, const char **atts); - - ImageEncodingQualityLevels* findImageEncodingQualityLevels(int cameraId) const; - void addImageEncodingQualityLevel(int cameraId, const char** atts); - - // Customized element tag handler for parsing the xml configuration file. - static void startElementHandler(void *userData, const char *name, const char **atts); - - // If the xml configuration file does not exist, use hard-coded values - static MediaProfiles* createDefaultInstance(); - - static CamcorderProfile *createDefaultCamcorderQcifProfile(camcorder_quality quality); - static CamcorderProfile *createDefaultCamcorderCifProfile(camcorder_quality quality); - static void createDefaultCamcorderLowProfiles( - MediaProfiles::CamcorderProfile **lowProfile, - MediaProfiles::CamcorderProfile **lowSpecificProfile); - static void createDefaultCamcorderHighProfiles( - MediaProfiles::CamcorderProfile **highProfile, - MediaProfiles::CamcorderProfile **highSpecificProfile); - - static CamcorderProfile *createDefaultCamcorderTimeLapseQcifProfile(camcorder_quality quality); - static CamcorderProfile *createDefaultCamcorderTimeLapse480pProfile(camcorder_quality quality); - static void createDefaultCamcorderTimeLapseLowProfiles( - MediaProfiles::CamcorderProfile **lowTimeLapseProfile, - MediaProfiles::CamcorderProfile **lowSpecificTimeLapseProfile); - static void createDefaultCamcorderTimeLapseHighProfiles( - MediaProfiles::CamcorderProfile **highTimeLapseProfile, - MediaProfiles::CamcorderProfile **highSpecificTimeLapseProfile); - - static void createDefaultCamcorderProfiles(MediaProfiles *profiles); - static void createDefaultVideoEncoders(MediaProfiles *profiles); - static void createDefaultAudioEncoders(MediaProfiles *profiles); - static void createDefaultVideoDecoders(MediaProfiles *profiles); - static void createDefaultAudioDecoders(MediaProfiles *profiles); - static void createDefaultEncoderOutputFileFormats(MediaProfiles *profiles); - static void createDefaultImageEncodingQualityLevels(MediaProfiles *profiles); - static void createDefaultImageDecodingMaxMemory(MediaProfiles *profiles); - static void createDefaultVideoEditorCap(MediaProfiles *profiles); - static void createDefaultExportVideoProfiles(MediaProfiles *profiles); - - static VideoEncoderCap* createDefaultH263VideoEncoderCap(); - static VideoEncoderCap* createDefaultM4vVideoEncoderCap(); - static AudioEncoderCap* createDefaultAmrNBEncoderCap(); - - static int findTagForName(const NameToTagMap *map, size_t nMappings, const char *name); - - /** - * Check on existing profiles with the following criteria: - * 1. Low quality profile must have the lowest video - * resolution product (width x height) - * 2. High quality profile must have the highest video - * resolution product (width x height) - * - * and add required low/high quality camcorder/timelapse - * profiles if they are not found. This allows to remove - * duplicate profile definitions in the media_profiles.xml - * file. - */ - void checkAndAddRequiredProfilesIfNecessary(); - - - // Mappings from name (for instance, codec name) to enum value - static const NameToTagMap sVideoEncoderNameMap[]; - static const NameToTagMap sAudioEncoderNameMap[]; - static const NameToTagMap sFileFormatMap[]; - static const NameToTagMap sVideoDecoderNameMap[]; - static const NameToTagMap sAudioDecoderNameMap[]; - static const NameToTagMap sCamcorderQualityNameMap[]; - - static bool sIsInitialized; - static MediaProfiles *sInstance; - static Mutex sLock; - int mCurrentCameraId; - - Vector mCamcorderProfiles; - Vector mAudioEncoders; - Vector mVideoEncoders; - Vector mAudioDecoders; - Vector mVideoDecoders; - Vector mEncoderOutputFileFormats; - Vector mImageEncodingQualityLevels; - KeyedVector mStartTimeOffsets; - - typedef struct { - bool mHasRefProfile; // Refers to an existing profile - int mRefProfileIndex; // Reference profile index - int mResolutionProduct; // width x height - } RequiredProfileRefInfo; // Required low and high profiles - - typedef struct { - RequiredProfileRefInfo mRefs[kNumRequiredProfiles]; - int mCameraId; - } RequiredProfiles; - - RequiredProfiles *mRequiredProfileRefs; - Vector mCameraIds; - VideoEditorCap* mVideoEditorCap; - Vector mVideoEditorExportProfiles; -}; - -}; // namespace android - -#endif // ANDROID_MEDIAPROFILES_H diff --git a/external/android/include/18/frameworks/av/include/media/MediaRecorderBase.h b/external/android/include/18/frameworks/av/include/media/MediaRecorderBase.h deleted file mode 100644 index d7ac302..0000000 --- a/external/android/include/18/frameworks/av/include/media/MediaRecorderBase.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 MEDIA_RECORDER_BASE_H_ - -#define MEDIA_RECORDER_BASE_H_ - -#include - -#include - -namespace android { - -class ICameraRecordingProxy; -class Surface; -class IGraphicBufferProducer; - -struct MediaRecorderBase { - MediaRecorderBase() {} - virtual ~MediaRecorderBase() {} - - virtual status_t init() = 0; - virtual status_t setAudioSource(audio_source_t as) = 0; - virtual status_t setVideoSource(video_source vs) = 0; - virtual status_t setOutputFormat(output_format of) = 0; - virtual status_t setAudioEncoder(audio_encoder ae) = 0; - virtual status_t setVideoEncoder(video_encoder ve) = 0; - virtual status_t setVideoSize(int width, int height) = 0; - virtual status_t setVideoFrameRate(int frames_per_second) = 0; - virtual status_t setCamera(const sp& camera, - const sp& proxy) = 0; - virtual status_t setPreviewSurface(const sp& surface) = 0; - virtual status_t setOutputFile(const char *path) = 0; - virtual status_t setOutputFile(int fd, int64_t offset, int64_t length) = 0; - virtual status_t setOutputFileAuxiliary(int fd) {return INVALID_OPERATION;} - virtual status_t setParameters(const String8& params) = 0; - virtual status_t setListener(const sp& listener) = 0; - virtual status_t setClientName(const String16& clientName) = 0; - virtual status_t prepare() = 0; - virtual status_t start() = 0; - virtual status_t stop() = 0; - virtual status_t close() = 0; - virtual status_t reset() = 0; - virtual status_t getMaxAmplitude(int *max) = 0; - virtual status_t dump(int fd, const Vector& args) const = 0; - virtual sp querySurfaceMediaSource() const = 0; - -private: - MediaRecorderBase(const MediaRecorderBase &); - MediaRecorderBase &operator=(const MediaRecorderBase &); -}; - -} // namespace android - -#endif // MEDIA_RECORDER_BASE_H_ diff --git a/external/android/include/18/frameworks/av/include/media/MemoryLeakTrackUtil.h b/external/android/include/18/frameworks/av/include/media/MemoryLeakTrackUtil.h deleted file mode 100644 index d2618aa..0000000 --- a/external/android/include/18/frameworks/av/include/media/MemoryLeakTrackUtil.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2011, 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 MEMORY_LEAK_TRACK_UTIL_H -#define MEMORY_LEAK_TRACK_UTIL_H - -namespace android { -/* - * Dump the memory address of the calling process to the given fd. - */ -extern void dumpMemoryAddresses(int fd); - -}; - -#endif // MEMORY_LEAK_TRACK_UTIL_H diff --git a/external/android/include/18/frameworks/av/include/media/Metadata.h b/external/android/include/18/frameworks/av/include/media/Metadata.h deleted file mode 100644 index 07567eb..0000000 --- a/external/android/include/18/frameworks/av/include/media/Metadata.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 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_MEDIA_METADATA_H__ -#define ANDROID_MEDIA_METADATA_H__ - -#include -#include -#include -#include - -namespace android { -class Parcel; - -namespace media { - -// Metadata is a class to build/serialize a set of metadata in a Parcel. -// -// This class should be kept in sync with android/media/Metadata.java. -// It provides all the metadata ids available and methods to build the -// header, add records and adjust the set size header field. -// -// Typical Usage: -// ============== -// Parcel p; -// media::Metadata data(&p); -// -// data.appendHeader(); -// data.appendBool(Metadata::kPauseAvailable, true); -// ... more append ... -// data.updateLength(); -// - -class Metadata { - public: - typedef int32_t Type; - typedef SortedVector Filter; - - static const Type kAny = 0; - - // Playback capabilities. - static const Type kPauseAvailable = 1; // Boolean - static const Type kSeekBackwardAvailable = 2; // Boolean - static const Type kSeekForwardAvailable = 3; // Boolean - static const Type kSeekAvailable = 4; // Boolean - - // Keep in sync with android/media/Metadata.java - static const Type kTitle = 5; // String - static const Type kComment = 6; // String - static const Type kCopyright = 7; // String - static const Type kAlbum = 8; // String - static const Type kArtist = 9; // String - static const Type kAuthor = 10; // String - static const Type kComposer = 11; // String - static const Type kGenre = 12; // String - static const Type kDate = 13; // Date - static const Type kDuration = 14; // Integer(millisec) - static const Type kCdTrackNum = 15; // Integer 1-based - static const Type kCdTrackMax = 16; // Integer - static const Type kRating = 17; // String - static const Type kAlbumArt = 18; // byte[] - static const Type kVideoFrame = 19; // Bitmap - - static const Type kBitRate = 20; // Integer, Aggregate rate of - // all the streams in bps. - - static const Type kAudioBitRate = 21; // Integer, bps - static const Type kVideoBitRate = 22; // Integer, bps - static const Type kAudioSampleRate = 23; // Integer, Hz - static const Type kVideoframeRate = 24; // Integer, Hz - - // See RFC2046 and RFC4281. - static const Type kMimeType = 25; // String - static const Type kAudioCodec = 26; // String - static const Type kVideoCodec = 27; // String - - static const Type kVideoHeight = 28; // Integer - static const Type kVideoWidth = 29; // Integer - static const Type kNumTracks = 30; // Integer - static const Type kDrmCrippled = 31; // Boolean - - // @param p[inout] The parcel to append the metadata records - // to. The global metadata header should have been set already. - explicit Metadata(Parcel *p); - ~Metadata(); - - // Rewind the underlying parcel, undoing all the changes. - void resetParcel(); - - // Append the size and 'META' marker. - bool appendHeader(); - - // Once all the records have been added, call this to update the - // lenght field in the header. - void updateLength(); - - // append* are methods to append metadata. - // @param key Is the metadata Id. - // @param val Is the value of the metadata. - // @return true if successful, false otherwise. - // TODO: add more as needed to handle other types. - bool appendBool(Type key, bool val); - bool appendInt32(Type key, int32_t val); - - private: - Metadata(const Metadata&); - Metadata& operator=(const Metadata&); - - - // Checks the key is valid and not already present. - bool checkKey(Type key); - - Parcel *mData; - size_t mBegin; -}; - -} // namespace android::media -} // namespace android - -#endif // ANDROID_MEDIA_METADATA_H__ diff --git a/external/android/include/18/frameworks/av/include/media/SingleStateQueue.h b/external/android/include/18/frameworks/av/include/media/SingleStateQueue.h deleted file mode 100644 index 04c5fd0..0000000 --- a/external/android/include/18/frameworks/av/include/media/SingleStateQueue.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (C) 2012 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 SINGLE_STATE_QUEUE_H -#define SINGLE_STATE_QUEUE_H - -// Non-blocking single element state queue, or -// Non-blocking single-reader / single-writer multi-word atomic load / store - -#include - -namespace android { - -template class SingleStateQueue { - -public: - - class Mutator; - class Observer; - - struct Shared { - // needs to be part of a union so don't define constructor or destructor - - friend class Mutator; - friend class Observer; - -private: - void init() { mAck = 0; mSequence = 0; } - - volatile int32_t mAck; -#if 0 - int mPad[7]; - // cache line boundary -#endif - volatile int32_t mSequence; - T mValue; - }; - - class Mutator { - public: - Mutator(Shared *shared); - /*virtual*/ ~Mutator() { } - - // push new value onto state queue, overwriting previous value; - // returns a sequence number which can be used with ack() - int32_t push(const T& value); - - // return true if most recent push has been observed - bool ack(); - - // return true if a push with specified sequence number or later has been observed - bool ack(int32_t sequence); - - private: - int32_t mSequence; - Shared * const mShared; - }; - - class Observer { - public: - Observer(Shared *shared); - /*virtual*/ ~Observer() { } - - // return true if value has changed - bool poll(T& value); - - private: - int32_t mSequence; - int mSeed; // for PRNG - Shared * const mShared; - }; - -#if 0 - SingleStateQueue(void /*Shared*/ *shared); - /*virtual*/ ~SingleStateQueue() { } - - static size_t size() { return sizeof(Shared); } -#endif - -}; - -} // namespace android - -#endif // SINGLE_STATE_QUEUE_H diff --git a/external/android/include/18/frameworks/av/include/media/SoundPool.h b/external/android/include/18/frameworks/av/include/media/SoundPool.h deleted file mode 100644 index 7bf3069..0000000 --- a/external/android/include/18/frameworks/av/include/media/SoundPool.h +++ /dev/null @@ -1,240 +0,0 @@ -/* - * 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 SOUNDPOOL_H_ -#define SOUNDPOOL_H_ - -#include -#include -#include -#include -#include - -namespace android { - -static const int IDLE_PRIORITY = -1; - -// forward declarations -class SoundEvent; -class SoundPoolThread; -class SoundPool; - -// for queued events -class SoundPoolEvent { -public: - SoundPoolEvent(int msg, int arg1=0, int arg2=0) : - mMsg(msg), mArg1(arg1), mArg2(arg2) {} - int mMsg; - int mArg1; - int mArg2; - enum MessageType { INVALID, SAMPLE_LOADED }; -}; - -// callback function prototype -typedef void SoundPoolCallback(SoundPoolEvent event, SoundPool* soundPool, void* user); - -// tracks samples used by application -class Sample : public RefBase { -public: - enum sample_state { UNLOADED, LOADING, READY, UNLOADING }; - Sample(int sampleID, const char* url); - Sample(int sampleID, int fd, int64_t offset, int64_t length); - ~Sample(); - int sampleID() { return mSampleID; } - int numChannels() { return mNumChannels; } - int sampleRate() { return mSampleRate; } - audio_format_t format() { return mFormat; } - size_t size() { return mSize; } - int state() { return mState; } - uint8_t* data() { return static_cast(mData->pointer()); } - status_t doLoad(); - void startLoad() { mState = LOADING; } - sp getIMemory() { return mData; } - - // hack - void init(int numChannels, int sampleRate, audio_format_t format, size_t size, - sp data ) { - mNumChannels = numChannels; mSampleRate = sampleRate; mFormat = format; mSize = size; - mData = data; } - -private: - void init(); - - size_t mSize; - volatile int32_t mRefCount; - uint16_t mSampleID; - uint16_t mSampleRate; - uint8_t mState : 3; - uint8_t mNumChannels : 2; - audio_format_t mFormat; - int mFd; - int64_t mOffset; - int64_t mLength; - char* mUrl; - sp mData; -}; - -// stores pending events for stolen channels -class SoundEvent -{ -public: - SoundEvent() : mChannelID(0), mLeftVolume(0), mRightVolume(0), - mPriority(IDLE_PRIORITY), mLoop(0), mRate(0) {} - void set(const sp& sample, int channelID, float leftVolume, - float rightVolume, int priority, int loop, float rate); - sp sample() { return mSample; } - int channelID() { return mChannelID; } - float leftVolume() { return mLeftVolume; } - float rightVolume() { return mRightVolume; } - int priority() { return mPriority; } - int loop() { return mLoop; } - float rate() { return mRate; } - void clear() { mChannelID = 0; mSample.clear(); } - -protected: - sp mSample; - int mChannelID; - float mLeftVolume; - float mRightVolume; - int mPriority; - int mLoop; - float mRate; -}; - -// for channels aka AudioTracks -class SoundChannel : public SoundEvent { -public: - enum state { IDLE, RESUMING, STOPPING, PAUSED, PLAYING }; - SoundChannel() : mAudioTrack(NULL), mState(IDLE), mNumChannels(1), - mPos(0), mToggle(0), mAutoPaused(false) {} - ~SoundChannel(); - void init(SoundPool* soundPool); - void play(const sp& sample, int channelID, float leftVolume, float rightVolume, - int priority, int loop, float rate); - void setVolume_l(float leftVolume, float rightVolume); - void setVolume(float leftVolume, float rightVolume); - void stop_l(); - void stop(); - void pause(); - void autoPause(); - void resume(); - void autoResume(); - void setRate(float rate); - int state() { return mState; } - void setPriority(int priority) { mPriority = priority; } - void setLoop(int loop); - int numChannels() { return mNumChannels; } - void clearNextEvent() { mNextEvent.clear(); } - void nextEvent(); - int nextChannelID() { return mNextEvent.channelID(); } - void dump(); - -private: - static void callback(int event, void* user, void *info); - void process(int event, void *info, unsigned long toggle); - bool doStop_l(); - - SoundPool* mSoundPool; - AudioTrack* mAudioTrack; - SoundEvent mNextEvent; - Mutex mLock; - int mState; - int mNumChannels; - int mPos; - int mAudioBufferSize; - unsigned long mToggle; - bool mAutoPaused; -}; - -// application object for managing a pool of sounds -class SoundPool { - friend class SoundPoolThread; - friend class SoundChannel; -public: - SoundPool(int maxChannels, audio_stream_type_t streamType, int srcQuality); - ~SoundPool(); - int load(const char* url, int priority); - int load(int fd, int64_t offset, int64_t length, int priority); - bool unload(int sampleID); - int play(int sampleID, float leftVolume, float rightVolume, int priority, - int loop, float rate); - void pause(int channelID); - void autoPause(); - void resume(int channelID); - void autoResume(); - void stop(int channelID); - void setVolume(int channelID, float leftVolume, float rightVolume); - void setPriority(int channelID, int priority); - void setLoop(int channelID, int loop); - void setRate(int channelID, float rate); - audio_stream_type_t streamType() const { return mStreamType; } - int srcQuality() const { return mSrcQuality; } - - // called from SoundPoolThread - void sampleLoaded(int sampleID); - - // called from AudioTrack thread - void done_l(SoundChannel* channel); - - // callback function - void setCallback(SoundPoolCallback* callback, void* user); - void* getUserData() { return mUserData; } - -private: - SoundPool() {} // no default constructor - bool startThreads(); - void doLoad(sp& sample); - sp findSample(int sampleID) { return mSamples.valueFor(sampleID); } - SoundChannel* findChannel (int channelID); - SoundChannel* findNextChannel (int channelID); - SoundChannel* allocateChannel_l(int priority); - void moveToFront_l(SoundChannel* channel); - void notify(SoundPoolEvent event); - void dump(); - - // restart thread - void addToRestartList(SoundChannel* channel); - void addToStopList(SoundChannel* channel); - static int beginThread(void* arg); - int run(); - void quit(); - - Mutex mLock; - Mutex mRestartLock; - Condition mCondition; - SoundPoolThread* mDecodeThread; - SoundChannel* mChannelPool; - List mChannels; - List mRestart; - List mStop; - DefaultKeyedVector< int, sp > mSamples; - int mMaxChannels; - audio_stream_type_t mStreamType; - int mSrcQuality; - int mAllocated; - int mNextSampleID; - int mNextChannelID; - bool mQuit; - - // callback - Mutex mCallbackLock; - SoundPoolCallback* mCallback; - void* mUserData; -}; - -} // end namespace android - -#endif /*SOUNDPOOL_H_*/ diff --git a/external/android/include/18/frameworks/av/include/media/ToneGenerator.h b/external/android/include/18/frameworks/av/include/media/ToneGenerator.h deleted file mode 100644 index 2183fbe..0000000 --- a/external/android/include/18/frameworks/av/include/media/ToneGenerator.h +++ /dev/null @@ -1,317 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_TONEGENERATOR_H_ -#define ANDROID_TONEGENERATOR_H_ - -#include -#include -#include -#include -#include - -namespace android { - -class ToneGenerator { -public: - - // List of all available tones - // This enum must be kept consistant with constants in ToneGenerator JAVA class - enum tone_type { - // DTMF tones ITU-T Recommendation Q.23 - TONE_DTMF_0 = 0, // 0 key: 1336Hz, 941Hz - TONE_DTMF_1, // 1 key: 1209Hz, 697Hz - TONE_DTMF_2, // 2 key: 1336Hz, 697Hz - TONE_DTMF_3, // 3 key: 1477Hz, 697Hz - TONE_DTMF_4, // 4 key: 1209Hz, 770Hz - TONE_DTMF_5, // 5 key: 1336Hz, 770Hz - TONE_DTMF_6, // 6 key: 1477Hz, 770Hz - TONE_DTMF_7, // 7 key: 1209Hz, 852Hz - TONE_DTMF_8, // 8 key: 1336Hz, 852Hz - TONE_DTMF_9, // 9 key: 1477Hz, 852Hz - TONE_DTMF_S, // * key: 1209Hz, 941Hz - TONE_DTMF_P, // # key: 1477Hz, 941Hz - TONE_DTMF_A, // A key: 1633Hz, 697Hz - TONE_DTMF_B, // B key: 1633Hz, 770Hz - TONE_DTMF_C, // C key: 1633Hz, 852Hz - TONE_DTMF_D, // D key: 1633Hz, 941Hz - // Call supervisory tones: 3GPP TS 22.001 (CEPT) - TONE_SUP_DIAL, // Dial tone: CEPT: 425Hz, continuous - FIRST_SUP_TONE = TONE_SUP_DIAL, - TONE_SUP_BUSY, // Busy tone, CEPT: 425Hz, 500ms ON, 500ms OFF... - TONE_SUP_CONGESTION, // Congestion tone CEPT, JAPAN: 425Hz, 200ms ON, 200ms OFF... - TONE_SUP_RADIO_ACK, // Radio path acknowlegment, CEPT, ANSI: 425Hz, 200ms ON - TONE_SUP_RADIO_NOTAVAIL, // Radio path not available: 425Hz, 200ms ON, 200 OFF 3 bursts - TONE_SUP_ERROR, // Error/Special info: 950Hz+1400Hz+1800Hz, 330ms ON, 1s OFF... - TONE_SUP_CALL_WAITING, // Call Waiting CEPT,JAPAN: 425Hz, 200ms ON, 600ms OFF, 200ms ON, 3s OFF... - TONE_SUP_RINGTONE, // Ring Tone CEPT, JAPAN: 425Hz, 1s ON, 4s OFF... - LAST_SUP_TONE = TONE_SUP_RINGTONE, - // Proprietary tones: 3GPP TS 31.111 - TONE_PROP_BEEP, // General beep: 400Hz+1200Hz, 35ms ON - TONE_PROP_ACK, // Positive Acknowlgement: 1200Hz, 100ms ON, 100ms OFF 2 bursts - TONE_PROP_NACK, // Negative Acknowlgement: 300Hz+400Hz+500Hz, 400ms ON - TONE_PROP_PROMPT, // Prompt tone: 400Hz+1200Hz, 200ms ON - TONE_PROP_BEEP2, // General double beep: 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms on - // Additional call supervisory tones: specified by IS-95 only - TONE_SUP_INTERCEPT, // Intercept tone: alternating 440 Hz and 620 Hz tones, each on for 250 ms. - TONE_SUP_INTERCEPT_ABBREV, // Abbreviated intercept: intercept tone limited to 4 seconds - TONE_SUP_CONGESTION_ABBREV, // Abbreviated congestion: congestion tone limited to 4 seconds - TONE_SUP_CONFIRM, // Confirm tone: a 350 Hz tone added to a 440 Hz tone repeated 3 times in a 100 ms on, 100 ms off cycle. - TONE_SUP_PIP, // Pip tone: four bursts of 480 Hz tone (0.1 s on, 0.1 s off). - - // CDMA Tones - TONE_CDMA_DIAL_TONE_LITE, - TONE_CDMA_NETWORK_USA_RINGBACK, - TONE_CDMA_INTERCEPT, - TONE_CDMA_ABBR_INTERCEPT, - TONE_CDMA_REORDER, - TONE_CDMA_ABBR_REORDER, - TONE_CDMA_NETWORK_BUSY, - TONE_CDMA_CONFIRM, - TONE_CDMA_ANSWER, - TONE_CDMA_NETWORK_CALLWAITING, - TONE_CDMA_PIP, - - // ISDN - TONE_CDMA_CALL_SIGNAL_ISDN_NORMAL, // ISDN Alert Normal - TONE_CDMA_CALL_SIGNAL_ISDN_INTERGROUP, // ISDN Intergroup - TONE_CDMA_CALL_SIGNAL_ISDN_SP_PRI, // ISDN SP PRI - TONE_CDMA_CALL_SIGNAL_ISDN_PAT3, // ISDN Alert PAT3 - TONE_CDMA_CALL_SIGNAL_ISDN_PING_RING, // ISDN Alert PING RING - TONE_CDMA_CALL_SIGNAL_ISDN_PAT5, // ISDN Alert PAT5 - TONE_CDMA_CALL_SIGNAL_ISDN_PAT6, // ISDN Alert PAT6 - TONE_CDMA_CALL_SIGNAL_ISDN_PAT7, // ISDN Alert PAT7 - // ISDN end - - // IS54 - TONE_CDMA_HIGH_L, // IS54 High Pitch Long - TONE_CDMA_MED_L, // IS54 Med Pitch Long - TONE_CDMA_LOW_L, // IS54 Low Pitch Long - TONE_CDMA_HIGH_SS, // IS54 High Pitch Short Short - TONE_CDMA_MED_SS, // IS54 Medium Pitch Short Short - TONE_CDMA_LOW_SS, // IS54 Low Pitch Short Short - TONE_CDMA_HIGH_SSL, // IS54 High Pitch Short Short Long - TONE_CDMA_MED_SSL, // IS54 Medium Pitch Short Short Long - TONE_CDMA_LOW_SSL, // IS54 Low Pitch Short Short Long - TONE_CDMA_HIGH_SS_2, // IS54 High Pitch Short Short 2 - TONE_CDMA_MED_SS_2, // IS54 Med Pitch Short Short 2 - TONE_CDMA_LOW_SS_2, // IS54 Low Pitch Short Short 2 - TONE_CDMA_HIGH_SLS, // IS54 High Pitch Short Long Short - TONE_CDMA_MED_SLS, // IS54 Med Pitch Short Long Short - TONE_CDMA_LOW_SLS, // IS54 Low Pitch Short Long Short - TONE_CDMA_HIGH_S_X4, // IS54 High Pitch Short Short Short Short - TONE_CDMA_MED_S_X4, // IS54 Med Pitch Short Short Short Short - TONE_CDMA_LOW_S_X4, // IS54 Low Pitch Short Short Short Short - TONE_CDMA_HIGH_PBX_L, // PBX High Pitch Long - TONE_CDMA_MED_PBX_L, // PBX Med Pitch Long - TONE_CDMA_LOW_PBX_L, // PBX Low Pitch Long - TONE_CDMA_HIGH_PBX_SS, // PBX High Short Short - TONE_CDMA_MED_PBX_SS, // PBX Med Short Short - TONE_CDMA_LOW_PBX_SS, // PBX Low Short Short - TONE_CDMA_HIGH_PBX_SSL, // PBX High Short Short Long - TONE_CDMA_MED_PBX_SSL, // PBX Med Short Short Long - TONE_CDMA_LOW_PBX_SSL, // PBX Low Short Short Long - TONE_CDMA_HIGH_PBX_SLS, // PBX High SLS - TONE_CDMA_MED_PBX_SLS, // PBX Med SLS - TONE_CDMA_LOW_PBX_SLS, // PBX Low SLS - TONE_CDMA_HIGH_PBX_S_X4, // PBX High SSSS - TONE_CDMA_MED_PBX_S_X4, // PBX Med SSSS - TONE_CDMA_LOW_PBX_S_X4, // PBX LOW SSSS - //IS54 end - // proprietary - TONE_CDMA_ALERT_NETWORK_LITE, - TONE_CDMA_ALERT_AUTOREDIAL_LITE, - TONE_CDMA_ONE_MIN_BEEP, - TONE_CDMA_KEYPAD_VOLUME_KEY_LITE, - TONE_CDMA_PRESSHOLDKEY_LITE, - TONE_CDMA_ALERT_INCALL_LITE, - TONE_CDMA_EMERGENCY_RINGBACK, - TONE_CDMA_ALERT_CALL_GUARD, - TONE_CDMA_SOFT_ERROR_LITE, - TONE_CDMA_CALLDROP_LITE, - // proprietary end - TONE_CDMA_NETWORK_BUSY_ONE_SHOT, - TONE_CDMA_ABBR_ALERT, - TONE_CDMA_SIGNAL_OFF, - //CDMA end - NUM_TONES, - NUM_SUP_TONES = LAST_SUP_TONE-FIRST_SUP_TONE+1 - }; - - ToneGenerator(audio_stream_type_t streamType, float volume, bool threadCanCallJava = false); - ~ToneGenerator(); - - bool startTone(tone_type toneType, int durationMs = -1); - void stopTone(); - - bool isInited() { return (mState == TONE_IDLE)?false:true;} - - // returns the audio session this ToneGenerator belongs to or 0 if an error occured. - int getSessionId() { return (mpAudioTrack == NULL) ? 0 : mpAudioTrack->getSessionId(); } - -private: - - enum tone_state { - TONE_IDLE, // ToneGenerator is being initialized or initialization failed - TONE_INIT, // ToneGenerator has been successfully initialized and is not playing - TONE_STARTING, // ToneGenerator is starting playing - TONE_PLAYING, // ToneGenerator is playing - TONE_STOPPING, // ToneGenerator is stoping - TONE_STOPPED, // ToneGenerator is stopped: the AudioTrack will be stopped - TONE_RESTARTING // A start request was received in active state (playing or stopping) - }; - - - // Region specific tones. - // These supervisory tones are different depending on the region (USA/CANADA, JAPAN, rest of the world). - // When a tone in the range [FIRST_SUP_TONE, LAST_SUP_TONE] is requested, the region is determined - // from system property gsm.operator.iso-country and the proper tone descriptor is selected with the - // help of sToneMappingTable[] - enum regional_tone_type { - // ANSI supervisory tones - TONE_ANSI_DIAL = NUM_TONES, // Dial tone: a continuous 350 Hz + 440 Hz tone. - TONE_ANSI_BUSY, // Busy tone on: a 480 Hz + 620 Hz tone repeated in a 500 ms on, 500 ms off cycle. - TONE_ANSI_CONGESTION, // Network congestion (reorder) tone on: a 480 Hz + 620 Hz tone repeated in a 250 ms on, 250 ms off cycle. - TONE_ANSI_CALL_WAITING, // Call waiting tone on: 440 Hz, on for 300 ms, 9,7 s off followed by - // (440 Hz, on for 100 ms off for 100 ms, on for 100 ms, 9,7s off and repeated as necessary). - TONE_ANSI_RINGTONE, // Ring Tone: a 440 Hz + 480 Hz tone repeated in a 2 s on, 4 s off pattern. - // JAPAN Supervisory tones - TONE_JAPAN_DIAL, // Dial tone: 400Hz, continuous - TONE_JAPAN_BUSY, // Busy tone: 400Hz, 500ms ON, 500ms OFF... - TONE_JAPAN_RADIO_ACK, // Radio path acknowlegment: 400Hz, 1s ON, 2s OFF... - NUM_ALTERNATE_TONES - }; - - enum region { - ANSI, - JAPAN, - CEPT, - NUM_REGIONS - }; - - static const unsigned char sToneMappingTable[NUM_REGIONS-1][NUM_SUP_TONES]; - - static const unsigned int TONEGEN_MAX_WAVES = 3; // Maximun number of sine waves in a tone segment - static const unsigned int TONEGEN_MAX_SEGMENTS = 12; // Maximun number of segments in a tone descriptor - static const unsigned int TONEGEN_INF = 0xFFFFFFFF; // Represents infinite time duration - static const float TONEGEN_GAIN = 0.9; // Default gain passed to WaveGenerator(). - - // ToneDescriptor class contains all parameters needed to generate a tone: - // - The array waveFreq[]: - // 1 for static tone descriptors: contains the frequencies of all individual waves making the multi-tone. - // 2 for active tone descritors: contains the indexes of the WaveGenerator objects in mWaveGens - // The number of sine waves varies from 1 to TONEGEN_MAX_WAVES. - // The first null value indicates that no more waves are needed. - // - The array segments[] is used to generate the tone pulses. A segment is a period of time - // during which the tone is ON or OFF. Segments with even index (starting from 0) - // correspond to tone ON state and segments with odd index to OFF state. - // The data stored in segments[] is the duration of the corresponding period in ms. - // The first segment encountered with a 0 duration indicates that no more segment follows. - // - loopCnt - Number of times to repeat a sequence of seqments after playing this - // - loopIndx - The segment index to go back and play is loopcnt > 0 - // - repeatCnt indicates the number of times the sequence described by segments[] array must be repeated. - // When the tone generator encounters the first 0 duration segment, it will compare repeatCnt to mCurCount. - // If mCurCount > repeatCnt, the tone is stopped automatically. Otherwise, tone sequence will be - // restarted from segment repeatSegment. - // - repeatSegment number of the first repeated segment when repeatCnt is not null - - class ToneSegment { - public: - unsigned int duration; - unsigned short waveFreq[TONEGEN_MAX_WAVES+1]; - unsigned short loopCnt; - unsigned short loopIndx; - }; - - class ToneDescriptor { - public: - ToneSegment segments[TONEGEN_MAX_SEGMENTS+1]; - unsigned long repeatCnt; - unsigned long repeatSegment; - }; - - static const ToneDescriptor sToneDescriptors[]; - - bool mThreadCanCallJava; - unsigned int mTotalSmp; // Total number of audio samples played (gives current time) - unsigned int mNextSegSmp; // Position of next segment transition expressed in samples - // NOTE: because mTotalSmp, mNextSegSmp are stored on 32 bit, current design will operate properly - // only if tone duration is less than about 27 Hours(@44100Hz sampling rate). If this time is exceeded, - // no crash will occur but tone sequence will show a glitch. - unsigned int mMaxSmp; // Maximum number of audio samples played (maximun tone duration) - int mDurationMs; // Maximum tone duration in ms - - unsigned short mCurSegment; // Current segment index in ToneDescriptor segments[] - unsigned short mCurCount; // Current sequence repeat count - volatile unsigned short mState; // ToneGenerator state (tone_state) - unsigned short mRegion; - const ToneDescriptor *mpToneDesc; // pointer to active tone descriptor - const ToneDescriptor *mpNewToneDesc; // pointer to next active tone descriptor - - unsigned short mLoopCounter; // Current tone loopback count - - uint32_t mSamplingRate; // AudioFlinger Sampling rate - AudioTrack *mpAudioTrack; // Pointer to audio track used for playback - Mutex mLock; // Mutex to control concurent access to ToneGenerator object from audio callback and application API - Mutex mCbkCondLock; // Mutex associated to mWaitCbkCond - Condition mWaitCbkCond; // condition enabling interface to wait for audio callback completion after a change is requested - float mVolume; // Volume applied to audio track - audio_stream_type_t mStreamType; // Audio stream used for output - unsigned int mProcessSize; // Size of audio blocks generated at a time by audioCallback() (in PCM frames). - struct timespec mStartTime; // tone start time: needed to guaranty actual tone duration - - bool initAudioTrack(); - static void audioCallback(int event, void* user, void *info); - bool prepareWave(); - unsigned int numWaves(unsigned int segmentIdx); - void clearWaveGens(); - tone_type getToneForRegion(tone_type toneType); - - // WaveGenerator generates a single sine wave - class WaveGenerator { - public: - enum gen_command { - WAVEGEN_START, // Start/restart wave from phase 0 - WAVEGEN_CONT, // Continue wave from current phase - WAVEGEN_STOP // Stop wave on zero crossing - }; - - WaveGenerator(unsigned short samplingRate, unsigned short frequency, - float volume); - ~WaveGenerator(); - - void getSamples(short *outBuffer, unsigned int count, - unsigned int command); - - private: - static const short GEN_AMP = 32000; // amplitude of generator - static const short S_Q14 = 14; // shift for Q14 - static const short S_Q15 = 15; // shift for Q15 - - short mA1_Q14; // Q14 coefficient - // delay line of full amplitude generator - short mS1, mS2; // delay line S2 oldest - short mS2_0; // saved value for reinitialisation - short mAmplitude_Q15; // Q15 amplitude - }; - - KeyedVector mWaveGens; // list of active wave generators. -}; - -} -; // namespace android - -#endif /*ANDROID_TONEGENERATOR_H_*/ diff --git a/external/android/include/18/frameworks/av/include/media/Visualizer.h b/external/android/include/18/frameworks/av/include/media/Visualizer.h deleted file mode 100644 index aa58905..0000000 --- a/external/android/include/18/frameworks/av/include/media/Visualizer.h +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (C) 2010 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_MEDIA_VISUALIZER_H -#define ANDROID_MEDIA_VISUALIZER_H - -#include -#include -#include - -/** - * The Visualizer class enables application to retrieve part of the currently playing audio for - * visualization purpose. It is not an audio recording interface and only returns partial and low - * quality audio content. However, to protect privacy of certain audio data (e.g voice mail) the use - * of the visualizer requires the permission android.permission.RECORD_AUDIO. - * The audio session ID passed to the constructor indicates which audio content should be - * visualized: - * - If the session is 0, the audio output mix is visualized - * - If the session is not 0, the audio from a particular MediaPlayer or AudioTrack - * using this audio session is visualized - * Two types of representation of audio content can be captured: - * - Waveform data: consecutive 8-bit (unsigned) mono samples by using the getWaveForm() method - * - Frequency data: 8-bit magnitude FFT by using the getFft() method - * - * The length of the capture can be retrieved or specified by calling respectively - * getCaptureSize() and setCaptureSize() methods. Note that the size of the FFT - * is half of the specified capture size but both sides of the spectrum are returned yielding in a - * number of bytes equal to the capture size. The capture size must be a power of 2 in the range - * returned by getMinCaptureSize() and getMaxCaptureSize(). - * In addition to the polling capture mode, a callback mode is also available by installing a - * callback function by use of the setCaptureCallBack() method. The rate at which the callback - * is called as well as the type of data returned is specified. - * Before capturing data, the Visualizer must be enabled by calling the setEnabled() method. - * When data capture is not needed any more, the Visualizer should be disabled. - */ - - -namespace android { - -// ---------------------------------------------------------------------------- - -class Visualizer: public AudioEffect { -public: - - enum callback_flags { - CAPTURE_WAVEFORM = 0x00000001, // capture callback returns a PCM wave form - CAPTURE_FFT = 0x00000002, // apture callback returns a frequency representation - CAPTURE_CALL_JAVA = 0x00000004 // the callback thread can call java - }; - - - /* Constructor. - * See AudioEffect constructor for details on parameters. - */ - Visualizer(int32_t priority = 0, - effect_callback_t cbf = NULL, - void* user = NULL, - int sessionId = 0); - - ~Visualizer(); - - virtual status_t setEnabled(bool enabled); - - // maximum capture size in samples - static uint32_t getMaxCaptureSize() { return VISUALIZER_CAPTURE_SIZE_MAX; } - // minimum capture size in samples - static uint32_t getMinCaptureSize() { return VISUALIZER_CAPTURE_SIZE_MIN; } - // maximum capture rate in millihertz - static uint32_t getMaxCaptureRate() { return CAPTURE_RATE_MAX; } - - // callback used to return periodic PCM or FFT captures to the application. Either one or both - // types of data are returned (PCM and FFT) according to flags indicated when installing the - // callback. When a type of data is not present, the corresponding size (waveformSize or - // fftSize) is 0. - typedef void (*capture_cbk_t)(void* user, - uint32_t waveformSize, - uint8_t *waveform, - uint32_t fftSize, - uint8_t *fft, - uint32_t samplingrate); - - // install a callback to receive periodic captures. The capture rate is specified in milliHertz - // and the capture format is according to flags (see callback_flags). - status_t setCaptureCallBack(capture_cbk_t cbk, void* user, uint32_t flags, uint32_t rate); - - // set the capture size capture size must be a power of two in the range - // [VISUALIZER_CAPTURE_SIZE_MAX. VISUALIZER_CAPTURE_SIZE_MIN] - // must be called when the visualizer is not enabled - status_t setCaptureSize(uint32_t size); - uint32_t getCaptureSize() { return mCaptureSize; } - - // returns the capture rate indicated when installing the callback - uint32_t getCaptureRate() { return mCaptureRate; } - - // returns the sampling rate of the audio being captured - uint32_t getSamplingRate() { return mSampleRate; } - - // set the way volume affects the captured data - // mode must one of VISUALIZER_SCALING_MODE_NORMALIZED, - // VISUALIZER_SCALING_MODE_AS_PLAYED - status_t setScalingMode(uint32_t mode); - uint32_t getScalingMode() { return mScalingMode; } - - // return a capture in PCM 8 bit unsigned format. The size of the capture is equal to - // getCaptureSize() - status_t getWaveForm(uint8_t *waveform); - - // return a capture in FFT 8 bit signed format. The size of the capture is equal to - // getCaptureSize() but the length of the FFT is half of the size (both parts of the spectrum - // are returned - status_t getFft(uint8_t *fft); - -protected: - // from IEffectClient - virtual void controlStatusChanged(bool controlGranted); - -private: - - static const uint32_t CAPTURE_RATE_MAX = 20000; - static const uint32_t CAPTURE_RATE_DEF = 10000; - static const uint32_t CAPTURE_SIZE_DEF = VISUALIZER_CAPTURE_SIZE_MAX; - - /* internal class to handle the callback */ - class CaptureThread : public Thread - { - public: - CaptureThread(Visualizer& receiver, uint32_t captureRate, bool bCanCallJava = false); - - private: - friend class Visualizer; - virtual bool threadLoop(); - Visualizer& mReceiver; - Mutex mLock; - uint32_t mSleepTimeUs; - }; - - status_t doFft(uint8_t *fft, uint8_t *waveform); - void periodicCapture(); - uint32_t initCaptureSize(); - - Mutex mCaptureLock; - uint32_t mCaptureRate; - uint32_t mCaptureSize; - uint32_t mSampleRate; - uint32_t mScalingMode; - capture_cbk_t mCaptureCallBack; - void *mCaptureCbkUser; - sp mCaptureThread; - uint32_t mCaptureFlags; -}; - - -}; // namespace android - -#endif // ANDROID_MEDIA_VISUALIZER_H diff --git a/external/android/include/18/frameworks/av/include/media/mediametadataretriever.h b/external/android/include/18/frameworks/av/include/media/mediametadataretriever.h deleted file mode 100644 index 0df77c1..0000000 --- a/external/android/include/18/frameworks/av/include/media/mediametadataretriever.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * 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. - */ - - -#ifndef MEDIAMETADATARETRIEVER_H -#define MEDIAMETADATARETRIEVER_H - -#include // for status_t -#include -#include -#include - -namespace android { - -class IMediaPlayerService; -class IMediaMetadataRetriever; - -// Keep these in synch with the constants defined in MediaMetadataRetriever.java -// class. -enum { - METADATA_KEY_CD_TRACK_NUMBER = 0, - METADATA_KEY_ALBUM = 1, - METADATA_KEY_ARTIST = 2, - METADATA_KEY_AUTHOR = 3, - METADATA_KEY_COMPOSER = 4, - METADATA_KEY_DATE = 5, - METADATA_KEY_GENRE = 6, - METADATA_KEY_TITLE = 7, - METADATA_KEY_YEAR = 8, - METADATA_KEY_DURATION = 9, - METADATA_KEY_NUM_TRACKS = 10, - METADATA_KEY_WRITER = 11, - METADATA_KEY_MIMETYPE = 12, - METADATA_KEY_ALBUMARTIST = 13, - METADATA_KEY_DISC_NUMBER = 14, - METADATA_KEY_COMPILATION = 15, - METADATA_KEY_HAS_AUDIO = 16, - METADATA_KEY_HAS_VIDEO = 17, - METADATA_KEY_VIDEO_WIDTH = 18, - METADATA_KEY_VIDEO_HEIGHT = 19, - METADATA_KEY_BITRATE = 20, - METADATA_KEY_TIMED_TEXT_LANGUAGES = 21, - METADATA_KEY_IS_DRM = 22, - METADATA_KEY_LOCATION = 23, - METADATA_KEY_VIDEO_ROTATION = 24, - - // Add more here... -}; - -class MediaMetadataRetriever: public RefBase -{ -public: - MediaMetadataRetriever(); - ~MediaMetadataRetriever(); - void disconnect(); - - status_t setDataSource( - const char *dataSourceUrl, - const KeyedVector *headers = NULL); - - status_t setDataSource(int fd, int64_t offset, int64_t length); - sp getFrameAtTime(int64_t timeUs, int option); - sp extractAlbumArt(); - const char* extractMetadata(int keyCode); - -private: - static const sp& getService(); - - class DeathNotifier: public IBinder::DeathRecipient - { - public: - DeathNotifier() {} - virtual ~DeathNotifier(); - virtual void binderDied(const wp& who); - }; - - static sp sDeathNotifier; - static Mutex sServiceLock; - static sp sService; - - Mutex mLock; - sp mRetriever; - -}; - -}; // namespace android - -#endif // MEDIAMETADATARETRIEVER_H diff --git a/external/android/include/18/frameworks/av/include/media/mediaplayer.h b/external/android/include/18/frameworks/av/include/media/mediaplayer.h deleted file mode 100644 index 14381c7..0000000 --- a/external/android/include/18/frameworks/av/include/media/mediaplayer.h +++ /dev/null @@ -1,273 +0,0 @@ -/* - * 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_MEDIAPLAYER_H -#define ANDROID_MEDIAPLAYER_H - -#include - -#include -#include -#include -#include -#include - -#include -#include - -class ANativeWindow; - -namespace android { - -class Surface; -class IGraphicBufferProducer; - -enum media_event_type { - MEDIA_NOP = 0, // interface test message - MEDIA_PREPARED = 1, - MEDIA_PLAYBACK_COMPLETE = 2, - MEDIA_BUFFERING_UPDATE = 3, - MEDIA_SEEK_COMPLETE = 4, - MEDIA_SET_VIDEO_SIZE = 5, - MEDIA_TIMED_TEXT = 99, - MEDIA_ERROR = 100, - MEDIA_INFO = 200, -}; - -// Generic error codes for the media player framework. Errors are fatal, the -// playback must abort. -// -// Errors are communicated back to the client using the -// MediaPlayerListener::notify method defined below. -// In this situation, 'notify' is invoked with the following: -// 'msg' is set to MEDIA_ERROR. -// 'ext1' should be a value from the enum media_error_type. -// 'ext2' contains an implementation dependant error code to provide -// more details. Should default to 0 when not used. -// -// The codes are distributed as follow: -// 0xx: Reserved -// 1xx: Android Player errors. Something went wrong inside the MediaPlayer. -// 2xx: Media errors (e.g Codec not supported). There is a problem with the -// media itself. -// 3xx: Runtime errors. Some extraordinary condition arose making the playback -// impossible. -// -enum media_error_type { - // 0xx - MEDIA_ERROR_UNKNOWN = 1, - // 1xx - MEDIA_ERROR_SERVER_DIED = 100, - // 2xx - MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK = 200, - // 3xx -}; - - -// Info and warning codes for the media player framework. These are non fatal, -// the playback is going on but there might be some user visible issues. -// -// Info and warning messages are communicated back to the client using the -// MediaPlayerListener::notify method defined below. In this situation, -// 'notify' is invoked with the following: -// 'msg' is set to MEDIA_INFO. -// 'ext1' should be a value from the enum media_info_type. -// 'ext2' contains an implementation dependant info code to provide -// more details. Should default to 0 when not used. -// -// The codes are distributed as follow: -// 0xx: Reserved -// 7xx: Android Player info/warning (e.g player lagging behind.) -// 8xx: Media info/warning (e.g media badly interleaved.) -// -enum media_info_type { - // 0xx - MEDIA_INFO_UNKNOWN = 1, - // The player was started because it was used as the next player for another - // player, which just completed playback - MEDIA_INFO_STARTED_AS_NEXT = 2, - // The player just pushed the very first video frame for rendering - MEDIA_INFO_RENDERING_START = 3, - // 7xx - // The video is too complex for the decoder: it can't decode frames fast - // enough. Possibly only the audio plays fine at this stage. - MEDIA_INFO_VIDEO_TRACK_LAGGING = 700, - // MediaPlayer is temporarily pausing playback internally in order to - // buffer more data. - MEDIA_INFO_BUFFERING_START = 701, - // MediaPlayer is resuming playback after filling buffers. - MEDIA_INFO_BUFFERING_END = 702, - // Bandwidth in recent past - MEDIA_INFO_NETWORK_BANDWIDTH = 703, - - // 8xx - // Bad interleaving means that a media has been improperly interleaved or not - // interleaved at all, e.g has all the video samples first then all the audio - // ones. Video is playing but a lot of disk seek may be happening. - MEDIA_INFO_BAD_INTERLEAVING = 800, - // The media is not seekable (e.g live stream). - MEDIA_INFO_NOT_SEEKABLE = 801, - // New media metadata is available. - MEDIA_INFO_METADATA_UPDATE = 802, - - //9xx - MEDIA_INFO_TIMED_TEXT_ERROR = 900, -}; - - - -enum media_player_states { - MEDIA_PLAYER_STATE_ERROR = 0, - MEDIA_PLAYER_IDLE = 1 << 0, - MEDIA_PLAYER_INITIALIZED = 1 << 1, - MEDIA_PLAYER_PREPARING = 1 << 2, - MEDIA_PLAYER_PREPARED = 1 << 3, - MEDIA_PLAYER_STARTED = 1 << 4, - MEDIA_PLAYER_PAUSED = 1 << 5, - MEDIA_PLAYER_STOPPED = 1 << 6, - MEDIA_PLAYER_PLAYBACK_COMPLETE = 1 << 7 -}; - -// Keep KEY_PARAMETER_* in sync with MediaPlayer.java. -// The same enum space is used for both set and get, in case there are future keys that -// can be both set and get. But as of now, all parameters are either set only or get only. -enum media_parameter_keys { - // Streaming/buffering parameters - KEY_PARAMETER_CACHE_STAT_COLLECT_FREQ_MS = 1100, // set only - - // Return a Parcel containing a single int, which is the channel count of the - // audio track, or zero for error (e.g. no audio track) or unknown. - KEY_PARAMETER_AUDIO_CHANNEL_COUNT = 1200, // get only - - // Playback rate expressed in permille (1000 is normal speed), saved as int32_t, with negative - // values used for rewinding or reverse playback. - KEY_PARAMETER_PLAYBACK_RATE_PERMILLE = 1300, // set only -}; - -// Keep INVOKE_ID_* in sync with MediaPlayer.java. -enum media_player_invoke_ids { - INVOKE_ID_GET_TRACK_INFO = 1, - INVOKE_ID_ADD_EXTERNAL_SOURCE = 2, - INVOKE_ID_ADD_EXTERNAL_SOURCE_FD = 3, - INVOKE_ID_SELECT_TRACK = 4, - INVOKE_ID_UNSELECT_TRACK = 5, - INVOKE_ID_SET_VIDEO_SCALING_MODE = 6, -}; - -// Keep MEDIA_TRACK_TYPE_* in sync with MediaPlayer.java. -enum media_track_type { - MEDIA_TRACK_TYPE_UNKNOWN = 0, - MEDIA_TRACK_TYPE_VIDEO = 1, - MEDIA_TRACK_TYPE_AUDIO = 2, - MEDIA_TRACK_TYPE_TIMEDTEXT = 3, -}; - -// ---------------------------------------------------------------------------- -// ref-counted object for callbacks -class MediaPlayerListener: virtual public RefBase -{ -public: - virtual void notify(int msg, int ext1, int ext2, const Parcel *obj) = 0; -}; - -class MediaPlayer : public BnMediaPlayerClient, - public virtual IMediaDeathNotifier -{ -public: - MediaPlayer(); - ~MediaPlayer(); - void died(); - void disconnect(); - - status_t setDataSource( - const char *url, - const KeyedVector *headers); - - status_t setDataSource(int fd, int64_t offset, int64_t length); - status_t setDataSource(const sp &source); - status_t setVideoSurfaceTexture( - const sp& bufferProducer); - status_t setListener(const sp& listener); - status_t prepare(); - status_t prepareAsync(); - status_t start(); - status_t stop(); - status_t pause(); - bool isPlaying(); - status_t getVideoWidth(int *w); - status_t getVideoHeight(int *h); - status_t seekTo(int msec); - status_t getCurrentPosition(int *msec); - status_t getDuration(int *msec); - status_t reset(); - status_t setAudioStreamType(audio_stream_type_t type); - status_t setLooping(int loop); - bool isLooping(); - status_t setVolume(float leftVolume, float rightVolume); - void notify(int msg, int ext1, int ext2, const Parcel *obj = NULL); - static sp decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, audio_format_t* pFormat); - static sp decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, audio_format_t* pFormat); - status_t invoke(const Parcel& request, Parcel *reply); - status_t setMetadataFilter(const Parcel& filter); - status_t getMetadata(bool update_only, bool apply_filter, Parcel *metadata); - status_t setAudioSessionId(int sessionId); - int getAudioSessionId(); - status_t setAuxEffectSendLevel(float level); - status_t attachAuxEffect(int effectId); - status_t setParameter(int key, const Parcel& request); - status_t getParameter(int key, Parcel* reply); - status_t setRetransmitEndpoint(const char* addrString, uint16_t port); - status_t setNextMediaPlayer(const sp& player); - - status_t updateProxyConfig( - const char *host, int32_t port, const char *exclusionList); - -private: - void clear_l(); - status_t seekTo_l(int msec); - status_t prepareAsync_l(); - status_t getDuration_l(int *msec); - status_t attachNewPlayer(const sp& player); - status_t reset_l(); - status_t doSetRetransmitEndpoint(const sp& player); - - sp mPlayer; - thread_id_t mLockThreadId; - Mutex mLock; - Mutex mNotifyLock; - Condition mSignal; - sp mListener; - void* mCookie; - media_player_states mCurrentState; - int mCurrentPosition; - int mSeekPosition; - bool mPrepareSync; - status_t mPrepareStatus; - audio_stream_type_t mStreamType; - bool mLoop; - float mLeftVolume; - float mRightVolume; - int mVideoWidth; - int mVideoHeight; - int mAudioSessionId; - float mSendLevel; - struct sockaddr_in mRetransmitEndpoint; - bool mRetransmitEndpointValid; -}; - -}; // namespace android - -#endif // ANDROID_MEDIAPLAYER_H diff --git a/external/android/include/18/frameworks/av/include/media/mediarecorder.h b/external/android/include/18/frameworks/av/include/media/mediarecorder.h deleted file mode 100644 index 88a42a0..0000000 --- a/external/android/include/18/frameworks/av/include/media/mediarecorder.h +++ /dev/null @@ -1,258 +0,0 @@ -/* - ** 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. - */ - -#ifndef ANDROID_MEDIARECORDER_H -#define ANDROID_MEDIARECORDER_H - -#include -#include -#include -#include -#include -#include - -namespace android { - -class Surface; -class IMediaRecorder; -class ICamera; -class ICameraRecordingProxy; -class IGraphicBufferProducer; -class Surface; - -typedef void (*media_completion_f)(status_t status, void *cookie); - -enum video_source { - VIDEO_SOURCE_DEFAULT = 0, - VIDEO_SOURCE_CAMERA = 1, - VIDEO_SOURCE_GRALLOC_BUFFER = 2, - - VIDEO_SOURCE_LIST_END // must be last - used to validate audio source type -}; - -//Please update media/java/android/media/MediaRecorder.java if the following is updated. -enum output_format { - OUTPUT_FORMAT_DEFAULT = 0, - OUTPUT_FORMAT_THREE_GPP = 1, - OUTPUT_FORMAT_MPEG_4 = 2, - - - OUTPUT_FORMAT_AUDIO_ONLY_START = 3, // Used in validating the output format. Should be the - // at the start of the audio only output formats. - - /* These are audio only file formats */ - OUTPUT_FORMAT_RAW_AMR = 3, //to be backward compatible - OUTPUT_FORMAT_AMR_NB = 3, - OUTPUT_FORMAT_AMR_WB = 4, - OUTPUT_FORMAT_AAC_ADIF = 5, - OUTPUT_FORMAT_AAC_ADTS = 6, - - /* Stream over a socket, limited to a single stream */ - OUTPUT_FORMAT_RTP_AVP = 7, - - /* H.264/AAC data encapsulated in MPEG2/TS */ - OUTPUT_FORMAT_MPEG2TS = 8, - - OUTPUT_FORMAT_LIST_END // must be last - used to validate format type -}; - -enum audio_encoder { - AUDIO_ENCODER_DEFAULT = 0, - AUDIO_ENCODER_AMR_NB = 1, - AUDIO_ENCODER_AMR_WB = 2, - AUDIO_ENCODER_AAC = 3, - AUDIO_ENCODER_HE_AAC = 4, - AUDIO_ENCODER_AAC_ELD = 5, - - AUDIO_ENCODER_LIST_END // must be the last - used to validate the audio encoder type -}; - -enum video_encoder { - VIDEO_ENCODER_DEFAULT = 0, - VIDEO_ENCODER_H263 = 1, - VIDEO_ENCODER_H264 = 2, - VIDEO_ENCODER_MPEG_4_SP = 3, - - VIDEO_ENCODER_LIST_END // must be the last - used to validate the video encoder type -}; - -/* - * The state machine of the media_recorder. - */ -enum media_recorder_states { - // Error state. - MEDIA_RECORDER_ERROR = 0, - - // Recorder was just created. - MEDIA_RECORDER_IDLE = 1 << 0, - - // Recorder has been initialized. - MEDIA_RECORDER_INITIALIZED = 1 << 1, - - // Configuration of the recorder has been completed. - MEDIA_RECORDER_DATASOURCE_CONFIGURED = 1 << 2, - - // Recorder is ready to start. - MEDIA_RECORDER_PREPARED = 1 << 3, - - // Recording is in progress. - MEDIA_RECORDER_RECORDING = 1 << 4, -}; - -// The "msg" code passed to the listener in notify. -enum media_recorder_event_type { - MEDIA_RECORDER_EVENT_LIST_START = 1, - MEDIA_RECORDER_EVENT_ERROR = 1, - MEDIA_RECORDER_EVENT_INFO = 2, - MEDIA_RECORDER_EVENT_LIST_END = 99, - - // Track related event types - MEDIA_RECORDER_TRACK_EVENT_LIST_START = 100, - MEDIA_RECORDER_TRACK_EVENT_ERROR = 100, - MEDIA_RECORDER_TRACK_EVENT_INFO = 101, - MEDIA_RECORDER_TRACK_EVENT_LIST_END = 1000, -}; - -/* - * The (part of) "what" code passed to the listener in notify. - * When the error or info type is track specific, the what has - * the following layout: - * the left-most 16-bit is meant for error or info type. - * the right-most 4-bit is meant for track id. - * the rest is reserved. - * - * | track id | reserved | error or info type | - * 31 28 16 0 - * - */ -enum media_recorder_error_type { - MEDIA_RECORDER_ERROR_UNKNOWN = 1, - - // Track related error type - MEDIA_RECORDER_TRACK_ERROR_LIST_START = 100, - MEDIA_RECORDER_TRACK_ERROR_GENERAL = 100, - MEDIA_RECORDER_ERROR_VIDEO_NO_SYNC_FRAME = 200, - MEDIA_RECORDER_TRACK_ERROR_LIST_END = 1000, -}; - -// The codes are distributed as follow: -// 0xx: Reserved -// 8xx: General info/warning -// -enum media_recorder_info_type { - MEDIA_RECORDER_INFO_UNKNOWN = 1, - - MEDIA_RECORDER_INFO_MAX_DURATION_REACHED = 800, - MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED = 801, - - // All track related informtional events start here - MEDIA_RECORDER_TRACK_INFO_LIST_START = 1000, - MEDIA_RECORDER_TRACK_INFO_COMPLETION_STATUS = 1000, - MEDIA_RECORDER_TRACK_INFO_PROGRESS_IN_TIME = 1001, - MEDIA_RECORDER_TRACK_INFO_TYPE = 1002, - MEDIA_RECORDER_TRACK_INFO_DURATION_MS = 1003, - - // The time to measure the max chunk duration - MEDIA_RECORDER_TRACK_INFO_MAX_CHUNK_DUR_MS = 1004, - - MEDIA_RECORDER_TRACK_INFO_ENCODED_FRAMES = 1005, - - // The time to measure how well the audio and video - // track data is interleaved. - MEDIA_RECORDER_TRACK_INTER_CHUNK_TIME_MS = 1006, - - // The time to measure system response. Note that - // the delay does not include the intentional delay - // we use to eliminate the recording sound. - MEDIA_RECORDER_TRACK_INFO_INITIAL_DELAY_MS = 1007, - - // The time used to compensate for initial A/V sync. - MEDIA_RECORDER_TRACK_INFO_START_OFFSET_MS = 1008, - - // Total number of bytes of the media data. - MEDIA_RECORDER_TRACK_INFO_DATA_KBYTES = 1009, - - MEDIA_RECORDER_TRACK_INFO_LIST_END = 2000, -}; - -// ---------------------------------------------------------------------------- -// ref-counted object for callbacks -class MediaRecorderListener: virtual public RefBase -{ -public: - virtual void notify(int msg, int ext1, int ext2) = 0; -}; - -class MediaRecorder : public BnMediaRecorderClient, - public virtual IMediaDeathNotifier -{ -public: - MediaRecorder(); - ~MediaRecorder(); - - void died(); - status_t initCheck(); - status_t setCamera(const sp& camera, const sp& proxy); - status_t setPreviewSurface(const sp& surface); - status_t setVideoSource(int vs); - status_t setAudioSource(int as); - status_t setOutputFormat(int of); - status_t setVideoEncoder(int ve); - status_t setAudioEncoder(int ae); - status_t setOutputFile(const char* path); - status_t setOutputFile(int fd, int64_t offset, int64_t length); - status_t setVideoSize(int width, int height); - status_t setVideoFrameRate(int frames_per_second); - status_t setParameters(const String8& params); - status_t setListener(const sp& listener); - status_t setClientName(const String16& clientName); - status_t prepare(); - status_t getMaxAmplitude(int* max); - status_t start(); - status_t stop(); - status_t reset(); - status_t init(); - status_t close(); - status_t release(); - void notify(int msg, int ext1, int ext2); - sp querySurfaceMediaSourceFromMediaServer(); - -private: - void doCleanUp(); - status_t doReset(); - - sp mMediaRecorder; - sp mListener; - - // Reference to IGraphicBufferProducer - // for encoding GL Frames. That is useful only when the - // video source is set to VIDEO_SOURCE_GRALLOC_BUFFER - sp mSurfaceMediaSource; - - media_recorder_states mCurrentState; - bool mIsAudioSourceSet; - bool mIsVideoSourceSet; - bool mIsAudioEncoderSet; - bool mIsVideoEncoderSet; - bool mIsOutputFileSet; - Mutex mLock; - Mutex mNotifyLock; -}; - -}; // namespace android - -#endif // ANDROID_MEDIARECORDER_H diff --git a/external/android/include/18/frameworks/av/include/media/mediascanner.h b/external/android/include/18/frameworks/av/include/media/mediascanner.h deleted file mode 100644 index a73403b..0000000 --- a/external/android/include/18/frameworks/av/include/media/mediascanner.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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. - */ - -#ifndef MEDIASCANNER_H -#define MEDIASCANNER_H - -#include -#include -#include -#include -#include - -struct dirent; - -namespace android { - -class MediaScannerClient; -class StringArray; - -enum MediaScanResult { - // This file or directory was scanned successfully. - MEDIA_SCAN_RESULT_OK, - // This file or directory was skipped because it was not found, could - // not be opened, was of an unsupported type, or was malfored in some way. - MEDIA_SCAN_RESULT_SKIPPED, - // The scan should be aborted due to a fatal error such as out of memory - // or an exception. - MEDIA_SCAN_RESULT_ERROR, -}; - -struct MediaScanner { - MediaScanner(); - virtual ~MediaScanner(); - - virtual MediaScanResult processFile( - const char *path, const char *mimeType, MediaScannerClient &client) = 0; - - virtual MediaScanResult processDirectory( - const char *path, MediaScannerClient &client); - - void setLocale(const char *locale); - - // extracts album art as a block of data - virtual char *extractAlbumArt(int fd) = 0; - -protected: - const char *locale() const; - -private: - // current locale (like "ja_JP"), created/destroyed with strdup()/free() - char *mLocale; - char *mSkipList; - int *mSkipIndex; - - MediaScanResult doProcessDirectory( - char *path, int pathRemaining, MediaScannerClient &client, bool noMedia); - MediaScanResult doProcessDirectoryEntry( - char *path, int pathRemaining, MediaScannerClient &client, bool noMedia, - struct dirent* entry, char* fileSpot); - void loadSkipList(); - bool shouldSkipDirectory(char *path); - - - MediaScanner(const MediaScanner &); - MediaScanner &operator=(const MediaScanner &); -}; - -class MediaScannerClient -{ -public: - MediaScannerClient(); - virtual ~MediaScannerClient(); - void setLocale(const char* locale); - void beginFile(); - status_t addStringTag(const char* name, const char* value); - void endFile(); - - virtual status_t scanFile(const char* path, long long lastModified, - long long fileSize, bool isDirectory, bool noMedia) = 0; - virtual status_t handleStringTag(const char* name, const char* value) = 0; - virtual status_t setMimeType(const char* mimeType) = 0; - -protected: - void convertValues(uint32_t encoding); - -protected: - // cached name and value strings, for native encoding support. - StringArray* mNames; - StringArray* mValues; - - // default encoding based on MediaScanner::mLocale string - uint32_t mLocaleEncoding; -}; - -}; // namespace android - -#endif // MEDIASCANNER_H diff --git a/external/android/include/18/frameworks/av/include/media/nbaio/AudioBufferProviderSource.h b/external/android/include/18/frameworks/av/include/media/nbaio/AudioBufferProviderSource.h deleted file mode 100644 index 2c4aaff..0000000 --- a/external/android/include/18/frameworks/av/include/media/nbaio/AudioBufferProviderSource.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2012 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. - */ - -// Implementation of NBAIO_Source that wraps an AudioBufferProvider - -#ifndef ANDROID_AUDIO_BUFFER_PROVIDER_SOURCE_H -#define ANDROID_AUDIO_BUFFER_PROVIDER_SOURCE_H - -#include "NBAIO.h" -#include - -namespace android { - -class AudioBufferProviderSource : public NBAIO_Source { - -public: - AudioBufferProviderSource(AudioBufferProvider *provider, NBAIO_Format format); - virtual ~AudioBufferProviderSource(); - - // NBAIO_Port interface - - //virtual ssize_t negotiate(const NBAIO_Format offers[], size_t numOffers, - // NBAIO_Format counterOffers[], size_t& numCounterOffers); - //virtual NBAIO_Format format(); - - // NBAIO_Source interface - - //virtual size_t framesRead() const; - //virtual size_t framesOverrun(); - //virtual size_t overruns(); - virtual ssize_t availableToRead(); - virtual ssize_t read(void *buffer, size_t count, int64_t readPTS); - virtual ssize_t readVia(readVia_t via, size_t total, void *user, - int64_t readPTS, size_t block); - -private: - AudioBufferProvider * const mProvider; - AudioBufferProvider::Buffer mBuffer; // current buffer - size_t mConsumed; // number of frames consumed so far from current buffer -}; - -} // namespace android - -#endif // ANDROID_AUDIO_BUFFER_PROVIDER_SOURCE_H diff --git a/external/android/include/18/frameworks/av/include/media/nbaio/AudioStreamInSource.h b/external/android/include/18/frameworks/av/include/media/nbaio/AudioStreamInSource.h deleted file mode 100644 index 07d8c89..0000000 --- a/external/android/include/18/frameworks/av/include/media/nbaio/AudioStreamInSource.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2012 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_AUDIO_STREAM_IN_SOURCE_H -#define ANDROID_AUDIO_STREAM_IN_SOURCE_H - -#include -#include "NBAIO.h" - -namespace android { - -// not multi-thread safe -class AudioStreamInSource : public NBAIO_Source { - -public: - AudioStreamInSource(audio_stream_in *stream); - virtual ~AudioStreamInSource(); - - // NBAIO_Port interface - - virtual ssize_t negotiate(const NBAIO_Format offers[], size_t numOffers, - NBAIO_Format counterOffers[], size_t& numCounterOffers); - //virtual NBAIO_Format format() const; - - // NBAIO_Sink interface - - //virtual size_t framesRead() const; - virtual size_t framesOverrun(); - virtual size_t overruns() { (void) framesOverrun(); return mOverruns; } - - // This is an over-estimate, and could dupe the caller into making a blocking read() - // FIXME Use an audio HAL API to query the buffer filling status when it's available. - virtual ssize_t availableToRead() { return mStreamBufferSizeBytes >> mBitShift; } - - virtual ssize_t read(void *buffer, size_t count); - - // NBAIO_Sink end - -#if 0 // until necessary - audio_stream_in *stream() const { return mStream; } -#endif - -private: - audio_stream_in * const mStream; - size_t mStreamBufferSizeBytes; // as reported by get_buffer_size() - size_t mFramesOverrun; - size_t mOverruns; -}; - -} // namespace android - -#endif // ANDROID_AUDIO_STREAM_IN_SOURCE_H diff --git a/external/android/include/18/frameworks/av/include/media/nbaio/AudioStreamOutSink.h b/external/android/include/18/frameworks/av/include/media/nbaio/AudioStreamOutSink.h deleted file mode 100644 index 5976b18..0000000 --- a/external/android/include/18/frameworks/av/include/media/nbaio/AudioStreamOutSink.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2012 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_AUDIO_STREAM_OUT_SINK_H -#define ANDROID_AUDIO_STREAM_OUT_SINK_H - -#include -#include "NBAIO.h" - -namespace android { - -// not multi-thread safe -class AudioStreamOutSink : public NBAIO_Sink { - -public: - AudioStreamOutSink(audio_stream_out *stream); - virtual ~AudioStreamOutSink(); - - // NBAIO_Port interface - - virtual ssize_t negotiate(const NBAIO_Format offers[], size_t numOffers, - NBAIO_Format counterOffers[], size_t& numCounterOffers); - //virtual NBAIO_Format format(); - - // NBAIO_Sink interface - - //virtual size_t framesWritten() const; - //virtual size_t framesUnderrun() const; - //virtual size_t underruns() const; - - // This is an over-estimate, and could dupe the caller into making a blocking write() - // FIXME Use an audio HAL API to query the buffer emptying status when it's available. - virtual ssize_t availableToWrite() const { return mStreamBufferSizeBytes >> mBitShift; } - - virtual ssize_t write(const void *buffer, size_t count); - - // AudioStreamOutSink wraps a HAL's output stream. Its - // getNextWriteTimestamp method is simply a passthru to the HAL's underlying - // implementation of GNWT (if any) - virtual status_t getNextWriteTimestamp(int64_t *timestamp); - - // NBAIO_Sink end - -#if 0 // until necessary - audio_stream_out *stream() const { return mStream; } -#endif - -private: - audio_stream_out * const mStream; - size_t mStreamBufferSizeBytes; // as reported by get_buffer_size() -}; - -} // namespace android - -#endif // ANDROID_AUDIO_STREAM_OUT_SINK_H diff --git a/external/android/include/18/frameworks/av/include/media/nbaio/LibsndfileSink.h b/external/android/include/18/frameworks/av/include/media/nbaio/LibsndfileSink.h deleted file mode 100644 index f5d53d5..0000000 --- a/external/android/include/18/frameworks/av/include/media/nbaio/LibsndfileSink.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2012 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_AUDIO_LIBSNDFILE_SINK_H -#define ANDROID_AUDIO_LIBSNDFILE_SINK_H - -#include "NBAIO.h" -#include "sndfile.h" - -// Implementation of NBAIO_Sink that wraps a libsndfile opened in SFM_WRITE mode - -namespace android { - -class LibsndfileSink : public NBAIO_Sink { - -public: - LibsndfileSink(SNDFILE *sndfile, const SF_INFO &sfinfo); - virtual ~LibsndfileSink(); - - // NBAIO_Port interface - - //virtual ssize_t negotiate(const NBAIO_Format offers[], size_t numOffers, - // NBAIO_Format counterOffers[], size_t& numCounterOffers); - //virtual NBAIO_Format format() const; - - // NBAIO_Sink interface - - //virtual size_t framesWritten() const; - //virtual size_t framesUnderrun() const; - //virtual size_t underruns() const; - //virtual ssize_t availableToWrite() const; - virtual ssize_t write(const void *buffer, size_t count); - //virtual ssize_t writeVia(writeVia_t via, size_t total, void *user, size_t block); - -private: - SNDFILE * mSndfile; -}; - -} // namespace android - -#endif // ANDROID_AUDIO_LIBSNDFILE_SINK_H diff --git a/external/android/include/18/frameworks/av/include/media/nbaio/LibsndfileSource.h b/external/android/include/18/frameworks/av/include/media/nbaio/LibsndfileSource.h deleted file mode 100644 index 4fbdb4b..0000000 --- a/external/android/include/18/frameworks/av/include/media/nbaio/LibsndfileSource.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2012 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_AUDIO_LIBSNDFILE_SOURCE_H -#define ANDROID_AUDIO_LIBSNDFILE_SOURCE_H - -#include "NBAIO.h" -#include "sndfile.h" - -// Implementation of NBAIO_Source that wraps a libsndfile opened in SFM_READ mode - -namespace android { - -class LibsndfileSource : public NBAIO_Source { - -public: - // If 'loop' is true and it permits seeking, then we'll act as an infinite source - LibsndfileSource(SNDFILE *sndfile, const SF_INFO &sfinfo, bool loop = false); - virtual ~LibsndfileSource(); - - // NBAIO_Port interface - - //virtual ssize_t negotiate(const NBAIO_Format offers[], size_t numOffers, - // NBAIO_Format counterOffers[], size_t& numCounterOffers); - //virtual NBAIO_Format format() const; - - // NBAIO_Source interface - - //virtual size_t framesRead() const; - //virtual size_t framesOverrun(); - //virtual size_t overruns(); - virtual ssize_t availableToRead(); - virtual ssize_t read(void *buffer, size_t count); - //virtual ssize_t readVia(readVia_t via, size_t total, void *user, size_t block); - -private: - SNDFILE * mSndfile; - sf_count_t mEstimatedFramesUntilEOF; - bool mLooping; - bool mReadAnyFramesThisLoopCycle; -}; - -} // namespace android - -#endif // ANDROID_AUDIO_LIBSNDFILE_SOURCE_H diff --git a/external/android/include/18/frameworks/av/include/media/nbaio/MonoPipe.h b/external/android/include/18/frameworks/av/include/media/nbaio/MonoPipe.h deleted file mode 100644 index 5fcfe9e..0000000 --- a/external/android/include/18/frameworks/av/include/media/nbaio/MonoPipe.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (C) 2012 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_AUDIO_MONO_PIPE_H -#define ANDROID_AUDIO_MONO_PIPE_H - -#include -#include -#include "NBAIO.h" - -namespace android { - -// MonoPipe is similar to Pipe except: -// - supports only a single reader, called MonoPipeReader -// - write() cannot overrun; instead it will return a short actual count if insufficient space -// - write() can optionally block if the pipe is full -// Like Pipe, it is not multi-thread safe for either writer or reader -// but writer and reader can be different threads. -class MonoPipe : public NBAIO_Sink { - - friend class MonoPipeReader; - -public: - // reqFrames will be rounded up to a power of 2, and all slots are available. Must be >= 2. - // Note: whatever shares this object with another thread needs to do so in an SMP-safe way (like - // creating it the object before creating the other thread, or storing the object with a - // release_store). Otherwise the other thread could see a partially-constructed object. - MonoPipe(size_t reqFrames, NBAIO_Format format, bool writeCanBlock = false); - virtual ~MonoPipe(); - - // NBAIO_Port interface - - //virtual ssize_t negotiate(const NBAIO_Format offers[], size_t numOffers, - // NBAIO_Format counterOffers[], size_t& numCounterOffers); - //virtual NBAIO_Format format() const; - - // NBAIO_Sink interface - - //virtual size_t framesWritten() const; - //virtual size_t framesUnderrun() const; - //virtual size_t underruns() const; - - virtual ssize_t availableToWrite() const; - virtual ssize_t write(const void *buffer, size_t count); - //virtual ssize_t writeVia(writeVia_t via, size_t total, void *user, size_t block); - - // MonoPipe's implementation of getNextWriteTimestamp works in conjunction - // with MonoPipeReader. Every time a MonoPipeReader reads from the pipe, it - // receives a "readPTS" indicating the point in time for which the reader - // would like to read data. This "last read PTS" is offset by the amt of - // data the reader is currently mixing and then cached cached along with the - // updated read pointer. This cached value is the local time for which the - // reader is going to request data next time it reads data (assuming we are - // in steady state and operating with no underflows). Writers to the - // MonoPipe who would like to know when their next write operation will hit - // the speakers can call getNextWriteTimestamp which will return the value - // of the last read PTS plus the duration of the amt of data waiting to be - // read in the MonoPipe. - virtual status_t getNextWriteTimestamp(int64_t *timestamp); - - // average number of frames present in the pipe under normal conditions. - // See throttling mechanism in MonoPipe::write() - size_t getAvgFrames() const { return mSetpoint; } - void setAvgFrames(size_t setpoint); - size_t maxFrames() const { return mMaxFrames; } - - // Set the shutdown state for the write side of a pipe. - // This may be called by an unrelated thread. When shutdown state is 'true', - // a write that would otherwise block instead returns a short transfer count. - // There is no guarantee how long it will take for the shutdown to be recognized, - // but it will not be an unbounded amount of time. - // The state can be restored to normal by calling shutdown(false). - void shutdown(bool newState = true); - - // Return true if the write side of a pipe is currently shutdown. - bool isShutdown(); - -private: - // A pair of methods and a helper variable which allows the reader and the - // writer to update and observe the values of mFront and mNextRdPTS in an - // atomic lock-less fashion. - // - // :: Important :: - // Two assumptions must be true in order for this lock-less approach to - // function properly on all systems. First, there may only be one updater - // thread in the system. Second, the updater thread must be running at a - // strictly higher priority than the observer threads. Currently, both of - // these assumptions are true. The only updater is always a single - // FastMixer thread (which runs with SCHED_FIFO/RT priority while the only - // observer is always an AudioFlinger::PlaybackThread running with - // traditional (non-RT) audio priority. - void updateFrontAndNRPTS(int32_t newFront, int64_t newNextRdPTS); - void observeFrontAndNRPTS(int32_t *outFront, int64_t *outNextRdPTS); - volatile int32_t mUpdateSeq; - - const size_t mReqFrames; // as requested in constructor, unrounded - const size_t mMaxFrames; // always a power of 2 - void * const mBuffer; - // mFront and mRear will never be separated by more than mMaxFrames. - // 32-bit overflow is possible if the pipe is active for a long time, but if that happens it's - // safe because we "&" with (mMaxFrames-1) at end of computations to calculate a buffer index. - volatile int32_t mFront; // written by the reader with updateFrontAndNRPTS, observed by - // the writer with observeFrontAndNRPTS - volatile int32_t mRear; // written by writer with android_atomic_release_store, - // read by reader with android_atomic_acquire_load - volatile int64_t mNextRdPTS; // written by the reader with updateFrontAndNRPTS, observed by - // the writer with observeFrontAndNRPTS - bool mWriteTsValid; // whether mWriteTs is valid - struct timespec mWriteTs; // time that the previous write() completed - size_t mSetpoint; // target value for pipe fill depth - const bool mWriteCanBlock; // whether write() should block if the pipe is full - - int64_t offsetTimestampByAudioFrames(int64_t ts, size_t audFrames); - LinearTransform mSamplesToLocalTime; - - bool mIsShutdown; // whether shutdown(true) was called, no barriers are needed -}; - -} // namespace android - -#endif // ANDROID_AUDIO_MONO_PIPE_H diff --git a/external/android/include/18/frameworks/av/include/media/nbaio/MonoPipeReader.h b/external/android/include/18/frameworks/av/include/media/nbaio/MonoPipeReader.h deleted file mode 100644 index 0e1c992..0000000 --- a/external/android/include/18/frameworks/av/include/media/nbaio/MonoPipeReader.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2012 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_AUDIO_MONO_PIPE_READER_H -#define ANDROID_AUDIO_MONO_PIPE_READER_H - -#include "MonoPipe.h" - -namespace android { - -// MonoPipeReader is safe for only a single reader thread -class MonoPipeReader : public NBAIO_Source { - -public: - - // Construct a MonoPipeReader and associate it with a MonoPipe; - // any data already in the pipe is visible to this PipeReader. - // There can be only a single MonoPipeReader per MonoPipe. - // FIXME make this constructor a factory method of MonoPipe. - MonoPipeReader(MonoPipe* pipe); - virtual ~MonoPipeReader(); - - // NBAIO_Port interface - - //virtual ssize_t negotiate(const NBAIO_Format offers[], size_t numOffers, - // NBAIO_Format counterOffers[], size_t& numCounterOffers); - //virtual NBAIO_Format format() const; - - // NBAIO_Source interface - - //virtual size_t framesRead() const; - //virtual size_t framesOverrun(); - //virtual size_t overruns(); - - virtual ssize_t availableToRead(); - - virtual ssize_t read(void *buffer, size_t count, int64_t readPTS); - - // NBAIO_Source end - -#if 0 // until necessary - MonoPipe* pipe() const { return mPipe; } -#endif - -private: - MonoPipe * const mPipe; -}; - -} // namespace android - -#endif // ANDROID_AUDIO_MONO_PIPE_READER_H diff --git a/external/android/include/18/frameworks/av/include/media/nbaio/NBAIO.h b/external/android/include/18/frameworks/av/include/media/nbaio/NBAIO.h deleted file mode 100644 index f5d6eb5..0000000 --- a/external/android/include/18/frameworks/av/include/media/nbaio/NBAIO.h +++ /dev/null @@ -1,313 +0,0 @@ -/* - * Copyright (C) 2012 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_AUDIO_NBAIO_H -#define ANDROID_AUDIO_NBAIO_H - -// Non-blocking audio I/O interface -// -// This header file has the abstract interfaces only. Concrete implementation classes are declared -// elsewhere. Implementations _should_ be non-blocking for all methods, especially read() and -// write(), but this is not enforced. In general, implementations do not need to be multi-thread -// safe, and any exceptions are noted in the particular implementation. - -#include -#include -#include -#include - -namespace android { - -// In addition to the usual status_t -enum { - NEGOTIATE = 0x80000010, // Must (re-)negotiate format. For negotiate() only, the offeree - // doesn't accept offers, and proposes counter-offers - OVERRUN = 0x80000011, // availableToRead(), read(), or readVia() detected lost input due - // to overrun; an event is counted and the caller should re-try - UNDERRUN = 0x80000012, // availableToWrite(), write(), or writeVia() detected a gap in - // output due to underrun (not being called often enough, or with - // enough data); an event is counted and the caller should re-try -}; - -// Negotiation of format is based on the data provider and data sink, or the data consumer and -// data source, exchanging prioritized arrays of offers and counter-offers until a single offer is -// mutually agreed upon. Each offer is an NBAIO_Format. For simplicity and performance, -// NBAIO_Format is a typedef that ties together the most important combinations of the various -// attributes, rather than a struct with separate fields for format, sample rate, channel count, -// interleave, packing, alignment, etc. The reason is that NBAIO_Format tries to abstract out only -// the combinations that are actually needed within AudioFlinger. If the list of combinations grows -// too large, then this decision should be re-visited. -// Sample rate and channel count are explicit, PCM interleaved 16-bit is assumed. -typedef unsigned NBAIO_Format; -enum { - Format_Invalid -}; - -// Return the frame size of an NBAIO_Format in bytes -size_t Format_frameSize(NBAIO_Format format); - -// Return the frame size of an NBAIO_Format as a bit shift -size_t Format_frameBitShift(NBAIO_Format format); - -// Convert a sample rate in Hz and channel count to an NBAIO_Format -NBAIO_Format Format_from_SR_C(unsigned sampleRate, unsigned channelCount); - -// Return the sample rate in Hz of an NBAIO_Format -unsigned Format_sampleRate(NBAIO_Format format); - -// Return the channel count of an NBAIO_Format -unsigned Format_channelCount(NBAIO_Format format); - -// Callbacks used by NBAIO_Sink::writeVia() and NBAIO_Source::readVia() below. -typedef ssize_t (*writeVia_t)(void *user, void *buffer, size_t count); -typedef ssize_t (*readVia_t)(void *user, const void *buffer, - size_t count, int64_t readPTS); - -// Abstract class (interface) representing a data port. -class NBAIO_Port : public RefBase { - -public: - - // negotiate() must called first. The purpose of negotiate() is to check compatibility of - // formats, not to automatically adapt if they are incompatible. It's the responsibility of - // whoever sets up the graph connections to make sure formats are compatible, and this method - // just verifies that. The edges are "dumb" and don't attempt to adapt to bad connections. - // How it works: offerer proposes an array of formats, in descending order of preference from - // offers[0] to offers[numOffers - 1]. If offeree accepts one of these formats, it returns - // the index of that offer. Otherwise, offeree sets numCounterOffers to the number of - // counter-offers (up to a maximumum of the entry value of numCounterOffers), fills in the - // provided array counterOffers[] with its counter-offers, in descending order of preference - // from counterOffers[0] to counterOffers[numCounterOffers - 1], and returns NEGOTIATE. - // Note that since the offerer allocates space for counter-offers, but only the offeree knows - // how many counter-offers it has, there may be insufficient space for all counter-offers. - // In that case, the offeree sets numCounterOffers to the requested number of counter-offers - // (which is greater than the entry value of numCounterOffers), fills in as many of the most - // important counterOffers as will fit, and returns NEGOTIATE. As this implies a re-allocation, - // it should be used as a last resort. It is preferable for the offerer to simply allocate a - // larger space to begin with, and/or for the offeree to tolerate a smaller space than desired. - // Alternatively, the offerer can pass NULL for offers and counterOffers, and zero for - // numOffers. This indicates that it has not allocated space for any counter-offers yet. - // In this case, the offerree should set numCounterOffers appropriately and return NEGOTIATE. - // Then the offerer will allocate the correct amount of memory and retry. - // Format_Invalid is not allowed as either an offer or counter-offer. - // Returns: - // >= 0 Offer accepted. - // NEGOTIATE No offer accepted, and counter-offer(s) optionally made. See above for details. - virtual ssize_t negotiate(const NBAIO_Format offers[], size_t numOffers, - NBAIO_Format counterOffers[], size_t& numCounterOffers); - - // Return the current negotiated format, or Format_Invalid if negotiation has not been done, - // or if re-negotiation is required. - virtual NBAIO_Format format() const { return mNegotiated ? mFormat : Format_Invalid; } - -protected: - NBAIO_Port(NBAIO_Format format) : mNegotiated(false), mFormat(format), - mBitShift(Format_frameBitShift(format)) { } - virtual ~NBAIO_Port() { } - - // Implementations are free to ignore these if they don't need them - - bool mNegotiated; // mNegotiated implies (mFormat != Format_Invalid) - NBAIO_Format mFormat; // (mFormat != Format_Invalid) does not imply mNegotiated - size_t mBitShift; // assign in parallel with any assignment to mFormat -}; - -// Abstract class (interface) representing a non-blocking data sink, for use by a data provider. -class NBAIO_Sink : public NBAIO_Port { - -public: - - // For the next two APIs: - // 32 bits rolls over after 27 hours at 44.1 kHz; if that concerns you then poll periodically. - - // Return the number of frames written successfully since construction. - virtual size_t framesWritten() const { return mFramesWritten; } - - // Number of frames lost due to underrun since construction. - virtual size_t framesUnderrun() const { return 0; } - - // Number of underruns since construction, where a set of contiguous lost frames is one event. - virtual size_t underruns() const { return 0; } - - // Estimate of number of frames that could be written successfully now without blocking. - // When a write() is actually attempted, the implementation is permitted to return a smaller or - // larger transfer count, however it will make a good faith effort to give an accurate estimate. - // Errors: - // NEGOTIATE (Re-)negotiation is needed. - // UNDERRUN write() has not been called frequently enough, or with enough frames to keep up. - // An underrun event is counted, and the caller should re-try this operation. - // WOULD_BLOCK Determining how many frames can be written without blocking would itself block. - virtual ssize_t availableToWrite() const { return SSIZE_MAX; } - - // Transfer data to sink from single input buffer. Implies a copy. - // Inputs: - // buffer Non-NULL buffer owned by provider. - // count Maximum number of frames to transfer. - // Return value: - // > 0 Number of frames successfully transferred prior to first error. - // = 0 Count was zero. - // < 0 status_t error occurred prior to the first frame transfer. - // Errors: - // NEGOTIATE (Re-)negotiation is needed. - // WOULD_BLOCK No frames can be transferred without blocking. - // UNDERRUN write() has not been called frequently enough, or with enough frames to keep up. - // An underrun event is counted, and the caller should re-try this operation. - virtual ssize_t write(const void *buffer, size_t count) = 0; - - // Transfer data to sink using a series of callbacks. More suitable for zero-fill, synthesis, - // and non-contiguous transfers (e.g. circular buffer or writev). - // Inputs: - // via Callback function that the sink will call as many times as needed to consume data. - // total Estimate of the number of frames the provider has available. This is an estimate, - // and it can provide a different number of frames during the series of callbacks. - // user Arbitrary void * reserved for data provider. - // block Number of frames per block, that is a suggested value for 'count' in each callback. - // Zero means no preference. This parameter is a hint only, and may be ignored. - // Return value: - // > 0 Total number of frames successfully transferred prior to first error. - // = 0 Count was zero. - // < 0 status_t error occurred prior to the first frame transfer. - // Errors: - // NEGOTIATE (Re-)negotiation is needed. - // WOULD_BLOCK No frames can be transferred without blocking. - // UNDERRUN write() has not been called frequently enough, or with enough frames to keep up. - // An underrun event is counted, and the caller should re-try this operation. - // - // The 'via' callback is called by the data sink as follows: - // Inputs: - // user Arbitrary void * reserved for data provider. - // buffer Non-NULL buffer owned by sink that callback should fill in with data, - // up to a maximum of 'count' frames. - // count Maximum number of frames to transfer during this callback. - // Return value: - // > 0 Number of frames successfully transferred during this callback prior to first error. - // = 0 Count was zero. - // < 0 status_t error occurred prior to the first frame transfer during this callback. - virtual ssize_t writeVia(writeVia_t via, size_t total, void *user, size_t block = 0); - - // Get the time (on the LocalTime timeline) at which the first frame of audio of the next write - // operation to this sink will be eventually rendered by the HAL. - // Inputs: - // ts A pointer pointing to the int64_t which will hold the result. - // Return value: - // OK Everything went well, *ts holds the time at which the first audio frame of the next - // write operation will be rendered, or AudioBufferProvider::kInvalidPTS if this sink - // does not know the answer for some reason. Sinks which eventually lead to a HAL - // which implements get_next_write_timestamp may return Invalid temporarily if the DMA - // output of the audio driver has not started yet. Sinks which lead to a HAL which - // does not implement get_next_write_timestamp, or which don't lead to a HAL at all, - // will always return kInvalidPTS. - // Something unexpected happened internally. Check the logs and start debugging. - virtual status_t getNextWriteTimestamp(int64_t *ts) { return INVALID_OPERATION; } - -protected: - NBAIO_Sink(NBAIO_Format format = Format_Invalid) : NBAIO_Port(format), mFramesWritten(0) { } - virtual ~NBAIO_Sink() { } - - // Implementations are free to ignore these if they don't need them - size_t mFramesWritten; -}; - -// Abstract class (interface) representing a non-blocking data source, for use by a data consumer. -class NBAIO_Source : public NBAIO_Port { - -public: - - // For the next two APIs: - // 32 bits rolls over after 27 hours at 44.1 kHz; if that concerns you then poll periodically. - - // Number of frames read successfully since construction. - virtual size_t framesRead() const { return mFramesRead; } - - // Number of frames lost due to overrun since construction. - // Not const because implementations may need to do I/O. - virtual size_t framesOverrun() /*const*/ { return 0; } - - // Number of overruns since construction, where a set of contiguous lost frames is one event. - // Not const because implementations may need to do I/O. - virtual size_t overruns() /*const*/ { return 0; } - - // Estimate of number of frames that could be read successfully now. - // When a read() is actually attempted, the implementation is permitted to return a smaller or - // larger transfer count, however it will make a good faith effort to give an accurate estimate. - // Errors: - // NEGOTIATE (Re-)negotiation is needed. - // OVERRUN One or more frames were lost due to overrun, try again to read more recent data. - // WOULD_BLOCK Determining how many frames can be read without blocking would itself block. - virtual ssize_t availableToRead() { return SSIZE_MAX; } - - // Transfer data from source into single destination buffer. Implies a copy. - // Inputs: - // buffer Non-NULL destination buffer owned by consumer. - // count Maximum number of frames to transfer. - // readPTS The presentation time (on the LocalTime timeline) for which data - // is being requested, or kInvalidPTS if not known. - // Return value: - // > 0 Number of frames successfully transferred prior to first error. - // = 0 Count was zero. - // < 0 status_t error occurred prior to the first frame transfer. - // Errors: - // NEGOTIATE (Re-)negotiation is needed. - // WOULD_BLOCK No frames can be transferred without blocking. - // OVERRUN read() has not been called frequently enough, or with enough frames to keep up. - // One or more frames were lost due to overrun, try again to read more recent data. - virtual ssize_t read(void *buffer, size_t count, int64_t readPTS) = 0; - - // Transfer data from source using a series of callbacks. More suitable for zero-fill, - // synthesis, and non-contiguous transfers (e.g. circular buffer or readv). - // Inputs: - // via Callback function that the source will call as many times as needed to provide data. - // total Estimate of the number of frames the consumer desires. This is an estimate, - // and it can consume a different number of frames during the series of callbacks. - // user Arbitrary void * reserved for data consumer. - // readPTS The presentation time (on the LocalTime timeline) for which data - // is being requested, or kInvalidPTS if not known. - // block Number of frames per block, that is a suggested value for 'count' in each callback. - // Zero means no preference. This parameter is a hint only, and may be ignored. - // Return value: - // > 0 Total number of frames successfully transferred prior to first error. - // = 0 Count was zero. - // < 0 status_t error occurred prior to the first frame transfer. - // Errors: - // NEGOTIATE (Re-)negotiation is needed. - // WOULD_BLOCK No frames can be transferred without blocking. - // OVERRUN read() has not been called frequently enough, or with enough frames to keep up. - // One or more frames were lost due to overrun, try again to read more recent data. - // - // The 'via' callback is called by the data source as follows: - // Inputs: - // user Arbitrary void * reserved for data consumer. - // dest Non-NULL buffer owned by source that callback should consume data from, - // up to a maximum of 'count' frames. - // count Maximum number of frames to transfer during this callback. - // Return value: - // > 0 Number of frames successfully transferred during this callback prior to first error. - // = 0 Count was zero. - // < 0 status_t error occurred prior to the first frame transfer during this callback. - virtual ssize_t readVia(readVia_t via, size_t total, void *user, - int64_t readPTS, size_t block = 0); - -protected: - NBAIO_Source(NBAIO_Format format = Format_Invalid) : NBAIO_Port(format), mFramesRead(0) { } - virtual ~NBAIO_Source() { } - - // Implementations are free to ignore these if they don't need them - size_t mFramesRead; -}; - -} // namespace android - -#endif // ANDROID_AUDIO_NBAIO_H diff --git a/external/android/include/18/frameworks/av/include/media/nbaio/NBLog.h b/external/android/include/18/frameworks/av/include/media/nbaio/NBLog.h deleted file mode 100644 index 107ba66..0000000 --- a/external/android/include/18/frameworks/av/include/media/nbaio/NBLog.h +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright (C) 2013 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. - */ - -// Non-blocking event logger intended for safe communication between processes via shared memory - -#ifndef ANDROID_MEDIA_NBLOG_H -#define ANDROID_MEDIA_NBLOG_H - -#include -#include -#include - -namespace android { - -class NBLog { - -public: - -class Writer; -class Reader; - -private: - -enum Event { - EVENT_RESERVED, - EVENT_STRING, // ASCII string, not NUL-terminated - EVENT_TIMESTAMP, // clock_gettime(CLOCK_MONOTONIC) -}; - -// --------------------------------------------------------------------------- - -// representation of a single log entry in private memory -struct Entry { - Entry(Event event, const void *data, size_t length) - : mEvent(event), mLength(length), mData(data) { } - /*virtual*/ ~Entry() { } - - int readAt(size_t offset) const; - -private: - friend class Writer; - Event mEvent; // event type - size_t mLength; // length of additional data, 0 <= mLength <= 255 - const void *mData; // event type-specific data -}; - -// representation of a single log entry in shared memory -// byte[0] mEvent -// byte[1] mLength -// byte[2] mData[0] -// ... -// byte[2+i] mData[i] -// ... -// byte[2+mLength-1] mData[mLength-1] -// byte[2+mLength] duplicate copy of mLength to permit reverse scan -// byte[3+mLength] start of next log entry - -// located in shared memory -struct Shared { - Shared() : mRear(0) { } - /*virtual*/ ~Shared() { } - - volatile int32_t mRear; // index one byte past the end of most recent Entry - char mBuffer[0]; // circular buffer for entries -}; - -public: - -// --------------------------------------------------------------------------- - -// FIXME Timeline was intended to wrap Writer and Reader, but isn't actually used yet. -// For now it is just a namespace for sharedSize(). -class Timeline : public RefBase { -public: -#if 0 - Timeline(size_t size, void *shared = NULL); - virtual ~Timeline(); -#endif - - static size_t sharedSize(size_t size); - -#if 0 -private: - friend class Writer; - friend class Reader; - - const size_t mSize; // circular buffer size in bytes, must be a power of 2 - bool mOwn; // whether I own the memory at mShared - Shared* const mShared; // pointer to shared memory -#endif -}; - -// --------------------------------------------------------------------------- - -// Writer is thread-safe with respect to Reader, but not with respect to multiple threads -// calling Writer methods. If you need multi-thread safety for writing, use LockedWriter. -class Writer : public RefBase { -public: - Writer(); // dummy nop implementation without shared memory - Writer(size_t size, void *shared); - Writer(size_t size, const sp& iMemory); - virtual ~Writer() { } - - virtual void log(const char *string); - virtual void logf(const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); - virtual void logvf(const char *fmt, va_list ap); - virtual void logTimestamp(); - virtual void logTimestamp(const struct timespec& ts); - - virtual bool isEnabled() const; - - // return value for all of these is the previous isEnabled() - virtual bool setEnabled(bool enabled); // but won't enable if no shared memory - bool enable() { return setEnabled(true); } - bool disable() { return setEnabled(false); } - - sp getIMemory() const { return mIMemory; } - -private: - void log(Event event, const void *data, size_t length); - void log(const Entry *entry, bool trusted = false); - - const size_t mSize; // circular buffer size in bytes, must be a power of 2 - Shared* const mShared; // raw pointer to shared memory - const sp mIMemory; // ref-counted version - int32_t mRear; // my private copy of mShared->mRear - bool mEnabled; // whether to actually log -}; - -// --------------------------------------------------------------------------- - -// Similar to Writer, but safe for multiple threads to call concurrently -class LockedWriter : public Writer { -public: - LockedWriter(); - LockedWriter(size_t size, void *shared); - - virtual void log(const char *string); - virtual void logf(const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); - virtual void logvf(const char *fmt, va_list ap); - virtual void logTimestamp(); - virtual void logTimestamp(const struct timespec& ts); - - virtual bool isEnabled() const; - virtual bool setEnabled(bool enabled); - -private: - mutable Mutex mLock; -}; - -// --------------------------------------------------------------------------- - -class Reader : public RefBase { -public: - Reader(size_t size, const void *shared); - Reader(size_t size, const sp& iMemory); - virtual ~Reader() { } - - void dump(int fd, size_t indent = 0); - bool isIMemory(const sp& iMemory) const; - -private: - const size_t mSize; // circular buffer size in bytes, must be a power of 2 - const Shared* const mShared; // raw pointer to shared memory - const sp mIMemory; // ref-counted version - int32_t mFront; // index of oldest acknowledged Entry - - static const size_t kSquashTimestamp = 5; // squash this many or more adjacent timestamps -}; - -}; // class NBLog - -} // namespace android - -#endif // ANDROID_MEDIA_NBLOG_H diff --git a/external/android/include/18/frameworks/av/include/media/nbaio/Pipe.h b/external/android/include/18/frameworks/av/include/media/nbaio/Pipe.h deleted file mode 100644 index 79a4eee..0000000 --- a/external/android/include/18/frameworks/av/include/media/nbaio/Pipe.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2012 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_AUDIO_PIPE_H -#define ANDROID_AUDIO_PIPE_H - -#include "NBAIO.h" - -namespace android { - -// Pipe is multi-thread safe for readers (see PipeReader), but safe for only a single writer thread. -// It cannot UNDERRUN on write, unless we allow designation of a master reader that provides the -// time-base. Readers can be added and removed dynamically, and it's OK to have no readers. -class Pipe : public NBAIO_Sink { - - friend class PipeReader; - -public: - // maxFrames will be rounded up to a power of 2, and all slots are available. Must be >= 2. - Pipe(size_t maxFrames, NBAIO_Format format); - virtual ~Pipe(); - - // NBAIO_Port interface - - //virtual ssize_t negotiate(const NBAIO_Format offers[], size_t numOffers, - // NBAIO_Format counterOffers[], size_t& numCounterOffers); - //virtual NBAIO_Format format() const; - - // NBAIO_Sink interface - - //virtual size_t framesWritten() const; - //virtual size_t framesUnderrun() const; - //virtual size_t underruns() const; - - // The write side of a pipe permits overruns; flow control is the caller's responsibility. - // It doesn't return +infinity because that would guarantee an overrun. - virtual ssize_t availableToWrite() const { return mMaxFrames; } - - virtual ssize_t write(const void *buffer, size_t count); - //virtual ssize_t writeVia(writeVia_t via, size_t total, void *user, size_t block); - -private: - const size_t mMaxFrames; // always a power of 2 - void * const mBuffer; - volatile int32_t mRear; // written by android_atomic_release_store - volatile int32_t mReaders; // number of PipeReader clients currently attached to this Pipe -}; - -} // namespace android - -#endif // ANDROID_AUDIO_PIPE_H diff --git a/external/android/include/18/frameworks/av/include/media/nbaio/PipeReader.h b/external/android/include/18/frameworks/av/include/media/nbaio/PipeReader.h deleted file mode 100644 index 350e6ab..0000000 --- a/external/android/include/18/frameworks/av/include/media/nbaio/PipeReader.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2012 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_AUDIO_PIPE_READER_H -#define ANDROID_AUDIO_PIPE_READER_H - -#include "Pipe.h" - -namespace android { - -// PipeReader is safe for only a single thread -class PipeReader : public NBAIO_Source { - -public: - - // Construct a PipeReader and associate it with a Pipe - // FIXME make this constructor a factory method of Pipe. - PipeReader(Pipe& pipe); - virtual ~PipeReader(); - - // NBAIO_Port interface - - //virtual ssize_t negotiate(const NBAIO_Format offers[], size_t numOffers, - // NBAIO_Format counterOffers[], size_t& numCounterOffers); - //virtual NBAIO_Format format() const; - - // NBAIO_Source interface - - //virtual size_t framesRead() const; - virtual size_t framesOverrun() { return mFramesOverrun; } - virtual size_t overruns() { return mOverruns; } - - virtual ssize_t availableToRead(); - - virtual ssize_t read(void *buffer, size_t count, int64_t readPTS); - - // NBAIO_Source end - -#if 0 // until necessary - Pipe& pipe() const { return mPipe; } -#endif - -private: - Pipe& mPipe; - int32_t mFront; // follows behind mPipe.mRear - size_t mFramesOverrun; - size_t mOverruns; -}; - -} // namespace android - -#endif // ANDROID_AUDIO_PIPE_READER_H diff --git a/external/android/include/18/frameworks/av/include/media/nbaio/SourceAudioBufferProvider.h b/external/android/include/18/frameworks/av/include/media/nbaio/SourceAudioBufferProvider.h deleted file mode 100644 index c08331b..0000000 --- a/external/android/include/18/frameworks/av/include/media/nbaio/SourceAudioBufferProvider.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2012 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. - */ - -// Implementation of AudioBufferProvider that wraps an NBAIO_Source - -#ifndef ANDROID_SOURCE_AUDIO_BUFFER_PROVIDER_H -#define ANDROID_SOURCE_AUDIO_BUFFER_PROVIDER_H - -#include "NBAIO.h" -#include - -namespace android { - -class SourceAudioBufferProvider : public ExtendedAudioBufferProvider { - -public: - SourceAudioBufferProvider(const sp& source); - virtual ~SourceAudioBufferProvider(); - - // AudioBufferProvider interface - virtual status_t getNextBuffer(Buffer *buffer, int64_t pts); - virtual void releaseBuffer(Buffer *buffer); - - // ExtendedAudioBufferProvider interface - virtual size_t framesReady() const; - -private: - const sp mSource; // the wrapped source - /*const*/ size_t mFrameBitShift; // log2(frame size in bytes) - void* mAllocated; // pointer to base of allocated memory - size_t mSize; // size of mAllocated in frames - size_t mOffset; // frame offset within mAllocated of valid data - size_t mRemaining; // frame count within mAllocated of valid data - size_t mGetCount; // buffer.frameCount of the most recent getNextBuffer -}; - -} // namespace android - -#endif // ANDROID_SOURCE_AUDIO_BUFFER_PROVIDER_H diff --git a/external/android/include/18/frameworks/av/include/media/nbaio/roundup.h b/external/android/include/18/frameworks/av/include/media/nbaio/roundup.h deleted file mode 100644 index 4c3cc25..0000000 --- a/external/android/include/18/frameworks/av/include/media/nbaio/roundup.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2012 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 ROUNDUP_H -#define ROUNDUP_H - -#ifdef __cplusplus -extern "C" { -#endif - -// Round up to the next highest power of 2 -unsigned roundup(unsigned v); - -#ifdef __cplusplus -} -#endif - -#endif // ROUNDUP_H diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/AACWriter.h b/external/android/include/18/frameworks/av/include/media/stagefright/AACWriter.h deleted file mode 100644 index df1b053..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/AACWriter.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2011 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 AAC_WRITER_H_ -#define AAC_WRITER_H_ - -#include -#include - -namespace android { - -struct MediaSource; -struct MetaData; - -struct AACWriter : public MediaWriter { - AACWriter(const char *filename); - AACWriter(int fd); - - status_t initCheck() const; - - virtual status_t addSource(const sp &source); - virtual bool reachedEOS(); - virtual status_t start(MetaData *params = NULL); - virtual status_t stop() { return reset(); } - virtual status_t pause(); - -protected: - virtual ~AACWriter(); - -private: - enum { - kAdtsHeaderLength = 7, // # of bytes for the adts header - kSamplesPerFrame = 1024, // # of samples in a frame - }; - - int mFd; - status_t mInitCheck; - sp mSource; - bool mStarted; - volatile bool mPaused; - volatile bool mResumed; - volatile bool mDone; - volatile bool mReachedEOS; - pthread_t mThread; - int64_t mEstimatedSizeBytes; - int64_t mEstimatedDurationUs; - int32_t mChannelCount; - int32_t mSampleRate; - int32_t mAACProfile; - int32_t mFrameDurationUs; - - static void *ThreadWrapper(void *); - status_t threadFunc(); - bool exceedsFileSizeLimit(); - bool exceedsFileDurationLimit(); - status_t writeAdtsHeader(uint32_t frameLength); - status_t reset(); - - DISALLOW_EVIL_CONSTRUCTORS(AACWriter); -}; - -} // namespace android - -#endif // AAC_WRITER_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/ACodec.h b/external/android/include/18/frameworks/av/include/media/stagefright/ACodec.h deleted file mode 100644 index 34bae29..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/ACodec.h +++ /dev/null @@ -1,298 +0,0 @@ -/* - * Copyright (C) 2010 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 A_CODEC_H_ - -#define A_CODEC_H_ - -#include -#include -#include -#include -#include -#include - -#define TRACK_BUFFER_TIMING 0 - -namespace android { - -struct ABuffer; -struct MemoryDealer; - -struct ACodec : public AHierarchicalStateMachine { - enum { - kWhatFillThisBuffer = 'fill', - kWhatDrainThisBuffer = 'drai', - kWhatEOS = 'eos ', - kWhatShutdownCompleted = 'scom', - kWhatFlushCompleted = 'fcom', - kWhatOutputFormatChanged = 'outC', - kWhatError = 'erro', - kWhatComponentAllocated = 'cAll', - kWhatComponentConfigured = 'cCon', - kWhatInputSurfaceCreated = 'isfc', - kWhatSignaledInputEOS = 'seos', - kWhatBuffersAllocated = 'allc', - kWhatOMXDied = 'OMXd', - }; - - ACodec(); - - void setNotificationMessage(const sp &msg); - void initiateSetup(const sp &msg); - void signalFlush(); - void signalResume(); - void initiateShutdown(bool keepComponentAllocated = false); - - void signalSetParameters(const sp &msg); - void signalEndOfInputStream(); - - void initiateAllocateComponent(const sp &msg); - void initiateConfigureComponent(const sp &msg); - void initiateCreateInputSurface(); - void initiateStart(); - - void signalRequestIDRFrame(); - - struct PortDescription : public RefBase { - size_t countBuffers(); - IOMX::buffer_id bufferIDAt(size_t index) const; - sp bufferAt(size_t index) const; - - private: - friend struct ACodec; - - Vector mBufferIDs; - Vector > mBuffers; - - PortDescription(); - void addBuffer(IOMX::buffer_id id, const sp &buffer); - - DISALLOW_EVIL_CONSTRUCTORS(PortDescription); - }; - -protected: - virtual ~ACodec(); - -private: - struct BaseState; - struct UninitializedState; - struct LoadedState; - struct LoadedToIdleState; - struct IdleToExecutingState; - struct ExecutingState; - struct OutputPortSettingsChangedState; - struct ExecutingToIdleState; - struct IdleToLoadedState; - struct FlushingState; - struct DeathNotifier; - - enum { - kWhatSetup = 'setu', - kWhatOMXMessage = 'omx ', - kWhatInputBufferFilled = 'inpF', - kWhatOutputBufferDrained = 'outD', - kWhatShutdown = 'shut', - kWhatFlush = 'flus', - kWhatResume = 'resm', - kWhatDrainDeferredMessages = 'drai', - kWhatAllocateComponent = 'allo', - kWhatConfigureComponent = 'conf', - kWhatCreateInputSurface = 'cisf', - kWhatSignalEndOfInputStream = 'eois', - kWhatStart = 'star', - kWhatRequestIDRFrame = 'ridr', - kWhatSetParameters = 'setP', - }; - - enum { - kPortIndexInput = 0, - kPortIndexOutput = 1 - }; - - enum { - kFlagIsSecure = 1, - }; - - struct BufferInfo { - enum Status { - OWNED_BY_US, - OWNED_BY_COMPONENT, - OWNED_BY_UPSTREAM, - OWNED_BY_DOWNSTREAM, - OWNED_BY_NATIVE_WINDOW, - }; - - IOMX::buffer_id mBufferID; - Status mStatus; - - sp mData; - sp mGraphicBuffer; - }; - -#if TRACK_BUFFER_TIMING - struct BufferStats { - int64_t mEmptyBufferTimeUs; - int64_t mFillBufferDoneTimeUs; - }; - - KeyedVector mBufferStats; -#endif - - sp mNotify; - - sp mUninitializedState; - sp mLoadedState; - sp mLoadedToIdleState; - sp mIdleToExecutingState; - sp mExecutingState; - sp mOutputPortSettingsChangedState; - sp mExecutingToIdleState; - sp mIdleToLoadedState; - sp mFlushingState; - sp mSkipCutBuffer; - - AString mComponentName; - uint32_t mFlags; - uint32_t mQuirks; - sp mOMX; - IOMX::node_id mNode; - sp mDealer[2]; - - sp mNativeWindow; - - Vector mBuffers[2]; - bool mPortEOS[2]; - status_t mInputEOSResult; - - List > mDeferredQueue; - - bool mSentFormat; - bool mIsEncoder; - - bool mShutdownInProgress; - - // If "mKeepComponentAllocated" we only transition back to Loaded state - // and do not release the component instance. - bool mKeepComponentAllocated; - - int32_t mEncoderDelay; - int32_t mEncoderPadding; - - bool mChannelMaskPresent; - int32_t mChannelMask; - - status_t setCyclicIntraMacroblockRefresh(const sp &msg, int32_t mode); - status_t allocateBuffersOnPort(OMX_U32 portIndex); - status_t freeBuffersOnPort(OMX_U32 portIndex); - status_t freeBuffer(OMX_U32 portIndex, size_t i); - - status_t allocateOutputBuffersFromNativeWindow(); - status_t cancelBufferToNativeWindow(BufferInfo *info); - status_t freeOutputBuffersNotOwnedByComponent(); - BufferInfo *dequeueBufferFromNativeWindow(); - - BufferInfo *findBufferByID( - uint32_t portIndex, IOMX::buffer_id bufferID, - ssize_t *index = NULL); - - status_t setComponentRole(bool isEncoder, const char *mime); - status_t configureCodec(const char *mime, const sp &msg); - - status_t setVideoPortFormatType( - OMX_U32 portIndex, - OMX_VIDEO_CODINGTYPE compressionFormat, - OMX_COLOR_FORMATTYPE colorFormat); - - status_t setSupportedOutputFormat(); - - status_t setupVideoDecoder( - const char *mime, int32_t width, int32_t height); - - status_t setupVideoEncoder( - const char *mime, const sp &msg); - - status_t setVideoFormatOnPort( - OMX_U32 portIndex, - int32_t width, int32_t height, - OMX_VIDEO_CODINGTYPE compressionFormat); - - status_t setupAACCodec( - bool encoder, - int32_t numChannels, int32_t sampleRate, int32_t bitRate, - int32_t aacProfile, bool isADTS); - - status_t selectAudioPortFormat( - OMX_U32 portIndex, OMX_AUDIO_CODINGTYPE desiredFormat); - - status_t setupAMRCodec(bool encoder, bool isWAMR, int32_t bitRate); - status_t setupG711Codec(bool encoder, int32_t numChannels); - - status_t setupFlacCodec( - bool encoder, int32_t numChannels, int32_t sampleRate, int32_t compressionLevel); - - status_t setupRawAudioFormat( - OMX_U32 portIndex, int32_t sampleRate, int32_t numChannels); - - status_t setMinBufferSize(OMX_U32 portIndex, size_t size); - - status_t setupMPEG4EncoderParameters(const sp &msg); - status_t setupH263EncoderParameters(const sp &msg); - status_t setupAVCEncoderParameters(const sp &msg); - - status_t verifySupportForProfileAndLevel(int32_t profile, int32_t level); - - status_t configureBitrate( - int32_t bitrate, OMX_VIDEO_CONTROLRATETYPE bitrateMode); - - status_t setupErrorCorrectionParameters(); - - status_t initNativeWindow(); - - status_t pushBlankBuffersToNativeWindow(); - - // Returns true iff all buffers on the given port have status - // OWNED_BY_US or OWNED_BY_NATIVE_WINDOW. - bool allYourBuffersAreBelongToUs(OMX_U32 portIndex); - - bool allYourBuffersAreBelongToUs(); - - void waitUntilAllPossibleNativeWindowBuffersAreReturnedToUs(); - - size_t countBuffersOwnedByComponent(OMX_U32 portIndex) const; - size_t countBuffersOwnedByNativeWindow() const; - - void deferMessage(const sp &msg); - void processDeferredMessages(); - - void sendFormatChange(); - - void signalError( - OMX_ERRORTYPE error = OMX_ErrorUndefined, - status_t internalError = UNKNOWN_ERROR); - - status_t requestIDRFrame(); - status_t setParameters(const sp ¶ms); - - // Send EOS on input stream. - void onSignalEndOfInputStream(); - - DISALLOW_EVIL_CONSTRUCTORS(ACodec); -}; - -} // namespace android - -#endif // A_CODEC_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/AMRWriter.h b/external/android/include/18/frameworks/av/include/media/stagefright/AMRWriter.h deleted file mode 100644 index 392f968..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/AMRWriter.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2010 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 AMR_WRITER_H_ - -#define AMR_WRITER_H_ - -#include - -#include -#include - -namespace android { - -struct MediaSource; -struct MetaData; - -struct AMRWriter : public MediaWriter { - AMRWriter(const char *filename); - AMRWriter(int fd); - - status_t initCheck() const; - - virtual status_t addSource(const sp &source); - virtual bool reachedEOS(); - virtual status_t start(MetaData *params = NULL); - virtual status_t stop() { return reset(); } - virtual status_t pause(); - -protected: - virtual ~AMRWriter(); - -private: - int mFd; - status_t mInitCheck; - sp mSource; - bool mStarted; - volatile bool mPaused; - volatile bool mResumed; - volatile bool mDone; - volatile bool mReachedEOS; - pthread_t mThread; - int64_t mEstimatedSizeBytes; - int64_t mEstimatedDurationUs; - - static void *ThreadWrapper(void *); - status_t threadFunc(); - bool exceedsFileSizeLimit(); - bool exceedsFileDurationLimit(); - status_t reset(); - - AMRWriter(const AMRWriter &); - AMRWriter &operator=(const AMRWriter &); -}; - -} // namespace android - -#endif // AMR_WRITER_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/AudioPlayer.h b/external/android/include/18/frameworks/av/include/media/stagefright/AudioPlayer.h deleted file mode 100644 index 1dc408f..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/AudioPlayer.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * 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 AUDIO_PLAYER_H_ - -#define AUDIO_PLAYER_H_ - -#include -#include -#include -#include - -namespace android { - -class MediaSource; -class AudioTrack; -class AwesomePlayer; - -class AudioPlayer : public TimeSource { -public: - enum { - REACHED_EOS, - SEEK_COMPLETE - }; - - AudioPlayer(const sp &audioSink, - bool allowDeepBuffering = false, - AwesomePlayer *audioObserver = NULL); - - virtual ~AudioPlayer(); - - // Caller retains ownership of "source". - void setSource(const sp &source); - - // Return time in us. - virtual int64_t getRealTimeUs(); - - status_t start(bool sourceAlreadyStarted = false); - - void pause(bool playPendingSamples = false); - void resume(); - - // Returns the timestamp of the last buffer played (in us). - int64_t getMediaTimeUs(); - - // Returns true iff a mapping is established, i.e. the AudioPlayer - // has played at least one frame of audio. - bool getMediaTimeMapping(int64_t *realtime_us, int64_t *mediatime_us); - - status_t seekTo(int64_t time_us); - - bool isSeeking(); - bool reachedEOS(status_t *finalStatus); - - status_t setPlaybackRatePermille(int32_t ratePermille); - -private: - friend class VideoEditorAudioPlayer; - sp mSource; - AudioTrack *mAudioTrack; - - MediaBuffer *mInputBuffer; - - int mSampleRate; - int64_t mLatencyUs; - size_t mFrameSize; - - Mutex mLock; - int64_t mNumFramesPlayed; - int64_t mNumFramesPlayedSysTimeUs; - - int64_t mPositionTimeMediaUs; - int64_t mPositionTimeRealUs; - - bool mSeeking; - bool mReachedEOS; - status_t mFinalStatus; - int64_t mSeekTimeUs; - - bool mStarted; - - bool mIsFirstBuffer; - status_t mFirstBufferResult; - MediaBuffer *mFirstBuffer; - - sp mAudioSink; - bool mAllowDeepBuffering; // allow audio deep audio buffers. Helps with low power audio - // playback but implies high latency - AwesomePlayer *mObserver; - int64_t mPinnedTimeUs; - - static void AudioCallback(int event, void *user, void *info); - void AudioCallback(int event, void *info); - - static size_t AudioSinkCallback( - MediaPlayerBase::AudioSink *audioSink, - void *data, size_t size, void *me); - - size_t fillBuffer(void *data, size_t size); - - int64_t getRealTimeUsLocked() const; - - void reset(); - - uint32_t getNumFramesPendingPlayout() const; - - AudioPlayer(const AudioPlayer &); - AudioPlayer &operator=(const AudioPlayer &); -}; - -} // namespace android - -#endif // AUDIO_PLAYER_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/AudioSource.h b/external/android/include/18/frameworks/av/include/media/stagefright/AudioSource.h deleted file mode 100644 index 99f3c3b..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/AudioSource.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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 AUDIO_SOURCE_H_ - -#define AUDIO_SOURCE_H_ - -#include -#include -#include -#include -#include - -#include - -namespace android { - -class AudioRecord; - -struct AudioSource : public MediaSource, public MediaBufferObserver { - // Note that the "channels" parameter _is_ the number of channels, - // _not_ a bitmask of audio_channels_t constants. - AudioSource( - audio_source_t inputSource, - uint32_t sampleRate, - uint32_t channels = 1); - - status_t initCheck() const; - - virtual status_t start(MetaData *params = NULL); - virtual status_t stop() { return reset(); } - virtual sp getFormat(); - - // Returns the maximum amplitude since last call. - int16_t getMaxAmplitude(); - - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL); - - status_t dataCallback(const AudioRecord::Buffer& buffer); - virtual void signalBufferReturned(MediaBuffer *buffer); - -protected: - virtual ~AudioSource(); - -private: - enum { - kMaxBufferSize = 2048, - - // After the initial mute, we raise the volume linearly - // over kAutoRampDurationUs. - kAutoRampDurationUs = 300000, - - // This is the initial mute duration to suppress - // the video recording signal tone - kAutoRampStartUs = 0, - }; - - Mutex mLock; - Condition mFrameAvailableCondition; - Condition mFrameEncodingCompletionCondition; - - AudioRecord *mRecord; - status_t mInitCheck; - bool mStarted; - int32_t mSampleRate; - - bool mTrackMaxAmplitude; - int64_t mStartTimeUs; - int16_t mMaxAmplitude; - int64_t mPrevSampleTimeUs; - int64_t mInitialReadTimeUs; - int64_t mNumFramesReceived; - int64_t mNumClientOwnedBuffers; - - List mBuffersReceived; - - void trackMaxAmplitude(int16_t *data, int nSamples); - - // This is used to raise the volume from mute to the - // actual level linearly. - void rampVolume( - int32_t startFrame, int32_t rampDurationFrames, - uint8_t *data, size_t bytes); - - void queueInputBuffer_l(MediaBuffer *buffer, int64_t timeUs); - void releaseQueuedFrames_l(); - void waitOutstandingEncodingFrames_l(); - status_t reset(); - - AudioSource(const AudioSource &); - AudioSource &operator=(const AudioSource &); -}; - -} // namespace android - -#endif // AUDIO_SOURCE_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/BufferProducerWrapper.h b/external/android/include/18/frameworks/av/include/media/stagefright/BufferProducerWrapper.h deleted file mode 100644 index d8acf30..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/BufferProducerWrapper.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2013 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 BUFFER_PRODUCER_WRAPPER_H_ - -#define BUFFER_PRODUCER_WRAPPER_H_ - -#include - -namespace android { - -// Can't use static_cast to cast a RefBase back to an IGraphicBufferProducer, -// because IGBP's parent (IInterface) uses virtual inheritance. This class -// wraps IGBP while we pass it through AMessage. - -struct BufferProducerWrapper : RefBase { - BufferProducerWrapper( - const sp& bufferProducer) : - mBufferProducer(bufferProducer) { } - - sp getBufferProducer() const { - return mBufferProducer; - } - -private: - const sp mBufferProducer; - - DISALLOW_EVIL_CONSTRUCTORS(BufferProducerWrapper); -}; - -} // namespace android - -#endif // BUFFER_PRODUCER_WRAPPER_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/CameraSource.h b/external/android/include/18/frameworks/av/include/media/stagefright/CameraSource.h deleted file mode 100644 index a829916..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/CameraSource.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * 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 CAMERA_SOURCE_H_ - -#define CAMERA_SOURCE_H_ - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace android { - -class IMemory; -class Camera; -class Surface; - -class CameraSource : public MediaSource, public MediaBufferObserver { -public: - /** - * Factory method to create a new CameraSource using the current - * settings (such as video size, frame rate, color format, etc) - * from the default camera. - * - * @param clientName The package/process name of the client application. - * This is used for permissions checking. - * @return NULL on error. - */ - static CameraSource *Create(const String16 &clientName); - - /** - * Factory method to create a new CameraSource. - * - * @param camera the video input frame data source. If it is NULL, - * we will try to connect to the camera with the given - * cameraId. - * - * @param cameraId the id of the camera that the source will connect - * to if camera is NULL; otherwise ignored. - * @param clientName the package/process name of the camera-using - * application if camera is NULL; otherwise ignored. Used for - * permissions checking. - * @param clientUid the UID of the camera-using application if camera is - * NULL; otherwise ignored. Used for permissions checking. - * @param videoSize the dimension (in pixels) of the video frame - * @param frameRate the target frames per second - * @param surface the preview surface for display where preview - * frames are sent to - * @param storeMetaDataInVideoBuffers true to request the camera - * source to store meta data in video buffers; false to - * request the camera source to store real YUV frame data - * in the video buffers. The camera source may not support - * storing meta data in video buffers, if so, a request - * to do that will NOT be honored. To find out whether - * meta data is actually being stored in video buffers - * during recording, call isMetaDataStoredInVideoBuffers(). - * - * @return NULL on error. - */ - static CameraSource *CreateFromCamera(const sp &camera, - const sp &proxy, - int32_t cameraId, - const String16& clientName, - uid_t clientUid, - Size videoSize, - int32_t frameRate, - const sp& surface, - bool storeMetaDataInVideoBuffers = false); - - virtual ~CameraSource(); - - virtual status_t start(MetaData *params = NULL); - virtual status_t stop() { return reset(); } - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL); - - /** - * Check whether a CameraSource object is properly initialized. - * Must call this method before stop(). - * @return OK if initialization has successfully completed. - */ - virtual status_t initCheck() const; - - /** - * Returns the MetaData associated with the CameraSource, - * including: - * kKeyColorFormat: YUV color format of the video frames - * kKeyWidth, kKeyHeight: dimension (in pixels) of the video frames - * kKeySampleRate: frame rate in frames per second - * kKeyMIMEType: always fixed to be MEDIA_MIMETYPE_VIDEO_RAW - */ - virtual sp getFormat(); - - /** - * Tell whether this camera source stores meta data or real YUV - * frame data in video buffers. - * - * @return true if meta data is stored in the video - * buffers; false if real YUV data is stored in - * the video buffers. - */ - bool isMetaDataStoredInVideoBuffers() const; - - virtual void signalBufferReturned(MediaBuffer* buffer); - -protected: - class ProxyListener: public BnCameraRecordingProxyListener { - public: - ProxyListener(const sp& source); - virtual void dataCallbackTimestamp(int64_t timestampUs, int32_t msgType, - const sp &data); - - private: - sp mSource; - }; - - // isBinderAlive needs linkToDeath to work. - class DeathNotifier: public IBinder::DeathRecipient { - public: - DeathNotifier() {} - virtual void binderDied(const wp& who); - }; - - enum CameraFlags { - FLAGS_SET_CAMERA = 1L << 0, - FLAGS_HOT_CAMERA = 1L << 1, - }; - - int32_t mCameraFlags; - Size mVideoSize; - int32_t mNumInputBuffers; - int32_t mVideoFrameRate; - int32_t mColorFormat; - status_t mInitCheck; - - sp mCamera; - sp mCameraRecordingProxy; - sp mDeathNotifier; - sp mSurface; - sp mMeta; - - int64_t mStartTimeUs; - int32_t mNumFramesReceived; - int64_t mLastFrameTimestampUs; - bool mStarted; - int32_t mNumFramesEncoded; - - // Time between capture of two frames. - int64_t mTimeBetweenFrameCaptureUs; - - CameraSource(const sp& camera, const sp& proxy, - int32_t cameraId, const String16& clientName, uid_t clientUid, - Size videoSize, int32_t frameRate, - const sp& surface, - bool storeMetaDataInVideoBuffers); - - virtual void startCameraRecording(); - virtual void releaseRecordingFrame(const sp& frame); - - // Returns true if need to skip the current frame. - // Called from dataCallbackTimestamp. - virtual bool skipCurrentFrame(int64_t timestampUs) {return false;} - - // Callback called when still camera raw data is available. - virtual void dataCallback(int32_t msgType, const sp &data) {} - - virtual void dataCallbackTimestamp(int64_t timestampUs, int32_t msgType, - const sp &data); - -private: - friend class CameraSourceListener; - - Mutex mLock; - Condition mFrameAvailableCondition; - Condition mFrameCompleteCondition; - List > mFramesReceived; - List > mFramesBeingEncoded; - List mFrameTimes; - - int64_t mFirstFrameTimeUs; - int32_t mNumFramesDropped; - int32_t mNumGlitches; - int64_t mGlitchDurationThresholdUs; - bool mCollectStats; - bool mIsMetaDataStoredInVideoBuffers; - - void releaseQueuedFrames(); - void releaseOneRecordingFrame(const sp& frame); - - - status_t init(const sp& camera, const sp& proxy, - int32_t cameraId, const String16& clientName, uid_t clientUid, - Size videoSize, int32_t frameRate, bool storeMetaDataInVideoBuffers); - - status_t initWithCameraAccess( - const sp& camera, const sp& proxy, - int32_t cameraId, const String16& clientName, uid_t clientUid, - Size videoSize, int32_t frameRate, bool storeMetaDataInVideoBuffers); - - status_t isCameraAvailable(const sp& camera, - const sp& proxy, - int32_t cameraId, - const String16& clientName, - uid_t clientUid); - - status_t isCameraColorFormatSupported(const CameraParameters& params); - status_t configureCamera(CameraParameters* params, - int32_t width, int32_t height, - int32_t frameRate); - - status_t checkVideoSize(const CameraParameters& params, - int32_t width, int32_t height); - - status_t checkFrameRate(const CameraParameters& params, - int32_t frameRate); - - void stopCameraRecording(); - void releaseCamera(); - status_t reset(); - - CameraSource(const CameraSource &); - CameraSource &operator=(const CameraSource &); -}; - -} // namespace android - -#endif // CAMERA_SOURCE_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/CameraSourceTimeLapse.h b/external/android/include/18/frameworks/av/include/media/stagefright/CameraSourceTimeLapse.h deleted file mode 100644 index 6b7a63c..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/CameraSourceTimeLapse.h +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright (C) 2010 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 CAMERA_SOURCE_TIME_LAPSE_H_ - -#define CAMERA_SOURCE_TIME_LAPSE_H_ - -#include - -#include -#include -#include - -namespace android { - -class ICamera; -class IMemory; -class Camera; - -class CameraSourceTimeLapse : public CameraSource { -public: - static CameraSourceTimeLapse *CreateFromCamera( - const sp &camera, - const sp &proxy, - int32_t cameraId, - const String16& clientName, - uid_t clientUid, - Size videoSize, - int32_t videoFrameRate, - const sp& surface, - int64_t timeBetweenTimeLapseFrameCaptureUs); - - virtual ~CameraSourceTimeLapse(); - - // If the frame capture interval is large, read will block for a long time. - // Due to the way the mediaRecorder framework works, a stop() call from - // mediaRecorder waits until the read returns, causing a long wait for - // stop() to return. To avoid this, we can make read() return a copy of the - // last read frame with the same time stamp frequently. This keeps the - // read() call from blocking too long. Calling this function quickly - // captures another frame, keeps its copy, and enables this mode of read() - // returning quickly. - void startQuickReadReturns(); - -private: - // size of the encoded video. - int32_t mVideoWidth; - int32_t mVideoHeight; - - // Time between two frames in final video (1/frameRate) - int64_t mTimeBetweenTimeLapseVideoFramesUs; - - // Real timestamp of the last encoded time lapse frame - int64_t mLastTimeLapseFrameRealTimestampUs; - - // Variable set in dataCallbackTimestamp() to help skipCurrentFrame() - // to know if current frame needs to be skipped. - bool mSkipCurrentFrame; - - // Lock for accessing mCameraIdle - Mutex mCameraIdleLock; - - // Condition variable to wait on if camera is is not yet idle. Once the - // camera gets idle, this variable will be signalled. - Condition mCameraIdleCondition; - - // True if camera is in preview mode and ready for takePicture(). - // False after a call to takePicture() but before the final compressed - // data callback has been called and preview has been restarted. - volatile bool mCameraIdle; - - // True if stop() is waiting for camera to get idle, i.e. for the last - // takePicture() to complete. This is needed so that dataCallbackTimestamp() - // can return immediately. - volatile bool mStopWaitingForIdleCamera; - - // Lock for accessing quick stop variables. - Mutex mQuickStopLock; - - // mQuickStop is set to true if we use quick read() returns, otherwise it is set - // to false. Once in this mode read() return a copy of the last read frame - // with the same time stamp. See startQuickReadReturns(). - volatile bool mQuickStop; - - // Forces the next frame passed to dataCallbackTimestamp() to be read - // as a time lapse frame. Used by startQuickReadReturns() so that the next - // frame wakes up any blocking read. - volatile bool mForceRead; - - // Stores a copy of the MediaBuffer read in the last read() call after - // mQuickStop was true. - MediaBuffer* mLastReadBufferCopy; - - // Status code for last read. - status_t mLastReadStatus; - - CameraSourceTimeLapse( - const sp &camera, - const sp &proxy, - int32_t cameraId, - const String16& clientName, - uid_t clientUid, - Size videoSize, - int32_t videoFrameRate, - const sp& surface, - int64_t timeBetweenTimeLapseFrameCaptureUs); - - // Wrapper over CameraSource::signalBufferReturned() to implement quick stop. - // It only handles the case when mLastReadBufferCopy is signalled. Otherwise - // it calls the base class' function. - virtual void signalBufferReturned(MediaBuffer* buffer); - - // Wrapper over CameraSource::read() to implement quick stop. - virtual status_t read(MediaBuffer **buffer, const ReadOptions *options = NULL); - - // mSkipCurrentFrame is set to true in dataCallbackTimestamp() if the current - // frame needs to be skipped and this function just returns the value of mSkipCurrentFrame. - virtual bool skipCurrentFrame(int64_t timestampUs); - - // In the video camera case calls skipFrameAndModifyTimeStamp() to modify - // timestamp and set mSkipCurrentFrame. - // Then it calls the base CameraSource::dataCallbackTimestamp() - virtual void dataCallbackTimestamp(int64_t timestampUs, int32_t msgType, - const sp &data); - - // Convenience function to fill mLastReadBufferCopy from the just read - // buffer. - void fillLastReadBufferCopy(MediaBuffer& sourceBuffer); - - // If the passed in size (width x height) is a supported video/preview size, - // the function sets the camera's video/preview size to it and returns true. - // Otherwise returns false. - bool trySettingVideoSize(int32_t width, int32_t height); - - // When video camera is used for time lapse capture, returns true - // until enough time has passed for the next time lapse frame. When - // the frame needs to be encoded, it returns false and also modifies - // the time stamp to be one frame time ahead of the last encoded - // frame's time stamp. - bool skipFrameAndModifyTimeStamp(int64_t *timestampUs); - - // Wrapper to enter threadTimeLapseEntry() - static void *ThreadTimeLapseWrapper(void *me); - - // Creates a copy of source_data into a new memory of final type MemoryBase. - sp createIMemoryCopy(const sp &source_data); - - CameraSourceTimeLapse(const CameraSourceTimeLapse &); - CameraSourceTimeLapse &operator=(const CameraSourceTimeLapse &); -}; - -} // namespace android - -#endif // CAMERA_SOURCE_TIME_LAPSE_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/ColorConverter.h b/external/android/include/18/frameworks/av/include/media/stagefright/ColorConverter.h deleted file mode 100644 index 85ba920..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/ColorConverter.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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 COLOR_CONVERTER_H_ - -#define COLOR_CONVERTER_H_ - -#include - -#include -#include - -#include - -namespace android { - -struct ColorConverter { - ColorConverter(OMX_COLOR_FORMATTYPE from, OMX_COLOR_FORMATTYPE to); - ~ColorConverter(); - - bool isValid() const; - - status_t convert( - const void *srcBits, - size_t srcWidth, size_t srcHeight, - size_t srcCropLeft, size_t srcCropTop, - size_t srcCropRight, size_t srcCropBottom, - void *dstBits, - size_t dstWidth, size_t dstHeight, - size_t dstCropLeft, size_t dstCropTop, - size_t dstCropRight, size_t dstCropBottom); - -private: - struct BitmapParams { - BitmapParams( - void *bits, - size_t width, size_t height, - size_t cropLeft, size_t cropTop, - size_t cropRight, size_t cropBottom); - - size_t cropWidth() const; - size_t cropHeight() const; - - void *mBits; - size_t mWidth, mHeight; - size_t mCropLeft, mCropTop, mCropRight, mCropBottom; - }; - - OMX_COLOR_FORMATTYPE mSrcFormat, mDstFormat; - uint8_t *mClip; - - uint8_t *initClip(); - - status_t convertCbYCrY( - const BitmapParams &src, const BitmapParams &dst); - - status_t convertYUV420Planar( - const BitmapParams &src, const BitmapParams &dst); - - status_t convertQCOMYUV420SemiPlanar( - const BitmapParams &src, const BitmapParams &dst); - - status_t convertYUV420SemiPlanar( - const BitmapParams &src, const BitmapParams &dst); - - status_t convertTIYUV420PackedSemiPlanar( - const BitmapParams &src, const BitmapParams &dst); - - ColorConverter(const ColorConverter &); - ColorConverter &operator=(const ColorConverter &); -}; - -} // namespace android - -#endif // COLOR_CONVERTER_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/DataSource.h b/external/android/include/18/frameworks/av/include/media/stagefright/DataSource.h deleted file mode 100644 index 742bc0e..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/DataSource.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * 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 DATA_SOURCE_H_ - -#define DATA_SOURCE_H_ - -#include - -#include -#include -#include -#include -#include -#include -#include - -namespace android { - -struct AMessage; -class String8; - -class DataSource : public RefBase { -public: - enum Flags { - kWantsPrefetching = 1, - kStreamedFromLocalHost = 2, - kIsCachingDataSource = 4, - kIsHTTPBasedSource = 8, - }; - - static sp CreateFromURI( - const char *uri, - const KeyedVector *headers = NULL); - - DataSource() {} - - virtual status_t initCheck() const = 0; - - virtual ssize_t readAt(off64_t offset, void *data, size_t size) = 0; - - // Convenience methods: - bool getUInt16(off64_t offset, uint16_t *x); - bool getUInt24(off64_t offset, uint32_t *x); // 3 byte int, returned as a 32-bit int - bool getUInt32(off64_t offset, uint32_t *x); - bool getUInt64(off64_t offset, uint64_t *x); - - // May return ERROR_UNSUPPORTED. - virtual status_t getSize(off64_t *size); - - virtual uint32_t flags() { - return 0; - } - - virtual status_t reconnectAtOffset(off64_t offset) { - return ERROR_UNSUPPORTED; - } - - //////////////////////////////////////////////////////////////////////////// - - bool sniff(String8 *mimeType, float *confidence, sp *meta); - - // The sniffer can optionally fill in "meta" with an AMessage containing - // a dictionary of values that helps the corresponding extractor initialize - // its state without duplicating effort already exerted by the sniffer. - typedef bool (*SnifferFunc)( - const sp &source, String8 *mimeType, - float *confidence, sp *meta); - - static void RegisterSniffer(SnifferFunc func); - static void RegisterDefaultSniffers(); - - // for DRM - virtual sp DrmInitialization(const char *mime = NULL) { - return NULL; - } - virtual void getDrmInfo(sp &handle, DrmManagerClient **client) {}; - - virtual String8 getUri() { - return String8(); - } - - virtual String8 getMIMEType() const; - -protected: - virtual ~DataSource() {} - -private: - static Mutex gSnifferMutex; - static List gSniffers; - - DataSource(const DataSource &); - DataSource &operator=(const DataSource &); -}; - -} // namespace android - -#endif // DATA_SOURCE_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/FileSource.h b/external/android/include/18/frameworks/av/include/media/stagefright/FileSource.h deleted file mode 100644 index d994cb3..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/FileSource.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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 FILE_SOURCE_H_ - -#define FILE_SOURCE_H_ - -#include - -#include -#include -#include -#include - -namespace android { - -class FileSource : public DataSource { -public: - FileSource(const char *filename); - FileSource(int fd, int64_t offset, int64_t length); - - virtual status_t initCheck() const; - - virtual ssize_t readAt(off64_t offset, void *data, size_t size); - - virtual status_t getSize(off64_t *size); - - virtual sp DrmInitialization(const char *mime); - - virtual void getDrmInfo(sp &handle, DrmManagerClient **client); - -protected: - virtual ~FileSource(); - -private: - int mFd; - int64_t mOffset; - int64_t mLength; - Mutex mLock; - - /*for DRM*/ - sp mDecryptHandle; - DrmManagerClient *mDrmManagerClient; - int64_t mDrmBufOffset; - int64_t mDrmBufSize; - unsigned char *mDrmBuf; - - ssize_t readAtDRM(off64_t offset, void *data, size_t size); - - FileSource(const FileSource &); - FileSource &operator=(const FileSource &); -}; - -} // namespace android - -#endif // FILE_SOURCE_H_ - diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/JPEGSource.h b/external/android/include/18/frameworks/av/include/media/stagefright/JPEGSource.h deleted file mode 100644 index 1b7e91b..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/JPEGSource.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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 JPEG_SOURCE_H_ - -#define JPEG_SOURCE_H_ - -#include - -namespace android { - -class DataSource; -class MediaBufferGroup; - -struct JPEGSource : public MediaSource { - JPEGSource(const sp &source); - - virtual status_t start(MetaData *params = NULL); - virtual status_t stop(); - virtual sp getFormat(); - - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL); - -protected: - virtual ~JPEGSource(); - -private: - sp mSource; - MediaBufferGroup *mGroup; - bool mStarted; - off64_t mSize; - int32_t mWidth, mHeight; - off64_t mOffset; - - status_t parseJPEG(); - - JPEGSource(const JPEGSource &); - JPEGSource &operator=(const JPEGSource &); -}; - -} // namespace android - -#endif // JPEG_SOURCE_H_ - diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/MPEG2TSWriter.h b/external/android/include/18/frameworks/av/include/media/stagefright/MPEG2TSWriter.h deleted file mode 100644 index 2e2922e..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/MPEG2TSWriter.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2010 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 MPEG2TS_WRITER_H_ - -#define MPEG2TS_WRITER_H_ - -#include -#include -#include -#include - -namespace android { - -struct ABuffer; - -struct MPEG2TSWriter : public MediaWriter { - MPEG2TSWriter(int fd); - MPEG2TSWriter(const char *filename); - - MPEG2TSWriter( - void *cookie, - ssize_t (*write)(void *cookie, const void *data, size_t size)); - - virtual status_t addSource(const sp &source); - virtual status_t start(MetaData *param = NULL); - virtual status_t stop() { return reset(); } - virtual status_t pause(); - virtual bool reachedEOS(); - virtual status_t dump(int fd, const Vector& args); - - void onMessageReceived(const sp &msg); - -protected: - virtual ~MPEG2TSWriter(); - -private: - enum { - kWhatSourceNotify = 'noti' - }; - - struct SourceInfo; - - FILE *mFile; - - void *mWriteCookie; - ssize_t (*mWriteFunc)(void *cookie, const void *data, size_t size); - - sp mLooper; - sp > mReflector; - - bool mStarted; - - Vector > mSources; - size_t mNumSourcesDone; - - int64_t mNumTSPacketsWritten; - int64_t mNumTSPacketsBeforeMeta; - int mPATContinuityCounter; - int mPMTContinuityCounter; - uint32_t mCrcTable[256]; - - void init(); - - void writeTS(); - void writeProgramAssociationTable(); - void writeProgramMap(); - void writeAccessUnit(int32_t sourceIndex, const sp &buffer); - void initCrcTable(); - uint32_t crc32(const uint8_t *start, size_t length); - - ssize_t internalWrite(const void *data, size_t size); - status_t reset(); - - DISALLOW_EVIL_CONSTRUCTORS(MPEG2TSWriter); -}; - -} // namespace android - -#endif // MPEG2TS_WRITER_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/MPEG4Writer.h b/external/android/include/18/frameworks/av/include/media/stagefright/MPEG4Writer.h deleted file mode 100644 index 3ef6b9a..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/MPEG4Writer.h +++ /dev/null @@ -1,211 +0,0 @@ -/* - * 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 MPEG4_WRITER_H_ - -#define MPEG4_WRITER_H_ - -#include - -#include -#include -#include - -namespace android { - -class MediaBuffer; -class MediaSource; -class MetaData; - -class MPEG4Writer : public MediaWriter { -public: - MPEG4Writer(const char *filename); - MPEG4Writer(int fd); - - // Limitations - // 1. No more than 2 tracks can be added - // 2. Only video or audio source can be added - // 3. No more than one video and/or one audio source can be added. - virtual status_t addSource(const sp &source); - - // Returns INVALID_OPERATION if there is no source or track. - virtual status_t start(MetaData *param = NULL); - virtual status_t stop() { return reset(); } - virtual status_t pause(); - virtual bool reachedEOS(); - virtual status_t dump(int fd, const Vector& args); - - void beginBox(const char *fourcc); - void writeInt8(int8_t x); - void writeInt16(int16_t x); - void writeInt32(int32_t x); - void writeInt64(int64_t x); - void writeCString(const char *s); - void writeFourcc(const char *fourcc); - void write(const void *data, size_t size); - inline size_t write(const void *ptr, size_t size, size_t nmemb); - void endBox(); - uint32_t interleaveDuration() const { return mInterleaveDurationUs; } - status_t setInterleaveDuration(uint32_t duration); - int32_t getTimeScale() const { return mTimeScale; } - - status_t setGeoData(int latitudex10000, int longitudex10000); - void setStartTimeOffsetMs(int ms) { mStartTimeOffsetMs = ms; } - int32_t getStartTimeOffsetMs() const { return mStartTimeOffsetMs; } - -protected: - virtual ~MPEG4Writer(); - -private: - class Track; - - int mFd; - status_t mInitCheck; - bool mIsRealTimeRecording; - bool mUse4ByteNalLength; - bool mUse32BitOffset; - bool mIsFileSizeLimitExplicitlyRequested; - bool mPaused; - bool mStarted; // Writer thread + track threads started successfully - bool mWriterThreadStarted; // Only writer thread started successfully - off64_t mOffset; - off_t mMdatOffset; - uint8_t *mMoovBoxBuffer; - off64_t mMoovBoxBufferOffset; - bool mWriteMoovBoxToMemory; - off64_t mFreeBoxOffset; - bool mStreamableFile; - off64_t mEstimatedMoovBoxSize; - uint32_t mInterleaveDurationUs; - int32_t mTimeScale; - int64_t mStartTimestampUs; - int mLatitudex10000; - int mLongitudex10000; - bool mAreGeoTagsAvailable; - int32_t mStartTimeOffsetMs; - - Mutex mLock; - - List mTracks; - - List mBoxes; - - void setStartTimestampUs(int64_t timeUs); - int64_t getStartTimestampUs(); // Not const - status_t startTracks(MetaData *params); - size_t numTracks(); - int64_t estimateMoovBoxSize(int32_t bitRate); - - struct Chunk { - Track *mTrack; // Owner - int64_t mTimeStampUs; // Timestamp of the 1st sample - List mSamples; // Sample data - - // Convenient constructor - Chunk(): mTrack(NULL), mTimeStampUs(0) {} - - Chunk(Track *track, int64_t timeUs, List samples) - : mTrack(track), mTimeStampUs(timeUs), mSamples(samples) { - } - - }; - struct ChunkInfo { - Track *mTrack; // Owner - List mChunks; // Remaining chunks to be written - - // Previous chunk timestamp that has been written - int64_t mPrevChunkTimestampUs; - - // Max time interval between neighboring chunks - int64_t mMaxInterChunkDurUs; - - }; - - bool mIsFirstChunk; - volatile bool mDone; // Writer thread is done? - pthread_t mThread; // Thread id for the writer - List mChunkInfos; // Chunk infos - Condition mChunkReadyCondition; // Signal that chunks are available - - // Writer thread handling - status_t startWriterThread(); - void stopWriterThread(); - static void *ThreadWrapper(void *me); - void threadFunc(); - - // Buffer a single chunk to be written out later. - void bufferChunk(const Chunk& chunk); - - // Write all buffered chunks from all tracks - void writeAllChunks(); - - // Retrieve the proper chunk to write if there is one - // Return true if a chunk is found; otherwise, return false. - bool findChunkToWrite(Chunk *chunk); - - // Actually write the given chunk to the file. - void writeChunkToFile(Chunk* chunk); - - // Adjust other track media clock (presumably wall clock) - // based on audio track media clock with the drift time. - int64_t mDriftTimeUs; - void setDriftTimeUs(int64_t driftTimeUs); - int64_t getDriftTimeUs(); - - // Return whether the nal length is 4 bytes or 2 bytes - // Only makes sense for H.264/AVC - bool useNalLengthFour(); - - // Return whether the writer is used for real time recording. - // In real time recording mode, new samples will be allowed to buffered into - // chunks in higher priority thread, even though the file writer has not - // drained the chunks yet. - // By default, real time recording is on. - bool isRealTimeRecording() const; - - void lock(); - void unlock(); - - // Acquire lock before calling these methods - off64_t addSample_l(MediaBuffer *buffer); - off64_t addLengthPrefixedSample_l(MediaBuffer *buffer); - - bool exceedsFileSizeLimit(); - bool use32BitFileOffset() const; - bool exceedsFileDurationLimit(); - bool isFileStreamable() const; - void trackProgressStatus(size_t trackId, int64_t timeUs, status_t err = OK); - void writeCompositionMatrix(int32_t degrees); - void writeMvhdBox(int64_t durationUs); - void writeMoovBox(int64_t durationUs); - void writeFtypBox(MetaData *param); - void writeUdtaBox(); - void writeGeoDataBox(); - void writeLatitude(int degreex10000); - void writeLongitude(int degreex10000); - void sendSessionSummary(); - void release(); - status_t reset(); - - static uint32_t getMpeg4Time(); - - MPEG4Writer(const MPEG4Writer &); - MPEG4Writer &operator=(const MPEG4Writer &); -}; - -} // namespace android - -#endif // MPEG4_WRITER_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/MediaAdapter.h b/external/android/include/18/frameworks/av/include/media/stagefright/MediaAdapter.h deleted file mode 100644 index 369fce6..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/MediaAdapter.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2013 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 MEDIA_ADAPTER_H -#define MEDIA_ADAPTER_H - -#include -#include -#include -#include -#include - -namespace android { - -// Convert the MediaMuxer's push model into MPEG4Writer's pull model. -// Used only by the MediaMuxer for now. -struct MediaAdapter : public MediaSource, public MediaBufferObserver { -public: - // MetaData is used to set the format and returned at getFormat. - MediaAdapter(const sp &meta); - virtual ~MediaAdapter(); - ///////////////////////////////////////////////// - // Inherited functions from MediaSource - ///////////////////////////////////////////////// - - virtual status_t start(MetaData *params = NULL); - virtual status_t stop(); - virtual sp getFormat(); - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL); - - ///////////////////////////////////////////////// - // Inherited functions from MediaBufferObserver - ///////////////////////////////////////////////// - - virtual void signalBufferReturned(MediaBuffer *buffer); - - ///////////////////////////////////////////////// - // Non-inherited functions: - ///////////////////////////////////////////////// - - // pushBuffer() will wait for the read() finish, and read() will have a - // deep copy, such that after pushBuffer return, the buffer can be re-used. - status_t pushBuffer(MediaBuffer *buffer); - -private: - Mutex mAdapterLock; - // Make sure the read() wait for the incoming buffer. - Condition mBufferReadCond; - // Make sure the pushBuffer() wait for the current buffer consumed. - Condition mBufferReturnedCond; - - MediaBuffer *mCurrentMediaBuffer; - - bool mStarted; - sp mOutputFormat; - - DISALLOW_EVIL_CONSTRUCTORS(MediaAdapter); -}; - -} // namespace android - -#endif // MEDIA_ADAPTER_H diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/MediaBuffer.h b/external/android/include/18/frameworks/av/include/media/stagefright/MediaBuffer.h deleted file mode 100644 index 3d79596..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/MediaBuffer.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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 MEDIA_BUFFER_H_ - -#define MEDIA_BUFFER_H_ - -#include - -#include -#include - -namespace android { - -struct ABuffer; -class GraphicBuffer; -class MediaBuffer; -class MediaBufferObserver; -class MetaData; - -class MediaBufferObserver { -public: - MediaBufferObserver() {} - virtual ~MediaBufferObserver() {} - - virtual void signalBufferReturned(MediaBuffer *buffer) = 0; - -private: - MediaBufferObserver(const MediaBufferObserver &); - MediaBufferObserver &operator=(const MediaBufferObserver &); -}; - -class MediaBuffer { -public: - // The underlying data remains the responsibility of the caller! - MediaBuffer(void *data, size_t size); - - MediaBuffer(size_t size); - - MediaBuffer(const sp& graphicBuffer); - - MediaBuffer(const sp &buffer); - - // Decrements the reference count and returns the buffer to its - // associated MediaBufferGroup if the reference count drops to 0. - void release(); - - // Increments the reference count. - void add_ref(); - - void *data() const; - size_t size() const; - - size_t range_offset() const; - size_t range_length() const; - - void set_range(size_t offset, size_t length); - - sp graphicBuffer() const; - - sp meta_data(); - - // Clears meta data and resets the range to the full extent. - void reset(); - - void setObserver(MediaBufferObserver *group); - - // Returns a clone of this MediaBuffer increasing its reference count. - // The clone references the same data but has its own range and - // MetaData. - MediaBuffer *clone(); - - int refcount() const; - -protected: - virtual ~MediaBuffer(); - -private: - friend class MediaBufferGroup; - friend class OMXDecoder; - - // For use by OMXDecoder, reference count must be 1, drop reference - // count to 0 without signalling the observer. - void claim(); - - MediaBufferObserver *mObserver; - MediaBuffer *mNextBuffer; - int mRefCount; - - void *mData; - size_t mSize, mRangeOffset, mRangeLength; - sp mGraphicBuffer; - sp mBuffer; - - bool mOwnsData; - - sp mMetaData; - - MediaBuffer *mOriginal; - - void setNextBuffer(MediaBuffer *buffer); - MediaBuffer *nextBuffer(); - - MediaBuffer(const MediaBuffer &); - MediaBuffer &operator=(const MediaBuffer &); -}; - -} // namespace android - -#endif // MEDIA_BUFFER_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/MediaBufferGroup.h b/external/android/include/18/frameworks/av/include/media/stagefright/MediaBufferGroup.h deleted file mode 100644 index 0488292..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/MediaBufferGroup.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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 MEDIA_BUFFER_GROUP_H_ - -#define MEDIA_BUFFER_GROUP_H_ - -#include -#include -#include - -namespace android { - -class MediaBuffer; -class MetaData; - -class MediaBufferGroup : public MediaBufferObserver { -public: - MediaBufferGroup(); - ~MediaBufferGroup(); - - void add_buffer(MediaBuffer *buffer); - - // Blocks until a buffer is available and returns it to the caller, - // the returned buffer will have a reference count of 1. - status_t acquire_buffer(MediaBuffer **buffer); - -protected: - virtual void signalBufferReturned(MediaBuffer *buffer); - -private: - friend class MediaBuffer; - - Mutex mLock; - Condition mCondition; - - MediaBuffer *mFirstBuffer, *mLastBuffer; - - MediaBufferGroup(const MediaBufferGroup &); - MediaBufferGroup &operator=(const MediaBufferGroup &); -}; - -} // namespace android - -#endif // MEDIA_BUFFER_GROUP_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/MediaCodec.h b/external/android/include/18/frameworks/av/include/media/stagefright/MediaCodec.h deleted file mode 100644 index 76aa503..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/MediaCodec.h +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Copyright 2012, 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 MEDIA_CODEC_H_ - -#define MEDIA_CODEC_H_ - -#include -#include -#include -#include - -namespace android { - -struct ABuffer; -struct ACodec; -struct AMessage; -struct AString; -struct ICrypto; -struct SoftwareRenderer; -struct Surface; - -struct MediaCodec : public AHandler { - enum ConfigureFlags { - CONFIGURE_FLAG_ENCODE = 1, - }; - - enum BufferFlags { - BUFFER_FLAG_SYNCFRAME = 1, - BUFFER_FLAG_CODECCONFIG = 2, - BUFFER_FLAG_EOS = 4, - }; - - static sp CreateByType( - const sp &looper, const char *mime, bool encoder); - - static sp CreateByComponentName( - const sp &looper, const char *name); - - status_t configure( - const sp &format, - const sp &nativeWindow, - const sp &crypto, - uint32_t flags); - - status_t createInputSurface(sp* bufferProducer); - - status_t start(); - - // Returns to a state in which the component remains allocated but - // unconfigured. - status_t stop(); - - // Client MUST call release before releasing final reference to this - // object. - status_t release(); - - status_t flush(); - - status_t queueInputBuffer( - size_t index, - size_t offset, - size_t size, - int64_t presentationTimeUs, - uint32_t flags, - AString *errorDetailMsg = NULL); - - status_t queueSecureInputBuffer( - size_t index, - size_t offset, - const CryptoPlugin::SubSample *subSamples, - size_t numSubSamples, - const uint8_t key[16], - const uint8_t iv[16], - CryptoPlugin::Mode mode, - int64_t presentationTimeUs, - uint32_t flags, - AString *errorDetailMsg = NULL); - - status_t dequeueInputBuffer(size_t *index, int64_t timeoutUs = 0ll); - - status_t dequeueOutputBuffer( - size_t *index, - size_t *offset, - size_t *size, - int64_t *presentationTimeUs, - uint32_t *flags, - int64_t timeoutUs = 0ll); - - status_t renderOutputBufferAndRelease(size_t index); - status_t releaseOutputBuffer(size_t index); - - status_t signalEndOfInputStream(); - - status_t getOutputFormat(sp *format) const; - - status_t getInputBuffers(Vector > *buffers) const; - status_t getOutputBuffers(Vector > *buffers) const; - - status_t requestIDRFrame(); - - // Notification will be posted once there "is something to do", i.e. - // an input/output buffer has become available, a format change is - // pending, an error is pending. - void requestActivityNotification(const sp ¬ify); - - status_t getName(AString *componentName) const; - - status_t setParameters(const sp ¶ms); - -protected: - virtual ~MediaCodec(); - virtual void onMessageReceived(const sp &msg); - -private: - enum State { - UNINITIALIZED, - INITIALIZING, - INITIALIZED, - CONFIGURING, - CONFIGURED, - STARTING, - STARTED, - FLUSHING, - STOPPING, - RELEASING, - }; - - enum { - kPortIndexInput = 0, - kPortIndexOutput = 1, - }; - - enum { - kWhatInit = 'init', - kWhatConfigure = 'conf', - kWhatCreateInputSurface = 'cisf', - kWhatStart = 'strt', - kWhatStop = 'stop', - kWhatRelease = 'rele', - kWhatDequeueInputBuffer = 'deqI', - kWhatQueueInputBuffer = 'queI', - kWhatDequeueOutputBuffer = 'deqO', - kWhatReleaseOutputBuffer = 'relO', - kWhatSignalEndOfInputStream = 'eois', - kWhatGetBuffers = 'getB', - kWhatFlush = 'flus', - kWhatGetOutputFormat = 'getO', - kWhatDequeueInputTimedOut = 'dITO', - kWhatDequeueOutputTimedOut = 'dOTO', - kWhatCodecNotify = 'codc', - kWhatRequestIDRFrame = 'ridr', - kWhatRequestActivityNotification = 'racN', - kWhatGetName = 'getN', - kWhatSetParameters = 'setP', - }; - - enum { - kFlagIsSoftwareCodec = 1, - kFlagOutputFormatChanged = 2, - kFlagOutputBuffersChanged = 4, - kFlagStickyError = 8, - kFlagDequeueInputPending = 16, - kFlagDequeueOutputPending = 32, - kFlagIsSecure = 64, - kFlagSawMediaServerDie = 128, - kFlagIsEncoder = 256, - kFlagGatherCodecSpecificData = 512, - }; - - struct BufferInfo { - void *mBufferID; - sp mData; - sp mEncryptedData; - sp mNotify; - bool mOwnedByClient; - }; - - State mState; - sp mLooper; - sp mCodecLooper; - sp mCodec; - AString mComponentName; - uint32_t mReplyID; - uint32_t mFlags; - sp mNativeWindow; - SoftwareRenderer *mSoftRenderer; - sp mOutputFormat; - - List mAvailPortBuffers[2]; - Vector mPortBuffers[2]; - - int32_t mDequeueInputTimeoutGeneration; - uint32_t mDequeueInputReplyID; - - int32_t mDequeueOutputTimeoutGeneration; - uint32_t mDequeueOutputReplyID; - - sp mCrypto; - - List > mCSD; - - sp mActivityNotify; - - bool mHaveInputSurface; - - MediaCodec(const sp &looper); - - static status_t PostAndAwaitResponse( - const sp &msg, sp *response); - - status_t init(const char *name, bool nameIsType, bool encoder); - - void setState(State newState); - void returnBuffersToCodec(); - void returnBuffersToCodecOnPort(int32_t portIndex); - size_t updateBuffers(int32_t portIndex, const sp &msg); - status_t onQueueInputBuffer(const sp &msg); - status_t onReleaseOutputBuffer(const sp &msg); - ssize_t dequeuePortBuffer(int32_t portIndex); - - bool handleDequeueInputBuffer(uint32_t replyID, bool newRequest = false); - bool handleDequeueOutputBuffer(uint32_t replyID, bool newRequest = false); - void cancelPendingDequeueOperations(); - - void extractCSD(const sp &format); - status_t queueCSDInputBuffer(size_t bufferIndex); - - status_t setNativeWindow( - const sp &surface); - - void postActivityNotificationIfPossible(); - - status_t onSetParameters(const sp ¶ms); - - status_t amendOutputFormatWithCodecSpecificData(const sp &buffer); - - DISALLOW_EVIL_CONSTRUCTORS(MediaCodec); -}; - -} // namespace android - -#endif // MEDIA_CODEC_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/MediaCodecList.h b/external/android/include/18/frameworks/av/include/media/stagefright/MediaCodecList.h deleted file mode 100644 index dfb845b..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/MediaCodecList.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2012, 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 MEDIA_CODEC_LIST_H_ - -#define MEDIA_CODEC_LIST_H_ - -#include -#include - -#include -#include -#include -#include - -namespace android { - -struct MediaCodecList { - static const MediaCodecList *getInstance(); - - ssize_t findCodecByType( - const char *type, bool encoder, size_t startIndex = 0) const; - - ssize_t findCodecByName(const char *name) const; - - size_t countCodecs() const; - const char *getCodecName(size_t index) const; - bool isEncoder(size_t index) const; - bool codecHasQuirk(size_t index, const char *quirkName) const; - - status_t getSupportedTypes(size_t index, Vector *types) const; - - struct ProfileLevel { - uint32_t mProfile; - uint32_t mLevel; - }; - status_t getCodecCapabilities( - size_t index, const char *type, - Vector *profileLevels, - Vector *colorFormats) const; - -private: - enum Section { - SECTION_TOPLEVEL, - SECTION_DECODERS, - SECTION_DECODER, - SECTION_ENCODERS, - SECTION_ENCODER, - }; - - struct CodecInfo { - AString mName; - bool mIsEncoder; - uint32_t mTypes; - uint32_t mQuirks; - }; - - static MediaCodecList *sCodecList; - - status_t mInitCheck; - Section mCurrentSection; - int32_t mDepth; - - Vector mCodecInfos; - KeyedVector mCodecQuirks; - KeyedVector mTypes; - - MediaCodecList(); - ~MediaCodecList(); - - status_t initCheck() const; - void parseXMLFile(FILE *file); - - static void StartElementHandlerWrapper( - void *me, const char *name, const char **attrs); - - static void EndElementHandlerWrapper(void *me, const char *name); - - void startElementHandler(const char *name, const char **attrs); - void endElementHandler(const char *name); - - status_t addMediaCodecFromAttributes(bool encoder, const char **attrs); - void addMediaCodec(bool encoder, const char *name, const char *type = NULL); - - status_t addQuirk(const char **attrs); - status_t addTypeFromAttributes(const char **attrs); - void addType(const char *name); - - DISALLOW_EVIL_CONSTRUCTORS(MediaCodecList); -}; - -} // namespace android - -#endif // MEDIA_CODEC_LIST_H_ - diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/MediaDefs.h b/external/android/include/18/frameworks/av/include/media/stagefright/MediaDefs.h deleted file mode 100644 index 81de6e4..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/MediaDefs.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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 MEDIA_DEFS_H_ - -#define MEDIA_DEFS_H_ - -namespace android { - -extern const char *MEDIA_MIMETYPE_IMAGE_JPEG; - -extern const char *MEDIA_MIMETYPE_VIDEO_VPX; -extern const char *MEDIA_MIMETYPE_VIDEO_AVC; -extern const char *MEDIA_MIMETYPE_VIDEO_MPEG4; -extern const char *MEDIA_MIMETYPE_VIDEO_H263; -extern const char *MEDIA_MIMETYPE_VIDEO_MPEG2; -extern const char *MEDIA_MIMETYPE_VIDEO_RAW; - -extern const char *MEDIA_MIMETYPE_AUDIO_AMR_NB; -extern const char *MEDIA_MIMETYPE_AUDIO_AMR_WB; -extern const char *MEDIA_MIMETYPE_AUDIO_MPEG; // layer III -extern const char *MEDIA_MIMETYPE_AUDIO_MPEG_LAYER_I; -extern const char *MEDIA_MIMETYPE_AUDIO_MPEG_LAYER_II; -extern const char *MEDIA_MIMETYPE_AUDIO_AAC; -extern const char *MEDIA_MIMETYPE_AUDIO_QCELP; -extern const char *MEDIA_MIMETYPE_AUDIO_VORBIS; -extern const char *MEDIA_MIMETYPE_AUDIO_G711_ALAW; -extern const char *MEDIA_MIMETYPE_AUDIO_G711_MLAW; -extern const char *MEDIA_MIMETYPE_AUDIO_RAW; -extern const char *MEDIA_MIMETYPE_AUDIO_FLAC; -extern const char *MEDIA_MIMETYPE_AUDIO_AAC_ADTS; -extern const char *MEDIA_MIMETYPE_AUDIO_MSGSM; - -extern const char *MEDIA_MIMETYPE_CONTAINER_MPEG4; -extern const char *MEDIA_MIMETYPE_CONTAINER_WAV; -extern const char *MEDIA_MIMETYPE_CONTAINER_OGG; -extern const char *MEDIA_MIMETYPE_CONTAINER_MATROSKA; -extern const char *MEDIA_MIMETYPE_CONTAINER_MPEG2TS; -extern const char *MEDIA_MIMETYPE_CONTAINER_AVI; -extern const char *MEDIA_MIMETYPE_CONTAINER_MPEG2PS; - -extern const char *MEDIA_MIMETYPE_CONTAINER_WVM; - -extern const char *MEDIA_MIMETYPE_TEXT_3GPP; -extern const char *MEDIA_MIMETYPE_TEXT_SUBRIP; - -} // namespace android - -#endif // MEDIA_DEFS_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/MediaErrors.h b/external/android/include/18/frameworks/av/include/media/stagefright/MediaErrors.h deleted file mode 100644 index ee5e4e2..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/MediaErrors.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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 MEDIA_ERRORS_H_ - -#define MEDIA_ERRORS_H_ - -#include - -namespace android { - -enum { - MEDIA_ERROR_BASE = -1000, - - ERROR_ALREADY_CONNECTED = MEDIA_ERROR_BASE, - ERROR_NOT_CONNECTED = MEDIA_ERROR_BASE - 1, - ERROR_UNKNOWN_HOST = MEDIA_ERROR_BASE - 2, - ERROR_CANNOT_CONNECT = MEDIA_ERROR_BASE - 3, - ERROR_IO = MEDIA_ERROR_BASE - 4, - ERROR_CONNECTION_LOST = MEDIA_ERROR_BASE - 5, - ERROR_MALFORMED = MEDIA_ERROR_BASE - 7, - ERROR_OUT_OF_RANGE = MEDIA_ERROR_BASE - 8, - ERROR_BUFFER_TOO_SMALL = MEDIA_ERROR_BASE - 9, - ERROR_UNSUPPORTED = MEDIA_ERROR_BASE - 10, - ERROR_END_OF_STREAM = MEDIA_ERROR_BASE - 11, - - // Not technically an error. - INFO_FORMAT_CHANGED = MEDIA_ERROR_BASE - 12, - INFO_DISCONTINUITY = MEDIA_ERROR_BASE - 13, - INFO_OUTPUT_BUFFERS_CHANGED = MEDIA_ERROR_BASE - 14, - - // The following constant values should be in sync with - // drm/drm_framework_common.h - DRM_ERROR_BASE = -2000, - - ERROR_DRM_UNKNOWN = DRM_ERROR_BASE, - ERROR_DRM_NO_LICENSE = DRM_ERROR_BASE - 1, - ERROR_DRM_LICENSE_EXPIRED = DRM_ERROR_BASE - 2, - ERROR_DRM_SESSION_NOT_OPENED = DRM_ERROR_BASE - 3, - ERROR_DRM_DECRYPT_UNIT_NOT_INITIALIZED = DRM_ERROR_BASE - 4, - ERROR_DRM_DECRYPT = DRM_ERROR_BASE - 5, - ERROR_DRM_CANNOT_HANDLE = DRM_ERROR_BASE - 6, - ERROR_DRM_TAMPER_DETECTED = DRM_ERROR_BASE - 7, - ERROR_DRM_NOT_PROVISIONED = DRM_ERROR_BASE - 8, - ERROR_DRM_DEVICE_REVOKED = DRM_ERROR_BASE - 9, - - ERROR_DRM_VENDOR_MAX = DRM_ERROR_BASE - 500, - ERROR_DRM_VENDOR_MIN = DRM_ERROR_BASE - 999, - - // Deprecated - ERROR_DRM_WV_VENDOR_MAX = ERROR_DRM_VENDOR_MAX, - ERROR_DRM_WV_VENDOR_MIN = ERROR_DRM_VENDOR_MIN, - - // Heartbeat Error Codes - HEARTBEAT_ERROR_BASE = -3000, - ERROR_HEARTBEAT_TERMINATE_REQUESTED = HEARTBEAT_ERROR_BASE, -}; - -} // namespace android - -#endif // MEDIA_ERRORS_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/MediaExtractor.h b/external/android/include/18/frameworks/av/include/media/stagefright/MediaExtractor.h deleted file mode 100644 index 3076a96..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/MediaExtractor.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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 MEDIA_EXTRACTOR_H_ - -#define MEDIA_EXTRACTOR_H_ - -#include - -namespace android { - -class DataSource; -class MediaSource; -class MetaData; - -class MediaExtractor : public RefBase { -public: - static sp Create( - const sp &source, const char *mime = NULL); - - virtual size_t countTracks() = 0; - virtual sp getTrack(size_t index) = 0; - - enum GetTrackMetaDataFlags { - kIncludeExtensiveMetaData = 1 - }; - virtual sp getTrackMetaData( - size_t index, uint32_t flags = 0) = 0; - - // Return container specific meta-data. The default implementation - // returns an empty metadata object. - virtual sp getMetaData(); - - enum Flags { - CAN_SEEK_BACKWARD = 1, // the "seek 10secs back button" - CAN_SEEK_FORWARD = 2, // the "seek 10secs forward button" - CAN_PAUSE = 4, - CAN_SEEK = 8, // the "seek bar" - }; - - // If subclasses do _not_ override this, the default is - // CAN_SEEK_BACKWARD | CAN_SEEK_FORWARD | CAN_SEEK | CAN_PAUSE - virtual uint32_t flags() const; - - // for DRM - void setDrmFlag(bool flag) { - mIsDrm = flag; - }; - bool getDrmFlag() { - return mIsDrm; - } - virtual char* getDrmTrackInfo(size_t trackID, int *len) { - return NULL; - } - -protected: - MediaExtractor() : mIsDrm(false) {} - virtual ~MediaExtractor() {} - -private: - bool mIsDrm; - - MediaExtractor(const MediaExtractor &); - MediaExtractor &operator=(const MediaExtractor &); -}; - -} // namespace android - -#endif // MEDIA_EXTRACTOR_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/MediaMuxer.h b/external/android/include/18/frameworks/av/include/media/stagefright/MediaMuxer.h deleted file mode 100644 index c1fdbad..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/MediaMuxer.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright 2013, 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 MEDIA_MUXER_H_ -#define MEDIA_MUXER_H_ - -#include -#include -#include -#include - -namespace android { - -struct ABuffer; -struct AMessage; -struct MediaAdapter; -struct MediaBuffer; -struct MediaSource; -struct MetaData; -struct MPEG4Writer; - -// MediaMuxer is used to mux multiple tracks into a video. Currently, we only -// support a mp4 file as the output. -// The expected calling order of the functions is: -// Constructor -> addTrack+ -> start -> writeSampleData+ -> stop -// If muxing operation need to be cancelled, the app is responsible for -// deleting the output file after stop. -struct MediaMuxer : public RefBase { -public: - // Please update media/java/android/media/MediaMuxer.java if the - // OutputFormat is updated. - enum OutputFormat { - OUTPUT_FORMAT_MPEG_4 = 0, - OUTPUT_FORMAT_LIST_END // must be last - used to validate format type - }; - - // Construct the muxer with the output file path. - MediaMuxer(const char *path, OutputFormat format); - - // Construct the muxer with the file descriptor. Note that the MediaMuxer - // will close this file at stop(). - MediaMuxer(int fd, OutputFormat format); - - virtual ~MediaMuxer(); - - /** - * Add a track with its format information. This should be - * called before start(). - * @param format the track's format. - * @return the track's index or negative number if error. - */ - ssize_t addTrack(const sp &format); - - /** - * Start muxing. Make sure all the tracks have been added before - * calling this. - */ - status_t start(); - - /** - * Set the orientation hint. - * @param degrees The rotation degrees. It has to be either 0, - * 90, 180 or 270. - * @return OK if no error. - */ - status_t setOrientationHint(int degrees); - - /** - * Stop muxing. - * This method is a blocking call. Depending on how - * much data is bufferred internally, the time needed for stopping - * the muxer may be time consuming. UI thread is - * not recommended for launching this call. - * @return OK if no error. - */ - status_t stop(); - - /** - * Send a sample buffer for muxing. - * The buffer can be reused once this method returns. Typically, - * this function won't be blocked for very long, and thus there - * is no need to use a separate thread calling this method to - * push a buffer. - * @param buffer the incoming sample buffer. - * @param trackIndex the buffer's track index number. - * @param timeUs the buffer's time stamp. - * @param flags the only supported flag for now is - * MediaCodec::BUFFER_FLAG_SYNCFRAME. - * @return OK if no error. - */ - status_t writeSampleData(const sp &buffer, size_t trackIndex, - int64_t timeUs, uint32_t flags) ; - -private: - sp mWriter; - Vector< sp > mTrackList; // Each track has its MediaAdapter. - sp mFileMeta; // Metadata for the whole file. - - Mutex mMuxerLock; - - enum State { - UNINITIALIZED, - INITIALIZED, - STARTED, - STOPPED - }; - State mState; - - DISALLOW_EVIL_CONSTRUCTORS(MediaMuxer); -}; - -} // namespace android - -#endif // MEDIA_MUXER_H_ - diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/MediaSource.h b/external/android/include/18/frameworks/av/include/media/stagefright/MediaSource.h deleted file mode 100644 index 3818e63..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/MediaSource.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - * 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 MEDIA_SOURCE_H_ - -#define MEDIA_SOURCE_H_ - -#include - -#include -#include -#include - -namespace android { - -class MediaBuffer; -class MetaData; - -struct MediaSource : public virtual RefBase { - MediaSource(); - - // To be called before any other methods on this object, except - // getFormat(). - virtual status_t start(MetaData *params = NULL) = 0; - - // Any blocking read call returns immediately with a result of NO_INIT. - // It is an error to call any methods other than start after this call - // returns. Any buffers the object may be holding onto at the time of - // the stop() call are released. - // Also, it is imperative that any buffers output by this object and - // held onto by callers be released before a call to stop() !!! - virtual status_t stop() = 0; - - // Returns the format of the data output by this media source. - virtual sp getFormat() = 0; - - struct ReadOptions; - - // Returns a new buffer of data. Call blocks until a - // buffer is available, an error is encountered of the end of the stream - // is reached. - // End of stream is signalled by a result of ERROR_END_OF_STREAM. - // A result of INFO_FORMAT_CHANGED indicates that the format of this - // MediaSource has changed mid-stream, the client can continue reading - // but should be prepared for buffers of the new configuration. - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL) = 0; - - // Options that modify read() behaviour. The default is to - // a) not request a seek - // b) not be late, i.e. lateness_us = 0 - struct ReadOptions { - enum SeekMode { - SEEK_PREVIOUS_SYNC, - SEEK_NEXT_SYNC, - SEEK_CLOSEST_SYNC, - SEEK_CLOSEST, - }; - - ReadOptions(); - - // Reset everything back to defaults. - void reset(); - - void setSeekTo(int64_t time_us, SeekMode mode = SEEK_CLOSEST_SYNC); - void clearSeekTo(); - bool getSeekTo(int64_t *time_us, SeekMode *mode) const; - - void setLateBy(int64_t lateness_us); - int64_t getLateBy() const; - - private: - enum Options { - kSeekTo_Option = 1, - }; - - uint32_t mOptions; - int64_t mSeekTimeUs; - SeekMode mSeekMode; - int64_t mLatenessUs; - }; - - // Causes this source to suspend pulling data from its upstream source - // until a subsequent read-with-seek. Currently only supported by - // OMXCodec. - virtual status_t pause() { - return ERROR_UNSUPPORTED; - } - - // The consumer of this media source requests that the given buffers - // are to be returned exclusively in response to read calls. - // This will be called after a successful start() and before the - // first read() call. - // Callee assumes ownership of the buffers if no error is returned. - virtual status_t setBuffers(const Vector &buffers) { - return ERROR_UNSUPPORTED; - } - -protected: - virtual ~MediaSource(); - -private: - MediaSource(const MediaSource &); - MediaSource &operator=(const MediaSource &); -}; - -} // namespace android - -#endif // MEDIA_SOURCE_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/MediaWriter.h b/external/android/include/18/frameworks/av/include/media/stagefright/MediaWriter.h deleted file mode 100644 index 5cc8dcf..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/MediaWriter.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2010 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 MEDIA_WRITER_H_ - -#define MEDIA_WRITER_H_ - -#include -#include - -namespace android { - -struct MediaSource; -struct MetaData; - -struct MediaWriter : public RefBase { - MediaWriter() - : mMaxFileSizeLimitBytes(0), - mMaxFileDurationLimitUs(0) { - } - - virtual status_t addSource(const sp &source) = 0; - virtual bool reachedEOS() = 0; - virtual status_t start(MetaData *params = NULL) = 0; - virtual status_t stop() = 0; - virtual status_t pause() = 0; - - virtual void setMaxFileSize(int64_t bytes) { mMaxFileSizeLimitBytes = bytes; } - virtual void setMaxFileDuration(int64_t durationUs) { mMaxFileDurationLimitUs = durationUs; } - virtual void setListener(const sp& listener) { - mListener = listener; - } - - virtual status_t dump(int fd, const Vector& args) { - return OK; - } - -protected: - virtual ~MediaWriter() {} - int64_t mMaxFileSizeLimitBytes; - int64_t mMaxFileDurationLimitUs; - sp mListener; - - void notify(int msg, int ext1, int ext2) { - if (mListener != NULL) { - mListener->notify(msg, ext1, ext2); - } - } -private: - MediaWriter(const MediaWriter &); - MediaWriter &operator=(const MediaWriter &); -}; - -} // namespace android - -#endif // MEDIA_WRITER_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/MetaData.h b/external/android/include/18/frameworks/av/include/media/stagefright/MetaData.h deleted file mode 100644 index de3fc36..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/MetaData.h +++ /dev/null @@ -1,271 +0,0 @@ -/* - * 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 META_DATA_H_ - -#define META_DATA_H_ - -#include - -#include - -#include -#include -#include - -namespace android { - -// The following keys map to int32_t data unless indicated otherwise. -enum { - kKeyMIMEType = 'mime', // cstring - kKeyWidth = 'widt', // int32_t, image pixel - kKeyHeight = 'heig', // int32_t, image pixel - kKeyDisplayWidth = 'dWid', // int32_t, display/presentation - kKeyDisplayHeight = 'dHgt', // int32_t, display/presentation - kKeySARWidth = 'sarW', // int32_t, sampleAspectRatio width - kKeySARHeight = 'sarH', // int32_t, sampleAspectRatio height - - // a rectangle, if absent assumed to be (0, 0, width - 1, height - 1) - kKeyCropRect = 'crop', - - kKeyRotation = 'rotA', // int32_t (angle in degrees) - kKeyIFramesInterval = 'ifiv', // int32_t - kKeyStride = 'strd', // int32_t - kKeySliceHeight = 'slht', // int32_t - kKeyChannelCount = '#chn', // int32_t - kKeyChannelMask = 'chnm', // int32_t - kKeySampleRate = 'srte', // int32_t (audio sampling rate Hz) - kKeyFrameRate = 'frmR', // int32_t (video frame rate fps) - kKeyBitRate = 'brte', // int32_t (bps) - kKeyESDS = 'esds', // raw data - kKeyAACProfile = 'aacp', // int32_t - kKeyAVCC = 'avcc', // raw data - kKeyD263 = 'd263', // raw data - kKeyVorbisInfo = 'vinf', // raw data - kKeyVorbisBooks = 'vboo', // raw data - kKeyWantsNALFragments = 'NALf', - kKeyIsSyncFrame = 'sync', // int32_t (bool) - kKeyIsCodecConfig = 'conf', // int32_t (bool) - kKeyTime = 'time', // int64_t (usecs) - kKeyDecodingTime = 'decT', // int64_t (decoding timestamp in usecs) - kKeyNTPTime = 'ntpT', // uint64_t (ntp-timestamp) - kKeyTargetTime = 'tarT', // int64_t (usecs) - kKeyDriftTime = 'dftT', // int64_t (usecs) - kKeyAnchorTime = 'ancT', // int64_t (usecs) - kKeyDuration = 'dura', // int64_t (usecs) - kKeyColorFormat = 'colf', - kKeyPlatformPrivate = 'priv', // pointer - kKeyDecoderComponent = 'decC', // cstring - kKeyBufferID = 'bfID', - kKeyMaxInputSize = 'inpS', - kKeyThumbnailTime = 'thbT', // int64_t (usecs) - kKeyTrackID = 'trID', - kKeyIsDRM = 'idrm', // int32_t (bool) - kKeyEncoderDelay = 'encd', // int32_t (frames) - kKeyEncoderPadding = 'encp', // int32_t (frames) - - kKeyAlbum = 'albu', // cstring - kKeyArtist = 'arti', // cstring - kKeyAlbumArtist = 'aart', // cstring - kKeyComposer = 'comp', // cstring - kKeyGenre = 'genr', // cstring - kKeyTitle = 'titl', // cstring - kKeyYear = 'year', // cstring - kKeyAlbumArt = 'albA', // compressed image data - kKeyAlbumArtMIME = 'alAM', // cstring - kKeyAuthor = 'auth', // cstring - kKeyCDTrackNumber = 'cdtr', // cstring - kKeyDiscNumber = 'dnum', // cstring - kKeyDate = 'date', // cstring - kKeyWriter = 'writ', // cstring - kKeyCompilation = 'cpil', // cstring - kKeyLocation = 'loc ', // cstring - kKeyTimeScale = 'tmsl', // int32_t - - // video profile and level - kKeyVideoProfile = 'vprf', // int32_t - kKeyVideoLevel = 'vlev', // int32_t - - // Set this key to enable authoring files in 64-bit offset - kKey64BitFileOffset = 'fobt', // int32_t (bool) - kKey2ByteNalLength = '2NAL', // int32_t (bool) - - // Identify the file output format for authoring - // Please see for the supported - // file output formats. - kKeyFileType = 'ftyp', // int32_t - - // Track authoring progress status - // kKeyTrackTimeStatus is used to track progress in elapsed time - kKeyTrackTimeStatus = 'tktm', // int64_t - - kKeyRealTimeRecording = 'rtrc', // bool (int32_t) - kKeyNumBuffers = 'nbbf', // int32_t - - // Ogg files can be tagged to be automatically looping... - kKeyAutoLoop = 'autL', // bool (int32_t) - - kKeyValidSamples = 'valD', // int32_t - - kKeyIsUnreadable = 'unre', // bool (int32_t) - - // An indication that a video buffer has been rendered. - kKeyRendered = 'rend', // bool (int32_t) - - // The language code for this media - kKeyMediaLanguage = 'lang', // cstring - - // To store the timed text format data - kKeyTextFormatData = 'text', // raw data - - kKeyRequiresSecureBuffers = 'secu', // bool (int32_t) - - kKeyIsADTS = 'adts', // bool (int32_t) - - // If a MediaBuffer's data represents (at least partially) encrypted - // data, the following fields aid in decryption. - // The data can be thought of as pairs of plain and encrypted data - // fragments, i.e. plain and encrypted data alternate. - // The first fragment is by convention plain data (if that's not the - // case, simply specify plain fragment size of 0). - // kKeyEncryptedSizes and kKeyPlainSizes each map to an array of - // size_t values. The sum total of all size_t values of both arrays - // must equal the amount of data (i.e. MediaBuffer's range_length()). - // If both arrays are present, they must be of the same size. - // If only encrypted sizes are present it is assumed that all - // plain sizes are 0, i.e. all fragments are encrypted. - // To programmatically set these array, use the MetaData::setData API, i.e. - // const size_t encSizes[]; - // meta->setData( - // kKeyEncryptedSizes, 0 /* type */, encSizes, sizeof(encSizes)); - // A plain sizes array by itself makes no sense. - kKeyEncryptedSizes = 'encr', // size_t[] - kKeyPlainSizes = 'plai', // size_t[] - kKeyCryptoKey = 'cryK', // uint8_t[16] - kKeyCryptoIV = 'cryI', // uint8_t[16] - kKeyCryptoMode = 'cryM', // int32_t - - kKeyCryptoDefaultIVSize = 'cryS', // int32_t - - kKeyPssh = 'pssh', // raw data -}; - -enum { - kTypeESDS = 'esds', - kTypeAVCC = 'avcc', - kTypeD263 = 'd263', -}; - -class MetaData : public RefBase { -public: - MetaData(); - MetaData(const MetaData &from); - - enum Type { - TYPE_NONE = 'none', - TYPE_C_STRING = 'cstr', - TYPE_INT32 = 'in32', - TYPE_INT64 = 'in64', - TYPE_FLOAT = 'floa', - TYPE_POINTER = 'ptr ', - TYPE_RECT = 'rect', - }; - - void clear(); - bool remove(uint32_t key); - - bool setCString(uint32_t key, const char *value); - bool setInt32(uint32_t key, int32_t value); - bool setInt64(uint32_t key, int64_t value); - bool setFloat(uint32_t key, float value); - bool setPointer(uint32_t key, void *value); - - bool setRect( - uint32_t key, - int32_t left, int32_t top, - int32_t right, int32_t bottom); - - bool findCString(uint32_t key, const char **value); - bool findInt32(uint32_t key, int32_t *value); - bool findInt64(uint32_t key, int64_t *value); - bool findFloat(uint32_t key, float *value); - bool findPointer(uint32_t key, void **value); - - bool findRect( - uint32_t key, - int32_t *left, int32_t *top, - int32_t *right, int32_t *bottom); - - bool setData(uint32_t key, uint32_t type, const void *data, size_t size); - - bool findData(uint32_t key, uint32_t *type, - const void **data, size_t *size) const; - - void dumpToLog() const; - -protected: - virtual ~MetaData(); - -private: - struct typed_data { - typed_data(); - ~typed_data(); - - typed_data(const MetaData::typed_data &); - typed_data &operator=(const MetaData::typed_data &); - - void clear(); - void setData(uint32_t type, const void *data, size_t size); - void getData(uint32_t *type, const void **data, size_t *size) const; - String8 asString() const; - - private: - uint32_t mType; - size_t mSize; - - union { - void *ext_data; - float reservoir; - } u; - - bool usesReservoir() const { - return mSize <= sizeof(u.reservoir); - } - - void allocateStorage(size_t size); - void freeStorage(); - - void *storage() { - return usesReservoir() ? &u.reservoir : u.ext_data; - } - - const void *storage() const { - return usesReservoir() ? &u.reservoir : u.ext_data; - } - }; - - struct Rect { - int32_t mLeft, mTop, mRight, mBottom; - }; - - KeyedVector mItems; - - // MetaData &operator=(const MetaData &); -}; - -} // namespace android - -#endif // META_DATA_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/NativeWindowWrapper.h b/external/android/include/18/frameworks/av/include/media/stagefright/NativeWindowWrapper.h deleted file mode 100644 index cfeec22..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/NativeWindowWrapper.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2011 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 NATIVE_WINDOW_WRAPPER_H_ - -#define NATIVE_WINDOW_WRAPPER_H_ - -#include - -namespace android { - -// Surface derives from ANativeWindow which derives from multiple -// base classes, in order to carry it in AMessages, we'll temporarily wrap it -// into a NativeWindowWrapper. - -struct NativeWindowWrapper : RefBase { - NativeWindowWrapper( - const sp &surfaceTextureClient) : - mSurfaceTextureClient(surfaceTextureClient) { } - - sp getNativeWindow() const { - return mSurfaceTextureClient; - } - - sp getSurfaceTextureClient() const { - return mSurfaceTextureClient; - } - -private: - const sp mSurfaceTextureClient; - - DISALLOW_EVIL_CONSTRUCTORS(NativeWindowWrapper); -}; - -} // namespace android - -#endif // NATIVE_WINDOW_WRAPPER_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/NuMediaExtractor.h b/external/android/include/18/frameworks/av/include/media/stagefright/NuMediaExtractor.h deleted file mode 100644 index 5ae6f6b..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/NuMediaExtractor.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright 2012, 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 NU_MEDIA_EXTRACTOR_H_ -#define NU_MEDIA_EXTRACTOR_H_ - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace android { - -struct ABuffer; -struct AMessage; -struct DataSource; -struct MediaBuffer; -struct MediaExtractor; -struct MediaSource; -struct MetaData; - -struct NuMediaExtractor : public RefBase { - enum SampleFlags { - SAMPLE_FLAG_SYNC = 1, - SAMPLE_FLAG_ENCRYPTED = 2, - }; - - NuMediaExtractor(); - - status_t setDataSource( - const char *path, - const KeyedVector *headers = NULL); - - status_t setDataSource(int fd, off64_t offset, off64_t size); - - status_t setDataSource(const sp &datasource); - - size_t countTracks() const; - status_t getTrackFormat(size_t index, sp *format) const; - - status_t getFileFormat(sp *format) const; - - status_t selectTrack(size_t index); - status_t unselectTrack(size_t index); - - status_t seekTo( - int64_t timeUs, - MediaSource::ReadOptions::SeekMode mode = - MediaSource::ReadOptions::SEEK_CLOSEST_SYNC); - - status_t advance(); - status_t readSampleData(const sp &buffer); - status_t getSampleTrackIndex(size_t *trackIndex); - status_t getSampleTime(int64_t *sampleTimeUs); - status_t getSampleMeta(sp *sampleMeta); - - bool getCachedDuration(int64_t *durationUs, bool *eos) const; - -protected: - virtual ~NuMediaExtractor(); - -private: - enum TrackFlags { - kIsVorbis = 1, - }; - - struct TrackInfo { - sp mSource; - size_t mTrackIndex; - status_t mFinalResult; - MediaBuffer *mSample; - int64_t mSampleTimeUs; - - uint32_t mTrackFlags; // bitmask of "TrackFlags" - }; - - mutable Mutex mLock; - - sp mDataSource; - - sp mImpl; - bool mIsWidevineExtractor; - - Vector mSelectedTracks; - int64_t mTotalBitrate; // in bits/sec - int64_t mDurationUs; - - ssize_t fetchTrackSamples( - int64_t seekTimeUs = -1ll, - MediaSource::ReadOptions::SeekMode mode = - MediaSource::ReadOptions::SEEK_CLOSEST_SYNC); - - void releaseTrackSamples(); - - bool getTotalBitrate(int64_t *bitRate) const; - void updateDurationAndBitrate(); - - DISALLOW_EVIL_CONSTRUCTORS(NuMediaExtractor); -}; - -} // namespace android - -#endif // NU_MEDIA_EXTRACTOR_H_ - diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/OMXClient.h b/external/android/include/18/frameworks/av/include/media/stagefright/OMXClient.h deleted file mode 100644 index 2f14d06..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/OMXClient.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 OMX_CLIENT_H_ - -#define OMX_CLIENT_H_ - -#include - -namespace android { - -class OMXClient { -public: - OMXClient(); - - status_t connect(); - void disconnect(); - - sp interface() { - return mOMX; - } - -private: - sp mOMX; - - OMXClient(const OMXClient &); - OMXClient &operator=(const OMXClient &); -}; - -} // namespace android - -#endif // OMX_CLIENT_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/OMXCodec.h b/external/android/include/18/frameworks/av/include/media/stagefright/OMXCodec.h deleted file mode 100644 index 583c3b3..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/OMXCodec.h +++ /dev/null @@ -1,402 +0,0 @@ -/* - * 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 OMX_CODEC_H_ - -#define OMX_CODEC_H_ - -#include -#include -#include -#include -#include - -#include - -namespace android { - -struct MediaCodecList; -class MemoryDealer; -struct OMXCodecObserver; -struct CodecProfileLevel; -class SkipCutBuffer; - -struct OMXCodec : public MediaSource, - public MediaBufferObserver { - enum CreationFlags { - kPreferSoftwareCodecs = 1, - kIgnoreCodecSpecificData = 2, - - // The client wants to access the output buffer's video - // data for example for thumbnail extraction. - kClientNeedsFramebuffer = 4, - - // Request for software or hardware codecs. If request - // can not be fullfilled, Create() returns NULL. - kSoftwareCodecsOnly = 8, - kHardwareCodecsOnly = 16, - - // Store meta data in video buffers - kStoreMetaDataInVideoBuffers = 32, - - // Only submit one input buffer at one time. - kOnlySubmitOneInputBufferAtOneTime = 64, - - // Enable GRALLOC_USAGE_PROTECTED for output buffers from native window - kEnableGrallocUsageProtected = 128, - - // Secure decoding mode - kUseSecureInputBuffers = 256, - }; - static sp Create( - const sp &omx, - const sp &meta, bool createEncoder, - const sp &source, - const char *matchComponentName = NULL, - uint32_t flags = 0, - const sp &nativeWindow = NULL); - - static void setComponentRole( - const sp &omx, IOMX::node_id node, bool isEncoder, - const char *mime); - - virtual status_t start(MetaData *params = NULL); - virtual status_t stop(); - - virtual sp getFormat(); - - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL); - - virtual status_t pause(); - - // from MediaBufferObserver - virtual void signalBufferReturned(MediaBuffer *buffer); - - enum Quirks { - kNeedsFlushBeforeDisable = 1, - kWantsNALFragments = 2, - kRequiresLoadedToIdleAfterAllocation = 4, - kRequiresAllocateBufferOnInputPorts = 8, - kRequiresFlushCompleteEmulation = 16, - kRequiresAllocateBufferOnOutputPorts = 32, - kRequiresFlushBeforeShutdown = 64, - kDefersOutputBufferAllocation = 128, - kDecoderLiesAboutNumberOfChannels = 256, - kInputBufferSizesAreBogus = 512, - kSupportsMultipleFramesPerInputBuffer = 1024, - kRequiresLargerEncoderOutputBuffer = 2048, - kOutputBuffersAreUnreadable = 4096, - }; - - struct CodecNameAndQuirks { - String8 mName; - uint32_t mQuirks; - }; - - // for use by ACodec - static void findMatchingCodecs( - const char *mime, - bool createEncoder, const char *matchComponentName, - uint32_t flags, - Vector *matchingCodecNamesAndQuirks); - - static uint32_t getComponentQuirks( - const MediaCodecList *list, size_t index); - - static bool findCodecQuirks(const char *componentName, uint32_t *quirks); - -protected: - virtual ~OMXCodec(); - -private: - - // Make sure mLock is accessible to OMXCodecObserver - friend class OMXCodecObserver; - - // Call this with mLock hold - void on_message(const omx_message &msg); - - enum State { - DEAD, - LOADED, - LOADED_TO_IDLE, - IDLE_TO_EXECUTING, - EXECUTING, - EXECUTING_TO_IDLE, - IDLE_TO_LOADED, - RECONFIGURING, - ERROR - }; - - enum { - kPortIndexInput = 0, - kPortIndexOutput = 1 - }; - - enum PortStatus { - ENABLED, - DISABLING, - DISABLED, - ENABLING, - SHUTTING_DOWN, - }; - - enum BufferStatus { - OWNED_BY_US, - OWNED_BY_COMPONENT, - OWNED_BY_NATIVE_WINDOW, - OWNED_BY_CLIENT, - }; - - struct BufferInfo { - IOMX::buffer_id mBuffer; - BufferStatus mStatus; - sp mMem; - size_t mSize; - void *mData; - MediaBuffer *mMediaBuffer; - }; - - struct CodecSpecificData { - size_t mSize; - uint8_t mData[1]; - }; - - sp mOMX; - bool mOMXLivesLocally; - IOMX::node_id mNode; - uint32_t mQuirks; - - // Flags specified in the creation of the codec. - uint32_t mFlags; - - bool mIsEncoder; - bool mIsVideo; - char *mMIME; - char *mComponentName; - sp mOutputFormat; - sp mSource; - Vector mCodecSpecificData; - size_t mCodecSpecificDataIndex; - - sp mDealer[2]; - - State mState; - Vector mPortBuffers[2]; - PortStatus mPortStatus[2]; - bool mInitialBufferSubmit; - bool mSignalledEOS; - status_t mFinalStatus; - bool mNoMoreOutputData; - bool mOutputPortSettingsHaveChanged; - int64_t mSeekTimeUs; - ReadOptions::SeekMode mSeekMode; - int64_t mTargetTimeUs; - bool mOutputPortSettingsChangedPending; - sp mSkipCutBuffer; - - MediaBuffer *mLeftOverBuffer; - - Mutex mLock; - Condition mAsyncCompletion; - - bool mPaused; - - sp mNativeWindow; - - // The index in each of the mPortBuffers arrays of the buffer that will be - // submitted to OMX next. This only applies when using buffers from a - // native window. - size_t mNextNativeBufferIndex[2]; - - // A list of indices into mPortStatus[kPortIndexOutput] filled with data. - List mFilledBuffers; - Condition mBufferFilled; - - // Used to record the decoding time for an output picture from - // a video encoder. - List mDecodingTimeList; - - OMXCodec(const sp &omx, IOMX::node_id node, - uint32_t quirks, uint32_t flags, - bool isEncoder, const char *mime, const char *componentName, - const sp &source, - const sp &nativeWindow); - - void addCodecSpecificData(const void *data, size_t size); - void clearCodecSpecificData(); - - void setComponentRole(); - - void setAMRFormat(bool isWAMR, int32_t bitRate); - - status_t setAACFormat( - int32_t numChannels, int32_t sampleRate, int32_t bitRate, - int32_t aacProfile, bool isADTS); - - void setG711Format(int32_t numChannels); - - status_t setVideoPortFormatType( - OMX_U32 portIndex, - OMX_VIDEO_CODINGTYPE compressionFormat, - OMX_COLOR_FORMATTYPE colorFormat); - - void setVideoInputFormat( - const char *mime, const sp& meta); - - status_t setupBitRate(int32_t bitRate); - status_t setupErrorCorrectionParameters(); - status_t setupH263EncoderParameters(const sp& meta); - status_t setupMPEG4EncoderParameters(const sp& meta); - status_t setupAVCEncoderParameters(const sp& meta); - status_t findTargetColorFormat( - const sp& meta, OMX_COLOR_FORMATTYPE *colorFormat); - - status_t isColorFormatSupported( - OMX_COLOR_FORMATTYPE colorFormat, int portIndex); - - // If profile/level is set in the meta data, its value in the meta - // data will be used; otherwise, the default value will be used. - status_t getVideoProfileLevel(const sp& meta, - const CodecProfileLevel& defaultProfileLevel, - CodecProfileLevel& profileLevel); - - status_t setVideoOutputFormat( - const char *mime, const sp& meta); - - void setImageOutputFormat( - OMX_COLOR_FORMATTYPE format, OMX_U32 width, OMX_U32 height); - - void setJPEGInputFormat( - OMX_U32 width, OMX_U32 height, OMX_U32 compressedSize); - - void setMinBufferSize(OMX_U32 portIndex, OMX_U32 size); - - void setRawAudioFormat( - OMX_U32 portIndex, int32_t sampleRate, int32_t numChannels); - - status_t allocateBuffers(); - status_t allocateBuffersOnPort(OMX_U32 portIndex); - status_t allocateOutputBuffersFromNativeWindow(); - - status_t queueBufferToNativeWindow(BufferInfo *info); - status_t cancelBufferToNativeWindow(BufferInfo *info); - BufferInfo* dequeueBufferFromNativeWindow(); - status_t pushBlankBuffersToNativeWindow(); - - status_t freeBuffersOnPort( - OMX_U32 portIndex, bool onlyThoseWeOwn = false); - - status_t freeBuffer(OMX_U32 portIndex, size_t bufIndex); - - bool drainInputBuffer(IOMX::buffer_id buffer); - void fillOutputBuffer(IOMX::buffer_id buffer); - bool drainInputBuffer(BufferInfo *info); - void fillOutputBuffer(BufferInfo *info); - - void drainInputBuffers(); - void fillOutputBuffers(); - - bool drainAnyInputBuffer(); - BufferInfo *findInputBufferByDataPointer(void *ptr); - BufferInfo *findEmptyInputBuffer(); - - // Returns true iff a flush was initiated and a completion event is - // upcoming, false otherwise (A flush was not necessary as we own all - // the buffers on that port). - // This method will ONLY ever return false for a component with quirk - // "kRequiresFlushCompleteEmulation". - bool flushPortAsync(OMX_U32 portIndex); - - void disablePortAsync(OMX_U32 portIndex); - status_t enablePortAsync(OMX_U32 portIndex); - - static size_t countBuffersWeOwn(const Vector &buffers); - static bool isIntermediateState(State state); - - void onEvent(OMX_EVENTTYPE event, OMX_U32 data1, OMX_U32 data2); - void onCmdComplete(OMX_COMMANDTYPE cmd, OMX_U32 data); - void onStateChange(OMX_STATETYPE newState); - void onPortSettingsChanged(OMX_U32 portIndex); - - void setState(State newState); - - status_t init(); - void initOutputFormat(const sp &inputFormat); - status_t initNativeWindow(); - - void initNativeWindowCrop(); - - void dumpPortStatus(OMX_U32 portIndex); - - status_t configureCodec(const sp &meta); - - status_t applyRotation(); - status_t waitForBufferFilled_l(); - - int64_t getDecodingTimeUs(); - - status_t parseAVCCodecSpecificData( - const void *data, size_t size, - unsigned *profile, unsigned *level); - - status_t stopOmxComponent_l(); - - OMXCodec(const OMXCodec &); - OMXCodec &operator=(const OMXCodec &); -}; - -struct CodecCapabilities { - String8 mComponentName; - Vector mProfileLevels; - Vector mColorFormats; -}; - -// Return a vector of componentNames with supported profile/level pairs -// supporting the given mime type, if queryDecoders==true, returns components -// that decode content of the given type, otherwise returns components -// that encode content of the given type. -// profile and level indications only make sense for h.263, mpeg4 and avc -// video. -// If hwCodecOnly==true, only returns hardware-based components, software and -// hardware otherwise. -// The profile/level values correspond to -// OMX_VIDEO_H263PROFILETYPE, OMX_VIDEO_MPEG4PROFILETYPE, -// OMX_VIDEO_AVCPROFILETYPE, OMX_VIDEO_H263LEVELTYPE, OMX_VIDEO_MPEG4LEVELTYPE -// and OMX_VIDEO_AVCLEVELTYPE respectively. - -status_t QueryCodecs( - const sp &omx, - const char *mimeType, bool queryDecoders, bool hwCodecOnly, - Vector *results); - -status_t QueryCodecs( - const sp &omx, - const char *mimeType, bool queryDecoders, - Vector *results); - -status_t QueryCodec( - const sp &omx, - const char *componentName, const char *mime, - bool isEncoder, - CodecCapabilities *caps); - -status_t getOMXChannelMapping(size_t numChannels, OMX_AUDIO_CHANNELTYPE map[]); - -} // namespace android - -#endif // OMX_CODEC_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/SkipCutBuffer.h b/external/android/include/18/frameworks/av/include/media/stagefright/SkipCutBuffer.h deleted file mode 100644 index 2653b53..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/SkipCutBuffer.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2012 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 SKIP_CUT_BUFFER_H_ - -#define SKIP_CUT_BUFFER_H_ - -#include -#include - -namespace android { - -/** - * utility class to cut the start and end off a stream of data in MediaBuffers - * - */ -class SkipCutBuffer: public RefBase { - public: - // 'skip' is the number of bytes to skip from the beginning - // 'cut' is the number of bytes to cut from the end - SkipCutBuffer(int32_t skip, int32_t cut); - - // Submit one MediaBuffer for skipping and cutting. This may consume all or - // some of the data in the buffer, or it may add data to it. - // After this, the caller should continue processing the buffer as usual. - void submit(MediaBuffer *buffer); - void submit(const sp& buffer); // same as above, but with an ABuffer - void clear(); - size_t size(); // how many bytes are currently stored in the buffer - - protected: - virtual ~SkipCutBuffer(); - - private: - void write(const char *src, size_t num); - size_t read(char *dst, size_t num); - int32_t mFrontPadding; - int32_t mBackPadding; - int32_t mWriteHead; - int32_t mReadHead; - int32_t mCapacity; - char* mCutBuffer; - DISALLOW_EVIL_CONSTRUCTORS(SkipCutBuffer); -}; - -} // namespace android - -#endif // OMX_CODEC_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/StagefrightMediaScanner.h b/external/android/include/18/frameworks/av/include/media/stagefright/StagefrightMediaScanner.h deleted file mode 100644 index 6510a59..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/StagefrightMediaScanner.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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 STAGEFRIGHT_MEDIA_SCANNER_H_ - -#define STAGEFRIGHT_MEDIA_SCANNER_H_ - -#include - -namespace android { - -struct StagefrightMediaScanner : public MediaScanner { - StagefrightMediaScanner(); - virtual ~StagefrightMediaScanner(); - - virtual MediaScanResult processFile( - const char *path, const char *mimeType, - MediaScannerClient &client); - - virtual char *extractAlbumArt(int fd); - -private: - StagefrightMediaScanner(const StagefrightMediaScanner &); - StagefrightMediaScanner &operator=(const StagefrightMediaScanner &); - - MediaScanResult processFileInternal( - const char *path, const char *mimeType, - MediaScannerClient &client); -}; - -} // namespace android - -#endif // STAGEFRIGHT_MEDIA_SCANNER_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/SurfaceMediaSource.h b/external/android/include/18/frameworks/av/include/media/stagefright/SurfaceMediaSource.h deleted file mode 100644 index 5f21da9..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/SurfaceMediaSource.h +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright (C) 2011 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_GUI_SURFACEMEDIASOURCE_H -#define ANDROID_GUI_SURFACEMEDIASOURCE_H - -#include -#include - -#include -#include -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class IGraphicBufferAlloc; -class String8; -class GraphicBuffer; - -// ASSUMPTIONS -// 1. SurfaceMediaSource is initialized with width*height which -// can never change. However, deqeueue buffer does not currently -// enforce this as in BufferQueue, dequeue can be used by Surface -// which can modify the default width and heght. Also neither the width -// nor height can be 0. -// 2. setSynchronousMode is never used (basically no one should call -// setSynchronousMode(false) -// 3. setCrop, setTransform, setScalingMode should never be used -// 4. queueBuffer returns a filled buffer to the SurfaceMediaSource. In addition, a -// timestamp must be provided for the buffer. The timestamp is in -// nanoseconds, and must be monotonically increasing. Its other semantics -// (zero point, etc) are client-dependent and should be documented by the -// client. -// 5. Once disconnected, SurfaceMediaSource can be reused (can not -// connect again) -// 6. Stop is a hard stop, the last few frames held by the encoder -// may be dropped. It is possible to wait for the buffers to be -// returned (but not implemented) - -#define DEBUG_PENDING_BUFFERS 0 - -class SurfaceMediaSource : public MediaSource, - public MediaBufferObserver, - protected BufferQueue::ConsumerListener { -public: - enum { MIN_UNDEQUEUED_BUFFERS = 4}; - - struct FrameAvailableListener : public virtual RefBase { - // onFrameAvailable() is called from queueBuffer() is the FIFO is - // empty. You can use SurfaceMediaSource::getQueuedCount() to - // figure out if there are more frames waiting. - // This is called without any lock held can be called concurrently by - // multiple threads. - virtual void onFrameAvailable() = 0; - }; - - SurfaceMediaSource(uint32_t bufferWidth, uint32_t bufferHeight); - - virtual ~SurfaceMediaSource(); - - // For the MediaSource interface for use by StageFrightRecorder: - virtual status_t start(MetaData *params = NULL); - virtual status_t stop(); - virtual status_t read(MediaBuffer **buffer, - const ReadOptions *options = NULL); - virtual sp getFormat(); - - // Get / Set the frame rate used for encoding. Default fps = 30 - status_t setFrameRate(int32_t fps) ; - int32_t getFrameRate( ) const; - - // The call for the StageFrightRecorder to tell us that - // it is done using the MediaBuffer data so that its state - // can be set to FREE for dequeuing - virtual void signalBufferReturned(MediaBuffer* buffer); - // end of MediaSource interface - - // getTimestamp retrieves the timestamp associated with the image - // set by the most recent call to read() - // - // The timestamp is in nanoseconds, and is monotonically increasing. Its - // other semantics (zero point, etc) are source-dependent and should be - // documented by the source. - int64_t getTimestamp(); - - // setFrameAvailableListener sets the listener object that will be notified - // when a new frame becomes available. - void setFrameAvailableListener(const sp& listener); - - // dump our state in a String - void dump(String8& result) const; - void dump(String8& result, const char* prefix, char* buffer, - size_t SIZE) const; - - // isMetaDataStoredInVideoBuffers tells the encoder whether we will - // pass metadata through the buffers. Currently, it is force set to true - bool isMetaDataStoredInVideoBuffers() const; - - sp getBufferQueue() const { return mBufferQueue; } - - // To be called before start() - status_t setMaxAcquiredBufferCount(size_t count); - - // To be called before start() - status_t setUseAbsoluteTimestamps(); - -protected: - - // Implementation of the BufferQueue::ConsumerListener interface. These - // calls are used to notify the Surface of asynchronous events in the - // BufferQueue. - virtual void onFrameAvailable(); - - // Used as a hook to BufferQueue::disconnect() - // This is called by the client side when it is done - // TODO: Currently, this also sets mStopped to true which - // is needed for unblocking the encoder which might be - // waiting to read more frames. So if on the client side, - // the same thread supplies the frames and also calls stop - // on the encoder, the client has to call disconnect before - // it calls stop. - // In the case of the camera, - // that need not be required since the thread supplying the - // frames is separate than the one calling stop. - virtual void onBuffersReleased(); - - static bool isExternalFormat(uint32_t format); - -private: - // mBufferQueue is the exchange point between the producer and - // this consumer - sp mBufferQueue; - - // mBufferSlot caches GraphicBuffers from the buffer queue - sp mBufferSlot[BufferQueue::NUM_BUFFER_SLOTS]; - - - // The permenent width and height of SMS buffers - int mWidth; - int mHeight; - - // mCurrentSlot is the buffer slot index of the buffer that is currently - // being used by buffer consumer - // (e.g. StageFrightRecorder in the case of SurfaceMediaSource or GLTexture - // in the case of Surface). - // It is initialized to INVALID_BUFFER_SLOT, - // indicating that no buffer slot is currently bound to the texture. Note, - // however, that a value of INVALID_BUFFER_SLOT does not necessarily mean - // that no buffer is bound to the texture. A call to setBufferCount will - // reset mCurrentTexture to INVALID_BUFFER_SLOT. - int mCurrentSlot; - - // mCurrentBuffers is a list of the graphic buffers that are being used by - // buffer consumer (i.e. the video encoder). It's possible that these - // buffers are not associated with any buffer slots, so we must track them - // separately. Buffers are added to this list in read, and removed from - // this list in signalBufferReturned - Vector > mCurrentBuffers; - - size_t mNumPendingBuffers; - -#if DEBUG_PENDING_BUFFERS - Vector mPendingBuffers; -#endif - - // mCurrentTimestamp is the timestamp for the current texture. It - // gets set to mLastQueuedTimestamp each time updateTexImage is called. - int64_t mCurrentTimestamp; - - // mFrameAvailableListener is the listener object that will be called when a - // new frame becomes available. If it is not NULL it will be called from - // queueBuffer. - sp mFrameAvailableListener; - - // mMutex is the mutex used to prevent concurrent access to the member - // variables of SurfaceMediaSource objects. It must be locked whenever the - // member variables are accessed. - mutable Mutex mMutex; - - ////////////////////////// For MediaSource - // Set to a default of 30 fps if not specified by the client side - int32_t mFrameRate; - - // mStarted is a flag to check if the recording is going on - bool mStarted; - - // mNumFramesReceived indicates the number of frames recieved from - // the client side - int mNumFramesReceived; - // mNumFramesEncoded indicates the number of frames passed on to the - // encoder - int mNumFramesEncoded; - - // mFirstFrameTimestamp is the timestamp of the first received frame. - // It is used to offset the output timestamps so recording starts at time 0. - int64_t mFirstFrameTimestamp; - // mStartTimeNs is the start time passed into the source at start, used to - // offset timestamps. - int64_t mStartTimeNs; - - size_t mMaxAcquiredBufferCount; - - bool mUseAbsoluteTimestamps; - - // mFrameAvailableCondition condition used to indicate whether there - // is a frame available for dequeuing - Condition mFrameAvailableCondition; - - Condition mMediaBuffersAvailableCondition; - - // Avoid copying and equating and default constructor - DISALLOW_IMPLICIT_CONSTRUCTORS(SurfaceMediaSource); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_SURFACEMEDIASOURCE_H diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/TimeSource.h b/external/android/include/18/frameworks/av/include/media/stagefright/TimeSource.h deleted file mode 100644 index 8f11e14..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/TimeSource.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 TIME_SOURCE_H_ - -#define TIME_SOURCE_H_ - -#include - -namespace android { - -class TimeSource { -public: - TimeSource() {} - virtual ~TimeSource() {} - - virtual int64_t getRealTimeUs() = 0; - -private: - TimeSource(const TimeSource &); - TimeSource &operator=(const TimeSource &); -}; - -class SystemTimeSource : public TimeSource { -public: - SystemTimeSource(); - - virtual int64_t getRealTimeUs(); - -private: - int64_t mStartTimeUs; -}; - -} // namespace android - -#endif // TIME_SOURCE_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/Utils.h b/external/android/include/18/frameworks/av/include/media/stagefright/Utils.h deleted file mode 100644 index 73940d3..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/Utils.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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 UTILS_H_ - -#define UTILS_H_ - -#include -#include -#include -#include - -namespace android { - -#define FOURCC(c1, c2, c3, c4) \ - (c1 << 24 | c2 << 16 | c3 << 8 | c4) - -uint16_t U16_AT(const uint8_t *ptr); -uint32_t U32_AT(const uint8_t *ptr); -uint64_t U64_AT(const uint8_t *ptr); - -uint16_t U16LE_AT(const uint8_t *ptr); -uint32_t U32LE_AT(const uint8_t *ptr); -uint64_t U64LE_AT(const uint8_t *ptr); - -uint64_t ntoh64(uint64_t x); -uint64_t hton64(uint64_t x); - -struct MetaData; -struct AMessage; -status_t convertMetaDataToMessage( - const sp &meta, sp *format); -void convertMessageToMetaData( - const sp &format, sp &meta); - -AString MakeUserAgent(); - -} // namespace android - -#endif // UTILS_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/YUVCanvas.h b/external/android/include/18/frameworks/av/include/media/stagefright/YUVCanvas.h deleted file mode 100644 index ff70923..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/YUVCanvas.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -// YUVCanvas holds a reference to a YUVImage on which it can do various -// drawing operations. It provides various utility functions for filling, -// cropping, etc. - - -#ifndef YUV_CANVAS_H_ - -#define YUV_CANVAS_H_ - -#include - -namespace android { - -class YUVImage; -class Rect; - -class YUVCanvas { -public: - - // Constructor takes in reference to a yuvImage on which it can do - // various drawing opreations. - YUVCanvas(YUVImage &yuvImage); - ~YUVCanvas(); - - // Fills the entire image with the given YUV values. - void FillYUV(uint8_t yValue, uint8_t uValue, uint8_t vValue); - - // Fills the rectangular region [startX,endX]x[startY,endY] with the given YUV values. - void FillYUVRectangle(const Rect& rect, - uint8_t yValue, uint8_t uValue, uint8_t vValue); - - // Copies the region [startX,endX]x[startY,endY] from srcImage into the - // canvas' target image (mYUVImage) starting at - // (destinationStartX,destinationStartY). - // Note that undefined behavior may occur if srcImage is same as the canvas' - // target image. - void CopyImageRect( - const Rect& srcRect, - int32_t destStartX, int32_t destStartY, - const YUVImage &srcImage); - - // Downsamples the srcImage into the canvas' target image (mYUVImage) - // The downsampling copies pixels from the source image starting at - // (srcOffsetX, srcOffsetY) to the target image, starting at (0, 0). - // For each X increment in the target image, skipX pixels are skipped - // in the source image. - // Similarly for each Y increment in the target image, skipY pixels - // are skipped in the source image. - void downsample( - int32_t srcOffsetX, int32_t srcOffsetY, - int32_t skipX, int32_t skipY, - const YUVImage &srcImage); - -private: - YUVImage& mYUVImage; - - YUVCanvas(const YUVCanvas &); - YUVCanvas &operator=(const YUVCanvas &); -}; - -} // namespace android - -#endif // YUV_CANVAS_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/YUVImage.h b/external/android/include/18/frameworks/av/include/media/stagefright/YUVImage.h deleted file mode 100644 index 4e98618..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/YUVImage.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -// A container class to hold YUV data and provide various utilities, -// e.g. to set/get pixel values. -// Supported formats: -// - YUV420 Planar -// - YUV420 Semi Planar -// -// Currently does not support variable strides. -// -// Implementation: Two simple abstractions are done to simplify access -// to YUV channels for different formats: -// - initializeYUVPointers() sets up pointers (mYdata, mUdata, mVdata) to -// point to the right start locations of the different channel data depending -// on the format. -// - getOffsets() returns the correct offset for the different channels -// depending on the format. -// Location of any pixel's YUV channels can then be easily computed using these. -// - -#ifndef YUV_IMAGE_H_ - -#define YUV_IMAGE_H_ - -#include -#include - -namespace android { - -class Rect; - -class YUVImage { -public: - // Supported YUV formats - enum YUVFormat { - YUV420Planar, - YUV420SemiPlanar - }; - - // Constructs an image with the given size, format. Also allocates and owns - // the required memory. - YUVImage(YUVFormat yuvFormat, int32_t width, int32_t height); - - // Constructs an image with the given size, format. The memory is provided - // by the caller and we don't own it. - YUVImage(YUVFormat yuvFormat, int32_t width, int32_t height, uint8_t *buffer); - - // Destructor to delete the memory if it owns it. - ~YUVImage(); - - // Returns the size of the buffer required to store the YUV data for the given - // format and geometry. Useful when the caller wants to allocate the requisite - // memory. - static size_t bufferSize(YUVFormat yuvFormat, int32_t width, int32_t height); - - int32_t width() const {return mWidth;} - int32_t height() const {return mHeight;} - - // Returns true if pixel is the range [0, width-1] x [0, height-1] - // and false otherwise. - bool validPixel(int32_t x, int32_t y) const; - - // Get the pixel YUV value at pixel (x,y). - // Note that the range of x is [0, width-1] and the range of y is [0, height-1]. - // Returns true if get was successful and false otherwise. - bool getPixelValue(int32_t x, int32_t y, - uint8_t *yPtr, uint8_t *uPtr, uint8_t *vPtr) const; - - // Set the pixel YUV value at pixel (x,y). - // Note that the range of x is [0, width-1] and the range of y is [0, height-1]. - // Returns true if set was successful and false otherwise. - bool setPixelValue(int32_t x, int32_t y, - uint8_t yValue, uint8_t uValue, uint8_t vValue); - - // Uses memcpy to copy an entire row of data - static void fastCopyRectangle420Planar( - const Rect& srcRect, - int32_t destStartX, int32_t destStartY, - const YUVImage &srcImage, YUVImage &destImage); - - // Uses memcpy to copy an entire row of data - static void fastCopyRectangle420SemiPlanar( - const Rect& srcRect, - int32_t destStartX, int32_t destStartY, - const YUVImage &srcImage, YUVImage &destImage); - - // Tries to use memcopy to copy entire rows of data. - // Returns false if fast copy is not possible for the passed image formats. - static bool fastCopyRectangle( - const Rect& srcRect, - int32_t destStartX, int32_t destStartY, - const YUVImage &srcImage, YUVImage &destImage); - - // Convert the given YUV value to RGB. - void yuv2rgb(uint8_t yValue, uint8_t uValue, uint8_t vValue, - uint8_t *r, uint8_t *g, uint8_t *b) const; - - // Write the image to a human readable PPM file. - // Returns true if write was succesful and false otherwise. - bool writeToPPM(const char *filename) const; - -private: - // YUV Format of the image. - YUVFormat mYUVFormat; - - int32_t mWidth; - int32_t mHeight; - - // Pointer to the memory buffer. - uint8_t *mBuffer; - - // Boolean telling whether we own the memory buffer. - bool mOwnBuffer; - - // Pointer to start of the Y data plane. - uint8_t *mYdata; - - // Pointer to start of the U data plane. Note that in case of interleaved formats like - // YUV420 semiplanar, mUdata points to the start of the U data in the UV plane. - uint8_t *mUdata; - - // Pointer to start of the V data plane. Note that in case of interleaved formats like - // YUV420 semiplanar, mVdata points to the start of the V data in the UV plane. - uint8_t *mVdata; - - // Initialize the pointers mYdata, mUdata, mVdata to point to the right locations for - // the given format and geometry. - // Returns true if initialize was succesful and false otherwise. - bool initializeYUVPointers(); - - // For the given pixel location, this returns the offset of the location of y, u and v - // data from the corresponding base pointers -- mYdata, mUdata, mVdata. - // Note that the range of x is [0, width-1] and the range of y is [0, height-1]. - // Returns true if getting offsets was succesful and false otherwise. - bool getOffsets(int32_t x, int32_t y, - int32_t *yOffset, int32_t *uOffset, int32_t *vOffset) const; - - // Returns the offset increments incurred in going from one data row to the next data row - // for the YUV channels. Note that this corresponds to data rows and not pixel rows. - // E.g. depending on formats, U/V channels may have only one data row corresponding - // to two pixel rows. - bool getOffsetIncrementsPerDataRow( - int32_t *yDataOffsetIncrement, - int32_t *uDataOffsetIncrement, - int32_t *vDataOffsetIncrement) const; - - // Given the offset return the address of the corresponding channel's data. - uint8_t* getYAddress(int32_t offset) const; - uint8_t* getUAddress(int32_t offset) const; - uint8_t* getVAddress(int32_t offset) const; - - // Given the pixel location, returns the address of the corresponding channel's data. - // Note that the range of x is [0, width-1] and the range of y is [0, height-1]. - bool getYUVAddresses(int32_t x, int32_t y, - uint8_t **yAddr, uint8_t **uAddr, uint8_t **vAddr) const; - - // Disallow implicit casting and copying. - YUVImage(const YUVImage &); - YUVImage &operator=(const YUVImage &); -}; - -} // namespace android - -#endif // YUV_IMAGE_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/AAtomizer.h b/external/android/include/18/frameworks/av/include/media/stagefright/foundation/AAtomizer.h deleted file mode 100644 index 5f3a678..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/AAtomizer.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2010 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 A_ATOMIZER_H_ - -#define A_ATOMIZER_H_ - -#include - -#include -#include -#include -#include -#include - -namespace android { - -struct AAtomizer { - static const char *Atomize(const char *name); - -private: - static AAtomizer gAtomizer; - - Mutex mLock; - Vector > mAtoms; - - AAtomizer(); - - const char *atomize(const char *name); - - static uint32_t Hash(const char *s); - - DISALLOW_EVIL_CONSTRUCTORS(AAtomizer); -}; - -} // namespace android - -#endif // A_ATOMIZER_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/ABase.h b/external/android/include/18/frameworks/av/include/media/stagefright/foundation/ABase.h deleted file mode 100644 index 9eceea3..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/ABase.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2010 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 A_BASE_H_ - -#define A_BASE_H_ - -#define DISALLOW_EVIL_CONSTRUCTORS(name) \ - name(const name &); \ - name &operator=(const name &) - -#endif // A_BASE_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/ABitReader.h b/external/android/include/18/frameworks/av/include/media/stagefright/foundation/ABitReader.h deleted file mode 100644 index 5510b12..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/ABitReader.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2010 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 A_BIT_READER_H_ - -#define A_BIT_READER_H_ - -#include - -#include -#include - -namespace android { - -struct ABitReader { - ABitReader(const uint8_t *data, size_t size); - - uint32_t getBits(size_t n); - void skipBits(size_t n); - - void putBits(uint32_t x, size_t n); - - size_t numBitsLeft() const; - - const uint8_t *data() const; - -private: - const uint8_t *mData; - size_t mSize; - - uint32_t mReservoir; // left-aligned bits - size_t mNumBitsLeft; - - void fillReservoir(); - - DISALLOW_EVIL_CONSTRUCTORS(ABitReader); -}; - -} // namespace android - -#endif // A_BIT_READER_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/ABuffer.h b/external/android/include/18/frameworks/av/include/media/stagefright/foundation/ABuffer.h deleted file mode 100644 index 28f0aed..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/ABuffer.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2010 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 A_BUFFER_H_ - -#define A_BUFFER_H_ - -#include -#include - -#include -#include - -namespace android { - -struct AMessage; - -struct ABuffer : public RefBase { - ABuffer(size_t capacity); - ABuffer(void *data, size_t capacity); - - void setFarewellMessage(const sp msg); - - uint8_t *base() { return (uint8_t *)mData; } - uint8_t *data() { return (uint8_t *)mData + mRangeOffset; } - size_t capacity() const { return mCapacity; } - size_t size() const { return mRangeLength; } - size_t offset() const { return mRangeOffset; } - - void setRange(size_t offset, size_t size); - - void setInt32Data(int32_t data) { mInt32Data = data; } - int32_t int32Data() const { return mInt32Data; } - - sp meta(); - -protected: - virtual ~ABuffer(); - -private: - sp mFarewell; - sp mMeta; - - void *mData; - size_t mCapacity; - size_t mRangeOffset; - size_t mRangeLength; - - int32_t mInt32Data; - - bool mOwnsData; - - DISALLOW_EVIL_CONSTRUCTORS(ABuffer); -}; - -} // namespace android - -#endif // A_BUFFER_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/ADebug.h b/external/android/include/18/frameworks/av/include/media/stagefright/foundation/ADebug.h deleted file mode 100644 index 450dcfe..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/ADebug.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2010 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 A_DEBUG_H_ - -#define A_DEBUG_H_ - -#include - -#include -#include -#include - -namespace android { - -#define LITERAL_TO_STRING_INTERNAL(x) #x -#define LITERAL_TO_STRING(x) LITERAL_TO_STRING_INTERNAL(x) - -#define CHECK(condition) \ - LOG_ALWAYS_FATAL_IF( \ - !(condition), \ - "%s", \ - __FILE__ ":" LITERAL_TO_STRING(__LINE__) \ - " CHECK(" #condition ") failed.") - -#define MAKE_COMPARATOR(suffix,op) \ - template \ - AString Compare_##suffix(const A &a, const B &b) { \ - AString res; \ - if (!(a op b)) { \ - res.append(a); \ - res.append(" vs. "); \ - res.append(b); \ - } \ - return res; \ - } - -MAKE_COMPARATOR(EQ,==) -MAKE_COMPARATOR(NE,!=) -MAKE_COMPARATOR(LE,<=) -MAKE_COMPARATOR(GE,>=) -MAKE_COMPARATOR(LT,<) -MAKE_COMPARATOR(GT,>) - -#define CHECK_OP(x,y,suffix,op) \ - do { \ - AString ___res = Compare_##suffix(x, y); \ - if (!___res.empty()) { \ - AString ___full = \ - __FILE__ ":" LITERAL_TO_STRING(__LINE__) \ - " CHECK_" #suffix "( " #x "," #y ") failed: "; \ - ___full.append(___res); \ - \ - LOG_ALWAYS_FATAL("%s", ___full.c_str()); \ - } \ - } while (false) - -#define CHECK_EQ(x,y) CHECK_OP(x,y,EQ,==) -#define CHECK_NE(x,y) CHECK_OP(x,y,NE,!=) -#define CHECK_LE(x,y) CHECK_OP(x,y,LE,<=) -#define CHECK_LT(x,y) CHECK_OP(x,y,LT,<) -#define CHECK_GE(x,y) CHECK_OP(x,y,GE,>=) -#define CHECK_GT(x,y) CHECK_OP(x,y,GT,>) - -#define TRESPASS() \ - LOG_ALWAYS_FATAL( \ - __FILE__ ":" LITERAL_TO_STRING(__LINE__) \ - " Should not be here."); - -} // namespace android - -#endif // A_DEBUG_H_ - diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/AHandler.h b/external/android/include/18/frameworks/av/include/media/stagefright/foundation/AHandler.h deleted file mode 100644 index b008b54..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/AHandler.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2010 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 A_HANDLER_H_ - -#define A_HANDLER_H_ - -#include -#include - -namespace android { - -struct AMessage; - -struct AHandler : public RefBase { - AHandler() - : mID(0) { - } - - ALooper::handler_id id() const { - return mID; - } - - sp looper(); - -protected: - virtual void onMessageReceived(const sp &msg) = 0; - -private: - friend struct ALooperRoster; - - ALooper::handler_id mID; - - void setID(ALooper::handler_id id) { - mID = id; - } - - DISALLOW_EVIL_CONSTRUCTORS(AHandler); -}; - -} // namespace android - -#endif // A_HANDLER_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/AHandlerReflector.h b/external/android/include/18/frameworks/av/include/media/stagefright/foundation/AHandlerReflector.h deleted file mode 100644 index 9d201b5..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/AHandlerReflector.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2010 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 A_HANDLER_REFLECTOR_H_ - -#define A_HANDLER_REFLECTOR_H_ - -#include - -namespace android { - -template -struct AHandlerReflector : public AHandler { - AHandlerReflector(T *target) - : mTarget(target) { - } - -protected: - virtual void onMessageReceived(const sp &msg) { - sp target = mTarget.promote(); - if (target != NULL) { - target->onMessageReceived(msg); - } - } - -private: - wp mTarget; - - AHandlerReflector(const AHandlerReflector &); - AHandlerReflector &operator=(const AHandlerReflector &); -}; - -} // namespace android - -#endif // A_HANDLER_REFLECTOR_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/AHierarchicalStateMachine.h b/external/android/include/18/frameworks/av/include/media/stagefright/foundation/AHierarchicalStateMachine.h deleted file mode 100644 index d2e6b28..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/AHierarchicalStateMachine.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2010 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 A_HIERARCHICAL_STATE_MACHINE_H_ - -#define A_HIERARCHICAL_STATE_MACHINE_H_ - -#include - -namespace android { - -struct AState : public RefBase { - AState(const sp &parentState = NULL); - - sp parentState(); - -protected: - virtual ~AState(); - - virtual void stateEntered(); - virtual void stateExited(); - - virtual bool onMessageReceived(const sp &msg) = 0; - -private: - friend struct AHierarchicalStateMachine; - - sp mParentState; - - DISALLOW_EVIL_CONSTRUCTORS(AState); -}; - -struct AHierarchicalStateMachine : public AHandler { - AHierarchicalStateMachine(); - -protected: - virtual ~AHierarchicalStateMachine(); - - virtual void onMessageReceived(const sp &msg); - - // Only to be called in response to a message. - void changeState(const sp &state); - -private: - sp mState; - - DISALLOW_EVIL_CONSTRUCTORS(AHierarchicalStateMachine); -}; - -} // namespace android - -#endif // A_HIERARCHICAL_STATE_MACHINE_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/ALooper.h b/external/android/include/18/frameworks/av/include/media/stagefright/foundation/ALooper.h deleted file mode 100644 index 70e0c5e..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/ALooper.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2010 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 A_LOOPER_H_ - -#define A_LOOPER_H_ - -#include -#include -#include -#include -#include -#include -#include - -namespace android { - -struct AHandler; -struct AMessage; - -struct ALooper : public RefBase { - typedef int32_t event_id; - typedef int32_t handler_id; - - ALooper(); - - // Takes effect in a subsequent call to start(). - void setName(const char *name); - - handler_id registerHandler(const sp &handler); - void unregisterHandler(handler_id handlerID); - - status_t start( - bool runOnCallingThread = false, - bool canCallJava = false, - int32_t priority = PRIORITY_DEFAULT - ); - - status_t stop(); - - static int64_t GetNowUs(); - -protected: - virtual ~ALooper(); - -private: - friend struct ALooperRoster; - - struct Event { - int64_t mWhenUs; - sp mMessage; - }; - - Mutex mLock; - Condition mQueueChangedCondition; - - AString mName; - - List mEventQueue; - - struct LooperThread; - sp mThread; - bool mRunningLocally; - - void post(const sp &msg, int64_t delayUs); - bool loop(); - - DISALLOW_EVIL_CONSTRUCTORS(ALooper); -}; - -} // namespace android - -#endif // A_LOOPER_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/ALooperRoster.h b/external/android/include/18/frameworks/av/include/media/stagefright/foundation/ALooperRoster.h deleted file mode 100644 index 2e5fd73..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/ALooperRoster.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2010 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 A_LOOPER_ROSTER_H_ - -#define A_LOOPER_ROSTER_H_ - -#include -#include - -namespace android { - -struct ALooperRoster { - ALooperRoster(); - - ALooper::handler_id registerHandler( - const sp looper, const sp &handler); - - void unregisterHandler(ALooper::handler_id handlerID); - - status_t postMessage(const sp &msg, int64_t delayUs = 0); - void deliverMessage(const sp &msg); - - status_t postAndAwaitResponse( - const sp &msg, sp *response); - - void postReply(uint32_t replyID, const sp &reply); - - sp findLooper(ALooper::handler_id handlerID); - -private: - struct HandlerInfo { - wp mLooper; - wp mHandler; - }; - - Mutex mLock; - KeyedVector mHandlers; - ALooper::handler_id mNextHandlerID; - uint32_t mNextReplyID; - Condition mRepliesCondition; - - KeyedVector > mReplies; - - status_t postMessage_l(const sp &msg, int64_t delayUs); - - DISALLOW_EVIL_CONSTRUCTORS(ALooperRoster); -}; - -} // namespace android - -#endif // A_LOOPER_ROSTER_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/AMessage.h b/external/android/include/18/frameworks/av/include/media/stagefright/foundation/AMessage.h deleted file mode 100644 index 7e823eb..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/AMessage.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (C) 2010 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 A_MESSAGE_H_ - -#define A_MESSAGE_H_ - -#include -#include -#include -#include - -namespace android { - -struct ABuffer; -struct AString; -struct Parcel; - -struct AMessage : public RefBase { - AMessage(uint32_t what = 0, ALooper::handler_id target = 0); - - static sp FromParcel(const Parcel &parcel); - void writeToParcel(Parcel *parcel) const; - - void setWhat(uint32_t what); - uint32_t what() const; - - void setTarget(ALooper::handler_id target); - ALooper::handler_id target() const; - - void clear(); - - void setInt32(const char *name, int32_t value); - void setInt64(const char *name, int64_t value); - void setSize(const char *name, size_t value); - void setFloat(const char *name, float value); - void setDouble(const char *name, double value); - void setPointer(const char *name, void *value); - void setString(const char *name, const char *s, ssize_t len = -1); - void setObject(const char *name, const sp &obj); - void setBuffer(const char *name, const sp &buffer); - void setMessage(const char *name, const sp &obj); - - void setRect( - const char *name, - int32_t left, int32_t top, int32_t right, int32_t bottom); - - bool findInt32(const char *name, int32_t *value) const; - bool findInt64(const char *name, int64_t *value) const; - bool findSize(const char *name, size_t *value) const; - bool findFloat(const char *name, float *value) const; - bool findDouble(const char *name, double *value) const; - bool findPointer(const char *name, void **value) const; - bool findString(const char *name, AString *value) const; - bool findObject(const char *name, sp *obj) const; - bool findBuffer(const char *name, sp *buffer) const; - bool findMessage(const char *name, sp *obj) const; - - bool findRect( - const char *name, - int32_t *left, int32_t *top, int32_t *right, int32_t *bottom) const; - - void post(int64_t delayUs = 0); - - // Posts the message to its target and waits for a response (or error) - // before returning. - status_t postAndAwaitResponse(sp *response); - - // If this returns true, the sender of this message is synchronously - // awaiting a response, the "replyID" can be used to send the response - // via "postReply" below. - bool senderAwaitsResponse(uint32_t *replyID) const; - - void postReply(uint32_t replyID); - - // Performs a deep-copy of "this", contained messages are in turn "dup'ed". - // Warning: RefBase items, i.e. "objects" are _not_ copied but only have - // their refcount incremented. - sp dup() const; - - AString debugString(int32_t indent = 0) const; - - enum Type { - kTypeInt32, - kTypeInt64, - kTypeSize, - kTypeFloat, - kTypeDouble, - kTypePointer, - kTypeString, - kTypeObject, - kTypeMessage, - kTypeRect, - kTypeBuffer, - }; - - size_t countEntries() const; - const char *getEntryNameAt(size_t index, Type *type) const; - -protected: - virtual ~AMessage(); - -private: - uint32_t mWhat; - ALooper::handler_id mTarget; - - struct Rect { - int32_t mLeft, mTop, mRight, mBottom; - }; - - struct Item { - union { - int32_t int32Value; - int64_t int64Value; - size_t sizeValue; - float floatValue; - double doubleValue; - void *ptrValue; - RefBase *refValue; - AString *stringValue; - Rect rectValue; - } u; - const char *mName; - Type mType; - }; - - enum { - kMaxNumItems = 64 - }; - Item mItems[kMaxNumItems]; - size_t mNumItems; - - Item *allocateItem(const char *name); - void freeItem(Item *item); - const Item *findItem(const char *name, Type type) const; - - void setObjectInternal( - const char *name, const sp &obj, Type type); - - DISALLOW_EVIL_CONSTRUCTORS(AMessage); -}; - -} // namespace android - -#endif // A_MESSAGE_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/AString.h b/external/android/include/18/frameworks/av/include/media/stagefright/foundation/AString.h deleted file mode 100644 index 0f8f1e1..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/AString.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (C) 2010 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 A_STRING_H_ - -#define A_STRING_H_ - -#include - -namespace android { - -struct AString { - AString(); - AString(const char *s); - AString(const char *s, size_t size); - AString(const AString &from); - AString(const AString &from, size_t offset, size_t n); - ~AString(); - - AString &operator=(const AString &from); - void setTo(const char *s); - void setTo(const char *s, size_t size); - void setTo(const AString &from, size_t offset, size_t n); - - size_t size() const; - const char *c_str() const; - - bool empty() const; - - void clear(); - void trim(); - void erase(size_t start, size_t n); - - void append(char c) { append(&c, 1); } - void append(const char *s); - void append(const char *s, size_t size); - void append(const AString &from); - void append(const AString &from, size_t offset, size_t n); - void append(int x); - void append(unsigned x); - void append(long x); - void append(unsigned long x); - void append(long long x); - void append(unsigned long long x); - void append(float x); - void append(double x); - void append(void *x); - - void insert(const AString &from, size_t insertionPos); - void insert(const char *from, size_t size, size_t insertionPos); - - ssize_t find(const char *substring, size_t start = 0) const; - - size_t hash() const; - - bool operator==(const AString &other) const; - bool operator<(const AString &other) const; - bool operator>(const AString &other) const; - - int compare(const AString &other) const; - - bool startsWith(const char *prefix) const; - bool endsWith(const char *suffix) const; - - void tolower(); - -private: - static const char *kEmptyString; - - char *mData; - size_t mSize; - size_t mAllocSize; - - void makeMutable(); -}; - -AString StringPrintf(const char *format, ...); - -} // namespace android - -#endif // A_STRING_H_ - diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/base64.h b/external/android/include/18/frameworks/av/include/media/stagefright/foundation/base64.h deleted file mode 100644 index e340b89..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/base64.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2010 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 BASE_64_H_ - -#define BASE_64_H_ - -#include - -namespace android { - -struct ABuffer; -struct AString; - -sp decodeBase64(const AString &s); -void encodeBase64(const void *data, size_t size, AString *out); - -} // namespace android - -#endif // BASE_64_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/hexdump.h b/external/android/include/18/frameworks/av/include/media/stagefright/foundation/hexdump.h deleted file mode 100644 index 8360c5a..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/foundation/hexdump.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2010 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 HEXDUMP_H_ - -#define HEXDUMP_H_ - -#include - -namespace android { - -struct AString; - -void hexdump( - const void *_data, size_t size, - size_t indent = 0, AString *appendTo = NULL); - -} // namespace android - -#endif // HEXDUMP_H_ diff --git a/external/android/include/18/frameworks/av/include/media/stagefright/timedtext/TimedTextDriver.h b/external/android/include/18/frameworks/av/include/media/stagefright/timedtext/TimedTextDriver.h deleted file mode 100644 index f23c337..0000000 --- a/external/android/include/18/frameworks/av/include/media/stagefright/timedtext/TimedTextDriver.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2012 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 TIMED_TEXT_DRIVER_H_ -#define TIMED_TEXT_DRIVER_H_ - -#include // for DISALLOW_* macro -#include // for status_t -#include -#include - -namespace android { - -class ALooper; -class MediaPlayerBase; -class MediaSource; -class Parcel; -class TimedTextPlayer; -class TimedTextSource; -class DataSource; - -class TimedTextDriver { -public: - TimedTextDriver(const wp &listener); - - ~TimedTextDriver(); - - status_t start(); - status_t pause(); - status_t selectTrack(size_t index); - status_t unselectTrack(size_t index); - - status_t seekToAsync(int64_t timeUs); - - status_t addInBandTextSource( - size_t trackIndex, const sp& source); - - status_t addOutOfBandTextSource( - size_t trackIndex, const char *uri, const char *mimeType); - - // Caller owns the file desriptor and caller is responsible for closing it. - status_t addOutOfBandTextSource( - size_t trackIndex, int fd, off64_t offset, - off64_t length, const char *mimeType); - - void getExternalTrackInfo(Parcel *parcel); - size_t countExternalTracks() const; - -private: - Mutex mLock; - - enum State { - UNINITIALIZED, - PREPARED, - PLAYING, - PAUSED, - }; - - enum TextSourceType { - TEXT_SOURCE_TYPE_IN_BAND = 0, - TEXT_SOURCE_TYPE_OUT_OF_BAND, - }; - - sp mLooper; - sp mPlayer; - wp mListener; - - // Variables to be guarded by mLock. - State mState; - size_t mCurrentTrackIndex; - KeyedVector > mTextSourceVector; - Vector mTextSourceTypeVector; - - // -- End of variables to be guarded by mLock - - status_t selectTrack_l(size_t index); - - status_t createOutOfBandTextSource( - size_t trackIndex, const char* mimeType, - const sp& dataSource); - - DISALLOW_EVIL_CONSTRUCTORS(TimedTextDriver); -}; - -} // namespace android - -#endif // TIMED_TEXT_DRIVER_H_ diff --git a/external/android/include/18/frameworks/native/include/binder/AppOpsManager.h b/external/android/include/18/frameworks/native/include/binder/AppOpsManager.h deleted file mode 100644 index 256cb94..0000000 --- a/external/android/include/18/frameworks/native/include/binder/AppOpsManager.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (C) 2013 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_APP_OPS_MANAGER_H -#define ANDROID_APP_OPS_MANAGER_H - -#include - -#include - -// --------------------------------------------------------------------------- -namespace android { - -class AppOpsManager -{ -public: - enum { - MODE_ALLOWED = IAppOpsService::MODE_ALLOWED, - MODE_IGNORED = IAppOpsService::MODE_IGNORED, - MODE_ERRORED = IAppOpsService::MODE_ERRORED - }; - - enum { - OP_NONE = -1, - OP_COARSE_LOCATION = 0, - OP_FINE_LOCATION = 1, - OP_GPS = 2, - OP_VIBRATE = 3, - OP_READ_CONTACTS = 4, - OP_WRITE_CONTACTS = 5, - OP_READ_CALL_LOG = 6, - OP_WRITE_CALL_LOG = 7, - OP_READ_CALENDAR = 8, - OP_WRITE_CALENDAR = 9, - OP_WIFI_SCAN = 10, - OP_POST_NOTIFICATION = 11, - OP_NEIGHBORING_CELLS = 12, - OP_CALL_PHONE = 13, - OP_READ_SMS = 14, - OP_WRITE_SMS = 15, - OP_RECEIVE_SMS = 16, - OP_RECEIVE_EMERGECY_SMS = 17, - OP_RECEIVE_MMS = 18, - OP_RECEIVE_WAP_PUSH = 19, - OP_SEND_SMS = 20, - OP_READ_ICC_SMS = 21, - OP_WRITE_ICC_SMS = 22, - OP_WRITE_SETTINGS = 23, - OP_SYSTEM_ALERT_WINDOW = 24, - OP_ACCESS_NOTIFICATIONS = 25, - OP_CAMERA = 26, - OP_RECORD_AUDIO = 27, - OP_PLAY_AUDIO = 28 - }; - - AppOpsManager(); - - int32_t checkOp(int32_t op, int32_t uid, const String16& callingPackage); - int32_t noteOp(int32_t op, int32_t uid, const String16& callingPackage); - int32_t startOp(int32_t op, int32_t uid, const String16& callingPackage); - void finishOp(int32_t op, int32_t uid, const String16& callingPackage); - void startWatchingMode(int32_t op, const String16& packageName, - const sp& callback); - void stopWatchingMode(const sp& callback); - -private: - Mutex mLock; - sp mService; - - sp getService(); -}; - - -}; // namespace android -// --------------------------------------------------------------------------- -#endif // ANDROID_APP_OPS_MANAGER_H diff --git a/external/android/include/18/frameworks/native/include/binder/Binder.h b/external/android/include/18/frameworks/native/include/binder/Binder.h deleted file mode 100644 index ba3ac4b..0000000 --- a/external/android/include/18/frameworks/native/include/binder/Binder.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_BINDER_H -#define ANDROID_BINDER_H - -#include - -// --------------------------------------------------------------------------- -namespace android { - -class BBinder : public IBinder -{ -public: - BBinder(); - - virtual const String16& getInterfaceDescriptor() const; - virtual bool isBinderAlive() const; - virtual status_t pingBinder(); - virtual status_t dump(int fd, const Vector& args); - - virtual status_t transact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); - - virtual status_t linkToDeath(const sp& recipient, - void* cookie = NULL, - uint32_t flags = 0); - - virtual status_t unlinkToDeath( const wp& recipient, - void* cookie = NULL, - uint32_t flags = 0, - wp* outRecipient = NULL); - - virtual void attachObject( const void* objectID, - void* object, - void* cleanupCookie, - object_cleanup_func func); - virtual void* findObject(const void* objectID) const; - virtual void detachObject(const void* objectID); - - virtual BBinder* localBinder(); - -protected: - virtual ~BBinder(); - - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); - -private: - BBinder(const BBinder& o); - BBinder& operator=(const BBinder& o); - - class Extras; - - Extras* mExtras; - void* mReserved0; -}; - -// --------------------------------------------------------------------------- - -class BpRefBase : public virtual RefBase -{ -protected: - BpRefBase(const sp& o); - virtual ~BpRefBase(); - virtual void onFirstRef(); - virtual void onLastStrongRef(const void* id); - virtual bool onIncStrongAttempted(uint32_t flags, const void* id); - - inline IBinder* remote() { return mRemote; } - inline IBinder* remote() const { return mRemote; } - -private: - BpRefBase(const BpRefBase& o); - BpRefBase& operator=(const BpRefBase& o); - - IBinder* const mRemote; - RefBase::weakref_type* mRefs; - volatile int32_t mState; -}; - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_BINDER_H diff --git a/external/android/include/18/frameworks/native/include/binder/BinderService.h b/external/android/include/18/frameworks/native/include/binder/BinderService.h deleted file mode 100644 index 5ac36d9..0000000 --- a/external/android/include/18/frameworks/native/include/binder/BinderService.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2010 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_BINDER_SERVICE_H -#define ANDROID_BINDER_SERVICE_H - -#include - -#include -#include - -#include -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -template -class BinderService -{ -public: - static status_t publish(bool allowIsolated = false) { - sp sm(defaultServiceManager()); - return sm->addService( - String16(SERVICE::getServiceName()), - new SERVICE(), allowIsolated); - } - - static void publishAndJoinThreadPool(bool allowIsolated = false) { - sp sm(defaultServiceManager()); - sm->addService( - String16(SERVICE::getServiceName()), - new SERVICE(), allowIsolated); - ProcessState::self()->startThreadPool(); - ProcessState::self()->giveThreadPoolName(); - IPCThreadState::self()->joinThreadPool(); - } - - static void instantiate() { publish(); } - - static status_t shutdown() { - return NO_ERROR; - } -}; - - -}; // namespace android -// --------------------------------------------------------------------------- -#endif // ANDROID_BINDER_SERVICE_H diff --git a/external/android/include/18/frameworks/native/include/binder/BpBinder.h b/external/android/include/18/frameworks/native/include/binder/BpBinder.h deleted file mode 100644 index 7ef93aa..0000000 --- a/external/android/include/18/frameworks/native/include/binder/BpBinder.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (C) 2005 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_BPBINDER_H -#define ANDROID_BPBINDER_H - -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -class BpBinder : public IBinder -{ -public: - BpBinder(int32_t handle); - - inline int32_t handle() const { return mHandle; } - - virtual const String16& getInterfaceDescriptor() const; - virtual bool isBinderAlive() const; - virtual status_t pingBinder(); - virtual status_t dump(int fd, const Vector& args); - - virtual status_t transact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); - - virtual status_t linkToDeath(const sp& recipient, - void* cookie = NULL, - uint32_t flags = 0); - virtual status_t unlinkToDeath( const wp& recipient, - void* cookie = NULL, - uint32_t flags = 0, - wp* outRecipient = NULL); - - virtual void attachObject( const void* objectID, - void* object, - void* cleanupCookie, - object_cleanup_func func); - virtual void* findObject(const void* objectID) const; - virtual void detachObject(const void* objectID); - - virtual BpBinder* remoteBinder(); - - status_t setConstantData(const void* data, size_t size); - void sendObituary(); - - class ObjectManager - { - public: - ObjectManager(); - ~ObjectManager(); - - void attach( const void* objectID, - void* object, - void* cleanupCookie, - IBinder::object_cleanup_func func); - void* find(const void* objectID) const; - void detach(const void* objectID); - - void kill(); - - private: - ObjectManager(const ObjectManager&); - ObjectManager& operator=(const ObjectManager&); - - struct entry_t - { - void* object; - void* cleanupCookie; - IBinder::object_cleanup_func func; - }; - - KeyedVector mObjects; - }; - -protected: - virtual ~BpBinder(); - virtual void onFirstRef(); - virtual void onLastStrongRef(const void* id); - virtual bool onIncStrongAttempted(uint32_t flags, const void* id); - -private: - const int32_t mHandle; - - struct Obituary { - wp recipient; - void* cookie; - uint32_t flags; - }; - - void reportOneDeath(const Obituary& obit); - bool isDescriptorCached() const; - - mutable Mutex mLock; - volatile int32_t mAlive; - volatile int32_t mObitsSent; - Vector* mObituaries; - ObjectManager mObjects; - Parcel* mConstantData; - mutable String16 mDescriptorCache; -}; - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_BPBINDER_H diff --git a/external/android/include/18/frameworks/native/include/binder/IAppOpsCallback.h b/external/android/include/18/frameworks/native/include/binder/IAppOpsCallback.h deleted file mode 100644 index 7f8eb01..0000000 --- a/external/android/include/18/frameworks/native/include/binder/IAppOpsCallback.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2013 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_IAPP_OPS_CALLBACK_H -#define ANDROID_IAPP_OPS_CALLBACK_H - -#include - -namespace android { - -// ---------------------------------------------------------------------- - -class IAppOpsCallback : public IInterface -{ -public: - DECLARE_META_INTERFACE(AppOpsCallback); - - virtual void opChanged(int32_t op, const String16& packageName) = 0; - - enum { - OP_CHANGED_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION - }; -}; - -// ---------------------------------------------------------------------- - -class BnAppOpsCallback : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IAPP_OPS_CALLBACK_H - diff --git a/external/android/include/18/frameworks/native/include/binder/IAppOpsService.h b/external/android/include/18/frameworks/native/include/binder/IAppOpsService.h deleted file mode 100644 index 7cb55e5..0000000 --- a/external/android/include/18/frameworks/native/include/binder/IAppOpsService.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2013 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_IAPP_OPS_SERVICE_H -#define ANDROID_IAPP_OPS_SERVICE_H - -#include -#include - -namespace android { - -// ---------------------------------------------------------------------- - -class IAppOpsService : public IInterface -{ -public: - DECLARE_META_INTERFACE(AppOpsService); - - virtual int32_t checkOperation(int32_t code, int32_t uid, const String16& packageName) = 0; - virtual int32_t noteOperation(int32_t code, int32_t uid, const String16& packageName) = 0; - virtual int32_t startOperation(int32_t code, int32_t uid, const String16& packageName) = 0; - virtual void finishOperation(int32_t code, int32_t uid, const String16& packageName) = 0; - virtual void startWatchingMode(int32_t op, const String16& packageName, - const sp& callback) = 0; - virtual void stopWatchingMode(const sp& callback) = 0; - - enum { - CHECK_OPERATION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION, - NOTE_OPERATION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+1, - START_OPERATION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+2, - FINISH_OPERATION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+3, - START_WATCHING_MODE_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+4, - STOP_WATCHING_MODE_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+5 - }; - - enum { - MODE_ALLOWED = 0, - MODE_IGNORED = 1, - MODE_ERRORED = 2 - }; -}; - -// ---------------------------------------------------------------------- - -class BnAppOpsService : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IAPP_OPS_SERVICE_H diff --git a/external/android/include/18/frameworks/native/include/binder/IBinder.h b/external/android/include/18/frameworks/native/include/binder/IBinder.h deleted file mode 100644 index 8b84951..0000000 --- a/external/android/include/18/frameworks/native/include/binder/IBinder.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_IBINDER_H -#define ANDROID_IBINDER_H - -#include -#include -#include -#include - - -#define B_PACK_CHARS(c1, c2, c3, c4) \ - ((((c1)<<24)) | (((c2)<<16)) | (((c3)<<8)) | (c4)) - -// --------------------------------------------------------------------------- -namespace android { - -class BBinder; -class BpBinder; -class IInterface; -class Parcel; - -/** - * Base class and low-level protocol for a remotable object. - * You can derive from this class to create an object for which other - * processes can hold references to it. Communication between processes - * (method calls, property get and set) is down through a low-level - * protocol implemented on top of the transact() API. - */ -class IBinder : public virtual RefBase -{ -public: - enum { - FIRST_CALL_TRANSACTION = 0x00000001, - LAST_CALL_TRANSACTION = 0x00ffffff, - - PING_TRANSACTION = B_PACK_CHARS('_','P','N','G'), - DUMP_TRANSACTION = B_PACK_CHARS('_','D','M','P'), - INTERFACE_TRANSACTION = B_PACK_CHARS('_', 'N', 'T', 'F'), - SYSPROPS_TRANSACTION = B_PACK_CHARS('_', 'S', 'P', 'R'), - - // Corresponds to TF_ONE_WAY -- an asynchronous call. - FLAG_ONEWAY = 0x00000001 - }; - - IBinder(); - - /** - * Check if this IBinder implements the interface named by - * @a descriptor. If it does, the base pointer to it is returned, - * which you can safely static_cast<> to the concrete C++ interface. - */ - virtual sp queryLocalInterface(const String16& descriptor); - - /** - * Return the canonical name of the interface provided by this IBinder - * object. - */ - virtual const String16& getInterfaceDescriptor() const = 0; - - virtual bool isBinderAlive() const = 0; - virtual status_t pingBinder() = 0; - virtual status_t dump(int fd, const Vector& args) = 0; - - virtual status_t transact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0) = 0; - - /** - * This method allows you to add data that is transported through - * IPC along with your IBinder pointer. When implementing a Binder - * object, override it to write your desired data in to @a outData. - * You can then call getConstantData() on your IBinder to retrieve - * that data, from any process. You MUST return the number of bytes - * written in to the parcel (including padding). - */ - class DeathRecipient : public virtual RefBase - { - public: - virtual void binderDied(const wp& who) = 0; - }; - - /** - * Register the @a recipient for a notification if this binder - * goes away. If this binder object unexpectedly goes away - * (typically because its hosting process has been killed), - * then DeathRecipient::binderDied() will be called with a reference - * to this. - * - * The @a cookie is optional -- if non-NULL, it should be a - * memory address that you own (that is, you know it is unique). - * - * @note You will only receive death notifications for remote binders, - * as local binders by definition can't die without you dying as well. - * Trying to use this function on a local binder will result in an - * INVALID_OPERATION code being returned and nothing happening. - * - * @note This link always holds a weak reference to its recipient. - * - * @note You will only receive a weak reference to the dead - * binder. You should not try to promote this to a strong reference. - * (Nor should you need to, as there is nothing useful you can - * directly do with it now that it has passed on.) - */ - virtual status_t linkToDeath(const sp& recipient, - void* cookie = NULL, - uint32_t flags = 0) = 0; - - /** - * Remove a previously registered death notification. - * The @a recipient will no longer be called if this object - * dies. The @a cookie is optional. If non-NULL, you can - * supply a NULL @a recipient, and the recipient previously - * added with that cookie will be unlinked. - */ - virtual status_t unlinkToDeath( const wp& recipient, - void* cookie = NULL, - uint32_t flags = 0, - wp* outRecipient = NULL) = 0; - - virtual bool checkSubclass(const void* subclassID) const; - - typedef void (*object_cleanup_func)(const void* id, void* obj, void* cleanupCookie); - - virtual void attachObject( const void* objectID, - void* object, - void* cleanupCookie, - object_cleanup_func func) = 0; - virtual void* findObject(const void* objectID) const = 0; - virtual void detachObject(const void* objectID) = 0; - - virtual BBinder* localBinder(); - virtual BpBinder* remoteBinder(); - -protected: - virtual ~IBinder(); - -private: -}; - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_IBINDER_H diff --git a/external/android/include/18/frameworks/native/include/binder/IInterface.h b/external/android/include/18/frameworks/native/include/binder/IInterface.h deleted file mode 100644 index 5f9f69c..0000000 --- a/external/android/include/18/frameworks/native/include/binder/IInterface.h +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (C) 2005 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_IINTERFACE_H -#define ANDROID_IINTERFACE_H - -#include - -namespace android { - -// ---------------------------------------------------------------------- - -class IInterface : public virtual RefBase -{ -public: - IInterface(); - sp asBinder(); - sp asBinder() const; - -protected: - virtual ~IInterface(); - virtual IBinder* onAsBinder() = 0; -}; - -// ---------------------------------------------------------------------- - -template -inline sp interface_cast(const sp& obj) -{ - return INTERFACE::asInterface(obj); -} - -// ---------------------------------------------------------------------- - -template -class BnInterface : public INTERFACE, public BBinder -{ -public: - virtual sp queryLocalInterface(const String16& _descriptor); - virtual const String16& getInterfaceDescriptor() const; - -protected: - virtual IBinder* onAsBinder(); -}; - -// ---------------------------------------------------------------------- - -template -class BpInterface : public INTERFACE, public BpRefBase -{ -public: - BpInterface(const sp& remote); - -protected: - virtual IBinder* onAsBinder(); -}; - -// ---------------------------------------------------------------------- - -#define DECLARE_META_INTERFACE(INTERFACE) \ - static const android::String16 descriptor; \ - static android::sp asInterface( \ - const android::sp& obj); \ - virtual const android::String16& getInterfaceDescriptor() const; \ - I##INTERFACE(); \ - virtual ~I##INTERFACE(); \ - - -#define IMPLEMENT_META_INTERFACE(INTERFACE, NAME) \ - const android::String16 I##INTERFACE::descriptor(NAME); \ - const android::String16& \ - I##INTERFACE::getInterfaceDescriptor() const { \ - return I##INTERFACE::descriptor; \ - } \ - android::sp I##INTERFACE::asInterface( \ - const android::sp& obj) \ - { \ - android::sp intr; \ - if (obj != NULL) { \ - intr = static_cast( \ - obj->queryLocalInterface( \ - I##INTERFACE::descriptor).get()); \ - if (intr == NULL) { \ - intr = new Bp##INTERFACE(obj); \ - } \ - } \ - return intr; \ - } \ - I##INTERFACE::I##INTERFACE() { } \ - I##INTERFACE::~I##INTERFACE() { } \ - - -#define CHECK_INTERFACE(interface, data, reply) \ - if (!data.checkInterface(this)) { return PERMISSION_DENIED; } \ - - -// ---------------------------------------------------------------------- -// No user-serviceable parts after this... - -template -inline sp BnInterface::queryLocalInterface( - const String16& _descriptor) -{ - if (_descriptor == INTERFACE::descriptor) return this; - return NULL; -} - -template -inline const String16& BnInterface::getInterfaceDescriptor() const -{ - return INTERFACE::getInterfaceDescriptor(); -} - -template -IBinder* BnInterface::onAsBinder() -{ - return this; -} - -template -inline BpInterface::BpInterface(const sp& remote) - : BpRefBase(remote) -{ -} - -template -inline IBinder* BpInterface::onAsBinder() -{ - return remote(); -} - -// ---------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IINTERFACE_H diff --git a/external/android/include/18/frameworks/native/include/binder/IMemory.h b/external/android/include/18/frameworks/native/include/binder/IMemory.h deleted file mode 100644 index 2d0db00..0000000 --- a/external/android/include/18/frameworks/native/include/binder/IMemory.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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_IMEMORY_H -#define ANDROID_IMEMORY_H - -#include -#include -#include - -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class IMemoryHeap : public IInterface -{ -public: - DECLARE_META_INTERFACE(MemoryHeap); - - // flags returned by getFlags() - enum { - READ_ONLY = 0x00000001 - }; - - virtual int getHeapID() const = 0; - virtual void* getBase() const = 0; - virtual size_t getSize() const = 0; - virtual uint32_t getFlags() const = 0; - virtual uint32_t getOffset() const = 0; - - // these are there just for backward source compatibility - int32_t heapID() const { return getHeapID(); } - void* base() const { return getBase(); } - size_t virtualSize() const { return getSize(); } -}; - -class BnMemoryHeap : public BnInterface -{ -public: - virtual status_t onTransact( - uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); - - BnMemoryHeap(); -protected: - virtual ~BnMemoryHeap(); -}; - -// ---------------------------------------------------------------------------- - -class IMemory : public IInterface -{ -public: - DECLARE_META_INTERFACE(Memory); - - virtual sp getMemory(ssize_t* offset=0, size_t* size=0) const = 0; - - // helpers - void* fastPointer(const sp& heap, ssize_t offset) const; - void* pointer() const; - size_t size() const; - ssize_t offset() const; -}; - -class BnMemory : public BnInterface -{ -public: - virtual status_t onTransact( - uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); - - BnMemory(); -protected: - virtual ~BnMemory(); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IMEMORY_H diff --git a/external/android/include/18/frameworks/native/include/binder/IPCThreadState.h b/external/android/include/18/frameworks/native/include/binder/IPCThreadState.h deleted file mode 100644 index 3378d97..0000000 --- a/external/android/include/18/frameworks/native/include/binder/IPCThreadState.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (C) 2005 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_IPC_THREAD_STATE_H -#define ANDROID_IPC_THREAD_STATE_H - -#include -#include -#include -#include - -#ifdef HAVE_WIN32_PROC -typedef int uid_t; -#endif - -// --------------------------------------------------------------------------- -namespace android { - -class IPCThreadState -{ -public: - static IPCThreadState* self(); - static IPCThreadState* selfOrNull(); // self(), but won't instantiate - - sp process(); - - status_t clearLastError(); - - int getCallingPid(); - int getCallingUid(); - - void setStrictModePolicy(int32_t policy); - int32_t getStrictModePolicy() const; - - void setLastTransactionBinderFlags(int32_t flags); - int32_t getLastTransactionBinderFlags() const; - - int64_t clearCallingIdentity(); - void restoreCallingIdentity(int64_t token); - - void flushCommands(); - - void joinThreadPool(bool isMain = true); - - // Stop the local process. - void stopProcess(bool immediate = true); - - status_t transact(int32_t handle, - uint32_t code, const Parcel& data, - Parcel* reply, uint32_t flags); - - void incStrongHandle(int32_t handle); - void decStrongHandle(int32_t handle); - void incWeakHandle(int32_t handle); - void decWeakHandle(int32_t handle); - status_t attemptIncStrongHandle(int32_t handle); - static void expungeHandle(int32_t handle, IBinder* binder); - status_t requestDeathNotification( int32_t handle, - BpBinder* proxy); - status_t clearDeathNotification( int32_t handle, - BpBinder* proxy); - - static void shutdown(); - - // Call this to disable switching threads to background scheduling when - // receiving incoming IPC calls. This is specifically here for the - // Android system process, since it expects to have background apps calling - // in to it but doesn't want to acquire locks in its services while in - // the background. - static void disableBackgroundScheduling(bool disable); - -private: - IPCThreadState(); - ~IPCThreadState(); - - status_t sendReply(const Parcel& reply, uint32_t flags); - status_t waitForResponse(Parcel *reply, - status_t *acquireResult=NULL); - status_t talkWithDriver(bool doReceive=true); - status_t writeTransactionData(int32_t cmd, - uint32_t binderFlags, - int32_t handle, - uint32_t code, - const Parcel& data, - status_t* statusBuffer); - status_t executeCommand(int32_t command); - - void clearCaller(); - - static void threadDestructor(void *st); - static void freeBuffer(Parcel* parcel, - const uint8_t* data, size_t dataSize, - const size_t* objects, size_t objectsSize, - void* cookie); - - const sp mProcess; - const pid_t mMyThreadId; - Vector mPendingStrongDerefs; - Vector mPendingWeakDerefs; - - Parcel mIn; - Parcel mOut; - status_t mLastError; - pid_t mCallingPid; - uid_t mCallingUid; - int32_t mStrictModePolicy; - int32_t mLastTransactionBinderFlags; -}; - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_IPC_THREAD_STATE_H diff --git a/external/android/include/18/frameworks/native/include/binder/IPermissionController.h b/external/android/include/18/frameworks/native/include/binder/IPermissionController.h deleted file mode 100644 index f9d371b..0000000 --- a/external/android/include/18/frameworks/native/include/binder/IPermissionController.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2005 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_IPERMISSION_CONTROLLER_H -#define ANDROID_IPERMISSION_CONTROLLER_H - -#include - -namespace android { - -// ---------------------------------------------------------------------- - -class IPermissionController : public IInterface -{ -public: - DECLARE_META_INTERFACE(PermissionController); - - virtual bool checkPermission(const String16& permission, - int32_t pid, int32_t uid) = 0; - - enum { - CHECK_PERMISSION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION - }; -}; - -// ---------------------------------------------------------------------- - -class BnPermissionController : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IPERMISSION_CONTROLLER_H - diff --git a/external/android/include/18/frameworks/native/include/binder/IServiceManager.h b/external/android/include/18/frameworks/native/include/binder/IServiceManager.h deleted file mode 100644 index 2c297d6..0000000 --- a/external/android/include/18/frameworks/native/include/binder/IServiceManager.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2005 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_ISERVICE_MANAGER_H -#define ANDROID_ISERVICE_MANAGER_H - -#include -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------- - -class IServiceManager : public IInterface -{ -public: - DECLARE_META_INTERFACE(ServiceManager); - - /** - * Retrieve an existing service, blocking for a few seconds - * if it doesn't yet exist. - */ - virtual sp getService( const String16& name) const = 0; - - /** - * Retrieve an existing service, non-blocking. - */ - virtual sp checkService( const String16& name) const = 0; - - /** - * Register a service. - */ - virtual status_t addService( const String16& name, - const sp& service, - bool allowIsolated = false) = 0; - - /** - * Return list of all existing services. - */ - virtual Vector listServices() = 0; - - enum { - GET_SERVICE_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION, - CHECK_SERVICE_TRANSACTION, - ADD_SERVICE_TRANSACTION, - LIST_SERVICES_TRANSACTION, - }; -}; - -sp defaultServiceManager(); - -template -status_t getService(const String16& name, sp* outService) -{ - const sp sm = defaultServiceManager(); - if (sm != NULL) { - *outService = interface_cast(sm->getService(name)); - if ((*outService) != NULL) return NO_ERROR; - } - return NAME_NOT_FOUND; -} - -bool checkCallingPermission(const String16& permission); -bool checkCallingPermission(const String16& permission, - int32_t* outPid, int32_t* outUid); -bool checkPermission(const String16& permission, pid_t pid, uid_t uid); - - -// ---------------------------------------------------------------------- - -class BnServiceManager : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_ISERVICE_MANAGER_H - diff --git a/external/android/include/18/frameworks/native/include/binder/MemoryBase.h b/external/android/include/18/frameworks/native/include/binder/MemoryBase.h deleted file mode 100644 index 463e26d..0000000 --- a/external/android/include/18/frameworks/native/include/binder/MemoryBase.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_MEMORY_BASE_H -#define ANDROID_MEMORY_BASE_H - -#include -#include - -#include - - -namespace android { - -// --------------------------------------------------------------------------- - -class MemoryBase : public BnMemory -{ -public: - MemoryBase(const sp& heap, ssize_t offset, size_t size); - virtual ~MemoryBase(); - virtual sp getMemory(ssize_t* offset, size_t* size) const; - -protected: - size_t getSize() const { return mSize; } - ssize_t getOffset() const { return mOffset; } - const sp& getHeap() const { return mHeap; } - -private: - size_t mSize; - ssize_t mOffset; - sp mHeap; -}; - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_MEMORY_BASE_H diff --git a/external/android/include/18/frameworks/native/include/binder/MemoryDealer.h b/external/android/include/18/frameworks/native/include/binder/MemoryDealer.h deleted file mode 100644 index 170f20d..0000000 --- a/external/android/include/18/frameworks/native/include/binder/MemoryDealer.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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_MEMORY_DEALER_H -#define ANDROID_MEMORY_DEALER_H - - -#include -#include - -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class SimpleBestFitAllocator; - -// ---------------------------------------------------------------------------- - -class MemoryDealer : public RefBase -{ -public: - MemoryDealer(size_t size, const char* name = 0); - - virtual sp allocate(size_t size); - virtual void deallocate(size_t offset); - virtual void dump(const char* what) const; - - sp getMemoryHeap() const { return heap(); } - -protected: - virtual ~MemoryDealer(); - -private: - const sp& heap() const; - SimpleBestFitAllocator* allocator() const; - - sp mHeap; - SimpleBestFitAllocator* mAllocator; -}; - - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_MEMORY_DEALER_H diff --git a/external/android/include/18/frameworks/native/include/binder/MemoryHeapBase.h b/external/android/include/18/frameworks/native/include/binder/MemoryHeapBase.h deleted file mode 100644 index ea9b66c..0000000 --- a/external/android/include/18/frameworks/native/include/binder/MemoryHeapBase.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_MEMORY_HEAP_BASE_H -#define ANDROID_MEMORY_HEAP_BASE_H - -#include -#include - -#include - - -namespace android { - -// --------------------------------------------------------------------------- - -class MemoryHeapBase : public virtual BnMemoryHeap -{ -public: - enum { - READ_ONLY = IMemoryHeap::READ_ONLY, - // memory won't be mapped locally, but will be mapped in the remote - // process. - DONT_MAP_LOCALLY = 0x00000100, - NO_CACHING = 0x00000200 - }; - - /* - * maps the memory referenced by fd. but DOESN'T take ownership - * of the filedescriptor (it makes a copy with dup() - */ - MemoryHeapBase(int fd, size_t size, uint32_t flags = 0, uint32_t offset = 0); - - /* - * maps memory from the given device - */ - MemoryHeapBase(const char* device, size_t size = 0, uint32_t flags = 0); - - /* - * maps memory from ashmem, with the given name for debugging - */ - MemoryHeapBase(size_t size, uint32_t flags = 0, char const* name = NULL); - - virtual ~MemoryHeapBase(); - - /* implement IMemoryHeap interface */ - virtual int getHeapID() const; - - /* virtual address of the heap. returns MAP_FAILED in case of error */ - virtual void* getBase() const; - - virtual size_t getSize() const; - virtual uint32_t getFlags() const; - virtual uint32_t getOffset() const; - - const char* getDevice() const; - - /* this closes this heap -- use carefully */ - void dispose(); - - /* this is only needed as a workaround, use only if you know - * what you are doing */ - status_t setDevice(const char* device) { - if (mDevice == 0) - mDevice = device; - return mDevice ? NO_ERROR : ALREADY_EXISTS; - } - -protected: - MemoryHeapBase(); - // init() takes ownership of fd - status_t init(int fd, void *base, int size, - int flags = 0, const char* device = NULL); - -private: - status_t mapfd(int fd, size_t size, uint32_t offset = 0); - - int mFD; - size_t mSize; - void* mBase; - uint32_t mFlags; - const char* mDevice; - bool mNeedUnmap; - uint32_t mOffset; -}; - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_MEMORY_HEAP_BASE_H diff --git a/external/android/include/18/frameworks/native/include/binder/Parcel.h b/external/android/include/18/frameworks/native/include/binder/Parcel.h deleted file mode 100644 index 3ff95d2..0000000 --- a/external/android/include/18/frameworks/native/include/binder/Parcel.h +++ /dev/null @@ -1,346 +0,0 @@ -/* - * Copyright (C) 2005 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_PARCEL_H -#define ANDROID_PARCEL_H - -#include -#include -#include -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -template class LightFlattenable; -class Flattenable; -class IBinder; -class IPCThreadState; -class ProcessState; -class String8; -class TextOutput; - -struct flat_binder_object; // defined in support_p/binder_module.h - -class Parcel -{ -public: - class ReadableBlob; - class WritableBlob; - - Parcel(); - ~Parcel(); - - const uint8_t* data() const; - size_t dataSize() const; - size_t dataAvail() const; - size_t dataPosition() const; - size_t dataCapacity() const; - - status_t setDataSize(size_t size); - void setDataPosition(size_t pos) const; - status_t setDataCapacity(size_t size); - - status_t setData(const uint8_t* buffer, size_t len); - - status_t appendFrom(const Parcel *parcel, - size_t start, size_t len); - - bool pushAllowFds(bool allowFds); - void restoreAllowFds(bool lastValue); - - bool hasFileDescriptors() const; - - // Writes the RPC header. - status_t writeInterfaceToken(const String16& interface); - - // Parses the RPC header, returning true if the interface name - // in the header matches the expected interface from the caller. - // - // Additionally, enforceInterface does part of the work of - // propagating the StrictMode policy mask, populating the current - // IPCThreadState, which as an optimization may optionally be - // passed in. - bool enforceInterface(const String16& interface, - IPCThreadState* threadState = NULL) const; - bool checkInterface(IBinder*) const; - - void freeData(); - - const size_t* objects() const; - size_t objectsCount() const; - - status_t errorCheck() const; - void setError(status_t err); - - status_t write(const void* data, size_t len); - void* writeInplace(size_t len); - status_t writeUnpadded(const void* data, size_t len); - status_t writeInt32(int32_t val); - status_t writeInt64(int64_t val); - status_t writeFloat(float val); - status_t writeDouble(double val); - status_t writeIntPtr(intptr_t val); - status_t writeCString(const char* str); - status_t writeString8(const String8& str); - status_t writeString16(const String16& str); - status_t writeString16(const char16_t* str, size_t len); - status_t writeStrongBinder(const sp& val); - status_t writeWeakBinder(const wp& val); - status_t write(const Flattenable& val); - - template - status_t write(const LightFlattenable& val); - - - // Place a native_handle into the parcel (the native_handle's file- - // descriptors are dup'ed, so it is safe to delete the native_handle - // when this function returns). - // Doesn't take ownership of the native_handle. - status_t writeNativeHandle(const native_handle* handle); - - // Place a file descriptor into the parcel. The given fd must remain - // valid for the lifetime of the parcel. - // The Parcel does not take ownership of the given fd unless you ask it to. - status_t writeFileDescriptor(int fd, bool takeOwnership = false); - - // Place a file descriptor into the parcel. A dup of the fd is made, which - // will be closed once the parcel is destroyed. - status_t writeDupFileDescriptor(int fd); - - // Writes a blob to the parcel. - // If the blob is small, then it is stored in-place, otherwise it is - // transferred by way of an anonymous shared memory region. - // The caller should call release() on the blob after writing its contents. - status_t writeBlob(size_t len, WritableBlob* outBlob); - - status_t writeObject(const flat_binder_object& val, bool nullMetaData); - - // Like Parcel.java's writeNoException(). Just writes a zero int32. - // Currently the native implementation doesn't do any of the StrictMode - // stack gathering and serialization that the Java implementation does. - status_t writeNoException(); - - void remove(size_t start, size_t amt); - - status_t read(void* outData, size_t len) const; - const void* readInplace(size_t len) const; - int32_t readInt32() const; - status_t readInt32(int32_t *pArg) const; - int64_t readInt64() const; - status_t readInt64(int64_t *pArg) const; - float readFloat() const; - status_t readFloat(float *pArg) const; - double readDouble() const; - status_t readDouble(double *pArg) const; - intptr_t readIntPtr() const; - status_t readIntPtr(intptr_t *pArg) const; - - const char* readCString() const; - String8 readString8() const; - String16 readString16() const; - const char16_t* readString16Inplace(size_t* outLen) const; - sp readStrongBinder() const; - wp readWeakBinder() const; - status_t read(Flattenable& val) const; - - template - status_t read(LightFlattenable& val) const; - - // Like Parcel.java's readExceptionCode(). Reads the first int32 - // off of a Parcel's header, returning 0 or the negative error - // code on exceptions, but also deals with skipping over rich - // response headers. Callers should use this to read & parse the - // response headers rather than doing it by hand. - int32_t readExceptionCode() const; - - // Retrieve native_handle from the parcel. This returns a copy of the - // parcel's native_handle (the caller takes ownership). The caller - // must free the native_handle with native_handle_close() and - // native_handle_delete(). - native_handle* readNativeHandle() const; - - - // Retrieve a file descriptor from the parcel. This returns the raw fd - // in the parcel, which you do not own -- use dup() to get your own copy. - int readFileDescriptor() const; - - // Reads a blob from the parcel. - // The caller should call release() on the blob after reading its contents. - status_t readBlob(size_t len, ReadableBlob* outBlob) const; - - const flat_binder_object* readObject(bool nullMetaData) const; - - // Explicitly close all file descriptors in the parcel. - void closeFileDescriptors(); - - typedef void (*release_func)(Parcel* parcel, - const uint8_t* data, size_t dataSize, - const size_t* objects, size_t objectsSize, - void* cookie); - - const uint8_t* ipcData() const; - size_t ipcDataSize() const; - const size_t* ipcObjects() const; - size_t ipcObjectsCount() const; - void ipcSetDataReference(const uint8_t* data, size_t dataSize, - const size_t* objects, size_t objectsCount, - release_func relFunc, void* relCookie); - - void print(TextOutput& to, uint32_t flags = 0) const; - -private: - Parcel(const Parcel& o); - Parcel& operator=(const Parcel& o); - - status_t finishWrite(size_t len); - void releaseObjects(); - void acquireObjects(); - status_t growData(size_t len); - status_t restartWrite(size_t desired); - status_t continueWrite(size_t desired); - void freeDataNoInit(); - void initState(); - void scanForFds() const; - - template - status_t readAligned(T *pArg) const; - - template T readAligned() const; - - template - status_t writeAligned(T val); - - status_t mError; - uint8_t* mData; - size_t mDataSize; - size_t mDataCapacity; - mutable size_t mDataPos; - size_t* mObjects; - size_t mObjectsSize; - size_t mObjectsCapacity; - mutable size_t mNextObjectHint; - - mutable bool mFdsKnown; - mutable bool mHasFds; - bool mAllowFds; - - release_func mOwner; - void* mOwnerCookie; - - class Blob { - public: - Blob(); - ~Blob(); - - void release(); - inline size_t size() const { return mSize; } - - protected: - void init(bool mapped, void* data, size_t size); - void clear(); - - bool mMapped; - void* mData; - size_t mSize; - }; - -public: - class ReadableBlob : public Blob { - friend class Parcel; - public: - inline const void* data() const { return mData; } - }; - - class WritableBlob : public Blob { - friend class Parcel; - public: - inline void* data() { return mData; } - }; -}; - -// --------------------------------------------------------------------------- - -template -status_t Parcel::write(const LightFlattenable& val) { - size_t size(val.getSize()); - if (!val.isFixedSize()) { - status_t err = writeInt32(size); - if (err != NO_ERROR) { - return err; - } - } - if (size) { - void* buffer = writeInplace(size); - return buffer == NULL ? NO_MEMORY : - val.flatten(buffer); - } - return NO_ERROR; -} - -template -status_t Parcel::read(LightFlattenable& val) const { - size_t size; - if (val.isFixedSize()) { - size = val.getSize(); - } else { - int32_t s; - status_t err = readInt32(&s); - if (err != NO_ERROR) { - return err; - } - size = s; - } - if (size) { - void const* buffer = readInplace(size); - return buffer == NULL ? NO_MEMORY : - val.unflatten(buffer, size); - } - return NO_ERROR; -} - -// --------------------------------------------------------------------------- - -inline TextOutput& operator<<(TextOutput& to, const Parcel& parcel) -{ - parcel.print(to); - return to; -} - -// --------------------------------------------------------------------------- - -// Generic acquire and release of objects. -void acquire_object(const sp& proc, - const flat_binder_object& obj, const void* who); -void release_object(const sp& proc, - const flat_binder_object& obj, const void* who); - -void flatten_binder(const sp& proc, - const sp& binder, flat_binder_object* out); -void flatten_binder(const sp& proc, - const wp& binder, flat_binder_object* out); -status_t unflatten_binder(const sp& proc, - const flat_binder_object& flat, sp* out); -status_t unflatten_binder(const sp& proc, - const flat_binder_object& flat, wp* out); - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_PARCEL_H diff --git a/external/android/include/18/frameworks/native/include/binder/PermissionCache.h b/external/android/include/18/frameworks/native/include/binder/PermissionCache.h deleted file mode 100644 index bcdf0c2..0000000 --- a/external/android/include/18/frameworks/native/include/binder/PermissionCache.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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 BINDER_PERMISSION_H -#define BINDER_PERMISSION_H - -#include -#include - -#include -#include -#include - -namespace android { -// --------------------------------------------------------------------------- - -/* - * PermissionCache caches permission checks for a given uid. - * - * Currently the cache is not updated when there is a permission change, - * for instance when an application is uninstalled. - * - * IMPORTANT: for the reason stated above, only system permissions are safe - * to cache. This restriction may be lifted at a later time. - * - */ - -class PermissionCache : Singleton { - struct Entry { - String16 name; - uid_t uid; - bool granted; - inline bool operator < (const Entry& e) const { - return (uid == e.uid) ? (name < e.name) : (uid < e.uid); - } - }; - mutable Mutex mLock; - // we pool all the permission names we see, as many permissions checks - // will have identical names - SortedVector< String16 > mPermissionNamesPool; - // this is our cache per say. it stores pooled names. - SortedVector< Entry > mCache; - - // free the whole cache, but keep the permission name pool - void purge(); - - status_t check(bool* granted, - const String16& permission, uid_t uid) const; - - void cache(const String16& permission, uid_t uid, bool granted); - -public: - PermissionCache(); - - static bool checkCallingPermission(const String16& permission); - - static bool checkCallingPermission(const String16& permission, - int32_t* outPid, int32_t* outUid); - - static bool checkPermission(const String16& permission, - pid_t pid, uid_t uid); -}; - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif /* BINDER_PERMISSION_H */ diff --git a/external/android/include/18/frameworks/native/include/binder/ProcessState.h b/external/android/include/18/frameworks/native/include/binder/ProcessState.h deleted file mode 100644 index e63a0d0..0000000 --- a/external/android/include/18/frameworks/native/include/binder/ProcessState.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (C) 2005 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_PROCESS_STATE_H -#define ANDROID_PROCESS_STATE_H - -#include -#include -#include -#include - -#include - -// --------------------------------------------------------------------------- -namespace android { - -// Global variables -extern int mArgC; -extern const char* const* mArgV; -extern int mArgLen; - -class IPCThreadState; - -class ProcessState : public virtual RefBase -{ -public: - static sp self(); - - void setContextObject(const sp& object); - sp getContextObject(const sp& caller); - - void setContextObject(const sp& object, - const String16& name); - sp getContextObject(const String16& name, - const sp& caller); - - void startThreadPool(); - - typedef bool (*context_check_func)(const String16& name, - const sp& caller, - void* userData); - - bool isContextManager(void) const; - bool becomeContextManager( - context_check_func checkFunc, - void* userData); - - sp getStrongProxyForHandle(int32_t handle); - wp getWeakProxyForHandle(int32_t handle); - void expungeHandle(int32_t handle, IBinder* binder); - - void setArgs(int argc, const char* const argv[]); - int getArgC() const; - const char* const* getArgV() const; - - void setArgV0(const char* txt); - - void spawnPooledThread(bool isMain); - - status_t setThreadPoolMaxThreadCount(size_t maxThreads); - void giveThreadPoolName(); - -private: - friend class IPCThreadState; - - ProcessState(); - ~ProcessState(); - - ProcessState(const ProcessState& o); - ProcessState& operator=(const ProcessState& o); - String8 makeBinderThreadName(); - - struct handle_entry { - IBinder* binder; - RefBase::weakref_type* refs; - }; - - handle_entry* lookupHandleLocked(int32_t handle); - - int mDriverFD; - void* mVMStart; - - mutable Mutex mLock; // protects everything below. - - VectormHandleToObject; - - bool mManagesContexts; - context_check_func mBinderContextCheckFunc; - void* mBinderContextUserData; - - KeyedVector > - mContexts; - - - String8 mRootDir; - bool mThreadPoolStarted; - volatile int32_t mThreadPoolSeq; -}; - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_PROCESS_STATE_H diff --git a/external/android/include/18/frameworks/native/include/gui/BitTube.h b/external/android/include/18/frameworks/native/include/gui/BitTube.h deleted file mode 100644 index 3022d05..0000000 --- a/external/android/include/18/frameworks/native/include/gui/BitTube.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_SENSOR_CHANNEL_H -#define ANDROID_GUI_SENSOR_CHANNEL_H - -#include -#include - -#include -#include -#include - - -namespace android { -// ---------------------------------------------------------------------------- -class Parcel; - -class BitTube : public RefBase -{ -public: - - BitTube(); - BitTube(const Parcel& data); - virtual ~BitTube(); - - status_t initCheck() const; - int getFd() const; - ssize_t write(void const* vaddr, size_t size); - ssize_t read(void* vaddr, size_t size); - - status_t writeToParcel(Parcel* reply) const; - - template - static ssize_t sendObjects(const sp& tube, - T const* events, size_t count) { - return sendObjects(tube, events, count, sizeof(T)); - } - - template - static ssize_t recvObjects(const sp& tube, - T* events, size_t count) { - return recvObjects(tube, events, count, sizeof(T)); - } - -private: - int mSendFd; - mutable int mReceiveFd; - - static ssize_t sendObjects(const sp& tube, - void const* events, size_t count, size_t objSize); - - static ssize_t recvObjects(const sp& tube, - void* events, size_t count, size_t objSize); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_SENSOR_CHANNEL_H diff --git a/external/android/include/18/frameworks/native/include/gui/BufferItemConsumer.h b/external/android/include/18/frameworks/native/include/gui/BufferItemConsumer.h deleted file mode 100644 index 98b450c..0000000 --- a/external/android/include/18/frameworks/native/include/gui/BufferItemConsumer.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (C) 2012 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_GUI_BUFFERITEMCONSUMER_H -#define ANDROID_GUI_BUFFERITEMCONSUMER_H - -#include - -#include - -#include -#include -#include - -#define ANDROID_GRAPHICS_BUFFERITEMCONSUMER_JNI_ID "mBufferItemConsumer" - -namespace android { - -/** - * BufferItemConsumer is a BufferQueue consumer endpoint that allows clients - * access to the whole BufferItem entry from BufferQueue. Multiple buffers may - * be acquired at once, to be used concurrently by the client. This consumer can - * operate either in synchronous or asynchronous mode. - */ -class BufferItemConsumer: public ConsumerBase -{ - public: - typedef ConsumerBase::FrameAvailableListener FrameAvailableListener; - - typedef BufferQueue::BufferItem BufferItem; - - enum { INVALID_BUFFER_SLOT = BufferQueue::INVALID_BUFFER_SLOT }; - enum { NO_BUFFER_AVAILABLE = BufferQueue::NO_BUFFER_AVAILABLE }; - - // Create a new buffer item consumer. The consumerUsage parameter determines - // the consumer usage flags passed to the graphics allocator. The - // bufferCount parameter specifies how many buffers can be locked for user - // access at the same time. - BufferItemConsumer(uint32_t consumerUsage, - int bufferCount = BufferQueue::MIN_UNDEQUEUED_BUFFERS, - bool synchronousMode = false); - - virtual ~BufferItemConsumer(); - - // set the name of the BufferItemConsumer that will be used to identify it in - // log messages. - void setName(const String8& name); - - // Gets the next graphics buffer from the producer, filling out the - // passed-in BufferItem structure. Returns NO_BUFFER_AVAILABLE if the queue - // of buffers is empty, and INVALID_OPERATION if the maximum number of - // buffers is already acquired. - // - // Only a fixed number of buffers can be acquired at a time, determined by - // the construction-time bufferCount parameter. If INVALID_OPERATION is - // returned by acquireBuffer, then old buffers must be returned to the - // queue by calling releaseBuffer before more buffers can be acquired. - // - // If waitForFence is true, and the acquired BufferItem has a valid fence object, - // acquireBuffer will wait on the fence with no timeout before returning. - status_t acquireBuffer(BufferItem *item, bool waitForFence = true); - - // Returns an acquired buffer to the queue, allowing it to be reused. Since - // only a fixed number of buffers may be acquired at a time, old buffers - // must be released by calling releaseBuffer to ensure new buffers can be - // acquired by acquireBuffer. Once a BufferItem is released, the caller must - // not access any members of the BufferItem, and should immediately remove - // all of its references to the BufferItem itself. - status_t releaseBuffer(const BufferItem &item, - const sp& releaseFence = Fence::NO_FENCE); - - sp getProducerInterface() const { return getBufferQueue(); } - - // setDefaultBufferSize is used to set the size of buffers returned by - // requestBuffers when a with and height of zero is requested. - status_t setDefaultBufferSize(uint32_t w, uint32_t h); - - // setDefaultBufferFormat allows the BufferQueue to create - // GraphicBuffers of a defaultFormat if no format is specified - // in dequeueBuffer - status_t setDefaultBufferFormat(uint32_t defaultFormat); -}; - -} // namespace android - -#endif // ANDROID_GUI_CPUCONSUMER_H diff --git a/external/android/include/18/frameworks/native/include/gui/BufferQueue.h b/external/android/include/18/frameworks/native/include/gui/BufferQueue.h deleted file mode 100644 index 6c1b691..0000000 --- a/external/android/include/18/frameworks/native/include/gui/BufferQueue.h +++ /dev/null @@ -1,638 +0,0 @@ -/* - * Copyright (C) 2012 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_GUI_BUFFERQUEUE_H -#define ANDROID_GUI_BUFFERQUEUE_H - -#include -#include - -#include -#include - -#include -#include - -#include -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class BufferQueue : public BnGraphicBufferProducer { -public: - enum { MIN_UNDEQUEUED_BUFFERS = 2 }; - enum { NUM_BUFFER_SLOTS = 32 }; - enum { NO_CONNECTED_API = 0 }; - enum { INVALID_BUFFER_SLOT = -1 }; - enum { STALE_BUFFER_SLOT = 1, NO_BUFFER_AVAILABLE }; - - // When in async mode we reserve two slots in order to guarantee that the - // producer and consumer can run asynchronously. - enum { MAX_MAX_ACQUIRED_BUFFERS = NUM_BUFFER_SLOTS - 2 }; - - // ConsumerListener is the interface through which the BufferQueue notifies - // the consumer of events that the consumer may wish to react to. Because - // the consumer will generally have a mutex that is locked during calls from - // the consumer to the BufferQueue, these calls from the BufferQueue to the - // consumer *MUST* be called only when the BufferQueue mutex is NOT locked. - struct ConsumerListener : public virtual RefBase { - // onFrameAvailable is called from queueBuffer each time an additional - // frame becomes available for consumption. This means that frames that - // are queued while in asynchronous mode only trigger the callback if no - // previous frames are pending. Frames queued while in synchronous mode - // always trigger the callback. - // - // This is called without any lock held and can be called concurrently - // by multiple threads. - virtual void onFrameAvailable() = 0; - - // onBuffersReleased is called to notify the buffer consumer that the - // BufferQueue has released its references to one or more GraphicBuffers - // contained in its slots. The buffer consumer should then call - // BufferQueue::getReleasedBuffers to retrieve the list of buffers - // - // This is called without any lock held and can be called concurrently - // by multiple threads. - virtual void onBuffersReleased() = 0; - }; - - // ProxyConsumerListener is a ConsumerListener implementation that keeps a weak - // reference to the actual consumer object. It forwards all calls to that - // consumer object so long as it exists. - // - // This class exists to avoid having a circular reference between the - // BufferQueue object and the consumer object. The reason this can't be a weak - // reference in the BufferQueue class is because we're planning to expose the - // consumer side of a BufferQueue as a binder interface, which doesn't support - // weak references. - class ProxyConsumerListener : public BufferQueue::ConsumerListener { - public: - - ProxyConsumerListener(const wp& consumerListener); - virtual ~ProxyConsumerListener(); - virtual void onFrameAvailable(); - virtual void onBuffersReleased(); - - private: - - // mConsumerListener is a weak reference to the ConsumerListener. This is - // the raison d'etre of ProxyConsumerListener. - wp mConsumerListener; - }; - - - // BufferQueue manages a pool of gralloc memory slots to be used by - // producers and consumers. allowSynchronousMode specifies whether or not - // synchronous mode can be enabled by the producer. allocator is used to - // allocate all the needed gralloc buffers. - BufferQueue(bool allowSynchronousMode = true, - const sp& allocator = NULL); - virtual ~BufferQueue(); - - // Query native window attributes. The "what" values are enumerated in - // window.h (e.g. NATIVE_WINDOW_FORMAT). - virtual int query(int what, int* value); - - // setBufferCount updates the number of available buffer slots. If this - // method succeeds, buffer slots will be both unallocated and owned by - // the BufferQueue object (i.e. they are not owned by the producer or - // consumer). - // - // This will fail if the producer has dequeued any buffers, or if - // bufferCount is invalid. bufferCount must generally be a value - // between the minimum undequeued buffer count and NUM_BUFFER_SLOTS - // (inclusive). It may also be set to zero (the default) to indicate - // that the producer does not wish to set a value. The minimum value - // can be obtained by calling query(NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS, - // ...). - // - // This may only be called by the producer. The consumer will be told - // to discard buffers through the onBuffersReleased callback. - virtual status_t setBufferCount(int bufferCount); - - // requestBuffer returns the GraphicBuffer for slot N. - // - // In normal operation, this is called the first time slot N is returned - // by dequeueBuffer. It must be called again if dequeueBuffer returns - // flags indicating that previously-returned buffers are no longer valid. - virtual status_t requestBuffer(int slot, sp* buf); - - // dequeueBuffer gets the next buffer slot index for the producer to use. - // If a buffer slot is available then that slot index is written to the - // location pointed to by the buf argument and a status of OK is returned. - // If no slot is available then a status of -EBUSY is returned and buf is - // unmodified. - // - // The fence parameter will be updated to hold the fence associated with - // the buffer. The contents of the buffer must not be overwritten until the - // fence signals. If the fence is Fence::NO_FENCE, the buffer may be - // written immediately. - // - // The width and height parameters must be no greater than the minimum of - // GL_MAX_VIEWPORT_DIMS and GL_MAX_TEXTURE_SIZE (see: glGetIntegerv). - // An error due to invalid dimensions might not be reported until - // updateTexImage() is called. If width and height are both zero, the - // default values specified by setDefaultBufferSize() are used instead. - // - // The pixel formats are enumerated in graphics.h, e.g. - // HAL_PIXEL_FORMAT_RGBA_8888. If the format is 0, the default format - // will be used. - // - // The usage argument specifies gralloc buffer usage flags. The values - // are enumerated in gralloc.h, e.g. GRALLOC_USAGE_HW_RENDER. These - // will be merged with the usage flags specified by setConsumerUsageBits. - // - // The return value may be a negative error value or a non-negative - // collection of flags. If the flags are set, the return values are - // valid, but additional actions must be performed. - // - // If IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION is set, the - // producer must discard cached GraphicBuffer references for the slot - // returned in buf. - // If IGraphicBufferProducer::RELEASE_ALL_BUFFERS is set, the producer - // must discard cached GraphicBuffer references for all slots. - // - // In both cases, the producer will need to call requestBuffer to get a - // GraphicBuffer handle for the returned slot. - virtual status_t dequeueBuffer(int *buf, sp* fence, - uint32_t width, uint32_t height, uint32_t format, uint32_t usage); - - // queueBuffer returns a filled buffer to the BufferQueue. - // - // Additional data is provided in the QueueBufferInput struct. Notably, - // a timestamp must be provided for the buffer. The timestamp is in - // nanoseconds, and must be monotonically increasing. Its other semantics - // (zero point, etc) are producer-specific and should be documented by the - // producer. - // - // The caller may provide a fence that signals when all rendering - // operations have completed. Alternatively, NO_FENCE may be used, - // indicating that the buffer is ready immediately. - // - // Some values are returned in the output struct: the current settings - // for default width and height, the current transform hint, and the - // number of queued buffers. - virtual status_t queueBuffer(int buf, - const QueueBufferInput& input, QueueBufferOutput* output); - - // cancelBuffer returns a dequeued buffer to the BufferQueue, but doesn't - // queue it for use by the consumer. - // - // The buffer will not be overwritten until the fence signals. The fence - // will usually be the one obtained from dequeueBuffer. - virtual void cancelBuffer(int buf, const sp& fence); - - // setSynchronousMode sets whether dequeueBuffer is synchronous or - // asynchronous. In synchronous mode, dequeueBuffer blocks until - // a buffer is available, the currently bound buffer can be dequeued and - // queued buffers will be acquired in order. In asynchronous mode, - // a queued buffer may be replaced by a subsequently queued buffer. - // - // The default mode is asynchronous. - virtual status_t setSynchronousMode(bool enabled); - - // connect attempts to connect a producer API to the BufferQueue. This - // must be called before any other IGraphicBufferProducer methods are - // called except for getAllocator. A consumer must already be connected. - // - // This method will fail if connect was previously called on the - // BufferQueue and no corresponding disconnect call was made (i.e. if - // it's still connected to a producer). - // - // APIs are enumerated in window.h (e.g. NATIVE_WINDOW_API_CPU). - virtual status_t connect(int api, QueueBufferOutput* output); - - // disconnect attempts to disconnect a producer API from the BufferQueue. - // Calling this method will cause any subsequent calls to other - // IGraphicBufferProducer methods to fail except for getAllocator and connect. - // Successfully calling connect after this will allow the other methods to - // succeed again. - // - // This method will fail if the the BufferQueue is not currently - // connected to the specified producer API. - virtual status_t disconnect(int api); - - // dump our state in a String - virtual void dump(String8& result) const; - virtual void dump(String8& result, const char* prefix, char* buffer, size_t SIZE) const; - - // public facing structure for BufferSlot - struct BufferItem { - - BufferItem() - : - mTransform(0), - mScalingMode(NATIVE_WINDOW_SCALING_MODE_FREEZE), - mTimestamp(0), - mFrameNumber(0), - mBuf(INVALID_BUFFER_SLOT) { - mCrop.makeInvalid(); - } - // mGraphicBuffer points to the buffer allocated for this slot, or is NULL - // if the buffer in this slot has been acquired in the past (see - // BufferSlot.mAcquireCalled). - sp mGraphicBuffer; - - // mCrop is the current crop rectangle for this buffer slot. - Rect mCrop; - - // mTransform is the current transform flags for this buffer slot. - uint32_t mTransform; - - // mScalingMode is the current scaling mode for this buffer slot. - uint32_t mScalingMode; - - // mTimestamp is the current timestamp for this buffer slot. This gets - // to set by queueBuffer each time this slot is queued. - int64_t mTimestamp; - - // mFrameNumber is the number of the queued frame for this slot. - uint64_t mFrameNumber; - - // mBuf is the slot index of this buffer - int mBuf; - - // mFence is a fence that will signal when the buffer is idle. - sp mFence; - }; - - // The following public functions are the consumer-facing interface - - // acquireBuffer attempts to acquire ownership of the next pending buffer in - // the BufferQueue. If no buffer is pending then it returns -EINVAL. If a - // buffer is successfully acquired, the information about the buffer is - // returned in BufferItem. If the buffer returned had previously been - // acquired then the BufferItem::mGraphicBuffer field of buffer is set to - // NULL and it is assumed that the consumer still holds a reference to the - // buffer. - status_t acquireBuffer(BufferItem *buffer); - - // releaseBuffer releases a buffer slot from the consumer back to the - // BufferQueue. This may be done while the buffer's contents are still - // being accessed. The fence will signal when the buffer is no longer - // in use. - // - // If releaseBuffer returns STALE_BUFFER_SLOT, then the consumer must free - // any references to the just-released buffer that it might have, as if it - // had received a onBuffersReleased() call with a mask set for the released - // buffer. - // - // Note that the dependencies on EGL will be removed once we switch to using - // the Android HW Sync HAL. - status_t releaseBuffer(int buf, EGLDisplay display, EGLSyncKHR fence, - const sp& releaseFence); - - // consumerConnect connects a consumer to the BufferQueue. Only one - // consumer may be connected, and when that consumer disconnects the - // BufferQueue is placed into the "abandoned" state, causing most - // interactions with the BufferQueue by the producer to fail. - // - // consumer may not be NULL. - status_t consumerConnect(const sp& consumer); - - // consumerDisconnect disconnects a consumer from the BufferQueue. All - // buffers will be freed and the BufferQueue is placed in the "abandoned" - // state, causing most interactions with the BufferQueue by the producer to - // fail. - status_t consumerDisconnect(); - - // getReleasedBuffers sets the value pointed to by slotMask to a bit mask - // indicating which buffer slots have been released by the BufferQueue - // but have not yet been released by the consumer. - // - // This should be called from the onBuffersReleased() callback. - status_t getReleasedBuffers(uint32_t* slotMask); - - // setDefaultBufferSize is used to set the size of buffers returned by - // dequeueBuffer when a width and height of zero is requested. Default - // is 1x1. - status_t setDefaultBufferSize(uint32_t w, uint32_t h); - - // setDefaultMaxBufferCount sets the default value for the maximum buffer - // count (the initial default is 2). If the producer has requested a - // buffer count using setBufferCount, the default buffer count will only - // take effect if the producer sets the count back to zero. - // - // The count must be between 2 and NUM_BUFFER_SLOTS, inclusive. - status_t setDefaultMaxBufferCount(int bufferCount); - - // setMaxAcquiredBufferCount sets the maximum number of buffers that can - // be acquired by the consumer at one time (default 1). This call will - // fail if a producer is connected to the BufferQueue. - status_t setMaxAcquiredBufferCount(int maxAcquiredBuffers); - - // isSynchronousMode returns whether the BufferQueue is currently in - // synchronous mode. - bool isSynchronousMode() const; - - // setConsumerName sets the name used in logging - void setConsumerName(const String8& name); - - // setDefaultBufferFormat allows the BufferQueue to create - // GraphicBuffers of a defaultFormat if no format is specified - // in dequeueBuffer. Formats are enumerated in graphics.h; the - // initial default is HAL_PIXEL_FORMAT_RGBA_8888. - status_t setDefaultBufferFormat(uint32_t defaultFormat); - - // setConsumerUsageBits will turn on additional usage bits for dequeueBuffer. - // These are merged with the bits passed to dequeueBuffer. The values are - // enumerated in gralloc.h, e.g. GRALLOC_USAGE_HW_RENDER; the default is 0. - status_t setConsumerUsageBits(uint32_t usage); - - // setTransformHint bakes in rotation to buffers so overlays can be used. - // The values are enumerated in window.h, e.g. - // NATIVE_WINDOW_TRANSFORM_ROT_90. The default is 0 (no transform). - status_t setTransformHint(uint32_t hint); - -private: - // freeBufferLocked frees the GraphicBuffer and sync resources for the - // given slot. - void freeBufferLocked(int index); - - // freeAllBuffersLocked frees the GraphicBuffer and sync resources for - // all slots. - void freeAllBuffersLocked(); - - // freeAllBuffersExceptHeadLocked frees the GraphicBuffer and sync - // resources for all slots except the head of mQueue. - void freeAllBuffersExceptHeadLocked(); - - // drainQueueLocked waits for the buffer queue to empty if we're in - // synchronous mode, or returns immediately otherwise. It returns NO_INIT - // if the BufferQueue is abandoned (consumer disconnected) or disconnected - // (producer disconnected) during the call. - status_t drainQueueLocked(); - - // drainQueueAndFreeBuffersLocked drains the buffer queue if we're in - // synchronous mode and free all buffers. In asynchronous mode, all buffers - // are freed except the currently queued buffer (if it exists). - status_t drainQueueAndFreeBuffersLocked(); - - // setDefaultMaxBufferCountLocked sets the maximum number of buffer slots - // that will be used if the producer does not override the buffer slot - // count. The count must be between 2 and NUM_BUFFER_SLOTS, inclusive. - // The initial default is 2. - status_t setDefaultMaxBufferCountLocked(int count); - - // getMinBufferCountLocked returns the minimum number of buffers allowed - // given the current BufferQueue state. - int getMinMaxBufferCountLocked() const; - - // getMinUndequeuedBufferCountLocked returns the minimum number of buffers - // that must remain in a state other than DEQUEUED. - int getMinUndequeuedBufferCountLocked() const; - - // getMaxBufferCountLocked returns the maximum number of buffers that can - // be allocated at once. This value depends upon the following member - // variables: - // - // mSynchronousMode - // mMaxAcquiredBufferCount - // mDefaultMaxBufferCount - // mOverrideMaxBufferCount - // - // Any time one of these member variables is changed while a producer is - // connected, mDequeueCondition must be broadcast. - int getMaxBufferCountLocked() const; - - struct BufferSlot { - - BufferSlot() - : mEglDisplay(EGL_NO_DISPLAY), - mBufferState(BufferSlot::FREE), - mRequestBufferCalled(false), - mTransform(0), - mScalingMode(NATIVE_WINDOW_SCALING_MODE_FREEZE), - mTimestamp(0), - mFrameNumber(0), - mEglFence(EGL_NO_SYNC_KHR), - mAcquireCalled(false), - mNeedsCleanupOnRelease(false) { - mCrop.makeInvalid(); - } - - // mGraphicBuffer points to the buffer allocated for this slot or is NULL - // if no buffer has been allocated. - sp mGraphicBuffer; - - // mEglDisplay is the EGLDisplay used to create EGLSyncKHR objects. - EGLDisplay mEglDisplay; - - // BufferState represents the different states in which a buffer slot - // can be. All slots are initially FREE. - enum BufferState { - // FREE indicates that the buffer is available to be dequeued - // by the producer. The buffer may be in use by the consumer for - // a finite time, so the buffer must not be modified until the - // associated fence is signaled. - // - // The slot is "owned" by BufferQueue. It transitions to DEQUEUED - // when dequeueBuffer is called. - FREE = 0, - - // DEQUEUED indicates that the buffer has been dequeued by the - // producer, but has not yet been queued or canceled. The - // producer may modify the buffer's contents as soon as the - // associated ready fence is signaled. - // - // The slot is "owned" by the producer. It can transition to - // QUEUED (via queueBuffer) or back to FREE (via cancelBuffer). - DEQUEUED = 1, - - // QUEUED indicates that the buffer has been filled by the - // producer and queued for use by the consumer. The buffer - // contents may continue to be modified for a finite time, so - // the contents must not be accessed until the associated fence - // is signaled. - // - // The slot is "owned" by BufferQueue. It can transition to - // ACQUIRED (via acquireBuffer) or to FREE (if another buffer is - // queued in asynchronous mode). - QUEUED = 2, - - // ACQUIRED indicates that the buffer has been acquired by the - // consumer. As with QUEUED, the contents must not be accessed - // by the consumer until the fence is signaled. - // - // The slot is "owned" by the consumer. It transitions to FREE - // when releaseBuffer is called. - ACQUIRED = 3 - }; - - // mBufferState is the current state of this buffer slot. - BufferState mBufferState; - - // mRequestBufferCalled is used for validating that the producer did - // call requestBuffer() when told to do so. Technically this is not - // needed but useful for debugging and catching producer bugs. - bool mRequestBufferCalled; - - // mCrop is the current crop rectangle for this buffer slot. - Rect mCrop; - - // mTransform is the current transform flags for this buffer slot. - // (example: NATIVE_WINDOW_TRANSFORM_ROT_90) - uint32_t mTransform; - - // mScalingMode is the current scaling mode for this buffer slot. - // (example: NATIVE_WINDOW_SCALING_MODE_FREEZE) - uint32_t mScalingMode; - - // mTimestamp is the current timestamp for this buffer slot. This gets - // to set by queueBuffer each time this slot is queued. - int64_t mTimestamp; - - // mFrameNumber is the number of the queued frame for this slot. This - // is used to dequeue buffers in LRU order (useful because buffers - // may be released before their release fence is signaled). - uint64_t mFrameNumber; - - // mEglFence is the EGL sync object that must signal before the buffer - // associated with this buffer slot may be dequeued. It is initialized - // to EGL_NO_SYNC_KHR when the buffer is created and may be set to a - // new sync object in releaseBuffer. (This is deprecated in favor of - // mFence, below.) - EGLSyncKHR mEglFence; - - // mFence is a fence which will signal when work initiated by the - // previous owner of the buffer is finished. When the buffer is FREE, - // the fence indicates when the consumer has finished reading - // from the buffer, or when the producer has finished writing if it - // called cancelBuffer after queueing some writes. When the buffer is - // QUEUED, it indicates when the producer has finished filling the - // buffer. When the buffer is DEQUEUED or ACQUIRED, the fence has been - // passed to the consumer or producer along with ownership of the - // buffer, and mFence is set to NO_FENCE. - sp mFence; - - // Indicates whether this buffer has been seen by a consumer yet - bool mAcquireCalled; - - // Indicates whether this buffer needs to be cleaned up by the - // consumer. This is set when a buffer in ACQUIRED state is freed. - // It causes releaseBuffer to return STALE_BUFFER_SLOT. - bool mNeedsCleanupOnRelease; - }; - - // mSlots is the array of buffer slots that must be mirrored on the - // producer side. This allows buffer ownership to be transferred between - // the producer and consumer without sending a GraphicBuffer over binder. - // The entire array is initialized to NULL at construction time, and - // buffers are allocated for a slot when requestBuffer is called with - // that slot's index. - BufferSlot mSlots[NUM_BUFFER_SLOTS]; - - // mDefaultWidth holds the default width of allocated buffers. It is used - // in dequeueBuffer() if a width and height of zero is specified. - uint32_t mDefaultWidth; - - // mDefaultHeight holds the default height of allocated buffers. It is used - // in dequeueBuffer() if a width and height of zero is specified. - uint32_t mDefaultHeight; - - // mMaxAcquiredBufferCount is the number of buffers that the consumer may - // acquire at one time. It defaults to 1 and can be changed by the - // consumer via the setMaxAcquiredBufferCount method, but this may only be - // done when no producer is connected to the BufferQueue. - // - // This value is used to derive the value returned for the - // MIN_UNDEQUEUED_BUFFERS query by the producer. - int mMaxAcquiredBufferCount; - - // mDefaultMaxBufferCount is the default limit on the number of buffers - // that will be allocated at one time. This default limit is set by the - // consumer. The limit (as opposed to the default limit) may be - // overridden by the producer. - int mDefaultMaxBufferCount; - - // mOverrideMaxBufferCount is the limit on the number of buffers that will - // be allocated at one time. This value is set by the image producer by - // calling setBufferCount. The default is zero, which means the producer - // doesn't care about the number of buffers in the pool. In that case - // mDefaultMaxBufferCount is used as the limit. - int mOverrideMaxBufferCount; - - // mGraphicBufferAlloc is the connection to SurfaceFlinger that is used to - // allocate new GraphicBuffer objects. - sp mGraphicBufferAlloc; - - // mConsumerListener is used to notify the connected consumer of - // asynchronous events that it may wish to react to. It is initially set - // to NULL and is written by consumerConnect and consumerDisconnect. - sp mConsumerListener; - - // mSynchronousMode whether we're in synchronous mode or not - bool mSynchronousMode; - - // mAllowSynchronousMode whether we allow synchronous mode or not. Set - // when the BufferQueue is created (by the consumer). - const bool mAllowSynchronousMode; - - // mConnectedApi indicates the producer API that is currently connected - // to this BufferQueue. It defaults to NO_CONNECTED_API (= 0), and gets - // updated by the connect and disconnect methods. - int mConnectedApi; - - // mDequeueCondition condition used for dequeueBuffer in synchronous mode - mutable Condition mDequeueCondition; - - // mQueue is a FIFO of queued buffers used in synchronous mode - typedef Vector Fifo; - Fifo mQueue; - - // mAbandoned indicates that the BufferQueue will no longer be used to - // consume image buffers pushed to it using the IGraphicBufferProducer - // interface. It is initialized to false, and set to true in the - // consumerDisconnect method. A BufferQueue that has been abandoned will - // return the NO_INIT error from all IGraphicBufferProducer methods - // capable of returning an error. - bool mAbandoned; - - // mConsumerName is a string used to identify the BufferQueue in log - // messages. It is set by the setConsumerName method. - String8 mConsumerName; - - // mMutex is the mutex used to prevent concurrent access to the member - // variables of BufferQueue objects. It must be locked whenever the - // member variables are accessed. - mutable Mutex mMutex; - - // mFrameCounter is the free running counter, incremented on every - // successful queueBuffer call. - uint64_t mFrameCounter; - - // mBufferHasBeenQueued is true once a buffer has been queued. It is - // reset when something causes all buffers to be freed (e.g. changing the - // buffer count). - bool mBufferHasBeenQueued; - - // mDefaultBufferFormat can be set so it will override - // the buffer format when it isn't specified in dequeueBuffer - uint32_t mDefaultBufferFormat; - - // mConsumerUsageBits contains flags the consumer wants for GraphicBuffers - uint32_t mConsumerUsageBits; - - // mTransformHint is used to optimize for screen rotations - uint32_t mTransformHint; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_BUFFERQUEUE_H diff --git a/external/android/include/18/frameworks/native/include/gui/ConsumerBase.h b/external/android/include/18/frameworks/native/include/gui/ConsumerBase.h deleted file mode 100644 index 8a7545d..0000000 --- a/external/android/include/18/frameworks/native/include/gui/ConsumerBase.h +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_CONSUMERBASE_H -#define ANDROID_GUI_CONSUMERBASE_H - -#include - -#include - -#include -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class String8; - -// ConsumerBase is a base class for BufferQueue consumer end-points. It -// handles common tasks like management of the connection to the BufferQueue -// and the buffer pool. -class ConsumerBase : public virtual RefBase, - protected BufferQueue::ConsumerListener { -public: - struct FrameAvailableListener : public virtual RefBase { - // onFrameAvailable() is called each time an additional frame becomes - // available for consumption. This means that frames that are queued - // while in asynchronous mode only trigger the callback if no previous - // frames are pending. Frames queued while in synchronous mode always - // trigger the callback. - // - // This is called without any lock held and can be called concurrently - // by multiple threads. - virtual void onFrameAvailable() = 0; - }; - - virtual ~ConsumerBase(); - - // abandon frees all the buffers and puts the ConsumerBase into the - // 'abandoned' state. Once put in this state the ConsumerBase can never - // leave it. When in the 'abandoned' state, all methods of the - // IGraphicBufferProducer interface will fail with the NO_INIT error. - // - // Note that while calling this method causes all the buffers to be freed - // from the perspective of the the ConsumerBase, if there are additional - // references on the buffers (e.g. if a buffer is referenced by a client - // or by OpenGL ES as a texture) then those buffer will remain allocated. - void abandon(); - - // set the name of the ConsumerBase that will be used to identify it in - // log messages. - void setName(const String8& name); - - // getBufferQueue returns the BufferQueue object to which this - // ConsumerBase is connected. - sp getBufferQueue() const; - - // dump writes the current state to a string. Child classes should add - // their state to the dump by overriding the dumpLocked method, which is - // called by these methods after locking the mutex. - void dump(String8& result) const; - void dump(String8& result, const char* prefix, char* buffer, size_t SIZE) const; - - // setFrameAvailableListener sets the listener object that will be notified - // when a new frame becomes available. - void setFrameAvailableListener(const wp& listener); - -private: - ConsumerBase(const ConsumerBase&); - void operator=(const ConsumerBase&); - -protected: - - // ConsumerBase constructs a new ConsumerBase object to consume image - // buffers from the given BufferQueue. - ConsumerBase(const sp &bufferQueue); - - // onLastStrongRef gets called by RefBase just before the dtor of the most - // derived class. It is used to clean up the buffers so that ConsumerBase - // can coordinate the clean-up by calling into virtual methods implemented - // by the derived classes. This would not be possible from the - // ConsuemrBase dtor because by the time that gets called the derived - // classes have already been destructed. - // - // This methods should not need to be overridden by derived classes, but - // if they are overridden the ConsumerBase implementation must be called - // from the derived class. - virtual void onLastStrongRef(const void* id); - - // Implementation of the BufferQueue::ConsumerListener interface. These - // calls are used to notify the ConsumerBase of asynchronous events in the - // BufferQueue. These methods should not need to be overridden by derived - // classes, but if they are overridden the ConsumerBase implementation - // must be called from the derived class. - virtual void onFrameAvailable(); - virtual void onBuffersReleased(); - - // freeBufferLocked frees up the given buffer slot. If the slot has been - // initialized this will release the reference to the GraphicBuffer in that - // slot. Otherwise it has no effect. - // - // Derived classes should override this method to clean up any state they - // keep per slot. If it is overridden, the derived class's implementation - // must call ConsumerBase::freeBufferLocked. - // - // This method must be called with mMutex locked. - virtual void freeBufferLocked(int slotIndex); - - // abandonLocked puts the BufferQueue into the abandoned state, causing - // all future operations on it to fail. This method rather than the public - // abandon method should be overridden by child classes to add abandon- - // time behavior. - // - // Derived classes should override this method to clean up any object - // state they keep (as opposed to per-slot state). If it is overridden, - // the derived class's implementation must call ConsumerBase::abandonLocked. - // - // This method must be called with mMutex locked. - virtual void abandonLocked(); - - // dumpLocked dumps the current state of the ConsumerBase object to the - // result string. Each line is prefixed with the string pointed to by the - // prefix argument. The buffer argument points to a buffer that may be - // used for intermediate formatting data, and the size of that buffer is - // indicated by the size argument. - // - // Derived classes should override this method to dump their internal - // state. If this method is overridden the derived class's implementation - // should call ConsumerBase::dumpLocked. - // - // This method must be called with mMutex locked. - virtual void dumpLocked(String8& result, const char* prefix, char* buffer, - size_t size) const; - - // acquireBufferLocked fetches the next buffer from the BufferQueue and - // updates the buffer slot for the buffer returned. - // - // Derived classes should override this method to perform any - // initialization that must take place the first time a buffer is assigned - // to a slot. If it is overridden the derived class's implementation must - // call ConsumerBase::acquireBufferLocked. - virtual status_t acquireBufferLocked(BufferQueue::BufferItem *item); - - // releaseBufferLocked relinquishes control over a buffer, returning that - // control to the BufferQueue. - // - // Derived classes should override this method to perform any cleanup that - // must take place when a buffer is released back to the BufferQueue. If - // it is overridden the derived class's implementation must call - // ConsumerBase::releaseBufferLocked. - virtual status_t releaseBufferLocked(int buf, EGLDisplay display, - EGLSyncKHR eglFence); - - // addReleaseFence* adds the sync points associated with a fence to the set - // of sync points that must be reached before the buffer in the given slot - // may be used after the slot has been released. This should be called by - // derived classes each time some asynchronous work is kicked off that - // references the buffer. - status_t addReleaseFence(int slot, const sp& fence); - status_t addReleaseFenceLocked(int slot, const sp& fence); - - // Slot contains the information and object references that - // ConsumerBase maintains about a BufferQueue buffer slot. - struct Slot { - // mGraphicBuffer is the Gralloc buffer store in the slot or NULL if - // no Gralloc buffer is in the slot. - sp mGraphicBuffer; - - // mFence is a fence which will signal when the buffer associated with - // this buffer slot is no longer being used by the consumer and can be - // overwritten. The buffer can be dequeued before the fence signals; - // the producer is responsible for delaying writes until it signals. - sp mFence; - }; - - // mSlots stores the buffers that have been allocated by the BufferQueue - // for each buffer slot. It is initialized to null pointers, and gets - // filled in with the result of BufferQueue::acquire when the - // client dequeues a buffer from a - // slot that has not yet been used. The buffer allocated to a slot will also - // be replaced if the requested buffer usage or geometry differs from that - // of the buffer allocated to a slot. - Slot mSlots[BufferQueue::NUM_BUFFER_SLOTS]; - - // mAbandoned indicates that the BufferQueue will no longer be used to - // consume images buffers pushed to it using the IGraphicBufferProducer - // interface. It is initialized to false, and set to true in the abandon - // method. A BufferQueue that has been abandoned will return the NO_INIT - // error from all IConsumerBase methods capable of returning an error. - bool mAbandoned; - - // mName is a string used to identify the ConsumerBase in log messages. - // It can be set by the setName method. - String8 mName; - - // mFrameAvailableListener is the listener object that will be called when a - // new frame becomes available. If it is not NULL it will be called from - // queueBuffer. - wp mFrameAvailableListener; - - // The ConsumerBase has-a BufferQueue and is responsible for creating this object - // if none is supplied - sp mBufferQueue; - - // mMutex is the mutex used to prevent concurrent access to the member - // variables of ConsumerBase objects. It must be locked whenever the - // member variables are accessed or when any of the *Locked methods are - // called. - // - // This mutex is intended to be locked by derived classes. - mutable Mutex mMutex; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_CONSUMERBASE_H diff --git a/external/android/include/18/frameworks/native/include/gui/CpuConsumer.h b/external/android/include/18/frameworks/native/include/gui/CpuConsumer.h deleted file mode 100644 index bf9918e..0000000 --- a/external/android/include/18/frameworks/native/include/gui/CpuConsumer.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (C) 2012 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_GUI_CPUCONSUMER_H -#define ANDROID_GUI_CPUCONSUMER_H - -#include - -#include - -#include -#include -#include - -#define ANDROID_GRAPHICS_CPUCONSUMER_JNI_ID "mCpuConsumer" - -namespace android { - -/** - * CpuConsumer is a BufferQueue consumer endpoint that allows direct CPU - * access to the underlying gralloc buffers provided by BufferQueue. Multiple - * buffers may be acquired by it at once, to be used concurrently by the - * CpuConsumer owner. Sets gralloc usage flags to be software-read-only. - * This queue is synchronous by default. - */ - -class CpuConsumer : public ConsumerBase -{ - public: - typedef ConsumerBase::FrameAvailableListener FrameAvailableListener; - - struct LockedBuffer { - uint8_t *data; - uint32_t width; - uint32_t height; - PixelFormat format; - uint32_t stride; - Rect crop; - uint32_t transform; - uint32_t scalingMode; - int64_t timestamp; - uint64_t frameNumber; - // Values below are only valid when using - // HAL_PIXEL_FORMAT_YCbCr_420_888, in which case LockedBuffer::data - // contains the Y channel, and stride is the Y channel stride. For other - // formats, these will all be 0. - uint8_t *dataCb; - uint8_t *dataCr; - uint32_t chromaStride; - uint32_t chromaStep; - }; - - // Create a new CPU consumer. The maxLockedBuffers parameter specifies - // how many buffers can be locked for user access at the same time. - CpuConsumer(uint32_t maxLockedBuffers, bool synchronousMode = true); - - virtual ~CpuConsumer(); - - // set the name of the CpuConsumer that will be used to identify it in - // log messages. - void setName(const String8& name); - - // Gets the next graphics buffer from the producer and locks it for CPU use, - // filling out the passed-in locked buffer structure with the native pointer - // and metadata. Returns BAD_VALUE if no new buffer is available, and - // INVALID_OPERATION if the maximum number of buffers is already locked. - // - // Only a fixed number of buffers can be locked at a time, determined by the - // construction-time maxLockedBuffers parameter. If INVALID_OPERATION is - // returned by lockNextBuffer, then old buffers must be returned to the queue - // by calling unlockBuffer before more buffers can be acquired. - status_t lockNextBuffer(LockedBuffer *nativeBuffer); - - // Returns a locked buffer to the queue, allowing it to be reused. Since - // only a fixed number of buffers may be locked at a time, old buffers must - // be released by calling unlockBuffer to ensure new buffers can be acquired by - // lockNextBuffer. - status_t unlockBuffer(const LockedBuffer &nativeBuffer); - - sp getProducerInterface() const { return getBufferQueue(); } - - private: - // Maximum number of buffers that can be locked at a time - uint32_t mMaxLockedBuffers; - - status_t releaseAcquiredBufferLocked(int lockedIdx); - - virtual void freeBufferLocked(int slotIndex); - - // Tracking for buffers acquired by the user - struct AcquiredBuffer { - // Need to track the original mSlot index and the buffer itself because - // the mSlot entry may be freed/reused before the acquired buffer is - // released. - int mSlot; - sp mGraphicBuffer; - void *mBufferPointer; - - AcquiredBuffer() : - mSlot(BufferQueue::INVALID_BUFFER_SLOT), - mBufferPointer(NULL) { - } - }; - Vector mAcquiredBuffers; - - // Count of currently locked buffers - uint32_t mCurrentLockedBuffers; - -}; - -} // namespace android - -#endif // ANDROID_GUI_CPUCONSUMER_H diff --git a/external/android/include/18/frameworks/native/include/gui/DisplayEventReceiver.h b/external/android/include/18/frameworks/native/include/gui/DisplayEventReceiver.h deleted file mode 100644 index f8267bf..0000000 --- a/external/android/include/18/frameworks/native/include/gui/DisplayEventReceiver.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (C) 2011 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_GUI_DISPLAY_EVENT_H -#define ANDROID_GUI_DISPLAY_EVENT_H - -#include -#include - -#include -#include -#include - -#include - -// ---------------------------------------------------------------------------- - -namespace android { - -// ---------------------------------------------------------------------------- - -class BitTube; -class IDisplayEventConnection; - -// ---------------------------------------------------------------------------- - -class DisplayEventReceiver { -public: - enum { - DISPLAY_EVENT_VSYNC = 'vsyn', - DISPLAY_EVENT_HOTPLUG = 'plug' - }; - - struct Event { - - struct Header { - uint32_t type; - uint32_t id; - nsecs_t timestamp; - }; - - struct VSync { - uint32_t count; - }; - - struct Hotplug { - bool connected; - }; - - Header header; - union { - VSync vsync; - Hotplug hotplug; - }; - }; - -public: - /* - * DisplayEventReceiver creates and registers an event connection with - * SurfaceFlinger. VSync events are disabled by default. Call setVSyncRate - * or requestNextVsync to receive them. - * Other events start being delivered immediately. - */ - DisplayEventReceiver(); - - /* - * ~DisplayEventReceiver severs the connection with SurfaceFlinger, new events - * stop being delivered immediately. Note that the queue could have - * some events pending. These will be delivered. - */ - ~DisplayEventReceiver(); - - /* - * initCheck returns the state of DisplayEventReceiver after construction. - */ - status_t initCheck() const; - - /* - * getFd returns the file descriptor to use to receive events. - * OWNERSHIP IS RETAINED by DisplayEventReceiver. DO NOT CLOSE this - * file-descriptor. - */ - int getFd() const; - - /* - * getEvents reads events from the queue and returns how many events were - * read. Returns 0 if there are no more events or a negative error code. - * If NOT_ENOUGH_DATA is returned, the object has become invalid forever, it - * should be destroyed and getEvents() shouldn't be called again. - */ - ssize_t getEvents(Event* events, size_t count); - static ssize_t getEvents(const sp& dataChannel, - Event* events, size_t count); - - /* - * sendEvents write events to the queue and returns how many events were - * written. - */ - static ssize_t sendEvents(const sp& dataChannel, - Event const* events, size_t count); - - /* - * setVsyncRate() sets the Event::VSync delivery rate. A value of - * 1 returns every Event::VSync. A value of 2 returns every other event, - * etc... a value of 0 returns no event unless requestNextVsync() has - * been called. - */ - status_t setVsyncRate(uint32_t count); - - /* - * requestNextVsync() schedules the next Event::VSync. It has no effect - * if the vsync rate is > 0. - */ - status_t requestNextVsync(); - -private: - sp mEventConnection; - sp mDataChannel; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_DISPLAY_EVENT_H diff --git a/external/android/include/18/frameworks/native/include/gui/DummyConsumer.h b/external/android/include/18/frameworks/native/include/gui/DummyConsumer.h deleted file mode 100644 index 08e8ec8..0000000 --- a/external/android/include/18/frameworks/native/include/gui/DummyConsumer.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2012 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_GUI_DUMMYCONSUMER_H -#define ANDROID_GUI_DUMMYCONSUMER_H - -#include - -namespace android { -// ---------------------------------------------------------------------------- - - -// The DummyConsumer does not keep a reference to BufferQueue -// unlike GLConsumer. This prevents a circular reference from -// forming without having to use a ProxyConsumerListener -class DummyConsumer : public BufferQueue::ConsumerListener { -public: - DummyConsumer(); - virtual ~DummyConsumer(); -protected: - - // Implementation of the BufferQueue::ConsumerListener interface. These - // calls are used to notify the GLConsumer of asynchronous events in the - // BufferQueue. - virtual void onFrameAvailable(); - virtual void onBuffersReleased(); - -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_DUMMYCONSUMER_H diff --git a/external/android/include/18/frameworks/native/include/gui/GLConsumer.h b/external/android/include/18/frameworks/native/include/gui/GLConsumer.h deleted file mode 100644 index f0a75dc..0000000 --- a/external/android/include/18/frameworks/native/include/gui/GLConsumer.h +++ /dev/null @@ -1,427 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_CONSUMER_H -#define ANDROID_GUI_CONSUMER_H - -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include -#include - -#define ANDROID_GRAPHICS_SURFACETEXTURE_JNI_ID "mSurfaceTexture" -#define ANDROID_GRAPHICS_FRAMEAVAILABLELISTENER_JNI_ID \ - "mFrameAvailableListener" - -namespace android { -// ---------------------------------------------------------------------------- - - -class String8; - -/* - * GLConsumer consumes buffers of graphics data from a BufferQueue, - * and makes them available to OpenGL as a texture. - * - * A typical usage pattern is to set up the GLConsumer with the - * desired options, and call updateTexImage() when a new frame is desired. - * If a new frame is available, the texture will be updated. If not, - * the previous contents are retained. - * - * By default, the texture is attached to the GL_TEXTURE_EXTERNAL_OES - * texture target, in the EGL context of the first thread that calls - * updateTexImage(). - * - * This class was previously called SurfaceTexture. - */ -class GLConsumer : public ConsumerBase { -public: - typedef ConsumerBase::FrameAvailableListener FrameAvailableListener; - - // GLConsumer constructs a new GLConsumer object. tex indicates the - // name of the OpenGL ES texture to which images are to be streamed. - // allowSynchronousMode specifies whether or not synchronous mode can be - // enabled. texTarget specifies the OpenGL ES texture target to which the - // texture will be bound in updateTexImage. useFenceSync specifies whether - // fences should be used to synchronize access to buffers if that behavior - // is enabled at compile-time. A custom bufferQueue can be specified - // if behavior for queue/dequeue/connect etc needs to be customized. - // Otherwise a default BufferQueue will be created and used. - // - // For legacy reasons, the GLConsumer is created in a state where it is - // considered attached to an OpenGL ES context for the purposes of the - // attachToContext and detachFromContext methods. However, despite being - // considered "attached" to a context, the specific OpenGL ES context - // doesn't get latched until the first call to updateTexImage. After that - // point, all calls to updateTexImage must be made with the same OpenGL ES - // context current. - // - // A GLConsumer may be detached from one OpenGL ES context and then - // attached to a different context using the detachFromContext and - // attachToContext methods, respectively. The intention of these methods is - // purely to allow a GLConsumer to be transferred from one consumer - // context to another. If such a transfer is not needed there is no - // requirement that either of these methods be called. - GLConsumer(GLuint tex, bool allowSynchronousMode = true, - GLenum texTarget = GL_TEXTURE_EXTERNAL_OES, bool useFenceSync = true, - const sp &bufferQueue = 0); - - // updateTexImage acquires the most recently queued buffer, and sets the - // image contents of the target texture to it. - // - // This call may only be made while the OpenGL ES context to which the - // target texture belongs is bound to the calling thread. - // - // This calls doGLFenceWait to ensure proper synchronization. - status_t updateTexImage(); - - // setReleaseFence stores a fence that will signal when the current buffer - // is no longer being read. This fence will be returned to the producer - // when the current buffer is released by updateTexImage(). Multiple - // fences can be set for a given buffer; they will be merged into a single - // union fence. - void setReleaseFence(const sp& fence); - - // setDefaultMaxBufferCount sets the default limit on the maximum number - // of buffers that will be allocated at one time. The image producer may - // override the limit. - status_t setDefaultMaxBufferCount(int bufferCount); - - // getTransformMatrix retrieves the 4x4 texture coordinate transform matrix - // associated with the texture image set by the most recent call to - // updateTexImage. - // - // This transform matrix maps 2D homogeneous texture coordinates of the form - // (s, t, 0, 1) with s and t in the inclusive range [0, 1] to the texture - // coordinate that should be used to sample that location from the texture. - // Sampling the texture outside of the range of this transform is undefined. - // - // This transform is necessary to compensate for transforms that the stream - // content producer may implicitly apply to the content. By forcing users of - // a GLConsumer to apply this transform we avoid performing an extra - // copy of the data that would be needed to hide the transform from the - // user. - // - // The matrix is stored in column-major order so that it may be passed - // directly to OpenGL ES via the glLoadMatrixf or glUniformMatrix4fv - // functions. - void getTransformMatrix(float mtx[16]); - - // getTimestamp retrieves the timestamp associated with the texture image - // set by the most recent call to updateTexImage. - // - // The timestamp is in nanoseconds, and is monotonically increasing. Its - // other semantics (zero point, etc) are source-dependent and should be - // documented by the source. - int64_t getTimestamp(); - - // setDefaultBufferSize is used to set the size of buffers returned by - // requestBuffers when a with and height of zero is requested. - // A call to setDefaultBufferSize() may trigger requestBuffers() to - // be called from the client. - // The width and height parameters must be no greater than the minimum of - // GL_MAX_VIEWPORT_DIMS and GL_MAX_TEXTURE_SIZE (see: glGetIntegerv). - // An error due to invalid dimensions might not be reported until - // updateTexImage() is called. - status_t setDefaultBufferSize(uint32_t width, uint32_t height); - - // setFilteringEnabled sets whether the transform matrix should be computed - // for use with bilinear filtering. - void setFilteringEnabled(bool enabled); - - // getCurrentBuffer returns the buffer associated with the current image. - sp getCurrentBuffer() const; - - // getCurrentTextureTarget returns the texture target of the current - // texture as returned by updateTexImage(). - GLenum getCurrentTextureTarget() const; - - // getCurrentCrop returns the cropping rectangle of the current buffer. - Rect getCurrentCrop() const; - - // getCurrentTransform returns the transform of the current buffer. - uint32_t getCurrentTransform() const; - - // getCurrentScalingMode returns the scaling mode of the current buffer. - uint32_t getCurrentScalingMode() const; - - // getCurrentFence returns the fence indicating when the current buffer is - // ready to be read from. - sp getCurrentFence() const; - - // doGLFenceWait inserts a wait command into the OpenGL ES command stream - // to ensure that it is safe for future OpenGL ES commands to access the - // current texture buffer. - status_t doGLFenceWait() const; - - // isSynchronousMode returns whether the GLConsumer is currently in - // synchronous mode. - bool isSynchronousMode() const; - - // set the name of the GLConsumer that will be used to identify it in - // log messages. - void setName(const String8& name); - - // These functions call the corresponding BufferQueue implementation - // so the refactoring can proceed smoothly - status_t setDefaultBufferFormat(uint32_t defaultFormat); - status_t setConsumerUsageBits(uint32_t usage); - status_t setTransformHint(uint32_t hint); - virtual status_t setSynchronousMode(bool enabled); - - // getBufferQueue returns the BufferQueue object to which this - // GLConsumer is connected. - sp getBufferQueue() const { - return mBufferQueue; - } - - // detachFromContext detaches the GLConsumer from the calling thread's - // current OpenGL ES context. This context must be the same as the context - // that was current for previous calls to updateTexImage. - // - // Detaching a GLConsumer from an OpenGL ES context will result in the - // deletion of the OpenGL ES texture object into which the images were being - // streamed. After a GLConsumer has been detached from the OpenGL ES - // context calls to updateTexImage will fail returning INVALID_OPERATION - // until the GLConsumer is attached to a new OpenGL ES context using the - // attachToContext method. - status_t detachFromContext(); - - // attachToContext attaches a GLConsumer that is currently in the - // 'detached' state to the current OpenGL ES context. A GLConsumer is - // in the 'detached' state iff detachFromContext has successfully been - // called and no calls to attachToContext have succeeded since the last - // detachFromContext call. Calls to attachToContext made on a - // GLConsumer that is not in the 'detached' state will result in an - // INVALID_OPERATION error. - // - // The tex argument specifies the OpenGL ES texture object name in the - // new context into which the image contents will be streamed. A successful - // call to attachToContext will result in this texture object being bound to - // the texture target and populated with the image contents that were - // current at the time of the last call to detachFromContext. - status_t attachToContext(GLuint tex); - -protected: - - // abandonLocked overrides the ConsumerBase method to clear - // mCurrentTextureBuf in addition to the ConsumerBase behavior. - virtual void abandonLocked(); - - // dumpLocked overrides the ConsumerBase method to dump GLConsumer- - // specific info in addition to the ConsumerBase behavior. - virtual void dumpLocked(String8& result, const char* prefix, char* buffer, - size_t size) const; - - // acquireBufferLocked overrides the ConsumerBase method to update the - // mEglSlots array in addition to the ConsumerBase behavior. - virtual status_t acquireBufferLocked(BufferQueue::BufferItem *item); - - // releaseBufferLocked overrides the ConsumerBase method to update the - // mEglSlots array in addition to the ConsumerBase. - virtual status_t releaseBufferLocked(int buf, EGLDisplay display, - EGLSyncKHR eglFence); - - status_t releaseBufferLocked(int buf, EGLSyncKHR eglFence) { - return releaseBufferLocked(buf, mEglDisplay, eglFence); - } - - static bool isExternalFormat(uint32_t format); - - // This releases the buffer in the slot referenced by mCurrentTexture, - // then updates state to refer to the BufferItem, which must be a - // newly-acquired buffer. - status_t releaseAndUpdateLocked(const BufferQueue::BufferItem& item); - - // Binds mTexName and the current buffer to mTexTarget. Uses - // mCurrentTexture if it's set, mCurrentTextureBuf if not. If the - // bind succeeds, this calls doGLFenceWait. - status_t bindTextureImageLocked(); - - // Gets the current EGLDisplay and EGLContext values, and compares them - // to mEglDisplay and mEglContext. If the fields have been previously - // set, the values must match; if not, the fields are set to the current - // values. - status_t checkAndUpdateEglStateLocked(); - -private: - // createImage creates a new EGLImage from a GraphicBuffer. - EGLImageKHR createImage(EGLDisplay dpy, - const sp& graphicBuffer); - - // freeBufferLocked frees up the given buffer slot. If the slot has been - // initialized this will release the reference to the GraphicBuffer in that - // slot and destroy the EGLImage in that slot. Otherwise it has no effect. - // - // This method must be called with mMutex locked. - virtual void freeBufferLocked(int slotIndex); - - // computeCurrentTransformMatrixLocked computes the transform matrix for the - // current texture. It uses mCurrentTransform and the current GraphicBuffer - // to compute this matrix and stores it in mCurrentTransformMatrix. - // mCurrentTextureBuf must not be NULL. - void computeCurrentTransformMatrixLocked(); - - // doGLFenceWaitLocked inserts a wait command into the OpenGL ES command - // stream to ensure that it is safe for future OpenGL ES commands to - // access the current texture buffer. - status_t doGLFenceWaitLocked() const; - - // syncForReleaseLocked performs the synchronization needed to release the - // current slot from an OpenGL ES context. If needed it will set the - // current slot's fence to guard against a producer accessing the buffer - // before the outstanding accesses have completed. - status_t syncForReleaseLocked(EGLDisplay dpy); - - // Normally, when we bind a buffer to a texture target, we bind a buffer - // that is referenced by an entry in mEglSlots. In some situations we - // have a buffer in mCurrentTextureBuf, but no corresponding entry for - // it in our slot array. bindUnslottedBuffer handles that situation by - // binding the buffer without touching the EglSlots. - status_t bindUnslottedBufferLocked(EGLDisplay dpy); - - // The default consumer usage flags that GLConsumer always sets on its - // BufferQueue instance; these will be OR:d with any additional flags passed - // from the GLConsumer user. In particular, GLConsumer will always - // consume buffers as hardware textures. - static const uint32_t DEFAULT_USAGE_FLAGS = GraphicBuffer::USAGE_HW_TEXTURE; - - // mCurrentTextureBuf is the graphic buffer of the current texture. It's - // possible that this buffer is not associated with any buffer slot, so we - // must track it separately in order to support the getCurrentBuffer method. - sp mCurrentTextureBuf; - - // mCurrentCrop is the crop rectangle that applies to the current texture. - // It gets set each time updateTexImage is called. - Rect mCurrentCrop; - - // mCurrentTransform is the transform identifier for the current texture. It - // gets set each time updateTexImage is called. - uint32_t mCurrentTransform; - - // mCurrentScalingMode is the scaling mode for the current texture. It gets - // set each time updateTexImage is called. - uint32_t mCurrentScalingMode; - - // mCurrentFence is the fence received from BufferQueue in updateTexImage. - sp mCurrentFence; - - // mCurrentTransformMatrix is the transform matrix for the current texture. - // It gets computed by computeTransformMatrix each time updateTexImage is - // called. - float mCurrentTransformMatrix[16]; - - // mCurrentTimestamp is the timestamp for the current texture. It - // gets set each time updateTexImage is called. - int64_t mCurrentTimestamp; - - uint32_t mDefaultWidth, mDefaultHeight; - - // mFilteringEnabled indicates whether the transform matrix is computed for - // use with bilinear filtering. It defaults to true and is changed by - // setFilteringEnabled(). - bool mFilteringEnabled; - - // mTexName is the name of the OpenGL texture to which streamed images will - // be bound when updateTexImage is called. It is set at construction time - // and can be changed with a call to attachToContext. - GLuint mTexName; - - // mUseFenceSync indicates whether creation of the EGL_KHR_fence_sync - // extension should be used to prevent buffers from being dequeued before - // it's safe for them to be written. It gets set at construction time and - // never changes. - const bool mUseFenceSync; - - // mTexTarget is the GL texture target with which the GL texture object is - // associated. It is set in the constructor and never changed. It is - // almost always GL_TEXTURE_EXTERNAL_OES except for one use case in Android - // Browser. In that case it is set to GL_TEXTURE_2D to allow - // glCopyTexSubImage to read from the texture. This is a hack to work - // around a GL driver limitation on the number of FBO attachments, which the - // browser's tile cache exceeds. - const GLenum mTexTarget; - - // EGLSlot contains the information and object references that - // GLConsumer maintains about a BufferQueue buffer slot. - struct EglSlot { - EglSlot() - : mEglImage(EGL_NO_IMAGE_KHR), - mEglFence(EGL_NO_SYNC_KHR) { - } - - // mEglImage is the EGLImage created from mGraphicBuffer. - EGLImageKHR mEglImage; - - // mFence is the EGL sync object that must signal before the buffer - // associated with this buffer slot may be dequeued. It is initialized - // to EGL_NO_SYNC_KHR when the buffer is created and (optionally, based - // on a compile-time option) set to a new sync object in updateTexImage. - EGLSyncKHR mEglFence; - }; - - // mEglDisplay is the EGLDisplay with which this GLConsumer is currently - // associated. It is intialized to EGL_NO_DISPLAY and gets set to the - // current display when updateTexImage is called for the first time and when - // attachToContext is called. - EGLDisplay mEglDisplay; - - // mEglContext is the OpenGL ES context with which this GLConsumer is - // currently associated. It is initialized to EGL_NO_CONTEXT and gets set - // to the current GL context when updateTexImage is called for the first - // time and when attachToContext is called. - EGLContext mEglContext; - - // mEGLSlots stores the buffers that have been allocated by the BufferQueue - // for each buffer slot. It is initialized to null pointers, and gets - // filled in with the result of BufferQueue::acquire when the - // client dequeues a buffer from a - // slot that has not yet been used. The buffer allocated to a slot will also - // be replaced if the requested buffer usage or geometry differs from that - // of the buffer allocated to a slot. - EglSlot mEglSlots[BufferQueue::NUM_BUFFER_SLOTS]; - - // mCurrentTexture is the buffer slot index of the buffer that is currently - // bound to the OpenGL texture. It is initialized to INVALID_BUFFER_SLOT, - // indicating that no buffer slot is currently bound to the texture. Note, - // however, that a value of INVALID_BUFFER_SLOT does not necessarily mean - // that no buffer is bound to the texture. A call to setBufferCount will - // reset mCurrentTexture to INVALID_BUFFER_SLOT. - int mCurrentTexture; - - // mAttached indicates whether the ConsumerBase is currently attached to - // an OpenGL ES context. For legacy reasons, this is initialized to true, - // indicating that the ConsumerBase is considered to be attached to - // whatever context is current at the time of the first updateTexImage call. - // It is set to false by detachFromContext, and then set to true again by - // attachToContext. - bool mAttached; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_CONSUMER_H diff --git a/external/android/include/18/frameworks/native/include/gui/GraphicBufferAlloc.h b/external/android/include/18/frameworks/native/include/gui/GraphicBufferAlloc.h deleted file mode 100644 index b08750c..0000000 --- a/external/android/include/18/frameworks/native/include/gui/GraphicBufferAlloc.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2012 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_SF_GRAPHIC_BUFFER_ALLOC_H -#define ANDROID_SF_GRAPHIC_BUFFER_ALLOC_H - -#include -#include - -#include -#include -#include - -namespace android { -// --------------------------------------------------------------------------- - -class GraphicBuffer; - -class GraphicBufferAlloc : public BnGraphicBufferAlloc { -public: - GraphicBufferAlloc(); - virtual ~GraphicBufferAlloc(); - virtual sp createGraphicBuffer(uint32_t w, uint32_t h, - PixelFormat format, uint32_t usage, status_t* error); -}; - - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_SF_GRAPHIC_BUFFER_ALLOC_H diff --git a/external/android/include/18/frameworks/native/include/gui/GuiConfig.h b/external/android/include/18/frameworks/native/include/gui/GuiConfig.h deleted file mode 100644 index b020ed9..0000000 --- a/external/android/include/18/frameworks/native/include/gui/GuiConfig.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2012 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_GUI_CONFIG_H -#define ANDROID_GUI_CONFIG_H - -#include - -namespace android { - -// Append the libgui configuration details to configStr. -void appendGuiConfigString(String8& configStr); - -}; // namespace android - -#endif /*ANDROID_GUI_CONFIG_H*/ diff --git a/external/android/include/18/frameworks/native/include/gui/IDisplayEventConnection.h b/external/android/include/18/frameworks/native/include/gui/IDisplayEventConnection.h deleted file mode 100644 index 86247de..0000000 --- a/external/android/include/18/frameworks/native/include/gui/IDisplayEventConnection.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2011 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_GUI_IDISPLAY_EVENT_CONNECTION_H -#define ANDROID_GUI_IDISPLAY_EVENT_CONNECTION_H - -#include -#include - -#include -#include - -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class BitTube; - -class IDisplayEventConnection : public IInterface -{ -public: - - DECLARE_META_INTERFACE(DisplayEventConnection); - - /* - * getDataChannel() returns a BitTube where to receive the events from - */ - virtual sp getDataChannel() const = 0; - - /* - * setVsyncRate() sets the vsync event delivery rate. A value of - * 1 returns every vsync events. A value of 2 returns every other events, - * etc... a value of 0 returns no event unless requestNextVsync() has - * been called. - */ - virtual void setVsyncRate(uint32_t count) = 0; - - /* - * requestNextVsync() schedules the next vsync event. It has no effect - * if the vsync rate is > 0. - */ - virtual void requestNextVsync() = 0; // asynchronous -}; - -// ---------------------------------------------------------------------------- - -class BnDisplayEventConnection : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_IDISPLAY_EVENT_CONNECTION_H diff --git a/external/android/include/18/frameworks/native/include/gui/IGraphicBufferAlloc.h b/external/android/include/18/frameworks/native/include/gui/IGraphicBufferAlloc.h deleted file mode 100644 index cee41d9..0000000 --- a/external/android/include/18/frameworks/native/include/gui/IGraphicBufferAlloc.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2011 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_GUI_IGRAPHIC_BUFFER_ALLOC_H -#define ANDROID_GUI_IGRAPHIC_BUFFER_ALLOC_H - -#include -#include - -#include -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class GraphicBuffer; - -class IGraphicBufferAlloc : public IInterface -{ -public: - DECLARE_META_INTERFACE(GraphicBufferAlloc); - - /* Create a new GraphicBuffer for the client to use. - */ - virtual sp createGraphicBuffer(uint32_t w, uint32_t h, - PixelFormat format, uint32_t usage, status_t* error) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnGraphicBufferAlloc : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_GUI_IGRAPHIC_BUFFER_ALLOC_H diff --git a/external/android/include/18/frameworks/native/include/gui/IGraphicBufferProducer.h b/external/android/include/18/frameworks/native/include/gui/IGraphicBufferProducer.h deleted file mode 100644 index 29c7ff3..0000000 --- a/external/android/include/18/frameworks/native/include/gui/IGraphicBufferProducer.h +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_IGRAPHICBUFFERPRODUCER_H -#define ANDROID_GUI_IGRAPHICBUFFERPRODUCER_H - -#include -#include - -#include -#include - -#include - -#include -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class Surface; - -/* - * This class defines the Binder IPC interface for the producer side of - * a queue of graphics buffers. It's used to send graphics data from one - * component to another. For example, a class that decodes video for - * playback might use this to provide frames. This is typically done - * indirectly, through Surface. - * - * The underlying mechanism is a BufferQueue, which implements - * BnGraphicBufferProducer. In normal operation, the producer calls - * dequeueBuffer() to get an empty buffer, fills it with data, then - * calls queueBuffer() to make it available to the consumer. - * - * This class was previously called ISurfaceTexture. - */ -class IGraphicBufferProducer : public IInterface -{ -public: - DECLARE_META_INTERFACE(GraphicBufferProducer); - - enum { - BUFFER_NEEDS_REALLOCATION = 0x1, - RELEASE_ALL_BUFFERS = 0x2, - }; - - // requestBuffer requests a new buffer for the given index. The server (i.e. - // the IGraphicBufferProducer implementation) assigns the newly created - // buffer to the given slot index, and the client is expected to mirror the - // slot->buffer mapping so that it's not necessary to transfer a - // GraphicBuffer for every dequeue operation. - virtual status_t requestBuffer(int slot, sp* buf) = 0; - - // setBufferCount sets the number of buffer slots available. Calling this - // will also cause all buffer slots to be emptied. The caller should empty - // its mirrored copy of the buffer slots when calling this method. - virtual status_t setBufferCount(int bufferCount) = 0; - - // dequeueBuffer requests a new buffer slot for the client to use. Ownership - // of the slot is transfered to the client, meaning that the server will not - // use the contents of the buffer associated with that slot. The slot index - // returned may or may not contain a buffer. If the slot is empty the client - // should call requestBuffer to assign a new buffer to that slot. The client - // is expected to either call cancelBuffer on the dequeued slot or to fill - // in the contents of its associated buffer contents and call queueBuffer. - // If dequeueBuffer return BUFFER_NEEDS_REALLOCATION, the client is - // expected to call requestBuffer immediately. - // - // The fence parameter will be updated to hold the fence associated with - // the buffer. The contents of the buffer must not be overwritten until the - // fence signals. If the fence is NULL, the buffer may be written - // immediately. - virtual status_t dequeueBuffer(int *slot, sp* fence, - uint32_t w, uint32_t h, uint32_t format, uint32_t usage) = 0; - - // queueBuffer indicates that the client has finished filling in the - // contents of the buffer associated with slot and transfers ownership of - // that slot back to the server. It is not valid to call queueBuffer on a - // slot that is not owned by the client or one for which a buffer associated - // via requestBuffer. In addition, a timestamp must be provided by the - // client for this buffer. The timestamp is measured in nanoseconds, and - // must be monotonically increasing. Its other properties (zero point, etc) - // are client-dependent, and should be documented by the client. - // - // outWidth, outHeight and outTransform are filled with the default width - // and height of the window and current transform applied to buffers, - // respectively. - - struct QueueBufferInput : public Flattenable { - inline QueueBufferInput(const Parcel& parcel); - inline QueueBufferInput(int64_t timestamp, - const Rect& crop, int scalingMode, uint32_t transform, - sp fence) - : timestamp(timestamp), crop(crop), scalingMode(scalingMode), - transform(transform), fence(fence) { } - inline void deflate(int64_t* outTimestamp, Rect* outCrop, - int* outScalingMode, uint32_t* outTransform, - sp* outFence) const { - *outTimestamp = timestamp; - *outCrop = crop; - *outScalingMode = scalingMode; - *outTransform = transform; - *outFence = fence; - } - - // Flattenable interface - virtual size_t getFlattenedSize() const; - virtual size_t getFdCount() const; - virtual status_t flatten(void* buffer, size_t size, - int fds[], size_t count) const; - virtual status_t unflatten(void const* buffer, size_t size, - int fds[], size_t count); - - private: - int64_t timestamp; - Rect crop; - int scalingMode; - uint32_t transform; - sp fence; - }; - - // QueueBufferOutput must be a POD structure - struct QueueBufferOutput { - inline QueueBufferOutput() { } - inline void deflate(uint32_t* outWidth, - uint32_t* outHeight, - uint32_t* outTransformHint, - uint32_t* outNumPendingBuffers) const { - *outWidth = width; - *outHeight = height; - *outTransformHint = transformHint; - *outNumPendingBuffers = numPendingBuffers; - } - inline void inflate(uint32_t inWidth, uint32_t inHeight, - uint32_t inTransformHint, uint32_t inNumPendingBuffers) { - width = inWidth; - height = inHeight; - transformHint = inTransformHint; - numPendingBuffers = inNumPendingBuffers; - } - private: - uint32_t width; - uint32_t height; - uint32_t transformHint; - uint32_t numPendingBuffers; - }; - - virtual status_t queueBuffer(int slot, - const QueueBufferInput& input, QueueBufferOutput* output) = 0; - - // cancelBuffer indicates that the client does not wish to fill in the - // buffer associated with slot and transfers ownership of the slot back to - // the server. - virtual void cancelBuffer(int slot, const sp& fence) = 0; - - // query retrieves some information for this surface - // 'what' tokens allowed are that of android_natives.h - virtual int query(int what, int* value) = 0; - - // setSynchronousMode set whether dequeueBuffer is synchronous or - // asynchronous. In synchronous mode, dequeueBuffer blocks until - // a buffer is available, the currently bound buffer can be dequeued and - // queued buffers will be retired in order. - // The default mode is asynchronous. - virtual status_t setSynchronousMode(bool enabled) = 0; - - // connect attempts to connect a client API to the IGraphicBufferProducer. - // This must be called before any other IGraphicBufferProducer methods are - // called except for getAllocator. - // - // This method will fail if the connect was previously called on the - // IGraphicBufferProducer and no corresponding disconnect call was made. - // - // outWidth, outHeight and outTransform are filled with the default width - // and height of the window and current transform applied to buffers, - // respectively. - virtual status_t connect(int api, QueueBufferOutput* output) = 0; - - // disconnect attempts to disconnect a client API from the - // IGraphicBufferProducer. Calling this method will cause any subsequent - // calls to other IGraphicBufferProducer methods to fail except for - // getAllocator and connect. Successfully calling connect after this will - // allow the other methods to succeed again. - // - // This method will fail if the the IGraphicBufferProducer is not currently - // connected to the specified client API. - virtual status_t disconnect(int api) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnGraphicBufferProducer : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_IGRAPHICBUFFERPRODUCER_H diff --git a/external/android/include/18/frameworks/native/include/gui/ISensorEventConnection.h b/external/android/include/18/frameworks/native/include/gui/ISensorEventConnection.h deleted file mode 100644 index 749065e..0000000 --- a/external/android/include/18/frameworks/native/include/gui/ISensorEventConnection.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_ISENSOR_EVENT_CONNECTION_H -#define ANDROID_GUI_ISENSOR_EVENT_CONNECTION_H - -#include -#include - -#include -#include - -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class BitTube; - -class ISensorEventConnection : public IInterface -{ -public: - DECLARE_META_INTERFACE(SensorEventConnection); - - virtual sp getSensorChannel() const = 0; - virtual status_t enableDisable(int handle, bool enabled) = 0; - virtual status_t setEventRate(int handle, nsecs_t ns) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnSensorEventConnection : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_ISENSOR_EVENT_CONNECTION_H diff --git a/external/android/include/18/frameworks/native/include/gui/ISensorServer.h b/external/android/include/18/frameworks/native/include/gui/ISensorServer.h deleted file mode 100644 index 9c8afc5..0000000 --- a/external/android/include/18/frameworks/native/include/gui/ISensorServer.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_ISENSORSERVER_H -#define ANDROID_GUI_ISENSORSERVER_H - -#include -#include - -#include -#include - -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class Sensor; -class ISensorEventConnection; - -class ISensorServer : public IInterface -{ -public: - DECLARE_META_INTERFACE(SensorServer); - - virtual Vector getSensorList() = 0; - virtual sp createSensorEventConnection() = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnSensorServer : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_ISENSORSERVER_H diff --git a/external/android/include/18/frameworks/native/include/gui/ISurfaceComposer.h b/external/android/include/18/frameworks/native/include/gui/ISurfaceComposer.h deleted file mode 100644 index 9018b87..0000000 --- a/external/android/include/18/frameworks/native/include/gui/ISurfaceComposer.h +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (C) 2006 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_GUI_ISURFACE_COMPOSER_H -#define ANDROID_GUI_ISURFACE_COMPOSER_H - -#include -#include - -#include -#include - -#include - -#include - -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class ComposerState; -class DisplayState; -class DisplayInfo; -class IDisplayEventConnection; -class IMemoryHeap; - -/* - * This class defines the Binder IPC interface for accessing various - * SurfaceFlinger features. - */ -class ISurfaceComposer: public IInterface { -public: - DECLARE_META_INTERFACE(SurfaceComposer); - - // flags for setTransactionState() - enum { - eSynchronous = 0x01, - eAnimation = 0x02, - }; - - enum { - eDisplayIdMain = 0, - eDisplayIdHdmi = 1 - }; - - /* create connection with surface flinger, requires - * ACCESS_SURFACE_FLINGER permission - */ - virtual sp createConnection() = 0; - - /* create a graphic buffer allocator - */ - virtual sp createGraphicBufferAlloc() = 0; - - /* return an IDisplayEventConnection */ - virtual sp createDisplayEventConnection() = 0; - - /* create a display - * requires ACCESS_SURFACE_FLINGER permission. - */ - virtual sp createDisplay(const String8& displayName, - bool secure) = 0; - - /* get the token for the existing default displays. possible values - * for id are eDisplayIdMain and eDisplayIdHdmi. - */ - virtual sp getBuiltInDisplay(int32_t id) = 0; - - /* open/close transactions. requires ACCESS_SURFACE_FLINGER permission */ - virtual void setTransactionState(const Vector& state, - const Vector& displays, uint32_t flags) = 0; - - /* signal that we're done booting. - * Requires ACCESS_SURFACE_FLINGER permission - */ - virtual void bootFinished() = 0; - - /* verify that an IGraphicBufferProducer was created by SurfaceFlinger. - */ - virtual bool authenticateSurfaceTexture( - const sp& surface) const = 0; - - /* triggers screen off and waits for it to complete - * requires ACCESS_SURFACE_FLINGER permission. - */ - virtual void blank(const sp& display) = 0; - - /* triggers screen on and waits for it to complete - * requires ACCESS_SURFACE_FLINGER permission. - */ - virtual void unblank(const sp& display) = 0; - - /* returns information about a display - * intended to be used to get information about built-in displays */ - virtual status_t getDisplayInfo(const sp& display, DisplayInfo* info) = 0; - - /* Capture the specified screen. requires READ_FRAME_BUFFER permission - * This function will fail if there is a secure window on screen. - */ - virtual status_t captureScreen(const sp& display, - const sp& producer, - uint32_t reqWidth, uint32_t reqHeight, - uint32_t minLayerZ, uint32_t maxLayerZ, - bool isCpuConsumer) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnSurfaceComposer: public BnInterface { -public: - enum { - // Note: BOOT_FINISHED must remain this value, it is called from - // Java by ActivityManagerService. - BOOT_FINISHED = IBinder::FIRST_CALL_TRANSACTION, - CREATE_CONNECTION, - CREATE_GRAPHIC_BUFFER_ALLOC, - CREATE_DISPLAY_EVENT_CONNECTION, - CREATE_DISPLAY, - GET_BUILT_IN_DISPLAY, - SET_TRANSACTION_STATE, - AUTHENTICATE_SURFACE, - BLANK, - UNBLANK, - GET_DISPLAY_INFO, - CONNECT_DISPLAY, - CAPTURE_SCREEN, - }; - - virtual status_t onTransact(uint32_t code, const Parcel& data, - Parcel* reply, uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_GUI_ISURFACE_COMPOSER_H diff --git a/external/android/include/18/frameworks/native/include/gui/ISurfaceComposerClient.h b/external/android/include/18/frameworks/native/include/gui/ISurfaceComposerClient.h deleted file mode 100644 index cb9816f..0000000 --- a/external/android/include/18/frameworks/native/include/gui/ISurfaceComposerClient.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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_GUI_ISURFACE_COMPOSER_CLIENT_H -#define ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H - -#include -#include - -#include -#include - -#include - -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class IGraphicBufferProducer; - -class ISurfaceComposerClient : public IInterface -{ -public: - DECLARE_META_INTERFACE(SurfaceComposerClient); - - // flags for createSurface() - enum { // (keep in sync with Surface.java) - eHidden = 0x00000004, - eDestroyBackbuffer = 0x00000020, - eSecure = 0x00000080, - eNonPremultiplied = 0x00000100, - eOpaque = 0x00000400, - eProtectedByApp = 0x00000800, - eProtectedByDRM = 0x00001000, - - eFXSurfaceNormal = 0x00000000, - eFXSurfaceDim = 0x00020000, - eFXSurfaceMask = 0x000F0000, - }; - - /* - * Requires ACCESS_SURFACE_FLINGER permission - */ - virtual status_t createSurface( - const String8& name, uint32_t w, uint32_t h, - PixelFormat format, uint32_t flags, - sp* handle, - sp* gbp) = 0; - - /* - * Requires ACCESS_SURFACE_FLINGER permission - */ - virtual status_t destroySurface(const sp& handle) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnSurfaceComposerClient: public BnInterface { -public: - virtual status_t onTransact(uint32_t code, const Parcel& data, - Parcel* reply, uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H diff --git a/external/android/include/18/frameworks/native/include/gui/Sensor.h b/external/android/include/18/frameworks/native/include/gui/Sensor.h deleted file mode 100644 index 2af2307..0000000 --- a/external/android/include/18/frameworks/native/include/gui/Sensor.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_SENSOR_H -#define ANDROID_GUI_SENSOR_H - -#include -#include - -#include -#include -#include -#include - -#include - -#include - -// ---------------------------------------------------------------------------- -// Concrete types for the NDK -struct ASensor { }; - -// ---------------------------------------------------------------------------- -namespace android { -// ---------------------------------------------------------------------------- - -class Parcel; - -// ---------------------------------------------------------------------------- - -class Sensor : public ASensor, public LightFlattenable -{ -public: - enum { - TYPE_ACCELEROMETER = ASENSOR_TYPE_ACCELEROMETER, - TYPE_MAGNETIC_FIELD = ASENSOR_TYPE_MAGNETIC_FIELD, - TYPE_GYROSCOPE = ASENSOR_TYPE_GYROSCOPE, - TYPE_LIGHT = ASENSOR_TYPE_LIGHT, - TYPE_PROXIMITY = ASENSOR_TYPE_PROXIMITY - }; - - Sensor(); - Sensor(struct sensor_t const* hwSensor); - ~Sensor(); - - const String8& getName() const; - const String8& getVendor() const; - int32_t getHandle() const; - int32_t getType() const; - float getMinValue() const; - float getMaxValue() const; - float getResolution() const; - float getPowerUsage() const; - int32_t getMinDelay() const; - nsecs_t getMinDelayNs() const; - int32_t getVersion() const; - - // LightFlattenable protocol - inline bool isFixedSize() const { return false; } - size_t getSize() const; - status_t flatten(void* buffer) const; - status_t unflatten(void const* buffer, size_t size); - -private: - String8 mName; - String8 mVendor; - int32_t mHandle; - int32_t mType; - float mMinValue; - float mMaxValue; - float mResolution; - float mPower; - int32_t mMinDelay; - int32_t mVersion; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_SENSOR_H diff --git a/external/android/include/18/frameworks/native/include/gui/SensorEventQueue.h b/external/android/include/18/frameworks/native/include/gui/SensorEventQueue.h deleted file mode 100644 index 759b5cb..0000000 --- a/external/android/include/18/frameworks/native/include/gui/SensorEventQueue.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2010 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_SENSOR_EVENT_QUEUE_H -#define ANDROID_SENSOR_EVENT_QUEUE_H - -#include -#include - -#include -#include -#include - -#include - -// ---------------------------------------------------------------------------- - -struct ALooper; -struct ASensorEvent; - -// Concrete types for the NDK -struct ASensorEventQueue { - ALooper* looper; -}; - -// ---------------------------------------------------------------------------- -namespace android { -// ---------------------------------------------------------------------------- - -class ISensorEventConnection; -class Sensor; -class Looper; - -// ---------------------------------------------------------------------------- - -class SensorEventQueue : public ASensorEventQueue, public RefBase -{ -public: - SensorEventQueue(const sp& connection); - virtual ~SensorEventQueue(); - virtual void onFirstRef(); - - int getFd() const; - - static ssize_t write(const sp& tube, - ASensorEvent const* events, size_t numEvents); - - ssize_t read(ASensorEvent* events, size_t numEvents); - - status_t waitForEvent() const; - status_t wake() const; - - status_t enableSensor(Sensor const* sensor) const; - status_t disableSensor(Sensor const* sensor) const; - status_t setEventRate(Sensor const* sensor, nsecs_t ns) const; - - // these are here only to support SensorManager.java - status_t enableSensor(int32_t handle, int32_t us) const; - status_t disableSensor(int32_t handle) const; - -private: - sp getLooper() const; - sp mSensorEventConnection; - sp mSensorChannel; - mutable Mutex mLock; - mutable sp mLooper; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_SENSOR_EVENT_QUEUE_H diff --git a/external/android/include/18/frameworks/native/include/gui/SensorManager.h b/external/android/include/18/frameworks/native/include/gui/SensorManager.h deleted file mode 100644 index 3176462..0000000 --- a/external/android/include/18/frameworks/native/include/gui/SensorManager.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_SENSOR_MANAGER_H -#define ANDROID_GUI_SENSOR_MANAGER_H - -#include -#include - -#include - -#include -#include -#include -#include - -#include - -// ---------------------------------------------------------------------------- -// Concrete types for the NDK -struct ASensorManager { }; - -// ---------------------------------------------------------------------------- -namespace android { -// ---------------------------------------------------------------------------- - -class ISensorServer; -class Sensor; -class SensorEventQueue; - -// ---------------------------------------------------------------------------- - -class SensorManager : - public ASensorManager, - public Singleton -{ -public: - SensorManager(); - ~SensorManager(); - - ssize_t getSensorList(Sensor const* const** list) const; - Sensor const* getDefaultSensor(int type); - sp createEventQueue(); - -private: - // DeathRecipient interface - void sensorManagerDied(); - - status_t assertStateLocked() const; - -private: - mutable Mutex mLock; - mutable sp mSensorServer; - mutable Sensor const** mSensorList; - mutable Vector mSensors; - mutable sp mDeathObserver; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_SENSOR_MANAGER_H diff --git a/external/android/include/18/frameworks/native/include/gui/Surface.h b/external/android/include/18/frameworks/native/include/gui/Surface.h deleted file mode 100644 index c25847c..0000000 --- a/external/android/include/18/frameworks/native/include/gui/Surface.h +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_SURFACE_H -#define ANDROID_GUI_SURFACE_H - -#include -#include -#include - -#include -#include - -#include -#include -#include - -struct ANativeWindow_Buffer; - -namespace android { - -/* - * An implementation of ANativeWindow that feeds graphics buffers into a - * BufferQueue. - * - * This is typically used by programs that want to render frames through - * some means (maybe OpenGL, a software renderer, or a hardware decoder) - * and have the frames they create forwarded to SurfaceFlinger for - * compositing. For example, a video decoder could render a frame and call - * eglSwapBuffers(), which invokes ANativeWindow callbacks defined by - * Surface. Surface then forwards the buffers through Binder IPC - * to the BufferQueue's producer interface, providing the new frame to a - * consumer such as GLConsumer. - */ -class Surface - : public ANativeObjectBase -{ -public: - - /* - * creates a Surface from the given IGraphicBufferProducer (which concrete - * implementation is a BufferQueue). - * - * Surface is mainly state-less while it's disconnected, it can be - * viewed as a glorified IGraphicBufferProducer holder. It's therefore - * safe to create other Surfaces from the same IGraphicBufferProducer. - * - * However, once a Surface is connected, it'll prevent other Surfaces - * referring to the same IGraphicBufferProducer to become connected and - * therefore prevent them to be used as actual producers of buffers. - */ - Surface(const sp& bufferProducer); - - /* getIGraphicBufferProducer() returns the IGraphicBufferProducer this - * Surface was created with. Usually it's an error to use the - * IGraphicBufferProducer while the Surface is connected. - */ - sp getIGraphicBufferProducer() const; - - /* convenience function to check that the given surface is non NULL as - * well as its IGraphicBufferProducer */ - static bool isValid(const sp& surface) { - return surface != NULL && surface->getIGraphicBufferProducer() != NULL; - } - -protected: - virtual ~Surface(); - -private: - // can't be copied - Surface& operator = (const Surface& rhs); - Surface(const Surface& rhs); - - // ANativeWindow hooks - static int hook_cancelBuffer(ANativeWindow* window, - ANativeWindowBuffer* buffer, int fenceFd); - static int hook_dequeueBuffer(ANativeWindow* window, - ANativeWindowBuffer** buffer, int* fenceFd); - static int hook_perform(ANativeWindow* window, int operation, ...); - static int hook_query(const ANativeWindow* window, int what, int* value); - static int hook_queueBuffer(ANativeWindow* window, - ANativeWindowBuffer* buffer, int fenceFd); - static int hook_setSwapInterval(ANativeWindow* window, int interval); - - static int hook_cancelBuffer_DEPRECATED(ANativeWindow* window, - ANativeWindowBuffer* buffer); - static int hook_dequeueBuffer_DEPRECATED(ANativeWindow* window, - ANativeWindowBuffer** buffer); - static int hook_lockBuffer_DEPRECATED(ANativeWindow* window, - ANativeWindowBuffer* buffer); - static int hook_queueBuffer_DEPRECATED(ANativeWindow* window, - ANativeWindowBuffer* buffer); - - int dispatchConnect(va_list args); - int dispatchDisconnect(va_list args); - int dispatchSetBufferCount(va_list args); - int dispatchSetBuffersGeometry(va_list args); - int dispatchSetBuffersDimensions(va_list args); - int dispatchSetBuffersUserDimensions(va_list args); - int dispatchSetBuffersFormat(va_list args); - int dispatchSetScalingMode(va_list args); - int dispatchSetBuffersTransform(va_list args); - int dispatchSetBuffersTimestamp(va_list args); - int dispatchSetCrop(va_list args); - int dispatchSetPostTransformCrop(va_list args); - int dispatchSetUsage(va_list args); - int dispatchLock(va_list args); - int dispatchUnlockAndPost(va_list args); - -protected: - virtual int dequeueBuffer(ANativeWindowBuffer** buffer, int* fenceFd); - virtual int cancelBuffer(ANativeWindowBuffer* buffer, int fenceFd); - virtual int queueBuffer(ANativeWindowBuffer* buffer, int fenceFd); - virtual int perform(int operation, va_list args); - virtual int query(int what, int* value) const; - virtual int setSwapInterval(int interval); - - virtual int lockBuffer_DEPRECATED(ANativeWindowBuffer* buffer); - - virtual int connect(int api); - virtual int disconnect(int api); - virtual int setBufferCount(int bufferCount); - virtual int setBuffersDimensions(int w, int h); - virtual int setBuffersUserDimensions(int w, int h); - virtual int setBuffersFormat(int format); - virtual int setScalingMode(int mode); - virtual int setBuffersTransform(int transform); - virtual int setBuffersTimestamp(int64_t timestamp); - virtual int setCrop(Rect const* rect); - virtual int setUsage(uint32_t reqUsage); - -public: - virtual int lock(ANativeWindow_Buffer* outBuffer, ARect* inOutDirtyBounds); - virtual int unlockAndPost(); - -protected: - enum { NUM_BUFFER_SLOTS = BufferQueue::NUM_BUFFER_SLOTS }; - enum { DEFAULT_FORMAT = PIXEL_FORMAT_RGBA_8888 }; - -private: - void freeAllBuffers(); - int getSlotFromBufferLocked(android_native_buffer_t* buffer) const; - - struct BufferSlot { - sp buffer; - Region dirtyRegion; - }; - - // mSurfaceTexture is the interface to the surface texture server. All - // operations on the surface texture client ultimately translate into - // interactions with the server using this interface. - // TODO: rename to mBufferProducer - sp mGraphicBufferProducer; - - // mSlots stores the buffers that have been allocated for each buffer slot. - // It is initialized to null pointers, and gets filled in with the result of - // IGraphicBufferProducer::requestBuffer when the client dequeues a buffer from a - // slot that has not yet been used. The buffer allocated to a slot will also - // be replaced if the requested buffer usage or geometry differs from that - // of the buffer allocated to a slot. - BufferSlot mSlots[NUM_BUFFER_SLOTS]; - - // mReqWidth is the buffer width that will be requested at the next dequeue - // operation. It is initialized to 1. - uint32_t mReqWidth; - - // mReqHeight is the buffer height that will be requested at the next - // dequeue operation. It is initialized to 1. - uint32_t mReqHeight; - - // mReqFormat is the buffer pixel format that will be requested at the next - // deuque operation. It is initialized to PIXEL_FORMAT_RGBA_8888. - uint32_t mReqFormat; - - // mReqUsage is the set of buffer usage flags that will be requested - // at the next deuque operation. It is initialized to 0. - uint32_t mReqUsage; - - // mTimestamp is the timestamp that will be used for the next buffer queue - // operation. It defaults to NATIVE_WINDOW_TIMESTAMP_AUTO, which means that - // a timestamp is auto-generated when queueBuffer is called. - int64_t mTimestamp; - - // mCrop is the crop rectangle that will be used for the next buffer - // that gets queued. It is set by calling setCrop. - Rect mCrop; - - // mScalingMode is the scaling mode that will be used for the next - // buffers that get queued. It is set by calling setScalingMode. - int mScalingMode; - - // mTransform is the transform identifier that will be used for the next - // buffer that gets queued. It is set by calling setTransform. - uint32_t mTransform; - - // mDefaultWidth is default width of the buffers, regardless of the - // native_window_set_buffers_dimensions call. - uint32_t mDefaultWidth; - - // mDefaultHeight is default height of the buffers, regardless of the - // native_window_set_buffers_dimensions call. - uint32_t mDefaultHeight; - - // mUserWidth, if non-zero, is an application-specified override - // of mDefaultWidth. This is lower priority than the width set by - // native_window_set_buffers_dimensions. - uint32_t mUserWidth; - - // mUserHeight, if non-zero, is an application-specified override - // of mDefaultHeight. This is lower priority than the height set - // by native_window_set_buffers_dimensions. - uint32_t mUserHeight; - - // mTransformHint is the transform probably applied to buffers of this - // window. this is only a hint, actual transform may differ. - uint32_t mTransformHint; - - // mConsumerRunningBehind whether the consumer is running more than - // one buffer behind the producer. - mutable bool mConsumerRunningBehind; - - // mMutex is the mutex used to prevent concurrent access to the member - // variables of Surface objects. It must be locked whenever the - // member variables are accessed. - mutable Mutex mMutex; - - // must be used from the lock/unlock thread - sp mLockedBuffer; - sp mPostedBuffer; - bool mConnectedToCpu; - - // must be accessed from lock/unlock thread only - Region mDirtyRegion; -}; - -}; // namespace android - -#endif // ANDROID_GUI_SURFACE_H diff --git a/external/android/include/18/frameworks/native/include/gui/SurfaceComposerClient.h b/external/android/include/18/frameworks/native/include/gui/SurfaceComposerClient.h deleted file mode 100644 index 6bf5b47..0000000 --- a/external/android/include/18/frameworks/native/include/gui/SurfaceComposerClient.h +++ /dev/null @@ -1,203 +0,0 @@ -/* - * 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_GUI_SURFACE_COMPOSER_CLIENT_H -#define ANDROID_GUI_SURFACE_COMPOSER_CLIENT_H - -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include - -#include -#include - -namespace android { - -// --------------------------------------------------------------------------- - -class DisplayInfo; -class Composer; -class ISurfaceComposerClient; -class IGraphicBufferProducer; -class Region; - -// --------------------------------------------------------------------------- - -class SurfaceComposerClient : public RefBase -{ - friend class Composer; -public: - SurfaceComposerClient(); - virtual ~SurfaceComposerClient(); - - // Always make sure we could initialize - status_t initCheck() const; - - // Return the connection of this client - sp connection() const; - - // Forcibly remove connection before all references have gone away. - void dispose(); - - // callback when the composer is dies - status_t linkToComposerDeath(const sp& recipient, - void* cookie = NULL, uint32_t flags = 0); - - // Get information about a display - static status_t getDisplayInfo(const sp& display, DisplayInfo* info); - - /* triggers screen off and waits for it to complete */ - static void blankDisplay(const sp& display); - - /* triggers screen on and waits for it to complete */ - static void unblankDisplay(const sp& display); - - // ------------------------------------------------------------------------ - // surface creation / destruction - - //! Create a surface - sp createSurface( - const String8& name,// name of the surface - uint32_t w, // width in pixel - uint32_t h, // height in pixel - PixelFormat format, // pixel-format desired - uint32_t flags = 0 // usage flags - ); - - //! Create a display - static sp createDisplay(const String8& displayName, bool secure); - - //! Get the token for the existing default displays. - //! Possible values for id are eDisplayIdMain and eDisplayIdHdmi. - static sp getBuiltInDisplay(int32_t id); - - // ------------------------------------------------------------------------ - // Composer parameters - // All composer parameters must be changed within a transaction - // several surfaces can be updated in one transaction, all changes are - // committed at once when the transaction is closed. - // closeGlobalTransaction() requires an IPC with the server. - - //! Open a composer transaction on all active SurfaceComposerClients. - static void openGlobalTransaction(); - - //! Close a composer transaction on all active SurfaceComposerClients. - static void closeGlobalTransaction(bool synchronous = false); - - //! Flag the currently open transaction as an animation transaction. - static void setAnimationTransaction(); - - status_t hide(const sp& id); - status_t show(const sp& id); - status_t setFlags(const sp& id, uint32_t flags, uint32_t mask); - status_t setTransparentRegionHint(const sp& id, const Region& transparent); - status_t setLayer(const sp& id, int32_t layer); - status_t setAlpha(const sp& id, float alpha=1.0f); - status_t setMatrix(const sp& id, float dsdx, float dtdx, float dsdy, float dtdy); - status_t setPosition(const sp& id, float x, float y); - status_t setSize(const sp& id, uint32_t w, uint32_t h); - status_t setCrop(const sp& id, const Rect& crop); - status_t setLayerStack(const sp& id, uint32_t layerStack); - status_t destroySurface(const sp& id); - - static void setDisplaySurface(const sp& token, - const sp& bufferProducer); - static void setDisplayLayerStack(const sp& token, - uint32_t layerStack); - - /* setDisplayProjection() defines the projection of layer stacks - * to a given display. - * - * - orientation defines the display's orientation. - * - layerStackRect defines which area of the window manager coordinate - * space will be used. - * - displayRect defines where on the display will layerStackRect be - * mapped to. displayRect is specified post-orientation, that is - * it uses the orientation seen by the end-user. - */ - static void setDisplayProjection(const sp& token, - uint32_t orientation, - const Rect& layerStackRect, - const Rect& displayRect); - -private: - virtual void onFirstRef(); - Composer& getComposer(); - - mutable Mutex mLock; - status_t mStatus; - sp mClient; - Composer& mComposer; -}; - -// --------------------------------------------------------------------------- - -class ScreenshotClient -{ -public: - static status_t capture( - const sp& display, - const sp& producer, - uint32_t reqWidth, uint32_t reqHeight, - uint32_t minLayerZ, uint32_t maxLayerZ); - -private: - mutable sp mCpuConsumer; - CpuConsumer::LockedBuffer mBuffer; - bool mHaveBuffer; - -public: - ScreenshotClient(); - ~ScreenshotClient(); - - // frees the previous screenshot and capture a new one - status_t update(const sp& display); - status_t update(const sp& display, - uint32_t reqWidth, uint32_t reqHeight); - status_t update(const sp& display, - uint32_t reqWidth, uint32_t reqHeight, - uint32_t minLayerZ, uint32_t maxLayerZ); - - sp getCpuConsumer() const; - - // release memory occupied by the screenshot - void release(); - - // pixels are valid until this object is freed or - // release() or update() is called - void const* getPixels() const; - - uint32_t getWidth() const; - uint32_t getHeight() const; - PixelFormat getFormat() const; - uint32_t getStride() const; - // size of allocated memory in bytes - size_t getSize() const; -}; - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_SURFACE_COMPOSER_CLIENT_H diff --git a/external/android/include/18/frameworks/native/include/gui/SurfaceControl.h b/external/android/include/18/frameworks/native/include/gui/SurfaceControl.h deleted file mode 100644 index f27754c..0000000 --- a/external/android/include/18/frameworks/native/include/gui/SurfaceControl.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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_GUI_SURFACE_CONTROL_H -#define ANDROID_GUI_SURFACE_CONTROL_H - -#include -#include - -#include -#include -#include - -#include -#include - -#include - -namespace android { - -// --------------------------------------------------------------------------- - -class IGraphicBufferProducer; -class Surface; -class SurfaceComposerClient; - -// --------------------------------------------------------------------------- - -class SurfaceControl : public RefBase -{ -public: - static bool isValid(const sp& surface) { - return (surface != 0) && surface->isValid(); - } - - bool isValid() { - return mHandle!=0 && mClient!=0; - } - - static bool isSameSurface( - const sp& lhs, const sp& rhs); - - // release surface data from java - void clear(); - - status_t setLayerStack(int32_t layerStack); - status_t setLayer(int32_t layer); - status_t setPosition(float x, float y); - status_t setSize(uint32_t w, uint32_t h); - status_t hide(); - status_t show(); - status_t setFlags(uint32_t flags, uint32_t mask); - status_t setTransparentRegionHint(const Region& transparent); - status_t setAlpha(float alpha=1.0f); - status_t setMatrix(float dsdx, float dtdx, float dsdy, float dtdy); - status_t setCrop(const Rect& crop); - - static status_t writeSurfaceToParcel( - const sp& control, Parcel* parcel); - - sp getSurface() const; - -private: - // can't be copied - SurfaceControl& operator = (SurfaceControl& rhs); - SurfaceControl(const SurfaceControl& rhs); - - friend class SurfaceComposerClient; - friend class Surface; - - SurfaceControl( - const sp& client, - const sp& handle, - const sp& gbp); - - ~SurfaceControl(); - - status_t validate() const; - void destroy(); - - sp mClient; - sp mHandle; - sp mGraphicBufferProducer; - mutable Mutex mLock; - mutable sp mSurfaceData; -}; - -}; // namespace android - -#endif // ANDROID_GUI_SURFACE_CONTROL_H diff --git a/external/android/include/18/frameworks/native/include/media/drm/DrmAPI.h b/external/android/include/18/frameworks/native/include/media/drm/DrmAPI.h deleted file mode 100644 index fbf93bc..0000000 --- a/external/android/include/18/frameworks/native/include/media/drm/DrmAPI.h +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Copyright (C) 2013 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 DRM_API_H_ -#define DRM_API_H_ - -#include -#include -#include -#include -#include -#include -#include - -// Loadable DrmEngine shared libraries should define the entry points -// createDrmFactory and createCryptoFactory as shown below: -// -// extern "C" { -// extern android::DrmFactory *createDrmFactory(); -// extern android::CryptoFactory *createCryptoFactory(); -// } - -namespace android { - - class DrmPlugin; - class DrmPluginListener; - - // DRMs are implemented in DrmEngine plugins, which are dynamically - // loadable shared libraries that implement the entry points - // createDrmFactory and createCryptoFactory. createDrmFactory - // constructs and returns an instance of a DrmFactory object. Similarly, - // createCryptoFactory creates an instance of a CryptoFactory object. - // When a MediaCrypto or MediaDrm object needs to be constructed, all - // available DrmEngines present in the plugins directory on the device - // are scanned for a matching DrmEngine that can support the crypto - // scheme. When a match is found, the DrmEngine's createCryptoPlugin and - // createDrmPlugin methods are used to create CryptoPlugin or - // DrmPlugin instances to support that DRM scheme. - - class DrmFactory { - public: - DrmFactory() {} - virtual ~DrmFactory() {} - - // DrmFactory::isCryptoSchemeSupported can be called to determine - // if the plugin factory is able to construct plugins that support a - // given crypto scheme, which is specified by a UUID. - virtual bool isCryptoSchemeSupported(const uint8_t uuid[16]) = 0; - - // Construct a DrmPlugin for the crypto scheme specified by UUID. - virtual status_t createDrmPlugin( - const uint8_t uuid[16], DrmPlugin **plugin) = 0; - - private: - DrmFactory(const DrmFactory &); - DrmFactory &operator=(const DrmFactory &); - }; - - class DrmPlugin { - public: - enum EventType { - kDrmPluginEventProvisionRequired = 1, - kDrmPluginEventKeyNeeded, - kDrmPluginEventKeyExpired, - kDrmPluginEventVendorDefined - }; - - // Drm keys can be for offline content or for online streaming. - // Offline keys are persisted on the device and may be used when the device - // is disconnected from the network. The Release type is used to request - // that offline keys be no longer restricted to offline use. - enum KeyType { - kKeyType_Offline, - kKeyType_Streaming, - kKeyType_Release - }; - - DrmPlugin() {} - virtual ~DrmPlugin() {} - - // Open a new session with the DrmPlugin object. A session ID is returned - // in the sessionId parameter. - virtual status_t openSession(Vector &sessionId) = 0; - - // Close a session on the DrmPlugin object. - virtual status_t closeSession(Vector const &sessionId) = 0; - - // A key request/response exchange occurs between the app and a License - // Server to obtain the keys required to decrypt the content. getKeyRequest() - // is used to obtain an opaque key request blob that is delivered to the - // license server. - // - // The scope parameter may be a sessionId or a keySetId, depending on the - // specified keyType. When the keyType is kKeyType_Offline or - // kKeyType_Streaming, scope should be set to the sessionId the keys will be - // provided to. When the keyType is kKeyType_Release, scope should be set to - // the keySetId of the keys being released. Releasing keys from a device - // invalidates them for all sessions. - // - // The init data passed to getKeyRequest is container-specific and its - // meaning is interpreted based on the mime type provided in the mimeType - // parameter to getKeyRequest. It could contain, for example, the content - // ID, key ID or other data obtained from the content metadata that is required - // in generating the key request. Init may be null when keyType is - // kKeyType_Release. - // - // mimeType identifies the mime type of the content - // - // keyType specifies if the keys are to be used for streaming or offline content - // - // optionalParameters are included in the key request message to allow a - // client application to provide additional message parameters to the server. - // - // If successful, the opaque key request blob is returned to the caller. - virtual status_t - getKeyRequest(Vector const &scope, - Vector const &initData, - String8 const &mimeType, KeyType keyType, - KeyedVector const &optionalParameters, - Vector &request, String8 &defaultUrl) = 0; - - // - // After a key response is received by the app, it is provided to the - // Drm plugin using provideKeyResponse. - // - // scope may be a sessionId or a keySetId depending on the type of the - // response. Scope should be set to the sessionId when the response is - // for either streaming or offline key requests. Scope should be set to the - // keySetId when the response is for a release request. - // - // When the response is for an offline key request, a keySetId is returned - // in the keySetId vector parameter that can be used to later restore the - // keys to a new session with the method restoreKeys. When the response is - // for a streaming or release request, no keySetId is returned. - // - virtual status_t provideKeyResponse(Vector const &scope, - Vector const &response, - Vector &keySetId) = 0; - - // Remove the current keys from a session - virtual status_t removeKeys(Vector const &sessionId) = 0; - - // Restore persisted offline keys into a new session. keySetId identifies - // the keys to load, obtained from a prior call to provideKeyResponse(). - virtual status_t restoreKeys(Vector const &sessionId, - Vector const &keySetId) = 0; - - // Request an informative description of the license for the session. The status - // is in the form of {name, value} pairs. Since DRM license policies vary by - // vendor, the specific status field names are determined by each DRM vendor. - // Refer to your DRM provider documentation for definitions of the field names - // for a particular DrmEngine. - virtual status_t - queryKeyStatus(Vector const &sessionId, - KeyedVector &infoMap) const = 0; - - // A provision request/response exchange occurs between the app and a - // provisioning server to retrieve a device certificate. getProvisionRequest - // is used to obtain an opaque key request blob that is delivered to the - // provisioning server. - // - // If successful, the opaque provision request blob is returned to the caller. - virtual status_t getProvisionRequest(Vector &request, - String8 &defaultUrl) = 0; - - // After a provision response is received by the app, it is provided to the - // Drm plugin using provideProvisionResponse. - virtual status_t provideProvisionResponse(Vector const &response) = 0; - - // A means of enforcing the contractual requirement for a concurrent stream - // limit per subscriber across devices is provided via SecureStop. SecureStop - // is a means of securely monitoring the lifetime of sessions. Since playback - // on a device can be interrupted due to reboot, power failure, etc. a means - // of persisting the lifetime information on the device is needed. - // - // A signed version of the sessionID is written to persistent storage on the - // device when each MediaCrypto object is created. The sessionID is signed by - // the device private key to prevent tampering. - // - // In the normal case, playback will be completed, the session destroyed and - // the Secure Stops will be queried. The App queries secure stops and forwards - // the secure stop message to the server which verifies the signature and - // notifies the server side database that the session destruction has been - // confirmed. The persisted record on the client is only removed after positive - // confirmation that the server received the message using releaseSecureStops(). - virtual status_t getSecureStops(List > &secureStops) = 0; - virtual status_t releaseSecureStops(Vector const &ssRelease) = 0; - - // Read a property value given the device property string. There are a few forms - // of property access methods, depending on the data type returned. - // Since DRM plugin properties may vary, additional field names may be defined - // by each DRM vendor. Refer to your DRM provider documentation for definitions - // of its additional field names. - // - // Standard values are: - // "vendor" [string] identifies the maker of the plugin - // "version" [string] identifies the version of the plugin - // "description" [string] describes the plugin - // 'deviceUniqueId' [byte array] The device unique identifier is established - // during device provisioning and provides a means of uniquely identifying - // each device. - virtual status_t getPropertyString(String8 const &name, String8 &value ) const = 0; - virtual status_t getPropertyByteArray(String8 const &name, - Vector &value ) const = 0; - - // Write a property value given the device property string. There are a few forms - // of property setting methods, depending on the data type. - // Since DRM plugin properties may vary, additional field names may be defined - // by each DRM vendor. Refer to your DRM provider documentation for definitions - // of its field names. - virtual status_t setPropertyString(String8 const &name, - String8 const &value ) = 0; - virtual status_t setPropertyByteArray(String8 const &name, - Vector const &value ) = 0; - - // The following methods implement operations on a CryptoSession to support - // encrypt, decrypt, sign verify operations on operator-provided - // session keys. - - // - // The algorithm string conforms to JCA Standard Names for Cipher - // Transforms and is case insensitive. For example "AES/CBC/PKCS5Padding". - // - // Return OK if the algorithm is supported, otherwise return BAD_VALUE - // - virtual status_t setCipherAlgorithm(Vector const &sessionId, - String8 const &algorithm) = 0; - - // - // The algorithm string conforms to JCA Standard Names for Mac - // Algorithms and is case insensitive. For example "HmacSHA256". - // - // Return OK if the algorithm is supported, otherwise return BAD_VALUE - // - virtual status_t setMacAlgorithm(Vector const &sessionId, - String8 const &algorithm) = 0; - - // Encrypt the provided input buffer with the cipher algorithm - // specified by setCipherAlgorithm and the key selected by keyId, - // and return the encrypted data. - virtual status_t encrypt(Vector const &sessionId, - Vector const &keyId, - Vector const &input, - Vector const &iv, - Vector &output) = 0; - - // Decrypt the provided input buffer with the cipher algorithm - // specified by setCipherAlgorithm and the key selected by keyId, - // and return the decrypted data. - virtual status_t decrypt(Vector const &sessionId, - Vector const &keyId, - Vector const &input, - Vector const &iv, - Vector &output) = 0; - - // Compute a signature on the provided message using the mac algorithm - // specified by setMacAlgorithm and the key selected by keyId, - // and return the signature. - virtual status_t sign(Vector const &sessionId, - Vector const &keyId, - Vector const &message, - Vector &signature) = 0; - - // Compute a signature on the provided message using the mac algorithm - // specified by setMacAlgorithm and the key selected by keyId, - // and compare with the expected result. Set result to true or - // false depending on the outcome. - virtual status_t verify(Vector const &sessionId, - Vector const &keyId, - Vector const &message, - Vector const &signature, - bool &match) = 0; - - - status_t setListener(const sp& listener) { - Mutex::Autolock lock(mEventLock); - mListener = listener; - return OK; - } - - protected: - // Plugins call sendEvent to deliver events to the java app - void sendEvent(EventType eventType, int extra, - Vector const *sessionId, - Vector const *data); - - private: - Mutex mEventLock; - sp mListener; - - DISALLOW_EVIL_CONSTRUCTORS(DrmPlugin); - }; - - class DrmPluginListener: virtual public RefBase - { - public: - virtual void sendEvent(DrmPlugin::EventType eventType, int extra, - Vector const *sesionId, - Vector const *data) = 0; - }; - - inline void DrmPlugin::sendEvent(EventType eventType, int extra, - Vector const *sessionId, - Vector const *data) { - - mEventLock.lock(); - sp listener = mListener; - mEventLock.unlock(); - - if (listener != NULL) { - listener->sendEvent(eventType, extra, sessionId, data); - } - } - -} // namespace android - -#endif // DRM_API_H_ diff --git a/external/android/include/18/frameworks/native/include/media/editor/II420ColorConverter.h b/external/android/include/18/frameworks/native/include/media/editor/II420ColorConverter.h deleted file mode 100644 index 33af61f..0000000 --- a/external/android/include/18/frameworks/native/include/media/editor/II420ColorConverter.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (C) 2011 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 II420_COLOR_CONVERTER_H - -#define II420_COLOR_CONVERTER_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct II420ColorConverter { - - /* - * getDecoderOutputFormat - * Returns the color format (OMX_COLOR_FORMATTYPE) of the decoder output. - * If it is I420 (OMX_COLOR_FormatYUV420Planar), no conversion is needed, - * and convertDecoderOutputToI420() can be a no-op. - */ - int (*getDecoderOutputFormat)(); - - /* - * convertDecoderOutputToI420 - * @Desc Converts from the decoder output format to I420 format. - * @note Caller (e.g. VideoEditor) owns the buffers - * @param decoderBits (IN) Pointer to the buffer contains decoder output - * @param decoderWidth (IN) Buffer width, as reported by the decoder - * metadata (kKeyWidth) - * @param decoderHeight (IN) Buffer height, as reported by the decoder - * metadata (kKeyHeight) - * @param decoderRect (IN) The rectangle of the actual frame, as - * reported by decoder metadata (kKeyCropRect) - * @param dstBits (OUT) Pointer to the output I420 buffer - * @return -1 Any error - * @return 0 No Error - */ - int (*convertDecoderOutputToI420)( - void* decoderBits, int decoderWidth, int decoderHeight, - ARect decoderRect, void* dstBits); - - /* - * getEncoderIntputFormat - * Returns the color format (OMX_COLOR_FORMATTYPE) of the encoder input. - * If it is I420 (OMX_COLOR_FormatYUV420Planar), no conversion is needed, - * and convertI420ToEncoderInput() and getEncoderInputBufferInfo() can - * be no-ops. - */ - int (*getEncoderInputFormat)(); - - /* convertI420ToEncoderInput - * @Desc This function converts from I420 to the encoder input format - * @note Caller (e.g. VideoEditor) owns the buffers - * @param srcBits (IN) Pointer to the input I420 buffer - * @param srcWidth (IN) Width of the I420 frame - * @param srcHeight (IN) Height of the I420 frame - * @param encoderWidth (IN) Encoder buffer width, as calculated by - * getEncoderBufferInfo() - * @param encoderHeight (IN) Encoder buffer height, as calculated by - * getEncoderBufferInfo() - * @param encoderRect (IN) Rect coordinates of the actual frame inside - * the encoder buffer, as calculated by - * getEncoderBufferInfo(). - * @param encoderBits (OUT) Pointer to the output buffer. The size of - * this buffer is calculated by - * getEncoderBufferInfo() - * @return -1 Any error - * @return 0 No Error - */ - int (*convertI420ToEncoderInput)( - void* srcBits, int srcWidth, int srcHeight, - int encoderWidth, int encoderHeight, ARect encoderRect, - void* encoderBits); - - /* getEncoderInputBufferInfo - * @Desc This function returns metadata for the encoder input buffer - * based on the actual I420 frame width and height. - * @note This API should be be used to obtain the necessary information - * before calling convertI420ToEncoderInput(). - * VideoEditor knows only the width and height of the I420 buffer, - * but it also needs know the width, height, and size of the - * encoder input buffer. The encoder input buffer width and height - * are used to set the metadata for the encoder. - * @param srcWidth (IN) Width of the I420 frame - * @param srcHeight (IN) Height of the I420 frame - * @param encoderWidth (OUT) Encoder buffer width needed - * @param encoderHeight (OUT) Encoder buffer height needed - * @param encoderRect (OUT) Rect coordinates of the actual frame inside - * the encoder buffer - * @param encoderBufferSize (OUT) The size of the buffer that need to be - * allocated by the caller before invoking - * convertI420ToEncoderInput(). - * @return -1 Any error - * @return 0 No Error - */ - int (*getEncoderInputBufferInfo)( - int srcWidth, int srcHeight, - int* encoderWidth, int* encoderHeight, - ARect* encoderRect, int* encoderBufferSize); - -} II420ColorConverter; - -/* The only function that the shared library needs to expose: It fills the - function pointers in II420ColorConverter */ -void getI420ColorConverter(II420ColorConverter *converter); - -#if defined(__cplusplus) -} -#endif - -#endif // II420_COLOR_CONVERTER_H diff --git a/external/android/include/18/frameworks/native/include/media/hardware/CryptoAPI.h b/external/android/include/18/frameworks/native/include/media/hardware/CryptoAPI.h deleted file mode 100644 index 44a0040..0000000 --- a/external/android/include/18/frameworks/native/include/media/hardware/CryptoAPI.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2012 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 - -#ifndef CRYPTO_API_H_ - -#define CRYPTO_API_H_ - -namespace android { - -struct AString; -struct CryptoPlugin; - -struct CryptoFactory { - CryptoFactory() {} - virtual ~CryptoFactory() {} - - virtual bool isCryptoSchemeSupported(const uint8_t uuid[16]) const = 0; - - virtual status_t createPlugin( - const uint8_t uuid[16], const void *data, size_t size, - CryptoPlugin **plugin) = 0; - -private: - CryptoFactory(const CryptoFactory &); - CryptoFactory &operator=(const CryptoFactory &); -}; - -struct CryptoPlugin { - enum Mode { - kMode_Unencrypted = 0, - kMode_AES_CTR = 1, - - // Neither key nor iv are being used in this mode. - // Each subsample is encrypted w/ an iv of all zeroes. - kMode_AES_WV = 2, // FIX constant - }; - - struct SubSample { - size_t mNumBytesOfClearData; - size_t mNumBytesOfEncryptedData; - }; - - CryptoPlugin() {} - virtual ~CryptoPlugin() {} - - // If this method returns false, a non-secure decoder will be used to - // decode the data after decryption. The decrypt API below will have - // to support insecure decryption of the data (secure = false) for - // media data of the given mime type. - virtual bool requiresSecureDecoderComponent(const char *mime) const = 0; - - // If the error returned falls into the range - // ERROR_DRM_VENDOR_MIN..ERROR_DRM_VENDOR_MAX, errorDetailMsg should be - // filled in with an appropriate string. - // At the java level these special errors will then trigger a - // MediaCodec.CryptoException that gives clients access to both - // the error code and the errorDetailMsg. - // Returns a non-negative result to indicate the number of bytes written - // to the dstPtr, or a negative result to indicate an error. - virtual ssize_t decrypt( - bool secure, - const uint8_t key[16], - const uint8_t iv[16], - Mode mode, - const void *srcPtr, - const SubSample *subSamples, size_t numSubSamples, - void *dstPtr, - AString *errorDetailMsg) = 0; - -private: - CryptoPlugin(const CryptoPlugin &); - CryptoPlugin &operator=(const CryptoPlugin &); -}; - -} // namespace android - -extern "C" { - extern android::CryptoFactory *createCryptoFactory(); -} - -#endif // CRYPTO_API_H_ diff --git a/external/android/include/18/frameworks/native/include/media/hardware/HDCPAPI.h b/external/android/include/18/frameworks/native/include/media/hardware/HDCPAPI.h deleted file mode 100644 index 147448e..0000000 --- a/external/android/include/18/frameworks/native/include/media/hardware/HDCPAPI.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (C) 2012 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 HDCP_API_H_ - -#define HDCP_API_H_ - -#include - -namespace android { - -// Two different kinds of modules are covered under the same HDCPModule -// structure below, a module either implements decryption or encryption. -struct HDCPModule { - typedef void (*ObserverFunc)(void *cookie, int msg, int ext1, int ext2); - - // The msg argument in calls to the observer notification function. - enum { - // Sent in response to a call to "HDCPModule::initAsync" once - // initialization has either been successfully completed, - // i.e. the HDCP session is now fully setup (AKE, Locality Check, - // SKE and any authentication with repeaters completed) or failed. - // ext1 should be a suitable error code (status_t), ext2 is - // unused for ENCRYPTION and in the case of HDCP_INITIALIZATION_COMPLETE - // holds the local TCP port the module is listening on. - HDCP_INITIALIZATION_COMPLETE, - HDCP_INITIALIZATION_FAILED, - - // Sent upon completion of a call to "HDCPModule::shutdownAsync". - // ext1 should be a suitable error code, ext2 is unused. - HDCP_SHUTDOWN_COMPLETE, - HDCP_SHUTDOWN_FAILED, - - HDCP_UNAUTHENTICATED_CONNECTION, - HDCP_UNAUTHORIZED_CONNECTION, - HDCP_REVOKED_CONNECTION, - HDCP_TOPOLOGY_EXECEEDED, - HDCP_UNKNOWN_ERROR, - - // DECRYPTION only: Indicates that a client has successfully connected, - // a secure session established and the module is ready to accept - // future calls to "decrypt". - HDCP_SESSION_ESTABLISHED, - }; - - // Module can call the notification function to signal completion/failure - // of asynchronous operations (such as initialization) or out of band - // events. - HDCPModule(void *cookie, ObserverFunc observerNotify) {}; - - virtual ~HDCPModule() {}; - - // ENCRYPTION: Request to setup an HDCP session with the host specified - // by addr and listening on the specified port. - // DECRYPTION: Request to setup an HDCP session, addr is the interface - // address the module should bind its socket to. port will be 0. - // The module will pick the port to listen on itself and report its choice - // in the "ext2" argument of the HDCP_INITIALIZATION_COMPLETE callback. - virtual status_t initAsync(const char *addr, unsigned port) = 0; - - // Request to shutdown the active HDCP session. - virtual status_t shutdownAsync() = 0; - - // ENCRYPTION only: - // Encrypt data according to the HDCP spec. "size" bytes of data are - // available at "inData" (virtual address), "size" may not be a multiple - // of 128 bits (16 bytes). An equal number of encrypted bytes should be - // written to the buffer at "outData" (virtual address). - // This operation is to be synchronous, i.e. this call does not return - // until outData contains size bytes of encrypted data. - // streamCTR will be assigned by the caller (to 0 for the first PES stream, - // 1 for the second and so on) - // inputCTR _will_be_maintained_by_the_callee_ for each PES stream. - virtual status_t encrypt( - const void *inData, size_t size, uint32_t streamCTR, - uint64_t *outInputCTR, void *outData) { - return INVALID_OPERATION; - } - - // DECRYPTION only: - // Decrypt data according to the HDCP spec. - // "size" bytes of encrypted data are available at "inData" - // (virtual address), "size" may not be a multiple of 128 bits (16 bytes). - // An equal number of decrypted bytes should be written to the buffer - // at "outData" (virtual address). - // This operation is to be synchronous, i.e. this call does not return - // until outData contains size bytes of decrypted data. - // Both streamCTR and inputCTR will be provided by the caller. - virtual status_t decrypt( - const void *inData, size_t size, - uint32_t streamCTR, uint64_t inputCTR, - void *outData) { - return INVALID_OPERATION; - } - -private: - HDCPModule(const HDCPModule &); - HDCPModule &operator=(const HDCPModule &); -}; - -} // namespace android - -// A shared library exporting the following methods should be included to -// support HDCP functionality. The shared library must be called -// "libstagefright_hdcp.so", it will be dynamically loaded into the -// mediaserver process. -extern "C" { - // Create a module for ENCRYPTION. - extern android::HDCPModule *createHDCPModule( - void *cookie, android::HDCPModule::ObserverFunc); - - // Create a module for DECRYPTION. - extern android::HDCPModule *createHDCPModuleForDecryption( - void *cookie, android::HDCPModule::ObserverFunc); -} - -#endif // HDCP_API_H_ - diff --git a/external/android/include/18/frameworks/native/include/media/hardware/HardwareAPI.h b/external/android/include/18/frameworks/native/include/media/hardware/HardwareAPI.h deleted file mode 100644 index cc43bf6..0000000 --- a/external/android/include/18/frameworks/native/include/media/hardware/HardwareAPI.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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 HARDWARE_API_H_ - -#define HARDWARE_API_H_ - -#include -#include -#include - -#include - -namespace android { - -// A pointer to this struct is passed to the OMX_SetParameter when the extension -// index for the 'OMX.google.android.index.enableAndroidNativeBuffers' extension -// is given. -// -// When Android native buffer use is disabled for a port (the default state), -// the OMX node should operate as normal, and expect UseBuffer calls to set its -// buffers. This is the mode that will be used when CPU access to the buffer is -// required. -// -// When Android native buffer use has been enabled for a given port, the video -// color format for the port is to be interpreted as an Android pixel format -// rather than an OMX color format. The node should then expect to receive -// UseAndroidNativeBuffer calls (via OMX_SetParameter) rather than UseBuffer -// calls for that port. -struct EnableAndroidNativeBuffersParams { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL enable; -}; - -// A pointer to this struct is passed to OMX_SetParameter() when the extension -// index "OMX.google.android.index.storeMetaDataInBuffers" -// is given. -// -// When meta data is stored in the video buffers passed between OMX clients -// and OMX components, interpretation of the buffer data is up to the -// buffer receiver, and the data may or may not be the actual video data, but -// some information helpful for the receiver to locate the actual data. -// The buffer receiver thus needs to know how to interpret what is stored -// in these buffers, with mechanisms pre-determined externally. How to -// interpret the meta data is outside of the scope of this method. -// -// Currently, this is specifically used to pass meta data from video source -// (camera component, for instance) to video encoder to avoid memcpying of -// input video frame data. To do this, bStoreMetaDta is set to OMX_TRUE. -// If bStoreMetaData is set to false, real YUV frame data will be stored -// in the buffers. In addition, if no OMX_SetParameter() call is made -// with the corresponding extension index, real YUV data is stored -// in the buffers. -struct StoreMetaDataInBuffersParams { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL bStoreMetaData; -}; - -// A pointer to this struct is passed to OMX_SetParameter when the extension -// index for the 'OMX.google.android.index.useAndroidNativeBuffer' extension is -// given. This call will only be performed if a prior call was made with the -// 'OMX.google.android.index.enableAndroidNativeBuffers' extension index, -// enabling use of Android native buffers. -struct UseAndroidNativeBufferParams { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_PTR pAppPrivate; - OMX_BUFFERHEADERTYPE **bufferHeader; - const sp& nativeBuffer; -}; - -// A pointer to this struct is passed to OMX_GetParameter when the extension -// index for the 'OMX.google.android.index.getAndroidNativeBufferUsage' -// extension is given. The usage bits returned from this query will be used to -// allocate the Gralloc buffers that get passed to the useAndroidNativeBuffer -// command. -struct GetAndroidNativeBufferUsageParams { - OMX_U32 nSize; // IN - OMX_VERSIONTYPE nVersion; // IN - OMX_U32 nPortIndex; // IN - OMX_U32 nUsage; // OUT -}; - -// An enum OMX_COLOR_FormatAndroidOpaque to indicate an opaque colorformat -// is declared in media/stagefright/openmax/OMX_IVCommon.h -// This will inform the encoder that the actual -// colorformat will be relayed by the GRalloc Buffers. -// OMX_COLOR_FormatAndroidOpaque = 0x7F000001, - -// A pointer to this struct is passed to OMX_SetParameter when the extension -// index for the 'OMX.google.android.index.prependSPSPPSToIDRFrames' extension -// is given. -// A successful result indicates that future IDR frames will be prefixed by -// SPS/PPS. -struct PrependSPSPPSToIDRFramesParams { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_BOOL bEnable; -}; - -} // namespace android - -extern android::OMXPluginBase *createOMXPlugin(); - -#endif // HARDWARE_API_H_ diff --git a/external/android/include/18/frameworks/native/include/media/hardware/MetadataBufferType.h b/external/android/include/18/frameworks/native/include/media/hardware/MetadataBufferType.h deleted file mode 100644 index 4eaf8ac..0000000 --- a/external/android/include/18/frameworks/native/include/media/hardware/MetadataBufferType.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2011 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 METADATA_BUFFER_TYPE_H -#define METADATA_BUFFER_TYPE_H - -#ifdef __cplusplus -extern "C" { -namespace android { -#endif - -/* - * MetadataBufferType defines the type of the metadata buffers that - * can be passed to video encoder component for encoding, via Stagefright - * media recording framework. To see how to work with the metadata buffers - * in media recording framework, please consult HardwareAPI.h - * - * The creator of metadata buffers and video encoder share common knowledge - * on what is actually being stored in these metadata buffers, and - * how the information can be used by the video encoder component - * to locate the actual pixel data as the source input for video - * encoder, plus whatever other information that is necessary. Stagefright - * media recording framework does not need to know anything specific about the - * metadata buffers, except for receving each individual metadata buffer - * as the source input, making a copy of the metadata buffer, and passing the - * copy via OpenMAX API to the video encoder component. - * - * The creator of the metadata buffers must ensure that the first - * 4 bytes in every metadata buffer indicates its buffer type, - * and the rest of the metadata buffer contains the - * actual metadata information. When a video encoder component receives - * a metadata buffer, it uses the first 4 bytes in that buffer to find - * out the type of the metadata buffer, and takes action appropriate - * to that type of metadata buffers (for instance, locate the actual - * pixel data input and then encoding the input data to produce a - * compressed output buffer). - * - * The following shows the layout of a metadata buffer, - * where buffer type is a 4-byte field of MetadataBufferType, - * and the payload is the metadata information. - * - * -------------------------------------------------------------- - * | buffer type | payload | - * -------------------------------------------------------------- - * - */ -typedef enum { - - /* - * kMetadataBufferTypeCameraSource is used to indicate that - * the source of the metadata buffer is the camera component. - */ - kMetadataBufferTypeCameraSource = 0, - - /* - * kMetadataBufferTypeGrallocSource is used to indicate that - * the payload of the metadata buffers can be interpreted as - * a buffer_handle_t. - * So in this case,the metadata that the encoder receives - * will have a byte stream that consists of two parts: - * 1. First, there is an integer indicating that it is a GRAlloc - * source (kMetadataBufferTypeGrallocSource) - * 2. This is followed by the buffer_handle_t that is a handle to the - * GRalloc buffer. The encoder needs to interpret this GRalloc handle - * and encode the frames. - * -------------------------------------------------------------- - * | kMetadataBufferTypeGrallocSource | sizeof(buffer_handle_t) | - * -------------------------------------------------------------- - */ - kMetadataBufferTypeGrallocSource = 1, - - // Add more here... - -} MetadataBufferType; - -#ifdef __cplusplus -} // namespace android -} -#endif - -#endif // METADATA_BUFFER_TYPE_H diff --git a/external/android/include/18/frameworks/native/include/media/hardware/OMXPluginBase.h b/external/android/include/18/frameworks/native/include/media/hardware/OMXPluginBase.h deleted file mode 100644 index 7bf4147..0000000 --- a/external/android/include/18/frameworks/native/include/media/hardware/OMXPluginBase.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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 OMX_PLUGIN_BASE_H_ - -#define OMX_PLUGIN_BASE_H_ - -#include - -#include - -#include -#include - -namespace android { - -struct OMXPluginBase { - OMXPluginBase() {} - virtual ~OMXPluginBase() {} - - virtual OMX_ERRORTYPE makeComponentInstance( - const char *name, - const OMX_CALLBACKTYPE *callbacks, - OMX_PTR appData, - OMX_COMPONENTTYPE **component) = 0; - - virtual OMX_ERRORTYPE destroyComponentInstance( - OMX_COMPONENTTYPE *component) = 0; - - virtual OMX_ERRORTYPE enumerateComponents( - OMX_STRING name, - size_t size, - OMX_U32 index) = 0; - - virtual OMX_ERRORTYPE getRolesOfComponent( - const char *name, - Vector *roles) = 0; - -private: - OMXPluginBase(const OMXPluginBase &); - OMXPluginBase &operator=(const OMXPluginBase &); -}; - -} // namespace android - -#endif // OMX_PLUGIN_BASE_H_ diff --git a/external/android/include/18/frameworks/native/include/media/openmax/OMX_Audio.h b/external/android/include/18/frameworks/native/include/media/openmax/OMX_Audio.h deleted file mode 100644 index 89ce0fc..0000000 --- a/external/android/include/18/frameworks/native/include/media/openmax/OMX_Audio.h +++ /dev/null @@ -1,1342 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** @file OMX_Audio.h - OpenMax IL version 1.1.2 - * The structures needed by Audio components to exchange - * parameters and configuration data with the componenmilts. - */ - -#ifndef OMX_Audio_h -#define OMX_Audio_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/* Each OMX header must include all required header files to allow the - * header to compile without errors. The includes below are required - * for this header file to compile successfully - */ - -#include - -/** @defgroup midi MIDI - * @ingroup audio - */ - -/** @defgroup effects Audio effects - * @ingroup audio - */ - -/** @defgroup audio OpenMAX IL Audio Domain - * Structures for OpenMAX IL Audio domain - * @{ - */ - -/** Enumeration used to define the possible audio codings. - * If "OMX_AUDIO_CodingUnused" is selected, the coding selection must - * be done in a vendor specific way. Since this is for an audio - * processing element this enum is relevant. However, for another - * type of component other enums would be in this area. - */ -typedef enum OMX_AUDIO_CODINGTYPE { - OMX_AUDIO_CodingUnused = 0, /**< Placeholder value when coding is N/A */ - OMX_AUDIO_CodingAutoDetect, /**< auto detection of audio format */ - OMX_AUDIO_CodingPCM, /**< Any variant of PCM coding */ - OMX_AUDIO_CodingADPCM, /**< Any variant of ADPCM encoded data */ - OMX_AUDIO_CodingAMR, /**< Any variant of AMR encoded data */ - OMX_AUDIO_CodingGSMFR, /**< Any variant of GSM fullrate (i.e. GSM610) */ - OMX_AUDIO_CodingGSMEFR, /**< Any variant of GSM Enhanced Fullrate encoded data*/ - OMX_AUDIO_CodingGSMHR, /**< Any variant of GSM Halfrate encoded data */ - OMX_AUDIO_CodingPDCFR, /**< Any variant of PDC Fullrate encoded data */ - OMX_AUDIO_CodingPDCEFR, /**< Any variant of PDC Enhanced Fullrate encoded data */ - OMX_AUDIO_CodingPDCHR, /**< Any variant of PDC Halfrate encoded data */ - OMX_AUDIO_CodingTDMAFR, /**< Any variant of TDMA Fullrate encoded data (TIA/EIA-136-420) */ - OMX_AUDIO_CodingTDMAEFR, /**< Any variant of TDMA Enhanced Fullrate encoded data (TIA/EIA-136-410) */ - OMX_AUDIO_CodingQCELP8, /**< Any variant of QCELP 8kbps encoded data */ - OMX_AUDIO_CodingQCELP13, /**< Any variant of QCELP 13kbps encoded data */ - OMX_AUDIO_CodingEVRC, /**< Any variant of EVRC encoded data */ - OMX_AUDIO_CodingSMV, /**< Any variant of SMV encoded data */ - OMX_AUDIO_CodingG711, /**< Any variant of G.711 encoded data */ - OMX_AUDIO_CodingG723, /**< Any variant of G.723 dot 1 encoded data */ - OMX_AUDIO_CodingG726, /**< Any variant of G.726 encoded data */ - OMX_AUDIO_CodingG729, /**< Any variant of G.729 encoded data */ - OMX_AUDIO_CodingAAC, /**< Any variant of AAC encoded data */ - OMX_AUDIO_CodingMP3, /**< Any variant of MP3 encoded data */ - OMX_AUDIO_CodingSBC, /**< Any variant of SBC encoded data */ - OMX_AUDIO_CodingVORBIS, /**< Any variant of VORBIS encoded data */ - OMX_AUDIO_CodingWMA, /**< Any variant of WMA encoded data */ - OMX_AUDIO_CodingRA, /**< Any variant of RA encoded data */ - OMX_AUDIO_CodingMIDI, /**< Any variant of MIDI encoded data */ - OMX_AUDIO_CodingFLAC, /**< Any variant of FLAC encoded data */ - OMX_AUDIO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_CodingMax = 0x7FFFFFFF -} OMX_AUDIO_CODINGTYPE; - - -/** The PortDefinition structure is used to define all of the parameters - * necessary for the compliant component to setup an input or an output audio - * path. If additional information is needed to define the parameters of the - * port (such as frequency), additional structures must be sent such as the - * OMX_AUDIO_PARAM_PCMMODETYPE structure to supply the extra parameters for the port. - */ -typedef struct OMX_AUDIO_PORTDEFINITIONTYPE { - OMX_STRING cMIMEType; /**< MIME type of data for the port */ - OMX_NATIVE_DEVICETYPE pNativeRender; /** < platform specific reference - for an output device, - otherwise this field is 0 */ - OMX_BOOL bFlagErrorConcealment; /**< Turns on error concealment if it is - supported by the OMX component */ - OMX_AUDIO_CODINGTYPE eEncoding; /**< Type of data expected for this - port (e.g. PCM, AMR, MP3, etc) */ -} OMX_AUDIO_PORTDEFINITIONTYPE; - - -/** Port format parameter. This structure is used to enumerate - * the various data input/output format supported by the port. - */ -typedef struct OMX_AUDIO_PARAM_PORTFORMATTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Indicates which port to set */ - OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */ - OMX_AUDIO_CODINGTYPE eEncoding; /**< Type of data expected for this port (e.g. PCM, AMR, MP3, etc) */ -} OMX_AUDIO_PARAM_PORTFORMATTYPE; - - -/** PCM mode type */ -typedef enum OMX_AUDIO_PCMMODETYPE { - OMX_AUDIO_PCMModeLinear = 0, /**< Linear PCM encoded data */ - OMX_AUDIO_PCMModeALaw, /**< A law PCM encoded data (G.711) */ - OMX_AUDIO_PCMModeMULaw, /**< Mu law PCM encoded data (G.711) */ - OMX_AUDIO_PCMModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_PCMModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_PCMModeMax = 0x7FFFFFFF -} OMX_AUDIO_PCMMODETYPE; - - -typedef enum OMX_AUDIO_CHANNELTYPE { - OMX_AUDIO_ChannelNone = 0x0, /**< Unused or empty */ - OMX_AUDIO_ChannelLF = 0x1, /**< Left front */ - OMX_AUDIO_ChannelRF = 0x2, /**< Right front */ - OMX_AUDIO_ChannelCF = 0x3, /**< Center front */ - OMX_AUDIO_ChannelLS = 0x4, /**< Left surround */ - OMX_AUDIO_ChannelRS = 0x5, /**< Right surround */ - OMX_AUDIO_ChannelLFE = 0x6, /**< Low frequency effects */ - OMX_AUDIO_ChannelCS = 0x7, /**< Back surround */ - OMX_AUDIO_ChannelLR = 0x8, /**< Left rear. */ - OMX_AUDIO_ChannelRR = 0x9, /**< Right rear. */ - OMX_AUDIO_ChannelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_ChannelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_ChannelMax = 0x7FFFFFFF -} OMX_AUDIO_CHANNELTYPE; - -#define OMX_AUDIO_MAXCHANNELS 16 /**< maximum number distinct audio channels that a buffer may contain */ -#define OMX_MIN_PCMPAYLOAD_MSEC 5 /**< Minimum audio buffer payload size for uncompressed (PCM) audio */ - -/** PCM format description */ -typedef struct OMX_AUDIO_PARAM_PCMMODETYPE { - OMX_U32 nSize; /**< Size of this structure, in Bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels (e.g. 2 for stereo) */ - OMX_NUMERICALDATATYPE eNumData; /**< indicates PCM data as signed or unsigned */ - OMX_ENDIANTYPE eEndian; /**< indicates PCM data as little or big endian */ - OMX_BOOL bInterleaved; /**< True for normal interleaved data; false for - non-interleaved data (e.g. block data) */ - OMX_U32 nBitPerSample; /**< Bit per sample */ - OMX_U32 nSamplingRate; /**< Sampling rate of the source data. Use 0 for - variable or unknown sampling rate. */ - OMX_AUDIO_PCMMODETYPE ePCMMode; /**< PCM mode enumeration */ - OMX_AUDIO_CHANNELTYPE eChannelMapping[OMX_AUDIO_MAXCHANNELS]; /**< Slot i contains channel defined by eChannelMap[i] */ - -} OMX_AUDIO_PARAM_PCMMODETYPE; - - -/** Audio channel mode. This is used by both AAC and MP3, although the names are more appropriate - * for the MP3. For example, JointStereo for MP3 is CouplingChannels for AAC. - */ -typedef enum OMX_AUDIO_CHANNELMODETYPE { - OMX_AUDIO_ChannelModeStereo = 0, /**< 2 channels, the bitrate allocation between those - two channels changes accordingly to each channel information */ - OMX_AUDIO_ChannelModeJointStereo, /**< mode that takes advantage of what is common between - 2 channels for higher compression gain */ - OMX_AUDIO_ChannelModeDual, /**< 2 mono-channels, each channel is encoded with half - the bitrate of the overall bitrate */ - OMX_AUDIO_ChannelModeMono, /**< Mono channel mode */ - OMX_AUDIO_ChannelModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_ChannelModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_ChannelModeMax = 0x7FFFFFFF -} OMX_AUDIO_CHANNELMODETYPE; - - -typedef enum OMX_AUDIO_MP3STREAMFORMATTYPE { - OMX_AUDIO_MP3StreamFormatMP1Layer3 = 0, /**< MP3 Audio MPEG 1 Layer 3 Stream format */ - OMX_AUDIO_MP3StreamFormatMP2Layer3, /**< MP3 Audio MPEG 2 Layer 3 Stream format */ - OMX_AUDIO_MP3StreamFormatMP2_5Layer3, /**< MP3 Audio MPEG2.5 Layer 3 Stream format */ - OMX_AUDIO_MP3StreamFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_MP3StreamFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_MP3StreamFormatMax = 0x7FFFFFFF -} OMX_AUDIO_MP3STREAMFORMATTYPE; - -/** MP3 params */ -typedef struct OMX_AUDIO_PARAM_MP3TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable - rate or unknown bit rates */ - OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for - variable or unknown sampling rate. */ - OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should - limit the audio signal. Use 0 to let encoder decide */ - OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */ - OMX_AUDIO_MP3STREAMFORMATTYPE eFormat; /**< MP3 stream format */ -} OMX_AUDIO_PARAM_MP3TYPE; - - -typedef enum OMX_AUDIO_AACSTREAMFORMATTYPE { - OMX_AUDIO_AACStreamFormatMP2ADTS = 0, /**< AAC Audio Data Transport Stream 2 format */ - OMX_AUDIO_AACStreamFormatMP4ADTS, /**< AAC Audio Data Transport Stream 4 format */ - OMX_AUDIO_AACStreamFormatMP4LOAS, /**< AAC Low Overhead Audio Stream format */ - OMX_AUDIO_AACStreamFormatMP4LATM, /**< AAC Low overhead Audio Transport Multiplex */ - OMX_AUDIO_AACStreamFormatADIF, /**< AAC Audio Data Interchange Format */ - OMX_AUDIO_AACStreamFormatMP4FF, /**< AAC inside MPEG-4/ISO File Format */ - OMX_AUDIO_AACStreamFormatRAW, /**< AAC Raw Format */ - OMX_AUDIO_AACStreamFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_AACStreamFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_AACStreamFormatMax = 0x7FFFFFFF -} OMX_AUDIO_AACSTREAMFORMATTYPE; - - -/** AAC mode type. Note that the term profile is used with the MPEG-2 - * standard and the term object type and profile is used with MPEG-4 */ -typedef enum OMX_AUDIO_AACPROFILETYPE{ - OMX_AUDIO_AACObjectNull = 0, /**< Null, not used */ - OMX_AUDIO_AACObjectMain = 1, /**< AAC Main object */ - OMX_AUDIO_AACObjectLC, /**< AAC Low Complexity object (AAC profile) */ - OMX_AUDIO_AACObjectSSR, /**< AAC Scalable Sample Rate object */ - OMX_AUDIO_AACObjectLTP, /**< AAC Long Term Prediction object */ - OMX_AUDIO_AACObjectHE, /**< AAC High Efficiency (object type SBR, HE-AAC profile) */ - OMX_AUDIO_AACObjectScalable, /**< AAC Scalable object */ - OMX_AUDIO_AACObjectERLC = 17, /**< ER AAC Low Complexity object (Error Resilient AAC-LC) */ - OMX_AUDIO_AACObjectLD = 23, /**< AAC Low Delay object (Error Resilient) */ - OMX_AUDIO_AACObjectHE_PS = 29, /**< AAC High Efficiency with Parametric Stereo coding (HE-AAC v2, object type PS) */ - OMX_AUDIO_AACObjectELD = 39, /** AAC Enhanced Low Delay. NOTE: Pending Khronos standardization **/ - OMX_AUDIO_AACObjectKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_AACObjectVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_AACObjectMax = 0x7FFFFFFF -} OMX_AUDIO_AACPROFILETYPE; - - -/** AAC tool usage (for nAACtools in OMX_AUDIO_PARAM_AACPROFILETYPE). - * Required for encoder configuration and optional as decoder info output. - * For MP3, OMX_AUDIO_CHANNELMODETYPE is sufficient. */ -#define OMX_AUDIO_AACToolNone 0x00000000 /**< no AAC tools allowed (encoder config) or active (decoder info output) */ -#define OMX_AUDIO_AACToolMS 0x00000001 /**< MS: Mid/side joint coding tool allowed or active */ -#define OMX_AUDIO_AACToolIS 0x00000002 /**< IS: Intensity stereo tool allowed or active */ -#define OMX_AUDIO_AACToolTNS 0x00000004 /**< TNS: Temporal Noise Shaping tool allowed or active */ -#define OMX_AUDIO_AACToolPNS 0x00000008 /**< PNS: MPEG-4 Perceptual Noise substitution tool allowed or active */ -#define OMX_AUDIO_AACToolLTP 0x00000010 /**< LTP: MPEG-4 Long Term Prediction tool allowed or active */ -#define OMX_AUDIO_AACToolAll 0x7FFFFFFF /**< all AAC tools allowed or active (*/ - -/** MPEG-4 AAC error resilience (ER) tool usage (for nAACERtools in OMX_AUDIO_PARAM_AACPROFILETYPE). - * Required for ER encoder configuration and optional as decoder info output */ -#define OMX_AUDIO_AACERNone 0x00000000 /**< no AAC ER tools allowed/used */ -#define OMX_AUDIO_AACERVCB11 0x00000001 /**< VCB11: Virtual Code Books for AAC section data */ -#define OMX_AUDIO_AACERRVLC 0x00000002 /**< RVLC: Reversible Variable Length Coding */ -#define OMX_AUDIO_AACERHCR 0x00000004 /**< HCR: Huffman Codeword Reordering */ -#define OMX_AUDIO_AACERAll 0x7FFFFFFF /**< all AAC ER tools allowed/used */ - - -/** AAC params */ -typedef struct OMX_AUDIO_PARAM_AACPROFILETYPE { - OMX_U32 nSize; /**< Size of this structure, in Bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for - variable or unknown sampling rate. */ - OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable - rate or unknown bit rates */ - OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should - limit the audio signal. Use 0 to let encoder decide */ - OMX_U32 nFrameLength; /**< Frame length (in audio samples per channel) of the codec. - Can be 1024 or 960 (AAC-LC), 2048 (HE-AAC), 480 or 512 (AAC-LD). - Use 0 to let encoder decide */ - OMX_U32 nAACtools; /**< AAC tool usage */ - OMX_U32 nAACERtools; /**< MPEG-4 AAC error resilience tool usage */ - OMX_AUDIO_AACPROFILETYPE eAACProfile; /**< AAC profile enumeration */ - OMX_AUDIO_AACSTREAMFORMATTYPE eAACStreamFormat; /**< AAC stream format enumeration */ - OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */ -} OMX_AUDIO_PARAM_AACPROFILETYPE; - - -/** VORBIS params */ -typedef struct OMX_AUDIO_PARAM_VORBISTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nBitRate; /**< Bit rate of the encoded data data. Use 0 for variable - rate or unknown bit rates. Encoding is set to the - bitrate closest to specified value (in bps) */ - OMX_U32 nMinBitRate; /**< Sets minimum bitrate (in bps). */ - OMX_U32 nMaxBitRate; /**< Sets maximum bitrate (in bps). */ - - OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for - variable or unknown sampling rate. */ - OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should - limit the audio signal. Use 0 to let encoder decide */ - OMX_S32 nQuality; /**< Sets encoding quality to n, between -1 (low) and 10 (high). - In the default mode of operation, teh quality level is 3. - Normal quality range is 0 - 10. */ - OMX_BOOL bManaged; /**< Set bitrate management mode. This turns off the - normal VBR encoding, but allows hard or soft bitrate - constraints to be enforced by the encoder. This mode can - be slower, and may also be lower quality. It is - primarily useful for streaming. */ - OMX_BOOL bDownmix; /**< Downmix input from stereo to mono (has no effect on - non-stereo streams). Useful for lower-bitrate encoding. */ -} OMX_AUDIO_PARAM_VORBISTYPE; - - -/** FLAC params */ -typedef struct OMX_AUDIO_PARAM_FLACTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for - unknown sampling rate. */ - OMX_U32 nCompressionLevel;/**< FLAC compression level, from 0 (fastest compression) - to 8 (highest compression */ -} OMX_AUDIO_PARAM_FLACTYPE; - - -/** WMA Version */ -typedef enum OMX_AUDIO_WMAFORMATTYPE { - OMX_AUDIO_WMAFormatUnused = 0, /**< format unused or unknown */ - OMX_AUDIO_WMAFormat7, /**< Windows Media Audio format 7 */ - OMX_AUDIO_WMAFormat8, /**< Windows Media Audio format 8 */ - OMX_AUDIO_WMAFormat9, /**< Windows Media Audio format 9 */ - OMX_AUDIO_WMAFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_WMAFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_WMAFormatMax = 0x7FFFFFFF -} OMX_AUDIO_WMAFORMATTYPE; - - -/** WMA Profile */ -typedef enum OMX_AUDIO_WMAPROFILETYPE { - OMX_AUDIO_WMAProfileUnused = 0, /**< profile unused or unknown */ - OMX_AUDIO_WMAProfileL1, /**< Windows Media audio version 9 profile L1 */ - OMX_AUDIO_WMAProfileL2, /**< Windows Media audio version 9 profile L2 */ - OMX_AUDIO_WMAProfileL3, /**< Windows Media audio version 9 profile L3 */ - OMX_AUDIO_WMAProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_WMAProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_WMAProfileMax = 0x7FFFFFFF -} OMX_AUDIO_WMAPROFILETYPE; - - -/** WMA params */ -typedef struct OMX_AUDIO_PARAM_WMATYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U16 nChannels; /**< Number of channels */ - OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable - rate or unknown bit rates */ - OMX_AUDIO_WMAFORMATTYPE eFormat; /**< Version of WMA stream / data */ - OMX_AUDIO_WMAPROFILETYPE eProfile; /**< Profile of WMA stream / data */ - OMX_U32 nSamplingRate; /**< Sampling rate of the source data */ - OMX_U16 nBlockAlign; /**< is the block alignment, or block size, in bytes of the audio codec */ - OMX_U16 nEncodeOptions; /**< WMA Type-specific data */ - OMX_U32 nSuperBlockAlign; /**< WMA Type-specific data */ -} OMX_AUDIO_PARAM_WMATYPE; - -/** - * RealAudio format - */ -typedef enum OMX_AUDIO_RAFORMATTYPE { - OMX_AUDIO_RAFormatUnused = 0, /**< Format unused or unknown */ - OMX_AUDIO_RA8, /**< RealAudio 8 codec */ - OMX_AUDIO_RA9, /**< RealAudio 9 codec */ - OMX_AUDIO_RA10_AAC, /**< MPEG-4 AAC codec for bitrates of more than 128kbps */ - OMX_AUDIO_RA10_CODEC, /**< RealAudio codec for bitrates less than 128 kbps */ - OMX_AUDIO_RA10_LOSSLESS, /**< RealAudio Lossless */ - OMX_AUDIO_RA10_MULTICHANNEL, /**< RealAudio Multichannel */ - OMX_AUDIO_RA10_VOICE, /**< RealAudio Voice for bitrates below 15 kbps */ - OMX_AUDIO_RAFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_RAFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_RAFormatMax = 0x7FFFFFFF -} OMX_AUDIO_RAFORMATTYPE; - -/** RA (Real Audio) params */ -typedef struct OMX_AUDIO_PARAM_RATYPE { - OMX_U32 nSize; /**< Size of this structure, in Bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nSamplingRate; /**< is the sampling rate of the source data */ - OMX_U32 nBitsPerFrame; /**< is the value for bits per frame */ - OMX_U32 nSamplePerFrame; /**< is the value for samples per frame */ - OMX_U32 nCouplingQuantBits; /**< is the number of coupling quantization bits in the stream */ - OMX_U32 nCouplingStartRegion; /**< is the coupling start region in the stream */ - OMX_U32 nNumRegions; /**< is the number of regions value */ - OMX_AUDIO_RAFORMATTYPE eFormat; /**< is the RealAudio audio format */ -} OMX_AUDIO_PARAM_RATYPE; - - -/** SBC Allocation Method Type */ -typedef enum OMX_AUDIO_SBCALLOCMETHODTYPE { - OMX_AUDIO_SBCAllocMethodLoudness, /**< Loudness allocation method */ - OMX_AUDIO_SBCAllocMethodSNR, /**< SNR allocation method */ - OMX_AUDIO_SBCAllocMethodKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_SBCAllocMethodVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_SBCAllocMethodMax = 0x7FFFFFFF -} OMX_AUDIO_SBCALLOCMETHODTYPE; - - -/** SBC params */ -typedef struct OMX_AUDIO_PARAM_SBCTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable - rate or unknown bit rates */ - OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for - variable or unknown sampling rate. */ - OMX_U32 nBlocks; /**< Number of blocks */ - OMX_U32 nSubbands; /**< Number of subbands */ - OMX_U32 nBitPool; /**< Bitpool value */ - OMX_BOOL bEnableBitrate; /**< Use bitrate value instead of bitpool */ - OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */ - OMX_AUDIO_SBCALLOCMETHODTYPE eSBCAllocType; /**< SBC Allocation method type */ -} OMX_AUDIO_PARAM_SBCTYPE; - - -/** ADPCM stream format parameters */ -typedef struct OMX_AUDIO_PARAM_ADPCMTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_U32 nBitsPerSample; /**< Number of bits in each sample */ - OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for - variable or unknown sampling rate. */ -} OMX_AUDIO_PARAM_ADPCMTYPE; - - -/** G723 rate */ -typedef enum OMX_AUDIO_G723RATE { - OMX_AUDIO_G723ModeUnused = 0, /**< AMRNB Mode unused / unknown */ - OMX_AUDIO_G723ModeLow, /**< 5300 bps */ - OMX_AUDIO_G723ModeHigh, /**< 6300 bps */ - OMX_AUDIO_G723ModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_G723ModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_G723ModeMax = 0x7FFFFFFF -} OMX_AUDIO_G723RATE; - - -/** G723 - Sample rate must be 8 KHz */ -typedef struct OMX_AUDIO_PARAM_G723TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_AUDIO_G723RATE eBitRate; /**< todo: Should this be moved to a config? */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ - OMX_BOOL bPostFilter; /**< Enable Post Filter */ -} OMX_AUDIO_PARAM_G723TYPE; - - -/** ITU G726 (ADPCM) rate */ -typedef enum OMX_AUDIO_G726MODE { - OMX_AUDIO_G726ModeUnused = 0, /**< G726 Mode unused / unknown */ - OMX_AUDIO_G726Mode16, /**< 16 kbps */ - OMX_AUDIO_G726Mode24, /**< 24 kbps */ - OMX_AUDIO_G726Mode32, /**< 32 kbps, most common rate, also G721 */ - OMX_AUDIO_G726Mode40, /**< 40 kbps */ - OMX_AUDIO_G726ModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_G726ModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_G726ModeMax = 0x7FFFFFFF -} OMX_AUDIO_G726MODE; - - -/** G.726 stream format parameters - must be at 8KHz */ -typedef struct OMX_AUDIO_PARAM_G726TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_AUDIO_G726MODE eG726Mode; -} OMX_AUDIO_PARAM_G726TYPE; - - -/** G729 coder type */ -typedef enum OMX_AUDIO_G729TYPE { - OMX_AUDIO_G729 = 0, /**< ITU G.729 encoded data */ - OMX_AUDIO_G729A, /**< ITU G.729 annex A encoded data */ - OMX_AUDIO_G729B, /**< ITU G.729 with annex B encoded data */ - OMX_AUDIO_G729AB, /**< ITU G.729 annexes A and B encoded data */ - OMX_AUDIO_G729KhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_G729VendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_G729Max = 0x7FFFFFFF -} OMX_AUDIO_G729TYPE; - - -/** G729 stream format parameters - fixed 6KHz sample rate */ -typedef struct OMX_AUDIO_PARAM_G729TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_AUDIO_G729TYPE eBitType; -} OMX_AUDIO_PARAM_G729TYPE; - - -/** AMR Frame format */ -typedef enum OMX_AUDIO_AMRFRAMEFORMATTYPE { - OMX_AUDIO_AMRFrameFormatConformance = 0, /**< Frame Format is AMR Conformance - (Standard) Format */ - OMX_AUDIO_AMRFrameFormatIF1, /**< Frame Format is AMR Interface - Format 1 */ - OMX_AUDIO_AMRFrameFormatIF2, /**< Frame Format is AMR Interface - Format 2*/ - OMX_AUDIO_AMRFrameFormatFSF, /**< Frame Format is AMR File Storage - Format */ - OMX_AUDIO_AMRFrameFormatRTPPayload, /**< Frame Format is AMR Real-Time - Transport Protocol Payload Format */ - OMX_AUDIO_AMRFrameFormatITU, /**< Frame Format is ITU Format (added at Motorola request) */ - OMX_AUDIO_AMRFrameFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_AMRFrameFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_AMRFrameFormatMax = 0x7FFFFFFF -} OMX_AUDIO_AMRFRAMEFORMATTYPE; - - -/** AMR band mode */ -typedef enum OMX_AUDIO_AMRBANDMODETYPE { - OMX_AUDIO_AMRBandModeUnused = 0, /**< AMRNB Mode unused / unknown */ - OMX_AUDIO_AMRBandModeNB0, /**< AMRNB Mode 0 = 4750 bps */ - OMX_AUDIO_AMRBandModeNB1, /**< AMRNB Mode 1 = 5150 bps */ - OMX_AUDIO_AMRBandModeNB2, /**< AMRNB Mode 2 = 5900 bps */ - OMX_AUDIO_AMRBandModeNB3, /**< AMRNB Mode 3 = 6700 bps */ - OMX_AUDIO_AMRBandModeNB4, /**< AMRNB Mode 4 = 7400 bps */ - OMX_AUDIO_AMRBandModeNB5, /**< AMRNB Mode 5 = 7950 bps */ - OMX_AUDIO_AMRBandModeNB6, /**< AMRNB Mode 6 = 10200 bps */ - OMX_AUDIO_AMRBandModeNB7, /**< AMRNB Mode 7 = 12200 bps */ - OMX_AUDIO_AMRBandModeWB0, /**< AMRWB Mode 0 = 6600 bps */ - OMX_AUDIO_AMRBandModeWB1, /**< AMRWB Mode 1 = 8850 bps */ - OMX_AUDIO_AMRBandModeWB2, /**< AMRWB Mode 2 = 12650 bps */ - OMX_AUDIO_AMRBandModeWB3, /**< AMRWB Mode 3 = 14250 bps */ - OMX_AUDIO_AMRBandModeWB4, /**< AMRWB Mode 4 = 15850 bps */ - OMX_AUDIO_AMRBandModeWB5, /**< AMRWB Mode 5 = 18250 bps */ - OMX_AUDIO_AMRBandModeWB6, /**< AMRWB Mode 6 = 19850 bps */ - OMX_AUDIO_AMRBandModeWB7, /**< AMRWB Mode 7 = 23050 bps */ - OMX_AUDIO_AMRBandModeWB8, /**< AMRWB Mode 8 = 23850 bps */ - OMX_AUDIO_AMRBandModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_AMRBandModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_AMRBandModeMax = 0x7FFFFFFF -} OMX_AUDIO_AMRBANDMODETYPE; - - -/** AMR Discontinuous Transmission mode */ -typedef enum OMX_AUDIO_AMRDTXMODETYPE { - OMX_AUDIO_AMRDTXModeOff = 0, /**< AMR Discontinuous Transmission Mode is disabled */ - OMX_AUDIO_AMRDTXModeOnVAD1, /**< AMR Discontinuous Transmission Mode using - Voice Activity Detector 1 (VAD1) is enabled */ - OMX_AUDIO_AMRDTXModeOnVAD2, /**< AMR Discontinuous Transmission Mode using - Voice Activity Detector 2 (VAD2) is enabled */ - OMX_AUDIO_AMRDTXModeOnAuto, /**< The codec will automatically select between - Off, VAD1 or VAD2 modes */ - - OMX_AUDIO_AMRDTXasEFR, /**< DTX as EFR instead of AMR standard (3GPP 26.101, frame type =8,9,10) */ - - OMX_AUDIO_AMRDTXModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_AMRDTXModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_AMRDTXModeMax = 0x7FFFFFFF -} OMX_AUDIO_AMRDTXMODETYPE; - - -/** AMR params */ -typedef struct OMX_AUDIO_PARAM_AMRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nBitRate; /**< Bit rate read only field */ - OMX_AUDIO_AMRBANDMODETYPE eAMRBandMode; /**< AMR Band Mode enumeration */ - OMX_AUDIO_AMRDTXMODETYPE eAMRDTXMode; /**< AMR DTX Mode enumeration */ - OMX_AUDIO_AMRFRAMEFORMATTYPE eAMRFrameFormat; /**< AMR frame format enumeration */ -} OMX_AUDIO_PARAM_AMRTYPE; - - -/** GSM_FR (ETSI 06.10, 3GPP 46.010) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_GSMFRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_GSMFRTYPE; - - -/** GSM-HR (ETSI 06.20, 3GPP 46.020) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_GSMHRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_GSMHRTYPE; - - -/** GSM-EFR (ETSI 06.60, 3GPP 46.060) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_GSMEFRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_GSMEFRTYPE; - - -/** TDMA FR (TIA/EIA-136-420, VSELP 7.95kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_TDMAFRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_TDMAFRTYPE; - - -/** TDMA EFR (TIA/EIA-136-410, ACELP 7.4kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_TDMAEFRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_TDMAEFRTYPE; - - -/** PDC FR ( RCR-27, VSELP 6.7kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_PDCFRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_PDCFRTYPE; - - -/** PDC EFR ( RCR-27, ACELP 6.7kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_PDCEFRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_PDCEFRTYPE; - -/** PDC HR ( RCR-27, PSI-CELP 3.45kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_PDCHRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_PDCHRTYPE; - - -/** CDMA Rate types */ -typedef enum OMX_AUDIO_CDMARATETYPE { - OMX_AUDIO_CDMARateBlank = 0, /**< CDMA encoded frame is blank */ - OMX_AUDIO_CDMARateFull, /**< CDMA encoded frame in full rate */ - OMX_AUDIO_CDMARateHalf, /**< CDMA encoded frame in half rate */ - OMX_AUDIO_CDMARateQuarter, /**< CDMA encoded frame in quarter rate */ - OMX_AUDIO_CDMARateEighth, /**< CDMA encoded frame in eighth rate (DTX)*/ - OMX_AUDIO_CDMARateErasure, /**< CDMA erasure frame */ - OMX_AUDIO_CDMARateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_CDMARateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_CDMARateMax = 0x7FFFFFFF -} OMX_AUDIO_CDMARATETYPE; - - -/** QCELP8 (TIA/EIA-96, up to 8kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_QCELP8TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable - rate or unknown bit rates */ - OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */ - OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */ - OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */ -} OMX_AUDIO_PARAM_QCELP8TYPE; - - -/** QCELP13 ( CDMA, EIA/TIA-733, 13.3kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_QCELP13TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */ - OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */ - OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */ -} OMX_AUDIO_PARAM_QCELP13TYPE; - - -/** EVRC ( CDMA, EIA/TIA-127, RCELP up to 8.55kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_EVRCTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_AUDIO_CDMARATETYPE eCDMARate; /**< actual Frame rate */ - OMX_BOOL bRATE_REDUCon; /**< RATE_REDUCtion is requested for this frame */ - OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */ - OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */ - OMX_BOOL bHiPassFilter; /**< Enable encoder's High Pass Filter */ - OMX_BOOL bNoiseSuppressor; /**< Enable encoder's noise suppressor pre-processing */ - OMX_BOOL bPostFilter; /**< Enable decoder's post Filter */ -} OMX_AUDIO_PARAM_EVRCTYPE; - - -/** SMV ( up to 8.55kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_SMVTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */ - OMX_BOOL bRATE_REDUCon; /**< RATE_REDUCtion is requested for this frame */ - OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 ??*/ - OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 ??*/ - OMX_BOOL bHiPassFilter; /**< Enable encoder's High Pass Filter ??*/ - OMX_BOOL bNoiseSuppressor; /**< Enable encoder's noise suppressor pre-processing */ - OMX_BOOL bPostFilter; /**< Enable decoder's post Filter ??*/ -} OMX_AUDIO_PARAM_SMVTYPE; - - -/** MIDI Format - * @ingroup midi - */ -typedef enum OMX_AUDIO_MIDIFORMATTYPE -{ - OMX_AUDIO_MIDIFormatUnknown = 0, /**< MIDI Format unknown or don't care */ - OMX_AUDIO_MIDIFormatSMF0, /**< Standard MIDI File Type 0 */ - OMX_AUDIO_MIDIFormatSMF1, /**< Standard MIDI File Type 1 */ - OMX_AUDIO_MIDIFormatSMF2, /**< Standard MIDI File Type 2 */ - OMX_AUDIO_MIDIFormatSPMIDI, /**< SP-MIDI */ - OMX_AUDIO_MIDIFormatXMF0, /**< eXtensible Music Format type 0 */ - OMX_AUDIO_MIDIFormatXMF1, /**< eXtensible Music Format type 1 */ - OMX_AUDIO_MIDIFormatMobileXMF, /**< Mobile XMF (eXtensible Music Format type 2) */ - OMX_AUDIO_MIDIFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_MIDIFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_MIDIFormatMax = 0x7FFFFFFF -} OMX_AUDIO_MIDIFORMATTYPE; - - -/** MIDI params - * @ingroup midi - */ -typedef struct OMX_AUDIO_PARAM_MIDITYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nFileSize; /**< size of the MIDI file in bytes, where the entire - MIDI file passed in, otherwise if 0x0, the MIDI data - is merged and streamed (instead of passed as an - entire MIDI file) */ - OMX_BU32 sMaxPolyphony; /**< Specifies the maximum simultaneous polyphonic - voices. A value of zero indicates that the default - polyphony of the device is used */ - OMX_BOOL bLoadDefaultSound; /**< Whether to load default sound - bank at initialization */ - OMX_AUDIO_MIDIFORMATTYPE eMidiFormat; /**< Version of the MIDI file */ -} OMX_AUDIO_PARAM_MIDITYPE; - - -/** Type of the MIDI sound bank - * @ingroup midi - */ -typedef enum OMX_AUDIO_MIDISOUNDBANKTYPE { - OMX_AUDIO_MIDISoundBankUnused = 0, /**< unused/unknown soundbank type */ - OMX_AUDIO_MIDISoundBankDLS1, /**< DLS version 1 */ - OMX_AUDIO_MIDISoundBankDLS2, /**< DLS version 2 */ - OMX_AUDIO_MIDISoundBankMobileDLSBase, /**< Mobile DLS, using the base functionality */ - OMX_AUDIO_MIDISoundBankMobileDLSPlusOptions, /**< Mobile DLS, using the specification-defined optional feature set */ - OMX_AUDIO_MIDISoundBankKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_MIDISoundBankVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_MIDISoundBankMax = 0x7FFFFFFF -} OMX_AUDIO_MIDISOUNDBANKTYPE; - - -/** Bank Layout describes how bank MSB & LSB are used in the DLS instrument definitions sound bank - * @ingroup midi - */ -typedef enum OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE { - OMX_AUDIO_MIDISoundBankLayoutUnused = 0, /**< unused/unknown soundbank type */ - OMX_AUDIO_MIDISoundBankLayoutGM, /**< GS layout (based on bank MSB 0x00) */ - OMX_AUDIO_MIDISoundBankLayoutGM2, /**< General MIDI 2 layout (using MSB 0x78/0x79, LSB 0x00) */ - OMX_AUDIO_MIDISoundBankLayoutUser, /**< Does not conform to any bank numbering standards */ - OMX_AUDIO_MIDISoundBankLayoutKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_MIDISoundBankLayoutVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_MIDISoundBankLayoutMax = 0x7FFFFFFF -} OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE; - - -/** MIDI params to load/unload user soundbank - * @ingroup midi - */ -typedef struct OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nDLSIndex; /**< DLS file index to be loaded */ - OMX_U32 nDLSSize; /**< Size in bytes */ - OMX_PTR pDLSData; /**< Pointer to DLS file data */ - OMX_AUDIO_MIDISOUNDBANKTYPE eMidiSoundBank; /**< Midi sound bank type enumeration */ - OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE eMidiSoundBankLayout; /**< Midi sound bank layout enumeration */ -} OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE; - - -/** Structure for Live MIDI events and MIP messages. - * (MIP = Maximum Instantaneous Polyphony; part of the SP-MIDI standard.) - * @ingroup midi - */ -typedef struct OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port that this structure applies to */ - OMX_U32 nMidiEventSize; /**< Size of immediate MIDI events or MIP message in bytes */ - OMX_U8 nMidiEvents[1]; /**< MIDI event array to be rendered immediately, or an - array for the MIP message buffer, where the size is - indicated by nMidiEventSize */ -} OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE; - - -/** MIDI sound bank/ program pair in a given channel - * @ingroup midi - */ -typedef struct OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port that this structure applies to */ - OMX_U32 nChannel; /**< Valid channel values range from 1 to 16 */ - OMX_U16 nIDProgram; /**< Valid program ID range is 1 to 128 */ - OMX_U16 nIDSoundBank; /**< Sound bank ID */ - OMX_U32 nUserSoundBankIndex;/**< User soundbank index, easier to access soundbanks - by index if multiple banks are present */ -} OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE; - - -/** MIDI control - * @ingroup midi - */ -typedef struct OMX_AUDIO_CONFIG_MIDICONTROLTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BS32 sPitchTransposition; /**< Pitch transposition in semitones, stored as Q22.10 - format based on JAVA MMAPI (JSR-135) requirement */ - OMX_BU32 sPlayBackRate; /**< Relative playback rate, stored as Q14.17 fixed-point - number based on JSR-135 requirement */ - OMX_BU32 sTempo ; /**< Tempo in beats per minute (BPM), stored as Q22.10 - fixed-point number based on JSR-135 requirement */ - OMX_U32 nMaxPolyphony; /**< Specifies the maximum simultaneous polyphonic - voices. A value of zero indicates that the default - polyphony of the device is used */ - OMX_U32 nNumRepeat; /**< Number of times to repeat playback */ - OMX_U32 nStopTime; /**< Time in milliseconds to indicate when playback - will stop automatically. Set to zero if not used */ - OMX_U16 nChannelMuteMask; /**< 16 bit mask for channel mute status */ - OMX_U16 nChannelSoloMask; /**< 16 bit mask for channel solo status */ - OMX_U32 nTrack0031MuteMask; /**< 32 bit mask for track mute status. Note: This is for tracks 0-31 */ - OMX_U32 nTrack3263MuteMask; /**< 32 bit mask for track mute status. Note: This is for tracks 32-63 */ - OMX_U32 nTrack0031SoloMask; /**< 32 bit mask for track solo status. Note: This is for tracks 0-31 */ - OMX_U32 nTrack3263SoloMask; /**< 32 bit mask for track solo status. Note: This is for tracks 32-63 */ - -} OMX_AUDIO_CONFIG_MIDICONTROLTYPE; - - -/** MIDI Playback States - * @ingroup midi - */ -typedef enum OMX_AUDIO_MIDIPLAYBACKSTATETYPE { - OMX_AUDIO_MIDIPlayBackStateUnknown = 0, /**< Unknown state or state does not map to - other defined states */ - OMX_AUDIO_MIDIPlayBackStateClosedEngaged, /**< No MIDI resource is currently open. - The MIDI engine is currently processing - MIDI events. */ - OMX_AUDIO_MIDIPlayBackStateParsing, /**< A MIDI resource is open and is being - primed. The MIDI engine is currently - processing MIDI events. */ - OMX_AUDIO_MIDIPlayBackStateOpenEngaged, /**< A MIDI resource is open and primed but - not playing. The MIDI engine is currently - processing MIDI events. The transition to - this state is only possible from the - OMX_AUDIO_MIDIPlayBackStatePlaying state, - when the 'playback head' reaches the end - of media data or the playback stops due - to stop time set.*/ - OMX_AUDIO_MIDIPlayBackStatePlaying, /**< A MIDI resource is open and currently - playing. The MIDI engine is currently - processing MIDI events.*/ - OMX_AUDIO_MIDIPlayBackStatePlayingPartially, /**< Best-effort playback due to SP-MIDI/DLS - resource constraints */ - OMX_AUDIO_MIDIPlayBackStatePlayingSilently, /**< Due to system resource constraints and - SP-MIDI content constraints, there is - no audible MIDI content during playback - currently. The situation may change if - resources are freed later.*/ - OMX_AUDIO_MIDIPlayBackStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_MIDIPlayBackStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_MIDIPlayBackStateMax = 0x7FFFFFFF -} OMX_AUDIO_MIDIPLAYBACKSTATETYPE; - - -/** MIDI status - * @ingroup midi - */ -typedef struct OMX_AUDIO_CONFIG_MIDISTATUSTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U16 nNumTracks; /**< Number of MIDI tracks in the file, read only field. - NOTE: May not return a meaningful value until the entire - file is parsed and buffered. */ - OMX_U32 nDuration; /**< The length of the currently open MIDI resource - in milliseconds. NOTE: May not return a meaningful value - until the entire file is parsed and buffered. */ - OMX_U32 nPosition; /**< Current Position of the MIDI resource being played - in milliseconds */ - OMX_BOOL bVibra; /**< Does Vibra track exist? NOTE: May not return a meaningful - value until the entire file is parsed and buffered. */ - OMX_U32 nNumMetaEvents; /**< Total number of MIDI Meta Events in the currently - open MIDI resource. NOTE: May not return a meaningful value - until the entire file is parsed and buffered. */ - OMX_U32 nNumActiveVoices; /**< Number of active voices in the currently playing - MIDI resource. NOTE: May not return a meaningful value until - the entire file is parsed and buffered. */ - OMX_AUDIO_MIDIPLAYBACKSTATETYPE eMIDIPlayBackState; /**< MIDI playback state enumeration, read only field */ -} OMX_AUDIO_CONFIG_MIDISTATUSTYPE; - - -/** MIDI Meta Event structure one per Meta Event. - * MIDI Meta Events are like audio metadata, except that they are interspersed - * with the MIDI content throughout the file and are not localized in the header. - * As such, it is necessary to retrieve information about these Meta Events from - * the engine, as it encounters these Meta Events within the MIDI content. - * For example, SMF files can have up to 14 types of MIDI Meta Events (copyright, - * author, default tempo, etc.) scattered throughout the file. - * @ingroup midi - */ -typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE{ - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nIndex; /**< Index of Meta Event */ - OMX_U8 nMetaEventType; /**< Meta Event Type, 7bits (i.e. 0 - 127) */ - OMX_U32 nMetaEventSize; /**< size of the Meta Event in bytes */ - OMX_U32 nTrack; /**< track number for the meta event */ - OMX_U32 nPosition; /**< Position of the meta-event in milliseconds */ -} OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE; - - -/** MIDI Meta Event Data structure - one per Meta Event. - * @ingroup midi - */ -typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE{ - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nIndex; /**< Index of Meta Event */ - OMX_U32 nMetaEventSize; /**< size of the Meta Event in bytes */ - OMX_U8 nData[1]; /**< array of one or more bytes of meta data - as indicated by the nMetaEventSize field */ -} OMX_AUDIO_CONFIG__MIDIMETAEVENTDATATYPE; - - -/** Audio Volume adjustment for a port */ -typedef struct OMX_AUDIO_CONFIG_VOLUMETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port index indicating which port to - set. Select the input port to set - just that port's volume. Select the - output port to adjust the master - volume. */ - OMX_BOOL bLinear; /**< Is the volume to be set in linear (0.100) - or logarithmic scale (mB) */ - OMX_BS32 sVolume; /**< Volume linear setting in the 0..100 range, OR - Volume logarithmic setting for this port. The values - for volume are in mB (millibels = 1/100 dB) relative - to a gain of 1 (e.g. the output is the same as the - input level). Values are in mB from nMax - (maximum volume) to nMin mB (typically negative). - Since the volume is "voltage" - and not a "power", it takes a setting of - -600 mB to decrease the volume by 1/2. If - a component cannot accurately set the - volume to the requested value, it must - set the volume to the closest value BELOW - the requested value. When getting the - volume setting, the current actual volume - must be returned. */ -} OMX_AUDIO_CONFIG_VOLUMETYPE; - - -/** Audio Volume adjustment for a channel */ -typedef struct OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port index indicating which port to - set. Select the input port to set - just that port's volume. Select the - output port to adjust the master - volume. */ - OMX_U32 nChannel; /**< channel to select from 0 to N-1, - using OMX_ALL to apply volume settings - to all channels */ - OMX_BOOL bLinear; /**< Is the volume to be set in linear (0.100) or - logarithmic scale (mB) */ - OMX_BS32 sVolume; /**< Volume linear setting in the 0..100 range, OR - Volume logarithmic setting for this port. - The values for volume are in mB - (millibels = 1/100 dB) relative to a gain - of 1 (e.g. the output is the same as the - input level). Values are in mB from nMax - (maximum volume) to nMin mB (typically negative). - Since the volume is "voltage" - and not a "power", it takes a setting of - -600 mB to decrease the volume by 1/2. If - a component cannot accurately set the - volume to the requested value, it must - set the volume to the closest value BELOW - the requested value. When getting the - volume setting, the current actual volume - must be returned. */ - OMX_BOOL bIsMIDI; /**< TRUE if nChannel refers to a MIDI channel, - FALSE otherwise */ -} OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE; - - -/** Audio balance setting */ -typedef struct OMX_AUDIO_CONFIG_BALANCETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port index indicating which port to - set. Select the input port to set - just that port's balance. Select the - output port to adjust the master - balance. */ - OMX_S32 nBalance; /**< balance setting for this port - (-100 to 100, where -100 indicates - all left, and no right */ -} OMX_AUDIO_CONFIG_BALANCETYPE; - - -/** Audio Port mute */ -typedef struct OMX_AUDIO_CONFIG_MUTETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port index indicating which port to - set. Select the input port to set - just that port's mute. Select the - output port to adjust the master - mute. */ - OMX_BOOL bMute; /**< Mute setting for this port */ -} OMX_AUDIO_CONFIG_MUTETYPE; - - -/** Audio Channel mute */ -typedef struct OMX_AUDIO_CONFIG_CHANNELMUTETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannel; /**< channel to select from 0 to N-1, - using OMX_ALL to apply mute settings - to all channels */ - OMX_BOOL bMute; /**< Mute setting for this channel */ - OMX_BOOL bIsMIDI; /**< TRUE if nChannel refers to a MIDI channel, - FALSE otherwise */ -} OMX_AUDIO_CONFIG_CHANNELMUTETYPE; - - - -/** Enable / Disable for loudness control, which boosts bass and to a - * smaller extent high end frequencies to compensate for hearing - * ability at the extreme ends of the audio spectrum - */ -typedef struct OMX_AUDIO_CONFIG_LOUDNESSTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bLoudness; /**< Enable/disable for loudness */ -} OMX_AUDIO_CONFIG_LOUDNESSTYPE; - - -/** Enable / Disable for bass, which controls low frequencies - */ -typedef struct OMX_AUDIO_CONFIG_BASSTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bEnable; /**< Enable/disable for bass control */ - OMX_S32 nBass; /**< bass setting for the port, as a - continuous value from -100 to 100 - (0 means no change in bass level)*/ -} OMX_AUDIO_CONFIG_BASSTYPE; - - -/** Enable / Disable for treble, which controls high frequencies tones - */ -typedef struct OMX_AUDIO_CONFIG_TREBLETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bEnable; /**< Enable/disable for treble control */ - OMX_S32 nTreble; /**< treble setting for the port, as a - continuous value from -100 to 100 - (0 means no change in treble level) */ -} OMX_AUDIO_CONFIG_TREBLETYPE; - - -/** An equalizer is typically used for two reasons: to compensate for an - * sub-optimal frequency response of a system to make it sound more natural - * or to create intentionally some unnatural coloring to the sound to create - * an effect. - * @ingroup effects - */ -typedef struct OMX_AUDIO_CONFIG_EQUALIZERTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bEnable; /**< Enable/disable for equalizer */ - OMX_BU32 sBandIndex; /**< Band number to be set. Upper Limit is - N-1, where N is the number of bands, lower limit is 0 */ - OMX_BU32 sCenterFreq; /**< Center frequecies in Hz. This is a - read only element and is used to determine - the lower, center and upper frequency of - this band. */ - OMX_BS32 sBandLevel; /**< band level in millibels */ -} OMX_AUDIO_CONFIG_EQUALIZERTYPE; - - -/** Stereo widening mode type - * @ingroup effects - */ -typedef enum OMX_AUDIO_STEREOWIDENINGTYPE { - OMX_AUDIO_StereoWideningHeadphones, /**< Stereo widening for loudspeakers */ - OMX_AUDIO_StereoWideningLoudspeakers, /**< Stereo widening for closely spaced loudspeakers */ - OMX_AUDIO_StereoWideningKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_StereoWideningVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_StereoWideningMax = 0x7FFFFFFF -} OMX_AUDIO_STEREOWIDENINGTYPE; - - -/** Control for stereo widening, which is a special 2-channel - * case of the audio virtualizer effect. For example, for 5.1-channel - * output, it translates to virtual surround sound. - * @ingroup effects - */ -typedef struct OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bEnable; /**< Enable/disable for stereo widening control */ - OMX_AUDIO_STEREOWIDENINGTYPE eWideningType; /**< Stereo widening algorithm type */ - OMX_U32 nStereoWidening; /**< stereo widening setting for the port, - as a continuous value from 0 to 100 */ -} OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE; - - -/** The chorus effect (or ``choralizer'') is any signal processor which makes - * one sound source (such as a voice) sound like many such sources singing - * (or playing) in unison. Since performance in unison is never exact, chorus - * effects simulate this by making independently modified copies of the input - * signal. Modifications may include (1) delay, (2) frequency shift, and - * (3) amplitude modulation. - * @ingroup effects - */ -typedef struct OMX_AUDIO_CONFIG_CHORUSTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bEnable; /**< Enable/disable for chorus */ - OMX_BU32 sDelay; /**< average delay in milliseconds */ - OMX_BU32 sModulationRate; /**< rate of modulation in millihertz */ - OMX_U32 nModulationDepth; /**< depth of modulation as a percentage of - delay (i.e. 0 to 100) */ - OMX_BU32 nFeedback; /**< Feedback from chorus output to input in percentage */ -} OMX_AUDIO_CONFIG_CHORUSTYPE; - - -/** Reverberation is part of the reflected sound that follows the early - * reflections. In a typical room, this consists of a dense succession of - * echoes whose energy decays exponentially. The reverberation effect structure - * as defined here includes both (early) reflections as well as (late) reverberations. - * @ingroup effects - */ -typedef struct OMX_AUDIO_CONFIG_REVERBERATIONTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bEnable; /**< Enable/disable for reverberation control */ - OMX_BS32 sRoomLevel; /**< Intensity level for the whole room effect - (i.e. both early reflections and late - reverberation) in millibels */ - OMX_BS32 sRoomHighFreqLevel; /**< Attenuation at high frequencies - relative to the intensity at low - frequencies in millibels */ - OMX_BS32 sReflectionsLevel; /**< Intensity level of early reflections - (relative to room value), in millibels */ - OMX_BU32 sReflectionsDelay; /**< Delay time of the first reflection relative - to the direct path, in milliseconds */ - OMX_BS32 sReverbLevel; /**< Intensity level of late reverberation - relative to room level, in millibels */ - OMX_BU32 sReverbDelay; /**< Time delay from the first early reflection - to the beginning of the late reverberation - section, in milliseconds */ - OMX_BU32 sDecayTime; /**< Late reverberation decay time at low - frequencies, in milliseconds */ - OMX_BU32 nDecayHighFreqRatio; /**< Ratio of high frequency decay time relative - to low frequency decay time in percent */ - OMX_U32 nDensity; /**< Modal density in the late reverberation decay, - in percent (i.e. 0 - 100) */ - OMX_U32 nDiffusion; /**< Echo density in the late reverberation decay, - in percent (i.e. 0 - 100) */ - OMX_BU32 sReferenceHighFreq; /**< Reference high frequency in Hertz. This is - the frequency used as the reference for all - the high-frequency settings above */ - -} OMX_AUDIO_CONFIG_REVERBERATIONTYPE; - - -/** Possible settings for the Echo Cancelation structure to use - * @ingroup effects - */ -typedef enum OMX_AUDIO_ECHOCANTYPE { - OMX_AUDIO_EchoCanOff = 0, /**< Echo Cancellation is disabled */ - OMX_AUDIO_EchoCanNormal, /**< Echo Cancellation normal operation - - echo from plastics and face */ - OMX_AUDIO_EchoCanHFree, /**< Echo Cancellation optimized for - Hands Free operation */ - OMX_AUDIO_EchoCanCarKit, /**< Echo Cancellation optimized for - Car Kit (longer echo) */ - OMX_AUDIO_EchoCanKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_EchoCanVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_EchoCanMax = 0x7FFFFFFF -} OMX_AUDIO_ECHOCANTYPE; - - -/** Enable / Disable for echo cancelation, which removes undesired echo's - * from the audio - * @ingroup effects - */ -typedef struct OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_AUDIO_ECHOCANTYPE eEchoCancelation; /**< Echo cancelation settings */ -} OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE; - - -/** Enable / Disable for noise reduction, which undesired noise from - * the audio - * @ingroup effects - */ -typedef struct OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bNoiseReduction; /**< Enable/disable for noise reduction */ -} OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE; - -/** @} */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ diff --git a/external/android/include/18/frameworks/native/include/media/openmax/OMX_Component.h b/external/android/include/18/frameworks/native/include/media/openmax/OMX_Component.h deleted file mode 100644 index b5b784e..0000000 --- a/external/android/include/18/frameworks/native/include/media/openmax/OMX_Component.h +++ /dev/null @@ -1,596 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** OMX_Component.h - OpenMax IL version 1.1.2 - * The OMX_Component header file contains the definitions used to define - * the public interface of a component. This header file is intended to - * be used by both the application and the component. - */ - -#ifndef OMX_Component_h -#define OMX_Component_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - - -/* Each OMX header must include all required header files to allow the - * header to compile without errors. The includes below are required - * for this header file to compile successfully - */ - -#include -#include -#include -#include - -/** @ingroup comp */ -typedef enum OMX_PORTDOMAINTYPE { - OMX_PortDomainAudio, - OMX_PortDomainVideo, - OMX_PortDomainImage, - OMX_PortDomainOther, - OMX_PortDomainKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_PortDomainVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_PortDomainMax = 0x7ffffff -} OMX_PORTDOMAINTYPE; - -/** @ingroup comp */ -typedef struct OMX_PARAM_PORTDEFINITIONTYPE { - OMX_U32 nSize; /**< Size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port number the structure applies to */ - OMX_DIRTYPE eDir; /**< Direction (input or output) of this port */ - OMX_U32 nBufferCountActual; /**< The actual number of buffers allocated on this port */ - OMX_U32 nBufferCountMin; /**< The minimum number of buffers this port requires */ - OMX_U32 nBufferSize; /**< Size, in bytes, for buffers to be used for this channel */ - OMX_BOOL bEnabled; /**< Ports default to enabled and are enabled/disabled by - OMX_CommandPortEnable/OMX_CommandPortDisable. - When disabled a port is unpopulated. A disabled port - is not populated with buffers on a transition to IDLE. */ - OMX_BOOL bPopulated; /**< Port is populated with all of its buffers as indicated by - nBufferCountActual. A disabled port is always unpopulated. - An enabled port is populated on a transition to OMX_StateIdle - and unpopulated on a transition to loaded. */ - OMX_PORTDOMAINTYPE eDomain; /**< Domain of the port. Determines the contents of metadata below. */ - union { - OMX_AUDIO_PORTDEFINITIONTYPE audio; - OMX_VIDEO_PORTDEFINITIONTYPE video; - OMX_IMAGE_PORTDEFINITIONTYPE image; - OMX_OTHER_PORTDEFINITIONTYPE other; - } format; - OMX_BOOL bBuffersContiguous; - OMX_U32 nBufferAlignment; -} OMX_PARAM_PORTDEFINITIONTYPE; - -/** @ingroup comp */ -typedef struct OMX_PARAM_U32TYPE { - OMX_U32 nSize; /**< Size of this structure, in Bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nU32; /**< U32 value */ -} OMX_PARAM_U32TYPE; - -/** @ingroup rpm */ -typedef enum OMX_SUSPENSIONPOLICYTYPE { - OMX_SuspensionDisabled, /**< No suspension; v1.0 behavior */ - OMX_SuspensionEnabled, /**< Suspension allowed */ - OMX_SuspensionPolicyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_SuspensionPolicyStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_SuspensionPolicyMax = 0x7fffffff -} OMX_SUSPENSIONPOLICYTYPE; - -/** @ingroup rpm */ -typedef struct OMX_PARAM_SUSPENSIONPOLICYTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_SUSPENSIONPOLICYTYPE ePolicy; -} OMX_PARAM_SUSPENSIONPOLICYTYPE; - -/** @ingroup rpm */ -typedef enum OMX_SUSPENSIONTYPE { - OMX_NotSuspended, /**< component is not suspended */ - OMX_Suspended, /**< component is suspended */ - OMX_SuspensionKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_SuspensionVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_SuspendMax = 0x7FFFFFFF -} OMX_SUSPENSIONTYPE; - -/** @ingroup rpm */ -typedef struct OMX_PARAM_SUSPENSIONTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_SUSPENSIONTYPE eType; -} OMX_PARAM_SUSPENSIONTYPE ; - -typedef struct OMX_CONFIG_BOOLEANTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_BOOL bEnabled; -} OMX_CONFIG_BOOLEANTYPE; - -/* Parameter specifying the content uri to use. */ -/** @ingroup cp */ -typedef struct OMX_PARAM_CONTENTURITYPE -{ - OMX_U32 nSize; /**< size of the structure in bytes, including - actual URI name */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U8 contentURI[1]; /**< The URI name */ -} OMX_PARAM_CONTENTURITYPE; - -/* Parameter specifying the pipe to use. */ -/** @ingroup cp */ -typedef struct OMX_PARAM_CONTENTPIPETYPE -{ - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_HANDLETYPE hPipe; /**< The pipe handle*/ -} OMX_PARAM_CONTENTPIPETYPE; - -/** @ingroup rpm */ -typedef struct OMX_RESOURCECONCEALMENTTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_BOOL bResourceConcealmentForbidden; /**< disallow the use of resource concealment - methods (like degrading algorithm quality to - lower resource consumption or functional bypass) - on a component as a resolution to resource conflicts. */ -} OMX_RESOURCECONCEALMENTTYPE; - - -/** @ingroup metadata */ -typedef enum OMX_METADATACHARSETTYPE { - OMX_MetadataCharsetUnknown = 0, - OMX_MetadataCharsetASCII, - OMX_MetadataCharsetBinary, - OMX_MetadataCharsetCodePage1252, - OMX_MetadataCharsetUTF8, - OMX_MetadataCharsetJavaConformantUTF8, - OMX_MetadataCharsetUTF7, - OMX_MetadataCharsetImapUTF7, - OMX_MetadataCharsetUTF16LE, - OMX_MetadataCharsetUTF16BE, - OMX_MetadataCharsetGB12345, - OMX_MetadataCharsetHZGB2312, - OMX_MetadataCharsetGB2312, - OMX_MetadataCharsetGB18030, - OMX_MetadataCharsetGBK, - OMX_MetadataCharsetBig5, - OMX_MetadataCharsetISO88591, - OMX_MetadataCharsetISO88592, - OMX_MetadataCharsetISO88593, - OMX_MetadataCharsetISO88594, - OMX_MetadataCharsetISO88595, - OMX_MetadataCharsetISO88596, - OMX_MetadataCharsetISO88597, - OMX_MetadataCharsetISO88598, - OMX_MetadataCharsetISO88599, - OMX_MetadataCharsetISO885910, - OMX_MetadataCharsetISO885913, - OMX_MetadataCharsetISO885914, - OMX_MetadataCharsetISO885915, - OMX_MetadataCharsetShiftJIS, - OMX_MetadataCharsetISO2022JP, - OMX_MetadataCharsetISO2022JP1, - OMX_MetadataCharsetISOEUCJP, - OMX_MetadataCharsetSMS7Bit, - OMX_MetadataCharsetKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_MetadataCharsetVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_MetadataCharsetTypeMax= 0x7FFFFFFF -} OMX_METADATACHARSETTYPE; - -/** @ingroup metadata */ -typedef enum OMX_METADATASCOPETYPE -{ - OMX_MetadataScopeAllLevels, - OMX_MetadataScopeTopLevel, - OMX_MetadataScopePortLevel, - OMX_MetadataScopeNodeLevel, - OMX_MetadataScopeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_MetadataScopeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_MetadataScopeTypeMax = 0x7fffffff -} OMX_METADATASCOPETYPE; - -/** @ingroup metadata */ -typedef enum OMX_METADATASEARCHMODETYPE -{ - OMX_MetadataSearchValueSizeByIndex, - OMX_MetadataSearchItemByIndex, - OMX_MetadataSearchNextItemByKey, - OMX_MetadataSearchKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_MetadataSearchVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_MetadataSearchTypeMax = 0x7fffffff -} OMX_METADATASEARCHMODETYPE; -/** @ingroup metadata */ -typedef struct OMX_CONFIG_METADATAITEMCOUNTTYPE -{ - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_METADATASCOPETYPE eScopeMode; - OMX_U32 nScopeSpecifier; - OMX_U32 nMetadataItemCount; -} OMX_CONFIG_METADATAITEMCOUNTTYPE; - -/** @ingroup metadata */ -typedef struct OMX_CONFIG_METADATAITEMTYPE -{ - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_METADATASCOPETYPE eScopeMode; - OMX_U32 nScopeSpecifier; - OMX_U32 nMetadataItemIndex; - OMX_METADATASEARCHMODETYPE eSearchMode; - OMX_METADATACHARSETTYPE eKeyCharset; - OMX_U8 nKeySizeUsed; - OMX_U8 nKey[128]; - OMX_METADATACHARSETTYPE eValueCharset; - OMX_STRING sLanguageCountry; - OMX_U32 nValueMaxSize; - OMX_U32 nValueSizeUsed; - OMX_U8 nValue[1]; -} OMX_CONFIG_METADATAITEMTYPE; - -/* @ingroup metadata */ -typedef struct OMX_CONFIG_CONTAINERNODECOUNTTYPE -{ - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_BOOL bAllKeys; - OMX_U32 nParentNodeID; - OMX_U32 nNumNodes; -} OMX_CONFIG_CONTAINERNODECOUNTTYPE; - -/** @ingroup metadata */ -typedef struct OMX_CONFIG_CONTAINERNODEIDTYPE -{ - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_BOOL bAllKeys; - OMX_U32 nParentNodeID; - OMX_U32 nNodeIndex; - OMX_U32 nNodeID; - OMX_STRING cNodeName; - OMX_BOOL bIsLeafType; -} OMX_CONFIG_CONTAINERNODEIDTYPE; - -/** @ingroup metadata */ -typedef struct OMX_PARAM_METADATAFILTERTYPE -{ - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_BOOL bAllKeys; /* if true then this structure refers to all keys and - * the three key fields below are ignored */ - OMX_METADATACHARSETTYPE eKeyCharset; - OMX_U32 nKeySizeUsed; - OMX_U8 nKey [128]; - OMX_U32 nLanguageCountrySizeUsed; - OMX_U8 nLanguageCountry[128]; - OMX_BOOL bEnabled; /* if true then key is part of filter (e.g. - * retained for query later). If false then - * key is not part of filter */ -} OMX_PARAM_METADATAFILTERTYPE; - -/** The OMX_HANDLETYPE structure defines the component handle. The component - * handle is used to access all of the component's public methods and also - * contains pointers to the component's private data area. The component - * handle is initialized by the OMX core (with help from the component) - * during the process of loading the component. After the component is - * successfully loaded, the application can safely access any of the - * component's public functions (although some may return an error because - * the state is inappropriate for the access). - * - * @ingroup comp - */ -typedef struct OMX_COMPONENTTYPE -{ - /** The size of this structure, in bytes. It is the responsibility - of the allocator of this structure to fill in this value. Since - this structure is allocated by the GetHandle function, this - function will fill in this value. */ - OMX_U32 nSize; - - /** nVersion is the version of the OMX specification that the structure - is built against. It is the responsibility of the creator of this - structure to initialize this value and every user of this structure - should verify that it knows how to use the exact version of - this structure found herein. */ - OMX_VERSIONTYPE nVersion; - - /** pComponentPrivate is a pointer to the component private data area. - This member is allocated and initialized by the component when the - component is first loaded. The application should not access this - data area. */ - OMX_PTR pComponentPrivate; - - /** pApplicationPrivate is a pointer that is a parameter to the - OMX_GetHandle method, and contains an application private value - provided by the IL client. This application private data is - returned to the IL Client by OMX in all callbacks */ - OMX_PTR pApplicationPrivate; - - /** refer to OMX_GetComponentVersion in OMX_core.h or the OMX IL - specification for details on the GetComponentVersion method. - */ - OMX_ERRORTYPE (*GetComponentVersion)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_OUT OMX_STRING pComponentName, - OMX_OUT OMX_VERSIONTYPE* pComponentVersion, - OMX_OUT OMX_VERSIONTYPE* pSpecVersion, - OMX_OUT OMX_UUIDTYPE* pComponentUUID); - - /** refer to OMX_SendCommand in OMX_core.h or the OMX IL - specification for details on the SendCommand method. - */ - OMX_ERRORTYPE (*SendCommand)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_COMMANDTYPE Cmd, - OMX_IN OMX_U32 nParam1, - OMX_IN OMX_PTR pCmdData); - - /** refer to OMX_GetParameter in OMX_core.h or the OMX IL - specification for details on the GetParameter method. - */ - OMX_ERRORTYPE (*GetParameter)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_INDEXTYPE nParamIndex, - OMX_INOUT OMX_PTR pComponentParameterStructure); - - - /** refer to OMX_SetParameter in OMX_core.h or the OMX IL - specification for details on the SetParameter method. - */ - OMX_ERRORTYPE (*SetParameter)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_INDEXTYPE nIndex, - OMX_IN OMX_PTR pComponentParameterStructure); - - - /** refer to OMX_GetConfig in OMX_core.h or the OMX IL - specification for details on the GetConfig method. - */ - OMX_ERRORTYPE (*GetConfig)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_INDEXTYPE nIndex, - OMX_INOUT OMX_PTR pComponentConfigStructure); - - - /** refer to OMX_SetConfig in OMX_core.h or the OMX IL - specification for details on the SetConfig method. - */ - OMX_ERRORTYPE (*SetConfig)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_INDEXTYPE nIndex, - OMX_IN OMX_PTR pComponentConfigStructure); - - - /** refer to OMX_GetExtensionIndex in OMX_core.h or the OMX IL - specification for details on the GetExtensionIndex method. - */ - OMX_ERRORTYPE (*GetExtensionIndex)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_STRING cParameterName, - OMX_OUT OMX_INDEXTYPE* pIndexType); - - - /** refer to OMX_GetState in OMX_core.h or the OMX IL - specification for details on the GetState method. - */ - OMX_ERRORTYPE (*GetState)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_OUT OMX_STATETYPE* pState); - - - /** The ComponentTunnelRequest method will interact with another OMX - component to determine if tunneling is possible and to setup the - tunneling. The return codes for this method can be used to - determine if tunneling is not possible, or if tunneling is not - supported. - - Base profile components (i.e. non-interop) do not support this - method and should return OMX_ErrorNotImplemented - - The interop profile component MUST support tunneling to another - interop profile component with a compatible port parameters. - A component may also support proprietary communication. - - If proprietary communication is supported the negotiation of - proprietary communication is done outside of OMX in a vendor - specific way. It is only required that the proper result be - returned and the details of how the setup is done is left - to the component implementation. - - When this method is invoked when nPort in an output port, the - component will: - 1. Populate the pTunnelSetup structure with the output port's - requirements and constraints for the tunnel. - - When this method is invoked when nPort in an input port, the - component will: - 1. Query the necessary parameters from the output port to - determine if the ports are compatible for tunneling - 2. If the ports are compatible, the component should store - the tunnel step provided by the output port - 3. Determine which port (either input or output) is the buffer - supplier, and call OMX_SetParameter on the output port to - indicate this selection. - - The component will return from this call within 5 msec. - - @param [in] hComp - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle method. - @param [in] nPort - nPort is used to select the port on the component to be used - for tunneling. - @param [in] hTunneledComp - Handle of the component to tunnel with. This is the component - handle returned by the call to the OMX_GetHandle method. When - this parameter is 0x0 the component should setup the port for - communication with the application / IL Client. - @param [in] nPortOutput - nPortOutput is used indicate the port the component should - tunnel with. - @param [in] pTunnelSetup - Pointer to the tunnel setup structure. When nPort is an output port - the component should populate the fields of this structure. When - When nPort is an input port the component should review the setup - provided by the component with the output port. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup tun - */ - - OMX_ERRORTYPE (*ComponentTunnelRequest)( - OMX_IN OMX_HANDLETYPE hComp, - OMX_IN OMX_U32 nPort, - OMX_IN OMX_HANDLETYPE hTunneledComp, - OMX_IN OMX_U32 nTunneledPort, - OMX_INOUT OMX_TUNNELSETUPTYPE* pTunnelSetup); - - /** refer to OMX_UseBuffer in OMX_core.h or the OMX IL - specification for details on the UseBuffer method. - @ingroup buf - */ - OMX_ERRORTYPE (*UseBuffer)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr, - OMX_IN OMX_U32 nPortIndex, - OMX_IN OMX_PTR pAppPrivate, - OMX_IN OMX_U32 nSizeBytes, - OMX_IN OMX_U8* pBuffer); - - /** refer to OMX_AllocateBuffer in OMX_core.h or the OMX IL - specification for details on the AllocateBuffer method. - @ingroup buf - */ - OMX_ERRORTYPE (*AllocateBuffer)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_INOUT OMX_BUFFERHEADERTYPE** ppBuffer, - OMX_IN OMX_U32 nPortIndex, - OMX_IN OMX_PTR pAppPrivate, - OMX_IN OMX_U32 nSizeBytes); - - /** refer to OMX_FreeBuffer in OMX_core.h or the OMX IL - specification for details on the FreeBuffer method. - @ingroup buf - */ - OMX_ERRORTYPE (*FreeBuffer)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_U32 nPortIndex, - OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); - - /** refer to OMX_EmptyThisBuffer in OMX_core.h or the OMX IL - specification for details on the EmptyThisBuffer method. - @ingroup buf - */ - OMX_ERRORTYPE (*EmptyThisBuffer)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); - - /** refer to OMX_FillThisBuffer in OMX_core.h or the OMX IL - specification for details on the FillThisBuffer method. - @ingroup buf - */ - OMX_ERRORTYPE (*FillThisBuffer)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); - - /** The SetCallbacks method is used by the core to specify the callback - structure from the application to the component. This is a blocking - call. The component will return from this call within 5 msec. - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the GetHandle function. - @param [in] pCallbacks - pointer to an OMX_CALLBACKTYPE structure used to provide the - callback information to the component - @param [in] pAppData - pointer to an application defined value. It is anticipated that - the application will pass a pointer to a data structure or a "this - pointer" in this area to allow the callback (in the application) - to determine the context of the call - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - */ - OMX_ERRORTYPE (*SetCallbacks)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_CALLBACKTYPE* pCallbacks, - OMX_IN OMX_PTR pAppData); - - /** ComponentDeInit method is used to deinitialize the component - providing a means to free any resources allocated at component - initialization. NOTE: After this call the component handle is - not valid for further use. - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the GetHandle function. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - */ - OMX_ERRORTYPE (*ComponentDeInit)( - OMX_IN OMX_HANDLETYPE hComponent); - - /** @ingroup buf */ - OMX_ERRORTYPE (*UseEGLImage)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr, - OMX_IN OMX_U32 nPortIndex, - OMX_IN OMX_PTR pAppPrivate, - OMX_IN void* eglImage); - - OMX_ERRORTYPE (*ComponentRoleEnum)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_OUT OMX_U8 *cRole, - OMX_IN OMX_U32 nIndex); - -} OMX_COMPONENTTYPE; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ diff --git a/external/android/include/18/frameworks/native/include/media/openmax/OMX_ContentPipe.h b/external/android/include/18/frameworks/native/include/media/openmax/OMX_ContentPipe.h deleted file mode 100644 index ee9e4db..0000000 --- a/external/android/include/18/frameworks/native/include/media/openmax/OMX_ContentPipe.h +++ /dev/null @@ -1,212 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** OMX_ContentPipe.h - OpenMax IL version 1.1.2 - * The OMX_ContentPipe header file contains the definitions used to define - * the public interface for content piples. This header file is intended to - * be used by the component. - */ - -#ifndef OMX_CONTENTPIPE_H -#define OMX_CONTENTPIPE_H - -#ifndef KD_EACCES -/* OpenKODE error codes. CPResult values may be zero (indicating success - or one of the following values) */ -#define KD_EACCES (1) -#define KD_EADDRINUSE (2) -#define KD_EAGAIN (5) -#define KD_EBADF (7) -#define KD_EBUSY (8) -#define KD_ECONNREFUSED (9) -#define KD_ECONNRESET (10) -#define KD_EDEADLK (11) -#define KD_EDESTADDRREQ (12) -#define KD_ERANGE (35) -#define KD_EEXIST (13) -#define KD_EFBIG (14) -#define KD_EHOSTUNREACH (15) -#define KD_EINVAL (17) -#define KD_EIO (18) -#define KD_EISCONN (20) -#define KD_EISDIR (21) -#define KD_EMFILE (22) -#define KD_ENAMETOOLONG (23) -#define KD_ENOENT (24) -#define KD_ENOMEM (25) -#define KD_ENOSPC (26) -#define KD_ENOSYS (27) -#define KD_ENOTCONN (28) -#define KD_EPERM (33) -#define KD_ETIMEDOUT (36) -#define KD_EILSEQ (19) -#endif - -/** Map types from OMX standard types only here so interface is as generic as possible. */ -typedef OMX_U32 CPresult; -typedef char * CPstring; -typedef void * CPhandle; -typedef OMX_U32 CPuint; -typedef OMX_S32 CPint; -typedef char CPbyte; -typedef OMX_BOOL CPbool; - -/** enumeration of origin types used in the CP_PIPETYPE's Seek function - * @ingroup cp - */ -typedef enum CP_ORIGINTYPE { - CP_OriginBegin, - CP_OriginCur, - CP_OriginEnd, - CP_OriginKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - CP_OriginVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - CP_OriginMax = 0X7FFFFFFF -} CP_ORIGINTYPE; - -/** enumeration of contact access types used in the CP_PIPETYPE's Open function - * @ingroup cp - */ -typedef enum CP_ACCESSTYPE { - CP_AccessRead, - CP_AccessWrite, - CP_AccessReadWrite , - CP_AccessKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - CP_AccessVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - CP_AccessMax = 0X7FFFFFFF -} CP_ACCESSTYPE; - -/** enumeration of results returned by the CP_PIPETYPE's CheckAvailableBytes function - * @ingroup cp - */ -typedef enum CP_CHECKBYTESRESULTTYPE -{ - CP_CheckBytesOk, /**< There are at least the request number - of bytes available */ - CP_CheckBytesNotReady, /**< The pipe is still retrieving bytes - and presently lacks sufficient bytes. - Client will be called when they are - sufficient bytes are available. */ - CP_CheckBytesInsufficientBytes , /**< The pipe has retrieved all bytes - but those available are less than those - requested */ - CP_CheckBytesAtEndOfStream, /**< The pipe has reached the end of stream - and no more bytes are available. */ - CP_CheckBytesOutOfBuffers, /**< All read/write buffers are currently in use. */ - CP_CheckBytesKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - CP_CheckBytesVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - CP_CheckBytesMax = 0X7FFFFFFF -} CP_CHECKBYTESRESULTTYPE; - -/** enumeration of content pipe events sent to the client callback. - * @ingroup cp - */ -typedef enum CP_EVENTTYPE{ - CP_BytesAvailable, /** bytes requested in a CheckAvailableBytes call are now available*/ - CP_Overflow, /** enumeration of content pipe events sent to the client callback*/ - CP_PipeDisconnected , /** enumeration of content pipe events sent to the client callback*/ - CP_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - CP_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - CP_EventMax = 0X7FFFFFFF -} CP_EVENTTYPE; - -/** content pipe definition - * @ingroup cp - */ -typedef struct CP_PIPETYPE -{ - /** Open a content stream for reading or writing. */ - CPresult (*Open)( CPhandle* hContent, CPstring szURI, CP_ACCESSTYPE eAccess ); - - /** Close a content stream. */ - CPresult (*Close)( CPhandle hContent ); - - /** Create a content source and open it for writing. */ - CPresult (*Create)( CPhandle *hContent, CPstring szURI ); - - /** Check the that specified number of bytes are available for reading or writing (depending on access type).*/ - CPresult (*CheckAvailableBytes)( CPhandle hContent, CPuint nBytesRequested, CP_CHECKBYTESRESULTTYPE *eResult ); - - /** Seek to certain position in the content relative to the specified origin. */ - CPresult (*SetPosition)( CPhandle hContent, CPint nOffset, CP_ORIGINTYPE eOrigin); - - /** Retrieve the current position relative to the start of the content. */ - CPresult (*GetPosition)( CPhandle hContent, CPuint *pPosition); - - /** Retrieve data of the specified size from the content stream (advance content pointer by size of data). - Note: pipe client provides pointer. This function is appropriate for small high frequency reads. */ - CPresult (*Read)( CPhandle hContent, CPbyte *pData, CPuint nSize); - - /** Retrieve a buffer allocated by the pipe that contains the requested number of bytes. - Buffer contains the next block of bytes, as specified by nSize, of the content. nSize also - returns the size of the block actually read. Content pointer advances the by the returned size. - Note: pipe provides pointer. This function is appropriate for large reads. The client must call - ReleaseReadBuffer when done with buffer. - - In some cases the requested block may not reside in contiguous memory within the - pipe implementation. For instance if the pipe leverages a circular buffer then the requested - block may straddle the boundary of the circular buffer. By default a pipe implementation - performs a copy in this case to provide the block to the pipe client in one contiguous buffer. - If, however, the client sets bForbidCopy, then the pipe returns only those bytes preceding the memory - boundary. Here the client may retrieve the data in segments over successive calls. */ - CPresult (*ReadBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint *nSize, CPbool bForbidCopy); - - /** Release a buffer obtained by ReadBuffer back to the pipe. */ - CPresult (*ReleaseReadBuffer)(CPhandle hContent, CPbyte *pBuffer); - - /** Write data of the specified size to the content (advance content pointer by size of data). - Note: pipe client provides pointer. This function is appropriate for small high frequency writes. */ - CPresult (*Write)( CPhandle hContent, CPbyte *data, CPuint nSize); - - /** Retrieve a buffer allocated by the pipe used to write data to the content. - Client will fill buffer with output data. Note: pipe provides pointer. This function is appropriate - for large writes. The client must call WriteBuffer when done it has filled the buffer with data.*/ - CPresult (*GetWriteBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint nSize); - - /** Deliver a buffer obtained via GetWriteBuffer to the pipe. Pipe will write the - the contents of the buffer to content and advance content pointer by the size of the buffer */ - CPresult (*WriteBuffer)( CPhandle hContent, CPbyte *pBuffer, CPuint nFilledSize); - - /** Register a per-handle client callback with the content pipe. */ - CPresult (*RegisterCallback)( CPhandle hContent, CPresult (*ClientCallback)(CP_EVENTTYPE eEvent, CPuint iParam)); - -} CP_PIPETYPE; - -#endif - diff --git a/external/android/include/18/frameworks/native/include/media/openmax/OMX_Core.h b/external/android/include/18/frameworks/native/include/media/openmax/OMX_Core.h deleted file mode 100644 index 9fb0f6f..0000000 --- a/external/android/include/18/frameworks/native/include/media/openmax/OMX_Core.h +++ /dev/null @@ -1,1448 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** OMX_Core.h - OpenMax IL version 1.1.2 - * The OMX_Core header file contains the definitions used by both the - * application and the component to access common items. - */ - -#ifndef OMX_Core_h -#define OMX_Core_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/* Each OMX header shall include all required header files to allow the - * header to compile without errors. The includes below are required - * for this header file to compile successfully - */ - -#include - - -/** The OMX_COMMANDTYPE enumeration is used to specify the action in the - * OMX_SendCommand macro. - * @ingroup core - */ -typedef enum OMX_COMMANDTYPE -{ - OMX_CommandStateSet, /**< Change the component state */ - OMX_CommandFlush, /**< Flush the data queue(s) of a component */ - OMX_CommandPortDisable, /**< Disable a port on a component. */ - OMX_CommandPortEnable, /**< Enable a port on a component. */ - OMX_CommandMarkBuffer, /**< Mark a component/buffer for observation */ - OMX_CommandKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_CommandVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_CommandMax = 0X7FFFFFFF -} OMX_COMMANDTYPE; - - - -/** The OMX_STATETYPE enumeration is used to indicate or change the component - * state. This enumeration reflects the current state of the component when - * used with the OMX_GetState macro or becomes the parameter in a state change - * command when used with the OMX_SendCommand macro. - * - * The component will be in the Loaded state after the component is initially - * loaded into memory. In the Loaded state, the component is not allowed to - * allocate or hold resources other than to build it's internal parameter - * and configuration tables. The application will send one or more - * SetParameters/GetParameters and SetConfig/GetConfig commands to the - * component and the component will record each of these parameter and - * configuration changes for use later. When the application sends the - * Idle command, the component will acquire the resources needed for the - * specified configuration and will transition to the idle state if the - * allocation is successful. If the component cannot successfully - * transition to the idle state for any reason, the state of the component - * shall be fully rolled back to the Loaded state (e.g. all allocated - * resources shall be released). When the component receives the command - * to go to the Executing state, it shall begin processing buffers by - * sending all input buffers it holds to the application. While - * the component is in the Idle state, the application may also send the - * Pause command. If the component receives the pause command while in the - * Idle state, the component shall send all input buffers it holds to the - * application, but shall not begin processing buffers. This will allow the - * application to prefill buffers. - * - * @ingroup comp - */ - -typedef enum OMX_STATETYPE -{ - OMX_StateInvalid, /**< component has detected that it's internal data - structures are corrupted to the point that - it cannot determine it's state properly */ - OMX_StateLoaded, /**< component has been loaded but has not completed - initialization. The OMX_SetParameter macro - and the OMX_GetParameter macro are the only - valid macros allowed to be sent to the - component in this state. */ - OMX_StateIdle, /**< component initialization has been completed - successfully and the component is ready to - to start. */ - OMX_StateExecuting, /**< component has accepted the start command and - is processing data (if data is available) */ - OMX_StatePause, /**< component has received pause command */ - OMX_StateWaitForResources, /**< component is waiting for resources, either after - preemption or before it gets the resources requested. - See specification for complete details. */ - OMX_StateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_StateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_StateMax = 0X7FFFFFFF -} OMX_STATETYPE; - -/** The OMX_ERRORTYPE enumeration defines the standard OMX Errors. These - * errors should cover most of the common failure cases. However, - * vendors are free to add additional error messages of their own as - * long as they follow these rules: - * 1. Vendor error messages shall be in the range of 0x90000000 to - * 0x9000FFFF. - * 2. Vendor error messages shall be defined in a header file provided - * with the component. No error messages are allowed that are - * not defined. - */ -typedef enum OMX_ERRORTYPE -{ - OMX_ErrorNone = 0, - - /** There were insufficient resources to perform the requested operation */ - OMX_ErrorInsufficientResources = (OMX_S32) 0x80001000, - - /** There was an error, but the cause of the error could not be determined */ - OMX_ErrorUndefined = (OMX_S32) 0x80001001, - - /** The component name string was not valid */ - OMX_ErrorInvalidComponentName = (OMX_S32) 0x80001002, - - /** No component with the specified name string was found */ - OMX_ErrorComponentNotFound = (OMX_S32) 0x80001003, - - /** The component specified did not have a "OMX_ComponentInit" or - "OMX_ComponentDeInit entry point */ - OMX_ErrorInvalidComponent = (OMX_S32) 0x80001004, - - /** One or more parameters were not valid */ - OMX_ErrorBadParameter = (OMX_S32) 0x80001005, - - /** The requested function is not implemented */ - OMX_ErrorNotImplemented = (OMX_S32) 0x80001006, - - /** The buffer was emptied before the next buffer was ready */ - OMX_ErrorUnderflow = (OMX_S32) 0x80001007, - - /** The buffer was not available when it was needed */ - OMX_ErrorOverflow = (OMX_S32) 0x80001008, - - /** The hardware failed to respond as expected */ - OMX_ErrorHardware = (OMX_S32) 0x80001009, - - /** The component is in the state OMX_StateInvalid */ - OMX_ErrorInvalidState = (OMX_S32) 0x8000100A, - - /** Stream is found to be corrupt */ - OMX_ErrorStreamCorrupt = (OMX_S32) 0x8000100B, - - /** Ports being connected are not compatible */ - OMX_ErrorPortsNotCompatible = (OMX_S32) 0x8000100C, - - /** Resources allocated to an idle component have been - lost resulting in the component returning to the loaded state */ - OMX_ErrorResourcesLost = (OMX_S32) 0x8000100D, - - /** No more indicies can be enumerated */ - OMX_ErrorNoMore = (OMX_S32) 0x8000100E, - - /** The component detected a version mismatch */ - OMX_ErrorVersionMismatch = (OMX_S32) 0x8000100F, - - /** The component is not ready to return data at this time */ - OMX_ErrorNotReady = (OMX_S32) 0x80001010, - - /** There was a timeout that occurred */ - OMX_ErrorTimeout = (OMX_S32) 0x80001011, - - /** This error occurs when trying to transition into the state you are already in */ - OMX_ErrorSameState = (OMX_S32) 0x80001012, - - /** Resources allocated to an executing or paused component have been - preempted, causing the component to return to the idle state */ - OMX_ErrorResourcesPreempted = (OMX_S32) 0x80001013, - - /** A non-supplier port sends this error to the IL client (via the EventHandler callback) - during the allocation of buffers (on a transition from the LOADED to the IDLE state or - on a port restart) when it deems that it has waited an unusually long time for the supplier - to send it an allocated buffer via a UseBuffer call. */ - OMX_ErrorPortUnresponsiveDuringAllocation = (OMX_S32) 0x80001014, - - /** A non-supplier port sends this error to the IL client (via the EventHandler callback) - during the deallocation of buffers (on a transition from the IDLE to LOADED state or - on a port stop) when it deems that it has waited an unusually long time for the supplier - to request the deallocation of a buffer header via a FreeBuffer call. */ - OMX_ErrorPortUnresponsiveDuringDeallocation = (OMX_S32) 0x80001015, - - /** A supplier port sends this error to the IL client (via the EventHandler callback) - during the stopping of a port (either on a transition from the IDLE to LOADED - state or a port stop) when it deems that it has waited an unusually long time for - the non-supplier to return a buffer via an EmptyThisBuffer or FillThisBuffer call. */ - OMX_ErrorPortUnresponsiveDuringStop = (OMX_S32) 0x80001016, - - /** Attempting a state transtion that is not allowed */ - OMX_ErrorIncorrectStateTransition = (OMX_S32) 0x80001017, - - /* Attempting a command that is not allowed during the present state. */ - OMX_ErrorIncorrectStateOperation = (OMX_S32) 0x80001018, - - /** The values encapsulated in the parameter or config structure are not supported. */ - OMX_ErrorUnsupportedSetting = (OMX_S32) 0x80001019, - - /** The parameter or config indicated by the given index is not supported. */ - OMX_ErrorUnsupportedIndex = (OMX_S32) 0x8000101A, - - /** The port index supplied is incorrect. */ - OMX_ErrorBadPortIndex = (OMX_S32) 0x8000101B, - - /** The port has lost one or more of its buffers and it thus unpopulated. */ - OMX_ErrorPortUnpopulated = (OMX_S32) 0x8000101C, - - /** Component suspended due to temporary loss of resources */ - OMX_ErrorComponentSuspended = (OMX_S32) 0x8000101D, - - /** Component suspended due to an inability to acquire dynamic resources */ - OMX_ErrorDynamicResourcesUnavailable = (OMX_S32) 0x8000101E, - - /** When the macroblock error reporting is enabled the component returns new error - for every frame that has errors */ - OMX_ErrorMbErrorsInFrame = (OMX_S32) 0x8000101F, - - /** A component reports this error when it cannot parse or determine the format of an input stream. */ - OMX_ErrorFormatNotDetected = (OMX_S32) 0x80001020, - - /** The content open operation failed. */ - OMX_ErrorContentPipeOpenFailed = (OMX_S32) 0x80001021, - - /** The content creation operation failed. */ - OMX_ErrorContentPipeCreationFailed = (OMX_S32) 0x80001022, - - /** Separate table information is being used */ - OMX_ErrorSeperateTablesUsed = (OMX_S32) 0x80001023, - - /** Tunneling is unsupported by the component*/ - OMX_ErrorTunnelingUnsupported = (OMX_S32) 0x80001024, - - OMX_ErrorKhronosExtensions = (OMX_S32)0x8F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_ErrorVendorStartUnused = (OMX_S32)0x90000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_ErrorMax = 0x7FFFFFFF -} OMX_ERRORTYPE; - -/** @ingroup core */ -typedef OMX_ERRORTYPE (* OMX_COMPONENTINITTYPE)(OMX_IN OMX_HANDLETYPE hComponent); - -/** @ingroup core */ -typedef struct OMX_COMPONENTREGISTERTYPE -{ - const char * pName; /* Component name, 128 byte limit (including '\0') applies */ - OMX_COMPONENTINITTYPE pInitialize; /* Component instance initialization function */ -} OMX_COMPONENTREGISTERTYPE; - -/** @ingroup core */ -extern OMX_COMPONENTREGISTERTYPE OMX_ComponentRegistered[]; - -/** @ingroup rpm */ -typedef struct OMX_PRIORITYMGMTTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nGroupPriority; /**< Priority of the component group */ - OMX_U32 nGroupID; /**< ID of the component group */ -} OMX_PRIORITYMGMTTYPE; - -/* Component name and Role names are limited to 128 characters including the terminating '\0'. */ -#define OMX_MAX_STRINGNAME_SIZE 128 - -/** @ingroup comp */ -typedef struct OMX_PARAM_COMPONENTROLETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U8 cRole[OMX_MAX_STRINGNAME_SIZE]; /**< name of standard component which defines component role */ -} OMX_PARAM_COMPONENTROLETYPE; - -/** End of Stream Buffer Flag: - * - * A component sets EOS when it has no more data to emit on a particular - * output port. Thus an output port shall set EOS on the last buffer it - * emits. A component's determination of when an output port should - * cease sending data is implemenation specific. - * @ingroup buf - */ - -#define OMX_BUFFERFLAG_EOS 0x00000001 - -/** Start Time Buffer Flag: - * - * The source of a stream (e.g. a demux component) sets the STARTTIME - * flag on the buffer that contains the starting timestamp for the - * stream. The starting timestamp corresponds to the first data that - * should be displayed at startup or after a seek. - * The first timestamp of the stream is not necessarily the start time. - * For instance, in the case of a seek to a particular video frame, - * the target frame may be an interframe. Thus the first buffer of - * the stream will be the intra-frame preceding the target frame and - * the starttime will occur with the target frame (with any other - * required frames required to reconstruct the target intervening). - * - * The STARTTIME flag is directly associated with the buffer's - * timestamp ' thus its association to buffer data and its - * propagation is identical to the timestamp's. - * - * When a Sync Component client receives a buffer with the - * STARTTIME flag it shall perform a SetConfig on its sync port - * using OMX_ConfigTimeClientStartTime and passing the buffer's - * timestamp. - * - * @ingroup buf - */ - -#define OMX_BUFFERFLAG_STARTTIME 0x00000002 - - - -/** Decode Only Buffer Flag: - * - * The source of a stream (e.g. a demux component) sets the DECODEONLY - * flag on any buffer that should shall be decoded but should not be - * displayed. This flag is used, for instance, when a source seeks to - * a target interframe that requires the decode of frames preceding the - * target to facilitate the target's reconstruction. In this case the - * source would emit the frames preceding the target downstream - * but mark them as decode only. - * - * The DECODEONLY is associated with buffer data and propagated in a - * manner identical to the buffer timestamp. - * - * A component that renders data should ignore all buffers with - * the DECODEONLY flag set. - * - * @ingroup buf - */ - -#define OMX_BUFFERFLAG_DECODEONLY 0x00000004 - - -/* Data Corrupt Flag: This flag is set when the IL client believes the data in the associated buffer is corrupt - * @ingroup buf - */ - -#define OMX_BUFFERFLAG_DATACORRUPT 0x00000008 - -/* End of Frame: The buffer contains exactly one end of frame and no data - * occurs after the end of frame. This flag is an optional hint. The absence - * of this flag does not imply the absence of an end of frame within the buffer. - * @ingroup buf -*/ -#define OMX_BUFFERFLAG_ENDOFFRAME 0x00000010 - -/* Sync Frame Flag: This flag is set when the buffer content contains a coded sync frame ' - * a frame that has no dependency on any other frame information - * @ingroup buf - */ -#define OMX_BUFFERFLAG_SYNCFRAME 0x00000020 - -/* Extra data present flag: there is extra data appended to the data stream - * residing in the buffer - * @ingroup buf - */ -#define OMX_BUFFERFLAG_EXTRADATA 0x00000040 - -/** Codec Config Buffer Flag: -* OMX_BUFFERFLAG_CODECCONFIG is an optional flag that is set by an -* output port when all bytes in the buffer form part or all of a set of -* codec specific configuration data. Examples include SPS/PPS nal units -* for OMX_VIDEO_CodingAVC or AudioSpecificConfig data for -* OMX_AUDIO_CodingAAC. Any component that for a given stream sets -* OMX_BUFFERFLAG_CODECCONFIG shall not mix codec configuration bytes -* with frame data in the same buffer, and shall send all buffers -* containing codec configuration bytes before any buffers containing -* frame data that those configurations bytes describe. -* If the stream format for a particular codec has a frame specific -* header at the start of each frame, for example OMX_AUDIO_CodingMP3 or -* OMX_AUDIO_CodingAAC in ADTS mode, then these shall be presented as -* normal without setting OMX_BUFFERFLAG_CODECCONFIG. - * @ingroup buf - */ -#define OMX_BUFFERFLAG_CODECCONFIG 0x00000080 - - - -/** @ingroup buf */ -typedef struct OMX_BUFFERHEADERTYPE -{ - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U8* pBuffer; /**< Pointer to actual block of memory - that is acting as the buffer */ - OMX_U32 nAllocLen; /**< size of the buffer allocated, in bytes */ - OMX_U32 nFilledLen; /**< number of bytes currently in the - buffer */ - OMX_U32 nOffset; /**< start offset of valid data in bytes from - the start of the buffer */ - OMX_PTR pAppPrivate; /**< pointer to any data the application - wants to associate with this buffer */ - OMX_PTR pPlatformPrivate; /**< pointer to any data the platform - wants to associate with this buffer */ - OMX_PTR pInputPortPrivate; /**< pointer to any data the input port - wants to associate with this buffer */ - OMX_PTR pOutputPortPrivate; /**< pointer to any data the output port - wants to associate with this buffer */ - OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will generate a - mark event upon processing this buffer. */ - OMX_PTR pMarkData; /**< Application specific data associated with - the mark sent on a mark event to disambiguate - this mark from others. */ - OMX_U32 nTickCount; /**< Optional entry that the component and - application can update with a tick count - when they access the component. This - value should be in microseconds. Since - this is a value relative to an arbitrary - starting point, this value cannot be used - to determine absolute time. This is an - optional entry and not all components - will update it.*/ - OMX_TICKS nTimeStamp; /**< Timestamp corresponding to the sample - starting at the first logical sample - boundary in the buffer. Timestamps of - successive samples within the buffer may - be inferred by adding the duration of the - of the preceding buffer to the timestamp - of the preceding buffer.*/ - OMX_U32 nFlags; /**< buffer specific flags */ - OMX_U32 nOutputPortIndex; /**< The index of the output port (if any) using - this buffer */ - OMX_U32 nInputPortIndex; /**< The index of the input port (if any) using - this buffer */ -} OMX_BUFFERHEADERTYPE; - -/** The OMX_EXTRADATATYPE enumeration is used to define the - * possible extra data payload types. - * NB: this enum is binary backwards compatible with the previous - * OMX_EXTRADATA_QUANT define. This should be replaced with - * OMX_ExtraDataQuantization. - */ -typedef enum OMX_EXTRADATATYPE -{ - OMX_ExtraDataNone = 0, /**< Indicates that no more extra data sections follow */ - OMX_ExtraDataQuantization, /**< The data payload contains quantization data */ - OMX_ExtraDataKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_ExtraDataVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_ExtraDataMax = 0x7FFFFFFF -} OMX_EXTRADATATYPE; - - -typedef struct OMX_OTHER_EXTRADATATYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_EXTRADATATYPE eType; /* Extra Data type */ - OMX_U32 nDataSize; /* Size of the supporting data to follow */ - OMX_U8 data[1]; /* Supporting data hint */ -} OMX_OTHER_EXTRADATATYPE; - -/** @ingroup comp */ -typedef struct OMX_PORT_PARAM_TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPorts; /**< The number of ports for this component */ - OMX_U32 nStartPortNumber; /** first port number for this type of port */ -} OMX_PORT_PARAM_TYPE; - -/** @ingroup comp */ -typedef enum OMX_EVENTTYPE -{ - OMX_EventCmdComplete, /**< component has sucessfully completed a command */ - OMX_EventError, /**< component has detected an error condition */ - OMX_EventMark, /**< component has detected a buffer mark */ - OMX_EventPortSettingsChanged, /**< component is reported a port settings change */ - OMX_EventBufferFlag, /**< component has detected an EOS */ - OMX_EventResourcesAcquired, /**< component has been granted resources and is - automatically starting the state change from - OMX_StateWaitForResources to OMX_StateIdle. */ - OMX_EventComponentResumed, /**< Component resumed due to reacquisition of resources */ - OMX_EventDynamicResourcesAvailable, /**< Component has acquired previously unavailable dynamic resources */ - OMX_EventPortFormatDetected, /**< Component has detected a supported format. */ - OMX_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_EventMax = 0x7FFFFFFF -} OMX_EVENTTYPE; - -typedef struct OMX_CALLBACKTYPE -{ - /** The EventHandler method is used to notify the application when an - event of interest occurs. Events are defined in the OMX_EVENTTYPE - enumeration. Please see that enumeration for details of what will - be returned for each type of event. Callbacks should not return - an error to the component, so if an error occurs, the application - shall handle it internally. This is a blocking call. - - The application should return from this call within 5 msec to avoid - blocking the component for an excessively long period of time. - - @param hComponent - handle of the component to access. This is the component - handle returned by the call to the GetHandle function. - @param pAppData - pointer to an application defined value that was provided in the - pAppData parameter to the OMX_GetHandle method for the component. - This application defined value is provided so that the application - can have a component specific context when receiving the callback. - @param eEvent - Event that the component wants to notify the application about. - @param nData1 - nData will be the OMX_ERRORTYPE for an error event and will be - an OMX_COMMANDTYPE for a command complete event and OMX_INDEXTYPE for a OMX_PortSettingsChanged event. - @param nData2 - nData2 will hold further information related to the event. Can be OMX_STATETYPE for - a OMX_CommandStateSet command or port index for a OMX_PortSettingsChanged event. - Default value is 0 if not used. ) - @param pEventData - Pointer to additional event-specific data (see spec for meaning). - */ - - OMX_ERRORTYPE (*EventHandler)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_PTR pAppData, - OMX_IN OMX_EVENTTYPE eEvent, - OMX_IN OMX_U32 nData1, - OMX_IN OMX_U32 nData2, - OMX_IN OMX_PTR pEventData); - - /** The EmptyBufferDone method is used to return emptied buffers from an - input port back to the application for reuse. This is a blocking call - so the application should not attempt to refill the buffers during this - call, but should queue them and refill them in another thread. There - is no error return, so the application shall handle any errors generated - internally. - - The application should return from this call within 5 msec. - - @param hComponent - handle of the component to access. This is the component - handle returned by the call to the GetHandle function. - @param pAppData - pointer to an application defined value that was provided in the - pAppData parameter to the OMX_GetHandle method for the component. - This application defined value is provided so that the application - can have a component specific context when receiving the callback. - @param pBuffer - pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer - or AllocateBuffer indicating the buffer that was emptied. - @ingroup buf - */ - OMX_ERRORTYPE (*EmptyBufferDone)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_PTR pAppData, - OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); - - /** The FillBufferDone method is used to return filled buffers from an - output port back to the application for emptying and then reuse. - This is a blocking call so the application should not attempt to - empty the buffers during this call, but should queue the buffers - and empty them in another thread. There is no error return, so - the application shall handle any errors generated internally. The - application shall also update the buffer header to indicate the - number of bytes placed into the buffer. - - The application should return from this call within 5 msec. - - @param hComponent - handle of the component to access. This is the component - handle returned by the call to the GetHandle function. - @param pAppData - pointer to an application defined value that was provided in the - pAppData parameter to the OMX_GetHandle method for the component. - This application defined value is provided so that the application - can have a component specific context when receiving the callback. - @param pBuffer - pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer - or AllocateBuffer indicating the buffer that was filled. - @ingroup buf - */ - OMX_ERRORTYPE (*FillBufferDone)( - OMX_OUT OMX_HANDLETYPE hComponent, - OMX_OUT OMX_PTR pAppData, - OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer); - -} OMX_CALLBACKTYPE; - -/** The OMX_BUFFERSUPPLIERTYPE enumeration is used to dictate port supplier - preference when tunneling between two ports. - @ingroup tun buf -*/ -typedef enum OMX_BUFFERSUPPLIERTYPE -{ - OMX_BufferSupplyUnspecified = 0x0, /**< port supplying the buffers is unspecified, - or don't care */ - OMX_BufferSupplyInput, /**< input port supplies the buffers */ - OMX_BufferSupplyOutput, /**< output port supplies the buffers */ - OMX_BufferSupplyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_BufferSupplyVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_BufferSupplyMax = 0x7FFFFFFF -} OMX_BUFFERSUPPLIERTYPE; - - -/** buffer supplier parameter - * @ingroup tun - */ -typedef struct OMX_PARAM_BUFFERSUPPLIERTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BUFFERSUPPLIERTYPE eBufferSupplier; /**< buffer supplier */ -} OMX_PARAM_BUFFERSUPPLIERTYPE; - - -/**< indicates that buffers received by an input port of a tunnel - may not modify the data in the buffers - @ingroup tun - */ -#define OMX_PORTTUNNELFLAG_READONLY 0x00000001 - - -/** The OMX_TUNNELSETUPTYPE structure is used to pass data from an output - port to an input port as part the two ComponentTunnelRequest calls - resulting from a OMX_SetupTunnel call from the IL Client. - @ingroup tun - */ -typedef struct OMX_TUNNELSETUPTYPE -{ - OMX_U32 nTunnelFlags; /**< bit flags for tunneling */ - OMX_BUFFERSUPPLIERTYPE eSupplier; /**< supplier preference */ -} OMX_TUNNELSETUPTYPE; - -/* OMX Component headers is included to enable the core to use - macros for functions into the component for OMX release 1.0. - Developers should not access any structures or data from within - the component header directly */ -/* TO BE REMOVED - #include */ - -/** GetComponentVersion will return information about the component. - This is a blocking call. This macro will go directly from the - application to the component (via a core macro). The - component will return from this call within 5 msec. - @param [in] hComponent - handle of component to execute the command - @param [out] pComponentName - pointer to an empty string of length 128 bytes. The component - will write its name into this string. The name will be - terminated by a single zero byte. The name of a component will - be 127 bytes or less to leave room for the trailing zero byte. - An example of a valid component name is "OMX.ABC.ChannelMixer\0". - @param [out] pComponentVersion - pointer to an OMX Version structure that the component will fill - in. The component will fill in a value that indicates the - component version. NOTE: the component version is NOT the same - as the OMX Specification version (found in all structures). The - component version is defined by the vendor of the component and - its value is entirely up to the component vendor. - @param [out] pSpecVersion - pointer to an OMX Version structure that the component will fill - in. The SpecVersion is the version of the specification that the - component was built against. Please note that this value may or - may not match the structure's version. For example, if the - component was built against the 2.0 specification, but the - application (which creates the structure is built against the - 1.0 specification the versions would be different. - @param [out] pComponentUUID - pointer to the UUID of the component which will be filled in by - the component. The UUID is a unique identifier that is set at - RUN time for the component and is unique to each instantion of - the component. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_GetComponentVersion( \ - hComponent, \ - pComponentName, \ - pComponentVersion, \ - pSpecVersion, \ - pComponentUUID) \ - ((OMX_COMPONENTTYPE*)hComponent)->GetComponentVersion( \ - hComponent, \ - pComponentName, \ - pComponentVersion, \ - pSpecVersion, \ - pComponentUUID) /* Macro End */ - - -/** Send a command to the component. This call is a non-blocking call. - The component should check the parameters and then queue the command - to the component thread to be executed. The component thread shall - send the EventHandler() callback at the conclusion of the command. - This macro will go directly from the application to the component (via - a core macro). The component will return from this call within 5 msec. - - When the command is "OMX_CommandStateSet" the component will queue a - state transition to the new state idenfied in nParam. - - When the command is "OMX_CommandFlush", to flush a port's buffer queues, - the command will force the component to return all buffers NOT CURRENTLY - BEING PROCESSED to the application, in the order in which the buffers - were received. - - When the command is "OMX_CommandPortDisable" or - "OMX_CommandPortEnable", the component's port (given by the value of - nParam) will be stopped or restarted. - - When the command "OMX_CommandMarkBuffer" is used to mark a buffer, the - pCmdData will point to a OMX_MARKTYPE structure containing the component - handle of the component to examine the buffer chain for the mark. nParam1 - contains the index of the port on which the buffer mark is applied. - - Specification text for more details. - - @param [in] hComponent - handle of component to execute the command - @param [in] Cmd - Command for the component to execute - @param [in] nParam - Parameter for the command to be executed. When Cmd has the value - OMX_CommandStateSet, value is a member of OMX_STATETYPE. When Cmd has - the value OMX_CommandFlush, value of nParam indicates which port(s) - to flush. -1 is used to flush all ports a single port index will - only flush that port. When Cmd has the value "OMX_CommandPortDisable" - or "OMX_CommandPortEnable", the component's port is given by - the value of nParam. When Cmd has the value "OMX_CommandMarkBuffer" - the components pot is given by the value of nParam. - @param [in] pCmdData - Parameter pointing to the OMX_MARKTYPE structure when Cmd has the value - "OMX_CommandMarkBuffer". - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_SendCommand( \ - hComponent, \ - Cmd, \ - nParam, \ - pCmdData) \ - ((OMX_COMPONENTTYPE*)hComponent)->SendCommand( \ - hComponent, \ - Cmd, \ - nParam, \ - pCmdData) /* Macro End */ - - -/** The OMX_GetParameter macro will get one of the current parameter - settings from the component. This macro cannot only be invoked when - the component is in the OMX_StateInvalid state. The nParamIndex - parameter is used to indicate which structure is being requested from - the component. The application shall allocate the correct structure - and shall fill in the structure size and version information before - invoking this macro. When the parameter applies to a port, the - caller shall fill in the appropriate nPortIndex value indicating the - port on which the parameter applies. If the component has not had - any settings changed, then the component should return a set of - valid DEFAULT parameters for the component. This is a blocking - call. - - The component should return from this call within 20 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] nParamIndex - Index of the structure to be filled. This value is from the - OMX_INDEXTYPE enumeration. - @param [in,out] pComponentParameterStructure - Pointer to application allocated structure to be filled by the - component. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_GetParameter( \ - hComponent, \ - nParamIndex, \ - pComponentParameterStructure) \ - ((OMX_COMPONENTTYPE*)hComponent)->GetParameter( \ - hComponent, \ - nParamIndex, \ - pComponentParameterStructure) /* Macro End */ - - -/** The OMX_SetParameter macro will send an initialization parameter - structure to a component. Each structure shall be sent one at a time, - in a separate invocation of the macro. This macro can only be - invoked when the component is in the OMX_StateLoaded state, or the - port is disabled (when the parameter applies to a port). The - nParamIndex parameter is used to indicate which structure is being - passed to the component. The application shall allocate the - correct structure and shall fill in the structure size and version - information (as well as the actual data) before invoking this macro. - The application is free to dispose of this structure after the call - as the component is required to copy any data it shall retain. This - is a blocking call. - - The component should return from this call within 20 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] nIndex - Index of the structure to be sent. This value is from the - OMX_INDEXTYPE enumeration. - @param [in] pComponentParameterStructure - pointer to application allocated structure to be used for - initialization by the component. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_SetParameter( \ - hComponent, \ - nParamIndex, \ - pComponentParameterStructure) \ - ((OMX_COMPONENTTYPE*)hComponent)->SetParameter( \ - hComponent, \ - nParamIndex, \ - pComponentParameterStructure) /* Macro End */ - - -/** The OMX_GetConfig macro will get one of the configuration structures - from a component. This macro can be invoked anytime after the - component has been loaded. The nParamIndex call parameter is used to - indicate which structure is being requested from the component. The - application shall allocate the correct structure and shall fill in the - structure size and version information before invoking this macro. - If the component has not had this configuration parameter sent before, - then the component should return a set of valid DEFAULT values for the - component. This is a blocking call. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] nIndex - Index of the structure to be filled. This value is from the - OMX_INDEXTYPE enumeration. - @param [in,out] pComponentConfigStructure - pointer to application allocated structure to be filled by the - component. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp -*/ -#define OMX_GetConfig( \ - hComponent, \ - nConfigIndex, \ - pComponentConfigStructure) \ - ((OMX_COMPONENTTYPE*)hComponent)->GetConfig( \ - hComponent, \ - nConfigIndex, \ - pComponentConfigStructure) /* Macro End */ - - -/** The OMX_SetConfig macro will send one of the configuration - structures to a component. Each structure shall be sent one at a time, - each in a separate invocation of the macro. This macro can be invoked - anytime after the component has been loaded. The application shall - allocate the correct structure and shall fill in the structure size - and version information (as well as the actual data) before invoking - this macro. The application is free to dispose of this structure after - the call as the component is required to copy any data it shall retain. - This is a blocking call. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] nConfigIndex - Index of the structure to be sent. This value is from the - OMX_INDEXTYPE enumeration above. - @param [in] pComponentConfigStructure - pointer to application allocated structure to be used for - initialization by the component. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_SetConfig( \ - hComponent, \ - nConfigIndex, \ - pComponentConfigStructure) \ - ((OMX_COMPONENTTYPE*)hComponent)->SetConfig( \ - hComponent, \ - nConfigIndex, \ - pComponentConfigStructure) /* Macro End */ - - -/** The OMX_GetExtensionIndex macro will invoke a component to translate - a vendor specific configuration or parameter string into an OMX - structure index. There is no requirement for the vendor to support - this command for the indexes already found in the OMX_INDEXTYPE - enumeration (this is done to save space in small components). The - component shall support all vendor supplied extension indexes not found - in the master OMX_INDEXTYPE enumeration. This is a blocking call. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the GetHandle function. - @param [in] cParameterName - OMX_STRING that shall be less than 128 characters long including - the trailing null byte. This is the string that will get - translated by the component into a configuration index. - @param [out] pIndexType - a pointer to a OMX_INDEXTYPE to receive the index value. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_GetExtensionIndex( \ - hComponent, \ - cParameterName, \ - pIndexType) \ - ((OMX_COMPONENTTYPE*)hComponent)->GetExtensionIndex( \ - hComponent, \ - cParameterName, \ - pIndexType) /* Macro End */ - - -/** The OMX_GetState macro will invoke the component to get the current - state of the component and place the state value into the location - pointed to by pState. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [out] pState - pointer to the location to receive the state. The value returned - is one of the OMX_STATETYPE members - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_GetState( \ - hComponent, \ - pState) \ - ((OMX_COMPONENTTYPE*)hComponent)->GetState( \ - hComponent, \ - pState) /* Macro End */ - - -/** The OMX_UseBuffer macro will request that the component use - a buffer (and allocate its own buffer header) already allocated - by another component, or by the IL Client. This is a blocking - call. - - The component should return from this call within 20 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [out] ppBuffer - pointer to an OMX_BUFFERHEADERTYPE structure used to receive the - pointer to the buffer header - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp buf - */ - -#define OMX_UseBuffer( \ - hComponent, \ - ppBufferHdr, \ - nPortIndex, \ - pAppPrivate, \ - nSizeBytes, \ - pBuffer) \ - ((OMX_COMPONENTTYPE*)hComponent)->UseBuffer( \ - hComponent, \ - ppBufferHdr, \ - nPortIndex, \ - pAppPrivate, \ - nSizeBytes, \ - pBuffer) - - -/** The OMX_AllocateBuffer macro will request that the component allocate - a new buffer and buffer header. The component will allocate the - buffer and the buffer header and return a pointer to the buffer - header. This is a blocking call. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [out] ppBuffer - pointer to an OMX_BUFFERHEADERTYPE structure used to receive - the pointer to the buffer header - @param [in] nPortIndex - nPortIndex is used to select the port on the component the buffer will - be used with. The port can be found by using the nPortIndex - value as an index into the Port Definition array of the component. - @param [in] pAppPrivate - pAppPrivate is used to initialize the pAppPrivate member of the - buffer header structure. - @param [in] nSizeBytes - size of the buffer to allocate. Used when bAllocateNew is true. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp buf - */ -#define OMX_AllocateBuffer( \ - hComponent, \ - ppBuffer, \ - nPortIndex, \ - pAppPrivate, \ - nSizeBytes) \ - ((OMX_COMPONENTTYPE*)hComponent)->AllocateBuffer( \ - hComponent, \ - ppBuffer, \ - nPortIndex, \ - pAppPrivate, \ - nSizeBytes) /* Macro End */ - - -/** The OMX_FreeBuffer macro will release a buffer header from the component - which was allocated using either OMX_AllocateBuffer or OMX_UseBuffer. If - the component allocated the buffer (see the OMX_UseBuffer macro) then - the component shall free the buffer and buffer header. This is a - blocking call. - - The component should return from this call within 20 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] nPortIndex - nPortIndex is used to select the port on the component the buffer will - be used with. - @param [in] pBuffer - pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer - or AllocateBuffer. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp buf - */ -#define OMX_FreeBuffer( \ - hComponent, \ - nPortIndex, \ - pBuffer) \ - ((OMX_COMPONENTTYPE*)hComponent)->FreeBuffer( \ - hComponent, \ - nPortIndex, \ - pBuffer) /* Macro End */ - - -/** The OMX_EmptyThisBuffer macro will send a buffer full of data to an - input port of a component. The buffer will be emptied by the component - and returned to the application via the EmptyBufferDone call back. - This is a non-blocking call in that the component will record the buffer - and return immediately and then empty the buffer, later, at the proper - time. As expected, this macro may be invoked only while the component - is in the OMX_StateExecuting. If nPortIndex does not specify an input - port, the component shall return an error. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] pBuffer - pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer - or AllocateBuffer. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp buf - */ -#define OMX_EmptyThisBuffer( \ - hComponent, \ - pBuffer) \ - ((OMX_COMPONENTTYPE*)hComponent)->EmptyThisBuffer( \ - hComponent, \ - pBuffer) /* Macro End */ - - -/** The OMX_FillThisBuffer macro will send an empty buffer to an - output port of a component. The buffer will be filled by the component - and returned to the application via the FillBufferDone call back. - This is a non-blocking call in that the component will record the buffer - and return immediately and then fill the buffer, later, at the proper - time. As expected, this macro may be invoked only while the component - is in the OMX_ExecutingState. If nPortIndex does not specify an output - port, the component shall return an error. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] pBuffer - pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer - or AllocateBuffer. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp buf - */ -#define OMX_FillThisBuffer( \ - hComponent, \ - pBuffer) \ - ((OMX_COMPONENTTYPE*)hComponent)->FillThisBuffer( \ - hComponent, \ - pBuffer) /* Macro End */ - - - -/** The OMX_UseEGLImage macro will request that the component use - a EGLImage provided by EGL (and allocate its own buffer header) - This is a blocking call. - - The component should return from this call within 20 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [out] ppBuffer - pointer to an OMX_BUFFERHEADERTYPE structure used to receive the - pointer to the buffer header. Note that the memory location used - for this buffer is NOT visible to the IL Client. - @param [in] nPortIndex - nPortIndex is used to select the port on the component the buffer will - be used with. The port can be found by using the nPortIndex - value as an index into the Port Definition array of the component. - @param [in] pAppPrivate - pAppPrivate is used to initialize the pAppPrivate member of the - buffer header structure. - @param [in] eglImage - eglImage contains the handle of the EGLImage to use as a buffer on the - specified port. The component is expected to validate properties of - the EGLImage against the configuration of the port to ensure the component - can use the EGLImage as a buffer. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp buf - */ -#define OMX_UseEGLImage( \ - hComponent, \ - ppBufferHdr, \ - nPortIndex, \ - pAppPrivate, \ - eglImage) \ - ((OMX_COMPONENTTYPE*)hComponent)->UseEGLImage( \ - hComponent, \ - ppBufferHdr, \ - nPortIndex, \ - pAppPrivate, \ - eglImage) - -/** The OMX_Init method is used to initialize the OMX core. It shall be the - first call made into OMX and it should only be executed one time without - an interviening OMX_Deinit call. - - The core should return from this call within 20 msec. - - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Init(void); - - -/** The OMX_Deinit method is used to deinitialize the OMX core. It shall be - the last call made into OMX. In the event that the core determines that - thare are components loaded when this call is made, the core may return - with an error rather than try to unload the components. - - The core should return from this call within 20 msec. - - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Deinit(void); - - -/** The OMX_ComponentNameEnum method will enumerate through all the names of - recognised valid components in the system. This function is provided - as a means to detect all the components in the system run-time. There is - no strict ordering to the enumeration order of component names, although - each name will only be enumerated once. If the OMX core supports run-time - installation of new components, it is only requried to detect newly - installed components when the first call to enumerate component names - is made (i.e. when nIndex is 0x0). - - The core should return from this call in 20 msec. - - @param [out] cComponentName - pointer to a null terminated string with the component name. The - names of the components are strings less than 127 bytes in length - plus the trailing null for a maximum size of 128 bytes. An example - of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are - assigned by the vendor, but shall start with "OMX." and then have - the Vendor designation next. - @param [in] nNameLength - number of characters in the cComponentName string. With all - component name strings restricted to less than 128 characters - (including the trailing null) it is recomended that the caller - provide a input string for the cComponentName of 128 characters. - @param [in] nIndex - number containing the enumeration index for the component. - Multiple calls to OMX_ComponentNameEnum with increasing values - of nIndex will enumerate through the component names in the - system until OMX_ErrorNoMore is returned. The value of nIndex - is 0 to (N-1), where N is the number of valid installed components - in the system. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. When the value of nIndex exceeds the number of - components in the system minus 1, OMX_ErrorNoMore will be - returned. Otherwise the appropriate OMX error will be returned. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_ComponentNameEnum( - OMX_OUT OMX_STRING cComponentName, - OMX_IN OMX_U32 nNameLength, - OMX_IN OMX_U32 nIndex); - - -/** The OMX_GetHandle method will locate the component specified by the - component name given, load that component into memory and then invoke - the component's methods to create an instance of the component. - - The core should return from this call within 20 msec. - - @param [out] pHandle - pointer to an OMX_HANDLETYPE pointer to be filled in by this method. - @param [in] cComponentName - pointer to a null terminated string with the component name. The - names of the components are strings less than 127 bytes in length - plus the trailing null for a maximum size of 128 bytes. An example - of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are - assigned by the vendor, but shall start with "OMX." and then have - the Vendor designation next. - @param [in] pAppData - pointer to an application defined value that will be returned - during callbacks so that the application can identify the source - of the callback. - @param [in] pCallBacks - pointer to a OMX_CALLBACKTYPE structure that will be passed to the - component to initialize it with. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_GetHandle( - OMX_OUT OMX_HANDLETYPE* pHandle, - OMX_IN OMX_STRING cComponentName, - OMX_IN OMX_PTR pAppData, - OMX_IN OMX_CALLBACKTYPE* pCallBacks); - - -/** The OMX_FreeHandle method will free a handle allocated by the OMX_GetHandle - method. If the component reference count goes to zero, the component will - be unloaded from memory. - - The core should return from this call within 20 msec when the component is - in the OMX_StateLoaded state. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the GetHandle function. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_FreeHandle( - OMX_IN OMX_HANDLETYPE hComponent); - - - -/** The OMX_SetupTunnel method will handle the necessary calls to the components - to setup the specified tunnel the two components. NOTE: This is - an actual method (not a #define macro). This method will make calls into - the component ComponentTunnelRequest method to do the actual tunnel - connection. - - The ComponentTunnelRequest method on both components will be called. - This method shall not be called unless the component is in the - OMX_StateLoaded state except when the ports used for the tunnel are - disabled. In this case, the component may be in the OMX_StateExecuting, - OMX_StatePause, or OMX_StateIdle states. - - The core should return from this call within 20 msec. - - @param [in] hOutput - Handle of the component to be accessed. Also this is the handle - of the component whose port, specified in the nPortOutput parameter - will be used the source for the tunnel. This is the component handle - returned by the call to the OMX_GetHandle function. There is a - requirement that hOutput be the source for the data when - tunelling (i.e. nPortOutput is an output port). If 0x0, the component - specified in hInput will have it's port specified in nPortInput - setup for communication with the application / IL client. - @param [in] nPortOutput - nPortOutput is used to select the source port on component to be - used in the tunnel. - @param [in] hInput - This is the component to setup the tunnel with. This is the handle - of the component whose port, specified in the nPortInput parameter - will be used the destination for the tunnel. This is the component handle - returned by the call to the OMX_GetHandle function. There is a - requirement that hInput be the destination for the data when - tunelling (i.e. nPortInut is an input port). If 0x0, the component - specified in hOutput will have it's port specified in nPortPOutput - setup for communication with the application / IL client. - @param [in] nPortInput - nPortInput is used to select the destination port on component to be - used in the tunnel. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - When OMX_ErrorNotImplemented is returned, one or both components is - a non-interop component and does not support tunneling. - - On failure, the ports of both components are setup for communication - with the application / IL Client. - @ingroup core tun - */ -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_SetupTunnel( - OMX_IN OMX_HANDLETYPE hOutput, - OMX_IN OMX_U32 nPortOutput, - OMX_IN OMX_HANDLETYPE hInput, - OMX_IN OMX_U32 nPortInput); - -/** @ingroup cp */ -OMX_API OMX_ERRORTYPE OMX_GetContentPipe( - OMX_OUT OMX_HANDLETYPE *hPipe, - OMX_IN OMX_STRING szURI); - -/** The OMX_GetComponentsOfRole method will return the number of components that support the given - role and (if the compNames field is non-NULL) the names of those components. The call will fail if - an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the - client should: - * first call this function with the compNames field NULL to determine the number of component names - * second call this function with the compNames field pointing to an array of names allocated - according to the number returned by the first call. - - The core should return from this call within 5 msec. - - @param [in] role - This is generic standard component name consisting only of component class - name and the type within that class (e.g. 'audio_decoder.aac'). - @param [inout] pNumComps - This is used both as input and output. - - If compNames is NULL, the input is ignored and the output specifies how many components support - the given role. - - If compNames is not NULL, on input it bounds the size of the input structure and - on output, it specifies the number of components string names listed within the compNames parameter. - @param [inout] compNames - If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings which accepts - a list of the names of all physical components that implement the specified standard component name. - Each name is NULL terminated. numComps indicates the number of names. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_GetComponentsOfRole ( - OMX_IN OMX_STRING role, - OMX_INOUT OMX_U32 *pNumComps, - OMX_INOUT OMX_U8 **compNames); - -/** The OMX_GetRolesOfComponent method will return the number of roles supported by the given - component and (if the roles field is non-NULL) the names of those roles. The call will fail if - an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the - client should: - * first call this function with the roles field NULL to determine the number of role names - * second call this function with the roles field pointing to an array of names allocated - according to the number returned by the first call. - - The core should return from this call within 5 msec. - - @param [in] compName - This is the name of the component being queried about. - @param [inout] pNumRoles - This is used both as input and output. - - If roles is NULL, the input is ignored and the output specifies how many roles the component supports. - - If compNames is not NULL, on input it bounds the size of the input structure and - on output, it specifies the number of roles string names listed within the roles parameter. - @param [out] roles - If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings - which accepts a list of the names of all standard components roles implemented on the - specified component name. numComps indicates the number of names. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_GetRolesOfComponent ( - OMX_IN OMX_STRING compName, - OMX_INOUT OMX_U32 *pNumRoles, - OMX_OUT OMX_U8 **roles); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ - diff --git a/external/android/include/18/frameworks/native/include/media/openmax/OMX_IVCommon.h b/external/android/include/18/frameworks/native/include/media/openmax/OMX_IVCommon.h deleted file mode 100644 index 85bf00d..0000000 --- a/external/android/include/18/frameworks/native/include/media/openmax/OMX_IVCommon.h +++ /dev/null @@ -1,949 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/** - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** - * @file OMX_IVCommon.h - OpenMax IL version 1.1.2 - * The structures needed by Video and Image components to exchange - * parameters and configuration data with the components. - */ -#ifndef OMX_IVCommon_h -#define OMX_IVCommon_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/** - * Each OMX header must include all required header files to allow the header - * to compile without errors. The includes below are required for this header - * file to compile successfully - */ - -#include - -/** @defgroup iv OpenMAX IL Imaging and Video Domain - * Common structures for OpenMAX IL Imaging and Video domains - * @{ - */ - - -/** - * Enumeration defining possible uncompressed image/video formats. - * - * ENUMS: - * Unused : Placeholder value when format is N/A - * Monochrome : black and white - * 8bitRGB332 : Red 7:5, Green 4:2, Blue 1:0 - * 12bitRGB444 : Red 11:8, Green 7:4, Blue 3:0 - * 16bitARGB4444 : Alpha 15:12, Red 11:8, Green 7:4, Blue 3:0 - * 16bitARGB1555 : Alpha 15, Red 14:10, Green 9:5, Blue 4:0 - * 16bitRGB565 : Red 15:11, Green 10:5, Blue 4:0 - * 16bitBGR565 : Blue 15:11, Green 10:5, Red 4:0 - * 18bitRGB666 : Red 17:12, Green 11:6, Blue 5:0 - * 18bitARGB1665 : Alpha 17, Red 16:11, Green 10:5, Blue 4:0 - * 19bitARGB1666 : Alpha 18, Red 17:12, Green 11:6, Blue 5:0 - * 24bitRGB888 : Red 24:16, Green 15:8, Blue 7:0 - * 24bitBGR888 : Blue 24:16, Green 15:8, Red 7:0 - * 24bitARGB1887 : Alpha 23, Red 22:15, Green 14:7, Blue 6:0 - * 25bitARGB1888 : Alpha 24, Red 23:16, Green 15:8, Blue 7:0 - * 32bitBGRA8888 : Blue 31:24, Green 23:16, Red 15:8, Alpha 7:0 - * 32bitARGB8888 : Alpha 31:24, Red 23:16, Green 15:8, Blue 7:0 - * YUV411Planar : U,Y are subsampled by a factor of 4 horizontally - * YUV411PackedPlanar : packed per payload in planar slices - * YUV420Planar : Three arrays Y,U,V. - * YUV420PackedPlanar : packed per payload in planar slices - * YUV420SemiPlanar : Two arrays, one is all Y, the other is U and V - * YUV422Planar : Three arrays Y,U,V. - * YUV422PackedPlanar : packed per payload in planar slices - * YUV422SemiPlanar : Two arrays, one is all Y, the other is U and V - * YCbYCr : Organized as 16bit YUYV (i.e. YCbYCr) - * YCrYCb : Organized as 16bit YVYU (i.e. YCrYCb) - * CbYCrY : Organized as 16bit UYVY (i.e. CbYCrY) - * CrYCbY : Organized as 16bit VYUY (i.e. CrYCbY) - * YUV444Interleaved : Each pixel contains equal parts YUV - * RawBayer8bit : SMIA camera output format - * RawBayer10bit : SMIA camera output format - * RawBayer8bitcompressed : SMIA camera output format - */ -typedef enum OMX_COLOR_FORMATTYPE { - OMX_COLOR_FormatUnused, - OMX_COLOR_FormatMonochrome, - OMX_COLOR_Format8bitRGB332, - OMX_COLOR_Format12bitRGB444, - OMX_COLOR_Format16bitARGB4444, - OMX_COLOR_Format16bitARGB1555, - OMX_COLOR_Format16bitRGB565, - OMX_COLOR_Format16bitBGR565, - OMX_COLOR_Format18bitRGB666, - OMX_COLOR_Format18bitARGB1665, - OMX_COLOR_Format19bitARGB1666, - OMX_COLOR_Format24bitRGB888, - OMX_COLOR_Format24bitBGR888, - OMX_COLOR_Format24bitARGB1887, - OMX_COLOR_Format25bitARGB1888, - OMX_COLOR_Format32bitBGRA8888, - OMX_COLOR_Format32bitARGB8888, - OMX_COLOR_FormatYUV411Planar, - OMX_COLOR_FormatYUV411PackedPlanar, - OMX_COLOR_FormatYUV420Planar, - OMX_COLOR_FormatYUV420PackedPlanar, - OMX_COLOR_FormatYUV420SemiPlanar, - OMX_COLOR_FormatYUV422Planar, - OMX_COLOR_FormatYUV422PackedPlanar, - OMX_COLOR_FormatYUV422SemiPlanar, - OMX_COLOR_FormatYCbYCr, - OMX_COLOR_FormatYCrYCb, - OMX_COLOR_FormatCbYCrY, - OMX_COLOR_FormatCrYCbY, - OMX_COLOR_FormatYUV444Interleaved, - OMX_COLOR_FormatRawBayer8bit, - OMX_COLOR_FormatRawBayer10bit, - OMX_COLOR_FormatRawBayer8bitcompressed, - OMX_COLOR_FormatL2, - OMX_COLOR_FormatL4, - OMX_COLOR_FormatL8, - OMX_COLOR_FormatL16, - OMX_COLOR_FormatL24, - OMX_COLOR_FormatL32, - OMX_COLOR_FormatYUV420PackedSemiPlanar, - OMX_COLOR_FormatYUV422PackedSemiPlanar, - OMX_COLOR_Format18BitBGR666, - OMX_COLOR_Format24BitARGB6666, - OMX_COLOR_Format24BitABGR6666, - OMX_COLOR_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_COLOR_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - /** - -/** @defgroup imaging OpenMAX IL Imaging Domain - * @ingroup iv - * Structures for OpenMAX IL Imaging domain - * @{ - */ - -/** - * Enumeration used to define the possible image compression coding. - */ -typedef enum OMX_IMAGE_CODINGTYPE { - OMX_IMAGE_CodingUnused, /**< Value when format is N/A */ - OMX_IMAGE_CodingAutoDetect, /**< Auto detection of image format */ - OMX_IMAGE_CodingJPEG, /**< JPEG/JFIF image format */ - OMX_IMAGE_CodingJPEG2K, /**< JPEG 2000 image format */ - OMX_IMAGE_CodingEXIF, /**< EXIF image format */ - OMX_IMAGE_CodingTIFF, /**< TIFF image format */ - OMX_IMAGE_CodingGIF, /**< Graphics image format */ - OMX_IMAGE_CodingPNG, /**< PNG image format */ - OMX_IMAGE_CodingLZW, /**< LZW image format */ - OMX_IMAGE_CodingBMP, /**< Windows Bitmap format */ - OMX_IMAGE_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_IMAGE_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_IMAGE_CodingMax = 0x7FFFFFFF -} OMX_IMAGE_CODINGTYPE; - - -/** - * Data structure used to define an image path. The number of image paths - * for input and output will vary by type of the image component. - * - * Input (aka Source) : Zero Inputs, one Output, - * Splitter : One Input, 2 or more Outputs, - * Processing Element : One Input, one output, - * Mixer : 2 or more inputs, one output, - * Output (aka Sink) : One Input, zero outputs. - * - * The PortDefinition structure is used to define all of the parameters - * necessary for the compliant component to setup an input or an output - * image path. If additional vendor specific data is required, it should - * be transmitted to the component using the CustomCommand function. - * Compliant components will prepopulate this structure with optimal - * values during the OMX_GetParameter() command. - * - * STRUCT MEMBERS: - * cMIMEType : MIME type of data for the port - * pNativeRender : Platform specific reference for a display if a - * sync, otherwise this field is 0 - * nFrameWidth : Width of frame to be used on port if - * uncompressed format is used. Use 0 for - * unknown, don't care or variable - * nFrameHeight : Height of frame to be used on port if - * uncompressed format is used. Use 0 for - * unknown, don't care or variable - * nStride : Number of bytes per span of an image (i.e. - * indicates the number of bytes to get from - * span N to span N+1, where negative stride - * indicates the image is bottom up - * nSliceHeight : Height used when encoding in slices - * bFlagErrorConcealment : Turns on error concealment if it is supported by - * the OMX component - * eCompressionFormat : Compression format used in this instance of - * the component. When OMX_IMAGE_CodingUnused is - * specified, eColorFormat is valid - * eColorFormat : Decompressed format used by this component - * pNativeWindow : Platform specific reference for a window object if a - * display sink , otherwise this field is 0x0. - */ -typedef struct OMX_IMAGE_PORTDEFINITIONTYPE { - OMX_STRING cMIMEType; - OMX_NATIVE_DEVICETYPE pNativeRender; - OMX_U32 nFrameWidth; - OMX_U32 nFrameHeight; - OMX_S32 nStride; - OMX_U32 nSliceHeight; - OMX_BOOL bFlagErrorConcealment; - OMX_IMAGE_CODINGTYPE eCompressionFormat; - OMX_COLOR_FORMATTYPE eColorFormat; - OMX_NATIVE_WINDOWTYPE pNativeWindow; -} OMX_IMAGE_PORTDEFINITIONTYPE; - - -/** - * Port format parameter. This structure is used to enumerate the various - * data input/output format supported by the port. - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Indicates which port to set - * nIndex : Indicates the enumeration index for the format from - * 0x0 to N-1 - * eCompressionFormat : Compression format used in this instance of the - * component. When OMX_IMAGE_CodingUnused is specified, - * eColorFormat is valid - * eColorFormat : Decompressed format used by this component - */ -typedef struct OMX_IMAGE_PARAM_PORTFORMATTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nIndex; - OMX_IMAGE_CODINGTYPE eCompressionFormat; - OMX_COLOR_FORMATTYPE eColorFormat; -} OMX_IMAGE_PARAM_PORTFORMATTYPE; - - -/** - * Flash control type - * - * ENUMS - * Torch : Flash forced constantly on - */ -typedef enum OMX_IMAGE_FLASHCONTROLTYPE { - OMX_IMAGE_FlashControlOn = 0, - OMX_IMAGE_FlashControlOff, - OMX_IMAGE_FlashControlAuto, - OMX_IMAGE_FlashControlRedEyeReduction, - OMX_IMAGE_FlashControlFillin, - OMX_IMAGE_FlashControlTorch, - OMX_IMAGE_FlashControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_IMAGE_FlashControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_IMAGE_FlashControlMax = 0x7FFFFFFF -} OMX_IMAGE_FLASHCONTROLTYPE; - - -/** - * Flash control configuration - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eFlashControl : Flash control type - */ -typedef struct OMX_IMAGE_PARAM_FLASHCONTROLTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_IMAGE_FLASHCONTROLTYPE eFlashControl; -} OMX_IMAGE_PARAM_FLASHCONTROLTYPE; - - -/** - * Focus control type - */ -typedef enum OMX_IMAGE_FOCUSCONTROLTYPE { - OMX_IMAGE_FocusControlOn = 0, - OMX_IMAGE_FocusControlOff, - OMX_IMAGE_FocusControlAuto, - OMX_IMAGE_FocusControlAutoLock, - OMX_IMAGE_FocusControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_IMAGE_FocusControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_IMAGE_FocusControlMax = 0x7FFFFFFF -} OMX_IMAGE_FOCUSCONTROLTYPE; - - -/** - * Focus control configuration - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eFocusControl : Focus control - * nFocusSteps : Focus can take on values from 0 mm to infinity. - * Interest is only in number of steps over this range. - * nFocusStepIndex : Current focus step index - */ -typedef struct OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_IMAGE_FOCUSCONTROLTYPE eFocusControl; - OMX_U32 nFocusSteps; - OMX_U32 nFocusStepIndex; -} OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE; - - -/** - * Q Factor for JPEG compression, which controls the tradeoff between image - * quality and size. Q Factor provides a more simple means of controlling - * JPEG compression quality, without directly programming Quantization - * tables for chroma and luma - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nQFactor : JPEG Q factor value in the range of 1-100. A factor of 1 - * produces the smallest, worst quality images, and a factor - * of 100 produces the largest, best quality images. A - * typical default is 75 for small good quality images - */ -typedef struct OMX_IMAGE_PARAM_QFACTORTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nQFactor; -} OMX_IMAGE_PARAM_QFACTORTYPE; - -/** - * Quantization table type - */ - -typedef enum OMX_IMAGE_QUANTIZATIONTABLETYPE { - OMX_IMAGE_QuantizationTableLuma = 0, - OMX_IMAGE_QuantizationTableChroma, - OMX_IMAGE_QuantizationTableChromaCb, - OMX_IMAGE_QuantizationTableChromaCr, - OMX_IMAGE_QuantizationTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_IMAGE_QuantizationTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_IMAGE_QuantizationTableMax = 0x7FFFFFFF -} OMX_IMAGE_QUANTIZATIONTABLETYPE; - -/** - * JPEG quantization tables are used to determine DCT compression for - * YUV data, as an alternative to specifying Q factor, providing exact - * control of compression - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eQuantizationTable : Quantization table type - * nQuantizationMatrix[64] : JPEG quantization table of coefficients stored - * in increasing columns then by rows of data (i.e. - * row 1, ... row 8). Quantization values are in - * the range 0-255 and stored in linear order - * (i.e. the component will zig-zag the - * quantization table data if required internally) - */ -typedef struct OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_IMAGE_QUANTIZATIONTABLETYPE eQuantizationTable; - OMX_U8 nQuantizationMatrix[64]; -} OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE; - - -/** - * Huffman table type, the same Huffman table is applied for chroma and - * luma component - */ -typedef enum OMX_IMAGE_HUFFMANTABLETYPE { - OMX_IMAGE_HuffmanTableAC = 0, - OMX_IMAGE_HuffmanTableDC, - OMX_IMAGE_HuffmanTableACLuma, - OMX_IMAGE_HuffmanTableACChroma, - OMX_IMAGE_HuffmanTableDCLuma, - OMX_IMAGE_HuffmanTableDCChroma, - OMX_IMAGE_HuffmanTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_IMAGE_HuffmanTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_IMAGE_HuffmanTableMax = 0x7FFFFFFF -} OMX_IMAGE_HUFFMANTABLETYPE; - -/** - * JPEG Huffman table - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eHuffmanTable : Huffman table type - * nNumberOfHuffmanCodeOfLength[16] : 0-16, number of Huffman codes of each - * possible length - * nHuffmanTable[256] : 0-255, the size used for AC and DC - * HuffmanTable are 16 and 162 - */ -typedef struct OMX_IMAGE_PARAM_HUFFMANTTABLETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_IMAGE_HUFFMANTABLETYPE eHuffmanTable; - OMX_U8 nNumberOfHuffmanCodeOfLength[16]; - OMX_U8 nHuffmanTable[256]; -}OMX_IMAGE_PARAM_HUFFMANTTABLETYPE; - -/** @} */ -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ diff --git a/external/android/include/18/frameworks/native/include/media/openmax/OMX_Index.h b/external/android/include/18/frameworks/native/include/media/openmax/OMX_Index.h deleted file mode 100644 index be9a1a6..0000000 --- a/external/android/include/18/frameworks/native/include/media/openmax/OMX_Index.h +++ /dev/null @@ -1,276 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** @file OMX_Index.h - OpenMax IL version 1.1.2 - * The OMX_Index header file contains the definitions for both applications - * and components . - */ - - -#ifndef OMX_Index_h -#define OMX_Index_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/* Each OMX header must include all required header files to allow the - * header to compile without errors. The includes below are required - * for this header file to compile successfully - */ -#include - - -/** The OMX_INDEXTYPE enumeration is used to select a structure when either - * getting or setting parameters and/or configuration data. Each entry in - * this enumeration maps to an OMX specified structure. When the - * OMX_GetParameter, OMX_SetParameter, OMX_GetConfig or OMX_SetConfig methods - * are used, the second parameter will always be an entry from this enumeration - * and the third entry will be the structure shown in the comments for the entry. - * For example, if the application is initializing a cropping function, the - * OMX_SetConfig command would have OMX_IndexConfigCommonInputCrop as the second parameter - * and would send a pointer to an initialized OMX_RECTTYPE structure as the - * third parameter. - * - * The enumeration entries named with the OMX_Config prefix are sent using - * the OMX_SetConfig command and the enumeration entries named with the - * OMX_PARAM_ prefix are sent using the OMX_SetParameter command. - */ -typedef enum OMX_INDEXTYPE { - - OMX_IndexComponentStartUnused = 0x01000000, - OMX_IndexParamPriorityMgmt, /**< reference: OMX_PRIORITYMGMTTYPE */ - OMX_IndexParamAudioInit, /**< reference: OMX_PORT_PARAM_TYPE */ - OMX_IndexParamImageInit, /**< reference: OMX_PORT_PARAM_TYPE */ - OMX_IndexParamVideoInit, /**< reference: OMX_PORT_PARAM_TYPE */ - OMX_IndexParamOtherInit, /**< reference: OMX_PORT_PARAM_TYPE */ - OMX_IndexParamNumAvailableStreams, /**< reference: OMX_PARAM_U32TYPE */ - OMX_IndexParamActiveStream, /**< reference: OMX_PARAM_U32TYPE */ - OMX_IndexParamSuspensionPolicy, /**< reference: OMX_PARAM_SUSPENSIONPOLICYTYPE */ - OMX_IndexParamComponentSuspended, /**< reference: OMX_PARAM_SUSPENSIONTYPE */ - OMX_IndexConfigCapturing, /**< reference: OMX_CONFIG_BOOLEANTYPE */ - OMX_IndexConfigCaptureMode, /**< reference: OMX_CONFIG_CAPTUREMODETYPE */ - OMX_IndexAutoPauseAfterCapture, /**< reference: OMX_CONFIG_BOOLEANTYPE */ - OMX_IndexParamContentURI, /**< reference: OMX_PARAM_CONTENTURITYPE */ - OMX_IndexParamCustomContentPipe, /**< reference: OMX_PARAM_CONTENTPIPETYPE */ - OMX_IndexParamDisableResourceConcealment, /**< reference: OMX_RESOURCECONCEALMENTTYPE */ - OMX_IndexConfigMetadataItemCount, /**< reference: OMX_CONFIG_METADATAITEMCOUNTTYPE */ - OMX_IndexConfigContainerNodeCount, /**< reference: OMX_CONFIG_CONTAINERNODECOUNTTYPE */ - OMX_IndexConfigMetadataItem, /**< reference: OMX_CONFIG_METADATAITEMTYPE */ - OMX_IndexConfigCounterNodeID, /**< reference: OMX_CONFIG_CONTAINERNODEIDTYPE */ - OMX_IndexParamMetadataFilterType, /**< reference: OMX_PARAM_METADATAFILTERTYPE */ - OMX_IndexParamMetadataKeyFilter, /**< reference: OMX_PARAM_METADATAFILTERTYPE */ - OMX_IndexConfigPriorityMgmt, /**< reference: OMX_PRIORITYMGMTTYPE */ - OMX_IndexParamStandardComponentRole, /**< reference: OMX_PARAM_COMPONENTROLETYPE */ - - OMX_IndexPortStartUnused = 0x02000000, - OMX_IndexParamPortDefinition, /**< reference: OMX_PARAM_PORTDEFINITIONTYPE */ - OMX_IndexParamCompBufferSupplier, /**< reference: OMX_PARAM_BUFFERSUPPLIERTYPE */ - OMX_IndexReservedStartUnused = 0x03000000, - - /* Audio parameters and configurations */ - OMX_IndexAudioStartUnused = 0x04000000, - OMX_IndexParamAudioPortFormat, /**< reference: OMX_AUDIO_PARAM_PORTFORMATTYPE */ - OMX_IndexParamAudioPcm, /**< reference: OMX_AUDIO_PARAM_PCMMODETYPE */ - OMX_IndexParamAudioAac, /**< reference: OMX_AUDIO_PARAM_AACPROFILETYPE */ - OMX_IndexParamAudioRa, /**< reference: OMX_AUDIO_PARAM_RATYPE */ - OMX_IndexParamAudioMp3, /**< reference: OMX_AUDIO_PARAM_MP3TYPE */ - OMX_IndexParamAudioAdpcm, /**< reference: OMX_AUDIO_PARAM_ADPCMTYPE */ - OMX_IndexParamAudioG723, /**< reference: OMX_AUDIO_PARAM_G723TYPE */ - OMX_IndexParamAudioG729, /**< reference: OMX_AUDIO_PARAM_G729TYPE */ - OMX_IndexParamAudioAmr, /**< reference: OMX_AUDIO_PARAM_AMRTYPE */ - OMX_IndexParamAudioWma, /**< reference: OMX_AUDIO_PARAM_WMATYPE */ - OMX_IndexParamAudioSbc, /**< reference: OMX_AUDIO_PARAM_SBCTYPE */ - OMX_IndexParamAudioMidi, /**< reference: OMX_AUDIO_PARAM_MIDITYPE */ - OMX_IndexParamAudioGsm_FR, /**< reference: OMX_AUDIO_PARAM_GSMFRTYPE */ - OMX_IndexParamAudioMidiLoadUserSound, /**< reference: OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE */ - OMX_IndexParamAudioG726, /**< reference: OMX_AUDIO_PARAM_G726TYPE */ - OMX_IndexParamAudioGsm_EFR, /**< reference: OMX_AUDIO_PARAM_GSMEFRTYPE */ - OMX_IndexParamAudioGsm_HR, /**< reference: OMX_AUDIO_PARAM_GSMHRTYPE */ - OMX_IndexParamAudioPdc_FR, /**< reference: OMX_AUDIO_PARAM_PDCFRTYPE */ - OMX_IndexParamAudioPdc_EFR, /**< reference: OMX_AUDIO_PARAM_PDCEFRTYPE */ - OMX_IndexParamAudioPdc_HR, /**< reference: OMX_AUDIO_PARAM_PDCHRTYPE */ - OMX_IndexParamAudioTdma_FR, /**< reference: OMX_AUDIO_PARAM_TDMAFRTYPE */ - OMX_IndexParamAudioTdma_EFR, /**< reference: OMX_AUDIO_PARAM_TDMAEFRTYPE */ - OMX_IndexParamAudioQcelp8, /**< reference: OMX_AUDIO_PARAM_QCELP8TYPE */ - OMX_IndexParamAudioQcelp13, /**< reference: OMX_AUDIO_PARAM_QCELP13TYPE */ - OMX_IndexParamAudioEvrc, /**< reference: OMX_AUDIO_PARAM_EVRCTYPE */ - OMX_IndexParamAudioSmv, /**< reference: OMX_AUDIO_PARAM_SMVTYPE */ - OMX_IndexParamAudioVorbis, /**< reference: OMX_AUDIO_PARAM_VORBISTYPE */ - OMX_IndexParamAudioFlac, /**< reference: OMX_AUDIO_PARAM_FLACTYPE */ - - OMX_IndexConfigAudioMidiImmediateEvent, /**< reference: OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE */ - OMX_IndexConfigAudioMidiControl, /**< reference: OMX_AUDIO_CONFIG_MIDICONTROLTYPE */ - OMX_IndexConfigAudioMidiSoundBankProgram, /**< reference: OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE */ - OMX_IndexConfigAudioMidiStatus, /**< reference: OMX_AUDIO_CONFIG_MIDISTATUSTYPE */ - OMX_IndexConfigAudioMidiMetaEvent, /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE */ - OMX_IndexConfigAudioMidiMetaEventData, /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE */ - OMX_IndexConfigAudioVolume, /**< reference: OMX_AUDIO_CONFIG_VOLUMETYPE */ - OMX_IndexConfigAudioBalance, /**< reference: OMX_AUDIO_CONFIG_BALANCETYPE */ - OMX_IndexConfigAudioChannelMute, /**< reference: OMX_AUDIO_CONFIG_CHANNELMUTETYPE */ - OMX_IndexConfigAudioMute, /**< reference: OMX_AUDIO_CONFIG_MUTETYPE */ - OMX_IndexConfigAudioLoudness, /**< reference: OMX_AUDIO_CONFIG_LOUDNESSTYPE */ - OMX_IndexConfigAudioEchoCancelation, /**< reference: OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE */ - OMX_IndexConfigAudioNoiseReduction, /**< reference: OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE */ - OMX_IndexConfigAudioBass, /**< reference: OMX_AUDIO_CONFIG_BASSTYPE */ - OMX_IndexConfigAudioTreble, /**< reference: OMX_AUDIO_CONFIG_TREBLETYPE */ - OMX_IndexConfigAudioStereoWidening, /**< reference: OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE */ - OMX_IndexConfigAudioChorus, /**< reference: OMX_AUDIO_CONFIG_CHORUSTYPE */ - OMX_IndexConfigAudioEqualizer, /**< reference: OMX_AUDIO_CONFIG_EQUALIZERTYPE */ - OMX_IndexConfigAudioReverberation, /**< reference: OMX_AUDIO_CONFIG_REVERBERATIONTYPE */ - OMX_IndexConfigAudioChannelVolume, /**< reference: OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE */ - - /* Image specific parameters and configurations */ - OMX_IndexImageStartUnused = 0x05000000, - OMX_IndexParamImagePortFormat, /**< reference: OMX_IMAGE_PARAM_PORTFORMATTYPE */ - OMX_IndexParamFlashControl, /**< reference: OMX_IMAGE_PARAM_FLASHCONTROLTYPE */ - OMX_IndexConfigFocusControl, /**< reference: OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE */ - OMX_IndexParamQFactor, /**< reference: OMX_IMAGE_PARAM_QFACTORTYPE */ - OMX_IndexParamQuantizationTable, /**< reference: OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE */ - OMX_IndexParamHuffmanTable, /**< reference: OMX_IMAGE_PARAM_HUFFMANTTABLETYPE */ - OMX_IndexConfigFlashControl, /**< reference: OMX_IMAGE_PARAM_FLASHCONTROLTYPE */ - - /* Video specific parameters and configurations */ - OMX_IndexVideoStartUnused = 0x06000000, - OMX_IndexParamVideoPortFormat, /**< reference: OMX_VIDEO_PARAM_PORTFORMATTYPE */ - OMX_IndexParamVideoQuantization, /**< reference: OMX_VIDEO_PARAM_QUANTIZATIONTYPE */ - OMX_IndexParamVideoFastUpdate, /**< reference: OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE */ - OMX_IndexParamVideoBitrate, /**< reference: OMX_VIDEO_PARAM_BITRATETYPE */ - OMX_IndexParamVideoMotionVector, /**< reference: OMX_VIDEO_PARAM_MOTIONVECTORTYPE */ - OMX_IndexParamVideoIntraRefresh, /**< reference: OMX_VIDEO_PARAM_INTRAREFRESHTYPE */ - OMX_IndexParamVideoErrorCorrection, /**< reference: OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE */ - OMX_IndexParamVideoVBSMC, /**< reference: OMX_VIDEO_PARAM_VBSMCTYPE */ - OMX_IndexParamVideoMpeg2, /**< reference: OMX_VIDEO_PARAM_MPEG2TYPE */ - OMX_IndexParamVideoMpeg4, /**< reference: OMX_VIDEO_PARAM_MPEG4TYPE */ - OMX_IndexParamVideoWmv, /**< reference: OMX_VIDEO_PARAM_WMVTYPE */ - OMX_IndexParamVideoRv, /**< reference: OMX_VIDEO_PARAM_RVTYPE */ - OMX_IndexParamVideoAvc, /**< reference: OMX_VIDEO_PARAM_AVCTYPE */ - OMX_IndexParamVideoH263, /**< reference: OMX_VIDEO_PARAM_H263TYPE */ - OMX_IndexParamVideoProfileLevelQuerySupported, /**< reference: OMX_VIDEO_PARAM_PROFILELEVELTYPE */ - OMX_IndexParamVideoProfileLevelCurrent, /**< reference: OMX_VIDEO_PARAM_PROFILELEVELTYPE */ - OMX_IndexConfigVideoBitrate, /**< reference: OMX_VIDEO_CONFIG_BITRATETYPE */ - OMX_IndexConfigVideoFramerate, /**< reference: OMX_CONFIG_FRAMERATETYPE */ - OMX_IndexConfigVideoIntraVOPRefresh, /**< reference: OMX_CONFIG_INTRAREFRESHVOPTYPE */ - OMX_IndexConfigVideoIntraMBRefresh, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */ - OMX_IndexConfigVideoMBErrorReporting, /**< reference: OMX_CONFIG_MBERRORREPORTINGTYPE */ - OMX_IndexParamVideoMacroblocksPerFrame, /**< reference: OMX_PARAM_MACROBLOCKSTYPE */ - OMX_IndexConfigVideoMacroBlockErrorMap, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */ - OMX_IndexParamVideoSliceFMO, /**< reference: OMX_VIDEO_PARAM_AVCSLICEFMO */ - OMX_IndexConfigVideoAVCIntraPeriod, /**< reference: OMX_VIDEO_CONFIG_AVCINTRAPERIOD */ - OMX_IndexConfigVideoNalSize, /**< reference: OMX_VIDEO_CONFIG_NALSIZE */ - - /* Image & Video common Configurations */ - OMX_IndexCommonStartUnused = 0x07000000, - OMX_IndexParamCommonDeblocking, /**< reference: OMX_PARAM_DEBLOCKINGTYPE */ - OMX_IndexParamCommonSensorMode, /**< reference: OMX_PARAM_SENSORMODETYPE */ - OMX_IndexParamCommonInterleave, /**< reference: OMX_PARAM_INTERLEAVETYPE */ - OMX_IndexConfigCommonColorFormatConversion, /**< reference: OMX_CONFIG_COLORCONVERSIONTYPE */ - OMX_IndexConfigCommonScale, /**< reference: OMX_CONFIG_SCALEFACTORTYPE */ - OMX_IndexConfigCommonImageFilter, /**< reference: OMX_CONFIG_IMAGEFILTERTYPE */ - OMX_IndexConfigCommonColorEnhancement, /**< reference: OMX_CONFIG_COLORENHANCEMENTTYPE */ - OMX_IndexConfigCommonColorKey, /**< reference: OMX_CONFIG_COLORKEYTYPE */ - OMX_IndexConfigCommonColorBlend, /**< reference: OMX_CONFIG_COLORBLENDTYPE */ - OMX_IndexConfigCommonFrameStabilisation,/**< reference: OMX_CONFIG_FRAMESTABTYPE */ - OMX_IndexConfigCommonRotate, /**< reference: OMX_CONFIG_ROTATIONTYPE */ - OMX_IndexConfigCommonMirror, /**< reference: OMX_CONFIG_MIRRORTYPE */ - OMX_IndexConfigCommonOutputPosition, /**< reference: OMX_CONFIG_POINTTYPE */ - OMX_IndexConfigCommonInputCrop, /**< reference: OMX_CONFIG_RECTTYPE */ - OMX_IndexConfigCommonOutputCrop, /**< reference: OMX_CONFIG_RECTTYPE */ - OMX_IndexConfigCommonDigitalZoom, /**< reference: OMX_CONFIG_SCALEFACTORTYPE */ - OMX_IndexConfigCommonOpticalZoom, /**< reference: OMX_CONFIG_SCALEFACTORTYPE*/ - OMX_IndexConfigCommonWhiteBalance, /**< reference: OMX_CONFIG_WHITEBALCONTROLTYPE */ - OMX_IndexConfigCommonExposure, /**< reference: OMX_CONFIG_EXPOSURECONTROLTYPE */ - OMX_IndexConfigCommonContrast, /**< reference: OMX_CONFIG_CONTRASTTYPE */ - OMX_IndexConfigCommonBrightness, /**< reference: OMX_CONFIG_BRIGHTNESSTYPE */ - OMX_IndexConfigCommonBacklight, /**< reference: OMX_CONFIG_BACKLIGHTTYPE */ - OMX_IndexConfigCommonGamma, /**< reference: OMX_CONFIG_GAMMATYPE */ - OMX_IndexConfigCommonSaturation, /**< reference: OMX_CONFIG_SATURATIONTYPE */ - OMX_IndexConfigCommonLightness, /**< reference: OMX_CONFIG_LIGHTNESSTYPE */ - OMX_IndexConfigCommonExclusionRect, /**< reference: OMX_CONFIG_RECTTYPE */ - OMX_IndexConfigCommonDithering, /**< reference: OMX_CONFIG_DITHERTYPE */ - OMX_IndexConfigCommonPlaneBlend, /**< reference: OMX_CONFIG_PLANEBLENDTYPE */ - OMX_IndexConfigCommonExposureValue, /**< reference: OMX_CONFIG_EXPOSUREVALUETYPE */ - OMX_IndexConfigCommonOutputSize, /**< reference: OMX_FRAMESIZETYPE */ - OMX_IndexParamCommonExtraQuantData, /**< reference: OMX_OTHER_EXTRADATATYPE */ - OMX_IndexConfigCommonFocusRegion, /**< reference: OMX_CONFIG_FOCUSREGIONTYPE */ - OMX_IndexConfigCommonFocusStatus, /**< reference: OMX_PARAM_FOCUSSTATUSTYPE */ - OMX_IndexConfigCommonTransitionEffect, /**< reference: OMX_CONFIG_TRANSITIONEFFECTTYPE */ - - /* Reserved Configuration range */ - OMX_IndexOtherStartUnused = 0x08000000, - OMX_IndexParamOtherPortFormat, /**< reference: OMX_OTHER_PARAM_PORTFORMATTYPE */ - OMX_IndexConfigOtherPower, /**< reference: OMX_OTHER_CONFIG_POWERTYPE */ - OMX_IndexConfigOtherStats, /**< reference: OMX_OTHER_CONFIG_STATSTYPE */ - - - /* Reserved Time range */ - OMX_IndexTimeStartUnused = 0x09000000, - OMX_IndexConfigTimeScale, /**< reference: OMX_TIME_CONFIG_SCALETYPE */ - OMX_IndexConfigTimeClockState, /**< reference: OMX_TIME_CONFIG_CLOCKSTATETYPE */ - OMX_IndexConfigTimeActiveRefClock, /**< reference: OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE */ - OMX_IndexConfigTimeCurrentMediaTime, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only) */ - OMX_IndexConfigTimeCurrentWallTime, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only) */ - OMX_IndexConfigTimeCurrentAudioReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */ - OMX_IndexConfigTimeCurrentVideoReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */ - OMX_IndexConfigTimeMediaTimeRequest, /**< reference: OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE (write only) */ - OMX_IndexConfigTimeClientStartTime, /** - - -/** Khronos standard extension indices. - -This enum lists the current Khronos extension indices to OpenMAX IL. -*/ -typedef enum OMX_INDEXEXTTYPE { - - /* Component parameters and configurations */ - OMX_IndexExtComponentStartUnused = OMX_IndexKhronosExtensions + 0x00100000, - OMX_IndexConfigCallbackRequest, /**< reference: OMX_CONFIG_CALLBACKREQUESTTYPE */ - OMX_IndexConfigCommitMode, /**< reference: OMX_CONFIG_COMMITMODETYPE */ - OMX_IndexConfigCommit, /**< reference: OMX_CONFIG_COMMITTYPE */ - - /* Port parameters and configurations */ - OMX_IndexExtPortStartUnused = OMX_IndexKhronosExtensions + 0x00200000, - - /* Audio parameters and configurations */ - OMX_IndexExtAudioStartUnused = OMX_IndexKhronosExtensions + 0x00400000, - - /* Image parameters and configurations */ - OMX_IndexExtImageStartUnused = OMX_IndexKhronosExtensions + 0x00500000, - - /* Video parameters and configurations */ - OMX_IndexExtVideoStartUnused = OMX_IndexKhronosExtensions + 0x00600000, - OMX_IndexParamNalStreamFormatSupported, /**< reference: OMX_NALSTREAMFORMATTYPE */ - OMX_IndexParamNalStreamFormat, /**< reference: OMX_NALSTREAMFORMATTYPE */ - OMX_IndexParamNalStreamFormatSelect, /**< reference: OMX_NALSTREAMFORMATTYPE */ - OMX_IndexParamVideoVp8, /**< reference: OMX_VIDEO_PARAM_VP8TYPE */ - OMX_IndexConfigVideoVp8ReferenceFrame, /**< reference: OMX_VIDEO_VP8REFERENCEFRAMETYPE */ - OMX_IndexConfigVideoVp8ReferenceFrameType, /**< reference: OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE */ - - /* Image & Video common configurations */ - OMX_IndexExtCommonStartUnused = OMX_IndexKhronosExtensions + 0x00700000, - - /* Other configurations */ - OMX_IndexExtOtherStartUnused = OMX_IndexKhronosExtensions + 0x00800000, - - /* Time configurations */ - OMX_IndexExtTimeStartUnused = OMX_IndexKhronosExtensions + 0x00900000, - - OMX_IndexExtMax = 0x7FFFFFFF -} OMX_INDEXEXTTYPE; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* OMX_IndexExt_h */ -/* File EOF */ diff --git a/external/android/include/18/frameworks/native/include/media/openmax/OMX_Other.h b/external/android/include/18/frameworks/native/include/media/openmax/OMX_Other.h deleted file mode 100644 index efbce83..0000000 --- a/external/android/include/18/frameworks/native/include/media/openmax/OMX_Other.h +++ /dev/null @@ -1,354 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** @file OMX_Other.h - OpenMax IL version 1.1.2 - * The structures needed by Other components to exchange - * parameters and configuration data with the components. - */ - -#ifndef OMX_Other_h -#define OMX_Other_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/* Each OMX header must include all required header files to allow the - * header to compile without errors. The includes below are required - * for this header file to compile successfully - */ - -#include - - -/** - * Enumeration of possible data types which match to multiple domains or no - * domain at all. For types which are vendor specific, a value above - * OMX_OTHER_VENDORTSTART should be used. - */ -typedef enum OMX_OTHER_FORMATTYPE { - OMX_OTHER_FormatTime = 0, /**< Transmission of various timestamps, elapsed time, - time deltas, etc */ - OMX_OTHER_FormatPower, /**< Perhaps used for enabling/disabling power - management, setting clocks? */ - OMX_OTHER_FormatStats, /**< Could be things such as frame rate, frames - dropped, etc */ - OMX_OTHER_FormatBinary, /**< Arbitrary binary data */ - OMX_OTHER_FormatVendorReserved = 1000, /**< Starting value for vendor specific - formats */ - - OMX_OTHER_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_OTHER_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_OTHER_FormatMax = 0x7FFFFFFF -} OMX_OTHER_FORMATTYPE; - -/** - * Enumeration of seek modes. - */ -typedef enum OMX_TIME_SEEKMODETYPE { - OMX_TIME_SeekModeFast = 0, /**< Prefer seeking to an approximation - * of the requested seek position over - * the actual seek position if it - * results in a faster seek. */ - OMX_TIME_SeekModeAccurate, /**< Prefer seeking to the actual seek - * position over an approximation - * of the requested seek position even - * if it results in a slower seek. */ - OMX_TIME_SeekModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_TIME_SeekModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_TIME_SeekModeMax = 0x7FFFFFFF -} OMX_TIME_SEEKMODETYPE; - -/* Structure representing the seekmode of the component */ -typedef struct OMX_TIME_CONFIG_SEEKMODETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_TIME_SEEKMODETYPE eType; /**< The seek mode */ -} OMX_TIME_CONFIG_SEEKMODETYPE; - -/** Structure representing a time stamp used with the following configs - * on the Clock Component (CC): - * - * OMX_IndexConfigTimeCurrentWallTime: query of the CC’s current wall - * time - * OMX_IndexConfigTimeCurrentMediaTime: query of the CC’s current media - * time - * OMX_IndexConfigTimeCurrentAudioReference and - * OMX_IndexConfigTimeCurrentVideoReference: audio/video reference - * clock sending SC its reference time - * OMX_IndexConfigTimeClientStartTime: a Clock Component client sends - * this structure to the Clock Component via a SetConfig on its - * client port when it receives a buffer with - * OMX_BUFFERFLAG_STARTTIME set. It must use the timestamp - * specified by that buffer for nStartTimestamp. - * - * It’s also used with the following config on components in general: - * - * OMX_IndexConfigTimePosition: IL client querying component position - * (GetConfig) or commanding a component to seek to the given location - * (SetConfig) - */ -typedef struct OMX_TIME_CONFIG_TIMESTAMPTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version - * information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_TICKS nTimestamp; /**< timestamp .*/ -} OMX_TIME_CONFIG_TIMESTAMPTYPE; - -/** Enumeration of possible reference clocks to the media time. */ -typedef enum OMX_TIME_UPDATETYPE { - OMX_TIME_UpdateRequestFulfillment, /**< Update is the fulfillment of a media time request. */ - OMX_TIME_UpdateScaleChanged, /**< Update was generated because the scale chagned. */ - OMX_TIME_UpdateClockStateChanged, /**< Update was generated because the clock state changed. */ - OMX_TIME_UpdateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_TIME_UpdateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_TIME_UpdateMax = 0x7FFFFFFF -} OMX_TIME_UPDATETYPE; - -/** Enumeration of possible reference clocks to the media time. */ -typedef enum OMX_TIME_REFCLOCKTYPE { - OMX_TIME_RefClockNone, /**< Use no references. */ - OMX_TIME_RefClockAudio, /**< Use references sent through OMX_IndexConfigTimeCurrentAudioReference */ - OMX_TIME_RefClockVideo, /**< Use references sent through OMX_IndexConfigTimeCurrentVideoReference */ - OMX_TIME_RefClockKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_TIME_RefClockVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_TIME_RefClockMax = 0x7FFFFFFF -} OMX_TIME_REFCLOCKTYPE; - -/** Enumeration of clock states. */ -typedef enum OMX_TIME_CLOCKSTATE { - OMX_TIME_ClockStateRunning, /**< Clock running. */ - OMX_TIME_ClockStateWaitingForStartTime, /**< Clock waiting until the - * prescribed clients emit their - * start time. */ - OMX_TIME_ClockStateStopped, /**< Clock stopped. */ - OMX_TIME_ClockStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_TIME_ClockStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_TIME_ClockStateMax = 0x7FFFFFFF -} OMX_TIME_CLOCKSTATE; - -/** Structure representing a media time request to the clock component. - * - * A client component sends this structure to the Clock Component via a SetConfig - * on its client port to specify a media timestamp the Clock Component - * should emit. The Clock Component should fulfill the request by sending a - * OMX_TIME_MEDIATIMETYPE when its media clock matches the requested - * timestamp. - * - * The client may require a media time request be fulfilled slightly - * earlier than the media time specified. In this case the client specifies - * an offset which is equal to the difference between wall time corresponding - * to the requested media time and the wall time when it will be - * fulfilled. - * - * A client component may uses these requests and the OMX_TIME_MEDIATIMETYPE to - * time events according to timestamps. If a client must perform an operation O at - * a time T (e.g. deliver a video frame at its corresponding timestamp), it makes a - * media time request at T (perhaps specifying an offset to ensure the request fulfillment - * is a little early). When the clock component passes the resulting OMX_TIME_MEDIATIMETYPE - * structure back to the client component, the client may perform operation O (perhaps having - * to wait a slight amount more time itself as specified by the return values). - */ - -typedef struct OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_PTR pClientPrivate; /**< Client private data to disabiguate this media time - * from others (e.g. the number of the frame to deliver). - * Duplicated in the media time structure that fulfills - * this request. A value of zero is reserved for time scale - * updates. */ - OMX_TICKS nMediaTimestamp; /**< Media timestamp requested.*/ - OMX_TICKS nOffset; /**< Amount of wall clock time by which this - * request should be fulfilled early */ -} OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE; - -/**< Structure sent from the clock component client either when fulfilling - * a media time request or when the time scale has changed. - * - * In the former case the Clock Component fills this structure and times its emission - * to a client component (via the client port) according to the corresponding media - * time request sent by the client. The Clock Component should time the emission to occur - * when the requested timestamp matches the Clock Component's media time but also the - * prescribed offset early. - * - * Upon scale changes the clock component clears the nClientPrivate data, sends the current - * media time and sets the nScale to the new scale via the client port. It emits a - * OMX_TIME_MEDIATIMETYPE to all clients independent of any requests. This allows clients to - * alter processing to accomodate scaling. For instance a video component might skip inter-frames - * in the case of extreme fastforward. Likewise an audio component might add or remove samples - * from an audio frame to scale audio data. - * - * It is expected that some clock components may not be able to fulfill requests - * at exactly the prescribed time. This is acceptable so long as the request is - * fulfilled at least as early as described and not later. This structure provides - * fields the client may use to wait for the remaining time. - * - * The client may use either the nOffset or nWallTimeAtMedia fields to determine the - * wall time until the nMediaTimestamp actually occurs. In the latter case the - * client can get a more accurate value for offset by getting the current wall - * from the cloc component and subtracting it from nWallTimeAtMedia. - */ - -typedef struct OMX_TIME_MEDIATIMETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nClientPrivate; /**< Client private data to disabiguate this media time - * from others. Copied from the media time request. - * A value of zero is reserved for time scale updates. */ - OMX_TIME_UPDATETYPE eUpdateType; /**< Reason for the update */ - OMX_TICKS nMediaTimestamp; /**< Media time requested. If no media time was - * requested then this is the current media time. */ - OMX_TICKS nOffset; /**< Amount of wall clock time by which this - * request was actually fulfilled early */ - - OMX_TICKS nWallTimeAtMediaTime; /**< Wall time corresponding to nMediaTimeStamp. - * A client may compare this value to current - * media time obtained from the Clock Component to determine - * the wall time until the media timestamp is really - * current. */ - OMX_S32 xScale; /**< Current media time scale in Q16 format. */ - OMX_TIME_CLOCKSTATE eState; /* Seeking Change. Added 7/12.*/ - /**< State of the media time. */ -} OMX_TIME_MEDIATIMETYPE; - -/** Structure representing the current media time scale factor. Applicable only to clock - * component, other components see scale changes via OMX_TIME_MEDIATIMETYPE buffers sent via - * the clock component client ports. Upon recieving this config the clock component changes - * the rate by which the media time increases or decreases effectively implementing trick modes. - */ -typedef struct OMX_TIME_CONFIG_SCALETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_S32 xScale; /**< This is a value in Q16 format which is used for - * scaling the media time */ -} OMX_TIME_CONFIG_SCALETYPE; - -/** Bits used to identify a clock port. Used in OMX_TIME_CONFIG_CLOCKSTATETYPE’s nWaitMask field */ -#define OMX_CLOCKPORT0 0x00000001 -#define OMX_CLOCKPORT1 0x00000002 -#define OMX_CLOCKPORT2 0x00000004 -#define OMX_CLOCKPORT3 0x00000008 -#define OMX_CLOCKPORT4 0x00000010 -#define OMX_CLOCKPORT5 0x00000020 -#define OMX_CLOCKPORT6 0x00000040 -#define OMX_CLOCKPORT7 0x00000080 - -/** Structure representing the current mode of the media clock. - * IL Client uses this config to change or query the mode of the - * media clock of the clock component. Applicable only to clock - * component. - * - * On a SetConfig if eState is OMX_TIME_ClockStateRunning media time - * starts immediately at the prescribed start time. If - * OMX_TIME_ClockStateWaitingForStartTime the Clock Component ignores - * the given nStartTime and waits for all clients specified in the - * nWaitMask to send starttimes (via - * OMX_IndexConfigTimeClientStartTime). The Clock Component then starts - * the media clock using the earliest start time supplied. */ -typedef struct OMX_TIME_CONFIG_CLOCKSTATETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version - * information */ - OMX_TIME_CLOCKSTATE eState; /**< State of the media time. */ - OMX_TICKS nStartTime; /**< Start time of the media time. */ - OMX_TICKS nOffset; /**< Time to offset the media time by - * (e.g. preroll). Media time will be - * reported to be nOffset ticks earlier. - */ - OMX_U32 nWaitMask; /**< Mask of OMX_CLOCKPORT values. */ -} OMX_TIME_CONFIG_CLOCKSTATETYPE; - -/** Structure representing the reference clock currently being used to - * compute media time. IL client uses this config to change or query the - * clock component's active reference clock */ -typedef struct OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_TIME_REFCLOCKTYPE eClock; /**< Reference clock used to compute media time */ -} OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE; - -/** Descriptor for setting specifics of power type. - * Note: this structure is listed for backwards compatibility. */ -typedef struct OMX_OTHER_CONFIG_POWERTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_BOOL bEnablePM; /**< Flag to enable Power Management */ -} OMX_OTHER_CONFIG_POWERTYPE; - - -/** Descriptor for setting specifics of stats type. - * Note: this structure is listed for backwards compatibility. */ -typedef struct OMX_OTHER_CONFIG_STATSTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - /* what goes here */ -} OMX_OTHER_CONFIG_STATSTYPE; - - -/** - * The PortDefinition structure is used to define all of the parameters - * necessary for the compliant component to setup an input or an output other - * path. - */ -typedef struct OMX_OTHER_PORTDEFINITIONTYPE { - OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */ -} OMX_OTHER_PORTDEFINITIONTYPE; - -/** Port format parameter. This structure is used to enumerate - * the various data input/output format supported by the port. - */ -typedef struct OMX_OTHER_PARAM_PORTFORMATTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Indicates which port to set */ - OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */ - OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */ -} OMX_OTHER_PARAM_PORTFORMATTYPE; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ diff --git a/external/android/include/18/frameworks/native/include/media/openmax/OMX_Types.h b/external/android/include/18/frameworks/native/include/media/openmax/OMX_Types.h deleted file mode 100644 index 03fd4bc..0000000 --- a/external/android/include/18/frameworks/native/include/media/openmax/OMX_Types.h +++ /dev/null @@ -1,365 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** OMX_Types.h - OpenMax IL version 1.1.2 - * The OMX_Types header file contains the primitive type definitions used by - * the core, the application and the component. This file may need to be - * modified to be used on systems that do not have "char" set to 8 bits, - * "short" set to 16 bits and "long" set to 32 bits. - */ - -#ifndef OMX_Types_h -#define OMX_Types_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/** The OMX_API and OMX_APIENTRY are platform specific definitions used - * to declare OMX function prototypes. They are modified to meet the - * requirements for a particular platform */ -#ifdef __SYMBIAN32__ -# ifdef __OMX_EXPORTS -# define OMX_API __declspec(dllexport) -# else -# ifdef _WIN32 -# define OMX_API __declspec(dllexport) -# else -# define OMX_API __declspec(dllimport) -# endif -# endif -#else -# ifdef _WIN32 -# ifdef __OMX_EXPORTS -# define OMX_API __declspec(dllexport) -# else -//# define OMX_API __declspec(dllimport) -#define OMX_API -# endif -# else -# ifdef __OMX_EXPORTS -# define OMX_API -# else -# define OMX_API extern -# endif -# endif -#endif - -#ifndef OMX_APIENTRY -#define OMX_APIENTRY -#endif - -/** OMX_IN is used to identify inputs to an OMX function. This designation - will also be used in the case of a pointer that points to a parameter - that is used as an output. */ -#ifndef OMX_IN -#define OMX_IN -#endif - -/** OMX_OUT is used to identify outputs from an OMX function. This - designation will also be used in the case of a pointer that points - to a parameter that is used as an input. */ -#ifndef OMX_OUT -#define OMX_OUT -#endif - - -/** OMX_INOUT is used to identify parameters that may be either inputs or - outputs from an OMX function at the same time. This designation will - also be used in the case of a pointer that points to a parameter that - is used both as an input and an output. */ -#ifndef OMX_INOUT -#define OMX_INOUT -#endif - -/** OMX_ALL is used to as a wildcard to select all entities of the same type - * when specifying the index, or referring to a object by an index. (i.e. - * use OMX_ALL to indicate all N channels). When used as a port index - * for a config or parameter this OMX_ALL denotes that the config or - * parameter applies to the entire component not just one port. */ -#define OMX_ALL 0xFFFFFFFF - -/** In the following we define groups that help building doxygen documentation */ - -/** @defgroup core OpenMAX IL core - * Functions and structure related to the OMX IL core - */ - - /** @defgroup comp OpenMAX IL component - * Functions and structure related to the OMX IL component - */ - -/** @defgroup rpm Resource and Policy Management - * Structures for resource and policy management of components - */ - -/** @defgroup buf Buffer Management - * Buffer handling functions and structures - */ - -/** @defgroup tun Tunneling - * @ingroup core comp - * Structures and functions to manage tunnels among component ports - */ - -/** @defgroup cp Content Pipes - * @ingroup core - */ - - /** @defgroup metadata Metadata handling - * - */ - -/** OMX_U8 is an 8 bit unsigned quantity that is byte aligned */ -typedef unsigned char OMX_U8; - -/** OMX_S8 is an 8 bit signed quantity that is byte aligned */ -typedef signed char OMX_S8; - -/** OMX_U16 is a 16 bit unsigned quantity that is 16 bit word aligned */ -typedef unsigned short OMX_U16; - -/** OMX_S16 is a 16 bit signed quantity that is 16 bit word aligned */ -typedef signed short OMX_S16; - -/** OMX_U32 is a 32 bit unsigned quantity that is 32 bit word aligned */ -typedef unsigned long OMX_U32; - -/** OMX_S32 is a 32 bit signed quantity that is 32 bit word aligned */ -typedef signed long OMX_S32; - - -/* Users with compilers that cannot accept the "long long" designation should - define the OMX_SKIP64BIT macro. It should be noted that this may cause - some components to fail to compile if the component was written to require - 64 bit integral types. However, these components would NOT compile anyway - since the compiler does not support the way the component was written. -*/ -#ifndef OMX_SKIP64BIT -#ifdef __SYMBIAN32__ -/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */ -typedef unsigned long long OMX_U64; - -/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */ -typedef signed long long OMX_S64; - -#elif defined(WIN32) - -/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */ -typedef unsigned __int64 OMX_U64; - -/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */ -typedef signed __int64 OMX_S64; - -#else /* WIN32 */ - -/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */ -typedef unsigned long long OMX_U64; - -/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */ -typedef signed long long OMX_S64; - -#endif /* WIN32 */ -#endif - - -/** The OMX_BOOL type is intended to be used to represent a true or a false - value when passing parameters to and from the OMX core and components. The - OMX_BOOL is a 32 bit quantity and is aligned on a 32 bit word boundary. - */ -typedef enum OMX_BOOL { - OMX_FALSE = 0, - OMX_TRUE = !OMX_FALSE, - OMX_BOOL_MAX = 0x7FFFFFFF -} OMX_BOOL; - -/** The OMX_PTR type is intended to be used to pass pointers between the OMX - applications and the OMX Core and components. This is a 32 bit pointer and - is aligned on a 32 bit boundary. - */ -typedef void* OMX_PTR; - -/** The OMX_STRING type is intended to be used to pass "C" type strings between - the application and the core and component. The OMX_STRING type is a 32 - bit pointer to a zero terminated string. The pointer is word aligned and - the string is byte aligned. - */ -typedef char* OMX_STRING; - -/** The OMX_BYTE type is intended to be used to pass arrays of bytes such as - buffers between the application and the component and core. The OMX_BYTE - type is a 32 bit pointer to a zero terminated string. The pointer is word - aligned and the string is byte aligned. - */ -typedef unsigned char* OMX_BYTE; - -/** OMX_UUIDTYPE is a very long unique identifier to uniquely identify - at runtime. This identifier should be generated by a component in a way - that guarantees that every instance of the identifier running on the system - is unique. */ -typedef unsigned char OMX_UUIDTYPE[128]; - -/** The OMX_DIRTYPE enumeration is used to indicate if a port is an input or - an output port. This enumeration is common across all component types. - */ -typedef enum OMX_DIRTYPE -{ - OMX_DirInput, /**< Port is an input port */ - OMX_DirOutput, /**< Port is an output port */ - OMX_DirMax = 0x7FFFFFFF -} OMX_DIRTYPE; - -/** The OMX_ENDIANTYPE enumeration is used to indicate the bit ordering - for numerical data (i.e. big endian, or little endian). - */ -typedef enum OMX_ENDIANTYPE -{ - OMX_EndianBig, /**< big endian */ - OMX_EndianLittle, /**< little endian */ - OMX_EndianMax = 0x7FFFFFFF -} OMX_ENDIANTYPE; - - -/** The OMX_NUMERICALDATATYPE enumeration is used to indicate if data - is signed or unsigned - */ -typedef enum OMX_NUMERICALDATATYPE -{ - OMX_NumericalDataSigned, /**< signed data */ - OMX_NumericalDataUnsigned, /**< unsigned data */ - OMX_NumercialDataMax = 0x7FFFFFFF -} OMX_NUMERICALDATATYPE; - - -/** Unsigned bounded value type */ -typedef struct OMX_BU32 { - OMX_U32 nValue; /**< actual value */ - OMX_U32 nMin; /**< minimum for value (i.e. nValue >= nMin) */ - OMX_U32 nMax; /**< maximum for value (i.e. nValue <= nMax) */ -} OMX_BU32; - - -/** Signed bounded value type */ -typedef struct OMX_BS32 { - OMX_S32 nValue; /**< actual value */ - OMX_S32 nMin; /**< minimum for value (i.e. nValue >= nMin) */ - OMX_S32 nMax; /**< maximum for value (i.e. nValue <= nMax) */ -} OMX_BS32; - - -/** Structure representing some time or duration in microseconds. This structure - * must be interpreted as a signed 64 bit value. The quantity is signed to accommodate - * negative deltas and preroll scenarios. The quantity is represented in microseconds - * to accomodate high resolution timestamps (e.g. DVD presentation timestamps based - * on a 90kHz clock) and to allow more accurate and synchronized delivery (e.g. - * individual audio samples delivered at 192 kHz). The quantity is 64 bit to - * accommodate a large dynamic range (signed 32 bit values would allow only for plus - * or minus 35 minutes). - * - * Implementations with limited precision may convert the signed 64 bit value to - * a signed 32 bit value internally but risk loss of precision. - */ -#ifndef OMX_SKIP64BIT -typedef OMX_S64 OMX_TICKS; -#else -typedef struct OMX_TICKS -{ - OMX_U32 nLowPart; /** low bits of the signed 64 bit tick value */ - OMX_U32 nHighPart; /** high bits of the signed 64 bit tick value */ -} OMX_TICKS; -#endif -#define OMX_TICKS_PER_SECOND 1000000 - -/** Define the public interface for the OMX Handle. The core will not use - this value internally, but the application should only use this value. - */ -typedef void* OMX_HANDLETYPE; - -typedef struct OMX_MARKTYPE -{ - OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will - generate a mark event upon - processing the mark. */ - OMX_PTR pMarkData; /**< Application specific data associated with - the mark sent on a mark event to disambiguate - this mark from others. */ -} OMX_MARKTYPE; - - -/** OMX_NATIVE_DEVICETYPE is used to map a OMX video port to the - * platform & operating specific object used to reference the display - * or can be used by a audio port for native audio rendering */ -typedef void* OMX_NATIVE_DEVICETYPE; - -/** OMX_NATIVE_WINDOWTYPE is used to map a OMX video port to the - * platform & operating specific object used to reference the window */ -typedef void* OMX_NATIVE_WINDOWTYPE; - -/** The OMX_VERSIONTYPE union is used to specify the version for - a structure or component. For a component, the version is entirely - specified by the component vendor. Components doing the same function - from different vendors may or may not have the same version. For - structures, the version shall be set by the entity that allocates the - structure. For structures specified in the OMX 1.1 specification, the - value of the version shall be set to 1.1.0.0 in all cases. Access to the - OMX_VERSIONTYPE can be by a single 32 bit access (e.g. by nVersion) or - by accessing one of the structure elements to, for example, check only - the Major revision. - */ -typedef union OMX_VERSIONTYPE -{ - struct - { - OMX_U8 nVersionMajor; /**< Major version accessor element */ - OMX_U8 nVersionMinor; /**< Minor version accessor element */ - OMX_U8 nRevision; /**< Revision version accessor element */ - OMX_U8 nStep; /**< Step version accessor element */ - } s; - OMX_U32 nVersion; /**< 32 bit value to make accessing the - version easily done in a single word - size copy/compare operation */ -} OMX_VERSIONTYPE; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ diff --git a/external/android/include/18/frameworks/native/include/media/openmax/OMX_Video.h b/external/android/include/18/frameworks/native/include/media/openmax/OMX_Video.h deleted file mode 100644 index 4f8485d..0000000 --- a/external/android/include/18/frameworks/native/include/media/openmax/OMX_Video.h +++ /dev/null @@ -1,1078 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/** - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** - * @file OMX_Video.h - OpenMax IL version 1.1.2 - * The structures is needed by Video components to exchange parameters - * and configuration data with OMX components. - */ -#ifndef OMX_Video_h -#define OMX_Video_h - -/** @defgroup video OpenMAX IL Video Domain - * @ingroup iv - * Structures for OpenMAX IL Video domain - * @{ - */ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/** - * Each OMX header must include all required header files to allow the - * header to compile without errors. The includes below are required - * for this header file to compile successfully - */ - -#include - - -/** - * Enumeration used to define the possible video compression codings. - * NOTE: This essentially refers to file extensions. If the coding is - * being used to specify the ENCODE type, then additional work - * must be done to configure the exact flavor of the compression - * to be used. For decode cases where the user application can - * not differentiate between MPEG-4 and H.264 bit streams, it is - * up to the codec to handle this. - */ -typedef enum OMX_VIDEO_CODINGTYPE { - OMX_VIDEO_CodingUnused, /**< Value when coding is N/A */ - OMX_VIDEO_CodingAutoDetect, /**< Autodetection of coding type */ - OMX_VIDEO_CodingMPEG2, /**< AKA: H.262 */ - OMX_VIDEO_CodingH263, /**< H.263 */ - OMX_VIDEO_CodingMPEG4, /**< MPEG-4 */ - OMX_VIDEO_CodingWMV, /**< all versions of Windows Media Video */ - OMX_VIDEO_CodingRV, /**< all versions of Real Video */ - OMX_VIDEO_CodingAVC, /**< H.264/AVC */ - OMX_VIDEO_CodingMJPEG, /**< Motion JPEG */ - OMX_VIDEO_CodingVPX, /**< Google VPX, formerly known as On2 VP8 */ - OMX_VIDEO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_CodingMax = 0x7FFFFFFF -} OMX_VIDEO_CODINGTYPE; - - -/** - * Data structure used to define a video path. The number of Video paths for - * input and output will vary by type of the Video component. - * - * Input (aka Source) : zero Inputs, one Output, - * Splitter : one Input, 2 or more Outputs, - * Processing Element : one Input, one output, - * Mixer : 2 or more inputs, one output, - * Output (aka Sink) : one Input, zero outputs. - * - * The PortDefinition structure is used to define all of the parameters - * necessary for the compliant component to setup an input or an output video - * path. If additional vendor specific data is required, it should be - * transmitted to the component using the CustomCommand function. Compliant - * components will prepopulate this structure with optimal values during the - * GetDefaultInitParams command. - * - * STRUCT MEMBERS: - * cMIMEType : MIME type of data for the port - * pNativeRender : Platform specific reference for a display if a - * sync, otherwise this field is 0 - * nFrameWidth : Width of frame to be used on channel if - * uncompressed format is used. Use 0 for unknown, - * don't care or variable - * nFrameHeight : Height of frame to be used on channel if - * uncompressed format is used. Use 0 for unknown, - * don't care or variable - * nStride : Number of bytes per span of an image - * (i.e. indicates the number of bytes to get - * from span N to span N+1, where negative stride - * indicates the image is bottom up - * nSliceHeight : Height used when encoding in slices - * nBitrate : Bit rate of frame to be used on channel if - * compressed format is used. Use 0 for unknown, - * don't care or variable - * xFramerate : Frame rate to be used on channel if uncompressed - * format is used. Use 0 for unknown, don't care or - * variable. Units are Q16 frames per second. - * bFlagErrorConcealment : Turns on error concealment if it is supported by - * the OMX component - * eCompressionFormat : Compression format used in this instance of the - * component. When OMX_VIDEO_CodingUnused is - * specified, eColorFormat is used - * eColorFormat : Decompressed format used by this component - * pNativeWindow : Platform specific reference for a window object if a - * display sink , otherwise this field is 0x0. - */ -typedef struct OMX_VIDEO_PORTDEFINITIONTYPE { - OMX_STRING cMIMEType; - OMX_NATIVE_DEVICETYPE pNativeRender; - OMX_U32 nFrameWidth; - OMX_U32 nFrameHeight; - OMX_S32 nStride; - OMX_U32 nSliceHeight; - OMX_U32 nBitrate; - OMX_U32 xFramerate; - OMX_BOOL bFlagErrorConcealment; - OMX_VIDEO_CODINGTYPE eCompressionFormat; - OMX_COLOR_FORMATTYPE eColorFormat; - OMX_NATIVE_WINDOWTYPE pNativeWindow; -} OMX_VIDEO_PORTDEFINITIONTYPE; - -/** - * Port format parameter. This structure is used to enumerate the various - * data input/output format supported by the port. - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Indicates which port to set - * nIndex : Indicates the enumeration index for the format from - * 0x0 to N-1 - * eCompressionFormat : Compression format used in this instance of the - * component. When OMX_VIDEO_CodingUnused is specified, - * eColorFormat is used - * eColorFormat : Decompressed format used by this component - * xFrameRate : Indicates the video frame rate in Q16 format - */ -typedef struct OMX_VIDEO_PARAM_PORTFORMATTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nIndex; - OMX_VIDEO_CODINGTYPE eCompressionFormat; - OMX_COLOR_FORMATTYPE eColorFormat; - OMX_U32 xFramerate; -} OMX_VIDEO_PARAM_PORTFORMATTYPE; - - -/** - * This is a structure for configuring video compression quantization - * parameter values. Codecs may support different QP values for different - * frame types. - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version info - * nPortIndex : Port that this structure applies to - * nQpI : QP value to use for index frames - * nQpP : QP value to use for P frames - * nQpB : QP values to use for bidirectional frames - */ -typedef struct OMX_VIDEO_PARAM_QUANTIZATIONTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nQpI; - OMX_U32 nQpP; - OMX_U32 nQpB; -} OMX_VIDEO_PARAM_QUANTIZATIONTYPE; - - -/** - * Structure for configuration of video fast update parameters. - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version info - * nPortIndex : Port that this structure applies to - * bEnableVFU : Enable/Disable video fast update - * nFirstGOB : Specifies the number of the first macroblock row - * nFirstMB : specifies the first MB relative to the specified first GOB - * nNumMBs : Specifies the number of MBs to be refreshed from nFirstGOB - * and nFirstMB - */ -typedef struct OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL bEnableVFU; - OMX_U32 nFirstGOB; - OMX_U32 nFirstMB; - OMX_U32 nNumMBs; -} OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE; - - -/** - * Enumeration of possible bitrate control types - */ -typedef enum OMX_VIDEO_CONTROLRATETYPE { - OMX_Video_ControlRateDisable, - OMX_Video_ControlRateVariable, - OMX_Video_ControlRateConstant, - OMX_Video_ControlRateVariableSkipFrames, - OMX_Video_ControlRateConstantSkipFrames, - OMX_Video_ControlRateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_Video_ControlRateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_Video_ControlRateMax = 0x7FFFFFFF -} OMX_VIDEO_CONTROLRATETYPE; - - -/** - * Structure for configuring bitrate mode of a codec. - * - * STRUCT MEMBERS: - * nSize : Size of the struct in bytes - * nVersion : OMX spec version info - * nPortIndex : Port that this struct applies to - * eControlRate : Control rate type enum - * nTargetBitrate : Target bitrate to encode with - */ -typedef struct OMX_VIDEO_PARAM_BITRATETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_VIDEO_CONTROLRATETYPE eControlRate; - OMX_U32 nTargetBitrate; -} OMX_VIDEO_PARAM_BITRATETYPE; - - -/** - * Enumeration of possible motion vector (MV) types - */ -typedef enum OMX_VIDEO_MOTIONVECTORTYPE { - OMX_Video_MotionVectorPixel, - OMX_Video_MotionVectorHalfPel, - OMX_Video_MotionVectorQuarterPel, - OMX_Video_MotionVectorEighthPel, - OMX_Video_MotionVectorKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_Video_MotionVectorVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_Video_MotionVectorMax = 0x7FFFFFFF -} OMX_VIDEO_MOTIONVECTORTYPE; - - -/** - * Structure for configuring the number of motion vectors used as well - * as their accuracy. - * - * STRUCT MEMBERS: - * nSize : Size of the struct in bytes - * nVersion : OMX spec version info - * nPortIndex : port that this structure applies to - * eAccuracy : Enumerated MV accuracy - * bUnrestrictedMVs : Allow unrestricted MVs - * bFourMV : Allow use of 4 MVs - * sXSearchRange : Search range in horizontal direction for MVs - * sYSearchRange : Search range in vertical direction for MVs - */ -typedef struct OMX_VIDEO_PARAM_MOTIONVECTORTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_VIDEO_MOTIONVECTORTYPE eAccuracy; - OMX_BOOL bUnrestrictedMVs; - OMX_BOOL bFourMV; - OMX_S32 sXSearchRange; - OMX_S32 sYSearchRange; -} OMX_VIDEO_PARAM_MOTIONVECTORTYPE; - - -/** - * Enumeration of possible methods to use for Intra Refresh - */ -typedef enum OMX_VIDEO_INTRAREFRESHTYPE { - OMX_VIDEO_IntraRefreshCyclic, - OMX_VIDEO_IntraRefreshAdaptive, - OMX_VIDEO_IntraRefreshBoth, - OMX_VIDEO_IntraRefreshKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_IntraRefreshVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_IntraRefreshMax = 0x7FFFFFFF -} OMX_VIDEO_INTRAREFRESHTYPE; - - -/** - * Structure for configuring intra refresh mode - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eRefreshMode : Cyclic, Adaptive, or Both - * nAirMBs : Number of intra macroblocks to refresh in a frame when - * AIR is enabled - * nAirRef : Number of times a motion marked macroblock has to be - * intra coded - * nCirMBs : Number of consecutive macroblocks to be coded as "intra" - * when CIR is enabled - */ -typedef struct OMX_VIDEO_PARAM_INTRAREFRESHTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_VIDEO_INTRAREFRESHTYPE eRefreshMode; - OMX_U32 nAirMBs; - OMX_U32 nAirRef; - OMX_U32 nCirMBs; -} OMX_VIDEO_PARAM_INTRAREFRESHTYPE; - - -/** - * Structure for enabling various error correction methods for video - * compression. - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * bEnableHEC : Enable/disable header extension codes (HEC) - * bEnableResync : Enable/disable resynchronization markers - * nResynchMarkerSpacing : Resynch markers interval (in bits) to be - * applied in the stream - * bEnableDataPartitioning : Enable/disable data partitioning - * bEnableRVLC : Enable/disable reversible variable length - * coding - */ -typedef struct OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL bEnableHEC; - OMX_BOOL bEnableResync; - OMX_U32 nResynchMarkerSpacing; - OMX_BOOL bEnableDataPartitioning; - OMX_BOOL bEnableRVLC; -} OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE; - - -/** - * Configuration of variable block-size motion compensation (VBSMC) - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * b16x16 : Enable inter block search 16x16 - * b16x8 : Enable inter block search 16x8 - * b8x16 : Enable inter block search 8x16 - * b8x8 : Enable inter block search 8x8 - * b8x4 : Enable inter block search 8x4 - * b4x8 : Enable inter block search 4x8 - * b4x4 : Enable inter block search 4x4 - */ -typedef struct OMX_VIDEO_PARAM_VBSMCTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL b16x16; - OMX_BOOL b16x8; - OMX_BOOL b8x16; - OMX_BOOL b8x8; - OMX_BOOL b8x4; - OMX_BOOL b4x8; - OMX_BOOL b4x4; -} OMX_VIDEO_PARAM_VBSMCTYPE; - - -/** - * H.263 profile types, each profile indicates support for various - * performance bounds and different annexes. - * - * ENUMS: - * Baseline : Baseline Profile: H.263 (V1), no optional modes - * H320 Coding : H.320 Coding Efficiency Backward Compatibility - * Profile: H.263+ (V2), includes annexes I, J, L.4 - * and T - * BackwardCompatible : Backward Compatibility Profile: H.263 (V1), - * includes annex F - * ISWV2 : Interactive Streaming Wireless Profile: H.263+ - * (V2), includes annexes I, J, K and T - * ISWV3 : Interactive Streaming Wireless Profile: H.263++ - * (V3), includes profile 3 and annexes V and W.6.3.8 - * HighCompression : Conversational High Compression Profile: H.263++ - * (V3), includes profiles 1 & 2 and annexes D and U - * Internet : Conversational Internet Profile: H.263++ (V3), - * includes profile 5 and annex K - * Interlace : Conversational Interlace Profile: H.263++ (V3), - * includes profile 5 and annex W.6.3.11 - * HighLatency : High Latency Profile: H.263++ (V3), includes - * profile 6 and annexes O.1 and P.5 - */ -typedef enum OMX_VIDEO_H263PROFILETYPE { - OMX_VIDEO_H263ProfileBaseline = 0x01, - OMX_VIDEO_H263ProfileH320Coding = 0x02, - OMX_VIDEO_H263ProfileBackwardCompatible = 0x04, - OMX_VIDEO_H263ProfileISWV2 = 0x08, - OMX_VIDEO_H263ProfileISWV3 = 0x10, - OMX_VIDEO_H263ProfileHighCompression = 0x20, - OMX_VIDEO_H263ProfileInternet = 0x40, - OMX_VIDEO_H263ProfileInterlace = 0x80, - OMX_VIDEO_H263ProfileHighLatency = 0x100, - OMX_VIDEO_H263ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_H263ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_H263ProfileMax = 0x7FFFFFFF -} OMX_VIDEO_H263PROFILETYPE; - - -/** - * H.263 level types, each level indicates support for various frame sizes, - * bit rates, decoder frame rates. - */ -typedef enum OMX_VIDEO_H263LEVELTYPE { - OMX_VIDEO_H263Level10 = 0x01, - OMX_VIDEO_H263Level20 = 0x02, - OMX_VIDEO_H263Level30 = 0x04, - OMX_VIDEO_H263Level40 = 0x08, - OMX_VIDEO_H263Level45 = 0x10, - OMX_VIDEO_H263Level50 = 0x20, - OMX_VIDEO_H263Level60 = 0x40, - OMX_VIDEO_H263Level70 = 0x80, - OMX_VIDEO_H263LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_H263LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_H263LevelMax = 0x7FFFFFFF -} OMX_VIDEO_H263LEVELTYPE; - - -/** - * Specifies the picture type. These values should be OR'd to signal all - * pictures types which are allowed. - * - * ENUMS: - * Generic Picture Types: I, P and B - * H.263 Specific Picture Types: SI and SP - * H.264 Specific Picture Types: EI and EP - * MPEG-4 Specific Picture Types: S - */ -typedef enum OMX_VIDEO_PICTURETYPE { - OMX_VIDEO_PictureTypeI = 0x01, - OMX_VIDEO_PictureTypeP = 0x02, - OMX_VIDEO_PictureTypeB = 0x04, - OMX_VIDEO_PictureTypeSI = 0x08, - OMX_VIDEO_PictureTypeSP = 0x10, - OMX_VIDEO_PictureTypeEI = 0x11, - OMX_VIDEO_PictureTypeEP = 0x12, - OMX_VIDEO_PictureTypeS = 0x14, - OMX_VIDEO_PictureTypeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_PictureTypeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_PictureTypeMax = 0x7FFFFFFF -} OMX_VIDEO_PICTURETYPE; - - -/** - * H.263 Params - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nPFrames : Number of P frames between each I frame - * nBFrames : Number of B frames between each I frame - * eProfile : H.263 profile(s) to use - * eLevel : H.263 level(s) to use - * bPLUSPTYPEAllowed : Indicating that it is allowed to use PLUSPTYPE - * (specified in the 1998 version of H.263) to - * indicate custom picture sizes or clock - * frequencies - * nAllowedPictureTypes : Specifies the picture types allowed in the - * bitstream - * bForceRoundingTypeToZero : value of the RTYPE bit (bit 6 of MPPTYPE) is - * not constrained. It is recommended to change - * the value of the RTYPE bit for each reference - * picture in error-free communication - * nPictureHeaderRepetition : Specifies the frequency of picture header - * repetition - * nGOBHeaderInterval : Specifies the interval of non-empty GOB - * headers in units of GOBs - */ -typedef struct OMX_VIDEO_PARAM_H263TYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nPFrames; - OMX_U32 nBFrames; - OMX_VIDEO_H263PROFILETYPE eProfile; - OMX_VIDEO_H263LEVELTYPE eLevel; - OMX_BOOL bPLUSPTYPEAllowed; - OMX_U32 nAllowedPictureTypes; - OMX_BOOL bForceRoundingTypeToZero; - OMX_U32 nPictureHeaderRepetition; - OMX_U32 nGOBHeaderInterval; -} OMX_VIDEO_PARAM_H263TYPE; - - -/** - * MPEG-2 profile types, each profile indicates support for various - * performance bounds and different annexes. - */ -typedef enum OMX_VIDEO_MPEG2PROFILETYPE { - OMX_VIDEO_MPEG2ProfileSimple = 0, /**< Simple Profile */ - OMX_VIDEO_MPEG2ProfileMain, /**< Main Profile */ - OMX_VIDEO_MPEG2Profile422, /**< 4:2:2 Profile */ - OMX_VIDEO_MPEG2ProfileSNR, /**< SNR Profile */ - OMX_VIDEO_MPEG2ProfileSpatial, /**< Spatial Profile */ - OMX_VIDEO_MPEG2ProfileHigh, /**< High Profile */ - OMX_VIDEO_MPEG2ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_MPEG2ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_MPEG2ProfileMax = 0x7FFFFFFF -} OMX_VIDEO_MPEG2PROFILETYPE; - - -/** - * MPEG-2 level types, each level indicates support for various frame - * sizes, bit rates, decoder frame rates. No need - */ -typedef enum OMX_VIDEO_MPEG2LEVELTYPE { - OMX_VIDEO_MPEG2LevelLL = 0, /**< Low Level */ - OMX_VIDEO_MPEG2LevelML, /**< Main Level */ - OMX_VIDEO_MPEG2LevelH14, /**< High 1440 */ - OMX_VIDEO_MPEG2LevelHL, /**< High Level */ - OMX_VIDEO_MPEG2LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_MPEG2LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_MPEG2LevelMax = 0x7FFFFFFF -} OMX_VIDEO_MPEG2LEVELTYPE; - - -/** - * MPEG-2 params - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nPFrames : Number of P frames between each I frame - * nBFrames : Number of B frames between each I frame - * eProfile : MPEG-2 profile(s) to use - * eLevel : MPEG-2 levels(s) to use - */ -typedef struct OMX_VIDEO_PARAM_MPEG2TYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nPFrames; - OMX_U32 nBFrames; - OMX_VIDEO_MPEG2PROFILETYPE eProfile; - OMX_VIDEO_MPEG2LEVELTYPE eLevel; -} OMX_VIDEO_PARAM_MPEG2TYPE; - - -/** - * MPEG-4 profile types, each profile indicates support for various - * performance bounds and different annexes. - * - * ENUMS: - * - Simple Profile, Levels 1-3 - * - Simple Scalable Profile, Levels 1-2 - * - Core Profile, Levels 1-2 - * - Main Profile, Levels 2-4 - * - N-bit Profile, Level 2 - * - Scalable Texture Profile, Level 1 - * - Simple Face Animation Profile, Levels 1-2 - * - Simple Face and Body Animation (FBA) Profile, Levels 1-2 - * - Basic Animated Texture Profile, Levels 1-2 - * - Hybrid Profile, Levels 1-2 - * - Advanced Real Time Simple Profiles, Levels 1-4 - * - Core Scalable Profile, Levels 1-3 - * - Advanced Coding Efficiency Profile, Levels 1-4 - * - Advanced Core Profile, Levels 1-2 - * - Advanced Scalable Texture, Levels 2-3 - */ -typedef enum OMX_VIDEO_MPEG4PROFILETYPE { - OMX_VIDEO_MPEG4ProfileSimple = 0x01, - OMX_VIDEO_MPEG4ProfileSimpleScalable = 0x02, - OMX_VIDEO_MPEG4ProfileCore = 0x04, - OMX_VIDEO_MPEG4ProfileMain = 0x08, - OMX_VIDEO_MPEG4ProfileNbit = 0x10, - OMX_VIDEO_MPEG4ProfileScalableTexture = 0x20, - OMX_VIDEO_MPEG4ProfileSimpleFace = 0x40, - OMX_VIDEO_MPEG4ProfileSimpleFBA = 0x80, - OMX_VIDEO_MPEG4ProfileBasicAnimated = 0x100, - OMX_VIDEO_MPEG4ProfileHybrid = 0x200, - OMX_VIDEO_MPEG4ProfileAdvancedRealTime = 0x400, - OMX_VIDEO_MPEG4ProfileCoreScalable = 0x800, - OMX_VIDEO_MPEG4ProfileAdvancedCoding = 0x1000, - OMX_VIDEO_MPEG4ProfileAdvancedCore = 0x2000, - OMX_VIDEO_MPEG4ProfileAdvancedScalable = 0x4000, - OMX_VIDEO_MPEG4ProfileAdvancedSimple = 0x8000, - OMX_VIDEO_MPEG4ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_MPEG4ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_MPEG4ProfileMax = 0x7FFFFFFF -} OMX_VIDEO_MPEG4PROFILETYPE; - - -/** - * MPEG-4 level types, each level indicates support for various frame - * sizes, bit rates, decoder frame rates. No need - */ -typedef enum OMX_VIDEO_MPEG4LEVELTYPE { - OMX_VIDEO_MPEG4Level0 = 0x01, /**< Level 0 */ - OMX_VIDEO_MPEG4Level0b = 0x02, /**< Level 0b */ - OMX_VIDEO_MPEG4Level1 = 0x04, /**< Level 1 */ - OMX_VIDEO_MPEG4Level2 = 0x08, /**< Level 2 */ - OMX_VIDEO_MPEG4Level3 = 0x10, /**< Level 3 */ - OMX_VIDEO_MPEG4Level4 = 0x20, /**< Level 4 */ - OMX_VIDEO_MPEG4Level4a = 0x40, /**< Level 4a */ - OMX_VIDEO_MPEG4Level5 = 0x80, /**< Level 5 */ - OMX_VIDEO_MPEG4LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_MPEG4LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_MPEG4LevelMax = 0x7FFFFFFF -} OMX_VIDEO_MPEG4LEVELTYPE; - - -/** - * MPEG-4 configuration. This structure handles configuration options - * which are specific to MPEG4 algorithms - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nSliceHeaderSpacing : Number of macroblocks between slice header (H263+ - * Annex K). Put zero if not used - * bSVH : Enable Short Video Header mode - * bGov : Flag to enable GOV - * nPFrames : Number of P frames between each I frame (also called - * GOV period) - * nBFrames : Number of B frames between each I frame - * nIDCVLCThreshold : Value of intra DC VLC threshold - * bACPred : Flag to use ac prediction - * nMaxPacketSize : Maximum size of packet in bytes. - * nTimeIncRes : Used to pass VOP time increment resolution for MPEG4. - * Interpreted as described in MPEG4 standard. - * eProfile : MPEG-4 profile(s) to use. - * eLevel : MPEG-4 level(s) to use. - * nAllowedPictureTypes : Specifies the picture types allowed in the bitstream - * nHeaderExtension : Specifies the number of consecutive video packet - * headers within a VOP - * bReversibleVLC : Specifies whether reversible variable length coding - * is in use - */ -typedef struct OMX_VIDEO_PARAM_MPEG4TYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nSliceHeaderSpacing; - OMX_BOOL bSVH; - OMX_BOOL bGov; - OMX_U32 nPFrames; - OMX_U32 nBFrames; - OMX_U32 nIDCVLCThreshold; - OMX_BOOL bACPred; - OMX_U32 nMaxPacketSize; - OMX_U32 nTimeIncRes; - OMX_VIDEO_MPEG4PROFILETYPE eProfile; - OMX_VIDEO_MPEG4LEVELTYPE eLevel; - OMX_U32 nAllowedPictureTypes; - OMX_U32 nHeaderExtension; - OMX_BOOL bReversibleVLC; -} OMX_VIDEO_PARAM_MPEG4TYPE; - - -/** - * WMV Versions - */ -typedef enum OMX_VIDEO_WMVFORMATTYPE { - OMX_VIDEO_WMVFormatUnused = 0x01, /**< Format unused or unknown */ - OMX_VIDEO_WMVFormat7 = 0x02, /**< Windows Media Video format 7 */ - OMX_VIDEO_WMVFormat8 = 0x04, /**< Windows Media Video format 8 */ - OMX_VIDEO_WMVFormat9 = 0x08, /**< Windows Media Video format 9 */ - OMX_VIDEO_WMFFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_WMFFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_WMVFormatMax = 0x7FFFFFFF -} OMX_VIDEO_WMVFORMATTYPE; - - -/** - * WMV Params - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eFormat : Version of WMV stream / data - */ -typedef struct OMX_VIDEO_PARAM_WMVTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_VIDEO_WMVFORMATTYPE eFormat; -} OMX_VIDEO_PARAM_WMVTYPE; - - -/** - * Real Video Version - */ -typedef enum OMX_VIDEO_RVFORMATTYPE { - OMX_VIDEO_RVFormatUnused = 0, /**< Format unused or unknown */ - OMX_VIDEO_RVFormat8, /**< Real Video format 8 */ - OMX_VIDEO_RVFormat9, /**< Real Video format 9 */ - OMX_VIDEO_RVFormatG2, /**< Real Video Format G2 */ - OMX_VIDEO_RVFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_RVFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_RVFormatMax = 0x7FFFFFFF -} OMX_VIDEO_RVFORMATTYPE; - - -/** - * Real Video Params - * - * STUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eFormat : Version of RV stream / data - * nBitsPerPixel : Bits per pixel coded in the frame - * nPaddedWidth : Padded width in pixel of a video frame - * nPaddedHeight : Padded Height in pixels of a video frame - * nFrameRate : Rate of video in frames per second - * nBitstreamFlags : Flags which internal information about the bitstream - * nBitstreamVersion : Bitstream version - * nMaxEncodeFrameSize: Max encoded frame size - * bEnablePostFilter : Turn on/off post filter - * bEnableTemporalInterpolation : Turn on/off temporal interpolation - * bEnableLatencyMode : When enabled, the decoder does not display a decoded - * frame until it has detected that no enhancement layer - * frames or dependent B frames will be coming. This - * detection usually occurs when a subsequent non-B - * frame is encountered - */ -typedef struct OMX_VIDEO_PARAM_RVTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_VIDEO_RVFORMATTYPE eFormat; - OMX_U16 nBitsPerPixel; - OMX_U16 nPaddedWidth; - OMX_U16 nPaddedHeight; - OMX_U32 nFrameRate; - OMX_U32 nBitstreamFlags; - OMX_U32 nBitstreamVersion; - OMX_U32 nMaxEncodeFrameSize; - OMX_BOOL bEnablePostFilter; - OMX_BOOL bEnableTemporalInterpolation; - OMX_BOOL bEnableLatencyMode; -} OMX_VIDEO_PARAM_RVTYPE; - - -/** - * AVC profile types, each profile indicates support for various - * performance bounds and different annexes. - */ -typedef enum OMX_VIDEO_AVCPROFILETYPE { - OMX_VIDEO_AVCProfileBaseline = 0x01, /**< Baseline profile */ - OMX_VIDEO_AVCProfileMain = 0x02, /**< Main profile */ - OMX_VIDEO_AVCProfileExtended = 0x04, /**< Extended profile */ - OMX_VIDEO_AVCProfileHigh = 0x08, /**< High profile */ - OMX_VIDEO_AVCProfileHigh10 = 0x10, /**< High 10 profile */ - OMX_VIDEO_AVCProfileHigh422 = 0x20, /**< High 4:2:2 profile */ - OMX_VIDEO_AVCProfileHigh444 = 0x40, /**< High 4:4:4 profile */ - OMX_VIDEO_AVCProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_AVCProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_AVCProfileMax = 0x7FFFFFFF -} OMX_VIDEO_AVCPROFILETYPE; - - -/** - * AVC level types, each level indicates support for various frame sizes, - * bit rates, decoder frame rates. No need - */ -typedef enum OMX_VIDEO_AVCLEVELTYPE { - OMX_VIDEO_AVCLevel1 = 0x01, /**< Level 1 */ - OMX_VIDEO_AVCLevel1b = 0x02, /**< Level 1b */ - OMX_VIDEO_AVCLevel11 = 0x04, /**< Level 1.1 */ - OMX_VIDEO_AVCLevel12 = 0x08, /**< Level 1.2 */ - OMX_VIDEO_AVCLevel13 = 0x10, /**< Level 1.3 */ - OMX_VIDEO_AVCLevel2 = 0x20, /**< Level 2 */ - OMX_VIDEO_AVCLevel21 = 0x40, /**< Level 2.1 */ - OMX_VIDEO_AVCLevel22 = 0x80, /**< Level 2.2 */ - OMX_VIDEO_AVCLevel3 = 0x100, /**< Level 3 */ - OMX_VIDEO_AVCLevel31 = 0x200, /**< Level 3.1 */ - OMX_VIDEO_AVCLevel32 = 0x400, /**< Level 3.2 */ - OMX_VIDEO_AVCLevel4 = 0x800, /**< Level 4 */ - OMX_VIDEO_AVCLevel41 = 0x1000, /**< Level 4.1 */ - OMX_VIDEO_AVCLevel42 = 0x2000, /**< Level 4.2 */ - OMX_VIDEO_AVCLevel5 = 0x4000, /**< Level 5 */ - OMX_VIDEO_AVCLevel51 = 0x8000, /**< Level 5.1 */ - OMX_VIDEO_AVCLevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_AVCLevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_AVCLevelMax = 0x7FFFFFFF -} OMX_VIDEO_AVCLEVELTYPE; - - -/** - * AVC loop filter modes - * - * OMX_VIDEO_AVCLoopFilterEnable : Enable - * OMX_VIDEO_AVCLoopFilterDisable : Disable - * OMX_VIDEO_AVCLoopFilterDisableSliceBoundary : Disabled on slice boundaries - */ -typedef enum OMX_VIDEO_AVCLOOPFILTERTYPE { - OMX_VIDEO_AVCLoopFilterEnable = 0, - OMX_VIDEO_AVCLoopFilterDisable, - OMX_VIDEO_AVCLoopFilterDisableSliceBoundary, - OMX_VIDEO_AVCLoopFilterKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_AVCLoopFilterVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_AVCLoopFilterMax = 0x7FFFFFFF -} OMX_VIDEO_AVCLOOPFILTERTYPE; - - -/** - * AVC params - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nSliceHeaderSpacing : Number of macroblocks between slice header, put - * zero if not used - * nPFrames : Number of P frames between each I frame - * nBFrames : Number of B frames between each I frame - * bUseHadamard : Enable/disable Hadamard transform - * nRefFrames : Max number of reference frames to use for inter - * motion search (1-16) - * nRefIdxTrailing : Pic param set ref frame index (index into ref - * frame buffer of trailing frames list), B frame - * support - * nRefIdxForward : Pic param set ref frame index (index into ref - * frame buffer of forward frames list), B frame - * support - * bEnableUEP : Enable/disable unequal error protection. This - * is only valid of data partitioning is enabled. - * bEnableFMO : Enable/disable flexible macroblock ordering - * bEnableASO : Enable/disable arbitrary slice ordering - * bEnableRS : Enable/disable sending of redundant slices - * eProfile : AVC profile(s) to use - * eLevel : AVC level(s) to use - * nAllowedPictureTypes : Specifies the picture types allowed in the - * bitstream - * bFrameMBsOnly : specifies that every coded picture of the - * coded video sequence is a coded frame - * containing only frame macroblocks - * bMBAFF : Enable/disable switching between frame and - * field macroblocks within a picture - * bEntropyCodingCABAC : Entropy decoding method to be applied for the - * syntax elements for which two descriptors appear - * in the syntax tables - * bWeightedPPrediction : Enable/disable weighted prediction shall not - * be applied to P and SP slices - * nWeightedBipredicitonMode : Default weighted prediction is applied to B - * slices - * bconstIpred : Enable/disable intra prediction - * bDirect8x8Inference : Specifies the method used in the derivation - * process for luma motion vectors for B_Skip, - * B_Direct_16x16 and B_Direct_8x8 as specified - * in subclause 8.4.1.2 of the AVC spec - * bDirectSpatialTemporal : Flag indicating spatial or temporal direct - * mode used in B slice coding (related to - * bDirect8x8Inference) . Spatial direct mode is - * more common and should be the default. - * nCabacInitIdx : Index used to init CABAC contexts - * eLoopFilterMode : Enable/disable loop filter - */ -typedef struct OMX_VIDEO_PARAM_AVCTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nSliceHeaderSpacing; - OMX_U32 nPFrames; - OMX_U32 nBFrames; - OMX_BOOL bUseHadamard; - OMX_U32 nRefFrames; - OMX_U32 nRefIdx10ActiveMinus1; - OMX_U32 nRefIdx11ActiveMinus1; - OMX_BOOL bEnableUEP; - OMX_BOOL bEnableFMO; - OMX_BOOL bEnableASO; - OMX_BOOL bEnableRS; - OMX_VIDEO_AVCPROFILETYPE eProfile; - OMX_VIDEO_AVCLEVELTYPE eLevel; - OMX_U32 nAllowedPictureTypes; - OMX_BOOL bFrameMBsOnly; - OMX_BOOL bMBAFF; - OMX_BOOL bEntropyCodingCABAC; - OMX_BOOL bWeightedPPrediction; - OMX_U32 nWeightedBipredicitonMode; - OMX_BOOL bconstIpred ; - OMX_BOOL bDirect8x8Inference; - OMX_BOOL bDirectSpatialTemporal; - OMX_U32 nCabacInitIdc; - OMX_VIDEO_AVCLOOPFILTERTYPE eLoopFilterMode; -} OMX_VIDEO_PARAM_AVCTYPE; - -typedef struct OMX_VIDEO_PARAM_PROFILELEVELTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 eProfile; /**< type is OMX_VIDEO_AVCPROFILETYPE, OMX_VIDEO_H263PROFILETYPE, - or OMX_VIDEO_MPEG4PROFILETYPE depending on context */ - OMX_U32 eLevel; /**< type is OMX_VIDEO_AVCLEVELTYPE, OMX_VIDEO_H263LEVELTYPE, - or OMX_VIDEO_MPEG4PROFILETYPE depending on context */ - OMX_U32 nProfileIndex; /**< Used to query for individual profile support information, - This parameter is valid only for - OMX_IndexParamVideoProfileLevelQuerySupported index, - For all other indices this parameter is to be ignored. */ -} OMX_VIDEO_PARAM_PROFILELEVELTYPE; - -/** - * Structure for dynamically configuring bitrate mode of a codec. - * - * STRUCT MEMBERS: - * nSize : Size of the struct in bytes - * nVersion : OMX spec version info - * nPortIndex : Port that this struct applies to - * nEncodeBitrate : Target average bitrate to be generated in bps - */ -typedef struct OMX_VIDEO_CONFIG_BITRATETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nEncodeBitrate; -} OMX_VIDEO_CONFIG_BITRATETYPE; - -/** - * Defines Encoder Frame Rate setting - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * xEncodeFramerate : Encoding framerate represented in Q16 format - */ -typedef struct OMX_CONFIG_FRAMERATETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 xEncodeFramerate; /* Q16 format */ -} OMX_CONFIG_FRAMERATETYPE; - -typedef struct OMX_CONFIG_INTRAREFRESHVOPTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL IntraRefreshVOP; -} OMX_CONFIG_INTRAREFRESHVOPTYPE; - -typedef struct OMX_CONFIG_MACROBLOCKERRORMAPTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nErrMapSize; /* Size of the Error Map in bytes */ - OMX_U8 ErrMap[1]; /* Error map hint */ -} OMX_CONFIG_MACROBLOCKERRORMAPTYPE; - -typedef struct OMX_CONFIG_MBERRORREPORTINGTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL bEnabled; -} OMX_CONFIG_MBERRORREPORTINGTYPE; - -typedef struct OMX_PARAM_MACROBLOCKSTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nMacroblocks; -} OMX_PARAM_MACROBLOCKSTYPE; - -/** - * AVC Slice Mode modes - * - * OMX_VIDEO_SLICEMODE_AVCDefault : Normal frame encoding, one slice per frame - * OMX_VIDEO_SLICEMODE_AVCMBSlice : NAL mode, number of MBs per frame - * OMX_VIDEO_SLICEMODE_AVCByteSlice : NAL mode, number of bytes per frame - */ -typedef enum OMX_VIDEO_AVCSLICEMODETYPE { - OMX_VIDEO_SLICEMODE_AVCDefault = 0, - OMX_VIDEO_SLICEMODE_AVCMBSlice, - OMX_VIDEO_SLICEMODE_AVCByteSlice, - OMX_VIDEO_SLICEMODE_AVCKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_SLICEMODE_AVCVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_SLICEMODE_AVCLevelMax = 0x7FFFFFFF -} OMX_VIDEO_AVCSLICEMODETYPE; - -/** - * AVC FMO Slice Mode Params - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nNumSliceGroups : Specifies the number of slice groups - * nSliceGroupMapType : Specifies the type of slice groups - * eSliceMode : Specifies the type of slice - */ -typedef struct OMX_VIDEO_PARAM_AVCSLICEFMO { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U8 nNumSliceGroups; - OMX_U8 nSliceGroupMapType; - OMX_VIDEO_AVCSLICEMODETYPE eSliceMode; -} OMX_VIDEO_PARAM_AVCSLICEFMO; - -/** - * AVC IDR Period Configs - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nIDRPeriod : Specifies periodicity of IDR frames - * nPFrames : Specifies internal of coding Intra frames - */ -typedef struct OMX_VIDEO_CONFIG_AVCINTRAPERIOD { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nIDRPeriod; - OMX_U32 nPFrames; -} OMX_VIDEO_CONFIG_AVCINTRAPERIOD; - -/** - * AVC NAL Size Configs - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nNaluBytes : Specifies the NAL unit size - */ -typedef struct OMX_VIDEO_CONFIG_NALSIZE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nNaluBytes; -} OMX_VIDEO_CONFIG_NALSIZE; - -/** @} */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ - diff --git a/external/android/include/18/frameworks/native/include/media/openmax/OMX_VideoExt.h b/external/android/include/18/frameworks/native/include/media/openmax/OMX_VideoExt.h deleted file mode 100644 index 5e79b47..0000000 --- a/external/android/include/18/frameworks/native/include/media/openmax/OMX_VideoExt.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2010 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** OMX_VideoExt.h - OpenMax IL version 1.1.2 - * The OMX_VideoExt header file contains extensions to the - * definitions used by both the application and the component to - * access video items. - */ - -#ifndef OMX_VideoExt_h -#define OMX_VideoExt_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* Each OMX header shall include all required header files to allow the - * header to compile without errors. The includes below are required - * for this header file to compile successfully - */ -#include - -/** NALU Formats */ -typedef enum OMX_NALUFORMATSTYPE { - OMX_NaluFormatStartCodes = 1, - OMX_NaluFormatOneNaluPerBuffer = 2, - OMX_NaluFormatOneByteInterleaveLength = 4, - OMX_NaluFormatTwoByteInterleaveLength = 8, - OMX_NaluFormatFourByteInterleaveLength = 16, - OMX_NaluFormatCodingMax = 0x7FFFFFFF -} OMX_NALUFORMATSTYPE; - -/** NAL Stream Format */ -typedef struct OMX_NALSTREAMFORMATTYPE{ - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_NALUFORMATSTYPE eNaluFormat; -} OMX_NALSTREAMFORMATTYPE; - -/** Enum for standard video codingtype extensions */ -typedef enum OMX_VIDEO_CODINGEXTTYPE { - OMX_VIDEO_ExtCodingUnused = OMX_VIDEO_CodingKhronosExtensions, - OMX_VIDEO_CodingVP8, /**< VP8/WebM */ -} OMX_VIDEO_CODINGEXTTYPE; - -/** VP8 profiles */ -typedef enum OMX_VIDEO_VP8PROFILETYPE { - OMX_VIDEO_VP8ProfileMain = 0x01, - OMX_VIDEO_VP8ProfileUnknown = 0x6EFFFFFF, - OMX_VIDEO_VP8ProfileMax = 0x7FFFFFFF -} OMX_VIDEO_VP8PROFILETYPE; - -/** VP8 levels */ -typedef enum OMX_VIDEO_VP8LEVELTYPE { - OMX_VIDEO_VP8Level_Version0 = 0x01, - OMX_VIDEO_VP8Level_Version1 = 0x02, - OMX_VIDEO_VP8Level_Version2 = 0x04, - OMX_VIDEO_VP8Level_Version3 = 0x08, - OMX_VIDEO_VP8LevelUnknown = 0x6EFFFFFF, - OMX_VIDEO_VP8LevelMax = 0x7FFFFFFF -} OMX_VIDEO_VP8LEVELTYPE; - -/** VP8 Param */ -typedef struct OMX_VIDEO_PARAM_VP8TYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_VIDEO_VP8PROFILETYPE eProfile; - OMX_VIDEO_VP8LEVELTYPE eLevel; - OMX_U32 nDCTPartitions; - OMX_BOOL bErrorResilientMode; -} OMX_VIDEO_PARAM_VP8TYPE; - -/** Structure for configuring VP8 reference frames */ -typedef struct OMX_VIDEO_VP8REFERENCEFRAMETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL bPreviousFrameRefresh; - OMX_BOOL bGoldenFrameRefresh; - OMX_BOOL bAlternateFrameRefresh; - OMX_BOOL bUsePreviousFrame; - OMX_BOOL bUseGoldenFrame; - OMX_BOOL bUseAlternateFrame; -} OMX_VIDEO_VP8REFERENCEFRAMETYPE; - -/** Structure for querying VP8 reference frame type */ -typedef struct OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL bIsIntraFrame; - OMX_BOOL bIsGoldenOrAlternateFrame; -} OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE; - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* OMX_VideoExt_h */ -/* File EOF */ diff --git a/external/android/include/18/frameworks/native/include/ui/ANativeObjectBase.h b/external/android/include/18/frameworks/native/include/ui/ANativeObjectBase.h deleted file mode 100644 index 76e850f..0000000 --- a/external/android/include/18/frameworks/native/include/ui/ANativeObjectBase.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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_ANDROID_NATIVES_H -#define ANDROID_ANDROID_NATIVES_H - -#include -#include - -#include -#include - -// --------------------------------------------------------------------------- - -/* FIXME: this is legacy for pixmaps */ -typedef struct egl_native_pixmap_t -{ - int32_t version; /* must be 32 */ - int32_t width; - int32_t height; - int32_t stride; - uint8_t* data; - uint8_t format; - uint8_t rfu[3]; - union { - uint32_t compressedFormat; - int32_t vstride; - }; - int32_t reserved; -} egl_native_pixmap_t; - -/*****************************************************************************/ - -#ifdef __cplusplus - -#include - -namespace android { - -/* - * This helper class turns a ANativeXXX object type into a C++ - * reference-counted object; with proper type conversions. - */ -template -class ANativeObjectBase : public NATIVE_TYPE, public REF -{ -public: - // Disambiguate between the incStrong in REF and NATIVE_TYPE - void incStrong(const void* id) const { - REF::incStrong(id); - } - void decStrong(const void* id) const { - REF::decStrong(id); - } - -protected: - typedef ANativeObjectBase BASE; - ANativeObjectBase() : NATIVE_TYPE(), REF() { - NATIVE_TYPE::common.incRef = incRef; - NATIVE_TYPE::common.decRef = decRef; - } - static inline TYPE* getSelf(NATIVE_TYPE* self) { - return static_cast(self); - } - static inline TYPE const* getSelf(NATIVE_TYPE const* self) { - return static_cast(self); - } - static inline TYPE* getSelf(android_native_base_t* base) { - return getSelf(reinterpret_cast(base)); - } - static inline TYPE const * getSelf(android_native_base_t const* base) { - return getSelf(reinterpret_cast(base)); - } - static void incRef(android_native_base_t* base) { - ANativeObjectBase* self = getSelf(base); - self->incStrong(self); - } - static void decRef(android_native_base_t* base) { - ANativeObjectBase* self = getSelf(base); - self->decStrong(self); - } -}; - -} // namespace android -#endif // __cplusplus - -/*****************************************************************************/ - -#endif /* ANDROID_ANDROID_NATIVES_H */ diff --git a/external/android/include/18/frameworks/native/include/ui/DisplayInfo.h b/external/android/include/18/frameworks/native/include/ui/DisplayInfo.h deleted file mode 100644 index c3a4d6b..0000000 --- a/external/android/include/18/frameworks/native/include/ui/DisplayInfo.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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_UI_DISPLAY_INFO_H -#define ANDROID_UI_DISPLAY_INFO_H - -#include -#include - -#include - -namespace android { - -struct DisplayInfo { - uint32_t w; - uint32_t h; - float xdpi; - float ydpi; - float fps; - float density; - uint8_t orientation; - bool secure; - uint8_t reserved[2]; - // TODO: this needs to go away (currently needed only by webkit) - PixelFormatInfo pixelFormatInfo; -}; - -/* Display orientations as defined in Surface.java and ISurfaceComposer.h. */ -enum { - DISPLAY_ORIENTATION_0 = 0, - DISPLAY_ORIENTATION_90 = 1, - DISPLAY_ORIENTATION_180 = 2, - DISPLAY_ORIENTATION_270 = 3 -}; - -}; // namespace android - -#endif // ANDROID_COMPOSER_DISPLAY_INFO_H diff --git a/external/android/include/18/frameworks/native/include/ui/Fence.h b/external/android/include/18/frameworks/native/include/ui/Fence.h deleted file mode 100644 index 60156e7..0000000 --- a/external/android/include/18/frameworks/native/include/ui/Fence.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (C) 2012 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_FENCE_H -#define ANDROID_FENCE_H - -#include -#include - -#include -#include -#include -#include -#include -#include - -struct ANativeWindowBuffer; - -namespace android { - -// =========================================================================== -// Fence -// =========================================================================== - -class Fence - : public LightRefBase, public Flattenable -{ -public: - static const sp NO_FENCE; - - // TIMEOUT_NEVER may be passed to the wait method to indicate that it - // should wait indefinitely for the fence to signal. - enum { TIMEOUT_NEVER = -1 }; - - // Construct a new Fence object with an invalid file descriptor. This - // should be done when the Fence object will be set up by unflattening - // serialized data. - Fence(); - - // Construct a new Fence object to manage a given fence file descriptor. - // When the new Fence object is destructed the file descriptor will be - // closed. - Fence(int fenceFd); - - // Check whether the Fence has an open fence file descriptor. Most Fence - // methods treat an invalid file descriptor just like a valid fence that - // is already signalled, so using this is usually not necessary. - bool isValid() const { return mFenceFd != -1; } - - // wait waits for up to timeout milliseconds for the fence to signal. If - // the fence signals then NO_ERROR is returned. If the timeout expires - // before the fence signals then -ETIME is returned. A timeout of - // TIMEOUT_NEVER may be used to indicate that the call should wait - // indefinitely for the fence to signal. - status_t wait(unsigned int timeout); - - // waitForever is a convenience function for waiting forever for a fence to - // signal (just like wait(TIMEOUT_NEVER)), but issuing an error to the - // system log and fence state to the kernel log if the wait lasts longer - // than a warning timeout. - // The logname argument should be a string identifying - // the caller and will be included in the log message. - status_t waitForever(const char* logname); - - // merge combines two Fence objects, creating a new Fence object that - // becomes signaled when both f1 and f2 are signaled (even if f1 or f2 is - // destroyed before it becomes signaled). The name argument specifies the - // human-readable name to associated with the new Fence object. - static sp merge(const String8& name, const sp& f1, - const sp& f2); - - // Return a duplicate of the fence file descriptor. The caller is - // responsible for closing the returned file descriptor. On error, -1 will - // be returned and errno will indicate the problem. - int dup() const; - - // getSignalTime returns the system monotonic clock time at which the - // fence transitioned to the signaled state. If the fence is not signaled - // then INT64_MAX is returned. If the fence is invalid or if an error - // occurs then -1 is returned. - nsecs_t getSignalTime() const; - - // Flattenable interface - size_t getFlattenedSize() const; - size_t getFdCount() const; - status_t flatten(void* buffer, size_t size, - int fds[], size_t count) const; - status_t unflatten(void const* buffer, size_t size, - int fds[], size_t count); - -private: - // Only allow instantiation using ref counting. - friend class LightRefBase; - virtual ~Fence(); - - // Disallow copying - Fence(const Fence& rhs); - Fence& operator = (const Fence& rhs); - const Fence& operator = (const Fence& rhs) const; - - int mFenceFd; -}; - -}; // namespace android - -#endif // ANDROID_FENCE_H diff --git a/external/android/include/18/frameworks/native/include/ui/FramebufferNativeWindow.h b/external/android/include/18/frameworks/native/include/ui/FramebufferNativeWindow.h deleted file mode 100644 index 5ec738f..0000000 --- a/external/android/include/18/frameworks/native/include/ui/FramebufferNativeWindow.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * 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_FRAMEBUFFER_NATIVE_WINDOW_H -#define ANDROID_FRAMEBUFFER_NATIVE_WINDOW_H - -#include -#include - -#include - -#include -#include - -#include -#include - -#define MIN_NUM_FRAME_BUFFERS 2 -#define MAX_NUM_FRAME_BUFFERS 3 - -extern "C" EGLNativeWindowType android_createDisplaySurface(void); - -// --------------------------------------------------------------------------- -namespace android { -// --------------------------------------------------------------------------- - -class Surface; -class NativeBuffer; - -// --------------------------------------------------------------------------- - -class FramebufferNativeWindow - : public ANativeObjectBase< - ANativeWindow, - FramebufferNativeWindow, - LightRefBase > -{ -public: - FramebufferNativeWindow(); - - framebuffer_device_t const * getDevice() const { return fbDev; } - - bool isUpdateOnDemand() const { return mUpdateOnDemand; } - status_t setUpdateRectangle(const Rect& updateRect); - status_t compositionComplete(); - - void dump(String8& result); - - // for debugging only - int getCurrentBufferIndex() const; - -private: - friend class LightRefBase; - ~FramebufferNativeWindow(); // this class cannot be overloaded - static int setSwapInterval(ANativeWindow* window, int interval); - static int dequeueBuffer(ANativeWindow* window, ANativeWindowBuffer** buffer, int* fenceFd); - static int queueBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer, int fenceFd); - static int query(const ANativeWindow* window, int what, int* value); - static int perform(ANativeWindow* window, int operation, ...); - - static int dequeueBuffer_DEPRECATED(ANativeWindow* window, ANativeWindowBuffer** buffer); - static int queueBuffer_DEPRECATED(ANativeWindow* window, ANativeWindowBuffer* buffer); - static int lockBuffer_DEPRECATED(ANativeWindow* window, ANativeWindowBuffer* buffer); - - framebuffer_device_t* fbDev; - alloc_device_t* grDev; - - sp buffers[MAX_NUM_FRAME_BUFFERS]; - sp front; - - mutable Mutex mutex; - Condition mCondition; - int32_t mNumBuffers; - int32_t mNumFreeBuffers; - int32_t mBufferHead; - int32_t mCurrentBufferIndex; - bool mUpdateOnDemand; -}; - -// --------------------------------------------------------------------------- -}; // namespace android -// --------------------------------------------------------------------------- - -#endif // ANDROID_FRAMEBUFFER_NATIVE_WINDOW_H - diff --git a/external/android/include/18/frameworks/native/include/ui/GraphicBuffer.h b/external/android/include/18/frameworks/native/include/ui/GraphicBuffer.h deleted file mode 100644 index e5ad1e0..0000000 --- a/external/android/include/18/frameworks/native/include/ui/GraphicBuffer.h +++ /dev/null @@ -1,159 +0,0 @@ -/* - * 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_GRAPHIC_BUFFER_H -#define ANDROID_GRAPHIC_BUFFER_H - -#include -#include - -#include -#include -#include -#include -#include - - -struct ANativeWindowBuffer; - -namespace android { - -class GraphicBufferMapper; - -// =========================================================================== -// GraphicBuffer -// =========================================================================== - -class GraphicBuffer - : public ANativeObjectBase< ANativeWindowBuffer, GraphicBuffer, RefBase >, - public Flattenable -{ -public: - - enum { - USAGE_SW_READ_NEVER = GRALLOC_USAGE_SW_READ_NEVER, - USAGE_SW_READ_RARELY = GRALLOC_USAGE_SW_READ_RARELY, - USAGE_SW_READ_OFTEN = GRALLOC_USAGE_SW_READ_OFTEN, - USAGE_SW_READ_MASK = GRALLOC_USAGE_SW_READ_MASK, - - USAGE_SW_WRITE_NEVER = GRALLOC_USAGE_SW_WRITE_NEVER, - USAGE_SW_WRITE_RARELY = GRALLOC_USAGE_SW_WRITE_RARELY, - USAGE_SW_WRITE_OFTEN = GRALLOC_USAGE_SW_WRITE_OFTEN, - USAGE_SW_WRITE_MASK = GRALLOC_USAGE_SW_WRITE_MASK, - - USAGE_SOFTWARE_MASK = USAGE_SW_READ_MASK|USAGE_SW_WRITE_MASK, - - USAGE_PROTECTED = GRALLOC_USAGE_PROTECTED, - - USAGE_HW_TEXTURE = GRALLOC_USAGE_HW_TEXTURE, - USAGE_HW_RENDER = GRALLOC_USAGE_HW_RENDER, - USAGE_HW_2D = GRALLOC_USAGE_HW_2D, - USAGE_HW_COMPOSER = GRALLOC_USAGE_HW_COMPOSER, - USAGE_HW_VIDEO_ENCODER = GRALLOC_USAGE_HW_VIDEO_ENCODER, - USAGE_HW_MASK = GRALLOC_USAGE_HW_MASK - }; - - GraphicBuffer(); - - // creates w * h buffer - GraphicBuffer(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage); - - // create a buffer from an existing handle - GraphicBuffer(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage, - uint32_t stride, native_handle_t* handle, bool keepOwnership); - - // create a buffer from an existing ANativeWindowBuffer - GraphicBuffer(ANativeWindowBuffer* buffer, bool keepOwnership); - - // return status - status_t initCheck() const; - - uint32_t getWidth() const { return width; } - uint32_t getHeight() const { return height; } - uint32_t getStride() const { return stride; } - uint32_t getUsage() const { return usage; } - PixelFormat getPixelFormat() const { return format; } - Rect getBounds() const { return Rect(width, height); } - - status_t reallocate(uint32_t w, uint32_t h, PixelFormat f, uint32_t usage); - - status_t lock(uint32_t usage, void** vaddr); - status_t lock(uint32_t usage, const Rect& rect, void** vaddr); - // For HAL_PIXEL_FORMAT_YCbCr_420_888 - status_t lockYCbCr(uint32_t usage, android_ycbcr *ycbcr); - status_t lockYCbCr(uint32_t usage, const Rect& rect, android_ycbcr *ycbcr); - status_t unlock(); - - ANativeWindowBuffer* getNativeBuffer() const; - - void setIndex(int index); - int getIndex() const; - - // for debugging - static void dumpAllocationsToSystemLog(); - -private: - virtual ~GraphicBuffer(); - - enum { - ownNone = 0, - ownHandle = 1, - ownData = 2, - }; - - inline const GraphicBufferMapper& getBufferMapper() const { - return mBufferMapper; - } - inline GraphicBufferMapper& getBufferMapper() { - return mBufferMapper; - } - uint8_t mOwner; - -private: - friend class Surface; - friend class BpSurface; - friend class BnSurface; - friend class LightRefBase; - GraphicBuffer(const GraphicBuffer& rhs); - GraphicBuffer& operator = (const GraphicBuffer& rhs); - const GraphicBuffer& operator = (const GraphicBuffer& rhs) const; - - status_t initSize(uint32_t w, uint32_t h, PixelFormat format, - uint32_t usage); - - void free_handle(); - - // Flattenable interface - size_t getFlattenedSize() const; - size_t getFdCount() const; - status_t flatten(void* buffer, size_t size, - int fds[], size_t count) const; - status_t unflatten(void const* buffer, size_t size, - int fds[], size_t count); - - - GraphicBufferMapper& mBufferMapper; - ssize_t mInitCheck; - int mIndex; - - // If we're wrapping another buffer then this reference will make sure it - // doesn't get freed. - sp mWrappedBuffer; -}; - -}; // namespace android - -#endif // ANDROID_GRAPHIC_BUFFER_H diff --git a/external/android/include/18/frameworks/native/include/ui/GraphicBufferAllocator.h b/external/android/include/18/frameworks/native/include/ui/GraphicBufferAllocator.h deleted file mode 100644 index dffa788..0000000 --- a/external/android/include/18/frameworks/native/include/ui/GraphicBufferAllocator.h +++ /dev/null @@ -1,96 +0,0 @@ -/* -** -** Copyright 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_BUFFER_ALLOCATOR_H -#define ANDROID_BUFFER_ALLOCATOR_H - -#include - -#include - -#include -#include -#include -#include - -#include - -#include - - -namespace android { -// --------------------------------------------------------------------------- - -class String8; - -class GraphicBufferAllocator : public Singleton -{ -public: - enum { - USAGE_SW_READ_NEVER = GRALLOC_USAGE_SW_READ_NEVER, - USAGE_SW_READ_RARELY = GRALLOC_USAGE_SW_READ_RARELY, - USAGE_SW_READ_OFTEN = GRALLOC_USAGE_SW_READ_OFTEN, - USAGE_SW_READ_MASK = GRALLOC_USAGE_SW_READ_MASK, - - USAGE_SW_WRITE_NEVER = GRALLOC_USAGE_SW_WRITE_NEVER, - USAGE_SW_WRITE_RARELY = GRALLOC_USAGE_SW_WRITE_RARELY, - USAGE_SW_WRITE_OFTEN = GRALLOC_USAGE_SW_WRITE_OFTEN, - USAGE_SW_WRITE_MASK = GRALLOC_USAGE_SW_WRITE_MASK, - - USAGE_SOFTWARE_MASK = USAGE_SW_READ_MASK|USAGE_SW_WRITE_MASK, - - USAGE_HW_TEXTURE = GRALLOC_USAGE_HW_TEXTURE, - USAGE_HW_RENDER = GRALLOC_USAGE_HW_RENDER, - USAGE_HW_2D = GRALLOC_USAGE_HW_2D, - USAGE_HW_MASK = GRALLOC_USAGE_HW_MASK - }; - - static inline GraphicBufferAllocator& get() { return getInstance(); } - - - status_t alloc(uint32_t w, uint32_t h, PixelFormat format, int usage, - buffer_handle_t* handle, int32_t* stride); - - status_t free(buffer_handle_t handle); - - void dump(String8& res) const; - static void dumpToSystemLog(); - -private: - struct alloc_rec_t { - uint32_t w; - uint32_t h; - uint32_t s; - PixelFormat format; - uint32_t usage; - size_t size; - }; - - static Mutex sLock; - static KeyedVector sAllocList; - - friend class Singleton; - GraphicBufferAllocator(); - ~GraphicBufferAllocator(); - - alloc_device_t *mAllocDev; -}; - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_BUFFER_ALLOCATOR_H diff --git a/external/android/include/18/frameworks/native/include/ui/GraphicBufferMapper.h b/external/android/include/18/frameworks/native/include/ui/GraphicBufferMapper.h deleted file mode 100644 index 99d8723..0000000 --- a/external/android/include/18/frameworks/native/include/ui/GraphicBufferMapper.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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_UI_BUFFER_MAPPER_H -#define ANDROID_UI_BUFFER_MAPPER_H - -#include -#include - -#include - -#include - - -struct gralloc_module_t; - -namespace android { - -// --------------------------------------------------------------------------- - -class Rect; - -class GraphicBufferMapper : public Singleton -{ -public: - static inline GraphicBufferMapper& get() { return getInstance(); } - - status_t registerBuffer(buffer_handle_t handle); - - status_t unregisterBuffer(buffer_handle_t handle); - - status_t lock(buffer_handle_t handle, - int usage, const Rect& bounds, void** vaddr); - - status_t lockYCbCr(buffer_handle_t handle, - int usage, const Rect& bounds, android_ycbcr *ycbcr); - - status_t unlock(buffer_handle_t handle); - - // dumps information about the mapping of this handle - void dump(buffer_handle_t handle); - -private: - friend class Singleton; - GraphicBufferMapper(); - gralloc_module_t const *mAllocMod; -}; - -// --------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_UI_BUFFER_MAPPER_H - diff --git a/external/android/include/18/frameworks/native/include/ui/PixelFormat.h b/external/android/include/18/frameworks/native/include/ui/PixelFormat.h deleted file mode 100644 index 9f3e267..0000000 --- a/external/android/include/18/frameworks/native/include/ui/PixelFormat.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// - -// Pixel formats used across the system. -// These formats might not all be supported by all renderers, for instance -// skia or SurfaceFlinger are not required to support all of these formats -// (either as source or destination) - - -#ifndef UI_PIXELFORMAT_H -#define UI_PIXELFORMAT_H - -#include -#include -#include -#include - -namespace android { - -enum { - // - // these constants need to match those - // in graphics/PixelFormat.java & pixelflinger/format.h - // - PIXEL_FORMAT_UNKNOWN = 0, - PIXEL_FORMAT_NONE = 0, - - // logical pixel formats used by the SurfaceFlinger ----------------------- - PIXEL_FORMAT_CUSTOM = -4, - // Custom pixel-format described by a PixelFormatInfo structure - - PIXEL_FORMAT_TRANSLUCENT = -3, - // System chooses a format that supports translucency (many alpha bits) - - PIXEL_FORMAT_TRANSPARENT = -2, - // System chooses a format that supports transparency - // (at least 1 alpha bit) - - PIXEL_FORMAT_OPAQUE = -1, - // System chooses an opaque format (no alpha bits required) - - // real pixel formats supported for rendering ----------------------------- - - PIXEL_FORMAT_RGBA_8888 = HAL_PIXEL_FORMAT_RGBA_8888, // 4x8-bit RGBA - PIXEL_FORMAT_RGBX_8888 = HAL_PIXEL_FORMAT_RGBX_8888, // 4x8-bit RGB0 - PIXEL_FORMAT_RGB_888 = HAL_PIXEL_FORMAT_RGB_888, // 3x8-bit RGB - PIXEL_FORMAT_RGB_565 = HAL_PIXEL_FORMAT_RGB_565, // 16-bit RGB - PIXEL_FORMAT_BGRA_8888 = HAL_PIXEL_FORMAT_BGRA_8888, // 4x8-bit BGRA - PIXEL_FORMAT_RGBA_5551 = HAL_PIXEL_FORMAT_RGBA_5551, // 16-bit ARGB - PIXEL_FORMAT_RGBA_4444 = HAL_PIXEL_FORMAT_RGBA_4444, // 16-bit ARGB - PIXEL_FORMAT_A_8 = 8, // 8-bit A -}; - -typedef int32_t PixelFormat; - -struct PixelFormatInfo { - enum { - INDEX_ALPHA = 0, - INDEX_RED = 1, - INDEX_GREEN = 2, - INDEX_BLUE = 3 - }; - - enum { // components - ALPHA = 1, - RGB = 2, - RGBA = 3, - L = 4, - LA = 5, - OTHER = 0xFF - }; - - struct szinfo { - uint8_t h; - uint8_t l; - }; - - inline PixelFormatInfo() : version(sizeof(PixelFormatInfo)) { } - size_t getScanlineSize(unsigned int width) const; - size_t getSize(size_t ci) const { - return (ci <= 3) ? (cinfo[ci].h - cinfo[ci].l) : 0; - } - size_t version; - PixelFormat format; - size_t bytesPerPixel; - size_t bitsPerPixel; - union { - szinfo cinfo[4]; - struct { - uint8_t h_alpha; - uint8_t l_alpha; - uint8_t h_red; - uint8_t l_red; - uint8_t h_green; - uint8_t l_green; - uint8_t h_blue; - uint8_t l_blue; - }; - }; - uint8_t components; - uint8_t reserved0[3]; - uint32_t reserved1; -}; - -// Consider caching the results of these functions are they're not -// guaranteed to be fast. -ssize_t bytesPerPixel(PixelFormat format); -ssize_t bitsPerPixel(PixelFormat format); -status_t getPixelFormatInfo(PixelFormat format, PixelFormatInfo* info); - -}; // namespace android - -#endif // UI_PIXELFORMAT_H diff --git a/external/android/include/18/frameworks/native/include/ui/Point.h b/external/android/include/18/frameworks/native/include/ui/Point.h deleted file mode 100644 index 1d7f64d..0000000 --- a/external/android/include/18/frameworks/native/include/ui/Point.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (C) 2006 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_UI_POINT -#define ANDROID_UI_POINT - -#include -#include - -namespace android { - -class Point : public LightFlattenablePod -{ -public: - int x; - int y; - - // we don't provide copy-ctor and operator= on purpose - // because we want the compiler generated versions - - // Default constructor doesn't initialize the Point - inline Point() { - } - inline Point(int x, int y) : x(x), y(y) { - } - - inline bool operator == (const Point& rhs) const { - return (x == rhs.x) && (y == rhs.y); - } - inline bool operator != (const Point& rhs) const { - return !operator == (rhs); - } - - inline bool isOrigin() const { - return !(x|y); - } - - // operator < defines an order which allows to use points in sorted - // vectors. - bool operator < (const Point& rhs) const { - return y -#include -#include - -#include - -namespace android { - -class Rect : public ARect, public LightFlattenablePod -{ -public: - typedef ARect::value_type value_type; - - // we don't provide copy-ctor and operator= on purpose - // because we want the compiler generated versions - - inline Rect() { - } - inline Rect(int32_t w, int32_t h) { - left = top = 0; right = w; bottom = h; - } - inline Rect(int32_t l, int32_t t, int32_t r, int32_t b) { - left = l; top = t; right = r; bottom = b; - } - inline Rect(const Point& lt, const Point& rb) { - left = lt.x; top = lt.y; right = rb.x; bottom = rb.y; - } - - void makeInvalid(); - - inline void clear() { - left = top = right = bottom = 0; - } - - // a valid rectangle has a non negative width and height - inline bool isValid() const { - return (width()>=0) && (height()>=0); - } - - // an empty rect has a zero width or height, or is invalid - inline bool isEmpty() const { - return (width()<=0) || (height()<=0); - } - - inline void set(const Rect& rhs) { - operator = (rhs); - } - - // rectangle's width - inline int32_t getWidth() const { - return right-left; - } - - // rectangle's height - inline int32_t getHeight() const { - return bottom-top; - } - - inline Rect getBounds() const { - return Rect(right-left, bottom-top); - } - - inline int32_t width() const { return getWidth(); } - inline int32_t height() const { return getHeight(); } - - void setLeftTop(const Point& lt) { - left = lt.x; - top = lt.y; - } - - void setRightBottom(const Point& rb) { - right = rb.x; - bottom = rb.y; - } - - // the following 4 functions return the 4 corners of the rect as Point - Point leftTop() const { - return Point(left, top); - } - Point rightBottom() const { - return Point(right, bottom); - } - Point rightTop() const { - return Point(right, top); - } - Point leftBottom() const { - return Point(left, bottom); - } - - // comparisons - inline bool operator == (const Rect& rhs) const { - return (left == rhs.left) && (top == rhs.top) && - (right == rhs.right) && (bottom == rhs.bottom); - } - - inline bool operator != (const Rect& rhs) const { - return !operator == (rhs); - } - - // operator < defines an order which allows to use rectangles in sorted - // vectors. - bool operator < (const Rect& rhs) const; - - Rect& offsetToOrigin() { - right -= left; - bottom -= top; - left = top = 0; - return *this; - } - Rect& offsetTo(const Point& p) { - return offsetTo(p.x, p.y); - } - Rect& offsetBy(const Point& dp) { - return offsetBy(dp.x, dp.y); - } - Rect& operator += (const Point& rhs) { - return offsetBy(rhs.x, rhs.y); - } - Rect& operator -= (const Point& rhs) { - return offsetBy(-rhs.x, -rhs.y); - } - const Rect operator + (const Point& rhs) const; - const Rect operator - (const Point& rhs) const; - - void translate(int32_t dx, int32_t dy) { // legacy, don't use. - offsetBy(dx, dy); - } - - Rect& offsetTo(int32_t x, int32_t y); - Rect& offsetBy(int32_t x, int32_t y); - bool intersect(const Rect& with, Rect* result) const; - - // Create a new Rect by transforming this one using a graphics HAL - // transform. This rectangle is defined in a coordinate space starting at - // the origin and extending to (width, height). If the transform includes - // a ROT90 then the output rectangle is defined in a space extending to - // (height, width). Otherwise the output rectangle is in the same space as - // the input. - Rect transform(uint32_t xform, int32_t width, int32_t height) const; -}; - -ANDROID_BASIC_TYPES_TRAITS(Rect) - -}; // namespace android - -#endif // ANDROID_UI_RECT diff --git a/external/android/include/18/frameworks/native/include/ui/Region.h b/external/android/include/18/frameworks/native/include/ui/Region.h deleted file mode 100644 index ce91f3b..0000000 --- a/external/android/include/18/frameworks/native/include/ui/Region.h +++ /dev/null @@ -1,217 +0,0 @@ -/* - * 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_UI_REGION_H -#define ANDROID_UI_REGION_H - -#include -#include - -#include - -#include -#include - -namespace android { -// --------------------------------------------------------------------------- - -class SharedBuffer; -class String8; - -// --------------------------------------------------------------------------- -class Region : public LightFlattenable -{ -public: - Region(); - Region(const Region& rhs); - explicit Region(const Rect& rhs); - ~Region(); - - static Region createTJunctionFreeRegion(const Region& r); - - Region& operator = (const Region& rhs); - - inline bool isEmpty() const { return getBounds().isEmpty(); } - inline bool isRect() const { return mStorage.size() == 1; } - - inline Rect getBounds() const { return mStorage[mStorage.size() - 1]; } - inline Rect bounds() const { return getBounds(); } - - // the region becomes its bounds - Region& makeBoundsSelf(); - - void clear(); - void set(const Rect& r); - void set(uint32_t w, uint32_t h); - - Region& orSelf(const Rect& rhs); - Region& xorSelf(const Rect& rhs); - Region& andSelf(const Rect& rhs); - Region& subtractSelf(const Rect& rhs); - - // boolean operators, applied on this - Region& orSelf(const Region& rhs); - Region& xorSelf(const Region& rhs); - Region& andSelf(const Region& rhs); - Region& subtractSelf(const Region& rhs); - - // boolean operators - const Region merge(const Rect& rhs) const; - const Region mergeExclusive(const Rect& rhs) const; - const Region intersect(const Rect& rhs) const; - const Region subtract(const Rect& rhs) const; - - // boolean operators - const Region merge(const Region& rhs) const; - const Region mergeExclusive(const Region& rhs) const; - const Region intersect(const Region& rhs) const; - const Region subtract(const Region& rhs) const; - - // these translate rhs first - Region& translateSelf(int dx, int dy); - Region& orSelf(const Region& rhs, int dx, int dy); - Region& xorSelf(const Region& rhs, int dx, int dy); - Region& andSelf(const Region& rhs, int dx, int dy); - Region& subtractSelf(const Region& rhs, int dx, int dy); - - // these translate rhs first - const Region translate(int dx, int dy) const; - const Region merge(const Region& rhs, int dx, int dy) const; - const Region mergeExclusive(const Region& rhs, int dx, int dy) const; - const Region intersect(const Region& rhs, int dx, int dy) const; - const Region subtract(const Region& rhs, int dx, int dy) const; - - // convenience operators overloads - inline const Region operator | (const Region& rhs) const; - inline const Region operator ^ (const Region& rhs) const; - inline const Region operator & (const Region& rhs) const; - inline const Region operator - (const Region& rhs) const; - inline const Region operator + (const Point& pt) const; - - inline Region& operator |= (const Region& rhs); - inline Region& operator ^= (const Region& rhs); - inline Region& operator &= (const Region& rhs); - inline Region& operator -= (const Region& rhs); - inline Region& operator += (const Point& pt); - - - // returns true if the regions share the same underlying storage - bool isTriviallyEqual(const Region& region) const; - - - /* various ways to access the rectangle list */ - - - // STL-like iterators - typedef Rect const* const_iterator; - const_iterator begin() const; - const_iterator end() const; - - // returns an array of rect which has the same life-time has this - // Region object. - Rect const* getArray(size_t* count) const; - - // returns a SharedBuffer as well as the number of rects. - // ownership is transfered to the caller. - // the caller must call SharedBuffer::release() to free the memory. - SharedBuffer const* getSharedBuffer(size_t* count) const; - - /* no user serviceable parts here... */ - - // add a rectangle to the internal list. This rectangle must - // be sorted in Y and X and must not make the region invalid. - void addRectUnchecked(int l, int t, int r, int b); - - inline bool isFixedSize() const { return false; } - size_t getSize() const; - status_t flatten(void* buffer) const; - status_t unflatten(void const* buffer, size_t size); - - void dump(String8& out, const char* what, uint32_t flags=0) const; - void dump(const char* what, uint32_t flags=0) const; - -private: - class rasterizer; - friend class rasterizer; - - Region& operationSelf(const Rect& r, int op); - Region& operationSelf(const Region& r, int op); - Region& operationSelf(const Region& r, int dx, int dy, int op); - const Region operation(const Rect& rhs, int op) const; - const Region operation(const Region& rhs, int op) const; - const Region operation(const Region& rhs, int dx, int dy, int op) const; - - static void boolean_operation(int op, Region& dst, - const Region& lhs, const Region& rhs, int dx, int dy); - static void boolean_operation(int op, Region& dst, - const Region& lhs, const Rect& rhs, int dx, int dy); - - static void boolean_operation(int op, Region& dst, - const Region& lhs, const Region& rhs); - static void boolean_operation(int op, Region& dst, - const Region& lhs, const Rect& rhs); - - static void translate(Region& reg, int dx, int dy); - static void translate(Region& dst, const Region& reg, int dx, int dy); - - static bool validate(const Region& reg, - const char* name, bool silent = false); - - // mStorage is a (manually) sorted array of Rects describing the region - // with an extra Rect as the last element which is set to the - // bounds of the region. However, if the region is - // a simple Rect then mStorage contains only that rect. - Vector mStorage; -}; - - -const Region Region::operator | (const Region& rhs) const { - return merge(rhs); -} -const Region Region::operator ^ (const Region& rhs) const { - return mergeExclusive(rhs); -} -const Region Region::operator & (const Region& rhs) const { - return intersect(rhs); -} -const Region Region::operator - (const Region& rhs) const { - return subtract(rhs); -} -const Region Region::operator + (const Point& pt) const { - return translate(pt.x, pt.y); -} - - -Region& Region::operator |= (const Region& rhs) { - return orSelf(rhs); -} -Region& Region::operator ^= (const Region& rhs) { - return xorSelf(rhs); -} -Region& Region::operator &= (const Region& rhs) { - return andSelf(rhs); -} -Region& Region::operator -= (const Region& rhs) { - return subtractSelf(rhs); -} -Region& Region::operator += (const Point& pt) { - return translateSelf(pt.x, pt.y); -} -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_UI_REGION_H - diff --git a/external/android/include/18/frameworks/native/include/ui/UiConfig.h b/external/android/include/18/frameworks/native/include/ui/UiConfig.h deleted file mode 100644 index fcf8ed5..0000000 --- a/external/android/include/18/frameworks/native/include/ui/UiConfig.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2012 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_UI_CONFIG_H -#define ANDROID_UI_CONFIG_H - -#include - -namespace android { - -// Append the libui configuration details to configStr. -void appendUiConfigString(String8& configStr); - -}; // namespace android - -#endif /*ANDROID_UI_CONFIG_H*/ diff --git a/external/android/include/18/frameworks/native/include/utils/AndroidThreads.h b/external/android/include/18/frameworks/native/include/utils/AndroidThreads.h deleted file mode 100644 index 4eee14d..0000000 --- a/external/android/include/18/frameworks/native/include/utils/AndroidThreads.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * 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 _LIBS_UTILS_ANDROID_THREADS_H -#define _LIBS_UTILS_ANDROID_THREADS_H - -#include -#include - -#if defined(HAVE_PTHREADS) -# include -#endif - -#include - -// --------------------------------------------------------------------------- -// C API - -#ifdef __cplusplus -extern "C" { -#endif - -// Create and run a new thread. -extern int androidCreateThread(android_thread_func_t, void *); - -// Create thread with lots of parameters -extern int androidCreateThreadEtc(android_thread_func_t entryFunction, - void *userData, - const char* threadName, - int32_t threadPriority, - size_t threadStackSize, - android_thread_id_t *threadId); - -// Get some sort of unique identifier for the current thread. -extern android_thread_id_t androidGetThreadId(); - -// Low-level thread creation -- never creates threads that can -// interact with the Java VM. -extern int androidCreateRawThreadEtc(android_thread_func_t entryFunction, - void *userData, - const char* threadName, - int32_t threadPriority, - size_t threadStackSize, - android_thread_id_t *threadId); - -// set the same of the running thread -extern void androidSetThreadName(const char* name); - -// Used by the Java Runtime to control how threads are created, so that -// they can be proper and lovely Java threads. -typedef int (*android_create_thread_fn)(android_thread_func_t entryFunction, - void *userData, - const char* threadName, - int32_t threadPriority, - size_t threadStackSize, - android_thread_id_t *threadId); - -extern void androidSetCreateThreadFunc(android_create_thread_fn func); - -// ------------------------------------------------------------------ -// Extra functions working with raw pids. - -// Get pid for the current thread. -extern pid_t androidGetTid(); - -#ifdef HAVE_ANDROID_OS -// Change the priority AND scheduling group of a particular thread. The priority -// should be one of the ANDROID_PRIORITY constants. Returns INVALID_OPERATION -// if the priority set failed, else another value if just the group set failed; -// in either case errno is set. Thread ID zero means current thread. -extern int androidSetThreadPriority(pid_t tid, int prio); - -// Get the current priority of a particular thread. Returns one of the -// ANDROID_PRIORITY constants or a negative result in case of error. -extern int androidGetThreadPriority(pid_t tid); -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -// ---------------------------------------------------------------------------- -// C++ API -#ifdef __cplusplus -namespace android { -// ---------------------------------------------------------------------------- - -// Create and run a new thread. -inline bool createThread(thread_func_t f, void *a) { - return androidCreateThread(f, a) ? true : false; -} - -// Create thread with lots of parameters -inline bool createThreadEtc(thread_func_t entryFunction, - void *userData, - const char* threadName = "android:unnamed_thread", - int32_t threadPriority = PRIORITY_DEFAULT, - size_t threadStackSize = 0, - thread_id_t *threadId = 0) -{ - return androidCreateThreadEtc(entryFunction, userData, threadName, - threadPriority, threadStackSize, threadId) ? true : false; -} - -// Get some sort of unique identifier for the current thread. -inline thread_id_t getThreadId() { - return androidGetThreadId(); -} - -// ---------------------------------------------------------------------------- -}; // namespace android -#endif // __cplusplus -// ---------------------------------------------------------------------------- - -#endif // _LIBS_UTILS_ANDROID_THREADS_H diff --git a/external/android/include/18/frameworks/native/include/utils/Atomic.h b/external/android/include/18/frameworks/native/include/utils/Atomic.h deleted file mode 100644 index 7eb476c..0000000 --- a/external/android/include/18/frameworks/native/include/utils/Atomic.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2005 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_UTILS_ATOMIC_H -#define ANDROID_UTILS_ATOMIC_H - -#include - -#endif // ANDROID_UTILS_ATOMIC_H diff --git a/external/android/include/18/frameworks/native/include/utils/BasicHashtable.h b/external/android/include/18/frameworks/native/include/utils/BasicHashtable.h deleted file mode 100644 index 7a6c96c..0000000 --- a/external/android/include/18/frameworks/native/include/utils/BasicHashtable.h +++ /dev/null @@ -1,401 +0,0 @@ -/* - * Copyright (C) 2011 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_BASIC_HASHTABLE_H -#define ANDROID_BASIC_HASHTABLE_H - -#include -#include -#include -#include - -namespace android { - -/* Implementation type. Nothing to see here. */ -class BasicHashtableImpl { -protected: - struct Bucket { - // The collision flag indicates that the bucket is part of a collision chain - // such that at least two entries both hash to this bucket. When true, we - // may need to seek further along the chain to find the entry. - static const uint32_t COLLISION = 0x80000000UL; - - // The present flag indicates that the bucket contains an initialized entry value. - static const uint32_t PRESENT = 0x40000000UL; - - // Mask for 30 bits worth of the hash code that are stored within the bucket to - // speed up lookups and rehashing by eliminating the need to recalculate the - // hash code of the entry's key. - static const uint32_t HASH_MASK = 0x3fffffffUL; - - // Combined value that stores the collision and present flags as well as - // a 30 bit hash code. - uint32_t cookie; - - // Storage for the entry begins here. - char entry[0]; - }; - - BasicHashtableImpl(size_t entrySize, bool hasTrivialDestructor, - size_t minimumInitialCapacity, float loadFactor); - BasicHashtableImpl(const BasicHashtableImpl& other); - - void dispose(); - - inline void edit() { - if (mBuckets && !SharedBuffer::bufferFromData(mBuckets)->onlyOwner()) { - clone(); - } - } - - void setTo(const BasicHashtableImpl& other); - void clear(); - - ssize_t next(ssize_t index) const; - ssize_t find(ssize_t index, hash_t hash, const void* __restrict__ key) const; - size_t add(hash_t hash, const void* __restrict__ entry); - void removeAt(size_t index); - void rehash(size_t minimumCapacity, float loadFactor); - - const size_t mBucketSize; // number of bytes per bucket including the entry - const bool mHasTrivialDestructor; // true if the entry type does not require destruction - size_t mCapacity; // number of buckets that can be filled before exceeding load factor - float mLoadFactor; // load factor - size_t mSize; // number of elements actually in the table - size_t mFilledBuckets; // number of buckets for which collision or present is true - size_t mBucketCount; // number of slots in the mBuckets array - void* mBuckets; // array of buckets, as a SharedBuffer - - inline const Bucket& bucketAt(const void* __restrict__ buckets, size_t index) const { - return *reinterpret_cast( - static_cast(buckets) + index * mBucketSize); - } - - inline Bucket& bucketAt(void* __restrict__ buckets, size_t index) const { - return *reinterpret_cast(static_cast(buckets) + index * mBucketSize); - } - - virtual bool compareBucketKey(const Bucket& bucket, const void* __restrict__ key) const = 0; - virtual void initializeBucketEntry(Bucket& bucket, const void* __restrict__ entry) const = 0; - virtual void destroyBucketEntry(Bucket& bucket) const = 0; - -private: - void clone(); - - // Allocates a bucket array as a SharedBuffer. - void* allocateBuckets(size_t count) const; - - // Releases a bucket array's associated SharedBuffer. - void releaseBuckets(void* __restrict__ buckets, size_t count) const; - - // Destroys the contents of buckets (invokes destroyBucketEntry for each - // populated bucket if needed). - void destroyBuckets(void* __restrict__ buckets, size_t count) const; - - // Copies the content of buckets (copies the cookie and invokes copyBucketEntry - // for each populated bucket if needed). - void copyBuckets(const void* __restrict__ fromBuckets, - void* __restrict__ toBuckets, size_t count) const; - - // Determines the appropriate size of a bucket array to store a certain minimum - // number of entries and returns its effective capacity. - static void determineCapacity(size_t minimumCapacity, float loadFactor, - size_t* __restrict__ outBucketCount, size_t* __restrict__ outCapacity); - - // Trim a hash code to 30 bits to match what we store in the bucket's cookie. - inline static hash_t trimHash(hash_t hash) { - return (hash & Bucket::HASH_MASK) ^ (hash >> 30); - } - - // Returns the index of the first bucket that is in the collision chain - // for the specified hash code, given the total number of buckets. - // (Primary hash) - inline static size_t chainStart(hash_t hash, size_t count) { - return hash % count; - } - - // Returns the increment to add to a bucket index to seek to the next bucket - // in the collision chain for the specified hash code, given the total number of buckets. - // (Secondary hash) - inline static size_t chainIncrement(hash_t hash, size_t count) { - return ((hash >> 7) | (hash << 25)) % (count - 1) + 1; - } - - // Returns the index of the next bucket that is in the collision chain - // that is defined by the specified increment, given the total number of buckets. - inline static size_t chainSeek(size_t index, size_t increment, size_t count) { - return (index + increment) % count; - } -}; - -/* - * A BasicHashtable stores entries that are indexed by hash code in place - * within an array. The basic operations are finding entries by key, - * adding new entries and removing existing entries. - * - * This class provides a very limited set of operations with simple semantics. - * It is intended to be used as a building block to construct more complex - * and interesting data structures such as HashMap. Think very hard before - * adding anything extra to BasicHashtable, it probably belongs at a - * higher level of abstraction. - * - * TKey: The key type. - * TEntry: The entry type which is what is actually stored in the array. - * - * TKey must support the following contract: - * bool operator==(const TKey& other) const; // return true if equal - * bool operator!=(const TKey& other) const; // return true if unequal - * - * TEntry must support the following contract: - * const TKey& getKey() const; // get the key from the entry - * - * This class supports storing entries with duplicate keys. Of course, it can't - * tell them apart during removal so only the first entry will be removed. - * We do this because it means that operations like add() can't fail. - */ -template -class BasicHashtable : private BasicHashtableImpl { -public: - /* Creates a hashtable with the specified minimum initial capacity. - * The underlying array will be created when the first entry is added. - * - * minimumInitialCapacity: The minimum initial capacity for the hashtable. - * Default is 0. - * loadFactor: The desired load factor for the hashtable, between 0 and 1. - * Default is 0.75. - */ - BasicHashtable(size_t minimumInitialCapacity = 0, float loadFactor = 0.75f); - - /* Copies a hashtable. - * The underlying storage is shared copy-on-write. - */ - BasicHashtable(const BasicHashtable& other); - - /* Clears and destroys the hashtable. - */ - virtual ~BasicHashtable(); - - /* Making this hashtable a copy of the other hashtable. - * The underlying storage is shared copy-on-write. - * - * other: The hashtable to copy. - */ - inline BasicHashtable& operator =(const BasicHashtable & other) { - setTo(other); - return *this; - } - - /* Returns the number of entries in the hashtable. - */ - inline size_t size() const { - return mSize; - } - - /* Returns the capacity of the hashtable, which is the number of elements that can - * added to the hashtable without requiring it to be grown. - */ - inline size_t capacity() const { - return mCapacity; - } - - /* Returns the number of buckets that the hashtable has, which is the size of its - * underlying array. - */ - inline size_t bucketCount() const { - return mBucketCount; - } - - /* Returns the load factor of the hashtable. */ - inline float loadFactor() const { - return mLoadFactor; - }; - - /* Returns a const reference to the entry at the specified index. - * - * index: The index of the entry to retrieve. Must be a valid index within - * the bounds of the hashtable. - */ - inline const TEntry& entryAt(size_t index) const { - return entryFor(bucketAt(mBuckets, index)); - } - - /* Returns a non-const reference to the entry at the specified index. - * - * index: The index of the entry to edit. Must be a valid index within - * the bounds of the hashtable. - */ - inline TEntry& editEntryAt(size_t index) { - edit(); - return entryFor(bucketAt(mBuckets, index)); - } - - /* Clears the hashtable. - * All entries in the hashtable are destroyed immediately. - * If you need to do something special with the entries in the hashtable then iterate - * over them and do what you need before clearing the hashtable. - */ - inline void clear() { - BasicHashtableImpl::clear(); - } - - /* Returns the index of the next entry in the hashtable given the index of a previous entry. - * If the given index is -1, then returns the index of the first entry in the hashtable, - * if there is one, or -1 otherwise. - * If the given index is not -1, then returns the index of the next entry in the hashtable, - * in strictly increasing order, or -1 if there are none left. - * - * index: The index of the previous entry that was iterated, or -1 to begin - * iteration at the beginning of the hashtable. - */ - inline ssize_t next(ssize_t index) const { - return BasicHashtableImpl::next(index); - } - - /* Finds the index of an entry with the specified key. - * If the given index is -1, then returns the index of the first matching entry, - * otherwise returns the index of the next matching entry. - * If the hashtable contains multiple entries with keys that match the requested - * key, then the sequence of entries returned is arbitrary. - * Returns -1 if no entry was found. - * - * index: The index of the previous entry with the specified key, or -1 to - * find the first matching entry. - * hash: The hashcode of the key. - * key: The key. - */ - inline ssize_t find(ssize_t index, hash_t hash, const TKey& key) const { - return BasicHashtableImpl::find(index, hash, &key); - } - - /* Adds the entry to the hashtable. - * Returns the index of the newly added entry. - * If an entry with the same key already exists, then a duplicate entry is added. - * If the entry will not fit, then the hashtable's capacity is increased and - * its contents are rehashed. See rehash(). - * - * hash: The hashcode of the key. - * entry: The entry to add. - */ - inline size_t add(hash_t hash, const TEntry& entry) { - return BasicHashtableImpl::add(hash, &entry); - } - - /* Removes the entry with the specified index from the hashtable. - * The entry is destroyed immediately. - * The index must be valid. - * - * The hashtable is not compacted after an item is removed, so it is legal - * to continue iterating over the hashtable using next() or find(). - * - * index: The index of the entry to remove. Must be a valid index within the - * bounds of the hashtable, and it must refer to an existing entry. - */ - inline void removeAt(size_t index) { - BasicHashtableImpl::removeAt(index); - } - - /* Rehashes the contents of the hashtable. - * Grows the hashtable to at least the specified minimum capacity or the - * current number of elements, whichever is larger. - * - * Rehashing causes all entries to be copied and the entry indices may change. - * Although the hash codes are cached by the hashtable, rehashing can be an - * expensive operation and should be avoided unless the hashtable's size - * needs to be changed. - * - * Rehashing is the only way to change the capacity or load factor of the - * hashtable once it has been created. It can be used to compact the - * hashtable by choosing a minimum capacity that is smaller than the current - * capacity (such as 0). - * - * minimumCapacity: The desired minimum capacity after rehashing. - * loadFactor: The desired load factor after rehashing. - */ - inline void rehash(size_t minimumCapacity, float loadFactor) { - BasicHashtableImpl::rehash(minimumCapacity, loadFactor); - } - - /* Determines whether there is room to add another entry without rehashing. - * When this returns true, a subsequent add() operation is guaranteed to - * complete without performing a rehash. - */ - inline bool hasMoreRoom() const { - return mCapacity > mFilledBuckets; - } - -protected: - static inline const TEntry& entryFor(const Bucket& bucket) { - return reinterpret_cast(bucket.entry); - } - - static inline TEntry& entryFor(Bucket& bucket) { - return reinterpret_cast(bucket.entry); - } - - virtual bool compareBucketKey(const Bucket& bucket, const void* __restrict__ key) const; - virtual void initializeBucketEntry(Bucket& bucket, const void* __restrict__ entry) const; - virtual void destroyBucketEntry(Bucket& bucket) const; - -private: - // For dumping the raw contents of a hashtable during testing. - friend class BasicHashtableTest; - inline uint32_t cookieAt(size_t index) const { - return bucketAt(mBuckets, index).cookie; - } -}; - -template -BasicHashtable::BasicHashtable(size_t minimumInitialCapacity, float loadFactor) : - BasicHashtableImpl(sizeof(TEntry), traits::has_trivial_dtor, - minimumInitialCapacity, loadFactor) { -} - -template -BasicHashtable::BasicHashtable(const BasicHashtable& other) : - BasicHashtableImpl(other) { -} - -template -BasicHashtable::~BasicHashtable() { - dispose(); -} - -template -bool BasicHashtable::compareBucketKey(const Bucket& bucket, - const void* __restrict__ key) const { - return entryFor(bucket).getKey() == *static_cast(key); -} - -template -void BasicHashtable::initializeBucketEntry(Bucket& bucket, - const void* __restrict__ entry) const { - if (!traits::has_trivial_copy) { - new (&entryFor(bucket)) TEntry(*(static_cast(entry))); - } else { - memcpy(&entryFor(bucket), entry, sizeof(TEntry)); - } -} - -template -void BasicHashtable::destroyBucketEntry(Bucket& bucket) const { - if (!traits::has_trivial_dtor) { - entryFor(bucket).~TEntry(); - } -} - -}; // namespace android - -#endif // ANDROID_BASIC_HASHTABLE_H diff --git a/external/android/include/18/frameworks/native/include/utils/BitSet.h b/external/android/include/18/frameworks/native/include/utils/BitSet.h deleted file mode 100644 index e189d0c..0000000 --- a/external/android/include/18/frameworks/native/include/utils/BitSet.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 2010 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 UTILS_BITSET_H -#define UTILS_BITSET_H - -#include -#include - -/* - * Contains some bit manipulation helpers. - */ - -namespace android { - -// A simple set of 32 bits that can be individually marked or cleared. -struct BitSet32 { - uint32_t value; - - inline BitSet32() : value(0) { } - explicit inline BitSet32(uint32_t value) : value(value) { } - - // Gets the value associated with a particular bit index. - static inline uint32_t valueForBit(uint32_t n) { return 0x80000000 >> n; } - - // Clears the bit set. - inline void clear() { value = 0; } - - // Returns the number of marked bits in the set. - inline uint32_t count() const { return __builtin_popcount(value); } - - // Returns true if the bit set does not contain any marked bits. - inline bool isEmpty() const { return ! value; } - - // Returns true if the bit set does not contain any unmarked bits. - inline bool isFull() const { return value == 0xffffffff; } - - // Returns true if the specified bit is marked. - inline bool hasBit(uint32_t n) const { return value & valueForBit(n); } - - // Marks the specified bit. - inline void markBit(uint32_t n) { value |= valueForBit(n); } - - // Clears the specified bit. - inline void clearBit(uint32_t n) { value &= ~ valueForBit(n); } - - // Finds the first marked bit in the set. - // Result is undefined if all bits are unmarked. - inline uint32_t firstMarkedBit() const { return __builtin_clz(value); } - - // Finds the first unmarked bit in the set. - // Result is undefined if all bits are marked. - inline uint32_t firstUnmarkedBit() const { return __builtin_clz(~ value); } - - // Finds the last marked bit in the set. - // Result is undefined if all bits are unmarked. - inline uint32_t lastMarkedBit() const { return 31 - __builtin_ctz(value); } - - // Finds the first marked bit in the set and clears it. Returns the bit index. - // Result is undefined if all bits are unmarked. - inline uint32_t clearFirstMarkedBit() { - uint32_t n = firstMarkedBit(); - clearBit(n); - return n; - } - - // Finds the first unmarked bit in the set and marks it. Returns the bit index. - // Result is undefined if all bits are marked. - inline uint32_t markFirstUnmarkedBit() { - uint32_t n = firstUnmarkedBit(); - markBit(n); - return n; - } - - // Finds the last marked bit in the set and clears it. Returns the bit index. - // Result is undefined if all bits are unmarked. - inline uint32_t clearLastMarkedBit() { - uint32_t n = lastMarkedBit(); - clearBit(n); - return n; - } - - // Gets the index of the specified bit in the set, which is the number of - // marked bits that appear before the specified bit. - inline uint32_t getIndexOfBit(uint32_t n) const { - return __builtin_popcount(value & ~(0xffffffffUL >> n)); - } - - inline bool operator== (const BitSet32& other) const { return value == other.value; } - inline bool operator!= (const BitSet32& other) const { return value != other.value; } -}; - -ANDROID_BASIC_TYPES_TRAITS(BitSet32) - -} // namespace android - -#endif // UTILS_BITSET_H diff --git a/external/android/include/18/frameworks/native/include/utils/BlobCache.h b/external/android/include/18/frameworks/native/include/utils/BlobCache.h deleted file mode 100644 index 4f342a2..0000000 --- a/external/android/include/18/frameworks/native/include/utils/BlobCache.h +++ /dev/null @@ -1,251 +0,0 @@ -/* - ** Copyright 2011, 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_BLOB_CACHE_H -#define ANDROID_BLOB_CACHE_H - -#include - -#include -#include -#include -#include - -namespace android { - -// A BlobCache is an in-memory cache for binary key/value pairs. A BlobCache -// does NOT provide any thread-safety guarantees. -// -// The cache contents can be serialized to an in-memory buffer or mmap'd file -// and then reloaded in a subsequent execution of the program. This -// serialization is non-portable and the data should only be used by the device -// that generated it. -class BlobCache : public RefBase, public Flattenable { -public: - - // Create an empty blob cache. The blob cache will cache key/value pairs - // with key and value sizes less than or equal to maxKeySize and - // maxValueSize, respectively. The total combined size of ALL cache entries - // (key sizes plus value sizes) will not exceed maxTotalSize. - BlobCache(size_t maxKeySize, size_t maxValueSize, size_t maxTotalSize); - - // set inserts a new binary value into the cache and associates it with the - // given binary key. If the key or value are too large for the cache then - // the cache remains unchanged. This includes the case where a different - // value was previously associated with the given key - the old value will - // remain in the cache. If the given key and value are small enough to be - // put in the cache (based on the maxKeySize, maxValueSize, and maxTotalSize - // values specified to the BlobCache constructor), then the key/value pair - // will be in the cache after set returns. Note, however, that a subsequent - // call to set may evict old key/value pairs from the cache. - // - // Preconditions: - // key != NULL - // 0 < keySize - // value != NULL - // 0 < valueSize - void set(const void* key, size_t keySize, const void* value, - size_t valueSize); - - // get retrieves from the cache the binary value associated with a given - // binary key. If the key is present in the cache then the length of the - // binary value associated with that key is returned. If the value argument - // is non-NULL and the size of the cached value is less than valueSize bytes - // then the cached value is copied into the buffer pointed to by the value - // argument. If the key is not present in the cache then 0 is returned and - // the buffer pointed to by the value argument is not modified. - // - // Note that when calling get multiple times with the same key, the later - // calls may fail, returning 0, even if earlier calls succeeded. The return - // value must be checked for each call. - // - // Preconditions: - // key != NULL - // 0 < keySize - // 0 <= valueSize - size_t get(const void* key, size_t keySize, void* value, size_t valueSize); - - // getFlattenedSize returns the number of bytes needed to store the entire - // serialized cache. - virtual size_t getFlattenedSize() const; - - // getFdCount returns the number of file descriptors that will result from - // flattening the cache. This will always return 0 so as to allow the - // flattened cache to be saved to disk and then later restored. - virtual size_t getFdCount() const; - - // flatten serializes the current contents of the cache into the memory - // pointed to by 'buffer'. The serialized cache contents can later be - // loaded into a BlobCache object using the unflatten method. The contents - // of the BlobCache object will not be modified. - // - // Preconditions: - // size >= this.getFlattenedSize() - // count == 0 - virtual status_t flatten(void* buffer, size_t size, int fds[], - size_t count) const; - - // unflatten replaces the contents of the cache with the serialized cache - // contents in the memory pointed to by 'buffer'. The previous contents of - // the BlobCache will be evicted from the cache. If an error occurs while - // unflattening the serialized cache contents then the BlobCache will be - // left in an empty state. - // - // Preconditions: - // count == 0 - virtual status_t unflatten(void const* buffer, size_t size, int fds[], - size_t count); - -private: - // Copying is disallowed. - BlobCache(const BlobCache&); - void operator=(const BlobCache&); - - // A random function helper to get around MinGW not having nrand48() - long int blob_random(); - - // clean evicts a randomly chosen set of entries from the cache such that - // the total size of all remaining entries is less than mMaxTotalSize/2. - void clean(); - - // isCleanable returns true if the cache is full enough for the clean method - // to have some effect, and false otherwise. - bool isCleanable() const; - - // A Blob is an immutable sized unstructured data blob. - class Blob : public RefBase { - public: - Blob(const void* data, size_t size, bool copyData); - ~Blob(); - - bool operator<(const Blob& rhs) const; - - const void* getData() const; - size_t getSize() const; - - private: - // Copying is not allowed. - Blob(const Blob&); - void operator=(const Blob&); - - // mData points to the buffer containing the blob data. - const void* mData; - - // mSize is the size of the blob data in bytes. - size_t mSize; - - // mOwnsData indicates whether or not this Blob object should free the - // memory pointed to by mData when the Blob gets destructed. - bool mOwnsData; - }; - - // A CacheEntry is a single key/value pair in the cache. - class CacheEntry { - public: - CacheEntry(); - CacheEntry(const sp& key, const sp& value); - CacheEntry(const CacheEntry& ce); - - bool operator<(const CacheEntry& rhs) const; - const CacheEntry& operator=(const CacheEntry&); - - sp getKey() const; - sp getValue() const; - - void setValue(const sp& value); - - private: - - // mKey is the key that identifies the cache entry. - sp mKey; - - // mValue is the cached data associated with the key. - sp mValue; - }; - - // A Header is the header for the entire BlobCache serialization format. No - // need to make this portable, so we simply write the struct out. - struct Header { - // mMagicNumber is the magic number that identifies the data as - // serialized BlobCache contents. It must always contain 'Blb$'. - uint32_t mMagicNumber; - - // mBlobCacheVersion is the serialization format version. - uint32_t mBlobCacheVersion; - - // mDeviceVersion is the device-specific version of the cache. This can - // be used to invalidate the cache. - uint32_t mDeviceVersion; - - // mNumEntries is number of cache entries following the header in the - // data. - size_t mNumEntries; - }; - - // An EntryHeader is the header for a serialized cache entry. No need to - // make this portable, so we simply write the struct out. Each EntryHeader - // is followed imediately by the key data and then the value data. - // - // The beginning of each serialized EntryHeader is 4-byte aligned, so the - // number of bytes that a serialized cache entry will occupy is: - // - // ((sizeof(EntryHeader) + keySize + valueSize) + 3) & ~3 - // - struct EntryHeader { - // mKeySize is the size of the entry key in bytes. - size_t mKeySize; - - // mValueSize is the size of the entry value in bytes. - size_t mValueSize; - - // mData contains both the key and value data for the cache entry. The - // key comes first followed immediately by the value. - uint8_t mData[]; - }; - - // mMaxKeySize is the maximum key size that will be cached. Calls to - // BlobCache::set with a keySize parameter larger than mMaxKeySize will - // simply not add the key/value pair to the cache. - const size_t mMaxKeySize; - - // mMaxValueSize is the maximum value size that will be cached. Calls to - // BlobCache::set with a valueSize parameter larger than mMaxValueSize will - // simply not add the key/value pair to the cache. - const size_t mMaxValueSize; - - // mMaxTotalSize is the maximum size that all cache entries can occupy. This - // includes space for both keys and values. When a call to BlobCache::set - // would otherwise cause this limit to be exceeded, either the key/value - // pair passed to BlobCache::set will not be cached or other cache entries - // will be evicted from the cache to make room for the new entry. - const size_t mMaxTotalSize; - - // mTotalSize is the total combined size of all keys and values currently in - // the cache. - size_t mTotalSize; - - // mRandState is the pseudo-random number generator state. It is passed to - // nrand48 to generate random numbers when needed. - unsigned short mRandState[3]; - - // mCacheEntries stores all the cache entries that are resident in memory. - // Cache entries are added to it by the 'set' method. - SortedVector mCacheEntries; -}; - -} - -#endif // ANDROID_BLOB_CACHE_H diff --git a/external/android/include/18/frameworks/native/include/utils/BufferedTextOutput.h b/external/android/include/18/frameworks/native/include/utils/BufferedTextOutput.h deleted file mode 100644 index 69c6240..0000000 --- a/external/android/include/18/frameworks/native/include/utils/BufferedTextOutput.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2006 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_BUFFEREDTEXTOUTPUT_H -#define ANDROID_BUFFEREDTEXTOUTPUT_H - -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -class BufferedTextOutput : public TextOutput -{ -public: - //** Flags for constructor */ - enum { - MULTITHREADED = 0x0001 - }; - - BufferedTextOutput(uint32_t flags = 0); - virtual ~BufferedTextOutput(); - - virtual status_t print(const char* txt, size_t len); - virtual void moveIndent(int delta); - - virtual void pushBundle(); - virtual void popBundle(); - -protected: - virtual status_t writeLines(const struct iovec& vec, size_t N) = 0; - -private: - struct BufferState; - struct ThreadState; - - static ThreadState*getThreadState(); - static void threadDestructor(void *st); - - BufferState*getBuffer() const; - - uint32_t mFlags; - const int32_t mSeq; - const int32_t mIndex; - - Mutex mLock; - BufferState* mGlobalState; -}; - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_BUFFEREDTEXTOUTPUT_H diff --git a/external/android/include/18/frameworks/native/include/utils/ByteOrder.h b/external/android/include/18/frameworks/native/include/utils/ByteOrder.h deleted file mode 100644 index baa3a83..0000000 --- a/external/android/include/18/frameworks/native/include/utils/ByteOrder.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2006 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 _LIBS_UTILS_BYTE_ORDER_H -#define _LIBS_UTILS_BYTE_ORDER_H - -#include -#include -#ifdef HAVE_WINSOCK -#include -#else -#include -#endif - -/* - * These macros are like the hton/ntoh byte swapping macros, - * except they allow you to swap to and from the "device" byte - * order. The device byte order is the endianness of the target - * device -- for the ARM CPUs we use today, this is little endian. - * - * Note that the byte swapping functions have not been optimized - * much; performance is currently not an issue for them since the - * intent is to allow us to avoid byte swapping on the device. - */ - -static inline uint32_t android_swap_long(uint32_t v) -{ - return (v<<24) | ((v<<8)&0x00FF0000) | ((v>>8)&0x0000FF00) | (v>>24); -} - -static inline uint16_t android_swap_short(uint16_t v) -{ - return (v<<8) | (v>>8); -} - -#define DEVICE_BYTE_ORDER LITTLE_ENDIAN - -#if BYTE_ORDER == DEVICE_BYTE_ORDER - -#define dtohl(x) (x) -#define dtohs(x) (x) -#define htodl(x) (x) -#define htods(x) (x) - -#else - -#define dtohl(x) (android_swap_long(x)) -#define dtohs(x) (android_swap_short(x)) -#define htodl(x) (android_swap_long(x)) -#define htods(x) (android_swap_short(x)) - -#endif - -#if BYTE_ORDER == LITTLE_ENDIAN -#define fromlel(x) (x) -#define fromles(x) (x) -#define tolel(x) (x) -#define toles(x) (x) -#else -#define fromlel(x) (android_swap_long(x)) -#define fromles(x) (android_swap_short(x)) -#define tolel(x) (android_swap_long(x)) -#define toles(x) (android_swap_short(x)) -#endif - -#endif // _LIBS_UTILS_BYTE_ORDER_H diff --git a/external/android/include/18/frameworks/native/include/utils/CallStack.h b/external/android/include/18/frameworks/native/include/utils/CallStack.h deleted file mode 100644 index 61dc832..0000000 --- a/external/android/include/18/frameworks/native/include/utils/CallStack.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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_CALLSTACK_H -#define ANDROID_CALLSTACK_H - -#include -#include - -#include -#include - -// --------------------------------------------------------------------------- - -namespace android { - -class CallStack -{ -public: - enum { - MAX_DEPTH = 31 - }; - - CallStack(); - CallStack(const char* logtag, int32_t ignoreDepth=1, - int32_t maxDepth=MAX_DEPTH); - CallStack(const CallStack& rhs); - ~CallStack(); - - CallStack& operator = (const CallStack& rhs); - - bool operator == (const CallStack& rhs) const; - bool operator != (const CallStack& rhs) const; - bool operator < (const CallStack& rhs) const; - bool operator >= (const CallStack& rhs) const; - bool operator > (const CallStack& rhs) const; - bool operator <= (const CallStack& rhs) const; - - const void* operator [] (int index) const; - - void clear(); - - void update(int32_t ignoreDepth=1, int32_t maxDepth=MAX_DEPTH); - - // Dump a stack trace to the log using the supplied logtag - void dump(const char* logtag, const char* prefix = 0) const; - - // Return a string (possibly very long) containing the complete stack trace - String8 toString(const char* prefix = 0) const; - - size_t size() const { return mCount; } - -private: - size_t mCount; - backtrace_frame_t mStack[MAX_DEPTH]; -}; - -}; // namespace android - - -// --------------------------------------------------------------------------- - -#endif // ANDROID_CALLSTACK_H diff --git a/external/android/include/18/frameworks/native/include/utils/Compat.h b/external/android/include/18/frameworks/native/include/utils/Compat.h deleted file mode 100644 index fb7748e..0000000 --- a/external/android/include/18/frameworks/native/include/utils/Compat.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2010 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 __LIB_UTILS_COMPAT_H -#define __LIB_UTILS_COMPAT_H - -#include - -/* Compatibility definitions for non-Linux (i.e., BSD-based) hosts. */ -#ifndef HAVE_OFF64_T -#if _FILE_OFFSET_BITS < 64 -#error "_FILE_OFFSET_BITS < 64; large files are not supported on this platform" -#endif /* _FILE_OFFSET_BITS < 64 */ - -typedef off_t off64_t; - -static inline off64_t lseek64(int fd, off64_t offset, int whence) { - return lseek(fd, offset, whence); -} - -#ifdef HAVE_PREAD -static inline ssize_t pread64(int fd, void* buf, size_t nbytes, off64_t offset) { - return pread(fd, buf, nbytes, offset); -} -#endif - -#endif /* !HAVE_OFF64_T */ - -#if HAVE_PRINTF_ZD -# define ZD "%zd" -# define ZD_TYPE ssize_t -#else -# define ZD "%ld" -# define ZD_TYPE long -#endif - -/* - * TEMP_FAILURE_RETRY is defined by some, but not all, versions of - * . (Alas, it is not as standard as we'd hoped!) So, if it's - * not already defined, then define it here. - */ -#ifndef TEMP_FAILURE_RETRY -/* Used to retry syscalls that can return EINTR. */ -#define TEMP_FAILURE_RETRY(exp) ({ \ - typeof (exp) _rc; \ - do { \ - _rc = (exp); \ - } while (_rc == -1 && errno == EINTR); \ - _rc; }) -#endif - -#endif /* __LIB_UTILS_COMPAT_H */ diff --git a/external/android/include/18/frameworks/native/include/utils/Condition.h b/external/android/include/18/frameworks/native/include/utils/Condition.h deleted file mode 100644 index e63ba7e..0000000 --- a/external/android/include/18/frameworks/native/include/utils/Condition.h +++ /dev/null @@ -1,147 +0,0 @@ -/* - * 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 _LIBS_UTILS_CONDITION_H -#define _LIBS_UTILS_CONDITION_H - -#include -#include -#include - -#if defined(HAVE_PTHREADS) -# include -#endif - -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { -// --------------------------------------------------------------------------- - -/* - * Condition variable class. The implementation is system-dependent. - * - * Condition variables are paired up with mutexes. Lock the mutex, - * call wait(), then either re-wait() if things aren't quite what you want, - * or unlock the mutex and continue. All threads calling wait() must - * use the same mutex for a given Condition. - */ -class Condition { -public: - enum { - PRIVATE = 0, - SHARED = 1 - }; - - enum WakeUpType { - WAKE_UP_ONE = 0, - WAKE_UP_ALL = 1 - }; - - Condition(); - Condition(int type); - ~Condition(); - // Wait on the condition variable. Lock the mutex before calling. - status_t wait(Mutex& mutex); - // same with relative timeout - status_t waitRelative(Mutex& mutex, nsecs_t reltime); - // Signal the condition variable, allowing one thread to continue. - void signal(); - // Signal the condition variable, allowing one or all threads to continue. - void signal(WakeUpType type) { - if (type == WAKE_UP_ONE) { - signal(); - } else { - broadcast(); - } - } - // Signal the condition variable, allowing all threads to continue. - void broadcast(); - -private: -#if defined(HAVE_PTHREADS) - pthread_cond_t mCond; -#else - void* mState; -#endif -}; - -// --------------------------------------------------------------------------- - -#if defined(HAVE_PTHREADS) - -inline Condition::Condition() { - pthread_cond_init(&mCond, NULL); -} -inline Condition::Condition(int type) { - if (type == SHARED) { - pthread_condattr_t attr; - pthread_condattr_init(&attr); - pthread_condattr_setpshared(&attr, PTHREAD_PROCESS_SHARED); - pthread_cond_init(&mCond, &attr); - pthread_condattr_destroy(&attr); - } else { - pthread_cond_init(&mCond, NULL); - } -} -inline Condition::~Condition() { - pthread_cond_destroy(&mCond); -} -inline status_t Condition::wait(Mutex& mutex) { - return -pthread_cond_wait(&mCond, &mutex.mMutex); -} -inline status_t Condition::waitRelative(Mutex& mutex, nsecs_t reltime) { -#if defined(HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE) - struct timespec ts; - ts.tv_sec = reltime/1000000000; - ts.tv_nsec = reltime%1000000000; - return -pthread_cond_timedwait_relative_np(&mCond, &mutex.mMutex, &ts); -#else // HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE - struct timespec ts; -#if defined(HAVE_POSIX_CLOCKS) - clock_gettime(CLOCK_REALTIME, &ts); -#else // HAVE_POSIX_CLOCKS - // we don't support the clocks here. - struct timeval t; - gettimeofday(&t, NULL); - ts.tv_sec = t.tv_sec; - ts.tv_nsec= t.tv_usec*1000; -#endif // HAVE_POSIX_CLOCKS - ts.tv_sec += reltime/1000000000; - ts.tv_nsec+= reltime%1000000000; - if (ts.tv_nsec >= 1000000000) { - ts.tv_nsec -= 1000000000; - ts.tv_sec += 1; - } - return -pthread_cond_timedwait(&mCond, &mutex.mMutex, &ts); -#endif // HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE -} -inline void Condition::signal() { - pthread_cond_signal(&mCond); -} -inline void Condition::broadcast() { - pthread_cond_broadcast(&mCond); -} - -#endif // HAVE_PTHREADS - -// --------------------------------------------------------------------------- -}; // namespace android -// --------------------------------------------------------------------------- - -#endif // _LIBS_UTILS_CONDITON_H diff --git a/external/android/include/18/frameworks/native/include/utils/Debug.h b/external/android/include/18/frameworks/native/include/utils/Debug.h deleted file mode 100644 index d9ed32d..0000000 --- a/external/android/include/18/frameworks/native/include/utils/Debug.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2005 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_DEBUG_H -#define ANDROID_DEBUG_H - -#include -#include - -namespace android { -// --------------------------------------------------------------------------- - -#ifdef __cplusplus -template struct CompileTimeAssert; -template<> struct CompileTimeAssert {}; -#define COMPILE_TIME_ASSERT(_exp) \ - template class CompileTimeAssert< (_exp) >; -#endif -#define COMPILE_TIME_ASSERT_FUNCTION_SCOPE(_exp) \ - CompileTimeAssert<( _exp )>(); - -// --------------------------------------------------------------------------- - -#ifdef __cplusplus -template struct CompileTimeIfElse; -template -struct CompileTimeIfElse { typedef LHS TYPE; }; -template -struct CompileTimeIfElse { typedef RHS TYPE; }; -#endif - -// --------------------------------------------------------------------------- - -#ifdef __cplusplus -extern "C" { -#endif - -const char* stringForIndent(int32_t indentLevel); - -typedef void (*debugPrintFunc)(void* cookie, const char* txt); - -void printTypeCode(uint32_t typeCode, - debugPrintFunc func = 0, void* cookie = 0); - -void printHexData(int32_t indent, const void *buf, size_t length, - size_t bytesPerLine=16, int32_t singleLineBytesCutoff=16, - size_t alignment=0, bool cArrayStyle=false, - debugPrintFunc func = 0, void* cookie = 0); - -#ifdef __cplusplus -} -#endif - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_DEBUG_H diff --git a/external/android/include/18/frameworks/native/include/utils/Endian.h b/external/android/include/18/frameworks/native/include/utils/Endian.h deleted file mode 100644 index 19f2504..0000000 --- a/external/android/include/18/frameworks/native/include/utils/Endian.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// Android endian-ness defines. -// -#ifndef _LIBS_UTILS_ENDIAN_H -#define _LIBS_UTILS_ENDIAN_H - -#if defined(HAVE_ENDIAN_H) - -#include - -#else /*not HAVE_ENDIAN_H*/ - -#define __BIG_ENDIAN 0x1000 -#define __LITTLE_ENDIAN 0x0001 - -#if defined(HAVE_LITTLE_ENDIAN) -# define __BYTE_ORDER __LITTLE_ENDIAN -#else -# define __BYTE_ORDER __BIG_ENDIAN -#endif - -#endif /*not HAVE_ENDIAN_H*/ - -#endif /*_LIBS_UTILS_ENDIAN_H*/ diff --git a/external/android/include/18/frameworks/native/include/utils/Errors.h b/external/android/include/18/frameworks/native/include/utils/Errors.h deleted file mode 100644 index 0b75b19..0000000 --- a/external/android/include/18/frameworks/native/include/utils/Errors.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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_ERRORS_H -#define ANDROID_ERRORS_H - -#include -#include - -namespace android { - -// use this type to return error codes -#ifdef HAVE_MS_C_RUNTIME -typedef int status_t; -#else -typedef int32_t status_t; -#endif - -/* the MS C runtime lacks a few error codes */ - -/* - * Error codes. - * All error codes are negative values. - */ - -// Win32 #defines NO_ERROR as well. It has the same value, so there's no -// real conflict, though it's a bit awkward. -#ifdef _WIN32 -# undef NO_ERROR -#endif - -enum { - OK = 0, // Everything's swell. - NO_ERROR = 0, // No errors. - - UNKNOWN_ERROR = 0x80000000, - - NO_MEMORY = -ENOMEM, - INVALID_OPERATION = -ENOSYS, - BAD_VALUE = -EINVAL, - BAD_TYPE = 0x80000001, - NAME_NOT_FOUND = -ENOENT, - PERMISSION_DENIED = -EPERM, - NO_INIT = -ENODEV, - ALREADY_EXISTS = -EEXIST, - DEAD_OBJECT = -EPIPE, - FAILED_TRANSACTION = 0x80000002, - JPARKS_BROKE_IT = -EPIPE, -#if !defined(HAVE_MS_C_RUNTIME) - BAD_INDEX = -EOVERFLOW, - NOT_ENOUGH_DATA = -ENODATA, - WOULD_BLOCK = -EWOULDBLOCK, - TIMED_OUT = -ETIMEDOUT, - UNKNOWN_TRANSACTION = -EBADMSG, -#else - BAD_INDEX = -E2BIG, - NOT_ENOUGH_DATA = 0x80000003, - WOULD_BLOCK = 0x80000004, - TIMED_OUT = 0x80000005, - UNKNOWN_TRANSACTION = 0x80000006, -#endif - FDS_NOT_ALLOWED = 0x80000007, -}; - -// Restore define; enumeration is in "android" namespace, so the value defined -// there won't work for Win32 code in a different namespace. -#ifdef _WIN32 -# define NO_ERROR 0L -#endif - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_ERRORS_H diff --git a/external/android/include/18/frameworks/native/include/utils/FileMap.h b/external/android/include/18/frameworks/native/include/utils/FileMap.h deleted file mode 100644 index dfe6d51..0000000 --- a/external/android/include/18/frameworks/native/include/utils/FileMap.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (C) 2006 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. - */ - -// -// Encapsulate a shared file mapping. -// -#ifndef __LIBS_FILE_MAP_H -#define __LIBS_FILE_MAP_H - -#include - -#include - -#ifdef HAVE_WIN32_FILEMAP -#include -#endif - -namespace android { - -/* - * This represents a memory-mapped file. It might be the entire file or - * only part of it. This requires a little bookkeeping because the mapping - * needs to be aligned on page boundaries, and in some cases we'd like to - * have multiple references to the mapped area without creating additional - * maps. - * - * This always uses MAP_SHARED. - * - * TODO: we should be able to create a new FileMap that is a subset of - * an existing FileMap and shares the underlying mapped pages. Requires - * completing the refcounting stuff and possibly introducing the notion - * of a FileMap hierarchy. - */ -class FileMap { -public: - FileMap(void); - - /* - * Create a new mapping on an open file. - * - * Closing the file descriptor does not unmap the pages, so we don't - * claim ownership of the fd. - * - * Returns "false" on failure. - */ - bool create(const char* origFileName, int fd, - off64_t offset, size_t length, bool readOnly); - - /* - * Return the name of the file this map came from, if known. - */ - const char* getFileName(void) const { return mFileName; } - - /* - * Get a pointer to the piece of the file we requested. - */ - void* getDataPtr(void) const { return mDataPtr; } - - /* - * Get the length we requested. - */ - size_t getDataLength(void) const { return mDataLength; } - - /* - * Get the data offset used to create this map. - */ - off64_t getDataOffset(void) const { return mDataOffset; } - - /* - * Get a "copy" of the object. - */ - FileMap* acquire(void) { mRefCount++; return this; } - - /* - * Call this when mapping is no longer needed. - */ - void release(void) { - if (--mRefCount <= 0) - delete this; - } - - /* - * This maps directly to madvise() values, but allows us to avoid - * including everywhere. - */ - enum MapAdvice { - NORMAL, RANDOM, SEQUENTIAL, WILLNEED, DONTNEED - }; - - /* - * Apply an madvise() call to the entire file. - * - * Returns 0 on success, -1 on failure. - */ - int advise(MapAdvice advice); - -protected: - // don't delete objects; call release() - ~FileMap(void); - -private: - // these are not implemented - FileMap(const FileMap& src); - const FileMap& operator=(const FileMap& src); - - int mRefCount; // reference count - char* mFileName; // original file name, if known - void* mBasePtr; // base of mmap area; page aligned - size_t mBaseLength; // length, measured from "mBasePtr" - off64_t mDataOffset; // offset used when map was created - void* mDataPtr; // start of requested data, offset from base - size_t mDataLength; // length, measured from "mDataPtr" -#ifdef HAVE_WIN32_FILEMAP - HANDLE mFileHandle; // Win32 file handle - HANDLE mFileMapping; // Win32 file mapping handle -#endif - - static long mPageSize; -}; - -}; // namespace android - -#endif // __LIBS_FILE_MAP_H diff --git a/external/android/include/18/frameworks/native/include/utils/Flattenable.h b/external/android/include/18/frameworks/native/include/utils/Flattenable.h deleted file mode 100644 index e40d289..0000000 --- a/external/android/include/18/frameworks/native/include/utils/Flattenable.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (C) 2010 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_UTILS_FLATTENABLE_H -#define ANDROID_UTILS_FLATTENABLE_H - - -#include -#include -#include - -namespace android { - -/* - * The Flattenable interface allows an object to serialize itself out - * to a byte-buffer and an array of file descriptors. - */ - -class Flattenable -{ -public: - // size in bytes of the flattened object - virtual size_t getFlattenedSize() const = 0; - - // number of file descriptors to flatten - virtual size_t getFdCount() const = 0; - - // flattens the object into buffer. - // size should be at least of getFlattenedSize() - // file descriptors are written in the fds[] array but ownership is - // not transfered (ie: they must be dupped by the caller of - // flatten() if needed). - virtual status_t flatten(void* buffer, size_t size, - int fds[], size_t count) const = 0; - - // unflattens the object from buffer. - // size should be equal to the value of getFlattenedSize() when the - // object was flattened. - // unflattened file descriptors are found in the fds[] array and - // don't need to be dupped(). ie: the caller of unflatten doesn't - // keep ownership. If a fd is not retained by unflatten() it must be - // explicitly closed. - virtual status_t unflatten(void const* buffer, size_t size, - int fds[], size_t count) = 0; - -protected: - virtual ~Flattenable() = 0; - -}; - -/* - * LightFlattenable is a protocol allowing object to serialize themselves out - * to a byte-buffer. - * - * LightFlattenable objects must implement this protocol. - * - * LightFlattenable doesn't require the object to be virtual. - */ -template -class LightFlattenable { -public: - // returns whether this object always flatten into the same size. - // for efficiency, this should always be inline. - inline bool isFixedSize() const; - - // returns size in bytes of the flattened object. must be a constant. - inline size_t getSize() const; - - // flattens the object into buffer. - inline status_t flatten(void* buffer) const; - - // unflattens the object from buffer of given size. - inline status_t unflatten(void const* buffer, size_t size); -}; - -template -inline bool LightFlattenable::isFixedSize() const { - return static_cast(this)->T::isFixedSize(); -} -template -inline size_t LightFlattenable::getSize() const { - return static_cast(this)->T::getSize(); -} -template -inline status_t LightFlattenable::flatten(void* buffer) const { - return static_cast(this)->T::flatten(buffer); -} -template -inline status_t LightFlattenable::unflatten(void const* buffer, size_t size) { - return static_cast(this)->T::unflatten(buffer, size); -} - -/* - * LightFlattenablePod is an implementation of the LightFlattenable protocol - * for POD (plain-old-data) objects. - */ -template -class LightFlattenablePod : public LightFlattenable { -public: - inline bool isFixedSize() const { - return true; - } - - inline size_t getSize() const { - return sizeof(T); - } - inline status_t flatten(void* buffer) const { - *reinterpret_cast(buffer) = *static_cast(this); - return NO_ERROR; - } - inline status_t unflatten(void const* buffer, size_t) { - *static_cast(this) = *reinterpret_cast(buffer); - return NO_ERROR; - } -}; - - -}; // namespace android - - -#endif /* ANDROID_UTILS_FLATTENABLE_H */ diff --git a/external/android/include/18/frameworks/native/include/utils/Functor.h b/external/android/include/18/frameworks/native/include/utils/Functor.h deleted file mode 100644 index e24ded4..0000000 --- a/external/android/include/18/frameworks/native/include/utils/Functor.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2011 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_FUNCTOR_H -#define ANDROID_FUNCTOR_H - -#include - -namespace android { - -class Functor { -public: - Functor() {} - virtual ~Functor() {} - virtual status_t operator ()(int what, void* data) { return NO_ERROR; } -}; - -}; // namespace android - -#endif // ANDROID_FUNCTOR_H diff --git a/external/android/include/18/frameworks/native/include/utils/GenerationCache.h b/external/android/include/18/frameworks/native/include/utils/GenerationCache.h deleted file mode 100644 index 40722d1..0000000 --- a/external/android/include/18/frameworks/native/include/utils/GenerationCache.h +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Copyright (C) 2010 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_UTILS_GENERATION_CACHE_H -#define ANDROID_UTILS_GENERATION_CACHE_H - -#include -#include - -namespace android { - -/** - * GenerationCache callback used when an item is removed - */ -template -class OnEntryRemoved { -public: - virtual ~OnEntryRemoved() { }; - virtual void operator()(EntryKey& key, EntryValue& value) = 0; -}; // class OnEntryRemoved - -template -struct Entry: public LightRefBase > { - Entry(const Entry& e) : - key(e.key), value(e.value), - parent(e.parent), child(e.child) { } - Entry(const EntryKey& key, const EntryValue& value) : - key(key), value(value) { } - - EntryKey key; - EntryValue value; - - sp > parent; // next older entry - sp > child; // next younger entry -}; // struct Entry - -/** - * A LRU type cache - */ -template -class GenerationCache { -public: - GenerationCache(uint32_t maxCapacity); - virtual ~GenerationCache(); - - enum Capacity { - kUnlimitedCapacity, - }; - - void setOnEntryRemovedListener(OnEntryRemoved* listener); - - size_t size() const; - - void clear(); - - bool contains(const K& key) const; - const K& getKeyAt(size_t index) const; - const V& getValueAt(size_t index) const; - - const V& get(const K& key); - bool put(const K& key, const V& value); - - void removeAt(ssize_t index); - bool remove(const K& key); - bool removeOldest(); - -private: - KeyedVector > > mCache; - uint32_t mMaxCapacity; - - OnEntryRemoved* mListener; - - sp > mOldest; - sp > mYoungest; - - void attachToCache(const sp >& entry); - void detachFromCache(const sp >& entry); - - const V mNullValue; -}; // class GenerationCache - -template -GenerationCache::GenerationCache(uint32_t maxCapacity): mMaxCapacity(maxCapacity), - mListener(NULL), mNullValue(NULL) { -}; - -template -GenerationCache::~GenerationCache() { - clear(); -}; - -template -uint32_t GenerationCache::size() const { - return mCache.size(); -} - -/** - * Should be set by the user of the Cache so that the callback is called whenever an item is - * removed from the cache - */ -template -void GenerationCache::setOnEntryRemovedListener(OnEntryRemoved* listener) { - mListener = listener; -} - -template -void GenerationCache::clear() { - if (mListener) { - for (uint32_t i = 0; i < mCache.size(); i++) { - sp > entry = mCache.valueAt(i); - if (mListener) { - (*mListener)(entry->key, entry->value); - } - } - } - mCache.clear(); - mYoungest.clear(); - mOldest.clear(); -} - -template -bool GenerationCache::contains(const K& key) const { - return mCache.indexOfKey(key) >= 0; -} - -template -const K& GenerationCache::getKeyAt(size_t index) const { - return mCache.keyAt(index); -} - -template -const V& GenerationCache::getValueAt(size_t index) const { - return mCache.valueAt(index)->value; -} - -template -const V& GenerationCache::get(const K& key) { - ssize_t index = mCache.indexOfKey(key); - if (index >= 0) { - const sp >& entry = mCache.valueAt(index); - detachFromCache(entry); - attachToCache(entry); - return entry->value; - } - - return mNullValue; -} - -template -bool GenerationCache::put(const K& key, const V& value) { - if (mMaxCapacity != kUnlimitedCapacity && mCache.size() >= mMaxCapacity) { - removeOldest(); - } - - ssize_t index = mCache.indexOfKey(key); - if (index < 0) { - sp > entry = new Entry(key, value); - mCache.add(key, entry); - attachToCache(entry); - return true; - } - - return false; -} - -template -bool GenerationCache::remove(const K& key) { - ssize_t index = mCache.indexOfKey(key); - if (index >= 0) { - removeAt(index); - return true; - } - - return false; -} - -template -void GenerationCache::removeAt(ssize_t index) { - sp > entry = mCache.valueAt(index); - if (mListener) { - (*mListener)(entry->key, entry->value); - } - mCache.removeItemsAt(index, 1); - detachFromCache(entry); -} - -template -bool GenerationCache::removeOldest() { - if (mOldest.get()) { - ssize_t index = mCache.indexOfKey(mOldest->key); - if (index >= 0) { - removeAt(index); - return true; - } - ALOGE("GenerationCache: removeOldest failed to find the item in the cache " - "with the given key, but we know it must be in there. " - "Is the key comparator kaput?"); - } - - return false; -} - -template -void GenerationCache::attachToCache(const sp >& entry) { - if (!mYoungest.get()) { - mYoungest = mOldest = entry; - } else { - entry->parent = mYoungest; - mYoungest->child = entry; - mYoungest = entry; - } -} - -template -void GenerationCache::detachFromCache(const sp >& entry) { - if (entry->parent.get()) { - entry->parent->child = entry->child; - } else { - mOldest = entry->child; - } - - if (entry->child.get()) { - entry->child->parent = entry->parent; - } else { - mYoungest = entry->parent; - } - - entry->parent.clear(); - entry->child.clear(); -} - -}; // namespace android - -#endif // ANDROID_UTILS_GENERATION_CACHE_H diff --git a/external/android/include/18/frameworks/native/include/utils/JenkinsHash.h b/external/android/include/18/frameworks/native/include/utils/JenkinsHash.h deleted file mode 100644 index 7da5dbd..0000000 --- a/external/android/include/18/frameworks/native/include/utils/JenkinsHash.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2012 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. - */ - -/* Implementation of Jenkins one-at-a-time hash function. These choices are - * optimized for code size and portability, rather than raw speed. But speed - * should still be quite good. - **/ - -#ifndef ANDROID_JENKINS_HASH_H -#define ANDROID_JENKINS_HASH_H - -#include - -namespace android { - -/* The Jenkins hash of a sequence of 32 bit words A, B, C is: - * Whiten(Mix(Mix(Mix(0, A), B), C)) */ - -inline uint32_t JenkinsHashMix(uint32_t hash, uint32_t data) { - hash += data; - hash += (hash << 10); - hash ^= (hash >> 6); - return hash; -} - -hash_t JenkinsHashWhiten(uint32_t hash); - -/* Helpful utility functions for hashing data in 32 bit chunks */ -uint32_t JenkinsHashMixBytes(uint32_t hash, const uint8_t* bytes, size_t size); - -uint32_t JenkinsHashMixShorts(uint32_t hash, const uint16_t* shorts, size_t size); - -} - -#endif // ANDROID_JENKINS_HASH_H diff --git a/external/android/include/18/frameworks/native/include/utils/KeyedVector.h b/external/android/include/18/frameworks/native/include/utils/KeyedVector.h deleted file mode 100644 index c4faae0..0000000 --- a/external/android/include/18/frameworks/native/include/utils/KeyedVector.h +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright (C) 2005 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_KEYED_VECTOR_H -#define ANDROID_KEYED_VECTOR_H - -#include -#include -#include - -#include - -#include -#include -#include - -// --------------------------------------------------------------------------- - -namespace android { - -template -class KeyedVector -{ -public: - typedef KEY key_type; - typedef VALUE value_type; - - inline KeyedVector(); - - /* - * empty the vector - */ - - inline void clear() { mVector.clear(); } - - /*! - * vector stats - */ - - //! returns number of items in the vector - inline size_t size() const { return mVector.size(); } - //! returns whether or not the vector is empty - inline bool isEmpty() const { return mVector.isEmpty(); } - //! returns how many items can be stored without reallocating the backing store - inline size_t capacity() const { return mVector.capacity(); } - //! sets the capacity. capacity can never be reduced less than size() - inline ssize_t setCapacity(size_t size) { return mVector.setCapacity(size); } - - // returns true if the arguments is known to be identical to this vector - inline bool isIdenticalTo(const KeyedVector& rhs) const; - - /*! - * accessors - */ - const VALUE& valueFor(const KEY& key) const; - const VALUE& valueAt(size_t index) const; - const KEY& keyAt(size_t index) const; - ssize_t indexOfKey(const KEY& key) const; - const VALUE& operator[] (size_t index) const; - - /*! - * modifying the array - */ - - VALUE& editValueFor(const KEY& key); - VALUE& editValueAt(size_t index); - - /*! - * add/insert/replace items - */ - - ssize_t add(const KEY& key, const VALUE& item); - ssize_t replaceValueFor(const KEY& key, const VALUE& item); - ssize_t replaceValueAt(size_t index, const VALUE& item); - - /*! - * remove items - */ - - ssize_t removeItem(const KEY& key); - ssize_t removeItemsAt(size_t index, size_t count = 1); - -private: - SortedVector< key_value_pair_t > mVector; -}; - -// KeyedVector can be trivially moved using memcpy() because its -// underlying SortedVector can be trivially moved. -template struct trait_trivial_move > { - enum { value = trait_trivial_move > >::value }; -}; - - -// --------------------------------------------------------------------------- - -/** - * Variation of KeyedVector that holds a default value to return when - * valueFor() is called with a key that doesn't exist. - */ -template -class DefaultKeyedVector : public KeyedVector -{ -public: - inline DefaultKeyedVector(const VALUE& defValue = VALUE()); - const VALUE& valueFor(const KEY& key) const; - -private: - VALUE mDefault; -}; - -// --------------------------------------------------------------------------- - -template inline -KeyedVector::KeyedVector() -{ -} - -template inline -bool KeyedVector::isIdenticalTo(const KeyedVector& rhs) const { - return mVector.array() == rhs.mVector.array(); -} - -template inline -ssize_t KeyedVector::indexOfKey(const KEY& key) const { - return mVector.indexOf( key_value_pair_t(key) ); -} - -template inline -const VALUE& KeyedVector::valueFor(const KEY& key) const { - ssize_t i = this->indexOfKey(key); - LOG_ALWAYS_FATAL_IF(i<0, "%s: key not found", __PRETTY_FUNCTION__); - return mVector.itemAt(i).value; -} - -template inline -const VALUE& KeyedVector::valueAt(size_t index) const { - return mVector.itemAt(index).value; -} - -template inline -const VALUE& KeyedVector::operator[] (size_t index) const { - return valueAt(index); -} - -template inline -const KEY& KeyedVector::keyAt(size_t index) const { - return mVector.itemAt(index).key; -} - -template inline -VALUE& KeyedVector::editValueFor(const KEY& key) { - ssize_t i = this->indexOfKey(key); - LOG_ALWAYS_FATAL_IF(i<0, "%s: key not found", __PRETTY_FUNCTION__); - return mVector.editItemAt(i).value; -} - -template inline -VALUE& KeyedVector::editValueAt(size_t index) { - return mVector.editItemAt(index).value; -} - -template inline -ssize_t KeyedVector::add(const KEY& key, const VALUE& value) { - return mVector.add( key_value_pair_t(key, value) ); -} - -template inline -ssize_t KeyedVector::replaceValueFor(const KEY& key, const VALUE& value) { - key_value_pair_t pair(key, value); - mVector.remove(pair); - return mVector.add(pair); -} - -template inline -ssize_t KeyedVector::replaceValueAt(size_t index, const VALUE& item) { - if (index inline -ssize_t KeyedVector::removeItem(const KEY& key) { - return mVector.remove(key_value_pair_t(key)); -} - -template inline -ssize_t KeyedVector::removeItemsAt(size_t index, size_t count) { - return mVector.removeItemsAt(index, count); -} - -// --------------------------------------------------------------------------- - -template inline -DefaultKeyedVector::DefaultKeyedVector(const VALUE& defValue) - : mDefault(defValue) -{ -} - -template inline -const VALUE& DefaultKeyedVector::valueFor(const KEY& key) const { - ssize_t i = this->indexOfKey(key); - return i >= 0 ? KeyedVector::valueAt(i) : mDefault; -} - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_KEYED_VECTOR_H diff --git a/external/android/include/18/frameworks/native/include/utils/LinearAllocator.h b/external/android/include/18/frameworks/native/include/utils/LinearAllocator.h deleted file mode 100644 index 4772bc8..0000000 --- a/external/android/include/18/frameworks/native/include/utils/LinearAllocator.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright 2012, The Android Open Source Project - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef ANDROID_LINEARALLOCATOR_H -#define ANDROID_LINEARALLOCATOR_H - -#include - -namespace android { - -/** - * A memory manager that internally allocates multi-kbyte buffers for placing objects in. It avoids - * the overhead of malloc when many objects are allocated. It is most useful when creating many - * small objects with a similar lifetime, and doesn't add significant overhead for large - * allocations. - */ -class LinearAllocator { -public: - LinearAllocator(); - ~LinearAllocator(); - - /** - * Reserves and returns a region of memory of at least size 'size', aligning as needed. - * Typically this is used in an object's overridden new() method or as a replacement for malloc. - * - * The lifetime of the returned buffers is tied to that of the LinearAllocator. If calling - * delete() on an object stored in a buffer is needed, it should be overridden to use - * rewindIfLastAlloc() - */ - void* alloc(size_t size); - - /** - * Attempt to deallocate the given buffer, with the LinearAllocator attempting to rewind its - * state if possible. No destructors are called. - */ - void rewindIfLastAlloc(void* ptr, size_t allocSize); - - /** - * Dump memory usage statistics to the log (allocated and wasted space) - */ - void dumpMemoryStats(const char* prefix = ""); - - /** - * The number of bytes used for buffers allocated in the LinearAllocator (does not count space - * wasted) - */ - size_t usedSize() const { return mTotalAllocated - mWastedSpace; } - -private: - LinearAllocator(const LinearAllocator& other); - - class Page; - - Page* newPage(size_t pageSize); - bool fitsInCurrentPage(size_t size); - void ensureNext(size_t size); - void* start(Page *p); - void* end(Page* p); - - size_t mPageSize; - size_t mMaxAllocSize; - void* mNext; - Page* mCurrentPage; - Page* mPages; - - // Memory usage tracking - size_t mTotalAllocated; - size_t mWastedSpace; - size_t mPageCount; - size_t mDedicatedPageCount; -}; - -}; // namespace android - -#endif // ANDROID_LINEARALLOCATOR_H diff --git a/external/android/include/18/frameworks/native/include/utils/LinearTransform.h b/external/android/include/18/frameworks/native/include/utils/LinearTransform.h deleted file mode 100644 index 04cb355..0000000 --- a/external/android/include/18/frameworks/native/include/utils/LinearTransform.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2011 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 _LIBS_UTILS_LINEAR_TRANSFORM_H -#define _LIBS_UTILS_LINEAR_TRANSFORM_H - -#include - -namespace android { - -// LinearTransform defines a structure which hold the definition of a -// transformation from single dimensional coordinate system A into coordinate -// system B (and back again). Values in A and in B are 64 bit, the linear -// scale factor is expressed as a rational number using two 32 bit values. -// -// Specifically, let -// f(a) = b -// F(b) = f^-1(b) = a -// then -// -// f(a) = (((a - a_zero) * a_to_b_numer) / a_to_b_denom) + b_zero; -// -// and -// -// F(b) = (((b - b_zero) * a_to_b_denom) / a_to_b_numer) + a_zero; -// -struct LinearTransform { - int64_t a_zero; - int64_t b_zero; - int32_t a_to_b_numer; - uint32_t a_to_b_denom; - - // Transform from A->B - // Returns true on success, or false in the case of a singularity or an - // overflow. - bool doForwardTransform(int64_t a_in, int64_t* b_out) const; - - // Transform from B->A - // Returns true on success, or false in the case of a singularity or an - // overflow. - bool doReverseTransform(int64_t b_in, int64_t* a_out) const; - - // Helpers which will reduce the fraction N/D using Euclid's method. - template static void reduce(T* N, T* D); - static void reduce(int32_t* N, uint32_t* D); -}; - - -} - -#endif // _LIBS_UTILS_LINEAR_TRANSFORM_H diff --git a/external/android/include/18/frameworks/native/include/utils/List.h b/external/android/include/18/frameworks/native/include/utils/List.h deleted file mode 100644 index 403cd7f..0000000 --- a/external/android/include/18/frameworks/native/include/utils/List.h +++ /dev/null @@ -1,332 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// Templated list class. Normally we'd use STL, but we don't have that. -// This class mimics STL's interfaces. -// -// Objects are copied into the list with the '=' operator or with copy- -// construction, so if the compiler's auto-generated versions won't work for -// you, define your own. -// -// The only class you want to use from here is "List". -// -#ifndef _LIBS_UTILS_LIST_H -#define _LIBS_UTILS_LIST_H - -#include -#include - -namespace android { - -/* - * Doubly-linked list. Instantiate with "List myList". - * - * Objects added to the list are copied using the assignment operator, - * so this must be defined. - */ -template -class List -{ -protected: - /* - * One element in the list. - */ - class _Node { - public: - explicit _Node(const T& val) : mVal(val) {} - ~_Node() {} - inline T& getRef() { return mVal; } - inline const T& getRef() const { return mVal; } - inline _Node* getPrev() const { return mpPrev; } - inline _Node* getNext() const { return mpNext; } - inline void setVal(const T& val) { mVal = val; } - inline void setPrev(_Node* ptr) { mpPrev = ptr; } - inline void setNext(_Node* ptr) { mpNext = ptr; } - private: - friend class List; - friend class _ListIterator; - T mVal; - _Node* mpPrev; - _Node* mpNext; - }; - - /* - * Iterator for walking through the list. - */ - - template - struct CONST_ITERATOR { - typedef _Node const * NodePtr; - typedef const TYPE Type; - }; - - template - struct NON_CONST_ITERATOR { - typedef _Node* NodePtr; - typedef TYPE Type; - }; - - template< - typename U, - template class Constness - > - class _ListIterator { - typedef _ListIterator _Iter; - typedef typename Constness::NodePtr _NodePtr; - typedef typename Constness::Type _Type; - - explicit _ListIterator(_NodePtr ptr) : mpNode(ptr) {} - - public: - _ListIterator() {} - _ListIterator(const _Iter& rhs) : mpNode(rhs.mpNode) {} - ~_ListIterator() {} - - // this will handle conversions from iterator to const_iterator - // (and also all convertible iterators) - // Here, in this implementation, the iterators can be converted - // if the nodes can be converted - template explicit - _ListIterator(const V& rhs) : mpNode(rhs.mpNode) {} - - - /* - * Dereference operator. Used to get at the juicy insides. - */ - _Type& operator*() const { return mpNode->getRef(); } - _Type* operator->() const { return &(mpNode->getRef()); } - - /* - * Iterator comparison. - */ - inline bool operator==(const _Iter& right) const { - return mpNode == right.mpNode; } - - inline bool operator!=(const _Iter& right) const { - return mpNode != right.mpNode; } - - /* - * handle comparisons between iterator and const_iterator - */ - template - inline bool operator==(const OTHER& right) const { - return mpNode == right.mpNode; } - - template - inline bool operator!=(const OTHER& right) const { - return mpNode != right.mpNode; } - - /* - * Incr/decr, used to move through the list. - */ - inline _Iter& operator++() { // pre-increment - mpNode = mpNode->getNext(); - return *this; - } - const _Iter operator++(int) { // post-increment - _Iter tmp(*this); - mpNode = mpNode->getNext(); - return tmp; - } - inline _Iter& operator--() { // pre-increment - mpNode = mpNode->getPrev(); - return *this; - } - const _Iter operator--(int) { // post-increment - _Iter tmp(*this); - mpNode = mpNode->getPrev(); - return tmp; - } - - inline _NodePtr getNode() const { return mpNode; } - - _NodePtr mpNode; /* should be private, but older gcc fails */ - private: - friend class List; - }; - -public: - List() { - prep(); - } - List(const List& src) { // copy-constructor - prep(); - insert(begin(), src.begin(), src.end()); - } - virtual ~List() { - clear(); - delete[] (unsigned char*) mpMiddle; - } - - typedef _ListIterator iterator; - typedef _ListIterator const_iterator; - - List& operator=(const List& right); - - /* returns true if the list is empty */ - inline bool empty() const { return mpMiddle->getNext() == mpMiddle; } - - /* return #of elements in list */ - size_t size() const { - return size_t(distance(begin(), end())); - } - - /* - * Return the first element or one past the last element. The - * _Node* we're returning is converted to an "iterator" by a - * constructor in _ListIterator. - */ - inline iterator begin() { - return iterator(mpMiddle->getNext()); - } - inline const_iterator begin() const { - return const_iterator(const_cast<_Node const*>(mpMiddle->getNext())); - } - inline iterator end() { - return iterator(mpMiddle); - } - inline const_iterator end() const { - return const_iterator(const_cast<_Node const*>(mpMiddle)); - } - - /* add the object to the head or tail of the list */ - void push_front(const T& val) { insert(begin(), val); } - void push_back(const T& val) { insert(end(), val); } - - /* insert before the current node; returns iterator at new node */ - iterator insert(iterator posn, const T& val) - { - _Node* newNode = new _Node(val); // alloc & copy-construct - newNode->setNext(posn.getNode()); - newNode->setPrev(posn.getNode()->getPrev()); - posn.getNode()->getPrev()->setNext(newNode); - posn.getNode()->setPrev(newNode); - return iterator(newNode); - } - - /* insert a range of elements before the current node */ - void insert(iterator posn, const_iterator first, const_iterator last) { - for ( ; first != last; ++first) - insert(posn, *first); - } - - /* remove one entry; returns iterator at next node */ - iterator erase(iterator posn) { - _Node* pNext = posn.getNode()->getNext(); - _Node* pPrev = posn.getNode()->getPrev(); - pPrev->setNext(pNext); - pNext->setPrev(pPrev); - delete posn.getNode(); - return iterator(pNext); - } - - /* remove a range of elements */ - iterator erase(iterator first, iterator last) { - while (first != last) - erase(first++); // don't erase than incr later! - return iterator(last); - } - - /* remove all contents of the list */ - void clear() { - _Node* pCurrent = mpMiddle->getNext(); - _Node* pNext; - - while (pCurrent != mpMiddle) { - pNext = pCurrent->getNext(); - delete pCurrent; - pCurrent = pNext; - } - mpMiddle->setPrev(mpMiddle); - mpMiddle->setNext(mpMiddle); - } - - /* - * Measure the distance between two iterators. On exist, "first" - * will be equal to "last". The iterators must refer to the same - * list. - * - * FIXME: This is actually a generic iterator function. It should be a - * template function at the top-level with specializations for things like - * vector<>, which can just do pointer math). Here we limit it to - * _ListIterator of the same type but different constness. - */ - template< - typename U, - template class CL, - template class CR - > - ptrdiff_t distance( - _ListIterator first, _ListIterator last) const - { - ptrdiff_t count = 0; - while (first != last) { - ++first; - ++count; - } - return count; - } - -private: - /* - * I want a _Node but don't need it to hold valid data. More - * to the point, I don't want T's constructor to fire, since it - * might have side-effects or require arguments. So, we do this - * slightly uncouth storage alloc. - */ - void prep() { - mpMiddle = (_Node*) new unsigned char[sizeof(_Node)]; - mpMiddle->setPrev(mpMiddle); - mpMiddle->setNext(mpMiddle); - } - - /* - * This node plays the role of "pointer to head" and "pointer to tail". - * It sits in the middle of a circular list of nodes. The iterator - * runs around the circle until it encounters this one. - */ - _Node* mpMiddle; -}; - -/* - * Assignment operator. - * - * The simplest way to do this would be to clear out the target list and - * fill it with the source. However, we can speed things along by - * re-using existing elements. - */ -template -List& List::operator=(const List& right) -{ - if (this == &right) - return *this; // self-assignment - iterator firstDst = begin(); - iterator lastDst = end(); - const_iterator firstSrc = right.begin(); - const_iterator lastSrc = right.end(); - while (firstSrc != lastSrc && firstDst != lastDst) - *firstDst++ = *firstSrc++; - if (firstSrc == lastSrc) // ran out of elements in source? - erase(firstDst, lastDst); // yes, erase any extras - else - insert(lastDst, firstSrc, lastSrc); // copy remaining over - return *this; -} - -}; // namespace android - -#endif // _LIBS_UTILS_LIST_H diff --git a/external/android/include/18/frameworks/native/include/utils/Log.h b/external/android/include/18/frameworks/native/include/utils/Log.h deleted file mode 100644 index 98c441c..0000000 --- a/external/android/include/18/frameworks/native/include/utils/Log.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// C/C++ logging functions. See the logging documentation for API details. -// -// We'd like these to be available from C code (in case we import some from -// somewhere), so this has a C interface. -// -// The output will be correct when the log file is shared between multiple -// threads and/or multiple processes so long as the operating system -// supports O_APPEND. These calls have mutex-protected data structures -// and so are NOT reentrant. Do not use LOG in a signal handler. -// -#ifndef _LIBS_UTILS_LOG_H -#define _LIBS_UTILS_LOG_H - -#include -#include - -#ifdef __cplusplus - -namespace android { - -/* - * A very simple utility that yells in the log when an operation takes too long. - */ -class LogIfSlow { -public: - LogIfSlow(const char* tag, android_LogPriority priority, - int timeoutMillis, const char* message); - ~LogIfSlow(); - -private: - const char* const mTag; - const android_LogPriority mPriority; - const int mTimeoutMillis; - const char* const mMessage; - const int64_t mStart; -}; - -/* - * Writes the specified debug log message if this block takes longer than the - * specified number of milliseconds to run. Includes the time actually taken. - * - * { - * ALOGD_IF_SLOW(50, "Excessive delay doing something."); - * doSomething(); - * } - */ -#define ALOGD_IF_SLOW(timeoutMillis, message) \ - LogIfSlow _logIfSlow(LOG_TAG, ANDROID_LOG_DEBUG, timeoutMillis, message); - -} // namespace android - -#endif // __cplusplus - -#endif // _LIBS_UTILS_LOG_H diff --git a/external/android/include/18/frameworks/native/include/utils/Looper.h b/external/android/include/18/frameworks/native/include/utils/Looper.h deleted file mode 100644 index d4a0067..0000000 --- a/external/android/include/18/frameworks/native/include/utils/Looper.h +++ /dev/null @@ -1,377 +0,0 @@ -/* - * Copyright (C) 2010 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 UTILS_LOOPER_H -#define UTILS_LOOPER_H - -#include -#include -#include -#include - -#include - -#include - -/* - * Declare a concrete type for the NDK's looper forward declaration. - */ -struct ALooper { -}; - -namespace android { - -/** - * A message that can be posted to a Looper. - */ -struct Message { - Message() : what(0) { } - Message(int what) : what(what) { } - - /* The message type. (interpretation is left up to the handler) */ - int what; -}; - - -/** - * Interface for a Looper message handler. - * - * The Looper holds a strong reference to the message handler whenever it has - * a message to deliver to it. Make sure to call Looper::removeMessages - * to remove any pending messages destined for the handler so that the handler - * can be destroyed. - */ -class MessageHandler : public virtual RefBase { -protected: - virtual ~MessageHandler() { } - -public: - /** - * Handles a message. - */ - virtual void handleMessage(const Message& message) = 0; -}; - - -/** - * A simple proxy that holds a weak reference to a message handler. - */ -class WeakMessageHandler : public MessageHandler { -protected: - virtual ~WeakMessageHandler(); - -public: - WeakMessageHandler(const wp& handler); - virtual void handleMessage(const Message& message); - -private: - wp mHandler; -}; - - -/** - * A looper callback. - */ -class LooperCallback : public virtual RefBase { -protected: - virtual ~LooperCallback() { } - -public: - /** - * Handles a poll event for the given file descriptor. - * It is given the file descriptor it is associated with, - * a bitmask of the poll events that were triggered (typically ALOOPER_EVENT_INPUT), - * and the data pointer that was originally supplied. - * - * Implementations should return 1 to continue receiving callbacks, or 0 - * to have this file descriptor and callback unregistered from the looper. - */ - virtual int handleEvent(int fd, int events, void* data) = 0; -}; - - -/** - * Wraps a ALooper_callbackFunc function pointer. - */ -class SimpleLooperCallback : public LooperCallback { -protected: - virtual ~SimpleLooperCallback(); - -public: - SimpleLooperCallback(ALooper_callbackFunc callback); - virtual int handleEvent(int fd, int events, void* data); - -private: - ALooper_callbackFunc mCallback; -}; - - -/** - * A polling loop that supports monitoring file descriptor events, optionally - * using callbacks. The implementation uses epoll() internally. - * - * A looper can be associated with a thread although there is no requirement that it must be. - */ -class Looper : public ALooper, public RefBase { -protected: - virtual ~Looper(); - -public: - /** - * Creates a looper. - * - * If allowNonCallbaks is true, the looper will allow file descriptors to be - * registered without associated callbacks. This assumes that the caller of - * pollOnce() is prepared to handle callback-less events itself. - */ - Looper(bool allowNonCallbacks); - - /** - * Returns whether this looper instance allows the registration of file descriptors - * using identifiers instead of callbacks. - */ - bool getAllowNonCallbacks() const; - - /** - * Waits for events to be available, with optional timeout in milliseconds. - * Invokes callbacks for all file descriptors on which an event occurred. - * - * If the timeout is zero, returns immediately without blocking. - * If the timeout is negative, waits indefinitely until an event appears. - * - * Returns ALOOPER_POLL_WAKE if the poll was awoken using wake() before - * the timeout expired and no callbacks were invoked and no other file - * descriptors were ready. - * - * Returns ALOOPER_POLL_CALLBACK if one or more callbacks were invoked. - * - * Returns ALOOPER_POLL_TIMEOUT if there was no data before the given - * timeout expired. - * - * Returns ALOOPER_POLL_ERROR if an error occurred. - * - * Returns a value >= 0 containing an identifier if its file descriptor has data - * and it has no callback function (requiring the caller here to handle it). - * In this (and only this) case outFd, outEvents and outData will contain the poll - * events and data associated with the fd, otherwise they will be set to NULL. - * - * This method does not return until it has finished invoking the appropriate callbacks - * for all file descriptors that were signalled. - */ - int pollOnce(int timeoutMillis, int* outFd, int* outEvents, void** outData); - inline int pollOnce(int timeoutMillis) { - return pollOnce(timeoutMillis, NULL, NULL, NULL); - } - - /** - * Like pollOnce(), but performs all pending callbacks until all - * data has been consumed or a file descriptor is available with no callback. - * This function will never return ALOOPER_POLL_CALLBACK. - */ - int pollAll(int timeoutMillis, int* outFd, int* outEvents, void** outData); - inline int pollAll(int timeoutMillis) { - return pollAll(timeoutMillis, NULL, NULL, NULL); - } - - /** - * Wakes the poll asynchronously. - * - * This method can be called on any thread. - * This method returns immediately. - */ - void wake(); - - /** - * Adds a new file descriptor to be polled by the looper. - * If the same file descriptor was previously added, it is replaced. - * - * "fd" is the file descriptor to be added. - * "ident" is an identifier for this event, which is returned from pollOnce(). - * The identifier must be >= 0, or ALOOPER_POLL_CALLBACK if providing a non-NULL callback. - * "events" are the poll events to wake up on. Typically this is ALOOPER_EVENT_INPUT. - * "callback" is the function to call when there is an event on the file descriptor. - * "data" is a private data pointer to supply to the callback. - * - * There are two main uses of this function: - * - * (1) If "callback" is non-NULL, then this function will be called when there is - * data on the file descriptor. It should execute any events it has pending, - * appropriately reading from the file descriptor. The 'ident' is ignored in this case. - * - * (2) If "callback" is NULL, the 'ident' will be returned by ALooper_pollOnce - * when its file descriptor has data available, requiring the caller to take - * care of processing it. - * - * Returns 1 if the file descriptor was added, 0 if the arguments were invalid. - * - * This method can be called on any thread. - * This method may block briefly if it needs to wake the poll. - * - * The callback may either be specified as a bare function pointer or as a smart - * pointer callback object. The smart pointer should be preferred because it is - * easier to avoid races when the callback is removed from a different thread. - * See removeFd() for details. - */ - int addFd(int fd, int ident, int events, ALooper_callbackFunc callback, void* data); - int addFd(int fd, int ident, int events, const sp& callback, void* data); - - /** - * Removes a previously added file descriptor from the looper. - * - * When this method returns, it is safe to close the file descriptor since the looper - * will no longer have a reference to it. However, it is possible for the callback to - * already be running or for it to run one last time if the file descriptor was already - * signalled. Calling code is responsible for ensuring that this case is safely handled. - * For example, if the callback takes care of removing itself during its own execution either - * by returning 0 or by calling this method, then it can be guaranteed to not be invoked - * again at any later time unless registered anew. - * - * A simple way to avoid this problem is to use the version of addFd() that takes - * a sp instead of a bare function pointer. The LooperCallback will - * be released at the appropriate time by the Looper. - * - * Returns 1 if the file descriptor was removed, 0 if none was previously registered. - * - * This method can be called on any thread. - * This method may block briefly if it needs to wake the poll. - */ - int removeFd(int fd); - - /** - * Enqueues a message to be processed by the specified handler. - * - * The handler must not be null. - * This method can be called on any thread. - */ - void sendMessage(const sp& handler, const Message& message); - - /** - * Enqueues a message to be processed by the specified handler after all pending messages - * after the specified delay. - * - * The time delay is specified in uptime nanoseconds. - * The handler must not be null. - * This method can be called on any thread. - */ - void sendMessageDelayed(nsecs_t uptimeDelay, const sp& handler, - const Message& message); - - /** - * Enqueues a message to be processed by the specified handler after all pending messages - * at the specified time. - * - * The time is specified in uptime nanoseconds. - * The handler must not be null. - * This method can be called on any thread. - */ - void sendMessageAtTime(nsecs_t uptime, const sp& handler, - const Message& message); - - /** - * Removes all messages for the specified handler from the queue. - * - * The handler must not be null. - * This method can be called on any thread. - */ - void removeMessages(const sp& handler); - - /** - * Removes all messages of a particular type for the specified handler from the queue. - * - * The handler must not be null. - * This method can be called on any thread. - */ - void removeMessages(const sp& handler, int what); - - /** - * Prepares a looper associated with the calling thread, and returns it. - * If the thread already has a looper, it is returned. Otherwise, a new - * one is created, associated with the thread, and returned. - * - * The opts may be ALOOPER_PREPARE_ALLOW_NON_CALLBACKS or 0. - */ - static sp prepare(int opts); - - /** - * Sets the given looper to be associated with the calling thread. - * If another looper is already associated with the thread, it is replaced. - * - * If "looper" is NULL, removes the currently associated looper. - */ - static void setForThread(const sp& looper); - - /** - * Returns the looper associated with the calling thread, or NULL if - * there is not one. - */ - static sp getForThread(); - -private: - struct Request { - int fd; - int ident; - sp callback; - void* data; - }; - - struct Response { - int events; - Request request; - }; - - struct MessageEnvelope { - MessageEnvelope() : uptime(0) { } - - MessageEnvelope(nsecs_t uptime, const sp handler, - const Message& message) : uptime(uptime), handler(handler), message(message) { - } - - nsecs_t uptime; - sp handler; - Message message; - }; - - const bool mAllowNonCallbacks; // immutable - - int mWakeReadPipeFd; // immutable - int mWakeWritePipeFd; // immutable - Mutex mLock; - - Vector mMessageEnvelopes; // guarded by mLock - bool mSendingMessage; // guarded by mLock - - int mEpollFd; // immutable - - // Locked list of file descriptor monitoring requests. - KeyedVector mRequests; // guarded by mLock - - // This state is only used privately by pollOnce and does not require a lock since - // it runs on a single thread. - Vector mResponses; - size_t mResponseIndex; - nsecs_t mNextMessageUptime; // set to LLONG_MAX when none - - int pollInner(int timeoutMillis); - void awoken(); - void pushResponse(int events, const Request& request); - - static void initTLSKey(); - static void threadDestructor(void *st); -}; - -} // namespace android - -#endif // UTILS_LOOPER_H diff --git a/external/android/include/18/frameworks/native/include/utils/LruCache.h b/external/android/include/18/frameworks/native/include/utils/LruCache.h deleted file mode 100644 index 302b929..0000000 --- a/external/android/include/18/frameworks/native/include/utils/LruCache.h +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright (C) 2012 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_UTILS_LRU_CACHE_H -#define ANDROID_UTILS_LRU_CACHE_H - -#include -#include -#include - -namespace android { - -// OnEntryRemoved is defined in GenerationCache.h, but maybe should move here. - -template -class LruCache { -public: - explicit LruCache(uint32_t maxCapacity); - - enum Capacity { - kUnlimitedCapacity, - }; - - void setOnEntryRemovedListener(OnEntryRemoved* listener); - size_t size() const; - const TValue& get(const TKey& key); - bool put(const TKey& key, const TValue& value); - bool remove(const TKey& key); - bool removeOldest(); - void clear(); - - class Iterator { - public: - Iterator(const LruCache& cache): mCache(cache), mIndex(-1) { - } - - bool next() { - mIndex = mCache.mTable->next(mIndex); - return mIndex != -1; - } - - size_t index() const { - return mIndex; - } - - const TValue& value() const { - return mCache.mTable->entryAt(mIndex).value; - } - - const TKey& key() const { - return mCache.mTable->entryAt(mIndex).key; - } - private: - const LruCache& mCache; - size_t mIndex; - }; - -private: - LruCache(const LruCache& that); // disallow copy constructor - - struct Entry { - TKey key; - TValue value; - Entry* parent; - Entry* child; - - Entry(TKey key_, TValue value_) : key(key_), value(value_), parent(NULL), child(NULL) { - } - const TKey& getKey() const { return key; } - }; - - void attachToCache(Entry& entry); - void detachFromCache(Entry& entry); - void rehash(size_t newCapacity); - - UniquePtr > mTable; - OnEntryRemoved* mListener; - Entry* mOldest; - Entry* mYoungest; - uint32_t mMaxCapacity; - TValue mNullValue; -}; - -// Implementation is here, because it's fully templated -template -LruCache::LruCache(uint32_t maxCapacity): mMaxCapacity(maxCapacity), - mNullValue(NULL), mTable(new BasicHashtable), mYoungest(NULL), mOldest(NULL), - mListener(NULL) { -}; - -template -void LruCache::setOnEntryRemovedListener(OnEntryRemoved* listener) { - mListener = listener; -} - -template -size_t LruCache::size() const { - return mTable->size(); -} - -template -const TValue& LruCache::get(const TKey& key) { - hash_t hash = hash_type(key); - ssize_t index = mTable->find(-1, hash, key); - if (index == -1) { - return mNullValue; - } - Entry& entry = mTable->editEntryAt(index); - detachFromCache(entry); - attachToCache(entry); - return entry.value; -} - -template -bool LruCache::put(const TKey& key, const TValue& value) { - if (mMaxCapacity != kUnlimitedCapacity && size() >= mMaxCapacity) { - removeOldest(); - } - - hash_t hash = hash_type(key); - ssize_t index = mTable->find(-1, hash, key); - if (index >= 0) { - return false; - } - if (!mTable->hasMoreRoom()) { - rehash(mTable->capacity() * 2); - } - - // Would it be better to initialize a blank entry and assign key, value? - Entry initEntry(key, value); - index = mTable->add(hash, initEntry); - Entry& entry = mTable->editEntryAt(index); - attachToCache(entry); - return true; -} - -template -bool LruCache::remove(const TKey& key) { - hash_t hash = hash_type(key); - ssize_t index = mTable->find(-1, hash, key); - if (index < 0) { - return false; - } - Entry& entry = mTable->editEntryAt(index); - if (mListener) { - (*mListener)(entry.key, entry.value); - } - detachFromCache(entry); - mTable->removeAt(index); - return true; -} - -template -bool LruCache::removeOldest() { - if (mOldest != NULL) { - return remove(mOldest->key); - // TODO: should probably abort if false - } - return false; -} - -template -void LruCache::clear() { - if (mListener) { - for (Entry* p = mOldest; p != NULL; p = p->child) { - (*mListener)(p->key, p->value); - } - } - mYoungest = NULL; - mOldest = NULL; - mTable->clear(); -} - -template -void LruCache::attachToCache(Entry& entry) { - if (mYoungest == NULL) { - mYoungest = mOldest = &entry; - } else { - entry.parent = mYoungest; - mYoungest->child = &entry; - mYoungest = &entry; - } -} - -template -void LruCache::detachFromCache(Entry& entry) { - if (entry.parent != NULL) { - entry.parent->child = entry.child; - } else { - mOldest = entry.child; - } - if (entry.child != NULL) { - entry.child->parent = entry.parent; - } else { - mYoungest = entry.parent; - } - - entry.parent = NULL; - entry.child = NULL; -} - -template -void LruCache::rehash(size_t newCapacity) { - UniquePtr > oldTable(mTable.release()); - Entry* oldest = mOldest; - - mOldest = NULL; - mYoungest = NULL; - mTable.reset(new BasicHashtable(newCapacity)); - for (Entry* p = oldest; p != NULL; p = p->child) { - put(p->key, p->value); - } -} - -} - -#endif // ANDROID_UTILS_LRU_CACHE_H diff --git a/external/android/include/18/frameworks/native/include/utils/Mutex.h b/external/android/include/18/frameworks/native/include/utils/Mutex.h deleted file mode 100644 index dd201c8..0000000 --- a/external/android/include/18/frameworks/native/include/utils/Mutex.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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 _LIBS_UTILS_MUTEX_H -#define _LIBS_UTILS_MUTEX_H - -#include -#include -#include - -#if defined(HAVE_PTHREADS) -# include -#endif - -#include - -// --------------------------------------------------------------------------- -namespace android { -// --------------------------------------------------------------------------- - -class Condition; - -/* - * Simple mutex class. The implementation is system-dependent. - * - * The mutex must be unlocked by the thread that locked it. They are not - * recursive, i.e. the same thread can't lock it multiple times. - */ -class Mutex { -public: - enum { - PRIVATE = 0, - SHARED = 1 - }; - - Mutex(); - Mutex(const char* name); - Mutex(int type, const char* name = NULL); - ~Mutex(); - - // lock or unlock the mutex - status_t lock(); - void unlock(); - - // lock if possible; returns 0 on success, error otherwise - status_t tryLock(); - - // Manages the mutex automatically. It'll be locked when Autolock is - // constructed and released when Autolock goes out of scope. - class Autolock { - public: - inline Autolock(Mutex& mutex) : mLock(mutex) { mLock.lock(); } - inline Autolock(Mutex* mutex) : mLock(*mutex) { mLock.lock(); } - inline ~Autolock() { mLock.unlock(); } - private: - Mutex& mLock; - }; - -private: - friend class Condition; - - // A mutex cannot be copied - Mutex(const Mutex&); - Mutex& operator = (const Mutex&); - -#if defined(HAVE_PTHREADS) - pthread_mutex_t mMutex; -#else - void _init(); - void* mState; -#endif -}; - -// --------------------------------------------------------------------------- - -#if defined(HAVE_PTHREADS) - -inline Mutex::Mutex() { - pthread_mutex_init(&mMutex, NULL); -} -inline Mutex::Mutex(__attribute__((unused)) const char* name) { - pthread_mutex_init(&mMutex, NULL); -} -inline Mutex::Mutex(int type, __attribute__((unused)) const char* name) { - if (type == SHARED) { - pthread_mutexattr_t attr; - pthread_mutexattr_init(&attr); - pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED); - pthread_mutex_init(&mMutex, &attr); - pthread_mutexattr_destroy(&attr); - } else { - pthread_mutex_init(&mMutex, NULL); - } -} -inline Mutex::~Mutex() { - pthread_mutex_destroy(&mMutex); -} -inline status_t Mutex::lock() { - return -pthread_mutex_lock(&mMutex); -} -inline void Mutex::unlock() { - pthread_mutex_unlock(&mMutex); -} -inline status_t Mutex::tryLock() { - return -pthread_mutex_trylock(&mMutex); -} - -#endif // HAVE_PTHREADS - -// --------------------------------------------------------------------------- - -/* - * Automatic mutex. Declare one of these at the top of a function. - * When the function returns, it will go out of scope, and release the - * mutex. - */ - -typedef Mutex::Autolock AutoMutex; - -// --------------------------------------------------------------------------- -}; // namespace android -// --------------------------------------------------------------------------- - -#endif // _LIBS_UTILS_MUTEX_H diff --git a/external/android/include/18/frameworks/native/include/utils/PropertyMap.h b/external/android/include/18/frameworks/native/include/utils/PropertyMap.h deleted file mode 100644 index a9e674f..0000000 --- a/external/android/include/18/frameworks/native/include/utils/PropertyMap.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (C) 2010 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 _UTILS_PROPERTY_MAP_H -#define _UTILS_PROPERTY_MAP_H - -#include -#include -#include -#include - -namespace android { - -/* - * Provides a mechanism for passing around string-based property key / value pairs - * and loading them from property files. - * - * The property files have the following simple structure: - * - * # Comment - * key = value - * - * Keys and values are any sequence of printable ASCII characters. - * The '=' separates the key from the value. - * The key and value may not contain whitespace. - * - * The '\' character is reserved for escape sequences and is not currently supported. - * The '"" character is reserved for quoting and is not currently supported. - * Files that contain the '\' or '"' character will fail to parse. - * - * The file must not contain duplicate keys. - * - * TODO Support escape sequences and quoted values when needed. - */ -class PropertyMap { -public: - /* Creates an empty property map. */ - PropertyMap(); - ~PropertyMap(); - - /* Clears the property map. */ - void clear(); - - /* Adds a property. - * Replaces the property with the same key if it is already present. - */ - void addProperty(const String8& key, const String8& value); - - /* Returns true if the property map contains the specified key. */ - bool hasProperty(const String8& key) const; - - /* Gets the value of a property and parses it. - * Returns true and sets outValue if the key was found and its value was parsed successfully. - * Otherwise returns false and does not modify outValue. (Also logs a warning.) - */ - bool tryGetProperty(const String8& key, String8& outValue) const; - bool tryGetProperty(const String8& key, bool& outValue) const; - bool tryGetProperty(const String8& key, int32_t& outValue) const; - bool tryGetProperty(const String8& key, float& outValue) const; - - /* Adds all values from the specified property map. */ - void addAll(const PropertyMap* map); - - /* Gets the underlying property map. */ - inline const KeyedVector& getProperties() const { return mProperties; } - - /* Loads a property map from a file. */ - static status_t load(const String8& filename, PropertyMap** outMap); - -private: - class Parser { - PropertyMap* mMap; - Tokenizer* mTokenizer; - - public: - Parser(PropertyMap* map, Tokenizer* tokenizer); - ~Parser(); - status_t parse(); - - private: - status_t parseType(); - status_t parseKey(); - status_t parseKeyProperty(); - status_t parseModifier(const String8& token, int32_t* outMetaState); - status_t parseCharacterLiteral(char16_t* outCharacter); - }; - - KeyedVector mProperties; -}; - -} // namespace android - -#endif // _UTILS_PROPERTY_MAP_H diff --git a/external/android/include/18/frameworks/native/include/utils/RWLock.h b/external/android/include/18/frameworks/native/include/utils/RWLock.h deleted file mode 100644 index 90beb5f..0000000 --- a/external/android/include/18/frameworks/native/include/utils/RWLock.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * 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 _LIBS_UTILS_RWLOCK_H -#define _LIBS_UTILS_RWLOCK_H - -#include -#include - -#if defined(HAVE_PTHREADS) -# include -#endif - -#include -#include - -// --------------------------------------------------------------------------- -namespace android { -// --------------------------------------------------------------------------- - -#if defined(HAVE_PTHREADS) - -/* - * Simple mutex class. The implementation is system-dependent. - * - * The mutex must be unlocked by the thread that locked it. They are not - * recursive, i.e. the same thread can't lock it multiple times. - */ -class RWLock { -public: - enum { - PRIVATE = 0, - SHARED = 1 - }; - - RWLock(); - RWLock(const char* name); - RWLock(int type, const char* name = NULL); - ~RWLock(); - - status_t readLock(); - status_t tryReadLock(); - status_t writeLock(); - status_t tryWriteLock(); - void unlock(); - - class AutoRLock { - public: - inline AutoRLock(RWLock& rwlock) : mLock(rwlock) { mLock.readLock(); } - inline ~AutoRLock() { mLock.unlock(); } - private: - RWLock& mLock; - }; - - class AutoWLock { - public: - inline AutoWLock(RWLock& rwlock) : mLock(rwlock) { mLock.writeLock(); } - inline ~AutoWLock() { mLock.unlock(); } - private: - RWLock& mLock; - }; - -private: - // A RWLock cannot be copied - RWLock(const RWLock&); - RWLock& operator = (const RWLock&); - - pthread_rwlock_t mRWLock; -}; - -inline RWLock::RWLock() { - pthread_rwlock_init(&mRWLock, NULL); -} -inline RWLock::RWLock(__attribute__((unused)) const char* name) { - pthread_rwlock_init(&mRWLock, NULL); -} -inline RWLock::RWLock(int type, __attribute__((unused)) const char* name) { - if (type == SHARED) { - pthread_rwlockattr_t attr; - pthread_rwlockattr_init(&attr); - pthread_rwlockattr_setpshared(&attr, PTHREAD_PROCESS_SHARED); - pthread_rwlock_init(&mRWLock, &attr); - pthread_rwlockattr_destroy(&attr); - } else { - pthread_rwlock_init(&mRWLock, NULL); - } -} -inline RWLock::~RWLock() { - pthread_rwlock_destroy(&mRWLock); -} -inline status_t RWLock::readLock() { - return -pthread_rwlock_rdlock(&mRWLock); -} -inline status_t RWLock::tryReadLock() { - return -pthread_rwlock_tryrdlock(&mRWLock); -} -inline status_t RWLock::writeLock() { - return -pthread_rwlock_wrlock(&mRWLock); -} -inline status_t RWLock::tryWriteLock() { - return -pthread_rwlock_trywrlock(&mRWLock); -} -inline void RWLock::unlock() { - pthread_rwlock_unlock(&mRWLock); -} - -#endif // HAVE_PTHREADS - -// --------------------------------------------------------------------------- -}; // namespace android -// --------------------------------------------------------------------------- - -#endif // _LIBS_UTILS_RWLOCK_H diff --git a/external/android/include/18/frameworks/native/include/utils/RefBase.h b/external/android/include/18/frameworks/native/include/utils/RefBase.h deleted file mode 100644 index 033fe67..0000000 --- a/external/android/include/18/frameworks/native/include/utils/RefBase.h +++ /dev/null @@ -1,546 +0,0 @@ -/* - * Copyright (C) 2005 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_REF_BASE_H -#define ANDROID_REF_BASE_H - -#include - -#include -#include -#include -#include - -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -class TextOutput; -TextOutput& printWeakPointer(TextOutput& to, const void* val); - -// --------------------------------------------------------------------------- - -#define COMPARE_WEAK(_op_) \ -inline bool operator _op_ (const sp& o) const { \ - return m_ptr _op_ o.m_ptr; \ -} \ -inline bool operator _op_ (const T* o) const { \ - return m_ptr _op_ o; \ -} \ -template \ -inline bool operator _op_ (const sp& o) const { \ - return m_ptr _op_ o.m_ptr; \ -} \ -template \ -inline bool operator _op_ (const U* o) const { \ - return m_ptr _op_ o; \ -} - -// --------------------------------------------------------------------------- - -class ReferenceRenamer { -protected: - // destructor is purposedly not virtual so we avoid code overhead from - // subclasses; we have to make it protected to guarantee that it - // cannot be called from this base class (and to make strict compilers - // happy). - ~ReferenceRenamer() { } -public: - virtual void operator()(size_t i) const = 0; -}; - -// --------------------------------------------------------------------------- - -class RefBase -{ -public: - void incStrong(const void* id) const; - void decStrong(const void* id) const; - - void forceIncStrong(const void* id) const; - - //! DEBUGGING ONLY: Get current strong ref count. - int32_t getStrongCount() const; - - class weakref_type - { - public: - RefBase* refBase() const; - - void incWeak(const void* id); - void decWeak(const void* id); - - // acquires a strong reference if there is already one. - bool attemptIncStrong(const void* id); - - // acquires a weak reference if there is already one. - // This is not always safe. see ProcessState.cpp and BpBinder.cpp - // for proper use. - bool attemptIncWeak(const void* id); - - //! DEBUGGING ONLY: Get current weak ref count. - int32_t getWeakCount() const; - - //! DEBUGGING ONLY: Print references held on object. - void printRefs() const; - - //! DEBUGGING ONLY: Enable tracking for this object. - // enable -- enable/disable tracking - // retain -- when tracking is enable, if true, then we save a stack trace - // for each reference and dereference; when retain == false, we - // match up references and dereferences and keep only the - // outstanding ones. - - void trackMe(bool enable, bool retain); - }; - - weakref_type* createWeak(const void* id) const; - - weakref_type* getWeakRefs() const; - - //! DEBUGGING ONLY: Print references held on object. - inline void printRefs() const { getWeakRefs()->printRefs(); } - - //! DEBUGGING ONLY: Enable tracking of object. - inline void trackMe(bool enable, bool retain) - { - getWeakRefs()->trackMe(enable, retain); - } - - typedef RefBase basetype; - -protected: - RefBase(); - virtual ~RefBase(); - - //! Flags for extendObjectLifetime() - enum { - OBJECT_LIFETIME_STRONG = 0x0000, - OBJECT_LIFETIME_WEAK = 0x0001, - OBJECT_LIFETIME_MASK = 0x0001 - }; - - void extendObjectLifetime(int32_t mode); - - //! Flags for onIncStrongAttempted() - enum { - FIRST_INC_STRONG = 0x0001 - }; - - virtual void onFirstRef(); - virtual void onLastStrongRef(const void* id); - virtual bool onIncStrongAttempted(uint32_t flags, const void* id); - virtual void onLastWeakRef(const void* id); - -private: - friend class weakref_type; - class weakref_impl; - - RefBase(const RefBase& o); - RefBase& operator=(const RefBase& o); - -private: - friend class ReferenceMover; - - static void renameRefs(size_t n, const ReferenceRenamer& renamer); - - static void renameRefId(weakref_type* ref, - const void* old_id, const void* new_id); - - static void renameRefId(RefBase* ref, - const void* old_id, const void* new_id); - - weakref_impl* const mRefs; -}; - -// --------------------------------------------------------------------------- - -template -class LightRefBase -{ -public: - inline LightRefBase() : mCount(0) { } - inline void incStrong(__attribute__((unused)) const void* id) const { - android_atomic_inc(&mCount); - } - inline void decStrong(__attribute__((unused)) const void* id) const { - if (android_atomic_dec(&mCount) == 1) { - delete static_cast(this); - } - } - //! DEBUGGING ONLY: Get current strong ref count. - inline int32_t getStrongCount() const { - return mCount; - } - - typedef LightRefBase basetype; - -protected: - inline ~LightRefBase() { } - -private: - friend class ReferenceMover; - inline static void renameRefs(size_t n, const ReferenceRenamer& renamer) { } - inline static void renameRefId(T* ref, - const void* old_id, const void* new_id) { } - -private: - mutable volatile int32_t mCount; -}; - -// --------------------------------------------------------------------------- - -template -class wp -{ -public: - typedef typename RefBase::weakref_type weakref_type; - - inline wp() : m_ptr(0) { } - - wp(T* other); - wp(const wp& other); - wp(const sp& other); - template wp(U* other); - template wp(const sp& other); - template wp(const wp& other); - - ~wp(); - - // Assignment - - wp& operator = (T* other); - wp& operator = (const wp& other); - wp& operator = (const sp& other); - - template wp& operator = (U* other); - template wp& operator = (const wp& other); - template wp& operator = (const sp& other); - - void set_object_and_refs(T* other, weakref_type* refs); - - // promotion to sp - - sp promote() const; - - // Reset - - void clear(); - - // Accessors - - inline weakref_type* get_refs() const { return m_refs; } - - inline T* unsafe_get() const { return m_ptr; } - - // Operators - - COMPARE_WEAK(==) - COMPARE_WEAK(!=) - COMPARE_WEAK(>) - COMPARE_WEAK(<) - COMPARE_WEAK(<=) - COMPARE_WEAK(>=) - - inline bool operator == (const wp& o) const { - return (m_ptr == o.m_ptr) && (m_refs == o.m_refs); - } - template - inline bool operator == (const wp& o) const { - return m_ptr == o.m_ptr; - } - - inline bool operator > (const wp& o) const { - return (m_ptr == o.m_ptr) ? (m_refs > o.m_refs) : (m_ptr > o.m_ptr); - } - template - inline bool operator > (const wp& o) const { - return (m_ptr == o.m_ptr) ? (m_refs > o.m_refs) : (m_ptr > o.m_ptr); - } - - inline bool operator < (const wp& o) const { - return (m_ptr == o.m_ptr) ? (m_refs < o.m_refs) : (m_ptr < o.m_ptr); - } - template - inline bool operator < (const wp& o) const { - return (m_ptr == o.m_ptr) ? (m_refs < o.m_refs) : (m_ptr < o.m_ptr); - } - inline bool operator != (const wp& o) const { return m_refs != o.m_refs; } - template inline bool operator != (const wp& o) const { return !operator == (o); } - inline bool operator <= (const wp& o) const { return !operator > (o); } - template inline bool operator <= (const wp& o) const { return !operator > (o); } - inline bool operator >= (const wp& o) const { return !operator < (o); } - template inline bool operator >= (const wp& o) const { return !operator < (o); } - -private: - template friend class sp; - template friend class wp; - - T* m_ptr; - weakref_type* m_refs; -}; - -template -TextOutput& operator<<(TextOutput& to, const wp& val); - -#undef COMPARE_WEAK - -// --------------------------------------------------------------------------- -// No user serviceable parts below here. - -template -wp::wp(T* other) - : m_ptr(other) -{ - if (other) m_refs = other->createWeak(this); -} - -template -wp::wp(const wp& other) - : m_ptr(other.m_ptr), m_refs(other.m_refs) -{ - if (m_ptr) m_refs->incWeak(this); -} - -template -wp::wp(const sp& other) - : m_ptr(other.m_ptr) -{ - if (m_ptr) { - m_refs = m_ptr->createWeak(this); - } -} - -template template -wp::wp(U* other) - : m_ptr(other) -{ - if (other) m_refs = other->createWeak(this); -} - -template template -wp::wp(const wp& other) - : m_ptr(other.m_ptr) -{ - if (m_ptr) { - m_refs = other.m_refs; - m_refs->incWeak(this); - } -} - -template template -wp::wp(const sp& other) - : m_ptr(other.m_ptr) -{ - if (m_ptr) { - m_refs = m_ptr->createWeak(this); - } -} - -template -wp::~wp() -{ - if (m_ptr) m_refs->decWeak(this); -} - -template -wp& wp::operator = (T* other) -{ - weakref_type* newRefs = - other ? other->createWeak(this) : 0; - if (m_ptr) m_refs->decWeak(this); - m_ptr = other; - m_refs = newRefs; - return *this; -} - -template -wp& wp::operator = (const wp& other) -{ - weakref_type* otherRefs(other.m_refs); - T* otherPtr(other.m_ptr); - if (otherPtr) otherRefs->incWeak(this); - if (m_ptr) m_refs->decWeak(this); - m_ptr = otherPtr; - m_refs = otherRefs; - return *this; -} - -template -wp& wp::operator = (const sp& other) -{ - weakref_type* newRefs = - other != NULL ? other->createWeak(this) : 0; - T* otherPtr(other.m_ptr); - if (m_ptr) m_refs->decWeak(this); - m_ptr = otherPtr; - m_refs = newRefs; - return *this; -} - -template template -wp& wp::operator = (U* other) -{ - weakref_type* newRefs = - other ? other->createWeak(this) : 0; - if (m_ptr) m_refs->decWeak(this); - m_ptr = other; - m_refs = newRefs; - return *this; -} - -template template -wp& wp::operator = (const wp& other) -{ - weakref_type* otherRefs(other.m_refs); - U* otherPtr(other.m_ptr); - if (otherPtr) otherRefs->incWeak(this); - if (m_ptr) m_refs->decWeak(this); - m_ptr = otherPtr; - m_refs = otherRefs; - return *this; -} - -template template -wp& wp::operator = (const sp& other) -{ - weakref_type* newRefs = - other != NULL ? other->createWeak(this) : 0; - U* otherPtr(other.m_ptr); - if (m_ptr) m_refs->decWeak(this); - m_ptr = otherPtr; - m_refs = newRefs; - return *this; -} - -template -void wp::set_object_and_refs(T* other, weakref_type* refs) -{ - if (other) refs->incWeak(this); - if (m_ptr) m_refs->decWeak(this); - m_ptr = other; - m_refs = refs; -} - -template -sp wp::promote() const -{ - sp result; - if (m_ptr && m_refs->attemptIncStrong(&result)) { - result.set_pointer(m_ptr); - } - return result; -} - -template -void wp::clear() -{ - if (m_ptr) { - m_refs->decWeak(this); - m_ptr = 0; - } -} - -template -inline TextOutput& operator<<(TextOutput& to, const wp& val) -{ - return printWeakPointer(to, val.unsafe_get()); -} - -// --------------------------------------------------------------------------- - -// this class just serves as a namespace so TYPE::moveReferences can stay -// private. -class ReferenceMover { -public: - // it would be nice if we could make sure no extra code is generated - // for sp or wp when TYPE is a descendant of RefBase: - // Using a sp override doesn't work; it's a bit like we wanted - // a template template... - - template static inline - void move_references(sp* d, sp const* s, size_t n) { - - class Renamer : public ReferenceRenamer { - sp* d; - sp const* s; - virtual void operator()(size_t i) const { - // The id are known to be the sp<>'s this pointer - TYPE::renameRefId(d[i].get(), &s[i], &d[i]); - } - public: - Renamer(sp* d, sp const* s) : s(s), d(d) { } - }; - - memmove(d, s, n*sizeof(sp)); - TYPE::renameRefs(n, Renamer(d, s)); - } - - - template static inline - void move_references(wp* d, wp const* s, size_t n) { - - class Renamer : public ReferenceRenamer { - wp* d; - wp const* s; - virtual void operator()(size_t i) const { - // The id are known to be the wp<>'s this pointer - TYPE::renameRefId(d[i].get_refs(), &s[i], &d[i]); - } - public: - Renamer(wp* d, wp const* s) : s(s), d(d) { } - }; - - memmove(d, s, n*sizeof(wp)); - TYPE::renameRefs(n, Renamer(d, s)); - } -}; - -// specialization for moving sp<> and wp<> types. -// these are used by the [Sorted|Keyed]Vector<> implementations -// sp<> and wp<> need to be handled specially, because they do not -// have trivial copy operation in the general case (see RefBase.cpp -// when DEBUG ops are enabled), but can be implemented very -// efficiently in most cases. - -template inline -void move_forward_type(sp* d, sp const* s, size_t n) { - ReferenceMover::move_references(d, s, n); -} - -template inline -void move_backward_type(sp* d, sp const* s, size_t n) { - ReferenceMover::move_references(d, s, n); -} - -template inline -void move_forward_type(wp* d, wp const* s, size_t n) { - ReferenceMover::move_references(d, s, n); -} - -template inline -void move_backward_type(wp* d, wp const* s, size_t n) { - ReferenceMover::move_references(d, s, n); -} - - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_REF_BASE_H diff --git a/external/android/include/18/frameworks/native/include/utils/SharedBuffer.h b/external/android/include/18/frameworks/native/include/utils/SharedBuffer.h deleted file mode 100644 index b670953..0000000 --- a/external/android/include/18/frameworks/native/include/utils/SharedBuffer.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (C) 2005 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_SHARED_BUFFER_H -#define ANDROID_SHARED_BUFFER_H - -#include -#include - -// --------------------------------------------------------------------------- - -namespace android { - -class SharedBuffer -{ -public: - - /* flags to use with release() */ - enum { - eKeepStorage = 0x00000001 - }; - - /*! allocate a buffer of size 'size' and acquire() it. - * call release() to free it. - */ - static SharedBuffer* alloc(size_t size); - - /*! free the memory associated with the SharedBuffer. - * Fails if there are any users associated with this SharedBuffer. - * In other words, the buffer must have been release by all its - * users. - */ - static ssize_t dealloc(const SharedBuffer* released); - - //! access the data for read - inline const void* data() const; - - //! access the data for read/write - inline void* data(); - - //! get size of the buffer - inline size_t size() const; - - //! get back a SharedBuffer object from its data - static inline SharedBuffer* bufferFromData(void* data); - - //! get back a SharedBuffer object from its data - static inline const SharedBuffer* bufferFromData(const void* data); - - //! get the size of a SharedBuffer object from its data - static inline size_t sizeFromData(const void* data); - - //! edit the buffer (get a writtable, or non-const, version of it) - SharedBuffer* edit() const; - - //! edit the buffer, resizing if needed - SharedBuffer* editResize(size_t size) const; - - //! like edit() but fails if a copy is required - SharedBuffer* attemptEdit() const; - - //! resize and edit the buffer, loose it's content. - SharedBuffer* reset(size_t size) const; - - //! acquire/release a reference on this buffer - void acquire() const; - - /*! release a reference on this buffer, with the option of not - * freeing the memory associated with it if it was the last reference - * returns the previous reference count - */ - int32_t release(uint32_t flags = 0) const; - - //! returns wether or not we're the only owner - inline bool onlyOwner() const; - - -private: - inline SharedBuffer() { } - inline ~SharedBuffer() { } - SharedBuffer(const SharedBuffer&); - SharedBuffer& operator = (const SharedBuffer&); - - // 16 bytes. must be sized to preserve correct alignment. - mutable int32_t mRefs; - size_t mSize; - uint32_t mReserved[2]; -}; - -// --------------------------------------------------------------------------- - -const void* SharedBuffer::data() const { - return this + 1; -} - -void* SharedBuffer::data() { - return this + 1; -} - -size_t SharedBuffer::size() const { - return mSize; -} - -SharedBuffer* SharedBuffer::bufferFromData(void* data) { - return data ? static_cast(data)-1 : 0; -} - -const SharedBuffer* SharedBuffer::bufferFromData(const void* data) { - return data ? static_cast(data)-1 : 0; -} - -size_t SharedBuffer::sizeFromData(const void* data) { - return data ? bufferFromData(data)->mSize : 0; -} - -bool SharedBuffer::onlyOwner() const { - return (mRefs == 1); -} - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_VECTOR_H diff --git a/external/android/include/18/frameworks/native/include/utils/Singleton.h b/external/android/include/18/frameworks/native/include/utils/Singleton.h deleted file mode 100644 index c60680e..0000000 --- a/external/android/include/18/frameworks/native/include/utils/Singleton.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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_UTILS_SINGLETON_H -#define ANDROID_UTILS_SINGLETON_H - -#include -#include -#include -#include - -namespace android { -// --------------------------------------------------------------------------- - -template -class ANDROID_API Singleton -{ -public: - static TYPE& getInstance() { - Mutex::Autolock _l(sLock); - TYPE* instance = sInstance; - if (instance == 0) { - instance = new TYPE(); - sInstance = instance; - } - return *instance; - } - - static bool hasInstance() { - Mutex::Autolock _l(sLock); - return sInstance != 0; - } - -protected: - ~Singleton() { }; - Singleton() { }; - -private: - Singleton(const Singleton&); - Singleton& operator = (const Singleton&); - static Mutex sLock; - static TYPE* sInstance; -}; - -/* - * use ANDROID_SINGLETON_STATIC_INSTANCE(TYPE) in your implementation file - * (eg: .cpp) to create the static instance of Singleton<>'s attributes, - * and avoid to have a copy of them in each compilation units Singleton - * is used. - * NOTE: we use a version of Mutex ctor that takes a parameter, because - * for some unknown reason using the default ctor doesn't emit the variable! - */ - -#define ANDROID_SINGLETON_STATIC_INSTANCE(TYPE) \ - template<> Mutex Singleton< TYPE >::sLock(Mutex::PRIVATE); \ - template<> TYPE* Singleton< TYPE >::sInstance(0); \ - template class Singleton< TYPE >; - - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_UTILS_SINGLETON_H - diff --git a/external/android/include/18/frameworks/native/include/utils/SortedVector.h b/external/android/include/18/frameworks/native/include/utils/SortedVector.h deleted file mode 100644 index 2d3e82a..0000000 --- a/external/android/include/18/frameworks/native/include/utils/SortedVector.h +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Copyright (C) 2005 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_SORTED_VECTOR_H -#define ANDROID_SORTED_VECTOR_H - -#include -#include -#include - -#include - -#include -#include -#include - -// --------------------------------------------------------------------------- - -namespace android { - -template -class SortedVector : private SortedVectorImpl -{ - friend class Vector; - -public: - typedef TYPE value_type; - - /*! - * Constructors and destructors - */ - - SortedVector(); - SortedVector(const SortedVector& rhs); - virtual ~SortedVector(); - - /*! copy operator */ - const SortedVector& operator = (const SortedVector& rhs) const; - SortedVector& operator = (const SortedVector& rhs); - - /* - * empty the vector - */ - - inline void clear() { VectorImpl::clear(); } - - /*! - * vector stats - */ - - //! returns number of items in the vector - inline size_t size() const { return VectorImpl::size(); } - //! returns whether or not the vector is empty - inline bool isEmpty() const { return VectorImpl::isEmpty(); } - //! returns how many items can be stored without reallocating the backing store - inline size_t capacity() const { return VectorImpl::capacity(); } - //! sets the capacity. capacity can never be reduced less than size() - inline ssize_t setCapacity(size_t size) { return VectorImpl::setCapacity(size); } - - /*! - * C-style array access - */ - - //! read-only C-style access - inline const TYPE* array() const; - - //! read-write C-style access. BE VERY CAREFUL when modifying the array - //! you must keep it sorted! You usually don't use this function. - TYPE* editArray(); - - //! finds the index of an item - ssize_t indexOf(const TYPE& item) const; - - //! finds where this item should be inserted - size_t orderOf(const TYPE& item) const; - - - /*! - * accessors - */ - - //! read-only access to an item at a given index - inline const TYPE& operator [] (size_t index) const; - //! alternate name for operator [] - inline const TYPE& itemAt(size_t index) const; - //! stack-usage of the vector. returns the top of the stack (last element) - const TYPE& top() const; - - /*! - * modifying the array - */ - - //! add an item in the right place (and replace the one that is there) - ssize_t add(const TYPE& item); - - //! editItemAt() MUST NOT change the order of this item - TYPE& editItemAt(size_t index) { - return *( static_cast(VectorImpl::editItemLocation(index)) ); - } - - //! merges a vector into this one - ssize_t merge(const Vector& vector); - ssize_t merge(const SortedVector& vector); - - //! removes an item - ssize_t remove(const TYPE&); - - //! remove several items - inline ssize_t removeItemsAt(size_t index, size_t count = 1); - //! remove one item - inline ssize_t removeAt(size_t index) { return removeItemsAt(index); } - -protected: - virtual void do_construct(void* storage, size_t num) const; - virtual void do_destroy(void* storage, size_t num) const; - virtual void do_copy(void* dest, const void* from, size_t num) const; - virtual void do_splat(void* dest, const void* item, size_t num) const; - virtual void do_move_forward(void* dest, const void* from, size_t num) const; - virtual void do_move_backward(void* dest, const void* from, size_t num) const; - virtual int do_compare(const void* lhs, const void* rhs) const; -}; - -// SortedVector can be trivially moved using memcpy() because moving does not -// require any change to the underlying SharedBuffer contents or reference count. -template struct trait_trivial_move > { enum { value = true }; }; - -// --------------------------------------------------------------------------- -// No user serviceable parts from here... -// --------------------------------------------------------------------------- - -template inline -SortedVector::SortedVector() - : SortedVectorImpl(sizeof(TYPE), - ((traits::has_trivial_ctor ? HAS_TRIVIAL_CTOR : 0) - |(traits::has_trivial_dtor ? HAS_TRIVIAL_DTOR : 0) - |(traits::has_trivial_copy ? HAS_TRIVIAL_COPY : 0)) - ) -{ -} - -template inline -SortedVector::SortedVector(const SortedVector& rhs) - : SortedVectorImpl(rhs) { -} - -template inline -SortedVector::~SortedVector() { - finish_vector(); -} - -template inline -SortedVector& SortedVector::operator = (const SortedVector& rhs) { - SortedVectorImpl::operator = (rhs); - return *this; -} - -template inline -const SortedVector& SortedVector::operator = (const SortedVector& rhs) const { - SortedVectorImpl::operator = (rhs); - return *this; -} - -template inline -const TYPE* SortedVector::array() const { - return static_cast(arrayImpl()); -} - -template inline -TYPE* SortedVector::editArray() { - return static_cast(editArrayImpl()); -} - - -template inline -const TYPE& SortedVector::operator[](size_t index) const { - LOG_FATAL_IF(index>=size(), - "%s: index=%u out of range (%u)", __PRETTY_FUNCTION__, - int(index), int(size())); - return *(array() + index); -} - -template inline -const TYPE& SortedVector::itemAt(size_t index) const { - return operator[](index); -} - -template inline -const TYPE& SortedVector::top() const { - return *(array() + size() - 1); -} - -template inline -ssize_t SortedVector::add(const TYPE& item) { - return SortedVectorImpl::add(&item); -} - -template inline -ssize_t SortedVector::indexOf(const TYPE& item) const { - return SortedVectorImpl::indexOf(&item); -} - -template inline -size_t SortedVector::orderOf(const TYPE& item) const { - return SortedVectorImpl::orderOf(&item); -} - -template inline -ssize_t SortedVector::merge(const Vector& vector) { - return SortedVectorImpl::merge(reinterpret_cast(vector)); -} - -template inline -ssize_t SortedVector::merge(const SortedVector& vector) { - return SortedVectorImpl::merge(reinterpret_cast(vector)); -} - -template inline -ssize_t SortedVector::remove(const TYPE& item) { - return SortedVectorImpl::remove(&item); -} - -template inline -ssize_t SortedVector::removeItemsAt(size_t index, size_t count) { - return VectorImpl::removeItemsAt(index, count); -} - -// --------------------------------------------------------------------------- - -template -void SortedVector::do_construct(void* storage, size_t num) const { - construct_type( reinterpret_cast(storage), num ); -} - -template -void SortedVector::do_destroy(void* storage, size_t num) const { - destroy_type( reinterpret_cast(storage), num ); -} - -template -void SortedVector::do_copy(void* dest, const void* from, size_t num) const { - copy_type( reinterpret_cast(dest), reinterpret_cast(from), num ); -} - -template -void SortedVector::do_splat(void* dest, const void* item, size_t num) const { - splat_type( reinterpret_cast(dest), reinterpret_cast(item), num ); -} - -template -void SortedVector::do_move_forward(void* dest, const void* from, size_t num) const { - move_forward_type( reinterpret_cast(dest), reinterpret_cast(from), num ); -} - -template -void SortedVector::do_move_backward(void* dest, const void* from, size_t num) const { - move_backward_type( reinterpret_cast(dest), reinterpret_cast(from), num ); -} - -template -int SortedVector::do_compare(const void* lhs, const void* rhs) const { - return compare_type( *reinterpret_cast(lhs), *reinterpret_cast(rhs) ); -} - -}; // namespace android - - -// --------------------------------------------------------------------------- - -#endif // ANDROID_SORTED_VECTOR_H diff --git a/external/android/include/18/frameworks/native/include/utils/StopWatch.h b/external/android/include/18/frameworks/native/include/utils/StopWatch.h deleted file mode 100644 index 693dd3c..0000000 --- a/external/android/include/18/frameworks/native/include/utils/StopWatch.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2005 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_STOPWATCH_H -#define ANDROID_STOPWATCH_H - -#include -#include - -#include - -// --------------------------------------------------------------------------- - -namespace android { - -class StopWatch -{ -public: - StopWatch( const char *name, - int clock = SYSTEM_TIME_MONOTONIC, - uint32_t flags = 0); - ~StopWatch(); - - const char* name() const; - nsecs_t lap(); - nsecs_t elapsedTime() const; - - void reset(); - -private: - const char* mName; - int mClock; - uint32_t mFlags; - - struct lap_t { - nsecs_t soFar; - nsecs_t thisLap; - }; - - nsecs_t mStartTime; - lap_t mLaps[8]; - int mNumLaps; -}; - - -}; // namespace android - - -// --------------------------------------------------------------------------- - -#endif // ANDROID_STOPWATCH_H diff --git a/external/android/include/18/frameworks/native/include/utils/String16.h b/external/android/include/18/frameworks/native/include/utils/String16.h deleted file mode 100644 index fe06c57..0000000 --- a/external/android/include/18/frameworks/native/include/utils/String16.h +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Copyright (C) 2005 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_STRING16_H -#define ANDROID_STRING16_H - -#include -#include -#include -#include - -// --------------------------------------------------------------------------- - -extern "C" { - -} - -// --------------------------------------------------------------------------- - -namespace android { - -// --------------------------------------------------------------------------- - -class String8; -class TextOutput; - -//! This is a string holding UTF-16 characters. -class String16 -{ -public: - String16(); - String16(const String16& o); - String16(const String16& o, - size_t len, - size_t begin=0); - explicit String16(const char16_t* o); - explicit String16(const char16_t* o, size_t len); - explicit String16(const String8& o); - explicit String16(const char* o); - explicit String16(const char* o, size_t len); - - ~String16(); - - inline const char16_t* string() const; - inline size_t size() const; - - inline const SharedBuffer* sharedBuffer() const; - - void setTo(const String16& other); - status_t setTo(const char16_t* other); - status_t setTo(const char16_t* other, size_t len); - status_t setTo(const String16& other, - size_t len, - size_t begin=0); - - status_t append(const String16& other); - status_t append(const char16_t* other, size_t len); - - inline String16& operator=(const String16& other); - - inline String16& operator+=(const String16& other); - inline String16 operator+(const String16& other) const; - - status_t insert(size_t pos, const char16_t* chrs); - status_t insert(size_t pos, - const char16_t* chrs, size_t len); - - ssize_t findFirst(char16_t c) const; - ssize_t findLast(char16_t c) const; - - bool startsWith(const String16& prefix) const; - bool startsWith(const char16_t* prefix) const; - - status_t makeLower(); - - status_t replaceAll(char16_t replaceThis, - char16_t withThis); - - status_t remove(size_t len, size_t begin=0); - - inline int compare(const String16& other) const; - - inline bool operator<(const String16& other) const; - inline bool operator<=(const String16& other) const; - inline bool operator==(const String16& other) const; - inline bool operator!=(const String16& other) const; - inline bool operator>=(const String16& other) const; - inline bool operator>(const String16& other) const; - - inline bool operator<(const char16_t* other) const; - inline bool operator<=(const char16_t* other) const; - inline bool operator==(const char16_t* other) const; - inline bool operator!=(const char16_t* other) const; - inline bool operator>=(const char16_t* other) const; - inline bool operator>(const char16_t* other) const; - - inline operator const char16_t*() const; - -private: - const char16_t* mString; -}; - -// String16 can be trivially moved using memcpy() because moving does not -// require any change to the underlying SharedBuffer contents or reference count. -ANDROID_TRIVIAL_MOVE_TRAIT(String16) - -TextOutput& operator<<(TextOutput& to, const String16& val); - -// --------------------------------------------------------------------------- -// No user servicable parts below. - -inline int compare_type(const String16& lhs, const String16& rhs) -{ - return lhs.compare(rhs); -} - -inline int strictly_order_type(const String16& lhs, const String16& rhs) -{ - return compare_type(lhs, rhs) < 0; -} - -inline const char16_t* String16::string() const -{ - return mString; -} - -inline size_t String16::size() const -{ - return SharedBuffer::sizeFromData(mString)/sizeof(char16_t)-1; -} - -inline const SharedBuffer* String16::sharedBuffer() const -{ - return SharedBuffer::bufferFromData(mString); -} - -inline String16& String16::operator=(const String16& other) -{ - setTo(other); - return *this; -} - -inline String16& String16::operator+=(const String16& other) -{ - append(other); - return *this; -} - -inline String16 String16::operator+(const String16& other) const -{ - String16 tmp(*this); - tmp += other; - return tmp; -} - -inline int String16::compare(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()); -} - -inline bool String16::operator<(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()) < 0; -} - -inline bool String16::operator<=(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()) <= 0; -} - -inline bool String16::operator==(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()) == 0; -} - -inline bool String16::operator!=(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()) != 0; -} - -inline bool String16::operator>=(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()) >= 0; -} - -inline bool String16::operator>(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()) > 0; -} - -inline bool String16::operator<(const char16_t* other) const -{ - return strcmp16(mString, other) < 0; -} - -inline bool String16::operator<=(const char16_t* other) const -{ - return strcmp16(mString, other) <= 0; -} - -inline bool String16::operator==(const char16_t* other) const -{ - return strcmp16(mString, other) == 0; -} - -inline bool String16::operator!=(const char16_t* other) const -{ - return strcmp16(mString, other) != 0; -} - -inline bool String16::operator>=(const char16_t* other) const -{ - return strcmp16(mString, other) >= 0; -} - -inline bool String16::operator>(const char16_t* other) const -{ - return strcmp16(mString, other) > 0; -} - -inline String16::operator const char16_t*() const -{ - return mString; -} - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_STRING16_H diff --git a/external/android/include/18/frameworks/native/include/utils/String8.h b/external/android/include/18/frameworks/native/include/utils/String8.h deleted file mode 100644 index 335e7f1..0000000 --- a/external/android/include/18/frameworks/native/include/utils/String8.h +++ /dev/null @@ -1,388 +0,0 @@ -/* - * Copyright (C) 2005 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_STRING8_H -#define ANDROID_STRING8_H - -#include -#include -#include -#include - -#include // for strcmp -#include - -// --------------------------------------------------------------------------- - -namespace android { - -class String16; -class TextOutput; - -//! This is a string holding UTF-8 characters. Does not allow the value more -// than 0x10FFFF, which is not valid unicode codepoint. -class String8 -{ -public: - String8(); - String8(const String8& o); - explicit String8(const char* o); - explicit String8(const char* o, size_t numChars); - - explicit String8(const String16& o); - explicit String8(const char16_t* o); - explicit String8(const char16_t* o, size_t numChars); - explicit String8(const char32_t* o); - explicit String8(const char32_t* o, size_t numChars); - ~String8(); - - static inline const String8 empty(); - - static String8 format(const char* fmt, ...) __attribute__((format (printf, 1, 2))); - static String8 formatV(const char* fmt, va_list args); - - inline const char* string() const; - inline size_t size() const; - inline size_t length() const; - inline size_t bytes() const; - inline bool isEmpty() const; - - inline const SharedBuffer* sharedBuffer() const; - - void clear(); - - void setTo(const String8& other); - status_t setTo(const char* other); - status_t setTo(const char* other, size_t numChars); - status_t setTo(const char16_t* other, size_t numChars); - status_t setTo(const char32_t* other, - size_t length); - - status_t append(const String8& other); - status_t append(const char* other); - status_t append(const char* other, size_t numChars); - - status_t appendFormat(const char* fmt, ...) - __attribute__((format (printf, 2, 3))); - status_t appendFormatV(const char* fmt, va_list args); - - // Note that this function takes O(N) time to calculate the value. - // No cache value is stored. - size_t getUtf32Length() const; - int32_t getUtf32At(size_t index, - size_t *next_index) const; - void getUtf32(char32_t* dst) const; - - inline String8& operator=(const String8& other); - inline String8& operator=(const char* other); - - inline String8& operator+=(const String8& other); - inline String8 operator+(const String8& other) const; - - inline String8& operator+=(const char* other); - inline String8 operator+(const char* other) const; - - inline int compare(const String8& other) const; - - inline bool operator<(const String8& other) const; - inline bool operator<=(const String8& other) const; - inline bool operator==(const String8& other) const; - inline bool operator!=(const String8& other) const; - inline bool operator>=(const String8& other) const; - inline bool operator>(const String8& other) const; - - inline bool operator<(const char* other) const; - inline bool operator<=(const char* other) const; - inline bool operator==(const char* other) const; - inline bool operator!=(const char* other) const; - inline bool operator>=(const char* other) const; - inline bool operator>(const char* other) const; - - inline operator const char*() const; - - char* lockBuffer(size_t size); - void unlockBuffer(); - status_t unlockBuffer(size_t size); - - // return the index of the first byte of other in this at or after - // start, or -1 if not found - ssize_t find(const char* other, size_t start = 0) const; - - void toLower(); - void toLower(size_t start, size_t numChars); - void toUpper(); - void toUpper(size_t start, size_t numChars); - - /* - * These methods operate on the string as if it were a path name. - */ - - /* - * Set the filename field to a specific value. - * - * Normalizes the filename, removing a trailing '/' if present. - */ - void setPathName(const char* name); - void setPathName(const char* name, size_t numChars); - - /* - * Get just the filename component. - * - * "/tmp/foo/bar.c" --> "bar.c" - */ - String8 getPathLeaf(void) const; - - /* - * Remove the last (file name) component, leaving just the directory - * name. - * - * "/tmp/foo/bar.c" --> "/tmp/foo" - * "/tmp" --> "" // ????? shouldn't this be "/" ???? XXX - * "bar.c" --> "" - */ - String8 getPathDir(void) const; - - /* - * Retrieve the front (root dir) component. Optionally also return the - * remaining components. - * - * "/tmp/foo/bar.c" --> "tmp" (remain = "foo/bar.c") - * "/tmp" --> "tmp" (remain = "") - * "bar.c" --> "bar.c" (remain = "") - */ - String8 walkPath(String8* outRemains = NULL) const; - - /* - * Return the filename extension. This is the last '.' and any number - * of characters that follow it. The '.' is included in case we - * decide to expand our definition of what constitutes an extension. - * - * "/tmp/foo/bar.c" --> ".c" - * "/tmp" --> "" - * "/tmp/foo.bar/baz" --> "" - * "foo.jpeg" --> ".jpeg" - * "foo." --> "" - */ - String8 getPathExtension(void) const; - - /* - * Return the path without the extension. Rules for what constitutes - * an extension are described in the comment for getPathExtension(). - * - * "/tmp/foo/bar.c" --> "/tmp/foo/bar" - */ - String8 getBasePath(void) const; - - /* - * Add a component to the pathname. We guarantee that there is - * exactly one path separator between the old path and the new. - * If there is no existing name, we just copy the new name in. - * - * If leaf is a fully qualified path (i.e. starts with '/', it - * replaces whatever was there before. - */ - String8& appendPath(const char* leaf); - String8& appendPath(const String8& leaf) { return appendPath(leaf.string()); } - - /* - * Like appendPath(), but does not affect this string. Returns a new one instead. - */ - String8 appendPathCopy(const char* leaf) const - { String8 p(*this); p.appendPath(leaf); return p; } - String8 appendPathCopy(const String8& leaf) const { return appendPathCopy(leaf.string()); } - - /* - * Converts all separators in this string to /, the default path separator. - * - * If the default OS separator is backslash, this converts all - * backslashes to slashes, in-place. Otherwise it does nothing. - * Returns self. - */ - String8& convertToResPath(); - -private: - status_t real_append(const char* other, size_t numChars); - char* find_extension(void) const; - - const char* mString; -}; - -// String8 can be trivially moved using memcpy() because moving does not -// require any change to the underlying SharedBuffer contents or reference count. -ANDROID_TRIVIAL_MOVE_TRAIT(String8) - -TextOutput& operator<<(TextOutput& to, const String16& val); - -// --------------------------------------------------------------------------- -// No user servicable parts below. - -inline int compare_type(const String8& lhs, const String8& rhs) -{ - return lhs.compare(rhs); -} - -inline int strictly_order_type(const String8& lhs, const String8& rhs) -{ - return compare_type(lhs, rhs) < 0; -} - -inline const String8 String8::empty() { - return String8(); -} - -inline const char* String8::string() const -{ - return mString; -} - -inline size_t String8::length() const -{ - return SharedBuffer::sizeFromData(mString)-1; -} - -inline size_t String8::size() const -{ - return length(); -} - -inline bool String8::isEmpty() const -{ - return length() == 0; -} - -inline size_t String8::bytes() const -{ - return SharedBuffer::sizeFromData(mString)-1; -} - -inline const SharedBuffer* String8::sharedBuffer() const -{ - return SharedBuffer::bufferFromData(mString); -} - -inline String8& String8::operator=(const String8& other) -{ - setTo(other); - return *this; -} - -inline String8& String8::operator=(const char* other) -{ - setTo(other); - return *this; -} - -inline String8& String8::operator+=(const String8& other) -{ - append(other); - return *this; -} - -inline String8 String8::operator+(const String8& other) const -{ - String8 tmp(*this); - tmp += other; - return tmp; -} - -inline String8& String8::operator+=(const char* other) -{ - append(other); - return *this; -} - -inline String8 String8::operator+(const char* other) const -{ - String8 tmp(*this); - tmp += other; - return tmp; -} - -inline int String8::compare(const String8& other) const -{ - return strcmp(mString, other.mString); -} - -inline bool String8::operator<(const String8& other) const -{ - return strcmp(mString, other.mString) < 0; -} - -inline bool String8::operator<=(const String8& other) const -{ - return strcmp(mString, other.mString) <= 0; -} - -inline bool String8::operator==(const String8& other) const -{ - return strcmp(mString, other.mString) == 0; -} - -inline bool String8::operator!=(const String8& other) const -{ - return strcmp(mString, other.mString) != 0; -} - -inline bool String8::operator>=(const String8& other) const -{ - return strcmp(mString, other.mString) >= 0; -} - -inline bool String8::operator>(const String8& other) const -{ - return strcmp(mString, other.mString) > 0; -} - -inline bool String8::operator<(const char* other) const -{ - return strcmp(mString, other) < 0; -} - -inline bool String8::operator<=(const char* other) const -{ - return strcmp(mString, other) <= 0; -} - -inline bool String8::operator==(const char* other) const -{ - return strcmp(mString, other) == 0; -} - -inline bool String8::operator!=(const char* other) const -{ - return strcmp(mString, other) != 0; -} - -inline bool String8::operator>=(const char* other) const -{ - return strcmp(mString, other) >= 0; -} - -inline bool String8::operator>(const char* other) const -{ - return strcmp(mString, other) > 0; -} - -inline String8::operator const char*() const -{ - return mString; -} - -} // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_STRING8_H diff --git a/external/android/include/18/frameworks/native/include/utils/StringArray.h b/external/android/include/18/frameworks/native/include/utils/StringArray.h deleted file mode 100644 index c244587..0000000 --- a/external/android/include/18/frameworks/native/include/utils/StringArray.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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. - */ - -// -// Sortable array of strings. STL-ish, but STL-free. -// -#ifndef _LIBS_UTILS_STRING_ARRAY_H -#define _LIBS_UTILS_STRING_ARRAY_H - -#include -#include - -namespace android { - -// -// An expanding array of strings. Add, get, sort, delete. -// -class StringArray { -public: - StringArray(); - virtual ~StringArray(); - - // - // Add a string. A copy of the string is made. - // - bool push_back(const char* str); - - // - // Delete an entry. - // - void erase(int idx); - - // - // Sort the array. - // - void sort(int (*compare)(const void*, const void*)); - - // - // Pass this to the sort routine to do an ascending alphabetical sort. - // - static int cmpAscendingAlpha(const void* pstr1, const void* pstr2); - - // - // Get the #of items in the array. - // - inline int size(void) const { return mCurrent; } - - // - // Return entry N. - // [should use operator[] here] - // - const char* getEntry(int idx) const { - return (unsigned(idx) >= unsigned(mCurrent)) ? NULL : mArray[idx]; - } - - // - // Set entry N to specified string. - // [should use operator[] here] - // - void setEntry(int idx, const char* str); - -private: - int mMax; - int mCurrent; - char** mArray; -}; - -}; // namespace android - -#endif // _LIBS_UTILS_STRING_ARRAY_H diff --git a/external/android/include/18/frameworks/native/include/utils/StrongPointer.h b/external/android/include/18/frameworks/native/include/utils/StrongPointer.h deleted file mode 100644 index 49fa3a8..0000000 --- a/external/android/include/18/frameworks/native/include/utils/StrongPointer.h +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright (C) 2005 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_STRONG_POINTER_H -#define ANDROID_STRONG_POINTER_H - -#include - -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -class TextOutput; -TextOutput& printStrongPointer(TextOutput& to, const void* val); - -template class wp; - -// --------------------------------------------------------------------------- - -#define COMPARE(_op_) \ -inline bool operator _op_ (const sp& o) const { \ - return m_ptr _op_ o.m_ptr; \ -} \ -inline bool operator _op_ (const T* o) const { \ - return m_ptr _op_ o; \ -} \ -template \ -inline bool operator _op_ (const sp& o) const { \ - return m_ptr _op_ o.m_ptr; \ -} \ -template \ -inline bool operator _op_ (const U* o) const { \ - return m_ptr _op_ o; \ -} \ -inline bool operator _op_ (const wp& o) const { \ - return m_ptr _op_ o.m_ptr; \ -} \ -template \ -inline bool operator _op_ (const wp& o) const { \ - return m_ptr _op_ o.m_ptr; \ -} - -// --------------------------------------------------------------------------- - -template -class sp -{ -public: - inline sp() : m_ptr(0) { } - - sp(T* other); - sp(const sp& other); - template sp(U* other); - template sp(const sp& other); - - ~sp(); - - // Assignment - - sp& operator = (T* other); - sp& operator = (const sp& other); - - template sp& operator = (const sp& other); - template sp& operator = (U* other); - - //! Special optimization for use by ProcessState (and nobody else). - void force_set(T* other); - - // Reset - - void clear(); - - // Accessors - - inline T& operator* () const { return *m_ptr; } - inline T* operator-> () const { return m_ptr; } - inline T* get() const { return m_ptr; } - - // Operators - - COMPARE(==) - COMPARE(!=) - COMPARE(>) - COMPARE(<) - COMPARE(<=) - COMPARE(>=) - -private: - template friend class sp; - template friend class wp; - void set_pointer(T* ptr); - T* m_ptr; -}; - -#undef COMPARE - -template -TextOutput& operator<<(TextOutput& to, const sp& val); - -// --------------------------------------------------------------------------- -// No user serviceable parts below here. - -template -sp::sp(T* other) -: m_ptr(other) - { - if (other) other->incStrong(this); - } - -template -sp::sp(const sp& other) -: m_ptr(other.m_ptr) - { - if (m_ptr) m_ptr->incStrong(this); - } - -template template -sp::sp(U* other) : m_ptr(other) -{ - if (other) ((T*)other)->incStrong(this); -} - -template template -sp::sp(const sp& other) -: m_ptr(other.m_ptr) - { - if (m_ptr) m_ptr->incStrong(this); - } - -template -sp::~sp() -{ - if (m_ptr) m_ptr->decStrong(this); -} - -template -sp& sp::operator = (const sp& other) { - T* otherPtr(other.m_ptr); - if (otherPtr) otherPtr->incStrong(this); - if (m_ptr) m_ptr->decStrong(this); - m_ptr = otherPtr; - return *this; -} - -template -sp& sp::operator = (T* other) -{ - if (other) other->incStrong(this); - if (m_ptr) m_ptr->decStrong(this); - m_ptr = other; - return *this; -} - -template template -sp& sp::operator = (const sp& other) -{ - T* otherPtr(other.m_ptr); - if (otherPtr) otherPtr->incStrong(this); - if (m_ptr) m_ptr->decStrong(this); - m_ptr = otherPtr; - return *this; -} - -template template -sp& sp::operator = (U* other) -{ - if (other) ((T*)other)->incStrong(this); - if (m_ptr) m_ptr->decStrong(this); - m_ptr = other; - return *this; -} - -template -void sp::force_set(T* other) -{ - other->forceIncStrong(this); - m_ptr = other; -} - -template -void sp::clear() -{ - if (m_ptr) { - m_ptr->decStrong(this); - m_ptr = 0; - } -} - -template -void sp::set_pointer(T* ptr) { - m_ptr = ptr; -} - -template -inline TextOutput& operator<<(TextOutput& to, const sp& val) -{ - return printStrongPointer(to, val.get()); -} - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_STRONG_POINTER_H diff --git a/external/android/include/18/frameworks/native/include/utils/SystemClock.h b/external/android/include/18/frameworks/native/include/utils/SystemClock.h deleted file mode 100644 index d75264c..0000000 --- a/external/android/include/18/frameworks/native/include/utils/SystemClock.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_UTILS_SYSTEMCLOCK_H -#define ANDROID_UTILS_SYSTEMCLOCK_H - -#include -#include - -namespace android { - -int setCurrentTimeMillis(int64_t millis); -int64_t uptimeMillis(); -int64_t elapsedRealtime(); -int64_t elapsedRealtimeNano(); - -}; // namespace android - -#endif // ANDROID_UTILS_SYSTEMCLOCK_H - diff --git a/external/android/include/18/frameworks/native/include/utils/TextOutput.h b/external/android/include/18/frameworks/native/include/utils/TextOutput.h deleted file mode 100644 index de2fbbe..0000000 --- a/external/android/include/18/frameworks/native/include/utils/TextOutput.h +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (C) 2006 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_TEXTOUTPUT_H -#define ANDROID_TEXTOUTPUT_H - -#include - -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -class TextOutput -{ -public: - TextOutput(); - virtual ~TextOutput(); - - virtual status_t print(const char* txt, size_t len) = 0; - virtual void moveIndent(int delta) = 0; - - class Bundle { - public: - inline Bundle(TextOutput& to) : mTO(to) { to.pushBundle(); } - inline ~Bundle() { mTO.popBundle(); } - private: - TextOutput& mTO; - }; - - virtual void pushBundle() = 0; - virtual void popBundle() = 0; -}; - -// --------------------------------------------------------------------------- - -// Text output stream for printing to the log (via utils/Log.h). -extern TextOutput& alog; - -// Text output stream for printing to stdout. -extern TextOutput& aout; - -// Text output stream for printing to stderr. -extern TextOutput& aerr; - -typedef TextOutput& (*TextOutputManipFunc)(TextOutput&); - -TextOutput& endl(TextOutput& to); -TextOutput& indent(TextOutput& to); -TextOutput& dedent(TextOutput& to); - -TextOutput& operator<<(TextOutput& to, const char* str); -TextOutput& operator<<(TextOutput& to, char); // writes raw character -TextOutput& operator<<(TextOutput& to, bool); -TextOutput& operator<<(TextOutput& to, int); -TextOutput& operator<<(TextOutput& to, long); -TextOutput& operator<<(TextOutput& to, unsigned int); -TextOutput& operator<<(TextOutput& to, unsigned long); -TextOutput& operator<<(TextOutput& to, long long); -TextOutput& operator<<(TextOutput& to, unsigned long long); -TextOutput& operator<<(TextOutput& to, float); -TextOutput& operator<<(TextOutput& to, double); -TextOutput& operator<<(TextOutput& to, TextOutputManipFunc func); -TextOutput& operator<<(TextOutput& to, const void*); - -class TypeCode -{ -public: - inline TypeCode(uint32_t code); - inline ~TypeCode(); - - inline uint32_t typeCode() const; - -private: - uint32_t mCode; -}; - -TextOutput& operator<<(TextOutput& to, const TypeCode& val); - -class HexDump -{ -public: - HexDump(const void *buf, size_t size, size_t bytesPerLine=16); - inline ~HexDump(); - - inline HexDump& setBytesPerLine(size_t bytesPerLine); - inline HexDump& setSingleLineCutoff(int32_t bytes); - inline HexDump& setAlignment(size_t alignment); - inline HexDump& setCArrayStyle(bool enabled); - - inline const void* buffer() const; - inline size_t size() const; - inline size_t bytesPerLine() const; - inline int32_t singleLineCutoff() const; - inline size_t alignment() const; - inline bool carrayStyle() const; - -private: - const void* mBuffer; - size_t mSize; - size_t mBytesPerLine; - int32_t mSingleLineCutoff; - size_t mAlignment; - bool mCArrayStyle; -}; - -TextOutput& operator<<(TextOutput& to, const HexDump& val); - -// --------------------------------------------------------------------------- -// No user servicable parts below. - -inline TextOutput& endl(TextOutput& to) -{ - to.print("\n", 1); - return to; -} - -inline TextOutput& indent(TextOutput& to) -{ - to.moveIndent(1); - return to; -} - -inline TextOutput& dedent(TextOutput& to) -{ - to.moveIndent(-1); - return to; -} - -inline TextOutput& operator<<(TextOutput& to, const char* str) -{ - to.print(str, strlen(str)); - return to; -} - -inline TextOutput& operator<<(TextOutput& to, char c) -{ - to.print(&c, 1); - return to; -} - -inline TextOutput& operator<<(TextOutput& to, TextOutputManipFunc func) -{ - return (*func)(to); -} - -inline TypeCode::TypeCode(uint32_t code) : mCode(code) { } -inline TypeCode::~TypeCode() { } -inline uint32_t TypeCode::typeCode() const { return mCode; } - -inline HexDump::~HexDump() { } - -inline HexDump& HexDump::setBytesPerLine(size_t bytesPerLine) { - mBytesPerLine = bytesPerLine; return *this; -} -inline HexDump& HexDump::setSingleLineCutoff(int32_t bytes) { - mSingleLineCutoff = bytes; return *this; -} -inline HexDump& HexDump::setAlignment(size_t alignment) { - mAlignment = alignment; return *this; -} -inline HexDump& HexDump::setCArrayStyle(bool enabled) { - mCArrayStyle = enabled; return *this; -} - -inline const void* HexDump::buffer() const { return mBuffer; } -inline size_t HexDump::size() const { return mSize; } -inline size_t HexDump::bytesPerLine() const { return mBytesPerLine; } -inline int32_t HexDump::singleLineCutoff() const { return mSingleLineCutoff; } -inline size_t HexDump::alignment() const { return mAlignment; } -inline bool HexDump::carrayStyle() const { return mCArrayStyle; } - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_TEXTOUTPUT_H diff --git a/external/android/include/18/frameworks/native/include/utils/Thread.h b/external/android/include/18/frameworks/native/include/utils/Thread.h deleted file mode 100644 index df30611..0000000 --- a/external/android/include/18/frameworks/native/include/utils/Thread.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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 _LIBS_UTILS_THREAD_H -#define _LIBS_UTILS_THREAD_H - -#include -#include -#include - -#if defined(HAVE_PTHREADS) -# include -#endif - -#include -#include -#include -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { -// --------------------------------------------------------------------------- - -class Thread : virtual public RefBase -{ -public: - // Create a Thread object, but doesn't create or start the associated - // thread. See the run() method. - Thread(bool canCallJava = true); - virtual ~Thread(); - - // Start the thread in threadLoop() which needs to be implemented. - virtual status_t run( const char* name = 0, - int32_t priority = PRIORITY_DEFAULT, - size_t stack = 0); - - // Ask this object's thread to exit. This function is asynchronous, when the - // function returns the thread might still be running. Of course, this - // function can be called from a different thread. - virtual void requestExit(); - - // Good place to do one-time initializations - virtual status_t readyToRun(); - - // Call requestExit() and wait until this object's thread exits. - // BE VERY CAREFUL of deadlocks. In particular, it would be silly to call - // this function from this object's thread. Will return WOULD_BLOCK in - // that case. - status_t requestExitAndWait(); - - // Wait until this object's thread exits. Returns immediately if not yet running. - // Do not call from this object's thread; will return WOULD_BLOCK in that case. - status_t join(); - - // Indicates whether this thread is running or not. - bool isRunning() const; - -#ifdef HAVE_ANDROID_OS - // Return the thread's kernel ID, same as the thread itself calling gettid() or - // androidGetTid(), or -1 if the thread is not running. - pid_t getTid() const; -#endif - -protected: - // exitPending() returns true if requestExit() has been called. - bool exitPending() const; - -private: - // Derived class must implement threadLoop(). The thread starts its life - // here. There are two ways of using the Thread object: - // 1) loop: if threadLoop() returns true, it will be called again if - // requestExit() wasn't called. - // 2) once: if threadLoop() returns false, the thread will exit upon return. - virtual bool threadLoop() = 0; - -private: - Thread& operator=(const Thread&); - static int _threadLoop(void* user); - const bool mCanCallJava; - // always hold mLock when reading or writing - thread_id_t mThread; - mutable Mutex mLock; - Condition mThreadExitedCondition; - status_t mStatus; - // note that all accesses of mExitPending and mRunning need to hold mLock - volatile bool mExitPending; - volatile bool mRunning; - sp mHoldSelf; -#ifdef HAVE_ANDROID_OS - // legacy for debugging, not used by getTid() as it is set by the child thread - // and so is not initialized until the child reaches that point - pid_t mTid; -#endif -}; - - -}; // namespace android - -// --------------------------------------------------------------------------- -#endif // _LIBS_UTILS_THREAD_H -// --------------------------------------------------------------------------- diff --git a/external/android/include/18/frameworks/native/include/utils/ThreadDefs.h b/external/android/include/18/frameworks/native/include/utils/ThreadDefs.h deleted file mode 100644 index a8f8eb3..0000000 --- a/external/android/include/18/frameworks/native/include/utils/ThreadDefs.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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 _LIBS_UTILS_THREAD_DEFS_H -#define _LIBS_UTILS_THREAD_DEFS_H - -#include -#include -#include - -// --------------------------------------------------------------------------- -// C API - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void* android_thread_id_t; - -typedef int (*android_thread_func_t)(void*); - -enum { - /* - * *********************************************** - * ** Keep in sync with android.os.Process.java ** - * *********************************************** - * - * This maps directly to the "nice" priorities we use in Android. - * A thread priority should be chosen inverse-proportionally to - * the amount of work the thread is expected to do. The more work - * a thread will do, the less favorable priority it should get so that - * it doesn't starve the system. Threads not behaving properly might - * be "punished" by the kernel. - * Use the levels below when appropriate. Intermediate values are - * acceptable, preferably use the {MORE|LESS}_FAVORABLE constants below. - */ - ANDROID_PRIORITY_LOWEST = 19, - - /* use for background tasks */ - ANDROID_PRIORITY_BACKGROUND = 10, - - /* most threads run at normal priority */ - ANDROID_PRIORITY_NORMAL = 0, - - /* threads currently running a UI that the user is interacting with */ - ANDROID_PRIORITY_FOREGROUND = -2, - - /* the main UI thread has a slightly more favorable priority */ - ANDROID_PRIORITY_DISPLAY = -4, - - /* ui service treads might want to run at a urgent display (uncommon) */ - ANDROID_PRIORITY_URGENT_DISPLAY = HAL_PRIORITY_URGENT_DISPLAY, - - /* all normal audio threads */ - ANDROID_PRIORITY_AUDIO = -16, - - /* service audio threads (uncommon) */ - ANDROID_PRIORITY_URGENT_AUDIO = -19, - - /* should never be used in practice. regular process might not - * be allowed to use this level */ - ANDROID_PRIORITY_HIGHEST = -20, - - ANDROID_PRIORITY_DEFAULT = ANDROID_PRIORITY_NORMAL, - ANDROID_PRIORITY_MORE_FAVORABLE = -1, - ANDROID_PRIORITY_LESS_FAVORABLE = +1, -}; - -#ifdef __cplusplus -} // extern "C" -#endif - -// --------------------------------------------------------------------------- -// C++ API -#ifdef __cplusplus -namespace android { -// --------------------------------------------------------------------------- - -typedef android_thread_id_t thread_id_t; -typedef android_thread_func_t thread_func_t; - -enum { - PRIORITY_LOWEST = ANDROID_PRIORITY_LOWEST, - PRIORITY_BACKGROUND = ANDROID_PRIORITY_BACKGROUND, - PRIORITY_NORMAL = ANDROID_PRIORITY_NORMAL, - PRIORITY_FOREGROUND = ANDROID_PRIORITY_FOREGROUND, - PRIORITY_DISPLAY = ANDROID_PRIORITY_DISPLAY, - PRIORITY_URGENT_DISPLAY = ANDROID_PRIORITY_URGENT_DISPLAY, - PRIORITY_AUDIO = ANDROID_PRIORITY_AUDIO, - PRIORITY_URGENT_AUDIO = ANDROID_PRIORITY_URGENT_AUDIO, - PRIORITY_HIGHEST = ANDROID_PRIORITY_HIGHEST, - PRIORITY_DEFAULT = ANDROID_PRIORITY_DEFAULT, - PRIORITY_MORE_FAVORABLE = ANDROID_PRIORITY_MORE_FAVORABLE, - PRIORITY_LESS_FAVORABLE = ANDROID_PRIORITY_LESS_FAVORABLE, -}; - -// --------------------------------------------------------------------------- -}; // namespace android -#endif // __cplusplus -// --------------------------------------------------------------------------- - - -#endif // _LIBS_UTILS_THREAD_DEFS_H diff --git a/external/android/include/18/frameworks/native/include/utils/Timers.h b/external/android/include/18/frameworks/native/include/utils/Timers.h deleted file mode 100644 index 92f66c9..0000000 --- a/external/android/include/18/frameworks/native/include/utils/Timers.h +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// Timer functions. -// -#ifndef _LIBS_UTILS_TIMERS_H -#define _LIBS_UTILS_TIMERS_H - -#include -#include -#include - -// ------------------------------------------------------------------ -// C API - -#ifdef __cplusplus -extern "C" { -#endif - -typedef int64_t nsecs_t; // nano-seconds - -static inline nsecs_t seconds_to_nanoseconds(nsecs_t secs) -{ - return secs*1000000000; -} - -static inline nsecs_t milliseconds_to_nanoseconds(nsecs_t secs) -{ - return secs*1000000; -} - -static inline nsecs_t microseconds_to_nanoseconds(nsecs_t secs) -{ - return secs*1000; -} - -static inline nsecs_t nanoseconds_to_seconds(nsecs_t secs) -{ - return secs/1000000000; -} - -static inline nsecs_t nanoseconds_to_milliseconds(nsecs_t secs) -{ - return secs/1000000; -} - -static inline nsecs_t nanoseconds_to_microseconds(nsecs_t secs) -{ - return secs/1000; -} - -static inline nsecs_t s2ns(nsecs_t v) {return seconds_to_nanoseconds(v);} -static inline nsecs_t ms2ns(nsecs_t v) {return milliseconds_to_nanoseconds(v);} -static inline nsecs_t us2ns(nsecs_t v) {return microseconds_to_nanoseconds(v);} -static inline nsecs_t ns2s(nsecs_t v) {return nanoseconds_to_seconds(v);} -static inline nsecs_t ns2ms(nsecs_t v) {return nanoseconds_to_milliseconds(v);} -static inline nsecs_t ns2us(nsecs_t v) {return nanoseconds_to_microseconds(v);} - -static inline nsecs_t seconds(nsecs_t v) { return s2ns(v); } -static inline nsecs_t milliseconds(nsecs_t v) { return ms2ns(v); } -static inline nsecs_t microseconds(nsecs_t v) { return us2ns(v); } - -enum { - SYSTEM_TIME_REALTIME = 0, // system-wide realtime clock - SYSTEM_TIME_MONOTONIC = 1, // monotonic time since unspecified starting point - SYSTEM_TIME_PROCESS = 2, // high-resolution per-process clock - SYSTEM_TIME_THREAD = 3, // high-resolution per-thread clock - SYSTEM_TIME_BOOTTIME = 4 // same as SYSTEM_TIME_MONOTONIC, but including CPU suspend time -}; - -// return the system-time according to the specified clock -#ifdef __cplusplus -nsecs_t systemTime(int clock = SYSTEM_TIME_MONOTONIC); -#else -nsecs_t systemTime(int clock); -#endif // def __cplusplus - -/** - * Returns the number of milliseconds to wait between the reference time and the timeout time. - * If the timeout is in the past relative to the reference time, returns 0. - * If the timeout is more than INT_MAX milliseconds in the future relative to the reference time, - * such as when timeoutTime == LLONG_MAX, returns -1 to indicate an infinite timeout delay. - * Otherwise, returns the difference between the reference time and timeout time - * rounded up to the next millisecond. - */ -int toMillisecondTimeoutDelay(nsecs_t referenceTime, nsecs_t timeoutTime); - -#ifdef __cplusplus -} // extern "C" -#endif - -// ------------------------------------------------------------------ -// C++ API - -#ifdef __cplusplus - -namespace android { -/* - * Time the duration of something. - * - * Includes some timeval manipulation functions. - */ -class DurationTimer { -public: - DurationTimer() {} - ~DurationTimer() {} - - // Start the timer. - void start(); - // Stop the timer. - void stop(); - // Get the duration in microseconds. - long long durationUsecs() const; - - // Subtract two timevals. Returns the difference (ptv1-ptv2) in - // microseconds. - static long long subtractTimevals(const struct timeval* ptv1, - const struct timeval* ptv2); - - // Add the specified amount of time to the timeval. - static void addToTimeval(struct timeval* ptv, long usec); - -private: - struct timeval mStartWhen; - struct timeval mStopWhen; -}; - -}; // android -#endif // def __cplusplus - -#endif // _LIBS_UTILS_TIMERS_H diff --git a/external/android/include/18/frameworks/native/include/utils/Tokenizer.h b/external/android/include/18/frameworks/native/include/utils/Tokenizer.h deleted file mode 100644 index bb25f37..0000000 --- a/external/android/include/18/frameworks/native/include/utils/Tokenizer.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (C) 2010 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 _UTILS_TOKENIZER_H -#define _UTILS_TOKENIZER_H - -#include -#include -#include -#include - -namespace android { - -/** - * A simple tokenizer for loading and parsing ASCII text files line by line. - */ -class Tokenizer { - Tokenizer(const String8& filename, FileMap* fileMap, char* buffer, - bool ownBuffer, size_t length); - -public: - ~Tokenizer(); - - /** - * Opens a file and maps it into memory. - * - * Returns NO_ERROR and a tokenizer for the file, if successful. - * Otherwise returns an error and sets outTokenizer to NULL. - */ - static status_t open(const String8& filename, Tokenizer** outTokenizer); - - /** - * Prepares to tokenize the contents of a string. - * - * Returns NO_ERROR and a tokenizer for the string, if successful. - * Otherwise returns an error and sets outTokenizer to NULL. - */ - static status_t fromContents(const String8& filename, - const char* contents, Tokenizer** outTokenizer); - - /** - * Returns true if at the end of the file. - */ - inline bool isEof() const { return mCurrent == getEnd(); } - - /** - * Returns true if at the end of the line or end of the file. - */ - inline bool isEol() const { return isEof() || *mCurrent == '\n'; } - - /** - * Gets the name of the file. - */ - inline String8 getFilename() const { return mFilename; } - - /** - * Gets a 1-based line number index for the current position. - */ - inline int32_t getLineNumber() const { return mLineNumber; } - - /** - * Formats a location string consisting of the filename and current line number. - * Returns a string like "MyFile.txt:33". - */ - String8 getLocation() const; - - /** - * Gets the character at the current position. - * Returns null at end of file. - */ - inline char peekChar() const { return isEof() ? '\0' : *mCurrent; } - - /** - * Gets the remainder of the current line as a string, excluding the newline character. - */ - String8 peekRemainderOfLine() const; - - /** - * Gets the character at the current position and advances past it. - * Returns null at end of file. - */ - inline char nextChar() { return isEof() ? '\0' : *(mCurrent++); } - - /** - * Gets the next token on this line stopping at the specified delimiters - * or the end of the line whichever comes first and advances past it. - * Also stops at embedded nulls. - * Returns the token or an empty string if the current character is a delimiter - * or is at the end of the line. - */ - String8 nextToken(const char* delimiters); - - /** - * Advances to the next line. - * Does nothing if already at the end of the file. - */ - void nextLine(); - - /** - * Skips over the specified delimiters in the line. - * Also skips embedded nulls. - */ - void skipDelimiters(const char* delimiters); - -private: - Tokenizer(const Tokenizer& other); // not copyable - - String8 mFilename; - FileMap* mFileMap; - char* mBuffer; - bool mOwnBuffer; - size_t mLength; - - const char* mCurrent; - int32_t mLineNumber; - - inline const char* getEnd() const { return mBuffer + mLength; } - -}; - -} // namespace android - -#endif // _UTILS_TOKENIZER_H diff --git a/external/android/include/18/frameworks/native/include/utils/Trace.h b/external/android/include/18/frameworks/native/include/utils/Trace.h deleted file mode 100644 index 49578c4..0000000 --- a/external/android/include/18/frameworks/native/include/utils/Trace.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2012 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_TRACE_H -#define ANDROID_TRACE_H - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -// See for more ATRACE_* macros. - -// ATRACE_NAME traces the beginning and end of the current scope. To trace -// the correct start and end times this macro should be declared first in the -// scope body. -#define ATRACE_NAME(name) android::ScopedTrace ___tracer(ATRACE_TAG, name) -// ATRACE_CALL is an ATRACE_NAME that uses the current function name. -#define ATRACE_CALL() ATRACE_NAME(__FUNCTION__) - -namespace android { - -class ScopedTrace { -public: -inline ScopedTrace(uint64_t tag, const char* name) - : mTag(tag) { - atrace_begin(mTag,name); -} - -inline ~ScopedTrace() { - atrace_end(mTag); -} - -private: - uint64_t mTag; -}; - -}; // namespace android - -#endif // ANDROID_TRACE_H diff --git a/external/android/include/18/frameworks/native/include/utils/TypeHelpers.h b/external/android/include/18/frameworks/native/include/utils/TypeHelpers.h deleted file mode 100644 index 13c9081..0000000 --- a/external/android/include/18/frameworks/native/include/utils/TypeHelpers.h +++ /dev/null @@ -1,302 +0,0 @@ -/* - * Copyright (C) 2005 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_TYPE_HELPERS_H -#define ANDROID_TYPE_HELPERS_H - -#include -#include -#include -#include - -// --------------------------------------------------------------------------- - -namespace android { - -/* - * Types traits - */ - -template struct trait_trivial_ctor { enum { value = false }; }; -template struct trait_trivial_dtor { enum { value = false }; }; -template struct trait_trivial_copy { enum { value = false }; }; -template struct trait_trivial_move { enum { value = false }; }; -template struct trait_pointer { enum { value = false }; }; -template struct trait_pointer { enum { value = true }; }; - -template -struct traits { - enum { - // whether this type is a pointer - is_pointer = trait_pointer::value, - // whether this type's constructor is a no-op - has_trivial_ctor = is_pointer || trait_trivial_ctor::value, - // whether this type's destructor is a no-op - has_trivial_dtor = is_pointer || trait_trivial_dtor::value, - // whether this type type can be copy-constructed with memcpy - has_trivial_copy = is_pointer || trait_trivial_copy::value, - // whether this type can be moved with memmove - has_trivial_move = is_pointer || trait_trivial_move::value - }; -}; - -template -struct aggregate_traits { - enum { - is_pointer = false, - has_trivial_ctor = - traits::has_trivial_ctor && traits::has_trivial_ctor, - has_trivial_dtor = - traits::has_trivial_dtor && traits::has_trivial_dtor, - has_trivial_copy = - traits::has_trivial_copy && traits::has_trivial_copy, - has_trivial_move = - traits::has_trivial_move && traits::has_trivial_move - }; -}; - -#define ANDROID_TRIVIAL_CTOR_TRAIT( T ) \ - template<> struct trait_trivial_ctor< T > { enum { value = true }; }; - -#define ANDROID_TRIVIAL_DTOR_TRAIT( T ) \ - template<> struct trait_trivial_dtor< T > { enum { value = true }; }; - -#define ANDROID_TRIVIAL_COPY_TRAIT( T ) \ - template<> struct trait_trivial_copy< T > { enum { value = true }; }; - -#define ANDROID_TRIVIAL_MOVE_TRAIT( T ) \ - template<> struct trait_trivial_move< T > { enum { value = true }; }; - -#define ANDROID_BASIC_TYPES_TRAITS( T ) \ - ANDROID_TRIVIAL_CTOR_TRAIT( T ) \ - ANDROID_TRIVIAL_DTOR_TRAIT( T ) \ - ANDROID_TRIVIAL_COPY_TRAIT( T ) \ - ANDROID_TRIVIAL_MOVE_TRAIT( T ) - -// --------------------------------------------------------------------------- - -/* - * basic types traits - */ - -ANDROID_BASIC_TYPES_TRAITS( void ) -ANDROID_BASIC_TYPES_TRAITS( bool ) -ANDROID_BASIC_TYPES_TRAITS( char ) -ANDROID_BASIC_TYPES_TRAITS( unsigned char ) -ANDROID_BASIC_TYPES_TRAITS( short ) -ANDROID_BASIC_TYPES_TRAITS( unsigned short ) -ANDROID_BASIC_TYPES_TRAITS( int ) -ANDROID_BASIC_TYPES_TRAITS( unsigned int ) -ANDROID_BASIC_TYPES_TRAITS( long ) -ANDROID_BASIC_TYPES_TRAITS( unsigned long ) -ANDROID_BASIC_TYPES_TRAITS( long long ) -ANDROID_BASIC_TYPES_TRAITS( unsigned long long ) -ANDROID_BASIC_TYPES_TRAITS( float ) -ANDROID_BASIC_TYPES_TRAITS( double ) - -// --------------------------------------------------------------------------- - - -/* - * compare and order types - */ - -template inline -int strictly_order_type(const TYPE& lhs, const TYPE& rhs) { - return (lhs < rhs) ? 1 : 0; -} - -template inline -int compare_type(const TYPE& lhs, const TYPE& rhs) { - return strictly_order_type(rhs, lhs) - strictly_order_type(lhs, rhs); -} - -/* - * create, destroy, copy and move types... - */ - -template inline -void construct_type(TYPE* p, size_t n) { - if (!traits::has_trivial_ctor) { - while (n--) { - new(p++) TYPE; - } - } -} - -template inline -void destroy_type(TYPE* p, size_t n) { - if (!traits::has_trivial_dtor) { - while (n--) { - p->~TYPE(); - p++; - } - } -} - -template inline -void copy_type(TYPE* d, const TYPE* s, size_t n) { - if (!traits::has_trivial_copy) { - while (n--) { - new(d) TYPE(*s); - d++, s++; - } - } else { - memcpy(d,s,n*sizeof(TYPE)); - } -} - -template inline -void splat_type(TYPE* where, const TYPE* what, size_t n) { - if (!traits::has_trivial_copy) { - while (n--) { - new(where) TYPE(*what); - where++; - } - } else { - while (n--) { - *where++ = *what; - } - } -} - -template inline -void move_forward_type(TYPE* d, const TYPE* s, size_t n = 1) { - if ((traits::has_trivial_dtor && traits::has_trivial_copy) - || traits::has_trivial_move) - { - memmove(d,s,n*sizeof(TYPE)); - } else { - d += n; - s += n; - while (n--) { - --d, --s; - if (!traits::has_trivial_copy) { - new(d) TYPE(*s); - } else { - *d = *s; - } - if (!traits::has_trivial_dtor) { - s->~TYPE(); - } - } - } -} - -template inline -void move_backward_type(TYPE* d, const TYPE* s, size_t n = 1) { - if ((traits::has_trivial_dtor && traits::has_trivial_copy) - || traits::has_trivial_move) - { - memmove(d,s,n*sizeof(TYPE)); - } else { - while (n--) { - if (!traits::has_trivial_copy) { - new(d) TYPE(*s); - } else { - *d = *s; - } - if (!traits::has_trivial_dtor) { - s->~TYPE(); - } - d++, s++; - } - } -} - -// --------------------------------------------------------------------------- - -/* - * a key/value pair - */ - -template -struct key_value_pair_t { - typedef KEY key_t; - typedef VALUE value_t; - - KEY key; - VALUE value; - key_value_pair_t() { } - key_value_pair_t(const key_value_pair_t& o) : key(o.key), value(o.value) { } - key_value_pair_t(const KEY& k, const VALUE& v) : key(k), value(v) { } - key_value_pair_t(const KEY& k) : key(k) { } - inline bool operator < (const key_value_pair_t& o) const { - return strictly_order_type(key, o.key); - } - inline const KEY& getKey() const { - return key; - } - inline const VALUE& getValue() const { - return value; - } -}; - -template -struct trait_trivial_ctor< key_value_pair_t > -{ enum { value = aggregate_traits::has_trivial_ctor }; }; -template -struct trait_trivial_dtor< key_value_pair_t > -{ enum { value = aggregate_traits::has_trivial_dtor }; }; -template -struct trait_trivial_copy< key_value_pair_t > -{ enum { value = aggregate_traits::has_trivial_copy }; }; -template -struct trait_trivial_move< key_value_pair_t > -{ enum { value = aggregate_traits::has_trivial_move }; }; - -// --------------------------------------------------------------------------- - -/* - * Hash codes. - */ -typedef uint32_t hash_t; - -template -hash_t hash_type(const TKey& key); - -/* Built-in hash code specializations. - * Assumes pointers are 32bit. */ -#define ANDROID_INT32_HASH(T) \ - template <> inline hash_t hash_type(const T& value) { return hash_t(value); } -#define ANDROID_INT64_HASH(T) \ - template <> inline hash_t hash_type(const T& value) { \ - return hash_t((value >> 32) ^ value); } -#define ANDROID_REINTERPRET_HASH(T, R) \ - template <> inline hash_t hash_type(const T& value) { \ - return hash_type(*reinterpret_cast(&value)); } - -ANDROID_INT32_HASH(bool) -ANDROID_INT32_HASH(int8_t) -ANDROID_INT32_HASH(uint8_t) -ANDROID_INT32_HASH(int16_t) -ANDROID_INT32_HASH(uint16_t) -ANDROID_INT32_HASH(int32_t) -ANDROID_INT32_HASH(uint32_t) -ANDROID_INT64_HASH(int64_t) -ANDROID_INT64_HASH(uint64_t) -ANDROID_REINTERPRET_HASH(float, uint32_t) -ANDROID_REINTERPRET_HASH(double, uint64_t) - -template inline hash_t hash_type(T* const & value) { - return hash_type(uintptr_t(value)); -} - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_TYPE_HELPERS_H diff --git a/external/android/include/18/frameworks/native/include/utils/Unicode.h b/external/android/include/18/frameworks/native/include/utils/Unicode.h deleted file mode 100644 index 9273533..0000000 --- a/external/android/include/18/frameworks/native/include/utils/Unicode.h +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (C) 2005 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_UNICODE_H -#define ANDROID_UNICODE_H - -#include -#include - -extern "C" { - -typedef uint32_t char32_t; -typedef uint16_t char16_t; - -// Standard string functions on char16_t strings. -int strcmp16(const char16_t *, const char16_t *); -int strncmp16(const char16_t *s1, const char16_t *s2, size_t n); -size_t strlen16(const char16_t *); -size_t strnlen16(const char16_t *, size_t); -char16_t *strcpy16(char16_t *, const char16_t *); -char16_t *strncpy16(char16_t *, const char16_t *, size_t); - -// Version of comparison that supports embedded nulls. -// This is different than strncmp() because we don't stop -// at a nul character and consider the strings to be different -// if the lengths are different (thus we need to supply the -// lengths of both strings). This can also be used when -// your string is not nul-terminated as it will have the -// equivalent result as strcmp16 (unlike strncmp16). -int strzcmp16(const char16_t *s1, size_t n1, const char16_t *s2, size_t n2); - -// Version of strzcmp16 for comparing strings in different endianness. -int strzcmp16_h_n(const char16_t *s1H, size_t n1, const char16_t *s2N, size_t n2); - -// Standard string functions on char32_t strings. -size_t strlen32(const char32_t *); -size_t strnlen32(const char32_t *, size_t); - -/** - * Measure the length of a UTF-32 string in UTF-8. If the string is invalid - * such as containing a surrogate character, -1 will be returned. - */ -ssize_t utf32_to_utf8_length(const char32_t *src, size_t src_len); - -/** - * Stores a UTF-8 string converted from "src" in "dst", if "dst_length" is not - * large enough to store the string, the part of the "src" string is stored - * into "dst" as much as possible. See the examples for more detail. - * Returns the size actually used for storing the string. - * dst" is not null-terminated when dst_len is fully used (like strncpy). - * - * Example 1 - * "src" == \u3042\u3044 (\xE3\x81\x82\xE3\x81\x84) - * "src_len" == 2 - * "dst_len" >= 7 - * -> - * Returned value == 6 - * "dst" becomes \xE3\x81\x82\xE3\x81\x84\0 - * (note that "dst" is null-terminated) - * - * Example 2 - * "src" == \u3042\u3044 (\xE3\x81\x82\xE3\x81\x84) - * "src_len" == 2 - * "dst_len" == 5 - * -> - * Returned value == 3 - * "dst" becomes \xE3\x81\x82\0 - * (note that "dst" is null-terminated, but \u3044 is not stored in "dst" - * since "dst" does not have enough size to store the character) - * - * Example 3 - * "src" == \u3042\u3044 (\xE3\x81\x82\xE3\x81\x84) - * "src_len" == 2 - * "dst_len" == 6 - * -> - * Returned value == 6 - * "dst" becomes \xE3\x81\x82\xE3\x81\x84 - * (note that "dst" is NOT null-terminated, like strncpy) - */ -void utf32_to_utf8(const char32_t* src, size_t src_len, char* dst); - -/** - * Returns the unicode value at "index". - * Returns -1 when the index is invalid (equals to or more than "src_len"). - * If returned value is positive, it is able to be converted to char32_t, which - * is unsigned. Then, if "next_index" is not NULL, the next index to be used is - * stored in "next_index". "next_index" can be NULL. - */ -int32_t utf32_from_utf8_at(const char *src, size_t src_len, size_t index, size_t *next_index); - - -/** - * Returns the UTF-8 length of UTF-16 string "src". - */ -ssize_t utf16_to_utf8_length(const char16_t *src, size_t src_len); - -/** - * Converts a UTF-16 string to UTF-8. The destination buffer must be large - * enough to fit the UTF-16 as measured by utf16_to_utf8_length with an added - * NULL terminator. - */ -void utf16_to_utf8(const char16_t* src, size_t src_len, char* dst); - -/** - * Returns the length of "src" when "src" is valid UTF-8 string. - * Returns 0 if src is NULL or 0-length string. Returns -1 when the source - * is an invalid string. - * - * This function should be used to determine whether "src" is valid UTF-8 - * characters with valid unicode codepoints. "src" must be null-terminated. - * - * If you are going to use other utf8_to_... functions defined in this header - * with string which may not be valid UTF-8 with valid codepoint (form 0 to - * 0x10FFFF), you should use this function before calling others, since the - * other functions do not check whether the string is valid UTF-8 or not. - * - * If you do not care whether "src" is valid UTF-8 or not, you should use - * strlen() as usual, which should be much faster. - */ -ssize_t utf8_length(const char *src); - -/** - * Measure the length of a UTF-32 string. - */ -size_t utf8_to_utf32_length(const char *src, size_t src_len); - -/** - * Stores a UTF-32 string converted from "src" in "dst". "dst" must be large - * enough to store the entire converted string as measured by - * utf8_to_utf32_length plus space for a NULL terminator. - */ -void utf8_to_utf32(const char* src, size_t src_len, char32_t* dst); - -/** - * Returns the UTF-16 length of UTF-8 string "src". - */ -ssize_t utf8_to_utf16_length(const uint8_t* src, size_t srcLen); - -/** - * Convert UTF-8 to UTF-16 including surrogate pairs. - * Returns a pointer to the end of the string (where a null terminator might go - * if you wanted to add one). - */ -char16_t* utf8_to_utf16_no_null_terminator(const uint8_t* src, size_t srcLen, char16_t* dst); - -/** - * Convert UTF-8 to UTF-16 including surrogate pairs. The destination buffer - * must be large enough to hold the result as measured by utf8_to_utf16_length - * plus an added NULL terminator. - */ -void utf8_to_utf16(const uint8_t* src, size_t srcLen, char16_t* dst); - -} - -#endif diff --git a/external/android/include/18/frameworks/native/include/utils/UniquePtr.h b/external/android/include/18/frameworks/native/include/utils/UniquePtr.h deleted file mode 100644 index bc62fe6..0000000 --- a/external/android/include/18/frameworks/native/include/utils/UniquePtr.h +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -/* === NOTE === NOTE === NOTE === NOTE === NOTE === NOTE === NOTE === NOTE === - * - * THIS IS A COPY OF libcore/include/UniquePtr.h AND AS SUCH THAT IS THE - * CANONICAL SOURCE OF THIS FILE. PLEASE KEEP THEM IN SYNC. - * - * === NOTE === NOTE === NOTE === NOTE === NOTE === NOTE === NOTE === NOTE === - */ - -#ifndef UNIQUE_PTR_H_included -#define UNIQUE_PTR_H_included - -#include // For NULL. - -// Default deleter for pointer types. -template -struct DefaultDelete { - enum { type_must_be_complete = sizeof(T) }; - DefaultDelete() {} - void operator()(T* p) const { - delete p; - } -}; - -// Default deleter for array types. -template -struct DefaultDelete { - enum { type_must_be_complete = sizeof(T) }; - void operator()(T* p) const { - delete[] p; - } -}; - -// A smart pointer that deletes the given pointer on destruction. -// Equivalent to C++0x's std::unique_ptr (a combination of boost::scoped_ptr -// and boost::scoped_array). -// Named to be in keeping with Android style but also to avoid -// collision with any other implementation, until we can switch over -// to unique_ptr. -// Use thus: -// UniquePtr c(new C); -template > -class UniquePtr { -public: - // Construct a new UniquePtr, taking ownership of the given raw pointer. - explicit UniquePtr(T* ptr = NULL) : mPtr(ptr) { - } - - ~UniquePtr() { - reset(); - } - - // Accessors. - T& operator*() const { return *mPtr; } - T* operator->() const { return mPtr; } - T* get() const { return mPtr; } - - // Returns the raw pointer and hands over ownership to the caller. - // The pointer will not be deleted by UniquePtr. - T* release() __attribute__((warn_unused_result)) { - T* result = mPtr; - mPtr = NULL; - return result; - } - - // Takes ownership of the given raw pointer. - // If this smart pointer previously owned a different raw pointer, that - // raw pointer will be freed. - void reset(T* ptr = NULL) { - if (ptr != mPtr) { - D()(mPtr); - mPtr = ptr; - } - } - -private: - // The raw pointer. - T* mPtr; - - // Comparing unique pointers is probably a mistake, since they're unique. - template bool operator==(const UniquePtr& p) const; - template bool operator!=(const UniquePtr& p) const; - - // Disallow copy and assignment. - UniquePtr(const UniquePtr&); - void operator=(const UniquePtr&); -}; - -// Partial specialization for array types. Like std::unique_ptr, this removes -// operator* and operator-> but adds operator[]. -template -class UniquePtr { -public: - explicit UniquePtr(T* ptr = NULL) : mPtr(ptr) { - } - - ~UniquePtr() { - reset(); - } - - T& operator[](size_t i) const { - return mPtr[i]; - } - T* get() const { return mPtr; } - - T* release() __attribute__((warn_unused_result)) { - T* result = mPtr; - mPtr = NULL; - return result; - } - - void reset(T* ptr = NULL) { - if (ptr != mPtr) { - D()(mPtr); - mPtr = ptr; - } - } - -private: - T* mPtr; - - // Disallow copy and assignment. - UniquePtr(const UniquePtr&); - void operator=(const UniquePtr&); -}; - -#if UNIQUE_PTR_TESTS - -// Run these tests with: -// g++ -g -DUNIQUE_PTR_TESTS -x c++ UniquePtr.h && ./a.out - -#include - -static void assert(bool b) { - if (!b) { - fprintf(stderr, "FAIL\n"); - abort(); - } - fprintf(stderr, "OK\n"); -} -static int cCount = 0; -struct C { - C() { ++cCount; } - ~C() { --cCount; } -}; -static bool freed = false; -struct Freer { - void operator()(int* p) { - assert(*p == 123); - free(p); - freed = true; - } -}; - -int main(int argc, char* argv[]) { - // - // UniquePtr tests... - // - - // Can we free a single object? - { - UniquePtr c(new C); - assert(cCount == 1); - } - assert(cCount == 0); - // Does release work? - C* rawC; - { - UniquePtr c(new C); - assert(cCount == 1); - rawC = c.release(); - } - assert(cCount == 1); - delete rawC; - // Does reset work? - { - UniquePtr c(new C); - assert(cCount == 1); - c.reset(new C); - assert(cCount == 1); - } - assert(cCount == 0); - - // - // UniquePtr tests... - // - - // Can we free an array? - { - UniquePtr cs(new C[4]); - assert(cCount == 4); - } - assert(cCount == 0); - // Does release work? - { - UniquePtr c(new C[4]); - assert(cCount == 4); - rawC = c.release(); - } - assert(cCount == 4); - delete[] rawC; - // Does reset work? - { - UniquePtr c(new C[4]); - assert(cCount == 4); - c.reset(new C[2]); - assert(cCount == 2); - } - assert(cCount == 0); - - // - // Custom deleter tests... - // - assert(!freed); - { - UniquePtr i(reinterpret_cast(malloc(sizeof(int)))); - *i = 123; - } - assert(freed); - return 0; -} -#endif - -#endif // UNIQUE_PTR_H_included diff --git a/external/android/include/18/frameworks/native/include/utils/Vector.h b/external/android/include/18/frameworks/native/include/utils/Vector.h deleted file mode 100644 index ed7b725..0000000 --- a/external/android/include/18/frameworks/native/include/utils/Vector.h +++ /dev/null @@ -1,423 +0,0 @@ -/* - * Copyright (C) 2005 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_VECTOR_H -#define ANDROID_VECTOR_H - -#include -#include -#include - -#include - -#include -#include - -// --------------------------------------------------------------------------- - -namespace android { - -template -class SortedVector; - -/*! - * The main templated vector class ensuring type safety - * while making use of VectorImpl. - * This is the class users want to use. - */ - -template -class Vector : private VectorImpl -{ -public: - typedef TYPE value_type; - - /*! - * Constructors and destructors - */ - - Vector(); - Vector(const Vector& rhs); - explicit Vector(const SortedVector& rhs); - virtual ~Vector(); - - /*! copy operator */ - const Vector& operator = (const Vector& rhs) const; - Vector& operator = (const Vector& rhs); - - const Vector& operator = (const SortedVector& rhs) const; - Vector& operator = (const SortedVector& rhs); - - /* - * empty the vector - */ - - inline void clear() { VectorImpl::clear(); } - - /*! - * vector stats - */ - - //! returns number of items in the vector - inline size_t size() const { return VectorImpl::size(); } - //! returns whether or not the vector is empty - inline bool isEmpty() const { return VectorImpl::isEmpty(); } - //! returns how many items can be stored without reallocating the backing store - inline size_t capacity() const { return VectorImpl::capacity(); } - //! sets the capacity. capacity can never be reduced less than size() - inline ssize_t setCapacity(size_t size) { return VectorImpl::setCapacity(size); } - - /*! - * set the size of the vector. items are appended with the default - * constructor, or removed from the end as needed. - */ - inline ssize_t resize(size_t size) { return VectorImpl::resize(size); } - - /*! - * C-style array access - */ - - //! read-only C-style access - inline const TYPE* array() const; - //! read-write C-style access - TYPE* editArray(); - - /*! - * accessors - */ - - //! read-only access to an item at a given index - inline const TYPE& operator [] (size_t index) const; - //! alternate name for operator [] - inline const TYPE& itemAt(size_t index) const; - //! stack-usage of the vector. returns the top of the stack (last element) - const TYPE& top() const; - - /*! - * modifying the array - */ - - //! copy-on write support, grants write access to an item - TYPE& editItemAt(size_t index); - //! grants right access to the top of the stack (last element) - TYPE& editTop(); - - /*! - * append/insert another vector - */ - - //! insert another vector at a given index - ssize_t insertVectorAt(const Vector& vector, size_t index); - - //! append another vector at the end of this one - ssize_t appendVector(const Vector& vector); - - - //! insert an array at a given index - ssize_t insertArrayAt(const TYPE* array, size_t index, size_t length); - - //! append an array at the end of this vector - ssize_t appendArray(const TYPE* array, size_t length); - - /*! - * add/insert/replace items - */ - - //! insert one or several items initialized with their default constructor - inline ssize_t insertAt(size_t index, size_t numItems = 1); - //! insert one or several items initialized from a prototype item - ssize_t insertAt(const TYPE& prototype_item, size_t index, size_t numItems = 1); - //! pop the top of the stack (removes the last element). No-op if the stack's empty - inline void pop(); - //! pushes an item initialized with its default constructor - inline void push(); - //! pushes an item on the top of the stack - void push(const TYPE& item); - //! same as push() but returns the index the item was added at (or an error) - inline ssize_t add(); - //! same as push() but returns the index the item was added at (or an error) - ssize_t add(const TYPE& item); - //! replace an item with a new one initialized with its default constructor - inline ssize_t replaceAt(size_t index); - //! replace an item with a new one - ssize_t replaceAt(const TYPE& item, size_t index); - - /*! - * remove items - */ - - //! remove several items - inline ssize_t removeItemsAt(size_t index, size_t count = 1); - //! remove one item - inline ssize_t removeAt(size_t index) { return removeItemsAt(index); } - - /*! - * sort (stable) the array - */ - - typedef int (*compar_t)(const TYPE* lhs, const TYPE* rhs); - typedef int (*compar_r_t)(const TYPE* lhs, const TYPE* rhs, void* state); - - inline status_t sort(compar_t cmp); - inline status_t sort(compar_r_t cmp, void* state); - - // for debugging only - inline size_t getItemSize() const { return itemSize(); } - - - /* - * these inlines add some level of compatibility with STL. eventually - * we should probably turn things around. - */ - typedef TYPE* iterator; - typedef TYPE const* const_iterator; - - inline iterator begin() { return editArray(); } - inline iterator end() { return editArray() + size(); } - inline const_iterator begin() const { return array(); } - inline const_iterator end() const { return array() + size(); } - inline void reserve(size_t n) { setCapacity(n); } - inline bool empty() const{ return isEmpty(); } - inline void push_back(const TYPE& item) { insertAt(item, size(), 1); } - inline void push_front(const TYPE& item) { insertAt(item, 0, 1); } - inline iterator erase(iterator pos) { - ssize_t index = removeItemsAt(pos-array()); - return begin() + index; - } - -protected: - virtual void do_construct(void* storage, size_t num) const; - virtual void do_destroy(void* storage, size_t num) const; - virtual void do_copy(void* dest, const void* from, size_t num) const; - virtual void do_splat(void* dest, const void* item, size_t num) const; - virtual void do_move_forward(void* dest, const void* from, size_t num) const; - virtual void do_move_backward(void* dest, const void* from, size_t num) const; -}; - -// Vector can be trivially moved using memcpy() because moving does not -// require any change to the underlying SharedBuffer contents or reference count. -template struct trait_trivial_move > { enum { value = true }; }; - -// --------------------------------------------------------------------------- -// No user serviceable parts from here... -// --------------------------------------------------------------------------- - -template inline -Vector::Vector() - : VectorImpl(sizeof(TYPE), - ((traits::has_trivial_ctor ? HAS_TRIVIAL_CTOR : 0) - |(traits::has_trivial_dtor ? HAS_TRIVIAL_DTOR : 0) - |(traits::has_trivial_copy ? HAS_TRIVIAL_COPY : 0)) - ) -{ -} - -template inline -Vector::Vector(const Vector& rhs) - : VectorImpl(rhs) { -} - -template inline -Vector::Vector(const SortedVector& rhs) - : VectorImpl(static_cast(rhs)) { -} - -template inline -Vector::~Vector() { - finish_vector(); -} - -template inline -Vector& Vector::operator = (const Vector& rhs) { - VectorImpl::operator = (rhs); - return *this; -} - -template inline -const Vector& Vector::operator = (const Vector& rhs) const { - VectorImpl::operator = (static_cast(rhs)); - return *this; -} - -template inline -Vector& Vector::operator = (const SortedVector& rhs) { - VectorImpl::operator = (static_cast(rhs)); - return *this; -} - -template inline -const Vector& Vector::operator = (const SortedVector& rhs) const { - VectorImpl::operator = (rhs); - return *this; -} - -template inline -const TYPE* Vector::array() const { - return static_cast(arrayImpl()); -} - -template inline -TYPE* Vector::editArray() { - return static_cast(editArrayImpl()); -} - - -template inline -const TYPE& Vector::operator[](size_t index) const { - LOG_FATAL_IF(index>=size(), - "%s: index=%u out of range (%u)", __PRETTY_FUNCTION__, - int(index), int(size())); - return *(array() + index); -} - -template inline -const TYPE& Vector::itemAt(size_t index) const { - return operator[](index); -} - -template inline -const TYPE& Vector::top() const { - return *(array() + size() - 1); -} - -template inline -TYPE& Vector::editItemAt(size_t index) { - return *( static_cast(editItemLocation(index)) ); -} - -template inline -TYPE& Vector::editTop() { - return *( static_cast(editItemLocation(size()-1)) ); -} - -template inline -ssize_t Vector::insertVectorAt(const Vector& vector, size_t index) { - return VectorImpl::insertVectorAt(reinterpret_cast(vector), index); -} - -template inline -ssize_t Vector::appendVector(const Vector& vector) { - return VectorImpl::appendVector(reinterpret_cast(vector)); -} - -template inline -ssize_t Vector::insertArrayAt(const TYPE* array, size_t index, size_t length) { - return VectorImpl::insertArrayAt(array, index, length); -} - -template inline -ssize_t Vector::appendArray(const TYPE* array, size_t length) { - return VectorImpl::appendArray(array, length); -} - -template inline -ssize_t Vector::insertAt(const TYPE& item, size_t index, size_t numItems) { - return VectorImpl::insertAt(&item, index, numItems); -} - -template inline -void Vector::push(const TYPE& item) { - return VectorImpl::push(&item); -} - -template inline -ssize_t Vector::add(const TYPE& item) { - return VectorImpl::add(&item); -} - -template inline -ssize_t Vector::replaceAt(const TYPE& item, size_t index) { - return VectorImpl::replaceAt(&item, index); -} - -template inline -ssize_t Vector::insertAt(size_t index, size_t numItems) { - return VectorImpl::insertAt(index, numItems); -} - -template inline -void Vector::pop() { - VectorImpl::pop(); -} - -template inline -void Vector::push() { - VectorImpl::push(); -} - -template inline -ssize_t Vector::add() { - return VectorImpl::add(); -} - -template inline -ssize_t Vector::replaceAt(size_t index) { - return VectorImpl::replaceAt(index); -} - -template inline -ssize_t Vector::removeItemsAt(size_t index, size_t count) { - return VectorImpl::removeItemsAt(index, count); -} - -template inline -status_t Vector::sort(Vector::compar_t cmp) { - return VectorImpl::sort((VectorImpl::compar_t)cmp); -} - -template inline -status_t Vector::sort(Vector::compar_r_t cmp, void* state) { - return VectorImpl::sort((VectorImpl::compar_r_t)cmp, state); -} - -// --------------------------------------------------------------------------- - -template -void Vector::do_construct(void* storage, size_t num) const { - construct_type( reinterpret_cast(storage), num ); -} - -template -void Vector::do_destroy(void* storage, size_t num) const { - destroy_type( reinterpret_cast(storage), num ); -} - -template -void Vector::do_copy(void* dest, const void* from, size_t num) const { - copy_type( reinterpret_cast(dest), reinterpret_cast(from), num ); -} - -template -void Vector::do_splat(void* dest, const void* item, size_t num) const { - splat_type( reinterpret_cast(dest), reinterpret_cast(item), num ); -} - -template -void Vector::do_move_forward(void* dest, const void* from, size_t num) const { - move_forward_type( reinterpret_cast(dest), reinterpret_cast(from), num ); -} - -template -void Vector::do_move_backward(void* dest, const void* from, size_t num) const { - move_backward_type( reinterpret_cast(dest), reinterpret_cast(from), num ); -} - -}; // namespace android - - -// --------------------------------------------------------------------------- - -#endif // ANDROID_VECTOR_H diff --git a/external/android/include/18/frameworks/native/include/utils/VectorImpl.h b/external/android/include/18/frameworks/native/include/utils/VectorImpl.h deleted file mode 100644 index 9bc50e6..0000000 --- a/external/android/include/18/frameworks/native/include/utils/VectorImpl.h +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (C) 2005 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_VECTOR_IMPL_H -#define ANDROID_VECTOR_IMPL_H - -#include -#include -#include -#include - -// --------------------------------------------------------------------------- -// No user serviceable parts in here... -// --------------------------------------------------------------------------- - -namespace android { - -/*! - * Implementation of the guts of the vector<> class - * this ensures backward binary compatibility and - * reduces code size. - * For performance reasons, we expose mStorage and mCount - * so these fields are set in stone. - * - */ - -class VectorImpl -{ -public: - enum { // flags passed to the ctor - HAS_TRIVIAL_CTOR = 0x00000001, - HAS_TRIVIAL_DTOR = 0x00000002, - HAS_TRIVIAL_COPY = 0x00000004, - }; - - VectorImpl(size_t itemSize, uint32_t flags); - VectorImpl(const VectorImpl& rhs); - virtual ~VectorImpl(); - - /*! must be called from subclasses destructor */ - void finish_vector(); - - VectorImpl& operator = (const VectorImpl& rhs); - - /*! C-style array access */ - inline const void* arrayImpl() const { return mStorage; } - void* editArrayImpl(); - - /*! vector stats */ - inline size_t size() const { return mCount; } - inline bool isEmpty() const { return mCount == 0; } - size_t capacity() const; - ssize_t setCapacity(size_t size); - ssize_t resize(size_t size); - - /*! append/insert another vector or array */ - ssize_t insertVectorAt(const VectorImpl& vector, size_t index); - ssize_t appendVector(const VectorImpl& vector); - ssize_t insertArrayAt(const void* array, size_t index, size_t length); - ssize_t appendArray(const void* array, size_t length); - - /*! add/insert/replace items */ - ssize_t insertAt(size_t where, size_t numItems = 1); - ssize_t insertAt(const void* item, size_t where, size_t numItems = 1); - void pop(); - void push(); - void push(const void* item); - ssize_t add(); - ssize_t add(const void* item); - ssize_t replaceAt(size_t index); - ssize_t replaceAt(const void* item, size_t index); - - /*! remove items */ - ssize_t removeItemsAt(size_t index, size_t count = 1); - void clear(); - - const void* itemLocation(size_t index) const; - void* editItemLocation(size_t index); - - typedef int (*compar_t)(const void* lhs, const void* rhs); - typedef int (*compar_r_t)(const void* lhs, const void* rhs, void* state); - status_t sort(compar_t cmp); - status_t sort(compar_r_t cmp, void* state); - -protected: - size_t itemSize() const; - void release_storage(); - - virtual void do_construct(void* storage, size_t num) const = 0; - virtual void do_destroy(void* storage, size_t num) const = 0; - virtual void do_copy(void* dest, const void* from, size_t num) const = 0; - virtual void do_splat(void* dest, const void* item, size_t num) const = 0; - virtual void do_move_forward(void* dest, const void* from, size_t num) const = 0; - virtual void do_move_backward(void* dest, const void* from, size_t num) const = 0; - - // take care of FBC... - virtual void reservedVectorImpl1(); - virtual void reservedVectorImpl2(); - virtual void reservedVectorImpl3(); - virtual void reservedVectorImpl4(); - virtual void reservedVectorImpl5(); - virtual void reservedVectorImpl6(); - virtual void reservedVectorImpl7(); - virtual void reservedVectorImpl8(); - -private: - void* _grow(size_t where, size_t amount); - void _shrink(size_t where, size_t amount); - - inline void _do_construct(void* storage, size_t num) const; - inline void _do_destroy(void* storage, size_t num) const; - inline void _do_copy(void* dest, const void* from, size_t num) const; - inline void _do_splat(void* dest, const void* item, size_t num) const; - inline void _do_move_forward(void* dest, const void* from, size_t num) const; - inline void _do_move_backward(void* dest, const void* from, size_t num) const; - - // These 2 fields are exposed in the inlines below, - // so they're set in stone. - void * mStorage; // base address of the vector - size_t mCount; // number of items - - const uint32_t mFlags; - const size_t mItemSize; -}; - - - -class SortedVectorImpl : public VectorImpl -{ -public: - SortedVectorImpl(size_t itemSize, uint32_t flags); - SortedVectorImpl(const VectorImpl& rhs); - virtual ~SortedVectorImpl(); - - SortedVectorImpl& operator = (const SortedVectorImpl& rhs); - - //! finds the index of an item - ssize_t indexOf(const void* item) const; - - //! finds where this item should be inserted - size_t orderOf(const void* item) const; - - //! add an item in the right place (or replaces it if there is one) - ssize_t add(const void* item); - - //! merges a vector into this one - ssize_t merge(const VectorImpl& vector); - ssize_t merge(const SortedVectorImpl& vector); - - //! removes an item - ssize_t remove(const void* item); - -protected: - virtual int do_compare(const void* lhs, const void* rhs) const = 0; - - // take care of FBC... - virtual void reservedSortedVectorImpl1(); - virtual void reservedSortedVectorImpl2(); - virtual void reservedSortedVectorImpl3(); - virtual void reservedSortedVectorImpl4(); - virtual void reservedSortedVectorImpl5(); - virtual void reservedSortedVectorImpl6(); - virtual void reservedSortedVectorImpl7(); - virtual void reservedSortedVectorImpl8(); - -private: - ssize_t _indexOrderOf(const void* item, size_t* order = 0) const; - - // these are made private, because they can't be used on a SortedVector - // (they don't have an implementation either) - ssize_t add(); - void pop(); - void push(); - void push(const void* item); - ssize_t insertVectorAt(const VectorImpl& vector, size_t index); - ssize_t appendVector(const VectorImpl& vector); - ssize_t insertArrayAt(const void* array, size_t index, size_t length); - ssize_t appendArray(const void* array, size_t length); - ssize_t insertAt(size_t where, size_t numItems = 1); - ssize_t insertAt(const void* item, size_t where, size_t numItems = 1); - ssize_t replaceAt(size_t index); - ssize_t replaceAt(const void* item, size_t index); -}; - -}; // namespace android - - -// --------------------------------------------------------------------------- - -#endif // ANDROID_VECTOR_IMPL_H diff --git a/external/android/include/18/frameworks/native/include/utils/WorkQueue.h b/external/android/include/18/frameworks/native/include/utils/WorkQueue.h deleted file mode 100644 index e3c75b2..0000000 --- a/external/android/include/18/frameworks/native/include/utils/WorkQueue.h +++ /dev/null @@ -1,119 +0,0 @@ -/*] - * Copyright (C) 2012 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 _LIBS_UTILS_WORK_QUEUE_H -#define _LIBS_UTILS_WORK_QUEUE_H - -#include -#include -#include - -namespace android { - -/* - * A threaded work queue. - * - * This class is designed to make it easy to run a bunch of isolated work - * units in parallel, using up to the specified number of threads. - * To use it, write a loop to post work units to the work queue, then synchronize - * on the queue at the end. - */ -class WorkQueue { -public: - class WorkUnit { - public: - WorkUnit() { } - virtual ~WorkUnit() { } - - /* - * Runs the work unit. - * If the result is 'true' then the work queue continues scheduling work as usual. - * If the result is 'false' then the work queue is canceled. - */ - virtual bool run() = 0; - }; - - /* Creates a work queue with the specified maximum number of work threads. */ - WorkQueue(size_t maxThreads, bool canCallJava = true); - - /* Destroys the work queue. - * Cancels pending work and waits for all remaining threads to complete. - */ - ~WorkQueue(); - - /* Posts a work unit to run later. - * If the work queue has been canceled or is already finished, returns INVALID_OPERATION - * and does not take ownership of the work unit (caller must destroy it itself). - * Otherwise, returns OK and takes ownership of the work unit (the work queue will - * destroy it automatically). - * - * For flow control, this method blocks when the size of the pending work queue is more - * 'backlog' times the number of threads. This condition reduces the rate of entry into - * the pending work queue and prevents it from growing much more rapidly than the - * work threads can actually handle. - * - * If 'backlog' is 0, then no throttle is applied. - */ - status_t schedule(WorkUnit* workUnit, size_t backlog = 2); - - /* Cancels all pending work. - * If the work queue is already finished, returns INVALID_OPERATION. - * If the work queue is already canceled, returns OK and does nothing else. - * Otherwise, returns OK, discards all pending work units and prevents additional - * work units from being scheduled. - * - * Call finish() after cancel() to wait for all remaining work to complete. - */ - status_t cancel(); - - /* Waits for all work to complete. - * If the work queue is already finished, returns INVALID_OPERATION. - * Otherwise, waits for all work to complete and returns OK. - */ - status_t finish(); - -private: - class WorkThread : public Thread { - public: - WorkThread(WorkQueue* workQueue, bool canCallJava); - virtual ~WorkThread(); - - private: - virtual bool threadLoop(); - - WorkQueue* const mWorkQueue; - }; - - status_t cancelLocked(); - bool threadLoop(); // called from each work thread - - const size_t mMaxThreads; - const bool mCanCallJava; - - Mutex mLock; - Condition mWorkChangedCondition; - Condition mWorkDequeuedCondition; - - bool mCanceled; - bool mFinished; - size_t mIdleThreads; - Vector > mWorkThreads; - Vector mWorkUnits; -}; - -}; // namespace android - -#endif // _LIBS_UTILS_WORK_QUEUE_H diff --git a/external/android/include/18/frameworks/native/include/utils/ZipFileCRO.h b/external/android/include/18/frameworks/native/include/utils/ZipFileCRO.h deleted file mode 100644 index 3e42a95..0000000 --- a/external/android/include/18/frameworks/native/include/utils/ZipFileCRO.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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. - */ - -// -// C API for ead-only access to Zip archives, with minimal heap allocation. -// -#ifndef __LIBS_ZIPFILECRO_H -#define __LIBS_ZIPFILECRO_H - -#include -#include -#include - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Trivial typedef to ensure that ZipFileCRO is not treated as a simple integer. - */ -typedef void* ZipFileCRO; - -/* - * Trivial typedef to ensure that ZipEntryCRO is not treated as a simple - * integer. We use NULL to indicate an invalid value. - */ -typedef void* ZipEntryCRO; - -extern ZipFileCRO ZipFileXRO_open(const char* path); - -extern void ZipFileCRO_destroy(ZipFileCRO zip); - -extern ZipEntryCRO ZipFileCRO_findEntryByName(ZipFileCRO zip, - const char* fileName); - -extern bool ZipFileCRO_getEntryInfo(ZipFileCRO zip, ZipEntryCRO entry, - int* pMethod, size_t* pUncompLen, - size_t* pCompLen, off64_t* pOffset, long* pModWhen, long* pCrc32); - -extern bool ZipFileCRO_uncompressEntry(ZipFileCRO zip, ZipEntryCRO entry, int fd); - -#ifdef __cplusplus -} -#endif - -#endif /*__LIBS_ZIPFILECRO_H*/ diff --git a/external/android/include/18/frameworks/native/include/utils/ZipFileRO.h b/external/android/include/18/frameworks/native/include/utils/ZipFileRO.h deleted file mode 100644 index 547e36a..0000000 --- a/external/android/include/18/frameworks/native/include/utils/ZipFileRO.h +++ /dev/null @@ -1,262 +0,0 @@ -/* - * 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. - */ - -/* - * Read-only access to Zip archives, with minimal heap allocation. - * - * This is similar to the more-complete ZipFile class, but no attempt - * has been made to make them interchangeable. This class operates under - * a very different set of assumptions and constraints. - * - * One such assumption is that if you're getting file descriptors for - * use with this class as a child of a fork() operation, you must be on - * a pread() to guarantee correct operation. This is because pread() can - * atomically read at a file offset without worrying about a lock around an - * lseek() + read() pair. - */ -#ifndef __LIBS_ZIPFILERO_H -#define __LIBS_ZIPFILERO_H - -#include -#include -#include -#include - -#include -#include -#include -#include - -namespace android { - -/* - * Trivial typedef to ensure that ZipEntryRO is not treated as a simple - * integer. We use NULL to indicate an invalid value. - */ -typedef void* ZipEntryRO; - -/* - * Open a Zip archive for reading. - * - * We want "open" and "find entry by name" to be fast operations, and we - * want to use as little memory as possible. We memory-map the file, - * and load a hash table with pointers to the filenames (which aren't - * null-terminated). The other fields are at a fixed offset from the - * filename, so we don't need to extract those (but we do need to byte-read - * and endian-swap them every time we want them). - * - * To speed comparisons when doing a lookup by name, we could make the mapping - * "private" (copy-on-write) and null-terminate the filenames after verifying - * the record structure. However, this requires a private mapping of - * every page that the Central Directory touches. Easier to tuck a copy - * of the string length into the hash table entry. - * - * NOTE: If this is used on file descriptors inherited from a fork() operation, - * you must be on a platform that implements pread() to guarantee correctness - * on the shared file descriptors. - */ -class ZipFileRO { -public: - ZipFileRO() - : mFd(-1), mFileName(NULL), mFileLength(-1), - mDirectoryMap(NULL), - mNumEntries(-1), mDirectoryOffset(-1), - mHashTableSize(-1), mHashTable(NULL) - {} - - ~ZipFileRO(); - - /* - * Open an archive. - */ - status_t open(const char* zipFileName); - - /* - * Find an entry, by name. Returns the entry identifier, or NULL if - * not found. - * - * If two entries have the same name, one will be chosen at semi-random. - */ - ZipEntryRO findEntryByName(const char* fileName) const; - - /* - * Return the #of entries in the Zip archive. - */ - int getNumEntries(void) const { - return mNumEntries; - } - - /* - * Return the Nth entry. Zip file entries are not stored in sorted - * order, and updated entries may appear at the end, so anyone walking - * the archive needs to avoid making ordering assumptions. We take - * that further by returning the Nth non-empty entry in the hash table - * rather than the Nth entry in the archive. - * - * Valid values are [0..numEntries). - * - * [This is currently O(n). If it needs to be fast we can allocate an - * additional data structure or provide an iterator interface.] - */ - ZipEntryRO findEntryByIndex(int idx) const; - - /* - * Copy the filename into the supplied buffer. Returns 0 on success, - * -1 if "entry" is invalid, or the filename length if it didn't fit. The - * length, and the returned string, include the null-termination. - */ - int getEntryFileName(ZipEntryRO entry, char* buffer, int bufLen) const; - - /* - * Get the vital stats for an entry. Pass in NULL pointers for anything - * you don't need. - * - * "*pOffset" holds the Zip file offset of the entry's data. - * - * Returns "false" if "entry" is bogus or if the data in the Zip file - * appears to be bad. - */ - bool getEntryInfo(ZipEntryRO entry, int* pMethod, size_t* pUncompLen, - size_t* pCompLen, off64_t* pOffset, long* pModWhen, long* pCrc32) const; - - /* - * Create a new FileMap object that maps a subset of the archive. For - * an uncompressed entry this effectively provides a pointer to the - * actual data, for a compressed entry this provides the input buffer - * for inflate(). - */ - FileMap* createEntryFileMap(ZipEntryRO entry) const; - - /* - * Uncompress the data into a buffer. Depending on the compression - * format, this is either an "inflate" operation or a memcpy. - * - * Use "uncompLen" from getEntryInfo() to determine the required - * buffer size. - * - * Returns "true" on success. - */ - bool uncompressEntry(ZipEntryRO entry, void* buffer) const; - - /* - * Uncompress the data to an open file descriptor. - */ - bool uncompressEntry(ZipEntryRO entry, int fd) const; - - /* Zip compression methods we support */ - enum { - kCompressStored = 0, // no compression - kCompressDeflated = 8, // standard deflate - }; - - /* - * Utility function: uncompress deflated data, buffer to buffer. - */ - static bool inflateBuffer(void* outBuf, const void* inBuf, - size_t uncompLen, size_t compLen); - - /* - * Utility function: uncompress deflated data, buffer to fd. - */ - static bool inflateBuffer(int fd, const void* inBuf, - size_t uncompLen, size_t compLen); - - /* - * Utility function to convert ZIP's time format to a timespec struct. - */ - static inline void zipTimeToTimespec(long when, struct tm* timespec) { - const long date = when >> 16; - timespec->tm_year = ((date >> 9) & 0x7F) + 80; // Zip is years since 1980 - timespec->tm_mon = (date >> 5) & 0x0F; - timespec->tm_mday = date & 0x1F; - - timespec->tm_hour = (when >> 11) & 0x1F; - timespec->tm_min = (when >> 5) & 0x3F; - timespec->tm_sec = (when & 0x1F) << 1; - } - - /* - * Some basic functions for raw data manipulation. "LE" means - * Little Endian. - */ - static inline unsigned short get2LE(const unsigned char* buf) { - return buf[0] | (buf[1] << 8); - } - static inline unsigned long get4LE(const unsigned char* buf) { - return buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24); - } - -private: - /* these are private and not defined */ - ZipFileRO(const ZipFileRO& src); - ZipFileRO& operator=(const ZipFileRO& src); - - /* locate and parse the central directory */ - bool mapCentralDirectory(void); - - /* parse the archive, prepping internal structures */ - bool parseZipArchive(void); - - /* add a new entry to the hash table */ - void addToHash(const char* str, int strLen, unsigned int hash); - - /* compute string hash code */ - static unsigned int computeHash(const char* str, int len); - - /* convert a ZipEntryRO back to a hash table index */ - int entryToIndex(const ZipEntryRO entry) const; - - /* - * One entry in the hash table. - */ - typedef struct HashEntry { - const char* name; - unsigned short nameLen; - //unsigned int hash; - } HashEntry; - - /* open Zip archive */ - int mFd; - - /* Lock for handling the file descriptor (seeks, etc) */ - mutable Mutex mFdLock; - - /* zip file name */ - char* mFileName; - - /* length of file */ - size_t mFileLength; - - /* mapped file */ - FileMap* mDirectoryMap; - - /* number of entries in the Zip archive */ - int mNumEntries; - - /* CD directory offset in the Zip archive */ - off64_t mDirectoryOffset; - - /* - * We know how many entries are in the Zip archive, so we have a - * fixed-size hash table. We probe for an empty slot. - */ - int mHashTableSize; - HashEntry* mHashTable; -}; - -}; // namespace android - -#endif /*__LIBS_ZIPFILERO_H*/ diff --git a/external/android/include/18/frameworks/native/include/utils/ZipUtils.h b/external/android/include/18/frameworks/native/include/utils/ZipUtils.h deleted file mode 100644 index 42c42b6..0000000 --- a/external/android/include/18/frameworks/native/include/utils/ZipUtils.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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. - */ - -// -// Miscellaneous zip/gzip utility functions. -// -#ifndef __LIBS_ZIPUTILS_H -#define __LIBS_ZIPUTILS_H - -#include - -namespace android { - -/* - * Container class for utility functions, primarily for namespace reasons. - */ -class ZipUtils { -public: - /* - * General utility function for uncompressing "deflate" data from a file - * to a buffer. - */ - static bool inflateToBuffer(int fd, void* buf, long uncompressedLen, - long compressedLen); - static bool inflateToBuffer(FILE* fp, void* buf, long uncompressedLen, - long compressedLen); - - /* - * Someday we might want to make this generic and handle bzip2 ".bz2" - * files too. - * - * We could declare gzip to be a sub-class of zip that has exactly - * one always-compressed entry, but we currently want to treat Zip - * and gzip as distinct, so there's no value. - * - * The zlib library has some gzip utilities, but it has no interface - * for extracting the uncompressed length of the file (you do *not* - * want to gzseek to the end). - * - * Pass in a seeked file pointer for the gzip file. If this is a gzip - * file, we set our return values appropriately and return "true" with - * the file seeked to the start of the compressed data. - */ - static bool examineGzip(FILE* fp, int* pCompressionMethod, - long* pUncompressedLen, long* pCompressedLen, unsigned long* pCRC32); - -private: - ZipUtils() {} - ~ZipUtils() {} -}; - -}; // namespace android - -#endif /*__LIBS_ZIPUTILS_H*/ diff --git a/external/android/include/18/frameworks/native/include/utils/ashmem.h b/external/android/include/18/frameworks/native/include/utils/ashmem.h deleted file mode 100644 index 0854775..0000000 --- a/external/android/include/18/frameworks/native/include/utils/ashmem.h +++ /dev/null @@ -1,41 +0,0 @@ -/* utils/ashmem.h - ** - ** Copyright 2008 The Android Open Source Project - ** - ** This file is dual licensed. It may be redistributed and/or modified - ** under the terms of the Apache 2.0 License OR version 2 of the GNU - ** General Public License. - */ - -#ifndef _UTILS_ASHMEM_H -#define _UTILS_ASHMEM_H - -#include -#include - -#define ASHMEM_NAME_LEN 256 - -#define ASHMEM_NAME_DEF "dev/ashmem" - -/* Return values from ASHMEM_PIN: Was the mapping purged while unpinned? */ -#define ASHMEM_NOT_REAPED 0 -#define ASHMEM_WAS_REAPED 1 - -/* Return values from ASHMEM_UNPIN: Is the mapping now pinned or unpinned? */ -#define ASHMEM_NOW_UNPINNED 0 -#define ASHMEM_NOW_PINNED 1 - -#define __ASHMEMIOC 0x77 - -#define ASHMEM_SET_NAME _IOW(__ASHMEMIOC, 1, char[ASHMEM_NAME_LEN]) -#define ASHMEM_GET_NAME _IOR(__ASHMEMIOC, 2, char[ASHMEM_NAME_LEN]) -#define ASHMEM_SET_SIZE _IOW(__ASHMEMIOC, 3, size_t) -#define ASHMEM_GET_SIZE _IO(__ASHMEMIOC, 4) -#define ASHMEM_SET_PROT_MASK _IOW(__ASHMEMIOC, 5, unsigned long) -#define ASHMEM_GET_PROT_MASK _IO(__ASHMEMIOC, 6) -#define ASHMEM_PIN _IO(__ASHMEMIOC, 7) -#define ASHMEM_UNPIN _IO(__ASHMEMIOC, 8) -#define ASHMEM_ISPINNED _IO(__ASHMEMIOC, 9) -#define ASHMEM_PURGE_ALL_CACHES _IO(__ASHMEMIOC, 10) - -#endif /* _UTILS_ASHMEM_H */ diff --git a/external/android/include/18/frameworks/native/include/utils/misc.h b/external/android/include/18/frameworks/native/include/utils/misc.h deleted file mode 100644 index f1aa432..0000000 --- a/external/android/include/18/frameworks/native/include/utils/misc.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// Handy utility functions and portability code. -// -#ifndef _LIBS_UTILS_MISC_H -#define _LIBS_UTILS_MISC_H - -#include -#include - -/* get #of elements in a static array */ -#ifndef NELEM -# define NELEM(x) ((int) (sizeof(x) / sizeof((x)[0]))) -#endif - -namespace android { - -/* - * Some utility functions for working with files. These could be made - * part of a "File" class. - */ -typedef enum FileType { - kFileTypeUnknown = 0, - kFileTypeNonexistent, // i.e. ENOENT - kFileTypeRegular, - kFileTypeDirectory, - kFileTypeCharDev, - kFileTypeBlockDev, - kFileTypeFifo, - kFileTypeSymlink, - kFileTypeSocket, -} FileType; -/* get the file's type; follows symlinks */ -FileType getFileType(const char* fileName); -/* get the file's modification date; returns -1 w/errno set on failure */ -time_t getFileModDate(const char* fileName); - -typedef void (*sysprop_change_callback)(void); -void add_sysprop_change_callback(sysprop_change_callback cb, int priority); -void report_sysprop_change(); - -}; // namespace android - -#endif // _LIBS_UTILS_MISC_H diff --git a/external/android/include/18/frameworks/native/include/utils/threads.h b/external/android/include/18/frameworks/native/include/utils/threads.h deleted file mode 100644 index 9de3382..0000000 --- a/external/android/include/18/frameworks/native/include/utils/threads.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 _LIBS_UTILS_THREADS_H -#define _LIBS_UTILS_THREADS_H - -/* - * Please, DO NOT USE! - * - * This file is here only for legacy reasons. Instead, include directly - * the headers you need below. - * - */ - -#include - -#ifdef __cplusplus -#include -#include -#include -#include -#include -#endif - -#endif // _LIBS_UTILS_THREADS_H diff --git a/external/android/include/18/hardware/libhardware/include/hardware/audio.h b/external/android/include/18/hardware/libhardware/include/hardware/audio.h deleted file mode 100644 index 3a0962e..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/audio.h +++ /dev/null @@ -1,453 +0,0 @@ -/* - * Copyright (C) 2011 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_AUDIO_HAL_INTERFACE_H -#define ANDROID_AUDIO_HAL_INTERFACE_H - -#include -#include -#include -#include - -#include - -#include -#include -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define AUDIO_HARDWARE_MODULE_ID "audio" - -/** - * Name of the audio devices to open - */ -#define AUDIO_HARDWARE_INTERFACE "audio_hw_if" - - -/* Use version 0.1 to be compatible with first generation of audio hw module with version_major - * hardcoded to 1. No audio module API change. - */ -#define AUDIO_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) -#define AUDIO_MODULE_API_VERSION_CURRENT AUDIO_MODULE_API_VERSION_0_1 - -/* First generation of audio devices had version hardcoded to 0. all devices with versions < 1.0 - * will be considered of first generation API. - */ -#define AUDIO_DEVICE_API_VERSION_0_0 HARDWARE_DEVICE_API_VERSION(0, 0) -#define AUDIO_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0) -#define AUDIO_DEVICE_API_VERSION_2_0 HARDWARE_DEVICE_API_VERSION(2, 0) -#define AUDIO_DEVICE_API_VERSION_CURRENT AUDIO_DEVICE_API_VERSION_2_0 - -/** - * List of known audio HAL modules. This is the base name of the audio HAL - * library composed of the "audio." prefix, one of the base names below and - * a suffix specific to the device. - * e.g: audio.primary.goldfish.so or audio.a2dp.default.so - */ - -#define AUDIO_HARDWARE_MODULE_ID_PRIMARY "primary" -#define AUDIO_HARDWARE_MODULE_ID_A2DP "a2dp" -#define AUDIO_HARDWARE_MODULE_ID_USB "usb" -#define AUDIO_HARDWARE_MODULE_ID_REMOTE_SUBMIX "r_submix" - -/**************************************/ - -/** - * standard audio parameters that the HAL may need to handle - */ - -/** - * audio device parameters - */ - -/* BT SCO Noise Reduction + Echo Cancellation parameters */ -#define AUDIO_PARAMETER_KEY_BT_NREC "bt_headset_nrec" -#define AUDIO_PARAMETER_VALUE_ON "on" -#define AUDIO_PARAMETER_VALUE_OFF "off" - -/* TTY mode selection */ -#define AUDIO_PARAMETER_KEY_TTY_MODE "tty_mode" -#define AUDIO_PARAMETER_VALUE_TTY_OFF "tty_off" -#define AUDIO_PARAMETER_VALUE_TTY_VCO "tty_vco" -#define AUDIO_PARAMETER_VALUE_TTY_HCO "tty_hco" -#define AUDIO_PARAMETER_VALUE_TTY_FULL "tty_full" - -/* A2DP sink address set by framework */ -#define AUDIO_PARAMETER_A2DP_SINK_ADDRESS "a2dp_sink_address" - -/* Screen state */ -#define AUDIO_PARAMETER_KEY_SCREEN_STATE "screen_state" - -/** - * audio stream parameters - */ - -#define AUDIO_PARAMETER_STREAM_ROUTING "routing" // audio_devices_t -#define AUDIO_PARAMETER_STREAM_FORMAT "format" // audio_format_t -#define AUDIO_PARAMETER_STREAM_CHANNELS "channels" // audio_channel_mask_t -#define AUDIO_PARAMETER_STREAM_FRAME_COUNT "frame_count" // size_t -#define AUDIO_PARAMETER_STREAM_INPUT_SOURCE "input_source" // audio_source_t -#define AUDIO_PARAMETER_STREAM_SAMPLING_RATE "sampling_rate" // uint32_t - -/* Query supported formats. The response is a '|' separated list of strings from - * audio_format_t enum e.g: "sup_formats=AUDIO_FORMAT_PCM_16_BIT" */ -#define AUDIO_PARAMETER_STREAM_SUP_FORMATS "sup_formats" -/* Query supported channel masks. The response is a '|' separated list of strings from - * audio_channel_mask_t enum e.g: "sup_channels=AUDIO_CHANNEL_OUT_STEREO|AUDIO_CHANNEL_OUT_MONO" */ -#define AUDIO_PARAMETER_STREAM_SUP_CHANNELS "sup_channels" -/* Query supported sampling rates. The response is a '|' separated list of integer values e.g: - * "sup_sampling_rates=44100|48000" */ -#define AUDIO_PARAMETER_STREAM_SUP_SAMPLING_RATES "sup_sampling_rates" - - -/**************************************/ - -/* common audio stream configuration parameters */ -struct audio_config { - uint32_t sample_rate; - audio_channel_mask_t channel_mask; - audio_format_t format; -}; - -typedef struct audio_config audio_config_t; - -/* common audio stream parameters and operations */ -struct audio_stream { - - /** - * Return the sampling rate in Hz - eg. 44100. - */ - uint32_t (*get_sample_rate)(const struct audio_stream *stream); - - /* currently unused - use set_parameters with key - * AUDIO_PARAMETER_STREAM_SAMPLING_RATE - */ - int (*set_sample_rate)(struct audio_stream *stream, uint32_t rate); - - /** - * Return size of input/output buffer in bytes for this stream - eg. 4800. - * It should be a multiple of the frame size. See also get_input_buffer_size. - */ - size_t (*get_buffer_size)(const struct audio_stream *stream); - - /** - * Return the channel mask - - * e.g. AUDIO_CHANNEL_OUT_STEREO or AUDIO_CHANNEL_IN_STEREO - */ - audio_channel_mask_t (*get_channels)(const struct audio_stream *stream); - - /** - * Return the audio format - e.g. AUDIO_FORMAT_PCM_16_BIT - */ - audio_format_t (*get_format)(const struct audio_stream *stream); - - /* currently unused - use set_parameters with key - * AUDIO_PARAMETER_STREAM_FORMAT - */ - int (*set_format)(struct audio_stream *stream, audio_format_t format); - - /** - * Put the audio hardware input/output into standby mode. - * Driver should exit from standby mode at the next I/O operation. - * Returns 0 on success and <0 on failure. - */ - int (*standby)(struct audio_stream *stream); - - /** dump the state of the audio input/output device */ - int (*dump)(const struct audio_stream *stream, int fd); - - /** Return the set of device(s) which this stream is connected to */ - audio_devices_t (*get_device)(const struct audio_stream *stream); - - /** - * Currently unused - set_device() corresponds to set_parameters() with key - * AUDIO_PARAMETER_STREAM_ROUTING for both input and output. - * AUDIO_PARAMETER_STREAM_INPUT_SOURCE is an additional information used by - * input streams only. - */ - int (*set_device)(struct audio_stream *stream, audio_devices_t device); - - /** - * set/get audio stream parameters. The function accepts a list of - * parameter key value pairs in the form: key1=value1;key2=value2;... - * - * Some keys are reserved for standard parameters (See AudioParameter class) - * - * If the implementation does not accept a parameter change while - * the output is active but the parameter is acceptable otherwise, it must - * return -ENOSYS. - * - * The audio flinger will put the stream in standby and then change the - * parameter value. - */ - int (*set_parameters)(struct audio_stream *stream, const char *kv_pairs); - - /* - * Returns a pointer to a heap allocated string. The caller is responsible - * for freeing the memory for it using free(). - */ - char * (*get_parameters)(const struct audio_stream *stream, - const char *keys); - int (*add_audio_effect)(const struct audio_stream *stream, - effect_handle_t effect); - int (*remove_audio_effect)(const struct audio_stream *stream, - effect_handle_t effect); -}; -typedef struct audio_stream audio_stream_t; - -/** - * audio_stream_out is the abstraction interface for the audio output hardware. - * - * It provides information about various properties of the audio output - * hardware driver. - */ - -struct audio_stream_out { - struct audio_stream common; - - /** - * Return the audio hardware driver estimated latency in milliseconds. - */ - uint32_t (*get_latency)(const struct audio_stream_out *stream); - - /** - * Use this method in situations where audio mixing is done in the - * hardware. This method serves as a direct interface with hardware, - * allowing you to directly set the volume as apposed to via the framework. - * This method might produce multiple PCM outputs or hardware accelerated - * codecs, such as MP3 or AAC. - */ - int (*set_volume)(struct audio_stream_out *stream, float left, float right); - - /** - * Write audio buffer to driver. Returns number of bytes written, or a - * negative status_t. If at least one frame was written successfully prior to the error, - * it is suggested that the driver return that successful (short) byte count - * and then return an error in the subsequent call. - */ - ssize_t (*write)(struct audio_stream_out *stream, const void* buffer, - size_t bytes); - - /* return the number of audio frames written by the audio dsp to DAC since - * the output has exited standby - */ - int (*get_render_position)(const struct audio_stream_out *stream, - uint32_t *dsp_frames); - - /** - * get the local time at which the next write to the audio driver will be presented. - * The units are microseconds, where the epoch is decided by the local audio HAL. - */ - int (*get_next_write_timestamp)(const struct audio_stream_out *stream, - int64_t *timestamp); - -}; -typedef struct audio_stream_out audio_stream_out_t; - -struct audio_stream_in { - struct audio_stream common; - - /** set the input gain for the audio driver. This method is for - * for future use */ - int (*set_gain)(struct audio_stream_in *stream, float gain); - - /** Read audio buffer in from audio driver. Returns number of bytes read, or a - * negative status_t. If at least one frame was read prior to the error, - * read should return that byte count and then return an error in the subsequent call. - */ - ssize_t (*read)(struct audio_stream_in *stream, void* buffer, - size_t bytes); - - /** - * Return the amount of input frames lost in the audio driver since the - * last call of this function. - * Audio driver is expected to reset the value to 0 and restart counting - * upon returning the current value by this function call. - * Such loss typically occurs when the user space process is blocked - * longer than the capacity of audio driver buffers. - * - * Unit: the number of input audio frames - */ - uint32_t (*get_input_frames_lost)(struct audio_stream_in *stream); -}; -typedef struct audio_stream_in audio_stream_in_t; - -/** - * return the frame size (number of bytes per sample). - */ -static inline size_t audio_stream_frame_size(const struct audio_stream *s) -{ - size_t chan_samp_sz; - - switch (s->get_format(s)) { - case AUDIO_FORMAT_PCM_16_BIT: - chan_samp_sz = sizeof(int16_t); - break; - case AUDIO_FORMAT_PCM_8_BIT: - default: - chan_samp_sz = sizeof(int8_t); - break; - } - - return popcount(s->get_channels(s)) * chan_samp_sz; -} - - -/**********************************************************************/ - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -struct audio_module { - struct hw_module_t common; -}; - -struct audio_hw_device { - struct hw_device_t common; - - /** - * used by audio flinger to enumerate what devices are supported by - * each audio_hw_device implementation. - * - * Return value is a bitmask of 1 or more values of audio_devices_t - * - * NOTE: audio HAL implementations starting with - * AUDIO_DEVICE_API_VERSION_2_0 do not implement this function. - * All supported devices should be listed in audio_policy.conf - * file and the audio policy manager must choose the appropriate - * audio module based on information in this file. - */ - uint32_t (*get_supported_devices)(const struct audio_hw_device *dev); - - /** - * check to see if the audio hardware interface has been initialized. - * returns 0 on success, -ENODEV on failure. - */ - int (*init_check)(const struct audio_hw_device *dev); - - /** set the audio volume of a voice call. Range is between 0.0 and 1.0 */ - int (*set_voice_volume)(struct audio_hw_device *dev, float volume); - - /** - * set the audio volume for all audio activities other than voice call. - * Range between 0.0 and 1.0. If any value other than 0 is returned, - * the software mixer will emulate this capability. - */ - int (*set_master_volume)(struct audio_hw_device *dev, float volume); - - /** - * Get the current master volume value for the HAL, if the HAL supports - * master volume control. AudioFlinger will query this value from the - * primary audio HAL when the service starts and use the value for setting - * the initial master volume across all HALs. HALs which do not support - * this method may leave it set to NULL. - */ - int (*get_master_volume)(struct audio_hw_device *dev, float *volume); - - /** - * set_mode is called when the audio mode changes. AUDIO_MODE_NORMAL mode - * is for standard audio playback, AUDIO_MODE_RINGTONE when a ringtone is - * playing, and AUDIO_MODE_IN_CALL when a call is in progress. - */ - int (*set_mode)(struct audio_hw_device *dev, audio_mode_t mode); - - /* mic mute */ - int (*set_mic_mute)(struct audio_hw_device *dev, bool state); - int (*get_mic_mute)(const struct audio_hw_device *dev, bool *state); - - /* set/get global audio parameters */ - int (*set_parameters)(struct audio_hw_device *dev, const char *kv_pairs); - - /* - * Returns a pointer to a heap allocated string. The caller is responsible - * for freeing the memory for it using free(). - */ - char * (*get_parameters)(const struct audio_hw_device *dev, - const char *keys); - - /* Returns audio input buffer size according to parameters passed or - * 0 if one of the parameters is not supported. - * See also get_buffer_size which is for a particular stream. - */ - size_t (*get_input_buffer_size)(const struct audio_hw_device *dev, - const struct audio_config *config); - - /** This method creates and opens the audio hardware output stream */ - int (*open_output_stream)(struct audio_hw_device *dev, - audio_io_handle_t handle, - audio_devices_t devices, - audio_output_flags_t flags, - struct audio_config *config, - struct audio_stream_out **stream_out); - - void (*close_output_stream)(struct audio_hw_device *dev, - struct audio_stream_out* stream_out); - - /** This method creates and opens the audio hardware input stream */ - int (*open_input_stream)(struct audio_hw_device *dev, - audio_io_handle_t handle, - audio_devices_t devices, - struct audio_config *config, - struct audio_stream_in **stream_in); - - void (*close_input_stream)(struct audio_hw_device *dev, - struct audio_stream_in *stream_in); - - /** This method dumps the state of the audio hardware */ - int (*dump)(const struct audio_hw_device *dev, int fd); - - /** - * set the audio mute status for all audio activities. If any value other - * than 0 is returned, the software mixer will emulate this capability. - */ - int (*set_master_mute)(struct audio_hw_device *dev, bool mute); - - /** - * Get the current master mute status for the HAL, if the HAL supports - * master mute control. AudioFlinger will query this value from the primary - * audio HAL when the service starts and use the value for setting the - * initial master mute across all HALs. HALs which do not support this - * method may leave it set to NULL. - */ - int (*get_master_mute)(struct audio_hw_device *dev, bool *mute); -}; -typedef struct audio_hw_device audio_hw_device_t; - -/** convenience API for opening and closing a supported device */ - -static inline int audio_hw_device_open(const struct hw_module_t* module, - struct audio_hw_device** device) -{ - return module->methods->open(module, AUDIO_HARDWARE_INTERFACE, - (struct hw_device_t**)device); -} - -static inline int audio_hw_device_close(struct audio_hw_device* device) -{ - return device->common.close(&device->common); -} - - -__END_DECLS - -#endif // ANDROID_AUDIO_INTERFACE_H diff --git a/external/android/include/18/hardware/libhardware/include/hardware/audio_effect.h b/external/android/include/18/hardware/libhardware/include/hardware/audio_effect.h deleted file mode 100644 index 2940b1a..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/audio_effect.h +++ /dev/null @@ -1,980 +0,0 @@ -/* - * Copyright (C) 2011 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_AUDIO_EFFECT_H -#define ANDROID_AUDIO_EFFECT_H - -#include -#include -#include -#include -#include - -#include - -#include - - -__BEGIN_DECLS - - -///////////////////////////////////////////////// -// Common Definitions -///////////////////////////////////////////////// - -// -//--- Effect descriptor structure effect_descriptor_t -// - -// Unique effect ID (can be generated from the following site: -// http://www.itu.int/ITU-T/asn1/uuid.html) -// This format is used for both "type" and "uuid" fields of the effect descriptor structure. -// - When used for effect type and the engine is implementing and effect corresponding to a standard -// OpenSL ES interface, this ID must be the one defined in OpenSLES_IID.h for that interface. -// - When used as uuid, it should be a unique UUID for this particular implementation. -typedef struct effect_uuid_s { - uint32_t timeLow; - uint16_t timeMid; - uint16_t timeHiAndVersion; - uint16_t clockSeq; - uint8_t node[6]; -} effect_uuid_t; - -// Maximum length of character strings in structures defines by this API. -#define EFFECT_STRING_LEN_MAX 64 - -// NULL UUID definition (matches SL_IID_NULL_) -#define EFFECT_UUID_INITIALIZER { 0xec7178ec, 0xe5e1, 0x4432, 0xa3f4, \ - { 0x46, 0x57, 0xe6, 0x79, 0x52, 0x10 } } -static const effect_uuid_t EFFECT_UUID_NULL_ = EFFECT_UUID_INITIALIZER; -static const effect_uuid_t * const EFFECT_UUID_NULL = &EFFECT_UUID_NULL_; -static const char * const EFFECT_UUID_NULL_STR = "ec7178ec-e5e1-4432-a3f4-4657e6795210"; - - -// The effect descriptor contains necessary information to facilitate the enumeration of the effect -// engines present in a library. -typedef struct effect_descriptor_s { - effect_uuid_t type; // UUID of to the OpenSL ES interface implemented by this effect - effect_uuid_t uuid; // UUID for this particular implementation - uint32_t apiVersion; // Version of the effect control API implemented - uint32_t flags; // effect engine capabilities/requirements flags (see below) - uint16_t cpuLoad; // CPU load indication (see below) - uint16_t memoryUsage; // Data Memory usage (see below) - char name[EFFECT_STRING_LEN_MAX]; // human readable effect name - char implementor[EFFECT_STRING_LEN_MAX]; // human readable effect implementor name -} effect_descriptor_t; - -// CPU load and memory usage indication: each effect implementation must provide an indication of -// its CPU and memory usage for the audio effect framework to limit the number of effects -// instantiated at a given time on a given platform. -// The CPU load is expressed in 0.1 MIPS units as estimated on an ARM9E core (ARMv5TE) with 0 WS. -// The memory usage is expressed in KB and includes only dynamically allocated memory - -// Definitions for flags field of effect descriptor. -// +---------------------------+-----------+----------------------------------- -// | description | bits | values -// +---------------------------+-----------+----------------------------------- -// | connection mode | 0..2 | 0 insert: after track process -// | | | 1 auxiliary: connect to track auxiliary -// | | | output and use send level -// | | | 2 replace: replaces track process function; -// | | | must implement SRC, volume and mono to stereo. -// | | | 3 pre processing: applied below audio HAL on input -// | | | 4 post processing: applied below audio HAL on output -// | | | 5 - 7 reserved -// +---------------------------+-----------+----------------------------------- -// | insertion preference | 3..5 | 0 none -// | | | 1 first of the chain -// | | | 2 last of the chain -// | | | 3 exclusive (only effect in the insert chain) -// | | | 4..7 reserved -// +---------------------------+-----------+----------------------------------- -// | Volume management | 6..8 | 0 none -// | | | 1 implements volume control -// | | | 2 requires volume indication -// | | | 4 reserved -// +---------------------------+-----------+----------------------------------- -// | Device indication | 9..11 | 0 none -// | | | 1 requires device updates -// | | | 2, 4 reserved -// +---------------------------+-----------+----------------------------------- -// | Sample input mode | 12..13 | 1 direct: process() function or EFFECT_CMD_SET_CONFIG -// | | | command must specify a buffer descriptor -// | | | 2 provider: process() function uses the -// | | | bufferProvider indicated by the -// | | | EFFECT_CMD_SET_CONFIG command to request input. -// | | | buffers. -// | | | 3 both: both input modes are supported -// +---------------------------+-----------+----------------------------------- -// | Sample output mode | 14..15 | 1 direct: process() function or EFFECT_CMD_SET_CONFIG -// | | | command must specify a buffer descriptor -// | | | 2 provider: process() function uses the -// | | | bufferProvider indicated by the -// | | | EFFECT_CMD_SET_CONFIG command to request output -// | | | buffers. -// | | | 3 both: both output modes are supported -// +---------------------------+-----------+----------------------------------- -// | Hardware acceleration | 16..17 | 0 No hardware acceleration -// | | | 1 non tunneled hw acceleration: the process() function -// | | | reads the samples, send them to HW accelerated -// | | | effect processor, reads back the processed samples -// | | | and returns them to the output buffer. -// | | | 2 tunneled hw acceleration: the process() function is -// | | | transparent. The effect interface is only used to -// | | | control the effect engine. This mode is relevant for -// | | | global effects actually applied by the audio -// | | | hardware on the output stream. -// +---------------------------+-----------+----------------------------------- -// | Audio Mode indication | 18..19 | 0 none -// | | | 1 requires audio mode updates -// | | | 2..3 reserved -// +---------------------------+-----------+----------------------------------- -// | Audio source indication | 20..21 | 0 none -// | | | 1 requires audio source updates -// | | | 2..3 reserved -// +---------------------------+-----------+----------------------------------- - -// Insert mode -#define EFFECT_FLAG_TYPE_SHIFT 0 -#define EFFECT_FLAG_TYPE_SIZE 3 -#define EFFECT_FLAG_TYPE_MASK (((1 << EFFECT_FLAG_TYPE_SIZE) -1) \ - << EFFECT_FLAG_TYPE_SHIFT) -#define EFFECT_FLAG_TYPE_INSERT (0 << EFFECT_FLAG_TYPE_SHIFT) -#define EFFECT_FLAG_TYPE_AUXILIARY (1 << EFFECT_FLAG_TYPE_SHIFT) -#define EFFECT_FLAG_TYPE_REPLACE (2 << EFFECT_FLAG_TYPE_SHIFT) -#define EFFECT_FLAG_TYPE_PRE_PROC (3 << EFFECT_FLAG_TYPE_SHIFT) -#define EFFECT_FLAG_TYPE_POST_PROC (4 << EFFECT_FLAG_TYPE_SHIFT) - -// Insert preference -#define EFFECT_FLAG_INSERT_SHIFT (EFFECT_FLAG_TYPE_SHIFT + EFFECT_FLAG_TYPE_SIZE) -#define EFFECT_FLAG_INSERT_SIZE 3 -#define EFFECT_FLAG_INSERT_MASK (((1 << EFFECT_FLAG_INSERT_SIZE) -1) \ - << EFFECT_FLAG_INSERT_SHIFT) -#define EFFECT_FLAG_INSERT_ANY (0 << EFFECT_FLAG_INSERT_SHIFT) -#define EFFECT_FLAG_INSERT_FIRST (1 << EFFECT_FLAG_INSERT_SHIFT) -#define EFFECT_FLAG_INSERT_LAST (2 << EFFECT_FLAG_INSERT_SHIFT) -#define EFFECT_FLAG_INSERT_EXCLUSIVE (3 << EFFECT_FLAG_INSERT_SHIFT) - - -// Volume control -#define EFFECT_FLAG_VOLUME_SHIFT (EFFECT_FLAG_INSERT_SHIFT + EFFECT_FLAG_INSERT_SIZE) -#define EFFECT_FLAG_VOLUME_SIZE 3 -#define EFFECT_FLAG_VOLUME_MASK (((1 << EFFECT_FLAG_VOLUME_SIZE) -1) \ - << EFFECT_FLAG_VOLUME_SHIFT) -#define EFFECT_FLAG_VOLUME_CTRL (1 << EFFECT_FLAG_VOLUME_SHIFT) -#define EFFECT_FLAG_VOLUME_IND (2 << EFFECT_FLAG_VOLUME_SHIFT) -#define EFFECT_FLAG_VOLUME_NONE (0 << EFFECT_FLAG_VOLUME_SHIFT) - -// Device indication -#define EFFECT_FLAG_DEVICE_SHIFT (EFFECT_FLAG_VOLUME_SHIFT + EFFECT_FLAG_VOLUME_SIZE) -#define EFFECT_FLAG_DEVICE_SIZE 3 -#define EFFECT_FLAG_DEVICE_MASK (((1 << EFFECT_FLAG_DEVICE_SIZE) -1) \ - << EFFECT_FLAG_DEVICE_SHIFT) -#define EFFECT_FLAG_DEVICE_IND (1 << EFFECT_FLAG_DEVICE_SHIFT) -#define EFFECT_FLAG_DEVICE_NONE (0 << EFFECT_FLAG_DEVICE_SHIFT) - -// Sample input modes -#define EFFECT_FLAG_INPUT_SHIFT (EFFECT_FLAG_DEVICE_SHIFT + EFFECT_FLAG_DEVICE_SIZE) -#define EFFECT_FLAG_INPUT_SIZE 2 -#define EFFECT_FLAG_INPUT_MASK (((1 << EFFECT_FLAG_INPUT_SIZE) -1) \ - << EFFECT_FLAG_INPUT_SHIFT) -#define EFFECT_FLAG_INPUT_DIRECT (1 << EFFECT_FLAG_INPUT_SHIFT) -#define EFFECT_FLAG_INPUT_PROVIDER (2 << EFFECT_FLAG_INPUT_SHIFT) -#define EFFECT_FLAG_INPUT_BOTH (3 << EFFECT_FLAG_INPUT_SHIFT) - -// Sample output modes -#define EFFECT_FLAG_OUTPUT_SHIFT (EFFECT_FLAG_INPUT_SHIFT + EFFECT_FLAG_INPUT_SIZE) -#define EFFECT_FLAG_OUTPUT_SIZE 2 -#define EFFECT_FLAG_OUTPUT_MASK (((1 << EFFECT_FLAG_OUTPUT_SIZE) -1) \ - << EFFECT_FLAG_OUTPUT_SHIFT) -#define EFFECT_FLAG_OUTPUT_DIRECT (1 << EFFECT_FLAG_OUTPUT_SHIFT) -#define EFFECT_FLAG_OUTPUT_PROVIDER (2 << EFFECT_FLAG_OUTPUT_SHIFT) -#define EFFECT_FLAG_OUTPUT_BOTH (3 << EFFECT_FLAG_OUTPUT_SHIFT) - -// Hardware acceleration mode -#define EFFECT_FLAG_HW_ACC_SHIFT (EFFECT_FLAG_OUTPUT_SHIFT + EFFECT_FLAG_OUTPUT_SIZE) -#define EFFECT_FLAG_HW_ACC_SIZE 2 -#define EFFECT_FLAG_HW_ACC_MASK (((1 << EFFECT_FLAG_HW_ACC_SIZE) -1) \ - << EFFECT_FLAG_HW_ACC_SHIFT) -#define EFFECT_FLAG_HW_ACC_SIMPLE (1 << EFFECT_FLAG_HW_ACC_SHIFT) -#define EFFECT_FLAG_HW_ACC_TUNNEL (2 << EFFECT_FLAG_HW_ACC_SHIFT) - -// Audio mode indication -#define EFFECT_FLAG_AUDIO_MODE_SHIFT (EFFECT_FLAG_HW_ACC_SHIFT + EFFECT_FLAG_HW_ACC_SIZE) -#define EFFECT_FLAG_AUDIO_MODE_SIZE 2 -#define EFFECT_FLAG_AUDIO_MODE_MASK (((1 << EFFECT_FLAG_AUDIO_MODE_SIZE) -1) \ - << EFFECT_FLAG_AUDIO_MODE_SHIFT) -#define EFFECT_FLAG_AUDIO_MODE_IND (1 << EFFECT_FLAG_AUDIO_MODE_SHIFT) -#define EFFECT_FLAG_AUDIO_MODE_NONE (0 << EFFECT_FLAG_AUDIO_MODE_SHIFT) - -// Audio source indication -#define EFFECT_FLAG_AUDIO_SOURCE_SHIFT (EFFECT_FLAG_AUDIO_MODE_SHIFT + EFFECT_FLAG_AUDIO_MODE_SIZE) -#define EFFECT_FLAG_AUDIO_SOURCE_SIZE 2 -#define EFFECT_FLAG_AUDIO_SOURCE_MASK (((1 << EFFECT_FLAG_AUDIO_SOURCE_SIZE) -1) \ - << EFFECT_FLAG_AUDIO_SOURCE_SHIFT) -#define EFFECT_FLAG_AUDIO_SOURCE_IND (1 << EFFECT_FLAG_AUDIO_SOURCE_SHIFT) -#define EFFECT_FLAG_AUDIO_SOURCE_NONE (0 << EFFECT_FLAG_AUDIO_SOURCE_SHIFT) - -#define EFFECT_MAKE_API_VERSION(M, m) (((M)<<16) | ((m) & 0xFFFF)) -#define EFFECT_API_VERSION_MAJOR(v) ((v)>>16) -#define EFFECT_API_VERSION_MINOR(v) ((m) & 0xFFFF) - - - -///////////////////////////////////////////////// -// Effect control interface -///////////////////////////////////////////////// - -// Effect control interface version 2.0 -#define EFFECT_CONTROL_API_VERSION EFFECT_MAKE_API_VERSION(2,0) - -// Effect control interface structure: effect_interface_s -// The effect control interface is exposed by each effect engine implementation. It consists of -// a set of functions controlling the configuration, activation and process of the engine. -// The functions are grouped in a structure of type effect_interface_s. -// -// Effect control interface handle: effect_handle_t -// The effect_handle_t serves two purposes regarding the implementation of the effect engine: -// - 1 it is the address of a pointer to an effect_interface_s structure where the functions -// of the effect control API for a particular effect are located. -// - 2 it is the address of the context of a particular effect instance. -// A typical implementation in the effect library would define a structure as follows: -// struct effect_module_s { -// const struct effect_interface_s *itfe; -// effect_config_t config; -// effect_context_t context; -// } -// The implementation of EffectCreate() function would then allocate a structure of this -// type and return its address as effect_handle_t -typedef struct effect_interface_s **effect_handle_t; - - -// Forward definition of type audio_buffer_t -typedef struct audio_buffer_s audio_buffer_t; - - - - - - -// Effect control interface definition -struct effect_interface_s { - //////////////////////////////////////////////////////////////////////////////// - // - // Function: process - // - // Description: Effect process function. Takes input samples as specified - // (count and location) in input buffer descriptor and output processed - // samples as specified in output buffer descriptor. If the buffer descriptor - // is not specified the function must use either the buffer or the - // buffer provider function installed by the EFFECT_CMD_SET_CONFIG command. - // The effect framework will call the process() function after the EFFECT_CMD_ENABLE - // command is received and until the EFFECT_CMD_DISABLE is received. When the engine - // receives the EFFECT_CMD_DISABLE command it should turn off the effect gracefully - // and when done indicate that it is OK to stop calling the process() function by - // returning the -ENODATA status. - // - // NOTE: the process() function implementation should be "real-time safe" that is - // it should not perform blocking calls: malloc/free, sleep, read/write/open/close, - // pthread_cond_wait/pthread_mutex_lock... - // - // Input: - // self: handle to the effect interface this function - // is called on. - // inBuffer: buffer descriptor indicating where to read samples to process. - // If NULL, use the configuration passed by EFFECT_CMD_SET_CONFIG command. - // - // outBuffer: buffer descriptor indicating where to write processed samples. - // If NULL, use the configuration passed by EFFECT_CMD_SET_CONFIG command. - // - // Output: - // returned value: 0 successful operation - // -ENODATA the engine has finished the disable phase and the framework - // can stop calling process() - // -EINVAL invalid interface handle or - // invalid input/output buffer description - //////////////////////////////////////////////////////////////////////////////// - int32_t (*process)(effect_handle_t self, - audio_buffer_t *inBuffer, - audio_buffer_t *outBuffer); - //////////////////////////////////////////////////////////////////////////////// - // - // Function: command - // - // Description: Send a command and receive a response to/from effect engine. - // - // Input: - // self: handle to the effect interface this function - // is called on. - // cmdCode: command code: the command can be a standardized command defined in - // effect_command_e (see below) or a proprietary command. - // cmdSize: size of command in bytes - // pCmdData: pointer to command data - // pReplyData: pointer to reply data - // - // Input/Output: - // replySize: maximum size of reply data as input - // actual size of reply data as output - // - // Output: - // returned value: 0 successful operation - // -EINVAL invalid interface handle or - // invalid command/reply size or format according to command code - // The return code should be restricted to indicate problems related to the this - // API specification. Status related to the execution of a particular command should be - // indicated as part of the reply field. - // - // *pReplyData updated with command response - // - //////////////////////////////////////////////////////////////////////////////// - int32_t (*command)(effect_handle_t self, - uint32_t cmdCode, - uint32_t cmdSize, - void *pCmdData, - uint32_t *replySize, - void *pReplyData); - //////////////////////////////////////////////////////////////////////////////// - // - // Function: get_descriptor - // - // Description: Returns the effect descriptor - // - // Input: - // self: handle to the effect interface this function - // is called on. - // - // Input/Output: - // pDescriptor: address where to return the effect descriptor. - // - // Output: - // returned value: 0 successful operation. - // -EINVAL invalid interface handle or invalid pDescriptor - // *pDescriptor: updated with the effect descriptor. - // - //////////////////////////////////////////////////////////////////////////////// - int32_t (*get_descriptor)(effect_handle_t self, - effect_descriptor_t *pDescriptor); - //////////////////////////////////////////////////////////////////////////////// - // - // Function: process_reverse - // - // Description: Process reverse stream function. This function is used to pass - // a reference stream to the effect engine. If the engine does not need a reference - // stream, this function pointer can be set to NULL. - // This function would typically implemented by an Echo Canceler. - // - // Input: - // self: handle to the effect interface this function - // is called on. - // inBuffer: buffer descriptor indicating where to read samples to process. - // If NULL, use the configuration passed by EFFECT_CMD_SET_CONFIG_REVERSE command. - // - // outBuffer: buffer descriptor indicating where to write processed samples. - // If NULL, use the configuration passed by EFFECT_CMD_SET_CONFIG_REVERSE command. - // If the buffer and buffer provider in the configuration received by - // EFFECT_CMD_SET_CONFIG_REVERSE are also NULL, do not return modified reverse - // stream data - // - // Output: - // returned value: 0 successful operation - // -ENODATA the engine has finished the disable phase and the framework - // can stop calling process_reverse() - // -EINVAL invalid interface handle or - // invalid input/output buffer description - //////////////////////////////////////////////////////////////////////////////// - int32_t (*process_reverse)(effect_handle_t self, - audio_buffer_t *inBuffer, - audio_buffer_t *outBuffer); -}; - - -// -//--- Standardized command codes for command() function -// -enum effect_command_e { - EFFECT_CMD_INIT, // initialize effect engine - EFFECT_CMD_SET_CONFIG, // configure effect engine (see effect_config_t) - EFFECT_CMD_RESET, // reset effect engine - EFFECT_CMD_ENABLE, // enable effect process - EFFECT_CMD_DISABLE, // disable effect process - EFFECT_CMD_SET_PARAM, // set parameter immediately (see effect_param_t) - EFFECT_CMD_SET_PARAM_DEFERRED, // set parameter deferred - EFFECT_CMD_SET_PARAM_COMMIT, // commit previous set parameter deferred - EFFECT_CMD_GET_PARAM, // get parameter - EFFECT_CMD_SET_DEVICE, // set audio device (see audio.h, audio_devices_t) - EFFECT_CMD_SET_VOLUME, // set volume - EFFECT_CMD_SET_AUDIO_MODE, // set the audio mode (normal, ring, ...) - EFFECT_CMD_SET_CONFIG_REVERSE, // configure effect engine reverse stream(see effect_config_t) - EFFECT_CMD_SET_INPUT_DEVICE, // set capture device (see audio.h, audio_devices_t) - EFFECT_CMD_GET_CONFIG, // read effect engine configuration - EFFECT_CMD_GET_CONFIG_REVERSE, // read configure effect engine reverse stream configuration - EFFECT_CMD_GET_FEATURE_SUPPORTED_CONFIGS,// get all supported configurations for a feature. - EFFECT_CMD_GET_FEATURE_CONFIG, // get current feature configuration - EFFECT_CMD_SET_FEATURE_CONFIG, // set current feature configuration - EFFECT_CMD_SET_AUDIO_SOURCE, // set the audio source (see audio.h, audio_source_t) - EFFECT_CMD_FIRST_PROPRIETARY = 0x10000 // first proprietary command code -}; - -//================================================================================================== -// command: EFFECT_CMD_INIT -//-------------------------------------------------------------------------------------------------- -// description: -// Initialize effect engine: All configurations return to default -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_SET_CONFIG -//-------------------------------------------------------------------------------------------------- -// description: -// Apply new audio parameters configurations for input and output buffers -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(effect_config_t) -// data: effect_config_t -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_RESET -//-------------------------------------------------------------------------------------------------- -// description: -// Reset the effect engine. Keep configuration but resets state and buffer content -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 0 -// data: N/A -//================================================================================================== -// command: EFFECT_CMD_ENABLE -//-------------------------------------------------------------------------------------------------- -// description: -// Enable the process. Called by the framework before the first call to process() -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_DISABLE -//-------------------------------------------------------------------------------------------------- -// description: -// Disable the process. Called by the framework after the last call to process() -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_SET_PARAM -//-------------------------------------------------------------------------------------------------- -// description: -// Set a parameter and apply it immediately -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(effect_param_t) + size of param and value -// data: effect_param_t + param + value. See effect_param_t definition below for value offset -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_SET_PARAM_DEFERRED -//-------------------------------------------------------------------------------------------------- -// description: -// Set a parameter but apply it only when receiving EFFECT_CMD_SET_PARAM_COMMIT command -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(effect_param_t) + size of param and value -// data: effect_param_t + param + value. See effect_param_t definition below for value offset -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 0 -// data: N/A -//================================================================================================== -// command: EFFECT_CMD_SET_PARAM_COMMIT -//-------------------------------------------------------------------------------------------------- -// description: -// Apply all previously received EFFECT_CMD_SET_PARAM_DEFERRED commands -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_GET_PARAM -//-------------------------------------------------------------------------------------------------- -// description: -// Get a parameter value -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(effect_param_t) + size of param -// data: effect_param_t + param -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(effect_param_t) + size of param and value -// data: effect_param_t + param + value. See effect_param_t definition below for value offset -//================================================================================================== -// command: EFFECT_CMD_SET_DEVICE -//-------------------------------------------------------------------------------------------------- -// description: -// Set the rendering device the audio output path is connected to. See audio.h, audio_devices_t -// for device values. -// The effect implementation must set EFFECT_FLAG_DEVICE_IND flag in its descriptor to receive this -// command when the device changes -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(uint32_t) -// data: uint32_t -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 0 -// data: N/A -//================================================================================================== -// command: EFFECT_CMD_SET_VOLUME -//-------------------------------------------------------------------------------------------------- -// description: -// Set and get volume. Used by audio framework to delegate volume control to effect engine. -// The effect implementation must set EFFECT_FLAG_VOLUME_IND or EFFECT_FLAG_VOLUME_CTRL flag in -// its descriptor to receive this command before every call to process() function -// If EFFECT_FLAG_VOLUME_CTRL flag is set in the effect descriptor, the effect engine must return -// the volume that should be applied before the effect is processed. The overall volume (the volume -// actually applied by the effect engine multiplied by the returned value) should match the value -// indicated in the command. -//-------------------------------------------------------------------------------------------------- -// command format: -// size: n * sizeof(uint32_t) -// data: volume for each channel defined in effect_config_t for output buffer expressed in -// 8.24 fixed point format -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: n * sizeof(uint32_t) / 0 -// data: - if EFFECT_FLAG_VOLUME_CTRL is set in effect descriptor: -// volume for each channel defined in effect_config_t for output buffer expressed in -// 8.24 fixed point format -// - if EFFECT_FLAG_VOLUME_CTRL is not set in effect descriptor: -// N/A -// It is legal to receive a null pointer as pReplyData in which case the effect framework has -// delegated volume control to another effect -//================================================================================================== -// command: EFFECT_CMD_SET_AUDIO_MODE -//-------------------------------------------------------------------------------------------------- -// description: -// Set the audio mode. The effect implementation must set EFFECT_FLAG_AUDIO_MODE_IND flag in its -// descriptor to receive this command when the audio mode changes. -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(uint32_t) -// data: audio_mode_t -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 0 -// data: N/A -//================================================================================================== -// command: EFFECT_CMD_SET_CONFIG_REVERSE -//-------------------------------------------------------------------------------------------------- -// description: -// Apply new audio parameters configurations for input and output buffers of reverse stream. -// An example of reverse stream is the echo reference supplied to an Acoustic Echo Canceler. -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(effect_config_t) -// data: effect_config_t -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_SET_INPUT_DEVICE -//-------------------------------------------------------------------------------------------------- -// description: -// Set the capture device the audio input path is connected to. See audio.h, audio_devices_t -// for device values. -// The effect implementation must set EFFECT_FLAG_DEVICE_IND flag in its descriptor to receive this -// command when the device changes -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(uint32_t) -// data: uint32_t -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 0 -// data: N/A -//================================================================================================== -// command: EFFECT_CMD_GET_CONFIG -//-------------------------------------------------------------------------------------------------- -// description: -// Read audio parameters configurations for input and output buffers -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(effect_config_t) -// data: effect_config_t -//================================================================================================== -// command: EFFECT_CMD_GET_CONFIG_REVERSE -//-------------------------------------------------------------------------------------------------- -// description: -// Read audio parameters configurations for input and output buffers of reverse stream -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(effect_config_t) -// data: effect_config_t -//================================================================================================== -// command: EFFECT_CMD_GET_FEATURE_SUPPORTED_CONFIGS -//-------------------------------------------------------------------------------------------------- -// description: -// Queries for supported configurations for a particular feature (e.g. get the supported -// combinations of main and auxiliary channels for a noise suppressor). -// The command parameter is the feature identifier (See effect_feature_e for a list of defined -// features) followed by the maximum number of configuration descriptor to return. -// The reply is composed of: -// - status (uint32_t): -// - 0 if feature is supported -// - -ENOSYS if the feature is not supported, -// - -ENOMEM if the feature is supported but the total number of supported configurations -// exceeds the maximum number indicated by the caller. -// - total number of supported configurations (uint32_t) -// - an array of configuration descriptors. -// The actual number of descriptors returned must not exceed the maximum number indicated by -// the caller. -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 2 x sizeof(uint32_t) -// data: effect_feature_e + maximum number of configurations to return -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 2 x sizeof(uint32_t) + n x sizeof () -// data: status + total number of configurations supported + array of n config descriptors -//================================================================================================== -// command: EFFECT_CMD_GET_FEATURE_CONFIG -//-------------------------------------------------------------------------------------------------- -// description: -// Retrieves current configuration for a given feature. -// The reply status is: -// - 0 if feature is supported -// - -ENOSYS if the feature is not supported, -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(uint32_t) -// data: effect_feature_e -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(uint32_t) + sizeof () -// data: status + config descriptor -//================================================================================================== -// command: EFFECT_CMD_SET_FEATURE_CONFIG -//-------------------------------------------------------------------------------------------------- -// description: -// Sets current configuration for a given feature. -// The reply status is: -// - 0 if feature is supported -// - -ENOSYS if the feature is not supported, -// - -EINVAL if the configuration is invalid -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(uint32_t) + sizeof () -// data: effect_feature_e + config descriptor -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(uint32_t) -// data: status -//================================================================================================== -// command: EFFECT_CMD_SET_AUDIO_SOURCE -//-------------------------------------------------------------------------------------------------- -// description: -// Set the audio source the capture path is configured for (Camcorder, voice recognition...). -// See audio.h, audio_source_t for values. -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(uint32_t) -// data: uint32_t -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 0 -// data: N/A -//================================================================================================== -// command: EFFECT_CMD_FIRST_PROPRIETARY -//-------------------------------------------------------------------------------------------------- -// description: -// All proprietary effect commands must use command codes above this value. The size and format of -// command and response fields is free in this case -//================================================================================================== - - -// Audio buffer descriptor used by process(), bufferProvider() functions and buffer_config_t -// structure. Multi-channel audio is always interleaved. The channel order is from LSB to MSB with -// regard to the channel mask definition in audio.h, audio_channel_mask_t e.g : -// Stereo: left, right -// 5 point 1: front left, front right, front center, low frequency, back left, back right -// The buffer size is expressed in frame count, a frame being composed of samples for all -// channels at a given time. Frame size for unspecified format (AUDIO_FORMAT_OTHER) is 8 bit by -// definition -struct audio_buffer_s { - size_t frameCount; // number of frames in buffer - union { - void* raw; // raw pointer to start of buffer - int32_t* s32; // pointer to signed 32 bit data at start of buffer - int16_t* s16; // pointer to signed 16 bit data at start of buffer - uint8_t* u8; // pointer to unsigned 8 bit data at start of buffer - }; -}; - -// The buffer_provider_s structure contains functions that can be used -// by the effect engine process() function to query and release input -// or output audio buffer. -// The getBuffer() function is called to retrieve a buffer where data -// should read from or written to by process() function. -// The releaseBuffer() function MUST be called when the buffer retrieved -// with getBuffer() is not needed anymore. -// The process function should use the buffer provider mechanism to retrieve -// input or output buffer if the inBuffer or outBuffer passed as argument is NULL -// and the buffer configuration (buffer_config_t) given by the EFFECT_CMD_SET_CONFIG -// command did not specify an audio buffer. - -typedef int32_t (* buffer_function_t)(void *cookie, audio_buffer_t *buffer); - -typedef struct buffer_provider_s { - buffer_function_t getBuffer; // retrieve next buffer - buffer_function_t releaseBuffer; // release used buffer - void *cookie; // for use by client of buffer provider functions -} buffer_provider_t; - - -// The buffer_config_s structure specifies the input or output audio format -// to be used by the effect engine. It is part of the effect_config_t -// structure that defines both input and output buffer configurations and is -// passed by the EFFECT_CMD_SET_CONFIG or EFFECT_CMD_SET_CONFIG_REVERSE command. -typedef struct buffer_config_s { - audio_buffer_t buffer; // buffer for use by process() function if not passed explicitly - uint32_t samplingRate; // sampling rate - uint32_t channels; // channel mask (see audio_channel_mask_t in audio.h) - buffer_provider_t bufferProvider; // buffer provider - uint8_t format; // Audio format (see see audio_format_t in audio.h) - uint8_t accessMode; // read/write or accumulate in buffer (effect_buffer_access_e) - uint16_t mask; // indicates which of the above fields is valid -} buffer_config_t; - -// Values for "accessMode" field of buffer_config_t: -// overwrite, read only, accumulate (read/modify/write) -enum effect_buffer_access_e { - EFFECT_BUFFER_ACCESS_WRITE, - EFFECT_BUFFER_ACCESS_READ, - EFFECT_BUFFER_ACCESS_ACCUMULATE - -}; - -// feature identifiers for EFFECT_CMD_GET_FEATURE_SUPPORTED_CONFIGS command -enum effect_feature_e { - EFFECT_FEATURE_AUX_CHANNELS, // supports auxiliary channels (e.g. dual mic noise suppressor) - EFFECT_FEATURE_CNT -}; - -// EFFECT_FEATURE_AUX_CHANNELS feature configuration descriptor. Describe a combination -// of main and auxiliary channels supported -typedef struct channel_config_s { - audio_channel_mask_t main_channels; // channel mask for main channels - audio_channel_mask_t aux_channels; // channel mask for auxiliary channels -} channel_config_t; - - -// Values for bit field "mask" in buffer_config_t. If a bit is set, the corresponding field -// in buffer_config_t must be taken into account when executing the EFFECT_CMD_SET_CONFIG command -#define EFFECT_CONFIG_BUFFER 0x0001 // buffer field must be taken into account -#define EFFECT_CONFIG_SMP_RATE 0x0002 // samplingRate field must be taken into account -#define EFFECT_CONFIG_CHANNELS 0x0004 // channels field must be taken into account -#define EFFECT_CONFIG_FORMAT 0x0008 // format field must be taken into account -#define EFFECT_CONFIG_ACC_MODE 0x0010 // accessMode field must be taken into account -#define EFFECT_CONFIG_PROVIDER 0x0020 // bufferProvider field must be taken into account -#define EFFECT_CONFIG_ALL (EFFECT_CONFIG_BUFFER | EFFECT_CONFIG_SMP_RATE | \ - EFFECT_CONFIG_CHANNELS | EFFECT_CONFIG_FORMAT | \ - EFFECT_CONFIG_ACC_MODE | EFFECT_CONFIG_PROVIDER) - - -// effect_config_s structure describes the format of the pCmdData argument of EFFECT_CMD_SET_CONFIG -// command to configure audio parameters and buffers for effect engine input and output. -typedef struct effect_config_s { - buffer_config_t inputCfg; - buffer_config_t outputCfg; -} effect_config_t; - - -// effect_param_s structure describes the format of the pCmdData argument of EFFECT_CMD_SET_PARAM -// command and pCmdData and pReplyData of EFFECT_CMD_GET_PARAM command. -// psize and vsize represent the actual size of parameter and value. -// -// NOTE: the start of value field inside the data field is always on a 32 bit boundary: -// -// +-----------+ -// | status | sizeof(int) -// +-----------+ -// | psize | sizeof(int) -// +-----------+ -// | vsize | sizeof(int) -// +-----------+ -// | | | | -// ~ parameter ~ > psize | -// | | | > ((psize - 1)/sizeof(int) + 1) * sizeof(int) -// +-----------+ | -// | padding | | -// +-----------+ -// | | | -// ~ value ~ > vsize -// | | | -// +-----------+ - -typedef struct effect_param_s { - int32_t status; // Transaction status (unused for command, used for reply) - uint32_t psize; // Parameter size - uint32_t vsize; // Value size - char data[]; // Start of Parameter + Value data -} effect_param_t; - - - -///////////////////////////////////////////////// -// Effect library interface -///////////////////////////////////////////////// - -// Effect library interface version 3.0 -// Note that EffectsFactory.c only checks the major version component, so changes to the minor -// number can only be used for fully backwards compatible changes -#define EFFECT_LIBRARY_API_VERSION EFFECT_MAKE_API_VERSION(3,0) - -#define AUDIO_EFFECT_LIBRARY_TAG ((('A') << 24) | (('E') << 16) | (('L') << 8) | ('T')) - -// Every effect library must have a data structure named AUDIO_EFFECT_LIBRARY_INFO_SYM -// and the fields of this data structure must begin with audio_effect_library_t - -typedef struct audio_effect_library_s { - // tag must be initialized to AUDIO_EFFECT_LIBRARY_TAG - uint32_t tag; - // Version of the effect library API : 0xMMMMmmmm MMMM: Major, mmmm: minor - uint32_t version; - // Name of this library - const char *name; - // Author/owner/implementor of the library - const char *implementor; - - //////////////////////////////////////////////////////////////////////////////// - // - // Function: create_effect - // - // Description: Creates an effect engine of the specified implementation uuid and - // returns an effect control interface on this engine. The function will allocate the - // resources for an instance of the requested effect engine and return - // a handle on the effect control interface. - // - // Input: - // uuid: pointer to the effect uuid. - // sessionId: audio session to which this effect instance will be attached. All effects - // created with the same session ID are connected in series and process the same signal - // stream. Knowing that two effects are part of the same effect chain can help the - // library implement some kind of optimizations. - // ioId: identifies the output or input stream this effect is directed to at audio HAL. - // For future use especially with tunneled HW accelerated effects - // - // Input/Output: - // pHandle: address where to return the effect interface handle. - // - // Output: - // returned value: 0 successful operation. - // -ENODEV library failed to initialize - // -EINVAL invalid pEffectUuid or pHandle - // -ENOENT no effect with this uuid found - // *pHandle: updated with the effect interface handle. - // - //////////////////////////////////////////////////////////////////////////////// - int32_t (*create_effect)(const effect_uuid_t *uuid, - int32_t sessionId, - int32_t ioId, - effect_handle_t *pHandle); - - //////////////////////////////////////////////////////////////////////////////// - // - // Function: release_effect - // - // Description: Releases the effect engine whose handle is given as argument. - // All resources allocated to this particular instance of the effect are - // released. - // - // Input: - // handle: handle on the effect interface to be released. - // - // Output: - // returned value: 0 successful operation. - // -ENODEV library failed to initialize - // -EINVAL invalid interface handle - // - //////////////////////////////////////////////////////////////////////////////// - int32_t (*release_effect)(effect_handle_t handle); - - //////////////////////////////////////////////////////////////////////////////// - // - // Function: get_descriptor - // - // Description: Returns the descriptor of the effect engine which implementation UUID is - // given as argument. - // - // Input/Output: - // uuid: pointer to the effect uuid. - // pDescriptor: address where to return the effect descriptor. - // - // Output: - // returned value: 0 successful operation. - // -ENODEV library failed to initialize - // -EINVAL invalid pDescriptor or uuid - // *pDescriptor: updated with the effect descriptor. - // - //////////////////////////////////////////////////////////////////////////////// - int32_t (*get_descriptor)(const effect_uuid_t *uuid, - effect_descriptor_t *pDescriptor); -} audio_effect_library_t; - -// Name of the hal_module_info -#define AUDIO_EFFECT_LIBRARY_INFO_SYM AELI - -// Name of the hal_module_info as a string -#define AUDIO_EFFECT_LIBRARY_INFO_SYM_AS_STR "AELI" - -__END_DECLS - -#endif // ANDROID_AUDIO_EFFECT_H diff --git a/external/android/include/18/hardware/libhardware/include/hardware/audio_policy.h b/external/android/include/18/hardware/libhardware/include/hardware/audio_policy.h deleted file mode 100644 index c635ebf..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/audio_policy.h +++ /dev/null @@ -1,449 +0,0 @@ -/* - * Copyright (C) 2011 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_AUDIO_POLICY_INTERFACE_H -#define ANDROID_AUDIO_POLICY_INTERFACE_H - -#include -#include -#include - -#include - -#include -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define AUDIO_POLICY_HARDWARE_MODULE_ID "audio_policy" - -/** - * Name of the audio devices to open - */ -#define AUDIO_POLICY_INTERFACE "policy" - -/* ---------------------------------------------------------------------------- */ - -/* - * The audio_policy and audio_policy_service_ops structs define the - * communication interfaces between the platform specific audio policy manager - * and Android generic audio policy manager. - * The platform specific audio policy manager must implement methods of the - * audio_policy struct. - * This implementation makes use of the audio_policy_service_ops to control - * the activity and configuration of audio input and output streams. - * - * The platform specific audio policy manager is in charge of the audio - * routing and volume control policies for a given platform. - * The main roles of this module are: - * - keep track of current system state (removable device connections, phone - * state, user requests...). - * System state changes and user actions are notified to audio policy - * manager with methods of the audio_policy. - * - * - process get_output() queries received when AudioTrack objects are - * created: Those queries return a handler on an output that has been - * selected, configured and opened by the audio policy manager and that - * must be used by the AudioTrack when registering to the AudioFlinger - * with the createTrack() method. - * When the AudioTrack object is released, a release_output() query - * is received and the audio policy manager can decide to close or - * reconfigure the output depending on other streams using this output and - * current system state. - * - * - similarly process get_input() and release_input() queries received from - * AudioRecord objects and configure audio inputs. - * - process volume control requests: the stream volume is converted from - * an index value (received from UI) to a float value applicable to each - * output as a function of platform specific settings and current output - * route (destination device). It also make sure that streams are not - * muted if not allowed (e.g. camera shutter sound in some countries). - */ - -/* XXX: this should be defined OUTSIDE of frameworks/base */ -struct effect_descriptor_s; - -struct audio_policy { - /* - * configuration functions - */ - - /* indicate a change in device connection status */ - int (*set_device_connection_state)(struct audio_policy *pol, - audio_devices_t device, - audio_policy_dev_state_t state, - const char *device_address); - - /* retrieve a device connection status */ - audio_policy_dev_state_t (*get_device_connection_state)( - const struct audio_policy *pol, - audio_devices_t device, - const char *device_address); - - /* indicate a change in phone state. Valid phones states are defined - * by audio_mode_t */ - void (*set_phone_state)(struct audio_policy *pol, audio_mode_t state); - - /* deprecated, never called (was "indicate a change in ringer mode") */ - void (*set_ringer_mode)(struct audio_policy *pol, uint32_t mode, - uint32_t mask); - - /* force using a specific device category for the specified usage */ - void (*set_force_use)(struct audio_policy *pol, - audio_policy_force_use_t usage, - audio_policy_forced_cfg_t config); - - /* retrieve current device category forced for a given usage */ - audio_policy_forced_cfg_t (*get_force_use)(const struct audio_policy *pol, - audio_policy_force_use_t usage); - - /* if can_mute is true, then audio streams that are marked ENFORCED_AUDIBLE - * can still be muted. */ - void (*set_can_mute_enforced_audible)(struct audio_policy *pol, - bool can_mute); - - /* check proper initialization */ - int (*init_check)(const struct audio_policy *pol); - - /* - * Audio routing query functions - */ - - /* request an output appropriate for playback of the supplied stream type and - * parameters */ - audio_io_handle_t (*get_output)(struct audio_policy *pol, - audio_stream_type_t stream, - uint32_t samplingRate, - audio_format_t format, - audio_channel_mask_t channelMask, - audio_output_flags_t flags); - - /* indicates to the audio policy manager that the output starts being used - * by corresponding stream. */ - int (*start_output)(struct audio_policy *pol, - audio_io_handle_t output, - audio_stream_type_t stream, - int session); - - /* indicates to the audio policy manager that the output stops being used - * by corresponding stream. */ - int (*stop_output)(struct audio_policy *pol, - audio_io_handle_t output, - audio_stream_type_t stream, - int session); - - /* releases the output. */ - void (*release_output)(struct audio_policy *pol, audio_io_handle_t output); - - /* request an input appropriate for record from the supplied device with - * supplied parameters. */ - audio_io_handle_t (*get_input)(struct audio_policy *pol, audio_source_t inputSource, - uint32_t samplingRate, - audio_format_t format, - audio_channel_mask_t channelMask, - audio_in_acoustics_t acoustics); - - /* indicates to the audio policy manager that the input starts being used */ - int (*start_input)(struct audio_policy *pol, audio_io_handle_t input); - - /* indicates to the audio policy manager that the input stops being used. */ - int (*stop_input)(struct audio_policy *pol, audio_io_handle_t input); - - /* releases the input. */ - void (*release_input)(struct audio_policy *pol, audio_io_handle_t input); - - /* - * volume control functions - */ - - /* initialises stream volume conversion parameters by specifying volume - * index range. The index range for each stream is defined by AudioService. */ - void (*init_stream_volume)(struct audio_policy *pol, - audio_stream_type_t stream, - int index_min, - int index_max); - - /* sets the new stream volume at a level corresponding to the supplied - * index. The index is within the range specified by init_stream_volume() */ - int (*set_stream_volume_index)(struct audio_policy *pol, - audio_stream_type_t stream, - int index); - - /* retrieve current volume index for the specified stream */ - int (*get_stream_volume_index)(const struct audio_policy *pol, - audio_stream_type_t stream, - int *index); - - /* sets the new stream volume at a level corresponding to the supplied - * index for the specified device. - * The index is within the range specified by init_stream_volume() */ - int (*set_stream_volume_index_for_device)(struct audio_policy *pol, - audio_stream_type_t stream, - int index, - audio_devices_t device); - - /* retrieve current volume index for the specified stream for the specified device */ - int (*get_stream_volume_index_for_device)(const struct audio_policy *pol, - audio_stream_type_t stream, - int *index, - audio_devices_t device); - - /* return the strategy corresponding to a given stream type */ - uint32_t (*get_strategy_for_stream)(const struct audio_policy *pol, - audio_stream_type_t stream); - - /* return the enabled output devices for the given stream type */ - audio_devices_t (*get_devices_for_stream)(const struct audio_policy *pol, - audio_stream_type_t stream); - - /* Audio effect management */ - audio_io_handle_t (*get_output_for_effect)(struct audio_policy *pol, - const struct effect_descriptor_s *desc); - - int (*register_effect)(struct audio_policy *pol, - const struct effect_descriptor_s *desc, - audio_io_handle_t output, - uint32_t strategy, - int session, - int id); - - int (*unregister_effect)(struct audio_policy *pol, int id); - - int (*set_effect_enabled)(struct audio_policy *pol, int id, bool enabled); - - bool (*is_stream_active)(const struct audio_policy *pol, - audio_stream_type_t stream, - uint32_t in_past_ms); - - bool (*is_stream_active_remotely)(const struct audio_policy *pol, - audio_stream_type_t stream, - uint32_t in_past_ms); - - bool (*is_source_active)(const struct audio_policy *pol, - audio_source_t source); - - /* dump state */ - int (*dump)(const struct audio_policy *pol, int fd); -}; - -/* audio hw module handle used by load_hw_module(), open_output_on_module() - * and open_input_on_module() */ -typedef int audio_module_handle_t; - -struct audio_policy_service_ops { - /* - * Audio output Control functions - */ - - /* Opens an audio output with the requested parameters. - * - * The parameter values can indicate to use the default values in case the - * audio policy manager has no specific requirements for the output being - * opened. - * - * When the function returns, the parameter values reflect the actual - * values used by the audio hardware output stream. - * - * The audio policy manager can check if the proposed parameters are - * suitable or not and act accordingly. - */ - audio_io_handle_t (*open_output)(void *service, - audio_devices_t *pDevices, - uint32_t *pSamplingRate, - audio_format_t *pFormat, - audio_channel_mask_t *pChannelMask, - uint32_t *pLatencyMs, - audio_output_flags_t flags); - - /* creates a special output that is duplicated to the two outputs passed as - * arguments. The duplication is performed by - * a special mixer thread in the AudioFlinger. - */ - audio_io_handle_t (*open_duplicate_output)(void *service, - audio_io_handle_t output1, - audio_io_handle_t output2); - - /* closes the output stream */ - int (*close_output)(void *service, audio_io_handle_t output); - - /* suspends the output. - * - * When an output is suspended, the corresponding audio hardware output - * stream is placed in standby and the AudioTracks attached to the mixer - * thread are still processed but the output mix is discarded. - */ - int (*suspend_output)(void *service, audio_io_handle_t output); - - /* restores a suspended output. */ - int (*restore_output)(void *service, audio_io_handle_t output); - - /* */ - /* Audio input Control functions */ - /* */ - - /* opens an audio input - * deprecated - new implementations should use open_input_on_module, - * and the acoustics parameter is ignored - */ - audio_io_handle_t (*open_input)(void *service, - audio_devices_t *pDevices, - uint32_t *pSamplingRate, - audio_format_t *pFormat, - audio_channel_mask_t *pChannelMask, - audio_in_acoustics_t acoustics); - - /* closes an audio input */ - int (*close_input)(void *service, audio_io_handle_t input); - - /* */ - /* misc control functions */ - /* */ - - /* set a stream volume for a particular output. - * - * For the same user setting, a given stream type can have different - * volumes for each output (destination device) it is attached to. - */ - int (*set_stream_volume)(void *service, - audio_stream_type_t stream, - float volume, - audio_io_handle_t output, - int delay_ms); - - /* reroute a given stream type to the specified output */ - int (*set_stream_output)(void *service, - audio_stream_type_t stream, - audio_io_handle_t output); - - /* function enabling to send proprietary informations directly from audio - * policy manager to audio hardware interface. */ - void (*set_parameters)(void *service, - audio_io_handle_t io_handle, - const char *kv_pairs, - int delay_ms); - - /* function enabling to receive proprietary informations directly from - * audio hardware interface to audio policy manager. - * - * Returns a pointer to a heap allocated string. The caller is responsible - * for freeing the memory for it using free(). - */ - - char * (*get_parameters)(void *service, audio_io_handle_t io_handle, - const char *keys); - - /* request the playback of a tone on the specified stream. - * used for instance to replace notification sounds when playing over a - * telephony device during a phone call. - */ - int (*start_tone)(void *service, - audio_policy_tone_t tone, - audio_stream_type_t stream); - - int (*stop_tone)(void *service); - - /* set down link audio volume. */ - int (*set_voice_volume)(void *service, - float volume, - int delay_ms); - - /* move effect to the specified output */ - int (*move_effects)(void *service, - int session, - audio_io_handle_t src_output, - audio_io_handle_t dst_output); - - /* loads an audio hw module. - * - * The module name passed is the base name of the HW module library, e.g "primary" or "a2dp". - * The function returns a handle on the module that will be used to specify a particular - * module when calling open_output_on_module() or open_input_on_module() - */ - audio_module_handle_t (*load_hw_module)(void *service, - const char *name); - - /* Opens an audio output on a particular HW module. - * - * Same as open_output() but specifying a specific HW module on which the output must be opened. - */ - audio_io_handle_t (*open_output_on_module)(void *service, - audio_module_handle_t module, - audio_devices_t *pDevices, - uint32_t *pSamplingRate, - audio_format_t *pFormat, - audio_channel_mask_t *pChannelMask, - uint32_t *pLatencyMs, - audio_output_flags_t flags); - - /* Opens an audio input on a particular HW module. - * - * Same as open_input() but specifying a specific HW module on which the input must be opened. - * Also removed deprecated acoustics parameter - */ - audio_io_handle_t (*open_input_on_module)(void *service, - audio_module_handle_t module, - audio_devices_t *pDevices, - uint32_t *pSamplingRate, - audio_format_t *pFormat, - audio_channel_mask_t *pChannelMask); - -}; - -/**********************************************************************/ - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -typedef struct audio_policy_module { - struct hw_module_t common; -} audio_policy_module_t; - -struct audio_policy_device { - struct hw_device_t common; - - int (*create_audio_policy)(const struct audio_policy_device *device, - struct audio_policy_service_ops *aps_ops, - void *service, - struct audio_policy **ap); - - int (*destroy_audio_policy)(const struct audio_policy_device *device, - struct audio_policy *ap); -}; - -/** convenience API for opening and closing a supported device */ - -static inline int audio_policy_dev_open(const hw_module_t* module, - struct audio_policy_device** device) -{ - return module->methods->open(module, AUDIO_POLICY_INTERFACE, - (hw_device_t**)device); -} - -static inline int audio_policy_dev_close(struct audio_policy_device* device) -{ - return device->common.close(&device->common); -} - - -__END_DECLS - -#endif // ANDROID_AUDIO_POLICY_INTERFACE_H diff --git a/external/android/include/18/hardware/libhardware/include/hardware/bluetooth.h b/external/android/include/18/hardware/libhardware/include/hardware/bluetooth.h deleted file mode 100755 index 2741332..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/bluetooth.h +++ /dev/null @@ -1,468 +0,0 @@ -/* - * Copyright (C) 2012 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_INCLUDE_BLUETOOTH_H -#define ANDROID_INCLUDE_BLUETOOTH_H - -#include -#include -#include - -#include - -__BEGIN_DECLS - -/** - * The Bluetooth Hardware Module ID - */ - -#define BT_HARDWARE_MODULE_ID "bluetooth" -#define BT_STACK_MODULE_ID "bluetooth" -#define BT_STACK_TEST_MODULE_ID "bluetooth_test" - - -/* Bluetooth profile interface IDs */ - -#define BT_PROFILE_HANDSFREE_ID "handsfree" -#define BT_PROFILE_ADVANCED_AUDIO_ID "a2dp" -#define BT_PROFILE_HEALTH_ID "health" -#define BT_PROFILE_SOCKETS_ID "socket" -#define BT_PROFILE_HIDHOST_ID "hidhost" -#define BT_PROFILE_PAN_ID "pan" - -#define BT_PROFILE_GATT_ID "gatt" -#define BT_PROFILE_AV_RC_ID "avrcp" - -/** Bluetooth Address */ -typedef struct { - uint8_t address[6]; -} __attribute__((packed))bt_bdaddr_t; - -/** Bluetooth Device Name */ -typedef struct { - uint8_t name[249]; -} __attribute__((packed))bt_bdname_t; - -/** Bluetooth Adapter Visibility Modes*/ -typedef enum { - BT_SCAN_MODE_NONE, - BT_SCAN_MODE_CONNECTABLE, - BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE -} bt_scan_mode_t; - -/** Bluetooth Adapter State */ -typedef enum { - BT_STATE_OFF, - BT_STATE_ON -} bt_state_t; - -/** Bluetooth Error Status */ -/** We need to build on this */ - -typedef enum { - BT_STATUS_SUCCESS, - BT_STATUS_FAIL, - BT_STATUS_NOT_READY, - BT_STATUS_NOMEM, - BT_STATUS_BUSY, - BT_STATUS_DONE, /* request already completed */ - BT_STATUS_UNSUPPORTED, - BT_STATUS_PARM_INVALID, - BT_STATUS_UNHANDLED, - BT_STATUS_AUTH_FAILURE, - BT_STATUS_RMT_DEV_DOWN - -} bt_status_t; - -/** Bluetooth PinKey Code */ -typedef struct { - uint8_t pin[16]; -} __attribute__((packed))bt_pin_code_t; - -/** Bluetooth Adapter Discovery state */ -typedef enum { - BT_DISCOVERY_STOPPED, - BT_DISCOVERY_STARTED -} bt_discovery_state_t; - -/** Bluetooth ACL connection state */ -typedef enum { - BT_ACL_STATE_CONNECTED, - BT_ACL_STATE_DISCONNECTED -} bt_acl_state_t; - -/** Bluetooth 128-bit UUID */ -typedef struct { - uint8_t uu[16]; -} bt_uuid_t; - -/** Bluetooth SDP service record */ -typedef struct -{ - bt_uuid_t uuid; - uint16_t channel; - char name[256]; // what's the maximum length -} bt_service_record_t; - - -/** Bluetooth Remote Version info */ -typedef struct -{ - int version; - int sub_ver; - int manufacturer; -} bt_remote_version_t; - -/* Bluetooth Adapter and Remote Device property types */ -typedef enum { - /* Properties common to both adapter and remote device */ - /** - * Description - Bluetooth Device Name - * Access mode - Adapter name can be GET/SET. Remote device can be GET - * Data type - bt_bdname_t - */ - BT_PROPERTY_BDNAME = 0x1, - /** - * Description - Bluetooth Device Address - * Access mode - Only GET. - * Data type - bt_bdaddr_t - */ - BT_PROPERTY_BDADDR, - /** - * Description - Bluetooth Service 128-bit UUIDs - * Access mode - Only GET. - * Data type - Array of bt_uuid_t (Array size inferred from property length). - */ - BT_PROPERTY_UUIDS, - /** - * Description - Bluetooth Class of Device as found in Assigned Numbers - * Access mode - Only GET. - * Data type - uint32_t. - */ - BT_PROPERTY_CLASS_OF_DEVICE, - /** - * Description - Device Type - BREDR, BLE or DUAL Mode - * Access mode - Only GET. - * Data type - bt_device_type_t - */ - BT_PROPERTY_TYPE_OF_DEVICE, - /** - * Description - Bluetooth Service Record - * Access mode - Only GET. - * Data type - bt_service_record_t - */ - BT_PROPERTY_SERVICE_RECORD, - - /* Properties unique to adapter */ - /** - * Description - Bluetooth Adapter scan mode - * Access mode - GET and SET - * Data type - bt_scan_mode_t. - */ - BT_PROPERTY_ADAPTER_SCAN_MODE, - /** - * Description - List of bonded devices - * Access mode - Only GET. - * Data type - Array of bt_bdaddr_t of the bonded remote devices - * (Array size inferred from property length). - */ - BT_PROPERTY_ADAPTER_BONDED_DEVICES, - /** - * Description - Bluetooth Adapter Discovery timeout (in seconds) - * Access mode - GET and SET - * Data type - uint32_t - */ - BT_PROPERTY_ADAPTER_DISCOVERY_TIMEOUT, - - /* Properties unique to remote device */ - /** - * Description - User defined friendly name of the remote device - * Access mode - GET and SET - * Data type - bt_bdname_t. - */ - BT_PROPERTY_REMOTE_FRIENDLY_NAME, - /** - * Description - RSSI value of the inquired remote device - * Access mode - Only GET. - * Data type - int32_t. - */ - BT_PROPERTY_REMOTE_RSSI, - /** - * Description - Remote version info - * Access mode - SET/GET. - * Data type - bt_remote_version_t. - */ - - BT_PROPERTY_REMOTE_VERSION_INFO, - - BT_PROPERTY_REMOTE_DEVICE_TIMESTAMP = 0xFF, -} bt_property_type_t; - -/** Bluetooth Adapter Property data structure */ -typedef struct -{ - bt_property_type_t type; - int len; - void *val; -} bt_property_t; - -/** Bluetooth Device Type */ -typedef enum { - BT_DEVICE_DEVTYPE_BREDR = 0x1, - BT_DEVICE_DEVTYPE_BLE, - BT_DEVICE_DEVTYPE_DUAL -} bt_device_type_t; -/** Bluetooth Bond state */ -typedef enum { - BT_BOND_STATE_NONE, - BT_BOND_STATE_BONDING, - BT_BOND_STATE_BONDED -} bt_bond_state_t; - -/** Bluetooth SSP Bonding Variant */ -typedef enum { - BT_SSP_VARIANT_PASSKEY_CONFIRMATION, - BT_SSP_VARIANT_PASSKEY_ENTRY, - BT_SSP_VARIANT_CONSENT, - BT_SSP_VARIANT_PASSKEY_NOTIFICATION -} bt_ssp_variant_t; - -#define BT_MAX_NUM_UUIDS 32 - -/** Bluetooth Interface callbacks */ - -/** Bluetooth Enable/Disable Callback. */ -typedef void (*adapter_state_changed_callback)(bt_state_t state); - -/** GET/SET Adapter Properties callback */ -/* TODO: For the GET/SET property APIs/callbacks, we may need a session - * identifier to associate the call with the callback. This would be needed - * whenever more than one simultaneous instance of the same adapter_type - * is get/set. - * - * If this is going to be handled in the Java framework, then we do not need - * to manage sessions here. - */ -typedef void (*adapter_properties_callback)(bt_status_t status, - int num_properties, - bt_property_t *properties); - -/** GET/SET Remote Device Properties callback */ -/** TODO: For remote device properties, do not see a need to get/set - * multiple properties - num_properties shall be 1 - */ -typedef void (*remote_device_properties_callback)(bt_status_t status, - bt_bdaddr_t *bd_addr, - int num_properties, - bt_property_t *properties); - -/** New device discovered callback */ -/** If EIR data is not present, then BD_NAME and RSSI shall be NULL and -1 - * respectively */ -typedef void (*device_found_callback)(int num_properties, - bt_property_t *properties); - -/** Discovery state changed callback */ -typedef void (*discovery_state_changed_callback)(bt_discovery_state_t state); - -/** Bluetooth Legacy PinKey Request callback */ -typedef void (*pin_request_callback)(bt_bdaddr_t *remote_bd_addr, - bt_bdname_t *bd_name, uint32_t cod); - -/** Bluetooth SSP Request callback - Just Works & Numeric Comparison*/ -/** pass_key - Shall be 0 for BT_SSP_PAIRING_VARIANT_CONSENT & - * BT_SSP_PAIRING_PASSKEY_ENTRY */ -/* TODO: Passkey request callback shall not be needed for devices with display - * capability. We still need support this in the stack for completeness */ -typedef void (*ssp_request_callback)(bt_bdaddr_t *remote_bd_addr, - bt_bdname_t *bd_name, - uint32_t cod, - bt_ssp_variant_t pairing_variant, - uint32_t pass_key); - -/** Bluetooth Bond state changed callback */ -/* Invoked in response to create_bond, cancel_bond or remove_bond */ -typedef void (*bond_state_changed_callback)(bt_status_t status, - bt_bdaddr_t *remote_bd_addr, - bt_bond_state_t state); - -/** Bluetooth ACL connection state changed callback */ -typedef void (*acl_state_changed_callback)(bt_status_t status, bt_bdaddr_t *remote_bd_addr, - bt_acl_state_t state); - -typedef enum { - ASSOCIATE_JVM, - DISASSOCIATE_JVM -} bt_cb_thread_evt; - -/** Thread Associate/Disassociate JVM Callback */ -/* Callback that is invoked by the callback thread to allow upper layer to attach/detach to/from - * the JVM */ -typedef void (*callback_thread_event)(bt_cb_thread_evt evt); - -/** Bluetooth Test Mode Callback */ -/* Receive any HCI event from controller. Must be in DUT Mode for this callback to be received */ -typedef void (*dut_mode_recv_callback)(uint16_t opcode, uint8_t *buf, uint8_t len); - -/* LE Test mode callbacks -* This callback shall be invoked whenever the le_tx_test, le_rx_test or le_test_end is invoked -* The num_packets is valid only for le_test_end command */ -typedef void (*le_test_mode_callback)(bt_status_t status, uint16_t num_packets); -/** TODO: Add callbacks for Link Up/Down and other generic - * notifications/callbacks */ - -/** Bluetooth DM callback structure. */ -typedef struct { - /** set to sizeof(bt_callbacks_t) */ - size_t size; - adapter_state_changed_callback adapter_state_changed_cb; - adapter_properties_callback adapter_properties_cb; - remote_device_properties_callback remote_device_properties_cb; - device_found_callback device_found_cb; - discovery_state_changed_callback discovery_state_changed_cb; - pin_request_callback pin_request_cb; - ssp_request_callback ssp_request_cb; - bond_state_changed_callback bond_state_changed_cb; - acl_state_changed_callback acl_state_changed_cb; - callback_thread_event thread_evt_cb; - dut_mode_recv_callback dut_mode_recv_cb; - le_test_mode_callback le_test_mode_cb; -} bt_callbacks_t; - -/** NOTE: By default, no profiles are initialized at the time of init/enable. - * Whenever the application invokes the 'init' API of a profile, then one of - * the following shall occur: - * - * 1.) If Bluetooth is not enabled, then the Bluetooth core shall mark the - * profile as enabled. Subsequently, when the application invokes the - * Bluetooth 'enable', as part of the enable sequence the profile that were - * marked shall be enabled by calling appropriate stack APIs. The - * 'adapter_properties_cb' shall return the list of UUIDs of the - * enabled profiles. - * - * 2.) If Bluetooth is enabled, then the Bluetooth core shall invoke the stack - * profile API to initialize the profile and trigger a - * 'adapter_properties_cb' with the current list of UUIDs including the - * newly added profile's UUID. - * - * The reverse shall occur whenever the profile 'cleanup' APIs are invoked - */ - -/** Represents the standard Bluetooth DM interface. */ -typedef struct { - /** set to sizeof(bt_interface_t) */ - size_t size; - /** - * Opens the interface and provides the callback routines - * to the implemenation of this interface. - */ - int (*init)(bt_callbacks_t* callbacks ); - - /** Enable Bluetooth. */ - int (*enable)(void); - - /** Disable Bluetooth. */ - int (*disable)(void); - - /** Closes the interface. */ - void (*cleanup)(void); - - /** Get all Bluetooth Adapter properties at init */ - int (*get_adapter_properties)(void); - - /** Get Bluetooth Adapter property of 'type' */ - int (*get_adapter_property)(bt_property_type_t type); - - /** Set Bluetooth Adapter property of 'type' */ - /* Based on the type, val shall be one of - * bt_bdaddr_t or bt_bdname_t or bt_scanmode_t etc - */ - int (*set_adapter_property)(const bt_property_t *property); - - /** Get all Remote Device properties */ - int (*get_remote_device_properties)(bt_bdaddr_t *remote_addr); - - /** Get Remote Device property of 'type' */ - int (*get_remote_device_property)(bt_bdaddr_t *remote_addr, - bt_property_type_t type); - - /** Set Remote Device property of 'type' */ - int (*set_remote_device_property)(bt_bdaddr_t *remote_addr, - const bt_property_t *property); - - /** Get Remote Device's service record for the given UUID */ - int (*get_remote_service_record)(bt_bdaddr_t *remote_addr, - bt_uuid_t *uuid); - - /** Start SDP to get remote services */ - int (*get_remote_services)(bt_bdaddr_t *remote_addr); - - /** Start Discovery */ - int (*start_discovery)(void); - - /** Cancel Discovery */ - int (*cancel_discovery)(void); - - /** Create Bluetooth Bonding */ - int (*create_bond)(const bt_bdaddr_t *bd_addr); - - /** Remove Bond */ - int (*remove_bond)(const bt_bdaddr_t *bd_addr); - - /** Cancel Bond */ - int (*cancel_bond)(const bt_bdaddr_t *bd_addr); - - /** BT Legacy PinKey Reply */ - /** If accept==FALSE, then pin_len and pin_code shall be 0x0 */ - int (*pin_reply)(const bt_bdaddr_t *bd_addr, uint8_t accept, - uint8_t pin_len, bt_pin_code_t *pin_code); - - /** BT SSP Reply - Just Works, Numeric Comparison and Passkey - * passkey shall be zero for BT_SSP_VARIANT_PASSKEY_COMPARISON & - * BT_SSP_VARIANT_CONSENT - * For BT_SSP_VARIANT_PASSKEY_ENTRY, if accept==FALSE, then passkey - * shall be zero */ - int (*ssp_reply)(const bt_bdaddr_t *bd_addr, bt_ssp_variant_t variant, - uint8_t accept, uint32_t passkey); - - /** Get Bluetooth profile interface */ - const void* (*get_profile_interface) (const char *profile_id); - - /** Bluetooth Test Mode APIs - Bluetooth must be enabled for these APIs */ - /* Configure DUT Mode - Use this mode to enter/exit DUT mode */ - int (*dut_mode_configure)(uint8_t enable); - - /* Send any test HCI (vendor-specific) command to the controller. Must be in DUT Mode */ - int (*dut_mode_send)(uint16_t opcode, uint8_t *buf, uint8_t len); - /** BLE Test Mode APIs */ - /* opcode MUST be one of: LE_Receiver_Test, LE_Transmitter_Test, LE_Test_End */ - int (*le_test_mode)(uint16_t opcode, uint8_t *buf, uint8_t len); - -} bt_interface_t; - -/** TODO: Need to add APIs for Service Discovery, Service authorization and - * connection management. Also need to add APIs for configuring - * properties of remote bonded devices such as name, UUID etc. */ - -typedef struct { - struct hw_device_t common; - const bt_interface_t* (*get_bluetooth_interface)(); -} bluetooth_device_t; - -typedef bluetooth_device_t bluetooth_module_t; -__END_DECLS - -#endif /* ANDROID_INCLUDE_BLUETOOTH_H */ diff --git a/external/android/include/18/hardware/libhardware/include/hardware/bt_av.h b/external/android/include/18/hardware/libhardware/include/hardware/bt_av.h deleted file mode 100644 index 2ec00c3..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/bt_av.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 2012 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_INCLUDE_BT_AV_H -#define ANDROID_INCLUDE_BT_AV_H - -__BEGIN_DECLS - -/* Bluetooth AV connection states */ -typedef enum { - BTAV_CONNECTION_STATE_DISCONNECTED = 0, - BTAV_CONNECTION_STATE_CONNECTING, - BTAV_CONNECTION_STATE_CONNECTED, - BTAV_CONNECTION_STATE_DISCONNECTING -} btav_connection_state_t; - -/* Bluetooth AV datapath states */ -typedef enum { - BTAV_AUDIO_STATE_REMOTE_SUSPEND = 0, - BTAV_AUDIO_STATE_STOPPED, - BTAV_AUDIO_STATE_STARTED, -} btav_audio_state_t; - - -/** Callback for connection state change. - * state will have one of the values from btav_connection_state_t - */ -typedef void (* btav_connection_state_callback)(btav_connection_state_t state, - bt_bdaddr_t *bd_addr); - -/** Callback for audiopath state change. - * state will have one of the values from btav_audio_state_t - */ -typedef void (* btav_audio_state_callback)(btav_audio_state_t state, - bt_bdaddr_t *bd_addr); - -/** BT-AV callback structure. */ -typedef struct { - /** set to sizeof(btav_callbacks_t) */ - size_t size; - btav_connection_state_callback connection_state_cb; - btav_audio_state_callback audio_state_cb; -} btav_callbacks_t; - -/** - * NOTE: - * - * 1. AVRCP 1.0 shall be supported initially. AVRCP passthrough commands - * shall be handled internally via uinput - * - * 2. A2DP data path shall be handled via a socket pipe between the AudioFlinger - * android_audio_hw library and the Bluetooth stack. - * - */ -/** Represents the standard BT-AV interface. */ -typedef struct { - - /** set to sizeof(btav_interface_t) */ - size_t size; - /** - * Register the BtAv callbacks - */ - bt_status_t (*init)( btav_callbacks_t* callbacks ); - - /** connect to headset */ - bt_status_t (*connect)( bt_bdaddr_t *bd_addr ); - - /** dis-connect from headset */ - bt_status_t (*disconnect)( bt_bdaddr_t *bd_addr ); - - /** Closes the interface. */ - void (*cleanup)( void ); -} btav_interface_t; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_BT_AV_H */ diff --git a/external/android/include/18/hardware/libhardware/include/hardware/bt_gatt.h b/external/android/include/18/hardware/libhardware/include/hardware/bt_gatt.h deleted file mode 100644 index 42e14c2..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/bt_gatt.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2013 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_INCLUDE_BT_GATT_H -#define ANDROID_INCLUDE_BT_GATT_H - -#include -#include "bt_gatt_client.h" -#include "bt_gatt_server.h" - -__BEGIN_DECLS - -/** BT-GATT callbacks */ -typedef struct { - /** Set to sizeof(btgatt_callbacks_t) */ - size_t size; - - /** GATT Client callbacks */ - const btgatt_client_callbacks_t* client; - - /** GATT Server callbacks */ - const btgatt_server_callbacks_t* server; -} btgatt_callbacks_t; - -/** Represents the standard Bluetooth GATT interface. */ -typedef struct { - /** Set to sizeof(btgatt_interface_t) */ - size_t size; - - /** - * Initializes the interface and provides callback routines - */ - bt_status_t (*init)( const btgatt_callbacks_t* callbacks ); - - /** Closes the interface */ - void (*cleanup)( void ); - - /** Pointer to the GATT client interface methods.*/ - const btgatt_client_interface_t* client; - - /** Pointer to the GATT server interface methods.*/ - const btgatt_server_interface_t* server; -} btgatt_interface_t; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_BT_GATT_H */ diff --git a/external/android/include/18/hardware/libhardware/include/hardware/bt_gatt_client.h b/external/android/include/18/hardware/libhardware/include/hardware/bt_gatt_client.h deleted file mode 100644 index 8b49f59..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/bt_gatt_client.h +++ /dev/null @@ -1,275 +0,0 @@ -/* - * Copyright (C) 2013 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_INCLUDE_BT_GATT_CLIENT_H -#define ANDROID_INCLUDE_BT_GATT_CLIENT_H - -#include -#include "bt_gatt_types.h" - -__BEGIN_DECLS - -/** - * Buffer sizes for maximum attribute length and maximum read/write - * operation buffer size. - */ -#define BTGATT_MAX_ATTR_LEN 600 - -/** Buffer type for unformatted reads/writes */ -typedef struct -{ - uint8_t value[BTGATT_MAX_ATTR_LEN]; - uint16_t len; -} btgatt_unformatted_value_t; - -/** Parameters for GATT read operations */ -typedef struct -{ - btgatt_srvc_id_t srvc_id; - btgatt_char_id_t char_id; - bt_uuid_t descr_id; - btgatt_unformatted_value_t value; - uint16_t value_type; - uint8_t status; -} btgatt_read_params_t; - -/** Parameters for GATT write operations */ -typedef struct -{ - btgatt_srvc_id_t srvc_id; - btgatt_char_id_t char_id; - bt_uuid_t descr_id; - uint8_t status; -} btgatt_write_params_t; - -/** Attribute change notification parameters */ -typedef struct -{ - uint8_t value[BTGATT_MAX_ATTR_LEN]; - bt_bdaddr_t bda; - btgatt_srvc_id_t srvc_id; - btgatt_char_id_t char_id; - uint16_t len; - uint8_t is_notify; -} btgatt_notify_params_t; - -typedef struct -{ - bt_bdaddr_t *bda1; - bt_uuid_t *uuid1; - uint16_t u1; - uint16_t u2; - uint16_t u3; - uint16_t u4; - uint16_t u5; -} btgatt_test_params_t; - -/** BT-GATT Client callback structure. */ - -/** Callback invoked in response to register_client */ -typedef void (*register_client_callback)(int status, int client_if, - bt_uuid_t *app_uuid); - -/** Callback for scan results */ -typedef void (*scan_result_callback)(bt_bdaddr_t* bda, int rssi, uint8_t* adv_data); - -/** GATT open callback invoked in response to open */ -typedef void (*connect_callback)(int conn_id, int status, int client_if, bt_bdaddr_t* bda); - -/** Callback invoked in response to close */ -typedef void (*disconnect_callback)(int conn_id, int status, - int client_if, bt_bdaddr_t* bda); - -/** - * Invoked in response to search_service when the GATT service search - * has been completed. - */ -typedef void (*search_complete_callback)(int conn_id, int status); - -/** Reports GATT services on a remote device */ -typedef void (*search_result_callback)( int conn_id, btgatt_srvc_id_t *srvc_id); - -/** GATT characteristic enumeration result callback */ -typedef void (*get_characteristic_callback)(int conn_id, int status, - btgatt_srvc_id_t *srvc_id, btgatt_char_id_t *char_id, - int char_prop); - -/** GATT descriptor enumeration result callback */ -typedef void (*get_descriptor_callback)(int conn_id, int status, - btgatt_srvc_id_t *srvc_id, btgatt_char_id_t *char_id, - bt_uuid_t *descr_id); - -/** GATT included service enumeration result callback */ -typedef void (*get_included_service_callback)(int conn_id, int status, - btgatt_srvc_id_t *srvc_id, btgatt_srvc_id_t *incl_srvc_id); - -/** Callback invoked in response to [de]register_for_notification */ -typedef void (*register_for_notification_callback)(int conn_id, - int registered, int status, btgatt_srvc_id_t *srvc_id, - btgatt_char_id_t *char_id); - -/** - * Remote device notification callback, invoked when a remote device sends - * a notification or indication that a client has registered for. - */ -typedef void (*notify_callback)(int conn_id, btgatt_notify_params_t *p_data); - -/** Reports result of a GATT read operation */ -typedef void (*read_characteristic_callback)(int conn_id, int status, - btgatt_read_params_t *p_data); - -/** GATT write characteristic operation callback */ -typedef void (*write_characteristic_callback)(int conn_id, int status, - btgatt_write_params_t *p_data); - -/** GATT execute prepared write callback */ -typedef void (*execute_write_callback)(int conn_id, int status); - -/** Callback invoked in response to read_descriptor */ -typedef void (*read_descriptor_callback)(int conn_id, int status, - btgatt_read_params_t *p_data); - -/** Callback invoked in response to write_descriptor */ -typedef void (*write_descriptor_callback)(int conn_id, int status, - btgatt_write_params_t *p_data); - -/** Callback triggered in response to read_remote_rssi */ -typedef void (*read_remote_rssi_callback)(int client_if, bt_bdaddr_t* bda, - int rssi, int status); - -typedef struct { - register_client_callback register_client_cb; - scan_result_callback scan_result_cb; - connect_callback open_cb; - disconnect_callback close_cb; - search_complete_callback search_complete_cb; - search_result_callback search_result_cb; - get_characteristic_callback get_characteristic_cb; - get_descriptor_callback get_descriptor_cb; - get_included_service_callback get_included_service_cb; - register_for_notification_callback register_for_notification_cb; - notify_callback notify_cb; - read_characteristic_callback read_characteristic_cb; - write_characteristic_callback write_characteristic_cb; - read_descriptor_callback read_descriptor_cb; - write_descriptor_callback write_descriptor_cb; - execute_write_callback execute_write_cb; - read_remote_rssi_callback read_remote_rssi_cb; -} btgatt_client_callbacks_t; - -/** Represents the standard BT-GATT client interface. */ - -typedef struct { - /** Registers a GATT client application with the stack */ - bt_status_t (*register_client)( bt_uuid_t *uuid ); - - /** Unregister a client application from the stack */ - bt_status_t (*unregister_client)(int client_if ); - - /** Start or stop LE device scanning */ - bt_status_t (*scan)( int client_if, bool start ); - - /** Create a connection to a remote LE or dual-mode device */ - bt_status_t (*connect)( int client_if, const bt_bdaddr_t *bd_addr, - bool is_direct ); - - /** Disconnect a remote device or cancel a pending connection */ - bt_status_t (*disconnect)( int client_if, const bt_bdaddr_t *bd_addr, - int conn_id); - - /** Clear the attribute cache for a given device */ - bt_status_t (*refresh)( int client_if, const bt_bdaddr_t *bd_addr ); - - /** - * Enumerate all GATT services on a connected device. - * Optionally, the results can be filtered for a given UUID. - */ - bt_status_t (*search_service)(int conn_id, bt_uuid_t *filter_uuid ); - - /** - * Enumerate included services for a given service. - * Set start_incl_srvc_id to NULL to get the first included service. - */ - bt_status_t (*get_included_service)( int conn_id, btgatt_srvc_id_t *srvc_id, - btgatt_srvc_id_t *start_incl_srvc_id); - - /** - * Enumerate characteristics for a given service. - * Set start_char_id to NULL to get the first characteristic. - */ - bt_status_t (*get_characteristic)( int conn_id, - btgatt_srvc_id_t *srvc_id, btgatt_char_id_t *start_char_id); - - /** - * Enumerate descriptors for a given characteristic. - * Set start_descr_id to NULL to get the first descriptor. - */ - bt_status_t (*get_descriptor)( int conn_id, - btgatt_srvc_id_t *srvc_id, btgatt_char_id_t *char_id, - bt_uuid_t *start_descr_id); - - /** Read a characteristic on a remote device */ - bt_status_t (*read_characteristic)( int conn_id, - btgatt_srvc_id_t *srvc_id, btgatt_char_id_t *char_id, - int auth_req ); - - /** Write a remote characteristic */ - bt_status_t (*write_characteristic)(int conn_id, - btgatt_srvc_id_t *srvc_id, btgatt_char_id_t *char_id, - int write_type, int len, int auth_req, - char* p_value); - - /** Read the descriptor for a given characteristic */ - bt_status_t (*read_descriptor)(int conn_id, - btgatt_srvc_id_t *srvc_id, btgatt_char_id_t *char_id, - bt_uuid_t *descr_id, int auth_req); - - /** Write a remote descriptor for a given characteristic */ - bt_status_t (*write_descriptor)( int conn_id, - btgatt_srvc_id_t *srvc_id, btgatt_char_id_t *char_id, - bt_uuid_t *descr_id, int write_type, int len, - int auth_req, char* p_value); - - /** Execute a prepared write operation */ - bt_status_t (*execute_write)(int conn_id, int execute); - - /** - * Register to receive notifications or indications for a given - * characteristic - */ - bt_status_t (*register_for_notification)( int client_if, - const bt_bdaddr_t *bd_addr, btgatt_srvc_id_t *srvc_id, - btgatt_char_id_t *char_id); - - /** Deregister a previous request for notifications/indications */ - bt_status_t (*deregister_for_notification)( int client_if, - const bt_bdaddr_t *bd_addr, btgatt_srvc_id_t *srvc_id, - btgatt_char_id_t *char_id); - - /** Request RSSI for a given remote device */ - bt_status_t (*read_remote_rssi)( int client_if, const bt_bdaddr_t *bd_addr); - - /** Determine the type of the remote device (LE, BR/EDR, Dual-mode) */ - int (*get_device_type)( const bt_bdaddr_t *bd_addr ); - - /** Test mode interface */ - bt_status_t (*test_command)( int command, btgatt_test_params_t* params); -} btgatt_client_interface_t; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_BT_GATT_CLIENT_H */ diff --git a/external/android/include/18/hardware/libhardware/include/hardware/bt_gatt_server.h b/external/android/include/18/hardware/libhardware/include/hardware/bt_gatt_server.h deleted file mode 100644 index 1a5a400..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/bt_gatt_server.h +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright (C) 2013 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_INCLUDE_BT_GATT_SERVER_H -#define ANDROID_INCLUDE_BT_GATT_SERVER_H - -#include - -#include "bt_gatt_types.h" - -__BEGIN_DECLS - -/** GATT value type used in response to remote read requests */ -typedef struct -{ - uint8_t value[BTGATT_MAX_ATTR_LEN]; - uint16_t handle; - uint16_t offset; - uint16_t len; - uint8_t auth_req; -} btgatt_value_t; - -/** GATT remote read request response type */ -typedef union -{ - btgatt_value_t attr_value; - uint16_t handle; -} btgatt_response_t; - -/** BT-GATT Server callback structure. */ - -/** Callback invoked in response to register_server */ -typedef void (*register_server_callback)(int status, int server_if, - bt_uuid_t *app_uuid); - -/** Callback indicating that a remote device has connected or been disconnected */ -typedef void (*connection_callback)(int conn_id, int server_if, int connected, - bt_bdaddr_t *bda); - -/** Callback invoked in response to create_service */ -typedef void (*service_added_callback)(int status, int server_if, - btgatt_srvc_id_t *srvc_id, int srvc_handle); - -/** Callback indicating that an included service has been added to a service */ -typedef void (*included_service_added_callback)(int status, int server_if, - int srvc_handle, int incl_srvc_handle); - -/** Callback invoked when a characteristic has been added to a service */ -typedef void (*characteristic_added_callback)(int status, int server_if, - bt_uuid_t *uuid, int srvc_handle, int char_handle); - -/** Callback invoked when a descriptor has been added to a characteristic */ -typedef void (*descriptor_added_callback)(int status, int server_if, - bt_uuid_t *uuid, int srvc_handle, int descr_handle); - -/** Callback invoked in response to start_service */ -typedef void (*service_started_callback)(int status, int server_if, - int srvc_handle); - -/** Callback invoked in response to stop_service */ -typedef void (*service_stopped_callback)(int status, int server_if, - int srvc_handle); - -/** Callback triggered when a service has been deleted */ -typedef void (*service_deleted_callback)(int status, int server_if, - int srvc_handle); - -/** - * Callback invoked when a remote device has requested to read a characteristic - * or descriptor. The application must respond by calling send_response - */ -typedef void (*request_read_callback)(int conn_id, int trans_id, bt_bdaddr_t *bda, - int attr_handle, int offset, bool is_long); - -/** - * Callback invoked when a remote device has requested to write to a - * characteristic or descriptor. - */ -typedef void (*request_write_callback)(int conn_id, int trans_id, bt_bdaddr_t *bda, - int attr_handle, int offset, int length, - bool need_rsp, bool is_prep, uint8_t* value); - -/** Callback invoked when a previously prepared write is to be executed */ -typedef void (*request_exec_write_callback)(int conn_id, int trans_id, - bt_bdaddr_t *bda, int exec_write); - -/** - * Callback triggered in response to send_response if the remote device - * sends a confirmation. - */ -typedef void (*response_confirmation_callback)(int status, int handle); - -typedef struct { - register_server_callback register_server_cb; - connection_callback connection_cb; - service_added_callback service_added_cb; - included_service_added_callback included_service_added_cb; - characteristic_added_callback characteristic_added_cb; - descriptor_added_callback descriptor_added_cb; - service_started_callback service_started_cb; - service_stopped_callback service_stopped_cb; - service_deleted_callback service_deleted_cb; - request_read_callback request_read_cb; - request_write_callback request_write_cb; - request_exec_write_callback request_exec_write_cb; - response_confirmation_callback response_confirmation_cb; -} btgatt_server_callbacks_t; - -/** Represents the standard BT-GATT server interface. */ -typedef struct { - /** Registers a GATT server application with the stack */ - bt_status_t (*register_server)( bt_uuid_t *uuid ); - - /** Unregister a server application from the stack */ - bt_status_t (*unregister_server)(int server_if ); - - /** Create a connection to a remote peripheral */ - bt_status_t (*connect)(int server_if, const bt_bdaddr_t *bd_addr, bool is_direct ); - - /** Disconnect an established connection or cancel a pending one */ - bt_status_t (*disconnect)(int server_if, const bt_bdaddr_t *bd_addr, - int conn_id ); - - /** Create a new service */ - bt_status_t (*add_service)( int server_if, btgatt_srvc_id_t *srvc_id, int num_handles); - - /** Assign an included service to it's parent service */ - bt_status_t (*add_included_service)( int server_if, int service_handle, int included_handle); - - /** Add a characteristic to a service */ - bt_status_t (*add_characteristic)( int server_if, - int service_handle, bt_uuid_t *uuid, - int properties, int permissions); - - /** Add a descriptor to a given service */ - bt_status_t (*add_descriptor)(int server_if, int service_handle, - bt_uuid_t *uuid, int permissions); - - /** Starts a local service */ - bt_status_t (*start_service)(int server_if, int service_handle, - int transport); - - /** Stops a local service */ - bt_status_t (*stop_service)(int server_if, int service_handle); - - /** Delete a local service */ - bt_status_t (*delete_service)(int server_if, int service_handle); - - /** Send value indication to a remote device */ - bt_status_t (*send_indication)(int server_if, int attribute_handle, - int conn_id, int len, int confirm, - char* p_value); - - /** Send a response to a read/write operation */ - bt_status_t (*send_response)(int conn_id, int trans_id, - int status, btgatt_response_t *response); -} btgatt_server_interface_t; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_BT_GATT_CLIENT_H */ diff --git a/external/android/include/18/hardware/libhardware/include/hardware/bt_gatt_types.h b/external/android/include/18/hardware/libhardware/include/hardware/bt_gatt_types.h deleted file mode 100644 index fee9bb5..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/bt_gatt_types.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2013 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_INCLUDE_BT_GATT_TYPES_H -#define ANDROID_INCLUDE_BT_GATT_TYPES_H - -#include -#include - -__BEGIN_DECLS - -/** - * GATT Service types - */ -#define BTGATT_SERVICE_TYPE_PRIMARY 0 -#define BTGATT_SERVICE_TYPE_SECONDARY 1 - -/** GATT Characteristic ID adding instance id tracking to the UUID */ -typedef struct -{ - bt_uuid_t uuid; - uint8_t inst_id; -} btgatt_char_id_t; - -/** GATT Service ID also identifies the service type (primary/secondary) */ -typedef struct -{ - btgatt_char_id_t id; - uint8_t is_primary; -} btgatt_srvc_id_t; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_BT_GATT_TYPES_H */ diff --git a/external/android/include/18/hardware/libhardware/include/hardware/bt_hf.h b/external/android/include/18/hardware/libhardware/include/hardware/bt_hf.h deleted file mode 100644 index 6135ac4..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/bt_hf.h +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Copyright (C) 2012 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_INCLUDE_BT_HF_H -#define ANDROID_INCLUDE_BT_HF_H - -__BEGIN_DECLS - -/* AT response code - OK/Error */ -typedef enum { - BTHF_AT_RESPONSE_ERROR = 0, - BTHF_AT_RESPONSE_OK -} bthf_at_response_t; - -typedef enum { - BTHF_CONNECTION_STATE_DISCONNECTED = 0, - BTHF_CONNECTION_STATE_CONNECTING, - BTHF_CONNECTION_STATE_CONNECTED, - BTHF_CONNECTION_STATE_SLC_CONNECTED, - BTHF_CONNECTION_STATE_DISCONNECTING -} bthf_connection_state_t; - -typedef enum { - BTHF_AUDIO_STATE_DISCONNECTED = 0, - BTHF_AUDIO_STATE_CONNECTING, - BTHF_AUDIO_STATE_CONNECTED, - BTHF_AUDIO_STATE_DISCONNECTING -} bthf_audio_state_t; - -typedef enum { - BTHF_VR_STATE_STOPPED = 0, - BTHF_VR_STATE_STARTED -} bthf_vr_state_t; - -typedef enum { - BTHF_VOLUME_TYPE_SPK = 0, - BTHF_VOLUME_TYPE_MIC -} bthf_volume_type_t; - -/* Noise Reduction and Echo Cancellation */ -typedef enum -{ - BTHF_NREC_STOP, - BTHF_NREC_START -} bthf_nrec_t; - -/* CHLD - Call held handling */ -typedef enum -{ - BTHF_CHLD_TYPE_RELEASEHELD, // Terminate all held or set UDUB("busy") to a waiting call - BTHF_CHLD_TYPE_RELEASEACTIVE_ACCEPTHELD, // Terminate all active calls and accepts a waiting/held call - BTHF_CHLD_TYPE_HOLDACTIVE_ACCEPTHELD, // Hold all active calls and accepts a waiting/held call - BTHF_CHLD_TYPE_ADDHELDTOCONF, // Add all held calls to a conference -} bthf_chld_type_t; - -/** Callback for connection state change. - * state will have one of the values from BtHfConnectionState - */ -typedef void (* bthf_connection_state_callback)(bthf_connection_state_t state, bt_bdaddr_t *bd_addr); - -/** Callback for audio connection state change. - * state will have one of the values from BtHfAudioState - */ -typedef void (* bthf_audio_state_callback)(bthf_audio_state_t state, bt_bdaddr_t *bd_addr); - -/** Callback for VR connection state change. - * state will have one of the values from BtHfVRState - */ -typedef void (* bthf_vr_cmd_callback)(bthf_vr_state_t state); - -/** Callback for answer incoming call (ATA) - */ -typedef void (* bthf_answer_call_cmd_callback)(); - -/** Callback for disconnect call (AT+CHUP) - */ -typedef void (* bthf_hangup_call_cmd_callback)(); - -/** Callback for disconnect call (AT+CHUP) - * type will denote Speaker/Mic gain (BtHfVolumeControl). - */ -typedef void (* bthf_volume_cmd_callback)(bthf_volume_type_t type, int volume); - -/** Callback for dialing an outgoing call - * If number is NULL, redial - */ -typedef void (* bthf_dial_call_cmd_callback)(char *number); - -/** Callback for sending DTMF tones - * tone contains the dtmf character to be sent - */ -typedef void (* bthf_dtmf_cmd_callback)(char tone); - -/** Callback for enabling/disabling noise reduction/echo cancellation - * value will be 1 to enable, 0 to disable - */ -typedef void (* bthf_nrec_cmd_callback)(bthf_nrec_t nrec); - -/** Callback for call hold handling (AT+CHLD) - * value will contain the call hold command (0, 1, 2, 3) - */ -typedef void (* bthf_chld_cmd_callback)(bthf_chld_type_t chld); - -/** Callback for CNUM (subscriber number) - */ -typedef void (* bthf_cnum_cmd_callback)(); - -/** Callback for indicators (CIND) - */ -typedef void (* bthf_cind_cmd_callback)(); - -/** Callback for operator selection (COPS) - */ -typedef void (* bthf_cops_cmd_callback)(); - -/** Callback for call list (AT+CLCC) - */ -typedef void (* bthf_clcc_cmd_callback) (); - -/** Callback for unknown AT command recd from HF - * at_string will contain the unparsed AT string - */ -typedef void (* bthf_unknown_at_cmd_callback)(char *at_string); - -/** Callback for keypressed (HSP) event. - */ -typedef void (* bthf_key_pressed_cmd_callback)(); - -/** BT-HF callback structure. */ -typedef struct { - /** set to sizeof(BtHfCallbacks) */ - size_t size; - bthf_connection_state_callback connection_state_cb; - bthf_audio_state_callback audio_state_cb; - bthf_vr_cmd_callback vr_cmd_cb; - bthf_answer_call_cmd_callback answer_call_cmd_cb; - bthf_hangup_call_cmd_callback hangup_call_cmd_cb; - bthf_volume_cmd_callback volume_cmd_cb; - bthf_dial_call_cmd_callback dial_call_cmd_cb; - bthf_dtmf_cmd_callback dtmf_cmd_cb; - bthf_nrec_cmd_callback nrec_cmd_cb; - bthf_chld_cmd_callback chld_cmd_cb; - bthf_cnum_cmd_callback cnum_cmd_cb; - bthf_cind_cmd_callback cind_cmd_cb; - bthf_cops_cmd_callback cops_cmd_cb; - bthf_clcc_cmd_callback clcc_cmd_cb; - bthf_unknown_at_cmd_callback unknown_at_cmd_cb; - bthf_key_pressed_cmd_callback key_pressed_cmd_cb; -} bthf_callbacks_t; - -/** Network Status */ -typedef enum -{ - BTHF_NETWORK_STATE_NOT_AVAILABLE = 0, - BTHF_NETWORK_STATE_AVAILABLE -} bthf_network_state_t; - -/** Service type */ -typedef enum -{ - BTHF_SERVICE_TYPE_HOME = 0, - BTHF_SERVICE_TYPE_ROAMING -} bthf_service_type_t; - -typedef enum { - BTHF_CALL_STATE_ACTIVE = 0, - BTHF_CALL_STATE_HELD, - BTHF_CALL_STATE_DIALING, - BTHF_CALL_STATE_ALERTING, - BTHF_CALL_STATE_INCOMING, - BTHF_CALL_STATE_WAITING, - BTHF_CALL_STATE_IDLE -} bthf_call_state_t; - -typedef enum { - BTHF_CALL_DIRECTION_OUTGOING = 0, - BTHF_CALL_DIRECTION_INCOMING -} bthf_call_direction_t; - -typedef enum { - BTHF_CALL_TYPE_VOICE = 0, - BTHF_CALL_TYPE_DATA, - BTHF_CALL_TYPE_FAX -} bthf_call_mode_t; - -typedef enum { - BTHF_CALL_MPTY_TYPE_SINGLE = 0, - BTHF_CALL_MPTY_TYPE_MULTI -} bthf_call_mpty_type_t; - -typedef enum { - BTHF_CALL_ADDRTYPE_UNKNOWN = 0x81, - BTHF_CALL_ADDRTYPE_INTERNATIONAL = 0x91 -} bthf_call_addrtype_t; -/** Represents the standard BT-HF interface. */ -typedef struct { - - /** set to sizeof(BtHfInterface) */ - size_t size; - /** - * Register the BtHf callbacks - */ - bt_status_t (*init)( bthf_callbacks_t* callbacks ); - - /** connect to headset */ - bt_status_t (*connect)( bt_bdaddr_t *bd_addr ); - - /** dis-connect from headset */ - bt_status_t (*disconnect)( bt_bdaddr_t *bd_addr ); - - /** create an audio connection */ - bt_status_t (*connect_audio)( bt_bdaddr_t *bd_addr ); - - /** close the audio connection */ - bt_status_t (*disconnect_audio)( bt_bdaddr_t *bd_addr ); - - /** start voice recognition */ - bt_status_t (*start_voice_recognition)(); - - /** stop voice recognition */ - bt_status_t (*stop_voice_recognition)(); - - /** volume control */ - bt_status_t (*volume_control) (bthf_volume_type_t type, int volume); - - /** Combined device status change notification */ - bt_status_t (*device_status_notification)(bthf_network_state_t ntk_state, bthf_service_type_t svc_type, int signal, - int batt_chg); - - /** Response for COPS command */ - bt_status_t (*cops_response)(const char *cops); - - /** Response for CIND command */ - bt_status_t (*cind_response)(int svc, int num_active, int num_held, bthf_call_state_t call_setup_state, - int signal, int roam, int batt_chg); - - /** Pre-formatted AT response, typically in response to unknown AT cmd */ - bt_status_t (*formatted_at_response)(const char *rsp); - - /** ok/error response - * ERROR (0) - * OK (1) - */ - bt_status_t (*at_response) (bthf_at_response_t response_code, int error_code); - - /** response for CLCC command - * Can be iteratively called for each call index - * Call index of 0 will be treated as NULL termination (Completes response) - */ - bt_status_t (*clcc_response) (int index, bthf_call_direction_t dir, - bthf_call_state_t state, bthf_call_mode_t mode, - bthf_call_mpty_type_t mpty, const char *number, - bthf_call_addrtype_t type); - - /** notify of a call state change - * Each update notifies - * 1. Number of active/held/ringing calls - * 2. call_state: This denotes the state change that triggered this msg - * This will take one of the values from BtHfCallState - * 3. number & type: valid only for incoming & waiting call - */ - bt_status_t (*phone_state_change) (int num_active, int num_held, bthf_call_state_t call_setup_state, - const char *number, bthf_call_addrtype_t type); - - /** Closes the interface. */ - void (*cleanup)( void ); -} bthf_interface_t; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_BT_HF_H */ diff --git a/external/android/include/18/hardware/libhardware/include/hardware/bt_hh.h b/external/android/include/18/hardware/libhardware/include/hardware/bt_hh.h deleted file mode 100644 index 09f547b..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/bt_hh.h +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright (C) 2012 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_INCLUDE_BT_HH_H -#define ANDROID_INCLUDE_BT_HH_H - -#include - -__BEGIN_DECLS - -#define BTHH_MAX_DSC_LEN 884 - -/* HH connection states */ -typedef enum -{ - BTHH_CONN_STATE_CONNECTED = 0, - BTHH_CONN_STATE_CONNECTING, - BTHH_CONN_STATE_DISCONNECTED, - BTHH_CONN_STATE_DISCONNECTING, - BTHH_CONN_STATE_FAILED_MOUSE_FROM_HOST, - BTHH_CONN_STATE_FAILED_KBD_FROM_HOST, - BTHH_CONN_STATE_FAILED_TOO_MANY_DEVICES, - BTHH_CONN_STATE_FAILED_NO_BTHID_DRIVER, - BTHH_CONN_STATE_FAILED_GENERIC, - BTHH_CONN_STATE_UNKNOWN -} bthh_connection_state_t; - -typedef enum -{ - BTHH_OK = 0, - BTHH_HS_HID_NOT_READY, /* handshake error : device not ready */ - BTHH_HS_INVALID_RPT_ID, /* handshake error : invalid report ID */ - BTHH_HS_TRANS_NOT_SPT, /* handshake error : transaction not spt */ - BTHH_HS_INVALID_PARAM, /* handshake error : invalid paremter */ - BTHH_HS_ERROR, /* handshake error : unspecified HS error */ - BTHH_ERR, /* general BTA HH error */ - BTHH_ERR_SDP, /* SDP error */ - BTHH_ERR_PROTO, /* SET_Protocol error, - only used in BTA_HH_OPEN_EVT callback */ - BTHH_ERR_DB_FULL, /* device database full error, used */ - BTHH_ERR_TOD_UNSPT, /* type of device not supported */ - BTHH_ERR_NO_RES, /* out of system resources */ - BTHH_ERR_AUTH_FAILED, /* authentication fail */ - BTHH_ERR_HDL -}bthh_status_t; - -/* Protocol modes */ -typedef enum { - BTHH_REPORT_MODE = 0x00, - BTHH_BOOT_MODE = 0x01, - BTHH_UNSUPPORTED_MODE = 0xff -}bthh_protocol_mode_t; - -/* Report types */ -typedef enum { - BTHH_INPUT_REPORT = 1, - BTHH_OUTPUT_REPORT, - BTHH_FEATURE_REPORT -}bthh_report_type_t; - -typedef struct -{ - int attr_mask; - uint8_t sub_class; - uint8_t app_id; - int vendor_id; - int product_id; - int version; - uint8_t ctry_code; - int dl_len; - uint8_t dsc_list[BTHH_MAX_DSC_LEN]; -} bthh_hid_info_t; - -/** Callback for connection state change. - * state will have one of the values from bthh_connection_state_t - */ -typedef void (* bthh_connection_state_callback)(bt_bdaddr_t *bd_addr, bthh_connection_state_t state); - -/** Callback for vitual unplug api. - * the status of the vitual unplug - */ -typedef void (* bthh_virtual_unplug_callback)(bt_bdaddr_t *bd_addr, bthh_status_t hh_status); - -/** Callback for get hid info - * hid_info will contain attr_mask, sub_class, app_id, vendor_id, product_id, version, ctry_code, len - */ -typedef void (* bthh_hid_info_callback)(bt_bdaddr_t *bd_addr, bthh_hid_info_t hid_info); - -/** Callback for get/set protocal api. - * the protocol mode is one of the value from bthh_protocol_mode_t - */ -typedef void (* bthh_protocol_mode_callback)(bt_bdaddr_t *bd_addr, bthh_status_t hh_status,bthh_protocol_mode_t mode); - -/** Callback for get/set_idle_time api. - */ -typedef void (* bthh_idle_time_callback)(bt_bdaddr_t *bd_addr, bthh_status_t hh_status, int idle_rate); - - -/** Callback for get report api. - * if staus is ok rpt_data contains the report data - */ -typedef void (* bthh_get_report_callback)(bt_bdaddr_t *bd_addr, bthh_status_t hh_status, uint8_t* rpt_data, int rpt_size); - - -/** BT-HH callback structure. */ -typedef struct { - /** set to sizeof(BtHfCallbacks) */ - size_t size; - bthh_connection_state_callback connection_state_cb; - bthh_hid_info_callback hid_info_cb; - bthh_protocol_mode_callback protocol_mode_cb; - bthh_idle_time_callback idle_time_cb; - bthh_get_report_callback get_report_cb; - bthh_virtual_unplug_callback virtual_unplug_cb; - -} bthh_callbacks_t; - - - -/** Represents the standard BT-HH interface. */ -typedef struct { - - /** set to sizeof(BtHhInterface) */ - size_t size; - - /** - * Register the BtHh callbacks - */ - bt_status_t (*init)( bthh_callbacks_t* callbacks ); - - /** connect to hid device */ - bt_status_t (*connect)( bt_bdaddr_t *bd_addr); - - /** dis-connect from hid device */ - bt_status_t (*disconnect)( bt_bdaddr_t *bd_addr ); - - /** Virtual UnPlug (VUP) the specified HID device */ - bt_status_t (*virtual_unplug)(bt_bdaddr_t *bd_addr); - - /** Set the HID device descriptor for the specified HID device. */ - bt_status_t (*set_info)(bt_bdaddr_t *bd_addr, bthh_hid_info_t hid_info ); - - /** Get the HID proto mode. */ - bt_status_t (*get_protocol) (bt_bdaddr_t *bd_addr, bthh_protocol_mode_t protocolMode); - - /** Set the HID proto mode. */ - bt_status_t (*set_protocol)(bt_bdaddr_t *bd_addr, bthh_protocol_mode_t protocolMode); - - /** Send a GET_REPORT to HID device. */ - bt_status_t (*get_report)(bt_bdaddr_t *bd_addr, bthh_report_type_t reportType, uint8_t reportId, int bufferSize); - - /** Send a SET_REPORT to HID device. */ - bt_status_t (*set_report)(bt_bdaddr_t *bd_addr, bthh_report_type_t reportType, char* report); - - /** Send data to HID device. */ - bt_status_t (*send_data)(bt_bdaddr_t *bd_addr, char* data); - - /** Closes the interface. */ - void (*cleanup)( void ); - -} bthh_interface_t; -__END_DECLS - -#endif /* ANDROID_INCLUDE_BT_HH_H */ - - diff --git a/external/android/include/18/hardware/libhardware/include/hardware/bt_hl.h b/external/android/include/18/hardware/libhardware/include/hardware/bt_hl.h deleted file mode 100644 index bd29e3a..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/bt_hl.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (C) 2012 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_INCLUDE_BT_HL_H -#define ANDROID_INCLUDE_BT_HL_H - -__BEGIN_DECLS - -/* HL connection states */ - -typedef enum -{ - BTHL_MDEP_ROLE_SOURCE, - BTHL_MDEP_ROLE_SINK -} bthl_mdep_role_t; - -typedef enum { - BTHL_APP_REG_STATE_REG_SUCCESS, - BTHL_APP_REG_STATE_REG_FAILED, - BTHL_APP_REG_STATE_DEREG_SUCCESS, - BTHL_APP_REG_STATE_DEREG_FAILED -} bthl_app_reg_state_t; - -typedef enum -{ - BTHL_CHANNEL_TYPE_RELIABLE, - BTHL_CHANNEL_TYPE_STREAMING, - BTHL_CHANNEL_TYPE_ANY -} bthl_channel_type_t; - - -/* HL connection states */ -typedef enum { - BTHL_CONN_STATE_CONNECTING, - BTHL_CONN_STATE_CONNECTED, - BTHL_CONN_STATE_DISCONNECTING, - BTHL_CONN_STATE_DISCONNECTED, - BTHL_CONN_STATE_DESTROYED -} bthl_channel_state_t; - -typedef struct -{ - bthl_mdep_role_t mdep_role; - int data_type; - bthl_channel_type_t channel_type; - const char *mdep_description; /* MDEP description to be used in the SDP (optional); null terminated */ -} bthl_mdep_cfg_t; - -typedef struct -{ - const char *application_name; - const char *provider_name; /* provider name to be used in the SDP (optional); null terminated */ - const char *srv_name; /* service name to be used in the SDP (optional); null terminated*/ - const char *srv_desp; /* service description to be used in the SDP (optional); null terminated */ - int number_of_mdeps; - bthl_mdep_cfg_t *mdep_cfg; /* Dynamic array */ -} bthl_reg_param_t; - -/** Callback for application registration status. - * state will have one of the values from bthl_app_reg_state_t - */ -typedef void (* bthl_app_reg_state_callback)(int app_id, bthl_app_reg_state_t state); - -/** Callback for channel connection state change. - * state will have one of the values from - * bthl_connection_state_t and fd (file descriptor) - */ -typedef void (* bthl_channel_state_callback)(int app_id, bt_bdaddr_t *bd_addr, int mdep_cfg_index, int channel_id, bthl_channel_state_t state, int fd); - -/** BT-HL callback structure. */ -typedef struct { - /** set to sizeof(bthl_callbacks_t) */ - size_t size; - bthl_app_reg_state_callback app_reg_state_cb; - bthl_channel_state_callback channel_state_cb; -} bthl_callbacks_t; - - -/** Represents the standard BT-HL interface. */ -typedef struct { - - /** set to sizeof(bthl_interface_t) */ - size_t size; - - /** - * Register the Bthl callbacks - */ - bt_status_t (*init)( bthl_callbacks_t* callbacks ); - - /** Register HL application */ - bt_status_t (*register_application) ( bthl_reg_param_t *p_reg_param, int *app_id); - - /** Unregister HL application */ - bt_status_t (*unregister_application) (int app_id); - - /** connect channel */ - bt_status_t (*connect_channel)(int app_id, bt_bdaddr_t *bd_addr, int mdep_cfg_index, int *channel_id); - - /** destroy channel */ - bt_status_t (*destroy_channel)(int channel_id); - - /** Close the Bthl callback **/ - void (*cleanup)(void); - -} bthl_interface_t; -__END_DECLS - -#endif /* ANDROID_INCLUDE_BT_HL_H */ - - diff --git a/external/android/include/18/hardware/libhardware/include/hardware/bt_pan.h b/external/android/include/18/hardware/libhardware/include/hardware/bt_pan.h deleted file mode 100644 index c8b36b4..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/bt_pan.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (C) 2012 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_INCLUDE_BT_PAN_H -#define ANDROID_INCLUDE_BT_PAN_H - -__BEGIN_DECLS - -#define BTPAN_ROLE_NONE 0 -#define BTPAN_ROLE_PANNAP 1 -#define BTPAN_ROLE_PANU 2 - -typedef enum { - BTPAN_STATE_CONNECTED = 0, - BTPAN_STATE_CONNECTING = 1, - BTPAN_STATE_DISCONNECTED = 2, - BTPAN_STATE_DISCONNECTING = 3 -} btpan_connection_state_t; - -typedef enum { - BTPAN_STATE_ENABLED = 0, - BTPAN_STATE_DISABLED = 1 -} btpan_control_state_t; - -/** -* Callback for pan connection state -*/ -typedef void (*btpan_connection_state_callback)(btpan_connection_state_t state, bt_status_t error, - const bt_bdaddr_t *bd_addr, int local_role, int remote_role); -typedef void (*btpan_control_state_callback)(btpan_control_state_t state, bt_status_t error, - int local_role, const char* ifname); - -typedef struct { - size_t size; - btpan_control_state_callback control_state_cb; - btpan_connection_state_callback connection_state_cb; -} btpan_callbacks_t; -typedef struct { - /** set to size of this struct*/ - size_t size; - /** - * Initialize the pan interface and register the btpan callbacks - */ - bt_status_t (*init)(const btpan_callbacks_t* callbacks); - /* - * enable the pan service by specified role. The result state of - * enabl will be returned by btpan_control_state_callback. when pan-nap is enabled, - * the state of connecting panu device will be notified by btpan_connection_state_callback - */ - bt_status_t (*enable)(int local_role); - /* - * get current pan local role - */ - int (*get_local_role)(void); - /** - * start bluetooth pan connection to the remote device by specified pan role. The result state will be - * returned by btpan_connection_state_callback - */ - bt_status_t (*connect)(const bt_bdaddr_t *bd_addr, int local_role, int remote_role); - /** - * stop bluetooth pan connection. The result state will be returned by btpan_connection_state_callback - */ - bt_status_t (*disconnect)(const bt_bdaddr_t *bd_addr); - - /** - * Cleanup the pan interface - */ - void (*cleanup)(void); - -} btpan_interface_t; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_BT_PAN_H */ diff --git a/external/android/include/18/hardware/libhardware/include/hardware/bt_rc.h b/external/android/include/18/hardware/libhardware/include/hardware/bt_rc.h deleted file mode 100755 index 952652e..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/bt_rc.h +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (C) 2012 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_INCLUDE_BT_RC_H -#define ANDROID_INCLUDE_BT_RC_H - -__BEGIN_DECLS - -/* Macros */ -#define BTRC_MAX_ATTR_STR_LEN 255 -#define BTRC_UID_SIZE 8 -#define BTRC_MAX_APP_SETTINGS 8 -#define BTRC_MAX_FOLDER_DEPTH 4 -#define BTRC_MAX_APP_ATTR_SIZE 16 -#define BTRC_MAX_ELEM_ATTR_SIZE 7 - -typedef uint8_t btrc_uid_t[BTRC_UID_SIZE]; - -typedef enum { - BTRC_PLAYSTATE_STOPPED = 0x00, /* Stopped */ - BTRC_PLAYSTATE_PLAYING = 0x01, /* Playing */ - BTRC_PLAYSTATE_PAUSED = 0x02, /* Paused */ - BTRC_PLAYSTATE_FWD_SEEK = 0x03, /* Fwd Seek*/ - BTRC_PLAYSTATE_REV_SEEK = 0x04, /* Rev Seek*/ - BTRC_PLAYSTATE_ERROR = 0xFF, /* Error */ -} btrc_play_status_t; - -typedef enum { - BTRC_EVT_PLAY_STATUS_CHANGED = 0x01, - BTRC_EVT_TRACK_CHANGE = 0x02, - BTRC_EVT_TRACK_REACHED_END = 0x03, - BTRC_EVT_TRACK_REACHED_START = 0x04, - BTRC_EVT_PLAY_POS_CHANGED = 0x05, - BTRC_EVT_APP_SETTINGS_CHANGED = 0x08, -} btrc_event_id_t; - -typedef enum { - BTRC_NOTIFICATION_TYPE_INTERIM = 0, - BTRC_NOTIFICATION_TYPE_CHANGED = 1, -} btrc_notification_type_t; - -typedef enum { - BTRC_PLAYER_ATTR_EQUALIZER = 0x01, - BTRC_PLAYER_ATTR_REPEAT = 0x02, - BTRC_PLAYER_ATTR_SHUFFLE = 0x03, - BTRC_PLAYER_ATTR_SCAN = 0x04, -} btrc_player_attr_t; - -typedef enum { - BTRC_MEDIA_ATTR_TITLE = 0x01, - BTRC_MEDIA_ATTR_ARTIST = 0x02, - BTRC_MEDIA_ATTR_ALBUM = 0x03, - BTRC_MEDIA_ATTR_TRACK_NUM = 0x04, - BTRC_MEDIA_ATTR_NUM_TRACKS = 0x05, - BTRC_MEDIA_ATTR_GENRE = 0x06, - BTRC_MEDIA_ATTR_PLAYING_TIME = 0x07, -} btrc_media_attr_t; - -typedef enum { - BTRC_PLAYER_VAL_OFF_REPEAT = 0x01, - BTRC_PLAYER_VAL_SINGLE_REPEAT = 0x02, - BTRC_PLAYER_VAL_ALL_REPEAT = 0x03, - BTRC_PLAYER_VAL_GROUP_REPEAT = 0x04 -} btrc_player_repeat_val_t; - -typedef enum { - BTRC_PLAYER_VAL_OFF_SHUFFLE = 0x01, - BTRC_PLAYER_VAL_ALL_SHUFFLE = 0x02, - BTRC_PLAYER_VAL_GROUP_SHUFFLE = 0x03 -} btrc_player_shuffle_val_t; - -typedef enum { - BTRC_STS_BAD_CMD = 0x00, /* Invalid command */ - BTRC_STS_BAD_PARAM = 0x01, /* Invalid parameter */ - BTRC_STS_NOT_FOUND = 0x02, /* Specified parameter is wrong or not found */ - BTRC_STS_INTERNAL_ERR = 0x03, /* Internal Error */ - BTRC_STS_NO_ERROR = 0x04 /* Operation Success */ -} btrc_status_t; - -typedef struct { - uint8_t num_attr; - uint8_t attr_ids[BTRC_MAX_APP_SETTINGS]; - uint8_t attr_values[BTRC_MAX_APP_SETTINGS]; -} btrc_player_settings_t; - -typedef union -{ - btrc_play_status_t play_status; - btrc_uid_t track; /* queue position in NowPlaying */ - uint32_t song_pos; - btrc_player_settings_t player_setting; -} btrc_register_notification_t; - -typedef struct { - uint8_t id; /* can be attr_id or value_id */ - uint8_t text[BTRC_MAX_ATTR_STR_LEN]; -} btrc_player_setting_text_t; - -typedef struct { - uint32_t attr_id; - uint8_t text[BTRC_MAX_ATTR_STR_LEN]; -} btrc_element_attr_val_t; - -/** Callback for play status request */ -typedef void (* btrc_get_play_status_callback)(); - -/** Callback for list player application attributes (Shuffle, Repeat,...) */ -typedef void (* btrc_list_player_app_attr_callback)(); - -/** Callback for list player application attributes (Shuffle, Repeat,...) */ -typedef void (* btrc_list_player_app_values_callback)(btrc_player_attr_t attr_id); - -/** Callback for getting the current player application settings value -** num_attr: specifies the number of attribute ids contained in p_attrs -*/ -typedef void (* btrc_get_player_app_value_callback) (uint8_t num_attr, btrc_player_attr_t *p_attrs); - -/** Callback for getting the player application settings attributes' text -** num_attr: specifies the number of attribute ids contained in p_attrs -*/ -typedef void (* btrc_get_player_app_attrs_text_callback) (uint8_t num_attr, btrc_player_attr_t *p_attrs); - -/** Callback for getting the player application settings values' text -** num_attr: specifies the number of value ids contained in p_vals -*/ -typedef void (* btrc_get_player_app_values_text_callback) (uint8_t attr_id, uint8_t num_val, uint8_t *p_vals); - -/** Callback for setting the player application settings values */ -typedef void (* btrc_set_player_app_value_callback) (btrc_player_settings_t *p_vals); - -/** Callback to fetch the get element attributes of the current song -** num_attr: specifies the number of attributes requested in p_attrs -*/ -typedef void (* btrc_get_element_attr_callback) (uint8_t num_attr, btrc_media_attr_t *p_attrs); - -/** Callback for register notification (Play state change/track change/...) -** param: Is only valid if event_id is BTRC_EVT_PLAY_POS_CHANGED -*/ -typedef void (* btrc_register_notification_callback) (btrc_event_id_t event_id, uint32_t param); - -/** BT-RC callback structure. */ -typedef struct { - /** set to sizeof(BtRcCallbacks) */ - size_t size; - btrc_get_play_status_callback get_play_status_cb; - btrc_list_player_app_attr_callback list_player_app_attr_cb; - btrc_list_player_app_values_callback list_player_app_values_cb; - btrc_get_player_app_value_callback get_player_app_value_cb; - btrc_get_player_app_attrs_text_callback get_player_app_attrs_text_cb; - btrc_get_player_app_values_text_callback get_player_app_values_text_cb; - btrc_set_player_app_value_callback set_player_app_value_cb; - btrc_get_element_attr_callback get_element_attr_cb; - btrc_register_notification_callback register_notification_cb; -} btrc_callbacks_t; - -/** Represents the standard BT-RC interface. */ -typedef struct { - - /** set to sizeof(BtRcInterface) */ - size_t size; - /** - * Register the BtRc callbacks - */ - bt_status_t (*init)( btrc_callbacks_t* callbacks ); - - /** Respose to GetPlayStatus request. Contains the current - ** 1. Play status - ** 2. Song duration/length - ** 3. Song position - */ - bt_status_t (*get_play_status_rsp)( btrc_play_status_t play_status, uint32_t song_len, uint32_t song_pos); - - /** Lists the support player application attributes (Shuffle/Repeat/...) - ** num_attr: Specifies the number of attributes contained in the pointer p_attrs - */ - bt_status_t (*list_player_app_attr_rsp)( int num_attr, btrc_player_attr_t *p_attrs); - - /** Lists the support player application attributes (Shuffle Off/On/Group) - ** num_val: Specifies the number of values contained in the pointer p_vals - */ - bt_status_t (*list_player_app_value_rsp)( int num_val, uint8_t *p_vals); - - /** Returns the current application attribute values for each of the specified attr_id */ - bt_status_t (*get_player_app_value_rsp)( btrc_player_settings_t *p_vals); - - /** Returns the application attributes text ("Shuffle"/"Repeat"/...) - ** num_attr: Specifies the number of attributes' text contained in the pointer p_attrs - */ - bt_status_t (*get_player_app_attr_text_rsp)( int num_attr, btrc_player_setting_text_t *p_attrs); - - /** Returns the application attributes text ("Shuffle"/"Repeat"/...) - ** num_attr: Specifies the number of attribute values' text contained in the pointer p_vals - */ - bt_status_t (*get_player_app_value_text_rsp)( int num_val, btrc_player_setting_text_t *p_vals); - - /** Returns the current songs' element attributes text ("Title"/"Album"/"Artist") - ** num_attr: Specifies the number of attributes' text contained in the pointer p_attrs - */ - bt_status_t (*get_element_attr_rsp)( uint8_t num_attr, btrc_element_attr_val_t *p_attrs); - - /** Response to set player attribute request ("Shuffle"/"Repeat") - ** rsp_status: Status of setting the player attributes for the current media player - */ - bt_status_t (*set_player_app_value_rsp)(btrc_status_t rsp_status); - - /* Response to the register notification request (Play state change/track change/...). - ** event_id: Refers to the event_id this notification change corresponds too - ** type: Response type - interim/changed - ** p_params: Based on the event_id, this parameter should be populated - */ - bt_status_t (*register_notification_rsp)(btrc_event_id_t event_id, - btrc_notification_type_t type, - btrc_register_notification_t *p_param); - - /** Closes the interface. */ - void (*cleanup)( void ); -} btrc_interface_t; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_BT_RC_H */ diff --git a/external/android/include/18/hardware/libhardware/include/hardware/bt_sock.h b/external/android/include/18/hardware/libhardware/include/hardware/bt_sock.h deleted file mode 100644 index a4aa046..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/bt_sock.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2012 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_INCLUDE_BT_SOCK_H -#define ANDROID_INCLUDE_BT_SOCK_H - -__BEGIN_DECLS - -#define BTSOCK_FLAG_ENCRYPT 1 -#define BTSOCK_FLAG_AUTH (1 << 1) - -typedef enum { - BTSOCK_RFCOMM = 1, - BTSOCK_SCO = 2, - BTSOCK_L2CAP = 3 -} btsock_type_t; - -/** Represents the standard BT SOCKET interface. */ -typedef struct { - short size; - bt_bdaddr_t bd_addr; - int channel; - int status; -} __attribute__((packed)) sock_connect_signal_t; - -typedef struct { - - /** set to size of this struct*/ - size_t size; - /** - * listen to a rfcomm uuid or channel. It returns the socket fd from which - * btsock_connect_signal can be read out when a remote device connected - */ - bt_status_t (*listen)(btsock_type_t type, const char* service_name, const uint8_t* service_uuid, int channel, int* sock_fd, int flags); - /* - * connect to a rfcomm uuid channel of remote device, It returns the socket fd from which - * the btsock_connect_signal and a new socket fd to be accepted can be read out when connected - */ - bt_status_t (*connect)(const bt_bdaddr_t *bd_addr, btsock_type_t type, const uint8_t* uuid, int channel, int* sock_fd, int flags); - -} btsock_interface_t; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_BT_SOCK_H */ diff --git a/external/android/include/18/hardware/libhardware/include/hardware/camera.h b/external/android/include/18/hardware/libhardware/include/hardware/camera.h deleted file mode 100644 index b7182f8..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/camera.h +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Copyright (C) 2010-2011 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_INCLUDE_CAMERA_H -#define ANDROID_INCLUDE_CAMERA_H - -#include "camera_common.h" - -/** - * Camera device HAL, initial version [ CAMERA_DEVICE_API_VERSION_1_0 ] - * - * Supports the android.hardware.Camera API. - * - * Camera devices that support this version of the HAL must return a value in - * the range HARDWARE_DEVICE_API_VERSION(0,0)-(1,FF) in - * camera_device_t.common.version. CAMERA_DEVICE_API_VERSION_1_0 is the - * recommended value. - * - * Camera modules that implement version 2.0 or higher of camera_module_t must - * also return the value of camera_device_t.common.version in - * camera_info_t.device_version. - * - * See camera_common.h for more details. - */ - -__BEGIN_DECLS - -struct camera_memory; -typedef void (*camera_release_memory)(struct camera_memory *mem); - -typedef struct camera_memory { - void *data; - size_t size; - void *handle; - camera_release_memory release; -} camera_memory_t; - -typedef camera_memory_t* (*camera_request_memory)(int fd, size_t buf_size, unsigned int num_bufs, - void *user); - -typedef void (*camera_notify_callback)(int32_t msg_type, - int32_t ext1, - int32_t ext2, - void *user); - -typedef void (*camera_data_callback)(int32_t msg_type, - const camera_memory_t *data, unsigned int index, - camera_frame_metadata_t *metadata, void *user); - -typedef void (*camera_data_timestamp_callback)(int64_t timestamp, - int32_t msg_type, - const camera_memory_t *data, unsigned int index, - void *user); - -#define HAL_CAMERA_PREVIEW_WINDOW_TAG 0xcafed00d - -typedef struct preview_stream_ops { - int (*dequeue_buffer)(struct preview_stream_ops* w, - buffer_handle_t** buffer, int *stride); - int (*enqueue_buffer)(struct preview_stream_ops* w, - buffer_handle_t* buffer); - int (*cancel_buffer)(struct preview_stream_ops* w, - buffer_handle_t* buffer); - int (*set_buffer_count)(struct preview_stream_ops* w, int count); - int (*set_buffers_geometry)(struct preview_stream_ops* pw, - int w, int h, int format); - int (*set_crop)(struct preview_stream_ops *w, - int left, int top, int right, int bottom); - int (*set_usage)(struct preview_stream_ops* w, int usage); - int (*set_swap_interval)(struct preview_stream_ops *w, int interval); - int (*get_min_undequeued_buffer_count)(const struct preview_stream_ops *w, - int *count); - int (*lock_buffer)(struct preview_stream_ops* w, - buffer_handle_t* buffer); - // Timestamps are measured in nanoseconds, and must be comparable - // and monotonically increasing between two frames in the same - // preview stream. They do not need to be comparable between - // consecutive or parallel preview streams, cameras, or app runs. - int (*set_timestamp)(struct preview_stream_ops *w, int64_t timestamp); -} preview_stream_ops_t; - -struct camera_device; -typedef struct camera_device_ops { - /** Set the ANativeWindow to which preview frames are sent */ - int (*set_preview_window)(struct camera_device *, - struct preview_stream_ops *window); - - /** Set the notification and data callbacks */ - void (*set_callbacks)(struct camera_device *, - camera_notify_callback notify_cb, - camera_data_callback data_cb, - camera_data_timestamp_callback data_cb_timestamp, - camera_request_memory get_memory, - void *user); - - /** - * The following three functions all take a msg_type, which is a bitmask of - * the messages defined in include/ui/Camera.h - */ - - /** - * Enable a message, or set of messages. - */ - void (*enable_msg_type)(struct camera_device *, int32_t msg_type); - - /** - * Disable a message, or a set of messages. - * - * Once received a call to disableMsgType(CAMERA_MSG_VIDEO_FRAME), camera - * HAL should not rely on its client to call releaseRecordingFrame() to - * release video recording frames sent out by the cameral HAL before and - * after the disableMsgType(CAMERA_MSG_VIDEO_FRAME) call. Camera HAL - * clients must not modify/access any video recording frame after calling - * disableMsgType(CAMERA_MSG_VIDEO_FRAME). - */ - void (*disable_msg_type)(struct camera_device *, int32_t msg_type); - - /** - * Query whether a message, or a set of messages, is enabled. Note that - * this is operates as an AND, if any of the messages queried are off, this - * will return false. - */ - int (*msg_type_enabled)(struct camera_device *, int32_t msg_type); - - /** - * Start preview mode. - */ - int (*start_preview)(struct camera_device *); - - /** - * Stop a previously started preview. - */ - void (*stop_preview)(struct camera_device *); - - /** - * Returns true if preview is enabled. - */ - int (*preview_enabled)(struct camera_device *); - - /** - * Request the camera HAL to store meta data or real YUV data in the video - * buffers sent out via CAMERA_MSG_VIDEO_FRAME for a recording session. If - * it is not called, the default camera HAL behavior is to store real YUV - * data in the video buffers. - * - * This method should be called before startRecording() in order to be - * effective. - * - * If meta data is stored in the video buffers, it is up to the receiver of - * the video buffers to interpret the contents and to find the actual frame - * data with the help of the meta data in the buffer. How this is done is - * outside of the scope of this method. - * - * Some camera HALs may not support storing meta data in the video buffers, - * but all camera HALs should support storing real YUV data in the video - * buffers. If the camera HAL does not support storing the meta data in the - * video buffers when it is requested to do do, INVALID_OPERATION must be - * returned. It is very useful for the camera HAL to pass meta data rather - * than the actual frame data directly to the video encoder, since the - * amount of the uncompressed frame data can be very large if video size is - * large. - * - * @param enable if true to instruct the camera HAL to store - * meta data in the video buffers; false to instruct - * the camera HAL to store real YUV data in the video - * buffers. - * - * @return OK on success. - */ - int (*store_meta_data_in_buffers)(struct camera_device *, int enable); - - /** - * Start record mode. When a record image is available, a - * CAMERA_MSG_VIDEO_FRAME message is sent with the corresponding - * frame. Every record frame must be released by a camera HAL client via - * releaseRecordingFrame() before the client calls - * disableMsgType(CAMERA_MSG_VIDEO_FRAME). After the client calls - * disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is the camera HAL's - * responsibility to manage the life-cycle of the video recording frames, - * and the client must not modify/access any video recording frames. - */ - int (*start_recording)(struct camera_device *); - - /** - * Stop a previously started recording. - */ - void (*stop_recording)(struct camera_device *); - - /** - * Returns true if recording is enabled. - */ - int (*recording_enabled)(struct camera_device *); - - /** - * Release a record frame previously returned by CAMERA_MSG_VIDEO_FRAME. - * - * It is camera HAL client's responsibility to release video recording - * frames sent out by the camera HAL before the camera HAL receives a call - * to disableMsgType(CAMERA_MSG_VIDEO_FRAME). After it receives the call to - * disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is the camera HAL's - * responsibility to manage the life-cycle of the video recording frames. - */ - void (*release_recording_frame)(struct camera_device *, - const void *opaque); - - /** - * Start auto focus, the notification callback routine is called with - * CAMERA_MSG_FOCUS once when focusing is complete. autoFocus() will be - * called again if another auto focus is needed. - */ - int (*auto_focus)(struct camera_device *); - - /** - * Cancels auto-focus function. If the auto-focus is still in progress, - * this function will cancel it. Whether the auto-focus is in progress or - * not, this function will return the focus position to the default. If - * the camera does not support auto-focus, this is a no-op. - */ - int (*cancel_auto_focus)(struct camera_device *); - - /** - * Take a picture. - */ - int (*take_picture)(struct camera_device *); - - /** - * Cancel a picture that was started with takePicture. Calling this method - * when no picture is being taken is a no-op. - */ - int (*cancel_picture)(struct camera_device *); - - /** - * Set the camera parameters. This returns BAD_VALUE if any parameter is - * invalid or not supported. - */ - int (*set_parameters)(struct camera_device *, const char *parms); - - /** Retrieve the camera parameters. The buffer returned by the camera HAL - must be returned back to it with put_parameters, if put_parameters - is not NULL. - */ - char *(*get_parameters)(struct camera_device *); - - /** The camera HAL uses its own memory to pass us the parameters when we - call get_parameters. Use this function to return the memory back to - the camera HAL, if put_parameters is not NULL. If put_parameters - is NULL, then you have to use free() to release the memory. - */ - void (*put_parameters)(struct camera_device *, char *); - - /** - * Send command to camera driver. - */ - int (*send_command)(struct camera_device *, - int32_t cmd, int32_t arg1, int32_t arg2); - - /** - * Release the hardware resources owned by this object. Note that this is - * *not* done in the destructor. - */ - void (*release)(struct camera_device *); - - /** - * Dump state of the camera hardware - */ - int (*dump)(struct camera_device *, int fd); -} camera_device_ops_t; - -typedef struct camera_device { - /** - * camera_device.common.version must be in the range - * HARDWARE_DEVICE_API_VERSION(0,0)-(1,FF). CAMERA_DEVICE_API_VERSION_1_0 is - * recommended. - */ - hw_device_t common; - camera_device_ops_t *ops; - void *priv; -} camera_device_t; - -__END_DECLS - -#endif /* #ifdef ANDROID_INCLUDE_CAMERA_H */ diff --git a/external/android/include/18/hardware/libhardware/include/hardware/camera2.h b/external/android/include/18/hardware/libhardware/include/hardware/camera2.h deleted file mode 100644 index 5b182a8..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/camera2.h +++ /dev/null @@ -1,838 +0,0 @@ -/* - * Copyright (C) 2012 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_INCLUDE_CAMERA2_H -#define ANDROID_INCLUDE_CAMERA2_H - -#include "camera_common.h" -#include "system/camera_metadata.h" - -/** - * Camera device HAL 2.1 [ CAMERA_DEVICE_API_VERSION_2_0, CAMERA_DEVICE_API_VERSION_2_1 ] - * - * EXPERIMENTAL. - * - * Supports the android.hardware.Camera APIs. - * - * Camera devices that support this version of the HAL must return - * CAMERA_DEVICE_API_VERSION_2_1 in camera_device_t.common.version and in - * camera_info_t.device_version (from camera_module_t.get_camera_info). - * - * Camera modules that may contain version 2.x devices must implement at least - * version 2.0 of the camera module interface (as defined by - * camera_module_t.common.module_api_version). - * - * See camera_common.h for more versioning details. - * - * Version history: - * - * 2.0: CAMERA_DEVICE_API_VERSION_2_0. Initial release (Android 4.2): - * - Sufficient for implementing existing android.hardware.Camera API. - * - Allows for ZSL queue in camera service layer - * - Not tested for any new features such manual capture control, - * Bayer RAW capture, reprocessing of RAW data. - * - * 2.1: CAMERA_DEVICE_API_VERSION_2_1. Support per-device static metadata: - * - Add get_instance_metadata() method to retrieve metadata that is fixed - * after device open, but may be variable between open() calls. - */ - -__BEGIN_DECLS - -struct camera2_device; - -/********************************************************************** - * - * Input/output stream buffer queue interface definitions - * - */ - -/** - * Output image stream queue interface. A set of these methods is provided to - * the HAL device in allocate_stream(), and are used to interact with the - * gralloc buffer queue for that stream. They may not be called until after - * allocate_stream returns. - */ -typedef struct camera2_stream_ops { - /** - * Get a buffer to fill from the queue. The size and format of the buffer - * are fixed for a given stream (defined in allocate_stream), and the stride - * should be queried from the platform gralloc module. The gralloc buffer - * will have been allocated based on the usage flags provided by - * allocate_stream, and will be locked for use. - */ - int (*dequeue_buffer)(const struct camera2_stream_ops* w, - buffer_handle_t** buffer); - - /** - * Push a filled buffer to the stream to be used by the consumer. - * - * The timestamp represents the time at start of exposure of the first row - * of the image; it must be from a monotonic clock, and is measured in - * nanoseconds. The timestamps do not need to be comparable between - * different cameras, or consecutive instances of the same camera. However, - * they must be comparable between streams from the same camera. If one - * capture produces buffers for multiple streams, each stream must have the - * same timestamp for that buffer, and that timestamp must match the - * timestamp in the output frame metadata. - */ - int (*enqueue_buffer)(const struct camera2_stream_ops* w, - int64_t timestamp, - buffer_handle_t* buffer); - /** - * Return a buffer to the queue without marking it as filled. - */ - int (*cancel_buffer)(const struct camera2_stream_ops* w, - buffer_handle_t* buffer); - /** - * Set the crop window for subsequently enqueued buffers. The parameters are - * measured in pixels relative to the buffer width and height. - */ - int (*set_crop)(const struct camera2_stream_ops *w, - int left, int top, int right, int bottom); - -} camera2_stream_ops_t; - -/** - * Temporary definition during transition. - * - * These formats will be removed and replaced with - * HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED. To maximize forward compatibility, - * HAL implementations are strongly recommended to treat FORMAT_OPAQUE and - * FORMAT_ZSL as equivalent to HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED, and - * return HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED in the format_actual output - * parameter of allocate_stream, allowing the gralloc module to select the - * specific format based on the usage flags from the camera and the stream - * consumer. - */ -enum { - CAMERA2_HAL_PIXEL_FORMAT_OPAQUE = HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED, - CAMERA2_HAL_PIXEL_FORMAT_ZSL = -1 -}; - -/** - * Transport header for compressed JPEG buffers in output streams. - * - * To capture JPEG images, a stream is created using the pixel format - * HAL_PIXEL_FORMAT_BLOB, and the static metadata field android.jpeg.maxSize is - * used as the buffer size. Since compressed JPEG images are of variable size, - * the HAL needs to include the final size of the compressed image using this - * structure inside the output stream buffer. The JPEG blob ID field must be set - * to CAMERA2_JPEG_BLOB_ID. - * - * Transport header should be at the end of the JPEG output stream buffer. That - * means the jpeg_blob_id must start at byte[android.jpeg.maxSize - - * sizeof(camera2_jpeg_blob)]. Any HAL using this transport header must - * account for it in android.jpeg.maxSize. The JPEG data itself starts at - * byte[0] and should be jpeg_size bytes long. - */ -typedef struct camera2_jpeg_blob { - uint16_t jpeg_blob_id; - uint32_t jpeg_size; -}; - -enum { - CAMERA2_JPEG_BLOB_ID = 0x00FF -}; - -/** - * Input reprocess stream queue management. A set of these methods is provided - * to the HAL device in allocate_reprocess_stream(); they are used to interact - * with the reprocess stream's input gralloc buffer queue. - */ -typedef struct camera2_stream_in_ops { - /** - * Get the next buffer of image data to reprocess. The width, height, and - * format of the buffer is fixed in allocate_reprocess_stream(), and the - * stride and other details should be queried from the platform gralloc - * module as needed. The buffer will already be locked for use. - */ - int (*acquire_buffer)(const struct camera2_stream_in_ops *w, - buffer_handle_t** buffer); - /** - * Return a used buffer to the buffer queue for reuse. - */ - int (*release_buffer)(const struct camera2_stream_in_ops *w, - buffer_handle_t* buffer); - -} camera2_stream_in_ops_t; - -/********************************************************************** - * - * Metadata queue management, used for requests sent to HAL module, and for - * frames produced by the HAL. - * - */ - -enum { - CAMERA2_REQUEST_QUEUE_IS_BOTTOMLESS = -1 -}; - -/** - * Request input queue protocol: - * - * The framework holds the queue and its contents. At start, the queue is empty. - * - * 1. When the first metadata buffer is placed into the queue, the framework - * signals the device by calling notify_request_queue_not_empty(). - * - * 2. After receiving notify_request_queue_not_empty, the device must call - * dequeue() once it's ready to handle the next buffer. - * - * 3. Once the device has processed a buffer, and is ready for the next buffer, - * it must call dequeue() again instead of waiting for a notification. If - * there are no more buffers available, dequeue() will return NULL. After - * this point, when a buffer becomes available, the framework must call - * notify_request_queue_not_empty() again. If the device receives a NULL - * return from dequeue, it does not need to query the queue again until a - * notify_request_queue_not_empty() call is received from the source. - * - * 4. If the device calls buffer_count() and receives 0, this does not mean that - * the framework will provide a notify_request_queue_not_empty() call. The - * framework will only provide such a notification after the device has - * received a NULL from dequeue, or on initial startup. - * - * 5. The dequeue() call in response to notify_request_queue_not_empty() may be - * on the same thread as the notify_request_queue_not_empty() call, and may - * be performed from within the notify call. - * - * 6. All dequeued request buffers must be returned to the framework by calling - * free_request, including when errors occur, a device flush is requested, or - * when the device is shutting down. - */ -typedef struct camera2_request_queue_src_ops { - /** - * Get the count of request buffers pending in the queue. May return - * CAMERA2_REQUEST_QUEUE_IS_BOTTOMLESS if a repeating request (stream - * request) is currently configured. Calling this method has no effect on - * whether the notify_request_queue_not_empty() method will be called by the - * framework. - */ - int (*request_count)(const struct camera2_request_queue_src_ops *q); - - /** - * Get a metadata buffer from the framework. Returns OK if there is no - * error. If the queue is empty, returns NULL in buffer. In that case, the - * device must wait for a notify_request_queue_not_empty() message before - * attempting to dequeue again. Buffers obtained in this way must be - * returned to the framework with free_request(). - */ - int (*dequeue_request)(const struct camera2_request_queue_src_ops *q, - camera_metadata_t **buffer); - /** - * Return a metadata buffer to the framework once it has been used, or if - * an error or shutdown occurs. - */ - int (*free_request)(const struct camera2_request_queue_src_ops *q, - camera_metadata_t *old_buffer); - -} camera2_request_queue_src_ops_t; - -/** - * Frame output queue protocol: - * - * The framework holds the queue and its contents. At start, the queue is empty. - * - * 1. When the device is ready to fill an output metadata frame, it must dequeue - * a metadata buffer of the required size. - * - * 2. It should then fill the metadata buffer, and place it on the frame queue - * using enqueue_frame. The framework takes ownership of the frame. - * - * 3. In case of an error, a request to flush the pipeline, or shutdown, the - * device must return any affected dequeued frames to the framework by - * calling cancel_frame. - */ -typedef struct camera2_frame_queue_dst_ops { - /** - * Get an empty metadata buffer to fill from the framework. The new metadata - * buffer will have room for entries number of metadata entries, plus - * data_bytes worth of extra storage. Frames dequeued here must be returned - * to the framework with either cancel_frame or enqueue_frame. - */ - int (*dequeue_frame)(const struct camera2_frame_queue_dst_ops *q, - size_t entries, size_t data_bytes, - camera_metadata_t **buffer); - - /** - * Return a dequeued metadata buffer to the framework for reuse; do not mark it as - * filled. Use when encountering errors, or flushing the internal request queue. - */ - int (*cancel_frame)(const struct camera2_frame_queue_dst_ops *q, - camera_metadata_t *buffer); - - /** - * Place a completed metadata frame on the frame output queue. - */ - int (*enqueue_frame)(const struct camera2_frame_queue_dst_ops *q, - camera_metadata_t *buffer); - -} camera2_frame_queue_dst_ops_t; - -/********************************************************************** - * - * Notification callback and message definition, and trigger definitions - * - */ - -/** - * Asynchronous notification callback from the HAL, fired for various - * reasons. Only for information independent of frame capture, or that require - * specific timing. The user pointer must be the same one that was passed to the - * device in set_notify_callback(). - */ -typedef void (*camera2_notify_callback)(int32_t msg_type, - int32_t ext1, - int32_t ext2, - int32_t ext3, - void *user); - -/** - * Possible message types for camera2_notify_callback - */ -enum { - /** - * An error has occurred. Argument ext1 contains the error code, and - * ext2 and ext3 contain any error-specific information. - */ - CAMERA2_MSG_ERROR = 0x0001, - /** - * The exposure of a given request has begun. Argument ext1 contains the - * frame number, and ext2 and ext3 contain the low-order and high-order - * bytes of the timestamp for when exposure began. - * (timestamp = (ext3 << 32 | ext2)) - */ - CAMERA2_MSG_SHUTTER = 0x0010, - /** - * The autofocus routine has changed state. Argument ext1 contains the new - * state; the values are the same as those for the metadata field - * android.control.afState. Ext2 contains the latest trigger ID passed to - * trigger_action(CAMERA2_TRIGGER_AUTOFOCUS) or - * trigger_action(CAMERA2_TRIGGER_CANCEL_AUTOFOCUS), or 0 if trigger has not - * been called with either of those actions. - */ - CAMERA2_MSG_AUTOFOCUS = 0x0020, - /** - * The autoexposure routine has changed state. Argument ext1 contains the - * new state; the values are the same as those for the metadata field - * android.control.aeState. Ext2 contains the latest trigger ID value passed to - * trigger_action(CAMERA2_TRIGGER_PRECAPTURE_METERING), or 0 if that method - * has not been called. - */ - CAMERA2_MSG_AUTOEXPOSURE = 0x0021, - /** - * The auto-whitebalance routine has changed state. Argument ext1 contains - * the new state; the values are the same as those for the metadata field - * android.control.awbState. Ext2 contains the latest trigger ID passed to - * trigger_action(CAMERA2_TRIGGER_PRECAPTURE_METERING), or 0 if that method - * has not been called. - */ - CAMERA2_MSG_AUTOWB = 0x0022 -}; - -/** - * Error codes for CAMERA_MSG_ERROR - */ -enum { - /** - * A serious failure occured. Camera device may not work without reboot, and - * no further frames or buffer streams will be produced by the - * device. Device should be treated as closed. - */ - CAMERA2_MSG_ERROR_HARDWARE = 0x0001, - /** - * A serious failure occured. No further frames or buffer streams will be - * produced by the device. Device should be treated as closed. The client - * must reopen the device to use it again. - */ - CAMERA2_MSG_ERROR_DEVICE, - /** - * An error has occurred in processing a request. No output (metadata or - * buffers) will be produced for this request. ext2 contains the frame - * number of the request. Subsequent requests are unaffected, and the device - * remains operational. - */ - CAMERA2_MSG_ERROR_REQUEST, - /** - * An error has occurred in producing an output frame metadata buffer for a - * request, but image buffers for it will still be available. Subsequent - * requests are unaffected, and the device remains operational. ext2 - * contains the frame number of the request. - */ - CAMERA2_MSG_ERROR_FRAME, - /** - * An error has occurred in placing an output buffer into a stream for a - * request. The frame metadata and other buffers may still be - * available. Subsequent requests are unaffected, and the device remains - * operational. ext2 contains the frame number of the request, and ext3 - * contains the stream id. - */ - CAMERA2_MSG_ERROR_STREAM, - /** - * Number of error types - */ - CAMERA2_MSG_NUM_ERRORS -}; - -/** - * Possible trigger ids for trigger_action() - */ -enum { - /** - * Trigger an autofocus cycle. The effect of the trigger depends on the - * autofocus mode in effect when the trigger is received, which is the mode - * listed in the latest capture request to be dequeued by the HAL. If the - * mode is OFF, EDOF, or FIXED, the trigger has no effect. In AUTO, MACRO, - * or CONTINUOUS_* modes, see below for the expected behavior. The state of - * the autofocus cycle can be tracked in android.control.afMode and the - * corresponding notifications. - * - ** - * In AUTO or MACRO mode, the AF state transitions (and notifications) - * when calling with trigger ID = N with the previous ID being K are: - * - * Initial state Transitions - * INACTIVE (K) -> ACTIVE_SCAN (N) -> AF_FOCUSED (N) or AF_NOT_FOCUSED (N) - * AF_FOCUSED (K) -> ACTIVE_SCAN (N) -> AF_FOCUSED (N) or AF_NOT_FOCUSED (N) - * AF_NOT_FOCUSED (K) -> ACTIVE_SCAN (N) -> AF_FOCUSED (N) or AF_NOT_FOCUSED (N) - * ACTIVE_SCAN (K) -> AF_FOCUSED(N) or AF_NOT_FOCUSED(N) - * PASSIVE_SCAN (K) Not used in AUTO/MACRO mode - * PASSIVE_FOCUSED (K) Not used in AUTO/MACRO mode - * - ** - * In CONTINUOUS_PICTURE mode, triggering AF must lock the AF to the current - * lens position and transition the AF state to either AF_FOCUSED or - * NOT_FOCUSED. If a passive scan is underway, that scan must complete and - * then lock the lens position and change AF state. TRIGGER_CANCEL_AUTOFOCUS - * will allow the AF to restart its operation. - * - * Initial state Transitions - * INACTIVE (K) -> immediate AF_FOCUSED (N) or AF_NOT_FOCUSED (N) - * PASSIVE_FOCUSED (K) -> immediate AF_FOCUSED (N) or AF_NOT_FOCUSED (N) - * PASSIVE_SCAN (K) -> AF_FOCUSED (N) or AF_NOT_FOCUSED (N) - * AF_FOCUSED (K) no effect except to change next notification ID to N - * AF_NOT_FOCUSED (K) no effect except to change next notification ID to N - * - ** - * In CONTINUOUS_VIDEO mode, triggering AF must lock the AF to the current - * lens position and transition the AF state to either AF_FOCUSED or - * NOT_FOCUSED. If a passive scan is underway, it must immediately halt, in - * contrast with CONTINUOUS_PICTURE mode. TRIGGER_CANCEL_AUTOFOCUS will - * allow the AF to restart its operation. - * - * Initial state Transitions - * INACTIVE (K) -> immediate AF_FOCUSED (N) or AF_NOT_FOCUSED (N) - * PASSIVE_FOCUSED (K) -> immediate AF_FOCUSED (N) or AF_NOT_FOCUSED (N) - * PASSIVE_SCAN (K) -> immediate AF_FOCUSED (N) or AF_NOT_FOCUSED (N) - * AF_FOCUSED (K) no effect except to change next notification ID to N - * AF_NOT_FOCUSED (K) no effect except to change next notification ID to N - * - * Ext1 is an ID that must be returned in subsequent auto-focus state change - * notifications through camera2_notify_callback() and stored in - * android.control.afTriggerId. - */ - CAMERA2_TRIGGER_AUTOFOCUS = 0x0001, - /** - * Send a cancel message to the autofocus algorithm. The effect of the - * cancellation depends on the autofocus mode in effect when the trigger is - * received, which is the mode listed in the latest capture request to be - * dequeued by the HAL. If the AF mode is OFF or EDOF, the cancel has no - * effect. For other modes, the lens should return to its default position, - * any current autofocus scan must be canceled, and the AF state should be - * set to INACTIVE. - * - * The state of the autofocus cycle can be tracked in android.control.afMode - * and the corresponding notification. Continuous autofocus modes may resume - * focusing operations thereafter exactly as if the camera had just been set - * to a continuous AF mode. - * - * Ext1 is an ID that must be returned in subsequent auto-focus state change - * notifications through camera2_notify_callback() and stored in - * android.control.afTriggerId. - */ - CAMERA2_TRIGGER_CANCEL_AUTOFOCUS, - /** - * Trigger a pre-capture metering cycle, which may include firing the flash - * to determine proper capture parameters. Typically, this trigger would be - * fired for a half-depress of a camera shutter key, or before a snapshot - * capture in general. The state of the metering cycle can be tracked in - * android.control.aeMode and the corresponding notification. If the - * auto-exposure mode is OFF, the trigger does nothing. - * - * Ext1 is an ID that must be returned in subsequent - * auto-exposure/auto-white balance state change notifications through - * camera2_notify_callback() and stored in android.control.aePrecaptureId. - */ - CAMERA2_TRIGGER_PRECAPTURE_METERING -}; - -/** - * Possible template types for construct_default_request() - */ -enum { - /** - * Standard camera preview operation with 3A on auto. - */ - CAMERA2_TEMPLATE_PREVIEW = 1, - /** - * Standard camera high-quality still capture with 3A and flash on auto. - */ - CAMERA2_TEMPLATE_STILL_CAPTURE, - /** - * Standard video recording plus preview with 3A on auto, torch off. - */ - CAMERA2_TEMPLATE_VIDEO_RECORD, - /** - * High-quality still capture while recording video. Application will - * include preview, video record, and full-resolution YUV or JPEG streams in - * request. Must not cause stuttering on video stream. 3A on auto. - */ - CAMERA2_TEMPLATE_VIDEO_SNAPSHOT, - /** - * Zero-shutter-lag mode. Application will request preview and - * full-resolution data for each frame, and reprocess it to JPEG when a - * still image is requested by user. Settings should provide highest-quality - * full-resolution images without compromising preview frame rate. 3A on - * auto. - */ - CAMERA2_TEMPLATE_ZERO_SHUTTER_LAG, - - /* Total number of templates */ - CAMERA2_TEMPLATE_COUNT -}; - - -/********************************************************************** - * - * Camera device operations - * - */ -typedef struct camera2_device_ops { - - /********************************************************************** - * Request and frame queue setup and management methods - */ - - /** - * Pass in input request queue interface methods. - */ - int (*set_request_queue_src_ops)(const struct camera2_device *, - const camera2_request_queue_src_ops_t *request_src_ops); - - /** - * Notify device that the request queue is no longer empty. Must only be - * called when the first buffer is added a new queue, or after the source - * has returned NULL in response to a dequeue call. - */ - int (*notify_request_queue_not_empty)(const struct camera2_device *); - - /** - * Pass in output frame queue interface methods - */ - int (*set_frame_queue_dst_ops)(const struct camera2_device *, - const camera2_frame_queue_dst_ops_t *frame_dst_ops); - - /** - * Number of camera requests being processed by the device at the moment - * (captures/reprocesses that have had their request dequeued, but have not - * yet been enqueued onto output pipeline(s) ). No streams may be released - * by the framework until the in-progress count is 0. - */ - int (*get_in_progress_count)(const struct camera2_device *); - - /** - * Flush all in-progress captures. This includes all dequeued requests - * (regular or reprocessing) that have not yet placed any outputs into a - * stream or the frame queue. Partially completed captures must be completed - * normally. No new requests may be dequeued from the request queue until - * the flush completes. - */ - int (*flush_captures_in_progress)(const struct camera2_device *); - - /** - * Create a filled-in default request for standard camera use cases. - * - * The device must return a complete request that is configured to meet the - * requested use case, which must be one of the CAMERA2_TEMPLATE_* - * enums. All request control fields must be included, except for - * android.request.outputStreams. - * - * The metadata buffer returned must be allocated with - * allocate_camera_metadata. The framework takes ownership of the buffer. - */ - int (*construct_default_request)(const struct camera2_device *, - int request_template, - camera_metadata_t **request); - - /********************************************************************** - * Stream management - */ - - /** - * allocate_stream: - * - * Allocate a new output stream for use, defined by the output buffer width, - * height, target, and possibly the pixel format. Returns the new stream's - * ID, gralloc usage flags, minimum queue buffer count, and possibly the - * pixel format, on success. Error conditions: - * - * - Requesting a width/height/format combination not listed as - * supported by the sensor's static characteristics - * - * - Asking for too many streams of a given format type (2 bayer raw - * streams, for example). - * - * Input parameters: - * - * - width, height, format: Specification for the buffers to be sent through - * this stream. Format is a value from the HAL_PIXEL_FORMAT_* list. If - * HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED is used, then the platform - * gralloc module will select a format based on the usage flags provided - * by the camera HAL and the consumer of the stream. The camera HAL should - * inspect the buffers handed to it in the register_stream_buffers call to - * obtain the implementation-specific format if necessary. - * - * - stream_ops: A structure of function pointers for obtaining and queuing - * up buffers for this stream. The underlying stream will be configured - * based on the usage and max_buffers outputs. The methods in this - * structure may not be called until after allocate_stream returns. - * - * Output parameters: - * - * - stream_id: An unsigned integer identifying this stream. This value is - * used in incoming requests to identify the stream, and in releasing the - * stream. - * - * - usage: The gralloc usage mask needed by the HAL device for producing - * the requested type of data. This is used in allocating new gralloc - * buffers for the stream buffer queue. - * - * - max_buffers: The maximum number of buffers the HAL device may need to - * have dequeued at the same time. The device may not dequeue more buffers - * than this value at the same time. - * - */ - int (*allocate_stream)( - const struct camera2_device *, - // inputs - uint32_t width, - uint32_t height, - int format, - const camera2_stream_ops_t *stream_ops, - // outputs - uint32_t *stream_id, - uint32_t *format_actual, // IGNORED, will be removed - uint32_t *usage, - uint32_t *max_buffers); - - /** - * Register buffers for a given stream. This is called after a successful - * allocate_stream call, and before the first request referencing the stream - * is enqueued. This method is intended to allow the HAL device to map or - * otherwise prepare the buffers for later use. num_buffers is guaranteed to - * be at least max_buffers (from allocate_stream), but may be larger. The - * buffers will already be locked for use. At the end of the call, all the - * buffers must be ready to be returned to the queue. If the stream format - * was set to HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED, the camera HAL should - * inspect the passed-in buffers here to determine any platform-private - * pixel format information. - */ - int (*register_stream_buffers)( - const struct camera2_device *, - uint32_t stream_id, - int num_buffers, - buffer_handle_t *buffers); - - /** - * Release a stream. Returns an error if called when get_in_progress_count - * is non-zero, or if the stream id is invalid. - */ - int (*release_stream)( - const struct camera2_device *, - uint32_t stream_id); - - /** - * allocate_reprocess_stream: - * - * Allocate a new input stream for use, defined by the output buffer width, - * height, and the pixel format. Returns the new stream's ID, gralloc usage - * flags, and required simultaneously acquirable buffer count, on - * success. Error conditions: - * - * - Requesting a width/height/format combination not listed as - * supported by the sensor's static characteristics - * - * - Asking for too many reprocessing streams to be configured at once. - * - * Input parameters: - * - * - width, height, format: Specification for the buffers to be sent through - * this stream. Format must be a value from the HAL_PIXEL_FORMAT_* list. - * - * - reprocess_stream_ops: A structure of function pointers for acquiring - * and releasing buffers for this stream. The underlying stream will be - * configured based on the usage and max_buffers outputs. - * - * Output parameters: - * - * - stream_id: An unsigned integer identifying this stream. This value is - * used in incoming requests to identify the stream, and in releasing the - * stream. These ids are numbered separately from the input stream ids. - * - * - consumer_usage: The gralloc usage mask needed by the HAL device for - * consuming the requested type of data. This is used in allocating new - * gralloc buffers for the stream buffer queue. - * - * - max_buffers: The maximum number of buffers the HAL device may need to - * have acquired at the same time. The device may not have more buffers - * acquired at the same time than this value. - * - */ - int (*allocate_reprocess_stream)(const struct camera2_device *, - uint32_t width, - uint32_t height, - uint32_t format, - const camera2_stream_in_ops_t *reprocess_stream_ops, - // outputs - uint32_t *stream_id, - uint32_t *consumer_usage, - uint32_t *max_buffers); - - /** - * allocate_reprocess_stream_from_stream: - * - * Allocate a new input stream for use, which will use the buffers allocated - * for an existing output stream. That is, after the HAL enqueues a buffer - * onto the output stream, it may see that same buffer handed to it from - * this input reprocessing stream. After the HAL releases the buffer back to - * the reprocessing stream, it will be returned to the output queue for - * reuse. - * - * Error conditions: - * - * - Using an output stream of unsuitable size/format for the basis of the - * reprocessing stream. - * - * - Attempting to allocatee too many reprocessing streams at once. - * - * Input parameters: - * - * - output_stream_id: The ID of an existing output stream which has - * a size and format suitable for reprocessing. - * - * - reprocess_stream_ops: A structure of function pointers for acquiring - * and releasing buffers for this stream. The underlying stream will use - * the same graphics buffer handles as the output stream uses. - * - * Output parameters: - * - * - stream_id: An unsigned integer identifying this stream. This value is - * used in incoming requests to identify the stream, and in releasing the - * stream. These ids are numbered separately from the input stream ids. - * - * The HAL client must always release the reprocessing stream before it - * releases the output stream it is based on. - * - */ - int (*allocate_reprocess_stream_from_stream)(const struct camera2_device *, - uint32_t output_stream_id, - const camera2_stream_in_ops_t *reprocess_stream_ops, - // outputs - uint32_t *stream_id); - - /** - * Release a reprocessing stream. Returns an error if called when - * get_in_progress_count is non-zero, or if the stream id is not - * valid. - */ - int (*release_reprocess_stream)( - const struct camera2_device *, - uint32_t stream_id); - - /********************************************************************** - * Miscellaneous methods - */ - - /** - * Trigger asynchronous activity. This is used for triggering special - * behaviors of the camera 3A routines when they are in use. See the - * documentation for CAMERA2_TRIGGER_* above for details of the trigger ids - * and their arguments. - */ - int (*trigger_action)(const struct camera2_device *, - uint32_t trigger_id, - int32_t ext1, - int32_t ext2); - - /** - * Notification callback setup - */ - int (*set_notify_callback)(const struct camera2_device *, - camera2_notify_callback notify_cb, - void *user); - - /** - * Get methods to query for vendor extension metadata tag infomation. May - * set ops to NULL if no vendor extension tags are defined. - */ - int (*get_metadata_vendor_tag_ops)(const struct camera2_device*, - vendor_tag_query_ops_t **ops); - - /** - * Dump state of the camera hardware - */ - int (*dump)(const struct camera2_device *, int fd); - - /** - * Get device-instance-specific metadata. This metadata must be constant for - * a single instance of the camera device, but may be different between - * open() calls. The returned camera_metadata pointer must be valid until - * the device close() method is called. - * - * Version information: - * - * CAMERA_DEVICE_API_VERSION_2_0: - * - * Not available. Framework may not access this function pointer. - * - * CAMERA_DEVICE_API_VERSION_2_1: - * - * Valid. Can be called by the framework. - * - */ - int (*get_instance_metadata)(const struct camera2_device *, - camera_metadata **instance_metadata); - -} camera2_device_ops_t; - -/********************************************************************** - * - * Camera device definition - * - */ -typedef struct camera2_device { - /** - * common.version must equal CAMERA_DEVICE_API_VERSION_2_0 to identify - * this device as implementing version 2.0 of the camera device HAL. - */ - hw_device_t common; - camera2_device_ops_t *ops; - void *priv; -} camera2_device_t; - -__END_DECLS - -#endif /* #ifdef ANDROID_INCLUDE_CAMERA2_H */ diff --git a/external/android/include/18/hardware/libhardware/include/hardware/camera3.h b/external/android/include/18/hardware/libhardware/include/hardware/camera3.h deleted file mode 100644 index 3a900fc..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/camera3.h +++ /dev/null @@ -1,2057 +0,0 @@ -/* - * Copyright (C) 2013 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_INCLUDE_CAMERA3_H -#define ANDROID_INCLUDE_CAMERA3_H - -#include -#include "camera_common.h" - -/** - * Camera device HAL 3.0 [ CAMERA_DEVICE_API_VERSION_3_0 ] - * - * EXPERIMENTAL. - * - * Supports the android.hardware.Camera API. - * - * Camera devices that support this version of the HAL must return - * CAMERA_DEVICE_API_VERSION_3_0 in camera_device_t.common.version and in - * camera_info_t.device_version (from camera_module_t.get_camera_info). - * - * Camera modules that may contain version 3.0 devices must implement at least - * version 2.0 of the camera module interface (as defined by - * camera_module_t.common.module_api_version). - * - * See camera_common.h for more versioning details. - * - * Documentation index: - * S1. Version history - * S2. Startup and operation sequencing - * S3. Operational modes - * S4. 3A modes and state machines - * S5. Cropping - * S6. Error management - */ - -/** - * S1. Version history: - * - * 1.0: Initial Android camera HAL (Android 4.0) [camera.h]: - * - * - Converted from C++ CameraHardwareInterface abstraction layer. - * - * - Supports android.hardware.Camera API. - * - * 2.0: Initial release of expanded-capability HAL (Android 4.2) [camera2.h]: - * - * - Sufficient for implementing existing android.hardware.Camera API. - * - * - Allows for ZSL queue in camera service layer - * - * - Not tested for any new features such manual capture control, Bayer RAW - * capture, reprocessing of RAW data. - * - * 3.0: First revision of expanded-capability HAL: - * - * - Major version change since the ABI is completely different. No change to - * the required hardware capabilities or operational model from 2.0. - * - * - Reworked input request and stream queue interfaces: Framework calls into - * HAL with next request and stream buffers already dequeued. Sync framework - * support is included, necessary for efficient implementations. - * - * - Moved triggers into requests, most notifications into results. - * - * - Consolidated all callbacks into framework into one structure, and all - * setup methods into a single initialize() call. - * - * - Made stream configuration into a single call to simplify stream - * management. Bidirectional streams replace STREAM_FROM_STREAM construct. - * - * - Limited mode semantics for older/limited hardware devices. - */ - -/** - * S2. Startup and general expected operation sequence: - * - * 1. Framework calls camera_module_t->common.open(), which returns a - * hardware_device_t structure. - * - * 2. Framework inspects the hardware_device_t->version field, and instantiates - * the appropriate handler for that version of the camera hardware device. In - * case the version is CAMERA_DEVICE_API_VERSION_3_0, the device is cast to - * a camera3_device_t. - * - * 3. Framework calls camera3_device_t->ops->initialize() with the framework - * callback function pointers. This will only be called this one time after - * open(), before any other functions in the ops structure are called. - * - * 4. The framework calls camera3_device_t->ops->configure_streams() with a list - * of input/output streams to the HAL device. - * - * 5. The framework allocates gralloc buffers and calls - * camera3_device_t->ops->register_stream_buffers() for at least one of the - * output streams listed in configure_streams. The same stream is registered - * only once. - * - * 5. The framework requests default settings for some number of use cases with - * calls to camera3_device_t->ops->construct_default_request_settings(). This - * may occur any time after step 3. - * - * 7. The framework constructs and sends the first capture request to the HAL, - * with settings based on one of the sets of default settings, and with at - * least one output stream, which has been registered earlier by the - * framework. This is sent to the HAL with - * camera3_device_t->ops->process_capture_request(). The HAL must block the - * return of this call until it is ready for the next request to be sent. - * - * 8. The framework continues to submit requests, and possibly call - * register_stream_buffers() for not-yet-registered streams, and call - * construct_default_request_settings to get default settings buffers for - * other use cases. - * - * 9. When the capture of a request begins (sensor starts exposing for the - * capture), the HAL calls camera3_callback_ops_t->notify() with the SHUTTER - * event, including the frame number and the timestamp for start of exposure. - * This notify call must be made before the first call to - * process_capture_result() for that frame number. - * - * 10. After some pipeline delay, the HAL begins to return completed captures to - * the framework with camera3_callback_ops_t->process_capture_result(). These - * are returned in the same order as the requests were submitted. Multiple - * requests can be in flight at once, depending on the pipeline depth of the - * camera HAL device. - * - * 11. After some time, the framework may stop submitting new requests, wait for - * the existing captures to complete (all buffers filled, all results - * returned), and then call configure_streams() again. This resets the camera - * hardware and pipeline for a new set of input/output streams. Some streams - * may be reused from the previous configuration; if these streams' buffers - * had already been registered with the HAL, they will not be registered - * again. The framework then continues from step 7, if at least one - * registered output stream remains (otherwise, step 5 is required first). - * - * 12. Alternatively, the framework may call camera3_device_t->common->close() - * to end the camera session. This may be called at any time when no other - * calls from the framework are active, although the call may block until all - * in-flight captures have completed (all results returned, all buffers - * filled). After the close call returns, no more calls to the - * camera3_callback_ops_t functions are allowed from the HAL. Once the - * close() call is underway, the framework may not call any other HAL device - * functions. - * - * 13. In case of an error or other asynchronous event, the HAL must call - * camera3_callback_ops_t->notify() with the appropriate error/event - * message. After returning from a fatal device-wide error notification, the - * HAL should act as if close() had been called on it. However, the HAL must - * either cancel or complete all outstanding captures before calling - * notify(), so that once notify() is called with a fatal error, the - * framework will not receive further callbacks from the device. Methods - * besides close() should return -ENODEV or NULL after the notify() method - * returns from a fatal error message. - */ - -/** - * S3. Operational modes: - * - * The camera 3 HAL device can implement one of two possible operational modes; - * limited and full. Full support is expected from new higher-end - * devices. Limited mode has hardware requirements roughly in line with those - * for a camera HAL device v1 implementation, and is expected from older or - * inexpensive devices. Full is a strict superset of limited, and they share the - * same essential operational flow, as documented above. - * - * The HAL must indicate its level of support with the - * android.info.supportedHardwareLevel static metadata entry, with 0 indicating - * limited mode, and 1 indicating full mode support. - * - * Roughly speaking, limited-mode devices do not allow for application control - * of capture settings (3A control only), high-rate capture of high-resolution - * images, raw sensor readout, or support for YUV output streams above maximum - * recording resolution (JPEG only for large images). - * - * ** Details of limited mode behavior: - * - * - Limited-mode devices do not need to implement accurate synchronization - * between capture request settings and the actual image data - * captured. Instead, changes to settings may take effect some time in the - * future, and possibly not for the same output frame for each settings - * entry. Rapid changes in settings may result in some settings never being - * used for a capture. However, captures that include high-resolution output - * buffers ( > 1080p ) have to use the settings as specified (but see below - * for processing rate). - * - * - Limited-mode devices do not need to support most of the - * settings/result/static info metadata. Full-mode devices must support all - * metadata fields listed in TODO. Specifically, only the following settings - * are expected to be consumed or produced by a limited-mode HAL device: - * - * android.control.aeAntibandingMode (controls) - * android.control.aeExposureCompensation (controls) - * android.control.aeLock (controls) - * android.control.aeMode (controls) - * [OFF means ON_FLASH_TORCH - TODO] - * android.control.aeRegions (controls) - * android.control.aeTargetFpsRange (controls) - * android.control.afMode (controls) - * [OFF means infinity focus] - * android.control.afRegions (controls) - * android.control.awbLock (controls) - * android.control.awbMode (controls) - * [OFF not supported] - * android.control.awbRegions (controls) - * android.control.captureIntent (controls) - * android.control.effectMode (controls) - * android.control.mode (controls) - * [OFF not supported] - * android.control.sceneMode (controls) - * android.control.videoStabilizationMode (controls) - * android.control.aeAvailableAntibandingModes (static) - * android.control.aeAvailableModes (static) - * android.control.aeAvailableTargetFpsRanges (static) - * android.control.aeCompensationRange (static) - * android.control.aeCompensationStep (static) - * android.control.afAvailableModes (static) - * android.control.availableEffects (static) - * android.control.availableSceneModes (static) - * android.control.availableVideoStabilizationModes (static) - * android.control.awbAvailableModes (static) - * android.control.maxRegions (static) - * android.control.sceneModeOverrides (static) - * android.control.aeRegions (dynamic) - * android.control.aeState (dynamic) - * android.control.afMode (dynamic) - * android.control.afRegions (dynamic) - * android.control.afState (dynamic) - * android.control.awbMode (dynamic) - * android.control.awbRegions (dynamic) - * android.control.awbState (dynamic) - * android.control.mode (dynamic) - * - * android.flash.info.available (static) - * - * android.info.supportedHardwareLevel (static) - * - * android.jpeg.gpsCoordinates (controls) - * android.jpeg.gpsProcessingMethod (controls) - * android.jpeg.gpsTimestamp (controls) - * android.jpeg.orientation (controls) - * android.jpeg.quality (controls) - * android.jpeg.thumbnailQuality (controls) - * android.jpeg.thumbnailSize (controls) - * android.jpeg.availableThumbnailSizes (static) - * android.jpeg.maxSize (static) - * android.jpeg.gpsCoordinates (dynamic) - * android.jpeg.gpsProcessingMethod (dynamic) - * android.jpeg.gpsTimestamp (dynamic) - * android.jpeg.orientation (dynamic) - * android.jpeg.quality (dynamic) - * android.jpeg.size (dynamic) - * android.jpeg.thumbnailQuality (dynamic) - * android.jpeg.thumbnailSize (dynamic) - * - * android.lens.info.minimumFocusDistance (static) - * - * android.request.id (controls) - * android.request.id (dynamic) - * - * android.scaler.cropRegion (controls) - * [ignores (x,y), assumes center-zoom] - * android.scaler.availableFormats (static) - * [RAW not supported] - * android.scaler.availableJpegMinDurations (static) - * android.scaler.availableJpegSizes (static) - * android.scaler.availableMaxDigitalZoom (static) - * android.scaler.availableProcessedMinDurations (static) - * android.scaler.availableProcessedSizes (static) - * [full resolution not supported] - * android.scaler.maxDigitalZoom (static) - * android.scaler.cropRegion (dynamic) - * - * android.sensor.orientation (static) - * android.sensor.timestamp (dynamic) - * - * android.statistics.faceDetectMode (controls) - * android.statistics.info.availableFaceDetectModes (static) - * android.statistics.faceDetectMode (dynamic) - * android.statistics.faceIds (dynamic) - * android.statistics.faceLandmarks (dynamic) - * android.statistics.faceRectangles (dynamic) - * android.statistics.faceScores (dynamic) - * - * - Captures in limited mode that include high-resolution (> 1080p) output - * buffers may block in process_capture_request() until all the output buffers - * have been filled. A full-mode HAL device must process sequences of - * high-resolution requests at the rate indicated in the static metadata for - * that pixel format. The HAL must still call process_capture_result() to - * provide the output; the framework must simply be prepared for - * process_capture_request() to block until after process_capture_result() for - * that request completes for high-resolution captures for limited-mode - * devices. - * - */ - -/** - * S4. 3A modes and state machines: - * - * While the actual 3A algorithms are up to the HAL implementation, a high-level - * state machine description is defined by the HAL interface, to allow the HAL - * device and the framework to communicate about the current state of 3A, and to - * trigger 3A events. - * - * When the device is opened, all the individual 3A states must be - * STATE_INACTIVE. Stream configuration does not reset 3A. For example, locked - * focus must be maintained across the configure() call. - * - * Triggering a 3A action involves simply setting the relevant trigger entry in - * the settings for the next request to indicate start of trigger. For example, - * the trigger for starting an autofocus scan is setting the entry - * ANDROID_CONTROL_AF_TRIGGER to ANDROID_CONTROL_AF_TRIGGER_START for one - * request, and cancelling an autofocus scan is triggered by setting - * ANDROID_CONTROL_AF_TRIGGER to ANDROID_CONTRL_AF_TRIGGER_CANCEL. Otherwise, - * the entry will not exist, or be set to ANDROID_CONTROL_AF_TRIGGER_IDLE. Each - * request with a trigger entry set to a non-IDLE value will be treated as an - * independent triggering event. - * - * At the top level, 3A is controlled by the ANDROID_CONTROL_MODE setting, which - * selects between no 3A (ANDROID_CONTROL_MODE_OFF), normal AUTO mode - * (ANDROID_CONTROL_MODE_AUTO), and using the scene mode setting - * (ANDROID_CONTROL_USE_SCENE_MODE). - * - * - In OFF mode, each of the individual AE/AF/AWB modes are effectively OFF, - * and none of the capture controls may be overridden by the 3A routines. - * - * - In AUTO mode, Auto-focus, auto-exposure, and auto-whitebalance all run - * their own independent algorithms, and have their own mode, state, and - * trigger metadata entries, as listed in the next section. - * - * - In USE_SCENE_MODE, the value of the ANDROID_CONTROL_SCENE_MODE entry must - * be used to determine the behavior of 3A routines. In SCENE_MODEs other than - * FACE_PRIORITY, the HAL must override the values of - * ANDROId_CONTROL_AE/AWB/AF_MODE to be the mode it prefers for the selected - * SCENE_MODE. For example, the HAL may prefer SCENE_MODE_NIGHT to use - * CONTINUOUS_FOCUS AF mode. Any user selection of AE/AWB/AF_MODE when scene - * must be ignored for these scene modes. - * - * - For SCENE_MODE_FACE_PRIORITY, the AE/AWB/AF_MODE controls work as in - * ANDROID_CONTROL_MODE_AUTO, but the 3A routines must bias toward metering - * and focusing on any detected faces in the scene. - * - * S4.1. Auto-focus settings and result entries: - * - * Main metadata entries: - * - * ANDROID_CONTROL_AF_MODE: Control for selecting the current autofocus - * mode. Set by the framework in the request settings. - * - * AF_MODE_OFF: AF is disabled; the framework/app directly controls lens - * position. - * - * AF_MODE_AUTO: Single-sweep autofocus. No lens movement unless AF is - * triggered. - * - * AF_MODE_MACRO: Single-sweep up-close autofocus. No lens movement unless - * AF is triggered. - * - * AF_MODE_CONTINUOUS_VIDEO: Smooth continuous focusing, for recording - * video. Triggering immediately locks focus in current - * position. Canceling resumes cotinuous focusing. - * - * AF_MODE_CONTINUOUS_PICTURE: Fast continuous focusing, for - * zero-shutter-lag still capture. Triggering locks focus once currently - * active sweep concludes. Canceling resumes continuous focusing. - * - * AF_MODE_EDOF: Advanced extended depth of field focusing. There is no - * autofocus scan, so triggering one or canceling one has no effect. - * Images are focused automatically by the HAL. - * - * ANDROID_CONTROL_AF_STATE: Dynamic metadata describing the current AF - * algorithm state, reported by the HAL in the result metadata. - * - * AF_STATE_INACTIVE: No focusing has been done, or algorithm was - * reset. Lens is not moving. Always the state for MODE_OFF or MODE_EDOF. - * When the device is opened, it must start in this state. - * - * AF_STATE_PASSIVE_SCAN: A continuous focus algorithm is currently scanning - * for good focus. The lens is moving. - * - * AF_STATE_PASSIVE_FOCUSED: A continuous focus algorithm believes it is - * well focused. The lens is not moving. The HAL may spontaneously leave - * this state. - * - * AF_STATE_ACTIVE_SCAN: A scan triggered by the user is underway. - * - * AF_STATE_FOCUSED_LOCKED: The AF algorithm believes it is focused. The - * lens is not moving. - * - * AF_STATE_NOT_FOCUSED_LOCKED: The AF algorithm has been unable to - * focus. The lens is not moving. - * - * ANDROID_CONTROL_AF_TRIGGER: Control for starting an autofocus scan, the - * meaning of which is mode- and state- dependent. Set by the framework in - * the request settings. - * - * AF_TRIGGER_IDLE: No current trigger. - * - * AF_TRIGGER_START: Trigger start of AF scan. Effect is mode and state - * dependent. - * - * AF_TRIGGER_CANCEL: Cancel current AF scan if any, and reset algorithm to - * default. - * - * Additional metadata entries: - * - * ANDROID_CONTROL_AF_REGIONS: Control for selecting the regions of the FOV - * that should be used to determine good focus. This applies to all AF - * modes that scan for focus. Set by the framework in the request - * settings. - * - * S4.2. Auto-exposure settings and result entries: - * - * Main metadata entries: - * - * ANDROID_CONTROL_AE_MODE: Control for selecting the current auto-exposure - * mode. Set by the framework in the request settings. - * - * AE_MODE_OFF: Autoexposure is disabled; the user controls exposure, gain, - * frame duration, and flash. - * - * AE_MODE_ON: Standard autoexposure, with flash control disabled. User may - * set flash to fire or to torch mode. - * - * AE_MODE_ON_AUTO_FLASH: Standard autoexposure, with flash on at HAL's - * discretion for precapture and still capture. User control of flash - * disabled. - * - * AE_MODE_ON_ALWAYS_FLASH: Standard autoexposure, with flash always fired - * for capture, and at HAL's discretion for precapture.. User control of - * flash disabled. - * - * AE_MODE_ON_AUTO_FLASH_REDEYE: Standard autoexposure, with flash on at - * HAL's discretion for precapture and still capture. Use a flash burst - * at end of precapture sequence to reduce redeye in the final - * picture. User control of flash disabled. - * - * ANDROID_CONTROL_AE_STATE: Dynamic metadata describing the current AE - * algorithm state, reported by the HAL in the result metadata. - * - * AE_STATE_INACTIVE: Initial AE state after mode switch. When the device is - * opened, it must start in this state. - * - * AE_STATE_SEARCHING: AE is not converged to a good value, and is adjusting - * exposure parameters. - * - * AE_STATE_CONVERGED: AE has found good exposure values for the current - * scene, and the exposure parameters are not changing. HAL may - * spontaneously leave this state to search for better solution. - * - * AE_STATE_LOCKED: AE has been locked with the AE_LOCK control. Exposure - * values are not changing. - * - * AE_STATE_FLASH_REQUIRED: The HAL has converged exposure, but believes - * flash is required for a sufficiently bright picture. Used for - * determining if a zero-shutter-lag frame can be used. - * - * AE_STATE_PRECAPTURE: The HAL is in the middle of a precapture - * sequence. Depending on AE mode, this mode may involve firing the - * flash for metering, or a burst of flash pulses for redeye reduction. - * - * ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER: Control for starting a metering - * sequence before capturing a high-quality image. Set by the framework in - * the request settings. - * - * PRECAPTURE_TRIGGER_IDLE: No current trigger. - * - * PRECAPTURE_TRIGGER_START: Start a precapture sequence. The HAL should - * use the subsequent requests to measure good exposure/white balance - * for an upcoming high-resolution capture. - * - * Additional metadata entries: - * - * ANDROID_CONTROL_AE_LOCK: Control for locking AE controls to their current - * values - * - * ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION: Control for adjusting AE - * algorithm target brightness point. - * - * ANDROID_CONTROL_AE_TARGET_FPS_RANGE: Control for selecting the target frame - * rate range for the AE algorithm. The AE routine cannot change the frame - * rate to be outside these bounds. - * - * ANDROID_CONTROL_AE_REGIONS: Control for selecting the regions of the FOV - * that should be used to determine good exposure levels. This applies to - * all AE modes besides OFF. - * - * S4.3. Auto-whitebalance settings and result entries: - * - * Main metadata entries: - * - * ANDROID_CONTROL_AWB_MODE: Control for selecting the current white-balance - * mode. - * - * AWB_MODE_OFF: Auto-whitebalance is disabled. User controls color matrix. - * - * AWB_MODE_AUTO: Automatic white balance is enabled; 3A controls color - * transform, possibly using more complex transforms than a simple - * matrix. - * - * AWB_MODE_INCANDESCENT: Fixed white balance settings good for indoor - * incandescent (tungsten) lighting, roughly 2700K. - * - * AWB_MODE_FLUORESCENT: Fixed white balance settings good for fluorescent - * lighting, roughly 5000K. - * - * AWB_MODE_WARM_FLUORESCENT: Fixed white balance settings good for - * fluorescent lighting, roughly 3000K. - * - * AWB_MODE_DAYLIGHT: Fixed white balance settings good for daylight, - * roughly 5500K. - * - * AWB_MODE_CLOUDY_DAYLIGHT: Fixed white balance settings good for clouded - * daylight, roughly 6500K. - * - * AWB_MODE_TWILIGHT: Fixed white balance settings good for - * near-sunset/sunrise, roughly 15000K. - * - * AWB_MODE_SHADE: Fixed white balance settings good for areas indirectly - * lit by the sun, roughly 7500K. - * - * ANDROID_CONTROL_AWB_STATE: Dynamic metadata describing the current AWB - * algorithm state, reported by the HAL in the result metadata. - * - * AWB_STATE_INACTIVE: Initial AWB state after mode switch. When the device - * is opened, it must start in this state. - * - * AWB_STATE_SEARCHING: AWB is not converged to a good value, and is - * changing color adjustment parameters. - * - * AWB_STATE_CONVERGED: AWB has found good color adjustment values for the - * current scene, and the parameters are not changing. HAL may - * spontaneously leave this state to search for better solution. - * - * AWB_STATE_LOCKED: AWB has been locked with the AWB_LOCK control. Color - * adjustment values are not changing. - * - * Additional metadata entries: - * - * ANDROID_CONTROL_AWB_LOCK: Control for locking AWB color adjustments to - * their current values. - * - * ANDROID_CONTROL_AWB_REGIONS: Control for selecting the regions of the FOV - * that should be used to determine good color balance. This applies only - * to auto-WB mode. - * - * S4.4. General state machine transition notes - * - * Switching between AF, AE, or AWB modes always resets the algorithm's state - * to INACTIVE. Similarly, switching between CONTROL_MODE or - * CONTROL_SCENE_MODE if CONTROL_MODE == USE_SCENE_MODE resets all the - * algorithm states to INACTIVE. - * - * The tables below are per-mode. - * - * S4.5. AF state machines - * - * mode = AF_MODE_OFF or AF_MODE_EDOF - *| state | trans. cause | new state | notes | - *+--------------------+---------------+--------------------+------------------+ - *| INACTIVE | | | AF is disabled | - *+--------------------+---------------+--------------------+------------------+ - * - * mode = AF_MODE_AUTO or AF_MODE_MACRO - *| state | trans. cause | new state | notes | - *+--------------------+---------------+--------------------+------------------+ - *| INACTIVE | AF_TRIGGER | ACTIVE_SCAN | Start AF sweep | - *| | | | Lens now moving | - *+--------------------+---------------+--------------------+------------------+ - *| ACTIVE_SCAN | AF sweep done | FOCUSED_LOCKED | If AF successful | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| ACTIVE_SCAN | AF sweep done | NOT_FOCUSED_LOCKED | If AF successful | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| ACTIVE_SCAN | AF_CANCEL | INACTIVE | Cancel/reset AF | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| FOCUSED_LOCKED | AF_CANCEL | INACTIVE | Cancel/reset AF | - *+--------------------+---------------+--------------------+------------------+ - *| FOCUSED_LOCKED | AF_TRIGGER | ACTIVE_SCAN | Start new sweep | - *| | | | Lens now moving | - *+--------------------+---------------+--------------------+------------------+ - *| NOT_FOCUSED_LOCKED | AF_CANCEL | INACTIVE | Cancel/reset AF | - *+--------------------+---------------+--------------------+------------------+ - *| NOT_FOCUSED_LOCKED | AF_TRIGGER | ACTIVE_SCAN | Start new sweep | - *| | | | Lens now moving | - *+--------------------+---------------+--------------------+------------------+ - *| All states | mode change | INACTIVE | | - *+--------------------+---------------+--------------------+------------------+ - * - * mode = AF_MODE_CONTINUOUS_VIDEO - *| state | trans. cause | new state | notes | - *+--------------------+---------------+--------------------+------------------+ - *| INACTIVE | HAL initiates | PASSIVE_SCAN | Start AF scan | - *| | new scan | | Lens now moving | - *+--------------------+---------------+--------------------+------------------+ - *| INACTIVE | AF_TRIGGER | NOT_FOCUSED_LOCKED | AF state query | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_SCAN | HAL completes | PASSIVE_FOCUSED | End AF scan | - *| | current scan | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_SCAN | AF_TRIGGER | FOCUSED_LOCKED | Immediate trans. | - *| | | | if focus is good | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_SCAN | AF_TRIGGER | NOT_FOCUSED_LOCKED | Immediate trans. | - *| | | | if focus is bad | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_SCAN | AF_CANCEL | INACTIVE | Reset lens | - *| | | | position | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_FOCUSED | HAL initiates | PASSIVE_SCAN | Start AF scan | - *| | new scan | | Lens now moving | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_FOCUSED | AF_TRIGGER | FOCUSED_LOCKED | Immediate trans. | - *| | | | if focus is good | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_FOCUSED | AF_TRIGGER | NOT_FOCUSED_LOCKED | Immediate trans. | - *| | | | if focus is bad | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| FOCUSED_LOCKED | AF_TRIGGER | FOCUSED_LOCKED | No effect | - *+--------------------+---------------+--------------------+------------------+ - *| FOCUSED_LOCKED | AF_CANCEL | INACTIVE | Restart AF scan | - *+--------------------+---------------+--------------------+------------------+ - *| NOT_FOCUSED_LOCKED | AF_TRIGGER | NOT_FOCUSED_LOCKED | No effect | - *+--------------------+---------------+--------------------+------------------+ - *| NOT_FOCUSED_LOCKED | AF_CANCEL | INACTIVE | Restart AF scan | - *+--------------------+---------------+--------------------+------------------+ - * - * mode = AF_MODE_CONTINUOUS_PICTURE - *| state | trans. cause | new state | notes | - *+--------------------+---------------+--------------------+------------------+ - *| INACTIVE | HAL initiates | PASSIVE_SCAN | Start AF scan | - *| | new scan | | Lens now moving | - *+--------------------+---------------+--------------------+------------------+ - *| INACTIVE | AF_TRIGGER | NOT_FOCUSED_LOCKED | AF state query | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_SCAN | HAL completes | PASSIVE_FOCUSED | End AF scan | - *| | current scan | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_SCAN | AF_TRIGGER | FOCUSED_LOCKED | Eventual trans. | - *| | | | once focus good | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_SCAN | AF_TRIGGER | NOT_FOCUSED_LOCKED | Eventual trans. | - *| | | | if cannot focus | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_SCAN | AF_CANCEL | INACTIVE | Reset lens | - *| | | | position | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_FOCUSED | HAL initiates | PASSIVE_SCAN | Start AF scan | - *| | new scan | | Lens now moving | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_FOCUSED | AF_TRIGGER | FOCUSED_LOCKED | Immediate trans. | - *| | | | if focus is good | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_FOCUSED | AF_TRIGGER | NOT_FOCUSED_LOCKED | Immediate trans. | - *| | | | if focus is bad | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| FOCUSED_LOCKED | AF_TRIGGER | FOCUSED_LOCKED | No effect | - *+--------------------+---------------+--------------------+------------------+ - *| FOCUSED_LOCKED | AF_CANCEL | INACTIVE | Restart AF scan | - *+--------------------+---------------+--------------------+------------------+ - *| NOT_FOCUSED_LOCKED | AF_TRIGGER | NOT_FOCUSED_LOCKED | No effect | - *+--------------------+---------------+--------------------+------------------+ - *| NOT_FOCUSED_LOCKED | AF_CANCEL | INACTIVE | Restart AF scan | - *+--------------------+---------------+--------------------+------------------+ - * - * S4.6. AE and AWB state machines - * - * The AE and AWB state machines are mostly identical. AE has additional - * FLASH_REQUIRED and PRECAPTURE states. So rows below that refer to those two - * states should be ignored for the AWB state machine. - * - * mode = AE_MODE_OFF / AWB mode not AUTO - *| state | trans. cause | new state | notes | - *+--------------------+---------------+--------------------+------------------+ - *| INACTIVE | | | AE/AWB disabled | - *+--------------------+---------------+--------------------+------------------+ - * - * mode = AE_MODE_ON_* / AWB_MODE_AUTO - *| state | trans. cause | new state | notes | - *+--------------------+---------------+--------------------+------------------+ - *| INACTIVE | HAL initiates | SEARCHING | | - *| | AE/AWB scan | | | - *+--------------------+---------------+--------------------+------------------+ - *| INACTIVE | AE/AWB_LOCK | LOCKED | values locked | - *| | on | | | - *+--------------------+---------------+--------------------+------------------+ - *| SEARCHING | HAL finishes | CONVERGED | good values, not | - *| | AE/AWB scan | | changing | - *+--------------------+---------------+--------------------+------------------+ - *| SEARCHING | HAL finishes | FLASH_REQUIRED | converged but too| - *| | AE scan | | dark w/o flash | - *+--------------------+---------------+--------------------+------------------+ - *| SEARCHING | AE/AWB_LOCK | LOCKED | values locked | - *| | on | | | - *+--------------------+---------------+--------------------+------------------+ - *| CONVERGED | HAL initiates | SEARCHING | values locked | - *| | AE/AWB scan | | | - *+--------------------+---------------+--------------------+------------------+ - *| CONVERGED | AE/AWB_LOCK | LOCKED | values locked | - *| | on | | | - *+--------------------+---------------+--------------------+------------------+ - *| FLASH_REQUIRED | HAL initiates | SEARCHING | values locked | - *| | AE/AWB scan | | | - *+--------------------+---------------+--------------------+------------------+ - *| FLASH_REQUIRED | AE/AWB_LOCK | LOCKED | values locked | - *| | on | | | - *+--------------------+---------------+--------------------+------------------+ - *| LOCKED | AE/AWB_LOCK | SEARCHING | values not good | - *| | off | | after unlock | - *+--------------------+---------------+--------------------+------------------+ - *| LOCKED | AE/AWB_LOCK | CONVERGED | values good | - *| | off | | after unlock | - *+--------------------+---------------+--------------------+------------------+ - *| LOCKED | AE_LOCK | FLASH_REQUIRED | exposure good, | - *| | off | | but too dark | - *+--------------------+---------------+--------------------+------------------+ - *| All AE states | PRECAPTURE_ | PRECAPTURE | Start precapture | - *| | START | | sequence | - *+--------------------+---------------+--------------------+------------------+ - *| PRECAPTURE | Sequence done.| CONVERGED | Ready for high- | - *| | AE_LOCK off | | quality capture | - *+--------------------+---------------+--------------------+------------------+ - *| PRECAPTURE | Sequence done.| LOCKED | Ready for high- | - *| | AE_LOCK on | | quality capture | - *+--------------------+---------------+--------------------+------------------+ - * - */ - -/** - * S5. Cropping: - * - * Cropping of the full pixel array (for digital zoom and other use cases where - * a smaller FOV is desirable) is communicated through the - * ANDROID_SCALER_CROP_REGION setting. This is a per-request setting, and can - * change on a per-request basis, which is critical for implementing smooth - * digital zoom. - * - * The region is defined as a rectangle (x, y, width, height), with (x, y) - * describing the top-left corner of the rectangle. The rectangle is defined on - * the coordinate system of the sensor active pixel array, with (0,0) being the - * top-left pixel of the active pixel array. Therefore, the width and height - * cannot be larger than the dimensions reported in the - * ANDROID_SENSOR_ACTIVE_PIXEL_ARRAY static info field. The minimum allowed - * width and height are reported by the HAL through the - * ANDROID_SCALER_MAX_DIGITAL_ZOOM static info field, which describes the - * maximum supported zoom factor. Therefore, the minimum crop region width and - * height are: - * - * {width, height} = - * { floor(ANDROID_SENSOR_ACTIVE_PIXEL_ARRAY[0] / - * ANDROID_SCALER_MAX_DIGITAL_ZOOM), - * floor(ANDROID_SENSOR_ACTIVE_PIXEL_ARRAY[1] / - * ANDROID_SCALER_MAX_DIGITAL_ZOOM) } - * - * If the crop region needs to fulfill specific requirements (for example, it - * needs to start on even coordinates, and its width/height needs to be even), - * the HAL must do the necessary rounding and write out the final crop region - * used in the output result metadata. Similarly, if the HAL implements video - * stabilization, it must adjust the result crop region to describe the region - * actually included in the output after video stabilization is applied. In - * general, a camera-using application must be able to determine the field of - * view it is receiving based on the crop region, the dimensions of the image - * sensor, and the lens focal length. - * - * Since the crop region applies to all streams, which may have different aspect - * ratios than the crop region, the exact sensor region used for each stream may - * be smaller than the crop region. Specifically, each stream should maintain - * square pixels and its aspect ratio by minimally further cropping the defined - * crop region. If the stream's aspect ratio is wider than the crop region, the - * stream should be further cropped vertically, and if the stream's aspect ratio - * is narrower than the crop region, the stream should be further cropped - * horizontally. - * - * In all cases, the stream crop must be centered within the full crop region, - * and each stream is only either cropped horizontally or vertical relative to - * the full crop region, never both. - * - * For example, if two streams are defined, a 640x480 stream (4:3 aspect), and a - * 1280x720 stream (16:9 aspect), below demonstrates the expected output regions - * for each stream for a few sample crop regions, on a hypothetical 3 MP (2000 x - * 1500 pixel array) sensor. - * - * Crop region: (500, 375, 1000, 750) (4:3 aspect ratio) - * - * 640x480 stream crop: (500, 375, 1000, 750) (equal to crop region) - * 1280x720 stream crop: (500, 469, 1000, 562) (marked with =) - * - * 0 1000 2000 - * +---------+---------+---------+----------+ - * | Active pixel array | - * | | - * | | - * + +-------------------+ + 375 - * | | | | - * | O===================O | - * | I 1280x720 stream I | - * + I I + 750 - * | I I | - * | O===================O | - * | | | | - * + +-------------------+ + 1125 - * | Crop region, 640x480 stream | - * | | - * | | - * +---------+---------+---------+----------+ 1500 - * - * Crop region: (500, 375, 1333, 750) (16:9 aspect ratio) - * - * 640x480 stream crop: (666, 375, 1000, 750) (marked with =) - * 1280x720 stream crop: (500, 375, 1333, 750) (equal to crop region) - * - * 0 1000 2000 - * +---------+---------+---------+----------+ - * | Active pixel array | - * | | - * | | - * + +---O==================O---+ + 375 - * | | I 640x480 stream I | | - * | | I I | | - * | | I I | | - * + | I I | + 750 - * | | I I | | - * | | I I | | - * | | I I | | - * + +---O==================O---+ + 1125 - * | Crop region, 1280x720 stream | - * | | - * | | - * +---------+---------+---------+----------+ 1500 - * - * Crop region: (500, 375, 750, 750) (1:1 aspect ratio) - * - * 640x480 stream crop: (500, 469, 750, 562) (marked with =) - * 1280x720 stream crop: (500, 543, 750, 414) (marged with #) - * - * 0 1000 2000 - * +---------+---------+---------+----------+ - * | Active pixel array | - * | | - * | | - * + +--------------+ + 375 - * | O==============O | - * | ################ | - * | # # | - * + # # + 750 - * | # # | - * | ################ 1280x720 | - * | O==============O 640x480 | - * + +--------------+ + 1125 - * | Crop region | - * | | - * | | - * +---------+---------+---------+----------+ 1500 - * - * And a final example, a 1024x1024 square aspect ratio stream instead of the - * 480p stream: - * - * Crop region: (500, 375, 1000, 750) (4:3 aspect ratio) - * - * 1024x1024 stream crop: (625, 375, 750, 750) (marked with #) - * 1280x720 stream crop: (500, 469, 1000, 562) (marked with =) - * - * 0 1000 2000 - * +---------+---------+---------+----------+ - * | Active pixel array | - * | | - * | 1024x1024 stream | - * + +--###############--+ + 375 - * | | # # | | - * | O===================O | - * | I 1280x720 stream I | - * + I I + 750 - * | I I | - * | O===================O | - * | | # # | | - * + +--###############--+ + 1125 - * | Crop region | - * | | - * | | - * +---------+---------+---------+----------+ 1500 - * - */ - -/** - * S6. Error management: - * - * Camera HAL device ops functions that have a return value will all return - * -ENODEV / NULL in case of a serious error. This means the device cannot - * continue operation, and must be closed by the framework. Once this error is - * returned by some method, or if notify() is called with ERROR_DEVICE, only - * the close() method can be called successfully. All other methods will return - * -ENODEV / NULL. - * - * If a device op is called in the wrong sequence, for example if the framework - * calls configure_streams() is called before initialize(), the device must - * return -ENOSYS from the call, and do nothing. - * - * Transient errors in image capture must be reported through notify() as follows: - * - * - The failure of an entire capture to occur must be reported by the HAL by - * calling notify() with ERROR_REQUEST. Individual errors for the result - * metadata or the output buffers must not be reported in this case. - * - * - If the metadata for a capture cannot be produced, but some image buffers - * were filled, the HAL must call notify() with ERROR_RESULT. - * - * - If an output image buffer could not be filled, but either the metadata was - * produced or some other buffers were filled, the HAL must call notify() with - * ERROR_BUFFER for each failed buffer. - * - * In each of these transient failure cases, the HAL must still call - * process_capture_result, with valid output buffer_handle_t. If the result - * metadata could not be produced, it should be NULL. If some buffers could not - * be filled, their sync fences must be set to the error state. - * - * Invalid input arguments result in -EINVAL from the appropriate methods. In - * that case, the framework must act as if that call had never been made. - * - */ - -__BEGIN_DECLS - -struct camera3_device; - -/********************************************************************** - * - * Camera3 stream and stream buffer definitions. - * - * These structs and enums define the handles and contents of the input and - * output streams connecting the HAL to various framework and application buffer - * consumers. Each stream is backed by a gralloc buffer queue. - * - */ - -/** - * camera3_stream_type_t: - * - * The type of the camera stream, which defines whether the camera HAL device is - * the producer or the consumer for that stream, and how the buffers of the - * stream relate to the other streams. - */ -typedef enum camera3_stream_type { - /** - * This stream is an output stream; the camera HAL device will be - * responsible for filling buffers from this stream with newly captured or - * reprocessed image data. - */ - CAMERA3_STREAM_OUTPUT = 0, - - /** - * This stream is an input stream; the camera HAL device will be responsible - * for reading buffers from this stream and sending them through the camera - * processing pipeline, as if the buffer was a newly captured image from the - * imager. - */ - CAMERA3_STREAM_INPUT = 1, - - /** - * This stream can be used for input and output. Typically, the stream is - * used as an output stream, but occasionally one already-filled buffer may - * be sent back to the HAL device for reprocessing. - * - * This kind of stream is meant generally for zero-shutter-lag features, - * where copying the captured image from the output buffer to the - * reprocessing input buffer would be expensive. The stream will be used by - * the framework as follows: - * - * 1. The framework includes a buffer from this stream as output buffer in a - * request as normal. - * - * 2. Once the HAL device returns a filled output buffer to the framework, - * the framework may do one of two things with the filled buffer: - * - * 2. a. The framework uses the filled data, and returns the now-used buffer - * to the stream queue for reuse. This behavior exactly matches the - * OUTPUT type of stream. - * - * 2. b. The framework wants to reprocess the filled data, and uses the - * buffer as an input buffer for a request. Once the HAL device has - * used the reprocessing buffer, it then returns it to the - * framework. The framework then returns the now-used buffer to the - * stream queue for reuse. - * - * 3. The HAL device will be given the buffer again as an output buffer for - * a request at some future point. - * - * Note that the HAL will always be reprocessing data it produced. - * - */ - CAMERA3_STREAM_BIDIRECTIONAL = 2, - - /** - * Total number of framework-defined stream types - */ - CAMERA3_NUM_STREAM_TYPES - -} camera3_stream_type_t; - -/** - * camera3_stream_t: - * - * A handle to a single camera input or output stream. A stream is defined by - * the framework by its buffer resolution and format, and additionally by the - * HAL with the gralloc usage flags and the maximum in-flight buffer count. - * - * The stream structures are owned by the framework, but pointers to a - * camera3_stream passed into the HAL by configure_streams() are valid until the - * end of the first subsequent configure_streams() call that _does not_ include - * that camera3_stream as an argument, or until the end of the close() call. - * - * All camera3_stream framework-controlled members are immutable once the - * camera3_stream is passed into configure_streams(). The HAL may only change - * the HAL-controlled parameters during a configure_streams() call, except for - * the contents of the private pointer. - * - * If a configure_streams() call returns a non-fatal error, all active streams - * remain valid as if configure_streams() had not been called. - * - * The endpoint of the stream is not visible to the camera HAL device. - */ -typedef struct camera3_stream { - - /***** - * Set by framework before configure_streams() - */ - - /** - * The type of the stream, one of the camera3_stream_type_t values. - */ - int stream_type; - - /** - * The width in pixels of the buffers in this stream - */ - uint32_t width; - - /** - * The height in pixels of the buffers in this stream - */ - uint32_t height; - - /** - * The pixel format for the buffers in this stream. Format is a value from - * the HAL_PIXEL_FORMAT_* list in system/core/include/system/graphics.h, or - * from device-specific headers. - * - * If HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED is used, then the platform - * gralloc module will select a format based on the usage flags provided by - * the camera device and the other endpoint of the stream. - * - * The camera HAL device must inspect the buffers handed to it in the - * subsequent register_stream_buffers() call to obtain the - * implementation-specific format details, if necessary. - */ - int format; - - /***** - * Set by HAL during configure_streams(). - */ - - /** - * The gralloc usage flags for this stream, as needed by the HAL. The usage - * flags are defined in gralloc.h (GRALLOC_USAGE_*), or in device-specific - * headers. - * - * For output streams, these are the HAL's producer usage flags. For input - * streams, these are the HAL's consumer usage flags. The usage flags from - * the producer and the consumer will be combined together and then passed - * to the platform gralloc HAL module for allocating the gralloc buffers for - * each stream. - */ - uint32_t usage; - - /** - * The maximum number of buffers the HAL device may need to have dequeued at - * the same time. The HAL device may not have more buffers in-flight from - * this stream than this value. - */ - uint32_t max_buffers; - - /** - * A handle to HAL-private information for the stream. Will not be inspected - * by the framework code. - */ - void *priv; - -} camera3_stream_t; - -/** - * camera3_stream_configuration_t: - * - * A structure of stream definitions, used by configure_streams(). This - * structure defines all the output streams and the reprocessing input - * stream for the current camera use case. - */ -typedef struct camera3_stream_configuration { - /** - * The total number of streams requested by the framework. This includes - * both input and output streams. The number of streams will be at least 1, - * and there will be at least one output-capable stream. - */ - uint32_t num_streams; - - /** - * An array of camera stream pointers, defining the input/output - * configuration for the camera HAL device. - * - * At most one input-capable stream may be defined (INPUT or BIDIRECTIONAL) - * in a single configuration. - * - * At least one output-capable stream must be defined (OUTPUT or - * BIDIRECTIONAL). - */ - camera3_stream_t **streams; - -} camera3_stream_configuration_t; - -/** - * camera3_buffer_status_t: - * - * The current status of a single stream buffer. - */ -typedef enum camera3_buffer_status { - /** - * The buffer is in a normal state, and can be used after waiting on its - * sync fence. - */ - CAMERA3_BUFFER_STATUS_OK = 0, - - /** - * The buffer does not contain valid data, and the data in it should not be - * used. The sync fence must still be waited on before reusing the buffer. - */ - CAMERA3_BUFFER_STATUS_ERROR = 1 - -} camera3_buffer_status_t; - -/** - * camera3_stream_buffer_t: - * - * A single buffer from a camera3 stream. It includes a handle to its parent - * stream, the handle to the gralloc buffer itself, and sync fences - * - * The buffer does not specify whether it is to be used for input or output; - * that is determined by its parent stream type and how the buffer is passed to - * the HAL device. - */ -typedef struct camera3_stream_buffer { - /** - * The handle of the stream this buffer is associated with - */ - camera3_stream_t *stream; - - /** - * The native handle to the buffer - */ - buffer_handle_t *buffer; - - /** - * Current state of the buffer, one of the camera3_buffer_status_t - * values. The framework will not pass buffers to the HAL that are in an - * error state. In case a buffer could not be filled by the HAL, it must - * have its status set to CAMERA3_BUFFER_STATUS_ERROR when returned to the - * framework with process_capture_result(). - */ - int status; - - /** - * The acquire sync fence for this buffer. The HAL must wait on this fence - * fd before attempting to read from or write to this buffer. - * - * The framework may be set to -1 to indicate that no waiting is necessary - * for this buffer. - * - * When the HAL returns an output buffer to the framework with - * process_capture_result(), the acquire_fence must be set to -1. If the HAL - * never waits on the acquire_fence due to an error in filling a buffer, - * when calling process_capture_result() the HAL must set the release_fence - * of the buffer to be the acquire_fence passed to it by the framework. This - * will allow the framework to wait on the fence before reusing the buffer. - * - * For input buffers, the HAL must not change the acquire_fence field during - * the process_capture_request() call. - */ - int acquire_fence; - - /** - * The release sync fence for this buffer. The HAL must set this fence when - * returning buffers to the framework, or write -1 to indicate that no - * waiting is required for this buffer. - * - * For the input buffer, the release fence must be set by the - * process_capture_request() call. For the output buffers, the fences must - * be set in the output_buffers array passed to process_capture_result(). - * - */ - int release_fence; - -} camera3_stream_buffer_t; - -/** - * camera3_stream_buffer_set_t: - * - * The complete set of gralloc buffers for a stream. This structure is given to - * register_stream_buffers() to allow the camera HAL device to register/map/etc - * newly allocated stream buffers. - */ -typedef struct camera3_stream_buffer_set { - /** - * The stream handle for the stream these buffers belong to - */ - camera3_stream_t *stream; - - /** - * The number of buffers in this stream. It is guaranteed to be at least - * stream->max_buffers. - */ - uint32_t num_buffers; - - /** - * The array of gralloc buffer handles for this stream. If the stream format - * is set to HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED, the camera HAL device - * should inspect the passed-in buffers to determine any platform-private - * pixel format information. - */ - buffer_handle_t **buffers; - -} camera3_stream_buffer_set_t; - -/** - * camera3_jpeg_blob: - * - * Transport header for compressed JPEG buffers in output streams. - * - * To capture JPEG images, a stream is created using the pixel format - * HAL_PIXEL_FORMAT_BLOB, and the static metadata field android.jpeg.maxSize is - * used as the buffer size. Since compressed JPEG images are of variable size, - * the HAL needs to include the final size of the compressed image using this - * structure inside the output stream buffer. The JPEG blob ID field must be set - * to CAMERA3_JPEG_BLOB_ID. - * - * Transport header should be at the end of the JPEG output stream buffer. That - * means the jpeg_blob_id must start at byte[android.jpeg.maxSize - - * sizeof(camera3_jpeg_blob)]. Any HAL using this transport header must - * account for it in android.jpeg.maxSize. The JPEG data itself starts at - * the beginning of the buffer and should be jpeg_size bytes long. - */ -typedef struct camera3_jpeg_blob { - uint16_t jpeg_blob_id; - uint32_t jpeg_size; -} camera3_jpeg_blob_t; - -enum { - CAMERA3_JPEG_BLOB_ID = 0x00FF -}; - -/********************************************************************** - * - * Message definitions for the HAL notify() callback. - * - * These definitions are used for the HAL notify callback, to signal - * asynchronous events from the HAL device to the Android framework. - * - */ - -/** - * camera3_msg_type: - * - * Indicates the type of message sent, which specifies which member of the - * message union is valid. - * - */ -typedef enum camera3_msg_type { - /** - * An error has occurred. camera3_notify_msg.message.error contains the - * error information. - */ - CAMERA3_MSG_ERROR = 1, - - /** - * The exposure of a given request has - * begun. camera3_notify_msg.message.shutter contains the information - * the capture. - */ - CAMERA3_MSG_SHUTTER = 2, - - /** - * Number of framework message types - */ - CAMERA3_NUM_MESSAGES - -} camera3_msg_type_t; - -/** - * Defined error codes for CAMERA_MSG_ERROR - */ -typedef enum camera3_error_msg_code { - /** - * A serious failure occured. No further frames or buffer streams will - * be produced by the device. Device should be treated as closed. The - * client must reopen the device to use it again. The frame_number field - * is unused. - */ - CAMERA3_MSG_ERROR_DEVICE = 1, - - /** - * An error has occurred in processing a request. No output (metadata or - * buffers) will be produced for this request. The frame_number field - * specifies which request has been dropped. Subsequent requests are - * unaffected, and the device remains operational. - */ - CAMERA3_MSG_ERROR_REQUEST = 2, - - /** - * An error has occurred in producing an output result metadata buffer - * for a request, but output stream buffers for it will still be - * available. Subsequent requests are unaffected, and the device remains - * operational. The frame_number field specifies the request for which - * result metadata won't be available. - */ - CAMERA3_MSG_ERROR_RESULT = 3, - - /** - * An error has occurred in placing an output buffer into a stream for a - * request. The frame metadata and other buffers may still be - * available. Subsequent requests are unaffected, and the device remains - * operational. The frame_number field specifies the request for which the - * buffer was dropped, and error_stream contains a pointer to the stream - * that dropped the frame.u - */ - CAMERA3_MSG_ERROR_BUFFER = 4, - - /** - * Number of error types - */ - CAMERA3_MSG_NUM_ERRORS - -} camera3_error_msg_code_t; - -/** - * camera3_error_msg_t: - * - * Message contents for CAMERA3_MSG_ERROR - */ -typedef struct camera3_error_msg { - /** - * Frame number of the request the error applies to. 0 if the frame number - * isn't applicable to the error. - */ - uint32_t frame_number; - - /** - * Pointer to the stream that had a failure. NULL if the stream isn't - * applicable to the error. - */ - camera3_stream_t *error_stream; - - /** - * The code for this error; one of the CAMERA_MSG_ERROR enum values. - */ - int error_code; - -} camera3_error_msg_t; - -/** - * camera3_shutter_msg_t: - * - * Message contents for CAMERA3_MSG_SHUTTER - */ -typedef struct camera3_shutter_msg { - /** - * Frame number of the request that has begun exposure - */ - uint32_t frame_number; - - /** - * Timestamp for the start of capture. This must match the capture result - * metadata's sensor exposure start timestamp. - */ - uint64_t timestamp; - -} camera3_shutter_msg_t; - -/** - * camera3_notify_msg_t: - * - * The message structure sent to camera3_callback_ops_t.notify() - */ -typedef struct camera3_notify_msg { - - /** - * The message type. One of camera3_notify_msg_type, or a private extension. - */ - int type; - - union { - /** - * Error message contents. Valid if type is CAMERA3_MSG_ERROR - */ - camera3_error_msg_t error; - - /** - * Shutter message contents. Valid if type is CAMERA3_MSG_SHUTTER - */ - camera3_shutter_msg_t shutter; - - /** - * Generic message contents. Used to ensure a minimum size for custom - * message types. - */ - uint8_t generic[32]; - } message; - -} camera3_notify_msg_t; - -/********************************************************************** - * - * Capture request/result definitions for the HAL process_capture_request() - * method, and the process_capture_result() callback. - * - */ - -/** - * camera3_request_template_t: - * - * Available template types for - * camera3_device_ops.construct_default_request_settings() - */ -typedef enum camera3_request_template { - /** - * Standard camera preview operation with 3A on auto. - */ - CAMERA3_TEMPLATE_PREVIEW = 1, - - /** - * Standard camera high-quality still capture with 3A and flash on auto. - */ - CAMERA3_TEMPLATE_STILL_CAPTURE = 2, - - /** - * Standard video recording plus preview with 3A on auto, torch off. - */ - CAMERA3_TEMPLATE_VIDEO_RECORD = 3, - - /** - * High-quality still capture while recording video. Application will - * include preview, video record, and full-resolution YUV or JPEG streams in - * request. Must not cause stuttering on video stream. 3A on auto. - */ - CAMERA3_TEMPLATE_VIDEO_SNAPSHOT = 4, - - /** - * Zero-shutter-lag mode. Application will request preview and - * full-resolution data for each frame, and reprocess it to JPEG when a - * still image is requested by user. Settings should provide highest-quality - * full-resolution images without compromising preview frame rate. 3A on - * auto. - */ - CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG = 5, - - /* Total number of templates */ - CAMERA3_TEMPLATE_COUNT, - - /** - * First value for vendor-defined request templates - */ - CAMERA3_VENDOR_TEMPLATE_START = 0x40000000 - -} camera3_request_template_t; - -/** - * camera3_capture_request_t: - * - * A single request for image capture/buffer reprocessing, sent to the Camera - * HAL device by the framework in process_capture_request(). - * - * The request contains the settings to be used for this capture, and the set of - * output buffers to write the resulting image data in. It may optionally - * contain an input buffer, in which case the request is for reprocessing that - * input buffer instead of capturing a new image with the camera sensor. The - * capture is identified by the frame_number. - * - * In response, the camera HAL device must send a camera3_capture_result - * structure asynchronously to the framework, using the process_capture_result() - * callback. - */ -typedef struct camera3_capture_request { - /** - * The frame number is an incrementing integer set by the framework to - * uniquely identify this capture. It needs to be returned in the result - * call, and is also used to identify the request in asynchronous - * notifications sent to camera3_callback_ops_t.notify(). - */ - uint32_t frame_number; - - /** - * The settings buffer contains the capture and processing parameters for - * the request. As a special case, a NULL settings buffer indicates that the - * settings are identical to the most-recently submitted capture request. A - * NULL buffer cannot be used as the first submitted request after a - * configure_streams() call. - */ - const camera_metadata_t *settings; - - /** - * The input stream buffer to use for this request, if any. - * - * If input_buffer is NULL, then the request is for a new capture from the - * imager. If input_buffer is valid, the request is for reprocessing the - * image contained in input_buffer. - * - * In the latter case, the HAL must set the release_fence of the - * input_buffer to a valid sync fence, or to -1 if the HAL does not support - * sync, before process_capture_request() returns. - * - * The HAL is required to wait on the acquire sync fence of the input buffer - * before accessing it. - * - * Any input buffer included here will have been registered with the HAL - * through register_stream_buffers() before its inclusion in a request. - */ - camera3_stream_buffer_t *input_buffer; - - /** - * The number of output buffers for this capture request. Must be at least - * 1. - */ - uint32_t num_output_buffers; - - /** - * An array of num_output_buffers stream buffers, to be filled with image - * data from this capture/reprocess. The HAL must wait on the acquire fences - * of each stream buffer before writing to them. All the buffers included - * here will have been registered with the HAL through - * register_stream_buffers() before their inclusion in a request. - * - * The HAL takes ownership of the actual buffer_handle_t entries in - * output_buffers; the framework does not access them until they are - * returned in a camera3_capture_result_t. - */ - const camera3_stream_buffer_t *output_buffers; - -} camera3_capture_request_t; - -/** - * camera3_capture_result_t: - * - * The result of a single capture/reprocess by the camera HAL device. This is - * sent to the framework asynchronously with process_capture_result(), in - * response to a single capture request sent to the HAL with - * process_capture_request(). Multiple process_capture_result() calls may be - * performed by the HAL for each request. Each call, all with the same frame - * number, may contain some subset of the output buffers, and/or the result - * metadata. The metadata may only be provided once for a given frame number; - * all other calls must set the result metadata to NULL. - * - * The result structure contains the output metadata from this capture, and the - * set of output buffers that have been/will be filled for this capture. Each - * output buffer may come with a release sync fence that the framework will wait - * on before reading, in case the buffer has not yet been filled by the HAL. - * - */ -typedef struct camera3_capture_result { - /** - * The frame number is an incrementing integer set by the framework in the - * submitted request to uniquely identify this capture. It is also used to - * identify the request in asynchronous notifications sent to - * camera3_callback_ops_t.notify(). - */ - uint32_t frame_number; - - /** - * The result metadata for this capture. This contains information about the - * final capture parameters, the state of the capture and post-processing - * hardware, the state of the 3A algorithms, if enabled, and the output of - * any enabled statistics units. - * - * Only one call to process_capture_result() with a given frame_number may - * include the result metadata. All other calls for the same frame_number - * must set this to NULL. - * - * If there was an error producing the result metadata, result must be an - * empty metadata buffer, and notify() must be called with ERROR_RESULT. - */ - const camera_metadata_t *result; - - /** - * The number of output buffers returned in this result structure. Must be - * less than or equal to the matching capture request's count. If this is - * less than the buffer count in the capture request, at least one more call - * to process_capture_result with the same frame_number must be made, to - * return the remaining output buffers to the framework. This may only be - * zero if the structure includes valid result metadata. - */ - uint32_t num_output_buffers; - - /** - * The handles for the output stream buffers for this capture. They may not - * yet be filled at the time the HAL calls process_capture_result(); the - * framework will wait on the release sync fences provided by the HAL before - * reading the buffers. - * - * The HAL must set the stream buffer's release sync fence to a valid sync - * fd, or to -1 if the buffer has already been filled. - * - * If the HAL encounters an error while processing the buffer, and the - * buffer is not filled, the buffer's status field must be set to - * CAMERA3_BUFFER_STATUS_ERROR. If the HAL did not wait on the acquire fence - * before encountering the error, the acquire fence should be copied into - * the release fence, to allow the framework to wait on the fence before - * reusing the buffer. - * - * The acquire fence must be set to -1 for all output buffers. If - * num_output_buffers is zero, this may be NULL. In that case, at least one - * more process_capture_result call must be made by the HAL to provide the - * output buffers. - */ - const camera3_stream_buffer_t *output_buffers; - -} camera3_capture_result_t; - -/********************************************************************** - * - * Callback methods for the HAL to call into the framework. - * - * These methods are used to return metadata and image buffers for a completed - * or failed captures, and to notify the framework of asynchronous events such - * as errors. - * - * The framework will not call back into the HAL from within these callbacks, - * and these calls will not block for extended periods. - * - */ -typedef struct camera3_callback_ops { - - /** - * process_capture_result: - * - * Send results from a completed capture to the framework. - * process_capture_result() may be invoked multiple times by the HAL in - * response to a single capture request. This allows, for example, the - * metadata and low-resolution buffers to be returned in one call, and - * post-processed JPEG buffers in a later call, once it is available. Each - * call must include the frame number of the request it is returning - * metadata or buffers for. - * - * A component (buffer or metadata) of the complete result may only be - * included in one process_capture_result call. A buffer for each stream, - * and the result metadata, must be returned by the HAL for each request in - * one of the process_capture_result calls, even in case of errors producing - * some of the output. A call to process_capture_result() with neither - * output buffers or result metadata is not allowed. - * - * The order of returning metadata and buffers for a single result does not - * matter, but buffers for a given stream must be returned in FIFO order. So - * the buffer for request 5 for stream A must always be returned before the - * buffer for request 6 for stream A. This also applies to the result - * metadata; the metadata for request 5 must be returned before the metadata - * for request 6. - * - * However, different streams are independent of each other, so it is - * acceptable and expected that the buffer for request 5 for stream A may be - * returned after the buffer for request 6 for stream B is. And it is - * acceptable that the result metadata for request 6 for stream B is - * returned before the buffer for request 5 for stream A is. - * - * The HAL retains ownership of result structure, which only needs to be - * valid to access during this call. The framework will copy whatever it - * needs before this call returns. - * - * The output buffers do not need to be filled yet; the framework will wait - * on the stream buffer release sync fence before reading the buffer - * data. Therefore, this method should be called by the HAL as soon as - * possible, even if some or all of the output buffers are still in - * being filled. The HAL must include valid release sync fences into each - * output_buffers stream buffer entry, or -1 if that stream buffer is - * already filled. - * - * If the result buffer cannot be constructed for a request, the HAL should - * return an empty metadata buffer, but still provide the output buffers and - * their sync fences. In addition, notify() must be called with an - * ERROR_RESULT message. - * - * If an output buffer cannot be filled, its status field must be set to - * STATUS_ERROR. In addition, notify() must be called with a ERROR_BUFFER - * message. - * - * If the entire capture has failed, then this method still needs to be - * called to return the output buffers to the framework. All the buffer - * statuses should be STATUS_ERROR, and the result metadata should be an - * empty buffer. In addition, notify() must be called with a ERROR_REQUEST - * message. In this case, individual ERROR_RESULT/ERROR_BUFFER messages - * should not be sent. - * - */ - void (*process_capture_result)(const struct camera3_callback_ops *, - const camera3_capture_result_t *result); - - /** - * notify: - * - * Asynchronous notification callback from the HAL, fired for various - * reasons. Only for information independent of frame capture, or that - * require specific timing. The ownership of the message structure remains - * with the HAL, and the msg only needs to be valid for the duration of this - * call. - * - * The notification for the start of exposure for a given request must be - * sent by the HAL before the first call to process_capture_result() for - * that request is made. - * - * Multiple threads may call notify() simultaneously. - */ - void (*notify)(const struct camera3_callback_ops *, - const camera3_notify_msg_t *msg); - -} camera3_callback_ops_t; - -/********************************************************************** - * - * Camera device operations - * - */ -typedef struct camera3_device_ops { - - /** - * initialize: - * - * One-time initialization to pass framework callback function pointers to - * the HAL. Will be called once after a successful open() call, before any - * other functions are called on the camera3_device_ops structure. - * - * Return values: - * - * 0: On successful initialization - * - * -ENODEV: If initialization fails. Only close() can be called successfully - * by the framework after this. - */ - int (*initialize)(const struct camera3_device *, - const camera3_callback_ops_t *callback_ops); - - /********************************************************************** - * Stream management - */ - - /** - * configure_streams: - * - * Reset the HAL camera device processing pipeline and set up new input and - * output streams. This call replaces any existing stream configuration with - * the streams defined in the stream_list. This method will be called at - * least once after initialize() before a request is submitted with - * process_capture_request(). - * - * The stream_list must contain at least one output-capable stream, and may - * not contain more than one input-capable stream. - * - * The stream_list may contain streams that are also in the currently-active - * set of streams (from the previous call to configure_stream()). These - * streams will already have valid values for usage, max_buffers, and the - * private pointer. If such a stream has already had its buffers registered, - * register_stream_buffers() will not be called again for the stream, and - * buffers from the stream can be immediately included in input requests. - * - * If the HAL needs to change the stream configuration for an existing - * stream due to the new configuration, it may rewrite the values of usage - * and/or max_buffers during the configure call. The framework will detect - * such a change, and will then reallocate the stream buffers, and call - * register_stream_buffers() again before using buffers from that stream in - * a request. - * - * If a currently-active stream is not included in stream_list, the HAL may - * safely remove any references to that stream. It will not be reused in a - * later configure() call by the framework, and all the gralloc buffers for - * it will be freed after the configure_streams() call returns. - * - * The stream_list structure is owned by the framework, and may not be - * accessed once this call completes. The address of an individual - * camera3_stream_t structure will remain valid for access by the HAL until - * the end of the first configure_stream() call which no longer includes - * that camera3_stream_t in the stream_list argument. The HAL may not change - * values in the stream structure outside of the private pointer, except for - * the usage and max_buffers members during the configure_streams() call - * itself. - * - * If the stream is new, the usage, max_buffer, and private pointer fields - * of the stream structure will all be set to 0. The HAL device must set - * these fields before the configure_streams() call returns. These fields - * are then used by the framework and the platform gralloc module to - * allocate the gralloc buffers for each stream. - * - * Before such a new stream can have its buffers included in a capture - * request, the framework will call register_stream_buffers() with that - * stream. However, the framework is not required to register buffers for - * _all_ streams before submitting a request. This allows for quick startup - * of (for example) a preview stream, with allocation for other streams - * happening later or concurrently. - * - * Preconditions: - * - * The framework will only call this method when no captures are being - * processed. That is, all results have been returned to the framework, and - * all in-flight input and output buffers have been returned and their - * release sync fences have been signaled by the HAL. The framework will not - * submit new requests for capture while the configure_streams() call is - * underway. - * - * Postconditions: - * - * The HAL device must configure itself to provide maximum possible output - * frame rate given the sizes and formats of the output streams, as - * documented in the camera device's static metadata. - * - * Performance expectations: - * - * This call is expected to be heavyweight and possibly take several hundred - * milliseconds to complete, since it may require resetting and - * reconfiguring the image sensor and the camera processing pipeline. - * Nevertheless, the HAL device should attempt to minimize the - * reconfiguration delay to minimize the user-visible pauses during - * application operational mode changes (such as switching from still - * capture to video recording). - * - * Return values: - * - * 0: On successful stream configuration - * - * -EINVAL: If the requested stream configuration is invalid. Some examples - * of invalid stream configurations include: - * - * - Including more than 1 input-capable stream (INPUT or - * BIDIRECTIONAL) - * - * - Not including any output-capable streams (OUTPUT or - * BIDIRECTIONAL) - * - * - Including streams with unsupported formats, or an unsupported - * size for that format. - * - * - Including too many output streams of a certain format. - * - * Note that the framework submitting an invalid stream - * configuration is not normal operation, since stream - * configurations are checked before configure. An invalid - * configuration means that a bug exists in the framework code, or - * there is a mismatch between the HAL's static metadata and the - * requirements on streams. - * - * -ENODEV: If there has been a fatal error and the device is no longer - * operational. Only close() can be called successfully by the - * framework after this error is returned. - */ - int (*configure_streams)(const struct camera3_device *, - camera3_stream_configuration_t *stream_list); - - /** - * register_stream_buffers: - * - * Register buffers for a given stream with the HAL device. This method is - * called by the framework after a new stream is defined by - * configure_streams, and before buffers from that stream are included in a - * capture request. If the same stream is listed in a subsequent - * configure_streams() call, register_stream_buffers will _not_ be called - * again for that stream. - * - * The framework does not need to register buffers for all configured - * streams before it submits the first capture request. This allows quick - * startup for preview (or similar use cases) while other streams are still - * being allocated. - * - * This method is intended to allow the HAL device to map or otherwise - * prepare the buffers for later use. The buffers passed in will already be - * locked for use. At the end of the call, all the buffers must be ready to - * be returned to the stream. The buffer_set argument is only valid for the - * duration of this call. - * - * If the stream format was set to HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED, - * the camera HAL should inspect the passed-in buffers here to determine any - * platform-private pixel format information. - * - * Return values: - * - * 0: On successful registration of the new stream buffers - * - * -EINVAL: If the stream_buffer_set does not refer to a valid active - * stream, or if the buffers array is invalid. - * - * -ENOMEM: If there was a failure in registering the buffers. The framework - * must consider all the stream buffers to be unregistered, and can - * try to register again later. - * - * -ENODEV: If there is a fatal error, and the device is no longer - * operational. Only close() can be called successfully by the - * framework after this error is returned. - */ - int (*register_stream_buffers)(const struct camera3_device *, - const camera3_stream_buffer_set_t *buffer_set); - - /********************************************************************** - * Request creation and submission - */ - - /** - * construct_default_request_settings: - * - * Create capture settings for standard camera use cases. - * - * The device must return a settings buffer that is configured to meet the - * requested use case, which must be one of the CAMERA3_TEMPLATE_* - * enums. All request control fields must be included. - * - * The HAL retains ownership of this structure, but the pointer to the - * structure must be valid until the device is closed. The framework and the - * HAL may not modify the buffer once it is returned by this call. The same - * buffer may be returned for subsequent calls for the same template, or for - * other templates. - * - * Return values: - * - * Valid metadata: On successful creation of a default settings - * buffer. - * - * NULL: In case of a fatal error. After this is returned, only - * the close() method can be called successfully by the - * framework. - */ - const camera_metadata_t* (*construct_default_request_settings)( - const struct camera3_device *, - int type); - - /** - * process_capture_request: - * - * Send a new capture request to the HAL. The HAL should not return from - * this call until it is ready to accept the next request to process. Only - * one call to process_capture_request() will be made at a time by the - * framework, and the calls will all be from the same thread. The next call - * to process_capture_request() will be made as soon as a new request and - * its associated buffers are available. In a normal preview scenario, this - * means the function will be called again by the framework almost - * instantly. - * - * The actual request processing is asynchronous, with the results of - * capture being returned by the HAL through the process_capture_result() - * call. This call requires the result metadata to be available, but output - * buffers may simply provide sync fences to wait on. Multiple requests are - * expected to be in flight at once, to maintain full output frame rate. - * - * The framework retains ownership of the request structure. It is only - * guaranteed to be valid during this call. The HAL device must make copies - * of the information it needs to retain for the capture processing. The HAL - * is responsible for waiting on and closing the buffers' fences and - * returning the buffer handles to the framework. - * - * The HAL must write the file descriptor for the input buffer's release - * sync fence into input_buffer->release_fence, if input_buffer is not - * NULL. If the HAL returns -1 for the input buffer release sync fence, the - * framework is free to immediately reuse the input buffer. Otherwise, the - * framework will wait on the sync fence before refilling and reusing the - * input buffer. - * - * Return values: - * - * 0: On a successful start to processing the capture request - * - * -EINVAL: If the input is malformed (the settings are NULL when not - * allowed, there are 0 output buffers, etc) and capture processing - * cannot start. Failures during request processing should be - * handled by calling camera3_callback_ops_t.notify(). In case of - * this error, the framework will retain responsibility for the - * stream buffers' fences and the buffer handles; the HAL should - * not close the fences or return these buffers with - * process_capture_result. - * - * -ENODEV: If the camera device has encountered a serious error. After this - * error is returned, only the close() method can be successfully - * called by the framework. - * - */ - int (*process_capture_request)(const struct camera3_device *, - camera3_capture_request_t *request); - - /********************************************************************** - * Miscellaneous methods - */ - - /** - * get_metadata_vendor_tag_ops: - * - * Get methods to query for vendor extension metadata tag information. The - * HAL should fill in all the vendor tag operation methods, or leave ops - * unchanged if no vendor tags are defined. - * - * The definition of vendor_tag_query_ops_t can be found in - * system/media/camera/include/system/camera_metadata.h. - * - */ - void (*get_metadata_vendor_tag_ops)(const struct camera3_device*, - vendor_tag_query_ops_t* ops); - - /** - * dump: - * - * Print out debugging state for the camera device. This will be called by - * the framework when the camera service is asked for a debug dump, which - * happens when using the dumpsys tool, or when capturing a bugreport. - * - * The passed-in file descriptor can be used to write debugging text using - * dprintf() or write(). The text should be in ASCII encoding only. - */ - void (*dump)(const struct camera3_device *, int fd); - -} camera3_device_ops_t; - -/********************************************************************** - * - * Camera device definition - * - */ -typedef struct camera3_device { - /** - * common.version must equal CAMERA_DEVICE_API_VERSION_3_0 to identify this - * device as implementing version 3.0 of the camera device HAL. - */ - hw_device_t common; - camera3_device_ops_t *ops; - void *priv; -} camera3_device_t; - -__END_DECLS - -#endif /* #ifdef ANDROID_INCLUDE_CAMERA3_H */ diff --git a/external/android/include/18/hardware/libhardware/include/hardware/camera_common.h b/external/android/include/18/hardware/libhardware/include/hardware/camera_common.h deleted file mode 100644 index 62c5740..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/camera_common.h +++ /dev/null @@ -1,297 +0,0 @@ -/* - * Copyright (C) 2012 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. - */ - -// FIXME: add well-defined names for cameras - -#ifndef ANDROID_INCLUDE_CAMERA_COMMON_H -#define ANDROID_INCLUDE_CAMERA_COMMON_H - -#include -#include -#include -#include -#include -#include -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define CAMERA_HARDWARE_MODULE_ID "camera" - -/** - * Module versioning information for the Camera hardware module, based on - * camera_module_t.common.module_api_version. The two most significant hex - * digits represent the major version, and the two least significant represent - * the minor version. - * - ******************************************************************************* - * Versions: 0.X - 1.X [CAMERA_MODULE_API_VERSION_1_0] - * - * Camera modules that report these version numbers implement the initial - * camera module HAL interface. All camera devices openable through this - * module support only version 1 of the camera device HAL. The device_version - * and static_camera_characteristics fields of camera_info are not valid. Only - * the android.hardware.Camera API can be supported by this module and its - * devices. - * - ******************************************************************************* - * Version: 2.0 [CAMERA_MODULE_API_VERSION_2_0] - * - * Camera modules that report this version number implement the second version - * of the camera module HAL interface. Camera devices openable through this - * module may support either version 1.0 or version 2.0 of the camera device - * HAL interface. The device_version field of camera_info is always valid; the - * static_camera_characteristics field of camera_info is valid if the - * device_version field is 2.0 or higher. - * - ******************************************************************************* - * Version: 2.1 [CAMERA_MODULE_API_VERSION_2_1] - * - * This camera module version adds support for asynchronous callbacks to the - * framework from the camera HAL module, which is used to notify the framework - * about changes to the camera module state. Modules that provide a valid - * set_callbacks() method must report at least this version number. - */ - -/** - * Predefined macros for currently-defined version numbers - */ - -/** - * All module versions <= HARDWARE_MODULE_API_VERSION(1, 0xFF) must be treated - * as CAMERA_MODULE_API_VERSION_1_0 - */ -#define CAMERA_MODULE_API_VERSION_1_0 HARDWARE_MODULE_API_VERSION(1, 0) -#define CAMERA_MODULE_API_VERSION_2_0 HARDWARE_MODULE_API_VERSION(2, 0) -#define CAMERA_MODULE_API_VERSION_2_1 HARDWARE_MODULE_API_VERSION(2, 1) - -#define CAMERA_MODULE_API_VERSION_CURRENT CAMERA_MODULE_API_VERSION_2_1 - -/** - * All device versions <= HARDWARE_DEVICE_API_VERSION(1, 0xFF) must be treated - * as CAMERA_DEVICE_API_VERSION_1_0 - */ -#define CAMERA_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0) -#define CAMERA_DEVICE_API_VERSION_2_0 HARDWARE_DEVICE_API_VERSION(2, 0) -#define CAMERA_DEVICE_API_VERSION_2_1 HARDWARE_DEVICE_API_VERSION(2, 1) -#define CAMERA_DEVICE_API_VERSION_3_0 HARDWARE_DEVICE_API_VERSION(3, 0) - -// Device version 2.x is outdated; device version 3.0 is experimental -#define CAMERA_DEVICE_API_VERSION_CURRENT CAMERA_DEVICE_API_VERSION_1_0 - -/** - * Defined in /system/media/camera/include/system/camera_metadata.h - */ -typedef struct camera_metadata camera_metadata_t; - -typedef struct camera_info { - /** - * The direction that the camera faces to. It should be CAMERA_FACING_BACK - * or CAMERA_FACING_FRONT. - * - * Version information: - * Valid in all camera_module versions - */ - int facing; - - /** - * The orientation of the camera image. The value is the angle that the - * camera image needs to be rotated clockwise so it shows correctly on the - * display in its natural orientation. It should be 0, 90, 180, or 270. - * - * For example, suppose a device has a naturally tall screen. The - * back-facing camera sensor is mounted in landscape. You are looking at the - * screen. If the top side of the camera sensor is aligned with the right - * edge of the screen in natural orientation, the value should be 90. If the - * top side of a front-facing camera sensor is aligned with the right of the - * screen, the value should be 270. - * - * Version information: - * Valid in all camera_module versions - */ - int orientation; - - /** - * The value of camera_device_t.common.version. - * - * Version information (based on camera_module_t.common.module_api_version): - * - * CAMERA_MODULE_API_VERSION_1_0: - * - * Not valid. Can be assumed to be CAMERA_DEVICE_API_VERSION_1_0. Do - * not read this field. - * - * CAMERA_MODULE_API_VERSION_2_0 or higher: - * - * Always valid - * - */ - uint32_t device_version; - - /** - * The camera's fixed characteristics, which include all camera metadata in - * the android.*.info.* sections. This should be a sorted metadata buffer, - * and may not be modified or freed by the caller. The pointer should remain - * valid for the lifetime of the camera module, and values in it may not - * change after it is returned by get_camera_info(). - * - * Version information (based on camera_module_t.common.module_api_version): - * - * CAMERA_MODULE_API_VERSION_1_0: - * - * Not valid. Extra characteristics are not available. Do not read this - * field. - * - * CAMERA_MODULE_API_VERSION_2_0 or higher: - * - * Valid if device_version >= CAMERA_DEVICE_API_VERSION_2_0. Do not read - * otherwise. - * - */ - const camera_metadata_t *static_camera_characteristics; -} camera_info_t; - -/** - * camera_device_status_t: - * - * The current status of the camera device, as provided by the HAL through the - * camera_module_callbacks.camera_device_status_change() call. - * - * At module load time, the framework will assume all camera devices are in the - * CAMERA_DEVICE_STATUS_PRESENT state. The HAL should invoke - * camera_module_callbacks::camera_device_status_change to inform the framework - * of any initially NOT_PRESENT devices. - * - * Allowed transitions: - * PRESENT -> NOT_PRESENT - * NOT_PRESENT -> ENUMERATING - * NOT_PRESENT -> PRESENT - * ENUMERATING -> PRESENT - * ENUMERATING -> NOT_PRESENT - */ -typedef enum camera_device_status { - /** - * The camera device is not currently connected, and opening it will return - * failure. Calls to get_camera_info must still succeed, and provide the - * same information it would if the camera were connected - */ - CAMERA_DEVICE_STATUS_NOT_PRESENT = 0, - - /** - * The camera device is connected, and opening it will succeed. The - * information returned by get_camera_info cannot change due to this status - * change. By default, the framework will assume all devices are in this - * state. - */ - CAMERA_DEVICE_STATUS_PRESENT = 1, - - /** - * The camera device is connected, but it is undergoing an enumeration and - * so opening the device will return -EBUSY. Calls to get_camera_info - * must still succeed, as if the camera was in the PRESENT status. - */ - CAMERA_DEVICE_STATUS_ENUMERATING = 2, - -} camera_device_status_t; - -/** - * Callback functions for the camera HAL module to use to inform the framework - * of changes to the camera subsystem. These are called only by HAL modules - * implementing version CAMERA_MODULE_API_VERSION_2_1 or higher of the HAL - * module API interface. - */ -typedef struct camera_module_callbacks { - - /** - * camera_device_status_change: - * - * Callback to the framework to indicate that the state of a specific camera - * device has changed. At module load time, the framework will assume all - * camera devices are in the CAMERA_DEVICE_STATUS_PRESENT state. The HAL - * must call this method to inform the framework of any initially - * NOT_PRESENT devices. - * - * camera_module_callbacks: The instance of camera_module_callbacks_t passed - * to the module with set_callbacks. - * - * camera_id: The ID of the camera device that has a new status. - * - * new_status: The new status code, one of the camera_device_status_t enums, - * or a platform-specific status. - * - */ - void (*camera_device_status_change)(const struct camera_module_callbacks*, - int camera_id, - int new_status); - -} camera_module_callbacks_t; - -typedef struct camera_module { - hw_module_t common; - - /** - * get_number_of_cameras: - * - * Returns the number of camera devices accessible through the camera - * module. The camera devices are numbered 0 through N-1, where N is the - * value returned by this call. The name of the camera device for open() is - * simply the number converted to a string. That is, "0" for camera ID 0, - * "1" for camera ID 1. - * - * The value here must be static, and cannot change after the first call to - * this method - */ - int (*get_number_of_cameras)(void); - - /** - * get_camera_info: - * - * Return the static camera information for a given camera device. This - * information may not change for a camera device. - * - */ - int (*get_camera_info)(int camera_id, struct camera_info *info); - - /** - * set_callbacks: - * - * Provide callback function pointers to the HAL module to inform framework - * of asynchronous camera module events. The framework will call this - * function once after initial camera HAL module load, after the - * get_number_of_cameras() method is called for the first time, and before - * any other calls to the module. - * - * Version information (based on camera_module_t.common.module_api_version): - * - * CAMERA_MODULE_API_VERSION_1_0, CAMERA_MODULE_API_VERSION_2_0: - * - * Not provided by HAL module. Framework may not call this function. - * - * CAMERA_MODULE_API_VERSION_2_1: - * - * Valid to be called by the framework. - * - */ - int (*set_callbacks)(const camera_module_callbacks_t *callbacks); - -} camera_module_t; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_CAMERA_COMMON_H */ diff --git a/external/android/include/18/hardware/libhardware/include/hardware/fb.h b/external/android/include/18/hardware/libhardware/include/hardware/fb.h deleted file mode 100644 index 135e4aa..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/fb.h +++ /dev/null @@ -1,167 +0,0 @@ -/* - * 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. - */ - - -#ifndef ANDROID_FB_INTERFACE_H -#define ANDROID_FB_INTERFACE_H - -#include -#include -#include - -#include - -#include - -__BEGIN_DECLS - -#define GRALLOC_HARDWARE_FB0 "fb0" - -/*****************************************************************************/ - - -/*****************************************************************************/ - -typedef struct framebuffer_device_t { - struct hw_device_t common; - - /* flags describing some attributes of the framebuffer */ - const uint32_t flags; - - /* dimensions of the framebuffer in pixels */ - const uint32_t width; - const uint32_t height; - - /* frambuffer stride in pixels */ - const int stride; - - /* framebuffer pixel format */ - const int format; - - /* resolution of the framebuffer's display panel in pixel per inch*/ - const float xdpi; - const float ydpi; - - /* framebuffer's display panel refresh rate in frames per second */ - const float fps; - - /* min swap interval supported by this framebuffer */ - const int minSwapInterval; - - /* max swap interval supported by this framebuffer */ - const int maxSwapInterval; - - /* Number of framebuffers supported*/ - const int numFramebuffers; - - int reserved[7]; - - /* - * requests a specific swap-interval (same definition than EGL) - * - * Returns 0 on success or -errno on error. - */ - int (*setSwapInterval)(struct framebuffer_device_t* window, - int interval); - - /* - * This hook is OPTIONAL. - * - * It is non NULL If the framebuffer driver supports "update-on-demand" - * and the given rectangle is the area of the screen that gets - * updated during (*post)(). - * - * This is useful on devices that are able to DMA only a portion of - * the screen to the display panel, upon demand -- as opposed to - * constantly refreshing the panel 60 times per second, for instance. - * - * Only the area defined by this rectangle is guaranteed to be valid, that - * is, the driver is not allowed to post anything outside of this - * rectangle. - * - * The rectangle evaluated during (*post)() and specifies which area - * of the buffer passed in (*post)() shall to be posted. - * - * return -EINVAL if width or height <=0, or if left or top < 0 - */ - int (*setUpdateRect)(struct framebuffer_device_t* window, - int left, int top, int width, int height); - - /* - * Post to the display (display it on the screen) - * The buffer must have been allocated with the - * GRALLOC_USAGE_HW_FB usage flag. - * buffer must be the same width and height as the display and must NOT - * be locked. - * - * The buffer is shown during the next VSYNC. - * - * If the same buffer is posted again (possibly after some other buffer), - * post() will block until the the first post is completed. - * - * Internally, post() is expected to lock the buffer so that a - * subsequent call to gralloc_module_t::(*lock)() with USAGE_RENDER or - * USAGE_*_WRITE will block until it is safe; that is typically once this - * buffer is shown and another buffer has been posted. - * - * Returns 0 on success or -errno on error. - */ - int (*post)(struct framebuffer_device_t* dev, buffer_handle_t buffer); - - - /* - * The (*compositionComplete)() method must be called after the - * compositor has finished issuing GL commands for client buffers. - */ - - int (*compositionComplete)(struct framebuffer_device_t* dev); - - /* - * This hook is OPTIONAL. - * - * If non NULL it will be caused by SurfaceFlinger on dumpsys - */ - void (*dump)(struct framebuffer_device_t* dev, char *buff, int buff_len); - - /* - * (*enableScreen)() is used to either blank (enable=0) or - * unblank (enable=1) the screen this framebuffer is attached to. - * - * Returns 0 on success or -errno on error. - */ - int (*enableScreen)(struct framebuffer_device_t* dev, int enable); - - void* reserved_proc[6]; - -} framebuffer_device_t; - - -/** convenience API for opening and closing a supported device */ - -static inline int framebuffer_open(const struct hw_module_t* module, - struct framebuffer_device_t** device) { - return module->methods->open(module, - GRALLOC_HARDWARE_FB0, (struct hw_device_t**)device); -} - -static inline int framebuffer_close(struct framebuffer_device_t* device) { - return device->common.close(&device->common); -} - - -__END_DECLS - -#endif // ANDROID_FB_INTERFACE_H diff --git a/external/android/include/18/hardware/libhardware/include/hardware/gps.h b/external/android/include/18/hardware/libhardware/include/hardware/gps.h deleted file mode 100644 index 458b5b4..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/gps.h +++ /dev/null @@ -1,939 +0,0 @@ -/* - * Copyright (C) 2010 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_INCLUDE_HARDWARE_GPS_H -#define ANDROID_INCLUDE_HARDWARE_GPS_H - -#include -#include -#include -#include - -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define GPS_HARDWARE_MODULE_ID "gps" - - -/** Milliseconds since January 1, 1970 */ -typedef int64_t GpsUtcTime; - -/** Maximum number of SVs for gps_sv_status_callback(). */ -#define GPS_MAX_SVS 32 - -/** Requested operational mode for GPS operation. */ -typedef uint32_t GpsPositionMode; -// IMPORTANT: Note that the following values must match -// constants in GpsLocationProvider.java. -/** Mode for running GPS standalone (no assistance). */ -#define GPS_POSITION_MODE_STANDALONE 0 -/** AGPS MS-Based mode. */ -#define GPS_POSITION_MODE_MS_BASED 1 -/** AGPS MS-Assisted mode. */ -#define GPS_POSITION_MODE_MS_ASSISTED 2 - -/** Requested recurrence mode for GPS operation. */ -typedef uint32_t GpsPositionRecurrence; -// IMPORTANT: Note that the following values must match -// constants in GpsLocationProvider.java. -/** Receive GPS fixes on a recurring basis at a specified period. */ -#define GPS_POSITION_RECURRENCE_PERIODIC 0 -/** Request a single shot GPS fix. */ -#define GPS_POSITION_RECURRENCE_SINGLE 1 - -/** GPS status event values. */ -typedef uint16_t GpsStatusValue; -// IMPORTANT: Note that the following values must match -// constants in GpsLocationProvider.java. -/** GPS status unknown. */ -#define GPS_STATUS_NONE 0 -/** GPS has begun navigating. */ -#define GPS_STATUS_SESSION_BEGIN 1 -/** GPS has stopped navigating. */ -#define GPS_STATUS_SESSION_END 2 -/** GPS has powered on but is not navigating. */ -#define GPS_STATUS_ENGINE_ON 3 -/** GPS is powered off. */ -#define GPS_STATUS_ENGINE_OFF 4 - -/** Flags to indicate which values are valid in a GpsLocation. */ -typedef uint16_t GpsLocationFlags; -// IMPORTANT: Note that the following values must match -// constants in GpsLocationProvider.java. -/** GpsLocation has valid latitude and longitude. */ -#define GPS_LOCATION_HAS_LAT_LONG 0x0001 -/** GpsLocation has valid altitude. */ -#define GPS_LOCATION_HAS_ALTITUDE 0x0002 -/** GpsLocation has valid speed. */ -#define GPS_LOCATION_HAS_SPEED 0x0004 -/** GpsLocation has valid bearing. */ -#define GPS_LOCATION_HAS_BEARING 0x0008 -/** GpsLocation has valid accuracy. */ -#define GPS_LOCATION_HAS_ACCURACY 0x0010 - -/** Flags for the gps_set_capabilities callback. */ - -/** GPS HAL schedules fixes for GPS_POSITION_RECURRENCE_PERIODIC mode. - If this is not set, then the framework will use 1000ms for min_interval - and will start and call start() and stop() to schedule the GPS. - */ -#define GPS_CAPABILITY_SCHEDULING 0x0000001 -/** GPS supports MS-Based AGPS mode */ -#define GPS_CAPABILITY_MSB 0x0000002 -/** GPS supports MS-Assisted AGPS mode */ -#define GPS_CAPABILITY_MSA 0x0000004 -/** GPS supports single-shot fixes */ -#define GPS_CAPABILITY_SINGLE_SHOT 0x0000008 -/** GPS supports on demand time injection */ -#define GPS_CAPABILITY_ON_DEMAND_TIME 0x0000010 -/** GPS supports Geofencing */ -#define GPS_CAPABILITY_GEOFENCING 0x0000020 - -/** Flags used to specify which aiding data to delete - when calling delete_aiding_data(). */ -typedef uint16_t GpsAidingData; -// IMPORTANT: Note that the following values must match -// constants in GpsLocationProvider.java. -#define GPS_DELETE_EPHEMERIS 0x0001 -#define GPS_DELETE_ALMANAC 0x0002 -#define GPS_DELETE_POSITION 0x0004 -#define GPS_DELETE_TIME 0x0008 -#define GPS_DELETE_IONO 0x0010 -#define GPS_DELETE_UTC 0x0020 -#define GPS_DELETE_HEALTH 0x0040 -#define GPS_DELETE_SVDIR 0x0080 -#define GPS_DELETE_SVSTEER 0x0100 -#define GPS_DELETE_SADATA 0x0200 -#define GPS_DELETE_RTI 0x0400 -#define GPS_DELETE_CELLDB_INFO 0x8000 -#define GPS_DELETE_ALL 0xFFFF - -/** AGPS type */ -typedef uint16_t AGpsType; -#define AGPS_TYPE_SUPL 1 -#define AGPS_TYPE_C2K 2 - -typedef uint16_t AGpsSetIDType; -#define AGPS_SETID_TYPE_NONE 0 -#define AGPS_SETID_TYPE_IMSI 1 -#define AGPS_SETID_TYPE_MSISDN 2 - -/** - * String length constants - */ -#define GPS_NI_SHORT_STRING_MAXLEN 256 -#define GPS_NI_LONG_STRING_MAXLEN 2048 - -/** - * GpsNiType constants - */ -typedef uint32_t GpsNiType; -#define GPS_NI_TYPE_VOICE 1 -#define GPS_NI_TYPE_UMTS_SUPL 2 -#define GPS_NI_TYPE_UMTS_CTRL_PLANE 3 - -/** - * GpsNiNotifyFlags constants - */ -typedef uint32_t GpsNiNotifyFlags; -/** NI requires notification */ -#define GPS_NI_NEED_NOTIFY 0x0001 -/** NI requires verification */ -#define GPS_NI_NEED_VERIFY 0x0002 -/** NI requires privacy override, no notification/minimal trace */ -#define GPS_NI_PRIVACY_OVERRIDE 0x0004 - -/** - * GPS NI responses, used to define the response in - * NI structures - */ -typedef int GpsUserResponseType; -#define GPS_NI_RESPONSE_ACCEPT 1 -#define GPS_NI_RESPONSE_DENY 2 -#define GPS_NI_RESPONSE_NORESP 3 - -/** - * NI data encoding scheme - */ -typedef int GpsNiEncodingType; -#define GPS_ENC_NONE 0 -#define GPS_ENC_SUPL_GSM_DEFAULT 1 -#define GPS_ENC_SUPL_UTF8 2 -#define GPS_ENC_SUPL_UCS2 3 -#define GPS_ENC_UNKNOWN -1 - -/** AGPS status event values. */ -typedef uint16_t AGpsStatusValue; -/** GPS requests data connection for AGPS. */ -#define GPS_REQUEST_AGPS_DATA_CONN 1 -/** GPS releases the AGPS data connection. */ -#define GPS_RELEASE_AGPS_DATA_CONN 2 -/** AGPS data connection initiated */ -#define GPS_AGPS_DATA_CONNECTED 3 -/** AGPS data connection completed */ -#define GPS_AGPS_DATA_CONN_DONE 4 -/** AGPS data connection failed */ -#define GPS_AGPS_DATA_CONN_FAILED 5 - -#define AGPS_REF_LOCATION_TYPE_GSM_CELLID 1 -#define AGPS_REF_LOCATION_TYPE_UMTS_CELLID 2 -#define AGPS_REG_LOCATION_TYPE_MAC 3 - -/** Network types for update_network_state "type" parameter */ -#define AGPS_RIL_NETWORK_TYPE_MOBILE 0 -#define AGPS_RIL_NETWORK_TYPE_WIFI 1 -#define AGPS_RIL_NETWORK_TYPE_MOBILE_MMS 2 -#define AGPS_RIL_NETWORK_TYPE_MOBILE_SUPL 3 -#define AGPS_RIL_NETWORK_TTYPE_MOBILE_DUN 4 -#define AGPS_RIL_NETWORK_TTYPE_MOBILE_HIPRI 5 -#define AGPS_RIL_NETWORK_TTYPE_WIMAX 6 - -/** - * Name for the GPS XTRA interface. - */ -#define GPS_XTRA_INTERFACE "gps-xtra" - -/** - * Name for the GPS DEBUG interface. - */ -#define GPS_DEBUG_INTERFACE "gps-debug" - -/** - * Name for the AGPS interface. - */ -#define AGPS_INTERFACE "agps" - -/** - * Name for NI interface - */ -#define GPS_NI_INTERFACE "gps-ni" - -/** - * Name for the AGPS-RIL interface. - */ -#define AGPS_RIL_INTERFACE "agps_ril" - -/** - * Name for the GPS_Geofencing interface. - */ -#define GPS_GEOFENCING_INTERFACE "gps_geofencing" - - -/** Represents a location. */ -typedef struct { - /** set to sizeof(GpsLocation) */ - size_t size; - /** Contains GpsLocationFlags bits. */ - uint16_t flags; - /** Represents latitude in degrees. */ - double latitude; - /** Represents longitude in degrees. */ - double longitude; - /** Represents altitude in meters above the WGS 84 reference - * ellipsoid. */ - double altitude; - /** Represents speed in meters per second. */ - float speed; - /** Represents heading in degrees. */ - float bearing; - /** Represents expected accuracy in meters. */ - float accuracy; - /** Timestamp for the location fix. */ - GpsUtcTime timestamp; -} GpsLocation; - -/** Represents the status. */ -typedef struct { - /** set to sizeof(GpsStatus) */ - size_t size; - GpsStatusValue status; -} GpsStatus; - -/** Represents SV information. */ -typedef struct { - /** set to sizeof(GpsSvInfo) */ - size_t size; - /** Pseudo-random number for the SV. */ - int prn; - /** Signal to noise ratio. */ - float snr; - /** Elevation of SV in degrees. */ - float elevation; - /** Azimuth of SV in degrees. */ - float azimuth; -} GpsSvInfo; - -/** Represents SV status. */ -typedef struct { - /** set to sizeof(GpsSvStatus) */ - size_t size; - - /** Number of SVs currently visible. */ - int num_svs; - - /** Contains an array of SV information. */ - GpsSvInfo sv_list[GPS_MAX_SVS]; - - /** Represents a bit mask indicating which SVs - * have ephemeris data. - */ - uint32_t ephemeris_mask; - - /** Represents a bit mask indicating which SVs - * have almanac data. - */ - uint32_t almanac_mask; - - /** - * Represents a bit mask indicating which SVs - * were used for computing the most recent position fix. - */ - uint32_t used_in_fix_mask; -} GpsSvStatus; - -/* 2G and 3G */ -/* In 3G lac is discarded */ -typedef struct { - uint16_t type; - uint16_t mcc; - uint16_t mnc; - uint16_t lac; - uint32_t cid; -} AGpsRefLocationCellID; - -typedef struct { - uint8_t mac[6]; -} AGpsRefLocationMac; - -/** Represents ref locations */ -typedef struct { - uint16_t type; - union { - AGpsRefLocationCellID cellID; - AGpsRefLocationMac mac; - } u; -} AGpsRefLocation; - -/** Callback with location information. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* gps_location_callback)(GpsLocation* location); - -/** Callback with status information. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* gps_status_callback)(GpsStatus* status); - -/** Callback with SV status information. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* gps_sv_status_callback)(GpsSvStatus* sv_info); - -/** Callback for reporting NMEA sentences. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* gps_nmea_callback)(GpsUtcTime timestamp, const char* nmea, int length); - -/** Callback to inform framework of the GPS engine's capabilities. - * Capability parameter is a bit field of GPS_CAPABILITY_* flags. - */ -typedef void (* gps_set_capabilities)(uint32_t capabilities); - -/** Callback utility for acquiring the GPS wakelock. - * This can be used to prevent the CPU from suspending while handling GPS events. - */ -typedef void (* gps_acquire_wakelock)(); - -/** Callback utility for releasing the GPS wakelock. */ -typedef void (* gps_release_wakelock)(); - -/** Callback for requesting NTP time */ -typedef void (* gps_request_utc_time)(); - -/** Callback for creating a thread that can call into the Java framework code. - * This must be used to create any threads that report events up to the framework. - */ -typedef pthread_t (* gps_create_thread)(const char* name, void (*start)(void *), void* arg); - -/** GPS callback structure. */ -typedef struct { - /** set to sizeof(GpsCallbacks) */ - size_t size; - gps_location_callback location_cb; - gps_status_callback status_cb; - gps_sv_status_callback sv_status_cb; - gps_nmea_callback nmea_cb; - gps_set_capabilities set_capabilities_cb; - gps_acquire_wakelock acquire_wakelock_cb; - gps_release_wakelock release_wakelock_cb; - gps_create_thread create_thread_cb; - gps_request_utc_time request_utc_time_cb; -} GpsCallbacks; - - -/** Represents the standard GPS interface. */ -typedef struct { - /** set to sizeof(GpsInterface) */ - size_t size; - /** - * Opens the interface and provides the callback routines - * to the implemenation of this interface. - */ - int (*init)( GpsCallbacks* callbacks ); - - /** Starts navigating. */ - int (*start)( void ); - - /** Stops navigating. */ - int (*stop)( void ); - - /** Closes the interface. */ - void (*cleanup)( void ); - - /** Injects the current time. */ - int (*inject_time)(GpsUtcTime time, int64_t timeReference, - int uncertainty); - - /** Injects current location from another location provider - * (typically cell ID). - * latitude and longitude are measured in degrees - * expected accuracy is measured in meters - */ - int (*inject_location)(double latitude, double longitude, float accuracy); - - /** - * Specifies that the next call to start will not use the - * information defined in the flags. GPS_DELETE_ALL is passed for - * a cold start. - */ - void (*delete_aiding_data)(GpsAidingData flags); - - /** - * min_interval represents the time between fixes in milliseconds. - * preferred_accuracy represents the requested fix accuracy in meters. - * preferred_time represents the requested time to first fix in milliseconds. - */ - int (*set_position_mode)(GpsPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time); - - /** Get a pointer to extension information. */ - const void* (*get_extension)(const char* name); -} GpsInterface; - -/** Callback to request the client to download XTRA data. - * The client should download XTRA data and inject it by calling inject_xtra_data(). - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* gps_xtra_download_request)(); - -/** Callback structure for the XTRA interface. */ -typedef struct { - gps_xtra_download_request download_request_cb; - gps_create_thread create_thread_cb; -} GpsXtraCallbacks; - -/** Extended interface for XTRA support. */ -typedef struct { - /** set to sizeof(GpsXtraInterface) */ - size_t size; - /** - * Opens the XTRA interface and provides the callback routines - * to the implemenation of this interface. - */ - int (*init)( GpsXtraCallbacks* callbacks ); - /** Injects XTRA data into the GPS. */ - int (*inject_xtra_data)( char* data, int length ); -} GpsXtraInterface; - -/** Extended interface for DEBUG support. */ -typedef struct { - /** set to sizeof(GpsDebugInterface) */ - size_t size; - - /** - * This function should return any information that the native - * implementation wishes to include in a bugreport. - */ - size_t (*get_internal_state)(char* buffer, size_t bufferSize); -} GpsDebugInterface; - -/** Represents the status of AGPS. */ -typedef struct { - /** set to sizeof(AGpsStatus) */ - size_t size; - - AGpsType type; - AGpsStatusValue status; - uint32_t ipaddr; -} AGpsStatus; - -/** Callback with AGPS status information. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* agps_status_callback)(AGpsStatus* status); - -/** Callback structure for the AGPS interface. */ -typedef struct { - agps_status_callback status_cb; - gps_create_thread create_thread_cb; -} AGpsCallbacks; - - -/** Extended interface for AGPS support. */ -typedef struct { - /** set to sizeof(AGpsInterface) */ - size_t size; - - /** - * Opens the AGPS interface and provides the callback routines - * to the implemenation of this interface. - */ - void (*init)( AGpsCallbacks* callbacks ); - /** - * Notifies that a data connection is available and sets - * the name of the APN to be used for SUPL. - */ - int (*data_conn_open)( const char* apn ); - /** - * Notifies that the AGPS data connection has been closed. - */ - int (*data_conn_closed)(); - /** - * Notifies that a data connection is not available for AGPS. - */ - int (*data_conn_failed)(); - /** - * Sets the hostname and port for the AGPS server. - */ - int (*set_server)( AGpsType type, const char* hostname, int port ); -} AGpsInterface; - - -/** Represents an NI request */ -typedef struct { - /** set to sizeof(GpsNiNotification) */ - size_t size; - - /** - * An ID generated by HAL to associate NI notifications and UI - * responses - */ - int notification_id; - - /** - * An NI type used to distinguish different categories of NI - * events, such as GPS_NI_TYPE_VOICE, GPS_NI_TYPE_UMTS_SUPL, ... - */ - GpsNiType ni_type; - - /** - * Notification/verification options, combinations of GpsNiNotifyFlags constants - */ - GpsNiNotifyFlags notify_flags; - - /** - * Timeout period to wait for user response. - * Set to 0 for no time out limit. - */ - int timeout; - - /** - * Default response when time out. - */ - GpsUserResponseType default_response; - - /** - * Requestor ID - */ - char requestor_id[GPS_NI_SHORT_STRING_MAXLEN]; - - /** - * Notification message. It can also be used to store client_id in some cases - */ - char text[GPS_NI_LONG_STRING_MAXLEN]; - - /** - * Client name decoding scheme - */ - GpsNiEncodingType requestor_id_encoding; - - /** - * Client name decoding scheme - */ - GpsNiEncodingType text_encoding; - - /** - * A pointer to extra data. Format: - * key_1 = value_1 - * key_2 = value_2 - */ - char extras[GPS_NI_LONG_STRING_MAXLEN]; - -} GpsNiNotification; - -/** Callback with NI notification. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (*gps_ni_notify_callback)(GpsNiNotification *notification); - -/** GPS NI callback structure. */ -typedef struct -{ - /** - * Sends the notification request from HAL to GPSLocationProvider. - */ - gps_ni_notify_callback notify_cb; - gps_create_thread create_thread_cb; -} GpsNiCallbacks; - -/** - * Extended interface for Network-initiated (NI) support. - */ -typedef struct -{ - /** set to sizeof(GpsNiInterface) */ - size_t size; - - /** Registers the callbacks for HAL to use. */ - void (*init) (GpsNiCallbacks *callbacks); - - /** Sends a response to HAL. */ - void (*respond) (int notif_id, GpsUserResponseType user_response); -} GpsNiInterface; - -struct gps_device_t { - struct hw_device_t common; - - /** - * Set the provided lights to the provided values. - * - * Returns: 0 on succes, error code on failure. - */ - const GpsInterface* (*get_gps_interface)(struct gps_device_t* dev); -}; - -#define AGPS_RIL_REQUEST_SETID_IMSI (1<<0L) -#define AGPS_RIL_REQUEST_SETID_MSISDN (1<<1L) - -#define AGPS_RIL_REQUEST_REFLOC_CELLID (1<<0L) -#define AGPS_RIL_REQUEST_REFLOC_MAC (1<<1L) - -typedef void (*agps_ril_request_set_id)(uint32_t flags); -typedef void (*agps_ril_request_ref_loc)(uint32_t flags); - -typedef struct { - agps_ril_request_set_id request_setid; - agps_ril_request_ref_loc request_refloc; - gps_create_thread create_thread_cb; -} AGpsRilCallbacks; - -/** Extended interface for AGPS_RIL support. */ -typedef struct { - /** set to sizeof(AGpsRilInterface) */ - size_t size; - /** - * Opens the AGPS interface and provides the callback routines - * to the implemenation of this interface. - */ - void (*init)( AGpsRilCallbacks* callbacks ); - - /** - * Sets the reference location. - */ - void (*set_ref_location) (const AGpsRefLocation *agps_reflocation, size_t sz_struct); - /** - * Sets the set ID. - */ - void (*set_set_id) (AGpsSetIDType type, const char* setid); - - /** - * Send network initiated message. - */ - void (*ni_message) (uint8_t *msg, size_t len); - - /** - * Notify GPS of network status changes. - * These parameters match values in the android.net.NetworkInfo class. - */ - void (*update_network_state) (int connected, int type, int roaming, const char* extra_info); - - /** - * Notify GPS of network status changes. - * These parameters match values in the android.net.NetworkInfo class. - */ - void (*update_network_availability) (int avaiable, const char* apn); -} AGpsRilInterface; - -/** - * GPS Geofence. - * There are 3 states associated with a Geofence: Inside, Outside, Unknown. - * There are 3 transitions: ENTERED, EXITED, UNCERTAIN. - * - * An example state diagram with confidence level: 95% and Unknown time limit - * set as 30 secs is shown below. (confidence level and Unknown time limit are - * explained latter) - * ____________________________ - * | Unknown (30 secs) | - * """""""""""""""""""""""""""" - * ^ | | ^ - * UNCERTAIN| |ENTERED EXITED| |UNCERTAIN - * | v v | - * ________ EXITED _________ - * | Inside | -----------> | Outside | - * | | <----------- | | - * """""""" ENTERED """"""""" - * - * Inside state: We are 95% confident that the user is inside the geofence. - * Outside state: We are 95% confident that the user is outside the geofence - * Unknown state: Rest of the time. - * - * The Unknown state is better explained with an example: - * - * __________ - * | c| - * | ___ | _______ - * | |a| | | b | - * | """ | """"""" - * | | - * """""""""" - * In the diagram above, "a" and "b" are 2 geofences and "c" is the accuracy - * circle reported by the GPS subsystem. Now with regard to "b", the system is - * confident that the user is outside. But with regard to "a" is not confident - * whether it is inside or outside the geofence. If the accuracy remains the - * same for a sufficient period of time, the UNCERTAIN transition would be - * triggered with the state set to Unknown. If the accuracy improves later, an - * appropriate transition should be triggered. This "sufficient period of time" - * is defined by the parameter in the add_geofence_area API. - * In other words, Unknown state can be interpreted as a state in which the - * GPS subsystem isn't confident enough that the user is either inside or - * outside the Geofence. It moves to Unknown state only after the expiry of the - * timeout. - * - * The geofence callback needs to be triggered for the ENTERED and EXITED - * transitions, when the GPS system is confident that the user has entered - * (Inside state) or exited (Outside state) the Geofence. An implementation - * which uses a value of 95% as the confidence is recommended. The callback - * should be triggered only for the transitions requested by the - * add_geofence_area call. - * - * Even though the diagram and explanation talks about states and transitions, - * the callee is only interested in the transistions. The states are mentioned - * here for illustrative purposes. - * - * Startup Scenario: When the device boots up, if an application adds geofences, - * and then we get an accurate GPS location fix, it needs to trigger the - * appropriate (ENTERED or EXITED) transition for every Geofence it knows about. - * By default, all the Geofences will be in the Unknown state. - * - * When the GPS system is unavailable, gps_geofence_status_callback should be - * called to inform the upper layers of the same. Similarly, when it becomes - * available the callback should be called. This is a global state while the - * UNKNOWN transition described above is per geofence. - * - * An important aspect to note is that users of this API (framework), will use - * other subsystems like wifi, sensors, cell to handle Unknown case and - * hopefully provide a definitive state transition to the third party - * application. GPS Geofence will just be a signal indicating what the GPS - * subsystem knows about the Geofence. - * - */ -#define GPS_GEOFENCE_ENTERED (1<<0L) -#define GPS_GEOFENCE_EXITED (1<<1L) -#define GPS_GEOFENCE_UNCERTAIN (1<<2L) - -#define GPS_GEOFENCE_UNAVAILABLE (1<<0L) -#define GPS_GEOFENCE_AVAILABLE (1<<1L) - -#define GPS_GEOFENCE_OPERATION_SUCCESS 0 -#define GPS_GEOFENCE_ERROR_TOO_MANY_GEOFENCES -100 -#define GPS_GEOFENCE_ERROR_ID_EXISTS -101 -#define GPS_GEOFENCE_ERROR_ID_UNKNOWN -102 -#define GPS_GEOFENCE_ERROR_INVALID_TRANSITION -103 -#define GPS_GEOFENCE_ERROR_GENERIC -149 - -/** - * The callback associated with the geofence. - * Parameters: - * geofence_id - The id associated with the add_geofence_area. - * location - The current GPS location. - * transition - Can be one of GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED, - * GPS_GEOFENCE_UNCERTAIN. - * timestamp - Timestamp when the transition was detected. - * - * The callback should only be called when the caller is interested in that - * particular transition. For instance, if the caller is interested only in - * ENTERED transition, then the callback should NOT be called with the EXITED - * transition. - * - * IMPORTANT: If a transition is triggered resulting in this callback, the GPS - * subsystem will wake up the application processor, if its in suspend state. - */ -typedef void (*gps_geofence_transition_callback) (int32_t geofence_id, GpsLocation* location, - int32_t transition, GpsUtcTime timestamp); - -/** - * The callback associated with the availablity of the GPS system for geofencing - * monitoring. If the GPS system determines that it cannot monitor geofences - * because of lack of reliability or unavailability of the GPS signals, it will - * call this callback with GPS_GEOFENCE_UNAVAILABLE parameter. - * - * Parameters: - * status - GPS_GEOFENCE_UNAVAILABLE or GPS_GEOFENCE_AVAILABLE. - * last_location - Last known location. - */ -typedef void (*gps_geofence_status_callback) (int32_t status, GpsLocation* last_location); - -/** - * The callback associated with the add_geofence call. - * - * Parameter: - * geofence_id - Id of the geofence. - * status - GPS_GEOFENCE_OPERATION_SUCCESS - * GPS_GEOFENCE_ERROR_TOO_MANY_GEOFENCES - geofence limit has been reached. - * GPS_GEOFENCE_ERROR_ID_EXISTS - geofence with id already exists - * GPS_GEOFENCE_ERROR_INVALID_TRANSITION - the monitorTransition contains an - * invalid transition - * GPS_GEOFENCE_ERROR_GENERIC - for other errors. - */ -typedef void (*gps_geofence_add_callback) (int32_t geofence_id, int32_t status); - -/** - * The callback associated with the remove_geofence call. - * - * Parameter: - * geofence_id - Id of the geofence. - * status - GPS_GEOFENCE_OPERATION_SUCCESS - * GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id - * GPS_GEOFENCE_ERROR_GENERIC for others. - */ -typedef void (*gps_geofence_remove_callback) (int32_t geofence_id, int32_t status); - - -/** - * The callback associated with the pause_geofence call. - * - * Parameter: - * geofence_id - Id of the geofence. - * status - GPS_GEOFENCE_OPERATION_SUCCESS - * GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id - * GPS_GEOFENCE_ERROR_INVALID_TRANSITION - - * when monitor_transitions is invalid - * GPS_GEOFENCE_ERROR_GENERIC for others. - */ -typedef void (*gps_geofence_pause_callback) (int32_t geofence_id, int32_t status); - -/** - * The callback associated with the resume_geofence call. - * - * Parameter: - * geofence_id - Id of the geofence. - * status - GPS_GEOFENCE_OPERATION_SUCCESS - * GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id - * GPS_GEOFENCE_ERROR_GENERIC for others. - */ -typedef void (*gps_geofence_resume_callback) (int32_t geofence_id, int32_t status); - -typedef struct { - gps_geofence_transition_callback geofence_transition_callback; - gps_geofence_status_callback geofence_status_callback; - gps_geofence_add_callback geofence_add_callback; - gps_geofence_remove_callback geofence_remove_callback; - gps_geofence_pause_callback geofence_pause_callback; - gps_geofence_resume_callback geofence_resume_callback; - gps_create_thread create_thread_cb; -} GpsGeofenceCallbacks; - -/** Extended interface for GPS_Geofencing support */ -typedef struct { - /** set to sizeof(GpsGeofencingInterface) */ - size_t size; - - /** - * Opens the geofence interface and provides the callback routines - * to the implemenation of this interface. - */ - void (*init)( GpsGeofenceCallbacks* callbacks ); - - /** - * Add a geofence area. This api currently supports circular geofences. - * Parameters: - * geofence_id - The id for the geofence. If a geofence with this id - * already exists, an error value (GPS_GEOFENCE_ERROR_ID_EXISTS) - * should be returned. - * latitude, longtitude, radius_meters - The lat, long and radius - * (in meters) for the geofence - * last_transition - The current state of the geofence. For example, if - * the system already knows that the user is inside the geofence, - * this will be set to GPS_GEOFENCE_ENTERED. In most cases, it - * will be GPS_GEOFENCE_UNCERTAIN. - * monitor_transition - Which transitions to monitor. Bitwise OR of - * GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED and - * GPS_GEOFENCE_UNCERTAIN. - * notification_responsiveness_ms - Defines the best-effort description - * of how soon should the callback be called when the transition - * associated with the Geofence is triggered. For instance, if set - * to 1000 millseconds with GPS_GEOFENCE_ENTERED, the callback - * should be called 1000 milliseconds within entering the geofence. - * This parameter is defined in milliseconds. - * NOTE: This is not to be confused with the rate that the GPS is - * polled at. It is acceptable to dynamically vary the rate of - * sampling the GPS for power-saving reasons; thus the rate of - * sampling may be faster or slower than this. - * unknown_timer_ms - The time limit after which the UNCERTAIN transition - * should be triggered. This paramter is defined in milliseconds. - * See above for a detailed explanation. - */ - void (*add_geofence_area) (int32_t geofence_id, double latitude, - double longitude, double radius_meters, - int last_transition, int monitor_transitions, - int notification_responsiveness_ms, - int unknown_timer_ms); - - /** - * Pause monitoring a particular geofence. - * Parameters: - * geofence_id - The id for the geofence. - */ - void (*pause_geofence) (int32_t geofence_id); - - /** - * Resume monitoring a particular geofence. - * Parameters: - * geofence_id - The id for the geofence. - * monitor_transitions - Which transitions to monitor. Bitwise OR of - * GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED and - * GPS_GEOFENCE_UNCERTAIN. - * This supersedes the value associated provided in the - * add_geofence_area call. - */ - void (*resume_geofence) (int32_t geofence_id, int monitor_transitions); - - /** - * Remove a geofence area. After the function returns, no notifications - * should be sent. - * Parameter: - * geofence_id - The id for the geofence. - */ - void (*remove_geofence_area) (int32_t geofence_id); -} GpsGeofencingInterface; -__END_DECLS - -#endif /* ANDROID_INCLUDE_HARDWARE_GPS_H */ - diff --git a/external/android/include/18/hardware/libhardware/include/hardware/gralloc.h b/external/android/include/18/hardware/libhardware/include/hardware/gralloc.h deleted file mode 100644 index 9c62242..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/gralloc.h +++ /dev/null @@ -1,310 +0,0 @@ -/* - * 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. - */ - - -#ifndef ANDROID_GRALLOC_INTERFACE_H -#define ANDROID_GRALLOC_INTERFACE_H - -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include - -__BEGIN_DECLS - -/** - * Module versioning information for the Gralloc hardware module, based on - * gralloc_module_t.common.module_api_version. - * - * Version History: - * - * GRALLOC_MODULE_API_VERSION_0_1: - * Initial Gralloc hardware module API. - * - * GRALLOC_MODULE_API_VERSION_0_2: - * Add support for flexible YCbCr format with (*lock_ycbcr)() method. - */ - -#define GRALLOC_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) -#define GRALLOC_MODULE_API_VERSION_0_2 HARDWARE_MODULE_API_VERSION(0, 2) - -#define GRALLOC_DEVICE_API_VERSION_0_1 HARDWARE_DEVICE_API_VERSION(0, 1) - -/** - * The id of this module - */ -#define GRALLOC_HARDWARE_MODULE_ID "gralloc" - -/** - * Name of the graphics device to open - */ - -#define GRALLOC_HARDWARE_GPU0 "gpu0" - -enum { - /* buffer is never read in software */ - GRALLOC_USAGE_SW_READ_NEVER = 0x00000000, - /* buffer is rarely read in software */ - GRALLOC_USAGE_SW_READ_RARELY = 0x00000002, - /* buffer is often read in software */ - GRALLOC_USAGE_SW_READ_OFTEN = 0x00000003, - /* mask for the software read values */ - GRALLOC_USAGE_SW_READ_MASK = 0x0000000F, - - /* buffer is never written in software */ - GRALLOC_USAGE_SW_WRITE_NEVER = 0x00000000, - /* buffer is rarely written in software */ - GRALLOC_USAGE_SW_WRITE_RARELY = 0x00000020, - /* buffer is often written in software */ - GRALLOC_USAGE_SW_WRITE_OFTEN = 0x00000030, - /* mask for the software write values */ - GRALLOC_USAGE_SW_WRITE_MASK = 0x000000F0, - - /* buffer will be used as an OpenGL ES texture */ - GRALLOC_USAGE_HW_TEXTURE = 0x00000100, - /* buffer will be used as an OpenGL ES render target */ - GRALLOC_USAGE_HW_RENDER = 0x00000200, - /* buffer will be used by the 2D hardware blitter */ - GRALLOC_USAGE_HW_2D = 0x00000400, - /* buffer will be used by the HWComposer HAL module */ - GRALLOC_USAGE_HW_COMPOSER = 0x00000800, - /* buffer will be used with the framebuffer device */ - GRALLOC_USAGE_HW_FB = 0x00001000, - /* buffer will be used with the HW video encoder */ - GRALLOC_USAGE_HW_VIDEO_ENCODER = 0x00010000, - /* buffer will be written by the HW camera pipeline */ - GRALLOC_USAGE_HW_CAMERA_WRITE = 0x00020000, - /* buffer will be read by the HW camera pipeline */ - GRALLOC_USAGE_HW_CAMERA_READ = 0x00040000, - /* buffer will be used as part of zero-shutter-lag queue */ - GRALLOC_USAGE_HW_CAMERA_ZSL = 0x00060000, - /* mask for the camera access values */ - GRALLOC_USAGE_HW_CAMERA_MASK = 0x00060000, - /* mask for the software usage bit-mask */ - GRALLOC_USAGE_HW_MASK = 0x00071F00, - - /* buffer should be displayed full-screen on an external display when - * possible - */ - GRALLOC_USAGE_EXTERNAL_DISP = 0x00002000, - - /* Must have a hardware-protected path to external display sink for - * this buffer. If a hardware-protected path is not available, then - * either don't composite only this buffer (preferred) to the - * external sink, or (less desirable) do not route the entire - * composition to the external sink. - */ - GRALLOC_USAGE_PROTECTED = 0x00004000, - - /* implementation-specific private usage flags */ - GRALLOC_USAGE_PRIVATE_0 = 0x10000000, - GRALLOC_USAGE_PRIVATE_1 = 0x20000000, - GRALLOC_USAGE_PRIVATE_2 = 0x40000000, - GRALLOC_USAGE_PRIVATE_3 = 0x80000000, - GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000, -}; - -/*****************************************************************************/ - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -typedef struct gralloc_module_t { - struct hw_module_t common; - - /* - * (*registerBuffer)() must be called before a buffer_handle_t that has not - * been created with (*alloc_device_t::alloc)() can be used. - * - * This is intended to be used with buffer_handle_t's that have been - * received in this process through IPC. - * - * This function checks that the handle is indeed a valid one and prepares - * it for use with (*lock)() and (*unlock)(). - * - * It is not necessary to call (*registerBuffer)() on a handle created - * with (*alloc_device_t::alloc)(). - * - * returns an error if this buffer_handle_t is not valid. - */ - int (*registerBuffer)(struct gralloc_module_t const* module, - buffer_handle_t handle); - - /* - * (*unregisterBuffer)() is called once this handle is no longer needed in - * this process. After this call, it is an error to call (*lock)(), - * (*unlock)(), or (*registerBuffer)(). - * - * This function doesn't close or free the handle itself; this is done - * by other means, usually through libcutils's native_handle_close() and - * native_handle_free(). - * - * It is an error to call (*unregisterBuffer)() on a buffer that wasn't - * explicitly registered first. - */ - int (*unregisterBuffer)(struct gralloc_module_t const* module, - buffer_handle_t handle); - - /* - * The (*lock)() method is called before a buffer is accessed for the - * specified usage. This call may block, for instance if the h/w needs - * to finish rendering or if CPU caches need to be synchronized. - * - * The caller promises to modify only pixels in the area specified - * by (l,t,w,h). - * - * The content of the buffer outside of the specified area is NOT modified - * by this call. - * - * If usage specifies GRALLOC_USAGE_SW_*, vaddr is filled with the address - * of the buffer in virtual memory. - * - * Note calling (*lock)() on HAL_PIXEL_FORMAT_YCbCr_*_888 buffers will fail - * and return -EINVAL. These buffers must be locked with (*lock_ycbcr)() - * instead. - * - * THREADING CONSIDERATIONS: - * - * It is legal for several different threads to lock a buffer from - * read access, none of the threads are blocked. - * - * However, locking a buffer simultaneously for write or read/write is - * undefined, but: - * - shall not result in termination of the process - * - shall not block the caller - * It is acceptable to return an error or to leave the buffer's content - * into an indeterminate state. - * - * If the buffer was created with a usage mask incompatible with the - * requested usage flags here, -EINVAL is returned. - * - */ - - int (*lock)(struct gralloc_module_t const* module, - buffer_handle_t handle, int usage, - int l, int t, int w, int h, - void** vaddr); - - - /* - * The (*unlock)() method must be called after all changes to the buffer - * are completed. - */ - - int (*unlock)(struct gralloc_module_t const* module, - buffer_handle_t handle); - - - /* reserved for future use */ - int (*perform)(struct gralloc_module_t const* module, - int operation, ... ); - - /* - * The (*lock_ycbcr)() method is like the (*lock)() method, with the - * difference that it fills a struct ycbcr with a description of the buffer - * layout, and zeroes out the reserved fields. - * - * This will only work on buffers with HAL_PIXEL_FORMAT_YCbCr_*_888, and - * will return -EINVAL on any other buffer formats. - * - * Added in GRALLOC_MODULE_API_VERSION_0_2. - */ - - int (*lock_ycbcr)(struct gralloc_module_t const* module, - buffer_handle_t handle, int usage, - int l, int t, int w, int h, - struct android_ycbcr *ycbcr); - - /* reserved for future use */ - void* reserved_proc[6]; -} gralloc_module_t; - -/*****************************************************************************/ - -/** - * Every device data structure must begin with hw_device_t - * followed by module specific public methods and attributes. - */ - -typedef struct alloc_device_t { - struct hw_device_t common; - - /* - * (*alloc)() Allocates a buffer in graphic memory with the requested - * parameters and returns a buffer_handle_t and the stride in pixels to - * allow the implementation to satisfy hardware constraints on the width - * of a pixmap (eg: it may have to be multiple of 8 pixels). - * The CALLER TAKES OWNERSHIP of the buffer_handle_t. - * - * If format is HAL_PIXEL_FORMAT_YCbCr_420_888, the returned stride must be - * 0, since the actual strides are available from the android_ycbcr - * structure. - * - * Returns 0 on success or -errno on error. - */ - - int (*alloc)(struct alloc_device_t* dev, - int w, int h, int format, int usage, - buffer_handle_t* handle, int* stride); - - /* - * (*free)() Frees a previously allocated buffer. - * Behavior is undefined if the buffer is still mapped in any process, - * but shall not result in termination of the program or security breaches - * (allowing a process to get access to another process' buffers). - * THIS FUNCTION TAKES OWNERSHIP of the buffer_handle_t which becomes - * invalid after the call. - * - * Returns 0 on success or -errno on error. - */ - int (*free)(struct alloc_device_t* dev, - buffer_handle_t handle); - - /* This hook is OPTIONAL. - * - * If non NULL it will be caused by SurfaceFlinger on dumpsys - */ - void (*dump)(struct alloc_device_t *dev, char *buff, int buff_len); - - void* reserved_proc[7]; -} alloc_device_t; - - -/** convenience API for opening and closing a supported device */ - -static inline int gralloc_open(const struct hw_module_t* module, - struct alloc_device_t** device) { - return module->methods->open(module, - GRALLOC_HARDWARE_GPU0, (struct hw_device_t**)device); -} - -static inline int gralloc_close(struct alloc_device_t* device) { - return device->common.close(&device->common); -} - -__END_DECLS - -#endif // ANDROID_GRALLOC_INTERFACE_H diff --git a/external/android/include/18/hardware/libhardware/include/hardware/hardware.h b/external/android/include/18/hardware/libhardware/include/hardware/hardware.h deleted file mode 100644 index 416ae39..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/hardware.h +++ /dev/null @@ -1,230 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_INCLUDE_HARDWARE_HARDWARE_H -#define ANDROID_INCLUDE_HARDWARE_HARDWARE_H - -#include -#include - -#include -#include - -__BEGIN_DECLS - -/* - * Value for the hw_module_t.tag field - */ - -#define MAKE_TAG_CONSTANT(A,B,C,D) (((A) << 24) | ((B) << 16) | ((C) << 8) | (D)) - -#define HARDWARE_MODULE_TAG MAKE_TAG_CONSTANT('H', 'W', 'M', 'T') -#define HARDWARE_DEVICE_TAG MAKE_TAG_CONSTANT('H', 'W', 'D', 'T') - -#define HARDWARE_MAKE_API_VERSION(maj,min) \ - ((((maj) & 0xff) << 8) | ((min) & 0xff)) - -#define HARDWARE_MAKE_API_VERSION_2(maj,min,hdr) \ - ((((maj) & 0xff) << 24) | (((min) & 0xff) << 16) | ((hdr) & 0xffff)) -#define HARDWARE_API_VERSION_2_MAJ_MIN_MASK 0xffff0000 -#define HARDWARE_API_VERSION_2_HEADER_MASK 0x0000ffff - - -/* - * The current HAL API version. - * - * All module implementations must set the hw_module_t.hal_api_version field - * to this value when declaring the module with HAL_MODULE_INFO_SYM. - * - * Note that previous implementations have always set this field to 0. - * Therefore, libhardware HAL API will always consider versions 0.0 and 1.0 - * to be 100% binary compatible. - * - */ -#define HARDWARE_HAL_API_VERSION HARDWARE_MAKE_API_VERSION(1, 0) - -/* - * Helper macros for module implementors. - * - * The derived modules should provide convenience macros for supported - * versions so that implementations can explicitly specify module/device - * versions at definition time. - * - * Use this macro to set the hw_module_t.module_api_version field. - */ -#define HARDWARE_MODULE_API_VERSION(maj,min) HARDWARE_MAKE_API_VERSION(maj,min) -#define HARDWARE_MODULE_API_VERSION_2(maj,min,hdr) HARDWARE_MAKE_API_VERSION_2(maj,min,hdr) - -/* - * Use this macro to set the hw_device_t.version field - */ -#define HARDWARE_DEVICE_API_VERSION(maj,min) HARDWARE_MAKE_API_VERSION(maj,min) -#define HARDWARE_DEVICE_API_VERSION_2(maj,min,hdr) HARDWARE_MAKE_API_VERSION_2(maj,min,hdr) - -struct hw_module_t; -struct hw_module_methods_t; -struct hw_device_t; - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -typedef struct hw_module_t { - /** tag must be initialized to HARDWARE_MODULE_TAG */ - uint32_t tag; - - /** - * The API version of the implemented module. The module owner is - * responsible for updating the version when a module interface has - * changed. - * - * The derived modules such as gralloc and audio own and manage this field. - * The module user must interpret the version field to decide whether or - * not to inter-operate with the supplied module implementation. - * For example, SurfaceFlinger is responsible for making sure that - * it knows how to manage different versions of the gralloc-module API, - * and AudioFlinger must know how to do the same for audio-module API. - * - * The module API version should include a major and a minor component. - * For example, version 1.0 could be represented as 0x0100. This format - * implies that versions 0x0100-0x01ff are all API-compatible. - * - * In the future, libhardware will expose a hw_get_module_version() - * (or equivalent) function that will take minimum/maximum supported - * versions as arguments and would be able to reject modules with - * versions outside of the supplied range. - */ - uint16_t module_api_version; -#define version_major module_api_version - /** - * version_major/version_minor defines are supplied here for temporary - * source code compatibility. They will be removed in the next version. - * ALL clients must convert to the new version format. - */ - - /** - * The API version of the HAL module interface. This is meant to - * version the hw_module_t, hw_module_methods_t, and hw_device_t - * structures and definitions. - * - * The HAL interface owns this field. Module users/implementations - * must NOT rely on this value for version information. - * - * Presently, 0 is the only valid value. - */ - uint16_t hal_api_version; -#define version_minor hal_api_version - - /** Identifier of module */ - const char *id; - - /** Name of this module */ - const char *name; - - /** Author/owner/implementor of the module */ - const char *author; - - /** Modules methods */ - struct hw_module_methods_t* methods; - - /** module's dso */ - void* dso; - - /** padding to 128 bytes, reserved for future use */ - uint32_t reserved[32-7]; - -} hw_module_t; - -typedef struct hw_module_methods_t { - /** Open a specific device */ - int (*open)(const struct hw_module_t* module, const char* id, - struct hw_device_t** device); - -} hw_module_methods_t; - -/** - * Every device data structure must begin with hw_device_t - * followed by module specific public methods and attributes. - */ -typedef struct hw_device_t { - /** tag must be initialized to HARDWARE_DEVICE_TAG */ - uint32_t tag; - - /** - * Version of the module-specific device API. This value is used by - * the derived-module user to manage different device implementations. - * - * The module user is responsible for checking the module_api_version - * and device version fields to ensure that the user is capable of - * communicating with the specific module implementation. - * - * One module can support multiple devices with different versions. This - * can be useful when a device interface changes in an incompatible way - * but it is still necessary to support older implementations at the same - * time. One such example is the Camera 2.0 API. - * - * This field is interpreted by the module user and is ignored by the - * HAL interface itself. - */ - uint32_t version; - - /** reference to the module this device belongs to */ - struct hw_module_t* module; - - /** padding reserved for future use */ - uint32_t reserved[12]; - - /** Close this device */ - int (*close)(struct hw_device_t* device); - -} hw_device_t; - -/** - * Name of the hal_module_info - */ -#define HAL_MODULE_INFO_SYM HMI - -/** - * Name of the hal_module_info as a string - */ -#define HAL_MODULE_INFO_SYM_AS_STR "HMI" - -/** - * Get the module info associated with a module by id. - * - * @return: 0 == success, <0 == error and *module == NULL - */ -int hw_get_module(const char *id, const struct hw_module_t **module); - -/** - * Get the module info associated with a module instance by class 'class_id' - * and instance 'inst'. - * - * Some modules types necessitate multiple instances. For example audio supports - * multiple concurrent interfaces and thus 'audio' is the module class - * and 'primary' or 'a2dp' are module interfaces. This implies that the files - * providing these modules would be named audio.primary..so and - * audio.a2dp..so - * - * @return: 0 == success, <0 == error and *module == NULL - */ -int hw_get_module_by_class(const char *class_id, const char *inst, - const struct hw_module_t **module); - -__END_DECLS - -#endif /* ANDROID_INCLUDE_HARDWARE_HARDWARE_H */ diff --git a/external/android/include/18/hardware/libhardware/include/hardware/hwcomposer.h b/external/android/include/18/hardware/libhardware/include/hardware/hwcomposer.h deleted file mode 100644 index d75a047..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/hwcomposer.h +++ /dev/null @@ -1,617 +0,0 @@ -/* - * Copyright (C) 2010 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_INCLUDE_HARDWARE_HWCOMPOSER_H -#define ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_H - -#include -#include - -#include -#include -#include - -#include - -__BEGIN_DECLS - -/*****************************************************************************/ - -/* for compatibility */ -#define HWC_MODULE_API_VERSION HWC_MODULE_API_VERSION_0_1 -#define HWC_DEVICE_API_VERSION HWC_DEVICE_API_VERSION_0_1 -#define HWC_API_VERSION HWC_DEVICE_API_VERSION - -/*****************************************************************************/ - -/** - * The id of this module - */ -#define HWC_HARDWARE_MODULE_ID "hwcomposer" - -/** - * Name of the sensors device to open - */ -#define HWC_HARDWARE_COMPOSER "composer" - -typedef struct hwc_rect { - int left; - int top; - int right; - int bottom; -} hwc_rect_t; - -typedef struct hwc_region { - size_t numRects; - hwc_rect_t const* rects; -} hwc_region_t; - -typedef struct hwc_color { - uint8_t r; - uint8_t g; - uint8_t b; - uint8_t a; -} hwc_color_t; - -typedef struct hwc_layer_1 { - /* - * compositionType is used to specify this layer's type and is set by either - * the hardware composer implementation, or by the caller (see below). - * - * This field is always reset to HWC_BACKGROUND or HWC_FRAMEBUFFER - * before (*prepare)() is called when the HWC_GEOMETRY_CHANGED flag is - * also set, otherwise, this field is preserved between (*prepare)() - * calls. - * - * HWC_BACKGROUND - * Always set by the caller before calling (*prepare)(), this value - * indicates this is a special "background" layer. The only valid field - * is backgroundColor. - * The HWC can toggle this value to HWC_FRAMEBUFFER to indicate it CANNOT - * handle the background color. - * - * - * HWC_FRAMEBUFFER_TARGET - * Always set by the caller before calling (*prepare)(), this value - * indicates this layer is the framebuffer surface used as the target of - * OpenGL ES composition. If the HWC sets all other layers to HWC_OVERLAY - * or HWC_BACKGROUND, then no OpenGL ES composition will be done, and - * this layer should be ignored during set(). - * - * This flag (and the framebuffer surface layer) will only be used if the - * HWC version is HWC_DEVICE_API_VERSION_1_1 or higher. In older versions, - * the OpenGL ES target surface is communicated by the (dpy, sur) fields - * in hwc_compositor_device_1_t. - * - * This value cannot be set by the HWC implementation. - * - * - * HWC_FRAMEBUFFER - * Set by the caller before calling (*prepare)() ONLY when the - * HWC_GEOMETRY_CHANGED flag is also set. - * - * Set by the HWC implementation during (*prepare)(), this indicates - * that the layer will be drawn into the framebuffer using OpenGL ES. - * The HWC can toggle this value to HWC_OVERLAY to indicate it will - * handle the layer. - * - * - * HWC_OVERLAY - * Set by the HWC implementation during (*prepare)(), this indicates - * that the layer will be handled by the HWC (ie: it must not be - * composited with OpenGL ES). - * - */ - int32_t compositionType; - - /* - * hints is bit mask set by the HWC implementation during (*prepare)(). - * It is preserved between (*prepare)() calls, unless the - * HWC_GEOMETRY_CHANGED flag is set, in which case it is reset to 0. - * - * see hwc_layer_t::hints - */ - uint32_t hints; - - /* see hwc_layer_t::flags */ - uint32_t flags; - - union { - /* color of the background. hwc_color_t.a is ignored */ - hwc_color_t backgroundColor; - - struct { - /* handle of buffer to compose. This handle is guaranteed to have been - * allocated from gralloc using the GRALLOC_USAGE_HW_COMPOSER usage flag. If - * the layer's handle is unchanged across two consecutive prepare calls and - * the HWC_GEOMETRY_CHANGED flag is not set for the second call then the - * HWComposer implementation may assume that the contents of the buffer have - * not changed. */ - buffer_handle_t handle; - - /* transformation to apply to the buffer during composition */ - uint32_t transform; - - /* blending to apply during composition */ - int32_t blending; - - /* area of the source to consider, the origin is the top-left corner of - * the buffer */ - hwc_rect_t sourceCrop; - - /* where to composite the sourceCrop onto the display. The sourceCrop - * is scaled using linear filtering to the displayFrame. The origin is the - * top-left corner of the screen. - */ - hwc_rect_t displayFrame; - - /* visible region in screen space. The origin is the - * top-left corner of the screen. - * The visible region INCLUDES areas overlapped by a translucent layer. - */ - hwc_region_t visibleRegionScreen; - - /* Sync fence object that will be signaled when the buffer's - * contents are available. May be -1 if the contents are already - * available. This field is only valid during set(), and should be - * ignored during prepare(). The set() call must not wait for the - * fence to be signaled before returning, but the HWC must wait for - * all buffers to be signaled before reading from them. - * - * HWC_FRAMEBUFFER layers will never have an acquire fence, since - * reads from them are complete before the framebuffer is ready for - * display. - * - * The HWC takes ownership of the acquireFenceFd and is responsible - * for closing it when no longer needed. - */ - int acquireFenceFd; - - /* During set() the HWC must set this field to a file descriptor for - * a sync fence object that will signal after the HWC has finished - * reading from the buffer. The field is ignored by prepare(). Each - * layer should have a unique file descriptor, even if more than one - * refer to the same underlying fence object; this allows each to be - * closed independently. - * - * If buffer reads can complete at significantly different times, - * then using independent fences is preferred. For example, if the - * HWC handles some layers with a blit engine and others with - * overlays, then the blit layers can be reused immediately after - * the blit completes, but the overlay layers can't be reused until - * a subsequent frame has been displayed. - * - * Since HWC doesn't read from HWC_FRAMEBUFFER layers, it shouldn't - * produce a release fence for them. The releaseFenceFd will be -1 - * for these layers when set() is called. - * - * The HWC client taks ownership of the releaseFenceFd and is - * responsible for closing it when no longer needed. - */ - int releaseFenceFd; - - /* - * Availability: HWC_DEVICE_API_VERSION_1_2 - * - * Alpha value applied to the whole layer. The effective - * value of each pixel is computed as: - * - * if (blending == HWC_BLENDING_PREMULT) - * pixel.rgb = pixel.rgb * planeAlpha / 255 - * pixel.a = pixel.a * planeAlpha / 255 - * - * Then blending proceeds as usual according to the "blending" - * field above. - * - * NOTE: planeAlpha applies to YUV layers as well: - * - * pixel.rgb = yuv_to_rgb(pixel.yuv) - * if (blending == HWC_BLENDING_PREMULT) - * pixel.rgb = pixel.rgb * planeAlpha / 255 - * pixel.a = planeAlpha - * - * - * IMPLEMENTATION NOTE: - * - * If the source image doesn't have an alpha channel, then - * the h/w can use the HWC_BLENDING_COVERAGE equations instead of - * HWC_BLENDING_PREMULT and simply set the alpha channel to - * planeAlpha. - * - * e.g.: - * - * if (blending == HWC_BLENDING_PREMULT) - * blending = HWC_BLENDING_COVERAGE; - * pixel.a = planeAlpha; - * - */ - uint8_t planeAlpha; - - /* reserved for future use */ - uint8_t _pad[3]; - }; - }; - - /* Allow for expansion w/o breaking binary compatibility. - * Pad layer to 96 bytes, assuming 32-bit pointers. - */ - int32_t reserved[24 - 19]; - -} hwc_layer_1_t; - -/* This represents a display, typically an EGLDisplay object */ -typedef void* hwc_display_t; - -/* This represents a surface, typically an EGLSurface object */ -typedef void* hwc_surface_t; - -/* - * hwc_display_contents_1_t::flags values - */ -enum { - /* - * HWC_GEOMETRY_CHANGED is set by SurfaceFlinger to indicate that the list - * passed to (*prepare)() has changed by more than just the buffer handles - * and acquire fences. - */ - HWC_GEOMETRY_CHANGED = 0x00000001, -}; - -/* - * Description of the contents to output on a display. - * - * This is the top-level structure passed to the prepare and set calls to - * negotiate and commit the composition of a display image. - */ -typedef struct hwc_display_contents_1 { - /* File descriptor referring to a Sync HAL fence object which will signal - * when this composition is retired. For a physical display, a composition - * is retired when it has been replaced on-screen by a subsequent set. For - * a virtual display, the composition is retired when the writes to - * outputBuffer are complete and can be read. The fence object is created - * and returned by the set call; this field will be -1 on entry to prepare - * and set. SurfaceFlinger will close the returned file descriptor. - */ - int retireFenceFd; - - union { - /* Fields only relevant for HWC_DEVICE_VERSION_1_0. */ - struct { - /* (dpy, sur) is the target of SurfaceFlinger's OpenGL ES - * composition for HWC_DEVICE_VERSION_1_0. They aren't relevant to - * prepare. The set call should commit this surface atomically to - * the display along with any overlay layers. - */ - hwc_display_t dpy; - hwc_surface_t sur; - }; - - /* WARNING: These fields are for experimental virtual display support, - * and are not currently used. */ - struct { - /* outbuf is the buffer that receives the composed image for - * virtual displays. Writes to the outbuf must wait until - * outbufAcquireFenceFd signals. A fence that will signal when - * writes to outbuf are complete should be returned in - * retireFenceFd. - * - * This field will not be updated until after prepare(). If - * prepare() sets all non-FB layers to OVERLAY or sets all non-FB - * layers to FRAMEBUFFER, then the FRAMEBUFFER_TARGET buffer and - * the output buffer may be the same. In mixed OVERLAY/FRAMEBUFFER - * configurations they will have different buffers so the - * h/w composer does not have to read and write the same buffer. - * - * For physical displays, outbuf will be NULL. - */ - buffer_handle_t outbuf; - - /* File descriptor for a fence that will signal when outbuf is - * ready to be written. The h/w composer is responsible for closing - * this when no longer needed. - * - * Will be -1 whenever outbuf is NULL, or when the outbuf can be - * written immediately. - */ - int outbufAcquireFenceFd; - }; - }; - - /* List of layers that will be composed on the display. The buffer handles - * in the list will be unique. If numHwLayers is 0, all composition will be - * performed by SurfaceFlinger. - */ - uint32_t flags; - size_t numHwLayers; - hwc_layer_1_t hwLayers[0]; - -} hwc_display_contents_1_t; - -/* see hwc_composer_device::registerProcs() - * All of the callbacks are required and non-NULL unless otherwise noted. - */ -typedef struct hwc_procs { - /* - * (*invalidate)() triggers a screen refresh, in particular prepare and set - * will be called shortly after this call is made. Note that there is - * NO GUARANTEE that the screen refresh will happen after invalidate() - * returns (in particular, it could happen before). - * invalidate() is GUARANTEED TO NOT CALL BACK into the h/w composer HAL and - * it is safe to call invalidate() from any of hwc_composer_device - * hooks, unless noted otherwise. - */ - void (*invalidate)(const struct hwc_procs* procs); - - /* - * (*vsync)() is called by the h/w composer HAL when a vsync event is - * received and HWC_EVENT_VSYNC is enabled on a display - * (see: hwc_event_control). - * - * the "disp" parameter indicates which display the vsync event is for. - * the "timestamp" parameter is the system monotonic clock timestamp in - * nanosecond of when the vsync event happened. - * - * vsync() is GUARANTEED TO NOT CALL BACK into the h/w composer HAL. - * - * It is expected that vsync() is called from a thread of at least - * HAL_PRIORITY_URGENT_DISPLAY with as little latency as possible, - * typically less than 0.5 ms. - * - * It is a (silent) error to have HWC_EVENT_VSYNC enabled when calling - * hwc_composer_device.set(..., 0, 0, 0) (screen off). The implementation - * can either stop or continue to process VSYNC events, but must not - * crash or cause other problems. - */ - void (*vsync)(const struct hwc_procs* procs, int disp, int64_t timestamp); - - /* - * (*hotplug)() is called by the h/w composer HAL when a display is - * connected or disconnected. The PRIMARY display is always connected and - * the hotplug callback should not be called for it. - * - * The disp parameter indicates which display type this event is for. - * The connected parameter indicates whether the display has just been - * connected (1) or disconnected (0). - * - * The hotplug() callback may call back into the h/w composer on the same - * thread to query refresh rate and dpi for the display. Additionally, - * other threads may be calling into the h/w composer while the callback - * is in progress. - * - * The h/w composer must serialize calls to the hotplug callback; only - * one thread may call it at a time. - * - * This callback will be NULL if the h/w composer is using - * HWC_DEVICE_API_VERSION_1_0. - */ - void (*hotplug)(const struct hwc_procs* procs, int disp, int connected); - -} hwc_procs_t; - - -/*****************************************************************************/ - -typedef struct hwc_module { - struct hw_module_t common; -} hwc_module_t; - -typedef struct hwc_composer_device_1 { - struct hw_device_t common; - - /* - * (*prepare)() is called for each frame before composition and is used by - * SurfaceFlinger to determine what composition steps the HWC can handle. - * - * (*prepare)() can be called more than once, the last call prevails. - * - * The HWC responds by setting the compositionType field in each layer to - * either HWC_FRAMEBUFFER or HWC_OVERLAY. In the former case, the - * composition for the layer is handled by SurfaceFlinger with OpenGL ES, - * in the later case, the HWC will have to handle the layer's composition. - * compositionType and hints are preserved between (*prepare)() calles - * unless the HWC_GEOMETRY_CHANGED flag is set. - * - * (*prepare)() is called with HWC_GEOMETRY_CHANGED to indicate that the - * list's geometry has changed, that is, when more than just the buffer's - * handles have been updated. Typically this happens (but is not limited to) - * when a window is added, removed, resized or moved. In this case - * compositionType and hints are reset to their default value. - * - * For HWC 1.0, numDisplays will always be one, and displays[0] will be - * non-NULL. - * - * For HWC 1.1, numDisplays will always be HWC_NUM_DISPLAY_TYPES. Entries - * for unsupported or disabled/disconnected display types will be NULL. - * - * In a future version, numDisplays may be larger than - * HWC_NUM_DISPLAY_TYPES. The extra entries correspond to enabled virtual - * displays, and will be non-NULL. - * - * returns: 0 on success. An negative error code on error. If an error is - * returned, SurfaceFlinger will assume that none of the layer will be - * handled by the HWC. - */ - int (*prepare)(struct hwc_composer_device_1 *dev, - size_t numDisplays, hwc_display_contents_1_t** displays); - - /* - * (*set)() is used in place of eglSwapBuffers(), and assumes the same - * functionality, except it also commits the work list atomically with - * the actual eglSwapBuffers(). - * - * The layer lists are guaranteed to be the same as the ones returned from - * the last call to (*prepare)(). - * - * When this call returns the caller assumes that the displays will be - * updated in the near future with the content of their work lists, without - * artifacts during the transition from the previous frame. - * - * A display with zero layers indicates that the entire composition has - * been handled by SurfaceFlinger with OpenGL ES. In this case, (*set)() - * behaves just like eglSwapBuffers(). - * - * For HWC 1.0, numDisplays will always be one, and displays[0] will be - * non-NULL. - * - * For HWC 1.1, numDisplays will always be HWC_NUM_DISPLAY_TYPES. Entries - * for unsupported or disabled/disconnected display types will be NULL. - * - * In a future version, numDisplays may be larger than - * HWC_NUM_DISPLAY_TYPES. The extra entries correspond to enabled virtual - * displays, and will be non-NULL. - * - * IMPORTANT NOTE: There is an implicit layer containing opaque black - * pixels behind all the layers in the list. It is the responsibility of - * the hwcomposer module to make sure black pixels are output (or blended - * from). - * - * IMPORTANT NOTE: In the event of an error this call *MUST* still cause - * any fences returned in the previous call to set to eventually become - * signaled. The caller may have already issued wait commands on these - * fences, and having set return without causing those fences to signal - * will likely result in a deadlock. - * - * returns: 0 on success. A negative error code on error: - * HWC_EGL_ERROR: eglGetError() will provide the proper error code (only - * allowed prior to HWComposer 1.1) - * Another code for non EGL errors. - */ - int (*set)(struct hwc_composer_device_1 *dev, - size_t numDisplays, hwc_display_contents_1_t** displays); - - /* - * eventControl(..., event, enabled) - * Enables or disables h/w composer events for a display. - * - * eventControl can be called from any thread and takes effect - * immediately. - * - * Supported events are: - * HWC_EVENT_VSYNC - * - * returns -EINVAL if the "event" parameter is not one of the value above - * or if the "enabled" parameter is not 0 or 1. - */ - int (*eventControl)(struct hwc_composer_device_1* dev, int disp, - int event, int enabled); - - /* - * blank(..., blank) - * Blanks or unblanks a display's screen. - * - * Turns the screen off when blank is nonzero, on when blank is zero. - * Multiple sequential calls with the same blank value must be supported. - * The screen state transition must be be complete when the function - * returns. - * - * returns 0 on success, negative on error. - */ - int (*blank)(struct hwc_composer_device_1* dev, int disp, int blank); - - /* - * Used to retrieve information about the h/w composer - * - * Returns 0 on success or -errno on error. - */ - int (*query)(struct hwc_composer_device_1* dev, int what, int* value); - - /* - * (*registerProcs)() registers callbacks that the h/w composer HAL can - * later use. It will be called immediately after the composer device is - * opened with non-NULL procs. It is FORBIDDEN to call any of the callbacks - * from within registerProcs(). registerProcs() must save the hwc_procs_t - * pointer which is needed when calling a registered callback. - */ - void (*registerProcs)(struct hwc_composer_device_1* dev, - hwc_procs_t const* procs); - - /* - * This field is OPTIONAL and can be NULL. - * - * If non NULL it will be called by SurfaceFlinger on dumpsys - */ - void (*dump)(struct hwc_composer_device_1* dev, char *buff, int buff_len); - - /* - * (*getDisplayConfigs)() returns handles for the configurations available - * on the connected display. These handles must remain valid as long as the - * display is connected. - * - * Configuration handles are written to configs. The number of entries - * allocated by the caller is passed in *numConfigs; getDisplayConfigs must - * not try to write more than this number of config handles. On return, the - * total number of configurations available for the display is returned in - * *numConfigs. If *numConfigs is zero on entry, then configs may be NULL. - * - * HWC_DEVICE_API_VERSION_1_1 does not provide a way to choose a config. - * For displays that support multiple configurations, the h/w composer - * implementation should choose one and report it as the first config in - * the list. Reporting the not-chosen configs is not required. - * - * Returns 0 on success or -errno on error. If disp is a hotpluggable - * display type and no display is connected, an error should be returned. - * - * This field is REQUIRED for HWC_DEVICE_API_VERSION_1_1 and later. - * It should be NULL for previous versions. - */ - int (*getDisplayConfigs)(struct hwc_composer_device_1* dev, int disp, - uint32_t* configs, size_t* numConfigs); - - /* - * (*getDisplayAttributes)() returns attributes for a specific config of a - * connected display. The config parameter is one of the config handles - * returned by getDisplayConfigs. - * - * The list of attributes to return is provided in the attributes - * parameter, terminated by HWC_DISPLAY_NO_ATTRIBUTE. The value for each - * requested attribute is written in order to the values array. The - * HWC_DISPLAY_NO_ATTRIBUTE attribute does not have a value, so the values - * array will have one less value than the attributes array. - * - * This field is REQUIRED for HWC_DEVICE_API_VERSION_1_1 and later. - * It should be NULL for previous versions. - * - * If disp is a hotpluggable display type and no display is connected, - * or if config is not a valid configuration for the display, a negative - * value should be returned. - */ - int (*getDisplayAttributes)(struct hwc_composer_device_1* dev, int disp, - uint32_t config, const uint32_t* attributes, int32_t* values); - - /* - * Reserved for future use. Must be NULL. - */ - void* reserved_proc[4]; - -} hwc_composer_device_1_t; - -/** convenience API for opening and closing a device */ - -static inline int hwc_open_1(const struct hw_module_t* module, - hwc_composer_device_1_t** device) { - return module->methods->open(module, - HWC_HARDWARE_COMPOSER, (struct hw_device_t**)device); -} - -static inline int hwc_close_1(hwc_composer_device_1_t* device) { - return device->common.close(&device->common); -} - -/*****************************************************************************/ - -__END_DECLS - -#endif /* ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_H */ diff --git a/external/android/include/18/hardware/libhardware/include/hardware/hwcomposer_defs.h b/external/android/include/18/hardware/libhardware/include/hardware/hwcomposer_defs.h deleted file mode 100644 index 1edfd3d..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/hwcomposer_defs.h +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Copyright (C) 2010 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_INCLUDE_HARDWARE_HWCOMPOSER_DEFS_H -#define ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_DEFS_H - -#include -#include - -#include -#include -#include - -__BEGIN_DECLS - -/*****************************************************************************/ - -#define HWC_HEADER_VERSION 1 - -#define HWC_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) - -#define HWC_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION_2(1, 0, HWC_HEADER_VERSION) -#define HWC_DEVICE_API_VERSION_1_1 HARDWARE_DEVICE_API_VERSION_2(1, 1, HWC_HEADER_VERSION) -#define HWC_DEVICE_API_VERSION_1_2 HARDWARE_DEVICE_API_VERSION_2(1, 2, HWC_HEADER_VERSION) - -enum { - /* hwc_composer_device_t::set failed in EGL */ - HWC_EGL_ERROR = -1 -}; - -/* - * hwc_layer_t::hints values - * Hints are set by the HAL and read by SurfaceFlinger - */ -enum { - /* - * HWC can set the HWC_HINT_TRIPLE_BUFFER hint to indicate to SurfaceFlinger - * that it should triple buffer this layer. Typically HWC does this when - * the layer will be unavailable for use for an extended period of time, - * e.g. if the display will be fetching data directly from the layer and - * the layer can not be modified until after the next set(). - */ - HWC_HINT_TRIPLE_BUFFER = 0x00000001, - - /* - * HWC sets HWC_HINT_CLEAR_FB to tell SurfaceFlinger that it should clear the - * framebuffer with transparent pixels where this layer would be. - * SurfaceFlinger will only honor this flag when the layer has no blending - * - */ - HWC_HINT_CLEAR_FB = 0x00000002 -}; - -/* - * hwc_layer_t::flags values - * Flags are set by SurfaceFlinger and read by the HAL - */ -enum { - /* - * HWC_SKIP_LAYER is set by SurfaceFlnger to indicate that the HAL - * shall not consider this layer for composition as it will be handled - * by SurfaceFlinger (just as if compositionType was set to HWC_OVERLAY). - */ - HWC_SKIP_LAYER = 0x00000001, -}; - -/* - * hwc_layer_t::compositionType values - */ -enum { - /* this layer is to be drawn into the framebuffer by SurfaceFlinger */ - HWC_FRAMEBUFFER = 0, - - /* this layer will be handled in the HWC */ - HWC_OVERLAY = 1, - - /* this is the background layer. it's used to set the background color. - * there is only a single background layer */ - HWC_BACKGROUND = 2, - - /* this layer holds the result of compositing the HWC_FRAMEBUFFER layers. - * Added in HWC_DEVICE_API_VERSION_1_1. */ - HWC_FRAMEBUFFER_TARGET = 3, -}; - -/* - * hwc_layer_t::blending values - */ -enum { - /* no blending */ - HWC_BLENDING_NONE = 0x0100, - - /* ONE / ONE_MINUS_SRC_ALPHA */ - HWC_BLENDING_PREMULT = 0x0105, - - /* SRC_ALPHA / ONE_MINUS_SRC_ALPHA */ - HWC_BLENDING_COVERAGE = 0x0405 -}; - -/* - * hwc_layer_t::transform values - */ -enum { - /* flip source image horizontally */ - HWC_TRANSFORM_FLIP_H = HAL_TRANSFORM_FLIP_H, - /* flip source image vertically */ - HWC_TRANSFORM_FLIP_V = HAL_TRANSFORM_FLIP_V, - /* rotate source image 90 degrees clock-wise */ - HWC_TRANSFORM_ROT_90 = HAL_TRANSFORM_ROT_90, - /* rotate source image 180 degrees */ - HWC_TRANSFORM_ROT_180 = HAL_TRANSFORM_ROT_180, - /* rotate source image 270 degrees clock-wise */ - HWC_TRANSFORM_ROT_270 = HAL_TRANSFORM_ROT_270, -}; - -/* attributes queriable with query() */ -enum { - /* - * Must return 1 if the background layer is supported, 0 otherwise. - */ - HWC_BACKGROUND_LAYER_SUPPORTED = 0, - - /* - * Returns the vsync period in nanoseconds. - * - * This query is not used for HWC_DEVICE_API_VERSION_1_1 and later. - * Instead, the per-display attribute HWC_DISPLAY_VSYNC_PERIOD is used. - */ - HWC_VSYNC_PERIOD = 1, - - /* - * Availability: HWC_DEVICE_API_VERSION_1_1 - * Returns a mask of supported display types. - */ - HWC_DISPLAY_TYPES_SUPPORTED = 2, -}; - -/* display attributes returned by getDisplayAttributes() */ -enum { - /* Indicates the end of an attribute list */ - HWC_DISPLAY_NO_ATTRIBUTE = 0, - - /* The vsync period in nanoseconds */ - HWC_DISPLAY_VSYNC_PERIOD = 1, - - /* The number of pixels in the horizontal and vertical directions. */ - HWC_DISPLAY_WIDTH = 2, - HWC_DISPLAY_HEIGHT = 3, - - /* The number of pixels per thousand inches of this configuration. - * - * Scaling DPI by 1000 allows it to be stored in an int without losing - * too much precision. - * - * If the DPI for a configuration is unavailable or the HWC implementation - * considers it unreliable, it should set these attributes to zero. - */ - HWC_DISPLAY_DPI_X = 4, - HWC_DISPLAY_DPI_Y = 5, -}; - -/* Allowed events for hwc_methods::eventControl() */ -enum { - HWC_EVENT_VSYNC = 0 -}; - -/* Display types and associated mask bits. */ -enum { - HWC_DISPLAY_PRIMARY = 0, - HWC_DISPLAY_EXTERNAL = 1, // HDMI, DP, etc. - HWC_NUM_DISPLAY_TYPES -}; - -enum { - HWC_DISPLAY_PRIMARY_BIT = 1 << HWC_DISPLAY_PRIMARY, - HWC_DISPLAY_EXTERNAL_BIT = 1 << HWC_DISPLAY_EXTERNAL, -}; - -/*****************************************************************************/ - -__END_DECLS - -#endif /* ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_DEFS_H */ diff --git a/external/android/include/18/hardware/libhardware/include/hardware/keymaster.h b/external/android/include/18/hardware/libhardware/include/hardware/keymaster.h deleted file mode 100644 index e0014c8..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/keymaster.h +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright (C) 2011 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_HARDWARE_KEYMASTER_H -#define ANDROID_HARDWARE_KEYMASTER_H - -#include -#include -#include - -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define KEYSTORE_HARDWARE_MODULE_ID "keystore" - -#define KEYSTORE_KEYMASTER "keymaster" - -/** - * The API level of this version of the header. The allows the implementing - * module to recognize which API level of the client it is dealing with in - * the case of pre-compiled binary clients. - */ -#define KEYMASTER_API_VERSION 1 - -/** - * Flags for keymaster_device::flags - */ -enum { - /* - * Indicates this keymaster implementation does not have hardware that - * keeps private keys out of user space. - * - * This should not be implemented on anything other than the default - * implementation. - */ - KEYMASTER_SOFTWARE_ONLY = 0x00000001, -}; - -struct keystore_module { - hw_module_t common; -}; - -/** - * Asymmetric key pair types. - */ -typedef enum { - TYPE_RSA = 1, -} keymaster_keypair_t; - -/** - * Parameters needed to generate an RSA key. - */ -typedef struct { - uint32_t modulus_size; - uint64_t public_exponent; -} keymaster_rsa_keygen_params_t; - -/** - * Digest type used for RSA operations. - */ -typedef enum { - DIGEST_NONE, -} keymaster_rsa_digest_t; - -/** - * Type of padding used for RSA operations. - */ -typedef enum { - PADDING_NONE, -} keymaster_rsa_padding_t; - -typedef struct { - keymaster_rsa_digest_t digest_type; - keymaster_rsa_padding_t padding_type; -} keymaster_rsa_sign_params_t; - -/** - * The parameters that can be set for a given keymaster implementation. - */ -struct keymaster_device { - struct hw_device_t common; - - uint32_t client_version; - - /** - * See flags defined for keymaster_device::flags above. - */ - uint32_t flags; - - void* context; - - /** - * Generates a public and private key. The key-blob returned is opaque - * and must subsequently provided for signing and verification. - * - * Returns: 0 on success or an error code less than 0. - */ - int (*generate_keypair)(const struct keymaster_device* dev, - const keymaster_keypair_t key_type, const void* key_params, - uint8_t** key_blob, size_t* key_blob_length); - - /** - * Imports a public and private key pair. The imported keys will be in - * PKCS#8 format with DER encoding (Java standard). The key-blob - * returned is opaque and will be subsequently provided for signing - * and verification. - * - * Returns: 0 on success or an error code less than 0. - */ - int (*import_keypair)(const struct keymaster_device* dev, - const uint8_t* key, const size_t key_length, - uint8_t** key_blob, size_t* key_blob_length); - - /** - * Gets the public key part of a key pair. The public key must be in - * X.509 format (Java standard) encoded byte array. - * - * Returns: 0 on success or an error code less than 0. - * On error, x509_data should not be allocated. - */ - int (*get_keypair_public)(const struct keymaster_device* dev, - const uint8_t* key_blob, const size_t key_blob_length, - uint8_t** x509_data, size_t* x509_data_length); - - /** - * Deletes the key pair associated with the key blob. - * - * This function is optional and should be set to NULL if it is not - * implemented. - * - * Returns 0 on success or an error code less than 0. - */ - int (*delete_keypair)(const struct keymaster_device* dev, - const uint8_t* key_blob, const size_t key_blob_length); - - /** - * Deletes all keys in the hardware keystore. Used when keystore is - * reset completely. - * - * This function is optional and should be set to NULL if it is not - * implemented. - * - * Returns 0 on success or an error code less than 0. - */ - int (*delete_all)(const struct keymaster_device* dev); - - /** - * Signs data using a key-blob generated before. This can use either - * an asymmetric key or a secret key. - * - * Returns: 0 on success or an error code less than 0. - */ - int (*sign_data)(const struct keymaster_device* dev, - const void* signing_params, - const uint8_t* key_blob, const size_t key_blob_length, - const uint8_t* data, const size_t data_length, - uint8_t** signed_data, size_t* signed_data_length); - - /** - * Verifies data signed with a key-blob. This can use either - * an asymmetric key or a secret key. - * - * Returns: 0 on successful verification or an error code less than 0. - */ - int (*verify_data)(const struct keymaster_device* dev, - const void* signing_params, - const uint8_t* key_blob, const size_t key_blob_length, - const uint8_t* signed_data, const size_t signed_data_length, - const uint8_t* signature, const size_t signature_length); -}; -typedef struct keymaster_device keymaster_device_t; - - -/* Convenience API for opening and closing keymaster devices */ - -static inline int keymaster_open(const struct hw_module_t* module, - keymaster_device_t** device) -{ - int rc = module->methods->open(module, KEYSTORE_KEYMASTER, - (struct hw_device_t**) device); - - if (!rc) { - (*device)->client_version = KEYMASTER_API_VERSION; - } - - return rc; -} - -static inline int keymaster_close(keymaster_device_t* device) -{ - return device->common.close(&device->common); -} - -__END_DECLS - -#endif // ANDROID_HARDWARE_KEYMASTER_H - diff --git a/external/android/include/18/hardware/libhardware/include/hardware/lights.h b/external/android/include/18/hardware/libhardware/include/hardware/lights.h deleted file mode 100644 index 2cf5519..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/lights.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_LIGHTS_INTERFACE_H -#define ANDROID_LIGHTS_INTERFACE_H - -#include -#include -#include - -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define LIGHTS_HARDWARE_MODULE_ID "lights" - -/* - * These light IDs correspond to logical lights, not physical. - * So for example, if your INDICATOR light is in line with your - * BUTTONS, it might make sense to also light the INDICATOR - * light to a reasonable color when the BUTTONS are lit. - */ -#define LIGHT_ID_BACKLIGHT "backlight" -#define LIGHT_ID_KEYBOARD "keyboard" -#define LIGHT_ID_BUTTONS "buttons" -#define LIGHT_ID_BATTERY "battery" -#define LIGHT_ID_NOTIFICATIONS "notifications" -#define LIGHT_ID_ATTENTION "attention" - -/* - * These lights aren't currently supported by the higher - * layers, but could be someday, so we have the constants - * here now. - */ -#define LIGHT_ID_BLUETOOTH "bluetooth" -#define LIGHT_ID_WIFI "wifi" - -/* ************************************************************************ - * Flash modes for the flashMode field of light_state_t. - */ - -#define LIGHT_FLASH_NONE 0 - -/** - * To flash the light at a given rate, set flashMode to LIGHT_FLASH_TIMED, - * and then flashOnMS should be set to the number of milliseconds to turn - * the light on, followed by the number of milliseconds to turn the light - * off. - */ -#define LIGHT_FLASH_TIMED 1 - -/** - * To flash the light using hardware assist, set flashMode to - * the hardware mode. - */ -#define LIGHT_FLASH_HARDWARE 2 - -/** - * Light brightness is managed by a user setting. - */ -#define BRIGHTNESS_MODE_USER 0 - -/** - * Light brightness is managed by a light sensor. - */ -#define BRIGHTNESS_MODE_SENSOR 1 - -/** - * The parameters that can be set for a given light. - * - * Not all lights must support all parameters. If you - * can do something backward-compatible, you should. - */ -struct light_state_t { - /** - * The color of the LED in ARGB. - * - * Do your best here. - * - If your light can only do red or green, if they ask for blue, - * you should do green. - * - If you can only do a brightness ramp, then use this formula: - * unsigned char brightness = ((77*((color>>16)&0x00ff)) - * + (150*((color>>8)&0x00ff)) + (29*(color&0x00ff))) >> 8; - * - If you can only do on or off, 0 is off, anything else is on. - * - * The high byte should be ignored. Callers will set it to 0xff (which - * would correspond to 255 alpha). - */ - unsigned int color; - - /** - * See the LIGHT_FLASH_* constants - */ - int flashMode; - int flashOnMS; - int flashOffMS; - - /** - * Policy used by the framework to manage the light's brightness. - * Currently the values are BRIGHTNESS_MODE_USER and BRIGHTNESS_MODE_SENSOR. - */ - int brightnessMode; -}; - -struct light_device_t { - struct hw_device_t common; - - /** - * Set the provided lights to the provided values. - * - * Returns: 0 on succes, error code on failure. - */ - int (*set_light)(struct light_device_t* dev, - struct light_state_t const* state); -}; - - -__END_DECLS - -#endif // ANDROID_LIGHTS_INTERFACE_H - diff --git a/external/android/include/18/hardware/libhardware/include/hardware/local_time_hal.h b/external/android/include/18/hardware/libhardware/include/hardware/local_time_hal.h deleted file mode 100644 index 6b6a317..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/local_time_hal.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (C) 2011 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_LOCAL_TIME_HAL_INTERFACE_H -#define ANDROID_LOCAL_TIME_HAL_INTERFACE_H - -#include - -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define LOCAL_TIME_HARDWARE_MODULE_ID "local_time" - -/** - * Name of the local time devices to open - */ -#define LOCAL_TIME_HARDWARE_INTERFACE "local_time_hw_if" - -/**********************************************************************/ - -/** - * A structure used to collect low level sync data in a lab environment. Most - * HAL implementations will never need this structure. - */ -struct local_time_debug_event { - int64_t local_timesync_event_id; - int64_t local_time; -}; - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -struct local_time_module { - struct hw_module_t common; -}; - -struct local_time_hw_device { - struct hw_device_t common; - - /** - * - * Returns the current value of the system wide local time counter - */ - int64_t (*get_local_time)(struct local_time_hw_device* dev); - - /** - * - * Returns the nominal frequency (in hertz) of the system wide local time - * counter - */ - uint64_t (*get_local_freq)(struct local_time_hw_device* dev); - - /** - * - * Sets the HW slew rate of oscillator which drives the system wide local - * time counter. On success, platforms should return 0. Platforms which - * do not support HW slew should leave this method set to NULL. - * - * Valid values for rate range from MIN_INT16 to MAX_INT16. Platform - * implementations should attempt map this range linearly to the min/max - * slew rate of their hardware. - */ - int (*set_local_slew)(struct local_time_hw_device* dev, int16_t rate); - - /** - * - * A method used to collect low level sync data in a lab environments. - * Most HAL implementations will simply set this member to NULL, or return - * -EINVAL to indicate that this functionality is not supported. - * Production HALs should never support this method. - */ - int (*get_debug_log)(struct local_time_hw_device* dev, - struct local_time_debug_event* records, - int max_records); -}; - -typedef struct local_time_hw_device local_time_hw_device_t; - -/** convenience API for opening and closing a supported device */ - -static inline int local_time_hw_device_open( - const struct hw_module_t* module, - struct local_time_hw_device** device) -{ - return module->methods->open(module, LOCAL_TIME_HARDWARE_INTERFACE, - (struct hw_device_t**)device); -} - -static inline int local_time_hw_device_close(struct local_time_hw_device* device) -{ - return device->common.close(&device->common); -} - - -__END_DECLS - -#endif // ANDROID_LOCAL_TIME_INTERFACE_H diff --git a/external/android/include/18/hardware/libhardware/include/hardware/nfc.h b/external/android/include/18/hardware/libhardware/include/hardware/nfc.h deleted file mode 100644 index 09523b3..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/nfc.h +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Copyright (C) 2011, 2012 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_NFC_HAL_INTERFACE_H -#define ANDROID_NFC_HAL_INTERFACE_H - -#include -#include -#include -#include - -#include - -__BEGIN_DECLS - - -/* NFC device HAL for NCI-based NFC controllers. - * - * This HAL allows NCI silicon vendors to make use - * of the core NCI stack in Android for their own silicon. - * - * The responibilities of the NCI HAL implementation - * are as follows: - * - * - Implement the transport to the NFC controller - * - Implement each of the HAL methods specified below as applicable to their silicon - * - Pass up received NCI messages from the controller to the stack - * - * A simplified timeline of NCI HAL method calls: - * 1) Core NCI stack calls open() - * 2) Core NCI stack executes CORE_RESET and CORE_INIT through calls to write() - * 3) Core NCI stack calls core_initialized() to allow HAL to do post-init configuration - * 4) Core NCI stack calls pre_discover() to allow HAL to prepare for RF discovery - * 5) Core NCI stack starts discovery through calls to write() - * 6) Core NCI stack stops discovery through calls to write() (e.g. screen turns off) - * 7) Core NCI stack calls pre_discover() to prepare for RF discovery (e.g. screen turned back on) - * 8) Core NCI stack starts discovery through calls to write() - * ... - * ... - * 9) Core NCI stack calls close() - */ -#define NFC_NCI_HARDWARE_MODULE_ID "nfc_nci" -#define NFC_NCI_CONTROLLER "nci" - -/* - * nfc_nci_module_t should contain module-specific parameters - */ -typedef struct nfc_nci_module_t { - struct hw_module_t common; -} nfc_nci_module_t; - -/* - * HAL events that can be passed back to the stack - */ -typedef uint8_t nfc_event_t; - -enum { - HAL_NFC_OPEN_CPLT_EVT = 0x00, - HAL_NFC_CLOSE_CPLT_EVT = 0x01, - HAL_NFC_POST_INIT_CPLT_EVT = 0x02, - HAL_NFC_PRE_DISCOVER_CPLT_EVT = 0x03, - HAL_NFC_REQUEST_CONTROL_EVT = 0x04, - HAL_NFC_RELEASE_CONTROL_EVT = 0x05, - HAL_NFC_ERROR_EVT = 0x06 -}; - -/* - * Allowed status return values for each of the HAL methods - */ -typedef uint8_t nfc_status_t; - -enum { - HAL_NFC_STATUS_OK = 0x00, - HAL_NFC_STATUS_FAILED = 0x01, - HAL_NFC_STATUS_ERR_TRANSPORT = 0x02, - HAL_NFC_STATUS_ERR_CMD_TIMEOUT = 0x03, - HAL_NFC_STATUS_REFUSED = 0x04 -}; - -/* - * The callback passed in from the NFC stack that the HAL - * can use to pass events back to the stack. - */ -typedef void (nfc_stack_callback_t) (nfc_event_t event, nfc_status_t event_status); - -/* - * The callback passed in from the NFC stack that the HAL - * can use to pass incomming data to the stack. - */ -typedef void (nfc_stack_data_callback_t) (uint16_t data_len, uint8_t* p_data); - -/* nfc_nci_device_t starts with a hw_device_t struct, - * followed by device-specific methods and members. - * - * All methods in the NCI HAL are asynchronous. - */ -typedef struct nfc_nci_device { - struct hw_device_t common; - /* - * (*open)() Opens the NFC controller device and performs initialization. - * This may include patch download and other vendor-specific initialization. - * - * If open completes successfully, the controller should be ready to perform - * NCI initialization - ie accept CORE_RESET and subsequent commands through - * the write() call. - * - * If open() returns 0, the NCI stack will wait for a HAL_NFC_OPEN_CPLT_EVT - * before continuing. - * - * If open() returns any other value, the NCI stack will stop. - * - */ - int (*open)(const struct nfc_nci_device *p_dev, nfc_stack_callback_t *p_cback, - nfc_stack_data_callback_t *p_data_cback); - - /* - * (*write)() Performs an NCI write. - * - * This method may queue writes and return immediately. The only - * requirement is that the writes are executed in order. - */ - int (*write)(const struct nfc_nci_device *p_dev, uint16_t data_len, const uint8_t *p_data); - - /* - * (*core_initialized)() is called after the CORE_INIT_RSP is received from the NFCC. - * At this time, the HAL can do any chip-specific configuration. - * - * If core_initialized() returns 0, the NCI stack will wait for a HAL_NFC_POST_INIT_CPLT_EVT - * before continuing. - * - * If core_initialized() returns any other value, the NCI stack will continue - * immediately. - */ - int (*core_initialized)(const struct nfc_nci_device *p_dev, uint8_t* p_core_init_rsp_params); - - /* - * (*pre_discover)() Is called every time before starting RF discovery. - * It is a good place to do vendor-specific configuration that must be - * performed every time RF discovery is about to be started. - * - * If pre_discover() returns 0, the NCI stack will wait for a HAL_NFC_PRE_DISCOVER_CPLT_EVT - * before continuing. - * - * If pre_discover() returns any other value, the NCI stack will start - * RF discovery immediately. - */ - int (*pre_discover)(const struct nfc_nci_device *p_dev); - - /* - * (*close)() Closed the NFC controller. Should free all resources. - */ - int (*close)(const struct nfc_nci_device *p_dev); - - /* - * (*control_granted)() Grant HAL the exclusive control to send NCI commands. - * Called in response to HAL_REQUEST_CONTROL_EVT. - * Must only be called when there are no NCI commands pending. - * HAL_RELEASE_CONTROL_EVT will notify when HAL no longer needs exclusive control. - */ - int (*control_granted)(const struct nfc_nci_device *p_dev); - - /* - * (*power_cycle)() Restart controller by power cyle; - * HAL_OPEN_CPLT_EVT will notify when operation is complete. - */ - int (*power_cycle)(const struct nfc_nci_device *p_dev); -} nfc_nci_device_t; - -/* - * Convenience methods that the NFC stack can use to open - * and close an NCI device - */ -static inline int nfc_nci_open(const struct hw_module_t* module, - nfc_nci_device_t** dev) { - return module->methods->open(module, NFC_NCI_CONTROLLER, - (struct hw_device_t**) dev); -} - -static inline int nfc_nci_close(nfc_nci_device_t* dev) { - return dev->common.close(&dev->common); -} -/* - * End NFC NCI HAL - */ - -/* - * This is a limited NFC HAL for NXP PN544-based devices. - * This HAL as Android is moving to - * an NCI-based NFC stack. - * - * All NCI-based NFC controllers should use the NFC-NCI - * HAL instead. - * Begin PN544 specific HAL - */ -#define NFC_HARDWARE_MODULE_ID "nfc" - -#define NFC_PN544_CONTROLLER "pn544" - -typedef struct nfc_module_t { - struct hw_module_t common; -} nfc_module_t; - -/* - * PN544 linktypes. - * UART - * I2C - * USB (uses UART DAL) - */ -typedef enum { - PN544_LINK_TYPE_UART, - PN544_LINK_TYPE_I2C, - PN544_LINK_TYPE_USB, - PN544_LINK_TYPE_INVALID, -} nfc_pn544_linktype; - -typedef struct { - struct hw_device_t common; - - /* The number of EEPROM registers to write */ - uint32_t num_eeprom_settings; - - /* The actual EEPROM settings - * For PN544, each EEPROM setting is a 4-byte entry, - * of the format [0x00, addr_msb, addr_lsb, value]. - */ - uint8_t* eeprom_settings; - - /* The link type to which the PN544 is connected */ - nfc_pn544_linktype linktype; - - /* The device node to which the PN544 is connected */ - const char* device_node; - - /* On Crespo we had an I2C issue that would cause us to sometimes read - * the I2C slave address (0x57) over the bus. libnfc contains - * a hack to ignore this byte and try to read the length byte - * again. - * Set to 0 to disable the workaround, 1 to enable it. - */ - uint8_t enable_i2c_workaround; - /* I2C slave address. Multiple I2C addresses are - * possible for PN544 module. Configure address according to - * board design. - */ - uint8_t i2c_device_address; -} nfc_pn544_device_t; - -static inline int nfc_pn544_open(const struct hw_module_t* module, - nfc_pn544_device_t** dev) { - return module->methods->open(module, NFC_PN544_CONTROLLER, - (struct hw_device_t**) dev); -} - -static inline int nfc_pn544_close(nfc_pn544_device_t* dev) { - return dev->common.close(&dev->common); -} -/* - * End PN544 specific HAL - */ - -__END_DECLS - -#endif // ANDROID_NFC_HAL_INTERFACE_H diff --git a/external/android/include/18/hardware/libhardware/include/hardware/power.h b/external/android/include/18/hardware/libhardware/include/hardware/power.h deleted file mode 100644 index 6c55061..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/power.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (C) 2012 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_INCLUDE_HARDWARE_POWER_H -#define ANDROID_INCLUDE_HARDWARE_POWER_H - -#include -#include -#include - -#include - -__BEGIN_DECLS - -#define POWER_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) -#define POWER_MODULE_API_VERSION_0_2 HARDWARE_MODULE_API_VERSION(0, 2) - - -/** - * The id of this module - */ -#define POWER_HARDWARE_MODULE_ID "power" - -/* - * Power hint identifiers passed to (*powerHint) - */ - -typedef enum { - POWER_HINT_VSYNC = 0x00000001, - POWER_HINT_INTERACTION = 0x00000002, -} power_hint_t; - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -typedef struct power_module { - struct hw_module_t common; - - /* - * (*init)() performs power management setup actions at runtime - * startup, such as to set default cpufreq parameters. This is - * called only by the Power HAL instance loaded by - * PowerManagerService. - */ - void (*init)(struct power_module *module); - - /* - * (*setInteractive)() performs power management actions upon the - * system entering interactive state (that is, the system is awake - * and ready for interaction, often with UI devices such as - * display and touchscreen enabled) or non-interactive state (the - * system appears asleep, display usually turned off). The - * non-interactive state is usually entered after a period of - * inactivity, in order to conserve battery power during - * such inactive periods. - * - * Typical actions are to turn on or off devices and adjust - * cpufreq parameters. This function may also call the - * appropriate interfaces to allow the kernel to suspend the - * system to low-power sleep state when entering non-interactive - * state, and to disallow low-power suspend when the system is in - * interactive state. When low-power suspend state is allowed, the - * kernel may suspend the system whenever no wakelocks are held. - * - * on is non-zero when the system is transitioning to an - * interactive / awake state, and zero when transitioning to a - * non-interactive / asleep state. - * - * This function is called to enter non-interactive state after - * turning off the screen (if present), and called to enter - * interactive state prior to turning on the screen. - */ - void (*setInteractive)(struct power_module *module, int on); - - /* - * (*powerHint) is called to pass hints on power requirements, which - * may result in adjustment of power/performance parameters of the - * cpufreq governor and other controls. The possible hints are: - * - * POWER_HINT_VSYNC - * - * Foreground app has started or stopped requesting a VSYNC pulse - * from SurfaceFlinger. If the app has started requesting VSYNC - * then CPU and GPU load is expected soon, and it may be appropriate - * to raise speeds of CPU, memory bus, etc. The data parameter is - * non-zero to indicate VSYNC pulse is now requested, or zero for - * VSYNC pulse no longer requested. - * - * POWER_HINT_INTERACTION - * - * User is interacting with the device, for example, touchscreen - * events are incoming. CPU and GPU load may be expected soon, - * and it may be appropriate to raise speeds of CPU, memory bus, - * etc. The data parameter is unused. - * - * A particular platform may choose to ignore any hint. - * - * availability: version 0.2 - * - */ - void (*powerHint)(struct power_module *module, power_hint_t hint, - void *data); -} power_module_t; - - -__END_DECLS - -#endif // ANDROID_INCLUDE_HARDWARE_POWER_H diff --git a/external/android/include/18/hardware/libhardware/include/hardware/qemu_pipe.h b/external/android/include/18/hardware/libhardware/include/hardware/qemu_pipe.h deleted file mode 100644 index 1a67022..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/qemu_pipe.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011 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_INCLUDE_HARDWARE_QEMU_PIPE_H -#define ANDROID_INCLUDE_HARDWARE_QEMU_PIPE_H - -#include -#include -#include -#include -#include /* for pthread_once() */ -#include -#include -#include - -#ifndef D -# define D(...) do{}while(0) -#endif - -/* Try to open a new Qemu fast-pipe. This function returns a file descriptor - * that can be used to communicate with a named service managed by the - * emulator. - * - * This file descriptor can be used as a standard pipe/socket descriptor. - * - * 'pipeName' is the name of the emulator service you want to connect to. - * E.g. 'opengles' or 'camera'. - * - * On success, return a valid file descriptor - * Returns -1 on error, and errno gives the error code, e.g.: - * - * EINVAL -> unknown/unsupported pipeName - * ENOSYS -> fast pipes not available in this system. - * - * ENOSYS should never happen, except if you're trying to run within a - * misconfigured emulator. - * - * You should be able to open several pipes to the same pipe service, - * except for a few special cases (e.g. GSM modem), where EBUSY will be - * returned if more than one client tries to connect to it. - */ -static __inline__ int -qemu_pipe_open(const char* pipeName) -{ - char buff[256]; - int buffLen; - int fd, ret; - - if (pipeName == NULL || pipeName[0] == '\0') { - errno = EINVAL; - return -1; - } - - snprintf(buff, sizeof buff, "pipe:%s", pipeName); - - fd = open("/dev/qemu_pipe", O_RDWR); - if (fd < 0) { - D("%s: Could not open /dev/qemu_pipe: %s", __FUNCTION__, strerror(errno)); - //errno = ENOSYS; - return -1; - } - - buffLen = strlen(buff); - - ret = TEMP_FAILURE_RETRY(write(fd, buff, buffLen+1)); - if (ret != buffLen+1) { - D("%s: Could not connect to %s pipe service: %s", __FUNCTION__, pipeName, strerror(errno)); - if (ret == 0) { - errno = ECONNRESET; - } else if (ret > 0) { - errno = EINVAL; - } - return -1; - } - - return fd; -} - -#endif /* ANDROID_INCLUDE_HARDWARE_QEMUD_PIPE_H */ diff --git a/external/android/include/18/hardware/libhardware/include/hardware/qemud.h b/external/android/include/18/hardware/libhardware/include/hardware/qemud.h deleted file mode 100644 index 5c39f9c..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/qemud.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_INCLUDE_HARDWARE_QEMUD_H -#define ANDROID_INCLUDE_HARDWARE_QEMUD_H - -#include -#include "qemu_pipe.h" - -/* the following is helper code that is used by the QEMU-specific - * hardware HAL modules to communicate with the emulator program - * through the 'qemud' multiplexing daemon, or through the qemud - * pipe. - * - * see the documentation comments for details in - * development/emulator/qemud/qemud.c - * - * all definitions here are built into the HAL module to avoid - * having to write a tiny shared library for this. - */ - -/* we expect the D macro to be defined to a function macro - * that sends its formatted string argument(s) to the log. - * If not, ignore the traces. - */ -#ifndef D -# define D(...) ((void)0) -#endif - -static __inline__ int -qemud_fd_write(int fd, const void* buff, int len) -{ - int len2; - do { - len2 = write(fd, buff, len); - } while (len2 < 0 && errno == EINTR); - return len2; -} - -static __inline__ int -qemud_fd_read(int fd, void* buff, int len) -{ - int len2; - do { - len2 = read(fd, buff, len); - } while (len2 < 0 && errno == EINTR); - return len2; -} - -static __inline__ int -qemud_channel_open(const char* name) -{ - int fd; - int namelen = strlen(name); - char answer[2]; - char pipe_name[256]; - - /* First, try to connect to the pipe. */ - snprintf(pipe_name, sizeof(pipe_name), "qemud:%s", name); - fd = qemu_pipe_open(pipe_name); - if (fd < 0) { - D("QEMUD pipe is not available for %s: %s", name, strerror(errno)); - /* If pipe is not available, connect to qemud control socket */ - fd = socket_local_client( "qemud", - ANDROID_SOCKET_NAMESPACE_RESERVED, - SOCK_STREAM ); - if (fd < 0) { - D("no qemud control socket: %s", strerror(errno)); - return -1; - } - - /* send service name to connect */ - if (qemud_fd_write(fd, name, namelen) != namelen) { - D("can't send service name to qemud: %s", - strerror(errno)); - close(fd); - return -1; - } - - /* read answer from daemon */ - if (qemud_fd_read(fd, answer, 2) != 2 || - answer[0] != 'O' || answer[1] != 'K') { - D("cant' connect to %s service through qemud", name); - close(fd); - return -1; - } - } - return fd; -} - -static __inline__ int -qemud_channel_send(int fd, const void* msg, int msglen) -{ - char header[5]; - - if (msglen < 0) - msglen = strlen((const char*)msg); - - if (msglen == 0) - return 0; - - snprintf(header, sizeof header, "%04x", msglen); - if (qemud_fd_write(fd, header, 4) != 4) { - D("can't write qemud frame header: %s", strerror(errno)); - return -1; - } - - if (qemud_fd_write(fd, msg, msglen) != msglen) { - D("can4t write qemud frame payload: %s", strerror(errno)); - return -1; - } - return 0; -} - -static __inline__ int -qemud_channel_recv(int fd, void* msg, int msgsize) -{ - char header[5]; - int size, avail; - - if (qemud_fd_read(fd, header, 4) != 4) { - D("can't read qemud frame header: %s", strerror(errno)); - return -1; - } - header[4] = 0; - if (sscanf(header, "%04x", &size) != 1) { - D("malformed qemud frame header: '%.*s'", 4, header); - return -1; - } - if (size > msgsize) - return -1; - - if (qemud_fd_read(fd, msg, size) != size) { - D("can't read qemud frame payload: %s", strerror(errno)); - return -1; - } - return size; -} - -#endif /* ANDROID_INCLUDE_HARDWARE_QEMUD_H */ diff --git a/external/android/include/18/hardware/libhardware/include/hardware/sensors.h b/external/android/include/18/hardware/libhardware/include/hardware/sensors.h deleted file mode 100644 index 7778e8f..0000000 --- a/external/android/include/18/hardware/libhardware/include/hardware/sensors.h +++ /dev/null @@ -1,1183 +0,0 @@ -/* - * Copyright (C) 2012 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_SENSORS_INTERFACE_H -#define ANDROID_SENSORS_INTERFACE_H - -#include -#include -#include - -#include -#include - -__BEGIN_DECLS - -/*****************************************************************************/ - -#define SENSORS_HEADER_VERSION 1 -#define SENSORS_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) -#define SENSORS_DEVICE_API_VERSION_0_1 HARDWARE_DEVICE_API_VERSION_2(0, 1, SENSORS_HEADER_VERSION) -#define SENSORS_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION_2(1, 0, SENSORS_HEADER_VERSION) - -/** - * The id of this module - */ -#define SENSORS_HARDWARE_MODULE_ID "sensors" - -/** - * Name of the sensors device to open - */ -#define SENSORS_HARDWARE_POLL "poll" - -/** - * Handles must be higher than SENSORS_HANDLE_BASE and must be unique. - * A Handle identifies a given sensors. The handle is used to activate - * and/or deactivate sensors. - * In this version of the API there can only be 256 handles. - */ -#define SENSORS_HANDLE_BASE 0 -#define SENSORS_HANDLE_BITS 8 -#define SENSORS_HANDLE_COUNT (1<0 - * ^ - * | - * +-----------+--> y>0 - * | | - * | | - * | | - * | | / z<0 - * | | / - * | | / - * O-----------+/ - * |[] [ ] []/ - * +----------/+ y<0 - * / - * / - * |/ z>0 (toward the sky) - * - * O: Origin (x=0,y=0,z=0) - * - */ - -/* - * Interaction with suspend mode - * - * Unless otherwise noted, an enabled sensor shall not prevent the - * SoC to go into suspend mode. It is the responsibility of applications - * to keep a partial wake-lock should they wish to receive sensor - * events while the screen is off. While in suspend mode, and unless - * otherwise noted (batch mode, sensor particularities, ...), enabled sensors' - * events are lost. - * - * Note that conceptually, the sensor itself is not de-activated while in - * suspend mode -- it's just that the data it returns are lost. As soon as - * the SoC gets out of suspend mode, operations resume as usual. Of course, - * in practice sensors shall be disabled while in suspend mode to - * save power, unless batch mode is active, in which case they must - * continue fill their internal FIFO (see the documentation of batch() to - * learn how suspend interacts with batch mode). - * - * In batch mode, and only when the flag SENSORS_BATCH_WAKE_UPON_FIFO_FULL is - * set and supported, the specified sensor must be able to wake-up the SoC and - * be able to buffer at least 10 seconds worth of the requested sensor events. - * - * There are notable exceptions to this behavior, which are sensor-dependent - * (see sensor types definitions below) - * - * - * The sensor type documentation below specifies the wake-up behavior of - * each sensor: - * wake-up: yes this sensor must wake-up the SoC to deliver events - * wake-up: no this sensor shall not wake-up the SoC, events are dropped - * - */ - -/* - * Sensor type - * - * Each sensor has a type which defines what this sensor measures and how - * measures are reported. All types are defined below. - */ - -/* - * Sensor fusion and virtual sensors - * - * Many sensor types are or can be implemented as virtual sensors from - * physical sensors on the device. For instance the rotation vector sensor, - * orientation sensor, step-detector, step-counter, etc... - * - * From the point of view of this API these virtual sensors MUST appear as - * real, individual sensors. It is the responsibility of the driver and HAL - * to make sure this is the case. - * - * In particular, all sensors must be able to function concurrently. - * For example, if defining both an accelerometer and a step counter, - * then both must be able to work concurrently. - */ - -/* - * Trigger modes - * - * Sensors can report events in different ways called trigger modes, - * each sensor type has one and only one trigger mode associated to it. - * Currently there are four trigger modes defined: - * - * continuous: events are reported at a constant rate defined by setDelay(). - * eg: accelerometers, gyroscopes. - * on-change: events are reported only if the sensor's value has changed. - * setDelay() is used to set a lower limit to the reporting - * period (minimum time between two events). - * The HAL must return an event immediately when an on-change - * sensor is activated. - * eg: proximity, light sensors - * one-shot: upon detection of an event, the sensor deactivates itself and - * then sends a single event. Order matters to avoid race - * conditions. No other event is sent until the sensor get - * reactivated. setDelay() is ignored. - * eg: significant motion sensor - * special: see details in the sensor type specification below - * - */ - -/* - * SENSOR_TYPE_ACCELEROMETER - * trigger-mode: continuous - * wake-up sensor: no - * - * All values are in SI units (m/s^2) and measure the acceleration of the - * device minus the force of gravity. - * - * Acceleration sensors return sensor events for all 3 axes at a constant - * rate defined by setDelay(). - * - * x: Acceleration on the x-axis - * y: Acceleration on the y-axis - * z: Acceleration on the z-axis - * - * Note that the readings from the accelerometer include the acceleration - * due to gravity (which is opposite to the direction of the gravity vector). - * - * Examples: - * The norm of should be close to 0 when in free fall. - * - * When the device lies flat on a table and is pushed on its left side - * toward the right, the x acceleration value is positive. - * - * When the device lies flat on a table, the acceleration value is +9.81, - * which correspond to the acceleration of the device (0 m/s^2) minus the - * force of gravity (-9.81 m/s^2). - * - * When the device lies flat on a table and is pushed toward the sky, the - * acceleration value is greater than +9.81, which correspond to the - * acceleration of the device (+A m/s^2) minus the force of - * gravity (-9.81 m/s^2). - */ -#define SENSOR_TYPE_ACCELEROMETER (1) - -/* - * SENSOR_TYPE_GEOMAGNETIC_FIELD - * trigger-mode: continuous - * wake-up sensor: no - * - * All values are in micro-Tesla (uT) and measure the geomagnetic - * field in the X, Y and Z axis. - * - * Returned values include calibration mechanisms such that the vector is - * aligned with the magnetic declination and heading of the earth's - * geomagnetic field. - * - * Magnetic Field sensors return sensor events for all 3 axes at a constant - * rate defined by setDelay(). - */ -#define SENSOR_TYPE_GEOMAGNETIC_FIELD (2) -#define SENSOR_TYPE_MAGNETIC_FIELD SENSOR_TYPE_GEOMAGNETIC_FIELD - -/* - * SENSOR_TYPE_ORIENTATION - * trigger-mode: continuous - * wake-up sensor: no - * - * All values are angles in degrees. - * - * Orientation sensors return sensor events for all 3 axes at a constant - * rate defined by setDelay(). - * - * azimuth: angle between the magnetic north direction and the Y axis, around - * the Z axis (0<=azimuth<360). - * 0=North, 90=East, 180=South, 270=West - * - * pitch: Rotation around X axis (-180<=pitch<=180), with positive values when - * the z-axis moves toward the y-axis. - * - * roll: Rotation around Y axis (-90<=roll<=90), with positive values when - * the x-axis moves towards the z-axis. - * - * Note: For historical reasons the roll angle is positive in the clockwise - * direction (mathematically speaking, it should be positive in the - * counter-clockwise direction): - * - * Z - * ^ - * (+roll) .--> | - * / | - * | | roll: rotation around Y axis - * X <-------(.) - * Y - * note that +Y == -roll - * - * - * - * Note: This definition is different from yaw, pitch and roll used in aviation - * where the X axis is along the long side of the plane (tail to nose). - */ -#define SENSOR_TYPE_ORIENTATION (3) - -/* - * SENSOR_TYPE_GYROSCOPE - * trigger-mode: continuous - * wake-up sensor: no - * - * All values are in radians/second and measure the rate of rotation - * around the X, Y and Z axis. The coordinate system is the same as is - * used for the acceleration sensor. Rotation is positive in the - * counter-clockwise direction (right-hand rule). That is, an observer - * looking from some positive location on the x, y or z axis at a device - * positioned on the origin would report positive rotation if the device - * appeared to be rotating counter clockwise. Note that this is the - * standard mathematical definition of positive rotation and does not agree - * with the definition of roll given earlier. - * The range should at least be 17.45 rad/s (ie: ~1000 deg/s). - * - * automatic gyro-drift compensation is allowed but not required. - */ -#define SENSOR_TYPE_GYROSCOPE (4) - -/* - * SENSOR_TYPE_LIGHT - * trigger-mode: on-change - * wake-up sensor: no - * - * The light sensor value is returned in SI lux units. - */ -#define SENSOR_TYPE_LIGHT (5) - -/* - * SENSOR_TYPE_PRESSURE - * trigger-mode: continuous - * wake-up sensor: no - * - * The pressure sensor return the athmospheric pressure in hectopascal (hPa) - */ -#define SENSOR_TYPE_PRESSURE (6) - -/* SENSOR_TYPE_TEMPERATURE is deprecated in the HAL */ -#define SENSOR_TYPE_TEMPERATURE (7) - -/* - * SENSOR_TYPE_PROXIMITY - * trigger-mode: on-change - * wake-up sensor: yes - * - * The distance value is measured in centimeters. Note that some proximity - * sensors only support a binary "close" or "far" measurement. In this case, - * the sensor should report its maxRange value in the "far" state and a value - * less than maxRange in the "near" state. - */ -#define SENSOR_TYPE_PROXIMITY (8) - -/* - * SENSOR_TYPE_GRAVITY - * trigger-mode: continuous - * wake-up sensor: no - * - * A gravity output indicates the direction of and magnitude of gravity in - * the devices's coordinates. On Earth, the magnitude is 9.8 m/s^2. - * Units are m/s^2. The coordinate system is the same as is used for the - * acceleration sensor. When the device is at rest, the output of the - * gravity sensor should be identical to that of the accelerometer. - */ -#define SENSOR_TYPE_GRAVITY (9) - -/* - * SENSOR_TYPE_LINEAR_ACCELERATION - * trigger-mode: continuous - * wake-up sensor: no - * - * Indicates the linear acceleration of the device in device coordinates, - * not including gravity. - * - * The output is conceptually: - * output of TYPE_ACCELERATION - output of TYPE_GRAVITY - * - * Readings on all axes should be close to 0 when device lies on a table. - * Units are m/s^2. - * The coordinate system is the same as is used for the acceleration sensor. - */ -#define SENSOR_TYPE_LINEAR_ACCELERATION (10) - - -/* - * SENSOR_TYPE_ROTATION_VECTOR - * trigger-mode: continuous - * wake-up sensor: no - * - * The rotation vector symbolizes the orientation of the device relative to the - * East-North-Up coordinates frame. It is usually obtained by integration of - * accelerometer, gyroscope and magnetometer readings. - * - * The East-North-Up coordinate system is defined as a direct orthonormal basis - * where: - * - X points east and is tangential to the ground. - * - Y points north and is tangential to the ground. - * - Z points towards the sky and is perpendicular to the ground. - * - * The orientation of the phone is represented by the rotation necessary to - * align the East-North-Up coordinates with the phone's coordinates. That is, - * applying the rotation to the world frame (X,Y,Z) would align them with the - * phone coordinates (x,y,z). - * - * The rotation can be seen as rotating the phone by an angle theta around - * an axis rot_axis to go from the reference (East-North-Up aligned) device - * orientation to the current device orientation. - * - * The rotation is encoded as the 4 (reordered) components of a unit quaternion: - * sensors_event_t.data[0] = rot_axis.x*sin(theta/2) - * sensors_event_t.data[1] = rot_axis.y*sin(theta/2) - * sensors_event_t.data[2] = rot_axis.z*sin(theta/2) - * sensors_event_t.data[3] = cos(theta/2) - * where - * - rot_axis.x,y,z are the North-East-Up coordinates of a unit length vector - * representing the rotation axis - * - theta is the rotation angle - * - * The quaternion must be of norm 1 (it is a unit quaternion). Failure to ensure - * this will cause erratic client behaviour. - * - * In addition, this sensor reports an estimated heading accuracy. - * sensors_event_t.data[4] = estimated_accuracy (in radians) - * The heading error must be less than estimated_accuracy 95% of the time - * - * This sensor must use a gyroscope and an accelerometer as main orientation - * change input. - * - * This sensor can also include magnetometer input to make up for gyro drift, - * but it cannot be implemented using only a magnetometer. - */ -#define SENSOR_TYPE_ROTATION_VECTOR (11) - -/* - * SENSOR_TYPE_RELATIVE_HUMIDITY - * trigger-mode: on-change - * wake-up sensor: no - * - * A relative humidity sensor measures relative ambient air humidity and - * returns a value in percent. - */ -#define SENSOR_TYPE_RELATIVE_HUMIDITY (12) - -/* - * SENSOR_TYPE_AMBIENT_TEMPERATURE - * trigger-mode: on-change - * wake-up sensor: no - * - * The ambient (room) temperature in degree Celsius. - */ -#define SENSOR_TYPE_AMBIENT_TEMPERATURE (13) - -/* - * SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED - * trigger-mode: continuous - * wake-up sensor: no - * - * Similar to SENSOR_TYPE_MAGNETIC_FIELD, but the hard iron calibration is - * reported separately instead of being included in the measurement. - * Factory calibration and temperature compensation should still be applied to - * the "uncalibrated" measurement. - * Separating away the hard iron calibration estimation allows the system to - * better recover from bad hard iron estimation. - * - * All values are in micro-Tesla (uT) and measure the ambient magnetic - * field in the X, Y and Z axis. Assumptions that the the magnetic field - * is due to the Earth's poles should be avoided. - * - * The uncalibrated_magnetic event contains - * - 3 fields for uncalibrated measurement: x_uncalib, y_uncalib, z_uncalib. - * Each is a component of the measured magnetic field, with soft iron - * and temperature compensation applied, but not hard iron calibration. - * These values should be continuous (no re-calibration should cause a jump). - * - 3 fields for hard iron bias estimates: x_bias, y_bias, z_bias. - * Each field is a component of the estimated hard iron calibration. - * They represent the offsets to apply to the calibrated readings to obtain - * uncalibrated readings (x_uncalib ~= x_calibrated + x_bias) - * These values are expected to jump as soon as the estimate of the hard iron - * changes, and they should be stable the rest of the time. - * - * If this sensor is present, then the corresponding - * SENSOR_TYPE_MAGNETIC_FIELD must be present and both must return the - * same sensor_t::name and sensor_t::vendor. - * - * See SENSOR_TYPE_MAGNETIC_FIELD for more information - */ -#define SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED (14) - -/* - * SENSOR_TYPE_GAME_ROTATION_VECTOR - * trigger-mode: continuous - * wake-up sensor: no - * - * Similar to SENSOR_TYPE_ROTATION_VECTOR, but not using the geomagnetic - * field. Therefore the Y axis doesn't point north, but instead to some other - * reference. That reference is allowed to drift by the same order of - * magnitude than the gyroscope drift around the Z axis. - * - * This sensor does not report an estimated heading accuracy: - * sensors_event_t.data[4] is reserved and should be set to 0 - * - * In the ideal case, a phone rotated and returning to the same real-world - * orientation should report the same game rotation vector - * (without using the earth's geomagnetic field). - * - * This sensor must be based on a gyroscope. It cannot be implemented using - * a magnetometer. - * - * see SENSOR_TYPE_ROTATION_VECTOR for more details - */ -#define SENSOR_TYPE_GAME_ROTATION_VECTOR (15) - -/* - * SENSOR_TYPE_GYROSCOPE_UNCALIBRATED - * trigger-mode: continuous - * wake-up sensor: no - * - * All values are in radians/second and measure the rate of rotation - * around the X, Y and Z axis. An estimation of the drift on each axis is - * reported as well. - * - * No gyro-drift compensation shall be performed. - * Factory calibration and temperature compensation should still be applied - * to the rate of rotation (angular speeds). - * - * The coordinate system is the same as is - * used for the acceleration sensor. Rotation is positive in the - * counter-clockwise direction (right-hand rule). That is, an observer - * looking from some positive location on the x, y or z axis at a device - * positioned on the origin would report positive rotation if the device - * appeared to be rotating counter clockwise. Note that this is the - * standard mathematical definition of positive rotation and does not agree - * with the definition of roll given earlier. - * The range should at least be 17.45 rad/s (ie: ~1000 deg/s). - * - * Content of an uncalibrated_gyro event: (units are rad/sec) - * x_uncalib : angular speed (w/o drift compensation) around the X axis - * y_uncalib : angular speed (w/o drift compensation) around the Y axis - * z_uncalib : angular speed (w/o drift compensation) around the Z axis - * x_bias : estimated drift around X axis in rad/s - * y_bias : estimated drift around Y axis in rad/s - * z_bias : estimated drift around Z axis in rad/s - * - * IMPLEMENTATION NOTES: - * - * If the implementation is not able to estimate the drift, then this - * sensor MUST NOT be reported by this HAL. Instead, the regular - * SENSOR_TYPE_GYROSCOPE is used without drift compensation. - * - * If this sensor is present, then the corresponding - * SENSOR_TYPE_GYROSCOPE must be present and both must return the - * same sensor_t::name and sensor_t::vendor. - */ -#define SENSOR_TYPE_GYROSCOPE_UNCALIBRATED (16) - - -/* - * SENSOR_TYPE_SIGNIFICANT_MOTION - * trigger-mode: one-shot - * wake-up sensor: yes - * - * A sensor of this type triggers an event each time significant motion - * is detected and automatically disables itself. - * The only allowed value to return is 1.0. - * - * A significant motion is a motion that might lead to a change in the user - * location. - * Examples of such motions are: - * walking, biking, sitting in a moving car, coach or train. - * Examples of situations that should not trigger significant motion: - * - phone in pocket and person is not moving - * - phone is on a table, even if the table shakes a bit due to nearby traffic - * or washing machine - * - * A note on false positive / false negative / power consumption tradeoff - * - The goal of this sensor is to save power. - * - Triggering an event when the user is not moving (false positive) is costly - * in terms of power, so it should be avoided. - * - Not triggering an event when the user is moving (false negative) is - * acceptable as long as it is not done repeatedly. If the user has been - * walking for 10 seconds, not triggering an event within those 10 seconds - * is not acceptable. - * - * IMPORTANT NOTE: this sensor type is very different from other types - * in that it must work when the screen is off without the need of - * holding a partial wake-lock and MUST allow the SoC to go into suspend. - * When significant motion is detected, the sensor must awaken the SoC and - * the event be reported. - * - * If a particular hardware cannot support this mode of operation then this - * sensor type MUST NOT be reported by the HAL. ie: it is not acceptable - * to "emulate" this sensor in the HAL. - * - * The whole point of this sensor type is to save power by keeping the - * SoC in suspend mode when the device is at rest. - * - * When the sensor is not activated, it must also be deactivated in the - * hardware: it must not wake up the SoC anymore, even in case of - * significant motion. - * - * setDelay() has no effect and is ignored. - * Once a "significant motion" event is returned, a sensor of this type - * must disables itself automatically, as if activate(..., 0) had been called. - */ - -#define SENSOR_TYPE_SIGNIFICANT_MOTION (17) - - -/* - * SENSOR_TYPE_STEP_DETECTOR - * trigger-mode: special - * wake-up sensor: no - * - * A sensor of this type triggers an event each time a step is taken - * by the user. The only allowed value to return is 1.0 and an event is - * generated for each step. Like with any other event, the timestamp - * indicates when the event (here the step) occurred, this corresponds to when - * the foot hit the ground, generating a high variation in acceleration. - * - * While this sensor operates, it shall not disrupt any other sensors, in - * particular, but not limited to, the accelerometer; which might very well - * be in use as well. - * - * This sensor must be low power. That is, if the step detection cannot be - * done in hardware, this sensor should not be defined. Also, when the - * step detector is activated and the accelerometer is not, only steps should - * trigger interrupts (not accelerometer data). - * - * setDelay() has no impact on this sensor type - */ - -#define SENSOR_TYPE_STEP_DETECTOR (18) - - -/* - * SENSOR_TYPE_STEP_COUNTER - * trigger-mode: on-change - * wake-up sensor: no - * - * A sensor of this type returns the number of steps taken by the user since - * the last reboot while activated. The value is returned as a uint64_t and is - * reset to zero only on a system reboot. - * - * The timestamp of the event is set to the time when the first step - * for that event was taken. - * See SENSOR_TYPE_STEP_DETECTOR for the signification of the time of a step. - * - * The minimum size of the hardware's internal counter shall be 16 bits - * (this restriction is here to avoid too frequent wake-ups when the - * delay is very large). - * - * IMPORTANT NOTE: this sensor type is different from other types - * in that it must work when the screen is off without the need of - * holding a partial wake-lock and MUST allow the SoC to go into suspend. - * Unlike other sensors, while in suspend mode this sensor must stay active, - * no events are reported during that time but, steps continue to be - * accounted for; an event will be reported as soon as the SoC resumes if - * the timeout has expired. - * - * In other words, when the screen is off and the device allowed to - * go into suspend mode, we don't want to be woken up, regardless of the - * setDelay() value, but the steps shall continue to be counted. - * - * The driver must however ensure that the internal step count never - * overflows. It is allowed in this situation to wake the SoC up so the - * driver can do the counter maintenance. - * - * While this sensor operates, it shall not disrupt any other sensors, in - * particular, but not limited to, the accelerometer; which might very well - * be in use as well. - * - * If a particular hardware cannot support these modes of operation then this - * sensor type MUST NOT be reported by the HAL. ie: it is not acceptable - * to "emulate" this sensor in the HAL. - * - * This sensor must be low power. That is, if the step detection cannot be - * done in hardware, this sensor should not be defined. Also, when the - * step counter is activated and the accelerometer is not, only steps should - * trigger interrupts (not accelerometer data). - * - * The whole point of this sensor type is to save power by keeping the - * SoC in suspend mode when the device is at rest. - */ - -#define SENSOR_TYPE_STEP_COUNTER (19) - -/* - * SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR - * trigger-mode: continuous - * wake-up sensor: no - * - * Similar to SENSOR_TYPE_ROTATION_VECTOR, but using a magnetometer instead - * of using a gyroscope. - * - * This sensor must be based on a magnetometer. It cannot be implemented using - * a gyroscope, and gyroscope input cannot be used by this sensor. - * - * Just like SENSOR_TYPE_ROTATION_VECTOR, this sensor reports an estimated - * heading accuracy: - * sensors_event_t.data[4] = estimated_accuracy (in radians) - * The heading error must be less than estimated_accuracy 95% of the time - * - * see SENSOR_TYPE_ROTATION_VECTOR for more details - */ -#define SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR (20) - -/** - * Values returned by the accelerometer in various locations in the universe. - * all values are in SI units (m/s^2) - */ -#define GRAVITY_SUN (275.0f) -#define GRAVITY_EARTH (9.80665f) - -/** Maximum magnetic field on Earth's surface */ -#define MAGNETIC_FIELD_EARTH_MAX (60.0f) - -/** Minimum magnetic field on Earth's surface */ -#define MAGNETIC_FIELD_EARTH_MIN (30.0f) - - -/** - * status of orientation sensor - */ - -#define SENSOR_STATUS_UNRELIABLE 0 -#define SENSOR_STATUS_ACCURACY_LOW 1 -#define SENSOR_STATUS_ACCURACY_MEDIUM 2 -#define SENSOR_STATUS_ACCURACY_HIGH 3 - - -/** - * sensor event data - */ -typedef struct { - union { - float v[3]; - struct { - float x; - float y; - float z; - }; - struct { - float azimuth; - float pitch; - float roll; - }; - }; - int8_t status; - uint8_t reserved[3]; -} sensors_vec_t; - -/** - * uncalibrated gyroscope and magnetometer event data - */ -typedef struct { - union { - float uncalib[3]; - struct { - float x_uncalib; - float y_uncalib; - float z_uncalib; - }; - }; - union { - float bias[3]; - struct { - float x_bias; - float y_bias; - float z_bias; - }; - }; -} uncalibrated_event_t; - -/** - * Union of the various types of sensor data - * that can be returned. - */ -typedef struct sensors_event_t { - /* must be sizeof(struct sensors_event_t) */ - int32_t version; - - /* sensor identifier */ - int32_t sensor; - - /* sensor type */ - int32_t type; - - /* reserved */ - int32_t reserved0; - - /* time is in nanosecond */ - int64_t timestamp; - - union { - float data[16]; - - /* acceleration values are in meter per second per second (m/s^2) */ - sensors_vec_t acceleration; - - /* magnetic vector values are in micro-Tesla (uT) */ - sensors_vec_t magnetic; - - /* orientation values are in degrees */ - sensors_vec_t orientation; - - /* gyroscope values are in rad/s */ - sensors_vec_t gyro; - - /* temperature is in degrees centigrade (Celsius) */ - float temperature; - - /* distance in centimeters */ - float distance; - - /* light in SI lux units */ - float light; - - /* pressure in hectopascal (hPa) */ - float pressure; - - /* relative humidity in percent */ - float relative_humidity; - - /* step-counter */ - uint64_t step_counter; - - /* uncalibrated gyroscope values are in rad/s */ - uncalibrated_event_t uncalibrated_gyro; - - /* uncalibrated magnetometer values are in micro-Teslas */ - uncalibrated_event_t uncalibrated_magnetic; - }; - uint32_t reserved1[4]; -} sensors_event_t; - - - -struct sensor_t; - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -struct sensors_module_t { - struct hw_module_t common; - - /** - * Enumerate all available sensors. The list is returned in "list". - * @return number of sensors in the list - */ - int (*get_sensors_list)(struct sensors_module_t* module, - struct sensor_t const** list); -}; - -struct sensor_t { - - /* Name of this sensor. - * All sensors of the same "type" must have a different "name". - */ - const char* name; - - /* vendor of the hardware part */ - const char* vendor; - - /* version of the hardware part + driver. The value of this field - * must increase when the driver is updated in a way that changes the - * output of this sensor. This is important for fused sensors when the - * fusion algorithm is updated. - */ - int version; - - /* handle that identifies this sensors. This handle is used to reference - * this sensor throughout the HAL API. - */ - int handle; - - /* this sensor's type. */ - int type; - - /* maximum range of this sensor's value in SI units */ - float maxRange; - - /* smallest difference between two values reported by this sensor */ - float resolution; - - /* rough estimate of this sensor's power consumption in mA */ - float power; - - /* this value depends on the trigger mode: - * - * continuous: minimum sample period allowed in microseconds - * on-change : 0 - * one-shot :-1 - * special : 0, unless otherwise noted - */ - int32_t minDelay; - - /* reserved fields, must be zero */ - void* reserved[8]; -}; - - -/* - * sensors_poll_device_t is used with SENSORS_DEVICE_API_VERSION_0_1 - * and is present for backward binary and source compatibility. - * (see documentation of the hooks in struct sensors_poll_device_1 below) - */ -struct sensors_poll_device_t { - struct hw_device_t common; - int (*activate)(struct sensors_poll_device_t *dev, - int handle, int enabled); - int (*setDelay)(struct sensors_poll_device_t *dev, - int handle, int64_t ns); - int (*poll)(struct sensors_poll_device_t *dev, - sensors_event_t* data, int count); -}; - -/* - * struct sensors_poll_device_1 is used with SENSORS_DEVICE_API_VERSION_1_0 - */ -typedef struct sensors_poll_device_1 { - union { - /* sensors_poll_device_1 is compatible with sensors_poll_device_t, - * and can be down-cast to it - */ - struct sensors_poll_device_t v0; - - struct { - struct hw_device_t common; - - /* Activate/de-activate one sensor. - * - * handle is the handle of the sensor to change. - * enabled set to 1 to enable, or 0 to disable the sensor. - * - * unless otherwise noted in the sensor types definitions, an - * activated sensor never prevents the SoC to go into suspend - * mode; that is, the HAL shall not hold a partial wake-lock on - * behalf of applications. - * - * one-shot sensors de-activate themselves automatically upon - * receiving an event and they must still accept to be deactivated - * through a call to activate(..., ..., 0). - * - * if "enabled" is true and the sensor is already activated, this - * function is a no-op and succeeds. - * - * if "enabled" is false and the sensor is already de-activated, - * this function is a no-op and succeeds. - * - * return 0 on success, negative errno code otherwise - */ - int (*activate)(struct sensors_poll_device_t *dev, - int handle, int enabled); - - /** - * Set the events's period in nanoseconds for a given sensor. - * - * What the period_ns parameter means depends on the specified - * sensor's trigger mode: - * - * continuous: setDelay() sets the sampling rate. - * on-change: setDelay() limits the delivery rate of events - * one-shot: setDelay() is ignored. it has no effect. - * special: see specific sensor type definitions - * - * For continuous and on-change sensors, if the requested value is - * less than sensor_t::minDelay, then it's silently clamped to - * sensor_t::minDelay unless sensor_t::minDelay is 0, in which - * case it is clamped to >= 1ms. - * - * @return 0 if successful, < 0 on error - */ - int (*setDelay)(struct sensors_poll_device_t *dev, - int handle, int64_t period_ns); - - /** - * Returns an array of sensor data. - * This function must block until events are available. - * - * return the number of events read on success, or -errno in case - * of an error. - * - * The number of events returned in data must be less or equal - * to the "count" argument. - * - * This function shall never return 0 (no event). - */ - int (*poll)(struct sensors_poll_device_t *dev, - sensors_event_t* data, int count); - }; - }; - - - /* - * Enables batch mode for the given sensor and sets the delay between events - * - * A timeout value of zero disables batch mode for the given sensor. - * - * The period_ns parameter is equivalent to calling setDelay() -- this - * function both enables or disables the batch mode AND sets the events's - * period in nanosecond. See setDelay() above for a detailed explanation of - * the period_ns parameter. - * - * BATCH MODE: - * ----------- - * In non-batch mode, all sensor events must be reported as soon as they - * are detected. For example, an accelerometer activated at 50Hz will - * trigger interrupts 50 times per second. - * While in batch mode, sensor events do not need to be reported as soon - * as they are detected. They can be temporarily stored in batches and - * reported in batches, as long as no event is delayed by more than - * "timeout" nanoseconds. That is, all events since the previous batch - * are recorded and returned all at once. This allows to reduce the amount - * of interrupts sent to the SoC, and allow the SoC to switch to a lower - * power state (Idle) while the sensor is capturing and batching data. - * - * setDelay() is not affected and it behaves as usual. - * - * Each event has a timestamp associated with it, the timestamp - * must be accurate and correspond to the time at which the event - * physically happened. - * - * Batching does not modify the behavior of poll(): batches from different - * sensors can be interleaved and split. As usual, all events from the same - * sensor are time-ordered. - * - * BEHAVIOUR OUTSIDE OF SUSPEND MODE: - * ---------------------------------- - * - * When the SoC is awake (not in suspend mode), events must be reported in - * batches at least every "timeout". No event shall be dropped or lost. - * If internal h/w FIFOs fill-up before the timeout, then events are - * reported at that point to ensure no event is lost. - * - * - * NORMAL BEHAVIOR IN SUSPEND MODE: - * --------------------------------- - * - * By default, batch mode doesn't significantly change the interaction with - * suspend mode. That is, sensors must continue to allow the SoC to - * go into suspend mode and sensors must stay active to fill their - * internal FIFO. In this mode, when the FIFO fills up, it shall wrap - * around (basically behave like a circular buffer, overwriting events). - * As soon as the SoC comes out of suspend mode, a batch is produced with - * as much as the recent history as possible, and batch operation - * resumes as usual. - * - * The behavior described above allows applications to record the recent - * history of a set of sensor while keeping the SoC into suspend. It - * also allows the hardware to not have to rely on a wake-up interrupt line. - * - * WAKE_UPON_FIFO_FULL BEHAVIOR IN SUSPEND MODE: - * ---------------------------------------------- - * - * There are cases, however, where an application cannot afford to lose - * any events, even when the device goes into suspend mode. - * For a given rate, if a sensor has the capability to store at least 10 - * seconds worth of events in its FIFO and is able to wake up the Soc, it - * can implement an optional secondary mode: the WAKE_UPON_FIFO_FULL mode. - * - * The caller will set the SENSORS_BATCH_WAKE_UPON_FIFO_FULL flag to - * activate this mode. If the sensor does not support this mode, batch() - * will fail when the flag is set. - * - * When running with the WAKE_UPON_FIFO_FULL flag set, no events can be - * lost. When the FIFO is getting full, the sensor must wake up the SoC from - * suspend and return a batch before the FIFO fills-up. - * Depending on the device, it might take a few miliseconds for the SoC to - * entirely come out of suspend and start flushing the FIFO. Enough head - * room must be allocated in the FIFO to allow the device to entirely come - * out of suspend without the FIFO overflowing (no events shall be lost). - * - * Implementing the WAKE_UPON_FIFO_FULL mode is optional. - * If the hardware cannot support this mode, or if the physical - * FIFO is so small that the device would never be allowed to go into - * suspend for at least 10 seconds, then this function MUST fail when - * the flag SENSORS_BATCH_WAKE_UPON_FIFO_FULL is set, regardless of - * the value of the timeout parameter. - * - * - * DRY RUN: - * -------- - * - * If the flag SENSORS_BATCH_DRY_RUN is set, this function returns - * without modifying the batch mode or the event period and has no side - * effects, but returns errors as usual (as it would if this flag was - * not set). This flag is used to check if batch mode is available for a - * given configuration -- in particular for a given sensor at a given rate. - * - * - * Return values: - * -------------- - * - * Because sensors must be independent, the return value must not depend - * on the state of the system (whether another sensor is on or not), - * nor on whether the flag SENSORS_BATCH_DRY_RUN is set (in other words, - * if a batch call with SENSORS_BATCH_DRY_RUN is successful, - * the same call without SENSORS_BATCH_DRY_RUN must succeed as well). - * - * If successful, 0 is returned. - * If the specified sensor doesn't support batch mode, -EINVAL is returned. - * If the specified sensor's trigger-mode is one-shot, -EINVAL is returned. - * If WAKE_UPON_FIFO_FULL is specified and the specified sensor's internal - * FIFO is too small to store at least 10 seconds worth of data at the - * given rate, -EINVAL is returned. Note that as stated above, this has to - * be determined at compile time, and not based on the state of the system. - * If some other constraints above cannot be satisfied, -EINVAL is returned. - * - * Note: the timeout parameter, when > 0, has no impact on whether this - * function succeeds or fails. - * - * If timeout is set to 0, this function must succeed. - * - * - * IMPLEMENTATION NOTES: - * --------------------- - * - * Batch mode, if supported, should happen at the hardware level, - * typically using hardware FIFOs. In particular, it SHALL NOT be - * implemented in the HAL, as this would be counter productive. - * The goal here is to save significant amounts of power. - * - * In some implementations, events from several sensors can share the - * same physical FIFO. In that case, all events in the FIFO can be sent and - * processed by the HAL as soon as one batch must be reported. - * For example, if the following sensors are activated: - * - accelerometer batched with timeout = 20s - * - gyroscope batched with timeout = 5s - * then the accelerometer batches can be reported at the same time the - * gyroscope batches are reported (every 5 seconds) - * - * Batch mode can be enabled or disabled at any time, in particular - * while the specified sensor is already enabled, and this shall not - * result in the loss of events. - * - * COMPARATIVE IMPORTANCE OF BATCHING FOR DIFFERENT SENSORS: - * --------------------------------------------------------- - * - * On platforms on which hardware fifo size is limited, the system designers - * might have to choose how much fifo to reserve for each sensor. To help - * with this choice, here is a list of applications made possible when - * batching is implemented on the different sensors. - * - * High value: Low power pedestrian dead reckoning - * Target batching time: 20 seconds to 1 minute - * Sensors to batch: - * - Step detector - * - Rotation vector or game rotation vector at 5Hz - * Gives us step and heading while letting the SoC go to Suspend. - * - * High value: Medium power activity/gesture recognition - * Target batching time: 3 seconds - * Sensors to batch: accelerometer between 20Hz and 50Hz - * Allows recognizing arbitrary activities and gestures without having - * to keep the SoC fully awake while the data is collected. - * - * Medium-high value: Interrupt load reduction - * Target batching time: < 1 second - * Sensors to batch: any high frequency sensor. - * If the gyroscope is set at 800Hz, even batching just 10 gyro events can - * reduce the number of interrupts from 800/second to 80/second. - * - * Medium value: Continuous low frequency data collection - * Target batching time: > 1 minute - * Sensors to batch: barometer, humidity sensor, other low frequency - * sensors. - * Allows creating monitoring applications at low power. - * - * Medium value: Continuous full-sensors collection - * Target batching time: > 1 minute - * Sensors to batch: all, at high frequencies - * Allows full collection of sensor data while leaving the SoC in - * suspend mode. Only to consider if fifo space is not an issue. - * - * In each of the cases above, if WAKE_UPON_FIFO_FULL is implemented, the - * applications might decide to let the SoC go to suspend, allowing for even - * more power savings. - */ - int (*batch)(struct sensors_poll_device_1* dev, - int handle, int flags, int64_t period_ns, int64_t timeout); - - void (*reserved_procs[8])(void); - -} sensors_poll_device_1_t; - - - -/** convenience API for opening and closing a device */ - -static inline int sensors_open(const struct hw_module_t* module, - struct sensors_poll_device_t** device) { - return module->methods->open(module, - SENSORS_HARDWARE_POLL, (struct hw_device_t**)device); -} - -static inline int sensors_close(struct sensors_poll_device_t* device) { - return device->common.close(&device->common); -} - -static inline int sensors_open_1(const struct hw_module_t* module, - sensors_poll_device_1_t** device) { - return module->methods->open(module, - SENSORS_HARDWARE_POLL, (struct hw_device_t**)device); -} - -static inline int sensors_close_1(sensors_poll_device_1_t* device) { - return device->common.close(&device->common); -} - -__END_DECLS - -#endif // ANDROID_SENSORS_INTERFACE_H diff --git a/external/android/include/18/system/core/include/cutils/abort_socket.h b/external/android/include/18/system/core/include/cutils/abort_socket.h deleted file mode 100644 index fbb1112..0000000 --- a/external/android/include/18/system/core/include/cutils/abort_socket.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 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. - */ - -/* Helper to perform abortable blocking operations on a socket: - * asocket_connect() - * asocket_accept() - * asocket_read() - * asocket_write() - * These calls are similar to the regular syscalls, but can be aborted with: - * asocket_abort() - * - * Calling close() on a regular POSIX socket does not abort blocked syscalls on - * that socket in other threads. - * - * After calling asocket_abort() the socket cannot be reused. - * - * Call asocket_destory() *after* all threads have finished with the socket to - * finish closing the socket and free the asocket structure. - * - * The helper is implemented by setting the socket non-blocking to initiate - * syscalls connect(), accept(), read(), write(), then using a blocking poll() - * on both the primary socket and a local pipe. This makes the poll() abortable - * by writing a byte to the local pipe in asocket_abort(). - * - * asocket_create() sets the fd to non-blocking mode. It must not be changed to - * blocking mode. - * - * Using asocket will triple the number of file descriptors required per - * socket, due to the local pipe. It may be possible to use a global pipe per - * process rather than per socket, but we have not been able to come up with a - * race-free implementation yet. - * - * All functions except asocket_init() and asocket_destroy() are thread safe. - */ - -#include -#include - -#ifndef __CUTILS_ABORT_SOCKET_H__ -#define __CUTILS_ABORT_SOCKET_H__ -#ifdef __cplusplus -extern "C" { -#endif - -struct asocket { - int fd; /* primary socket fd */ - int abort_fd[2]; /* pipe used to abort */ -}; - -/* Create an asocket from fd. - * Sets the socket to non-blocking mode. - * Returns NULL on error with errno set. - */ -struct asocket *asocket_init(int fd); - -/* Blocking socket I/O with timeout. - * Calling asocket_abort() from another thread will cause each of these - * functions to immediately return with value -1 and errno ECANCELED. - * timeout is in ms, use -1 to indicate no timeout. On timeout -1 is returned - * with errno ETIMEDOUT. - * EINTR is handled in-call. - * Other semantics are identical to the regular syscalls. - */ -int asocket_connect(struct asocket *s, const struct sockaddr *addr, - socklen_t addrlen, int timeout); - -int asocket_accept(struct asocket *s, struct sockaddr *addr, - socklen_t *addrlen, int timeout); - -int asocket_read(struct asocket *s, void *buf, size_t count, int timeout); - -int asocket_write(struct asocket *s, const void *buf, size_t count, - int timeout); - -/* Abort above calls and shutdown socket. - * Further I/O operations on this socket will immediately fail after this call. - * asocket_destroy() should be used to release resources once all threads - * have returned from blocking calls on the socket. - */ -void asocket_abort(struct asocket *s); - -/* Close socket and free asocket structure. - * Must not be called until all calls on this structure have completed. - */ -void asocket_destroy(struct asocket *s); - -#ifdef __cplusplus -} -#endif -#endif //__CUTILS_ABORT_SOCKET__H__ diff --git a/external/android/include/18/system/core/include/cutils/android_reboot.h b/external/android/include/18/system/core/include/cutils/android_reboot.h deleted file mode 100644 index 0c79be7..0000000 --- a/external/android/include/18/system/core/include/cutils/android_reboot.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2011, 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 __CUTILS_ANDROID_REBOOT_H__ -#define __CUTILS_ANDROID_REBOOT_H__ - -__BEGIN_DECLS - -/* Commands */ -#define ANDROID_RB_RESTART 0xDEAD0001 -#define ANDROID_RB_POWEROFF 0xDEAD0002 -#define ANDROID_RB_RESTART2 0xDEAD0003 - -/* Flags */ -#define ANDROID_RB_FLAG_NO_SYNC 0x1 -#define ANDROID_RB_FLAG_NO_REMOUNT_RO 0x2 - -int android_reboot(int cmd, int flags, char *arg); - -__END_DECLS - -#endif /* __CUTILS_ANDROID_REBOOT_H__ */ diff --git a/external/android/include/18/system/core/include/cutils/aref.h b/external/android/include/18/system/core/include/cutils/aref.h deleted file mode 100644 index 460ac02..0000000 --- a/external/android/include/18/system/core/include/cutils/aref.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2013 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 _CUTILS_AREF_H_ -#define _CUTILS_AREF_H_ - -#include -#include - -#ifdef ANDROID_SMP -#include -#else -#include -#endif - -__BEGIN_DECLS - -#define AREF_TO_ITEM(aref, container, member) \ - (container *) (((char*) (aref)) - offsetof(container, member)) - -struct aref -{ - volatile int32_t count; -}; - -static inline void aref_init(struct aref *r) -{ - r->count = 1; -} - -static inline int32_t aref_count(struct aref *r) -{ - return r->count; -} - -static inline void aref_get(struct aref *r) -{ - android_atomic_inc(&r->count); -} - -static inline void aref_put(struct aref *r, void (*release)(struct aref *)) -{ - if (android_atomic_dec(&r->count) == 1) - release(r); -} - -__END_DECLS - -#endif // _CUTILS_AREF_H_ diff --git a/external/android/include/18/system/core/include/cutils/array.h b/external/android/include/18/system/core/include/cutils/array.h deleted file mode 100644 index c97ff34..0000000 --- a/external/android/include/18/system/core/include/cutils/array.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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. - */ - -/** - * A pointer array which intelligently expands its capacity ad needed. - */ - -#ifndef __ARRAY_H -#define __ARRAY_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -/** An array. */ -typedef struct Array Array; - -/** Constructs a new array. Returns NULL if we ran out of memory. */ -Array* arrayCreate(); - -/** Frees an array. Does not free elements themselves. */ -void arrayFree(Array* array); - -/** Adds a pointer. Returns 0 is successful, < 0 otherwise. */ -int arrayAdd(Array* array, void* pointer); - -/** Gets the pointer at the specified index. */ -void* arrayGet(Array* array, int index); - -/** Removes the pointer at the given index and returns it. */ -void* arrayRemove(Array* array, int index); - -/** Sets pointer at the given index. Returns old pointer. */ -void* arraySet(Array* array, int index, void* pointer); - -/** Sets the array size. Sets new pointers to NULL. Returns 0 if successful, < 0 otherwise . */ -int arraySetSize(Array* array, int size); - -/** Returns the size of the given array. */ -int arraySize(Array* array); - -/** - * Returns a pointer to a C-style array which will be valid until this array - * changes. - */ -const void** arrayUnwrap(Array* array); - -#ifdef __cplusplus -} -#endif - -#endif /* __ARRAY_H */ diff --git a/external/android/include/18/system/core/include/cutils/ashmem.h b/external/android/include/18/system/core/include/cutils/ashmem.h deleted file mode 100644 index 25b233e..0000000 --- a/external/android/include/18/system/core/include/cutils/ashmem.h +++ /dev/null @@ -1,45 +0,0 @@ -/* cutils/ashmem.h - ** - ** Copyright 2008 The Android Open Source Project - ** - ** This file is dual licensed. It may be redistributed and/or modified - ** under the terms of the Apache 2.0 License OR version 2 of the GNU - ** General Public License. - */ - -#ifndef _CUTILS_ASHMEM_H -#define _CUTILS_ASHMEM_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -int ashmem_create_region(const char *name, size_t size); -int ashmem_set_prot_region(int fd, int prot); -int ashmem_pin_region(int fd, size_t offset, size_t len); -int ashmem_unpin_region(int fd, size_t offset, size_t len); -int ashmem_get_size_region(int fd); - -#ifdef __cplusplus -} -#endif - -#ifndef __ASHMEMIOC /* in case someone included too */ - -#define ASHMEM_NAME_LEN 256 - -#define ASHMEM_NAME_DEF "dev/ashmem" - -/* Return values from ASHMEM_PIN: Was the mapping purged while unpinned? */ -#define ASHMEM_NOT_PURGED 0 -#define ASHMEM_WAS_PURGED 1 - -/* Return values from ASHMEM_UNPIN: Is the mapping now pinned or unpinned? */ -#define ASHMEM_IS_UNPINNED 0 -#define ASHMEM_IS_PINNED 1 - -#endif /* ! __ASHMEMIOC */ - -#endif /* _CUTILS_ASHMEM_H */ diff --git a/external/android/include/18/system/core/include/cutils/atomic-arm.h b/external/android/include/18/system/core/include/cutils/atomic-arm.h deleted file mode 100644 index 172a0cd..0000000 --- a/external/android/include/18/system/core/include/cutils/atomic-arm.h +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (C) 2010 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_CUTILS_ATOMIC_ARM_H -#define ANDROID_CUTILS_ATOMIC_ARM_H - -#include - -#ifndef ANDROID_ATOMIC_INLINE -#define ANDROID_ATOMIC_INLINE inline __attribute__((always_inline)) -#endif - -extern ANDROID_ATOMIC_INLINE void android_compiler_barrier() -{ - __asm__ __volatile__ ("" : : : "memory"); -} - -extern ANDROID_ATOMIC_INLINE void android_memory_barrier() -{ -#if ANDROID_SMP == 0 - android_compiler_barrier(); -#else - __asm__ __volatile__ ("dmb" : : : "memory"); -#endif -} - -extern ANDROID_ATOMIC_INLINE void android_memory_store_barrier() -{ -#if ANDROID_SMP == 0 - android_compiler_barrier(); -#else - __asm__ __volatile__ ("dmb st" : : : "memory"); -#endif -} - -extern ANDROID_ATOMIC_INLINE -int32_t android_atomic_acquire_load(volatile const int32_t *ptr) -{ - int32_t value = *ptr; - android_memory_barrier(); - return value; -} - -extern ANDROID_ATOMIC_INLINE -int32_t android_atomic_release_load(volatile const int32_t *ptr) -{ - android_memory_barrier(); - return *ptr; -} - -extern ANDROID_ATOMIC_INLINE -void android_atomic_acquire_store(int32_t value, volatile int32_t *ptr) -{ - *ptr = value; - android_memory_barrier(); -} - -extern ANDROID_ATOMIC_INLINE -void android_atomic_release_store(int32_t value, volatile int32_t *ptr) -{ - android_memory_barrier(); - *ptr = value; -} - -extern ANDROID_ATOMIC_INLINE -int android_atomic_cas(int32_t old_value, int32_t new_value, - volatile int32_t *ptr) -{ - int32_t prev, status; - do { - __asm__ __volatile__ ("ldrex %0, [%3]\n" - "mov %1, #0\n" - "teq %0, %4\n" -#ifdef __thumb2__ - "it eq\n" -#endif - "strexeq %1, %5, [%3]" - : "=&r" (prev), "=&r" (status), "+m"(*ptr) - : "r" (ptr), "Ir" (old_value), "r" (new_value) - : "cc"); - } while (__builtin_expect(status != 0, 0)); - return prev != old_value; -} - -extern ANDROID_ATOMIC_INLINE -int android_atomic_acquire_cas(int32_t old_value, int32_t new_value, - volatile int32_t *ptr) -{ - int status = android_atomic_cas(old_value, new_value, ptr); - android_memory_barrier(); - return status; -} - -extern ANDROID_ATOMIC_INLINE -int android_atomic_release_cas(int32_t old_value, int32_t new_value, - volatile int32_t *ptr) -{ - android_memory_barrier(); - return android_atomic_cas(old_value, new_value, ptr); -} - -extern ANDROID_ATOMIC_INLINE -int32_t android_atomic_add(int32_t increment, volatile int32_t *ptr) -{ - int32_t prev, tmp, status; - android_memory_barrier(); - do { - __asm__ __volatile__ ("ldrex %0, [%4]\n" - "add %1, %0, %5\n" - "strex %2, %1, [%4]" - : "=&r" (prev), "=&r" (tmp), - "=&r" (status), "+m" (*ptr) - : "r" (ptr), "Ir" (increment) - : "cc"); - } while (__builtin_expect(status != 0, 0)); - return prev; -} - -extern ANDROID_ATOMIC_INLINE int32_t android_atomic_inc(volatile int32_t *addr) -{ - return android_atomic_add(1, addr); -} - -extern ANDROID_ATOMIC_INLINE int32_t android_atomic_dec(volatile int32_t *addr) -{ - return android_atomic_add(-1, addr); -} - -extern ANDROID_ATOMIC_INLINE -int32_t android_atomic_and(int32_t value, volatile int32_t *ptr) -{ - int32_t prev, tmp, status; - android_memory_barrier(); - do { - __asm__ __volatile__ ("ldrex %0, [%4]\n" - "and %1, %0, %5\n" - "strex %2, %1, [%4]" - : "=&r" (prev), "=&r" (tmp), - "=&r" (status), "+m" (*ptr) - : "r" (ptr), "Ir" (value) - : "cc"); - } while (__builtin_expect(status != 0, 0)); - return prev; -} - -extern ANDROID_ATOMIC_INLINE -int32_t android_atomic_or(int32_t value, volatile int32_t *ptr) -{ - int32_t prev, tmp, status; - android_memory_barrier(); - do { - __asm__ __volatile__ ("ldrex %0, [%4]\n" - "orr %1, %0, %5\n" - "strex %2, %1, [%4]" - : "=&r" (prev), "=&r" (tmp), - "=&r" (status), "+m" (*ptr) - : "r" (ptr), "Ir" (value) - : "cc"); - } while (__builtin_expect(status != 0, 0)); - return prev; -} - -#endif /* ANDROID_CUTILS_ATOMIC_ARM_H */ diff --git a/external/android/include/18/system/core/include/cutils/atomic-inline.h b/external/android/include/18/system/core/include/cutils/atomic-inline.h deleted file mode 100644 index 0b13138..0000000 --- a/external/android/include/18/system/core/include/cutils/atomic-inline.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2010 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_CUTILS_ATOMIC_INLINE_H -#define ANDROID_CUTILS_ATOMIC_INLINE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Inline declarations and macros for some special-purpose atomic - * operations. These are intended for rare circumstances where a - * memory barrier needs to be issued inline rather than as a function - * call. - * - * Most code should not use these. - * - * Anything that does include this file must set ANDROID_SMP to either - * 0 or 1, indicating compilation for UP or SMP, respectively. - * - * Macros defined in this header: - * - * void ANDROID_MEMBAR_FULL(void) - * Full memory barrier. Provides a compiler reordering barrier, and - * on SMP systems emits an appropriate instruction. - */ - -#if !defined(ANDROID_SMP) -# error "Must define ANDROID_SMP before including atomic-inline.h" -#endif - -#if defined(__arm__) -#include -#elif defined(__i386__) || defined(__x86_64__) -#include -#elif defined(__mips__) -#include -#else -#error atomic operations are unsupported -#endif - -#if ANDROID_SMP == 0 -#define ANDROID_MEMBAR_FULL android_compiler_barrier -#else -#define ANDROID_MEMBAR_FULL android_memory_barrier -#endif - -#if ANDROID_SMP == 0 -#define ANDROID_MEMBAR_STORE android_compiler_barrier -#else -#define ANDROID_MEMBAR_STORE android_memory_store_barrier -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* ANDROID_CUTILS_ATOMIC_INLINE_H */ diff --git a/external/android/include/18/system/core/include/cutils/atomic-mips.h b/external/android/include/18/system/core/include/cutils/atomic-mips.h deleted file mode 100644 index f9d3e25..0000000 --- a/external/android/include/18/system/core/include/cutils/atomic-mips.h +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright (C) 2010 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_CUTILS_ATOMIC_MIPS_H -#define ANDROID_CUTILS_ATOMIC_MIPS_H - -#include - -#ifndef ANDROID_ATOMIC_INLINE -#define ANDROID_ATOMIC_INLINE inline __attribute__((always_inline)) -#endif - -extern ANDROID_ATOMIC_INLINE void android_compiler_barrier(void) -{ - __asm__ __volatile__ ("" : : : "memory"); -} - -#if ANDROID_SMP == 0 -extern ANDROID_ATOMIC_INLINE void android_memory_barrier(void) -{ - android_compiler_barrier(); -} -extern ANDROID_ATOMIC_INLINE void android_memory_store_barrier(void) -{ - android_compiler_barrier(); -} -#else -extern ANDROID_ATOMIC_INLINE void android_memory_barrier(void) -{ - __asm__ __volatile__ ("sync" : : : "memory"); -} -extern ANDROID_ATOMIC_INLINE void android_memory_store_barrier(void) -{ - __asm__ __volatile__ ("sync" : : : "memory"); -} -#endif - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_acquire_load(volatile const int32_t *ptr) -{ - int32_t value = *ptr; - android_memory_barrier(); - return value; -} - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_release_load(volatile const int32_t *ptr) -{ - android_memory_barrier(); - return *ptr; -} - -extern ANDROID_ATOMIC_INLINE void -android_atomic_acquire_store(int32_t value, volatile int32_t *ptr) -{ - *ptr = value; - android_memory_barrier(); -} - -extern ANDROID_ATOMIC_INLINE void -android_atomic_release_store(int32_t value, volatile int32_t *ptr) -{ - android_memory_barrier(); - *ptr = value; -} - -extern ANDROID_ATOMIC_INLINE int -android_atomic_cas(int32_t old_value, int32_t new_value, volatile int32_t *ptr) -{ - int32_t prev, status; - do { - __asm__ __volatile__ ( - " ll %[prev], (%[ptr])\n" - " li %[status], 1\n" - " bne %[prev], %[old], 9f\n" - " move %[status], %[new_value]\n" - " sc %[status], (%[ptr])\n" - "9:\n" - : [prev] "=&r" (prev), [status] "=&r" (status) - : [ptr] "r" (ptr), [old] "r" (old_value), [new_value] "r" (new_value) - ); - } while (__builtin_expect(status == 0, 0)); - return prev != old_value; -} - -extern ANDROID_ATOMIC_INLINE int -android_atomic_acquire_cas(int32_t old_value, - int32_t new_value, - volatile int32_t *ptr) -{ - int status = android_atomic_cas(old_value, new_value, ptr); - android_memory_barrier(); - return status; -} - -extern ANDROID_ATOMIC_INLINE int -android_atomic_release_cas(int32_t old_value, - int32_t new_value, - volatile int32_t *ptr) -{ - android_memory_barrier(); - return android_atomic_cas(old_value, new_value, ptr); -} - - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_swap(int32_t new_value, volatile int32_t *ptr) -{ - int32_t prev, status; - do { - __asm__ __volatile__ ( - " move %[status], %[new_value]\n" - " ll %[prev], (%[ptr])\n" - " sc %[status], (%[ptr])\n" - : [prev] "=&r" (prev), [status] "=&r" (status) - : [ptr] "r" (ptr), [new_value] "r" (new_value) - ); - } while (__builtin_expect(status == 0, 0)); - android_memory_barrier(); - return prev; -} - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_add(int32_t increment, volatile int32_t *ptr) -{ - int32_t prev, status; - android_memory_barrier(); - do { - __asm__ __volatile__ ( - " ll %[prev], (%[ptr])\n" - " addu %[status], %[prev], %[inc]\n" - " sc %[status], (%[ptr])\n" - : [status] "=&r" (status), [prev] "=&r" (prev) - : [ptr] "r" (ptr), [inc] "Ir" (increment) - ); - } while (__builtin_expect(status == 0, 0)); - return prev; -} - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_inc(volatile int32_t *addr) -{ - return android_atomic_add(1, addr); -} - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_dec(volatile int32_t *addr) -{ - return android_atomic_add(-1, addr); -} - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_and(int32_t value, volatile int32_t *ptr) -{ - int32_t prev, status; - android_memory_barrier(); - do { - __asm__ __volatile__ ( - " ll %[prev], (%[ptr])\n" - " and %[status], %[prev], %[value]\n" - " sc %[status], (%[ptr])\n" - : [prev] "=&r" (prev), [status] "=&r" (status) - : [ptr] "r" (ptr), [value] "Ir" (value) - ); - } while (__builtin_expect(status == 0, 0)); - return prev; -} - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_or(int32_t value, volatile int32_t *ptr) -{ - int32_t prev, status; - android_memory_barrier(); - do { - __asm__ __volatile__ ( - " ll %[prev], (%[ptr])\n" - " or %[status], %[prev], %[value]\n" - " sc %[status], (%[ptr])\n" - : [prev] "=&r" (prev), [status] "=&r" (status) - : [ptr] "r" (ptr), [value] "Ir" (value) - ); - } while (__builtin_expect(status == 0, 0)); - return prev; -} - -#endif /* ANDROID_CUTILS_ATOMIC_MIPS_H */ diff --git a/external/android/include/18/system/core/include/cutils/atomic-x86.h b/external/android/include/18/system/core/include/cutils/atomic-x86.h deleted file mode 100644 index 9480f57..0000000 --- a/external/android/include/18/system/core/include/cutils/atomic-x86.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (C) 2010 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_CUTILS_ATOMIC_X86_H -#define ANDROID_CUTILS_ATOMIC_X86_H - -#include - -#ifndef ANDROID_ATOMIC_INLINE -#define ANDROID_ATOMIC_INLINE inline __attribute__((always_inline)) -#endif - -extern ANDROID_ATOMIC_INLINE void android_compiler_barrier(void) -{ - __asm__ __volatile__ ("" : : : "memory"); -} - -#if ANDROID_SMP == 0 -extern ANDROID_ATOMIC_INLINE void android_memory_barrier(void) -{ - android_compiler_barrier(); -} -extern ANDROID_ATOMIC_INLINE void android_memory_store_barrier(void) -{ - android_compiler_barrier(); -} -#else -extern ANDROID_ATOMIC_INLINE void android_memory_barrier(void) -{ - __asm__ __volatile__ ("mfence" : : : "memory"); -} -extern ANDROID_ATOMIC_INLINE void android_memory_store_barrier(void) -{ - android_compiler_barrier(); -} -#endif - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_acquire_load(volatile const int32_t *ptr) -{ - int32_t value = *ptr; - android_compiler_barrier(); - return value; -} - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_release_load(volatile const int32_t *ptr) -{ - android_memory_barrier(); - return *ptr; -} - -extern ANDROID_ATOMIC_INLINE void -android_atomic_acquire_store(int32_t value, volatile int32_t *ptr) -{ - *ptr = value; - android_memory_barrier(); -} - -extern ANDROID_ATOMIC_INLINE void -android_atomic_release_store(int32_t value, volatile int32_t *ptr) -{ - android_compiler_barrier(); - *ptr = value; -} - -extern ANDROID_ATOMIC_INLINE int -android_atomic_cas(int32_t old_value, int32_t new_value, volatile int32_t *ptr) -{ - int32_t prev; - __asm__ __volatile__ ("lock; cmpxchgl %1, %2" - : "=a" (prev) - : "q" (new_value), "m" (*ptr), "0" (old_value) - : "memory"); - return prev != old_value; -} - -extern ANDROID_ATOMIC_INLINE int -android_atomic_acquire_cas(int32_t old_value, - int32_t new_value, - volatile int32_t *ptr) -{ - /* Loads are not reordered with other loads. */ - return android_atomic_cas(old_value, new_value, ptr); -} - -extern ANDROID_ATOMIC_INLINE int -android_atomic_release_cas(int32_t old_value, - int32_t new_value, - volatile int32_t *ptr) -{ - /* Stores are not reordered with other stores. */ - return android_atomic_cas(old_value, new_value, ptr); -} - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_add(int32_t increment, volatile int32_t *ptr) -{ - __asm__ __volatile__ ("lock; xaddl %0, %1" - : "+r" (increment), "+m" (*ptr) - : : "memory"); - /* increment now holds the old value of *ptr */ - return increment; -} - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_inc(volatile int32_t *addr) -{ - return android_atomic_add(1, addr); -} - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_dec(volatile int32_t *addr) -{ - return android_atomic_add(-1, addr); -} - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_and(int32_t value, volatile int32_t *ptr) -{ - int32_t prev, status; - do { - prev = *ptr; - status = android_atomic_cas(prev, prev & value, ptr); - } while (__builtin_expect(status != 0, 0)); - return prev; -} - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_or(int32_t value, volatile int32_t *ptr) -{ - int32_t prev, status; - do { - prev = *ptr; - status = android_atomic_cas(prev, prev | value, ptr); - } while (__builtin_expect(status != 0, 0)); - return prev; -} - -#endif /* ANDROID_CUTILS_ATOMIC_X86_H */ diff --git a/external/android/include/18/system/core/include/cutils/atomic.h b/external/android/include/18/system/core/include/cutils/atomic.h deleted file mode 100644 index ae42eb8..0000000 --- a/external/android/include/18/system/core/include/cutils/atomic.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * 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_CUTILS_ATOMIC_H -#define ANDROID_CUTILS_ATOMIC_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * A handful of basic atomic operations. The appropriate pthread - * functions should be used instead of these whenever possible. - * - * The "acquire" and "release" terms can be defined intuitively in terms - * of the placement of memory barriers in a simple lock implementation: - * - wait until compare-and-swap(lock-is-free --> lock-is-held) succeeds - * - barrier - * - [do work] - * - barrier - * - store(lock-is-free) - * In very crude terms, the initial (acquire) barrier prevents any of the - * "work" from happening before the lock is held, and the later (release) - * barrier ensures that all of the work happens before the lock is released. - * (Think of cached writes, cache read-ahead, and instruction reordering - * around the CAS and store instructions.) - * - * The barriers must apply to both the compiler and the CPU. Note it is - * legal for instructions that occur before an "acquire" barrier to be - * moved down below it, and for instructions that occur after a "release" - * barrier to be moved up above it. - * - * The ARM-driven implementation we use here is short on subtlety, - * and actually requests a full barrier from the compiler and the CPU. - * The only difference between acquire and release is in whether they - * are issued before or after the atomic operation with which they - * are associated. To ease the transition to C/C++ atomic intrinsics, - * you should not rely on this, and instead assume that only the minimal - * acquire/release protection is provided. - * - * NOTE: all int32_t* values are expected to be aligned on 32-bit boundaries. - * If they are not, atomicity is not guaranteed. - */ - -/* - * Basic arithmetic and bitwise operations. These all provide a - * barrier with "release" ordering, and return the previous value. - * - * These have the same characteristics (e.g. what happens on overflow) - * as the equivalent non-atomic C operations. - */ -int32_t android_atomic_inc(volatile int32_t* addr); -int32_t android_atomic_dec(volatile int32_t* addr); -int32_t android_atomic_add(int32_t value, volatile int32_t* addr); -int32_t android_atomic_and(int32_t value, volatile int32_t* addr); -int32_t android_atomic_or(int32_t value, volatile int32_t* addr); - -/* - * Perform an atomic load with "acquire" or "release" ordering. - * - * This is only necessary if you need the memory barrier. A 32-bit read - * from a 32-bit aligned address is atomic on all supported platforms. - */ -int32_t android_atomic_acquire_load(volatile const int32_t* addr); -int32_t android_atomic_release_load(volatile const int32_t* addr); - -/* - * Perform an atomic store with "acquire" or "release" ordering. - * - * This is only necessary if you need the memory barrier. A 32-bit write - * to a 32-bit aligned address is atomic on all supported platforms. - */ -void android_atomic_acquire_store(int32_t value, volatile int32_t* addr); -void android_atomic_release_store(int32_t value, volatile int32_t* addr); - -/* - * Compare-and-set operation with "acquire" or "release" ordering. - * - * This returns zero if the new value was successfully stored, which will - * only happen when *addr == oldvalue. - * - * (The return value is inverted from implementations on other platforms, - * but matches the ARM ldrex/strex result.) - * - * Implementations that use the release CAS in a loop may be less efficient - * than possible, because we re-issue the memory barrier on each iteration. - */ -int android_atomic_acquire_cas(int32_t oldvalue, int32_t newvalue, - volatile int32_t* addr); -int android_atomic_release_cas(int32_t oldvalue, int32_t newvalue, - volatile int32_t* addr); - -/* - * Aliases for code using an older version of this header. These are now - * deprecated and should not be used. The definitions will be removed - * in a future release. - */ -#define android_atomic_write android_atomic_release_store -#define android_atomic_cmpxchg android_atomic_release_cas - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // ANDROID_CUTILS_ATOMIC_H diff --git a/external/android/include/18/system/core/include/cutils/bitops.h b/external/android/include/18/system/core/include/cutils/bitops.h deleted file mode 100644 index eb44236..0000000 --- a/external/android/include/18/system/core/include/cutils/bitops.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 2011 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 __CUTILS_BITOPS_H -#define __CUTILS_BITOPS_H - -#include -#include -#include -#include - -__BEGIN_DECLS - -/* - * Bitmask Operations - * - * Note this doesn't provide any locking/exclusion, and isn't atomic. - * Additionally no bounds checking is done on the bitmask array. - * - * Example: - * - * int num_resources; - * unsigned int resource_bits[BITS_TO_WORDS(num_resources)]; - * bitmask_init(resource_bits, num_resources); - * ... - * int bit = bitmask_ffz(resource_bits, num_resources); - * bitmask_set(resource_bits, bit); - * ... - * if (bitmask_test(resource_bits, bit)) { ... } - * ... - * bitmask_clear(resource_bits, bit); - * - */ - -#define BITS_PER_WORD (sizeof(unsigned int) * 8) -#define BITS_TO_WORDS(x) (((x) + BITS_PER_WORD - 1) / BITS_PER_WORD) -#define BIT_IN_WORD(x) ((x) % BITS_PER_WORD) -#define BIT_WORD(x) ((x) / BITS_PER_WORD) -#define BIT_MASK(x) (1 << BIT_IN_WORD(x)) - -static inline void bitmask_init(unsigned int *bitmask, int num_bits) -{ - memset(bitmask, 0, BITS_TO_WORDS(num_bits)*sizeof(unsigned int)); -} - -static inline int bitmask_ffz(unsigned int *bitmask, int num_bits) -{ - int bit, result; - unsigned int i; - - for (i = 0; i < BITS_TO_WORDS(num_bits); i++) { - bit = ffs(~bitmask[i]); - if (bit) { - // ffs is 1-indexed, return 0-indexed result - bit--; - result = BITS_PER_WORD * i + bit; - if (result >= num_bits) - return -1; - return result; - } - } - return -1; -} - -static inline void bitmask_set(unsigned int *bitmask, int bit) -{ - bitmask[BIT_WORD(bit)] |= BIT_MASK(bit); -} - -static inline void bitmask_clear(unsigned int *bitmask, int bit) -{ - bitmask[BIT_WORD(bit)] &= ~BIT_MASK(bit); -} - -static inline bool bitmask_test(unsigned int *bitmask, int bit) -{ - return bitmask[BIT_WORD(bit)] & BIT_MASK(bit); -} - -static inline int popcount(unsigned int x) -{ - return __builtin_popcount(x); -} - -static inline int popcountl(unsigned long x) -{ - return __builtin_popcountl(x); -} - -static inline int popcountll(unsigned long long x) -{ - return __builtin_popcountll(x); -} - -__END_DECLS - -#endif /* __CUTILS_BITOPS_H */ diff --git a/external/android/include/18/system/core/include/cutils/compiler.h b/external/android/include/18/system/core/include/cutils/compiler.h deleted file mode 100644 index 70f884a..0000000 --- a/external/android/include/18/system/core/include/cutils/compiler.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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_CUTILS_COMPILER_H -#define ANDROID_CUTILS_COMPILER_H - -/* - * helps the compiler's optimizer predicting branches - */ - -#ifdef __cplusplus -# define CC_LIKELY( exp ) (__builtin_expect( !!(exp), true )) -# define CC_UNLIKELY( exp ) (__builtin_expect( !!(exp), false )) -#else -# define CC_LIKELY( exp ) (__builtin_expect( !!(exp), 1 )) -# define CC_UNLIKELY( exp ) (__builtin_expect( !!(exp), 0 )) -#endif - -/** - * exports marked symbols - * - * if used on a C++ class declaration, this macro must be inserted - * after the "class" keyword. For instance: - * - * template - * class ANDROID_API Singleton { } - */ - -#define ANDROID_API __attribute__((visibility("default"))) - -#endif // ANDROID_CUTILS_COMPILER_H diff --git a/external/android/include/18/system/core/include/cutils/config_utils.h b/external/android/include/18/system/core/include/cutils/config_utils.h deleted file mode 100644 index 2dea6f1..0000000 --- a/external/android/include/18/system/core/include/cutils/config_utils.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2006 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 __CUTILS_CONFIG_UTILS_H -#define __CUTILS_CONFIG_UTILS_H - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct cnode cnode; - - -struct cnode -{ - cnode *next; - cnode *first_child; - cnode *last_child; - const char *name; - const char *value; -}; - -/* parse a text string into a config node tree */ -void config_load(cnode *root, char *data); - -/* parse a file into a config node tree */ -void config_load_file(cnode *root, const char *fn); - -/* create a single config node */ -cnode* config_node(const char *name, const char *value); - -/* locate a named child of a config node */ -cnode* config_find(cnode *root, const char *name); - -/* look up a child by name and return the boolean value */ -int config_bool(cnode *root, const char *name, int _default); - -/* look up a child by name and return the string value */ -const char* config_str(cnode *root, const char *name, const char *_default); - -/* add a named child to a config node (or modify it if it already exists) */ -void config_set(cnode *root, const char *name, const char *value); - -/* free a config node tree */ -void config_free(cnode *root); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/external/android/include/18/system/core/include/cutils/cpu_info.h b/external/android/include/18/system/core/include/cutils/cpu_info.h deleted file mode 100644 index 78c1884..0000000 --- a/external/android/include/18/system/core/include/cutils/cpu_info.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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 __CUTILS_CPU_INFO_H -#define __CUTILS_CPU_INFO_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* returns a string contiaining an ASCII representation of the CPU serial number, -** or NULL if cpu info not available. -** The string is a static variable, so don't call free() on it. -*/ -extern const char* get_cpu_serial_number(void); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_CPU_INFO_H */ diff --git a/external/android/include/18/system/core/include/cutils/debugger.h b/external/android/include/18/system/core/include/cutils/debugger.h deleted file mode 100644 index 4eda523..0000000 --- a/external/android/include/18/system/core/include/cutils/debugger.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2012 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 __CUTILS_DEBUGGER_H -#define __CUTILS_DEBUGGER_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define DEBUGGER_SOCKET_NAME "android:debuggerd" - -typedef enum { - // dump a crash - DEBUGGER_ACTION_CRASH, - // dump a tombstone file - DEBUGGER_ACTION_DUMP_TOMBSTONE, - // dump a backtrace only back to the socket - DEBUGGER_ACTION_DUMP_BACKTRACE, -} debugger_action_t; - -typedef struct { - debugger_action_t action; - pid_t tid; - uintptr_t abort_msg_address; -} debugger_msg_t; - -/* Dumps a process backtrace, registers, and stack to a tombstone file (requires root). - * Stores the tombstone path in the provided buffer. - * Returns 0 on success, -1 on error. - */ -int dump_tombstone(pid_t tid, char* pathbuf, size_t pathlen); - -/* Dumps a process backtrace only to the specified file (requires root). - * Returns 0 on success, -1 on error. - */ -int dump_backtrace_to_file(pid_t tid, int fd); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_DEBUGGER_H */ diff --git a/external/android/include/18/system/core/include/cutils/dir_hash.h b/external/android/include/18/system/core/include/cutils/dir_hash.h deleted file mode 100644 index fbb4d02..0000000 --- a/external/android/include/18/system/core/include/cutils/dir_hash.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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. - */ - -typedef enum { - SHA_1, -} HashAlgorithm; - -int get_file_hash(HashAlgorithm algorithm, const char *path, - char *output_string, size_t max_output_string); - -int get_recursive_hash_manifest(HashAlgorithm algorithm, - const char *directory_path, - char **output_string); diff --git a/external/android/include/18/system/core/include/cutils/event_tag_map.h b/external/android/include/18/system/core/include/cutils/event_tag_map.h deleted file mode 100644 index 1653c61..0000000 --- a/external/android/include/18/system/core/include/cutils/event_tag_map.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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 _LIBS_CUTILS_EVENTTAGMAP_H -#define _LIBS_CUTILS_EVENTTAGMAP_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define EVENT_TAG_MAP_FILE "/system/etc/event-log-tags" - -struct EventTagMap; -typedef struct EventTagMap EventTagMap; - -/* - * Open the specified file as an event log tag map. - * - * Returns NULL on failure. - */ -EventTagMap* android_openEventTagMap(const char* fileName); - -/* - * Close the map. - */ -void android_closeEventTagMap(EventTagMap* map); - -/* - * Look up a tag by index. Returns the tag string, or NULL if not found. - */ -const char* android_lookupEventTag(const EventTagMap* map, int tag); - -#ifdef __cplusplus -} -#endif - -#endif /*_LIBS_CUTILS_EVENTTAGMAP_H*/ diff --git a/external/android/include/18/system/core/include/cutils/fs.h b/external/android/include/18/system/core/include/cutils/fs.h deleted file mode 100644 index fd5296b..0000000 --- a/external/android/include/18/system/core/include/cutils/fs.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2012 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 __CUTILS_FS_H -#define __CUTILS_FS_H - -#include - -/* - * TEMP_FAILURE_RETRY is defined by some, but not all, versions of - * . (Alas, it is not as standard as we'd hoped!) So, if it's - * not already defined, then define it here. - */ -#ifndef TEMP_FAILURE_RETRY -/* Used to retry syscalls that can return EINTR. */ -#define TEMP_FAILURE_RETRY(exp) ({ \ - typeof (exp) _rc; \ - do { \ - _rc = (exp); \ - } while (_rc == -1 && errno == EINTR); \ - _rc; }) -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Ensure that directory exists with given mode and owners. - */ -extern int fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid); - -/* - * Read single plaintext integer from given file, correctly handling files - * partially written with fs_write_atomic_int(). - */ -extern int fs_read_atomic_int(const char* path, int* value); - -/* - * Write single plaintext integer to given file, creating backup while - * in progress. - */ -extern int fs_write_atomic_int(const char* path, int value); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_FS_H */ diff --git a/external/android/include/18/system/core/include/cutils/hashmap.h b/external/android/include/18/system/core/include/cutils/hashmap.h deleted file mode 100644 index 5cb344c..0000000 --- a/external/android/include/18/system/core/include/cutils/hashmap.h +++ /dev/null @@ -1,150 +0,0 @@ -/* - * 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. - */ - -/** - * Hash map. - */ - -#ifndef __HASHMAP_H -#define __HASHMAP_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** A hash map. */ -typedef struct Hashmap Hashmap; - -/** - * Creates a new hash map. Returns NULL if memory allocation fails. - * - * @param initialCapacity number of expected entries - * @param hash function which hashes keys - * @param equals function which compares keys for equality - */ -Hashmap* hashmapCreate(size_t initialCapacity, - int (*hash)(void* key), bool (*equals)(void* keyA, void* keyB)); - -/** - * Frees the hash map. Does not free the keys or values themselves. - */ -void hashmapFree(Hashmap* map); - -/** - * Hashes the memory pointed to by key with the given size. Useful for - * implementing hash functions. - */ -int hashmapHash(void* key, size_t keySize); - -/** - * Puts value for the given key in the map. Returns pre-existing value if - * any. - * - * If memory allocation fails, this function returns NULL, the map's size - * does not increase, and errno is set to ENOMEM. - */ -void* hashmapPut(Hashmap* map, void* key, void* value); - -/** - * Gets a value from the map. Returns NULL if no entry for the given key is - * found or if the value itself is NULL. - */ -void* hashmapGet(Hashmap* map, void* key); - -/** - * Returns true if the map contains an entry for the given key. - */ -bool hashmapContainsKey(Hashmap* map, void* key); - -/** - * Gets the value for a key. If a value is not found, this function gets a - * value and creates an entry using the given callback. - * - * If memory allocation fails, the callback is not called, this function - * returns NULL, and errno is set to ENOMEM. - */ -void* hashmapMemoize(Hashmap* map, void* key, - void* (*initialValue)(void* key, void* context), void* context); - -/** - * Removes an entry from the map. Returns the removed value or NULL if no - * entry was present. - */ -void* hashmapRemove(Hashmap* map, void* key); - -/** - * Gets the number of entries in this map. - */ -size_t hashmapSize(Hashmap* map); - -/** - * Invokes the given callback on each entry in the map. Stops iterating if - * the callback returns false. - */ -void hashmapForEach(Hashmap* map, - bool (*callback)(void* key, void* value, void* context), - void* context); - -/** - * Concurrency support. - */ - -/** - * Locks the hash map so only the current thread can access it. - */ -void hashmapLock(Hashmap* map); - -/** - * Unlocks the hash map so other threads can access it. - */ -void hashmapUnlock(Hashmap* map); - -/** - * Key utilities. - */ - -/** - * Hashes int keys. 'key' is a pointer to int. - */ -int hashmapIntHash(void* key); - -/** - * Compares two int keys for equality. - */ -bool hashmapIntEquals(void* keyA, void* keyB); - -/** - * For debugging. - */ - -/** - * Gets current capacity. - */ -size_t hashmapCurrentCapacity(Hashmap* map); - -/** - * Counts the number of entry collisions. - */ -size_t hashmapCountCollisions(Hashmap* map); - -#ifdef __cplusplus -} -#endif - -#endif /* __HASHMAP_H */ diff --git a/external/android/include/18/system/core/include/cutils/iosched_policy.h b/external/android/include/18/system/core/include/cutils/iosched_policy.h deleted file mode 100644 index 07c5d1f..0000000 --- a/external/android/include/18/system/core/include/cutils/iosched_policy.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 __CUTILS_IOSCHED_POLICY_H -#define __CUTILS_IOSCHED_POLICY_H - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - IoSchedClass_NONE, - IoSchedClass_RT, - IoSchedClass_BE, - IoSchedClass_IDLE, -} IoSchedClass; - -extern int android_set_ioprio(int pid, IoSchedClass clazz, int ioprio); -extern int android_get_ioprio(int pid, IoSchedClass *clazz, int *ioprio); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_IOSCHED_POLICY_H */ diff --git a/external/android/include/18/system/core/include/cutils/jstring.h b/external/android/include/18/system/core/include/cutils/jstring.h deleted file mode 100644 index ee0018f..0000000 --- a/external/android/include/18/system/core/include/cutils/jstring.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2006 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 __CUTILS_STRING16_H -#define __CUTILS_STRING16_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef uint16_t char16_t; - -extern char * strndup16to8 (const char16_t* s, size_t n); -extern size_t strnlen16to8 (const char16_t* s, size_t n); -extern char * strncpy16to8 (char *dest, const char16_t*s, size_t n); - -extern char16_t * strdup8to16 (const char* s, size_t *out_len); -extern size_t strlen8to16 (const char* utf8Str); -extern char16_t * strcpy8to16 (char16_t *dest, const char*s, size_t *out_len); -extern char16_t * strcpylen8to16 (char16_t *dest, const char*s, int length, - size_t *out_len); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_STRING16_H */ diff --git a/external/android/include/18/system/core/include/cutils/klog.h b/external/android/include/18/system/core/include/cutils/klog.h deleted file mode 100644 index ba728ac..0000000 --- a/external/android/include/18/system/core/include/cutils/klog.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2010 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 _CUTILS_KLOG_H_ -#define _CUTILS_KLOG_H_ - -#include - -__BEGIN_DECLS - -void klog_init(void); -void klog_set_level(int level); -void klog_close(void); -void klog_write(int level, const char *fmt, ...) - __attribute__ ((format(printf, 2, 3))); - -__END_DECLS - -#define KLOG_ERROR(tag,x...) klog_write(3, "<3>" tag ": " x) -#define KLOG_WARNING(tag,x...) klog_write(4, "<4>" tag ": " x) -#define KLOG_NOTICE(tag,x...) klog_write(5, "<5>" tag ": " x) -#define KLOG_INFO(tag,x...) klog_write(6, "<6>" tag ": " x) -#define KLOG_DEBUG(tag,x...) klog_write(7, "<7>" tag ": " x) - -#define KLOG_DEFAULT_LEVEL 3 /* messages <= this level are logged */ - -#endif diff --git a/external/android/include/18/system/core/include/cutils/list.h b/external/android/include/18/system/core/include/cutils/list.h deleted file mode 100644 index 3881fc9..0000000 --- a/external/android/include/18/system/core/include/cutils/list.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2010 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 _CUTILS_LIST_H_ -#define _CUTILS_LIST_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -struct listnode -{ - struct listnode *next; - struct listnode *prev; -}; - -#define node_to_item(node, container, member) \ - (container *) (((char*) (node)) - offsetof(container, member)) - -#define list_declare(name) \ - struct listnode name = { \ - .next = &name, \ - .prev = &name, \ - } - -#define list_for_each(node, list) \ - for (node = (list)->next; node != (list); node = node->next) - -#define list_for_each_reverse(node, list) \ - for (node = (list)->prev; node != (list); node = node->prev) - -void list_init(struct listnode *list); -void list_add_tail(struct listnode *list, struct listnode *item); -void list_remove(struct listnode *item); - -#define list_empty(list) ((list) == (list)->next) -#define list_head(list) ((list)->next) -#define list_tail(list) ((list)->prev) - -#ifdef __cplusplus -}; -#endif /* __cplusplus */ - -#endif diff --git a/external/android/include/18/system/core/include/cutils/log.h b/external/android/include/18/system/core/include/cutils/log.h deleted file mode 100644 index 8b045c7..0000000 --- a/external/android/include/18/system/core/include/cutils/log.h +++ /dev/null @@ -1,563 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// C/C++ logging functions. See the logging documentation for API details. -// -// We'd like these to be available from C code (in case we import some from -// somewhere), so this has a C interface. -// -// The output will be correct when the log file is shared between multiple -// threads and/or multiple processes so long as the operating system -// supports O_APPEND. These calls have mutex-protected data structures -// and so are NOT reentrant. Do not use LOG in a signal handler. -// -#ifndef _LIBS_CUTILS_LOG_H -#define _LIBS_CUTILS_LOG_H - -#include -#include -#include -#include -#ifdef HAVE_PTHREADS -#include -#endif -#include - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// --------------------------------------------------------------------- - -/* - * Normally we strip ALOGV (VERBOSE messages) from release builds. - * You can modify this (for example with "#define LOG_NDEBUG 0" - * at the top of your source file) to change that behavior. - */ -#ifndef LOG_NDEBUG -#ifdef NDEBUG -#define LOG_NDEBUG 1 -#else -#define LOG_NDEBUG 0 -#endif -#endif - -/* - * This is the local tag used for the following simplified - * logging macros. You can change this preprocessor definition - * before using the other macros to change the tag. - */ -#ifndef LOG_TAG -#define LOG_TAG NULL -#endif - -// --------------------------------------------------------------------- - -/* - * Simplified macro to send a verbose log message using the current LOG_TAG. - */ -#ifndef ALOGV -#if LOG_NDEBUG -#define ALOGV(...) ((void)0) -#else -#define ALOGV(...) ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) -#endif -#endif - -#define CONDITION(cond) (__builtin_expect((cond)!=0, 0)) - -#ifndef ALOGV_IF -#if LOG_NDEBUG -#define ALOGV_IF(cond, ...) ((void)0) -#else -#define ALOGV_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif -#endif - -/* - * Simplified macro to send a debug log message using the current LOG_TAG. - */ -#ifndef ALOGD -#define ALOGD(...) ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef ALOGD_IF -#define ALOGD_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send an info log message using the current LOG_TAG. - */ -#ifndef ALOGI -#define ALOGI(...) ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef ALOGI_IF -#define ALOGI_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send a warning log message using the current LOG_TAG. - */ -#ifndef ALOGW -#define ALOGW(...) ((void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef ALOGW_IF -#define ALOGW_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send an error log message using the current LOG_TAG. - */ -#ifndef ALOGE -#define ALOGE(...) ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef ALOGE_IF -#define ALOGE_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -// --------------------------------------------------------------------- - -/* - * Conditional based on whether the current LOG_TAG is enabled at - * verbose priority. - */ -#ifndef IF_ALOGV -#if LOG_NDEBUG -#define IF_ALOGV() if (false) -#else -#define IF_ALOGV() IF_ALOG(LOG_VERBOSE, LOG_TAG) -#endif -#endif - -/* - * Conditional based on whether the current LOG_TAG is enabled at - * debug priority. - */ -#ifndef IF_ALOGD -#define IF_ALOGD() IF_ALOG(LOG_DEBUG, LOG_TAG) -#endif - -/* - * Conditional based on whether the current LOG_TAG is enabled at - * info priority. - */ -#ifndef IF_ALOGI -#define IF_ALOGI() IF_ALOG(LOG_INFO, LOG_TAG) -#endif - -/* - * Conditional based on whether the current LOG_TAG is enabled at - * warn priority. - */ -#ifndef IF_ALOGW -#define IF_ALOGW() IF_ALOG(LOG_WARN, LOG_TAG) -#endif - -/* - * Conditional based on whether the current LOG_TAG is enabled at - * error priority. - */ -#ifndef IF_ALOGE -#define IF_ALOGE() IF_ALOG(LOG_ERROR, LOG_TAG) -#endif - - -// --------------------------------------------------------------------- - -/* - * Simplified macro to send a verbose system log message using the current LOG_TAG. - */ -#ifndef SLOGV -#if LOG_NDEBUG -#define SLOGV(...) ((void)0) -#else -#define SLOGV(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) -#endif -#endif - -#define CONDITION(cond) (__builtin_expect((cond)!=0, 0)) - -#ifndef SLOGV_IF -#if LOG_NDEBUG -#define SLOGV_IF(cond, ...) ((void)0) -#else -#define SLOGV_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif -#endif - -/* - * Simplified macro to send a debug system log message using the current LOG_TAG. - */ -#ifndef SLOGD -#define SLOGD(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef SLOGD_IF -#define SLOGD_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send an info system log message using the current LOG_TAG. - */ -#ifndef SLOGI -#define SLOGI(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef SLOGI_IF -#define SLOGI_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send a warning system log message using the current LOG_TAG. - */ -#ifndef SLOGW -#define SLOGW(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef SLOGW_IF -#define SLOGW_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send an error system log message using the current LOG_TAG. - */ -#ifndef SLOGE -#define SLOGE(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef SLOGE_IF -#define SLOGE_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -// --------------------------------------------------------------------- - -/* - * Simplified macro to send a verbose radio log message using the current LOG_TAG. - */ -#ifndef RLOGV -#if LOG_NDEBUG -#define RLOGV(...) ((void)0) -#else -#define RLOGV(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) -#endif -#endif - -#define CONDITION(cond) (__builtin_expect((cond)!=0, 0)) - -#ifndef RLOGV_IF -#if LOG_NDEBUG -#define RLOGV_IF(cond, ...) ((void)0) -#else -#define RLOGV_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif -#endif - -/* - * Simplified macro to send a debug radio log message using the current LOG_TAG. - */ -#ifndef RLOGD -#define RLOGD(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef RLOGD_IF -#define RLOGD_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send an info radio log message using the current LOG_TAG. - */ -#ifndef RLOGI -#define RLOGI(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef RLOGI_IF -#define RLOGI_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send a warning radio log message using the current LOG_TAG. - */ -#ifndef RLOGW -#define RLOGW(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef RLOGW_IF -#define RLOGW_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send an error radio log message using the current LOG_TAG. - */ -#ifndef RLOGE -#define RLOGE(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef RLOGE_IF -#define RLOGE_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - - -// --------------------------------------------------------------------- - -/* - * Log a fatal error. If the given condition fails, this stops program - * execution like a normal assertion, but also generating the given message. - * It is NOT stripped from release builds. Note that the condition test - * is -inverted- from the normal assert() semantics. - */ -#ifndef LOG_ALWAYS_FATAL_IF -#define LOG_ALWAYS_FATAL_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)android_printAssert(#cond, LOG_TAG, ## __VA_ARGS__)) \ - : (void)0 ) -#endif - -#ifndef LOG_ALWAYS_FATAL -#define LOG_ALWAYS_FATAL(...) \ - ( ((void)android_printAssert(NULL, LOG_TAG, ## __VA_ARGS__)) ) -#endif - -/* - * Versions of LOG_ALWAYS_FATAL_IF and LOG_ALWAYS_FATAL that - * are stripped out of release builds. - */ -#if LOG_NDEBUG - -#ifndef LOG_FATAL_IF -#define LOG_FATAL_IF(cond, ...) ((void)0) -#endif -#ifndef LOG_FATAL -#define LOG_FATAL(...) ((void)0) -#endif - -#else - -#ifndef LOG_FATAL_IF -#define LOG_FATAL_IF(cond, ...) LOG_ALWAYS_FATAL_IF(cond, ## __VA_ARGS__) -#endif -#ifndef LOG_FATAL -#define LOG_FATAL(...) LOG_ALWAYS_FATAL(__VA_ARGS__) -#endif - -#endif - -/* - * Assertion that generates a log message when the assertion fails. - * Stripped out of release builds. Uses the current LOG_TAG. - */ -#ifndef ALOG_ASSERT -#define ALOG_ASSERT(cond, ...) LOG_FATAL_IF(!(cond), ## __VA_ARGS__) -//#define ALOG_ASSERT(cond) LOG_FATAL_IF(!(cond), "Assertion failed: " #cond) -#endif - -// --------------------------------------------------------------------- - -/* - * Basic log message macro. - * - * Example: - * ALOG(LOG_WARN, NULL, "Failed with error %d", errno); - * - * The second argument may be NULL or "" to indicate the "global" tag. - */ -#ifndef ALOG -#define ALOG(priority, tag, ...) \ - LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__) -#endif - -/* - * Log macro that allows you to specify a number for the priority. - */ -#ifndef LOG_PRI -#define LOG_PRI(priority, tag, ...) \ - android_printLog(priority, tag, __VA_ARGS__) -#endif - -/* - * Log macro that allows you to pass in a varargs ("args" is a va_list). - */ -#ifndef LOG_PRI_VA -#define LOG_PRI_VA(priority, tag, fmt, args) \ - android_vprintLog(priority, NULL, tag, fmt, args) -#endif - -/* - * Conditional given a desired logging priority and tag. - */ -#ifndef IF_ALOG -#define IF_ALOG(priority, tag) \ - if (android_testLog(ANDROID_##priority, tag)) -#endif - -// --------------------------------------------------------------------- - -/* - * Event logging. - */ - -/* - * Event log entry types. These must match up with the declarations in - * java/android/android/util/EventLog.java. - */ -typedef enum { - EVENT_TYPE_INT = 0, - EVENT_TYPE_LONG = 1, - EVENT_TYPE_STRING = 2, - EVENT_TYPE_LIST = 3, -} AndroidEventLogType; - - -#ifndef LOG_EVENT_INT -#define LOG_EVENT_INT(_tag, _value) { \ - int intBuf = _value; \ - (void) android_btWriteLog(_tag, EVENT_TYPE_INT, &intBuf, \ - sizeof(intBuf)); \ - } -#endif -#ifndef LOG_EVENT_LONG -#define LOG_EVENT_LONG(_tag, _value) { \ - long long longBuf = _value; \ - (void) android_btWriteLog(_tag, EVENT_TYPE_LONG, &longBuf, \ - sizeof(longBuf)); \ - } -#endif -#ifndef LOG_EVENT_STRING -#define LOG_EVENT_STRING(_tag, _value) \ - ((void) 0) /* not implemented -- must combine len with string */ -#endif -/* TODO: something for LIST */ - -/* - * =========================================================================== - * - * The stuff in the rest of this file should not be used directly. - */ - -#define android_printLog(prio, tag, fmt...) \ - __android_log_print(prio, tag, fmt) - -#define android_vprintLog(prio, cond, tag, fmt...) \ - __android_log_vprint(prio, tag, fmt) - -/* XXX Macros to work around syntax errors in places where format string - * arg is not passed to ALOG_ASSERT, LOG_ALWAYS_FATAL or LOG_ALWAYS_FATAL_IF - * (happens only in debug builds). - */ - -/* Returns 2nd arg. Used to substitute default value if caller's vararg list - * is empty. - */ -#define __android_second(dummy, second, ...) second - -/* If passed multiple args, returns ',' followed by all but 1st arg, otherwise - * returns nothing. - */ -#define __android_rest(first, ...) , ## __VA_ARGS__ - -#define android_printAssert(cond, tag, fmt...) \ - __android_log_assert(cond, tag, \ - __android_second(0, ## fmt, NULL) __android_rest(fmt)) - -#define android_writeLog(prio, tag, text) \ - __android_log_write(prio, tag, text) - -#define android_bWriteLog(tag, payload, len) \ - __android_log_bwrite(tag, payload, len) -#define android_btWriteLog(tag, type, payload, len) \ - __android_log_btwrite(tag, type, payload, len) - -// TODO: remove these prototypes and their users -#define android_testLog(prio, tag) (1) -#define android_writevLog(vec,num) do{}while(0) -#define android_write1Log(str,len) do{}while (0) -#define android_setMinPriority(tag, prio) do{}while(0) -//#define android_logToCallback(func) do{}while(0) -#define android_logToFile(tag, file) (0) -#define android_logToFd(tag, fd) (0) - -typedef enum { - LOG_ID_MAIN = 0, - LOG_ID_RADIO = 1, - LOG_ID_EVENTS = 2, - LOG_ID_SYSTEM = 3, - - LOG_ID_MAX -} log_id_t; - -/* - * Send a simple string to the log. - */ -int __android_log_buf_write(int bufID, int prio, const char *tag, const char *text); -int __android_log_buf_print(int bufID, int prio, const char *tag, const char *fmt, ...); - - -#ifdef __cplusplus -} -#endif - -#endif // _LIBS_CUTILS_LOG_H diff --git a/external/android/include/18/system/core/include/cutils/logd.h b/external/android/include/18/system/core/include/cutils/logd.h deleted file mode 100644 index 8737639..0000000 --- a/external/android/include/18/system/core/include/cutils/logd.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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_CUTILS_LOGD_H -#define _ANDROID_CUTILS_LOGD_H - -/* the stable/frozen log-related definitions have been - * moved to this header, which is exposed by the NDK - */ -#include - -/* the rest is only used internally by the system */ -#include -#include -#include -#include -#include -#ifdef HAVE_PTHREADS -#include -#endif -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -int __android_log_bwrite(int32_t tag, const void *payload, size_t len); -int __android_log_btwrite(int32_t tag, char type, const void *payload, - size_t len); - -#ifdef __cplusplus -} -#endif - -#endif /* _LOGD_H */ diff --git a/external/android/include/18/system/core/include/cutils/logger.h b/external/android/include/18/system/core/include/cutils/logger.h deleted file mode 100644 index 04f3fb0..0000000 --- a/external/android/include/18/system/core/include/cutils/logger.h +++ /dev/null @@ -1,81 +0,0 @@ -/* utils/logger.h -** -** Copyright 2007, The Android Open Source Project -** -** This file is dual licensed. It may be redistributed and/or modified -** under the terms of the Apache 2.0 License OR version 2 of the GNU -** General Public License. -*/ - -#ifndef _UTILS_LOGGER_H -#define _UTILS_LOGGER_H - -#include - -/* - * The userspace structure for version 1 of the logger_entry ABI. - * This structure is returned to userspace by the kernel logger - * driver unless an upgrade to a newer ABI version is requested. - */ -struct logger_entry { - uint16_t len; /* length of the payload */ - uint16_t __pad; /* no matter what, we get 2 bytes of padding */ - int32_t pid; /* generating process's pid */ - int32_t tid; /* generating process's tid */ - int32_t sec; /* seconds since Epoch */ - int32_t nsec; /* nanoseconds */ - char msg[0]; /* the entry's payload */ -}; - -/* - * The userspace structure for version 2 of the logger_entry ABI. - * This structure is returned to userspace if ioctl(LOGGER_SET_VERSION) - * is called with version==2 - */ -struct logger_entry_v2 { - uint16_t len; /* length of the payload */ - uint16_t hdr_size; /* sizeof(struct logger_entry_v2) */ - int32_t pid; /* generating process's pid */ - int32_t tid; /* generating process's tid */ - int32_t sec; /* seconds since Epoch */ - int32_t nsec; /* nanoseconds */ - uint32_t euid; /* effective UID of logger */ - char msg[0]; /* the entry's payload */ -}; - -#define LOGGER_LOG_MAIN "log/main" -#define LOGGER_LOG_RADIO "log/radio" -#define LOGGER_LOG_EVENTS "log/events" -#define LOGGER_LOG_SYSTEM "log/system" - -/* - * The maximum size of the log entry payload that can be - * written to the kernel logger driver. An attempt to write - * more than this amount to /dev/log/* will result in a - * truncated log entry. - */ -#define LOGGER_ENTRY_MAX_PAYLOAD 4076 - -/* - * The maximum size of a log entry which can be read from the - * kernel logger driver. An attempt to read less than this amount - * may result in read() returning EINVAL. - */ -#define LOGGER_ENTRY_MAX_LEN (5*1024) - -#ifdef HAVE_IOCTL - -#include - -#define __LOGGERIO 0xAE - -#define LOGGER_GET_LOG_BUF_SIZE _IO(__LOGGERIO, 1) /* size of log */ -#define LOGGER_GET_LOG_LEN _IO(__LOGGERIO, 2) /* used log len */ -#define LOGGER_GET_NEXT_ENTRY_LEN _IO(__LOGGERIO, 3) /* next entry len */ -#define LOGGER_FLUSH_LOG _IO(__LOGGERIO, 4) /* flush log */ -#define LOGGER_GET_VERSION _IO(__LOGGERIO, 5) /* abi version */ -#define LOGGER_SET_VERSION _IO(__LOGGERIO, 6) /* abi version */ - -#endif // HAVE_IOCTL - -#endif /* _UTILS_LOGGER_H */ diff --git a/external/android/include/18/system/core/include/cutils/logprint.h b/external/android/include/18/system/core/include/cutils/logprint.h deleted file mode 100644 index 2b1e1c5..0000000 --- a/external/android/include/18/system/core/include/cutils/logprint.h +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (C) 2006 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 _LOGPRINT_H -#define _LOGPRINT_H - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - FORMAT_OFF = 0, - FORMAT_BRIEF, - FORMAT_PROCESS, - FORMAT_TAG, - FORMAT_THREAD, - FORMAT_RAW, - FORMAT_TIME, - FORMAT_THREADTIME, - FORMAT_LONG, -} AndroidLogPrintFormat; - -typedef struct AndroidLogFormat_t AndroidLogFormat; - -typedef struct AndroidLogEntry_t { - time_t tv_sec; - long tv_nsec; - android_LogPriority priority; - int32_t pid; - int32_t tid; - const char * tag; - size_t messageLen; - const char * message; -} AndroidLogEntry; - -AndroidLogFormat *android_log_format_new(); - -void android_log_format_free(AndroidLogFormat *p_format); - -void android_log_setPrintFormat(AndroidLogFormat *p_format, - AndroidLogPrintFormat format); - -/** - * Returns FORMAT_OFF on invalid string - */ -AndroidLogPrintFormat android_log_formatFromString(const char *s); - -/** - * filterExpression: a single filter expression - * eg "AT:d" - * - * returns 0 on success and -1 on invalid expression - * - * Assumes single threaded execution - * - */ - -int android_log_addFilterRule(AndroidLogFormat *p_format, - const char *filterExpression); - - -/** - * filterString: a whitespace-separated set of filter expressions - * eg "AT:d *:i" - * - * returns 0 on success and -1 on invalid expression - * - * Assumes single threaded execution - * - */ - -int android_log_addFilterString(AndroidLogFormat *p_format, - const char *filterString); - - -/** - * returns 1 if this log line should be printed based on its priority - * and tag, and 0 if it should not - */ -int android_log_shouldPrintLine ( - AndroidLogFormat *p_format, const char *tag, android_LogPriority pri); - - -/** - * Splits a wire-format buffer into an AndroidLogEntry - * entry allocated by caller. Pointers will point directly into buf - * - * Returns 0 on success and -1 on invalid wire format (entry will be - * in unspecified state) - */ -int android_log_processLogBuffer(struct logger_entry *buf, - AndroidLogEntry *entry); - -/** - * Like android_log_processLogBuffer, but for binary logs. - * - * If "map" is non-NULL, it will be used to convert the log tag number - * into a string. - */ -int android_log_processBinaryLogBuffer(struct logger_entry *buf, - AndroidLogEntry *entry, const EventTagMap* map, char* messageBuf, - int messageBufLen); - - -/** - * Formats a log message into a buffer - * - * Uses defaultBuffer if it can, otherwise malloc()'s a new buffer - * If return value != defaultBuffer, caller must call free() - * Returns NULL on malloc error - */ - -char *android_log_formatLogLine ( - AndroidLogFormat *p_format, - char *defaultBuffer, - size_t defaultBufferSize, - const AndroidLogEntry *p_line, - size_t *p_outLength); - - -/** - * Either print or do not print log line, based on filter - * - * Assumes single threaded execution - * - */ -int android_log_printLogLine( - AndroidLogFormat *p_format, - int fd, - const AndroidLogEntry *entry); - - -#ifdef __cplusplus -} -#endif - - -#endif /*_LOGPRINT_H*/ diff --git a/external/android/include/18/system/core/include/cutils/memory.h b/external/android/include/18/system/core/include/cutils/memory.h deleted file mode 100644 index e725cdd..0000000 --- a/external/android/include/18/system/core/include/cutils/memory.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2006 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_CUTILS_MEMORY_H -#define ANDROID_CUTILS_MEMORY_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* size is given in bytes and must be multiple of 2 */ -void android_memset16(uint16_t* dst, uint16_t value, size_t size); - -/* size is given in bytes and must be multiple of 4 */ -void android_memset32(uint32_t* dst, uint32_t value, size_t size); - -#if !HAVE_STRLCPY -/* Declaration of strlcpy() for platforms that don't already have it. */ -size_t strlcpy(char *dst, const char *src, size_t size); -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // ANDROID_CUTILS_MEMORY_H diff --git a/external/android/include/18/system/core/include/cutils/misc.h b/external/android/include/18/system/core/include/cutils/misc.h deleted file mode 100644 index 2c48dfa..0000000 --- a/external/android/include/18/system/core/include/cutils/misc.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2006 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 __CUTILS_MISC_H -#define __CUTILS_MISC_H - -#ifdef __cplusplus -extern "C" { -#endif - - /* Load an entire file into a malloc'd chunk of memory - * that is length_of_file + 1 (null terminator). If - * sz is non-zero, return the size of the file via sz. - * Returns 0 on failure. - */ -extern void *load_file(const char *fn, unsigned *sz); - - /* Connects your process to the system debugger daemon - * so that on a crash it may be logged or interactively - * debugged (depending on system settings). - */ -extern void debuggerd_connect(void); - - - /* This is the range of UIDs (and GIDs) that are reserved - * for assigning to applications. - */ -#define FIRST_APPLICATION_UID 10000 -#define LAST_APPLICATION_UID 99999 - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_MISC_H */ diff --git a/external/android/include/18/system/core/include/cutils/mq.h b/external/android/include/18/system/core/include/cutils/mq.h deleted file mode 100644 index b27456d..0000000 --- a/external/android/include/18/system/core/include/cutils/mq.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * 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. - */ - -/** - * IPC messaging library. - */ - -#ifndef __MQ_H -#define __MQ_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** A message. */ -typedef struct MqMessage MqMessage; - -/** A destination to which messages can be sent. */ -typedef struct MqDestination MqDestination; - -/* Array of bytes. */ -typedef struct MqBytes MqBytes; - -/** - * Hears messages. - * - * @param destination to which the message was sent - * @param message the message to hear - */ -typedef void MqMessageListener(MqDestination* destination, MqMessage* message); - -/** - * Hears a destination close. - * - * @param destination that closed - */ -typedef void MqCloseListener(MqDestination* destination); - -/** Message functions. */ - -/** - * Creates a new Message. - * - * @param header as defined by user - * @param body as defined by user - * @param replyTo destination to which replies should be sent, NULL if none - */ -MqMessage* mqCreateMessage(MqBytes header, MqBytes body, - MqDestination* replyTo); - -/** Sends a message to a destination. */ -void mqSendMessage(MqMessage* message, MqDestination* destination); - -/** Destination functions. */ - -/** - * Creates a new destination. Acquires a reference implicitly. - * - * @param messageListener function to call when a message is recieved - * @param closeListener function to call when the destination closes - * @param userData user-specific data to associate with the destination. - * Retrieve using mqGetDestinationUserData(). - */ -MqDestination* mqCreateDestination(MqMessageListener* messageListener, - MqCloseListener* closeListener, void* userData); - -/** - * Gets user data which was associated with the given destination at - * construction time. - * - * It is only valid to call this function in the same process that the - * given destination was created in. - * This function returns a null pointer if you call it on a destination - * created in a remote process. - */ -void* mqGetUserData(MqDestination* destination); - -/** - * Returns 1 if the destination was created in this process, or 0 if - * the destination was created in a different process, in which case you have - * a remote stub. - */ -int mqIsDestinationLocal(MqDestination* destination); - -/** - * Increments the destination's reference count. - */ -void mqKeepDestination(MqDesintation* destination); - -/** - * Decrements the destination's reference count. - */ -void mqFreeDestination(MqDestination* desintation); - -/** Registry API. */ - -/** - * Gets the destination bound to a name. - */ -MqDestination* mqGetDestination(char* name); - -/** - * Binds a destination to a name. - */ -void mqPutDestination(char* name, MqDestination* desintation); - -#ifdef __cplusplus -} -#endif - -#endif /* __MQ_H */ diff --git a/external/android/include/18/system/core/include/cutils/multiuser.h b/external/android/include/18/system/core/include/cutils/multiuser.h deleted file mode 100644 index 635ddb1..0000000 --- a/external/android/include/18/system/core/include/cutils/multiuser.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2012 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 __CUTILS_MULTIUSER_H -#define __CUTILS_MULTIUSER_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// NOTE: keep in sync with android.os.UserId - -#define MULTIUSER_APP_PER_USER_RANGE 100000 - -typedef uid_t userid_t; -typedef uid_t appid_t; - -extern userid_t multiuser_get_user_id(uid_t uid); -extern appid_t multiuser_get_app_id(uid_t uid); -extern uid_t multiuser_get_uid(userid_t userId, appid_t appId); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_MULTIUSER_H */ diff --git a/external/android/include/18/system/core/include/cutils/native_handle.h b/external/android/include/18/system/core/include/cutils/native_handle.h deleted file mode 100644 index 268c5d3..0000000 --- a/external/android/include/18/system/core/include/cutils/native_handle.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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 NATIVE_HANDLE_H_ -#define NATIVE_HANDLE_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct native_handle -{ - int version; /* sizeof(native_handle_t) */ - int numFds; /* number of file-descriptors at &data[0] */ - int numInts; /* number of ints at &data[numFds] */ - int data[0]; /* numFds + numInts ints */ -} native_handle_t; - -/* - * native_handle_close - * - * closes the file descriptors contained in this native_handle_t - * - * return 0 on success, or a negative error code on failure - * - */ -int native_handle_close(const native_handle_t* h); - - -/* - * native_handle_create - * - * creates a native_handle_t and initializes it. must be destroyed with - * native_handle_delete(). - * - */ -native_handle_t* native_handle_create(int numFds, int numInts); - -/* - * native_handle_delete - * - * frees a native_handle_t allocated with native_handle_create(). - * This ONLY frees the memory allocated for the native_handle_t, but doesn't - * close the file descriptors; which can be achieved with native_handle_close(). - * - * return 0 on success, or a negative error code on failure - * - */ -int native_handle_delete(native_handle_t* h); - - -#ifdef __cplusplus -} -#endif - -#endif /* NATIVE_HANDLE_H_ */ diff --git a/external/android/include/18/system/core/include/cutils/open_memstream.h b/external/android/include/18/system/core/include/cutils/open_memstream.h deleted file mode 100644 index b7998be..0000000 --- a/external/android/include/18/system/core/include/cutils/open_memstream.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2010 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 __CUTILS_OPEN_MEMSTREAM_H__ -#define __CUTILS_OPEN_MEMSTREAM_H__ - -#include - -#ifndef HAVE_OPEN_MEMSTREAM - -#ifdef __cplusplus -extern "C" { -#endif - -FILE* open_memstream(char** bufp, size_t* sizep); - -#ifdef __cplusplus -} -#endif - -#endif /*!HAVE_OPEN_MEMSTREAM*/ - -#endif /*__CUTILS_OPEN_MEMSTREAM_H__*/ diff --git a/external/android/include/18/system/core/include/cutils/partition_utils.h b/external/android/include/18/system/core/include/cutils/partition_utils.h deleted file mode 100644 index 597df92..0000000 --- a/external/android/include/18/system/core/include/cutils/partition_utils.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2011, 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 __CUTILS_PARTITION_WIPED_H__ -#define __CUTILS_PARTITION_WIPED_H__ - -__BEGIN_DECLS - -int partition_wiped(char *source); -void erase_footer(const char *dev_path, long long size); - -__END_DECLS - -#endif /* __CUTILS_PARTITION_WIPED_H__ */ diff --git a/external/android/include/18/system/core/include/cutils/process_name.h b/external/android/include/18/system/core/include/cutils/process_name.h deleted file mode 100644 index 1e72e5c..0000000 --- a/external/android/include/18/system/core/include/cutils/process_name.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ - -/** - * Gives the current process a name. - */ - -#ifndef __PROCESS_NAME_H -#define __PROCESS_NAME_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Sets the current process name. - * - * Warning: This leaks a string every time you call it. Use judiciously! - */ -void set_process_name(const char* process_name); - -/** Gets the current process name. */ -const char* get_process_name(void); - -#ifdef __cplusplus -} -#endif - -#endif /* __PROCESS_NAME_H */ diff --git a/external/android/include/18/system/core/include/cutils/properties.h b/external/android/include/18/system/core/include/cutils/properties.h deleted file mode 100644 index 25fd67a..0000000 --- a/external/android/include/18/system/core/include/cutils/properties.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2006 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 __CUTILS_PROPERTIES_H -#define __CUTILS_PROPERTIES_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* System properties are *small* name value pairs managed by the -** property service. If your data doesn't fit in the provided -** space it is not appropriate for a system property. -** -** WARNING: system/bionic/include/sys/system_properties.h also defines -** these, but with different names. (TODO: fix that) -*/ -#define PROPERTY_KEY_MAX 32 -#define PROPERTY_VALUE_MAX 92 - -/* property_get: returns the length of the value which will never be -** greater than PROPERTY_VALUE_MAX - 1 and will always be zero terminated. -** (the length does not include the terminating zero). -** -** If the property read fails or returns an empty value, the default -** value is used (if nonnull). -*/ -int property_get(const char *key, char *value, const char *default_value); - -/* property_set: returns 0 on success, < 0 on failure -*/ -int property_set(const char *key, const char *value); - -int property_list(void (*propfn)(const char *key, const char *value, void *cookie), void *cookie); - - -#ifdef HAVE_SYSTEM_PROPERTY_SERVER -/* - * We have an external property server instead of built-in libc support. - * Used by the simulator. - */ -#define SYSTEM_PROPERTY_PIPE_NAME "/tmp/android-sysprop" - -enum { - kSystemPropertyUnknown = 0, - kSystemPropertyGet, - kSystemPropertySet, - kSystemPropertyList -}; -#endif /*HAVE_SYSTEM_PROPERTY_SERVER*/ - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/external/android/include/18/system/core/include/cutils/qsort_r_compat.h b/external/android/include/18/system/core/include/cutils/qsort_r_compat.h deleted file mode 100644 index 479a1ab..0000000 --- a/external/android/include/18/system/core/include/cutils/qsort_r_compat.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2012 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. - */ - -/* - * Provides a portable version of qsort_r, called qsort_r_compat, which is a - * reentrant variant of qsort that passes a user data pointer to its comparator. - * This implementation follows the BSD parameter convention. - */ - -#ifndef _LIBS_CUTILS_QSORT_R_COMPAT_H -#define _LIBS_CUTILS_QSORT_R_COMPAT_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -void qsort_r_compat(void* base, size_t nel, size_t width, void* thunk, - int (*compar)(void*, const void* , const void* )); - -#ifdef __cplusplus -} -#endif - -#endif // _LIBS_CUTILS_QSORT_R_COMPAT_H diff --git a/external/android/include/18/system/core/include/cutils/qtaguid.h b/external/android/include/18/system/core/include/cutils/qtaguid.h deleted file mode 100644 index f8550fd..0000000 --- a/external/android/include/18/system/core/include/cutils/qtaguid.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2011 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 __CUTILS_QTAGUID_H -#define __CUTILS_QTAGUID_H - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Set tags (and owning UIDs) for network sockets. -*/ -extern int qtaguid_tagSocket(int sockfd, int tag, uid_t uid); - -/* - * Untag a network socket before closing. -*/ -extern int qtaguid_untagSocket(int sockfd); - -/* - * For the given uid, switch counter sets. - * The kernel only keeps a limited number of sets. - * 2 for now. - */ -extern int qtaguid_setCounterSet(int counterSetNum, uid_t uid); - -/* - * Delete all tag info that relates to the given tag an uid. - * If the tag is 0, then ALL info about the uid is freeded. - * The delete data also affects active tagged socketd, which are - * then untagged. - * The calling process can only operate on its own tags. - * Unless it is part of the happy AID_NET_BW_ACCT group. - * In which case it can clobber everything. - */ -extern int qtaguid_deleteTagData(int tag, uid_t uid); - -/* - * Enable/disable qtaguid functionnality at a lower level. - * When pacified, the kernel will accept commands but do nothing. - */ -extern int qtaguid_setPacifier(int on); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_QTAG_UID_H */ diff --git a/external/android/include/18/system/core/include/cutils/record_stream.h b/external/android/include/18/system/core/include/cutils/record_stream.h deleted file mode 100644 index bfac87a..0000000 --- a/external/android/include/18/system/core/include/cutils/record_stream.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2006 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. - */ - -/* - * A simple utility for reading fixed records out of a stream fd - */ - -#ifndef _CUTILS_RECORD_STREAM_H -#define _CUTILS_RECORD_STREAM_H - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef struct RecordStream RecordStream; - -extern RecordStream *record_stream_new(int fd, size_t maxRecordLen); -extern void record_stream_free(RecordStream *p_rs); - -extern int record_stream_get_next (RecordStream *p_rs, void ** p_outRecord, - size_t *p_outRecordLen); - -#ifdef __cplusplus -} -#endif - - -#endif /*_CUTILS_RECORD_STREAM_H*/ - diff --git a/external/android/include/18/system/core/include/cutils/sched_policy.h b/external/android/include/18/system/core/include/cutils/sched_policy.h deleted file mode 100644 index ba84ce3..0000000 --- a/external/android/include/18/system/core/include/cutils/sched_policy.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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 __CUTILS_SCHED_POLICY_H -#define __CUTILS_SCHED_POLICY_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* Keep in sync with THREAD_GROUP_* in frameworks/base/core/java/android/os/Process.java */ -typedef enum { - SP_DEFAULT = -1, - SP_BACKGROUND = 0, - SP_FOREGROUND = 1, - SP_SYSTEM = 2, // can't be used with set_sched_policy() - SP_AUDIO_APP = 3, - SP_AUDIO_SYS = 4, - SP_CNT, - SP_MAX = SP_CNT - 1, - SP_SYSTEM_DEFAULT = SP_FOREGROUND, -} SchedPolicy; - -/* Assign thread tid to the cgroup associated with the specified policy. - * If the thread is a thread group leader, that is it's gettid() == getpid(), - * then the other threads in the same thread group are _not_ affected. - * On platforms which support gettid(), zero tid means current thread. - * Return value: 0 for success, or -errno for error. - */ -extern int set_sched_policy(int tid, SchedPolicy policy); - -/* Return the policy associated with the cgroup of thread tid via policy pointer. - * On platforms which support gettid(), zero tid means current thread. - * Return value: 0 for success, or -1 for error and set errno. - */ -extern int get_sched_policy(int tid, SchedPolicy *policy); - -/* Return a displayable string corresponding to policy. - * Return value: non-NULL NUL-terminated name of unspecified length; - * the caller is responsible for displaying the useful part of the string. - */ -extern const char *get_sched_policy_name(SchedPolicy policy); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_SCHED_POLICY_H */ diff --git a/external/android/include/18/system/core/include/cutils/selector.h b/external/android/include/18/system/core/include/cutils/selector.h deleted file mode 100644 index dfc2a9d..0000000 --- a/external/android/include/18/system/core/include/cutils/selector.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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. - */ - -/** - * Framework for multiplexing I/O. A selector manages a set of file - * descriptors and calls out to user-provided callback functions to read and - * write data and handle errors. - */ - -#ifndef __SELECTOR_H -#define __SELECTOR_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -/** - * Manages SelectableFds and invokes their callbacks at appropriate times. - */ -typedef struct Selector Selector; - -/** - * A selectable descriptor. Contains callbacks which the selector can invoke - * before calling select(), when the descriptor is readable or writable, and - * when the descriptor contains out-of-band data. Simply set a callback to - * NULL if you're not interested in that particular event. - * - * A selectable descriptor can indicate that it needs to be removed from the - * selector by setting the 'remove' flag. The selector will remove the - * descriptor at a later time and invoke the onRemove() callback. - * - * SelectableFd fields should only be modified from the selector loop. - */ -typedef struct SelectableFd SelectableFd; -struct SelectableFd { - - /** The file descriptor itself. */ - int fd; - - /** Pointer to user-specific data. Can be NULL. */ - void* data; - - /** - * Set this flag when you no longer wish to be selected. The selector - * will invoke onRemove() when the descriptor is actually removed. - */ - bool remove; - - /** - * Invoked by the selector before calling select. You can set up other - * callbacks from here as necessary. - */ - void (*beforeSelect)(SelectableFd* self); - - /** - * Invoked by the selector when the descriptor has data available. Set to - * NULL to indicate that you're not interested in reading. - */ - void (*onReadable)(SelectableFd* self); - - /** - * Invoked by the selector when the descriptor can accept data. Set to - * NULL to indicate that you're not interested in writing. - */ - void (*onWritable)(SelectableFd* self); - - /** - * Invoked by the selector when out-of-band (OOB) data is available. Set to - * NULL to indicate that you're not interested in OOB data. - */ - void (*onExcept)(SelectableFd* self); - - /** - * Invoked by the selector after the descriptor is removed from the - * selector but before the selector frees the SelectableFd memory. - */ - void (*onRemove)(SelectableFd* self); - - /** - * The selector which selected this fd. Set by the selector itself. - */ - Selector* selector; -}; - -/** - * Creates a new selector. - */ -Selector* selectorCreate(void); - -/** - * Creates a new selectable fd, adds it to the given selector and returns a - * pointer. Outside of 'selector' and 'fd', all fields are set to 0 or NULL - * by default. - * - * The selectable fd should only be modified from the selector loop thread. - */ -SelectableFd* selectorAdd(Selector* selector, int fd); - -/** - * Wakes up the selector even though no I/O events occurred. Use this - * to indicate that you're ready to write to a descriptor. - */ -void selectorWakeUp(Selector* selector); - -/** - * Loops continuously selecting file descriptors and firing events. - * Does not return. - */ -void selectorLoop(Selector* selector); - -#ifdef __cplusplus -} -#endif - -#endif /* __SELECTOR_H */ diff --git a/external/android/include/18/system/core/include/cutils/sockets.h b/external/android/include/18/system/core/include/cutils/sockets.h deleted file mode 100644 index 19cae0c..0000000 --- a/external/android/include/18/system/core/include/cutils/sockets.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2006 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 __CUTILS_SOCKETS_H -#define __CUTILS_SOCKETS_H - -#include -#include -#include -#include - -#ifdef HAVE_WINSOCK -#include -typedef int socklen_t; -#elif HAVE_SYS_SOCKET_H -#include -#endif - -#define ANDROID_SOCKET_ENV_PREFIX "ANDROID_SOCKET_" -#define ANDROID_SOCKET_DIR "/dev/socket" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * android_get_control_socket - simple helper function to get the file - * descriptor of our init-managed Unix domain socket. `name' is the name of the - * socket, as given in init.rc. Returns -1 on error. - * - * This is inline and not in libcutils proper because we want to use this in - * third-party daemons with minimal modification. - */ -static inline int android_get_control_socket(const char *name) -{ - char key[64] = ANDROID_SOCKET_ENV_PREFIX; - const char *val; - int fd; - - /* build our environment variable, counting cycles like a wolf ... */ -#if HAVE_STRLCPY - strlcpy(key + sizeof(ANDROID_SOCKET_ENV_PREFIX) - 1, - name, - sizeof(key) - sizeof(ANDROID_SOCKET_ENV_PREFIX)); -#else /* for the host, which may lack the almightly strncpy ... */ - strncpy(key + sizeof(ANDROID_SOCKET_ENV_PREFIX) - 1, - name, - sizeof(key) - sizeof(ANDROID_SOCKET_ENV_PREFIX)); - key[sizeof(key)-1] = '\0'; -#endif - - val = getenv(key); - if (!val) - return -1; - - errno = 0; - fd = strtol(val, NULL, 10); - if (errno) - return -1; - - return fd; -} - -/* - * See also android.os.LocalSocketAddress.Namespace - */ -// Linux "abstract" (non-filesystem) namespace -#define ANDROID_SOCKET_NAMESPACE_ABSTRACT 0 -// Android "reserved" (/dev/socket) namespace -#define ANDROID_SOCKET_NAMESPACE_RESERVED 1 -// Normal filesystem namespace -#define ANDROID_SOCKET_NAMESPACE_FILESYSTEM 2 - -extern int socket_loopback_client(int port, int type); -extern int socket_network_client(const char *host, int port, int type); -extern int socket_loopback_server(int port, int type); -extern int socket_local_server(const char *name, int namespaceId, int type); -extern int socket_local_server_bind(int s, const char *name, int namespaceId); -extern int socket_local_client_connect(int fd, - const char *name, int namespaceId, int type); -extern int socket_local_client(const char *name, int namespaceId, int type); -extern int socket_inaddr_any_server(int port, int type); - -/* - * socket_peer_is_trusted - Takes a socket which is presumed to be a - * connected local socket (e.g. AF_LOCAL) and returns whether the peer - * (the userid that owns the process on the other end of that socket) - * is one of the two trusted userids, root or shell. - * - * Note: This only works as advertised on the Android OS and always - * just returns true when called on other operating systems. - */ -extern bool socket_peer_is_trusted(int fd); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_SOCKETS_H */ diff --git a/external/android/include/18/system/core/include/cutils/str_parms.h b/external/android/include/18/system/core/include/cutils/str_parms.h deleted file mode 100644 index 247c996..0000000 --- a/external/android/include/18/system/core/include/cutils/str_parms.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2011 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 __CUTILS_STR_PARMS_H -#define __CUTILS_STR_PARMS_H - -#include - -struct str_parms; - -struct str_parms *str_parms_create(void); -struct str_parms *str_parms_create_str(const char *_string); -void str_parms_destroy(struct str_parms *str_parms); - -void str_parms_del(struct str_parms *str_parms, const char *key); - -int str_parms_add_str(struct str_parms *str_parms, const char *key, - const char *value); -int str_parms_add_int(struct str_parms *str_parms, const char *key, int value); - -int str_parms_add_float(struct str_parms *str_parms, const char *key, - float value); - -int str_parms_get_str(struct str_parms *str_parms, const char *key, - char *out_val, int len); -int str_parms_get_int(struct str_parms *str_parms, const char *key, - int *out_val); -int str_parms_get_float(struct str_parms *str_parms, const char *key, - float *out_val); - -char *str_parms_to_str(struct str_parms *str_parms); - -/* debug */ -void str_parms_dump(struct str_parms *str_parms); - -#endif /* __CUTILS_STR_PARMS_H */ diff --git a/external/android/include/18/system/core/include/cutils/threads.h b/external/android/include/18/system/core/include/cutils/threads.h deleted file mode 100644 index acf8f48..0000000 --- a/external/android/include/18/system/core/include/cutils/threads.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - * 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 _LIBS_CUTILS_THREADS_H -#define _LIBS_CUTILS_THREADS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/***********************************************************************/ -/***********************************************************************/ -/***** *****/ -/***** local thread storage *****/ -/***** *****/ -/***********************************************************************/ -/***********************************************************************/ - -#ifdef HAVE_PTHREADS - -#include - -typedef struct { - pthread_mutex_t lock; - int has_tls; - pthread_key_t tls; - -} thread_store_t; - -#define THREAD_STORE_INITIALIZER { PTHREAD_MUTEX_INITIALIZER, 0, 0 } - -#elif defined HAVE_WIN32_THREADS - -#include - -typedef struct { - int lock_init; - int has_tls; - DWORD tls; - CRITICAL_SECTION lock; - -} thread_store_t; - -#define THREAD_STORE_INITIALIZER { 0, 0, 0, {0, 0, 0, 0, 0, 0} } - -#else -# error "no thread_store_t implementation for your platform !!" -#endif - -typedef void (*thread_store_destruct_t)(void* value); - -extern void* thread_store_get(thread_store_t* store); - -extern void thread_store_set(thread_store_t* store, - void* value, - thread_store_destruct_t destroy); - -/***********************************************************************/ -/***********************************************************************/ -/***** *****/ -/***** mutexes *****/ -/***** *****/ -/***********************************************************************/ -/***********************************************************************/ - -#ifdef HAVE_PTHREADS - -typedef pthread_mutex_t mutex_t; - -#define MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER - -static __inline__ void mutex_lock(mutex_t* lock) -{ - pthread_mutex_lock(lock); -} -static __inline__ void mutex_unlock(mutex_t* lock) -{ - pthread_mutex_unlock(lock); -} -static __inline__ int mutex_init(mutex_t* lock) -{ - return pthread_mutex_init(lock, NULL); -} -static __inline__ void mutex_destroy(mutex_t* lock) -{ - pthread_mutex_destroy(lock); -} -#endif - -#ifdef HAVE_WIN32_THREADS -typedef struct { - int init; - CRITICAL_SECTION lock[1]; -} mutex_t; - -#define MUTEX_INITIALIZER { 0, {{ NULL, 0, 0, NULL, NULL, 0 }} } - -static __inline__ void mutex_lock(mutex_t* lock) -{ - if (!lock->init) { - lock->init = 1; - InitializeCriticalSection( lock->lock ); - lock->init = 2; - } else while (lock->init != 2) - Sleep(10); - - EnterCriticalSection(lock->lock); -} - -static __inline__ void mutex_unlock(mutex_t* lock) -{ - LeaveCriticalSection(lock->lock); -} -static __inline__ int mutex_init(mutex_t* lock) -{ - InitializeCriticalSection(lock->lock); - lock->init = 2; - return 0; -} -static __inline__ void mutex_destroy(mutex_t* lock) -{ - if (lock->init) { - lock->init = 0; - DeleteCriticalSection(lock->lock); - } -} -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* _LIBS_CUTILS_THREADS_H */ diff --git a/external/android/include/18/system/core/include/cutils/trace.h b/external/android/include/18/system/core/include/cutils/trace.h deleted file mode 100644 index 29034ca..0000000 --- a/external/android/include/18/system/core/include/cutils/trace.h +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Copyright (C) 2012 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 _LIBS_CUTILS_TRACE_H -#define _LIBS_CUTILS_TRACE_H - -#include -#include -#include -#include -#include -#include - -#ifdef ANDROID_SMP -#include -#else -#include -#endif - -__BEGIN_DECLS - -/** - * The ATRACE_TAG macro can be defined before including this header to trace - * using one of the tags defined below. It must be defined to one of the - * following ATRACE_TAG_* macros. The trace tag is used to filter tracing in - * userland to avoid some of the runtime cost of tracing when it is not desired. - * - * Defining ATRACE_TAG to be ATRACE_TAG_ALWAYS will result in the tracing always - * being enabled - this should ONLY be done for debug code, as userland tracing - * has a performance cost even when the trace is not being recorded. Defining - * ATRACE_TAG to be ATRACE_TAG_NEVER or leaving ATRACE_TAG undefined will result - * in the tracing always being disabled. - * - * ATRACE_TAG_HAL should be bitwise ORed with the relevant tags for tracing - * within a hardware module. For example a camera hardware module would set: - * #define ATRACE_TAG (ATRACE_TAG_CAMERA | ATRACE_TAG_HAL) - * - * Keep these in sync with frameworks/base/core/java/android/os/Trace.java. - */ -#define ATRACE_TAG_NEVER 0 // This tag is never enabled. -#define ATRACE_TAG_ALWAYS (1<<0) // This tag is always enabled. -#define ATRACE_TAG_GRAPHICS (1<<1) -#define ATRACE_TAG_INPUT (1<<2) -#define ATRACE_TAG_VIEW (1<<3) -#define ATRACE_TAG_WEBVIEW (1<<4) -#define ATRACE_TAG_WINDOW_MANAGER (1<<5) -#define ATRACE_TAG_ACTIVITY_MANAGER (1<<6) -#define ATRACE_TAG_SYNC_MANAGER (1<<7) -#define ATRACE_TAG_AUDIO (1<<8) -#define ATRACE_TAG_VIDEO (1<<9) -#define ATRACE_TAG_CAMERA (1<<10) -#define ATRACE_TAG_HAL (1<<11) -#define ATRACE_TAG_APP (1<<12) -#define ATRACE_TAG_RESOURCES (1<<13) -#define ATRACE_TAG_DALVIK (1<<14) -#define ATRACE_TAG_LAST ATRACE_TAG_DALVIK - -// Reserved for initialization. -#define ATRACE_TAG_NOT_READY (1LL<<63) - -#define ATRACE_TAG_VALID_MASK ((ATRACE_TAG_LAST - 1) | ATRACE_TAG_LAST) - -#ifndef ATRACE_TAG -#define ATRACE_TAG ATRACE_TAG_NEVER -#elif ATRACE_TAG > ATRACE_TAG_VALID_MASK -#error ATRACE_TAG must be defined to be one of the tags defined in cutils/trace.h -#endif - -#ifdef HAVE_ANDROID_OS -/** - * Maximum size of a message that can be logged to the trace buffer. - * Note this message includes a tag, the pid, and the string given as the name. - * Names should be kept short to get the most use of the trace buffer. - */ -#define ATRACE_MESSAGE_LENGTH 1024 - -/** - * Opens the trace file for writing and reads the property for initial tags. - * The atrace.tags.enableflags property sets the tags to trace. - * This function should not be explicitly called, the first call to any normal - * trace function will cause it to be run safely. - */ -void atrace_setup(); - -/** - * If tracing is ready, set atrace_enabled_tags to the system property - * debug.atrace.tags.enableflags. Can be used as a sysprop change callback. - */ -void atrace_update_tags(); - -/** - * Set whether the process is debuggable. By default the process is not - * considered debuggable. If the process is not debuggable then application- - * level tracing is not allowed unless the ro.debuggable system property is - * set to '1'. - */ -void atrace_set_debuggable(bool debuggable); - -/** - * Set whether tracing is enabled for the current process. This is used to - * prevent tracing within the Zygote process. - */ -void atrace_set_tracing_enabled(bool enabled); - -/** - * Flag indicating whether setup has been completed, initialized to 0. - * Nonzero indicates setup has completed. - * Note: This does NOT indicate whether or not setup was successful. - */ -extern volatile int32_t atrace_is_ready; - -/** - * Set of ATRACE_TAG flags to trace for, initialized to ATRACE_TAG_NOT_READY. - * A value of zero indicates setup has failed. - * Any other nonzero value indicates setup has succeeded, and tracing is on. - */ -extern uint64_t atrace_enabled_tags; - -/** - * Handle to the kernel's trace buffer, initialized to -1. - * Any other value indicates setup has succeeded, and is a valid fd for tracing. - */ -extern int atrace_marker_fd; - -/** - * atrace_init readies the process for tracing by opening the trace_marker file. - * Calling any trace function causes this to be run, so calling it is optional. - * This can be explicitly run to avoid setup delay on first trace function. - */ -#define ATRACE_INIT() atrace_init() -static inline void atrace_init() -{ - if (CC_UNLIKELY(!android_atomic_acquire_load(&atrace_is_ready))) { - atrace_setup(); - } -} - -/** - * Get the mask of all tags currently enabled. - * It can be used as a guard condition around more expensive trace calculations. - * Every trace function calls this, which ensures atrace_init is run. - */ -#define ATRACE_GET_ENABLED_TAGS() atrace_get_enabled_tags() -static inline uint64_t atrace_get_enabled_tags() -{ - atrace_init(); - return atrace_enabled_tags; -} - -/** - * Test if a given tag is currently enabled. - * Returns nonzero if the tag is enabled, otherwise zero. - * It can be used as a guard condition around more expensive trace calculations. - */ -#define ATRACE_ENABLED() atrace_is_tag_enabled(ATRACE_TAG) -static inline uint64_t atrace_is_tag_enabled(uint64_t tag) -{ - return atrace_get_enabled_tags() & tag; -} - -/** - * Trace the beginning of a context. name is used to identify the context. - * This is often used to time function execution. - */ -#define ATRACE_BEGIN(name) atrace_begin(ATRACE_TAG, name) -static inline void atrace_begin(uint64_t tag, const char* name) -{ - if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { - char buf[ATRACE_MESSAGE_LENGTH]; - size_t len; - - len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "B|%d|%s", getpid(), name); - write(atrace_marker_fd, buf, len); - } -} - -/** - * Trace the end of a context. - * This should match up (and occur after) a corresponding ATRACE_BEGIN. - */ -#define ATRACE_END() atrace_end(ATRACE_TAG) -static inline void atrace_end(uint64_t tag) -{ - if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { - char c = 'E'; - write(atrace_marker_fd, &c, 1); - } -} - -/** - * Trace the beginning of an asynchronous event. Unlike ATRACE_BEGIN/ATRACE_END - * contexts, asynchronous events do not need to be nested. The name describes - * the event, and the cookie provides a unique identifier for distinguishing - * simultaneous events. The name and cookie used to begin an event must be - * used to end it. - */ -#define ATRACE_ASYNC_BEGIN(name, cookie) \ - atrace_async_begin(ATRACE_TAG, name, cookie) -static inline void atrace_async_begin(uint64_t tag, const char* name, - int32_t cookie) -{ - if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { - char buf[ATRACE_MESSAGE_LENGTH]; - size_t len; - - len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "S|%d|%s|%d", getpid(), - name, cookie); - write(atrace_marker_fd, buf, len); - } -} - -/** - * Trace the end of an asynchronous event. - * This should have a corresponding ATRACE_ASYNC_BEGIN. - */ -#define ATRACE_ASYNC_END(name, cookie) atrace_async_end(ATRACE_TAG, name, cookie) -static inline void atrace_async_end(uint64_t tag, const char* name, - int32_t cookie) -{ - if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { - char buf[ATRACE_MESSAGE_LENGTH]; - size_t len; - - len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "F|%d|%s|%d", getpid(), - name, cookie); - write(atrace_marker_fd, buf, len); - } -} - - -/** - * Traces an integer counter value. name is used to identify the counter. - * This can be used to track how a value changes over time. - */ -#define ATRACE_INT(name, value) atrace_int(ATRACE_TAG, name, value) -static inline void atrace_int(uint64_t tag, const char* name, int32_t value) -{ - if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { - char buf[ATRACE_MESSAGE_LENGTH]; - size_t len; - - len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "C|%d|%s|%d", - getpid(), name, value); - write(atrace_marker_fd, buf, len); - } -} - -#else // not HAVE_ANDROID_OS - -#define ATRACE_INIT() -#define ATRACE_GET_ENABLED_TAGS() -#define ATRACE_ENABLED() -#define ATRACE_BEGIN(name) -#define ATRACE_END() -#define ATRACE_ASYNC_BEGIN(name, cookie) -#define ATRACE_ASYNC_END(name, cookie) -#define ATRACE_INT(name, value) - -#endif // not HAVE_ANDROID_OS - -__END_DECLS - -#endif // _LIBS_CUTILS_TRACE_H diff --git a/external/android/include/18/system/core/include/cutils/tztime.h b/external/android/include/18/system/core/include/cutils/tztime.h deleted file mode 100644 index dbdbd60..0000000 --- a/external/android/include/18/system/core/include/cutils/tztime.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2006 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 _CUTILS_TZTIME_H -#define _CUTILS_TZTIME_H - -// TODO: fix both callers to just include themselves. -#include - -#endif /* __CUTILS_TZTIME_H */ - diff --git a/external/android/include/18/system/core/include/cutils/uevent.h b/external/android/include/18/system/core/include/cutils/uevent.h deleted file mode 100644 index 4cca7e5..0000000 --- a/external/android/include/18/system/core/include/cutils/uevent.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2011 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 __CUTILS_UEVENT_H -#define __CUTILS_UEVENT_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -int uevent_open_socket(int buf_sz, bool passcred); -ssize_t uevent_kernel_multicast_recv(int socket, void *buffer, size_t length); -ssize_t uevent_kernel_multicast_uid_recv(int socket, void *buffer, size_t length, uid_t *uid); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_UEVENT_H */ diff --git a/external/android/include/18/system/core/include/cutils/uio.h b/external/android/include/18/system/core/include/cutils/uio.h deleted file mode 100644 index 01a74d2..0000000 --- a/external/android/include/18/system/core/include/cutils/uio.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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. - */ - -// -// implementation of sys/uio.h for platforms that don't have it (Win32) -// -#ifndef _LIBS_CUTILS_UIO_H -#define _LIBS_CUTILS_UIO_H - -#ifdef HAVE_SYS_UIO_H -#include -#else - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -struct iovec { - const void* iov_base; - size_t iov_len; -}; - -extern int readv( int fd, struct iovec* vecs, int count ); -extern int writev( int fd, const struct iovec* vecs, int count ); - -#ifdef __cplusplus -} -#endif - -#endif /* !HAVE_SYS_UIO_H */ - -#endif /* _LIBS_UTILS_UIO_H */ - diff --git a/external/android/include/18/system/core/include/cutils/zygote.h b/external/android/include/18/system/core/include/cutils/zygote.h deleted file mode 100644 index a7480d3..0000000 --- a/external/android/include/18/system/core/include/cutils/zygote.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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 __CUTILS_ZYGOTE_H -#define __CUTILS_ZYGOTE_H - -#ifdef __cplusplus -extern "C" { -#endif - -int zygote_run_oneshot(int sendStdio, int argc, const char **argv); -int zygote_run(int argc, const char **argv); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_ZYGOTE_H */ diff --git a/external/android/include/18/system/core/include/sync/sw_sync.h b/external/android/include/18/system/core/include/sync/sw_sync.h deleted file mode 100644 index 3bf4110..0000000 --- a/external/android/include/18/system/core/include/sync/sw_sync.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * sw_sync.h - * - * Copyright 2013 Google, Inc - * - * 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 __SYS_CORE_SW_SYNC_H -#define __SYS_CORE_SW_SYNC_H - -#include "sync.h" - -__BEGIN_DECLS - -/* - * sw_sync is mainly intended for testing and should not be compiled into - * production kernels - */ - -int sw_sync_timeline_create(void); -int sw_sync_timeline_inc(int fd, unsigned count); -int sw_sync_fence_create(int fd, const char *name, unsigned value); - -__END_DECLS - -#endif /* __SYS_CORE_SW_SYNC_H */ diff --git a/external/android/include/18/system/core/include/sync/sync.h b/external/android/include/18/system/core/include/sync/sync.h deleted file mode 100644 index 2e5d82f..0000000 --- a/external/android/include/18/system/core/include/sync/sync.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * sync.h - * - * Copyright 2012 Google, Inc - * - * 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 __SYS_CORE_SYNC_H -#define __SYS_CORE_SYNC_H - -#include -#include - -__BEGIN_DECLS - -// XXX: These structs are copied from the header "linux/sync.h". -struct sync_fence_info_data { - uint32_t len; - char name[32]; - int32_t status; - uint8_t pt_info[0]; -}; - -struct sync_pt_info { - uint32_t len; - char obj_name[32]; - char driver_name[32]; - int32_t status; - uint64_t timestamp_ns; - uint8_t driver_data[0]; -}; - -/* timeout in msecs */ -int sync_wait(int fd, int timeout); -int sync_merge(const char *name, int fd1, int fd2); -struct sync_fence_info_data *sync_fence_info(int fd); -struct sync_pt_info *sync_pt_info(struct sync_fence_info_data *info, - struct sync_pt_info *itr); -void sync_fence_info_free(struct sync_fence_info_data *info); - -__END_DECLS - -#endif /* __SYS_CORE_SYNC_H */ diff --git a/external/android/include/18/system/core/include/system/audio.h b/external/android/include/18/system/core/include/system/audio.h deleted file mode 100644 index da235dd..0000000 --- a/external/android/include/18/system/core/include/system/audio.h +++ /dev/null @@ -1,558 +0,0 @@ -/* - * Copyright (C) 2011 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_AUDIO_CORE_H -#define ANDROID_AUDIO_CORE_H - -#include -#include -#include -#include - -#include - -__BEGIN_DECLS - -/* The enums were moved here mostly from - * frameworks/base/include/media/AudioSystem.h - */ - -typedef int audio_io_handle_t; - -/* Audio stream types */ -typedef enum { - AUDIO_STREAM_DEFAULT = -1, - AUDIO_STREAM_VOICE_CALL = 0, - AUDIO_STREAM_SYSTEM = 1, - AUDIO_STREAM_RING = 2, - AUDIO_STREAM_MUSIC = 3, - AUDIO_STREAM_ALARM = 4, - AUDIO_STREAM_NOTIFICATION = 5, - AUDIO_STREAM_BLUETOOTH_SCO = 6, - AUDIO_STREAM_ENFORCED_AUDIBLE = 7, /* Sounds that cannot be muted by user and must be routed to speaker */ - AUDIO_STREAM_DTMF = 8, - AUDIO_STREAM_TTS = 9, - - AUDIO_STREAM_CNT, - AUDIO_STREAM_MAX = AUDIO_STREAM_CNT - 1, -} audio_stream_type_t; - -/* Do not change these values without updating their counterparts - * in media/java/android/media/MediaRecorder.java! - */ -typedef enum { - AUDIO_SOURCE_DEFAULT = 0, - AUDIO_SOURCE_MIC = 1, - AUDIO_SOURCE_VOICE_UPLINK = 2, - AUDIO_SOURCE_VOICE_DOWNLINK = 3, - AUDIO_SOURCE_VOICE_CALL = 4, - AUDIO_SOURCE_CAMCORDER = 5, - AUDIO_SOURCE_VOICE_RECOGNITION = 6, - AUDIO_SOURCE_VOICE_COMMUNICATION = 7, - AUDIO_SOURCE_REMOTE_SUBMIX = 8, /* Source for the mix to be presented remotely. */ - /* An example of remote presentation is Wifi Display */ - /* where a dongle attached to a TV can be used to */ - /* play the mix captured by this audio source. */ - AUDIO_SOURCE_CNT, - AUDIO_SOURCE_MAX = AUDIO_SOURCE_CNT - 1, -} audio_source_t; - -/* special audio session values - * (XXX: should this be living in the audio effects land?) - */ -typedef enum { - /* session for effects attached to a particular output stream - * (value must be less than 0) - */ - AUDIO_SESSION_OUTPUT_STAGE = -1, - - /* session for effects applied to output mix. These effects can - * be moved by audio policy manager to another output stream - * (value must be 0) - */ - AUDIO_SESSION_OUTPUT_MIX = 0, -} audio_session_t; - -/* Audio sub formats (see enum audio_format). */ - -/* PCM sub formats */ -typedef enum { - AUDIO_FORMAT_PCM_SUB_16_BIT = 0x1, /* DO NOT CHANGE - PCM signed 16 bits */ - AUDIO_FORMAT_PCM_SUB_8_BIT = 0x2, /* DO NOT CHANGE - PCM unsigned 8 bits */ - AUDIO_FORMAT_PCM_SUB_32_BIT = 0x3, /* PCM signed .31 fixed point */ - AUDIO_FORMAT_PCM_SUB_8_24_BIT = 0x4, /* PCM signed 7.24 fixed point */ -} audio_format_pcm_sub_fmt_t; - -/* MP3 sub format field definition : can use 11 LSBs in the same way as MP3 - * frame header to specify bit rate, stereo mode, version... - */ -typedef enum { - AUDIO_FORMAT_MP3_SUB_NONE = 0x0, -} audio_format_mp3_sub_fmt_t; - -/* AMR NB/WB sub format field definition: specify frame block interleaving, - * bandwidth efficient or octet aligned, encoding mode for recording... - */ -typedef enum { - AUDIO_FORMAT_AMR_SUB_NONE = 0x0, -} audio_format_amr_sub_fmt_t; - -/* AAC sub format field definition: specify profile or bitrate for recording... */ -typedef enum { - AUDIO_FORMAT_AAC_SUB_NONE = 0x0, -} audio_format_aac_sub_fmt_t; - -/* VORBIS sub format field definition: specify quality for recording... */ -typedef enum { - AUDIO_FORMAT_VORBIS_SUB_NONE = 0x0, -} audio_format_vorbis_sub_fmt_t; - -/* Audio format consists in a main format field (upper 8 bits) and a sub format - * field (lower 24 bits). - * - * The main format indicates the main codec type. The sub format field - * indicates options and parameters for each format. The sub format is mainly - * used for record to indicate for instance the requested bitrate or profile. - * It can also be used for certain formats to give informations not present in - * the encoded audio stream (e.g. octet alignement for AMR). - */ -typedef enum { - AUDIO_FORMAT_INVALID = 0xFFFFFFFFUL, - AUDIO_FORMAT_DEFAULT = 0, - AUDIO_FORMAT_PCM = 0x00000000UL, /* DO NOT CHANGE */ - AUDIO_FORMAT_MP3 = 0x01000000UL, - AUDIO_FORMAT_AMR_NB = 0x02000000UL, - AUDIO_FORMAT_AMR_WB = 0x03000000UL, - AUDIO_FORMAT_AAC = 0x04000000UL, - AUDIO_FORMAT_HE_AAC_V1 = 0x05000000UL, - AUDIO_FORMAT_HE_AAC_V2 = 0x06000000UL, - AUDIO_FORMAT_VORBIS = 0x07000000UL, - AUDIO_FORMAT_MAIN_MASK = 0xFF000000UL, - AUDIO_FORMAT_SUB_MASK = 0x00FFFFFFUL, - - /* Aliases */ - AUDIO_FORMAT_PCM_16_BIT = (AUDIO_FORMAT_PCM | - AUDIO_FORMAT_PCM_SUB_16_BIT), - AUDIO_FORMAT_PCM_8_BIT = (AUDIO_FORMAT_PCM | - AUDIO_FORMAT_PCM_SUB_8_BIT), - AUDIO_FORMAT_PCM_32_BIT = (AUDIO_FORMAT_PCM | - AUDIO_FORMAT_PCM_SUB_32_BIT), - AUDIO_FORMAT_PCM_8_24_BIT = (AUDIO_FORMAT_PCM | - AUDIO_FORMAT_PCM_SUB_8_24_BIT), -} audio_format_t; - -enum { - /* output channels */ - AUDIO_CHANNEL_OUT_FRONT_LEFT = 0x1, - AUDIO_CHANNEL_OUT_FRONT_RIGHT = 0x2, - AUDIO_CHANNEL_OUT_FRONT_CENTER = 0x4, - AUDIO_CHANNEL_OUT_LOW_FREQUENCY = 0x8, - AUDIO_CHANNEL_OUT_BACK_LEFT = 0x10, - AUDIO_CHANNEL_OUT_BACK_RIGHT = 0x20, - AUDIO_CHANNEL_OUT_FRONT_LEFT_OF_CENTER = 0x40, - AUDIO_CHANNEL_OUT_FRONT_RIGHT_OF_CENTER = 0x80, - AUDIO_CHANNEL_OUT_BACK_CENTER = 0x100, - AUDIO_CHANNEL_OUT_SIDE_LEFT = 0x200, - AUDIO_CHANNEL_OUT_SIDE_RIGHT = 0x400, - AUDIO_CHANNEL_OUT_TOP_CENTER = 0x800, - AUDIO_CHANNEL_OUT_TOP_FRONT_LEFT = 0x1000, - AUDIO_CHANNEL_OUT_TOP_FRONT_CENTER = 0x2000, - AUDIO_CHANNEL_OUT_TOP_FRONT_RIGHT = 0x4000, - AUDIO_CHANNEL_OUT_TOP_BACK_LEFT = 0x8000, - AUDIO_CHANNEL_OUT_TOP_BACK_CENTER = 0x10000, - AUDIO_CHANNEL_OUT_TOP_BACK_RIGHT = 0x20000, - - AUDIO_CHANNEL_OUT_MONO = AUDIO_CHANNEL_OUT_FRONT_LEFT, - AUDIO_CHANNEL_OUT_STEREO = (AUDIO_CHANNEL_OUT_FRONT_LEFT | - AUDIO_CHANNEL_OUT_FRONT_RIGHT), - AUDIO_CHANNEL_OUT_QUAD = (AUDIO_CHANNEL_OUT_FRONT_LEFT | - AUDIO_CHANNEL_OUT_FRONT_RIGHT | - AUDIO_CHANNEL_OUT_BACK_LEFT | - AUDIO_CHANNEL_OUT_BACK_RIGHT), - AUDIO_CHANNEL_OUT_SURROUND = (AUDIO_CHANNEL_OUT_FRONT_LEFT | - AUDIO_CHANNEL_OUT_FRONT_RIGHT | - AUDIO_CHANNEL_OUT_FRONT_CENTER | - AUDIO_CHANNEL_OUT_BACK_CENTER), - AUDIO_CHANNEL_OUT_5POINT1 = (AUDIO_CHANNEL_OUT_FRONT_LEFT | - AUDIO_CHANNEL_OUT_FRONT_RIGHT | - AUDIO_CHANNEL_OUT_FRONT_CENTER | - AUDIO_CHANNEL_OUT_LOW_FREQUENCY | - AUDIO_CHANNEL_OUT_BACK_LEFT | - AUDIO_CHANNEL_OUT_BACK_RIGHT), - // matches the correct AudioFormat.CHANNEL_OUT_7POINT1_SURROUND definition for 7.1 - AUDIO_CHANNEL_OUT_7POINT1 = (AUDIO_CHANNEL_OUT_FRONT_LEFT | - AUDIO_CHANNEL_OUT_FRONT_RIGHT | - AUDIO_CHANNEL_OUT_FRONT_CENTER | - AUDIO_CHANNEL_OUT_LOW_FREQUENCY | - AUDIO_CHANNEL_OUT_BACK_LEFT | - AUDIO_CHANNEL_OUT_BACK_RIGHT | - AUDIO_CHANNEL_OUT_SIDE_LEFT | - AUDIO_CHANNEL_OUT_SIDE_RIGHT), - AUDIO_CHANNEL_OUT_ALL = (AUDIO_CHANNEL_OUT_FRONT_LEFT | - AUDIO_CHANNEL_OUT_FRONT_RIGHT | - AUDIO_CHANNEL_OUT_FRONT_CENTER | - AUDIO_CHANNEL_OUT_LOW_FREQUENCY | - AUDIO_CHANNEL_OUT_BACK_LEFT | - AUDIO_CHANNEL_OUT_BACK_RIGHT | - AUDIO_CHANNEL_OUT_FRONT_LEFT_OF_CENTER | - AUDIO_CHANNEL_OUT_FRONT_RIGHT_OF_CENTER | - AUDIO_CHANNEL_OUT_BACK_CENTER| - AUDIO_CHANNEL_OUT_SIDE_LEFT| - AUDIO_CHANNEL_OUT_SIDE_RIGHT| - AUDIO_CHANNEL_OUT_TOP_CENTER| - AUDIO_CHANNEL_OUT_TOP_FRONT_LEFT| - AUDIO_CHANNEL_OUT_TOP_FRONT_CENTER| - AUDIO_CHANNEL_OUT_TOP_FRONT_RIGHT| - AUDIO_CHANNEL_OUT_TOP_BACK_LEFT| - AUDIO_CHANNEL_OUT_TOP_BACK_CENTER| - AUDIO_CHANNEL_OUT_TOP_BACK_RIGHT), - - /* input channels */ - AUDIO_CHANNEL_IN_LEFT = 0x4, - AUDIO_CHANNEL_IN_RIGHT = 0x8, - AUDIO_CHANNEL_IN_FRONT = 0x10, - AUDIO_CHANNEL_IN_BACK = 0x20, - AUDIO_CHANNEL_IN_LEFT_PROCESSED = 0x40, - AUDIO_CHANNEL_IN_RIGHT_PROCESSED = 0x80, - AUDIO_CHANNEL_IN_FRONT_PROCESSED = 0x100, - AUDIO_CHANNEL_IN_BACK_PROCESSED = 0x200, - AUDIO_CHANNEL_IN_PRESSURE = 0x400, - AUDIO_CHANNEL_IN_X_AXIS = 0x800, - AUDIO_CHANNEL_IN_Y_AXIS = 0x1000, - AUDIO_CHANNEL_IN_Z_AXIS = 0x2000, - AUDIO_CHANNEL_IN_VOICE_UPLINK = 0x4000, - AUDIO_CHANNEL_IN_VOICE_DNLINK = 0x8000, - - AUDIO_CHANNEL_IN_MONO = AUDIO_CHANNEL_IN_FRONT, - AUDIO_CHANNEL_IN_STEREO = (AUDIO_CHANNEL_IN_LEFT | AUDIO_CHANNEL_IN_RIGHT), - AUDIO_CHANNEL_IN_FRONT_BACK = (AUDIO_CHANNEL_IN_FRONT | AUDIO_CHANNEL_IN_BACK), - AUDIO_CHANNEL_IN_ALL = (AUDIO_CHANNEL_IN_LEFT | - AUDIO_CHANNEL_IN_RIGHT | - AUDIO_CHANNEL_IN_FRONT | - AUDIO_CHANNEL_IN_BACK| - AUDIO_CHANNEL_IN_LEFT_PROCESSED | - AUDIO_CHANNEL_IN_RIGHT_PROCESSED | - AUDIO_CHANNEL_IN_FRONT_PROCESSED | - AUDIO_CHANNEL_IN_BACK_PROCESSED| - AUDIO_CHANNEL_IN_PRESSURE | - AUDIO_CHANNEL_IN_X_AXIS | - AUDIO_CHANNEL_IN_Y_AXIS | - AUDIO_CHANNEL_IN_Z_AXIS | - AUDIO_CHANNEL_IN_VOICE_UPLINK | - AUDIO_CHANNEL_IN_VOICE_DNLINK), -}; - -typedef uint32_t audio_channel_mask_t; - -typedef enum { - AUDIO_MODE_INVALID = -2, - AUDIO_MODE_CURRENT = -1, - AUDIO_MODE_NORMAL = 0, - AUDIO_MODE_RINGTONE = 1, - AUDIO_MODE_IN_CALL = 2, - AUDIO_MODE_IN_COMMUNICATION = 3, - - AUDIO_MODE_CNT, - AUDIO_MODE_MAX = AUDIO_MODE_CNT - 1, -} audio_mode_t; - -typedef enum { - AUDIO_IN_ACOUSTICS_AGC_ENABLE = 0x0001, - AUDIO_IN_ACOUSTICS_AGC_DISABLE = 0, - AUDIO_IN_ACOUSTICS_NS_ENABLE = 0x0002, - AUDIO_IN_ACOUSTICS_NS_DISABLE = 0, - AUDIO_IN_ACOUSTICS_TX_IIR_ENABLE = 0x0004, - AUDIO_IN_ACOUSTICS_TX_DISABLE = 0, -} audio_in_acoustics_t; - -enum { - AUDIO_DEVICE_NONE = 0x0, - /* reserved bits */ - AUDIO_DEVICE_BIT_IN = 0x80000000, - AUDIO_DEVICE_BIT_DEFAULT = 0x40000000, - /* output devices */ - AUDIO_DEVICE_OUT_EARPIECE = 0x1, - AUDIO_DEVICE_OUT_SPEAKER = 0x2, - AUDIO_DEVICE_OUT_WIRED_HEADSET = 0x4, - AUDIO_DEVICE_OUT_WIRED_HEADPHONE = 0x8, - AUDIO_DEVICE_OUT_BLUETOOTH_SCO = 0x10, - AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET = 0x20, - AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT = 0x40, - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP = 0x80, - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES = 0x100, - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER = 0x200, - AUDIO_DEVICE_OUT_AUX_DIGITAL = 0x400, - AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET = 0x800, - AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET = 0x1000, - AUDIO_DEVICE_OUT_USB_ACCESSORY = 0x2000, - AUDIO_DEVICE_OUT_USB_DEVICE = 0x4000, - AUDIO_DEVICE_OUT_REMOTE_SUBMIX = 0x8000, - AUDIO_DEVICE_OUT_DEFAULT = AUDIO_DEVICE_BIT_DEFAULT, - AUDIO_DEVICE_OUT_ALL = (AUDIO_DEVICE_OUT_EARPIECE | - AUDIO_DEVICE_OUT_SPEAKER | - AUDIO_DEVICE_OUT_WIRED_HEADSET | - AUDIO_DEVICE_OUT_WIRED_HEADPHONE | - AUDIO_DEVICE_OUT_BLUETOOTH_SCO | - AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET | - AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT | - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP | - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES | - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER | - AUDIO_DEVICE_OUT_AUX_DIGITAL | - AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET | - AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET | - AUDIO_DEVICE_OUT_USB_ACCESSORY | - AUDIO_DEVICE_OUT_USB_DEVICE | - AUDIO_DEVICE_OUT_REMOTE_SUBMIX | - AUDIO_DEVICE_OUT_DEFAULT), - AUDIO_DEVICE_OUT_ALL_A2DP = (AUDIO_DEVICE_OUT_BLUETOOTH_A2DP | - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES | - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER), - AUDIO_DEVICE_OUT_ALL_SCO = (AUDIO_DEVICE_OUT_BLUETOOTH_SCO | - AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET | - AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT), - AUDIO_DEVICE_OUT_ALL_USB = (AUDIO_DEVICE_OUT_USB_ACCESSORY | - AUDIO_DEVICE_OUT_USB_DEVICE), - - /* input devices */ - AUDIO_DEVICE_IN_COMMUNICATION = AUDIO_DEVICE_BIT_IN | 0x1, - AUDIO_DEVICE_IN_AMBIENT = AUDIO_DEVICE_BIT_IN | 0x2, - AUDIO_DEVICE_IN_BUILTIN_MIC = AUDIO_DEVICE_BIT_IN | 0x4, - AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET = AUDIO_DEVICE_BIT_IN | 0x8, - AUDIO_DEVICE_IN_WIRED_HEADSET = AUDIO_DEVICE_BIT_IN | 0x10, - AUDIO_DEVICE_IN_AUX_DIGITAL = AUDIO_DEVICE_BIT_IN | 0x20, - AUDIO_DEVICE_IN_VOICE_CALL = AUDIO_DEVICE_BIT_IN | 0x40, - AUDIO_DEVICE_IN_BACK_MIC = AUDIO_DEVICE_BIT_IN | 0x80, - AUDIO_DEVICE_IN_REMOTE_SUBMIX = AUDIO_DEVICE_BIT_IN | 0x100, - AUDIO_DEVICE_IN_ANLG_DOCK_HEADSET = AUDIO_DEVICE_BIT_IN | 0x200, - AUDIO_DEVICE_IN_DGTL_DOCK_HEADSET = AUDIO_DEVICE_BIT_IN | 0x400, - AUDIO_DEVICE_IN_USB_ACCESSORY = AUDIO_DEVICE_BIT_IN | 0x800, - AUDIO_DEVICE_IN_USB_DEVICE = AUDIO_DEVICE_BIT_IN | 0x1000, - AUDIO_DEVICE_IN_DEFAULT = AUDIO_DEVICE_BIT_IN | AUDIO_DEVICE_BIT_DEFAULT, - - AUDIO_DEVICE_IN_ALL = (AUDIO_DEVICE_IN_COMMUNICATION | - AUDIO_DEVICE_IN_AMBIENT | - AUDIO_DEVICE_IN_BUILTIN_MIC | - AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET | - AUDIO_DEVICE_IN_WIRED_HEADSET | - AUDIO_DEVICE_IN_AUX_DIGITAL | - AUDIO_DEVICE_IN_VOICE_CALL | - AUDIO_DEVICE_IN_BACK_MIC | - AUDIO_DEVICE_IN_REMOTE_SUBMIX | - AUDIO_DEVICE_IN_ANLG_DOCK_HEADSET | - AUDIO_DEVICE_IN_DGTL_DOCK_HEADSET | - AUDIO_DEVICE_IN_USB_ACCESSORY | - AUDIO_DEVICE_IN_USB_DEVICE | - AUDIO_DEVICE_IN_DEFAULT), - AUDIO_DEVICE_IN_ALL_SCO = AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET, -}; - -typedef uint32_t audio_devices_t; - -/* the audio output flags serve two purposes: - * - when an AudioTrack is created they indicate a "wish" to be connected to an - * output stream with attributes corresponding to the specified flags - * - when present in an output profile descriptor listed for a particular audio - * hardware module, they indicate that an output stream can be opened that - * supports the attributes indicated by the flags. - * the audio policy manager will try to match the flags in the request - * (when getOuput() is called) to an available output stream. - */ -typedef enum { - AUDIO_OUTPUT_FLAG_NONE = 0x0, // no attributes - AUDIO_OUTPUT_FLAG_DIRECT = 0x1, // this output directly connects a track - // to one output stream: no software mixer - AUDIO_OUTPUT_FLAG_PRIMARY = 0x2, // this output is the primary output of - // the device. It is unique and must be - // present. It is opened by default and - // receives routing, audio mode and volume - // controls related to voice calls. - AUDIO_OUTPUT_FLAG_FAST = 0x4, // output supports "fast tracks", - // defined elsewhere - AUDIO_OUTPUT_FLAG_DEEP_BUFFER = 0x8 // use deep audio buffers -} audio_output_flags_t; - -static inline bool audio_is_output_device(audio_devices_t device) -{ - if (((device & AUDIO_DEVICE_BIT_IN) == 0) && - (popcount(device) == 1) && ((device & ~AUDIO_DEVICE_OUT_ALL) == 0)) - return true; - else - return false; -} - -static inline bool audio_is_input_device(audio_devices_t device) -{ - if ((device & AUDIO_DEVICE_BIT_IN) != 0) { - device &= ~AUDIO_DEVICE_BIT_IN; - if ((popcount(device) == 1) && ((device & ~AUDIO_DEVICE_IN_ALL) == 0)) - return true; - } - return false; -} - -static inline bool audio_is_output_devices(audio_devices_t device) -{ - return (device & AUDIO_DEVICE_BIT_IN) == 0; -} - - -static inline bool audio_is_a2dp_device(audio_devices_t device) -{ - if ((popcount(device) == 1) && (device & AUDIO_DEVICE_OUT_ALL_A2DP)) - return true; - else - return false; -} - -static inline bool audio_is_bluetooth_sco_device(audio_devices_t device) -{ - device &= ~AUDIO_DEVICE_BIT_IN; - if ((popcount(device) == 1) && (device & (AUDIO_DEVICE_OUT_ALL_SCO | - AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET))) - return true; - else - return false; -} - -static inline bool audio_is_usb_device(audio_devices_t device) -{ - if ((popcount(device) == 1) && (device & AUDIO_DEVICE_OUT_ALL_USB)) - return true; - else - return false; -} - -static inline bool audio_is_remote_submix_device(audio_devices_t device) -{ - if ((popcount(device) == 1) && (device & AUDIO_DEVICE_OUT_REMOTE_SUBMIX)) - return true; - else - return false; -} - -static inline bool audio_is_input_channel(uint32_t channel) -{ - if ((channel & ~AUDIO_CHANNEL_IN_ALL) == 0) - return true; - else - return false; -} - -static inline bool audio_is_output_channel(uint32_t channel) -{ - if ((channel & ~AUDIO_CHANNEL_OUT_ALL) == 0) - return true; - else - return false; -} - -/* Derive an output channel mask from a channel count. - * This is to be used when the content channel mask is unknown. The 1, 2, 4, 5, 6, 7 and 8 channel - * cases are mapped to the standard game/home-theater layouts, but note that 4 is mapped to quad, - * and not stereo + FC + mono surround. A channel count of 3 is arbitrarily mapped to stereo + FC - * for continuity with stereo. - * Returns the matching channel mask, or 0 if the number of channels exceeds that of the - * configurations for which a default channel mask is defined. - */ -static inline audio_channel_mask_t audio_channel_out_mask_from_count(uint32_t channel_count) -{ - switch(channel_count) { - case 1: - return AUDIO_CHANNEL_OUT_MONO; - case 2: - return AUDIO_CHANNEL_OUT_STEREO; - case 3: - return (AUDIO_CHANNEL_OUT_STEREO | AUDIO_CHANNEL_OUT_FRONT_CENTER); - case 4: // 4.0 - return AUDIO_CHANNEL_OUT_QUAD; - case 5: // 5.0 - return (AUDIO_CHANNEL_OUT_QUAD | AUDIO_CHANNEL_OUT_FRONT_CENTER); - case 6: // 5.1 - return AUDIO_CHANNEL_OUT_5POINT1; - case 7: // 6.1 - return (AUDIO_CHANNEL_OUT_5POINT1 | AUDIO_CHANNEL_OUT_BACK_CENTER); - case 8: - return AUDIO_CHANNEL_OUT_7POINT1; - default: - return 0; - } -} - -/* Similar to above, but for input. Currently handles only mono and stereo. */ -static inline audio_channel_mask_t audio_channel_in_mask_from_count(uint32_t channel_count) -{ - switch (channel_count) { - case 1: - return AUDIO_CHANNEL_IN_MONO; - case 2: - return AUDIO_CHANNEL_IN_STEREO; - default: - return 0; - } -} - -static inline bool audio_is_valid_format(audio_format_t format) -{ - switch (format & AUDIO_FORMAT_MAIN_MASK) { - case AUDIO_FORMAT_PCM: - if (format != AUDIO_FORMAT_PCM_16_BIT && - format != AUDIO_FORMAT_PCM_8_BIT) { - return false; - } - case AUDIO_FORMAT_MP3: - case AUDIO_FORMAT_AMR_NB: - case AUDIO_FORMAT_AMR_WB: - case AUDIO_FORMAT_AAC: - case AUDIO_FORMAT_HE_AAC_V1: - case AUDIO_FORMAT_HE_AAC_V2: - case AUDIO_FORMAT_VORBIS: - return true; - default: - return false; - } -} - -static inline bool audio_is_linear_pcm(audio_format_t format) -{ - return ((format & AUDIO_FORMAT_MAIN_MASK) == AUDIO_FORMAT_PCM); -} - -static inline size_t audio_bytes_per_sample(audio_format_t format) -{ - size_t size = 0; - - switch (format) { - case AUDIO_FORMAT_PCM_32_BIT: - case AUDIO_FORMAT_PCM_8_24_BIT: - size = sizeof(int32_t); - break; - case AUDIO_FORMAT_PCM_16_BIT: - size = sizeof(int16_t); - break; - case AUDIO_FORMAT_PCM_8_BIT: - size = sizeof(uint8_t); - break; - default: - break; - } - return size; -} - -__END_DECLS - -#endif // ANDROID_AUDIO_CORE_H diff --git a/external/android/include/18/system/core/include/system/audio_policy.h b/external/android/include/18/system/core/include/system/audio_policy.h deleted file mode 100644 index a6554de..0000000 --- a/external/android/include/18/system/core/include/system/audio_policy.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2011 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_AUDIO_POLICY_CORE_H -#define ANDROID_AUDIO_POLICY_CORE_H - -#include -#include -#include - -#include - -__BEGIN_DECLS - -/* The enums were moved here mostly from - * frameworks/base/include/media/AudioSystem.h - */ - -/* device categories used for audio_policy->set_force_use() */ -typedef enum { - AUDIO_POLICY_FORCE_NONE, - AUDIO_POLICY_FORCE_SPEAKER, - AUDIO_POLICY_FORCE_HEADPHONES, - AUDIO_POLICY_FORCE_BT_SCO, - AUDIO_POLICY_FORCE_BT_A2DP, - AUDIO_POLICY_FORCE_WIRED_ACCESSORY, - AUDIO_POLICY_FORCE_BT_CAR_DOCK, - AUDIO_POLICY_FORCE_BT_DESK_DOCK, - AUDIO_POLICY_FORCE_ANALOG_DOCK, - AUDIO_POLICY_FORCE_DIGITAL_DOCK, - AUDIO_POLICY_FORCE_NO_BT_A2DP, /* A2DP sink is not preferred to speaker or wired HS */ - AUDIO_POLICY_FORCE_SYSTEM_ENFORCED, - - AUDIO_POLICY_FORCE_CFG_CNT, - AUDIO_POLICY_FORCE_CFG_MAX = AUDIO_POLICY_FORCE_CFG_CNT - 1, - - AUDIO_POLICY_FORCE_DEFAULT = AUDIO_POLICY_FORCE_NONE, -} audio_policy_forced_cfg_t; - -/* usages used for audio_policy->set_force_use() */ -typedef enum { - AUDIO_POLICY_FORCE_FOR_COMMUNICATION, - AUDIO_POLICY_FORCE_FOR_MEDIA, - AUDIO_POLICY_FORCE_FOR_RECORD, - AUDIO_POLICY_FORCE_FOR_DOCK, - AUDIO_POLICY_FORCE_FOR_SYSTEM, - - AUDIO_POLICY_FORCE_USE_CNT, - AUDIO_POLICY_FORCE_USE_MAX = AUDIO_POLICY_FORCE_USE_CNT - 1, -} audio_policy_force_use_t; - -/* device connection states used for audio_policy->set_device_connection_state() - */ -typedef enum { - AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE, - AUDIO_POLICY_DEVICE_STATE_AVAILABLE, - - AUDIO_POLICY_DEVICE_STATE_CNT, - AUDIO_POLICY_DEVICE_STATE_MAX = AUDIO_POLICY_DEVICE_STATE_CNT - 1, -} audio_policy_dev_state_t; - -typedef enum { - /* Used to generate a tone to notify the user of a - * notification/alarm/ringtone while they are in a call. */ - AUDIO_POLICY_TONE_IN_CALL_NOTIFICATION = 0, - - AUDIO_POLICY_TONE_CNT, - AUDIO_POLICY_TONE_MAX = AUDIO_POLICY_TONE_CNT - 1, -} audio_policy_tone_t; - - -static inline bool audio_is_low_visibility(audio_stream_type_t stream) -{ - switch (stream) { - case AUDIO_STREAM_SYSTEM: - case AUDIO_STREAM_NOTIFICATION: - case AUDIO_STREAM_RING: - return true; - default: - return false; - } -} - - -__END_DECLS - -#endif // ANDROID_AUDIO_POLICY_CORE_H diff --git a/external/android/include/18/system/core/include/system/camera.h b/external/android/include/18/system/core/include/system/camera.h deleted file mode 100644 index 7a4dd53..0000000 --- a/external/android/include/18/system/core/include/system/camera.h +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Copyright (C) 2011 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 SYSTEM_CORE_INCLUDE_ANDROID_CAMERA_H -#define SYSTEM_CORE_INCLUDE_ANDROID_CAMERA_H - -#include -#include -#include -#include -#include -#include - -__BEGIN_DECLS - -/** - * A set of bit masks for specifying how the received preview frames are - * handled before the previewCallback() call. - * - * The least significant 3 bits of an "int" value are used for this purpose: - * - * ..... 0 0 0 - * ^ ^ ^ - * | | |---------> determine whether the callback is enabled or not - * | |-----------> determine whether the callback is one-shot or not - * |-------------> determine whether the frame is copied out or not - * - * WARNING: When a frame is sent directly without copying, it is the frame - * receiver's responsiblity to make sure that the frame data won't get - * corrupted by subsequent preview frames filled by the camera. This flag is - * recommended only when copying out data brings significant performance price - * and the handling/processing of the received frame data is always faster than - * the preview frame rate so that data corruption won't occur. - * - * For instance, - * 1. 0x00 disables the callback. In this case, copy out and one shot bits - * are ignored. - * 2. 0x01 enables a callback without copying out the received frames. A - * typical use case is the Camcorder application to avoid making costly - * frame copies. - * 3. 0x05 is enabling a callback with frame copied out repeatedly. A typical - * use case is the Camera application. - * 4. 0x07 is enabling a callback with frame copied out only once. A typical - * use case is the Barcode scanner application. - */ - -enum { - CAMERA_FRAME_CALLBACK_FLAG_ENABLE_MASK = 0x01, - CAMERA_FRAME_CALLBACK_FLAG_ONE_SHOT_MASK = 0x02, - CAMERA_FRAME_CALLBACK_FLAG_COPY_OUT_MASK = 0x04, - /** Typical use cases */ - CAMERA_FRAME_CALLBACK_FLAG_NOOP = 0x00, - CAMERA_FRAME_CALLBACK_FLAG_CAMCORDER = 0x01, - CAMERA_FRAME_CALLBACK_FLAG_CAMERA = 0x05, - CAMERA_FRAME_CALLBACK_FLAG_BARCODE_SCANNER = 0x07 -}; - -/** msgType in notifyCallback and dataCallback functions */ -enum { - CAMERA_MSG_ERROR = 0x0001, // notifyCallback - CAMERA_MSG_SHUTTER = 0x0002, // notifyCallback - CAMERA_MSG_FOCUS = 0x0004, // notifyCallback - CAMERA_MSG_ZOOM = 0x0008, // notifyCallback - CAMERA_MSG_PREVIEW_FRAME = 0x0010, // dataCallback - CAMERA_MSG_VIDEO_FRAME = 0x0020, // data_timestamp_callback - CAMERA_MSG_POSTVIEW_FRAME = 0x0040, // dataCallback - CAMERA_MSG_RAW_IMAGE = 0x0080, // dataCallback - CAMERA_MSG_COMPRESSED_IMAGE = 0x0100, // dataCallback - CAMERA_MSG_RAW_IMAGE_NOTIFY = 0x0200, // dataCallback - // Preview frame metadata. This can be combined with - // CAMERA_MSG_PREVIEW_FRAME in dataCallback. For example, the apps can - // request FRAME and METADATA. Or the apps can request only FRAME or only - // METADATA. - CAMERA_MSG_PREVIEW_METADATA = 0x0400, // dataCallback - // Notify on autofocus start and stop. This is useful in continuous - // autofocus - FOCUS_MODE_CONTINUOUS_VIDEO and FOCUS_MODE_CONTINUOUS_PICTURE. - CAMERA_MSG_FOCUS_MOVE = 0x0800, // notifyCallback - CAMERA_MSG_ALL_MSGS = 0xFFFF -}; - -/** cmdType in sendCommand functions */ -enum { - CAMERA_CMD_START_SMOOTH_ZOOM = 1, - CAMERA_CMD_STOP_SMOOTH_ZOOM = 2, - - /** - * Set the clockwise rotation of preview display (setPreviewDisplay) in - * degrees. This affects the preview frames and the picture displayed after - * snapshot. This method is useful for portrait mode applications. Note - * that preview display of front-facing cameras is flipped horizontally - * before the rotation, that is, the image is reflected along the central - * vertical axis of the camera sensor. So the users can see themselves as - * looking into a mirror. - * - * This does not affect the order of byte array of - * CAMERA_MSG_PREVIEW_FRAME, CAMERA_MSG_VIDEO_FRAME, - * CAMERA_MSG_POSTVIEW_FRAME, CAMERA_MSG_RAW_IMAGE, or - * CAMERA_MSG_COMPRESSED_IMAGE. This is allowed to be set during preview - * since API level 14. - */ - CAMERA_CMD_SET_DISPLAY_ORIENTATION = 3, - - /** - * cmdType to disable/enable shutter sound. In sendCommand passing arg1 = - * 0 will disable, while passing arg1 = 1 will enable the shutter sound. - */ - CAMERA_CMD_ENABLE_SHUTTER_SOUND = 4, - - /* cmdType to play recording sound */ - CAMERA_CMD_PLAY_RECORDING_SOUND = 5, - - /** - * Start the face detection. This should be called after preview is started. - * The camera will notify the listener of CAMERA_MSG_FACE and the detected - * faces in the preview frame. The detected faces may be the same as the - * previous ones. Apps should call CAMERA_CMD_STOP_FACE_DETECTION to stop - * the face detection. This method is supported if CameraParameters - * KEY_MAX_NUM_HW_DETECTED_FACES or KEY_MAX_NUM_SW_DETECTED_FACES is - * bigger than 0. Hardware and software face detection should not be running - * at the same time. If the face detection has started, apps should not send - * this again. - * - * In hardware face detection mode, CameraParameters KEY_WHITE_BALANCE, - * KEY_FOCUS_AREAS and KEY_METERING_AREAS have no effect. - * - * arg1 is the face detection type. It can be CAMERA_FACE_DETECTION_HW or - * CAMERA_FACE_DETECTION_SW. If the type of face detection requested is not - * supported, the HAL must return BAD_VALUE. - */ - CAMERA_CMD_START_FACE_DETECTION = 6, - - /** - * Stop the face detection. - */ - CAMERA_CMD_STOP_FACE_DETECTION = 7, - - /** - * Enable/disable focus move callback (CAMERA_MSG_FOCUS_MOVE). Passing - * arg1 = 0 will disable, while passing arg1 = 1 will enable the callback. - */ - CAMERA_CMD_ENABLE_FOCUS_MOVE_MSG = 8, - - /** - * Ping camera service to see if camera hardware is released. - * - * When any camera method returns error, the client can use ping command - * to see if the camera has been taken away by other clients. If the result - * is NO_ERROR, it means the camera hardware is not released. If the result - * is not NO_ERROR, the camera has been released and the existing client - * can silently finish itself or show a dialog. - */ - CAMERA_CMD_PING = 9, - - /** - * Configure the number of video buffers used for recording. The intended - * video buffer count for recording is passed as arg1, which must be - * greater than 0. This command must be sent before recording is started. - * This command returns INVALID_OPERATION error if it is sent after video - * recording is started, or the command is not supported at all. This - * command also returns a BAD_VALUE error if the intended video buffer - * count is non-positive or too big to be realized. - */ - CAMERA_CMD_SET_VIDEO_BUFFER_COUNT = 10, -}; - -/** camera fatal errors */ -enum { - CAMERA_ERROR_UNKNOWN = 1, - /** - * Camera was released because another client has connected to the camera. - * The original client should call Camera::disconnect immediately after - * getting this notification. Otherwise, the camera will be released by - * camera service in a short time. The client should not call any method - * (except disconnect and sending CAMERA_CMD_PING) after getting this. - */ - CAMERA_ERROR_RELEASED = 2, - CAMERA_ERROR_SERVER_DIED = 100 -}; - -enum { - /** The facing of the camera is opposite to that of the screen. */ - CAMERA_FACING_BACK = 0, - /** The facing of the camera is the same as that of the screen. */ - CAMERA_FACING_FRONT = 1 -}; - -enum { - /** Hardware face detection. It does not use much CPU. */ - CAMERA_FACE_DETECTION_HW = 0, - /** - * Software face detection. It uses some CPU. Applications must use - * Camera.setPreviewTexture for preview in this mode. - */ - CAMERA_FACE_DETECTION_SW = 1 -}; - -/** - * The information of a face from camera face detection. - */ -typedef struct camera_face { - /** - * Bounds of the face [left, top, right, bottom]. (-1000, -1000) represents - * the top-left of the camera field of view, and (1000, 1000) represents the - * bottom-right of the field of view. The width and height cannot be 0 or - * negative. This is supported by both hardware and software face detection. - * - * The direction is relative to the sensor orientation, that is, what the - * sensor sees. The direction is not affected by the rotation or mirroring - * of CAMERA_CMD_SET_DISPLAY_ORIENTATION. - */ - int32_t rect[4]; - - /** - * The confidence level of the face. The range is 1 to 100. 100 is the - * highest confidence. This is supported by both hardware and software - * face detection. - */ - int32_t score; - - /** - * An unique id per face while the face is visible to the tracker. If - * the face leaves the field-of-view and comes back, it will get a new - * id. If the value is 0, id is not supported. - */ - int32_t id; - - /** - * The coordinates of the center of the left eye. The range is -1000 to - * 1000. -2000, -2000 if this is not supported. - */ - int32_t left_eye[2]; - - /** - * The coordinates of the center of the right eye. The range is -1000 to - * 1000. -2000, -2000 if this is not supported. - */ - int32_t right_eye[2]; - - /** - * The coordinates of the center of the mouth. The range is -1000 to 1000. - * -2000, -2000 if this is not supported. - */ - int32_t mouth[2]; - -} camera_face_t; - -/** - * The metadata of the frame data. - */ -typedef struct camera_frame_metadata { - /** - * The number of detected faces in the frame. - */ - int32_t number_of_faces; - - /** - * An array of the detected faces. The length is number_of_faces. - */ - camera_face_t *faces; -} camera_frame_metadata_t; - -__END_DECLS - -#endif /* SYSTEM_CORE_INCLUDE_ANDROID_CAMERA_H */ diff --git a/external/android/include/18/system/core/include/system/graphics.h b/external/android/include/18/system/core/include/system/graphics.h deleted file mode 100644 index ed493f5..0000000 --- a/external/android/include/18/system/core/include/system/graphics.h +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Copyright (C) 2011 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 SYSTEM_CORE_INCLUDE_ANDROID_GRAPHICS_H -#define SYSTEM_CORE_INCLUDE_ANDROID_GRAPHICS_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * If the HAL needs to create service threads to handle graphics related - * tasks, these threads need to run at HAL_PRIORITY_URGENT_DISPLAY priority - * if they can block the main rendering thread in any way. - * - * the priority of the current thread can be set with: - * - * #include - * setpriority(PRIO_PROCESS, 0, HAL_PRIORITY_URGENT_DISPLAY); - * - */ - -#define HAL_PRIORITY_URGENT_DISPLAY (-8) - -/** - * pixel format definitions - */ - -enum { - HAL_PIXEL_FORMAT_RGBA_8888 = 1, - HAL_PIXEL_FORMAT_RGBX_8888 = 2, - HAL_PIXEL_FORMAT_RGB_888 = 3, - HAL_PIXEL_FORMAT_RGB_565 = 4, - HAL_PIXEL_FORMAT_BGRA_8888 = 5, - HAL_PIXEL_FORMAT_RGBA_5551 = 6, - HAL_PIXEL_FORMAT_RGBA_4444 = 7, - - /* 0x8 - 0xFF range unavailable */ - - /* - * 0x100 - 0x1FF - * - * This range is reserved for pixel formats that are specific to the HAL - * implementation. Implementations can use any value in this range to - * communicate video pixel formats between their HAL modules. These formats - * must not have an alpha channel. Additionally, an EGLimage created from a - * gralloc buffer of one of these formats must be supported for use with the - * GL_OES_EGL_image_external OpenGL ES extension. - */ - - /* - * Android YUV format: - * - * This format is exposed outside of the HAL to software decoders and - * applications. EGLImageKHR must support it in conjunction with the - * OES_EGL_image_external extension. - * - * YV12 is a 4:2:0 YCrCb planar format comprised of a WxH Y plane followed - * by (W/2) x (H/2) Cr and Cb planes. - * - * This format assumes - * - an even width - * - an even height - * - a horizontal stride multiple of 16 pixels - * - a vertical stride equal to the height - * - * y_size = stride * height - * c_stride = ALIGN(stride/2, 16) - * c_size = c_stride * height/2 - * size = y_size + c_size * 2 - * cr_offset = y_size - * cb_offset = y_size + c_size - * - */ - HAL_PIXEL_FORMAT_YV12 = 0x32315659, // YCrCb 4:2:0 Planar - - - /* - * Android Y8 format: - * - * This format is exposed outside of the HAL to the framework. - * The expected gralloc usage flags are SW_* and HW_CAMERA_*, - * and no other HW_ flags will be used. - * - * Y8 is a YUV planar format comprised of a WxH Y plane, - * with each pixel being represented by 8 bits. - * - * It is equivalent to just the Y plane from YV12. - * - * This format assumes - * - an even width - * - an even height - * - a horizontal stride multiple of 16 pixels - * - a vertical stride equal to the height - * - * size = stride * height - * - */ - HAL_PIXEL_FORMAT_Y8 = 0x20203859, - - /* - * Android Y16 format: - * - * This format is exposed outside of the HAL to the framework. - * The expected gralloc usage flags are SW_* and HW_CAMERA_*, - * and no other HW_ flags will be used. - * - * Y16 is a YUV planar format comprised of a WxH Y plane, - * with each pixel being represented by 16 bits. - * - * It is just like Y8, but has double the bits per pixel (little endian). - * - * This format assumes - * - an even width - * - an even height - * - a horizontal stride multiple of 16 pixels - * - a vertical stride equal to the height - * - strides are specified in pixels, not in bytes - * - * size = stride * height * 2 - * - */ - HAL_PIXEL_FORMAT_Y16 = 0x20363159, - - /* - * Android RAW sensor format: - * - * This format is exposed outside of the HAL to applications. - * - * RAW_SENSOR is a single-channel 16-bit format, typically representing raw - * Bayer-pattern images from an image sensor, with minimal processing. - * - * The exact pixel layout of the data in the buffer is sensor-dependent, and - * needs to be queried from the camera device. - * - * Generally, not all 16 bits are used; more common values are 10 or 12 - * bits. All parameters to interpret the raw data (black and white points, - * color space, etc) must be queried from the camera device. - * - * This format assumes - * - an even width - * - an even height - * - a horizontal stride multiple of 16 pixels (32 bytes). - */ - HAL_PIXEL_FORMAT_RAW_SENSOR = 0x20, - - /* - * Android binary blob graphics buffer format: - * - * This format is used to carry task-specific data which does not have a - * standard image structure. The details of the format are left to the two - * endpoints. - * - * A typical use case is for transporting JPEG-compressed images from the - * Camera HAL to the framework or to applications. - * - * Buffers of this format must have a height of 1, and width equal to their - * size in bytes. - */ - HAL_PIXEL_FORMAT_BLOB = 0x21, - - /* - * Android format indicating that the choice of format is entirely up to the - * device-specific Gralloc implementation. - * - * The Gralloc implementation should examine the usage bits passed in when - * allocating a buffer with this format, and it should derive the pixel - * format from those usage flags. This format will never be used with any - * of the GRALLOC_USAGE_SW_* usage flags. - * - * If a buffer of this format is to be used as an OpenGL ES texture, the - * framework will assume that sampling the texture will always return an - * alpha value of 1.0 (i.e. the buffer contains only opaque pixel values). - * - */ - HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED = 0x22, - - /* - * Android flexible YCbCr formats - * - * This format allows platforms to use an efficient YCbCr/YCrCb buffer - * layout, while still describing the buffer layout in a way accessible to - * the CPU in a device-independent manner. While called YCbCr, it can be - * used to describe formats with either chromatic ordering, as well as - * whole planar or semiplanar layouts. - * - * struct android_ycbcr (below) is the the struct used to describe it. - * - * This format must be accepted by the gralloc module when - * USAGE_HW_CAMERA_WRITE and USAGE_SW_READ_* are set. - * - * This format is locked for use by gralloc's (*lock_ycbcr) method, and - * locking with the (*lock) method will return an error. - */ - HAL_PIXEL_FORMAT_YCbCr_420_888 = 0x23, - - /* Legacy formats (deprecated), used by ImageFormat.java */ - HAL_PIXEL_FORMAT_YCbCr_422_SP = 0x10, // NV16 - HAL_PIXEL_FORMAT_YCrCb_420_SP = 0x11, // NV21 - HAL_PIXEL_FORMAT_YCbCr_422_I = 0x14, // YUY2 -}; - -/* - * Structure for describing YCbCr formats for consumption by applications. - * This is used with HAL_PIXEL_FORMAT_YCbCr_*_888. - * - * Buffer chroma subsampling is defined in the format. - * e.g. HAL_PIXEL_FORMAT_YCbCr_420_888 has subsampling 4:2:0. - * - * Buffers must have a 8 bit depth. - * - * @y, @cb, and @cr point to the first byte of their respective planes. - * - * Stride describes the distance in bytes from the first value of one row of - * the image to the first value of the next row. It includes the width of the - * image plus padding. - * @ystride is the stride of the luma plane. - * @cstride is the stride of the chroma planes. - * - * @chroma_step is the distance in bytes from one chroma pixel value to the - * next. This is 2 bytes for semiplanar (because chroma values are interleaved - * and each chroma value is one byte) and 1 for planar. - */ - -struct android_ycbcr { - void *y; - void *cb; - void *cr; - size_t ystride; - size_t cstride; - size_t chroma_step; - - /** reserved for future use, set to 0 by gralloc's (*lock_ycbcr)() */ - uint32_t reserved[8]; -}; - -/** - * Transformation definitions - * - * IMPORTANT NOTE: - * HAL_TRANSFORM_ROT_90 is applied CLOCKWISE and AFTER HAL_TRANSFORM_FLIP_{H|V}. - * - */ - -enum { - /* flip source image horizontally (around the vertical axis) */ - HAL_TRANSFORM_FLIP_H = 0x01, - /* flip source image vertically (around the horizontal axis)*/ - HAL_TRANSFORM_FLIP_V = 0x02, - /* rotate source image 90 degrees clockwise */ - HAL_TRANSFORM_ROT_90 = 0x04, - /* rotate source image 180 degrees */ - HAL_TRANSFORM_ROT_180 = 0x03, - /* rotate source image 270 degrees clockwise */ - HAL_TRANSFORM_ROT_270 = 0x07, -}; - -#ifdef __cplusplus -} -#endif - -#endif /* SYSTEM_CORE_INCLUDE_ANDROID_GRAPHICS_H */ diff --git a/external/android/include/18/system/core/include/system/window.h b/external/android/include/18/system/core/include/system/window.h deleted file mode 100644 index b8a19c8..0000000 --- a/external/android/include/18/system/core/include/system/window.h +++ /dev/null @@ -1,833 +0,0 @@ -/* - * Copyright (C) 2011 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 SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H -#define SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -__BEGIN_DECLS - -/*****************************************************************************/ - -#define ANDROID_NATIVE_MAKE_CONSTANT(a,b,c,d) \ - (((unsigned)(a)<<24)|((unsigned)(b)<<16)|((unsigned)(c)<<8)|(unsigned)(d)) - -#define ANDROID_NATIVE_WINDOW_MAGIC \ - ANDROID_NATIVE_MAKE_CONSTANT('_','w','n','d') - -#define ANDROID_NATIVE_BUFFER_MAGIC \ - ANDROID_NATIVE_MAKE_CONSTANT('_','b','f','r') - -// --------------------------------------------------------------------------- - -// This #define may be used to conditionally compile device-specific code to -// support either the prior ANativeWindow interface, which did not pass libsync -// fences around, or the new interface that does. This #define is only present -// when the ANativeWindow interface does include libsync support. -#define ANDROID_NATIVE_WINDOW_HAS_SYNC 1 - -// --------------------------------------------------------------------------- - -typedef const native_handle_t* buffer_handle_t; - -// --------------------------------------------------------------------------- - -typedef struct android_native_rect_t -{ - int32_t left; - int32_t top; - int32_t right; - int32_t bottom; -} android_native_rect_t; - -// --------------------------------------------------------------------------- - -typedef struct android_native_base_t -{ - /* a magic value defined by the actual EGL native type */ - int magic; - - /* the sizeof() of the actual EGL native type */ - int version; - - void* reserved[4]; - - /* reference-counting interface */ - void (*incRef)(struct android_native_base_t* base); - void (*decRef)(struct android_native_base_t* base); -} android_native_base_t; - -typedef struct ANativeWindowBuffer -{ -#ifdef __cplusplus - ANativeWindowBuffer() { - common.magic = ANDROID_NATIVE_BUFFER_MAGIC; - common.version = sizeof(ANativeWindowBuffer); - memset(common.reserved, 0, sizeof(common.reserved)); - } - - // Implement the methods that sp expects so that it - // can be used to automatically refcount ANativeWindowBuffer's. - void incStrong(const void* id) const { - common.incRef(const_cast(&common)); - } - void decStrong(const void* id) const { - common.decRef(const_cast(&common)); - } -#endif - - struct android_native_base_t common; - - int width; - int height; - int stride; - int format; - int usage; - - void* reserved[2]; - - buffer_handle_t handle; - - void* reserved_proc[8]; -} ANativeWindowBuffer_t; - -// Old typedef for backwards compatibility. -typedef ANativeWindowBuffer_t android_native_buffer_t; - -// --------------------------------------------------------------------------- - -/* attributes queriable with query() */ -enum { - NATIVE_WINDOW_WIDTH = 0, - NATIVE_WINDOW_HEIGHT = 1, - NATIVE_WINDOW_FORMAT = 2, - - /* The minimum number of buffers that must remain un-dequeued after a buffer - * has been queued. This value applies only if set_buffer_count was used to - * override the number of buffers and if a buffer has since been queued. - * Users of the set_buffer_count ANativeWindow method should query this - * value before calling set_buffer_count. If it is necessary to have N - * buffers simultaneously dequeued as part of the steady-state operation, - * and this query returns M then N+M buffers should be requested via - * native_window_set_buffer_count. - * - * Note that this value does NOT apply until a single buffer has been - * queued. In particular this means that it is possible to: - * - * 1. Query M = min undequeued buffers - * 2. Set the buffer count to N + M - * 3. Dequeue all N + M buffers - * 4. Cancel M buffers - * 5. Queue, dequeue, queue, dequeue, ad infinitum - */ - NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS = 3, - - /* Check whether queueBuffer operations on the ANativeWindow send the buffer - * to the window compositor. The query sets the returned 'value' argument - * to 1 if the ANativeWindow DOES send queued buffers directly to the window - * compositor and 0 if the buffers do not go directly to the window - * compositor. - * - * This can be used to determine whether protected buffer content should be - * sent to the ANativeWindow. Note, however, that a result of 1 does NOT - * indicate that queued buffers will be protected from applications or users - * capturing their contents. If that behavior is desired then some other - * mechanism (e.g. the GRALLOC_USAGE_PROTECTED flag) should be used in - * conjunction with this query. - */ - NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER = 4, - - /* Get the concrete type of a ANativeWindow. See below for the list of - * possible return values. - * - * This query should not be used outside the Android framework and will - * likely be removed in the near future. - */ - NATIVE_WINDOW_CONCRETE_TYPE = 5, - - - /* - * Default width and height of ANativeWindow buffers, these are the - * dimensions of the window buffers irrespective of the - * NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS call and match the native window - * size unless overridden by NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS. - */ - NATIVE_WINDOW_DEFAULT_WIDTH = 6, - NATIVE_WINDOW_DEFAULT_HEIGHT = 7, - - /* - * transformation that will most-likely be applied to buffers. This is only - * a hint, the actual transformation applied might be different. - * - * INTENDED USE: - * - * The transform hint can be used by a producer, for instance the GLES - * driver, to pre-rotate the rendering such that the final transformation - * in the composer is identity. This can be very useful when used in - * conjunction with the h/w composer HAL, in situations where it - * cannot handle arbitrary rotations. - * - * 1. Before dequeuing a buffer, the GL driver (or any other ANW client) - * queries the ANW for NATIVE_WINDOW_TRANSFORM_HINT. - * - * 2. The GL driver overrides the width and height of the ANW to - * account for NATIVE_WINDOW_TRANSFORM_HINT. This is done by querying - * NATIVE_WINDOW_DEFAULT_{WIDTH | HEIGHT}, swapping the dimensions - * according to NATIVE_WINDOW_TRANSFORM_HINT and calling - * native_window_set_buffers_dimensions(). - * - * 3. The GL driver dequeues a buffer of the new pre-rotated size. - * - * 4. The GL driver renders to the buffer such that the image is - * already transformed, that is applying NATIVE_WINDOW_TRANSFORM_HINT - * to the rendering. - * - * 5. The GL driver calls native_window_set_transform to apply - * inverse transformation to the buffer it just rendered. - * In order to do this, the GL driver needs - * to calculate the inverse of NATIVE_WINDOW_TRANSFORM_HINT, this is - * done easily: - * - * int hintTransform, inverseTransform; - * query(..., NATIVE_WINDOW_TRANSFORM_HINT, &hintTransform); - * inverseTransform = hintTransform; - * if (hintTransform & HAL_TRANSFORM_ROT_90) - * inverseTransform ^= HAL_TRANSFORM_ROT_180; - * - * - * 6. The GL driver queues the pre-transformed buffer. - * - * 7. The composer combines the buffer transform with the display - * transform. If the buffer transform happens to cancel out the - * display transform then no rotation is needed. - * - */ - NATIVE_WINDOW_TRANSFORM_HINT = 8, - - /* - * Boolean that indicates whether the consumer is running more than - * one buffer behind the producer. - */ - NATIVE_WINDOW_CONSUMER_RUNNING_BEHIND = 9 -}; - -/* Valid operations for the (*perform)() hook. - * - * Values marked as 'deprecated' are supported, but have been superceded by - * other functionality. - * - * Values marked as 'private' should be considered private to the framework. - * HAL implementation code with access to an ANativeWindow should not use these, - * as it may not interact properly with the framework's use of the - * ANativeWindow. - */ -enum { - NATIVE_WINDOW_SET_USAGE = 0, - NATIVE_WINDOW_CONNECT = 1, /* deprecated */ - NATIVE_WINDOW_DISCONNECT = 2, /* deprecated */ - NATIVE_WINDOW_SET_CROP = 3, /* private */ - NATIVE_WINDOW_SET_BUFFER_COUNT = 4, - NATIVE_WINDOW_SET_BUFFERS_GEOMETRY = 5, /* deprecated */ - NATIVE_WINDOW_SET_BUFFERS_TRANSFORM = 6, - NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP = 7, - NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS = 8, - NATIVE_WINDOW_SET_BUFFERS_FORMAT = 9, - NATIVE_WINDOW_SET_SCALING_MODE = 10, /* private */ - NATIVE_WINDOW_LOCK = 11, /* private */ - NATIVE_WINDOW_UNLOCK_AND_POST = 12, /* private */ - NATIVE_WINDOW_API_CONNECT = 13, /* private */ - NATIVE_WINDOW_API_DISCONNECT = 14, /* private */ - NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS = 15, /* private */ - NATIVE_WINDOW_SET_POST_TRANSFORM_CROP = 16, /* private */ -}; - -/* parameter for NATIVE_WINDOW_[API_][DIS]CONNECT */ -enum { - /* Buffers will be queued by EGL via eglSwapBuffers after being filled using - * OpenGL ES. - */ - NATIVE_WINDOW_API_EGL = 1, - - /* Buffers will be queued after being filled using the CPU - */ - NATIVE_WINDOW_API_CPU = 2, - - /* Buffers will be queued by Stagefright after being filled by a video - * decoder. The video decoder can either be a software or hardware decoder. - */ - NATIVE_WINDOW_API_MEDIA = 3, - - /* Buffers will be queued by the the camera HAL. - */ - NATIVE_WINDOW_API_CAMERA = 4, -}; - -/* parameter for NATIVE_WINDOW_SET_BUFFERS_TRANSFORM */ -enum { - /* flip source image horizontally */ - NATIVE_WINDOW_TRANSFORM_FLIP_H = HAL_TRANSFORM_FLIP_H , - /* flip source image vertically */ - NATIVE_WINDOW_TRANSFORM_FLIP_V = HAL_TRANSFORM_FLIP_V, - /* rotate source image 90 degrees clock-wise */ - NATIVE_WINDOW_TRANSFORM_ROT_90 = HAL_TRANSFORM_ROT_90, - /* rotate source image 180 degrees */ - NATIVE_WINDOW_TRANSFORM_ROT_180 = HAL_TRANSFORM_ROT_180, - /* rotate source image 270 degrees clock-wise */ - NATIVE_WINDOW_TRANSFORM_ROT_270 = HAL_TRANSFORM_ROT_270, -}; - -/* parameter for NATIVE_WINDOW_SET_SCALING_MODE */ -enum { - /* the window content is not updated (frozen) until a buffer of - * the window size is received (enqueued) - */ - NATIVE_WINDOW_SCALING_MODE_FREEZE = 0, - /* the buffer is scaled in both dimensions to match the window size */ - NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW = 1, - /* the buffer is scaled uniformly such that the smaller dimension - * of the buffer matches the window size (cropping in the process) - */ - NATIVE_WINDOW_SCALING_MODE_SCALE_CROP = 2, - /* the window is clipped to the size of the buffer's crop rectangle; pixels - * outside the crop rectangle are treated as if they are completely - * transparent. - */ - NATIVE_WINDOW_SCALING_MODE_NO_SCALE_CROP = 3, -}; - -/* values returned by the NATIVE_WINDOW_CONCRETE_TYPE query */ -enum { - NATIVE_WINDOW_FRAMEBUFFER = 0, /* FramebufferNativeWindow */ - NATIVE_WINDOW_SURFACE = 1, /* Surface */ -}; - -/* parameter for NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP - * - * Special timestamp value to indicate that timestamps should be auto-generated - * by the native window when queueBuffer is called. This is equal to INT64_MIN, - * defined directly to avoid problems with C99/C++ inclusion of stdint.h. - */ -static const int64_t NATIVE_WINDOW_TIMESTAMP_AUTO = (-9223372036854775807LL-1); - -struct ANativeWindow -{ -#ifdef __cplusplus - ANativeWindow() - : flags(0), minSwapInterval(0), maxSwapInterval(0), xdpi(0), ydpi(0) - { - common.magic = ANDROID_NATIVE_WINDOW_MAGIC; - common.version = sizeof(ANativeWindow); - memset(common.reserved, 0, sizeof(common.reserved)); - } - - /* Implement the methods that sp expects so that it - can be used to automatically refcount ANativeWindow's. */ - void incStrong(const void* id) const { - common.incRef(const_cast(&common)); - } - void decStrong(const void* id) const { - common.decRef(const_cast(&common)); - } -#endif - - struct android_native_base_t common; - - /* flags describing some attributes of this surface or its updater */ - const uint32_t flags; - - /* min swap interval supported by this updated */ - const int minSwapInterval; - - /* max swap interval supported by this updated */ - const int maxSwapInterval; - - /* horizontal and vertical resolution in DPI */ - const float xdpi; - const float ydpi; - - /* Some storage reserved for the OEM's driver. */ - intptr_t oem[4]; - - /* - * Set the swap interval for this surface. - * - * Returns 0 on success or -errno on error. - */ - int (*setSwapInterval)(struct ANativeWindow* window, - int interval); - - /* - * Hook called by EGL to acquire a buffer. After this call, the buffer - * is not locked, so its content cannot be modified. This call may block if - * no buffers are available. - * - * The window holds a reference to the buffer between dequeueBuffer and - * either queueBuffer or cancelBuffer, so clients only need their own - * reference if they might use the buffer after queueing or canceling it. - * Holding a reference to a buffer after queueing or canceling it is only - * allowed if a specific buffer count has been set. - * - * Returns 0 on success or -errno on error. - * - * XXX: This function is deprecated. It will continue to work for some - * time for binary compatibility, but the new dequeueBuffer function that - * outputs a fence file descriptor should be used in its place. - */ - int (*dequeueBuffer_DEPRECATED)(struct ANativeWindow* window, - struct ANativeWindowBuffer** buffer); - - /* - * hook called by EGL to lock a buffer. This MUST be called before modifying - * the content of a buffer. The buffer must have been acquired with - * dequeueBuffer first. - * - * Returns 0 on success or -errno on error. - * - * XXX: This function is deprecated. It will continue to work for some - * time for binary compatibility, but it is essentially a no-op, and calls - * to it should be removed. - */ - int (*lockBuffer_DEPRECATED)(struct ANativeWindow* window, - struct ANativeWindowBuffer* buffer); - - /* - * Hook called by EGL when modifications to the render buffer are done. - * This unlocks and post the buffer. - * - * The window holds a reference to the buffer between dequeueBuffer and - * either queueBuffer or cancelBuffer, so clients only need their own - * reference if they might use the buffer after queueing or canceling it. - * Holding a reference to a buffer after queueing or canceling it is only - * allowed if a specific buffer count has been set. - * - * Buffers MUST be queued in the same order than they were dequeued. - * - * Returns 0 on success or -errno on error. - * - * XXX: This function is deprecated. It will continue to work for some - * time for binary compatibility, but the new queueBuffer function that - * takes a fence file descriptor should be used in its place (pass a value - * of -1 for the fence file descriptor if there is no valid one to pass). - */ - int (*queueBuffer_DEPRECATED)(struct ANativeWindow* window, - struct ANativeWindowBuffer* buffer); - - /* - * hook used to retrieve information about the native window. - * - * Returns 0 on success or -errno on error. - */ - int (*query)(const struct ANativeWindow* window, - int what, int* value); - - /* - * hook used to perform various operations on the surface. - * (*perform)() is a generic mechanism to add functionality to - * ANativeWindow while keeping backward binary compatibility. - * - * DO NOT CALL THIS HOOK DIRECTLY. Instead, use the helper functions - * defined below. - * - * (*perform)() returns -ENOENT if the 'what' parameter is not supported - * by the surface's implementation. - * - * The valid operations are: - * NATIVE_WINDOW_SET_USAGE - * NATIVE_WINDOW_CONNECT (deprecated) - * NATIVE_WINDOW_DISCONNECT (deprecated) - * NATIVE_WINDOW_SET_CROP (private) - * NATIVE_WINDOW_SET_BUFFER_COUNT - * NATIVE_WINDOW_SET_BUFFERS_GEOMETRY (deprecated) - * NATIVE_WINDOW_SET_BUFFERS_TRANSFORM - * NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP - * NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS - * NATIVE_WINDOW_SET_BUFFERS_FORMAT - * NATIVE_WINDOW_SET_SCALING_MODE (private) - * NATIVE_WINDOW_LOCK (private) - * NATIVE_WINDOW_UNLOCK_AND_POST (private) - * NATIVE_WINDOW_API_CONNECT (private) - * NATIVE_WINDOW_API_DISCONNECT (private) - * NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS (private) - * NATIVE_WINDOW_SET_POST_TRANSFORM_CROP (private) - * - */ - - int (*perform)(struct ANativeWindow* window, - int operation, ... ); - - /* - * Hook used to cancel a buffer that has been dequeued. - * No synchronization is performed between dequeue() and cancel(), so - * either external synchronization is needed, or these functions must be - * called from the same thread. - * - * The window holds a reference to the buffer between dequeueBuffer and - * either queueBuffer or cancelBuffer, so clients only need their own - * reference if they might use the buffer after queueing or canceling it. - * Holding a reference to a buffer after queueing or canceling it is only - * allowed if a specific buffer count has been set. - * - * XXX: This function is deprecated. It will continue to work for some - * time for binary compatibility, but the new cancelBuffer function that - * takes a fence file descriptor should be used in its place (pass a value - * of -1 for the fence file descriptor if there is no valid one to pass). - */ - int (*cancelBuffer_DEPRECATED)(struct ANativeWindow* window, - struct ANativeWindowBuffer* buffer); - - /* - * Hook called by EGL to acquire a buffer. This call may block if no - * buffers are available. - * - * The window holds a reference to the buffer between dequeueBuffer and - * either queueBuffer or cancelBuffer, so clients only need their own - * reference if they might use the buffer after queueing or canceling it. - * Holding a reference to a buffer after queueing or canceling it is only - * allowed if a specific buffer count has been set. - * - * The libsync fence file descriptor returned in the int pointed to by the - * fenceFd argument will refer to the fence that must signal before the - * dequeued buffer may be written to. A value of -1 indicates that the - * caller may access the buffer immediately without waiting on a fence. If - * a valid file descriptor is returned (i.e. any value except -1) then the - * caller is responsible for closing the file descriptor. - * - * Returns 0 on success or -errno on error. - */ - int (*dequeueBuffer)(struct ANativeWindow* window, - struct ANativeWindowBuffer** buffer, int* fenceFd); - - /* - * Hook called by EGL when modifications to the render buffer are done. - * This unlocks and post the buffer. - * - * The window holds a reference to the buffer between dequeueBuffer and - * either queueBuffer or cancelBuffer, so clients only need their own - * reference if they might use the buffer after queueing or canceling it. - * Holding a reference to a buffer after queueing or canceling it is only - * allowed if a specific buffer count has been set. - * - * The fenceFd argument specifies a libsync fence file descriptor for a - * fence that must signal before the buffer can be accessed. If the buffer - * can be accessed immediately then a value of -1 should be used. The - * caller must not use the file descriptor after it is passed to - * queueBuffer, and the ANativeWindow implementation is responsible for - * closing it. - * - * Returns 0 on success or -errno on error. - */ - int (*queueBuffer)(struct ANativeWindow* window, - struct ANativeWindowBuffer* buffer, int fenceFd); - - /* - * Hook used to cancel a buffer that has been dequeued. - * No synchronization is performed between dequeue() and cancel(), so - * either external synchronization is needed, or these functions must be - * called from the same thread. - * - * The window holds a reference to the buffer between dequeueBuffer and - * either queueBuffer or cancelBuffer, so clients only need their own - * reference if they might use the buffer after queueing or canceling it. - * Holding a reference to a buffer after queueing or canceling it is only - * allowed if a specific buffer count has been set. - * - * The fenceFd argument specifies a libsync fence file decsriptor for a - * fence that must signal before the buffer can be accessed. If the buffer - * can be accessed immediately then a value of -1 should be used. - * - * Note that if the client has not waited on the fence that was returned - * from dequeueBuffer, that same fence should be passed to cancelBuffer to - * ensure that future uses of the buffer are preceded by a wait on that - * fence. The caller must not use the file descriptor after it is passed - * to cancelBuffer, and the ANativeWindow implementation is responsible for - * closing it. - * - * Returns 0 on success or -errno on error. - */ - int (*cancelBuffer)(struct ANativeWindow* window, - struct ANativeWindowBuffer* buffer, int fenceFd); -}; - - /* Backwards compatibility: use ANativeWindow (struct ANativeWindow in C). - * android_native_window_t is deprecated. - */ -typedef struct ANativeWindow ANativeWindow; -typedef struct ANativeWindow android_native_window_t; - -/* - * native_window_set_usage(..., usage) - * Sets the intended usage flags for the next buffers - * acquired with (*lockBuffer)() and on. - * By default (if this function is never called), a usage of - * GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE - * is assumed. - * Calling this function will usually cause following buffers to be - * reallocated. - */ - -static inline int native_window_set_usage( - struct ANativeWindow* window, int usage) -{ - return window->perform(window, NATIVE_WINDOW_SET_USAGE, usage); -} - -/* deprecated. Always returns 0. Don't call. */ -static inline int native_window_connect( - struct ANativeWindow* window, int api) { - return 0; -} - -/* deprecated. Always returns 0. Don't call. */ -static inline int native_window_disconnect( - struct ANativeWindow* window, int api) { - return 0; -} - -/* - * native_window_set_crop(..., crop) - * Sets which region of the next queued buffers needs to be considered. - * Depending on the scaling mode, a buffer's crop region is scaled and/or - * cropped to match the surface's size. This function sets the crop in - * pre-transformed buffer pixel coordinates. - * - * The specified crop region applies to all buffers queued after it is called. - * - * If 'crop' is NULL, subsequently queued buffers won't be cropped. - * - * An error is returned if for instance the crop region is invalid, out of the - * buffer's bound or if the window is invalid. - */ -static inline int native_window_set_crop( - struct ANativeWindow* window, - android_native_rect_t const * crop) -{ - return window->perform(window, NATIVE_WINDOW_SET_CROP, crop); -} - -/* - * native_window_set_post_transform_crop(..., crop) - * Sets which region of the next queued buffers needs to be considered. - * Depending on the scaling mode, a buffer's crop region is scaled and/or - * cropped to match the surface's size. This function sets the crop in - * post-transformed pixel coordinates. - * - * The specified crop region applies to all buffers queued after it is called. - * - * If 'crop' is NULL, subsequently queued buffers won't be cropped. - * - * An error is returned if for instance the crop region is invalid, out of the - * buffer's bound or if the window is invalid. - */ -static inline int native_window_set_post_transform_crop( - struct ANativeWindow* window, - android_native_rect_t const * crop) -{ - return window->perform(window, NATIVE_WINDOW_SET_POST_TRANSFORM_CROP, crop); -} - -/* - * native_window_set_active_rect(..., active_rect) - * - * This function is deprecated and will be removed soon. For now it simply - * sets the post-transform crop for compatibility while multi-project commits - * get checked. - */ -static inline int native_window_set_active_rect( - struct ANativeWindow* window, - android_native_rect_t const * active_rect) -{ - return native_window_set_post_transform_crop(window, active_rect); -} - -/* - * native_window_set_buffer_count(..., count) - * Sets the number of buffers associated with this native window. - */ -static inline int native_window_set_buffer_count( - struct ANativeWindow* window, - size_t bufferCount) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFER_COUNT, bufferCount); -} - -/* - * native_window_set_buffers_geometry(..., int w, int h, int format) - * All buffers dequeued after this call will have the dimensions and format - * specified. A successful call to this function has the same effect as calling - * native_window_set_buffers_size and native_window_set_buffers_format. - * - * XXX: This function is deprecated. The native_window_set_buffers_dimensions - * and native_window_set_buffers_format functions should be used instead. - */ -static inline int native_window_set_buffers_geometry( - struct ANativeWindow* window, - int w, int h, int format) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_GEOMETRY, - w, h, format); -} - -/* - * native_window_set_buffers_dimensions(..., int w, int h) - * All buffers dequeued after this call will have the dimensions specified. - * In particular, all buffers will have a fixed-size, independent from the - * native-window size. They will be scaled according to the scaling mode - * (see native_window_set_scaling_mode) upon window composition. - * - * If w and h are 0, the normal behavior is restored. That is, dequeued buffers - * following this call will be sized to match the window's size. - * - * Calling this function will reset the window crop to a NULL value, which - * disables cropping of the buffers. - */ -static inline int native_window_set_buffers_dimensions( - struct ANativeWindow* window, - int w, int h) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS, - w, h); -} - -/* - * native_window_set_buffers_user_dimensions(..., int w, int h) - * - * Sets the user buffer size for the window, which overrides the - * window's size. All buffers dequeued after this call will have the - * dimensions specified unless overridden by - * native_window_set_buffers_dimensions. All buffers will have a - * fixed-size, independent from the native-window size. They will be - * scaled according to the scaling mode (see - * native_window_set_scaling_mode) upon window composition. - * - * If w and h are 0, the normal behavior is restored. That is, the - * default buffer size will match the windows's size. - * - * Calling this function will reset the window crop to a NULL value, which - * disables cropping of the buffers. - */ -static inline int native_window_set_buffers_user_dimensions( - struct ANativeWindow* window, - int w, int h) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS, - w, h); -} - -/* - * native_window_set_buffers_format(..., int format) - * All buffers dequeued after this call will have the format specified. - * - * If the specified format is 0, the default buffer format will be used. - */ -static inline int native_window_set_buffers_format( - struct ANativeWindow* window, - int format) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_FORMAT, format); -} - -/* - * native_window_set_buffers_transform(..., int transform) - * All buffers queued after this call will be displayed transformed according - * to the transform parameter specified. - */ -static inline int native_window_set_buffers_transform( - struct ANativeWindow* window, - int transform) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_TRANSFORM, - transform); -} - -/* - * native_window_set_buffers_timestamp(..., int64_t timestamp) - * All buffers queued after this call will be associated with the timestamp - * parameter specified. If the timestamp is set to NATIVE_WINDOW_TIMESTAMP_AUTO - * (the default), timestamps will be generated automatically when queueBuffer is - * called. The timestamp is measured in nanoseconds, and is normally monotonically - * increasing. The timestamp should be unaffected by time-of-day adjustments, - * and for a camera should be strictly monotonic but for a media player may be - * reset when the position is set. - */ -static inline int native_window_set_buffers_timestamp( - struct ANativeWindow* window, - int64_t timestamp) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP, - timestamp); -} - -/* - * native_window_set_scaling_mode(..., int mode) - * All buffers queued after this call will be associated with the scaling mode - * specified. - */ -static inline int native_window_set_scaling_mode( - struct ANativeWindow* window, - int mode) -{ - return window->perform(window, NATIVE_WINDOW_SET_SCALING_MODE, - mode); -} - -/* - * native_window_api_connect(..., int api) - * connects an API to this window. only one API can be connected at a time. - * Returns -EINVAL if for some reason the window cannot be connected, which - * can happen if it's connected to some other API. - */ -static inline int native_window_api_connect( - struct ANativeWindow* window, int api) -{ - return window->perform(window, NATIVE_WINDOW_API_CONNECT, api); -} - -/* - * native_window_api_disconnect(..., int api) - * disconnect the API from this window. - * An error is returned if for instance the window wasn't connected in the - * first place. - */ -static inline int native_window_api_disconnect( - struct ANativeWindow* window, int api) -{ - return window->perform(window, NATIVE_WINDOW_API_DISCONNECT, api); -} - -/* - * native_window_dequeue_buffer_and_wait(...) - * Dequeue a buffer and wait on the fence associated with that buffer. The - * buffer may safely be accessed immediately upon this function returning. An - * error is returned if either of the dequeue or the wait operations fail. - */ -static inline int native_window_dequeue_buffer_and_wait(ANativeWindow *anw, - struct ANativeWindowBuffer** anb) { - return anw->dequeueBuffer_DEPRECATED(anw, anb); -} - - -__END_DECLS - -#endif /* SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H */ diff --git a/external/android/include/19/frameworks/av/include/media/AudioBufferProvider.h b/external/android/include/19/frameworks/av/include/media/AudioBufferProvider.h deleted file mode 100644 index ef392f0..0000000 --- a/external/android/include/19/frameworks/av/include/media/AudioBufferProvider.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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_AUDIO_BUFFER_PROVIDER_H -#define ANDROID_AUDIO_BUFFER_PROVIDER_H - -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class AudioBufferProvider -{ -public: - - // FIXME merge with AudioTrackShared::Buffer, AudioTrack::Buffer, and AudioRecord::Buffer - // and rename getNextBuffer() to obtainBuffer() - struct Buffer { - Buffer() : raw(NULL), frameCount(0) { } - union { - void* raw; - short* i16; - int8_t* i8; - }; - size_t frameCount; - }; - - virtual ~AudioBufferProvider() {} - - // value representing an invalid presentation timestamp - static const int64_t kInvalidPTS = 0x7FFFFFFFFFFFFFFFLL; // is too painful - - // pts is the local time when the next sample yielded by getNextBuffer - // will be rendered. - // Pass kInvalidPTS if the PTS is unknown or not applicable. - // On entry: - // buffer != NULL - // buffer->raw unused - // buffer->frameCount maximum number of desired frames - // On successful return: - // status NO_ERROR - // buffer->raw non-NULL pointer to buffer->frameCount contiguous available frames - // buffer->frameCount number of contiguous available frames at buffer->raw, - // 0 < buffer->frameCount <= entry value - // On error return: - // status != NO_ERROR - // buffer->raw NULL - // buffer->frameCount 0 - virtual status_t getNextBuffer(Buffer* buffer, int64_t pts = kInvalidPTS) = 0; - - virtual void releaseBuffer(Buffer* buffer) = 0; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_AUDIO_BUFFER_PROVIDER_H diff --git a/external/android/include/19/frameworks/av/include/media/AudioEffect.h b/external/android/include/19/frameworks/av/include/media/AudioEffect.h deleted file mode 100644 index 05d834d..0000000 --- a/external/android/include/19/frameworks/av/include/media/AudioEffect.h +++ /dev/null @@ -1,456 +0,0 @@ -/* - * 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_AUDIOEFFECT_H -#define ANDROID_AUDIOEFFECT_H - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - - -namespace android { - -// ---------------------------------------------------------------------------- - -class effect_param_cblk_t; - -// ---------------------------------------------------------------------------- - -class AudioEffect : public RefBase -{ -public: - - /* - * Static methods for effects enumeration. - */ - - /* - * Returns the number of effects available. This method together - * with queryEffect() is used to enumerate all effects: - * The enumeration sequence is: - * queryNumberEffects(&num_effects); - * for (i = 0; i < num_effects; i++) - * queryEffect(i,...); - * - * Parameters: - * numEffects: address where the number of effects should be returned. - * - * Returned status (from utils/Errors.h) can be: - * NO_ERROR successful operation. - * PERMISSION_DENIED could not get AudioFlinger interface - * NO_INIT effect library failed to initialize - * BAD_VALUE invalid numEffects pointer - * - * Returned value - * *numEffects: updated with number of effects available - */ - static status_t queryNumberEffects(uint32_t *numEffects); - - /* - * Returns an effect descriptor during effect - * enumeration. - * - * Parameters: - * index: index of the queried effect. - * descriptor: address where the effect descriptor should be returned. - * - * Returned status (from utils/Errors.h) can be: - * NO_ERROR successful operation. - * PERMISSION_DENIED could not get AudioFlinger interface - * NO_INIT effect library failed to initialize - * BAD_VALUE invalid descriptor pointer or index - * INVALID_OPERATION effect list has changed since last execution of queryNumberEffects() - * - * Returned value - * *descriptor: updated with effect descriptor - */ - static status_t queryEffect(uint32_t index, effect_descriptor_t *descriptor); - - - /* - * Returns the descriptor for the specified effect uuid. - * - * Parameters: - * uuid: pointer to effect uuid. - * descriptor: address where the effect descriptor should be returned. - * - * Returned status (from utils/Errors.h) can be: - * NO_ERROR successful operation. - * PERMISSION_DENIED could not get AudioFlinger interface - * NO_INIT effect library failed to initialize - * BAD_VALUE invalid uuid or descriptor pointers - * NAME_NOT_FOUND no effect with this uuid found - * - * Returned value - * *descriptor updated with effect descriptor - */ - static status_t getEffectDescriptor(const effect_uuid_t *uuid, - effect_descriptor_t *descriptor) /*const*/; - - - /* - * Returns a list of descriptors corresponding to the pre processings enabled by default - * on an AudioRecord with the supplied audio session ID. - * - * Parameters: - * audioSession: audio session ID. - * descriptors: address where the effect descriptors should be returned. - * count: as input, the maximum number of descriptor than should be returned - * as output, the number of descriptor returned if status is NO_ERROR or the actual - * number of enabled pre processings if status is NO_MEMORY - * - * Returned status (from utils/Errors.h) can be: - * NO_ERROR successful operation. - * NO_MEMORY the number of descriptor to return is more than the maximum number - * indicated by count. - * PERMISSION_DENIED could not get AudioFlinger interface - * NO_INIT effect library failed to initialize - * BAD_VALUE invalid audio session or descriptor pointers - * - * Returned value - * *descriptor updated with descriptors of pre processings enabled by default - * *count number of descriptors returned if returned status is N_ERROR. - * total number of pre processing enabled by default if returned status is - * NO_MEMORY. This happens if the count passed as input is less than the number - * of descriptors to return - */ - static status_t queryDefaultPreProcessing(int audioSession, - effect_descriptor_t *descriptors, - uint32_t *count); - - /* - * Events used by callback function (effect_callback_t). - */ - enum event_type { - EVENT_CONTROL_STATUS_CHANGED = 0, - EVENT_ENABLE_STATUS_CHANGED = 1, - EVENT_PARAMETER_CHANGED = 2, - EVENT_ERROR = 3 - }; - - /* Callback function notifying client application of a change in effect engine state or - * configuration. - * An effect engine can be shared by several applications but only one has the control - * of the engine activity and configuration at a time. - * The EVENT_CONTROL_STATUS_CHANGED event is received when an application loses or - * retrieves the control of the effect engine. Loss of control happens - * if another application requests the use of the engine by creating an AudioEffect for - * the same effect type but with a higher priority. Control is returned when the - * application having the control deletes its AudioEffect object. - * The EVENT_ENABLE_STATUS_CHANGED event is received by all applications not having the - * control of the effect engine when the effect is enabled or disabled. - * The EVENT_PARAMETER_CHANGED event is received by all applications not having the - * control of the effect engine when an effect parameter is changed. - * The EVENT_ERROR event is received when the media server process dies. - * - * Parameters: - * - * event: type of event notified (see enum AudioEffect::event_type). - * user: Pointer to context for use by the callback receiver. - * info: Pointer to optional parameter according to event type: - * - EVENT_CONTROL_STATUS_CHANGED: boolean indicating if control is granted (true) - * or stolen (false). - * - EVENT_ENABLE_STATUS_CHANGED: boolean indicating if effect is now enabled (true) - * or disabled (false). - * - EVENT_PARAMETER_CHANGED: pointer to a effect_param_t structure. - * - EVENT_ERROR: status_t indicating the error (DEAD_OBJECT when media server dies). - */ - - typedef void (*effect_callback_t)(int32_t event, void* user, void *info); - - - /* Constructor. - * AudioEffect is the base class for creating and controlling an effect engine from - * the application process. Creating an AudioEffect object will create the effect engine - * in the AudioFlinger if no engine of the specified type exists. If one exists, this engine - * will be used. The application creating the AudioEffect object (or a derived class like - * Reverb for instance) will either receive control of the effect engine or not, depending - * on the priority parameter. If priority is higher than the priority used by the current - * effect engine owner, the control will be transfered to the new application. Otherwise - * control will remain to the previous application. In this case, the new application will be - * notified of changes in effect engine state or control ownership by the effect callback. - * After creating the AudioEffect, the application must call the initCheck() method and - * check the creation status before trying to control the effect engine (see initCheck()). - * If the effect is to be applied to an AudioTrack or MediaPlayer only the application - * must specify the audio session ID corresponding to this player. - */ - - /* Simple Constructor. - */ - AudioEffect(); - - - /* Constructor. - * - * Parameters: - * - * type: type of effect created: can be null if uuid is specified. This corresponds to - * the OpenSL ES interface implemented by this effect. - * uuid: Uuid of effect created: can be null if type is specified. This uuid corresponds to - * a particular implementation of an effect type. - * priority: requested priority for effect control: the priority level corresponds to the - * value of priority parameter: negative values indicate lower priorities, positive values - * higher priorities, 0 being the normal priority. - * cbf: optional callback function (see effect_callback_t) - * user: pointer to context for use by the callback receiver. - * sessionID: audio session this effect is associated to. If 0, the effect will be global to - * the output mix. If not 0, the effect will be applied to all players - * (AudioTrack or MediaPLayer) within the same audio session. - * io: HAL audio output or input stream to which this effect must be attached. Leave at 0 for - * automatic output selection by AudioFlinger. - */ - - AudioEffect(const effect_uuid_t *type, - const effect_uuid_t *uuid = NULL, - int32_t priority = 0, - effect_callback_t cbf = NULL, - void* user = NULL, - int sessionId = 0, - audio_io_handle_t io = 0 - ); - - /* Constructor. - * Same as above but with type and uuid specified by character strings - */ - AudioEffect(const char *typeStr, - const char *uuidStr = NULL, - int32_t priority = 0, - effect_callback_t cbf = NULL, - void* user = NULL, - int sessionId = 0, - audio_io_handle_t io = 0 - ); - - /* Terminates the AudioEffect and unregisters it from AudioFlinger. - * The effect engine is also destroyed if this AudioEffect was the last controlling - * the engine. - */ - ~AudioEffect(); - - /* Initialize an uninitialized AudioEffect. - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR or ALREADY_EXISTS: successful initialization - * - INVALID_OPERATION: AudioEffect is already initialized - * - BAD_VALUE: invalid parameter - * - NO_INIT: audio flinger or audio hardware not initialized - * */ - status_t set(const effect_uuid_t *type, - const effect_uuid_t *uuid = NULL, - int32_t priority = 0, - effect_callback_t cbf = NULL, - void* user = NULL, - int sessionId = 0, - audio_io_handle_t io = 0 - ); - - /* Result of constructing the AudioEffect. This must be checked - * before using any AudioEffect API. - * initCheck() can return: - * - NO_ERROR: the effect engine is successfully created and the application has control. - * - ALREADY_EXISTS: the effect engine is successfully created but the application does not - * have control. - * - NO_INIT: the effect creation failed. - * - */ - status_t initCheck() const; - - - /* Returns the unique effect Id for the controlled effect engine. This ID is unique - * system wide and is used for instance in the case of auxiliary effects to attach - * the effect to an AudioTrack or MediaPlayer. - * - */ - int32_t id() const { return mId; } - - /* Returns a descriptor for the effect (see effect_descriptor_t in audio_effect.h). - */ - effect_descriptor_t descriptor() const; - - /* Returns effect control priority of this AudioEffect object. - */ - int32_t priority() const { return mPriority; } - - - /* Enables or disables the effect engine. - * - * Parameters: - * enabled: requested enable state. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the application does not have control of the effect engine or the - * effect is already in the requested state. - */ - virtual status_t setEnabled(bool enabled); - bool getEnabled() const; - - /* Sets a parameter value. - * - * Parameters: - * param: pointer to effect_param_t structure containing the parameter - * and its value (See audio_effect.h). - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation. - * - INVALID_OPERATION: the application does not have control of the effect engine. - * - BAD_VALUE: invalid parameter identifier or value. - * - DEAD_OBJECT: the effect engine has been deleted. - */ - virtual status_t setParameter(effect_param_t *param); - - /* Prepare a new parameter value that will be set by next call to - * setParameterCommit(). This method can be used to set multiple parameters - * in a synchronous manner or to avoid multiple binder calls for each - * parameter. - * - * Parameters: - * param: pointer to effect_param_t structure containing the parameter - * and its value (See audio_effect.h). - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation. - * - INVALID_OPERATION: the application does not have control of the effect engine. - * - NO_MEMORY: no more space available in shared memory used for deferred parameter - * setting. - */ - virtual status_t setParameterDeferred(effect_param_t *param); - - /* Commit all parameter values previously prepared by setParameterDeferred(). - * - * Parameters: - * none - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation. - * - INVALID_OPERATION: No new parameter values ready for commit. - * - BAD_VALUE: invalid parameter identifier or value: there is no indication - * as to which of the parameters caused this error. - * - DEAD_OBJECT: the effect engine has been deleted. - */ - virtual status_t setParameterCommit(); - - /* Gets a parameter value. - * - * Parameters: - * param: pointer to effect_param_t structure containing the parameter - * and the returned value (See audio_effect.h). - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation. - * - INVALID_OPERATION: the AudioEffect was not successfully initialized. - * - BAD_VALUE: invalid parameter identifier. - * - DEAD_OBJECT: the effect engine has been deleted. - */ - virtual status_t getParameter(effect_param_t *param); - - /* Sends a command and receives a response to/from effect engine. - * See audio_effect.h for details on effect command() function, valid command codes - * and formats. - */ - virtual status_t command(uint32_t cmdCode, - uint32_t cmdSize, - void *cmdData, - uint32_t *replySize, - void *replyData); - - - /* - * Utility functions. - */ - - /* Converts the string passed as first argument to the effect_uuid_t - * pointed to by second argument - */ - static status_t stringToGuid(const char *str, effect_uuid_t *guid); - /* Converts the effect_uuid_t pointed to by first argument to the - * string passed as second argument - */ - static status_t guidToString(const effect_uuid_t *guid, char *str, size_t maxLen); - -protected: - bool mEnabled; // enable state - int32_t mSessionId; // audio session ID - int32_t mPriority; // priority for effect control - status_t mStatus; // effect status - effect_callback_t mCbf; // callback function for status, control and - // parameter changes notifications - void* mUserData; // client context for callback function - effect_descriptor_t mDescriptor; // effect descriptor - int32_t mId; // system wide unique effect engine instance ID - Mutex mLock; // Mutex for mEnabled access - - // IEffectClient - virtual void controlStatusChanged(bool controlGranted); - virtual void enableStatusChanged(bool enabled); - virtual void commandExecuted(uint32_t cmdCode, - uint32_t cmdSize, - void *pCmdData, - uint32_t replySize, - void *pReplyData); - -private: - - // Implements the IEffectClient interface - class EffectClient : public android::BnEffectClient, public android::IBinder::DeathRecipient - { - public: - - EffectClient(AudioEffect *effect) : mEffect(effect){} - - // IEffectClient - virtual void controlStatusChanged(bool controlGranted) { - mEffect->controlStatusChanged(controlGranted); - } - virtual void enableStatusChanged(bool enabled) { - mEffect->enableStatusChanged(enabled); - } - virtual void commandExecuted(uint32_t cmdCode, - uint32_t cmdSize, - void *pCmdData, - uint32_t replySize, - void *pReplyData) { - mEffect->commandExecuted(cmdCode, cmdSize, pCmdData, replySize, pReplyData); - } - - // IBinder::DeathRecipient - virtual void binderDied(const wp& who) {mEffect->binderDied();} - - private: - AudioEffect *mEffect; - }; - - void binderDied(); - - sp mIEffect; // IEffect binder interface - sp mIEffectClient; // IEffectClient implementation - sp mCblkMemory; // shared memory for deferred parameter setting - effect_param_cblk_t* mCblk; // control block for deferred parameter setting -}; - - -}; // namespace android - -#endif // ANDROID_AUDIOEFFECT_H diff --git a/external/android/include/19/frameworks/av/include/media/AudioParameter.h b/external/android/include/19/frameworks/av/include/media/AudioParameter.h deleted file mode 100644 index 891bc4b..0000000 --- a/external/android/include/19/frameworks/av/include/media/AudioParameter.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2008-2011 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_AUDIOPARAMETER_H_ -#define ANDROID_AUDIOPARAMETER_H_ - -#include -#include -#include - -namespace android { - -class AudioParameter { - -public: - AudioParameter() {} - AudioParameter(const String8& keyValuePairs); - virtual ~AudioParameter(); - - // reserved parameter keys for changing standard parameters with setParameters() function. - // Using these keys is mandatory for AudioFlinger to properly monitor audio output/input - // configuration changes and act accordingly. - // keyRouting: to change audio routing, value is an int in audio_devices_t - // keySamplingRate: to change sampling rate routing, value is an int - // keyFormat: to change audio format, value is an int in audio_format_t - // keyChannels: to change audio channel configuration, value is an int in audio_channels_t - // keyFrameCount: to change audio output frame count, value is an int - // keyInputSource: to change audio input source, value is an int in audio_source_t - // (defined in media/mediarecorder.h) - // keyScreenState: either "on" or "off" - static const char * const keyRouting; - static const char * const keySamplingRate; - static const char * const keyFormat; - static const char * const keyChannels; - static const char * const keyFrameCount; - static const char * const keyInputSource; - static const char * const keyScreenState; - - String8 toString(); - - status_t add(const String8& key, const String8& value); - status_t addInt(const String8& key, const int value); - status_t addFloat(const String8& key, const float value); - - status_t remove(const String8& key); - - status_t get(const String8& key, String8& value); - status_t getInt(const String8& key, int& value); - status_t getFloat(const String8& key, float& value); - status_t getAt(size_t index, String8& key, String8& value); - - size_t size() { return mParameters.size(); } - -private: - String8 mKeyValuePairs; - KeyedVector mParameters; -}; - -}; // namespace android - -#endif /*ANDROID_AUDIOPARAMETER_H_*/ diff --git a/external/android/include/19/frameworks/av/include/media/AudioRecord.h b/external/android/include/19/frameworks/av/include/media/AudioRecord.h deleted file mode 100644 index 052064d..0000000 --- a/external/android/include/19/frameworks/av/include/media/AudioRecord.h +++ /dev/null @@ -1,512 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_AUDIORECORD_H -#define ANDROID_AUDIORECORD_H - -#include -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class audio_track_cblk_t; -class AudioRecordClientProxy; - -// ---------------------------------------------------------------------------- - -class AudioRecord : public RefBase -{ -public: - - /* Events used by AudioRecord callback function (callback_t). - * Keep in sync with frameworks/base/media/java/android/media/AudioRecord.java NATIVE_EVENT_*. - */ - enum event_type { - EVENT_MORE_DATA = 0, // Request to read more data from PCM buffer. - EVENT_OVERRUN = 1, // PCM buffer overrun occurred. - EVENT_MARKER = 2, // Record head is at the specified marker position - // (See setMarkerPosition()). - EVENT_NEW_POS = 3, // Record head is at a new position - // (See setPositionUpdatePeriod()). - EVENT_NEW_IAUDIORECORD = 4, // IAudioRecord was re-created, either due to re-routing and - // voluntary invalidation by mediaserver, or mediaserver crash. - }; - - /* Client should declare Buffer on the stack and pass address to obtainBuffer() - * and releaseBuffer(). See also callback_t for EVENT_MORE_DATA. - */ - - class Buffer - { - public: - // FIXME use m prefix - size_t frameCount; // number of sample frames corresponding to size; - // on input it is the number of frames available, - // on output is the number of frames actually drained - // (currently ignored, but will make the primary field in future) - - size_t size; // input/output in bytes == frameCount * frameSize - // FIXME this is redundant with respect to frameCount, - // and TRANSFER_OBTAIN mode is broken for 8-bit data - // since we don't define the frame format - - union { - void* raw; - short* i16; // signed 16-bit - int8_t* i8; // unsigned 8-bit, offset by 0x80 - }; - }; - - /* As a convenience, if a callback is supplied, a handler thread - * is automatically created with the appropriate priority. This thread - * invokes the callback when a new buffer becomes ready or various conditions occur. - * Parameters: - * - * event: type of event notified (see enum AudioRecord::event_type). - * user: Pointer to context for use by the callback receiver. - * info: Pointer to optional parameter according to event type: - * - EVENT_MORE_DATA: pointer to AudioRecord::Buffer struct. The callback must not read - * more bytes than indicated by 'size' field and update 'size' if fewer bytes are - * consumed. - * - EVENT_OVERRUN: unused. - * - EVENT_MARKER: pointer to const uint32_t containing the marker position in frames. - * - EVENT_NEW_POS: pointer to const uint32_t containing the new position in frames. - * - EVENT_NEW_IAUDIORECORD: unused. - */ - - typedef void (*callback_t)(int event, void* user, void *info); - - /* Returns the minimum frame count required for the successful creation of - * an AudioRecord object. - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - NO_INIT: audio server or audio hardware not initialized - * - BAD_VALUE: unsupported configuration - */ - - static status_t getMinFrameCount(size_t* frameCount, - uint32_t sampleRate, - audio_format_t format, - audio_channel_mask_t channelMask); - - /* How data is transferred from AudioRecord - */ - enum transfer_type { - TRANSFER_DEFAULT, // not specified explicitly; determine from other parameters - TRANSFER_CALLBACK, // callback EVENT_MORE_DATA - TRANSFER_OBTAIN, // FIXME deprecated: call obtainBuffer() and releaseBuffer() - TRANSFER_SYNC, // synchronous read() - }; - - /* Constructs an uninitialized AudioRecord. No connection with - * AudioFlinger takes place. Use set() after this. - */ - AudioRecord(); - - /* Creates an AudioRecord object and registers it with AudioFlinger. - * Once created, the track needs to be started before it can be used. - * Unspecified values are set to appropriate default values. - * - * Parameters: - * - * inputSource: Select the audio input to record from (e.g. AUDIO_SOURCE_DEFAULT). - * sampleRate: Data sink sampling rate in Hz. - * format: Audio format (e.g AUDIO_FORMAT_PCM_16_BIT for signed - * 16 bits per sample). - * channelMask: Channel mask, such that audio_is_input_channel(channelMask) is true. - * frameCount: Minimum size of track PCM buffer in frames. This defines the - * application's contribution to the - * latency of the track. The actual size selected by the AudioRecord could - * be larger if the requested size is not compatible with current audio HAL - * latency. Zero means to use a default value. - * cbf: Callback function. If not null, this function is called periodically - * to consume new PCM data and inform of marker, position updates, etc. - * user: Context for use by the callback receiver. - * notificationFrames: The callback function is called each time notificationFrames PCM - * frames are ready in record track output buffer. - * sessionId: Not yet supported. - * transferType: How data is transferred from AudioRecord. - * flags: See comments on audio_input_flags_t in - * threadCanCallJava: Not present in parameter list, and so is fixed at false. - */ - - AudioRecord(audio_source_t inputSource, - uint32_t sampleRate, - audio_format_t format, - audio_channel_mask_t channelMask, - int frameCount = 0, - callback_t cbf = NULL, - void* user = NULL, - int notificationFrames = 0, - int sessionId = 0, - transfer_type transferType = TRANSFER_DEFAULT, - audio_input_flags_t flags = AUDIO_INPUT_FLAG_NONE); - - /* Terminates the AudioRecord and unregisters it from AudioFlinger. - * Also destroys all resources associated with the AudioRecord. - */ -protected: - virtual ~AudioRecord(); -public: - - /* Initialize an AudioRecord that was created using the AudioRecord() constructor. - * Don't call set() more than once, or after an AudioRecord() constructor that takes parameters. - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful intialization - * - INVALID_OPERATION: AudioRecord is already initialized or record device is already in use - * - BAD_VALUE: invalid parameter (channels, format, sampleRate...) - * - NO_INIT: audio server or audio hardware not initialized - * - PERMISSION_DENIED: recording is not allowed for the requesting process - * - * Parameters not listed in the AudioRecord constructors above: - * - * threadCanCallJava: Whether callbacks are made from an attached thread and thus can call JNI. - */ - status_t set(audio_source_t inputSource, - uint32_t sampleRate, - audio_format_t format, - audio_channel_mask_t channelMask, - int frameCount = 0, - callback_t cbf = NULL, - void* user = NULL, - int notificationFrames = 0, - bool threadCanCallJava = false, - int sessionId = 0, - transfer_type transferType = TRANSFER_DEFAULT, - audio_input_flags_t flags = AUDIO_INPUT_FLAG_NONE); - - /* Result of constructing the AudioRecord. This must be checked - * before using any AudioRecord API (except for set()), because using - * an uninitialized AudioRecord produces undefined results. - * See set() method above for possible return codes. - */ - status_t initCheck() const { return mStatus; } - - /* Returns this track's estimated latency in milliseconds. - * This includes the latency due to AudioRecord buffer size, - * and audio hardware driver. - */ - uint32_t latency() const { return mLatency; } - - /* getters, see constructor and set() */ - - audio_format_t format() const { return mFormat; } - uint32_t channelCount() const { return mChannelCount; } - size_t frameCount() const { return mFrameCount; } - size_t frameSize() const { return mFrameSize; } - audio_source_t inputSource() const { return mInputSource; } - - /* After it's created the track is not active. Call start() to - * make it active. If set, the callback will start being called. - * If event is not AudioSystem::SYNC_EVENT_NONE, the capture start will be delayed until - * the specified event occurs on the specified trigger session. - */ - status_t start(AudioSystem::sync_event_t event = AudioSystem::SYNC_EVENT_NONE, - int triggerSession = 0); - - /* Stop a track. If set, the callback will cease being called. Note that obtainBuffer() still - * works and will drain buffers until the pool is exhausted, and then will return WOULD_BLOCK. - */ - void stop(); - bool stopped() const; - - /* Return the sink sample rate for this record track in Hz. - * Unlike AudioTrack, the sample rate is const after initialization, so doesn't need a lock. - */ - uint32_t getSampleRate() const { return mSampleRate; } - - /* Sets marker position. When record reaches the number of frames specified, - * a callback with event type EVENT_MARKER is called. Calling setMarkerPosition - * with marker == 0 cancels marker notification callback. - * To set a marker at a position which would compute as 0, - * a workaround is to the set the marker at a nearby position such as ~0 or 1. - * If the AudioRecord has been opened with no callback function associated, - * the operation will fail. - * - * Parameters: - * - * marker: marker position expressed in wrapping (overflow) frame units, - * like the return value of getPosition(). - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the AudioRecord has no callback installed. - */ - status_t setMarkerPosition(uint32_t marker); - status_t getMarkerPosition(uint32_t *marker) const; - - /* Sets position update period. Every time the number of frames specified has been recorded, - * a callback with event type EVENT_NEW_POS is called. - * Calling setPositionUpdatePeriod with updatePeriod == 0 cancels new position notification - * callback. - * If the AudioRecord has been opened with no callback function associated, - * the operation will fail. - * Extremely small values may be rounded up to a value the implementation can support. - * - * Parameters: - * - * updatePeriod: position update notification period expressed in frames. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the AudioRecord has no callback installed. - */ - status_t setPositionUpdatePeriod(uint32_t updatePeriod); - status_t getPositionUpdatePeriod(uint32_t *updatePeriod) const; - - /* Return the total number of frames recorded since recording started. - * The counter will wrap (overflow) periodically, e.g. every ~27 hours at 44.1 kHz. - * It is reset to zero by stop(). - * - * Parameters: - * - * position: Address where to return record head position. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - BAD_VALUE: position is NULL - */ - status_t getPosition(uint32_t *position) const; - - /* Returns a handle on the audio input used by this AudioRecord. - * - * Parameters: - * none. - * - * Returned value: - * handle on audio hardware input - */ - audio_io_handle_t getInput() const; - - /* Returns the audio session ID associated with this AudioRecord. - * - * Parameters: - * none. - * - * Returned value: - * AudioRecord session ID. - * - * No lock needed because session ID doesn't change after first set(). - */ - int getSessionId() const { return mSessionId; } - - /* Obtains a buffer of up to "audioBuffer->frameCount" full frames. - * After draining these frames of data, the caller should release them with releaseBuffer(). - * If the track buffer is not empty, obtainBuffer() returns as many contiguous - * full frames as are available immediately. - * If the track buffer is empty and track is stopped, obtainBuffer() returns WOULD_BLOCK - * regardless of the value of waitCount. - * If the track buffer is empty and track is not stopped, obtainBuffer() blocks with a - * maximum timeout based on waitCount; see chart below. - * Buffers will be returned until the pool - * is exhausted, at which point obtainBuffer() will either block - * or return WOULD_BLOCK depending on the value of the "waitCount" - * parameter. - * - * obtainBuffer() and releaseBuffer() are deprecated for direct use by applications, - * which should use read() or callback EVENT_MORE_DATA instead. - * - * Interpretation of waitCount: - * +n limits wait time to n * WAIT_PERIOD_MS, - * -1 causes an (almost) infinite wait time, - * 0 non-blocking. - * - * Buffer fields - * On entry: - * frameCount number of frames requested - * After error return: - * frameCount 0 - * size 0 - * raw undefined - * After successful return: - * frameCount actual number of frames available, <= number requested - * size actual number of bytes available - * raw pointer to the buffer - */ - - /* FIXME Deprecated public API for TRANSFER_OBTAIN mode */ - status_t obtainBuffer(Buffer* audioBuffer, int32_t waitCount) - __attribute__((__deprecated__)); - -private: - /* If nonContig is non-NULL, it is an output parameter that will be set to the number of - * additional non-contiguous frames that are available immediately. - * FIXME We could pass an array of Buffers instead of only one Buffer to obtainBuffer(), - * in case the requested amount of frames is in two or more non-contiguous regions. - * FIXME requested and elapsed are both relative times. Consider changing to absolute time. - */ - status_t obtainBuffer(Buffer* audioBuffer, const struct timespec *requested, - struct timespec *elapsed = NULL, size_t *nonContig = NULL); -public: - - /* Release an emptied buffer of "audioBuffer->frameCount" frames for AudioFlinger to re-fill. */ - // FIXME make private when obtainBuffer() for TRANSFER_OBTAIN is removed - void releaseBuffer(Buffer* audioBuffer); - - /* As a convenience we provide a read() interface to the audio buffer. - * Input parameter 'size' is in byte units. - * This is implemented on top of obtainBuffer/releaseBuffer. For best - * performance use callbacks. Returns actual number of bytes read >= 0, - * or one of the following negative status codes: - * INVALID_OPERATION AudioRecord is configured for streaming mode - * BAD_VALUE size is invalid - * WOULD_BLOCK when obtainBuffer() returns same, or - * AudioRecord was stopped during the read - * or any other error code returned by IAudioRecord::start() or restoreRecord_l(). - */ - ssize_t read(void* buffer, size_t size); - - /* Return the number of input frames lost in the audio driver since the last call of this - * function. Audio driver is expected to reset the value to 0 and restart counting upon - * returning the current value by this function call. Such loss typically occurs when the - * user space process is blocked longer than the capacity of audio driver buffers. - * Units: the number of input audio frames. - */ - unsigned int getInputFramesLost() const; - -private: - /* copying audio record objects is not allowed */ - AudioRecord(const AudioRecord& other); - AudioRecord& operator = (const AudioRecord& other); - - /* a small internal class to handle the callback */ - class AudioRecordThread : public Thread - { - public: - AudioRecordThread(AudioRecord& receiver, bool bCanCallJava = false); - - // Do not call Thread::requestExitAndWait() without first calling requestExit(). - // Thread::requestExitAndWait() is not virtual, and the implementation doesn't do enough. - virtual void requestExit(); - - void pause(); // suspend thread from execution at next loop boundary - void resume(); // allow thread to execute, if not requested to exit - - private: - void pauseInternal(nsecs_t ns = 0LL); - // like pause(), but only used internally within thread - - friend class AudioRecord; - virtual bool threadLoop(); - AudioRecord& mReceiver; - virtual ~AudioRecordThread(); - Mutex mMyLock; // Thread::mLock is private - Condition mMyCond; // Thread::mThreadExitedCondition is private - bool mPaused; // whether thread is requested to pause at next loop entry - bool mPausedInt; // whether thread internally requests pause - nsecs_t mPausedNs; // if mPausedInt then associated timeout, otherwise ignored - }; - - // body of AudioRecordThread::threadLoop() - // returns the maximum amount of time before we would like to run again, where: - // 0 immediately - // > 0 no later than this many nanoseconds from now - // NS_WHENEVER still active but no particular deadline - // NS_INACTIVE inactive so don't run again until re-started - // NS_NEVER never again - static const nsecs_t NS_WHENEVER = -1, NS_INACTIVE = -2, NS_NEVER = -3; - nsecs_t processAudioBuffer(const sp& thread); - - // caller must hold lock on mLock for all _l methods - status_t openRecord_l(size_t epoch); - - // FIXME enum is faster than strcmp() for parameter 'from' - status_t restoreRecord_l(const char *from); - - sp mAudioRecordThread; - mutable Mutex mLock; - - // Current client state: false = stopped, true = active. Protected by mLock. If more states - // are added, consider changing this to enum State { ... } mState as in AudioTrack. - bool mActive; - - // for client callback handler - callback_t mCbf; // callback handler for events, or NULL - void* mUserData; - - // for notification APIs - uint32_t mNotificationFramesReq; // requested number of frames between each - // notification callback - uint32_t mNotificationFramesAct; // actual number of frames between each - // notification callback - bool mRefreshRemaining; // processAudioBuffer() should refresh next 2 - - // These are private to processAudioBuffer(), and are not protected by a lock - uint32_t mRemainingFrames; // number of frames to request in obtainBuffer() - bool mRetryOnPartialBuffer; // sleep and retry after partial obtainBuffer() - int mObservedSequence; // last observed value of mSequence - - uint32_t mMarkerPosition; // in wrapping (overflow) frame units - bool mMarkerReached; - uint32_t mNewPosition; // in frames - uint32_t mUpdatePeriod; // in frames, zero means no EVENT_NEW_POS - - status_t mStatus; - - // constant after constructor or set() - uint32_t mSampleRate; - size_t mFrameCount; - audio_format_t mFormat; - uint32_t mChannelCount; - size_t mFrameSize; // app-level frame size == AudioFlinger frame size - audio_source_t mInputSource; - uint32_t mLatency; // in ms - audio_channel_mask_t mChannelMask; - audio_input_flags_t mFlags; - int mSessionId; - transfer_type mTransfer; - - audio_io_handle_t mInput; // returned by AudioSystem::getInput() - - // may be changed if IAudioRecord object is re-created - sp mAudioRecord; - sp mCblkMemory; - audio_track_cblk_t* mCblk; // re-load after mLock.unlock() - - int mPreviousPriority; // before start() - SchedPolicy mPreviousSchedulingGroup; - bool mAwaitBoost; // thread should wait for priority boost before running - - // The proxy should only be referenced while a lock is held because the proxy isn't - // multi-thread safe. - // An exception is that a blocking ClientProxy::obtainBuffer() may be called without a lock, - // provided that the caller also holds an extra reference to the proxy and shared memory to keep - // them around in case they are replaced during the obtainBuffer(). - sp mProxy; - - bool mInOverrun; // whether recorder is currently in overrun state - -private: - class DeathNotifier : public IBinder::DeathRecipient { - public: - DeathNotifier(AudioRecord* audioRecord) : mAudioRecord(audioRecord) { } - protected: - virtual void binderDied(const wp& who); - private: - const wp mAudioRecord; - }; - - sp mDeathNotifier; - uint32_t mSequence; // incremented for each new IAudioRecord attempt -}; - -}; // namespace android - -#endif // ANDROID_AUDIORECORD_H diff --git a/external/android/include/19/frameworks/av/include/media/AudioSystem.h b/external/android/include/19/frameworks/av/include/media/AudioSystem.h deleted file mode 100644 index 225ef76..0000000 --- a/external/android/include/19/frameworks/av/include/media/AudioSystem.h +++ /dev/null @@ -1,314 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_AUDIOSYSTEM_H_ -#define ANDROID_AUDIOSYSTEM_H_ - -#include -#include -#include -#include -#include -#include - -namespace android { - -typedef void (*audio_error_callback)(status_t err); - -class IAudioFlinger; -class IAudioPolicyService; -class String8; - -class AudioSystem -{ -public: - - /* These are static methods to control the system-wide AudioFlinger - * only privileged processes can have access to them - */ - - // mute/unmute microphone - static status_t muteMicrophone(bool state); - static status_t isMicrophoneMuted(bool *state); - - // set/get master volume - static status_t setMasterVolume(float value); - static status_t getMasterVolume(float* volume); - - // mute/unmute audio outputs - static status_t setMasterMute(bool mute); - static status_t getMasterMute(bool* mute); - - // set/get stream volume on specified output - static status_t setStreamVolume(audio_stream_type_t stream, float value, - audio_io_handle_t output); - static status_t getStreamVolume(audio_stream_type_t stream, float* volume, - audio_io_handle_t output); - - // mute/unmute stream - static status_t setStreamMute(audio_stream_type_t stream, bool mute); - static status_t getStreamMute(audio_stream_type_t stream, bool* mute); - - // set audio mode in audio hardware - static status_t setMode(audio_mode_t mode); - - // returns true in *state if tracks are active on the specified stream or have been active - // in the past inPastMs milliseconds - static status_t isStreamActive(audio_stream_type_t stream, bool *state, uint32_t inPastMs = 0); - // returns true in *state if tracks are active for what qualifies as remote playback - // on the specified stream or have been active in the past inPastMs milliseconds. Remote - // playback isn't mutually exclusive with local playback. - static status_t isStreamActiveRemotely(audio_stream_type_t stream, bool *state, - uint32_t inPastMs = 0); - // returns true in *state if a recorder is currently recording with the specified source - static status_t isSourceActive(audio_source_t source, bool *state); - - // set/get audio hardware parameters. The function accepts a list of parameters - // key value pairs in the form: key1=value1;key2=value2;... - // Some keys are reserved for standard parameters (See AudioParameter class). - static status_t setParameters(audio_io_handle_t ioHandle, const String8& keyValuePairs); - static String8 getParameters(audio_io_handle_t ioHandle, const String8& keys); - - static void setErrorCallback(audio_error_callback cb); - - // helper function to obtain AudioFlinger service handle - static const sp& get_audio_flinger(); - - static float linearToLog(int volume); - static int logToLinear(float volume); - - static status_t getOutputSamplingRate(uint32_t* samplingRate, - audio_stream_type_t stream = AUDIO_STREAM_DEFAULT); - static status_t getOutputFrameCount(size_t* frameCount, - audio_stream_type_t stream = AUDIO_STREAM_DEFAULT); - static status_t getOutputLatency(uint32_t* latency, - audio_stream_type_t stream = AUDIO_STREAM_DEFAULT); - static status_t getSamplingRate(audio_io_handle_t output, - audio_stream_type_t streamType, - uint32_t* samplingRate); - // returns the number of frames per audio HAL write buffer. Corresponds to - // audio_stream->get_buffer_size()/audio_stream_frame_size() - static status_t getFrameCount(audio_io_handle_t output, - audio_stream_type_t stream, - size_t* frameCount); - // returns the audio output stream latency in ms. Corresponds to - // audio_stream_out->get_latency() - static status_t getLatency(audio_io_handle_t output, - audio_stream_type_t stream, - uint32_t* latency); - - static bool routedToA2dpOutput(audio_stream_type_t streamType); - - static status_t getInputBufferSize(uint32_t sampleRate, audio_format_t format, - audio_channel_mask_t channelMask, size_t* buffSize); - - static status_t setVoiceVolume(float volume); - - // return the number of audio frames written by AudioFlinger to audio HAL and - // audio dsp to DAC since the output on which the specified stream is playing - // has exited standby. - // returned status (from utils/Errors.h) can be: - // - NO_ERROR: successful operation, halFrames and dspFrames point to valid data - // - INVALID_OPERATION: Not supported on current hardware platform - // - BAD_VALUE: invalid parameter - // NOTE: this feature is not supported on all hardware platforms and it is - // necessary to check returned status before using the returned values. - static status_t getRenderPosition(audio_io_handle_t output, - size_t *halFrames, - size_t *dspFrames, - audio_stream_type_t stream = AUDIO_STREAM_DEFAULT); - - // return the number of input frames lost by HAL implementation, or 0 if the handle is invalid - static size_t getInputFramesLost(audio_io_handle_t ioHandle); - - static int newAudioSessionId(); - static void acquireAudioSessionId(int audioSession); - static void releaseAudioSessionId(int audioSession); - - // types of io configuration change events received with ioConfigChanged() - enum io_config_event { - OUTPUT_OPENED, - OUTPUT_CLOSED, - OUTPUT_CONFIG_CHANGED, - INPUT_OPENED, - INPUT_CLOSED, - INPUT_CONFIG_CHANGED, - STREAM_CONFIG_CHANGED, - NUM_CONFIG_EVENTS - }; - - // audio output descriptor used to cache output configurations in client process to avoid - // frequent calls through IAudioFlinger - class OutputDescriptor { - public: - OutputDescriptor() - : samplingRate(0), format(AUDIO_FORMAT_DEFAULT), channelMask(0), frameCount(0), latency(0) {} - - uint32_t samplingRate; - audio_format_t format; - audio_channel_mask_t channelMask; - size_t frameCount; - uint32_t latency; - }; - - // Events used to synchronize actions between audio sessions. - // For instance SYNC_EVENT_PRESENTATION_COMPLETE can be used to delay recording start until - // playback is complete on another audio session. - // See definitions in MediaSyncEvent.java - enum sync_event_t { - SYNC_EVENT_SAME = -1, // used internally to indicate restart with same event - SYNC_EVENT_NONE = 0, - SYNC_EVENT_PRESENTATION_COMPLETE, - - // - // Define new events here: SYNC_EVENT_START, SYNC_EVENT_STOP, SYNC_EVENT_TIME ... - // - SYNC_EVENT_CNT, - }; - - // Timeout for synchronous record start. Prevents from blocking the record thread forever - // if the trigger event is not fired. - static const uint32_t kSyncRecordStartTimeOutMs = 30000; - - // - // IAudioPolicyService interface (see AudioPolicyInterface for method descriptions) - // - static status_t setDeviceConnectionState(audio_devices_t device, audio_policy_dev_state_t state, - const char *device_address); - static audio_policy_dev_state_t getDeviceConnectionState(audio_devices_t device, - const char *device_address); - static status_t setPhoneState(audio_mode_t state); - static status_t setForceUse(audio_policy_force_use_t usage, audio_policy_forced_cfg_t config); - static audio_policy_forced_cfg_t getForceUse(audio_policy_force_use_t usage); - static audio_io_handle_t getOutput(audio_stream_type_t stream, - uint32_t samplingRate = 0, - audio_format_t format = AUDIO_FORMAT_DEFAULT, - audio_channel_mask_t channelMask = AUDIO_CHANNEL_OUT_STEREO, - audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE, - const audio_offload_info_t *offloadInfo = NULL); - static status_t startOutput(audio_io_handle_t output, - audio_stream_type_t stream, - int session = 0); - static status_t stopOutput(audio_io_handle_t output, - audio_stream_type_t stream, - int session = 0); - static void releaseOutput(audio_io_handle_t output); - static audio_io_handle_t getInput(audio_source_t inputSource, - uint32_t samplingRate = 0, - audio_format_t format = AUDIO_FORMAT_DEFAULT, - audio_channel_mask_t channelMask = AUDIO_CHANNEL_IN_MONO, - int sessionId = 0); - static status_t startInput(audio_io_handle_t input); - static status_t stopInput(audio_io_handle_t input); - static void releaseInput(audio_io_handle_t input); - static status_t initStreamVolume(audio_stream_type_t stream, - int indexMin, - int indexMax); - static status_t setStreamVolumeIndex(audio_stream_type_t stream, - int index, - audio_devices_t device); - static status_t getStreamVolumeIndex(audio_stream_type_t stream, - int *index, - audio_devices_t device); - - static uint32_t getStrategyForStream(audio_stream_type_t stream); - static audio_devices_t getDevicesForStream(audio_stream_type_t stream); - - static audio_io_handle_t getOutputForEffect(const effect_descriptor_t *desc); - static status_t registerEffect(const effect_descriptor_t *desc, - audio_io_handle_t io, - uint32_t strategy, - int session, - int id); - static status_t unregisterEffect(int id); - static status_t setEffectEnabled(int id, bool enabled); - - // clear stream to output mapping cache (gStreamOutputMap) - // and output configuration cache (gOutputs) - static void clearAudioConfigCache(); - - static const sp& get_audio_policy_service(); - - // helpers for android.media.AudioManager.getProperty(), see description there for meaning - static uint32_t getPrimaryOutputSamplingRate(); - static size_t getPrimaryOutputFrameCount(); - - static status_t setLowRamDevice(bool isLowRamDevice); - - // Check if hw offload is possible for given format, stream type, sample rate, - // bit rate, duration, video and streaming or offload property is enabled - static bool isOffloadSupported(const audio_offload_info_t& info); - - // check presence of audio flinger service. - // returns NO_ERROR if binding to service succeeds, DEAD_OBJECT otherwise - static status_t checkAudioFlinger(); - // ---------------------------------------------------------------------------- - -private: - - class AudioFlingerClient: public IBinder::DeathRecipient, public BnAudioFlingerClient - { - public: - AudioFlingerClient() { - } - - // DeathRecipient - virtual void binderDied(const wp& who); - - // IAudioFlingerClient - - // indicate a change in the configuration of an output or input: keeps the cached - // values for output/input parameters up-to-date in client process - virtual void ioConfigChanged(int event, audio_io_handle_t ioHandle, const void *param2); - }; - - class AudioPolicyServiceClient: public IBinder::DeathRecipient - { - public: - AudioPolicyServiceClient() { - } - - // DeathRecipient - virtual void binderDied(const wp& who); - }; - - static sp gAudioFlingerClient; - static sp gAudioPolicyServiceClient; - friend class AudioFlingerClient; - friend class AudioPolicyServiceClient; - - static Mutex gLock; - static sp gAudioFlinger; - static audio_error_callback gAudioErrorCallback; - - static size_t gInBuffSize; - // previous parameters for recording buffer size queries - static uint32_t gPrevInSamplingRate; - static audio_format_t gPrevInFormat; - static audio_channel_mask_t gPrevInChannelMask; - - static sp gAudioPolicyService; - - // mapping between stream types and outputs - static DefaultKeyedVector gStreamOutputMap; - // list of output descriptors containing cached parameters - // (sampling rate, framecount, channel count...) - static DefaultKeyedVector gOutputs; -}; - -}; // namespace android - -#endif /*ANDROID_AUDIOSYSTEM_H_*/ diff --git a/external/android/include/19/frameworks/av/include/media/AudioTimestamp.h b/external/android/include/19/frameworks/av/include/media/AudioTimestamp.h deleted file mode 100644 index c29c7e5..0000000 --- a/external/android/include/19/frameworks/av/include/media/AudioTimestamp.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2013 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_AUDIO_TIMESTAMP_H -#define ANDROID_AUDIO_TIMESTAMP_H - -#include - -class AudioTimestamp { -public: - AudioTimestamp() : mPosition(0) { - mTime.tv_sec = 0; - mTime.tv_nsec = 0; - } - // FIXME change type to match android.media.AudioTrack - uint32_t mPosition; // a frame position in AudioTrack::getPosition() units - struct timespec mTime; // corresponding CLOCK_MONOTONIC when frame is expected to present -}; - -#endif // ANDROID_AUDIO_TIMESTAMP_H diff --git a/external/android/include/19/frameworks/av/include/media/AudioTrack.h b/external/android/include/19/frameworks/av/include/media/AudioTrack.h deleted file mode 100644 index f2f9c22..0000000 --- a/external/android/include/19/frameworks/av/include/media/AudioTrack.h +++ /dev/null @@ -1,781 +0,0 @@ -/* - * 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_AUDIOTRACK_H -#define ANDROID_AUDIOTRACK_H - -#include -#include -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class audio_track_cblk_t; -class AudioTrackClientProxy; -class StaticAudioTrackClientProxy; - -// ---------------------------------------------------------------------------- - -class AudioTrack : public RefBase -{ -public: - enum channel_index { - MONO = 0, - LEFT = 0, - RIGHT = 1 - }; - - /* Events used by AudioTrack callback function (callback_t). - * Keep in sync with frameworks/base/media/java/android/media/AudioTrack.java NATIVE_EVENT_*. - */ - enum event_type { - EVENT_MORE_DATA = 0, // Request to write more data to buffer. - // If this event is delivered but the callback handler - // does not want to write more data, the handler must explicitly - // ignore the event by setting frameCount to zero. - EVENT_UNDERRUN = 1, // Buffer underrun occurred. - EVENT_LOOP_END = 2, // Sample loop end was reached; playback restarted from - // loop start if loop count was not 0. - EVENT_MARKER = 3, // Playback head is at the specified marker position - // (See setMarkerPosition()). - EVENT_NEW_POS = 4, // Playback head is at a new position - // (See setPositionUpdatePeriod()). - EVENT_BUFFER_END = 5, // Playback head is at the end of the buffer. - // Not currently used by android.media.AudioTrack. - EVENT_NEW_IAUDIOTRACK = 6, // IAudioTrack was re-created, either due to re-routing and - // voluntary invalidation by mediaserver, or mediaserver crash. - EVENT_STREAM_END = 7, // Sent after all the buffers queued in AF and HW are played - // back (after stop is called) - EVENT_NEW_TIMESTAMP = 8, // Delivered periodically and when there's a significant change - // in the mapping from frame position to presentation time. - // See AudioTimestamp for the information included with event. - }; - - /* Client should declare Buffer on the stack and pass address to obtainBuffer() - * and releaseBuffer(). See also callback_t for EVENT_MORE_DATA. - */ - - class Buffer - { - public: - // FIXME use m prefix - size_t frameCount; // number of sample frames corresponding to size; - // on input it is the number of frames desired, - // on output is the number of frames actually filled - // (currently ignored, but will make the primary field in future) - - size_t size; // input/output in bytes == frameCount * frameSize - // on output is the number of bytes actually filled - // FIXME this is redundant with respect to frameCount, - // and TRANSFER_OBTAIN mode is broken for 8-bit data - // since we don't define the frame format - - union { - void* raw; - short* i16; // signed 16-bit - int8_t* i8; // unsigned 8-bit, offset by 0x80 - }; - }; - - /* As a convenience, if a callback is supplied, a handler thread - * is automatically created with the appropriate priority. This thread - * invokes the callback when a new buffer becomes available or various conditions occur. - * Parameters: - * - * event: type of event notified (see enum AudioTrack::event_type). - * user: Pointer to context for use by the callback receiver. - * info: Pointer to optional parameter according to event type: - * - EVENT_MORE_DATA: pointer to AudioTrack::Buffer struct. The callback must not write - * more bytes than indicated by 'size' field and update 'size' if fewer bytes are - * written. - * - EVENT_UNDERRUN: unused. - * - EVENT_LOOP_END: pointer to an int indicating the number of loops remaining. - * - EVENT_MARKER: pointer to const uint32_t containing the marker position in frames. - * - EVENT_NEW_POS: pointer to const uint32_t containing the new position in frames. - * - EVENT_BUFFER_END: unused. - * - EVENT_NEW_IAUDIOTRACK: unused. - * - EVENT_STREAM_END: unused. - * - EVENT_NEW_TIMESTAMP: pointer to const AudioTimestamp. - */ - - typedef void (*callback_t)(int event, void* user, void *info); - - /* Returns the minimum frame count required for the successful creation of - * an AudioTrack object. - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - NO_INIT: audio server or audio hardware not initialized - * - BAD_VALUE: unsupported configuration - */ - - static status_t getMinFrameCount(size_t* frameCount, - audio_stream_type_t streamType, - uint32_t sampleRate); - - /* How data is transferred to AudioTrack - */ - enum transfer_type { - TRANSFER_DEFAULT, // not specified explicitly; determine from the other parameters - TRANSFER_CALLBACK, // callback EVENT_MORE_DATA - TRANSFER_OBTAIN, // FIXME deprecated: call obtainBuffer() and releaseBuffer() - TRANSFER_SYNC, // synchronous write() - TRANSFER_SHARED, // shared memory - }; - - /* Constructs an uninitialized AudioTrack. No connection with - * AudioFlinger takes place. Use set() after this. - */ - AudioTrack(); - - /* Creates an AudioTrack object and registers it with AudioFlinger. - * Once created, the track needs to be started before it can be used. - * Unspecified values are set to appropriate default values. - * With this constructor, the track is configured for streaming mode. - * Data to be rendered is supplied by write() or by the callback EVENT_MORE_DATA. - * Intermixing a combination of write() and non-ignored EVENT_MORE_DATA is not allowed. - * - * Parameters: - * - * streamType: Select the type of audio stream this track is attached to - * (e.g. AUDIO_STREAM_MUSIC). - * sampleRate: Data source sampling rate in Hz. - * format: Audio format (e.g AUDIO_FORMAT_PCM_16_BIT for signed - * 16 bits per sample). - * channelMask: Channel mask. - * frameCount: Minimum size of track PCM buffer in frames. This defines the - * application's contribution to the - * latency of the track. The actual size selected by the AudioTrack could be - * larger if the requested size is not compatible with current audio HAL - * configuration. Zero means to use a default value. - * flags: See comments on audio_output_flags_t in . - * cbf: Callback function. If not null, this function is called periodically - * to provide new data and inform of marker, position updates, etc. - * user: Context for use by the callback receiver. - * notificationFrames: The callback function is called each time notificationFrames PCM - * frames have been consumed from track input buffer. - * This is expressed in units of frames at the initial source sample rate. - * sessionId: Specific session ID, or zero to use default. - * transferType: How data is transferred to AudioTrack. - * threadCanCallJava: Not present in parameter list, and so is fixed at false. - */ - - AudioTrack( audio_stream_type_t streamType, - uint32_t sampleRate, - audio_format_t format, - audio_channel_mask_t, - int frameCount = 0, - audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE, - callback_t cbf = NULL, - void* user = NULL, - int notificationFrames = 0, - int sessionId = 0, - transfer_type transferType = TRANSFER_DEFAULT, - const audio_offload_info_t *offloadInfo = NULL); - - /* Creates an audio track and registers it with AudioFlinger. - * With this constructor, the track is configured for static buffer mode. - * The format must not be 8-bit linear PCM. - * Data to be rendered is passed in a shared memory buffer - * identified by the argument sharedBuffer, which must be non-0. - * The memory should be initialized to the desired data before calling start(). - * The write() method is not supported in this case. - * It is recommended to pass a callback function to be notified of playback end by an - * EVENT_UNDERRUN event. - */ - - AudioTrack( audio_stream_type_t streamType, - uint32_t sampleRate, - audio_format_t format, - audio_channel_mask_t channelMask, - const sp& sharedBuffer, - audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE, - callback_t cbf = NULL, - void* user = NULL, - int notificationFrames = 0, - int sessionId = 0, - transfer_type transferType = TRANSFER_DEFAULT, - const audio_offload_info_t *offloadInfo = NULL); - - /* Terminates the AudioTrack and unregisters it from AudioFlinger. - * Also destroys all resources associated with the AudioTrack. - */ -protected: - virtual ~AudioTrack(); -public: - - /* Initialize an AudioTrack that was created using the AudioTrack() constructor. - * Don't call set() more than once, or after the AudioTrack() constructors that take parameters. - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful initialization - * - INVALID_OPERATION: AudioTrack is already initialized - * - BAD_VALUE: invalid parameter (channelMask, format, sampleRate...) - * - NO_INIT: audio server or audio hardware not initialized - * If status is not equal to NO_ERROR, don't call any other APIs on this AudioTrack. - * If sharedBuffer is non-0, the frameCount parameter is ignored and - * replaced by the shared buffer's total allocated size in frame units. - * - * Parameters not listed in the AudioTrack constructors above: - * - * threadCanCallJava: Whether callbacks are made from an attached thread and thus can call JNI. - */ - status_t set(audio_stream_type_t streamType, - uint32_t sampleRate, - audio_format_t format, - audio_channel_mask_t channelMask, - int frameCount = 0, - audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE, - callback_t cbf = NULL, - void* user = NULL, - int notificationFrames = 0, - const sp& sharedBuffer = 0, - bool threadCanCallJava = false, - int sessionId = 0, - transfer_type transferType = TRANSFER_DEFAULT, - const audio_offload_info_t *offloadInfo = NULL); - - /* Result of constructing the AudioTrack. This must be checked for successful initialization - * before using any AudioTrack API (except for set()), because using - * an uninitialized AudioTrack produces undefined results. - * See set() method above for possible return codes. - */ - status_t initCheck() const { return mStatus; } - - /* Returns this track's estimated latency in milliseconds. - * This includes the latency due to AudioTrack buffer size, AudioMixer (if any) - * and audio hardware driver. - */ - uint32_t latency() const { return mLatency; } - - /* getters, see constructors and set() */ - - audio_stream_type_t streamType() const { return mStreamType; } - audio_format_t format() const { return mFormat; } - - /* Return frame size in bytes, which for linear PCM is - * channelCount * (bit depth per channel / 8). - * channelCount is determined from channelMask, and bit depth comes from format. - * For non-linear formats, the frame size is typically 1 byte. - */ - size_t frameSize() const { return mFrameSize; } - - uint32_t channelCount() const { return mChannelCount; } - uint32_t frameCount() const { return mFrameCount; } - - /* Return the static buffer specified in constructor or set(), or 0 for streaming mode */ - sp sharedBuffer() const { return mSharedBuffer; } - - /* After it's created the track is not active. Call start() to - * make it active. If set, the callback will start being called. - * If the track was previously paused, volume is ramped up over the first mix buffer. - */ - status_t start(); - - /* Stop a track. - * In static buffer mode, the track is stopped immediately. - * In streaming mode, the callback will cease being called. Note that obtainBuffer() still - * works and will fill up buffers until the pool is exhausted, and then will return WOULD_BLOCK. - * In streaming mode the stop does not occur immediately: any data remaining in the buffer - * is first drained, mixed, and output, and only then is the track marked as stopped. - */ - void stop(); - bool stopped() const; - - /* Flush a stopped or paused track. All previously buffered data is discarded immediately. - * This has the effect of draining the buffers without mixing or output. - * Flush is intended for streaming mode, for example before switching to non-contiguous content. - * This function is a no-op if the track is not stopped or paused, or uses a static buffer. - */ - void flush(); - - /* Pause a track. After pause, the callback will cease being called and - * obtainBuffer returns WOULD_BLOCK. Note that obtainBuffer() still works - * and will fill up buffers until the pool is exhausted. - * Volume is ramped down over the next mix buffer following the pause request, - * and then the track is marked as paused. It can be resumed with ramp up by start(). - */ - void pause(); - - /* Set volume for this track, mostly used for games' sound effects - * left and right volumes. Levels must be >= 0.0 and <= 1.0. - * This is the older API. New applications should use setVolume(float) when possible. - */ - status_t setVolume(float left, float right); - - /* Set volume for all channels. This is the preferred API for new applications, - * especially for multi-channel content. - */ - status_t setVolume(float volume); - - /* Set the send level for this track. An auxiliary effect should be attached - * to the track with attachEffect(). Level must be >= 0.0 and <= 1.0. - */ - status_t setAuxEffectSendLevel(float level); - void getAuxEffectSendLevel(float* level) const; - - /* Set source sample rate for this track in Hz, mostly used for games' sound effects - */ - status_t setSampleRate(uint32_t sampleRate); - - /* Return current source sample rate in Hz, or 0 if unknown */ - uint32_t getSampleRate() const; - - /* Enables looping and sets the start and end points of looping. - * Only supported for static buffer mode. - * - * Parameters: - * - * loopStart: loop start in frames relative to start of buffer. - * loopEnd: loop end in frames relative to start of buffer. - * loopCount: number of loops to execute. Calling setLoop() with loopCount == 0 cancels any - * pending or active loop. loopCount == -1 means infinite looping. - * - * For proper operation the following condition must be respected: - * loopCount != 0 implies 0 <= loopStart < loopEnd <= frameCount(). - * - * If the loop period (loopEnd - loopStart) is too small for the implementation to support, - * setLoop() will return BAD_VALUE. loopCount must be >= -1. - * - */ - status_t setLoop(uint32_t loopStart, uint32_t loopEnd, int loopCount); - - /* Sets marker position. When playback reaches the number of frames specified, a callback with - * event type EVENT_MARKER is called. Calling setMarkerPosition with marker == 0 cancels marker - * notification callback. To set a marker at a position which would compute as 0, - * a workaround is to the set the marker at a nearby position such as ~0 or 1. - * If the AudioTrack has been opened with no callback function associated, the operation will - * fail. - * - * Parameters: - * - * marker: marker position expressed in wrapping (overflow) frame units, - * like the return value of getPosition(). - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the AudioTrack has no callback installed. - */ - status_t setMarkerPosition(uint32_t marker); - status_t getMarkerPosition(uint32_t *marker) const; - - /* Sets position update period. Every time the number of frames specified has been played, - * a callback with event type EVENT_NEW_POS is called. - * Calling setPositionUpdatePeriod with updatePeriod == 0 cancels new position notification - * callback. - * If the AudioTrack has been opened with no callback function associated, the operation will - * fail. - * Extremely small values may be rounded up to a value the implementation can support. - * - * Parameters: - * - * updatePeriod: position update notification period expressed in frames. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the AudioTrack has no callback installed. - */ - status_t setPositionUpdatePeriod(uint32_t updatePeriod); - status_t getPositionUpdatePeriod(uint32_t *updatePeriod) const; - - /* Sets playback head position. - * Only supported for static buffer mode. - * - * Parameters: - * - * position: New playback head position in frames relative to start of buffer. - * 0 <= position <= frameCount(). Note that end of buffer is permitted, - * but will result in an immediate underrun if started. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the AudioTrack is not stopped or paused, or is streaming mode. - * - BAD_VALUE: The specified position is beyond the number of frames present in AudioTrack - * buffer - */ - status_t setPosition(uint32_t position); - - /* Return the total number of frames played since playback start. - * The counter will wrap (overflow) periodically, e.g. every ~27 hours at 44.1 kHz. - * It is reset to zero by flush(), reload(), and stop(). - * - * Parameters: - * - * position: Address where to return play head position. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - BAD_VALUE: position is NULL - */ - status_t getPosition(uint32_t *position) const; - - /* For static buffer mode only, this returns the current playback position in frames - * relative to start of buffer. It is analogous to the position units used by - * setLoop() and setPosition(). After underrun, the position will be at end of buffer. - */ - status_t getBufferPosition(uint32_t *position); - - /* Forces AudioTrack buffer full condition. When playing a static buffer, this method avoids - * rewriting the buffer before restarting playback after a stop. - * This method must be called with the AudioTrack in paused or stopped state. - * Not allowed in streaming mode. - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the AudioTrack is not stopped or paused, or is streaming mode. - */ - status_t reload(); - - /* Returns a handle on the audio output used by this AudioTrack. - * - * Parameters: - * none. - * - * Returned value: - * handle on audio hardware output - */ - audio_io_handle_t getOutput(); - - /* Returns the unique session ID associated with this track. - * - * Parameters: - * none. - * - * Returned value: - * AudioTrack session ID. - */ - int getSessionId() const { return mSessionId; } - - /* Attach track auxiliary output to specified effect. Use effectId = 0 - * to detach track from effect. - * - * Parameters: - * - * effectId: effectId obtained from AudioEffect::id(). - * - * Returned status (from utils/Errors.h) can be: - * - NO_ERROR: successful operation - * - INVALID_OPERATION: the effect is not an auxiliary effect. - * - BAD_VALUE: The specified effect ID is invalid - */ - status_t attachAuxEffect(int effectId); - - /* Obtains a buffer of up to "audioBuffer->frameCount" empty slots for frames. - * After filling these slots with data, the caller should release them with releaseBuffer(). - * If the track buffer is not full, obtainBuffer() returns as many contiguous - * [empty slots for] frames as are available immediately. - * If the track buffer is full and track is stopped, obtainBuffer() returns WOULD_BLOCK - * regardless of the value of waitCount. - * If the track buffer is full and track is not stopped, obtainBuffer() blocks with a - * maximum timeout based on waitCount; see chart below. - * Buffers will be returned until the pool - * is exhausted, at which point obtainBuffer() will either block - * or return WOULD_BLOCK depending on the value of the "waitCount" - * parameter. - * Each sample is 16-bit signed PCM. - * - * obtainBuffer() and releaseBuffer() are deprecated for direct use by applications, - * which should use write() or callback EVENT_MORE_DATA instead. - * - * Interpretation of waitCount: - * +n limits wait time to n * WAIT_PERIOD_MS, - * -1 causes an (almost) infinite wait time, - * 0 non-blocking. - * - * Buffer fields - * On entry: - * frameCount number of frames requested - * After error return: - * frameCount 0 - * size 0 - * raw undefined - * After successful return: - * frameCount actual number of frames available, <= number requested - * size actual number of bytes available - * raw pointer to the buffer - */ - - /* FIXME Deprecated public API for TRANSFER_OBTAIN mode */ - status_t obtainBuffer(Buffer* audioBuffer, int32_t waitCount) - __attribute__((__deprecated__)); - -private: - /* If nonContig is non-NULL, it is an output parameter that will be set to the number of - * additional non-contiguous frames that are available immediately. - * FIXME We could pass an array of Buffers instead of only one Buffer to obtainBuffer(), - * in case the requested amount of frames is in two or more non-contiguous regions. - * FIXME requested and elapsed are both relative times. Consider changing to absolute time. - */ - status_t obtainBuffer(Buffer* audioBuffer, const struct timespec *requested, - struct timespec *elapsed = NULL, size_t *nonContig = NULL); -public: - -//EL_FIXME to be reconciled with new obtainBuffer() return codes and control block proxy -// enum { -// NO_MORE_BUFFERS = 0x80000001, // same name in AudioFlinger.h, ok to be different value -// TEAR_DOWN = 0x80000002, -// STOPPED = 1, -// STREAM_END_WAIT, -// STREAM_END -// }; - - /* Release a filled buffer of "audioBuffer->frameCount" frames for AudioFlinger to process. */ - // FIXME make private when obtainBuffer() for TRANSFER_OBTAIN is removed - void releaseBuffer(Buffer* audioBuffer); - - /* As a convenience we provide a write() interface to the audio buffer. - * Input parameter 'size' is in byte units. - * This is implemented on top of obtainBuffer/releaseBuffer. For best - * performance use callbacks. Returns actual number of bytes written >= 0, - * or one of the following negative status codes: - * INVALID_OPERATION AudioTrack is configured for static buffer or streaming mode - * BAD_VALUE size is invalid - * WOULD_BLOCK when obtainBuffer() returns same, or - * AudioTrack was stopped during the write - * or any other error code returned by IAudioTrack::start() or restoreTrack_l(). - */ - ssize_t write(const void* buffer, size_t size); - - /* - * Dumps the state of an audio track. - */ - status_t dump(int fd, const Vector& args) const; - - /* - * Return the total number of frames which AudioFlinger desired but were unavailable, - * and thus which resulted in an underrun. Reset to zero by stop(). - */ - uint32_t getUnderrunFrames() const; - - /* Get the flags */ - audio_output_flags_t getFlags() const { return mFlags; } - - /* Set parameters - only possible when using direct output */ - status_t setParameters(const String8& keyValuePairs); - - /* Get parameters */ - String8 getParameters(const String8& keys); - - /* Poll for a timestamp on demand. - * Use if EVENT_NEW_TIMESTAMP is not delivered often enough for your needs, - * or if you need to get the most recent timestamp outside of the event callback handler. - * Caution: calling this method too often may be inefficient; - * if you need a high resolution mapping between frame position and presentation time, - * consider implementing that at application level, based on the low resolution timestamps. - * Returns NO_ERROR if timestamp is valid. - */ - status_t getTimestamp(AudioTimestamp& timestamp); - -protected: - /* copying audio tracks is not allowed */ - AudioTrack(const AudioTrack& other); - AudioTrack& operator = (const AudioTrack& other); - - /* a small internal class to handle the callback */ - class AudioTrackThread : public Thread - { - public: - AudioTrackThread(AudioTrack& receiver, bool bCanCallJava = false); - - // Do not call Thread::requestExitAndWait() without first calling requestExit(). - // Thread::requestExitAndWait() is not virtual, and the implementation doesn't do enough. - virtual void requestExit(); - - void pause(); // suspend thread from execution at next loop boundary - void resume(); // allow thread to execute, if not requested to exit - - private: - void pauseInternal(nsecs_t ns = 0LL); - // like pause(), but only used internally within thread - - friend class AudioTrack; - virtual bool threadLoop(); - AudioTrack& mReceiver; - virtual ~AudioTrackThread(); - Mutex mMyLock; // Thread::mLock is private - Condition mMyCond; // Thread::mThreadExitedCondition is private - bool mPaused; // whether thread is requested to pause at next loop entry - bool mPausedInt; // whether thread internally requests pause - nsecs_t mPausedNs; // if mPausedInt then associated timeout, otherwise ignored - bool mIgnoreNextPausedInt; // whether to ignore next mPausedInt request - }; - - // body of AudioTrackThread::threadLoop() - // returns the maximum amount of time before we would like to run again, where: - // 0 immediately - // > 0 no later than this many nanoseconds from now - // NS_WHENEVER still active but no particular deadline - // NS_INACTIVE inactive so don't run again until re-started - // NS_NEVER never again - static const nsecs_t NS_WHENEVER = -1, NS_INACTIVE = -2, NS_NEVER = -3; - nsecs_t processAudioBuffer(const sp& thread); - status_t processStreamEnd(int32_t waitCount); - - - // caller must hold lock on mLock for all _l methods - - status_t createTrack_l(audio_stream_type_t streamType, - uint32_t sampleRate, - audio_format_t format, - size_t frameCount, - audio_output_flags_t flags, - const sp& sharedBuffer, - audio_io_handle_t output, - size_t epoch); - - // can only be called when mState != STATE_ACTIVE - void flush_l(); - - void setLoop_l(uint32_t loopStart, uint32_t loopEnd, int loopCount); - audio_io_handle_t getOutput_l(); - - // FIXME enum is faster than strcmp() for parameter 'from' - status_t restoreTrack_l(const char *from); - - bool isOffloaded() const - { return (mFlags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) != 0; } - - // Next 3 fields may be changed if IAudioTrack is re-created, but always != 0 - sp mAudioTrack; - sp mCblkMemory; - audio_track_cblk_t* mCblk; // re-load after mLock.unlock() - - sp mAudioTrackThread; - float mVolume[2]; - float mSendLevel; - uint32_t mSampleRate; - size_t mFrameCount; // corresponds to current IAudioTrack - size_t mReqFrameCount; // frame count to request the next time a new - // IAudioTrack is needed - - - // constant after constructor or set() - audio_format_t mFormat; // as requested by client, not forced to 16-bit - audio_stream_type_t mStreamType; - uint32_t mChannelCount; - audio_channel_mask_t mChannelMask; - transfer_type mTransfer; - - // mFrameSize is equal to mFrameSizeAF for non-PCM or 16-bit PCM data. For 8-bit PCM data, it's - // twice as large as mFrameSize because data is expanded to 16-bit before it's stored in buffer. - size_t mFrameSize; // app-level frame size - size_t mFrameSizeAF; // AudioFlinger frame size - - status_t mStatus; - - // can change dynamically when IAudioTrack invalidated - uint32_t mLatency; // in ms - - // Indicates the current track state. Protected by mLock. - enum State { - STATE_ACTIVE, - STATE_STOPPED, - STATE_PAUSED, - STATE_PAUSED_STOPPING, - STATE_FLUSHED, - STATE_STOPPING, - } mState; - - // for client callback handler - callback_t mCbf; // callback handler for events, or NULL - void* mUserData; - - // for notification APIs - uint32_t mNotificationFramesReq; // requested number of frames between each - // notification callback, - // at initial source sample rate - uint32_t mNotificationFramesAct; // actual number of frames between each - // notification callback, - // at initial source sample rate - bool mRefreshRemaining; // processAudioBuffer() should refresh next 2 - - // These are private to processAudioBuffer(), and are not protected by a lock - uint32_t mRemainingFrames; // number of frames to request in obtainBuffer() - bool mRetryOnPartialBuffer; // sleep and retry after partial obtainBuffer() - uint32_t mObservedSequence; // last observed value of mSequence - - sp mSharedBuffer; - uint32_t mLoopPeriod; // in frames, zero means looping is disabled - uint32_t mMarkerPosition; // in wrapping (overflow) frame units - bool mMarkerReached; - uint32_t mNewPosition; // in frames - uint32_t mUpdatePeriod; // in frames, zero means no EVENT_NEW_POS - - audio_output_flags_t mFlags; - int mSessionId; - int mAuxEffectId; - - mutable Mutex mLock; - - bool mIsTimed; - int mPreviousPriority; // before start() - SchedPolicy mPreviousSchedulingGroup; - bool mAwaitBoost; // thread should wait for priority boost before running - - // The proxy should only be referenced while a lock is held because the proxy isn't - // multi-thread safe, especially the SingleStateQueue part of the proxy. - // An exception is that a blocking ClientProxy::obtainBuffer() may be called without a lock, - // provided that the caller also holds an extra reference to the proxy and shared memory to keep - // them around in case they are replaced during the obtainBuffer(). - sp mStaticProxy; // for type safety only - sp mProxy; // primary owner of the memory - - bool mInUnderrun; // whether track is currently in underrun state - String8 mName; // server's name for this IAudioTrack - -private: - class DeathNotifier : public IBinder::DeathRecipient { - public: - DeathNotifier(AudioTrack* audioTrack) : mAudioTrack(audioTrack) { } - protected: - virtual void binderDied(const wp& who); - private: - const wp mAudioTrack; - }; - - sp mDeathNotifier; - uint32_t mSequence; // incremented for each new IAudioTrack attempt - audio_io_handle_t mOutput; // cached output io handle -}; - -class TimedAudioTrack : public AudioTrack -{ -public: - TimedAudioTrack(); - - /* allocate a shared memory buffer that can be passed to queueTimedBuffer */ - status_t allocateTimedBuffer(size_t size, sp* buffer); - - /* queue a buffer obtained via allocateTimedBuffer for playback at the - given timestamp. PTS units are microseconds on the media time timeline. - The media time transform (set with setMediaTimeTransform) set by the - audio producer will handle converting from media time to local time - (perhaps going through the common time timeline in the case of - synchronized multiroom audio case) */ - status_t queueTimedBuffer(const sp& buffer, int64_t pts); - - /* define a transform between media time and either common time or - local time */ - enum TargetTimeline {LOCAL_TIME, COMMON_TIME}; - status_t setMediaTimeTransform(const LinearTransform& xform, - TargetTimeline target); -}; - -}; // namespace android - -#endif // ANDROID_AUDIOTRACK_H diff --git a/external/android/include/19/frameworks/av/include/media/EffectsFactoryApi.h b/external/android/include/19/frameworks/av/include/media/EffectsFactoryApi.h deleted file mode 100644 index b1143b9..0000000 --- a/external/android/include/19/frameworks/av/include/media/EffectsFactoryApi.h +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (C) 2010 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_EFFECTSFACTORYAPI_H_ -#define ANDROID_EFFECTSFACTORYAPI_H_ - -#include -#include -#include -#include - -#if __cplusplus -extern "C" { -#endif - -///////////////////////////////////////////////// -// Effect factory interface -///////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectQueryNumberEffects -// -// Description: Returns the number of different effects in all loaded libraries. -// Each effect must have a different effect uuid (see -// effect_descriptor_t). This function together with EffectQueryEffect() -// is used to enumerate all effects present in all loaded libraries. -// Each time EffectQueryNumberEffects() is called, the factory must -// reset the index of the effect descriptor returned by next call to -// EffectQueryEffect() to restart enumeration from the beginning. -// -// Input/Output: -// pNumEffects: address where the number of effects should be returned. -// -// Output: -// returned value: 0 successful operation. -// -ENODEV factory failed to initialize -// -EINVAL invalid pNumEffects -// *pNumEffects: updated with number of effects in factory -// -//////////////////////////////////////////////////////////////////////////////// -int EffectQueryNumberEffects(uint32_t *pNumEffects); - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectQueryEffect -// -// Description: Returns a descriptor of the next available effect. -// See effect_descriptor_t for a details on effect descriptor. -// This function together with EffectQueryNumberEffects() is used to enumerate all -// effects present in all loaded libraries. The enumeration sequence is: -// EffectQueryNumberEffects(&num_effects); -// for (i = 0; i < num_effects; i++) -// EffectQueryEffect(i,...); -// -// Input/Output: -// pDescriptor: address where to return the effect descriptor. -// -// Output: -// returned value: 0 successful operation. -// -ENOENT no more effect available -// -ENODEV factory failed to initialize -// -EINVAL invalid pDescriptor -// -ENOSYS effect list has changed since last execution of -// EffectQueryNumberEffects() -// *pDescriptor: updated with the effect descriptor. -// -//////////////////////////////////////////////////////////////////////////////// -int EffectQueryEffect(uint32_t index, effect_descriptor_t *pDescriptor); - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectCreate -// -// Description: Creates an effect engine of the specified type and returns an -// effect control interface on this engine. The function will allocate the -// resources for an instance of the requested effect engine and return -// a handle on the effect control interface. -// -// Input: -// pEffectUuid: pointer to the effect uuid. -// sessionId: audio session to which this effect instance will be attached. All effects -// created with the same session ID are connected in series and process the same signal -// stream. Knowing that two effects are part of the same effect chain can help the -// library implement some kind of optimizations. -// ioId: identifies the output or input stream this effect is directed to at audio HAL. -// For future use especially with tunneled HW accelerated effects -// -// Input/Output: -// pHandle: address where to return the effect handle. -// -// Output: -// returned value: 0 successful operation. -// -ENODEV factory failed to initialize -// -EINVAL invalid pEffectUuid or pHandle -// -ENOENT no effect with this uuid found -// *pHandle: updated with the effect handle. -// -//////////////////////////////////////////////////////////////////////////////// -int EffectCreate(const effect_uuid_t *pEffectUuid, int32_t sessionId, int32_t ioId, - effect_handle_t *pHandle); - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectRelease -// -// Description: Releases the effect engine whose handle is given as argument. -// All resources allocated to this particular instance of the effect are -// released. -// -// Input: -// handle: handle on the effect interface to be released. -// -// Output: -// returned value: 0 successful operation. -// -ENODEV factory failed to initialize -// -EINVAL invalid interface handle -// -//////////////////////////////////////////////////////////////////////////////// -int EffectRelease(effect_handle_t handle); - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectGetDescriptor -// -// Description: Returns the descriptor of the effect which uuid is pointed -// to by first argument. -// -// Input: -// pEffectUuid: pointer to the effect uuid. -// -// Input/Output: -// pDescriptor: address where to return the effect descriptor. -// -// Output: -// returned value: 0 successful operation. -// -ENODEV factory failed to initialize -// -EINVAL invalid pEffectUuid or pDescriptor -// -ENOENT no effect with this uuid found -// *pDescriptor: updated with the effect descriptor. -// -//////////////////////////////////////////////////////////////////////////////// -int EffectGetDescriptor(const effect_uuid_t *pEffectUuid, effect_descriptor_t *pDescriptor); - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectIsNullUuid -// -// Description: Helper function to compare effect uuid to EFFECT_UUID_NULL -// -// Input: -// pEffectUuid: pointer to effect uuid to compare to EFFECT_UUID_NULL. -// -// Output: -// returned value: 0 if uuid is different from EFFECT_UUID_NULL. -// 1 if uuid is equal to EFFECT_UUID_NULL. -// -//////////////////////////////////////////////////////////////////////////////// -int EffectIsNullUuid(const effect_uuid_t *pEffectUuid); - -//////////////////////////////////////////////////////////////////////////////// -// -// Function: EffectGetSubEffects -// -// Description: Returns the descriptors of the sub effects of the effect -// whose uuid is pointed to by first argument. -// -// Input: -// pEffectUuid: pointer to the effect uuid. -// size: size of the buffer pointed by pDescriptor. -// -// Input/Output: -// pDescriptor: address where to return the sub effect descriptors. -// -// Output: -// returned value: 0 successful operation. -// -ENODEV factory failed to initialize -// -EINVAL invalid pEffectUuid or pDescriptor -// -ENOENT no effect with this uuid found -// *pDescriptor: updated with the sub effect descriptors. -// -//////////////////////////////////////////////////////////////////////////////// -int EffectGetSubEffects(const effect_uuid_t *pEffectUuid, effect_descriptor_t *pDescriptors, size_t size); - -#if __cplusplus -} // extern "C" -#endif - - -#endif /*ANDROID_EFFECTSFACTORYAPI_H_*/ diff --git a/external/android/include/19/frameworks/av/include/media/ExtendedAudioBufferProvider.h b/external/android/include/19/frameworks/av/include/media/ExtendedAudioBufferProvider.h deleted file mode 100644 index 2539ed3..0000000 --- a/external/android/include/19/frameworks/av/include/media/ExtendedAudioBufferProvider.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2012 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_EXTENDED_AUDIO_BUFFER_PROVIDER_H -#define ANDROID_EXTENDED_AUDIO_BUFFER_PROVIDER_H - -#include -#include - -namespace android { - -class ExtendedAudioBufferProvider : public AudioBufferProvider { -public: - virtual size_t framesReady() const = 0; // see description at AudioFlinger.h - - // Return the total number of frames that have been obtained and released - virtual size_t framesReleased() const { return 0; } - - // Invoked by buffer consumer when a new timestamp is available. - // Default implementation ignores the timestamp. - virtual void onTimestamp(const AudioTimestamp& timestamp) { } -}; - -} // namespace android - -#endif // ANDROID_EXTENDED_AUDIO_BUFFER_PROVIDER_H diff --git a/external/android/include/19/frameworks/av/include/media/IAudioFlinger.h b/external/android/include/19/frameworks/av/include/media/IAudioFlinger.h deleted file mode 100644 index eaf7780..0000000 --- a/external/android/include/19/frameworks/av/include/media/IAudioFlinger.h +++ /dev/null @@ -1,229 +0,0 @@ -/* - * 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_IAUDIOFLINGER_H -#define ANDROID_IAUDIOFLINGER_H - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class IAudioFlinger : public IInterface -{ -public: - DECLARE_META_INTERFACE(AudioFlinger); - - // or-able bits shared by createTrack and openRecord, but not all combinations make sense - enum { - TRACK_DEFAULT = 0, // client requests a default AudioTrack - TRACK_TIMED = 1, // client requests a TimedAudioTrack - TRACK_FAST = 2, // client requests a fast AudioTrack or AudioRecord - TRACK_OFFLOAD = 4, // client requests offload to hw codec - }; - typedef uint32_t track_flags_t; - - // invariant on exit for all APIs that return an sp<>: - // (return value != 0) == (*status == NO_ERROR) - - /* create an audio track and registers it with AudioFlinger. - * return null if the track cannot be created. - */ - virtual sp createTrack( - audio_stream_type_t streamType, - uint32_t sampleRate, - audio_format_t format, - audio_channel_mask_t channelMask, - size_t frameCount, - track_flags_t *flags, - const sp& sharedBuffer, - audio_io_handle_t output, - pid_t tid, // -1 means unused, otherwise must be valid non-0 - int *sessionId, - // input: ignored - // output: server's description of IAudioTrack for display in logs. - // Don't attempt to parse, as the format could change. - String8& name, - status_t *status) = 0; - - virtual sp openRecord( - audio_io_handle_t input, - uint32_t sampleRate, - audio_format_t format, - audio_channel_mask_t channelMask, - size_t frameCount, - track_flags_t *flags, - pid_t tid, // -1 means unused, otherwise must be valid non-0 - int *sessionId, - status_t *status) = 0; - - /* query the audio hardware state. This state never changes, - * and therefore can be cached. - */ - virtual uint32_t sampleRate(audio_io_handle_t output) const = 0; -#if 0 - virtual int channelCount(audio_io_handle_t output) const = 0; -#endif - virtual audio_format_t format(audio_io_handle_t output) const = 0; - virtual size_t frameCount(audio_io_handle_t output) const = 0; - - // return estimated latency in milliseconds - virtual uint32_t latency(audio_io_handle_t output) const = 0; - - /* set/get the audio hardware state. This will probably be used by - * the preference panel, mostly. - */ - virtual status_t setMasterVolume(float value) = 0; - virtual status_t setMasterMute(bool muted) = 0; - - virtual float masterVolume() const = 0; - virtual bool masterMute() const = 0; - - /* set/get stream type state. This will probably be used by - * the preference panel, mostly. - */ - virtual status_t setStreamVolume(audio_stream_type_t stream, float value, - audio_io_handle_t output) = 0; - virtual status_t setStreamMute(audio_stream_type_t stream, bool muted) = 0; - - virtual float streamVolume(audio_stream_type_t stream, - audio_io_handle_t output) const = 0; - virtual bool streamMute(audio_stream_type_t stream) const = 0; - - // set audio mode - virtual status_t setMode(audio_mode_t mode) = 0; - - // mic mute/state - virtual status_t setMicMute(bool state) = 0; - virtual bool getMicMute() const = 0; - - virtual status_t setParameters(audio_io_handle_t ioHandle, - const String8& keyValuePairs) = 0; - virtual String8 getParameters(audio_io_handle_t ioHandle, const String8& keys) - const = 0; - - // Register an object to receive audio input/output change and track notifications. - // For a given calling pid, AudioFlinger disregards any registrations after the first. - // Thus the IAudioFlingerClient must be a singleton per process. - virtual void registerClient(const sp& client) = 0; - - // retrieve the audio recording buffer size - virtual size_t getInputBufferSize(uint32_t sampleRate, audio_format_t format, - audio_channel_mask_t channelMask) const = 0; - - virtual audio_io_handle_t openOutput(audio_module_handle_t module, - audio_devices_t *pDevices, - uint32_t *pSamplingRate, - audio_format_t *pFormat, - audio_channel_mask_t *pChannelMask, - uint32_t *pLatencyMs, - audio_output_flags_t flags, - const audio_offload_info_t *offloadInfo = NULL) = 0; - virtual audio_io_handle_t openDuplicateOutput(audio_io_handle_t output1, - audio_io_handle_t output2) = 0; - virtual status_t closeOutput(audio_io_handle_t output) = 0; - virtual status_t suspendOutput(audio_io_handle_t output) = 0; - virtual status_t restoreOutput(audio_io_handle_t output) = 0; - - virtual audio_io_handle_t openInput(audio_module_handle_t module, - audio_devices_t *pDevices, - uint32_t *pSamplingRate, - audio_format_t *pFormat, - audio_channel_mask_t *pChannelMask) = 0; - virtual status_t closeInput(audio_io_handle_t input) = 0; - - virtual status_t setStreamOutput(audio_stream_type_t stream, audio_io_handle_t output) = 0; - - virtual status_t setVoiceVolume(float volume) = 0; - - virtual status_t getRenderPosition(size_t *halFrames, size_t *dspFrames, - audio_io_handle_t output) const = 0; - - virtual size_t getInputFramesLost(audio_io_handle_t ioHandle) const = 0; - - virtual int newAudioSessionId() = 0; - - virtual void acquireAudioSessionId(int audioSession) = 0; - virtual void releaseAudioSessionId(int audioSession) = 0; - - virtual status_t queryNumberEffects(uint32_t *numEffects) const = 0; - - virtual status_t queryEffect(uint32_t index, effect_descriptor_t *pDescriptor) const = 0; - - virtual status_t getEffectDescriptor(const effect_uuid_t *pEffectUUID, - effect_descriptor_t *pDescriptor) const = 0; - - virtual sp createEffect( - effect_descriptor_t *pDesc, - const sp& client, - int32_t priority, - audio_io_handle_t output, - int sessionId, - status_t *status, - int *id, - int *enabled) = 0; - - virtual status_t moveEffects(int session, audio_io_handle_t srcOutput, - audio_io_handle_t dstOutput) = 0; - - virtual audio_module_handle_t loadHwModule(const char *name) = 0; - - // helpers for android.media.AudioManager.getProperty(), see description there for meaning - // FIXME move these APIs to AudioPolicy to permit a more accurate implementation - // that looks on primary device for a stream with fast flag, primary flag, or first one. - virtual uint32_t getPrimaryOutputSamplingRate() = 0; - virtual size_t getPrimaryOutputFrameCount() = 0; - - // Intended for AudioService to inform AudioFlinger of device's low RAM attribute, - // and should be called at most once. For a definition of what "low RAM" means, see - // android.app.ActivityManager.isLowRamDevice(). - virtual status_t setLowRamDevice(bool isLowRamDevice) = 0; -}; - - -// ---------------------------------------------------------------------------- - -class BnAudioFlinger : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IAUDIOFLINGER_H diff --git a/external/android/include/19/frameworks/av/include/media/IAudioFlingerClient.h b/external/android/include/19/frameworks/av/include/media/IAudioFlingerClient.h deleted file mode 100644 index 75a9971..0000000 --- a/external/android/include/19/frameworks/av/include/media/IAudioFlingerClient.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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_IAUDIOFLINGERCLIENT_H -#define ANDROID_IAUDIOFLINGERCLIENT_H - - -#include -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class IAudioFlingerClient : public IInterface -{ -public: - DECLARE_META_INTERFACE(AudioFlingerClient); - - // Notifies a change of audio input/output configuration. - virtual void ioConfigChanged(int event, audio_io_handle_t ioHandle, const void *param2) = 0; - -}; - - -// ---------------------------------------------------------------------------- - -class BnAudioFlingerClient : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IAUDIOFLINGERCLIENT_H diff --git a/external/android/include/19/frameworks/av/include/media/IAudioPolicyService.h b/external/android/include/19/frameworks/av/include/media/IAudioPolicyService.h deleted file mode 100644 index 09b9ea6..0000000 --- a/external/android/include/19/frameworks/av/include/media/IAudioPolicyService.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - * 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_IAUDIOPOLICYSERVICE_H -#define ANDROID_IAUDIOPOLICYSERVICE_H - -#include -#include -#include - -#include -#include -#include -#include - -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class IAudioPolicyService : public IInterface -{ -public: - DECLARE_META_INTERFACE(AudioPolicyService); - - // - // IAudioPolicyService interface (see AudioPolicyInterface for method descriptions) - // - virtual status_t setDeviceConnectionState(audio_devices_t device, - audio_policy_dev_state_t state, - const char *device_address) = 0; - virtual audio_policy_dev_state_t getDeviceConnectionState(audio_devices_t device, - const char *device_address) = 0; - virtual status_t setPhoneState(audio_mode_t state) = 0; - virtual status_t setForceUse(audio_policy_force_use_t usage, - audio_policy_forced_cfg_t config) = 0; - virtual audio_policy_forced_cfg_t getForceUse(audio_policy_force_use_t usage) = 0; - virtual audio_io_handle_t getOutput(audio_stream_type_t stream, - uint32_t samplingRate = 0, - audio_format_t format = AUDIO_FORMAT_DEFAULT, - audio_channel_mask_t channelMask = 0, - audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE, - const audio_offload_info_t *offloadInfo = NULL) = 0; - virtual status_t startOutput(audio_io_handle_t output, - audio_stream_type_t stream, - int session = 0) = 0; - virtual status_t stopOutput(audio_io_handle_t output, - audio_stream_type_t stream, - int session = 0) = 0; - virtual void releaseOutput(audio_io_handle_t output) = 0; - virtual audio_io_handle_t getInput(audio_source_t inputSource, - uint32_t samplingRate = 0, - audio_format_t format = AUDIO_FORMAT_DEFAULT, - audio_channel_mask_t channelMask = 0, - int audioSession = 0) = 0; - virtual status_t startInput(audio_io_handle_t input) = 0; - virtual status_t stopInput(audio_io_handle_t input) = 0; - virtual void releaseInput(audio_io_handle_t input) = 0; - virtual status_t initStreamVolume(audio_stream_type_t stream, - int indexMin, - int indexMax) = 0; - virtual status_t setStreamVolumeIndex(audio_stream_type_t stream, - int index, - audio_devices_t device) = 0; - virtual status_t getStreamVolumeIndex(audio_stream_type_t stream, - int *index, - audio_devices_t device) = 0; - virtual uint32_t getStrategyForStream(audio_stream_type_t stream) = 0; - virtual audio_devices_t getDevicesForStream(audio_stream_type_t stream) = 0; - virtual audio_io_handle_t getOutputForEffect(const effect_descriptor_t *desc) = 0; - virtual status_t registerEffect(const effect_descriptor_t *desc, - audio_io_handle_t io, - uint32_t strategy, - int session, - int id) = 0; - virtual status_t unregisterEffect(int id) = 0; - virtual status_t setEffectEnabled(int id, bool enabled) = 0; - virtual bool isStreamActive(audio_stream_type_t stream, uint32_t inPastMs = 0) const = 0; - virtual bool isStreamActiveRemotely(audio_stream_type_t stream, uint32_t inPastMs = 0) - const = 0; - virtual bool isSourceActive(audio_source_t source) const = 0; - virtual status_t queryDefaultPreProcessing(int audioSession, - effect_descriptor_t *descriptors, - uint32_t *count) = 0; - // Check if offload is possible for given format, stream type, sample rate, - // bit rate, duration, video and streaming or offload property is enabled - virtual bool isOffloadSupported(const audio_offload_info_t& info) = 0; -}; - - -// ---------------------------------------------------------------------------- - -class BnAudioPolicyService : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IAUDIOPOLICYSERVICE_H diff --git a/external/android/include/19/frameworks/av/include/media/IAudioRecord.h b/external/android/include/19/frameworks/av/include/media/IAudioRecord.h deleted file mode 100644 index eccc2ca..0000000 --- a/external/android/include/19/frameworks/av/include/media/IAudioRecord.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 IAUDIORECORD_H_ -#define IAUDIORECORD_H_ - -#include -#include - -#include -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class IAudioRecord : public IInterface -{ -public: - DECLARE_META_INTERFACE(AudioRecord); - - /* get this tracks control block */ - virtual sp getCblk() const = 0; - - /* After it's created the track is not active. Call start() to - * make it active. - */ - virtual status_t start(int /*AudioSystem::sync_event_t*/ event, int triggerSession) = 0; - - /* Stop a track. If set, the callback will cease being called and - * obtainBuffer will return an error. Buffers that are already released - * will be processed, unless flush() is called. - */ - virtual void stop() = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnAudioRecord : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif /*IAUDIORECORD_H_*/ diff --git a/external/android/include/19/frameworks/av/include/media/IAudioTrack.h b/external/android/include/19/frameworks/av/include/media/IAudioTrack.h deleted file mode 100644 index 5c8a484..0000000 --- a/external/android/include/19/frameworks/av/include/media/IAudioTrack.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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_IAUDIOTRACK_H -#define ANDROID_IAUDIOTRACK_H - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class IAudioTrack : public IInterface -{ -public: - DECLARE_META_INTERFACE(AudioTrack); - - /* Get this track's control block */ - virtual sp getCblk() const = 0; - - /* After it's created the track is not active. Call start() to - * make it active. - */ - virtual status_t start() = 0; - - /* Stop a track. If set, the callback will cease being called and - * obtainBuffer will return an error. Buffers that are already released - * will continue to be processed, unless/until flush() is called. - */ - virtual void stop() = 0; - - /* Flush a stopped or paused track. All pending/released buffers are discarded. - * This function has no effect if the track is not stopped or paused. - */ - virtual void flush() = 0; - - /* Pause a track. If set, the callback will cease being called and - * obtainBuffer will return an error. Buffers that are already released - * will continue to be processed, unless/until flush() is called. - */ - virtual void pause() = 0; - - /* Attach track auxiliary output to specified effect. Use effectId = 0 - * to detach track from effect. - */ - virtual status_t attachAuxEffect(int effectId) = 0; - - - /* Allocate a shared memory buffer suitable for holding timed audio - samples */ - virtual status_t allocateTimedBuffer(size_t size, - sp* buffer) = 0; - - /* Queue a buffer obtained via allocateTimedBuffer for playback at the given - timestamp */ - virtual status_t queueTimedBuffer(const sp& buffer, - int64_t pts) = 0; - - /* Define the linear transform that will be applied to the timestamps - given to queueTimedBuffer (which are expressed in media time). - Target specifies whether this transform converts media time to local time - or Tungsten time. The values for target are defined in AudioTrack.h */ - virtual status_t setMediaTimeTransform(const LinearTransform& xform, - int target) = 0; - - /* Send parameters to the audio hardware */ - virtual status_t setParameters(const String8& keyValuePairs) = 0; - - /* Return NO_ERROR if timestamp is valid */ - virtual status_t getTimestamp(AudioTimestamp& timestamp) = 0; - - /* Signal the playback thread for a change in control block */ - virtual void signal() = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnAudioTrack : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IAUDIOTRACK_H diff --git a/external/android/include/19/frameworks/av/include/media/ICrypto.h b/external/android/include/19/frameworks/av/include/media/ICrypto.h deleted file mode 100644 index 9dcb8d9..0000000 --- a/external/android/include/19/frameworks/av/include/media/ICrypto.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2012 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 -#include -#include - -#ifndef ANDROID_ICRYPTO_H_ - -#define ANDROID_ICRYPTO_H_ - -namespace android { - -struct AString; - -struct ICrypto : public IInterface { - DECLARE_META_INTERFACE(Crypto); - - virtual status_t initCheck() const = 0; - - virtual bool isCryptoSchemeSupported(const uint8_t uuid[16]) = 0; - - virtual status_t createPlugin( - const uint8_t uuid[16], const void *data, size_t size) = 0; - - virtual status_t destroyPlugin() = 0; - - virtual bool requiresSecureDecoderComponent( - const char *mime) const = 0; - - virtual ssize_t decrypt( - bool secure, - const uint8_t key[16], - const uint8_t iv[16], - CryptoPlugin::Mode mode, - const void *srcPtr, - const CryptoPlugin::SubSample *subSamples, size_t numSubSamples, - void *dstPtr, - AString *errorDetailMsg) = 0; - -private: - DISALLOW_EVIL_CONSTRUCTORS(ICrypto); -}; - -struct BnCrypto : public BnInterface { - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -}; - -} // namespace android - -#endif // ANDROID_ICRYPTO_H_ - diff --git a/external/android/include/19/frameworks/av/include/media/IDrm.h b/external/android/include/19/frameworks/av/include/media/IDrm.h deleted file mode 100644 index 5ef26af..0000000 --- a/external/android/include/19/frameworks/av/include/media/IDrm.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2013 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 -#include -#include -#include - -#ifndef ANDROID_IDRM_H_ - -#define ANDROID_IDRM_H_ - -namespace android { - -struct AString; - -struct IDrm : public IInterface { - DECLARE_META_INTERFACE(Drm); - - virtual status_t initCheck() const = 0; - - virtual bool isCryptoSchemeSupported(const uint8_t uuid[16], const String8 &mimeType) = 0; - - virtual status_t createPlugin(const uint8_t uuid[16]) = 0; - - virtual status_t destroyPlugin() = 0; - - virtual status_t openSession(Vector &sessionId) = 0; - - virtual status_t closeSession(Vector const &sessionId) = 0; - - virtual status_t - getKeyRequest(Vector const &sessionId, - Vector const &initData, - String8 const &mimeType, DrmPlugin::KeyType keyType, - KeyedVector const &optionalParameters, - Vector &request, String8 &defaultUrl) = 0; - - virtual status_t provideKeyResponse(Vector const &sessionId, - Vector const &response, - Vector &keySetId) = 0; - - virtual status_t removeKeys(Vector const &keySetId) = 0; - - virtual status_t restoreKeys(Vector const &sessionId, - Vector const &keySetId) = 0; - - virtual status_t queryKeyStatus(Vector const &sessionId, - KeyedVector &infoMap) const = 0; - - virtual status_t getProvisionRequest(Vector &request, - String8 &defaulUrl) = 0; - - virtual status_t provideProvisionResponse(Vector const &response) = 0; - - virtual status_t getSecureStops(List > &secureStops) = 0; - - virtual status_t releaseSecureStops(Vector const &ssRelease) = 0; - - virtual status_t getPropertyString(String8 const &name, String8 &value) const = 0; - virtual status_t getPropertyByteArray(String8 const &name, - Vector &value) const = 0; - virtual status_t setPropertyString(String8 const &name, - String8 const &value ) const = 0; - virtual status_t setPropertyByteArray(String8 const &name, - Vector const &value) const = 0; - - virtual status_t setCipherAlgorithm(Vector const &sessionId, - String8 const &algorithm) = 0; - - virtual status_t setMacAlgorithm(Vector const &sessionId, - String8 const &algorithm) = 0; - - virtual status_t encrypt(Vector const &sessionId, - Vector const &keyId, - Vector const &input, - Vector const &iv, - Vector &output) = 0; - - virtual status_t decrypt(Vector const &sessionId, - Vector const &keyId, - Vector const &input, - Vector const &iv, - Vector &output) = 0; - - virtual status_t sign(Vector const &sessionId, - Vector const &keyId, - Vector const &message, - Vector &signature) = 0; - - virtual status_t verify(Vector const &sessionId, - Vector const &keyId, - Vector const &message, - Vector const &signature, - bool &match) = 0; - - virtual status_t setListener(const sp& listener) = 0; - -private: - DISALLOW_EVIL_CONSTRUCTORS(IDrm); -}; - -struct BnDrm : public BnInterface { - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -private: - void readVector(const Parcel &data, Vector &vector) const; - void writeVector(Parcel *reply, Vector const &vector) const; -}; - -} // namespace android - -#endif // ANDROID_IDRM_H_ - diff --git a/external/android/include/19/frameworks/av/include/media/IDrmClient.h b/external/android/include/19/frameworks/av/include/media/IDrmClient.h deleted file mode 100644 index 3b2fc7c..0000000 --- a/external/android/include/19/frameworks/av/include/media/IDrmClient.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2013 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_IDRMCLIENT_H -#define ANDROID_IDRMCLIENT_H - -#include -#include -#include -#include - -namespace android { - -class IDrmClient: public IInterface -{ -public: - DECLARE_META_INTERFACE(DrmClient); - - virtual void notify(DrmPlugin::EventType eventType, int extra, const Parcel *obj) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnDrmClient: public BnInterface -{ -public: - virtual status_t onTransact(uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IDRMCLIENT_H diff --git a/external/android/include/19/frameworks/av/include/media/IEffect.h b/external/android/include/19/frameworks/av/include/media/IEffect.h deleted file mode 100644 index ff04869..0000000 --- a/external/android/include/19/frameworks/av/include/media/IEffect.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2010 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_IEFFECT_H -#define ANDROID_IEFFECT_H - -#include -#include -#include -#include - -namespace android { - -class IEffect: public IInterface -{ -public: - DECLARE_META_INTERFACE(Effect); - - virtual status_t enable() = 0; - - virtual status_t disable() = 0; - - virtual status_t command(uint32_t cmdCode, - uint32_t cmdSize, - void *pCmdData, - uint32_t *pReplySize, - void *pReplyData) = 0; - - virtual void disconnect() = 0; - - virtual sp getCblk() const = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnEffect: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IEFFECT_H diff --git a/external/android/include/19/frameworks/av/include/media/IEffectClient.h b/external/android/include/19/frameworks/av/include/media/IEffectClient.h deleted file mode 100644 index 2f78c98..0000000 --- a/external/android/include/19/frameworks/av/include/media/IEffectClient.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2010 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_IEFFECTCLIENT_H -#define ANDROID_IEFFECTCLIENT_H - -#include -#include -#include -#include - -namespace android { - -class IEffectClient: public IInterface -{ -public: - DECLARE_META_INTERFACE(EffectClient); - - virtual void controlStatusChanged(bool controlGranted) = 0; - virtual void enableStatusChanged(bool enabled) = 0; - virtual void commandExecuted(uint32_t cmdCode, - uint32_t cmdSize, - void *pCmdData, - uint32_t replySize, - void *pReplyData) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnEffectClient: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IEFFECTCLIENT_H diff --git a/external/android/include/19/frameworks/av/include/media/IHDCP.h b/external/android/include/19/frameworks/av/include/media/IHDCP.h deleted file mode 100644 index 352561e..0000000 --- a/external/android/include/19/frameworks/av/include/media/IHDCP.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (C) 2012 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 -#include -#include -#include - -namespace android { - -struct IHDCPObserver : public IInterface { - DECLARE_META_INTERFACE(HDCPObserver); - - virtual void notify( - int msg, int ext1, int ext2, const Parcel *obj) = 0; - -private: - DISALLOW_EVIL_CONSTRUCTORS(IHDCPObserver); -}; - -struct IHDCP : public IInterface { - DECLARE_META_INTERFACE(HDCP); - - // Called to specify the observer that receives asynchronous notifications - // from the HDCP implementation to signal completion/failure of asynchronous - // operations (such as initialization) or out of band events. - virtual status_t setObserver(const sp &observer) = 0; - - // Request to setup an HDCP session with the specified host listening - // on the specified port. - virtual status_t initAsync(const char *host, unsigned port) = 0; - - // Request to shutdown the active HDCP session. - virtual status_t shutdownAsync() = 0; - - // Returns the capability bitmask of this HDCP session. - // Possible return values (please refer to HDCAPAPI.h): - // HDCP_CAPS_ENCRYPT: mandatory, meaning the HDCP module can encrypt - // from an input byte-array buffer to an output byte-array buffer - // HDCP_CAPS_ENCRYPT_NATIVE: the HDCP module supports encryption from - // a native buffer to an output byte-array buffer. The format of the - // input native buffer is specific to vendor's encoder implementation. - // It is the same format as that used by the encoder when - // "storeMetaDataInBuffers" extension is enabled on its output port. - virtual uint32_t getCaps() = 0; - - // ENCRYPTION only: - // Encrypt data according to the HDCP spec. "size" bytes of data are - // available at "inData" (virtual address), "size" may not be a multiple - // of 128 bits (16 bytes). An equal number of encrypted bytes should be - // written to the buffer at "outData" (virtual address). - // This operation is to be synchronous, i.e. this call does not return - // until outData contains size bytes of encrypted data. - // streamCTR will be assigned by the caller (to 0 for the first PES stream, - // 1 for the second and so on) - // inputCTR _will_be_maintained_by_the_callee_ for each PES stream. - virtual status_t encrypt( - const void *inData, size_t size, uint32_t streamCTR, - uint64_t *outInputCTR, void *outData) = 0; - - // Encrypt data according to the HDCP spec. "size" bytes of data starting - // at location "offset" are available in "buffer" (buffer handle). "size" - // may not be a multiple of 128 bits (16 bytes). An equal number of - // encrypted bytes should be written to the buffer at "outData" (virtual - // address). This operation is to be synchronous, i.e. this call does not - // return until outData contains size bytes of encrypted data. - // streamCTR will be assigned by the caller (to 0 for the first PES stream, - // 1 for the second and so on) - // inputCTR _will_be_maintained_by_the_callee_ for each PES stream. - virtual status_t encryptNative( - const sp &graphicBuffer, - size_t offset, size_t size, uint32_t streamCTR, - uint64_t *outInputCTR, void *outData) = 0; - - // DECRYPTION only: - // Decrypt data according to the HDCP spec. - // "size" bytes of encrypted data are available at "inData" - // (virtual address), "size" may not be a multiple of 128 bits (16 bytes). - // An equal number of decrypted bytes should be written to the buffer - // at "outData" (virtual address). - // This operation is to be synchronous, i.e. this call does not return - // until outData contains size bytes of decrypted data. - // Both streamCTR and inputCTR will be provided by the caller. - virtual status_t decrypt( - const void *inData, size_t size, - uint32_t streamCTR, uint64_t inputCTR, - void *outData) = 0; - -private: - DISALLOW_EVIL_CONSTRUCTORS(IHDCP); -}; - -struct BnHDCPObserver : public BnInterface { - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -}; - -struct BnHDCP : public BnInterface { - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -}; - -} // namespace android - - diff --git a/external/android/include/19/frameworks/av/include/media/IMediaDeathNotifier.h b/external/android/include/19/frameworks/av/include/media/IMediaDeathNotifier.h deleted file mode 100644 index bb3d0d8..0000000 --- a/external/android/include/19/frameworks/av/include/media/IMediaDeathNotifier.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2010 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_IMEDIADEATHNOTIFIER_H -#define ANDROID_IMEDIADEATHNOTIFIER_H - -#include -#include -#include - -namespace android { - -class IMediaDeathNotifier: virtual public RefBase -{ -public: - IMediaDeathNotifier() { addObitRecipient(this); } - virtual ~IMediaDeathNotifier() { removeObitRecipient(this); } - - virtual void died() = 0; - static const sp& getMediaPlayerService(); - -private: - IMediaDeathNotifier &operator=(const IMediaDeathNotifier &); - IMediaDeathNotifier(const IMediaDeathNotifier &); - - static void addObitRecipient(const wp& recipient); - static void removeObitRecipient(const wp& recipient); - - class DeathNotifier: public IBinder::DeathRecipient - { - public: - DeathNotifier() {} - virtual ~DeathNotifier(); - - virtual void binderDied(const wp& who); - }; - - friend class DeathNotifier; - - static Mutex sServiceLock; - static sp sMediaPlayerService; - static sp sDeathNotifier; - static SortedVector< wp > sObitRecipients; -}; - -}; // namespace android - -#endif // ANDROID_IMEDIADEATHNOTIFIER_H diff --git a/external/android/include/19/frameworks/av/include/media/IMediaLogService.h b/external/android/include/19/frameworks/av/include/media/IMediaLogService.h deleted file mode 100644 index 1f5777e..0000000 --- a/external/android/include/19/frameworks/av/include/media/IMediaLogService.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2013 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_IMEDIALOGSERVICE_H -#define ANDROID_IMEDIALOGSERVICE_H - -#include -#include -#include - -namespace android { - -class IMediaLogService: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaLogService); - - virtual void registerWriter(const sp& shared, size_t size, const char *name) = 0; - virtual void unregisterWriter(const sp& shared) = 0; - -}; - -class BnMediaLogService: public BnInterface -{ -public: - virtual status_t onTransact(uint32_t code, const Parcel& data, Parcel* reply, - uint32_t flags = 0); -}; - -} // namespace android - -#endif // ANDROID_IMEDIALOGSERVICE_H diff --git a/external/android/include/19/frameworks/av/include/media/IMediaMetadataRetriever.h b/external/android/include/19/frameworks/av/include/media/IMediaMetadataRetriever.h deleted file mode 100644 index 6dbb2d7..0000000 --- a/external/android/include/19/frameworks/av/include/media/IMediaMetadataRetriever.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -** -** 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. -*/ - -#ifndef ANDROID_IMEDIAMETADATARETRIEVER_H -#define ANDROID_IMEDIAMETADATARETRIEVER_H - -#include -#include -#include -#include -#include - -namespace android { - -class IMediaMetadataRetriever: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaMetadataRetriever); - virtual void disconnect() = 0; - - virtual status_t setDataSource( - const char *srcUrl, - const KeyedVector *headers = NULL) = 0; - - virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; - virtual sp getFrameAtTime(int64_t timeUs, int option) = 0; - virtual sp extractAlbumArt() = 0; - virtual const char* extractMetadata(int keyCode) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnMediaMetadataRetriever: public BnInterface -{ -public: - virtual status_t onTransact(uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IMEDIAMETADATARETRIEVER_H diff --git a/external/android/include/19/frameworks/av/include/media/IMediaPlayer.h b/external/android/include/19/frameworks/av/include/media/IMediaPlayer.h deleted file mode 100644 index 0cbd269..0000000 --- a/external/android/include/19/frameworks/av/include/media/IMediaPlayer.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_IMEDIAPLAYER_H -#define ANDROID_IMEDIAPLAYER_H - -#include -#include -#include -#include -#include - -// Fwd decl to make sure everyone agrees that the scope of struct sockaddr_in is -// global, and not in android:: -struct sockaddr_in; - -namespace android { - -class Parcel; -class Surface; -class IStreamSource; -class IGraphicBufferProducer; - -class IMediaPlayer: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaPlayer); - - virtual void disconnect() = 0; - - virtual status_t setDataSource(const char *url, - const KeyedVector* headers) = 0; - virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; - virtual status_t setDataSource(const sp& source) = 0; - virtual status_t setVideoSurfaceTexture( - const sp& bufferProducer) = 0; - virtual status_t prepareAsync() = 0; - virtual status_t start() = 0; - virtual status_t stop() = 0; - virtual status_t pause() = 0; - virtual status_t isPlaying(bool* state) = 0; - virtual status_t seekTo(int msec) = 0; - virtual status_t getCurrentPosition(int* msec) = 0; - virtual status_t getDuration(int* msec) = 0; - virtual status_t reset() = 0; - virtual status_t setAudioStreamType(audio_stream_type_t type) = 0; - virtual status_t setLooping(int loop) = 0; - virtual status_t setVolume(float leftVolume, float rightVolume) = 0; - virtual status_t setAuxEffectSendLevel(float level) = 0; - virtual status_t attachAuxEffect(int effectId) = 0; - virtual status_t setParameter(int key, const Parcel& request) = 0; - virtual status_t getParameter(int key, Parcel* reply) = 0; - virtual status_t setRetransmitEndpoint(const struct sockaddr_in* endpoint) = 0; - virtual status_t getRetransmitEndpoint(struct sockaddr_in* endpoint) = 0; - virtual status_t setNextPlayer(const sp& next) = 0; - - // Invoke a generic method on the player by using opaque parcels - // for the request and reply. - // @param request Parcel that must start with the media player - // interface token. - // @param[out] reply Parcel to hold the reply data. Cannot be null. - // @return OK if the invocation was made successfully. - virtual status_t invoke(const Parcel& request, Parcel *reply) = 0; - - // Set a new metadata filter. - // @param filter A set of allow and drop rules serialized in a Parcel. - // @return OK if the invocation was made successfully. - virtual status_t setMetadataFilter(const Parcel& filter) = 0; - - // Retrieve a set of metadata. - // @param update_only Include only the metadata that have changed - // since the last invocation of getMetadata. - // The set is built using the unfiltered - // notifications the native player sent to the - // MediaPlayerService during that period of - // time. If false, all the metadatas are considered. - // @param apply_filter If true, once the metadata set has been built based - // on the value update_only, the current filter is - // applied. - // @param[out] metadata On exit contains a set (possibly empty) of metadata. - // Valid only if the call returned OK. - // @return OK if the invocation was made successfully. - virtual status_t getMetadata(bool update_only, - bool apply_filter, - Parcel *metadata) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnMediaPlayer: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IMEDIAPLAYER_H diff --git a/external/android/include/19/frameworks/av/include/media/IMediaPlayerClient.h b/external/android/include/19/frameworks/av/include/media/IMediaPlayerClient.h deleted file mode 100644 index 8f1843e..0000000 --- a/external/android/include/19/frameworks/av/include/media/IMediaPlayerClient.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_IMEDIAPLAYERCLIENT_H -#define ANDROID_IMEDIAPLAYERCLIENT_H - -#include -#include -#include - -namespace android { - -class IMediaPlayerClient: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaPlayerClient); - - virtual void notify(int msg, int ext1, int ext2, const Parcel *obj) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnMediaPlayerClient: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IMEDIAPLAYERCLIENT_H diff --git a/external/android/include/19/frameworks/av/include/media/IMediaPlayerService.h b/external/android/include/19/frameworks/av/include/media/IMediaPlayerService.h deleted file mode 100644 index 2998b37..0000000 --- a/external/android/include/19/frameworks/av/include/media/IMediaPlayerService.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_IMEDIAPLAYERSERVICE_H -#define ANDROID_IMEDIAPLAYERSERVICE_H - -#include // for status_t -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -namespace android { - -struct ICrypto; -struct IDrm; -struct IHDCP; -class IMediaRecorder; -class IOMX; -class IRemoteDisplay; -class IRemoteDisplayClient; -struct IStreamSource; - -class IMediaPlayerService: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaPlayerService); - - virtual sp createMediaRecorder() = 0; - virtual sp createMetadataRetriever() = 0; - virtual sp create(const sp& client, int audioSessionId = 0) = 0; - - virtual status_t decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, - audio_format_t* pFormat, - const sp& heap, size_t *pSize) = 0; - virtual status_t decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, - int* pNumChannels, audio_format_t* pFormat, - const sp& heap, size_t *pSize) = 0; - virtual sp getOMX() = 0; - virtual sp makeCrypto() = 0; - virtual sp makeDrm() = 0; - virtual sp makeHDCP(bool createEncryptionModule) = 0; - - // Connects to a remote display. - // 'iface' specifies the address of the local interface on which to listen for - // a connection from the remote display as an ip address and port number - // of the form "x.x.x.x:y". The media server should call back into the provided remote - // display client when display connection, disconnection or errors occur. - // The assumption is that at most one remote display will be connected to the - // provided interface at a time. - virtual sp listenForRemoteDisplay(const sp& client, - const String8& iface) = 0; - - // codecs and audio devices usage tracking for the battery app - enum BatteryDataBits { - // tracking audio codec - kBatteryDataTrackAudio = 0x1, - // tracking video codec - kBatteryDataTrackVideo = 0x2, - // codec is started, otherwise codec is paused - kBatteryDataCodecStarted = 0x4, - // tracking decoder (for media player), - // otherwise tracking encoder (for media recorder) - kBatteryDataTrackDecoder = 0x8, - // start to play an audio on an audio device - kBatteryDataAudioFlingerStart = 0x10, - // stop/pause the audio playback - kBatteryDataAudioFlingerStop = 0x20, - // audio is rounted to speaker - kBatteryDataSpeakerOn = 0x40, - // audio is rounted to devices other than speaker - kBatteryDataOtherAudioDeviceOn = 0x80, - }; - - virtual void addBatteryData(uint32_t params) = 0; - virtual status_t pullBatteryData(Parcel* reply) = 0; - - virtual status_t updateProxyConfig( - const char *host, int32_t port, const char *exclusionList) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnMediaPlayerService: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IMEDIAPLAYERSERVICE_H diff --git a/external/android/include/19/frameworks/av/include/media/IMediaRecorder.h b/external/android/include/19/frameworks/av/include/media/IMediaRecorder.h deleted file mode 100644 index 3e67550..0000000 --- a/external/android/include/19/frameworks/av/include/media/IMediaRecorder.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - ** - ** Copyright 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. - */ - -#ifndef ANDROID_IMEDIARECORDER_H -#define ANDROID_IMEDIARECORDER_H - -#include - -namespace android { - -class Surface; -class ICamera; -class ICameraRecordingProxy; -class IMediaRecorderClient; -class IGraphicBufferProducer; - -class IMediaRecorder: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaRecorder); - - virtual status_t setCamera(const sp& camera, - const sp& proxy) = 0; - virtual status_t setPreviewSurface(const sp& surface) = 0; - virtual status_t setVideoSource(int vs) = 0; - virtual status_t setAudioSource(int as) = 0; - virtual status_t setOutputFormat(int of) = 0; - virtual status_t setVideoEncoder(int ve) = 0; - virtual status_t setAudioEncoder(int ae) = 0; - virtual status_t setOutputFile(const char* path) = 0; - virtual status_t setOutputFile(int fd, int64_t offset, int64_t length) = 0; - virtual status_t setVideoSize(int width, int height) = 0; - virtual status_t setVideoFrameRate(int frames_per_second) = 0; - virtual status_t setParameters(const String8& params) = 0; - virtual status_t setListener(const sp& listener) = 0; - virtual status_t setClientName(const String16& clientName) = 0; - virtual status_t prepare() = 0; - virtual status_t getMaxAmplitude(int* max) = 0; - virtual status_t start() = 0; - virtual status_t stop() = 0; - virtual status_t reset() = 0; - virtual status_t init() = 0; - virtual status_t close() = 0; - virtual status_t release() = 0; - virtual sp querySurfaceMediaSource() = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnMediaRecorder: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IMEDIARECORDER_H diff --git a/external/android/include/19/frameworks/av/include/media/IMediaRecorderClient.h b/external/android/include/19/frameworks/av/include/media/IMediaRecorderClient.h deleted file mode 100644 index e7d0229..0000000 --- a/external/android/include/19/frameworks/av/include/media/IMediaRecorderClient.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2010 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_IMEDIARECORDERCLIENT_H -#define ANDROID_IMEDIARECORDERCLIENT_H - -#include -#include -#include - -namespace android { - -class IMediaRecorderClient: public IInterface -{ -public: - DECLARE_META_INTERFACE(MediaRecorderClient); - - virtual void notify(int msg, int ext1, int ext2) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnMediaRecorderClient: public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IMEDIARECORDERCLIENT_H diff --git a/external/android/include/19/frameworks/av/include/media/IOMX.h b/external/android/include/19/frameworks/av/include/media/IOMX.h deleted file mode 100644 index 9c8451c..0000000 --- a/external/android/include/19/frameworks/av/include/media/IOMX.h +++ /dev/null @@ -1,221 +0,0 @@ -/* - * 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_IOMX_H_ - -#define ANDROID_IOMX_H_ - -#include -#include -#include -#include -#include - -#include -#include - -namespace android { - -class IMemory; -class IOMXObserver; -class IOMXRenderer; -class Surface; - -class IOMX : public IInterface { -public: - DECLARE_META_INTERFACE(OMX); - - typedef void *buffer_id; - typedef void *node_id; - - // Given a node_id and the calling process' pid, returns true iff - // the implementation of the OMX interface lives in the same - // process. - virtual bool livesLocally(node_id node, pid_t pid) = 0; - - struct ComponentInfo { - String8 mName; - List mRoles; - }; - virtual status_t listNodes(List *list) = 0; - - virtual status_t allocateNode( - const char *name, const sp &observer, - node_id *node) = 0; - - virtual status_t freeNode(node_id node) = 0; - - virtual status_t sendCommand( - node_id node, OMX_COMMANDTYPE cmd, OMX_S32 param) = 0; - - virtual status_t getParameter( - node_id node, OMX_INDEXTYPE index, - void *params, size_t size) = 0; - - virtual status_t setParameter( - node_id node, OMX_INDEXTYPE index, - const void *params, size_t size) = 0; - - virtual status_t getConfig( - node_id node, OMX_INDEXTYPE index, - void *params, size_t size) = 0; - - virtual status_t setConfig( - node_id node, OMX_INDEXTYPE index, - const void *params, size_t size) = 0; - - virtual status_t getState( - node_id node, OMX_STATETYPE* state) = 0; - - virtual status_t storeMetaDataInBuffers( - node_id node, OMX_U32 port_index, OMX_BOOL enable) = 0; - - virtual status_t prepareForAdaptivePlayback( - node_id node, OMX_U32 portIndex, OMX_BOOL enable, - OMX_U32 maxFrameWidth, OMX_U32 maxFrameHeight) = 0; - - virtual status_t enableGraphicBuffers( - node_id node, OMX_U32 port_index, OMX_BOOL enable) = 0; - - virtual status_t getGraphicBufferUsage( - node_id node, OMX_U32 port_index, OMX_U32* usage) = 0; - - virtual status_t useBuffer( - node_id node, OMX_U32 port_index, const sp ¶ms, - buffer_id *buffer) = 0; - - virtual status_t useGraphicBuffer( - node_id node, OMX_U32 port_index, - const sp &graphicBuffer, buffer_id *buffer) = 0; - - virtual status_t updateGraphicBufferInMeta( - node_id node, OMX_U32 port_index, - const sp &graphicBuffer, buffer_id buffer) = 0; - - virtual status_t createInputSurface( - node_id node, OMX_U32 port_index, - sp *bufferProducer) = 0; - - virtual status_t signalEndOfInputStream(node_id node) = 0; - - // This API clearly only makes sense if the caller lives in the - // same process as the callee, i.e. is the media_server, as the - // returned "buffer_data" pointer is just that, a pointer into local - // address space. - virtual status_t allocateBuffer( - node_id node, OMX_U32 port_index, size_t size, - buffer_id *buffer, void **buffer_data) = 0; - - virtual status_t allocateBufferWithBackup( - node_id node, OMX_U32 port_index, const sp ¶ms, - buffer_id *buffer) = 0; - - virtual status_t freeBuffer( - node_id node, OMX_U32 port_index, buffer_id buffer) = 0; - - virtual status_t fillBuffer(node_id node, buffer_id buffer) = 0; - - virtual status_t emptyBuffer( - node_id node, - buffer_id buffer, - OMX_U32 range_offset, OMX_U32 range_length, - OMX_U32 flags, OMX_TICKS timestamp) = 0; - - virtual status_t getExtensionIndex( - node_id node, - const char *parameter_name, - OMX_INDEXTYPE *index) = 0; - - enum InternalOptionType { - INTERNAL_OPTION_SUSPEND, // data is a bool - INTERNAL_OPTION_REPEAT_PREVIOUS_FRAME_DELAY, // data is an int64_t - }; - virtual status_t setInternalOption( - node_id node, - OMX_U32 port_index, - InternalOptionType type, - const void *data, - size_t size) = 0; -}; - -struct omx_message { - enum { - EVENT, - EMPTY_BUFFER_DONE, - FILL_BUFFER_DONE, - - } type; - - IOMX::node_id node; - - union { - // if type == EVENT - struct { - OMX_EVENTTYPE event; - OMX_U32 data1; - OMX_U32 data2; - } event_data; - - // if type == EMPTY_BUFFER_DONE - struct { - IOMX::buffer_id buffer; - } buffer_data; - - // if type == FILL_BUFFER_DONE - struct { - IOMX::buffer_id buffer; - OMX_U32 range_offset; - OMX_U32 range_length; - OMX_U32 flags; - OMX_TICKS timestamp; - OMX_PTR platform_private; - OMX_PTR data_ptr; - } extended_buffer_data; - - } u; -}; - -class IOMXObserver : public IInterface { -public: - DECLARE_META_INTERFACE(OMXObserver); - - virtual void onMessage(const omx_message &msg) = 0; -}; - -//////////////////////////////////////////////////////////////////////////////// - -class BnOMX : public BnInterface { -public: - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -}; - -class BnOMXObserver : public BnInterface { -public: - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -}; - -struct CodecProfileLevel { - OMX_U32 mProfile; - OMX_U32 mLevel; -}; - -} // namespace android - -#endif // ANDROID_IOMX_H_ diff --git a/external/android/include/19/frameworks/av/include/media/IRemoteDisplay.h b/external/android/include/19/frameworks/av/include/media/IRemoteDisplay.h deleted file mode 100644 index c8baae9..0000000 --- a/external/android/include/19/frameworks/av/include/media/IRemoteDisplay.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2012 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_IREMOTEDISPLAY_H -#define ANDROID_IREMOTEDISPLAY_H - -#include -#include - -#include -#include -#include - -namespace android { - -/* - * Represents a remote display, such as a Wifi display. - * - * When the remote display is created, it may not yet be connected to the - * display. The remote display asynchronously reports events such as successful - * connection, disconnection and errors to an IRemoteDisplayClient interface provided by - * the client. - */ -class IRemoteDisplay : public IInterface -{ -public: - DECLARE_META_INTERFACE(RemoteDisplay); - - virtual status_t pause() = 0; - virtual status_t resume() = 0; - - // Disconnects the remote display and stops listening for new connections. - virtual status_t dispose() = 0; -}; - - -// ---------------------------------------------------------------------------- - -class BnRemoteDisplay : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IREMOTEDISPLAY_H diff --git a/external/android/include/19/frameworks/av/include/media/IRemoteDisplayClient.h b/external/android/include/19/frameworks/av/include/media/IRemoteDisplayClient.h deleted file mode 100644 index 0e6d55d..0000000 --- a/external/android/include/19/frameworks/av/include/media/IRemoteDisplayClient.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2012 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_IREMOTEDISPLAYCLIENT_H -#define ANDROID_IREMOTEDISPLAYCLIENT_H - -#include -#include - -#include -#include -#include - -namespace android { - -class IGraphicBufferProducer; - -class IRemoteDisplayClient : public IInterface -{ -public: - DECLARE_META_INTERFACE(RemoteDisplayClient); - - enum { - // Flag: The remote display is using a secure transport protocol such as HDCP. - kDisplayFlagSecure = 1 << 0, - }; - - enum { - // Error: An unknown / generic error occurred. - kDisplayErrorUnknown = 1, - // Error: The connection was dropped unexpectedly. - kDisplayErrorConnectionDropped = 2, - }; - - // Indicates that the remote display has been connected successfully. - // Provides a surface texture that the client should use to stream buffers to - // the remote display. - virtual void onDisplayConnected(const sp& bufferProducer, - uint32_t width, uint32_t height, uint32_t flags, uint32_t session) = 0; // one-way - - // Indicates that the remote display has been disconnected normally. - // This method should only be called once the client has called 'dispose()' - // on the IRemoteDisplay. - // It is currently an error for the display to disconnect for any other reason. - virtual void onDisplayDisconnected() = 0; // one-way - - // Indicates that a connection could not be established to the remote display - // or an unrecoverable error occurred and the connection was severed. - virtual void onDisplayError(int32_t error) = 0; // one-way -}; - - -// ---------------------------------------------------------------------------- - -class BnRemoteDisplayClient : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -}; // namespace android - -#endif // ANDROID_IREMOTEDISPLAYCLIENT_H diff --git a/external/android/include/19/frameworks/av/include/media/IStreamSource.h b/external/android/include/19/frameworks/av/include/media/IStreamSource.h deleted file mode 100644 index 677119b..0000000 --- a/external/android/include/19/frameworks/av/include/media/IStreamSource.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (C) 2010 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_ISTREAMSOURCE_H_ - -#define ANDROID_ISTREAMSOURCE_H_ - -#include - -namespace android { - -struct AMessage; -struct IMemory; -struct IStreamListener; - -struct IStreamSource : public IInterface { - DECLARE_META_INTERFACE(StreamSource); - - virtual void setListener(const sp &listener) = 0; - virtual void setBuffers(const Vector > &buffers) = 0; - - virtual void onBufferAvailable(size_t index) = 0; - - enum { - // Video PES packets contain exactly one (aligned) access unit. - kFlagAlignedVideoData = 1, - - // Timestamps are in ALooper::GetNowUs() units. - kFlagIsRealTimeData = 2, - }; - virtual uint32_t flags() const { return 0; } -}; - -struct IStreamListener : public IInterface { - DECLARE_META_INTERFACE(StreamListener); - - enum Command { - EOS, - DISCONTINUITY, - }; - - virtual void queueBuffer(size_t index, size_t size) = 0; - - // When signalling a discontinuity you can optionally - // specify an int64_t PTS timestamp in "msg". - // If present, rendering of data following the discontinuity - // will be suppressed until media time reaches this timestamp. - static const char *const kKeyResumeAtPTS; - - // When signalling a discontinuity you can optionally - // specify the type(s) of discontinuity, i.e. if the - // audio format has changed, the video format has changed, - // time has jumped or any combination thereof. - // To do so, include a non-zero int32_t value - // under the key "kKeyDiscontinuityMask" when issuing the DISCONTINUITY - // command. - // If there is a change in audio/video format, The new logical stream - // must start with proper codec initialization - // information for playback to continue, i.e. SPS and PPS in the case - // of AVC video etc. - // If this key is not present, only a time discontinuity is assumed. - // The value should be a bitmask of values from - // ATSParser::DiscontinuityType. - static const char *const kKeyDiscontinuityMask; - - // Optionally signalled as part of a discontinuity that includes - // DISCONTINUITY_TIME. It indicates the media time (in us) to be associated - // with the next PTS occuring in the stream. The value is of type int64_t. - static const char *const kKeyMediaTimeUs; - - virtual void issueCommand( - Command cmd, bool synchronous, const sp &msg = NULL) = 0; -}; - -//////////////////////////////////////////////////////////////////////////////// - -struct BnStreamSource : public BnInterface { - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -}; - -struct BnStreamListener : public BnInterface { - virtual status_t onTransact( - uint32_t code, const Parcel &data, Parcel *reply, - uint32_t flags = 0); -}; - -} // namespace android - -#endif // ANDROID_ISTREAMSOURCE_H_ diff --git a/external/android/include/19/frameworks/av/include/media/JetPlayer.h b/external/android/include/19/frameworks/av/include/media/JetPlayer.h deleted file mode 100644 index 388f767..0000000 --- a/external/android/include/19/frameworks/av/include/media/JetPlayer.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * 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. - */ - -#ifndef JETPLAYER_H_ -#define JETPLAYER_H_ - -#include - -#include -#include -#include - - -namespace android { - -typedef void (*jetevent_callback)(int eventType, int val1, int val2, void *cookie); - -class JetPlayer { - -public: - - // to keep in sync with the JetPlayer class constants - // defined in frameworks/base/media/java/android/media/JetPlayer.java - static const int JET_EVENT = 1; - static const int JET_USERID_UPDATE = 2; - static const int JET_NUMQUEUEDSEGMENT_UPDATE = 3; - static const int JET_PAUSE_UPDATE = 4; - - JetPlayer(void *javaJetPlayer, - int maxTracks = 32, - int trackBufferSize = 1200); - ~JetPlayer(); - int init(); - int release(); - - int loadFromFile(const char* url); - int loadFromFD(const int fd, const long long offset, const long long length); - int closeFile(); - int play(); - int pause(); - int queueSegment(int segmentNum, int libNum, int repeatCount, int transpose, - EAS_U32 muteFlags, EAS_U8 userID); - int setMuteFlags(EAS_U32 muteFlags, bool sync); - int setMuteFlag(int trackNum, bool muteFlag, bool sync); - int triggerClip(int clipId); - int clearQueue(); - - void setEventCallback(jetevent_callback callback); - - int getMaxTracks() { return mMaxTracks; }; - - -private: - int render(); - void fireUpdateOnStatusChange(); - void fireEventsFromJetQueue(); - - JetPlayer() {} // no default constructor - void dump(); - void dumpJetStatus(S_JET_STATUS* pJetStatus); - - jetevent_callback mEventCallback; - - void* mJavaJetPlayerRef; - Mutex mMutex; // mutex to sync the render and playback thread with the JET calls - pid_t mTid; - Condition mCondition; - volatile bool mRender; - bool mPaused; - - EAS_STATE mState; - int* mMemFailedVar; - - int mMaxTracks; // max number of MIDI tracks, usually 32 - EAS_DATA_HANDLE mEasData; - EAS_FILE_LOCATOR mEasJetFileLoc; - EAS_PCM* mAudioBuffer;// EAS renders the MIDI data into this buffer, - sp mAudioTrack; // and we play it in this audio track - int mTrackBufferSize; - S_JET_STATUS mJetStatus; - S_JET_STATUS mPreviousJetStatus; - - char mJetFilePath[PATH_MAX]; - - class JetPlayerThread : public Thread { - public: - JetPlayerThread(JetPlayer *player) : mPlayer(player) { - } - - protected: - virtual ~JetPlayerThread() {} - - private: - JetPlayer *mPlayer; - - bool threadLoop() { - int result; - result = mPlayer->render(); - return false; - } - - JetPlayerThread(const JetPlayerThread &); - JetPlayerThread &operator=(const JetPlayerThread &); - }; - - sp mThread; - -}; // end class JetPlayer - -} // end namespace android - - - -#endif /*JETPLAYER_H_*/ diff --git a/external/android/include/19/frameworks/av/include/media/MediaMetadataRetrieverInterface.h b/external/android/include/19/frameworks/av/include/media/MediaMetadataRetrieverInterface.h deleted file mode 100644 index ecc3b65..0000000 --- a/external/android/include/19/frameworks/av/include/media/MediaMetadataRetrieverInterface.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -** -** 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. -*/ - -#ifndef ANDROID_MEDIAMETADATARETRIEVERINTERFACE_H -#define ANDROID_MEDIAMETADATARETRIEVERINTERFACE_H - -#include -#include -#include - -namespace android { - -// Abstract base class -class MediaMetadataRetrieverBase : public RefBase -{ -public: - MediaMetadataRetrieverBase() {} - virtual ~MediaMetadataRetrieverBase() {} - - virtual status_t setDataSource( - const char *url, - const KeyedVector *headers = NULL) = 0; - - virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; - virtual VideoFrame* getFrameAtTime(int64_t timeUs, int option) = 0; - virtual MediaAlbumArt* extractAlbumArt() = 0; - virtual const char* extractMetadata(int keyCode) = 0; -}; - -// MediaMetadataRetrieverInterface -class MediaMetadataRetrieverInterface : public MediaMetadataRetrieverBase -{ -public: - MediaMetadataRetrieverInterface() {} - - virtual ~MediaMetadataRetrieverInterface() {} - virtual VideoFrame* getFrameAtTime(int64_t timeUs, int option) { return NULL; } - virtual MediaAlbumArt* extractAlbumArt() { return NULL; } - virtual const char* extractMetadata(int keyCode) { return NULL; } -}; - -}; // namespace android - -#endif // ANDROID_MEDIAMETADATARETRIEVERINTERFACE_H diff --git a/external/android/include/19/frameworks/av/include/media/MediaPlayerInterface.h b/external/android/include/19/frameworks/av/include/media/MediaPlayerInterface.h deleted file mode 100644 index 3b151ef..0000000 --- a/external/android/include/19/frameworks/av/include/media/MediaPlayerInterface.h +++ /dev/null @@ -1,253 +0,0 @@ -/* - * 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_MEDIAPLAYERINTERFACE_H -#define ANDROID_MEDIAPLAYERINTERFACE_H - -#ifdef __cplusplus - -#include -#include -#include -#include -#include - -#include -#include -#include - -// Fwd decl to make sure everyone agrees that the scope of struct sockaddr_in is -// global, and not in android:: -struct sockaddr_in; - -namespace android { - -class Parcel; -class Surface; -class IGraphicBufferProducer; - -template class SortedVector; - -enum player_type { - PV_PLAYER = 1, - SONIVOX_PLAYER = 2, - STAGEFRIGHT_PLAYER = 3, - NU_PLAYER = 4, - // Test players are available only in the 'test' and 'eng' builds. - // The shared library with the test player is passed passed as an - // argument to the 'test:' url in the setDataSource call. - TEST_PLAYER = 5, -}; - - -#define DEFAULT_AUDIOSINK_BUFFERCOUNT 4 -#define DEFAULT_AUDIOSINK_BUFFERSIZE 1200 -#define DEFAULT_AUDIOSINK_SAMPLERATE 44100 - -// when the channel mask isn't known, use the channel count to derive a mask in AudioSink::open() -#define CHANNEL_MASK_USE_CHANNEL_ORDER 0 - -// duration below which we do not allow deep audio buffering -#define AUDIO_SINK_MIN_DEEP_BUFFER_DURATION_US 5000000 - -// callback mechanism for passing messages to MediaPlayer object -typedef void (*notify_callback_f)(void* cookie, - int msg, int ext1, int ext2, const Parcel *obj); - -// abstract base class - use MediaPlayerInterface -class MediaPlayerBase : public RefBase -{ -public: - // AudioSink: abstraction layer for audio output - class AudioSink : public RefBase { - public: - enum cb_event_t { - CB_EVENT_FILL_BUFFER, // Request to write more data to buffer. - CB_EVENT_STREAM_END, // Sent after all the buffers queued in AF and HW are played - // back (after stop is called) - CB_EVENT_TEAR_DOWN // The AudioTrack was invalidated due to use case change: - // Need to re-evaluate offloading options - }; - - // Callback returns the number of bytes actually written to the buffer. - typedef size_t (*AudioCallback)( - AudioSink *audioSink, void *buffer, size_t size, void *cookie, - cb_event_t event); - - virtual ~AudioSink() {} - virtual bool ready() const = 0; // audio output is open and ready - virtual bool realtime() const = 0; // audio output is real-time output - virtual ssize_t bufferSize() const = 0; - virtual ssize_t frameCount() const = 0; - virtual ssize_t channelCount() const = 0; - virtual ssize_t frameSize() const = 0; - virtual uint32_t latency() const = 0; - virtual float msecsPerFrame() const = 0; - virtual status_t getPosition(uint32_t *position) const = 0; - virtual status_t getFramesWritten(uint32_t *frameswritten) const = 0; - virtual int getSessionId() const = 0; - - // If no callback is specified, use the "write" API below to submit - // audio data. - virtual status_t open( - uint32_t sampleRate, int channelCount, audio_channel_mask_t channelMask, - audio_format_t format=AUDIO_FORMAT_PCM_16_BIT, - int bufferCount=DEFAULT_AUDIOSINK_BUFFERCOUNT, - AudioCallback cb = NULL, - void *cookie = NULL, - audio_output_flags_t flags = AUDIO_OUTPUT_FLAG_NONE, - const audio_offload_info_t *offloadInfo = NULL) = 0; - - virtual status_t start() = 0; - virtual ssize_t write(const void* buffer, size_t size) = 0; - virtual void stop() = 0; - virtual void flush() = 0; - virtual void pause() = 0; - virtual void close() = 0; - - virtual status_t setPlaybackRatePermille(int32_t rate) { return INVALID_OPERATION; } - virtual bool needsTrailingPadding() { return true; } - - virtual status_t setParameters(const String8& keyValuePairs) { return NO_ERROR; }; - virtual String8 getParameters(const String8& keys) { return String8::empty(); }; - }; - - MediaPlayerBase() : mCookie(0), mNotify(0) {} - virtual ~MediaPlayerBase() {} - virtual status_t initCheck() = 0; - virtual bool hardwareOutput() = 0; - - virtual status_t setUID(uid_t uid) { - return INVALID_OPERATION; - } - - virtual status_t setDataSource( - const char *url, - const KeyedVector *headers = NULL) = 0; - - virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; - - virtual status_t setDataSource(const sp &source) { - return INVALID_OPERATION; - } - - // pass the buffered IGraphicBufferProducer to the media player service - virtual status_t setVideoSurfaceTexture( - const sp& bufferProducer) = 0; - - virtual status_t prepare() = 0; - virtual status_t prepareAsync() = 0; - virtual status_t start() = 0; - virtual status_t stop() = 0; - virtual status_t pause() = 0; - virtual bool isPlaying() = 0; - virtual status_t seekTo(int msec) = 0; - virtual status_t getCurrentPosition(int *msec) = 0; - virtual status_t getDuration(int *msec) = 0; - virtual status_t reset() = 0; - virtual status_t setLooping(int loop) = 0; - virtual player_type playerType() = 0; - virtual status_t setParameter(int key, const Parcel &request) = 0; - virtual status_t getParameter(int key, Parcel *reply) = 0; - - // default no-op implementation of optional extensions - virtual status_t setRetransmitEndpoint(const struct sockaddr_in* endpoint) { - return INVALID_OPERATION; - } - virtual status_t getRetransmitEndpoint(struct sockaddr_in* endpoint) { - return INVALID_OPERATION; - } - virtual status_t setNextPlayer(const sp& next) { - return OK; - } - - // Invoke a generic method on the player by using opaque parcels - // for the request and reply. - // - // @param request Parcel that is positioned at the start of the - // data sent by the java layer. - // @param[out] reply Parcel to hold the reply data. Cannot be null. - // @return OK if the call was successful. - virtual status_t invoke(const Parcel& request, Parcel *reply) = 0; - - // The Client in the MetadataPlayerService calls this method on - // the native player to retrieve all or a subset of metadata. - // - // @param ids SortedList of metadata ID to be fetch. If empty, all - // the known metadata should be returned. - // @param[inout] records Parcel where the player appends its metadata. - // @return OK if the call was successful. - virtual status_t getMetadata(const media::Metadata::Filter& ids, - Parcel *records) { - return INVALID_OPERATION; - }; - - void setNotifyCallback( - void* cookie, notify_callback_f notifyFunc) { - Mutex::Autolock autoLock(mNotifyLock); - mCookie = cookie; mNotify = notifyFunc; - } - - void sendEvent(int msg, int ext1=0, int ext2=0, - const Parcel *obj=NULL) { - Mutex::Autolock autoLock(mNotifyLock); - if (mNotify) mNotify(mCookie, msg, ext1, ext2, obj); - } - - virtual status_t dump(int fd, const Vector &args) const { - return INVALID_OPERATION; - } - - virtual status_t updateProxyConfig( - const char *host, int32_t port, const char *exclusionList) { - return INVALID_OPERATION; - } - -private: - friend class MediaPlayerService; - - Mutex mNotifyLock; - void* mCookie; - notify_callback_f mNotify; -}; - -// Implement this class for media players that use the AudioFlinger software mixer -class MediaPlayerInterface : public MediaPlayerBase -{ -public: - virtual ~MediaPlayerInterface() { } - virtual bool hardwareOutput() { return false; } - virtual void setAudioSink(const sp& audioSink) { mAudioSink = audioSink; } -protected: - sp mAudioSink; -}; - -// Implement this class for media players that output audio directly to hardware -class MediaPlayerHWInterface : public MediaPlayerBase -{ -public: - virtual ~MediaPlayerHWInterface() {} - virtual bool hardwareOutput() { return true; } - virtual status_t setVolume(float leftVolume, float rightVolume) = 0; - virtual status_t setAudioStreamType(audio_stream_type_t streamType) = 0; -}; - -}; // namespace android - -#endif // __cplusplus - - -#endif // ANDROID_MEDIAPLAYERINTERFACE_H diff --git a/external/android/include/19/frameworks/av/include/media/MediaProfiles.h b/external/android/include/19/frameworks/av/include/media/MediaProfiles.h deleted file mode 100644 index 9fc962c..0000000 --- a/external/android/include/19/frameworks/av/include/media/MediaProfiles.h +++ /dev/null @@ -1,518 +0,0 @@ -/* - ** - ** Copyright 2010, 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_MEDIAPROFILES_H -#define ANDROID_MEDIAPROFILES_H - -#include -#include - -namespace android { - -enum camcorder_quality { - CAMCORDER_QUALITY_LIST_START = 0, - CAMCORDER_QUALITY_LOW = 0, - CAMCORDER_QUALITY_HIGH = 1, - CAMCORDER_QUALITY_QCIF = 2, - CAMCORDER_QUALITY_CIF = 3, - CAMCORDER_QUALITY_480P = 4, - CAMCORDER_QUALITY_720P = 5, - CAMCORDER_QUALITY_1080P = 6, - CAMCORDER_QUALITY_QVGA = 7, - CAMCORDER_QUALITY_LIST_END = 7, - - CAMCORDER_QUALITY_TIME_LAPSE_LIST_START = 1000, - CAMCORDER_QUALITY_TIME_LAPSE_LOW = 1000, - CAMCORDER_QUALITY_TIME_LAPSE_HIGH = 1001, - CAMCORDER_QUALITY_TIME_LAPSE_QCIF = 1002, - CAMCORDER_QUALITY_TIME_LAPSE_CIF = 1003, - CAMCORDER_QUALITY_TIME_LAPSE_480P = 1004, - CAMCORDER_QUALITY_TIME_LAPSE_720P = 1005, - CAMCORDER_QUALITY_TIME_LAPSE_1080P = 1006, - CAMCORDER_QUALITY_TIME_LAPSE_QVGA = 1007, - CAMCORDER_QUALITY_TIME_LAPSE_LIST_END = 1007, -}; - -/** - * Set CIF as default maximum import and export resolution of video editor. - * The maximum import and export resolutions are platform specific, - * which should be defined in media_profiles.xml. - * Set default maximum prefetch YUV frames to 6, which means video editor can - * queue up to 6 YUV frames in the video encoder source. - * This value is used to limit the amount of memory used by video editor - * engine when the encoder consumes YUV frames at a lower speed - * than video editor engine produces. - */ -enum videoeditor_capability { - VIDEOEDITOR_DEFAULT_MAX_INPUT_FRAME_WIDTH = 352, - VIDEOEDITOR_DEFUALT_MAX_INPUT_FRAME_HEIGHT = 288, - VIDEOEDITOR_DEFAULT_MAX_OUTPUT_FRAME_WIDTH = 352, - VIDEOEDITOR_DEFUALT_MAX_OUTPUT_FRAME_HEIGHT = 288, - VIDEOEDITOR_DEFAULT_MAX_PREFETCH_YUV_FRAMES = 6 -}; - -enum video_decoder { - VIDEO_DECODER_WMV, -}; - -enum audio_decoder { - AUDIO_DECODER_WMA, -}; - - -class MediaProfiles -{ -public: - - /** - * Returns the singleton instance for subsequence queries. - * or NULL if error. - */ - static MediaProfiles* getInstance(); - - /** - * Returns the value for the given param name for the given camera at - * the given quality level, or -1 if error. - * - * Supported param name are: - * duration - the recording duration. - * file.format - output file format. see mediarecorder.h for details - * vid.codec - video encoder. see mediarecorder.h for details. - * aud.codec - audio encoder. see mediarecorder.h for details. - * vid.width - video frame width - * vid.height - video frame height - * vid.fps - video frame rate - * vid.bps - video bit rate - * aud.bps - audio bit rate - * aud.hz - audio sample rate - * aud.ch - number of audio channels - */ - int getCamcorderProfileParamByName(const char *name, int cameraId, - camcorder_quality quality) const; - - /** - * Returns true if a profile for the given camera at the given quality exists, - * or false if not. - */ - bool hasCamcorderProfile(int cameraId, camcorder_quality quality) const; - - /** - * Returns the output file formats supported. - */ - Vector getOutputFileFormats() const; - - /** - * Returns the video encoders supported. - */ - Vector getVideoEncoders() const; - - /** - * Returns the value for the given param name for the given video encoder - * returned from getVideoEncoderByIndex or -1 if error. - * - * Supported param name are: - * enc.vid.width.min - min video frame width - * enc.vid.width.max - max video frame width - * enc.vid.height.min - min video frame height - * enc.vid.height.max - max video frame height - * enc.vid.bps.min - min bit rate in bits per second - * enc.vid.bps.max - max bit rate in bits per second - * enc.vid.fps.min - min frame rate in frames per second - * enc.vid.fps.max - max frame rate in frames per second - */ - int getVideoEncoderParamByName(const char *name, video_encoder codec) const; - - /** - * Returns the value for the given param name for the video editor cap - * param or -1 if error. - * Supported param name are: - * videoeditor.input.width.max - max input video frame width - * videoeditor.input.height.max - max input video frame height - * videoeditor.output.width.max - max output video frame width - * videoeditor.output.height.max - max output video frame height - * maxPrefetchYUVFrames - max prefetch YUV frames in video editor engine. This value is used - * to limit the memory consumption. - */ - int getVideoEditorCapParamByName(const char *name) const; - - /** - * Returns the value for the given param name for the video editor export codec format - * param or -1 if error. - * Supported param name are: - * videoeditor.export.profile - export video profile - * videoeditor.export.level - export video level - * Supported param codec are: - * 1 for h263 - * 2 for h264 - * 3 for mpeg4 - */ - int getVideoEditorExportParamByName(const char *name, int codec) const; - - /** - * Returns the audio encoders supported. - */ - Vector getAudioEncoders() const; - - /** - * Returns the value for the given param name for the given audio encoder - * returned from getAudioEncoderByIndex or -1 if error. - * - * Supported param name are: - * enc.aud.ch.min - min number of channels - * enc.aud.ch.max - max number of channels - * enc.aud.bps.min - min bit rate in bits per second - * enc.aud.bps.max - max bit rate in bits per second - * enc.aud.hz.min - min sample rate in samples per second - * enc.aud.hz.max - max sample rate in samples per second - */ - int getAudioEncoderParamByName(const char *name, audio_encoder codec) const; - - /** - * Returns the video decoders supported. - */ - Vector getVideoDecoders() const; - - /** - * Returns the audio decoders supported. - */ - Vector getAudioDecoders() const; - - /** - * Returns the number of image encoding quality levels supported. - */ - Vector getImageEncodingQualityLevels(int cameraId) const; - - /** - * Returns the start time offset (in ms) for the given camera Id. - * If the given camera Id does not exist, -1 will be returned. - */ - int getStartTimeOffsetMs(int cameraId) const; - -private: - enum { - // Camcorder profiles (high/low) and timelapse profiles (high/low) - kNumRequiredProfiles = 4, - }; - - MediaProfiles& operator=(const MediaProfiles&); // Don't call me - MediaProfiles(const MediaProfiles&); // Don't call me - MediaProfiles() { mVideoEditorCap = NULL; } // Dummy default constructor - ~MediaProfiles(); // Don't delete me - - struct VideoCodec { - VideoCodec(video_encoder codec, int bitRate, int frameWidth, int frameHeight, int frameRate) - : mCodec(codec), - mBitRate(bitRate), - mFrameWidth(frameWidth), - mFrameHeight(frameHeight), - mFrameRate(frameRate) {} - - VideoCodec(const VideoCodec& copy) { - mCodec = copy.mCodec; - mBitRate = copy.mBitRate; - mFrameWidth = copy.mFrameWidth; - mFrameHeight = copy.mFrameHeight; - mFrameRate = copy.mFrameRate; - } - - ~VideoCodec() {} - - video_encoder mCodec; - int mBitRate; - int mFrameWidth; - int mFrameHeight; - int mFrameRate; - }; - - struct AudioCodec { - AudioCodec(audio_encoder codec, int bitRate, int sampleRate, int channels) - : mCodec(codec), - mBitRate(bitRate), - mSampleRate(sampleRate), - mChannels(channels) {} - - AudioCodec(const AudioCodec& copy) { - mCodec = copy.mCodec; - mBitRate = copy.mBitRate; - mSampleRate = copy.mSampleRate; - mChannels = copy.mChannels; - } - - ~AudioCodec() {} - - audio_encoder mCodec; - int mBitRate; - int mSampleRate; - int mChannels; - }; - - struct CamcorderProfile { - CamcorderProfile() - : mCameraId(0), - mFileFormat(OUTPUT_FORMAT_THREE_GPP), - mQuality(CAMCORDER_QUALITY_HIGH), - mDuration(0), - mVideoCodec(0), - mAudioCodec(0) {} - - CamcorderProfile(const CamcorderProfile& copy) { - mCameraId = copy.mCameraId; - mFileFormat = copy.mFileFormat; - mQuality = copy.mQuality; - mDuration = copy.mDuration; - mVideoCodec = new VideoCodec(*copy.mVideoCodec); - mAudioCodec = new AudioCodec(*copy.mAudioCodec); - } - - ~CamcorderProfile() { - delete mVideoCodec; - delete mAudioCodec; - } - - int mCameraId; - output_format mFileFormat; - camcorder_quality mQuality; - int mDuration; - VideoCodec *mVideoCodec; - AudioCodec *mAudioCodec; - }; - - struct VideoEncoderCap { - // Ugly constructor - VideoEncoderCap(video_encoder codec, - int minBitRate, int maxBitRate, - int minFrameWidth, int maxFrameWidth, - int minFrameHeight, int maxFrameHeight, - int minFrameRate, int maxFrameRate) - : mCodec(codec), - mMinBitRate(minBitRate), mMaxBitRate(maxBitRate), - mMinFrameWidth(minFrameWidth), mMaxFrameWidth(maxFrameWidth), - mMinFrameHeight(minFrameHeight), mMaxFrameHeight(maxFrameHeight), - mMinFrameRate(minFrameRate), mMaxFrameRate(maxFrameRate) {} - - ~VideoEncoderCap() {} - - video_encoder mCodec; - int mMinBitRate, mMaxBitRate; - int mMinFrameWidth, mMaxFrameWidth; - int mMinFrameHeight, mMaxFrameHeight; - int mMinFrameRate, mMaxFrameRate; - }; - - struct AudioEncoderCap { - // Ugly constructor - AudioEncoderCap(audio_encoder codec, - int minBitRate, int maxBitRate, - int minSampleRate, int maxSampleRate, - int minChannels, int maxChannels) - : mCodec(codec), - mMinBitRate(minBitRate), mMaxBitRate(maxBitRate), - mMinSampleRate(minSampleRate), mMaxSampleRate(maxSampleRate), - mMinChannels(minChannels), mMaxChannels(maxChannels) {} - - ~AudioEncoderCap() {} - - audio_encoder mCodec; - int mMinBitRate, mMaxBitRate; - int mMinSampleRate, mMaxSampleRate; - int mMinChannels, mMaxChannels; - }; - - struct VideoDecoderCap { - VideoDecoderCap(video_decoder codec): mCodec(codec) {} - ~VideoDecoderCap() {} - - video_decoder mCodec; - }; - - struct AudioDecoderCap { - AudioDecoderCap(audio_decoder codec): mCodec(codec) {} - ~AudioDecoderCap() {} - - audio_decoder mCodec; - }; - - struct NameToTagMap { - const char* name; - int tag; - }; - - struct ImageEncodingQualityLevels { - int mCameraId; - Vector mLevels; - }; - struct ExportVideoProfile { - ExportVideoProfile(int codec, int profile, int level) - :mCodec(codec),mProfile(profile),mLevel(level) {} - ~ExportVideoProfile() {} - int mCodec; - int mProfile; - int mLevel; - }; - struct VideoEditorCap { - VideoEditorCap(int inFrameWidth, int inFrameHeight, - int outFrameWidth, int outFrameHeight, int frames) - : mMaxInputFrameWidth(inFrameWidth), - mMaxInputFrameHeight(inFrameHeight), - mMaxOutputFrameWidth(outFrameWidth), - mMaxOutputFrameHeight(outFrameHeight), - mMaxPrefetchYUVFrames(frames) {} - - ~VideoEditorCap() {} - - int mMaxInputFrameWidth; - int mMaxInputFrameHeight; - int mMaxOutputFrameWidth; - int mMaxOutputFrameHeight; - int mMaxPrefetchYUVFrames; - }; - - int getCamcorderProfileIndex(int cameraId, camcorder_quality quality) const; - void initRequiredProfileRefs(const Vector& cameraIds); - int getRequiredProfileRefIndex(int cameraId); - - // Debug - static void logVideoCodec(const VideoCodec& codec); - static void logAudioCodec(const AudioCodec& codec); - static void logVideoEncoderCap(const VideoEncoderCap& cap); - static void logAudioEncoderCap(const AudioEncoderCap& cap); - static void logVideoDecoderCap(const VideoDecoderCap& cap); - static void logAudioDecoderCap(const AudioDecoderCap& cap); - static void logVideoEditorCap(const VideoEditorCap& cap); - - // If the xml configuration file does exist, use the settings - // from the xml - static MediaProfiles* createInstanceFromXmlFile(const char *xml); - static output_format createEncoderOutputFileFormat(const char **atts); - static VideoCodec* createVideoCodec(const char **atts, MediaProfiles *profiles); - static AudioCodec* createAudioCodec(const char **atts, MediaProfiles *profiles); - static AudioDecoderCap* createAudioDecoderCap(const char **atts); - static VideoDecoderCap* createVideoDecoderCap(const char **atts); - static VideoEncoderCap* createVideoEncoderCap(const char **atts); - static AudioEncoderCap* createAudioEncoderCap(const char **atts); - static VideoEditorCap* createVideoEditorCap( - const char **atts, MediaProfiles *profiles); - static ExportVideoProfile* createExportVideoProfile(const char **atts); - - static CamcorderProfile* createCamcorderProfile( - int cameraId, const char **atts, Vector& cameraIds); - - static int getCameraId(const char **atts); - - void addStartTimeOffset(int cameraId, const char **atts); - - ImageEncodingQualityLevels* findImageEncodingQualityLevels(int cameraId) const; - void addImageEncodingQualityLevel(int cameraId, const char** atts); - - // Customized element tag handler for parsing the xml configuration file. - static void startElementHandler(void *userData, const char *name, const char **atts); - - // If the xml configuration file does not exist, use hard-coded values - static MediaProfiles* createDefaultInstance(); - - static CamcorderProfile *createDefaultCamcorderQcifProfile(camcorder_quality quality); - static CamcorderProfile *createDefaultCamcorderCifProfile(camcorder_quality quality); - static void createDefaultCamcorderLowProfiles( - MediaProfiles::CamcorderProfile **lowProfile, - MediaProfiles::CamcorderProfile **lowSpecificProfile); - static void createDefaultCamcorderHighProfiles( - MediaProfiles::CamcorderProfile **highProfile, - MediaProfiles::CamcorderProfile **highSpecificProfile); - - static CamcorderProfile *createDefaultCamcorderTimeLapseQcifProfile(camcorder_quality quality); - static CamcorderProfile *createDefaultCamcorderTimeLapse480pProfile(camcorder_quality quality); - static void createDefaultCamcorderTimeLapseLowProfiles( - MediaProfiles::CamcorderProfile **lowTimeLapseProfile, - MediaProfiles::CamcorderProfile **lowSpecificTimeLapseProfile); - static void createDefaultCamcorderTimeLapseHighProfiles( - MediaProfiles::CamcorderProfile **highTimeLapseProfile, - MediaProfiles::CamcorderProfile **highSpecificTimeLapseProfile); - - static void createDefaultCamcorderProfiles(MediaProfiles *profiles); - static void createDefaultVideoEncoders(MediaProfiles *profiles); - static void createDefaultAudioEncoders(MediaProfiles *profiles); - static void createDefaultVideoDecoders(MediaProfiles *profiles); - static void createDefaultAudioDecoders(MediaProfiles *profiles); - static void createDefaultEncoderOutputFileFormats(MediaProfiles *profiles); - static void createDefaultImageEncodingQualityLevels(MediaProfiles *profiles); - static void createDefaultImageDecodingMaxMemory(MediaProfiles *profiles); - static void createDefaultVideoEditorCap(MediaProfiles *profiles); - static void createDefaultExportVideoProfiles(MediaProfiles *profiles); - - static VideoEncoderCap* createDefaultH263VideoEncoderCap(); - static VideoEncoderCap* createDefaultM4vVideoEncoderCap(); - static AudioEncoderCap* createDefaultAmrNBEncoderCap(); - - static int findTagForName(const NameToTagMap *map, size_t nMappings, const char *name); - - /** - * Check on existing profiles with the following criteria: - * 1. Low quality profile must have the lowest video - * resolution product (width x height) - * 2. High quality profile must have the highest video - * resolution product (width x height) - * - * and add required low/high quality camcorder/timelapse - * profiles if they are not found. This allows to remove - * duplicate profile definitions in the media_profiles.xml - * file. - */ - void checkAndAddRequiredProfilesIfNecessary(); - - - // Mappings from name (for instance, codec name) to enum value - static const NameToTagMap sVideoEncoderNameMap[]; - static const NameToTagMap sAudioEncoderNameMap[]; - static const NameToTagMap sFileFormatMap[]; - static const NameToTagMap sVideoDecoderNameMap[]; - static const NameToTagMap sAudioDecoderNameMap[]; - static const NameToTagMap sCamcorderQualityNameMap[]; - - static bool sIsInitialized; - static MediaProfiles *sInstance; - static Mutex sLock; - int mCurrentCameraId; - - Vector mCamcorderProfiles; - Vector mAudioEncoders; - Vector mVideoEncoders; - Vector mAudioDecoders; - Vector mVideoDecoders; - Vector mEncoderOutputFileFormats; - Vector mImageEncodingQualityLevels; - KeyedVector mStartTimeOffsets; - - typedef struct { - bool mHasRefProfile; // Refers to an existing profile - int mRefProfileIndex; // Reference profile index - int mResolutionProduct; // width x height - } RequiredProfileRefInfo; // Required low and high profiles - - typedef struct { - RequiredProfileRefInfo mRefs[kNumRequiredProfiles]; - int mCameraId; - } RequiredProfiles; - - RequiredProfiles *mRequiredProfileRefs; - Vector mCameraIds; - VideoEditorCap* mVideoEditorCap; - Vector mVideoEditorExportProfiles; -}; - -}; // namespace android - -#endif // ANDROID_MEDIAPROFILES_H diff --git a/external/android/include/19/frameworks/av/include/media/MediaRecorderBase.h b/external/android/include/19/frameworks/av/include/media/MediaRecorderBase.h deleted file mode 100644 index d7ac302..0000000 --- a/external/android/include/19/frameworks/av/include/media/MediaRecorderBase.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 MEDIA_RECORDER_BASE_H_ - -#define MEDIA_RECORDER_BASE_H_ - -#include - -#include - -namespace android { - -class ICameraRecordingProxy; -class Surface; -class IGraphicBufferProducer; - -struct MediaRecorderBase { - MediaRecorderBase() {} - virtual ~MediaRecorderBase() {} - - virtual status_t init() = 0; - virtual status_t setAudioSource(audio_source_t as) = 0; - virtual status_t setVideoSource(video_source vs) = 0; - virtual status_t setOutputFormat(output_format of) = 0; - virtual status_t setAudioEncoder(audio_encoder ae) = 0; - virtual status_t setVideoEncoder(video_encoder ve) = 0; - virtual status_t setVideoSize(int width, int height) = 0; - virtual status_t setVideoFrameRate(int frames_per_second) = 0; - virtual status_t setCamera(const sp& camera, - const sp& proxy) = 0; - virtual status_t setPreviewSurface(const sp& surface) = 0; - virtual status_t setOutputFile(const char *path) = 0; - virtual status_t setOutputFile(int fd, int64_t offset, int64_t length) = 0; - virtual status_t setOutputFileAuxiliary(int fd) {return INVALID_OPERATION;} - virtual status_t setParameters(const String8& params) = 0; - virtual status_t setListener(const sp& listener) = 0; - virtual status_t setClientName(const String16& clientName) = 0; - virtual status_t prepare() = 0; - virtual status_t start() = 0; - virtual status_t stop() = 0; - virtual status_t close() = 0; - virtual status_t reset() = 0; - virtual status_t getMaxAmplitude(int *max) = 0; - virtual status_t dump(int fd, const Vector& args) const = 0; - virtual sp querySurfaceMediaSource() const = 0; - -private: - MediaRecorderBase(const MediaRecorderBase &); - MediaRecorderBase &operator=(const MediaRecorderBase &); -}; - -} // namespace android - -#endif // MEDIA_RECORDER_BASE_H_ diff --git a/external/android/include/19/frameworks/av/include/media/MemoryLeakTrackUtil.h b/external/android/include/19/frameworks/av/include/media/MemoryLeakTrackUtil.h deleted file mode 100644 index d2618aa..0000000 --- a/external/android/include/19/frameworks/av/include/media/MemoryLeakTrackUtil.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2011, 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 MEMORY_LEAK_TRACK_UTIL_H -#define MEMORY_LEAK_TRACK_UTIL_H - -namespace android { -/* - * Dump the memory address of the calling process to the given fd. - */ -extern void dumpMemoryAddresses(int fd); - -}; - -#endif // MEMORY_LEAK_TRACK_UTIL_H diff --git a/external/android/include/19/frameworks/av/include/media/Metadata.h b/external/android/include/19/frameworks/av/include/media/Metadata.h deleted file mode 100644 index 07567eb..0000000 --- a/external/android/include/19/frameworks/av/include/media/Metadata.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 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_MEDIA_METADATA_H__ -#define ANDROID_MEDIA_METADATA_H__ - -#include -#include -#include -#include - -namespace android { -class Parcel; - -namespace media { - -// Metadata is a class to build/serialize a set of metadata in a Parcel. -// -// This class should be kept in sync with android/media/Metadata.java. -// It provides all the metadata ids available and methods to build the -// header, add records and adjust the set size header field. -// -// Typical Usage: -// ============== -// Parcel p; -// media::Metadata data(&p); -// -// data.appendHeader(); -// data.appendBool(Metadata::kPauseAvailable, true); -// ... more append ... -// data.updateLength(); -// - -class Metadata { - public: - typedef int32_t Type; - typedef SortedVector Filter; - - static const Type kAny = 0; - - // Playback capabilities. - static const Type kPauseAvailable = 1; // Boolean - static const Type kSeekBackwardAvailable = 2; // Boolean - static const Type kSeekForwardAvailable = 3; // Boolean - static const Type kSeekAvailable = 4; // Boolean - - // Keep in sync with android/media/Metadata.java - static const Type kTitle = 5; // String - static const Type kComment = 6; // String - static const Type kCopyright = 7; // String - static const Type kAlbum = 8; // String - static const Type kArtist = 9; // String - static const Type kAuthor = 10; // String - static const Type kComposer = 11; // String - static const Type kGenre = 12; // String - static const Type kDate = 13; // Date - static const Type kDuration = 14; // Integer(millisec) - static const Type kCdTrackNum = 15; // Integer 1-based - static const Type kCdTrackMax = 16; // Integer - static const Type kRating = 17; // String - static const Type kAlbumArt = 18; // byte[] - static const Type kVideoFrame = 19; // Bitmap - - static const Type kBitRate = 20; // Integer, Aggregate rate of - // all the streams in bps. - - static const Type kAudioBitRate = 21; // Integer, bps - static const Type kVideoBitRate = 22; // Integer, bps - static const Type kAudioSampleRate = 23; // Integer, Hz - static const Type kVideoframeRate = 24; // Integer, Hz - - // See RFC2046 and RFC4281. - static const Type kMimeType = 25; // String - static const Type kAudioCodec = 26; // String - static const Type kVideoCodec = 27; // String - - static const Type kVideoHeight = 28; // Integer - static const Type kVideoWidth = 29; // Integer - static const Type kNumTracks = 30; // Integer - static const Type kDrmCrippled = 31; // Boolean - - // @param p[inout] The parcel to append the metadata records - // to. The global metadata header should have been set already. - explicit Metadata(Parcel *p); - ~Metadata(); - - // Rewind the underlying parcel, undoing all the changes. - void resetParcel(); - - // Append the size and 'META' marker. - bool appendHeader(); - - // Once all the records have been added, call this to update the - // lenght field in the header. - void updateLength(); - - // append* are methods to append metadata. - // @param key Is the metadata Id. - // @param val Is the value of the metadata. - // @return true if successful, false otherwise. - // TODO: add more as needed to handle other types. - bool appendBool(Type key, bool val); - bool appendInt32(Type key, int32_t val); - - private: - Metadata(const Metadata&); - Metadata& operator=(const Metadata&); - - - // Checks the key is valid and not already present. - bool checkKey(Type key); - - Parcel *mData; - size_t mBegin; -}; - -} // namespace android::media -} // namespace android - -#endif // ANDROID_MEDIA_METADATA_H__ diff --git a/external/android/include/19/frameworks/av/include/media/SingleStateQueue.h b/external/android/include/19/frameworks/av/include/media/SingleStateQueue.h deleted file mode 100644 index 04c5fd0..0000000 --- a/external/android/include/19/frameworks/av/include/media/SingleStateQueue.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (C) 2012 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 SINGLE_STATE_QUEUE_H -#define SINGLE_STATE_QUEUE_H - -// Non-blocking single element state queue, or -// Non-blocking single-reader / single-writer multi-word atomic load / store - -#include - -namespace android { - -template class SingleStateQueue { - -public: - - class Mutator; - class Observer; - - struct Shared { - // needs to be part of a union so don't define constructor or destructor - - friend class Mutator; - friend class Observer; - -private: - void init() { mAck = 0; mSequence = 0; } - - volatile int32_t mAck; -#if 0 - int mPad[7]; - // cache line boundary -#endif - volatile int32_t mSequence; - T mValue; - }; - - class Mutator { - public: - Mutator(Shared *shared); - /*virtual*/ ~Mutator() { } - - // push new value onto state queue, overwriting previous value; - // returns a sequence number which can be used with ack() - int32_t push(const T& value); - - // return true if most recent push has been observed - bool ack(); - - // return true if a push with specified sequence number or later has been observed - bool ack(int32_t sequence); - - private: - int32_t mSequence; - Shared * const mShared; - }; - - class Observer { - public: - Observer(Shared *shared); - /*virtual*/ ~Observer() { } - - // return true if value has changed - bool poll(T& value); - - private: - int32_t mSequence; - int mSeed; // for PRNG - Shared * const mShared; - }; - -#if 0 - SingleStateQueue(void /*Shared*/ *shared); - /*virtual*/ ~SingleStateQueue() { } - - static size_t size() { return sizeof(Shared); } -#endif - -}; - -} // namespace android - -#endif // SINGLE_STATE_QUEUE_H diff --git a/external/android/include/19/frameworks/av/include/media/SoundPool.h b/external/android/include/19/frameworks/av/include/media/SoundPool.h deleted file mode 100644 index 2dd78cc..0000000 --- a/external/android/include/19/frameworks/av/include/media/SoundPool.h +++ /dev/null @@ -1,243 +0,0 @@ -/* - * 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 SOUNDPOOL_H_ -#define SOUNDPOOL_H_ - -#include -#include -#include -#include -#include -#include -#include - -namespace android { - -static const int IDLE_PRIORITY = -1; - -// forward declarations -class SoundEvent; -class SoundPoolThread; -class SoundPool; - -// for queued events -class SoundPoolEvent { -public: - SoundPoolEvent(int msg, int arg1=0, int arg2=0) : - mMsg(msg), mArg1(arg1), mArg2(arg2) {} - int mMsg; - int mArg1; - int mArg2; - enum MessageType { INVALID, SAMPLE_LOADED }; -}; - -// callback function prototype -typedef void SoundPoolCallback(SoundPoolEvent event, SoundPool* soundPool, void* user); - -// tracks samples used by application -class Sample : public RefBase { -public: - enum sample_state { UNLOADED, LOADING, READY, UNLOADING }; - Sample(int sampleID, const char* url); - Sample(int sampleID, int fd, int64_t offset, int64_t length); - ~Sample(); - int sampleID() { return mSampleID; } - int numChannels() { return mNumChannels; } - int sampleRate() { return mSampleRate; } - audio_format_t format() { return mFormat; } - size_t size() { return mSize; } - int state() { return mState; } - uint8_t* data() { return static_cast(mData->pointer()); } - status_t doLoad(); - void startLoad() { mState = LOADING; } - sp getIMemory() { return mData; } - - // hack - void init(int numChannels, int sampleRate, audio_format_t format, size_t size, - sp data ) { - mNumChannels = numChannels; mSampleRate = sampleRate; mFormat = format; mSize = size; - mData = data; } - -private: - void init(); - - size_t mSize; - volatile int32_t mRefCount; - uint16_t mSampleID; - uint16_t mSampleRate; - uint8_t mState : 3; - uint8_t mNumChannels : 2; - audio_format_t mFormat; - int mFd; - int64_t mOffset; - int64_t mLength; - char* mUrl; - sp mData; - sp mHeap; -}; - -// stores pending events for stolen channels -class SoundEvent -{ -public: - SoundEvent() : mChannelID(0), mLeftVolume(0), mRightVolume(0), - mPriority(IDLE_PRIORITY), mLoop(0), mRate(0) {} - void set(const sp& sample, int channelID, float leftVolume, - float rightVolume, int priority, int loop, float rate); - sp sample() { return mSample; } - int channelID() { return mChannelID; } - float leftVolume() { return mLeftVolume; } - float rightVolume() { return mRightVolume; } - int priority() { return mPriority; } - int loop() { return mLoop; } - float rate() { return mRate; } - void clear() { mChannelID = 0; mSample.clear(); } - -protected: - sp mSample; - int mChannelID; - float mLeftVolume; - float mRightVolume; - int mPriority; - int mLoop; - float mRate; -}; - -// for channels aka AudioTracks -class SoundChannel : public SoundEvent { -public: - enum state { IDLE, RESUMING, STOPPING, PAUSED, PLAYING }; - SoundChannel() : mState(IDLE), mNumChannels(1), - mPos(0), mToggle(0), mAutoPaused(false) {} - ~SoundChannel(); - void init(SoundPool* soundPool); - void play(const sp& sample, int channelID, float leftVolume, float rightVolume, - int priority, int loop, float rate); - void setVolume_l(float leftVolume, float rightVolume); - void setVolume(float leftVolume, float rightVolume); - void stop_l(); - void stop(); - void pause(); - void autoPause(); - void resume(); - void autoResume(); - void setRate(float rate); - int state() { return mState; } - void setPriority(int priority) { mPriority = priority; } - void setLoop(int loop); - int numChannels() { return mNumChannels; } - void clearNextEvent() { mNextEvent.clear(); } - void nextEvent(); - int nextChannelID() { return mNextEvent.channelID(); } - void dump(); - -private: - static void callback(int event, void* user, void *info); - void process(int event, void *info, unsigned long toggle); - bool doStop_l(); - - SoundPool* mSoundPool; - sp mAudioTrack; - SoundEvent mNextEvent; - Mutex mLock; - int mState; - int mNumChannels; - int mPos; - int mAudioBufferSize; - unsigned long mToggle; - bool mAutoPaused; -}; - -// application object for managing a pool of sounds -class SoundPool { - friend class SoundPoolThread; - friend class SoundChannel; -public: - SoundPool(int maxChannels, audio_stream_type_t streamType, int srcQuality); - ~SoundPool(); - int load(const char* url, int priority); - int load(int fd, int64_t offset, int64_t length, int priority); - bool unload(int sampleID); - int play(int sampleID, float leftVolume, float rightVolume, int priority, - int loop, float rate); - void pause(int channelID); - void autoPause(); - void resume(int channelID); - void autoResume(); - void stop(int channelID); - void setVolume(int channelID, float leftVolume, float rightVolume); - void setPriority(int channelID, int priority); - void setLoop(int channelID, int loop); - void setRate(int channelID, float rate); - audio_stream_type_t streamType() const { return mStreamType; } - int srcQuality() const { return mSrcQuality; } - - // called from SoundPoolThread - void sampleLoaded(int sampleID); - - // called from AudioTrack thread - void done_l(SoundChannel* channel); - - // callback function - void setCallback(SoundPoolCallback* callback, void* user); - void* getUserData() { return mUserData; } - -private: - SoundPool() {} // no default constructor - bool startThreads(); - void doLoad(sp& sample); - sp findSample(int sampleID) { return mSamples.valueFor(sampleID); } - SoundChannel* findChannel (int channelID); - SoundChannel* findNextChannel (int channelID); - SoundChannel* allocateChannel_l(int priority); - void moveToFront_l(SoundChannel* channel); - void notify(SoundPoolEvent event); - void dump(); - - // restart thread - void addToRestartList(SoundChannel* channel); - void addToStopList(SoundChannel* channel); - static int beginThread(void* arg); - int run(); - void quit(); - - Mutex mLock; - Mutex mRestartLock; - Condition mCondition; - SoundPoolThread* mDecodeThread; - SoundChannel* mChannelPool; - List mChannels; - List mRestart; - List mStop; - DefaultKeyedVector< int, sp > mSamples; - int mMaxChannels; - audio_stream_type_t mStreamType; - int mSrcQuality; - int mAllocated; - int mNextSampleID; - int mNextChannelID; - bool mQuit; - - // callback - Mutex mCallbackLock; - SoundPoolCallback* mCallback; - void* mUserData; -}; - -} // end namespace android - -#endif /*SOUNDPOOL_H_*/ diff --git a/external/android/include/19/frameworks/av/include/media/ToneGenerator.h b/external/android/include/19/frameworks/av/include/media/ToneGenerator.h deleted file mode 100644 index 98c4332..0000000 --- a/external/android/include/19/frameworks/av/include/media/ToneGenerator.h +++ /dev/null @@ -1,317 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_TONEGENERATOR_H_ -#define ANDROID_TONEGENERATOR_H_ - -#include -#include -#include -#include -#include - -namespace android { - -class ToneGenerator { -public: - - // List of all available tones - // This enum must be kept consistant with constants in ToneGenerator JAVA class - enum tone_type { - // DTMF tones ITU-T Recommendation Q.23 - TONE_DTMF_0 = 0, // 0 key: 1336Hz, 941Hz - TONE_DTMF_1, // 1 key: 1209Hz, 697Hz - TONE_DTMF_2, // 2 key: 1336Hz, 697Hz - TONE_DTMF_3, // 3 key: 1477Hz, 697Hz - TONE_DTMF_4, // 4 key: 1209Hz, 770Hz - TONE_DTMF_5, // 5 key: 1336Hz, 770Hz - TONE_DTMF_6, // 6 key: 1477Hz, 770Hz - TONE_DTMF_7, // 7 key: 1209Hz, 852Hz - TONE_DTMF_8, // 8 key: 1336Hz, 852Hz - TONE_DTMF_9, // 9 key: 1477Hz, 852Hz - TONE_DTMF_S, // * key: 1209Hz, 941Hz - TONE_DTMF_P, // # key: 1477Hz, 941Hz - TONE_DTMF_A, // A key: 1633Hz, 697Hz - TONE_DTMF_B, // B key: 1633Hz, 770Hz - TONE_DTMF_C, // C key: 1633Hz, 852Hz - TONE_DTMF_D, // D key: 1633Hz, 941Hz - // Call supervisory tones: 3GPP TS 22.001 (CEPT) - TONE_SUP_DIAL, // Dial tone: CEPT: 425Hz, continuous - FIRST_SUP_TONE = TONE_SUP_DIAL, - TONE_SUP_BUSY, // Busy tone, CEPT: 425Hz, 500ms ON, 500ms OFF... - TONE_SUP_CONGESTION, // Congestion tone CEPT, JAPAN: 425Hz, 200ms ON, 200ms OFF... - TONE_SUP_RADIO_ACK, // Radio path acknowlegment, CEPT, ANSI: 425Hz, 200ms ON - TONE_SUP_RADIO_NOTAVAIL, // Radio path not available: 425Hz, 200ms ON, 200 OFF 3 bursts - TONE_SUP_ERROR, // Error/Special info: 950Hz+1400Hz+1800Hz, 330ms ON, 1s OFF... - TONE_SUP_CALL_WAITING, // Call Waiting CEPT,JAPAN: 425Hz, 200ms ON, 600ms OFF, 200ms ON, 3s OFF... - TONE_SUP_RINGTONE, // Ring Tone CEPT, JAPAN: 425Hz, 1s ON, 4s OFF... - LAST_SUP_TONE = TONE_SUP_RINGTONE, - // Proprietary tones: 3GPP TS 31.111 - TONE_PROP_BEEP, // General beep: 400Hz+1200Hz, 35ms ON - TONE_PROP_ACK, // Positive Acknowlgement: 1200Hz, 100ms ON, 100ms OFF 2 bursts - TONE_PROP_NACK, // Negative Acknowlgement: 300Hz+400Hz+500Hz, 400ms ON - TONE_PROP_PROMPT, // Prompt tone: 400Hz+1200Hz, 200ms ON - TONE_PROP_BEEP2, // General double beep: 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms on - // Additional call supervisory tones: specified by IS-95 only - TONE_SUP_INTERCEPT, // Intercept tone: alternating 440 Hz and 620 Hz tones, each on for 250 ms. - TONE_SUP_INTERCEPT_ABBREV, // Abbreviated intercept: intercept tone limited to 4 seconds - TONE_SUP_CONGESTION_ABBREV, // Abbreviated congestion: congestion tone limited to 4 seconds - TONE_SUP_CONFIRM, // Confirm tone: a 350 Hz tone added to a 440 Hz tone repeated 3 times in a 100 ms on, 100 ms off cycle. - TONE_SUP_PIP, // Pip tone: four bursts of 480 Hz tone (0.1 s on, 0.1 s off). - - // CDMA Tones - TONE_CDMA_DIAL_TONE_LITE, - TONE_CDMA_NETWORK_USA_RINGBACK, - TONE_CDMA_INTERCEPT, - TONE_CDMA_ABBR_INTERCEPT, - TONE_CDMA_REORDER, - TONE_CDMA_ABBR_REORDER, - TONE_CDMA_NETWORK_BUSY, - TONE_CDMA_CONFIRM, - TONE_CDMA_ANSWER, - TONE_CDMA_NETWORK_CALLWAITING, - TONE_CDMA_PIP, - - // ISDN - TONE_CDMA_CALL_SIGNAL_ISDN_NORMAL, // ISDN Alert Normal - TONE_CDMA_CALL_SIGNAL_ISDN_INTERGROUP, // ISDN Intergroup - TONE_CDMA_CALL_SIGNAL_ISDN_SP_PRI, // ISDN SP PRI - TONE_CDMA_CALL_SIGNAL_ISDN_PAT3, // ISDN Alert PAT3 - TONE_CDMA_CALL_SIGNAL_ISDN_PING_RING, // ISDN Alert PING RING - TONE_CDMA_CALL_SIGNAL_ISDN_PAT5, // ISDN Alert PAT5 - TONE_CDMA_CALL_SIGNAL_ISDN_PAT6, // ISDN Alert PAT6 - TONE_CDMA_CALL_SIGNAL_ISDN_PAT7, // ISDN Alert PAT7 - // ISDN end - - // IS54 - TONE_CDMA_HIGH_L, // IS54 High Pitch Long - TONE_CDMA_MED_L, // IS54 Med Pitch Long - TONE_CDMA_LOW_L, // IS54 Low Pitch Long - TONE_CDMA_HIGH_SS, // IS54 High Pitch Short Short - TONE_CDMA_MED_SS, // IS54 Medium Pitch Short Short - TONE_CDMA_LOW_SS, // IS54 Low Pitch Short Short - TONE_CDMA_HIGH_SSL, // IS54 High Pitch Short Short Long - TONE_CDMA_MED_SSL, // IS54 Medium Pitch Short Short Long - TONE_CDMA_LOW_SSL, // IS54 Low Pitch Short Short Long - TONE_CDMA_HIGH_SS_2, // IS54 High Pitch Short Short 2 - TONE_CDMA_MED_SS_2, // IS54 Med Pitch Short Short 2 - TONE_CDMA_LOW_SS_2, // IS54 Low Pitch Short Short 2 - TONE_CDMA_HIGH_SLS, // IS54 High Pitch Short Long Short - TONE_CDMA_MED_SLS, // IS54 Med Pitch Short Long Short - TONE_CDMA_LOW_SLS, // IS54 Low Pitch Short Long Short - TONE_CDMA_HIGH_S_X4, // IS54 High Pitch Short Short Short Short - TONE_CDMA_MED_S_X4, // IS54 Med Pitch Short Short Short Short - TONE_CDMA_LOW_S_X4, // IS54 Low Pitch Short Short Short Short - TONE_CDMA_HIGH_PBX_L, // PBX High Pitch Long - TONE_CDMA_MED_PBX_L, // PBX Med Pitch Long - TONE_CDMA_LOW_PBX_L, // PBX Low Pitch Long - TONE_CDMA_HIGH_PBX_SS, // PBX High Short Short - TONE_CDMA_MED_PBX_SS, // PBX Med Short Short - TONE_CDMA_LOW_PBX_SS, // PBX Low Short Short - TONE_CDMA_HIGH_PBX_SSL, // PBX High Short Short Long - TONE_CDMA_MED_PBX_SSL, // PBX Med Short Short Long - TONE_CDMA_LOW_PBX_SSL, // PBX Low Short Short Long - TONE_CDMA_HIGH_PBX_SLS, // PBX High SLS - TONE_CDMA_MED_PBX_SLS, // PBX Med SLS - TONE_CDMA_LOW_PBX_SLS, // PBX Low SLS - TONE_CDMA_HIGH_PBX_S_X4, // PBX High SSSS - TONE_CDMA_MED_PBX_S_X4, // PBX Med SSSS - TONE_CDMA_LOW_PBX_S_X4, // PBX LOW SSSS - //IS54 end - // proprietary - TONE_CDMA_ALERT_NETWORK_LITE, - TONE_CDMA_ALERT_AUTOREDIAL_LITE, - TONE_CDMA_ONE_MIN_BEEP, - TONE_CDMA_KEYPAD_VOLUME_KEY_LITE, - TONE_CDMA_PRESSHOLDKEY_LITE, - TONE_CDMA_ALERT_INCALL_LITE, - TONE_CDMA_EMERGENCY_RINGBACK, - TONE_CDMA_ALERT_CALL_GUARD, - TONE_CDMA_SOFT_ERROR_LITE, - TONE_CDMA_CALLDROP_LITE, - // proprietary end - TONE_CDMA_NETWORK_BUSY_ONE_SHOT, - TONE_CDMA_ABBR_ALERT, - TONE_CDMA_SIGNAL_OFF, - //CDMA end - NUM_TONES, - NUM_SUP_TONES = LAST_SUP_TONE-FIRST_SUP_TONE+1 - }; - - ToneGenerator(audio_stream_type_t streamType, float volume, bool threadCanCallJava = false); - ~ToneGenerator(); - - bool startTone(tone_type toneType, int durationMs = -1); - void stopTone(); - - bool isInited() { return (mState == TONE_IDLE)?false:true;} - - // returns the audio session this ToneGenerator belongs to or 0 if an error occured. - int getSessionId() { return (mpAudioTrack == 0) ? 0 : mpAudioTrack->getSessionId(); } - -private: - - enum tone_state { - TONE_IDLE, // ToneGenerator is being initialized or initialization failed - TONE_INIT, // ToneGenerator has been successfully initialized and is not playing - TONE_STARTING, // ToneGenerator is starting playing - TONE_PLAYING, // ToneGenerator is playing - TONE_STOPPING, // ToneGenerator is stoping - TONE_STOPPED, // ToneGenerator is stopped: the AudioTrack will be stopped - TONE_RESTARTING // A start request was received in active state (playing or stopping) - }; - - - // Region specific tones. - // These supervisory tones are different depending on the region (USA/CANADA, JAPAN, rest of the world). - // When a tone in the range [FIRST_SUP_TONE, LAST_SUP_TONE] is requested, the region is determined - // from system property gsm.operator.iso-country and the proper tone descriptor is selected with the - // help of sToneMappingTable[] - enum regional_tone_type { - // ANSI supervisory tones - TONE_ANSI_DIAL = NUM_TONES, // Dial tone: a continuous 350 Hz + 440 Hz tone. - TONE_ANSI_BUSY, // Busy tone on: a 480 Hz + 620 Hz tone repeated in a 500 ms on, 500 ms off cycle. - TONE_ANSI_CONGESTION, // Network congestion (reorder) tone on: a 480 Hz + 620 Hz tone repeated in a 250 ms on, 250 ms off cycle. - TONE_ANSI_CALL_WAITING, // Call waiting tone on: 440 Hz, on for 300 ms, 9,7 s off followed by - // (440 Hz, on for 100 ms off for 100 ms, on for 100 ms, 9,7s off and repeated as necessary). - TONE_ANSI_RINGTONE, // Ring Tone: a 440 Hz + 480 Hz tone repeated in a 2 s on, 4 s off pattern. - // JAPAN Supervisory tones - TONE_JAPAN_DIAL, // Dial tone: 400Hz, continuous - TONE_JAPAN_BUSY, // Busy tone: 400Hz, 500ms ON, 500ms OFF... - TONE_JAPAN_RADIO_ACK, // Radio path acknowlegment: 400Hz, 1s ON, 2s OFF... - NUM_ALTERNATE_TONES - }; - - enum region { - ANSI, - JAPAN, - CEPT, - NUM_REGIONS - }; - - static const unsigned char sToneMappingTable[NUM_REGIONS-1][NUM_SUP_TONES]; - - static const unsigned int TONEGEN_MAX_WAVES = 3; // Maximun number of sine waves in a tone segment - static const unsigned int TONEGEN_MAX_SEGMENTS = 12; // Maximun number of segments in a tone descriptor - static const unsigned int TONEGEN_INF = 0xFFFFFFFF; // Represents infinite time duration - static const float TONEGEN_GAIN = 0.9; // Default gain passed to WaveGenerator(). - - // ToneDescriptor class contains all parameters needed to generate a tone: - // - The array waveFreq[]: - // 1 for static tone descriptors: contains the frequencies of all individual waves making the multi-tone. - // 2 for active tone descritors: contains the indexes of the WaveGenerator objects in mWaveGens - // The number of sine waves varies from 1 to TONEGEN_MAX_WAVES. - // The first null value indicates that no more waves are needed. - // - The array segments[] is used to generate the tone pulses. A segment is a period of time - // during which the tone is ON or OFF. Segments with even index (starting from 0) - // correspond to tone ON state and segments with odd index to OFF state. - // The data stored in segments[] is the duration of the corresponding period in ms. - // The first segment encountered with a 0 duration indicates that no more segment follows. - // - loopCnt - Number of times to repeat a sequence of seqments after playing this - // - loopIndx - The segment index to go back and play is loopcnt > 0 - // - repeatCnt indicates the number of times the sequence described by segments[] array must be repeated. - // When the tone generator encounters the first 0 duration segment, it will compare repeatCnt to mCurCount. - // If mCurCount > repeatCnt, the tone is stopped automatically. Otherwise, tone sequence will be - // restarted from segment repeatSegment. - // - repeatSegment number of the first repeated segment when repeatCnt is not null - - class ToneSegment { - public: - unsigned int duration; - unsigned short waveFreq[TONEGEN_MAX_WAVES+1]; - unsigned short loopCnt; - unsigned short loopIndx; - }; - - class ToneDescriptor { - public: - ToneSegment segments[TONEGEN_MAX_SEGMENTS+1]; - unsigned long repeatCnt; - unsigned long repeatSegment; - }; - - static const ToneDescriptor sToneDescriptors[]; - - bool mThreadCanCallJava; - unsigned int mTotalSmp; // Total number of audio samples played (gives current time) - unsigned int mNextSegSmp; // Position of next segment transition expressed in samples - // NOTE: because mTotalSmp, mNextSegSmp are stored on 32 bit, current design will operate properly - // only if tone duration is less than about 27 Hours(@44100Hz sampling rate). If this time is exceeded, - // no crash will occur but tone sequence will show a glitch. - unsigned int mMaxSmp; // Maximum number of audio samples played (maximun tone duration) - int mDurationMs; // Maximum tone duration in ms - - unsigned short mCurSegment; // Current segment index in ToneDescriptor segments[] - unsigned short mCurCount; // Current sequence repeat count - volatile unsigned short mState; // ToneGenerator state (tone_state) - unsigned short mRegion; - const ToneDescriptor *mpToneDesc; // pointer to active tone descriptor - const ToneDescriptor *mpNewToneDesc; // pointer to next active tone descriptor - - unsigned short mLoopCounter; // Current tone loopback count - - uint32_t mSamplingRate; // AudioFlinger Sampling rate - sp mpAudioTrack; // Pointer to audio track used for playback - Mutex mLock; // Mutex to control concurent access to ToneGenerator object from audio callback and application API - Mutex mCbkCondLock; // Mutex associated to mWaitCbkCond - Condition mWaitCbkCond; // condition enabling interface to wait for audio callback completion after a change is requested - float mVolume; // Volume applied to audio track - audio_stream_type_t mStreamType; // Audio stream used for output - unsigned int mProcessSize; // Size of audio blocks generated at a time by audioCallback() (in PCM frames). - struct timespec mStartTime; // tone start time: needed to guaranty actual tone duration - - bool initAudioTrack(); - static void audioCallback(int event, void* user, void *info); - bool prepareWave(); - unsigned int numWaves(unsigned int segmentIdx); - void clearWaveGens(); - tone_type getToneForRegion(tone_type toneType); - - // WaveGenerator generates a single sine wave - class WaveGenerator { - public: - enum gen_command { - WAVEGEN_START, // Start/restart wave from phase 0 - WAVEGEN_CONT, // Continue wave from current phase - WAVEGEN_STOP // Stop wave on zero crossing - }; - - WaveGenerator(unsigned short samplingRate, unsigned short frequency, - float volume); - ~WaveGenerator(); - - void getSamples(short *outBuffer, unsigned int count, - unsigned int command); - - private: - static const short GEN_AMP = 32000; // amplitude of generator - static const short S_Q14 = 14; // shift for Q14 - static const short S_Q15 = 15; // shift for Q15 - - short mA1_Q14; // Q14 coefficient - // delay line of full amplitude generator - short mS1, mS2; // delay line S2 oldest - short mS2_0; // saved value for reinitialisation - short mAmplitude_Q15; // Q15 amplitude - }; - - KeyedVector mWaveGens; // list of active wave generators. -}; - -} -; // namespace android - -#endif /*ANDROID_TONEGENERATOR_H_*/ diff --git a/external/android/include/19/frameworks/av/include/media/Visualizer.h b/external/android/include/19/frameworks/av/include/media/Visualizer.h deleted file mode 100644 index 6167dd6..0000000 --- a/external/android/include/19/frameworks/av/include/media/Visualizer.h +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright (C) 2010 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_MEDIA_VISUALIZER_H -#define ANDROID_MEDIA_VISUALIZER_H - -#include -#include -#include - -/** - * The Visualizer class enables application to retrieve part of the currently playing audio for - * visualization purpose. It is not an audio recording interface and only returns partial and low - * quality audio content. However, to protect privacy of certain audio data (e.g voice mail) the use - * of the visualizer requires the permission android.permission.RECORD_AUDIO. - * The audio session ID passed to the constructor indicates which audio content should be - * visualized: - * - If the session is 0, the audio output mix is visualized - * - If the session is not 0, the audio from a particular MediaPlayer or AudioTrack - * using this audio session is visualized - * Two types of representation of audio content can be captured: - * - Waveform data: consecutive 8-bit (unsigned) mono samples by using the getWaveForm() method - * - Frequency data: 8-bit magnitude FFT by using the getFft() method - * - * The length of the capture can be retrieved or specified by calling respectively - * getCaptureSize() and setCaptureSize() methods. Note that the size of the FFT - * is half of the specified capture size but both sides of the spectrum are returned yielding in a - * number of bytes equal to the capture size. The capture size must be a power of 2 in the range - * returned by getMinCaptureSize() and getMaxCaptureSize(). - * In addition to the polling capture mode, a callback mode is also available by installing a - * callback function by use of the setCaptureCallBack() method. The rate at which the callback - * is called as well as the type of data returned is specified. - * Before capturing data, the Visualizer must be enabled by calling the setEnabled() method. - * When data capture is not needed any more, the Visualizer should be disabled. - */ - - -namespace android { - -// ---------------------------------------------------------------------------- - -class Visualizer: public AudioEffect { -public: - - enum callback_flags { - CAPTURE_WAVEFORM = 0x00000001, // capture callback returns a PCM wave form - CAPTURE_FFT = 0x00000002, // apture callback returns a frequency representation - CAPTURE_CALL_JAVA = 0x00000004 // the callback thread can call java - }; - - - /* Constructor. - * See AudioEffect constructor for details on parameters. - */ - Visualizer(int32_t priority = 0, - effect_callback_t cbf = NULL, - void* user = NULL, - int sessionId = 0); - - ~Visualizer(); - - virtual status_t setEnabled(bool enabled); - - // maximum capture size in samples - static uint32_t getMaxCaptureSize() { return VISUALIZER_CAPTURE_SIZE_MAX; } - // minimum capture size in samples - static uint32_t getMinCaptureSize() { return VISUALIZER_CAPTURE_SIZE_MIN; } - // maximum capture rate in millihertz - static uint32_t getMaxCaptureRate() { return CAPTURE_RATE_MAX; } - - // callback used to return periodic PCM or FFT captures to the application. Either one or both - // types of data are returned (PCM and FFT) according to flags indicated when installing the - // callback. When a type of data is not present, the corresponding size (waveformSize or - // fftSize) is 0. - typedef void (*capture_cbk_t)(void* user, - uint32_t waveformSize, - uint8_t *waveform, - uint32_t fftSize, - uint8_t *fft, - uint32_t samplingrate); - - // install a callback to receive periodic captures. The capture rate is specified in milliHertz - // and the capture format is according to flags (see callback_flags). - status_t setCaptureCallBack(capture_cbk_t cbk, void* user, uint32_t flags, uint32_t rate); - - // set the capture size capture size must be a power of two in the range - // [VISUALIZER_CAPTURE_SIZE_MAX. VISUALIZER_CAPTURE_SIZE_MIN] - // must be called when the visualizer is not enabled - status_t setCaptureSize(uint32_t size); - uint32_t getCaptureSize() { return mCaptureSize; } - - // returns the capture rate indicated when installing the callback - uint32_t getCaptureRate() { return mCaptureRate; } - - // returns the sampling rate of the audio being captured - uint32_t getSamplingRate() { return mSampleRate; } - - // set the way volume affects the captured data - // mode must one of VISUALIZER_SCALING_MODE_NORMALIZED, - // VISUALIZER_SCALING_MODE_AS_PLAYED - status_t setScalingMode(uint32_t mode); - uint32_t getScalingMode() { return mScalingMode; } - - // set which measurements are done on the audio buffers processed by the effect. - // valid measurements (mask): MEASUREMENT_MODE_PEAK_RMS - status_t setMeasurementMode(uint32_t mode); - uint32_t getMeasurementMode() { return mMeasurementMode; } - - // return a set of int32_t measurements - status_t getIntMeasurements(uint32_t type, uint32_t number, int32_t *measurements); - - // return a capture in PCM 8 bit unsigned format. The size of the capture is equal to - // getCaptureSize() - status_t getWaveForm(uint8_t *waveform); - - // return a capture in FFT 8 bit signed format. The size of the capture is equal to - // getCaptureSize() but the length of the FFT is half of the size (both parts of the spectrum - // are returned - status_t getFft(uint8_t *fft); - -protected: - // from IEffectClient - virtual void controlStatusChanged(bool controlGranted); - -private: - - static const uint32_t CAPTURE_RATE_MAX = 20000; - static const uint32_t CAPTURE_RATE_DEF = 10000; - static const uint32_t CAPTURE_SIZE_DEF = VISUALIZER_CAPTURE_SIZE_MAX; - - /* internal class to handle the callback */ - class CaptureThread : public Thread - { - public: - CaptureThread(Visualizer& receiver, uint32_t captureRate, bool bCanCallJava = false); - - private: - friend class Visualizer; - virtual bool threadLoop(); - Visualizer& mReceiver; - Mutex mLock; - uint32_t mSleepTimeUs; - }; - - status_t doFft(uint8_t *fft, uint8_t *waveform); - void periodicCapture(); - uint32_t initCaptureSize(); - - Mutex mCaptureLock; - uint32_t mCaptureRate; - uint32_t mCaptureSize; - uint32_t mSampleRate; - uint32_t mScalingMode; - uint32_t mMeasurementMode; - capture_cbk_t mCaptureCallBack; - void *mCaptureCbkUser; - sp mCaptureThread; - uint32_t mCaptureFlags; -}; - - -}; // namespace android - -#endif // ANDROID_MEDIA_VISUALIZER_H diff --git a/external/android/include/19/frameworks/av/include/media/mediametadataretriever.h b/external/android/include/19/frameworks/av/include/media/mediametadataretriever.h deleted file mode 100644 index 0df77c1..0000000 --- a/external/android/include/19/frameworks/av/include/media/mediametadataretriever.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * 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. - */ - - -#ifndef MEDIAMETADATARETRIEVER_H -#define MEDIAMETADATARETRIEVER_H - -#include // for status_t -#include -#include -#include - -namespace android { - -class IMediaPlayerService; -class IMediaMetadataRetriever; - -// Keep these in synch with the constants defined in MediaMetadataRetriever.java -// class. -enum { - METADATA_KEY_CD_TRACK_NUMBER = 0, - METADATA_KEY_ALBUM = 1, - METADATA_KEY_ARTIST = 2, - METADATA_KEY_AUTHOR = 3, - METADATA_KEY_COMPOSER = 4, - METADATA_KEY_DATE = 5, - METADATA_KEY_GENRE = 6, - METADATA_KEY_TITLE = 7, - METADATA_KEY_YEAR = 8, - METADATA_KEY_DURATION = 9, - METADATA_KEY_NUM_TRACKS = 10, - METADATA_KEY_WRITER = 11, - METADATA_KEY_MIMETYPE = 12, - METADATA_KEY_ALBUMARTIST = 13, - METADATA_KEY_DISC_NUMBER = 14, - METADATA_KEY_COMPILATION = 15, - METADATA_KEY_HAS_AUDIO = 16, - METADATA_KEY_HAS_VIDEO = 17, - METADATA_KEY_VIDEO_WIDTH = 18, - METADATA_KEY_VIDEO_HEIGHT = 19, - METADATA_KEY_BITRATE = 20, - METADATA_KEY_TIMED_TEXT_LANGUAGES = 21, - METADATA_KEY_IS_DRM = 22, - METADATA_KEY_LOCATION = 23, - METADATA_KEY_VIDEO_ROTATION = 24, - - // Add more here... -}; - -class MediaMetadataRetriever: public RefBase -{ -public: - MediaMetadataRetriever(); - ~MediaMetadataRetriever(); - void disconnect(); - - status_t setDataSource( - const char *dataSourceUrl, - const KeyedVector *headers = NULL); - - status_t setDataSource(int fd, int64_t offset, int64_t length); - sp getFrameAtTime(int64_t timeUs, int option); - sp extractAlbumArt(); - const char* extractMetadata(int keyCode); - -private: - static const sp& getService(); - - class DeathNotifier: public IBinder::DeathRecipient - { - public: - DeathNotifier() {} - virtual ~DeathNotifier(); - virtual void binderDied(const wp& who); - }; - - static sp sDeathNotifier; - static Mutex sServiceLock; - static sp sService; - - Mutex mLock; - sp mRetriever; - -}; - -}; // namespace android - -#endif // MEDIAMETADATARETRIEVER_H diff --git a/external/android/include/19/frameworks/av/include/media/mediaplayer.h b/external/android/include/19/frameworks/av/include/media/mediaplayer.h deleted file mode 100644 index 4c05fc3..0000000 --- a/external/android/include/19/frameworks/av/include/media/mediaplayer.h +++ /dev/null @@ -1,283 +0,0 @@ -/* - * 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_MEDIAPLAYER_H -#define ANDROID_MEDIAPLAYER_H - -#include - -#include -#include -#include -#include -#include - -#include -#include - -class ANativeWindow; - -namespace android { - -class Surface; -class IGraphicBufferProducer; - -enum media_event_type { - MEDIA_NOP = 0, // interface test message - MEDIA_PREPARED = 1, - MEDIA_PLAYBACK_COMPLETE = 2, - MEDIA_BUFFERING_UPDATE = 3, - MEDIA_SEEK_COMPLETE = 4, - MEDIA_SET_VIDEO_SIZE = 5, - MEDIA_STARTED = 6, - MEDIA_PAUSED = 7, - MEDIA_STOPPED = 8, - MEDIA_SKIPPED = 9, - MEDIA_TIMED_TEXT = 99, - MEDIA_ERROR = 100, - MEDIA_INFO = 200, - MEDIA_SUBTITLE_DATA = 201, -}; - -// Generic error codes for the media player framework. Errors are fatal, the -// playback must abort. -// -// Errors are communicated back to the client using the -// MediaPlayerListener::notify method defined below. -// In this situation, 'notify' is invoked with the following: -// 'msg' is set to MEDIA_ERROR. -// 'ext1' should be a value from the enum media_error_type. -// 'ext2' contains an implementation dependant error code to provide -// more details. Should default to 0 when not used. -// -// The codes are distributed as follow: -// 0xx: Reserved -// 1xx: Android Player errors. Something went wrong inside the MediaPlayer. -// 2xx: Media errors (e.g Codec not supported). There is a problem with the -// media itself. -// 3xx: Runtime errors. Some extraordinary condition arose making the playback -// impossible. -// -enum media_error_type { - // 0xx - MEDIA_ERROR_UNKNOWN = 1, - // 1xx - MEDIA_ERROR_SERVER_DIED = 100, - // 2xx - MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK = 200, - // 3xx -}; - - -// Info and warning codes for the media player framework. These are non fatal, -// the playback is going on but there might be some user visible issues. -// -// Info and warning messages are communicated back to the client using the -// MediaPlayerListener::notify method defined below. In this situation, -// 'notify' is invoked with the following: -// 'msg' is set to MEDIA_INFO. -// 'ext1' should be a value from the enum media_info_type. -// 'ext2' contains an implementation dependant info code to provide -// more details. Should default to 0 when not used. -// -// The codes are distributed as follow: -// 0xx: Reserved -// 7xx: Android Player info/warning (e.g player lagging behind.) -// 8xx: Media info/warning (e.g media badly interleaved.) -// -enum media_info_type { - // 0xx - MEDIA_INFO_UNKNOWN = 1, - // The player was started because it was used as the next player for another - // player, which just completed playback - MEDIA_INFO_STARTED_AS_NEXT = 2, - // The player just pushed the very first video frame for rendering - MEDIA_INFO_RENDERING_START = 3, - // 7xx - // The video is too complex for the decoder: it can't decode frames fast - // enough. Possibly only the audio plays fine at this stage. - MEDIA_INFO_VIDEO_TRACK_LAGGING = 700, - // MediaPlayer is temporarily pausing playback internally in order to - // buffer more data. - MEDIA_INFO_BUFFERING_START = 701, - // MediaPlayer is resuming playback after filling buffers. - MEDIA_INFO_BUFFERING_END = 702, - // Bandwidth in recent past - MEDIA_INFO_NETWORK_BANDWIDTH = 703, - - // 8xx - // Bad interleaving means that a media has been improperly interleaved or not - // interleaved at all, e.g has all the video samples first then all the audio - // ones. Video is playing but a lot of disk seek may be happening. - MEDIA_INFO_BAD_INTERLEAVING = 800, - // The media is not seekable (e.g live stream). - MEDIA_INFO_NOT_SEEKABLE = 801, - // New media metadata is available. - MEDIA_INFO_METADATA_UPDATE = 802, - - //9xx - MEDIA_INFO_TIMED_TEXT_ERROR = 900, -}; - - - -enum media_player_states { - MEDIA_PLAYER_STATE_ERROR = 0, - MEDIA_PLAYER_IDLE = 1 << 0, - MEDIA_PLAYER_INITIALIZED = 1 << 1, - MEDIA_PLAYER_PREPARING = 1 << 2, - MEDIA_PLAYER_PREPARED = 1 << 3, - MEDIA_PLAYER_STARTED = 1 << 4, - MEDIA_PLAYER_PAUSED = 1 << 5, - MEDIA_PLAYER_STOPPED = 1 << 6, - MEDIA_PLAYER_PLAYBACK_COMPLETE = 1 << 7 -}; - -// Keep KEY_PARAMETER_* in sync with MediaPlayer.java. -// The same enum space is used for both set and get, in case there are future keys that -// can be both set and get. But as of now, all parameters are either set only or get only. -enum media_parameter_keys { - // Streaming/buffering parameters - KEY_PARAMETER_CACHE_STAT_COLLECT_FREQ_MS = 1100, // set only - - // Return a Parcel containing a single int, which is the channel count of the - // audio track, or zero for error (e.g. no audio track) or unknown. - KEY_PARAMETER_AUDIO_CHANNEL_COUNT = 1200, // get only - - // Playback rate expressed in permille (1000 is normal speed), saved as int32_t, with negative - // values used for rewinding or reverse playback. - KEY_PARAMETER_PLAYBACK_RATE_PERMILLE = 1300, // set only -}; - -// Keep INVOKE_ID_* in sync with MediaPlayer.java. -enum media_player_invoke_ids { - INVOKE_ID_GET_TRACK_INFO = 1, - INVOKE_ID_ADD_EXTERNAL_SOURCE = 2, - INVOKE_ID_ADD_EXTERNAL_SOURCE_FD = 3, - INVOKE_ID_SELECT_TRACK = 4, - INVOKE_ID_UNSELECT_TRACK = 5, - INVOKE_ID_SET_VIDEO_SCALING_MODE = 6, -}; - -// Keep MEDIA_TRACK_TYPE_* in sync with MediaPlayer.java. -enum media_track_type { - MEDIA_TRACK_TYPE_UNKNOWN = 0, - MEDIA_TRACK_TYPE_VIDEO = 1, - MEDIA_TRACK_TYPE_AUDIO = 2, - MEDIA_TRACK_TYPE_TIMEDTEXT = 3, - MEDIA_TRACK_TYPE_SUBTITLE = 4, -}; - -// ---------------------------------------------------------------------------- -// ref-counted object for callbacks -class MediaPlayerListener: virtual public RefBase -{ -public: - virtual void notify(int msg, int ext1, int ext2, const Parcel *obj) = 0; -}; - -class MediaPlayer : public BnMediaPlayerClient, - public virtual IMediaDeathNotifier -{ -public: - MediaPlayer(); - ~MediaPlayer(); - void died(); - void disconnect(); - - status_t setDataSource( - const char *url, - const KeyedVector *headers); - - status_t setDataSource(int fd, int64_t offset, int64_t length); - status_t setDataSource(const sp &source); - status_t setVideoSurfaceTexture( - const sp& bufferProducer); - status_t setListener(const sp& listener); - status_t prepare(); - status_t prepareAsync(); - status_t start(); - status_t stop(); - status_t pause(); - bool isPlaying(); - status_t getVideoWidth(int *w); - status_t getVideoHeight(int *h); - status_t seekTo(int msec); - status_t getCurrentPosition(int *msec); - status_t getDuration(int *msec); - status_t reset(); - status_t setAudioStreamType(audio_stream_type_t type); - status_t setLooping(int loop); - bool isLooping(); - status_t setVolume(float leftVolume, float rightVolume); - void notify(int msg, int ext1, int ext2, const Parcel *obj = NULL); - static status_t decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, - audio_format_t* pFormat, - const sp& heap, size_t *pSize); - static status_t decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, - int* pNumChannels, audio_format_t* pFormat, - const sp& heap, size_t *pSize); - status_t invoke(const Parcel& request, Parcel *reply); - status_t setMetadataFilter(const Parcel& filter); - status_t getMetadata(bool update_only, bool apply_filter, Parcel *metadata); - status_t setAudioSessionId(int sessionId); - int getAudioSessionId(); - status_t setAuxEffectSendLevel(float level); - status_t attachAuxEffect(int effectId); - status_t setParameter(int key, const Parcel& request); - status_t getParameter(int key, Parcel* reply); - status_t setRetransmitEndpoint(const char* addrString, uint16_t port); - status_t setNextMediaPlayer(const sp& player); - - status_t updateProxyConfig( - const char *host, int32_t port, const char *exclusionList); - -private: - void clear_l(); - status_t seekTo_l(int msec); - status_t prepareAsync_l(); - status_t getDuration_l(int *msec); - status_t attachNewPlayer(const sp& player); - status_t reset_l(); - status_t doSetRetransmitEndpoint(const sp& player); - - sp mPlayer; - thread_id_t mLockThreadId; - Mutex mLock; - Mutex mNotifyLock; - Condition mSignal; - sp mListener; - void* mCookie; - media_player_states mCurrentState; - int mCurrentPosition; - int mSeekPosition; - bool mPrepareSync; - status_t mPrepareStatus; - audio_stream_type_t mStreamType; - bool mLoop; - float mLeftVolume; - float mRightVolume; - int mVideoWidth; - int mVideoHeight; - int mAudioSessionId; - float mSendLevel; - struct sockaddr_in mRetransmitEndpoint; - bool mRetransmitEndpointValid; -}; - -}; // namespace android - -#endif // ANDROID_MEDIAPLAYER_H diff --git a/external/android/include/19/frameworks/av/include/media/mediarecorder.h b/external/android/include/19/frameworks/av/include/media/mediarecorder.h deleted file mode 100644 index 88a42a0..0000000 --- a/external/android/include/19/frameworks/av/include/media/mediarecorder.h +++ /dev/null @@ -1,258 +0,0 @@ -/* - ** 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. - */ - -#ifndef ANDROID_MEDIARECORDER_H -#define ANDROID_MEDIARECORDER_H - -#include -#include -#include -#include -#include -#include - -namespace android { - -class Surface; -class IMediaRecorder; -class ICamera; -class ICameraRecordingProxy; -class IGraphicBufferProducer; -class Surface; - -typedef void (*media_completion_f)(status_t status, void *cookie); - -enum video_source { - VIDEO_SOURCE_DEFAULT = 0, - VIDEO_SOURCE_CAMERA = 1, - VIDEO_SOURCE_GRALLOC_BUFFER = 2, - - VIDEO_SOURCE_LIST_END // must be last - used to validate audio source type -}; - -//Please update media/java/android/media/MediaRecorder.java if the following is updated. -enum output_format { - OUTPUT_FORMAT_DEFAULT = 0, - OUTPUT_FORMAT_THREE_GPP = 1, - OUTPUT_FORMAT_MPEG_4 = 2, - - - OUTPUT_FORMAT_AUDIO_ONLY_START = 3, // Used in validating the output format. Should be the - // at the start of the audio only output formats. - - /* These are audio only file formats */ - OUTPUT_FORMAT_RAW_AMR = 3, //to be backward compatible - OUTPUT_FORMAT_AMR_NB = 3, - OUTPUT_FORMAT_AMR_WB = 4, - OUTPUT_FORMAT_AAC_ADIF = 5, - OUTPUT_FORMAT_AAC_ADTS = 6, - - /* Stream over a socket, limited to a single stream */ - OUTPUT_FORMAT_RTP_AVP = 7, - - /* H.264/AAC data encapsulated in MPEG2/TS */ - OUTPUT_FORMAT_MPEG2TS = 8, - - OUTPUT_FORMAT_LIST_END // must be last - used to validate format type -}; - -enum audio_encoder { - AUDIO_ENCODER_DEFAULT = 0, - AUDIO_ENCODER_AMR_NB = 1, - AUDIO_ENCODER_AMR_WB = 2, - AUDIO_ENCODER_AAC = 3, - AUDIO_ENCODER_HE_AAC = 4, - AUDIO_ENCODER_AAC_ELD = 5, - - AUDIO_ENCODER_LIST_END // must be the last - used to validate the audio encoder type -}; - -enum video_encoder { - VIDEO_ENCODER_DEFAULT = 0, - VIDEO_ENCODER_H263 = 1, - VIDEO_ENCODER_H264 = 2, - VIDEO_ENCODER_MPEG_4_SP = 3, - - VIDEO_ENCODER_LIST_END // must be the last - used to validate the video encoder type -}; - -/* - * The state machine of the media_recorder. - */ -enum media_recorder_states { - // Error state. - MEDIA_RECORDER_ERROR = 0, - - // Recorder was just created. - MEDIA_RECORDER_IDLE = 1 << 0, - - // Recorder has been initialized. - MEDIA_RECORDER_INITIALIZED = 1 << 1, - - // Configuration of the recorder has been completed. - MEDIA_RECORDER_DATASOURCE_CONFIGURED = 1 << 2, - - // Recorder is ready to start. - MEDIA_RECORDER_PREPARED = 1 << 3, - - // Recording is in progress. - MEDIA_RECORDER_RECORDING = 1 << 4, -}; - -// The "msg" code passed to the listener in notify. -enum media_recorder_event_type { - MEDIA_RECORDER_EVENT_LIST_START = 1, - MEDIA_RECORDER_EVENT_ERROR = 1, - MEDIA_RECORDER_EVENT_INFO = 2, - MEDIA_RECORDER_EVENT_LIST_END = 99, - - // Track related event types - MEDIA_RECORDER_TRACK_EVENT_LIST_START = 100, - MEDIA_RECORDER_TRACK_EVENT_ERROR = 100, - MEDIA_RECORDER_TRACK_EVENT_INFO = 101, - MEDIA_RECORDER_TRACK_EVENT_LIST_END = 1000, -}; - -/* - * The (part of) "what" code passed to the listener in notify. - * When the error or info type is track specific, the what has - * the following layout: - * the left-most 16-bit is meant for error or info type. - * the right-most 4-bit is meant for track id. - * the rest is reserved. - * - * | track id | reserved | error or info type | - * 31 28 16 0 - * - */ -enum media_recorder_error_type { - MEDIA_RECORDER_ERROR_UNKNOWN = 1, - - // Track related error type - MEDIA_RECORDER_TRACK_ERROR_LIST_START = 100, - MEDIA_RECORDER_TRACK_ERROR_GENERAL = 100, - MEDIA_RECORDER_ERROR_VIDEO_NO_SYNC_FRAME = 200, - MEDIA_RECORDER_TRACK_ERROR_LIST_END = 1000, -}; - -// The codes are distributed as follow: -// 0xx: Reserved -// 8xx: General info/warning -// -enum media_recorder_info_type { - MEDIA_RECORDER_INFO_UNKNOWN = 1, - - MEDIA_RECORDER_INFO_MAX_DURATION_REACHED = 800, - MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED = 801, - - // All track related informtional events start here - MEDIA_RECORDER_TRACK_INFO_LIST_START = 1000, - MEDIA_RECORDER_TRACK_INFO_COMPLETION_STATUS = 1000, - MEDIA_RECORDER_TRACK_INFO_PROGRESS_IN_TIME = 1001, - MEDIA_RECORDER_TRACK_INFO_TYPE = 1002, - MEDIA_RECORDER_TRACK_INFO_DURATION_MS = 1003, - - // The time to measure the max chunk duration - MEDIA_RECORDER_TRACK_INFO_MAX_CHUNK_DUR_MS = 1004, - - MEDIA_RECORDER_TRACK_INFO_ENCODED_FRAMES = 1005, - - // The time to measure how well the audio and video - // track data is interleaved. - MEDIA_RECORDER_TRACK_INTER_CHUNK_TIME_MS = 1006, - - // The time to measure system response. Note that - // the delay does not include the intentional delay - // we use to eliminate the recording sound. - MEDIA_RECORDER_TRACK_INFO_INITIAL_DELAY_MS = 1007, - - // The time used to compensate for initial A/V sync. - MEDIA_RECORDER_TRACK_INFO_START_OFFSET_MS = 1008, - - // Total number of bytes of the media data. - MEDIA_RECORDER_TRACK_INFO_DATA_KBYTES = 1009, - - MEDIA_RECORDER_TRACK_INFO_LIST_END = 2000, -}; - -// ---------------------------------------------------------------------------- -// ref-counted object for callbacks -class MediaRecorderListener: virtual public RefBase -{ -public: - virtual void notify(int msg, int ext1, int ext2) = 0; -}; - -class MediaRecorder : public BnMediaRecorderClient, - public virtual IMediaDeathNotifier -{ -public: - MediaRecorder(); - ~MediaRecorder(); - - void died(); - status_t initCheck(); - status_t setCamera(const sp& camera, const sp& proxy); - status_t setPreviewSurface(const sp& surface); - status_t setVideoSource(int vs); - status_t setAudioSource(int as); - status_t setOutputFormat(int of); - status_t setVideoEncoder(int ve); - status_t setAudioEncoder(int ae); - status_t setOutputFile(const char* path); - status_t setOutputFile(int fd, int64_t offset, int64_t length); - status_t setVideoSize(int width, int height); - status_t setVideoFrameRate(int frames_per_second); - status_t setParameters(const String8& params); - status_t setListener(const sp& listener); - status_t setClientName(const String16& clientName); - status_t prepare(); - status_t getMaxAmplitude(int* max); - status_t start(); - status_t stop(); - status_t reset(); - status_t init(); - status_t close(); - status_t release(); - void notify(int msg, int ext1, int ext2); - sp querySurfaceMediaSourceFromMediaServer(); - -private: - void doCleanUp(); - status_t doReset(); - - sp mMediaRecorder; - sp mListener; - - // Reference to IGraphicBufferProducer - // for encoding GL Frames. That is useful only when the - // video source is set to VIDEO_SOURCE_GRALLOC_BUFFER - sp mSurfaceMediaSource; - - media_recorder_states mCurrentState; - bool mIsAudioSourceSet; - bool mIsVideoSourceSet; - bool mIsAudioEncoderSet; - bool mIsVideoEncoderSet; - bool mIsOutputFileSet; - Mutex mLock; - Mutex mNotifyLock; -}; - -}; // namespace android - -#endif // ANDROID_MEDIARECORDER_H diff --git a/external/android/include/19/frameworks/av/include/media/mediascanner.h b/external/android/include/19/frameworks/av/include/media/mediascanner.h deleted file mode 100644 index a73403b..0000000 --- a/external/android/include/19/frameworks/av/include/media/mediascanner.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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. - */ - -#ifndef MEDIASCANNER_H -#define MEDIASCANNER_H - -#include -#include -#include -#include -#include - -struct dirent; - -namespace android { - -class MediaScannerClient; -class StringArray; - -enum MediaScanResult { - // This file or directory was scanned successfully. - MEDIA_SCAN_RESULT_OK, - // This file or directory was skipped because it was not found, could - // not be opened, was of an unsupported type, or was malfored in some way. - MEDIA_SCAN_RESULT_SKIPPED, - // The scan should be aborted due to a fatal error such as out of memory - // or an exception. - MEDIA_SCAN_RESULT_ERROR, -}; - -struct MediaScanner { - MediaScanner(); - virtual ~MediaScanner(); - - virtual MediaScanResult processFile( - const char *path, const char *mimeType, MediaScannerClient &client) = 0; - - virtual MediaScanResult processDirectory( - const char *path, MediaScannerClient &client); - - void setLocale(const char *locale); - - // extracts album art as a block of data - virtual char *extractAlbumArt(int fd) = 0; - -protected: - const char *locale() const; - -private: - // current locale (like "ja_JP"), created/destroyed with strdup()/free() - char *mLocale; - char *mSkipList; - int *mSkipIndex; - - MediaScanResult doProcessDirectory( - char *path, int pathRemaining, MediaScannerClient &client, bool noMedia); - MediaScanResult doProcessDirectoryEntry( - char *path, int pathRemaining, MediaScannerClient &client, bool noMedia, - struct dirent* entry, char* fileSpot); - void loadSkipList(); - bool shouldSkipDirectory(char *path); - - - MediaScanner(const MediaScanner &); - MediaScanner &operator=(const MediaScanner &); -}; - -class MediaScannerClient -{ -public: - MediaScannerClient(); - virtual ~MediaScannerClient(); - void setLocale(const char* locale); - void beginFile(); - status_t addStringTag(const char* name, const char* value); - void endFile(); - - virtual status_t scanFile(const char* path, long long lastModified, - long long fileSize, bool isDirectory, bool noMedia) = 0; - virtual status_t handleStringTag(const char* name, const char* value) = 0; - virtual status_t setMimeType(const char* mimeType) = 0; - -protected: - void convertValues(uint32_t encoding); - -protected: - // cached name and value strings, for native encoding support. - StringArray* mNames; - StringArray* mValues; - - // default encoding based on MediaScanner::mLocale string - uint32_t mLocaleEncoding; -}; - -}; // namespace android - -#endif // MEDIASCANNER_H diff --git a/external/android/include/19/frameworks/av/include/media/nbaio/AudioBufferProviderSource.h b/external/android/include/19/frameworks/av/include/media/nbaio/AudioBufferProviderSource.h deleted file mode 100644 index 2c4aaff..0000000 --- a/external/android/include/19/frameworks/av/include/media/nbaio/AudioBufferProviderSource.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2012 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. - */ - -// Implementation of NBAIO_Source that wraps an AudioBufferProvider - -#ifndef ANDROID_AUDIO_BUFFER_PROVIDER_SOURCE_H -#define ANDROID_AUDIO_BUFFER_PROVIDER_SOURCE_H - -#include "NBAIO.h" -#include - -namespace android { - -class AudioBufferProviderSource : public NBAIO_Source { - -public: - AudioBufferProviderSource(AudioBufferProvider *provider, NBAIO_Format format); - virtual ~AudioBufferProviderSource(); - - // NBAIO_Port interface - - //virtual ssize_t negotiate(const NBAIO_Format offers[], size_t numOffers, - // NBAIO_Format counterOffers[], size_t& numCounterOffers); - //virtual NBAIO_Format format(); - - // NBAIO_Source interface - - //virtual size_t framesRead() const; - //virtual size_t framesOverrun(); - //virtual size_t overruns(); - virtual ssize_t availableToRead(); - virtual ssize_t read(void *buffer, size_t count, int64_t readPTS); - virtual ssize_t readVia(readVia_t via, size_t total, void *user, - int64_t readPTS, size_t block); - -private: - AudioBufferProvider * const mProvider; - AudioBufferProvider::Buffer mBuffer; // current buffer - size_t mConsumed; // number of frames consumed so far from current buffer -}; - -} // namespace android - -#endif // ANDROID_AUDIO_BUFFER_PROVIDER_SOURCE_H diff --git a/external/android/include/19/frameworks/av/include/media/nbaio/AudioStreamInSource.h b/external/android/include/19/frameworks/av/include/media/nbaio/AudioStreamInSource.h deleted file mode 100644 index 07d8c89..0000000 --- a/external/android/include/19/frameworks/av/include/media/nbaio/AudioStreamInSource.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2012 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_AUDIO_STREAM_IN_SOURCE_H -#define ANDROID_AUDIO_STREAM_IN_SOURCE_H - -#include -#include "NBAIO.h" - -namespace android { - -// not multi-thread safe -class AudioStreamInSource : public NBAIO_Source { - -public: - AudioStreamInSource(audio_stream_in *stream); - virtual ~AudioStreamInSource(); - - // NBAIO_Port interface - - virtual ssize_t negotiate(const NBAIO_Format offers[], size_t numOffers, - NBAIO_Format counterOffers[], size_t& numCounterOffers); - //virtual NBAIO_Format format() const; - - // NBAIO_Sink interface - - //virtual size_t framesRead() const; - virtual size_t framesOverrun(); - virtual size_t overruns() { (void) framesOverrun(); return mOverruns; } - - // This is an over-estimate, and could dupe the caller into making a blocking read() - // FIXME Use an audio HAL API to query the buffer filling status when it's available. - virtual ssize_t availableToRead() { return mStreamBufferSizeBytes >> mBitShift; } - - virtual ssize_t read(void *buffer, size_t count); - - // NBAIO_Sink end - -#if 0 // until necessary - audio_stream_in *stream() const { return mStream; } -#endif - -private: - audio_stream_in * const mStream; - size_t mStreamBufferSizeBytes; // as reported by get_buffer_size() - size_t mFramesOverrun; - size_t mOverruns; -}; - -} // namespace android - -#endif // ANDROID_AUDIO_STREAM_IN_SOURCE_H diff --git a/external/android/include/19/frameworks/av/include/media/nbaio/AudioStreamOutSink.h b/external/android/include/19/frameworks/av/include/media/nbaio/AudioStreamOutSink.h deleted file mode 100644 index 7948d40..0000000 --- a/external/android/include/19/frameworks/av/include/media/nbaio/AudioStreamOutSink.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2012 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_AUDIO_STREAM_OUT_SINK_H -#define ANDROID_AUDIO_STREAM_OUT_SINK_H - -#include -#include "NBAIO.h" - -namespace android { - -// not multi-thread safe -class AudioStreamOutSink : public NBAIO_Sink { - -public: - AudioStreamOutSink(audio_stream_out *stream); - virtual ~AudioStreamOutSink(); - - // NBAIO_Port interface - - virtual ssize_t negotiate(const NBAIO_Format offers[], size_t numOffers, - NBAIO_Format counterOffers[], size_t& numCounterOffers); - //virtual NBAIO_Format format(); - - // NBAIO_Sink interface - - //virtual size_t framesWritten() const; - //virtual size_t framesUnderrun() const; - //virtual size_t underruns() const; - - // This is an over-estimate, and could dupe the caller into making a blocking write() - // FIXME Use an audio HAL API to query the buffer emptying status when it's available. - virtual ssize_t availableToWrite() const { return mStreamBufferSizeBytes >> mBitShift; } - - virtual ssize_t write(const void *buffer, size_t count); - - // AudioStreamOutSink wraps a HAL's output stream. Its - // getNextWriteTimestamp method is simply a passthru to the HAL's underlying - // implementation of GNWT (if any) - virtual status_t getNextWriteTimestamp(int64_t *timestamp); - - virtual status_t getTimestamp(AudioTimestamp& timestamp); - - // NBAIO_Sink end - -#if 0 // until necessary - audio_stream_out *stream() const { return mStream; } -#endif - -private: - audio_stream_out * const mStream; - size_t mStreamBufferSizeBytes; // as reported by get_buffer_size() -}; - -} // namespace android - -#endif // ANDROID_AUDIO_STREAM_OUT_SINK_H diff --git a/external/android/include/19/frameworks/av/include/media/nbaio/LibsndfileSink.h b/external/android/include/19/frameworks/av/include/media/nbaio/LibsndfileSink.h deleted file mode 100644 index f5d53d5..0000000 --- a/external/android/include/19/frameworks/av/include/media/nbaio/LibsndfileSink.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2012 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_AUDIO_LIBSNDFILE_SINK_H -#define ANDROID_AUDIO_LIBSNDFILE_SINK_H - -#include "NBAIO.h" -#include "sndfile.h" - -// Implementation of NBAIO_Sink that wraps a libsndfile opened in SFM_WRITE mode - -namespace android { - -class LibsndfileSink : public NBAIO_Sink { - -public: - LibsndfileSink(SNDFILE *sndfile, const SF_INFO &sfinfo); - virtual ~LibsndfileSink(); - - // NBAIO_Port interface - - //virtual ssize_t negotiate(const NBAIO_Format offers[], size_t numOffers, - // NBAIO_Format counterOffers[], size_t& numCounterOffers); - //virtual NBAIO_Format format() const; - - // NBAIO_Sink interface - - //virtual size_t framesWritten() const; - //virtual size_t framesUnderrun() const; - //virtual size_t underruns() const; - //virtual ssize_t availableToWrite() const; - virtual ssize_t write(const void *buffer, size_t count); - //virtual ssize_t writeVia(writeVia_t via, size_t total, void *user, size_t block); - -private: - SNDFILE * mSndfile; -}; - -} // namespace android - -#endif // ANDROID_AUDIO_LIBSNDFILE_SINK_H diff --git a/external/android/include/19/frameworks/av/include/media/nbaio/LibsndfileSource.h b/external/android/include/19/frameworks/av/include/media/nbaio/LibsndfileSource.h deleted file mode 100644 index 4fbdb4b..0000000 --- a/external/android/include/19/frameworks/av/include/media/nbaio/LibsndfileSource.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2012 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_AUDIO_LIBSNDFILE_SOURCE_H -#define ANDROID_AUDIO_LIBSNDFILE_SOURCE_H - -#include "NBAIO.h" -#include "sndfile.h" - -// Implementation of NBAIO_Source that wraps a libsndfile opened in SFM_READ mode - -namespace android { - -class LibsndfileSource : public NBAIO_Source { - -public: - // If 'loop' is true and it permits seeking, then we'll act as an infinite source - LibsndfileSource(SNDFILE *sndfile, const SF_INFO &sfinfo, bool loop = false); - virtual ~LibsndfileSource(); - - // NBAIO_Port interface - - //virtual ssize_t negotiate(const NBAIO_Format offers[], size_t numOffers, - // NBAIO_Format counterOffers[], size_t& numCounterOffers); - //virtual NBAIO_Format format() const; - - // NBAIO_Source interface - - //virtual size_t framesRead() const; - //virtual size_t framesOverrun(); - //virtual size_t overruns(); - virtual ssize_t availableToRead(); - virtual ssize_t read(void *buffer, size_t count); - //virtual ssize_t readVia(readVia_t via, size_t total, void *user, size_t block); - -private: - SNDFILE * mSndfile; - sf_count_t mEstimatedFramesUntilEOF; - bool mLooping; - bool mReadAnyFramesThisLoopCycle; -}; - -} // namespace android - -#endif // ANDROID_AUDIO_LIBSNDFILE_SOURCE_H diff --git a/external/android/include/19/frameworks/av/include/media/nbaio/MonoPipe.h b/external/android/include/19/frameworks/av/include/media/nbaio/MonoPipe.h deleted file mode 100644 index d3802fe..0000000 --- a/external/android/include/19/frameworks/av/include/media/nbaio/MonoPipe.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (C) 2012 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_AUDIO_MONO_PIPE_H -#define ANDROID_AUDIO_MONO_PIPE_H - -#include -#include -#include "NBAIO.h" -#include - -namespace android { - -typedef SingleStateQueue AudioTimestampSingleStateQueue; - -// MonoPipe is similar to Pipe except: -// - supports only a single reader, called MonoPipeReader -// - write() cannot overrun; instead it will return a short actual count if insufficient space -// - write() can optionally block if the pipe is full -// Like Pipe, it is not multi-thread safe for either writer or reader -// but writer and reader can be different threads. -class MonoPipe : public NBAIO_Sink { - - friend class MonoPipeReader; - -public: - // reqFrames will be rounded up to a power of 2, and all slots are available. Must be >= 2. - // Note: whatever shares this object with another thread needs to do so in an SMP-safe way (like - // creating it the object before creating the other thread, or storing the object with a - // release_store). Otherwise the other thread could see a partially-constructed object. - MonoPipe(size_t reqFrames, NBAIO_Format format, bool writeCanBlock = false); - virtual ~MonoPipe(); - - // NBAIO_Port interface - - //virtual ssize_t negotiate(const NBAIO_Format offers[], size_t numOffers, - // NBAIO_Format counterOffers[], size_t& numCounterOffers); - //virtual NBAIO_Format format() const; - - // NBAIO_Sink interface - - //virtual size_t framesWritten() const; - //virtual size_t framesUnderrun() const; - //virtual size_t underruns() const; - - virtual ssize_t availableToWrite() const; - virtual ssize_t write(const void *buffer, size_t count); - //virtual ssize_t writeVia(writeVia_t via, size_t total, void *user, size_t block); - - // MonoPipe's implementation of getNextWriteTimestamp works in conjunction - // with MonoPipeReader. Every time a MonoPipeReader reads from the pipe, it - // receives a "readPTS" indicating the point in time for which the reader - // would like to read data. This "last read PTS" is offset by the amt of - // data the reader is currently mixing and then cached cached along with the - // updated read pointer. This cached value is the local time for which the - // reader is going to request data next time it reads data (assuming we are - // in steady state and operating with no underflows). Writers to the - // MonoPipe who would like to know when their next write operation will hit - // the speakers can call getNextWriteTimestamp which will return the value - // of the last read PTS plus the duration of the amt of data waiting to be - // read in the MonoPipe. - virtual status_t getNextWriteTimestamp(int64_t *timestamp); - - // average number of frames present in the pipe under normal conditions. - // See throttling mechanism in MonoPipe::write() - size_t getAvgFrames() const { return mSetpoint; } - void setAvgFrames(size_t setpoint); - size_t maxFrames() const { return mMaxFrames; } - - // Set the shutdown state for the write side of a pipe. - // This may be called by an unrelated thread. When shutdown state is 'true', - // a write that would otherwise block instead returns a short transfer count. - // There is no guarantee how long it will take for the shutdown to be recognized, - // but it will not be an unbounded amount of time. - // The state can be restored to normal by calling shutdown(false). - void shutdown(bool newState = true); - - // Return true if the write side of a pipe is currently shutdown. - bool isShutdown(); - - // Return NO_ERROR if there is a timestamp available - status_t getTimestamp(AudioTimestamp& timestamp); - -private: - // A pair of methods and a helper variable which allows the reader and the - // writer to update and observe the values of mFront and mNextRdPTS in an - // atomic lock-less fashion. - // - // :: Important :: - // Two assumptions must be true in order for this lock-less approach to - // function properly on all systems. First, there may only be one updater - // thread in the system. Second, the updater thread must be running at a - // strictly higher priority than the observer threads. Currently, both of - // these assumptions are true. The only updater is always a single - // FastMixer thread (which runs with SCHED_FIFO/RT priority while the only - // observer is always an AudioFlinger::PlaybackThread running with - // traditional (non-RT) audio priority. - void updateFrontAndNRPTS(int32_t newFront, int64_t newNextRdPTS); - void observeFrontAndNRPTS(int32_t *outFront, int64_t *outNextRdPTS); - volatile int32_t mUpdateSeq; - - const size_t mReqFrames; // as requested in constructor, unrounded - const size_t mMaxFrames; // always a power of 2 - void * const mBuffer; - // mFront and mRear will never be separated by more than mMaxFrames. - // 32-bit overflow is possible if the pipe is active for a long time, but if that happens it's - // safe because we "&" with (mMaxFrames-1) at end of computations to calculate a buffer index. - volatile int32_t mFront; // written by the reader with updateFrontAndNRPTS, observed by - // the writer with observeFrontAndNRPTS - volatile int32_t mRear; // written by writer with android_atomic_release_store, - // read by reader with android_atomic_acquire_load - volatile int64_t mNextRdPTS; // written by the reader with updateFrontAndNRPTS, observed by - // the writer with observeFrontAndNRPTS - bool mWriteTsValid; // whether mWriteTs is valid - struct timespec mWriteTs; // time that the previous write() completed - size_t mSetpoint; // target value for pipe fill depth - const bool mWriteCanBlock; // whether write() should block if the pipe is full - - int64_t offsetTimestampByAudioFrames(int64_t ts, size_t audFrames); - LinearTransform mSamplesToLocalTime; - - bool mIsShutdown; // whether shutdown(true) was called, no barriers are needed - - AudioTimestampSingleStateQueue::Shared mTimestampShared; - AudioTimestampSingleStateQueue::Mutator mTimestampMutator; - AudioTimestampSingleStateQueue::Observer mTimestampObserver; -}; - -} // namespace android - -#endif // ANDROID_AUDIO_MONO_PIPE_H diff --git a/external/android/include/19/frameworks/av/include/media/nbaio/MonoPipeReader.h b/external/android/include/19/frameworks/av/include/media/nbaio/MonoPipeReader.h deleted file mode 100644 index 78fe867..0000000 --- a/external/android/include/19/frameworks/av/include/media/nbaio/MonoPipeReader.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2012 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_AUDIO_MONO_PIPE_READER_H -#define ANDROID_AUDIO_MONO_PIPE_READER_H - -#include "MonoPipe.h" - -namespace android { - -// MonoPipeReader is safe for only a single reader thread -class MonoPipeReader : public NBAIO_Source { - -public: - - // Construct a MonoPipeReader and associate it with a MonoPipe; - // any data already in the pipe is visible to this PipeReader. - // There can be only a single MonoPipeReader per MonoPipe. - // FIXME make this constructor a factory method of MonoPipe. - MonoPipeReader(MonoPipe* pipe); - virtual ~MonoPipeReader(); - - // NBAIO_Port interface - - //virtual ssize_t negotiate(const NBAIO_Format offers[], size_t numOffers, - // NBAIO_Format counterOffers[], size_t& numCounterOffers); - //virtual NBAIO_Format format() const; - - // NBAIO_Source interface - - //virtual size_t framesRead() const; - //virtual size_t framesOverrun(); - //virtual size_t overruns(); - - virtual ssize_t availableToRead(); - - virtual ssize_t read(void *buffer, size_t count, int64_t readPTS); - - virtual void onTimestamp(const AudioTimestamp& timestamp); - - // NBAIO_Source end - -#if 0 // until necessary - MonoPipe* pipe() const { return mPipe; } -#endif - -private: - MonoPipe * const mPipe; -}; - -} // namespace android - -#endif // ANDROID_AUDIO_MONO_PIPE_READER_H diff --git a/external/android/include/19/frameworks/av/include/media/nbaio/NBAIO.h b/external/android/include/19/frameworks/av/include/media/nbaio/NBAIO.h deleted file mode 100644 index 1da0c73..0000000 --- a/external/android/include/19/frameworks/av/include/media/nbaio/NBAIO.h +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Copyright (C) 2012 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_AUDIO_NBAIO_H -#define ANDROID_AUDIO_NBAIO_H - -// Non-blocking audio I/O interface -// -// This header file has the abstract interfaces only. Concrete implementation classes are declared -// elsewhere. Implementations _should_ be non-blocking for all methods, especially read() and -// write(), but this is not enforced. In general, implementations do not need to be multi-thread -// safe, and any exceptions are noted in the particular implementation. - -#include -#include -#include -#include -#include - -namespace android { - -// In addition to the usual status_t -enum { - NEGOTIATE = 0x80000010, // Must (re-)negotiate format. For negotiate() only, the offeree - // doesn't accept offers, and proposes counter-offers - OVERRUN = 0x80000011, // availableToRead(), read(), or readVia() detected lost input due - // to overrun; an event is counted and the caller should re-try - UNDERRUN = 0x80000012, // availableToWrite(), write(), or writeVia() detected a gap in - // output due to underrun (not being called often enough, or with - // enough data); an event is counted and the caller should re-try -}; - -// Negotiation of format is based on the data provider and data sink, or the data consumer and -// data source, exchanging prioritized arrays of offers and counter-offers until a single offer is -// mutually agreed upon. Each offer is an NBAIO_Format. For simplicity and performance, -// NBAIO_Format is a typedef that ties together the most important combinations of the various -// attributes, rather than a struct with separate fields for format, sample rate, channel count, -// interleave, packing, alignment, etc. The reason is that NBAIO_Format tries to abstract out only -// the combinations that are actually needed within AudioFlinger. If the list of combinations grows -// too large, then this decision should be re-visited. -// Sample rate and channel count are explicit, PCM interleaved 16-bit is assumed. -typedef unsigned NBAIO_Format; -enum { - Format_Invalid -}; - -// Return the frame size of an NBAIO_Format in bytes -size_t Format_frameSize(NBAIO_Format format); - -// Return the frame size of an NBAIO_Format as a bit shift -size_t Format_frameBitShift(NBAIO_Format format); - -// Convert a sample rate in Hz and channel count to an NBAIO_Format -NBAIO_Format Format_from_SR_C(unsigned sampleRate, unsigned channelCount); - -// Return the sample rate in Hz of an NBAIO_Format -unsigned Format_sampleRate(NBAIO_Format format); - -// Return the channel count of an NBAIO_Format -unsigned Format_channelCount(NBAIO_Format format); - -// Callbacks used by NBAIO_Sink::writeVia() and NBAIO_Source::readVia() below. -typedef ssize_t (*writeVia_t)(void *user, void *buffer, size_t count); -typedef ssize_t (*readVia_t)(void *user, const void *buffer, - size_t count, int64_t readPTS); - -// Abstract class (interface) representing a data port. -class NBAIO_Port : public RefBase { - -public: - - // negotiate() must called first. The purpose of negotiate() is to check compatibility of - // formats, not to automatically adapt if they are incompatible. It's the responsibility of - // whoever sets up the graph connections to make sure formats are compatible, and this method - // just verifies that. The edges are "dumb" and don't attempt to adapt to bad connections. - // How it works: offerer proposes an array of formats, in descending order of preference from - // offers[0] to offers[numOffers - 1]. If offeree accepts one of these formats, it returns - // the index of that offer. Otherwise, offeree sets numCounterOffers to the number of - // counter-offers (up to a maximumum of the entry value of numCounterOffers), fills in the - // provided array counterOffers[] with its counter-offers, in descending order of preference - // from counterOffers[0] to counterOffers[numCounterOffers - 1], and returns NEGOTIATE. - // Note that since the offerer allocates space for counter-offers, but only the offeree knows - // how many counter-offers it has, there may be insufficient space for all counter-offers. - // In that case, the offeree sets numCounterOffers to the requested number of counter-offers - // (which is greater than the entry value of numCounterOffers), fills in as many of the most - // important counterOffers as will fit, and returns NEGOTIATE. As this implies a re-allocation, - // it should be used as a last resort. It is preferable for the offerer to simply allocate a - // larger space to begin with, and/or for the offeree to tolerate a smaller space than desired. - // Alternatively, the offerer can pass NULL for offers and counterOffers, and zero for - // numOffers. This indicates that it has not allocated space for any counter-offers yet. - // In this case, the offerree should set numCounterOffers appropriately and return NEGOTIATE. - // Then the offerer will allocate the correct amount of memory and retry. - // Format_Invalid is not allowed as either an offer or counter-offer. - // Returns: - // >= 0 Offer accepted. - // NEGOTIATE No offer accepted, and counter-offer(s) optionally made. See above for details. - virtual ssize_t negotiate(const NBAIO_Format offers[], size_t numOffers, - NBAIO_Format counterOffers[], size_t& numCounterOffers); - - // Return the current negotiated format, or Format_Invalid if negotiation has not been done, - // or if re-negotiation is required. - virtual NBAIO_Format format() const { return mNegotiated ? mFormat : Format_Invalid; } - -protected: - NBAIO_Port(NBAIO_Format format) : mNegotiated(false), mFormat(format), - mBitShift(Format_frameBitShift(format)) { } - virtual ~NBAIO_Port() { } - - // Implementations are free to ignore these if they don't need them - - bool mNegotiated; // mNegotiated implies (mFormat != Format_Invalid) - NBAIO_Format mFormat; // (mFormat != Format_Invalid) does not imply mNegotiated - size_t mBitShift; // assign in parallel with any assignment to mFormat -}; - -// Abstract class (interface) representing a non-blocking data sink, for use by a data provider. -class NBAIO_Sink : public NBAIO_Port { - -public: - - // For the next two APIs: - // 32 bits rolls over after 27 hours at 44.1 kHz; if that concerns you then poll periodically. - - // Return the number of frames written successfully since construction. - virtual size_t framesWritten() const { return mFramesWritten; } - - // Number of frames lost due to underrun since construction. - virtual size_t framesUnderrun() const { return 0; } - - // Number of underruns since construction, where a set of contiguous lost frames is one event. - virtual size_t underruns() const { return 0; } - - // Estimate of number of frames that could be written successfully now without blocking. - // When a write() is actually attempted, the implementation is permitted to return a smaller or - // larger transfer count, however it will make a good faith effort to give an accurate estimate. - // Errors: - // NEGOTIATE (Re-)negotiation is needed. - // UNDERRUN write() has not been called frequently enough, or with enough frames to keep up. - // An underrun event is counted, and the caller should re-try this operation. - // WOULD_BLOCK Determining how many frames can be written without blocking would itself block. - virtual ssize_t availableToWrite() const { return SSIZE_MAX; } - - // Transfer data to sink from single input buffer. Implies a copy. - // Inputs: - // buffer Non-NULL buffer owned by provider. - // count Maximum number of frames to transfer. - // Return value: - // > 0 Number of frames successfully transferred prior to first error. - // = 0 Count was zero. - // < 0 status_t error occurred prior to the first frame transfer. - // Errors: - // NEGOTIATE (Re-)negotiation is needed. - // WOULD_BLOCK No frames can be transferred without blocking. - // UNDERRUN write() has not been called frequently enough, or with enough frames to keep up. - // An underrun event is counted, and the caller should re-try this operation. - virtual ssize_t write(const void *buffer, size_t count) = 0; - - // Transfer data to sink using a series of callbacks. More suitable for zero-fill, synthesis, - // and non-contiguous transfers (e.g. circular buffer or writev). - // Inputs: - // via Callback function that the sink will call as many times as needed to consume data. - // total Estimate of the number of frames the provider has available. This is an estimate, - // and it can provide a different number of frames during the series of callbacks. - // user Arbitrary void * reserved for data provider. - // block Number of frames per block, that is a suggested value for 'count' in each callback. - // Zero means no preference. This parameter is a hint only, and may be ignored. - // Return value: - // > 0 Total number of frames successfully transferred prior to first error. - // = 0 Count was zero. - // < 0 status_t error occurred prior to the first frame transfer. - // Errors: - // NEGOTIATE (Re-)negotiation is needed. - // WOULD_BLOCK No frames can be transferred without blocking. - // UNDERRUN write() has not been called frequently enough, or with enough frames to keep up. - // An underrun event is counted, and the caller should re-try this operation. - // - // The 'via' callback is called by the data sink as follows: - // Inputs: - // user Arbitrary void * reserved for data provider. - // buffer Non-NULL buffer owned by sink that callback should fill in with data, - // up to a maximum of 'count' frames. - // count Maximum number of frames to transfer during this callback. - // Return value: - // > 0 Number of frames successfully transferred during this callback prior to first error. - // = 0 Count was zero. - // < 0 status_t error occurred prior to the first frame transfer during this callback. - virtual ssize_t writeVia(writeVia_t via, size_t total, void *user, size_t block = 0); - - // Get the time (on the LocalTime timeline) at which the first frame of audio of the next write - // operation to this sink will be eventually rendered by the HAL. - // Inputs: - // ts A pointer pointing to the int64_t which will hold the result. - // Return value: - // OK Everything went well, *ts holds the time at which the first audio frame of the next - // write operation will be rendered, or AudioBufferProvider::kInvalidPTS if this sink - // does not know the answer for some reason. Sinks which eventually lead to a HAL - // which implements get_next_write_timestamp may return Invalid temporarily if the DMA - // output of the audio driver has not started yet. Sinks which lead to a HAL which - // does not implement get_next_write_timestamp, or which don't lead to a HAL at all, - // will always return kInvalidPTS. - // Something unexpected happened internally. Check the logs and start debugging. - virtual status_t getNextWriteTimestamp(int64_t *ts) { return INVALID_OPERATION; } - - // Returns NO_ERROR if a timestamp is available. The timestamp includes the total number - // of frames presented to an external observer, together with the value of CLOCK_MONOTONIC - // as of this presentation count. - virtual status_t getTimestamp(AudioTimestamp& timestamp) { return INVALID_OPERATION; } - -protected: - NBAIO_Sink(NBAIO_Format format = Format_Invalid) : NBAIO_Port(format), mFramesWritten(0) { } - virtual ~NBAIO_Sink() { } - - // Implementations are free to ignore these if they don't need them - size_t mFramesWritten; -}; - -// Abstract class (interface) representing a non-blocking data source, for use by a data consumer. -class NBAIO_Source : public NBAIO_Port { - -public: - - // For the next two APIs: - // 32 bits rolls over after 27 hours at 44.1 kHz; if that concerns you then poll periodically. - - // Number of frames read successfully since construction. - virtual size_t framesRead() const { return mFramesRead; } - - // Number of frames lost due to overrun since construction. - // Not const because implementations may need to do I/O. - virtual size_t framesOverrun() /*const*/ { return 0; } - - // Number of overruns since construction, where a set of contiguous lost frames is one event. - // Not const because implementations may need to do I/O. - virtual size_t overruns() /*const*/ { return 0; } - - // Estimate of number of frames that could be read successfully now. - // When a read() is actually attempted, the implementation is permitted to return a smaller or - // larger transfer count, however it will make a good faith effort to give an accurate estimate. - // Errors: - // NEGOTIATE (Re-)negotiation is needed. - // OVERRUN One or more frames were lost due to overrun, try again to read more recent data. - // WOULD_BLOCK Determining how many frames can be read without blocking would itself block. - virtual ssize_t availableToRead() { return SSIZE_MAX; } - - // Transfer data from source into single destination buffer. Implies a copy. - // Inputs: - // buffer Non-NULL destination buffer owned by consumer. - // count Maximum number of frames to transfer. - // readPTS The presentation time (on the LocalTime timeline) for which data - // is being requested, or kInvalidPTS if not known. - // Return value: - // > 0 Number of frames successfully transferred prior to first error. - // = 0 Count was zero. - // < 0 status_t error occurred prior to the first frame transfer. - // Errors: - // NEGOTIATE (Re-)negotiation is needed. - // WOULD_BLOCK No frames can be transferred without blocking. - // OVERRUN read() has not been called frequently enough, or with enough frames to keep up. - // One or more frames were lost due to overrun, try again to read more recent data. - virtual ssize_t read(void *buffer, size_t count, int64_t readPTS) = 0; - - // Transfer data from source using a series of callbacks. More suitable for zero-fill, - // synthesis, and non-contiguous transfers (e.g. circular buffer or readv). - // Inputs: - // via Callback function that the source will call as many times as needed to provide data. - // total Estimate of the number of frames the consumer desires. This is an estimate, - // and it can consume a different number of frames during the series of callbacks. - // user Arbitrary void * reserved for data consumer. - // readPTS The presentation time (on the LocalTime timeline) for which data - // is being requested, or kInvalidPTS if not known. - // block Number of frames per block, that is a suggested value for 'count' in each callback. - // Zero means no preference. This parameter is a hint only, and may be ignored. - // Return value: - // > 0 Total number of frames successfully transferred prior to first error. - // = 0 Count was zero. - // < 0 status_t error occurred prior to the first frame transfer. - // Errors: - // NEGOTIATE (Re-)negotiation is needed. - // WOULD_BLOCK No frames can be transferred without blocking. - // OVERRUN read() has not been called frequently enough, or with enough frames to keep up. - // One or more frames were lost due to overrun, try again to read more recent data. - // - // The 'via' callback is called by the data source as follows: - // Inputs: - // user Arbitrary void * reserved for data consumer. - // dest Non-NULL buffer owned by source that callback should consume data from, - // up to a maximum of 'count' frames. - // count Maximum number of frames to transfer during this callback. - // Return value: - // > 0 Number of frames successfully transferred during this callback prior to first error. - // = 0 Count was zero. - // < 0 status_t error occurred prior to the first frame transfer during this callback. - virtual ssize_t readVia(readVia_t via, size_t total, void *user, - int64_t readPTS, size_t block = 0); - - // Invoked asynchronously by corresponding sink when a new timestamp is available. - // Default implementation ignores the timestamp. - virtual void onTimestamp(const AudioTimestamp& timestamp) { } - -protected: - NBAIO_Source(NBAIO_Format format = Format_Invalid) : NBAIO_Port(format), mFramesRead(0) { } - virtual ~NBAIO_Source() { } - - // Implementations are free to ignore these if they don't need them - size_t mFramesRead; -}; - -} // namespace android - -#endif // ANDROID_AUDIO_NBAIO_H diff --git a/external/android/include/19/frameworks/av/include/media/nbaio/NBLog.h b/external/android/include/19/frameworks/av/include/media/nbaio/NBLog.h deleted file mode 100644 index 6d59ea7..0000000 --- a/external/android/include/19/frameworks/av/include/media/nbaio/NBLog.h +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Copyright (C) 2013 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. - */ - -// Non-blocking event logger intended for safe communication between processes via shared memory - -#ifndef ANDROID_MEDIA_NBLOG_H -#define ANDROID_MEDIA_NBLOG_H - -#include -#include -#include - -namespace android { - -class NBLog { - -public: - -class Writer; -class Reader; - -private: - -enum Event { - EVENT_RESERVED, - EVENT_STRING, // ASCII string, not NUL-terminated - EVENT_TIMESTAMP, // clock_gettime(CLOCK_MONOTONIC) -}; - -// --------------------------------------------------------------------------- - -// representation of a single log entry in private memory -struct Entry { - Entry(Event event, const void *data, size_t length) - : mEvent(event), mLength(length), mData(data) { } - /*virtual*/ ~Entry() { } - - int readAt(size_t offset) const; - -private: - friend class Writer; - Event mEvent; // event type - size_t mLength; // length of additional data, 0 <= mLength <= 255 - const void *mData; // event type-specific data -}; - -// representation of a single log entry in shared memory -// byte[0] mEvent -// byte[1] mLength -// byte[2] mData[0] -// ... -// byte[2+i] mData[i] -// ... -// byte[2+mLength-1] mData[mLength-1] -// byte[2+mLength] duplicate copy of mLength to permit reverse scan -// byte[3+mLength] start of next log entry - -// located in shared memory -struct Shared { - Shared() : mRear(0) { } - /*virtual*/ ~Shared() { } - - volatile int32_t mRear; // index one byte past the end of most recent Entry - char mBuffer[0]; // circular buffer for entries -}; - -public: - -// --------------------------------------------------------------------------- - -// FIXME Timeline was intended to wrap Writer and Reader, but isn't actually used yet. -// For now it is just a namespace for sharedSize(). -class Timeline : public RefBase { -public: -#if 0 - Timeline(size_t size, void *shared = NULL); - virtual ~Timeline(); -#endif - - // Input parameter 'size' is the desired size of the timeline in byte units. - // Returns the size rounded up to a power-of-2, plus the constant size overhead for indices. - static size_t sharedSize(size_t size); - -#if 0 -private: - friend class Writer; - friend class Reader; - - const size_t mSize; // circular buffer size in bytes, must be a power of 2 - bool mOwn; // whether I own the memory at mShared - Shared* const mShared; // pointer to shared memory -#endif -}; - -// --------------------------------------------------------------------------- - -// Writer is thread-safe with respect to Reader, but not with respect to multiple threads -// calling Writer methods. If you need multi-thread safety for writing, use LockedWriter. -class Writer : public RefBase { -public: - Writer(); // dummy nop implementation without shared memory - - // Input parameter 'size' is the desired size of the timeline in byte units. - // The size of the shared memory must be at least Timeline::sharedSize(size). - Writer(size_t size, void *shared); - Writer(size_t size, const sp& iMemory); - - virtual ~Writer() { } - - virtual void log(const char *string); - virtual void logf(const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); - virtual void logvf(const char *fmt, va_list ap); - virtual void logTimestamp(); - virtual void logTimestamp(const struct timespec& ts); - - virtual bool isEnabled() const; - - // return value for all of these is the previous isEnabled() - virtual bool setEnabled(bool enabled); // but won't enable if no shared memory - bool enable() { return setEnabled(true); } - bool disable() { return setEnabled(false); } - - sp getIMemory() const { return mIMemory; } - -private: - void log(Event event, const void *data, size_t length); - void log(const Entry *entry, bool trusted = false); - - const size_t mSize; // circular buffer size in bytes, must be a power of 2 - Shared* const mShared; // raw pointer to shared memory - const sp mIMemory; // ref-counted version - int32_t mRear; // my private copy of mShared->mRear - bool mEnabled; // whether to actually log -}; - -// --------------------------------------------------------------------------- - -// Similar to Writer, but safe for multiple threads to call concurrently -class LockedWriter : public Writer { -public: - LockedWriter(); - LockedWriter(size_t size, void *shared); - - virtual void log(const char *string); - virtual void logf(const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); - virtual void logvf(const char *fmt, va_list ap); - virtual void logTimestamp(); - virtual void logTimestamp(const struct timespec& ts); - - virtual bool isEnabled() const; - virtual bool setEnabled(bool enabled); - -private: - mutable Mutex mLock; -}; - -// --------------------------------------------------------------------------- - -class Reader : public RefBase { -public: - - // Input parameter 'size' is the desired size of the timeline in byte units. - // The size of the shared memory must be at least Timeline::sharedSize(size). - Reader(size_t size, const void *shared); - Reader(size_t size, const sp& iMemory); - - virtual ~Reader() { } - - void dump(int fd, size_t indent = 0); - bool isIMemory(const sp& iMemory) const; - -private: - const size_t mSize; // circular buffer size in bytes, must be a power of 2 - const Shared* const mShared; // raw pointer to shared memory - const sp mIMemory; // ref-counted version - int32_t mFront; // index of oldest acknowledged Entry - - static const size_t kSquashTimestamp = 5; // squash this many or more adjacent timestamps -}; - -}; // class NBLog - -} // namespace android - -#endif // ANDROID_MEDIA_NBLOG_H diff --git a/external/android/include/19/frameworks/av/include/media/nbaio/Pipe.h b/external/android/include/19/frameworks/av/include/media/nbaio/Pipe.h deleted file mode 100644 index 79a4eee..0000000 --- a/external/android/include/19/frameworks/av/include/media/nbaio/Pipe.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2012 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_AUDIO_PIPE_H -#define ANDROID_AUDIO_PIPE_H - -#include "NBAIO.h" - -namespace android { - -// Pipe is multi-thread safe for readers (see PipeReader), but safe for only a single writer thread. -// It cannot UNDERRUN on write, unless we allow designation of a master reader that provides the -// time-base. Readers can be added and removed dynamically, and it's OK to have no readers. -class Pipe : public NBAIO_Sink { - - friend class PipeReader; - -public: - // maxFrames will be rounded up to a power of 2, and all slots are available. Must be >= 2. - Pipe(size_t maxFrames, NBAIO_Format format); - virtual ~Pipe(); - - // NBAIO_Port interface - - //virtual ssize_t negotiate(const NBAIO_Format offers[], size_t numOffers, - // NBAIO_Format counterOffers[], size_t& numCounterOffers); - //virtual NBAIO_Format format() const; - - // NBAIO_Sink interface - - //virtual size_t framesWritten() const; - //virtual size_t framesUnderrun() const; - //virtual size_t underruns() const; - - // The write side of a pipe permits overruns; flow control is the caller's responsibility. - // It doesn't return +infinity because that would guarantee an overrun. - virtual ssize_t availableToWrite() const { return mMaxFrames; } - - virtual ssize_t write(const void *buffer, size_t count); - //virtual ssize_t writeVia(writeVia_t via, size_t total, void *user, size_t block); - -private: - const size_t mMaxFrames; // always a power of 2 - void * const mBuffer; - volatile int32_t mRear; // written by android_atomic_release_store - volatile int32_t mReaders; // number of PipeReader clients currently attached to this Pipe -}; - -} // namespace android - -#endif // ANDROID_AUDIO_PIPE_H diff --git a/external/android/include/19/frameworks/av/include/media/nbaio/PipeReader.h b/external/android/include/19/frameworks/av/include/media/nbaio/PipeReader.h deleted file mode 100644 index 350e6ab..0000000 --- a/external/android/include/19/frameworks/av/include/media/nbaio/PipeReader.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2012 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_AUDIO_PIPE_READER_H -#define ANDROID_AUDIO_PIPE_READER_H - -#include "Pipe.h" - -namespace android { - -// PipeReader is safe for only a single thread -class PipeReader : public NBAIO_Source { - -public: - - // Construct a PipeReader and associate it with a Pipe - // FIXME make this constructor a factory method of Pipe. - PipeReader(Pipe& pipe); - virtual ~PipeReader(); - - // NBAIO_Port interface - - //virtual ssize_t negotiate(const NBAIO_Format offers[], size_t numOffers, - // NBAIO_Format counterOffers[], size_t& numCounterOffers); - //virtual NBAIO_Format format() const; - - // NBAIO_Source interface - - //virtual size_t framesRead() const; - virtual size_t framesOverrun() { return mFramesOverrun; } - virtual size_t overruns() { return mOverruns; } - - virtual ssize_t availableToRead(); - - virtual ssize_t read(void *buffer, size_t count, int64_t readPTS); - - // NBAIO_Source end - -#if 0 // until necessary - Pipe& pipe() const { return mPipe; } -#endif - -private: - Pipe& mPipe; - int32_t mFront; // follows behind mPipe.mRear - size_t mFramesOverrun; - size_t mOverruns; -}; - -} // namespace android - -#endif // ANDROID_AUDIO_PIPE_READER_H diff --git a/external/android/include/19/frameworks/av/include/media/nbaio/SourceAudioBufferProvider.h b/external/android/include/19/frameworks/av/include/media/nbaio/SourceAudioBufferProvider.h deleted file mode 100644 index cdfb6fe..0000000 --- a/external/android/include/19/frameworks/av/include/media/nbaio/SourceAudioBufferProvider.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2012 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. - */ - -// Implementation of AudioBufferProvider that wraps an NBAIO_Source - -#ifndef ANDROID_SOURCE_AUDIO_BUFFER_PROVIDER_H -#define ANDROID_SOURCE_AUDIO_BUFFER_PROVIDER_H - -#include "NBAIO.h" -#include - -namespace android { - -class SourceAudioBufferProvider : public ExtendedAudioBufferProvider { - -public: - SourceAudioBufferProvider(const sp& source); - virtual ~SourceAudioBufferProvider(); - - // AudioBufferProvider interface - virtual status_t getNextBuffer(Buffer *buffer, int64_t pts); - virtual void releaseBuffer(Buffer *buffer); - - // ExtendedAudioBufferProvider interface - virtual size_t framesReady() const; - virtual size_t framesReleased() const; - virtual void onTimestamp(const AudioTimestamp& timestamp); - -private: - const sp mSource; // the wrapped source - /*const*/ size_t mFrameBitShift; // log2(frame size in bytes) - void* mAllocated; // pointer to base of allocated memory - size_t mSize; // size of mAllocated in frames - size_t mOffset; // frame offset within mAllocated of valid data - size_t mRemaining; // frame count within mAllocated of valid data - size_t mGetCount; // buffer.frameCount of the most recent getNextBuffer - uint32_t mFramesReleased; // counter of the total number of frames released -}; - -} // namespace android - -#endif // ANDROID_SOURCE_AUDIO_BUFFER_PROVIDER_H diff --git a/external/android/include/19/frameworks/av/include/media/nbaio/roundup.h b/external/android/include/19/frameworks/av/include/media/nbaio/roundup.h deleted file mode 100644 index 4c3cc25..0000000 --- a/external/android/include/19/frameworks/av/include/media/nbaio/roundup.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2012 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 ROUNDUP_H -#define ROUNDUP_H - -#ifdef __cplusplus -extern "C" { -#endif - -// Round up to the next highest power of 2 -unsigned roundup(unsigned v); - -#ifdef __cplusplus -} -#endif - -#endif // ROUNDUP_H diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/AACWriter.h b/external/android/include/19/frameworks/av/include/media/stagefright/AACWriter.h deleted file mode 100644 index df1b053..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/AACWriter.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2011 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 AAC_WRITER_H_ -#define AAC_WRITER_H_ - -#include -#include - -namespace android { - -struct MediaSource; -struct MetaData; - -struct AACWriter : public MediaWriter { - AACWriter(const char *filename); - AACWriter(int fd); - - status_t initCheck() const; - - virtual status_t addSource(const sp &source); - virtual bool reachedEOS(); - virtual status_t start(MetaData *params = NULL); - virtual status_t stop() { return reset(); } - virtual status_t pause(); - -protected: - virtual ~AACWriter(); - -private: - enum { - kAdtsHeaderLength = 7, // # of bytes for the adts header - kSamplesPerFrame = 1024, // # of samples in a frame - }; - - int mFd; - status_t mInitCheck; - sp mSource; - bool mStarted; - volatile bool mPaused; - volatile bool mResumed; - volatile bool mDone; - volatile bool mReachedEOS; - pthread_t mThread; - int64_t mEstimatedSizeBytes; - int64_t mEstimatedDurationUs; - int32_t mChannelCount; - int32_t mSampleRate; - int32_t mAACProfile; - int32_t mFrameDurationUs; - - static void *ThreadWrapper(void *); - status_t threadFunc(); - bool exceedsFileSizeLimit(); - bool exceedsFileDurationLimit(); - status_t writeAdtsHeader(uint32_t frameLength); - status_t reset(); - - DISALLOW_EVIL_CONSTRUCTORS(AACWriter); -}; - -} // namespace android - -#endif // AAC_WRITER_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/ACodec.h b/external/android/include/19/frameworks/av/include/media/stagefright/ACodec.h deleted file mode 100644 index a8ffd4a..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/ACodec.h +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Copyright (C) 2010 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 A_CODEC_H_ - -#define A_CODEC_H_ - -#include -#include -#include -#include -#include -#include - -#define TRACK_BUFFER_TIMING 0 - -namespace android { - -struct ABuffer; -struct MemoryDealer; - -struct ACodec : public AHierarchicalStateMachine { - enum { - kWhatFillThisBuffer = 'fill', - kWhatDrainThisBuffer = 'drai', - kWhatEOS = 'eos ', - kWhatShutdownCompleted = 'scom', - kWhatFlushCompleted = 'fcom', - kWhatOutputFormatChanged = 'outC', - kWhatError = 'erro', - kWhatComponentAllocated = 'cAll', - kWhatComponentConfigured = 'cCon', - kWhatInputSurfaceCreated = 'isfc', - kWhatSignaledInputEOS = 'seos', - kWhatBuffersAllocated = 'allc', - kWhatOMXDied = 'OMXd', - }; - - ACodec(); - - void setNotificationMessage(const sp &msg); - void initiateSetup(const sp &msg); - void signalFlush(); - void signalResume(); - void initiateShutdown(bool keepComponentAllocated = false); - - void signalSetParameters(const sp &msg); - void signalEndOfInputStream(); - - void initiateAllocateComponent(const sp &msg); - void initiateConfigureComponent(const sp &msg); - void initiateCreateInputSurface(); - void initiateStart(); - - void signalRequestIDRFrame(); - - struct PortDescription : public RefBase { - size_t countBuffers(); - IOMX::buffer_id bufferIDAt(size_t index) const; - sp bufferAt(size_t index) const; - - private: - friend struct ACodec; - - Vector mBufferIDs; - Vector > mBuffers; - - PortDescription(); - void addBuffer(IOMX::buffer_id id, const sp &buffer); - - DISALLOW_EVIL_CONSTRUCTORS(PortDescription); - }; - -protected: - virtual ~ACodec(); - -private: - struct BaseState; - struct UninitializedState; - struct LoadedState; - struct LoadedToIdleState; - struct IdleToExecutingState; - struct ExecutingState; - struct OutputPortSettingsChangedState; - struct ExecutingToIdleState; - struct IdleToLoadedState; - struct FlushingState; - struct DeathNotifier; - - enum { - kWhatSetup = 'setu', - kWhatOMXMessage = 'omx ', - kWhatInputBufferFilled = 'inpF', - kWhatOutputBufferDrained = 'outD', - kWhatShutdown = 'shut', - kWhatFlush = 'flus', - kWhatResume = 'resm', - kWhatDrainDeferredMessages = 'drai', - kWhatAllocateComponent = 'allo', - kWhatConfigureComponent = 'conf', - kWhatCreateInputSurface = 'cisf', - kWhatSignalEndOfInputStream = 'eois', - kWhatStart = 'star', - kWhatRequestIDRFrame = 'ridr', - kWhatSetParameters = 'setP', - }; - - enum { - kPortIndexInput = 0, - kPortIndexOutput = 1 - }; - - enum { - kFlagIsSecure = 1, - kFlagPushBlankBuffersToNativeWindowOnShutdown = 2, - }; - - struct BufferInfo { - enum Status { - OWNED_BY_US, - OWNED_BY_COMPONENT, - OWNED_BY_UPSTREAM, - OWNED_BY_DOWNSTREAM, - OWNED_BY_NATIVE_WINDOW, - }; - - IOMX::buffer_id mBufferID; - Status mStatus; - unsigned mDequeuedAt; - - sp mData; - sp mGraphicBuffer; - }; - -#if TRACK_BUFFER_TIMING - struct BufferStats { - int64_t mEmptyBufferTimeUs; - int64_t mFillBufferDoneTimeUs; - }; - - KeyedVector mBufferStats; -#endif - - sp mNotify; - - sp mUninitializedState; - sp mLoadedState; - sp mLoadedToIdleState; - sp mIdleToExecutingState; - sp mExecutingState; - sp mOutputPortSettingsChangedState; - sp mExecutingToIdleState; - sp mIdleToLoadedState; - sp mFlushingState; - sp mSkipCutBuffer; - - AString mComponentName; - uint32_t mFlags; - uint32_t mQuirks; - sp mOMX; - IOMX::node_id mNode; - sp mDealer[2]; - - sp mNativeWindow; - - Vector mBuffers[2]; - bool mPortEOS[2]; - status_t mInputEOSResult; - - List > mDeferredQueue; - - bool mSentFormat; - bool mIsEncoder; - bool mUseMetadataOnEncoderOutput; - bool mShutdownInProgress; - - // If "mKeepComponentAllocated" we only transition back to Loaded state - // and do not release the component instance. - bool mKeepComponentAllocated; - - int32_t mEncoderDelay; - int32_t mEncoderPadding; - - bool mChannelMaskPresent; - int32_t mChannelMask; - unsigned mDequeueCounter; - bool mStoreMetaDataInOutputBuffers; - int32_t mMetaDataBuffersToSubmit; - - int64_t mRepeatFrameDelayUs; - - status_t setCyclicIntraMacroblockRefresh(const sp &msg, int32_t mode); - status_t allocateBuffersOnPort(OMX_U32 portIndex); - status_t freeBuffersOnPort(OMX_U32 portIndex); - status_t freeBuffer(OMX_U32 portIndex, size_t i); - - status_t configureOutputBuffersFromNativeWindow( - OMX_U32 *nBufferCount, OMX_U32 *nBufferSize, - OMX_U32 *nMinUndequeuedBuffers); - status_t allocateOutputMetaDataBuffers(); - status_t submitOutputMetaDataBuffer(); - status_t allocateOutputBuffersFromNativeWindow(); - status_t cancelBufferToNativeWindow(BufferInfo *info); - status_t freeOutputBuffersNotOwnedByComponent(); - BufferInfo *dequeueBufferFromNativeWindow(); - - BufferInfo *findBufferByID( - uint32_t portIndex, IOMX::buffer_id bufferID, - ssize_t *index = NULL); - - status_t setComponentRole(bool isEncoder, const char *mime); - status_t configureCodec(const char *mime, const sp &msg); - - status_t setVideoPortFormatType( - OMX_U32 portIndex, - OMX_VIDEO_CODINGTYPE compressionFormat, - OMX_COLOR_FORMATTYPE colorFormat); - - status_t setSupportedOutputFormat(); - - status_t setupVideoDecoder( - const char *mime, int32_t width, int32_t height); - - status_t setupVideoEncoder( - const char *mime, const sp &msg); - - status_t setVideoFormatOnPort( - OMX_U32 portIndex, - int32_t width, int32_t height, - OMX_VIDEO_CODINGTYPE compressionFormat); - - status_t setupAACCodec( - bool encoder, - int32_t numChannels, int32_t sampleRate, int32_t bitRate, - int32_t aacProfile, bool isADTS); - - status_t selectAudioPortFormat( - OMX_U32 portIndex, OMX_AUDIO_CODINGTYPE desiredFormat); - - status_t setupAMRCodec(bool encoder, bool isWAMR, int32_t bitRate); - status_t setupG711Codec(bool encoder, int32_t numChannels); - - status_t setupFlacCodec( - bool encoder, int32_t numChannels, int32_t sampleRate, int32_t compressionLevel); - - status_t setupRawAudioFormat( - OMX_U32 portIndex, int32_t sampleRate, int32_t numChannels); - - status_t setMinBufferSize(OMX_U32 portIndex, size_t size); - - status_t setupMPEG4EncoderParameters(const sp &msg); - status_t setupH263EncoderParameters(const sp &msg); - status_t setupAVCEncoderParameters(const sp &msg); - - status_t verifySupportForProfileAndLevel(int32_t profile, int32_t level); - - status_t configureBitrate( - int32_t bitrate, OMX_VIDEO_CONTROLRATETYPE bitrateMode); - - status_t setupErrorCorrectionParameters(); - - status_t initNativeWindow(); - - status_t pushBlankBuffersToNativeWindow(); - - // Returns true iff all buffers on the given port have status - // OWNED_BY_US or OWNED_BY_NATIVE_WINDOW. - bool allYourBuffersAreBelongToUs(OMX_U32 portIndex); - - bool allYourBuffersAreBelongToUs(); - - void waitUntilAllPossibleNativeWindowBuffersAreReturnedToUs(); - - size_t countBuffersOwnedByComponent(OMX_U32 portIndex) const; - size_t countBuffersOwnedByNativeWindow() const; - - void deferMessage(const sp &msg); - void processDeferredMessages(); - - void sendFormatChange(const sp &reply); - - void signalError( - OMX_ERRORTYPE error = OMX_ErrorUndefined, - status_t internalError = UNKNOWN_ERROR); - - status_t requestIDRFrame(); - status_t setParameters(const sp ¶ms); - - // Send EOS on input stream. - void onSignalEndOfInputStream(); - - DISALLOW_EVIL_CONSTRUCTORS(ACodec); -}; - -} // namespace android - -#endif // A_CODEC_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/AMRWriter.h b/external/android/include/19/frameworks/av/include/media/stagefright/AMRWriter.h deleted file mode 100644 index 392f968..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/AMRWriter.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2010 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 AMR_WRITER_H_ - -#define AMR_WRITER_H_ - -#include - -#include -#include - -namespace android { - -struct MediaSource; -struct MetaData; - -struct AMRWriter : public MediaWriter { - AMRWriter(const char *filename); - AMRWriter(int fd); - - status_t initCheck() const; - - virtual status_t addSource(const sp &source); - virtual bool reachedEOS(); - virtual status_t start(MetaData *params = NULL); - virtual status_t stop() { return reset(); } - virtual status_t pause(); - -protected: - virtual ~AMRWriter(); - -private: - int mFd; - status_t mInitCheck; - sp mSource; - bool mStarted; - volatile bool mPaused; - volatile bool mResumed; - volatile bool mDone; - volatile bool mReachedEOS; - pthread_t mThread; - int64_t mEstimatedSizeBytes; - int64_t mEstimatedDurationUs; - - static void *ThreadWrapper(void *); - status_t threadFunc(); - bool exceedsFileSizeLimit(); - bool exceedsFileDurationLimit(); - status_t reset(); - - AMRWriter(const AMRWriter &); - AMRWriter &operator=(const AMRWriter &); -}; - -} // namespace android - -#endif // AMR_WRITER_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/AudioPlayer.h b/external/android/include/19/frameworks/av/include/media/stagefright/AudioPlayer.h deleted file mode 100644 index 912a43c..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/AudioPlayer.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - * 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 AUDIO_PLAYER_H_ - -#define AUDIO_PLAYER_H_ - -#include -#include -#include -#include - -namespace android { - -class MediaSource; -class AudioTrack; -class AwesomePlayer; - -class AudioPlayer : public TimeSource { -public: - enum { - REACHED_EOS, - SEEK_COMPLETE - }; - - enum { - ALLOW_DEEP_BUFFERING = 0x01, - USE_OFFLOAD = 0x02, - HAS_VIDEO = 0x1000, - IS_STREAMING = 0x2000 - - }; - - AudioPlayer(const sp &audioSink, - uint32_t flags = 0, - AwesomePlayer *audioObserver = NULL); - - virtual ~AudioPlayer(); - - // Caller retains ownership of "source". - void setSource(const sp &source); - - // Return time in us. - virtual int64_t getRealTimeUs(); - - status_t start(bool sourceAlreadyStarted = false); - - void pause(bool playPendingSamples = false); - status_t resume(); - - // Returns the timestamp of the last buffer played (in us). - int64_t getMediaTimeUs(); - - // Returns true iff a mapping is established, i.e. the AudioPlayer - // has played at least one frame of audio. - bool getMediaTimeMapping(int64_t *realtime_us, int64_t *mediatime_us); - - status_t seekTo(int64_t time_us); - - bool isSeeking(); - bool reachedEOS(status_t *finalStatus); - - status_t setPlaybackRatePermille(int32_t ratePermille); - - void notifyAudioEOS(); - -private: - friend class VideoEditorAudioPlayer; - sp mSource; - sp mAudioTrack; - - MediaBuffer *mInputBuffer; - - int mSampleRate; - int64_t mLatencyUs; - size_t mFrameSize; - - Mutex mLock; - int64_t mNumFramesPlayed; - int64_t mNumFramesPlayedSysTimeUs; - - int64_t mPositionTimeMediaUs; - int64_t mPositionTimeRealUs; - - bool mSeeking; - bool mReachedEOS; - status_t mFinalStatus; - int64_t mSeekTimeUs; - - bool mStarted; - - bool mIsFirstBuffer; - status_t mFirstBufferResult; - MediaBuffer *mFirstBuffer; - - sp mAudioSink; - AwesomePlayer *mObserver; - int64_t mPinnedTimeUs; - - bool mPlaying; - int64_t mStartPosUs; - const uint32_t mCreateFlags; - - static void AudioCallback(int event, void *user, void *info); - void AudioCallback(int event, void *info); - - static size_t AudioSinkCallback( - MediaPlayerBase::AudioSink *audioSink, - void *data, size_t size, void *me, - MediaPlayerBase::AudioSink::cb_event_t event); - - size_t fillBuffer(void *data, size_t size); - - int64_t getRealTimeUsLocked() const; - - void reset(); - - uint32_t getNumFramesPendingPlayout() const; - int64_t getOutputPlayPositionUs_l() const; - - bool allowDeepBuffering() const { return (mCreateFlags & ALLOW_DEEP_BUFFERING) != 0; } - bool useOffload() const { return (mCreateFlags & USE_OFFLOAD) != 0; } - - AudioPlayer(const AudioPlayer &); - AudioPlayer &operator=(const AudioPlayer &); -}; - -} // namespace android - -#endif // AUDIO_PLAYER_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/AudioSource.h b/external/android/include/19/frameworks/av/include/media/stagefright/AudioSource.h deleted file mode 100644 index 4c9aaad..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/AudioSource.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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 AUDIO_SOURCE_H_ - -#define AUDIO_SOURCE_H_ - -#include -#include -#include -#include -#include - -#include - -namespace android { - -class AudioRecord; - -struct AudioSource : public MediaSource, public MediaBufferObserver { - // Note that the "channels" parameter _is_ the number of channels, - // _not_ a bitmask of audio_channels_t constants. - AudioSource( - audio_source_t inputSource, - uint32_t sampleRate, - uint32_t channels = 1); - - status_t initCheck() const; - - virtual status_t start(MetaData *params = NULL); - virtual status_t stop() { return reset(); } - virtual sp getFormat(); - - // Returns the maximum amplitude since last call. - int16_t getMaxAmplitude(); - - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL); - - status_t dataCallback(const AudioRecord::Buffer& buffer); - virtual void signalBufferReturned(MediaBuffer *buffer); - -protected: - virtual ~AudioSource(); - -private: - enum { - kMaxBufferSize = 2048, - - // After the initial mute, we raise the volume linearly - // over kAutoRampDurationUs. - kAutoRampDurationUs = 300000, - - // This is the initial mute duration to suppress - // the video recording signal tone - kAutoRampStartUs = 0, - }; - - Mutex mLock; - Condition mFrameAvailableCondition; - Condition mFrameEncodingCompletionCondition; - - sp mRecord; - status_t mInitCheck; - bool mStarted; - int32_t mSampleRate; - - bool mTrackMaxAmplitude; - int64_t mStartTimeUs; - int16_t mMaxAmplitude; - int64_t mPrevSampleTimeUs; - int64_t mInitialReadTimeUs; - int64_t mNumFramesReceived; - int64_t mNumClientOwnedBuffers; - - List mBuffersReceived; - - void trackMaxAmplitude(int16_t *data, int nSamples); - - // This is used to raise the volume from mute to the - // actual level linearly. - void rampVolume( - int32_t startFrame, int32_t rampDurationFrames, - uint8_t *data, size_t bytes); - - void queueInputBuffer_l(MediaBuffer *buffer, int64_t timeUs); - void releaseQueuedFrames_l(); - void waitOutstandingEncodingFrames_l(); - status_t reset(); - - AudioSource(const AudioSource &); - AudioSource &operator=(const AudioSource &); -}; - -} // namespace android - -#endif // AUDIO_SOURCE_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/BufferProducerWrapper.h b/external/android/include/19/frameworks/av/include/media/stagefright/BufferProducerWrapper.h deleted file mode 100644 index d8acf30..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/BufferProducerWrapper.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2013 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 BUFFER_PRODUCER_WRAPPER_H_ - -#define BUFFER_PRODUCER_WRAPPER_H_ - -#include - -namespace android { - -// Can't use static_cast to cast a RefBase back to an IGraphicBufferProducer, -// because IGBP's parent (IInterface) uses virtual inheritance. This class -// wraps IGBP while we pass it through AMessage. - -struct BufferProducerWrapper : RefBase { - BufferProducerWrapper( - const sp& bufferProducer) : - mBufferProducer(bufferProducer) { } - - sp getBufferProducer() const { - return mBufferProducer; - } - -private: - const sp mBufferProducer; - - DISALLOW_EVIL_CONSTRUCTORS(BufferProducerWrapper); -}; - -} // namespace android - -#endif // BUFFER_PRODUCER_WRAPPER_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/CameraSource.h b/external/android/include/19/frameworks/av/include/media/stagefright/CameraSource.h deleted file mode 100644 index a829916..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/CameraSource.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * 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 CAMERA_SOURCE_H_ - -#define CAMERA_SOURCE_H_ - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace android { - -class IMemory; -class Camera; -class Surface; - -class CameraSource : public MediaSource, public MediaBufferObserver { -public: - /** - * Factory method to create a new CameraSource using the current - * settings (such as video size, frame rate, color format, etc) - * from the default camera. - * - * @param clientName The package/process name of the client application. - * This is used for permissions checking. - * @return NULL on error. - */ - static CameraSource *Create(const String16 &clientName); - - /** - * Factory method to create a new CameraSource. - * - * @param camera the video input frame data source. If it is NULL, - * we will try to connect to the camera with the given - * cameraId. - * - * @param cameraId the id of the camera that the source will connect - * to if camera is NULL; otherwise ignored. - * @param clientName the package/process name of the camera-using - * application if camera is NULL; otherwise ignored. Used for - * permissions checking. - * @param clientUid the UID of the camera-using application if camera is - * NULL; otherwise ignored. Used for permissions checking. - * @param videoSize the dimension (in pixels) of the video frame - * @param frameRate the target frames per second - * @param surface the preview surface for display where preview - * frames are sent to - * @param storeMetaDataInVideoBuffers true to request the camera - * source to store meta data in video buffers; false to - * request the camera source to store real YUV frame data - * in the video buffers. The camera source may not support - * storing meta data in video buffers, if so, a request - * to do that will NOT be honored. To find out whether - * meta data is actually being stored in video buffers - * during recording, call isMetaDataStoredInVideoBuffers(). - * - * @return NULL on error. - */ - static CameraSource *CreateFromCamera(const sp &camera, - const sp &proxy, - int32_t cameraId, - const String16& clientName, - uid_t clientUid, - Size videoSize, - int32_t frameRate, - const sp& surface, - bool storeMetaDataInVideoBuffers = false); - - virtual ~CameraSource(); - - virtual status_t start(MetaData *params = NULL); - virtual status_t stop() { return reset(); } - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL); - - /** - * Check whether a CameraSource object is properly initialized. - * Must call this method before stop(). - * @return OK if initialization has successfully completed. - */ - virtual status_t initCheck() const; - - /** - * Returns the MetaData associated with the CameraSource, - * including: - * kKeyColorFormat: YUV color format of the video frames - * kKeyWidth, kKeyHeight: dimension (in pixels) of the video frames - * kKeySampleRate: frame rate in frames per second - * kKeyMIMEType: always fixed to be MEDIA_MIMETYPE_VIDEO_RAW - */ - virtual sp getFormat(); - - /** - * Tell whether this camera source stores meta data or real YUV - * frame data in video buffers. - * - * @return true if meta data is stored in the video - * buffers; false if real YUV data is stored in - * the video buffers. - */ - bool isMetaDataStoredInVideoBuffers() const; - - virtual void signalBufferReturned(MediaBuffer* buffer); - -protected: - class ProxyListener: public BnCameraRecordingProxyListener { - public: - ProxyListener(const sp& source); - virtual void dataCallbackTimestamp(int64_t timestampUs, int32_t msgType, - const sp &data); - - private: - sp mSource; - }; - - // isBinderAlive needs linkToDeath to work. - class DeathNotifier: public IBinder::DeathRecipient { - public: - DeathNotifier() {} - virtual void binderDied(const wp& who); - }; - - enum CameraFlags { - FLAGS_SET_CAMERA = 1L << 0, - FLAGS_HOT_CAMERA = 1L << 1, - }; - - int32_t mCameraFlags; - Size mVideoSize; - int32_t mNumInputBuffers; - int32_t mVideoFrameRate; - int32_t mColorFormat; - status_t mInitCheck; - - sp mCamera; - sp mCameraRecordingProxy; - sp mDeathNotifier; - sp mSurface; - sp mMeta; - - int64_t mStartTimeUs; - int32_t mNumFramesReceived; - int64_t mLastFrameTimestampUs; - bool mStarted; - int32_t mNumFramesEncoded; - - // Time between capture of two frames. - int64_t mTimeBetweenFrameCaptureUs; - - CameraSource(const sp& camera, const sp& proxy, - int32_t cameraId, const String16& clientName, uid_t clientUid, - Size videoSize, int32_t frameRate, - const sp& surface, - bool storeMetaDataInVideoBuffers); - - virtual void startCameraRecording(); - virtual void releaseRecordingFrame(const sp& frame); - - // Returns true if need to skip the current frame. - // Called from dataCallbackTimestamp. - virtual bool skipCurrentFrame(int64_t timestampUs) {return false;} - - // Callback called when still camera raw data is available. - virtual void dataCallback(int32_t msgType, const sp &data) {} - - virtual void dataCallbackTimestamp(int64_t timestampUs, int32_t msgType, - const sp &data); - -private: - friend class CameraSourceListener; - - Mutex mLock; - Condition mFrameAvailableCondition; - Condition mFrameCompleteCondition; - List > mFramesReceived; - List > mFramesBeingEncoded; - List mFrameTimes; - - int64_t mFirstFrameTimeUs; - int32_t mNumFramesDropped; - int32_t mNumGlitches; - int64_t mGlitchDurationThresholdUs; - bool mCollectStats; - bool mIsMetaDataStoredInVideoBuffers; - - void releaseQueuedFrames(); - void releaseOneRecordingFrame(const sp& frame); - - - status_t init(const sp& camera, const sp& proxy, - int32_t cameraId, const String16& clientName, uid_t clientUid, - Size videoSize, int32_t frameRate, bool storeMetaDataInVideoBuffers); - - status_t initWithCameraAccess( - const sp& camera, const sp& proxy, - int32_t cameraId, const String16& clientName, uid_t clientUid, - Size videoSize, int32_t frameRate, bool storeMetaDataInVideoBuffers); - - status_t isCameraAvailable(const sp& camera, - const sp& proxy, - int32_t cameraId, - const String16& clientName, - uid_t clientUid); - - status_t isCameraColorFormatSupported(const CameraParameters& params); - status_t configureCamera(CameraParameters* params, - int32_t width, int32_t height, - int32_t frameRate); - - status_t checkVideoSize(const CameraParameters& params, - int32_t width, int32_t height); - - status_t checkFrameRate(const CameraParameters& params, - int32_t frameRate); - - void stopCameraRecording(); - void releaseCamera(); - status_t reset(); - - CameraSource(const CameraSource &); - CameraSource &operator=(const CameraSource &); -}; - -} // namespace android - -#endif // CAMERA_SOURCE_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/CameraSourceTimeLapse.h b/external/android/include/19/frameworks/av/include/media/stagefright/CameraSourceTimeLapse.h deleted file mode 100644 index 6b7a63c..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/CameraSourceTimeLapse.h +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright (C) 2010 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 CAMERA_SOURCE_TIME_LAPSE_H_ - -#define CAMERA_SOURCE_TIME_LAPSE_H_ - -#include - -#include -#include -#include - -namespace android { - -class ICamera; -class IMemory; -class Camera; - -class CameraSourceTimeLapse : public CameraSource { -public: - static CameraSourceTimeLapse *CreateFromCamera( - const sp &camera, - const sp &proxy, - int32_t cameraId, - const String16& clientName, - uid_t clientUid, - Size videoSize, - int32_t videoFrameRate, - const sp& surface, - int64_t timeBetweenTimeLapseFrameCaptureUs); - - virtual ~CameraSourceTimeLapse(); - - // If the frame capture interval is large, read will block for a long time. - // Due to the way the mediaRecorder framework works, a stop() call from - // mediaRecorder waits until the read returns, causing a long wait for - // stop() to return. To avoid this, we can make read() return a copy of the - // last read frame with the same time stamp frequently. This keeps the - // read() call from blocking too long. Calling this function quickly - // captures another frame, keeps its copy, and enables this mode of read() - // returning quickly. - void startQuickReadReturns(); - -private: - // size of the encoded video. - int32_t mVideoWidth; - int32_t mVideoHeight; - - // Time between two frames in final video (1/frameRate) - int64_t mTimeBetweenTimeLapseVideoFramesUs; - - // Real timestamp of the last encoded time lapse frame - int64_t mLastTimeLapseFrameRealTimestampUs; - - // Variable set in dataCallbackTimestamp() to help skipCurrentFrame() - // to know if current frame needs to be skipped. - bool mSkipCurrentFrame; - - // Lock for accessing mCameraIdle - Mutex mCameraIdleLock; - - // Condition variable to wait on if camera is is not yet idle. Once the - // camera gets idle, this variable will be signalled. - Condition mCameraIdleCondition; - - // True if camera is in preview mode and ready for takePicture(). - // False after a call to takePicture() but before the final compressed - // data callback has been called and preview has been restarted. - volatile bool mCameraIdle; - - // True if stop() is waiting for camera to get idle, i.e. for the last - // takePicture() to complete. This is needed so that dataCallbackTimestamp() - // can return immediately. - volatile bool mStopWaitingForIdleCamera; - - // Lock for accessing quick stop variables. - Mutex mQuickStopLock; - - // mQuickStop is set to true if we use quick read() returns, otherwise it is set - // to false. Once in this mode read() return a copy of the last read frame - // with the same time stamp. See startQuickReadReturns(). - volatile bool mQuickStop; - - // Forces the next frame passed to dataCallbackTimestamp() to be read - // as a time lapse frame. Used by startQuickReadReturns() so that the next - // frame wakes up any blocking read. - volatile bool mForceRead; - - // Stores a copy of the MediaBuffer read in the last read() call after - // mQuickStop was true. - MediaBuffer* mLastReadBufferCopy; - - // Status code for last read. - status_t mLastReadStatus; - - CameraSourceTimeLapse( - const sp &camera, - const sp &proxy, - int32_t cameraId, - const String16& clientName, - uid_t clientUid, - Size videoSize, - int32_t videoFrameRate, - const sp& surface, - int64_t timeBetweenTimeLapseFrameCaptureUs); - - // Wrapper over CameraSource::signalBufferReturned() to implement quick stop. - // It only handles the case when mLastReadBufferCopy is signalled. Otherwise - // it calls the base class' function. - virtual void signalBufferReturned(MediaBuffer* buffer); - - // Wrapper over CameraSource::read() to implement quick stop. - virtual status_t read(MediaBuffer **buffer, const ReadOptions *options = NULL); - - // mSkipCurrentFrame is set to true in dataCallbackTimestamp() if the current - // frame needs to be skipped and this function just returns the value of mSkipCurrentFrame. - virtual bool skipCurrentFrame(int64_t timestampUs); - - // In the video camera case calls skipFrameAndModifyTimeStamp() to modify - // timestamp and set mSkipCurrentFrame. - // Then it calls the base CameraSource::dataCallbackTimestamp() - virtual void dataCallbackTimestamp(int64_t timestampUs, int32_t msgType, - const sp &data); - - // Convenience function to fill mLastReadBufferCopy from the just read - // buffer. - void fillLastReadBufferCopy(MediaBuffer& sourceBuffer); - - // If the passed in size (width x height) is a supported video/preview size, - // the function sets the camera's video/preview size to it and returns true. - // Otherwise returns false. - bool trySettingVideoSize(int32_t width, int32_t height); - - // When video camera is used for time lapse capture, returns true - // until enough time has passed for the next time lapse frame. When - // the frame needs to be encoded, it returns false and also modifies - // the time stamp to be one frame time ahead of the last encoded - // frame's time stamp. - bool skipFrameAndModifyTimeStamp(int64_t *timestampUs); - - // Wrapper to enter threadTimeLapseEntry() - static void *ThreadTimeLapseWrapper(void *me); - - // Creates a copy of source_data into a new memory of final type MemoryBase. - sp createIMemoryCopy(const sp &source_data); - - CameraSourceTimeLapse(const CameraSourceTimeLapse &); - CameraSourceTimeLapse &operator=(const CameraSourceTimeLapse &); -}; - -} // namespace android - -#endif // CAMERA_SOURCE_TIME_LAPSE_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/ColorConverter.h b/external/android/include/19/frameworks/av/include/media/stagefright/ColorConverter.h deleted file mode 100644 index 85ba920..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/ColorConverter.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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 COLOR_CONVERTER_H_ - -#define COLOR_CONVERTER_H_ - -#include - -#include -#include - -#include - -namespace android { - -struct ColorConverter { - ColorConverter(OMX_COLOR_FORMATTYPE from, OMX_COLOR_FORMATTYPE to); - ~ColorConverter(); - - bool isValid() const; - - status_t convert( - const void *srcBits, - size_t srcWidth, size_t srcHeight, - size_t srcCropLeft, size_t srcCropTop, - size_t srcCropRight, size_t srcCropBottom, - void *dstBits, - size_t dstWidth, size_t dstHeight, - size_t dstCropLeft, size_t dstCropTop, - size_t dstCropRight, size_t dstCropBottom); - -private: - struct BitmapParams { - BitmapParams( - void *bits, - size_t width, size_t height, - size_t cropLeft, size_t cropTop, - size_t cropRight, size_t cropBottom); - - size_t cropWidth() const; - size_t cropHeight() const; - - void *mBits; - size_t mWidth, mHeight; - size_t mCropLeft, mCropTop, mCropRight, mCropBottom; - }; - - OMX_COLOR_FORMATTYPE mSrcFormat, mDstFormat; - uint8_t *mClip; - - uint8_t *initClip(); - - status_t convertCbYCrY( - const BitmapParams &src, const BitmapParams &dst); - - status_t convertYUV420Planar( - const BitmapParams &src, const BitmapParams &dst); - - status_t convertQCOMYUV420SemiPlanar( - const BitmapParams &src, const BitmapParams &dst); - - status_t convertYUV420SemiPlanar( - const BitmapParams &src, const BitmapParams &dst); - - status_t convertTIYUV420PackedSemiPlanar( - const BitmapParams &src, const BitmapParams &dst); - - ColorConverter(const ColorConverter &); - ColorConverter &operator=(const ColorConverter &); -}; - -} // namespace android - -#endif // COLOR_CONVERTER_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/DataSource.h b/external/android/include/19/frameworks/av/include/media/stagefright/DataSource.h deleted file mode 100644 index 742bc0e..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/DataSource.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * 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 DATA_SOURCE_H_ - -#define DATA_SOURCE_H_ - -#include - -#include -#include -#include -#include -#include -#include -#include - -namespace android { - -struct AMessage; -class String8; - -class DataSource : public RefBase { -public: - enum Flags { - kWantsPrefetching = 1, - kStreamedFromLocalHost = 2, - kIsCachingDataSource = 4, - kIsHTTPBasedSource = 8, - }; - - static sp CreateFromURI( - const char *uri, - const KeyedVector *headers = NULL); - - DataSource() {} - - virtual status_t initCheck() const = 0; - - virtual ssize_t readAt(off64_t offset, void *data, size_t size) = 0; - - // Convenience methods: - bool getUInt16(off64_t offset, uint16_t *x); - bool getUInt24(off64_t offset, uint32_t *x); // 3 byte int, returned as a 32-bit int - bool getUInt32(off64_t offset, uint32_t *x); - bool getUInt64(off64_t offset, uint64_t *x); - - // May return ERROR_UNSUPPORTED. - virtual status_t getSize(off64_t *size); - - virtual uint32_t flags() { - return 0; - } - - virtual status_t reconnectAtOffset(off64_t offset) { - return ERROR_UNSUPPORTED; - } - - //////////////////////////////////////////////////////////////////////////// - - bool sniff(String8 *mimeType, float *confidence, sp *meta); - - // The sniffer can optionally fill in "meta" with an AMessage containing - // a dictionary of values that helps the corresponding extractor initialize - // its state without duplicating effort already exerted by the sniffer. - typedef bool (*SnifferFunc)( - const sp &source, String8 *mimeType, - float *confidence, sp *meta); - - static void RegisterSniffer(SnifferFunc func); - static void RegisterDefaultSniffers(); - - // for DRM - virtual sp DrmInitialization(const char *mime = NULL) { - return NULL; - } - virtual void getDrmInfo(sp &handle, DrmManagerClient **client) {}; - - virtual String8 getUri() { - return String8(); - } - - virtual String8 getMIMEType() const; - -protected: - virtual ~DataSource() {} - -private: - static Mutex gSnifferMutex; - static List gSniffers; - - DataSource(const DataSource &); - DataSource &operator=(const DataSource &); -}; - -} // namespace android - -#endif // DATA_SOURCE_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/FileSource.h b/external/android/include/19/frameworks/av/include/media/stagefright/FileSource.h deleted file mode 100644 index d994cb3..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/FileSource.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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 FILE_SOURCE_H_ - -#define FILE_SOURCE_H_ - -#include - -#include -#include -#include -#include - -namespace android { - -class FileSource : public DataSource { -public: - FileSource(const char *filename); - FileSource(int fd, int64_t offset, int64_t length); - - virtual status_t initCheck() const; - - virtual ssize_t readAt(off64_t offset, void *data, size_t size); - - virtual status_t getSize(off64_t *size); - - virtual sp DrmInitialization(const char *mime); - - virtual void getDrmInfo(sp &handle, DrmManagerClient **client); - -protected: - virtual ~FileSource(); - -private: - int mFd; - int64_t mOffset; - int64_t mLength; - Mutex mLock; - - /*for DRM*/ - sp mDecryptHandle; - DrmManagerClient *mDrmManagerClient; - int64_t mDrmBufOffset; - int64_t mDrmBufSize; - unsigned char *mDrmBuf; - - ssize_t readAtDRM(off64_t offset, void *data, size_t size); - - FileSource(const FileSource &); - FileSource &operator=(const FileSource &); -}; - -} // namespace android - -#endif // FILE_SOURCE_H_ - diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/JPEGSource.h b/external/android/include/19/frameworks/av/include/media/stagefright/JPEGSource.h deleted file mode 100644 index 1b7e91b..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/JPEGSource.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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 JPEG_SOURCE_H_ - -#define JPEG_SOURCE_H_ - -#include - -namespace android { - -class DataSource; -class MediaBufferGroup; - -struct JPEGSource : public MediaSource { - JPEGSource(const sp &source); - - virtual status_t start(MetaData *params = NULL); - virtual status_t stop(); - virtual sp getFormat(); - - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL); - -protected: - virtual ~JPEGSource(); - -private: - sp mSource; - MediaBufferGroup *mGroup; - bool mStarted; - off64_t mSize; - int32_t mWidth, mHeight; - off64_t mOffset; - - status_t parseJPEG(); - - JPEGSource(const JPEGSource &); - JPEGSource &operator=(const JPEGSource &); -}; - -} // namespace android - -#endif // JPEG_SOURCE_H_ - diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/MPEG2TSWriter.h b/external/android/include/19/frameworks/av/include/media/stagefright/MPEG2TSWriter.h deleted file mode 100644 index 2e2922e..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/MPEG2TSWriter.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2010 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 MPEG2TS_WRITER_H_ - -#define MPEG2TS_WRITER_H_ - -#include -#include -#include -#include - -namespace android { - -struct ABuffer; - -struct MPEG2TSWriter : public MediaWriter { - MPEG2TSWriter(int fd); - MPEG2TSWriter(const char *filename); - - MPEG2TSWriter( - void *cookie, - ssize_t (*write)(void *cookie, const void *data, size_t size)); - - virtual status_t addSource(const sp &source); - virtual status_t start(MetaData *param = NULL); - virtual status_t stop() { return reset(); } - virtual status_t pause(); - virtual bool reachedEOS(); - virtual status_t dump(int fd, const Vector& args); - - void onMessageReceived(const sp &msg); - -protected: - virtual ~MPEG2TSWriter(); - -private: - enum { - kWhatSourceNotify = 'noti' - }; - - struct SourceInfo; - - FILE *mFile; - - void *mWriteCookie; - ssize_t (*mWriteFunc)(void *cookie, const void *data, size_t size); - - sp mLooper; - sp > mReflector; - - bool mStarted; - - Vector > mSources; - size_t mNumSourcesDone; - - int64_t mNumTSPacketsWritten; - int64_t mNumTSPacketsBeforeMeta; - int mPATContinuityCounter; - int mPMTContinuityCounter; - uint32_t mCrcTable[256]; - - void init(); - - void writeTS(); - void writeProgramAssociationTable(); - void writeProgramMap(); - void writeAccessUnit(int32_t sourceIndex, const sp &buffer); - void initCrcTable(); - uint32_t crc32(const uint8_t *start, size_t length); - - ssize_t internalWrite(const void *data, size_t size); - status_t reset(); - - DISALLOW_EVIL_CONSTRUCTORS(MPEG2TSWriter); -}; - -} // namespace android - -#endif // MPEG2TS_WRITER_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/MPEG4Writer.h b/external/android/include/19/frameworks/av/include/media/stagefright/MPEG4Writer.h deleted file mode 100644 index 3ef6b9a..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/MPEG4Writer.h +++ /dev/null @@ -1,211 +0,0 @@ -/* - * 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 MPEG4_WRITER_H_ - -#define MPEG4_WRITER_H_ - -#include - -#include -#include -#include - -namespace android { - -class MediaBuffer; -class MediaSource; -class MetaData; - -class MPEG4Writer : public MediaWriter { -public: - MPEG4Writer(const char *filename); - MPEG4Writer(int fd); - - // Limitations - // 1. No more than 2 tracks can be added - // 2. Only video or audio source can be added - // 3. No more than one video and/or one audio source can be added. - virtual status_t addSource(const sp &source); - - // Returns INVALID_OPERATION if there is no source or track. - virtual status_t start(MetaData *param = NULL); - virtual status_t stop() { return reset(); } - virtual status_t pause(); - virtual bool reachedEOS(); - virtual status_t dump(int fd, const Vector& args); - - void beginBox(const char *fourcc); - void writeInt8(int8_t x); - void writeInt16(int16_t x); - void writeInt32(int32_t x); - void writeInt64(int64_t x); - void writeCString(const char *s); - void writeFourcc(const char *fourcc); - void write(const void *data, size_t size); - inline size_t write(const void *ptr, size_t size, size_t nmemb); - void endBox(); - uint32_t interleaveDuration() const { return mInterleaveDurationUs; } - status_t setInterleaveDuration(uint32_t duration); - int32_t getTimeScale() const { return mTimeScale; } - - status_t setGeoData(int latitudex10000, int longitudex10000); - void setStartTimeOffsetMs(int ms) { mStartTimeOffsetMs = ms; } - int32_t getStartTimeOffsetMs() const { return mStartTimeOffsetMs; } - -protected: - virtual ~MPEG4Writer(); - -private: - class Track; - - int mFd; - status_t mInitCheck; - bool mIsRealTimeRecording; - bool mUse4ByteNalLength; - bool mUse32BitOffset; - bool mIsFileSizeLimitExplicitlyRequested; - bool mPaused; - bool mStarted; // Writer thread + track threads started successfully - bool mWriterThreadStarted; // Only writer thread started successfully - off64_t mOffset; - off_t mMdatOffset; - uint8_t *mMoovBoxBuffer; - off64_t mMoovBoxBufferOffset; - bool mWriteMoovBoxToMemory; - off64_t mFreeBoxOffset; - bool mStreamableFile; - off64_t mEstimatedMoovBoxSize; - uint32_t mInterleaveDurationUs; - int32_t mTimeScale; - int64_t mStartTimestampUs; - int mLatitudex10000; - int mLongitudex10000; - bool mAreGeoTagsAvailable; - int32_t mStartTimeOffsetMs; - - Mutex mLock; - - List mTracks; - - List mBoxes; - - void setStartTimestampUs(int64_t timeUs); - int64_t getStartTimestampUs(); // Not const - status_t startTracks(MetaData *params); - size_t numTracks(); - int64_t estimateMoovBoxSize(int32_t bitRate); - - struct Chunk { - Track *mTrack; // Owner - int64_t mTimeStampUs; // Timestamp of the 1st sample - List mSamples; // Sample data - - // Convenient constructor - Chunk(): mTrack(NULL), mTimeStampUs(0) {} - - Chunk(Track *track, int64_t timeUs, List samples) - : mTrack(track), mTimeStampUs(timeUs), mSamples(samples) { - } - - }; - struct ChunkInfo { - Track *mTrack; // Owner - List mChunks; // Remaining chunks to be written - - // Previous chunk timestamp that has been written - int64_t mPrevChunkTimestampUs; - - // Max time interval between neighboring chunks - int64_t mMaxInterChunkDurUs; - - }; - - bool mIsFirstChunk; - volatile bool mDone; // Writer thread is done? - pthread_t mThread; // Thread id for the writer - List mChunkInfos; // Chunk infos - Condition mChunkReadyCondition; // Signal that chunks are available - - // Writer thread handling - status_t startWriterThread(); - void stopWriterThread(); - static void *ThreadWrapper(void *me); - void threadFunc(); - - // Buffer a single chunk to be written out later. - void bufferChunk(const Chunk& chunk); - - // Write all buffered chunks from all tracks - void writeAllChunks(); - - // Retrieve the proper chunk to write if there is one - // Return true if a chunk is found; otherwise, return false. - bool findChunkToWrite(Chunk *chunk); - - // Actually write the given chunk to the file. - void writeChunkToFile(Chunk* chunk); - - // Adjust other track media clock (presumably wall clock) - // based on audio track media clock with the drift time. - int64_t mDriftTimeUs; - void setDriftTimeUs(int64_t driftTimeUs); - int64_t getDriftTimeUs(); - - // Return whether the nal length is 4 bytes or 2 bytes - // Only makes sense for H.264/AVC - bool useNalLengthFour(); - - // Return whether the writer is used for real time recording. - // In real time recording mode, new samples will be allowed to buffered into - // chunks in higher priority thread, even though the file writer has not - // drained the chunks yet. - // By default, real time recording is on. - bool isRealTimeRecording() const; - - void lock(); - void unlock(); - - // Acquire lock before calling these methods - off64_t addSample_l(MediaBuffer *buffer); - off64_t addLengthPrefixedSample_l(MediaBuffer *buffer); - - bool exceedsFileSizeLimit(); - bool use32BitFileOffset() const; - bool exceedsFileDurationLimit(); - bool isFileStreamable() const; - void trackProgressStatus(size_t trackId, int64_t timeUs, status_t err = OK); - void writeCompositionMatrix(int32_t degrees); - void writeMvhdBox(int64_t durationUs); - void writeMoovBox(int64_t durationUs); - void writeFtypBox(MetaData *param); - void writeUdtaBox(); - void writeGeoDataBox(); - void writeLatitude(int degreex10000); - void writeLongitude(int degreex10000); - void sendSessionSummary(); - void release(); - status_t reset(); - - static uint32_t getMpeg4Time(); - - MPEG4Writer(const MPEG4Writer &); - MPEG4Writer &operator=(const MPEG4Writer &); -}; - -} // namespace android - -#endif // MPEG4_WRITER_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/MediaAdapter.h b/external/android/include/19/frameworks/av/include/media/stagefright/MediaAdapter.h deleted file mode 100644 index 369fce6..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/MediaAdapter.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2013 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 MEDIA_ADAPTER_H -#define MEDIA_ADAPTER_H - -#include -#include -#include -#include -#include - -namespace android { - -// Convert the MediaMuxer's push model into MPEG4Writer's pull model. -// Used only by the MediaMuxer for now. -struct MediaAdapter : public MediaSource, public MediaBufferObserver { -public: - // MetaData is used to set the format and returned at getFormat. - MediaAdapter(const sp &meta); - virtual ~MediaAdapter(); - ///////////////////////////////////////////////// - // Inherited functions from MediaSource - ///////////////////////////////////////////////// - - virtual status_t start(MetaData *params = NULL); - virtual status_t stop(); - virtual sp getFormat(); - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL); - - ///////////////////////////////////////////////// - // Inherited functions from MediaBufferObserver - ///////////////////////////////////////////////// - - virtual void signalBufferReturned(MediaBuffer *buffer); - - ///////////////////////////////////////////////// - // Non-inherited functions: - ///////////////////////////////////////////////// - - // pushBuffer() will wait for the read() finish, and read() will have a - // deep copy, such that after pushBuffer return, the buffer can be re-used. - status_t pushBuffer(MediaBuffer *buffer); - -private: - Mutex mAdapterLock; - // Make sure the read() wait for the incoming buffer. - Condition mBufferReadCond; - // Make sure the pushBuffer() wait for the current buffer consumed. - Condition mBufferReturnedCond; - - MediaBuffer *mCurrentMediaBuffer; - - bool mStarted; - sp mOutputFormat; - - DISALLOW_EVIL_CONSTRUCTORS(MediaAdapter); -}; - -} // namespace android - -#endif // MEDIA_ADAPTER_H diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/MediaBuffer.h b/external/android/include/19/frameworks/av/include/media/stagefright/MediaBuffer.h deleted file mode 100644 index 3d79596..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/MediaBuffer.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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 MEDIA_BUFFER_H_ - -#define MEDIA_BUFFER_H_ - -#include - -#include -#include - -namespace android { - -struct ABuffer; -class GraphicBuffer; -class MediaBuffer; -class MediaBufferObserver; -class MetaData; - -class MediaBufferObserver { -public: - MediaBufferObserver() {} - virtual ~MediaBufferObserver() {} - - virtual void signalBufferReturned(MediaBuffer *buffer) = 0; - -private: - MediaBufferObserver(const MediaBufferObserver &); - MediaBufferObserver &operator=(const MediaBufferObserver &); -}; - -class MediaBuffer { -public: - // The underlying data remains the responsibility of the caller! - MediaBuffer(void *data, size_t size); - - MediaBuffer(size_t size); - - MediaBuffer(const sp& graphicBuffer); - - MediaBuffer(const sp &buffer); - - // Decrements the reference count and returns the buffer to its - // associated MediaBufferGroup if the reference count drops to 0. - void release(); - - // Increments the reference count. - void add_ref(); - - void *data() const; - size_t size() const; - - size_t range_offset() const; - size_t range_length() const; - - void set_range(size_t offset, size_t length); - - sp graphicBuffer() const; - - sp meta_data(); - - // Clears meta data and resets the range to the full extent. - void reset(); - - void setObserver(MediaBufferObserver *group); - - // Returns a clone of this MediaBuffer increasing its reference count. - // The clone references the same data but has its own range and - // MetaData. - MediaBuffer *clone(); - - int refcount() const; - -protected: - virtual ~MediaBuffer(); - -private: - friend class MediaBufferGroup; - friend class OMXDecoder; - - // For use by OMXDecoder, reference count must be 1, drop reference - // count to 0 without signalling the observer. - void claim(); - - MediaBufferObserver *mObserver; - MediaBuffer *mNextBuffer; - int mRefCount; - - void *mData; - size_t mSize, mRangeOffset, mRangeLength; - sp mGraphicBuffer; - sp mBuffer; - - bool mOwnsData; - - sp mMetaData; - - MediaBuffer *mOriginal; - - void setNextBuffer(MediaBuffer *buffer); - MediaBuffer *nextBuffer(); - - MediaBuffer(const MediaBuffer &); - MediaBuffer &operator=(const MediaBuffer &); -}; - -} // namespace android - -#endif // MEDIA_BUFFER_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/MediaBufferGroup.h b/external/android/include/19/frameworks/av/include/media/stagefright/MediaBufferGroup.h deleted file mode 100644 index 0488292..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/MediaBufferGroup.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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 MEDIA_BUFFER_GROUP_H_ - -#define MEDIA_BUFFER_GROUP_H_ - -#include -#include -#include - -namespace android { - -class MediaBuffer; -class MetaData; - -class MediaBufferGroup : public MediaBufferObserver { -public: - MediaBufferGroup(); - ~MediaBufferGroup(); - - void add_buffer(MediaBuffer *buffer); - - // Blocks until a buffer is available and returns it to the caller, - // the returned buffer will have a reference count of 1. - status_t acquire_buffer(MediaBuffer **buffer); - -protected: - virtual void signalBufferReturned(MediaBuffer *buffer); - -private: - friend class MediaBuffer; - - Mutex mLock; - Condition mCondition; - - MediaBuffer *mFirstBuffer, *mLastBuffer; - - MediaBufferGroup(const MediaBufferGroup &); - MediaBufferGroup &operator=(const MediaBufferGroup &); -}; - -} // namespace android - -#endif // MEDIA_BUFFER_GROUP_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/MediaCodec.h b/external/android/include/19/frameworks/av/include/media/stagefright/MediaCodec.h deleted file mode 100644 index 76aa503..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/MediaCodec.h +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Copyright 2012, 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 MEDIA_CODEC_H_ - -#define MEDIA_CODEC_H_ - -#include -#include -#include -#include - -namespace android { - -struct ABuffer; -struct ACodec; -struct AMessage; -struct AString; -struct ICrypto; -struct SoftwareRenderer; -struct Surface; - -struct MediaCodec : public AHandler { - enum ConfigureFlags { - CONFIGURE_FLAG_ENCODE = 1, - }; - - enum BufferFlags { - BUFFER_FLAG_SYNCFRAME = 1, - BUFFER_FLAG_CODECCONFIG = 2, - BUFFER_FLAG_EOS = 4, - }; - - static sp CreateByType( - const sp &looper, const char *mime, bool encoder); - - static sp CreateByComponentName( - const sp &looper, const char *name); - - status_t configure( - const sp &format, - const sp &nativeWindow, - const sp &crypto, - uint32_t flags); - - status_t createInputSurface(sp* bufferProducer); - - status_t start(); - - // Returns to a state in which the component remains allocated but - // unconfigured. - status_t stop(); - - // Client MUST call release before releasing final reference to this - // object. - status_t release(); - - status_t flush(); - - status_t queueInputBuffer( - size_t index, - size_t offset, - size_t size, - int64_t presentationTimeUs, - uint32_t flags, - AString *errorDetailMsg = NULL); - - status_t queueSecureInputBuffer( - size_t index, - size_t offset, - const CryptoPlugin::SubSample *subSamples, - size_t numSubSamples, - const uint8_t key[16], - const uint8_t iv[16], - CryptoPlugin::Mode mode, - int64_t presentationTimeUs, - uint32_t flags, - AString *errorDetailMsg = NULL); - - status_t dequeueInputBuffer(size_t *index, int64_t timeoutUs = 0ll); - - status_t dequeueOutputBuffer( - size_t *index, - size_t *offset, - size_t *size, - int64_t *presentationTimeUs, - uint32_t *flags, - int64_t timeoutUs = 0ll); - - status_t renderOutputBufferAndRelease(size_t index); - status_t releaseOutputBuffer(size_t index); - - status_t signalEndOfInputStream(); - - status_t getOutputFormat(sp *format) const; - - status_t getInputBuffers(Vector > *buffers) const; - status_t getOutputBuffers(Vector > *buffers) const; - - status_t requestIDRFrame(); - - // Notification will be posted once there "is something to do", i.e. - // an input/output buffer has become available, a format change is - // pending, an error is pending. - void requestActivityNotification(const sp ¬ify); - - status_t getName(AString *componentName) const; - - status_t setParameters(const sp ¶ms); - -protected: - virtual ~MediaCodec(); - virtual void onMessageReceived(const sp &msg); - -private: - enum State { - UNINITIALIZED, - INITIALIZING, - INITIALIZED, - CONFIGURING, - CONFIGURED, - STARTING, - STARTED, - FLUSHING, - STOPPING, - RELEASING, - }; - - enum { - kPortIndexInput = 0, - kPortIndexOutput = 1, - }; - - enum { - kWhatInit = 'init', - kWhatConfigure = 'conf', - kWhatCreateInputSurface = 'cisf', - kWhatStart = 'strt', - kWhatStop = 'stop', - kWhatRelease = 'rele', - kWhatDequeueInputBuffer = 'deqI', - kWhatQueueInputBuffer = 'queI', - kWhatDequeueOutputBuffer = 'deqO', - kWhatReleaseOutputBuffer = 'relO', - kWhatSignalEndOfInputStream = 'eois', - kWhatGetBuffers = 'getB', - kWhatFlush = 'flus', - kWhatGetOutputFormat = 'getO', - kWhatDequeueInputTimedOut = 'dITO', - kWhatDequeueOutputTimedOut = 'dOTO', - kWhatCodecNotify = 'codc', - kWhatRequestIDRFrame = 'ridr', - kWhatRequestActivityNotification = 'racN', - kWhatGetName = 'getN', - kWhatSetParameters = 'setP', - }; - - enum { - kFlagIsSoftwareCodec = 1, - kFlagOutputFormatChanged = 2, - kFlagOutputBuffersChanged = 4, - kFlagStickyError = 8, - kFlagDequeueInputPending = 16, - kFlagDequeueOutputPending = 32, - kFlagIsSecure = 64, - kFlagSawMediaServerDie = 128, - kFlagIsEncoder = 256, - kFlagGatherCodecSpecificData = 512, - }; - - struct BufferInfo { - void *mBufferID; - sp mData; - sp mEncryptedData; - sp mNotify; - bool mOwnedByClient; - }; - - State mState; - sp mLooper; - sp mCodecLooper; - sp mCodec; - AString mComponentName; - uint32_t mReplyID; - uint32_t mFlags; - sp mNativeWindow; - SoftwareRenderer *mSoftRenderer; - sp mOutputFormat; - - List mAvailPortBuffers[2]; - Vector mPortBuffers[2]; - - int32_t mDequeueInputTimeoutGeneration; - uint32_t mDequeueInputReplyID; - - int32_t mDequeueOutputTimeoutGeneration; - uint32_t mDequeueOutputReplyID; - - sp mCrypto; - - List > mCSD; - - sp mActivityNotify; - - bool mHaveInputSurface; - - MediaCodec(const sp &looper); - - static status_t PostAndAwaitResponse( - const sp &msg, sp *response); - - status_t init(const char *name, bool nameIsType, bool encoder); - - void setState(State newState); - void returnBuffersToCodec(); - void returnBuffersToCodecOnPort(int32_t portIndex); - size_t updateBuffers(int32_t portIndex, const sp &msg); - status_t onQueueInputBuffer(const sp &msg); - status_t onReleaseOutputBuffer(const sp &msg); - ssize_t dequeuePortBuffer(int32_t portIndex); - - bool handleDequeueInputBuffer(uint32_t replyID, bool newRequest = false); - bool handleDequeueOutputBuffer(uint32_t replyID, bool newRequest = false); - void cancelPendingDequeueOperations(); - - void extractCSD(const sp &format); - status_t queueCSDInputBuffer(size_t bufferIndex); - - status_t setNativeWindow( - const sp &surface); - - void postActivityNotificationIfPossible(); - - status_t onSetParameters(const sp ¶ms); - - status_t amendOutputFormatWithCodecSpecificData(const sp &buffer); - - DISALLOW_EVIL_CONSTRUCTORS(MediaCodec); -}; - -} // namespace android - -#endif // MEDIA_CODEC_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/MediaCodecList.h b/external/android/include/19/frameworks/av/include/media/stagefright/MediaCodecList.h deleted file mode 100644 index 590623b..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/MediaCodecList.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright 2012, 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 MEDIA_CODEC_LIST_H_ - -#define MEDIA_CODEC_LIST_H_ - -#include -#include - -#include -#include -#include -#include - -namespace android { - -struct MediaCodecList { - static const MediaCodecList *getInstance(); - - ssize_t findCodecByType( - const char *type, bool encoder, size_t startIndex = 0) const; - - ssize_t findCodecByName(const char *name) const; - - size_t countCodecs() const; - const char *getCodecName(size_t index) const; - bool isEncoder(size_t index) const; - bool codecHasQuirk(size_t index, const char *quirkName) const; - - status_t getSupportedTypes(size_t index, Vector *types) const; - - struct ProfileLevel { - uint32_t mProfile; - uint32_t mLevel; - }; - status_t getCodecCapabilities( - size_t index, const char *type, - Vector *profileLevels, - Vector *colorFormats, - uint32_t *flags) const; - -private: - enum Section { - SECTION_TOPLEVEL, - SECTION_DECODERS, - SECTION_DECODER, - SECTION_ENCODERS, - SECTION_ENCODER, - }; - - struct CodecInfo { - AString mName; - bool mIsEncoder; - uint32_t mTypes; - uint32_t mQuirks; - }; - - static MediaCodecList *sCodecList; - - status_t mInitCheck; - Section mCurrentSection; - int32_t mDepth; - - Vector mCodecInfos; - KeyedVector mCodecQuirks; - KeyedVector mTypes; - - MediaCodecList(); - ~MediaCodecList(); - - status_t initCheck() const; - void parseXMLFile(FILE *file); - - static void StartElementHandlerWrapper( - void *me, const char *name, const char **attrs); - - static void EndElementHandlerWrapper(void *me, const char *name); - - void startElementHandler(const char *name, const char **attrs); - void endElementHandler(const char *name); - - status_t addMediaCodecFromAttributes(bool encoder, const char **attrs); - void addMediaCodec(bool encoder, const char *name, const char *type = NULL); - - status_t addQuirk(const char **attrs); - status_t addTypeFromAttributes(const char **attrs); - void addType(const char *name); - - DISALLOW_EVIL_CONSTRUCTORS(MediaCodecList); -}; - -} // namespace android - -#endif // MEDIA_CODEC_LIST_H_ - diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/MediaDefs.h b/external/android/include/19/frameworks/av/include/media/stagefright/MediaDefs.h deleted file mode 100644 index 85693d4..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/MediaDefs.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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 MEDIA_DEFS_H_ - -#define MEDIA_DEFS_H_ - -namespace android { - -extern const char *MEDIA_MIMETYPE_IMAGE_JPEG; - -extern const char *MEDIA_MIMETYPE_VIDEO_VP8; -extern const char *MEDIA_MIMETYPE_VIDEO_VP9; -extern const char *MEDIA_MIMETYPE_VIDEO_AVC; -extern const char *MEDIA_MIMETYPE_VIDEO_MPEG4; -extern const char *MEDIA_MIMETYPE_VIDEO_H263; -extern const char *MEDIA_MIMETYPE_VIDEO_MPEG2; -extern const char *MEDIA_MIMETYPE_VIDEO_RAW; - -extern const char *MEDIA_MIMETYPE_AUDIO_AMR_NB; -extern const char *MEDIA_MIMETYPE_AUDIO_AMR_WB; -extern const char *MEDIA_MIMETYPE_AUDIO_MPEG; // layer III -extern const char *MEDIA_MIMETYPE_AUDIO_MPEG_LAYER_I; -extern const char *MEDIA_MIMETYPE_AUDIO_MPEG_LAYER_II; -extern const char *MEDIA_MIMETYPE_AUDIO_AAC; -extern const char *MEDIA_MIMETYPE_AUDIO_QCELP; -extern const char *MEDIA_MIMETYPE_AUDIO_VORBIS; -extern const char *MEDIA_MIMETYPE_AUDIO_G711_ALAW; -extern const char *MEDIA_MIMETYPE_AUDIO_G711_MLAW; -extern const char *MEDIA_MIMETYPE_AUDIO_RAW; -extern const char *MEDIA_MIMETYPE_AUDIO_FLAC; -extern const char *MEDIA_MIMETYPE_AUDIO_AAC_ADTS; -extern const char *MEDIA_MIMETYPE_AUDIO_MSGSM; - -extern const char *MEDIA_MIMETYPE_CONTAINER_MPEG4; -extern const char *MEDIA_MIMETYPE_CONTAINER_WAV; -extern const char *MEDIA_MIMETYPE_CONTAINER_OGG; -extern const char *MEDIA_MIMETYPE_CONTAINER_MATROSKA; -extern const char *MEDIA_MIMETYPE_CONTAINER_MPEG2TS; -extern const char *MEDIA_MIMETYPE_CONTAINER_AVI; -extern const char *MEDIA_MIMETYPE_CONTAINER_MPEG2PS; - -extern const char *MEDIA_MIMETYPE_CONTAINER_WVM; - -extern const char *MEDIA_MIMETYPE_TEXT_3GPP; -extern const char *MEDIA_MIMETYPE_TEXT_SUBRIP; - -} // namespace android - -#endif // MEDIA_DEFS_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/MediaErrors.h b/external/android/include/19/frameworks/av/include/media/stagefright/MediaErrors.h deleted file mode 100644 index 686f286..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/MediaErrors.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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 MEDIA_ERRORS_H_ - -#define MEDIA_ERRORS_H_ - -#include - -namespace android { - -enum { - MEDIA_ERROR_BASE = -1000, - - ERROR_ALREADY_CONNECTED = MEDIA_ERROR_BASE, - ERROR_NOT_CONNECTED = MEDIA_ERROR_BASE - 1, - ERROR_UNKNOWN_HOST = MEDIA_ERROR_BASE - 2, - ERROR_CANNOT_CONNECT = MEDIA_ERROR_BASE - 3, - ERROR_IO = MEDIA_ERROR_BASE - 4, - ERROR_CONNECTION_LOST = MEDIA_ERROR_BASE - 5, - ERROR_MALFORMED = MEDIA_ERROR_BASE - 7, - ERROR_OUT_OF_RANGE = MEDIA_ERROR_BASE - 8, - ERROR_BUFFER_TOO_SMALL = MEDIA_ERROR_BASE - 9, - ERROR_UNSUPPORTED = MEDIA_ERROR_BASE - 10, - ERROR_END_OF_STREAM = MEDIA_ERROR_BASE - 11, - - // Not technically an error. - INFO_FORMAT_CHANGED = MEDIA_ERROR_BASE - 12, - INFO_DISCONTINUITY = MEDIA_ERROR_BASE - 13, - INFO_OUTPUT_BUFFERS_CHANGED = MEDIA_ERROR_BASE - 14, - - // The following constant values should be in sync with - // drm/drm_framework_common.h - DRM_ERROR_BASE = -2000, - - ERROR_DRM_UNKNOWN = DRM_ERROR_BASE, - ERROR_DRM_NO_LICENSE = DRM_ERROR_BASE - 1, - ERROR_DRM_LICENSE_EXPIRED = DRM_ERROR_BASE - 2, - ERROR_DRM_SESSION_NOT_OPENED = DRM_ERROR_BASE - 3, - ERROR_DRM_DECRYPT_UNIT_NOT_INITIALIZED = DRM_ERROR_BASE - 4, - ERROR_DRM_DECRYPT = DRM_ERROR_BASE - 5, - ERROR_DRM_CANNOT_HANDLE = DRM_ERROR_BASE - 6, - ERROR_DRM_TAMPER_DETECTED = DRM_ERROR_BASE - 7, - ERROR_DRM_NOT_PROVISIONED = DRM_ERROR_BASE - 8, - ERROR_DRM_DEVICE_REVOKED = DRM_ERROR_BASE - 9, - ERROR_DRM_RESOURCE_BUSY = DRM_ERROR_BASE - 10, - - ERROR_DRM_VENDOR_MAX = DRM_ERROR_BASE - 500, - ERROR_DRM_VENDOR_MIN = DRM_ERROR_BASE - 999, - - // Heartbeat Error Codes - HEARTBEAT_ERROR_BASE = -3000, - ERROR_HEARTBEAT_TERMINATE_REQUESTED = HEARTBEAT_ERROR_BASE, -}; - -} // namespace android - -#endif // MEDIA_ERRORS_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/MediaExtractor.h b/external/android/include/19/frameworks/av/include/media/stagefright/MediaExtractor.h deleted file mode 100644 index 3076a96..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/MediaExtractor.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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 MEDIA_EXTRACTOR_H_ - -#define MEDIA_EXTRACTOR_H_ - -#include - -namespace android { - -class DataSource; -class MediaSource; -class MetaData; - -class MediaExtractor : public RefBase { -public: - static sp Create( - const sp &source, const char *mime = NULL); - - virtual size_t countTracks() = 0; - virtual sp getTrack(size_t index) = 0; - - enum GetTrackMetaDataFlags { - kIncludeExtensiveMetaData = 1 - }; - virtual sp getTrackMetaData( - size_t index, uint32_t flags = 0) = 0; - - // Return container specific meta-data. The default implementation - // returns an empty metadata object. - virtual sp getMetaData(); - - enum Flags { - CAN_SEEK_BACKWARD = 1, // the "seek 10secs back button" - CAN_SEEK_FORWARD = 2, // the "seek 10secs forward button" - CAN_PAUSE = 4, - CAN_SEEK = 8, // the "seek bar" - }; - - // If subclasses do _not_ override this, the default is - // CAN_SEEK_BACKWARD | CAN_SEEK_FORWARD | CAN_SEEK | CAN_PAUSE - virtual uint32_t flags() const; - - // for DRM - void setDrmFlag(bool flag) { - mIsDrm = flag; - }; - bool getDrmFlag() { - return mIsDrm; - } - virtual char* getDrmTrackInfo(size_t trackID, int *len) { - return NULL; - } - -protected: - MediaExtractor() : mIsDrm(false) {} - virtual ~MediaExtractor() {} - -private: - bool mIsDrm; - - MediaExtractor(const MediaExtractor &); - MediaExtractor &operator=(const MediaExtractor &); -}; - -} // namespace android - -#endif // MEDIA_EXTRACTOR_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/MediaMuxer.h b/external/android/include/19/frameworks/av/include/media/stagefright/MediaMuxer.h deleted file mode 100644 index ff6a66e..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/MediaMuxer.h +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright 2013, 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 MEDIA_MUXER_H_ -#define MEDIA_MUXER_H_ - -#include -#include -#include -#include - -namespace android { - -struct ABuffer; -struct AMessage; -struct MediaAdapter; -struct MediaBuffer; -struct MediaSource; -struct MetaData; -struct MPEG4Writer; - -// MediaMuxer is used to mux multiple tracks into a video. Currently, we only -// support a mp4 file as the output. -// The expected calling order of the functions is: -// Constructor -> addTrack+ -> start -> writeSampleData+ -> stop -// If muxing operation need to be cancelled, the app is responsible for -// deleting the output file after stop. -struct MediaMuxer : public RefBase { -public: - // Please update media/java/android/media/MediaMuxer.java if the - // OutputFormat is updated. - enum OutputFormat { - OUTPUT_FORMAT_MPEG_4 = 0, - OUTPUT_FORMAT_LIST_END // must be last - used to validate format type - }; - - // Construct the muxer with the output file path. - MediaMuxer(const char *path, OutputFormat format); - - // Construct the muxer with the file descriptor. Note that the MediaMuxer - // will close this file at stop(). - MediaMuxer(int fd, OutputFormat format); - - virtual ~MediaMuxer(); - - /** - * Add a track with its format information. This should be - * called before start(). - * @param format the track's format. - * @return the track's index or negative number if error. - */ - ssize_t addTrack(const sp &format); - - /** - * Start muxing. Make sure all the tracks have been added before - * calling this. - */ - status_t start(); - - /** - * Set the orientation hint. - * @param degrees The rotation degrees. It has to be either 0, - * 90, 180 or 270. - * @return OK if no error. - */ - status_t setOrientationHint(int degrees); - - /** - * Set the location. - * @param latitude The latitude in degree x 1000. Its value must be in the range - * [-900000, 900000]. - * @param longitude The longitude in degree x 1000. Its value must be in the range - * [-1800000, 1800000]. - * @return OK if no error. - */ - status_t setLocation(int latitude, int longitude); - - /** - * Stop muxing. - * This method is a blocking call. Depending on how - * much data is bufferred internally, the time needed for stopping - * the muxer may be time consuming. UI thread is - * not recommended for launching this call. - * @return OK if no error. - */ - status_t stop(); - - /** - * Send a sample buffer for muxing. - * The buffer can be reused once this method returns. Typically, - * this function won't be blocked for very long, and thus there - * is no need to use a separate thread calling this method to - * push a buffer. - * @param buffer the incoming sample buffer. - * @param trackIndex the buffer's track index number. - * @param timeUs the buffer's time stamp. - * @param flags the only supported flag for now is - * MediaCodec::BUFFER_FLAG_SYNCFRAME. - * @return OK if no error. - */ - status_t writeSampleData(const sp &buffer, size_t trackIndex, - int64_t timeUs, uint32_t flags) ; - -private: - sp mWriter; - Vector< sp > mTrackList; // Each track has its MediaAdapter. - sp mFileMeta; // Metadata for the whole file. - - Mutex mMuxerLock; - - enum State { - UNINITIALIZED, - INITIALIZED, - STARTED, - STOPPED - }; - State mState; - - DISALLOW_EVIL_CONSTRUCTORS(MediaMuxer); -}; - -} // namespace android - -#endif // MEDIA_MUXER_H_ - diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/MediaSource.h b/external/android/include/19/frameworks/av/include/media/stagefright/MediaSource.h deleted file mode 100644 index 3818e63..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/MediaSource.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - * 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 MEDIA_SOURCE_H_ - -#define MEDIA_SOURCE_H_ - -#include - -#include -#include -#include - -namespace android { - -class MediaBuffer; -class MetaData; - -struct MediaSource : public virtual RefBase { - MediaSource(); - - // To be called before any other methods on this object, except - // getFormat(). - virtual status_t start(MetaData *params = NULL) = 0; - - // Any blocking read call returns immediately with a result of NO_INIT. - // It is an error to call any methods other than start after this call - // returns. Any buffers the object may be holding onto at the time of - // the stop() call are released. - // Also, it is imperative that any buffers output by this object and - // held onto by callers be released before a call to stop() !!! - virtual status_t stop() = 0; - - // Returns the format of the data output by this media source. - virtual sp getFormat() = 0; - - struct ReadOptions; - - // Returns a new buffer of data. Call blocks until a - // buffer is available, an error is encountered of the end of the stream - // is reached. - // End of stream is signalled by a result of ERROR_END_OF_STREAM. - // A result of INFO_FORMAT_CHANGED indicates that the format of this - // MediaSource has changed mid-stream, the client can continue reading - // but should be prepared for buffers of the new configuration. - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL) = 0; - - // Options that modify read() behaviour. The default is to - // a) not request a seek - // b) not be late, i.e. lateness_us = 0 - struct ReadOptions { - enum SeekMode { - SEEK_PREVIOUS_SYNC, - SEEK_NEXT_SYNC, - SEEK_CLOSEST_SYNC, - SEEK_CLOSEST, - }; - - ReadOptions(); - - // Reset everything back to defaults. - void reset(); - - void setSeekTo(int64_t time_us, SeekMode mode = SEEK_CLOSEST_SYNC); - void clearSeekTo(); - bool getSeekTo(int64_t *time_us, SeekMode *mode) const; - - void setLateBy(int64_t lateness_us); - int64_t getLateBy() const; - - private: - enum Options { - kSeekTo_Option = 1, - }; - - uint32_t mOptions; - int64_t mSeekTimeUs; - SeekMode mSeekMode; - int64_t mLatenessUs; - }; - - // Causes this source to suspend pulling data from its upstream source - // until a subsequent read-with-seek. Currently only supported by - // OMXCodec. - virtual status_t pause() { - return ERROR_UNSUPPORTED; - } - - // The consumer of this media source requests that the given buffers - // are to be returned exclusively in response to read calls. - // This will be called after a successful start() and before the - // first read() call. - // Callee assumes ownership of the buffers if no error is returned. - virtual status_t setBuffers(const Vector &buffers) { - return ERROR_UNSUPPORTED; - } - -protected: - virtual ~MediaSource(); - -private: - MediaSource(const MediaSource &); - MediaSource &operator=(const MediaSource &); -}; - -} // namespace android - -#endif // MEDIA_SOURCE_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/MediaWriter.h b/external/android/include/19/frameworks/av/include/media/stagefright/MediaWriter.h deleted file mode 100644 index 5cc8dcf..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/MediaWriter.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2010 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 MEDIA_WRITER_H_ - -#define MEDIA_WRITER_H_ - -#include -#include - -namespace android { - -struct MediaSource; -struct MetaData; - -struct MediaWriter : public RefBase { - MediaWriter() - : mMaxFileSizeLimitBytes(0), - mMaxFileDurationLimitUs(0) { - } - - virtual status_t addSource(const sp &source) = 0; - virtual bool reachedEOS() = 0; - virtual status_t start(MetaData *params = NULL) = 0; - virtual status_t stop() = 0; - virtual status_t pause() = 0; - - virtual void setMaxFileSize(int64_t bytes) { mMaxFileSizeLimitBytes = bytes; } - virtual void setMaxFileDuration(int64_t durationUs) { mMaxFileDurationLimitUs = durationUs; } - virtual void setListener(const sp& listener) { - mListener = listener; - } - - virtual status_t dump(int fd, const Vector& args) { - return OK; - } - -protected: - virtual ~MediaWriter() {} - int64_t mMaxFileSizeLimitBytes; - int64_t mMaxFileDurationLimitUs; - sp mListener; - - void notify(int msg, int ext1, int ext2) { - if (mListener != NULL) { - mListener->notify(msg, ext1, ext2); - } - } -private: - MediaWriter(const MediaWriter &); - MediaWriter &operator=(const MediaWriter &); -}; - -} // namespace android - -#endif // MEDIA_WRITER_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/MetaData.h b/external/android/include/19/frameworks/av/include/media/stagefright/MetaData.h deleted file mode 100644 index de3fc36..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/MetaData.h +++ /dev/null @@ -1,271 +0,0 @@ -/* - * 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 META_DATA_H_ - -#define META_DATA_H_ - -#include - -#include - -#include -#include -#include - -namespace android { - -// The following keys map to int32_t data unless indicated otherwise. -enum { - kKeyMIMEType = 'mime', // cstring - kKeyWidth = 'widt', // int32_t, image pixel - kKeyHeight = 'heig', // int32_t, image pixel - kKeyDisplayWidth = 'dWid', // int32_t, display/presentation - kKeyDisplayHeight = 'dHgt', // int32_t, display/presentation - kKeySARWidth = 'sarW', // int32_t, sampleAspectRatio width - kKeySARHeight = 'sarH', // int32_t, sampleAspectRatio height - - // a rectangle, if absent assumed to be (0, 0, width - 1, height - 1) - kKeyCropRect = 'crop', - - kKeyRotation = 'rotA', // int32_t (angle in degrees) - kKeyIFramesInterval = 'ifiv', // int32_t - kKeyStride = 'strd', // int32_t - kKeySliceHeight = 'slht', // int32_t - kKeyChannelCount = '#chn', // int32_t - kKeyChannelMask = 'chnm', // int32_t - kKeySampleRate = 'srte', // int32_t (audio sampling rate Hz) - kKeyFrameRate = 'frmR', // int32_t (video frame rate fps) - kKeyBitRate = 'brte', // int32_t (bps) - kKeyESDS = 'esds', // raw data - kKeyAACProfile = 'aacp', // int32_t - kKeyAVCC = 'avcc', // raw data - kKeyD263 = 'd263', // raw data - kKeyVorbisInfo = 'vinf', // raw data - kKeyVorbisBooks = 'vboo', // raw data - kKeyWantsNALFragments = 'NALf', - kKeyIsSyncFrame = 'sync', // int32_t (bool) - kKeyIsCodecConfig = 'conf', // int32_t (bool) - kKeyTime = 'time', // int64_t (usecs) - kKeyDecodingTime = 'decT', // int64_t (decoding timestamp in usecs) - kKeyNTPTime = 'ntpT', // uint64_t (ntp-timestamp) - kKeyTargetTime = 'tarT', // int64_t (usecs) - kKeyDriftTime = 'dftT', // int64_t (usecs) - kKeyAnchorTime = 'ancT', // int64_t (usecs) - kKeyDuration = 'dura', // int64_t (usecs) - kKeyColorFormat = 'colf', - kKeyPlatformPrivate = 'priv', // pointer - kKeyDecoderComponent = 'decC', // cstring - kKeyBufferID = 'bfID', - kKeyMaxInputSize = 'inpS', - kKeyThumbnailTime = 'thbT', // int64_t (usecs) - kKeyTrackID = 'trID', - kKeyIsDRM = 'idrm', // int32_t (bool) - kKeyEncoderDelay = 'encd', // int32_t (frames) - kKeyEncoderPadding = 'encp', // int32_t (frames) - - kKeyAlbum = 'albu', // cstring - kKeyArtist = 'arti', // cstring - kKeyAlbumArtist = 'aart', // cstring - kKeyComposer = 'comp', // cstring - kKeyGenre = 'genr', // cstring - kKeyTitle = 'titl', // cstring - kKeyYear = 'year', // cstring - kKeyAlbumArt = 'albA', // compressed image data - kKeyAlbumArtMIME = 'alAM', // cstring - kKeyAuthor = 'auth', // cstring - kKeyCDTrackNumber = 'cdtr', // cstring - kKeyDiscNumber = 'dnum', // cstring - kKeyDate = 'date', // cstring - kKeyWriter = 'writ', // cstring - kKeyCompilation = 'cpil', // cstring - kKeyLocation = 'loc ', // cstring - kKeyTimeScale = 'tmsl', // int32_t - - // video profile and level - kKeyVideoProfile = 'vprf', // int32_t - kKeyVideoLevel = 'vlev', // int32_t - - // Set this key to enable authoring files in 64-bit offset - kKey64BitFileOffset = 'fobt', // int32_t (bool) - kKey2ByteNalLength = '2NAL', // int32_t (bool) - - // Identify the file output format for authoring - // Please see for the supported - // file output formats. - kKeyFileType = 'ftyp', // int32_t - - // Track authoring progress status - // kKeyTrackTimeStatus is used to track progress in elapsed time - kKeyTrackTimeStatus = 'tktm', // int64_t - - kKeyRealTimeRecording = 'rtrc', // bool (int32_t) - kKeyNumBuffers = 'nbbf', // int32_t - - // Ogg files can be tagged to be automatically looping... - kKeyAutoLoop = 'autL', // bool (int32_t) - - kKeyValidSamples = 'valD', // int32_t - - kKeyIsUnreadable = 'unre', // bool (int32_t) - - // An indication that a video buffer has been rendered. - kKeyRendered = 'rend', // bool (int32_t) - - // The language code for this media - kKeyMediaLanguage = 'lang', // cstring - - // To store the timed text format data - kKeyTextFormatData = 'text', // raw data - - kKeyRequiresSecureBuffers = 'secu', // bool (int32_t) - - kKeyIsADTS = 'adts', // bool (int32_t) - - // If a MediaBuffer's data represents (at least partially) encrypted - // data, the following fields aid in decryption. - // The data can be thought of as pairs of plain and encrypted data - // fragments, i.e. plain and encrypted data alternate. - // The first fragment is by convention plain data (if that's not the - // case, simply specify plain fragment size of 0). - // kKeyEncryptedSizes and kKeyPlainSizes each map to an array of - // size_t values. The sum total of all size_t values of both arrays - // must equal the amount of data (i.e. MediaBuffer's range_length()). - // If both arrays are present, they must be of the same size. - // If only encrypted sizes are present it is assumed that all - // plain sizes are 0, i.e. all fragments are encrypted. - // To programmatically set these array, use the MetaData::setData API, i.e. - // const size_t encSizes[]; - // meta->setData( - // kKeyEncryptedSizes, 0 /* type */, encSizes, sizeof(encSizes)); - // A plain sizes array by itself makes no sense. - kKeyEncryptedSizes = 'encr', // size_t[] - kKeyPlainSizes = 'plai', // size_t[] - kKeyCryptoKey = 'cryK', // uint8_t[16] - kKeyCryptoIV = 'cryI', // uint8_t[16] - kKeyCryptoMode = 'cryM', // int32_t - - kKeyCryptoDefaultIVSize = 'cryS', // int32_t - - kKeyPssh = 'pssh', // raw data -}; - -enum { - kTypeESDS = 'esds', - kTypeAVCC = 'avcc', - kTypeD263 = 'd263', -}; - -class MetaData : public RefBase { -public: - MetaData(); - MetaData(const MetaData &from); - - enum Type { - TYPE_NONE = 'none', - TYPE_C_STRING = 'cstr', - TYPE_INT32 = 'in32', - TYPE_INT64 = 'in64', - TYPE_FLOAT = 'floa', - TYPE_POINTER = 'ptr ', - TYPE_RECT = 'rect', - }; - - void clear(); - bool remove(uint32_t key); - - bool setCString(uint32_t key, const char *value); - bool setInt32(uint32_t key, int32_t value); - bool setInt64(uint32_t key, int64_t value); - bool setFloat(uint32_t key, float value); - bool setPointer(uint32_t key, void *value); - - bool setRect( - uint32_t key, - int32_t left, int32_t top, - int32_t right, int32_t bottom); - - bool findCString(uint32_t key, const char **value); - bool findInt32(uint32_t key, int32_t *value); - bool findInt64(uint32_t key, int64_t *value); - bool findFloat(uint32_t key, float *value); - bool findPointer(uint32_t key, void **value); - - bool findRect( - uint32_t key, - int32_t *left, int32_t *top, - int32_t *right, int32_t *bottom); - - bool setData(uint32_t key, uint32_t type, const void *data, size_t size); - - bool findData(uint32_t key, uint32_t *type, - const void **data, size_t *size) const; - - void dumpToLog() const; - -protected: - virtual ~MetaData(); - -private: - struct typed_data { - typed_data(); - ~typed_data(); - - typed_data(const MetaData::typed_data &); - typed_data &operator=(const MetaData::typed_data &); - - void clear(); - void setData(uint32_t type, const void *data, size_t size); - void getData(uint32_t *type, const void **data, size_t *size) const; - String8 asString() const; - - private: - uint32_t mType; - size_t mSize; - - union { - void *ext_data; - float reservoir; - } u; - - bool usesReservoir() const { - return mSize <= sizeof(u.reservoir); - } - - void allocateStorage(size_t size); - void freeStorage(); - - void *storage() { - return usesReservoir() ? &u.reservoir : u.ext_data; - } - - const void *storage() const { - return usesReservoir() ? &u.reservoir : u.ext_data; - } - }; - - struct Rect { - int32_t mLeft, mTop, mRight, mBottom; - }; - - KeyedVector mItems; - - // MetaData &operator=(const MetaData &); -}; - -} // namespace android - -#endif // META_DATA_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/NativeWindowWrapper.h b/external/android/include/19/frameworks/av/include/media/stagefright/NativeWindowWrapper.h deleted file mode 100644 index cfeec22..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/NativeWindowWrapper.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2011 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 NATIVE_WINDOW_WRAPPER_H_ - -#define NATIVE_WINDOW_WRAPPER_H_ - -#include - -namespace android { - -// Surface derives from ANativeWindow which derives from multiple -// base classes, in order to carry it in AMessages, we'll temporarily wrap it -// into a NativeWindowWrapper. - -struct NativeWindowWrapper : RefBase { - NativeWindowWrapper( - const sp &surfaceTextureClient) : - mSurfaceTextureClient(surfaceTextureClient) { } - - sp getNativeWindow() const { - return mSurfaceTextureClient; - } - - sp getSurfaceTextureClient() const { - return mSurfaceTextureClient; - } - -private: - const sp mSurfaceTextureClient; - - DISALLOW_EVIL_CONSTRUCTORS(NativeWindowWrapper); -}; - -} // namespace android - -#endif // NATIVE_WINDOW_WRAPPER_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/NuMediaExtractor.h b/external/android/include/19/frameworks/av/include/media/stagefright/NuMediaExtractor.h deleted file mode 100644 index 5ae6f6b..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/NuMediaExtractor.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright 2012, 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 NU_MEDIA_EXTRACTOR_H_ -#define NU_MEDIA_EXTRACTOR_H_ - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace android { - -struct ABuffer; -struct AMessage; -struct DataSource; -struct MediaBuffer; -struct MediaExtractor; -struct MediaSource; -struct MetaData; - -struct NuMediaExtractor : public RefBase { - enum SampleFlags { - SAMPLE_FLAG_SYNC = 1, - SAMPLE_FLAG_ENCRYPTED = 2, - }; - - NuMediaExtractor(); - - status_t setDataSource( - const char *path, - const KeyedVector *headers = NULL); - - status_t setDataSource(int fd, off64_t offset, off64_t size); - - status_t setDataSource(const sp &datasource); - - size_t countTracks() const; - status_t getTrackFormat(size_t index, sp *format) const; - - status_t getFileFormat(sp *format) const; - - status_t selectTrack(size_t index); - status_t unselectTrack(size_t index); - - status_t seekTo( - int64_t timeUs, - MediaSource::ReadOptions::SeekMode mode = - MediaSource::ReadOptions::SEEK_CLOSEST_SYNC); - - status_t advance(); - status_t readSampleData(const sp &buffer); - status_t getSampleTrackIndex(size_t *trackIndex); - status_t getSampleTime(int64_t *sampleTimeUs); - status_t getSampleMeta(sp *sampleMeta); - - bool getCachedDuration(int64_t *durationUs, bool *eos) const; - -protected: - virtual ~NuMediaExtractor(); - -private: - enum TrackFlags { - kIsVorbis = 1, - }; - - struct TrackInfo { - sp mSource; - size_t mTrackIndex; - status_t mFinalResult; - MediaBuffer *mSample; - int64_t mSampleTimeUs; - - uint32_t mTrackFlags; // bitmask of "TrackFlags" - }; - - mutable Mutex mLock; - - sp mDataSource; - - sp mImpl; - bool mIsWidevineExtractor; - - Vector mSelectedTracks; - int64_t mTotalBitrate; // in bits/sec - int64_t mDurationUs; - - ssize_t fetchTrackSamples( - int64_t seekTimeUs = -1ll, - MediaSource::ReadOptions::SeekMode mode = - MediaSource::ReadOptions::SEEK_CLOSEST_SYNC); - - void releaseTrackSamples(); - - bool getTotalBitrate(int64_t *bitRate) const; - void updateDurationAndBitrate(); - - DISALLOW_EVIL_CONSTRUCTORS(NuMediaExtractor); -}; - -} // namespace android - -#endif // NU_MEDIA_EXTRACTOR_H_ - diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/OMXClient.h b/external/android/include/19/frameworks/av/include/media/stagefright/OMXClient.h deleted file mode 100644 index 2f14d06..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/OMXClient.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 OMX_CLIENT_H_ - -#define OMX_CLIENT_H_ - -#include - -namespace android { - -class OMXClient { -public: - OMXClient(); - - status_t connect(); - void disconnect(); - - sp interface() { - return mOMX; - } - -private: - sp mOMX; - - OMXClient(const OMXClient &); - OMXClient &operator=(const OMXClient &); -}; - -} // namespace android - -#endif // OMX_CLIENT_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/OMXCodec.h b/external/android/include/19/frameworks/av/include/media/stagefright/OMXCodec.h deleted file mode 100644 index daaf20f..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/OMXCodec.h +++ /dev/null @@ -1,407 +0,0 @@ -/* - * 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 OMX_CODEC_H_ - -#define OMX_CODEC_H_ - -#include -#include -#include -#include -#include - -#include - -namespace android { - -struct MediaCodecList; -class MemoryDealer; -struct OMXCodecObserver; -struct CodecProfileLevel; -class SkipCutBuffer; - -struct OMXCodec : public MediaSource, - public MediaBufferObserver { - enum CreationFlags { - kPreferSoftwareCodecs = 1, - kIgnoreCodecSpecificData = 2, - - // The client wants to access the output buffer's video - // data for example for thumbnail extraction. - kClientNeedsFramebuffer = 4, - - // Request for software or hardware codecs. If request - // can not be fullfilled, Create() returns NULL. - kSoftwareCodecsOnly = 8, - kHardwareCodecsOnly = 16, - - // Store meta data in video buffers - kStoreMetaDataInVideoBuffers = 32, - - // Only submit one input buffer at one time. - kOnlySubmitOneInputBufferAtOneTime = 64, - - // Enable GRALLOC_USAGE_PROTECTED for output buffers from native window - kEnableGrallocUsageProtected = 128, - - // Secure decoding mode - kUseSecureInputBuffers = 256, - }; - static sp Create( - const sp &omx, - const sp &meta, bool createEncoder, - const sp &source, - const char *matchComponentName = NULL, - uint32_t flags = 0, - const sp &nativeWindow = NULL); - - static void setComponentRole( - const sp &omx, IOMX::node_id node, bool isEncoder, - const char *mime); - - virtual status_t start(MetaData *params = NULL); - virtual status_t stop(); - - virtual sp getFormat(); - - virtual status_t read( - MediaBuffer **buffer, const ReadOptions *options = NULL); - - virtual status_t pause(); - - // from MediaBufferObserver - virtual void signalBufferReturned(MediaBuffer *buffer); - - enum Quirks { - kNeedsFlushBeforeDisable = 1, - kWantsNALFragments = 2, - kRequiresLoadedToIdleAfterAllocation = 4, - kRequiresAllocateBufferOnInputPorts = 8, - kRequiresFlushCompleteEmulation = 16, - kRequiresAllocateBufferOnOutputPorts = 32, - kRequiresFlushBeforeShutdown = 64, - kDefersOutputBufferAllocation = 128, - kDecoderLiesAboutNumberOfChannels = 256, - kInputBufferSizesAreBogus = 512, - kSupportsMultipleFramesPerInputBuffer = 1024, - kRequiresLargerEncoderOutputBuffer = 2048, - kOutputBuffersAreUnreadable = 4096, - }; - - struct CodecNameAndQuirks { - String8 mName; - uint32_t mQuirks; - }; - - // for use by ACodec - static void findMatchingCodecs( - const char *mime, - bool createEncoder, const char *matchComponentName, - uint32_t flags, - Vector *matchingCodecNamesAndQuirks); - - static uint32_t getComponentQuirks( - const MediaCodecList *list, size_t index); - - static bool findCodecQuirks(const char *componentName, uint32_t *quirks); - -protected: - virtual ~OMXCodec(); - -private: - - // Make sure mLock is accessible to OMXCodecObserver - friend class OMXCodecObserver; - - // Call this with mLock hold - void on_message(const omx_message &msg); - - enum State { - DEAD, - LOADED, - LOADED_TO_IDLE, - IDLE_TO_EXECUTING, - EXECUTING, - EXECUTING_TO_IDLE, - IDLE_TO_LOADED, - RECONFIGURING, - ERROR - }; - - enum { - kPortIndexInput = 0, - kPortIndexOutput = 1 - }; - - enum PortStatus { - ENABLED, - DISABLING, - DISABLED, - ENABLING, - SHUTTING_DOWN, - }; - - enum BufferStatus { - OWNED_BY_US, - OWNED_BY_COMPONENT, - OWNED_BY_NATIVE_WINDOW, - OWNED_BY_CLIENT, - }; - - struct BufferInfo { - IOMX::buffer_id mBuffer; - BufferStatus mStatus; - sp mMem; - size_t mSize; - void *mData; - MediaBuffer *mMediaBuffer; - }; - - struct CodecSpecificData { - size_t mSize; - uint8_t mData[1]; - }; - - sp mOMX; - bool mOMXLivesLocally; - IOMX::node_id mNode; - uint32_t mQuirks; - - // Flags specified in the creation of the codec. - uint32_t mFlags; - - bool mIsEncoder; - bool mIsVideo; - char *mMIME; - char *mComponentName; - sp mOutputFormat; - sp mSource; - Vector mCodecSpecificData; - size_t mCodecSpecificDataIndex; - - sp mDealer[2]; - - State mState; - Vector mPortBuffers[2]; - PortStatus mPortStatus[2]; - bool mInitialBufferSubmit; - bool mSignalledEOS; - status_t mFinalStatus; - bool mNoMoreOutputData; - bool mOutputPortSettingsHaveChanged; - int64_t mSeekTimeUs; - ReadOptions::SeekMode mSeekMode; - int64_t mTargetTimeUs; - bool mOutputPortSettingsChangedPending; - sp mSkipCutBuffer; - - MediaBuffer *mLeftOverBuffer; - - Mutex mLock; - Condition mAsyncCompletion; - - bool mPaused; - - sp mNativeWindow; - - // The index in each of the mPortBuffers arrays of the buffer that will be - // submitted to OMX next. This only applies when using buffers from a - // native window. - size_t mNextNativeBufferIndex[2]; - - // A list of indices into mPortStatus[kPortIndexOutput] filled with data. - List mFilledBuffers; - Condition mBufferFilled; - - // Used to record the decoding time for an output picture from - // a video encoder. - List mDecodingTimeList; - - OMXCodec(const sp &omx, IOMX::node_id node, - uint32_t quirks, uint32_t flags, - bool isEncoder, const char *mime, const char *componentName, - const sp &source, - const sp &nativeWindow); - - void addCodecSpecificData(const void *data, size_t size); - void clearCodecSpecificData(); - - void setComponentRole(); - - void setAMRFormat(bool isWAMR, int32_t bitRate); - - status_t setAACFormat( - int32_t numChannels, int32_t sampleRate, int32_t bitRate, - int32_t aacProfile, bool isADTS); - - void setG711Format(int32_t numChannels); - - status_t setVideoPortFormatType( - OMX_U32 portIndex, - OMX_VIDEO_CODINGTYPE compressionFormat, - OMX_COLOR_FORMATTYPE colorFormat); - - void setVideoInputFormat( - const char *mime, const sp& meta); - - status_t setupBitRate(int32_t bitRate); - status_t setupErrorCorrectionParameters(); - status_t setupH263EncoderParameters(const sp& meta); - status_t setupMPEG4EncoderParameters(const sp& meta); - status_t setupAVCEncoderParameters(const sp& meta); - status_t findTargetColorFormat( - const sp& meta, OMX_COLOR_FORMATTYPE *colorFormat); - - status_t isColorFormatSupported( - OMX_COLOR_FORMATTYPE colorFormat, int portIndex); - - // If profile/level is set in the meta data, its value in the meta - // data will be used; otherwise, the default value will be used. - status_t getVideoProfileLevel(const sp& meta, - const CodecProfileLevel& defaultProfileLevel, - CodecProfileLevel& profileLevel); - - status_t setVideoOutputFormat( - const char *mime, const sp& meta); - - void setImageOutputFormat( - OMX_COLOR_FORMATTYPE format, OMX_U32 width, OMX_U32 height); - - void setJPEGInputFormat( - OMX_U32 width, OMX_U32 height, OMX_U32 compressedSize); - - void setMinBufferSize(OMX_U32 portIndex, OMX_U32 size); - - void setRawAudioFormat( - OMX_U32 portIndex, int32_t sampleRate, int32_t numChannels); - - status_t allocateBuffers(); - status_t allocateBuffersOnPort(OMX_U32 portIndex); - status_t allocateOutputBuffersFromNativeWindow(); - - status_t queueBufferToNativeWindow(BufferInfo *info); - status_t cancelBufferToNativeWindow(BufferInfo *info); - BufferInfo* dequeueBufferFromNativeWindow(); - status_t pushBlankBuffersToNativeWindow(); - - status_t freeBuffersOnPort( - OMX_U32 portIndex, bool onlyThoseWeOwn = false); - - status_t freeBuffer(OMX_U32 portIndex, size_t bufIndex); - - bool drainInputBuffer(IOMX::buffer_id buffer); - void fillOutputBuffer(IOMX::buffer_id buffer); - bool drainInputBuffer(BufferInfo *info); - void fillOutputBuffer(BufferInfo *info); - - void drainInputBuffers(); - void fillOutputBuffers(); - - bool drainAnyInputBuffer(); - BufferInfo *findInputBufferByDataPointer(void *ptr); - BufferInfo *findEmptyInputBuffer(); - - // Returns true iff a flush was initiated and a completion event is - // upcoming, false otherwise (A flush was not necessary as we own all - // the buffers on that port). - // This method will ONLY ever return false for a component with quirk - // "kRequiresFlushCompleteEmulation". - bool flushPortAsync(OMX_U32 portIndex); - - void disablePortAsync(OMX_U32 portIndex); - status_t enablePortAsync(OMX_U32 portIndex); - - static size_t countBuffersWeOwn(const Vector &buffers); - static bool isIntermediateState(State state); - - void onEvent(OMX_EVENTTYPE event, OMX_U32 data1, OMX_U32 data2); - void onCmdComplete(OMX_COMMANDTYPE cmd, OMX_U32 data); - void onStateChange(OMX_STATETYPE newState); - void onPortSettingsChanged(OMX_U32 portIndex); - - void setState(State newState); - - status_t init(); - void initOutputFormat(const sp &inputFormat); - status_t initNativeWindow(); - - void initNativeWindowCrop(); - - void dumpPortStatus(OMX_U32 portIndex); - - status_t configureCodec(const sp &meta); - - status_t applyRotation(); - status_t waitForBufferFilled_l(); - - int64_t getDecodingTimeUs(); - - status_t parseAVCCodecSpecificData( - const void *data, size_t size, - unsigned *profile, unsigned *level); - - status_t stopOmxComponent_l(); - - OMXCodec(const OMXCodec &); - OMXCodec &operator=(const OMXCodec &); -}; - -struct CodecCapabilities { - enum { - kFlagSupportsAdaptivePlayback = 1 << 0, - }; - - String8 mComponentName; - Vector mProfileLevels; - Vector mColorFormats; - uint32_t mFlags; -}; - -// Return a vector of componentNames with supported profile/level pairs -// supporting the given mime type, if queryDecoders==true, returns components -// that decode content of the given type, otherwise returns components -// that encode content of the given type. -// profile and level indications only make sense for h.263, mpeg4 and avc -// video. -// If hwCodecOnly==true, only returns hardware-based components, software and -// hardware otherwise. -// The profile/level values correspond to -// OMX_VIDEO_H263PROFILETYPE, OMX_VIDEO_MPEG4PROFILETYPE, -// OMX_VIDEO_AVCPROFILETYPE, OMX_VIDEO_H263LEVELTYPE, OMX_VIDEO_MPEG4LEVELTYPE -// and OMX_VIDEO_AVCLEVELTYPE respectively. - -status_t QueryCodecs( - const sp &omx, - const char *mimeType, bool queryDecoders, bool hwCodecOnly, - Vector *results); - -status_t QueryCodecs( - const sp &omx, - const char *mimeType, bool queryDecoders, - Vector *results); - -status_t QueryCodec( - const sp &omx, - const char *componentName, const char *mime, - bool isEncoder, - CodecCapabilities *caps); - -status_t getOMXChannelMapping(size_t numChannels, OMX_AUDIO_CHANNELTYPE map[]); - -} // namespace android - -#endif // OMX_CODEC_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/SkipCutBuffer.h b/external/android/include/19/frameworks/av/include/media/stagefright/SkipCutBuffer.h deleted file mode 100644 index 2653b53..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/SkipCutBuffer.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2012 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 SKIP_CUT_BUFFER_H_ - -#define SKIP_CUT_BUFFER_H_ - -#include -#include - -namespace android { - -/** - * utility class to cut the start and end off a stream of data in MediaBuffers - * - */ -class SkipCutBuffer: public RefBase { - public: - // 'skip' is the number of bytes to skip from the beginning - // 'cut' is the number of bytes to cut from the end - SkipCutBuffer(int32_t skip, int32_t cut); - - // Submit one MediaBuffer for skipping and cutting. This may consume all or - // some of the data in the buffer, or it may add data to it. - // After this, the caller should continue processing the buffer as usual. - void submit(MediaBuffer *buffer); - void submit(const sp& buffer); // same as above, but with an ABuffer - void clear(); - size_t size(); // how many bytes are currently stored in the buffer - - protected: - virtual ~SkipCutBuffer(); - - private: - void write(const char *src, size_t num); - size_t read(char *dst, size_t num); - int32_t mFrontPadding; - int32_t mBackPadding; - int32_t mWriteHead; - int32_t mReadHead; - int32_t mCapacity; - char* mCutBuffer; - DISALLOW_EVIL_CONSTRUCTORS(SkipCutBuffer); -}; - -} // namespace android - -#endif // OMX_CODEC_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/StagefrightMediaScanner.h b/external/android/include/19/frameworks/av/include/media/stagefright/StagefrightMediaScanner.h deleted file mode 100644 index 6510a59..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/StagefrightMediaScanner.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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 STAGEFRIGHT_MEDIA_SCANNER_H_ - -#define STAGEFRIGHT_MEDIA_SCANNER_H_ - -#include - -namespace android { - -struct StagefrightMediaScanner : public MediaScanner { - StagefrightMediaScanner(); - virtual ~StagefrightMediaScanner(); - - virtual MediaScanResult processFile( - const char *path, const char *mimeType, - MediaScannerClient &client); - - virtual char *extractAlbumArt(int fd); - -private: - StagefrightMediaScanner(const StagefrightMediaScanner &); - StagefrightMediaScanner &operator=(const StagefrightMediaScanner &); - - MediaScanResult processFileInternal( - const char *path, const char *mimeType, - MediaScannerClient &client); -}; - -} // namespace android - -#endif // STAGEFRIGHT_MEDIA_SCANNER_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/SurfaceMediaSource.h b/external/android/include/19/frameworks/av/include/media/stagefright/SurfaceMediaSource.h deleted file mode 100644 index db5f947..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/SurfaceMediaSource.h +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Copyright (C) 2011 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_GUI_SURFACEMEDIASOURCE_H -#define ANDROID_GUI_SURFACEMEDIASOURCE_H - -#include -#include - -#include -#include -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class IGraphicBufferAlloc; -class String8; -class GraphicBuffer; - -// ASSUMPTIONS -// 1. SurfaceMediaSource is initialized with width*height which -// can never change. However, deqeueue buffer does not currently -// enforce this as in BufferQueue, dequeue can be used by Surface -// which can modify the default width and heght. Also neither the width -// nor height can be 0. -// 2. setSynchronousMode is never used (basically no one should call -// setSynchronousMode(false) -// 3. setCrop, setTransform, setScalingMode should never be used -// 4. queueBuffer returns a filled buffer to the SurfaceMediaSource. In addition, a -// timestamp must be provided for the buffer. The timestamp is in -// nanoseconds, and must be monotonically increasing. Its other semantics -// (zero point, etc) are client-dependent and should be documented by the -// client. -// 5. Once disconnected, SurfaceMediaSource can be reused (can not -// connect again) -// 6. Stop is a hard stop, the last few frames held by the encoder -// may be dropped. It is possible to wait for the buffers to be -// returned (but not implemented) - -#define DEBUG_PENDING_BUFFERS 0 - -class SurfaceMediaSource : public MediaSource, - public MediaBufferObserver, - protected ConsumerListener { -public: - enum { MIN_UNDEQUEUED_BUFFERS = 4}; - - struct FrameAvailableListener : public virtual RefBase { - // onFrameAvailable() is called from queueBuffer() is the FIFO is - // empty. You can use SurfaceMediaSource::getQueuedCount() to - // figure out if there are more frames waiting. - // This is called without any lock held can be called concurrently by - // multiple threads. - virtual void onFrameAvailable() = 0; - }; - - SurfaceMediaSource(uint32_t bufferWidth, uint32_t bufferHeight); - - virtual ~SurfaceMediaSource(); - - // For the MediaSource interface for use by StageFrightRecorder: - virtual status_t start(MetaData *params = NULL); - virtual status_t stop(); - virtual status_t read(MediaBuffer **buffer, - const ReadOptions *options = NULL); - virtual sp getFormat(); - - // Get / Set the frame rate used for encoding. Default fps = 30 - status_t setFrameRate(int32_t fps) ; - int32_t getFrameRate( ) const; - - // The call for the StageFrightRecorder to tell us that - // it is done using the MediaBuffer data so that its state - // can be set to FREE for dequeuing - virtual void signalBufferReturned(MediaBuffer* buffer); - // end of MediaSource interface - - // getTimestamp retrieves the timestamp associated with the image - // set by the most recent call to read() - // - // The timestamp is in nanoseconds, and is monotonically increasing. Its - // other semantics (zero point, etc) are source-dependent and should be - // documented by the source. - int64_t getTimestamp(); - - // setFrameAvailableListener sets the listener object that will be notified - // when a new frame becomes available. - void setFrameAvailableListener(const sp& listener); - - // dump our state in a String - void dump(String8& result) const; - void dump(String8& result, const char* prefix, char* buffer, - size_t SIZE) const; - - // isMetaDataStoredInVideoBuffers tells the encoder whether we will - // pass metadata through the buffers. Currently, it is force set to true - bool isMetaDataStoredInVideoBuffers() const; - - sp getBufferQueue() const { return mBufferQueue; } - - // To be called before start() - status_t setMaxAcquiredBufferCount(size_t count); - - // To be called before start() - status_t setUseAbsoluteTimestamps(); - -protected: - - // Implementation of the BufferQueue::ConsumerListener interface. These - // calls are used to notify the Surface of asynchronous events in the - // BufferQueue. - virtual void onFrameAvailable(); - - // Used as a hook to BufferQueue::disconnect() - // This is called by the client side when it is done - // TODO: Currently, this also sets mStopped to true which - // is needed for unblocking the encoder which might be - // waiting to read more frames. So if on the client side, - // the same thread supplies the frames and also calls stop - // on the encoder, the client has to call disconnect before - // it calls stop. - // In the case of the camera, - // that need not be required since the thread supplying the - // frames is separate than the one calling stop. - virtual void onBuffersReleased(); - - static bool isExternalFormat(uint32_t format); - -private: - // mBufferQueue is the exchange point between the producer and - // this consumer - sp mBufferQueue; - - struct SlotData { - sp mGraphicBuffer; - uint64_t mFrameNumber; - }; - - // mSlots caches GraphicBuffers and frameNumbers from the buffer queue - SlotData mSlots[BufferQueue::NUM_BUFFER_SLOTS]; - - // The permenent width and height of SMS buffers - int mWidth; - int mHeight; - - // mCurrentSlot is the buffer slot index of the buffer that is currently - // being used by buffer consumer - // (e.g. StageFrightRecorder in the case of SurfaceMediaSource or GLTexture - // in the case of Surface). - // It is initialized to INVALID_BUFFER_SLOT, - // indicating that no buffer slot is currently bound to the texture. Note, - // however, that a value of INVALID_BUFFER_SLOT does not necessarily mean - // that no buffer is bound to the texture. A call to setBufferCount will - // reset mCurrentTexture to INVALID_BUFFER_SLOT. - int mCurrentSlot; - - // mCurrentBuffers is a list of the graphic buffers that are being used by - // buffer consumer (i.e. the video encoder). It's possible that these - // buffers are not associated with any buffer slots, so we must track them - // separately. Buffers are added to this list in read, and removed from - // this list in signalBufferReturned - Vector > mCurrentBuffers; - - size_t mNumPendingBuffers; - -#if DEBUG_PENDING_BUFFERS - Vector mPendingBuffers; -#endif - - // mCurrentTimestamp is the timestamp for the current texture. It - // gets set to mLastQueuedTimestamp each time updateTexImage is called. - int64_t mCurrentTimestamp; - - // mFrameAvailableListener is the listener object that will be called when a - // new frame becomes available. If it is not NULL it will be called from - // queueBuffer. - sp mFrameAvailableListener; - - // mMutex is the mutex used to prevent concurrent access to the member - // variables of SurfaceMediaSource objects. It must be locked whenever the - // member variables are accessed. - mutable Mutex mMutex; - - ////////////////////////// For MediaSource - // Set to a default of 30 fps if not specified by the client side - int32_t mFrameRate; - - // mStarted is a flag to check if the recording is going on - bool mStarted; - - // mNumFramesReceived indicates the number of frames recieved from - // the client side - int mNumFramesReceived; - // mNumFramesEncoded indicates the number of frames passed on to the - // encoder - int mNumFramesEncoded; - - // mFirstFrameTimestamp is the timestamp of the first received frame. - // It is used to offset the output timestamps so recording starts at time 0. - int64_t mFirstFrameTimestamp; - // mStartTimeNs is the start time passed into the source at start, used to - // offset timestamps. - int64_t mStartTimeNs; - - size_t mMaxAcquiredBufferCount; - - bool mUseAbsoluteTimestamps; - - // mFrameAvailableCondition condition used to indicate whether there - // is a frame available for dequeuing - Condition mFrameAvailableCondition; - - Condition mMediaBuffersAvailableCondition; - - // Avoid copying and equating and default constructor - DISALLOW_IMPLICIT_CONSTRUCTORS(SurfaceMediaSource); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_SURFACEMEDIASOURCE_H diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/TimeSource.h b/external/android/include/19/frameworks/av/include/media/stagefright/TimeSource.h deleted file mode 100644 index 8f11e14..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/TimeSource.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 TIME_SOURCE_H_ - -#define TIME_SOURCE_H_ - -#include - -namespace android { - -class TimeSource { -public: - TimeSource() {} - virtual ~TimeSource() {} - - virtual int64_t getRealTimeUs() = 0; - -private: - TimeSource(const TimeSource &); - TimeSource &operator=(const TimeSource &); -}; - -class SystemTimeSource : public TimeSource { -public: - SystemTimeSource(); - - virtual int64_t getRealTimeUs(); - -private: - int64_t mStartTimeUs; -}; - -} // namespace android - -#endif // TIME_SOURCE_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/Utils.h b/external/android/include/19/frameworks/av/include/media/stagefright/Utils.h deleted file mode 100644 index c24f612..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/Utils.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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 UTILS_H_ - -#define UTILS_H_ - -#include -#include -#include -#include -#include -#include - -namespace android { - -#define FOURCC(c1, c2, c3, c4) \ - (c1 << 24 | c2 << 16 | c3 << 8 | c4) - -uint16_t U16_AT(const uint8_t *ptr); -uint32_t U32_AT(const uint8_t *ptr); -uint64_t U64_AT(const uint8_t *ptr); - -uint16_t U16LE_AT(const uint8_t *ptr); -uint32_t U32LE_AT(const uint8_t *ptr); -uint64_t U64LE_AT(const uint8_t *ptr); - -uint64_t ntoh64(uint64_t x); -uint64_t hton64(uint64_t x); - -struct MetaData; -struct AMessage; -status_t convertMetaDataToMessage( - const sp &meta, sp *format); -void convertMessageToMetaData( - const sp &format, sp &meta); - -AString MakeUserAgent(); - -// Convert a MIME type to a AudioSystem::audio_format -status_t mapMimeToAudioFormat(audio_format_t& format, const char* mime); - -// Send information from MetaData to the HAL via AudioSink -status_t sendMetaDataToHal(sp& sink, const sp& meta); - -// Check whether the stream defined by meta can be offloaded to hardware -bool canOffloadStream(const sp& meta, bool hasVideo, bool isStreaming); - -} // namespace android - -#endif // UTILS_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/YUVCanvas.h b/external/android/include/19/frameworks/av/include/media/stagefright/YUVCanvas.h deleted file mode 100644 index ff70923..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/YUVCanvas.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -// YUVCanvas holds a reference to a YUVImage on which it can do various -// drawing operations. It provides various utility functions for filling, -// cropping, etc. - - -#ifndef YUV_CANVAS_H_ - -#define YUV_CANVAS_H_ - -#include - -namespace android { - -class YUVImage; -class Rect; - -class YUVCanvas { -public: - - // Constructor takes in reference to a yuvImage on which it can do - // various drawing opreations. - YUVCanvas(YUVImage &yuvImage); - ~YUVCanvas(); - - // Fills the entire image with the given YUV values. - void FillYUV(uint8_t yValue, uint8_t uValue, uint8_t vValue); - - // Fills the rectangular region [startX,endX]x[startY,endY] with the given YUV values. - void FillYUVRectangle(const Rect& rect, - uint8_t yValue, uint8_t uValue, uint8_t vValue); - - // Copies the region [startX,endX]x[startY,endY] from srcImage into the - // canvas' target image (mYUVImage) starting at - // (destinationStartX,destinationStartY). - // Note that undefined behavior may occur if srcImage is same as the canvas' - // target image. - void CopyImageRect( - const Rect& srcRect, - int32_t destStartX, int32_t destStartY, - const YUVImage &srcImage); - - // Downsamples the srcImage into the canvas' target image (mYUVImage) - // The downsampling copies pixels from the source image starting at - // (srcOffsetX, srcOffsetY) to the target image, starting at (0, 0). - // For each X increment in the target image, skipX pixels are skipped - // in the source image. - // Similarly for each Y increment in the target image, skipY pixels - // are skipped in the source image. - void downsample( - int32_t srcOffsetX, int32_t srcOffsetY, - int32_t skipX, int32_t skipY, - const YUVImage &srcImage); - -private: - YUVImage& mYUVImage; - - YUVCanvas(const YUVCanvas &); - YUVCanvas &operator=(const YUVCanvas &); -}; - -} // namespace android - -#endif // YUV_CANVAS_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/YUVImage.h b/external/android/include/19/frameworks/av/include/media/stagefright/YUVImage.h deleted file mode 100644 index 4e98618..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/YUVImage.h +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -// A container class to hold YUV data and provide various utilities, -// e.g. to set/get pixel values. -// Supported formats: -// - YUV420 Planar -// - YUV420 Semi Planar -// -// Currently does not support variable strides. -// -// Implementation: Two simple abstractions are done to simplify access -// to YUV channels for different formats: -// - initializeYUVPointers() sets up pointers (mYdata, mUdata, mVdata) to -// point to the right start locations of the different channel data depending -// on the format. -// - getOffsets() returns the correct offset for the different channels -// depending on the format. -// Location of any pixel's YUV channels can then be easily computed using these. -// - -#ifndef YUV_IMAGE_H_ - -#define YUV_IMAGE_H_ - -#include -#include - -namespace android { - -class Rect; - -class YUVImage { -public: - // Supported YUV formats - enum YUVFormat { - YUV420Planar, - YUV420SemiPlanar - }; - - // Constructs an image with the given size, format. Also allocates and owns - // the required memory. - YUVImage(YUVFormat yuvFormat, int32_t width, int32_t height); - - // Constructs an image with the given size, format. The memory is provided - // by the caller and we don't own it. - YUVImage(YUVFormat yuvFormat, int32_t width, int32_t height, uint8_t *buffer); - - // Destructor to delete the memory if it owns it. - ~YUVImage(); - - // Returns the size of the buffer required to store the YUV data for the given - // format and geometry. Useful when the caller wants to allocate the requisite - // memory. - static size_t bufferSize(YUVFormat yuvFormat, int32_t width, int32_t height); - - int32_t width() const {return mWidth;} - int32_t height() const {return mHeight;} - - // Returns true if pixel is the range [0, width-1] x [0, height-1] - // and false otherwise. - bool validPixel(int32_t x, int32_t y) const; - - // Get the pixel YUV value at pixel (x,y). - // Note that the range of x is [0, width-1] and the range of y is [0, height-1]. - // Returns true if get was successful and false otherwise. - bool getPixelValue(int32_t x, int32_t y, - uint8_t *yPtr, uint8_t *uPtr, uint8_t *vPtr) const; - - // Set the pixel YUV value at pixel (x,y). - // Note that the range of x is [0, width-1] and the range of y is [0, height-1]. - // Returns true if set was successful and false otherwise. - bool setPixelValue(int32_t x, int32_t y, - uint8_t yValue, uint8_t uValue, uint8_t vValue); - - // Uses memcpy to copy an entire row of data - static void fastCopyRectangle420Planar( - const Rect& srcRect, - int32_t destStartX, int32_t destStartY, - const YUVImage &srcImage, YUVImage &destImage); - - // Uses memcpy to copy an entire row of data - static void fastCopyRectangle420SemiPlanar( - const Rect& srcRect, - int32_t destStartX, int32_t destStartY, - const YUVImage &srcImage, YUVImage &destImage); - - // Tries to use memcopy to copy entire rows of data. - // Returns false if fast copy is not possible for the passed image formats. - static bool fastCopyRectangle( - const Rect& srcRect, - int32_t destStartX, int32_t destStartY, - const YUVImage &srcImage, YUVImage &destImage); - - // Convert the given YUV value to RGB. - void yuv2rgb(uint8_t yValue, uint8_t uValue, uint8_t vValue, - uint8_t *r, uint8_t *g, uint8_t *b) const; - - // Write the image to a human readable PPM file. - // Returns true if write was succesful and false otherwise. - bool writeToPPM(const char *filename) const; - -private: - // YUV Format of the image. - YUVFormat mYUVFormat; - - int32_t mWidth; - int32_t mHeight; - - // Pointer to the memory buffer. - uint8_t *mBuffer; - - // Boolean telling whether we own the memory buffer. - bool mOwnBuffer; - - // Pointer to start of the Y data plane. - uint8_t *mYdata; - - // Pointer to start of the U data plane. Note that in case of interleaved formats like - // YUV420 semiplanar, mUdata points to the start of the U data in the UV plane. - uint8_t *mUdata; - - // Pointer to start of the V data plane. Note that in case of interleaved formats like - // YUV420 semiplanar, mVdata points to the start of the V data in the UV plane. - uint8_t *mVdata; - - // Initialize the pointers mYdata, mUdata, mVdata to point to the right locations for - // the given format and geometry. - // Returns true if initialize was succesful and false otherwise. - bool initializeYUVPointers(); - - // For the given pixel location, this returns the offset of the location of y, u and v - // data from the corresponding base pointers -- mYdata, mUdata, mVdata. - // Note that the range of x is [0, width-1] and the range of y is [0, height-1]. - // Returns true if getting offsets was succesful and false otherwise. - bool getOffsets(int32_t x, int32_t y, - int32_t *yOffset, int32_t *uOffset, int32_t *vOffset) const; - - // Returns the offset increments incurred in going from one data row to the next data row - // for the YUV channels. Note that this corresponds to data rows and not pixel rows. - // E.g. depending on formats, U/V channels may have only one data row corresponding - // to two pixel rows. - bool getOffsetIncrementsPerDataRow( - int32_t *yDataOffsetIncrement, - int32_t *uDataOffsetIncrement, - int32_t *vDataOffsetIncrement) const; - - // Given the offset return the address of the corresponding channel's data. - uint8_t* getYAddress(int32_t offset) const; - uint8_t* getUAddress(int32_t offset) const; - uint8_t* getVAddress(int32_t offset) const; - - // Given the pixel location, returns the address of the corresponding channel's data. - // Note that the range of x is [0, width-1] and the range of y is [0, height-1]. - bool getYUVAddresses(int32_t x, int32_t y, - uint8_t **yAddr, uint8_t **uAddr, uint8_t **vAddr) const; - - // Disallow implicit casting and copying. - YUVImage(const YUVImage &); - YUVImage &operator=(const YUVImage &); -}; - -} // namespace android - -#endif // YUV_IMAGE_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/AAtomizer.h b/external/android/include/19/frameworks/av/include/media/stagefright/foundation/AAtomizer.h deleted file mode 100644 index 5f3a678..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/AAtomizer.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2010 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 A_ATOMIZER_H_ - -#define A_ATOMIZER_H_ - -#include - -#include -#include -#include -#include -#include - -namespace android { - -struct AAtomizer { - static const char *Atomize(const char *name); - -private: - static AAtomizer gAtomizer; - - Mutex mLock; - Vector > mAtoms; - - AAtomizer(); - - const char *atomize(const char *name); - - static uint32_t Hash(const char *s); - - DISALLOW_EVIL_CONSTRUCTORS(AAtomizer); -}; - -} // namespace android - -#endif // A_ATOMIZER_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/ABase.h b/external/android/include/19/frameworks/av/include/media/stagefright/foundation/ABase.h deleted file mode 100644 index 9eceea3..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/ABase.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2010 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 A_BASE_H_ - -#define A_BASE_H_ - -#define DISALLOW_EVIL_CONSTRUCTORS(name) \ - name(const name &); \ - name &operator=(const name &) - -#endif // A_BASE_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/ABitReader.h b/external/android/include/19/frameworks/av/include/media/stagefright/foundation/ABitReader.h deleted file mode 100644 index 5510b12..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/ABitReader.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2010 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 A_BIT_READER_H_ - -#define A_BIT_READER_H_ - -#include - -#include -#include - -namespace android { - -struct ABitReader { - ABitReader(const uint8_t *data, size_t size); - - uint32_t getBits(size_t n); - void skipBits(size_t n); - - void putBits(uint32_t x, size_t n); - - size_t numBitsLeft() const; - - const uint8_t *data() const; - -private: - const uint8_t *mData; - size_t mSize; - - uint32_t mReservoir; // left-aligned bits - size_t mNumBitsLeft; - - void fillReservoir(); - - DISALLOW_EVIL_CONSTRUCTORS(ABitReader); -}; - -} // namespace android - -#endif // A_BIT_READER_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/ABuffer.h b/external/android/include/19/frameworks/av/include/media/stagefright/foundation/ABuffer.h deleted file mode 100644 index 28f0aed..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/ABuffer.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2010 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 A_BUFFER_H_ - -#define A_BUFFER_H_ - -#include -#include - -#include -#include - -namespace android { - -struct AMessage; - -struct ABuffer : public RefBase { - ABuffer(size_t capacity); - ABuffer(void *data, size_t capacity); - - void setFarewellMessage(const sp msg); - - uint8_t *base() { return (uint8_t *)mData; } - uint8_t *data() { return (uint8_t *)mData + mRangeOffset; } - size_t capacity() const { return mCapacity; } - size_t size() const { return mRangeLength; } - size_t offset() const { return mRangeOffset; } - - void setRange(size_t offset, size_t size); - - void setInt32Data(int32_t data) { mInt32Data = data; } - int32_t int32Data() const { return mInt32Data; } - - sp meta(); - -protected: - virtual ~ABuffer(); - -private: - sp mFarewell; - sp mMeta; - - void *mData; - size_t mCapacity; - size_t mRangeOffset; - size_t mRangeLength; - - int32_t mInt32Data; - - bool mOwnsData; - - DISALLOW_EVIL_CONSTRUCTORS(ABuffer); -}; - -} // namespace android - -#endif // A_BUFFER_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/ADebug.h b/external/android/include/19/frameworks/av/include/media/stagefright/foundation/ADebug.h deleted file mode 100644 index 450dcfe..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/ADebug.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2010 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 A_DEBUG_H_ - -#define A_DEBUG_H_ - -#include - -#include -#include -#include - -namespace android { - -#define LITERAL_TO_STRING_INTERNAL(x) #x -#define LITERAL_TO_STRING(x) LITERAL_TO_STRING_INTERNAL(x) - -#define CHECK(condition) \ - LOG_ALWAYS_FATAL_IF( \ - !(condition), \ - "%s", \ - __FILE__ ":" LITERAL_TO_STRING(__LINE__) \ - " CHECK(" #condition ") failed.") - -#define MAKE_COMPARATOR(suffix,op) \ - template \ - AString Compare_##suffix(const A &a, const B &b) { \ - AString res; \ - if (!(a op b)) { \ - res.append(a); \ - res.append(" vs. "); \ - res.append(b); \ - } \ - return res; \ - } - -MAKE_COMPARATOR(EQ,==) -MAKE_COMPARATOR(NE,!=) -MAKE_COMPARATOR(LE,<=) -MAKE_COMPARATOR(GE,>=) -MAKE_COMPARATOR(LT,<) -MAKE_COMPARATOR(GT,>) - -#define CHECK_OP(x,y,suffix,op) \ - do { \ - AString ___res = Compare_##suffix(x, y); \ - if (!___res.empty()) { \ - AString ___full = \ - __FILE__ ":" LITERAL_TO_STRING(__LINE__) \ - " CHECK_" #suffix "( " #x "," #y ") failed: "; \ - ___full.append(___res); \ - \ - LOG_ALWAYS_FATAL("%s", ___full.c_str()); \ - } \ - } while (false) - -#define CHECK_EQ(x,y) CHECK_OP(x,y,EQ,==) -#define CHECK_NE(x,y) CHECK_OP(x,y,NE,!=) -#define CHECK_LE(x,y) CHECK_OP(x,y,LE,<=) -#define CHECK_LT(x,y) CHECK_OP(x,y,LT,<) -#define CHECK_GE(x,y) CHECK_OP(x,y,GE,>=) -#define CHECK_GT(x,y) CHECK_OP(x,y,GT,>) - -#define TRESPASS() \ - LOG_ALWAYS_FATAL( \ - __FILE__ ":" LITERAL_TO_STRING(__LINE__) \ - " Should not be here."); - -} // namespace android - -#endif // A_DEBUG_H_ - diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/AHandler.h b/external/android/include/19/frameworks/av/include/media/stagefright/foundation/AHandler.h deleted file mode 100644 index b008b54..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/AHandler.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2010 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 A_HANDLER_H_ - -#define A_HANDLER_H_ - -#include -#include - -namespace android { - -struct AMessage; - -struct AHandler : public RefBase { - AHandler() - : mID(0) { - } - - ALooper::handler_id id() const { - return mID; - } - - sp looper(); - -protected: - virtual void onMessageReceived(const sp &msg) = 0; - -private: - friend struct ALooperRoster; - - ALooper::handler_id mID; - - void setID(ALooper::handler_id id) { - mID = id; - } - - DISALLOW_EVIL_CONSTRUCTORS(AHandler); -}; - -} // namespace android - -#endif // A_HANDLER_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/AHandlerReflector.h b/external/android/include/19/frameworks/av/include/media/stagefright/foundation/AHandlerReflector.h deleted file mode 100644 index 9d201b5..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/AHandlerReflector.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2010 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 A_HANDLER_REFLECTOR_H_ - -#define A_HANDLER_REFLECTOR_H_ - -#include - -namespace android { - -template -struct AHandlerReflector : public AHandler { - AHandlerReflector(T *target) - : mTarget(target) { - } - -protected: - virtual void onMessageReceived(const sp &msg) { - sp target = mTarget.promote(); - if (target != NULL) { - target->onMessageReceived(msg); - } - } - -private: - wp mTarget; - - AHandlerReflector(const AHandlerReflector &); - AHandlerReflector &operator=(const AHandlerReflector &); -}; - -} // namespace android - -#endif // A_HANDLER_REFLECTOR_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/AHierarchicalStateMachine.h b/external/android/include/19/frameworks/av/include/media/stagefright/foundation/AHierarchicalStateMachine.h deleted file mode 100644 index d2e6b28..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/AHierarchicalStateMachine.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2010 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 A_HIERARCHICAL_STATE_MACHINE_H_ - -#define A_HIERARCHICAL_STATE_MACHINE_H_ - -#include - -namespace android { - -struct AState : public RefBase { - AState(const sp &parentState = NULL); - - sp parentState(); - -protected: - virtual ~AState(); - - virtual void stateEntered(); - virtual void stateExited(); - - virtual bool onMessageReceived(const sp &msg) = 0; - -private: - friend struct AHierarchicalStateMachine; - - sp mParentState; - - DISALLOW_EVIL_CONSTRUCTORS(AState); -}; - -struct AHierarchicalStateMachine : public AHandler { - AHierarchicalStateMachine(); - -protected: - virtual ~AHierarchicalStateMachine(); - - virtual void onMessageReceived(const sp &msg); - - // Only to be called in response to a message. - void changeState(const sp &state); - -private: - sp mState; - - DISALLOW_EVIL_CONSTRUCTORS(AHierarchicalStateMachine); -}; - -} // namespace android - -#endif // A_HIERARCHICAL_STATE_MACHINE_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/ALooper.h b/external/android/include/19/frameworks/av/include/media/stagefright/foundation/ALooper.h deleted file mode 100644 index 70e0c5e..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/ALooper.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (C) 2010 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 A_LOOPER_H_ - -#define A_LOOPER_H_ - -#include -#include -#include -#include -#include -#include -#include - -namespace android { - -struct AHandler; -struct AMessage; - -struct ALooper : public RefBase { - typedef int32_t event_id; - typedef int32_t handler_id; - - ALooper(); - - // Takes effect in a subsequent call to start(). - void setName(const char *name); - - handler_id registerHandler(const sp &handler); - void unregisterHandler(handler_id handlerID); - - status_t start( - bool runOnCallingThread = false, - bool canCallJava = false, - int32_t priority = PRIORITY_DEFAULT - ); - - status_t stop(); - - static int64_t GetNowUs(); - -protected: - virtual ~ALooper(); - -private: - friend struct ALooperRoster; - - struct Event { - int64_t mWhenUs; - sp mMessage; - }; - - Mutex mLock; - Condition mQueueChangedCondition; - - AString mName; - - List mEventQueue; - - struct LooperThread; - sp mThread; - bool mRunningLocally; - - void post(const sp &msg, int64_t delayUs); - bool loop(); - - DISALLOW_EVIL_CONSTRUCTORS(ALooper); -}; - -} // namespace android - -#endif // A_LOOPER_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/ALooperRoster.h b/external/android/include/19/frameworks/av/include/media/stagefright/foundation/ALooperRoster.h deleted file mode 100644 index 940fc55..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/ALooperRoster.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2010 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 A_LOOPER_ROSTER_H_ - -#define A_LOOPER_ROSTER_H_ - -#include -#include - -namespace android { - -struct ALooperRoster { - ALooperRoster(); - - ALooper::handler_id registerHandler( - const sp looper, const sp &handler); - - void unregisterHandler(ALooper::handler_id handlerID); - void unregisterStaleHandlers(); - - status_t postMessage(const sp &msg, int64_t delayUs = 0); - void deliverMessage(const sp &msg); - - status_t postAndAwaitResponse( - const sp &msg, sp *response); - - void postReply(uint32_t replyID, const sp &reply); - - sp findLooper(ALooper::handler_id handlerID); - -private: - struct HandlerInfo { - wp mLooper; - wp mHandler; - }; - - Mutex mLock; - KeyedVector mHandlers; - ALooper::handler_id mNextHandlerID; - uint32_t mNextReplyID; - Condition mRepliesCondition; - - KeyedVector > mReplies; - - status_t postMessage_l(const sp &msg, int64_t delayUs); - - DISALLOW_EVIL_CONSTRUCTORS(ALooperRoster); -}; - -} // namespace android - -#endif // A_LOOPER_ROSTER_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/AMessage.h b/external/android/include/19/frameworks/av/include/media/stagefright/foundation/AMessage.h deleted file mode 100644 index 7e823eb..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/AMessage.h +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (C) 2010 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 A_MESSAGE_H_ - -#define A_MESSAGE_H_ - -#include -#include -#include -#include - -namespace android { - -struct ABuffer; -struct AString; -struct Parcel; - -struct AMessage : public RefBase { - AMessage(uint32_t what = 0, ALooper::handler_id target = 0); - - static sp FromParcel(const Parcel &parcel); - void writeToParcel(Parcel *parcel) const; - - void setWhat(uint32_t what); - uint32_t what() const; - - void setTarget(ALooper::handler_id target); - ALooper::handler_id target() const; - - void clear(); - - void setInt32(const char *name, int32_t value); - void setInt64(const char *name, int64_t value); - void setSize(const char *name, size_t value); - void setFloat(const char *name, float value); - void setDouble(const char *name, double value); - void setPointer(const char *name, void *value); - void setString(const char *name, const char *s, ssize_t len = -1); - void setObject(const char *name, const sp &obj); - void setBuffer(const char *name, const sp &buffer); - void setMessage(const char *name, const sp &obj); - - void setRect( - const char *name, - int32_t left, int32_t top, int32_t right, int32_t bottom); - - bool findInt32(const char *name, int32_t *value) const; - bool findInt64(const char *name, int64_t *value) const; - bool findSize(const char *name, size_t *value) const; - bool findFloat(const char *name, float *value) const; - bool findDouble(const char *name, double *value) const; - bool findPointer(const char *name, void **value) const; - bool findString(const char *name, AString *value) const; - bool findObject(const char *name, sp *obj) const; - bool findBuffer(const char *name, sp *buffer) const; - bool findMessage(const char *name, sp *obj) const; - - bool findRect( - const char *name, - int32_t *left, int32_t *top, int32_t *right, int32_t *bottom) const; - - void post(int64_t delayUs = 0); - - // Posts the message to its target and waits for a response (or error) - // before returning. - status_t postAndAwaitResponse(sp *response); - - // If this returns true, the sender of this message is synchronously - // awaiting a response, the "replyID" can be used to send the response - // via "postReply" below. - bool senderAwaitsResponse(uint32_t *replyID) const; - - void postReply(uint32_t replyID); - - // Performs a deep-copy of "this", contained messages are in turn "dup'ed". - // Warning: RefBase items, i.e. "objects" are _not_ copied but only have - // their refcount incremented. - sp dup() const; - - AString debugString(int32_t indent = 0) const; - - enum Type { - kTypeInt32, - kTypeInt64, - kTypeSize, - kTypeFloat, - kTypeDouble, - kTypePointer, - kTypeString, - kTypeObject, - kTypeMessage, - kTypeRect, - kTypeBuffer, - }; - - size_t countEntries() const; - const char *getEntryNameAt(size_t index, Type *type) const; - -protected: - virtual ~AMessage(); - -private: - uint32_t mWhat; - ALooper::handler_id mTarget; - - struct Rect { - int32_t mLeft, mTop, mRight, mBottom; - }; - - struct Item { - union { - int32_t int32Value; - int64_t int64Value; - size_t sizeValue; - float floatValue; - double doubleValue; - void *ptrValue; - RefBase *refValue; - AString *stringValue; - Rect rectValue; - } u; - const char *mName; - Type mType; - }; - - enum { - kMaxNumItems = 64 - }; - Item mItems[kMaxNumItems]; - size_t mNumItems; - - Item *allocateItem(const char *name); - void freeItem(Item *item); - const Item *findItem(const char *name, Type type) const; - - void setObjectInternal( - const char *name, const sp &obj, Type type); - - DISALLOW_EVIL_CONSTRUCTORS(AMessage); -}; - -} // namespace android - -#endif // A_MESSAGE_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/ANetworkSession.h b/external/android/include/19/frameworks/av/include/media/stagefright/foundation/ANetworkSession.h deleted file mode 100644 index fd3ebaa..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/ANetworkSession.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright 2012, 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 A_NETWORK_SESSION_H_ - -#define A_NETWORK_SESSION_H_ - -#include -#include -#include -#include - -#include - -namespace android { - -struct AMessage; - -// Helper class to manage a number of live sockets (datagram and stream-based) -// on a single thread. Clients are notified about activity through AMessages. -struct ANetworkSession : public RefBase { - ANetworkSession(); - - status_t start(); - status_t stop(); - - status_t createRTSPClient( - const char *host, unsigned port, const sp ¬ify, - int32_t *sessionID); - - status_t createRTSPServer( - const struct in_addr &addr, unsigned port, - const sp ¬ify, int32_t *sessionID); - - status_t createUDPSession( - unsigned localPort, const sp ¬ify, int32_t *sessionID); - - status_t createUDPSession( - unsigned localPort, - const char *remoteHost, - unsigned remotePort, - const sp ¬ify, - int32_t *sessionID); - - status_t connectUDPSession( - int32_t sessionID, const char *remoteHost, unsigned remotePort); - - // passive - status_t createTCPDatagramSession( - const struct in_addr &addr, unsigned port, - const sp ¬ify, int32_t *sessionID); - - // active - status_t createTCPDatagramSession( - unsigned localPort, - const char *remoteHost, - unsigned remotePort, - const sp ¬ify, - int32_t *sessionID); - - status_t destroySession(int32_t sessionID); - - status_t sendRequest( - int32_t sessionID, const void *data, ssize_t size = -1, - bool timeValid = false, int64_t timeUs = -1ll); - - status_t switchToWebSocketMode(int32_t sessionID); - - enum NotificationReason { - kWhatError, - kWhatConnected, - kWhatClientConnected, - kWhatData, - kWhatDatagram, - kWhatBinaryData, - kWhatWebSocketMessage, - kWhatNetworkStall, - }; - -protected: - virtual ~ANetworkSession(); - -private: - struct NetworkThread; - struct Session; - - Mutex mLock; - sp mThread; - - int32_t mNextSessionID; - - int mPipeFd[2]; - - KeyedVector > mSessions; - - enum Mode { - kModeCreateUDPSession, - kModeCreateTCPDatagramSessionPassive, - kModeCreateTCPDatagramSessionActive, - kModeCreateRTSPServer, - kModeCreateRTSPClient, - }; - status_t createClientOrServer( - Mode mode, - const struct in_addr *addr, - unsigned port, - const char *remoteHost, - unsigned remotePort, - const sp ¬ify, - int32_t *sessionID); - - void threadLoop(); - void interrupt(); - - static status_t MakeSocketNonBlocking(int s); - - DISALLOW_EVIL_CONSTRUCTORS(ANetworkSession); -}; - -} // namespace android - -#endif // A_NETWORK_SESSION_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/AString.h b/external/android/include/19/frameworks/av/include/media/stagefright/foundation/AString.h deleted file mode 100644 index 0f8f1e1..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/AString.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (C) 2010 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 A_STRING_H_ - -#define A_STRING_H_ - -#include - -namespace android { - -struct AString { - AString(); - AString(const char *s); - AString(const char *s, size_t size); - AString(const AString &from); - AString(const AString &from, size_t offset, size_t n); - ~AString(); - - AString &operator=(const AString &from); - void setTo(const char *s); - void setTo(const char *s, size_t size); - void setTo(const AString &from, size_t offset, size_t n); - - size_t size() const; - const char *c_str() const; - - bool empty() const; - - void clear(); - void trim(); - void erase(size_t start, size_t n); - - void append(char c) { append(&c, 1); } - void append(const char *s); - void append(const char *s, size_t size); - void append(const AString &from); - void append(const AString &from, size_t offset, size_t n); - void append(int x); - void append(unsigned x); - void append(long x); - void append(unsigned long x); - void append(long long x); - void append(unsigned long long x); - void append(float x); - void append(double x); - void append(void *x); - - void insert(const AString &from, size_t insertionPos); - void insert(const char *from, size_t size, size_t insertionPos); - - ssize_t find(const char *substring, size_t start = 0) const; - - size_t hash() const; - - bool operator==(const AString &other) const; - bool operator<(const AString &other) const; - bool operator>(const AString &other) const; - - int compare(const AString &other) const; - - bool startsWith(const char *prefix) const; - bool endsWith(const char *suffix) const; - - void tolower(); - -private: - static const char *kEmptyString; - - char *mData; - size_t mSize; - size_t mAllocSize; - - void makeMutable(); -}; - -AString StringPrintf(const char *format, ...); - -} // namespace android - -#endif // A_STRING_H_ - diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/ParsedMessage.h b/external/android/include/19/frameworks/av/include/media/stagefright/foundation/ParsedMessage.h deleted file mode 100644 index 9d43a93..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/ParsedMessage.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2012, 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 -#include -#include -#include - -namespace android { - -// Encapsulates an "HTTP/RTSP style" response, i.e. a status line, -// key/value pairs making up the headers and an optional body/content. -struct ParsedMessage : public RefBase { - static sp Parse( - const char *data, size_t size, bool noMoreData, size_t *length); - - bool findString(const char *name, AString *value) const; - bool findInt32(const char *name, int32_t *value) const; - - const char *getContent() const; - - bool getRequestField(size_t index, AString *field) const; - bool getStatusCode(int32_t *statusCode) const; - - AString debugString() const; - - static bool GetAttribute(const char *s, const char *key, AString *value); - - static bool GetInt32Attribute( - const char *s, const char *key, int32_t *value); - - -protected: - virtual ~ParsedMessage(); - -private: - KeyedVector mDict; - AString mContent; - - ParsedMessage(); - - ssize_t parse(const char *data, size_t size, bool noMoreData); - - DISALLOW_EVIL_CONSTRUCTORS(ParsedMessage); -}; - -} // namespace android diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/base64.h b/external/android/include/19/frameworks/av/include/media/stagefright/foundation/base64.h deleted file mode 100644 index e340b89..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/base64.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2010 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 BASE_64_H_ - -#define BASE_64_H_ - -#include - -namespace android { - -struct ABuffer; -struct AString; - -sp decodeBase64(const AString &s); -void encodeBase64(const void *data, size_t size, AString *out); - -} // namespace android - -#endif // BASE_64_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/hexdump.h b/external/android/include/19/frameworks/av/include/media/stagefright/foundation/hexdump.h deleted file mode 100644 index 8360c5a..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/foundation/hexdump.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2010 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 HEXDUMP_H_ - -#define HEXDUMP_H_ - -#include - -namespace android { - -struct AString; - -void hexdump( - const void *_data, size_t size, - size_t indent = 0, AString *appendTo = NULL); - -} // namespace android - -#endif // HEXDUMP_H_ diff --git a/external/android/include/19/frameworks/av/include/media/stagefright/timedtext/TimedTextDriver.h b/external/android/include/19/frameworks/av/include/media/stagefright/timedtext/TimedTextDriver.h deleted file mode 100644 index f23c337..0000000 --- a/external/android/include/19/frameworks/av/include/media/stagefright/timedtext/TimedTextDriver.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2012 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 TIMED_TEXT_DRIVER_H_ -#define TIMED_TEXT_DRIVER_H_ - -#include // for DISALLOW_* macro -#include // for status_t -#include -#include - -namespace android { - -class ALooper; -class MediaPlayerBase; -class MediaSource; -class Parcel; -class TimedTextPlayer; -class TimedTextSource; -class DataSource; - -class TimedTextDriver { -public: - TimedTextDriver(const wp &listener); - - ~TimedTextDriver(); - - status_t start(); - status_t pause(); - status_t selectTrack(size_t index); - status_t unselectTrack(size_t index); - - status_t seekToAsync(int64_t timeUs); - - status_t addInBandTextSource( - size_t trackIndex, const sp& source); - - status_t addOutOfBandTextSource( - size_t trackIndex, const char *uri, const char *mimeType); - - // Caller owns the file desriptor and caller is responsible for closing it. - status_t addOutOfBandTextSource( - size_t trackIndex, int fd, off64_t offset, - off64_t length, const char *mimeType); - - void getExternalTrackInfo(Parcel *parcel); - size_t countExternalTracks() const; - -private: - Mutex mLock; - - enum State { - UNINITIALIZED, - PREPARED, - PLAYING, - PAUSED, - }; - - enum TextSourceType { - TEXT_SOURCE_TYPE_IN_BAND = 0, - TEXT_SOURCE_TYPE_OUT_OF_BAND, - }; - - sp mLooper; - sp mPlayer; - wp mListener; - - // Variables to be guarded by mLock. - State mState; - size_t mCurrentTrackIndex; - KeyedVector > mTextSourceVector; - Vector mTextSourceTypeVector; - - // -- End of variables to be guarded by mLock - - status_t selectTrack_l(size_t index); - - status_t createOutOfBandTextSource( - size_t trackIndex, const char* mimeType, - const sp& dataSource); - - DISALLOW_EVIL_CONSTRUCTORS(TimedTextDriver); -}; - -} // namespace android - -#endif // TIMED_TEXT_DRIVER_H_ diff --git a/external/android/include/19/frameworks/native/include/binder/AppOpsManager.h b/external/android/include/19/frameworks/native/include/binder/AppOpsManager.h deleted file mode 100644 index 256cb94..0000000 --- a/external/android/include/19/frameworks/native/include/binder/AppOpsManager.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (C) 2013 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_APP_OPS_MANAGER_H -#define ANDROID_APP_OPS_MANAGER_H - -#include - -#include - -// --------------------------------------------------------------------------- -namespace android { - -class AppOpsManager -{ -public: - enum { - MODE_ALLOWED = IAppOpsService::MODE_ALLOWED, - MODE_IGNORED = IAppOpsService::MODE_IGNORED, - MODE_ERRORED = IAppOpsService::MODE_ERRORED - }; - - enum { - OP_NONE = -1, - OP_COARSE_LOCATION = 0, - OP_FINE_LOCATION = 1, - OP_GPS = 2, - OP_VIBRATE = 3, - OP_READ_CONTACTS = 4, - OP_WRITE_CONTACTS = 5, - OP_READ_CALL_LOG = 6, - OP_WRITE_CALL_LOG = 7, - OP_READ_CALENDAR = 8, - OP_WRITE_CALENDAR = 9, - OP_WIFI_SCAN = 10, - OP_POST_NOTIFICATION = 11, - OP_NEIGHBORING_CELLS = 12, - OP_CALL_PHONE = 13, - OP_READ_SMS = 14, - OP_WRITE_SMS = 15, - OP_RECEIVE_SMS = 16, - OP_RECEIVE_EMERGECY_SMS = 17, - OP_RECEIVE_MMS = 18, - OP_RECEIVE_WAP_PUSH = 19, - OP_SEND_SMS = 20, - OP_READ_ICC_SMS = 21, - OP_WRITE_ICC_SMS = 22, - OP_WRITE_SETTINGS = 23, - OP_SYSTEM_ALERT_WINDOW = 24, - OP_ACCESS_NOTIFICATIONS = 25, - OP_CAMERA = 26, - OP_RECORD_AUDIO = 27, - OP_PLAY_AUDIO = 28 - }; - - AppOpsManager(); - - int32_t checkOp(int32_t op, int32_t uid, const String16& callingPackage); - int32_t noteOp(int32_t op, int32_t uid, const String16& callingPackage); - int32_t startOp(int32_t op, int32_t uid, const String16& callingPackage); - void finishOp(int32_t op, int32_t uid, const String16& callingPackage); - void startWatchingMode(int32_t op, const String16& packageName, - const sp& callback); - void stopWatchingMode(const sp& callback); - -private: - Mutex mLock; - sp mService; - - sp getService(); -}; - - -}; // namespace android -// --------------------------------------------------------------------------- -#endif // ANDROID_APP_OPS_MANAGER_H diff --git a/external/android/include/19/frameworks/native/include/binder/Binder.h b/external/android/include/19/frameworks/native/include/binder/Binder.h deleted file mode 100644 index ba3ac4b..0000000 --- a/external/android/include/19/frameworks/native/include/binder/Binder.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_BINDER_H -#define ANDROID_BINDER_H - -#include - -// --------------------------------------------------------------------------- -namespace android { - -class BBinder : public IBinder -{ -public: - BBinder(); - - virtual const String16& getInterfaceDescriptor() const; - virtual bool isBinderAlive() const; - virtual status_t pingBinder(); - virtual status_t dump(int fd, const Vector& args); - - virtual status_t transact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); - - virtual status_t linkToDeath(const sp& recipient, - void* cookie = NULL, - uint32_t flags = 0); - - virtual status_t unlinkToDeath( const wp& recipient, - void* cookie = NULL, - uint32_t flags = 0, - wp* outRecipient = NULL); - - virtual void attachObject( const void* objectID, - void* object, - void* cleanupCookie, - object_cleanup_func func); - virtual void* findObject(const void* objectID) const; - virtual void detachObject(const void* objectID); - - virtual BBinder* localBinder(); - -protected: - virtual ~BBinder(); - - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); - -private: - BBinder(const BBinder& o); - BBinder& operator=(const BBinder& o); - - class Extras; - - Extras* mExtras; - void* mReserved0; -}; - -// --------------------------------------------------------------------------- - -class BpRefBase : public virtual RefBase -{ -protected: - BpRefBase(const sp& o); - virtual ~BpRefBase(); - virtual void onFirstRef(); - virtual void onLastStrongRef(const void* id); - virtual bool onIncStrongAttempted(uint32_t flags, const void* id); - - inline IBinder* remote() { return mRemote; } - inline IBinder* remote() const { return mRemote; } - -private: - BpRefBase(const BpRefBase& o); - BpRefBase& operator=(const BpRefBase& o); - - IBinder* const mRemote; - RefBase::weakref_type* mRefs; - volatile int32_t mState; -}; - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_BINDER_H diff --git a/external/android/include/19/frameworks/native/include/binder/BinderService.h b/external/android/include/19/frameworks/native/include/binder/BinderService.h deleted file mode 100644 index ef703bd..0000000 --- a/external/android/include/19/frameworks/native/include/binder/BinderService.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2010 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_BINDER_SERVICE_H -#define ANDROID_BINDER_SERVICE_H - -#include - -#include -#include - -#include -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -template -class BinderService -{ -public: - static status_t publish(bool allowIsolated = false) { - sp sm(defaultServiceManager()); - return sm->addService( - String16(SERVICE::getServiceName()), - new SERVICE(), allowIsolated); - } - - static void publishAndJoinThreadPool(bool allowIsolated = false) { - publish(allowIsolated); - joinThreadPool(); - } - - static void instantiate() { publish(); } - - static status_t shutdown() { return NO_ERROR; } - -private: - static void joinThreadPool() { - sp ps(ProcessState::self()); - ps->startThreadPool(); - ps->giveThreadPoolName(); - IPCThreadState::self()->joinThreadPool(); - } -}; - - -}; // namespace android -// --------------------------------------------------------------------------- -#endif // ANDROID_BINDER_SERVICE_H diff --git a/external/android/include/19/frameworks/native/include/binder/BpBinder.h b/external/android/include/19/frameworks/native/include/binder/BpBinder.h deleted file mode 100644 index 7ef93aa..0000000 --- a/external/android/include/19/frameworks/native/include/binder/BpBinder.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (C) 2005 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_BPBINDER_H -#define ANDROID_BPBINDER_H - -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -class BpBinder : public IBinder -{ -public: - BpBinder(int32_t handle); - - inline int32_t handle() const { return mHandle; } - - virtual const String16& getInterfaceDescriptor() const; - virtual bool isBinderAlive() const; - virtual status_t pingBinder(); - virtual status_t dump(int fd, const Vector& args); - - virtual status_t transact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); - - virtual status_t linkToDeath(const sp& recipient, - void* cookie = NULL, - uint32_t flags = 0); - virtual status_t unlinkToDeath( const wp& recipient, - void* cookie = NULL, - uint32_t flags = 0, - wp* outRecipient = NULL); - - virtual void attachObject( const void* objectID, - void* object, - void* cleanupCookie, - object_cleanup_func func); - virtual void* findObject(const void* objectID) const; - virtual void detachObject(const void* objectID); - - virtual BpBinder* remoteBinder(); - - status_t setConstantData(const void* data, size_t size); - void sendObituary(); - - class ObjectManager - { - public: - ObjectManager(); - ~ObjectManager(); - - void attach( const void* objectID, - void* object, - void* cleanupCookie, - IBinder::object_cleanup_func func); - void* find(const void* objectID) const; - void detach(const void* objectID); - - void kill(); - - private: - ObjectManager(const ObjectManager&); - ObjectManager& operator=(const ObjectManager&); - - struct entry_t - { - void* object; - void* cleanupCookie; - IBinder::object_cleanup_func func; - }; - - KeyedVector mObjects; - }; - -protected: - virtual ~BpBinder(); - virtual void onFirstRef(); - virtual void onLastStrongRef(const void* id); - virtual bool onIncStrongAttempted(uint32_t flags, const void* id); - -private: - const int32_t mHandle; - - struct Obituary { - wp recipient; - void* cookie; - uint32_t flags; - }; - - void reportOneDeath(const Obituary& obit); - bool isDescriptorCached() const; - - mutable Mutex mLock; - volatile int32_t mAlive; - volatile int32_t mObitsSent; - Vector* mObituaries; - ObjectManager mObjects; - Parcel* mConstantData; - mutable String16 mDescriptorCache; -}; - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_BPBINDER_H diff --git a/external/android/include/19/frameworks/native/include/binder/BufferedTextOutput.h b/external/android/include/19/frameworks/native/include/binder/BufferedTextOutput.h deleted file mode 100644 index 9a7c43b..0000000 --- a/external/android/include/19/frameworks/native/include/binder/BufferedTextOutput.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2006 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_BUFFEREDTEXTOUTPUT_H -#define ANDROID_BUFFEREDTEXTOUTPUT_H - -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -class BufferedTextOutput : public TextOutput -{ -public: - //** Flags for constructor */ - enum { - MULTITHREADED = 0x0001 - }; - - BufferedTextOutput(uint32_t flags = 0); - virtual ~BufferedTextOutput(); - - virtual status_t print(const char* txt, size_t len); - virtual void moveIndent(int delta); - - virtual void pushBundle(); - virtual void popBundle(); - -protected: - virtual status_t writeLines(const struct iovec& vec, size_t N) = 0; - -private: - struct BufferState; - struct ThreadState; - - static ThreadState*getThreadState(); - static void threadDestructor(void *st); - - BufferState*getBuffer() const; - - uint32_t mFlags; - const int32_t mSeq; - const int32_t mIndex; - - Mutex mLock; - BufferState* mGlobalState; -}; - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_BUFFEREDTEXTOUTPUT_H diff --git a/external/android/include/19/frameworks/native/include/binder/Debug.h b/external/android/include/19/frameworks/native/include/binder/Debug.h deleted file mode 100644 index f6a3355..0000000 --- a/external/android/include/19/frameworks/native/include/binder/Debug.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2005 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_BINDER_DEBUG_H -#define ANDROID_BINDER_DEBUG_H - -#include -#include - -namespace android { -// --------------------------------------------------------------------------- - -#ifdef __cplusplus -extern "C" { -#endif - -const char* stringForIndent(int32_t indentLevel); - -typedef void (*debugPrintFunc)(void* cookie, const char* txt); - -void printTypeCode(uint32_t typeCode, - debugPrintFunc func = 0, void* cookie = 0); - -void printHexData(int32_t indent, const void *buf, size_t length, - size_t bytesPerLine=16, int32_t singleLineBytesCutoff=16, - size_t alignment=0, bool cArrayStyle=false, - debugPrintFunc func = 0, void* cookie = 0); - -#ifdef __cplusplus -} -#endif - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_BINDER_DEBUG_H diff --git a/external/android/include/19/frameworks/native/include/binder/IAppOpsCallback.h b/external/android/include/19/frameworks/native/include/binder/IAppOpsCallback.h deleted file mode 100644 index 7f8eb01..0000000 --- a/external/android/include/19/frameworks/native/include/binder/IAppOpsCallback.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2013 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_IAPP_OPS_CALLBACK_H -#define ANDROID_IAPP_OPS_CALLBACK_H - -#include - -namespace android { - -// ---------------------------------------------------------------------- - -class IAppOpsCallback : public IInterface -{ -public: - DECLARE_META_INTERFACE(AppOpsCallback); - - virtual void opChanged(int32_t op, const String16& packageName) = 0; - - enum { - OP_CHANGED_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION - }; -}; - -// ---------------------------------------------------------------------- - -class BnAppOpsCallback : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IAPP_OPS_CALLBACK_H - diff --git a/external/android/include/19/frameworks/native/include/binder/IAppOpsService.h b/external/android/include/19/frameworks/native/include/binder/IAppOpsService.h deleted file mode 100644 index 193e9cc..0000000 --- a/external/android/include/19/frameworks/native/include/binder/IAppOpsService.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2013 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_IAPP_OPS_SERVICE_H -#define ANDROID_IAPP_OPS_SERVICE_H - -#include -#include - -namespace android { - -// ---------------------------------------------------------------------- - -class IAppOpsService : public IInterface -{ -public: - DECLARE_META_INTERFACE(AppOpsService); - - virtual int32_t checkOperation(int32_t code, int32_t uid, const String16& packageName) = 0; - virtual int32_t noteOperation(int32_t code, int32_t uid, const String16& packageName) = 0; - virtual int32_t startOperation(const sp& token, int32_t code, int32_t uid, - const String16& packageName) = 0; - virtual void finishOperation(const sp& token, int32_t code, int32_t uid, - const String16& packageName) = 0; - virtual void startWatchingMode(int32_t op, const String16& packageName, - const sp& callback) = 0; - virtual void stopWatchingMode(const sp& callback) = 0; - virtual sp getToken(const sp& clientToken) = 0; - - enum { - CHECK_OPERATION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION, - NOTE_OPERATION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+1, - START_OPERATION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+2, - FINISH_OPERATION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+3, - START_WATCHING_MODE_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+4, - STOP_WATCHING_MODE_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+5, - GET_TOKEN_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION+6, - }; - - enum { - MODE_ALLOWED = 0, - MODE_IGNORED = 1, - MODE_ERRORED = 2 - }; -}; - -// ---------------------------------------------------------------------- - -class BnAppOpsService : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IAPP_OPS_SERVICE_H diff --git a/external/android/include/19/frameworks/native/include/binder/IBinder.h b/external/android/include/19/frameworks/native/include/binder/IBinder.h deleted file mode 100644 index 8b84951..0000000 --- a/external/android/include/19/frameworks/native/include/binder/IBinder.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_IBINDER_H -#define ANDROID_IBINDER_H - -#include -#include -#include -#include - - -#define B_PACK_CHARS(c1, c2, c3, c4) \ - ((((c1)<<24)) | (((c2)<<16)) | (((c3)<<8)) | (c4)) - -// --------------------------------------------------------------------------- -namespace android { - -class BBinder; -class BpBinder; -class IInterface; -class Parcel; - -/** - * Base class and low-level protocol for a remotable object. - * You can derive from this class to create an object for which other - * processes can hold references to it. Communication between processes - * (method calls, property get and set) is down through a low-level - * protocol implemented on top of the transact() API. - */ -class IBinder : public virtual RefBase -{ -public: - enum { - FIRST_CALL_TRANSACTION = 0x00000001, - LAST_CALL_TRANSACTION = 0x00ffffff, - - PING_TRANSACTION = B_PACK_CHARS('_','P','N','G'), - DUMP_TRANSACTION = B_PACK_CHARS('_','D','M','P'), - INTERFACE_TRANSACTION = B_PACK_CHARS('_', 'N', 'T', 'F'), - SYSPROPS_TRANSACTION = B_PACK_CHARS('_', 'S', 'P', 'R'), - - // Corresponds to TF_ONE_WAY -- an asynchronous call. - FLAG_ONEWAY = 0x00000001 - }; - - IBinder(); - - /** - * Check if this IBinder implements the interface named by - * @a descriptor. If it does, the base pointer to it is returned, - * which you can safely static_cast<> to the concrete C++ interface. - */ - virtual sp queryLocalInterface(const String16& descriptor); - - /** - * Return the canonical name of the interface provided by this IBinder - * object. - */ - virtual const String16& getInterfaceDescriptor() const = 0; - - virtual bool isBinderAlive() const = 0; - virtual status_t pingBinder() = 0; - virtual status_t dump(int fd, const Vector& args) = 0; - - virtual status_t transact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0) = 0; - - /** - * This method allows you to add data that is transported through - * IPC along with your IBinder pointer. When implementing a Binder - * object, override it to write your desired data in to @a outData. - * You can then call getConstantData() on your IBinder to retrieve - * that data, from any process. You MUST return the number of bytes - * written in to the parcel (including padding). - */ - class DeathRecipient : public virtual RefBase - { - public: - virtual void binderDied(const wp& who) = 0; - }; - - /** - * Register the @a recipient for a notification if this binder - * goes away. If this binder object unexpectedly goes away - * (typically because its hosting process has been killed), - * then DeathRecipient::binderDied() will be called with a reference - * to this. - * - * The @a cookie is optional -- if non-NULL, it should be a - * memory address that you own (that is, you know it is unique). - * - * @note You will only receive death notifications for remote binders, - * as local binders by definition can't die without you dying as well. - * Trying to use this function on a local binder will result in an - * INVALID_OPERATION code being returned and nothing happening. - * - * @note This link always holds a weak reference to its recipient. - * - * @note You will only receive a weak reference to the dead - * binder. You should not try to promote this to a strong reference. - * (Nor should you need to, as there is nothing useful you can - * directly do with it now that it has passed on.) - */ - virtual status_t linkToDeath(const sp& recipient, - void* cookie = NULL, - uint32_t flags = 0) = 0; - - /** - * Remove a previously registered death notification. - * The @a recipient will no longer be called if this object - * dies. The @a cookie is optional. If non-NULL, you can - * supply a NULL @a recipient, and the recipient previously - * added with that cookie will be unlinked. - */ - virtual status_t unlinkToDeath( const wp& recipient, - void* cookie = NULL, - uint32_t flags = 0, - wp* outRecipient = NULL) = 0; - - virtual bool checkSubclass(const void* subclassID) const; - - typedef void (*object_cleanup_func)(const void* id, void* obj, void* cleanupCookie); - - virtual void attachObject( const void* objectID, - void* object, - void* cleanupCookie, - object_cleanup_func func) = 0; - virtual void* findObject(const void* objectID) const = 0; - virtual void detachObject(const void* objectID) = 0; - - virtual BBinder* localBinder(); - virtual BpBinder* remoteBinder(); - -protected: - virtual ~IBinder(); - -private: -}; - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_IBINDER_H diff --git a/external/android/include/19/frameworks/native/include/binder/IInterface.h b/external/android/include/19/frameworks/native/include/binder/IInterface.h deleted file mode 100644 index 5f9f69c..0000000 --- a/external/android/include/19/frameworks/native/include/binder/IInterface.h +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (C) 2005 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_IINTERFACE_H -#define ANDROID_IINTERFACE_H - -#include - -namespace android { - -// ---------------------------------------------------------------------- - -class IInterface : public virtual RefBase -{ -public: - IInterface(); - sp asBinder(); - sp asBinder() const; - -protected: - virtual ~IInterface(); - virtual IBinder* onAsBinder() = 0; -}; - -// ---------------------------------------------------------------------- - -template -inline sp interface_cast(const sp& obj) -{ - return INTERFACE::asInterface(obj); -} - -// ---------------------------------------------------------------------- - -template -class BnInterface : public INTERFACE, public BBinder -{ -public: - virtual sp queryLocalInterface(const String16& _descriptor); - virtual const String16& getInterfaceDescriptor() const; - -protected: - virtual IBinder* onAsBinder(); -}; - -// ---------------------------------------------------------------------- - -template -class BpInterface : public INTERFACE, public BpRefBase -{ -public: - BpInterface(const sp& remote); - -protected: - virtual IBinder* onAsBinder(); -}; - -// ---------------------------------------------------------------------- - -#define DECLARE_META_INTERFACE(INTERFACE) \ - static const android::String16 descriptor; \ - static android::sp asInterface( \ - const android::sp& obj); \ - virtual const android::String16& getInterfaceDescriptor() const; \ - I##INTERFACE(); \ - virtual ~I##INTERFACE(); \ - - -#define IMPLEMENT_META_INTERFACE(INTERFACE, NAME) \ - const android::String16 I##INTERFACE::descriptor(NAME); \ - const android::String16& \ - I##INTERFACE::getInterfaceDescriptor() const { \ - return I##INTERFACE::descriptor; \ - } \ - android::sp I##INTERFACE::asInterface( \ - const android::sp& obj) \ - { \ - android::sp intr; \ - if (obj != NULL) { \ - intr = static_cast( \ - obj->queryLocalInterface( \ - I##INTERFACE::descriptor).get()); \ - if (intr == NULL) { \ - intr = new Bp##INTERFACE(obj); \ - } \ - } \ - return intr; \ - } \ - I##INTERFACE::I##INTERFACE() { } \ - I##INTERFACE::~I##INTERFACE() { } \ - - -#define CHECK_INTERFACE(interface, data, reply) \ - if (!data.checkInterface(this)) { return PERMISSION_DENIED; } \ - - -// ---------------------------------------------------------------------- -// No user-serviceable parts after this... - -template -inline sp BnInterface::queryLocalInterface( - const String16& _descriptor) -{ - if (_descriptor == INTERFACE::descriptor) return this; - return NULL; -} - -template -inline const String16& BnInterface::getInterfaceDescriptor() const -{ - return INTERFACE::getInterfaceDescriptor(); -} - -template -IBinder* BnInterface::onAsBinder() -{ - return this; -} - -template -inline BpInterface::BpInterface(const sp& remote) - : BpRefBase(remote) -{ -} - -template -inline IBinder* BpInterface::onAsBinder() -{ - return remote(); -} - -// ---------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IINTERFACE_H diff --git a/external/android/include/19/frameworks/native/include/binder/IMemory.h b/external/android/include/19/frameworks/native/include/binder/IMemory.h deleted file mode 100644 index 2d0db00..0000000 --- a/external/android/include/19/frameworks/native/include/binder/IMemory.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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_IMEMORY_H -#define ANDROID_IMEMORY_H - -#include -#include -#include - -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------------- - -class IMemoryHeap : public IInterface -{ -public: - DECLARE_META_INTERFACE(MemoryHeap); - - // flags returned by getFlags() - enum { - READ_ONLY = 0x00000001 - }; - - virtual int getHeapID() const = 0; - virtual void* getBase() const = 0; - virtual size_t getSize() const = 0; - virtual uint32_t getFlags() const = 0; - virtual uint32_t getOffset() const = 0; - - // these are there just for backward source compatibility - int32_t heapID() const { return getHeapID(); } - void* base() const { return getBase(); } - size_t virtualSize() const { return getSize(); } -}; - -class BnMemoryHeap : public BnInterface -{ -public: - virtual status_t onTransact( - uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); - - BnMemoryHeap(); -protected: - virtual ~BnMemoryHeap(); -}; - -// ---------------------------------------------------------------------------- - -class IMemory : public IInterface -{ -public: - DECLARE_META_INTERFACE(Memory); - - virtual sp getMemory(ssize_t* offset=0, size_t* size=0) const = 0; - - // helpers - void* fastPointer(const sp& heap, ssize_t offset) const; - void* pointer() const; - size_t size() const; - ssize_t offset() const; -}; - -class BnMemory : public BnInterface -{ -public: - virtual status_t onTransact( - uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); - - BnMemory(); -protected: - virtual ~BnMemory(); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IMEMORY_H diff --git a/external/android/include/19/frameworks/native/include/binder/IPCThreadState.h b/external/android/include/19/frameworks/native/include/binder/IPCThreadState.h deleted file mode 100644 index 5bc123e..0000000 --- a/external/android/include/19/frameworks/native/include/binder/IPCThreadState.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (C) 2005 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_IPC_THREAD_STATE_H -#define ANDROID_IPC_THREAD_STATE_H - -#include -#include -#include -#include - -#ifdef HAVE_WIN32_PROC -typedef int uid_t; -#endif - -// --------------------------------------------------------------------------- -namespace android { - -class IPCThreadState -{ -public: - static IPCThreadState* self(); - static IPCThreadState* selfOrNull(); // self(), but won't instantiate - - sp process(); - - status_t clearLastError(); - - int getCallingPid() const; - int getCallingUid() const; - - void setStrictModePolicy(int32_t policy); - int32_t getStrictModePolicy() const; - - void setLastTransactionBinderFlags(int32_t flags); - int32_t getLastTransactionBinderFlags() const; - - int64_t clearCallingIdentity(); - void restoreCallingIdentity(int64_t token); - - int setupPolling(int* fd); - status_t handlePolledCommands(); - void flushCommands(); - - void joinThreadPool(bool isMain = true); - - // Stop the local process. - void stopProcess(bool immediate = true); - - status_t transact(int32_t handle, - uint32_t code, const Parcel& data, - Parcel* reply, uint32_t flags); - - void incStrongHandle(int32_t handle); - void decStrongHandle(int32_t handle); - void incWeakHandle(int32_t handle); - void decWeakHandle(int32_t handle); - status_t attemptIncStrongHandle(int32_t handle); - static void expungeHandle(int32_t handle, IBinder* binder); - status_t requestDeathNotification( int32_t handle, - BpBinder* proxy); - status_t clearDeathNotification( int32_t handle, - BpBinder* proxy); - - static void shutdown(); - - // Call this to disable switching threads to background scheduling when - // receiving incoming IPC calls. This is specifically here for the - // Android system process, since it expects to have background apps calling - // in to it but doesn't want to acquire locks in its services while in - // the background. - static void disableBackgroundScheduling(bool disable); - -private: - IPCThreadState(); - ~IPCThreadState(); - - status_t sendReply(const Parcel& reply, uint32_t flags); - status_t waitForResponse(Parcel *reply, - status_t *acquireResult=NULL); - status_t talkWithDriver(bool doReceive=true); - status_t writeTransactionData(int32_t cmd, - uint32_t binderFlags, - int32_t handle, - uint32_t code, - const Parcel& data, - status_t* statusBuffer); - status_t getAndExecuteCommand(); - status_t executeCommand(int32_t command); - void processPendingDerefs(); - - void clearCaller(); - - static void threadDestructor(void *st); - static void freeBuffer(Parcel* parcel, - const uint8_t* data, size_t dataSize, - const size_t* objects, size_t objectsSize, - void* cookie); - - const sp mProcess; - const pid_t mMyThreadId; - Vector mPendingStrongDerefs; - Vector mPendingWeakDerefs; - - Parcel mIn; - Parcel mOut; - status_t mLastError; - pid_t mCallingPid; - uid_t mCallingUid; - int32_t mStrictModePolicy; - int32_t mLastTransactionBinderFlags; -}; - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_IPC_THREAD_STATE_H diff --git a/external/android/include/19/frameworks/native/include/binder/IPermissionController.h b/external/android/include/19/frameworks/native/include/binder/IPermissionController.h deleted file mode 100644 index f9d371b..0000000 --- a/external/android/include/19/frameworks/native/include/binder/IPermissionController.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2005 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_IPERMISSION_CONTROLLER_H -#define ANDROID_IPERMISSION_CONTROLLER_H - -#include - -namespace android { - -// ---------------------------------------------------------------------- - -class IPermissionController : public IInterface -{ -public: - DECLARE_META_INTERFACE(PermissionController); - - virtual bool checkPermission(const String16& permission, - int32_t pid, int32_t uid) = 0; - - enum { - CHECK_PERMISSION_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION - }; -}; - -// ---------------------------------------------------------------------- - -class BnPermissionController : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_IPERMISSION_CONTROLLER_H - diff --git a/external/android/include/19/frameworks/native/include/binder/IServiceManager.h b/external/android/include/19/frameworks/native/include/binder/IServiceManager.h deleted file mode 100644 index 2c297d6..0000000 --- a/external/android/include/19/frameworks/native/include/binder/IServiceManager.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2005 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_ISERVICE_MANAGER_H -#define ANDROID_ISERVICE_MANAGER_H - -#include -#include -#include -#include - -namespace android { - -// ---------------------------------------------------------------------- - -class IServiceManager : public IInterface -{ -public: - DECLARE_META_INTERFACE(ServiceManager); - - /** - * Retrieve an existing service, blocking for a few seconds - * if it doesn't yet exist. - */ - virtual sp getService( const String16& name) const = 0; - - /** - * Retrieve an existing service, non-blocking. - */ - virtual sp checkService( const String16& name) const = 0; - - /** - * Register a service. - */ - virtual status_t addService( const String16& name, - const sp& service, - bool allowIsolated = false) = 0; - - /** - * Return list of all existing services. - */ - virtual Vector listServices() = 0; - - enum { - GET_SERVICE_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION, - CHECK_SERVICE_TRANSACTION, - ADD_SERVICE_TRANSACTION, - LIST_SERVICES_TRANSACTION, - }; -}; - -sp defaultServiceManager(); - -template -status_t getService(const String16& name, sp* outService) -{ - const sp sm = defaultServiceManager(); - if (sm != NULL) { - *outService = interface_cast(sm->getService(name)); - if ((*outService) != NULL) return NO_ERROR; - } - return NAME_NOT_FOUND; -} - -bool checkCallingPermission(const String16& permission); -bool checkCallingPermission(const String16& permission, - int32_t* outPid, int32_t* outUid); -bool checkPermission(const String16& permission, pid_t pid, uid_t uid); - - -// ---------------------------------------------------------------------- - -class BnServiceManager : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_ISERVICE_MANAGER_H - diff --git a/external/android/include/19/frameworks/native/include/binder/MemoryBase.h b/external/android/include/19/frameworks/native/include/binder/MemoryBase.h deleted file mode 100644 index 463e26d..0000000 --- a/external/android/include/19/frameworks/native/include/binder/MemoryBase.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_MEMORY_BASE_H -#define ANDROID_MEMORY_BASE_H - -#include -#include - -#include - - -namespace android { - -// --------------------------------------------------------------------------- - -class MemoryBase : public BnMemory -{ -public: - MemoryBase(const sp& heap, ssize_t offset, size_t size); - virtual ~MemoryBase(); - virtual sp getMemory(ssize_t* offset, size_t* size) const; - -protected: - size_t getSize() const { return mSize; } - ssize_t getOffset() const { return mOffset; } - const sp& getHeap() const { return mHeap; } - -private: - size_t mSize; - ssize_t mOffset; - sp mHeap; -}; - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_MEMORY_BASE_H diff --git a/external/android/include/19/frameworks/native/include/binder/MemoryDealer.h b/external/android/include/19/frameworks/native/include/binder/MemoryDealer.h deleted file mode 100644 index 170f20d..0000000 --- a/external/android/include/19/frameworks/native/include/binder/MemoryDealer.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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_MEMORY_DEALER_H -#define ANDROID_MEMORY_DEALER_H - - -#include -#include - -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class SimpleBestFitAllocator; - -// ---------------------------------------------------------------------------- - -class MemoryDealer : public RefBase -{ -public: - MemoryDealer(size_t size, const char* name = 0); - - virtual sp allocate(size_t size); - virtual void deallocate(size_t offset); - virtual void dump(const char* what) const; - - sp getMemoryHeap() const { return heap(); } - -protected: - virtual ~MemoryDealer(); - -private: - const sp& heap() const; - SimpleBestFitAllocator* allocator() const; - - sp mHeap; - SimpleBestFitAllocator* mAllocator; -}; - - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_MEMORY_DEALER_H diff --git a/external/android/include/19/frameworks/native/include/binder/MemoryHeapBase.h b/external/android/include/19/frameworks/native/include/binder/MemoryHeapBase.h deleted file mode 100644 index ea9b66c..0000000 --- a/external/android/include/19/frameworks/native/include/binder/MemoryHeapBase.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_MEMORY_HEAP_BASE_H -#define ANDROID_MEMORY_HEAP_BASE_H - -#include -#include - -#include - - -namespace android { - -// --------------------------------------------------------------------------- - -class MemoryHeapBase : public virtual BnMemoryHeap -{ -public: - enum { - READ_ONLY = IMemoryHeap::READ_ONLY, - // memory won't be mapped locally, but will be mapped in the remote - // process. - DONT_MAP_LOCALLY = 0x00000100, - NO_CACHING = 0x00000200 - }; - - /* - * maps the memory referenced by fd. but DOESN'T take ownership - * of the filedescriptor (it makes a copy with dup() - */ - MemoryHeapBase(int fd, size_t size, uint32_t flags = 0, uint32_t offset = 0); - - /* - * maps memory from the given device - */ - MemoryHeapBase(const char* device, size_t size = 0, uint32_t flags = 0); - - /* - * maps memory from ashmem, with the given name for debugging - */ - MemoryHeapBase(size_t size, uint32_t flags = 0, char const* name = NULL); - - virtual ~MemoryHeapBase(); - - /* implement IMemoryHeap interface */ - virtual int getHeapID() const; - - /* virtual address of the heap. returns MAP_FAILED in case of error */ - virtual void* getBase() const; - - virtual size_t getSize() const; - virtual uint32_t getFlags() const; - virtual uint32_t getOffset() const; - - const char* getDevice() const; - - /* this closes this heap -- use carefully */ - void dispose(); - - /* this is only needed as a workaround, use only if you know - * what you are doing */ - status_t setDevice(const char* device) { - if (mDevice == 0) - mDevice = device; - return mDevice ? NO_ERROR : ALREADY_EXISTS; - } - -protected: - MemoryHeapBase(); - // init() takes ownership of fd - status_t init(int fd, void *base, int size, - int flags = 0, const char* device = NULL); - -private: - status_t mapfd(int fd, size_t size, uint32_t offset = 0); - - int mFD; - size_t mSize; - void* mBase; - uint32_t mFlags; - const char* mDevice; - bool mNeedUnmap; - uint32_t mOffset; -}; - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_MEMORY_HEAP_BASE_H diff --git a/external/android/include/19/frameworks/native/include/binder/Parcel.h b/external/android/include/19/frameworks/native/include/binder/Parcel.h deleted file mode 100644 index 7a782f5..0000000 --- a/external/android/include/19/frameworks/native/include/binder/Parcel.h +++ /dev/null @@ -1,395 +0,0 @@ -/* - * Copyright (C) 2005 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_PARCEL_H -#define ANDROID_PARCEL_H - -#include -#include -#include -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -template class Flattenable; -template class LightFlattenable; -class IBinder; -class IPCThreadState; -class ProcessState; -class String8; -class TextOutput; - -struct flat_binder_object; // defined in support_p/binder_module.h - -class Parcel { -public: - class ReadableBlob; - class WritableBlob; - - Parcel(); - ~Parcel(); - - const uint8_t* data() const; - size_t dataSize() const; - size_t dataAvail() const; - size_t dataPosition() const; - size_t dataCapacity() const; - - status_t setDataSize(size_t size); - void setDataPosition(size_t pos) const; - status_t setDataCapacity(size_t size); - - status_t setData(const uint8_t* buffer, size_t len); - - status_t appendFrom(const Parcel *parcel, - size_t start, size_t len); - - bool pushAllowFds(bool allowFds); - void restoreAllowFds(bool lastValue); - - bool hasFileDescriptors() const; - - // Writes the RPC header. - status_t writeInterfaceToken(const String16& interface); - - // Parses the RPC header, returning true if the interface name - // in the header matches the expected interface from the caller. - // - // Additionally, enforceInterface does part of the work of - // propagating the StrictMode policy mask, populating the current - // IPCThreadState, which as an optimization may optionally be - // passed in. - bool enforceInterface(const String16& interface, - IPCThreadState* threadState = NULL) const; - bool checkInterface(IBinder*) const; - - void freeData(); - - const size_t* objects() const; - size_t objectsCount() const; - - status_t errorCheck() const; - void setError(status_t err); - - status_t write(const void* data, size_t len); - void* writeInplace(size_t len); - status_t writeUnpadded(const void* data, size_t len); - status_t writeInt32(int32_t val); - status_t writeInt64(int64_t val); - status_t writeFloat(float val); - status_t writeDouble(double val); - status_t writeIntPtr(intptr_t val); - status_t writeCString(const char* str); - status_t writeString8(const String8& str); - status_t writeString16(const String16& str); - status_t writeString16(const char16_t* str, size_t len); - status_t writeStrongBinder(const sp& val); - status_t writeWeakBinder(const wp& val); - - template - status_t write(const Flattenable& val); - - template - status_t write(const LightFlattenable& val); - - - // Place a native_handle into the parcel (the native_handle's file- - // descriptors are dup'ed, so it is safe to delete the native_handle - // when this function returns). - // Doesn't take ownership of the native_handle. - status_t writeNativeHandle(const native_handle* handle); - - // Place a file descriptor into the parcel. The given fd must remain - // valid for the lifetime of the parcel. - // The Parcel does not take ownership of the given fd unless you ask it to. - status_t writeFileDescriptor(int fd, bool takeOwnership = false); - - // Place a file descriptor into the parcel. A dup of the fd is made, which - // will be closed once the parcel is destroyed. - status_t writeDupFileDescriptor(int fd); - - // Writes a blob to the parcel. - // If the blob is small, then it is stored in-place, otherwise it is - // transferred by way of an anonymous shared memory region. - // The caller should call release() on the blob after writing its contents. - status_t writeBlob(size_t len, WritableBlob* outBlob); - - status_t writeObject(const flat_binder_object& val, bool nullMetaData); - - // Like Parcel.java's writeNoException(). Just writes a zero int32. - // Currently the native implementation doesn't do any of the StrictMode - // stack gathering and serialization that the Java implementation does. - status_t writeNoException(); - - void remove(size_t start, size_t amt); - - status_t read(void* outData, size_t len) const; - const void* readInplace(size_t len) const; - int32_t readInt32() const; - status_t readInt32(int32_t *pArg) const; - int64_t readInt64() const; - status_t readInt64(int64_t *pArg) const; - float readFloat() const; - status_t readFloat(float *pArg) const; - double readDouble() const; - status_t readDouble(double *pArg) const; - intptr_t readIntPtr() const; - status_t readIntPtr(intptr_t *pArg) const; - - const char* readCString() const; - String8 readString8() const; - String16 readString16() const; - const char16_t* readString16Inplace(size_t* outLen) const; - sp readStrongBinder() const; - wp readWeakBinder() const; - - template - status_t read(Flattenable& val) const; - - template - status_t read(LightFlattenable& val) const; - - // Like Parcel.java's readExceptionCode(). Reads the first int32 - // off of a Parcel's header, returning 0 or the negative error - // code on exceptions, but also deals with skipping over rich - // response headers. Callers should use this to read & parse the - // response headers rather than doing it by hand. - int32_t readExceptionCode() const; - - // Retrieve native_handle from the parcel. This returns a copy of the - // parcel's native_handle (the caller takes ownership). The caller - // must free the native_handle with native_handle_close() and - // native_handle_delete(). - native_handle* readNativeHandle() const; - - - // Retrieve a file descriptor from the parcel. This returns the raw fd - // in the parcel, which you do not own -- use dup() to get your own copy. - int readFileDescriptor() const; - - // Reads a blob from the parcel. - // The caller should call release() on the blob after reading its contents. - status_t readBlob(size_t len, ReadableBlob* outBlob) const; - - const flat_binder_object* readObject(bool nullMetaData) const; - - // Explicitly close all file descriptors in the parcel. - void closeFileDescriptors(); - - typedef void (*release_func)(Parcel* parcel, - const uint8_t* data, size_t dataSize, - const size_t* objects, size_t objectsSize, - void* cookie); - - const uint8_t* ipcData() const; - size_t ipcDataSize() const; - const size_t* ipcObjects() const; - size_t ipcObjectsCount() const; - void ipcSetDataReference(const uint8_t* data, size_t dataSize, - const size_t* objects, size_t objectsCount, - release_func relFunc, void* relCookie); - - void print(TextOutput& to, uint32_t flags = 0) const; - -private: - Parcel(const Parcel& o); - Parcel& operator=(const Parcel& o); - - status_t finishWrite(size_t len); - void releaseObjects(); - void acquireObjects(); - status_t growData(size_t len); - status_t restartWrite(size_t desired); - status_t continueWrite(size_t desired); - void freeDataNoInit(); - void initState(); - void scanForFds() const; - - template - status_t readAligned(T *pArg) const; - - template T readAligned() const; - - template - status_t writeAligned(T val); - - status_t mError; - uint8_t* mData; - size_t mDataSize; - size_t mDataCapacity; - mutable size_t mDataPos; - size_t* mObjects; - size_t mObjectsSize; - size_t mObjectsCapacity; - mutable size_t mNextObjectHint; - - mutable bool mFdsKnown; - mutable bool mHasFds; - bool mAllowFds; - - release_func mOwner; - void* mOwnerCookie; - - class Blob { - public: - Blob(); - ~Blob(); - - void release(); - inline size_t size() const { return mSize; } - - protected: - void init(bool mapped, void* data, size_t size); - void clear(); - - bool mMapped; - void* mData; - size_t mSize; - }; - - class FlattenableHelperInterface { - protected: - ~FlattenableHelperInterface() { } - public: - virtual size_t getFlattenedSize() const = 0; - virtual size_t getFdCount() const = 0; - virtual status_t flatten(void* buffer, size_t size, int* fds, size_t count) const = 0; - virtual status_t unflatten(void const* buffer, size_t size, int const* fds, size_t count) = 0; - }; - - template - class FlattenableHelper : public FlattenableHelperInterface { - friend class Parcel; - const Flattenable& val; - explicit FlattenableHelper(const Flattenable& val) : val(val) { } - - public: - virtual size_t getFlattenedSize() const { - return val.getFlattenedSize(); - } - virtual size_t getFdCount() const { - return val.getFdCount(); - } - virtual status_t flatten(void* buffer, size_t size, int* fds, size_t count) const { - return val.flatten(buffer, size, fds, count); - } - virtual status_t unflatten(void const* buffer, size_t size, int const* fds, size_t count) { - return const_cast&>(val).unflatten(buffer, size, fds, count); - } - }; - status_t write(const FlattenableHelperInterface& val); - status_t read(FlattenableHelperInterface& val) const; - -public: - class ReadableBlob : public Blob { - friend class Parcel; - public: - inline const void* data() const { return mData; } - }; - - class WritableBlob : public Blob { - friend class Parcel; - public: - inline void* data() { return mData; } - }; -}; - -// --------------------------------------------------------------------------- - -template -status_t Parcel::write(const Flattenable& val) { - const FlattenableHelper helper(val); - return write(helper); -} - -template -status_t Parcel::write(const LightFlattenable& val) { - size_t size(val.getFlattenedSize()); - if (!val.isFixedSize()) { - status_t err = writeInt32(size); - if (err != NO_ERROR) { - return err; - } - } - if (size) { - void* buffer = writeInplace(size); - if (buffer == NULL) - return NO_MEMORY; - return val.flatten(buffer, size); - } - return NO_ERROR; -} - -template -status_t Parcel::read(Flattenable& val) const { - FlattenableHelper helper(val); - return read(helper); -} - -template -status_t Parcel::read(LightFlattenable& val) const { - size_t size; - if (val.isFixedSize()) { - size = val.getFlattenedSize(); - } else { - int32_t s; - status_t err = readInt32(&s); - if (err != NO_ERROR) { - return err; - } - size = s; - } - if (size) { - void const* buffer = readInplace(size); - return buffer == NULL ? NO_MEMORY : - val.unflatten(buffer, size); - } - return NO_ERROR; -} - -// --------------------------------------------------------------------------- - -inline TextOutput& operator<<(TextOutput& to, const Parcel& parcel) -{ - parcel.print(to); - return to; -} - -// --------------------------------------------------------------------------- - -// Generic acquire and release of objects. -void acquire_object(const sp& proc, - const flat_binder_object& obj, const void* who); -void release_object(const sp& proc, - const flat_binder_object& obj, const void* who); - -void flatten_binder(const sp& proc, - const sp& binder, flat_binder_object* out); -void flatten_binder(const sp& proc, - const wp& binder, flat_binder_object* out); -status_t unflatten_binder(const sp& proc, - const flat_binder_object& flat, sp* out); -status_t unflatten_binder(const sp& proc, - const flat_binder_object& flat, wp* out); - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_PARCEL_H diff --git a/external/android/include/19/frameworks/native/include/binder/PermissionCache.h b/external/android/include/19/frameworks/native/include/binder/PermissionCache.h deleted file mode 100644 index bcdf0c2..0000000 --- a/external/android/include/19/frameworks/native/include/binder/PermissionCache.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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 BINDER_PERMISSION_H -#define BINDER_PERMISSION_H - -#include -#include - -#include -#include -#include - -namespace android { -// --------------------------------------------------------------------------- - -/* - * PermissionCache caches permission checks for a given uid. - * - * Currently the cache is not updated when there is a permission change, - * for instance when an application is uninstalled. - * - * IMPORTANT: for the reason stated above, only system permissions are safe - * to cache. This restriction may be lifted at a later time. - * - */ - -class PermissionCache : Singleton { - struct Entry { - String16 name; - uid_t uid; - bool granted; - inline bool operator < (const Entry& e) const { - return (uid == e.uid) ? (name < e.name) : (uid < e.uid); - } - }; - mutable Mutex mLock; - // we pool all the permission names we see, as many permissions checks - // will have identical names - SortedVector< String16 > mPermissionNamesPool; - // this is our cache per say. it stores pooled names. - SortedVector< Entry > mCache; - - // free the whole cache, but keep the permission name pool - void purge(); - - status_t check(bool* granted, - const String16& permission, uid_t uid) const; - - void cache(const String16& permission, uid_t uid, bool granted); - -public: - PermissionCache(); - - static bool checkCallingPermission(const String16& permission); - - static bool checkCallingPermission(const String16& permission, - int32_t* outPid, int32_t* outUid); - - static bool checkPermission(const String16& permission, - pid_t pid, uid_t uid); -}; - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif /* BINDER_PERMISSION_H */ diff --git a/external/android/include/19/frameworks/native/include/binder/ProcessState.h b/external/android/include/19/frameworks/native/include/binder/ProcessState.h deleted file mode 100644 index e63a0d0..0000000 --- a/external/android/include/19/frameworks/native/include/binder/ProcessState.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (C) 2005 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_PROCESS_STATE_H -#define ANDROID_PROCESS_STATE_H - -#include -#include -#include -#include - -#include - -// --------------------------------------------------------------------------- -namespace android { - -// Global variables -extern int mArgC; -extern const char* const* mArgV; -extern int mArgLen; - -class IPCThreadState; - -class ProcessState : public virtual RefBase -{ -public: - static sp self(); - - void setContextObject(const sp& object); - sp getContextObject(const sp& caller); - - void setContextObject(const sp& object, - const String16& name); - sp getContextObject(const String16& name, - const sp& caller); - - void startThreadPool(); - - typedef bool (*context_check_func)(const String16& name, - const sp& caller, - void* userData); - - bool isContextManager(void) const; - bool becomeContextManager( - context_check_func checkFunc, - void* userData); - - sp getStrongProxyForHandle(int32_t handle); - wp getWeakProxyForHandle(int32_t handle); - void expungeHandle(int32_t handle, IBinder* binder); - - void setArgs(int argc, const char* const argv[]); - int getArgC() const; - const char* const* getArgV() const; - - void setArgV0(const char* txt); - - void spawnPooledThread(bool isMain); - - status_t setThreadPoolMaxThreadCount(size_t maxThreads); - void giveThreadPoolName(); - -private: - friend class IPCThreadState; - - ProcessState(); - ~ProcessState(); - - ProcessState(const ProcessState& o); - ProcessState& operator=(const ProcessState& o); - String8 makeBinderThreadName(); - - struct handle_entry { - IBinder* binder; - RefBase::weakref_type* refs; - }; - - handle_entry* lookupHandleLocked(int32_t handle); - - int mDriverFD; - void* mVMStart; - - mutable Mutex mLock; // protects everything below. - - VectormHandleToObject; - - bool mManagesContexts; - context_check_func mBinderContextCheckFunc; - void* mBinderContextUserData; - - KeyedVector > - mContexts; - - - String8 mRootDir; - bool mThreadPoolStarted; - volatile int32_t mThreadPoolSeq; -}; - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_PROCESS_STATE_H diff --git a/external/android/include/19/frameworks/native/include/binder/TextOutput.h b/external/android/include/19/frameworks/native/include/binder/TextOutput.h deleted file mode 100644 index 974a194..0000000 --- a/external/android/include/19/frameworks/native/include/binder/TextOutput.h +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright (C) 2006 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_TEXTOUTPUT_H -#define ANDROID_TEXTOUTPUT_H - -#include - -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -class String8; -class String16; - -class TextOutput -{ -public: - TextOutput(); - virtual ~TextOutput(); - - virtual status_t print(const char* txt, size_t len) = 0; - virtual void moveIndent(int delta) = 0; - - class Bundle { - public: - inline Bundle(TextOutput& to) : mTO(to) { to.pushBundle(); } - inline ~Bundle() { mTO.popBundle(); } - private: - TextOutput& mTO; - }; - - virtual void pushBundle() = 0; - virtual void popBundle() = 0; -}; - -// --------------------------------------------------------------------------- - -// Text output stream for printing to the log (via utils/Log.h). -extern TextOutput& alog; - -// Text output stream for printing to stdout. -extern TextOutput& aout; - -// Text output stream for printing to stderr. -extern TextOutput& aerr; - -typedef TextOutput& (*TextOutputManipFunc)(TextOutput&); - -TextOutput& endl(TextOutput& to); -TextOutput& indent(TextOutput& to); -TextOutput& dedent(TextOutput& to); - -TextOutput& operator<<(TextOutput& to, const char* str); -TextOutput& operator<<(TextOutput& to, char); // writes raw character -TextOutput& operator<<(TextOutput& to, bool); -TextOutput& operator<<(TextOutput& to, int); -TextOutput& operator<<(TextOutput& to, long); -TextOutput& operator<<(TextOutput& to, unsigned int); -TextOutput& operator<<(TextOutput& to, unsigned long); -TextOutput& operator<<(TextOutput& to, long long); -TextOutput& operator<<(TextOutput& to, unsigned long long); -TextOutput& operator<<(TextOutput& to, float); -TextOutput& operator<<(TextOutput& to, double); -TextOutput& operator<<(TextOutput& to, TextOutputManipFunc func); -TextOutput& operator<<(TextOutput& to, const void*); -TextOutput& operator<<(TextOutput& to, const String8& val); -TextOutput& operator<<(TextOutput& to, const String16& val); - -class TypeCode -{ -public: - inline TypeCode(uint32_t code); - inline ~TypeCode(); - - inline uint32_t typeCode() const; - -private: - uint32_t mCode; -}; - -TextOutput& operator<<(TextOutput& to, const TypeCode& val); - -class HexDump -{ -public: - HexDump(const void *buf, size_t size, size_t bytesPerLine=16); - inline ~HexDump(); - - inline HexDump& setBytesPerLine(size_t bytesPerLine); - inline HexDump& setSingleLineCutoff(int32_t bytes); - inline HexDump& setAlignment(size_t alignment); - inline HexDump& setCArrayStyle(bool enabled); - - inline const void* buffer() const; - inline size_t size() const; - inline size_t bytesPerLine() const; - inline int32_t singleLineCutoff() const; - inline size_t alignment() const; - inline bool carrayStyle() const; - -private: - const void* mBuffer; - size_t mSize; - size_t mBytesPerLine; - int32_t mSingleLineCutoff; - size_t mAlignment; - bool mCArrayStyle; -}; - -TextOutput& operator<<(TextOutput& to, const HexDump& val); - -// --------------------------------------------------------------------------- -// No user servicable parts below. - -inline TextOutput& endl(TextOutput& to) -{ - to.print("\n", 1); - return to; -} - -inline TextOutput& indent(TextOutput& to) -{ - to.moveIndent(1); - return to; -} - -inline TextOutput& dedent(TextOutput& to) -{ - to.moveIndent(-1); - return to; -} - -inline TextOutput& operator<<(TextOutput& to, const char* str) -{ - to.print(str, strlen(str)); - return to; -} - -inline TextOutput& operator<<(TextOutput& to, char c) -{ - to.print(&c, 1); - return to; -} - -inline TextOutput& operator<<(TextOutput& to, TextOutputManipFunc func) -{ - return (*func)(to); -} - -inline TypeCode::TypeCode(uint32_t code) : mCode(code) { } -inline TypeCode::~TypeCode() { } -inline uint32_t TypeCode::typeCode() const { return mCode; } - -inline HexDump::~HexDump() { } - -inline HexDump& HexDump::setBytesPerLine(size_t bytesPerLine) { - mBytesPerLine = bytesPerLine; return *this; -} -inline HexDump& HexDump::setSingleLineCutoff(int32_t bytes) { - mSingleLineCutoff = bytes; return *this; -} -inline HexDump& HexDump::setAlignment(size_t alignment) { - mAlignment = alignment; return *this; -} -inline HexDump& HexDump::setCArrayStyle(bool enabled) { - mCArrayStyle = enabled; return *this; -} - -inline const void* HexDump::buffer() const { return mBuffer; } -inline size_t HexDump::size() const { return mSize; } -inline size_t HexDump::bytesPerLine() const { return mBytesPerLine; } -inline int32_t HexDump::singleLineCutoff() const { return mSingleLineCutoff; } -inline size_t HexDump::alignment() const { return mAlignment; } -inline bool HexDump::carrayStyle() const { return mCArrayStyle; } - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_TEXTOUTPUT_H diff --git a/external/android/include/19/frameworks/native/include/gui/BitTube.h b/external/android/include/19/frameworks/native/include/gui/BitTube.h deleted file mode 100644 index d32df84..0000000 --- a/external/android/include/19/frameworks/native/include/gui/BitTube.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_SENSOR_CHANNEL_H -#define ANDROID_GUI_SENSOR_CHANNEL_H - -#include -#include - -#include -#include -#include - - -namespace android { -// ---------------------------------------------------------------------------- -class Parcel; - -class BitTube : public RefBase -{ -public: - - // creates a BitTube with a default (4KB) send buffer - BitTube(); - - // creates a BitTube with a a specified send and receive buffer size - explicit BitTube(size_t bufsize); - - explicit BitTube(const Parcel& data); - virtual ~BitTube(); - - // check state after construction - status_t initCheck() const; - - // get receive file-descriptor - int getFd() const; - - // send objects (sized blobs). All objects are guaranteed to be written or the call fails. - template - static ssize_t sendObjects(const sp& tube, - T const* events, size_t count) { - return sendObjects(tube, events, count, sizeof(T)); - } - - // receive objects (sized blobs). If the receiving buffer isn't large enough, - // excess messages are silently discarded. - template - static ssize_t recvObjects(const sp& tube, - T* events, size_t count) { - return recvObjects(tube, events, count, sizeof(T)); - } - - // parcels this BitTube - status_t writeToParcel(Parcel* reply) const; - -private: - void init(size_t rcvbuf, size_t sndbuf); - - // send a message. The write is guaranteed to send the whole message or fail. - ssize_t write(void const* vaddr, size_t size); - - // receive a message. the passed buffer must be at least as large as the - // write call used to send the message, excess data is silently discarded. - ssize_t read(void* vaddr, size_t size); - - int mSendFd; - mutable int mReceiveFd; - - static ssize_t sendObjects(const sp& tube, - void const* events, size_t count, size_t objSize); - - static ssize_t recvObjects(const sp& tube, - void* events, size_t count, size_t objSize); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_SENSOR_CHANNEL_H diff --git a/external/android/include/19/frameworks/native/include/gui/BufferItemConsumer.h b/external/android/include/19/frameworks/native/include/gui/BufferItemConsumer.h deleted file mode 100644 index 52edf17..0000000 --- a/external/android/include/19/frameworks/native/include/gui/BufferItemConsumer.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (C) 2012 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_GUI_BUFFERITEMCONSUMER_H -#define ANDROID_GUI_BUFFERITEMCONSUMER_H - -#include - -#include - -#include -#include -#include - -#define ANDROID_GRAPHICS_BUFFERITEMCONSUMER_JNI_ID "mBufferItemConsumer" - -namespace android { - -class BufferQueue; - -/** - * BufferItemConsumer is a BufferQueue consumer endpoint that allows clients - * access to the whole BufferItem entry from BufferQueue. Multiple buffers may - * be acquired at once, to be used concurrently by the client. This consumer can - * operate either in synchronous or asynchronous mode. - */ -class BufferItemConsumer: public ConsumerBase -{ - public: - typedef ConsumerBase::FrameAvailableListener FrameAvailableListener; - - typedef BufferQueue::BufferItem BufferItem; - - enum { INVALID_BUFFER_SLOT = BufferQueue::INVALID_BUFFER_SLOT }; - enum { NO_BUFFER_AVAILABLE = BufferQueue::NO_BUFFER_AVAILABLE }; - - // Create a new buffer item consumer. The consumerUsage parameter determines - // the consumer usage flags passed to the graphics allocator. The - // bufferCount parameter specifies how many buffers can be locked for user - // access at the same time. - // controlledByApp tells whether this consumer is controlled by the - // application. - BufferItemConsumer(const sp& bq, uint32_t consumerUsage, - int bufferCount = BufferQueue::MIN_UNDEQUEUED_BUFFERS, - bool controlledByApp = false); - - virtual ~BufferItemConsumer(); - - // set the name of the BufferItemConsumer that will be used to identify it in - // log messages. - void setName(const String8& name); - - // Gets the next graphics buffer from the producer, filling out the - // passed-in BufferItem structure. Returns NO_BUFFER_AVAILABLE if the queue - // of buffers is empty, and INVALID_OPERATION if the maximum number of - // buffers is already acquired. - // - // Only a fixed number of buffers can be acquired at a time, determined by - // the construction-time bufferCount parameter. If INVALID_OPERATION is - // returned by acquireBuffer, then old buffers must be returned to the - // queue by calling releaseBuffer before more buffers can be acquired. - // - // If waitForFence is true, and the acquired BufferItem has a valid fence object, - // acquireBuffer will wait on the fence with no timeout before returning. - status_t acquireBuffer(BufferItem *item, nsecs_t presentWhen, - bool waitForFence = true); - - // Returns an acquired buffer to the queue, allowing it to be reused. Since - // only a fixed number of buffers may be acquired at a time, old buffers - // must be released by calling releaseBuffer to ensure new buffers can be - // acquired by acquireBuffer. Once a BufferItem is released, the caller must - // not access any members of the BufferItem, and should immediately remove - // all of its references to the BufferItem itself. - status_t releaseBuffer(const BufferItem &item, - const sp& releaseFence = Fence::NO_FENCE); - - // setDefaultBufferSize is used to set the size of buffers returned by - // requestBuffers when a with and height of zero is requested. - status_t setDefaultBufferSize(uint32_t w, uint32_t h); - - // setDefaultBufferFormat allows the BufferQueue to create - // GraphicBuffers of a defaultFormat if no format is specified - // in dequeueBuffer - status_t setDefaultBufferFormat(uint32_t defaultFormat); -}; - -} // namespace android - -#endif // ANDROID_GUI_CPUCONSUMER_H diff --git a/external/android/include/19/frameworks/native/include/gui/BufferQueue.h b/external/android/include/19/frameworks/native/include/gui/BufferQueue.h deleted file mode 100644 index 408956b..0000000 --- a/external/android/include/19/frameworks/native/include/gui/BufferQueue.h +++ /dev/null @@ -1,574 +0,0 @@ -/* - * Copyright (C) 2012 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_GUI_BUFFERQUEUE_H -#define ANDROID_GUI_BUFFERQUEUE_H - -#include -#include - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class BufferQueue : public BnGraphicBufferProducer, - public BnGraphicBufferConsumer, - private IBinder::DeathRecipient { -public: - enum { MIN_UNDEQUEUED_BUFFERS = 2 }; - enum { NUM_BUFFER_SLOTS = 32 }; - enum { NO_CONNECTED_API = 0 }; - enum { INVALID_BUFFER_SLOT = -1 }; - enum { STALE_BUFFER_SLOT = 1, NO_BUFFER_AVAILABLE, PRESENT_LATER }; - - // When in async mode we reserve two slots in order to guarantee that the - // producer and consumer can run asynchronously. - enum { MAX_MAX_ACQUIRED_BUFFERS = NUM_BUFFER_SLOTS - 2 }; - - // for backward source compatibility - typedef ::android::ConsumerListener ConsumerListener; - - // ProxyConsumerListener is a ConsumerListener implementation that keeps a weak - // reference to the actual consumer object. It forwards all calls to that - // consumer object so long as it exists. - // - // This class exists to avoid having a circular reference between the - // BufferQueue object and the consumer object. The reason this can't be a weak - // reference in the BufferQueue class is because we're planning to expose the - // consumer side of a BufferQueue as a binder interface, which doesn't support - // weak references. - class ProxyConsumerListener : public BnConsumerListener { - public: - ProxyConsumerListener(const wp& consumerListener); - virtual ~ProxyConsumerListener(); - virtual void onFrameAvailable(); - virtual void onBuffersReleased(); - private: - // mConsumerListener is a weak reference to the IConsumerListener. This is - // the raison d'etre of ProxyConsumerListener. - wp mConsumerListener; - }; - - - // BufferQueue manages a pool of gralloc memory slots to be used by - // producers and consumers. allocator is used to allocate all the - // needed gralloc buffers. - BufferQueue(const sp& allocator = NULL); - virtual ~BufferQueue(); - - /* - * IBinder::DeathRecipient interface - */ - - virtual void binderDied(const wp& who); - - /* - * IGraphicBufferProducer interface - */ - - // Query native window attributes. The "what" values are enumerated in - // window.h (e.g. NATIVE_WINDOW_FORMAT). - virtual int query(int what, int* value); - - // setBufferCount updates the number of available buffer slots. If this - // method succeeds, buffer slots will be both unallocated and owned by - // the BufferQueue object (i.e. they are not owned by the producer or - // consumer). - // - // This will fail if the producer has dequeued any buffers, or if - // bufferCount is invalid. bufferCount must generally be a value - // between the minimum undequeued buffer count and NUM_BUFFER_SLOTS - // (inclusive). It may also be set to zero (the default) to indicate - // that the producer does not wish to set a value. The minimum value - // can be obtained by calling query(NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS, - // ...). - // - // This may only be called by the producer. The consumer will be told - // to discard buffers through the onBuffersReleased callback. - virtual status_t setBufferCount(int bufferCount); - - // requestBuffer returns the GraphicBuffer for slot N. - // - // In normal operation, this is called the first time slot N is returned - // by dequeueBuffer. It must be called again if dequeueBuffer returns - // flags indicating that previously-returned buffers are no longer valid. - virtual status_t requestBuffer(int slot, sp* buf); - - // dequeueBuffer gets the next buffer slot index for the producer to use. - // If a buffer slot is available then that slot index is written to the - // location pointed to by the buf argument and a status of OK is returned. - // If no slot is available then a status of -EBUSY is returned and buf is - // unmodified. - // - // The fence parameter will be updated to hold the fence associated with - // the buffer. The contents of the buffer must not be overwritten until the - // fence signals. If the fence is Fence::NO_FENCE, the buffer may be - // written immediately. - // - // The width and height parameters must be no greater than the minimum of - // GL_MAX_VIEWPORT_DIMS and GL_MAX_TEXTURE_SIZE (see: glGetIntegerv). - // An error due to invalid dimensions might not be reported until - // updateTexImage() is called. If width and height are both zero, the - // default values specified by setDefaultBufferSize() are used instead. - // - // The pixel formats are enumerated in graphics.h, e.g. - // HAL_PIXEL_FORMAT_RGBA_8888. If the format is 0, the default format - // will be used. - // - // The usage argument specifies gralloc buffer usage flags. The values - // are enumerated in gralloc.h, e.g. GRALLOC_USAGE_HW_RENDER. These - // will be merged with the usage flags specified by setConsumerUsageBits. - // - // The return value may be a negative error value or a non-negative - // collection of flags. If the flags are set, the return values are - // valid, but additional actions must be performed. - // - // If IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION is set, the - // producer must discard cached GraphicBuffer references for the slot - // returned in buf. - // If IGraphicBufferProducer::RELEASE_ALL_BUFFERS is set, the producer - // must discard cached GraphicBuffer references for all slots. - // - // In both cases, the producer will need to call requestBuffer to get a - // GraphicBuffer handle for the returned slot. - virtual status_t dequeueBuffer(int *buf, sp* fence, bool async, - uint32_t width, uint32_t height, uint32_t format, uint32_t usage); - - // queueBuffer returns a filled buffer to the BufferQueue. - // - // Additional data is provided in the QueueBufferInput struct. Notably, - // a timestamp must be provided for the buffer. The timestamp is in - // nanoseconds, and must be monotonically increasing. Its other semantics - // (zero point, etc) are producer-specific and should be documented by the - // producer. - // - // The caller may provide a fence that signals when all rendering - // operations have completed. Alternatively, NO_FENCE may be used, - // indicating that the buffer is ready immediately. - // - // Some values are returned in the output struct: the current settings - // for default width and height, the current transform hint, and the - // number of queued buffers. - virtual status_t queueBuffer(int buf, - const QueueBufferInput& input, QueueBufferOutput* output); - - // cancelBuffer returns a dequeued buffer to the BufferQueue, but doesn't - // queue it for use by the consumer. - // - // The buffer will not be overwritten until the fence signals. The fence - // will usually be the one obtained from dequeueBuffer. - virtual void cancelBuffer(int buf, const sp& fence); - - // connect attempts to connect a producer API to the BufferQueue. This - // must be called before any other IGraphicBufferProducer methods are - // called except for getAllocator. A consumer must already be connected. - // - // This method will fail if connect was previously called on the - // BufferQueue and no corresponding disconnect call was made (i.e. if - // it's still connected to a producer). - // - // APIs are enumerated in window.h (e.g. NATIVE_WINDOW_API_CPU). - virtual status_t connect(const sp& token, - int api, bool producerControlledByApp, QueueBufferOutput* output); - - // disconnect attempts to disconnect a producer API from the BufferQueue. - // Calling this method will cause any subsequent calls to other - // IGraphicBufferProducer methods to fail except for getAllocator and connect. - // Successfully calling connect after this will allow the other methods to - // succeed again. - // - // This method will fail if the the BufferQueue is not currently - // connected to the specified producer API. - virtual status_t disconnect(int api); - - /* - * IGraphicBufferConsumer interface - */ - - // acquireBuffer attempts to acquire ownership of the next pending buffer in - // the BufferQueue. If no buffer is pending then it returns -EINVAL. If a - // buffer is successfully acquired, the information about the buffer is - // returned in BufferItem. If the buffer returned had previously been - // acquired then the BufferItem::mGraphicBuffer field of buffer is set to - // NULL and it is assumed that the consumer still holds a reference to the - // buffer. - // - // If presentWhen is nonzero, it indicates the time when the buffer will - // be displayed on screen. If the buffer's timestamp is farther in the - // future, the buffer won't be acquired, and PRESENT_LATER will be - // returned. The presentation time is in nanoseconds, and the time base - // is CLOCK_MONOTONIC. - virtual status_t acquireBuffer(BufferItem *buffer, nsecs_t presentWhen); - - // releaseBuffer releases a buffer slot from the consumer back to the - // BufferQueue. This may be done while the buffer's contents are still - // being accessed. The fence will signal when the buffer is no longer - // in use. frameNumber is used to indentify the exact buffer returned. - // - // If releaseBuffer returns STALE_BUFFER_SLOT, then the consumer must free - // any references to the just-released buffer that it might have, as if it - // had received a onBuffersReleased() call with a mask set for the released - // buffer. - // - // Note that the dependencies on EGL will be removed once we switch to using - // the Android HW Sync HAL. - virtual status_t releaseBuffer(int buf, uint64_t frameNumber, - EGLDisplay display, EGLSyncKHR fence, - const sp& releaseFence); - - // consumerConnect connects a consumer to the BufferQueue. Only one - // consumer may be connected, and when that consumer disconnects the - // BufferQueue is placed into the "abandoned" state, causing most - // interactions with the BufferQueue by the producer to fail. - // controlledByApp indicates whether the consumer is controlled by - // the application. - // - // consumer may not be NULL. - virtual status_t consumerConnect(const sp& consumer, bool controlledByApp); - - // consumerDisconnect disconnects a consumer from the BufferQueue. All - // buffers will be freed and the BufferQueue is placed in the "abandoned" - // state, causing most interactions with the BufferQueue by the producer to - // fail. - virtual status_t consumerDisconnect(); - - // getReleasedBuffers sets the value pointed to by slotMask to a bit mask - // indicating which buffer slots have been released by the BufferQueue - // but have not yet been released by the consumer. - // - // This should be called from the onBuffersReleased() callback. - virtual status_t getReleasedBuffers(uint32_t* slotMask); - - // setDefaultBufferSize is used to set the size of buffers returned by - // dequeueBuffer when a width and height of zero is requested. Default - // is 1x1. - virtual status_t setDefaultBufferSize(uint32_t w, uint32_t h); - - // setDefaultMaxBufferCount sets the default value for the maximum buffer - // count (the initial default is 2). If the producer has requested a - // buffer count using setBufferCount, the default buffer count will only - // take effect if the producer sets the count back to zero. - // - // The count must be between 2 and NUM_BUFFER_SLOTS, inclusive. - virtual status_t setDefaultMaxBufferCount(int bufferCount); - - // disableAsyncBuffer disables the extra buffer used in async mode - // (when both producer and consumer have set their "isControlledByApp" - // flag) and has dequeueBuffer() return WOULD_BLOCK instead. - // - // This can only be called before consumerConnect(). - virtual status_t disableAsyncBuffer(); - - // setMaxAcquiredBufferCount sets the maximum number of buffers that can - // be acquired by the consumer at one time (default 1). This call will - // fail if a producer is connected to the BufferQueue. - virtual status_t setMaxAcquiredBufferCount(int maxAcquiredBuffers); - - // setConsumerName sets the name used in logging - virtual void setConsumerName(const String8& name); - - // setDefaultBufferFormat allows the BufferQueue to create - // GraphicBuffers of a defaultFormat if no format is specified - // in dequeueBuffer. Formats are enumerated in graphics.h; the - // initial default is HAL_PIXEL_FORMAT_RGBA_8888. - virtual status_t setDefaultBufferFormat(uint32_t defaultFormat); - - // setConsumerUsageBits will turn on additional usage bits for dequeueBuffer. - // These are merged with the bits passed to dequeueBuffer. The values are - // enumerated in gralloc.h, e.g. GRALLOC_USAGE_HW_RENDER; the default is 0. - virtual status_t setConsumerUsageBits(uint32_t usage); - - // setTransformHint bakes in rotation to buffers so overlays can be used. - // The values are enumerated in window.h, e.g. - // NATIVE_WINDOW_TRANSFORM_ROT_90. The default is 0 (no transform). - virtual status_t setTransformHint(uint32_t hint); - - // dump our state in a String - virtual void dump(String8& result, const char* prefix) const; - - -private: - // freeBufferLocked frees the GraphicBuffer and sync resources for the - // given slot. - void freeBufferLocked(int index); - - // freeAllBuffersLocked frees the GraphicBuffer and sync resources for - // all slots. - void freeAllBuffersLocked(); - - // setDefaultMaxBufferCountLocked sets the maximum number of buffer slots - // that will be used if the producer does not override the buffer slot - // count. The count must be between 2 and NUM_BUFFER_SLOTS, inclusive. - // The initial default is 2. - status_t setDefaultMaxBufferCountLocked(int count); - - // getMinUndequeuedBufferCount returns the minimum number of buffers - // that must remain in a state other than DEQUEUED. - // The async parameter tells whether we're in asynchronous mode. - int getMinUndequeuedBufferCount(bool async) const; - - // getMinBufferCountLocked returns the minimum number of buffers allowed - // given the current BufferQueue state. - // The async parameter tells whether we're in asynchronous mode. - int getMinMaxBufferCountLocked(bool async) const; - - // getMaxBufferCountLocked returns the maximum number of buffers that can - // be allocated at once. This value depends upon the following member - // variables: - // - // mDequeueBufferCannotBlock - // mMaxAcquiredBufferCount - // mDefaultMaxBufferCount - // mOverrideMaxBufferCount - // async parameter - // - // Any time one of these member variables is changed while a producer is - // connected, mDequeueCondition must be broadcast. - int getMaxBufferCountLocked(bool async) const; - - // stillTracking returns true iff the buffer item is still being tracked - // in one of the slots. - bool stillTracking(const BufferItem *item) const; - - struct BufferSlot { - - BufferSlot() - : mEglDisplay(EGL_NO_DISPLAY), - mBufferState(BufferSlot::FREE), - mRequestBufferCalled(false), - mFrameNumber(0), - mEglFence(EGL_NO_SYNC_KHR), - mAcquireCalled(false), - mNeedsCleanupOnRelease(false) { - } - - // mGraphicBuffer points to the buffer allocated for this slot or is NULL - // if no buffer has been allocated. - sp mGraphicBuffer; - - // mEglDisplay is the EGLDisplay used to create EGLSyncKHR objects. - EGLDisplay mEglDisplay; - - // BufferState represents the different states in which a buffer slot - // can be. All slots are initially FREE. - enum BufferState { - // FREE indicates that the buffer is available to be dequeued - // by the producer. The buffer may be in use by the consumer for - // a finite time, so the buffer must not be modified until the - // associated fence is signaled. - // - // The slot is "owned" by BufferQueue. It transitions to DEQUEUED - // when dequeueBuffer is called. - FREE = 0, - - // DEQUEUED indicates that the buffer has been dequeued by the - // producer, but has not yet been queued or canceled. The - // producer may modify the buffer's contents as soon as the - // associated ready fence is signaled. - // - // The slot is "owned" by the producer. It can transition to - // QUEUED (via queueBuffer) or back to FREE (via cancelBuffer). - DEQUEUED = 1, - - // QUEUED indicates that the buffer has been filled by the - // producer and queued for use by the consumer. The buffer - // contents may continue to be modified for a finite time, so - // the contents must not be accessed until the associated fence - // is signaled. - // - // The slot is "owned" by BufferQueue. It can transition to - // ACQUIRED (via acquireBuffer) or to FREE (if another buffer is - // queued in asynchronous mode). - QUEUED = 2, - - // ACQUIRED indicates that the buffer has been acquired by the - // consumer. As with QUEUED, the contents must not be accessed - // by the consumer until the fence is signaled. - // - // The slot is "owned" by the consumer. It transitions to FREE - // when releaseBuffer is called. - ACQUIRED = 3 - }; - - // mBufferState is the current state of this buffer slot. - BufferState mBufferState; - - // mRequestBufferCalled is used for validating that the producer did - // call requestBuffer() when told to do so. Technically this is not - // needed but useful for debugging and catching producer bugs. - bool mRequestBufferCalled; - - // mFrameNumber is the number of the queued frame for this slot. This - // is used to dequeue buffers in LRU order (useful because buffers - // may be released before their release fence is signaled). - uint64_t mFrameNumber; - - // mEglFence is the EGL sync object that must signal before the buffer - // associated with this buffer slot may be dequeued. It is initialized - // to EGL_NO_SYNC_KHR when the buffer is created and may be set to a - // new sync object in releaseBuffer. (This is deprecated in favor of - // mFence, below.) - EGLSyncKHR mEglFence; - - // mFence is a fence which will signal when work initiated by the - // previous owner of the buffer is finished. When the buffer is FREE, - // the fence indicates when the consumer has finished reading - // from the buffer, or when the producer has finished writing if it - // called cancelBuffer after queueing some writes. When the buffer is - // QUEUED, it indicates when the producer has finished filling the - // buffer. When the buffer is DEQUEUED or ACQUIRED, the fence has been - // passed to the consumer or producer along with ownership of the - // buffer, and mFence is set to NO_FENCE. - sp mFence; - - // Indicates whether this buffer has been seen by a consumer yet - bool mAcquireCalled; - - // Indicates whether this buffer needs to be cleaned up by the - // consumer. This is set when a buffer in ACQUIRED state is freed. - // It causes releaseBuffer to return STALE_BUFFER_SLOT. - bool mNeedsCleanupOnRelease; - }; - - // mSlots is the array of buffer slots that must be mirrored on the - // producer side. This allows buffer ownership to be transferred between - // the producer and consumer without sending a GraphicBuffer over binder. - // The entire array is initialized to NULL at construction time, and - // buffers are allocated for a slot when requestBuffer is called with - // that slot's index. - BufferSlot mSlots[NUM_BUFFER_SLOTS]; - - // mDefaultWidth holds the default width of allocated buffers. It is used - // in dequeueBuffer() if a width and height of zero is specified. - uint32_t mDefaultWidth; - - // mDefaultHeight holds the default height of allocated buffers. It is used - // in dequeueBuffer() if a width and height of zero is specified. - uint32_t mDefaultHeight; - - // mMaxAcquiredBufferCount is the number of buffers that the consumer may - // acquire at one time. It defaults to 1 and can be changed by the - // consumer via the setMaxAcquiredBufferCount method, but this may only be - // done when no producer is connected to the BufferQueue. - // - // This value is used to derive the value returned for the - // MIN_UNDEQUEUED_BUFFERS query by the producer. - int mMaxAcquiredBufferCount; - - // mDefaultMaxBufferCount is the default limit on the number of buffers - // that will be allocated at one time. This default limit is set by the - // consumer. The limit (as opposed to the default limit) may be - // overridden by the producer. - int mDefaultMaxBufferCount; - - // mOverrideMaxBufferCount is the limit on the number of buffers that will - // be allocated at one time. This value is set by the image producer by - // calling setBufferCount. The default is zero, which means the producer - // doesn't care about the number of buffers in the pool. In that case - // mDefaultMaxBufferCount is used as the limit. - int mOverrideMaxBufferCount; - - // mGraphicBufferAlloc is the connection to SurfaceFlinger that is used to - // allocate new GraphicBuffer objects. - sp mGraphicBufferAlloc; - - // mConsumerListener is used to notify the connected consumer of - // asynchronous events that it may wish to react to. It is initially set - // to NULL and is written by consumerConnect and consumerDisconnect. - sp mConsumerListener; - - // mConsumerControlledByApp whether the connected consumer is controlled by the - // application. - bool mConsumerControlledByApp; - - // mDequeueBufferCannotBlock whether dequeueBuffer() isn't allowed to block. - // this flag is set during connect() when both consumer and producer are controlled - // by the application. - bool mDequeueBufferCannotBlock; - - // mUseAsyncBuffer whether an extra buffer is used in async mode to prevent - // dequeueBuffer() from ever blocking. - bool mUseAsyncBuffer; - - // mConnectedApi indicates the producer API that is currently connected - // to this BufferQueue. It defaults to NO_CONNECTED_API (= 0), and gets - // updated by the connect and disconnect methods. - int mConnectedApi; - - // mDequeueCondition condition used for dequeueBuffer in synchronous mode - mutable Condition mDequeueCondition; - - // mQueue is a FIFO of queued buffers used in synchronous mode - typedef Vector Fifo; - Fifo mQueue; - - // mAbandoned indicates that the BufferQueue will no longer be used to - // consume image buffers pushed to it using the IGraphicBufferProducer - // interface. It is initialized to false, and set to true in the - // consumerDisconnect method. A BufferQueue that has been abandoned will - // return the NO_INIT error from all IGraphicBufferProducer methods - // capable of returning an error. - bool mAbandoned; - - // mConsumerName is a string used to identify the BufferQueue in log - // messages. It is set by the setConsumerName method. - String8 mConsumerName; - - // mMutex is the mutex used to prevent concurrent access to the member - // variables of BufferQueue objects. It must be locked whenever the - // member variables are accessed. - mutable Mutex mMutex; - - // mFrameCounter is the free running counter, incremented on every - // successful queueBuffer call, and buffer allocation. - uint64_t mFrameCounter; - - // mBufferHasBeenQueued is true once a buffer has been queued. It is - // reset when something causes all buffers to be freed (e.g. changing the - // buffer count). - bool mBufferHasBeenQueued; - - // mDefaultBufferFormat can be set so it will override - // the buffer format when it isn't specified in dequeueBuffer - uint32_t mDefaultBufferFormat; - - // mConsumerUsageBits contains flags the consumer wants for GraphicBuffers - uint32_t mConsumerUsageBits; - - // mTransformHint is used to optimize for screen rotations - uint32_t mTransformHint; - - // mConnectedProducerToken is used to set a binder death notification on the producer - sp mConnectedProducerToken; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_BUFFERQUEUE_H diff --git a/external/android/include/19/frameworks/native/include/gui/ConsumerBase.h b/external/android/include/19/frameworks/native/include/gui/ConsumerBase.h deleted file mode 100644 index fb21185..0000000 --- a/external/android/include/19/frameworks/native/include/gui/ConsumerBase.h +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_CONSUMERBASE_H -#define ANDROID_GUI_CONSUMERBASE_H - -#include - -#include - -#include -#include -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class String8; - -// ConsumerBase is a base class for BufferQueue consumer end-points. It -// handles common tasks like management of the connection to the BufferQueue -// and the buffer pool. -class ConsumerBase : public virtual RefBase, - protected ConsumerListener { -public: - struct FrameAvailableListener : public virtual RefBase { - // onFrameAvailable() is called each time an additional frame becomes - // available for consumption. This means that frames that are queued - // while in asynchronous mode only trigger the callback if no previous - // frames are pending. Frames queued while in synchronous mode always - // trigger the callback. - // - // This is called without any lock held and can be called concurrently - // by multiple threads. - virtual void onFrameAvailable() = 0; - }; - - virtual ~ConsumerBase(); - - // abandon frees all the buffers and puts the ConsumerBase into the - // 'abandoned' state. Once put in this state the ConsumerBase can never - // leave it. When in the 'abandoned' state, all methods of the - // IGraphicBufferProducer interface will fail with the NO_INIT error. - // - // Note that while calling this method causes all the buffers to be freed - // from the perspective of the the ConsumerBase, if there are additional - // references on the buffers (e.g. if a buffer is referenced by a client - // or by OpenGL ES as a texture) then those buffer will remain allocated. - void abandon(); - - // set the name of the ConsumerBase that will be used to identify it in - // log messages. - void setName(const String8& name); - - // dump writes the current state to a string. Child classes should add - // their state to the dump by overriding the dumpLocked method, which is - // called by these methods after locking the mutex. - void dump(String8& result) const; - void dump(String8& result, const char* prefix) const; - - // setFrameAvailableListener sets the listener object that will be notified - // when a new frame becomes available. - void setFrameAvailableListener(const wp& listener); - -private: - ConsumerBase(const ConsumerBase&); - void operator=(const ConsumerBase&); - -protected: - // ConsumerBase constructs a new ConsumerBase object to consume image - // buffers from the given IGraphicBufferConsumer. - // The controlledByApp flag indicates that this consumer is under the application's - // control. - ConsumerBase(const sp& consumer, bool controlledByApp = false); - - // onLastStrongRef gets called by RefBase just before the dtor of the most - // derived class. It is used to clean up the buffers so that ConsumerBase - // can coordinate the clean-up by calling into virtual methods implemented - // by the derived classes. This would not be possible from the - // ConsuemrBase dtor because by the time that gets called the derived - // classes have already been destructed. - // - // This methods should not need to be overridden by derived classes, but - // if they are overridden the ConsumerBase implementation must be called - // from the derived class. - virtual void onLastStrongRef(const void* id); - - // Implementation of the IConsumerListener interface. These - // calls are used to notify the ConsumerBase of asynchronous events in the - // BufferQueue. These methods should not need to be overridden by derived - // classes, but if they are overridden the ConsumerBase implementation - // must be called from the derived class. - virtual void onFrameAvailable(); - virtual void onBuffersReleased(); - - // freeBufferLocked frees up the given buffer slot. If the slot has been - // initialized this will release the reference to the GraphicBuffer in that - // slot. Otherwise it has no effect. - // - // Derived classes should override this method to clean up any state they - // keep per slot. If it is overridden, the derived class's implementation - // must call ConsumerBase::freeBufferLocked. - // - // This method must be called with mMutex locked. - virtual void freeBufferLocked(int slotIndex); - - // abandonLocked puts the BufferQueue into the abandoned state, causing - // all future operations on it to fail. This method rather than the public - // abandon method should be overridden by child classes to add abandon- - // time behavior. - // - // Derived classes should override this method to clean up any object - // state they keep (as opposed to per-slot state). If it is overridden, - // the derived class's implementation must call ConsumerBase::abandonLocked. - // - // This method must be called with mMutex locked. - virtual void abandonLocked(); - - // dumpLocked dumps the current state of the ConsumerBase object to the - // result string. Each line is prefixed with the string pointed to by the - // prefix argument. The buffer argument points to a buffer that may be - // used for intermediate formatting data, and the size of that buffer is - // indicated by the size argument. - // - // Derived classes should override this method to dump their internal - // state. If this method is overridden the derived class's implementation - // should call ConsumerBase::dumpLocked. - // - // This method must be called with mMutex locked. - virtual void dumpLocked(String8& result, const char* prefix) const; - - // acquireBufferLocked fetches the next buffer from the BufferQueue and - // updates the buffer slot for the buffer returned. - // - // Derived classes should override this method to perform any - // initialization that must take place the first time a buffer is assigned - // to a slot. If it is overridden the derived class's implementation must - // call ConsumerBase::acquireBufferLocked. - virtual status_t acquireBufferLocked(IGraphicBufferConsumer::BufferItem *item, - nsecs_t presentWhen); - - // releaseBufferLocked relinquishes control over a buffer, returning that - // control to the BufferQueue. - // - // Derived classes should override this method to perform any cleanup that - // must take place when a buffer is released back to the BufferQueue. If - // it is overridden the derived class's implementation must call - // ConsumerBase::releaseBufferLocked.e - virtual status_t releaseBufferLocked(int slot, - const sp graphicBuffer, - EGLDisplay display, EGLSyncKHR eglFence); - - // returns true iff the slot still has the graphicBuffer in it. - bool stillTracking(int slot, const sp graphicBuffer); - - // addReleaseFence* adds the sync points associated with a fence to the set - // of sync points that must be reached before the buffer in the given slot - // may be used after the slot has been released. This should be called by - // derived classes each time some asynchronous work is kicked off that - // references the buffer. - status_t addReleaseFence(int slot, - const sp graphicBuffer, const sp& fence); - status_t addReleaseFenceLocked(int slot, - const sp graphicBuffer, const sp& fence); - - // Slot contains the information and object references that - // ConsumerBase maintains about a BufferQueue buffer slot. - struct Slot { - // mGraphicBuffer is the Gralloc buffer store in the slot or NULL if - // no Gralloc buffer is in the slot. - sp mGraphicBuffer; - - // mFence is a fence which will signal when the buffer associated with - // this buffer slot is no longer being used by the consumer and can be - // overwritten. The buffer can be dequeued before the fence signals; - // the producer is responsible for delaying writes until it signals. - sp mFence; - - // the frame number of the last acquired frame for this slot - uint64_t mFrameNumber; - }; - - // mSlots stores the buffers that have been allocated by the BufferQueue - // for each buffer slot. It is initialized to null pointers, and gets - // filled in with the result of BufferQueue::acquire when the - // client dequeues a buffer from a - // slot that has not yet been used. The buffer allocated to a slot will also - // be replaced if the requested buffer usage or geometry differs from that - // of the buffer allocated to a slot. - Slot mSlots[BufferQueue::NUM_BUFFER_SLOTS]; - - // mAbandoned indicates that the BufferQueue will no longer be used to - // consume images buffers pushed to it using the IGraphicBufferProducer - // interface. It is initialized to false, and set to true in the abandon - // method. A BufferQueue that has been abandoned will return the NO_INIT - // error from all IConsumerBase methods capable of returning an error. - bool mAbandoned; - - // mName is a string used to identify the ConsumerBase in log messages. - // It can be set by the setName method. - String8 mName; - - // mFrameAvailableListener is the listener object that will be called when a - // new frame becomes available. If it is not NULL it will be called from - // queueBuffer. - wp mFrameAvailableListener; - - // The ConsumerBase has-a BufferQueue and is responsible for creating this object - // if none is supplied - sp mConsumer; - - // mMutex is the mutex used to prevent concurrent access to the member - // variables of ConsumerBase objects. It must be locked whenever the - // member variables are accessed or when any of the *Locked methods are - // called. - // - // This mutex is intended to be locked by derived classes. - mutable Mutex mMutex; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_CONSUMERBASE_H diff --git a/external/android/include/19/frameworks/native/include/gui/CpuConsumer.h b/external/android/include/19/frameworks/native/include/gui/CpuConsumer.h deleted file mode 100644 index 6f4c2ec..0000000 --- a/external/android/include/19/frameworks/native/include/gui/CpuConsumer.h +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (C) 2012 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_GUI_CPUCONSUMER_H -#define ANDROID_GUI_CPUCONSUMER_H - -#include - -#include - -#include -#include -#include - - -namespace android { - -class BufferQueue; - -/** - * CpuConsumer is a BufferQueue consumer endpoint that allows direct CPU - * access to the underlying gralloc buffers provided by BufferQueue. Multiple - * buffers may be acquired by it at once, to be used concurrently by the - * CpuConsumer owner. Sets gralloc usage flags to be software-read-only. - * This queue is synchronous by default. - */ - -class CpuConsumer : public ConsumerBase -{ - public: - typedef ConsumerBase::FrameAvailableListener FrameAvailableListener; - - struct LockedBuffer { - uint8_t *data; - uint32_t width; - uint32_t height; - PixelFormat format; - uint32_t stride; - Rect crop; - uint32_t transform; - uint32_t scalingMode; - int64_t timestamp; - uint64_t frameNumber; - // Values below are only valid when using - // HAL_PIXEL_FORMAT_YCbCr_420_888, in which case LockedBuffer::data - // contains the Y channel, and stride is the Y channel stride. For other - // formats, these will all be 0. - uint8_t *dataCb; - uint8_t *dataCr; - uint32_t chromaStride; - uint32_t chromaStep; - }; - - // Create a new CPU consumer. The maxLockedBuffers parameter specifies - // how many buffers can be locked for user access at the same time. - CpuConsumer(const sp& bq, - uint32_t maxLockedBuffers, bool controlledByApp = false); - - virtual ~CpuConsumer(); - - // set the name of the CpuConsumer that will be used to identify it in - // log messages. - void setName(const String8& name); - - // setDefaultBufferSize is used to set the size of buffers returned by - // requestBuffers when a width and height of zero is requested. - // A call to setDefaultBufferSize() may trigger requestBuffers() to - // be called from the client. Default size is 1x1. - status_t setDefaultBufferSize(uint32_t width, uint32_t height); - - // setDefaultBufferFormat allows CpuConsumer's BufferQueue to create buffers - // of a defaultFormat if no format is specified by producer. Formats are - // enumerated in graphics.h; the initial default is - // HAL_PIXEL_FORMAT_RGBA_8888. - status_t setDefaultBufferFormat(uint32_t defaultFormat); - - // Gets the next graphics buffer from the producer and locks it for CPU use, - // filling out the passed-in locked buffer structure with the native pointer - // and metadata. Returns BAD_VALUE if no new buffer is available, and - // NOT_ENOUGH_DATA if the maximum number of buffers is already locked. - // - // Only a fixed number of buffers can be locked at a time, determined by the - // construction-time maxLockedBuffers parameter. If INVALID_OPERATION is - // returned by lockNextBuffer, then old buffers must be returned to the queue - // by calling unlockBuffer before more buffers can be acquired. - status_t lockNextBuffer(LockedBuffer *nativeBuffer); - - // Returns a locked buffer to the queue, allowing it to be reused. Since - // only a fixed number of buffers may be locked at a time, old buffers must - // be released by calling unlockBuffer to ensure new buffers can be acquired by - // lockNextBuffer. - status_t unlockBuffer(const LockedBuffer &nativeBuffer); - - private: - // Maximum number of buffers that can be locked at a time - uint32_t mMaxLockedBuffers; - - status_t releaseAcquiredBufferLocked(int lockedIdx); - - virtual void freeBufferLocked(int slotIndex); - - // Tracking for buffers acquired by the user - struct AcquiredBuffer { - // Need to track the original mSlot index and the buffer itself because - // the mSlot entry may be freed/reused before the acquired buffer is - // released. - int mSlot; - sp mGraphicBuffer; - void *mBufferPointer; - - AcquiredBuffer() : - mSlot(BufferQueue::INVALID_BUFFER_SLOT), - mBufferPointer(NULL) { - } - }; - Vector mAcquiredBuffers; - - // Count of currently locked buffers - uint32_t mCurrentLockedBuffers; - -}; - -} // namespace android - -#endif // ANDROID_GUI_CPUCONSUMER_H diff --git a/external/android/include/19/frameworks/native/include/gui/DisplayEventReceiver.h b/external/android/include/19/frameworks/native/include/gui/DisplayEventReceiver.h deleted file mode 100644 index f8267bf..0000000 --- a/external/android/include/19/frameworks/native/include/gui/DisplayEventReceiver.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (C) 2011 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_GUI_DISPLAY_EVENT_H -#define ANDROID_GUI_DISPLAY_EVENT_H - -#include -#include - -#include -#include -#include - -#include - -// ---------------------------------------------------------------------------- - -namespace android { - -// ---------------------------------------------------------------------------- - -class BitTube; -class IDisplayEventConnection; - -// ---------------------------------------------------------------------------- - -class DisplayEventReceiver { -public: - enum { - DISPLAY_EVENT_VSYNC = 'vsyn', - DISPLAY_EVENT_HOTPLUG = 'plug' - }; - - struct Event { - - struct Header { - uint32_t type; - uint32_t id; - nsecs_t timestamp; - }; - - struct VSync { - uint32_t count; - }; - - struct Hotplug { - bool connected; - }; - - Header header; - union { - VSync vsync; - Hotplug hotplug; - }; - }; - -public: - /* - * DisplayEventReceiver creates and registers an event connection with - * SurfaceFlinger. VSync events are disabled by default. Call setVSyncRate - * or requestNextVsync to receive them. - * Other events start being delivered immediately. - */ - DisplayEventReceiver(); - - /* - * ~DisplayEventReceiver severs the connection with SurfaceFlinger, new events - * stop being delivered immediately. Note that the queue could have - * some events pending. These will be delivered. - */ - ~DisplayEventReceiver(); - - /* - * initCheck returns the state of DisplayEventReceiver after construction. - */ - status_t initCheck() const; - - /* - * getFd returns the file descriptor to use to receive events. - * OWNERSHIP IS RETAINED by DisplayEventReceiver. DO NOT CLOSE this - * file-descriptor. - */ - int getFd() const; - - /* - * getEvents reads events from the queue and returns how many events were - * read. Returns 0 if there are no more events or a negative error code. - * If NOT_ENOUGH_DATA is returned, the object has become invalid forever, it - * should be destroyed and getEvents() shouldn't be called again. - */ - ssize_t getEvents(Event* events, size_t count); - static ssize_t getEvents(const sp& dataChannel, - Event* events, size_t count); - - /* - * sendEvents write events to the queue and returns how many events were - * written. - */ - static ssize_t sendEvents(const sp& dataChannel, - Event const* events, size_t count); - - /* - * setVsyncRate() sets the Event::VSync delivery rate. A value of - * 1 returns every Event::VSync. A value of 2 returns every other event, - * etc... a value of 0 returns no event unless requestNextVsync() has - * been called. - */ - status_t setVsyncRate(uint32_t count); - - /* - * requestNextVsync() schedules the next Event::VSync. It has no effect - * if the vsync rate is > 0. - */ - status_t requestNextVsync(); - -private: - sp mEventConnection; - sp mDataChannel; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_DISPLAY_EVENT_H diff --git a/external/android/include/19/frameworks/native/include/gui/GLConsumer.h b/external/android/include/19/frameworks/native/include/gui/GLConsumer.h deleted file mode 100644 index a5fdfb9..0000000 --- a/external/android/include/19/frameworks/native/include/gui/GLConsumer.h +++ /dev/null @@ -1,448 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_CONSUMER_H -#define ANDROID_GUI_CONSUMER_H - -#include -#include - -#include -#include -#include - -#include - -#include -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - - -class String8; - -/* - * GLConsumer consumes buffers of graphics data from a BufferQueue, - * and makes them available to OpenGL as a texture. - * - * A typical usage pattern is to set up the GLConsumer with the - * desired options, and call updateTexImage() when a new frame is desired. - * If a new frame is available, the texture will be updated. If not, - * the previous contents are retained. - * - * By default, the texture is attached to the GL_TEXTURE_EXTERNAL_OES - * texture target, in the EGL context of the first thread that calls - * updateTexImage(). - * - * This class was previously called SurfaceTexture. - */ -class GLConsumer : public ConsumerBase { -protected: - enum { TEXTURE_EXTERNAL = 0x8D65 }; // GL_TEXTURE_EXTERNAL_OES -public: - typedef ConsumerBase::FrameAvailableListener FrameAvailableListener; - - // GLConsumer constructs a new GLConsumer object. tex indicates the - // name of the OpenGL ES texture to which images are to be streamed. - // allowSynchronousMode specifies whether or not synchronous mode can be - // enabled. texTarget specifies the OpenGL ES texture target to which the - // texture will be bound in updateTexImage. useFenceSync specifies whether - // fences should be used to synchronize access to buffers if that behavior - // is enabled at compile-time. A custom bufferQueue can be specified - // if behavior for queue/dequeue/connect etc needs to be customized. - // Otherwise a default BufferQueue will be created and used. - // - // For legacy reasons, the GLConsumer is created in a state where it is - // considered attached to an OpenGL ES context for the purposes of the - // attachToContext and detachFromContext methods. However, despite being - // considered "attached" to a context, the specific OpenGL ES context - // doesn't get latched until the first call to updateTexImage. After that - // point, all calls to updateTexImage must be made with the same OpenGL ES - // context current. - // - // A GLConsumer may be detached from one OpenGL ES context and then - // attached to a different context using the detachFromContext and - // attachToContext methods, respectively. The intention of these methods is - // purely to allow a GLConsumer to be transferred from one consumer - // context to another. If such a transfer is not needed there is no - // requirement that either of these methods be called. - GLConsumer(const sp& bq, - uint32_t tex, uint32_t texureTarget = TEXTURE_EXTERNAL, - bool useFenceSync = true, bool isControlledByApp = false); - - // updateTexImage acquires the most recently queued buffer, and sets the - // image contents of the target texture to it. - // - // This call may only be made while the OpenGL ES context to which the - // target texture belongs is bound to the calling thread. - // - // This calls doGLFenceWait to ensure proper synchronization. - status_t updateTexImage(); - - // releaseTexImage releases the texture acquired in updateTexImage(). - // This is intended to be used in single buffer mode. - // - // This call may only be made while the OpenGL ES context to which the - // target texture belongs is bound to the calling thread. - status_t releaseTexImage(); - - // setReleaseFence stores a fence that will signal when the current buffer - // is no longer being read. This fence will be returned to the producer - // when the current buffer is released by updateTexImage(). Multiple - // fences can be set for a given buffer; they will be merged into a single - // union fence. - void setReleaseFence(const sp& fence); - - // setDefaultMaxBufferCount sets the default limit on the maximum number - // of buffers that will be allocated at one time. The image producer may - // override the limit. - status_t setDefaultMaxBufferCount(int bufferCount); - - // getTransformMatrix retrieves the 4x4 texture coordinate transform matrix - // associated with the texture image set by the most recent call to - // updateTexImage. - // - // This transform matrix maps 2D homogeneous texture coordinates of the form - // (s, t, 0, 1) with s and t in the inclusive range [0, 1] to the texture - // coordinate that should be used to sample that location from the texture. - // Sampling the texture outside of the range of this transform is undefined. - // - // This transform is necessary to compensate for transforms that the stream - // content producer may implicitly apply to the content. By forcing users of - // a GLConsumer to apply this transform we avoid performing an extra - // copy of the data that would be needed to hide the transform from the - // user. - // - // The matrix is stored in column-major order so that it may be passed - // directly to OpenGL ES via the glLoadMatrixf or glUniformMatrix4fv - // functions. - void getTransformMatrix(float mtx[16]); - - // getTimestamp retrieves the timestamp associated with the texture image - // set by the most recent call to updateTexImage. - // - // The timestamp is in nanoseconds, and is monotonically increasing. Its - // other semantics (zero point, etc) are source-dependent and should be - // documented by the source. - int64_t getTimestamp(); - - // getFrameNumber retrieves the frame number associated with the texture - // image set by the most recent call to updateTexImage. - // - // The frame number is an incrementing counter set to 0 at the creation of - // the BufferQueue associated with this consumer. - int64_t getFrameNumber(); - - // setDefaultBufferSize is used to set the size of buffers returned by - // requestBuffers when a with and height of zero is requested. - // A call to setDefaultBufferSize() may trigger requestBuffers() to - // be called from the client. - // The width and height parameters must be no greater than the minimum of - // GL_MAX_VIEWPORT_DIMS and GL_MAX_TEXTURE_SIZE (see: glGetIntegerv). - // An error due to invalid dimensions might not be reported until - // updateTexImage() is called. - status_t setDefaultBufferSize(uint32_t width, uint32_t height); - - // setFilteringEnabled sets whether the transform matrix should be computed - // for use with bilinear filtering. - void setFilteringEnabled(bool enabled); - - // getCurrentBuffer returns the buffer associated with the current image. - sp getCurrentBuffer() const; - - // getCurrentTextureTarget returns the texture target of the current - // texture as returned by updateTexImage(). - uint32_t getCurrentTextureTarget() const; - - // getCurrentCrop returns the cropping rectangle of the current buffer. - Rect getCurrentCrop() const; - - // getCurrentTransform returns the transform of the current buffer. - uint32_t getCurrentTransform() const; - - // getCurrentScalingMode returns the scaling mode of the current buffer. - uint32_t getCurrentScalingMode() const; - - // getCurrentFence returns the fence indicating when the current buffer is - // ready to be read from. - sp getCurrentFence() const; - - // doGLFenceWait inserts a wait command into the OpenGL ES command stream - // to ensure that it is safe for future OpenGL ES commands to access the - // current texture buffer. - status_t doGLFenceWait() const; - - // set the name of the GLConsumer that will be used to identify it in - // log messages. - void setName(const String8& name); - - // These functions call the corresponding BufferQueue implementation - // so the refactoring can proceed smoothly - status_t setDefaultBufferFormat(uint32_t defaultFormat); - status_t setConsumerUsageBits(uint32_t usage); - status_t setTransformHint(uint32_t hint); - - // detachFromContext detaches the GLConsumer from the calling thread's - // current OpenGL ES context. This context must be the same as the context - // that was current for previous calls to updateTexImage. - // - // Detaching a GLConsumer from an OpenGL ES context will result in the - // deletion of the OpenGL ES texture object into which the images were being - // streamed. After a GLConsumer has been detached from the OpenGL ES - // context calls to updateTexImage will fail returning INVALID_OPERATION - // until the GLConsumer is attached to a new OpenGL ES context using the - // attachToContext method. - status_t detachFromContext(); - - // attachToContext attaches a GLConsumer that is currently in the - // 'detached' state to the current OpenGL ES context. A GLConsumer is - // in the 'detached' state iff detachFromContext has successfully been - // called and no calls to attachToContext have succeeded since the last - // detachFromContext call. Calls to attachToContext made on a - // GLConsumer that is not in the 'detached' state will result in an - // INVALID_OPERATION error. - // - // The tex argument specifies the OpenGL ES texture object name in the - // new context into which the image contents will be streamed. A successful - // call to attachToContext will result in this texture object being bound to - // the texture target and populated with the image contents that were - // current at the time of the last call to detachFromContext. - status_t attachToContext(uint32_t tex); - -protected: - - // abandonLocked overrides the ConsumerBase method to clear - // mCurrentTextureBuf in addition to the ConsumerBase behavior. - virtual void abandonLocked(); - - // dumpLocked overrides the ConsumerBase method to dump GLConsumer- - // specific info in addition to the ConsumerBase behavior. - virtual void dumpLocked(String8& result, const char* prefix) const; - - // acquireBufferLocked overrides the ConsumerBase method to update the - // mEglSlots array in addition to the ConsumerBase behavior. - virtual status_t acquireBufferLocked(BufferQueue::BufferItem *item, - nsecs_t presentWhen); - - // releaseBufferLocked overrides the ConsumerBase method to update the - // mEglSlots array in addition to the ConsumerBase. - virtual status_t releaseBufferLocked(int slot, - const sp graphicBuffer, - EGLDisplay display, EGLSyncKHR eglFence); - - status_t releaseBufferLocked(int slot, - const sp graphicBuffer, EGLSyncKHR eglFence) { - return releaseBufferLocked(slot, graphicBuffer, mEglDisplay, eglFence); - } - - static bool isExternalFormat(uint32_t format); - - // This releases the buffer in the slot referenced by mCurrentTexture, - // then updates state to refer to the BufferItem, which must be a - // newly-acquired buffer. - status_t updateAndReleaseLocked(const BufferQueue::BufferItem& item); - - // Binds mTexName and the current buffer to mTexTarget. Uses - // mCurrentTexture if it's set, mCurrentTextureBuf if not. If the - // bind succeeds, this calls doGLFenceWait. - status_t bindTextureImageLocked(); - - // Gets the current EGLDisplay and EGLContext values, and compares them - // to mEglDisplay and mEglContext. If the fields have been previously - // set, the values must match; if not, the fields are set to the current - // values. - // The contextCheck argument is used to ensure that a GL context is - // properly set; when set to false, the check is not performed. - status_t checkAndUpdateEglStateLocked(bool contextCheck = false); - -private: - // createImage creates a new EGLImage from a GraphicBuffer. - EGLImageKHR createImage(EGLDisplay dpy, - const sp& graphicBuffer, const Rect& crop); - - // freeBufferLocked frees up the given buffer slot. If the slot has been - // initialized this will release the reference to the GraphicBuffer in that - // slot and destroy the EGLImage in that slot. Otherwise it has no effect. - // - // This method must be called with mMutex locked. - virtual void freeBufferLocked(int slotIndex); - - // computeCurrentTransformMatrixLocked computes the transform matrix for the - // current texture. It uses mCurrentTransform and the current GraphicBuffer - // to compute this matrix and stores it in mCurrentTransformMatrix. - // mCurrentTextureBuf must not be NULL. - void computeCurrentTransformMatrixLocked(); - - // doGLFenceWaitLocked inserts a wait command into the OpenGL ES command - // stream to ensure that it is safe for future OpenGL ES commands to - // access the current texture buffer. - status_t doGLFenceWaitLocked() const; - - // syncForReleaseLocked performs the synchronization needed to release the - // current slot from an OpenGL ES context. If needed it will set the - // current slot's fence to guard against a producer accessing the buffer - // before the outstanding accesses have completed. - status_t syncForReleaseLocked(EGLDisplay dpy); - - // Normally, when we bind a buffer to a texture target, we bind a buffer - // that is referenced by an entry in mEglSlots. In some situations we - // have a buffer in mCurrentTextureBuf, but no corresponding entry for - // it in our slot array. bindUnslottedBuffer handles that situation by - // binding the buffer without touching the EglSlots. - status_t bindUnslottedBufferLocked(EGLDisplay dpy); - - // returns a graphic buffer used when the texture image has been released - static sp getDebugTexImageBuffer(); - - // The default consumer usage flags that GLConsumer always sets on its - // BufferQueue instance; these will be OR:d with any additional flags passed - // from the GLConsumer user. In particular, GLConsumer will always - // consume buffers as hardware textures. - static const uint32_t DEFAULT_USAGE_FLAGS = GraphicBuffer::USAGE_HW_TEXTURE; - - // mCurrentTextureBuf is the graphic buffer of the current texture. It's - // possible that this buffer is not associated with any buffer slot, so we - // must track it separately in order to support the getCurrentBuffer method. - sp mCurrentTextureBuf; - - // mCurrentCrop is the crop rectangle that applies to the current texture. - // It gets set each time updateTexImage is called. - Rect mCurrentCrop; - - // mCurrentTransform is the transform identifier for the current texture. It - // gets set each time updateTexImage is called. - uint32_t mCurrentTransform; - - // mCurrentScalingMode is the scaling mode for the current texture. It gets - // set each time updateTexImage is called. - uint32_t mCurrentScalingMode; - - // mCurrentFence is the fence received from BufferQueue in updateTexImage. - sp mCurrentFence; - - // mCurrentTransformMatrix is the transform matrix for the current texture. - // It gets computed by computeTransformMatrix each time updateTexImage is - // called. - float mCurrentTransformMatrix[16]; - - // mCurrentTimestamp is the timestamp for the current texture. It - // gets set each time updateTexImage is called. - int64_t mCurrentTimestamp; - - // mCurrentFrameNumber is the frame counter for the current texture. - // It gets set each time updateTexImage is called. - int64_t mCurrentFrameNumber; - - uint32_t mDefaultWidth, mDefaultHeight; - - // mFilteringEnabled indicates whether the transform matrix is computed for - // use with bilinear filtering. It defaults to true and is changed by - // setFilteringEnabled(). - bool mFilteringEnabled; - - // mTexName is the name of the OpenGL texture to which streamed images will - // be bound when updateTexImage is called. It is set at construction time - // and can be changed with a call to attachToContext. - uint32_t mTexName; - - // mUseFenceSync indicates whether creation of the EGL_KHR_fence_sync - // extension should be used to prevent buffers from being dequeued before - // it's safe for them to be written. It gets set at construction time and - // never changes. - const bool mUseFenceSync; - - // mTexTarget is the GL texture target with which the GL texture object is - // associated. It is set in the constructor and never changed. It is - // almost always GL_TEXTURE_EXTERNAL_OES except for one use case in Android - // Browser. In that case it is set to GL_TEXTURE_2D to allow - // glCopyTexSubImage to read from the texture. This is a hack to work - // around a GL driver limitation on the number of FBO attachments, which the - // browser's tile cache exceeds. - const uint32_t mTexTarget; - - // EGLSlot contains the information and object references that - // GLConsumer maintains about a BufferQueue buffer slot. - struct EglSlot { - EglSlot() - : mEglImage(EGL_NO_IMAGE_KHR), - mEglFence(EGL_NO_SYNC_KHR) { - } - - // mEglImage is the EGLImage created from mGraphicBuffer. - EGLImageKHR mEglImage; - - // mCropRect is the crop rectangle passed to EGL when mEglImage was - // created. - Rect mCropRect; - - // mFence is the EGL sync object that must signal before the buffer - // associated with this buffer slot may be dequeued. It is initialized - // to EGL_NO_SYNC_KHR when the buffer is created and (optionally, based - // on a compile-time option) set to a new sync object in updateTexImage. - EGLSyncKHR mEglFence; - }; - - // mEglDisplay is the EGLDisplay with which this GLConsumer is currently - // associated. It is intialized to EGL_NO_DISPLAY and gets set to the - // current display when updateTexImage is called for the first time and when - // attachToContext is called. - EGLDisplay mEglDisplay; - - // mEglContext is the OpenGL ES context with which this GLConsumer is - // currently associated. It is initialized to EGL_NO_CONTEXT and gets set - // to the current GL context when updateTexImage is called for the first - // time and when attachToContext is called. - EGLContext mEglContext; - - // mEGLSlots stores the buffers that have been allocated by the BufferQueue - // for each buffer slot. It is initialized to null pointers, and gets - // filled in with the result of BufferQueue::acquire when the - // client dequeues a buffer from a - // slot that has not yet been used. The buffer allocated to a slot will also - // be replaced if the requested buffer usage or geometry differs from that - // of the buffer allocated to a slot. - EglSlot mEglSlots[BufferQueue::NUM_BUFFER_SLOTS]; - - // mCurrentTexture is the buffer slot index of the buffer that is currently - // bound to the OpenGL texture. It is initialized to INVALID_BUFFER_SLOT, - // indicating that no buffer slot is currently bound to the texture. Note, - // however, that a value of INVALID_BUFFER_SLOT does not necessarily mean - // that no buffer is bound to the texture. A call to setBufferCount will - // reset mCurrentTexture to INVALID_BUFFER_SLOT. - int mCurrentTexture; - - // mAttached indicates whether the ConsumerBase is currently attached to - // an OpenGL ES context. For legacy reasons, this is initialized to true, - // indicating that the ConsumerBase is considered to be attached to - // whatever context is current at the time of the first updateTexImage call. - // It is set to false by detachFromContext, and then set to true again by - // attachToContext. - bool mAttached; - - // protects static initialization - static Mutex sStaticInitLock; - - // mReleasedTexImageBuffer is a dummy buffer used when in single buffer - // mode and releaseTexImage() has been called - static sp sReleasedTexImageBuffer; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_CONSUMER_H diff --git a/external/android/include/19/frameworks/native/include/gui/GraphicBufferAlloc.h b/external/android/include/19/frameworks/native/include/gui/GraphicBufferAlloc.h deleted file mode 100644 index b08750c..0000000 --- a/external/android/include/19/frameworks/native/include/gui/GraphicBufferAlloc.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2012 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_SF_GRAPHIC_BUFFER_ALLOC_H -#define ANDROID_SF_GRAPHIC_BUFFER_ALLOC_H - -#include -#include - -#include -#include -#include - -namespace android { -// --------------------------------------------------------------------------- - -class GraphicBuffer; - -class GraphicBufferAlloc : public BnGraphicBufferAlloc { -public: - GraphicBufferAlloc(); - virtual ~GraphicBufferAlloc(); - virtual sp createGraphicBuffer(uint32_t w, uint32_t h, - PixelFormat format, uint32_t usage, status_t* error); -}; - - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_SF_GRAPHIC_BUFFER_ALLOC_H diff --git a/external/android/include/19/frameworks/native/include/gui/GuiConfig.h b/external/android/include/19/frameworks/native/include/gui/GuiConfig.h deleted file mode 100644 index b020ed9..0000000 --- a/external/android/include/19/frameworks/native/include/gui/GuiConfig.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2012 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_GUI_CONFIG_H -#define ANDROID_GUI_CONFIG_H - -#include - -namespace android { - -// Append the libgui configuration details to configStr. -void appendGuiConfigString(String8& configStr); - -}; // namespace android - -#endif /*ANDROID_GUI_CONFIG_H*/ diff --git a/external/android/include/19/frameworks/native/include/gui/IConsumerListener.h b/external/android/include/19/frameworks/native/include/gui/IConsumerListener.h deleted file mode 100644 index ac2f9bb..0000000 --- a/external/android/include/19/frameworks/native/include/gui/IConsumerListener.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2013 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_GUI_ICONSUMERLISTENER_H -#define ANDROID_GUI_ICONSUMERLISTENER_H - -#include -#include - -#include -#include - -#include - -namespace android { -// ---------------------------------------------------------------------------- - -// ConsumerListener is the interface through which the BufferQueue notifies -// the consumer of events that the consumer may wish to react to. Because -// the consumer will generally have a mutex that is locked during calls from -// the consumer to the BufferQueue, these calls from the BufferQueue to the -// consumer *MUST* be called only when the BufferQueue mutex is NOT locked. - -class ConsumerListener : public virtual RefBase { -public: - ConsumerListener() { } - virtual ~ConsumerListener() { } - - // onFrameAvailable is called from queueBuffer each time an additional - // frame becomes available for consumption. This means that frames that - // are queued while in asynchronous mode only trigger the callback if no - // previous frames are pending. Frames queued while in synchronous mode - // always trigger the callback. - // - // This is called without any lock held and can be called concurrently - // by multiple threads. - virtual void onFrameAvailable() = 0; /* Asynchronous */ - - // onBuffersReleased is called to notify the buffer consumer that the - // BufferQueue has released its references to one or more GraphicBuffers - // contained in its slots. The buffer consumer should then call - // BufferQueue::getReleasedBuffers to retrieve the list of buffers - // - // This is called without any lock held and can be called concurrently - // by multiple threads. - virtual void onBuffersReleased() = 0; /* Asynchronous */ -}; - - -class IConsumerListener : public ConsumerListener, public IInterface -{ -public: - DECLARE_META_INTERFACE(ConsumerListener); -}; - -// ---------------------------------------------------------------------------- - -class BnConsumerListener : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_ICONSUMERLISTENER_H diff --git a/external/android/include/19/frameworks/native/include/gui/IDisplayEventConnection.h b/external/android/include/19/frameworks/native/include/gui/IDisplayEventConnection.h deleted file mode 100644 index 86247de..0000000 --- a/external/android/include/19/frameworks/native/include/gui/IDisplayEventConnection.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2011 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_GUI_IDISPLAY_EVENT_CONNECTION_H -#define ANDROID_GUI_IDISPLAY_EVENT_CONNECTION_H - -#include -#include - -#include -#include - -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class BitTube; - -class IDisplayEventConnection : public IInterface -{ -public: - - DECLARE_META_INTERFACE(DisplayEventConnection); - - /* - * getDataChannel() returns a BitTube where to receive the events from - */ - virtual sp getDataChannel() const = 0; - - /* - * setVsyncRate() sets the vsync event delivery rate. A value of - * 1 returns every vsync events. A value of 2 returns every other events, - * etc... a value of 0 returns no event unless requestNextVsync() has - * been called. - */ - virtual void setVsyncRate(uint32_t count) = 0; - - /* - * requestNextVsync() schedules the next vsync event. It has no effect - * if the vsync rate is > 0. - */ - virtual void requestNextVsync() = 0; // asynchronous -}; - -// ---------------------------------------------------------------------------- - -class BnDisplayEventConnection : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_IDISPLAY_EVENT_CONNECTION_H diff --git a/external/android/include/19/frameworks/native/include/gui/IGraphicBufferAlloc.h b/external/android/include/19/frameworks/native/include/gui/IGraphicBufferAlloc.h deleted file mode 100644 index cee41d9..0000000 --- a/external/android/include/19/frameworks/native/include/gui/IGraphicBufferAlloc.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2011 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_GUI_IGRAPHIC_BUFFER_ALLOC_H -#define ANDROID_GUI_IGRAPHIC_BUFFER_ALLOC_H - -#include -#include - -#include -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class GraphicBuffer; - -class IGraphicBufferAlloc : public IInterface -{ -public: - DECLARE_META_INTERFACE(GraphicBufferAlloc); - - /* Create a new GraphicBuffer for the client to use. - */ - virtual sp createGraphicBuffer(uint32_t w, uint32_t h, - PixelFormat format, uint32_t usage, status_t* error) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnGraphicBufferAlloc : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_GUI_IGRAPHIC_BUFFER_ALLOC_H diff --git a/external/android/include/19/frameworks/native/include/gui/IGraphicBufferConsumer.h b/external/android/include/19/frameworks/native/include/gui/IGraphicBufferConsumer.h deleted file mode 100644 index 0e35f13..0000000 --- a/external/android/include/19/frameworks/native/include/gui/IGraphicBufferConsumer.h +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright (C) 2013 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_GUI_IGRAPHICBUFFERCONSUMER_H -#define ANDROID_GUI_IGRAPHICBUFFERCONSUMER_H - -#include -#include - -#include -#include -#include - -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class IConsumerListener; -class GraphicBuffer; -class Fence; - -class IGraphicBufferConsumer : public IInterface { - -public: - - // public facing structure for BufferSlot - class BufferItem : public Flattenable { - friend class Flattenable; - size_t getPodSize() const; - size_t getFlattenedSize() const; - size_t getFdCount() const; - status_t flatten(void*& buffer, size_t& size, int*& fds, size_t& count) const; - status_t unflatten(void const*& buffer, size_t& size, int const*& fds, size_t& count); - - public: - enum { INVALID_BUFFER_SLOT = -1 }; - BufferItem(); - - // mGraphicBuffer points to the buffer allocated for this slot, or is NULL - // if the buffer in this slot has been acquired in the past (see - // BufferSlot.mAcquireCalled). - sp mGraphicBuffer; - - // mFence is a fence that will signal when the buffer is idle. - sp mFence; - - // mCrop is the current crop rectangle for this buffer slot. - Rect mCrop; - - // mTransform is the current transform flags for this buffer slot. - uint32_t mTransform; - - // mScalingMode is the current scaling mode for this buffer slot. - uint32_t mScalingMode; - - // mTimestamp is the current timestamp for this buffer slot. This gets - // to set by queueBuffer each time this slot is queued. - int64_t mTimestamp; - - // mIsAutoTimestamp indicates whether mTimestamp was generated - // automatically when the buffer was queued. - bool mIsAutoTimestamp; - - // mFrameNumber is the number of the queued frame for this slot. - uint64_t mFrameNumber; - - // mBuf is the slot index of this buffer - int mBuf; - - // mIsDroppable whether this buffer was queued with the - // property that it can be replaced by a new buffer for the purpose of - // making sure dequeueBuffer() won't block. - // i.e.: was the BufferQueue in "mDequeueBufferCannotBlock" when this buffer - // was queued. - bool mIsDroppable; - - // Indicates whether this buffer has been seen by a consumer yet - bool mAcquireCalled; - - // Indicates this buffer must be transformed by the inverse transform of the screen - // it is displayed onto. This is applied after mTransform. - bool mTransformToDisplayInverse; - }; - - - // acquireBuffer attempts to acquire ownership of the next pending buffer in - // the BufferQueue. If no buffer is pending then it returns -EINVAL. If a - // buffer is successfully acquired, the information about the buffer is - // returned in BufferItem. If the buffer returned had previously been - // acquired then the BufferItem::mGraphicBuffer field of buffer is set to - // NULL and it is assumed that the consumer still holds a reference to the - // buffer. - // - // If presentWhen is nonzero, it indicates the time when the buffer will - // be displayed on screen. If the buffer's timestamp is farther in the - // future, the buffer won't be acquired, and PRESENT_LATER will be - // returned. The presentation time is in nanoseconds, and the time base - // is CLOCK_MONOTONIC. - virtual status_t acquireBuffer(BufferItem *buffer, nsecs_t presentWhen) = 0; - - // releaseBuffer releases a buffer slot from the consumer back to the - // BufferQueue. This may be done while the buffer's contents are still - // being accessed. The fence will signal when the buffer is no longer - // in use. frameNumber is used to indentify the exact buffer returned. - // - // If releaseBuffer returns STALE_BUFFER_SLOT, then the consumer must free - // any references to the just-released buffer that it might have, as if it - // had received a onBuffersReleased() call with a mask set for the released - // buffer. - // - // Note that the dependencies on EGL will be removed once we switch to using - // the Android HW Sync HAL. - virtual status_t releaseBuffer(int buf, uint64_t frameNumber, - EGLDisplay display, EGLSyncKHR fence, - const sp& releaseFence) = 0; - - // consumerConnect connects a consumer to the BufferQueue. Only one - // consumer may be connected, and when that consumer disconnects the - // BufferQueue is placed into the "abandoned" state, causing most - // interactions with the BufferQueue by the producer to fail. - // controlledByApp indicates whether the consumer is controlled by - // the application. - // - // consumer may not be NULL. - virtual status_t consumerConnect(const sp& consumer, bool controlledByApp) = 0; - - // consumerDisconnect disconnects a consumer from the BufferQueue. All - // buffers will be freed and the BufferQueue is placed in the "abandoned" - // state, causing most interactions with the BufferQueue by the producer to - // fail. - virtual status_t consumerDisconnect() = 0; - - // getReleasedBuffers sets the value pointed to by slotMask to a bit mask - // indicating which buffer slots have been released by the BufferQueue - // but have not yet been released by the consumer. - // - // This should be called from the onBuffersReleased() callback. - virtual status_t getReleasedBuffers(uint32_t* slotMask) = 0; - - // setDefaultBufferSize is used to set the size of buffers returned by - // dequeueBuffer when a width and height of zero is requested. Default - // is 1x1. - virtual status_t setDefaultBufferSize(uint32_t w, uint32_t h) = 0; - - // setDefaultMaxBufferCount sets the default value for the maximum buffer - // count (the initial default is 2). If the producer has requested a - // buffer count using setBufferCount, the default buffer count will only - // take effect if the producer sets the count back to zero. - // - // The count must be between 2 and NUM_BUFFER_SLOTS, inclusive. - virtual status_t setDefaultMaxBufferCount(int bufferCount) = 0; - - // disableAsyncBuffer disables the extra buffer used in async mode - // (when both producer and consumer have set their "isControlledByApp" - // flag) and has dequeueBuffer() return WOULD_BLOCK instead. - // - // This can only be called before consumerConnect(). - virtual status_t disableAsyncBuffer() = 0; - - // setMaxAcquiredBufferCount sets the maximum number of buffers that can - // be acquired by the consumer at one time (default 1). This call will - // fail if a producer is connected to the BufferQueue. - virtual status_t setMaxAcquiredBufferCount(int maxAcquiredBuffers) = 0; - - // setConsumerName sets the name used in logging - virtual void setConsumerName(const String8& name) = 0; - - // setDefaultBufferFormat allows the BufferQueue to create - // GraphicBuffers of a defaultFormat if no format is specified - // in dequeueBuffer. Formats are enumerated in graphics.h; the - // initial default is HAL_PIXEL_FORMAT_RGBA_8888. - virtual status_t setDefaultBufferFormat(uint32_t defaultFormat) = 0; - - // setConsumerUsageBits will turn on additional usage bits for dequeueBuffer. - // These are merged with the bits passed to dequeueBuffer. The values are - // enumerated in gralloc.h, e.g. GRALLOC_USAGE_HW_RENDER; the default is 0. - virtual status_t setConsumerUsageBits(uint32_t usage) = 0; - - // setTransformHint bakes in rotation to buffers so overlays can be used. - // The values are enumerated in window.h, e.g. - // NATIVE_WINDOW_TRANSFORM_ROT_90. The default is 0 (no transform). - virtual status_t setTransformHint(uint32_t hint) = 0; - - // dump state into a string - virtual void dump(String8& result, const char* prefix) const = 0; - -public: - DECLARE_META_INTERFACE(GraphicBufferConsumer); -}; - -// ---------------------------------------------------------------------------- - -class BnGraphicBufferConsumer : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_IGRAPHICBUFFERCONSUMER_H diff --git a/external/android/include/19/frameworks/native/include/gui/IGraphicBufferProducer.h b/external/android/include/19/frameworks/native/include/gui/IGraphicBufferProducer.h deleted file mode 100644 index 342ba08..0000000 --- a/external/android/include/19/frameworks/native/include/gui/IGraphicBufferProducer.h +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_IGRAPHICBUFFERPRODUCER_H -#define ANDROID_GUI_IGRAPHICBUFFERPRODUCER_H - -#include -#include - -#include -#include - -#include - -#include -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class Surface; - -/* - * This class defines the Binder IPC interface for the producer side of - * a queue of graphics buffers. It's used to send graphics data from one - * component to another. For example, a class that decodes video for - * playback might use this to provide frames. This is typically done - * indirectly, through Surface. - * - * The underlying mechanism is a BufferQueue, which implements - * BnGraphicBufferProducer. In normal operation, the producer calls - * dequeueBuffer() to get an empty buffer, fills it with data, then - * calls queueBuffer() to make it available to the consumer. - * - * This class was previously called ISurfaceTexture. - */ -class IGraphicBufferProducer : public IInterface -{ -public: - DECLARE_META_INTERFACE(GraphicBufferProducer); - - enum { - BUFFER_NEEDS_REALLOCATION = 0x1, - RELEASE_ALL_BUFFERS = 0x2, - }; - - // requestBuffer requests a new buffer for the given index. The server (i.e. - // the IGraphicBufferProducer implementation) assigns the newly created - // buffer to the given slot index, and the client is expected to mirror the - // slot->buffer mapping so that it's not necessary to transfer a - // GraphicBuffer for every dequeue operation. - virtual status_t requestBuffer(int slot, sp* buf) = 0; - - // setBufferCount sets the number of buffer slots available. Calling this - // will also cause all buffer slots to be emptied. The caller should empty - // its mirrored copy of the buffer slots when calling this method. - virtual status_t setBufferCount(int bufferCount) = 0; - - // dequeueBuffer requests a new buffer slot for the client to use. Ownership - // of the slot is transfered to the client, meaning that the server will not - // use the contents of the buffer associated with that slot. The slot index - // returned may or may not contain a buffer. If the slot is empty the client - // should call requestBuffer to assign a new buffer to that slot. The client - // is expected to either call cancelBuffer on the dequeued slot or to fill - // in the contents of its associated buffer contents and call queueBuffer. - // If dequeueBuffer return BUFFER_NEEDS_REALLOCATION, the client is - // expected to call requestBuffer immediately. - // - // The fence parameter will be updated to hold the fence associated with - // the buffer. The contents of the buffer must not be overwritten until the - // fence signals. If the fence is NULL, the buffer may be written - // immediately. - // - // The async parameter sets whether we're in asynchrnous mode for this - // deququeBuffer() call. - virtual status_t dequeueBuffer(int *slot, sp* fence, bool async, - uint32_t w, uint32_t h, uint32_t format, uint32_t usage) = 0; - - // queueBuffer indicates that the client has finished filling in the - // contents of the buffer associated with slot and transfers ownership of - // that slot back to the server. It is not valid to call queueBuffer on a - // slot that is not owned by the client or one for which a buffer associated - // via requestBuffer. In addition, a timestamp must be provided by the - // client for this buffer. The timestamp is measured in nanoseconds, and - // must be monotonically increasing. Its other properties (zero point, etc) - // are client-dependent, and should be documented by the client. - // - // The async parameter sets whether we're queuing a buffer in asynchronous mode. - // - // outWidth, outHeight and outTransform are filled with the default width - // and height of the window and current transform applied to buffers, - // respectively. - - struct QueueBufferInput : public Flattenable { - friend class Flattenable; - inline QueueBufferInput(const Parcel& parcel); - inline QueueBufferInput(int64_t timestamp, bool isAutoTimestamp, - const Rect& crop, int scalingMode, uint32_t transform, bool async, - const sp& fence) - : timestamp(timestamp), isAutoTimestamp(isAutoTimestamp), crop(crop), - scalingMode(scalingMode), transform(transform), async(async), - fence(fence) { } - inline void deflate(int64_t* outTimestamp, bool* outIsAutoTimestamp, - Rect* outCrop, int* outScalingMode, uint32_t* outTransform, - bool* outAsync, sp* outFence) const { - *outTimestamp = timestamp; - *outIsAutoTimestamp = bool(isAutoTimestamp); - *outCrop = crop; - *outScalingMode = scalingMode; - *outTransform = transform; - *outAsync = bool(async); - *outFence = fence; - } - - // Flattenable protocol - size_t getFlattenedSize() const; - size_t getFdCount() const; - status_t flatten(void*& buffer, size_t& size, int*& fds, size_t& count) const; - status_t unflatten(void const*& buffer, size_t& size, int const*& fds, size_t& count); - - private: - int64_t timestamp; - int isAutoTimestamp; - Rect crop; - int scalingMode; - uint32_t transform; - int async; - sp fence; - }; - - // QueueBufferOutput must be a POD structure - struct QueueBufferOutput { - inline QueueBufferOutput() { } - inline void deflate(uint32_t* outWidth, - uint32_t* outHeight, - uint32_t* outTransformHint, - uint32_t* outNumPendingBuffers) const { - *outWidth = width; - *outHeight = height; - *outTransformHint = transformHint; - *outNumPendingBuffers = numPendingBuffers; - } - inline void inflate(uint32_t inWidth, uint32_t inHeight, - uint32_t inTransformHint, uint32_t inNumPendingBuffers) { - width = inWidth; - height = inHeight; - transformHint = inTransformHint; - numPendingBuffers = inNumPendingBuffers; - } - private: - uint32_t width; - uint32_t height; - uint32_t transformHint; - uint32_t numPendingBuffers; - }; - - virtual status_t queueBuffer(int slot, - const QueueBufferInput& input, QueueBufferOutput* output) = 0; - - // cancelBuffer indicates that the client does not wish to fill in the - // buffer associated with slot and transfers ownership of the slot back to - // the server. - virtual void cancelBuffer(int slot, const sp& fence) = 0; - - // query retrieves some information for this surface - // 'what' tokens allowed are that of android_natives.h - virtual int query(int what, int* value) = 0; - - // connect attempts to connect a client API to the IGraphicBufferProducer. - // This must be called before any other IGraphicBufferProducer methods are - // called except for getAllocator. - // - // This method will fail if the connect was previously called on the - // IGraphicBufferProducer and no corresponding disconnect call was made. - // - // outWidth, outHeight and outTransform are filled with the default width - // and height of the window and current transform applied to buffers, - // respectively. The token needs to be any binder object that lives in the - // producer process -- it is solely used for obtaining a death notification - // when the producer is killed. - virtual status_t connect(const sp& token, - int api, bool producerControlledByApp, QueueBufferOutput* output) = 0; - - // disconnect attempts to disconnect a client API from the - // IGraphicBufferProducer. Calling this method will cause any subsequent - // calls to other IGraphicBufferProducer methods to fail except for - // getAllocator and connect. Successfully calling connect after this will - // allow the other methods to succeed again. - // - // This method will fail if the the IGraphicBufferProducer is not currently - // connected to the specified client API. - virtual status_t disconnect(int api) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnGraphicBufferProducer : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_IGRAPHICBUFFERPRODUCER_H diff --git a/external/android/include/19/frameworks/native/include/gui/ISensorEventConnection.h b/external/android/include/19/frameworks/native/include/gui/ISensorEventConnection.h deleted file mode 100644 index f64c6b8..0000000 --- a/external/android/include/19/frameworks/native/include/gui/ISensorEventConnection.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_ISENSOR_EVENT_CONNECTION_H -#define ANDROID_GUI_ISENSOR_EVENT_CONNECTION_H - -#include -#include - -#include -#include - -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class BitTube; - -class ISensorEventConnection : public IInterface -{ -public: - DECLARE_META_INTERFACE(SensorEventConnection); - - virtual sp getSensorChannel() const = 0; - virtual status_t enableDisable(int handle, bool enabled, nsecs_t samplingPeriodNs, - nsecs_t maxBatchReportLatencyNs, int reservedFlags) = 0; - virtual status_t setEventRate(int handle, nsecs_t ns) = 0; - virtual status_t flush() = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnSensorEventConnection : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_ISENSOR_EVENT_CONNECTION_H diff --git a/external/android/include/19/frameworks/native/include/gui/ISensorServer.h b/external/android/include/19/frameworks/native/include/gui/ISensorServer.h deleted file mode 100644 index 9c8afc5..0000000 --- a/external/android/include/19/frameworks/native/include/gui/ISensorServer.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_ISENSORSERVER_H -#define ANDROID_GUI_ISENSORSERVER_H - -#include -#include - -#include -#include - -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class Sensor; -class ISensorEventConnection; - -class ISensorServer : public IInterface -{ -public: - DECLARE_META_INTERFACE(SensorServer); - - virtual Vector getSensorList() = 0; - virtual sp createSensorEventConnection() = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnSensorServer : public BnInterface -{ -public: - virtual status_t onTransact( uint32_t code, - const Parcel& data, - Parcel* reply, - uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_ISENSORSERVER_H diff --git a/external/android/include/19/frameworks/native/include/gui/ISurfaceComposer.h b/external/android/include/19/frameworks/native/include/gui/ISurfaceComposer.h deleted file mode 100644 index 5c3c99c..0000000 --- a/external/android/include/19/frameworks/native/include/gui/ISurfaceComposer.h +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (C) 2006 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_GUI_ISURFACE_COMPOSER_H -#define ANDROID_GUI_ISURFACE_COMPOSER_H - -#include -#include - -#include -#include - -#include - -#include - -#include -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class ComposerState; -class DisplayState; -class DisplayInfo; -class IDisplayEventConnection; -class IMemoryHeap; - -/* - * This class defines the Binder IPC interface for accessing various - * SurfaceFlinger features. - */ -class ISurfaceComposer: public IInterface { -public: - DECLARE_META_INTERFACE(SurfaceComposer); - - // flags for setTransactionState() - enum { - eSynchronous = 0x01, - eAnimation = 0x02, - }; - - enum { - eDisplayIdMain = 0, - eDisplayIdHdmi = 1 - }; - - /* create connection with surface flinger, requires - * ACCESS_SURFACE_FLINGER permission - */ - virtual sp createConnection() = 0; - - /* create a graphic buffer allocator - */ - virtual sp createGraphicBufferAlloc() = 0; - - /* return an IDisplayEventConnection */ - virtual sp createDisplayEventConnection() = 0; - - /* create a virtual display - * requires ACCESS_SURFACE_FLINGER permission. - */ - virtual sp createDisplay(const String8& displayName, - bool secure) = 0; - - /* destroy a virtual display - * requires ACCESS_SURFACE_FLINGER permission. - */ - virtual void destroyDisplay(const sp& display) = 0; - - /* get the token for the existing default displays. possible values - * for id are eDisplayIdMain and eDisplayIdHdmi. - */ - virtual sp getBuiltInDisplay(int32_t id) = 0; - - /* open/close transactions. requires ACCESS_SURFACE_FLINGER permission */ - virtual void setTransactionState(const Vector& state, - const Vector& displays, uint32_t flags) = 0; - - /* signal that we're done booting. - * Requires ACCESS_SURFACE_FLINGER permission - */ - virtual void bootFinished() = 0; - - /* verify that an IGraphicBufferProducer was created by SurfaceFlinger. - */ - virtual bool authenticateSurfaceTexture( - const sp& surface) const = 0; - - /* triggers screen off and waits for it to complete - * requires ACCESS_SURFACE_FLINGER permission. - */ - virtual void blank(const sp& display) = 0; - - /* triggers screen on and waits for it to complete - * requires ACCESS_SURFACE_FLINGER permission. - */ - virtual void unblank(const sp& display) = 0; - - /* returns information about a display - * intended to be used to get information about built-in displays */ - virtual status_t getDisplayInfo(const sp& display, DisplayInfo* info) = 0; - - /* Capture the specified screen. requires READ_FRAME_BUFFER permission - * This function will fail if there is a secure window on screen. - */ - virtual status_t captureScreen(const sp& display, - const sp& producer, - uint32_t reqWidth, uint32_t reqHeight, - uint32_t minLayerZ, uint32_t maxLayerZ) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnSurfaceComposer: public BnInterface { -public: - enum { - // Note: BOOT_FINISHED must remain this value, it is called from - // Java by ActivityManagerService. - BOOT_FINISHED = IBinder::FIRST_CALL_TRANSACTION, - CREATE_CONNECTION, - CREATE_GRAPHIC_BUFFER_ALLOC, - CREATE_DISPLAY_EVENT_CONNECTION, - CREATE_DISPLAY, - DESTROY_DISPLAY, - GET_BUILT_IN_DISPLAY, - SET_TRANSACTION_STATE, - AUTHENTICATE_SURFACE, - BLANK, - UNBLANK, - GET_DISPLAY_INFO, - CONNECT_DISPLAY, - CAPTURE_SCREEN, - }; - - virtual status_t onTransact(uint32_t code, const Parcel& data, - Parcel* reply, uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_GUI_ISURFACE_COMPOSER_H diff --git a/external/android/include/19/frameworks/native/include/gui/ISurfaceComposerClient.h b/external/android/include/19/frameworks/native/include/gui/ISurfaceComposerClient.h deleted file mode 100644 index cb9816f..0000000 --- a/external/android/include/19/frameworks/native/include/gui/ISurfaceComposerClient.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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_GUI_ISURFACE_COMPOSER_CLIENT_H -#define ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H - -#include -#include - -#include -#include - -#include - -#include - -namespace android { -// ---------------------------------------------------------------------------- - -class IGraphicBufferProducer; - -class ISurfaceComposerClient : public IInterface -{ -public: - DECLARE_META_INTERFACE(SurfaceComposerClient); - - // flags for createSurface() - enum { // (keep in sync with Surface.java) - eHidden = 0x00000004, - eDestroyBackbuffer = 0x00000020, - eSecure = 0x00000080, - eNonPremultiplied = 0x00000100, - eOpaque = 0x00000400, - eProtectedByApp = 0x00000800, - eProtectedByDRM = 0x00001000, - - eFXSurfaceNormal = 0x00000000, - eFXSurfaceDim = 0x00020000, - eFXSurfaceMask = 0x000F0000, - }; - - /* - * Requires ACCESS_SURFACE_FLINGER permission - */ - virtual status_t createSurface( - const String8& name, uint32_t w, uint32_t h, - PixelFormat format, uint32_t flags, - sp* handle, - sp* gbp) = 0; - - /* - * Requires ACCESS_SURFACE_FLINGER permission - */ - virtual status_t destroySurface(const sp& handle) = 0; -}; - -// ---------------------------------------------------------------------------- - -class BnSurfaceComposerClient: public BnInterface { -public: - virtual status_t onTransact(uint32_t code, const Parcel& data, - Parcel* reply, uint32_t flags = 0); -}; - -// ---------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H diff --git a/external/android/include/19/frameworks/native/include/gui/Sensor.h b/external/android/include/19/frameworks/native/include/gui/Sensor.h deleted file mode 100644 index 0c81426..0000000 --- a/external/android/include/19/frameworks/native/include/gui/Sensor.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_SENSOR_H -#define ANDROID_GUI_SENSOR_H - -#include -#include - -#include -#include -#include -#include - -#include - -#include - -// ---------------------------------------------------------------------------- -// Concrete types for the NDK -struct ASensor { }; - -// ---------------------------------------------------------------------------- -namespace android { -// ---------------------------------------------------------------------------- - -class Parcel; - -// ---------------------------------------------------------------------------- - -class Sensor : public ASensor, public LightFlattenable -{ -public: - enum { - TYPE_ACCELEROMETER = ASENSOR_TYPE_ACCELEROMETER, - TYPE_MAGNETIC_FIELD = ASENSOR_TYPE_MAGNETIC_FIELD, - TYPE_GYROSCOPE = ASENSOR_TYPE_GYROSCOPE, - TYPE_LIGHT = ASENSOR_TYPE_LIGHT, - TYPE_PROXIMITY = ASENSOR_TYPE_PROXIMITY - }; - - Sensor(); - Sensor(struct sensor_t const* hwSensor, int halVersion = 0); - ~Sensor(); - - const String8& getName() const; - const String8& getVendor() const; - int32_t getHandle() const; - int32_t getType() const; - float getMinValue() const; - float getMaxValue() const; - float getResolution() const; - float getPowerUsage() const; - int32_t getMinDelay() const; - nsecs_t getMinDelayNs() const; - int32_t getVersion() const; - int32_t getFifoReservedEventCount() const; - int32_t getFifoMaxEventCount() const; - - // LightFlattenable protocol - inline bool isFixedSize() const { return false; } - size_t getFlattenedSize() const; - status_t flatten(void* buffer, size_t size) const; - status_t unflatten(void const* buffer, size_t size); - -private: - String8 mName; - String8 mVendor; - int32_t mHandle; - int32_t mType; - float mMinValue; - float mMaxValue; - float mResolution; - float mPower; - int32_t mMinDelay; - int32_t mVersion; - int32_t mFifoReservedEventCount; - int32_t mFifoMaxEventCount; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_SENSOR_H diff --git a/external/android/include/19/frameworks/native/include/gui/SensorEventQueue.h b/external/android/include/19/frameworks/native/include/gui/SensorEventQueue.h deleted file mode 100644 index 0bfc7a0..0000000 --- a/external/android/include/19/frameworks/native/include/gui/SensorEventQueue.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2010 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_SENSOR_EVENT_QUEUE_H -#define ANDROID_SENSOR_EVENT_QUEUE_H - -#include -#include - -#include -#include -#include - -#include - -// ---------------------------------------------------------------------------- - -struct ALooper; -struct ASensorEvent; - -// Concrete types for the NDK -struct ASensorEventQueue { - ALooper* looper; -}; - -// ---------------------------------------------------------------------------- -namespace android { -// ---------------------------------------------------------------------------- - -class ISensorEventConnection; -class Sensor; -class Looper; - -// ---------------------------------------------------------------------------- - -class SensorEventQueue : public ASensorEventQueue, public RefBase -{ -public: - - enum { MAX_RECEIVE_BUFFER_EVENT_COUNT = 256 }; - - SensorEventQueue(const sp& connection); - virtual ~SensorEventQueue(); - virtual void onFirstRef(); - - int getFd() const; - - static ssize_t write(const sp& tube, - ASensorEvent const* events, size_t numEvents); - - ssize_t read(ASensorEvent* events, size_t numEvents); - - status_t waitForEvent() const; - status_t wake() const; - - status_t enableSensor(Sensor const* sensor) const; - status_t disableSensor(Sensor const* sensor) const; - status_t setEventRate(Sensor const* sensor, nsecs_t ns) const; - - // these are here only to support SensorManager.java - status_t enableSensor(int32_t handle, int32_t samplingPeriodUs, int maxBatchReportLatencyUs, - int reservedFlags) const; - status_t disableSensor(int32_t handle) const; - status_t flush() const; - -private: - sp getLooper() const; - sp mSensorEventConnection; - sp mSensorChannel; - mutable Mutex mLock; - mutable sp mLooper; - ASensorEvent* mRecBuffer; - size_t mAvailable; - size_t mConsumed; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_SENSOR_EVENT_QUEUE_H diff --git a/external/android/include/19/frameworks/native/include/gui/SensorManager.h b/external/android/include/19/frameworks/native/include/gui/SensorManager.h deleted file mode 100644 index 3176462..0000000 --- a/external/android/include/19/frameworks/native/include/gui/SensorManager.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_SENSOR_MANAGER_H -#define ANDROID_GUI_SENSOR_MANAGER_H - -#include -#include - -#include - -#include -#include -#include -#include - -#include - -// ---------------------------------------------------------------------------- -// Concrete types for the NDK -struct ASensorManager { }; - -// ---------------------------------------------------------------------------- -namespace android { -// ---------------------------------------------------------------------------- - -class ISensorServer; -class Sensor; -class SensorEventQueue; - -// ---------------------------------------------------------------------------- - -class SensorManager : - public ASensorManager, - public Singleton -{ -public: - SensorManager(); - ~SensorManager(); - - ssize_t getSensorList(Sensor const* const** list) const; - Sensor const* getDefaultSensor(int type); - sp createEventQueue(); - -private: - // DeathRecipient interface - void sensorManagerDied(); - - status_t assertStateLocked() const; - -private: - mutable Mutex mLock; - mutable sp mSensorServer; - mutable Sensor const** mSensorList; - mutable Vector mSensors; - mutable sp mDeathObserver; -}; - -// ---------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_SENSOR_MANAGER_H diff --git a/external/android/include/19/frameworks/native/include/gui/Surface.h b/external/android/include/19/frameworks/native/include/gui/Surface.h deleted file mode 100644 index 6f8a97c..0000000 --- a/external/android/include/19/frameworks/native/include/gui/Surface.h +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright (C) 2010 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_GUI_SURFACE_H -#define ANDROID_GUI_SURFACE_H - -#include -#include - -#include -#include - -#include -#include -#include - -struct ANativeWindow_Buffer; - -namespace android { - -/* - * An implementation of ANativeWindow that feeds graphics buffers into a - * BufferQueue. - * - * This is typically used by programs that want to render frames through - * some means (maybe OpenGL, a software renderer, or a hardware decoder) - * and have the frames they create forwarded to SurfaceFlinger for - * compositing. For example, a video decoder could render a frame and call - * eglSwapBuffers(), which invokes ANativeWindow callbacks defined by - * Surface. Surface then forwards the buffers through Binder IPC - * to the BufferQueue's producer interface, providing the new frame to a - * consumer such as GLConsumer. - */ -class Surface - : public ANativeObjectBase -{ -public: - - /* - * creates a Surface from the given IGraphicBufferProducer (which concrete - * implementation is a BufferQueue). - * - * Surface is mainly state-less while it's disconnected, it can be - * viewed as a glorified IGraphicBufferProducer holder. It's therefore - * safe to create other Surfaces from the same IGraphicBufferProducer. - * - * However, once a Surface is connected, it'll prevent other Surfaces - * referring to the same IGraphicBufferProducer to become connected and - * therefore prevent them to be used as actual producers of buffers. - * - * the controlledByApp flag indicates that this Surface (producer) is - * controlled by the application. This flag is used at connect time. - */ - Surface(const sp& bufferProducer, bool controlledByApp = false); - - /* getIGraphicBufferProducer() returns the IGraphicBufferProducer this - * Surface was created with. Usually it's an error to use the - * IGraphicBufferProducer while the Surface is connected. - */ - sp getIGraphicBufferProducer() const; - - /* convenience function to check that the given surface is non NULL as - * well as its IGraphicBufferProducer */ - static bool isValid(const sp& surface) { - return surface != NULL && surface->getIGraphicBufferProducer() != NULL; - } - -protected: - virtual ~Surface(); - -private: - // can't be copied - Surface& operator = (const Surface& rhs); - Surface(const Surface& rhs); - - // ANativeWindow hooks - static int hook_cancelBuffer(ANativeWindow* window, - ANativeWindowBuffer* buffer, int fenceFd); - static int hook_dequeueBuffer(ANativeWindow* window, - ANativeWindowBuffer** buffer, int* fenceFd); - static int hook_perform(ANativeWindow* window, int operation, ...); - static int hook_query(const ANativeWindow* window, int what, int* value); - static int hook_queueBuffer(ANativeWindow* window, - ANativeWindowBuffer* buffer, int fenceFd); - static int hook_setSwapInterval(ANativeWindow* window, int interval); - - static int hook_cancelBuffer_DEPRECATED(ANativeWindow* window, - ANativeWindowBuffer* buffer); - static int hook_dequeueBuffer_DEPRECATED(ANativeWindow* window, - ANativeWindowBuffer** buffer); - static int hook_lockBuffer_DEPRECATED(ANativeWindow* window, - ANativeWindowBuffer* buffer); - static int hook_queueBuffer_DEPRECATED(ANativeWindow* window, - ANativeWindowBuffer* buffer); - - int dispatchConnect(va_list args); - int dispatchDisconnect(va_list args); - int dispatchSetBufferCount(va_list args); - int dispatchSetBuffersGeometry(va_list args); - int dispatchSetBuffersDimensions(va_list args); - int dispatchSetBuffersUserDimensions(va_list args); - int dispatchSetBuffersFormat(va_list args); - int dispatchSetScalingMode(va_list args); - int dispatchSetBuffersTransform(va_list args); - int dispatchSetBuffersTimestamp(va_list args); - int dispatchSetCrop(va_list args); - int dispatchSetPostTransformCrop(va_list args); - int dispatchSetUsage(va_list args); - int dispatchLock(va_list args); - int dispatchUnlockAndPost(va_list args); - -protected: - virtual int dequeueBuffer(ANativeWindowBuffer** buffer, int* fenceFd); - virtual int cancelBuffer(ANativeWindowBuffer* buffer, int fenceFd); - virtual int queueBuffer(ANativeWindowBuffer* buffer, int fenceFd); - virtual int perform(int operation, va_list args); - virtual int query(int what, int* value) const; - virtual int setSwapInterval(int interval); - - virtual int lockBuffer_DEPRECATED(ANativeWindowBuffer* buffer); - - virtual int connect(int api); - virtual int disconnect(int api); - virtual int setBufferCount(int bufferCount); - virtual int setBuffersDimensions(int w, int h); - virtual int setBuffersUserDimensions(int w, int h); - virtual int setBuffersFormat(int format); - virtual int setScalingMode(int mode); - virtual int setBuffersTransform(int transform); - virtual int setBuffersTimestamp(int64_t timestamp); - virtual int setCrop(Rect const* rect); - virtual int setUsage(uint32_t reqUsage); - -public: - virtual int lock(ANativeWindow_Buffer* outBuffer, ARect* inOutDirtyBounds); - virtual int unlockAndPost(); - -protected: - enum { NUM_BUFFER_SLOTS = BufferQueue::NUM_BUFFER_SLOTS }; - enum { DEFAULT_FORMAT = PIXEL_FORMAT_RGBA_8888 }; - -private: - void freeAllBuffers(); - int getSlotFromBufferLocked(android_native_buffer_t* buffer) const; - - struct BufferSlot { - sp buffer; - Region dirtyRegion; - }; - - // mSurfaceTexture is the interface to the surface texture server. All - // operations on the surface texture client ultimately translate into - // interactions with the server using this interface. - // TODO: rename to mBufferProducer - sp mGraphicBufferProducer; - - // mSlots stores the buffers that have been allocated for each buffer slot. - // It is initialized to null pointers, and gets filled in with the result of - // IGraphicBufferProducer::requestBuffer when the client dequeues a buffer from a - // slot that has not yet been used. The buffer allocated to a slot will also - // be replaced if the requested buffer usage or geometry differs from that - // of the buffer allocated to a slot. - BufferSlot mSlots[NUM_BUFFER_SLOTS]; - - // mReqWidth is the buffer width that will be requested at the next dequeue - // operation. It is initialized to 1. - uint32_t mReqWidth; - - // mReqHeight is the buffer height that will be requested at the next - // dequeue operation. It is initialized to 1. - uint32_t mReqHeight; - - // mReqFormat is the buffer pixel format that will be requested at the next - // deuque operation. It is initialized to PIXEL_FORMAT_RGBA_8888. - uint32_t mReqFormat; - - // mReqUsage is the set of buffer usage flags that will be requested - // at the next deuque operation. It is initialized to 0. - uint32_t mReqUsage; - - // mTimestamp is the timestamp that will be used for the next buffer queue - // operation. It defaults to NATIVE_WINDOW_TIMESTAMP_AUTO, which means that - // a timestamp is auto-generated when queueBuffer is called. - int64_t mTimestamp; - - // mCrop is the crop rectangle that will be used for the next buffer - // that gets queued. It is set by calling setCrop. - Rect mCrop; - - // mScalingMode is the scaling mode that will be used for the next - // buffers that get queued. It is set by calling setScalingMode. - int mScalingMode; - - // mTransform is the transform identifier that will be used for the next - // buffer that gets queued. It is set by calling setTransform. - uint32_t mTransform; - - // mDefaultWidth is default width of the buffers, regardless of the - // native_window_set_buffers_dimensions call. - uint32_t mDefaultWidth; - - // mDefaultHeight is default height of the buffers, regardless of the - // native_window_set_buffers_dimensions call. - uint32_t mDefaultHeight; - - // mUserWidth, if non-zero, is an application-specified override - // of mDefaultWidth. This is lower priority than the width set by - // native_window_set_buffers_dimensions. - uint32_t mUserWidth; - - // mUserHeight, if non-zero, is an application-specified override - // of mDefaultHeight. This is lower priority than the height set - // by native_window_set_buffers_dimensions. - uint32_t mUserHeight; - - // mTransformHint is the transform probably applied to buffers of this - // window. this is only a hint, actual transform may differ. - uint32_t mTransformHint; - - // mProducerControlledByApp whether this buffer producer is controlled - // by the application - bool mProducerControlledByApp; - - // mSwapIntervalZero set if we should drop buffers at queue() time to - // achieve an asynchronous swap interval - bool mSwapIntervalZero; - - // mConsumerRunningBehind whether the consumer is running more than - // one buffer behind the producer. - mutable bool mConsumerRunningBehind; - - // mMutex is the mutex used to prevent concurrent access to the member - // variables of Surface objects. It must be locked whenever the - // member variables are accessed. - mutable Mutex mMutex; - - // must be used from the lock/unlock thread - sp mLockedBuffer; - sp mPostedBuffer; - bool mConnectedToCpu; - - // must be accessed from lock/unlock thread only - Region mDirtyRegion; -}; - -}; // namespace android - -#endif // ANDROID_GUI_SURFACE_H diff --git a/external/android/include/19/frameworks/native/include/gui/SurfaceComposerClient.h b/external/android/include/19/frameworks/native/include/gui/SurfaceComposerClient.h deleted file mode 100644 index e982bcd..0000000 --- a/external/android/include/19/frameworks/native/include/gui/SurfaceComposerClient.h +++ /dev/null @@ -1,207 +0,0 @@ -/* - * 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_GUI_SURFACE_COMPOSER_CLIENT_H -#define ANDROID_GUI_SURFACE_COMPOSER_CLIENT_H - -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include - -#include -#include - -namespace android { - -// --------------------------------------------------------------------------- - -class DisplayInfo; -class Composer; -class ISurfaceComposerClient; -class IGraphicBufferProducer; -class Region; - -// --------------------------------------------------------------------------- - -class SurfaceComposerClient : public RefBase -{ - friend class Composer; -public: - SurfaceComposerClient(); - virtual ~SurfaceComposerClient(); - - // Always make sure we could initialize - status_t initCheck() const; - - // Return the connection of this client - sp connection() const; - - // Forcibly remove connection before all references have gone away. - void dispose(); - - // callback when the composer is dies - status_t linkToComposerDeath(const sp& recipient, - void* cookie = NULL, uint32_t flags = 0); - - // Get information about a display - static status_t getDisplayInfo(const sp& display, DisplayInfo* info); - - /* triggers screen off and waits for it to complete */ - static void blankDisplay(const sp& display); - - /* triggers screen on and waits for it to complete */ - static void unblankDisplay(const sp& display); - - // ------------------------------------------------------------------------ - // surface creation / destruction - - //! Create a surface - sp createSurface( - const String8& name,// name of the surface - uint32_t w, // width in pixel - uint32_t h, // height in pixel - PixelFormat format, // pixel-format desired - uint32_t flags = 0 // usage flags - ); - - //! Create a virtual display - static sp createDisplay(const String8& displayName, bool secure); - - //! Destroy a virtual display - static void destroyDisplay(const sp& display); - - //! Get the token for the existing default displays. - //! Possible values for id are eDisplayIdMain and eDisplayIdHdmi. - static sp getBuiltInDisplay(int32_t id); - - // ------------------------------------------------------------------------ - // Composer parameters - // All composer parameters must be changed within a transaction - // several surfaces can be updated in one transaction, all changes are - // committed at once when the transaction is closed. - // closeGlobalTransaction() requires an IPC with the server. - - //! Open a composer transaction on all active SurfaceComposerClients. - static void openGlobalTransaction(); - - //! Close a composer transaction on all active SurfaceComposerClients. - static void closeGlobalTransaction(bool synchronous = false); - - //! Flag the currently open transaction as an animation transaction. - static void setAnimationTransaction(); - - status_t hide(const sp& id); - status_t show(const sp& id); - status_t setFlags(const sp& id, uint32_t flags, uint32_t mask); - status_t setTransparentRegionHint(const sp& id, const Region& transparent); - status_t setLayer(const sp& id, int32_t layer); - status_t setAlpha(const sp& id, float alpha=1.0f); - status_t setMatrix(const sp& id, float dsdx, float dtdx, float dsdy, float dtdy); - status_t setPosition(const sp& id, float x, float y); - status_t setSize(const sp& id, uint32_t w, uint32_t h); - status_t setCrop(const sp& id, const Rect& crop); - status_t setLayerStack(const sp& id, uint32_t layerStack); - status_t destroySurface(const sp& id); - - static void setDisplaySurface(const sp& token, - const sp& bufferProducer); - static void setDisplayLayerStack(const sp& token, - uint32_t layerStack); - - /* setDisplayProjection() defines the projection of layer stacks - * to a given display. - * - * - orientation defines the display's orientation. - * - layerStackRect defines which area of the window manager coordinate - * space will be used. - * - displayRect defines where on the display will layerStackRect be - * mapped to. displayRect is specified post-orientation, that is - * it uses the orientation seen by the end-user. - */ - static void setDisplayProjection(const sp& token, - uint32_t orientation, - const Rect& layerStackRect, - const Rect& displayRect); - -private: - virtual void onFirstRef(); - Composer& getComposer(); - - mutable Mutex mLock; - status_t mStatus; - sp mClient; - Composer& mComposer; -}; - -// --------------------------------------------------------------------------- - -class ScreenshotClient -{ -public: - static status_t capture( - const sp& display, - const sp& producer, - uint32_t reqWidth, uint32_t reqHeight, - uint32_t minLayerZ, uint32_t maxLayerZ); - -private: - mutable sp mCpuConsumer; - mutable sp mBufferQueue; - CpuConsumer::LockedBuffer mBuffer; - bool mHaveBuffer; - -public: - ScreenshotClient(); - ~ScreenshotClient(); - - // frees the previous screenshot and capture a new one - status_t update(const sp& display); - status_t update(const sp& display, - uint32_t reqWidth, uint32_t reqHeight); - status_t update(const sp& display, - uint32_t reqWidth, uint32_t reqHeight, - uint32_t minLayerZ, uint32_t maxLayerZ); - - sp getCpuConsumer() const; - - // release memory occupied by the screenshot - void release(); - - // pixels are valid until this object is freed or - // release() or update() is called - void const* getPixels() const; - - uint32_t getWidth() const; - uint32_t getHeight() const; - PixelFormat getFormat() const; - uint32_t getStride() const; - // size of allocated memory in bytes - size_t getSize() const; -}; - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_GUI_SURFACE_COMPOSER_CLIENT_H diff --git a/external/android/include/19/frameworks/native/include/gui/SurfaceControl.h b/external/android/include/19/frameworks/native/include/gui/SurfaceControl.h deleted file mode 100644 index f27754c..0000000 --- a/external/android/include/19/frameworks/native/include/gui/SurfaceControl.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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_GUI_SURFACE_CONTROL_H -#define ANDROID_GUI_SURFACE_CONTROL_H - -#include -#include - -#include -#include -#include - -#include -#include - -#include - -namespace android { - -// --------------------------------------------------------------------------- - -class IGraphicBufferProducer; -class Surface; -class SurfaceComposerClient; - -// --------------------------------------------------------------------------- - -class SurfaceControl : public RefBase -{ -public: - static bool isValid(const sp& surface) { - return (surface != 0) && surface->isValid(); - } - - bool isValid() { - return mHandle!=0 && mClient!=0; - } - - static bool isSameSurface( - const sp& lhs, const sp& rhs); - - // release surface data from java - void clear(); - - status_t setLayerStack(int32_t layerStack); - status_t setLayer(int32_t layer); - status_t setPosition(float x, float y); - status_t setSize(uint32_t w, uint32_t h); - status_t hide(); - status_t show(); - status_t setFlags(uint32_t flags, uint32_t mask); - status_t setTransparentRegionHint(const Region& transparent); - status_t setAlpha(float alpha=1.0f); - status_t setMatrix(float dsdx, float dtdx, float dsdy, float dtdy); - status_t setCrop(const Rect& crop); - - static status_t writeSurfaceToParcel( - const sp& control, Parcel* parcel); - - sp getSurface() const; - -private: - // can't be copied - SurfaceControl& operator = (SurfaceControl& rhs); - SurfaceControl(const SurfaceControl& rhs); - - friend class SurfaceComposerClient; - friend class Surface; - - SurfaceControl( - const sp& client, - const sp& handle, - const sp& gbp); - - ~SurfaceControl(); - - status_t validate() const; - void destroy(); - - sp mClient; - sp mHandle; - sp mGraphicBufferProducer; - mutable Mutex mLock; - mutable sp mSurfaceData; -}; - -}; // namespace android - -#endif // ANDROID_GUI_SURFACE_CONTROL_H diff --git a/external/android/include/19/frameworks/native/include/media/drm/DrmAPI.h b/external/android/include/19/frameworks/native/include/media/drm/DrmAPI.h deleted file mode 100644 index 95bdf77..0000000 --- a/external/android/include/19/frameworks/native/include/media/drm/DrmAPI.h +++ /dev/null @@ -1,335 +0,0 @@ -/* - * Copyright (C) 2013 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 DRM_API_H_ -#define DRM_API_H_ - -#include -#include -#include -#include -#include -#include -#include - -// Loadable DrmEngine shared libraries should define the entry points -// createDrmFactory and createCryptoFactory as shown below: -// -// extern "C" { -// extern android::DrmFactory *createDrmFactory(); -// extern android::CryptoFactory *createCryptoFactory(); -// } - -namespace android { - - class DrmPlugin; - class DrmPluginListener; - - // DRMs are implemented in DrmEngine plugins, which are dynamically - // loadable shared libraries that implement the entry points - // createDrmFactory and createCryptoFactory. createDrmFactory - // constructs and returns an instance of a DrmFactory object. Similarly, - // createCryptoFactory creates an instance of a CryptoFactory object. - // When a MediaCrypto or MediaDrm object needs to be constructed, all - // available DrmEngines present in the plugins directory on the device - // are scanned for a matching DrmEngine that can support the crypto - // scheme. When a match is found, the DrmEngine's createCryptoPlugin and - // createDrmPlugin methods are used to create CryptoPlugin or - // DrmPlugin instances to support that DRM scheme. - - class DrmFactory { - public: - DrmFactory() {} - virtual ~DrmFactory() {} - - // DrmFactory::isCryptoSchemeSupported can be called to determine - // if the plugin factory is able to construct plugins that support a - // given crypto scheme, which is specified by a UUID. - virtual bool isCryptoSchemeSupported(const uint8_t uuid[16]) = 0; - - // DrmFactory::isContentTypeSupported can be called to determine - // if the plugin factory is able to construct plugins that support a - // given media container format specified by mimeType - virtual bool isContentTypeSupported(const String8 &mimeType) = 0; - - // Construct a DrmPlugin for the crypto scheme specified by UUID. - virtual status_t createDrmPlugin( - const uint8_t uuid[16], DrmPlugin **plugin) = 0; - - private: - DrmFactory(const DrmFactory &); - DrmFactory &operator=(const DrmFactory &); - }; - - class DrmPlugin { - public: - enum EventType { - kDrmPluginEventProvisionRequired = 1, - kDrmPluginEventKeyNeeded, - kDrmPluginEventKeyExpired, - kDrmPluginEventVendorDefined - }; - - // Drm keys can be for offline content or for online streaming. - // Offline keys are persisted on the device and may be used when the device - // is disconnected from the network. The Release type is used to request - // that offline keys be no longer restricted to offline use. - enum KeyType { - kKeyType_Offline, - kKeyType_Streaming, - kKeyType_Release - }; - - DrmPlugin() {} - virtual ~DrmPlugin() {} - - // Open a new session with the DrmPlugin object. A session ID is returned - // in the sessionId parameter. - virtual status_t openSession(Vector &sessionId) = 0; - - // Close a session on the DrmPlugin object. - virtual status_t closeSession(Vector const &sessionId) = 0; - - // A key request/response exchange occurs between the app and a License - // Server to obtain the keys required to decrypt the content. getKeyRequest() - // is used to obtain an opaque key request blob that is delivered to the - // license server. - // - // The scope parameter may be a sessionId or a keySetId, depending on the - // specified keyType. When the keyType is kKeyType_Offline or - // kKeyType_Streaming, scope should be set to the sessionId the keys will be - // provided to. When the keyType is kKeyType_Release, scope should be set to - // the keySetId of the keys being released. Releasing keys from a device - // invalidates them for all sessions. - // - // The init data passed to getKeyRequest is container-specific and its - // meaning is interpreted based on the mime type provided in the mimeType - // parameter to getKeyRequest. It could contain, for example, the content - // ID, key ID or other data obtained from the content metadata that is required - // in generating the key request. Init may be null when keyType is - // kKeyType_Release. - // - // mimeType identifies the mime type of the content - // - // keyType specifies if the keys are to be used for streaming or offline content - // - // optionalParameters are included in the key request message to allow a - // client application to provide additional message parameters to the server. - // - // If successful, the opaque key request blob is returned to the caller. - virtual status_t - getKeyRequest(Vector const &scope, - Vector const &initData, - String8 const &mimeType, KeyType keyType, - KeyedVector const &optionalParameters, - Vector &request, String8 &defaultUrl) = 0; - - // - // After a key response is received by the app, it is provided to the - // Drm plugin using provideKeyResponse. - // - // scope may be a sessionId or a keySetId depending on the type of the - // response. Scope should be set to the sessionId when the response is - // for either streaming or offline key requests. Scope should be set to the - // keySetId when the response is for a release request. - // - // When the response is for an offline key request, a keySetId is returned - // in the keySetId vector parameter that can be used to later restore the - // keys to a new session with the method restoreKeys. When the response is - // for a streaming or release request, no keySetId is returned. - // - virtual status_t provideKeyResponse(Vector const &scope, - Vector const &response, - Vector &keySetId) = 0; - - // Remove the current keys from a session - virtual status_t removeKeys(Vector const &sessionId) = 0; - - // Restore persisted offline keys into a new session. keySetId identifies - // the keys to load, obtained from a prior call to provideKeyResponse(). - virtual status_t restoreKeys(Vector const &sessionId, - Vector const &keySetId) = 0; - - // Request an informative description of the license for the session. The status - // is in the form of {name, value} pairs. Since DRM license policies vary by - // vendor, the specific status field names are determined by each DRM vendor. - // Refer to your DRM provider documentation for definitions of the field names - // for a particular DrmEngine. - virtual status_t - queryKeyStatus(Vector const &sessionId, - KeyedVector &infoMap) const = 0; - - // A provision request/response exchange occurs between the app and a - // provisioning server to retrieve a device certificate. getProvisionRequest - // is used to obtain an opaque key request blob that is delivered to the - // provisioning server. - // - // If successful, the opaque provision request blob is returned to the caller. - virtual status_t getProvisionRequest(Vector &request, - String8 &defaultUrl) = 0; - - // After a provision response is received by the app, it is provided to the - // Drm plugin using provideProvisionResponse. - virtual status_t provideProvisionResponse(Vector const &response) = 0; - - // A means of enforcing the contractual requirement for a concurrent stream - // limit per subscriber across devices is provided via SecureStop. SecureStop - // is a means of securely monitoring the lifetime of sessions. Since playback - // on a device can be interrupted due to reboot, power failure, etc. a means - // of persisting the lifetime information on the device is needed. - // - // A signed version of the sessionID is written to persistent storage on the - // device when each MediaCrypto object is created. The sessionID is signed by - // the device private key to prevent tampering. - // - // In the normal case, playback will be completed, the session destroyed and - // the Secure Stops will be queried. The App queries secure stops and forwards - // the secure stop message to the server which verifies the signature and - // notifies the server side database that the session destruction has been - // confirmed. The persisted record on the client is only removed after positive - // confirmation that the server received the message using releaseSecureStops(). - virtual status_t getSecureStops(List > &secureStops) = 0; - virtual status_t releaseSecureStops(Vector const &ssRelease) = 0; - - // Read a property value given the device property string. There are a few forms - // of property access methods, depending on the data type returned. - // Since DRM plugin properties may vary, additional field names may be defined - // by each DRM vendor. Refer to your DRM provider documentation for definitions - // of its additional field names. - // - // Standard values are: - // "vendor" [string] identifies the maker of the plugin - // "version" [string] identifies the version of the plugin - // "description" [string] describes the plugin - // 'deviceUniqueId' [byte array] The device unique identifier is established - // during device provisioning and provides a means of uniquely identifying - // each device. - virtual status_t getPropertyString(String8 const &name, String8 &value ) const = 0; - virtual status_t getPropertyByteArray(String8 const &name, - Vector &value ) const = 0; - - // Write a property value given the device property string. There are a few forms - // of property setting methods, depending on the data type. - // Since DRM plugin properties may vary, additional field names may be defined - // by each DRM vendor. Refer to your DRM provider documentation for definitions - // of its field names. - virtual status_t setPropertyString(String8 const &name, - String8 const &value ) = 0; - virtual status_t setPropertyByteArray(String8 const &name, - Vector const &value ) = 0; - - // The following methods implement operations on a CryptoSession to support - // encrypt, decrypt, sign verify operations on operator-provided - // session keys. - - // - // The algorithm string conforms to JCA Standard Names for Cipher - // Transforms and is case insensitive. For example "AES/CBC/PKCS5Padding". - // - // Return OK if the algorithm is supported, otherwise return BAD_VALUE - // - virtual status_t setCipherAlgorithm(Vector const &sessionId, - String8 const &algorithm) = 0; - - // - // The algorithm string conforms to JCA Standard Names for Mac - // Algorithms and is case insensitive. For example "HmacSHA256". - // - // Return OK if the algorithm is supported, otherwise return BAD_VALUE - // - virtual status_t setMacAlgorithm(Vector const &sessionId, - String8 const &algorithm) = 0; - - // Encrypt the provided input buffer with the cipher algorithm - // specified by setCipherAlgorithm and the key selected by keyId, - // and return the encrypted data. - virtual status_t encrypt(Vector const &sessionId, - Vector const &keyId, - Vector const &input, - Vector const &iv, - Vector &output) = 0; - - // Decrypt the provided input buffer with the cipher algorithm - // specified by setCipherAlgorithm and the key selected by keyId, - // and return the decrypted data. - virtual status_t decrypt(Vector const &sessionId, - Vector const &keyId, - Vector const &input, - Vector const &iv, - Vector &output) = 0; - - // Compute a signature on the provided message using the mac algorithm - // specified by setMacAlgorithm and the key selected by keyId, - // and return the signature. - virtual status_t sign(Vector const &sessionId, - Vector const &keyId, - Vector const &message, - Vector &signature) = 0; - - // Compute a signature on the provided message using the mac algorithm - // specified by setMacAlgorithm and the key selected by keyId, - // and compare with the expected result. Set result to true or - // false depending on the outcome. - virtual status_t verify(Vector const &sessionId, - Vector const &keyId, - Vector const &message, - Vector const &signature, - bool &match) = 0; - - - status_t setListener(const sp& listener) { - Mutex::Autolock lock(mEventLock); - mListener = listener; - return OK; - } - - protected: - // Plugins call sendEvent to deliver events to the java app - void sendEvent(EventType eventType, int extra, - Vector const *sessionId, - Vector const *data); - - private: - Mutex mEventLock; - sp mListener; - - DISALLOW_EVIL_CONSTRUCTORS(DrmPlugin); - }; - - class DrmPluginListener: virtual public RefBase - { - public: - virtual void sendEvent(DrmPlugin::EventType eventType, int extra, - Vector const *sesionId, - Vector const *data) = 0; - }; - - inline void DrmPlugin::sendEvent(EventType eventType, int extra, - Vector const *sessionId, - Vector const *data) { - - mEventLock.lock(); - sp listener = mListener; - mEventLock.unlock(); - - if (listener != NULL) { - listener->sendEvent(eventType, extra, sessionId, data); - } - } - -} // namespace android - -#endif // DRM_API_H_ diff --git a/external/android/include/19/frameworks/native/include/media/editor/II420ColorConverter.h b/external/android/include/19/frameworks/native/include/media/editor/II420ColorConverter.h deleted file mode 100644 index 33af61f..0000000 --- a/external/android/include/19/frameworks/native/include/media/editor/II420ColorConverter.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (C) 2011 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 II420_COLOR_CONVERTER_H - -#define II420_COLOR_CONVERTER_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct II420ColorConverter { - - /* - * getDecoderOutputFormat - * Returns the color format (OMX_COLOR_FORMATTYPE) of the decoder output. - * If it is I420 (OMX_COLOR_FormatYUV420Planar), no conversion is needed, - * and convertDecoderOutputToI420() can be a no-op. - */ - int (*getDecoderOutputFormat)(); - - /* - * convertDecoderOutputToI420 - * @Desc Converts from the decoder output format to I420 format. - * @note Caller (e.g. VideoEditor) owns the buffers - * @param decoderBits (IN) Pointer to the buffer contains decoder output - * @param decoderWidth (IN) Buffer width, as reported by the decoder - * metadata (kKeyWidth) - * @param decoderHeight (IN) Buffer height, as reported by the decoder - * metadata (kKeyHeight) - * @param decoderRect (IN) The rectangle of the actual frame, as - * reported by decoder metadata (kKeyCropRect) - * @param dstBits (OUT) Pointer to the output I420 buffer - * @return -1 Any error - * @return 0 No Error - */ - int (*convertDecoderOutputToI420)( - void* decoderBits, int decoderWidth, int decoderHeight, - ARect decoderRect, void* dstBits); - - /* - * getEncoderIntputFormat - * Returns the color format (OMX_COLOR_FORMATTYPE) of the encoder input. - * If it is I420 (OMX_COLOR_FormatYUV420Planar), no conversion is needed, - * and convertI420ToEncoderInput() and getEncoderInputBufferInfo() can - * be no-ops. - */ - int (*getEncoderInputFormat)(); - - /* convertI420ToEncoderInput - * @Desc This function converts from I420 to the encoder input format - * @note Caller (e.g. VideoEditor) owns the buffers - * @param srcBits (IN) Pointer to the input I420 buffer - * @param srcWidth (IN) Width of the I420 frame - * @param srcHeight (IN) Height of the I420 frame - * @param encoderWidth (IN) Encoder buffer width, as calculated by - * getEncoderBufferInfo() - * @param encoderHeight (IN) Encoder buffer height, as calculated by - * getEncoderBufferInfo() - * @param encoderRect (IN) Rect coordinates of the actual frame inside - * the encoder buffer, as calculated by - * getEncoderBufferInfo(). - * @param encoderBits (OUT) Pointer to the output buffer. The size of - * this buffer is calculated by - * getEncoderBufferInfo() - * @return -1 Any error - * @return 0 No Error - */ - int (*convertI420ToEncoderInput)( - void* srcBits, int srcWidth, int srcHeight, - int encoderWidth, int encoderHeight, ARect encoderRect, - void* encoderBits); - - /* getEncoderInputBufferInfo - * @Desc This function returns metadata for the encoder input buffer - * based on the actual I420 frame width and height. - * @note This API should be be used to obtain the necessary information - * before calling convertI420ToEncoderInput(). - * VideoEditor knows only the width and height of the I420 buffer, - * but it also needs know the width, height, and size of the - * encoder input buffer. The encoder input buffer width and height - * are used to set the metadata for the encoder. - * @param srcWidth (IN) Width of the I420 frame - * @param srcHeight (IN) Height of the I420 frame - * @param encoderWidth (OUT) Encoder buffer width needed - * @param encoderHeight (OUT) Encoder buffer height needed - * @param encoderRect (OUT) Rect coordinates of the actual frame inside - * the encoder buffer - * @param encoderBufferSize (OUT) The size of the buffer that need to be - * allocated by the caller before invoking - * convertI420ToEncoderInput(). - * @return -1 Any error - * @return 0 No Error - */ - int (*getEncoderInputBufferInfo)( - int srcWidth, int srcHeight, - int* encoderWidth, int* encoderHeight, - ARect* encoderRect, int* encoderBufferSize); - -} II420ColorConverter; - -/* The only function that the shared library needs to expose: It fills the - function pointers in II420ColorConverter */ -void getI420ColorConverter(II420ColorConverter *converter); - -#if defined(__cplusplus) -} -#endif - -#endif // II420_COLOR_CONVERTER_H diff --git a/external/android/include/19/frameworks/native/include/media/hardware/CryptoAPI.h b/external/android/include/19/frameworks/native/include/media/hardware/CryptoAPI.h deleted file mode 100644 index 44a0040..0000000 --- a/external/android/include/19/frameworks/native/include/media/hardware/CryptoAPI.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2012 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 - -#ifndef CRYPTO_API_H_ - -#define CRYPTO_API_H_ - -namespace android { - -struct AString; -struct CryptoPlugin; - -struct CryptoFactory { - CryptoFactory() {} - virtual ~CryptoFactory() {} - - virtual bool isCryptoSchemeSupported(const uint8_t uuid[16]) const = 0; - - virtual status_t createPlugin( - const uint8_t uuid[16], const void *data, size_t size, - CryptoPlugin **plugin) = 0; - -private: - CryptoFactory(const CryptoFactory &); - CryptoFactory &operator=(const CryptoFactory &); -}; - -struct CryptoPlugin { - enum Mode { - kMode_Unencrypted = 0, - kMode_AES_CTR = 1, - - // Neither key nor iv are being used in this mode. - // Each subsample is encrypted w/ an iv of all zeroes. - kMode_AES_WV = 2, // FIX constant - }; - - struct SubSample { - size_t mNumBytesOfClearData; - size_t mNumBytesOfEncryptedData; - }; - - CryptoPlugin() {} - virtual ~CryptoPlugin() {} - - // If this method returns false, a non-secure decoder will be used to - // decode the data after decryption. The decrypt API below will have - // to support insecure decryption of the data (secure = false) for - // media data of the given mime type. - virtual bool requiresSecureDecoderComponent(const char *mime) const = 0; - - // If the error returned falls into the range - // ERROR_DRM_VENDOR_MIN..ERROR_DRM_VENDOR_MAX, errorDetailMsg should be - // filled in with an appropriate string. - // At the java level these special errors will then trigger a - // MediaCodec.CryptoException that gives clients access to both - // the error code and the errorDetailMsg. - // Returns a non-negative result to indicate the number of bytes written - // to the dstPtr, or a negative result to indicate an error. - virtual ssize_t decrypt( - bool secure, - const uint8_t key[16], - const uint8_t iv[16], - Mode mode, - const void *srcPtr, - const SubSample *subSamples, size_t numSubSamples, - void *dstPtr, - AString *errorDetailMsg) = 0; - -private: - CryptoPlugin(const CryptoPlugin &); - CryptoPlugin &operator=(const CryptoPlugin &); -}; - -} // namespace android - -extern "C" { - extern android::CryptoFactory *createCryptoFactory(); -} - -#endif // CRYPTO_API_H_ diff --git a/external/android/include/19/frameworks/native/include/media/hardware/HDCPAPI.h b/external/android/include/19/frameworks/native/include/media/hardware/HDCPAPI.h deleted file mode 100644 index d4abb3f..0000000 --- a/external/android/include/19/frameworks/native/include/media/hardware/HDCPAPI.h +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (C) 2012 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 HDCP_API_H_ - -#define HDCP_API_H_ - -#include -#include - -namespace android { - -// Two different kinds of modules are covered under the same HDCPModule -// structure below, a module either implements decryption or encryption. -struct HDCPModule { - typedef void (*ObserverFunc)(void *cookie, int msg, int ext1, int ext2); - - // The msg argument in calls to the observer notification function. - enum { - // Sent in response to a call to "HDCPModule::initAsync" once - // initialization has either been successfully completed, - // i.e. the HDCP session is now fully setup (AKE, Locality Check, - // SKE and any authentication with repeaters completed) or failed. - // ext1 should be a suitable error code (status_t), ext2 is - // unused for ENCRYPTION and in the case of HDCP_INITIALIZATION_COMPLETE - // holds the local TCP port the module is listening on. - HDCP_INITIALIZATION_COMPLETE, - HDCP_INITIALIZATION_FAILED, - - // Sent upon completion of a call to "HDCPModule::shutdownAsync". - // ext1 should be a suitable error code, ext2 is unused. - HDCP_SHUTDOWN_COMPLETE, - HDCP_SHUTDOWN_FAILED, - - HDCP_UNAUTHENTICATED_CONNECTION, - HDCP_UNAUTHORIZED_CONNECTION, - HDCP_REVOKED_CONNECTION, - HDCP_TOPOLOGY_EXECEEDED, - HDCP_UNKNOWN_ERROR, - - // DECRYPTION only: Indicates that a client has successfully connected, - // a secure session established and the module is ready to accept - // future calls to "decrypt". - HDCP_SESSION_ESTABLISHED, - }; - - // HDCPModule capability bit masks - enum { - // HDCP_CAPS_ENCRYPT: mandatory, meaning the HDCP module can encrypt - // from an input byte-array buffer to an output byte-array buffer - HDCP_CAPS_ENCRYPT = (1 << 0), - // HDCP_CAPS_ENCRYPT_NATIVE: the HDCP module supports encryption from - // a native buffer to an output byte-array buffer. The format of the - // input native buffer is specific to vendor's encoder implementation. - // It is the same format as that used by the encoder when - // "storeMetaDataInBuffers" extension is enabled on its output port. - HDCP_CAPS_ENCRYPT_NATIVE = (1 << 1), - }; - - // Module can call the notification function to signal completion/failure - // of asynchronous operations (such as initialization) or out of band - // events. - HDCPModule(void *cookie, ObserverFunc observerNotify) {}; - - virtual ~HDCPModule() {}; - - // ENCRYPTION: Request to setup an HDCP session with the host specified - // by addr and listening on the specified port. - // DECRYPTION: Request to setup an HDCP session, addr is the interface - // address the module should bind its socket to. port will be 0. - // The module will pick the port to listen on itself and report its choice - // in the "ext2" argument of the HDCP_INITIALIZATION_COMPLETE callback. - virtual status_t initAsync(const char *addr, unsigned port) = 0; - - // Request to shutdown the active HDCP session. - virtual status_t shutdownAsync() = 0; - - // ENCRYPTION only: - // Encrypt data according to the HDCP spec. "size" bytes of data are - // available at "inData" (virtual address), "size" may not be a multiple - // of 128 bits (16 bytes). An equal number of encrypted bytes should be - // written to the buffer at "outData" (virtual address). - // This operation is to be synchronous, i.e. this call does not return - // until outData contains size bytes of encrypted data. - // streamCTR will be assigned by the caller (to 0 for the first PES stream, - // 1 for the second and so on) - // inputCTR _will_be_maintained_by_the_callee_ for each PES stream. - virtual status_t encrypt( - const void *inData, size_t size, uint32_t streamCTR, - uint64_t *outInputCTR, void *outData) { - return INVALID_OPERATION; - } - - // Encrypt data according to the HDCP spec. "size" bytes of data starting - // at location "offset" are available in "buffer" (buffer handle). "size" - // may not be a multiple of 128 bits (16 bytes). An equal number of - // encrypted bytes should be written to the buffer at "outData" (virtual - // address). This operation is to be synchronous, i.e. this call does not - // return until outData contains size bytes of encrypted data. - // streamCTR will be assigned by the caller (to 0 for the first PES stream, - // 1 for the second and so on) - // inputCTR _will_be_maintained_by_the_callee_ for each PES stream. - virtual status_t encryptNative( - buffer_handle_t buffer, size_t offset, size_t size, - uint32_t streamCTR, uint64_t *outInputCTR, void *outData) { - return INVALID_OPERATION; - } - // DECRYPTION only: - // Decrypt data according to the HDCP spec. - // "size" bytes of encrypted data are available at "inData" - // (virtual address), "size" may not be a multiple of 128 bits (16 bytes). - // An equal number of decrypted bytes should be written to the buffer - // at "outData" (virtual address). - // This operation is to be synchronous, i.e. this call does not return - // until outData contains size bytes of decrypted data. - // Both streamCTR and inputCTR will be provided by the caller. - virtual status_t decrypt( - const void *inData, size_t size, - uint32_t streamCTR, uint64_t inputCTR, - void *outData) { - return INVALID_OPERATION; - } - -private: - HDCPModule(const HDCPModule &); - HDCPModule &operator=(const HDCPModule &); -}; - -} // namespace android - -// A shared library exporting the following methods should be included to -// support HDCP functionality. The shared library must be called -// "libstagefright_hdcp.so", it will be dynamically loaded into the -// mediaserver process. -extern "C" { - // Create a module for ENCRYPTION. - extern android::HDCPModule *createHDCPModule( - void *cookie, android::HDCPModule::ObserverFunc); - - // Create a module for DECRYPTION. - extern android::HDCPModule *createHDCPModuleForDecryption( - void *cookie, android::HDCPModule::ObserverFunc); -} - -#endif // HDCP_API_H_ - diff --git a/external/android/include/19/frameworks/native/include/media/hardware/HardwareAPI.h b/external/android/include/19/frameworks/native/include/media/hardware/HardwareAPI.h deleted file mode 100644 index de3aeb1..0000000 --- a/external/android/include/19/frameworks/native/include/media/hardware/HardwareAPI.h +++ /dev/null @@ -1,164 +0,0 @@ -/* - * 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 HARDWARE_API_H_ - -#define HARDWARE_API_H_ - -#include -#include -#include -#include - -#include - -namespace android { - -// A pointer to this struct is passed to the OMX_SetParameter when the extension -// index for the 'OMX.google.android.index.enableAndroidNativeBuffers' extension -// is given. -// -// When Android native buffer use is disabled for a port (the default state), -// the OMX node should operate as normal, and expect UseBuffer calls to set its -// buffers. This is the mode that will be used when CPU access to the buffer is -// required. -// -// When Android native buffer use has been enabled for a given port, the video -// color format for the port is to be interpreted as an Android pixel format -// rather than an OMX color format. Enabling Android native buffers may also -// change how the component receives the native buffers. If store-metadata-mode -// is enabled on the port, the component will receive the buffers as specified -// in the section below. Otherwise, unless the node supports the -// 'OMX.google.android.index.useAndroidNativeBuffer2' extension, it should -// expect to receive UseAndroidNativeBuffer calls (via OMX_SetParameter) rather -// than UseBuffer calls for that port. -struct EnableAndroidNativeBuffersParams { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL enable; -}; - -// A pointer to this struct is passed to OMX_SetParameter() when the extension -// index "OMX.google.android.index.storeMetaDataInBuffers" -// is given. -// -// When meta data is stored in the video buffers passed between OMX clients -// and OMX components, interpretation of the buffer data is up to the -// buffer receiver, and the data may or may not be the actual video data, but -// some information helpful for the receiver to locate the actual data. -// The buffer receiver thus needs to know how to interpret what is stored -// in these buffers, with mechanisms pre-determined externally. How to -// interpret the meta data is outside of the scope of this method. -// -// Currently, this is specifically used to pass meta data from video source -// (camera component, for instance) to video encoder to avoid memcpying of -// input video frame data. To do this, bStoreMetaData is set to OMX_TRUE. -// If bStoreMetaData is set to false, real YUV frame data will be stored -// in the buffers. In addition, if no OMX_SetParameter() call is made -// with the corresponding extension index, real YUV data is stored -// in the buffers. -// -// For video decoder output port, the metadata buffer layout is defined below. -// -// Metadata buffers are registered with the component using UseBuffer calls. -struct StoreMetaDataInBuffersParams { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL bStoreMetaData; -}; - -// Meta data buffer layout used to transport output frames to the decoder for -// dynamic buffer handling. -struct VideoDecoderOutputMetaData { - MetadataBufferType eType; - buffer_handle_t pHandle; -}; - -// A pointer to this struct is passed to OMX_SetParameter() when the extension -// index "OMX.google.android.index.prepareForAdaptivePlayback" is given. -// -// This method is used to signal a video decoder, that the user has requested -// seamless resolution change support (if bEnable is set to OMX_TRUE). -// nMaxFrameWidth and nMaxFrameHeight are the dimensions of the largest -// anticipated frames in the video. If bEnable is OMX_FALSE, no resolution -// change is expected, and the nMaxFrameWidth/Height fields are unused. -// -// If the decoder supports dynamic output buffers, it may ignore this -// request. Otherwise, it shall request resources in such a way so that it -// avoids full port-reconfiguration (due to output port-definition change) -// during resolution changes. -// -// DO NOT USE THIS STRUCTURE AS IT WILL BE REMOVED. INSTEAD, IMPLEMENT -// METADATA SUPPORT FOR VIDEO DECODERS. -struct PrepareForAdaptivePlaybackParams { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL bEnable; - OMX_U32 nMaxFrameWidth; - OMX_U32 nMaxFrameHeight; -}; - -// A pointer to this struct is passed to OMX_SetParameter when the extension -// index for the 'OMX.google.android.index.useAndroidNativeBuffer' extension is -// given. This call will only be performed if a prior call was made with the -// 'OMX.google.android.index.enableAndroidNativeBuffers' extension index, -// enabling use of Android native buffers. -struct UseAndroidNativeBufferParams { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_PTR pAppPrivate; - OMX_BUFFERHEADERTYPE **bufferHeader; - const sp& nativeBuffer; -}; - -// A pointer to this struct is passed to OMX_GetParameter when the extension -// index for the 'OMX.google.android.index.getAndroidNativeBufferUsage' -// extension is given. The usage bits returned from this query will be used to -// allocate the Gralloc buffers that get passed to the useAndroidNativeBuffer -// command. -struct GetAndroidNativeBufferUsageParams { - OMX_U32 nSize; // IN - OMX_VERSIONTYPE nVersion; // IN - OMX_U32 nPortIndex; // IN - OMX_U32 nUsage; // OUT -}; - -// An enum OMX_COLOR_FormatAndroidOpaque to indicate an opaque colorformat -// is declared in media/stagefright/openmax/OMX_IVCommon.h -// This will inform the encoder that the actual -// colorformat will be relayed by the GRalloc Buffers. -// OMX_COLOR_FormatAndroidOpaque = 0x7F000001, - -// A pointer to this struct is passed to OMX_SetParameter when the extension -// index for the 'OMX.google.android.index.prependSPSPPSToIDRFrames' extension -// is given. -// A successful result indicates that future IDR frames will be prefixed by -// SPS/PPS. -struct PrependSPSPPSToIDRFramesParams { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_BOOL bEnable; -}; - -} // namespace android - -extern android::OMXPluginBase *createOMXPlugin(); - -#endif // HARDWARE_API_H_ diff --git a/external/android/include/19/frameworks/native/include/media/hardware/MetadataBufferType.h b/external/android/include/19/frameworks/native/include/media/hardware/MetadataBufferType.h deleted file mode 100644 index 4eaf8ac..0000000 --- a/external/android/include/19/frameworks/native/include/media/hardware/MetadataBufferType.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2011 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 METADATA_BUFFER_TYPE_H -#define METADATA_BUFFER_TYPE_H - -#ifdef __cplusplus -extern "C" { -namespace android { -#endif - -/* - * MetadataBufferType defines the type of the metadata buffers that - * can be passed to video encoder component for encoding, via Stagefright - * media recording framework. To see how to work with the metadata buffers - * in media recording framework, please consult HardwareAPI.h - * - * The creator of metadata buffers and video encoder share common knowledge - * on what is actually being stored in these metadata buffers, and - * how the information can be used by the video encoder component - * to locate the actual pixel data as the source input for video - * encoder, plus whatever other information that is necessary. Stagefright - * media recording framework does not need to know anything specific about the - * metadata buffers, except for receving each individual metadata buffer - * as the source input, making a copy of the metadata buffer, and passing the - * copy via OpenMAX API to the video encoder component. - * - * The creator of the metadata buffers must ensure that the first - * 4 bytes in every metadata buffer indicates its buffer type, - * and the rest of the metadata buffer contains the - * actual metadata information. When a video encoder component receives - * a metadata buffer, it uses the first 4 bytes in that buffer to find - * out the type of the metadata buffer, and takes action appropriate - * to that type of metadata buffers (for instance, locate the actual - * pixel data input and then encoding the input data to produce a - * compressed output buffer). - * - * The following shows the layout of a metadata buffer, - * where buffer type is a 4-byte field of MetadataBufferType, - * and the payload is the metadata information. - * - * -------------------------------------------------------------- - * | buffer type | payload | - * -------------------------------------------------------------- - * - */ -typedef enum { - - /* - * kMetadataBufferTypeCameraSource is used to indicate that - * the source of the metadata buffer is the camera component. - */ - kMetadataBufferTypeCameraSource = 0, - - /* - * kMetadataBufferTypeGrallocSource is used to indicate that - * the payload of the metadata buffers can be interpreted as - * a buffer_handle_t. - * So in this case,the metadata that the encoder receives - * will have a byte stream that consists of two parts: - * 1. First, there is an integer indicating that it is a GRAlloc - * source (kMetadataBufferTypeGrallocSource) - * 2. This is followed by the buffer_handle_t that is a handle to the - * GRalloc buffer. The encoder needs to interpret this GRalloc handle - * and encode the frames. - * -------------------------------------------------------------- - * | kMetadataBufferTypeGrallocSource | sizeof(buffer_handle_t) | - * -------------------------------------------------------------- - */ - kMetadataBufferTypeGrallocSource = 1, - - // Add more here... - -} MetadataBufferType; - -#ifdef __cplusplus -} // namespace android -} -#endif - -#endif // METADATA_BUFFER_TYPE_H diff --git a/external/android/include/19/frameworks/native/include/media/hardware/OMXPluginBase.h b/external/android/include/19/frameworks/native/include/media/hardware/OMXPluginBase.h deleted file mode 100644 index 7bf4147..0000000 --- a/external/android/include/19/frameworks/native/include/media/hardware/OMXPluginBase.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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 OMX_PLUGIN_BASE_H_ - -#define OMX_PLUGIN_BASE_H_ - -#include - -#include - -#include -#include - -namespace android { - -struct OMXPluginBase { - OMXPluginBase() {} - virtual ~OMXPluginBase() {} - - virtual OMX_ERRORTYPE makeComponentInstance( - const char *name, - const OMX_CALLBACKTYPE *callbacks, - OMX_PTR appData, - OMX_COMPONENTTYPE **component) = 0; - - virtual OMX_ERRORTYPE destroyComponentInstance( - OMX_COMPONENTTYPE *component) = 0; - - virtual OMX_ERRORTYPE enumerateComponents( - OMX_STRING name, - size_t size, - OMX_U32 index) = 0; - - virtual OMX_ERRORTYPE getRolesOfComponent( - const char *name, - Vector *roles) = 0; - -private: - OMXPluginBase(const OMXPluginBase &); - OMXPluginBase &operator=(const OMXPluginBase &); -}; - -} // namespace android - -#endif // OMX_PLUGIN_BASE_H_ diff --git a/external/android/include/19/frameworks/native/include/media/openmax/OMX_Audio.h b/external/android/include/19/frameworks/native/include/media/openmax/OMX_Audio.h deleted file mode 100644 index 89ce0fc..0000000 --- a/external/android/include/19/frameworks/native/include/media/openmax/OMX_Audio.h +++ /dev/null @@ -1,1342 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** @file OMX_Audio.h - OpenMax IL version 1.1.2 - * The structures needed by Audio components to exchange - * parameters and configuration data with the componenmilts. - */ - -#ifndef OMX_Audio_h -#define OMX_Audio_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/* Each OMX header must include all required header files to allow the - * header to compile without errors. The includes below are required - * for this header file to compile successfully - */ - -#include - -/** @defgroup midi MIDI - * @ingroup audio - */ - -/** @defgroup effects Audio effects - * @ingroup audio - */ - -/** @defgroup audio OpenMAX IL Audio Domain - * Structures for OpenMAX IL Audio domain - * @{ - */ - -/** Enumeration used to define the possible audio codings. - * If "OMX_AUDIO_CodingUnused" is selected, the coding selection must - * be done in a vendor specific way. Since this is for an audio - * processing element this enum is relevant. However, for another - * type of component other enums would be in this area. - */ -typedef enum OMX_AUDIO_CODINGTYPE { - OMX_AUDIO_CodingUnused = 0, /**< Placeholder value when coding is N/A */ - OMX_AUDIO_CodingAutoDetect, /**< auto detection of audio format */ - OMX_AUDIO_CodingPCM, /**< Any variant of PCM coding */ - OMX_AUDIO_CodingADPCM, /**< Any variant of ADPCM encoded data */ - OMX_AUDIO_CodingAMR, /**< Any variant of AMR encoded data */ - OMX_AUDIO_CodingGSMFR, /**< Any variant of GSM fullrate (i.e. GSM610) */ - OMX_AUDIO_CodingGSMEFR, /**< Any variant of GSM Enhanced Fullrate encoded data*/ - OMX_AUDIO_CodingGSMHR, /**< Any variant of GSM Halfrate encoded data */ - OMX_AUDIO_CodingPDCFR, /**< Any variant of PDC Fullrate encoded data */ - OMX_AUDIO_CodingPDCEFR, /**< Any variant of PDC Enhanced Fullrate encoded data */ - OMX_AUDIO_CodingPDCHR, /**< Any variant of PDC Halfrate encoded data */ - OMX_AUDIO_CodingTDMAFR, /**< Any variant of TDMA Fullrate encoded data (TIA/EIA-136-420) */ - OMX_AUDIO_CodingTDMAEFR, /**< Any variant of TDMA Enhanced Fullrate encoded data (TIA/EIA-136-410) */ - OMX_AUDIO_CodingQCELP8, /**< Any variant of QCELP 8kbps encoded data */ - OMX_AUDIO_CodingQCELP13, /**< Any variant of QCELP 13kbps encoded data */ - OMX_AUDIO_CodingEVRC, /**< Any variant of EVRC encoded data */ - OMX_AUDIO_CodingSMV, /**< Any variant of SMV encoded data */ - OMX_AUDIO_CodingG711, /**< Any variant of G.711 encoded data */ - OMX_AUDIO_CodingG723, /**< Any variant of G.723 dot 1 encoded data */ - OMX_AUDIO_CodingG726, /**< Any variant of G.726 encoded data */ - OMX_AUDIO_CodingG729, /**< Any variant of G.729 encoded data */ - OMX_AUDIO_CodingAAC, /**< Any variant of AAC encoded data */ - OMX_AUDIO_CodingMP3, /**< Any variant of MP3 encoded data */ - OMX_AUDIO_CodingSBC, /**< Any variant of SBC encoded data */ - OMX_AUDIO_CodingVORBIS, /**< Any variant of VORBIS encoded data */ - OMX_AUDIO_CodingWMA, /**< Any variant of WMA encoded data */ - OMX_AUDIO_CodingRA, /**< Any variant of RA encoded data */ - OMX_AUDIO_CodingMIDI, /**< Any variant of MIDI encoded data */ - OMX_AUDIO_CodingFLAC, /**< Any variant of FLAC encoded data */ - OMX_AUDIO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_CodingMax = 0x7FFFFFFF -} OMX_AUDIO_CODINGTYPE; - - -/** The PortDefinition structure is used to define all of the parameters - * necessary for the compliant component to setup an input or an output audio - * path. If additional information is needed to define the parameters of the - * port (such as frequency), additional structures must be sent such as the - * OMX_AUDIO_PARAM_PCMMODETYPE structure to supply the extra parameters for the port. - */ -typedef struct OMX_AUDIO_PORTDEFINITIONTYPE { - OMX_STRING cMIMEType; /**< MIME type of data for the port */ - OMX_NATIVE_DEVICETYPE pNativeRender; /** < platform specific reference - for an output device, - otherwise this field is 0 */ - OMX_BOOL bFlagErrorConcealment; /**< Turns on error concealment if it is - supported by the OMX component */ - OMX_AUDIO_CODINGTYPE eEncoding; /**< Type of data expected for this - port (e.g. PCM, AMR, MP3, etc) */ -} OMX_AUDIO_PORTDEFINITIONTYPE; - - -/** Port format parameter. This structure is used to enumerate - * the various data input/output format supported by the port. - */ -typedef struct OMX_AUDIO_PARAM_PORTFORMATTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Indicates which port to set */ - OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */ - OMX_AUDIO_CODINGTYPE eEncoding; /**< Type of data expected for this port (e.g. PCM, AMR, MP3, etc) */ -} OMX_AUDIO_PARAM_PORTFORMATTYPE; - - -/** PCM mode type */ -typedef enum OMX_AUDIO_PCMMODETYPE { - OMX_AUDIO_PCMModeLinear = 0, /**< Linear PCM encoded data */ - OMX_AUDIO_PCMModeALaw, /**< A law PCM encoded data (G.711) */ - OMX_AUDIO_PCMModeMULaw, /**< Mu law PCM encoded data (G.711) */ - OMX_AUDIO_PCMModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_PCMModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_PCMModeMax = 0x7FFFFFFF -} OMX_AUDIO_PCMMODETYPE; - - -typedef enum OMX_AUDIO_CHANNELTYPE { - OMX_AUDIO_ChannelNone = 0x0, /**< Unused or empty */ - OMX_AUDIO_ChannelLF = 0x1, /**< Left front */ - OMX_AUDIO_ChannelRF = 0x2, /**< Right front */ - OMX_AUDIO_ChannelCF = 0x3, /**< Center front */ - OMX_AUDIO_ChannelLS = 0x4, /**< Left surround */ - OMX_AUDIO_ChannelRS = 0x5, /**< Right surround */ - OMX_AUDIO_ChannelLFE = 0x6, /**< Low frequency effects */ - OMX_AUDIO_ChannelCS = 0x7, /**< Back surround */ - OMX_AUDIO_ChannelLR = 0x8, /**< Left rear. */ - OMX_AUDIO_ChannelRR = 0x9, /**< Right rear. */ - OMX_AUDIO_ChannelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_ChannelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_ChannelMax = 0x7FFFFFFF -} OMX_AUDIO_CHANNELTYPE; - -#define OMX_AUDIO_MAXCHANNELS 16 /**< maximum number distinct audio channels that a buffer may contain */ -#define OMX_MIN_PCMPAYLOAD_MSEC 5 /**< Minimum audio buffer payload size for uncompressed (PCM) audio */ - -/** PCM format description */ -typedef struct OMX_AUDIO_PARAM_PCMMODETYPE { - OMX_U32 nSize; /**< Size of this structure, in Bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels (e.g. 2 for stereo) */ - OMX_NUMERICALDATATYPE eNumData; /**< indicates PCM data as signed or unsigned */ - OMX_ENDIANTYPE eEndian; /**< indicates PCM data as little or big endian */ - OMX_BOOL bInterleaved; /**< True for normal interleaved data; false for - non-interleaved data (e.g. block data) */ - OMX_U32 nBitPerSample; /**< Bit per sample */ - OMX_U32 nSamplingRate; /**< Sampling rate of the source data. Use 0 for - variable or unknown sampling rate. */ - OMX_AUDIO_PCMMODETYPE ePCMMode; /**< PCM mode enumeration */ - OMX_AUDIO_CHANNELTYPE eChannelMapping[OMX_AUDIO_MAXCHANNELS]; /**< Slot i contains channel defined by eChannelMap[i] */ - -} OMX_AUDIO_PARAM_PCMMODETYPE; - - -/** Audio channel mode. This is used by both AAC and MP3, although the names are more appropriate - * for the MP3. For example, JointStereo for MP3 is CouplingChannels for AAC. - */ -typedef enum OMX_AUDIO_CHANNELMODETYPE { - OMX_AUDIO_ChannelModeStereo = 0, /**< 2 channels, the bitrate allocation between those - two channels changes accordingly to each channel information */ - OMX_AUDIO_ChannelModeJointStereo, /**< mode that takes advantage of what is common between - 2 channels for higher compression gain */ - OMX_AUDIO_ChannelModeDual, /**< 2 mono-channels, each channel is encoded with half - the bitrate of the overall bitrate */ - OMX_AUDIO_ChannelModeMono, /**< Mono channel mode */ - OMX_AUDIO_ChannelModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_ChannelModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_ChannelModeMax = 0x7FFFFFFF -} OMX_AUDIO_CHANNELMODETYPE; - - -typedef enum OMX_AUDIO_MP3STREAMFORMATTYPE { - OMX_AUDIO_MP3StreamFormatMP1Layer3 = 0, /**< MP3 Audio MPEG 1 Layer 3 Stream format */ - OMX_AUDIO_MP3StreamFormatMP2Layer3, /**< MP3 Audio MPEG 2 Layer 3 Stream format */ - OMX_AUDIO_MP3StreamFormatMP2_5Layer3, /**< MP3 Audio MPEG2.5 Layer 3 Stream format */ - OMX_AUDIO_MP3StreamFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_MP3StreamFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_MP3StreamFormatMax = 0x7FFFFFFF -} OMX_AUDIO_MP3STREAMFORMATTYPE; - -/** MP3 params */ -typedef struct OMX_AUDIO_PARAM_MP3TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable - rate or unknown bit rates */ - OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for - variable or unknown sampling rate. */ - OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should - limit the audio signal. Use 0 to let encoder decide */ - OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */ - OMX_AUDIO_MP3STREAMFORMATTYPE eFormat; /**< MP3 stream format */ -} OMX_AUDIO_PARAM_MP3TYPE; - - -typedef enum OMX_AUDIO_AACSTREAMFORMATTYPE { - OMX_AUDIO_AACStreamFormatMP2ADTS = 0, /**< AAC Audio Data Transport Stream 2 format */ - OMX_AUDIO_AACStreamFormatMP4ADTS, /**< AAC Audio Data Transport Stream 4 format */ - OMX_AUDIO_AACStreamFormatMP4LOAS, /**< AAC Low Overhead Audio Stream format */ - OMX_AUDIO_AACStreamFormatMP4LATM, /**< AAC Low overhead Audio Transport Multiplex */ - OMX_AUDIO_AACStreamFormatADIF, /**< AAC Audio Data Interchange Format */ - OMX_AUDIO_AACStreamFormatMP4FF, /**< AAC inside MPEG-4/ISO File Format */ - OMX_AUDIO_AACStreamFormatRAW, /**< AAC Raw Format */ - OMX_AUDIO_AACStreamFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_AACStreamFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_AACStreamFormatMax = 0x7FFFFFFF -} OMX_AUDIO_AACSTREAMFORMATTYPE; - - -/** AAC mode type. Note that the term profile is used with the MPEG-2 - * standard and the term object type and profile is used with MPEG-4 */ -typedef enum OMX_AUDIO_AACPROFILETYPE{ - OMX_AUDIO_AACObjectNull = 0, /**< Null, not used */ - OMX_AUDIO_AACObjectMain = 1, /**< AAC Main object */ - OMX_AUDIO_AACObjectLC, /**< AAC Low Complexity object (AAC profile) */ - OMX_AUDIO_AACObjectSSR, /**< AAC Scalable Sample Rate object */ - OMX_AUDIO_AACObjectLTP, /**< AAC Long Term Prediction object */ - OMX_AUDIO_AACObjectHE, /**< AAC High Efficiency (object type SBR, HE-AAC profile) */ - OMX_AUDIO_AACObjectScalable, /**< AAC Scalable object */ - OMX_AUDIO_AACObjectERLC = 17, /**< ER AAC Low Complexity object (Error Resilient AAC-LC) */ - OMX_AUDIO_AACObjectLD = 23, /**< AAC Low Delay object (Error Resilient) */ - OMX_AUDIO_AACObjectHE_PS = 29, /**< AAC High Efficiency with Parametric Stereo coding (HE-AAC v2, object type PS) */ - OMX_AUDIO_AACObjectELD = 39, /** AAC Enhanced Low Delay. NOTE: Pending Khronos standardization **/ - OMX_AUDIO_AACObjectKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_AACObjectVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_AACObjectMax = 0x7FFFFFFF -} OMX_AUDIO_AACPROFILETYPE; - - -/** AAC tool usage (for nAACtools in OMX_AUDIO_PARAM_AACPROFILETYPE). - * Required for encoder configuration and optional as decoder info output. - * For MP3, OMX_AUDIO_CHANNELMODETYPE is sufficient. */ -#define OMX_AUDIO_AACToolNone 0x00000000 /**< no AAC tools allowed (encoder config) or active (decoder info output) */ -#define OMX_AUDIO_AACToolMS 0x00000001 /**< MS: Mid/side joint coding tool allowed or active */ -#define OMX_AUDIO_AACToolIS 0x00000002 /**< IS: Intensity stereo tool allowed or active */ -#define OMX_AUDIO_AACToolTNS 0x00000004 /**< TNS: Temporal Noise Shaping tool allowed or active */ -#define OMX_AUDIO_AACToolPNS 0x00000008 /**< PNS: MPEG-4 Perceptual Noise substitution tool allowed or active */ -#define OMX_AUDIO_AACToolLTP 0x00000010 /**< LTP: MPEG-4 Long Term Prediction tool allowed or active */ -#define OMX_AUDIO_AACToolAll 0x7FFFFFFF /**< all AAC tools allowed or active (*/ - -/** MPEG-4 AAC error resilience (ER) tool usage (for nAACERtools in OMX_AUDIO_PARAM_AACPROFILETYPE). - * Required for ER encoder configuration and optional as decoder info output */ -#define OMX_AUDIO_AACERNone 0x00000000 /**< no AAC ER tools allowed/used */ -#define OMX_AUDIO_AACERVCB11 0x00000001 /**< VCB11: Virtual Code Books for AAC section data */ -#define OMX_AUDIO_AACERRVLC 0x00000002 /**< RVLC: Reversible Variable Length Coding */ -#define OMX_AUDIO_AACERHCR 0x00000004 /**< HCR: Huffman Codeword Reordering */ -#define OMX_AUDIO_AACERAll 0x7FFFFFFF /**< all AAC ER tools allowed/used */ - - -/** AAC params */ -typedef struct OMX_AUDIO_PARAM_AACPROFILETYPE { - OMX_U32 nSize; /**< Size of this structure, in Bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for - variable or unknown sampling rate. */ - OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable - rate or unknown bit rates */ - OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should - limit the audio signal. Use 0 to let encoder decide */ - OMX_U32 nFrameLength; /**< Frame length (in audio samples per channel) of the codec. - Can be 1024 or 960 (AAC-LC), 2048 (HE-AAC), 480 or 512 (AAC-LD). - Use 0 to let encoder decide */ - OMX_U32 nAACtools; /**< AAC tool usage */ - OMX_U32 nAACERtools; /**< MPEG-4 AAC error resilience tool usage */ - OMX_AUDIO_AACPROFILETYPE eAACProfile; /**< AAC profile enumeration */ - OMX_AUDIO_AACSTREAMFORMATTYPE eAACStreamFormat; /**< AAC stream format enumeration */ - OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */ -} OMX_AUDIO_PARAM_AACPROFILETYPE; - - -/** VORBIS params */ -typedef struct OMX_AUDIO_PARAM_VORBISTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nBitRate; /**< Bit rate of the encoded data data. Use 0 for variable - rate or unknown bit rates. Encoding is set to the - bitrate closest to specified value (in bps) */ - OMX_U32 nMinBitRate; /**< Sets minimum bitrate (in bps). */ - OMX_U32 nMaxBitRate; /**< Sets maximum bitrate (in bps). */ - - OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for - variable or unknown sampling rate. */ - OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should - limit the audio signal. Use 0 to let encoder decide */ - OMX_S32 nQuality; /**< Sets encoding quality to n, between -1 (low) and 10 (high). - In the default mode of operation, teh quality level is 3. - Normal quality range is 0 - 10. */ - OMX_BOOL bManaged; /**< Set bitrate management mode. This turns off the - normal VBR encoding, but allows hard or soft bitrate - constraints to be enforced by the encoder. This mode can - be slower, and may also be lower quality. It is - primarily useful for streaming. */ - OMX_BOOL bDownmix; /**< Downmix input from stereo to mono (has no effect on - non-stereo streams). Useful for lower-bitrate encoding. */ -} OMX_AUDIO_PARAM_VORBISTYPE; - - -/** FLAC params */ -typedef struct OMX_AUDIO_PARAM_FLACTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for - unknown sampling rate. */ - OMX_U32 nCompressionLevel;/**< FLAC compression level, from 0 (fastest compression) - to 8 (highest compression */ -} OMX_AUDIO_PARAM_FLACTYPE; - - -/** WMA Version */ -typedef enum OMX_AUDIO_WMAFORMATTYPE { - OMX_AUDIO_WMAFormatUnused = 0, /**< format unused or unknown */ - OMX_AUDIO_WMAFormat7, /**< Windows Media Audio format 7 */ - OMX_AUDIO_WMAFormat8, /**< Windows Media Audio format 8 */ - OMX_AUDIO_WMAFormat9, /**< Windows Media Audio format 9 */ - OMX_AUDIO_WMAFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_WMAFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_WMAFormatMax = 0x7FFFFFFF -} OMX_AUDIO_WMAFORMATTYPE; - - -/** WMA Profile */ -typedef enum OMX_AUDIO_WMAPROFILETYPE { - OMX_AUDIO_WMAProfileUnused = 0, /**< profile unused or unknown */ - OMX_AUDIO_WMAProfileL1, /**< Windows Media audio version 9 profile L1 */ - OMX_AUDIO_WMAProfileL2, /**< Windows Media audio version 9 profile L2 */ - OMX_AUDIO_WMAProfileL3, /**< Windows Media audio version 9 profile L3 */ - OMX_AUDIO_WMAProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_WMAProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_WMAProfileMax = 0x7FFFFFFF -} OMX_AUDIO_WMAPROFILETYPE; - - -/** WMA params */ -typedef struct OMX_AUDIO_PARAM_WMATYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U16 nChannels; /**< Number of channels */ - OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable - rate or unknown bit rates */ - OMX_AUDIO_WMAFORMATTYPE eFormat; /**< Version of WMA stream / data */ - OMX_AUDIO_WMAPROFILETYPE eProfile; /**< Profile of WMA stream / data */ - OMX_U32 nSamplingRate; /**< Sampling rate of the source data */ - OMX_U16 nBlockAlign; /**< is the block alignment, or block size, in bytes of the audio codec */ - OMX_U16 nEncodeOptions; /**< WMA Type-specific data */ - OMX_U32 nSuperBlockAlign; /**< WMA Type-specific data */ -} OMX_AUDIO_PARAM_WMATYPE; - -/** - * RealAudio format - */ -typedef enum OMX_AUDIO_RAFORMATTYPE { - OMX_AUDIO_RAFormatUnused = 0, /**< Format unused or unknown */ - OMX_AUDIO_RA8, /**< RealAudio 8 codec */ - OMX_AUDIO_RA9, /**< RealAudio 9 codec */ - OMX_AUDIO_RA10_AAC, /**< MPEG-4 AAC codec for bitrates of more than 128kbps */ - OMX_AUDIO_RA10_CODEC, /**< RealAudio codec for bitrates less than 128 kbps */ - OMX_AUDIO_RA10_LOSSLESS, /**< RealAudio Lossless */ - OMX_AUDIO_RA10_MULTICHANNEL, /**< RealAudio Multichannel */ - OMX_AUDIO_RA10_VOICE, /**< RealAudio Voice for bitrates below 15 kbps */ - OMX_AUDIO_RAFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_RAFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_RAFormatMax = 0x7FFFFFFF -} OMX_AUDIO_RAFORMATTYPE; - -/** RA (Real Audio) params */ -typedef struct OMX_AUDIO_PARAM_RATYPE { - OMX_U32 nSize; /**< Size of this structure, in Bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nSamplingRate; /**< is the sampling rate of the source data */ - OMX_U32 nBitsPerFrame; /**< is the value for bits per frame */ - OMX_U32 nSamplePerFrame; /**< is the value for samples per frame */ - OMX_U32 nCouplingQuantBits; /**< is the number of coupling quantization bits in the stream */ - OMX_U32 nCouplingStartRegion; /**< is the coupling start region in the stream */ - OMX_U32 nNumRegions; /**< is the number of regions value */ - OMX_AUDIO_RAFORMATTYPE eFormat; /**< is the RealAudio audio format */ -} OMX_AUDIO_PARAM_RATYPE; - - -/** SBC Allocation Method Type */ -typedef enum OMX_AUDIO_SBCALLOCMETHODTYPE { - OMX_AUDIO_SBCAllocMethodLoudness, /**< Loudness allocation method */ - OMX_AUDIO_SBCAllocMethodSNR, /**< SNR allocation method */ - OMX_AUDIO_SBCAllocMethodKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_SBCAllocMethodVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_SBCAllocMethodMax = 0x7FFFFFFF -} OMX_AUDIO_SBCALLOCMETHODTYPE; - - -/** SBC params */ -typedef struct OMX_AUDIO_PARAM_SBCTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable - rate or unknown bit rates */ - OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for - variable or unknown sampling rate. */ - OMX_U32 nBlocks; /**< Number of blocks */ - OMX_U32 nSubbands; /**< Number of subbands */ - OMX_U32 nBitPool; /**< Bitpool value */ - OMX_BOOL bEnableBitrate; /**< Use bitrate value instead of bitpool */ - OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */ - OMX_AUDIO_SBCALLOCMETHODTYPE eSBCAllocType; /**< SBC Allocation method type */ -} OMX_AUDIO_PARAM_SBCTYPE; - - -/** ADPCM stream format parameters */ -typedef struct OMX_AUDIO_PARAM_ADPCMTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_U32 nBitsPerSample; /**< Number of bits in each sample */ - OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for - variable or unknown sampling rate. */ -} OMX_AUDIO_PARAM_ADPCMTYPE; - - -/** G723 rate */ -typedef enum OMX_AUDIO_G723RATE { - OMX_AUDIO_G723ModeUnused = 0, /**< AMRNB Mode unused / unknown */ - OMX_AUDIO_G723ModeLow, /**< 5300 bps */ - OMX_AUDIO_G723ModeHigh, /**< 6300 bps */ - OMX_AUDIO_G723ModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_G723ModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_G723ModeMax = 0x7FFFFFFF -} OMX_AUDIO_G723RATE; - - -/** G723 - Sample rate must be 8 KHz */ -typedef struct OMX_AUDIO_PARAM_G723TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_AUDIO_G723RATE eBitRate; /**< todo: Should this be moved to a config? */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ - OMX_BOOL bPostFilter; /**< Enable Post Filter */ -} OMX_AUDIO_PARAM_G723TYPE; - - -/** ITU G726 (ADPCM) rate */ -typedef enum OMX_AUDIO_G726MODE { - OMX_AUDIO_G726ModeUnused = 0, /**< G726 Mode unused / unknown */ - OMX_AUDIO_G726Mode16, /**< 16 kbps */ - OMX_AUDIO_G726Mode24, /**< 24 kbps */ - OMX_AUDIO_G726Mode32, /**< 32 kbps, most common rate, also G721 */ - OMX_AUDIO_G726Mode40, /**< 40 kbps */ - OMX_AUDIO_G726ModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_G726ModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_G726ModeMax = 0x7FFFFFFF -} OMX_AUDIO_G726MODE; - - -/** G.726 stream format parameters - must be at 8KHz */ -typedef struct OMX_AUDIO_PARAM_G726TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_AUDIO_G726MODE eG726Mode; -} OMX_AUDIO_PARAM_G726TYPE; - - -/** G729 coder type */ -typedef enum OMX_AUDIO_G729TYPE { - OMX_AUDIO_G729 = 0, /**< ITU G.729 encoded data */ - OMX_AUDIO_G729A, /**< ITU G.729 annex A encoded data */ - OMX_AUDIO_G729B, /**< ITU G.729 with annex B encoded data */ - OMX_AUDIO_G729AB, /**< ITU G.729 annexes A and B encoded data */ - OMX_AUDIO_G729KhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_G729VendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_G729Max = 0x7FFFFFFF -} OMX_AUDIO_G729TYPE; - - -/** G729 stream format parameters - fixed 6KHz sample rate */ -typedef struct OMX_AUDIO_PARAM_G729TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_AUDIO_G729TYPE eBitType; -} OMX_AUDIO_PARAM_G729TYPE; - - -/** AMR Frame format */ -typedef enum OMX_AUDIO_AMRFRAMEFORMATTYPE { - OMX_AUDIO_AMRFrameFormatConformance = 0, /**< Frame Format is AMR Conformance - (Standard) Format */ - OMX_AUDIO_AMRFrameFormatIF1, /**< Frame Format is AMR Interface - Format 1 */ - OMX_AUDIO_AMRFrameFormatIF2, /**< Frame Format is AMR Interface - Format 2*/ - OMX_AUDIO_AMRFrameFormatFSF, /**< Frame Format is AMR File Storage - Format */ - OMX_AUDIO_AMRFrameFormatRTPPayload, /**< Frame Format is AMR Real-Time - Transport Protocol Payload Format */ - OMX_AUDIO_AMRFrameFormatITU, /**< Frame Format is ITU Format (added at Motorola request) */ - OMX_AUDIO_AMRFrameFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_AMRFrameFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_AMRFrameFormatMax = 0x7FFFFFFF -} OMX_AUDIO_AMRFRAMEFORMATTYPE; - - -/** AMR band mode */ -typedef enum OMX_AUDIO_AMRBANDMODETYPE { - OMX_AUDIO_AMRBandModeUnused = 0, /**< AMRNB Mode unused / unknown */ - OMX_AUDIO_AMRBandModeNB0, /**< AMRNB Mode 0 = 4750 bps */ - OMX_AUDIO_AMRBandModeNB1, /**< AMRNB Mode 1 = 5150 bps */ - OMX_AUDIO_AMRBandModeNB2, /**< AMRNB Mode 2 = 5900 bps */ - OMX_AUDIO_AMRBandModeNB3, /**< AMRNB Mode 3 = 6700 bps */ - OMX_AUDIO_AMRBandModeNB4, /**< AMRNB Mode 4 = 7400 bps */ - OMX_AUDIO_AMRBandModeNB5, /**< AMRNB Mode 5 = 7950 bps */ - OMX_AUDIO_AMRBandModeNB6, /**< AMRNB Mode 6 = 10200 bps */ - OMX_AUDIO_AMRBandModeNB7, /**< AMRNB Mode 7 = 12200 bps */ - OMX_AUDIO_AMRBandModeWB0, /**< AMRWB Mode 0 = 6600 bps */ - OMX_AUDIO_AMRBandModeWB1, /**< AMRWB Mode 1 = 8850 bps */ - OMX_AUDIO_AMRBandModeWB2, /**< AMRWB Mode 2 = 12650 bps */ - OMX_AUDIO_AMRBandModeWB3, /**< AMRWB Mode 3 = 14250 bps */ - OMX_AUDIO_AMRBandModeWB4, /**< AMRWB Mode 4 = 15850 bps */ - OMX_AUDIO_AMRBandModeWB5, /**< AMRWB Mode 5 = 18250 bps */ - OMX_AUDIO_AMRBandModeWB6, /**< AMRWB Mode 6 = 19850 bps */ - OMX_AUDIO_AMRBandModeWB7, /**< AMRWB Mode 7 = 23050 bps */ - OMX_AUDIO_AMRBandModeWB8, /**< AMRWB Mode 8 = 23850 bps */ - OMX_AUDIO_AMRBandModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_AMRBandModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_AMRBandModeMax = 0x7FFFFFFF -} OMX_AUDIO_AMRBANDMODETYPE; - - -/** AMR Discontinuous Transmission mode */ -typedef enum OMX_AUDIO_AMRDTXMODETYPE { - OMX_AUDIO_AMRDTXModeOff = 0, /**< AMR Discontinuous Transmission Mode is disabled */ - OMX_AUDIO_AMRDTXModeOnVAD1, /**< AMR Discontinuous Transmission Mode using - Voice Activity Detector 1 (VAD1) is enabled */ - OMX_AUDIO_AMRDTXModeOnVAD2, /**< AMR Discontinuous Transmission Mode using - Voice Activity Detector 2 (VAD2) is enabled */ - OMX_AUDIO_AMRDTXModeOnAuto, /**< The codec will automatically select between - Off, VAD1 or VAD2 modes */ - - OMX_AUDIO_AMRDTXasEFR, /**< DTX as EFR instead of AMR standard (3GPP 26.101, frame type =8,9,10) */ - - OMX_AUDIO_AMRDTXModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_AMRDTXModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_AMRDTXModeMax = 0x7FFFFFFF -} OMX_AUDIO_AMRDTXMODETYPE; - - -/** AMR params */ -typedef struct OMX_AUDIO_PARAM_AMRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels */ - OMX_U32 nBitRate; /**< Bit rate read only field */ - OMX_AUDIO_AMRBANDMODETYPE eAMRBandMode; /**< AMR Band Mode enumeration */ - OMX_AUDIO_AMRDTXMODETYPE eAMRDTXMode; /**< AMR DTX Mode enumeration */ - OMX_AUDIO_AMRFRAMEFORMATTYPE eAMRFrameFormat; /**< AMR frame format enumeration */ -} OMX_AUDIO_PARAM_AMRTYPE; - - -/** GSM_FR (ETSI 06.10, 3GPP 46.010) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_GSMFRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_GSMFRTYPE; - - -/** GSM-HR (ETSI 06.20, 3GPP 46.020) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_GSMHRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_GSMHRTYPE; - - -/** GSM-EFR (ETSI 06.60, 3GPP 46.060) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_GSMEFRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_GSMEFRTYPE; - - -/** TDMA FR (TIA/EIA-136-420, VSELP 7.95kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_TDMAFRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_TDMAFRTYPE; - - -/** TDMA EFR (TIA/EIA-136-410, ACELP 7.4kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_TDMAEFRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_TDMAEFRTYPE; - - -/** PDC FR ( RCR-27, VSELP 6.7kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_PDCFRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_PDCFRTYPE; - - -/** PDC EFR ( RCR-27, ACELP 6.7kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_PDCEFRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_PDCEFRTYPE; - -/** PDC HR ( RCR-27, PSI-CELP 3.45kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_PDCHRTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ - OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ -} OMX_AUDIO_PARAM_PDCHRTYPE; - - -/** CDMA Rate types */ -typedef enum OMX_AUDIO_CDMARATETYPE { - OMX_AUDIO_CDMARateBlank = 0, /**< CDMA encoded frame is blank */ - OMX_AUDIO_CDMARateFull, /**< CDMA encoded frame in full rate */ - OMX_AUDIO_CDMARateHalf, /**< CDMA encoded frame in half rate */ - OMX_AUDIO_CDMARateQuarter, /**< CDMA encoded frame in quarter rate */ - OMX_AUDIO_CDMARateEighth, /**< CDMA encoded frame in eighth rate (DTX)*/ - OMX_AUDIO_CDMARateErasure, /**< CDMA erasure frame */ - OMX_AUDIO_CDMARateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_CDMARateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_CDMARateMax = 0x7FFFFFFF -} OMX_AUDIO_CDMARATETYPE; - - -/** QCELP8 (TIA/EIA-96, up to 8kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_QCELP8TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable - rate or unknown bit rates */ - OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */ - OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */ - OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */ -} OMX_AUDIO_PARAM_QCELP8TYPE; - - -/** QCELP13 ( CDMA, EIA/TIA-733, 13.3kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_QCELP13TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */ - OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */ - OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */ -} OMX_AUDIO_PARAM_QCELP13TYPE; - - -/** EVRC ( CDMA, EIA/TIA-127, RCELP up to 8.55kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_EVRCTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_AUDIO_CDMARATETYPE eCDMARate; /**< actual Frame rate */ - OMX_BOOL bRATE_REDUCon; /**< RATE_REDUCtion is requested for this frame */ - OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */ - OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */ - OMX_BOOL bHiPassFilter; /**< Enable encoder's High Pass Filter */ - OMX_BOOL bNoiseSuppressor; /**< Enable encoder's noise suppressor pre-processing */ - OMX_BOOL bPostFilter; /**< Enable decoder's post Filter */ -} OMX_AUDIO_PARAM_EVRCTYPE; - - -/** SMV ( up to 8.55kbps coder) stream format parameters */ -typedef struct OMX_AUDIO_PARAM_SMVTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannels; /**< Number of channels in the data stream (not - necessarily the same as the number of channels - to be rendered. */ - OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */ - OMX_BOOL bRATE_REDUCon; /**< RATE_REDUCtion is requested for this frame */ - OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 ??*/ - OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 ??*/ - OMX_BOOL bHiPassFilter; /**< Enable encoder's High Pass Filter ??*/ - OMX_BOOL bNoiseSuppressor; /**< Enable encoder's noise suppressor pre-processing */ - OMX_BOOL bPostFilter; /**< Enable decoder's post Filter ??*/ -} OMX_AUDIO_PARAM_SMVTYPE; - - -/** MIDI Format - * @ingroup midi - */ -typedef enum OMX_AUDIO_MIDIFORMATTYPE -{ - OMX_AUDIO_MIDIFormatUnknown = 0, /**< MIDI Format unknown or don't care */ - OMX_AUDIO_MIDIFormatSMF0, /**< Standard MIDI File Type 0 */ - OMX_AUDIO_MIDIFormatSMF1, /**< Standard MIDI File Type 1 */ - OMX_AUDIO_MIDIFormatSMF2, /**< Standard MIDI File Type 2 */ - OMX_AUDIO_MIDIFormatSPMIDI, /**< SP-MIDI */ - OMX_AUDIO_MIDIFormatXMF0, /**< eXtensible Music Format type 0 */ - OMX_AUDIO_MIDIFormatXMF1, /**< eXtensible Music Format type 1 */ - OMX_AUDIO_MIDIFormatMobileXMF, /**< Mobile XMF (eXtensible Music Format type 2) */ - OMX_AUDIO_MIDIFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_MIDIFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_MIDIFormatMax = 0x7FFFFFFF -} OMX_AUDIO_MIDIFORMATTYPE; - - -/** MIDI params - * @ingroup midi - */ -typedef struct OMX_AUDIO_PARAM_MIDITYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nFileSize; /**< size of the MIDI file in bytes, where the entire - MIDI file passed in, otherwise if 0x0, the MIDI data - is merged and streamed (instead of passed as an - entire MIDI file) */ - OMX_BU32 sMaxPolyphony; /**< Specifies the maximum simultaneous polyphonic - voices. A value of zero indicates that the default - polyphony of the device is used */ - OMX_BOOL bLoadDefaultSound; /**< Whether to load default sound - bank at initialization */ - OMX_AUDIO_MIDIFORMATTYPE eMidiFormat; /**< Version of the MIDI file */ -} OMX_AUDIO_PARAM_MIDITYPE; - - -/** Type of the MIDI sound bank - * @ingroup midi - */ -typedef enum OMX_AUDIO_MIDISOUNDBANKTYPE { - OMX_AUDIO_MIDISoundBankUnused = 0, /**< unused/unknown soundbank type */ - OMX_AUDIO_MIDISoundBankDLS1, /**< DLS version 1 */ - OMX_AUDIO_MIDISoundBankDLS2, /**< DLS version 2 */ - OMX_AUDIO_MIDISoundBankMobileDLSBase, /**< Mobile DLS, using the base functionality */ - OMX_AUDIO_MIDISoundBankMobileDLSPlusOptions, /**< Mobile DLS, using the specification-defined optional feature set */ - OMX_AUDIO_MIDISoundBankKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_MIDISoundBankVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_MIDISoundBankMax = 0x7FFFFFFF -} OMX_AUDIO_MIDISOUNDBANKTYPE; - - -/** Bank Layout describes how bank MSB & LSB are used in the DLS instrument definitions sound bank - * @ingroup midi - */ -typedef enum OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE { - OMX_AUDIO_MIDISoundBankLayoutUnused = 0, /**< unused/unknown soundbank type */ - OMX_AUDIO_MIDISoundBankLayoutGM, /**< GS layout (based on bank MSB 0x00) */ - OMX_AUDIO_MIDISoundBankLayoutGM2, /**< General MIDI 2 layout (using MSB 0x78/0x79, LSB 0x00) */ - OMX_AUDIO_MIDISoundBankLayoutUser, /**< Does not conform to any bank numbering standards */ - OMX_AUDIO_MIDISoundBankLayoutKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_MIDISoundBankLayoutVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_MIDISoundBankLayoutMax = 0x7FFFFFFF -} OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE; - - -/** MIDI params to load/unload user soundbank - * @ingroup midi - */ -typedef struct OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nDLSIndex; /**< DLS file index to be loaded */ - OMX_U32 nDLSSize; /**< Size in bytes */ - OMX_PTR pDLSData; /**< Pointer to DLS file data */ - OMX_AUDIO_MIDISOUNDBANKTYPE eMidiSoundBank; /**< Midi sound bank type enumeration */ - OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE eMidiSoundBankLayout; /**< Midi sound bank layout enumeration */ -} OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE; - - -/** Structure for Live MIDI events and MIP messages. - * (MIP = Maximum Instantaneous Polyphony; part of the SP-MIDI standard.) - * @ingroup midi - */ -typedef struct OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port that this structure applies to */ - OMX_U32 nMidiEventSize; /**< Size of immediate MIDI events or MIP message in bytes */ - OMX_U8 nMidiEvents[1]; /**< MIDI event array to be rendered immediately, or an - array for the MIP message buffer, where the size is - indicated by nMidiEventSize */ -} OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE; - - -/** MIDI sound bank/ program pair in a given channel - * @ingroup midi - */ -typedef struct OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port that this structure applies to */ - OMX_U32 nChannel; /**< Valid channel values range from 1 to 16 */ - OMX_U16 nIDProgram; /**< Valid program ID range is 1 to 128 */ - OMX_U16 nIDSoundBank; /**< Sound bank ID */ - OMX_U32 nUserSoundBankIndex;/**< User soundbank index, easier to access soundbanks - by index if multiple banks are present */ -} OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE; - - -/** MIDI control - * @ingroup midi - */ -typedef struct OMX_AUDIO_CONFIG_MIDICONTROLTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BS32 sPitchTransposition; /**< Pitch transposition in semitones, stored as Q22.10 - format based on JAVA MMAPI (JSR-135) requirement */ - OMX_BU32 sPlayBackRate; /**< Relative playback rate, stored as Q14.17 fixed-point - number based on JSR-135 requirement */ - OMX_BU32 sTempo ; /**< Tempo in beats per minute (BPM), stored as Q22.10 - fixed-point number based on JSR-135 requirement */ - OMX_U32 nMaxPolyphony; /**< Specifies the maximum simultaneous polyphonic - voices. A value of zero indicates that the default - polyphony of the device is used */ - OMX_U32 nNumRepeat; /**< Number of times to repeat playback */ - OMX_U32 nStopTime; /**< Time in milliseconds to indicate when playback - will stop automatically. Set to zero if not used */ - OMX_U16 nChannelMuteMask; /**< 16 bit mask for channel mute status */ - OMX_U16 nChannelSoloMask; /**< 16 bit mask for channel solo status */ - OMX_U32 nTrack0031MuteMask; /**< 32 bit mask for track mute status. Note: This is for tracks 0-31 */ - OMX_U32 nTrack3263MuteMask; /**< 32 bit mask for track mute status. Note: This is for tracks 32-63 */ - OMX_U32 nTrack0031SoloMask; /**< 32 bit mask for track solo status. Note: This is for tracks 0-31 */ - OMX_U32 nTrack3263SoloMask; /**< 32 bit mask for track solo status. Note: This is for tracks 32-63 */ - -} OMX_AUDIO_CONFIG_MIDICONTROLTYPE; - - -/** MIDI Playback States - * @ingroup midi - */ -typedef enum OMX_AUDIO_MIDIPLAYBACKSTATETYPE { - OMX_AUDIO_MIDIPlayBackStateUnknown = 0, /**< Unknown state or state does not map to - other defined states */ - OMX_AUDIO_MIDIPlayBackStateClosedEngaged, /**< No MIDI resource is currently open. - The MIDI engine is currently processing - MIDI events. */ - OMX_AUDIO_MIDIPlayBackStateParsing, /**< A MIDI resource is open and is being - primed. The MIDI engine is currently - processing MIDI events. */ - OMX_AUDIO_MIDIPlayBackStateOpenEngaged, /**< A MIDI resource is open and primed but - not playing. The MIDI engine is currently - processing MIDI events. The transition to - this state is only possible from the - OMX_AUDIO_MIDIPlayBackStatePlaying state, - when the 'playback head' reaches the end - of media data or the playback stops due - to stop time set.*/ - OMX_AUDIO_MIDIPlayBackStatePlaying, /**< A MIDI resource is open and currently - playing. The MIDI engine is currently - processing MIDI events.*/ - OMX_AUDIO_MIDIPlayBackStatePlayingPartially, /**< Best-effort playback due to SP-MIDI/DLS - resource constraints */ - OMX_AUDIO_MIDIPlayBackStatePlayingSilently, /**< Due to system resource constraints and - SP-MIDI content constraints, there is - no audible MIDI content during playback - currently. The situation may change if - resources are freed later.*/ - OMX_AUDIO_MIDIPlayBackStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_MIDIPlayBackStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_MIDIPlayBackStateMax = 0x7FFFFFFF -} OMX_AUDIO_MIDIPLAYBACKSTATETYPE; - - -/** MIDI status - * @ingroup midi - */ -typedef struct OMX_AUDIO_CONFIG_MIDISTATUSTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U16 nNumTracks; /**< Number of MIDI tracks in the file, read only field. - NOTE: May not return a meaningful value until the entire - file is parsed and buffered. */ - OMX_U32 nDuration; /**< The length of the currently open MIDI resource - in milliseconds. NOTE: May not return a meaningful value - until the entire file is parsed and buffered. */ - OMX_U32 nPosition; /**< Current Position of the MIDI resource being played - in milliseconds */ - OMX_BOOL bVibra; /**< Does Vibra track exist? NOTE: May not return a meaningful - value until the entire file is parsed and buffered. */ - OMX_U32 nNumMetaEvents; /**< Total number of MIDI Meta Events in the currently - open MIDI resource. NOTE: May not return a meaningful value - until the entire file is parsed and buffered. */ - OMX_U32 nNumActiveVoices; /**< Number of active voices in the currently playing - MIDI resource. NOTE: May not return a meaningful value until - the entire file is parsed and buffered. */ - OMX_AUDIO_MIDIPLAYBACKSTATETYPE eMIDIPlayBackState; /**< MIDI playback state enumeration, read only field */ -} OMX_AUDIO_CONFIG_MIDISTATUSTYPE; - - -/** MIDI Meta Event structure one per Meta Event. - * MIDI Meta Events are like audio metadata, except that they are interspersed - * with the MIDI content throughout the file and are not localized in the header. - * As such, it is necessary to retrieve information about these Meta Events from - * the engine, as it encounters these Meta Events within the MIDI content. - * For example, SMF files can have up to 14 types of MIDI Meta Events (copyright, - * author, default tempo, etc.) scattered throughout the file. - * @ingroup midi - */ -typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE{ - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nIndex; /**< Index of Meta Event */ - OMX_U8 nMetaEventType; /**< Meta Event Type, 7bits (i.e. 0 - 127) */ - OMX_U32 nMetaEventSize; /**< size of the Meta Event in bytes */ - OMX_U32 nTrack; /**< track number for the meta event */ - OMX_U32 nPosition; /**< Position of the meta-event in milliseconds */ -} OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE; - - -/** MIDI Meta Event Data structure - one per Meta Event. - * @ingroup midi - */ -typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE{ - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nIndex; /**< Index of Meta Event */ - OMX_U32 nMetaEventSize; /**< size of the Meta Event in bytes */ - OMX_U8 nData[1]; /**< array of one or more bytes of meta data - as indicated by the nMetaEventSize field */ -} OMX_AUDIO_CONFIG__MIDIMETAEVENTDATATYPE; - - -/** Audio Volume adjustment for a port */ -typedef struct OMX_AUDIO_CONFIG_VOLUMETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port index indicating which port to - set. Select the input port to set - just that port's volume. Select the - output port to adjust the master - volume. */ - OMX_BOOL bLinear; /**< Is the volume to be set in linear (0.100) - or logarithmic scale (mB) */ - OMX_BS32 sVolume; /**< Volume linear setting in the 0..100 range, OR - Volume logarithmic setting for this port. The values - for volume are in mB (millibels = 1/100 dB) relative - to a gain of 1 (e.g. the output is the same as the - input level). Values are in mB from nMax - (maximum volume) to nMin mB (typically negative). - Since the volume is "voltage" - and not a "power", it takes a setting of - -600 mB to decrease the volume by 1/2. If - a component cannot accurately set the - volume to the requested value, it must - set the volume to the closest value BELOW - the requested value. When getting the - volume setting, the current actual volume - must be returned. */ -} OMX_AUDIO_CONFIG_VOLUMETYPE; - - -/** Audio Volume adjustment for a channel */ -typedef struct OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port index indicating which port to - set. Select the input port to set - just that port's volume. Select the - output port to adjust the master - volume. */ - OMX_U32 nChannel; /**< channel to select from 0 to N-1, - using OMX_ALL to apply volume settings - to all channels */ - OMX_BOOL bLinear; /**< Is the volume to be set in linear (0.100) or - logarithmic scale (mB) */ - OMX_BS32 sVolume; /**< Volume linear setting in the 0..100 range, OR - Volume logarithmic setting for this port. - The values for volume are in mB - (millibels = 1/100 dB) relative to a gain - of 1 (e.g. the output is the same as the - input level). Values are in mB from nMax - (maximum volume) to nMin mB (typically negative). - Since the volume is "voltage" - and not a "power", it takes a setting of - -600 mB to decrease the volume by 1/2. If - a component cannot accurately set the - volume to the requested value, it must - set the volume to the closest value BELOW - the requested value. When getting the - volume setting, the current actual volume - must be returned. */ - OMX_BOOL bIsMIDI; /**< TRUE if nChannel refers to a MIDI channel, - FALSE otherwise */ -} OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE; - - -/** Audio balance setting */ -typedef struct OMX_AUDIO_CONFIG_BALANCETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port index indicating which port to - set. Select the input port to set - just that port's balance. Select the - output port to adjust the master - balance. */ - OMX_S32 nBalance; /**< balance setting for this port - (-100 to 100, where -100 indicates - all left, and no right */ -} OMX_AUDIO_CONFIG_BALANCETYPE; - - -/** Audio Port mute */ -typedef struct OMX_AUDIO_CONFIG_MUTETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port index indicating which port to - set. Select the input port to set - just that port's mute. Select the - output port to adjust the master - mute. */ - OMX_BOOL bMute; /**< Mute setting for this port */ -} OMX_AUDIO_CONFIG_MUTETYPE; - - -/** Audio Channel mute */ -typedef struct OMX_AUDIO_CONFIG_CHANNELMUTETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nChannel; /**< channel to select from 0 to N-1, - using OMX_ALL to apply mute settings - to all channels */ - OMX_BOOL bMute; /**< Mute setting for this channel */ - OMX_BOOL bIsMIDI; /**< TRUE if nChannel refers to a MIDI channel, - FALSE otherwise */ -} OMX_AUDIO_CONFIG_CHANNELMUTETYPE; - - - -/** Enable / Disable for loudness control, which boosts bass and to a - * smaller extent high end frequencies to compensate for hearing - * ability at the extreme ends of the audio spectrum - */ -typedef struct OMX_AUDIO_CONFIG_LOUDNESSTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bLoudness; /**< Enable/disable for loudness */ -} OMX_AUDIO_CONFIG_LOUDNESSTYPE; - - -/** Enable / Disable for bass, which controls low frequencies - */ -typedef struct OMX_AUDIO_CONFIG_BASSTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bEnable; /**< Enable/disable for bass control */ - OMX_S32 nBass; /**< bass setting for the port, as a - continuous value from -100 to 100 - (0 means no change in bass level)*/ -} OMX_AUDIO_CONFIG_BASSTYPE; - - -/** Enable / Disable for treble, which controls high frequencies tones - */ -typedef struct OMX_AUDIO_CONFIG_TREBLETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bEnable; /**< Enable/disable for treble control */ - OMX_S32 nTreble; /**< treble setting for the port, as a - continuous value from -100 to 100 - (0 means no change in treble level) */ -} OMX_AUDIO_CONFIG_TREBLETYPE; - - -/** An equalizer is typically used for two reasons: to compensate for an - * sub-optimal frequency response of a system to make it sound more natural - * or to create intentionally some unnatural coloring to the sound to create - * an effect. - * @ingroup effects - */ -typedef struct OMX_AUDIO_CONFIG_EQUALIZERTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bEnable; /**< Enable/disable for equalizer */ - OMX_BU32 sBandIndex; /**< Band number to be set. Upper Limit is - N-1, where N is the number of bands, lower limit is 0 */ - OMX_BU32 sCenterFreq; /**< Center frequecies in Hz. This is a - read only element and is used to determine - the lower, center and upper frequency of - this band. */ - OMX_BS32 sBandLevel; /**< band level in millibels */ -} OMX_AUDIO_CONFIG_EQUALIZERTYPE; - - -/** Stereo widening mode type - * @ingroup effects - */ -typedef enum OMX_AUDIO_STEREOWIDENINGTYPE { - OMX_AUDIO_StereoWideningHeadphones, /**< Stereo widening for loudspeakers */ - OMX_AUDIO_StereoWideningLoudspeakers, /**< Stereo widening for closely spaced loudspeakers */ - OMX_AUDIO_StereoWideningKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_StereoWideningVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_StereoWideningMax = 0x7FFFFFFF -} OMX_AUDIO_STEREOWIDENINGTYPE; - - -/** Control for stereo widening, which is a special 2-channel - * case of the audio virtualizer effect. For example, for 5.1-channel - * output, it translates to virtual surround sound. - * @ingroup effects - */ -typedef struct OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bEnable; /**< Enable/disable for stereo widening control */ - OMX_AUDIO_STEREOWIDENINGTYPE eWideningType; /**< Stereo widening algorithm type */ - OMX_U32 nStereoWidening; /**< stereo widening setting for the port, - as a continuous value from 0 to 100 */ -} OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE; - - -/** The chorus effect (or ``choralizer'') is any signal processor which makes - * one sound source (such as a voice) sound like many such sources singing - * (or playing) in unison. Since performance in unison is never exact, chorus - * effects simulate this by making independently modified copies of the input - * signal. Modifications may include (1) delay, (2) frequency shift, and - * (3) amplitude modulation. - * @ingroup effects - */ -typedef struct OMX_AUDIO_CONFIG_CHORUSTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bEnable; /**< Enable/disable for chorus */ - OMX_BU32 sDelay; /**< average delay in milliseconds */ - OMX_BU32 sModulationRate; /**< rate of modulation in millihertz */ - OMX_U32 nModulationDepth; /**< depth of modulation as a percentage of - delay (i.e. 0 to 100) */ - OMX_BU32 nFeedback; /**< Feedback from chorus output to input in percentage */ -} OMX_AUDIO_CONFIG_CHORUSTYPE; - - -/** Reverberation is part of the reflected sound that follows the early - * reflections. In a typical room, this consists of a dense succession of - * echoes whose energy decays exponentially. The reverberation effect structure - * as defined here includes both (early) reflections as well as (late) reverberations. - * @ingroup effects - */ -typedef struct OMX_AUDIO_CONFIG_REVERBERATIONTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bEnable; /**< Enable/disable for reverberation control */ - OMX_BS32 sRoomLevel; /**< Intensity level for the whole room effect - (i.e. both early reflections and late - reverberation) in millibels */ - OMX_BS32 sRoomHighFreqLevel; /**< Attenuation at high frequencies - relative to the intensity at low - frequencies in millibels */ - OMX_BS32 sReflectionsLevel; /**< Intensity level of early reflections - (relative to room value), in millibels */ - OMX_BU32 sReflectionsDelay; /**< Delay time of the first reflection relative - to the direct path, in milliseconds */ - OMX_BS32 sReverbLevel; /**< Intensity level of late reverberation - relative to room level, in millibels */ - OMX_BU32 sReverbDelay; /**< Time delay from the first early reflection - to the beginning of the late reverberation - section, in milliseconds */ - OMX_BU32 sDecayTime; /**< Late reverberation decay time at low - frequencies, in milliseconds */ - OMX_BU32 nDecayHighFreqRatio; /**< Ratio of high frequency decay time relative - to low frequency decay time in percent */ - OMX_U32 nDensity; /**< Modal density in the late reverberation decay, - in percent (i.e. 0 - 100) */ - OMX_U32 nDiffusion; /**< Echo density in the late reverberation decay, - in percent (i.e. 0 - 100) */ - OMX_BU32 sReferenceHighFreq; /**< Reference high frequency in Hertz. This is - the frequency used as the reference for all - the high-frequency settings above */ - -} OMX_AUDIO_CONFIG_REVERBERATIONTYPE; - - -/** Possible settings for the Echo Cancelation structure to use - * @ingroup effects - */ -typedef enum OMX_AUDIO_ECHOCANTYPE { - OMX_AUDIO_EchoCanOff = 0, /**< Echo Cancellation is disabled */ - OMX_AUDIO_EchoCanNormal, /**< Echo Cancellation normal operation - - echo from plastics and face */ - OMX_AUDIO_EchoCanHFree, /**< Echo Cancellation optimized for - Hands Free operation */ - OMX_AUDIO_EchoCanCarKit, /**< Echo Cancellation optimized for - Car Kit (longer echo) */ - OMX_AUDIO_EchoCanKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_AUDIO_EchoCanVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_AUDIO_EchoCanMax = 0x7FFFFFFF -} OMX_AUDIO_ECHOCANTYPE; - - -/** Enable / Disable for echo cancelation, which removes undesired echo's - * from the audio - * @ingroup effects - */ -typedef struct OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_AUDIO_ECHOCANTYPE eEchoCancelation; /**< Echo cancelation settings */ -} OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE; - - -/** Enable / Disable for noise reduction, which undesired noise from - * the audio - * @ingroup effects - */ -typedef struct OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BOOL bNoiseReduction; /**< Enable/disable for noise reduction */ -} OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE; - -/** @} */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ diff --git a/external/android/include/19/frameworks/native/include/media/openmax/OMX_Component.h b/external/android/include/19/frameworks/native/include/media/openmax/OMX_Component.h deleted file mode 100644 index b5b784e..0000000 --- a/external/android/include/19/frameworks/native/include/media/openmax/OMX_Component.h +++ /dev/null @@ -1,596 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** OMX_Component.h - OpenMax IL version 1.1.2 - * The OMX_Component header file contains the definitions used to define - * the public interface of a component. This header file is intended to - * be used by both the application and the component. - */ - -#ifndef OMX_Component_h -#define OMX_Component_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - - -/* Each OMX header must include all required header files to allow the - * header to compile without errors. The includes below are required - * for this header file to compile successfully - */ - -#include -#include -#include -#include - -/** @ingroup comp */ -typedef enum OMX_PORTDOMAINTYPE { - OMX_PortDomainAudio, - OMX_PortDomainVideo, - OMX_PortDomainImage, - OMX_PortDomainOther, - OMX_PortDomainKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_PortDomainVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_PortDomainMax = 0x7ffffff -} OMX_PORTDOMAINTYPE; - -/** @ingroup comp */ -typedef struct OMX_PARAM_PORTDEFINITIONTYPE { - OMX_U32 nSize; /**< Size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Port number the structure applies to */ - OMX_DIRTYPE eDir; /**< Direction (input or output) of this port */ - OMX_U32 nBufferCountActual; /**< The actual number of buffers allocated on this port */ - OMX_U32 nBufferCountMin; /**< The minimum number of buffers this port requires */ - OMX_U32 nBufferSize; /**< Size, in bytes, for buffers to be used for this channel */ - OMX_BOOL bEnabled; /**< Ports default to enabled and are enabled/disabled by - OMX_CommandPortEnable/OMX_CommandPortDisable. - When disabled a port is unpopulated. A disabled port - is not populated with buffers on a transition to IDLE. */ - OMX_BOOL bPopulated; /**< Port is populated with all of its buffers as indicated by - nBufferCountActual. A disabled port is always unpopulated. - An enabled port is populated on a transition to OMX_StateIdle - and unpopulated on a transition to loaded. */ - OMX_PORTDOMAINTYPE eDomain; /**< Domain of the port. Determines the contents of metadata below. */ - union { - OMX_AUDIO_PORTDEFINITIONTYPE audio; - OMX_VIDEO_PORTDEFINITIONTYPE video; - OMX_IMAGE_PORTDEFINITIONTYPE image; - OMX_OTHER_PORTDEFINITIONTYPE other; - } format; - OMX_BOOL bBuffersContiguous; - OMX_U32 nBufferAlignment; -} OMX_PARAM_PORTDEFINITIONTYPE; - -/** @ingroup comp */ -typedef struct OMX_PARAM_U32TYPE { - OMX_U32 nSize; /**< Size of this structure, in Bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_U32 nU32; /**< U32 value */ -} OMX_PARAM_U32TYPE; - -/** @ingroup rpm */ -typedef enum OMX_SUSPENSIONPOLICYTYPE { - OMX_SuspensionDisabled, /**< No suspension; v1.0 behavior */ - OMX_SuspensionEnabled, /**< Suspension allowed */ - OMX_SuspensionPolicyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_SuspensionPolicyStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_SuspensionPolicyMax = 0x7fffffff -} OMX_SUSPENSIONPOLICYTYPE; - -/** @ingroup rpm */ -typedef struct OMX_PARAM_SUSPENSIONPOLICYTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_SUSPENSIONPOLICYTYPE ePolicy; -} OMX_PARAM_SUSPENSIONPOLICYTYPE; - -/** @ingroup rpm */ -typedef enum OMX_SUSPENSIONTYPE { - OMX_NotSuspended, /**< component is not suspended */ - OMX_Suspended, /**< component is suspended */ - OMX_SuspensionKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_SuspensionVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_SuspendMax = 0x7FFFFFFF -} OMX_SUSPENSIONTYPE; - -/** @ingroup rpm */ -typedef struct OMX_PARAM_SUSPENSIONTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_SUSPENSIONTYPE eType; -} OMX_PARAM_SUSPENSIONTYPE ; - -typedef struct OMX_CONFIG_BOOLEANTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_BOOL bEnabled; -} OMX_CONFIG_BOOLEANTYPE; - -/* Parameter specifying the content uri to use. */ -/** @ingroup cp */ -typedef struct OMX_PARAM_CONTENTURITYPE -{ - OMX_U32 nSize; /**< size of the structure in bytes, including - actual URI name */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U8 contentURI[1]; /**< The URI name */ -} OMX_PARAM_CONTENTURITYPE; - -/* Parameter specifying the pipe to use. */ -/** @ingroup cp */ -typedef struct OMX_PARAM_CONTENTPIPETYPE -{ - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_HANDLETYPE hPipe; /**< The pipe handle*/ -} OMX_PARAM_CONTENTPIPETYPE; - -/** @ingroup rpm */ -typedef struct OMX_RESOURCECONCEALMENTTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_BOOL bResourceConcealmentForbidden; /**< disallow the use of resource concealment - methods (like degrading algorithm quality to - lower resource consumption or functional bypass) - on a component as a resolution to resource conflicts. */ -} OMX_RESOURCECONCEALMENTTYPE; - - -/** @ingroup metadata */ -typedef enum OMX_METADATACHARSETTYPE { - OMX_MetadataCharsetUnknown = 0, - OMX_MetadataCharsetASCII, - OMX_MetadataCharsetBinary, - OMX_MetadataCharsetCodePage1252, - OMX_MetadataCharsetUTF8, - OMX_MetadataCharsetJavaConformantUTF8, - OMX_MetadataCharsetUTF7, - OMX_MetadataCharsetImapUTF7, - OMX_MetadataCharsetUTF16LE, - OMX_MetadataCharsetUTF16BE, - OMX_MetadataCharsetGB12345, - OMX_MetadataCharsetHZGB2312, - OMX_MetadataCharsetGB2312, - OMX_MetadataCharsetGB18030, - OMX_MetadataCharsetGBK, - OMX_MetadataCharsetBig5, - OMX_MetadataCharsetISO88591, - OMX_MetadataCharsetISO88592, - OMX_MetadataCharsetISO88593, - OMX_MetadataCharsetISO88594, - OMX_MetadataCharsetISO88595, - OMX_MetadataCharsetISO88596, - OMX_MetadataCharsetISO88597, - OMX_MetadataCharsetISO88598, - OMX_MetadataCharsetISO88599, - OMX_MetadataCharsetISO885910, - OMX_MetadataCharsetISO885913, - OMX_MetadataCharsetISO885914, - OMX_MetadataCharsetISO885915, - OMX_MetadataCharsetShiftJIS, - OMX_MetadataCharsetISO2022JP, - OMX_MetadataCharsetISO2022JP1, - OMX_MetadataCharsetISOEUCJP, - OMX_MetadataCharsetSMS7Bit, - OMX_MetadataCharsetKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_MetadataCharsetVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_MetadataCharsetTypeMax= 0x7FFFFFFF -} OMX_METADATACHARSETTYPE; - -/** @ingroup metadata */ -typedef enum OMX_METADATASCOPETYPE -{ - OMX_MetadataScopeAllLevels, - OMX_MetadataScopeTopLevel, - OMX_MetadataScopePortLevel, - OMX_MetadataScopeNodeLevel, - OMX_MetadataScopeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_MetadataScopeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_MetadataScopeTypeMax = 0x7fffffff -} OMX_METADATASCOPETYPE; - -/** @ingroup metadata */ -typedef enum OMX_METADATASEARCHMODETYPE -{ - OMX_MetadataSearchValueSizeByIndex, - OMX_MetadataSearchItemByIndex, - OMX_MetadataSearchNextItemByKey, - OMX_MetadataSearchKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_MetadataSearchVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_MetadataSearchTypeMax = 0x7fffffff -} OMX_METADATASEARCHMODETYPE; -/** @ingroup metadata */ -typedef struct OMX_CONFIG_METADATAITEMCOUNTTYPE -{ - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_METADATASCOPETYPE eScopeMode; - OMX_U32 nScopeSpecifier; - OMX_U32 nMetadataItemCount; -} OMX_CONFIG_METADATAITEMCOUNTTYPE; - -/** @ingroup metadata */ -typedef struct OMX_CONFIG_METADATAITEMTYPE -{ - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_METADATASCOPETYPE eScopeMode; - OMX_U32 nScopeSpecifier; - OMX_U32 nMetadataItemIndex; - OMX_METADATASEARCHMODETYPE eSearchMode; - OMX_METADATACHARSETTYPE eKeyCharset; - OMX_U8 nKeySizeUsed; - OMX_U8 nKey[128]; - OMX_METADATACHARSETTYPE eValueCharset; - OMX_STRING sLanguageCountry; - OMX_U32 nValueMaxSize; - OMX_U32 nValueSizeUsed; - OMX_U8 nValue[1]; -} OMX_CONFIG_METADATAITEMTYPE; - -/* @ingroup metadata */ -typedef struct OMX_CONFIG_CONTAINERNODECOUNTTYPE -{ - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_BOOL bAllKeys; - OMX_U32 nParentNodeID; - OMX_U32 nNumNodes; -} OMX_CONFIG_CONTAINERNODECOUNTTYPE; - -/** @ingroup metadata */ -typedef struct OMX_CONFIG_CONTAINERNODEIDTYPE -{ - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_BOOL bAllKeys; - OMX_U32 nParentNodeID; - OMX_U32 nNodeIndex; - OMX_U32 nNodeID; - OMX_STRING cNodeName; - OMX_BOOL bIsLeafType; -} OMX_CONFIG_CONTAINERNODEIDTYPE; - -/** @ingroup metadata */ -typedef struct OMX_PARAM_METADATAFILTERTYPE -{ - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_BOOL bAllKeys; /* if true then this structure refers to all keys and - * the three key fields below are ignored */ - OMX_METADATACHARSETTYPE eKeyCharset; - OMX_U32 nKeySizeUsed; - OMX_U8 nKey [128]; - OMX_U32 nLanguageCountrySizeUsed; - OMX_U8 nLanguageCountry[128]; - OMX_BOOL bEnabled; /* if true then key is part of filter (e.g. - * retained for query later). If false then - * key is not part of filter */ -} OMX_PARAM_METADATAFILTERTYPE; - -/** The OMX_HANDLETYPE structure defines the component handle. The component - * handle is used to access all of the component's public methods and also - * contains pointers to the component's private data area. The component - * handle is initialized by the OMX core (with help from the component) - * during the process of loading the component. After the component is - * successfully loaded, the application can safely access any of the - * component's public functions (although some may return an error because - * the state is inappropriate for the access). - * - * @ingroup comp - */ -typedef struct OMX_COMPONENTTYPE -{ - /** The size of this structure, in bytes. It is the responsibility - of the allocator of this structure to fill in this value. Since - this structure is allocated by the GetHandle function, this - function will fill in this value. */ - OMX_U32 nSize; - - /** nVersion is the version of the OMX specification that the structure - is built against. It is the responsibility of the creator of this - structure to initialize this value and every user of this structure - should verify that it knows how to use the exact version of - this structure found herein. */ - OMX_VERSIONTYPE nVersion; - - /** pComponentPrivate is a pointer to the component private data area. - This member is allocated and initialized by the component when the - component is first loaded. The application should not access this - data area. */ - OMX_PTR pComponentPrivate; - - /** pApplicationPrivate is a pointer that is a parameter to the - OMX_GetHandle method, and contains an application private value - provided by the IL client. This application private data is - returned to the IL Client by OMX in all callbacks */ - OMX_PTR pApplicationPrivate; - - /** refer to OMX_GetComponentVersion in OMX_core.h or the OMX IL - specification for details on the GetComponentVersion method. - */ - OMX_ERRORTYPE (*GetComponentVersion)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_OUT OMX_STRING pComponentName, - OMX_OUT OMX_VERSIONTYPE* pComponentVersion, - OMX_OUT OMX_VERSIONTYPE* pSpecVersion, - OMX_OUT OMX_UUIDTYPE* pComponentUUID); - - /** refer to OMX_SendCommand in OMX_core.h or the OMX IL - specification for details on the SendCommand method. - */ - OMX_ERRORTYPE (*SendCommand)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_COMMANDTYPE Cmd, - OMX_IN OMX_U32 nParam1, - OMX_IN OMX_PTR pCmdData); - - /** refer to OMX_GetParameter in OMX_core.h or the OMX IL - specification for details on the GetParameter method. - */ - OMX_ERRORTYPE (*GetParameter)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_INDEXTYPE nParamIndex, - OMX_INOUT OMX_PTR pComponentParameterStructure); - - - /** refer to OMX_SetParameter in OMX_core.h or the OMX IL - specification for details on the SetParameter method. - */ - OMX_ERRORTYPE (*SetParameter)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_INDEXTYPE nIndex, - OMX_IN OMX_PTR pComponentParameterStructure); - - - /** refer to OMX_GetConfig in OMX_core.h or the OMX IL - specification for details on the GetConfig method. - */ - OMX_ERRORTYPE (*GetConfig)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_INDEXTYPE nIndex, - OMX_INOUT OMX_PTR pComponentConfigStructure); - - - /** refer to OMX_SetConfig in OMX_core.h or the OMX IL - specification for details on the SetConfig method. - */ - OMX_ERRORTYPE (*SetConfig)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_INDEXTYPE nIndex, - OMX_IN OMX_PTR pComponentConfigStructure); - - - /** refer to OMX_GetExtensionIndex in OMX_core.h or the OMX IL - specification for details on the GetExtensionIndex method. - */ - OMX_ERRORTYPE (*GetExtensionIndex)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_STRING cParameterName, - OMX_OUT OMX_INDEXTYPE* pIndexType); - - - /** refer to OMX_GetState in OMX_core.h or the OMX IL - specification for details on the GetState method. - */ - OMX_ERRORTYPE (*GetState)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_OUT OMX_STATETYPE* pState); - - - /** The ComponentTunnelRequest method will interact with another OMX - component to determine if tunneling is possible and to setup the - tunneling. The return codes for this method can be used to - determine if tunneling is not possible, or if tunneling is not - supported. - - Base profile components (i.e. non-interop) do not support this - method and should return OMX_ErrorNotImplemented - - The interop profile component MUST support tunneling to another - interop profile component with a compatible port parameters. - A component may also support proprietary communication. - - If proprietary communication is supported the negotiation of - proprietary communication is done outside of OMX in a vendor - specific way. It is only required that the proper result be - returned and the details of how the setup is done is left - to the component implementation. - - When this method is invoked when nPort in an output port, the - component will: - 1. Populate the pTunnelSetup structure with the output port's - requirements and constraints for the tunnel. - - When this method is invoked when nPort in an input port, the - component will: - 1. Query the necessary parameters from the output port to - determine if the ports are compatible for tunneling - 2. If the ports are compatible, the component should store - the tunnel step provided by the output port - 3. Determine which port (either input or output) is the buffer - supplier, and call OMX_SetParameter on the output port to - indicate this selection. - - The component will return from this call within 5 msec. - - @param [in] hComp - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle method. - @param [in] nPort - nPort is used to select the port on the component to be used - for tunneling. - @param [in] hTunneledComp - Handle of the component to tunnel with. This is the component - handle returned by the call to the OMX_GetHandle method. When - this parameter is 0x0 the component should setup the port for - communication with the application / IL Client. - @param [in] nPortOutput - nPortOutput is used indicate the port the component should - tunnel with. - @param [in] pTunnelSetup - Pointer to the tunnel setup structure. When nPort is an output port - the component should populate the fields of this structure. When - When nPort is an input port the component should review the setup - provided by the component with the output port. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup tun - */ - - OMX_ERRORTYPE (*ComponentTunnelRequest)( - OMX_IN OMX_HANDLETYPE hComp, - OMX_IN OMX_U32 nPort, - OMX_IN OMX_HANDLETYPE hTunneledComp, - OMX_IN OMX_U32 nTunneledPort, - OMX_INOUT OMX_TUNNELSETUPTYPE* pTunnelSetup); - - /** refer to OMX_UseBuffer in OMX_core.h or the OMX IL - specification for details on the UseBuffer method. - @ingroup buf - */ - OMX_ERRORTYPE (*UseBuffer)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr, - OMX_IN OMX_U32 nPortIndex, - OMX_IN OMX_PTR pAppPrivate, - OMX_IN OMX_U32 nSizeBytes, - OMX_IN OMX_U8* pBuffer); - - /** refer to OMX_AllocateBuffer in OMX_core.h or the OMX IL - specification for details on the AllocateBuffer method. - @ingroup buf - */ - OMX_ERRORTYPE (*AllocateBuffer)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_INOUT OMX_BUFFERHEADERTYPE** ppBuffer, - OMX_IN OMX_U32 nPortIndex, - OMX_IN OMX_PTR pAppPrivate, - OMX_IN OMX_U32 nSizeBytes); - - /** refer to OMX_FreeBuffer in OMX_core.h or the OMX IL - specification for details on the FreeBuffer method. - @ingroup buf - */ - OMX_ERRORTYPE (*FreeBuffer)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_U32 nPortIndex, - OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); - - /** refer to OMX_EmptyThisBuffer in OMX_core.h or the OMX IL - specification for details on the EmptyThisBuffer method. - @ingroup buf - */ - OMX_ERRORTYPE (*EmptyThisBuffer)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); - - /** refer to OMX_FillThisBuffer in OMX_core.h or the OMX IL - specification for details on the FillThisBuffer method. - @ingroup buf - */ - OMX_ERRORTYPE (*FillThisBuffer)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); - - /** The SetCallbacks method is used by the core to specify the callback - structure from the application to the component. This is a blocking - call. The component will return from this call within 5 msec. - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the GetHandle function. - @param [in] pCallbacks - pointer to an OMX_CALLBACKTYPE structure used to provide the - callback information to the component - @param [in] pAppData - pointer to an application defined value. It is anticipated that - the application will pass a pointer to a data structure or a "this - pointer" in this area to allow the callback (in the application) - to determine the context of the call - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - */ - OMX_ERRORTYPE (*SetCallbacks)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_CALLBACKTYPE* pCallbacks, - OMX_IN OMX_PTR pAppData); - - /** ComponentDeInit method is used to deinitialize the component - providing a means to free any resources allocated at component - initialization. NOTE: After this call the component handle is - not valid for further use. - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the GetHandle function. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - */ - OMX_ERRORTYPE (*ComponentDeInit)( - OMX_IN OMX_HANDLETYPE hComponent); - - /** @ingroup buf */ - OMX_ERRORTYPE (*UseEGLImage)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr, - OMX_IN OMX_U32 nPortIndex, - OMX_IN OMX_PTR pAppPrivate, - OMX_IN void* eglImage); - - OMX_ERRORTYPE (*ComponentRoleEnum)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_OUT OMX_U8 *cRole, - OMX_IN OMX_U32 nIndex); - -} OMX_COMPONENTTYPE; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ diff --git a/external/android/include/19/frameworks/native/include/media/openmax/OMX_ContentPipe.h b/external/android/include/19/frameworks/native/include/media/openmax/OMX_ContentPipe.h deleted file mode 100644 index ee9e4db..0000000 --- a/external/android/include/19/frameworks/native/include/media/openmax/OMX_ContentPipe.h +++ /dev/null @@ -1,212 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** OMX_ContentPipe.h - OpenMax IL version 1.1.2 - * The OMX_ContentPipe header file contains the definitions used to define - * the public interface for content piples. This header file is intended to - * be used by the component. - */ - -#ifndef OMX_CONTENTPIPE_H -#define OMX_CONTENTPIPE_H - -#ifndef KD_EACCES -/* OpenKODE error codes. CPResult values may be zero (indicating success - or one of the following values) */ -#define KD_EACCES (1) -#define KD_EADDRINUSE (2) -#define KD_EAGAIN (5) -#define KD_EBADF (7) -#define KD_EBUSY (8) -#define KD_ECONNREFUSED (9) -#define KD_ECONNRESET (10) -#define KD_EDEADLK (11) -#define KD_EDESTADDRREQ (12) -#define KD_ERANGE (35) -#define KD_EEXIST (13) -#define KD_EFBIG (14) -#define KD_EHOSTUNREACH (15) -#define KD_EINVAL (17) -#define KD_EIO (18) -#define KD_EISCONN (20) -#define KD_EISDIR (21) -#define KD_EMFILE (22) -#define KD_ENAMETOOLONG (23) -#define KD_ENOENT (24) -#define KD_ENOMEM (25) -#define KD_ENOSPC (26) -#define KD_ENOSYS (27) -#define KD_ENOTCONN (28) -#define KD_EPERM (33) -#define KD_ETIMEDOUT (36) -#define KD_EILSEQ (19) -#endif - -/** Map types from OMX standard types only here so interface is as generic as possible. */ -typedef OMX_U32 CPresult; -typedef char * CPstring; -typedef void * CPhandle; -typedef OMX_U32 CPuint; -typedef OMX_S32 CPint; -typedef char CPbyte; -typedef OMX_BOOL CPbool; - -/** enumeration of origin types used in the CP_PIPETYPE's Seek function - * @ingroup cp - */ -typedef enum CP_ORIGINTYPE { - CP_OriginBegin, - CP_OriginCur, - CP_OriginEnd, - CP_OriginKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - CP_OriginVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - CP_OriginMax = 0X7FFFFFFF -} CP_ORIGINTYPE; - -/** enumeration of contact access types used in the CP_PIPETYPE's Open function - * @ingroup cp - */ -typedef enum CP_ACCESSTYPE { - CP_AccessRead, - CP_AccessWrite, - CP_AccessReadWrite , - CP_AccessKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - CP_AccessVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - CP_AccessMax = 0X7FFFFFFF -} CP_ACCESSTYPE; - -/** enumeration of results returned by the CP_PIPETYPE's CheckAvailableBytes function - * @ingroup cp - */ -typedef enum CP_CHECKBYTESRESULTTYPE -{ - CP_CheckBytesOk, /**< There are at least the request number - of bytes available */ - CP_CheckBytesNotReady, /**< The pipe is still retrieving bytes - and presently lacks sufficient bytes. - Client will be called when they are - sufficient bytes are available. */ - CP_CheckBytesInsufficientBytes , /**< The pipe has retrieved all bytes - but those available are less than those - requested */ - CP_CheckBytesAtEndOfStream, /**< The pipe has reached the end of stream - and no more bytes are available. */ - CP_CheckBytesOutOfBuffers, /**< All read/write buffers are currently in use. */ - CP_CheckBytesKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - CP_CheckBytesVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - CP_CheckBytesMax = 0X7FFFFFFF -} CP_CHECKBYTESRESULTTYPE; - -/** enumeration of content pipe events sent to the client callback. - * @ingroup cp - */ -typedef enum CP_EVENTTYPE{ - CP_BytesAvailable, /** bytes requested in a CheckAvailableBytes call are now available*/ - CP_Overflow, /** enumeration of content pipe events sent to the client callback*/ - CP_PipeDisconnected , /** enumeration of content pipe events sent to the client callback*/ - CP_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - CP_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - CP_EventMax = 0X7FFFFFFF -} CP_EVENTTYPE; - -/** content pipe definition - * @ingroup cp - */ -typedef struct CP_PIPETYPE -{ - /** Open a content stream for reading or writing. */ - CPresult (*Open)( CPhandle* hContent, CPstring szURI, CP_ACCESSTYPE eAccess ); - - /** Close a content stream. */ - CPresult (*Close)( CPhandle hContent ); - - /** Create a content source and open it for writing. */ - CPresult (*Create)( CPhandle *hContent, CPstring szURI ); - - /** Check the that specified number of bytes are available for reading or writing (depending on access type).*/ - CPresult (*CheckAvailableBytes)( CPhandle hContent, CPuint nBytesRequested, CP_CHECKBYTESRESULTTYPE *eResult ); - - /** Seek to certain position in the content relative to the specified origin. */ - CPresult (*SetPosition)( CPhandle hContent, CPint nOffset, CP_ORIGINTYPE eOrigin); - - /** Retrieve the current position relative to the start of the content. */ - CPresult (*GetPosition)( CPhandle hContent, CPuint *pPosition); - - /** Retrieve data of the specified size from the content stream (advance content pointer by size of data). - Note: pipe client provides pointer. This function is appropriate for small high frequency reads. */ - CPresult (*Read)( CPhandle hContent, CPbyte *pData, CPuint nSize); - - /** Retrieve a buffer allocated by the pipe that contains the requested number of bytes. - Buffer contains the next block of bytes, as specified by nSize, of the content. nSize also - returns the size of the block actually read. Content pointer advances the by the returned size. - Note: pipe provides pointer. This function is appropriate for large reads. The client must call - ReleaseReadBuffer when done with buffer. - - In some cases the requested block may not reside in contiguous memory within the - pipe implementation. For instance if the pipe leverages a circular buffer then the requested - block may straddle the boundary of the circular buffer. By default a pipe implementation - performs a copy in this case to provide the block to the pipe client in one contiguous buffer. - If, however, the client sets bForbidCopy, then the pipe returns only those bytes preceding the memory - boundary. Here the client may retrieve the data in segments over successive calls. */ - CPresult (*ReadBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint *nSize, CPbool bForbidCopy); - - /** Release a buffer obtained by ReadBuffer back to the pipe. */ - CPresult (*ReleaseReadBuffer)(CPhandle hContent, CPbyte *pBuffer); - - /** Write data of the specified size to the content (advance content pointer by size of data). - Note: pipe client provides pointer. This function is appropriate for small high frequency writes. */ - CPresult (*Write)( CPhandle hContent, CPbyte *data, CPuint nSize); - - /** Retrieve a buffer allocated by the pipe used to write data to the content. - Client will fill buffer with output data. Note: pipe provides pointer. This function is appropriate - for large writes. The client must call WriteBuffer when done it has filled the buffer with data.*/ - CPresult (*GetWriteBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint nSize); - - /** Deliver a buffer obtained via GetWriteBuffer to the pipe. Pipe will write the - the contents of the buffer to content and advance content pointer by the size of the buffer */ - CPresult (*WriteBuffer)( CPhandle hContent, CPbyte *pBuffer, CPuint nFilledSize); - - /** Register a per-handle client callback with the content pipe. */ - CPresult (*RegisterCallback)( CPhandle hContent, CPresult (*ClientCallback)(CP_EVENTTYPE eEvent, CPuint iParam)); - -} CP_PIPETYPE; - -#endif - diff --git a/external/android/include/19/frameworks/native/include/media/openmax/OMX_Core.h b/external/android/include/19/frameworks/native/include/media/openmax/OMX_Core.h deleted file mode 100644 index 9fb0f6f..0000000 --- a/external/android/include/19/frameworks/native/include/media/openmax/OMX_Core.h +++ /dev/null @@ -1,1448 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** OMX_Core.h - OpenMax IL version 1.1.2 - * The OMX_Core header file contains the definitions used by both the - * application and the component to access common items. - */ - -#ifndef OMX_Core_h -#define OMX_Core_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/* Each OMX header shall include all required header files to allow the - * header to compile without errors. The includes below are required - * for this header file to compile successfully - */ - -#include - - -/** The OMX_COMMANDTYPE enumeration is used to specify the action in the - * OMX_SendCommand macro. - * @ingroup core - */ -typedef enum OMX_COMMANDTYPE -{ - OMX_CommandStateSet, /**< Change the component state */ - OMX_CommandFlush, /**< Flush the data queue(s) of a component */ - OMX_CommandPortDisable, /**< Disable a port on a component. */ - OMX_CommandPortEnable, /**< Enable a port on a component. */ - OMX_CommandMarkBuffer, /**< Mark a component/buffer for observation */ - OMX_CommandKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_CommandVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_CommandMax = 0X7FFFFFFF -} OMX_COMMANDTYPE; - - - -/** The OMX_STATETYPE enumeration is used to indicate or change the component - * state. This enumeration reflects the current state of the component when - * used with the OMX_GetState macro or becomes the parameter in a state change - * command when used with the OMX_SendCommand macro. - * - * The component will be in the Loaded state after the component is initially - * loaded into memory. In the Loaded state, the component is not allowed to - * allocate or hold resources other than to build it's internal parameter - * and configuration tables. The application will send one or more - * SetParameters/GetParameters and SetConfig/GetConfig commands to the - * component and the component will record each of these parameter and - * configuration changes for use later. When the application sends the - * Idle command, the component will acquire the resources needed for the - * specified configuration and will transition to the idle state if the - * allocation is successful. If the component cannot successfully - * transition to the idle state for any reason, the state of the component - * shall be fully rolled back to the Loaded state (e.g. all allocated - * resources shall be released). When the component receives the command - * to go to the Executing state, it shall begin processing buffers by - * sending all input buffers it holds to the application. While - * the component is in the Idle state, the application may also send the - * Pause command. If the component receives the pause command while in the - * Idle state, the component shall send all input buffers it holds to the - * application, but shall not begin processing buffers. This will allow the - * application to prefill buffers. - * - * @ingroup comp - */ - -typedef enum OMX_STATETYPE -{ - OMX_StateInvalid, /**< component has detected that it's internal data - structures are corrupted to the point that - it cannot determine it's state properly */ - OMX_StateLoaded, /**< component has been loaded but has not completed - initialization. The OMX_SetParameter macro - and the OMX_GetParameter macro are the only - valid macros allowed to be sent to the - component in this state. */ - OMX_StateIdle, /**< component initialization has been completed - successfully and the component is ready to - to start. */ - OMX_StateExecuting, /**< component has accepted the start command and - is processing data (if data is available) */ - OMX_StatePause, /**< component has received pause command */ - OMX_StateWaitForResources, /**< component is waiting for resources, either after - preemption or before it gets the resources requested. - See specification for complete details. */ - OMX_StateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_StateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_StateMax = 0X7FFFFFFF -} OMX_STATETYPE; - -/** The OMX_ERRORTYPE enumeration defines the standard OMX Errors. These - * errors should cover most of the common failure cases. However, - * vendors are free to add additional error messages of their own as - * long as they follow these rules: - * 1. Vendor error messages shall be in the range of 0x90000000 to - * 0x9000FFFF. - * 2. Vendor error messages shall be defined in a header file provided - * with the component. No error messages are allowed that are - * not defined. - */ -typedef enum OMX_ERRORTYPE -{ - OMX_ErrorNone = 0, - - /** There were insufficient resources to perform the requested operation */ - OMX_ErrorInsufficientResources = (OMX_S32) 0x80001000, - - /** There was an error, but the cause of the error could not be determined */ - OMX_ErrorUndefined = (OMX_S32) 0x80001001, - - /** The component name string was not valid */ - OMX_ErrorInvalidComponentName = (OMX_S32) 0x80001002, - - /** No component with the specified name string was found */ - OMX_ErrorComponentNotFound = (OMX_S32) 0x80001003, - - /** The component specified did not have a "OMX_ComponentInit" or - "OMX_ComponentDeInit entry point */ - OMX_ErrorInvalidComponent = (OMX_S32) 0x80001004, - - /** One or more parameters were not valid */ - OMX_ErrorBadParameter = (OMX_S32) 0x80001005, - - /** The requested function is not implemented */ - OMX_ErrorNotImplemented = (OMX_S32) 0x80001006, - - /** The buffer was emptied before the next buffer was ready */ - OMX_ErrorUnderflow = (OMX_S32) 0x80001007, - - /** The buffer was not available when it was needed */ - OMX_ErrorOverflow = (OMX_S32) 0x80001008, - - /** The hardware failed to respond as expected */ - OMX_ErrorHardware = (OMX_S32) 0x80001009, - - /** The component is in the state OMX_StateInvalid */ - OMX_ErrorInvalidState = (OMX_S32) 0x8000100A, - - /** Stream is found to be corrupt */ - OMX_ErrorStreamCorrupt = (OMX_S32) 0x8000100B, - - /** Ports being connected are not compatible */ - OMX_ErrorPortsNotCompatible = (OMX_S32) 0x8000100C, - - /** Resources allocated to an idle component have been - lost resulting in the component returning to the loaded state */ - OMX_ErrorResourcesLost = (OMX_S32) 0x8000100D, - - /** No more indicies can be enumerated */ - OMX_ErrorNoMore = (OMX_S32) 0x8000100E, - - /** The component detected a version mismatch */ - OMX_ErrorVersionMismatch = (OMX_S32) 0x8000100F, - - /** The component is not ready to return data at this time */ - OMX_ErrorNotReady = (OMX_S32) 0x80001010, - - /** There was a timeout that occurred */ - OMX_ErrorTimeout = (OMX_S32) 0x80001011, - - /** This error occurs when trying to transition into the state you are already in */ - OMX_ErrorSameState = (OMX_S32) 0x80001012, - - /** Resources allocated to an executing or paused component have been - preempted, causing the component to return to the idle state */ - OMX_ErrorResourcesPreempted = (OMX_S32) 0x80001013, - - /** A non-supplier port sends this error to the IL client (via the EventHandler callback) - during the allocation of buffers (on a transition from the LOADED to the IDLE state or - on a port restart) when it deems that it has waited an unusually long time for the supplier - to send it an allocated buffer via a UseBuffer call. */ - OMX_ErrorPortUnresponsiveDuringAllocation = (OMX_S32) 0x80001014, - - /** A non-supplier port sends this error to the IL client (via the EventHandler callback) - during the deallocation of buffers (on a transition from the IDLE to LOADED state or - on a port stop) when it deems that it has waited an unusually long time for the supplier - to request the deallocation of a buffer header via a FreeBuffer call. */ - OMX_ErrorPortUnresponsiveDuringDeallocation = (OMX_S32) 0x80001015, - - /** A supplier port sends this error to the IL client (via the EventHandler callback) - during the stopping of a port (either on a transition from the IDLE to LOADED - state or a port stop) when it deems that it has waited an unusually long time for - the non-supplier to return a buffer via an EmptyThisBuffer or FillThisBuffer call. */ - OMX_ErrorPortUnresponsiveDuringStop = (OMX_S32) 0x80001016, - - /** Attempting a state transtion that is not allowed */ - OMX_ErrorIncorrectStateTransition = (OMX_S32) 0x80001017, - - /* Attempting a command that is not allowed during the present state. */ - OMX_ErrorIncorrectStateOperation = (OMX_S32) 0x80001018, - - /** The values encapsulated in the parameter or config structure are not supported. */ - OMX_ErrorUnsupportedSetting = (OMX_S32) 0x80001019, - - /** The parameter or config indicated by the given index is not supported. */ - OMX_ErrorUnsupportedIndex = (OMX_S32) 0x8000101A, - - /** The port index supplied is incorrect. */ - OMX_ErrorBadPortIndex = (OMX_S32) 0x8000101B, - - /** The port has lost one or more of its buffers and it thus unpopulated. */ - OMX_ErrorPortUnpopulated = (OMX_S32) 0x8000101C, - - /** Component suspended due to temporary loss of resources */ - OMX_ErrorComponentSuspended = (OMX_S32) 0x8000101D, - - /** Component suspended due to an inability to acquire dynamic resources */ - OMX_ErrorDynamicResourcesUnavailable = (OMX_S32) 0x8000101E, - - /** When the macroblock error reporting is enabled the component returns new error - for every frame that has errors */ - OMX_ErrorMbErrorsInFrame = (OMX_S32) 0x8000101F, - - /** A component reports this error when it cannot parse or determine the format of an input stream. */ - OMX_ErrorFormatNotDetected = (OMX_S32) 0x80001020, - - /** The content open operation failed. */ - OMX_ErrorContentPipeOpenFailed = (OMX_S32) 0x80001021, - - /** The content creation operation failed. */ - OMX_ErrorContentPipeCreationFailed = (OMX_S32) 0x80001022, - - /** Separate table information is being used */ - OMX_ErrorSeperateTablesUsed = (OMX_S32) 0x80001023, - - /** Tunneling is unsupported by the component*/ - OMX_ErrorTunnelingUnsupported = (OMX_S32) 0x80001024, - - OMX_ErrorKhronosExtensions = (OMX_S32)0x8F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_ErrorVendorStartUnused = (OMX_S32)0x90000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_ErrorMax = 0x7FFFFFFF -} OMX_ERRORTYPE; - -/** @ingroup core */ -typedef OMX_ERRORTYPE (* OMX_COMPONENTINITTYPE)(OMX_IN OMX_HANDLETYPE hComponent); - -/** @ingroup core */ -typedef struct OMX_COMPONENTREGISTERTYPE -{ - const char * pName; /* Component name, 128 byte limit (including '\0') applies */ - OMX_COMPONENTINITTYPE pInitialize; /* Component instance initialization function */ -} OMX_COMPONENTREGISTERTYPE; - -/** @ingroup core */ -extern OMX_COMPONENTREGISTERTYPE OMX_ComponentRegistered[]; - -/** @ingroup rpm */ -typedef struct OMX_PRIORITYMGMTTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nGroupPriority; /**< Priority of the component group */ - OMX_U32 nGroupID; /**< ID of the component group */ -} OMX_PRIORITYMGMTTYPE; - -/* Component name and Role names are limited to 128 characters including the terminating '\0'. */ -#define OMX_MAX_STRINGNAME_SIZE 128 - -/** @ingroup comp */ -typedef struct OMX_PARAM_COMPONENTROLETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U8 cRole[OMX_MAX_STRINGNAME_SIZE]; /**< name of standard component which defines component role */ -} OMX_PARAM_COMPONENTROLETYPE; - -/** End of Stream Buffer Flag: - * - * A component sets EOS when it has no more data to emit on a particular - * output port. Thus an output port shall set EOS on the last buffer it - * emits. A component's determination of when an output port should - * cease sending data is implemenation specific. - * @ingroup buf - */ - -#define OMX_BUFFERFLAG_EOS 0x00000001 - -/** Start Time Buffer Flag: - * - * The source of a stream (e.g. a demux component) sets the STARTTIME - * flag on the buffer that contains the starting timestamp for the - * stream. The starting timestamp corresponds to the first data that - * should be displayed at startup or after a seek. - * The first timestamp of the stream is not necessarily the start time. - * For instance, in the case of a seek to a particular video frame, - * the target frame may be an interframe. Thus the first buffer of - * the stream will be the intra-frame preceding the target frame and - * the starttime will occur with the target frame (with any other - * required frames required to reconstruct the target intervening). - * - * The STARTTIME flag is directly associated with the buffer's - * timestamp ' thus its association to buffer data and its - * propagation is identical to the timestamp's. - * - * When a Sync Component client receives a buffer with the - * STARTTIME flag it shall perform a SetConfig on its sync port - * using OMX_ConfigTimeClientStartTime and passing the buffer's - * timestamp. - * - * @ingroup buf - */ - -#define OMX_BUFFERFLAG_STARTTIME 0x00000002 - - - -/** Decode Only Buffer Flag: - * - * The source of a stream (e.g. a demux component) sets the DECODEONLY - * flag on any buffer that should shall be decoded but should not be - * displayed. This flag is used, for instance, when a source seeks to - * a target interframe that requires the decode of frames preceding the - * target to facilitate the target's reconstruction. In this case the - * source would emit the frames preceding the target downstream - * but mark them as decode only. - * - * The DECODEONLY is associated with buffer data and propagated in a - * manner identical to the buffer timestamp. - * - * A component that renders data should ignore all buffers with - * the DECODEONLY flag set. - * - * @ingroup buf - */ - -#define OMX_BUFFERFLAG_DECODEONLY 0x00000004 - - -/* Data Corrupt Flag: This flag is set when the IL client believes the data in the associated buffer is corrupt - * @ingroup buf - */ - -#define OMX_BUFFERFLAG_DATACORRUPT 0x00000008 - -/* End of Frame: The buffer contains exactly one end of frame and no data - * occurs after the end of frame. This flag is an optional hint. The absence - * of this flag does not imply the absence of an end of frame within the buffer. - * @ingroup buf -*/ -#define OMX_BUFFERFLAG_ENDOFFRAME 0x00000010 - -/* Sync Frame Flag: This flag is set when the buffer content contains a coded sync frame ' - * a frame that has no dependency on any other frame information - * @ingroup buf - */ -#define OMX_BUFFERFLAG_SYNCFRAME 0x00000020 - -/* Extra data present flag: there is extra data appended to the data stream - * residing in the buffer - * @ingroup buf - */ -#define OMX_BUFFERFLAG_EXTRADATA 0x00000040 - -/** Codec Config Buffer Flag: -* OMX_BUFFERFLAG_CODECCONFIG is an optional flag that is set by an -* output port when all bytes in the buffer form part or all of a set of -* codec specific configuration data. Examples include SPS/PPS nal units -* for OMX_VIDEO_CodingAVC or AudioSpecificConfig data for -* OMX_AUDIO_CodingAAC. Any component that for a given stream sets -* OMX_BUFFERFLAG_CODECCONFIG shall not mix codec configuration bytes -* with frame data in the same buffer, and shall send all buffers -* containing codec configuration bytes before any buffers containing -* frame data that those configurations bytes describe. -* If the stream format for a particular codec has a frame specific -* header at the start of each frame, for example OMX_AUDIO_CodingMP3 or -* OMX_AUDIO_CodingAAC in ADTS mode, then these shall be presented as -* normal without setting OMX_BUFFERFLAG_CODECCONFIG. - * @ingroup buf - */ -#define OMX_BUFFERFLAG_CODECCONFIG 0x00000080 - - - -/** @ingroup buf */ -typedef struct OMX_BUFFERHEADERTYPE -{ - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U8* pBuffer; /**< Pointer to actual block of memory - that is acting as the buffer */ - OMX_U32 nAllocLen; /**< size of the buffer allocated, in bytes */ - OMX_U32 nFilledLen; /**< number of bytes currently in the - buffer */ - OMX_U32 nOffset; /**< start offset of valid data in bytes from - the start of the buffer */ - OMX_PTR pAppPrivate; /**< pointer to any data the application - wants to associate with this buffer */ - OMX_PTR pPlatformPrivate; /**< pointer to any data the platform - wants to associate with this buffer */ - OMX_PTR pInputPortPrivate; /**< pointer to any data the input port - wants to associate with this buffer */ - OMX_PTR pOutputPortPrivate; /**< pointer to any data the output port - wants to associate with this buffer */ - OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will generate a - mark event upon processing this buffer. */ - OMX_PTR pMarkData; /**< Application specific data associated with - the mark sent on a mark event to disambiguate - this mark from others. */ - OMX_U32 nTickCount; /**< Optional entry that the component and - application can update with a tick count - when they access the component. This - value should be in microseconds. Since - this is a value relative to an arbitrary - starting point, this value cannot be used - to determine absolute time. This is an - optional entry and not all components - will update it.*/ - OMX_TICKS nTimeStamp; /**< Timestamp corresponding to the sample - starting at the first logical sample - boundary in the buffer. Timestamps of - successive samples within the buffer may - be inferred by adding the duration of the - of the preceding buffer to the timestamp - of the preceding buffer.*/ - OMX_U32 nFlags; /**< buffer specific flags */ - OMX_U32 nOutputPortIndex; /**< The index of the output port (if any) using - this buffer */ - OMX_U32 nInputPortIndex; /**< The index of the input port (if any) using - this buffer */ -} OMX_BUFFERHEADERTYPE; - -/** The OMX_EXTRADATATYPE enumeration is used to define the - * possible extra data payload types. - * NB: this enum is binary backwards compatible with the previous - * OMX_EXTRADATA_QUANT define. This should be replaced with - * OMX_ExtraDataQuantization. - */ -typedef enum OMX_EXTRADATATYPE -{ - OMX_ExtraDataNone = 0, /**< Indicates that no more extra data sections follow */ - OMX_ExtraDataQuantization, /**< The data payload contains quantization data */ - OMX_ExtraDataKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_ExtraDataVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_ExtraDataMax = 0x7FFFFFFF -} OMX_EXTRADATATYPE; - - -typedef struct OMX_OTHER_EXTRADATATYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_EXTRADATATYPE eType; /* Extra Data type */ - OMX_U32 nDataSize; /* Size of the supporting data to follow */ - OMX_U8 data[1]; /* Supporting data hint */ -} OMX_OTHER_EXTRADATATYPE; - -/** @ingroup comp */ -typedef struct OMX_PORT_PARAM_TYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPorts; /**< The number of ports for this component */ - OMX_U32 nStartPortNumber; /** first port number for this type of port */ -} OMX_PORT_PARAM_TYPE; - -/** @ingroup comp */ -typedef enum OMX_EVENTTYPE -{ - OMX_EventCmdComplete, /**< component has sucessfully completed a command */ - OMX_EventError, /**< component has detected an error condition */ - OMX_EventMark, /**< component has detected a buffer mark */ - OMX_EventPortSettingsChanged, /**< component is reported a port settings change */ - OMX_EventBufferFlag, /**< component has detected an EOS */ - OMX_EventResourcesAcquired, /**< component has been granted resources and is - automatically starting the state change from - OMX_StateWaitForResources to OMX_StateIdle. */ - OMX_EventComponentResumed, /**< Component resumed due to reacquisition of resources */ - OMX_EventDynamicResourcesAvailable, /**< Component has acquired previously unavailable dynamic resources */ - OMX_EventPortFormatDetected, /**< Component has detected a supported format. */ - OMX_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_EventMax = 0x7FFFFFFF -} OMX_EVENTTYPE; - -typedef struct OMX_CALLBACKTYPE -{ - /** The EventHandler method is used to notify the application when an - event of interest occurs. Events are defined in the OMX_EVENTTYPE - enumeration. Please see that enumeration for details of what will - be returned for each type of event. Callbacks should not return - an error to the component, so if an error occurs, the application - shall handle it internally. This is a blocking call. - - The application should return from this call within 5 msec to avoid - blocking the component for an excessively long period of time. - - @param hComponent - handle of the component to access. This is the component - handle returned by the call to the GetHandle function. - @param pAppData - pointer to an application defined value that was provided in the - pAppData parameter to the OMX_GetHandle method for the component. - This application defined value is provided so that the application - can have a component specific context when receiving the callback. - @param eEvent - Event that the component wants to notify the application about. - @param nData1 - nData will be the OMX_ERRORTYPE for an error event and will be - an OMX_COMMANDTYPE for a command complete event and OMX_INDEXTYPE for a OMX_PortSettingsChanged event. - @param nData2 - nData2 will hold further information related to the event. Can be OMX_STATETYPE for - a OMX_CommandStateSet command or port index for a OMX_PortSettingsChanged event. - Default value is 0 if not used. ) - @param pEventData - Pointer to additional event-specific data (see spec for meaning). - */ - - OMX_ERRORTYPE (*EventHandler)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_PTR pAppData, - OMX_IN OMX_EVENTTYPE eEvent, - OMX_IN OMX_U32 nData1, - OMX_IN OMX_U32 nData2, - OMX_IN OMX_PTR pEventData); - - /** The EmptyBufferDone method is used to return emptied buffers from an - input port back to the application for reuse. This is a blocking call - so the application should not attempt to refill the buffers during this - call, but should queue them and refill them in another thread. There - is no error return, so the application shall handle any errors generated - internally. - - The application should return from this call within 5 msec. - - @param hComponent - handle of the component to access. This is the component - handle returned by the call to the GetHandle function. - @param pAppData - pointer to an application defined value that was provided in the - pAppData parameter to the OMX_GetHandle method for the component. - This application defined value is provided so that the application - can have a component specific context when receiving the callback. - @param pBuffer - pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer - or AllocateBuffer indicating the buffer that was emptied. - @ingroup buf - */ - OMX_ERRORTYPE (*EmptyBufferDone)( - OMX_IN OMX_HANDLETYPE hComponent, - OMX_IN OMX_PTR pAppData, - OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); - - /** The FillBufferDone method is used to return filled buffers from an - output port back to the application for emptying and then reuse. - This is a blocking call so the application should not attempt to - empty the buffers during this call, but should queue the buffers - and empty them in another thread. There is no error return, so - the application shall handle any errors generated internally. The - application shall also update the buffer header to indicate the - number of bytes placed into the buffer. - - The application should return from this call within 5 msec. - - @param hComponent - handle of the component to access. This is the component - handle returned by the call to the GetHandle function. - @param pAppData - pointer to an application defined value that was provided in the - pAppData parameter to the OMX_GetHandle method for the component. - This application defined value is provided so that the application - can have a component specific context when receiving the callback. - @param pBuffer - pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer - or AllocateBuffer indicating the buffer that was filled. - @ingroup buf - */ - OMX_ERRORTYPE (*FillBufferDone)( - OMX_OUT OMX_HANDLETYPE hComponent, - OMX_OUT OMX_PTR pAppData, - OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer); - -} OMX_CALLBACKTYPE; - -/** The OMX_BUFFERSUPPLIERTYPE enumeration is used to dictate port supplier - preference when tunneling between two ports. - @ingroup tun buf -*/ -typedef enum OMX_BUFFERSUPPLIERTYPE -{ - OMX_BufferSupplyUnspecified = 0x0, /**< port supplying the buffers is unspecified, - or don't care */ - OMX_BufferSupplyInput, /**< input port supplies the buffers */ - OMX_BufferSupplyOutput, /**< output port supplies the buffers */ - OMX_BufferSupplyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_BufferSupplyVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_BufferSupplyMax = 0x7FFFFFFF -} OMX_BUFFERSUPPLIERTYPE; - - -/** buffer supplier parameter - * @ingroup tun - */ -typedef struct OMX_PARAM_BUFFERSUPPLIERTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_BUFFERSUPPLIERTYPE eBufferSupplier; /**< buffer supplier */ -} OMX_PARAM_BUFFERSUPPLIERTYPE; - - -/**< indicates that buffers received by an input port of a tunnel - may not modify the data in the buffers - @ingroup tun - */ -#define OMX_PORTTUNNELFLAG_READONLY 0x00000001 - - -/** The OMX_TUNNELSETUPTYPE structure is used to pass data from an output - port to an input port as part the two ComponentTunnelRequest calls - resulting from a OMX_SetupTunnel call from the IL Client. - @ingroup tun - */ -typedef struct OMX_TUNNELSETUPTYPE -{ - OMX_U32 nTunnelFlags; /**< bit flags for tunneling */ - OMX_BUFFERSUPPLIERTYPE eSupplier; /**< supplier preference */ -} OMX_TUNNELSETUPTYPE; - -/* OMX Component headers is included to enable the core to use - macros for functions into the component for OMX release 1.0. - Developers should not access any structures or data from within - the component header directly */ -/* TO BE REMOVED - #include */ - -/** GetComponentVersion will return information about the component. - This is a blocking call. This macro will go directly from the - application to the component (via a core macro). The - component will return from this call within 5 msec. - @param [in] hComponent - handle of component to execute the command - @param [out] pComponentName - pointer to an empty string of length 128 bytes. The component - will write its name into this string. The name will be - terminated by a single zero byte. The name of a component will - be 127 bytes or less to leave room for the trailing zero byte. - An example of a valid component name is "OMX.ABC.ChannelMixer\0". - @param [out] pComponentVersion - pointer to an OMX Version structure that the component will fill - in. The component will fill in a value that indicates the - component version. NOTE: the component version is NOT the same - as the OMX Specification version (found in all structures). The - component version is defined by the vendor of the component and - its value is entirely up to the component vendor. - @param [out] pSpecVersion - pointer to an OMX Version structure that the component will fill - in. The SpecVersion is the version of the specification that the - component was built against. Please note that this value may or - may not match the structure's version. For example, if the - component was built against the 2.0 specification, but the - application (which creates the structure is built against the - 1.0 specification the versions would be different. - @param [out] pComponentUUID - pointer to the UUID of the component which will be filled in by - the component. The UUID is a unique identifier that is set at - RUN time for the component and is unique to each instantion of - the component. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_GetComponentVersion( \ - hComponent, \ - pComponentName, \ - pComponentVersion, \ - pSpecVersion, \ - pComponentUUID) \ - ((OMX_COMPONENTTYPE*)hComponent)->GetComponentVersion( \ - hComponent, \ - pComponentName, \ - pComponentVersion, \ - pSpecVersion, \ - pComponentUUID) /* Macro End */ - - -/** Send a command to the component. This call is a non-blocking call. - The component should check the parameters and then queue the command - to the component thread to be executed. The component thread shall - send the EventHandler() callback at the conclusion of the command. - This macro will go directly from the application to the component (via - a core macro). The component will return from this call within 5 msec. - - When the command is "OMX_CommandStateSet" the component will queue a - state transition to the new state idenfied in nParam. - - When the command is "OMX_CommandFlush", to flush a port's buffer queues, - the command will force the component to return all buffers NOT CURRENTLY - BEING PROCESSED to the application, in the order in which the buffers - were received. - - When the command is "OMX_CommandPortDisable" or - "OMX_CommandPortEnable", the component's port (given by the value of - nParam) will be stopped or restarted. - - When the command "OMX_CommandMarkBuffer" is used to mark a buffer, the - pCmdData will point to a OMX_MARKTYPE structure containing the component - handle of the component to examine the buffer chain for the mark. nParam1 - contains the index of the port on which the buffer mark is applied. - - Specification text for more details. - - @param [in] hComponent - handle of component to execute the command - @param [in] Cmd - Command for the component to execute - @param [in] nParam - Parameter for the command to be executed. When Cmd has the value - OMX_CommandStateSet, value is a member of OMX_STATETYPE. When Cmd has - the value OMX_CommandFlush, value of nParam indicates which port(s) - to flush. -1 is used to flush all ports a single port index will - only flush that port. When Cmd has the value "OMX_CommandPortDisable" - or "OMX_CommandPortEnable", the component's port is given by - the value of nParam. When Cmd has the value "OMX_CommandMarkBuffer" - the components pot is given by the value of nParam. - @param [in] pCmdData - Parameter pointing to the OMX_MARKTYPE structure when Cmd has the value - "OMX_CommandMarkBuffer". - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_SendCommand( \ - hComponent, \ - Cmd, \ - nParam, \ - pCmdData) \ - ((OMX_COMPONENTTYPE*)hComponent)->SendCommand( \ - hComponent, \ - Cmd, \ - nParam, \ - pCmdData) /* Macro End */ - - -/** The OMX_GetParameter macro will get one of the current parameter - settings from the component. This macro cannot only be invoked when - the component is in the OMX_StateInvalid state. The nParamIndex - parameter is used to indicate which structure is being requested from - the component. The application shall allocate the correct structure - and shall fill in the structure size and version information before - invoking this macro. When the parameter applies to a port, the - caller shall fill in the appropriate nPortIndex value indicating the - port on which the parameter applies. If the component has not had - any settings changed, then the component should return a set of - valid DEFAULT parameters for the component. This is a blocking - call. - - The component should return from this call within 20 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] nParamIndex - Index of the structure to be filled. This value is from the - OMX_INDEXTYPE enumeration. - @param [in,out] pComponentParameterStructure - Pointer to application allocated structure to be filled by the - component. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_GetParameter( \ - hComponent, \ - nParamIndex, \ - pComponentParameterStructure) \ - ((OMX_COMPONENTTYPE*)hComponent)->GetParameter( \ - hComponent, \ - nParamIndex, \ - pComponentParameterStructure) /* Macro End */ - - -/** The OMX_SetParameter macro will send an initialization parameter - structure to a component. Each structure shall be sent one at a time, - in a separate invocation of the macro. This macro can only be - invoked when the component is in the OMX_StateLoaded state, or the - port is disabled (when the parameter applies to a port). The - nParamIndex parameter is used to indicate which structure is being - passed to the component. The application shall allocate the - correct structure and shall fill in the structure size and version - information (as well as the actual data) before invoking this macro. - The application is free to dispose of this structure after the call - as the component is required to copy any data it shall retain. This - is a blocking call. - - The component should return from this call within 20 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] nIndex - Index of the structure to be sent. This value is from the - OMX_INDEXTYPE enumeration. - @param [in] pComponentParameterStructure - pointer to application allocated structure to be used for - initialization by the component. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_SetParameter( \ - hComponent, \ - nParamIndex, \ - pComponentParameterStructure) \ - ((OMX_COMPONENTTYPE*)hComponent)->SetParameter( \ - hComponent, \ - nParamIndex, \ - pComponentParameterStructure) /* Macro End */ - - -/** The OMX_GetConfig macro will get one of the configuration structures - from a component. This macro can be invoked anytime after the - component has been loaded. The nParamIndex call parameter is used to - indicate which structure is being requested from the component. The - application shall allocate the correct structure and shall fill in the - structure size and version information before invoking this macro. - If the component has not had this configuration parameter sent before, - then the component should return a set of valid DEFAULT values for the - component. This is a blocking call. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] nIndex - Index of the structure to be filled. This value is from the - OMX_INDEXTYPE enumeration. - @param [in,out] pComponentConfigStructure - pointer to application allocated structure to be filled by the - component. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp -*/ -#define OMX_GetConfig( \ - hComponent, \ - nConfigIndex, \ - pComponentConfigStructure) \ - ((OMX_COMPONENTTYPE*)hComponent)->GetConfig( \ - hComponent, \ - nConfigIndex, \ - pComponentConfigStructure) /* Macro End */ - - -/** The OMX_SetConfig macro will send one of the configuration - structures to a component. Each structure shall be sent one at a time, - each in a separate invocation of the macro. This macro can be invoked - anytime after the component has been loaded. The application shall - allocate the correct structure and shall fill in the structure size - and version information (as well as the actual data) before invoking - this macro. The application is free to dispose of this structure after - the call as the component is required to copy any data it shall retain. - This is a blocking call. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] nConfigIndex - Index of the structure to be sent. This value is from the - OMX_INDEXTYPE enumeration above. - @param [in] pComponentConfigStructure - pointer to application allocated structure to be used for - initialization by the component. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_SetConfig( \ - hComponent, \ - nConfigIndex, \ - pComponentConfigStructure) \ - ((OMX_COMPONENTTYPE*)hComponent)->SetConfig( \ - hComponent, \ - nConfigIndex, \ - pComponentConfigStructure) /* Macro End */ - - -/** The OMX_GetExtensionIndex macro will invoke a component to translate - a vendor specific configuration or parameter string into an OMX - structure index. There is no requirement for the vendor to support - this command for the indexes already found in the OMX_INDEXTYPE - enumeration (this is done to save space in small components). The - component shall support all vendor supplied extension indexes not found - in the master OMX_INDEXTYPE enumeration. This is a blocking call. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the GetHandle function. - @param [in] cParameterName - OMX_STRING that shall be less than 128 characters long including - the trailing null byte. This is the string that will get - translated by the component into a configuration index. - @param [out] pIndexType - a pointer to a OMX_INDEXTYPE to receive the index value. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_GetExtensionIndex( \ - hComponent, \ - cParameterName, \ - pIndexType) \ - ((OMX_COMPONENTTYPE*)hComponent)->GetExtensionIndex( \ - hComponent, \ - cParameterName, \ - pIndexType) /* Macro End */ - - -/** The OMX_GetState macro will invoke the component to get the current - state of the component and place the state value into the location - pointed to by pState. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [out] pState - pointer to the location to receive the state. The value returned - is one of the OMX_STATETYPE members - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp - */ -#define OMX_GetState( \ - hComponent, \ - pState) \ - ((OMX_COMPONENTTYPE*)hComponent)->GetState( \ - hComponent, \ - pState) /* Macro End */ - - -/** The OMX_UseBuffer macro will request that the component use - a buffer (and allocate its own buffer header) already allocated - by another component, or by the IL Client. This is a blocking - call. - - The component should return from this call within 20 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [out] ppBuffer - pointer to an OMX_BUFFERHEADERTYPE structure used to receive the - pointer to the buffer header - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp buf - */ - -#define OMX_UseBuffer( \ - hComponent, \ - ppBufferHdr, \ - nPortIndex, \ - pAppPrivate, \ - nSizeBytes, \ - pBuffer) \ - ((OMX_COMPONENTTYPE*)hComponent)->UseBuffer( \ - hComponent, \ - ppBufferHdr, \ - nPortIndex, \ - pAppPrivate, \ - nSizeBytes, \ - pBuffer) - - -/** The OMX_AllocateBuffer macro will request that the component allocate - a new buffer and buffer header. The component will allocate the - buffer and the buffer header and return a pointer to the buffer - header. This is a blocking call. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [out] ppBuffer - pointer to an OMX_BUFFERHEADERTYPE structure used to receive - the pointer to the buffer header - @param [in] nPortIndex - nPortIndex is used to select the port on the component the buffer will - be used with. The port can be found by using the nPortIndex - value as an index into the Port Definition array of the component. - @param [in] pAppPrivate - pAppPrivate is used to initialize the pAppPrivate member of the - buffer header structure. - @param [in] nSizeBytes - size of the buffer to allocate. Used when bAllocateNew is true. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp buf - */ -#define OMX_AllocateBuffer( \ - hComponent, \ - ppBuffer, \ - nPortIndex, \ - pAppPrivate, \ - nSizeBytes) \ - ((OMX_COMPONENTTYPE*)hComponent)->AllocateBuffer( \ - hComponent, \ - ppBuffer, \ - nPortIndex, \ - pAppPrivate, \ - nSizeBytes) /* Macro End */ - - -/** The OMX_FreeBuffer macro will release a buffer header from the component - which was allocated using either OMX_AllocateBuffer or OMX_UseBuffer. If - the component allocated the buffer (see the OMX_UseBuffer macro) then - the component shall free the buffer and buffer header. This is a - blocking call. - - The component should return from this call within 20 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] nPortIndex - nPortIndex is used to select the port on the component the buffer will - be used with. - @param [in] pBuffer - pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer - or AllocateBuffer. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp buf - */ -#define OMX_FreeBuffer( \ - hComponent, \ - nPortIndex, \ - pBuffer) \ - ((OMX_COMPONENTTYPE*)hComponent)->FreeBuffer( \ - hComponent, \ - nPortIndex, \ - pBuffer) /* Macro End */ - - -/** The OMX_EmptyThisBuffer macro will send a buffer full of data to an - input port of a component. The buffer will be emptied by the component - and returned to the application via the EmptyBufferDone call back. - This is a non-blocking call in that the component will record the buffer - and return immediately and then empty the buffer, later, at the proper - time. As expected, this macro may be invoked only while the component - is in the OMX_StateExecuting. If nPortIndex does not specify an input - port, the component shall return an error. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] pBuffer - pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer - or AllocateBuffer. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp buf - */ -#define OMX_EmptyThisBuffer( \ - hComponent, \ - pBuffer) \ - ((OMX_COMPONENTTYPE*)hComponent)->EmptyThisBuffer( \ - hComponent, \ - pBuffer) /* Macro End */ - - -/** The OMX_FillThisBuffer macro will send an empty buffer to an - output port of a component. The buffer will be filled by the component - and returned to the application via the FillBufferDone call back. - This is a non-blocking call in that the component will record the buffer - and return immediately and then fill the buffer, later, at the proper - time. As expected, this macro may be invoked only while the component - is in the OMX_ExecutingState. If nPortIndex does not specify an output - port, the component shall return an error. - - The component should return from this call within 5 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [in] pBuffer - pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer - or AllocateBuffer. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp buf - */ -#define OMX_FillThisBuffer( \ - hComponent, \ - pBuffer) \ - ((OMX_COMPONENTTYPE*)hComponent)->FillThisBuffer( \ - hComponent, \ - pBuffer) /* Macro End */ - - - -/** The OMX_UseEGLImage macro will request that the component use - a EGLImage provided by EGL (and allocate its own buffer header) - This is a blocking call. - - The component should return from this call within 20 msec. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the OMX_GetHandle function. - @param [out] ppBuffer - pointer to an OMX_BUFFERHEADERTYPE structure used to receive the - pointer to the buffer header. Note that the memory location used - for this buffer is NOT visible to the IL Client. - @param [in] nPortIndex - nPortIndex is used to select the port on the component the buffer will - be used with. The port can be found by using the nPortIndex - value as an index into the Port Definition array of the component. - @param [in] pAppPrivate - pAppPrivate is used to initialize the pAppPrivate member of the - buffer header structure. - @param [in] eglImage - eglImage contains the handle of the EGLImage to use as a buffer on the - specified port. The component is expected to validate properties of - the EGLImage against the configuration of the port to ensure the component - can use the EGLImage as a buffer. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup comp buf - */ -#define OMX_UseEGLImage( \ - hComponent, \ - ppBufferHdr, \ - nPortIndex, \ - pAppPrivate, \ - eglImage) \ - ((OMX_COMPONENTTYPE*)hComponent)->UseEGLImage( \ - hComponent, \ - ppBufferHdr, \ - nPortIndex, \ - pAppPrivate, \ - eglImage) - -/** The OMX_Init method is used to initialize the OMX core. It shall be the - first call made into OMX and it should only be executed one time without - an interviening OMX_Deinit call. - - The core should return from this call within 20 msec. - - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Init(void); - - -/** The OMX_Deinit method is used to deinitialize the OMX core. It shall be - the last call made into OMX. In the event that the core determines that - thare are components loaded when this call is made, the core may return - with an error rather than try to unload the components. - - The core should return from this call within 20 msec. - - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Deinit(void); - - -/** The OMX_ComponentNameEnum method will enumerate through all the names of - recognised valid components in the system. This function is provided - as a means to detect all the components in the system run-time. There is - no strict ordering to the enumeration order of component names, although - each name will only be enumerated once. If the OMX core supports run-time - installation of new components, it is only requried to detect newly - installed components when the first call to enumerate component names - is made (i.e. when nIndex is 0x0). - - The core should return from this call in 20 msec. - - @param [out] cComponentName - pointer to a null terminated string with the component name. The - names of the components are strings less than 127 bytes in length - plus the trailing null for a maximum size of 128 bytes. An example - of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are - assigned by the vendor, but shall start with "OMX." and then have - the Vendor designation next. - @param [in] nNameLength - number of characters in the cComponentName string. With all - component name strings restricted to less than 128 characters - (including the trailing null) it is recomended that the caller - provide a input string for the cComponentName of 128 characters. - @param [in] nIndex - number containing the enumeration index for the component. - Multiple calls to OMX_ComponentNameEnum with increasing values - of nIndex will enumerate through the component names in the - system until OMX_ErrorNoMore is returned. The value of nIndex - is 0 to (N-1), where N is the number of valid installed components - in the system. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. When the value of nIndex exceeds the number of - components in the system minus 1, OMX_ErrorNoMore will be - returned. Otherwise the appropriate OMX error will be returned. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_ComponentNameEnum( - OMX_OUT OMX_STRING cComponentName, - OMX_IN OMX_U32 nNameLength, - OMX_IN OMX_U32 nIndex); - - -/** The OMX_GetHandle method will locate the component specified by the - component name given, load that component into memory and then invoke - the component's methods to create an instance of the component. - - The core should return from this call within 20 msec. - - @param [out] pHandle - pointer to an OMX_HANDLETYPE pointer to be filled in by this method. - @param [in] cComponentName - pointer to a null terminated string with the component name. The - names of the components are strings less than 127 bytes in length - plus the trailing null for a maximum size of 128 bytes. An example - of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are - assigned by the vendor, but shall start with "OMX." and then have - the Vendor designation next. - @param [in] pAppData - pointer to an application defined value that will be returned - during callbacks so that the application can identify the source - of the callback. - @param [in] pCallBacks - pointer to a OMX_CALLBACKTYPE structure that will be passed to the - component to initialize it with. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_GetHandle( - OMX_OUT OMX_HANDLETYPE* pHandle, - OMX_IN OMX_STRING cComponentName, - OMX_IN OMX_PTR pAppData, - OMX_IN OMX_CALLBACKTYPE* pCallBacks); - - -/** The OMX_FreeHandle method will free a handle allocated by the OMX_GetHandle - method. If the component reference count goes to zero, the component will - be unloaded from memory. - - The core should return from this call within 20 msec when the component is - in the OMX_StateLoaded state. - - @param [in] hComponent - Handle of the component to be accessed. This is the component - handle returned by the call to the GetHandle function. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_FreeHandle( - OMX_IN OMX_HANDLETYPE hComponent); - - - -/** The OMX_SetupTunnel method will handle the necessary calls to the components - to setup the specified tunnel the two components. NOTE: This is - an actual method (not a #define macro). This method will make calls into - the component ComponentTunnelRequest method to do the actual tunnel - connection. - - The ComponentTunnelRequest method on both components will be called. - This method shall not be called unless the component is in the - OMX_StateLoaded state except when the ports used for the tunnel are - disabled. In this case, the component may be in the OMX_StateExecuting, - OMX_StatePause, or OMX_StateIdle states. - - The core should return from this call within 20 msec. - - @param [in] hOutput - Handle of the component to be accessed. Also this is the handle - of the component whose port, specified in the nPortOutput parameter - will be used the source for the tunnel. This is the component handle - returned by the call to the OMX_GetHandle function. There is a - requirement that hOutput be the source for the data when - tunelling (i.e. nPortOutput is an output port). If 0x0, the component - specified in hInput will have it's port specified in nPortInput - setup for communication with the application / IL client. - @param [in] nPortOutput - nPortOutput is used to select the source port on component to be - used in the tunnel. - @param [in] hInput - This is the component to setup the tunnel with. This is the handle - of the component whose port, specified in the nPortInput parameter - will be used the destination for the tunnel. This is the component handle - returned by the call to the OMX_GetHandle function. There is a - requirement that hInput be the destination for the data when - tunelling (i.e. nPortInut is an input port). If 0x0, the component - specified in hOutput will have it's port specified in nPortPOutput - setup for communication with the application / IL client. - @param [in] nPortInput - nPortInput is used to select the destination port on component to be - used in the tunnel. - @return OMX_ERRORTYPE - If the command successfully executes, the return code will be - OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. - When OMX_ErrorNotImplemented is returned, one or both components is - a non-interop component and does not support tunneling. - - On failure, the ports of both components are setup for communication - with the application / IL Client. - @ingroup core tun - */ -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_SetupTunnel( - OMX_IN OMX_HANDLETYPE hOutput, - OMX_IN OMX_U32 nPortOutput, - OMX_IN OMX_HANDLETYPE hInput, - OMX_IN OMX_U32 nPortInput); - -/** @ingroup cp */ -OMX_API OMX_ERRORTYPE OMX_GetContentPipe( - OMX_OUT OMX_HANDLETYPE *hPipe, - OMX_IN OMX_STRING szURI); - -/** The OMX_GetComponentsOfRole method will return the number of components that support the given - role and (if the compNames field is non-NULL) the names of those components. The call will fail if - an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the - client should: - * first call this function with the compNames field NULL to determine the number of component names - * second call this function with the compNames field pointing to an array of names allocated - according to the number returned by the first call. - - The core should return from this call within 5 msec. - - @param [in] role - This is generic standard component name consisting only of component class - name and the type within that class (e.g. 'audio_decoder.aac'). - @param [inout] pNumComps - This is used both as input and output. - - If compNames is NULL, the input is ignored and the output specifies how many components support - the given role. - - If compNames is not NULL, on input it bounds the size of the input structure and - on output, it specifies the number of components string names listed within the compNames parameter. - @param [inout] compNames - If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings which accepts - a list of the names of all physical components that implement the specified standard component name. - Each name is NULL terminated. numComps indicates the number of names. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_GetComponentsOfRole ( - OMX_IN OMX_STRING role, - OMX_INOUT OMX_U32 *pNumComps, - OMX_INOUT OMX_U8 **compNames); - -/** The OMX_GetRolesOfComponent method will return the number of roles supported by the given - component and (if the roles field is non-NULL) the names of those roles. The call will fail if - an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the - client should: - * first call this function with the roles field NULL to determine the number of role names - * second call this function with the roles field pointing to an array of names allocated - according to the number returned by the first call. - - The core should return from this call within 5 msec. - - @param [in] compName - This is the name of the component being queried about. - @param [inout] pNumRoles - This is used both as input and output. - - If roles is NULL, the input is ignored and the output specifies how many roles the component supports. - - If compNames is not NULL, on input it bounds the size of the input structure and - on output, it specifies the number of roles string names listed within the roles parameter. - @param [out] roles - If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings - which accepts a list of the names of all standard components roles implemented on the - specified component name. numComps indicates the number of names. - @ingroup core - */ -OMX_API OMX_ERRORTYPE OMX_GetRolesOfComponent ( - OMX_IN OMX_STRING compName, - OMX_INOUT OMX_U32 *pNumRoles, - OMX_OUT OMX_U8 **roles); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ - diff --git a/external/android/include/19/frameworks/native/include/media/openmax/OMX_IVCommon.h b/external/android/include/19/frameworks/native/include/media/openmax/OMX_IVCommon.h deleted file mode 100644 index 96a4396..0000000 --- a/external/android/include/19/frameworks/native/include/media/openmax/OMX_IVCommon.h +++ /dev/null @@ -1,950 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/** - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** - * @file OMX_IVCommon.h - OpenMax IL version 1.1.2 - * The structures needed by Video and Image components to exchange - * parameters and configuration data with the components. - */ -#ifndef OMX_IVCommon_h -#define OMX_IVCommon_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/** - * Each OMX header must include all required header files to allow the header - * to compile without errors. The includes below are required for this header - * file to compile successfully - */ - -#include - -/** @defgroup iv OpenMAX IL Imaging and Video Domain - * Common structures for OpenMAX IL Imaging and Video domains - * @{ - */ - - -/** - * Enumeration defining possible uncompressed image/video formats. - * - * ENUMS: - * Unused : Placeholder value when format is N/A - * Monochrome : black and white - * 8bitRGB332 : Red 7:5, Green 4:2, Blue 1:0 - * 12bitRGB444 : Red 11:8, Green 7:4, Blue 3:0 - * 16bitARGB4444 : Alpha 15:12, Red 11:8, Green 7:4, Blue 3:0 - * 16bitARGB1555 : Alpha 15, Red 14:10, Green 9:5, Blue 4:0 - * 16bitRGB565 : Red 15:11, Green 10:5, Blue 4:0 - * 16bitBGR565 : Blue 15:11, Green 10:5, Red 4:0 - * 18bitRGB666 : Red 17:12, Green 11:6, Blue 5:0 - * 18bitARGB1665 : Alpha 17, Red 16:11, Green 10:5, Blue 4:0 - * 19bitARGB1666 : Alpha 18, Red 17:12, Green 11:6, Blue 5:0 - * 24bitRGB888 : Red 24:16, Green 15:8, Blue 7:0 - * 24bitBGR888 : Blue 24:16, Green 15:8, Red 7:0 - * 24bitARGB1887 : Alpha 23, Red 22:15, Green 14:7, Blue 6:0 - * 25bitARGB1888 : Alpha 24, Red 23:16, Green 15:8, Blue 7:0 - * 32bitBGRA8888 : Blue 31:24, Green 23:16, Red 15:8, Alpha 7:0 - * 32bitARGB8888 : Alpha 31:24, Red 23:16, Green 15:8, Blue 7:0 - * YUV411Planar : U,Y are subsampled by a factor of 4 horizontally - * YUV411PackedPlanar : packed per payload in planar slices - * YUV420Planar : Three arrays Y,U,V. - * YUV420PackedPlanar : packed per payload in planar slices - * YUV420SemiPlanar : Two arrays, one is all Y, the other is U and V - * YUV422Planar : Three arrays Y,U,V. - * YUV422PackedPlanar : packed per payload in planar slices - * YUV422SemiPlanar : Two arrays, one is all Y, the other is U and V - * YCbYCr : Organized as 16bit YUYV (i.e. YCbYCr) - * YCrYCb : Organized as 16bit YVYU (i.e. YCrYCb) - * CbYCrY : Organized as 16bit UYVY (i.e. CbYCrY) - * CrYCbY : Organized as 16bit VYUY (i.e. CrYCbY) - * YUV444Interleaved : Each pixel contains equal parts YUV - * RawBayer8bit : SMIA camera output format - * RawBayer10bit : SMIA camera output format - * RawBayer8bitcompressed : SMIA camera output format - */ -typedef enum OMX_COLOR_FORMATTYPE { - OMX_COLOR_FormatUnused, - OMX_COLOR_FormatMonochrome, - OMX_COLOR_Format8bitRGB332, - OMX_COLOR_Format12bitRGB444, - OMX_COLOR_Format16bitARGB4444, - OMX_COLOR_Format16bitARGB1555, - OMX_COLOR_Format16bitRGB565, - OMX_COLOR_Format16bitBGR565, - OMX_COLOR_Format18bitRGB666, - OMX_COLOR_Format18bitARGB1665, - OMX_COLOR_Format19bitARGB1666, - OMX_COLOR_Format24bitRGB888, - OMX_COLOR_Format24bitBGR888, - OMX_COLOR_Format24bitARGB1887, - OMX_COLOR_Format25bitARGB1888, - OMX_COLOR_Format32bitBGRA8888, - OMX_COLOR_Format32bitARGB8888, - OMX_COLOR_FormatYUV411Planar, - OMX_COLOR_FormatYUV411PackedPlanar, - OMX_COLOR_FormatYUV420Planar, - OMX_COLOR_FormatYUV420PackedPlanar, - OMX_COLOR_FormatYUV420SemiPlanar, - OMX_COLOR_FormatYUV422Planar, - OMX_COLOR_FormatYUV422PackedPlanar, - OMX_COLOR_FormatYUV422SemiPlanar, - OMX_COLOR_FormatYCbYCr, - OMX_COLOR_FormatYCrYCb, - OMX_COLOR_FormatCbYCrY, - OMX_COLOR_FormatCrYCbY, - OMX_COLOR_FormatYUV444Interleaved, - OMX_COLOR_FormatRawBayer8bit, - OMX_COLOR_FormatRawBayer10bit, - OMX_COLOR_FormatRawBayer8bitcompressed, - OMX_COLOR_FormatL2, - OMX_COLOR_FormatL4, - OMX_COLOR_FormatL8, - OMX_COLOR_FormatL16, - OMX_COLOR_FormatL24, - OMX_COLOR_FormatL32, - OMX_COLOR_FormatYUV420PackedSemiPlanar, - OMX_COLOR_FormatYUV422PackedSemiPlanar, - OMX_COLOR_Format18BitBGR666, - OMX_COLOR_Format24BitARGB6666, - OMX_COLOR_Format24BitABGR6666, - OMX_COLOR_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_COLOR_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - /** - -/** @defgroup imaging OpenMAX IL Imaging Domain - * @ingroup iv - * Structures for OpenMAX IL Imaging domain - * @{ - */ - -/** - * Enumeration used to define the possible image compression coding. - */ -typedef enum OMX_IMAGE_CODINGTYPE { - OMX_IMAGE_CodingUnused, /**< Value when format is N/A */ - OMX_IMAGE_CodingAutoDetect, /**< Auto detection of image format */ - OMX_IMAGE_CodingJPEG, /**< JPEG/JFIF image format */ - OMX_IMAGE_CodingJPEG2K, /**< JPEG 2000 image format */ - OMX_IMAGE_CodingEXIF, /**< EXIF image format */ - OMX_IMAGE_CodingTIFF, /**< TIFF image format */ - OMX_IMAGE_CodingGIF, /**< Graphics image format */ - OMX_IMAGE_CodingPNG, /**< PNG image format */ - OMX_IMAGE_CodingLZW, /**< LZW image format */ - OMX_IMAGE_CodingBMP, /**< Windows Bitmap format */ - OMX_IMAGE_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_IMAGE_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_IMAGE_CodingMax = 0x7FFFFFFF -} OMX_IMAGE_CODINGTYPE; - - -/** - * Data structure used to define an image path. The number of image paths - * for input and output will vary by type of the image component. - * - * Input (aka Source) : Zero Inputs, one Output, - * Splitter : One Input, 2 or more Outputs, - * Processing Element : One Input, one output, - * Mixer : 2 or more inputs, one output, - * Output (aka Sink) : One Input, zero outputs. - * - * The PortDefinition structure is used to define all of the parameters - * necessary for the compliant component to setup an input or an output - * image path. If additional vendor specific data is required, it should - * be transmitted to the component using the CustomCommand function. - * Compliant components will prepopulate this structure with optimal - * values during the OMX_GetParameter() command. - * - * STRUCT MEMBERS: - * cMIMEType : MIME type of data for the port - * pNativeRender : Platform specific reference for a display if a - * sync, otherwise this field is 0 - * nFrameWidth : Width of frame to be used on port if - * uncompressed format is used. Use 0 for - * unknown, don't care or variable - * nFrameHeight : Height of frame to be used on port if - * uncompressed format is used. Use 0 for - * unknown, don't care or variable - * nStride : Number of bytes per span of an image (i.e. - * indicates the number of bytes to get from - * span N to span N+1, where negative stride - * indicates the image is bottom up - * nSliceHeight : Height used when encoding in slices - * bFlagErrorConcealment : Turns on error concealment if it is supported by - * the OMX component - * eCompressionFormat : Compression format used in this instance of - * the component. When OMX_IMAGE_CodingUnused is - * specified, eColorFormat is valid - * eColorFormat : Decompressed format used by this component - * pNativeWindow : Platform specific reference for a window object if a - * display sink , otherwise this field is 0x0. - */ -typedef struct OMX_IMAGE_PORTDEFINITIONTYPE { - OMX_STRING cMIMEType; - OMX_NATIVE_DEVICETYPE pNativeRender; - OMX_U32 nFrameWidth; - OMX_U32 nFrameHeight; - OMX_S32 nStride; - OMX_U32 nSliceHeight; - OMX_BOOL bFlagErrorConcealment; - OMX_IMAGE_CODINGTYPE eCompressionFormat; - OMX_COLOR_FORMATTYPE eColorFormat; - OMX_NATIVE_WINDOWTYPE pNativeWindow; -} OMX_IMAGE_PORTDEFINITIONTYPE; - - -/** - * Port format parameter. This structure is used to enumerate the various - * data input/output format supported by the port. - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Indicates which port to set - * nIndex : Indicates the enumeration index for the format from - * 0x0 to N-1 - * eCompressionFormat : Compression format used in this instance of the - * component. When OMX_IMAGE_CodingUnused is specified, - * eColorFormat is valid - * eColorFormat : Decompressed format used by this component - */ -typedef struct OMX_IMAGE_PARAM_PORTFORMATTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nIndex; - OMX_IMAGE_CODINGTYPE eCompressionFormat; - OMX_COLOR_FORMATTYPE eColorFormat; -} OMX_IMAGE_PARAM_PORTFORMATTYPE; - - -/** - * Flash control type - * - * ENUMS - * Torch : Flash forced constantly on - */ -typedef enum OMX_IMAGE_FLASHCONTROLTYPE { - OMX_IMAGE_FlashControlOn = 0, - OMX_IMAGE_FlashControlOff, - OMX_IMAGE_FlashControlAuto, - OMX_IMAGE_FlashControlRedEyeReduction, - OMX_IMAGE_FlashControlFillin, - OMX_IMAGE_FlashControlTorch, - OMX_IMAGE_FlashControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_IMAGE_FlashControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_IMAGE_FlashControlMax = 0x7FFFFFFF -} OMX_IMAGE_FLASHCONTROLTYPE; - - -/** - * Flash control configuration - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eFlashControl : Flash control type - */ -typedef struct OMX_IMAGE_PARAM_FLASHCONTROLTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_IMAGE_FLASHCONTROLTYPE eFlashControl; -} OMX_IMAGE_PARAM_FLASHCONTROLTYPE; - - -/** - * Focus control type - */ -typedef enum OMX_IMAGE_FOCUSCONTROLTYPE { - OMX_IMAGE_FocusControlOn = 0, - OMX_IMAGE_FocusControlOff, - OMX_IMAGE_FocusControlAuto, - OMX_IMAGE_FocusControlAutoLock, - OMX_IMAGE_FocusControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_IMAGE_FocusControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_IMAGE_FocusControlMax = 0x7FFFFFFF -} OMX_IMAGE_FOCUSCONTROLTYPE; - - -/** - * Focus control configuration - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eFocusControl : Focus control - * nFocusSteps : Focus can take on values from 0 mm to infinity. - * Interest is only in number of steps over this range. - * nFocusStepIndex : Current focus step index - */ -typedef struct OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_IMAGE_FOCUSCONTROLTYPE eFocusControl; - OMX_U32 nFocusSteps; - OMX_U32 nFocusStepIndex; -} OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE; - - -/** - * Q Factor for JPEG compression, which controls the tradeoff between image - * quality and size. Q Factor provides a more simple means of controlling - * JPEG compression quality, without directly programming Quantization - * tables for chroma and luma - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nQFactor : JPEG Q factor value in the range of 1-100. A factor of 1 - * produces the smallest, worst quality images, and a factor - * of 100 produces the largest, best quality images. A - * typical default is 75 for small good quality images - */ -typedef struct OMX_IMAGE_PARAM_QFACTORTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nQFactor; -} OMX_IMAGE_PARAM_QFACTORTYPE; - -/** - * Quantization table type - */ - -typedef enum OMX_IMAGE_QUANTIZATIONTABLETYPE { - OMX_IMAGE_QuantizationTableLuma = 0, - OMX_IMAGE_QuantizationTableChroma, - OMX_IMAGE_QuantizationTableChromaCb, - OMX_IMAGE_QuantizationTableChromaCr, - OMX_IMAGE_QuantizationTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_IMAGE_QuantizationTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_IMAGE_QuantizationTableMax = 0x7FFFFFFF -} OMX_IMAGE_QUANTIZATIONTABLETYPE; - -/** - * JPEG quantization tables are used to determine DCT compression for - * YUV data, as an alternative to specifying Q factor, providing exact - * control of compression - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eQuantizationTable : Quantization table type - * nQuantizationMatrix[64] : JPEG quantization table of coefficients stored - * in increasing columns then by rows of data (i.e. - * row 1, ... row 8). Quantization values are in - * the range 0-255 and stored in linear order - * (i.e. the component will zig-zag the - * quantization table data if required internally) - */ -typedef struct OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_IMAGE_QUANTIZATIONTABLETYPE eQuantizationTable; - OMX_U8 nQuantizationMatrix[64]; -} OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE; - - -/** - * Huffman table type, the same Huffman table is applied for chroma and - * luma component - */ -typedef enum OMX_IMAGE_HUFFMANTABLETYPE { - OMX_IMAGE_HuffmanTableAC = 0, - OMX_IMAGE_HuffmanTableDC, - OMX_IMAGE_HuffmanTableACLuma, - OMX_IMAGE_HuffmanTableACChroma, - OMX_IMAGE_HuffmanTableDCLuma, - OMX_IMAGE_HuffmanTableDCChroma, - OMX_IMAGE_HuffmanTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_IMAGE_HuffmanTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_IMAGE_HuffmanTableMax = 0x7FFFFFFF -} OMX_IMAGE_HUFFMANTABLETYPE; - -/** - * JPEG Huffman table - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eHuffmanTable : Huffman table type - * nNumberOfHuffmanCodeOfLength[16] : 0-16, number of Huffman codes of each - * possible length - * nHuffmanTable[256] : 0-255, the size used for AC and DC - * HuffmanTable are 16 and 162 - */ -typedef struct OMX_IMAGE_PARAM_HUFFMANTTABLETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_IMAGE_HUFFMANTABLETYPE eHuffmanTable; - OMX_U8 nNumberOfHuffmanCodeOfLength[16]; - OMX_U8 nHuffmanTable[256]; -}OMX_IMAGE_PARAM_HUFFMANTTABLETYPE; - -/** @} */ -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ diff --git a/external/android/include/19/frameworks/native/include/media/openmax/OMX_Index.h b/external/android/include/19/frameworks/native/include/media/openmax/OMX_Index.h deleted file mode 100644 index be9a1a6..0000000 --- a/external/android/include/19/frameworks/native/include/media/openmax/OMX_Index.h +++ /dev/null @@ -1,276 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** @file OMX_Index.h - OpenMax IL version 1.1.2 - * The OMX_Index header file contains the definitions for both applications - * and components . - */ - - -#ifndef OMX_Index_h -#define OMX_Index_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/* Each OMX header must include all required header files to allow the - * header to compile without errors. The includes below are required - * for this header file to compile successfully - */ -#include - - -/** The OMX_INDEXTYPE enumeration is used to select a structure when either - * getting or setting parameters and/or configuration data. Each entry in - * this enumeration maps to an OMX specified structure. When the - * OMX_GetParameter, OMX_SetParameter, OMX_GetConfig or OMX_SetConfig methods - * are used, the second parameter will always be an entry from this enumeration - * and the third entry will be the structure shown in the comments for the entry. - * For example, if the application is initializing a cropping function, the - * OMX_SetConfig command would have OMX_IndexConfigCommonInputCrop as the second parameter - * and would send a pointer to an initialized OMX_RECTTYPE structure as the - * third parameter. - * - * The enumeration entries named with the OMX_Config prefix are sent using - * the OMX_SetConfig command and the enumeration entries named with the - * OMX_PARAM_ prefix are sent using the OMX_SetParameter command. - */ -typedef enum OMX_INDEXTYPE { - - OMX_IndexComponentStartUnused = 0x01000000, - OMX_IndexParamPriorityMgmt, /**< reference: OMX_PRIORITYMGMTTYPE */ - OMX_IndexParamAudioInit, /**< reference: OMX_PORT_PARAM_TYPE */ - OMX_IndexParamImageInit, /**< reference: OMX_PORT_PARAM_TYPE */ - OMX_IndexParamVideoInit, /**< reference: OMX_PORT_PARAM_TYPE */ - OMX_IndexParamOtherInit, /**< reference: OMX_PORT_PARAM_TYPE */ - OMX_IndexParamNumAvailableStreams, /**< reference: OMX_PARAM_U32TYPE */ - OMX_IndexParamActiveStream, /**< reference: OMX_PARAM_U32TYPE */ - OMX_IndexParamSuspensionPolicy, /**< reference: OMX_PARAM_SUSPENSIONPOLICYTYPE */ - OMX_IndexParamComponentSuspended, /**< reference: OMX_PARAM_SUSPENSIONTYPE */ - OMX_IndexConfigCapturing, /**< reference: OMX_CONFIG_BOOLEANTYPE */ - OMX_IndexConfigCaptureMode, /**< reference: OMX_CONFIG_CAPTUREMODETYPE */ - OMX_IndexAutoPauseAfterCapture, /**< reference: OMX_CONFIG_BOOLEANTYPE */ - OMX_IndexParamContentURI, /**< reference: OMX_PARAM_CONTENTURITYPE */ - OMX_IndexParamCustomContentPipe, /**< reference: OMX_PARAM_CONTENTPIPETYPE */ - OMX_IndexParamDisableResourceConcealment, /**< reference: OMX_RESOURCECONCEALMENTTYPE */ - OMX_IndexConfigMetadataItemCount, /**< reference: OMX_CONFIG_METADATAITEMCOUNTTYPE */ - OMX_IndexConfigContainerNodeCount, /**< reference: OMX_CONFIG_CONTAINERNODECOUNTTYPE */ - OMX_IndexConfigMetadataItem, /**< reference: OMX_CONFIG_METADATAITEMTYPE */ - OMX_IndexConfigCounterNodeID, /**< reference: OMX_CONFIG_CONTAINERNODEIDTYPE */ - OMX_IndexParamMetadataFilterType, /**< reference: OMX_PARAM_METADATAFILTERTYPE */ - OMX_IndexParamMetadataKeyFilter, /**< reference: OMX_PARAM_METADATAFILTERTYPE */ - OMX_IndexConfigPriorityMgmt, /**< reference: OMX_PRIORITYMGMTTYPE */ - OMX_IndexParamStandardComponentRole, /**< reference: OMX_PARAM_COMPONENTROLETYPE */ - - OMX_IndexPortStartUnused = 0x02000000, - OMX_IndexParamPortDefinition, /**< reference: OMX_PARAM_PORTDEFINITIONTYPE */ - OMX_IndexParamCompBufferSupplier, /**< reference: OMX_PARAM_BUFFERSUPPLIERTYPE */ - OMX_IndexReservedStartUnused = 0x03000000, - - /* Audio parameters and configurations */ - OMX_IndexAudioStartUnused = 0x04000000, - OMX_IndexParamAudioPortFormat, /**< reference: OMX_AUDIO_PARAM_PORTFORMATTYPE */ - OMX_IndexParamAudioPcm, /**< reference: OMX_AUDIO_PARAM_PCMMODETYPE */ - OMX_IndexParamAudioAac, /**< reference: OMX_AUDIO_PARAM_AACPROFILETYPE */ - OMX_IndexParamAudioRa, /**< reference: OMX_AUDIO_PARAM_RATYPE */ - OMX_IndexParamAudioMp3, /**< reference: OMX_AUDIO_PARAM_MP3TYPE */ - OMX_IndexParamAudioAdpcm, /**< reference: OMX_AUDIO_PARAM_ADPCMTYPE */ - OMX_IndexParamAudioG723, /**< reference: OMX_AUDIO_PARAM_G723TYPE */ - OMX_IndexParamAudioG729, /**< reference: OMX_AUDIO_PARAM_G729TYPE */ - OMX_IndexParamAudioAmr, /**< reference: OMX_AUDIO_PARAM_AMRTYPE */ - OMX_IndexParamAudioWma, /**< reference: OMX_AUDIO_PARAM_WMATYPE */ - OMX_IndexParamAudioSbc, /**< reference: OMX_AUDIO_PARAM_SBCTYPE */ - OMX_IndexParamAudioMidi, /**< reference: OMX_AUDIO_PARAM_MIDITYPE */ - OMX_IndexParamAudioGsm_FR, /**< reference: OMX_AUDIO_PARAM_GSMFRTYPE */ - OMX_IndexParamAudioMidiLoadUserSound, /**< reference: OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE */ - OMX_IndexParamAudioG726, /**< reference: OMX_AUDIO_PARAM_G726TYPE */ - OMX_IndexParamAudioGsm_EFR, /**< reference: OMX_AUDIO_PARAM_GSMEFRTYPE */ - OMX_IndexParamAudioGsm_HR, /**< reference: OMX_AUDIO_PARAM_GSMHRTYPE */ - OMX_IndexParamAudioPdc_FR, /**< reference: OMX_AUDIO_PARAM_PDCFRTYPE */ - OMX_IndexParamAudioPdc_EFR, /**< reference: OMX_AUDIO_PARAM_PDCEFRTYPE */ - OMX_IndexParamAudioPdc_HR, /**< reference: OMX_AUDIO_PARAM_PDCHRTYPE */ - OMX_IndexParamAudioTdma_FR, /**< reference: OMX_AUDIO_PARAM_TDMAFRTYPE */ - OMX_IndexParamAudioTdma_EFR, /**< reference: OMX_AUDIO_PARAM_TDMAEFRTYPE */ - OMX_IndexParamAudioQcelp8, /**< reference: OMX_AUDIO_PARAM_QCELP8TYPE */ - OMX_IndexParamAudioQcelp13, /**< reference: OMX_AUDIO_PARAM_QCELP13TYPE */ - OMX_IndexParamAudioEvrc, /**< reference: OMX_AUDIO_PARAM_EVRCTYPE */ - OMX_IndexParamAudioSmv, /**< reference: OMX_AUDIO_PARAM_SMVTYPE */ - OMX_IndexParamAudioVorbis, /**< reference: OMX_AUDIO_PARAM_VORBISTYPE */ - OMX_IndexParamAudioFlac, /**< reference: OMX_AUDIO_PARAM_FLACTYPE */ - - OMX_IndexConfigAudioMidiImmediateEvent, /**< reference: OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE */ - OMX_IndexConfigAudioMidiControl, /**< reference: OMX_AUDIO_CONFIG_MIDICONTROLTYPE */ - OMX_IndexConfigAudioMidiSoundBankProgram, /**< reference: OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE */ - OMX_IndexConfigAudioMidiStatus, /**< reference: OMX_AUDIO_CONFIG_MIDISTATUSTYPE */ - OMX_IndexConfigAudioMidiMetaEvent, /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE */ - OMX_IndexConfigAudioMidiMetaEventData, /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE */ - OMX_IndexConfigAudioVolume, /**< reference: OMX_AUDIO_CONFIG_VOLUMETYPE */ - OMX_IndexConfigAudioBalance, /**< reference: OMX_AUDIO_CONFIG_BALANCETYPE */ - OMX_IndexConfigAudioChannelMute, /**< reference: OMX_AUDIO_CONFIG_CHANNELMUTETYPE */ - OMX_IndexConfigAudioMute, /**< reference: OMX_AUDIO_CONFIG_MUTETYPE */ - OMX_IndexConfigAudioLoudness, /**< reference: OMX_AUDIO_CONFIG_LOUDNESSTYPE */ - OMX_IndexConfigAudioEchoCancelation, /**< reference: OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE */ - OMX_IndexConfigAudioNoiseReduction, /**< reference: OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE */ - OMX_IndexConfigAudioBass, /**< reference: OMX_AUDIO_CONFIG_BASSTYPE */ - OMX_IndexConfigAudioTreble, /**< reference: OMX_AUDIO_CONFIG_TREBLETYPE */ - OMX_IndexConfigAudioStereoWidening, /**< reference: OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE */ - OMX_IndexConfigAudioChorus, /**< reference: OMX_AUDIO_CONFIG_CHORUSTYPE */ - OMX_IndexConfigAudioEqualizer, /**< reference: OMX_AUDIO_CONFIG_EQUALIZERTYPE */ - OMX_IndexConfigAudioReverberation, /**< reference: OMX_AUDIO_CONFIG_REVERBERATIONTYPE */ - OMX_IndexConfigAudioChannelVolume, /**< reference: OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE */ - - /* Image specific parameters and configurations */ - OMX_IndexImageStartUnused = 0x05000000, - OMX_IndexParamImagePortFormat, /**< reference: OMX_IMAGE_PARAM_PORTFORMATTYPE */ - OMX_IndexParamFlashControl, /**< reference: OMX_IMAGE_PARAM_FLASHCONTROLTYPE */ - OMX_IndexConfigFocusControl, /**< reference: OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE */ - OMX_IndexParamQFactor, /**< reference: OMX_IMAGE_PARAM_QFACTORTYPE */ - OMX_IndexParamQuantizationTable, /**< reference: OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE */ - OMX_IndexParamHuffmanTable, /**< reference: OMX_IMAGE_PARAM_HUFFMANTTABLETYPE */ - OMX_IndexConfigFlashControl, /**< reference: OMX_IMAGE_PARAM_FLASHCONTROLTYPE */ - - /* Video specific parameters and configurations */ - OMX_IndexVideoStartUnused = 0x06000000, - OMX_IndexParamVideoPortFormat, /**< reference: OMX_VIDEO_PARAM_PORTFORMATTYPE */ - OMX_IndexParamVideoQuantization, /**< reference: OMX_VIDEO_PARAM_QUANTIZATIONTYPE */ - OMX_IndexParamVideoFastUpdate, /**< reference: OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE */ - OMX_IndexParamVideoBitrate, /**< reference: OMX_VIDEO_PARAM_BITRATETYPE */ - OMX_IndexParamVideoMotionVector, /**< reference: OMX_VIDEO_PARAM_MOTIONVECTORTYPE */ - OMX_IndexParamVideoIntraRefresh, /**< reference: OMX_VIDEO_PARAM_INTRAREFRESHTYPE */ - OMX_IndexParamVideoErrorCorrection, /**< reference: OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE */ - OMX_IndexParamVideoVBSMC, /**< reference: OMX_VIDEO_PARAM_VBSMCTYPE */ - OMX_IndexParamVideoMpeg2, /**< reference: OMX_VIDEO_PARAM_MPEG2TYPE */ - OMX_IndexParamVideoMpeg4, /**< reference: OMX_VIDEO_PARAM_MPEG4TYPE */ - OMX_IndexParamVideoWmv, /**< reference: OMX_VIDEO_PARAM_WMVTYPE */ - OMX_IndexParamVideoRv, /**< reference: OMX_VIDEO_PARAM_RVTYPE */ - OMX_IndexParamVideoAvc, /**< reference: OMX_VIDEO_PARAM_AVCTYPE */ - OMX_IndexParamVideoH263, /**< reference: OMX_VIDEO_PARAM_H263TYPE */ - OMX_IndexParamVideoProfileLevelQuerySupported, /**< reference: OMX_VIDEO_PARAM_PROFILELEVELTYPE */ - OMX_IndexParamVideoProfileLevelCurrent, /**< reference: OMX_VIDEO_PARAM_PROFILELEVELTYPE */ - OMX_IndexConfigVideoBitrate, /**< reference: OMX_VIDEO_CONFIG_BITRATETYPE */ - OMX_IndexConfigVideoFramerate, /**< reference: OMX_CONFIG_FRAMERATETYPE */ - OMX_IndexConfigVideoIntraVOPRefresh, /**< reference: OMX_CONFIG_INTRAREFRESHVOPTYPE */ - OMX_IndexConfigVideoIntraMBRefresh, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */ - OMX_IndexConfigVideoMBErrorReporting, /**< reference: OMX_CONFIG_MBERRORREPORTINGTYPE */ - OMX_IndexParamVideoMacroblocksPerFrame, /**< reference: OMX_PARAM_MACROBLOCKSTYPE */ - OMX_IndexConfigVideoMacroBlockErrorMap, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */ - OMX_IndexParamVideoSliceFMO, /**< reference: OMX_VIDEO_PARAM_AVCSLICEFMO */ - OMX_IndexConfigVideoAVCIntraPeriod, /**< reference: OMX_VIDEO_CONFIG_AVCINTRAPERIOD */ - OMX_IndexConfigVideoNalSize, /**< reference: OMX_VIDEO_CONFIG_NALSIZE */ - - /* Image & Video common Configurations */ - OMX_IndexCommonStartUnused = 0x07000000, - OMX_IndexParamCommonDeblocking, /**< reference: OMX_PARAM_DEBLOCKINGTYPE */ - OMX_IndexParamCommonSensorMode, /**< reference: OMX_PARAM_SENSORMODETYPE */ - OMX_IndexParamCommonInterleave, /**< reference: OMX_PARAM_INTERLEAVETYPE */ - OMX_IndexConfigCommonColorFormatConversion, /**< reference: OMX_CONFIG_COLORCONVERSIONTYPE */ - OMX_IndexConfigCommonScale, /**< reference: OMX_CONFIG_SCALEFACTORTYPE */ - OMX_IndexConfigCommonImageFilter, /**< reference: OMX_CONFIG_IMAGEFILTERTYPE */ - OMX_IndexConfigCommonColorEnhancement, /**< reference: OMX_CONFIG_COLORENHANCEMENTTYPE */ - OMX_IndexConfigCommonColorKey, /**< reference: OMX_CONFIG_COLORKEYTYPE */ - OMX_IndexConfigCommonColorBlend, /**< reference: OMX_CONFIG_COLORBLENDTYPE */ - OMX_IndexConfigCommonFrameStabilisation,/**< reference: OMX_CONFIG_FRAMESTABTYPE */ - OMX_IndexConfigCommonRotate, /**< reference: OMX_CONFIG_ROTATIONTYPE */ - OMX_IndexConfigCommonMirror, /**< reference: OMX_CONFIG_MIRRORTYPE */ - OMX_IndexConfigCommonOutputPosition, /**< reference: OMX_CONFIG_POINTTYPE */ - OMX_IndexConfigCommonInputCrop, /**< reference: OMX_CONFIG_RECTTYPE */ - OMX_IndexConfigCommonOutputCrop, /**< reference: OMX_CONFIG_RECTTYPE */ - OMX_IndexConfigCommonDigitalZoom, /**< reference: OMX_CONFIG_SCALEFACTORTYPE */ - OMX_IndexConfigCommonOpticalZoom, /**< reference: OMX_CONFIG_SCALEFACTORTYPE*/ - OMX_IndexConfigCommonWhiteBalance, /**< reference: OMX_CONFIG_WHITEBALCONTROLTYPE */ - OMX_IndexConfigCommonExposure, /**< reference: OMX_CONFIG_EXPOSURECONTROLTYPE */ - OMX_IndexConfigCommonContrast, /**< reference: OMX_CONFIG_CONTRASTTYPE */ - OMX_IndexConfigCommonBrightness, /**< reference: OMX_CONFIG_BRIGHTNESSTYPE */ - OMX_IndexConfigCommonBacklight, /**< reference: OMX_CONFIG_BACKLIGHTTYPE */ - OMX_IndexConfigCommonGamma, /**< reference: OMX_CONFIG_GAMMATYPE */ - OMX_IndexConfigCommonSaturation, /**< reference: OMX_CONFIG_SATURATIONTYPE */ - OMX_IndexConfigCommonLightness, /**< reference: OMX_CONFIG_LIGHTNESSTYPE */ - OMX_IndexConfigCommonExclusionRect, /**< reference: OMX_CONFIG_RECTTYPE */ - OMX_IndexConfigCommonDithering, /**< reference: OMX_CONFIG_DITHERTYPE */ - OMX_IndexConfigCommonPlaneBlend, /**< reference: OMX_CONFIG_PLANEBLENDTYPE */ - OMX_IndexConfigCommonExposureValue, /**< reference: OMX_CONFIG_EXPOSUREVALUETYPE */ - OMX_IndexConfigCommonOutputSize, /**< reference: OMX_FRAMESIZETYPE */ - OMX_IndexParamCommonExtraQuantData, /**< reference: OMX_OTHER_EXTRADATATYPE */ - OMX_IndexConfigCommonFocusRegion, /**< reference: OMX_CONFIG_FOCUSREGIONTYPE */ - OMX_IndexConfigCommonFocusStatus, /**< reference: OMX_PARAM_FOCUSSTATUSTYPE */ - OMX_IndexConfigCommonTransitionEffect, /**< reference: OMX_CONFIG_TRANSITIONEFFECTTYPE */ - - /* Reserved Configuration range */ - OMX_IndexOtherStartUnused = 0x08000000, - OMX_IndexParamOtherPortFormat, /**< reference: OMX_OTHER_PARAM_PORTFORMATTYPE */ - OMX_IndexConfigOtherPower, /**< reference: OMX_OTHER_CONFIG_POWERTYPE */ - OMX_IndexConfigOtherStats, /**< reference: OMX_OTHER_CONFIG_STATSTYPE */ - - - /* Reserved Time range */ - OMX_IndexTimeStartUnused = 0x09000000, - OMX_IndexConfigTimeScale, /**< reference: OMX_TIME_CONFIG_SCALETYPE */ - OMX_IndexConfigTimeClockState, /**< reference: OMX_TIME_CONFIG_CLOCKSTATETYPE */ - OMX_IndexConfigTimeActiveRefClock, /**< reference: OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE */ - OMX_IndexConfigTimeCurrentMediaTime, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only) */ - OMX_IndexConfigTimeCurrentWallTime, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only) */ - OMX_IndexConfigTimeCurrentAudioReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */ - OMX_IndexConfigTimeCurrentVideoReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */ - OMX_IndexConfigTimeMediaTimeRequest, /**< reference: OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE (write only) */ - OMX_IndexConfigTimeClientStartTime, /** - - -/** Khronos standard extension indices. - -This enum lists the current Khronos extension indices to OpenMAX IL. -*/ -typedef enum OMX_INDEXEXTTYPE { - - /* Component parameters and configurations */ - OMX_IndexExtComponentStartUnused = OMX_IndexKhronosExtensions + 0x00100000, - OMX_IndexConfigCallbackRequest, /**< reference: OMX_CONFIG_CALLBACKREQUESTTYPE */ - OMX_IndexConfigCommitMode, /**< reference: OMX_CONFIG_COMMITMODETYPE */ - OMX_IndexConfigCommit, /**< reference: OMX_CONFIG_COMMITTYPE */ - - /* Port parameters and configurations */ - OMX_IndexExtPortStartUnused = OMX_IndexKhronosExtensions + 0x00200000, - - /* Audio parameters and configurations */ - OMX_IndexExtAudioStartUnused = OMX_IndexKhronosExtensions + 0x00400000, - - /* Image parameters and configurations */ - OMX_IndexExtImageStartUnused = OMX_IndexKhronosExtensions + 0x00500000, - - /* Video parameters and configurations */ - OMX_IndexExtVideoStartUnused = OMX_IndexKhronosExtensions + 0x00600000, - OMX_IndexParamNalStreamFormatSupported, /**< reference: OMX_NALSTREAMFORMATTYPE */ - OMX_IndexParamNalStreamFormat, /**< reference: OMX_NALSTREAMFORMATTYPE */ - OMX_IndexParamNalStreamFormatSelect, /**< reference: OMX_NALSTREAMFORMATTYPE */ - OMX_IndexParamVideoVp8, /**< reference: OMX_VIDEO_PARAM_VP8TYPE */ - OMX_IndexConfigVideoVp8ReferenceFrame, /**< reference: OMX_VIDEO_VP8REFERENCEFRAMETYPE */ - OMX_IndexConfigVideoVp8ReferenceFrameType, /**< reference: OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE */ - - /* Image & Video common configurations */ - OMX_IndexExtCommonStartUnused = OMX_IndexKhronosExtensions + 0x00700000, - - /* Other configurations */ - OMX_IndexExtOtherStartUnused = OMX_IndexKhronosExtensions + 0x00800000, - - /* Time configurations */ - OMX_IndexExtTimeStartUnused = OMX_IndexKhronosExtensions + 0x00900000, - - OMX_IndexExtMax = 0x7FFFFFFF -} OMX_INDEXEXTTYPE; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* OMX_IndexExt_h */ -/* File EOF */ diff --git a/external/android/include/19/frameworks/native/include/media/openmax/OMX_Other.h b/external/android/include/19/frameworks/native/include/media/openmax/OMX_Other.h deleted file mode 100644 index efbce83..0000000 --- a/external/android/include/19/frameworks/native/include/media/openmax/OMX_Other.h +++ /dev/null @@ -1,354 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** @file OMX_Other.h - OpenMax IL version 1.1.2 - * The structures needed by Other components to exchange - * parameters and configuration data with the components. - */ - -#ifndef OMX_Other_h -#define OMX_Other_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/* Each OMX header must include all required header files to allow the - * header to compile without errors. The includes below are required - * for this header file to compile successfully - */ - -#include - - -/** - * Enumeration of possible data types which match to multiple domains or no - * domain at all. For types which are vendor specific, a value above - * OMX_OTHER_VENDORTSTART should be used. - */ -typedef enum OMX_OTHER_FORMATTYPE { - OMX_OTHER_FormatTime = 0, /**< Transmission of various timestamps, elapsed time, - time deltas, etc */ - OMX_OTHER_FormatPower, /**< Perhaps used for enabling/disabling power - management, setting clocks? */ - OMX_OTHER_FormatStats, /**< Could be things such as frame rate, frames - dropped, etc */ - OMX_OTHER_FormatBinary, /**< Arbitrary binary data */ - OMX_OTHER_FormatVendorReserved = 1000, /**< Starting value for vendor specific - formats */ - - OMX_OTHER_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_OTHER_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_OTHER_FormatMax = 0x7FFFFFFF -} OMX_OTHER_FORMATTYPE; - -/** - * Enumeration of seek modes. - */ -typedef enum OMX_TIME_SEEKMODETYPE { - OMX_TIME_SeekModeFast = 0, /**< Prefer seeking to an approximation - * of the requested seek position over - * the actual seek position if it - * results in a faster seek. */ - OMX_TIME_SeekModeAccurate, /**< Prefer seeking to the actual seek - * position over an approximation - * of the requested seek position even - * if it results in a slower seek. */ - OMX_TIME_SeekModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_TIME_SeekModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_TIME_SeekModeMax = 0x7FFFFFFF -} OMX_TIME_SEEKMODETYPE; - -/* Structure representing the seekmode of the component */ -typedef struct OMX_TIME_CONFIG_SEEKMODETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_TIME_SEEKMODETYPE eType; /**< The seek mode */ -} OMX_TIME_CONFIG_SEEKMODETYPE; - -/** Structure representing a time stamp used with the following configs - * on the Clock Component (CC): - * - * OMX_IndexConfigTimeCurrentWallTime: query of the CC’s current wall - * time - * OMX_IndexConfigTimeCurrentMediaTime: query of the CC’s current media - * time - * OMX_IndexConfigTimeCurrentAudioReference and - * OMX_IndexConfigTimeCurrentVideoReference: audio/video reference - * clock sending SC its reference time - * OMX_IndexConfigTimeClientStartTime: a Clock Component client sends - * this structure to the Clock Component via a SetConfig on its - * client port when it receives a buffer with - * OMX_BUFFERFLAG_STARTTIME set. It must use the timestamp - * specified by that buffer for nStartTimestamp. - * - * It’s also used with the following config on components in general: - * - * OMX_IndexConfigTimePosition: IL client querying component position - * (GetConfig) or commanding a component to seek to the given location - * (SetConfig) - */ -typedef struct OMX_TIME_CONFIG_TIMESTAMPTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version - * information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_TICKS nTimestamp; /**< timestamp .*/ -} OMX_TIME_CONFIG_TIMESTAMPTYPE; - -/** Enumeration of possible reference clocks to the media time. */ -typedef enum OMX_TIME_UPDATETYPE { - OMX_TIME_UpdateRequestFulfillment, /**< Update is the fulfillment of a media time request. */ - OMX_TIME_UpdateScaleChanged, /**< Update was generated because the scale chagned. */ - OMX_TIME_UpdateClockStateChanged, /**< Update was generated because the clock state changed. */ - OMX_TIME_UpdateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_TIME_UpdateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_TIME_UpdateMax = 0x7FFFFFFF -} OMX_TIME_UPDATETYPE; - -/** Enumeration of possible reference clocks to the media time. */ -typedef enum OMX_TIME_REFCLOCKTYPE { - OMX_TIME_RefClockNone, /**< Use no references. */ - OMX_TIME_RefClockAudio, /**< Use references sent through OMX_IndexConfigTimeCurrentAudioReference */ - OMX_TIME_RefClockVideo, /**< Use references sent through OMX_IndexConfigTimeCurrentVideoReference */ - OMX_TIME_RefClockKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_TIME_RefClockVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_TIME_RefClockMax = 0x7FFFFFFF -} OMX_TIME_REFCLOCKTYPE; - -/** Enumeration of clock states. */ -typedef enum OMX_TIME_CLOCKSTATE { - OMX_TIME_ClockStateRunning, /**< Clock running. */ - OMX_TIME_ClockStateWaitingForStartTime, /**< Clock waiting until the - * prescribed clients emit their - * start time. */ - OMX_TIME_ClockStateStopped, /**< Clock stopped. */ - OMX_TIME_ClockStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_TIME_ClockStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_TIME_ClockStateMax = 0x7FFFFFFF -} OMX_TIME_CLOCKSTATE; - -/** Structure representing a media time request to the clock component. - * - * A client component sends this structure to the Clock Component via a SetConfig - * on its client port to specify a media timestamp the Clock Component - * should emit. The Clock Component should fulfill the request by sending a - * OMX_TIME_MEDIATIMETYPE when its media clock matches the requested - * timestamp. - * - * The client may require a media time request be fulfilled slightly - * earlier than the media time specified. In this case the client specifies - * an offset which is equal to the difference between wall time corresponding - * to the requested media time and the wall time when it will be - * fulfilled. - * - * A client component may uses these requests and the OMX_TIME_MEDIATIMETYPE to - * time events according to timestamps. If a client must perform an operation O at - * a time T (e.g. deliver a video frame at its corresponding timestamp), it makes a - * media time request at T (perhaps specifying an offset to ensure the request fulfillment - * is a little early). When the clock component passes the resulting OMX_TIME_MEDIATIMETYPE - * structure back to the client component, the client may perform operation O (perhaps having - * to wait a slight amount more time itself as specified by the return values). - */ - -typedef struct OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< port that this structure applies to */ - OMX_PTR pClientPrivate; /**< Client private data to disabiguate this media time - * from others (e.g. the number of the frame to deliver). - * Duplicated in the media time structure that fulfills - * this request. A value of zero is reserved for time scale - * updates. */ - OMX_TICKS nMediaTimestamp; /**< Media timestamp requested.*/ - OMX_TICKS nOffset; /**< Amount of wall clock time by which this - * request should be fulfilled early */ -} OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE; - -/**< Structure sent from the clock component client either when fulfilling - * a media time request or when the time scale has changed. - * - * In the former case the Clock Component fills this structure and times its emission - * to a client component (via the client port) according to the corresponding media - * time request sent by the client. The Clock Component should time the emission to occur - * when the requested timestamp matches the Clock Component's media time but also the - * prescribed offset early. - * - * Upon scale changes the clock component clears the nClientPrivate data, sends the current - * media time and sets the nScale to the new scale via the client port. It emits a - * OMX_TIME_MEDIATIMETYPE to all clients independent of any requests. This allows clients to - * alter processing to accomodate scaling. For instance a video component might skip inter-frames - * in the case of extreme fastforward. Likewise an audio component might add or remove samples - * from an audio frame to scale audio data. - * - * It is expected that some clock components may not be able to fulfill requests - * at exactly the prescribed time. This is acceptable so long as the request is - * fulfilled at least as early as described and not later. This structure provides - * fields the client may use to wait for the remaining time. - * - * The client may use either the nOffset or nWallTimeAtMedia fields to determine the - * wall time until the nMediaTimestamp actually occurs. In the latter case the - * client can get a more accurate value for offset by getting the current wall - * from the cloc component and subtracting it from nWallTimeAtMedia. - */ - -typedef struct OMX_TIME_MEDIATIMETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nClientPrivate; /**< Client private data to disabiguate this media time - * from others. Copied from the media time request. - * A value of zero is reserved for time scale updates. */ - OMX_TIME_UPDATETYPE eUpdateType; /**< Reason for the update */ - OMX_TICKS nMediaTimestamp; /**< Media time requested. If no media time was - * requested then this is the current media time. */ - OMX_TICKS nOffset; /**< Amount of wall clock time by which this - * request was actually fulfilled early */ - - OMX_TICKS nWallTimeAtMediaTime; /**< Wall time corresponding to nMediaTimeStamp. - * A client may compare this value to current - * media time obtained from the Clock Component to determine - * the wall time until the media timestamp is really - * current. */ - OMX_S32 xScale; /**< Current media time scale in Q16 format. */ - OMX_TIME_CLOCKSTATE eState; /* Seeking Change. Added 7/12.*/ - /**< State of the media time. */ -} OMX_TIME_MEDIATIMETYPE; - -/** Structure representing the current media time scale factor. Applicable only to clock - * component, other components see scale changes via OMX_TIME_MEDIATIMETYPE buffers sent via - * the clock component client ports. Upon recieving this config the clock component changes - * the rate by which the media time increases or decreases effectively implementing trick modes. - */ -typedef struct OMX_TIME_CONFIG_SCALETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_S32 xScale; /**< This is a value in Q16 format which is used for - * scaling the media time */ -} OMX_TIME_CONFIG_SCALETYPE; - -/** Bits used to identify a clock port. Used in OMX_TIME_CONFIG_CLOCKSTATETYPE’s nWaitMask field */ -#define OMX_CLOCKPORT0 0x00000001 -#define OMX_CLOCKPORT1 0x00000002 -#define OMX_CLOCKPORT2 0x00000004 -#define OMX_CLOCKPORT3 0x00000008 -#define OMX_CLOCKPORT4 0x00000010 -#define OMX_CLOCKPORT5 0x00000020 -#define OMX_CLOCKPORT6 0x00000040 -#define OMX_CLOCKPORT7 0x00000080 - -/** Structure representing the current mode of the media clock. - * IL Client uses this config to change or query the mode of the - * media clock of the clock component. Applicable only to clock - * component. - * - * On a SetConfig if eState is OMX_TIME_ClockStateRunning media time - * starts immediately at the prescribed start time. If - * OMX_TIME_ClockStateWaitingForStartTime the Clock Component ignores - * the given nStartTime and waits for all clients specified in the - * nWaitMask to send starttimes (via - * OMX_IndexConfigTimeClientStartTime). The Clock Component then starts - * the media clock using the earliest start time supplied. */ -typedef struct OMX_TIME_CONFIG_CLOCKSTATETYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version - * information */ - OMX_TIME_CLOCKSTATE eState; /**< State of the media time. */ - OMX_TICKS nStartTime; /**< Start time of the media time. */ - OMX_TICKS nOffset; /**< Time to offset the media time by - * (e.g. preroll). Media time will be - * reported to be nOffset ticks earlier. - */ - OMX_U32 nWaitMask; /**< Mask of OMX_CLOCKPORT values. */ -} OMX_TIME_CONFIG_CLOCKSTATETYPE; - -/** Structure representing the reference clock currently being used to - * compute media time. IL client uses this config to change or query the - * clock component's active reference clock */ -typedef struct OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_TIME_REFCLOCKTYPE eClock; /**< Reference clock used to compute media time */ -} OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE; - -/** Descriptor for setting specifics of power type. - * Note: this structure is listed for backwards compatibility. */ -typedef struct OMX_OTHER_CONFIG_POWERTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_BOOL bEnablePM; /**< Flag to enable Power Management */ -} OMX_OTHER_CONFIG_POWERTYPE; - - -/** Descriptor for setting specifics of stats type. - * Note: this structure is listed for backwards compatibility. */ -typedef struct OMX_OTHER_CONFIG_STATSTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - /* what goes here */ -} OMX_OTHER_CONFIG_STATSTYPE; - - -/** - * The PortDefinition structure is used to define all of the parameters - * necessary for the compliant component to setup an input or an output other - * path. - */ -typedef struct OMX_OTHER_PORTDEFINITIONTYPE { - OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */ -} OMX_OTHER_PORTDEFINITIONTYPE; - -/** Port format parameter. This structure is used to enumerate - * the various data input/output format supported by the port. - */ -typedef struct OMX_OTHER_PARAM_PORTFORMATTYPE { - OMX_U32 nSize; /**< size of the structure in bytes */ - OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ - OMX_U32 nPortIndex; /**< Indicates which port to set */ - OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */ - OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */ -} OMX_OTHER_PARAM_PORTFORMATTYPE; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ diff --git a/external/android/include/19/frameworks/native/include/media/openmax/OMX_Types.h b/external/android/include/19/frameworks/native/include/media/openmax/OMX_Types.h deleted file mode 100644 index 03fd4bc..0000000 --- a/external/android/include/19/frameworks/native/include/media/openmax/OMX_Types.h +++ /dev/null @@ -1,365 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/* - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** OMX_Types.h - OpenMax IL version 1.1.2 - * The OMX_Types header file contains the primitive type definitions used by - * the core, the application and the component. This file may need to be - * modified to be used on systems that do not have "char" set to 8 bits, - * "short" set to 16 bits and "long" set to 32 bits. - */ - -#ifndef OMX_Types_h -#define OMX_Types_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/** The OMX_API and OMX_APIENTRY are platform specific definitions used - * to declare OMX function prototypes. They are modified to meet the - * requirements for a particular platform */ -#ifdef __SYMBIAN32__ -# ifdef __OMX_EXPORTS -# define OMX_API __declspec(dllexport) -# else -# ifdef _WIN32 -# define OMX_API __declspec(dllexport) -# else -# define OMX_API __declspec(dllimport) -# endif -# endif -#else -# ifdef _WIN32 -# ifdef __OMX_EXPORTS -# define OMX_API __declspec(dllexport) -# else -//# define OMX_API __declspec(dllimport) -#define OMX_API -# endif -# else -# ifdef __OMX_EXPORTS -# define OMX_API -# else -# define OMX_API extern -# endif -# endif -#endif - -#ifndef OMX_APIENTRY -#define OMX_APIENTRY -#endif - -/** OMX_IN is used to identify inputs to an OMX function. This designation - will also be used in the case of a pointer that points to a parameter - that is used as an output. */ -#ifndef OMX_IN -#define OMX_IN -#endif - -/** OMX_OUT is used to identify outputs from an OMX function. This - designation will also be used in the case of a pointer that points - to a parameter that is used as an input. */ -#ifndef OMX_OUT -#define OMX_OUT -#endif - - -/** OMX_INOUT is used to identify parameters that may be either inputs or - outputs from an OMX function at the same time. This designation will - also be used in the case of a pointer that points to a parameter that - is used both as an input and an output. */ -#ifndef OMX_INOUT -#define OMX_INOUT -#endif - -/** OMX_ALL is used to as a wildcard to select all entities of the same type - * when specifying the index, or referring to a object by an index. (i.e. - * use OMX_ALL to indicate all N channels). When used as a port index - * for a config or parameter this OMX_ALL denotes that the config or - * parameter applies to the entire component not just one port. */ -#define OMX_ALL 0xFFFFFFFF - -/** In the following we define groups that help building doxygen documentation */ - -/** @defgroup core OpenMAX IL core - * Functions and structure related to the OMX IL core - */ - - /** @defgroup comp OpenMAX IL component - * Functions and structure related to the OMX IL component - */ - -/** @defgroup rpm Resource and Policy Management - * Structures for resource and policy management of components - */ - -/** @defgroup buf Buffer Management - * Buffer handling functions and structures - */ - -/** @defgroup tun Tunneling - * @ingroup core comp - * Structures and functions to manage tunnels among component ports - */ - -/** @defgroup cp Content Pipes - * @ingroup core - */ - - /** @defgroup metadata Metadata handling - * - */ - -/** OMX_U8 is an 8 bit unsigned quantity that is byte aligned */ -typedef unsigned char OMX_U8; - -/** OMX_S8 is an 8 bit signed quantity that is byte aligned */ -typedef signed char OMX_S8; - -/** OMX_U16 is a 16 bit unsigned quantity that is 16 bit word aligned */ -typedef unsigned short OMX_U16; - -/** OMX_S16 is a 16 bit signed quantity that is 16 bit word aligned */ -typedef signed short OMX_S16; - -/** OMX_U32 is a 32 bit unsigned quantity that is 32 bit word aligned */ -typedef unsigned long OMX_U32; - -/** OMX_S32 is a 32 bit signed quantity that is 32 bit word aligned */ -typedef signed long OMX_S32; - - -/* Users with compilers that cannot accept the "long long" designation should - define the OMX_SKIP64BIT macro. It should be noted that this may cause - some components to fail to compile if the component was written to require - 64 bit integral types. However, these components would NOT compile anyway - since the compiler does not support the way the component was written. -*/ -#ifndef OMX_SKIP64BIT -#ifdef __SYMBIAN32__ -/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */ -typedef unsigned long long OMX_U64; - -/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */ -typedef signed long long OMX_S64; - -#elif defined(WIN32) - -/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */ -typedef unsigned __int64 OMX_U64; - -/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */ -typedef signed __int64 OMX_S64; - -#else /* WIN32 */ - -/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */ -typedef unsigned long long OMX_U64; - -/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */ -typedef signed long long OMX_S64; - -#endif /* WIN32 */ -#endif - - -/** The OMX_BOOL type is intended to be used to represent a true or a false - value when passing parameters to and from the OMX core and components. The - OMX_BOOL is a 32 bit quantity and is aligned on a 32 bit word boundary. - */ -typedef enum OMX_BOOL { - OMX_FALSE = 0, - OMX_TRUE = !OMX_FALSE, - OMX_BOOL_MAX = 0x7FFFFFFF -} OMX_BOOL; - -/** The OMX_PTR type is intended to be used to pass pointers between the OMX - applications and the OMX Core and components. This is a 32 bit pointer and - is aligned on a 32 bit boundary. - */ -typedef void* OMX_PTR; - -/** The OMX_STRING type is intended to be used to pass "C" type strings between - the application and the core and component. The OMX_STRING type is a 32 - bit pointer to a zero terminated string. The pointer is word aligned and - the string is byte aligned. - */ -typedef char* OMX_STRING; - -/** The OMX_BYTE type is intended to be used to pass arrays of bytes such as - buffers between the application and the component and core. The OMX_BYTE - type is a 32 bit pointer to a zero terminated string. The pointer is word - aligned and the string is byte aligned. - */ -typedef unsigned char* OMX_BYTE; - -/** OMX_UUIDTYPE is a very long unique identifier to uniquely identify - at runtime. This identifier should be generated by a component in a way - that guarantees that every instance of the identifier running on the system - is unique. */ -typedef unsigned char OMX_UUIDTYPE[128]; - -/** The OMX_DIRTYPE enumeration is used to indicate if a port is an input or - an output port. This enumeration is common across all component types. - */ -typedef enum OMX_DIRTYPE -{ - OMX_DirInput, /**< Port is an input port */ - OMX_DirOutput, /**< Port is an output port */ - OMX_DirMax = 0x7FFFFFFF -} OMX_DIRTYPE; - -/** The OMX_ENDIANTYPE enumeration is used to indicate the bit ordering - for numerical data (i.e. big endian, or little endian). - */ -typedef enum OMX_ENDIANTYPE -{ - OMX_EndianBig, /**< big endian */ - OMX_EndianLittle, /**< little endian */ - OMX_EndianMax = 0x7FFFFFFF -} OMX_ENDIANTYPE; - - -/** The OMX_NUMERICALDATATYPE enumeration is used to indicate if data - is signed or unsigned - */ -typedef enum OMX_NUMERICALDATATYPE -{ - OMX_NumericalDataSigned, /**< signed data */ - OMX_NumericalDataUnsigned, /**< unsigned data */ - OMX_NumercialDataMax = 0x7FFFFFFF -} OMX_NUMERICALDATATYPE; - - -/** Unsigned bounded value type */ -typedef struct OMX_BU32 { - OMX_U32 nValue; /**< actual value */ - OMX_U32 nMin; /**< minimum for value (i.e. nValue >= nMin) */ - OMX_U32 nMax; /**< maximum for value (i.e. nValue <= nMax) */ -} OMX_BU32; - - -/** Signed bounded value type */ -typedef struct OMX_BS32 { - OMX_S32 nValue; /**< actual value */ - OMX_S32 nMin; /**< minimum for value (i.e. nValue >= nMin) */ - OMX_S32 nMax; /**< maximum for value (i.e. nValue <= nMax) */ -} OMX_BS32; - - -/** Structure representing some time or duration in microseconds. This structure - * must be interpreted as a signed 64 bit value. The quantity is signed to accommodate - * negative deltas and preroll scenarios. The quantity is represented in microseconds - * to accomodate high resolution timestamps (e.g. DVD presentation timestamps based - * on a 90kHz clock) and to allow more accurate and synchronized delivery (e.g. - * individual audio samples delivered at 192 kHz). The quantity is 64 bit to - * accommodate a large dynamic range (signed 32 bit values would allow only for plus - * or minus 35 minutes). - * - * Implementations with limited precision may convert the signed 64 bit value to - * a signed 32 bit value internally but risk loss of precision. - */ -#ifndef OMX_SKIP64BIT -typedef OMX_S64 OMX_TICKS; -#else -typedef struct OMX_TICKS -{ - OMX_U32 nLowPart; /** low bits of the signed 64 bit tick value */ - OMX_U32 nHighPart; /** high bits of the signed 64 bit tick value */ -} OMX_TICKS; -#endif -#define OMX_TICKS_PER_SECOND 1000000 - -/** Define the public interface for the OMX Handle. The core will not use - this value internally, but the application should only use this value. - */ -typedef void* OMX_HANDLETYPE; - -typedef struct OMX_MARKTYPE -{ - OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will - generate a mark event upon - processing the mark. */ - OMX_PTR pMarkData; /**< Application specific data associated with - the mark sent on a mark event to disambiguate - this mark from others. */ -} OMX_MARKTYPE; - - -/** OMX_NATIVE_DEVICETYPE is used to map a OMX video port to the - * platform & operating specific object used to reference the display - * or can be used by a audio port for native audio rendering */ -typedef void* OMX_NATIVE_DEVICETYPE; - -/** OMX_NATIVE_WINDOWTYPE is used to map a OMX video port to the - * platform & operating specific object used to reference the window */ -typedef void* OMX_NATIVE_WINDOWTYPE; - -/** The OMX_VERSIONTYPE union is used to specify the version for - a structure or component. For a component, the version is entirely - specified by the component vendor. Components doing the same function - from different vendors may or may not have the same version. For - structures, the version shall be set by the entity that allocates the - structure. For structures specified in the OMX 1.1 specification, the - value of the version shall be set to 1.1.0.0 in all cases. Access to the - OMX_VERSIONTYPE can be by a single 32 bit access (e.g. by nVersion) or - by accessing one of the structure elements to, for example, check only - the Major revision. - */ -typedef union OMX_VERSIONTYPE -{ - struct - { - OMX_U8 nVersionMajor; /**< Major version accessor element */ - OMX_U8 nVersionMinor; /**< Minor version accessor element */ - OMX_U8 nRevision; /**< Revision version accessor element */ - OMX_U8 nStep; /**< Step version accessor element */ - } s; - OMX_U32 nVersion; /**< 32 bit value to make accessing the - version easily done in a single word - size copy/compare operation */ -} OMX_VERSIONTYPE; - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ diff --git a/external/android/include/19/frameworks/native/include/media/openmax/OMX_Video.h b/external/android/include/19/frameworks/native/include/media/openmax/OMX_Video.h deleted file mode 100644 index 4441a7a..0000000 --- a/external/android/include/19/frameworks/native/include/media/openmax/OMX_Video.h +++ /dev/null @@ -1,1079 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * 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. - * ------------------------------------------------------------------- - */ -/** - * Copyright (c) 2008 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** - * @file OMX_Video.h - OpenMax IL version 1.1.2 - * The structures is needed by Video components to exchange parameters - * and configuration data with OMX components. - */ -#ifndef OMX_Video_h -#define OMX_Video_h - -/** @defgroup video OpenMAX IL Video Domain - * @ingroup iv - * Structures for OpenMAX IL Video domain - * @{ - */ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/** - * Each OMX header must include all required header files to allow the - * header to compile without errors. The includes below are required - * for this header file to compile successfully - */ - -#include - - -/** - * Enumeration used to define the possible video compression codings. - * NOTE: This essentially refers to file extensions. If the coding is - * being used to specify the ENCODE type, then additional work - * must be done to configure the exact flavor of the compression - * to be used. For decode cases where the user application can - * not differentiate between MPEG-4 and H.264 bit streams, it is - * up to the codec to handle this. - */ -typedef enum OMX_VIDEO_CODINGTYPE { - OMX_VIDEO_CodingUnused, /**< Value when coding is N/A */ - OMX_VIDEO_CodingAutoDetect, /**< Autodetection of coding type */ - OMX_VIDEO_CodingMPEG2, /**< AKA: H.262 */ - OMX_VIDEO_CodingH263, /**< H.263 */ - OMX_VIDEO_CodingMPEG4, /**< MPEG-4 */ - OMX_VIDEO_CodingWMV, /**< all versions of Windows Media Video */ - OMX_VIDEO_CodingRV, /**< all versions of Real Video */ - OMX_VIDEO_CodingAVC, /**< H.264/AVC */ - OMX_VIDEO_CodingMJPEG, /**< Motion JPEG */ - OMX_VIDEO_CodingVP8, /**< Google VP8, formerly known as On2 VP8 */ - OMX_VIDEO_CodingVP9, /**< Google VP9 */ - OMX_VIDEO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_CodingMax = 0x7FFFFFFF -} OMX_VIDEO_CODINGTYPE; - - -/** - * Data structure used to define a video path. The number of Video paths for - * input and output will vary by type of the Video component. - * - * Input (aka Source) : zero Inputs, one Output, - * Splitter : one Input, 2 or more Outputs, - * Processing Element : one Input, one output, - * Mixer : 2 or more inputs, one output, - * Output (aka Sink) : one Input, zero outputs. - * - * The PortDefinition structure is used to define all of the parameters - * necessary for the compliant component to setup an input or an output video - * path. If additional vendor specific data is required, it should be - * transmitted to the component using the CustomCommand function. Compliant - * components will prepopulate this structure with optimal values during the - * GetDefaultInitParams command. - * - * STRUCT MEMBERS: - * cMIMEType : MIME type of data for the port - * pNativeRender : Platform specific reference for a display if a - * sync, otherwise this field is 0 - * nFrameWidth : Width of frame to be used on channel if - * uncompressed format is used. Use 0 for unknown, - * don't care or variable - * nFrameHeight : Height of frame to be used on channel if - * uncompressed format is used. Use 0 for unknown, - * don't care or variable - * nStride : Number of bytes per span of an image - * (i.e. indicates the number of bytes to get - * from span N to span N+1, where negative stride - * indicates the image is bottom up - * nSliceHeight : Height used when encoding in slices - * nBitrate : Bit rate of frame to be used on channel if - * compressed format is used. Use 0 for unknown, - * don't care or variable - * xFramerate : Frame rate to be used on channel if uncompressed - * format is used. Use 0 for unknown, don't care or - * variable. Units are Q16 frames per second. - * bFlagErrorConcealment : Turns on error concealment if it is supported by - * the OMX component - * eCompressionFormat : Compression format used in this instance of the - * component. When OMX_VIDEO_CodingUnused is - * specified, eColorFormat is used - * eColorFormat : Decompressed format used by this component - * pNativeWindow : Platform specific reference for a window object if a - * display sink , otherwise this field is 0x0. - */ -typedef struct OMX_VIDEO_PORTDEFINITIONTYPE { - OMX_STRING cMIMEType; - OMX_NATIVE_DEVICETYPE pNativeRender; - OMX_U32 nFrameWidth; - OMX_U32 nFrameHeight; - OMX_S32 nStride; - OMX_U32 nSliceHeight; - OMX_U32 nBitrate; - OMX_U32 xFramerate; - OMX_BOOL bFlagErrorConcealment; - OMX_VIDEO_CODINGTYPE eCompressionFormat; - OMX_COLOR_FORMATTYPE eColorFormat; - OMX_NATIVE_WINDOWTYPE pNativeWindow; -} OMX_VIDEO_PORTDEFINITIONTYPE; - -/** - * Port format parameter. This structure is used to enumerate the various - * data input/output format supported by the port. - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Indicates which port to set - * nIndex : Indicates the enumeration index for the format from - * 0x0 to N-1 - * eCompressionFormat : Compression format used in this instance of the - * component. When OMX_VIDEO_CodingUnused is specified, - * eColorFormat is used - * eColorFormat : Decompressed format used by this component - * xFrameRate : Indicates the video frame rate in Q16 format - */ -typedef struct OMX_VIDEO_PARAM_PORTFORMATTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nIndex; - OMX_VIDEO_CODINGTYPE eCompressionFormat; - OMX_COLOR_FORMATTYPE eColorFormat; - OMX_U32 xFramerate; -} OMX_VIDEO_PARAM_PORTFORMATTYPE; - - -/** - * This is a structure for configuring video compression quantization - * parameter values. Codecs may support different QP values for different - * frame types. - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version info - * nPortIndex : Port that this structure applies to - * nQpI : QP value to use for index frames - * nQpP : QP value to use for P frames - * nQpB : QP values to use for bidirectional frames - */ -typedef struct OMX_VIDEO_PARAM_QUANTIZATIONTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nQpI; - OMX_U32 nQpP; - OMX_U32 nQpB; -} OMX_VIDEO_PARAM_QUANTIZATIONTYPE; - - -/** - * Structure for configuration of video fast update parameters. - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version info - * nPortIndex : Port that this structure applies to - * bEnableVFU : Enable/Disable video fast update - * nFirstGOB : Specifies the number of the first macroblock row - * nFirstMB : specifies the first MB relative to the specified first GOB - * nNumMBs : Specifies the number of MBs to be refreshed from nFirstGOB - * and nFirstMB - */ -typedef struct OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL bEnableVFU; - OMX_U32 nFirstGOB; - OMX_U32 nFirstMB; - OMX_U32 nNumMBs; -} OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE; - - -/** - * Enumeration of possible bitrate control types - */ -typedef enum OMX_VIDEO_CONTROLRATETYPE { - OMX_Video_ControlRateDisable, - OMX_Video_ControlRateVariable, - OMX_Video_ControlRateConstant, - OMX_Video_ControlRateVariableSkipFrames, - OMX_Video_ControlRateConstantSkipFrames, - OMX_Video_ControlRateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_Video_ControlRateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_Video_ControlRateMax = 0x7FFFFFFF -} OMX_VIDEO_CONTROLRATETYPE; - - -/** - * Structure for configuring bitrate mode of a codec. - * - * STRUCT MEMBERS: - * nSize : Size of the struct in bytes - * nVersion : OMX spec version info - * nPortIndex : Port that this struct applies to - * eControlRate : Control rate type enum - * nTargetBitrate : Target bitrate to encode with - */ -typedef struct OMX_VIDEO_PARAM_BITRATETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_VIDEO_CONTROLRATETYPE eControlRate; - OMX_U32 nTargetBitrate; -} OMX_VIDEO_PARAM_BITRATETYPE; - - -/** - * Enumeration of possible motion vector (MV) types - */ -typedef enum OMX_VIDEO_MOTIONVECTORTYPE { - OMX_Video_MotionVectorPixel, - OMX_Video_MotionVectorHalfPel, - OMX_Video_MotionVectorQuarterPel, - OMX_Video_MotionVectorEighthPel, - OMX_Video_MotionVectorKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_Video_MotionVectorVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_Video_MotionVectorMax = 0x7FFFFFFF -} OMX_VIDEO_MOTIONVECTORTYPE; - - -/** - * Structure for configuring the number of motion vectors used as well - * as their accuracy. - * - * STRUCT MEMBERS: - * nSize : Size of the struct in bytes - * nVersion : OMX spec version info - * nPortIndex : port that this structure applies to - * eAccuracy : Enumerated MV accuracy - * bUnrestrictedMVs : Allow unrestricted MVs - * bFourMV : Allow use of 4 MVs - * sXSearchRange : Search range in horizontal direction for MVs - * sYSearchRange : Search range in vertical direction for MVs - */ -typedef struct OMX_VIDEO_PARAM_MOTIONVECTORTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_VIDEO_MOTIONVECTORTYPE eAccuracy; - OMX_BOOL bUnrestrictedMVs; - OMX_BOOL bFourMV; - OMX_S32 sXSearchRange; - OMX_S32 sYSearchRange; -} OMX_VIDEO_PARAM_MOTIONVECTORTYPE; - - -/** - * Enumeration of possible methods to use for Intra Refresh - */ -typedef enum OMX_VIDEO_INTRAREFRESHTYPE { - OMX_VIDEO_IntraRefreshCyclic, - OMX_VIDEO_IntraRefreshAdaptive, - OMX_VIDEO_IntraRefreshBoth, - OMX_VIDEO_IntraRefreshKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_IntraRefreshVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_IntraRefreshMax = 0x7FFFFFFF -} OMX_VIDEO_INTRAREFRESHTYPE; - - -/** - * Structure for configuring intra refresh mode - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eRefreshMode : Cyclic, Adaptive, or Both - * nAirMBs : Number of intra macroblocks to refresh in a frame when - * AIR is enabled - * nAirRef : Number of times a motion marked macroblock has to be - * intra coded - * nCirMBs : Number of consecutive macroblocks to be coded as "intra" - * when CIR is enabled - */ -typedef struct OMX_VIDEO_PARAM_INTRAREFRESHTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_VIDEO_INTRAREFRESHTYPE eRefreshMode; - OMX_U32 nAirMBs; - OMX_U32 nAirRef; - OMX_U32 nCirMBs; -} OMX_VIDEO_PARAM_INTRAREFRESHTYPE; - - -/** - * Structure for enabling various error correction methods for video - * compression. - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * bEnableHEC : Enable/disable header extension codes (HEC) - * bEnableResync : Enable/disable resynchronization markers - * nResynchMarkerSpacing : Resynch markers interval (in bits) to be - * applied in the stream - * bEnableDataPartitioning : Enable/disable data partitioning - * bEnableRVLC : Enable/disable reversible variable length - * coding - */ -typedef struct OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL bEnableHEC; - OMX_BOOL bEnableResync; - OMX_U32 nResynchMarkerSpacing; - OMX_BOOL bEnableDataPartitioning; - OMX_BOOL bEnableRVLC; -} OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE; - - -/** - * Configuration of variable block-size motion compensation (VBSMC) - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * b16x16 : Enable inter block search 16x16 - * b16x8 : Enable inter block search 16x8 - * b8x16 : Enable inter block search 8x16 - * b8x8 : Enable inter block search 8x8 - * b8x4 : Enable inter block search 8x4 - * b4x8 : Enable inter block search 4x8 - * b4x4 : Enable inter block search 4x4 - */ -typedef struct OMX_VIDEO_PARAM_VBSMCTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL b16x16; - OMX_BOOL b16x8; - OMX_BOOL b8x16; - OMX_BOOL b8x8; - OMX_BOOL b8x4; - OMX_BOOL b4x8; - OMX_BOOL b4x4; -} OMX_VIDEO_PARAM_VBSMCTYPE; - - -/** - * H.263 profile types, each profile indicates support for various - * performance bounds and different annexes. - * - * ENUMS: - * Baseline : Baseline Profile: H.263 (V1), no optional modes - * H320 Coding : H.320 Coding Efficiency Backward Compatibility - * Profile: H.263+ (V2), includes annexes I, J, L.4 - * and T - * BackwardCompatible : Backward Compatibility Profile: H.263 (V1), - * includes annex F - * ISWV2 : Interactive Streaming Wireless Profile: H.263+ - * (V2), includes annexes I, J, K and T - * ISWV3 : Interactive Streaming Wireless Profile: H.263++ - * (V3), includes profile 3 and annexes V and W.6.3.8 - * HighCompression : Conversational High Compression Profile: H.263++ - * (V3), includes profiles 1 & 2 and annexes D and U - * Internet : Conversational Internet Profile: H.263++ (V3), - * includes profile 5 and annex K - * Interlace : Conversational Interlace Profile: H.263++ (V3), - * includes profile 5 and annex W.6.3.11 - * HighLatency : High Latency Profile: H.263++ (V3), includes - * profile 6 and annexes O.1 and P.5 - */ -typedef enum OMX_VIDEO_H263PROFILETYPE { - OMX_VIDEO_H263ProfileBaseline = 0x01, - OMX_VIDEO_H263ProfileH320Coding = 0x02, - OMX_VIDEO_H263ProfileBackwardCompatible = 0x04, - OMX_VIDEO_H263ProfileISWV2 = 0x08, - OMX_VIDEO_H263ProfileISWV3 = 0x10, - OMX_VIDEO_H263ProfileHighCompression = 0x20, - OMX_VIDEO_H263ProfileInternet = 0x40, - OMX_VIDEO_H263ProfileInterlace = 0x80, - OMX_VIDEO_H263ProfileHighLatency = 0x100, - OMX_VIDEO_H263ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_H263ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_H263ProfileMax = 0x7FFFFFFF -} OMX_VIDEO_H263PROFILETYPE; - - -/** - * H.263 level types, each level indicates support for various frame sizes, - * bit rates, decoder frame rates. - */ -typedef enum OMX_VIDEO_H263LEVELTYPE { - OMX_VIDEO_H263Level10 = 0x01, - OMX_VIDEO_H263Level20 = 0x02, - OMX_VIDEO_H263Level30 = 0x04, - OMX_VIDEO_H263Level40 = 0x08, - OMX_VIDEO_H263Level45 = 0x10, - OMX_VIDEO_H263Level50 = 0x20, - OMX_VIDEO_H263Level60 = 0x40, - OMX_VIDEO_H263Level70 = 0x80, - OMX_VIDEO_H263LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_H263LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_H263LevelMax = 0x7FFFFFFF -} OMX_VIDEO_H263LEVELTYPE; - - -/** - * Specifies the picture type. These values should be OR'd to signal all - * pictures types which are allowed. - * - * ENUMS: - * Generic Picture Types: I, P and B - * H.263 Specific Picture Types: SI and SP - * H.264 Specific Picture Types: EI and EP - * MPEG-4 Specific Picture Types: S - */ -typedef enum OMX_VIDEO_PICTURETYPE { - OMX_VIDEO_PictureTypeI = 0x01, - OMX_VIDEO_PictureTypeP = 0x02, - OMX_VIDEO_PictureTypeB = 0x04, - OMX_VIDEO_PictureTypeSI = 0x08, - OMX_VIDEO_PictureTypeSP = 0x10, - OMX_VIDEO_PictureTypeEI = 0x11, - OMX_VIDEO_PictureTypeEP = 0x12, - OMX_VIDEO_PictureTypeS = 0x14, - OMX_VIDEO_PictureTypeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_PictureTypeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_PictureTypeMax = 0x7FFFFFFF -} OMX_VIDEO_PICTURETYPE; - - -/** - * H.263 Params - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nPFrames : Number of P frames between each I frame - * nBFrames : Number of B frames between each I frame - * eProfile : H.263 profile(s) to use - * eLevel : H.263 level(s) to use - * bPLUSPTYPEAllowed : Indicating that it is allowed to use PLUSPTYPE - * (specified in the 1998 version of H.263) to - * indicate custom picture sizes or clock - * frequencies - * nAllowedPictureTypes : Specifies the picture types allowed in the - * bitstream - * bForceRoundingTypeToZero : value of the RTYPE bit (bit 6 of MPPTYPE) is - * not constrained. It is recommended to change - * the value of the RTYPE bit for each reference - * picture in error-free communication - * nPictureHeaderRepetition : Specifies the frequency of picture header - * repetition - * nGOBHeaderInterval : Specifies the interval of non-empty GOB - * headers in units of GOBs - */ -typedef struct OMX_VIDEO_PARAM_H263TYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nPFrames; - OMX_U32 nBFrames; - OMX_VIDEO_H263PROFILETYPE eProfile; - OMX_VIDEO_H263LEVELTYPE eLevel; - OMX_BOOL bPLUSPTYPEAllowed; - OMX_U32 nAllowedPictureTypes; - OMX_BOOL bForceRoundingTypeToZero; - OMX_U32 nPictureHeaderRepetition; - OMX_U32 nGOBHeaderInterval; -} OMX_VIDEO_PARAM_H263TYPE; - - -/** - * MPEG-2 profile types, each profile indicates support for various - * performance bounds and different annexes. - */ -typedef enum OMX_VIDEO_MPEG2PROFILETYPE { - OMX_VIDEO_MPEG2ProfileSimple = 0, /**< Simple Profile */ - OMX_VIDEO_MPEG2ProfileMain, /**< Main Profile */ - OMX_VIDEO_MPEG2Profile422, /**< 4:2:2 Profile */ - OMX_VIDEO_MPEG2ProfileSNR, /**< SNR Profile */ - OMX_VIDEO_MPEG2ProfileSpatial, /**< Spatial Profile */ - OMX_VIDEO_MPEG2ProfileHigh, /**< High Profile */ - OMX_VIDEO_MPEG2ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_MPEG2ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_MPEG2ProfileMax = 0x7FFFFFFF -} OMX_VIDEO_MPEG2PROFILETYPE; - - -/** - * MPEG-2 level types, each level indicates support for various frame - * sizes, bit rates, decoder frame rates. No need - */ -typedef enum OMX_VIDEO_MPEG2LEVELTYPE { - OMX_VIDEO_MPEG2LevelLL = 0, /**< Low Level */ - OMX_VIDEO_MPEG2LevelML, /**< Main Level */ - OMX_VIDEO_MPEG2LevelH14, /**< High 1440 */ - OMX_VIDEO_MPEG2LevelHL, /**< High Level */ - OMX_VIDEO_MPEG2LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_MPEG2LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_MPEG2LevelMax = 0x7FFFFFFF -} OMX_VIDEO_MPEG2LEVELTYPE; - - -/** - * MPEG-2 params - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nPFrames : Number of P frames between each I frame - * nBFrames : Number of B frames between each I frame - * eProfile : MPEG-2 profile(s) to use - * eLevel : MPEG-2 levels(s) to use - */ -typedef struct OMX_VIDEO_PARAM_MPEG2TYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nPFrames; - OMX_U32 nBFrames; - OMX_VIDEO_MPEG2PROFILETYPE eProfile; - OMX_VIDEO_MPEG2LEVELTYPE eLevel; -} OMX_VIDEO_PARAM_MPEG2TYPE; - - -/** - * MPEG-4 profile types, each profile indicates support for various - * performance bounds and different annexes. - * - * ENUMS: - * - Simple Profile, Levels 1-3 - * - Simple Scalable Profile, Levels 1-2 - * - Core Profile, Levels 1-2 - * - Main Profile, Levels 2-4 - * - N-bit Profile, Level 2 - * - Scalable Texture Profile, Level 1 - * - Simple Face Animation Profile, Levels 1-2 - * - Simple Face and Body Animation (FBA) Profile, Levels 1-2 - * - Basic Animated Texture Profile, Levels 1-2 - * - Hybrid Profile, Levels 1-2 - * - Advanced Real Time Simple Profiles, Levels 1-4 - * - Core Scalable Profile, Levels 1-3 - * - Advanced Coding Efficiency Profile, Levels 1-4 - * - Advanced Core Profile, Levels 1-2 - * - Advanced Scalable Texture, Levels 2-3 - */ -typedef enum OMX_VIDEO_MPEG4PROFILETYPE { - OMX_VIDEO_MPEG4ProfileSimple = 0x01, - OMX_VIDEO_MPEG4ProfileSimpleScalable = 0x02, - OMX_VIDEO_MPEG4ProfileCore = 0x04, - OMX_VIDEO_MPEG4ProfileMain = 0x08, - OMX_VIDEO_MPEG4ProfileNbit = 0x10, - OMX_VIDEO_MPEG4ProfileScalableTexture = 0x20, - OMX_VIDEO_MPEG4ProfileSimpleFace = 0x40, - OMX_VIDEO_MPEG4ProfileSimpleFBA = 0x80, - OMX_VIDEO_MPEG4ProfileBasicAnimated = 0x100, - OMX_VIDEO_MPEG4ProfileHybrid = 0x200, - OMX_VIDEO_MPEG4ProfileAdvancedRealTime = 0x400, - OMX_VIDEO_MPEG4ProfileCoreScalable = 0x800, - OMX_VIDEO_MPEG4ProfileAdvancedCoding = 0x1000, - OMX_VIDEO_MPEG4ProfileAdvancedCore = 0x2000, - OMX_VIDEO_MPEG4ProfileAdvancedScalable = 0x4000, - OMX_VIDEO_MPEG4ProfileAdvancedSimple = 0x8000, - OMX_VIDEO_MPEG4ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_MPEG4ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_MPEG4ProfileMax = 0x7FFFFFFF -} OMX_VIDEO_MPEG4PROFILETYPE; - - -/** - * MPEG-4 level types, each level indicates support for various frame - * sizes, bit rates, decoder frame rates. No need - */ -typedef enum OMX_VIDEO_MPEG4LEVELTYPE { - OMX_VIDEO_MPEG4Level0 = 0x01, /**< Level 0 */ - OMX_VIDEO_MPEG4Level0b = 0x02, /**< Level 0b */ - OMX_VIDEO_MPEG4Level1 = 0x04, /**< Level 1 */ - OMX_VIDEO_MPEG4Level2 = 0x08, /**< Level 2 */ - OMX_VIDEO_MPEG4Level3 = 0x10, /**< Level 3 */ - OMX_VIDEO_MPEG4Level4 = 0x20, /**< Level 4 */ - OMX_VIDEO_MPEG4Level4a = 0x40, /**< Level 4a */ - OMX_VIDEO_MPEG4Level5 = 0x80, /**< Level 5 */ - OMX_VIDEO_MPEG4LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_MPEG4LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_MPEG4LevelMax = 0x7FFFFFFF -} OMX_VIDEO_MPEG4LEVELTYPE; - - -/** - * MPEG-4 configuration. This structure handles configuration options - * which are specific to MPEG4 algorithms - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nSliceHeaderSpacing : Number of macroblocks between slice header (H263+ - * Annex K). Put zero if not used - * bSVH : Enable Short Video Header mode - * bGov : Flag to enable GOV - * nPFrames : Number of P frames between each I frame (also called - * GOV period) - * nBFrames : Number of B frames between each I frame - * nIDCVLCThreshold : Value of intra DC VLC threshold - * bACPred : Flag to use ac prediction - * nMaxPacketSize : Maximum size of packet in bytes. - * nTimeIncRes : Used to pass VOP time increment resolution for MPEG4. - * Interpreted as described in MPEG4 standard. - * eProfile : MPEG-4 profile(s) to use. - * eLevel : MPEG-4 level(s) to use. - * nAllowedPictureTypes : Specifies the picture types allowed in the bitstream - * nHeaderExtension : Specifies the number of consecutive video packet - * headers within a VOP - * bReversibleVLC : Specifies whether reversible variable length coding - * is in use - */ -typedef struct OMX_VIDEO_PARAM_MPEG4TYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nSliceHeaderSpacing; - OMX_BOOL bSVH; - OMX_BOOL bGov; - OMX_U32 nPFrames; - OMX_U32 nBFrames; - OMX_U32 nIDCVLCThreshold; - OMX_BOOL bACPred; - OMX_U32 nMaxPacketSize; - OMX_U32 nTimeIncRes; - OMX_VIDEO_MPEG4PROFILETYPE eProfile; - OMX_VIDEO_MPEG4LEVELTYPE eLevel; - OMX_U32 nAllowedPictureTypes; - OMX_U32 nHeaderExtension; - OMX_BOOL bReversibleVLC; -} OMX_VIDEO_PARAM_MPEG4TYPE; - - -/** - * WMV Versions - */ -typedef enum OMX_VIDEO_WMVFORMATTYPE { - OMX_VIDEO_WMVFormatUnused = 0x01, /**< Format unused or unknown */ - OMX_VIDEO_WMVFormat7 = 0x02, /**< Windows Media Video format 7 */ - OMX_VIDEO_WMVFormat8 = 0x04, /**< Windows Media Video format 8 */ - OMX_VIDEO_WMVFormat9 = 0x08, /**< Windows Media Video format 9 */ - OMX_VIDEO_WMFFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_WMFFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_WMVFormatMax = 0x7FFFFFFF -} OMX_VIDEO_WMVFORMATTYPE; - - -/** - * WMV Params - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eFormat : Version of WMV stream / data - */ -typedef struct OMX_VIDEO_PARAM_WMVTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_VIDEO_WMVFORMATTYPE eFormat; -} OMX_VIDEO_PARAM_WMVTYPE; - - -/** - * Real Video Version - */ -typedef enum OMX_VIDEO_RVFORMATTYPE { - OMX_VIDEO_RVFormatUnused = 0, /**< Format unused or unknown */ - OMX_VIDEO_RVFormat8, /**< Real Video format 8 */ - OMX_VIDEO_RVFormat9, /**< Real Video format 9 */ - OMX_VIDEO_RVFormatG2, /**< Real Video Format G2 */ - OMX_VIDEO_RVFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_RVFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_RVFormatMax = 0x7FFFFFFF -} OMX_VIDEO_RVFORMATTYPE; - - -/** - * Real Video Params - * - * STUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eFormat : Version of RV stream / data - * nBitsPerPixel : Bits per pixel coded in the frame - * nPaddedWidth : Padded width in pixel of a video frame - * nPaddedHeight : Padded Height in pixels of a video frame - * nFrameRate : Rate of video in frames per second - * nBitstreamFlags : Flags which internal information about the bitstream - * nBitstreamVersion : Bitstream version - * nMaxEncodeFrameSize: Max encoded frame size - * bEnablePostFilter : Turn on/off post filter - * bEnableTemporalInterpolation : Turn on/off temporal interpolation - * bEnableLatencyMode : When enabled, the decoder does not display a decoded - * frame until it has detected that no enhancement layer - * frames or dependent B frames will be coming. This - * detection usually occurs when a subsequent non-B - * frame is encountered - */ -typedef struct OMX_VIDEO_PARAM_RVTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_VIDEO_RVFORMATTYPE eFormat; - OMX_U16 nBitsPerPixel; - OMX_U16 nPaddedWidth; - OMX_U16 nPaddedHeight; - OMX_U32 nFrameRate; - OMX_U32 nBitstreamFlags; - OMX_U32 nBitstreamVersion; - OMX_U32 nMaxEncodeFrameSize; - OMX_BOOL bEnablePostFilter; - OMX_BOOL bEnableTemporalInterpolation; - OMX_BOOL bEnableLatencyMode; -} OMX_VIDEO_PARAM_RVTYPE; - - -/** - * AVC profile types, each profile indicates support for various - * performance bounds and different annexes. - */ -typedef enum OMX_VIDEO_AVCPROFILETYPE { - OMX_VIDEO_AVCProfileBaseline = 0x01, /**< Baseline profile */ - OMX_VIDEO_AVCProfileMain = 0x02, /**< Main profile */ - OMX_VIDEO_AVCProfileExtended = 0x04, /**< Extended profile */ - OMX_VIDEO_AVCProfileHigh = 0x08, /**< High profile */ - OMX_VIDEO_AVCProfileHigh10 = 0x10, /**< High 10 profile */ - OMX_VIDEO_AVCProfileHigh422 = 0x20, /**< High 4:2:2 profile */ - OMX_VIDEO_AVCProfileHigh444 = 0x40, /**< High 4:4:4 profile */ - OMX_VIDEO_AVCProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_AVCProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_AVCProfileMax = 0x7FFFFFFF -} OMX_VIDEO_AVCPROFILETYPE; - - -/** - * AVC level types, each level indicates support for various frame sizes, - * bit rates, decoder frame rates. No need - */ -typedef enum OMX_VIDEO_AVCLEVELTYPE { - OMX_VIDEO_AVCLevel1 = 0x01, /**< Level 1 */ - OMX_VIDEO_AVCLevel1b = 0x02, /**< Level 1b */ - OMX_VIDEO_AVCLevel11 = 0x04, /**< Level 1.1 */ - OMX_VIDEO_AVCLevel12 = 0x08, /**< Level 1.2 */ - OMX_VIDEO_AVCLevel13 = 0x10, /**< Level 1.3 */ - OMX_VIDEO_AVCLevel2 = 0x20, /**< Level 2 */ - OMX_VIDEO_AVCLevel21 = 0x40, /**< Level 2.1 */ - OMX_VIDEO_AVCLevel22 = 0x80, /**< Level 2.2 */ - OMX_VIDEO_AVCLevel3 = 0x100, /**< Level 3 */ - OMX_VIDEO_AVCLevel31 = 0x200, /**< Level 3.1 */ - OMX_VIDEO_AVCLevel32 = 0x400, /**< Level 3.2 */ - OMX_VIDEO_AVCLevel4 = 0x800, /**< Level 4 */ - OMX_VIDEO_AVCLevel41 = 0x1000, /**< Level 4.1 */ - OMX_VIDEO_AVCLevel42 = 0x2000, /**< Level 4.2 */ - OMX_VIDEO_AVCLevel5 = 0x4000, /**< Level 5 */ - OMX_VIDEO_AVCLevel51 = 0x8000, /**< Level 5.1 */ - OMX_VIDEO_AVCLevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_AVCLevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_AVCLevelMax = 0x7FFFFFFF -} OMX_VIDEO_AVCLEVELTYPE; - - -/** - * AVC loop filter modes - * - * OMX_VIDEO_AVCLoopFilterEnable : Enable - * OMX_VIDEO_AVCLoopFilterDisable : Disable - * OMX_VIDEO_AVCLoopFilterDisableSliceBoundary : Disabled on slice boundaries - */ -typedef enum OMX_VIDEO_AVCLOOPFILTERTYPE { - OMX_VIDEO_AVCLoopFilterEnable = 0, - OMX_VIDEO_AVCLoopFilterDisable, - OMX_VIDEO_AVCLoopFilterDisableSliceBoundary, - OMX_VIDEO_AVCLoopFilterKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_AVCLoopFilterVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_AVCLoopFilterMax = 0x7FFFFFFF -} OMX_VIDEO_AVCLOOPFILTERTYPE; - - -/** - * AVC params - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nSliceHeaderSpacing : Number of macroblocks between slice header, put - * zero if not used - * nPFrames : Number of P frames between each I frame - * nBFrames : Number of B frames between each I frame - * bUseHadamard : Enable/disable Hadamard transform - * nRefFrames : Max number of reference frames to use for inter - * motion search (1-16) - * nRefIdxTrailing : Pic param set ref frame index (index into ref - * frame buffer of trailing frames list), B frame - * support - * nRefIdxForward : Pic param set ref frame index (index into ref - * frame buffer of forward frames list), B frame - * support - * bEnableUEP : Enable/disable unequal error protection. This - * is only valid of data partitioning is enabled. - * bEnableFMO : Enable/disable flexible macroblock ordering - * bEnableASO : Enable/disable arbitrary slice ordering - * bEnableRS : Enable/disable sending of redundant slices - * eProfile : AVC profile(s) to use - * eLevel : AVC level(s) to use - * nAllowedPictureTypes : Specifies the picture types allowed in the - * bitstream - * bFrameMBsOnly : specifies that every coded picture of the - * coded video sequence is a coded frame - * containing only frame macroblocks - * bMBAFF : Enable/disable switching between frame and - * field macroblocks within a picture - * bEntropyCodingCABAC : Entropy decoding method to be applied for the - * syntax elements for which two descriptors appear - * in the syntax tables - * bWeightedPPrediction : Enable/disable weighted prediction shall not - * be applied to P and SP slices - * nWeightedBipredicitonMode : Default weighted prediction is applied to B - * slices - * bconstIpred : Enable/disable intra prediction - * bDirect8x8Inference : Specifies the method used in the derivation - * process for luma motion vectors for B_Skip, - * B_Direct_16x16 and B_Direct_8x8 as specified - * in subclause 8.4.1.2 of the AVC spec - * bDirectSpatialTemporal : Flag indicating spatial or temporal direct - * mode used in B slice coding (related to - * bDirect8x8Inference) . Spatial direct mode is - * more common and should be the default. - * nCabacInitIdx : Index used to init CABAC contexts - * eLoopFilterMode : Enable/disable loop filter - */ -typedef struct OMX_VIDEO_PARAM_AVCTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nSliceHeaderSpacing; - OMX_U32 nPFrames; - OMX_U32 nBFrames; - OMX_BOOL bUseHadamard; - OMX_U32 nRefFrames; - OMX_U32 nRefIdx10ActiveMinus1; - OMX_U32 nRefIdx11ActiveMinus1; - OMX_BOOL bEnableUEP; - OMX_BOOL bEnableFMO; - OMX_BOOL bEnableASO; - OMX_BOOL bEnableRS; - OMX_VIDEO_AVCPROFILETYPE eProfile; - OMX_VIDEO_AVCLEVELTYPE eLevel; - OMX_U32 nAllowedPictureTypes; - OMX_BOOL bFrameMBsOnly; - OMX_BOOL bMBAFF; - OMX_BOOL bEntropyCodingCABAC; - OMX_BOOL bWeightedPPrediction; - OMX_U32 nWeightedBipredicitonMode; - OMX_BOOL bconstIpred ; - OMX_BOOL bDirect8x8Inference; - OMX_BOOL bDirectSpatialTemporal; - OMX_U32 nCabacInitIdc; - OMX_VIDEO_AVCLOOPFILTERTYPE eLoopFilterMode; -} OMX_VIDEO_PARAM_AVCTYPE; - -typedef struct OMX_VIDEO_PARAM_PROFILELEVELTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 eProfile; /**< type is OMX_VIDEO_AVCPROFILETYPE, OMX_VIDEO_H263PROFILETYPE, - or OMX_VIDEO_MPEG4PROFILETYPE depending on context */ - OMX_U32 eLevel; /**< type is OMX_VIDEO_AVCLEVELTYPE, OMX_VIDEO_H263LEVELTYPE, - or OMX_VIDEO_MPEG4PROFILETYPE depending on context */ - OMX_U32 nProfileIndex; /**< Used to query for individual profile support information, - This parameter is valid only for - OMX_IndexParamVideoProfileLevelQuerySupported index, - For all other indices this parameter is to be ignored. */ -} OMX_VIDEO_PARAM_PROFILELEVELTYPE; - -/** - * Structure for dynamically configuring bitrate mode of a codec. - * - * STRUCT MEMBERS: - * nSize : Size of the struct in bytes - * nVersion : OMX spec version info - * nPortIndex : Port that this struct applies to - * nEncodeBitrate : Target average bitrate to be generated in bps - */ -typedef struct OMX_VIDEO_CONFIG_BITRATETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nEncodeBitrate; -} OMX_VIDEO_CONFIG_BITRATETYPE; - -/** - * Defines Encoder Frame Rate setting - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * xEncodeFramerate : Encoding framerate represented in Q16 format - */ -typedef struct OMX_CONFIG_FRAMERATETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 xEncodeFramerate; /* Q16 format */ -} OMX_CONFIG_FRAMERATETYPE; - -typedef struct OMX_CONFIG_INTRAREFRESHVOPTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL IntraRefreshVOP; -} OMX_CONFIG_INTRAREFRESHVOPTYPE; - -typedef struct OMX_CONFIG_MACROBLOCKERRORMAPTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nErrMapSize; /* Size of the Error Map in bytes */ - OMX_U8 ErrMap[1]; /* Error map hint */ -} OMX_CONFIG_MACROBLOCKERRORMAPTYPE; - -typedef struct OMX_CONFIG_MBERRORREPORTINGTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL bEnabled; -} OMX_CONFIG_MBERRORREPORTINGTYPE; - -typedef struct OMX_PARAM_MACROBLOCKSTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nMacroblocks; -} OMX_PARAM_MACROBLOCKSTYPE; - -/** - * AVC Slice Mode modes - * - * OMX_VIDEO_SLICEMODE_AVCDefault : Normal frame encoding, one slice per frame - * OMX_VIDEO_SLICEMODE_AVCMBSlice : NAL mode, number of MBs per frame - * OMX_VIDEO_SLICEMODE_AVCByteSlice : NAL mode, number of bytes per frame - */ -typedef enum OMX_VIDEO_AVCSLICEMODETYPE { - OMX_VIDEO_SLICEMODE_AVCDefault = 0, - OMX_VIDEO_SLICEMODE_AVCMBSlice, - OMX_VIDEO_SLICEMODE_AVCByteSlice, - OMX_VIDEO_SLICEMODE_AVCKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ - OMX_VIDEO_SLICEMODE_AVCVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_VIDEO_SLICEMODE_AVCLevelMax = 0x7FFFFFFF -} OMX_VIDEO_AVCSLICEMODETYPE; - -/** - * AVC FMO Slice Mode Params - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nNumSliceGroups : Specifies the number of slice groups - * nSliceGroupMapType : Specifies the type of slice groups - * eSliceMode : Specifies the type of slice - */ -typedef struct OMX_VIDEO_PARAM_AVCSLICEFMO { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U8 nNumSliceGroups; - OMX_U8 nSliceGroupMapType; - OMX_VIDEO_AVCSLICEMODETYPE eSliceMode; -} OMX_VIDEO_PARAM_AVCSLICEFMO; - -/** - * AVC IDR Period Configs - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nIDRPeriod : Specifies periodicity of IDR frames - * nPFrames : Specifies internal of coding Intra frames - */ -typedef struct OMX_VIDEO_CONFIG_AVCINTRAPERIOD { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nIDRPeriod; - OMX_U32 nPFrames; -} OMX_VIDEO_CONFIG_AVCINTRAPERIOD; - -/** - * AVC NAL Size Configs - * - * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * nNaluBytes : Specifies the NAL unit size - */ -typedef struct OMX_VIDEO_CONFIG_NALSIZE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_U32 nNaluBytes; -} OMX_VIDEO_CONFIG_NALSIZE; - -/** @} */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif -/* File EOF */ - diff --git a/external/android/include/19/frameworks/native/include/media/openmax/OMX_VideoExt.h b/external/android/include/19/frameworks/native/include/media/openmax/OMX_VideoExt.h deleted file mode 100644 index fa24168..0000000 --- a/external/android/include/19/frameworks/native/include/media/openmax/OMX_VideoExt.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2010 The Khronos Group Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - */ - -/** OMX_VideoExt.h - OpenMax IL version 1.1.2 - * The OMX_VideoExt header file contains extensions to the - * definitions used by both the application and the component to - * access video items. - */ - -#ifndef OMX_VideoExt_h -#define OMX_VideoExt_h - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* Each OMX header shall include all required header files to allow the - * header to compile without errors. The includes below are required - * for this header file to compile successfully - */ -#include - -/** NALU Formats */ -typedef enum OMX_NALUFORMATSTYPE { - OMX_NaluFormatStartCodes = 1, - OMX_NaluFormatOneNaluPerBuffer = 2, - OMX_NaluFormatOneByteInterleaveLength = 4, - OMX_NaluFormatTwoByteInterleaveLength = 8, - OMX_NaluFormatFourByteInterleaveLength = 16, - OMX_NaluFormatCodingMax = 0x7FFFFFFF -} OMX_NALUFORMATSTYPE; - -/** NAL Stream Format */ -typedef struct OMX_NALSTREAMFORMATTYPE{ - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_NALUFORMATSTYPE eNaluFormat; -} OMX_NALSTREAMFORMATTYPE; - -/** VP8 profiles */ -typedef enum OMX_VIDEO_VP8PROFILETYPE { - OMX_VIDEO_VP8ProfileMain = 0x01, - OMX_VIDEO_VP8ProfileUnknown = 0x6EFFFFFF, - OMX_VIDEO_VP8ProfileMax = 0x7FFFFFFF -} OMX_VIDEO_VP8PROFILETYPE; - -/** VP8 levels */ -typedef enum OMX_VIDEO_VP8LEVELTYPE { - OMX_VIDEO_VP8Level_Version0 = 0x01, - OMX_VIDEO_VP8Level_Version1 = 0x02, - OMX_VIDEO_VP8Level_Version2 = 0x04, - OMX_VIDEO_VP8Level_Version3 = 0x08, - OMX_VIDEO_VP8LevelUnknown = 0x6EFFFFFF, - OMX_VIDEO_VP8LevelMax = 0x7FFFFFFF -} OMX_VIDEO_VP8LEVELTYPE; - -/** VP8 Param */ -typedef struct OMX_VIDEO_PARAM_VP8TYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_VIDEO_VP8PROFILETYPE eProfile; - OMX_VIDEO_VP8LEVELTYPE eLevel; - OMX_U32 nDCTPartitions; - OMX_BOOL bErrorResilientMode; -} OMX_VIDEO_PARAM_VP8TYPE; - -/** Structure for configuring VP8 reference frames */ -typedef struct OMX_VIDEO_VP8REFERENCEFRAMETYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL bPreviousFrameRefresh; - OMX_BOOL bGoldenFrameRefresh; - OMX_BOOL bAlternateFrameRefresh; - OMX_BOOL bUsePreviousFrame; - OMX_BOOL bUseGoldenFrame; - OMX_BOOL bUseAlternateFrame; -} OMX_VIDEO_VP8REFERENCEFRAMETYPE; - -/** Structure for querying VP8 reference frame type */ -typedef struct OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE { - OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; - OMX_U32 nPortIndex; - OMX_BOOL bIsIntraFrame; - OMX_BOOL bIsGoldenOrAlternateFrame; -} OMX_VIDEO_VP8REFERENCEFRAMEINFOTYPE; - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* OMX_VideoExt_h */ -/* File EOF */ diff --git a/external/android/include/19/frameworks/native/include/ui/ANativeObjectBase.h b/external/android/include/19/frameworks/native/include/ui/ANativeObjectBase.h deleted file mode 100644 index 76e850f..0000000 --- a/external/android/include/19/frameworks/native/include/ui/ANativeObjectBase.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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_ANDROID_NATIVES_H -#define ANDROID_ANDROID_NATIVES_H - -#include -#include - -#include -#include - -// --------------------------------------------------------------------------- - -/* FIXME: this is legacy for pixmaps */ -typedef struct egl_native_pixmap_t -{ - int32_t version; /* must be 32 */ - int32_t width; - int32_t height; - int32_t stride; - uint8_t* data; - uint8_t format; - uint8_t rfu[3]; - union { - uint32_t compressedFormat; - int32_t vstride; - }; - int32_t reserved; -} egl_native_pixmap_t; - -/*****************************************************************************/ - -#ifdef __cplusplus - -#include - -namespace android { - -/* - * This helper class turns a ANativeXXX object type into a C++ - * reference-counted object; with proper type conversions. - */ -template -class ANativeObjectBase : public NATIVE_TYPE, public REF -{ -public: - // Disambiguate between the incStrong in REF and NATIVE_TYPE - void incStrong(const void* id) const { - REF::incStrong(id); - } - void decStrong(const void* id) const { - REF::decStrong(id); - } - -protected: - typedef ANativeObjectBase BASE; - ANativeObjectBase() : NATIVE_TYPE(), REF() { - NATIVE_TYPE::common.incRef = incRef; - NATIVE_TYPE::common.decRef = decRef; - } - static inline TYPE* getSelf(NATIVE_TYPE* self) { - return static_cast(self); - } - static inline TYPE const* getSelf(NATIVE_TYPE const* self) { - return static_cast(self); - } - static inline TYPE* getSelf(android_native_base_t* base) { - return getSelf(reinterpret_cast(base)); - } - static inline TYPE const * getSelf(android_native_base_t const* base) { - return getSelf(reinterpret_cast(base)); - } - static void incRef(android_native_base_t* base) { - ANativeObjectBase* self = getSelf(base); - self->incStrong(self); - } - static void decRef(android_native_base_t* base) { - ANativeObjectBase* self = getSelf(base); - self->decStrong(self); - } -}; - -} // namespace android -#endif // __cplusplus - -/*****************************************************************************/ - -#endif /* ANDROID_ANDROID_NATIVES_H */ diff --git a/external/android/include/19/frameworks/native/include/ui/DisplayInfo.h b/external/android/include/19/frameworks/native/include/ui/DisplayInfo.h deleted file mode 100644 index 2853e06..0000000 --- a/external/android/include/19/frameworks/native/include/ui/DisplayInfo.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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_UI_DISPLAY_INFO_H -#define ANDROID_UI_DISPLAY_INFO_H - -#include -#include - -#include - -namespace android { - -struct DisplayInfo { - uint32_t w; - uint32_t h; - float xdpi; - float ydpi; - float fps; - float density; - uint8_t orientation; - bool secure; - uint8_t reserved[2]; -}; - -/* Display orientations as defined in Surface.java and ISurfaceComposer.h. */ -enum { - DISPLAY_ORIENTATION_0 = 0, - DISPLAY_ORIENTATION_90 = 1, - DISPLAY_ORIENTATION_180 = 2, - DISPLAY_ORIENTATION_270 = 3 -}; - -}; // namespace android - -#endif // ANDROID_COMPOSER_DISPLAY_INFO_H diff --git a/external/android/include/19/frameworks/native/include/ui/Fence.h b/external/android/include/19/frameworks/native/include/ui/Fence.h deleted file mode 100644 index 20466b6..0000000 --- a/external/android/include/19/frameworks/native/include/ui/Fence.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (C) 2012 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_FENCE_H -#define ANDROID_FENCE_H - -#include -#include - -#include -#include -#include -#include -#include -#include - -struct ANativeWindowBuffer; - -namespace android { - -// =========================================================================== -// Fence -// =========================================================================== - -class Fence - : public LightRefBase, public Flattenable -{ -public: - static const sp NO_FENCE; - - // TIMEOUT_NEVER may be passed to the wait method to indicate that it - // should wait indefinitely for the fence to signal. - enum { TIMEOUT_NEVER = -1 }; - - // Construct a new Fence object with an invalid file descriptor. This - // should be done when the Fence object will be set up by unflattening - // serialized data. - Fence(); - - // Construct a new Fence object to manage a given fence file descriptor. - // When the new Fence object is destructed the file descriptor will be - // closed. - Fence(int fenceFd); - - // Check whether the Fence has an open fence file descriptor. Most Fence - // methods treat an invalid file descriptor just like a valid fence that - // is already signalled, so using this is usually not necessary. - bool isValid() const { return mFenceFd != -1; } - - // wait waits for up to timeout milliseconds for the fence to signal. If - // the fence signals then NO_ERROR is returned. If the timeout expires - // before the fence signals then -ETIME is returned. A timeout of - // TIMEOUT_NEVER may be used to indicate that the call should wait - // indefinitely for the fence to signal. - status_t wait(unsigned int timeout); - - // waitForever is a convenience function for waiting forever for a fence to - // signal (just like wait(TIMEOUT_NEVER)), but issuing an error to the - // system log and fence state to the kernel log if the wait lasts longer - // than a warning timeout. - // The logname argument should be a string identifying - // the caller and will be included in the log message. - status_t waitForever(const char* logname); - - // merge combines two Fence objects, creating a new Fence object that - // becomes signaled when both f1 and f2 are signaled (even if f1 or f2 is - // destroyed before it becomes signaled). The name argument specifies the - // human-readable name to associated with the new Fence object. - static sp merge(const String8& name, const sp& f1, - const sp& f2); - - // Return a duplicate of the fence file descriptor. The caller is - // responsible for closing the returned file descriptor. On error, -1 will - // be returned and errno will indicate the problem. - int dup() const; - - // getSignalTime returns the system monotonic clock time at which the - // fence transitioned to the signaled state. If the fence is not signaled - // then INT64_MAX is returned. If the fence is invalid or if an error - // occurs then -1 is returned. - nsecs_t getSignalTime() const; - - // Flattenable interface - size_t getFlattenedSize() const; - size_t getFdCount() const; - status_t flatten(void*& buffer, size_t& size, int*& fds, size_t& count) const; - status_t unflatten(void const*& buffer, size_t& size, int const*& fds, size_t& count); - -private: - // Only allow instantiation using ref counting. - friend class LightRefBase; - ~Fence(); - - // Disallow copying - Fence(const Fence& rhs); - Fence& operator = (const Fence& rhs); - const Fence& operator = (const Fence& rhs) const; - - int mFenceFd; -}; - -}; // namespace android - -#endif // ANDROID_FENCE_H diff --git a/external/android/include/19/frameworks/native/include/ui/FramebufferNativeWindow.h b/external/android/include/19/frameworks/native/include/ui/FramebufferNativeWindow.h deleted file mode 100644 index 5ec738f..0000000 --- a/external/android/include/19/frameworks/native/include/ui/FramebufferNativeWindow.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * 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_FRAMEBUFFER_NATIVE_WINDOW_H -#define ANDROID_FRAMEBUFFER_NATIVE_WINDOW_H - -#include -#include - -#include - -#include -#include - -#include -#include - -#define MIN_NUM_FRAME_BUFFERS 2 -#define MAX_NUM_FRAME_BUFFERS 3 - -extern "C" EGLNativeWindowType android_createDisplaySurface(void); - -// --------------------------------------------------------------------------- -namespace android { -// --------------------------------------------------------------------------- - -class Surface; -class NativeBuffer; - -// --------------------------------------------------------------------------- - -class FramebufferNativeWindow - : public ANativeObjectBase< - ANativeWindow, - FramebufferNativeWindow, - LightRefBase > -{ -public: - FramebufferNativeWindow(); - - framebuffer_device_t const * getDevice() const { return fbDev; } - - bool isUpdateOnDemand() const { return mUpdateOnDemand; } - status_t setUpdateRectangle(const Rect& updateRect); - status_t compositionComplete(); - - void dump(String8& result); - - // for debugging only - int getCurrentBufferIndex() const; - -private: - friend class LightRefBase; - ~FramebufferNativeWindow(); // this class cannot be overloaded - static int setSwapInterval(ANativeWindow* window, int interval); - static int dequeueBuffer(ANativeWindow* window, ANativeWindowBuffer** buffer, int* fenceFd); - static int queueBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer, int fenceFd); - static int query(const ANativeWindow* window, int what, int* value); - static int perform(ANativeWindow* window, int operation, ...); - - static int dequeueBuffer_DEPRECATED(ANativeWindow* window, ANativeWindowBuffer** buffer); - static int queueBuffer_DEPRECATED(ANativeWindow* window, ANativeWindowBuffer* buffer); - static int lockBuffer_DEPRECATED(ANativeWindow* window, ANativeWindowBuffer* buffer); - - framebuffer_device_t* fbDev; - alloc_device_t* grDev; - - sp buffers[MAX_NUM_FRAME_BUFFERS]; - sp front; - - mutable Mutex mutex; - Condition mCondition; - int32_t mNumBuffers; - int32_t mNumFreeBuffers; - int32_t mBufferHead; - int32_t mCurrentBufferIndex; - bool mUpdateOnDemand; -}; - -// --------------------------------------------------------------------------- -}; // namespace android -// --------------------------------------------------------------------------- - -#endif // ANDROID_FRAMEBUFFER_NATIVE_WINDOW_H - diff --git a/external/android/include/19/frameworks/native/include/ui/GraphicBuffer.h b/external/android/include/19/frameworks/native/include/ui/GraphicBuffer.h deleted file mode 100644 index 3cf628c..0000000 --- a/external/android/include/19/frameworks/native/include/ui/GraphicBuffer.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - * 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_GRAPHIC_BUFFER_H -#define ANDROID_GRAPHIC_BUFFER_H - -#include -#include - -#include -#include -#include -#include -#include - - -struct ANativeWindowBuffer; - -namespace android { - -class GraphicBufferMapper; - -// =========================================================================== -// GraphicBuffer -// =========================================================================== - -class GraphicBuffer - : public ANativeObjectBase< ANativeWindowBuffer, GraphicBuffer, RefBase >, - public Flattenable -{ - friend class Flattenable; -public: - - enum { - USAGE_SW_READ_NEVER = GRALLOC_USAGE_SW_READ_NEVER, - USAGE_SW_READ_RARELY = GRALLOC_USAGE_SW_READ_RARELY, - USAGE_SW_READ_OFTEN = GRALLOC_USAGE_SW_READ_OFTEN, - USAGE_SW_READ_MASK = GRALLOC_USAGE_SW_READ_MASK, - - USAGE_SW_WRITE_NEVER = GRALLOC_USAGE_SW_WRITE_NEVER, - USAGE_SW_WRITE_RARELY = GRALLOC_USAGE_SW_WRITE_RARELY, - USAGE_SW_WRITE_OFTEN = GRALLOC_USAGE_SW_WRITE_OFTEN, - USAGE_SW_WRITE_MASK = GRALLOC_USAGE_SW_WRITE_MASK, - - USAGE_SOFTWARE_MASK = USAGE_SW_READ_MASK|USAGE_SW_WRITE_MASK, - - USAGE_PROTECTED = GRALLOC_USAGE_PROTECTED, - - USAGE_HW_TEXTURE = GRALLOC_USAGE_HW_TEXTURE, - USAGE_HW_RENDER = GRALLOC_USAGE_HW_RENDER, - USAGE_HW_2D = GRALLOC_USAGE_HW_2D, - USAGE_HW_COMPOSER = GRALLOC_USAGE_HW_COMPOSER, - USAGE_HW_VIDEO_ENCODER = GRALLOC_USAGE_HW_VIDEO_ENCODER, - USAGE_HW_MASK = GRALLOC_USAGE_HW_MASK - }; - - GraphicBuffer(); - - // creates w * h buffer - GraphicBuffer(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage); - - // create a buffer from an existing handle - GraphicBuffer(uint32_t w, uint32_t h, PixelFormat format, uint32_t usage, - uint32_t stride, native_handle_t* handle, bool keepOwnership); - - // create a buffer from an existing ANativeWindowBuffer - GraphicBuffer(ANativeWindowBuffer* buffer, bool keepOwnership); - - // return status - status_t initCheck() const; - - uint32_t getWidth() const { return width; } - uint32_t getHeight() const { return height; } - uint32_t getStride() const { return stride; } - uint32_t getUsage() const { return usage; } - PixelFormat getPixelFormat() const { return format; } - Rect getBounds() const { return Rect(width, height); } - - status_t reallocate(uint32_t w, uint32_t h, PixelFormat f, uint32_t usage); - - status_t lock(uint32_t usage, void** vaddr); - status_t lock(uint32_t usage, const Rect& rect, void** vaddr); - // For HAL_PIXEL_FORMAT_YCbCr_420_888 - status_t lockYCbCr(uint32_t usage, android_ycbcr *ycbcr); - status_t lockYCbCr(uint32_t usage, const Rect& rect, android_ycbcr *ycbcr); - status_t unlock(); - - ANativeWindowBuffer* getNativeBuffer() const; - - // for debugging - static void dumpAllocationsToSystemLog(); - - // Flattenable protocol - size_t getFlattenedSize() const; - size_t getFdCount() const; - status_t flatten(void*& buffer, size_t& size, int*& fds, size_t& count) const; - status_t unflatten(void const*& buffer, size_t& size, int const*& fds, size_t& count); - -private: - ~GraphicBuffer(); - - enum { - ownNone = 0, - ownHandle = 1, - ownData = 2, - }; - - inline const GraphicBufferMapper& getBufferMapper() const { - return mBufferMapper; - } - inline GraphicBufferMapper& getBufferMapper() { - return mBufferMapper; - } - uint8_t mOwner; - -private: - friend class Surface; - friend class BpSurface; - friend class BnSurface; - friend class LightRefBase; - GraphicBuffer(const GraphicBuffer& rhs); - GraphicBuffer& operator = (const GraphicBuffer& rhs); - const GraphicBuffer& operator = (const GraphicBuffer& rhs) const; - - status_t initSize(uint32_t w, uint32_t h, PixelFormat format, - uint32_t usage); - - void free_handle(); - - GraphicBufferMapper& mBufferMapper; - ssize_t mInitCheck; - - // If we're wrapping another buffer then this reference will make sure it - // doesn't get freed. - sp mWrappedBuffer; -}; - -}; // namespace android - -#endif // ANDROID_GRAPHIC_BUFFER_H diff --git a/external/android/include/19/frameworks/native/include/ui/GraphicBufferAllocator.h b/external/android/include/19/frameworks/native/include/ui/GraphicBufferAllocator.h deleted file mode 100644 index dffa788..0000000 --- a/external/android/include/19/frameworks/native/include/ui/GraphicBufferAllocator.h +++ /dev/null @@ -1,96 +0,0 @@ -/* -** -** Copyright 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_BUFFER_ALLOCATOR_H -#define ANDROID_BUFFER_ALLOCATOR_H - -#include - -#include - -#include -#include -#include -#include - -#include - -#include - - -namespace android { -// --------------------------------------------------------------------------- - -class String8; - -class GraphicBufferAllocator : public Singleton -{ -public: - enum { - USAGE_SW_READ_NEVER = GRALLOC_USAGE_SW_READ_NEVER, - USAGE_SW_READ_RARELY = GRALLOC_USAGE_SW_READ_RARELY, - USAGE_SW_READ_OFTEN = GRALLOC_USAGE_SW_READ_OFTEN, - USAGE_SW_READ_MASK = GRALLOC_USAGE_SW_READ_MASK, - - USAGE_SW_WRITE_NEVER = GRALLOC_USAGE_SW_WRITE_NEVER, - USAGE_SW_WRITE_RARELY = GRALLOC_USAGE_SW_WRITE_RARELY, - USAGE_SW_WRITE_OFTEN = GRALLOC_USAGE_SW_WRITE_OFTEN, - USAGE_SW_WRITE_MASK = GRALLOC_USAGE_SW_WRITE_MASK, - - USAGE_SOFTWARE_MASK = USAGE_SW_READ_MASK|USAGE_SW_WRITE_MASK, - - USAGE_HW_TEXTURE = GRALLOC_USAGE_HW_TEXTURE, - USAGE_HW_RENDER = GRALLOC_USAGE_HW_RENDER, - USAGE_HW_2D = GRALLOC_USAGE_HW_2D, - USAGE_HW_MASK = GRALLOC_USAGE_HW_MASK - }; - - static inline GraphicBufferAllocator& get() { return getInstance(); } - - - status_t alloc(uint32_t w, uint32_t h, PixelFormat format, int usage, - buffer_handle_t* handle, int32_t* stride); - - status_t free(buffer_handle_t handle); - - void dump(String8& res) const; - static void dumpToSystemLog(); - -private: - struct alloc_rec_t { - uint32_t w; - uint32_t h; - uint32_t s; - PixelFormat format; - uint32_t usage; - size_t size; - }; - - static Mutex sLock; - static KeyedVector sAllocList; - - friend class Singleton; - GraphicBufferAllocator(); - ~GraphicBufferAllocator(); - - alloc_device_t *mAllocDev; -}; - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_BUFFER_ALLOCATOR_H diff --git a/external/android/include/19/frameworks/native/include/ui/GraphicBufferMapper.h b/external/android/include/19/frameworks/native/include/ui/GraphicBufferMapper.h deleted file mode 100644 index 99d8723..0000000 --- a/external/android/include/19/frameworks/native/include/ui/GraphicBufferMapper.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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_UI_BUFFER_MAPPER_H -#define ANDROID_UI_BUFFER_MAPPER_H - -#include -#include - -#include - -#include - - -struct gralloc_module_t; - -namespace android { - -// --------------------------------------------------------------------------- - -class Rect; - -class GraphicBufferMapper : public Singleton -{ -public: - static inline GraphicBufferMapper& get() { return getInstance(); } - - status_t registerBuffer(buffer_handle_t handle); - - status_t unregisterBuffer(buffer_handle_t handle); - - status_t lock(buffer_handle_t handle, - int usage, const Rect& bounds, void** vaddr); - - status_t lockYCbCr(buffer_handle_t handle, - int usage, const Rect& bounds, android_ycbcr *ycbcr); - - status_t unlock(buffer_handle_t handle); - - // dumps information about the mapping of this handle - void dump(buffer_handle_t handle); - -private: - friend class Singleton; - GraphicBufferMapper(); - gralloc_module_t const *mAllocMod; -}; - -// --------------------------------------------------------------------------- - -}; // namespace android - -#endif // ANDROID_UI_BUFFER_MAPPER_H - diff --git a/external/android/include/19/frameworks/native/include/ui/PixelFormat.h b/external/android/include/19/frameworks/native/include/ui/PixelFormat.h deleted file mode 100644 index 627cfb6..0000000 --- a/external/android/include/19/frameworks/native/include/ui/PixelFormat.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// - -// Pixel formats used across the system. -// These formats might not all be supported by all renderers, for instance -// skia or SurfaceFlinger are not required to support all of these formats -// (either as source or destination) - - -#ifndef UI_PIXELFORMAT_H -#define UI_PIXELFORMAT_H - -#include -#include -#include -#include - -namespace android { - -enum { - // - // these constants need to match those - // in graphics/PixelFormat.java & pixelflinger/format.h - // - PIXEL_FORMAT_UNKNOWN = 0, - PIXEL_FORMAT_NONE = 0, - - // logical pixel formats used by the SurfaceFlinger ----------------------- - PIXEL_FORMAT_CUSTOM = -4, - // Custom pixel-format described by a PixelFormatInfo structure - - PIXEL_FORMAT_TRANSLUCENT = -3, - // System chooses a format that supports translucency (many alpha bits) - - PIXEL_FORMAT_TRANSPARENT = -2, - // System chooses a format that supports transparency - // (at least 1 alpha bit) - - PIXEL_FORMAT_OPAQUE = -1, - // System chooses an opaque format (no alpha bits required) - - // real pixel formats supported for rendering ----------------------------- - - PIXEL_FORMAT_RGBA_8888 = HAL_PIXEL_FORMAT_RGBA_8888, // 4x8-bit RGBA - PIXEL_FORMAT_RGBX_8888 = HAL_PIXEL_FORMAT_RGBX_8888, // 4x8-bit RGB0 - PIXEL_FORMAT_RGB_888 = HAL_PIXEL_FORMAT_RGB_888, // 3x8-bit RGB - PIXEL_FORMAT_RGB_565 = HAL_PIXEL_FORMAT_RGB_565, // 16-bit RGB - PIXEL_FORMAT_BGRA_8888 = HAL_PIXEL_FORMAT_BGRA_8888, // 4x8-bit BGRA - PIXEL_FORMAT_RGBA_5551 = 6, // 16-bit ARGB - PIXEL_FORMAT_RGBA_4444 = 7, // 16-bit ARGB -}; - -typedef int32_t PixelFormat; - -ssize_t bytesPerPixel(PixelFormat format); -ssize_t bitsPerPixel(PixelFormat format); - -}; // namespace android - -#endif // UI_PIXELFORMAT_H diff --git a/external/android/include/19/frameworks/native/include/ui/Point.h b/external/android/include/19/frameworks/native/include/ui/Point.h deleted file mode 100644 index 1d7f64d..0000000 --- a/external/android/include/19/frameworks/native/include/ui/Point.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (C) 2006 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_UI_POINT -#define ANDROID_UI_POINT - -#include -#include - -namespace android { - -class Point : public LightFlattenablePod -{ -public: - int x; - int y; - - // we don't provide copy-ctor and operator= on purpose - // because we want the compiler generated versions - - // Default constructor doesn't initialize the Point - inline Point() { - } - inline Point(int x, int y) : x(x), y(y) { - } - - inline bool operator == (const Point& rhs) const { - return (x == rhs.x) && (y == rhs.y); - } - inline bool operator != (const Point& rhs) const { - return !operator == (rhs); - } - - inline bool isOrigin() const { - return !(x|y); - } - - // operator < defines an order which allows to use points in sorted - // vectors. - bool operator < (const Point& rhs) const { - return y -#include -#include - -#include - -namespace android { - -class Rect : public ARect, public LightFlattenablePod -{ -public: - typedef ARect::value_type value_type; - - // we don't provide copy-ctor and operator= on purpose - // because we want the compiler generated versions - - inline Rect() { - } - - inline Rect(int32_t w, int32_t h) { - left = top = 0; - right = w; - bottom = h; - } - - inline Rect(int32_t l, int32_t t, int32_t r, int32_t b) { - left = l; - top = t; - right = r; - bottom = b; - } - - inline Rect(const Point& lt, const Point& rb) { - left = lt.x; - top = lt.y; - right = rb.x; - bottom = rb.y; - } - - void makeInvalid(); - - inline void clear() { - left = top = right = bottom = 0; - } - - // a valid rectangle has a non negative width and height - inline bool isValid() const { - return (getWidth() >= 0) && (getHeight() >= 0); - } - - // an empty rect has a zero width or height, or is invalid - inline bool isEmpty() const { - return (getWidth() <= 0) || (getHeight() <= 0); - } - - // rectangle's width - inline int32_t getWidth() const { - return right - left; - } - - // rectangle's height - inline int32_t getHeight() const { - return bottom - top; - } - - inline Rect getBounds() const { - return Rect(right - left, bottom - top); - } - - void setLeftTop(const Point& lt) { - left = lt.x; - top = lt.y; - } - - void setRightBottom(const Point& rb) { - right = rb.x; - bottom = rb.y; - } - - // the following 4 functions return the 4 corners of the rect as Point - Point leftTop() const { - return Point(left, top); - } - Point rightBottom() const { - return Point(right, bottom); - } - Point rightTop() const { - return Point(right, top); - } - Point leftBottom() const { - return Point(left, bottom); - } - - // comparisons - inline bool operator == (const Rect& rhs) const { - return (left == rhs.left) && (top == rhs.top) && - (right == rhs.right) && (bottom == rhs.bottom); - } - - inline bool operator != (const Rect& rhs) const { - return !operator == (rhs); - } - - // operator < defines an order which allows to use rectangles in sorted - // vectors. - bool operator < (const Rect& rhs) const; - - const Rect operator + (const Point& rhs) const; - const Rect operator - (const Point& rhs) const; - - Rect& operator += (const Point& rhs) { - return offsetBy(rhs.x, rhs.y); - } - Rect& operator -= (const Point& rhs) { - return offsetBy(-rhs.x, -rhs.y); - } - - Rect& offsetToOrigin() { - right -= left; - bottom -= top; - left = top = 0; - return *this; - } - Rect& offsetTo(const Point& p) { - return offsetTo(p.x, p.y); - } - Rect& offsetBy(const Point& dp) { - return offsetBy(dp.x, dp.y); - } - - Rect& offsetTo(int32_t x, int32_t y); - Rect& offsetBy(int32_t x, int32_t y); - - bool intersect(const Rect& with, Rect* result) const; - - // Create a new Rect by transforming this one using a graphics HAL - // transform. This rectangle is defined in a coordinate space starting at - // the origin and extending to (width, height). If the transform includes - // a ROT90 then the output rectangle is defined in a space extending to - // (height, width). Otherwise the output rectangle is in the same space as - // the input. - Rect transform(uint32_t xform, int32_t width, int32_t height) const; - - // this calculates (Region(*this) - exclude).bounds() efficiently - Rect reduce(const Rect& exclude) const; - - - // for backward compatibility - inline int32_t width() const { return getWidth(); } - inline int32_t height() const { return getHeight(); } - inline void set(const Rect& rhs) { operator = (rhs); } -}; - -ANDROID_BASIC_TYPES_TRAITS(Rect) - -}; // namespace android - -#endif // ANDROID_UI_RECT diff --git a/external/android/include/19/frameworks/native/include/ui/Region.h b/external/android/include/19/frameworks/native/include/ui/Region.h deleted file mode 100644 index d906dbb..0000000 --- a/external/android/include/19/frameworks/native/include/ui/Region.h +++ /dev/null @@ -1,217 +0,0 @@ -/* - * 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_UI_REGION_H -#define ANDROID_UI_REGION_H - -#include -#include - -#include - -#include -#include - -namespace android { -// --------------------------------------------------------------------------- - -class SharedBuffer; -class String8; - -// --------------------------------------------------------------------------- -class Region : public LightFlattenable -{ -public: - Region(); - Region(const Region& rhs); - explicit Region(const Rect& rhs); - ~Region(); - - static Region createTJunctionFreeRegion(const Region& r); - - Region& operator = (const Region& rhs); - - inline bool isEmpty() const { return getBounds().isEmpty(); } - inline bool isRect() const { return mStorage.size() == 1; } - - inline Rect getBounds() const { return mStorage[mStorage.size() - 1]; } - inline Rect bounds() const { return getBounds(); } - - // the region becomes its bounds - Region& makeBoundsSelf(); - - void clear(); - void set(const Rect& r); - void set(uint32_t w, uint32_t h); - - Region& orSelf(const Rect& rhs); - Region& xorSelf(const Rect& rhs); - Region& andSelf(const Rect& rhs); - Region& subtractSelf(const Rect& rhs); - - // boolean operators, applied on this - Region& orSelf(const Region& rhs); - Region& xorSelf(const Region& rhs); - Region& andSelf(const Region& rhs); - Region& subtractSelf(const Region& rhs); - - // boolean operators - const Region merge(const Rect& rhs) const; - const Region mergeExclusive(const Rect& rhs) const; - const Region intersect(const Rect& rhs) const; - const Region subtract(const Rect& rhs) const; - - // boolean operators - const Region merge(const Region& rhs) const; - const Region mergeExclusive(const Region& rhs) const; - const Region intersect(const Region& rhs) const; - const Region subtract(const Region& rhs) const; - - // these translate rhs first - Region& translateSelf(int dx, int dy); - Region& orSelf(const Region& rhs, int dx, int dy); - Region& xorSelf(const Region& rhs, int dx, int dy); - Region& andSelf(const Region& rhs, int dx, int dy); - Region& subtractSelf(const Region& rhs, int dx, int dy); - - // these translate rhs first - const Region translate(int dx, int dy) const; - const Region merge(const Region& rhs, int dx, int dy) const; - const Region mergeExclusive(const Region& rhs, int dx, int dy) const; - const Region intersect(const Region& rhs, int dx, int dy) const; - const Region subtract(const Region& rhs, int dx, int dy) const; - - // convenience operators overloads - inline const Region operator | (const Region& rhs) const; - inline const Region operator ^ (const Region& rhs) const; - inline const Region operator & (const Region& rhs) const; - inline const Region operator - (const Region& rhs) const; - inline const Region operator + (const Point& pt) const; - - inline Region& operator |= (const Region& rhs); - inline Region& operator ^= (const Region& rhs); - inline Region& operator &= (const Region& rhs); - inline Region& operator -= (const Region& rhs); - inline Region& operator += (const Point& pt); - - - // returns true if the regions share the same underlying storage - bool isTriviallyEqual(const Region& region) const; - - - /* various ways to access the rectangle list */ - - - // STL-like iterators - typedef Rect const* const_iterator; - const_iterator begin() const; - const_iterator end() const; - - // returns an array of rect which has the same life-time has this - // Region object. - Rect const* getArray(size_t* count) const; - - // returns a SharedBuffer as well as the number of rects. - // ownership is transfered to the caller. - // the caller must call SharedBuffer::release() to free the memory. - SharedBuffer const* getSharedBuffer(size_t* count) const; - - /* no user serviceable parts here... */ - - // add a rectangle to the internal list. This rectangle must - // be sorted in Y and X and must not make the region invalid. - void addRectUnchecked(int l, int t, int r, int b); - - inline bool isFixedSize() const { return false; } - size_t getFlattenedSize() const; - status_t flatten(void* buffer, size_t size) const; - status_t unflatten(void const* buffer, size_t size); - - void dump(String8& out, const char* what, uint32_t flags=0) const; - void dump(const char* what, uint32_t flags=0) const; - -private: - class rasterizer; - friend class rasterizer; - - Region& operationSelf(const Rect& r, int op); - Region& operationSelf(const Region& r, int op); - Region& operationSelf(const Region& r, int dx, int dy, int op); - const Region operation(const Rect& rhs, int op) const; - const Region operation(const Region& rhs, int op) const; - const Region operation(const Region& rhs, int dx, int dy, int op) const; - - static void boolean_operation(int op, Region& dst, - const Region& lhs, const Region& rhs, int dx, int dy); - static void boolean_operation(int op, Region& dst, - const Region& lhs, const Rect& rhs, int dx, int dy); - - static void boolean_operation(int op, Region& dst, - const Region& lhs, const Region& rhs); - static void boolean_operation(int op, Region& dst, - const Region& lhs, const Rect& rhs); - - static void translate(Region& reg, int dx, int dy); - static void translate(Region& dst, const Region& reg, int dx, int dy); - - static bool validate(const Region& reg, - const char* name, bool silent = false); - - // mStorage is a (manually) sorted array of Rects describing the region - // with an extra Rect as the last element which is set to the - // bounds of the region. However, if the region is - // a simple Rect then mStorage contains only that rect. - Vector mStorage; -}; - - -const Region Region::operator | (const Region& rhs) const { - return merge(rhs); -} -const Region Region::operator ^ (const Region& rhs) const { - return mergeExclusive(rhs); -} -const Region Region::operator & (const Region& rhs) const { - return intersect(rhs); -} -const Region Region::operator - (const Region& rhs) const { - return subtract(rhs); -} -const Region Region::operator + (const Point& pt) const { - return translate(pt.x, pt.y); -} - - -Region& Region::operator |= (const Region& rhs) { - return orSelf(rhs); -} -Region& Region::operator ^= (const Region& rhs) { - return xorSelf(rhs); -} -Region& Region::operator &= (const Region& rhs) { - return andSelf(rhs); -} -Region& Region::operator -= (const Region& rhs) { - return subtractSelf(rhs); -} -Region& Region::operator += (const Point& pt) { - return translateSelf(pt.x, pt.y); -} -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_UI_REGION_H - diff --git a/external/android/include/19/frameworks/native/include/ui/TMatHelpers.h b/external/android/include/19/frameworks/native/include/ui/TMatHelpers.h deleted file mode 100644 index a6aadca..0000000 --- a/external/android/include/19/frameworks/native/include/ui/TMatHelpers.h +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright 2013 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 TMAT_IMPLEMENTATION -#error "Don't include TMatHelpers.h directly. use ui/mat*.h instead" -#else -#undef TMAT_IMPLEMENTATION -#endif - - -#ifndef UI_TMAT_HELPERS_H -#define UI_TMAT_HELPERS_H - -#include -#include -#include -#include -#include - -#define PURE __attribute__((pure)) - -namespace android { -// ------------------------------------------------------------------------------------- - -/* - * No user serviceable parts here. - * - * Don't use this file directly, instead include ui/mat*.h - */ - - -/* - * Matrix utilities - */ - -namespace matrix { - -inline int PURE transpose(int v) { return v; } -inline float PURE transpose(float v) { return v; } -inline double PURE transpose(double v) { return v; } - -inline int PURE trace(int v) { return v; } -inline float PURE trace(float v) { return v; } -inline double PURE trace(double v) { return v; } - -template -MATRIX PURE inverse(const MATRIX& src) { - - COMPILE_TIME_ASSERT_FUNCTION_SCOPE( MATRIX::COL_SIZE == MATRIX::ROW_SIZE ); - - typename MATRIX::value_type t; - const size_t N = MATRIX::col_size(); - size_t swap; - MATRIX tmp(src); - MATRIX inverse(1); - - for (size_t i=0 ; i fabs(tmp[i][i])) { - swap = j; - } - } - - if (swap != i) { - /* swap rows. */ - for (size_t k=0 ; k -MATRIX_R PURE multiply(const MATRIX_A& lhs, const MATRIX_B& rhs) { - // pre-requisite: - // lhs : D columns, R rows - // rhs : C columns, D rows - // res : C columns, R rows - - COMPILE_TIME_ASSERT_FUNCTION_SCOPE( MATRIX_A::ROW_SIZE == MATRIX_B::COL_SIZE ); - COMPILE_TIME_ASSERT_FUNCTION_SCOPE( MATRIX_R::ROW_SIZE == MATRIX_B::ROW_SIZE ); - COMPILE_TIME_ASSERT_FUNCTION_SCOPE( MATRIX_R::COL_SIZE == MATRIX_A::COL_SIZE ); - - MATRIX_R res(MATRIX_R::NO_INIT); - for (size_t r=0 ; r -MATRIX PURE transpose(const MATRIX& m) { - // for now we only handle square matrix transpose - COMPILE_TIME_ASSERT_FUNCTION_SCOPE( MATRIX::ROW_SIZE == MATRIX::COL_SIZE ); - MATRIX result(MATRIX::NO_INIT); - for (size_t r=0 ; r -typename MATRIX::value_type PURE trace(const MATRIX& m) { - COMPILE_TIME_ASSERT_FUNCTION_SCOPE( MATRIX::ROW_SIZE == MATRIX::COL_SIZE ); - typename MATRIX::value_type result(0); - for (size_t r=0 ; r -typename MATRIX::col_type PURE diag(const MATRIX& m) { - COMPILE_TIME_ASSERT_FUNCTION_SCOPE( MATRIX::ROW_SIZE == MATRIX::COL_SIZE ); - typename MATRIX::col_type result(MATRIX::col_type::NO_INIT); - for (size_t r=0 ; r -String8 asString(const MATRIX& m) { - String8 s; - for (size_t c=0 ; c. - * - * BASE only needs to implement operator[] and size(). - * By simply inheriting from TMatProductOperators BASE will automatically - * get all the functionality here. - */ - -template class BASE, typename T> -class TMatProductOperators { -public: - // multiply by a scalar - BASE& operator *= (T v) { - BASE& lhs(static_cast< BASE& >(*this)); - for (size_t r=0 ; r& operator /= (T v) { - BASE& lhs(static_cast< BASE& >(*this)); - for (size_t r=0 ; r - friend BASE PURE operator *(const BASE& lhs, const BASE& rhs) { - return matrix::multiply >(lhs, rhs); - } -}; - - -/* - * TMatSquareFunctions implements functions on a matrix of type BASE. - * - * BASE only needs to implement: - * - operator[] - * - col_type - * - row_type - * - COL_SIZE - * - ROW_SIZE - * - * By simply inheriting from TMatSquareFunctions BASE will automatically - * get all the functionality here. - */ - -template class BASE, typename T> -class TMatSquareFunctions { -public: - /* - * NOTE: the functions below ARE NOT member methods. They are friend functions - * with they definition inlined with their declaration. This makes these - * template functions available to the compiler when (and only when) this class - * is instantiated, at which point they're only templated on the 2nd parameter - * (the first one, BASE being known). - */ - friend BASE PURE inverse(const BASE& m) { return matrix::inverse(m); } - friend BASE PURE transpose(const BASE& m) { return matrix::transpose(m); } - friend T PURE trace(const BASE& m) { return matrix::trace(m); } -}; - -template class BASE, typename T> -class TMatDebug { -public: - String8 asString() const { - return matrix::asString( static_cast< const BASE& >(*this) ); - } -}; - -// ------------------------------------------------------------------------------------- -}; // namespace android - -#undef PURE - -#endif /* UI_TMAT_HELPERS_H */ diff --git a/external/android/include/19/frameworks/native/include/ui/TVecHelpers.h b/external/android/include/19/frameworks/native/include/ui/TVecHelpers.h deleted file mode 100644 index bb7dbfc..0000000 --- a/external/android/include/19/frameworks/native/include/ui/TVecHelpers.h +++ /dev/null @@ -1,381 +0,0 @@ -/* - * Copyright 2013 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 TVEC_IMPLEMENTATION -#error "Don't include TVecHelpers.h directly. use ui/vec*.h instead" -#else -#undef TVEC_IMPLEMENTATION -#endif - - -#ifndef UI_TVEC_HELPERS_H -#define UI_TVEC_HELPERS_H - -#include -#include - -#define PURE __attribute__((pure)) - -namespace android { -// ------------------------------------------------------------------------------------- - -/* - * No user serviceable parts here. - * - * Don't use this file directly, instead include ui/vec{2|3|4}.h - */ - -/* - * This class casts itself into anything and assign itself from anything! - * Use with caution! - */ -template -struct Impersonator { - Impersonator& operator = (const TYPE& rhs) { - reinterpret_cast(*this) = rhs; - return *this; - } - operator TYPE& () { - return reinterpret_cast(*this); - } - operator TYPE const& () const { - return reinterpret_cast(*this); - } -}; - -/* - * TVec{Add|Product}Operators implements basic arithmetic and basic compound assignments - * operators on a vector of type BASE. - * - * BASE only needs to implement operator[] and size(). - * By simply inheriting from TVec{Add|Product}Operators BASE will automatically - * get all the functionality here. - */ - -template class BASE, typename T> -class TVecAddOperators { -public: - /* compound assignment from a another vector of the same size but different - * element type. - */ - template - BASE& operator += (const BASE& v) { - BASE& rhs = static_cast&>(*this); - for (size_t i=0 ; i::size() ; i++) { - rhs[i] += v[i]; - } - return rhs; - } - template - BASE& operator -= (const BASE& v) { - BASE& rhs = static_cast&>(*this); - for (size_t i=0 ; i::size() ; i++) { - rhs[i] -= v[i]; - } - return rhs; - } - - /* compound assignment from a another vector of the same type. - * These operators can be used for implicit conversion and handle operations - * like "vector *= scalar" by letting the compiler implicitly convert a scalar - * to a vector (assuming the BASE allows it). - */ - BASE& operator += (const BASE& v) { - BASE& rhs = static_cast&>(*this); - for (size_t i=0 ; i::size() ; i++) { - rhs[i] += v[i]; - } - return rhs; - } - BASE& operator -= (const BASE& v) { - BASE& rhs = static_cast&>(*this); - for (size_t i=0 ; i::size() ; i++) { - rhs[i] -= v[i]; - } - return rhs; - } - - /* - * NOTE: the functions below ARE NOT member methods. They are friend functions - * with they definition inlined with their declaration. This makes these - * template functions available to the compiler when (and only when) this class - * is instantiated, at which point they're only templated on the 2nd parameter - * (the first one, BASE being known). - */ - - /* The operators below handle operation between vectors of the same side - * but of a different element type. - */ - template - friend inline - BASE PURE operator +(const BASE& lv, const BASE& rv) { - return BASE(lv) += rv; - } - template - friend inline - BASE PURE operator -(const BASE& lv, const BASE& rv) { - return BASE(lv) -= rv; - } - - /* The operators below (which are not templates once this class is instanced, - * i.e.: BASE is known) can be used for implicit conversion on both sides. - * These handle operations like "vector * scalar" and "scalar * vector" by - * letting the compiler implicitly convert a scalar to a vector (assuming - * the BASE allows it). - */ - friend inline - BASE PURE operator +(const BASE& lv, const BASE& rv) { - return BASE(lv) += rv; - } - friend inline - BASE PURE operator -(const BASE& lv, const BASE& rv) { - return BASE(lv) -= rv; - } -}; - -template class BASE, typename T> -class TVecProductOperators { -public: - /* compound assignment from a another vector of the same size but different - * element type. - */ - template - BASE& operator *= (const BASE& v) { - BASE& rhs = static_cast&>(*this); - for (size_t i=0 ; i::size() ; i++) { - rhs[i] *= v[i]; - } - return rhs; - } - template - BASE& operator /= (const BASE& v) { - BASE& rhs = static_cast&>(*this); - for (size_t i=0 ; i::size() ; i++) { - rhs[i] /= v[i]; - } - return rhs; - } - - /* compound assignment from a another vector of the same type. - * These operators can be used for implicit conversion and handle operations - * like "vector *= scalar" by letting the compiler implicitly convert a scalar - * to a vector (assuming the BASE allows it). - */ - BASE& operator *= (const BASE& v) { - BASE& rhs = static_cast&>(*this); - for (size_t i=0 ; i::size() ; i++) { - rhs[i] *= v[i]; - } - return rhs; - } - BASE& operator /= (const BASE& v) { - BASE& rhs = static_cast&>(*this); - for (size_t i=0 ; i::size() ; i++) { - rhs[i] /= v[i]; - } - return rhs; - } - - /* - * NOTE: the functions below ARE NOT member methods. They are friend functions - * with they definition inlined with their declaration. This makes these - * template functions available to the compiler when (and only when) this class - * is instantiated, at which point they're only templated on the 2nd parameter - * (the first one, BASE being known). - */ - - /* The operators below handle operation between vectors of the same side - * but of a different element type. - */ - template - friend inline - BASE PURE operator *(const BASE& lv, const BASE& rv) { - return BASE(lv) *= rv; - } - template - friend inline - BASE PURE operator /(const BASE& lv, const BASE& rv) { - return BASE(lv) /= rv; - } - - /* The operators below (which are not templates once this class is instanced, - * i.e.: BASE is known) can be used for implicit conversion on both sides. - * These handle operations like "vector * scalar" and "scalar * vector" by - * letting the compiler implicitly convert a scalar to a vector (assuming - * the BASE allows it). - */ - friend inline - BASE PURE operator *(const BASE& lv, const BASE& rv) { - return BASE(lv) *= rv; - } - friend inline - BASE PURE operator /(const BASE& lv, const BASE& rv) { - return BASE(lv) /= rv; - } -}; - -/* - * TVecUnaryOperators implements unary operators on a vector of type BASE. - * - * BASE only needs to implement operator[] and size(). - * By simply inheriting from TVecUnaryOperators BASE will automatically - * get all the functionality here. - * - * These operators are implemented as friend functions of TVecUnaryOperators - */ -template class BASE, typename T> -class TVecUnaryOperators { -public: - BASE& operator ++ () { - BASE& rhs = static_cast&>(*this); - for (size_t i=0 ; i::size() ; i++) { - ++rhs[i]; - } - return rhs; - } - BASE& operator -- () { - BASE& rhs = static_cast&>(*this); - for (size_t i=0 ; i::size() ; i++) { - --rhs[i]; - } - return rhs; - } - BASE operator - () const { - BASE r(BASE::NO_INIT); - BASE const& rv(static_cast const&>(*this)); - for (size_t i=0 ; i::size() ; i++) { - r[i] = -rv[i]; - } - return r; - } -}; - - -/* - * TVecComparisonOperators implements relational/comparison operators - * on a vector of type BASE. - * - * BASE only needs to implement operator[] and size(). - * By simply inheriting from TVecComparisonOperators BASE will automatically - * get all the functionality here. - */ -template class BASE, typename T> -class TVecComparisonOperators { -public: - /* - * NOTE: the functions below ARE NOT member methods. They are friend functions - * with they definition inlined with their declaration. This makes these - * template functions available to the compiler when (and only when) this class - * is instantiated, at which point they're only templated on the 2nd parameter - * (the first one, BASE being known). - */ - template - friend inline - bool PURE operator ==(const BASE& lv, const BASE& rv) { - for (size_t i = 0; i < BASE::size(); i++) - if (lv[i] != rv[i]) - return false; - return true; - } - - template - friend inline - bool PURE operator !=(const BASE& lv, const BASE& rv) { - return !operator ==(lv, rv); - } - - template - friend inline - bool PURE operator >(const BASE& lv, const BASE& rv) { - for (size_t i = 0; i < BASE::size(); i++) - if (lv[i] <= rv[i]) - return false; - return true; - } - - template - friend inline - bool PURE operator <=(const BASE& lv, const BASE& rv) { - return !(lv > rv); - } - - template - friend inline - bool PURE operator <(const BASE& lv, const BASE& rv) { - for (size_t i = 0; i < BASE::size(); i++) - if (lv[i] >= rv[i]) - return false; - return true; - } - - template - friend inline - bool PURE operator >=(const BASE& lv, const BASE& rv) { - return !(lv < rv); - } -}; - - -/* - * TVecFunctions implements functions on a vector of type BASE. - * - * BASE only needs to implement operator[] and size(). - * By simply inheriting from TVecFunctions BASE will automatically - * get all the functionality here. - */ -template class BASE, typename T> -class TVecFunctions { -public: - /* - * NOTE: the functions below ARE NOT member methods. They are friend functions - * with they definition inlined with their declaration. This makes these - * template functions available to the compiler when (and only when) this class - * is instantiated, at which point they're only templated on the 2nd parameter - * (the first one, BASE being known). - */ - template - friend inline - T PURE dot(const BASE& lv, const BASE& rv) { - T r(0); - for (size_t i = 0; i < BASE::size(); i++) - r += lv[i]*rv[i]; - return r; - } - - friend inline - T PURE length(const BASE& lv) { - return sqrt( dot(lv, lv) ); - } - - template - friend inline - T PURE distance(const BASE& lv, const BASE& rv) { - return length(rv - lv); - } - - friend inline - BASE PURE normalize(const BASE& lv) { - return lv * (1 / length(lv)); - } -}; - -#undef PURE - -// ------------------------------------------------------------------------------------- -}; // namespace android - - -#endif /* UI_TVEC_HELPERS_H */ diff --git a/external/android/include/19/frameworks/native/include/ui/UiConfig.h b/external/android/include/19/frameworks/native/include/ui/UiConfig.h deleted file mode 100644 index fcf8ed5..0000000 --- a/external/android/include/19/frameworks/native/include/ui/UiConfig.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2012 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_UI_CONFIG_H -#define ANDROID_UI_CONFIG_H - -#include - -namespace android { - -// Append the libui configuration details to configStr. -void appendUiConfigString(String8& configStr); - -}; // namespace android - -#endif /*ANDROID_UI_CONFIG_H*/ diff --git a/external/android/include/19/frameworks/native/include/ui/mat4.h b/external/android/include/19/frameworks/native/include/ui/mat4.h deleted file mode 100644 index d9647cc..0000000 --- a/external/android/include/19/frameworks/native/include/ui/mat4.h +++ /dev/null @@ -1,394 +0,0 @@ -/* - * Copyright 2013 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 UI_MAT4_H -#define UI_MAT4_H - -#include -#include - -#include -#include - -#define TMAT_IMPLEMENTATION -#include - -#define PURE __attribute__((pure)) - -namespace android { -// ------------------------------------------------------------------------------------- - -template -class tmat44 : public TVecUnaryOperators, - public TVecComparisonOperators, - public TVecAddOperators, - public TMatProductOperators, - public TMatSquareFunctions, - public TMatDebug -{ -public: - enum no_init { NO_INIT }; - typedef T value_type; - typedef T& reference; - typedef T const& const_reference; - typedef size_t size_type; - typedef tvec4 col_type; - typedef tvec4 row_type; - - // size of a column (i.e.: number of rows) - enum { COL_SIZE = col_type::SIZE }; - static inline size_t col_size() { return COL_SIZE; } - - // size of a row (i.e.: number of columns) - enum { ROW_SIZE = row_type::SIZE }; - static inline size_t row_size() { return ROW_SIZE; } - static inline size_t size() { return row_size(); } // for TVec*<> - -private: - - /* - * <-- N columns --> - * - * a00 a10 a20 ... aN0 ^ - * a01 a11 a21 ... aN1 | - * a02 a12 a22 ... aN2 M rows - * ... | - * a0M a1M a2M ... aNM v - * - * COL_SIZE = M - * ROW_SIZE = N - * m[0] = [a00 a01 a02 ... a01M] - */ - - col_type mValue[ROW_SIZE]; - -public: - // array access - inline col_type const& operator [] (size_t i) const { return mValue[i]; } - inline col_type& operator [] (size_t i) { return mValue[i]; } - - T const* asArray() const { return &mValue[0][0]; } - - // ----------------------------------------------------------------------- - // we don't provide copy-ctor and operator= on purpose - // because we want the compiler generated versions - - /* - * constructors - */ - - // leaves object uninitialized. use with caution. - explicit tmat44(no_init) { } - - // initialize to identity - tmat44(); - - // initialize to Identity*scalar. - template - explicit tmat44(U v); - - // sets the diagonal to the passed vector - template - explicit tmat44(const tvec4& rhs); - - // construct from another matrix of the same size - template - explicit tmat44(const tmat44& rhs); - - // construct from 4 column vectors - template - tmat44(const tvec4& v0, const tvec4& v1, const tvec4& v2, const tvec4& v3); - - // construct from 16 scalars - template < - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, - typename I, typename J, typename K, typename L, - typename M, typename N, typename O, typename P> - tmat44( A m00, B m01, C m02, D m03, - E m10, F m11, G m12, H m13, - I m20, J m21, K m22, L m23, - M m30, N m31, O m32, P m33); - - // construct from a C array - template - explicit tmat44(U const* rawArray); - - /* - * helpers - */ - - static tmat44 ortho(T left, T right, T bottom, T top, T near, T far); - - static tmat44 frustum(T left, T right, T bottom, T top, T near, T far); - - template - static tmat44 lookAt(const tvec3& eye, const tvec3& center, const tvec3& up); - - template - static tmat44 translate(const tvec4& t); - - template - static tmat44 scale(const tvec4& s); - - template - static tmat44 rotate(A radian, const tvec3& about); -}; - -// ---------------------------------------------------------------------------------------- -// Constructors -// ---------------------------------------------------------------------------------------- - -/* - * Since the matrix code could become pretty big quickly, we don't inline most - * operations. - */ - -template -tmat44::tmat44() { - mValue[0] = col_type(1,0,0,0); - mValue[1] = col_type(0,1,0,0); - mValue[2] = col_type(0,0,1,0); - mValue[3] = col_type(0,0,0,1); -} - -template -template -tmat44::tmat44(U v) { - mValue[0] = col_type(v,0,0,0); - mValue[1] = col_type(0,v,0,0); - mValue[2] = col_type(0,0,v,0); - mValue[3] = col_type(0,0,0,v); -} - -template -template -tmat44::tmat44(const tvec4& v) { - mValue[0] = col_type(v.x,0,0,0); - mValue[1] = col_type(0,v.y,0,0); - mValue[2] = col_type(0,0,v.z,0); - mValue[3] = col_type(0,0,0,v.w); -} - -// construct from 16 scalars -template -template < - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, - typename I, typename J, typename K, typename L, - typename M, typename N, typename O, typename P> -tmat44::tmat44( A m00, B m01, C m02, D m03, - E m10, F m11, G m12, H m13, - I m20, J m21, K m22, L m23, - M m30, N m31, O m32, P m33) { - mValue[0] = col_type(m00, m01, m02, m03); - mValue[1] = col_type(m10, m11, m12, m13); - mValue[2] = col_type(m20, m21, m22, m23); - mValue[3] = col_type(m30, m31, m32, m33); -} - -template -template -tmat44::tmat44(const tmat44& rhs) { - for (size_t r=0 ; r -template -tmat44::tmat44(const tvec4& v0, const tvec4& v1, const tvec4& v2, const tvec4& v3) { - mValue[0] = v0; - mValue[1] = v1; - mValue[2] = v2; - mValue[3] = v3; -} - -template -template -tmat44::tmat44(U const* rawArray) { - for (size_t r=0 ; r -tmat44 tmat44::ortho(T left, T right, T bottom, T top, T near, T far) { - tmat44 m; - m[0][0] = 2 / (right - left); - m[1][1] = 2 / (top - bottom); - m[2][2] = -2 / (far - near); - m[3][0] = -(right + left) / (right - left); - m[3][1] = -(top + bottom) / (top - bottom); - m[3][2] = -(far + near) / (far - near); - return m; -} - -template -tmat44 tmat44::frustum(T left, T right, T bottom, T top, T near, T far) { - tmat44 m; - T A = (right + left) / (right - left); - T B = (top + bottom) / (top - bottom); - T C = (far + near) / (far - near); - T D = (2 * far * near) / (far - near); - m[0][0] = (2 * near) / (right - left); - m[1][1] = (2 * near) / (top - bottom); - m[2][0] = A; - m[2][1] = B; - m[2][2] = C; - m[2][3] =-1; - m[3][2] = D; - m[3][3] = 0; - return m; -} - -template -template -tmat44 tmat44::lookAt(const tvec3& eye, const tvec3& center, const tvec3& up) { - tvec3 L(normalize(center - eye)); - tvec3 S(normalize( cross(L, up) )); - tvec3 U(cross(S, L)); - return tmat44( - tvec4( S, 0), - tvec4( U, 0), - tvec4(-L, 0), - tvec4(-eye, 1)); -} - -template -template -tmat44 tmat44::translate(const tvec4& t) { - tmat44 r; - r[3] = t; - return r; -} - -template -template -tmat44 tmat44::scale(const tvec4& s) { - tmat44 r; - r[0][0] = s[0]; - r[1][1] = s[1]; - r[2][2] = s[2]; - r[3][3] = s[3]; - return r; -} - -template -template -tmat44 tmat44::rotate(A radian, const tvec3& about) { - tmat44 rotation; - T* r = const_cast(rotation.asArray()); - T c = cos(radian); - T s = sin(radian); - if (about.x==1 && about.y==0 && about.z==0) { - r[5] = c; r[10]= c; - r[6] = s; r[9] = -s; - } else if (about.x==0 && about.y==1 && about.z==0) { - r[0] = c; r[10]= c; - r[8] = s; r[2] = -s; - } else if (about.x==0 && about.y==0 && about.z==1) { - r[0] = c; r[5] = c; - r[1] = s; r[4] = -s; - } else { - tvec3 nabout = normalize(about); - B x = nabout.x; - B y = nabout.y; - B z = nabout.z; - T nc = 1 - c; - T xy = x * y; - T yz = y * z; - T zx = z * x; - T xs = x * s; - T ys = y * s; - T zs = z * s; - r[ 0] = x*x*nc + c; r[ 4] = xy*nc - zs; r[ 8] = zx*nc + ys; - r[ 1] = xy*nc + zs; r[ 5] = y*y*nc + c; r[ 9] = yz*nc - xs; - r[ 2] = zx*nc - ys; r[ 6] = yz*nc + xs; r[10] = z*z*nc + c; - } -} - -// ---------------------------------------------------------------------------------------- -// Arithmetic operators outside of class -// ---------------------------------------------------------------------------------------- - -/* We use non-friend functions here to prevent the compiler from using - * implicit conversions, for instance of a scalar to a vector. The result would - * not be what the caller expects. - * - * Also note that the order of the arguments in the inner loop is important since - * it determines the output type (only relevant when T != U). - */ - -// matrix * vector, result is a vector of the same type than the input vector -template -typename tmat44::col_type PURE operator *(const tmat44& lv, const tvec4& rv) { - typename tmat44::col_type result; - for (size_t r=0 ; r::row_size() ; r++) - result += rv[r]*lv[r]; - return result; -} - -// vector * matrix, result is a vector of the same type than the input vector -template -typename tmat44::row_type PURE operator *(const tvec4& rv, const tmat44& lv) { - typename tmat44::row_type result(tmat44::row_type::NO_INIT); - for (size_t r=0 ; r::row_size() ; r++) - result[r] = dot(rv, lv[r]); - return result; -} - -// matrix * scalar, result is a matrix of the same type than the input matrix -template -tmat44 PURE operator *(const tmat44& lv, U rv) { - tmat44 result(tmat44::NO_INIT); - for (size_t r=0 ; r::row_size() ; r++) - result[r] = lv[r]*rv; - return result; -} - -// scalar * matrix, result is a matrix of the same type than the input matrix -template -tmat44 PURE operator *(U rv, const tmat44& lv) { - tmat44 result(tmat44::NO_INIT); - for (size_t r=0 ; r::row_size() ; r++) - result[r] = lv[r]*rv; - return result; -} - -// ---------------------------------------------------------------------------------------- - -/* FIXME: this should go into TMatSquareFunctions<> but for some reason - * BASE::col_type is not accessible from there (???) - */ -template -typename tmat44::col_type PURE diag(const tmat44& m) { - return matrix::diag(m); -} - -// ---------------------------------------------------------------------------------------- - -typedef tmat44 mat4; - -// ---------------------------------------------------------------------------------------- -}; // namespace android - -#undef PURE - -#endif /* UI_MAT4_H */ diff --git a/external/android/include/19/frameworks/native/include/ui/vec2.h b/external/android/include/19/frameworks/native/include/ui/vec2.h deleted file mode 100644 index c31d0e4..0000000 --- a/external/android/include/19/frameworks/native/include/ui/vec2.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2013 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 UI_VEC2_H -#define UI_VEC2_H - -#include -#include - -#define TVEC_IMPLEMENTATION -#include - -namespace android { -// ------------------------------------------------------------------------------------- - -template -class tvec2 : public TVecProductOperators, - public TVecAddOperators, - public TVecUnaryOperators, - public TVecComparisonOperators, - public TVecFunctions -{ -public: - enum no_init { NO_INIT }; - typedef T value_type; - typedef T& reference; - typedef T const& const_reference; - typedef size_t size_type; - - union { - struct { T x, y; }; - struct { T s, t; }; - struct { T r, g; }; - }; - - enum { SIZE = 2 }; - inline static size_type size() { return SIZE; } - - // array access - inline T const& operator [] (size_t i) const { return (&x)[i]; } - inline T& operator [] (size_t i) { return (&x)[i]; } - - // ----------------------------------------------------------------------- - // we don't provide copy-ctor and operator= on purpose - // because we want the compiler generated versions - - // constructors - - // leaves object uninitialized. use with caution. - explicit tvec2(no_init) { } - - // default constructor - tvec2() : x(0), y(0) { } - - // handles implicit conversion to a tvec4. must not be explicit. - template - tvec2(A v) : x(v), y(v) { } - - template - tvec2(A x, B y) : x(x), y(y) { } - - template - explicit tvec2(const tvec2& v) : x(v.x), y(v.y) { } - - template - tvec2(const Impersonator< tvec2 >& v) - : x(((const tvec2&)v).x), - y(((const tvec2&)v).y) { } -}; - -// ---------------------------------------------------------------------------------------- - -typedef tvec2 vec2; - -// ---------------------------------------------------------------------------------------- -}; // namespace android - -#endif /* UI_VEC4_H */ diff --git a/external/android/include/19/frameworks/native/include/ui/vec3.h b/external/android/include/19/frameworks/native/include/ui/vec3.h deleted file mode 100644 index dde59a9..0000000 --- a/external/android/include/19/frameworks/native/include/ui/vec3.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2013 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 UI_VEC3_H -#define UI_VEC3_H - -#include -#include - -#include - -namespace android { -// ------------------------------------------------------------------------------------- - -template -class tvec3 : public TVecProductOperators, - public TVecAddOperators, - public TVecUnaryOperators, - public TVecComparisonOperators, - public TVecFunctions -{ -public: - enum no_init { NO_INIT }; - typedef T value_type; - typedef T& reference; - typedef T const& const_reference; - typedef size_t size_type; - - union { - struct { T x, y, z; }; - struct { T s, t, p; }; - struct { T r, g, b; }; - Impersonator< tvec2 > xy; - Impersonator< tvec2 > st; - Impersonator< tvec2 > rg; - }; - - enum { SIZE = 3 }; - inline static size_type size() { return SIZE; } - - // array access - inline T const& operator [] (size_t i) const { return (&x)[i]; } - inline T& operator [] (size_t i) { return (&x)[i]; } - - // ----------------------------------------------------------------------- - // we don't provide copy-ctor and operator= on purpose - // because we want the compiler generated versions - - // constructors - // leaves object uninitialized. use with caution. - explicit tvec3(no_init) { } - - // default constructor - tvec3() : x(0), y(0), z(0) { } - - // handles implicit conversion to a tvec4. must not be explicit. - template - tvec3(A v) : x(v), y(v), z(v) { } - - template - tvec3(A x, B y, C z) : x(x), y(y), z(z) { } - - template - tvec3(const tvec2& v, B z) : x(v.x), y(v.y), z(z) { } - - template - explicit tvec3(const tvec3& v) : x(v.x), y(v.y), z(v.z) { } - - template - tvec3(const Impersonator< tvec3 >& v) - : x(((const tvec3&)v).x), - y(((const tvec3&)v).y), - z(((const tvec3&)v).z) { } - - template - tvec3(const Impersonator< tvec2 >& v, B z) - : x(((const tvec2&)v).x), - y(((const tvec2&)v).y), - z(z) { } - - // cross product works only on vectors of size 3 - template - friend inline - tvec3 __attribute__((pure)) cross(const tvec3& u, const tvec3& v) { - return tvec3( - u.y*v.z - u.z*v.y, - u.z*v.x - u.x*v.z, - u.x*v.y - u.y*v.x); - } -}; - - -// ---------------------------------------------------------------------------------------- - -typedef tvec3 vec3; - -// ---------------------------------------------------------------------------------------- -}; // namespace android - -#endif /* UI_VEC4_H */ diff --git a/external/android/include/19/frameworks/native/include/ui/vec4.h b/external/android/include/19/frameworks/native/include/ui/vec4.h deleted file mode 100644 index e03d331..0000000 --- a/external/android/include/19/frameworks/native/include/ui/vec4.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright 2013 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 UI_VEC4_H -#define UI_VEC4_H - -#include -#include - -#include - -namespace android { -// ------------------------------------------------------------------------------------- - -template -class tvec4 : public TVecProductOperators, - public TVecAddOperators, - public TVecUnaryOperators, - public TVecComparisonOperators, - public TVecFunctions -{ -public: - enum no_init { NO_INIT }; - typedef T value_type; - typedef T& reference; - typedef T const& const_reference; - typedef size_t size_type; - - union { - struct { T x, y, z, w; }; - struct { T s, t, p, q; }; - struct { T r, g, b, a; }; - Impersonator< tvec2 > xy; - Impersonator< tvec2 > st; - Impersonator< tvec2 > rg; - Impersonator< tvec3 > xyz; - Impersonator< tvec3 > stp; - Impersonator< tvec3 > rgb; - }; - - enum { SIZE = 4 }; - inline static size_type size() { return SIZE; } - - // array access - inline T const& operator [] (size_t i) const { return (&x)[i]; } - inline T& operator [] (size_t i) { return (&x)[i]; } - - // ----------------------------------------------------------------------- - // we don't provide copy-ctor and operator= on purpose - // because we want the compiler generated versions - - // constructors - - // leaves object uninitialized. use with caution. - explicit tvec4(no_init) { } - - // default constructor - tvec4() : x(0), y(0), z(0), w(0) { } - - // handles implicit conversion to a tvec4. must not be explicit. - template - tvec4(A v) : x(v), y(v), z(v), w(v) { } - - template - tvec4(A x, B y, C z, D w) : x(x), y(y), z(z), w(w) { } - - template - tvec4(const tvec2& v, B z, C w) : x(v.x), y(v.y), z(z), w(w) { } - - template - tvec4(const tvec3& v, B w) : x(v.x), y(v.y), z(v.z), w(w) { } - - template - explicit tvec4(const tvec4& v) : x(v.x), y(v.y), z(v.z), w(v.w) { } - - template - tvec4(const Impersonator< tvec4 >& v) - : x(((const tvec4&)v).x), - y(((const tvec4&)v).y), - z(((const tvec4&)v).z), - w(((const tvec4&)v).w) { } - - template - tvec4(const Impersonator< tvec3 >& v, B w) - : x(((const tvec3&)v).x), - y(((const tvec3&)v).y), - z(((const tvec3&)v).z), - w(w) { } - - template - tvec4(const Impersonator< tvec2 >& v, B z, C w) - : x(((const tvec2&)v).x), - y(((const tvec2&)v).y), - z(z), - w(w) { } -}; - -// ---------------------------------------------------------------------------------------- - -typedef tvec4 vec4; - -// ---------------------------------------------------------------------------------------- -}; // namespace android - -#endif /* UI_VEC4_H */ diff --git a/external/android/include/19/hardware/libhardware/include/hardware/audio.h b/external/android/include/19/hardware/libhardware/include/hardware/audio.h deleted file mode 100644 index 6ba2544..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/audio.h +++ /dev/null @@ -1,566 +0,0 @@ -/* - * Copyright (C) 2011 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_AUDIO_HAL_INTERFACE_H -#define ANDROID_AUDIO_HAL_INTERFACE_H - -#include -#include -#include -#include - -#include - -#include -#include -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define AUDIO_HARDWARE_MODULE_ID "audio" - -/** - * Name of the audio devices to open - */ -#define AUDIO_HARDWARE_INTERFACE "audio_hw_if" - - -/* Use version 0.1 to be compatible with first generation of audio hw module with version_major - * hardcoded to 1. No audio module API change. - */ -#define AUDIO_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) -#define AUDIO_MODULE_API_VERSION_CURRENT AUDIO_MODULE_API_VERSION_0_1 - -/* First generation of audio devices had version hardcoded to 0. all devices with versions < 1.0 - * will be considered of first generation API. - */ -#define AUDIO_DEVICE_API_VERSION_0_0 HARDWARE_DEVICE_API_VERSION(0, 0) -#define AUDIO_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0) -#define AUDIO_DEVICE_API_VERSION_2_0 HARDWARE_DEVICE_API_VERSION(2, 0) -#define AUDIO_DEVICE_API_VERSION_CURRENT AUDIO_DEVICE_API_VERSION_2_0 - -/** - * List of known audio HAL modules. This is the base name of the audio HAL - * library composed of the "audio." prefix, one of the base names below and - * a suffix specific to the device. - * e.g: audio.primary.goldfish.so or audio.a2dp.default.so - */ - -#define AUDIO_HARDWARE_MODULE_ID_PRIMARY "primary" -#define AUDIO_HARDWARE_MODULE_ID_A2DP "a2dp" -#define AUDIO_HARDWARE_MODULE_ID_USB "usb" -#define AUDIO_HARDWARE_MODULE_ID_REMOTE_SUBMIX "r_submix" -#define AUDIO_HARDWARE_MODULE_ID_CODEC_OFFLOAD "codec_offload" - -/**************************************/ - -/** - * standard audio parameters that the HAL may need to handle - */ - -/** - * audio device parameters - */ - -/* BT SCO Noise Reduction + Echo Cancellation parameters */ -#define AUDIO_PARAMETER_KEY_BT_NREC "bt_headset_nrec" -#define AUDIO_PARAMETER_VALUE_ON "on" -#define AUDIO_PARAMETER_VALUE_OFF "off" - -/* TTY mode selection */ -#define AUDIO_PARAMETER_KEY_TTY_MODE "tty_mode" -#define AUDIO_PARAMETER_VALUE_TTY_OFF "tty_off" -#define AUDIO_PARAMETER_VALUE_TTY_VCO "tty_vco" -#define AUDIO_PARAMETER_VALUE_TTY_HCO "tty_hco" -#define AUDIO_PARAMETER_VALUE_TTY_FULL "tty_full" - -/* A2DP sink address set by framework */ -#define AUDIO_PARAMETER_A2DP_SINK_ADDRESS "a2dp_sink_address" - -/* Screen state */ -#define AUDIO_PARAMETER_KEY_SCREEN_STATE "screen_state" - -/** - * audio stream parameters - */ - -#define AUDIO_PARAMETER_STREAM_ROUTING "routing" // audio_devices_t -#define AUDIO_PARAMETER_STREAM_FORMAT "format" // audio_format_t -#define AUDIO_PARAMETER_STREAM_CHANNELS "channels" // audio_channel_mask_t -#define AUDIO_PARAMETER_STREAM_FRAME_COUNT "frame_count" // size_t -#define AUDIO_PARAMETER_STREAM_INPUT_SOURCE "input_source" // audio_source_t -#define AUDIO_PARAMETER_STREAM_SAMPLING_RATE "sampling_rate" // uint32_t - -/* Query supported formats. The response is a '|' separated list of strings from - * audio_format_t enum e.g: "sup_formats=AUDIO_FORMAT_PCM_16_BIT" */ -#define AUDIO_PARAMETER_STREAM_SUP_FORMATS "sup_formats" -/* Query supported channel masks. The response is a '|' separated list of strings from - * audio_channel_mask_t enum e.g: "sup_channels=AUDIO_CHANNEL_OUT_STEREO|AUDIO_CHANNEL_OUT_MONO" */ -#define AUDIO_PARAMETER_STREAM_SUP_CHANNELS "sup_channels" -/* Query supported sampling rates. The response is a '|' separated list of integer values e.g: - * "sup_sampling_rates=44100|48000" */ -#define AUDIO_PARAMETER_STREAM_SUP_SAMPLING_RATES "sup_sampling_rates" - -/** - * audio codec parameters - */ - -#define AUDIO_OFFLOAD_CODEC_PARAMS "music_offload_codec_param" -#define AUDIO_OFFLOAD_CODEC_BIT_PER_SAMPLE "music_offload_bit_per_sample" -#define AUDIO_OFFLOAD_CODEC_BIT_RATE "music_offload_bit_rate" -#define AUDIO_OFFLOAD_CODEC_AVG_BIT_RATE "music_offload_avg_bit_rate" -#define AUDIO_OFFLOAD_CODEC_ID "music_offload_codec_id" -#define AUDIO_OFFLOAD_CODEC_BLOCK_ALIGN "music_offload_block_align" -#define AUDIO_OFFLOAD_CODEC_SAMPLE_RATE "music_offload_sample_rate" -#define AUDIO_OFFLOAD_CODEC_ENCODE_OPTION "music_offload_encode_option" -#define AUDIO_OFFLOAD_CODEC_NUM_CHANNEL "music_offload_num_channels" -#define AUDIO_OFFLOAD_CODEC_DOWN_SAMPLING "music_offload_down_sampling" -#define AUDIO_OFFLOAD_CODEC_DELAY_SAMPLES "delay_samples" -#define AUDIO_OFFLOAD_CODEC_PADDING_SAMPLES "padding_samples" - -/**************************************/ - -/* common audio stream configuration parameters - * You should memset() the entire structure to zero before use to - * ensure forward compatibility - */ -struct audio_config { - uint32_t sample_rate; - audio_channel_mask_t channel_mask; - audio_format_t format; - audio_offload_info_t offload_info; -}; -typedef struct audio_config audio_config_t; - -/* common audio stream parameters and operations */ -struct audio_stream { - - /** - * Return the sampling rate in Hz - eg. 44100. - */ - uint32_t (*get_sample_rate)(const struct audio_stream *stream); - - /* currently unused - use set_parameters with key - * AUDIO_PARAMETER_STREAM_SAMPLING_RATE - */ - int (*set_sample_rate)(struct audio_stream *stream, uint32_t rate); - - /** - * Return size of input/output buffer in bytes for this stream - eg. 4800. - * It should be a multiple of the frame size. See also get_input_buffer_size. - */ - size_t (*get_buffer_size)(const struct audio_stream *stream); - - /** - * Return the channel mask - - * e.g. AUDIO_CHANNEL_OUT_STEREO or AUDIO_CHANNEL_IN_STEREO - */ - audio_channel_mask_t (*get_channels)(const struct audio_stream *stream); - - /** - * Return the audio format - e.g. AUDIO_FORMAT_PCM_16_BIT - */ - audio_format_t (*get_format)(const struct audio_stream *stream); - - /* currently unused - use set_parameters with key - * AUDIO_PARAMETER_STREAM_FORMAT - */ - int (*set_format)(struct audio_stream *stream, audio_format_t format); - - /** - * Put the audio hardware input/output into standby mode. - * Driver should exit from standby mode at the next I/O operation. - * Returns 0 on success and <0 on failure. - */ - int (*standby)(struct audio_stream *stream); - - /** dump the state of the audio input/output device */ - int (*dump)(const struct audio_stream *stream, int fd); - - /** Return the set of device(s) which this stream is connected to */ - audio_devices_t (*get_device)(const struct audio_stream *stream); - - /** - * Currently unused - set_device() corresponds to set_parameters() with key - * AUDIO_PARAMETER_STREAM_ROUTING for both input and output. - * AUDIO_PARAMETER_STREAM_INPUT_SOURCE is an additional information used by - * input streams only. - */ - int (*set_device)(struct audio_stream *stream, audio_devices_t device); - - /** - * set/get audio stream parameters. The function accepts a list of - * parameter key value pairs in the form: key1=value1;key2=value2;... - * - * Some keys are reserved for standard parameters (See AudioParameter class) - * - * If the implementation does not accept a parameter change while - * the output is active but the parameter is acceptable otherwise, it must - * return -ENOSYS. - * - * The audio flinger will put the stream in standby and then change the - * parameter value. - */ - int (*set_parameters)(struct audio_stream *stream, const char *kv_pairs); - - /* - * Returns a pointer to a heap allocated string. The caller is responsible - * for freeing the memory for it using free(). - */ - char * (*get_parameters)(const struct audio_stream *stream, - const char *keys); - int (*add_audio_effect)(const struct audio_stream *stream, - effect_handle_t effect); - int (*remove_audio_effect)(const struct audio_stream *stream, - effect_handle_t effect); -}; -typedef struct audio_stream audio_stream_t; - -/* type of asynchronous write callback events. Mutually exclusive */ -typedef enum { - STREAM_CBK_EVENT_WRITE_READY, /* non blocking write completed */ - STREAM_CBK_EVENT_DRAIN_READY /* drain completed */ -} stream_callback_event_t; - -typedef int (*stream_callback_t)(stream_callback_event_t event, void *param, void *cookie); - -/* type of drain requested to audio_stream_out->drain(). Mutually exclusive */ -typedef enum { - AUDIO_DRAIN_ALL, /* drain() returns when all data has been played */ - AUDIO_DRAIN_EARLY_NOTIFY /* drain() returns a short time before all data - from the current track has been played to - give time for gapless track switch */ -} audio_drain_type_t; - -/** - * audio_stream_out is the abstraction interface for the audio output hardware. - * - * It provides information about various properties of the audio output - * hardware driver. - */ - -struct audio_stream_out { - struct audio_stream common; - - /** - * Return the audio hardware driver estimated latency in milliseconds. - */ - uint32_t (*get_latency)(const struct audio_stream_out *stream); - - /** - * Use this method in situations where audio mixing is done in the - * hardware. This method serves as a direct interface with hardware, - * allowing you to directly set the volume as apposed to via the framework. - * This method might produce multiple PCM outputs or hardware accelerated - * codecs, such as MP3 or AAC. - */ - int (*set_volume)(struct audio_stream_out *stream, float left, float right); - - /** - * Write audio buffer to driver. Returns number of bytes written, or a - * negative status_t. If at least one frame was written successfully prior to the error, - * it is suggested that the driver return that successful (short) byte count - * and then return an error in the subsequent call. - * - * If set_callback() has previously been called to enable non-blocking mode - * the write() is not allowed to block. It must write only the number of - * bytes that currently fit in the driver/hardware buffer and then return - * this byte count. If this is less than the requested write size the - * callback function must be called when more space is available in the - * driver/hardware buffer. - */ - ssize_t (*write)(struct audio_stream_out *stream, const void* buffer, - size_t bytes); - - /* return the number of audio frames written by the audio dsp to DAC since - * the output has exited standby - */ - int (*get_render_position)(const struct audio_stream_out *stream, - uint32_t *dsp_frames); - - /** - * get the local time at which the next write to the audio driver will be presented. - * The units are microseconds, where the epoch is decided by the local audio HAL. - */ - int (*get_next_write_timestamp)(const struct audio_stream_out *stream, - int64_t *timestamp); - - /** - * set the callback function for notifying completion of non-blocking - * write and drain. - * Calling this function implies that all future write() and drain() - * must be non-blocking and use the callback to signal completion. - */ - int (*set_callback)(struct audio_stream_out *stream, - stream_callback_t callback, void *cookie); - - /** - * Notifies to the audio driver to stop playback however the queued buffers are - * retained by the hardware. Useful for implementing pause/resume. Empty implementation - * if not supported however should be implemented for hardware with non-trivial - * latency. In the pause state audio hardware could still be using power. User may - * consider calling suspend after a timeout. - * - * Implementation of this function is mandatory for offloaded playback. - */ - int (*pause)(struct audio_stream_out* stream); - - /** - * Notifies to the audio driver to resume playback following a pause. - * Returns error if called without matching pause. - * - * Implementation of this function is mandatory for offloaded playback. - */ - int (*resume)(struct audio_stream_out* stream); - - /** - * Requests notification when data buffered by the driver/hardware has - * been played. If set_callback() has previously been called to enable - * non-blocking mode, the drain() must not block, instead it should return - * quickly and completion of the drain is notified through the callback. - * If set_callback() has not been called, the drain() must block until - * completion. - * If type==AUDIO_DRAIN_ALL, the drain completes when all previously written - * data has been played. - * If type==AUDIO_DRAIN_EARLY_NOTIFY, the drain completes shortly before all - * data for the current track has played to allow time for the framework - * to perform a gapless track switch. - * - * Drain must return immediately on stop() and flush() call - * - * Implementation of this function is mandatory for offloaded playback. - */ - int (*drain)(struct audio_stream_out* stream, audio_drain_type_t type ); - - /** - * Notifies to the audio driver to flush the queued data. Stream must already - * be paused before calling flush(). - * - * Implementation of this function is mandatory for offloaded playback. - */ - int (*flush)(struct audio_stream_out* stream); - - /** - * Return a recent count of the number of audio frames presented to an external observer. - * This excludes frames which have been written but are still in the pipeline. - * The count is not reset to zero when output enters standby. - * Also returns the value of CLOCK_MONOTONIC as of this presentation count. - * The returned count is expected to be 'recent', - * but does not need to be the most recent possible value. - * However, the associated time should correspond to whatever count is returned. - * Example: assume that N+M frames have been presented, where M is a 'small' number. - * Then it is permissible to return N instead of N+M, - * and the timestamp should correspond to N rather than N+M. - * The terms 'recent' and 'small' are not defined. - * They reflect the quality of the implementation. - * - * 3.0 and higher only. - */ - int (*get_presentation_position)(const struct audio_stream_out *stream, - uint64_t *frames, struct timespec *timestamp); - -}; -typedef struct audio_stream_out audio_stream_out_t; - -struct audio_stream_in { - struct audio_stream common; - - /** set the input gain for the audio driver. This method is for - * for future use */ - int (*set_gain)(struct audio_stream_in *stream, float gain); - - /** Read audio buffer in from audio driver. Returns number of bytes read, or a - * negative status_t. If at least one frame was read prior to the error, - * read should return that byte count and then return an error in the subsequent call. - */ - ssize_t (*read)(struct audio_stream_in *stream, void* buffer, - size_t bytes); - - /** - * Return the amount of input frames lost in the audio driver since the - * last call of this function. - * Audio driver is expected to reset the value to 0 and restart counting - * upon returning the current value by this function call. - * Such loss typically occurs when the user space process is blocked - * longer than the capacity of audio driver buffers. - * - * Unit: the number of input audio frames - */ - uint32_t (*get_input_frames_lost)(struct audio_stream_in *stream); -}; -typedef struct audio_stream_in audio_stream_in_t; - -/** - * return the frame size (number of bytes per sample). - */ -static inline size_t audio_stream_frame_size(const struct audio_stream *s) -{ - size_t chan_samp_sz; - audio_format_t format = s->get_format(s); - - if (audio_is_linear_pcm(format)) { - chan_samp_sz = audio_bytes_per_sample(format); - return popcount(s->get_channels(s)) * chan_samp_sz; - } - - return sizeof(int8_t); -} - - -/**********************************************************************/ - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -struct audio_module { - struct hw_module_t common; -}; - -struct audio_hw_device { - struct hw_device_t common; - - /** - * used by audio flinger to enumerate what devices are supported by - * each audio_hw_device implementation. - * - * Return value is a bitmask of 1 or more values of audio_devices_t - * - * NOTE: audio HAL implementations starting with - * AUDIO_DEVICE_API_VERSION_2_0 do not implement this function. - * All supported devices should be listed in audio_policy.conf - * file and the audio policy manager must choose the appropriate - * audio module based on information in this file. - */ - uint32_t (*get_supported_devices)(const struct audio_hw_device *dev); - - /** - * check to see if the audio hardware interface has been initialized. - * returns 0 on success, -ENODEV on failure. - */ - int (*init_check)(const struct audio_hw_device *dev); - - /** set the audio volume of a voice call. Range is between 0.0 and 1.0 */ - int (*set_voice_volume)(struct audio_hw_device *dev, float volume); - - /** - * set the audio volume for all audio activities other than voice call. - * Range between 0.0 and 1.0. If any value other than 0 is returned, - * the software mixer will emulate this capability. - */ - int (*set_master_volume)(struct audio_hw_device *dev, float volume); - - /** - * Get the current master volume value for the HAL, if the HAL supports - * master volume control. AudioFlinger will query this value from the - * primary audio HAL when the service starts and use the value for setting - * the initial master volume across all HALs. HALs which do not support - * this method may leave it set to NULL. - */ - int (*get_master_volume)(struct audio_hw_device *dev, float *volume); - - /** - * set_mode is called when the audio mode changes. AUDIO_MODE_NORMAL mode - * is for standard audio playback, AUDIO_MODE_RINGTONE when a ringtone is - * playing, and AUDIO_MODE_IN_CALL when a call is in progress. - */ - int (*set_mode)(struct audio_hw_device *dev, audio_mode_t mode); - - /* mic mute */ - int (*set_mic_mute)(struct audio_hw_device *dev, bool state); - int (*get_mic_mute)(const struct audio_hw_device *dev, bool *state); - - /* set/get global audio parameters */ - int (*set_parameters)(struct audio_hw_device *dev, const char *kv_pairs); - - /* - * Returns a pointer to a heap allocated string. The caller is responsible - * for freeing the memory for it using free(). - */ - char * (*get_parameters)(const struct audio_hw_device *dev, - const char *keys); - - /* Returns audio input buffer size according to parameters passed or - * 0 if one of the parameters is not supported. - * See also get_buffer_size which is for a particular stream. - */ - size_t (*get_input_buffer_size)(const struct audio_hw_device *dev, - const struct audio_config *config); - - /** This method creates and opens the audio hardware output stream */ - int (*open_output_stream)(struct audio_hw_device *dev, - audio_io_handle_t handle, - audio_devices_t devices, - audio_output_flags_t flags, - struct audio_config *config, - struct audio_stream_out **stream_out); - - void (*close_output_stream)(struct audio_hw_device *dev, - struct audio_stream_out* stream_out); - - /** This method creates and opens the audio hardware input stream */ - int (*open_input_stream)(struct audio_hw_device *dev, - audio_io_handle_t handle, - audio_devices_t devices, - struct audio_config *config, - struct audio_stream_in **stream_in); - - void (*close_input_stream)(struct audio_hw_device *dev, - struct audio_stream_in *stream_in); - - /** This method dumps the state of the audio hardware */ - int (*dump)(const struct audio_hw_device *dev, int fd); - - /** - * set the audio mute status for all audio activities. If any value other - * than 0 is returned, the software mixer will emulate this capability. - */ - int (*set_master_mute)(struct audio_hw_device *dev, bool mute); - - /** - * Get the current master mute status for the HAL, if the HAL supports - * master mute control. AudioFlinger will query this value from the primary - * audio HAL when the service starts and use the value for setting the - * initial master mute across all HALs. HALs which do not support this - * method may leave it set to NULL. - */ - int (*get_master_mute)(struct audio_hw_device *dev, bool *mute); -}; -typedef struct audio_hw_device audio_hw_device_t; - -/** convenience API for opening and closing a supported device */ - -static inline int audio_hw_device_open(const struct hw_module_t* module, - struct audio_hw_device** device) -{ - return module->methods->open(module, AUDIO_HARDWARE_INTERFACE, - (struct hw_device_t**)device); -} - -static inline int audio_hw_device_close(struct audio_hw_device* device) -{ - return device->common.close(&device->common); -} - - -__END_DECLS - -#endif // ANDROID_AUDIO_INTERFACE_H diff --git a/external/android/include/19/hardware/libhardware/include/hardware/audio_effect.h b/external/android/include/19/hardware/libhardware/include/hardware/audio_effect.h deleted file mode 100644 index b49d02d..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/audio_effect.h +++ /dev/null @@ -1,1012 +0,0 @@ -/* - * Copyright (C) 2011 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_AUDIO_EFFECT_H -#define ANDROID_AUDIO_EFFECT_H - -#include -#include -#include -#include -#include - -#include - -#include - - -__BEGIN_DECLS - - -///////////////////////////////////////////////// -// Common Definitions -///////////////////////////////////////////////// - -// -//--- Effect descriptor structure effect_descriptor_t -// - -// Unique effect ID (can be generated from the following site: -// http://www.itu.int/ITU-T/asn1/uuid.html) -// This format is used for both "type" and "uuid" fields of the effect descriptor structure. -// - When used for effect type and the engine is implementing and effect corresponding to a standard -// OpenSL ES interface, this ID must be the one defined in OpenSLES_IID.h for that interface. -// - When used as uuid, it should be a unique UUID for this particular implementation. -typedef struct effect_uuid_s { - uint32_t timeLow; - uint16_t timeMid; - uint16_t timeHiAndVersion; - uint16_t clockSeq; - uint8_t node[6]; -} effect_uuid_t; - -// Maximum length of character strings in structures defines by this API. -#define EFFECT_STRING_LEN_MAX 64 - -// NULL UUID definition (matches SL_IID_NULL_) -#define EFFECT_UUID_INITIALIZER { 0xec7178ec, 0xe5e1, 0x4432, 0xa3f4, \ - { 0x46, 0x57, 0xe6, 0x79, 0x52, 0x10 } } -static const effect_uuid_t EFFECT_UUID_NULL_ = EFFECT_UUID_INITIALIZER; -static const effect_uuid_t * const EFFECT_UUID_NULL = &EFFECT_UUID_NULL_; -static const char * const EFFECT_UUID_NULL_STR = "ec7178ec-e5e1-4432-a3f4-4657e6795210"; - - -// The effect descriptor contains necessary information to facilitate the enumeration of the effect -// engines present in a library. -typedef struct effect_descriptor_s { - effect_uuid_t type; // UUID of to the OpenSL ES interface implemented by this effect - effect_uuid_t uuid; // UUID for this particular implementation - uint32_t apiVersion; // Version of the effect control API implemented - uint32_t flags; // effect engine capabilities/requirements flags (see below) - uint16_t cpuLoad; // CPU load indication (see below) - uint16_t memoryUsage; // Data Memory usage (see below) - char name[EFFECT_STRING_LEN_MAX]; // human readable effect name - char implementor[EFFECT_STRING_LEN_MAX]; // human readable effect implementor name -} effect_descriptor_t; - -// CPU load and memory usage indication: each effect implementation must provide an indication of -// its CPU and memory usage for the audio effect framework to limit the number of effects -// instantiated at a given time on a given platform. -// The CPU load is expressed in 0.1 MIPS units as estimated on an ARM9E core (ARMv5TE) with 0 WS. -// The memory usage is expressed in KB and includes only dynamically allocated memory - -// Definitions for flags field of effect descriptor. -// +---------------------------+-----------+----------------------------------- -// | description | bits | values -// +---------------------------+-----------+----------------------------------- -// | connection mode | 0..2 | 0 insert: after track process -// | | | 1 auxiliary: connect to track auxiliary -// | | | output and use send level -// | | | 2 replace: replaces track process function; -// | | | must implement SRC, volume and mono to stereo. -// | | | 3 pre processing: applied below audio HAL on input -// | | | 4 post processing: applied below audio HAL on output -// | | | 5 - 7 reserved -// +---------------------------+-----------+----------------------------------- -// | insertion preference | 3..5 | 0 none -// | | | 1 first of the chain -// | | | 2 last of the chain -// | | | 3 exclusive (only effect in the insert chain) -// | | | 4..7 reserved -// +---------------------------+-----------+----------------------------------- -// | Volume management | 6..8 | 0 none -// | | | 1 implements volume control -// | | | 2 requires volume indication -// | | | 4 reserved -// +---------------------------+-----------+----------------------------------- -// | Device indication | 9..11 | 0 none -// | | | 1 requires device updates -// | | | 2, 4 reserved -// +---------------------------+-----------+----------------------------------- -// | Sample input mode | 12..13 | 1 direct: process() function or EFFECT_CMD_SET_CONFIG -// | | | command must specify a buffer descriptor -// | | | 2 provider: process() function uses the -// | | | bufferProvider indicated by the -// | | | EFFECT_CMD_SET_CONFIG command to request input. -// | | | buffers. -// | | | 3 both: both input modes are supported -// +---------------------------+-----------+----------------------------------- -// | Sample output mode | 14..15 | 1 direct: process() function or EFFECT_CMD_SET_CONFIG -// | | | command must specify a buffer descriptor -// | | | 2 provider: process() function uses the -// | | | bufferProvider indicated by the -// | | | EFFECT_CMD_SET_CONFIG command to request output -// | | | buffers. -// | | | 3 both: both output modes are supported -// +---------------------------+-----------+----------------------------------- -// | Hardware acceleration | 16..17 | 0 No hardware acceleration -// | | | 1 non tunneled hw acceleration: the process() function -// | | | reads the samples, send them to HW accelerated -// | | | effect processor, reads back the processed samples -// | | | and returns them to the output buffer. -// | | | 2 tunneled hw acceleration: the process() function is -// | | | transparent. The effect interface is only used to -// | | | control the effect engine. This mode is relevant for -// | | | global effects actually applied by the audio -// | | | hardware on the output stream. -// +---------------------------+-----------+----------------------------------- -// | Audio Mode indication | 18..19 | 0 none -// | | | 1 requires audio mode updates -// | | | 2..3 reserved -// +---------------------------+-----------+----------------------------------- -// | Audio source indication | 20..21 | 0 none -// | | | 1 requires audio source updates -// | | | 2..3 reserved -// +---------------------------+-----------+----------------------------------- -// | Effect offload supported | 22 | 0 The effect cannot be offloaded to an audio DSP -// | | | 1 The effect can be offloaded to an audio DSP -// +---------------------------+-----------+----------------------------------- - -// Insert mode -#define EFFECT_FLAG_TYPE_SHIFT 0 -#define EFFECT_FLAG_TYPE_SIZE 3 -#define EFFECT_FLAG_TYPE_MASK (((1 << EFFECT_FLAG_TYPE_SIZE) -1) \ - << EFFECT_FLAG_TYPE_SHIFT) -#define EFFECT_FLAG_TYPE_INSERT (0 << EFFECT_FLAG_TYPE_SHIFT) -#define EFFECT_FLAG_TYPE_AUXILIARY (1 << EFFECT_FLAG_TYPE_SHIFT) -#define EFFECT_FLAG_TYPE_REPLACE (2 << EFFECT_FLAG_TYPE_SHIFT) -#define EFFECT_FLAG_TYPE_PRE_PROC (3 << EFFECT_FLAG_TYPE_SHIFT) -#define EFFECT_FLAG_TYPE_POST_PROC (4 << EFFECT_FLAG_TYPE_SHIFT) - -// Insert preference -#define EFFECT_FLAG_INSERT_SHIFT (EFFECT_FLAG_TYPE_SHIFT + EFFECT_FLAG_TYPE_SIZE) -#define EFFECT_FLAG_INSERT_SIZE 3 -#define EFFECT_FLAG_INSERT_MASK (((1 << EFFECT_FLAG_INSERT_SIZE) -1) \ - << EFFECT_FLAG_INSERT_SHIFT) -#define EFFECT_FLAG_INSERT_ANY (0 << EFFECT_FLAG_INSERT_SHIFT) -#define EFFECT_FLAG_INSERT_FIRST (1 << EFFECT_FLAG_INSERT_SHIFT) -#define EFFECT_FLAG_INSERT_LAST (2 << EFFECT_FLAG_INSERT_SHIFT) -#define EFFECT_FLAG_INSERT_EXCLUSIVE (3 << EFFECT_FLAG_INSERT_SHIFT) - - -// Volume control -#define EFFECT_FLAG_VOLUME_SHIFT (EFFECT_FLAG_INSERT_SHIFT + EFFECT_FLAG_INSERT_SIZE) -#define EFFECT_FLAG_VOLUME_SIZE 3 -#define EFFECT_FLAG_VOLUME_MASK (((1 << EFFECT_FLAG_VOLUME_SIZE) -1) \ - << EFFECT_FLAG_VOLUME_SHIFT) -#define EFFECT_FLAG_VOLUME_CTRL (1 << EFFECT_FLAG_VOLUME_SHIFT) -#define EFFECT_FLAG_VOLUME_IND (2 << EFFECT_FLAG_VOLUME_SHIFT) -#define EFFECT_FLAG_VOLUME_NONE (0 << EFFECT_FLAG_VOLUME_SHIFT) - -// Device indication -#define EFFECT_FLAG_DEVICE_SHIFT (EFFECT_FLAG_VOLUME_SHIFT + EFFECT_FLAG_VOLUME_SIZE) -#define EFFECT_FLAG_DEVICE_SIZE 3 -#define EFFECT_FLAG_DEVICE_MASK (((1 << EFFECT_FLAG_DEVICE_SIZE) -1) \ - << EFFECT_FLAG_DEVICE_SHIFT) -#define EFFECT_FLAG_DEVICE_IND (1 << EFFECT_FLAG_DEVICE_SHIFT) -#define EFFECT_FLAG_DEVICE_NONE (0 << EFFECT_FLAG_DEVICE_SHIFT) - -// Sample input modes -#define EFFECT_FLAG_INPUT_SHIFT (EFFECT_FLAG_DEVICE_SHIFT + EFFECT_FLAG_DEVICE_SIZE) -#define EFFECT_FLAG_INPUT_SIZE 2 -#define EFFECT_FLAG_INPUT_MASK (((1 << EFFECT_FLAG_INPUT_SIZE) -1) \ - << EFFECT_FLAG_INPUT_SHIFT) -#define EFFECT_FLAG_INPUT_DIRECT (1 << EFFECT_FLAG_INPUT_SHIFT) -#define EFFECT_FLAG_INPUT_PROVIDER (2 << EFFECT_FLAG_INPUT_SHIFT) -#define EFFECT_FLAG_INPUT_BOTH (3 << EFFECT_FLAG_INPUT_SHIFT) - -// Sample output modes -#define EFFECT_FLAG_OUTPUT_SHIFT (EFFECT_FLAG_INPUT_SHIFT + EFFECT_FLAG_INPUT_SIZE) -#define EFFECT_FLAG_OUTPUT_SIZE 2 -#define EFFECT_FLAG_OUTPUT_MASK (((1 << EFFECT_FLAG_OUTPUT_SIZE) -1) \ - << EFFECT_FLAG_OUTPUT_SHIFT) -#define EFFECT_FLAG_OUTPUT_DIRECT (1 << EFFECT_FLAG_OUTPUT_SHIFT) -#define EFFECT_FLAG_OUTPUT_PROVIDER (2 << EFFECT_FLAG_OUTPUT_SHIFT) -#define EFFECT_FLAG_OUTPUT_BOTH (3 << EFFECT_FLAG_OUTPUT_SHIFT) - -// Hardware acceleration mode -#define EFFECT_FLAG_HW_ACC_SHIFT (EFFECT_FLAG_OUTPUT_SHIFT + EFFECT_FLAG_OUTPUT_SIZE) -#define EFFECT_FLAG_HW_ACC_SIZE 2 -#define EFFECT_FLAG_HW_ACC_MASK (((1 << EFFECT_FLAG_HW_ACC_SIZE) -1) \ - << EFFECT_FLAG_HW_ACC_SHIFT) -#define EFFECT_FLAG_HW_ACC_SIMPLE (1 << EFFECT_FLAG_HW_ACC_SHIFT) -#define EFFECT_FLAG_HW_ACC_TUNNEL (2 << EFFECT_FLAG_HW_ACC_SHIFT) - -// Audio mode indication -#define EFFECT_FLAG_AUDIO_MODE_SHIFT (EFFECT_FLAG_HW_ACC_SHIFT + EFFECT_FLAG_HW_ACC_SIZE) -#define EFFECT_FLAG_AUDIO_MODE_SIZE 2 -#define EFFECT_FLAG_AUDIO_MODE_MASK (((1 << EFFECT_FLAG_AUDIO_MODE_SIZE) -1) \ - << EFFECT_FLAG_AUDIO_MODE_SHIFT) -#define EFFECT_FLAG_AUDIO_MODE_IND (1 << EFFECT_FLAG_AUDIO_MODE_SHIFT) -#define EFFECT_FLAG_AUDIO_MODE_NONE (0 << EFFECT_FLAG_AUDIO_MODE_SHIFT) - -// Audio source indication -#define EFFECT_FLAG_AUDIO_SOURCE_SHIFT (EFFECT_FLAG_AUDIO_MODE_SHIFT + EFFECT_FLAG_AUDIO_MODE_SIZE) -#define EFFECT_FLAG_AUDIO_SOURCE_SIZE 2 -#define EFFECT_FLAG_AUDIO_SOURCE_MASK (((1 << EFFECT_FLAG_AUDIO_SOURCE_SIZE) -1) \ - << EFFECT_FLAG_AUDIO_SOURCE_SHIFT) -#define EFFECT_FLAG_AUDIO_SOURCE_IND (1 << EFFECT_FLAG_AUDIO_SOURCE_SHIFT) -#define EFFECT_FLAG_AUDIO_SOURCE_NONE (0 << EFFECT_FLAG_AUDIO_SOURCE_SHIFT) - -// Effect offload indication -#define EFFECT_FLAG_OFFLOAD_SHIFT (EFFECT_FLAG_AUDIO_SOURCE_SHIFT + \ - EFFECT_FLAG_AUDIO_SOURCE_SIZE) -#define EFFECT_FLAG_OFFLOAD_SIZE 1 -#define EFFECT_FLAG_OFFLOAD_MASK (((1 << EFFECT_FLAG_OFFLOAD_SIZE) -1) \ - << EFFECT_FLAG_OFFLOAD_SHIFT) -#define EFFECT_FLAG_OFFLOAD_SUPPORTED (1 << EFFECT_FLAG_OFFLOAD_SHIFT) - -#define EFFECT_MAKE_API_VERSION(M, m) (((M)<<16) | ((m) & 0xFFFF)) -#define EFFECT_API_VERSION_MAJOR(v) ((v)>>16) -#define EFFECT_API_VERSION_MINOR(v) ((m) & 0xFFFF) - - - -///////////////////////////////////////////////// -// Effect control interface -///////////////////////////////////////////////// - -// Effect control interface version 2.0 -#define EFFECT_CONTROL_API_VERSION EFFECT_MAKE_API_VERSION(2,0) - -// Effect control interface structure: effect_interface_s -// The effect control interface is exposed by each effect engine implementation. It consists of -// a set of functions controlling the configuration, activation and process of the engine. -// The functions are grouped in a structure of type effect_interface_s. -// -// Effect control interface handle: effect_handle_t -// The effect_handle_t serves two purposes regarding the implementation of the effect engine: -// - 1 it is the address of a pointer to an effect_interface_s structure where the functions -// of the effect control API for a particular effect are located. -// - 2 it is the address of the context of a particular effect instance. -// A typical implementation in the effect library would define a structure as follows: -// struct effect_module_s { -// const struct effect_interface_s *itfe; -// effect_config_t config; -// effect_context_t context; -// } -// The implementation of EffectCreate() function would then allocate a structure of this -// type and return its address as effect_handle_t -typedef struct effect_interface_s **effect_handle_t; - - -// Forward definition of type audio_buffer_t -typedef struct audio_buffer_s audio_buffer_t; - - - - - - -// Effect control interface definition -struct effect_interface_s { - //////////////////////////////////////////////////////////////////////////////// - // - // Function: process - // - // Description: Effect process function. Takes input samples as specified - // (count and location) in input buffer descriptor and output processed - // samples as specified in output buffer descriptor. If the buffer descriptor - // is not specified the function must use either the buffer or the - // buffer provider function installed by the EFFECT_CMD_SET_CONFIG command. - // The effect framework will call the process() function after the EFFECT_CMD_ENABLE - // command is received and until the EFFECT_CMD_DISABLE is received. When the engine - // receives the EFFECT_CMD_DISABLE command it should turn off the effect gracefully - // and when done indicate that it is OK to stop calling the process() function by - // returning the -ENODATA status. - // - // NOTE: the process() function implementation should be "real-time safe" that is - // it should not perform blocking calls: malloc/free, sleep, read/write/open/close, - // pthread_cond_wait/pthread_mutex_lock... - // - // Input: - // self: handle to the effect interface this function - // is called on. - // inBuffer: buffer descriptor indicating where to read samples to process. - // If NULL, use the configuration passed by EFFECT_CMD_SET_CONFIG command. - // - // outBuffer: buffer descriptor indicating where to write processed samples. - // If NULL, use the configuration passed by EFFECT_CMD_SET_CONFIG command. - // - // Output: - // returned value: 0 successful operation - // -ENODATA the engine has finished the disable phase and the framework - // can stop calling process() - // -EINVAL invalid interface handle or - // invalid input/output buffer description - //////////////////////////////////////////////////////////////////////////////// - int32_t (*process)(effect_handle_t self, - audio_buffer_t *inBuffer, - audio_buffer_t *outBuffer); - //////////////////////////////////////////////////////////////////////////////// - // - // Function: command - // - // Description: Send a command and receive a response to/from effect engine. - // - // Input: - // self: handle to the effect interface this function - // is called on. - // cmdCode: command code: the command can be a standardized command defined in - // effect_command_e (see below) or a proprietary command. - // cmdSize: size of command in bytes - // pCmdData: pointer to command data - // pReplyData: pointer to reply data - // - // Input/Output: - // replySize: maximum size of reply data as input - // actual size of reply data as output - // - // Output: - // returned value: 0 successful operation - // -EINVAL invalid interface handle or - // invalid command/reply size or format according to command code - // The return code should be restricted to indicate problems related to the this - // API specification. Status related to the execution of a particular command should be - // indicated as part of the reply field. - // - // *pReplyData updated with command response - // - //////////////////////////////////////////////////////////////////////////////// - int32_t (*command)(effect_handle_t self, - uint32_t cmdCode, - uint32_t cmdSize, - void *pCmdData, - uint32_t *replySize, - void *pReplyData); - //////////////////////////////////////////////////////////////////////////////// - // - // Function: get_descriptor - // - // Description: Returns the effect descriptor - // - // Input: - // self: handle to the effect interface this function - // is called on. - // - // Input/Output: - // pDescriptor: address where to return the effect descriptor. - // - // Output: - // returned value: 0 successful operation. - // -EINVAL invalid interface handle or invalid pDescriptor - // *pDescriptor: updated with the effect descriptor. - // - //////////////////////////////////////////////////////////////////////////////// - int32_t (*get_descriptor)(effect_handle_t self, - effect_descriptor_t *pDescriptor); - //////////////////////////////////////////////////////////////////////////////// - // - // Function: process_reverse - // - // Description: Process reverse stream function. This function is used to pass - // a reference stream to the effect engine. If the engine does not need a reference - // stream, this function pointer can be set to NULL. - // This function would typically implemented by an Echo Canceler. - // - // Input: - // self: handle to the effect interface this function - // is called on. - // inBuffer: buffer descriptor indicating where to read samples to process. - // If NULL, use the configuration passed by EFFECT_CMD_SET_CONFIG_REVERSE command. - // - // outBuffer: buffer descriptor indicating where to write processed samples. - // If NULL, use the configuration passed by EFFECT_CMD_SET_CONFIG_REVERSE command. - // If the buffer and buffer provider in the configuration received by - // EFFECT_CMD_SET_CONFIG_REVERSE are also NULL, do not return modified reverse - // stream data - // - // Output: - // returned value: 0 successful operation - // -ENODATA the engine has finished the disable phase and the framework - // can stop calling process_reverse() - // -EINVAL invalid interface handle or - // invalid input/output buffer description - //////////////////////////////////////////////////////////////////////////////// - int32_t (*process_reverse)(effect_handle_t self, - audio_buffer_t *inBuffer, - audio_buffer_t *outBuffer); -}; - - -// -//--- Standardized command codes for command() function -// -enum effect_command_e { - EFFECT_CMD_INIT, // initialize effect engine - EFFECT_CMD_SET_CONFIG, // configure effect engine (see effect_config_t) - EFFECT_CMD_RESET, // reset effect engine - EFFECT_CMD_ENABLE, // enable effect process - EFFECT_CMD_DISABLE, // disable effect process - EFFECT_CMD_SET_PARAM, // set parameter immediately (see effect_param_t) - EFFECT_CMD_SET_PARAM_DEFERRED, // set parameter deferred - EFFECT_CMD_SET_PARAM_COMMIT, // commit previous set parameter deferred - EFFECT_CMD_GET_PARAM, // get parameter - EFFECT_CMD_SET_DEVICE, // set audio device (see audio.h, audio_devices_t) - EFFECT_CMD_SET_VOLUME, // set volume - EFFECT_CMD_SET_AUDIO_MODE, // set the audio mode (normal, ring, ...) - EFFECT_CMD_SET_CONFIG_REVERSE, // configure effect engine reverse stream(see effect_config_t) - EFFECT_CMD_SET_INPUT_DEVICE, // set capture device (see audio.h, audio_devices_t) - EFFECT_CMD_GET_CONFIG, // read effect engine configuration - EFFECT_CMD_GET_CONFIG_REVERSE, // read configure effect engine reverse stream configuration - EFFECT_CMD_GET_FEATURE_SUPPORTED_CONFIGS,// get all supported configurations for a feature. - EFFECT_CMD_GET_FEATURE_CONFIG, // get current feature configuration - EFFECT_CMD_SET_FEATURE_CONFIG, // set current feature configuration - EFFECT_CMD_SET_AUDIO_SOURCE, // set the audio source (see audio.h, audio_source_t) - EFFECT_CMD_OFFLOAD, // set if effect thread is an offload one, - // send the ioHandle of the effect thread - EFFECT_CMD_FIRST_PROPRIETARY = 0x10000 // first proprietary command code -}; - -//================================================================================================== -// command: EFFECT_CMD_INIT -//-------------------------------------------------------------------------------------------------- -// description: -// Initialize effect engine: All configurations return to default -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_SET_CONFIG -//-------------------------------------------------------------------------------------------------- -// description: -// Apply new audio parameters configurations for input and output buffers -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(effect_config_t) -// data: effect_config_t -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_RESET -//-------------------------------------------------------------------------------------------------- -// description: -// Reset the effect engine. Keep configuration but resets state and buffer content -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 0 -// data: N/A -//================================================================================================== -// command: EFFECT_CMD_ENABLE -//-------------------------------------------------------------------------------------------------- -// description: -// Enable the process. Called by the framework before the first call to process() -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_DISABLE -//-------------------------------------------------------------------------------------------------- -// description: -// Disable the process. Called by the framework after the last call to process() -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_SET_PARAM -//-------------------------------------------------------------------------------------------------- -// description: -// Set a parameter and apply it immediately -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(effect_param_t) + size of param and value -// data: effect_param_t + param + value. See effect_param_t definition below for value offset -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_SET_PARAM_DEFERRED -//-------------------------------------------------------------------------------------------------- -// description: -// Set a parameter but apply it only when receiving EFFECT_CMD_SET_PARAM_COMMIT command -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(effect_param_t) + size of param and value -// data: effect_param_t + param + value. See effect_param_t definition below for value offset -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 0 -// data: N/A -//================================================================================================== -// command: EFFECT_CMD_SET_PARAM_COMMIT -//-------------------------------------------------------------------------------------------------- -// description: -// Apply all previously received EFFECT_CMD_SET_PARAM_DEFERRED commands -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_GET_PARAM -//-------------------------------------------------------------------------------------------------- -// description: -// Get a parameter value -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(effect_param_t) + size of param -// data: effect_param_t + param -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(effect_param_t) + size of param and value -// data: effect_param_t + param + value. See effect_param_t definition below for value offset -//================================================================================================== -// command: EFFECT_CMD_SET_DEVICE -//-------------------------------------------------------------------------------------------------- -// description: -// Set the rendering device the audio output path is connected to. See audio.h, audio_devices_t -// for device values. -// The effect implementation must set EFFECT_FLAG_DEVICE_IND flag in its descriptor to receive this -// command when the device changes -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(uint32_t) -// data: uint32_t -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 0 -// data: N/A -//================================================================================================== -// command: EFFECT_CMD_SET_VOLUME -//-------------------------------------------------------------------------------------------------- -// description: -// Set and get volume. Used by audio framework to delegate volume control to effect engine. -// The effect implementation must set EFFECT_FLAG_VOLUME_IND or EFFECT_FLAG_VOLUME_CTRL flag in -// its descriptor to receive this command before every call to process() function -// If EFFECT_FLAG_VOLUME_CTRL flag is set in the effect descriptor, the effect engine must return -// the volume that should be applied before the effect is processed. The overall volume (the volume -// actually applied by the effect engine multiplied by the returned value) should match the value -// indicated in the command. -//-------------------------------------------------------------------------------------------------- -// command format: -// size: n * sizeof(uint32_t) -// data: volume for each channel defined in effect_config_t for output buffer expressed in -// 8.24 fixed point format -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: n * sizeof(uint32_t) / 0 -// data: - if EFFECT_FLAG_VOLUME_CTRL is set in effect descriptor: -// volume for each channel defined in effect_config_t for output buffer expressed in -// 8.24 fixed point format -// - if EFFECT_FLAG_VOLUME_CTRL is not set in effect descriptor: -// N/A -// It is legal to receive a null pointer as pReplyData in which case the effect framework has -// delegated volume control to another effect -//================================================================================================== -// command: EFFECT_CMD_SET_AUDIO_MODE -//-------------------------------------------------------------------------------------------------- -// description: -// Set the audio mode. The effect implementation must set EFFECT_FLAG_AUDIO_MODE_IND flag in its -// descriptor to receive this command when the audio mode changes. -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(uint32_t) -// data: audio_mode_t -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 0 -// data: N/A -//================================================================================================== -// command: EFFECT_CMD_SET_CONFIG_REVERSE -//-------------------------------------------------------------------------------------------------- -// description: -// Apply new audio parameters configurations for input and output buffers of reverse stream. -// An example of reverse stream is the echo reference supplied to an Acoustic Echo Canceler. -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(effect_config_t) -// data: effect_config_t -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(int) -// data: status -//================================================================================================== -// command: EFFECT_CMD_SET_INPUT_DEVICE -//-------------------------------------------------------------------------------------------------- -// description: -// Set the capture device the audio input path is connected to. See audio.h, audio_devices_t -// for device values. -// The effect implementation must set EFFECT_FLAG_DEVICE_IND flag in its descriptor to receive this -// command when the device changes -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(uint32_t) -// data: uint32_t -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 0 -// data: N/A -//================================================================================================== -// command: EFFECT_CMD_GET_CONFIG -//-------------------------------------------------------------------------------------------------- -// description: -// Read audio parameters configurations for input and output buffers -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(effect_config_t) -// data: effect_config_t -//================================================================================================== -// command: EFFECT_CMD_GET_CONFIG_REVERSE -//-------------------------------------------------------------------------------------------------- -// description: -// Read audio parameters configurations for input and output buffers of reverse stream -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 0 -// data: N/A -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(effect_config_t) -// data: effect_config_t -//================================================================================================== -// command: EFFECT_CMD_GET_FEATURE_SUPPORTED_CONFIGS -//-------------------------------------------------------------------------------------------------- -// description: -// Queries for supported configurations for a particular feature (e.g. get the supported -// combinations of main and auxiliary channels for a noise suppressor). -// The command parameter is the feature identifier (See effect_feature_e for a list of defined -// features) followed by the maximum number of configuration descriptor to return. -// The reply is composed of: -// - status (uint32_t): -// - 0 if feature is supported -// - -ENOSYS if the feature is not supported, -// - -ENOMEM if the feature is supported but the total number of supported configurations -// exceeds the maximum number indicated by the caller. -// - total number of supported configurations (uint32_t) -// - an array of configuration descriptors. -// The actual number of descriptors returned must not exceed the maximum number indicated by -// the caller. -//-------------------------------------------------------------------------------------------------- -// command format: -// size: 2 x sizeof(uint32_t) -// data: effect_feature_e + maximum number of configurations to return -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 2 x sizeof(uint32_t) + n x sizeof () -// data: status + total number of configurations supported + array of n config descriptors -//================================================================================================== -// command: EFFECT_CMD_GET_FEATURE_CONFIG -//-------------------------------------------------------------------------------------------------- -// description: -// Retrieves current configuration for a given feature. -// The reply status is: -// - 0 if feature is supported -// - -ENOSYS if the feature is not supported, -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(uint32_t) -// data: effect_feature_e -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(uint32_t) + sizeof () -// data: status + config descriptor -//================================================================================================== -// command: EFFECT_CMD_SET_FEATURE_CONFIG -//-------------------------------------------------------------------------------------------------- -// description: -// Sets current configuration for a given feature. -// The reply status is: -// - 0 if feature is supported -// - -ENOSYS if the feature is not supported, -// - -EINVAL if the configuration is invalid -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(uint32_t) + sizeof () -// data: effect_feature_e + config descriptor -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(uint32_t) -// data: status -//================================================================================================== -// command: EFFECT_CMD_SET_AUDIO_SOURCE -//-------------------------------------------------------------------------------------------------- -// description: -// Set the audio source the capture path is configured for (Camcorder, voice recognition...). -// See audio.h, audio_source_t for values. -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(uint32_t) -// data: uint32_t -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: 0 -// data: N/A -//================================================================================================== -// command: EFFECT_CMD_OFFLOAD -//-------------------------------------------------------------------------------------------------- -// description: -// 1.indicate if the playback thread the effect is attached to is offloaded or not -// 2.update the io handle of the playback thread the effect is attached to -//-------------------------------------------------------------------------------------------------- -// command format: -// size: sizeof(effect_offload_param_t) -// data: effect_offload_param_t -//-------------------------------------------------------------------------------------------------- -// reply format: -// size: sizeof(uint32_t) -// data: uint32_t -//-------------------------------------------------------------------------------------------------- -// command: EFFECT_CMD_FIRST_PROPRIETARY -//-------------------------------------------------------------------------------------------------- -// description: -// All proprietary effect commands must use command codes above this value. The size and format of -// command and response fields is free in this case -//================================================================================================== - - -// Audio buffer descriptor used by process(), bufferProvider() functions and buffer_config_t -// structure. Multi-channel audio is always interleaved. The channel order is from LSB to MSB with -// regard to the channel mask definition in audio.h, audio_channel_mask_t e.g : -// Stereo: left, right -// 5 point 1: front left, front right, front center, low frequency, back left, back right -// The buffer size is expressed in frame count, a frame being composed of samples for all -// channels at a given time. Frame size for unspecified format (AUDIO_FORMAT_OTHER) is 8 bit by -// definition -struct audio_buffer_s { - size_t frameCount; // number of frames in buffer - union { - void* raw; // raw pointer to start of buffer - int32_t* s32; // pointer to signed 32 bit data at start of buffer - int16_t* s16; // pointer to signed 16 bit data at start of buffer - uint8_t* u8; // pointer to unsigned 8 bit data at start of buffer - }; -}; - -// The buffer_provider_s structure contains functions that can be used -// by the effect engine process() function to query and release input -// or output audio buffer. -// The getBuffer() function is called to retrieve a buffer where data -// should read from or written to by process() function. -// The releaseBuffer() function MUST be called when the buffer retrieved -// with getBuffer() is not needed anymore. -// The process function should use the buffer provider mechanism to retrieve -// input or output buffer if the inBuffer or outBuffer passed as argument is NULL -// and the buffer configuration (buffer_config_t) given by the EFFECT_CMD_SET_CONFIG -// command did not specify an audio buffer. - -typedef int32_t (* buffer_function_t)(void *cookie, audio_buffer_t *buffer); - -typedef struct buffer_provider_s { - buffer_function_t getBuffer; // retrieve next buffer - buffer_function_t releaseBuffer; // release used buffer - void *cookie; // for use by client of buffer provider functions -} buffer_provider_t; - - -// The buffer_config_s structure specifies the input or output audio format -// to be used by the effect engine. It is part of the effect_config_t -// structure that defines both input and output buffer configurations and is -// passed by the EFFECT_CMD_SET_CONFIG or EFFECT_CMD_SET_CONFIG_REVERSE command. -typedef struct buffer_config_s { - audio_buffer_t buffer; // buffer for use by process() function if not passed explicitly - uint32_t samplingRate; // sampling rate - uint32_t channels; // channel mask (see audio_channel_mask_t in audio.h) - buffer_provider_t bufferProvider; // buffer provider - uint8_t format; // Audio format (see see audio_format_t in audio.h) - uint8_t accessMode; // read/write or accumulate in buffer (effect_buffer_access_e) - uint16_t mask; // indicates which of the above fields is valid -} buffer_config_t; - -// Values for "accessMode" field of buffer_config_t: -// overwrite, read only, accumulate (read/modify/write) -enum effect_buffer_access_e { - EFFECT_BUFFER_ACCESS_WRITE, - EFFECT_BUFFER_ACCESS_READ, - EFFECT_BUFFER_ACCESS_ACCUMULATE - -}; - -// feature identifiers for EFFECT_CMD_GET_FEATURE_SUPPORTED_CONFIGS command -enum effect_feature_e { - EFFECT_FEATURE_AUX_CHANNELS, // supports auxiliary channels (e.g. dual mic noise suppressor) - EFFECT_FEATURE_CNT -}; - -// EFFECT_FEATURE_AUX_CHANNELS feature configuration descriptor. Describe a combination -// of main and auxiliary channels supported -typedef struct channel_config_s { - audio_channel_mask_t main_channels; // channel mask for main channels - audio_channel_mask_t aux_channels; // channel mask for auxiliary channels -} channel_config_t; - - -// Values for bit field "mask" in buffer_config_t. If a bit is set, the corresponding field -// in buffer_config_t must be taken into account when executing the EFFECT_CMD_SET_CONFIG command -#define EFFECT_CONFIG_BUFFER 0x0001 // buffer field must be taken into account -#define EFFECT_CONFIG_SMP_RATE 0x0002 // samplingRate field must be taken into account -#define EFFECT_CONFIG_CHANNELS 0x0004 // channels field must be taken into account -#define EFFECT_CONFIG_FORMAT 0x0008 // format field must be taken into account -#define EFFECT_CONFIG_ACC_MODE 0x0010 // accessMode field must be taken into account -#define EFFECT_CONFIG_PROVIDER 0x0020 // bufferProvider field must be taken into account -#define EFFECT_CONFIG_ALL (EFFECT_CONFIG_BUFFER | EFFECT_CONFIG_SMP_RATE | \ - EFFECT_CONFIG_CHANNELS | EFFECT_CONFIG_FORMAT | \ - EFFECT_CONFIG_ACC_MODE | EFFECT_CONFIG_PROVIDER) - - -// effect_config_s structure describes the format of the pCmdData argument of EFFECT_CMD_SET_CONFIG -// command to configure audio parameters and buffers for effect engine input and output. -typedef struct effect_config_s { - buffer_config_t inputCfg; - buffer_config_t outputCfg; -} effect_config_t; - - -// effect_param_s structure describes the format of the pCmdData argument of EFFECT_CMD_SET_PARAM -// command and pCmdData and pReplyData of EFFECT_CMD_GET_PARAM command. -// psize and vsize represent the actual size of parameter and value. -// -// NOTE: the start of value field inside the data field is always on a 32 bit boundary: -// -// +-----------+ -// | status | sizeof(int) -// +-----------+ -// | psize | sizeof(int) -// +-----------+ -// | vsize | sizeof(int) -// +-----------+ -// | | | | -// ~ parameter ~ > psize | -// | | | > ((psize - 1)/sizeof(int) + 1) * sizeof(int) -// +-----------+ | -// | padding | | -// +-----------+ -// | | | -// ~ value ~ > vsize -// | | | -// +-----------+ - -typedef struct effect_param_s { - int32_t status; // Transaction status (unused for command, used for reply) - uint32_t psize; // Parameter size - uint32_t vsize; // Value size - char data[]; // Start of Parameter + Value data -} effect_param_t; - -// structure used by EFFECT_CMD_OFFLOAD command -typedef struct effect_offload_param_s { - bool isOffload; // true if the playback thread the effect is attached to is offloaded - int ioHandle; // io handle of the playback thread the effect is attached to -} effect_offload_param_t; - - -///////////////////////////////////////////////// -// Effect library interface -///////////////////////////////////////////////// - -// Effect library interface version 3.0 -// Note that EffectsFactory.c only checks the major version component, so changes to the minor -// number can only be used for fully backwards compatible changes -#define EFFECT_LIBRARY_API_VERSION EFFECT_MAKE_API_VERSION(3,0) - -#define AUDIO_EFFECT_LIBRARY_TAG ((('A') << 24) | (('E') << 16) | (('L') << 8) | ('T')) - -// Every effect library must have a data structure named AUDIO_EFFECT_LIBRARY_INFO_SYM -// and the fields of this data structure must begin with audio_effect_library_t - -typedef struct audio_effect_library_s { - // tag must be initialized to AUDIO_EFFECT_LIBRARY_TAG - uint32_t tag; - // Version of the effect library API : 0xMMMMmmmm MMMM: Major, mmmm: minor - uint32_t version; - // Name of this library - const char *name; - // Author/owner/implementor of the library - const char *implementor; - - //////////////////////////////////////////////////////////////////////////////// - // - // Function: create_effect - // - // Description: Creates an effect engine of the specified implementation uuid and - // returns an effect control interface on this engine. The function will allocate the - // resources for an instance of the requested effect engine and return - // a handle on the effect control interface. - // - // Input: - // uuid: pointer to the effect uuid. - // sessionId: audio session to which this effect instance will be attached. All effects - // created with the same session ID are connected in series and process the same signal - // stream. Knowing that two effects are part of the same effect chain can help the - // library implement some kind of optimizations. - // ioId: identifies the output or input stream this effect is directed to at audio HAL. - // For future use especially with tunneled HW accelerated effects - // - // Input/Output: - // pHandle: address where to return the effect interface handle. - // - // Output: - // returned value: 0 successful operation. - // -ENODEV library failed to initialize - // -EINVAL invalid pEffectUuid or pHandle - // -ENOENT no effect with this uuid found - // *pHandle: updated with the effect interface handle. - // - //////////////////////////////////////////////////////////////////////////////// - int32_t (*create_effect)(const effect_uuid_t *uuid, - int32_t sessionId, - int32_t ioId, - effect_handle_t *pHandle); - - //////////////////////////////////////////////////////////////////////////////// - // - // Function: release_effect - // - // Description: Releases the effect engine whose handle is given as argument. - // All resources allocated to this particular instance of the effect are - // released. - // - // Input: - // handle: handle on the effect interface to be released. - // - // Output: - // returned value: 0 successful operation. - // -ENODEV library failed to initialize - // -EINVAL invalid interface handle - // - //////////////////////////////////////////////////////////////////////////////// - int32_t (*release_effect)(effect_handle_t handle); - - //////////////////////////////////////////////////////////////////////////////// - // - // Function: get_descriptor - // - // Description: Returns the descriptor of the effect engine which implementation UUID is - // given as argument. - // - // Input/Output: - // uuid: pointer to the effect uuid. - // pDescriptor: address where to return the effect descriptor. - // - // Output: - // returned value: 0 successful operation. - // -ENODEV library failed to initialize - // -EINVAL invalid pDescriptor or uuid - // *pDescriptor: updated with the effect descriptor. - // - //////////////////////////////////////////////////////////////////////////////// - int32_t (*get_descriptor)(const effect_uuid_t *uuid, - effect_descriptor_t *pDescriptor); -} audio_effect_library_t; - -// Name of the hal_module_info -#define AUDIO_EFFECT_LIBRARY_INFO_SYM AELI - -// Name of the hal_module_info as a string -#define AUDIO_EFFECT_LIBRARY_INFO_SYM_AS_STR "AELI" - -__END_DECLS - -#endif // ANDROID_AUDIO_EFFECT_H diff --git a/external/android/include/19/hardware/libhardware/include/hardware/audio_policy.h b/external/android/include/19/hardware/libhardware/include/hardware/audio_policy.h deleted file mode 100644 index 4e75e02..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/audio_policy.h +++ /dev/null @@ -1,455 +0,0 @@ -/* - * Copyright (C) 2011 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_AUDIO_POLICY_INTERFACE_H -#define ANDROID_AUDIO_POLICY_INTERFACE_H - -#include -#include -#include - -#include - -#include -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define AUDIO_POLICY_HARDWARE_MODULE_ID "audio_policy" - -/** - * Name of the audio devices to open - */ -#define AUDIO_POLICY_INTERFACE "policy" - -/* ---------------------------------------------------------------------------- */ - -/* - * The audio_policy and audio_policy_service_ops structs define the - * communication interfaces between the platform specific audio policy manager - * and Android generic audio policy manager. - * The platform specific audio policy manager must implement methods of the - * audio_policy struct. - * This implementation makes use of the audio_policy_service_ops to control - * the activity and configuration of audio input and output streams. - * - * The platform specific audio policy manager is in charge of the audio - * routing and volume control policies for a given platform. - * The main roles of this module are: - * - keep track of current system state (removable device connections, phone - * state, user requests...). - * System state changes and user actions are notified to audio policy - * manager with methods of the audio_policy. - * - * - process get_output() queries received when AudioTrack objects are - * created: Those queries return a handler on an output that has been - * selected, configured and opened by the audio policy manager and that - * must be used by the AudioTrack when registering to the AudioFlinger - * with the createTrack() method. - * When the AudioTrack object is released, a release_output() query - * is received and the audio policy manager can decide to close or - * reconfigure the output depending on other streams using this output and - * current system state. - * - * - similarly process get_input() and release_input() queries received from - * AudioRecord objects and configure audio inputs. - * - process volume control requests: the stream volume is converted from - * an index value (received from UI) to a float value applicable to each - * output as a function of platform specific settings and current output - * route (destination device). It also make sure that streams are not - * muted if not allowed (e.g. camera shutter sound in some countries). - */ - -/* XXX: this should be defined OUTSIDE of frameworks/base */ -struct effect_descriptor_s; - -struct audio_policy { - /* - * configuration functions - */ - - /* indicate a change in device connection status */ - int (*set_device_connection_state)(struct audio_policy *pol, - audio_devices_t device, - audio_policy_dev_state_t state, - const char *device_address); - - /* retrieve a device connection status */ - audio_policy_dev_state_t (*get_device_connection_state)( - const struct audio_policy *pol, - audio_devices_t device, - const char *device_address); - - /* indicate a change in phone state. Valid phones states are defined - * by audio_mode_t */ - void (*set_phone_state)(struct audio_policy *pol, audio_mode_t state); - - /* deprecated, never called (was "indicate a change in ringer mode") */ - void (*set_ringer_mode)(struct audio_policy *pol, uint32_t mode, - uint32_t mask); - - /* force using a specific device category for the specified usage */ - void (*set_force_use)(struct audio_policy *pol, - audio_policy_force_use_t usage, - audio_policy_forced_cfg_t config); - - /* retrieve current device category forced for a given usage */ - audio_policy_forced_cfg_t (*get_force_use)(const struct audio_policy *pol, - audio_policy_force_use_t usage); - - /* if can_mute is true, then audio streams that are marked ENFORCED_AUDIBLE - * can still be muted. */ - void (*set_can_mute_enforced_audible)(struct audio_policy *pol, - bool can_mute); - - /* check proper initialization */ - int (*init_check)(const struct audio_policy *pol); - - /* - * Audio routing query functions - */ - - /* request an output appropriate for playback of the supplied stream type and - * parameters */ - audio_io_handle_t (*get_output)(struct audio_policy *pol, - audio_stream_type_t stream, - uint32_t samplingRate, - audio_format_t format, - audio_channel_mask_t channelMask, - audio_output_flags_t flags, - const audio_offload_info_t *offloadInfo); - - /* indicates to the audio policy manager that the output starts being used - * by corresponding stream. */ - int (*start_output)(struct audio_policy *pol, - audio_io_handle_t output, - audio_stream_type_t stream, - int session); - - /* indicates to the audio policy manager that the output stops being used - * by corresponding stream. */ - int (*stop_output)(struct audio_policy *pol, - audio_io_handle_t output, - audio_stream_type_t stream, - int session); - - /* releases the output. */ - void (*release_output)(struct audio_policy *pol, audio_io_handle_t output); - - /* request an input appropriate for record from the supplied device with - * supplied parameters. */ - audio_io_handle_t (*get_input)(struct audio_policy *pol, audio_source_t inputSource, - uint32_t samplingRate, - audio_format_t format, - audio_channel_mask_t channelMask, - audio_in_acoustics_t acoustics); - - /* indicates to the audio policy manager that the input starts being used */ - int (*start_input)(struct audio_policy *pol, audio_io_handle_t input); - - /* indicates to the audio policy manager that the input stops being used. */ - int (*stop_input)(struct audio_policy *pol, audio_io_handle_t input); - - /* releases the input. */ - void (*release_input)(struct audio_policy *pol, audio_io_handle_t input); - - /* - * volume control functions - */ - - /* initialises stream volume conversion parameters by specifying volume - * index range. The index range for each stream is defined by AudioService. */ - void (*init_stream_volume)(struct audio_policy *pol, - audio_stream_type_t stream, - int index_min, - int index_max); - - /* sets the new stream volume at a level corresponding to the supplied - * index. The index is within the range specified by init_stream_volume() */ - int (*set_stream_volume_index)(struct audio_policy *pol, - audio_stream_type_t stream, - int index); - - /* retrieve current volume index for the specified stream */ - int (*get_stream_volume_index)(const struct audio_policy *pol, - audio_stream_type_t stream, - int *index); - - /* sets the new stream volume at a level corresponding to the supplied - * index for the specified device. - * The index is within the range specified by init_stream_volume() */ - int (*set_stream_volume_index_for_device)(struct audio_policy *pol, - audio_stream_type_t stream, - int index, - audio_devices_t device); - - /* retrieve current volume index for the specified stream for the specified device */ - int (*get_stream_volume_index_for_device)(const struct audio_policy *pol, - audio_stream_type_t stream, - int *index, - audio_devices_t device); - - /* return the strategy corresponding to a given stream type */ - uint32_t (*get_strategy_for_stream)(const struct audio_policy *pol, - audio_stream_type_t stream); - - /* return the enabled output devices for the given stream type */ - audio_devices_t (*get_devices_for_stream)(const struct audio_policy *pol, - audio_stream_type_t stream); - - /* Audio effect management */ - audio_io_handle_t (*get_output_for_effect)(struct audio_policy *pol, - const struct effect_descriptor_s *desc); - - int (*register_effect)(struct audio_policy *pol, - const struct effect_descriptor_s *desc, - audio_io_handle_t output, - uint32_t strategy, - int session, - int id); - - int (*unregister_effect)(struct audio_policy *pol, int id); - - int (*set_effect_enabled)(struct audio_policy *pol, int id, bool enabled); - - bool (*is_stream_active)(const struct audio_policy *pol, - audio_stream_type_t stream, - uint32_t in_past_ms); - - bool (*is_stream_active_remotely)(const struct audio_policy *pol, - audio_stream_type_t stream, - uint32_t in_past_ms); - - bool (*is_source_active)(const struct audio_policy *pol, - audio_source_t source); - - /* dump state */ - int (*dump)(const struct audio_policy *pol, int fd); - - /* check if offload is possible for given sample rate, bitrate, duration, ... */ - bool (*is_offload_supported)(const struct audio_policy *pol, - const audio_offload_info_t *info); -}; - -/* audio hw module handle used by load_hw_module(), open_output_on_module() - * and open_input_on_module() */ -typedef int audio_module_handle_t; - -struct audio_policy_service_ops { - /* - * Audio output Control functions - */ - - /* Opens an audio output with the requested parameters. - * - * The parameter values can indicate to use the default values in case the - * audio policy manager has no specific requirements for the output being - * opened. - * - * When the function returns, the parameter values reflect the actual - * values used by the audio hardware output stream. - * - * The audio policy manager can check if the proposed parameters are - * suitable or not and act accordingly. - */ - audio_io_handle_t (*open_output)(void *service, - audio_devices_t *pDevices, - uint32_t *pSamplingRate, - audio_format_t *pFormat, - audio_channel_mask_t *pChannelMask, - uint32_t *pLatencyMs, - audio_output_flags_t flags); - - /* creates a special output that is duplicated to the two outputs passed as - * arguments. The duplication is performed by - * a special mixer thread in the AudioFlinger. - */ - audio_io_handle_t (*open_duplicate_output)(void *service, - audio_io_handle_t output1, - audio_io_handle_t output2); - - /* closes the output stream */ - int (*close_output)(void *service, audio_io_handle_t output); - - /* suspends the output. - * - * When an output is suspended, the corresponding audio hardware output - * stream is placed in standby and the AudioTracks attached to the mixer - * thread are still processed but the output mix is discarded. - */ - int (*suspend_output)(void *service, audio_io_handle_t output); - - /* restores a suspended output. */ - int (*restore_output)(void *service, audio_io_handle_t output); - - /* */ - /* Audio input Control functions */ - /* */ - - /* opens an audio input - * deprecated - new implementations should use open_input_on_module, - * and the acoustics parameter is ignored - */ - audio_io_handle_t (*open_input)(void *service, - audio_devices_t *pDevices, - uint32_t *pSamplingRate, - audio_format_t *pFormat, - audio_channel_mask_t *pChannelMask, - audio_in_acoustics_t acoustics); - - /* closes an audio input */ - int (*close_input)(void *service, audio_io_handle_t input); - - /* */ - /* misc control functions */ - /* */ - - /* set a stream volume for a particular output. - * - * For the same user setting, a given stream type can have different - * volumes for each output (destination device) it is attached to. - */ - int (*set_stream_volume)(void *service, - audio_stream_type_t stream, - float volume, - audio_io_handle_t output, - int delay_ms); - - /* reroute a given stream type to the specified output */ - int (*set_stream_output)(void *service, - audio_stream_type_t stream, - audio_io_handle_t output); - - /* function enabling to send proprietary informations directly from audio - * policy manager to audio hardware interface. */ - void (*set_parameters)(void *service, - audio_io_handle_t io_handle, - const char *kv_pairs, - int delay_ms); - - /* function enabling to receive proprietary informations directly from - * audio hardware interface to audio policy manager. - * - * Returns a pointer to a heap allocated string. The caller is responsible - * for freeing the memory for it using free(). - */ - - char * (*get_parameters)(void *service, audio_io_handle_t io_handle, - const char *keys); - - /* request the playback of a tone on the specified stream. - * used for instance to replace notification sounds when playing over a - * telephony device during a phone call. - */ - int (*start_tone)(void *service, - audio_policy_tone_t tone, - audio_stream_type_t stream); - - int (*stop_tone)(void *service); - - /* set down link audio volume. */ - int (*set_voice_volume)(void *service, - float volume, - int delay_ms); - - /* move effect to the specified output */ - int (*move_effects)(void *service, - int session, - audio_io_handle_t src_output, - audio_io_handle_t dst_output); - - /* loads an audio hw module. - * - * The module name passed is the base name of the HW module library, e.g "primary" or "a2dp". - * The function returns a handle on the module that will be used to specify a particular - * module when calling open_output_on_module() or open_input_on_module() - */ - audio_module_handle_t (*load_hw_module)(void *service, - const char *name); - - /* Opens an audio output on a particular HW module. - * - * Same as open_output() but specifying a specific HW module on which the output must be opened. - */ - audio_io_handle_t (*open_output_on_module)(void *service, - audio_module_handle_t module, - audio_devices_t *pDevices, - uint32_t *pSamplingRate, - audio_format_t *pFormat, - audio_channel_mask_t *pChannelMask, - uint32_t *pLatencyMs, - audio_output_flags_t flags, - const audio_offload_info_t *offloadInfo); - - /* Opens an audio input on a particular HW module. - * - * Same as open_input() but specifying a specific HW module on which the input must be opened. - * Also removed deprecated acoustics parameter - */ - audio_io_handle_t (*open_input_on_module)(void *service, - audio_module_handle_t module, - audio_devices_t *pDevices, - uint32_t *pSamplingRate, - audio_format_t *pFormat, - audio_channel_mask_t *pChannelMask); - -}; - -/**********************************************************************/ - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -typedef struct audio_policy_module { - struct hw_module_t common; -} audio_policy_module_t; - -struct audio_policy_device { - struct hw_device_t common; - - int (*create_audio_policy)(const struct audio_policy_device *device, - struct audio_policy_service_ops *aps_ops, - void *service, - struct audio_policy **ap); - - int (*destroy_audio_policy)(const struct audio_policy_device *device, - struct audio_policy *ap); -}; - -/** convenience API for opening and closing a supported device */ - -static inline int audio_policy_dev_open(const hw_module_t* module, - struct audio_policy_device** device) -{ - return module->methods->open(module, AUDIO_POLICY_INTERFACE, - (hw_device_t**)device); -} - -static inline int audio_policy_dev_close(struct audio_policy_device* device) -{ - return device->common.close(&device->common); -} - - -__END_DECLS - -#endif // ANDROID_AUDIO_POLICY_INTERFACE_H diff --git a/external/android/include/19/hardware/libhardware/include/hardware/bluetooth.h b/external/android/include/19/hardware/libhardware/include/hardware/bluetooth.h deleted file mode 100644 index c00a8f7..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/bluetooth.h +++ /dev/null @@ -1,470 +0,0 @@ -/* - * Copyright (C) 2012 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_INCLUDE_BLUETOOTH_H -#define ANDROID_INCLUDE_BLUETOOTH_H - -#include -#include -#include - -#include - -__BEGIN_DECLS - -/** - * The Bluetooth Hardware Module ID - */ - -#define BT_HARDWARE_MODULE_ID "bluetooth" -#define BT_STACK_MODULE_ID "bluetooth" -#define BT_STACK_TEST_MODULE_ID "bluetooth_test" - - -/* Bluetooth profile interface IDs */ - -#define BT_PROFILE_HANDSFREE_ID "handsfree" -#define BT_PROFILE_ADVANCED_AUDIO_ID "a2dp" -#define BT_PROFILE_HEALTH_ID "health" -#define BT_PROFILE_SOCKETS_ID "socket" -#define BT_PROFILE_HIDHOST_ID "hidhost" -#define BT_PROFILE_PAN_ID "pan" - -#define BT_PROFILE_GATT_ID "gatt" -#define BT_PROFILE_AV_RC_ID "avrcp" - -/** Bluetooth Address */ -typedef struct { - uint8_t address[6]; -} __attribute__((packed))bt_bdaddr_t; - -/** Bluetooth Device Name */ -typedef struct { - uint8_t name[249]; -} __attribute__((packed))bt_bdname_t; - -/** Bluetooth Adapter Visibility Modes*/ -typedef enum { - BT_SCAN_MODE_NONE, - BT_SCAN_MODE_CONNECTABLE, - BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE -} bt_scan_mode_t; - -/** Bluetooth Adapter State */ -typedef enum { - BT_STATE_OFF, - BT_STATE_ON -} bt_state_t; - -/** Bluetooth Error Status */ -/** We need to build on this */ - -typedef enum { - BT_STATUS_SUCCESS, - BT_STATUS_FAIL, - BT_STATUS_NOT_READY, - BT_STATUS_NOMEM, - BT_STATUS_BUSY, - BT_STATUS_DONE, /* request already completed */ - BT_STATUS_UNSUPPORTED, - BT_STATUS_PARM_INVALID, - BT_STATUS_UNHANDLED, - BT_STATUS_AUTH_FAILURE, - BT_STATUS_RMT_DEV_DOWN - -} bt_status_t; - -/** Bluetooth PinKey Code */ -typedef struct { - uint8_t pin[16]; -} __attribute__((packed))bt_pin_code_t; - -/** Bluetooth Adapter Discovery state */ -typedef enum { - BT_DISCOVERY_STOPPED, - BT_DISCOVERY_STARTED -} bt_discovery_state_t; - -/** Bluetooth ACL connection state */ -typedef enum { - BT_ACL_STATE_CONNECTED, - BT_ACL_STATE_DISCONNECTED -} bt_acl_state_t; - -/** Bluetooth 128-bit UUID */ -typedef struct { - uint8_t uu[16]; -} bt_uuid_t; - -/** Bluetooth SDP service record */ -typedef struct -{ - bt_uuid_t uuid; - uint16_t channel; - char name[256]; // what's the maximum length -} bt_service_record_t; - - -/** Bluetooth Remote Version info */ -typedef struct -{ - int version; - int sub_ver; - int manufacturer; -} bt_remote_version_t; - -/* Bluetooth Adapter and Remote Device property types */ -typedef enum { - /* Properties common to both adapter and remote device */ - /** - * Description - Bluetooth Device Name - * Access mode - Adapter name can be GET/SET. Remote device can be GET - * Data type - bt_bdname_t - */ - BT_PROPERTY_BDNAME = 0x1, - /** - * Description - Bluetooth Device Address - * Access mode - Only GET. - * Data type - bt_bdaddr_t - */ - BT_PROPERTY_BDADDR, - /** - * Description - Bluetooth Service 128-bit UUIDs - * Access mode - Only GET. - * Data type - Array of bt_uuid_t (Array size inferred from property length). - */ - BT_PROPERTY_UUIDS, - /** - * Description - Bluetooth Class of Device as found in Assigned Numbers - * Access mode - Only GET. - * Data type - uint32_t. - */ - BT_PROPERTY_CLASS_OF_DEVICE, - /** - * Description - Device Type - BREDR, BLE or DUAL Mode - * Access mode - Only GET. - * Data type - bt_device_type_t - */ - BT_PROPERTY_TYPE_OF_DEVICE, - /** - * Description - Bluetooth Service Record - * Access mode - Only GET. - * Data type - bt_service_record_t - */ - BT_PROPERTY_SERVICE_RECORD, - - /* Properties unique to adapter */ - /** - * Description - Bluetooth Adapter scan mode - * Access mode - GET and SET - * Data type - bt_scan_mode_t. - */ - BT_PROPERTY_ADAPTER_SCAN_MODE, - /** - * Description - List of bonded devices - * Access mode - Only GET. - * Data type - Array of bt_bdaddr_t of the bonded remote devices - * (Array size inferred from property length). - */ - BT_PROPERTY_ADAPTER_BONDED_DEVICES, - /** - * Description - Bluetooth Adapter Discovery timeout (in seconds) - * Access mode - GET and SET - * Data type - uint32_t - */ - BT_PROPERTY_ADAPTER_DISCOVERY_TIMEOUT, - - /* Properties unique to remote device */ - /** - * Description - User defined friendly name of the remote device - * Access mode - GET and SET - * Data type - bt_bdname_t. - */ - BT_PROPERTY_REMOTE_FRIENDLY_NAME, - /** - * Description - RSSI value of the inquired remote device - * Access mode - Only GET. - * Data type - int32_t. - */ - BT_PROPERTY_REMOTE_RSSI, - /** - * Description - Remote version info - * Access mode - SET/GET. - * Data type - bt_remote_version_t. - */ - - BT_PROPERTY_REMOTE_VERSION_INFO, - - BT_PROPERTY_REMOTE_DEVICE_TIMESTAMP = 0xFF, -} bt_property_type_t; - -/** Bluetooth Adapter Property data structure */ -typedef struct -{ - bt_property_type_t type; - int len; - void *val; -} bt_property_t; - -/** Bluetooth Device Type */ -typedef enum { - BT_DEVICE_DEVTYPE_BREDR = 0x1, - BT_DEVICE_DEVTYPE_BLE, - BT_DEVICE_DEVTYPE_DUAL -} bt_device_type_t; -/** Bluetooth Bond state */ -typedef enum { - BT_BOND_STATE_NONE, - BT_BOND_STATE_BONDING, - BT_BOND_STATE_BONDED -} bt_bond_state_t; - -/** Bluetooth SSP Bonding Variant */ -typedef enum { - BT_SSP_VARIANT_PASSKEY_CONFIRMATION, - BT_SSP_VARIANT_PASSKEY_ENTRY, - BT_SSP_VARIANT_CONSENT, - BT_SSP_VARIANT_PASSKEY_NOTIFICATION -} bt_ssp_variant_t; - -#define BT_MAX_NUM_UUIDS 32 - -/** Bluetooth Interface callbacks */ - -/** Bluetooth Enable/Disable Callback. */ -typedef void (*adapter_state_changed_callback)(bt_state_t state); - -/** GET/SET Adapter Properties callback */ -/* TODO: For the GET/SET property APIs/callbacks, we may need a session - * identifier to associate the call with the callback. This would be needed - * whenever more than one simultaneous instance of the same adapter_type - * is get/set. - * - * If this is going to be handled in the Java framework, then we do not need - * to manage sessions here. - */ -typedef void (*adapter_properties_callback)(bt_status_t status, - int num_properties, - bt_property_t *properties); - -/** GET/SET Remote Device Properties callback */ -/** TODO: For remote device properties, do not see a need to get/set - * multiple properties - num_properties shall be 1 - */ -typedef void (*remote_device_properties_callback)(bt_status_t status, - bt_bdaddr_t *bd_addr, - int num_properties, - bt_property_t *properties); - -/** New device discovered callback */ -/** If EIR data is not present, then BD_NAME and RSSI shall be NULL and -1 - * respectively */ -typedef void (*device_found_callback)(int num_properties, - bt_property_t *properties); - -/** Discovery state changed callback */ -typedef void (*discovery_state_changed_callback)(bt_discovery_state_t state); - -/** Bluetooth Legacy PinKey Request callback */ -typedef void (*pin_request_callback)(bt_bdaddr_t *remote_bd_addr, - bt_bdname_t *bd_name, uint32_t cod); - -/** Bluetooth SSP Request callback - Just Works & Numeric Comparison*/ -/** pass_key - Shall be 0 for BT_SSP_PAIRING_VARIANT_CONSENT & - * BT_SSP_PAIRING_PASSKEY_ENTRY */ -/* TODO: Passkey request callback shall not be needed for devices with display - * capability. We still need support this in the stack for completeness */ -typedef void (*ssp_request_callback)(bt_bdaddr_t *remote_bd_addr, - bt_bdname_t *bd_name, - uint32_t cod, - bt_ssp_variant_t pairing_variant, - uint32_t pass_key); - -/** Bluetooth Bond state changed callback */ -/* Invoked in response to create_bond, cancel_bond or remove_bond */ -typedef void (*bond_state_changed_callback)(bt_status_t status, - bt_bdaddr_t *remote_bd_addr, - bt_bond_state_t state); - -/** Bluetooth ACL connection state changed callback */ -typedef void (*acl_state_changed_callback)(bt_status_t status, bt_bdaddr_t *remote_bd_addr, - bt_acl_state_t state); - -typedef enum { - ASSOCIATE_JVM, - DISASSOCIATE_JVM -} bt_cb_thread_evt; - -/** Thread Associate/Disassociate JVM Callback */ -/* Callback that is invoked by the callback thread to allow upper layer to attach/detach to/from - * the JVM */ -typedef void (*callback_thread_event)(bt_cb_thread_evt evt); - -/** Bluetooth Test Mode Callback */ -/* Receive any HCI event from controller. Must be in DUT Mode for this callback to be received */ -typedef void (*dut_mode_recv_callback)(uint16_t opcode, uint8_t *buf, uint8_t len); - -/* LE Test mode callbacks -* This callback shall be invoked whenever the le_tx_test, le_rx_test or le_test_end is invoked -* The num_packets is valid only for le_test_end command */ -typedef void (*le_test_mode_callback)(bt_status_t status, uint16_t num_packets); -/** TODO: Add callbacks for Link Up/Down and other generic - * notifications/callbacks */ - -/** Bluetooth DM callback structure. */ -typedef struct { - /** set to sizeof(bt_callbacks_t) */ - size_t size; - adapter_state_changed_callback adapter_state_changed_cb; - adapter_properties_callback adapter_properties_cb; - remote_device_properties_callback remote_device_properties_cb; - device_found_callback device_found_cb; - discovery_state_changed_callback discovery_state_changed_cb; - pin_request_callback pin_request_cb; - ssp_request_callback ssp_request_cb; - bond_state_changed_callback bond_state_changed_cb; - acl_state_changed_callback acl_state_changed_cb; - callback_thread_event thread_evt_cb; - dut_mode_recv_callback dut_mode_recv_cb; - le_test_mode_callback le_test_mode_cb; -} bt_callbacks_t; - -/** NOTE: By default, no profiles are initialized at the time of init/enable. - * Whenever the application invokes the 'init' API of a profile, then one of - * the following shall occur: - * - * 1.) If Bluetooth is not enabled, then the Bluetooth core shall mark the - * profile as enabled. Subsequently, when the application invokes the - * Bluetooth 'enable', as part of the enable sequence the profile that were - * marked shall be enabled by calling appropriate stack APIs. The - * 'adapter_properties_cb' shall return the list of UUIDs of the - * enabled profiles. - * - * 2.) If Bluetooth is enabled, then the Bluetooth core shall invoke the stack - * profile API to initialize the profile and trigger a - * 'adapter_properties_cb' with the current list of UUIDs including the - * newly added profile's UUID. - * - * The reverse shall occur whenever the profile 'cleanup' APIs are invoked - */ - -/** Represents the standard Bluetooth DM interface. */ -typedef struct { - /** set to sizeof(bt_interface_t) */ - size_t size; - /** - * Opens the interface and provides the callback routines - * to the implemenation of this interface. - */ - int (*init)(bt_callbacks_t* callbacks ); - - /** Enable Bluetooth. */ - int (*enable)(void); - - /** Disable Bluetooth. */ - int (*disable)(void); - - /** Closes the interface. */ - void (*cleanup)(void); - - /** Get all Bluetooth Adapter properties at init */ - int (*get_adapter_properties)(void); - - /** Get Bluetooth Adapter property of 'type' */ - int (*get_adapter_property)(bt_property_type_t type); - - /** Set Bluetooth Adapter property of 'type' */ - /* Based on the type, val shall be one of - * bt_bdaddr_t or bt_bdname_t or bt_scanmode_t etc - */ - int (*set_adapter_property)(const bt_property_t *property); - - /** Get all Remote Device properties */ - int (*get_remote_device_properties)(bt_bdaddr_t *remote_addr); - - /** Get Remote Device property of 'type' */ - int (*get_remote_device_property)(bt_bdaddr_t *remote_addr, - bt_property_type_t type); - - /** Set Remote Device property of 'type' */ - int (*set_remote_device_property)(bt_bdaddr_t *remote_addr, - const bt_property_t *property); - - /** Get Remote Device's service record for the given UUID */ - int (*get_remote_service_record)(bt_bdaddr_t *remote_addr, - bt_uuid_t *uuid); - - /** Start SDP to get remote services */ - int (*get_remote_services)(bt_bdaddr_t *remote_addr); - - /** Start Discovery */ - int (*start_discovery)(void); - - /** Cancel Discovery */ - int (*cancel_discovery)(void); - - /** Create Bluetooth Bonding */ - int (*create_bond)(const bt_bdaddr_t *bd_addr); - - /** Remove Bond */ - int (*remove_bond)(const bt_bdaddr_t *bd_addr); - - /** Cancel Bond */ - int (*cancel_bond)(const bt_bdaddr_t *bd_addr); - - /** BT Legacy PinKey Reply */ - /** If accept==FALSE, then pin_len and pin_code shall be 0x0 */ - int (*pin_reply)(const bt_bdaddr_t *bd_addr, uint8_t accept, - uint8_t pin_len, bt_pin_code_t *pin_code); - - /** BT SSP Reply - Just Works, Numeric Comparison and Passkey - * passkey shall be zero for BT_SSP_VARIANT_PASSKEY_COMPARISON & - * BT_SSP_VARIANT_CONSENT - * For BT_SSP_VARIANT_PASSKEY_ENTRY, if accept==FALSE, then passkey - * shall be zero */ - int (*ssp_reply)(const bt_bdaddr_t *bd_addr, bt_ssp_variant_t variant, - uint8_t accept, uint32_t passkey); - - /** Get Bluetooth profile interface */ - const void* (*get_profile_interface) (const char *profile_id); - - /** Bluetooth Test Mode APIs - Bluetooth must be enabled for these APIs */ - /* Configure DUT Mode - Use this mode to enter/exit DUT mode */ - int (*dut_mode_configure)(uint8_t enable); - - /* Send any test HCI (vendor-specific) command to the controller. Must be in DUT Mode */ - int (*dut_mode_send)(uint16_t opcode, uint8_t *buf, uint8_t len); - /** BLE Test Mode APIs */ - /* opcode MUST be one of: LE_Receiver_Test, LE_Transmitter_Test, LE_Test_End */ - int (*le_test_mode)(uint16_t opcode, uint8_t *buf, uint8_t len); - - /* enable or disable bluetooth HCI snoop log */ - int (*config_hci_snoop_log)(uint8_t enable); -} bt_interface_t; - -/** TODO: Need to add APIs for Service Discovery, Service authorization and - * connection management. Also need to add APIs for configuring - * properties of remote bonded devices such as name, UUID etc. */ - -typedef struct { - struct hw_device_t common; - const bt_interface_t* (*get_bluetooth_interface)(); -} bluetooth_device_t; - -typedef bluetooth_device_t bluetooth_module_t; -__END_DECLS - -#endif /* ANDROID_INCLUDE_BLUETOOTH_H */ diff --git a/external/android/include/19/hardware/libhardware/include/hardware/bt_av.h b/external/android/include/19/hardware/libhardware/include/hardware/bt_av.h deleted file mode 100644 index 2ec00c3..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/bt_av.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 2012 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_INCLUDE_BT_AV_H -#define ANDROID_INCLUDE_BT_AV_H - -__BEGIN_DECLS - -/* Bluetooth AV connection states */ -typedef enum { - BTAV_CONNECTION_STATE_DISCONNECTED = 0, - BTAV_CONNECTION_STATE_CONNECTING, - BTAV_CONNECTION_STATE_CONNECTED, - BTAV_CONNECTION_STATE_DISCONNECTING -} btav_connection_state_t; - -/* Bluetooth AV datapath states */ -typedef enum { - BTAV_AUDIO_STATE_REMOTE_SUSPEND = 0, - BTAV_AUDIO_STATE_STOPPED, - BTAV_AUDIO_STATE_STARTED, -} btav_audio_state_t; - - -/** Callback for connection state change. - * state will have one of the values from btav_connection_state_t - */ -typedef void (* btav_connection_state_callback)(btav_connection_state_t state, - bt_bdaddr_t *bd_addr); - -/** Callback for audiopath state change. - * state will have one of the values from btav_audio_state_t - */ -typedef void (* btav_audio_state_callback)(btav_audio_state_t state, - bt_bdaddr_t *bd_addr); - -/** BT-AV callback structure. */ -typedef struct { - /** set to sizeof(btav_callbacks_t) */ - size_t size; - btav_connection_state_callback connection_state_cb; - btav_audio_state_callback audio_state_cb; -} btav_callbacks_t; - -/** - * NOTE: - * - * 1. AVRCP 1.0 shall be supported initially. AVRCP passthrough commands - * shall be handled internally via uinput - * - * 2. A2DP data path shall be handled via a socket pipe between the AudioFlinger - * android_audio_hw library and the Bluetooth stack. - * - */ -/** Represents the standard BT-AV interface. */ -typedef struct { - - /** set to sizeof(btav_interface_t) */ - size_t size; - /** - * Register the BtAv callbacks - */ - bt_status_t (*init)( btav_callbacks_t* callbacks ); - - /** connect to headset */ - bt_status_t (*connect)( bt_bdaddr_t *bd_addr ); - - /** dis-connect from headset */ - bt_status_t (*disconnect)( bt_bdaddr_t *bd_addr ); - - /** Closes the interface. */ - void (*cleanup)( void ); -} btav_interface_t; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_BT_AV_H */ diff --git a/external/android/include/19/hardware/libhardware/include/hardware/bt_gatt.h b/external/android/include/19/hardware/libhardware/include/hardware/bt_gatt.h deleted file mode 100644 index 42e14c2..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/bt_gatt.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2013 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_INCLUDE_BT_GATT_H -#define ANDROID_INCLUDE_BT_GATT_H - -#include -#include "bt_gatt_client.h" -#include "bt_gatt_server.h" - -__BEGIN_DECLS - -/** BT-GATT callbacks */ -typedef struct { - /** Set to sizeof(btgatt_callbacks_t) */ - size_t size; - - /** GATT Client callbacks */ - const btgatt_client_callbacks_t* client; - - /** GATT Server callbacks */ - const btgatt_server_callbacks_t* server; -} btgatt_callbacks_t; - -/** Represents the standard Bluetooth GATT interface. */ -typedef struct { - /** Set to sizeof(btgatt_interface_t) */ - size_t size; - - /** - * Initializes the interface and provides callback routines - */ - bt_status_t (*init)( const btgatt_callbacks_t* callbacks ); - - /** Closes the interface */ - void (*cleanup)( void ); - - /** Pointer to the GATT client interface methods.*/ - const btgatt_client_interface_t* client; - - /** Pointer to the GATT server interface methods.*/ - const btgatt_server_interface_t* server; -} btgatt_interface_t; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_BT_GATT_H */ diff --git a/external/android/include/19/hardware/libhardware/include/hardware/bt_gatt_client.h b/external/android/include/19/hardware/libhardware/include/hardware/bt_gatt_client.h deleted file mode 100644 index d6b0cb4..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/bt_gatt_client.h +++ /dev/null @@ -1,289 +0,0 @@ -/* - * Copyright (C) 2013 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_INCLUDE_BT_GATT_CLIENT_H -#define ANDROID_INCLUDE_BT_GATT_CLIENT_H - -#include -#include "bt_gatt_types.h" - -__BEGIN_DECLS - -/** - * Buffer sizes for maximum attribute length and maximum read/write - * operation buffer size. - */ -#define BTGATT_MAX_ATTR_LEN 600 - -/** Buffer type for unformatted reads/writes */ -typedef struct -{ - uint8_t value[BTGATT_MAX_ATTR_LEN]; - uint16_t len; -} btgatt_unformatted_value_t; - -/** Parameters for GATT read operations */ -typedef struct -{ - btgatt_srvc_id_t srvc_id; - btgatt_gatt_id_t char_id; - btgatt_gatt_id_t descr_id; - btgatt_unformatted_value_t value; - uint16_t value_type; - uint8_t status; -} btgatt_read_params_t; - -/** Parameters for GATT write operations */ -typedef struct -{ - btgatt_srvc_id_t srvc_id; - btgatt_gatt_id_t char_id; - btgatt_gatt_id_t descr_id; - uint8_t status; -} btgatt_write_params_t; - -/** Attribute change notification parameters */ -typedef struct -{ - uint8_t value[BTGATT_MAX_ATTR_LEN]; - bt_bdaddr_t bda; - btgatt_srvc_id_t srvc_id; - btgatt_gatt_id_t char_id; - uint16_t len; - uint8_t is_notify; -} btgatt_notify_params_t; - -typedef struct -{ - bt_bdaddr_t *bda1; - bt_uuid_t *uuid1; - uint16_t u1; - uint16_t u2; - uint16_t u3; - uint16_t u4; - uint16_t u5; -} btgatt_test_params_t; - -/** BT-GATT Client callback structure. */ - -/** Callback invoked in response to register_client */ -typedef void (*register_client_callback)(int status, int client_if, - bt_uuid_t *app_uuid); - -/** Callback for scan results */ -typedef void (*scan_result_callback)(bt_bdaddr_t* bda, int rssi, uint8_t* adv_data); - -/** GATT open callback invoked in response to open */ -typedef void (*connect_callback)(int conn_id, int status, int client_if, bt_bdaddr_t* bda); - -/** Callback invoked in response to close */ -typedef void (*disconnect_callback)(int conn_id, int status, - int client_if, bt_bdaddr_t* bda); - -/** - * Invoked in response to search_service when the GATT service search - * has been completed. - */ -typedef void (*search_complete_callback)(int conn_id, int status); - -/** Reports GATT services on a remote device */ -typedef void (*search_result_callback)( int conn_id, btgatt_srvc_id_t *srvc_id); - -/** GATT characteristic enumeration result callback */ -typedef void (*get_characteristic_callback)(int conn_id, int status, - btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id, - int char_prop); - -/** GATT descriptor enumeration result callback */ -typedef void (*get_descriptor_callback)(int conn_id, int status, - btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id, - btgatt_gatt_id_t *descr_id); - -/** GATT included service enumeration result callback */ -typedef void (*get_included_service_callback)(int conn_id, int status, - btgatt_srvc_id_t *srvc_id, btgatt_srvc_id_t *incl_srvc_id); - -/** Callback invoked in response to [de]register_for_notification */ -typedef void (*register_for_notification_callback)(int conn_id, - int registered, int status, btgatt_srvc_id_t *srvc_id, - btgatt_gatt_id_t *char_id); - -/** - * Remote device notification callback, invoked when a remote device sends - * a notification or indication that a client has registered for. - */ -typedef void (*notify_callback)(int conn_id, btgatt_notify_params_t *p_data); - -/** Reports result of a GATT read operation */ -typedef void (*read_characteristic_callback)(int conn_id, int status, - btgatt_read_params_t *p_data); - -/** GATT write characteristic operation callback */ -typedef void (*write_characteristic_callback)(int conn_id, int status, - btgatt_write_params_t *p_data); - -/** GATT execute prepared write callback */ -typedef void (*execute_write_callback)(int conn_id, int status); - -/** Callback invoked in response to read_descriptor */ -typedef void (*read_descriptor_callback)(int conn_id, int status, - btgatt_read_params_t *p_data); - -/** Callback invoked in response to write_descriptor */ -typedef void (*write_descriptor_callback)(int conn_id, int status, - btgatt_write_params_t *p_data); - -/** Callback triggered in response to read_remote_rssi */ -typedef void (*read_remote_rssi_callback)(int client_if, bt_bdaddr_t* bda, - int rssi, int status); - -/** - * Callback indicationg the status of a listen() operation - */ -typedef void (*listen_callback)(int status, int server_if); - -typedef struct { - register_client_callback register_client_cb; - scan_result_callback scan_result_cb; - connect_callback open_cb; - disconnect_callback close_cb; - search_complete_callback search_complete_cb; - search_result_callback search_result_cb; - get_characteristic_callback get_characteristic_cb; - get_descriptor_callback get_descriptor_cb; - get_included_service_callback get_included_service_cb; - register_for_notification_callback register_for_notification_cb; - notify_callback notify_cb; - read_characteristic_callback read_characteristic_cb; - write_characteristic_callback write_characteristic_cb; - read_descriptor_callback read_descriptor_cb; - write_descriptor_callback write_descriptor_cb; - execute_write_callback execute_write_cb; - read_remote_rssi_callback read_remote_rssi_cb; - listen_callback listen_cb; -} btgatt_client_callbacks_t; - -/** Represents the standard BT-GATT client interface. */ - -typedef struct { - /** Registers a GATT client application with the stack */ - bt_status_t (*register_client)( bt_uuid_t *uuid ); - - /** Unregister a client application from the stack */ - bt_status_t (*unregister_client)(int client_if ); - - /** Start or stop LE device scanning */ - bt_status_t (*scan)( int client_if, bool start ); - - /** Create a connection to a remote LE or dual-mode device */ - bt_status_t (*connect)( int client_if, const bt_bdaddr_t *bd_addr, - bool is_direct ); - - /** Disconnect a remote device or cancel a pending connection */ - bt_status_t (*disconnect)( int client_if, const bt_bdaddr_t *bd_addr, - int conn_id); - - /** Start or stop advertisements to listen for incoming connections */ - bt_status_t (*listen)(int client_if, bool start); - - /** Clear the attribute cache for a given device */ - bt_status_t (*refresh)( int client_if, const bt_bdaddr_t *bd_addr ); - - /** - * Enumerate all GATT services on a connected device. - * Optionally, the results can be filtered for a given UUID. - */ - bt_status_t (*search_service)(int conn_id, bt_uuid_t *filter_uuid ); - - /** - * Enumerate included services for a given service. - * Set start_incl_srvc_id to NULL to get the first included service. - */ - bt_status_t (*get_included_service)( int conn_id, btgatt_srvc_id_t *srvc_id, - btgatt_srvc_id_t *start_incl_srvc_id); - - /** - * Enumerate characteristics for a given service. - * Set start_char_id to NULL to get the first characteristic. - */ - bt_status_t (*get_characteristic)( int conn_id, - btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *start_char_id); - - /** - * Enumerate descriptors for a given characteristic. - * Set start_descr_id to NULL to get the first descriptor. - */ - bt_status_t (*get_descriptor)( int conn_id, - btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id, - btgatt_gatt_id_t *start_descr_id); - - /** Read a characteristic on a remote device */ - bt_status_t (*read_characteristic)( int conn_id, - btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id, - int auth_req ); - - /** Write a remote characteristic */ - bt_status_t (*write_characteristic)(int conn_id, - btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id, - int write_type, int len, int auth_req, - char* p_value); - - /** Read the descriptor for a given characteristic */ - bt_status_t (*read_descriptor)(int conn_id, - btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id, - btgatt_gatt_id_t *descr_id, int auth_req); - - /** Write a remote descriptor for a given characteristic */ - bt_status_t (*write_descriptor)( int conn_id, - btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id, - btgatt_gatt_id_t *descr_id, int write_type, int len, - int auth_req, char* p_value); - - /** Execute a prepared write operation */ - bt_status_t (*execute_write)(int conn_id, int execute); - - /** - * Register to receive notifications or indications for a given - * characteristic - */ - bt_status_t (*register_for_notification)( int client_if, - const bt_bdaddr_t *bd_addr, btgatt_srvc_id_t *srvc_id, - btgatt_gatt_id_t *char_id); - - /** Deregister a previous request for notifications/indications */ - bt_status_t (*deregister_for_notification)( int client_if, - const bt_bdaddr_t *bd_addr, btgatt_srvc_id_t *srvc_id, - btgatt_gatt_id_t *char_id); - - /** Request RSSI for a given remote device */ - bt_status_t (*read_remote_rssi)( int client_if, const bt_bdaddr_t *bd_addr); - - /** Determine the type of the remote device (LE, BR/EDR, Dual-mode) */ - int (*get_device_type)( const bt_bdaddr_t *bd_addr ); - - /** Set the advertising data or scan response data */ - bt_status_t (*set_adv_data)(int server_if, bool set_scan_rsp, bool include_name, - bool include_txpower, int min_interval, int max_interval, int appearance, - uint16_t manufacturer_len, char* manufacturer_data); - - /** Test mode interface */ - bt_status_t (*test_command)( int command, btgatt_test_params_t* params); -} btgatt_client_interface_t; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_BT_GATT_CLIENT_H */ diff --git a/external/android/include/19/hardware/libhardware/include/hardware/bt_gatt_server.h b/external/android/include/19/hardware/libhardware/include/hardware/bt_gatt_server.h deleted file mode 100644 index 1a5a400..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/bt_gatt_server.h +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright (C) 2013 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_INCLUDE_BT_GATT_SERVER_H -#define ANDROID_INCLUDE_BT_GATT_SERVER_H - -#include - -#include "bt_gatt_types.h" - -__BEGIN_DECLS - -/** GATT value type used in response to remote read requests */ -typedef struct -{ - uint8_t value[BTGATT_MAX_ATTR_LEN]; - uint16_t handle; - uint16_t offset; - uint16_t len; - uint8_t auth_req; -} btgatt_value_t; - -/** GATT remote read request response type */ -typedef union -{ - btgatt_value_t attr_value; - uint16_t handle; -} btgatt_response_t; - -/** BT-GATT Server callback structure. */ - -/** Callback invoked in response to register_server */ -typedef void (*register_server_callback)(int status, int server_if, - bt_uuid_t *app_uuid); - -/** Callback indicating that a remote device has connected or been disconnected */ -typedef void (*connection_callback)(int conn_id, int server_if, int connected, - bt_bdaddr_t *bda); - -/** Callback invoked in response to create_service */ -typedef void (*service_added_callback)(int status, int server_if, - btgatt_srvc_id_t *srvc_id, int srvc_handle); - -/** Callback indicating that an included service has been added to a service */ -typedef void (*included_service_added_callback)(int status, int server_if, - int srvc_handle, int incl_srvc_handle); - -/** Callback invoked when a characteristic has been added to a service */ -typedef void (*characteristic_added_callback)(int status, int server_if, - bt_uuid_t *uuid, int srvc_handle, int char_handle); - -/** Callback invoked when a descriptor has been added to a characteristic */ -typedef void (*descriptor_added_callback)(int status, int server_if, - bt_uuid_t *uuid, int srvc_handle, int descr_handle); - -/** Callback invoked in response to start_service */ -typedef void (*service_started_callback)(int status, int server_if, - int srvc_handle); - -/** Callback invoked in response to stop_service */ -typedef void (*service_stopped_callback)(int status, int server_if, - int srvc_handle); - -/** Callback triggered when a service has been deleted */ -typedef void (*service_deleted_callback)(int status, int server_if, - int srvc_handle); - -/** - * Callback invoked when a remote device has requested to read a characteristic - * or descriptor. The application must respond by calling send_response - */ -typedef void (*request_read_callback)(int conn_id, int trans_id, bt_bdaddr_t *bda, - int attr_handle, int offset, bool is_long); - -/** - * Callback invoked when a remote device has requested to write to a - * characteristic or descriptor. - */ -typedef void (*request_write_callback)(int conn_id, int trans_id, bt_bdaddr_t *bda, - int attr_handle, int offset, int length, - bool need_rsp, bool is_prep, uint8_t* value); - -/** Callback invoked when a previously prepared write is to be executed */ -typedef void (*request_exec_write_callback)(int conn_id, int trans_id, - bt_bdaddr_t *bda, int exec_write); - -/** - * Callback triggered in response to send_response if the remote device - * sends a confirmation. - */ -typedef void (*response_confirmation_callback)(int status, int handle); - -typedef struct { - register_server_callback register_server_cb; - connection_callback connection_cb; - service_added_callback service_added_cb; - included_service_added_callback included_service_added_cb; - characteristic_added_callback characteristic_added_cb; - descriptor_added_callback descriptor_added_cb; - service_started_callback service_started_cb; - service_stopped_callback service_stopped_cb; - service_deleted_callback service_deleted_cb; - request_read_callback request_read_cb; - request_write_callback request_write_cb; - request_exec_write_callback request_exec_write_cb; - response_confirmation_callback response_confirmation_cb; -} btgatt_server_callbacks_t; - -/** Represents the standard BT-GATT server interface. */ -typedef struct { - /** Registers a GATT server application with the stack */ - bt_status_t (*register_server)( bt_uuid_t *uuid ); - - /** Unregister a server application from the stack */ - bt_status_t (*unregister_server)(int server_if ); - - /** Create a connection to a remote peripheral */ - bt_status_t (*connect)(int server_if, const bt_bdaddr_t *bd_addr, bool is_direct ); - - /** Disconnect an established connection or cancel a pending one */ - bt_status_t (*disconnect)(int server_if, const bt_bdaddr_t *bd_addr, - int conn_id ); - - /** Create a new service */ - bt_status_t (*add_service)( int server_if, btgatt_srvc_id_t *srvc_id, int num_handles); - - /** Assign an included service to it's parent service */ - bt_status_t (*add_included_service)( int server_if, int service_handle, int included_handle); - - /** Add a characteristic to a service */ - bt_status_t (*add_characteristic)( int server_if, - int service_handle, bt_uuid_t *uuid, - int properties, int permissions); - - /** Add a descriptor to a given service */ - bt_status_t (*add_descriptor)(int server_if, int service_handle, - bt_uuid_t *uuid, int permissions); - - /** Starts a local service */ - bt_status_t (*start_service)(int server_if, int service_handle, - int transport); - - /** Stops a local service */ - bt_status_t (*stop_service)(int server_if, int service_handle); - - /** Delete a local service */ - bt_status_t (*delete_service)(int server_if, int service_handle); - - /** Send value indication to a remote device */ - bt_status_t (*send_indication)(int server_if, int attribute_handle, - int conn_id, int len, int confirm, - char* p_value); - - /** Send a response to a read/write operation */ - bt_status_t (*send_response)(int conn_id, int trans_id, - int status, btgatt_response_t *response); -} btgatt_server_interface_t; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_BT_GATT_CLIENT_H */ diff --git a/external/android/include/19/hardware/libhardware/include/hardware/bt_gatt_types.h b/external/android/include/19/hardware/libhardware/include/hardware/bt_gatt_types.h deleted file mode 100644 index 0ac217e..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/bt_gatt_types.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2013 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_INCLUDE_BT_GATT_TYPES_H -#define ANDROID_INCLUDE_BT_GATT_TYPES_H - -#include -#include - -__BEGIN_DECLS - -/** - * GATT Service types - */ -#define BTGATT_SERVICE_TYPE_PRIMARY 0 -#define BTGATT_SERVICE_TYPE_SECONDARY 1 - -/** GATT ID adding instance id tracking to the UUID */ -typedef struct -{ - bt_uuid_t uuid; - uint8_t inst_id; -} btgatt_gatt_id_t; - -/** GATT Service ID also identifies the service type (primary/secondary) */ -typedef struct -{ - btgatt_gatt_id_t id; - uint8_t is_primary; -} btgatt_srvc_id_t; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_BT_GATT_TYPES_H */ diff --git a/external/android/include/19/hardware/libhardware/include/hardware/bt_hf.h b/external/android/include/19/hardware/libhardware/include/hardware/bt_hf.h deleted file mode 100644 index 6135ac4..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/bt_hf.h +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Copyright (C) 2012 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_INCLUDE_BT_HF_H -#define ANDROID_INCLUDE_BT_HF_H - -__BEGIN_DECLS - -/* AT response code - OK/Error */ -typedef enum { - BTHF_AT_RESPONSE_ERROR = 0, - BTHF_AT_RESPONSE_OK -} bthf_at_response_t; - -typedef enum { - BTHF_CONNECTION_STATE_DISCONNECTED = 0, - BTHF_CONNECTION_STATE_CONNECTING, - BTHF_CONNECTION_STATE_CONNECTED, - BTHF_CONNECTION_STATE_SLC_CONNECTED, - BTHF_CONNECTION_STATE_DISCONNECTING -} bthf_connection_state_t; - -typedef enum { - BTHF_AUDIO_STATE_DISCONNECTED = 0, - BTHF_AUDIO_STATE_CONNECTING, - BTHF_AUDIO_STATE_CONNECTED, - BTHF_AUDIO_STATE_DISCONNECTING -} bthf_audio_state_t; - -typedef enum { - BTHF_VR_STATE_STOPPED = 0, - BTHF_VR_STATE_STARTED -} bthf_vr_state_t; - -typedef enum { - BTHF_VOLUME_TYPE_SPK = 0, - BTHF_VOLUME_TYPE_MIC -} bthf_volume_type_t; - -/* Noise Reduction and Echo Cancellation */ -typedef enum -{ - BTHF_NREC_STOP, - BTHF_NREC_START -} bthf_nrec_t; - -/* CHLD - Call held handling */ -typedef enum -{ - BTHF_CHLD_TYPE_RELEASEHELD, // Terminate all held or set UDUB("busy") to a waiting call - BTHF_CHLD_TYPE_RELEASEACTIVE_ACCEPTHELD, // Terminate all active calls and accepts a waiting/held call - BTHF_CHLD_TYPE_HOLDACTIVE_ACCEPTHELD, // Hold all active calls and accepts a waiting/held call - BTHF_CHLD_TYPE_ADDHELDTOCONF, // Add all held calls to a conference -} bthf_chld_type_t; - -/** Callback for connection state change. - * state will have one of the values from BtHfConnectionState - */ -typedef void (* bthf_connection_state_callback)(bthf_connection_state_t state, bt_bdaddr_t *bd_addr); - -/** Callback for audio connection state change. - * state will have one of the values from BtHfAudioState - */ -typedef void (* bthf_audio_state_callback)(bthf_audio_state_t state, bt_bdaddr_t *bd_addr); - -/** Callback for VR connection state change. - * state will have one of the values from BtHfVRState - */ -typedef void (* bthf_vr_cmd_callback)(bthf_vr_state_t state); - -/** Callback for answer incoming call (ATA) - */ -typedef void (* bthf_answer_call_cmd_callback)(); - -/** Callback for disconnect call (AT+CHUP) - */ -typedef void (* bthf_hangup_call_cmd_callback)(); - -/** Callback for disconnect call (AT+CHUP) - * type will denote Speaker/Mic gain (BtHfVolumeControl). - */ -typedef void (* bthf_volume_cmd_callback)(bthf_volume_type_t type, int volume); - -/** Callback for dialing an outgoing call - * If number is NULL, redial - */ -typedef void (* bthf_dial_call_cmd_callback)(char *number); - -/** Callback for sending DTMF tones - * tone contains the dtmf character to be sent - */ -typedef void (* bthf_dtmf_cmd_callback)(char tone); - -/** Callback for enabling/disabling noise reduction/echo cancellation - * value will be 1 to enable, 0 to disable - */ -typedef void (* bthf_nrec_cmd_callback)(bthf_nrec_t nrec); - -/** Callback for call hold handling (AT+CHLD) - * value will contain the call hold command (0, 1, 2, 3) - */ -typedef void (* bthf_chld_cmd_callback)(bthf_chld_type_t chld); - -/** Callback for CNUM (subscriber number) - */ -typedef void (* bthf_cnum_cmd_callback)(); - -/** Callback for indicators (CIND) - */ -typedef void (* bthf_cind_cmd_callback)(); - -/** Callback for operator selection (COPS) - */ -typedef void (* bthf_cops_cmd_callback)(); - -/** Callback for call list (AT+CLCC) - */ -typedef void (* bthf_clcc_cmd_callback) (); - -/** Callback for unknown AT command recd from HF - * at_string will contain the unparsed AT string - */ -typedef void (* bthf_unknown_at_cmd_callback)(char *at_string); - -/** Callback for keypressed (HSP) event. - */ -typedef void (* bthf_key_pressed_cmd_callback)(); - -/** BT-HF callback structure. */ -typedef struct { - /** set to sizeof(BtHfCallbacks) */ - size_t size; - bthf_connection_state_callback connection_state_cb; - bthf_audio_state_callback audio_state_cb; - bthf_vr_cmd_callback vr_cmd_cb; - bthf_answer_call_cmd_callback answer_call_cmd_cb; - bthf_hangup_call_cmd_callback hangup_call_cmd_cb; - bthf_volume_cmd_callback volume_cmd_cb; - bthf_dial_call_cmd_callback dial_call_cmd_cb; - bthf_dtmf_cmd_callback dtmf_cmd_cb; - bthf_nrec_cmd_callback nrec_cmd_cb; - bthf_chld_cmd_callback chld_cmd_cb; - bthf_cnum_cmd_callback cnum_cmd_cb; - bthf_cind_cmd_callback cind_cmd_cb; - bthf_cops_cmd_callback cops_cmd_cb; - bthf_clcc_cmd_callback clcc_cmd_cb; - bthf_unknown_at_cmd_callback unknown_at_cmd_cb; - bthf_key_pressed_cmd_callback key_pressed_cmd_cb; -} bthf_callbacks_t; - -/** Network Status */ -typedef enum -{ - BTHF_NETWORK_STATE_NOT_AVAILABLE = 0, - BTHF_NETWORK_STATE_AVAILABLE -} bthf_network_state_t; - -/** Service type */ -typedef enum -{ - BTHF_SERVICE_TYPE_HOME = 0, - BTHF_SERVICE_TYPE_ROAMING -} bthf_service_type_t; - -typedef enum { - BTHF_CALL_STATE_ACTIVE = 0, - BTHF_CALL_STATE_HELD, - BTHF_CALL_STATE_DIALING, - BTHF_CALL_STATE_ALERTING, - BTHF_CALL_STATE_INCOMING, - BTHF_CALL_STATE_WAITING, - BTHF_CALL_STATE_IDLE -} bthf_call_state_t; - -typedef enum { - BTHF_CALL_DIRECTION_OUTGOING = 0, - BTHF_CALL_DIRECTION_INCOMING -} bthf_call_direction_t; - -typedef enum { - BTHF_CALL_TYPE_VOICE = 0, - BTHF_CALL_TYPE_DATA, - BTHF_CALL_TYPE_FAX -} bthf_call_mode_t; - -typedef enum { - BTHF_CALL_MPTY_TYPE_SINGLE = 0, - BTHF_CALL_MPTY_TYPE_MULTI -} bthf_call_mpty_type_t; - -typedef enum { - BTHF_CALL_ADDRTYPE_UNKNOWN = 0x81, - BTHF_CALL_ADDRTYPE_INTERNATIONAL = 0x91 -} bthf_call_addrtype_t; -/** Represents the standard BT-HF interface. */ -typedef struct { - - /** set to sizeof(BtHfInterface) */ - size_t size; - /** - * Register the BtHf callbacks - */ - bt_status_t (*init)( bthf_callbacks_t* callbacks ); - - /** connect to headset */ - bt_status_t (*connect)( bt_bdaddr_t *bd_addr ); - - /** dis-connect from headset */ - bt_status_t (*disconnect)( bt_bdaddr_t *bd_addr ); - - /** create an audio connection */ - bt_status_t (*connect_audio)( bt_bdaddr_t *bd_addr ); - - /** close the audio connection */ - bt_status_t (*disconnect_audio)( bt_bdaddr_t *bd_addr ); - - /** start voice recognition */ - bt_status_t (*start_voice_recognition)(); - - /** stop voice recognition */ - bt_status_t (*stop_voice_recognition)(); - - /** volume control */ - bt_status_t (*volume_control) (bthf_volume_type_t type, int volume); - - /** Combined device status change notification */ - bt_status_t (*device_status_notification)(bthf_network_state_t ntk_state, bthf_service_type_t svc_type, int signal, - int batt_chg); - - /** Response for COPS command */ - bt_status_t (*cops_response)(const char *cops); - - /** Response for CIND command */ - bt_status_t (*cind_response)(int svc, int num_active, int num_held, bthf_call_state_t call_setup_state, - int signal, int roam, int batt_chg); - - /** Pre-formatted AT response, typically in response to unknown AT cmd */ - bt_status_t (*formatted_at_response)(const char *rsp); - - /** ok/error response - * ERROR (0) - * OK (1) - */ - bt_status_t (*at_response) (bthf_at_response_t response_code, int error_code); - - /** response for CLCC command - * Can be iteratively called for each call index - * Call index of 0 will be treated as NULL termination (Completes response) - */ - bt_status_t (*clcc_response) (int index, bthf_call_direction_t dir, - bthf_call_state_t state, bthf_call_mode_t mode, - bthf_call_mpty_type_t mpty, const char *number, - bthf_call_addrtype_t type); - - /** notify of a call state change - * Each update notifies - * 1. Number of active/held/ringing calls - * 2. call_state: This denotes the state change that triggered this msg - * This will take one of the values from BtHfCallState - * 3. number & type: valid only for incoming & waiting call - */ - bt_status_t (*phone_state_change) (int num_active, int num_held, bthf_call_state_t call_setup_state, - const char *number, bthf_call_addrtype_t type); - - /** Closes the interface. */ - void (*cleanup)( void ); -} bthf_interface_t; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_BT_HF_H */ diff --git a/external/android/include/19/hardware/libhardware/include/hardware/bt_hh.h b/external/android/include/19/hardware/libhardware/include/hardware/bt_hh.h deleted file mode 100644 index 09f547b..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/bt_hh.h +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright (C) 2012 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_INCLUDE_BT_HH_H -#define ANDROID_INCLUDE_BT_HH_H - -#include - -__BEGIN_DECLS - -#define BTHH_MAX_DSC_LEN 884 - -/* HH connection states */ -typedef enum -{ - BTHH_CONN_STATE_CONNECTED = 0, - BTHH_CONN_STATE_CONNECTING, - BTHH_CONN_STATE_DISCONNECTED, - BTHH_CONN_STATE_DISCONNECTING, - BTHH_CONN_STATE_FAILED_MOUSE_FROM_HOST, - BTHH_CONN_STATE_FAILED_KBD_FROM_HOST, - BTHH_CONN_STATE_FAILED_TOO_MANY_DEVICES, - BTHH_CONN_STATE_FAILED_NO_BTHID_DRIVER, - BTHH_CONN_STATE_FAILED_GENERIC, - BTHH_CONN_STATE_UNKNOWN -} bthh_connection_state_t; - -typedef enum -{ - BTHH_OK = 0, - BTHH_HS_HID_NOT_READY, /* handshake error : device not ready */ - BTHH_HS_INVALID_RPT_ID, /* handshake error : invalid report ID */ - BTHH_HS_TRANS_NOT_SPT, /* handshake error : transaction not spt */ - BTHH_HS_INVALID_PARAM, /* handshake error : invalid paremter */ - BTHH_HS_ERROR, /* handshake error : unspecified HS error */ - BTHH_ERR, /* general BTA HH error */ - BTHH_ERR_SDP, /* SDP error */ - BTHH_ERR_PROTO, /* SET_Protocol error, - only used in BTA_HH_OPEN_EVT callback */ - BTHH_ERR_DB_FULL, /* device database full error, used */ - BTHH_ERR_TOD_UNSPT, /* type of device not supported */ - BTHH_ERR_NO_RES, /* out of system resources */ - BTHH_ERR_AUTH_FAILED, /* authentication fail */ - BTHH_ERR_HDL -}bthh_status_t; - -/* Protocol modes */ -typedef enum { - BTHH_REPORT_MODE = 0x00, - BTHH_BOOT_MODE = 0x01, - BTHH_UNSUPPORTED_MODE = 0xff -}bthh_protocol_mode_t; - -/* Report types */ -typedef enum { - BTHH_INPUT_REPORT = 1, - BTHH_OUTPUT_REPORT, - BTHH_FEATURE_REPORT -}bthh_report_type_t; - -typedef struct -{ - int attr_mask; - uint8_t sub_class; - uint8_t app_id; - int vendor_id; - int product_id; - int version; - uint8_t ctry_code; - int dl_len; - uint8_t dsc_list[BTHH_MAX_DSC_LEN]; -} bthh_hid_info_t; - -/** Callback for connection state change. - * state will have one of the values from bthh_connection_state_t - */ -typedef void (* bthh_connection_state_callback)(bt_bdaddr_t *bd_addr, bthh_connection_state_t state); - -/** Callback for vitual unplug api. - * the status of the vitual unplug - */ -typedef void (* bthh_virtual_unplug_callback)(bt_bdaddr_t *bd_addr, bthh_status_t hh_status); - -/** Callback for get hid info - * hid_info will contain attr_mask, sub_class, app_id, vendor_id, product_id, version, ctry_code, len - */ -typedef void (* bthh_hid_info_callback)(bt_bdaddr_t *bd_addr, bthh_hid_info_t hid_info); - -/** Callback for get/set protocal api. - * the protocol mode is one of the value from bthh_protocol_mode_t - */ -typedef void (* bthh_protocol_mode_callback)(bt_bdaddr_t *bd_addr, bthh_status_t hh_status,bthh_protocol_mode_t mode); - -/** Callback for get/set_idle_time api. - */ -typedef void (* bthh_idle_time_callback)(bt_bdaddr_t *bd_addr, bthh_status_t hh_status, int idle_rate); - - -/** Callback for get report api. - * if staus is ok rpt_data contains the report data - */ -typedef void (* bthh_get_report_callback)(bt_bdaddr_t *bd_addr, bthh_status_t hh_status, uint8_t* rpt_data, int rpt_size); - - -/** BT-HH callback structure. */ -typedef struct { - /** set to sizeof(BtHfCallbacks) */ - size_t size; - bthh_connection_state_callback connection_state_cb; - bthh_hid_info_callback hid_info_cb; - bthh_protocol_mode_callback protocol_mode_cb; - bthh_idle_time_callback idle_time_cb; - bthh_get_report_callback get_report_cb; - bthh_virtual_unplug_callback virtual_unplug_cb; - -} bthh_callbacks_t; - - - -/** Represents the standard BT-HH interface. */ -typedef struct { - - /** set to sizeof(BtHhInterface) */ - size_t size; - - /** - * Register the BtHh callbacks - */ - bt_status_t (*init)( bthh_callbacks_t* callbacks ); - - /** connect to hid device */ - bt_status_t (*connect)( bt_bdaddr_t *bd_addr); - - /** dis-connect from hid device */ - bt_status_t (*disconnect)( bt_bdaddr_t *bd_addr ); - - /** Virtual UnPlug (VUP) the specified HID device */ - bt_status_t (*virtual_unplug)(bt_bdaddr_t *bd_addr); - - /** Set the HID device descriptor for the specified HID device. */ - bt_status_t (*set_info)(bt_bdaddr_t *bd_addr, bthh_hid_info_t hid_info ); - - /** Get the HID proto mode. */ - bt_status_t (*get_protocol) (bt_bdaddr_t *bd_addr, bthh_protocol_mode_t protocolMode); - - /** Set the HID proto mode. */ - bt_status_t (*set_protocol)(bt_bdaddr_t *bd_addr, bthh_protocol_mode_t protocolMode); - - /** Send a GET_REPORT to HID device. */ - bt_status_t (*get_report)(bt_bdaddr_t *bd_addr, bthh_report_type_t reportType, uint8_t reportId, int bufferSize); - - /** Send a SET_REPORT to HID device. */ - bt_status_t (*set_report)(bt_bdaddr_t *bd_addr, bthh_report_type_t reportType, char* report); - - /** Send data to HID device. */ - bt_status_t (*send_data)(bt_bdaddr_t *bd_addr, char* data); - - /** Closes the interface. */ - void (*cleanup)( void ); - -} bthh_interface_t; -__END_DECLS - -#endif /* ANDROID_INCLUDE_BT_HH_H */ - - diff --git a/external/android/include/19/hardware/libhardware/include/hardware/bt_hl.h b/external/android/include/19/hardware/libhardware/include/hardware/bt_hl.h deleted file mode 100644 index bd29e3a..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/bt_hl.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (C) 2012 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_INCLUDE_BT_HL_H -#define ANDROID_INCLUDE_BT_HL_H - -__BEGIN_DECLS - -/* HL connection states */ - -typedef enum -{ - BTHL_MDEP_ROLE_SOURCE, - BTHL_MDEP_ROLE_SINK -} bthl_mdep_role_t; - -typedef enum { - BTHL_APP_REG_STATE_REG_SUCCESS, - BTHL_APP_REG_STATE_REG_FAILED, - BTHL_APP_REG_STATE_DEREG_SUCCESS, - BTHL_APP_REG_STATE_DEREG_FAILED -} bthl_app_reg_state_t; - -typedef enum -{ - BTHL_CHANNEL_TYPE_RELIABLE, - BTHL_CHANNEL_TYPE_STREAMING, - BTHL_CHANNEL_TYPE_ANY -} bthl_channel_type_t; - - -/* HL connection states */ -typedef enum { - BTHL_CONN_STATE_CONNECTING, - BTHL_CONN_STATE_CONNECTED, - BTHL_CONN_STATE_DISCONNECTING, - BTHL_CONN_STATE_DISCONNECTED, - BTHL_CONN_STATE_DESTROYED -} bthl_channel_state_t; - -typedef struct -{ - bthl_mdep_role_t mdep_role; - int data_type; - bthl_channel_type_t channel_type; - const char *mdep_description; /* MDEP description to be used in the SDP (optional); null terminated */ -} bthl_mdep_cfg_t; - -typedef struct -{ - const char *application_name; - const char *provider_name; /* provider name to be used in the SDP (optional); null terminated */ - const char *srv_name; /* service name to be used in the SDP (optional); null terminated*/ - const char *srv_desp; /* service description to be used in the SDP (optional); null terminated */ - int number_of_mdeps; - bthl_mdep_cfg_t *mdep_cfg; /* Dynamic array */ -} bthl_reg_param_t; - -/** Callback for application registration status. - * state will have one of the values from bthl_app_reg_state_t - */ -typedef void (* bthl_app_reg_state_callback)(int app_id, bthl_app_reg_state_t state); - -/** Callback for channel connection state change. - * state will have one of the values from - * bthl_connection_state_t and fd (file descriptor) - */ -typedef void (* bthl_channel_state_callback)(int app_id, bt_bdaddr_t *bd_addr, int mdep_cfg_index, int channel_id, bthl_channel_state_t state, int fd); - -/** BT-HL callback structure. */ -typedef struct { - /** set to sizeof(bthl_callbacks_t) */ - size_t size; - bthl_app_reg_state_callback app_reg_state_cb; - bthl_channel_state_callback channel_state_cb; -} bthl_callbacks_t; - - -/** Represents the standard BT-HL interface. */ -typedef struct { - - /** set to sizeof(bthl_interface_t) */ - size_t size; - - /** - * Register the Bthl callbacks - */ - bt_status_t (*init)( bthl_callbacks_t* callbacks ); - - /** Register HL application */ - bt_status_t (*register_application) ( bthl_reg_param_t *p_reg_param, int *app_id); - - /** Unregister HL application */ - bt_status_t (*unregister_application) (int app_id); - - /** connect channel */ - bt_status_t (*connect_channel)(int app_id, bt_bdaddr_t *bd_addr, int mdep_cfg_index, int *channel_id); - - /** destroy channel */ - bt_status_t (*destroy_channel)(int channel_id); - - /** Close the Bthl callback **/ - void (*cleanup)(void); - -} bthl_interface_t; -__END_DECLS - -#endif /* ANDROID_INCLUDE_BT_HL_H */ - - diff --git a/external/android/include/19/hardware/libhardware/include/hardware/bt_pan.h b/external/android/include/19/hardware/libhardware/include/hardware/bt_pan.h deleted file mode 100644 index c8b36b4..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/bt_pan.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (C) 2012 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_INCLUDE_BT_PAN_H -#define ANDROID_INCLUDE_BT_PAN_H - -__BEGIN_DECLS - -#define BTPAN_ROLE_NONE 0 -#define BTPAN_ROLE_PANNAP 1 -#define BTPAN_ROLE_PANU 2 - -typedef enum { - BTPAN_STATE_CONNECTED = 0, - BTPAN_STATE_CONNECTING = 1, - BTPAN_STATE_DISCONNECTED = 2, - BTPAN_STATE_DISCONNECTING = 3 -} btpan_connection_state_t; - -typedef enum { - BTPAN_STATE_ENABLED = 0, - BTPAN_STATE_DISABLED = 1 -} btpan_control_state_t; - -/** -* Callback for pan connection state -*/ -typedef void (*btpan_connection_state_callback)(btpan_connection_state_t state, bt_status_t error, - const bt_bdaddr_t *bd_addr, int local_role, int remote_role); -typedef void (*btpan_control_state_callback)(btpan_control_state_t state, bt_status_t error, - int local_role, const char* ifname); - -typedef struct { - size_t size; - btpan_control_state_callback control_state_cb; - btpan_connection_state_callback connection_state_cb; -} btpan_callbacks_t; -typedef struct { - /** set to size of this struct*/ - size_t size; - /** - * Initialize the pan interface and register the btpan callbacks - */ - bt_status_t (*init)(const btpan_callbacks_t* callbacks); - /* - * enable the pan service by specified role. The result state of - * enabl will be returned by btpan_control_state_callback. when pan-nap is enabled, - * the state of connecting panu device will be notified by btpan_connection_state_callback - */ - bt_status_t (*enable)(int local_role); - /* - * get current pan local role - */ - int (*get_local_role)(void); - /** - * start bluetooth pan connection to the remote device by specified pan role. The result state will be - * returned by btpan_connection_state_callback - */ - bt_status_t (*connect)(const bt_bdaddr_t *bd_addr, int local_role, int remote_role); - /** - * stop bluetooth pan connection. The result state will be returned by btpan_connection_state_callback - */ - bt_status_t (*disconnect)(const bt_bdaddr_t *bd_addr); - - /** - * Cleanup the pan interface - */ - void (*cleanup)(void); - -} btpan_interface_t; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_BT_PAN_H */ diff --git a/external/android/include/19/hardware/libhardware/include/hardware/bt_rc.h b/external/android/include/19/hardware/libhardware/include/hardware/bt_rc.h deleted file mode 100644 index d455543..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/bt_rc.h +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Copyright (C) 2012 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_INCLUDE_BT_RC_H -#define ANDROID_INCLUDE_BT_RC_H - -__BEGIN_DECLS - -/* Macros */ -#define BTRC_MAX_ATTR_STR_LEN 255 -#define BTRC_UID_SIZE 8 -#define BTRC_MAX_APP_SETTINGS 8 -#define BTRC_MAX_FOLDER_DEPTH 4 -#define BTRC_MAX_APP_ATTR_SIZE 16 -#define BTRC_MAX_ELEM_ATTR_SIZE 7 - -typedef uint8_t btrc_uid_t[BTRC_UID_SIZE]; - -typedef enum { - BTRC_FEAT_NONE = 0x00, /* AVRCP 1.0 */ - BTRC_FEAT_METADATA = 0x01, /* AVRCP 1.3 */ - BTRC_FEAT_ABSOLUTE_VOLUME = 0x02, /* Supports TG role and volume sync */ - BTRC_FEAT_BROWSE = 0x04, /* AVRCP 1.4 and up, with Browsing support */ -} btrc_remote_features_t; - -typedef enum { - BTRC_PLAYSTATE_STOPPED = 0x00, /* Stopped */ - BTRC_PLAYSTATE_PLAYING = 0x01, /* Playing */ - BTRC_PLAYSTATE_PAUSED = 0x02, /* Paused */ - BTRC_PLAYSTATE_FWD_SEEK = 0x03, /* Fwd Seek*/ - BTRC_PLAYSTATE_REV_SEEK = 0x04, /* Rev Seek*/ - BTRC_PLAYSTATE_ERROR = 0xFF, /* Error */ -} btrc_play_status_t; - -typedef enum { - BTRC_EVT_PLAY_STATUS_CHANGED = 0x01, - BTRC_EVT_TRACK_CHANGE = 0x02, - BTRC_EVT_TRACK_REACHED_END = 0x03, - BTRC_EVT_TRACK_REACHED_START = 0x04, - BTRC_EVT_PLAY_POS_CHANGED = 0x05, - BTRC_EVT_APP_SETTINGS_CHANGED = 0x08, -} btrc_event_id_t; - -typedef enum { - BTRC_NOTIFICATION_TYPE_INTERIM = 0, - BTRC_NOTIFICATION_TYPE_CHANGED = 1, -} btrc_notification_type_t; - -typedef enum { - BTRC_PLAYER_ATTR_EQUALIZER = 0x01, - BTRC_PLAYER_ATTR_REPEAT = 0x02, - BTRC_PLAYER_ATTR_SHUFFLE = 0x03, - BTRC_PLAYER_ATTR_SCAN = 0x04, -} btrc_player_attr_t; - -typedef enum { - BTRC_MEDIA_ATTR_TITLE = 0x01, - BTRC_MEDIA_ATTR_ARTIST = 0x02, - BTRC_MEDIA_ATTR_ALBUM = 0x03, - BTRC_MEDIA_ATTR_TRACK_NUM = 0x04, - BTRC_MEDIA_ATTR_NUM_TRACKS = 0x05, - BTRC_MEDIA_ATTR_GENRE = 0x06, - BTRC_MEDIA_ATTR_PLAYING_TIME = 0x07, -} btrc_media_attr_t; - -typedef enum { - BTRC_PLAYER_VAL_OFF_REPEAT = 0x01, - BTRC_PLAYER_VAL_SINGLE_REPEAT = 0x02, - BTRC_PLAYER_VAL_ALL_REPEAT = 0x03, - BTRC_PLAYER_VAL_GROUP_REPEAT = 0x04 -} btrc_player_repeat_val_t; - -typedef enum { - BTRC_PLAYER_VAL_OFF_SHUFFLE = 0x01, - BTRC_PLAYER_VAL_ALL_SHUFFLE = 0x02, - BTRC_PLAYER_VAL_GROUP_SHUFFLE = 0x03 -} btrc_player_shuffle_val_t; - -typedef enum { - BTRC_STS_BAD_CMD = 0x00, /* Invalid command */ - BTRC_STS_BAD_PARAM = 0x01, /* Invalid parameter */ - BTRC_STS_NOT_FOUND = 0x02, /* Specified parameter is wrong or not found */ - BTRC_STS_INTERNAL_ERR = 0x03, /* Internal Error */ - BTRC_STS_NO_ERROR = 0x04 /* Operation Success */ -} btrc_status_t; - -typedef struct { - uint8_t num_attr; - uint8_t attr_ids[BTRC_MAX_APP_SETTINGS]; - uint8_t attr_values[BTRC_MAX_APP_SETTINGS]; -} btrc_player_settings_t; - -typedef union -{ - btrc_play_status_t play_status; - btrc_uid_t track; /* queue position in NowPlaying */ - uint32_t song_pos; - btrc_player_settings_t player_setting; -} btrc_register_notification_t; - -typedef struct { - uint8_t id; /* can be attr_id or value_id */ - uint8_t text[BTRC_MAX_ATTR_STR_LEN]; -} btrc_player_setting_text_t; - -typedef struct { - uint32_t attr_id; - uint8_t text[BTRC_MAX_ATTR_STR_LEN]; -} btrc_element_attr_val_t; - -/** Callback for the controller's supported feautres */ -typedef void (* btrc_remote_features_callback)(bt_bdaddr_t *bd_addr, - btrc_remote_features_t features); - -/** Callback for play status request */ -typedef void (* btrc_get_play_status_callback)(); - -/** Callback for list player application attributes (Shuffle, Repeat,...) */ -typedef void (* btrc_list_player_app_attr_callback)(); - -/** Callback for list player application attributes (Shuffle, Repeat,...) */ -typedef void (* btrc_list_player_app_values_callback)(btrc_player_attr_t attr_id); - -/** Callback for getting the current player application settings value -** num_attr: specifies the number of attribute ids contained in p_attrs -*/ -typedef void (* btrc_get_player_app_value_callback) (uint8_t num_attr, btrc_player_attr_t *p_attrs); - -/** Callback for getting the player application settings attributes' text -** num_attr: specifies the number of attribute ids contained in p_attrs -*/ -typedef void (* btrc_get_player_app_attrs_text_callback) (uint8_t num_attr, btrc_player_attr_t *p_attrs); - -/** Callback for getting the player application settings values' text -** num_attr: specifies the number of value ids contained in p_vals -*/ -typedef void (* btrc_get_player_app_values_text_callback) (uint8_t attr_id, uint8_t num_val, uint8_t *p_vals); - -/** Callback for setting the player application settings values */ -typedef void (* btrc_set_player_app_value_callback) (btrc_player_settings_t *p_vals); - -/** Callback to fetch the get element attributes of the current song -** num_attr: specifies the number of attributes requested in p_attrs -*/ -typedef void (* btrc_get_element_attr_callback) (uint8_t num_attr, btrc_media_attr_t *p_attrs); - -/** Callback for register notification (Play state change/track change/...) -** param: Is only valid if event_id is BTRC_EVT_PLAY_POS_CHANGED -*/ -typedef void (* btrc_register_notification_callback) (btrc_event_id_t event_id, uint32_t param); - -/* AVRCP 1.4 Enhancements */ -/** Callback for volume change on CT -** volume: Current volume setting on the CT (0-127) -*/ -typedef void (* btrc_volume_change_callback) (uint8_t volume, uint8_t ctype); - -/** Callback for passthrough commands */ -typedef void (* btrc_passthrough_cmd_callback) (int id, int key_state); - -/** BT-RC callback structure. */ -typedef struct { - /** set to sizeof(BtRcCallbacks) */ - size_t size; - btrc_remote_features_callback remote_features_cb; - btrc_get_play_status_callback get_play_status_cb; - btrc_list_player_app_attr_callback list_player_app_attr_cb; - btrc_list_player_app_values_callback list_player_app_values_cb; - btrc_get_player_app_value_callback get_player_app_value_cb; - btrc_get_player_app_attrs_text_callback get_player_app_attrs_text_cb; - btrc_get_player_app_values_text_callback get_player_app_values_text_cb; - btrc_set_player_app_value_callback set_player_app_value_cb; - btrc_get_element_attr_callback get_element_attr_cb; - btrc_register_notification_callback register_notification_cb; - btrc_volume_change_callback volume_change_cb; - btrc_passthrough_cmd_callback passthrough_cmd_cb; -} btrc_callbacks_t; - -/** Represents the standard BT-RC interface. */ -typedef struct { - - /** set to sizeof(BtRcInterface) */ - size_t size; - /** - * Register the BtRc callbacks - */ - bt_status_t (*init)( btrc_callbacks_t* callbacks ); - - /** Respose to GetPlayStatus request. Contains the current - ** 1. Play status - ** 2. Song duration/length - ** 3. Song position - */ - bt_status_t (*get_play_status_rsp)( btrc_play_status_t play_status, uint32_t song_len, uint32_t song_pos); - - /** Lists the support player application attributes (Shuffle/Repeat/...) - ** num_attr: Specifies the number of attributes contained in the pointer p_attrs - */ - bt_status_t (*list_player_app_attr_rsp)( int num_attr, btrc_player_attr_t *p_attrs); - - /** Lists the support player application attributes (Shuffle Off/On/Group) - ** num_val: Specifies the number of values contained in the pointer p_vals - */ - bt_status_t (*list_player_app_value_rsp)( int num_val, uint8_t *p_vals); - - /** Returns the current application attribute values for each of the specified attr_id */ - bt_status_t (*get_player_app_value_rsp)( btrc_player_settings_t *p_vals); - - /** Returns the application attributes text ("Shuffle"/"Repeat"/...) - ** num_attr: Specifies the number of attributes' text contained in the pointer p_attrs - */ - bt_status_t (*get_player_app_attr_text_rsp)( int num_attr, btrc_player_setting_text_t *p_attrs); - - /** Returns the application attributes text ("Shuffle"/"Repeat"/...) - ** num_attr: Specifies the number of attribute values' text contained in the pointer p_vals - */ - bt_status_t (*get_player_app_value_text_rsp)( int num_val, btrc_player_setting_text_t *p_vals); - - /** Returns the current songs' element attributes text ("Title"/"Album"/"Artist") - ** num_attr: Specifies the number of attributes' text contained in the pointer p_attrs - */ - bt_status_t (*get_element_attr_rsp)( uint8_t num_attr, btrc_element_attr_val_t *p_attrs); - - /** Response to set player attribute request ("Shuffle"/"Repeat") - ** rsp_status: Status of setting the player attributes for the current media player - */ - bt_status_t (*set_player_app_value_rsp)(btrc_status_t rsp_status); - - /* Response to the register notification request (Play state change/track change/...). - ** event_id: Refers to the event_id this notification change corresponds too - ** type: Response type - interim/changed - ** p_params: Based on the event_id, this parameter should be populated - */ - bt_status_t (*register_notification_rsp)(btrc_event_id_t event_id, - btrc_notification_type_t type, - btrc_register_notification_t *p_param); - - /* AVRCP 1.4 enhancements */ - - /**Send current volume setting to remote side. Support limited to SetAbsoluteVolume - ** This can be enhanced to support Relative Volume (AVRCP 1.0). - ** With RelateVolume, we will send VOLUME_UP/VOLUME_DOWN opposed to absolute volume level - ** volume: Should be in the range 0-127. bit7 is reseved and cannot be set - */ - bt_status_t (*set_volume)(uint8_t volume); - - /** Closes the interface. */ - void (*cleanup)( void ); -} btrc_interface_t; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_BT_RC_H */ diff --git a/external/android/include/19/hardware/libhardware/include/hardware/bt_sock.h b/external/android/include/19/hardware/libhardware/include/hardware/bt_sock.h deleted file mode 100644 index a4aa046..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/bt_sock.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2012 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_INCLUDE_BT_SOCK_H -#define ANDROID_INCLUDE_BT_SOCK_H - -__BEGIN_DECLS - -#define BTSOCK_FLAG_ENCRYPT 1 -#define BTSOCK_FLAG_AUTH (1 << 1) - -typedef enum { - BTSOCK_RFCOMM = 1, - BTSOCK_SCO = 2, - BTSOCK_L2CAP = 3 -} btsock_type_t; - -/** Represents the standard BT SOCKET interface. */ -typedef struct { - short size; - bt_bdaddr_t bd_addr; - int channel; - int status; -} __attribute__((packed)) sock_connect_signal_t; - -typedef struct { - - /** set to size of this struct*/ - size_t size; - /** - * listen to a rfcomm uuid or channel. It returns the socket fd from which - * btsock_connect_signal can be read out when a remote device connected - */ - bt_status_t (*listen)(btsock_type_t type, const char* service_name, const uint8_t* service_uuid, int channel, int* sock_fd, int flags); - /* - * connect to a rfcomm uuid channel of remote device, It returns the socket fd from which - * the btsock_connect_signal and a new socket fd to be accepted can be read out when connected - */ - bt_status_t (*connect)(const bt_bdaddr_t *bd_addr, btsock_type_t type, const uint8_t* uuid, int channel, int* sock_fd, int flags); - -} btsock_interface_t; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_BT_SOCK_H */ diff --git a/external/android/include/19/hardware/libhardware/include/hardware/camera.h b/external/android/include/19/hardware/libhardware/include/hardware/camera.h deleted file mode 100644 index b7182f8..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/camera.h +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Copyright (C) 2010-2011 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_INCLUDE_CAMERA_H -#define ANDROID_INCLUDE_CAMERA_H - -#include "camera_common.h" - -/** - * Camera device HAL, initial version [ CAMERA_DEVICE_API_VERSION_1_0 ] - * - * Supports the android.hardware.Camera API. - * - * Camera devices that support this version of the HAL must return a value in - * the range HARDWARE_DEVICE_API_VERSION(0,0)-(1,FF) in - * camera_device_t.common.version. CAMERA_DEVICE_API_VERSION_1_0 is the - * recommended value. - * - * Camera modules that implement version 2.0 or higher of camera_module_t must - * also return the value of camera_device_t.common.version in - * camera_info_t.device_version. - * - * See camera_common.h for more details. - */ - -__BEGIN_DECLS - -struct camera_memory; -typedef void (*camera_release_memory)(struct camera_memory *mem); - -typedef struct camera_memory { - void *data; - size_t size; - void *handle; - camera_release_memory release; -} camera_memory_t; - -typedef camera_memory_t* (*camera_request_memory)(int fd, size_t buf_size, unsigned int num_bufs, - void *user); - -typedef void (*camera_notify_callback)(int32_t msg_type, - int32_t ext1, - int32_t ext2, - void *user); - -typedef void (*camera_data_callback)(int32_t msg_type, - const camera_memory_t *data, unsigned int index, - camera_frame_metadata_t *metadata, void *user); - -typedef void (*camera_data_timestamp_callback)(int64_t timestamp, - int32_t msg_type, - const camera_memory_t *data, unsigned int index, - void *user); - -#define HAL_CAMERA_PREVIEW_WINDOW_TAG 0xcafed00d - -typedef struct preview_stream_ops { - int (*dequeue_buffer)(struct preview_stream_ops* w, - buffer_handle_t** buffer, int *stride); - int (*enqueue_buffer)(struct preview_stream_ops* w, - buffer_handle_t* buffer); - int (*cancel_buffer)(struct preview_stream_ops* w, - buffer_handle_t* buffer); - int (*set_buffer_count)(struct preview_stream_ops* w, int count); - int (*set_buffers_geometry)(struct preview_stream_ops* pw, - int w, int h, int format); - int (*set_crop)(struct preview_stream_ops *w, - int left, int top, int right, int bottom); - int (*set_usage)(struct preview_stream_ops* w, int usage); - int (*set_swap_interval)(struct preview_stream_ops *w, int interval); - int (*get_min_undequeued_buffer_count)(const struct preview_stream_ops *w, - int *count); - int (*lock_buffer)(struct preview_stream_ops* w, - buffer_handle_t* buffer); - // Timestamps are measured in nanoseconds, and must be comparable - // and monotonically increasing between two frames in the same - // preview stream. They do not need to be comparable between - // consecutive or parallel preview streams, cameras, or app runs. - int (*set_timestamp)(struct preview_stream_ops *w, int64_t timestamp); -} preview_stream_ops_t; - -struct camera_device; -typedef struct camera_device_ops { - /** Set the ANativeWindow to which preview frames are sent */ - int (*set_preview_window)(struct camera_device *, - struct preview_stream_ops *window); - - /** Set the notification and data callbacks */ - void (*set_callbacks)(struct camera_device *, - camera_notify_callback notify_cb, - camera_data_callback data_cb, - camera_data_timestamp_callback data_cb_timestamp, - camera_request_memory get_memory, - void *user); - - /** - * The following three functions all take a msg_type, which is a bitmask of - * the messages defined in include/ui/Camera.h - */ - - /** - * Enable a message, or set of messages. - */ - void (*enable_msg_type)(struct camera_device *, int32_t msg_type); - - /** - * Disable a message, or a set of messages. - * - * Once received a call to disableMsgType(CAMERA_MSG_VIDEO_FRAME), camera - * HAL should not rely on its client to call releaseRecordingFrame() to - * release video recording frames sent out by the cameral HAL before and - * after the disableMsgType(CAMERA_MSG_VIDEO_FRAME) call. Camera HAL - * clients must not modify/access any video recording frame after calling - * disableMsgType(CAMERA_MSG_VIDEO_FRAME). - */ - void (*disable_msg_type)(struct camera_device *, int32_t msg_type); - - /** - * Query whether a message, or a set of messages, is enabled. Note that - * this is operates as an AND, if any of the messages queried are off, this - * will return false. - */ - int (*msg_type_enabled)(struct camera_device *, int32_t msg_type); - - /** - * Start preview mode. - */ - int (*start_preview)(struct camera_device *); - - /** - * Stop a previously started preview. - */ - void (*stop_preview)(struct camera_device *); - - /** - * Returns true if preview is enabled. - */ - int (*preview_enabled)(struct camera_device *); - - /** - * Request the camera HAL to store meta data or real YUV data in the video - * buffers sent out via CAMERA_MSG_VIDEO_FRAME for a recording session. If - * it is not called, the default camera HAL behavior is to store real YUV - * data in the video buffers. - * - * This method should be called before startRecording() in order to be - * effective. - * - * If meta data is stored in the video buffers, it is up to the receiver of - * the video buffers to interpret the contents and to find the actual frame - * data with the help of the meta data in the buffer. How this is done is - * outside of the scope of this method. - * - * Some camera HALs may not support storing meta data in the video buffers, - * but all camera HALs should support storing real YUV data in the video - * buffers. If the camera HAL does not support storing the meta data in the - * video buffers when it is requested to do do, INVALID_OPERATION must be - * returned. It is very useful for the camera HAL to pass meta data rather - * than the actual frame data directly to the video encoder, since the - * amount of the uncompressed frame data can be very large if video size is - * large. - * - * @param enable if true to instruct the camera HAL to store - * meta data in the video buffers; false to instruct - * the camera HAL to store real YUV data in the video - * buffers. - * - * @return OK on success. - */ - int (*store_meta_data_in_buffers)(struct camera_device *, int enable); - - /** - * Start record mode. When a record image is available, a - * CAMERA_MSG_VIDEO_FRAME message is sent with the corresponding - * frame. Every record frame must be released by a camera HAL client via - * releaseRecordingFrame() before the client calls - * disableMsgType(CAMERA_MSG_VIDEO_FRAME). After the client calls - * disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is the camera HAL's - * responsibility to manage the life-cycle of the video recording frames, - * and the client must not modify/access any video recording frames. - */ - int (*start_recording)(struct camera_device *); - - /** - * Stop a previously started recording. - */ - void (*stop_recording)(struct camera_device *); - - /** - * Returns true if recording is enabled. - */ - int (*recording_enabled)(struct camera_device *); - - /** - * Release a record frame previously returned by CAMERA_MSG_VIDEO_FRAME. - * - * It is camera HAL client's responsibility to release video recording - * frames sent out by the camera HAL before the camera HAL receives a call - * to disableMsgType(CAMERA_MSG_VIDEO_FRAME). After it receives the call to - * disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is the camera HAL's - * responsibility to manage the life-cycle of the video recording frames. - */ - void (*release_recording_frame)(struct camera_device *, - const void *opaque); - - /** - * Start auto focus, the notification callback routine is called with - * CAMERA_MSG_FOCUS once when focusing is complete. autoFocus() will be - * called again if another auto focus is needed. - */ - int (*auto_focus)(struct camera_device *); - - /** - * Cancels auto-focus function. If the auto-focus is still in progress, - * this function will cancel it. Whether the auto-focus is in progress or - * not, this function will return the focus position to the default. If - * the camera does not support auto-focus, this is a no-op. - */ - int (*cancel_auto_focus)(struct camera_device *); - - /** - * Take a picture. - */ - int (*take_picture)(struct camera_device *); - - /** - * Cancel a picture that was started with takePicture. Calling this method - * when no picture is being taken is a no-op. - */ - int (*cancel_picture)(struct camera_device *); - - /** - * Set the camera parameters. This returns BAD_VALUE if any parameter is - * invalid or not supported. - */ - int (*set_parameters)(struct camera_device *, const char *parms); - - /** Retrieve the camera parameters. The buffer returned by the camera HAL - must be returned back to it with put_parameters, if put_parameters - is not NULL. - */ - char *(*get_parameters)(struct camera_device *); - - /** The camera HAL uses its own memory to pass us the parameters when we - call get_parameters. Use this function to return the memory back to - the camera HAL, if put_parameters is not NULL. If put_parameters - is NULL, then you have to use free() to release the memory. - */ - void (*put_parameters)(struct camera_device *, char *); - - /** - * Send command to camera driver. - */ - int (*send_command)(struct camera_device *, - int32_t cmd, int32_t arg1, int32_t arg2); - - /** - * Release the hardware resources owned by this object. Note that this is - * *not* done in the destructor. - */ - void (*release)(struct camera_device *); - - /** - * Dump state of the camera hardware - */ - int (*dump)(struct camera_device *, int fd); -} camera_device_ops_t; - -typedef struct camera_device { - /** - * camera_device.common.version must be in the range - * HARDWARE_DEVICE_API_VERSION(0,0)-(1,FF). CAMERA_DEVICE_API_VERSION_1_0 is - * recommended. - */ - hw_device_t common; - camera_device_ops_t *ops; - void *priv; -} camera_device_t; - -__END_DECLS - -#endif /* #ifdef ANDROID_INCLUDE_CAMERA_H */ diff --git a/external/android/include/19/hardware/libhardware/include/hardware/camera2.h b/external/android/include/19/hardware/libhardware/include/hardware/camera2.h deleted file mode 100644 index 5b182a8..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/camera2.h +++ /dev/null @@ -1,838 +0,0 @@ -/* - * Copyright (C) 2012 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_INCLUDE_CAMERA2_H -#define ANDROID_INCLUDE_CAMERA2_H - -#include "camera_common.h" -#include "system/camera_metadata.h" - -/** - * Camera device HAL 2.1 [ CAMERA_DEVICE_API_VERSION_2_0, CAMERA_DEVICE_API_VERSION_2_1 ] - * - * EXPERIMENTAL. - * - * Supports the android.hardware.Camera APIs. - * - * Camera devices that support this version of the HAL must return - * CAMERA_DEVICE_API_VERSION_2_1 in camera_device_t.common.version and in - * camera_info_t.device_version (from camera_module_t.get_camera_info). - * - * Camera modules that may contain version 2.x devices must implement at least - * version 2.0 of the camera module interface (as defined by - * camera_module_t.common.module_api_version). - * - * See camera_common.h for more versioning details. - * - * Version history: - * - * 2.0: CAMERA_DEVICE_API_VERSION_2_0. Initial release (Android 4.2): - * - Sufficient for implementing existing android.hardware.Camera API. - * - Allows for ZSL queue in camera service layer - * - Not tested for any new features such manual capture control, - * Bayer RAW capture, reprocessing of RAW data. - * - * 2.1: CAMERA_DEVICE_API_VERSION_2_1. Support per-device static metadata: - * - Add get_instance_metadata() method to retrieve metadata that is fixed - * after device open, but may be variable between open() calls. - */ - -__BEGIN_DECLS - -struct camera2_device; - -/********************************************************************** - * - * Input/output stream buffer queue interface definitions - * - */ - -/** - * Output image stream queue interface. A set of these methods is provided to - * the HAL device in allocate_stream(), and are used to interact with the - * gralloc buffer queue for that stream. They may not be called until after - * allocate_stream returns. - */ -typedef struct camera2_stream_ops { - /** - * Get a buffer to fill from the queue. The size and format of the buffer - * are fixed for a given stream (defined in allocate_stream), and the stride - * should be queried from the platform gralloc module. The gralloc buffer - * will have been allocated based on the usage flags provided by - * allocate_stream, and will be locked for use. - */ - int (*dequeue_buffer)(const struct camera2_stream_ops* w, - buffer_handle_t** buffer); - - /** - * Push a filled buffer to the stream to be used by the consumer. - * - * The timestamp represents the time at start of exposure of the first row - * of the image; it must be from a monotonic clock, and is measured in - * nanoseconds. The timestamps do not need to be comparable between - * different cameras, or consecutive instances of the same camera. However, - * they must be comparable between streams from the same camera. If one - * capture produces buffers for multiple streams, each stream must have the - * same timestamp for that buffer, and that timestamp must match the - * timestamp in the output frame metadata. - */ - int (*enqueue_buffer)(const struct camera2_stream_ops* w, - int64_t timestamp, - buffer_handle_t* buffer); - /** - * Return a buffer to the queue without marking it as filled. - */ - int (*cancel_buffer)(const struct camera2_stream_ops* w, - buffer_handle_t* buffer); - /** - * Set the crop window for subsequently enqueued buffers. The parameters are - * measured in pixels relative to the buffer width and height. - */ - int (*set_crop)(const struct camera2_stream_ops *w, - int left, int top, int right, int bottom); - -} camera2_stream_ops_t; - -/** - * Temporary definition during transition. - * - * These formats will be removed and replaced with - * HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED. To maximize forward compatibility, - * HAL implementations are strongly recommended to treat FORMAT_OPAQUE and - * FORMAT_ZSL as equivalent to HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED, and - * return HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED in the format_actual output - * parameter of allocate_stream, allowing the gralloc module to select the - * specific format based on the usage flags from the camera and the stream - * consumer. - */ -enum { - CAMERA2_HAL_PIXEL_FORMAT_OPAQUE = HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED, - CAMERA2_HAL_PIXEL_FORMAT_ZSL = -1 -}; - -/** - * Transport header for compressed JPEG buffers in output streams. - * - * To capture JPEG images, a stream is created using the pixel format - * HAL_PIXEL_FORMAT_BLOB, and the static metadata field android.jpeg.maxSize is - * used as the buffer size. Since compressed JPEG images are of variable size, - * the HAL needs to include the final size of the compressed image using this - * structure inside the output stream buffer. The JPEG blob ID field must be set - * to CAMERA2_JPEG_BLOB_ID. - * - * Transport header should be at the end of the JPEG output stream buffer. That - * means the jpeg_blob_id must start at byte[android.jpeg.maxSize - - * sizeof(camera2_jpeg_blob)]. Any HAL using this transport header must - * account for it in android.jpeg.maxSize. The JPEG data itself starts at - * byte[0] and should be jpeg_size bytes long. - */ -typedef struct camera2_jpeg_blob { - uint16_t jpeg_blob_id; - uint32_t jpeg_size; -}; - -enum { - CAMERA2_JPEG_BLOB_ID = 0x00FF -}; - -/** - * Input reprocess stream queue management. A set of these methods is provided - * to the HAL device in allocate_reprocess_stream(); they are used to interact - * with the reprocess stream's input gralloc buffer queue. - */ -typedef struct camera2_stream_in_ops { - /** - * Get the next buffer of image data to reprocess. The width, height, and - * format of the buffer is fixed in allocate_reprocess_stream(), and the - * stride and other details should be queried from the platform gralloc - * module as needed. The buffer will already be locked for use. - */ - int (*acquire_buffer)(const struct camera2_stream_in_ops *w, - buffer_handle_t** buffer); - /** - * Return a used buffer to the buffer queue for reuse. - */ - int (*release_buffer)(const struct camera2_stream_in_ops *w, - buffer_handle_t* buffer); - -} camera2_stream_in_ops_t; - -/********************************************************************** - * - * Metadata queue management, used for requests sent to HAL module, and for - * frames produced by the HAL. - * - */ - -enum { - CAMERA2_REQUEST_QUEUE_IS_BOTTOMLESS = -1 -}; - -/** - * Request input queue protocol: - * - * The framework holds the queue and its contents. At start, the queue is empty. - * - * 1. When the first metadata buffer is placed into the queue, the framework - * signals the device by calling notify_request_queue_not_empty(). - * - * 2. After receiving notify_request_queue_not_empty, the device must call - * dequeue() once it's ready to handle the next buffer. - * - * 3. Once the device has processed a buffer, and is ready for the next buffer, - * it must call dequeue() again instead of waiting for a notification. If - * there are no more buffers available, dequeue() will return NULL. After - * this point, when a buffer becomes available, the framework must call - * notify_request_queue_not_empty() again. If the device receives a NULL - * return from dequeue, it does not need to query the queue again until a - * notify_request_queue_not_empty() call is received from the source. - * - * 4. If the device calls buffer_count() and receives 0, this does not mean that - * the framework will provide a notify_request_queue_not_empty() call. The - * framework will only provide such a notification after the device has - * received a NULL from dequeue, or on initial startup. - * - * 5. The dequeue() call in response to notify_request_queue_not_empty() may be - * on the same thread as the notify_request_queue_not_empty() call, and may - * be performed from within the notify call. - * - * 6. All dequeued request buffers must be returned to the framework by calling - * free_request, including when errors occur, a device flush is requested, or - * when the device is shutting down. - */ -typedef struct camera2_request_queue_src_ops { - /** - * Get the count of request buffers pending in the queue. May return - * CAMERA2_REQUEST_QUEUE_IS_BOTTOMLESS if a repeating request (stream - * request) is currently configured. Calling this method has no effect on - * whether the notify_request_queue_not_empty() method will be called by the - * framework. - */ - int (*request_count)(const struct camera2_request_queue_src_ops *q); - - /** - * Get a metadata buffer from the framework. Returns OK if there is no - * error. If the queue is empty, returns NULL in buffer. In that case, the - * device must wait for a notify_request_queue_not_empty() message before - * attempting to dequeue again. Buffers obtained in this way must be - * returned to the framework with free_request(). - */ - int (*dequeue_request)(const struct camera2_request_queue_src_ops *q, - camera_metadata_t **buffer); - /** - * Return a metadata buffer to the framework once it has been used, or if - * an error or shutdown occurs. - */ - int (*free_request)(const struct camera2_request_queue_src_ops *q, - camera_metadata_t *old_buffer); - -} camera2_request_queue_src_ops_t; - -/** - * Frame output queue protocol: - * - * The framework holds the queue and its contents. At start, the queue is empty. - * - * 1. When the device is ready to fill an output metadata frame, it must dequeue - * a metadata buffer of the required size. - * - * 2. It should then fill the metadata buffer, and place it on the frame queue - * using enqueue_frame. The framework takes ownership of the frame. - * - * 3. In case of an error, a request to flush the pipeline, or shutdown, the - * device must return any affected dequeued frames to the framework by - * calling cancel_frame. - */ -typedef struct camera2_frame_queue_dst_ops { - /** - * Get an empty metadata buffer to fill from the framework. The new metadata - * buffer will have room for entries number of metadata entries, plus - * data_bytes worth of extra storage. Frames dequeued here must be returned - * to the framework with either cancel_frame or enqueue_frame. - */ - int (*dequeue_frame)(const struct camera2_frame_queue_dst_ops *q, - size_t entries, size_t data_bytes, - camera_metadata_t **buffer); - - /** - * Return a dequeued metadata buffer to the framework for reuse; do not mark it as - * filled. Use when encountering errors, or flushing the internal request queue. - */ - int (*cancel_frame)(const struct camera2_frame_queue_dst_ops *q, - camera_metadata_t *buffer); - - /** - * Place a completed metadata frame on the frame output queue. - */ - int (*enqueue_frame)(const struct camera2_frame_queue_dst_ops *q, - camera_metadata_t *buffer); - -} camera2_frame_queue_dst_ops_t; - -/********************************************************************** - * - * Notification callback and message definition, and trigger definitions - * - */ - -/** - * Asynchronous notification callback from the HAL, fired for various - * reasons. Only for information independent of frame capture, or that require - * specific timing. The user pointer must be the same one that was passed to the - * device in set_notify_callback(). - */ -typedef void (*camera2_notify_callback)(int32_t msg_type, - int32_t ext1, - int32_t ext2, - int32_t ext3, - void *user); - -/** - * Possible message types for camera2_notify_callback - */ -enum { - /** - * An error has occurred. Argument ext1 contains the error code, and - * ext2 and ext3 contain any error-specific information. - */ - CAMERA2_MSG_ERROR = 0x0001, - /** - * The exposure of a given request has begun. Argument ext1 contains the - * frame number, and ext2 and ext3 contain the low-order and high-order - * bytes of the timestamp for when exposure began. - * (timestamp = (ext3 << 32 | ext2)) - */ - CAMERA2_MSG_SHUTTER = 0x0010, - /** - * The autofocus routine has changed state. Argument ext1 contains the new - * state; the values are the same as those for the metadata field - * android.control.afState. Ext2 contains the latest trigger ID passed to - * trigger_action(CAMERA2_TRIGGER_AUTOFOCUS) or - * trigger_action(CAMERA2_TRIGGER_CANCEL_AUTOFOCUS), or 0 if trigger has not - * been called with either of those actions. - */ - CAMERA2_MSG_AUTOFOCUS = 0x0020, - /** - * The autoexposure routine has changed state. Argument ext1 contains the - * new state; the values are the same as those for the metadata field - * android.control.aeState. Ext2 contains the latest trigger ID value passed to - * trigger_action(CAMERA2_TRIGGER_PRECAPTURE_METERING), or 0 if that method - * has not been called. - */ - CAMERA2_MSG_AUTOEXPOSURE = 0x0021, - /** - * The auto-whitebalance routine has changed state. Argument ext1 contains - * the new state; the values are the same as those for the metadata field - * android.control.awbState. Ext2 contains the latest trigger ID passed to - * trigger_action(CAMERA2_TRIGGER_PRECAPTURE_METERING), or 0 if that method - * has not been called. - */ - CAMERA2_MSG_AUTOWB = 0x0022 -}; - -/** - * Error codes for CAMERA_MSG_ERROR - */ -enum { - /** - * A serious failure occured. Camera device may not work without reboot, and - * no further frames or buffer streams will be produced by the - * device. Device should be treated as closed. - */ - CAMERA2_MSG_ERROR_HARDWARE = 0x0001, - /** - * A serious failure occured. No further frames or buffer streams will be - * produced by the device. Device should be treated as closed. The client - * must reopen the device to use it again. - */ - CAMERA2_MSG_ERROR_DEVICE, - /** - * An error has occurred in processing a request. No output (metadata or - * buffers) will be produced for this request. ext2 contains the frame - * number of the request. Subsequent requests are unaffected, and the device - * remains operational. - */ - CAMERA2_MSG_ERROR_REQUEST, - /** - * An error has occurred in producing an output frame metadata buffer for a - * request, but image buffers for it will still be available. Subsequent - * requests are unaffected, and the device remains operational. ext2 - * contains the frame number of the request. - */ - CAMERA2_MSG_ERROR_FRAME, - /** - * An error has occurred in placing an output buffer into a stream for a - * request. The frame metadata and other buffers may still be - * available. Subsequent requests are unaffected, and the device remains - * operational. ext2 contains the frame number of the request, and ext3 - * contains the stream id. - */ - CAMERA2_MSG_ERROR_STREAM, - /** - * Number of error types - */ - CAMERA2_MSG_NUM_ERRORS -}; - -/** - * Possible trigger ids for trigger_action() - */ -enum { - /** - * Trigger an autofocus cycle. The effect of the trigger depends on the - * autofocus mode in effect when the trigger is received, which is the mode - * listed in the latest capture request to be dequeued by the HAL. If the - * mode is OFF, EDOF, or FIXED, the trigger has no effect. In AUTO, MACRO, - * or CONTINUOUS_* modes, see below for the expected behavior. The state of - * the autofocus cycle can be tracked in android.control.afMode and the - * corresponding notifications. - * - ** - * In AUTO or MACRO mode, the AF state transitions (and notifications) - * when calling with trigger ID = N with the previous ID being K are: - * - * Initial state Transitions - * INACTIVE (K) -> ACTIVE_SCAN (N) -> AF_FOCUSED (N) or AF_NOT_FOCUSED (N) - * AF_FOCUSED (K) -> ACTIVE_SCAN (N) -> AF_FOCUSED (N) or AF_NOT_FOCUSED (N) - * AF_NOT_FOCUSED (K) -> ACTIVE_SCAN (N) -> AF_FOCUSED (N) or AF_NOT_FOCUSED (N) - * ACTIVE_SCAN (K) -> AF_FOCUSED(N) or AF_NOT_FOCUSED(N) - * PASSIVE_SCAN (K) Not used in AUTO/MACRO mode - * PASSIVE_FOCUSED (K) Not used in AUTO/MACRO mode - * - ** - * In CONTINUOUS_PICTURE mode, triggering AF must lock the AF to the current - * lens position and transition the AF state to either AF_FOCUSED or - * NOT_FOCUSED. If a passive scan is underway, that scan must complete and - * then lock the lens position and change AF state. TRIGGER_CANCEL_AUTOFOCUS - * will allow the AF to restart its operation. - * - * Initial state Transitions - * INACTIVE (K) -> immediate AF_FOCUSED (N) or AF_NOT_FOCUSED (N) - * PASSIVE_FOCUSED (K) -> immediate AF_FOCUSED (N) or AF_NOT_FOCUSED (N) - * PASSIVE_SCAN (K) -> AF_FOCUSED (N) or AF_NOT_FOCUSED (N) - * AF_FOCUSED (K) no effect except to change next notification ID to N - * AF_NOT_FOCUSED (K) no effect except to change next notification ID to N - * - ** - * In CONTINUOUS_VIDEO mode, triggering AF must lock the AF to the current - * lens position and transition the AF state to either AF_FOCUSED or - * NOT_FOCUSED. If a passive scan is underway, it must immediately halt, in - * contrast with CONTINUOUS_PICTURE mode. TRIGGER_CANCEL_AUTOFOCUS will - * allow the AF to restart its operation. - * - * Initial state Transitions - * INACTIVE (K) -> immediate AF_FOCUSED (N) or AF_NOT_FOCUSED (N) - * PASSIVE_FOCUSED (K) -> immediate AF_FOCUSED (N) or AF_NOT_FOCUSED (N) - * PASSIVE_SCAN (K) -> immediate AF_FOCUSED (N) or AF_NOT_FOCUSED (N) - * AF_FOCUSED (K) no effect except to change next notification ID to N - * AF_NOT_FOCUSED (K) no effect except to change next notification ID to N - * - * Ext1 is an ID that must be returned in subsequent auto-focus state change - * notifications through camera2_notify_callback() and stored in - * android.control.afTriggerId. - */ - CAMERA2_TRIGGER_AUTOFOCUS = 0x0001, - /** - * Send a cancel message to the autofocus algorithm. The effect of the - * cancellation depends on the autofocus mode in effect when the trigger is - * received, which is the mode listed in the latest capture request to be - * dequeued by the HAL. If the AF mode is OFF or EDOF, the cancel has no - * effect. For other modes, the lens should return to its default position, - * any current autofocus scan must be canceled, and the AF state should be - * set to INACTIVE. - * - * The state of the autofocus cycle can be tracked in android.control.afMode - * and the corresponding notification. Continuous autofocus modes may resume - * focusing operations thereafter exactly as if the camera had just been set - * to a continuous AF mode. - * - * Ext1 is an ID that must be returned in subsequent auto-focus state change - * notifications through camera2_notify_callback() and stored in - * android.control.afTriggerId. - */ - CAMERA2_TRIGGER_CANCEL_AUTOFOCUS, - /** - * Trigger a pre-capture metering cycle, which may include firing the flash - * to determine proper capture parameters. Typically, this trigger would be - * fired for a half-depress of a camera shutter key, or before a snapshot - * capture in general. The state of the metering cycle can be tracked in - * android.control.aeMode and the corresponding notification. If the - * auto-exposure mode is OFF, the trigger does nothing. - * - * Ext1 is an ID that must be returned in subsequent - * auto-exposure/auto-white balance state change notifications through - * camera2_notify_callback() and stored in android.control.aePrecaptureId. - */ - CAMERA2_TRIGGER_PRECAPTURE_METERING -}; - -/** - * Possible template types for construct_default_request() - */ -enum { - /** - * Standard camera preview operation with 3A on auto. - */ - CAMERA2_TEMPLATE_PREVIEW = 1, - /** - * Standard camera high-quality still capture with 3A and flash on auto. - */ - CAMERA2_TEMPLATE_STILL_CAPTURE, - /** - * Standard video recording plus preview with 3A on auto, torch off. - */ - CAMERA2_TEMPLATE_VIDEO_RECORD, - /** - * High-quality still capture while recording video. Application will - * include preview, video record, and full-resolution YUV or JPEG streams in - * request. Must not cause stuttering on video stream. 3A on auto. - */ - CAMERA2_TEMPLATE_VIDEO_SNAPSHOT, - /** - * Zero-shutter-lag mode. Application will request preview and - * full-resolution data for each frame, and reprocess it to JPEG when a - * still image is requested by user. Settings should provide highest-quality - * full-resolution images without compromising preview frame rate. 3A on - * auto. - */ - CAMERA2_TEMPLATE_ZERO_SHUTTER_LAG, - - /* Total number of templates */ - CAMERA2_TEMPLATE_COUNT -}; - - -/********************************************************************** - * - * Camera device operations - * - */ -typedef struct camera2_device_ops { - - /********************************************************************** - * Request and frame queue setup and management methods - */ - - /** - * Pass in input request queue interface methods. - */ - int (*set_request_queue_src_ops)(const struct camera2_device *, - const camera2_request_queue_src_ops_t *request_src_ops); - - /** - * Notify device that the request queue is no longer empty. Must only be - * called when the first buffer is added a new queue, or after the source - * has returned NULL in response to a dequeue call. - */ - int (*notify_request_queue_not_empty)(const struct camera2_device *); - - /** - * Pass in output frame queue interface methods - */ - int (*set_frame_queue_dst_ops)(const struct camera2_device *, - const camera2_frame_queue_dst_ops_t *frame_dst_ops); - - /** - * Number of camera requests being processed by the device at the moment - * (captures/reprocesses that have had their request dequeued, but have not - * yet been enqueued onto output pipeline(s) ). No streams may be released - * by the framework until the in-progress count is 0. - */ - int (*get_in_progress_count)(const struct camera2_device *); - - /** - * Flush all in-progress captures. This includes all dequeued requests - * (regular or reprocessing) that have not yet placed any outputs into a - * stream or the frame queue. Partially completed captures must be completed - * normally. No new requests may be dequeued from the request queue until - * the flush completes. - */ - int (*flush_captures_in_progress)(const struct camera2_device *); - - /** - * Create a filled-in default request for standard camera use cases. - * - * The device must return a complete request that is configured to meet the - * requested use case, which must be one of the CAMERA2_TEMPLATE_* - * enums. All request control fields must be included, except for - * android.request.outputStreams. - * - * The metadata buffer returned must be allocated with - * allocate_camera_metadata. The framework takes ownership of the buffer. - */ - int (*construct_default_request)(const struct camera2_device *, - int request_template, - camera_metadata_t **request); - - /********************************************************************** - * Stream management - */ - - /** - * allocate_stream: - * - * Allocate a new output stream for use, defined by the output buffer width, - * height, target, and possibly the pixel format. Returns the new stream's - * ID, gralloc usage flags, minimum queue buffer count, and possibly the - * pixel format, on success. Error conditions: - * - * - Requesting a width/height/format combination not listed as - * supported by the sensor's static characteristics - * - * - Asking for too many streams of a given format type (2 bayer raw - * streams, for example). - * - * Input parameters: - * - * - width, height, format: Specification for the buffers to be sent through - * this stream. Format is a value from the HAL_PIXEL_FORMAT_* list. If - * HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED is used, then the platform - * gralloc module will select a format based on the usage flags provided - * by the camera HAL and the consumer of the stream. The camera HAL should - * inspect the buffers handed to it in the register_stream_buffers call to - * obtain the implementation-specific format if necessary. - * - * - stream_ops: A structure of function pointers for obtaining and queuing - * up buffers for this stream. The underlying stream will be configured - * based on the usage and max_buffers outputs. The methods in this - * structure may not be called until after allocate_stream returns. - * - * Output parameters: - * - * - stream_id: An unsigned integer identifying this stream. This value is - * used in incoming requests to identify the stream, and in releasing the - * stream. - * - * - usage: The gralloc usage mask needed by the HAL device for producing - * the requested type of data. This is used in allocating new gralloc - * buffers for the stream buffer queue. - * - * - max_buffers: The maximum number of buffers the HAL device may need to - * have dequeued at the same time. The device may not dequeue more buffers - * than this value at the same time. - * - */ - int (*allocate_stream)( - const struct camera2_device *, - // inputs - uint32_t width, - uint32_t height, - int format, - const camera2_stream_ops_t *stream_ops, - // outputs - uint32_t *stream_id, - uint32_t *format_actual, // IGNORED, will be removed - uint32_t *usage, - uint32_t *max_buffers); - - /** - * Register buffers for a given stream. This is called after a successful - * allocate_stream call, and before the first request referencing the stream - * is enqueued. This method is intended to allow the HAL device to map or - * otherwise prepare the buffers for later use. num_buffers is guaranteed to - * be at least max_buffers (from allocate_stream), but may be larger. The - * buffers will already be locked for use. At the end of the call, all the - * buffers must be ready to be returned to the queue. If the stream format - * was set to HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED, the camera HAL should - * inspect the passed-in buffers here to determine any platform-private - * pixel format information. - */ - int (*register_stream_buffers)( - const struct camera2_device *, - uint32_t stream_id, - int num_buffers, - buffer_handle_t *buffers); - - /** - * Release a stream. Returns an error if called when get_in_progress_count - * is non-zero, or if the stream id is invalid. - */ - int (*release_stream)( - const struct camera2_device *, - uint32_t stream_id); - - /** - * allocate_reprocess_stream: - * - * Allocate a new input stream for use, defined by the output buffer width, - * height, and the pixel format. Returns the new stream's ID, gralloc usage - * flags, and required simultaneously acquirable buffer count, on - * success. Error conditions: - * - * - Requesting a width/height/format combination not listed as - * supported by the sensor's static characteristics - * - * - Asking for too many reprocessing streams to be configured at once. - * - * Input parameters: - * - * - width, height, format: Specification for the buffers to be sent through - * this stream. Format must be a value from the HAL_PIXEL_FORMAT_* list. - * - * - reprocess_stream_ops: A structure of function pointers for acquiring - * and releasing buffers for this stream. The underlying stream will be - * configured based on the usage and max_buffers outputs. - * - * Output parameters: - * - * - stream_id: An unsigned integer identifying this stream. This value is - * used in incoming requests to identify the stream, and in releasing the - * stream. These ids are numbered separately from the input stream ids. - * - * - consumer_usage: The gralloc usage mask needed by the HAL device for - * consuming the requested type of data. This is used in allocating new - * gralloc buffers for the stream buffer queue. - * - * - max_buffers: The maximum number of buffers the HAL device may need to - * have acquired at the same time. The device may not have more buffers - * acquired at the same time than this value. - * - */ - int (*allocate_reprocess_stream)(const struct camera2_device *, - uint32_t width, - uint32_t height, - uint32_t format, - const camera2_stream_in_ops_t *reprocess_stream_ops, - // outputs - uint32_t *stream_id, - uint32_t *consumer_usage, - uint32_t *max_buffers); - - /** - * allocate_reprocess_stream_from_stream: - * - * Allocate a new input stream for use, which will use the buffers allocated - * for an existing output stream. That is, after the HAL enqueues a buffer - * onto the output stream, it may see that same buffer handed to it from - * this input reprocessing stream. After the HAL releases the buffer back to - * the reprocessing stream, it will be returned to the output queue for - * reuse. - * - * Error conditions: - * - * - Using an output stream of unsuitable size/format for the basis of the - * reprocessing stream. - * - * - Attempting to allocatee too many reprocessing streams at once. - * - * Input parameters: - * - * - output_stream_id: The ID of an existing output stream which has - * a size and format suitable for reprocessing. - * - * - reprocess_stream_ops: A structure of function pointers for acquiring - * and releasing buffers for this stream. The underlying stream will use - * the same graphics buffer handles as the output stream uses. - * - * Output parameters: - * - * - stream_id: An unsigned integer identifying this stream. This value is - * used in incoming requests to identify the stream, and in releasing the - * stream. These ids are numbered separately from the input stream ids. - * - * The HAL client must always release the reprocessing stream before it - * releases the output stream it is based on. - * - */ - int (*allocate_reprocess_stream_from_stream)(const struct camera2_device *, - uint32_t output_stream_id, - const camera2_stream_in_ops_t *reprocess_stream_ops, - // outputs - uint32_t *stream_id); - - /** - * Release a reprocessing stream. Returns an error if called when - * get_in_progress_count is non-zero, or if the stream id is not - * valid. - */ - int (*release_reprocess_stream)( - const struct camera2_device *, - uint32_t stream_id); - - /********************************************************************** - * Miscellaneous methods - */ - - /** - * Trigger asynchronous activity. This is used for triggering special - * behaviors of the camera 3A routines when they are in use. See the - * documentation for CAMERA2_TRIGGER_* above for details of the trigger ids - * and their arguments. - */ - int (*trigger_action)(const struct camera2_device *, - uint32_t trigger_id, - int32_t ext1, - int32_t ext2); - - /** - * Notification callback setup - */ - int (*set_notify_callback)(const struct camera2_device *, - camera2_notify_callback notify_cb, - void *user); - - /** - * Get methods to query for vendor extension metadata tag infomation. May - * set ops to NULL if no vendor extension tags are defined. - */ - int (*get_metadata_vendor_tag_ops)(const struct camera2_device*, - vendor_tag_query_ops_t **ops); - - /** - * Dump state of the camera hardware - */ - int (*dump)(const struct camera2_device *, int fd); - - /** - * Get device-instance-specific metadata. This metadata must be constant for - * a single instance of the camera device, but may be different between - * open() calls. The returned camera_metadata pointer must be valid until - * the device close() method is called. - * - * Version information: - * - * CAMERA_DEVICE_API_VERSION_2_0: - * - * Not available. Framework may not access this function pointer. - * - * CAMERA_DEVICE_API_VERSION_2_1: - * - * Valid. Can be called by the framework. - * - */ - int (*get_instance_metadata)(const struct camera2_device *, - camera_metadata **instance_metadata); - -} camera2_device_ops_t; - -/********************************************************************** - * - * Camera device definition - * - */ -typedef struct camera2_device { - /** - * common.version must equal CAMERA_DEVICE_API_VERSION_2_0 to identify - * this device as implementing version 2.0 of the camera device HAL. - */ - hw_device_t common; - camera2_device_ops_t *ops; - void *priv; -} camera2_device_t; - -__END_DECLS - -#endif /* #ifdef ANDROID_INCLUDE_CAMERA2_H */ diff --git a/external/android/include/19/hardware/libhardware/include/hardware/camera3.h b/external/android/include/19/hardware/libhardware/include/hardware/camera3.h deleted file mode 100644 index afc9d9f..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/camera3.h +++ /dev/null @@ -1,2152 +0,0 @@ -/* - * Copyright (C) 2013 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_INCLUDE_CAMERA3_H -#define ANDROID_INCLUDE_CAMERA3_H - -#include -#include "camera_common.h" - -/** - * Camera device HAL 3.1 [ CAMERA_DEVICE_API_VERSION_3_1 ] - * - * EXPERIMENTAL. - * - * Supports the android.hardware.Camera API. - * - * Camera devices that support this version of the HAL must return - * CAMERA_DEVICE_API_VERSION_3_1 in camera_device_t.common.version and in - * camera_info_t.device_version (from camera_module_t.get_camera_info). - * - * Camera modules that may contain version 3.1 devices must implement at least - * version 2.0 of the camera module interface (as defined by - * camera_module_t.common.module_api_version). - * - * See camera_common.h for more versioning details. - * - * Documentation index: - * S1. Version history - * S2. Startup and operation sequencing - * S3. Operational modes - * S4. 3A modes and state machines - * S5. Cropping - * S6. Error management - */ - -/** - * S1. Version history: - * - * 1.0: Initial Android camera HAL (Android 4.0) [camera.h]: - * - * - Converted from C++ CameraHardwareInterface abstraction layer. - * - * - Supports android.hardware.Camera API. - * - * 2.0: Initial release of expanded-capability HAL (Android 4.2) [camera2.h]: - * - * - Sufficient for implementing existing android.hardware.Camera API. - * - * - Allows for ZSL queue in camera service layer - * - * - Not tested for any new features such manual capture control, Bayer RAW - * capture, reprocessing of RAW data. - * - * 3.0: First revision of expanded-capability HAL: - * - * - Major version change since the ABI is completely different. No change to - * the required hardware capabilities or operational model from 2.0. - * - * - Reworked input request and stream queue interfaces: Framework calls into - * HAL with next request and stream buffers already dequeued. Sync framework - * support is included, necessary for efficient implementations. - * - * - Moved triggers into requests, most notifications into results. - * - * - Consolidated all callbacks into framework into one structure, and all - * setup methods into a single initialize() call. - * - * - Made stream configuration into a single call to simplify stream - * management. Bidirectional streams replace STREAM_FROM_STREAM construct. - * - * - Limited mode semantics for older/limited hardware devices. - * - * 3.1: Minor revision of expanded-capability HAL: - * - * - configure_streams passes consumer usage flags to the HAL. - * - * - flush call to drop all in-flight requests/buffers as fast as possible. - */ - -/** - * S2. Startup and general expected operation sequence: - * - * 1. Framework calls camera_module_t->common.open(), which returns a - * hardware_device_t structure. - * - * 2. Framework inspects the hardware_device_t->version field, and instantiates - * the appropriate handler for that version of the camera hardware device. In - * case the version is CAMERA_DEVICE_API_VERSION_3_0, the device is cast to - * a camera3_device_t. - * - * 3. Framework calls camera3_device_t->ops->initialize() with the framework - * callback function pointers. This will only be called this one time after - * open(), before any other functions in the ops structure are called. - * - * 4. The framework calls camera3_device_t->ops->configure_streams() with a list - * of input/output streams to the HAL device. - * - * 5. The framework allocates gralloc buffers and calls - * camera3_device_t->ops->register_stream_buffers() for at least one of the - * output streams listed in configure_streams. The same stream is registered - * only once. - * - * 5. The framework requests default settings for some number of use cases with - * calls to camera3_device_t->ops->construct_default_request_settings(). This - * may occur any time after step 3. - * - * 7. The framework constructs and sends the first capture request to the HAL, - * with settings based on one of the sets of default settings, and with at - * least one output stream, which has been registered earlier by the - * framework. This is sent to the HAL with - * camera3_device_t->ops->process_capture_request(). The HAL must block the - * return of this call until it is ready for the next request to be sent. - * - * 8. The framework continues to submit requests, and possibly call - * register_stream_buffers() for not-yet-registered streams, and call - * construct_default_request_settings to get default settings buffers for - * other use cases. - * - * 9. When the capture of a request begins (sensor starts exposing for the - * capture), the HAL calls camera3_callback_ops_t->notify() with the SHUTTER - * event, including the frame number and the timestamp for start of exposure. - * This notify call must be made before the first call to - * process_capture_result() for that frame number. - * - * 10. After some pipeline delay, the HAL begins to return completed captures to - * the framework with camera3_callback_ops_t->process_capture_result(). These - * are returned in the same order as the requests were submitted. Multiple - * requests can be in flight at once, depending on the pipeline depth of the - * camera HAL device. - * - * 11. After some time, the framework may stop submitting new requests, wait for - * the existing captures to complete (all buffers filled, all results - * returned), and then call configure_streams() again. This resets the camera - * hardware and pipeline for a new set of input/output streams. Some streams - * may be reused from the previous configuration; if these streams' buffers - * had already been registered with the HAL, they will not be registered - * again. The framework then continues from step 7, if at least one - * registered output stream remains (otherwise, step 5 is required first). - * - * 12. Alternatively, the framework may call camera3_device_t->common->close() - * to end the camera session. This may be called at any time when no other - * calls from the framework are active, although the call may block until all - * in-flight captures have completed (all results returned, all buffers - * filled). After the close call returns, no more calls to the - * camera3_callback_ops_t functions are allowed from the HAL. Once the - * close() call is underway, the framework may not call any other HAL device - * functions. - * - * 13. In case of an error or other asynchronous event, the HAL must call - * camera3_callback_ops_t->notify() with the appropriate error/event - * message. After returning from a fatal device-wide error notification, the - * HAL should act as if close() had been called on it. However, the HAL must - * either cancel or complete all outstanding captures before calling - * notify(), so that once notify() is called with a fatal error, the - * framework will not receive further callbacks from the device. Methods - * besides close() should return -ENODEV or NULL after the notify() method - * returns from a fatal error message. - */ - -/** - * S3. Operational modes: - * - * The camera 3 HAL device can implement one of two possible operational modes; - * limited and full. Full support is expected from new higher-end - * devices. Limited mode has hardware requirements roughly in line with those - * for a camera HAL device v1 implementation, and is expected from older or - * inexpensive devices. Full is a strict superset of limited, and they share the - * same essential operational flow, as documented above. - * - * The HAL must indicate its level of support with the - * android.info.supportedHardwareLevel static metadata entry, with 0 indicating - * limited mode, and 1 indicating full mode support. - * - * Roughly speaking, limited-mode devices do not allow for application control - * of capture settings (3A control only), high-rate capture of high-resolution - * images, raw sensor readout, or support for YUV output streams above maximum - * recording resolution (JPEG only for large images). - * - * ** Details of limited mode behavior: - * - * - Limited-mode devices do not need to implement accurate synchronization - * between capture request settings and the actual image data - * captured. Instead, changes to settings may take effect some time in the - * future, and possibly not for the same output frame for each settings - * entry. Rapid changes in settings may result in some settings never being - * used for a capture. However, captures that include high-resolution output - * buffers ( > 1080p ) have to use the settings as specified (but see below - * for processing rate). - * - * - Limited-mode devices do not need to support most of the - * settings/result/static info metadata. Full-mode devices must support all - * metadata fields listed in TODO. Specifically, only the following settings - * are expected to be consumed or produced by a limited-mode HAL device: - * - * android.control.aeAntibandingMode (controls) - * android.control.aeExposureCompensation (controls) - * android.control.aeLock (controls) - * android.control.aeMode (controls) - * [OFF means ON_FLASH_TORCH - TODO] - * android.control.aeRegions (controls) - * android.control.aeTargetFpsRange (controls) - * android.control.afMode (controls) - * [OFF means infinity focus] - * android.control.afRegions (controls) - * android.control.awbLock (controls) - * android.control.awbMode (controls) - * [OFF not supported] - * android.control.awbRegions (controls) - * android.control.captureIntent (controls) - * android.control.effectMode (controls) - * android.control.mode (controls) - * [OFF not supported] - * android.control.sceneMode (controls) - * android.control.videoStabilizationMode (controls) - * android.control.aeAvailableAntibandingModes (static) - * android.control.aeAvailableModes (static) - * android.control.aeAvailableTargetFpsRanges (static) - * android.control.aeCompensationRange (static) - * android.control.aeCompensationStep (static) - * android.control.afAvailableModes (static) - * android.control.availableEffects (static) - * android.control.availableSceneModes (static) - * android.control.availableVideoStabilizationModes (static) - * android.control.awbAvailableModes (static) - * android.control.maxRegions (static) - * android.control.sceneModeOverrides (static) - * android.control.aeRegions (dynamic) - * android.control.aeState (dynamic) - * android.control.afMode (dynamic) - * android.control.afRegions (dynamic) - * android.control.afState (dynamic) - * android.control.awbMode (dynamic) - * android.control.awbRegions (dynamic) - * android.control.awbState (dynamic) - * android.control.mode (dynamic) - * - * android.flash.info.available (static) - * - * android.info.supportedHardwareLevel (static) - * - * android.jpeg.gpsCoordinates (controls) - * android.jpeg.gpsProcessingMethod (controls) - * android.jpeg.gpsTimestamp (controls) - * android.jpeg.orientation (controls) - * android.jpeg.quality (controls) - * android.jpeg.thumbnailQuality (controls) - * android.jpeg.thumbnailSize (controls) - * android.jpeg.availableThumbnailSizes (static) - * android.jpeg.maxSize (static) - * android.jpeg.gpsCoordinates (dynamic) - * android.jpeg.gpsProcessingMethod (dynamic) - * android.jpeg.gpsTimestamp (dynamic) - * android.jpeg.orientation (dynamic) - * android.jpeg.quality (dynamic) - * android.jpeg.size (dynamic) - * android.jpeg.thumbnailQuality (dynamic) - * android.jpeg.thumbnailSize (dynamic) - * - * android.lens.info.minimumFocusDistance (static) - * - * android.request.id (controls) - * android.request.id (dynamic) - * - * android.scaler.cropRegion (controls) - * [ignores (x,y), assumes center-zoom] - * android.scaler.availableFormats (static) - * [RAW not supported] - * android.scaler.availableJpegMinDurations (static) - * android.scaler.availableJpegSizes (static) - * android.scaler.availableMaxDigitalZoom (static) - * android.scaler.availableProcessedMinDurations (static) - * android.scaler.availableProcessedSizes (static) - * [full resolution not supported] - * android.scaler.maxDigitalZoom (static) - * android.scaler.cropRegion (dynamic) - * - * android.sensor.orientation (static) - * android.sensor.timestamp (dynamic) - * - * android.statistics.faceDetectMode (controls) - * android.statistics.info.availableFaceDetectModes (static) - * android.statistics.faceDetectMode (dynamic) - * android.statistics.faceIds (dynamic) - * android.statistics.faceLandmarks (dynamic) - * android.statistics.faceRectangles (dynamic) - * android.statistics.faceScores (dynamic) - * - * - Captures in limited mode that include high-resolution (> 1080p) output - * buffers may block in process_capture_request() until all the output buffers - * have been filled. A full-mode HAL device must process sequences of - * high-resolution requests at the rate indicated in the static metadata for - * that pixel format. The HAL must still call process_capture_result() to - * provide the output; the framework must simply be prepared for - * process_capture_request() to block until after process_capture_result() for - * that request completes for high-resolution captures for limited-mode - * devices. - * - */ - -/** - * S4. 3A modes and state machines: - * - * While the actual 3A algorithms are up to the HAL implementation, a high-level - * state machine description is defined by the HAL interface, to allow the HAL - * device and the framework to communicate about the current state of 3A, and to - * trigger 3A events. - * - * When the device is opened, all the individual 3A states must be - * STATE_INACTIVE. Stream configuration does not reset 3A. For example, locked - * focus must be maintained across the configure() call. - * - * Triggering a 3A action involves simply setting the relevant trigger entry in - * the settings for the next request to indicate start of trigger. For example, - * the trigger for starting an autofocus scan is setting the entry - * ANDROID_CONTROL_AF_TRIGGER to ANDROID_CONTROL_AF_TRIGGER_START for one - * request, and cancelling an autofocus scan is triggered by setting - * ANDROID_CONTROL_AF_TRIGGER to ANDROID_CONTRL_AF_TRIGGER_CANCEL. Otherwise, - * the entry will not exist, or be set to ANDROID_CONTROL_AF_TRIGGER_IDLE. Each - * request with a trigger entry set to a non-IDLE value will be treated as an - * independent triggering event. - * - * At the top level, 3A is controlled by the ANDROID_CONTROL_MODE setting, which - * selects between no 3A (ANDROID_CONTROL_MODE_OFF), normal AUTO mode - * (ANDROID_CONTROL_MODE_AUTO), and using the scene mode setting - * (ANDROID_CONTROL_USE_SCENE_MODE). - * - * - In OFF mode, each of the individual AE/AF/AWB modes are effectively OFF, - * and none of the capture controls may be overridden by the 3A routines. - * - * - In AUTO mode, Auto-focus, auto-exposure, and auto-whitebalance all run - * their own independent algorithms, and have their own mode, state, and - * trigger metadata entries, as listed in the next section. - * - * - In USE_SCENE_MODE, the value of the ANDROID_CONTROL_SCENE_MODE entry must - * be used to determine the behavior of 3A routines. In SCENE_MODEs other than - * FACE_PRIORITY, the HAL must override the values of - * ANDROId_CONTROL_AE/AWB/AF_MODE to be the mode it prefers for the selected - * SCENE_MODE. For example, the HAL may prefer SCENE_MODE_NIGHT to use - * CONTINUOUS_FOCUS AF mode. Any user selection of AE/AWB/AF_MODE when scene - * must be ignored for these scene modes. - * - * - For SCENE_MODE_FACE_PRIORITY, the AE/AWB/AF_MODE controls work as in - * ANDROID_CONTROL_MODE_AUTO, but the 3A routines must bias toward metering - * and focusing on any detected faces in the scene. - * - * S4.1. Auto-focus settings and result entries: - * - * Main metadata entries: - * - * ANDROID_CONTROL_AF_MODE: Control for selecting the current autofocus - * mode. Set by the framework in the request settings. - * - * AF_MODE_OFF: AF is disabled; the framework/app directly controls lens - * position. - * - * AF_MODE_AUTO: Single-sweep autofocus. No lens movement unless AF is - * triggered. - * - * AF_MODE_MACRO: Single-sweep up-close autofocus. No lens movement unless - * AF is triggered. - * - * AF_MODE_CONTINUOUS_VIDEO: Smooth continuous focusing, for recording - * video. Triggering immediately locks focus in current - * position. Canceling resumes cotinuous focusing. - * - * AF_MODE_CONTINUOUS_PICTURE: Fast continuous focusing, for - * zero-shutter-lag still capture. Triggering locks focus once currently - * active sweep concludes. Canceling resumes continuous focusing. - * - * AF_MODE_EDOF: Advanced extended depth of field focusing. There is no - * autofocus scan, so triggering one or canceling one has no effect. - * Images are focused automatically by the HAL. - * - * ANDROID_CONTROL_AF_STATE: Dynamic metadata describing the current AF - * algorithm state, reported by the HAL in the result metadata. - * - * AF_STATE_INACTIVE: No focusing has been done, or algorithm was - * reset. Lens is not moving. Always the state for MODE_OFF or MODE_EDOF. - * When the device is opened, it must start in this state. - * - * AF_STATE_PASSIVE_SCAN: A continuous focus algorithm is currently scanning - * for good focus. The lens is moving. - * - * AF_STATE_PASSIVE_FOCUSED: A continuous focus algorithm believes it is - * well focused. The lens is not moving. The HAL may spontaneously leave - * this state. - * - * AF_STATE_PASSIVE_UNFOCUSED: A continuous focus algorithm believes it is - * not well focused. The lens is not moving. The HAL may spontaneously - * leave this state. - * - * AF_STATE_ACTIVE_SCAN: A scan triggered by the user is underway. - * - * AF_STATE_FOCUSED_LOCKED: The AF algorithm believes it is focused. The - * lens is not moving. - * - * AF_STATE_NOT_FOCUSED_LOCKED: The AF algorithm has been unable to - * focus. The lens is not moving. - * - * ANDROID_CONTROL_AF_TRIGGER: Control for starting an autofocus scan, the - * meaning of which is mode- and state- dependent. Set by the framework in - * the request settings. - * - * AF_TRIGGER_IDLE: No current trigger. - * - * AF_TRIGGER_START: Trigger start of AF scan. Effect is mode and state - * dependent. - * - * AF_TRIGGER_CANCEL: Cancel current AF scan if any, and reset algorithm to - * default. - * - * Additional metadata entries: - * - * ANDROID_CONTROL_AF_REGIONS: Control for selecting the regions of the FOV - * that should be used to determine good focus. This applies to all AF - * modes that scan for focus. Set by the framework in the request - * settings. - * - * S4.2. Auto-exposure settings and result entries: - * - * Main metadata entries: - * - * ANDROID_CONTROL_AE_MODE: Control for selecting the current auto-exposure - * mode. Set by the framework in the request settings. - * - * AE_MODE_OFF: Autoexposure is disabled; the user controls exposure, gain, - * frame duration, and flash. - * - * AE_MODE_ON: Standard autoexposure, with flash control disabled. User may - * set flash to fire or to torch mode. - * - * AE_MODE_ON_AUTO_FLASH: Standard autoexposure, with flash on at HAL's - * discretion for precapture and still capture. User control of flash - * disabled. - * - * AE_MODE_ON_ALWAYS_FLASH: Standard autoexposure, with flash always fired - * for capture, and at HAL's discretion for precapture.. User control of - * flash disabled. - * - * AE_MODE_ON_AUTO_FLASH_REDEYE: Standard autoexposure, with flash on at - * HAL's discretion for precapture and still capture. Use a flash burst - * at end of precapture sequence to reduce redeye in the final - * picture. User control of flash disabled. - * - * ANDROID_CONTROL_AE_STATE: Dynamic metadata describing the current AE - * algorithm state, reported by the HAL in the result metadata. - * - * AE_STATE_INACTIVE: Initial AE state after mode switch. When the device is - * opened, it must start in this state. - * - * AE_STATE_SEARCHING: AE is not converged to a good value, and is adjusting - * exposure parameters. - * - * AE_STATE_CONVERGED: AE has found good exposure values for the current - * scene, and the exposure parameters are not changing. HAL may - * spontaneously leave this state to search for better solution. - * - * AE_STATE_LOCKED: AE has been locked with the AE_LOCK control. Exposure - * values are not changing. - * - * AE_STATE_FLASH_REQUIRED: The HAL has converged exposure, but believes - * flash is required for a sufficiently bright picture. Used for - * determining if a zero-shutter-lag frame can be used. - * - * AE_STATE_PRECAPTURE: The HAL is in the middle of a precapture - * sequence. Depending on AE mode, this mode may involve firing the - * flash for metering, or a burst of flash pulses for redeye reduction. - * - * ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER: Control for starting a metering - * sequence before capturing a high-quality image. Set by the framework in - * the request settings. - * - * PRECAPTURE_TRIGGER_IDLE: No current trigger. - * - * PRECAPTURE_TRIGGER_START: Start a precapture sequence. The HAL should - * use the subsequent requests to measure good exposure/white balance - * for an upcoming high-resolution capture. - * - * Additional metadata entries: - * - * ANDROID_CONTROL_AE_LOCK: Control for locking AE controls to their current - * values - * - * ANDROID_CONTROL_AE_EXPOSURE_COMPENSATION: Control for adjusting AE - * algorithm target brightness point. - * - * ANDROID_CONTROL_AE_TARGET_FPS_RANGE: Control for selecting the target frame - * rate range for the AE algorithm. The AE routine cannot change the frame - * rate to be outside these bounds. - * - * ANDROID_CONTROL_AE_REGIONS: Control for selecting the regions of the FOV - * that should be used to determine good exposure levels. This applies to - * all AE modes besides OFF. - * - * S4.3. Auto-whitebalance settings and result entries: - * - * Main metadata entries: - * - * ANDROID_CONTROL_AWB_MODE: Control for selecting the current white-balance - * mode. - * - * AWB_MODE_OFF: Auto-whitebalance is disabled. User controls color matrix. - * - * AWB_MODE_AUTO: Automatic white balance is enabled; 3A controls color - * transform, possibly using more complex transforms than a simple - * matrix. - * - * AWB_MODE_INCANDESCENT: Fixed white balance settings good for indoor - * incandescent (tungsten) lighting, roughly 2700K. - * - * AWB_MODE_FLUORESCENT: Fixed white balance settings good for fluorescent - * lighting, roughly 5000K. - * - * AWB_MODE_WARM_FLUORESCENT: Fixed white balance settings good for - * fluorescent lighting, roughly 3000K. - * - * AWB_MODE_DAYLIGHT: Fixed white balance settings good for daylight, - * roughly 5500K. - * - * AWB_MODE_CLOUDY_DAYLIGHT: Fixed white balance settings good for clouded - * daylight, roughly 6500K. - * - * AWB_MODE_TWILIGHT: Fixed white balance settings good for - * near-sunset/sunrise, roughly 15000K. - * - * AWB_MODE_SHADE: Fixed white balance settings good for areas indirectly - * lit by the sun, roughly 7500K. - * - * ANDROID_CONTROL_AWB_STATE: Dynamic metadata describing the current AWB - * algorithm state, reported by the HAL in the result metadata. - * - * AWB_STATE_INACTIVE: Initial AWB state after mode switch. When the device - * is opened, it must start in this state. - * - * AWB_STATE_SEARCHING: AWB is not converged to a good value, and is - * changing color adjustment parameters. - * - * AWB_STATE_CONVERGED: AWB has found good color adjustment values for the - * current scene, and the parameters are not changing. HAL may - * spontaneously leave this state to search for better solution. - * - * AWB_STATE_LOCKED: AWB has been locked with the AWB_LOCK control. Color - * adjustment values are not changing. - * - * Additional metadata entries: - * - * ANDROID_CONTROL_AWB_LOCK: Control for locking AWB color adjustments to - * their current values. - * - * ANDROID_CONTROL_AWB_REGIONS: Control for selecting the regions of the FOV - * that should be used to determine good color balance. This applies only - * to auto-WB mode. - * - * S4.4. General state machine transition notes - * - * Switching between AF, AE, or AWB modes always resets the algorithm's state - * to INACTIVE. Similarly, switching between CONTROL_MODE or - * CONTROL_SCENE_MODE if CONTROL_MODE == USE_SCENE_MODE resets all the - * algorithm states to INACTIVE. - * - * The tables below are per-mode. - * - * S4.5. AF state machines - * - * when enabling AF or changing AF mode - *| state | trans. cause | new state | notes | - *+--------------------+---------------+--------------------+------------------+ - *| Any | AF mode change| INACTIVE | | - *+--------------------+---------------+--------------------+------------------+ - * - * mode = AF_MODE_OFF or AF_MODE_EDOF - *| state | trans. cause | new state | notes | - *+--------------------+---------------+--------------------+------------------+ - *| INACTIVE | | INACTIVE | Never changes | - *+--------------------+---------------+--------------------+------------------+ - * - * mode = AF_MODE_AUTO or AF_MODE_MACRO - *| state | trans. cause | new state | notes | - *+--------------------+---------------+--------------------+------------------+ - *| INACTIVE | AF_TRIGGER | ACTIVE_SCAN | Start AF sweep | - *| | | | Lens now moving | - *+--------------------+---------------+--------------------+------------------+ - *| ACTIVE_SCAN | AF sweep done | FOCUSED_LOCKED | If AF successful | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| ACTIVE_SCAN | AF sweep done | NOT_FOCUSED_LOCKED | If AF successful | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| ACTIVE_SCAN | AF_CANCEL | INACTIVE | Cancel/reset AF | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| FOCUSED_LOCKED | AF_CANCEL | INACTIVE | Cancel/reset AF | - *+--------------------+---------------+--------------------+------------------+ - *| FOCUSED_LOCKED | AF_TRIGGER | ACTIVE_SCAN | Start new sweep | - *| | | | Lens now moving | - *+--------------------+---------------+--------------------+------------------+ - *| NOT_FOCUSED_LOCKED | AF_CANCEL | INACTIVE | Cancel/reset AF | - *+--------------------+---------------+--------------------+------------------+ - *| NOT_FOCUSED_LOCKED | AF_TRIGGER | ACTIVE_SCAN | Start new sweep | - *| | | | Lens now moving | - *+--------------------+---------------+--------------------+------------------+ - *| All states | mode change | INACTIVE | | - *+--------------------+---------------+--------------------+------------------+ - * - * mode = AF_MODE_CONTINUOUS_VIDEO - *| state | trans. cause | new state | notes | - *+--------------------+---------------+--------------------+------------------+ - *| INACTIVE | HAL initiates | PASSIVE_SCAN | Start AF scan | - *| | new scan | | Lens now moving | - *+--------------------+---------------+--------------------+------------------+ - *| INACTIVE | AF_TRIGGER | NOT_FOCUSED_LOCKED | AF state query | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_SCAN | HAL completes | PASSIVE_FOCUSED | End AF scan | - *| | current scan | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_SCAN | HAL fails | PASSIVE_UNFOCUSED | End AF scan | - *| | current scan | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_SCAN | AF_TRIGGER | FOCUSED_LOCKED | Immediate trans. | - *| | | | if focus is good | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_SCAN | AF_TRIGGER | NOT_FOCUSED_LOCKED | Immediate trans. | - *| | | | if focus is bad | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_SCAN | AF_CANCEL | INACTIVE | Reset lens | - *| | | | position | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_FOCUSED | HAL initiates | PASSIVE_SCAN | Start AF scan | - *| | new scan | | Lens now moving | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_UNFOCUSED | HAL initiates | PASSIVE_SCAN | Start AF scan | - *| | new scan | | Lens now moving | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_FOCUSED | AF_TRIGGER | FOCUSED_LOCKED | Immediate trans. | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_UNFOCUSED | AF_TRIGGER | NOT_FOCUSED_LOCKED | Immediate trans. | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| FOCUSED_LOCKED | AF_TRIGGER | FOCUSED_LOCKED | No effect | - *+--------------------+---------------+--------------------+------------------+ - *| FOCUSED_LOCKED | AF_CANCEL | INACTIVE | Restart AF scan | - *+--------------------+---------------+--------------------+------------------+ - *| NOT_FOCUSED_LOCKED | AF_TRIGGER | NOT_FOCUSED_LOCKED | No effect | - *+--------------------+---------------+--------------------+------------------+ - *| NOT_FOCUSED_LOCKED | AF_CANCEL | INACTIVE | Restart AF scan | - *+--------------------+---------------+--------------------+------------------+ - * - * mode = AF_MODE_CONTINUOUS_PICTURE - *| state | trans. cause | new state | notes | - *+--------------------+---------------+--------------------+------------------+ - *| INACTIVE | HAL initiates | PASSIVE_SCAN | Start AF scan | - *| | new scan | | Lens now moving | - *+--------------------+---------------+--------------------+------------------+ - *| INACTIVE | AF_TRIGGER | NOT_FOCUSED_LOCKED | AF state query | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_SCAN | HAL completes | PASSIVE_FOCUSED | End AF scan | - *| | current scan | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_SCAN | HAL fails | PASSIVE_UNFOCUSED | End AF scan | - *| | current scan | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_SCAN | AF_TRIGGER | FOCUSED_LOCKED | Eventual trans. | - *| | | | once focus good | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_SCAN | AF_TRIGGER | NOT_FOCUSED_LOCKED | Eventual trans. | - *| | | | if cannot focus | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_SCAN | AF_CANCEL | INACTIVE | Reset lens | - *| | | | position | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_FOCUSED | HAL initiates | PASSIVE_SCAN | Start AF scan | - *| | new scan | | Lens now moving | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_UNFOCUSED | HAL initiates | PASSIVE_SCAN | Start AF scan | - *| | new scan | | Lens now moving | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_FOCUSED | AF_TRIGGER | FOCUSED_LOCKED | Immediate trans. | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| PASSIVE_UNFOCUSED | AF_TRIGGER | NOT_FOCUSED_LOCKED | Immediate trans. | - *| | | | Lens now locked | - *+--------------------+---------------+--------------------+------------------+ - *| FOCUSED_LOCKED | AF_TRIGGER | FOCUSED_LOCKED | No effect | - *+--------------------+---------------+--------------------+------------------+ - *| FOCUSED_LOCKED | AF_CANCEL | INACTIVE | Restart AF scan | - *+--------------------+---------------+--------------------+------------------+ - *| NOT_FOCUSED_LOCKED | AF_TRIGGER | NOT_FOCUSED_LOCKED | No effect | - *+--------------------+---------------+--------------------+------------------+ - *| NOT_FOCUSED_LOCKED | AF_CANCEL | INACTIVE | Restart AF scan | - *+--------------------+---------------+--------------------+------------------+ - * - * S4.6. AE and AWB state machines - * - * The AE and AWB state machines are mostly identical. AE has additional - * FLASH_REQUIRED and PRECAPTURE states. So rows below that refer to those two - * states should be ignored for the AWB state machine. - * - * when enabling AE/AWB or changing AE/AWB mode - *| state | trans. cause | new state | notes | - *+--------------------+---------------+--------------------+------------------+ - *| Any | mode change | INACTIVE | | - *+--------------------+---------------+--------------------+------------------+ - * - * mode = AE_MODE_OFF / AWB mode not AUTO - *| state | trans. cause | new state | notes | - *+--------------------+---------------+--------------------+------------------+ - *| INACTIVE | | INACTIVE | AE/AWB disabled | - *+--------------------+---------------+--------------------+------------------+ - * - * mode = AE_MODE_ON_* / AWB_MODE_AUTO - *| state | trans. cause | new state | notes | - *+--------------------+---------------+--------------------+------------------+ - *| INACTIVE | HAL initiates | SEARCHING | | - *| | AE/AWB scan | | | - *+--------------------+---------------+--------------------+------------------+ - *| INACTIVE | AE/AWB_LOCK | LOCKED | values locked | - *| | on | | | - *+--------------------+---------------+--------------------+------------------+ - *| SEARCHING | HAL finishes | CONVERGED | good values, not | - *| | AE/AWB scan | | changing | - *+--------------------+---------------+--------------------+------------------+ - *| SEARCHING | HAL finishes | FLASH_REQUIRED | converged but too| - *| | AE scan | | dark w/o flash | - *+--------------------+---------------+--------------------+------------------+ - *| SEARCHING | AE/AWB_LOCK | LOCKED | values locked | - *| | on | | | - *+--------------------+---------------+--------------------+------------------+ - *| CONVERGED | HAL initiates | SEARCHING | values locked | - *| | AE/AWB scan | | | - *+--------------------+---------------+--------------------+------------------+ - *| CONVERGED | AE/AWB_LOCK | LOCKED | values locked | - *| | on | | | - *+--------------------+---------------+--------------------+------------------+ - *| FLASH_REQUIRED | HAL initiates | SEARCHING | values locked | - *| | AE/AWB scan | | | - *+--------------------+---------------+--------------------+------------------+ - *| FLASH_REQUIRED | AE/AWB_LOCK | LOCKED | values locked | - *| | on | | | - *+--------------------+---------------+--------------------+------------------+ - *| LOCKED | AE/AWB_LOCK | SEARCHING | values not good | - *| | off | | after unlock | - *+--------------------+---------------+--------------------+------------------+ - *| LOCKED | AE/AWB_LOCK | CONVERGED | values good | - *| | off | | after unlock | - *+--------------------+---------------+--------------------+------------------+ - *| LOCKED | AE_LOCK | FLASH_REQUIRED | exposure good, | - *| | off | | but too dark | - *+--------------------+---------------+--------------------+------------------+ - *| All AE states | PRECAPTURE_ | PRECAPTURE | Start precapture | - *| | START | | sequence | - *+--------------------+---------------+--------------------+------------------+ - *| PRECAPTURE | Sequence done.| CONVERGED | Ready for high- | - *| | AE_LOCK off | | quality capture | - *+--------------------+---------------+--------------------+------------------+ - *| PRECAPTURE | Sequence done.| LOCKED | Ready for high- | - *| | AE_LOCK on | | quality capture | - *+--------------------+---------------+--------------------+------------------+ - * - */ - -/** - * S5. Cropping: - * - * Cropping of the full pixel array (for digital zoom and other use cases where - * a smaller FOV is desirable) is communicated through the - * ANDROID_SCALER_CROP_REGION setting. This is a per-request setting, and can - * change on a per-request basis, which is critical for implementing smooth - * digital zoom. - * - * The region is defined as a rectangle (x, y, width, height), with (x, y) - * describing the top-left corner of the rectangle. The rectangle is defined on - * the coordinate system of the sensor active pixel array, with (0,0) being the - * top-left pixel of the active pixel array. Therefore, the width and height - * cannot be larger than the dimensions reported in the - * ANDROID_SENSOR_ACTIVE_PIXEL_ARRAY static info field. The minimum allowed - * width and height are reported by the HAL through the - * ANDROID_SCALER_MAX_DIGITAL_ZOOM static info field, which describes the - * maximum supported zoom factor. Therefore, the minimum crop region width and - * height are: - * - * {width, height} = - * { floor(ANDROID_SENSOR_ACTIVE_PIXEL_ARRAY[0] / - * ANDROID_SCALER_MAX_DIGITAL_ZOOM), - * floor(ANDROID_SENSOR_ACTIVE_PIXEL_ARRAY[1] / - * ANDROID_SCALER_MAX_DIGITAL_ZOOM) } - * - * If the crop region needs to fulfill specific requirements (for example, it - * needs to start on even coordinates, and its width/height needs to be even), - * the HAL must do the necessary rounding and write out the final crop region - * used in the output result metadata. Similarly, if the HAL implements video - * stabilization, it must adjust the result crop region to describe the region - * actually included in the output after video stabilization is applied. In - * general, a camera-using application must be able to determine the field of - * view it is receiving based on the crop region, the dimensions of the image - * sensor, and the lens focal length. - * - * Since the crop region applies to all streams, which may have different aspect - * ratios than the crop region, the exact sensor region used for each stream may - * be smaller than the crop region. Specifically, each stream should maintain - * square pixels and its aspect ratio by minimally further cropping the defined - * crop region. If the stream's aspect ratio is wider than the crop region, the - * stream should be further cropped vertically, and if the stream's aspect ratio - * is narrower than the crop region, the stream should be further cropped - * horizontally. - * - * In all cases, the stream crop must be centered within the full crop region, - * and each stream is only either cropped horizontally or vertical relative to - * the full crop region, never both. - * - * For example, if two streams are defined, a 640x480 stream (4:3 aspect), and a - * 1280x720 stream (16:9 aspect), below demonstrates the expected output regions - * for each stream for a few sample crop regions, on a hypothetical 3 MP (2000 x - * 1500 pixel array) sensor. - * - * Crop region: (500, 375, 1000, 750) (4:3 aspect ratio) - * - * 640x480 stream crop: (500, 375, 1000, 750) (equal to crop region) - * 1280x720 stream crop: (500, 469, 1000, 562) (marked with =) - * - * 0 1000 2000 - * +---------+---------+---------+----------+ - * | Active pixel array | - * | | - * | | - * + +-------------------+ + 375 - * | | | | - * | O===================O | - * | I 1280x720 stream I | - * + I I + 750 - * | I I | - * | O===================O | - * | | | | - * + +-------------------+ + 1125 - * | Crop region, 640x480 stream | - * | | - * | | - * +---------+---------+---------+----------+ 1500 - * - * Crop region: (500, 375, 1333, 750) (16:9 aspect ratio) - * - * 640x480 stream crop: (666, 375, 1000, 750) (marked with =) - * 1280x720 stream crop: (500, 375, 1333, 750) (equal to crop region) - * - * 0 1000 2000 - * +---------+---------+---------+----------+ - * | Active pixel array | - * | | - * | | - * + +---O==================O---+ + 375 - * | | I 640x480 stream I | | - * | | I I | | - * | | I I | | - * + | I I | + 750 - * | | I I | | - * | | I I | | - * | | I I | | - * + +---O==================O---+ + 1125 - * | Crop region, 1280x720 stream | - * | | - * | | - * +---------+---------+---------+----------+ 1500 - * - * Crop region: (500, 375, 750, 750) (1:1 aspect ratio) - * - * 640x480 stream crop: (500, 469, 750, 562) (marked with =) - * 1280x720 stream crop: (500, 543, 750, 414) (marged with #) - * - * 0 1000 2000 - * +---------+---------+---------+----------+ - * | Active pixel array | - * | | - * | | - * + +--------------+ + 375 - * | O==============O | - * | ################ | - * | # # | - * + # # + 750 - * | # # | - * | ################ 1280x720 | - * | O==============O 640x480 | - * + +--------------+ + 1125 - * | Crop region | - * | | - * | | - * +---------+---------+---------+----------+ 1500 - * - * And a final example, a 1024x1024 square aspect ratio stream instead of the - * 480p stream: - * - * Crop region: (500, 375, 1000, 750) (4:3 aspect ratio) - * - * 1024x1024 stream crop: (625, 375, 750, 750) (marked with #) - * 1280x720 stream crop: (500, 469, 1000, 562) (marked with =) - * - * 0 1000 2000 - * +---------+---------+---------+----------+ - * | Active pixel array | - * | | - * | 1024x1024 stream | - * + +--###############--+ + 375 - * | | # # | | - * | O===================O | - * | I 1280x720 stream I | - * + I I + 750 - * | I I | - * | O===================O | - * | | # # | | - * + +--###############--+ + 1125 - * | Crop region | - * | | - * | | - * +---------+---------+---------+----------+ 1500 - * - */ - -/** - * S6. Error management: - * - * Camera HAL device ops functions that have a return value will all return - * -ENODEV / NULL in case of a serious error. This means the device cannot - * continue operation, and must be closed by the framework. Once this error is - * returned by some method, or if notify() is called with ERROR_DEVICE, only - * the close() method can be called successfully. All other methods will return - * -ENODEV / NULL. - * - * If a device op is called in the wrong sequence, for example if the framework - * calls configure_streams() is called before initialize(), the device must - * return -ENOSYS from the call, and do nothing. - * - * Transient errors in image capture must be reported through notify() as follows: - * - * - The failure of an entire capture to occur must be reported by the HAL by - * calling notify() with ERROR_REQUEST. Individual errors for the result - * metadata or the output buffers must not be reported in this case. - * - * - If the metadata for a capture cannot be produced, but some image buffers - * were filled, the HAL must call notify() with ERROR_RESULT. - * - * - If an output image buffer could not be filled, but either the metadata was - * produced or some other buffers were filled, the HAL must call notify() with - * ERROR_BUFFER for each failed buffer. - * - * In each of these transient failure cases, the HAL must still call - * process_capture_result, with valid output buffer_handle_t. If the result - * metadata could not be produced, it should be NULL. If some buffers could not - * be filled, their sync fences must be set to the error state. - * - * Invalid input arguments result in -EINVAL from the appropriate methods. In - * that case, the framework must act as if that call had never been made. - * - */ - -__BEGIN_DECLS - -struct camera3_device; - -/********************************************************************** - * - * Camera3 stream and stream buffer definitions. - * - * These structs and enums define the handles and contents of the input and - * output streams connecting the HAL to various framework and application buffer - * consumers. Each stream is backed by a gralloc buffer queue. - * - */ - -/** - * camera3_stream_type_t: - * - * The type of the camera stream, which defines whether the camera HAL device is - * the producer or the consumer for that stream, and how the buffers of the - * stream relate to the other streams. - */ -typedef enum camera3_stream_type { - /** - * This stream is an output stream; the camera HAL device will be - * responsible for filling buffers from this stream with newly captured or - * reprocessed image data. - */ - CAMERA3_STREAM_OUTPUT = 0, - - /** - * This stream is an input stream; the camera HAL device will be responsible - * for reading buffers from this stream and sending them through the camera - * processing pipeline, as if the buffer was a newly captured image from the - * imager. - */ - CAMERA3_STREAM_INPUT = 1, - - /** - * This stream can be used for input and output. Typically, the stream is - * used as an output stream, but occasionally one already-filled buffer may - * be sent back to the HAL device for reprocessing. - * - * This kind of stream is meant generally for zero-shutter-lag features, - * where copying the captured image from the output buffer to the - * reprocessing input buffer would be expensive. The stream will be used by - * the framework as follows: - * - * 1. The framework includes a buffer from this stream as output buffer in a - * request as normal. - * - * 2. Once the HAL device returns a filled output buffer to the framework, - * the framework may do one of two things with the filled buffer: - * - * 2. a. The framework uses the filled data, and returns the now-used buffer - * to the stream queue for reuse. This behavior exactly matches the - * OUTPUT type of stream. - * - * 2. b. The framework wants to reprocess the filled data, and uses the - * buffer as an input buffer for a request. Once the HAL device has - * used the reprocessing buffer, it then returns it to the - * framework. The framework then returns the now-used buffer to the - * stream queue for reuse. - * - * 3. The HAL device will be given the buffer again as an output buffer for - * a request at some future point. - * - * Note that the HAL will always be reprocessing data it produced. - * - */ - CAMERA3_STREAM_BIDIRECTIONAL = 2, - - /** - * Total number of framework-defined stream types - */ - CAMERA3_NUM_STREAM_TYPES - -} camera3_stream_type_t; - -/** - * camera3_stream_t: - * - * A handle to a single camera input or output stream. A stream is defined by - * the framework by its buffer resolution and format, and additionally by the - * HAL with the gralloc usage flags and the maximum in-flight buffer count. - * - * The stream structures are owned by the framework, but pointers to a - * camera3_stream passed into the HAL by configure_streams() are valid until the - * end of the first subsequent configure_streams() call that _does not_ include - * that camera3_stream as an argument, or until the end of the close() call. - * - * All camera3_stream framework-controlled members are immutable once the - * camera3_stream is passed into configure_streams(). The HAL may only change - * the HAL-controlled parameters during a configure_streams() call, except for - * the contents of the private pointer. - * - * If a configure_streams() call returns a non-fatal error, all active streams - * remain valid as if configure_streams() had not been called. - * - * The endpoint of the stream is not visible to the camera HAL device. - * In DEVICE_API_VERSION_3_1, this was changed to share consumer usage flags - * on streams where the camera is a producer (OUTPUT and BIDIRECTIONAL stream - * types) see the usage field below. - */ -typedef struct camera3_stream { - - /***** - * Set by framework before configure_streams() - */ - - /** - * The type of the stream, one of the camera3_stream_type_t values. - */ - int stream_type; - - /** - * The width in pixels of the buffers in this stream - */ - uint32_t width; - - /** - * The height in pixels of the buffers in this stream - */ - uint32_t height; - - /** - * The pixel format for the buffers in this stream. Format is a value from - * the HAL_PIXEL_FORMAT_* list in system/core/include/system/graphics.h, or - * from device-specific headers. - * - * If HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED is used, then the platform - * gralloc module will select a format based on the usage flags provided by - * the camera device and the other endpoint of the stream. - * - * The camera HAL device must inspect the buffers handed to it in the - * subsequent register_stream_buffers() call to obtain the - * implementation-specific format details, if necessary. - */ - int format; - - /***** - * Set by HAL during configure_streams(). - */ - - /** - * The gralloc usage flags for this stream, as needed by the HAL. The usage - * flags are defined in gralloc.h (GRALLOC_USAGE_*), or in device-specific - * headers. - * - * For output streams, these are the HAL's producer usage flags. For input - * streams, these are the HAL's consumer usage flags. The usage flags from - * the producer and the consumer will be combined together and then passed - * to the platform gralloc HAL module for allocating the gralloc buffers for - * each stream. - * - * Version information: - * - * == CAMERA_DEVICE_API_VERSION_3_0: - * - * No initial value guaranteed when passed via configure_streams(). - * HAL may not use this field as input, and must write over this field - * with its usage flags. - * - * >= CAMERA_DEVICE_API_VERSION_3_1: - * - * For stream_type OUTPUT and BIDIRECTIONAL, when passed via - * configure_streams(), the initial value of this is the consumer's - * usage flags. The HAL may use these consumer flags to decide stream - * configuration. - * For stream_type INPUT, when passed via configure_streams(), the initial - * value of this is 0. - * For all streams passed via configure_streams(), the HAL must write - * over this field with its usage flags. - */ - uint32_t usage; - - /** - * The maximum number of buffers the HAL device may need to have dequeued at - * the same time. The HAL device may not have more buffers in-flight from - * this stream than this value. - */ - uint32_t max_buffers; - - /** - * A handle to HAL-private information for the stream. Will not be inspected - * by the framework code. - */ - void *priv; - -} camera3_stream_t; - -/** - * camera3_stream_configuration_t: - * - * A structure of stream definitions, used by configure_streams(). This - * structure defines all the output streams and the reprocessing input - * stream for the current camera use case. - */ -typedef struct camera3_stream_configuration { - /** - * The total number of streams requested by the framework. This includes - * both input and output streams. The number of streams will be at least 1, - * and there will be at least one output-capable stream. - */ - uint32_t num_streams; - - /** - * An array of camera stream pointers, defining the input/output - * configuration for the camera HAL device. - * - * At most one input-capable stream may be defined (INPUT or BIDIRECTIONAL) - * in a single configuration. - * - * At least one output-capable stream must be defined (OUTPUT or - * BIDIRECTIONAL). - */ - camera3_stream_t **streams; - -} camera3_stream_configuration_t; - -/** - * camera3_buffer_status_t: - * - * The current status of a single stream buffer. - */ -typedef enum camera3_buffer_status { - /** - * The buffer is in a normal state, and can be used after waiting on its - * sync fence. - */ - CAMERA3_BUFFER_STATUS_OK = 0, - - /** - * The buffer does not contain valid data, and the data in it should not be - * used. The sync fence must still be waited on before reusing the buffer. - */ - CAMERA3_BUFFER_STATUS_ERROR = 1 - -} camera3_buffer_status_t; - -/** - * camera3_stream_buffer_t: - * - * A single buffer from a camera3 stream. It includes a handle to its parent - * stream, the handle to the gralloc buffer itself, and sync fences - * - * The buffer does not specify whether it is to be used for input or output; - * that is determined by its parent stream type and how the buffer is passed to - * the HAL device. - */ -typedef struct camera3_stream_buffer { - /** - * The handle of the stream this buffer is associated with - */ - camera3_stream_t *stream; - - /** - * The native handle to the buffer - */ - buffer_handle_t *buffer; - - /** - * Current state of the buffer, one of the camera3_buffer_status_t - * values. The framework will not pass buffers to the HAL that are in an - * error state. In case a buffer could not be filled by the HAL, it must - * have its status set to CAMERA3_BUFFER_STATUS_ERROR when returned to the - * framework with process_capture_result(). - */ - int status; - - /** - * The acquire sync fence for this buffer. The HAL must wait on this fence - * fd before attempting to read from or write to this buffer. - * - * The framework may be set to -1 to indicate that no waiting is necessary - * for this buffer. - * - * When the HAL returns an output buffer to the framework with - * process_capture_result(), the acquire_fence must be set to -1. If the HAL - * never waits on the acquire_fence due to an error in filling a buffer, - * when calling process_capture_result() the HAL must set the release_fence - * of the buffer to be the acquire_fence passed to it by the framework. This - * will allow the framework to wait on the fence before reusing the buffer. - * - * For input buffers, the HAL must not change the acquire_fence field during - * the process_capture_request() call. - */ - int acquire_fence; - - /** - * The release sync fence for this buffer. The HAL must set this fence when - * returning buffers to the framework, or write -1 to indicate that no - * waiting is required for this buffer. - * - * For the input buffer, the release fence must be set by the - * process_capture_request() call. For the output buffers, the fences must - * be set in the output_buffers array passed to process_capture_result(). - * - */ - int release_fence; - -} camera3_stream_buffer_t; - -/** - * camera3_stream_buffer_set_t: - * - * The complete set of gralloc buffers for a stream. This structure is given to - * register_stream_buffers() to allow the camera HAL device to register/map/etc - * newly allocated stream buffers. - */ -typedef struct camera3_stream_buffer_set { - /** - * The stream handle for the stream these buffers belong to - */ - camera3_stream_t *stream; - - /** - * The number of buffers in this stream. It is guaranteed to be at least - * stream->max_buffers. - */ - uint32_t num_buffers; - - /** - * The array of gralloc buffer handles for this stream. If the stream format - * is set to HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED, the camera HAL device - * should inspect the passed-in buffers to determine any platform-private - * pixel format information. - */ - buffer_handle_t **buffers; - -} camera3_stream_buffer_set_t; - -/** - * camera3_jpeg_blob: - * - * Transport header for compressed JPEG buffers in output streams. - * - * To capture JPEG images, a stream is created using the pixel format - * HAL_PIXEL_FORMAT_BLOB, and the static metadata field android.jpeg.maxSize is - * used as the buffer size. Since compressed JPEG images are of variable size, - * the HAL needs to include the final size of the compressed image using this - * structure inside the output stream buffer. The JPEG blob ID field must be set - * to CAMERA3_JPEG_BLOB_ID. - * - * Transport header should be at the end of the JPEG output stream buffer. That - * means the jpeg_blob_id must start at byte[android.jpeg.maxSize - - * sizeof(camera3_jpeg_blob)]. Any HAL using this transport header must - * account for it in android.jpeg.maxSize. The JPEG data itself starts at - * the beginning of the buffer and should be jpeg_size bytes long. - */ -typedef struct camera3_jpeg_blob { - uint16_t jpeg_blob_id; - uint32_t jpeg_size; -} camera3_jpeg_blob_t; - -enum { - CAMERA3_JPEG_BLOB_ID = 0x00FF -}; - -/********************************************************************** - * - * Message definitions for the HAL notify() callback. - * - * These definitions are used for the HAL notify callback, to signal - * asynchronous events from the HAL device to the Android framework. - * - */ - -/** - * camera3_msg_type: - * - * Indicates the type of message sent, which specifies which member of the - * message union is valid. - * - */ -typedef enum camera3_msg_type { - /** - * An error has occurred. camera3_notify_msg.message.error contains the - * error information. - */ - CAMERA3_MSG_ERROR = 1, - - /** - * The exposure of a given request has - * begun. camera3_notify_msg.message.shutter contains the information - * the capture. - */ - CAMERA3_MSG_SHUTTER = 2, - - /** - * Number of framework message types - */ - CAMERA3_NUM_MESSAGES - -} camera3_msg_type_t; - -/** - * Defined error codes for CAMERA_MSG_ERROR - */ -typedef enum camera3_error_msg_code { - /** - * A serious failure occured. No further frames or buffer streams will - * be produced by the device. Device should be treated as closed. The - * client must reopen the device to use it again. The frame_number field - * is unused. - */ - CAMERA3_MSG_ERROR_DEVICE = 1, - - /** - * An error has occurred in processing a request. No output (metadata or - * buffers) will be produced for this request. The frame_number field - * specifies which request has been dropped. Subsequent requests are - * unaffected, and the device remains operational. - */ - CAMERA3_MSG_ERROR_REQUEST = 2, - - /** - * An error has occurred in producing an output result metadata buffer - * for a request, but output stream buffers for it will still be - * available. Subsequent requests are unaffected, and the device remains - * operational. The frame_number field specifies the request for which - * result metadata won't be available. - */ - CAMERA3_MSG_ERROR_RESULT = 3, - - /** - * An error has occurred in placing an output buffer into a stream for a - * request. The frame metadata and other buffers may still be - * available. Subsequent requests are unaffected, and the device remains - * operational. The frame_number field specifies the request for which the - * buffer was dropped, and error_stream contains a pointer to the stream - * that dropped the frame.u - */ - CAMERA3_MSG_ERROR_BUFFER = 4, - - /** - * Number of error types - */ - CAMERA3_MSG_NUM_ERRORS - -} camera3_error_msg_code_t; - -/** - * camera3_error_msg_t: - * - * Message contents for CAMERA3_MSG_ERROR - */ -typedef struct camera3_error_msg { - /** - * Frame number of the request the error applies to. 0 if the frame number - * isn't applicable to the error. - */ - uint32_t frame_number; - - /** - * Pointer to the stream that had a failure. NULL if the stream isn't - * applicable to the error. - */ - camera3_stream_t *error_stream; - - /** - * The code for this error; one of the CAMERA_MSG_ERROR enum values. - */ - int error_code; - -} camera3_error_msg_t; - -/** - * camera3_shutter_msg_t: - * - * Message contents for CAMERA3_MSG_SHUTTER - */ -typedef struct camera3_shutter_msg { - /** - * Frame number of the request that has begun exposure - */ - uint32_t frame_number; - - /** - * Timestamp for the start of capture. This must match the capture result - * metadata's sensor exposure start timestamp. - */ - uint64_t timestamp; - -} camera3_shutter_msg_t; - -/** - * camera3_notify_msg_t: - * - * The message structure sent to camera3_callback_ops_t.notify() - */ -typedef struct camera3_notify_msg { - - /** - * The message type. One of camera3_notify_msg_type, or a private extension. - */ - int type; - - union { - /** - * Error message contents. Valid if type is CAMERA3_MSG_ERROR - */ - camera3_error_msg_t error; - - /** - * Shutter message contents. Valid if type is CAMERA3_MSG_SHUTTER - */ - camera3_shutter_msg_t shutter; - - /** - * Generic message contents. Used to ensure a minimum size for custom - * message types. - */ - uint8_t generic[32]; - } message; - -} camera3_notify_msg_t; - -/********************************************************************** - * - * Capture request/result definitions for the HAL process_capture_request() - * method, and the process_capture_result() callback. - * - */ - -/** - * camera3_request_template_t: - * - * Available template types for - * camera3_device_ops.construct_default_request_settings() - */ -typedef enum camera3_request_template { - /** - * Standard camera preview operation with 3A on auto. - */ - CAMERA3_TEMPLATE_PREVIEW = 1, - - /** - * Standard camera high-quality still capture with 3A and flash on auto. - */ - CAMERA3_TEMPLATE_STILL_CAPTURE = 2, - - /** - * Standard video recording plus preview with 3A on auto, torch off. - */ - CAMERA3_TEMPLATE_VIDEO_RECORD = 3, - - /** - * High-quality still capture while recording video. Application will - * include preview, video record, and full-resolution YUV or JPEG streams in - * request. Must not cause stuttering on video stream. 3A on auto. - */ - CAMERA3_TEMPLATE_VIDEO_SNAPSHOT = 4, - - /** - * Zero-shutter-lag mode. Application will request preview and - * full-resolution data for each frame, and reprocess it to JPEG when a - * still image is requested by user. Settings should provide highest-quality - * full-resolution images without compromising preview frame rate. 3A on - * auto. - */ - CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG = 5, - - /* Total number of templates */ - CAMERA3_TEMPLATE_COUNT, - - /** - * First value for vendor-defined request templates - */ - CAMERA3_VENDOR_TEMPLATE_START = 0x40000000 - -} camera3_request_template_t; - -/** - * camera3_capture_request_t: - * - * A single request for image capture/buffer reprocessing, sent to the Camera - * HAL device by the framework in process_capture_request(). - * - * The request contains the settings to be used for this capture, and the set of - * output buffers to write the resulting image data in. It may optionally - * contain an input buffer, in which case the request is for reprocessing that - * input buffer instead of capturing a new image with the camera sensor. The - * capture is identified by the frame_number. - * - * In response, the camera HAL device must send a camera3_capture_result - * structure asynchronously to the framework, using the process_capture_result() - * callback. - */ -typedef struct camera3_capture_request { - /** - * The frame number is an incrementing integer set by the framework to - * uniquely identify this capture. It needs to be returned in the result - * call, and is also used to identify the request in asynchronous - * notifications sent to camera3_callback_ops_t.notify(). - */ - uint32_t frame_number; - - /** - * The settings buffer contains the capture and processing parameters for - * the request. As a special case, a NULL settings buffer indicates that the - * settings are identical to the most-recently submitted capture request. A - * NULL buffer cannot be used as the first submitted request after a - * configure_streams() call. - */ - const camera_metadata_t *settings; - - /** - * The input stream buffer to use for this request, if any. - * - * If input_buffer is NULL, then the request is for a new capture from the - * imager. If input_buffer is valid, the request is for reprocessing the - * image contained in input_buffer. - * - * In the latter case, the HAL must set the release_fence of the - * input_buffer to a valid sync fence, or to -1 if the HAL does not support - * sync, before process_capture_request() returns. - * - * The HAL is required to wait on the acquire sync fence of the input buffer - * before accessing it. - * - * Any input buffer included here will have been registered with the HAL - * through register_stream_buffers() before its inclusion in a request. - */ - camera3_stream_buffer_t *input_buffer; - - /** - * The number of output buffers for this capture request. Must be at least - * 1. - */ - uint32_t num_output_buffers; - - /** - * An array of num_output_buffers stream buffers, to be filled with image - * data from this capture/reprocess. The HAL must wait on the acquire fences - * of each stream buffer before writing to them. All the buffers included - * here will have been registered with the HAL through - * register_stream_buffers() before their inclusion in a request. - * - * The HAL takes ownership of the actual buffer_handle_t entries in - * output_buffers; the framework does not access them until they are - * returned in a camera3_capture_result_t. - */ - const camera3_stream_buffer_t *output_buffers; - -} camera3_capture_request_t; - -/** - * camera3_capture_result_t: - * - * The result of a single capture/reprocess by the camera HAL device. This is - * sent to the framework asynchronously with process_capture_result(), in - * response to a single capture request sent to the HAL with - * process_capture_request(). Multiple process_capture_result() calls may be - * performed by the HAL for each request. Each call, all with the same frame - * number, may contain some subset of the output buffers, and/or the result - * metadata. The metadata may only be provided once for a given frame number; - * all other calls must set the result metadata to NULL. - * - * The result structure contains the output metadata from this capture, and the - * set of output buffers that have been/will be filled for this capture. Each - * output buffer may come with a release sync fence that the framework will wait - * on before reading, in case the buffer has not yet been filled by the HAL. - * - */ -typedef struct camera3_capture_result { - /** - * The frame number is an incrementing integer set by the framework in the - * submitted request to uniquely identify this capture. It is also used to - * identify the request in asynchronous notifications sent to - * camera3_callback_ops_t.notify(). - */ - uint32_t frame_number; - - /** - * The result metadata for this capture. This contains information about the - * final capture parameters, the state of the capture and post-processing - * hardware, the state of the 3A algorithms, if enabled, and the output of - * any enabled statistics units. - * - * Only one call to process_capture_result() with a given frame_number may - * include the result metadata. All other calls for the same frame_number - * must set this to NULL. - * - * If there was an error producing the result metadata, result must be an - * empty metadata buffer, and notify() must be called with ERROR_RESULT. - */ - const camera_metadata_t *result; - - /** - * The number of output buffers returned in this result structure. Must be - * less than or equal to the matching capture request's count. If this is - * less than the buffer count in the capture request, at least one more call - * to process_capture_result with the same frame_number must be made, to - * return the remaining output buffers to the framework. This may only be - * zero if the structure includes valid result metadata. - */ - uint32_t num_output_buffers; - - /** - * The handles for the output stream buffers for this capture. They may not - * yet be filled at the time the HAL calls process_capture_result(); the - * framework will wait on the release sync fences provided by the HAL before - * reading the buffers. - * - * The HAL must set the stream buffer's release sync fence to a valid sync - * fd, or to -1 if the buffer has already been filled. - * - * If the HAL encounters an error while processing the buffer, and the - * buffer is not filled, the buffer's status field must be set to - * CAMERA3_BUFFER_STATUS_ERROR. If the HAL did not wait on the acquire fence - * before encountering the error, the acquire fence should be copied into - * the release fence, to allow the framework to wait on the fence before - * reusing the buffer. - * - * The acquire fence must be set to -1 for all output buffers. If - * num_output_buffers is zero, this may be NULL. In that case, at least one - * more process_capture_result call must be made by the HAL to provide the - * output buffers. - */ - const camera3_stream_buffer_t *output_buffers; - -} camera3_capture_result_t; - -/********************************************************************** - * - * Callback methods for the HAL to call into the framework. - * - * These methods are used to return metadata and image buffers for a completed - * or failed captures, and to notify the framework of asynchronous events such - * as errors. - * - * The framework will not call back into the HAL from within these callbacks, - * and these calls will not block for extended periods. - * - */ -typedef struct camera3_callback_ops { - - /** - * process_capture_result: - * - * Send results from a completed capture to the framework. - * process_capture_result() may be invoked multiple times by the HAL in - * response to a single capture request. This allows, for example, the - * metadata and low-resolution buffers to be returned in one call, and - * post-processed JPEG buffers in a later call, once it is available. Each - * call must include the frame number of the request it is returning - * metadata or buffers for. - * - * A component (buffer or metadata) of the complete result may only be - * included in one process_capture_result call. A buffer for each stream, - * and the result metadata, must be returned by the HAL for each request in - * one of the process_capture_result calls, even in case of errors producing - * some of the output. A call to process_capture_result() with neither - * output buffers or result metadata is not allowed. - * - * The order of returning metadata and buffers for a single result does not - * matter, but buffers for a given stream must be returned in FIFO order. So - * the buffer for request 5 for stream A must always be returned before the - * buffer for request 6 for stream A. This also applies to the result - * metadata; the metadata for request 5 must be returned before the metadata - * for request 6. - * - * However, different streams are independent of each other, so it is - * acceptable and expected that the buffer for request 5 for stream A may be - * returned after the buffer for request 6 for stream B is. And it is - * acceptable that the result metadata for request 6 for stream B is - * returned before the buffer for request 5 for stream A is. - * - * The HAL retains ownership of result structure, which only needs to be - * valid to access during this call. The framework will copy whatever it - * needs before this call returns. - * - * The output buffers do not need to be filled yet; the framework will wait - * on the stream buffer release sync fence before reading the buffer - * data. Therefore, this method should be called by the HAL as soon as - * possible, even if some or all of the output buffers are still in - * being filled. The HAL must include valid release sync fences into each - * output_buffers stream buffer entry, or -1 if that stream buffer is - * already filled. - * - * If the result buffer cannot be constructed for a request, the HAL should - * return an empty metadata buffer, but still provide the output buffers and - * their sync fences. In addition, notify() must be called with an - * ERROR_RESULT message. - * - * If an output buffer cannot be filled, its status field must be set to - * STATUS_ERROR. In addition, notify() must be called with a ERROR_BUFFER - * message. - * - * If the entire capture has failed, then this method still needs to be - * called to return the output buffers to the framework. All the buffer - * statuses should be STATUS_ERROR, and the result metadata should be an - * empty buffer. In addition, notify() must be called with a ERROR_REQUEST - * message. In this case, individual ERROR_RESULT/ERROR_BUFFER messages - * should not be sent. - * - */ - void (*process_capture_result)(const struct camera3_callback_ops *, - const camera3_capture_result_t *result); - - /** - * notify: - * - * Asynchronous notification callback from the HAL, fired for various - * reasons. Only for information independent of frame capture, or that - * require specific timing. The ownership of the message structure remains - * with the HAL, and the msg only needs to be valid for the duration of this - * call. - * - * The notification for the start of exposure for a given request must be - * sent by the HAL before the first call to process_capture_result() for - * that request is made. - * - * Multiple threads may call notify() simultaneously. - */ - void (*notify)(const struct camera3_callback_ops *, - const camera3_notify_msg_t *msg); - -} camera3_callback_ops_t; - -/********************************************************************** - * - * Camera device operations - * - */ -typedef struct camera3_device_ops { - - /** - * initialize: - * - * One-time initialization to pass framework callback function pointers to - * the HAL. Will be called once after a successful open() call, before any - * other functions are called on the camera3_device_ops structure. - * - * Return values: - * - * 0: On successful initialization - * - * -ENODEV: If initialization fails. Only close() can be called successfully - * by the framework after this. - */ - int (*initialize)(const struct camera3_device *, - const camera3_callback_ops_t *callback_ops); - - /********************************************************************** - * Stream management - */ - - /** - * configure_streams: - * - * Reset the HAL camera device processing pipeline and set up new input and - * output streams. This call replaces any existing stream configuration with - * the streams defined in the stream_list. This method will be called at - * least once after initialize() before a request is submitted with - * process_capture_request(). - * - * The stream_list must contain at least one output-capable stream, and may - * not contain more than one input-capable stream. - * - * The stream_list may contain streams that are also in the currently-active - * set of streams (from the previous call to configure_stream()). These - * streams will already have valid values for usage, max_buffers, and the - * private pointer. If such a stream has already had its buffers registered, - * register_stream_buffers() will not be called again for the stream, and - * buffers from the stream can be immediately included in input requests. - * - * If the HAL needs to change the stream configuration for an existing - * stream due to the new configuration, it may rewrite the values of usage - * and/or max_buffers during the configure call. The framework will detect - * such a change, and will then reallocate the stream buffers, and call - * register_stream_buffers() again before using buffers from that stream in - * a request. - * - * If a currently-active stream is not included in stream_list, the HAL may - * safely remove any references to that stream. It will not be reused in a - * later configure() call by the framework, and all the gralloc buffers for - * it will be freed after the configure_streams() call returns. - * - * The stream_list structure is owned by the framework, and may not be - * accessed once this call completes. The address of an individual - * camera3_stream_t structure will remain valid for access by the HAL until - * the end of the first configure_stream() call which no longer includes - * that camera3_stream_t in the stream_list argument. The HAL may not change - * values in the stream structure outside of the private pointer, except for - * the usage and max_buffers members during the configure_streams() call - * itself. - * - * If the stream is new, the usage, max_buffer, and private pointer fields - * of the stream structure will all be set to 0. The HAL device must set - * these fields before the configure_streams() call returns. These fields - * are then used by the framework and the platform gralloc module to - * allocate the gralloc buffers for each stream. - * - * Before such a new stream can have its buffers included in a capture - * request, the framework will call register_stream_buffers() with that - * stream. However, the framework is not required to register buffers for - * _all_ streams before submitting a request. This allows for quick startup - * of (for example) a preview stream, with allocation for other streams - * happening later or concurrently. - * - * Preconditions: - * - * The framework will only call this method when no captures are being - * processed. That is, all results have been returned to the framework, and - * all in-flight input and output buffers have been returned and their - * release sync fences have been signaled by the HAL. The framework will not - * submit new requests for capture while the configure_streams() call is - * underway. - * - * Postconditions: - * - * The HAL device must configure itself to provide maximum possible output - * frame rate given the sizes and formats of the output streams, as - * documented in the camera device's static metadata. - * - * Performance expectations: - * - * This call is expected to be heavyweight and possibly take several hundred - * milliseconds to complete, since it may require resetting and - * reconfiguring the image sensor and the camera processing pipeline. - * Nevertheless, the HAL device should attempt to minimize the - * reconfiguration delay to minimize the user-visible pauses during - * application operational mode changes (such as switching from still - * capture to video recording). - * - * Return values: - * - * 0: On successful stream configuration - * - * -EINVAL: If the requested stream configuration is invalid. Some examples - * of invalid stream configurations include: - * - * - Including more than 1 input-capable stream (INPUT or - * BIDIRECTIONAL) - * - * - Not including any output-capable streams (OUTPUT or - * BIDIRECTIONAL) - * - * - Including streams with unsupported formats, or an unsupported - * size for that format. - * - * - Including too many output streams of a certain format. - * - * Note that the framework submitting an invalid stream - * configuration is not normal operation, since stream - * configurations are checked before configure. An invalid - * configuration means that a bug exists in the framework code, or - * there is a mismatch between the HAL's static metadata and the - * requirements on streams. - * - * -ENODEV: If there has been a fatal error and the device is no longer - * operational. Only close() can be called successfully by the - * framework after this error is returned. - */ - int (*configure_streams)(const struct camera3_device *, - camera3_stream_configuration_t *stream_list); - - /** - * register_stream_buffers: - * - * Register buffers for a given stream with the HAL device. This method is - * called by the framework after a new stream is defined by - * configure_streams, and before buffers from that stream are included in a - * capture request. If the same stream is listed in a subsequent - * configure_streams() call, register_stream_buffers will _not_ be called - * again for that stream. - * - * The framework does not need to register buffers for all configured - * streams before it submits the first capture request. This allows quick - * startup for preview (or similar use cases) while other streams are still - * being allocated. - * - * This method is intended to allow the HAL device to map or otherwise - * prepare the buffers for later use. The buffers passed in will already be - * locked for use. At the end of the call, all the buffers must be ready to - * be returned to the stream. The buffer_set argument is only valid for the - * duration of this call. - * - * If the stream format was set to HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED, - * the camera HAL should inspect the passed-in buffers here to determine any - * platform-private pixel format information. - * - * Return values: - * - * 0: On successful registration of the new stream buffers - * - * -EINVAL: If the stream_buffer_set does not refer to a valid active - * stream, or if the buffers array is invalid. - * - * -ENOMEM: If there was a failure in registering the buffers. The framework - * must consider all the stream buffers to be unregistered, and can - * try to register again later. - * - * -ENODEV: If there is a fatal error, and the device is no longer - * operational. Only close() can be called successfully by the - * framework after this error is returned. - */ - int (*register_stream_buffers)(const struct camera3_device *, - const camera3_stream_buffer_set_t *buffer_set); - - /********************************************************************** - * Request creation and submission - */ - - /** - * construct_default_request_settings: - * - * Create capture settings for standard camera use cases. - * - * The device must return a settings buffer that is configured to meet the - * requested use case, which must be one of the CAMERA3_TEMPLATE_* - * enums. All request control fields must be included. - * - * The HAL retains ownership of this structure, but the pointer to the - * structure must be valid until the device is closed. The framework and the - * HAL may not modify the buffer once it is returned by this call. The same - * buffer may be returned for subsequent calls for the same template, or for - * other templates. - * - * Return values: - * - * Valid metadata: On successful creation of a default settings - * buffer. - * - * NULL: In case of a fatal error. After this is returned, only - * the close() method can be called successfully by the - * framework. - */ - const camera_metadata_t* (*construct_default_request_settings)( - const struct camera3_device *, - int type); - - /** - * process_capture_request: - * - * Send a new capture request to the HAL. The HAL should not return from - * this call until it is ready to accept the next request to process. Only - * one call to process_capture_request() will be made at a time by the - * framework, and the calls will all be from the same thread. The next call - * to process_capture_request() will be made as soon as a new request and - * its associated buffers are available. In a normal preview scenario, this - * means the function will be called again by the framework almost - * instantly. - * - * The actual request processing is asynchronous, with the results of - * capture being returned by the HAL through the process_capture_result() - * call. This call requires the result metadata to be available, but output - * buffers may simply provide sync fences to wait on. Multiple requests are - * expected to be in flight at once, to maintain full output frame rate. - * - * The framework retains ownership of the request structure. It is only - * guaranteed to be valid during this call. The HAL device must make copies - * of the information it needs to retain for the capture processing. The HAL - * is responsible for waiting on and closing the buffers' fences and - * returning the buffer handles to the framework. - * - * The HAL must write the file descriptor for the input buffer's release - * sync fence into input_buffer->release_fence, if input_buffer is not - * NULL. If the HAL returns -1 for the input buffer release sync fence, the - * framework is free to immediately reuse the input buffer. Otherwise, the - * framework will wait on the sync fence before refilling and reusing the - * input buffer. - * - * Return values: - * - * 0: On a successful start to processing the capture request - * - * -EINVAL: If the input is malformed (the settings are NULL when not - * allowed, there are 0 output buffers, etc) and capture processing - * cannot start. Failures during request processing should be - * handled by calling camera3_callback_ops_t.notify(). In case of - * this error, the framework will retain responsibility for the - * stream buffers' fences and the buffer handles; the HAL should - * not close the fences or return these buffers with - * process_capture_result. - * - * -ENODEV: If the camera device has encountered a serious error. After this - * error is returned, only the close() method can be successfully - * called by the framework. - * - */ - int (*process_capture_request)(const struct camera3_device *, - camera3_capture_request_t *request); - - /********************************************************************** - * Miscellaneous methods - */ - - /** - * get_metadata_vendor_tag_ops: - * - * Get methods to query for vendor extension metadata tag information. The - * HAL should fill in all the vendor tag operation methods, or leave ops - * unchanged if no vendor tags are defined. - * - * The definition of vendor_tag_query_ops_t can be found in - * system/media/camera/include/system/camera_metadata.h. - * - */ - void (*get_metadata_vendor_tag_ops)(const struct camera3_device*, - vendor_tag_query_ops_t* ops); - - /** - * dump: - * - * Print out debugging state for the camera device. This will be called by - * the framework when the camera service is asked for a debug dump, which - * happens when using the dumpsys tool, or when capturing a bugreport. - * - * The passed-in file descriptor can be used to write debugging text using - * dprintf() or write(). The text should be in ASCII encoding only. - */ - void (*dump)(const struct camera3_device *, int fd); - - /** - * flush: - * - * Flush all currently in-process captures and all buffers in the pipeline - * on the given device. The framework will use this to dump all state as - * quickly as possible in order to prepare for a configure_streams() call. - * - * No buffers are required to be successfully returned, so every buffer - * held at the time of flush() (whether sucessfully filled or not) may be - * returned with CAMERA3_BUFFER_STATUS_ERROR. Note the HAL is still allowed - * to return valid (STATUS_OK) buffers during this call, provided they are - * succesfully filled. - * - * All requests currently in the HAL are expected to be returned as soon as - * possible. Not-in-process requests should return errors immediately. Any - * interruptible hardware blocks should be stopped, and any uninterruptible - * blocks should be waited on. - * - * flush() should only return when there are no more outstanding buffers or - * requests left in the HAL. The framework may call configure_streams (as - * the HAL state is now quiesced) or may issue new requests. - * - * A flush() call should only take 100ms or less. The maximum time it can - * take is 1 second. - * - * Version information: - * - * only available if device version >= CAMERA_DEVICE_API_VERSION_3_1. - * - * Return values: - * - * 0: On a successful flush of the camera HAL. - * - * -EINVAL: If the input is malformed (the device is not valid). - * - * -ENODEV: If the camera device has encountered a serious error. After this - * error is returned, only the close() method can be successfully - * called by the framework. - */ - int (*flush)(const struct camera3_device *); - - /* reserved for future use */ - void *reserved[8]; -} camera3_device_ops_t; - -/********************************************************************** - * - * Camera device definition - * - */ -typedef struct camera3_device { - /** - * common.version must equal CAMERA_DEVICE_API_VERSION_3_0 to identify this - * device as implementing version 3.0 of the camera device HAL. - */ - hw_device_t common; - camera3_device_ops_t *ops; - void *priv; -} camera3_device_t; - -__END_DECLS - -#endif /* #ifdef ANDROID_INCLUDE_CAMERA3_H */ diff --git a/external/android/include/19/hardware/libhardware/include/hardware/camera_common.h b/external/android/include/19/hardware/libhardware/include/hardware/camera_common.h deleted file mode 100644 index 3a1233f..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/camera_common.h +++ /dev/null @@ -1,384 +0,0 @@ -/* - * Copyright (C) 2012 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. - */ - -// FIXME: add well-defined names for cameras - -#ifndef ANDROID_INCLUDE_CAMERA_COMMON_H -#define ANDROID_INCLUDE_CAMERA_COMMON_H - -#include -#include -#include -#include -#include -#include -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define CAMERA_HARDWARE_MODULE_ID "camera" - -/** - * Module versioning information for the Camera hardware module, based on - * camera_module_t.common.module_api_version. The two most significant hex - * digits represent the major version, and the two least significant represent - * the minor version. - * - ******************************************************************************* - * Versions: 0.X - 1.X [CAMERA_MODULE_API_VERSION_1_0] - * - * Camera modules that report these version numbers implement the initial - * camera module HAL interface. All camera devices openable through this - * module support only version 1 of the camera device HAL. The device_version - * and static_camera_characteristics fields of camera_info are not valid. Only - * the android.hardware.Camera API can be supported by this module and its - * devices. - * - ******************************************************************************* - * Version: 2.0 [CAMERA_MODULE_API_VERSION_2_0] - * - * Camera modules that report this version number implement the second version - * of the camera module HAL interface. Camera devices openable through this - * module may support either version 1.0 or version 2.0 of the camera device - * HAL interface. The device_version field of camera_info is always valid; the - * static_camera_characteristics field of camera_info is valid if the - * device_version field is 2.0 or higher. - * - ******************************************************************************* - * Version: 2.1 [CAMERA_MODULE_API_VERSION_2_1] - * - * This camera module version adds support for asynchronous callbacks to the - * framework from the camera HAL module, which is used to notify the framework - * about changes to the camera module state. Modules that provide a valid - * set_callbacks() method must report at least this version number. - * - ******************************************************************************* - * Version: 2.2 [CAMERA_MODULE_API_VERSION_2_2] - * - * This camera module version adds vendor tag support from the module, and - * deprecates the old vendor_tag_query_ops that were previously only - * accessible with a device open. - */ - -/** - * Predefined macros for currently-defined version numbers - */ - -/** - * All module versions <= HARDWARE_MODULE_API_VERSION(1, 0xFF) must be treated - * as CAMERA_MODULE_API_VERSION_1_0 - */ -#define CAMERA_MODULE_API_VERSION_1_0 HARDWARE_MODULE_API_VERSION(1, 0) -#define CAMERA_MODULE_API_VERSION_2_0 HARDWARE_MODULE_API_VERSION(2, 0) -#define CAMERA_MODULE_API_VERSION_2_1 HARDWARE_MODULE_API_VERSION(2, 1) -#define CAMERA_MODULE_API_VERSION_2_2 HARDWARE_MODULE_API_VERSION(2, 2) - -#define CAMERA_MODULE_API_VERSION_CURRENT CAMERA_MODULE_API_VERSION_2_2 - -/** - * All device versions <= HARDWARE_DEVICE_API_VERSION(1, 0xFF) must be treated - * as CAMERA_DEVICE_API_VERSION_1_0 - */ -#define CAMERA_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0) -#define CAMERA_DEVICE_API_VERSION_2_0 HARDWARE_DEVICE_API_VERSION(2, 0) -#define CAMERA_DEVICE_API_VERSION_2_1 HARDWARE_DEVICE_API_VERSION(2, 1) -#define CAMERA_DEVICE_API_VERSION_3_0 HARDWARE_DEVICE_API_VERSION(3, 0) -#define CAMERA_DEVICE_API_VERSION_3_1 HARDWARE_DEVICE_API_VERSION(3, 1) - -// Device version 2.x is outdated; device version 3.0 is experimental -#define CAMERA_DEVICE_API_VERSION_CURRENT CAMERA_DEVICE_API_VERSION_1_0 - -/** - * Defined in /system/media/camera/include/system/camera_metadata.h - */ -typedef struct camera_metadata camera_metadata_t; - -typedef struct camera_info { - /** - * The direction that the camera faces to. It should be CAMERA_FACING_BACK - * or CAMERA_FACING_FRONT. - * - * Version information: - * Valid in all camera_module versions - */ - int facing; - - /** - * The orientation of the camera image. The value is the angle that the - * camera image needs to be rotated clockwise so it shows correctly on the - * display in its natural orientation. It should be 0, 90, 180, or 270. - * - * For example, suppose a device has a naturally tall screen. The - * back-facing camera sensor is mounted in landscape. You are looking at the - * screen. If the top side of the camera sensor is aligned with the right - * edge of the screen in natural orientation, the value should be 90. If the - * top side of a front-facing camera sensor is aligned with the right of the - * screen, the value should be 270. - * - * Version information: - * Valid in all camera_module versions - */ - int orientation; - - /** - * The value of camera_device_t.common.version. - * - * Version information (based on camera_module_t.common.module_api_version): - * - * CAMERA_MODULE_API_VERSION_1_0: - * - * Not valid. Can be assumed to be CAMERA_DEVICE_API_VERSION_1_0. Do - * not read this field. - * - * CAMERA_MODULE_API_VERSION_2_0 or higher: - * - * Always valid - * - */ - uint32_t device_version; - - /** - * The camera's fixed characteristics, which include all camera metadata in - * the android.*.info.* sections. This should be a sorted metadata buffer, - * and may not be modified or freed by the caller. The pointer should remain - * valid for the lifetime of the camera module, and values in it may not - * change after it is returned by get_camera_info(). - * - * Version information (based on camera_module_t.common.module_api_version): - * - * CAMERA_MODULE_API_VERSION_1_0: - * - * Not valid. Extra characteristics are not available. Do not read this - * field. - * - * CAMERA_MODULE_API_VERSION_2_0 or higher: - * - * Valid if device_version >= CAMERA_DEVICE_API_VERSION_2_0. Do not read - * otherwise. - * - */ - const camera_metadata_t *static_camera_characteristics; -} camera_info_t; - -/** - * camera_device_status_t: - * - * The current status of the camera device, as provided by the HAL through the - * camera_module_callbacks.camera_device_status_change() call. - * - * At module load time, the framework will assume all camera devices are in the - * CAMERA_DEVICE_STATUS_PRESENT state. The HAL should invoke - * camera_module_callbacks::camera_device_status_change to inform the framework - * of any initially NOT_PRESENT devices. - * - * Allowed transitions: - * PRESENT -> NOT_PRESENT - * NOT_PRESENT -> ENUMERATING - * NOT_PRESENT -> PRESENT - * ENUMERATING -> PRESENT - * ENUMERATING -> NOT_PRESENT - */ -typedef enum camera_device_status { - /** - * The camera device is not currently connected, and opening it will return - * failure. Calls to get_camera_info must still succeed, and provide the - * same information it would if the camera were connected - */ - CAMERA_DEVICE_STATUS_NOT_PRESENT = 0, - - /** - * The camera device is connected, and opening it will succeed. The - * information returned by get_camera_info cannot change due to this status - * change. By default, the framework will assume all devices are in this - * state. - */ - CAMERA_DEVICE_STATUS_PRESENT = 1, - - /** - * The camera device is connected, but it is undergoing an enumeration and - * so opening the device will return -EBUSY. Calls to get_camera_info - * must still succeed, as if the camera was in the PRESENT status. - */ - CAMERA_DEVICE_STATUS_ENUMERATING = 2, - -} camera_device_status_t; - -/** - * Callback functions for the camera HAL module to use to inform the framework - * of changes to the camera subsystem. These are called only by HAL modules - * implementing version CAMERA_MODULE_API_VERSION_2_1 or higher of the HAL - * module API interface. - */ -typedef struct camera_module_callbacks { - - /** - * camera_device_status_change: - * - * Callback to the framework to indicate that the state of a specific camera - * device has changed. At module load time, the framework will assume all - * camera devices are in the CAMERA_DEVICE_STATUS_PRESENT state. The HAL - * must call this method to inform the framework of any initially - * NOT_PRESENT devices. - * - * camera_module_callbacks: The instance of camera_module_callbacks_t passed - * to the module with set_callbacks. - * - * camera_id: The ID of the camera device that has a new status. - * - * new_status: The new status code, one of the camera_device_status_t enums, - * or a platform-specific status. - * - */ - void (*camera_device_status_change)(const struct camera_module_callbacks*, - int camera_id, - int new_status); - -} camera_module_callbacks_t; - -/** - * Set up vendor-specific tag query methods. These are needed to properly query - * entries with vendor-specified tags, potentially returned by get_camera_info. - * - * This should be used in place of vendor_tag_query_ops, which are deprecated. - */ -typedef struct vendor_tag_ops vendor_tag_ops_t; -struct vendor_tag_ops { - /** - * Get the number of vendor tags supported on this platform. Used to - * calculate the size of buffer needed for holding the array of all tags - * returned by get_all_tags(). - */ - int (*get_tag_count)(const vendor_tag_ops_t *v); - - /** - * Fill an array with all the supported vendor tags on this platform. - * get_tag_count() returns the number of tags supported, and - * tag_array will be allocated with enough space to hold all of the tags. - */ - void (*get_all_tags)(const vendor_tag_ops_t *v, uint32_t *tag_array); - - /** - * Get vendor section name for a vendor-specified entry tag. Only called for - * vendor-defined tags. The section name must start with the name of the - * vendor in the Java package style. For example, CameraZoom Inc. must - * prefix their sections with "com.camerazoom." Must return NULL if the tag - * is outside the bounds of vendor-defined sections. - * - * There may be different vendor-defined tag sections, for example the - * phone maker, the chipset maker, and the camera module maker may each - * have their own "com.vendor."-prefixed section. - * - * The memory pointed to by the return value must remain valid for the - * lifetime that the module is loaded, and is owned by the module. - */ - const char *(*get_section_name)(const vendor_tag_ops_t *v, uint32_t tag); - - /** - * Get tag name for a vendor-specified entry tag. Only called for - * vendor-defined tags. Must return NULL if the it is not a vendor-defined - * tag. - * - * The memory pointed to by the return value must remain valid for the - * lifetime that the module is loaded, and is owned by the module. - */ - const char *(*get_tag_name)(const vendor_tag_ops_t *v, uint32_t tag); - - /** - * Get tag type for a vendor-specified entry tag. Only called for tags >= - * 0x80000000. Must return -1 if the tag is outside the bounds of - * vendor-defined sections. - */ - int (*get_tag_type)(const vendor_tag_ops_t *v, uint32_t tag); - - /* reserved for future use */ - void* reserved[8]; -}; - -typedef struct camera_module { - hw_module_t common; - - /** - * get_number_of_cameras: - * - * Returns the number of camera devices accessible through the camera - * module. The camera devices are numbered 0 through N-1, where N is the - * value returned by this call. The name of the camera device for open() is - * simply the number converted to a string. That is, "0" for camera ID 0, - * "1" for camera ID 1. - * - * The value here must be static, and cannot change after the first call to - * this method - */ - int (*get_number_of_cameras)(void); - - /** - * get_camera_info: - * - * Return the static camera information for a given camera device. This - * information may not change for a camera device. - * - */ - int (*get_camera_info)(int camera_id, struct camera_info *info); - - /** - * set_callbacks: - * - * Provide callback function pointers to the HAL module to inform framework - * of asynchronous camera module events. The framework will call this - * function once after initial camera HAL module load, after the - * get_number_of_cameras() method is called for the first time, and before - * any other calls to the module. - * - * Version information (based on camera_module_t.common.module_api_version): - * - * CAMERA_MODULE_API_VERSION_1_0, CAMERA_MODULE_API_VERSION_2_0: - * - * Not provided by HAL module. Framework may not call this function. - * - * CAMERA_MODULE_API_VERSION_2_1: - * - * Valid to be called by the framework. - * - */ - int (*set_callbacks)(const camera_module_callbacks_t *callbacks); - - /** - * get_vendor_tag_ops: - * - * Get methods to query for vendor extension metadata tag information. The - * HAL should fill in all the vendor tag operation methods, or leave ops - * unchanged if no vendor tags are defined. - * - * Version information (based on camera_module_t.common.module_api_version): - * - * CAMERA_MODULE_API_VERSION_1_x/2_0/2_1: - * Not provided by HAL module. Framework may not call this function. - * - * CAMERA_MODULE_API_VERSION_2_2: - * Valid to be called by the framework. - */ - void (*get_vendor_tag_ops)(vendor_tag_ops_t* ops); - - /* reserved for future use */ - void* reserved[8]; -} camera_module_t; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_CAMERA_COMMON_H */ diff --git a/external/android/include/19/hardware/libhardware/include/hardware/consumerir.h b/external/android/include/19/hardware/libhardware/include/hardware/consumerir.h deleted file mode 100644 index 5adf6be..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/consumerir.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2013 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_INCLUDE_HARDWARE_CONSUMERIR_H -#define ANDROID_INCLUDE_HARDWARE_CONSUMERIR_H - -#include -#include -#include -#include - -#define CONSUMERIR_MODULE_API_VERSION_1_0 HARDWARE_MODULE_API_VERSION(1, 0) -#define CONSUMERIR_HARDWARE_MODULE_ID "consumerir" -#define CONSUMERIR_TRANSMITTER "transmitter" - -typedef struct consumerir_freq_range { - int min; - int max; -} consumerir_freq_range_t; - -typedef struct consumerir_module { - struct hw_module_t common; -} consumerir_module_t; - -typedef struct consumerir_device { - struct hw_device_t common; - - /* - * (*transmit)() is called to by the ConsumerIrService to send an IR pattern - * at a given carrier_freq. - * - * The pattern is alternating series of carrier on and off periods measured in - * microseconds. The carrier should be turned off at the end of a transmit - * even if there are and odd number of entries in the pattern array. - * - * This call should return when the transmit is complete or encounters an error. - * - * returns: 0 on success. A negative error code on error. - */ - int (*transmit)(struct consumerir_device *dev, int carrier_freq, - const int pattern[], int pattern_len); - - /* - * (*get_num_carrier_freqs)() is called by the ConsumerIrService to get the - * number of carrier freqs to allocate space for, which is then filled by - * a subsequent call to (*get_carrier_freqs)(). - * - * returns: the number of ranges on success. A negative error code on error. - */ - int (*get_num_carrier_freqs)(struct consumerir_device *dev); - - /* - * (*get_carrier_freqs)() is called by the ConsumerIrService to enumerate - * which frequencies the IR transmitter supports. The HAL implementation - * should fill an array of consumerir_freq_range structs with the - * appropriate values for the transmitter, up to len elements. - * - * returns: the number of ranges on success. A negative error code on error. - */ - int (*get_carrier_freqs)(struct consumerir_device *dev, - size_t len, consumerir_freq_range_t *ranges); - - /* Reserved for future use. Must be NULL. */ - void* reserved[8 - 3]; -} consumerir_device_t; - -#endif /* ANDROID_INCLUDE_HARDWARE_CONSUMERIR_H */ diff --git a/external/android/include/19/hardware/libhardware/include/hardware/fb.h b/external/android/include/19/hardware/libhardware/include/hardware/fb.h deleted file mode 100644 index 135e4aa..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/fb.h +++ /dev/null @@ -1,167 +0,0 @@ -/* - * 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. - */ - - -#ifndef ANDROID_FB_INTERFACE_H -#define ANDROID_FB_INTERFACE_H - -#include -#include -#include - -#include - -#include - -__BEGIN_DECLS - -#define GRALLOC_HARDWARE_FB0 "fb0" - -/*****************************************************************************/ - - -/*****************************************************************************/ - -typedef struct framebuffer_device_t { - struct hw_device_t common; - - /* flags describing some attributes of the framebuffer */ - const uint32_t flags; - - /* dimensions of the framebuffer in pixels */ - const uint32_t width; - const uint32_t height; - - /* frambuffer stride in pixels */ - const int stride; - - /* framebuffer pixel format */ - const int format; - - /* resolution of the framebuffer's display panel in pixel per inch*/ - const float xdpi; - const float ydpi; - - /* framebuffer's display panel refresh rate in frames per second */ - const float fps; - - /* min swap interval supported by this framebuffer */ - const int minSwapInterval; - - /* max swap interval supported by this framebuffer */ - const int maxSwapInterval; - - /* Number of framebuffers supported*/ - const int numFramebuffers; - - int reserved[7]; - - /* - * requests a specific swap-interval (same definition than EGL) - * - * Returns 0 on success or -errno on error. - */ - int (*setSwapInterval)(struct framebuffer_device_t* window, - int interval); - - /* - * This hook is OPTIONAL. - * - * It is non NULL If the framebuffer driver supports "update-on-demand" - * and the given rectangle is the area of the screen that gets - * updated during (*post)(). - * - * This is useful on devices that are able to DMA only a portion of - * the screen to the display panel, upon demand -- as opposed to - * constantly refreshing the panel 60 times per second, for instance. - * - * Only the area defined by this rectangle is guaranteed to be valid, that - * is, the driver is not allowed to post anything outside of this - * rectangle. - * - * The rectangle evaluated during (*post)() and specifies which area - * of the buffer passed in (*post)() shall to be posted. - * - * return -EINVAL if width or height <=0, or if left or top < 0 - */ - int (*setUpdateRect)(struct framebuffer_device_t* window, - int left, int top, int width, int height); - - /* - * Post to the display (display it on the screen) - * The buffer must have been allocated with the - * GRALLOC_USAGE_HW_FB usage flag. - * buffer must be the same width and height as the display and must NOT - * be locked. - * - * The buffer is shown during the next VSYNC. - * - * If the same buffer is posted again (possibly after some other buffer), - * post() will block until the the first post is completed. - * - * Internally, post() is expected to lock the buffer so that a - * subsequent call to gralloc_module_t::(*lock)() with USAGE_RENDER or - * USAGE_*_WRITE will block until it is safe; that is typically once this - * buffer is shown and another buffer has been posted. - * - * Returns 0 on success or -errno on error. - */ - int (*post)(struct framebuffer_device_t* dev, buffer_handle_t buffer); - - - /* - * The (*compositionComplete)() method must be called after the - * compositor has finished issuing GL commands for client buffers. - */ - - int (*compositionComplete)(struct framebuffer_device_t* dev); - - /* - * This hook is OPTIONAL. - * - * If non NULL it will be caused by SurfaceFlinger on dumpsys - */ - void (*dump)(struct framebuffer_device_t* dev, char *buff, int buff_len); - - /* - * (*enableScreen)() is used to either blank (enable=0) or - * unblank (enable=1) the screen this framebuffer is attached to. - * - * Returns 0 on success or -errno on error. - */ - int (*enableScreen)(struct framebuffer_device_t* dev, int enable); - - void* reserved_proc[6]; - -} framebuffer_device_t; - - -/** convenience API for opening and closing a supported device */ - -static inline int framebuffer_open(const struct hw_module_t* module, - struct framebuffer_device_t** device) { - return module->methods->open(module, - GRALLOC_HARDWARE_FB0, (struct hw_device_t**)device); -} - -static inline int framebuffer_close(struct framebuffer_device_t* device) { - return device->common.close(&device->common); -} - - -__END_DECLS - -#endif // ANDROID_FB_INTERFACE_H diff --git a/external/android/include/19/hardware/libhardware/include/hardware/fused_location.h b/external/android/include/19/hardware/libhardware/include/hardware/fused_location.h deleted file mode 100644 index 5c7821c..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/fused_location.h +++ /dev/null @@ -1,734 +0,0 @@ -/* - * Copyright (C) 2013 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_INCLUDE_HARDWARE_FUSED_LOCATION_H -#define ANDROID_INCLUDE_HARDWARE_FUSED_LOCATION_H - -#include - - -/** - * This header file defines the interface of the Fused Location Provider. - * Fused Location Provider is designed to fuse data from various sources - * like GPS, Wifi, Cell, Sensors, Bluetooth etc to provide a fused location to the - * upper layers. The advantage of doing fusion in hardware is power savings. - * The goal is to do this without waking up the AP to get additional data. - * The software implementation of FLP will decide when to use - * the hardware fused location. Other location features like geofencing will - * also be implemented using fusion in hardware. - */ -__BEGIN_DECLS - -#define FLP_HEADER_VERSION 1 -#define FLP_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) -#define FLP_DEVICE_API_VERSION_0_1 HARDWARE_DEVICE_API_VERSION_2(0, 1, FLP_HEADER_VERSION) - -/** - * The id of this module - */ -#define FUSED_LOCATION_HARDWARE_MODULE_ID "flp" - -/** - * Name for the FLP location interface - */ -#define FLP_LOCATION_INTERFACE "flp_location" - -/** - * Name for the FLP location interface - */ -#define FLP_DIAGNOSTIC_INTERFACE "flp_diagnostic" - -/** - * Name for the FLP_Geofencing interface. - */ -#define FLP_GEOFENCING_INTERFACE "flp_geofencing" - -/** - * Name for the FLP_device context interface. - */ -#define FLP_DEVICE_CONTEXT_INTERFACE "flp_device_context" - -/** - * Constants to indicate the various subsystems - * that will be used. - */ -#define FLP_TECH_MASK_GNSS (1U<<0) -#define FLP_TECH_MASK_WIFI (1U<<1) -#define FLP_TECH_MASK_SENSORS (1U<<2) -#define FLP_TECH_MASK_CELL (1U<<3) -#define FLP_TECH_MASK_BLUETOOTH (1U<<4) - -/** - * This constant is used with the batched locations - * APIs. Batching is mandatory when FLP implementation - * is supported. If the flag is set, the hardware implementation - * will wake up the application processor when the FIFO is full, - * If the flag is not set, the hardware implementation will drop - * the oldest data when the FIFO is full. - */ -#define FLP_BATCH_WAKEUP_ON_FIFO_FULL 0x0000001 - -/** - * While batching, the implementation should not call the - * flp_location_callback on every location fix. However, - * sometimes in high power mode, the system might need - * a location callback every single time the location - * fix has been obtained. This flag controls that option. - * Its the responsibility of the upper layers (caller) to switch - * it off, if it knows that the AP might go to sleep. - * When this bit is on amidst a batching session, batching should - * continue while location fixes are reported in real time. - */ -#define FLP_BATCH_CALLBACK_ON_LOCATION_FIX 0x0000002 - -/** Flags to indicate which values are valid in a FlpLocation. */ -typedef uint16_t FlpLocationFlags; - -// IMPORTANT: Note that the following values must match -// constants in the corresponding java file. - -/** FlpLocation has valid latitude and longitude. */ -#define FLP_LOCATION_HAS_LAT_LONG (1U<<0) -/** FlpLocation has valid altitude. */ -#define FLP_LOCATION_HAS_ALTITUDE (1U<<1) -/** FlpLocation has valid speed. */ -#define FLP_LOCATION_HAS_SPEED (1U<<2) -/** FlpLocation has valid bearing. */ -#define FLP_LOCATION_HAS_BEARING (1U<<4) -/** FlpLocation has valid accuracy. */ -#define FLP_LOCATION_HAS_ACCURACY (1U<<8) - - -typedef int64_t FlpUtcTime; - -/** Represents a location. */ -typedef struct { - /** set to sizeof(FlpLocation) */ - size_t size; - - /** Flags associated with the location object. */ - FlpLocationFlags flags; - - /** Represents latitude in degrees. */ - double latitude; - - /** Represents longitude in degrees. */ - double longitude; - - /** - * Represents altitude in meters above the WGS 84 reference - * ellipsoid. */ - double altitude; - - /** Represents speed in meters per second. */ - float speed; - - /** Represents heading in degrees. */ - float bearing; - - /** Represents expected accuracy in meters. */ - float accuracy; - - /** Timestamp for the location fix. */ - FlpUtcTime timestamp; - - /** Sources used, will be Bitwise OR of the FLP_TECH_MASK bits. */ - uint32_t sources_used; -} FlpLocation; - -typedef enum { - ASSOCIATE_JVM, - DISASSOCIATE_JVM, -} ThreadEvent; - -/** - * Callback with location information. - * Can only be called from a thread associated to JVM using set_thread_event_cb. - * Parameters: - * num_locations is the number of batched locations available. - * location is the pointer to an array of pointers to location objects. - */ -typedef void (*flp_location_callback)(int32_t num_locations, FlpLocation** location); - -/** - * Callback utility for acquiring a wakelock. - * This can be used to prevent the CPU from suspending while handling FLP events. - */ -typedef void (*flp_acquire_wakelock)(); - -/** - * Callback utility for releasing the FLP wakelock. - */ -typedef void (*flp_release_wakelock)(); - -/** - * Callback for associating a thread that can call into the Java framework code. - * This must be used to initialize any threads that report events up to the framework. - * Return value: - * FLP_RESULT_SUCCESS on success. - * FLP_RESULT_ERROR if the association failed in the current thread. - */ -typedef int (*flp_set_thread_event)(ThreadEvent event); - -/** FLP callback structure. */ -typedef struct { - /** set to sizeof(FlpCallbacks) */ - size_t size; - flp_location_callback location_cb; - flp_acquire_wakelock acquire_wakelock_cb; - flp_release_wakelock release_wakelock_cb; - flp_set_thread_event set_thread_event_cb; -} FlpCallbacks; - - -/** Options with the batching FLP APIs */ -typedef struct { - /** - * Maximum power in mW that the underlying implementation - * can use for this batching call. - * If max_power_allocation_mW is 0, only fixes that are generated - * at no additional cost of power shall be reported. - */ - double max_power_allocation_mW; - - /** Bitwise OR of the FLP_TECH_MASKS to use */ - uint32_t sources_to_use; - - /** - * FLP_BATCH_WAKEUP_ON_FIFO_FULL - If set the hardware - * will wake up the AP when the buffer is full. If not set, the - * hardware will drop the oldest location object. - * - * FLP_BATCH_CALLBACK_ON_LOCATION_FIX - If set the location - * callback will be called every time there is a location fix. - * Its the responsibility of the upper layers (caller) to switch - * it off, if it knows that the AP might go to sleep. When this - * bit is on amidst a batching session, batching should continue - * while location fixes are reported in real time. - * - * Other flags to be bitwised ORed in the future. - */ - uint32_t flags; - - /** - * Frequency with which location needs to be batched in nano - * seconds. - */ - int64_t period_ns; -} FlpBatchOptions; - -#define FLP_RESULT_SUCCESS 0 -#define FLP_RESULT_ERROR -1 -#define FLP_RESULT_INSUFFICIENT_MEMORY -2 -#define FLP_RESULT_TOO_MANY_GEOFENCES -3 -#define FLP_RESULT_ID_EXISTS -4 -#define FLP_RESULT_ID_UNKNOWN -5 -#define FLP_RESULT_INVALID_GEOFENCE_TRANSITION -6 - -/** - * Represents the standard FLP interface. - */ -typedef struct { - /** - * set to sizeof(FlpLocationInterface) - */ - size_t size; - - /** - * Opens the interface and provides the callback routines - * to the implemenation of this interface. - */ - int (*init)(FlpCallbacks* callbacks ); - - /** - * Return the batch size (in number of FlpLocation objects) - * available in the hardware. Note, different HW implementations - * may have different sample sizes. This shall return number - * of samples defined in the format of FlpLocation. - * This will be used by the upper layer, to decide on the batching - * interval and whether the AP should be woken up or not. - */ - int (*get_batch_size)(); - - /** - * Start batching locations. This API is primarily used when the AP is - * asleep and the device can batch locations in the hardware. - * flp_location_callback is used to return the locations. When the buffer - * is full and FLP_BATCH_WAKEUP_ON_FIFO_FULL is used, the AP is woken up. - * When the buffer is full and FLP_BATCH_WAKEUP_ON_FIFO_FULL is not set, - * the oldest location object is dropped. In this case the AP will not be - * woken up. The upper layer will use get_batched_location - * API to explicitly ask for the location. - * If FLP_BATCH_CALLBACK_ON_LOCATION_FIX is set, the implementation - * will call the flp_location_callback every single time there is a location - * fix. This overrides FLP_BATCH_WAKEUP_ON_FIFO_FULL flag setting. - * It's the responsibility of the upper layers (caller) to switch - * it off, if it knows that the AP might go to sleep. This is useful - * for nagivational applications when the system is in high power mode. - * Parameters: - * id - Id for the request. - * options - See FlpBatchOptions struct definition. - * Return value: - * FLP_RESULT_SUCCESS on success, FLP_RESULT_INSUFFICIENT_MEMORY, - * FLP_RESULT_ID_EXISTS, FLP_RESULT_ERROR on failure. - */ - int (*start_batching)(int id, FlpBatchOptions* options); - - /** - * Update FlpBatchOptions associated with a batching request. - * When a batching operation is in progress and a batching option - * such as FLP_BATCH_WAKEUP_ON_FIFO_FULL needs to be updated, this API - * will be used. For instance, this can happen when the AP is awake and - * the maps application is being used. - * Parameters: - * id - Id of an existing batch request. - * new_options - Updated FlpBatchOptions - * Return value: - * FLP_RESULT_SUCCESS on success, FLP_RESULT_ID_UNKNOWN, - * FLP_RESULT_ERROR on error. - */ - int (*update_batching_options)(int id, FlpBatchOptions* new_options); - - /** - * Stop batching. - * Parameters: - * id - Id for the request. - * Return Value: - * FLP_RESULT_SUCCESS on success, FLP_RESULT_ID_UNKNOWN or - * FLP_RESULT_ERROR on failure. - */ - int (*stop_batching)(int id); - - /** - * Closes the interface. If any batch operations are in progress, - * they should be stopped. - */ - void (*cleanup)(); - - /** - * Get the fused location that was batched. - * flp_location_callback is used to return the location. The location object - * is dropped from the buffer only when the buffer is full. Do not remove it - * from the buffer just because it has been returned using the callback. - * In other words, when there is no new location object, two calls to - * get_batched_location(1) should return the same location object. - * Parameters: - * last_n_locations - Number of locations to get. This can be one or many. - * If the last_n_locations is 1, you get the latest location known to the - * hardware. - */ - void (*get_batched_location)(int last_n_locations); - - /** - * Injects current location from another location provider - * latitude and longitude are measured in degrees - * expected accuracy is measured in meters - * Parameters: - * location - The location object being injected. - * Return value: FLP_RESULT_SUCCESS or FLP_RESULT_ERROR. - */ - int (*inject_location)(FlpLocation* location); - - /** - * Get a pointer to extension information. - */ - const void* (*get_extension)(const char* name); -} FlpLocationInterface; - -struct flp_device_t { - struct hw_device_t common; - - /** - * Get a handle to the FLP Interface. - */ - const FlpLocationInterface* (*get_flp_interface)(struct flp_device_t* dev); -}; - -/** - * Callback for reports diagnostic data into the Java framework code. -*/ -typedef void (*report_data)(char* data, int length); - -/** - * FLP diagnostic callback structure. - * Currently, not used - but this for future extension. - */ -typedef struct { - /** set to sizeof(FlpDiagnosticCallbacks) */ - size_t size; - - flp_set_thread_event set_thread_event_cb; - - /** reports diagnostic data into the Java framework code */ - report_data data_cb; -} FlpDiagnosticCallbacks; - -/** Extended interface for diagnostic support. */ -typedef struct { - /** set to sizeof(FlpDiagnosticInterface) */ - size_t size; - - /** - * Opens the diagnostic interface and provides the callback routines - * to the implemenation of this interface. - */ - void (*init)(FlpDiagnosticCallbacks* callbacks); - - /** - * Injects diagnostic data into the FLP subsystem. - * Return 0 on success, -1 on error. - **/ - int (*inject_data)(char* data, int length ); -} FlpDiagnosticInterface; - -/** - * Context setting information. - * All these settings shall be injected to FLP HAL at FLP init time. - * Following that, only the changed setting need to be re-injected - * upon changes. - */ - -#define FLP_DEVICE_CONTEXT_GPS_ENABLED (1U<<0) -#define FLP_DEVICE_CONTEXT_AGPS_ENABLED (1U<<1) -#define FLP_DEVICE_CONTEXT_NETWORK_POSITIONING_ENABLED (1U<<2) -#define FLP_DEVICE_CONTEXT_WIFI_CONNECTIVITY_ENABLED (1U<<3) -#define FLP_DEVICE_CONTEXT_WIFI_POSITIONING_ENABLED (1U<<4) -#define FLP_DEVICE_CONTEXT_HW_NETWORK_POSITIONING_ENABLED (1U<<5) -#define FLP_DEVICE_CONTEXT_AIRPLANE_MODE_ON (1U<<6) -#define FLP_DEVICE_CONTEXT_DATA_ENABLED (1U<<7) -#define FLP_DEVICE_CONTEXT_ROAMING_ENABLED (1U<<8) -#define FLP_DEVICE_CONTEXT_CURRENTLY_ROAMING (1U<<9) -#define FLP_DEVICE_CONTEXT_SENSOR_ENABLED (1U<<10) -#define FLP_DEVICE_CONTEXT_BLUETOOTH_ENABLED (1U<<11) -#define FLP_DEVICE_CONTEXT_CHARGER_ON (1U<<12) - -/** Extended interface for device context support. */ -typedef struct { - /** set to sizeof(FlpDeviceContextInterface) */ - size_t size; - - /** - * Injects debug data into the FLP subsystem. - * Return 0 on success, -1 on error. - **/ - int (*inject_device_context)(uint32_t enabledMask); -} FlpDeviceContextInterface; - - -/** - * There are 3 states associated with a Geofence: Inside, Outside, Unknown. - * There are 3 transitions: ENTERED, EXITED, UNCERTAIN. - * - * An example state diagram with confidence level: 95% and Unknown time limit - * set as 30 secs is shown below. (confidence level and Unknown time limit are - * explained latter) - * ____________________________ - * | Unknown (30 secs) | - * """""""""""""""""""""""""""" - * ^ | | ^ - * UNCERTAIN| |ENTERED EXITED| |UNCERTAIN - * | v v | - * ________ EXITED _________ - * | Inside | -----------> | Outside | - * | | <----------- | | - * """""""" ENTERED """"""""" - * - * Inside state: We are 95% confident that the user is inside the geofence. - * Outside state: We are 95% confident that the user is outside the geofence - * Unknown state: Rest of the time. - * - * The Unknown state is better explained with an example: - * - * __________ - * | c| - * | ___ | _______ - * | |a| | | b | - * | """ | """"""" - * | | - * """""""""" - * In the diagram above, "a" and "b" are 2 geofences and "c" is the accuracy - * circle reported by the FLP subsystem. Now with regard to "b", the system is - * confident that the user is outside. But with regard to "a" is not confident - * whether it is inside or outside the geofence. If the accuracy remains the - * same for a sufficient period of time, the UNCERTAIN transition would be - * triggered with the state set to Unknown. If the accuracy improves later, an - * appropriate transition should be triggered. This "sufficient period of time" - * is defined by the parameter in the add_geofence_area API. - * In other words, Unknown state can be interpreted as a state in which the - * FLP subsystem isn't confident enough that the user is either inside or - * outside the Geofence. It moves to Unknown state only after the expiry of the - * timeout. - * - * The geofence callback needs to be triggered for the ENTERED and EXITED - * transitions, when the FLP system is confident that the user has entered - * (Inside state) or exited (Outside state) the Geofence. An implementation - * which uses a value of 95% as the confidence is recommended. The callback - * should be triggered only for the transitions requested by the - * add_geofence_area call. - * - * Even though the diagram and explanation talks about states and transitions, - * the callee is only interested in the transistions. The states are mentioned - * here for illustrative purposes. - * - * Startup Scenario: When the device boots up, if an application adds geofences, - * and then we get an accurate FLP location fix, it needs to trigger the - * appropriate (ENTERED or EXITED) transition for every Geofence it knows about. - * By default, all the Geofences will be in the Unknown state. - * - * When the FLP system is unavailable, flp_geofence_status_callback should be - * called to inform the upper layers of the same. Similarly, when it becomes - * available the callback should be called. This is a global state while the - * UNKNOWN transition described above is per geofence. - * - */ -#define FLP_GEOFENCE_TRANSITION_ENTERED (1L<<0) -#define FLP_GEOFENCE_TRANSITION_EXITED (1L<<1) -#define FLP_GEOFENCE_TRANSITION_UNCERTAIN (1L<<2) - -#define FLP_GEOFENCE_MONITOR_STATUS_UNAVAILABLE (1L<<0) -#define FLP_GEOFENCE_MONITOR_STATUS_AVAILABLE (1L<<1) - -/** - * The callback associated with the geofence. - * Parameters: - * geofence_id - The id associated with the add_geofence_area. - * location - The current location as determined by the FLP subsystem. - * transition - Can be one of FLP_GEOFENCE_TRANSITION_ENTERED, FLP_GEOFENCE_TRANSITION_EXITED, - * FLP_GEOFENCE_TRANSITION_UNCERTAIN. - * timestamp - Timestamp when the transition was detected; -1 if not available. - * sources_used - Bitwise OR of FLP_TECH_MASK flags indicating which - * subsystems were used. - * - * The callback should only be called when the caller is interested in that - * particular transition. For instance, if the caller is interested only in - * ENTERED transition, then the callback should NOT be called with the EXITED - * transition. - * - * IMPORTANT: If a transition is triggered resulting in this callback, the - * subsystem will wake up the application processor, if its in suspend state. - */ -typedef void (*flp_geofence_transition_callback) (int32_t geofence_id, FlpLocation* location, - int32_t transition, FlpUtcTime timestamp, uint32_t sources_used); - -/** - * The callback associated with the availablity of one the sources used for geofence - * monitoring by the FLP sub-system For example, if the GPS system determines that it cannot - * monitor geofences because of lack of reliability or unavailability of the GPS signals, - * it will call this callback with FLP_GEOFENCE_MONITOR_STATUS_UNAVAILABLE parameter and the - * source set to FLP_TECH_MASK_GNSS. - * - * Parameters: - * status - FLP_GEOFENCE_MONITOR_STATUS_UNAVAILABLE or FLP_GEOFENCE_MONITOR_STATUS_AVAILABLE. - * source - One of the FLP_TECH_MASKS - * last_location - Last known location. - */ -typedef void (*flp_geofence_monitor_status_callback) (int32_t status, uint32_t source, - FlpLocation* last_location); - -/** - * The callback associated with the add_geofence call. - * - * Parameter: - * geofence_id - Id of the geofence. - * result - FLP_RESULT_SUCCESS - * FLP_RESULT_ERROR_TOO_MANY_GEOFENCES - geofence limit has been reached. - * FLP_RESULT_ID_EXISTS - geofence with id already exists - * FLP_RESULT_INVALID_GEOFENCE_TRANSITION - the monitorTransition contains an - * invalid transition - * FLP_RESULT_ERROR - for other errors. - */ -typedef void (*flp_geofence_add_callback) (int32_t geofence_id, int32_t result); - -/** - * The callback associated with the remove_geofence call. - * - * Parameter: - * geofence_id - Id of the geofence. - * result - FLP_RESULT_SUCCESS - * FLP_RESULT_ID_UNKNOWN - for invalid id - * FLP_RESULT_ERROR for others. - */ -typedef void (*flp_geofence_remove_callback) (int32_t geofence_id, int32_t result); - - -/** - * The callback associated with the pause_geofence call. - * - * Parameter: - * geofence_id - Id of the geofence. - * result - FLP_RESULT_SUCCESS - * FLP_RESULT__ID_UNKNOWN - for invalid id - * FLP_RESULT_INVALID_TRANSITION - - * when monitor_transitions is invalid - * FLP_RESULT_ERROR for others. - */ -typedef void (*flp_geofence_pause_callback) (int32_t geofence_id, int32_t result); - -/** - * The callback associated with the resume_geofence call. - * - * Parameter: - * geofence_id - Id of the geofence. - * result - FLP_RESULT_SUCCESS - * FLP_RESULT_ID_UNKNOWN - for invalid id - * FLP_RESULT_ERROR for others. - */ -typedef void (*flp_geofence_resume_callback) (int32_t geofence_id, int32_t result); - -typedef struct { - /** set to sizeof(FlpGeofenceCallbacks) */ - size_t size; - flp_geofence_transition_callback geofence_transition_callback; - flp_geofence_monitor_status_callback geofence_status_callback; - flp_geofence_add_callback geofence_add_callback; - flp_geofence_remove_callback geofence_remove_callback; - flp_geofence_pause_callback geofence_pause_callback; - flp_geofence_resume_callback geofence_resume_callback; - flp_set_thread_event set_thread_event_cb; -} FlpGeofenceCallbacks; - - -/** Type of geofence */ -typedef enum { - TYPE_CIRCLE = 0, -} GeofenceType; - -/** Circular geofence is represented by lat / long / radius */ -typedef struct { - double latitude; - double longitude; - double radius_m; -} GeofenceCircle; - -/** Represents the type of geofence and data */ -typedef struct { - GeofenceType type; - union { - GeofenceCircle circle; - } geofence; -} GeofenceData; - -/** Geofence Options */ -typedef struct { - /** - * The current state of the geofence. For example, if - * the system already knows that the user is inside the geofence, - * this will be set to FLP_GEOFENCE_TRANSITION_ENTERED. In most cases, it - * will be FLP_GEOFENCE_TRANSITION_UNCERTAIN. */ - int last_transition; - - /** - * Transitions to monitor. Bitwise OR of - * FLP_GEOFENCE_TRANSITION_ENTERED, FLP_GEOFENCE_TRANSITION_EXITED and - * FLP_GEOFENCE_TRANSITION_UNCERTAIN. - */ - int monitor_transitions; - - /** - * Defines the best-effort description - * of how soon should the callback be called when the transition - * associated with the Geofence is triggered. For instance, if set - * to 1000 millseconds with FLP_GEOFENCE_TRANSITION_ENTERED, the callback - * should be called 1000 milliseconds within entering the geofence. - * This parameter is defined in milliseconds. - * NOTE: This is not to be confused with the rate that the GPS is - * polled at. It is acceptable to dynamically vary the rate of - * sampling the GPS for power-saving reasons; thus the rate of - * sampling may be faster or slower than this. - */ - int notification_responsivenes_ms; - - /** - * The time limit after which the UNCERTAIN transition - * should be triggered. This paramter is defined in milliseconds. - */ - int unknown_timer_ms; - - /** - * The sources to use for monitoring geofences. Its a BITWISE-OR - * of FLP_TECH_MASK flags. - */ - uint32_t sources_to_use; -} GeofenceOptions; - -/** Geofence struct */ -typedef struct { - int32_t geofence_id; - GeofenceData* data; - GeofenceOptions* options; -} Geofence; - -/** Extended interface for FLP_Geofencing support */ -typedef struct { - /** set to sizeof(FlpGeofencingInterface) */ - size_t size; - - /** - * Opens the geofence interface and provides the callback routines - * to the implemenation of this interface. - */ - void (*init)( FlpGeofenceCallbacks* callbacks ); - - /** - * Add a list of geofences. - * Parameters: - * number_of_geofences - The number of geofences that needed to be added. - * geofences - Pointer to array of pointers to Geofence structure. - */ - void (*add_geofences) (int32_t number_of_geofences, Geofence** geofences); - - /** - * Pause monitoring a particular geofence. - * Parameters: - * geofence_id - The id for the geofence. - */ - void (*pause_geofence) (int32_t geofence_id); - - /** - * Resume monitoring a particular geofence. - * Parameters: - * geofence_id - The id for the geofence. - * monitor_transitions - Which transitions to monitor. Bitwise OR of - * FLP_GEOFENCE_TRANSITION_ENTERED, FLP_GEOFENCE_TRANSITION_EXITED and - * FLP_GEOFENCE_TRANSITION_UNCERTAIN. - * This supersedes the value associated provided in the - * add_geofence_area call. - */ - void (*resume_geofence) (int32_t geofence_id, int monitor_transitions); - - /** - * Modify a particular geofence option. - * Parameters: - * geofence_id - The id for the geofence. - * options - Various options associated with the geofence. See - * GeofenceOptions structure for details. - */ - void (*modify_geofence_option) (int32_t geofence_id, GeofenceOptions* options); - - /** - * Remove a list of geofences. After the function returns, no notifications - * should be sent. - * Parameter: - * number_of_geofences - The number of geofences that needed to be added. - * geofence_id - Pointer to array of geofence_ids to be removed. - */ - void (*remove_geofences) (int32_t number_of_geofences, int32_t* geofence_id); -} FlpGeofencingInterface; - -__END_DECLS - -#endif /* ANDROID_INCLUDE_HARDWARE_FLP_H */ - diff --git a/external/android/include/19/hardware/libhardware/include/hardware/gps.h b/external/android/include/19/hardware/libhardware/include/hardware/gps.h deleted file mode 100644 index 458b5b4..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/gps.h +++ /dev/null @@ -1,939 +0,0 @@ -/* - * Copyright (C) 2010 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_INCLUDE_HARDWARE_GPS_H -#define ANDROID_INCLUDE_HARDWARE_GPS_H - -#include -#include -#include -#include - -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define GPS_HARDWARE_MODULE_ID "gps" - - -/** Milliseconds since January 1, 1970 */ -typedef int64_t GpsUtcTime; - -/** Maximum number of SVs for gps_sv_status_callback(). */ -#define GPS_MAX_SVS 32 - -/** Requested operational mode for GPS operation. */ -typedef uint32_t GpsPositionMode; -// IMPORTANT: Note that the following values must match -// constants in GpsLocationProvider.java. -/** Mode for running GPS standalone (no assistance). */ -#define GPS_POSITION_MODE_STANDALONE 0 -/** AGPS MS-Based mode. */ -#define GPS_POSITION_MODE_MS_BASED 1 -/** AGPS MS-Assisted mode. */ -#define GPS_POSITION_MODE_MS_ASSISTED 2 - -/** Requested recurrence mode for GPS operation. */ -typedef uint32_t GpsPositionRecurrence; -// IMPORTANT: Note that the following values must match -// constants in GpsLocationProvider.java. -/** Receive GPS fixes on a recurring basis at a specified period. */ -#define GPS_POSITION_RECURRENCE_PERIODIC 0 -/** Request a single shot GPS fix. */ -#define GPS_POSITION_RECURRENCE_SINGLE 1 - -/** GPS status event values. */ -typedef uint16_t GpsStatusValue; -// IMPORTANT: Note that the following values must match -// constants in GpsLocationProvider.java. -/** GPS status unknown. */ -#define GPS_STATUS_NONE 0 -/** GPS has begun navigating. */ -#define GPS_STATUS_SESSION_BEGIN 1 -/** GPS has stopped navigating. */ -#define GPS_STATUS_SESSION_END 2 -/** GPS has powered on but is not navigating. */ -#define GPS_STATUS_ENGINE_ON 3 -/** GPS is powered off. */ -#define GPS_STATUS_ENGINE_OFF 4 - -/** Flags to indicate which values are valid in a GpsLocation. */ -typedef uint16_t GpsLocationFlags; -// IMPORTANT: Note that the following values must match -// constants in GpsLocationProvider.java. -/** GpsLocation has valid latitude and longitude. */ -#define GPS_LOCATION_HAS_LAT_LONG 0x0001 -/** GpsLocation has valid altitude. */ -#define GPS_LOCATION_HAS_ALTITUDE 0x0002 -/** GpsLocation has valid speed. */ -#define GPS_LOCATION_HAS_SPEED 0x0004 -/** GpsLocation has valid bearing. */ -#define GPS_LOCATION_HAS_BEARING 0x0008 -/** GpsLocation has valid accuracy. */ -#define GPS_LOCATION_HAS_ACCURACY 0x0010 - -/** Flags for the gps_set_capabilities callback. */ - -/** GPS HAL schedules fixes for GPS_POSITION_RECURRENCE_PERIODIC mode. - If this is not set, then the framework will use 1000ms for min_interval - and will start and call start() and stop() to schedule the GPS. - */ -#define GPS_CAPABILITY_SCHEDULING 0x0000001 -/** GPS supports MS-Based AGPS mode */ -#define GPS_CAPABILITY_MSB 0x0000002 -/** GPS supports MS-Assisted AGPS mode */ -#define GPS_CAPABILITY_MSA 0x0000004 -/** GPS supports single-shot fixes */ -#define GPS_CAPABILITY_SINGLE_SHOT 0x0000008 -/** GPS supports on demand time injection */ -#define GPS_CAPABILITY_ON_DEMAND_TIME 0x0000010 -/** GPS supports Geofencing */ -#define GPS_CAPABILITY_GEOFENCING 0x0000020 - -/** Flags used to specify which aiding data to delete - when calling delete_aiding_data(). */ -typedef uint16_t GpsAidingData; -// IMPORTANT: Note that the following values must match -// constants in GpsLocationProvider.java. -#define GPS_DELETE_EPHEMERIS 0x0001 -#define GPS_DELETE_ALMANAC 0x0002 -#define GPS_DELETE_POSITION 0x0004 -#define GPS_DELETE_TIME 0x0008 -#define GPS_DELETE_IONO 0x0010 -#define GPS_DELETE_UTC 0x0020 -#define GPS_DELETE_HEALTH 0x0040 -#define GPS_DELETE_SVDIR 0x0080 -#define GPS_DELETE_SVSTEER 0x0100 -#define GPS_DELETE_SADATA 0x0200 -#define GPS_DELETE_RTI 0x0400 -#define GPS_DELETE_CELLDB_INFO 0x8000 -#define GPS_DELETE_ALL 0xFFFF - -/** AGPS type */ -typedef uint16_t AGpsType; -#define AGPS_TYPE_SUPL 1 -#define AGPS_TYPE_C2K 2 - -typedef uint16_t AGpsSetIDType; -#define AGPS_SETID_TYPE_NONE 0 -#define AGPS_SETID_TYPE_IMSI 1 -#define AGPS_SETID_TYPE_MSISDN 2 - -/** - * String length constants - */ -#define GPS_NI_SHORT_STRING_MAXLEN 256 -#define GPS_NI_LONG_STRING_MAXLEN 2048 - -/** - * GpsNiType constants - */ -typedef uint32_t GpsNiType; -#define GPS_NI_TYPE_VOICE 1 -#define GPS_NI_TYPE_UMTS_SUPL 2 -#define GPS_NI_TYPE_UMTS_CTRL_PLANE 3 - -/** - * GpsNiNotifyFlags constants - */ -typedef uint32_t GpsNiNotifyFlags; -/** NI requires notification */ -#define GPS_NI_NEED_NOTIFY 0x0001 -/** NI requires verification */ -#define GPS_NI_NEED_VERIFY 0x0002 -/** NI requires privacy override, no notification/minimal trace */ -#define GPS_NI_PRIVACY_OVERRIDE 0x0004 - -/** - * GPS NI responses, used to define the response in - * NI structures - */ -typedef int GpsUserResponseType; -#define GPS_NI_RESPONSE_ACCEPT 1 -#define GPS_NI_RESPONSE_DENY 2 -#define GPS_NI_RESPONSE_NORESP 3 - -/** - * NI data encoding scheme - */ -typedef int GpsNiEncodingType; -#define GPS_ENC_NONE 0 -#define GPS_ENC_SUPL_GSM_DEFAULT 1 -#define GPS_ENC_SUPL_UTF8 2 -#define GPS_ENC_SUPL_UCS2 3 -#define GPS_ENC_UNKNOWN -1 - -/** AGPS status event values. */ -typedef uint16_t AGpsStatusValue; -/** GPS requests data connection for AGPS. */ -#define GPS_REQUEST_AGPS_DATA_CONN 1 -/** GPS releases the AGPS data connection. */ -#define GPS_RELEASE_AGPS_DATA_CONN 2 -/** AGPS data connection initiated */ -#define GPS_AGPS_DATA_CONNECTED 3 -/** AGPS data connection completed */ -#define GPS_AGPS_DATA_CONN_DONE 4 -/** AGPS data connection failed */ -#define GPS_AGPS_DATA_CONN_FAILED 5 - -#define AGPS_REF_LOCATION_TYPE_GSM_CELLID 1 -#define AGPS_REF_LOCATION_TYPE_UMTS_CELLID 2 -#define AGPS_REG_LOCATION_TYPE_MAC 3 - -/** Network types for update_network_state "type" parameter */ -#define AGPS_RIL_NETWORK_TYPE_MOBILE 0 -#define AGPS_RIL_NETWORK_TYPE_WIFI 1 -#define AGPS_RIL_NETWORK_TYPE_MOBILE_MMS 2 -#define AGPS_RIL_NETWORK_TYPE_MOBILE_SUPL 3 -#define AGPS_RIL_NETWORK_TTYPE_MOBILE_DUN 4 -#define AGPS_RIL_NETWORK_TTYPE_MOBILE_HIPRI 5 -#define AGPS_RIL_NETWORK_TTYPE_WIMAX 6 - -/** - * Name for the GPS XTRA interface. - */ -#define GPS_XTRA_INTERFACE "gps-xtra" - -/** - * Name for the GPS DEBUG interface. - */ -#define GPS_DEBUG_INTERFACE "gps-debug" - -/** - * Name for the AGPS interface. - */ -#define AGPS_INTERFACE "agps" - -/** - * Name for NI interface - */ -#define GPS_NI_INTERFACE "gps-ni" - -/** - * Name for the AGPS-RIL interface. - */ -#define AGPS_RIL_INTERFACE "agps_ril" - -/** - * Name for the GPS_Geofencing interface. - */ -#define GPS_GEOFENCING_INTERFACE "gps_geofencing" - - -/** Represents a location. */ -typedef struct { - /** set to sizeof(GpsLocation) */ - size_t size; - /** Contains GpsLocationFlags bits. */ - uint16_t flags; - /** Represents latitude in degrees. */ - double latitude; - /** Represents longitude in degrees. */ - double longitude; - /** Represents altitude in meters above the WGS 84 reference - * ellipsoid. */ - double altitude; - /** Represents speed in meters per second. */ - float speed; - /** Represents heading in degrees. */ - float bearing; - /** Represents expected accuracy in meters. */ - float accuracy; - /** Timestamp for the location fix. */ - GpsUtcTime timestamp; -} GpsLocation; - -/** Represents the status. */ -typedef struct { - /** set to sizeof(GpsStatus) */ - size_t size; - GpsStatusValue status; -} GpsStatus; - -/** Represents SV information. */ -typedef struct { - /** set to sizeof(GpsSvInfo) */ - size_t size; - /** Pseudo-random number for the SV. */ - int prn; - /** Signal to noise ratio. */ - float snr; - /** Elevation of SV in degrees. */ - float elevation; - /** Azimuth of SV in degrees. */ - float azimuth; -} GpsSvInfo; - -/** Represents SV status. */ -typedef struct { - /** set to sizeof(GpsSvStatus) */ - size_t size; - - /** Number of SVs currently visible. */ - int num_svs; - - /** Contains an array of SV information. */ - GpsSvInfo sv_list[GPS_MAX_SVS]; - - /** Represents a bit mask indicating which SVs - * have ephemeris data. - */ - uint32_t ephemeris_mask; - - /** Represents a bit mask indicating which SVs - * have almanac data. - */ - uint32_t almanac_mask; - - /** - * Represents a bit mask indicating which SVs - * were used for computing the most recent position fix. - */ - uint32_t used_in_fix_mask; -} GpsSvStatus; - -/* 2G and 3G */ -/* In 3G lac is discarded */ -typedef struct { - uint16_t type; - uint16_t mcc; - uint16_t mnc; - uint16_t lac; - uint32_t cid; -} AGpsRefLocationCellID; - -typedef struct { - uint8_t mac[6]; -} AGpsRefLocationMac; - -/** Represents ref locations */ -typedef struct { - uint16_t type; - union { - AGpsRefLocationCellID cellID; - AGpsRefLocationMac mac; - } u; -} AGpsRefLocation; - -/** Callback with location information. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* gps_location_callback)(GpsLocation* location); - -/** Callback with status information. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* gps_status_callback)(GpsStatus* status); - -/** Callback with SV status information. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* gps_sv_status_callback)(GpsSvStatus* sv_info); - -/** Callback for reporting NMEA sentences. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* gps_nmea_callback)(GpsUtcTime timestamp, const char* nmea, int length); - -/** Callback to inform framework of the GPS engine's capabilities. - * Capability parameter is a bit field of GPS_CAPABILITY_* flags. - */ -typedef void (* gps_set_capabilities)(uint32_t capabilities); - -/** Callback utility for acquiring the GPS wakelock. - * This can be used to prevent the CPU from suspending while handling GPS events. - */ -typedef void (* gps_acquire_wakelock)(); - -/** Callback utility for releasing the GPS wakelock. */ -typedef void (* gps_release_wakelock)(); - -/** Callback for requesting NTP time */ -typedef void (* gps_request_utc_time)(); - -/** Callback for creating a thread that can call into the Java framework code. - * This must be used to create any threads that report events up to the framework. - */ -typedef pthread_t (* gps_create_thread)(const char* name, void (*start)(void *), void* arg); - -/** GPS callback structure. */ -typedef struct { - /** set to sizeof(GpsCallbacks) */ - size_t size; - gps_location_callback location_cb; - gps_status_callback status_cb; - gps_sv_status_callback sv_status_cb; - gps_nmea_callback nmea_cb; - gps_set_capabilities set_capabilities_cb; - gps_acquire_wakelock acquire_wakelock_cb; - gps_release_wakelock release_wakelock_cb; - gps_create_thread create_thread_cb; - gps_request_utc_time request_utc_time_cb; -} GpsCallbacks; - - -/** Represents the standard GPS interface. */ -typedef struct { - /** set to sizeof(GpsInterface) */ - size_t size; - /** - * Opens the interface and provides the callback routines - * to the implemenation of this interface. - */ - int (*init)( GpsCallbacks* callbacks ); - - /** Starts navigating. */ - int (*start)( void ); - - /** Stops navigating. */ - int (*stop)( void ); - - /** Closes the interface. */ - void (*cleanup)( void ); - - /** Injects the current time. */ - int (*inject_time)(GpsUtcTime time, int64_t timeReference, - int uncertainty); - - /** Injects current location from another location provider - * (typically cell ID). - * latitude and longitude are measured in degrees - * expected accuracy is measured in meters - */ - int (*inject_location)(double latitude, double longitude, float accuracy); - - /** - * Specifies that the next call to start will not use the - * information defined in the flags. GPS_DELETE_ALL is passed for - * a cold start. - */ - void (*delete_aiding_data)(GpsAidingData flags); - - /** - * min_interval represents the time between fixes in milliseconds. - * preferred_accuracy represents the requested fix accuracy in meters. - * preferred_time represents the requested time to first fix in milliseconds. - */ - int (*set_position_mode)(GpsPositionMode mode, GpsPositionRecurrence recurrence, - uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time); - - /** Get a pointer to extension information. */ - const void* (*get_extension)(const char* name); -} GpsInterface; - -/** Callback to request the client to download XTRA data. - * The client should download XTRA data and inject it by calling inject_xtra_data(). - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* gps_xtra_download_request)(); - -/** Callback structure for the XTRA interface. */ -typedef struct { - gps_xtra_download_request download_request_cb; - gps_create_thread create_thread_cb; -} GpsXtraCallbacks; - -/** Extended interface for XTRA support. */ -typedef struct { - /** set to sizeof(GpsXtraInterface) */ - size_t size; - /** - * Opens the XTRA interface and provides the callback routines - * to the implemenation of this interface. - */ - int (*init)( GpsXtraCallbacks* callbacks ); - /** Injects XTRA data into the GPS. */ - int (*inject_xtra_data)( char* data, int length ); -} GpsXtraInterface; - -/** Extended interface for DEBUG support. */ -typedef struct { - /** set to sizeof(GpsDebugInterface) */ - size_t size; - - /** - * This function should return any information that the native - * implementation wishes to include in a bugreport. - */ - size_t (*get_internal_state)(char* buffer, size_t bufferSize); -} GpsDebugInterface; - -/** Represents the status of AGPS. */ -typedef struct { - /** set to sizeof(AGpsStatus) */ - size_t size; - - AGpsType type; - AGpsStatusValue status; - uint32_t ipaddr; -} AGpsStatus; - -/** Callback with AGPS status information. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (* agps_status_callback)(AGpsStatus* status); - -/** Callback structure for the AGPS interface. */ -typedef struct { - agps_status_callback status_cb; - gps_create_thread create_thread_cb; -} AGpsCallbacks; - - -/** Extended interface for AGPS support. */ -typedef struct { - /** set to sizeof(AGpsInterface) */ - size_t size; - - /** - * Opens the AGPS interface and provides the callback routines - * to the implemenation of this interface. - */ - void (*init)( AGpsCallbacks* callbacks ); - /** - * Notifies that a data connection is available and sets - * the name of the APN to be used for SUPL. - */ - int (*data_conn_open)( const char* apn ); - /** - * Notifies that the AGPS data connection has been closed. - */ - int (*data_conn_closed)(); - /** - * Notifies that a data connection is not available for AGPS. - */ - int (*data_conn_failed)(); - /** - * Sets the hostname and port for the AGPS server. - */ - int (*set_server)( AGpsType type, const char* hostname, int port ); -} AGpsInterface; - - -/** Represents an NI request */ -typedef struct { - /** set to sizeof(GpsNiNotification) */ - size_t size; - - /** - * An ID generated by HAL to associate NI notifications and UI - * responses - */ - int notification_id; - - /** - * An NI type used to distinguish different categories of NI - * events, such as GPS_NI_TYPE_VOICE, GPS_NI_TYPE_UMTS_SUPL, ... - */ - GpsNiType ni_type; - - /** - * Notification/verification options, combinations of GpsNiNotifyFlags constants - */ - GpsNiNotifyFlags notify_flags; - - /** - * Timeout period to wait for user response. - * Set to 0 for no time out limit. - */ - int timeout; - - /** - * Default response when time out. - */ - GpsUserResponseType default_response; - - /** - * Requestor ID - */ - char requestor_id[GPS_NI_SHORT_STRING_MAXLEN]; - - /** - * Notification message. It can also be used to store client_id in some cases - */ - char text[GPS_NI_LONG_STRING_MAXLEN]; - - /** - * Client name decoding scheme - */ - GpsNiEncodingType requestor_id_encoding; - - /** - * Client name decoding scheme - */ - GpsNiEncodingType text_encoding; - - /** - * A pointer to extra data. Format: - * key_1 = value_1 - * key_2 = value_2 - */ - char extras[GPS_NI_LONG_STRING_MAXLEN]; - -} GpsNiNotification; - -/** Callback with NI notification. - * Can only be called from a thread created by create_thread_cb. - */ -typedef void (*gps_ni_notify_callback)(GpsNiNotification *notification); - -/** GPS NI callback structure. */ -typedef struct -{ - /** - * Sends the notification request from HAL to GPSLocationProvider. - */ - gps_ni_notify_callback notify_cb; - gps_create_thread create_thread_cb; -} GpsNiCallbacks; - -/** - * Extended interface for Network-initiated (NI) support. - */ -typedef struct -{ - /** set to sizeof(GpsNiInterface) */ - size_t size; - - /** Registers the callbacks for HAL to use. */ - void (*init) (GpsNiCallbacks *callbacks); - - /** Sends a response to HAL. */ - void (*respond) (int notif_id, GpsUserResponseType user_response); -} GpsNiInterface; - -struct gps_device_t { - struct hw_device_t common; - - /** - * Set the provided lights to the provided values. - * - * Returns: 0 on succes, error code on failure. - */ - const GpsInterface* (*get_gps_interface)(struct gps_device_t* dev); -}; - -#define AGPS_RIL_REQUEST_SETID_IMSI (1<<0L) -#define AGPS_RIL_REQUEST_SETID_MSISDN (1<<1L) - -#define AGPS_RIL_REQUEST_REFLOC_CELLID (1<<0L) -#define AGPS_RIL_REQUEST_REFLOC_MAC (1<<1L) - -typedef void (*agps_ril_request_set_id)(uint32_t flags); -typedef void (*agps_ril_request_ref_loc)(uint32_t flags); - -typedef struct { - agps_ril_request_set_id request_setid; - agps_ril_request_ref_loc request_refloc; - gps_create_thread create_thread_cb; -} AGpsRilCallbacks; - -/** Extended interface for AGPS_RIL support. */ -typedef struct { - /** set to sizeof(AGpsRilInterface) */ - size_t size; - /** - * Opens the AGPS interface and provides the callback routines - * to the implemenation of this interface. - */ - void (*init)( AGpsRilCallbacks* callbacks ); - - /** - * Sets the reference location. - */ - void (*set_ref_location) (const AGpsRefLocation *agps_reflocation, size_t sz_struct); - /** - * Sets the set ID. - */ - void (*set_set_id) (AGpsSetIDType type, const char* setid); - - /** - * Send network initiated message. - */ - void (*ni_message) (uint8_t *msg, size_t len); - - /** - * Notify GPS of network status changes. - * These parameters match values in the android.net.NetworkInfo class. - */ - void (*update_network_state) (int connected, int type, int roaming, const char* extra_info); - - /** - * Notify GPS of network status changes. - * These parameters match values in the android.net.NetworkInfo class. - */ - void (*update_network_availability) (int avaiable, const char* apn); -} AGpsRilInterface; - -/** - * GPS Geofence. - * There are 3 states associated with a Geofence: Inside, Outside, Unknown. - * There are 3 transitions: ENTERED, EXITED, UNCERTAIN. - * - * An example state diagram with confidence level: 95% and Unknown time limit - * set as 30 secs is shown below. (confidence level and Unknown time limit are - * explained latter) - * ____________________________ - * | Unknown (30 secs) | - * """""""""""""""""""""""""""" - * ^ | | ^ - * UNCERTAIN| |ENTERED EXITED| |UNCERTAIN - * | v v | - * ________ EXITED _________ - * | Inside | -----------> | Outside | - * | | <----------- | | - * """""""" ENTERED """"""""" - * - * Inside state: We are 95% confident that the user is inside the geofence. - * Outside state: We are 95% confident that the user is outside the geofence - * Unknown state: Rest of the time. - * - * The Unknown state is better explained with an example: - * - * __________ - * | c| - * | ___ | _______ - * | |a| | | b | - * | """ | """"""" - * | | - * """""""""" - * In the diagram above, "a" and "b" are 2 geofences and "c" is the accuracy - * circle reported by the GPS subsystem. Now with regard to "b", the system is - * confident that the user is outside. But with regard to "a" is not confident - * whether it is inside or outside the geofence. If the accuracy remains the - * same for a sufficient period of time, the UNCERTAIN transition would be - * triggered with the state set to Unknown. If the accuracy improves later, an - * appropriate transition should be triggered. This "sufficient period of time" - * is defined by the parameter in the add_geofence_area API. - * In other words, Unknown state can be interpreted as a state in which the - * GPS subsystem isn't confident enough that the user is either inside or - * outside the Geofence. It moves to Unknown state only after the expiry of the - * timeout. - * - * The geofence callback needs to be triggered for the ENTERED and EXITED - * transitions, when the GPS system is confident that the user has entered - * (Inside state) or exited (Outside state) the Geofence. An implementation - * which uses a value of 95% as the confidence is recommended. The callback - * should be triggered only for the transitions requested by the - * add_geofence_area call. - * - * Even though the diagram and explanation talks about states and transitions, - * the callee is only interested in the transistions. The states are mentioned - * here for illustrative purposes. - * - * Startup Scenario: When the device boots up, if an application adds geofences, - * and then we get an accurate GPS location fix, it needs to trigger the - * appropriate (ENTERED or EXITED) transition for every Geofence it knows about. - * By default, all the Geofences will be in the Unknown state. - * - * When the GPS system is unavailable, gps_geofence_status_callback should be - * called to inform the upper layers of the same. Similarly, when it becomes - * available the callback should be called. This is a global state while the - * UNKNOWN transition described above is per geofence. - * - * An important aspect to note is that users of this API (framework), will use - * other subsystems like wifi, sensors, cell to handle Unknown case and - * hopefully provide a definitive state transition to the third party - * application. GPS Geofence will just be a signal indicating what the GPS - * subsystem knows about the Geofence. - * - */ -#define GPS_GEOFENCE_ENTERED (1<<0L) -#define GPS_GEOFENCE_EXITED (1<<1L) -#define GPS_GEOFENCE_UNCERTAIN (1<<2L) - -#define GPS_GEOFENCE_UNAVAILABLE (1<<0L) -#define GPS_GEOFENCE_AVAILABLE (1<<1L) - -#define GPS_GEOFENCE_OPERATION_SUCCESS 0 -#define GPS_GEOFENCE_ERROR_TOO_MANY_GEOFENCES -100 -#define GPS_GEOFENCE_ERROR_ID_EXISTS -101 -#define GPS_GEOFENCE_ERROR_ID_UNKNOWN -102 -#define GPS_GEOFENCE_ERROR_INVALID_TRANSITION -103 -#define GPS_GEOFENCE_ERROR_GENERIC -149 - -/** - * The callback associated with the geofence. - * Parameters: - * geofence_id - The id associated with the add_geofence_area. - * location - The current GPS location. - * transition - Can be one of GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED, - * GPS_GEOFENCE_UNCERTAIN. - * timestamp - Timestamp when the transition was detected. - * - * The callback should only be called when the caller is interested in that - * particular transition. For instance, if the caller is interested only in - * ENTERED transition, then the callback should NOT be called with the EXITED - * transition. - * - * IMPORTANT: If a transition is triggered resulting in this callback, the GPS - * subsystem will wake up the application processor, if its in suspend state. - */ -typedef void (*gps_geofence_transition_callback) (int32_t geofence_id, GpsLocation* location, - int32_t transition, GpsUtcTime timestamp); - -/** - * The callback associated with the availablity of the GPS system for geofencing - * monitoring. If the GPS system determines that it cannot monitor geofences - * because of lack of reliability or unavailability of the GPS signals, it will - * call this callback with GPS_GEOFENCE_UNAVAILABLE parameter. - * - * Parameters: - * status - GPS_GEOFENCE_UNAVAILABLE or GPS_GEOFENCE_AVAILABLE. - * last_location - Last known location. - */ -typedef void (*gps_geofence_status_callback) (int32_t status, GpsLocation* last_location); - -/** - * The callback associated with the add_geofence call. - * - * Parameter: - * geofence_id - Id of the geofence. - * status - GPS_GEOFENCE_OPERATION_SUCCESS - * GPS_GEOFENCE_ERROR_TOO_MANY_GEOFENCES - geofence limit has been reached. - * GPS_GEOFENCE_ERROR_ID_EXISTS - geofence with id already exists - * GPS_GEOFENCE_ERROR_INVALID_TRANSITION - the monitorTransition contains an - * invalid transition - * GPS_GEOFENCE_ERROR_GENERIC - for other errors. - */ -typedef void (*gps_geofence_add_callback) (int32_t geofence_id, int32_t status); - -/** - * The callback associated with the remove_geofence call. - * - * Parameter: - * geofence_id - Id of the geofence. - * status - GPS_GEOFENCE_OPERATION_SUCCESS - * GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id - * GPS_GEOFENCE_ERROR_GENERIC for others. - */ -typedef void (*gps_geofence_remove_callback) (int32_t geofence_id, int32_t status); - - -/** - * The callback associated with the pause_geofence call. - * - * Parameter: - * geofence_id - Id of the geofence. - * status - GPS_GEOFENCE_OPERATION_SUCCESS - * GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id - * GPS_GEOFENCE_ERROR_INVALID_TRANSITION - - * when monitor_transitions is invalid - * GPS_GEOFENCE_ERROR_GENERIC for others. - */ -typedef void (*gps_geofence_pause_callback) (int32_t geofence_id, int32_t status); - -/** - * The callback associated with the resume_geofence call. - * - * Parameter: - * geofence_id - Id of the geofence. - * status - GPS_GEOFENCE_OPERATION_SUCCESS - * GPS_GEOFENCE_ERROR_ID_UNKNOWN - for invalid id - * GPS_GEOFENCE_ERROR_GENERIC for others. - */ -typedef void (*gps_geofence_resume_callback) (int32_t geofence_id, int32_t status); - -typedef struct { - gps_geofence_transition_callback geofence_transition_callback; - gps_geofence_status_callback geofence_status_callback; - gps_geofence_add_callback geofence_add_callback; - gps_geofence_remove_callback geofence_remove_callback; - gps_geofence_pause_callback geofence_pause_callback; - gps_geofence_resume_callback geofence_resume_callback; - gps_create_thread create_thread_cb; -} GpsGeofenceCallbacks; - -/** Extended interface for GPS_Geofencing support */ -typedef struct { - /** set to sizeof(GpsGeofencingInterface) */ - size_t size; - - /** - * Opens the geofence interface and provides the callback routines - * to the implemenation of this interface. - */ - void (*init)( GpsGeofenceCallbacks* callbacks ); - - /** - * Add a geofence area. This api currently supports circular geofences. - * Parameters: - * geofence_id - The id for the geofence. If a geofence with this id - * already exists, an error value (GPS_GEOFENCE_ERROR_ID_EXISTS) - * should be returned. - * latitude, longtitude, radius_meters - The lat, long and radius - * (in meters) for the geofence - * last_transition - The current state of the geofence. For example, if - * the system already knows that the user is inside the geofence, - * this will be set to GPS_GEOFENCE_ENTERED. In most cases, it - * will be GPS_GEOFENCE_UNCERTAIN. - * monitor_transition - Which transitions to monitor. Bitwise OR of - * GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED and - * GPS_GEOFENCE_UNCERTAIN. - * notification_responsiveness_ms - Defines the best-effort description - * of how soon should the callback be called when the transition - * associated with the Geofence is triggered. For instance, if set - * to 1000 millseconds with GPS_GEOFENCE_ENTERED, the callback - * should be called 1000 milliseconds within entering the geofence. - * This parameter is defined in milliseconds. - * NOTE: This is not to be confused with the rate that the GPS is - * polled at. It is acceptable to dynamically vary the rate of - * sampling the GPS for power-saving reasons; thus the rate of - * sampling may be faster or slower than this. - * unknown_timer_ms - The time limit after which the UNCERTAIN transition - * should be triggered. This paramter is defined in milliseconds. - * See above for a detailed explanation. - */ - void (*add_geofence_area) (int32_t geofence_id, double latitude, - double longitude, double radius_meters, - int last_transition, int monitor_transitions, - int notification_responsiveness_ms, - int unknown_timer_ms); - - /** - * Pause monitoring a particular geofence. - * Parameters: - * geofence_id - The id for the geofence. - */ - void (*pause_geofence) (int32_t geofence_id); - - /** - * Resume monitoring a particular geofence. - * Parameters: - * geofence_id - The id for the geofence. - * monitor_transitions - Which transitions to monitor. Bitwise OR of - * GPS_GEOFENCE_ENTERED, GPS_GEOFENCE_EXITED and - * GPS_GEOFENCE_UNCERTAIN. - * This supersedes the value associated provided in the - * add_geofence_area call. - */ - void (*resume_geofence) (int32_t geofence_id, int monitor_transitions); - - /** - * Remove a geofence area. After the function returns, no notifications - * should be sent. - * Parameter: - * geofence_id - The id for the geofence. - */ - void (*remove_geofence_area) (int32_t geofence_id); -} GpsGeofencingInterface; -__END_DECLS - -#endif /* ANDROID_INCLUDE_HARDWARE_GPS_H */ - diff --git a/external/android/include/19/hardware/libhardware/include/hardware/gralloc.h b/external/android/include/19/hardware/libhardware/include/hardware/gralloc.h deleted file mode 100644 index 0dbebcf..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/gralloc.h +++ /dev/null @@ -1,313 +0,0 @@ -/* - * 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. - */ - - -#ifndef ANDROID_GRALLOC_INTERFACE_H -#define ANDROID_GRALLOC_INTERFACE_H - -#include -#include -#include - -#include -#include -#include - -#include - -#include -#include - -__BEGIN_DECLS - -/** - * Module versioning information for the Gralloc hardware module, based on - * gralloc_module_t.common.module_api_version. - * - * Version History: - * - * GRALLOC_MODULE_API_VERSION_0_1: - * Initial Gralloc hardware module API. - * - * GRALLOC_MODULE_API_VERSION_0_2: - * Add support for flexible YCbCr format with (*lock_ycbcr)() method. - */ - -#define GRALLOC_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) -#define GRALLOC_MODULE_API_VERSION_0_2 HARDWARE_MODULE_API_VERSION(0, 2) - -#define GRALLOC_DEVICE_API_VERSION_0_1 HARDWARE_DEVICE_API_VERSION(0, 1) - -/** - * The id of this module - */ -#define GRALLOC_HARDWARE_MODULE_ID "gralloc" - -/** - * Name of the graphics device to open - */ - -#define GRALLOC_HARDWARE_GPU0 "gpu0" - -enum { - /* buffer is never read in software */ - GRALLOC_USAGE_SW_READ_NEVER = 0x00000000, - /* buffer is rarely read in software */ - GRALLOC_USAGE_SW_READ_RARELY = 0x00000002, - /* buffer is often read in software */ - GRALLOC_USAGE_SW_READ_OFTEN = 0x00000003, - /* mask for the software read values */ - GRALLOC_USAGE_SW_READ_MASK = 0x0000000F, - - /* buffer is never written in software */ - GRALLOC_USAGE_SW_WRITE_NEVER = 0x00000000, - /* buffer is rarely written in software */ - GRALLOC_USAGE_SW_WRITE_RARELY = 0x00000020, - /* buffer is often written in software */ - GRALLOC_USAGE_SW_WRITE_OFTEN = 0x00000030, - /* mask for the software write values */ - GRALLOC_USAGE_SW_WRITE_MASK = 0x000000F0, - - /* buffer will be used as an OpenGL ES texture */ - GRALLOC_USAGE_HW_TEXTURE = 0x00000100, - /* buffer will be used as an OpenGL ES render target */ - GRALLOC_USAGE_HW_RENDER = 0x00000200, - /* buffer will be used by the 2D hardware blitter */ - GRALLOC_USAGE_HW_2D = 0x00000400, - /* buffer will be used by the HWComposer HAL module */ - GRALLOC_USAGE_HW_COMPOSER = 0x00000800, - /* buffer will be used with the framebuffer device */ - GRALLOC_USAGE_HW_FB = 0x00001000, - /* buffer will be used with the HW video encoder */ - GRALLOC_USAGE_HW_VIDEO_ENCODER = 0x00010000, - /* buffer will be written by the HW camera pipeline */ - GRALLOC_USAGE_HW_CAMERA_WRITE = 0x00020000, - /* buffer will be read by the HW camera pipeline */ - GRALLOC_USAGE_HW_CAMERA_READ = 0x00040000, - /* buffer will be used as part of zero-shutter-lag queue */ - GRALLOC_USAGE_HW_CAMERA_ZSL = 0x00060000, - /* mask for the camera access values */ - GRALLOC_USAGE_HW_CAMERA_MASK = 0x00060000, - /* mask for the software usage bit-mask */ - GRALLOC_USAGE_HW_MASK = 0x00071F00, - - /* buffer will be used as a RenderScript Allocation */ - GRALLOC_USAGE_RENDERSCRIPT = 0x00100000, - - /* buffer should be displayed full-screen on an external display when - * possible - */ - GRALLOC_USAGE_EXTERNAL_DISP = 0x00002000, - - /* Must have a hardware-protected path to external display sink for - * this buffer. If a hardware-protected path is not available, then - * either don't composite only this buffer (preferred) to the - * external sink, or (less desirable) do not route the entire - * composition to the external sink. - */ - GRALLOC_USAGE_PROTECTED = 0x00004000, - - /* implementation-specific private usage flags */ - GRALLOC_USAGE_PRIVATE_0 = 0x10000000, - GRALLOC_USAGE_PRIVATE_1 = 0x20000000, - GRALLOC_USAGE_PRIVATE_2 = 0x40000000, - GRALLOC_USAGE_PRIVATE_3 = 0x80000000, - GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000, -}; - -/*****************************************************************************/ - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -typedef struct gralloc_module_t { - struct hw_module_t common; - - /* - * (*registerBuffer)() must be called before a buffer_handle_t that has not - * been created with (*alloc_device_t::alloc)() can be used. - * - * This is intended to be used with buffer_handle_t's that have been - * received in this process through IPC. - * - * This function checks that the handle is indeed a valid one and prepares - * it for use with (*lock)() and (*unlock)(). - * - * It is not necessary to call (*registerBuffer)() on a handle created - * with (*alloc_device_t::alloc)(). - * - * returns an error if this buffer_handle_t is not valid. - */ - int (*registerBuffer)(struct gralloc_module_t const* module, - buffer_handle_t handle); - - /* - * (*unregisterBuffer)() is called once this handle is no longer needed in - * this process. After this call, it is an error to call (*lock)(), - * (*unlock)(), or (*registerBuffer)(). - * - * This function doesn't close or free the handle itself; this is done - * by other means, usually through libcutils's native_handle_close() and - * native_handle_free(). - * - * It is an error to call (*unregisterBuffer)() on a buffer that wasn't - * explicitly registered first. - */ - int (*unregisterBuffer)(struct gralloc_module_t const* module, - buffer_handle_t handle); - - /* - * The (*lock)() method is called before a buffer is accessed for the - * specified usage. This call may block, for instance if the h/w needs - * to finish rendering or if CPU caches need to be synchronized. - * - * The caller promises to modify only pixels in the area specified - * by (l,t,w,h). - * - * The content of the buffer outside of the specified area is NOT modified - * by this call. - * - * If usage specifies GRALLOC_USAGE_SW_*, vaddr is filled with the address - * of the buffer in virtual memory. - * - * Note calling (*lock)() on HAL_PIXEL_FORMAT_YCbCr_*_888 buffers will fail - * and return -EINVAL. These buffers must be locked with (*lock_ycbcr)() - * instead. - * - * THREADING CONSIDERATIONS: - * - * It is legal for several different threads to lock a buffer from - * read access, none of the threads are blocked. - * - * However, locking a buffer simultaneously for write or read/write is - * undefined, but: - * - shall not result in termination of the process - * - shall not block the caller - * It is acceptable to return an error or to leave the buffer's content - * into an indeterminate state. - * - * If the buffer was created with a usage mask incompatible with the - * requested usage flags here, -EINVAL is returned. - * - */ - - int (*lock)(struct gralloc_module_t const* module, - buffer_handle_t handle, int usage, - int l, int t, int w, int h, - void** vaddr); - - - /* - * The (*unlock)() method must be called after all changes to the buffer - * are completed. - */ - - int (*unlock)(struct gralloc_module_t const* module, - buffer_handle_t handle); - - - /* reserved for future use */ - int (*perform)(struct gralloc_module_t const* module, - int operation, ... ); - - /* - * The (*lock_ycbcr)() method is like the (*lock)() method, with the - * difference that it fills a struct ycbcr with a description of the buffer - * layout, and zeroes out the reserved fields. - * - * This will only work on buffers with HAL_PIXEL_FORMAT_YCbCr_*_888, and - * will return -EINVAL on any other buffer formats. - * - * Added in GRALLOC_MODULE_API_VERSION_0_2. - */ - - int (*lock_ycbcr)(struct gralloc_module_t const* module, - buffer_handle_t handle, int usage, - int l, int t, int w, int h, - struct android_ycbcr *ycbcr); - - /* reserved for future use */ - void* reserved_proc[6]; -} gralloc_module_t; - -/*****************************************************************************/ - -/** - * Every device data structure must begin with hw_device_t - * followed by module specific public methods and attributes. - */ - -typedef struct alloc_device_t { - struct hw_device_t common; - - /* - * (*alloc)() Allocates a buffer in graphic memory with the requested - * parameters and returns a buffer_handle_t and the stride in pixels to - * allow the implementation to satisfy hardware constraints on the width - * of a pixmap (eg: it may have to be multiple of 8 pixels). - * The CALLER TAKES OWNERSHIP of the buffer_handle_t. - * - * If format is HAL_PIXEL_FORMAT_YCbCr_420_888, the returned stride must be - * 0, since the actual strides are available from the android_ycbcr - * structure. - * - * Returns 0 on success or -errno on error. - */ - - int (*alloc)(struct alloc_device_t* dev, - int w, int h, int format, int usage, - buffer_handle_t* handle, int* stride); - - /* - * (*free)() Frees a previously allocated buffer. - * Behavior is undefined if the buffer is still mapped in any process, - * but shall not result in termination of the program or security breaches - * (allowing a process to get access to another process' buffers). - * THIS FUNCTION TAKES OWNERSHIP of the buffer_handle_t which becomes - * invalid after the call. - * - * Returns 0 on success or -errno on error. - */ - int (*free)(struct alloc_device_t* dev, - buffer_handle_t handle); - - /* This hook is OPTIONAL. - * - * If non NULL it will be caused by SurfaceFlinger on dumpsys - */ - void (*dump)(struct alloc_device_t *dev, char *buff, int buff_len); - - void* reserved_proc[7]; -} alloc_device_t; - - -/** convenience API for opening and closing a supported device */ - -static inline int gralloc_open(const struct hw_module_t* module, - struct alloc_device_t** device) { - return module->methods->open(module, - GRALLOC_HARDWARE_GPU0, (struct hw_device_t**)device); -} - -static inline int gralloc_close(struct alloc_device_t* device) { - return device->common.close(&device->common); -} - -__END_DECLS - -#endif // ANDROID_GRALLOC_INTERFACE_H diff --git a/external/android/include/19/hardware/libhardware/include/hardware/hardware.h b/external/android/include/19/hardware/libhardware/include/hardware/hardware.h deleted file mode 100644 index 416ae39..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/hardware.h +++ /dev/null @@ -1,230 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_INCLUDE_HARDWARE_HARDWARE_H -#define ANDROID_INCLUDE_HARDWARE_HARDWARE_H - -#include -#include - -#include -#include - -__BEGIN_DECLS - -/* - * Value for the hw_module_t.tag field - */ - -#define MAKE_TAG_CONSTANT(A,B,C,D) (((A) << 24) | ((B) << 16) | ((C) << 8) | (D)) - -#define HARDWARE_MODULE_TAG MAKE_TAG_CONSTANT('H', 'W', 'M', 'T') -#define HARDWARE_DEVICE_TAG MAKE_TAG_CONSTANT('H', 'W', 'D', 'T') - -#define HARDWARE_MAKE_API_VERSION(maj,min) \ - ((((maj) & 0xff) << 8) | ((min) & 0xff)) - -#define HARDWARE_MAKE_API_VERSION_2(maj,min,hdr) \ - ((((maj) & 0xff) << 24) | (((min) & 0xff) << 16) | ((hdr) & 0xffff)) -#define HARDWARE_API_VERSION_2_MAJ_MIN_MASK 0xffff0000 -#define HARDWARE_API_VERSION_2_HEADER_MASK 0x0000ffff - - -/* - * The current HAL API version. - * - * All module implementations must set the hw_module_t.hal_api_version field - * to this value when declaring the module with HAL_MODULE_INFO_SYM. - * - * Note that previous implementations have always set this field to 0. - * Therefore, libhardware HAL API will always consider versions 0.0 and 1.0 - * to be 100% binary compatible. - * - */ -#define HARDWARE_HAL_API_VERSION HARDWARE_MAKE_API_VERSION(1, 0) - -/* - * Helper macros for module implementors. - * - * The derived modules should provide convenience macros for supported - * versions so that implementations can explicitly specify module/device - * versions at definition time. - * - * Use this macro to set the hw_module_t.module_api_version field. - */ -#define HARDWARE_MODULE_API_VERSION(maj,min) HARDWARE_MAKE_API_VERSION(maj,min) -#define HARDWARE_MODULE_API_VERSION_2(maj,min,hdr) HARDWARE_MAKE_API_VERSION_2(maj,min,hdr) - -/* - * Use this macro to set the hw_device_t.version field - */ -#define HARDWARE_DEVICE_API_VERSION(maj,min) HARDWARE_MAKE_API_VERSION(maj,min) -#define HARDWARE_DEVICE_API_VERSION_2(maj,min,hdr) HARDWARE_MAKE_API_VERSION_2(maj,min,hdr) - -struct hw_module_t; -struct hw_module_methods_t; -struct hw_device_t; - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -typedef struct hw_module_t { - /** tag must be initialized to HARDWARE_MODULE_TAG */ - uint32_t tag; - - /** - * The API version of the implemented module. The module owner is - * responsible for updating the version when a module interface has - * changed. - * - * The derived modules such as gralloc and audio own and manage this field. - * The module user must interpret the version field to decide whether or - * not to inter-operate with the supplied module implementation. - * For example, SurfaceFlinger is responsible for making sure that - * it knows how to manage different versions of the gralloc-module API, - * and AudioFlinger must know how to do the same for audio-module API. - * - * The module API version should include a major and a minor component. - * For example, version 1.0 could be represented as 0x0100. This format - * implies that versions 0x0100-0x01ff are all API-compatible. - * - * In the future, libhardware will expose a hw_get_module_version() - * (or equivalent) function that will take minimum/maximum supported - * versions as arguments and would be able to reject modules with - * versions outside of the supplied range. - */ - uint16_t module_api_version; -#define version_major module_api_version - /** - * version_major/version_minor defines are supplied here for temporary - * source code compatibility. They will be removed in the next version. - * ALL clients must convert to the new version format. - */ - - /** - * The API version of the HAL module interface. This is meant to - * version the hw_module_t, hw_module_methods_t, and hw_device_t - * structures and definitions. - * - * The HAL interface owns this field. Module users/implementations - * must NOT rely on this value for version information. - * - * Presently, 0 is the only valid value. - */ - uint16_t hal_api_version; -#define version_minor hal_api_version - - /** Identifier of module */ - const char *id; - - /** Name of this module */ - const char *name; - - /** Author/owner/implementor of the module */ - const char *author; - - /** Modules methods */ - struct hw_module_methods_t* methods; - - /** module's dso */ - void* dso; - - /** padding to 128 bytes, reserved for future use */ - uint32_t reserved[32-7]; - -} hw_module_t; - -typedef struct hw_module_methods_t { - /** Open a specific device */ - int (*open)(const struct hw_module_t* module, const char* id, - struct hw_device_t** device); - -} hw_module_methods_t; - -/** - * Every device data structure must begin with hw_device_t - * followed by module specific public methods and attributes. - */ -typedef struct hw_device_t { - /** tag must be initialized to HARDWARE_DEVICE_TAG */ - uint32_t tag; - - /** - * Version of the module-specific device API. This value is used by - * the derived-module user to manage different device implementations. - * - * The module user is responsible for checking the module_api_version - * and device version fields to ensure that the user is capable of - * communicating with the specific module implementation. - * - * One module can support multiple devices with different versions. This - * can be useful when a device interface changes in an incompatible way - * but it is still necessary to support older implementations at the same - * time. One such example is the Camera 2.0 API. - * - * This field is interpreted by the module user and is ignored by the - * HAL interface itself. - */ - uint32_t version; - - /** reference to the module this device belongs to */ - struct hw_module_t* module; - - /** padding reserved for future use */ - uint32_t reserved[12]; - - /** Close this device */ - int (*close)(struct hw_device_t* device); - -} hw_device_t; - -/** - * Name of the hal_module_info - */ -#define HAL_MODULE_INFO_SYM HMI - -/** - * Name of the hal_module_info as a string - */ -#define HAL_MODULE_INFO_SYM_AS_STR "HMI" - -/** - * Get the module info associated with a module by id. - * - * @return: 0 == success, <0 == error and *module == NULL - */ -int hw_get_module(const char *id, const struct hw_module_t **module); - -/** - * Get the module info associated with a module instance by class 'class_id' - * and instance 'inst'. - * - * Some modules types necessitate multiple instances. For example audio supports - * multiple concurrent interfaces and thus 'audio' is the module class - * and 'primary' or 'a2dp' are module interfaces. This implies that the files - * providing these modules would be named audio.primary..so and - * audio.a2dp..so - * - * @return: 0 == success, <0 == error and *module == NULL - */ -int hw_get_module_by_class(const char *class_id, const char *inst, - const struct hw_module_t **module); - -__END_DECLS - -#endif /* ANDROID_INCLUDE_HARDWARE_HARDWARE_H */ diff --git a/external/android/include/19/hardware/libhardware/include/hardware/hwcomposer.h b/external/android/include/19/hardware/libhardware/include/hardware/hwcomposer.h deleted file mode 100644 index 846bab4..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/hwcomposer.h +++ /dev/null @@ -1,633 +0,0 @@ -/* - * Copyright (C) 2010 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_INCLUDE_HARDWARE_HWCOMPOSER_H -#define ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_H - -#include -#include - -#include -#include -#include - -#include - -__BEGIN_DECLS - -/*****************************************************************************/ - -/* for compatibility */ -#define HWC_MODULE_API_VERSION HWC_MODULE_API_VERSION_0_1 -#define HWC_DEVICE_API_VERSION HWC_DEVICE_API_VERSION_0_1 -#define HWC_API_VERSION HWC_DEVICE_API_VERSION - -/*****************************************************************************/ - -/** - * The id of this module - */ -#define HWC_HARDWARE_MODULE_ID "hwcomposer" - -/** - * Name of the sensors device to open - */ -#define HWC_HARDWARE_COMPOSER "composer" - -typedef struct hwc_rect { - int left; - int top; - int right; - int bottom; -} hwc_rect_t; - -typedef struct hwc_frect { - float left; - float top; - float right; - float bottom; -} hwc_frect_t; - -typedef struct hwc_region { - size_t numRects; - hwc_rect_t const* rects; -} hwc_region_t; - -typedef struct hwc_color { - uint8_t r; - uint8_t g; - uint8_t b; - uint8_t a; -} hwc_color_t; - -typedef struct hwc_layer_1 { - /* - * compositionType is used to specify this layer's type and is set by either - * the hardware composer implementation, or by the caller (see below). - * - * This field is always reset to HWC_BACKGROUND or HWC_FRAMEBUFFER - * before (*prepare)() is called when the HWC_GEOMETRY_CHANGED flag is - * also set, otherwise, this field is preserved between (*prepare)() - * calls. - * - * HWC_BACKGROUND - * Always set by the caller before calling (*prepare)(), this value - * indicates this is a special "background" layer. The only valid field - * is backgroundColor. - * The HWC can toggle this value to HWC_FRAMEBUFFER to indicate it CANNOT - * handle the background color. - * - * - * HWC_FRAMEBUFFER_TARGET - * Always set by the caller before calling (*prepare)(), this value - * indicates this layer is the framebuffer surface used as the target of - * OpenGL ES composition. If the HWC sets all other layers to HWC_OVERLAY - * or HWC_BACKGROUND, then no OpenGL ES composition will be done, and - * this layer should be ignored during set(). - * - * This flag (and the framebuffer surface layer) will only be used if the - * HWC version is HWC_DEVICE_API_VERSION_1_1 or higher. In older versions, - * the OpenGL ES target surface is communicated by the (dpy, sur) fields - * in hwc_compositor_device_1_t. - * - * This value cannot be set by the HWC implementation. - * - * - * HWC_FRAMEBUFFER - * Set by the caller before calling (*prepare)() ONLY when the - * HWC_GEOMETRY_CHANGED flag is also set. - * - * Set by the HWC implementation during (*prepare)(), this indicates - * that the layer will be drawn into the framebuffer using OpenGL ES. - * The HWC can toggle this value to HWC_OVERLAY to indicate it will - * handle the layer. - * - * - * HWC_OVERLAY - * Set by the HWC implementation during (*prepare)(), this indicates - * that the layer will be handled by the HWC (ie: it must not be - * composited with OpenGL ES). - * - */ - int32_t compositionType; - - /* - * hints is bit mask set by the HWC implementation during (*prepare)(). - * It is preserved between (*prepare)() calls, unless the - * HWC_GEOMETRY_CHANGED flag is set, in which case it is reset to 0. - * - * see hwc_layer_t::hints - */ - uint32_t hints; - - /* see hwc_layer_t::flags */ - uint32_t flags; - - union { - /* color of the background. hwc_color_t.a is ignored */ - hwc_color_t backgroundColor; - - struct { - /* handle of buffer to compose. This handle is guaranteed to have been - * allocated from gralloc using the GRALLOC_USAGE_HW_COMPOSER usage flag. If - * the layer's handle is unchanged across two consecutive prepare calls and - * the HWC_GEOMETRY_CHANGED flag is not set for the second call then the - * HWComposer implementation may assume that the contents of the buffer have - * not changed. */ - buffer_handle_t handle; - - /* transformation to apply to the buffer during composition */ - uint32_t transform; - - /* blending to apply during composition */ - int32_t blending; - - /* area of the source to consider, the origin is the top-left corner of - * the buffer. As of HWC_DEVICE_API_VERSION_1_3, sourceRect uses floats. - * If the h/w can't support a non-integer source crop rectangle, it should - * punt to OpenGL ES composition. - */ - union { - // crop rectangle in integer (pre HWC_DEVICE_API_VERSION_1_3) - hwc_rect_t sourceCropi; - hwc_rect_t sourceCrop; // just for source compatibility - // crop rectangle in floats (as of HWC_DEVICE_API_VERSION_1_3) - hwc_frect_t sourceCropf; - }; - - /* where to composite the sourceCrop onto the display. The sourceCrop - * is scaled using linear filtering to the displayFrame. The origin is the - * top-left corner of the screen. - */ - hwc_rect_t displayFrame; - - /* visible region in screen space. The origin is the - * top-left corner of the screen. - * The visible region INCLUDES areas overlapped by a translucent layer. - */ - hwc_region_t visibleRegionScreen; - - /* Sync fence object that will be signaled when the buffer's - * contents are available. May be -1 if the contents are already - * available. This field is only valid during set(), and should be - * ignored during prepare(). The set() call must not wait for the - * fence to be signaled before returning, but the HWC must wait for - * all buffers to be signaled before reading from them. - * - * HWC_FRAMEBUFFER layers will never have an acquire fence, since - * reads from them are complete before the framebuffer is ready for - * display. - * - * The HWC takes ownership of the acquireFenceFd and is responsible - * for closing it when no longer needed. - */ - int acquireFenceFd; - - /* During set() the HWC must set this field to a file descriptor for - * a sync fence object that will signal after the HWC has finished - * reading from the buffer. The field is ignored by prepare(). Each - * layer should have a unique file descriptor, even if more than one - * refer to the same underlying fence object; this allows each to be - * closed independently. - * - * If buffer reads can complete at significantly different times, - * then using independent fences is preferred. For example, if the - * HWC handles some layers with a blit engine and others with - * overlays, then the blit layers can be reused immediately after - * the blit completes, but the overlay layers can't be reused until - * a subsequent frame has been displayed. - * - * Since HWC doesn't read from HWC_FRAMEBUFFER layers, it shouldn't - * produce a release fence for them. The releaseFenceFd will be -1 - * for these layers when set() is called. - * - * The HWC client taks ownership of the releaseFenceFd and is - * responsible for closing it when no longer needed. - */ - int releaseFenceFd; - - /* - * Availability: HWC_DEVICE_API_VERSION_1_2 - * - * Alpha value applied to the whole layer. The effective - * value of each pixel is computed as: - * - * if (blending == HWC_BLENDING_PREMULT) - * pixel.rgb = pixel.rgb * planeAlpha / 255 - * pixel.a = pixel.a * planeAlpha / 255 - * - * Then blending proceeds as usual according to the "blending" - * field above. - * - * NOTE: planeAlpha applies to YUV layers as well: - * - * pixel.rgb = yuv_to_rgb(pixel.yuv) - * if (blending == HWC_BLENDING_PREMULT) - * pixel.rgb = pixel.rgb * planeAlpha / 255 - * pixel.a = planeAlpha - * - * - * IMPLEMENTATION NOTE: - * - * If the source image doesn't have an alpha channel, then - * the h/w can use the HWC_BLENDING_COVERAGE equations instead of - * HWC_BLENDING_PREMULT and simply set the alpha channel to - * planeAlpha. - * - * e.g.: - * - * if (blending == HWC_BLENDING_PREMULT) - * blending = HWC_BLENDING_COVERAGE; - * pixel.a = planeAlpha; - * - */ - uint8_t planeAlpha; - - /* reserved for future use */ - uint8_t _pad[3]; - }; - }; - - /* Allow for expansion w/o breaking binary compatibility. - * Pad layer to 96 bytes, assuming 32-bit pointers. - */ - int32_t reserved[24 - 19]; - -} hwc_layer_1_t; - -/* This represents a display, typically an EGLDisplay object */ -typedef void* hwc_display_t; - -/* This represents a surface, typically an EGLSurface object */ -typedef void* hwc_surface_t; - -/* - * hwc_display_contents_1_t::flags values - */ -enum { - /* - * HWC_GEOMETRY_CHANGED is set by SurfaceFlinger to indicate that the list - * passed to (*prepare)() has changed by more than just the buffer handles - * and acquire fences. - */ - HWC_GEOMETRY_CHANGED = 0x00000001, -}; - -/* - * Description of the contents to output on a display. - * - * This is the top-level structure passed to the prepare and set calls to - * negotiate and commit the composition of a display image. - */ -typedef struct hwc_display_contents_1 { - /* File descriptor referring to a Sync HAL fence object which will signal - * when this composition is retired. For a physical display, a composition - * is retired when it has been replaced on-screen by a subsequent set. For - * a virtual display, the composition is retired when the writes to - * outputBuffer are complete and can be read. The fence object is created - * and returned by the set call; this field will be -1 on entry to prepare - * and set. SurfaceFlinger will close the returned file descriptor. - */ - int retireFenceFd; - - union { - /* Fields only relevant for HWC_DEVICE_VERSION_1_0. */ - struct { - /* (dpy, sur) is the target of SurfaceFlinger's OpenGL ES - * composition for HWC_DEVICE_VERSION_1_0. They aren't relevant to - * prepare. The set call should commit this surface atomically to - * the display along with any overlay layers. - */ - hwc_display_t dpy; - hwc_surface_t sur; - }; - - /* WARNING: These fields are for experimental virtual display support, - * and are not currently used. */ - struct { - /* outbuf is the buffer that receives the composed image for - * virtual displays. Writes to the outbuf must wait until - * outbufAcquireFenceFd signals. A fence that will signal when - * writes to outbuf are complete should be returned in - * retireFenceFd. - * - * This field will not be updated until after prepare(). If - * prepare() sets all non-FB layers to OVERLAY or sets all non-FB - * layers to FRAMEBUFFER, then the FRAMEBUFFER_TARGET buffer and - * the output buffer may be the same. In mixed OVERLAY/FRAMEBUFFER - * configurations they will have different buffers so the - * h/w composer does not have to read and write the same buffer. - * - * For physical displays, outbuf will be NULL. - */ - buffer_handle_t outbuf; - - /* File descriptor for a fence that will signal when outbuf is - * ready to be written. The h/w composer is responsible for closing - * this when no longer needed. - * - * Will be -1 whenever outbuf is NULL, or when the outbuf can be - * written immediately. - */ - int outbufAcquireFenceFd; - }; - }; - - /* List of layers that will be composed on the display. The buffer handles - * in the list will be unique. If numHwLayers is 0, all composition will be - * performed by SurfaceFlinger. - */ - uint32_t flags; - size_t numHwLayers; - hwc_layer_1_t hwLayers[0]; - -} hwc_display_contents_1_t; - -/* see hwc_composer_device::registerProcs() - * All of the callbacks are required and non-NULL unless otherwise noted. - */ -typedef struct hwc_procs { - /* - * (*invalidate)() triggers a screen refresh, in particular prepare and set - * will be called shortly after this call is made. Note that there is - * NO GUARANTEE that the screen refresh will happen after invalidate() - * returns (in particular, it could happen before). - * invalidate() is GUARANTEED TO NOT CALL BACK into the h/w composer HAL and - * it is safe to call invalidate() from any of hwc_composer_device - * hooks, unless noted otherwise. - */ - void (*invalidate)(const struct hwc_procs* procs); - - /* - * (*vsync)() is called by the h/w composer HAL when a vsync event is - * received and HWC_EVENT_VSYNC is enabled on a display - * (see: hwc_event_control). - * - * the "disp" parameter indicates which display the vsync event is for. - * the "timestamp" parameter is the system monotonic clock timestamp in - * nanosecond of when the vsync event happened. - * - * vsync() is GUARANTEED TO NOT CALL BACK into the h/w composer HAL. - * - * It is expected that vsync() is called from a thread of at least - * HAL_PRIORITY_URGENT_DISPLAY with as little latency as possible, - * typically less than 0.5 ms. - * - * It is a (silent) error to have HWC_EVENT_VSYNC enabled when calling - * hwc_composer_device.set(..., 0, 0, 0) (screen off). The implementation - * can either stop or continue to process VSYNC events, but must not - * crash or cause other problems. - */ - void (*vsync)(const struct hwc_procs* procs, int disp, int64_t timestamp); - - /* - * (*hotplug)() is called by the h/w composer HAL when a display is - * connected or disconnected. The PRIMARY display is always connected and - * the hotplug callback should not be called for it. - * - * The disp parameter indicates which display type this event is for. - * The connected parameter indicates whether the display has just been - * connected (1) or disconnected (0). - * - * The hotplug() callback may call back into the h/w composer on the same - * thread to query refresh rate and dpi for the display. Additionally, - * other threads may be calling into the h/w composer while the callback - * is in progress. - * - * The h/w composer must serialize calls to the hotplug callback; only - * one thread may call it at a time. - * - * This callback will be NULL if the h/w composer is using - * HWC_DEVICE_API_VERSION_1_0. - */ - void (*hotplug)(const struct hwc_procs* procs, int disp, int connected); - -} hwc_procs_t; - - -/*****************************************************************************/ - -typedef struct hwc_module { - struct hw_module_t common; -} hwc_module_t; - -typedef struct hwc_composer_device_1 { - struct hw_device_t common; - - /* - * (*prepare)() is called for each frame before composition and is used by - * SurfaceFlinger to determine what composition steps the HWC can handle. - * - * (*prepare)() can be called more than once, the last call prevails. - * - * The HWC responds by setting the compositionType field in each layer to - * either HWC_FRAMEBUFFER or HWC_OVERLAY. In the former case, the - * composition for the layer is handled by SurfaceFlinger with OpenGL ES, - * in the later case, the HWC will have to handle the layer's composition. - * compositionType and hints are preserved between (*prepare)() calles - * unless the HWC_GEOMETRY_CHANGED flag is set. - * - * (*prepare)() is called with HWC_GEOMETRY_CHANGED to indicate that the - * list's geometry has changed, that is, when more than just the buffer's - * handles have been updated. Typically this happens (but is not limited to) - * when a window is added, removed, resized or moved. In this case - * compositionType and hints are reset to their default value. - * - * For HWC 1.0, numDisplays will always be one, and displays[0] will be - * non-NULL. - * - * For HWC 1.1, numDisplays will always be HWC_NUM_PHYSICAL_DISPLAY_TYPES. - * Entries for unsupported or disabled/disconnected display types will be - * NULL. - * - * In HWC 1.3, numDisplays may be up to HWC_NUM_DISPLAY_TYPES. The extra - * entries correspond to enabled virtual displays, and will be non-NULL. - * - * returns: 0 on success. An negative error code on error. If an error is - * returned, SurfaceFlinger will assume that none of the layer will be - * handled by the HWC. - */ - int (*prepare)(struct hwc_composer_device_1 *dev, - size_t numDisplays, hwc_display_contents_1_t** displays); - - /* - * (*set)() is used in place of eglSwapBuffers(), and assumes the same - * functionality, except it also commits the work list atomically with - * the actual eglSwapBuffers(). - * - * The layer lists are guaranteed to be the same as the ones returned from - * the last call to (*prepare)(). - * - * When this call returns the caller assumes that the displays will be - * updated in the near future with the content of their work lists, without - * artifacts during the transition from the previous frame. - * - * A display with zero layers indicates that the entire composition has - * been handled by SurfaceFlinger with OpenGL ES. In this case, (*set)() - * behaves just like eglSwapBuffers(). - * - * For HWC 1.0, numDisplays will always be one, and displays[0] will be - * non-NULL. - * - * For HWC 1.1, numDisplays will always be HWC_NUM_PHYSICAL_DISPLAY_TYPES. - * Entries for unsupported or disabled/disconnected display types will be - * NULL. - * - * In HWC 1.3, numDisplays may be up to HWC_NUM_DISPLAY_TYPES. The extra - * entries correspond to enabled virtual displays, and will be non-NULL. - * - * IMPORTANT NOTE: There is an implicit layer containing opaque black - * pixels behind all the layers in the list. It is the responsibility of - * the hwcomposer module to make sure black pixels are output (or blended - * from). - * - * IMPORTANT NOTE: In the event of an error this call *MUST* still cause - * any fences returned in the previous call to set to eventually become - * signaled. The caller may have already issued wait commands on these - * fences, and having set return without causing those fences to signal - * will likely result in a deadlock. - * - * returns: 0 on success. A negative error code on error: - * HWC_EGL_ERROR: eglGetError() will provide the proper error code (only - * allowed prior to HWComposer 1.1) - * Another code for non EGL errors. - */ - int (*set)(struct hwc_composer_device_1 *dev, - size_t numDisplays, hwc_display_contents_1_t** displays); - - /* - * eventControl(..., event, enabled) - * Enables or disables h/w composer events for a display. - * - * eventControl can be called from any thread and takes effect - * immediately. - * - * Supported events are: - * HWC_EVENT_VSYNC - * - * returns -EINVAL if the "event" parameter is not one of the value above - * or if the "enabled" parameter is not 0 or 1. - */ - int (*eventControl)(struct hwc_composer_device_1* dev, int disp, - int event, int enabled); - - /* - * blank(..., blank) - * Blanks or unblanks a display's screen. - * - * Turns the screen off when blank is nonzero, on when blank is zero. - * Multiple sequential calls with the same blank value must be supported. - * The screen state transition must be be complete when the function - * returns. - * - * returns 0 on success, negative on error. - */ - int (*blank)(struct hwc_composer_device_1* dev, int disp, int blank); - - /* - * Used to retrieve information about the h/w composer - * - * Returns 0 on success or -errno on error. - */ - int (*query)(struct hwc_composer_device_1* dev, int what, int* value); - - /* - * (*registerProcs)() registers callbacks that the h/w composer HAL can - * later use. It will be called immediately after the composer device is - * opened with non-NULL procs. It is FORBIDDEN to call any of the callbacks - * from within registerProcs(). registerProcs() must save the hwc_procs_t - * pointer which is needed when calling a registered callback. - */ - void (*registerProcs)(struct hwc_composer_device_1* dev, - hwc_procs_t const* procs); - - /* - * This field is OPTIONAL and can be NULL. - * - * If non NULL it will be called by SurfaceFlinger on dumpsys - */ - void (*dump)(struct hwc_composer_device_1* dev, char *buff, int buff_len); - - /* - * (*getDisplayConfigs)() returns handles for the configurations available - * on the connected display. These handles must remain valid as long as the - * display is connected. - * - * Configuration handles are written to configs. The number of entries - * allocated by the caller is passed in *numConfigs; getDisplayConfigs must - * not try to write more than this number of config handles. On return, the - * total number of configurations available for the display is returned in - * *numConfigs. If *numConfigs is zero on entry, then configs may be NULL. - * - * HWC_DEVICE_API_VERSION_1_1 does not provide a way to choose a config. - * For displays that support multiple configurations, the h/w composer - * implementation should choose one and report it as the first config in - * the list. Reporting the not-chosen configs is not required. - * - * Returns 0 on success or -errno on error. If disp is a hotpluggable - * display type and no display is connected, an error should be returned. - * - * This field is REQUIRED for HWC_DEVICE_API_VERSION_1_1 and later. - * It should be NULL for previous versions. - */ - int (*getDisplayConfigs)(struct hwc_composer_device_1* dev, int disp, - uint32_t* configs, size_t* numConfigs); - - /* - * (*getDisplayAttributes)() returns attributes for a specific config of a - * connected display. The config parameter is one of the config handles - * returned by getDisplayConfigs. - * - * The list of attributes to return is provided in the attributes - * parameter, terminated by HWC_DISPLAY_NO_ATTRIBUTE. The value for each - * requested attribute is written in order to the values array. The - * HWC_DISPLAY_NO_ATTRIBUTE attribute does not have a value, so the values - * array will have one less value than the attributes array. - * - * This field is REQUIRED for HWC_DEVICE_API_VERSION_1_1 and later. - * It should be NULL for previous versions. - * - * If disp is a hotpluggable display type and no display is connected, - * or if config is not a valid configuration for the display, a negative - * value should be returned. - */ - int (*getDisplayAttributes)(struct hwc_composer_device_1* dev, int disp, - uint32_t config, const uint32_t* attributes, int32_t* values); - - /* - * Reserved for future use. Must be NULL. - */ - void* reserved_proc[4]; - -} hwc_composer_device_1_t; - -/** convenience API for opening and closing a device */ - -static inline int hwc_open_1(const struct hw_module_t* module, - hwc_composer_device_1_t** device) { - return module->methods->open(module, - HWC_HARDWARE_COMPOSER, (struct hw_device_t**)device); -} - -static inline int hwc_close_1(hwc_composer_device_1_t* device) { - return device->common.close(&device->common); -} - -/*****************************************************************************/ - -__END_DECLS - -#endif /* ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_H */ diff --git a/external/android/include/19/hardware/libhardware/include/hardware/hwcomposer_defs.h b/external/android/include/19/hardware/libhardware/include/hardware/hwcomposer_defs.h deleted file mode 100644 index c69a4bc..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/hwcomposer_defs.h +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright (C) 2010 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_INCLUDE_HARDWARE_HWCOMPOSER_DEFS_H -#define ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_DEFS_H - -#include -#include - -#include -#include -#include - -__BEGIN_DECLS - -/*****************************************************************************/ - -#define HWC_HEADER_VERSION 1 - -#define HWC_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) - -#define HWC_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION_2(1, 0, HWC_HEADER_VERSION) -#define HWC_DEVICE_API_VERSION_1_1 HARDWARE_DEVICE_API_VERSION_2(1, 1, HWC_HEADER_VERSION) -#define HWC_DEVICE_API_VERSION_1_2 HARDWARE_DEVICE_API_VERSION_2(1, 2, HWC_HEADER_VERSION) -#define HWC_DEVICE_API_VERSION_1_3 HARDWARE_DEVICE_API_VERSION_2(1, 3, HWC_HEADER_VERSION) - -enum { - /* hwc_composer_device_t::set failed in EGL */ - HWC_EGL_ERROR = -1 -}; - -/* - * hwc_layer_t::hints values - * Hints are set by the HAL and read by SurfaceFlinger - */ -enum { - /* - * HWC can set the HWC_HINT_TRIPLE_BUFFER hint to indicate to SurfaceFlinger - * that it should triple buffer this layer. Typically HWC does this when - * the layer will be unavailable for use for an extended period of time, - * e.g. if the display will be fetching data directly from the layer and - * the layer can not be modified until after the next set(). - */ - HWC_HINT_TRIPLE_BUFFER = 0x00000001, - - /* - * HWC sets HWC_HINT_CLEAR_FB to tell SurfaceFlinger that it should clear the - * framebuffer with transparent pixels where this layer would be. - * SurfaceFlinger will only honor this flag when the layer has no blending - * - */ - HWC_HINT_CLEAR_FB = 0x00000002 -}; - -/* - * hwc_layer_t::flags values - * Flags are set by SurfaceFlinger and read by the HAL - */ -enum { - /* - * HWC_SKIP_LAYER is set by SurfaceFlnger to indicate that the HAL - * shall not consider this layer for composition as it will be handled - * by SurfaceFlinger (just as if compositionType was set to HWC_OVERLAY). - */ - HWC_SKIP_LAYER = 0x00000001, -}; - -/* - * hwc_layer_t::compositionType values - */ -enum { - /* this layer is to be drawn into the framebuffer by SurfaceFlinger */ - HWC_FRAMEBUFFER = 0, - - /* this layer will be handled in the HWC */ - HWC_OVERLAY = 1, - - /* this is the background layer. it's used to set the background color. - * there is only a single background layer */ - HWC_BACKGROUND = 2, - - /* this layer holds the result of compositing the HWC_FRAMEBUFFER layers. - * Added in HWC_DEVICE_API_VERSION_1_1. */ - HWC_FRAMEBUFFER_TARGET = 3, -}; - -/* - * hwc_layer_t::blending values - */ -enum { - /* no blending */ - HWC_BLENDING_NONE = 0x0100, - - /* ONE / ONE_MINUS_SRC_ALPHA */ - HWC_BLENDING_PREMULT = 0x0105, - - /* SRC_ALPHA / ONE_MINUS_SRC_ALPHA */ - HWC_BLENDING_COVERAGE = 0x0405 -}; - -/* - * hwc_layer_t::transform values - */ -enum { - /* flip source image horizontally */ - HWC_TRANSFORM_FLIP_H = HAL_TRANSFORM_FLIP_H, - /* flip source image vertically */ - HWC_TRANSFORM_FLIP_V = HAL_TRANSFORM_FLIP_V, - /* rotate source image 90 degrees clock-wise */ - HWC_TRANSFORM_ROT_90 = HAL_TRANSFORM_ROT_90, - /* rotate source image 180 degrees */ - HWC_TRANSFORM_ROT_180 = HAL_TRANSFORM_ROT_180, - /* rotate source image 270 degrees clock-wise */ - HWC_TRANSFORM_ROT_270 = HAL_TRANSFORM_ROT_270, -}; - -/* attributes queriable with query() */ -enum { - /* - * Must return 1 if the background layer is supported, 0 otherwise. - */ - HWC_BACKGROUND_LAYER_SUPPORTED = 0, - - /* - * Returns the vsync period in nanoseconds. - * - * This query is not used for HWC_DEVICE_API_VERSION_1_1 and later. - * Instead, the per-display attribute HWC_DISPLAY_VSYNC_PERIOD is used. - */ - HWC_VSYNC_PERIOD = 1, - - /* - * Availability: HWC_DEVICE_API_VERSION_1_1 - * Returns a mask of supported display types. - */ - HWC_DISPLAY_TYPES_SUPPORTED = 2, -}; - -/* display attributes returned by getDisplayAttributes() */ -enum { - /* Indicates the end of an attribute list */ - HWC_DISPLAY_NO_ATTRIBUTE = 0, - - /* The vsync period in nanoseconds */ - HWC_DISPLAY_VSYNC_PERIOD = 1, - - /* The number of pixels in the horizontal and vertical directions. */ - HWC_DISPLAY_WIDTH = 2, - HWC_DISPLAY_HEIGHT = 3, - - /* The number of pixels per thousand inches of this configuration. - * - * Scaling DPI by 1000 allows it to be stored in an int without losing - * too much precision. - * - * If the DPI for a configuration is unavailable or the HWC implementation - * considers it unreliable, it should set these attributes to zero. - */ - HWC_DISPLAY_DPI_X = 4, - HWC_DISPLAY_DPI_Y = 5, -}; - -/* Allowed events for hwc_methods::eventControl() */ -enum { - HWC_EVENT_VSYNC = 0 -}; - -/* Display types and associated mask bits. */ -enum { - HWC_DISPLAY_PRIMARY = 0, - HWC_DISPLAY_EXTERNAL = 1, // HDMI, DP, etc. - HWC_DISPLAY_VIRTUAL = 2, - - HWC_NUM_PHYSICAL_DISPLAY_TYPES = 2, - HWC_NUM_DISPLAY_TYPES = 3, -}; - -enum { - HWC_DISPLAY_PRIMARY_BIT = 1 << HWC_DISPLAY_PRIMARY, - HWC_DISPLAY_EXTERNAL_BIT = 1 << HWC_DISPLAY_EXTERNAL, - HWC_DISPLAY_VIRTUAL_BIT = 1 << HWC_DISPLAY_VIRTUAL, -}; - -/*****************************************************************************/ - -__END_DECLS - -#endif /* ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_DEFS_H */ diff --git a/external/android/include/19/hardware/libhardware/include/hardware/keymaster.h b/external/android/include/19/hardware/libhardware/include/hardware/keymaster.h deleted file mode 100644 index 6752146..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/keymaster.h +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Copyright (C) 2011 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_HARDWARE_KEYMASTER_H -#define ANDROID_HARDWARE_KEYMASTER_H - -#include -#include -#include - -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define KEYSTORE_HARDWARE_MODULE_ID "keystore" - -#define KEYSTORE_KEYMASTER "keymaster" - -/** - * Settings for "module_api_version" and "hal_api_version" - * fields in the keymaster_module initialization. - */ -#define KEYMASTER_HEADER_VERSION 2 - -#define KEYMASTER_MODULE_API_VERSION_0_2 HARDWARE_MODULE_API_VERSION(0, 2) -#define KEYMASTER_DEVICE_API_VERSION_0_2 HARDWARE_DEVICE_API_VERSION_2(0, 2, KEYMASTER_HEADER_VERSION) - -/** - * Flags for keymaster_device::flags - */ -enum { - /* - * Indicates this keymaster implementation does not have hardware that - * keeps private keys out of user space. - * - * This should not be implemented on anything other than the default - * implementation. - */ - KEYMASTER_SOFTWARE_ONLY = 0x00000001, -}; - -struct keystore_module { - hw_module_t common; -}; - -/** - * Asymmetric key pair types. - */ -typedef enum { - TYPE_RSA = 1, - TYPE_DSA = 2, - TYPE_EC = 3, -} keymaster_keypair_t; - -/** - * Parameters needed to generate an RSA key. - */ -typedef struct { - uint32_t modulus_size; - uint64_t public_exponent; -} keymaster_rsa_keygen_params_t; - -/** - * Parameters needed to generate a DSA key. - */ -typedef struct { - uint32_t key_size; - uint32_t generator_len; - uint32_t prime_p_len; - uint32_t prime_q_len; - const uint8_t* generator; - const uint8_t* prime_p; - const uint8_t* prime_q; -} keymaster_dsa_keygen_params_t; - -/** - * Parameters needed to generate an EC key. - * - * Field size is the only parameter in version 2. The sizes correspond to these required curves: - * - * 192 = NIST P-192 - * 224 = NIST P-224 - * 256 = NIST P-256 - * 384 = NIST P-384 - * 521 = NIST P-521 - * - * The parameters for these curves are available at: http://www.nsa.gov/ia/_files/nist-routines.pdf - * in Chapter 4. - */ -typedef struct { - uint32_t field_size; -} keymaster_ec_keygen_params_t; - -/** - * Digest type. - */ -typedef enum { - DIGEST_NONE, -} keymaster_digest_t; - -/** - * Type of padding used for RSA operations. - */ -typedef enum { - PADDING_NONE, -} keymaster_rsa_padding_t; - - -typedef struct { - keymaster_digest_t digest_type; -} keymaster_dsa_sign_params_t; - -typedef struct { - keymaster_digest_t digest_type; -} keymaster_ec_sign_params_t; - -typedef struct { - keymaster_digest_t digest_type; - keymaster_rsa_padding_t padding_type; -} keymaster_rsa_sign_params_t; - -/** - * The parameters that can be set for a given keymaster implementation. - */ -struct keymaster_device { - struct hw_device_t common; - - /** - * THIS IS DEPRECATED. Use the new "module_api_version" and "hal_api_version" - * fields in the keymaster_module initialization instead. - */ - uint32_t client_version; - - /** - * See flags defined for keymaster_device::flags above. - */ - uint32_t flags; - - void* context; - - /** - * Generates a public and private key. The key-blob returned is opaque - * and must subsequently provided for signing and verification. - * - * Returns: 0 on success or an error code less than 0. - */ - int (*generate_keypair)(const struct keymaster_device* dev, - const keymaster_keypair_t key_type, const void* key_params, - uint8_t** key_blob, size_t* key_blob_length); - - /** - * Imports a public and private key pair. The imported keys will be in - * PKCS#8 format with DER encoding (Java standard). The key-blob - * returned is opaque and will be subsequently provided for signing - * and verification. - * - * Returns: 0 on success or an error code less than 0. - */ - int (*import_keypair)(const struct keymaster_device* dev, - const uint8_t* key, const size_t key_length, - uint8_t** key_blob, size_t* key_blob_length); - - /** - * Gets the public key part of a key pair. The public key must be in - * X.509 format (Java standard) encoded byte array. - * - * Returns: 0 on success or an error code less than 0. - * On error, x509_data should not be allocated. - */ - int (*get_keypair_public)(const struct keymaster_device* dev, - const uint8_t* key_blob, const size_t key_blob_length, - uint8_t** x509_data, size_t* x509_data_length); - - /** - * Deletes the key pair associated with the key blob. - * - * This function is optional and should be set to NULL if it is not - * implemented. - * - * Returns 0 on success or an error code less than 0. - */ - int (*delete_keypair)(const struct keymaster_device* dev, - const uint8_t* key_blob, const size_t key_blob_length); - - /** - * Deletes all keys in the hardware keystore. Used when keystore is - * reset completely. - * - * This function is optional and should be set to NULL if it is not - * implemented. - * - * Returns 0 on success or an error code less than 0. - */ - int (*delete_all)(const struct keymaster_device* dev); - - /** - * Signs data using a key-blob generated before. This can use either - * an asymmetric key or a secret key. - * - * Returns: 0 on success or an error code less than 0. - */ - int (*sign_data)(const struct keymaster_device* dev, - const void* signing_params, - const uint8_t* key_blob, const size_t key_blob_length, - const uint8_t* data, const size_t data_length, - uint8_t** signed_data, size_t* signed_data_length); - - /** - * Verifies data signed with a key-blob. This can use either - * an asymmetric key or a secret key. - * - * Returns: 0 on successful verification or an error code less than 0. - */ - int (*verify_data)(const struct keymaster_device* dev, - const void* signing_params, - const uint8_t* key_blob, const size_t key_blob_length, - const uint8_t* signed_data, const size_t signed_data_length, - const uint8_t* signature, const size_t signature_length); -}; -typedef struct keymaster_device keymaster_device_t; - - -/* Convenience API for opening and closing keymaster devices */ - -static inline int keymaster_open(const struct hw_module_t* module, - keymaster_device_t** device) -{ - int rc = module->methods->open(module, KEYSTORE_KEYMASTER, - (struct hw_device_t**) device); - - return rc; -} - -static inline int keymaster_close(keymaster_device_t* device) -{ - return device->common.close(&device->common); -} - -__END_DECLS - -#endif // ANDROID_HARDWARE_KEYMASTER_H - diff --git a/external/android/include/19/hardware/libhardware/include/hardware/lights.h b/external/android/include/19/hardware/libhardware/include/hardware/lights.h deleted file mode 100644 index 2cf5519..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/lights.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_LIGHTS_INTERFACE_H -#define ANDROID_LIGHTS_INTERFACE_H - -#include -#include -#include - -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define LIGHTS_HARDWARE_MODULE_ID "lights" - -/* - * These light IDs correspond to logical lights, not physical. - * So for example, if your INDICATOR light is in line with your - * BUTTONS, it might make sense to also light the INDICATOR - * light to a reasonable color when the BUTTONS are lit. - */ -#define LIGHT_ID_BACKLIGHT "backlight" -#define LIGHT_ID_KEYBOARD "keyboard" -#define LIGHT_ID_BUTTONS "buttons" -#define LIGHT_ID_BATTERY "battery" -#define LIGHT_ID_NOTIFICATIONS "notifications" -#define LIGHT_ID_ATTENTION "attention" - -/* - * These lights aren't currently supported by the higher - * layers, but could be someday, so we have the constants - * here now. - */ -#define LIGHT_ID_BLUETOOTH "bluetooth" -#define LIGHT_ID_WIFI "wifi" - -/* ************************************************************************ - * Flash modes for the flashMode field of light_state_t. - */ - -#define LIGHT_FLASH_NONE 0 - -/** - * To flash the light at a given rate, set flashMode to LIGHT_FLASH_TIMED, - * and then flashOnMS should be set to the number of milliseconds to turn - * the light on, followed by the number of milliseconds to turn the light - * off. - */ -#define LIGHT_FLASH_TIMED 1 - -/** - * To flash the light using hardware assist, set flashMode to - * the hardware mode. - */ -#define LIGHT_FLASH_HARDWARE 2 - -/** - * Light brightness is managed by a user setting. - */ -#define BRIGHTNESS_MODE_USER 0 - -/** - * Light brightness is managed by a light sensor. - */ -#define BRIGHTNESS_MODE_SENSOR 1 - -/** - * The parameters that can be set for a given light. - * - * Not all lights must support all parameters. If you - * can do something backward-compatible, you should. - */ -struct light_state_t { - /** - * The color of the LED in ARGB. - * - * Do your best here. - * - If your light can only do red or green, if they ask for blue, - * you should do green. - * - If you can only do a brightness ramp, then use this formula: - * unsigned char brightness = ((77*((color>>16)&0x00ff)) - * + (150*((color>>8)&0x00ff)) + (29*(color&0x00ff))) >> 8; - * - If you can only do on or off, 0 is off, anything else is on. - * - * The high byte should be ignored. Callers will set it to 0xff (which - * would correspond to 255 alpha). - */ - unsigned int color; - - /** - * See the LIGHT_FLASH_* constants - */ - int flashMode; - int flashOnMS; - int flashOffMS; - - /** - * Policy used by the framework to manage the light's brightness. - * Currently the values are BRIGHTNESS_MODE_USER and BRIGHTNESS_MODE_SENSOR. - */ - int brightnessMode; -}; - -struct light_device_t { - struct hw_device_t common; - - /** - * Set the provided lights to the provided values. - * - * Returns: 0 on succes, error code on failure. - */ - int (*set_light)(struct light_device_t* dev, - struct light_state_t const* state); -}; - - -__END_DECLS - -#endif // ANDROID_LIGHTS_INTERFACE_H - diff --git a/external/android/include/19/hardware/libhardware/include/hardware/local_time_hal.h b/external/android/include/19/hardware/libhardware/include/hardware/local_time_hal.h deleted file mode 100644 index 6b6a317..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/local_time_hal.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (C) 2011 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_LOCAL_TIME_HAL_INTERFACE_H -#define ANDROID_LOCAL_TIME_HAL_INTERFACE_H - -#include - -#include - -__BEGIN_DECLS - -/** - * The id of this module - */ -#define LOCAL_TIME_HARDWARE_MODULE_ID "local_time" - -/** - * Name of the local time devices to open - */ -#define LOCAL_TIME_HARDWARE_INTERFACE "local_time_hw_if" - -/**********************************************************************/ - -/** - * A structure used to collect low level sync data in a lab environment. Most - * HAL implementations will never need this structure. - */ -struct local_time_debug_event { - int64_t local_timesync_event_id; - int64_t local_time; -}; - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -struct local_time_module { - struct hw_module_t common; -}; - -struct local_time_hw_device { - struct hw_device_t common; - - /** - * - * Returns the current value of the system wide local time counter - */ - int64_t (*get_local_time)(struct local_time_hw_device* dev); - - /** - * - * Returns the nominal frequency (in hertz) of the system wide local time - * counter - */ - uint64_t (*get_local_freq)(struct local_time_hw_device* dev); - - /** - * - * Sets the HW slew rate of oscillator which drives the system wide local - * time counter. On success, platforms should return 0. Platforms which - * do not support HW slew should leave this method set to NULL. - * - * Valid values for rate range from MIN_INT16 to MAX_INT16. Platform - * implementations should attempt map this range linearly to the min/max - * slew rate of their hardware. - */ - int (*set_local_slew)(struct local_time_hw_device* dev, int16_t rate); - - /** - * - * A method used to collect low level sync data in a lab environments. - * Most HAL implementations will simply set this member to NULL, or return - * -EINVAL to indicate that this functionality is not supported. - * Production HALs should never support this method. - */ - int (*get_debug_log)(struct local_time_hw_device* dev, - struct local_time_debug_event* records, - int max_records); -}; - -typedef struct local_time_hw_device local_time_hw_device_t; - -/** convenience API for opening and closing a supported device */ - -static inline int local_time_hw_device_open( - const struct hw_module_t* module, - struct local_time_hw_device** device) -{ - return module->methods->open(module, LOCAL_TIME_HARDWARE_INTERFACE, - (struct hw_device_t**)device); -} - -static inline int local_time_hw_device_close(struct local_time_hw_device* device) -{ - return device->common.close(&device->common); -} - - -__END_DECLS - -#endif // ANDROID_LOCAL_TIME_INTERFACE_H diff --git a/external/android/include/19/hardware/libhardware/include/hardware/memtrack.h b/external/android/include/19/hardware/libhardware/include/hardware/memtrack.h deleted file mode 100644 index 57ba4ad..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/memtrack.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (C) 2013 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_INCLUDE_HARDWARE_MEMTRACK_H -#define ANDROID_INCLUDE_HARDWARE_MEMTRACK_H - -#include -#include -#include - -#include - -__BEGIN_DECLS - -#define MEMTRACK_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) - -/** - * The id of this module - */ -#define MEMTRACK_HARDWARE_MODULE_ID "memtrack" - -/* - * The Memory Tracker HAL is designed to return information about device-specific - * memory usage. The primary goal is to be able to track memory that is not - * trackable in any other way, for example texture memory that is allocated by - * a process, but not mapped in to that process' address space. - * A secondary goal is to be able to categorize memory used by a process into - * GL, graphics, etc. All memory sizes should be in real memory usage, - * accounting for stride, bit depth, rounding up to page size, etc. - * - * A process collecting memory statistics will call getMemory for each - * combination of pid and memory type. For each memory type that it recognizes - * the HAL should fill out an array of memtrack_record structures breaking - * down the statistics of that memory type as much as possible. For example, - * getMemory(, MEMTRACK_TYPE_GL) might return: - * { { 4096, ACCOUNTED | PRIVATE | SYSTEM }, - * { 40960, UNACCOUNTED | PRIVATE | SYSTEM }, - * { 8192, ACCOUNTED | PRIVATE | DEDICATED }, - * { 8192, UNACCOUNTED | PRIVATE | DEDICATED } } - * If the HAL could not differentiate between SYSTEM and DEDICATED memory, it - * could return: - * { { 12288, ACCOUNTED | PRIVATE }, - * { 49152, UNACCOUNTED | PRIVATE } } - * - * Memory should not overlap between types. For example, a graphics buffer - * that has been mapped into the GPU as a surface should show up when - * MEMTRACK_TYPE_GRAPHICS is requested, and not when MEMTRACK_TYPE_GL - * is requested. - */ - -enum memtrack_type { - MEMTRACK_TYPE_OTHER = 0, - MEMTRACK_TYPE_GL = 1, - MEMTRACK_TYPE_GRAPHICS = 2, - MEMTRACK_TYPE_MULTIMEDIA = 3, - MEMTRACK_TYPE_CAMERA = 4, - MEMTRACK_NUM_TYPES, -}; - -struct memtrack_record { - size_t size_in_bytes; - unsigned int flags; -}; - -/** - * Flags to differentiate memory that can already be accounted for in - * /proc//smaps, - * (Shared_Clean + Shared_Dirty + Private_Clean + Private_Dirty = Size). - * In general, memory mapped in to a userspace process is accounted unless - * it was mapped with remap_pfn_range. - * Exactly one of these should be set. - */ -#define MEMTRACK_FLAG_SMAPS_ACCOUNTED (1 << 1) -#define MEMTRACK_FLAG_SMAPS_UNACCOUNTED (1 << 2) - -/** - * Flags to differentiate memory shared across multiple processes vs. memory - * used by a single process. Only zero or one of these may be set in a record. - * If none are set, record is assumed to count shared + private memory. - */ -#define MEMTRACK_FLAG_SHARED (1 << 3) -#define MEMTRACK_FLAG_SHARED_PSS (1 << 4) /* shared / num_procesess */ -#define MEMTRACK_FLAG_PRIVATE (1 << 5) - -/** - * Flags to differentiate memory taken from the kernel's allocation pool vs. - * memory that is dedicated to non-kernel allocations, for example a carveout - * or separate video memory. Only zero or one of these may be set in a record. - * If none are set, record is assumed to count system + dedicated memory. - */ -#define MEMTRACK_FLAG_SYSTEM (1 << 6) -#define MEMTRACK_FLAG_DEDICATED (1 << 7) - -/** - * Flags to differentiate memory accessible by the CPU in non-secure mode vs. - * memory that is protected. Only zero or one of these may be set in a record. - * If none are set, record is assumed to count secure + nonsecure memory. - */ -#define MEMTRACK_FLAG_NONSECURE (1 << 8) -#define MEMTRACK_FLAG_SECURE (1 << 9) - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -typedef struct memtrack_module { - struct hw_module_t common; - - /** - * (*init)() performs memtrack management setup actions and is called - * once before any calls to getMemory(). - * Returns 0 on success, -errno on error. - */ - int (*init)(const struct memtrack_module *module); - - /** - * (*getMemory)() expects an array of record objects and populates up to - * *num_record structures with the sizes of memory plus associated flags for - * that memory. It also updates *num_records with the total number of - * records it could return if *num_records was large enough when passed in. - * Returning records with size 0 is expected, the number of records should - * not vary between calls to getMemory for the same memory type, even - * for different pids. - * - * The caller will often call getMemory for a type and pid with - * *num_records == 0 to determine how many records to allocate room for, - * this case should be a fast-path in the HAL, returning a constant and - * not querying any kernel files. If *num_records passed in is 0, - * then records may be NULL. - * - * This function must be thread-safe, it may get called from multiple - * threads at the same time. - * - * Returns 0 on success, -ENODEV if the type is not supported, -errno - * on other errors. - */ - int (*getMemory)(const struct memtrack_module *module, - pid_t pid, - int type, - struct memtrack_record *records, - size_t *num_records); -} memtrack_module_t; - -__END_DECLS - -#endif // ANDROID_INCLUDE_HARDWARE_MEMTRACK_H diff --git a/external/android/include/19/hardware/libhardware/include/hardware/nfc.h b/external/android/include/19/hardware/libhardware/include/hardware/nfc.h deleted file mode 100644 index 09523b3..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/nfc.h +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Copyright (C) 2011, 2012 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_NFC_HAL_INTERFACE_H -#define ANDROID_NFC_HAL_INTERFACE_H - -#include -#include -#include -#include - -#include - -__BEGIN_DECLS - - -/* NFC device HAL for NCI-based NFC controllers. - * - * This HAL allows NCI silicon vendors to make use - * of the core NCI stack in Android for their own silicon. - * - * The responibilities of the NCI HAL implementation - * are as follows: - * - * - Implement the transport to the NFC controller - * - Implement each of the HAL methods specified below as applicable to their silicon - * - Pass up received NCI messages from the controller to the stack - * - * A simplified timeline of NCI HAL method calls: - * 1) Core NCI stack calls open() - * 2) Core NCI stack executes CORE_RESET and CORE_INIT through calls to write() - * 3) Core NCI stack calls core_initialized() to allow HAL to do post-init configuration - * 4) Core NCI stack calls pre_discover() to allow HAL to prepare for RF discovery - * 5) Core NCI stack starts discovery through calls to write() - * 6) Core NCI stack stops discovery through calls to write() (e.g. screen turns off) - * 7) Core NCI stack calls pre_discover() to prepare for RF discovery (e.g. screen turned back on) - * 8) Core NCI stack starts discovery through calls to write() - * ... - * ... - * 9) Core NCI stack calls close() - */ -#define NFC_NCI_HARDWARE_MODULE_ID "nfc_nci" -#define NFC_NCI_CONTROLLER "nci" - -/* - * nfc_nci_module_t should contain module-specific parameters - */ -typedef struct nfc_nci_module_t { - struct hw_module_t common; -} nfc_nci_module_t; - -/* - * HAL events that can be passed back to the stack - */ -typedef uint8_t nfc_event_t; - -enum { - HAL_NFC_OPEN_CPLT_EVT = 0x00, - HAL_NFC_CLOSE_CPLT_EVT = 0x01, - HAL_NFC_POST_INIT_CPLT_EVT = 0x02, - HAL_NFC_PRE_DISCOVER_CPLT_EVT = 0x03, - HAL_NFC_REQUEST_CONTROL_EVT = 0x04, - HAL_NFC_RELEASE_CONTROL_EVT = 0x05, - HAL_NFC_ERROR_EVT = 0x06 -}; - -/* - * Allowed status return values for each of the HAL methods - */ -typedef uint8_t nfc_status_t; - -enum { - HAL_NFC_STATUS_OK = 0x00, - HAL_NFC_STATUS_FAILED = 0x01, - HAL_NFC_STATUS_ERR_TRANSPORT = 0x02, - HAL_NFC_STATUS_ERR_CMD_TIMEOUT = 0x03, - HAL_NFC_STATUS_REFUSED = 0x04 -}; - -/* - * The callback passed in from the NFC stack that the HAL - * can use to pass events back to the stack. - */ -typedef void (nfc_stack_callback_t) (nfc_event_t event, nfc_status_t event_status); - -/* - * The callback passed in from the NFC stack that the HAL - * can use to pass incomming data to the stack. - */ -typedef void (nfc_stack_data_callback_t) (uint16_t data_len, uint8_t* p_data); - -/* nfc_nci_device_t starts with a hw_device_t struct, - * followed by device-specific methods and members. - * - * All methods in the NCI HAL are asynchronous. - */ -typedef struct nfc_nci_device { - struct hw_device_t common; - /* - * (*open)() Opens the NFC controller device and performs initialization. - * This may include patch download and other vendor-specific initialization. - * - * If open completes successfully, the controller should be ready to perform - * NCI initialization - ie accept CORE_RESET and subsequent commands through - * the write() call. - * - * If open() returns 0, the NCI stack will wait for a HAL_NFC_OPEN_CPLT_EVT - * before continuing. - * - * If open() returns any other value, the NCI stack will stop. - * - */ - int (*open)(const struct nfc_nci_device *p_dev, nfc_stack_callback_t *p_cback, - nfc_stack_data_callback_t *p_data_cback); - - /* - * (*write)() Performs an NCI write. - * - * This method may queue writes and return immediately. The only - * requirement is that the writes are executed in order. - */ - int (*write)(const struct nfc_nci_device *p_dev, uint16_t data_len, const uint8_t *p_data); - - /* - * (*core_initialized)() is called after the CORE_INIT_RSP is received from the NFCC. - * At this time, the HAL can do any chip-specific configuration. - * - * If core_initialized() returns 0, the NCI stack will wait for a HAL_NFC_POST_INIT_CPLT_EVT - * before continuing. - * - * If core_initialized() returns any other value, the NCI stack will continue - * immediately. - */ - int (*core_initialized)(const struct nfc_nci_device *p_dev, uint8_t* p_core_init_rsp_params); - - /* - * (*pre_discover)() Is called every time before starting RF discovery. - * It is a good place to do vendor-specific configuration that must be - * performed every time RF discovery is about to be started. - * - * If pre_discover() returns 0, the NCI stack will wait for a HAL_NFC_PRE_DISCOVER_CPLT_EVT - * before continuing. - * - * If pre_discover() returns any other value, the NCI stack will start - * RF discovery immediately. - */ - int (*pre_discover)(const struct nfc_nci_device *p_dev); - - /* - * (*close)() Closed the NFC controller. Should free all resources. - */ - int (*close)(const struct nfc_nci_device *p_dev); - - /* - * (*control_granted)() Grant HAL the exclusive control to send NCI commands. - * Called in response to HAL_REQUEST_CONTROL_EVT. - * Must only be called when there are no NCI commands pending. - * HAL_RELEASE_CONTROL_EVT will notify when HAL no longer needs exclusive control. - */ - int (*control_granted)(const struct nfc_nci_device *p_dev); - - /* - * (*power_cycle)() Restart controller by power cyle; - * HAL_OPEN_CPLT_EVT will notify when operation is complete. - */ - int (*power_cycle)(const struct nfc_nci_device *p_dev); -} nfc_nci_device_t; - -/* - * Convenience methods that the NFC stack can use to open - * and close an NCI device - */ -static inline int nfc_nci_open(const struct hw_module_t* module, - nfc_nci_device_t** dev) { - return module->methods->open(module, NFC_NCI_CONTROLLER, - (struct hw_device_t**) dev); -} - -static inline int nfc_nci_close(nfc_nci_device_t* dev) { - return dev->common.close(&dev->common); -} -/* - * End NFC NCI HAL - */ - -/* - * This is a limited NFC HAL for NXP PN544-based devices. - * This HAL as Android is moving to - * an NCI-based NFC stack. - * - * All NCI-based NFC controllers should use the NFC-NCI - * HAL instead. - * Begin PN544 specific HAL - */ -#define NFC_HARDWARE_MODULE_ID "nfc" - -#define NFC_PN544_CONTROLLER "pn544" - -typedef struct nfc_module_t { - struct hw_module_t common; -} nfc_module_t; - -/* - * PN544 linktypes. - * UART - * I2C - * USB (uses UART DAL) - */ -typedef enum { - PN544_LINK_TYPE_UART, - PN544_LINK_TYPE_I2C, - PN544_LINK_TYPE_USB, - PN544_LINK_TYPE_INVALID, -} nfc_pn544_linktype; - -typedef struct { - struct hw_device_t common; - - /* The number of EEPROM registers to write */ - uint32_t num_eeprom_settings; - - /* The actual EEPROM settings - * For PN544, each EEPROM setting is a 4-byte entry, - * of the format [0x00, addr_msb, addr_lsb, value]. - */ - uint8_t* eeprom_settings; - - /* The link type to which the PN544 is connected */ - nfc_pn544_linktype linktype; - - /* The device node to which the PN544 is connected */ - const char* device_node; - - /* On Crespo we had an I2C issue that would cause us to sometimes read - * the I2C slave address (0x57) over the bus. libnfc contains - * a hack to ignore this byte and try to read the length byte - * again. - * Set to 0 to disable the workaround, 1 to enable it. - */ - uint8_t enable_i2c_workaround; - /* I2C slave address. Multiple I2C addresses are - * possible for PN544 module. Configure address according to - * board design. - */ - uint8_t i2c_device_address; -} nfc_pn544_device_t; - -static inline int nfc_pn544_open(const struct hw_module_t* module, - nfc_pn544_device_t** dev) { - return module->methods->open(module, NFC_PN544_CONTROLLER, - (struct hw_device_t**) dev); -} - -static inline int nfc_pn544_close(nfc_pn544_device_t* dev) { - return dev->common.close(&dev->common); -} -/* - * End PN544 specific HAL - */ - -__END_DECLS - -#endif // ANDROID_NFC_HAL_INTERFACE_H diff --git a/external/android/include/19/hardware/libhardware/include/hardware/power.h b/external/android/include/19/hardware/libhardware/include/hardware/power.h deleted file mode 100644 index 89d57ed..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/power.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (C) 2012 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_INCLUDE_HARDWARE_POWER_H -#define ANDROID_INCLUDE_HARDWARE_POWER_H - -#include -#include -#include - -#include - -__BEGIN_DECLS - -#define POWER_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) -#define POWER_MODULE_API_VERSION_0_2 HARDWARE_MODULE_API_VERSION(0, 2) - -/** - * The id of this module - */ -#define POWER_HARDWARE_MODULE_ID "power" - -/* - * Power hint identifiers passed to (*powerHint) - */ - -typedef enum { - POWER_HINT_VSYNC = 0x00000001, - POWER_HINT_INTERACTION = 0x00000002, - /* DO NOT USE POWER_HINT_VIDEO_ENCODE/_DECODE! They will be removed in - * KLP. - */ - POWER_HINT_VIDEO_ENCODE = 0x00000003, - POWER_HINT_VIDEO_DECODE = 0x00000004 -} power_hint_t; - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -typedef struct power_module { - struct hw_module_t common; - - /* - * (*init)() performs power management setup actions at runtime - * startup, such as to set default cpufreq parameters. This is - * called only by the Power HAL instance loaded by - * PowerManagerService. - */ - void (*init)(struct power_module *module); - - /* - * (*setInteractive)() performs power management actions upon the - * system entering interactive state (that is, the system is awake - * and ready for interaction, often with UI devices such as - * display and touchscreen enabled) or non-interactive state (the - * system appears asleep, display usually turned off). The - * non-interactive state is usually entered after a period of - * inactivity, in order to conserve battery power during - * such inactive periods. - * - * Typical actions are to turn on or off devices and adjust - * cpufreq parameters. This function may also call the - * appropriate interfaces to allow the kernel to suspend the - * system to low-power sleep state when entering non-interactive - * state, and to disallow low-power suspend when the system is in - * interactive state. When low-power suspend state is allowed, the - * kernel may suspend the system whenever no wakelocks are held. - * - * on is non-zero when the system is transitioning to an - * interactive / awake state, and zero when transitioning to a - * non-interactive / asleep state. - * - * This function is called to enter non-interactive state after - * turning off the screen (if present), and called to enter - * interactive state prior to turning on the screen. - */ - void (*setInteractive)(struct power_module *module, int on); - - /* - * (*powerHint) is called to pass hints on power requirements, which - * may result in adjustment of power/performance parameters of the - * cpufreq governor and other controls. The possible hints are: - * - * POWER_HINT_VSYNC - * - * Foreground app has started or stopped requesting a VSYNC pulse - * from SurfaceFlinger. If the app has started requesting VSYNC - * then CPU and GPU load is expected soon, and it may be appropriate - * to raise speeds of CPU, memory bus, etc. The data parameter is - * non-zero to indicate VSYNC pulse is now requested, or zero for - * VSYNC pulse no longer requested. - * - * POWER_HINT_INTERACTION - * - * User is interacting with the device, for example, touchscreen - * events are incoming. CPU and GPU load may be expected soon, - * and it may be appropriate to raise speeds of CPU, memory bus, - * etc. The data parameter is unused. - * - * A particular platform may choose to ignore any hint. - * - * availability: version 0.2 - * - */ - void (*powerHint)(struct power_module *module, power_hint_t hint, - void *data); -} power_module_t; - - -__END_DECLS - -#endif // ANDROID_INCLUDE_HARDWARE_POWER_H diff --git a/external/android/include/19/hardware/libhardware/include/hardware/qemu_pipe.h b/external/android/include/19/hardware/libhardware/include/hardware/qemu_pipe.h deleted file mode 100644 index 1a67022..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/qemu_pipe.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2011 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_INCLUDE_HARDWARE_QEMU_PIPE_H -#define ANDROID_INCLUDE_HARDWARE_QEMU_PIPE_H - -#include -#include -#include -#include -#include /* for pthread_once() */ -#include -#include -#include - -#ifndef D -# define D(...) do{}while(0) -#endif - -/* Try to open a new Qemu fast-pipe. This function returns a file descriptor - * that can be used to communicate with a named service managed by the - * emulator. - * - * This file descriptor can be used as a standard pipe/socket descriptor. - * - * 'pipeName' is the name of the emulator service you want to connect to. - * E.g. 'opengles' or 'camera'. - * - * On success, return a valid file descriptor - * Returns -1 on error, and errno gives the error code, e.g.: - * - * EINVAL -> unknown/unsupported pipeName - * ENOSYS -> fast pipes not available in this system. - * - * ENOSYS should never happen, except if you're trying to run within a - * misconfigured emulator. - * - * You should be able to open several pipes to the same pipe service, - * except for a few special cases (e.g. GSM modem), where EBUSY will be - * returned if more than one client tries to connect to it. - */ -static __inline__ int -qemu_pipe_open(const char* pipeName) -{ - char buff[256]; - int buffLen; - int fd, ret; - - if (pipeName == NULL || pipeName[0] == '\0') { - errno = EINVAL; - return -1; - } - - snprintf(buff, sizeof buff, "pipe:%s", pipeName); - - fd = open("/dev/qemu_pipe", O_RDWR); - if (fd < 0) { - D("%s: Could not open /dev/qemu_pipe: %s", __FUNCTION__, strerror(errno)); - //errno = ENOSYS; - return -1; - } - - buffLen = strlen(buff); - - ret = TEMP_FAILURE_RETRY(write(fd, buff, buffLen+1)); - if (ret != buffLen+1) { - D("%s: Could not connect to %s pipe service: %s", __FUNCTION__, pipeName, strerror(errno)); - if (ret == 0) { - errno = ECONNRESET; - } else if (ret > 0) { - errno = EINVAL; - } - return -1; - } - - return fd; -} - -#endif /* ANDROID_INCLUDE_HARDWARE_QEMUD_PIPE_H */ diff --git a/external/android/include/19/hardware/libhardware/include/hardware/qemud.h b/external/android/include/19/hardware/libhardware/include/hardware/qemud.h deleted file mode 100644 index 5c39f9c..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/qemud.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_INCLUDE_HARDWARE_QEMUD_H -#define ANDROID_INCLUDE_HARDWARE_QEMUD_H - -#include -#include "qemu_pipe.h" - -/* the following is helper code that is used by the QEMU-specific - * hardware HAL modules to communicate with the emulator program - * through the 'qemud' multiplexing daemon, or through the qemud - * pipe. - * - * see the documentation comments for details in - * development/emulator/qemud/qemud.c - * - * all definitions here are built into the HAL module to avoid - * having to write a tiny shared library for this. - */ - -/* we expect the D macro to be defined to a function macro - * that sends its formatted string argument(s) to the log. - * If not, ignore the traces. - */ -#ifndef D -# define D(...) ((void)0) -#endif - -static __inline__ int -qemud_fd_write(int fd, const void* buff, int len) -{ - int len2; - do { - len2 = write(fd, buff, len); - } while (len2 < 0 && errno == EINTR); - return len2; -} - -static __inline__ int -qemud_fd_read(int fd, void* buff, int len) -{ - int len2; - do { - len2 = read(fd, buff, len); - } while (len2 < 0 && errno == EINTR); - return len2; -} - -static __inline__ int -qemud_channel_open(const char* name) -{ - int fd; - int namelen = strlen(name); - char answer[2]; - char pipe_name[256]; - - /* First, try to connect to the pipe. */ - snprintf(pipe_name, sizeof(pipe_name), "qemud:%s", name); - fd = qemu_pipe_open(pipe_name); - if (fd < 0) { - D("QEMUD pipe is not available for %s: %s", name, strerror(errno)); - /* If pipe is not available, connect to qemud control socket */ - fd = socket_local_client( "qemud", - ANDROID_SOCKET_NAMESPACE_RESERVED, - SOCK_STREAM ); - if (fd < 0) { - D("no qemud control socket: %s", strerror(errno)); - return -1; - } - - /* send service name to connect */ - if (qemud_fd_write(fd, name, namelen) != namelen) { - D("can't send service name to qemud: %s", - strerror(errno)); - close(fd); - return -1; - } - - /* read answer from daemon */ - if (qemud_fd_read(fd, answer, 2) != 2 || - answer[0] != 'O' || answer[1] != 'K') { - D("cant' connect to %s service through qemud", name); - close(fd); - return -1; - } - } - return fd; -} - -static __inline__ int -qemud_channel_send(int fd, const void* msg, int msglen) -{ - char header[5]; - - if (msglen < 0) - msglen = strlen((const char*)msg); - - if (msglen == 0) - return 0; - - snprintf(header, sizeof header, "%04x", msglen); - if (qemud_fd_write(fd, header, 4) != 4) { - D("can't write qemud frame header: %s", strerror(errno)); - return -1; - } - - if (qemud_fd_write(fd, msg, msglen) != msglen) { - D("can4t write qemud frame payload: %s", strerror(errno)); - return -1; - } - return 0; -} - -static __inline__ int -qemud_channel_recv(int fd, void* msg, int msgsize) -{ - char header[5]; - int size, avail; - - if (qemud_fd_read(fd, header, 4) != 4) { - D("can't read qemud frame header: %s", strerror(errno)); - return -1; - } - header[4] = 0; - if (sscanf(header, "%04x", &size) != 1) { - D("malformed qemud frame header: '%.*s'", 4, header); - return -1; - } - if (size > msgsize) - return -1; - - if (qemud_fd_read(fd, msg, size) != size) { - D("can't read qemud frame payload: %s", strerror(errno)); - return -1; - } - return size; -} - -#endif /* ANDROID_INCLUDE_HARDWARE_QEMUD_H */ diff --git a/external/android/include/19/hardware/libhardware/include/hardware/sensors.h b/external/android/include/19/hardware/libhardware/include/hardware/sensors.h deleted file mode 100644 index 4c13848..0000000 --- a/external/android/include/19/hardware/libhardware/include/hardware/sensors.h +++ /dev/null @@ -1,1323 +0,0 @@ -/* - * Copyright (C) 2012 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_SENSORS_INTERFACE_H -#define ANDROID_SENSORS_INTERFACE_H - -#include -#include -#include - -#include -#include - -__BEGIN_DECLS - -/*****************************************************************************/ - -#define SENSORS_HEADER_VERSION 1 -#define SENSORS_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) -#define SENSORS_DEVICE_API_VERSION_0_1 HARDWARE_DEVICE_API_VERSION_2(0, 1, SENSORS_HEADER_VERSION) -#define SENSORS_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION_2(1, 0, SENSORS_HEADER_VERSION) -#define SENSORS_DEVICE_API_VERSION_1_1 HARDWARE_DEVICE_API_VERSION_2(1, 1, SENSORS_HEADER_VERSION) - -/** - * The id of this module - */ -#define SENSORS_HARDWARE_MODULE_ID "sensors" - -/** - * Name of the sensors device to open - */ -#define SENSORS_HARDWARE_POLL "poll" - -/** - * Handles must be higher than SENSORS_HANDLE_BASE and must be unique. - * A Handle identifies a given sensors. The handle is used to activate - * and/or deactivate sensors. - * In this version of the API there can only be 256 handles. - */ -#define SENSORS_HANDLE_BASE 0 -#define SENSORS_HANDLE_BITS 8 -#define SENSORS_HANDLE_COUNT (1<0 - * ^ - * | - * +-----------+--> y>0 - * | | - * | | - * | | - * | | / z<0 - * | | / - * | | / - * O-----------+/ - * |[] [ ] []/ - * +----------/+ y<0 - * / - * / - * |/ z>0 (toward the sky) - * - * O: Origin (x=0,y=0,z=0) - * - */ - -/* - * Interaction with suspend mode - * - * Unless otherwise noted, an enabled sensor shall not prevent the - * SoC to go into suspend mode. It is the responsibility of applications - * to keep a partial wake-lock should they wish to receive sensor - * events while the screen is off. While in suspend mode, and unless - * otherwise noted (batch mode, sensor particularities, ...), enabled sensors' - * events are lost. - * - * Note that conceptually, the sensor itself is not de-activated while in - * suspend mode -- it's just that the data it returns are lost. As soon as - * the SoC gets out of suspend mode, operations resume as usual. Of course, - * in practice sensors shall be disabled while in suspend mode to - * save power, unless batch mode is active, in which case they must - * continue fill their internal FIFO (see the documentation of batch() to - * learn how suspend interacts with batch mode). - * - * In batch mode, and only when the flag SENSORS_BATCH_WAKE_UPON_FIFO_FULL is - * set and supported, the specified sensor must be able to wake-up the SoC and - * be able to buffer at least 10 seconds worth of the requested sensor events. - * - * There are notable exceptions to this behavior, which are sensor-dependent - * (see sensor types definitions below) - * - * - * The sensor type documentation below specifies the wake-up behavior of - * each sensor: - * wake-up: yes this sensor must wake-up the SoC to deliver events - * wake-up: no this sensor shall not wake-up the SoC, events are dropped - * - */ - -/* - * Sensor type - * - * Each sensor has a type which defines what this sensor measures and how - * measures are reported. All types are defined below. - * - * Device manufacturers (OEMs) can define their own sensor types, for - * their private use by applications or services provided by them. Such - * sensor types are specific to an OEM and can't be exposed in the SDK. - * These types must start at SENSOR_TYPE_DEVICE_PRIVATE_BASE. - */ - -/* - * Base for device manufacturers private sensor types. - * These sensor types can't be exposed in the SDK. - */ -#define SENSOR_TYPE_DEVICE_PRIVATE_BASE 0x10000 - -/* - * Sensor fusion and virtual sensors - * - * Many sensor types are or can be implemented as virtual sensors from - * physical sensors on the device. For instance the rotation vector sensor, - * orientation sensor, step-detector, step-counter, etc... - * - * From the point of view of this API these virtual sensors MUST appear as - * real, individual sensors. It is the responsibility of the driver and HAL - * to make sure this is the case. - * - * In particular, all sensors must be able to function concurrently. - * For example, if defining both an accelerometer and a step counter, - * then both must be able to work concurrently. - */ - -/* - * Trigger modes - * - * Sensors can report events in different ways called trigger modes, - * each sensor type has one and only one trigger mode associated to it. - * Currently there are four trigger modes defined: - * - * continuous: events are reported at a constant rate defined by setDelay(). - * eg: accelerometers, gyroscopes. - * on-change: events are reported only if the sensor's value has changed. - * setDelay() is used to set a lower limit to the reporting - * period (minimum time between two events). - * The HAL must return an event immediately when an on-change - * sensor is activated. - * eg: proximity, light sensors - * one-shot: upon detection of an event, the sensor deactivates itself and - * then sends a single event. Order matters to avoid race - * conditions. No other event is sent until the sensor get - * reactivated. setDelay() is ignored. - * eg: significant motion sensor - * special: see details in the sensor type specification below - * - */ - - -/* - * SENSOR_TYPE_META_DATA - * trigger-mode: n/a - * wake-up sensor: n/a - * - * NO SENSOR OF THAT TYPE MUST BE RETURNED (*get_sensors_list)() - * - * SENSOR_TYPE_META_DATA is a special token used to populate the - * sensors_meta_data_event structure. It doesn't correspond to a physical - * sensor. sensors_meta_data_event are special, they exist only inside - * the HAL and are generated spontaneously, as opposed to be related to - * a physical sensor. - * - * sensors_meta_data_event_t.version must be META_DATA_VERSION - * sensors_meta_data_event_t.sensor must be 0 - * sensors_meta_data_event_t.type must be SENSOR_TYPE_META_DATA - * sensors_meta_data_event_t.reserved must be 0 - * sensors_meta_data_event_t.timestamp must be 0 - * - * The payload is a meta_data_event_t, where: - * meta_data_event_t.what can take the following values: - * - * META_DATA_FLUSH_COMPLETE - * This event indicates that a previous (*flush)() call has completed for the sensor - * handle specified in meta_data_event_t.sensor. - * see (*flush)() for more details - * - * All other values for meta_data_event_t.what are reserved and - * must not be used. - * - */ -#define SENSOR_TYPE_META_DATA (0) - -/* - * SENSOR_TYPE_ACCELEROMETER - * trigger-mode: continuous - * wake-up sensor: no - * - * All values are in SI units (m/s^2) and measure the acceleration of the - * device minus the force of gravity. - * - * Acceleration sensors return sensor events for all 3 axes at a constant - * rate defined by setDelay(). - * - * x: Acceleration on the x-axis - * y: Acceleration on the y-axis - * z: Acceleration on the z-axis - * - * Note that the readings from the accelerometer include the acceleration - * due to gravity (which is opposite to the direction of the gravity vector). - * - * Examples: - * The norm of should be close to 0 when in free fall. - * - * When the device lies flat on a table and is pushed on its left side - * toward the right, the x acceleration value is positive. - * - * When the device lies flat on a table, the acceleration value is +9.81, - * which correspond to the acceleration of the device (0 m/s^2) minus the - * force of gravity (-9.81 m/s^2). - * - * When the device lies flat on a table and is pushed toward the sky, the - * acceleration value is greater than +9.81, which correspond to the - * acceleration of the device (+A m/s^2) minus the force of - * gravity (-9.81 m/s^2). - */ -#define SENSOR_TYPE_ACCELEROMETER (1) - -/* - * SENSOR_TYPE_GEOMAGNETIC_FIELD - * trigger-mode: continuous - * wake-up sensor: no - * - * All values are in micro-Tesla (uT) and measure the geomagnetic - * field in the X, Y and Z axis. - * - * Returned values include calibration mechanisms such that the vector is - * aligned with the magnetic declination and heading of the earth's - * geomagnetic field. - * - * Magnetic Field sensors return sensor events for all 3 axes at a constant - * rate defined by setDelay(). - */ -#define SENSOR_TYPE_GEOMAGNETIC_FIELD (2) -#define SENSOR_TYPE_MAGNETIC_FIELD SENSOR_TYPE_GEOMAGNETIC_FIELD - -/* - * SENSOR_TYPE_ORIENTATION - * trigger-mode: continuous - * wake-up sensor: no - * - * All values are angles in degrees. - * - * Orientation sensors return sensor events for all 3 axes at a constant - * rate defined by setDelay(). - * - * azimuth: angle between the magnetic north direction and the Y axis, around - * the Z axis (0<=azimuth<360). - * 0=North, 90=East, 180=South, 270=West - * - * pitch: Rotation around X axis (-180<=pitch<=180), with positive values when - * the z-axis moves toward the y-axis. - * - * roll: Rotation around Y axis (-90<=roll<=90), with positive values when - * the x-axis moves towards the z-axis. - * - * Note: For historical reasons the roll angle is positive in the clockwise - * direction (mathematically speaking, it should be positive in the - * counter-clockwise direction): - * - * Z - * ^ - * (+roll) .--> | - * / | - * | | roll: rotation around Y axis - * X <-------(.) - * Y - * note that +Y == -roll - * - * - * - * Note: This definition is different from yaw, pitch and roll used in aviation - * where the X axis is along the long side of the plane (tail to nose). - */ -#define SENSOR_TYPE_ORIENTATION (3) - -/* - * SENSOR_TYPE_GYROSCOPE - * trigger-mode: continuous - * wake-up sensor: no - * - * All values are in radians/second and measure the rate of rotation - * around the X, Y and Z axis. The coordinate system is the same as is - * used for the acceleration sensor. Rotation is positive in the - * counter-clockwise direction (right-hand rule). That is, an observer - * looking from some positive location on the x, y or z axis at a device - * positioned on the origin would report positive rotation if the device - * appeared to be rotating counter clockwise. Note that this is the - * standard mathematical definition of positive rotation and does not agree - * with the definition of roll given earlier. - * The range should at least be 17.45 rad/s (ie: ~1000 deg/s). - * - * automatic gyro-drift compensation is allowed but not required. - */ -#define SENSOR_TYPE_GYROSCOPE (4) - -/* - * SENSOR_TYPE_LIGHT - * trigger-mode: on-change - * wake-up sensor: no - * - * The light sensor value is returned in SI lux units. - */ -#define SENSOR_TYPE_LIGHT (5) - -/* - * SENSOR_TYPE_PRESSURE - * trigger-mode: continuous - * wake-up sensor: no - * - * The pressure sensor return the athmospheric pressure in hectopascal (hPa) - */ -#define SENSOR_TYPE_PRESSURE (6) - -/* SENSOR_TYPE_TEMPERATURE is deprecated in the HAL */ -#define SENSOR_TYPE_TEMPERATURE (7) - -/* - * SENSOR_TYPE_PROXIMITY - * trigger-mode: on-change - * wake-up sensor: yes - * - * The distance value is measured in centimeters. Note that some proximity - * sensors only support a binary "close" or "far" measurement. In this case, - * the sensor should report its maxRange value in the "far" state and a value - * less than maxRange in the "near" state. - */ -#define SENSOR_TYPE_PROXIMITY (8) - -/* - * SENSOR_TYPE_GRAVITY - * trigger-mode: continuous - * wake-up sensor: no - * - * A gravity output indicates the direction of and magnitude of gravity in - * the devices's coordinates. On Earth, the magnitude is 9.8 m/s^2. - * Units are m/s^2. The coordinate system is the same as is used for the - * acceleration sensor. When the device is at rest, the output of the - * gravity sensor should be identical to that of the accelerometer. - */ -#define SENSOR_TYPE_GRAVITY (9) - -/* - * SENSOR_TYPE_LINEAR_ACCELERATION - * trigger-mode: continuous - * wake-up sensor: no - * - * Indicates the linear acceleration of the device in device coordinates, - * not including gravity. - * - * The output is conceptually: - * output of TYPE_ACCELERATION - output of TYPE_GRAVITY - * - * Readings on all axes should be close to 0 when device lies on a table. - * Units are m/s^2. - * The coordinate system is the same as is used for the acceleration sensor. - */ -#define SENSOR_TYPE_LINEAR_ACCELERATION (10) - - -/* - * SENSOR_TYPE_ROTATION_VECTOR - * trigger-mode: continuous - * wake-up sensor: no - * - * The rotation vector symbolizes the orientation of the device relative to the - * East-North-Up coordinates frame. It is usually obtained by integration of - * accelerometer, gyroscope and magnetometer readings. - * - * The East-North-Up coordinate system is defined as a direct orthonormal basis - * where: - * - X points east and is tangential to the ground. - * - Y points north and is tangential to the ground. - * - Z points towards the sky and is perpendicular to the ground. - * - * The orientation of the phone is represented by the rotation necessary to - * align the East-North-Up coordinates with the phone's coordinates. That is, - * applying the rotation to the world frame (X,Y,Z) would align them with the - * phone coordinates (x,y,z). - * - * The rotation can be seen as rotating the phone by an angle theta around - * an axis rot_axis to go from the reference (East-North-Up aligned) device - * orientation to the current device orientation. - * - * The rotation is encoded as the 4 (reordered) components of a unit quaternion: - * sensors_event_t.data[0] = rot_axis.x*sin(theta/2) - * sensors_event_t.data[1] = rot_axis.y*sin(theta/2) - * sensors_event_t.data[2] = rot_axis.z*sin(theta/2) - * sensors_event_t.data[3] = cos(theta/2) - * where - * - rot_axis.x,y,z are the North-East-Up coordinates of a unit length vector - * representing the rotation axis - * - theta is the rotation angle - * - * The quaternion must be of norm 1 (it is a unit quaternion). Failure to ensure - * this will cause erratic client behaviour. - * - * In addition, this sensor reports an estimated heading accuracy. - * sensors_event_t.data[4] = estimated_accuracy (in radians) - * The heading error must be less than estimated_accuracy 95% of the time - * - * This sensor must use a gyroscope and an accelerometer as main orientation - * change input. - * - * This sensor can also include magnetometer input to make up for gyro drift, - * but it cannot be implemented using only a magnetometer. - */ -#define SENSOR_TYPE_ROTATION_VECTOR (11) - -/* - * SENSOR_TYPE_RELATIVE_HUMIDITY - * trigger-mode: on-change - * wake-up sensor: no - * - * A relative humidity sensor measures relative ambient air humidity and - * returns a value in percent. - */ -#define SENSOR_TYPE_RELATIVE_HUMIDITY (12) - -/* - * SENSOR_TYPE_AMBIENT_TEMPERATURE - * trigger-mode: on-change - * wake-up sensor: no - * - * The ambient (room) temperature in degree Celsius. - */ -#define SENSOR_TYPE_AMBIENT_TEMPERATURE (13) - -/* - * SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED - * trigger-mode: continuous - * wake-up sensor: no - * - * Similar to SENSOR_TYPE_MAGNETIC_FIELD, but the hard iron calibration is - * reported separately instead of being included in the measurement. - * Factory calibration and temperature compensation should still be applied to - * the "uncalibrated" measurement. - * Separating away the hard iron calibration estimation allows the system to - * better recover from bad hard iron estimation. - * - * All values are in micro-Tesla (uT) and measure the ambient magnetic - * field in the X, Y and Z axis. Assumptions that the the magnetic field - * is due to the Earth's poles should be avoided. - * - * The uncalibrated_magnetic event contains - * - 3 fields for uncalibrated measurement: x_uncalib, y_uncalib, z_uncalib. - * Each is a component of the measured magnetic field, with soft iron - * and temperature compensation applied, but not hard iron calibration. - * These values should be continuous (no re-calibration should cause a jump). - * - 3 fields for hard iron bias estimates: x_bias, y_bias, z_bias. - * Each field is a component of the estimated hard iron calibration. - * They represent the offsets to apply to the calibrated readings to obtain - * uncalibrated readings (x_uncalib ~= x_calibrated + x_bias) - * These values are expected to jump as soon as the estimate of the hard iron - * changes, and they should be stable the rest of the time. - * - * If this sensor is present, then the corresponding - * SENSOR_TYPE_MAGNETIC_FIELD must be present and both must return the - * same sensor_t::name and sensor_t::vendor. - * - * Minimum filtering should be applied to this sensor. In particular, low pass - * filters should be avoided. - * - * See SENSOR_TYPE_MAGNETIC_FIELD for more information - */ -#define SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED (14) - -/* - * SENSOR_TYPE_GAME_ROTATION_VECTOR - * trigger-mode: continuous - * wake-up sensor: no - * - * Similar to SENSOR_TYPE_ROTATION_VECTOR, but not using the geomagnetic - * field. Therefore the Y axis doesn't point north, but instead to some other - * reference. That reference is allowed to drift by the same order of - * magnitude than the gyroscope drift around the Z axis. - * - * This sensor does not report an estimated heading accuracy: - * sensors_event_t.data[4] is reserved and should be set to 0 - * - * In the ideal case, a phone rotated and returning to the same real-world - * orientation should report the same game rotation vector - * (without using the earth's geomagnetic field). - * - * This sensor must be based on a gyroscope. It cannot be implemented using - * a magnetometer. - * - * see SENSOR_TYPE_ROTATION_VECTOR for more details - */ -#define SENSOR_TYPE_GAME_ROTATION_VECTOR (15) - -/* - * SENSOR_TYPE_GYROSCOPE_UNCALIBRATED - * trigger-mode: continuous - * wake-up sensor: no - * - * All values are in radians/second and measure the rate of rotation - * around the X, Y and Z axis. An estimation of the drift on each axis is - * reported as well. - * - * No gyro-drift compensation shall be performed. - * Factory calibration and temperature compensation should still be applied - * to the rate of rotation (angular speeds). - * - * The coordinate system is the same as is - * used for the acceleration sensor. Rotation is positive in the - * counter-clockwise direction (right-hand rule). That is, an observer - * looking from some positive location on the x, y or z axis at a device - * positioned on the origin would report positive rotation if the device - * appeared to be rotating counter clockwise. Note that this is the - * standard mathematical definition of positive rotation and does not agree - * with the definition of roll given earlier. - * The range should at least be 17.45 rad/s (ie: ~1000 deg/s). - * - * Content of an uncalibrated_gyro event: (units are rad/sec) - * x_uncalib : angular speed (w/o drift compensation) around the X axis - * y_uncalib : angular speed (w/o drift compensation) around the Y axis - * z_uncalib : angular speed (w/o drift compensation) around the Z axis - * x_bias : estimated drift around X axis in rad/s - * y_bias : estimated drift around Y axis in rad/s - * z_bias : estimated drift around Z axis in rad/s - * - * IMPLEMENTATION NOTES: - * - * If the implementation is not able to estimate the drift, then this - * sensor MUST NOT be reported by this HAL. Instead, the regular - * SENSOR_TYPE_GYROSCOPE is used without drift compensation. - * - * If this sensor is present, then the corresponding - * SENSOR_TYPE_GYROSCOPE must be present and both must return the - * same sensor_t::name and sensor_t::vendor. - */ -#define SENSOR_TYPE_GYROSCOPE_UNCALIBRATED (16) - - -/* - * SENSOR_TYPE_SIGNIFICANT_MOTION - * trigger-mode: one-shot - * wake-up sensor: yes - * - * A sensor of this type triggers an event each time significant motion - * is detected and automatically disables itself. - * The only allowed value to return is 1.0. - * - * A significant motion is a motion that might lead to a change in the user - * location. - * Examples of such motions are: - * walking, biking, sitting in a moving car, coach or train. - * Examples of situations that should not trigger significant motion: - * - phone in pocket and person is not moving - * - phone is on a table, even if the table shakes a bit due to nearby traffic - * or washing machine - * - * A note on false positive / false negative / power consumption tradeoff - * - The goal of this sensor is to save power. - * - Triggering an event when the user is not moving (false positive) is costly - * in terms of power, so it should be avoided. - * - Not triggering an event when the user is moving (false negative) is - * acceptable as long as it is not done repeatedly. If the user has been - * walking for 10 seconds, not triggering an event within those 10 seconds - * is not acceptable. - * - * IMPORTANT NOTE: this sensor type is very different from other types - * in that it must work when the screen is off without the need of - * holding a partial wake-lock and MUST allow the SoC to go into suspend. - * When significant motion is detected, the sensor must awaken the SoC and - * the event be reported. - * - * If a particular hardware cannot support this mode of operation then this - * sensor type MUST NOT be reported by the HAL. ie: it is not acceptable - * to "emulate" this sensor in the HAL. - * - * The whole point of this sensor type is to save power by keeping the - * SoC in suspend mode when the device is at rest. - * - * When the sensor is not activated, it must also be deactivated in the - * hardware: it must not wake up the SoC anymore, even in case of - * significant motion. - * - * setDelay() has no effect and is ignored. - * Once a "significant motion" event is returned, a sensor of this type - * must disables itself automatically, as if activate(..., 0) had been called. - */ - -#define SENSOR_TYPE_SIGNIFICANT_MOTION (17) - - -/* - * SENSOR_TYPE_STEP_DETECTOR - * trigger-mode: special - * wake-up sensor: no - * - * A sensor of this type triggers an event each time a step is taken - * by the user. The only allowed value to return is 1.0 and an event is - * generated for each step. Like with any other event, the timestamp - * indicates when the event (here the step) occurred, this corresponds to when - * the foot hit the ground, generating a high variation in acceleration. - * - * While this sensor operates, it shall not disrupt any other sensors, in - * particular, but not limited to, the accelerometer; which might very well - * be in use as well. - * - * This sensor must be low power. That is, if the step detection cannot be - * done in hardware, this sensor should not be defined. Also, when the - * step detector is activated and the accelerometer is not, only steps should - * trigger interrupts (not accelerometer data). - * - * setDelay() has no impact on this sensor type - */ - -#define SENSOR_TYPE_STEP_DETECTOR (18) - - -/* - * SENSOR_TYPE_STEP_COUNTER - * trigger-mode: on-change - * wake-up sensor: no - * - * A sensor of this type returns the number of steps taken by the user since - * the last reboot while activated. The value is returned as a uint64_t and is - * reset to zero only on a system / android reboot. - * - * The timestamp of the event is set to the time when the first step - * for that event was taken. - * See SENSOR_TYPE_STEP_DETECTOR for the signification of the time of a step. - * - * The minimum size of the hardware's internal counter shall be 16 bits - * (this restriction is here to avoid too frequent wake-ups when the - * delay is very large). - * - * IMPORTANT NOTE: this sensor type is different from other types - * in that it must work when the screen is off without the need of - * holding a partial wake-lock and MUST allow the SoC to go into suspend. - * Unlike other sensors, while in suspend mode this sensor must stay active, - * no events are reported during that time but, steps continue to be - * accounted for; an event will be reported as soon as the SoC resumes if - * the timeout has expired. - * - * In other words, when the screen is off and the device allowed to - * go into suspend mode, we don't want to be woken up, regardless of the - * setDelay() value, but the steps shall continue to be counted. - * - * The driver must however ensure that the internal step count never - * overflows. It is allowed in this situation to wake the SoC up so the - * driver can do the counter maintenance. - * - * While this sensor operates, it shall not disrupt any other sensors, in - * particular, but not limited to, the accelerometer; which might very well - * be in use as well. - * - * If a particular hardware cannot support these modes of operation then this - * sensor type MUST NOT be reported by the HAL. ie: it is not acceptable - * to "emulate" this sensor in the HAL. - * - * This sensor must be low power. That is, if the step detection cannot be - * done in hardware, this sensor should not be defined. Also, when the - * step counter is activated and the accelerometer is not, only steps should - * trigger interrupts (not accelerometer data). - * - * The whole point of this sensor type is to save power by keeping the - * SoC in suspend mode when the device is at rest. - */ - -#define SENSOR_TYPE_STEP_COUNTER (19) - -/* - * SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR - * trigger-mode: continuous - * wake-up sensor: no - * - * Similar to SENSOR_TYPE_ROTATION_VECTOR, but using a magnetometer instead - * of using a gyroscope. - * - * This sensor must be based on a magnetometer. It cannot be implemented using - * a gyroscope, and gyroscope input cannot be used by this sensor, as the - * goal of this sensor is to be low power. - * The accelerometer can be (and usually is) used. - * - * Just like SENSOR_TYPE_ROTATION_VECTOR, this sensor reports an estimated - * heading accuracy: - * sensors_event_t.data[4] = estimated_accuracy (in radians) - * The heading error must be less than estimated_accuracy 95% of the time - * - * see SENSOR_TYPE_ROTATION_VECTOR for more details - */ -#define SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR (20) - -/** - * Values returned by the accelerometer in various locations in the universe. - * all values are in SI units (m/s^2) - */ -#define GRAVITY_SUN (275.0f) -#define GRAVITY_EARTH (9.80665f) - -/** Maximum magnetic field on Earth's surface */ -#define MAGNETIC_FIELD_EARTH_MAX (60.0f) - -/** Minimum magnetic field on Earth's surface */ -#define MAGNETIC_FIELD_EARTH_MIN (30.0f) - - -/** - * status of orientation sensor - */ - -#define SENSOR_STATUS_UNRELIABLE 0 -#define SENSOR_STATUS_ACCURACY_LOW 1 -#define SENSOR_STATUS_ACCURACY_MEDIUM 2 -#define SENSOR_STATUS_ACCURACY_HIGH 3 - - -/** - * sensor event data - */ -typedef struct { - union { - float v[3]; - struct { - float x; - float y; - float z; - }; - struct { - float azimuth; - float pitch; - float roll; - }; - }; - int8_t status; - uint8_t reserved[3]; -} sensors_vec_t; - -/** - * uncalibrated gyroscope and magnetometer event data - */ -typedef struct { - union { - float uncalib[3]; - struct { - float x_uncalib; - float y_uncalib; - float z_uncalib; - }; - }; - union { - float bias[3]; - struct { - float x_bias; - float y_bias; - float z_bias; - }; - }; -} uncalibrated_event_t; - -typedef struct meta_data_event { - int32_t what; - int32_t sensor; -} meta_data_event_t; - -/** - * Union of the various types of sensor data - * that can be returned. - */ -typedef struct sensors_event_t { - /* must be sizeof(struct sensors_event_t) */ - int32_t version; - - /* sensor identifier */ - int32_t sensor; - - /* sensor type */ - int32_t type; - - /* reserved */ - int32_t reserved0; - - /* time is in nanosecond */ - int64_t timestamp; - - union { - union { - float data[16]; - - /* acceleration values are in meter per second per second (m/s^2) */ - sensors_vec_t acceleration; - - /* magnetic vector values are in micro-Tesla (uT) */ - sensors_vec_t magnetic; - - /* orientation values are in degrees */ - sensors_vec_t orientation; - - /* gyroscope values are in rad/s */ - sensors_vec_t gyro; - - /* temperature is in degrees centigrade (Celsius) */ - float temperature; - - /* distance in centimeters */ - float distance; - - /* light in SI lux units */ - float light; - - /* pressure in hectopascal (hPa) */ - float pressure; - - /* relative humidity in percent */ - float relative_humidity; - - /* uncalibrated gyroscope values are in rad/s */ - uncalibrated_event_t uncalibrated_gyro; - - /* uncalibrated magnetometer values are in micro-Teslas */ - uncalibrated_event_t uncalibrated_magnetic; - - /* this is a special event. see SENSOR_TYPE_META_DATA above. - * sensors_meta_data_event_t events are all reported with a type of - * SENSOR_TYPE_META_DATA. The handle is ignored and must be zero. - */ - meta_data_event_t meta_data; - }; - - union { - uint64_t data[8]; - - /* step-counter */ - uint64_t step_counter; - } u64; - }; - uint32_t reserved1[4]; -} sensors_event_t; - - -/* see SENSOR_TYPE_META_DATA */ -typedef sensors_event_t sensors_meta_data_event_t; - - -struct sensor_t; - -/** - * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM - * and the fields of this data structure must begin with hw_module_t - * followed by module specific information. - */ -struct sensors_module_t { - struct hw_module_t common; - - /** - * Enumerate all available sensors. The list is returned in "list". - * @return number of sensors in the list - */ - int (*get_sensors_list)(struct sensors_module_t* module, - struct sensor_t const** list); -}; - -struct sensor_t { - - /* Name of this sensor. - * All sensors of the same "type" must have a different "name". - */ - const char* name; - - /* vendor of the hardware part */ - const char* vendor; - - /* version of the hardware part + driver. The value of this field - * must increase when the driver is updated in a way that changes the - * output of this sensor. This is important for fused sensors when the - * fusion algorithm is updated. - */ - int version; - - /* handle that identifies this sensors. This handle is used to reference - * this sensor throughout the HAL API. - */ - int handle; - - /* this sensor's type. */ - int type; - - /* maximum range of this sensor's value in SI units */ - float maxRange; - - /* smallest difference between two values reported by this sensor */ - float resolution; - - /* rough estimate of this sensor's power consumption in mA */ - float power; - - /* this value depends on the trigger mode: - * - * continuous: minimum sample period allowed in microseconds - * on-change : 0 - * one-shot :-1 - * special : 0, unless otherwise noted - */ - int32_t minDelay; - - /* number of events reserved for this sensor in the batch mode FIFO. - * If there is a dedicated FIFO for this sensor, then this is the - * size of this FIFO. If the FIFO is shared with other sensors, - * this is the size reserved for that sensor and it can be zero. - */ - uint32_t fifoReservedEventCount; - - /* maximum number of events of this sensor that could be batched. - * This is especially relevant when the FIFO is shared between - * several sensors; this value is then set to the size of that FIFO. - */ - uint32_t fifoMaxEventCount; - - /* reserved fields, must be zero */ - void* reserved[6]; -}; - - -/* - * sensors_poll_device_t is used with SENSORS_DEVICE_API_VERSION_0_1 - * and is present for backward binary and source compatibility. - * (see documentation of the hooks in struct sensors_poll_device_1 below) - */ -struct sensors_poll_device_t { - struct hw_device_t common; - int (*activate)(struct sensors_poll_device_t *dev, - int handle, int enabled); - int (*setDelay)(struct sensors_poll_device_t *dev, - int handle, int64_t ns); - int (*poll)(struct sensors_poll_device_t *dev, - sensors_event_t* data, int count); -}; - -/* - * struct sensors_poll_device_1 is used with SENSORS_DEVICE_API_VERSION_1_0 - */ -typedef struct sensors_poll_device_1 { - union { - /* sensors_poll_device_1 is compatible with sensors_poll_device_t, - * and can be down-cast to it - */ - struct sensors_poll_device_t v0; - - struct { - struct hw_device_t common; - - /* Activate/de-activate one sensor. - * - * handle is the handle of the sensor to change. - * enabled set to 1 to enable, or 0 to disable the sensor. - * - * if enabled is set to 1, the sensor is activated even if - * setDelay() wasn't called before. In this case, a default rate - * should be used. - * - * unless otherwise noted in the sensor types definitions, an - * activated sensor never prevents the SoC to go into suspend - * mode; that is, the HAL shall not hold a partial wake-lock on - * behalf of applications. - * - * one-shot sensors de-activate themselves automatically upon - * receiving an event and they must still accept to be deactivated - * through a call to activate(..., ..., 0). - * - * if "enabled" is 1 and the sensor is already activated, this - * function is a no-op and succeeds. - * - * if "enabled" is 0 and the sensor is already de-activated, - * this function is a no-op and succeeds. - * - * return 0 on success, negative errno code otherwise - */ - int (*activate)(struct sensors_poll_device_t *dev, - int handle, int enabled); - - /** - * Set the events's period in nanoseconds for a given sensor. - * - * What the period_ns parameter means depends on the specified - * sensor's trigger mode: - * - * continuous: setDelay() sets the sampling rate. - * on-change: setDelay() limits the delivery rate of events - * one-shot: setDelay() is ignored. it has no effect. - * special: see specific sensor type definitions - * - * For continuous and on-change sensors, if the requested value is - * less than sensor_t::minDelay, then it's silently clamped to - * sensor_t::minDelay unless sensor_t::minDelay is 0, in which - * case it is clamped to >= 1ms. - * - * setDelay will not be called when the sensor is in batching mode. - * In this case, batch() will be called with the new period. - * - * @return 0 if successful, < 0 on error - */ - int (*setDelay)(struct sensors_poll_device_t *dev, - int handle, int64_t period_ns); - - /** - * Returns an array of sensor data. - * This function must block until events are available. - * - * return the number of events read on success, or -errno in case - * of an error. - * - * The number of events returned in data must be less or equal - * to the "count" argument. - * - * This function shall never return 0 (no event). - */ - int (*poll)(struct sensors_poll_device_t *dev, - sensors_event_t* data, int count); - }; - }; - - - /* - * Enables batch mode for the given sensor and sets the delay between events - * - * A timeout value of zero disables batch mode for the given sensor. - * - * The period_ns parameter is equivalent to calling setDelay() -- this - * function both enables or disables the batch mode AND sets the events's - * period in nanosecond. See setDelay() above for a detailed explanation of - * the period_ns parameter. - * - * BATCH MODE: - * ----------- - * In non-batch mode, all sensor events must be reported as soon as they - * are detected. For example, an accelerometer activated at 50Hz will - * trigger interrupts 50 times per second. - * While in batch mode, sensor events do not need to be reported as soon - * as they are detected. They can be temporarily stored in batches and - * reported in batches, as long as no event is delayed by more than - * "timeout" nanoseconds. That is, all events since the previous batch - * are recorded and returned all at once. This allows to reduce the amount - * of interrupts sent to the SoC, and allow the SoC to switch to a lower - * power state (Idle) while the sensor is capturing and batching data. - * - * setDelay() is not affected and it behaves as usual. - * - * Each event has a timestamp associated with it, the timestamp - * must be accurate and correspond to the time at which the event - * physically happened. - * - * Batching does not modify the behavior of poll(): batches from different - * sensors can be interleaved and split. As usual, all events from the same - * sensor are time-ordered. - * - * BEHAVIOUR OUTSIDE OF SUSPEND MODE: - * ---------------------------------- - * - * When the SoC is awake (not in suspend mode), events must be reported in - * batches at least every "timeout". No event shall be dropped or lost. - * If internal h/w FIFOs fill-up before the timeout, then events are - * reported at that point to ensure no event is lost. - * - * - * NORMAL BEHAVIOR IN SUSPEND MODE: - * --------------------------------- - * - * By default, batch mode doesn't significantly change the interaction with - * suspend mode. That is, sensors must continue to allow the SoC to - * go into suspend mode and sensors must stay active to fill their - * internal FIFO. In this mode, when the FIFO fills up, it shall wrap - * around (basically behave like a circular buffer, overwriting events). - * As soon as the SoC comes out of suspend mode, a batch is produced with - * as much as the recent history as possible, and batch operation - * resumes as usual. - * - * The behavior described above allows applications to record the recent - * history of a set of sensor while keeping the SoC into suspend. It - * also allows the hardware to not have to rely on a wake-up interrupt line. - * - * WAKE_UPON_FIFO_FULL BEHAVIOR IN SUSPEND MODE: - * ---------------------------------------------- - * - * There are cases, however, where an application cannot afford to lose - * any events, even when the device goes into suspend mode. - * For a given rate, if a sensor has the capability to store at least 10 - * seconds worth of events in its FIFO and is able to wake up the Soc, it - * can implement an optional secondary mode: the WAKE_UPON_FIFO_FULL mode. - * - * The caller will set the SENSORS_BATCH_WAKE_UPON_FIFO_FULL flag to - * activate this mode. If the sensor does not support this mode, batch() - * will fail when the flag is set. - * - * When running with the WAKE_UPON_FIFO_FULL flag set, no events can be - * lost. When the FIFO is getting full, the sensor must wake up the SoC from - * suspend and return a batch before the FIFO fills-up. - * Depending on the device, it might take a few miliseconds for the SoC to - * entirely come out of suspend and start flushing the FIFO. Enough head - * room must be allocated in the FIFO to allow the device to entirely come - * out of suspend without the FIFO overflowing (no events shall be lost). - * - * Implementing the WAKE_UPON_FIFO_FULL mode is optional. - * If the hardware cannot support this mode, or if the physical - * FIFO is so small that the device would never be allowed to go into - * suspend for at least 10 seconds, then this function MUST fail when - * the flag SENSORS_BATCH_WAKE_UPON_FIFO_FULL is set, regardless of - * the value of the timeout parameter. - * - * - * DRY RUN: - * -------- - * - * If the flag SENSORS_BATCH_DRY_RUN is set, this function returns - * without modifying the batch mode or the event period and has no side - * effects, but returns errors as usual (as it would if this flag was - * not set). This flag is used to check if batch mode is available for a - * given configuration -- in particular for a given sensor at a given rate. - * - * - * Return values: - * -------------- - * - * Because sensors must be independent, the return value must not depend - * on the state of the system (whether another sensor is on or not), - * nor on whether the flag SENSORS_BATCH_DRY_RUN is set (in other words, - * if a batch call with SENSORS_BATCH_DRY_RUN is successful, - * the same call without SENSORS_BATCH_DRY_RUN must succeed as well). - * - * When timeout is not 0: - * If successful, 0 is returned. - * If the specified sensor doesn't support batch mode, return -EINVAL. - * If the specified sensor's trigger-mode is one-shot, return -EINVAL. - * If WAKE_UPON_FIFO_FULL is specified and the specified sensor's internal - * FIFO is too small to store at least 10 seconds worth of data at the - * given rate, -EINVAL is returned. Note that as stated above, this has to - * be determined at compile time, and not based on the state of the - * system. - * If some other constraints above cannot be satisfied, return -EINVAL. - * - * Note: the timeout parameter, when > 0, has no impact on whether this - * function succeeds or fails. - * - * When timeout is 0: - * The caller will never set the wake_upon_fifo_full flag. - * The function must succeed, and batch mode must be deactivated. - * - * Independently of whether DRY_RUN is specified, When the call to batch() - * fails, no state should be changed. In particular, a failed call to - * batch() should not change the rate of the sensor. Example: - * setDelay(..., 10ms) - * batch(..., 20ms, ...) fails - * rate should stay 10ms. - * - * - * IMPLEMENTATION NOTES: - * --------------------- - * - * Batch mode, if supported, should happen at the hardware level, - * typically using hardware FIFOs. In particular, it SHALL NOT be - * implemented in the HAL, as this would be counter productive. - * The goal here is to save significant amounts of power. - * - * In some implementations, events from several sensors can share the - * same physical FIFO. In that case, all events in the FIFO can be sent and - * processed by the HAL as soon as one batch must be reported. - * For example, if the following sensors are activated: - * - accelerometer batched with timeout = 20s - * - gyroscope batched with timeout = 5s - * then the accelerometer batches can be reported at the same time the - * gyroscope batches are reported (every 5 seconds) - * - * Batch mode can be enabled or disabled at any time, in particular - * while the specified sensor is already enabled, and this shall not - * result in the loss of events. - * - * COMPARATIVE IMPORTANCE OF BATCHING FOR DIFFERENT SENSORS: - * --------------------------------------------------------- - * - * On platforms on which hardware fifo size is limited, the system designers - * might have to choose how much fifo to reserve for each sensor. To help - * with this choice, here is a list of applications made possible when - * batching is implemented on the different sensors. - * - * High value: Low power pedestrian dead reckoning - * Target batching time: 20 seconds to 1 minute - * Sensors to batch: - * - Step detector - * - Rotation vector or game rotation vector at 5Hz - * Gives us step and heading while letting the SoC go to Suspend. - * - * High value: Medium power activity/gesture recognition - * Target batching time: 3 seconds - * Sensors to batch: accelerometer between 20Hz and 50Hz - * Allows recognizing arbitrary activities and gestures without having - * to keep the SoC fully awake while the data is collected. - * - * Medium-high value: Interrupt load reduction - * Target batching time: < 1 second - * Sensors to batch: any high frequency sensor. - * If the gyroscope is set at 800Hz, even batching just 10 gyro events can - * reduce the number of interrupts from 800/second to 80/second. - * - * Medium value: Continuous low frequency data collection - * Target batching time: > 1 minute - * Sensors to batch: barometer, humidity sensor, other low frequency - * sensors. - * Allows creating monitoring applications at low power. - * - * Medium value: Continuous full-sensors collection - * Target batching time: > 1 minute - * Sensors to batch: all, at high frequencies - * Allows full collection of sensor data while leaving the SoC in - * suspend mode. Only to consider if fifo space is not an issue. - * - * In each of the cases above, if WAKE_UPON_FIFO_FULL is implemented, the - * applications might decide to let the SoC go to suspend, allowing for even - * more power savings. - */ - int (*batch)(struct sensors_poll_device_1* dev, - int handle, int flags, int64_t period_ns, int64_t timeout); - - /* - * Flush adds a META_DATA_FLUSH_COMPLETE event (sensors_event_meta_data_t) - * to the end of the "batch mode" FIFO for the specified sensor and flushes - * the FIFO; those events are delivered as usual (i.e.: as if the batch - * timeout had expired) and removed from the FIFO. - * - * See the META_DATA_FLUSH_COMPLETE section for details about the - * META_DATA_FLUSH_COMPLETE event. - * - * The flush happens asynchronously (i.e.: this function must return - * immediately). - * - * If the implementation uses a single FIFO for several sensors, that - * FIFO is flushed and the META_DATA_FLUSH_COMPLETE event is added only - * for the specified sensor. - * - * If the specified sensor wasn't in batch mode, flush succeeds and - * promptly sends a META_DATA_FLUSH_COMPLETE event for that sensor. - * - * If the FIFO was empty at the time of the call, flush returns - * 0 (success) and promptly sends a META_DATA_FLUSH_COMPLETE event - * for that sensor. - * - * If the specified sensor wasn't enabled, flush returns -EINVAL. - * - * return 0 on success, negative errno code otherwise. - */ - int (*flush)(struct sensors_poll_device_1* dev, int handle); - - void (*reserved_procs[8])(void); - -} sensors_poll_device_1_t; - - - -/** convenience API for opening and closing a device */ - -static inline int sensors_open(const struct hw_module_t* module, - struct sensors_poll_device_t** device) { - return module->methods->open(module, - SENSORS_HARDWARE_POLL, (struct hw_device_t**)device); -} - -static inline int sensors_close(struct sensors_poll_device_t* device) { - return device->common.close(&device->common); -} - -static inline int sensors_open_1(const struct hw_module_t* module, - sensors_poll_device_1_t** device) { - return module->methods->open(module, - SENSORS_HARDWARE_POLL, (struct hw_device_t**)device); -} - -static inline int sensors_close_1(sensors_poll_device_1_t* device) { - return device->common.close(&device->common); -} - -__END_DECLS - -#endif // ANDROID_SENSORS_INTERFACE_H diff --git a/external/android/include/19/system/core/include/cutils/android_reboot.h b/external/android/include/19/system/core/include/cutils/android_reboot.h deleted file mode 100644 index 8c30e8e..0000000 --- a/external/android/include/19/system/core/include/cutils/android_reboot.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2011, 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 __CUTILS_ANDROID_REBOOT_H__ -#define __CUTILS_ANDROID_REBOOT_H__ - -__BEGIN_DECLS - -/* Commands */ -#define ANDROID_RB_RESTART 0xDEAD0001 -#define ANDROID_RB_POWEROFF 0xDEAD0002 -#define ANDROID_RB_RESTART2 0xDEAD0003 - -/* Properties */ -#define ANDROID_RB_PROPERTY "sys.powerctl" - -int android_reboot(int cmd, int flags, char *arg); - -__END_DECLS - -#endif /* __CUTILS_ANDROID_REBOOT_H__ */ diff --git a/external/android/include/19/system/core/include/cutils/aref.h b/external/android/include/19/system/core/include/cutils/aref.h deleted file mode 100644 index 460ac02..0000000 --- a/external/android/include/19/system/core/include/cutils/aref.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2013 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 _CUTILS_AREF_H_ -#define _CUTILS_AREF_H_ - -#include -#include - -#ifdef ANDROID_SMP -#include -#else -#include -#endif - -__BEGIN_DECLS - -#define AREF_TO_ITEM(aref, container, member) \ - (container *) (((char*) (aref)) - offsetof(container, member)) - -struct aref -{ - volatile int32_t count; -}; - -static inline void aref_init(struct aref *r) -{ - r->count = 1; -} - -static inline int32_t aref_count(struct aref *r) -{ - return r->count; -} - -static inline void aref_get(struct aref *r) -{ - android_atomic_inc(&r->count); -} - -static inline void aref_put(struct aref *r, void (*release)(struct aref *)) -{ - if (android_atomic_dec(&r->count) == 1) - release(r); -} - -__END_DECLS - -#endif // _CUTILS_AREF_H_ diff --git a/external/android/include/19/system/core/include/cutils/ashmem.h b/external/android/include/19/system/core/include/cutils/ashmem.h deleted file mode 100644 index 25b233e..0000000 --- a/external/android/include/19/system/core/include/cutils/ashmem.h +++ /dev/null @@ -1,45 +0,0 @@ -/* cutils/ashmem.h - ** - ** Copyright 2008 The Android Open Source Project - ** - ** This file is dual licensed. It may be redistributed and/or modified - ** under the terms of the Apache 2.0 License OR version 2 of the GNU - ** General Public License. - */ - -#ifndef _CUTILS_ASHMEM_H -#define _CUTILS_ASHMEM_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -int ashmem_create_region(const char *name, size_t size); -int ashmem_set_prot_region(int fd, int prot); -int ashmem_pin_region(int fd, size_t offset, size_t len); -int ashmem_unpin_region(int fd, size_t offset, size_t len); -int ashmem_get_size_region(int fd); - -#ifdef __cplusplus -} -#endif - -#ifndef __ASHMEMIOC /* in case someone included too */ - -#define ASHMEM_NAME_LEN 256 - -#define ASHMEM_NAME_DEF "dev/ashmem" - -/* Return values from ASHMEM_PIN: Was the mapping purged while unpinned? */ -#define ASHMEM_NOT_PURGED 0 -#define ASHMEM_WAS_PURGED 1 - -/* Return values from ASHMEM_UNPIN: Is the mapping now pinned or unpinned? */ -#define ASHMEM_IS_UNPINNED 0 -#define ASHMEM_IS_PINNED 1 - -#endif /* ! __ASHMEMIOC */ - -#endif /* _CUTILS_ASHMEM_H */ diff --git a/external/android/include/19/system/core/include/cutils/atomic-arm.h b/external/android/include/19/system/core/include/cutils/atomic-arm.h deleted file mode 100644 index 172a0cd..0000000 --- a/external/android/include/19/system/core/include/cutils/atomic-arm.h +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (C) 2010 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_CUTILS_ATOMIC_ARM_H -#define ANDROID_CUTILS_ATOMIC_ARM_H - -#include - -#ifndef ANDROID_ATOMIC_INLINE -#define ANDROID_ATOMIC_INLINE inline __attribute__((always_inline)) -#endif - -extern ANDROID_ATOMIC_INLINE void android_compiler_barrier() -{ - __asm__ __volatile__ ("" : : : "memory"); -} - -extern ANDROID_ATOMIC_INLINE void android_memory_barrier() -{ -#if ANDROID_SMP == 0 - android_compiler_barrier(); -#else - __asm__ __volatile__ ("dmb" : : : "memory"); -#endif -} - -extern ANDROID_ATOMIC_INLINE void android_memory_store_barrier() -{ -#if ANDROID_SMP == 0 - android_compiler_barrier(); -#else - __asm__ __volatile__ ("dmb st" : : : "memory"); -#endif -} - -extern ANDROID_ATOMIC_INLINE -int32_t android_atomic_acquire_load(volatile const int32_t *ptr) -{ - int32_t value = *ptr; - android_memory_barrier(); - return value; -} - -extern ANDROID_ATOMIC_INLINE -int32_t android_atomic_release_load(volatile const int32_t *ptr) -{ - android_memory_barrier(); - return *ptr; -} - -extern ANDROID_ATOMIC_INLINE -void android_atomic_acquire_store(int32_t value, volatile int32_t *ptr) -{ - *ptr = value; - android_memory_barrier(); -} - -extern ANDROID_ATOMIC_INLINE -void android_atomic_release_store(int32_t value, volatile int32_t *ptr) -{ - android_memory_barrier(); - *ptr = value; -} - -extern ANDROID_ATOMIC_INLINE -int android_atomic_cas(int32_t old_value, int32_t new_value, - volatile int32_t *ptr) -{ - int32_t prev, status; - do { - __asm__ __volatile__ ("ldrex %0, [%3]\n" - "mov %1, #0\n" - "teq %0, %4\n" -#ifdef __thumb2__ - "it eq\n" -#endif - "strexeq %1, %5, [%3]" - : "=&r" (prev), "=&r" (status), "+m"(*ptr) - : "r" (ptr), "Ir" (old_value), "r" (new_value) - : "cc"); - } while (__builtin_expect(status != 0, 0)); - return prev != old_value; -} - -extern ANDROID_ATOMIC_INLINE -int android_atomic_acquire_cas(int32_t old_value, int32_t new_value, - volatile int32_t *ptr) -{ - int status = android_atomic_cas(old_value, new_value, ptr); - android_memory_barrier(); - return status; -} - -extern ANDROID_ATOMIC_INLINE -int android_atomic_release_cas(int32_t old_value, int32_t new_value, - volatile int32_t *ptr) -{ - android_memory_barrier(); - return android_atomic_cas(old_value, new_value, ptr); -} - -extern ANDROID_ATOMIC_INLINE -int32_t android_atomic_add(int32_t increment, volatile int32_t *ptr) -{ - int32_t prev, tmp, status; - android_memory_barrier(); - do { - __asm__ __volatile__ ("ldrex %0, [%4]\n" - "add %1, %0, %5\n" - "strex %2, %1, [%4]" - : "=&r" (prev), "=&r" (tmp), - "=&r" (status), "+m" (*ptr) - : "r" (ptr), "Ir" (increment) - : "cc"); - } while (__builtin_expect(status != 0, 0)); - return prev; -} - -extern ANDROID_ATOMIC_INLINE int32_t android_atomic_inc(volatile int32_t *addr) -{ - return android_atomic_add(1, addr); -} - -extern ANDROID_ATOMIC_INLINE int32_t android_atomic_dec(volatile int32_t *addr) -{ - return android_atomic_add(-1, addr); -} - -extern ANDROID_ATOMIC_INLINE -int32_t android_atomic_and(int32_t value, volatile int32_t *ptr) -{ - int32_t prev, tmp, status; - android_memory_barrier(); - do { - __asm__ __volatile__ ("ldrex %0, [%4]\n" - "and %1, %0, %5\n" - "strex %2, %1, [%4]" - : "=&r" (prev), "=&r" (tmp), - "=&r" (status), "+m" (*ptr) - : "r" (ptr), "Ir" (value) - : "cc"); - } while (__builtin_expect(status != 0, 0)); - return prev; -} - -extern ANDROID_ATOMIC_INLINE -int32_t android_atomic_or(int32_t value, volatile int32_t *ptr) -{ - int32_t prev, tmp, status; - android_memory_barrier(); - do { - __asm__ __volatile__ ("ldrex %0, [%4]\n" - "orr %1, %0, %5\n" - "strex %2, %1, [%4]" - : "=&r" (prev), "=&r" (tmp), - "=&r" (status), "+m" (*ptr) - : "r" (ptr), "Ir" (value) - : "cc"); - } while (__builtin_expect(status != 0, 0)); - return prev; -} - -#endif /* ANDROID_CUTILS_ATOMIC_ARM_H */ diff --git a/external/android/include/19/system/core/include/cutils/atomic-inline.h b/external/android/include/19/system/core/include/cutils/atomic-inline.h deleted file mode 100644 index 0b13138..0000000 --- a/external/android/include/19/system/core/include/cutils/atomic-inline.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2010 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_CUTILS_ATOMIC_INLINE_H -#define ANDROID_CUTILS_ATOMIC_INLINE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Inline declarations and macros for some special-purpose atomic - * operations. These are intended for rare circumstances where a - * memory barrier needs to be issued inline rather than as a function - * call. - * - * Most code should not use these. - * - * Anything that does include this file must set ANDROID_SMP to either - * 0 or 1, indicating compilation for UP or SMP, respectively. - * - * Macros defined in this header: - * - * void ANDROID_MEMBAR_FULL(void) - * Full memory barrier. Provides a compiler reordering barrier, and - * on SMP systems emits an appropriate instruction. - */ - -#if !defined(ANDROID_SMP) -# error "Must define ANDROID_SMP before including atomic-inline.h" -#endif - -#if defined(__arm__) -#include -#elif defined(__i386__) || defined(__x86_64__) -#include -#elif defined(__mips__) -#include -#else -#error atomic operations are unsupported -#endif - -#if ANDROID_SMP == 0 -#define ANDROID_MEMBAR_FULL android_compiler_barrier -#else -#define ANDROID_MEMBAR_FULL android_memory_barrier -#endif - -#if ANDROID_SMP == 0 -#define ANDROID_MEMBAR_STORE android_compiler_barrier -#else -#define ANDROID_MEMBAR_STORE android_memory_store_barrier -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* ANDROID_CUTILS_ATOMIC_INLINE_H */ diff --git a/external/android/include/19/system/core/include/cutils/atomic-mips.h b/external/android/include/19/system/core/include/cutils/atomic-mips.h deleted file mode 100644 index f9d3e25..0000000 --- a/external/android/include/19/system/core/include/cutils/atomic-mips.h +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright (C) 2010 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_CUTILS_ATOMIC_MIPS_H -#define ANDROID_CUTILS_ATOMIC_MIPS_H - -#include - -#ifndef ANDROID_ATOMIC_INLINE -#define ANDROID_ATOMIC_INLINE inline __attribute__((always_inline)) -#endif - -extern ANDROID_ATOMIC_INLINE void android_compiler_barrier(void) -{ - __asm__ __volatile__ ("" : : : "memory"); -} - -#if ANDROID_SMP == 0 -extern ANDROID_ATOMIC_INLINE void android_memory_barrier(void) -{ - android_compiler_barrier(); -} -extern ANDROID_ATOMIC_INLINE void android_memory_store_barrier(void) -{ - android_compiler_barrier(); -} -#else -extern ANDROID_ATOMIC_INLINE void android_memory_barrier(void) -{ - __asm__ __volatile__ ("sync" : : : "memory"); -} -extern ANDROID_ATOMIC_INLINE void android_memory_store_barrier(void) -{ - __asm__ __volatile__ ("sync" : : : "memory"); -} -#endif - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_acquire_load(volatile const int32_t *ptr) -{ - int32_t value = *ptr; - android_memory_barrier(); - return value; -} - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_release_load(volatile const int32_t *ptr) -{ - android_memory_barrier(); - return *ptr; -} - -extern ANDROID_ATOMIC_INLINE void -android_atomic_acquire_store(int32_t value, volatile int32_t *ptr) -{ - *ptr = value; - android_memory_barrier(); -} - -extern ANDROID_ATOMIC_INLINE void -android_atomic_release_store(int32_t value, volatile int32_t *ptr) -{ - android_memory_barrier(); - *ptr = value; -} - -extern ANDROID_ATOMIC_INLINE int -android_atomic_cas(int32_t old_value, int32_t new_value, volatile int32_t *ptr) -{ - int32_t prev, status; - do { - __asm__ __volatile__ ( - " ll %[prev], (%[ptr])\n" - " li %[status], 1\n" - " bne %[prev], %[old], 9f\n" - " move %[status], %[new_value]\n" - " sc %[status], (%[ptr])\n" - "9:\n" - : [prev] "=&r" (prev), [status] "=&r" (status) - : [ptr] "r" (ptr), [old] "r" (old_value), [new_value] "r" (new_value) - ); - } while (__builtin_expect(status == 0, 0)); - return prev != old_value; -} - -extern ANDROID_ATOMIC_INLINE int -android_atomic_acquire_cas(int32_t old_value, - int32_t new_value, - volatile int32_t *ptr) -{ - int status = android_atomic_cas(old_value, new_value, ptr); - android_memory_barrier(); - return status; -} - -extern ANDROID_ATOMIC_INLINE int -android_atomic_release_cas(int32_t old_value, - int32_t new_value, - volatile int32_t *ptr) -{ - android_memory_barrier(); - return android_atomic_cas(old_value, new_value, ptr); -} - - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_swap(int32_t new_value, volatile int32_t *ptr) -{ - int32_t prev, status; - do { - __asm__ __volatile__ ( - " move %[status], %[new_value]\n" - " ll %[prev], (%[ptr])\n" - " sc %[status], (%[ptr])\n" - : [prev] "=&r" (prev), [status] "=&r" (status) - : [ptr] "r" (ptr), [new_value] "r" (new_value) - ); - } while (__builtin_expect(status == 0, 0)); - android_memory_barrier(); - return prev; -} - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_add(int32_t increment, volatile int32_t *ptr) -{ - int32_t prev, status; - android_memory_barrier(); - do { - __asm__ __volatile__ ( - " ll %[prev], (%[ptr])\n" - " addu %[status], %[prev], %[inc]\n" - " sc %[status], (%[ptr])\n" - : [status] "=&r" (status), [prev] "=&r" (prev) - : [ptr] "r" (ptr), [inc] "Ir" (increment) - ); - } while (__builtin_expect(status == 0, 0)); - return prev; -} - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_inc(volatile int32_t *addr) -{ - return android_atomic_add(1, addr); -} - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_dec(volatile int32_t *addr) -{ - return android_atomic_add(-1, addr); -} - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_and(int32_t value, volatile int32_t *ptr) -{ - int32_t prev, status; - android_memory_barrier(); - do { - __asm__ __volatile__ ( - " ll %[prev], (%[ptr])\n" - " and %[status], %[prev], %[value]\n" - " sc %[status], (%[ptr])\n" - : [prev] "=&r" (prev), [status] "=&r" (status) - : [ptr] "r" (ptr), [value] "Ir" (value) - ); - } while (__builtin_expect(status == 0, 0)); - return prev; -} - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_or(int32_t value, volatile int32_t *ptr) -{ - int32_t prev, status; - android_memory_barrier(); - do { - __asm__ __volatile__ ( - " ll %[prev], (%[ptr])\n" - " or %[status], %[prev], %[value]\n" - " sc %[status], (%[ptr])\n" - : [prev] "=&r" (prev), [status] "=&r" (status) - : [ptr] "r" (ptr), [value] "Ir" (value) - ); - } while (__builtin_expect(status == 0, 0)); - return prev; -} - -#endif /* ANDROID_CUTILS_ATOMIC_MIPS_H */ diff --git a/external/android/include/19/system/core/include/cutils/atomic-x86.h b/external/android/include/19/system/core/include/cutils/atomic-x86.h deleted file mode 100644 index 9480f57..0000000 --- a/external/android/include/19/system/core/include/cutils/atomic-x86.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (C) 2010 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_CUTILS_ATOMIC_X86_H -#define ANDROID_CUTILS_ATOMIC_X86_H - -#include - -#ifndef ANDROID_ATOMIC_INLINE -#define ANDROID_ATOMIC_INLINE inline __attribute__((always_inline)) -#endif - -extern ANDROID_ATOMIC_INLINE void android_compiler_barrier(void) -{ - __asm__ __volatile__ ("" : : : "memory"); -} - -#if ANDROID_SMP == 0 -extern ANDROID_ATOMIC_INLINE void android_memory_barrier(void) -{ - android_compiler_barrier(); -} -extern ANDROID_ATOMIC_INLINE void android_memory_store_barrier(void) -{ - android_compiler_barrier(); -} -#else -extern ANDROID_ATOMIC_INLINE void android_memory_barrier(void) -{ - __asm__ __volatile__ ("mfence" : : : "memory"); -} -extern ANDROID_ATOMIC_INLINE void android_memory_store_barrier(void) -{ - android_compiler_barrier(); -} -#endif - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_acquire_load(volatile const int32_t *ptr) -{ - int32_t value = *ptr; - android_compiler_barrier(); - return value; -} - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_release_load(volatile const int32_t *ptr) -{ - android_memory_barrier(); - return *ptr; -} - -extern ANDROID_ATOMIC_INLINE void -android_atomic_acquire_store(int32_t value, volatile int32_t *ptr) -{ - *ptr = value; - android_memory_barrier(); -} - -extern ANDROID_ATOMIC_INLINE void -android_atomic_release_store(int32_t value, volatile int32_t *ptr) -{ - android_compiler_barrier(); - *ptr = value; -} - -extern ANDROID_ATOMIC_INLINE int -android_atomic_cas(int32_t old_value, int32_t new_value, volatile int32_t *ptr) -{ - int32_t prev; - __asm__ __volatile__ ("lock; cmpxchgl %1, %2" - : "=a" (prev) - : "q" (new_value), "m" (*ptr), "0" (old_value) - : "memory"); - return prev != old_value; -} - -extern ANDROID_ATOMIC_INLINE int -android_atomic_acquire_cas(int32_t old_value, - int32_t new_value, - volatile int32_t *ptr) -{ - /* Loads are not reordered with other loads. */ - return android_atomic_cas(old_value, new_value, ptr); -} - -extern ANDROID_ATOMIC_INLINE int -android_atomic_release_cas(int32_t old_value, - int32_t new_value, - volatile int32_t *ptr) -{ - /* Stores are not reordered with other stores. */ - return android_atomic_cas(old_value, new_value, ptr); -} - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_add(int32_t increment, volatile int32_t *ptr) -{ - __asm__ __volatile__ ("lock; xaddl %0, %1" - : "+r" (increment), "+m" (*ptr) - : : "memory"); - /* increment now holds the old value of *ptr */ - return increment; -} - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_inc(volatile int32_t *addr) -{ - return android_atomic_add(1, addr); -} - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_dec(volatile int32_t *addr) -{ - return android_atomic_add(-1, addr); -} - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_and(int32_t value, volatile int32_t *ptr) -{ - int32_t prev, status; - do { - prev = *ptr; - status = android_atomic_cas(prev, prev & value, ptr); - } while (__builtin_expect(status != 0, 0)); - return prev; -} - -extern ANDROID_ATOMIC_INLINE int32_t -android_atomic_or(int32_t value, volatile int32_t *ptr) -{ - int32_t prev, status; - do { - prev = *ptr; - status = android_atomic_cas(prev, prev | value, ptr); - } while (__builtin_expect(status != 0, 0)); - return prev; -} - -#endif /* ANDROID_CUTILS_ATOMIC_X86_H */ diff --git a/external/android/include/19/system/core/include/cutils/atomic.h b/external/android/include/19/system/core/include/cutils/atomic.h deleted file mode 100644 index ae42eb8..0000000 --- a/external/android/include/19/system/core/include/cutils/atomic.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * 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_CUTILS_ATOMIC_H -#define ANDROID_CUTILS_ATOMIC_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * A handful of basic atomic operations. The appropriate pthread - * functions should be used instead of these whenever possible. - * - * The "acquire" and "release" terms can be defined intuitively in terms - * of the placement of memory barriers in a simple lock implementation: - * - wait until compare-and-swap(lock-is-free --> lock-is-held) succeeds - * - barrier - * - [do work] - * - barrier - * - store(lock-is-free) - * In very crude terms, the initial (acquire) barrier prevents any of the - * "work" from happening before the lock is held, and the later (release) - * barrier ensures that all of the work happens before the lock is released. - * (Think of cached writes, cache read-ahead, and instruction reordering - * around the CAS and store instructions.) - * - * The barriers must apply to both the compiler and the CPU. Note it is - * legal for instructions that occur before an "acquire" barrier to be - * moved down below it, and for instructions that occur after a "release" - * barrier to be moved up above it. - * - * The ARM-driven implementation we use here is short on subtlety, - * and actually requests a full barrier from the compiler and the CPU. - * The only difference between acquire and release is in whether they - * are issued before or after the atomic operation with which they - * are associated. To ease the transition to C/C++ atomic intrinsics, - * you should not rely on this, and instead assume that only the minimal - * acquire/release protection is provided. - * - * NOTE: all int32_t* values are expected to be aligned on 32-bit boundaries. - * If they are not, atomicity is not guaranteed. - */ - -/* - * Basic arithmetic and bitwise operations. These all provide a - * barrier with "release" ordering, and return the previous value. - * - * These have the same characteristics (e.g. what happens on overflow) - * as the equivalent non-atomic C operations. - */ -int32_t android_atomic_inc(volatile int32_t* addr); -int32_t android_atomic_dec(volatile int32_t* addr); -int32_t android_atomic_add(int32_t value, volatile int32_t* addr); -int32_t android_atomic_and(int32_t value, volatile int32_t* addr); -int32_t android_atomic_or(int32_t value, volatile int32_t* addr); - -/* - * Perform an atomic load with "acquire" or "release" ordering. - * - * This is only necessary if you need the memory barrier. A 32-bit read - * from a 32-bit aligned address is atomic on all supported platforms. - */ -int32_t android_atomic_acquire_load(volatile const int32_t* addr); -int32_t android_atomic_release_load(volatile const int32_t* addr); - -/* - * Perform an atomic store with "acquire" or "release" ordering. - * - * This is only necessary if you need the memory barrier. A 32-bit write - * to a 32-bit aligned address is atomic on all supported platforms. - */ -void android_atomic_acquire_store(int32_t value, volatile int32_t* addr); -void android_atomic_release_store(int32_t value, volatile int32_t* addr); - -/* - * Compare-and-set operation with "acquire" or "release" ordering. - * - * This returns zero if the new value was successfully stored, which will - * only happen when *addr == oldvalue. - * - * (The return value is inverted from implementations on other platforms, - * but matches the ARM ldrex/strex result.) - * - * Implementations that use the release CAS in a loop may be less efficient - * than possible, because we re-issue the memory barrier on each iteration. - */ -int android_atomic_acquire_cas(int32_t oldvalue, int32_t newvalue, - volatile int32_t* addr); -int android_atomic_release_cas(int32_t oldvalue, int32_t newvalue, - volatile int32_t* addr); - -/* - * Aliases for code using an older version of this header. These are now - * deprecated and should not be used. The definitions will be removed - * in a future release. - */ -#define android_atomic_write android_atomic_release_store -#define android_atomic_cmpxchg android_atomic_release_cas - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // ANDROID_CUTILS_ATOMIC_H diff --git a/external/android/include/19/system/core/include/cutils/bitops.h b/external/android/include/19/system/core/include/cutils/bitops.h deleted file mode 100644 index c26dc54..0000000 --- a/external/android/include/19/system/core/include/cutils/bitops.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (C) 2011 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 __CUTILS_BITOPS_H -#define __CUTILS_BITOPS_H - -#include -#include -#include -#include - -__BEGIN_DECLS - -/* - * Bitmask Operations - * - * Note this doesn't provide any locking/exclusion, and isn't atomic. - * Additionally no bounds checking is done on the bitmask array. - * - * Example: - * - * int num_resources; - * unsigned int resource_bits[BITS_TO_WORDS(num_resources)]; - * bitmask_init(resource_bits, num_resources); - * ... - * int bit = bitmask_ffz(resource_bits, num_resources); - * bitmask_set(resource_bits, bit); - * ... - * if (bitmask_test(resource_bits, bit)) { ... } - * ... - * bitmask_clear(resource_bits, bit); - * - */ - -#define BITS_PER_WORD (sizeof(unsigned int) * 8) -#define BITS_TO_WORDS(x) (((x) + BITS_PER_WORD - 1) / BITS_PER_WORD) -#define BIT_IN_WORD(x) ((x) % BITS_PER_WORD) -#define BIT_WORD(x) ((x) / BITS_PER_WORD) -#define BIT_MASK(x) (1 << BIT_IN_WORD(x)) - -static inline void bitmask_init(unsigned int *bitmask, int num_bits) -{ - memset(bitmask, 0, BITS_TO_WORDS(num_bits)*sizeof(unsigned int)); -} - -static inline int bitmask_ffz(unsigned int *bitmask, int num_bits) -{ - int bit, result; - unsigned int i; - - for (i = 0; i < BITS_TO_WORDS(num_bits); i++) { - bit = ffs(~bitmask[i]); - if (bit) { - // ffs is 1-indexed, return 0-indexed result - bit--; - result = BITS_PER_WORD * i + bit; - if (result >= num_bits) - return -1; - return result; - } - } - return -1; -} - -static inline int bitmask_weight(unsigned int *bitmask, int num_bits) -{ - int i; - int weight = 0; - - for (i = 0; i < BITS_TO_WORDS(num_bits); i++) - weight += __builtin_popcount(bitmask[i]); - return weight; -} - -static inline void bitmask_set(unsigned int *bitmask, int bit) -{ - bitmask[BIT_WORD(bit)] |= BIT_MASK(bit); -} - -static inline void bitmask_clear(unsigned int *bitmask, int bit) -{ - bitmask[BIT_WORD(bit)] &= ~BIT_MASK(bit); -} - -static inline bool bitmask_test(unsigned int *bitmask, int bit) -{ - return bitmask[BIT_WORD(bit)] & BIT_MASK(bit); -} - -static inline int popcount(unsigned int x) -{ - return __builtin_popcount(x); -} - -static inline int popcountl(unsigned long x) -{ - return __builtin_popcountl(x); -} - -static inline int popcountll(unsigned long long x) -{ - return __builtin_popcountll(x); -} - -__END_DECLS - -#endif /* __CUTILS_BITOPS_H */ diff --git a/external/android/include/19/system/core/include/cutils/compiler.h b/external/android/include/19/system/core/include/cutils/compiler.h deleted file mode 100644 index 70f884a..0000000 --- a/external/android/include/19/system/core/include/cutils/compiler.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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_CUTILS_COMPILER_H -#define ANDROID_CUTILS_COMPILER_H - -/* - * helps the compiler's optimizer predicting branches - */ - -#ifdef __cplusplus -# define CC_LIKELY( exp ) (__builtin_expect( !!(exp), true )) -# define CC_UNLIKELY( exp ) (__builtin_expect( !!(exp), false )) -#else -# define CC_LIKELY( exp ) (__builtin_expect( !!(exp), 1 )) -# define CC_UNLIKELY( exp ) (__builtin_expect( !!(exp), 0 )) -#endif - -/** - * exports marked symbols - * - * if used on a C++ class declaration, this macro must be inserted - * after the "class" keyword. For instance: - * - * template - * class ANDROID_API Singleton { } - */ - -#define ANDROID_API __attribute__((visibility("default"))) - -#endif // ANDROID_CUTILS_COMPILER_H diff --git a/external/android/include/19/system/core/include/cutils/config_utils.h b/external/android/include/19/system/core/include/cutils/config_utils.h deleted file mode 100644 index 2dea6f1..0000000 --- a/external/android/include/19/system/core/include/cutils/config_utils.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2006 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 __CUTILS_CONFIG_UTILS_H -#define __CUTILS_CONFIG_UTILS_H - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct cnode cnode; - - -struct cnode -{ - cnode *next; - cnode *first_child; - cnode *last_child; - const char *name; - const char *value; -}; - -/* parse a text string into a config node tree */ -void config_load(cnode *root, char *data); - -/* parse a file into a config node tree */ -void config_load_file(cnode *root, const char *fn); - -/* create a single config node */ -cnode* config_node(const char *name, const char *value); - -/* locate a named child of a config node */ -cnode* config_find(cnode *root, const char *name); - -/* look up a child by name and return the boolean value */ -int config_bool(cnode *root, const char *name, int _default); - -/* look up a child by name and return the string value */ -const char* config_str(cnode *root, const char *name, const char *_default); - -/* add a named child to a config node (or modify it if it already exists) */ -void config_set(cnode *root, const char *name, const char *value); - -/* free a config node tree */ -void config_free(cnode *root); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/external/android/include/19/system/core/include/cutils/cpu_info.h b/external/android/include/19/system/core/include/cutils/cpu_info.h deleted file mode 100644 index 78c1884..0000000 --- a/external/android/include/19/system/core/include/cutils/cpu_info.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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 __CUTILS_CPU_INFO_H -#define __CUTILS_CPU_INFO_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* returns a string contiaining an ASCII representation of the CPU serial number, -** or NULL if cpu info not available. -** The string is a static variable, so don't call free() on it. -*/ -extern const char* get_cpu_serial_number(void); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_CPU_INFO_H */ diff --git a/external/android/include/19/system/core/include/cutils/debugger.h b/external/android/include/19/system/core/include/cutils/debugger.h deleted file mode 100644 index 4eda523..0000000 --- a/external/android/include/19/system/core/include/cutils/debugger.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2012 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 __CUTILS_DEBUGGER_H -#define __CUTILS_DEBUGGER_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define DEBUGGER_SOCKET_NAME "android:debuggerd" - -typedef enum { - // dump a crash - DEBUGGER_ACTION_CRASH, - // dump a tombstone file - DEBUGGER_ACTION_DUMP_TOMBSTONE, - // dump a backtrace only back to the socket - DEBUGGER_ACTION_DUMP_BACKTRACE, -} debugger_action_t; - -typedef struct { - debugger_action_t action; - pid_t tid; - uintptr_t abort_msg_address; -} debugger_msg_t; - -/* Dumps a process backtrace, registers, and stack to a tombstone file (requires root). - * Stores the tombstone path in the provided buffer. - * Returns 0 on success, -1 on error. - */ -int dump_tombstone(pid_t tid, char* pathbuf, size_t pathlen); - -/* Dumps a process backtrace only to the specified file (requires root). - * Returns 0 on success, -1 on error. - */ -int dump_backtrace_to_file(pid_t tid, int fd); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_DEBUGGER_H */ diff --git a/external/android/include/19/system/core/include/cutils/dir_hash.h b/external/android/include/19/system/core/include/cutils/dir_hash.h deleted file mode 100644 index fbb4d02..0000000 --- a/external/android/include/19/system/core/include/cutils/dir_hash.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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. - */ - -typedef enum { - SHA_1, -} HashAlgorithm; - -int get_file_hash(HashAlgorithm algorithm, const char *path, - char *output_string, size_t max_output_string); - -int get_recursive_hash_manifest(HashAlgorithm algorithm, - const char *directory_path, - char **output_string); diff --git a/external/android/include/19/system/core/include/cutils/fs.h b/external/android/include/19/system/core/include/cutils/fs.h deleted file mode 100644 index d1d4cf2..0000000 --- a/external/android/include/19/system/core/include/cutils/fs.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2012 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 __CUTILS_FS_H -#define __CUTILS_FS_H - -#include - -/* - * TEMP_FAILURE_RETRY is defined by some, but not all, versions of - * . (Alas, it is not as standard as we'd hoped!) So, if it's - * not already defined, then define it here. - */ -#ifndef TEMP_FAILURE_RETRY -/* Used to retry syscalls that can return EINTR. */ -#define TEMP_FAILURE_RETRY(exp) ({ \ - typeof (exp) _rc; \ - do { \ - _rc = (exp); \ - } while (_rc == -1 && errno == EINTR); \ - _rc; }) -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Ensure that directory exists with given mode and owners. - */ -extern int fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid); - -/* - * Read single plaintext integer from given file, correctly handling files - * partially written with fs_write_atomic_int(). - */ -extern int fs_read_atomic_int(const char* path, int* value); - -/* - * Write single plaintext integer to given file, creating backup while - * in progress. - */ -extern int fs_write_atomic_int(const char* path, int value); - -/* - * Ensure that all directories along given path exist, creating parent - * directories as needed. Validates that given path is absolute and that - * it contains no relative "." or ".." paths or symlinks. Last path segment - * is treated as filename and ignored, unless the path ends with "/". - */ -extern int fs_mkdirs(const char* path, mode_t mode); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_FS_H */ diff --git a/external/android/include/19/system/core/include/cutils/hashmap.h b/external/android/include/19/system/core/include/cutils/hashmap.h deleted file mode 100644 index 5cb344c..0000000 --- a/external/android/include/19/system/core/include/cutils/hashmap.h +++ /dev/null @@ -1,150 +0,0 @@ -/* - * 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. - */ - -/** - * Hash map. - */ - -#ifndef __HASHMAP_H -#define __HASHMAP_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** A hash map. */ -typedef struct Hashmap Hashmap; - -/** - * Creates a new hash map. Returns NULL if memory allocation fails. - * - * @param initialCapacity number of expected entries - * @param hash function which hashes keys - * @param equals function which compares keys for equality - */ -Hashmap* hashmapCreate(size_t initialCapacity, - int (*hash)(void* key), bool (*equals)(void* keyA, void* keyB)); - -/** - * Frees the hash map. Does not free the keys or values themselves. - */ -void hashmapFree(Hashmap* map); - -/** - * Hashes the memory pointed to by key with the given size. Useful for - * implementing hash functions. - */ -int hashmapHash(void* key, size_t keySize); - -/** - * Puts value for the given key in the map. Returns pre-existing value if - * any. - * - * If memory allocation fails, this function returns NULL, the map's size - * does not increase, and errno is set to ENOMEM. - */ -void* hashmapPut(Hashmap* map, void* key, void* value); - -/** - * Gets a value from the map. Returns NULL if no entry for the given key is - * found or if the value itself is NULL. - */ -void* hashmapGet(Hashmap* map, void* key); - -/** - * Returns true if the map contains an entry for the given key. - */ -bool hashmapContainsKey(Hashmap* map, void* key); - -/** - * Gets the value for a key. If a value is not found, this function gets a - * value and creates an entry using the given callback. - * - * If memory allocation fails, the callback is not called, this function - * returns NULL, and errno is set to ENOMEM. - */ -void* hashmapMemoize(Hashmap* map, void* key, - void* (*initialValue)(void* key, void* context), void* context); - -/** - * Removes an entry from the map. Returns the removed value or NULL if no - * entry was present. - */ -void* hashmapRemove(Hashmap* map, void* key); - -/** - * Gets the number of entries in this map. - */ -size_t hashmapSize(Hashmap* map); - -/** - * Invokes the given callback on each entry in the map. Stops iterating if - * the callback returns false. - */ -void hashmapForEach(Hashmap* map, - bool (*callback)(void* key, void* value, void* context), - void* context); - -/** - * Concurrency support. - */ - -/** - * Locks the hash map so only the current thread can access it. - */ -void hashmapLock(Hashmap* map); - -/** - * Unlocks the hash map so other threads can access it. - */ -void hashmapUnlock(Hashmap* map); - -/** - * Key utilities. - */ - -/** - * Hashes int keys. 'key' is a pointer to int. - */ -int hashmapIntHash(void* key); - -/** - * Compares two int keys for equality. - */ -bool hashmapIntEquals(void* keyA, void* keyB); - -/** - * For debugging. - */ - -/** - * Gets current capacity. - */ -size_t hashmapCurrentCapacity(Hashmap* map); - -/** - * Counts the number of entry collisions. - */ -size_t hashmapCountCollisions(Hashmap* map); - -#ifdef __cplusplus -} -#endif - -#endif /* __HASHMAP_H */ diff --git a/external/android/include/19/system/core/include/cutils/iosched_policy.h b/external/android/include/19/system/core/include/cutils/iosched_policy.h deleted file mode 100644 index 07c5d1f..0000000 --- a/external/android/include/19/system/core/include/cutils/iosched_policy.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 __CUTILS_IOSCHED_POLICY_H -#define __CUTILS_IOSCHED_POLICY_H - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - IoSchedClass_NONE, - IoSchedClass_RT, - IoSchedClass_BE, - IoSchedClass_IDLE, -} IoSchedClass; - -extern int android_set_ioprio(int pid, IoSchedClass clazz, int ioprio); -extern int android_get_ioprio(int pid, IoSchedClass *clazz, int *ioprio); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_IOSCHED_POLICY_H */ diff --git a/external/android/include/19/system/core/include/cutils/jstring.h b/external/android/include/19/system/core/include/cutils/jstring.h deleted file mode 100644 index ee0018f..0000000 --- a/external/android/include/19/system/core/include/cutils/jstring.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2006 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 __CUTILS_STRING16_H -#define __CUTILS_STRING16_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef uint16_t char16_t; - -extern char * strndup16to8 (const char16_t* s, size_t n); -extern size_t strnlen16to8 (const char16_t* s, size_t n); -extern char * strncpy16to8 (char *dest, const char16_t*s, size_t n); - -extern char16_t * strdup8to16 (const char* s, size_t *out_len); -extern size_t strlen8to16 (const char* utf8Str); -extern char16_t * strcpy8to16 (char16_t *dest, const char*s, size_t *out_len); -extern char16_t * strcpylen8to16 (char16_t *dest, const char*s, int length, - size_t *out_len); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_STRING16_H */ diff --git a/external/android/include/19/system/core/include/cutils/klog.h b/external/android/include/19/system/core/include/cutils/klog.h deleted file mode 100644 index ba728ac..0000000 --- a/external/android/include/19/system/core/include/cutils/klog.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2010 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 _CUTILS_KLOG_H_ -#define _CUTILS_KLOG_H_ - -#include - -__BEGIN_DECLS - -void klog_init(void); -void klog_set_level(int level); -void klog_close(void); -void klog_write(int level, const char *fmt, ...) - __attribute__ ((format(printf, 2, 3))); - -__END_DECLS - -#define KLOG_ERROR(tag,x...) klog_write(3, "<3>" tag ": " x) -#define KLOG_WARNING(tag,x...) klog_write(4, "<4>" tag ": " x) -#define KLOG_NOTICE(tag,x...) klog_write(5, "<5>" tag ": " x) -#define KLOG_INFO(tag,x...) klog_write(6, "<6>" tag ": " x) -#define KLOG_DEBUG(tag,x...) klog_write(7, "<7>" tag ": " x) - -#define KLOG_DEFAULT_LEVEL 3 /* messages <= this level are logged */ - -#endif diff --git a/external/android/include/19/system/core/include/cutils/list.h b/external/android/include/19/system/core/include/cutils/list.h deleted file mode 100644 index 3881fc9..0000000 --- a/external/android/include/19/system/core/include/cutils/list.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2010 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 _CUTILS_LIST_H_ -#define _CUTILS_LIST_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -struct listnode -{ - struct listnode *next; - struct listnode *prev; -}; - -#define node_to_item(node, container, member) \ - (container *) (((char*) (node)) - offsetof(container, member)) - -#define list_declare(name) \ - struct listnode name = { \ - .next = &name, \ - .prev = &name, \ - } - -#define list_for_each(node, list) \ - for (node = (list)->next; node != (list); node = node->next) - -#define list_for_each_reverse(node, list) \ - for (node = (list)->prev; node != (list); node = node->prev) - -void list_init(struct listnode *list); -void list_add_tail(struct listnode *list, struct listnode *item); -void list_remove(struct listnode *item); - -#define list_empty(list) ((list) == (list)->next) -#define list_head(list) ((list)->next) -#define list_tail(list) ((list)->prev) - -#ifdef __cplusplus -}; -#endif /* __cplusplus */ - -#endif diff --git a/external/android/include/19/system/core/include/cutils/log.h b/external/android/include/19/system/core/include/cutils/log.h deleted file mode 100644 index 0e0248e..0000000 --- a/external/android/include/19/system/core/include/cutils/log.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/external/android/include/19/system/core/include/cutils/memory.h b/external/android/include/19/system/core/include/cutils/memory.h deleted file mode 100644 index e725cdd..0000000 --- a/external/android/include/19/system/core/include/cutils/memory.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2006 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_CUTILS_MEMORY_H -#define ANDROID_CUTILS_MEMORY_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* size is given in bytes and must be multiple of 2 */ -void android_memset16(uint16_t* dst, uint16_t value, size_t size); - -/* size is given in bytes and must be multiple of 4 */ -void android_memset32(uint32_t* dst, uint32_t value, size_t size); - -#if !HAVE_STRLCPY -/* Declaration of strlcpy() for platforms that don't already have it. */ -size_t strlcpy(char *dst, const char *src, size_t size); -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // ANDROID_CUTILS_MEMORY_H diff --git a/external/android/include/19/system/core/include/cutils/misc.h b/external/android/include/19/system/core/include/cutils/misc.h deleted file mode 100644 index 2c48dfa..0000000 --- a/external/android/include/19/system/core/include/cutils/misc.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2006 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 __CUTILS_MISC_H -#define __CUTILS_MISC_H - -#ifdef __cplusplus -extern "C" { -#endif - - /* Load an entire file into a malloc'd chunk of memory - * that is length_of_file + 1 (null terminator). If - * sz is non-zero, return the size of the file via sz. - * Returns 0 on failure. - */ -extern void *load_file(const char *fn, unsigned *sz); - - /* Connects your process to the system debugger daemon - * so that on a crash it may be logged or interactively - * debugged (depending on system settings). - */ -extern void debuggerd_connect(void); - - - /* This is the range of UIDs (and GIDs) that are reserved - * for assigning to applications. - */ -#define FIRST_APPLICATION_UID 10000 -#define LAST_APPLICATION_UID 99999 - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_MISC_H */ diff --git a/external/android/include/19/system/core/include/cutils/multiuser.h b/external/android/include/19/system/core/include/cutils/multiuser.h deleted file mode 100644 index 635ddb1..0000000 --- a/external/android/include/19/system/core/include/cutils/multiuser.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2012 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 __CUTILS_MULTIUSER_H -#define __CUTILS_MULTIUSER_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// NOTE: keep in sync with android.os.UserId - -#define MULTIUSER_APP_PER_USER_RANGE 100000 - -typedef uid_t userid_t; -typedef uid_t appid_t; - -extern userid_t multiuser_get_user_id(uid_t uid); -extern appid_t multiuser_get_app_id(uid_t uid); -extern uid_t multiuser_get_uid(userid_t userId, appid_t appId); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_MULTIUSER_H */ diff --git a/external/android/include/19/system/core/include/cutils/native_handle.h b/external/android/include/19/system/core/include/cutils/native_handle.h deleted file mode 100644 index 268c5d3..0000000 --- a/external/android/include/19/system/core/include/cutils/native_handle.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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 NATIVE_HANDLE_H_ -#define NATIVE_HANDLE_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct native_handle -{ - int version; /* sizeof(native_handle_t) */ - int numFds; /* number of file-descriptors at &data[0] */ - int numInts; /* number of ints at &data[numFds] */ - int data[0]; /* numFds + numInts ints */ -} native_handle_t; - -/* - * native_handle_close - * - * closes the file descriptors contained in this native_handle_t - * - * return 0 on success, or a negative error code on failure - * - */ -int native_handle_close(const native_handle_t* h); - - -/* - * native_handle_create - * - * creates a native_handle_t and initializes it. must be destroyed with - * native_handle_delete(). - * - */ -native_handle_t* native_handle_create(int numFds, int numInts); - -/* - * native_handle_delete - * - * frees a native_handle_t allocated with native_handle_create(). - * This ONLY frees the memory allocated for the native_handle_t, but doesn't - * close the file descriptors; which can be achieved with native_handle_close(). - * - * return 0 on success, or a negative error code on failure - * - */ -int native_handle_delete(native_handle_t* h); - - -#ifdef __cplusplus -} -#endif - -#endif /* NATIVE_HANDLE_H_ */ diff --git a/external/android/include/19/system/core/include/cutils/open_memstream.h b/external/android/include/19/system/core/include/cutils/open_memstream.h deleted file mode 100644 index b7998be..0000000 --- a/external/android/include/19/system/core/include/cutils/open_memstream.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2010 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 __CUTILS_OPEN_MEMSTREAM_H__ -#define __CUTILS_OPEN_MEMSTREAM_H__ - -#include - -#ifndef HAVE_OPEN_MEMSTREAM - -#ifdef __cplusplus -extern "C" { -#endif - -FILE* open_memstream(char** bufp, size_t* sizep); - -#ifdef __cplusplus -} -#endif - -#endif /*!HAVE_OPEN_MEMSTREAM*/ - -#endif /*__CUTILS_OPEN_MEMSTREAM_H__*/ diff --git a/external/android/include/19/system/core/include/cutils/partition_utils.h b/external/android/include/19/system/core/include/cutils/partition_utils.h deleted file mode 100644 index 597df92..0000000 --- a/external/android/include/19/system/core/include/cutils/partition_utils.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2011, 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 __CUTILS_PARTITION_WIPED_H__ -#define __CUTILS_PARTITION_WIPED_H__ - -__BEGIN_DECLS - -int partition_wiped(char *source); -void erase_footer(const char *dev_path, long long size); - -__END_DECLS - -#endif /* __CUTILS_PARTITION_WIPED_H__ */ diff --git a/external/android/include/19/system/core/include/cutils/process_name.h b/external/android/include/19/system/core/include/cutils/process_name.h deleted file mode 100644 index 1e72e5c..0000000 --- a/external/android/include/19/system/core/include/cutils/process_name.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ - -/** - * Gives the current process a name. - */ - -#ifndef __PROCESS_NAME_H -#define __PROCESS_NAME_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Sets the current process name. - * - * Warning: This leaks a string every time you call it. Use judiciously! - */ -void set_process_name(const char* process_name); - -/** Gets the current process name. */ -const char* get_process_name(void); - -#ifdef __cplusplus -} -#endif - -#endif /* __PROCESS_NAME_H */ diff --git a/external/android/include/19/system/core/include/cutils/properties.h b/external/android/include/19/system/core/include/cutils/properties.h deleted file mode 100644 index 2c70165..0000000 --- a/external/android/include/19/system/core/include/cutils/properties.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 2006 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 __CUTILS_PROPERTIES_H -#define __CUTILS_PROPERTIES_H - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* System properties are *small* name value pairs managed by the -** property service. If your data doesn't fit in the provided -** space it is not appropriate for a system property. -** -** WARNING: system/bionic/include/sys/system_properties.h also defines -** these, but with different names. (TODO: fix that) -*/ -#define PROPERTY_KEY_MAX PROP_NAME_MAX -#define PROPERTY_VALUE_MAX PROP_VALUE_MAX - -/* property_get: returns the length of the value which will never be -** greater than PROPERTY_VALUE_MAX - 1 and will always be zero terminated. -** (the length does not include the terminating zero). -** -** If the property read fails or returns an empty value, the default -** value is used (if nonnull). -*/ -int property_get(const char *key, char *value, const char *default_value); - -/* property_set: returns 0 on success, < 0 on failure -*/ -int property_set(const char *key, const char *value); - -int property_list(void (*propfn)(const char *key, const char *value, void *cookie), void *cookie); - -#if defined(__BIONIC_FORTIFY) - -extern int __property_get_real(const char *, char *, const char *) - __asm__(__USER_LABEL_PREFIX__ "property_get"); -__errordecl(__property_get_too_small_error, "property_get() called with too small of a buffer"); - -__BIONIC_FORTIFY_INLINE -int property_get(const char *key, char *value, const char *default_value) { - size_t bos = __bos(value); - if (bos < PROPERTY_VALUE_MAX) { - __property_get_too_small_error(); - } - return __property_get_real(key, value, default_value); -} - -#endif - -#ifdef HAVE_SYSTEM_PROPERTY_SERVER -/* - * We have an external property server instead of built-in libc support. - * Used by the simulator. - */ -#define SYSTEM_PROPERTY_PIPE_NAME "/tmp/android-sysprop" - -enum { - kSystemPropertyUnknown = 0, - kSystemPropertyGet, - kSystemPropertySet, - kSystemPropertyList -}; -#endif /*HAVE_SYSTEM_PROPERTY_SERVER*/ - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/external/android/include/19/system/core/include/cutils/qtaguid.h b/external/android/include/19/system/core/include/cutils/qtaguid.h deleted file mode 100644 index f8550fd..0000000 --- a/external/android/include/19/system/core/include/cutils/qtaguid.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2011 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 __CUTILS_QTAGUID_H -#define __CUTILS_QTAGUID_H - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Set tags (and owning UIDs) for network sockets. -*/ -extern int qtaguid_tagSocket(int sockfd, int tag, uid_t uid); - -/* - * Untag a network socket before closing. -*/ -extern int qtaguid_untagSocket(int sockfd); - -/* - * For the given uid, switch counter sets. - * The kernel only keeps a limited number of sets. - * 2 for now. - */ -extern int qtaguid_setCounterSet(int counterSetNum, uid_t uid); - -/* - * Delete all tag info that relates to the given tag an uid. - * If the tag is 0, then ALL info about the uid is freeded. - * The delete data also affects active tagged socketd, which are - * then untagged. - * The calling process can only operate on its own tags. - * Unless it is part of the happy AID_NET_BW_ACCT group. - * In which case it can clobber everything. - */ -extern int qtaguid_deleteTagData(int tag, uid_t uid); - -/* - * Enable/disable qtaguid functionnality at a lower level. - * When pacified, the kernel will accept commands but do nothing. - */ -extern int qtaguid_setPacifier(int on); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_QTAG_UID_H */ diff --git a/external/android/include/19/system/core/include/cutils/record_stream.h b/external/android/include/19/system/core/include/cutils/record_stream.h deleted file mode 100644 index bfac87a..0000000 --- a/external/android/include/19/system/core/include/cutils/record_stream.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2006 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. - */ - -/* - * A simple utility for reading fixed records out of a stream fd - */ - -#ifndef _CUTILS_RECORD_STREAM_H -#define _CUTILS_RECORD_STREAM_H - -#ifdef __cplusplus -extern "C" { -#endif - - -typedef struct RecordStream RecordStream; - -extern RecordStream *record_stream_new(int fd, size_t maxRecordLen); -extern void record_stream_free(RecordStream *p_rs); - -extern int record_stream_get_next (RecordStream *p_rs, void ** p_outRecord, - size_t *p_outRecordLen); - -#ifdef __cplusplus -} -#endif - - -#endif /*_CUTILS_RECORD_STREAM_H*/ - diff --git a/external/android/include/19/system/core/include/cutils/sched_policy.h b/external/android/include/19/system/core/include/cutils/sched_policy.h deleted file mode 100644 index ba84ce3..0000000 --- a/external/android/include/19/system/core/include/cutils/sched_policy.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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 __CUTILS_SCHED_POLICY_H -#define __CUTILS_SCHED_POLICY_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* Keep in sync with THREAD_GROUP_* in frameworks/base/core/java/android/os/Process.java */ -typedef enum { - SP_DEFAULT = -1, - SP_BACKGROUND = 0, - SP_FOREGROUND = 1, - SP_SYSTEM = 2, // can't be used with set_sched_policy() - SP_AUDIO_APP = 3, - SP_AUDIO_SYS = 4, - SP_CNT, - SP_MAX = SP_CNT - 1, - SP_SYSTEM_DEFAULT = SP_FOREGROUND, -} SchedPolicy; - -/* Assign thread tid to the cgroup associated with the specified policy. - * If the thread is a thread group leader, that is it's gettid() == getpid(), - * then the other threads in the same thread group are _not_ affected. - * On platforms which support gettid(), zero tid means current thread. - * Return value: 0 for success, or -errno for error. - */ -extern int set_sched_policy(int tid, SchedPolicy policy); - -/* Return the policy associated with the cgroup of thread tid via policy pointer. - * On platforms which support gettid(), zero tid means current thread. - * Return value: 0 for success, or -1 for error and set errno. - */ -extern int get_sched_policy(int tid, SchedPolicy *policy); - -/* Return a displayable string corresponding to policy. - * Return value: non-NULL NUL-terminated name of unspecified length; - * the caller is responsible for displaying the useful part of the string. - */ -extern const char *get_sched_policy_name(SchedPolicy policy); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_SCHED_POLICY_H */ diff --git a/external/android/include/19/system/core/include/cutils/sockets.h b/external/android/include/19/system/core/include/cutils/sockets.h deleted file mode 100644 index 19cae0c..0000000 --- a/external/android/include/19/system/core/include/cutils/sockets.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2006 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 __CUTILS_SOCKETS_H -#define __CUTILS_SOCKETS_H - -#include -#include -#include -#include - -#ifdef HAVE_WINSOCK -#include -typedef int socklen_t; -#elif HAVE_SYS_SOCKET_H -#include -#endif - -#define ANDROID_SOCKET_ENV_PREFIX "ANDROID_SOCKET_" -#define ANDROID_SOCKET_DIR "/dev/socket" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * android_get_control_socket - simple helper function to get the file - * descriptor of our init-managed Unix domain socket. `name' is the name of the - * socket, as given in init.rc. Returns -1 on error. - * - * This is inline and not in libcutils proper because we want to use this in - * third-party daemons with minimal modification. - */ -static inline int android_get_control_socket(const char *name) -{ - char key[64] = ANDROID_SOCKET_ENV_PREFIX; - const char *val; - int fd; - - /* build our environment variable, counting cycles like a wolf ... */ -#if HAVE_STRLCPY - strlcpy(key + sizeof(ANDROID_SOCKET_ENV_PREFIX) - 1, - name, - sizeof(key) - sizeof(ANDROID_SOCKET_ENV_PREFIX)); -#else /* for the host, which may lack the almightly strncpy ... */ - strncpy(key + sizeof(ANDROID_SOCKET_ENV_PREFIX) - 1, - name, - sizeof(key) - sizeof(ANDROID_SOCKET_ENV_PREFIX)); - key[sizeof(key)-1] = '\0'; -#endif - - val = getenv(key); - if (!val) - return -1; - - errno = 0; - fd = strtol(val, NULL, 10); - if (errno) - return -1; - - return fd; -} - -/* - * See also android.os.LocalSocketAddress.Namespace - */ -// Linux "abstract" (non-filesystem) namespace -#define ANDROID_SOCKET_NAMESPACE_ABSTRACT 0 -// Android "reserved" (/dev/socket) namespace -#define ANDROID_SOCKET_NAMESPACE_RESERVED 1 -// Normal filesystem namespace -#define ANDROID_SOCKET_NAMESPACE_FILESYSTEM 2 - -extern int socket_loopback_client(int port, int type); -extern int socket_network_client(const char *host, int port, int type); -extern int socket_loopback_server(int port, int type); -extern int socket_local_server(const char *name, int namespaceId, int type); -extern int socket_local_server_bind(int s, const char *name, int namespaceId); -extern int socket_local_client_connect(int fd, - const char *name, int namespaceId, int type); -extern int socket_local_client(const char *name, int namespaceId, int type); -extern int socket_inaddr_any_server(int port, int type); - -/* - * socket_peer_is_trusted - Takes a socket which is presumed to be a - * connected local socket (e.g. AF_LOCAL) and returns whether the peer - * (the userid that owns the process on the other end of that socket) - * is one of the two trusted userids, root or shell. - * - * Note: This only works as advertised on the Android OS and always - * just returns true when called on other operating systems. - */ -extern bool socket_peer_is_trusted(int fd); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_SOCKETS_H */ diff --git a/external/android/include/19/system/core/include/cutils/str_parms.h b/external/android/include/19/system/core/include/cutils/str_parms.h deleted file mode 100644 index 247c996..0000000 --- a/external/android/include/19/system/core/include/cutils/str_parms.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2011 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 __CUTILS_STR_PARMS_H -#define __CUTILS_STR_PARMS_H - -#include - -struct str_parms; - -struct str_parms *str_parms_create(void); -struct str_parms *str_parms_create_str(const char *_string); -void str_parms_destroy(struct str_parms *str_parms); - -void str_parms_del(struct str_parms *str_parms, const char *key); - -int str_parms_add_str(struct str_parms *str_parms, const char *key, - const char *value); -int str_parms_add_int(struct str_parms *str_parms, const char *key, int value); - -int str_parms_add_float(struct str_parms *str_parms, const char *key, - float value); - -int str_parms_get_str(struct str_parms *str_parms, const char *key, - char *out_val, int len); -int str_parms_get_int(struct str_parms *str_parms, const char *key, - int *out_val); -int str_parms_get_float(struct str_parms *str_parms, const char *key, - float *out_val); - -char *str_parms_to_str(struct str_parms *str_parms); - -/* debug */ -void str_parms_dump(struct str_parms *str_parms); - -#endif /* __CUTILS_STR_PARMS_H */ diff --git a/external/android/include/19/system/core/include/cutils/threads.h b/external/android/include/19/system/core/include/cutils/threads.h deleted file mode 100644 index acf8f48..0000000 --- a/external/android/include/19/system/core/include/cutils/threads.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - * 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 _LIBS_CUTILS_THREADS_H -#define _LIBS_CUTILS_THREADS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/***********************************************************************/ -/***********************************************************************/ -/***** *****/ -/***** local thread storage *****/ -/***** *****/ -/***********************************************************************/ -/***********************************************************************/ - -#ifdef HAVE_PTHREADS - -#include - -typedef struct { - pthread_mutex_t lock; - int has_tls; - pthread_key_t tls; - -} thread_store_t; - -#define THREAD_STORE_INITIALIZER { PTHREAD_MUTEX_INITIALIZER, 0, 0 } - -#elif defined HAVE_WIN32_THREADS - -#include - -typedef struct { - int lock_init; - int has_tls; - DWORD tls; - CRITICAL_SECTION lock; - -} thread_store_t; - -#define THREAD_STORE_INITIALIZER { 0, 0, 0, {0, 0, 0, 0, 0, 0} } - -#else -# error "no thread_store_t implementation for your platform !!" -#endif - -typedef void (*thread_store_destruct_t)(void* value); - -extern void* thread_store_get(thread_store_t* store); - -extern void thread_store_set(thread_store_t* store, - void* value, - thread_store_destruct_t destroy); - -/***********************************************************************/ -/***********************************************************************/ -/***** *****/ -/***** mutexes *****/ -/***** *****/ -/***********************************************************************/ -/***********************************************************************/ - -#ifdef HAVE_PTHREADS - -typedef pthread_mutex_t mutex_t; - -#define MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER - -static __inline__ void mutex_lock(mutex_t* lock) -{ - pthread_mutex_lock(lock); -} -static __inline__ void mutex_unlock(mutex_t* lock) -{ - pthread_mutex_unlock(lock); -} -static __inline__ int mutex_init(mutex_t* lock) -{ - return pthread_mutex_init(lock, NULL); -} -static __inline__ void mutex_destroy(mutex_t* lock) -{ - pthread_mutex_destroy(lock); -} -#endif - -#ifdef HAVE_WIN32_THREADS -typedef struct { - int init; - CRITICAL_SECTION lock[1]; -} mutex_t; - -#define MUTEX_INITIALIZER { 0, {{ NULL, 0, 0, NULL, NULL, 0 }} } - -static __inline__ void mutex_lock(mutex_t* lock) -{ - if (!lock->init) { - lock->init = 1; - InitializeCriticalSection( lock->lock ); - lock->init = 2; - } else while (lock->init != 2) - Sleep(10); - - EnterCriticalSection(lock->lock); -} - -static __inline__ void mutex_unlock(mutex_t* lock) -{ - LeaveCriticalSection(lock->lock); -} -static __inline__ int mutex_init(mutex_t* lock) -{ - InitializeCriticalSection(lock->lock); - lock->init = 2; - return 0; -} -static __inline__ void mutex_destroy(mutex_t* lock) -{ - if (lock->init) { - lock->init = 0; - DeleteCriticalSection(lock->lock); - } -} -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* _LIBS_CUTILS_THREADS_H */ diff --git a/external/android/include/19/system/core/include/cutils/trace.h b/external/android/include/19/system/core/include/cutils/trace.h deleted file mode 100644 index 1c8f107..0000000 --- a/external/android/include/19/system/core/include/cutils/trace.h +++ /dev/null @@ -1,294 +0,0 @@ -/* - * Copyright (C) 2012 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 _LIBS_CUTILS_TRACE_H -#define _LIBS_CUTILS_TRACE_H - -#include -#include -#include -#include -#include -#include - -#ifdef ANDROID_SMP -#include -#else -#include -#endif - -__BEGIN_DECLS - -/** - * The ATRACE_TAG macro can be defined before including this header to trace - * using one of the tags defined below. It must be defined to one of the - * following ATRACE_TAG_* macros. The trace tag is used to filter tracing in - * userland to avoid some of the runtime cost of tracing when it is not desired. - * - * Defining ATRACE_TAG to be ATRACE_TAG_ALWAYS will result in the tracing always - * being enabled - this should ONLY be done for debug code, as userland tracing - * has a performance cost even when the trace is not being recorded. Defining - * ATRACE_TAG to be ATRACE_TAG_NEVER or leaving ATRACE_TAG undefined will result - * in the tracing always being disabled. - * - * ATRACE_TAG_HAL should be bitwise ORed with the relevant tags for tracing - * within a hardware module. For example a camera hardware module would set: - * #define ATRACE_TAG (ATRACE_TAG_CAMERA | ATRACE_TAG_HAL) - * - * Keep these in sync with frameworks/base/core/java/android/os/Trace.java. - */ -#define ATRACE_TAG_NEVER 0 // This tag is never enabled. -#define ATRACE_TAG_ALWAYS (1<<0) // This tag is always enabled. -#define ATRACE_TAG_GRAPHICS (1<<1) -#define ATRACE_TAG_INPUT (1<<2) -#define ATRACE_TAG_VIEW (1<<3) -#define ATRACE_TAG_WEBVIEW (1<<4) -#define ATRACE_TAG_WINDOW_MANAGER (1<<5) -#define ATRACE_TAG_ACTIVITY_MANAGER (1<<6) -#define ATRACE_TAG_SYNC_MANAGER (1<<7) -#define ATRACE_TAG_AUDIO (1<<8) -#define ATRACE_TAG_VIDEO (1<<9) -#define ATRACE_TAG_CAMERA (1<<10) -#define ATRACE_TAG_HAL (1<<11) -#define ATRACE_TAG_APP (1<<12) -#define ATRACE_TAG_RESOURCES (1<<13) -#define ATRACE_TAG_DALVIK (1<<14) -#define ATRACE_TAG_RS (1<<15) -#define ATRACE_TAG_LAST ATRACE_TAG_RS - -// Reserved for initialization. -#define ATRACE_TAG_NOT_READY (1LL<<63) - -#define ATRACE_TAG_VALID_MASK ((ATRACE_TAG_LAST - 1) | ATRACE_TAG_LAST) - -#ifndef ATRACE_TAG -#define ATRACE_TAG ATRACE_TAG_NEVER -#elif ATRACE_TAG > ATRACE_TAG_VALID_MASK -#error ATRACE_TAG must be defined to be one of the tags defined in cutils/trace.h -#endif - -#ifdef HAVE_ANDROID_OS -/** - * Maximum size of a message that can be logged to the trace buffer. - * Note this message includes a tag, the pid, and the string given as the name. - * Names should be kept short to get the most use of the trace buffer. - */ -#define ATRACE_MESSAGE_LENGTH 1024 - -/** - * Opens the trace file for writing and reads the property for initial tags. - * The atrace.tags.enableflags property sets the tags to trace. - * This function should not be explicitly called, the first call to any normal - * trace function will cause it to be run safely. - */ -void atrace_setup(); - -/** - * If tracing is ready, set atrace_enabled_tags to the system property - * debug.atrace.tags.enableflags. Can be used as a sysprop change callback. - */ -void atrace_update_tags(); - -/** - * Set whether the process is debuggable. By default the process is not - * considered debuggable. If the process is not debuggable then application- - * level tracing is not allowed unless the ro.debuggable system property is - * set to '1'. - */ -void atrace_set_debuggable(bool debuggable); - -/** - * Set whether tracing is enabled for the current process. This is used to - * prevent tracing within the Zygote process. - */ -void atrace_set_tracing_enabled(bool enabled); - -/** - * Flag indicating whether setup has been completed, initialized to 0. - * Nonzero indicates setup has completed. - * Note: This does NOT indicate whether or not setup was successful. - */ -extern volatile int32_t atrace_is_ready; - -/** - * Set of ATRACE_TAG flags to trace for, initialized to ATRACE_TAG_NOT_READY. - * A value of zero indicates setup has failed. - * Any other nonzero value indicates setup has succeeded, and tracing is on. - */ -extern uint64_t atrace_enabled_tags; - -/** - * Handle to the kernel's trace buffer, initialized to -1. - * Any other value indicates setup has succeeded, and is a valid fd for tracing. - */ -extern int atrace_marker_fd; - -/** - * atrace_init readies the process for tracing by opening the trace_marker file. - * Calling any trace function causes this to be run, so calling it is optional. - * This can be explicitly run to avoid setup delay on first trace function. - */ -#define ATRACE_INIT() atrace_init() -static inline void atrace_init() -{ - if (CC_UNLIKELY(!android_atomic_acquire_load(&atrace_is_ready))) { - atrace_setup(); - } -} - -/** - * Get the mask of all tags currently enabled. - * It can be used as a guard condition around more expensive trace calculations. - * Every trace function calls this, which ensures atrace_init is run. - */ -#define ATRACE_GET_ENABLED_TAGS() atrace_get_enabled_tags() -static inline uint64_t atrace_get_enabled_tags() -{ - atrace_init(); - return atrace_enabled_tags; -} - -/** - * Test if a given tag is currently enabled. - * Returns nonzero if the tag is enabled, otherwise zero. - * It can be used as a guard condition around more expensive trace calculations. - */ -#define ATRACE_ENABLED() atrace_is_tag_enabled(ATRACE_TAG) -static inline uint64_t atrace_is_tag_enabled(uint64_t tag) -{ - return atrace_get_enabled_tags() & tag; -} - -/** - * Trace the beginning of a context. name is used to identify the context. - * This is often used to time function execution. - */ -#define ATRACE_BEGIN(name) atrace_begin(ATRACE_TAG, name) -static inline void atrace_begin(uint64_t tag, const char* name) -{ - if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { - char buf[ATRACE_MESSAGE_LENGTH]; - size_t len; - - len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "B|%d|%s", getpid(), name); - write(atrace_marker_fd, buf, len); - } -} - -/** - * Trace the end of a context. - * This should match up (and occur after) a corresponding ATRACE_BEGIN. - */ -#define ATRACE_END() atrace_end(ATRACE_TAG) -static inline void atrace_end(uint64_t tag) -{ - if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { - char c = 'E'; - write(atrace_marker_fd, &c, 1); - } -} - -/** - * Trace the beginning of an asynchronous event. Unlike ATRACE_BEGIN/ATRACE_END - * contexts, asynchronous events do not need to be nested. The name describes - * the event, and the cookie provides a unique identifier for distinguishing - * simultaneous events. The name and cookie used to begin an event must be - * used to end it. - */ -#define ATRACE_ASYNC_BEGIN(name, cookie) \ - atrace_async_begin(ATRACE_TAG, name, cookie) -static inline void atrace_async_begin(uint64_t tag, const char* name, - int32_t cookie) -{ - if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { - char buf[ATRACE_MESSAGE_LENGTH]; - size_t len; - - len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "S|%d|%s|%d", getpid(), - name, cookie); - write(atrace_marker_fd, buf, len); - } -} - -/** - * Trace the end of an asynchronous event. - * This should have a corresponding ATRACE_ASYNC_BEGIN. - */ -#define ATRACE_ASYNC_END(name, cookie) atrace_async_end(ATRACE_TAG, name, cookie) -static inline void atrace_async_end(uint64_t tag, const char* name, - int32_t cookie) -{ - if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { - char buf[ATRACE_MESSAGE_LENGTH]; - size_t len; - - len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "F|%d|%s|%d", getpid(), - name, cookie); - write(atrace_marker_fd, buf, len); - } -} - - -/** - * Traces an integer counter value. name is used to identify the counter. - * This can be used to track how a value changes over time. - */ -#define ATRACE_INT(name, value) atrace_int(ATRACE_TAG, name, value) -static inline void atrace_int(uint64_t tag, const char* name, int32_t value) -{ - if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { - char buf[ATRACE_MESSAGE_LENGTH]; - size_t len; - - len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "C|%d|%s|%d", - getpid(), name, value); - write(atrace_marker_fd, buf, len); - } -} - -/** - * Traces a 64-bit integer counter value. name is used to identify the - * counter. This can be used to track how a value changes over time. - */ -#define ATRACE_INT64(name, value) atrace_int64(ATRACE_TAG, name, value) -static inline void atrace_int64(uint64_t tag, const char* name, int64_t value) -{ - if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) { - char buf[ATRACE_MESSAGE_LENGTH]; - size_t len; - - len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "C|%d|%s|%lld", - getpid(), name, value); - write(atrace_marker_fd, buf, len); - } -} - -#else // not HAVE_ANDROID_OS - -#define ATRACE_INIT() -#define ATRACE_GET_ENABLED_TAGS() -#define ATRACE_ENABLED() 0 -#define ATRACE_BEGIN(name) -#define ATRACE_END() -#define ATRACE_ASYNC_BEGIN(name, cookie) -#define ATRACE_ASYNC_END(name, cookie) -#define ATRACE_INT(name, value) - -#endif // not HAVE_ANDROID_OS - -__END_DECLS - -#endif // _LIBS_CUTILS_TRACE_H diff --git a/external/android/include/19/system/core/include/cutils/tztime.h b/external/android/include/19/system/core/include/cutils/tztime.h deleted file mode 100644 index dbdbd60..0000000 --- a/external/android/include/19/system/core/include/cutils/tztime.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2006 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 _CUTILS_TZTIME_H -#define _CUTILS_TZTIME_H - -// TODO: fix both callers to just include themselves. -#include - -#endif /* __CUTILS_TZTIME_H */ - diff --git a/external/android/include/19/system/core/include/cutils/uevent.h b/external/android/include/19/system/core/include/cutils/uevent.h deleted file mode 100644 index 4cca7e5..0000000 --- a/external/android/include/19/system/core/include/cutils/uevent.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2011 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 __CUTILS_UEVENT_H -#define __CUTILS_UEVENT_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -int uevent_open_socket(int buf_sz, bool passcred); -ssize_t uevent_kernel_multicast_recv(int socket, void *buffer, size_t length); -ssize_t uevent_kernel_multicast_uid_recv(int socket, void *buffer, size_t length, uid_t *uid); - -#ifdef __cplusplus -} -#endif - -#endif /* __CUTILS_UEVENT_H */ diff --git a/external/android/include/19/system/core/include/log/event_tag_map.h b/external/android/include/19/system/core/include/log/event_tag_map.h deleted file mode 100644 index 1653c61..0000000 --- a/external/android/include/19/system/core/include/log/event_tag_map.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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 _LIBS_CUTILS_EVENTTAGMAP_H -#define _LIBS_CUTILS_EVENTTAGMAP_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define EVENT_TAG_MAP_FILE "/system/etc/event-log-tags" - -struct EventTagMap; -typedef struct EventTagMap EventTagMap; - -/* - * Open the specified file as an event log tag map. - * - * Returns NULL on failure. - */ -EventTagMap* android_openEventTagMap(const char* fileName); - -/* - * Close the map. - */ -void android_closeEventTagMap(EventTagMap* map); - -/* - * Look up a tag by index. Returns the tag string, or NULL if not found. - */ -const char* android_lookupEventTag(const EventTagMap* map, int tag); - -#ifdef __cplusplus -} -#endif - -#endif /*_LIBS_CUTILS_EVENTTAGMAP_H*/ diff --git a/external/android/include/19/system/core/include/log/log.h b/external/android/include/19/system/core/include/log/log.h deleted file mode 100644 index 7faddea..0000000 --- a/external/android/include/19/system/core/include/log/log.h +++ /dev/null @@ -1,563 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// C/C++ logging functions. See the logging documentation for API details. -// -// We'd like these to be available from C code (in case we import some from -// somewhere), so this has a C interface. -// -// The output will be correct when the log file is shared between multiple -// threads and/or multiple processes so long as the operating system -// supports O_APPEND. These calls have mutex-protected data structures -// and so are NOT reentrant. Do not use LOG in a signal handler. -// -#ifndef _LIBS_LOG_LOG_H -#define _LIBS_LOG_LOG_H - -#include -#include -#include -#include -#ifdef HAVE_PTHREADS -#include -#endif -#include - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// --------------------------------------------------------------------- - -/* - * Normally we strip ALOGV (VERBOSE messages) from release builds. - * You can modify this (for example with "#define LOG_NDEBUG 0" - * at the top of your source file) to change that behavior. - */ -#ifndef LOG_NDEBUG -#ifdef NDEBUG -#define LOG_NDEBUG 1 -#else -#define LOG_NDEBUG 0 -#endif -#endif - -/* - * This is the local tag used for the following simplified - * logging macros. You can change this preprocessor definition - * before using the other macros to change the tag. - */ -#ifndef LOG_TAG -#define LOG_TAG NULL -#endif - -// --------------------------------------------------------------------- - -/* - * Simplified macro to send a verbose log message using the current LOG_TAG. - */ -#ifndef ALOGV -#if LOG_NDEBUG -#define ALOGV(...) ((void)0) -#else -#define ALOGV(...) ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) -#endif -#endif - -#define CONDITION(cond) (__builtin_expect((cond)!=0, 0)) - -#ifndef ALOGV_IF -#if LOG_NDEBUG -#define ALOGV_IF(cond, ...) ((void)0) -#else -#define ALOGV_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif -#endif - -/* - * Simplified macro to send a debug log message using the current LOG_TAG. - */ -#ifndef ALOGD -#define ALOGD(...) ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef ALOGD_IF -#define ALOGD_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send an info log message using the current LOG_TAG. - */ -#ifndef ALOGI -#define ALOGI(...) ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef ALOGI_IF -#define ALOGI_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send a warning log message using the current LOG_TAG. - */ -#ifndef ALOGW -#define ALOGW(...) ((void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef ALOGW_IF -#define ALOGW_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send an error log message using the current LOG_TAG. - */ -#ifndef ALOGE -#define ALOGE(...) ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef ALOGE_IF -#define ALOGE_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -// --------------------------------------------------------------------- - -/* - * Conditional based on whether the current LOG_TAG is enabled at - * verbose priority. - */ -#ifndef IF_ALOGV -#if LOG_NDEBUG -#define IF_ALOGV() if (false) -#else -#define IF_ALOGV() IF_ALOG(LOG_VERBOSE, LOG_TAG) -#endif -#endif - -/* - * Conditional based on whether the current LOG_TAG is enabled at - * debug priority. - */ -#ifndef IF_ALOGD -#define IF_ALOGD() IF_ALOG(LOG_DEBUG, LOG_TAG) -#endif - -/* - * Conditional based on whether the current LOG_TAG is enabled at - * info priority. - */ -#ifndef IF_ALOGI -#define IF_ALOGI() IF_ALOG(LOG_INFO, LOG_TAG) -#endif - -/* - * Conditional based on whether the current LOG_TAG is enabled at - * warn priority. - */ -#ifndef IF_ALOGW -#define IF_ALOGW() IF_ALOG(LOG_WARN, LOG_TAG) -#endif - -/* - * Conditional based on whether the current LOG_TAG is enabled at - * error priority. - */ -#ifndef IF_ALOGE -#define IF_ALOGE() IF_ALOG(LOG_ERROR, LOG_TAG) -#endif - - -// --------------------------------------------------------------------- - -/* - * Simplified macro to send a verbose system log message using the current LOG_TAG. - */ -#ifndef SLOGV -#if LOG_NDEBUG -#define SLOGV(...) ((void)0) -#else -#define SLOGV(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) -#endif -#endif - -#define CONDITION(cond) (__builtin_expect((cond)!=0, 0)) - -#ifndef SLOGV_IF -#if LOG_NDEBUG -#define SLOGV_IF(cond, ...) ((void)0) -#else -#define SLOGV_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif -#endif - -/* - * Simplified macro to send a debug system log message using the current LOG_TAG. - */ -#ifndef SLOGD -#define SLOGD(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef SLOGD_IF -#define SLOGD_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send an info system log message using the current LOG_TAG. - */ -#ifndef SLOGI -#define SLOGI(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef SLOGI_IF -#define SLOGI_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send a warning system log message using the current LOG_TAG. - */ -#ifndef SLOGW -#define SLOGW(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef SLOGW_IF -#define SLOGW_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send an error system log message using the current LOG_TAG. - */ -#ifndef SLOGE -#define SLOGE(...) ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef SLOGE_IF -#define SLOGE_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -// --------------------------------------------------------------------- - -/* - * Simplified macro to send a verbose radio log message using the current LOG_TAG. - */ -#ifndef RLOGV -#if LOG_NDEBUG -#define RLOGV(...) ((void)0) -#else -#define RLOGV(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) -#endif -#endif - -#define CONDITION(cond) (__builtin_expect((cond)!=0, 0)) - -#ifndef RLOGV_IF -#if LOG_NDEBUG -#define RLOGV_IF(cond, ...) ((void)0) -#else -#define RLOGV_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif -#endif - -/* - * Simplified macro to send a debug radio log message using the current LOG_TAG. - */ -#ifndef RLOGD -#define RLOGD(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef RLOGD_IF -#define RLOGD_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send an info radio log message using the current LOG_TAG. - */ -#ifndef RLOGI -#define RLOGI(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef RLOGI_IF -#define RLOGI_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send a warning radio log message using the current LOG_TAG. - */ -#ifndef RLOGW -#define RLOGW(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef RLOGW_IF -#define RLOGW_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - -/* - * Simplified macro to send an error radio log message using the current LOG_TAG. - */ -#ifndef RLOGE -#define RLOGE(...) ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) -#endif - -#ifndef RLOGE_IF -#define RLOGE_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)) \ - : (void)0 ) -#endif - - -// --------------------------------------------------------------------- - -/* - * Log a fatal error. If the given condition fails, this stops program - * execution like a normal assertion, but also generating the given message. - * It is NOT stripped from release builds. Note that the condition test - * is -inverted- from the normal assert() semantics. - */ -#ifndef LOG_ALWAYS_FATAL_IF -#define LOG_ALWAYS_FATAL_IF(cond, ...) \ - ( (CONDITION(cond)) \ - ? ((void)android_printAssert(#cond, LOG_TAG, ## __VA_ARGS__)) \ - : (void)0 ) -#endif - -#ifndef LOG_ALWAYS_FATAL -#define LOG_ALWAYS_FATAL(...) \ - ( ((void)android_printAssert(NULL, LOG_TAG, ## __VA_ARGS__)) ) -#endif - -/* - * Versions of LOG_ALWAYS_FATAL_IF and LOG_ALWAYS_FATAL that - * are stripped out of release builds. - */ -#if LOG_NDEBUG - -#ifndef LOG_FATAL_IF -#define LOG_FATAL_IF(cond, ...) ((void)0) -#endif -#ifndef LOG_FATAL -#define LOG_FATAL(...) ((void)0) -#endif - -#else - -#ifndef LOG_FATAL_IF -#define LOG_FATAL_IF(cond, ...) LOG_ALWAYS_FATAL_IF(cond, ## __VA_ARGS__) -#endif -#ifndef LOG_FATAL -#define LOG_FATAL(...) LOG_ALWAYS_FATAL(__VA_ARGS__) -#endif - -#endif - -/* - * Assertion that generates a log message when the assertion fails. - * Stripped out of release builds. Uses the current LOG_TAG. - */ -#ifndef ALOG_ASSERT -#define ALOG_ASSERT(cond, ...) LOG_FATAL_IF(!(cond), ## __VA_ARGS__) -//#define ALOG_ASSERT(cond) LOG_FATAL_IF(!(cond), "Assertion failed: " #cond) -#endif - -// --------------------------------------------------------------------- - -/* - * Basic log message macro. - * - * Example: - * ALOG(LOG_WARN, NULL, "Failed with error %d", errno); - * - * The second argument may be NULL or "" to indicate the "global" tag. - */ -#ifndef ALOG -#define ALOG(priority, tag, ...) \ - LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__) -#endif - -/* - * Log macro that allows you to specify a number for the priority. - */ -#ifndef LOG_PRI -#define LOG_PRI(priority, tag, ...) \ - android_printLog(priority, tag, __VA_ARGS__) -#endif - -/* - * Log macro that allows you to pass in a varargs ("args" is a va_list). - */ -#ifndef LOG_PRI_VA -#define LOG_PRI_VA(priority, tag, fmt, args) \ - android_vprintLog(priority, NULL, tag, fmt, args) -#endif - -/* - * Conditional given a desired logging priority and tag. - */ -#ifndef IF_ALOG -#define IF_ALOG(priority, tag) \ - if (android_testLog(ANDROID_##priority, tag)) -#endif - -// --------------------------------------------------------------------- - -/* - * Event logging. - */ - -/* - * Event log entry types. These must match up with the declarations in - * java/android/android/util/EventLog.java. - */ -typedef enum { - EVENT_TYPE_INT = 0, - EVENT_TYPE_LONG = 1, - EVENT_TYPE_STRING = 2, - EVENT_TYPE_LIST = 3, -} AndroidEventLogType; - - -#ifndef LOG_EVENT_INT -#define LOG_EVENT_INT(_tag, _value) { \ - int intBuf = _value; \ - (void) android_btWriteLog(_tag, EVENT_TYPE_INT, &intBuf, \ - sizeof(intBuf)); \ - } -#endif -#ifndef LOG_EVENT_LONG -#define LOG_EVENT_LONG(_tag, _value) { \ - long long longBuf = _value; \ - (void) android_btWriteLog(_tag, EVENT_TYPE_LONG, &longBuf, \ - sizeof(longBuf)); \ - } -#endif -#ifndef LOG_EVENT_STRING -#define LOG_EVENT_STRING(_tag, _value) \ - ((void) 0) /* not implemented -- must combine len with string */ -#endif -/* TODO: something for LIST */ - -/* - * =========================================================================== - * - * The stuff in the rest of this file should not be used directly. - */ - -#define android_printLog(prio, tag, fmt...) \ - __android_log_print(prio, tag, fmt) - -#define android_vprintLog(prio, cond, tag, fmt...) \ - __android_log_vprint(prio, tag, fmt) - -/* XXX Macros to work around syntax errors in places where format string - * arg is not passed to ALOG_ASSERT, LOG_ALWAYS_FATAL or LOG_ALWAYS_FATAL_IF - * (happens only in debug builds). - */ - -/* Returns 2nd arg. Used to substitute default value if caller's vararg list - * is empty. - */ -#define __android_second(dummy, second, ...) second - -/* If passed multiple args, returns ',' followed by all but 1st arg, otherwise - * returns nothing. - */ -#define __android_rest(first, ...) , ## __VA_ARGS__ - -#define android_printAssert(cond, tag, fmt...) \ - __android_log_assert(cond, tag, \ - __android_second(0, ## fmt, NULL) __android_rest(fmt)) - -#define android_writeLog(prio, tag, text) \ - __android_log_write(prio, tag, text) - -#define android_bWriteLog(tag, payload, len) \ - __android_log_bwrite(tag, payload, len) -#define android_btWriteLog(tag, type, payload, len) \ - __android_log_btwrite(tag, type, payload, len) - -// TODO: remove these prototypes and their users -#define android_testLog(prio, tag) (1) -#define android_writevLog(vec,num) do{}while(0) -#define android_write1Log(str,len) do{}while (0) -#define android_setMinPriority(tag, prio) do{}while(0) -//#define android_logToCallback(func) do{}while(0) -#define android_logToFile(tag, file) (0) -#define android_logToFd(tag, fd) (0) - -typedef enum { - LOG_ID_MAIN = 0, - LOG_ID_RADIO = 1, - LOG_ID_EVENTS = 2, - LOG_ID_SYSTEM = 3, - - LOG_ID_MAX -} log_id_t; - -/* - * Send a simple string to the log. - */ -int __android_log_buf_write(int bufID, int prio, const char *tag, const char *text); -int __android_log_buf_print(int bufID, int prio, const char *tag, const char *fmt, ...); - - -#ifdef __cplusplus -} -#endif - -#endif // _LIBS_CUTILS_LOG_H diff --git a/external/android/include/19/system/core/include/log/logd.h b/external/android/include/19/system/core/include/log/logd.h deleted file mode 100644 index 379c373..0000000 --- a/external/android/include/19/system/core/include/log/logd.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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_CUTILS_LOGD_H -#define _ANDROID_CUTILS_LOGD_H - -/* the stable/frozen log-related definitions have been - * moved to this header, which is exposed by the NDK - */ -#include - -/* the rest is only used internally by the system */ -#include -#include -#include -#include -#include -#ifdef HAVE_PTHREADS -#include -#endif -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -int __android_log_bwrite(int32_t tag, const void *payload, size_t len); -int __android_log_btwrite(int32_t tag, char type, const void *payload, - size_t len); - -#ifdef __cplusplus -} -#endif - -#endif /* _LOGD_H */ diff --git a/external/android/include/19/system/core/include/log/logger.h b/external/android/include/19/system/core/include/log/logger.h deleted file mode 100644 index 04f3fb0..0000000 --- a/external/android/include/19/system/core/include/log/logger.h +++ /dev/null @@ -1,81 +0,0 @@ -/* utils/logger.h -** -** Copyright 2007, The Android Open Source Project -** -** This file is dual licensed. It may be redistributed and/or modified -** under the terms of the Apache 2.0 License OR version 2 of the GNU -** General Public License. -*/ - -#ifndef _UTILS_LOGGER_H -#define _UTILS_LOGGER_H - -#include - -/* - * The userspace structure for version 1 of the logger_entry ABI. - * This structure is returned to userspace by the kernel logger - * driver unless an upgrade to a newer ABI version is requested. - */ -struct logger_entry { - uint16_t len; /* length of the payload */ - uint16_t __pad; /* no matter what, we get 2 bytes of padding */ - int32_t pid; /* generating process's pid */ - int32_t tid; /* generating process's tid */ - int32_t sec; /* seconds since Epoch */ - int32_t nsec; /* nanoseconds */ - char msg[0]; /* the entry's payload */ -}; - -/* - * The userspace structure for version 2 of the logger_entry ABI. - * This structure is returned to userspace if ioctl(LOGGER_SET_VERSION) - * is called with version==2 - */ -struct logger_entry_v2 { - uint16_t len; /* length of the payload */ - uint16_t hdr_size; /* sizeof(struct logger_entry_v2) */ - int32_t pid; /* generating process's pid */ - int32_t tid; /* generating process's tid */ - int32_t sec; /* seconds since Epoch */ - int32_t nsec; /* nanoseconds */ - uint32_t euid; /* effective UID of logger */ - char msg[0]; /* the entry's payload */ -}; - -#define LOGGER_LOG_MAIN "log/main" -#define LOGGER_LOG_RADIO "log/radio" -#define LOGGER_LOG_EVENTS "log/events" -#define LOGGER_LOG_SYSTEM "log/system" - -/* - * The maximum size of the log entry payload that can be - * written to the kernel logger driver. An attempt to write - * more than this amount to /dev/log/* will result in a - * truncated log entry. - */ -#define LOGGER_ENTRY_MAX_PAYLOAD 4076 - -/* - * The maximum size of a log entry which can be read from the - * kernel logger driver. An attempt to read less than this amount - * may result in read() returning EINVAL. - */ -#define LOGGER_ENTRY_MAX_LEN (5*1024) - -#ifdef HAVE_IOCTL - -#include - -#define __LOGGERIO 0xAE - -#define LOGGER_GET_LOG_BUF_SIZE _IO(__LOGGERIO, 1) /* size of log */ -#define LOGGER_GET_LOG_LEN _IO(__LOGGERIO, 2) /* used log len */ -#define LOGGER_GET_NEXT_ENTRY_LEN _IO(__LOGGERIO, 3) /* next entry len */ -#define LOGGER_FLUSH_LOG _IO(__LOGGERIO, 4) /* flush log */ -#define LOGGER_GET_VERSION _IO(__LOGGERIO, 5) /* abi version */ -#define LOGGER_SET_VERSION _IO(__LOGGERIO, 6) /* abi version */ - -#endif // HAVE_IOCTL - -#endif /* _UTILS_LOGGER_H */ diff --git a/external/android/include/19/system/core/include/log/logprint.h b/external/android/include/19/system/core/include/log/logprint.h deleted file mode 100644 index 481c96e..0000000 --- a/external/android/include/19/system/core/include/log/logprint.h +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (C) 2006 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 _LOGPRINT_H -#define _LOGPRINT_H - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - FORMAT_OFF = 0, - FORMAT_BRIEF, - FORMAT_PROCESS, - FORMAT_TAG, - FORMAT_THREAD, - FORMAT_RAW, - FORMAT_TIME, - FORMAT_THREADTIME, - FORMAT_LONG, -} AndroidLogPrintFormat; - -typedef struct AndroidLogFormat_t AndroidLogFormat; - -typedef struct AndroidLogEntry_t { - time_t tv_sec; - long tv_nsec; - android_LogPriority priority; - int32_t pid; - int32_t tid; - const char * tag; - size_t messageLen; - const char * message; -} AndroidLogEntry; - -AndroidLogFormat *android_log_format_new(); - -void android_log_format_free(AndroidLogFormat *p_format); - -void android_log_setPrintFormat(AndroidLogFormat *p_format, - AndroidLogPrintFormat format); - -/** - * Returns FORMAT_OFF on invalid string - */ -AndroidLogPrintFormat android_log_formatFromString(const char *s); - -/** - * filterExpression: a single filter expression - * eg "AT:d" - * - * returns 0 on success and -1 on invalid expression - * - * Assumes single threaded execution - * - */ - -int android_log_addFilterRule(AndroidLogFormat *p_format, - const char *filterExpression); - - -/** - * filterString: a whitespace-separated set of filter expressions - * eg "AT:d *:i" - * - * returns 0 on success and -1 on invalid expression - * - * Assumes single threaded execution - * - */ - -int android_log_addFilterString(AndroidLogFormat *p_format, - const char *filterString); - - -/** - * returns 1 if this log line should be printed based on its priority - * and tag, and 0 if it should not - */ -int android_log_shouldPrintLine ( - AndroidLogFormat *p_format, const char *tag, android_LogPriority pri); - - -/** - * Splits a wire-format buffer into an AndroidLogEntry - * entry allocated by caller. Pointers will point directly into buf - * - * Returns 0 on success and -1 on invalid wire format (entry will be - * in unspecified state) - */ -int android_log_processLogBuffer(struct logger_entry *buf, - AndroidLogEntry *entry); - -/** - * Like android_log_processLogBuffer, but for binary logs. - * - * If "map" is non-NULL, it will be used to convert the log tag number - * into a string. - */ -int android_log_processBinaryLogBuffer(struct logger_entry *buf, - AndroidLogEntry *entry, const EventTagMap* map, char* messageBuf, - int messageBufLen); - - -/** - * Formats a log message into a buffer - * - * Uses defaultBuffer if it can, otherwise malloc()'s a new buffer - * If return value != defaultBuffer, caller must call free() - * Returns NULL on malloc error - */ - -char *android_log_formatLogLine ( - AndroidLogFormat *p_format, - char *defaultBuffer, - size_t defaultBufferSize, - const AndroidLogEntry *p_line, - size_t *p_outLength); - - -/** - * Either print or do not print log line, based on filter - * - * Assumes single threaded execution - * - */ -int android_log_printLogLine( - AndroidLogFormat *p_format, - int fd, - const AndroidLogEntry *entry); - - -#ifdef __cplusplus -} -#endif - - -#endif /*_LOGPRINT_H*/ diff --git a/external/android/include/19/system/core/include/log/uio.h b/external/android/include/19/system/core/include/log/uio.h deleted file mode 100644 index 01a74d2..0000000 --- a/external/android/include/19/system/core/include/log/uio.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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. - */ - -// -// implementation of sys/uio.h for platforms that don't have it (Win32) -// -#ifndef _LIBS_CUTILS_UIO_H -#define _LIBS_CUTILS_UIO_H - -#ifdef HAVE_SYS_UIO_H -#include -#else - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -struct iovec { - const void* iov_base; - size_t iov_len; -}; - -extern int readv( int fd, struct iovec* vecs, int count ); -extern int writev( int fd, const struct iovec* vecs, int count ); - -#ifdef __cplusplus -} -#endif - -#endif /* !HAVE_SYS_UIO_H */ - -#endif /* _LIBS_UTILS_UIO_H */ - diff --git a/external/android/include/19/system/core/include/sync/sw_sync.h b/external/android/include/19/system/core/include/sync/sw_sync.h deleted file mode 100644 index 3bf4110..0000000 --- a/external/android/include/19/system/core/include/sync/sw_sync.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * sw_sync.h - * - * Copyright 2013 Google, Inc - * - * 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 __SYS_CORE_SW_SYNC_H -#define __SYS_CORE_SW_SYNC_H - -#include "sync.h" - -__BEGIN_DECLS - -/* - * sw_sync is mainly intended for testing and should not be compiled into - * production kernels - */ - -int sw_sync_timeline_create(void); -int sw_sync_timeline_inc(int fd, unsigned count); -int sw_sync_fence_create(int fd, const char *name, unsigned value); - -__END_DECLS - -#endif /* __SYS_CORE_SW_SYNC_H */ diff --git a/external/android/include/19/system/core/include/sync/sync.h b/external/android/include/19/system/core/include/sync/sync.h deleted file mode 100644 index 2e5d82f..0000000 --- a/external/android/include/19/system/core/include/sync/sync.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * sync.h - * - * Copyright 2012 Google, Inc - * - * 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 __SYS_CORE_SYNC_H -#define __SYS_CORE_SYNC_H - -#include -#include - -__BEGIN_DECLS - -// XXX: These structs are copied from the header "linux/sync.h". -struct sync_fence_info_data { - uint32_t len; - char name[32]; - int32_t status; - uint8_t pt_info[0]; -}; - -struct sync_pt_info { - uint32_t len; - char obj_name[32]; - char driver_name[32]; - int32_t status; - uint64_t timestamp_ns; - uint8_t driver_data[0]; -}; - -/* timeout in msecs */ -int sync_wait(int fd, int timeout); -int sync_merge(const char *name, int fd1, int fd2); -struct sync_fence_info_data *sync_fence_info(int fd); -struct sync_pt_info *sync_pt_info(struct sync_fence_info_data *info, - struct sync_pt_info *itr); -void sync_fence_info_free(struct sync_fence_info_data *info); - -__END_DECLS - -#endif /* __SYS_CORE_SYNC_H */ diff --git a/external/android/include/19/system/core/include/system/audio.h b/external/android/include/19/system/core/include/system/audio.h deleted file mode 100644 index aa7ac02..0000000 --- a/external/android/include/19/system/core/include/system/audio.h +++ /dev/null @@ -1,609 +0,0 @@ -/* - * Copyright (C) 2011 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_AUDIO_CORE_H -#define ANDROID_AUDIO_CORE_H - -#include -#include -#include -#include - -#include - -__BEGIN_DECLS - -/* The enums were moved here mostly from - * frameworks/base/include/media/AudioSystem.h - */ - -/* device address used to refer to the standard remote submix */ -#define AUDIO_REMOTE_SUBMIX_DEVICE_ADDRESS "0" - -typedef int audio_io_handle_t; - -/* Audio stream types */ -typedef enum { - AUDIO_STREAM_DEFAULT = -1, - AUDIO_STREAM_VOICE_CALL = 0, - AUDIO_STREAM_SYSTEM = 1, - AUDIO_STREAM_RING = 2, - AUDIO_STREAM_MUSIC = 3, - AUDIO_STREAM_ALARM = 4, - AUDIO_STREAM_NOTIFICATION = 5, - AUDIO_STREAM_BLUETOOTH_SCO = 6, - AUDIO_STREAM_ENFORCED_AUDIBLE = 7, /* Sounds that cannot be muted by user and must be routed to speaker */ - AUDIO_STREAM_DTMF = 8, - AUDIO_STREAM_TTS = 9, - - AUDIO_STREAM_CNT, - AUDIO_STREAM_MAX = AUDIO_STREAM_CNT - 1, -} audio_stream_type_t; - -/* Do not change these values without updating their counterparts - * in media/java/android/media/MediaRecorder.java! - */ -typedef enum { - AUDIO_SOURCE_DEFAULT = 0, - AUDIO_SOURCE_MIC = 1, - AUDIO_SOURCE_VOICE_UPLINK = 2, - AUDIO_SOURCE_VOICE_DOWNLINK = 3, - AUDIO_SOURCE_VOICE_CALL = 4, - AUDIO_SOURCE_CAMCORDER = 5, - AUDIO_SOURCE_VOICE_RECOGNITION = 6, - AUDIO_SOURCE_VOICE_COMMUNICATION = 7, - AUDIO_SOURCE_REMOTE_SUBMIX = 8, /* Source for the mix to be presented remotely. */ - /* An example of remote presentation is Wifi Display */ - /* where a dongle attached to a TV can be used to */ - /* play the mix captured by this audio source. */ - AUDIO_SOURCE_CNT, - AUDIO_SOURCE_MAX = AUDIO_SOURCE_CNT - 1, - AUDIO_SOURCE_HOTWORD = 1999, /* A low-priority, preemptible audio source for - for background software hotword detection. - Same tuning as AUDIO_SOURCE_VOICE_RECOGNITION. - Used only internally to the framework. Not exposed - at the audio HAL. */ -} audio_source_t; - -/* special audio session values - * (XXX: should this be living in the audio effects land?) - */ -typedef enum { - /* session for effects attached to a particular output stream - * (value must be less than 0) - */ - AUDIO_SESSION_OUTPUT_STAGE = -1, - - /* session for effects applied to output mix. These effects can - * be moved by audio policy manager to another output stream - * (value must be 0) - */ - AUDIO_SESSION_OUTPUT_MIX = 0, -} audio_session_t; - -/* Audio sub formats (see enum audio_format). */ - -/* PCM sub formats */ -typedef enum { - AUDIO_FORMAT_PCM_SUB_16_BIT = 0x1, /* DO NOT CHANGE - PCM signed 16 bits */ - AUDIO_FORMAT_PCM_SUB_8_BIT = 0x2, /* DO NOT CHANGE - PCM unsigned 8 bits */ - AUDIO_FORMAT_PCM_SUB_32_BIT = 0x3, /* PCM signed .31 fixed point */ - AUDIO_FORMAT_PCM_SUB_8_24_BIT = 0x4, /* PCM signed 7.24 fixed point */ -} audio_format_pcm_sub_fmt_t; - -/* MP3 sub format field definition : can use 11 LSBs in the same way as MP3 - * frame header to specify bit rate, stereo mode, version... - */ -typedef enum { - AUDIO_FORMAT_MP3_SUB_NONE = 0x0, -} audio_format_mp3_sub_fmt_t; - -/* AMR NB/WB sub format field definition: specify frame block interleaving, - * bandwidth efficient or octet aligned, encoding mode for recording... - */ -typedef enum { - AUDIO_FORMAT_AMR_SUB_NONE = 0x0, -} audio_format_amr_sub_fmt_t; - -/* AAC sub format field definition: specify profile or bitrate for recording... */ -typedef enum { - AUDIO_FORMAT_AAC_SUB_NONE = 0x0, -} audio_format_aac_sub_fmt_t; - -/* VORBIS sub format field definition: specify quality for recording... */ -typedef enum { - AUDIO_FORMAT_VORBIS_SUB_NONE = 0x0, -} audio_format_vorbis_sub_fmt_t; - -/* Audio format consists in a main format field (upper 8 bits) and a sub format - * field (lower 24 bits). - * - * The main format indicates the main codec type. The sub format field - * indicates options and parameters for each format. The sub format is mainly - * used for record to indicate for instance the requested bitrate or profile. - * It can also be used for certain formats to give informations not present in - * the encoded audio stream (e.g. octet alignement for AMR). - */ -typedef enum { - AUDIO_FORMAT_INVALID = 0xFFFFFFFFUL, - AUDIO_FORMAT_DEFAULT = 0, - AUDIO_FORMAT_PCM = 0x00000000UL, /* DO NOT CHANGE */ - AUDIO_FORMAT_MP3 = 0x01000000UL, - AUDIO_FORMAT_AMR_NB = 0x02000000UL, - AUDIO_FORMAT_AMR_WB = 0x03000000UL, - AUDIO_FORMAT_AAC = 0x04000000UL, - AUDIO_FORMAT_HE_AAC_V1 = 0x05000000UL, - AUDIO_FORMAT_HE_AAC_V2 = 0x06000000UL, - AUDIO_FORMAT_VORBIS = 0x07000000UL, - AUDIO_FORMAT_MAIN_MASK = 0xFF000000UL, - AUDIO_FORMAT_SUB_MASK = 0x00FFFFFFUL, - - /* Aliases */ - AUDIO_FORMAT_PCM_16_BIT = (AUDIO_FORMAT_PCM | - AUDIO_FORMAT_PCM_SUB_16_BIT), - AUDIO_FORMAT_PCM_8_BIT = (AUDIO_FORMAT_PCM | - AUDIO_FORMAT_PCM_SUB_8_BIT), - AUDIO_FORMAT_PCM_32_BIT = (AUDIO_FORMAT_PCM | - AUDIO_FORMAT_PCM_SUB_32_BIT), - AUDIO_FORMAT_PCM_8_24_BIT = (AUDIO_FORMAT_PCM | - AUDIO_FORMAT_PCM_SUB_8_24_BIT), -} audio_format_t; - -enum { - /* output channels */ - AUDIO_CHANNEL_OUT_FRONT_LEFT = 0x1, - AUDIO_CHANNEL_OUT_FRONT_RIGHT = 0x2, - AUDIO_CHANNEL_OUT_FRONT_CENTER = 0x4, - AUDIO_CHANNEL_OUT_LOW_FREQUENCY = 0x8, - AUDIO_CHANNEL_OUT_BACK_LEFT = 0x10, - AUDIO_CHANNEL_OUT_BACK_RIGHT = 0x20, - AUDIO_CHANNEL_OUT_FRONT_LEFT_OF_CENTER = 0x40, - AUDIO_CHANNEL_OUT_FRONT_RIGHT_OF_CENTER = 0x80, - AUDIO_CHANNEL_OUT_BACK_CENTER = 0x100, - AUDIO_CHANNEL_OUT_SIDE_LEFT = 0x200, - AUDIO_CHANNEL_OUT_SIDE_RIGHT = 0x400, - AUDIO_CHANNEL_OUT_TOP_CENTER = 0x800, - AUDIO_CHANNEL_OUT_TOP_FRONT_LEFT = 0x1000, - AUDIO_CHANNEL_OUT_TOP_FRONT_CENTER = 0x2000, - AUDIO_CHANNEL_OUT_TOP_FRONT_RIGHT = 0x4000, - AUDIO_CHANNEL_OUT_TOP_BACK_LEFT = 0x8000, - AUDIO_CHANNEL_OUT_TOP_BACK_CENTER = 0x10000, - AUDIO_CHANNEL_OUT_TOP_BACK_RIGHT = 0x20000, - - AUDIO_CHANNEL_OUT_MONO = AUDIO_CHANNEL_OUT_FRONT_LEFT, - AUDIO_CHANNEL_OUT_STEREO = (AUDIO_CHANNEL_OUT_FRONT_LEFT | - AUDIO_CHANNEL_OUT_FRONT_RIGHT), - AUDIO_CHANNEL_OUT_QUAD = (AUDIO_CHANNEL_OUT_FRONT_LEFT | - AUDIO_CHANNEL_OUT_FRONT_RIGHT | - AUDIO_CHANNEL_OUT_BACK_LEFT | - AUDIO_CHANNEL_OUT_BACK_RIGHT), - AUDIO_CHANNEL_OUT_SURROUND = (AUDIO_CHANNEL_OUT_FRONT_LEFT | - AUDIO_CHANNEL_OUT_FRONT_RIGHT | - AUDIO_CHANNEL_OUT_FRONT_CENTER | - AUDIO_CHANNEL_OUT_BACK_CENTER), - AUDIO_CHANNEL_OUT_5POINT1 = (AUDIO_CHANNEL_OUT_FRONT_LEFT | - AUDIO_CHANNEL_OUT_FRONT_RIGHT | - AUDIO_CHANNEL_OUT_FRONT_CENTER | - AUDIO_CHANNEL_OUT_LOW_FREQUENCY | - AUDIO_CHANNEL_OUT_BACK_LEFT | - AUDIO_CHANNEL_OUT_BACK_RIGHT), - // matches the correct AudioFormat.CHANNEL_OUT_7POINT1_SURROUND definition for 7.1 - AUDIO_CHANNEL_OUT_7POINT1 = (AUDIO_CHANNEL_OUT_FRONT_LEFT | - AUDIO_CHANNEL_OUT_FRONT_RIGHT | - AUDIO_CHANNEL_OUT_FRONT_CENTER | - AUDIO_CHANNEL_OUT_LOW_FREQUENCY | - AUDIO_CHANNEL_OUT_BACK_LEFT | - AUDIO_CHANNEL_OUT_BACK_RIGHT | - AUDIO_CHANNEL_OUT_SIDE_LEFT | - AUDIO_CHANNEL_OUT_SIDE_RIGHT), - AUDIO_CHANNEL_OUT_ALL = (AUDIO_CHANNEL_OUT_FRONT_LEFT | - AUDIO_CHANNEL_OUT_FRONT_RIGHT | - AUDIO_CHANNEL_OUT_FRONT_CENTER | - AUDIO_CHANNEL_OUT_LOW_FREQUENCY | - AUDIO_CHANNEL_OUT_BACK_LEFT | - AUDIO_CHANNEL_OUT_BACK_RIGHT | - AUDIO_CHANNEL_OUT_FRONT_LEFT_OF_CENTER | - AUDIO_CHANNEL_OUT_FRONT_RIGHT_OF_CENTER | - AUDIO_CHANNEL_OUT_BACK_CENTER| - AUDIO_CHANNEL_OUT_SIDE_LEFT| - AUDIO_CHANNEL_OUT_SIDE_RIGHT| - AUDIO_CHANNEL_OUT_TOP_CENTER| - AUDIO_CHANNEL_OUT_TOP_FRONT_LEFT| - AUDIO_CHANNEL_OUT_TOP_FRONT_CENTER| - AUDIO_CHANNEL_OUT_TOP_FRONT_RIGHT| - AUDIO_CHANNEL_OUT_TOP_BACK_LEFT| - AUDIO_CHANNEL_OUT_TOP_BACK_CENTER| - AUDIO_CHANNEL_OUT_TOP_BACK_RIGHT), - - /* input channels */ - AUDIO_CHANNEL_IN_LEFT = 0x4, - AUDIO_CHANNEL_IN_RIGHT = 0x8, - AUDIO_CHANNEL_IN_FRONT = 0x10, - AUDIO_CHANNEL_IN_BACK = 0x20, - AUDIO_CHANNEL_IN_LEFT_PROCESSED = 0x40, - AUDIO_CHANNEL_IN_RIGHT_PROCESSED = 0x80, - AUDIO_CHANNEL_IN_FRONT_PROCESSED = 0x100, - AUDIO_CHANNEL_IN_BACK_PROCESSED = 0x200, - AUDIO_CHANNEL_IN_PRESSURE = 0x400, - AUDIO_CHANNEL_IN_X_AXIS = 0x800, - AUDIO_CHANNEL_IN_Y_AXIS = 0x1000, - AUDIO_CHANNEL_IN_Z_AXIS = 0x2000, - AUDIO_CHANNEL_IN_VOICE_UPLINK = 0x4000, - AUDIO_CHANNEL_IN_VOICE_DNLINK = 0x8000, - - AUDIO_CHANNEL_IN_MONO = AUDIO_CHANNEL_IN_FRONT, - AUDIO_CHANNEL_IN_STEREO = (AUDIO_CHANNEL_IN_LEFT | AUDIO_CHANNEL_IN_RIGHT), - AUDIO_CHANNEL_IN_FRONT_BACK = (AUDIO_CHANNEL_IN_FRONT | AUDIO_CHANNEL_IN_BACK), - AUDIO_CHANNEL_IN_ALL = (AUDIO_CHANNEL_IN_LEFT | - AUDIO_CHANNEL_IN_RIGHT | - AUDIO_CHANNEL_IN_FRONT | - AUDIO_CHANNEL_IN_BACK| - AUDIO_CHANNEL_IN_LEFT_PROCESSED | - AUDIO_CHANNEL_IN_RIGHT_PROCESSED | - AUDIO_CHANNEL_IN_FRONT_PROCESSED | - AUDIO_CHANNEL_IN_BACK_PROCESSED| - AUDIO_CHANNEL_IN_PRESSURE | - AUDIO_CHANNEL_IN_X_AXIS | - AUDIO_CHANNEL_IN_Y_AXIS | - AUDIO_CHANNEL_IN_Z_AXIS | - AUDIO_CHANNEL_IN_VOICE_UPLINK | - AUDIO_CHANNEL_IN_VOICE_DNLINK), -}; - -typedef uint32_t audio_channel_mask_t; - -typedef enum { - AUDIO_MODE_INVALID = -2, - AUDIO_MODE_CURRENT = -1, - AUDIO_MODE_NORMAL = 0, - AUDIO_MODE_RINGTONE = 1, - AUDIO_MODE_IN_CALL = 2, - AUDIO_MODE_IN_COMMUNICATION = 3, - - AUDIO_MODE_CNT, - AUDIO_MODE_MAX = AUDIO_MODE_CNT - 1, -} audio_mode_t; - -typedef enum { - AUDIO_IN_ACOUSTICS_AGC_ENABLE = 0x0001, - AUDIO_IN_ACOUSTICS_AGC_DISABLE = 0, - AUDIO_IN_ACOUSTICS_NS_ENABLE = 0x0002, - AUDIO_IN_ACOUSTICS_NS_DISABLE = 0, - AUDIO_IN_ACOUSTICS_TX_IIR_ENABLE = 0x0004, - AUDIO_IN_ACOUSTICS_TX_DISABLE = 0, -} audio_in_acoustics_t; - -enum { - AUDIO_DEVICE_NONE = 0x0, - /* reserved bits */ - AUDIO_DEVICE_BIT_IN = 0x80000000, - AUDIO_DEVICE_BIT_DEFAULT = 0x40000000, - /* output devices */ - AUDIO_DEVICE_OUT_EARPIECE = 0x1, - AUDIO_DEVICE_OUT_SPEAKER = 0x2, - AUDIO_DEVICE_OUT_WIRED_HEADSET = 0x4, - AUDIO_DEVICE_OUT_WIRED_HEADPHONE = 0x8, - AUDIO_DEVICE_OUT_BLUETOOTH_SCO = 0x10, - AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET = 0x20, - AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT = 0x40, - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP = 0x80, - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES = 0x100, - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER = 0x200, - AUDIO_DEVICE_OUT_AUX_DIGITAL = 0x400, - AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET = 0x800, - AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET = 0x1000, - AUDIO_DEVICE_OUT_USB_ACCESSORY = 0x2000, - AUDIO_DEVICE_OUT_USB_DEVICE = 0x4000, - AUDIO_DEVICE_OUT_REMOTE_SUBMIX = 0x8000, - AUDIO_DEVICE_OUT_DEFAULT = AUDIO_DEVICE_BIT_DEFAULT, - AUDIO_DEVICE_OUT_ALL = (AUDIO_DEVICE_OUT_EARPIECE | - AUDIO_DEVICE_OUT_SPEAKER | - AUDIO_DEVICE_OUT_WIRED_HEADSET | - AUDIO_DEVICE_OUT_WIRED_HEADPHONE | - AUDIO_DEVICE_OUT_BLUETOOTH_SCO | - AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET | - AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT | - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP | - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES | - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER | - AUDIO_DEVICE_OUT_AUX_DIGITAL | - AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET | - AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET | - AUDIO_DEVICE_OUT_USB_ACCESSORY | - AUDIO_DEVICE_OUT_USB_DEVICE | - AUDIO_DEVICE_OUT_REMOTE_SUBMIX | - AUDIO_DEVICE_OUT_DEFAULT), - AUDIO_DEVICE_OUT_ALL_A2DP = (AUDIO_DEVICE_OUT_BLUETOOTH_A2DP | - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES | - AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER), - AUDIO_DEVICE_OUT_ALL_SCO = (AUDIO_DEVICE_OUT_BLUETOOTH_SCO | - AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET | - AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT), - AUDIO_DEVICE_OUT_ALL_USB = (AUDIO_DEVICE_OUT_USB_ACCESSORY | - AUDIO_DEVICE_OUT_USB_DEVICE), - - /* input devices */ - AUDIO_DEVICE_IN_COMMUNICATION = AUDIO_DEVICE_BIT_IN | 0x1, - AUDIO_DEVICE_IN_AMBIENT = AUDIO_DEVICE_BIT_IN | 0x2, - AUDIO_DEVICE_IN_BUILTIN_MIC = AUDIO_DEVICE_BIT_IN | 0x4, - AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET = AUDIO_DEVICE_BIT_IN | 0x8, - AUDIO_DEVICE_IN_WIRED_HEADSET = AUDIO_DEVICE_BIT_IN | 0x10, - AUDIO_DEVICE_IN_AUX_DIGITAL = AUDIO_DEVICE_BIT_IN | 0x20, - AUDIO_DEVICE_IN_VOICE_CALL = AUDIO_DEVICE_BIT_IN | 0x40, - AUDIO_DEVICE_IN_BACK_MIC = AUDIO_DEVICE_BIT_IN | 0x80, - AUDIO_DEVICE_IN_REMOTE_SUBMIX = AUDIO_DEVICE_BIT_IN | 0x100, - AUDIO_DEVICE_IN_ANLG_DOCK_HEADSET = AUDIO_DEVICE_BIT_IN | 0x200, - AUDIO_DEVICE_IN_DGTL_DOCK_HEADSET = AUDIO_DEVICE_BIT_IN | 0x400, - AUDIO_DEVICE_IN_USB_ACCESSORY = AUDIO_DEVICE_BIT_IN | 0x800, - AUDIO_DEVICE_IN_USB_DEVICE = AUDIO_DEVICE_BIT_IN | 0x1000, - AUDIO_DEVICE_IN_DEFAULT = AUDIO_DEVICE_BIT_IN | AUDIO_DEVICE_BIT_DEFAULT, - - AUDIO_DEVICE_IN_ALL = (AUDIO_DEVICE_IN_COMMUNICATION | - AUDIO_DEVICE_IN_AMBIENT | - AUDIO_DEVICE_IN_BUILTIN_MIC | - AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET | - AUDIO_DEVICE_IN_WIRED_HEADSET | - AUDIO_DEVICE_IN_AUX_DIGITAL | - AUDIO_DEVICE_IN_VOICE_CALL | - AUDIO_DEVICE_IN_BACK_MIC | - AUDIO_DEVICE_IN_REMOTE_SUBMIX | - AUDIO_DEVICE_IN_ANLG_DOCK_HEADSET | - AUDIO_DEVICE_IN_DGTL_DOCK_HEADSET | - AUDIO_DEVICE_IN_USB_ACCESSORY | - AUDIO_DEVICE_IN_USB_DEVICE | - AUDIO_DEVICE_IN_DEFAULT), - AUDIO_DEVICE_IN_ALL_SCO = AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET, -}; - -typedef uint32_t audio_devices_t; - -/* the audio output flags serve two purposes: - * - when an AudioTrack is created they indicate a "wish" to be connected to an - * output stream with attributes corresponding to the specified flags - * - when present in an output profile descriptor listed for a particular audio - * hardware module, they indicate that an output stream can be opened that - * supports the attributes indicated by the flags. - * the audio policy manager will try to match the flags in the request - * (when getOuput() is called) to an available output stream. - */ -typedef enum { - AUDIO_OUTPUT_FLAG_NONE = 0x0, // no attributes - AUDIO_OUTPUT_FLAG_DIRECT = 0x1, // this output directly connects a track - // to one output stream: no software mixer - AUDIO_OUTPUT_FLAG_PRIMARY = 0x2, // this output is the primary output of - // the device. It is unique and must be - // present. It is opened by default and - // receives routing, audio mode and volume - // controls related to voice calls. - AUDIO_OUTPUT_FLAG_FAST = 0x4, // output supports "fast tracks", - // defined elsewhere - AUDIO_OUTPUT_FLAG_DEEP_BUFFER = 0x8, // use deep audio buffers - AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD = 0x10, // offload playback of compressed - // streams to hardware codec - AUDIO_OUTPUT_FLAG_NON_BLOCKING = 0x20 // use non-blocking write -} audio_output_flags_t; - -/* The audio input flags are analogous to audio output flags. - * Currently they are used only when an AudioRecord is created, - * to indicate a preference to be connected to an input stream with - * attributes corresponding to the specified flags. - */ -typedef enum { - AUDIO_INPUT_FLAG_NONE = 0x0, // no attributes - AUDIO_INPUT_FLAG_FAST = 0x1, // prefer an input that supports "fast tracks" -} audio_input_flags_t; - -/* Additional information about compressed streams offloaded to - * hardware playback - * The version and size fields must be initialized by the caller by using - * one of the constants defined here. - */ -typedef struct { - uint16_t version; // version of the info structure - uint16_t size; // total size of the structure including version and size - uint32_t sample_rate; // sample rate in Hz - audio_channel_mask_t channel_mask; // channel mask - audio_format_t format; // audio format - audio_stream_type_t stream_type; // stream type - uint32_t bit_rate; // bit rate in bits per second - int64_t duration_us; // duration in microseconds, -1 if unknown - bool has_video; // true if stream is tied to a video stream - bool is_streaming; // true if streaming, false if local playback -} audio_offload_info_t; - -#define AUDIO_MAKE_OFFLOAD_INFO_VERSION(maj,min) \ - ((((maj) & 0xff) << 8) | ((min) & 0xff)) - -#define AUDIO_OFFLOAD_INFO_VERSION_0_1 AUDIO_MAKE_OFFLOAD_INFO_VERSION(0, 1) -#define AUDIO_OFFLOAD_INFO_VERSION_CURRENT AUDIO_OFFLOAD_INFO_VERSION_0_1 - -static const audio_offload_info_t AUDIO_INFO_INITIALIZER = { - version: AUDIO_OFFLOAD_INFO_VERSION_CURRENT, - size: sizeof(audio_offload_info_t), -}; - -static inline bool audio_is_output_device(audio_devices_t device) -{ - if (((device & AUDIO_DEVICE_BIT_IN) == 0) && - (popcount(device) == 1) && ((device & ~AUDIO_DEVICE_OUT_ALL) == 0)) - return true; - else - return false; -} - -static inline bool audio_is_input_device(audio_devices_t device) -{ - if ((device & AUDIO_DEVICE_BIT_IN) != 0) { - device &= ~AUDIO_DEVICE_BIT_IN; - if ((popcount(device) == 1) && ((device & ~AUDIO_DEVICE_IN_ALL) == 0)) - return true; - } - return false; -} - -static inline bool audio_is_output_devices(audio_devices_t device) -{ - return (device & AUDIO_DEVICE_BIT_IN) == 0; -} - - -static inline bool audio_is_a2dp_device(audio_devices_t device) -{ - if ((popcount(device) == 1) && (device & AUDIO_DEVICE_OUT_ALL_A2DP)) - return true; - else - return false; -} - -static inline bool audio_is_bluetooth_sco_device(audio_devices_t device) -{ - device &= ~AUDIO_DEVICE_BIT_IN; - if ((popcount(device) == 1) && (device & (AUDIO_DEVICE_OUT_ALL_SCO | - AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET))) - return true; - else - return false; -} - -static inline bool audio_is_usb_device(audio_devices_t device) -{ - if ((popcount(device) == 1) && (device & AUDIO_DEVICE_OUT_ALL_USB)) - return true; - else - return false; -} - -static inline bool audio_is_remote_submix_device(audio_devices_t device) -{ - if ((device & AUDIO_DEVICE_OUT_REMOTE_SUBMIX) == AUDIO_DEVICE_OUT_REMOTE_SUBMIX - || (device & AUDIO_DEVICE_IN_REMOTE_SUBMIX) == AUDIO_DEVICE_IN_REMOTE_SUBMIX) - return true; - else - return false; -} - -static inline bool audio_is_input_channel(audio_channel_mask_t channel) -{ - if ((channel & ~AUDIO_CHANNEL_IN_ALL) == 0) - return channel != 0; - else - return false; -} - -static inline bool audio_is_output_channel(audio_channel_mask_t channel) -{ - if ((channel & ~AUDIO_CHANNEL_OUT_ALL) == 0) - return channel != 0; - else - return false; -} - -/* Derive an output channel mask from a channel count. - * This is to be used when the content channel mask is unknown. The 1, 2, 4, 5, 6, 7 and 8 channel - * cases are mapped to the standard game/home-theater layouts, but note that 4 is mapped to quad, - * and not stereo + FC + mono surround. A channel count of 3 is arbitrarily mapped to stereo + FC - * for continuity with stereo. - * Returns the matching channel mask, or 0 if the number of channels exceeds that of the - * configurations for which a default channel mask is defined. - */ -static inline audio_channel_mask_t audio_channel_out_mask_from_count(uint32_t channel_count) -{ - switch(channel_count) { - case 1: - return AUDIO_CHANNEL_OUT_MONO; - case 2: - return AUDIO_CHANNEL_OUT_STEREO; - case 3: - return (AUDIO_CHANNEL_OUT_STEREO | AUDIO_CHANNEL_OUT_FRONT_CENTER); - case 4: // 4.0 - return AUDIO_CHANNEL_OUT_QUAD; - case 5: // 5.0 - return (AUDIO_CHANNEL_OUT_QUAD | AUDIO_CHANNEL_OUT_FRONT_CENTER); - case 6: // 5.1 - return AUDIO_CHANNEL_OUT_5POINT1; - case 7: // 6.1 - return (AUDIO_CHANNEL_OUT_5POINT1 | AUDIO_CHANNEL_OUT_BACK_CENTER); - case 8: - return AUDIO_CHANNEL_OUT_7POINT1; - default: - return 0; - } -} - -/* Similar to above, but for input. Currently handles only mono and stereo. */ -static inline audio_channel_mask_t audio_channel_in_mask_from_count(uint32_t channel_count) -{ - switch (channel_count) { - case 1: - return AUDIO_CHANNEL_IN_MONO; - case 2: - return AUDIO_CHANNEL_IN_STEREO; - default: - return 0; - } -} - -static inline bool audio_is_valid_format(audio_format_t format) -{ - switch (format & AUDIO_FORMAT_MAIN_MASK) { - case AUDIO_FORMAT_PCM: - if (format != AUDIO_FORMAT_PCM_16_BIT && - format != AUDIO_FORMAT_PCM_8_BIT) { - return false; - } - case AUDIO_FORMAT_MP3: - case AUDIO_FORMAT_AMR_NB: - case AUDIO_FORMAT_AMR_WB: - case AUDIO_FORMAT_AAC: - case AUDIO_FORMAT_HE_AAC_V1: - case AUDIO_FORMAT_HE_AAC_V2: - case AUDIO_FORMAT_VORBIS: - return true; - default: - return false; - } -} - -static inline bool audio_is_linear_pcm(audio_format_t format) -{ - return ((format & AUDIO_FORMAT_MAIN_MASK) == AUDIO_FORMAT_PCM); -} - -static inline size_t audio_bytes_per_sample(audio_format_t format) -{ - size_t size = 0; - - switch (format) { - case AUDIO_FORMAT_PCM_32_BIT: - case AUDIO_FORMAT_PCM_8_24_BIT: - size = sizeof(int32_t); - break; - case AUDIO_FORMAT_PCM_16_BIT: - size = sizeof(int16_t); - break; - case AUDIO_FORMAT_PCM_8_BIT: - size = sizeof(uint8_t); - break; - default: - break; - } - return size; -} - -__END_DECLS - -#endif // ANDROID_AUDIO_CORE_H diff --git a/external/android/include/19/system/core/include/system/audio_policy.h b/external/android/include/19/system/core/include/system/audio_policy.h deleted file mode 100644 index a6554de..0000000 --- a/external/android/include/19/system/core/include/system/audio_policy.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2011 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_AUDIO_POLICY_CORE_H -#define ANDROID_AUDIO_POLICY_CORE_H - -#include -#include -#include - -#include - -__BEGIN_DECLS - -/* The enums were moved here mostly from - * frameworks/base/include/media/AudioSystem.h - */ - -/* device categories used for audio_policy->set_force_use() */ -typedef enum { - AUDIO_POLICY_FORCE_NONE, - AUDIO_POLICY_FORCE_SPEAKER, - AUDIO_POLICY_FORCE_HEADPHONES, - AUDIO_POLICY_FORCE_BT_SCO, - AUDIO_POLICY_FORCE_BT_A2DP, - AUDIO_POLICY_FORCE_WIRED_ACCESSORY, - AUDIO_POLICY_FORCE_BT_CAR_DOCK, - AUDIO_POLICY_FORCE_BT_DESK_DOCK, - AUDIO_POLICY_FORCE_ANALOG_DOCK, - AUDIO_POLICY_FORCE_DIGITAL_DOCK, - AUDIO_POLICY_FORCE_NO_BT_A2DP, /* A2DP sink is not preferred to speaker or wired HS */ - AUDIO_POLICY_FORCE_SYSTEM_ENFORCED, - - AUDIO_POLICY_FORCE_CFG_CNT, - AUDIO_POLICY_FORCE_CFG_MAX = AUDIO_POLICY_FORCE_CFG_CNT - 1, - - AUDIO_POLICY_FORCE_DEFAULT = AUDIO_POLICY_FORCE_NONE, -} audio_policy_forced_cfg_t; - -/* usages used for audio_policy->set_force_use() */ -typedef enum { - AUDIO_POLICY_FORCE_FOR_COMMUNICATION, - AUDIO_POLICY_FORCE_FOR_MEDIA, - AUDIO_POLICY_FORCE_FOR_RECORD, - AUDIO_POLICY_FORCE_FOR_DOCK, - AUDIO_POLICY_FORCE_FOR_SYSTEM, - - AUDIO_POLICY_FORCE_USE_CNT, - AUDIO_POLICY_FORCE_USE_MAX = AUDIO_POLICY_FORCE_USE_CNT - 1, -} audio_policy_force_use_t; - -/* device connection states used for audio_policy->set_device_connection_state() - */ -typedef enum { - AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE, - AUDIO_POLICY_DEVICE_STATE_AVAILABLE, - - AUDIO_POLICY_DEVICE_STATE_CNT, - AUDIO_POLICY_DEVICE_STATE_MAX = AUDIO_POLICY_DEVICE_STATE_CNT - 1, -} audio_policy_dev_state_t; - -typedef enum { - /* Used to generate a tone to notify the user of a - * notification/alarm/ringtone while they are in a call. */ - AUDIO_POLICY_TONE_IN_CALL_NOTIFICATION = 0, - - AUDIO_POLICY_TONE_CNT, - AUDIO_POLICY_TONE_MAX = AUDIO_POLICY_TONE_CNT - 1, -} audio_policy_tone_t; - - -static inline bool audio_is_low_visibility(audio_stream_type_t stream) -{ - switch (stream) { - case AUDIO_STREAM_SYSTEM: - case AUDIO_STREAM_NOTIFICATION: - case AUDIO_STREAM_RING: - return true; - default: - return false; - } -} - - -__END_DECLS - -#endif // ANDROID_AUDIO_POLICY_CORE_H diff --git a/external/android/include/19/system/core/include/system/camera.h b/external/android/include/19/system/core/include/system/camera.h deleted file mode 100644 index 7a4dd53..0000000 --- a/external/android/include/19/system/core/include/system/camera.h +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Copyright (C) 2011 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 SYSTEM_CORE_INCLUDE_ANDROID_CAMERA_H -#define SYSTEM_CORE_INCLUDE_ANDROID_CAMERA_H - -#include -#include -#include -#include -#include -#include - -__BEGIN_DECLS - -/** - * A set of bit masks for specifying how the received preview frames are - * handled before the previewCallback() call. - * - * The least significant 3 bits of an "int" value are used for this purpose: - * - * ..... 0 0 0 - * ^ ^ ^ - * | | |---------> determine whether the callback is enabled or not - * | |-----------> determine whether the callback is one-shot or not - * |-------------> determine whether the frame is copied out or not - * - * WARNING: When a frame is sent directly without copying, it is the frame - * receiver's responsiblity to make sure that the frame data won't get - * corrupted by subsequent preview frames filled by the camera. This flag is - * recommended only when copying out data brings significant performance price - * and the handling/processing of the received frame data is always faster than - * the preview frame rate so that data corruption won't occur. - * - * For instance, - * 1. 0x00 disables the callback. In this case, copy out and one shot bits - * are ignored. - * 2. 0x01 enables a callback without copying out the received frames. A - * typical use case is the Camcorder application to avoid making costly - * frame copies. - * 3. 0x05 is enabling a callback with frame copied out repeatedly. A typical - * use case is the Camera application. - * 4. 0x07 is enabling a callback with frame copied out only once. A typical - * use case is the Barcode scanner application. - */ - -enum { - CAMERA_FRAME_CALLBACK_FLAG_ENABLE_MASK = 0x01, - CAMERA_FRAME_CALLBACK_FLAG_ONE_SHOT_MASK = 0x02, - CAMERA_FRAME_CALLBACK_FLAG_COPY_OUT_MASK = 0x04, - /** Typical use cases */ - CAMERA_FRAME_CALLBACK_FLAG_NOOP = 0x00, - CAMERA_FRAME_CALLBACK_FLAG_CAMCORDER = 0x01, - CAMERA_FRAME_CALLBACK_FLAG_CAMERA = 0x05, - CAMERA_FRAME_CALLBACK_FLAG_BARCODE_SCANNER = 0x07 -}; - -/** msgType in notifyCallback and dataCallback functions */ -enum { - CAMERA_MSG_ERROR = 0x0001, // notifyCallback - CAMERA_MSG_SHUTTER = 0x0002, // notifyCallback - CAMERA_MSG_FOCUS = 0x0004, // notifyCallback - CAMERA_MSG_ZOOM = 0x0008, // notifyCallback - CAMERA_MSG_PREVIEW_FRAME = 0x0010, // dataCallback - CAMERA_MSG_VIDEO_FRAME = 0x0020, // data_timestamp_callback - CAMERA_MSG_POSTVIEW_FRAME = 0x0040, // dataCallback - CAMERA_MSG_RAW_IMAGE = 0x0080, // dataCallback - CAMERA_MSG_COMPRESSED_IMAGE = 0x0100, // dataCallback - CAMERA_MSG_RAW_IMAGE_NOTIFY = 0x0200, // dataCallback - // Preview frame metadata. This can be combined with - // CAMERA_MSG_PREVIEW_FRAME in dataCallback. For example, the apps can - // request FRAME and METADATA. Or the apps can request only FRAME or only - // METADATA. - CAMERA_MSG_PREVIEW_METADATA = 0x0400, // dataCallback - // Notify on autofocus start and stop. This is useful in continuous - // autofocus - FOCUS_MODE_CONTINUOUS_VIDEO and FOCUS_MODE_CONTINUOUS_PICTURE. - CAMERA_MSG_FOCUS_MOVE = 0x0800, // notifyCallback - CAMERA_MSG_ALL_MSGS = 0xFFFF -}; - -/** cmdType in sendCommand functions */ -enum { - CAMERA_CMD_START_SMOOTH_ZOOM = 1, - CAMERA_CMD_STOP_SMOOTH_ZOOM = 2, - - /** - * Set the clockwise rotation of preview display (setPreviewDisplay) in - * degrees. This affects the preview frames and the picture displayed after - * snapshot. This method is useful for portrait mode applications. Note - * that preview display of front-facing cameras is flipped horizontally - * before the rotation, that is, the image is reflected along the central - * vertical axis of the camera sensor. So the users can see themselves as - * looking into a mirror. - * - * This does not affect the order of byte array of - * CAMERA_MSG_PREVIEW_FRAME, CAMERA_MSG_VIDEO_FRAME, - * CAMERA_MSG_POSTVIEW_FRAME, CAMERA_MSG_RAW_IMAGE, or - * CAMERA_MSG_COMPRESSED_IMAGE. This is allowed to be set during preview - * since API level 14. - */ - CAMERA_CMD_SET_DISPLAY_ORIENTATION = 3, - - /** - * cmdType to disable/enable shutter sound. In sendCommand passing arg1 = - * 0 will disable, while passing arg1 = 1 will enable the shutter sound. - */ - CAMERA_CMD_ENABLE_SHUTTER_SOUND = 4, - - /* cmdType to play recording sound */ - CAMERA_CMD_PLAY_RECORDING_SOUND = 5, - - /** - * Start the face detection. This should be called after preview is started. - * The camera will notify the listener of CAMERA_MSG_FACE and the detected - * faces in the preview frame. The detected faces may be the same as the - * previous ones. Apps should call CAMERA_CMD_STOP_FACE_DETECTION to stop - * the face detection. This method is supported if CameraParameters - * KEY_MAX_NUM_HW_DETECTED_FACES or KEY_MAX_NUM_SW_DETECTED_FACES is - * bigger than 0. Hardware and software face detection should not be running - * at the same time. If the face detection has started, apps should not send - * this again. - * - * In hardware face detection mode, CameraParameters KEY_WHITE_BALANCE, - * KEY_FOCUS_AREAS and KEY_METERING_AREAS have no effect. - * - * arg1 is the face detection type. It can be CAMERA_FACE_DETECTION_HW or - * CAMERA_FACE_DETECTION_SW. If the type of face detection requested is not - * supported, the HAL must return BAD_VALUE. - */ - CAMERA_CMD_START_FACE_DETECTION = 6, - - /** - * Stop the face detection. - */ - CAMERA_CMD_STOP_FACE_DETECTION = 7, - - /** - * Enable/disable focus move callback (CAMERA_MSG_FOCUS_MOVE). Passing - * arg1 = 0 will disable, while passing arg1 = 1 will enable the callback. - */ - CAMERA_CMD_ENABLE_FOCUS_MOVE_MSG = 8, - - /** - * Ping camera service to see if camera hardware is released. - * - * When any camera method returns error, the client can use ping command - * to see if the camera has been taken away by other clients. If the result - * is NO_ERROR, it means the camera hardware is not released. If the result - * is not NO_ERROR, the camera has been released and the existing client - * can silently finish itself or show a dialog. - */ - CAMERA_CMD_PING = 9, - - /** - * Configure the number of video buffers used for recording. The intended - * video buffer count for recording is passed as arg1, which must be - * greater than 0. This command must be sent before recording is started. - * This command returns INVALID_OPERATION error if it is sent after video - * recording is started, or the command is not supported at all. This - * command also returns a BAD_VALUE error if the intended video buffer - * count is non-positive or too big to be realized. - */ - CAMERA_CMD_SET_VIDEO_BUFFER_COUNT = 10, -}; - -/** camera fatal errors */ -enum { - CAMERA_ERROR_UNKNOWN = 1, - /** - * Camera was released because another client has connected to the camera. - * The original client should call Camera::disconnect immediately after - * getting this notification. Otherwise, the camera will be released by - * camera service in a short time. The client should not call any method - * (except disconnect and sending CAMERA_CMD_PING) after getting this. - */ - CAMERA_ERROR_RELEASED = 2, - CAMERA_ERROR_SERVER_DIED = 100 -}; - -enum { - /** The facing of the camera is opposite to that of the screen. */ - CAMERA_FACING_BACK = 0, - /** The facing of the camera is the same as that of the screen. */ - CAMERA_FACING_FRONT = 1 -}; - -enum { - /** Hardware face detection. It does not use much CPU. */ - CAMERA_FACE_DETECTION_HW = 0, - /** - * Software face detection. It uses some CPU. Applications must use - * Camera.setPreviewTexture for preview in this mode. - */ - CAMERA_FACE_DETECTION_SW = 1 -}; - -/** - * The information of a face from camera face detection. - */ -typedef struct camera_face { - /** - * Bounds of the face [left, top, right, bottom]. (-1000, -1000) represents - * the top-left of the camera field of view, and (1000, 1000) represents the - * bottom-right of the field of view. The width and height cannot be 0 or - * negative. This is supported by both hardware and software face detection. - * - * The direction is relative to the sensor orientation, that is, what the - * sensor sees. The direction is not affected by the rotation or mirroring - * of CAMERA_CMD_SET_DISPLAY_ORIENTATION. - */ - int32_t rect[4]; - - /** - * The confidence level of the face. The range is 1 to 100. 100 is the - * highest confidence. This is supported by both hardware and software - * face detection. - */ - int32_t score; - - /** - * An unique id per face while the face is visible to the tracker. If - * the face leaves the field-of-view and comes back, it will get a new - * id. If the value is 0, id is not supported. - */ - int32_t id; - - /** - * The coordinates of the center of the left eye. The range is -1000 to - * 1000. -2000, -2000 if this is not supported. - */ - int32_t left_eye[2]; - - /** - * The coordinates of the center of the right eye. The range is -1000 to - * 1000. -2000, -2000 if this is not supported. - */ - int32_t right_eye[2]; - - /** - * The coordinates of the center of the mouth. The range is -1000 to 1000. - * -2000, -2000 if this is not supported. - */ - int32_t mouth[2]; - -} camera_face_t; - -/** - * The metadata of the frame data. - */ -typedef struct camera_frame_metadata { - /** - * The number of detected faces in the frame. - */ - int32_t number_of_faces; - - /** - * An array of the detected faces. The length is number_of_faces. - */ - camera_face_t *faces; -} camera_frame_metadata_t; - -__END_DECLS - -#endif /* SYSTEM_CORE_INCLUDE_ANDROID_CAMERA_H */ diff --git a/external/android/include/19/system/core/include/system/graphics.h b/external/android/include/19/system/core/include/system/graphics.h deleted file mode 100644 index be86ae4..0000000 --- a/external/android/include/19/system/core/include/system/graphics.h +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Copyright (C) 2011 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 SYSTEM_CORE_INCLUDE_ANDROID_GRAPHICS_H -#define SYSTEM_CORE_INCLUDE_ANDROID_GRAPHICS_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * If the HAL needs to create service threads to handle graphics related - * tasks, these threads need to run at HAL_PRIORITY_URGENT_DISPLAY priority - * if they can block the main rendering thread in any way. - * - * the priority of the current thread can be set with: - * - * #include - * setpriority(PRIO_PROCESS, 0, HAL_PRIORITY_URGENT_DISPLAY); - * - */ - -#define HAL_PRIORITY_URGENT_DISPLAY (-8) - -/** - * pixel format definitions - */ - -enum { - /* - * "linear" color pixel formats: - * - * The pixel formats below contain sRGB data but are otherwise treated - * as linear formats, i.e.: no special operation is performed when - * reading or writing into a buffer in one of these formats - */ - HAL_PIXEL_FORMAT_RGBA_8888 = 1, - HAL_PIXEL_FORMAT_RGBX_8888 = 2, - HAL_PIXEL_FORMAT_RGB_888 = 3, - HAL_PIXEL_FORMAT_RGB_565 = 4, - HAL_PIXEL_FORMAT_BGRA_8888 = 5, - - /* - * sRGB color pixel formats: - * - * The red, green and blue components are stored in sRGB space, and converted - * to linear space when read, using the standard sRGB to linear equation: - * - * Clinear = Csrgb / 12.92 for Csrgb <= 0.04045 - * = (Csrgb + 0.055 / 1.055)^2.4 for Csrgb > 0.04045 - * - * When written the inverse transformation is performed: - * - * Csrgb = 12.92 * Clinear for Clinear <= 0.0031308 - * = 1.055 * Clinear^(1/2.4) - 0.055 for Clinear > 0.0031308 - * - * - * The alpha component, if present, is always stored in linear space and - * is left unmodified when read or written. - * - */ - HAL_PIXEL_FORMAT_sRGB_A_8888 = 0xC, - HAL_PIXEL_FORMAT_sRGB_X_8888 = 0xD, - - /* - * 0x100 - 0x1FF - * - * This range is reserved for pixel formats that are specific to the HAL - * implementation. Implementations can use any value in this range to - * communicate video pixel formats between their HAL modules. These formats - * must not have an alpha channel. Additionally, an EGLimage created from a - * gralloc buffer of one of these formats must be supported for use with the - * GL_OES_EGL_image_external OpenGL ES extension. - */ - - /* - * Android YUV format: - * - * This format is exposed outside of the HAL to software decoders and - * applications. EGLImageKHR must support it in conjunction with the - * OES_EGL_image_external extension. - * - * YV12 is a 4:2:0 YCrCb planar format comprised of a WxH Y plane followed - * by (W/2) x (H/2) Cr and Cb planes. - * - * This format assumes - * - an even width - * - an even height - * - a horizontal stride multiple of 16 pixels - * - a vertical stride equal to the height - * - * y_size = stride * height - * c_stride = ALIGN(stride/2, 16) - * c_size = c_stride * height/2 - * size = y_size + c_size * 2 - * cr_offset = y_size - * cb_offset = y_size + c_size - * - */ - HAL_PIXEL_FORMAT_YV12 = 0x32315659, // YCrCb 4:2:0 Planar - - - /* - * Android Y8 format: - * - * This format is exposed outside of the HAL to the framework. - * The expected gralloc usage flags are SW_* and HW_CAMERA_*, - * and no other HW_ flags will be used. - * - * Y8 is a YUV planar format comprised of a WxH Y plane, - * with each pixel being represented by 8 bits. - * - * It is equivalent to just the Y plane from YV12. - * - * This format assumes - * - an even width - * - an even height - * - a horizontal stride multiple of 16 pixels - * - a vertical stride equal to the height - * - * size = stride * height - * - */ - HAL_PIXEL_FORMAT_Y8 = 0x20203859, - - /* - * Android Y16 format: - * - * This format is exposed outside of the HAL to the framework. - * The expected gralloc usage flags are SW_* and HW_CAMERA_*, - * and no other HW_ flags will be used. - * - * Y16 is a YUV planar format comprised of a WxH Y plane, - * with each pixel being represented by 16 bits. - * - * It is just like Y8, but has double the bits per pixel (little endian). - * - * This format assumes - * - an even width - * - an even height - * - a horizontal stride multiple of 16 pixels - * - a vertical stride equal to the height - * - strides are specified in pixels, not in bytes - * - * size = stride * height * 2 - * - */ - HAL_PIXEL_FORMAT_Y16 = 0x20363159, - - /* - * Android RAW sensor format: - * - * This format is exposed outside of the HAL to applications. - * - * RAW_SENSOR is a single-channel 16-bit format, typically representing raw - * Bayer-pattern images from an image sensor, with minimal processing. - * - * The exact pixel layout of the data in the buffer is sensor-dependent, and - * needs to be queried from the camera device. - * - * Generally, not all 16 bits are used; more common values are 10 or 12 - * bits. All parameters to interpret the raw data (black and white points, - * color space, etc) must be queried from the camera device. - * - * This format assumes - * - an even width - * - an even height - * - a horizontal stride multiple of 16 pixels (32 bytes). - */ - HAL_PIXEL_FORMAT_RAW_SENSOR = 0x20, - - /* - * Android binary blob graphics buffer format: - * - * This format is used to carry task-specific data which does not have a - * standard image structure. The details of the format are left to the two - * endpoints. - * - * A typical use case is for transporting JPEG-compressed images from the - * Camera HAL to the framework or to applications. - * - * Buffers of this format must have a height of 1, and width equal to their - * size in bytes. - */ - HAL_PIXEL_FORMAT_BLOB = 0x21, - - /* - * Android format indicating that the choice of format is entirely up to the - * device-specific Gralloc implementation. - * - * The Gralloc implementation should examine the usage bits passed in when - * allocating a buffer with this format, and it should derive the pixel - * format from those usage flags. This format will never be used with any - * of the GRALLOC_USAGE_SW_* usage flags. - * - * If a buffer of this format is to be used as an OpenGL ES texture, the - * framework will assume that sampling the texture will always return an - * alpha value of 1.0 (i.e. the buffer contains only opaque pixel values). - * - */ - HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED = 0x22, - - /* - * Android flexible YCbCr formats - * - * This format allows platforms to use an efficient YCbCr/YCrCb buffer - * layout, while still describing the buffer layout in a way accessible to - * the CPU in a device-independent manner. While called YCbCr, it can be - * used to describe formats with either chromatic ordering, as well as - * whole planar or semiplanar layouts. - * - * struct android_ycbcr (below) is the the struct used to describe it. - * - * This format must be accepted by the gralloc module when - * USAGE_HW_CAMERA_WRITE and USAGE_SW_READ_* are set. - * - * This format is locked for use by gralloc's (*lock_ycbcr) method, and - * locking with the (*lock) method will return an error. - */ - HAL_PIXEL_FORMAT_YCbCr_420_888 = 0x23, - - /* Legacy formats (deprecated), used by ImageFormat.java */ - HAL_PIXEL_FORMAT_YCbCr_422_SP = 0x10, // NV16 - HAL_PIXEL_FORMAT_YCrCb_420_SP = 0x11, // NV21 - HAL_PIXEL_FORMAT_YCbCr_422_I = 0x14, // YUY2 -}; - -/* - * Structure for describing YCbCr formats for consumption by applications. - * This is used with HAL_PIXEL_FORMAT_YCbCr_*_888. - * - * Buffer chroma subsampling is defined in the format. - * e.g. HAL_PIXEL_FORMAT_YCbCr_420_888 has subsampling 4:2:0. - * - * Buffers must have a 8 bit depth. - * - * @y, @cb, and @cr point to the first byte of their respective planes. - * - * Stride describes the distance in bytes from the first value of one row of - * the image to the first value of the next row. It includes the width of the - * image plus padding. - * @ystride is the stride of the luma plane. - * @cstride is the stride of the chroma planes. - * - * @chroma_step is the distance in bytes from one chroma pixel value to the - * next. This is 2 bytes for semiplanar (because chroma values are interleaved - * and each chroma value is one byte) and 1 for planar. - */ - -struct android_ycbcr { - void *y; - void *cb; - void *cr; - size_t ystride; - size_t cstride; - size_t chroma_step; - - /** reserved for future use, set to 0 by gralloc's (*lock_ycbcr)() */ - uint32_t reserved[8]; -}; - -/** - * Transformation definitions - * - * IMPORTANT NOTE: - * HAL_TRANSFORM_ROT_90 is applied CLOCKWISE and AFTER HAL_TRANSFORM_FLIP_{H|V}. - * - */ - -enum { - /* flip source image horizontally (around the vertical axis) */ - HAL_TRANSFORM_FLIP_H = 0x01, - /* flip source image vertically (around the horizontal axis)*/ - HAL_TRANSFORM_FLIP_V = 0x02, - /* rotate source image 90 degrees clockwise */ - HAL_TRANSFORM_ROT_90 = 0x04, - /* rotate source image 180 degrees */ - HAL_TRANSFORM_ROT_180 = 0x03, - /* rotate source image 270 degrees clockwise */ - HAL_TRANSFORM_ROT_270 = 0x07, - /* don't use. see system/window.h */ - HAL_TRANSFORM_RESERVED = 0x08, -}; - -#ifdef __cplusplus -} -#endif - -#endif /* SYSTEM_CORE_INCLUDE_ANDROID_GRAPHICS_H */ diff --git a/external/android/include/19/system/core/include/system/thread_defs.h b/external/android/include/19/system/core/include/system/thread_defs.h deleted file mode 100644 index 377a48c..0000000 --- a/external/android/include/19/system/core/include/system/thread_defs.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2013 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_THREAD_DEFS_H -#define ANDROID_THREAD_DEFS_H - -#include "graphics.h" - -#if defined(__cplusplus) -extern "C" { -#endif - -enum { - /* - * *********************************************** - * ** Keep in sync with android.os.Process.java ** - * *********************************************** - * - * This maps directly to the "nice" priorities we use in Android. - * A thread priority should be chosen inverse-proportionally to - * the amount of work the thread is expected to do. The more work - * a thread will do, the less favorable priority it should get so that - * it doesn't starve the system. Threads not behaving properly might - * be "punished" by the kernel. - * Use the levels below when appropriate. Intermediate values are - * acceptable, preferably use the {MORE|LESS}_FAVORABLE constants below. - */ - ANDROID_PRIORITY_LOWEST = 19, - - /* use for background tasks */ - ANDROID_PRIORITY_BACKGROUND = 10, - - /* most threads run at normal priority */ - ANDROID_PRIORITY_NORMAL = 0, - - /* threads currently running a UI that the user is interacting with */ - ANDROID_PRIORITY_FOREGROUND = -2, - - /* the main UI thread has a slightly more favorable priority */ - ANDROID_PRIORITY_DISPLAY = -4, - - /* ui service treads might want to run at a urgent display (uncommon) */ - ANDROID_PRIORITY_URGENT_DISPLAY = HAL_PRIORITY_URGENT_DISPLAY, - - /* all normal audio threads */ - ANDROID_PRIORITY_AUDIO = -16, - - /* service audio threads (uncommon) */ - ANDROID_PRIORITY_URGENT_AUDIO = -19, - - /* should never be used in practice. regular process might not - * be allowed to use this level */ - ANDROID_PRIORITY_HIGHEST = -20, - - ANDROID_PRIORITY_DEFAULT = ANDROID_PRIORITY_NORMAL, - ANDROID_PRIORITY_MORE_FAVORABLE = -1, - ANDROID_PRIORITY_LESS_FAVORABLE = +1, -}; - -#if defined(__cplusplus) -} -#endif - -#endif /* ANDROID_THREAD_DEFS_H */ diff --git a/external/android/include/19/system/core/include/system/window.h b/external/android/include/19/system/core/include/system/window.h deleted file mode 100644 index 649bd71..0000000 --- a/external/android/include/19/system/core/include/system/window.h +++ /dev/null @@ -1,842 +0,0 @@ -/* - * Copyright (C) 2011 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 SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H -#define SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -__BEGIN_DECLS - -/*****************************************************************************/ - -#define ANDROID_NATIVE_MAKE_CONSTANT(a,b,c,d) \ - (((unsigned)(a)<<24)|((unsigned)(b)<<16)|((unsigned)(c)<<8)|(unsigned)(d)) - -#define ANDROID_NATIVE_WINDOW_MAGIC \ - ANDROID_NATIVE_MAKE_CONSTANT('_','w','n','d') - -#define ANDROID_NATIVE_BUFFER_MAGIC \ - ANDROID_NATIVE_MAKE_CONSTANT('_','b','f','r') - -// --------------------------------------------------------------------------- - -// This #define may be used to conditionally compile device-specific code to -// support either the prior ANativeWindow interface, which did not pass libsync -// fences around, or the new interface that does. This #define is only present -// when the ANativeWindow interface does include libsync support. -#define ANDROID_NATIVE_WINDOW_HAS_SYNC 1 - -// --------------------------------------------------------------------------- - -typedef const native_handle_t* buffer_handle_t; - -// --------------------------------------------------------------------------- - -typedef struct android_native_rect_t -{ - int32_t left; - int32_t top; - int32_t right; - int32_t bottom; -} android_native_rect_t; - -// --------------------------------------------------------------------------- - -typedef struct android_native_base_t -{ - /* a magic value defined by the actual EGL native type */ - int magic; - - /* the sizeof() of the actual EGL native type */ - int version; - - void* reserved[4]; - - /* reference-counting interface */ - void (*incRef)(struct android_native_base_t* base); - void (*decRef)(struct android_native_base_t* base); -} android_native_base_t; - -typedef struct ANativeWindowBuffer -{ -#ifdef __cplusplus - ANativeWindowBuffer() { - common.magic = ANDROID_NATIVE_BUFFER_MAGIC; - common.version = sizeof(ANativeWindowBuffer); - memset(common.reserved, 0, sizeof(common.reserved)); - } - - // Implement the methods that sp expects so that it - // can be used to automatically refcount ANativeWindowBuffer's. - void incStrong(const void* id) const { - common.incRef(const_cast(&common)); - } - void decStrong(const void* id) const { - common.decRef(const_cast(&common)); - } -#endif - - struct android_native_base_t common; - - int width; - int height; - int stride; - int format; - int usage; - - void* reserved[2]; - - buffer_handle_t handle; - - void* reserved_proc[8]; -} ANativeWindowBuffer_t; - -// Old typedef for backwards compatibility. -typedef ANativeWindowBuffer_t android_native_buffer_t; - -// --------------------------------------------------------------------------- - -/* attributes queriable with query() */ -enum { - NATIVE_WINDOW_WIDTH = 0, - NATIVE_WINDOW_HEIGHT = 1, - NATIVE_WINDOW_FORMAT = 2, - - /* The minimum number of buffers that must remain un-dequeued after a buffer - * has been queued. This value applies only if set_buffer_count was used to - * override the number of buffers and if a buffer has since been queued. - * Users of the set_buffer_count ANativeWindow method should query this - * value before calling set_buffer_count. If it is necessary to have N - * buffers simultaneously dequeued as part of the steady-state operation, - * and this query returns M then N+M buffers should be requested via - * native_window_set_buffer_count. - * - * Note that this value does NOT apply until a single buffer has been - * queued. In particular this means that it is possible to: - * - * 1. Query M = min undequeued buffers - * 2. Set the buffer count to N + M - * 3. Dequeue all N + M buffers - * 4. Cancel M buffers - * 5. Queue, dequeue, queue, dequeue, ad infinitum - */ - NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS = 3, - - /* Check whether queueBuffer operations on the ANativeWindow send the buffer - * to the window compositor. The query sets the returned 'value' argument - * to 1 if the ANativeWindow DOES send queued buffers directly to the window - * compositor and 0 if the buffers do not go directly to the window - * compositor. - * - * This can be used to determine whether protected buffer content should be - * sent to the ANativeWindow. Note, however, that a result of 1 does NOT - * indicate that queued buffers will be protected from applications or users - * capturing their contents. If that behavior is desired then some other - * mechanism (e.g. the GRALLOC_USAGE_PROTECTED flag) should be used in - * conjunction with this query. - */ - NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER = 4, - - /* Get the concrete type of a ANativeWindow. See below for the list of - * possible return values. - * - * This query should not be used outside the Android framework and will - * likely be removed in the near future. - */ - NATIVE_WINDOW_CONCRETE_TYPE = 5, - - - /* - * Default width and height of ANativeWindow buffers, these are the - * dimensions of the window buffers irrespective of the - * NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS call and match the native window - * size unless overridden by NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS. - */ - NATIVE_WINDOW_DEFAULT_WIDTH = 6, - NATIVE_WINDOW_DEFAULT_HEIGHT = 7, - - /* - * transformation that will most-likely be applied to buffers. This is only - * a hint, the actual transformation applied might be different. - * - * INTENDED USE: - * - * The transform hint can be used by a producer, for instance the GLES - * driver, to pre-rotate the rendering such that the final transformation - * in the composer is identity. This can be very useful when used in - * conjunction with the h/w composer HAL, in situations where it - * cannot handle arbitrary rotations. - * - * 1. Before dequeuing a buffer, the GL driver (or any other ANW client) - * queries the ANW for NATIVE_WINDOW_TRANSFORM_HINT. - * - * 2. The GL driver overrides the width and height of the ANW to - * account for NATIVE_WINDOW_TRANSFORM_HINT. This is done by querying - * NATIVE_WINDOW_DEFAULT_{WIDTH | HEIGHT}, swapping the dimensions - * according to NATIVE_WINDOW_TRANSFORM_HINT and calling - * native_window_set_buffers_dimensions(). - * - * 3. The GL driver dequeues a buffer of the new pre-rotated size. - * - * 4. The GL driver renders to the buffer such that the image is - * already transformed, that is applying NATIVE_WINDOW_TRANSFORM_HINT - * to the rendering. - * - * 5. The GL driver calls native_window_set_transform to apply - * inverse transformation to the buffer it just rendered. - * In order to do this, the GL driver needs - * to calculate the inverse of NATIVE_WINDOW_TRANSFORM_HINT, this is - * done easily: - * - * int hintTransform, inverseTransform; - * query(..., NATIVE_WINDOW_TRANSFORM_HINT, &hintTransform); - * inverseTransform = hintTransform; - * if (hintTransform & HAL_TRANSFORM_ROT_90) - * inverseTransform ^= HAL_TRANSFORM_ROT_180; - * - * - * 6. The GL driver queues the pre-transformed buffer. - * - * 7. The composer combines the buffer transform with the display - * transform. If the buffer transform happens to cancel out the - * display transform then no rotation is needed. - * - */ - NATIVE_WINDOW_TRANSFORM_HINT = 8, - - /* - * Boolean that indicates whether the consumer is running more than - * one buffer behind the producer. - */ - NATIVE_WINDOW_CONSUMER_RUNNING_BEHIND = 9, - - /* - * The consumer gralloc usage bits currently set by the consumer. - * The values are defined in hardware/libhardware/include/gralloc.h. - */ - NATIVE_WINDOW_CONSUMER_USAGE_BITS = 10 -}; - -/* Valid operations for the (*perform)() hook. - * - * Values marked as 'deprecated' are supported, but have been superceded by - * other functionality. - * - * Values marked as 'private' should be considered private to the framework. - * HAL implementation code with access to an ANativeWindow should not use these, - * as it may not interact properly with the framework's use of the - * ANativeWindow. - */ -enum { - NATIVE_WINDOW_SET_USAGE = 0, - NATIVE_WINDOW_CONNECT = 1, /* deprecated */ - NATIVE_WINDOW_DISCONNECT = 2, /* deprecated */ - NATIVE_WINDOW_SET_CROP = 3, /* private */ - NATIVE_WINDOW_SET_BUFFER_COUNT = 4, - NATIVE_WINDOW_SET_BUFFERS_GEOMETRY = 5, /* deprecated */ - NATIVE_WINDOW_SET_BUFFERS_TRANSFORM = 6, - NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP = 7, - NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS = 8, - NATIVE_WINDOW_SET_BUFFERS_FORMAT = 9, - NATIVE_WINDOW_SET_SCALING_MODE = 10, /* private */ - NATIVE_WINDOW_LOCK = 11, /* private */ - NATIVE_WINDOW_UNLOCK_AND_POST = 12, /* private */ - NATIVE_WINDOW_API_CONNECT = 13, /* private */ - NATIVE_WINDOW_API_DISCONNECT = 14, /* private */ - NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS = 15, /* private */ - NATIVE_WINDOW_SET_POST_TRANSFORM_CROP = 16, /* private */ -}; - -/* parameter for NATIVE_WINDOW_[API_][DIS]CONNECT */ -enum { - /* Buffers will be queued by EGL via eglSwapBuffers after being filled using - * OpenGL ES. - */ - NATIVE_WINDOW_API_EGL = 1, - - /* Buffers will be queued after being filled using the CPU - */ - NATIVE_WINDOW_API_CPU = 2, - - /* Buffers will be queued by Stagefright after being filled by a video - * decoder. The video decoder can either be a software or hardware decoder. - */ - NATIVE_WINDOW_API_MEDIA = 3, - - /* Buffers will be queued by the the camera HAL. - */ - NATIVE_WINDOW_API_CAMERA = 4, -}; - -/* parameter for NATIVE_WINDOW_SET_BUFFERS_TRANSFORM */ -enum { - /* flip source image horizontally */ - NATIVE_WINDOW_TRANSFORM_FLIP_H = HAL_TRANSFORM_FLIP_H , - /* flip source image vertically */ - NATIVE_WINDOW_TRANSFORM_FLIP_V = HAL_TRANSFORM_FLIP_V, - /* rotate source image 90 degrees clock-wise, and is applied after TRANSFORM_FLIP_{H|V} */ - NATIVE_WINDOW_TRANSFORM_ROT_90 = HAL_TRANSFORM_ROT_90, - /* rotate source image 180 degrees */ - NATIVE_WINDOW_TRANSFORM_ROT_180 = HAL_TRANSFORM_ROT_180, - /* rotate source image 270 degrees clock-wise */ - NATIVE_WINDOW_TRANSFORM_ROT_270 = HAL_TRANSFORM_ROT_270, - /* transforms source by the inverse transform of the screen it is displayed onto. This - * transform is applied last */ - NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY = 0x08 -}; - -/* parameter for NATIVE_WINDOW_SET_SCALING_MODE */ -enum { - /* the window content is not updated (frozen) until a buffer of - * the window size is received (enqueued) - */ - NATIVE_WINDOW_SCALING_MODE_FREEZE = 0, - /* the buffer is scaled in both dimensions to match the window size */ - NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW = 1, - /* the buffer is scaled uniformly such that the smaller dimension - * of the buffer matches the window size (cropping in the process) - */ - NATIVE_WINDOW_SCALING_MODE_SCALE_CROP = 2, - /* the window is clipped to the size of the buffer's crop rectangle; pixels - * outside the crop rectangle are treated as if they are completely - * transparent. - */ - NATIVE_WINDOW_SCALING_MODE_NO_SCALE_CROP = 3, -}; - -/* values returned by the NATIVE_WINDOW_CONCRETE_TYPE query */ -enum { - NATIVE_WINDOW_FRAMEBUFFER = 0, /* FramebufferNativeWindow */ - NATIVE_WINDOW_SURFACE = 1, /* Surface */ -}; - -/* parameter for NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP - * - * Special timestamp value to indicate that timestamps should be auto-generated - * by the native window when queueBuffer is called. This is equal to INT64_MIN, - * defined directly to avoid problems with C99/C++ inclusion of stdint.h. - */ -static const int64_t NATIVE_WINDOW_TIMESTAMP_AUTO = (-9223372036854775807LL-1); - -struct ANativeWindow -{ -#ifdef __cplusplus - ANativeWindow() - : flags(0), minSwapInterval(0), maxSwapInterval(0), xdpi(0), ydpi(0) - { - common.magic = ANDROID_NATIVE_WINDOW_MAGIC; - common.version = sizeof(ANativeWindow); - memset(common.reserved, 0, sizeof(common.reserved)); - } - - /* Implement the methods that sp expects so that it - can be used to automatically refcount ANativeWindow's. */ - void incStrong(const void* id) const { - common.incRef(const_cast(&common)); - } - void decStrong(const void* id) const { - common.decRef(const_cast(&common)); - } -#endif - - struct android_native_base_t common; - - /* flags describing some attributes of this surface or its updater */ - const uint32_t flags; - - /* min swap interval supported by this updated */ - const int minSwapInterval; - - /* max swap interval supported by this updated */ - const int maxSwapInterval; - - /* horizontal and vertical resolution in DPI */ - const float xdpi; - const float ydpi; - - /* Some storage reserved for the OEM's driver. */ - intptr_t oem[4]; - - /* - * Set the swap interval for this surface. - * - * Returns 0 on success or -errno on error. - */ - int (*setSwapInterval)(struct ANativeWindow* window, - int interval); - - /* - * Hook called by EGL to acquire a buffer. After this call, the buffer - * is not locked, so its content cannot be modified. This call may block if - * no buffers are available. - * - * The window holds a reference to the buffer between dequeueBuffer and - * either queueBuffer or cancelBuffer, so clients only need their own - * reference if they might use the buffer after queueing or canceling it. - * Holding a reference to a buffer after queueing or canceling it is only - * allowed if a specific buffer count has been set. - * - * Returns 0 on success or -errno on error. - * - * XXX: This function is deprecated. It will continue to work for some - * time for binary compatibility, but the new dequeueBuffer function that - * outputs a fence file descriptor should be used in its place. - */ - int (*dequeueBuffer_DEPRECATED)(struct ANativeWindow* window, - struct ANativeWindowBuffer** buffer); - - /* - * hook called by EGL to lock a buffer. This MUST be called before modifying - * the content of a buffer. The buffer must have been acquired with - * dequeueBuffer first. - * - * Returns 0 on success or -errno on error. - * - * XXX: This function is deprecated. It will continue to work for some - * time for binary compatibility, but it is essentially a no-op, and calls - * to it should be removed. - */ - int (*lockBuffer_DEPRECATED)(struct ANativeWindow* window, - struct ANativeWindowBuffer* buffer); - - /* - * Hook called by EGL when modifications to the render buffer are done. - * This unlocks and post the buffer. - * - * The window holds a reference to the buffer between dequeueBuffer and - * either queueBuffer or cancelBuffer, so clients only need their own - * reference if they might use the buffer after queueing or canceling it. - * Holding a reference to a buffer after queueing or canceling it is only - * allowed if a specific buffer count has been set. - * - * Buffers MUST be queued in the same order than they were dequeued. - * - * Returns 0 on success or -errno on error. - * - * XXX: This function is deprecated. It will continue to work for some - * time for binary compatibility, but the new queueBuffer function that - * takes a fence file descriptor should be used in its place (pass a value - * of -1 for the fence file descriptor if there is no valid one to pass). - */ - int (*queueBuffer_DEPRECATED)(struct ANativeWindow* window, - struct ANativeWindowBuffer* buffer); - - /* - * hook used to retrieve information about the native window. - * - * Returns 0 on success or -errno on error. - */ - int (*query)(const struct ANativeWindow* window, - int what, int* value); - - /* - * hook used to perform various operations on the surface. - * (*perform)() is a generic mechanism to add functionality to - * ANativeWindow while keeping backward binary compatibility. - * - * DO NOT CALL THIS HOOK DIRECTLY. Instead, use the helper functions - * defined below. - * - * (*perform)() returns -ENOENT if the 'what' parameter is not supported - * by the surface's implementation. - * - * The valid operations are: - * NATIVE_WINDOW_SET_USAGE - * NATIVE_WINDOW_CONNECT (deprecated) - * NATIVE_WINDOW_DISCONNECT (deprecated) - * NATIVE_WINDOW_SET_CROP (private) - * NATIVE_WINDOW_SET_BUFFER_COUNT - * NATIVE_WINDOW_SET_BUFFERS_GEOMETRY (deprecated) - * NATIVE_WINDOW_SET_BUFFERS_TRANSFORM - * NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP - * NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS - * NATIVE_WINDOW_SET_BUFFERS_FORMAT - * NATIVE_WINDOW_SET_SCALING_MODE (private) - * NATIVE_WINDOW_LOCK (private) - * NATIVE_WINDOW_UNLOCK_AND_POST (private) - * NATIVE_WINDOW_API_CONNECT (private) - * NATIVE_WINDOW_API_DISCONNECT (private) - * NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS (private) - * NATIVE_WINDOW_SET_POST_TRANSFORM_CROP (private) - * - */ - - int (*perform)(struct ANativeWindow* window, - int operation, ... ); - - /* - * Hook used to cancel a buffer that has been dequeued. - * No synchronization is performed between dequeue() and cancel(), so - * either external synchronization is needed, or these functions must be - * called from the same thread. - * - * The window holds a reference to the buffer between dequeueBuffer and - * either queueBuffer or cancelBuffer, so clients only need their own - * reference if they might use the buffer after queueing or canceling it. - * Holding a reference to a buffer after queueing or canceling it is only - * allowed if a specific buffer count has been set. - * - * XXX: This function is deprecated. It will continue to work for some - * time for binary compatibility, but the new cancelBuffer function that - * takes a fence file descriptor should be used in its place (pass a value - * of -1 for the fence file descriptor if there is no valid one to pass). - */ - int (*cancelBuffer_DEPRECATED)(struct ANativeWindow* window, - struct ANativeWindowBuffer* buffer); - - /* - * Hook called by EGL to acquire a buffer. This call may block if no - * buffers are available. - * - * The window holds a reference to the buffer between dequeueBuffer and - * either queueBuffer or cancelBuffer, so clients only need their own - * reference if they might use the buffer after queueing or canceling it. - * Holding a reference to a buffer after queueing or canceling it is only - * allowed if a specific buffer count has been set. - * - * The libsync fence file descriptor returned in the int pointed to by the - * fenceFd argument will refer to the fence that must signal before the - * dequeued buffer may be written to. A value of -1 indicates that the - * caller may access the buffer immediately without waiting on a fence. If - * a valid file descriptor is returned (i.e. any value except -1) then the - * caller is responsible for closing the file descriptor. - * - * Returns 0 on success or -errno on error. - */ - int (*dequeueBuffer)(struct ANativeWindow* window, - struct ANativeWindowBuffer** buffer, int* fenceFd); - - /* - * Hook called by EGL when modifications to the render buffer are done. - * This unlocks and post the buffer. - * - * The window holds a reference to the buffer between dequeueBuffer and - * either queueBuffer or cancelBuffer, so clients only need their own - * reference if they might use the buffer after queueing or canceling it. - * Holding a reference to a buffer after queueing or canceling it is only - * allowed if a specific buffer count has been set. - * - * The fenceFd argument specifies a libsync fence file descriptor for a - * fence that must signal before the buffer can be accessed. If the buffer - * can be accessed immediately then a value of -1 should be used. The - * caller must not use the file descriptor after it is passed to - * queueBuffer, and the ANativeWindow implementation is responsible for - * closing it. - * - * Returns 0 on success or -errno on error. - */ - int (*queueBuffer)(struct ANativeWindow* window, - struct ANativeWindowBuffer* buffer, int fenceFd); - - /* - * Hook used to cancel a buffer that has been dequeued. - * No synchronization is performed between dequeue() and cancel(), so - * either external synchronization is needed, or these functions must be - * called from the same thread. - * - * The window holds a reference to the buffer between dequeueBuffer and - * either queueBuffer or cancelBuffer, so clients only need their own - * reference if they might use the buffer after queueing or canceling it. - * Holding a reference to a buffer after queueing or canceling it is only - * allowed if a specific buffer count has been set. - * - * The fenceFd argument specifies a libsync fence file decsriptor for a - * fence that must signal before the buffer can be accessed. If the buffer - * can be accessed immediately then a value of -1 should be used. - * - * Note that if the client has not waited on the fence that was returned - * from dequeueBuffer, that same fence should be passed to cancelBuffer to - * ensure that future uses of the buffer are preceded by a wait on that - * fence. The caller must not use the file descriptor after it is passed - * to cancelBuffer, and the ANativeWindow implementation is responsible for - * closing it. - * - * Returns 0 on success or -errno on error. - */ - int (*cancelBuffer)(struct ANativeWindow* window, - struct ANativeWindowBuffer* buffer, int fenceFd); -}; - - /* Backwards compatibility: use ANativeWindow (struct ANativeWindow in C). - * android_native_window_t is deprecated. - */ -typedef struct ANativeWindow ANativeWindow; -typedef struct ANativeWindow android_native_window_t; - -/* - * native_window_set_usage(..., usage) - * Sets the intended usage flags for the next buffers - * acquired with (*lockBuffer)() and on. - * By default (if this function is never called), a usage of - * GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE - * is assumed. - * Calling this function will usually cause following buffers to be - * reallocated. - */ - -static inline int native_window_set_usage( - struct ANativeWindow* window, int usage) -{ - return window->perform(window, NATIVE_WINDOW_SET_USAGE, usage); -} - -/* deprecated. Always returns 0. Don't call. */ -static inline int native_window_connect( - struct ANativeWindow* window, int api) { - return 0; -} - -/* deprecated. Always returns 0. Don't call. */ -static inline int native_window_disconnect( - struct ANativeWindow* window, int api) { - return 0; -} - -/* - * native_window_set_crop(..., crop) - * Sets which region of the next queued buffers needs to be considered. - * Depending on the scaling mode, a buffer's crop region is scaled and/or - * cropped to match the surface's size. This function sets the crop in - * pre-transformed buffer pixel coordinates. - * - * The specified crop region applies to all buffers queued after it is called. - * - * If 'crop' is NULL, subsequently queued buffers won't be cropped. - * - * An error is returned if for instance the crop region is invalid, out of the - * buffer's bound or if the window is invalid. - */ -static inline int native_window_set_crop( - struct ANativeWindow* window, - android_native_rect_t const * crop) -{ - return window->perform(window, NATIVE_WINDOW_SET_CROP, crop); -} - -/* - * native_window_set_post_transform_crop(..., crop) - * Sets which region of the next queued buffers needs to be considered. - * Depending on the scaling mode, a buffer's crop region is scaled and/or - * cropped to match the surface's size. This function sets the crop in - * post-transformed pixel coordinates. - * - * The specified crop region applies to all buffers queued after it is called. - * - * If 'crop' is NULL, subsequently queued buffers won't be cropped. - * - * An error is returned if for instance the crop region is invalid, out of the - * buffer's bound or if the window is invalid. - */ -static inline int native_window_set_post_transform_crop( - struct ANativeWindow* window, - android_native_rect_t const * crop) -{ - return window->perform(window, NATIVE_WINDOW_SET_POST_TRANSFORM_CROP, crop); -} - -/* - * native_window_set_active_rect(..., active_rect) - * - * This function is deprecated and will be removed soon. For now it simply - * sets the post-transform crop for compatibility while multi-project commits - * get checked. - */ -static inline int native_window_set_active_rect( - struct ANativeWindow* window, - android_native_rect_t const * active_rect) -{ - return native_window_set_post_transform_crop(window, active_rect); -} - -/* - * native_window_set_buffer_count(..., count) - * Sets the number of buffers associated with this native window. - */ -static inline int native_window_set_buffer_count( - struct ANativeWindow* window, - size_t bufferCount) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFER_COUNT, bufferCount); -} - -/* - * native_window_set_buffers_geometry(..., int w, int h, int format) - * All buffers dequeued after this call will have the dimensions and format - * specified. A successful call to this function has the same effect as calling - * native_window_set_buffers_size and native_window_set_buffers_format. - * - * XXX: This function is deprecated. The native_window_set_buffers_dimensions - * and native_window_set_buffers_format functions should be used instead. - */ -static inline int native_window_set_buffers_geometry( - struct ANativeWindow* window, - int w, int h, int format) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_GEOMETRY, - w, h, format); -} - -/* - * native_window_set_buffers_dimensions(..., int w, int h) - * All buffers dequeued after this call will have the dimensions specified. - * In particular, all buffers will have a fixed-size, independent from the - * native-window size. They will be scaled according to the scaling mode - * (see native_window_set_scaling_mode) upon window composition. - * - * If w and h are 0, the normal behavior is restored. That is, dequeued buffers - * following this call will be sized to match the window's size. - * - * Calling this function will reset the window crop to a NULL value, which - * disables cropping of the buffers. - */ -static inline int native_window_set_buffers_dimensions( - struct ANativeWindow* window, - int w, int h) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS, - w, h); -} - -/* - * native_window_set_buffers_user_dimensions(..., int w, int h) - * - * Sets the user buffer size for the window, which overrides the - * window's size. All buffers dequeued after this call will have the - * dimensions specified unless overridden by - * native_window_set_buffers_dimensions. All buffers will have a - * fixed-size, independent from the native-window size. They will be - * scaled according to the scaling mode (see - * native_window_set_scaling_mode) upon window composition. - * - * If w and h are 0, the normal behavior is restored. That is, the - * default buffer size will match the windows's size. - * - * Calling this function will reset the window crop to a NULL value, which - * disables cropping of the buffers. - */ -static inline int native_window_set_buffers_user_dimensions( - struct ANativeWindow* window, - int w, int h) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS, - w, h); -} - -/* - * native_window_set_buffers_format(..., int format) - * All buffers dequeued after this call will have the format specified. - * - * If the specified format is 0, the default buffer format will be used. - */ -static inline int native_window_set_buffers_format( - struct ANativeWindow* window, - int format) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_FORMAT, format); -} - -/* - * native_window_set_buffers_transform(..., int transform) - * All buffers queued after this call will be displayed transformed according - * to the transform parameter specified. - */ -static inline int native_window_set_buffers_transform( - struct ANativeWindow* window, - int transform) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_TRANSFORM, - transform); -} - -/* - * native_window_set_buffers_timestamp(..., int64_t timestamp) - * All buffers queued after this call will be associated with the timestamp - * parameter specified. If the timestamp is set to NATIVE_WINDOW_TIMESTAMP_AUTO - * (the default), timestamps will be generated automatically when queueBuffer is - * called. The timestamp is measured in nanoseconds, and is normally monotonically - * increasing. The timestamp should be unaffected by time-of-day adjustments, - * and for a camera should be strictly monotonic but for a media player may be - * reset when the position is set. - */ -static inline int native_window_set_buffers_timestamp( - struct ANativeWindow* window, - int64_t timestamp) -{ - return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP, - timestamp); -} - -/* - * native_window_set_scaling_mode(..., int mode) - * All buffers queued after this call will be associated with the scaling mode - * specified. - */ -static inline int native_window_set_scaling_mode( - struct ANativeWindow* window, - int mode) -{ - return window->perform(window, NATIVE_WINDOW_SET_SCALING_MODE, - mode); -} - -/* - * native_window_api_connect(..., int api) - * connects an API to this window. only one API can be connected at a time. - * Returns -EINVAL if for some reason the window cannot be connected, which - * can happen if it's connected to some other API. - */ -static inline int native_window_api_connect( - struct ANativeWindow* window, int api) -{ - return window->perform(window, NATIVE_WINDOW_API_CONNECT, api); -} - -/* - * native_window_api_disconnect(..., int api) - * disconnect the API from this window. - * An error is returned if for instance the window wasn't connected in the - * first place. - */ -static inline int native_window_api_disconnect( - struct ANativeWindow* window, int api) -{ - return window->perform(window, NATIVE_WINDOW_API_DISCONNECT, api); -} - -/* - * native_window_dequeue_buffer_and_wait(...) - * Dequeue a buffer and wait on the fence associated with that buffer. The - * buffer may safely be accessed immediately upon this function returning. An - * error is returned if either of the dequeue or the wait operations fail. - */ -static inline int native_window_dequeue_buffer_and_wait(ANativeWindow *anw, - struct ANativeWindowBuffer** anb) { - return anw->dequeueBuffer_DEPRECATED(anw, anb); -} - - -__END_DECLS - -#endif /* SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H */ diff --git a/external/android/include/19/system/core/include/utils/AndroidThreads.h b/external/android/include/19/system/core/include/utils/AndroidThreads.h deleted file mode 100644 index 4eee14d..0000000 --- a/external/android/include/19/system/core/include/utils/AndroidThreads.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * 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 _LIBS_UTILS_ANDROID_THREADS_H -#define _LIBS_UTILS_ANDROID_THREADS_H - -#include -#include - -#if defined(HAVE_PTHREADS) -# include -#endif - -#include - -// --------------------------------------------------------------------------- -// C API - -#ifdef __cplusplus -extern "C" { -#endif - -// Create and run a new thread. -extern int androidCreateThread(android_thread_func_t, void *); - -// Create thread with lots of parameters -extern int androidCreateThreadEtc(android_thread_func_t entryFunction, - void *userData, - const char* threadName, - int32_t threadPriority, - size_t threadStackSize, - android_thread_id_t *threadId); - -// Get some sort of unique identifier for the current thread. -extern android_thread_id_t androidGetThreadId(); - -// Low-level thread creation -- never creates threads that can -// interact with the Java VM. -extern int androidCreateRawThreadEtc(android_thread_func_t entryFunction, - void *userData, - const char* threadName, - int32_t threadPriority, - size_t threadStackSize, - android_thread_id_t *threadId); - -// set the same of the running thread -extern void androidSetThreadName(const char* name); - -// Used by the Java Runtime to control how threads are created, so that -// they can be proper and lovely Java threads. -typedef int (*android_create_thread_fn)(android_thread_func_t entryFunction, - void *userData, - const char* threadName, - int32_t threadPriority, - size_t threadStackSize, - android_thread_id_t *threadId); - -extern void androidSetCreateThreadFunc(android_create_thread_fn func); - -// ------------------------------------------------------------------ -// Extra functions working with raw pids. - -// Get pid for the current thread. -extern pid_t androidGetTid(); - -#ifdef HAVE_ANDROID_OS -// Change the priority AND scheduling group of a particular thread. The priority -// should be one of the ANDROID_PRIORITY constants. Returns INVALID_OPERATION -// if the priority set failed, else another value if just the group set failed; -// in either case errno is set. Thread ID zero means current thread. -extern int androidSetThreadPriority(pid_t tid, int prio); - -// Get the current priority of a particular thread. Returns one of the -// ANDROID_PRIORITY constants or a negative result in case of error. -extern int androidGetThreadPriority(pid_t tid); -#endif - -#ifdef __cplusplus -} // extern "C" -#endif - -// ---------------------------------------------------------------------------- -// C++ API -#ifdef __cplusplus -namespace android { -// ---------------------------------------------------------------------------- - -// Create and run a new thread. -inline bool createThread(thread_func_t f, void *a) { - return androidCreateThread(f, a) ? true : false; -} - -// Create thread with lots of parameters -inline bool createThreadEtc(thread_func_t entryFunction, - void *userData, - const char* threadName = "android:unnamed_thread", - int32_t threadPriority = PRIORITY_DEFAULT, - size_t threadStackSize = 0, - thread_id_t *threadId = 0) -{ - return androidCreateThreadEtc(entryFunction, userData, threadName, - threadPriority, threadStackSize, threadId) ? true : false; -} - -// Get some sort of unique identifier for the current thread. -inline thread_id_t getThreadId() { - return androidGetThreadId(); -} - -// ---------------------------------------------------------------------------- -}; // namespace android -#endif // __cplusplus -// ---------------------------------------------------------------------------- - -#endif // _LIBS_UTILS_ANDROID_THREADS_H diff --git a/external/android/include/19/system/core/include/utils/Atomic.h b/external/android/include/19/system/core/include/utils/Atomic.h deleted file mode 100644 index 7eb476c..0000000 --- a/external/android/include/19/system/core/include/utils/Atomic.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2005 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_UTILS_ATOMIC_H -#define ANDROID_UTILS_ATOMIC_H - -#include - -#endif // ANDROID_UTILS_ATOMIC_H diff --git a/external/android/include/19/system/core/include/utils/BasicHashtable.h b/external/android/include/19/system/core/include/utils/BasicHashtable.h deleted file mode 100644 index c235d62..0000000 --- a/external/android/include/19/system/core/include/utils/BasicHashtable.h +++ /dev/null @@ -1,402 +0,0 @@ -/* - * Copyright (C) 2011 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_BASIC_HASHTABLE_H -#define ANDROID_BASIC_HASHTABLE_H - -#include -#include -#include -#include - -namespace android { - -/* Implementation type. Nothing to see here. */ -class BasicHashtableImpl { -protected: - struct Bucket { - // The collision flag indicates that the bucket is part of a collision chain - // such that at least two entries both hash to this bucket. When true, we - // may need to seek further along the chain to find the entry. - static const uint32_t COLLISION = 0x80000000UL; - - // The present flag indicates that the bucket contains an initialized entry value. - static const uint32_t PRESENT = 0x40000000UL; - - // Mask for 30 bits worth of the hash code that are stored within the bucket to - // speed up lookups and rehashing by eliminating the need to recalculate the - // hash code of the entry's key. - static const uint32_t HASH_MASK = 0x3fffffffUL; - - // Combined value that stores the collision and present flags as well as - // a 30 bit hash code. - uint32_t cookie; - - // Storage for the entry begins here. - char entry[0]; - }; - - BasicHashtableImpl(size_t entrySize, bool hasTrivialDestructor, - size_t minimumInitialCapacity, float loadFactor); - BasicHashtableImpl(const BasicHashtableImpl& other); - virtual ~BasicHashtableImpl(); - - void dispose(); - - inline void edit() { - if (mBuckets && !SharedBuffer::bufferFromData(mBuckets)->onlyOwner()) { - clone(); - } - } - - void setTo(const BasicHashtableImpl& other); - void clear(); - - ssize_t next(ssize_t index) const; - ssize_t find(ssize_t index, hash_t hash, const void* __restrict__ key) const; - size_t add(hash_t hash, const void* __restrict__ entry); - void removeAt(size_t index); - void rehash(size_t minimumCapacity, float loadFactor); - - const size_t mBucketSize; // number of bytes per bucket including the entry - const bool mHasTrivialDestructor; // true if the entry type does not require destruction - size_t mCapacity; // number of buckets that can be filled before exceeding load factor - float mLoadFactor; // load factor - size_t mSize; // number of elements actually in the table - size_t mFilledBuckets; // number of buckets for which collision or present is true - size_t mBucketCount; // number of slots in the mBuckets array - void* mBuckets; // array of buckets, as a SharedBuffer - - inline const Bucket& bucketAt(const void* __restrict__ buckets, size_t index) const { - return *reinterpret_cast( - static_cast(buckets) + index * mBucketSize); - } - - inline Bucket& bucketAt(void* __restrict__ buckets, size_t index) const { - return *reinterpret_cast(static_cast(buckets) + index * mBucketSize); - } - - virtual bool compareBucketKey(const Bucket& bucket, const void* __restrict__ key) const = 0; - virtual void initializeBucketEntry(Bucket& bucket, const void* __restrict__ entry) const = 0; - virtual void destroyBucketEntry(Bucket& bucket) const = 0; - -private: - void clone(); - - // Allocates a bucket array as a SharedBuffer. - void* allocateBuckets(size_t count) const; - - // Releases a bucket array's associated SharedBuffer. - void releaseBuckets(void* __restrict__ buckets, size_t count) const; - - // Destroys the contents of buckets (invokes destroyBucketEntry for each - // populated bucket if needed). - void destroyBuckets(void* __restrict__ buckets, size_t count) const; - - // Copies the content of buckets (copies the cookie and invokes copyBucketEntry - // for each populated bucket if needed). - void copyBuckets(const void* __restrict__ fromBuckets, - void* __restrict__ toBuckets, size_t count) const; - - // Determines the appropriate size of a bucket array to store a certain minimum - // number of entries and returns its effective capacity. - static void determineCapacity(size_t minimumCapacity, float loadFactor, - size_t* __restrict__ outBucketCount, size_t* __restrict__ outCapacity); - - // Trim a hash code to 30 bits to match what we store in the bucket's cookie. - inline static hash_t trimHash(hash_t hash) { - return (hash & Bucket::HASH_MASK) ^ (hash >> 30); - } - - // Returns the index of the first bucket that is in the collision chain - // for the specified hash code, given the total number of buckets. - // (Primary hash) - inline static size_t chainStart(hash_t hash, size_t count) { - return hash % count; - } - - // Returns the increment to add to a bucket index to seek to the next bucket - // in the collision chain for the specified hash code, given the total number of buckets. - // (Secondary hash) - inline static size_t chainIncrement(hash_t hash, size_t count) { - return ((hash >> 7) | (hash << 25)) % (count - 1) + 1; - } - - // Returns the index of the next bucket that is in the collision chain - // that is defined by the specified increment, given the total number of buckets. - inline static size_t chainSeek(size_t index, size_t increment, size_t count) { - return (index + increment) % count; - } -}; - -/* - * A BasicHashtable stores entries that are indexed by hash code in place - * within an array. The basic operations are finding entries by key, - * adding new entries and removing existing entries. - * - * This class provides a very limited set of operations with simple semantics. - * It is intended to be used as a building block to construct more complex - * and interesting data structures such as HashMap. Think very hard before - * adding anything extra to BasicHashtable, it probably belongs at a - * higher level of abstraction. - * - * TKey: The key type. - * TEntry: The entry type which is what is actually stored in the array. - * - * TKey must support the following contract: - * bool operator==(const TKey& other) const; // return true if equal - * bool operator!=(const TKey& other) const; // return true if unequal - * - * TEntry must support the following contract: - * const TKey& getKey() const; // get the key from the entry - * - * This class supports storing entries with duplicate keys. Of course, it can't - * tell them apart during removal so only the first entry will be removed. - * We do this because it means that operations like add() can't fail. - */ -template -class BasicHashtable : private BasicHashtableImpl { -public: - /* Creates a hashtable with the specified minimum initial capacity. - * The underlying array will be created when the first entry is added. - * - * minimumInitialCapacity: The minimum initial capacity for the hashtable. - * Default is 0. - * loadFactor: The desired load factor for the hashtable, between 0 and 1. - * Default is 0.75. - */ - BasicHashtable(size_t minimumInitialCapacity = 0, float loadFactor = 0.75f); - - /* Copies a hashtable. - * The underlying storage is shared copy-on-write. - */ - BasicHashtable(const BasicHashtable& other); - - /* Clears and destroys the hashtable. - */ - virtual ~BasicHashtable(); - - /* Making this hashtable a copy of the other hashtable. - * The underlying storage is shared copy-on-write. - * - * other: The hashtable to copy. - */ - inline BasicHashtable& operator =(const BasicHashtable & other) { - setTo(other); - return *this; - } - - /* Returns the number of entries in the hashtable. - */ - inline size_t size() const { - return mSize; - } - - /* Returns the capacity of the hashtable, which is the number of elements that can - * added to the hashtable without requiring it to be grown. - */ - inline size_t capacity() const { - return mCapacity; - } - - /* Returns the number of buckets that the hashtable has, which is the size of its - * underlying array. - */ - inline size_t bucketCount() const { - return mBucketCount; - } - - /* Returns the load factor of the hashtable. */ - inline float loadFactor() const { - return mLoadFactor; - }; - - /* Returns a const reference to the entry at the specified index. - * - * index: The index of the entry to retrieve. Must be a valid index within - * the bounds of the hashtable. - */ - inline const TEntry& entryAt(size_t index) const { - return entryFor(bucketAt(mBuckets, index)); - } - - /* Returns a non-const reference to the entry at the specified index. - * - * index: The index of the entry to edit. Must be a valid index within - * the bounds of the hashtable. - */ - inline TEntry& editEntryAt(size_t index) { - edit(); - return entryFor(bucketAt(mBuckets, index)); - } - - /* Clears the hashtable. - * All entries in the hashtable are destroyed immediately. - * If you need to do something special with the entries in the hashtable then iterate - * over them and do what you need before clearing the hashtable. - */ - inline void clear() { - BasicHashtableImpl::clear(); - } - - /* Returns the index of the next entry in the hashtable given the index of a previous entry. - * If the given index is -1, then returns the index of the first entry in the hashtable, - * if there is one, or -1 otherwise. - * If the given index is not -1, then returns the index of the next entry in the hashtable, - * in strictly increasing order, or -1 if there are none left. - * - * index: The index of the previous entry that was iterated, or -1 to begin - * iteration at the beginning of the hashtable. - */ - inline ssize_t next(ssize_t index) const { - return BasicHashtableImpl::next(index); - } - - /* Finds the index of an entry with the specified key. - * If the given index is -1, then returns the index of the first matching entry, - * otherwise returns the index of the next matching entry. - * If the hashtable contains multiple entries with keys that match the requested - * key, then the sequence of entries returned is arbitrary. - * Returns -1 if no entry was found. - * - * index: The index of the previous entry with the specified key, or -1 to - * find the first matching entry. - * hash: The hashcode of the key. - * key: The key. - */ - inline ssize_t find(ssize_t index, hash_t hash, const TKey& key) const { - return BasicHashtableImpl::find(index, hash, &key); - } - - /* Adds the entry to the hashtable. - * Returns the index of the newly added entry. - * If an entry with the same key already exists, then a duplicate entry is added. - * If the entry will not fit, then the hashtable's capacity is increased and - * its contents are rehashed. See rehash(). - * - * hash: The hashcode of the key. - * entry: The entry to add. - */ - inline size_t add(hash_t hash, const TEntry& entry) { - return BasicHashtableImpl::add(hash, &entry); - } - - /* Removes the entry with the specified index from the hashtable. - * The entry is destroyed immediately. - * The index must be valid. - * - * The hashtable is not compacted after an item is removed, so it is legal - * to continue iterating over the hashtable using next() or find(). - * - * index: The index of the entry to remove. Must be a valid index within the - * bounds of the hashtable, and it must refer to an existing entry. - */ - inline void removeAt(size_t index) { - BasicHashtableImpl::removeAt(index); - } - - /* Rehashes the contents of the hashtable. - * Grows the hashtable to at least the specified minimum capacity or the - * current number of elements, whichever is larger. - * - * Rehashing causes all entries to be copied and the entry indices may change. - * Although the hash codes are cached by the hashtable, rehashing can be an - * expensive operation and should be avoided unless the hashtable's size - * needs to be changed. - * - * Rehashing is the only way to change the capacity or load factor of the - * hashtable once it has been created. It can be used to compact the - * hashtable by choosing a minimum capacity that is smaller than the current - * capacity (such as 0). - * - * minimumCapacity: The desired minimum capacity after rehashing. - * loadFactor: The desired load factor after rehashing. - */ - inline void rehash(size_t minimumCapacity, float loadFactor) { - BasicHashtableImpl::rehash(minimumCapacity, loadFactor); - } - - /* Determines whether there is room to add another entry without rehashing. - * When this returns true, a subsequent add() operation is guaranteed to - * complete without performing a rehash. - */ - inline bool hasMoreRoom() const { - return mCapacity > mFilledBuckets; - } - -protected: - static inline const TEntry& entryFor(const Bucket& bucket) { - return reinterpret_cast(bucket.entry); - } - - static inline TEntry& entryFor(Bucket& bucket) { - return reinterpret_cast(bucket.entry); - } - - virtual bool compareBucketKey(const Bucket& bucket, const void* __restrict__ key) const; - virtual void initializeBucketEntry(Bucket& bucket, const void* __restrict__ entry) const; - virtual void destroyBucketEntry(Bucket& bucket) const; - -private: - // For dumping the raw contents of a hashtable during testing. - friend class BasicHashtableTest; - inline uint32_t cookieAt(size_t index) const { - return bucketAt(mBuckets, index).cookie; - } -}; - -template -BasicHashtable::BasicHashtable(size_t minimumInitialCapacity, float loadFactor) : - BasicHashtableImpl(sizeof(TEntry), traits::has_trivial_dtor, - minimumInitialCapacity, loadFactor) { -} - -template -BasicHashtable::BasicHashtable(const BasicHashtable& other) : - BasicHashtableImpl(other) { -} - -template -BasicHashtable::~BasicHashtable() { - dispose(); -} - -template -bool BasicHashtable::compareBucketKey(const Bucket& bucket, - const void* __restrict__ key) const { - return entryFor(bucket).getKey() == *static_cast(key); -} - -template -void BasicHashtable::initializeBucketEntry(Bucket& bucket, - const void* __restrict__ entry) const { - if (!traits::has_trivial_copy) { - new (&entryFor(bucket)) TEntry(*(static_cast(entry))); - } else { - memcpy(&entryFor(bucket), entry, sizeof(TEntry)); - } -} - -template -void BasicHashtable::destroyBucketEntry(Bucket& bucket) const { - if (!traits::has_trivial_dtor) { - entryFor(bucket).~TEntry(); - } -} - -}; // namespace android - -#endif // ANDROID_BASIC_HASHTABLE_H diff --git a/external/android/include/19/system/core/include/utils/BitSet.h b/external/android/include/19/system/core/include/utils/BitSet.h deleted file mode 100644 index 19c03d1..0000000 --- a/external/android/include/19/system/core/include/utils/BitSet.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (C) 2010 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 UTILS_BITSET_H -#define UTILS_BITSET_H - -#include -#include - -/* - * Contains some bit manipulation helpers. - */ - -namespace android { - -// A simple set of 32 bits that can be individually marked or cleared. -struct BitSet32 { - uint32_t value; - - inline BitSet32() : value(0) { } - explicit inline BitSet32(uint32_t value) : value(value) { } - - // Gets the value associated with a particular bit index. - static inline uint32_t valueForBit(uint32_t n) { return 0x80000000 >> n; } - - // Clears the bit set. - inline void clear() { value = 0; } - - // Returns the number of marked bits in the set. - inline uint32_t count() const { return __builtin_popcount(value); } - - // Returns true if the bit set does not contain any marked bits. - inline bool isEmpty() const { return ! value; } - - // Returns true if the bit set does not contain any unmarked bits. - inline bool isFull() const { return value == 0xffffffff; } - - // Returns true if the specified bit is marked. - inline bool hasBit(uint32_t n) const { return value & valueForBit(n); } - - // Marks the specified bit. - inline void markBit(uint32_t n) { value |= valueForBit(n); } - - // Clears the specified bit. - inline void clearBit(uint32_t n) { value &= ~ valueForBit(n); } - - // Finds the first marked bit in the set. - // Result is undefined if all bits are unmarked. - inline uint32_t firstMarkedBit() const { return __builtin_clz(value); } - - // Finds the first unmarked bit in the set. - // Result is undefined if all bits are marked. - inline uint32_t firstUnmarkedBit() const { return __builtin_clz(~ value); } - - // Finds the last marked bit in the set. - // Result is undefined if all bits are unmarked. - inline uint32_t lastMarkedBit() const { return 31 - __builtin_ctz(value); } - - // Finds the first marked bit in the set and clears it. Returns the bit index. - // Result is undefined if all bits are unmarked. - inline uint32_t clearFirstMarkedBit() { - uint32_t n = firstMarkedBit(); - clearBit(n); - return n; - } - - // Finds the first unmarked bit in the set and marks it. Returns the bit index. - // Result is undefined if all bits are marked. - inline uint32_t markFirstUnmarkedBit() { - uint32_t n = firstUnmarkedBit(); - markBit(n); - return n; - } - - // Finds the last marked bit in the set and clears it. Returns the bit index. - // Result is undefined if all bits are unmarked. - inline uint32_t clearLastMarkedBit() { - uint32_t n = lastMarkedBit(); - clearBit(n); - return n; - } - - // Gets the index of the specified bit in the set, which is the number of - // marked bits that appear before the specified bit. - inline uint32_t getIndexOfBit(uint32_t n) const { - return __builtin_popcount(value & ~(0xffffffffUL >> n)); - } - - inline bool operator== (const BitSet32& other) const { return value == other.value; } - inline bool operator!= (const BitSet32& other) const { return value != other.value; } - inline BitSet32 operator& (const BitSet32& other) const { - return BitSet32(value & other.value); - } - inline BitSet32& operator&= (const BitSet32& other) { - value &= other.value; - return *this; - } - inline BitSet32 operator| (const BitSet32& other) const { - return BitSet32(value | other.value); - } - inline BitSet32& operator|= (const BitSet32& other) { - value |= other.value; - return *this; - } -}; - -ANDROID_BASIC_TYPES_TRAITS(BitSet32) - -} // namespace android - -#endif // UTILS_BITSET_H diff --git a/external/android/include/19/system/core/include/utils/BlobCache.h b/external/android/include/19/system/core/include/utils/BlobCache.h deleted file mode 100644 index 7d621e4..0000000 --- a/external/android/include/19/system/core/include/utils/BlobCache.h +++ /dev/null @@ -1,243 +0,0 @@ -/* - ** Copyright 2011, 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_BLOB_CACHE_H -#define ANDROID_BLOB_CACHE_H - -#include - -#include -#include -#include -#include - -namespace android { - -// A BlobCache is an in-memory cache for binary key/value pairs. A BlobCache -// does NOT provide any thread-safety guarantees. -// -// The cache contents can be serialized to an in-memory buffer or mmap'd file -// and then reloaded in a subsequent execution of the program. This -// serialization is non-portable and the data should only be used by the device -// that generated it. -class BlobCache : public RefBase { - -public: - - // Create an empty blob cache. The blob cache will cache key/value pairs - // with key and value sizes less than or equal to maxKeySize and - // maxValueSize, respectively. The total combined size of ALL cache entries - // (key sizes plus value sizes) will not exceed maxTotalSize. - BlobCache(size_t maxKeySize, size_t maxValueSize, size_t maxTotalSize); - - // set inserts a new binary value into the cache and associates it with the - // given binary key. If the key or value are too large for the cache then - // the cache remains unchanged. This includes the case where a different - // value was previously associated with the given key - the old value will - // remain in the cache. If the given key and value are small enough to be - // put in the cache (based on the maxKeySize, maxValueSize, and maxTotalSize - // values specified to the BlobCache constructor), then the key/value pair - // will be in the cache after set returns. Note, however, that a subsequent - // call to set may evict old key/value pairs from the cache. - // - // Preconditions: - // key != NULL - // 0 < keySize - // value != NULL - // 0 < valueSize - void set(const void* key, size_t keySize, const void* value, - size_t valueSize); - - // get retrieves from the cache the binary value associated with a given - // binary key. If the key is present in the cache then the length of the - // binary value associated with that key is returned. If the value argument - // is non-NULL and the size of the cached value is less than valueSize bytes - // then the cached value is copied into the buffer pointed to by the value - // argument. If the key is not present in the cache then 0 is returned and - // the buffer pointed to by the value argument is not modified. - // - // Note that when calling get multiple times with the same key, the later - // calls may fail, returning 0, even if earlier calls succeeded. The return - // value must be checked for each call. - // - // Preconditions: - // key != NULL - // 0 < keySize - // 0 <= valueSize - size_t get(const void* key, size_t keySize, void* value, size_t valueSize); - - - // getFlattenedSize returns the number of bytes needed to store the entire - // serialized cache. - size_t getFlattenedSize() const; - - // flatten serializes the current contents of the cache into the memory - // pointed to by 'buffer'. The serialized cache contents can later be - // loaded into a BlobCache object using the unflatten method. The contents - // of the BlobCache object will not be modified. - // - // Preconditions: - // size >= this.getFlattenedSize() - status_t flatten(void* buffer, size_t size) const; - - // unflatten replaces the contents of the cache with the serialized cache - // contents in the memory pointed to by 'buffer'. The previous contents of - // the BlobCache will be evicted from the cache. If an error occurs while - // unflattening the serialized cache contents then the BlobCache will be - // left in an empty state. - // - status_t unflatten(void const* buffer, size_t size); - -private: - // Copying is disallowed. - BlobCache(const BlobCache&); - void operator=(const BlobCache&); - - // A random function helper to get around MinGW not having nrand48() - long int blob_random(); - - // clean evicts a randomly chosen set of entries from the cache such that - // the total size of all remaining entries is less than mMaxTotalSize/2. - void clean(); - - // isCleanable returns true if the cache is full enough for the clean method - // to have some effect, and false otherwise. - bool isCleanable() const; - - // A Blob is an immutable sized unstructured data blob. - class Blob : public RefBase { - public: - Blob(const void* data, size_t size, bool copyData); - ~Blob(); - - bool operator<(const Blob& rhs) const; - - const void* getData() const; - size_t getSize() const; - - private: - // Copying is not allowed. - Blob(const Blob&); - void operator=(const Blob&); - - // mData points to the buffer containing the blob data. - const void* mData; - - // mSize is the size of the blob data in bytes. - size_t mSize; - - // mOwnsData indicates whether or not this Blob object should free the - // memory pointed to by mData when the Blob gets destructed. - bool mOwnsData; - }; - - // A CacheEntry is a single key/value pair in the cache. - class CacheEntry { - public: - CacheEntry(); - CacheEntry(const sp& key, const sp& value); - CacheEntry(const CacheEntry& ce); - - bool operator<(const CacheEntry& rhs) const; - const CacheEntry& operator=(const CacheEntry&); - - sp getKey() const; - sp getValue() const; - - void setValue(const sp& value); - - private: - - // mKey is the key that identifies the cache entry. - sp mKey; - - // mValue is the cached data associated with the key. - sp mValue; - }; - - // A Header is the header for the entire BlobCache serialization format. No - // need to make this portable, so we simply write the struct out. - struct Header { - // mMagicNumber is the magic number that identifies the data as - // serialized BlobCache contents. It must always contain 'Blb$'. - uint32_t mMagicNumber; - - // mBlobCacheVersion is the serialization format version. - uint32_t mBlobCacheVersion; - - // mDeviceVersion is the device-specific version of the cache. This can - // be used to invalidate the cache. - uint32_t mDeviceVersion; - - // mNumEntries is number of cache entries following the header in the - // data. - size_t mNumEntries; - }; - - // An EntryHeader is the header for a serialized cache entry. No need to - // make this portable, so we simply write the struct out. Each EntryHeader - // is followed imediately by the key data and then the value data. - // - // The beginning of each serialized EntryHeader is 4-byte aligned, so the - // number of bytes that a serialized cache entry will occupy is: - // - // ((sizeof(EntryHeader) + keySize + valueSize) + 3) & ~3 - // - struct EntryHeader { - // mKeySize is the size of the entry key in bytes. - size_t mKeySize; - - // mValueSize is the size of the entry value in bytes. - size_t mValueSize; - - // mData contains both the key and value data for the cache entry. The - // key comes first followed immediately by the value. - uint8_t mData[]; - }; - - // mMaxKeySize is the maximum key size that will be cached. Calls to - // BlobCache::set with a keySize parameter larger than mMaxKeySize will - // simply not add the key/value pair to the cache. - const size_t mMaxKeySize; - - // mMaxValueSize is the maximum value size that will be cached. Calls to - // BlobCache::set with a valueSize parameter larger than mMaxValueSize will - // simply not add the key/value pair to the cache. - const size_t mMaxValueSize; - - // mMaxTotalSize is the maximum size that all cache entries can occupy. This - // includes space for both keys and values. When a call to BlobCache::set - // would otherwise cause this limit to be exceeded, either the key/value - // pair passed to BlobCache::set will not be cached or other cache entries - // will be evicted from the cache to make room for the new entry. - const size_t mMaxTotalSize; - - // mTotalSize is the total combined size of all keys and values currently in - // the cache. - size_t mTotalSize; - - // mRandState is the pseudo-random number generator state. It is passed to - // nrand48 to generate random numbers when needed. - unsigned short mRandState[3]; - - // mCacheEntries stores all the cache entries that are resident in memory. - // Cache entries are added to it by the 'set' method. - SortedVector mCacheEntries; -}; - -} - -#endif // ANDROID_BLOB_CACHE_H diff --git a/external/android/include/19/system/core/include/utils/ByteOrder.h b/external/android/include/19/system/core/include/utils/ByteOrder.h deleted file mode 100644 index baa3a83..0000000 --- a/external/android/include/19/system/core/include/utils/ByteOrder.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2006 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 _LIBS_UTILS_BYTE_ORDER_H -#define _LIBS_UTILS_BYTE_ORDER_H - -#include -#include -#ifdef HAVE_WINSOCK -#include -#else -#include -#endif - -/* - * These macros are like the hton/ntoh byte swapping macros, - * except they allow you to swap to and from the "device" byte - * order. The device byte order is the endianness of the target - * device -- for the ARM CPUs we use today, this is little endian. - * - * Note that the byte swapping functions have not been optimized - * much; performance is currently not an issue for them since the - * intent is to allow us to avoid byte swapping on the device. - */ - -static inline uint32_t android_swap_long(uint32_t v) -{ - return (v<<24) | ((v<<8)&0x00FF0000) | ((v>>8)&0x0000FF00) | (v>>24); -} - -static inline uint16_t android_swap_short(uint16_t v) -{ - return (v<<8) | (v>>8); -} - -#define DEVICE_BYTE_ORDER LITTLE_ENDIAN - -#if BYTE_ORDER == DEVICE_BYTE_ORDER - -#define dtohl(x) (x) -#define dtohs(x) (x) -#define htodl(x) (x) -#define htods(x) (x) - -#else - -#define dtohl(x) (android_swap_long(x)) -#define dtohs(x) (android_swap_short(x)) -#define htodl(x) (android_swap_long(x)) -#define htods(x) (android_swap_short(x)) - -#endif - -#if BYTE_ORDER == LITTLE_ENDIAN -#define fromlel(x) (x) -#define fromles(x) (x) -#define tolel(x) (x) -#define toles(x) (x) -#else -#define fromlel(x) (android_swap_long(x)) -#define fromles(x) (android_swap_short(x)) -#define tolel(x) (android_swap_long(x)) -#define toles(x) (android_swap_short(x)) -#endif - -#endif // _LIBS_UTILS_BYTE_ORDER_H diff --git a/external/android/include/19/system/core/include/utils/CallStack.h b/external/android/include/19/system/core/include/utils/CallStack.h deleted file mode 100644 index 61dc832..0000000 --- a/external/android/include/19/system/core/include/utils/CallStack.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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_CALLSTACK_H -#define ANDROID_CALLSTACK_H - -#include -#include - -#include -#include - -// --------------------------------------------------------------------------- - -namespace android { - -class CallStack -{ -public: - enum { - MAX_DEPTH = 31 - }; - - CallStack(); - CallStack(const char* logtag, int32_t ignoreDepth=1, - int32_t maxDepth=MAX_DEPTH); - CallStack(const CallStack& rhs); - ~CallStack(); - - CallStack& operator = (const CallStack& rhs); - - bool operator == (const CallStack& rhs) const; - bool operator != (const CallStack& rhs) const; - bool operator < (const CallStack& rhs) const; - bool operator >= (const CallStack& rhs) const; - bool operator > (const CallStack& rhs) const; - bool operator <= (const CallStack& rhs) const; - - const void* operator [] (int index) const; - - void clear(); - - void update(int32_t ignoreDepth=1, int32_t maxDepth=MAX_DEPTH); - - // Dump a stack trace to the log using the supplied logtag - void dump(const char* logtag, const char* prefix = 0) const; - - // Return a string (possibly very long) containing the complete stack trace - String8 toString(const char* prefix = 0) const; - - size_t size() const { return mCount; } - -private: - size_t mCount; - backtrace_frame_t mStack[MAX_DEPTH]; -}; - -}; // namespace android - - -// --------------------------------------------------------------------------- - -#endif // ANDROID_CALLSTACK_H diff --git a/external/android/include/19/system/core/include/utils/Compat.h b/external/android/include/19/system/core/include/utils/Compat.h deleted file mode 100644 index fb7748e..0000000 --- a/external/android/include/19/system/core/include/utils/Compat.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2010 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 __LIB_UTILS_COMPAT_H -#define __LIB_UTILS_COMPAT_H - -#include - -/* Compatibility definitions for non-Linux (i.e., BSD-based) hosts. */ -#ifndef HAVE_OFF64_T -#if _FILE_OFFSET_BITS < 64 -#error "_FILE_OFFSET_BITS < 64; large files are not supported on this platform" -#endif /* _FILE_OFFSET_BITS < 64 */ - -typedef off_t off64_t; - -static inline off64_t lseek64(int fd, off64_t offset, int whence) { - return lseek(fd, offset, whence); -} - -#ifdef HAVE_PREAD -static inline ssize_t pread64(int fd, void* buf, size_t nbytes, off64_t offset) { - return pread(fd, buf, nbytes, offset); -} -#endif - -#endif /* !HAVE_OFF64_T */ - -#if HAVE_PRINTF_ZD -# define ZD "%zd" -# define ZD_TYPE ssize_t -#else -# define ZD "%ld" -# define ZD_TYPE long -#endif - -/* - * TEMP_FAILURE_RETRY is defined by some, but not all, versions of - * . (Alas, it is not as standard as we'd hoped!) So, if it's - * not already defined, then define it here. - */ -#ifndef TEMP_FAILURE_RETRY -/* Used to retry syscalls that can return EINTR. */ -#define TEMP_FAILURE_RETRY(exp) ({ \ - typeof (exp) _rc; \ - do { \ - _rc = (exp); \ - } while (_rc == -1 && errno == EINTR); \ - _rc; }) -#endif - -#endif /* __LIB_UTILS_COMPAT_H */ diff --git a/external/android/include/19/system/core/include/utils/Condition.h b/external/android/include/19/system/core/include/utils/Condition.h deleted file mode 100644 index e63ba7e..0000000 --- a/external/android/include/19/system/core/include/utils/Condition.h +++ /dev/null @@ -1,147 +0,0 @@ -/* - * 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 _LIBS_UTILS_CONDITION_H -#define _LIBS_UTILS_CONDITION_H - -#include -#include -#include - -#if defined(HAVE_PTHREADS) -# include -#endif - -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { -// --------------------------------------------------------------------------- - -/* - * Condition variable class. The implementation is system-dependent. - * - * Condition variables are paired up with mutexes. Lock the mutex, - * call wait(), then either re-wait() if things aren't quite what you want, - * or unlock the mutex and continue. All threads calling wait() must - * use the same mutex for a given Condition. - */ -class Condition { -public: - enum { - PRIVATE = 0, - SHARED = 1 - }; - - enum WakeUpType { - WAKE_UP_ONE = 0, - WAKE_UP_ALL = 1 - }; - - Condition(); - Condition(int type); - ~Condition(); - // Wait on the condition variable. Lock the mutex before calling. - status_t wait(Mutex& mutex); - // same with relative timeout - status_t waitRelative(Mutex& mutex, nsecs_t reltime); - // Signal the condition variable, allowing one thread to continue. - void signal(); - // Signal the condition variable, allowing one or all threads to continue. - void signal(WakeUpType type) { - if (type == WAKE_UP_ONE) { - signal(); - } else { - broadcast(); - } - } - // Signal the condition variable, allowing all threads to continue. - void broadcast(); - -private: -#if defined(HAVE_PTHREADS) - pthread_cond_t mCond; -#else - void* mState; -#endif -}; - -// --------------------------------------------------------------------------- - -#if defined(HAVE_PTHREADS) - -inline Condition::Condition() { - pthread_cond_init(&mCond, NULL); -} -inline Condition::Condition(int type) { - if (type == SHARED) { - pthread_condattr_t attr; - pthread_condattr_init(&attr); - pthread_condattr_setpshared(&attr, PTHREAD_PROCESS_SHARED); - pthread_cond_init(&mCond, &attr); - pthread_condattr_destroy(&attr); - } else { - pthread_cond_init(&mCond, NULL); - } -} -inline Condition::~Condition() { - pthread_cond_destroy(&mCond); -} -inline status_t Condition::wait(Mutex& mutex) { - return -pthread_cond_wait(&mCond, &mutex.mMutex); -} -inline status_t Condition::waitRelative(Mutex& mutex, nsecs_t reltime) { -#if defined(HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE) - struct timespec ts; - ts.tv_sec = reltime/1000000000; - ts.tv_nsec = reltime%1000000000; - return -pthread_cond_timedwait_relative_np(&mCond, &mutex.mMutex, &ts); -#else // HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE - struct timespec ts; -#if defined(HAVE_POSIX_CLOCKS) - clock_gettime(CLOCK_REALTIME, &ts); -#else // HAVE_POSIX_CLOCKS - // we don't support the clocks here. - struct timeval t; - gettimeofday(&t, NULL); - ts.tv_sec = t.tv_sec; - ts.tv_nsec= t.tv_usec*1000; -#endif // HAVE_POSIX_CLOCKS - ts.tv_sec += reltime/1000000000; - ts.tv_nsec+= reltime%1000000000; - if (ts.tv_nsec >= 1000000000) { - ts.tv_nsec -= 1000000000; - ts.tv_sec += 1; - } - return -pthread_cond_timedwait(&mCond, &mutex.mMutex, &ts); -#endif // HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE -} -inline void Condition::signal() { - pthread_cond_signal(&mCond); -} -inline void Condition::broadcast() { - pthread_cond_broadcast(&mCond); -} - -#endif // HAVE_PTHREADS - -// --------------------------------------------------------------------------- -}; // namespace android -// --------------------------------------------------------------------------- - -#endif // _LIBS_UTILS_CONDITON_H diff --git a/external/android/include/19/system/core/include/utils/Debug.h b/external/android/include/19/system/core/include/utils/Debug.h deleted file mode 100644 index 08893bd..0000000 --- a/external/android/include/19/system/core/include/utils/Debug.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2005 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_UTILS_DEBUG_H -#define ANDROID_UTILS_DEBUG_H - -#include -#include - -namespace android { -// --------------------------------------------------------------------------- - -#ifdef __cplusplus -template struct CompileTimeAssert; -template<> struct CompileTimeAssert {}; -#define COMPILE_TIME_ASSERT(_exp) \ - template class CompileTimeAssert< (_exp) >; -#endif -#define COMPILE_TIME_ASSERT_FUNCTION_SCOPE(_exp) \ - CompileTimeAssert<( _exp )>(); - -// --------------------------------------------------------------------------- - -#ifdef __cplusplus -template struct CompileTimeIfElse; -template -struct CompileTimeIfElse { typedef LHS TYPE; }; -template -struct CompileTimeIfElse { typedef RHS TYPE; }; -#endif - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_UTILS_DEBUG_H diff --git a/external/android/include/19/system/core/include/utils/Endian.h b/external/android/include/19/system/core/include/utils/Endian.h deleted file mode 100644 index 19f2504..0000000 --- a/external/android/include/19/system/core/include/utils/Endian.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// Android endian-ness defines. -// -#ifndef _LIBS_UTILS_ENDIAN_H -#define _LIBS_UTILS_ENDIAN_H - -#if defined(HAVE_ENDIAN_H) - -#include - -#else /*not HAVE_ENDIAN_H*/ - -#define __BIG_ENDIAN 0x1000 -#define __LITTLE_ENDIAN 0x0001 - -#if defined(HAVE_LITTLE_ENDIAN) -# define __BYTE_ORDER __LITTLE_ENDIAN -#else -# define __BYTE_ORDER __BIG_ENDIAN -#endif - -#endif /*not HAVE_ENDIAN_H*/ - -#endif /*_LIBS_UTILS_ENDIAN_H*/ diff --git a/external/android/include/19/system/core/include/utils/Errors.h b/external/android/include/19/system/core/include/utils/Errors.h deleted file mode 100644 index 0b75b19..0000000 --- a/external/android/include/19/system/core/include/utils/Errors.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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_ERRORS_H -#define ANDROID_ERRORS_H - -#include -#include - -namespace android { - -// use this type to return error codes -#ifdef HAVE_MS_C_RUNTIME -typedef int status_t; -#else -typedef int32_t status_t; -#endif - -/* the MS C runtime lacks a few error codes */ - -/* - * Error codes. - * All error codes are negative values. - */ - -// Win32 #defines NO_ERROR as well. It has the same value, so there's no -// real conflict, though it's a bit awkward. -#ifdef _WIN32 -# undef NO_ERROR -#endif - -enum { - OK = 0, // Everything's swell. - NO_ERROR = 0, // No errors. - - UNKNOWN_ERROR = 0x80000000, - - NO_MEMORY = -ENOMEM, - INVALID_OPERATION = -ENOSYS, - BAD_VALUE = -EINVAL, - BAD_TYPE = 0x80000001, - NAME_NOT_FOUND = -ENOENT, - PERMISSION_DENIED = -EPERM, - NO_INIT = -ENODEV, - ALREADY_EXISTS = -EEXIST, - DEAD_OBJECT = -EPIPE, - FAILED_TRANSACTION = 0x80000002, - JPARKS_BROKE_IT = -EPIPE, -#if !defined(HAVE_MS_C_RUNTIME) - BAD_INDEX = -EOVERFLOW, - NOT_ENOUGH_DATA = -ENODATA, - WOULD_BLOCK = -EWOULDBLOCK, - TIMED_OUT = -ETIMEDOUT, - UNKNOWN_TRANSACTION = -EBADMSG, -#else - BAD_INDEX = -E2BIG, - NOT_ENOUGH_DATA = 0x80000003, - WOULD_BLOCK = 0x80000004, - TIMED_OUT = 0x80000005, - UNKNOWN_TRANSACTION = 0x80000006, -#endif - FDS_NOT_ALLOWED = 0x80000007, -}; - -// Restore define; enumeration is in "android" namespace, so the value defined -// there won't work for Win32 code in a different namespace. -#ifdef _WIN32 -# define NO_ERROR 0L -#endif - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_ERRORS_H diff --git a/external/android/include/19/system/core/include/utils/FileMap.h b/external/android/include/19/system/core/include/utils/FileMap.h deleted file mode 100644 index dfe6d51..0000000 --- a/external/android/include/19/system/core/include/utils/FileMap.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (C) 2006 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. - */ - -// -// Encapsulate a shared file mapping. -// -#ifndef __LIBS_FILE_MAP_H -#define __LIBS_FILE_MAP_H - -#include - -#include - -#ifdef HAVE_WIN32_FILEMAP -#include -#endif - -namespace android { - -/* - * This represents a memory-mapped file. It might be the entire file or - * only part of it. This requires a little bookkeeping because the mapping - * needs to be aligned on page boundaries, and in some cases we'd like to - * have multiple references to the mapped area without creating additional - * maps. - * - * This always uses MAP_SHARED. - * - * TODO: we should be able to create a new FileMap that is a subset of - * an existing FileMap and shares the underlying mapped pages. Requires - * completing the refcounting stuff and possibly introducing the notion - * of a FileMap hierarchy. - */ -class FileMap { -public: - FileMap(void); - - /* - * Create a new mapping on an open file. - * - * Closing the file descriptor does not unmap the pages, so we don't - * claim ownership of the fd. - * - * Returns "false" on failure. - */ - bool create(const char* origFileName, int fd, - off64_t offset, size_t length, bool readOnly); - - /* - * Return the name of the file this map came from, if known. - */ - const char* getFileName(void) const { return mFileName; } - - /* - * Get a pointer to the piece of the file we requested. - */ - void* getDataPtr(void) const { return mDataPtr; } - - /* - * Get the length we requested. - */ - size_t getDataLength(void) const { return mDataLength; } - - /* - * Get the data offset used to create this map. - */ - off64_t getDataOffset(void) const { return mDataOffset; } - - /* - * Get a "copy" of the object. - */ - FileMap* acquire(void) { mRefCount++; return this; } - - /* - * Call this when mapping is no longer needed. - */ - void release(void) { - if (--mRefCount <= 0) - delete this; - } - - /* - * This maps directly to madvise() values, but allows us to avoid - * including everywhere. - */ - enum MapAdvice { - NORMAL, RANDOM, SEQUENTIAL, WILLNEED, DONTNEED - }; - - /* - * Apply an madvise() call to the entire file. - * - * Returns 0 on success, -1 on failure. - */ - int advise(MapAdvice advice); - -protected: - // don't delete objects; call release() - ~FileMap(void); - -private: - // these are not implemented - FileMap(const FileMap& src); - const FileMap& operator=(const FileMap& src); - - int mRefCount; // reference count - char* mFileName; // original file name, if known - void* mBasePtr; // base of mmap area; page aligned - size_t mBaseLength; // length, measured from "mBasePtr" - off64_t mDataOffset; // offset used when map was created - void* mDataPtr; // start of requested data, offset from base - size_t mDataLength; // length, measured from "mDataPtr" -#ifdef HAVE_WIN32_FILEMAP - HANDLE mFileHandle; // Win32 file handle - HANDLE mFileMapping; // Win32 file mapping handle -#endif - - static long mPageSize; -}; - -}; // namespace android - -#endif // __LIBS_FILE_MAP_H diff --git a/external/android/include/19/system/core/include/utils/Flattenable.h b/external/android/include/19/system/core/include/utils/Flattenable.h deleted file mode 100644 index 882a8b2..0000000 --- a/external/android/include/19/system/core/include/utils/Flattenable.h +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Copyright (C) 2010 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_UTILS_FLATTENABLE_H -#define ANDROID_UTILS_FLATTENABLE_H - - -#include -#include -#include -#include - -namespace android { - - -class FlattenableUtils { -public: - template - static size_t align(size_t size) { - COMPILE_TIME_ASSERT_FUNCTION_SCOPE( !(N & (N-1)) ); - return (size + (N-1)) & ~(N-1); - } - - template - static size_t align(void const*& buffer) { - COMPILE_TIME_ASSERT_FUNCTION_SCOPE( !(N & (N-1)) ); - intptr_t b = intptr_t(buffer); - buffer = (void*)((intptr_t(buffer) + (N-1)) & ~(N-1)); - return size_t(intptr_t(buffer) - b); - } - - template - static size_t align(void*& buffer) { - return align( const_cast(buffer) ); - } - - static void advance(void*& buffer, size_t& size, size_t offset) { - buffer = reinterpret_cast( intptr_t(buffer) + offset ); - size -= offset; - } - - static void advance(void const*& buffer, size_t& size, size_t offset) { - buffer = reinterpret_cast( intptr_t(buffer) + offset ); - size -= offset; - } - - // write a POD structure - template - static void write(void*& buffer, size_t& size, const T& value) { - *static_cast(buffer) = value; - advance(buffer, size, sizeof(T)); - } - - // read a POD structure - template - static void read(void const*& buffer, size_t& size, T& value) { - value = *static_cast(buffer); - advance(buffer, size, sizeof(T)); - } -}; - - -/* - * The Flattenable protocol allows an object to serialize itself out - * to a byte-buffer and an array of file descriptors. - * Flattenable objects must implement this protocol. - */ - -template -class Flattenable { -public: - // size in bytes of the flattened object - inline size_t getFlattenedSize() const; - - // number of file descriptors to flatten - inline size_t getFdCount() const; - - // flattens the object into buffer. - // size should be at least of getFlattenedSize() - // file descriptors are written in the fds[] array but ownership is - // not transfered (ie: they must be dupped by the caller of - // flatten() if needed). - inline status_t flatten(void*& buffer, size_t& size, int*& fds, size_t& count) const; - - // unflattens the object from buffer. - // size should be equal to the value of getFlattenedSize() when the - // object was flattened. - // unflattened file descriptors are found in the fds[] array and - // don't need to be dupped(). ie: the caller of unflatten doesn't - // keep ownership. If a fd is not retained by unflatten() it must be - // explicitly closed. - inline status_t unflatten(void const*& buffer, size_t& size, int const*& fds, size_t& count); -}; - -template -inline size_t Flattenable::getFlattenedSize() const { - return static_cast(this)->T::getFlattenedSize(); -} -template -inline size_t Flattenable::getFdCount() const { - return static_cast(this)->T::getFdCount(); -} -template -inline status_t Flattenable::flatten( - void*& buffer, size_t& size, int*& fds, size_t& count) const { - return static_cast(this)->T::flatten(buffer, size, fds, count); -} -template -inline status_t Flattenable::unflatten( - void const*& buffer, size_t& size, int const*& fds, size_t& count) { - return static_cast(this)->T::unflatten(buffer, size, fds, count); -} - -/* - * LightFlattenable is a protocol allowing object to serialize themselves out - * to a byte-buffer. Because it doesn't handle file-descriptors, - * LightFlattenable is usually more size efficient than Flattenable. - * LightFlattenable objects must implement this protocol. - */ -template -class LightFlattenable { -public: - // returns whether this object always flatten into the same size. - // for efficiency, this should always be inline. - inline bool isFixedSize() const; - - // returns size in bytes of the flattened object. must be a constant. - inline size_t getFlattenedSize() const; - - // flattens the object into buffer. - inline status_t flatten(void* buffer, size_t size) const; - - // unflattens the object from buffer of given size. - inline status_t unflatten(void const* buffer, size_t size); -}; - -template -inline bool LightFlattenable::isFixedSize() const { - return static_cast(this)->T::isFixedSize(); -} -template -inline size_t LightFlattenable::getFlattenedSize() const { - return static_cast(this)->T::getFlattenedSize(); -} -template -inline status_t LightFlattenable::flatten(void* buffer, size_t size) const { - return static_cast(this)->T::flatten(buffer, size); -} -template -inline status_t LightFlattenable::unflatten(void const* buffer, size_t size) { - return static_cast(this)->T::unflatten(buffer, size); -} - -/* - * LightFlattenablePod is an implementation of the LightFlattenable protocol - * for POD (plain-old-data) objects. - * Simply derive from LightFlattenablePod to make Foo flattenable; no - * need to implement any methods; obviously Foo must be a POD structure. - */ -template -class LightFlattenablePod : public LightFlattenable { -public: - inline bool isFixedSize() const { - return true; - } - - inline size_t getFlattenedSize() const { - return sizeof(T); - } - inline status_t flatten(void* buffer, size_t size) const { - if (size < sizeof(T)) return NO_MEMORY; - *reinterpret_cast(buffer) = *static_cast(this); - return NO_ERROR; - } - inline status_t unflatten(void const* buffer, size_t) { - *static_cast(this) = *reinterpret_cast(buffer); - return NO_ERROR; - } -}; - - -}; // namespace android - - -#endif /* ANDROID_UTILS_FLATTENABLE_H */ diff --git a/external/android/include/19/system/core/include/utils/Functor.h b/external/android/include/19/system/core/include/utils/Functor.h deleted file mode 100644 index e24ded4..0000000 --- a/external/android/include/19/system/core/include/utils/Functor.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2011 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_FUNCTOR_H -#define ANDROID_FUNCTOR_H - -#include - -namespace android { - -class Functor { -public: - Functor() {} - virtual ~Functor() {} - virtual status_t operator ()(int what, void* data) { return NO_ERROR; } -}; - -}; // namespace android - -#endif // ANDROID_FUNCTOR_H diff --git a/external/android/include/19/system/core/include/utils/JenkinsHash.h b/external/android/include/19/system/core/include/utils/JenkinsHash.h deleted file mode 100644 index 7da5dbd..0000000 --- a/external/android/include/19/system/core/include/utils/JenkinsHash.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2012 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. - */ - -/* Implementation of Jenkins one-at-a-time hash function. These choices are - * optimized for code size and portability, rather than raw speed. But speed - * should still be quite good. - **/ - -#ifndef ANDROID_JENKINS_HASH_H -#define ANDROID_JENKINS_HASH_H - -#include - -namespace android { - -/* The Jenkins hash of a sequence of 32 bit words A, B, C is: - * Whiten(Mix(Mix(Mix(0, A), B), C)) */ - -inline uint32_t JenkinsHashMix(uint32_t hash, uint32_t data) { - hash += data; - hash += (hash << 10); - hash ^= (hash >> 6); - return hash; -} - -hash_t JenkinsHashWhiten(uint32_t hash); - -/* Helpful utility functions for hashing data in 32 bit chunks */ -uint32_t JenkinsHashMixBytes(uint32_t hash, const uint8_t* bytes, size_t size); - -uint32_t JenkinsHashMixShorts(uint32_t hash, const uint16_t* shorts, size_t size); - -} - -#endif // ANDROID_JENKINS_HASH_H diff --git a/external/android/include/19/system/core/include/utils/KeyedVector.h b/external/android/include/19/system/core/include/utils/KeyedVector.h deleted file mode 100644 index c4faae0..0000000 --- a/external/android/include/19/system/core/include/utils/KeyedVector.h +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright (C) 2005 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_KEYED_VECTOR_H -#define ANDROID_KEYED_VECTOR_H - -#include -#include -#include - -#include - -#include -#include -#include - -// --------------------------------------------------------------------------- - -namespace android { - -template -class KeyedVector -{ -public: - typedef KEY key_type; - typedef VALUE value_type; - - inline KeyedVector(); - - /* - * empty the vector - */ - - inline void clear() { mVector.clear(); } - - /*! - * vector stats - */ - - //! returns number of items in the vector - inline size_t size() const { return mVector.size(); } - //! returns whether or not the vector is empty - inline bool isEmpty() const { return mVector.isEmpty(); } - //! returns how many items can be stored without reallocating the backing store - inline size_t capacity() const { return mVector.capacity(); } - //! sets the capacity. capacity can never be reduced less than size() - inline ssize_t setCapacity(size_t size) { return mVector.setCapacity(size); } - - // returns true if the arguments is known to be identical to this vector - inline bool isIdenticalTo(const KeyedVector& rhs) const; - - /*! - * accessors - */ - const VALUE& valueFor(const KEY& key) const; - const VALUE& valueAt(size_t index) const; - const KEY& keyAt(size_t index) const; - ssize_t indexOfKey(const KEY& key) const; - const VALUE& operator[] (size_t index) const; - - /*! - * modifying the array - */ - - VALUE& editValueFor(const KEY& key); - VALUE& editValueAt(size_t index); - - /*! - * add/insert/replace items - */ - - ssize_t add(const KEY& key, const VALUE& item); - ssize_t replaceValueFor(const KEY& key, const VALUE& item); - ssize_t replaceValueAt(size_t index, const VALUE& item); - - /*! - * remove items - */ - - ssize_t removeItem(const KEY& key); - ssize_t removeItemsAt(size_t index, size_t count = 1); - -private: - SortedVector< key_value_pair_t > mVector; -}; - -// KeyedVector can be trivially moved using memcpy() because its -// underlying SortedVector can be trivially moved. -template struct trait_trivial_move > { - enum { value = trait_trivial_move > >::value }; -}; - - -// --------------------------------------------------------------------------- - -/** - * Variation of KeyedVector that holds a default value to return when - * valueFor() is called with a key that doesn't exist. - */ -template -class DefaultKeyedVector : public KeyedVector -{ -public: - inline DefaultKeyedVector(const VALUE& defValue = VALUE()); - const VALUE& valueFor(const KEY& key) const; - -private: - VALUE mDefault; -}; - -// --------------------------------------------------------------------------- - -template inline -KeyedVector::KeyedVector() -{ -} - -template inline -bool KeyedVector::isIdenticalTo(const KeyedVector& rhs) const { - return mVector.array() == rhs.mVector.array(); -} - -template inline -ssize_t KeyedVector::indexOfKey(const KEY& key) const { - return mVector.indexOf( key_value_pair_t(key) ); -} - -template inline -const VALUE& KeyedVector::valueFor(const KEY& key) const { - ssize_t i = this->indexOfKey(key); - LOG_ALWAYS_FATAL_IF(i<0, "%s: key not found", __PRETTY_FUNCTION__); - return mVector.itemAt(i).value; -} - -template inline -const VALUE& KeyedVector::valueAt(size_t index) const { - return mVector.itemAt(index).value; -} - -template inline -const VALUE& KeyedVector::operator[] (size_t index) const { - return valueAt(index); -} - -template inline -const KEY& KeyedVector::keyAt(size_t index) const { - return mVector.itemAt(index).key; -} - -template inline -VALUE& KeyedVector::editValueFor(const KEY& key) { - ssize_t i = this->indexOfKey(key); - LOG_ALWAYS_FATAL_IF(i<0, "%s: key not found", __PRETTY_FUNCTION__); - return mVector.editItemAt(i).value; -} - -template inline -VALUE& KeyedVector::editValueAt(size_t index) { - return mVector.editItemAt(index).value; -} - -template inline -ssize_t KeyedVector::add(const KEY& key, const VALUE& value) { - return mVector.add( key_value_pair_t(key, value) ); -} - -template inline -ssize_t KeyedVector::replaceValueFor(const KEY& key, const VALUE& value) { - key_value_pair_t pair(key, value); - mVector.remove(pair); - return mVector.add(pair); -} - -template inline -ssize_t KeyedVector::replaceValueAt(size_t index, const VALUE& item) { - if (index inline -ssize_t KeyedVector::removeItem(const KEY& key) { - return mVector.remove(key_value_pair_t(key)); -} - -template inline -ssize_t KeyedVector::removeItemsAt(size_t index, size_t count) { - return mVector.removeItemsAt(index, count); -} - -// --------------------------------------------------------------------------- - -template inline -DefaultKeyedVector::DefaultKeyedVector(const VALUE& defValue) - : mDefault(defValue) -{ -} - -template inline -const VALUE& DefaultKeyedVector::valueFor(const KEY& key) const { - ssize_t i = this->indexOfKey(key); - return i >= 0 ? KeyedVector::valueAt(i) : mDefault; -} - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_KEYED_VECTOR_H diff --git a/external/android/include/19/system/core/include/utils/LinearAllocator.h b/external/android/include/19/system/core/include/utils/LinearAllocator.h deleted file mode 100644 index 4772bc8..0000000 --- a/external/android/include/19/system/core/include/utils/LinearAllocator.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright 2012, The Android Open Source Project - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef ANDROID_LINEARALLOCATOR_H -#define ANDROID_LINEARALLOCATOR_H - -#include - -namespace android { - -/** - * A memory manager that internally allocates multi-kbyte buffers for placing objects in. It avoids - * the overhead of malloc when many objects are allocated. It is most useful when creating many - * small objects with a similar lifetime, and doesn't add significant overhead for large - * allocations. - */ -class LinearAllocator { -public: - LinearAllocator(); - ~LinearAllocator(); - - /** - * Reserves and returns a region of memory of at least size 'size', aligning as needed. - * Typically this is used in an object's overridden new() method or as a replacement for malloc. - * - * The lifetime of the returned buffers is tied to that of the LinearAllocator. If calling - * delete() on an object stored in a buffer is needed, it should be overridden to use - * rewindIfLastAlloc() - */ - void* alloc(size_t size); - - /** - * Attempt to deallocate the given buffer, with the LinearAllocator attempting to rewind its - * state if possible. No destructors are called. - */ - void rewindIfLastAlloc(void* ptr, size_t allocSize); - - /** - * Dump memory usage statistics to the log (allocated and wasted space) - */ - void dumpMemoryStats(const char* prefix = ""); - - /** - * The number of bytes used for buffers allocated in the LinearAllocator (does not count space - * wasted) - */ - size_t usedSize() const { return mTotalAllocated - mWastedSpace; } - -private: - LinearAllocator(const LinearAllocator& other); - - class Page; - - Page* newPage(size_t pageSize); - bool fitsInCurrentPage(size_t size); - void ensureNext(size_t size); - void* start(Page *p); - void* end(Page* p); - - size_t mPageSize; - size_t mMaxAllocSize; - void* mNext; - Page* mCurrentPage; - Page* mPages; - - // Memory usage tracking - size_t mTotalAllocated; - size_t mWastedSpace; - size_t mPageCount; - size_t mDedicatedPageCount; -}; - -}; // namespace android - -#endif // ANDROID_LINEARALLOCATOR_H diff --git a/external/android/include/19/system/core/include/utils/LinearTransform.h b/external/android/include/19/system/core/include/utils/LinearTransform.h deleted file mode 100644 index 04cb355..0000000 --- a/external/android/include/19/system/core/include/utils/LinearTransform.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2011 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 _LIBS_UTILS_LINEAR_TRANSFORM_H -#define _LIBS_UTILS_LINEAR_TRANSFORM_H - -#include - -namespace android { - -// LinearTransform defines a structure which hold the definition of a -// transformation from single dimensional coordinate system A into coordinate -// system B (and back again). Values in A and in B are 64 bit, the linear -// scale factor is expressed as a rational number using two 32 bit values. -// -// Specifically, let -// f(a) = b -// F(b) = f^-1(b) = a -// then -// -// f(a) = (((a - a_zero) * a_to_b_numer) / a_to_b_denom) + b_zero; -// -// and -// -// F(b) = (((b - b_zero) * a_to_b_denom) / a_to_b_numer) + a_zero; -// -struct LinearTransform { - int64_t a_zero; - int64_t b_zero; - int32_t a_to_b_numer; - uint32_t a_to_b_denom; - - // Transform from A->B - // Returns true on success, or false in the case of a singularity or an - // overflow. - bool doForwardTransform(int64_t a_in, int64_t* b_out) const; - - // Transform from B->A - // Returns true on success, or false in the case of a singularity or an - // overflow. - bool doReverseTransform(int64_t b_in, int64_t* a_out) const; - - // Helpers which will reduce the fraction N/D using Euclid's method. - template static void reduce(T* N, T* D); - static void reduce(int32_t* N, uint32_t* D); -}; - - -} - -#endif // _LIBS_UTILS_LINEAR_TRANSFORM_H diff --git a/external/android/include/19/system/core/include/utils/List.h b/external/android/include/19/system/core/include/utils/List.h deleted file mode 100644 index 403cd7f..0000000 --- a/external/android/include/19/system/core/include/utils/List.h +++ /dev/null @@ -1,332 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// Templated list class. Normally we'd use STL, but we don't have that. -// This class mimics STL's interfaces. -// -// Objects are copied into the list with the '=' operator or with copy- -// construction, so if the compiler's auto-generated versions won't work for -// you, define your own. -// -// The only class you want to use from here is "List". -// -#ifndef _LIBS_UTILS_LIST_H -#define _LIBS_UTILS_LIST_H - -#include -#include - -namespace android { - -/* - * Doubly-linked list. Instantiate with "List myList". - * - * Objects added to the list are copied using the assignment operator, - * so this must be defined. - */ -template -class List -{ -protected: - /* - * One element in the list. - */ - class _Node { - public: - explicit _Node(const T& val) : mVal(val) {} - ~_Node() {} - inline T& getRef() { return mVal; } - inline const T& getRef() const { return mVal; } - inline _Node* getPrev() const { return mpPrev; } - inline _Node* getNext() const { return mpNext; } - inline void setVal(const T& val) { mVal = val; } - inline void setPrev(_Node* ptr) { mpPrev = ptr; } - inline void setNext(_Node* ptr) { mpNext = ptr; } - private: - friend class List; - friend class _ListIterator; - T mVal; - _Node* mpPrev; - _Node* mpNext; - }; - - /* - * Iterator for walking through the list. - */ - - template - struct CONST_ITERATOR { - typedef _Node const * NodePtr; - typedef const TYPE Type; - }; - - template - struct NON_CONST_ITERATOR { - typedef _Node* NodePtr; - typedef TYPE Type; - }; - - template< - typename U, - template class Constness - > - class _ListIterator { - typedef _ListIterator _Iter; - typedef typename Constness::NodePtr _NodePtr; - typedef typename Constness::Type _Type; - - explicit _ListIterator(_NodePtr ptr) : mpNode(ptr) {} - - public: - _ListIterator() {} - _ListIterator(const _Iter& rhs) : mpNode(rhs.mpNode) {} - ~_ListIterator() {} - - // this will handle conversions from iterator to const_iterator - // (and also all convertible iterators) - // Here, in this implementation, the iterators can be converted - // if the nodes can be converted - template explicit - _ListIterator(const V& rhs) : mpNode(rhs.mpNode) {} - - - /* - * Dereference operator. Used to get at the juicy insides. - */ - _Type& operator*() const { return mpNode->getRef(); } - _Type* operator->() const { return &(mpNode->getRef()); } - - /* - * Iterator comparison. - */ - inline bool operator==(const _Iter& right) const { - return mpNode == right.mpNode; } - - inline bool operator!=(const _Iter& right) const { - return mpNode != right.mpNode; } - - /* - * handle comparisons between iterator and const_iterator - */ - template - inline bool operator==(const OTHER& right) const { - return mpNode == right.mpNode; } - - template - inline bool operator!=(const OTHER& right) const { - return mpNode != right.mpNode; } - - /* - * Incr/decr, used to move through the list. - */ - inline _Iter& operator++() { // pre-increment - mpNode = mpNode->getNext(); - return *this; - } - const _Iter operator++(int) { // post-increment - _Iter tmp(*this); - mpNode = mpNode->getNext(); - return tmp; - } - inline _Iter& operator--() { // pre-increment - mpNode = mpNode->getPrev(); - return *this; - } - const _Iter operator--(int) { // post-increment - _Iter tmp(*this); - mpNode = mpNode->getPrev(); - return tmp; - } - - inline _NodePtr getNode() const { return mpNode; } - - _NodePtr mpNode; /* should be private, but older gcc fails */ - private: - friend class List; - }; - -public: - List() { - prep(); - } - List(const List& src) { // copy-constructor - prep(); - insert(begin(), src.begin(), src.end()); - } - virtual ~List() { - clear(); - delete[] (unsigned char*) mpMiddle; - } - - typedef _ListIterator iterator; - typedef _ListIterator const_iterator; - - List& operator=(const List& right); - - /* returns true if the list is empty */ - inline bool empty() const { return mpMiddle->getNext() == mpMiddle; } - - /* return #of elements in list */ - size_t size() const { - return size_t(distance(begin(), end())); - } - - /* - * Return the first element or one past the last element. The - * _Node* we're returning is converted to an "iterator" by a - * constructor in _ListIterator. - */ - inline iterator begin() { - return iterator(mpMiddle->getNext()); - } - inline const_iterator begin() const { - return const_iterator(const_cast<_Node const*>(mpMiddle->getNext())); - } - inline iterator end() { - return iterator(mpMiddle); - } - inline const_iterator end() const { - return const_iterator(const_cast<_Node const*>(mpMiddle)); - } - - /* add the object to the head or tail of the list */ - void push_front(const T& val) { insert(begin(), val); } - void push_back(const T& val) { insert(end(), val); } - - /* insert before the current node; returns iterator at new node */ - iterator insert(iterator posn, const T& val) - { - _Node* newNode = new _Node(val); // alloc & copy-construct - newNode->setNext(posn.getNode()); - newNode->setPrev(posn.getNode()->getPrev()); - posn.getNode()->getPrev()->setNext(newNode); - posn.getNode()->setPrev(newNode); - return iterator(newNode); - } - - /* insert a range of elements before the current node */ - void insert(iterator posn, const_iterator first, const_iterator last) { - for ( ; first != last; ++first) - insert(posn, *first); - } - - /* remove one entry; returns iterator at next node */ - iterator erase(iterator posn) { - _Node* pNext = posn.getNode()->getNext(); - _Node* pPrev = posn.getNode()->getPrev(); - pPrev->setNext(pNext); - pNext->setPrev(pPrev); - delete posn.getNode(); - return iterator(pNext); - } - - /* remove a range of elements */ - iterator erase(iterator first, iterator last) { - while (first != last) - erase(first++); // don't erase than incr later! - return iterator(last); - } - - /* remove all contents of the list */ - void clear() { - _Node* pCurrent = mpMiddle->getNext(); - _Node* pNext; - - while (pCurrent != mpMiddle) { - pNext = pCurrent->getNext(); - delete pCurrent; - pCurrent = pNext; - } - mpMiddle->setPrev(mpMiddle); - mpMiddle->setNext(mpMiddle); - } - - /* - * Measure the distance between two iterators. On exist, "first" - * will be equal to "last". The iterators must refer to the same - * list. - * - * FIXME: This is actually a generic iterator function. It should be a - * template function at the top-level with specializations for things like - * vector<>, which can just do pointer math). Here we limit it to - * _ListIterator of the same type but different constness. - */ - template< - typename U, - template class CL, - template class CR - > - ptrdiff_t distance( - _ListIterator first, _ListIterator last) const - { - ptrdiff_t count = 0; - while (first != last) { - ++first; - ++count; - } - return count; - } - -private: - /* - * I want a _Node but don't need it to hold valid data. More - * to the point, I don't want T's constructor to fire, since it - * might have side-effects or require arguments. So, we do this - * slightly uncouth storage alloc. - */ - void prep() { - mpMiddle = (_Node*) new unsigned char[sizeof(_Node)]; - mpMiddle->setPrev(mpMiddle); - mpMiddle->setNext(mpMiddle); - } - - /* - * This node plays the role of "pointer to head" and "pointer to tail". - * It sits in the middle of a circular list of nodes. The iterator - * runs around the circle until it encounters this one. - */ - _Node* mpMiddle; -}; - -/* - * Assignment operator. - * - * The simplest way to do this would be to clear out the target list and - * fill it with the source. However, we can speed things along by - * re-using existing elements. - */ -template -List& List::operator=(const List& right) -{ - if (this == &right) - return *this; // self-assignment - iterator firstDst = begin(); - iterator lastDst = end(); - const_iterator firstSrc = right.begin(); - const_iterator lastSrc = right.end(); - while (firstSrc != lastSrc && firstDst != lastDst) - *firstDst++ = *firstSrc++; - if (firstSrc == lastSrc) // ran out of elements in source? - erase(firstDst, lastDst); // yes, erase any extras - else - insert(lastDst, firstSrc, lastSrc); // copy remaining over - return *this; -} - -}; // namespace android - -#endif // _LIBS_UTILS_LIST_H diff --git a/external/android/include/19/system/core/include/utils/Log.h b/external/android/include/19/system/core/include/utils/Log.h deleted file mode 100644 index 4259c86..0000000 --- a/external/android/include/19/system/core/include/utils/Log.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// C/C++ logging functions. See the logging documentation for API details. -// -// We'd like these to be available from C code (in case we import some from -// somewhere), so this has a C interface. -// -// The output will be correct when the log file is shared between multiple -// threads and/or multiple processes so long as the operating system -// supports O_APPEND. These calls have mutex-protected data structures -// and so are NOT reentrant. Do not use LOG in a signal handler. -// -#ifndef _LIBS_UTILS_LOG_H -#define _LIBS_UTILS_LOG_H - -#include -#include - -#ifdef __cplusplus - -namespace android { - -/* - * A very simple utility that yells in the log when an operation takes too long. - */ -class LogIfSlow { -public: - LogIfSlow(const char* tag, android_LogPriority priority, - int timeoutMillis, const char* message); - ~LogIfSlow(); - -private: - const char* const mTag; - const android_LogPriority mPriority; - const int mTimeoutMillis; - const char* const mMessage; - const int64_t mStart; -}; - -/* - * Writes the specified debug log message if this block takes longer than the - * specified number of milliseconds to run. Includes the time actually taken. - * - * { - * ALOGD_IF_SLOW(50, "Excessive delay doing something."); - * doSomething(); - * } - */ -#define ALOGD_IF_SLOW(timeoutMillis, message) \ - android::LogIfSlow _logIfSlow(LOG_TAG, ANDROID_LOG_DEBUG, timeoutMillis, message); - -} // namespace android - -#endif // __cplusplus - -#endif // _LIBS_UTILS_LOG_H diff --git a/external/android/include/19/system/core/include/utils/Looper.h b/external/android/include/19/system/core/include/utils/Looper.h deleted file mode 100644 index 2e0651a..0000000 --- a/external/android/include/19/system/core/include/utils/Looper.h +++ /dev/null @@ -1,388 +0,0 @@ -/* - * Copyright (C) 2010 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 UTILS_LOOPER_H -#define UTILS_LOOPER_H - -#include -#include -#include -#include - -#include - -#include - -/* - * Declare a concrete type for the NDK's looper forward declaration. - */ -struct ALooper { -}; - -namespace android { - -/** - * A message that can be posted to a Looper. - */ -struct Message { - Message() : what(0) { } - Message(int what) : what(what) { } - - /* The message type. (interpretation is left up to the handler) */ - int what; -}; - - -/** - * Interface for a Looper message handler. - * - * The Looper holds a strong reference to the message handler whenever it has - * a message to deliver to it. Make sure to call Looper::removeMessages - * to remove any pending messages destined for the handler so that the handler - * can be destroyed. - */ -class MessageHandler : public virtual RefBase { -protected: - virtual ~MessageHandler() { } - -public: - /** - * Handles a message. - */ - virtual void handleMessage(const Message& message) = 0; -}; - - -/** - * A simple proxy that holds a weak reference to a message handler. - */ -class WeakMessageHandler : public MessageHandler { -protected: - virtual ~WeakMessageHandler(); - -public: - WeakMessageHandler(const wp& handler); - virtual void handleMessage(const Message& message); - -private: - wp mHandler; -}; - - -/** - * A looper callback. - */ -class LooperCallback : public virtual RefBase { -protected: - virtual ~LooperCallback() { } - -public: - /** - * Handles a poll event for the given file descriptor. - * It is given the file descriptor it is associated with, - * a bitmask of the poll events that were triggered (typically ALOOPER_EVENT_INPUT), - * and the data pointer that was originally supplied. - * - * Implementations should return 1 to continue receiving callbacks, or 0 - * to have this file descriptor and callback unregistered from the looper. - */ - virtual int handleEvent(int fd, int events, void* data) = 0; -}; - - -/** - * Wraps a ALooper_callbackFunc function pointer. - */ -class SimpleLooperCallback : public LooperCallback { -protected: - virtual ~SimpleLooperCallback(); - -public: - SimpleLooperCallback(ALooper_callbackFunc callback); - virtual int handleEvent(int fd, int events, void* data); - -private: - ALooper_callbackFunc mCallback; -}; - - -/** - * A polling loop that supports monitoring file descriptor events, optionally - * using callbacks. The implementation uses epoll() internally. - * - * A looper can be associated with a thread although there is no requirement that it must be. - */ -class Looper : public ALooper, public RefBase { -protected: - virtual ~Looper(); - -public: - /** - * Creates a looper. - * - * If allowNonCallbaks is true, the looper will allow file descriptors to be - * registered without associated callbacks. This assumes that the caller of - * pollOnce() is prepared to handle callback-less events itself. - */ - Looper(bool allowNonCallbacks); - - /** - * Returns whether this looper instance allows the registration of file descriptors - * using identifiers instead of callbacks. - */ - bool getAllowNonCallbacks() const; - - /** - * Waits for events to be available, with optional timeout in milliseconds. - * Invokes callbacks for all file descriptors on which an event occurred. - * - * If the timeout is zero, returns immediately without blocking. - * If the timeout is negative, waits indefinitely until an event appears. - * - * Returns ALOOPER_POLL_WAKE if the poll was awoken using wake() before - * the timeout expired and no callbacks were invoked and no other file - * descriptors were ready. - * - * Returns ALOOPER_POLL_CALLBACK if one or more callbacks were invoked. - * - * Returns ALOOPER_POLL_TIMEOUT if there was no data before the given - * timeout expired. - * - * Returns ALOOPER_POLL_ERROR if an error occurred. - * - * Returns a value >= 0 containing an identifier if its file descriptor has data - * and it has no callback function (requiring the caller here to handle it). - * In this (and only this) case outFd, outEvents and outData will contain the poll - * events and data associated with the fd, otherwise they will be set to NULL. - * - * This method does not return until it has finished invoking the appropriate callbacks - * for all file descriptors that were signalled. - */ - int pollOnce(int timeoutMillis, int* outFd, int* outEvents, void** outData); - inline int pollOnce(int timeoutMillis) { - return pollOnce(timeoutMillis, NULL, NULL, NULL); - } - - /** - * Like pollOnce(), but performs all pending callbacks until all - * data has been consumed or a file descriptor is available with no callback. - * This function will never return ALOOPER_POLL_CALLBACK. - */ - int pollAll(int timeoutMillis, int* outFd, int* outEvents, void** outData); - inline int pollAll(int timeoutMillis) { - return pollAll(timeoutMillis, NULL, NULL, NULL); - } - - /** - * Wakes the poll asynchronously. - * - * This method can be called on any thread. - * This method returns immediately. - */ - void wake(); - - /** - * Adds a new file descriptor to be polled by the looper. - * If the same file descriptor was previously added, it is replaced. - * - * "fd" is the file descriptor to be added. - * "ident" is an identifier for this event, which is returned from pollOnce(). - * The identifier must be >= 0, or ALOOPER_POLL_CALLBACK if providing a non-NULL callback. - * "events" are the poll events to wake up on. Typically this is ALOOPER_EVENT_INPUT. - * "callback" is the function to call when there is an event on the file descriptor. - * "data" is a private data pointer to supply to the callback. - * - * There are two main uses of this function: - * - * (1) If "callback" is non-NULL, then this function will be called when there is - * data on the file descriptor. It should execute any events it has pending, - * appropriately reading from the file descriptor. The 'ident' is ignored in this case. - * - * (2) If "callback" is NULL, the 'ident' will be returned by ALooper_pollOnce - * when its file descriptor has data available, requiring the caller to take - * care of processing it. - * - * Returns 1 if the file descriptor was added, 0 if the arguments were invalid. - * - * This method can be called on any thread. - * This method may block briefly if it needs to wake the poll. - * - * The callback may either be specified as a bare function pointer or as a smart - * pointer callback object. The smart pointer should be preferred because it is - * easier to avoid races when the callback is removed from a different thread. - * See removeFd() for details. - */ - int addFd(int fd, int ident, int events, ALooper_callbackFunc callback, void* data); - int addFd(int fd, int ident, int events, const sp& callback, void* data); - - /** - * Removes a previously added file descriptor from the looper. - * - * When this method returns, it is safe to close the file descriptor since the looper - * will no longer have a reference to it. However, it is possible for the callback to - * already be running or for it to run one last time if the file descriptor was already - * signalled. Calling code is responsible for ensuring that this case is safely handled. - * For example, if the callback takes care of removing itself during its own execution either - * by returning 0 or by calling this method, then it can be guaranteed to not be invoked - * again at any later time unless registered anew. - * - * A simple way to avoid this problem is to use the version of addFd() that takes - * a sp instead of a bare function pointer. The LooperCallback will - * be released at the appropriate time by the Looper. - * - * Returns 1 if the file descriptor was removed, 0 if none was previously registered. - * - * This method can be called on any thread. - * This method may block briefly if it needs to wake the poll. - */ - int removeFd(int fd); - - /** - * Enqueues a message to be processed by the specified handler. - * - * The handler must not be null. - * This method can be called on any thread. - */ - void sendMessage(const sp& handler, const Message& message); - - /** - * Enqueues a message to be processed by the specified handler after all pending messages - * after the specified delay. - * - * The time delay is specified in uptime nanoseconds. - * The handler must not be null. - * This method can be called on any thread. - */ - void sendMessageDelayed(nsecs_t uptimeDelay, const sp& handler, - const Message& message); - - /** - * Enqueues a message to be processed by the specified handler after all pending messages - * at the specified time. - * - * The time is specified in uptime nanoseconds. - * The handler must not be null. - * This method can be called on any thread. - */ - void sendMessageAtTime(nsecs_t uptime, const sp& handler, - const Message& message); - - /** - * Removes all messages for the specified handler from the queue. - * - * The handler must not be null. - * This method can be called on any thread. - */ - void removeMessages(const sp& handler); - - /** - * Removes all messages of a particular type for the specified handler from the queue. - * - * The handler must not be null. - * This method can be called on any thread. - */ - void removeMessages(const sp& handler, int what); - - /** - * Return whether this looper's thread is currently idling -- that is, whether it - * stopped waiting for more work to do. Note that this is intrinsically racy, since - * its state can change before you get the result back. - */ - bool isIdling() const; - - /** - * Prepares a looper associated with the calling thread, and returns it. - * If the thread already has a looper, it is returned. Otherwise, a new - * one is created, associated with the thread, and returned. - * - * The opts may be ALOOPER_PREPARE_ALLOW_NON_CALLBACKS or 0. - */ - static sp prepare(int opts); - - /** - * Sets the given looper to be associated with the calling thread. - * If another looper is already associated with the thread, it is replaced. - * - * If "looper" is NULL, removes the currently associated looper. - */ - static void setForThread(const sp& looper); - - /** - * Returns the looper associated with the calling thread, or NULL if - * there is not one. - */ - static sp getForThread(); - -private: - struct Request { - int fd; - int ident; - sp callback; - void* data; - }; - - struct Response { - int events; - Request request; - }; - - struct MessageEnvelope { - MessageEnvelope() : uptime(0) { } - - MessageEnvelope(nsecs_t uptime, const sp handler, - const Message& message) : uptime(uptime), handler(handler), message(message) { - } - - nsecs_t uptime; - sp handler; - Message message; - }; - - const bool mAllowNonCallbacks; // immutable - - int mWakeReadPipeFd; // immutable - int mWakeWritePipeFd; // immutable - Mutex mLock; - - Vector mMessageEnvelopes; // guarded by mLock - bool mSendingMessage; // guarded by mLock - - // Whether we are currently waiting for work. Not protected by a lock, - // any use of it is racy anyway. - volatile bool mIdling; - - int mEpollFd; // immutable - - // Locked list of file descriptor monitoring requests. - KeyedVector mRequests; // guarded by mLock - - // This state is only used privately by pollOnce and does not require a lock since - // it runs on a single thread. - Vector mResponses; - size_t mResponseIndex; - nsecs_t mNextMessageUptime; // set to LLONG_MAX when none - - int pollInner(int timeoutMillis); - void awoken(); - void pushResponse(int events, const Request& request); - - static void initTLSKey(); - static void threadDestructor(void *st); -}; - -} // namespace android - -#endif // UTILS_LOOPER_H diff --git a/external/android/include/19/system/core/include/utils/LruCache.h b/external/android/include/19/system/core/include/utils/LruCache.h deleted file mode 100644 index 053bfaf..0000000 --- a/external/android/include/19/system/core/include/utils/LruCache.h +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Copyright (C) 2012 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_UTILS_LRU_CACHE_H -#define ANDROID_UTILS_LRU_CACHE_H - -#include -#include - -namespace android { - -/** - * GenerationCache callback used when an item is removed - */ -template -class OnEntryRemoved { -public: - virtual ~OnEntryRemoved() { }; - virtual void operator()(EntryKey& key, EntryValue& value) = 0; -}; // class OnEntryRemoved - -template -class LruCache { -public: - explicit LruCache(uint32_t maxCapacity); - - enum Capacity { - kUnlimitedCapacity, - }; - - void setOnEntryRemovedListener(OnEntryRemoved* listener); - size_t size() const; - const TValue& get(const TKey& key); - bool put(const TKey& key, const TValue& value); - bool remove(const TKey& key); - bool removeOldest(); - void clear(); - - class Iterator { - public: - Iterator(const LruCache& cache): mCache(cache), mIndex(-1) { - } - - bool next() { - mIndex = mCache.mTable->next(mIndex); - return mIndex != -1; - } - - size_t index() const { - return mIndex; - } - - const TValue& value() const { - return mCache.mTable->entryAt(mIndex).value; - } - - const TKey& key() const { - return mCache.mTable->entryAt(mIndex).key; - } - private: - const LruCache& mCache; - size_t mIndex; - }; - -private: - LruCache(const LruCache& that); // disallow copy constructor - - struct Entry { - TKey key; - TValue value; - Entry* parent; - Entry* child; - - Entry(TKey key_, TValue value_) : key(key_), value(value_), parent(NULL), child(NULL) { - } - const TKey& getKey() const { return key; } - }; - - void attachToCache(Entry& entry); - void detachFromCache(Entry& entry); - void rehash(size_t newCapacity); - - UniquePtr > mTable; - OnEntryRemoved* mListener; - Entry* mOldest; - Entry* mYoungest; - uint32_t mMaxCapacity; - TValue mNullValue; -}; - -// Implementation is here, because it's fully templated -template -LruCache::LruCache(uint32_t maxCapacity): mMaxCapacity(maxCapacity), - mNullValue(NULL), mTable(new BasicHashtable), mYoungest(NULL), mOldest(NULL), - mListener(NULL) { -}; - -template -void LruCache::setOnEntryRemovedListener(OnEntryRemoved* listener) { - mListener = listener; -} - -template -size_t LruCache::size() const { - return mTable->size(); -} - -template -const TValue& LruCache::get(const TKey& key) { - hash_t hash = hash_type(key); - ssize_t index = mTable->find(-1, hash, key); - if (index == -1) { - return mNullValue; - } - Entry& entry = mTable->editEntryAt(index); - detachFromCache(entry); - attachToCache(entry); - return entry.value; -} - -template -bool LruCache::put(const TKey& key, const TValue& value) { - if (mMaxCapacity != kUnlimitedCapacity && size() >= mMaxCapacity) { - removeOldest(); - } - - hash_t hash = hash_type(key); - ssize_t index = mTable->find(-1, hash, key); - if (index >= 0) { - return false; - } - if (!mTable->hasMoreRoom()) { - rehash(mTable->capacity() * 2); - } - - // Would it be better to initialize a blank entry and assign key, value? - Entry initEntry(key, value); - index = mTable->add(hash, initEntry); - Entry& entry = mTable->editEntryAt(index); - attachToCache(entry); - return true; -} - -template -bool LruCache::remove(const TKey& key) { - hash_t hash = hash_type(key); - ssize_t index = mTable->find(-1, hash, key); - if (index < 0) { - return false; - } - Entry& entry = mTable->editEntryAt(index); - if (mListener) { - (*mListener)(entry.key, entry.value); - } - detachFromCache(entry); - mTable->removeAt(index); - return true; -} - -template -bool LruCache::removeOldest() { - if (mOldest != NULL) { - return remove(mOldest->key); - // TODO: should probably abort if false - } - return false; -} - -template -void LruCache::clear() { - if (mListener) { - for (Entry* p = mOldest; p != NULL; p = p->child) { - (*mListener)(p->key, p->value); - } - } - mYoungest = NULL; - mOldest = NULL; - mTable->clear(); -} - -template -void LruCache::attachToCache(Entry& entry) { - if (mYoungest == NULL) { - mYoungest = mOldest = &entry; - } else { - entry.parent = mYoungest; - mYoungest->child = &entry; - mYoungest = &entry; - } -} - -template -void LruCache::detachFromCache(Entry& entry) { - if (entry.parent != NULL) { - entry.parent->child = entry.child; - } else { - mOldest = entry.child; - } - if (entry.child != NULL) { - entry.child->parent = entry.parent; - } else { - mYoungest = entry.parent; - } - - entry.parent = NULL; - entry.child = NULL; -} - -template -void LruCache::rehash(size_t newCapacity) { - UniquePtr > oldTable(mTable.release()); - Entry* oldest = mOldest; - - mOldest = NULL; - mYoungest = NULL; - mTable.reset(new BasicHashtable(newCapacity)); - for (Entry* p = oldest; p != NULL; p = p->child) { - put(p->key, p->value); - } -} - -} - -#endif // ANDROID_UTILS_LRU_CACHE_H diff --git a/external/android/include/19/system/core/include/utils/Mutex.h b/external/android/include/19/system/core/include/utils/Mutex.h deleted file mode 100644 index dd201c8..0000000 --- a/external/android/include/19/system/core/include/utils/Mutex.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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 _LIBS_UTILS_MUTEX_H -#define _LIBS_UTILS_MUTEX_H - -#include -#include -#include - -#if defined(HAVE_PTHREADS) -# include -#endif - -#include - -// --------------------------------------------------------------------------- -namespace android { -// --------------------------------------------------------------------------- - -class Condition; - -/* - * Simple mutex class. The implementation is system-dependent. - * - * The mutex must be unlocked by the thread that locked it. They are not - * recursive, i.e. the same thread can't lock it multiple times. - */ -class Mutex { -public: - enum { - PRIVATE = 0, - SHARED = 1 - }; - - Mutex(); - Mutex(const char* name); - Mutex(int type, const char* name = NULL); - ~Mutex(); - - // lock or unlock the mutex - status_t lock(); - void unlock(); - - // lock if possible; returns 0 on success, error otherwise - status_t tryLock(); - - // Manages the mutex automatically. It'll be locked when Autolock is - // constructed and released when Autolock goes out of scope. - class Autolock { - public: - inline Autolock(Mutex& mutex) : mLock(mutex) { mLock.lock(); } - inline Autolock(Mutex* mutex) : mLock(*mutex) { mLock.lock(); } - inline ~Autolock() { mLock.unlock(); } - private: - Mutex& mLock; - }; - -private: - friend class Condition; - - // A mutex cannot be copied - Mutex(const Mutex&); - Mutex& operator = (const Mutex&); - -#if defined(HAVE_PTHREADS) - pthread_mutex_t mMutex; -#else - void _init(); - void* mState; -#endif -}; - -// --------------------------------------------------------------------------- - -#if defined(HAVE_PTHREADS) - -inline Mutex::Mutex() { - pthread_mutex_init(&mMutex, NULL); -} -inline Mutex::Mutex(__attribute__((unused)) const char* name) { - pthread_mutex_init(&mMutex, NULL); -} -inline Mutex::Mutex(int type, __attribute__((unused)) const char* name) { - if (type == SHARED) { - pthread_mutexattr_t attr; - pthread_mutexattr_init(&attr); - pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED); - pthread_mutex_init(&mMutex, &attr); - pthread_mutexattr_destroy(&attr); - } else { - pthread_mutex_init(&mMutex, NULL); - } -} -inline Mutex::~Mutex() { - pthread_mutex_destroy(&mMutex); -} -inline status_t Mutex::lock() { - return -pthread_mutex_lock(&mMutex); -} -inline void Mutex::unlock() { - pthread_mutex_unlock(&mMutex); -} -inline status_t Mutex::tryLock() { - return -pthread_mutex_trylock(&mMutex); -} - -#endif // HAVE_PTHREADS - -// --------------------------------------------------------------------------- - -/* - * Automatic mutex. Declare one of these at the top of a function. - * When the function returns, it will go out of scope, and release the - * mutex. - */ - -typedef Mutex::Autolock AutoMutex; - -// --------------------------------------------------------------------------- -}; // namespace android -// --------------------------------------------------------------------------- - -#endif // _LIBS_UTILS_MUTEX_H diff --git a/external/android/include/19/system/core/include/utils/PropertyMap.h b/external/android/include/19/system/core/include/utils/PropertyMap.h deleted file mode 100644 index a9e674f..0000000 --- a/external/android/include/19/system/core/include/utils/PropertyMap.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (C) 2010 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 _UTILS_PROPERTY_MAP_H -#define _UTILS_PROPERTY_MAP_H - -#include -#include -#include -#include - -namespace android { - -/* - * Provides a mechanism for passing around string-based property key / value pairs - * and loading them from property files. - * - * The property files have the following simple structure: - * - * # Comment - * key = value - * - * Keys and values are any sequence of printable ASCII characters. - * The '=' separates the key from the value. - * The key and value may not contain whitespace. - * - * The '\' character is reserved for escape sequences and is not currently supported. - * The '"" character is reserved for quoting and is not currently supported. - * Files that contain the '\' or '"' character will fail to parse. - * - * The file must not contain duplicate keys. - * - * TODO Support escape sequences and quoted values when needed. - */ -class PropertyMap { -public: - /* Creates an empty property map. */ - PropertyMap(); - ~PropertyMap(); - - /* Clears the property map. */ - void clear(); - - /* Adds a property. - * Replaces the property with the same key if it is already present. - */ - void addProperty(const String8& key, const String8& value); - - /* Returns true if the property map contains the specified key. */ - bool hasProperty(const String8& key) const; - - /* Gets the value of a property and parses it. - * Returns true and sets outValue if the key was found and its value was parsed successfully. - * Otherwise returns false and does not modify outValue. (Also logs a warning.) - */ - bool tryGetProperty(const String8& key, String8& outValue) const; - bool tryGetProperty(const String8& key, bool& outValue) const; - bool tryGetProperty(const String8& key, int32_t& outValue) const; - bool tryGetProperty(const String8& key, float& outValue) const; - - /* Adds all values from the specified property map. */ - void addAll(const PropertyMap* map); - - /* Gets the underlying property map. */ - inline const KeyedVector& getProperties() const { return mProperties; } - - /* Loads a property map from a file. */ - static status_t load(const String8& filename, PropertyMap** outMap); - -private: - class Parser { - PropertyMap* mMap; - Tokenizer* mTokenizer; - - public: - Parser(PropertyMap* map, Tokenizer* tokenizer); - ~Parser(); - status_t parse(); - - private: - status_t parseType(); - status_t parseKey(); - status_t parseKeyProperty(); - status_t parseModifier(const String8& token, int32_t* outMetaState); - status_t parseCharacterLiteral(char16_t* outCharacter); - }; - - KeyedVector mProperties; -}; - -} // namespace android - -#endif // _UTILS_PROPERTY_MAP_H diff --git a/external/android/include/19/system/core/include/utils/RWLock.h b/external/android/include/19/system/core/include/utils/RWLock.h deleted file mode 100644 index 90beb5f..0000000 --- a/external/android/include/19/system/core/include/utils/RWLock.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * 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 _LIBS_UTILS_RWLOCK_H -#define _LIBS_UTILS_RWLOCK_H - -#include -#include - -#if defined(HAVE_PTHREADS) -# include -#endif - -#include -#include - -// --------------------------------------------------------------------------- -namespace android { -// --------------------------------------------------------------------------- - -#if defined(HAVE_PTHREADS) - -/* - * Simple mutex class. The implementation is system-dependent. - * - * The mutex must be unlocked by the thread that locked it. They are not - * recursive, i.e. the same thread can't lock it multiple times. - */ -class RWLock { -public: - enum { - PRIVATE = 0, - SHARED = 1 - }; - - RWLock(); - RWLock(const char* name); - RWLock(int type, const char* name = NULL); - ~RWLock(); - - status_t readLock(); - status_t tryReadLock(); - status_t writeLock(); - status_t tryWriteLock(); - void unlock(); - - class AutoRLock { - public: - inline AutoRLock(RWLock& rwlock) : mLock(rwlock) { mLock.readLock(); } - inline ~AutoRLock() { mLock.unlock(); } - private: - RWLock& mLock; - }; - - class AutoWLock { - public: - inline AutoWLock(RWLock& rwlock) : mLock(rwlock) { mLock.writeLock(); } - inline ~AutoWLock() { mLock.unlock(); } - private: - RWLock& mLock; - }; - -private: - // A RWLock cannot be copied - RWLock(const RWLock&); - RWLock& operator = (const RWLock&); - - pthread_rwlock_t mRWLock; -}; - -inline RWLock::RWLock() { - pthread_rwlock_init(&mRWLock, NULL); -} -inline RWLock::RWLock(__attribute__((unused)) const char* name) { - pthread_rwlock_init(&mRWLock, NULL); -} -inline RWLock::RWLock(int type, __attribute__((unused)) const char* name) { - if (type == SHARED) { - pthread_rwlockattr_t attr; - pthread_rwlockattr_init(&attr); - pthread_rwlockattr_setpshared(&attr, PTHREAD_PROCESS_SHARED); - pthread_rwlock_init(&mRWLock, &attr); - pthread_rwlockattr_destroy(&attr); - } else { - pthread_rwlock_init(&mRWLock, NULL); - } -} -inline RWLock::~RWLock() { - pthread_rwlock_destroy(&mRWLock); -} -inline status_t RWLock::readLock() { - return -pthread_rwlock_rdlock(&mRWLock); -} -inline status_t RWLock::tryReadLock() { - return -pthread_rwlock_tryrdlock(&mRWLock); -} -inline status_t RWLock::writeLock() { - return -pthread_rwlock_wrlock(&mRWLock); -} -inline status_t RWLock::tryWriteLock() { - return -pthread_rwlock_trywrlock(&mRWLock); -} -inline void RWLock::unlock() { - pthread_rwlock_unlock(&mRWLock); -} - -#endif // HAVE_PTHREADS - -// --------------------------------------------------------------------------- -}; // namespace android -// --------------------------------------------------------------------------- - -#endif // _LIBS_UTILS_RWLOCK_H diff --git a/external/android/include/19/system/core/include/utils/RefBase.h b/external/android/include/19/system/core/include/utils/RefBase.h deleted file mode 100644 index cbfe13a..0000000 --- a/external/android/include/19/system/core/include/utils/RefBase.h +++ /dev/null @@ -1,546 +0,0 @@ -/* - * Copyright (C) 2005 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_REF_BASE_H -#define ANDROID_REF_BASE_H - -#include - -#include -#include -#include -#include - -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -class TextOutput; -TextOutput& printWeakPointer(TextOutput& to, const void* val); - -// --------------------------------------------------------------------------- - -#define COMPARE_WEAK(_op_) \ -inline bool operator _op_ (const sp& o) const { \ - return m_ptr _op_ o.m_ptr; \ -} \ -inline bool operator _op_ (const T* o) const { \ - return m_ptr _op_ o; \ -} \ -template \ -inline bool operator _op_ (const sp& o) const { \ - return m_ptr _op_ o.m_ptr; \ -} \ -template \ -inline bool operator _op_ (const U* o) const { \ - return m_ptr _op_ o; \ -} - -// --------------------------------------------------------------------------- - -class ReferenceRenamer { -protected: - // destructor is purposedly not virtual so we avoid code overhead from - // subclasses; we have to make it protected to guarantee that it - // cannot be called from this base class (and to make strict compilers - // happy). - ~ReferenceRenamer() { } -public: - virtual void operator()(size_t i) const = 0; -}; - -// --------------------------------------------------------------------------- - -class RefBase -{ -public: - void incStrong(const void* id) const; - void decStrong(const void* id) const; - - void forceIncStrong(const void* id) const; - - //! DEBUGGING ONLY: Get current strong ref count. - int32_t getStrongCount() const; - - class weakref_type - { - public: - RefBase* refBase() const; - - void incWeak(const void* id); - void decWeak(const void* id); - - // acquires a strong reference if there is already one. - bool attemptIncStrong(const void* id); - - // acquires a weak reference if there is already one. - // This is not always safe. see ProcessState.cpp and BpBinder.cpp - // for proper use. - bool attemptIncWeak(const void* id); - - //! DEBUGGING ONLY: Get current weak ref count. - int32_t getWeakCount() const; - - //! DEBUGGING ONLY: Print references held on object. - void printRefs() const; - - //! DEBUGGING ONLY: Enable tracking for this object. - // enable -- enable/disable tracking - // retain -- when tracking is enable, if true, then we save a stack trace - // for each reference and dereference; when retain == false, we - // match up references and dereferences and keep only the - // outstanding ones. - - void trackMe(bool enable, bool retain); - }; - - weakref_type* createWeak(const void* id) const; - - weakref_type* getWeakRefs() const; - - //! DEBUGGING ONLY: Print references held on object. - inline void printRefs() const { getWeakRefs()->printRefs(); } - - //! DEBUGGING ONLY: Enable tracking of object. - inline void trackMe(bool enable, bool retain) - { - getWeakRefs()->trackMe(enable, retain); - } - - typedef RefBase basetype; - -protected: - RefBase(); - virtual ~RefBase(); - - //! Flags for extendObjectLifetime() - enum { - OBJECT_LIFETIME_STRONG = 0x0000, - OBJECT_LIFETIME_WEAK = 0x0001, - OBJECT_LIFETIME_MASK = 0x0001 - }; - - void extendObjectLifetime(int32_t mode); - - //! Flags for onIncStrongAttempted() - enum { - FIRST_INC_STRONG = 0x0001 - }; - - virtual void onFirstRef(); - virtual void onLastStrongRef(const void* id); - virtual bool onIncStrongAttempted(uint32_t flags, const void* id); - virtual void onLastWeakRef(const void* id); - -private: - friend class weakref_type; - class weakref_impl; - - RefBase(const RefBase& o); - RefBase& operator=(const RefBase& o); - -private: - friend class ReferenceMover; - - static void renameRefs(size_t n, const ReferenceRenamer& renamer); - - static void renameRefId(weakref_type* ref, - const void* old_id, const void* new_id); - - static void renameRefId(RefBase* ref, - const void* old_id, const void* new_id); - - weakref_impl* const mRefs; -}; - -// --------------------------------------------------------------------------- - -template -class LightRefBase -{ -public: - inline LightRefBase() : mCount(0) { } - inline void incStrong(__attribute__((unused)) const void* id) const { - android_atomic_inc(&mCount); - } - inline void decStrong(__attribute__((unused)) const void* id) const { - if (android_atomic_dec(&mCount) == 1) { - delete static_cast(this); - } - } - //! DEBUGGING ONLY: Get current strong ref count. - inline int32_t getStrongCount() const { - return mCount; - } - - typedef LightRefBase basetype; - -protected: - inline ~LightRefBase() { } - -private: - friend class ReferenceMover; - inline static void renameRefs(size_t n, const ReferenceRenamer& renamer) { } - inline static void renameRefId(T* ref, - const void* old_id, const void* new_id) { } - -private: - mutable volatile int32_t mCount; -}; - -// --------------------------------------------------------------------------- - -template -class wp -{ -public: - typedef typename RefBase::weakref_type weakref_type; - - inline wp() : m_ptr(0) { } - - wp(T* other); - wp(const wp& other); - wp(const sp& other); - template wp(U* other); - template wp(const sp& other); - template wp(const wp& other); - - ~wp(); - - // Assignment - - wp& operator = (T* other); - wp& operator = (const wp& other); - wp& operator = (const sp& other); - - template wp& operator = (U* other); - template wp& operator = (const wp& other); - template wp& operator = (const sp& other); - - void set_object_and_refs(T* other, weakref_type* refs); - - // promotion to sp - - sp promote() const; - - // Reset - - void clear(); - - // Accessors - - inline weakref_type* get_refs() const { return m_refs; } - - inline T* unsafe_get() const { return m_ptr; } - - // Operators - - COMPARE_WEAK(==) - COMPARE_WEAK(!=) - COMPARE_WEAK(>) - COMPARE_WEAK(<) - COMPARE_WEAK(<=) - COMPARE_WEAK(>=) - - inline bool operator == (const wp& o) const { - return (m_ptr == o.m_ptr) && (m_refs == o.m_refs); - } - template - inline bool operator == (const wp& o) const { - return m_ptr == o.m_ptr; - } - - inline bool operator > (const wp& o) const { - return (m_ptr == o.m_ptr) ? (m_refs > o.m_refs) : (m_ptr > o.m_ptr); - } - template - inline bool operator > (const wp& o) const { - return (m_ptr == o.m_ptr) ? (m_refs > o.m_refs) : (m_ptr > o.m_ptr); - } - - inline bool operator < (const wp& o) const { - return (m_ptr == o.m_ptr) ? (m_refs < o.m_refs) : (m_ptr < o.m_ptr); - } - template - inline bool operator < (const wp& o) const { - return (m_ptr == o.m_ptr) ? (m_refs < o.m_refs) : (m_ptr < o.m_ptr); - } - inline bool operator != (const wp& o) const { return m_refs != o.m_refs; } - template inline bool operator != (const wp& o) const { return !operator == (o); } - inline bool operator <= (const wp& o) const { return !operator > (o); } - template inline bool operator <= (const wp& o) const { return !operator > (o); } - inline bool operator >= (const wp& o) const { return !operator < (o); } - template inline bool operator >= (const wp& o) const { return !operator < (o); } - -private: - template friend class sp; - template friend class wp; - - T* m_ptr; - weakref_type* m_refs; -}; - -template -TextOutput& operator<<(TextOutput& to, const wp& val); - -#undef COMPARE_WEAK - -// --------------------------------------------------------------------------- -// No user serviceable parts below here. - -template -wp::wp(T* other) - : m_ptr(other) -{ - if (other) m_refs = other->createWeak(this); -} - -template -wp::wp(const wp& other) - : m_ptr(other.m_ptr), m_refs(other.m_refs) -{ - if (m_ptr) m_refs->incWeak(this); -} - -template -wp::wp(const sp& other) - : m_ptr(other.m_ptr) -{ - if (m_ptr) { - m_refs = m_ptr->createWeak(this); - } -} - -template template -wp::wp(U* other) - : m_ptr(other) -{ - if (other) m_refs = other->createWeak(this); -} - -template template -wp::wp(const wp& other) - : m_ptr(other.m_ptr) -{ - if (m_ptr) { - m_refs = other.m_refs; - m_refs->incWeak(this); - } -} - -template template -wp::wp(const sp& other) - : m_ptr(other.m_ptr) -{ - if (m_ptr) { - m_refs = m_ptr->createWeak(this); - } -} - -template -wp::~wp() -{ - if (m_ptr) m_refs->decWeak(this); -} - -template -wp& wp::operator = (T* other) -{ - weakref_type* newRefs = - other ? other->createWeak(this) : 0; - if (m_ptr) m_refs->decWeak(this); - m_ptr = other; - m_refs = newRefs; - return *this; -} - -template -wp& wp::operator = (const wp& other) -{ - weakref_type* otherRefs(other.m_refs); - T* otherPtr(other.m_ptr); - if (otherPtr) otherRefs->incWeak(this); - if (m_ptr) m_refs->decWeak(this); - m_ptr = otherPtr; - m_refs = otherRefs; - return *this; -} - -template -wp& wp::operator = (const sp& other) -{ - weakref_type* newRefs = - other != NULL ? other->createWeak(this) : 0; - T* otherPtr(other.m_ptr); - if (m_ptr) m_refs->decWeak(this); - m_ptr = otherPtr; - m_refs = newRefs; - return *this; -} - -template template -wp& wp::operator = (U* other) -{ - weakref_type* newRefs = - other ? other->createWeak(this) : 0; - if (m_ptr) m_refs->decWeak(this); - m_ptr = other; - m_refs = newRefs; - return *this; -} - -template template -wp& wp::operator = (const wp& other) -{ - weakref_type* otherRefs(other.m_refs); - U* otherPtr(other.m_ptr); - if (otherPtr) otherRefs->incWeak(this); - if (m_ptr) m_refs->decWeak(this); - m_ptr = otherPtr; - m_refs = otherRefs; - return *this; -} - -template template -wp& wp::operator = (const sp& other) -{ - weakref_type* newRefs = - other != NULL ? other->createWeak(this) : 0; - U* otherPtr(other.m_ptr); - if (m_ptr) m_refs->decWeak(this); - m_ptr = otherPtr; - m_refs = newRefs; - return *this; -} - -template -void wp::set_object_and_refs(T* other, weakref_type* refs) -{ - if (other) refs->incWeak(this); - if (m_ptr) m_refs->decWeak(this); - m_ptr = other; - m_refs = refs; -} - -template -sp wp::promote() const -{ - sp result; - if (m_ptr && m_refs->attemptIncStrong(&result)) { - result.set_pointer(m_ptr); - } - return result; -} - -template -void wp::clear() -{ - if (m_ptr) { - m_refs->decWeak(this); - m_ptr = 0; - } -} - -template -inline TextOutput& operator<<(TextOutput& to, const wp& val) -{ - return printWeakPointer(to, val.unsafe_get()); -} - -// --------------------------------------------------------------------------- - -// this class just serves as a namespace so TYPE::moveReferences can stay -// private. -class ReferenceMover { -public: - // it would be nice if we could make sure no extra code is generated - // for sp or wp when TYPE is a descendant of RefBase: - // Using a sp override doesn't work; it's a bit like we wanted - // a template template... - - template static inline - void move_references(sp* d, sp const* s, size_t n) { - - class Renamer : public ReferenceRenamer { - sp* d; - sp const* s; - virtual void operator()(size_t i) const { - // The id are known to be the sp<>'s this pointer - TYPE::renameRefId(d[i].get(), &s[i], &d[i]); - } - public: - Renamer(sp* d, sp const* s) : s(s), d(d) { } - }; - - memmove(d, s, n*sizeof(sp)); - TYPE::renameRefs(n, Renamer(d, s)); - } - - - template static inline - void move_references(wp* d, wp const* s, size_t n) { - - class Renamer : public ReferenceRenamer { - wp* d; - wp const* s; - virtual void operator()(size_t i) const { - // The id are known to be the wp<>'s this pointer - TYPE::renameRefId(d[i].get_refs(), &s[i], &d[i]); - } - public: - Renamer(wp* d, wp const* s) : s(s), d(d) { } - }; - - memmove(d, s, n*sizeof(wp)); - TYPE::renameRefs(n, Renamer(d, s)); - } -}; - -// specialization for moving sp<> and wp<> types. -// these are used by the [Sorted|Keyed]Vector<> implementations -// sp<> and wp<> need to be handled specially, because they do not -// have trivial copy operation in the general case (see RefBase.cpp -// when DEBUG ops are enabled), but can be implemented very -// efficiently in most cases. - -template inline -void move_forward_type(sp* d, sp const* s, size_t n) { - ReferenceMover::move_references(d, s, n); -} - -template inline -void move_backward_type(sp* d, sp const* s, size_t n) { - ReferenceMover::move_references(d, s, n); -} - -template inline -void move_forward_type(wp* d, wp const* s, size_t n) { - ReferenceMover::move_references(d, s, n); -} - -template inline -void move_backward_type(wp* d, wp const* s, size_t n) { - ReferenceMover::move_references(d, s, n); -} - - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_REF_BASE_H diff --git a/external/android/include/19/system/core/include/utils/SharedBuffer.h b/external/android/include/19/system/core/include/utils/SharedBuffer.h deleted file mode 100644 index b670953..0000000 --- a/external/android/include/19/system/core/include/utils/SharedBuffer.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (C) 2005 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_SHARED_BUFFER_H -#define ANDROID_SHARED_BUFFER_H - -#include -#include - -// --------------------------------------------------------------------------- - -namespace android { - -class SharedBuffer -{ -public: - - /* flags to use with release() */ - enum { - eKeepStorage = 0x00000001 - }; - - /*! allocate a buffer of size 'size' and acquire() it. - * call release() to free it. - */ - static SharedBuffer* alloc(size_t size); - - /*! free the memory associated with the SharedBuffer. - * Fails if there are any users associated with this SharedBuffer. - * In other words, the buffer must have been release by all its - * users. - */ - static ssize_t dealloc(const SharedBuffer* released); - - //! access the data for read - inline const void* data() const; - - //! access the data for read/write - inline void* data(); - - //! get size of the buffer - inline size_t size() const; - - //! get back a SharedBuffer object from its data - static inline SharedBuffer* bufferFromData(void* data); - - //! get back a SharedBuffer object from its data - static inline const SharedBuffer* bufferFromData(const void* data); - - //! get the size of a SharedBuffer object from its data - static inline size_t sizeFromData(const void* data); - - //! edit the buffer (get a writtable, or non-const, version of it) - SharedBuffer* edit() const; - - //! edit the buffer, resizing if needed - SharedBuffer* editResize(size_t size) const; - - //! like edit() but fails if a copy is required - SharedBuffer* attemptEdit() const; - - //! resize and edit the buffer, loose it's content. - SharedBuffer* reset(size_t size) const; - - //! acquire/release a reference on this buffer - void acquire() const; - - /*! release a reference on this buffer, with the option of not - * freeing the memory associated with it if it was the last reference - * returns the previous reference count - */ - int32_t release(uint32_t flags = 0) const; - - //! returns wether or not we're the only owner - inline bool onlyOwner() const; - - -private: - inline SharedBuffer() { } - inline ~SharedBuffer() { } - SharedBuffer(const SharedBuffer&); - SharedBuffer& operator = (const SharedBuffer&); - - // 16 bytes. must be sized to preserve correct alignment. - mutable int32_t mRefs; - size_t mSize; - uint32_t mReserved[2]; -}; - -// --------------------------------------------------------------------------- - -const void* SharedBuffer::data() const { - return this + 1; -} - -void* SharedBuffer::data() { - return this + 1; -} - -size_t SharedBuffer::size() const { - return mSize; -} - -SharedBuffer* SharedBuffer::bufferFromData(void* data) { - return data ? static_cast(data)-1 : 0; -} - -const SharedBuffer* SharedBuffer::bufferFromData(const void* data) { - return data ? static_cast(data)-1 : 0; -} - -size_t SharedBuffer::sizeFromData(const void* data) { - return data ? bufferFromData(data)->mSize : 0; -} - -bool SharedBuffer::onlyOwner() const { - return (mRefs == 1); -} - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_VECTOR_H diff --git a/external/android/include/19/system/core/include/utils/Singleton.h b/external/android/include/19/system/core/include/utils/Singleton.h deleted file mode 100644 index c60680e..0000000 --- a/external/android/include/19/system/core/include/utils/Singleton.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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_UTILS_SINGLETON_H -#define ANDROID_UTILS_SINGLETON_H - -#include -#include -#include -#include - -namespace android { -// --------------------------------------------------------------------------- - -template -class ANDROID_API Singleton -{ -public: - static TYPE& getInstance() { - Mutex::Autolock _l(sLock); - TYPE* instance = sInstance; - if (instance == 0) { - instance = new TYPE(); - sInstance = instance; - } - return *instance; - } - - static bool hasInstance() { - Mutex::Autolock _l(sLock); - return sInstance != 0; - } - -protected: - ~Singleton() { }; - Singleton() { }; - -private: - Singleton(const Singleton&); - Singleton& operator = (const Singleton&); - static Mutex sLock; - static TYPE* sInstance; -}; - -/* - * use ANDROID_SINGLETON_STATIC_INSTANCE(TYPE) in your implementation file - * (eg: .cpp) to create the static instance of Singleton<>'s attributes, - * and avoid to have a copy of them in each compilation units Singleton - * is used. - * NOTE: we use a version of Mutex ctor that takes a parameter, because - * for some unknown reason using the default ctor doesn't emit the variable! - */ - -#define ANDROID_SINGLETON_STATIC_INSTANCE(TYPE) \ - template<> Mutex Singleton< TYPE >::sLock(Mutex::PRIVATE); \ - template<> TYPE* Singleton< TYPE >::sInstance(0); \ - template class Singleton< TYPE >; - - -// --------------------------------------------------------------------------- -}; // namespace android - -#endif // ANDROID_UTILS_SINGLETON_H - diff --git a/external/android/include/19/system/core/include/utils/SortedVector.h b/external/android/include/19/system/core/include/utils/SortedVector.h deleted file mode 100644 index 2d3e82a..0000000 --- a/external/android/include/19/system/core/include/utils/SortedVector.h +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Copyright (C) 2005 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_SORTED_VECTOR_H -#define ANDROID_SORTED_VECTOR_H - -#include -#include -#include - -#include - -#include -#include -#include - -// --------------------------------------------------------------------------- - -namespace android { - -template -class SortedVector : private SortedVectorImpl -{ - friend class Vector; - -public: - typedef TYPE value_type; - - /*! - * Constructors and destructors - */ - - SortedVector(); - SortedVector(const SortedVector& rhs); - virtual ~SortedVector(); - - /*! copy operator */ - const SortedVector& operator = (const SortedVector& rhs) const; - SortedVector& operator = (const SortedVector& rhs); - - /* - * empty the vector - */ - - inline void clear() { VectorImpl::clear(); } - - /*! - * vector stats - */ - - //! returns number of items in the vector - inline size_t size() const { return VectorImpl::size(); } - //! returns whether or not the vector is empty - inline bool isEmpty() const { return VectorImpl::isEmpty(); } - //! returns how many items can be stored without reallocating the backing store - inline size_t capacity() const { return VectorImpl::capacity(); } - //! sets the capacity. capacity can never be reduced less than size() - inline ssize_t setCapacity(size_t size) { return VectorImpl::setCapacity(size); } - - /*! - * C-style array access - */ - - //! read-only C-style access - inline const TYPE* array() const; - - //! read-write C-style access. BE VERY CAREFUL when modifying the array - //! you must keep it sorted! You usually don't use this function. - TYPE* editArray(); - - //! finds the index of an item - ssize_t indexOf(const TYPE& item) const; - - //! finds where this item should be inserted - size_t orderOf(const TYPE& item) const; - - - /*! - * accessors - */ - - //! read-only access to an item at a given index - inline const TYPE& operator [] (size_t index) const; - //! alternate name for operator [] - inline const TYPE& itemAt(size_t index) const; - //! stack-usage of the vector. returns the top of the stack (last element) - const TYPE& top() const; - - /*! - * modifying the array - */ - - //! add an item in the right place (and replace the one that is there) - ssize_t add(const TYPE& item); - - //! editItemAt() MUST NOT change the order of this item - TYPE& editItemAt(size_t index) { - return *( static_cast(VectorImpl::editItemLocation(index)) ); - } - - //! merges a vector into this one - ssize_t merge(const Vector& vector); - ssize_t merge(const SortedVector& vector); - - //! removes an item - ssize_t remove(const TYPE&); - - //! remove several items - inline ssize_t removeItemsAt(size_t index, size_t count = 1); - //! remove one item - inline ssize_t removeAt(size_t index) { return removeItemsAt(index); } - -protected: - virtual void do_construct(void* storage, size_t num) const; - virtual void do_destroy(void* storage, size_t num) const; - virtual void do_copy(void* dest, const void* from, size_t num) const; - virtual void do_splat(void* dest, const void* item, size_t num) const; - virtual void do_move_forward(void* dest, const void* from, size_t num) const; - virtual void do_move_backward(void* dest, const void* from, size_t num) const; - virtual int do_compare(const void* lhs, const void* rhs) const; -}; - -// SortedVector can be trivially moved using memcpy() because moving does not -// require any change to the underlying SharedBuffer contents or reference count. -template struct trait_trivial_move > { enum { value = true }; }; - -// --------------------------------------------------------------------------- -// No user serviceable parts from here... -// --------------------------------------------------------------------------- - -template inline -SortedVector::SortedVector() - : SortedVectorImpl(sizeof(TYPE), - ((traits::has_trivial_ctor ? HAS_TRIVIAL_CTOR : 0) - |(traits::has_trivial_dtor ? HAS_TRIVIAL_DTOR : 0) - |(traits::has_trivial_copy ? HAS_TRIVIAL_COPY : 0)) - ) -{ -} - -template inline -SortedVector::SortedVector(const SortedVector& rhs) - : SortedVectorImpl(rhs) { -} - -template inline -SortedVector::~SortedVector() { - finish_vector(); -} - -template inline -SortedVector& SortedVector::operator = (const SortedVector& rhs) { - SortedVectorImpl::operator = (rhs); - return *this; -} - -template inline -const SortedVector& SortedVector::operator = (const SortedVector& rhs) const { - SortedVectorImpl::operator = (rhs); - return *this; -} - -template inline -const TYPE* SortedVector::array() const { - return static_cast(arrayImpl()); -} - -template inline -TYPE* SortedVector::editArray() { - return static_cast(editArrayImpl()); -} - - -template inline -const TYPE& SortedVector::operator[](size_t index) const { - LOG_FATAL_IF(index>=size(), - "%s: index=%u out of range (%u)", __PRETTY_FUNCTION__, - int(index), int(size())); - return *(array() + index); -} - -template inline -const TYPE& SortedVector::itemAt(size_t index) const { - return operator[](index); -} - -template inline -const TYPE& SortedVector::top() const { - return *(array() + size() - 1); -} - -template inline -ssize_t SortedVector::add(const TYPE& item) { - return SortedVectorImpl::add(&item); -} - -template inline -ssize_t SortedVector::indexOf(const TYPE& item) const { - return SortedVectorImpl::indexOf(&item); -} - -template inline -size_t SortedVector::orderOf(const TYPE& item) const { - return SortedVectorImpl::orderOf(&item); -} - -template inline -ssize_t SortedVector::merge(const Vector& vector) { - return SortedVectorImpl::merge(reinterpret_cast(vector)); -} - -template inline -ssize_t SortedVector::merge(const SortedVector& vector) { - return SortedVectorImpl::merge(reinterpret_cast(vector)); -} - -template inline -ssize_t SortedVector::remove(const TYPE& item) { - return SortedVectorImpl::remove(&item); -} - -template inline -ssize_t SortedVector::removeItemsAt(size_t index, size_t count) { - return VectorImpl::removeItemsAt(index, count); -} - -// --------------------------------------------------------------------------- - -template -void SortedVector::do_construct(void* storage, size_t num) const { - construct_type( reinterpret_cast(storage), num ); -} - -template -void SortedVector::do_destroy(void* storage, size_t num) const { - destroy_type( reinterpret_cast(storage), num ); -} - -template -void SortedVector::do_copy(void* dest, const void* from, size_t num) const { - copy_type( reinterpret_cast(dest), reinterpret_cast(from), num ); -} - -template -void SortedVector::do_splat(void* dest, const void* item, size_t num) const { - splat_type( reinterpret_cast(dest), reinterpret_cast(item), num ); -} - -template -void SortedVector::do_move_forward(void* dest, const void* from, size_t num) const { - move_forward_type( reinterpret_cast(dest), reinterpret_cast(from), num ); -} - -template -void SortedVector::do_move_backward(void* dest, const void* from, size_t num) const { - move_backward_type( reinterpret_cast(dest), reinterpret_cast(from), num ); -} - -template -int SortedVector::do_compare(const void* lhs, const void* rhs) const { - return compare_type( *reinterpret_cast(lhs), *reinterpret_cast(rhs) ); -} - -}; // namespace android - - -// --------------------------------------------------------------------------- - -#endif // ANDROID_SORTED_VECTOR_H diff --git a/external/android/include/19/system/core/include/utils/StopWatch.h b/external/android/include/19/system/core/include/utils/StopWatch.h deleted file mode 100644 index 693dd3c..0000000 --- a/external/android/include/19/system/core/include/utils/StopWatch.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2005 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_STOPWATCH_H -#define ANDROID_STOPWATCH_H - -#include -#include - -#include - -// --------------------------------------------------------------------------- - -namespace android { - -class StopWatch -{ -public: - StopWatch( const char *name, - int clock = SYSTEM_TIME_MONOTONIC, - uint32_t flags = 0); - ~StopWatch(); - - const char* name() const; - nsecs_t lap(); - nsecs_t elapsedTime() const; - - void reset(); - -private: - const char* mName; - int mClock; - uint32_t mFlags; - - struct lap_t { - nsecs_t soFar; - nsecs_t thisLap; - }; - - nsecs_t mStartTime; - lap_t mLaps[8]; - int mNumLaps; -}; - - -}; // namespace android - - -// --------------------------------------------------------------------------- - -#endif // ANDROID_STOPWATCH_H diff --git a/external/android/include/19/system/core/include/utils/String16.h b/external/android/include/19/system/core/include/utils/String16.h deleted file mode 100644 index d131bfc..0000000 --- a/external/android/include/19/system/core/include/utils/String16.h +++ /dev/null @@ -1,250 +0,0 @@ -/* - * Copyright (C) 2005 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_STRING16_H -#define ANDROID_STRING16_H - -#include -#include -#include -#include - -// --------------------------------------------------------------------------- - -extern "C" { - -} - -// --------------------------------------------------------------------------- - -namespace android { - -// --------------------------------------------------------------------------- - -class String8; -class TextOutput; - -//! This is a string holding UTF-16 characters. -class String16 -{ -public: - /* use String16(StaticLinkage) if you're statically linking against - * libutils and declaring an empty static String16, e.g.: - * - * static String16 sAStaticEmptyString(String16::kEmptyString); - * static String16 sAnotherStaticEmptyString(sAStaticEmptyString); - */ - enum StaticLinkage { kEmptyString }; - - String16(); - explicit String16(StaticLinkage); - String16(const String16& o); - String16(const String16& o, - size_t len, - size_t begin=0); - explicit String16(const char16_t* o); - explicit String16(const char16_t* o, size_t len); - explicit String16(const String8& o); - explicit String16(const char* o); - explicit String16(const char* o, size_t len); - - ~String16(); - - inline const char16_t* string() const; - inline size_t size() const; - - inline const SharedBuffer* sharedBuffer() const; - - void setTo(const String16& other); - status_t setTo(const char16_t* other); - status_t setTo(const char16_t* other, size_t len); - status_t setTo(const String16& other, - size_t len, - size_t begin=0); - - status_t append(const String16& other); - status_t append(const char16_t* other, size_t len); - - inline String16& operator=(const String16& other); - - inline String16& operator+=(const String16& other); - inline String16 operator+(const String16& other) const; - - status_t insert(size_t pos, const char16_t* chrs); - status_t insert(size_t pos, - const char16_t* chrs, size_t len); - - ssize_t findFirst(char16_t c) const; - ssize_t findLast(char16_t c) const; - - bool startsWith(const String16& prefix) const; - bool startsWith(const char16_t* prefix) const; - - status_t makeLower(); - - status_t replaceAll(char16_t replaceThis, - char16_t withThis); - - status_t remove(size_t len, size_t begin=0); - - inline int compare(const String16& other) const; - - inline bool operator<(const String16& other) const; - inline bool operator<=(const String16& other) const; - inline bool operator==(const String16& other) const; - inline bool operator!=(const String16& other) const; - inline bool operator>=(const String16& other) const; - inline bool operator>(const String16& other) const; - - inline bool operator<(const char16_t* other) const; - inline bool operator<=(const char16_t* other) const; - inline bool operator==(const char16_t* other) const; - inline bool operator!=(const char16_t* other) const; - inline bool operator>=(const char16_t* other) const; - inline bool operator>(const char16_t* other) const; - - inline operator const char16_t*() const; - -private: - const char16_t* mString; -}; - -// String16 can be trivially moved using memcpy() because moving does not -// require any change to the underlying SharedBuffer contents or reference count. -ANDROID_TRIVIAL_MOVE_TRAIT(String16) - -// --------------------------------------------------------------------------- -// No user servicable parts below. - -inline int compare_type(const String16& lhs, const String16& rhs) -{ - return lhs.compare(rhs); -} - -inline int strictly_order_type(const String16& lhs, const String16& rhs) -{ - return compare_type(lhs, rhs) < 0; -} - -inline const char16_t* String16::string() const -{ - return mString; -} - -inline size_t String16::size() const -{ - return SharedBuffer::sizeFromData(mString)/sizeof(char16_t)-1; -} - -inline const SharedBuffer* String16::sharedBuffer() const -{ - return SharedBuffer::bufferFromData(mString); -} - -inline String16& String16::operator=(const String16& other) -{ - setTo(other); - return *this; -} - -inline String16& String16::operator+=(const String16& other) -{ - append(other); - return *this; -} - -inline String16 String16::operator+(const String16& other) const -{ - String16 tmp(*this); - tmp += other; - return tmp; -} - -inline int String16::compare(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()); -} - -inline bool String16::operator<(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()) < 0; -} - -inline bool String16::operator<=(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()) <= 0; -} - -inline bool String16::operator==(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()) == 0; -} - -inline bool String16::operator!=(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()) != 0; -} - -inline bool String16::operator>=(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()) >= 0; -} - -inline bool String16::operator>(const String16& other) const -{ - return strzcmp16(mString, size(), other.mString, other.size()) > 0; -} - -inline bool String16::operator<(const char16_t* other) const -{ - return strcmp16(mString, other) < 0; -} - -inline bool String16::operator<=(const char16_t* other) const -{ - return strcmp16(mString, other) <= 0; -} - -inline bool String16::operator==(const char16_t* other) const -{ - return strcmp16(mString, other) == 0; -} - -inline bool String16::operator!=(const char16_t* other) const -{ - return strcmp16(mString, other) != 0; -} - -inline bool String16::operator>=(const char16_t* other) const -{ - return strcmp16(mString, other) >= 0; -} - -inline bool String16::operator>(const char16_t* other) const -{ - return strcmp16(mString, other) > 0; -} - -inline String16::operator const char16_t*() const -{ - return mString; -} - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_STRING16_H diff --git a/external/android/include/19/system/core/include/utils/String8.h b/external/android/include/19/system/core/include/utils/String8.h deleted file mode 100644 index ef59470..0000000 --- a/external/android/include/19/system/core/include/utils/String8.h +++ /dev/null @@ -1,395 +0,0 @@ -/* - * Copyright (C) 2005 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_STRING8_H -#define ANDROID_STRING8_H - -#include -#include -#include -#include - -#include // for strcmp -#include - -// --------------------------------------------------------------------------- - -namespace android { - -class String16; -class TextOutput; - -//! This is a string holding UTF-8 characters. Does not allow the value more -// than 0x10FFFF, which is not valid unicode codepoint. -class String8 -{ -public: - /* use String8(StaticLinkage) if you're statically linking against - * libutils and declaring an empty static String8, e.g.: - * - * static String8 sAStaticEmptyString(String8::kEmptyString); - * static String8 sAnotherStaticEmptyString(sAStaticEmptyString); - */ - enum StaticLinkage { kEmptyString }; - - String8(); - explicit String8(StaticLinkage); - String8(const String8& o); - explicit String8(const char* o); - explicit String8(const char* o, size_t numChars); - - explicit String8(const String16& o); - explicit String8(const char16_t* o); - explicit String8(const char16_t* o, size_t numChars); - explicit String8(const char32_t* o); - explicit String8(const char32_t* o, size_t numChars); - ~String8(); - - static inline const String8 empty(); - - static String8 format(const char* fmt, ...) __attribute__((format (printf, 1, 2))); - static String8 formatV(const char* fmt, va_list args); - - inline const char* string() const; - inline size_t size() const; - inline size_t length() const; - inline size_t bytes() const; - inline bool isEmpty() const; - - inline const SharedBuffer* sharedBuffer() const; - - void clear(); - - void setTo(const String8& other); - status_t setTo(const char* other); - status_t setTo(const char* other, size_t numChars); - status_t setTo(const char16_t* other, size_t numChars); - status_t setTo(const char32_t* other, - size_t length); - - status_t append(const String8& other); - status_t append(const char* other); - status_t append(const char* other, size_t numChars); - - status_t appendFormat(const char* fmt, ...) - __attribute__((format (printf, 2, 3))); - status_t appendFormatV(const char* fmt, va_list args); - - // Note that this function takes O(N) time to calculate the value. - // No cache value is stored. - size_t getUtf32Length() const; - int32_t getUtf32At(size_t index, - size_t *next_index) const; - void getUtf32(char32_t* dst) const; - - inline String8& operator=(const String8& other); - inline String8& operator=(const char* other); - - inline String8& operator+=(const String8& other); - inline String8 operator+(const String8& other) const; - - inline String8& operator+=(const char* other); - inline String8 operator+(const char* other) const; - - inline int compare(const String8& other) const; - - inline bool operator<(const String8& other) const; - inline bool operator<=(const String8& other) const; - inline bool operator==(const String8& other) const; - inline bool operator!=(const String8& other) const; - inline bool operator>=(const String8& other) const; - inline bool operator>(const String8& other) const; - - inline bool operator<(const char* other) const; - inline bool operator<=(const char* other) const; - inline bool operator==(const char* other) const; - inline bool operator!=(const char* other) const; - inline bool operator>=(const char* other) const; - inline bool operator>(const char* other) const; - - inline operator const char*() const; - - char* lockBuffer(size_t size); - void unlockBuffer(); - status_t unlockBuffer(size_t size); - - // return the index of the first byte of other in this at or after - // start, or -1 if not found - ssize_t find(const char* other, size_t start = 0) const; - - void toLower(); - void toLower(size_t start, size_t numChars); - void toUpper(); - void toUpper(size_t start, size_t numChars); - - /* - * These methods operate on the string as if it were a path name. - */ - - /* - * Set the filename field to a specific value. - * - * Normalizes the filename, removing a trailing '/' if present. - */ - void setPathName(const char* name); - void setPathName(const char* name, size_t numChars); - - /* - * Get just the filename component. - * - * "/tmp/foo/bar.c" --> "bar.c" - */ - String8 getPathLeaf(void) const; - - /* - * Remove the last (file name) component, leaving just the directory - * name. - * - * "/tmp/foo/bar.c" --> "/tmp/foo" - * "/tmp" --> "" // ????? shouldn't this be "/" ???? XXX - * "bar.c" --> "" - */ - String8 getPathDir(void) const; - - /* - * Retrieve the front (root dir) component. Optionally also return the - * remaining components. - * - * "/tmp/foo/bar.c" --> "tmp" (remain = "foo/bar.c") - * "/tmp" --> "tmp" (remain = "") - * "bar.c" --> "bar.c" (remain = "") - */ - String8 walkPath(String8* outRemains = NULL) const; - - /* - * Return the filename extension. This is the last '.' and any number - * of characters that follow it. The '.' is included in case we - * decide to expand our definition of what constitutes an extension. - * - * "/tmp/foo/bar.c" --> ".c" - * "/tmp" --> "" - * "/tmp/foo.bar/baz" --> "" - * "foo.jpeg" --> ".jpeg" - * "foo." --> "" - */ - String8 getPathExtension(void) const; - - /* - * Return the path without the extension. Rules for what constitutes - * an extension are described in the comment for getPathExtension(). - * - * "/tmp/foo/bar.c" --> "/tmp/foo/bar" - */ - String8 getBasePath(void) const; - - /* - * Add a component to the pathname. We guarantee that there is - * exactly one path separator between the old path and the new. - * If there is no existing name, we just copy the new name in. - * - * If leaf is a fully qualified path (i.e. starts with '/', it - * replaces whatever was there before. - */ - String8& appendPath(const char* leaf); - String8& appendPath(const String8& leaf) { return appendPath(leaf.string()); } - - /* - * Like appendPath(), but does not affect this string. Returns a new one instead. - */ - String8 appendPathCopy(const char* leaf) const - { String8 p(*this); p.appendPath(leaf); return p; } - String8 appendPathCopy(const String8& leaf) const { return appendPathCopy(leaf.string()); } - - /* - * Converts all separators in this string to /, the default path separator. - * - * If the default OS separator is backslash, this converts all - * backslashes to slashes, in-place. Otherwise it does nothing. - * Returns self. - */ - String8& convertToResPath(); - -private: - status_t real_append(const char* other, size_t numChars); - char* find_extension(void) const; - - const char* mString; -}; - -// String8 can be trivially moved using memcpy() because moving does not -// require any change to the underlying SharedBuffer contents or reference count. -ANDROID_TRIVIAL_MOVE_TRAIT(String8) - -// --------------------------------------------------------------------------- -// No user servicable parts below. - -inline int compare_type(const String8& lhs, const String8& rhs) -{ - return lhs.compare(rhs); -} - -inline int strictly_order_type(const String8& lhs, const String8& rhs) -{ - return compare_type(lhs, rhs) < 0; -} - -inline const String8 String8::empty() { - return String8(); -} - -inline const char* String8::string() const -{ - return mString; -} - -inline size_t String8::length() const -{ - return SharedBuffer::sizeFromData(mString)-1; -} - -inline size_t String8::size() const -{ - return length(); -} - -inline bool String8::isEmpty() const -{ - return length() == 0; -} - -inline size_t String8::bytes() const -{ - return SharedBuffer::sizeFromData(mString)-1; -} - -inline const SharedBuffer* String8::sharedBuffer() const -{ - return SharedBuffer::bufferFromData(mString); -} - -inline String8& String8::operator=(const String8& other) -{ - setTo(other); - return *this; -} - -inline String8& String8::operator=(const char* other) -{ - setTo(other); - return *this; -} - -inline String8& String8::operator+=(const String8& other) -{ - append(other); - return *this; -} - -inline String8 String8::operator+(const String8& other) const -{ - String8 tmp(*this); - tmp += other; - return tmp; -} - -inline String8& String8::operator+=(const char* other) -{ - append(other); - return *this; -} - -inline String8 String8::operator+(const char* other) const -{ - String8 tmp(*this); - tmp += other; - return tmp; -} - -inline int String8::compare(const String8& other) const -{ - return strcmp(mString, other.mString); -} - -inline bool String8::operator<(const String8& other) const -{ - return strcmp(mString, other.mString) < 0; -} - -inline bool String8::operator<=(const String8& other) const -{ - return strcmp(mString, other.mString) <= 0; -} - -inline bool String8::operator==(const String8& other) const -{ - return strcmp(mString, other.mString) == 0; -} - -inline bool String8::operator!=(const String8& other) const -{ - return strcmp(mString, other.mString) != 0; -} - -inline bool String8::operator>=(const String8& other) const -{ - return strcmp(mString, other.mString) >= 0; -} - -inline bool String8::operator>(const String8& other) const -{ - return strcmp(mString, other.mString) > 0; -} - -inline bool String8::operator<(const char* other) const -{ - return strcmp(mString, other) < 0; -} - -inline bool String8::operator<=(const char* other) const -{ - return strcmp(mString, other) <= 0; -} - -inline bool String8::operator==(const char* other) const -{ - return strcmp(mString, other) == 0; -} - -inline bool String8::operator!=(const char* other) const -{ - return strcmp(mString, other) != 0; -} - -inline bool String8::operator>=(const char* other) const -{ - return strcmp(mString, other) >= 0; -} - -inline bool String8::operator>(const char* other) const -{ - return strcmp(mString, other) > 0; -} - -inline String8::operator const char*() const -{ - return mString; -} - -} // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_STRING8_H diff --git a/external/android/include/19/system/core/include/utils/StrongPointer.h b/external/android/include/19/system/core/include/utils/StrongPointer.h deleted file mode 100644 index aba9577..0000000 --- a/external/android/include/19/system/core/include/utils/StrongPointer.h +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Copyright (C) 2005 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_STRONG_POINTER_H -#define ANDROID_STRONG_POINTER_H - -#include - -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { - -template class wp; - -// --------------------------------------------------------------------------- - -#define COMPARE(_op_) \ -inline bool operator _op_ (const sp& o) const { \ - return m_ptr _op_ o.m_ptr; \ -} \ -inline bool operator _op_ (const T* o) const { \ - return m_ptr _op_ o; \ -} \ -template \ -inline bool operator _op_ (const sp& o) const { \ - return m_ptr _op_ o.m_ptr; \ -} \ -template \ -inline bool operator _op_ (const U* o) const { \ - return m_ptr _op_ o; \ -} \ -inline bool operator _op_ (const wp& o) const { \ - return m_ptr _op_ o.m_ptr; \ -} \ -template \ -inline bool operator _op_ (const wp& o) const { \ - return m_ptr _op_ o.m_ptr; \ -} - -// --------------------------------------------------------------------------- - -template -class sp { -public: - inline sp() : m_ptr(0) { } - - sp(T* other); - sp(const sp& other); - template sp(U* other); - template sp(const sp& other); - - ~sp(); - - // Assignment - - sp& operator = (T* other); - sp& operator = (const sp& other); - - template sp& operator = (const sp& other); - template sp& operator = (U* other); - - //! Special optimization for use by ProcessState (and nobody else). - void force_set(T* other); - - // Reset - - void clear(); - - // Accessors - - inline T& operator* () const { return *m_ptr; } - inline T* operator-> () const { return m_ptr; } - inline T* get() const { return m_ptr; } - - // Operators - - COMPARE(==) - COMPARE(!=) - COMPARE(>) - COMPARE(<) - COMPARE(<=) - COMPARE(>=) - -private: - template friend class sp; - template friend class wp; - void set_pointer(T* ptr); - T* m_ptr; -}; - -#undef COMPARE - -// --------------------------------------------------------------------------- -// No user serviceable parts below here. - -template -sp::sp(T* other) - : m_ptr(other) { - if (other) - other->incStrong(this); -} - -template -sp::sp(const sp& other) - : m_ptr(other.m_ptr) { - if (m_ptr) - m_ptr->incStrong(this); -} - -template template -sp::sp(U* other) - : m_ptr(other) { - if (other) - ((T*) other)->incStrong(this); -} - -template template -sp::sp(const sp& other) - : m_ptr(other.m_ptr) { - if (m_ptr) - m_ptr->incStrong(this); -} - -template -sp::~sp() { - if (m_ptr) - m_ptr->decStrong(this); -} - -template -sp& sp::operator =(const sp& other) { - T* otherPtr(other.m_ptr); - if (otherPtr) - otherPtr->incStrong(this); - if (m_ptr) - m_ptr->decStrong(this); - m_ptr = otherPtr; - return *this; -} - -template -sp& sp::operator =(T* other) { - if (other) - other->incStrong(this); - if (m_ptr) - m_ptr->decStrong(this); - m_ptr = other; - return *this; -} - -template template -sp& sp::operator =(const sp& other) { - T* otherPtr(other.m_ptr); - if (otherPtr) - otherPtr->incStrong(this); - if (m_ptr) - m_ptr->decStrong(this); - m_ptr = otherPtr; - return *this; -} - -template template -sp& sp::operator =(U* other) { - if (other) - ((T*) other)->incStrong(this); - if (m_ptr) - m_ptr->decStrong(this); - m_ptr = other; - return *this; -} - -template -void sp::force_set(T* other) { - other->forceIncStrong(this); - m_ptr = other; -} - -template -void sp::clear() { - if (m_ptr) { - m_ptr->decStrong(this); - m_ptr = 0; - } -} - -template -void sp::set_pointer(T* ptr) { - m_ptr = ptr; -} - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_STRONG_POINTER_H diff --git a/external/android/include/19/system/core/include/utils/SystemClock.h b/external/android/include/19/system/core/include/utils/SystemClock.h deleted file mode 100644 index 01db340..0000000 --- a/external/android/include/19/system/core/include/utils/SystemClock.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ - -#ifndef ANDROID_UTILS_SYSTEMCLOCK_H -#define ANDROID_UTILS_SYSTEMCLOCK_H - -#include -#include - -namespace android { - -int64_t uptimeMillis(); -int64_t elapsedRealtime(); -int64_t elapsedRealtimeNano(); - -}; // namespace android - -#endif // ANDROID_UTILS_SYSTEMCLOCK_H - diff --git a/external/android/include/19/system/core/include/utils/Thread.h b/external/android/include/19/system/core/include/utils/Thread.h deleted file mode 100644 index df30611..0000000 --- a/external/android/include/19/system/core/include/utils/Thread.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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 _LIBS_UTILS_THREAD_H -#define _LIBS_UTILS_THREAD_H - -#include -#include -#include - -#if defined(HAVE_PTHREADS) -# include -#endif - -#include -#include -#include -#include -#include -#include - -// --------------------------------------------------------------------------- -namespace android { -// --------------------------------------------------------------------------- - -class Thread : virtual public RefBase -{ -public: - // Create a Thread object, but doesn't create or start the associated - // thread. See the run() method. - Thread(bool canCallJava = true); - virtual ~Thread(); - - // Start the thread in threadLoop() which needs to be implemented. - virtual status_t run( const char* name = 0, - int32_t priority = PRIORITY_DEFAULT, - size_t stack = 0); - - // Ask this object's thread to exit. This function is asynchronous, when the - // function returns the thread might still be running. Of course, this - // function can be called from a different thread. - virtual void requestExit(); - - // Good place to do one-time initializations - virtual status_t readyToRun(); - - // Call requestExit() and wait until this object's thread exits. - // BE VERY CAREFUL of deadlocks. In particular, it would be silly to call - // this function from this object's thread. Will return WOULD_BLOCK in - // that case. - status_t requestExitAndWait(); - - // Wait until this object's thread exits. Returns immediately if not yet running. - // Do not call from this object's thread; will return WOULD_BLOCK in that case. - status_t join(); - - // Indicates whether this thread is running or not. - bool isRunning() const; - -#ifdef HAVE_ANDROID_OS - // Return the thread's kernel ID, same as the thread itself calling gettid() or - // androidGetTid(), or -1 if the thread is not running. - pid_t getTid() const; -#endif - -protected: - // exitPending() returns true if requestExit() has been called. - bool exitPending() const; - -private: - // Derived class must implement threadLoop(). The thread starts its life - // here. There are two ways of using the Thread object: - // 1) loop: if threadLoop() returns true, it will be called again if - // requestExit() wasn't called. - // 2) once: if threadLoop() returns false, the thread will exit upon return. - virtual bool threadLoop() = 0; - -private: - Thread& operator=(const Thread&); - static int _threadLoop(void* user); - const bool mCanCallJava; - // always hold mLock when reading or writing - thread_id_t mThread; - mutable Mutex mLock; - Condition mThreadExitedCondition; - status_t mStatus; - // note that all accesses of mExitPending and mRunning need to hold mLock - volatile bool mExitPending; - volatile bool mRunning; - sp mHoldSelf; -#ifdef HAVE_ANDROID_OS - // legacy for debugging, not used by getTid() as it is set by the child thread - // and so is not initialized until the child reaches that point - pid_t mTid; -#endif -}; - - -}; // namespace android - -// --------------------------------------------------------------------------- -#endif // _LIBS_UTILS_THREAD_H -// --------------------------------------------------------------------------- diff --git a/external/android/include/19/system/core/include/utils/ThreadDefs.h b/external/android/include/19/system/core/include/utils/ThreadDefs.h deleted file mode 100644 index 9711c13..0000000 --- a/external/android/include/19/system/core/include/utils/ThreadDefs.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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 _LIBS_UTILS_THREAD_DEFS_H -#define _LIBS_UTILS_THREAD_DEFS_H - -#include -#include -#include -#include - -// --------------------------------------------------------------------------- -// C API - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void* android_thread_id_t; - -typedef int (*android_thread_func_t)(void*); - -#ifdef __cplusplus -} // extern "C" -#endif - -// --------------------------------------------------------------------------- -// C++ API -#ifdef __cplusplus -namespace android { -// --------------------------------------------------------------------------- - -typedef android_thread_id_t thread_id_t; -typedef android_thread_func_t thread_func_t; - -enum { - PRIORITY_LOWEST = ANDROID_PRIORITY_LOWEST, - PRIORITY_BACKGROUND = ANDROID_PRIORITY_BACKGROUND, - PRIORITY_NORMAL = ANDROID_PRIORITY_NORMAL, - PRIORITY_FOREGROUND = ANDROID_PRIORITY_FOREGROUND, - PRIORITY_DISPLAY = ANDROID_PRIORITY_DISPLAY, - PRIORITY_URGENT_DISPLAY = ANDROID_PRIORITY_URGENT_DISPLAY, - PRIORITY_AUDIO = ANDROID_PRIORITY_AUDIO, - PRIORITY_URGENT_AUDIO = ANDROID_PRIORITY_URGENT_AUDIO, - PRIORITY_HIGHEST = ANDROID_PRIORITY_HIGHEST, - PRIORITY_DEFAULT = ANDROID_PRIORITY_DEFAULT, - PRIORITY_MORE_FAVORABLE = ANDROID_PRIORITY_MORE_FAVORABLE, - PRIORITY_LESS_FAVORABLE = ANDROID_PRIORITY_LESS_FAVORABLE, -}; - -// --------------------------------------------------------------------------- -}; // namespace android -#endif // __cplusplus -// --------------------------------------------------------------------------- - - -#endif // _LIBS_UTILS_THREAD_DEFS_H diff --git a/external/android/include/19/system/core/include/utils/Timers.h b/external/android/include/19/system/core/include/utils/Timers.h deleted file mode 100644 index d015421..0000000 --- a/external/android/include/19/system/core/include/utils/Timers.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// Timer functions. -// -#ifndef _LIBS_UTILS_TIMERS_H -#define _LIBS_UTILS_TIMERS_H - -#include -#include -#include - -// ------------------------------------------------------------------ -// C API - -#ifdef __cplusplus -extern "C" { -#endif - -typedef int64_t nsecs_t; // nano-seconds - -static inline nsecs_t seconds_to_nanoseconds(nsecs_t secs) -{ - return secs*1000000000; -} - -static inline nsecs_t milliseconds_to_nanoseconds(nsecs_t secs) -{ - return secs*1000000; -} - -static inline nsecs_t microseconds_to_nanoseconds(nsecs_t secs) -{ - return secs*1000; -} - -static inline nsecs_t nanoseconds_to_seconds(nsecs_t secs) -{ - return secs/1000000000; -} - -static inline nsecs_t nanoseconds_to_milliseconds(nsecs_t secs) -{ - return secs/1000000; -} - -static inline nsecs_t nanoseconds_to_microseconds(nsecs_t secs) -{ - return secs/1000; -} - -static inline nsecs_t s2ns(nsecs_t v) {return seconds_to_nanoseconds(v);} -static inline nsecs_t ms2ns(nsecs_t v) {return milliseconds_to_nanoseconds(v);} -static inline nsecs_t us2ns(nsecs_t v) {return microseconds_to_nanoseconds(v);} -static inline nsecs_t ns2s(nsecs_t v) {return nanoseconds_to_seconds(v);} -static inline nsecs_t ns2ms(nsecs_t v) {return nanoseconds_to_milliseconds(v);} -static inline nsecs_t ns2us(nsecs_t v) {return nanoseconds_to_microseconds(v);} - -static inline nsecs_t seconds(nsecs_t v) { return s2ns(v); } -static inline nsecs_t milliseconds(nsecs_t v) { return ms2ns(v); } -static inline nsecs_t microseconds(nsecs_t v) { return us2ns(v); } - -enum { - SYSTEM_TIME_REALTIME = 0, // system-wide realtime clock - SYSTEM_TIME_MONOTONIC = 1, // monotonic time since unspecified starting point - SYSTEM_TIME_PROCESS = 2, // high-resolution per-process clock - SYSTEM_TIME_THREAD = 3, // high-resolution per-thread clock - SYSTEM_TIME_BOOTTIME = 4 // same as SYSTEM_TIME_MONOTONIC, but including CPU suspend time -}; - -// return the system-time according to the specified clock -#ifdef __cplusplus -nsecs_t systemTime(int clock = SYSTEM_TIME_MONOTONIC); -#else -nsecs_t systemTime(int clock); -#endif // def __cplusplus - -/** - * Returns the number of milliseconds to wait between the reference time and the timeout time. - * If the timeout is in the past relative to the reference time, returns 0. - * If the timeout is more than INT_MAX milliseconds in the future relative to the reference time, - * such as when timeoutTime == LLONG_MAX, returns -1 to indicate an infinite timeout delay. - * Otherwise, returns the difference between the reference time and timeout time - * rounded up to the next millisecond. - */ -int toMillisecondTimeoutDelay(nsecs_t referenceTime, nsecs_t timeoutTime); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _LIBS_UTILS_TIMERS_H diff --git a/external/android/include/19/system/core/include/utils/Tokenizer.h b/external/android/include/19/system/core/include/utils/Tokenizer.h deleted file mode 100644 index bb25f37..0000000 --- a/external/android/include/19/system/core/include/utils/Tokenizer.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (C) 2010 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 _UTILS_TOKENIZER_H -#define _UTILS_TOKENIZER_H - -#include -#include -#include -#include - -namespace android { - -/** - * A simple tokenizer for loading and parsing ASCII text files line by line. - */ -class Tokenizer { - Tokenizer(const String8& filename, FileMap* fileMap, char* buffer, - bool ownBuffer, size_t length); - -public: - ~Tokenizer(); - - /** - * Opens a file and maps it into memory. - * - * Returns NO_ERROR and a tokenizer for the file, if successful. - * Otherwise returns an error and sets outTokenizer to NULL. - */ - static status_t open(const String8& filename, Tokenizer** outTokenizer); - - /** - * Prepares to tokenize the contents of a string. - * - * Returns NO_ERROR and a tokenizer for the string, if successful. - * Otherwise returns an error and sets outTokenizer to NULL. - */ - static status_t fromContents(const String8& filename, - const char* contents, Tokenizer** outTokenizer); - - /** - * Returns true if at the end of the file. - */ - inline bool isEof() const { return mCurrent == getEnd(); } - - /** - * Returns true if at the end of the line or end of the file. - */ - inline bool isEol() const { return isEof() || *mCurrent == '\n'; } - - /** - * Gets the name of the file. - */ - inline String8 getFilename() const { return mFilename; } - - /** - * Gets a 1-based line number index for the current position. - */ - inline int32_t getLineNumber() const { return mLineNumber; } - - /** - * Formats a location string consisting of the filename and current line number. - * Returns a string like "MyFile.txt:33". - */ - String8 getLocation() const; - - /** - * Gets the character at the current position. - * Returns null at end of file. - */ - inline char peekChar() const { return isEof() ? '\0' : *mCurrent; } - - /** - * Gets the remainder of the current line as a string, excluding the newline character. - */ - String8 peekRemainderOfLine() const; - - /** - * Gets the character at the current position and advances past it. - * Returns null at end of file. - */ - inline char nextChar() { return isEof() ? '\0' : *(mCurrent++); } - - /** - * Gets the next token on this line stopping at the specified delimiters - * or the end of the line whichever comes first and advances past it. - * Also stops at embedded nulls. - * Returns the token or an empty string if the current character is a delimiter - * or is at the end of the line. - */ - String8 nextToken(const char* delimiters); - - /** - * Advances to the next line. - * Does nothing if already at the end of the file. - */ - void nextLine(); - - /** - * Skips over the specified delimiters in the line. - * Also skips embedded nulls. - */ - void skipDelimiters(const char* delimiters); - -private: - Tokenizer(const Tokenizer& other); // not copyable - - String8 mFilename; - FileMap* mFileMap; - char* mBuffer; - bool mOwnBuffer; - size_t mLength; - - const char* mCurrent; - int32_t mLineNumber; - - inline const char* getEnd() const { return mBuffer + mLength; } - -}; - -} // namespace android - -#endif // _UTILS_TOKENIZER_H diff --git a/external/android/include/19/system/core/include/utils/Trace.h b/external/android/include/19/system/core/include/utils/Trace.h deleted file mode 100644 index 6ee343d..0000000 --- a/external/android/include/19/system/core/include/utils/Trace.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2012 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_TRACE_H -#define ANDROID_TRACE_H - -#ifdef HAVE_ANDROID_OS - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -// See for more ATRACE_* macros. - -// ATRACE_NAME traces the beginning and end of the current scope. To trace -// the correct start and end times this macro should be declared first in the -// scope body. -#define ATRACE_NAME(name) android::ScopedTrace ___tracer(ATRACE_TAG, name) -// ATRACE_CALL is an ATRACE_NAME that uses the current function name. -#define ATRACE_CALL() ATRACE_NAME(__FUNCTION__) - -namespace android { - -class ScopedTrace { -public: -inline ScopedTrace(uint64_t tag, const char* name) - : mTag(tag) { - atrace_begin(mTag,name); -} - -inline ~ScopedTrace() { - atrace_end(mTag); -} - -private: - uint64_t mTag; -}; - -}; // namespace android - -#else // HAVE_ANDROID_OS - -#define ATRACE_NAME(...) -#define ATRACE_CALL() - -#endif // HAVE_ANDROID_OS - -#endif // ANDROID_TRACE_H diff --git a/external/android/include/19/system/core/include/utils/TypeHelpers.h b/external/android/include/19/system/core/include/utils/TypeHelpers.h deleted file mode 100644 index 13c9081..0000000 --- a/external/android/include/19/system/core/include/utils/TypeHelpers.h +++ /dev/null @@ -1,302 +0,0 @@ -/* - * Copyright (C) 2005 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_TYPE_HELPERS_H -#define ANDROID_TYPE_HELPERS_H - -#include -#include -#include -#include - -// --------------------------------------------------------------------------- - -namespace android { - -/* - * Types traits - */ - -template struct trait_trivial_ctor { enum { value = false }; }; -template struct trait_trivial_dtor { enum { value = false }; }; -template struct trait_trivial_copy { enum { value = false }; }; -template struct trait_trivial_move { enum { value = false }; }; -template struct trait_pointer { enum { value = false }; }; -template struct trait_pointer { enum { value = true }; }; - -template -struct traits { - enum { - // whether this type is a pointer - is_pointer = trait_pointer::value, - // whether this type's constructor is a no-op - has_trivial_ctor = is_pointer || trait_trivial_ctor::value, - // whether this type's destructor is a no-op - has_trivial_dtor = is_pointer || trait_trivial_dtor::value, - // whether this type type can be copy-constructed with memcpy - has_trivial_copy = is_pointer || trait_trivial_copy::value, - // whether this type can be moved with memmove - has_trivial_move = is_pointer || trait_trivial_move::value - }; -}; - -template -struct aggregate_traits { - enum { - is_pointer = false, - has_trivial_ctor = - traits::has_trivial_ctor && traits::has_trivial_ctor, - has_trivial_dtor = - traits::has_trivial_dtor && traits::has_trivial_dtor, - has_trivial_copy = - traits::has_trivial_copy && traits::has_trivial_copy, - has_trivial_move = - traits::has_trivial_move && traits::has_trivial_move - }; -}; - -#define ANDROID_TRIVIAL_CTOR_TRAIT( T ) \ - template<> struct trait_trivial_ctor< T > { enum { value = true }; }; - -#define ANDROID_TRIVIAL_DTOR_TRAIT( T ) \ - template<> struct trait_trivial_dtor< T > { enum { value = true }; }; - -#define ANDROID_TRIVIAL_COPY_TRAIT( T ) \ - template<> struct trait_trivial_copy< T > { enum { value = true }; }; - -#define ANDROID_TRIVIAL_MOVE_TRAIT( T ) \ - template<> struct trait_trivial_move< T > { enum { value = true }; }; - -#define ANDROID_BASIC_TYPES_TRAITS( T ) \ - ANDROID_TRIVIAL_CTOR_TRAIT( T ) \ - ANDROID_TRIVIAL_DTOR_TRAIT( T ) \ - ANDROID_TRIVIAL_COPY_TRAIT( T ) \ - ANDROID_TRIVIAL_MOVE_TRAIT( T ) - -// --------------------------------------------------------------------------- - -/* - * basic types traits - */ - -ANDROID_BASIC_TYPES_TRAITS( void ) -ANDROID_BASIC_TYPES_TRAITS( bool ) -ANDROID_BASIC_TYPES_TRAITS( char ) -ANDROID_BASIC_TYPES_TRAITS( unsigned char ) -ANDROID_BASIC_TYPES_TRAITS( short ) -ANDROID_BASIC_TYPES_TRAITS( unsigned short ) -ANDROID_BASIC_TYPES_TRAITS( int ) -ANDROID_BASIC_TYPES_TRAITS( unsigned int ) -ANDROID_BASIC_TYPES_TRAITS( long ) -ANDROID_BASIC_TYPES_TRAITS( unsigned long ) -ANDROID_BASIC_TYPES_TRAITS( long long ) -ANDROID_BASIC_TYPES_TRAITS( unsigned long long ) -ANDROID_BASIC_TYPES_TRAITS( float ) -ANDROID_BASIC_TYPES_TRAITS( double ) - -// --------------------------------------------------------------------------- - - -/* - * compare and order types - */ - -template inline -int strictly_order_type(const TYPE& lhs, const TYPE& rhs) { - return (lhs < rhs) ? 1 : 0; -} - -template inline -int compare_type(const TYPE& lhs, const TYPE& rhs) { - return strictly_order_type(rhs, lhs) - strictly_order_type(lhs, rhs); -} - -/* - * create, destroy, copy and move types... - */ - -template inline -void construct_type(TYPE* p, size_t n) { - if (!traits::has_trivial_ctor) { - while (n--) { - new(p++) TYPE; - } - } -} - -template inline -void destroy_type(TYPE* p, size_t n) { - if (!traits::has_trivial_dtor) { - while (n--) { - p->~TYPE(); - p++; - } - } -} - -template inline -void copy_type(TYPE* d, const TYPE* s, size_t n) { - if (!traits::has_trivial_copy) { - while (n--) { - new(d) TYPE(*s); - d++, s++; - } - } else { - memcpy(d,s,n*sizeof(TYPE)); - } -} - -template inline -void splat_type(TYPE* where, const TYPE* what, size_t n) { - if (!traits::has_trivial_copy) { - while (n--) { - new(where) TYPE(*what); - where++; - } - } else { - while (n--) { - *where++ = *what; - } - } -} - -template inline -void move_forward_type(TYPE* d, const TYPE* s, size_t n = 1) { - if ((traits::has_trivial_dtor && traits::has_trivial_copy) - || traits::has_trivial_move) - { - memmove(d,s,n*sizeof(TYPE)); - } else { - d += n; - s += n; - while (n--) { - --d, --s; - if (!traits::has_trivial_copy) { - new(d) TYPE(*s); - } else { - *d = *s; - } - if (!traits::has_trivial_dtor) { - s->~TYPE(); - } - } - } -} - -template inline -void move_backward_type(TYPE* d, const TYPE* s, size_t n = 1) { - if ((traits::has_trivial_dtor && traits::has_trivial_copy) - || traits::has_trivial_move) - { - memmove(d,s,n*sizeof(TYPE)); - } else { - while (n--) { - if (!traits::has_trivial_copy) { - new(d) TYPE(*s); - } else { - *d = *s; - } - if (!traits::has_trivial_dtor) { - s->~TYPE(); - } - d++, s++; - } - } -} - -// --------------------------------------------------------------------------- - -/* - * a key/value pair - */ - -template -struct key_value_pair_t { - typedef KEY key_t; - typedef VALUE value_t; - - KEY key; - VALUE value; - key_value_pair_t() { } - key_value_pair_t(const key_value_pair_t& o) : key(o.key), value(o.value) { } - key_value_pair_t(const KEY& k, const VALUE& v) : key(k), value(v) { } - key_value_pair_t(const KEY& k) : key(k) { } - inline bool operator < (const key_value_pair_t& o) const { - return strictly_order_type(key, o.key); - } - inline const KEY& getKey() const { - return key; - } - inline const VALUE& getValue() const { - return value; - } -}; - -template -struct trait_trivial_ctor< key_value_pair_t > -{ enum { value = aggregate_traits::has_trivial_ctor }; }; -template -struct trait_trivial_dtor< key_value_pair_t > -{ enum { value = aggregate_traits::has_trivial_dtor }; }; -template -struct trait_trivial_copy< key_value_pair_t > -{ enum { value = aggregate_traits::has_trivial_copy }; }; -template -struct trait_trivial_move< key_value_pair_t > -{ enum { value = aggregate_traits::has_trivial_move }; }; - -// --------------------------------------------------------------------------- - -/* - * Hash codes. - */ -typedef uint32_t hash_t; - -template -hash_t hash_type(const TKey& key); - -/* Built-in hash code specializations. - * Assumes pointers are 32bit. */ -#define ANDROID_INT32_HASH(T) \ - template <> inline hash_t hash_type(const T& value) { return hash_t(value); } -#define ANDROID_INT64_HASH(T) \ - template <> inline hash_t hash_type(const T& value) { \ - return hash_t((value >> 32) ^ value); } -#define ANDROID_REINTERPRET_HASH(T, R) \ - template <> inline hash_t hash_type(const T& value) { \ - return hash_type(*reinterpret_cast(&value)); } - -ANDROID_INT32_HASH(bool) -ANDROID_INT32_HASH(int8_t) -ANDROID_INT32_HASH(uint8_t) -ANDROID_INT32_HASH(int16_t) -ANDROID_INT32_HASH(uint16_t) -ANDROID_INT32_HASH(int32_t) -ANDROID_INT32_HASH(uint32_t) -ANDROID_INT64_HASH(int64_t) -ANDROID_INT64_HASH(uint64_t) -ANDROID_REINTERPRET_HASH(float, uint32_t) -ANDROID_REINTERPRET_HASH(double, uint64_t) - -template inline hash_t hash_type(T* const & value) { - return hash_type(uintptr_t(value)); -} - -}; // namespace android - -// --------------------------------------------------------------------------- - -#endif // ANDROID_TYPE_HELPERS_H diff --git a/external/android/include/19/system/core/include/utils/Unicode.h b/external/android/include/19/system/core/include/utils/Unicode.h deleted file mode 100644 index c8c87c3..0000000 --- a/external/android/include/19/system/core/include/utils/Unicode.h +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright (C) 2005 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_UNICODE_H -#define ANDROID_UNICODE_H - -#include -#include - -extern "C" { - -typedef uint32_t char32_t; -typedef uint16_t char16_t; - -// Standard string functions on char16_t strings. -int strcmp16(const char16_t *, const char16_t *); -int strncmp16(const char16_t *s1, const char16_t *s2, size_t n); -size_t strlen16(const char16_t *); -size_t strnlen16(const char16_t *, size_t); -char16_t *strcpy16(char16_t *, const char16_t *); -char16_t *strncpy16(char16_t *, const char16_t *, size_t); - -// Version of comparison that supports embedded nulls. -// This is different than strncmp() because we don't stop -// at a nul character and consider the strings to be different -// if the lengths are different (thus we need to supply the -// lengths of both strings). This can also be used when -// your string is not nul-terminated as it will have the -// equivalent result as strcmp16 (unlike strncmp16). -int strzcmp16(const char16_t *s1, size_t n1, const char16_t *s2, size_t n2); - -// Version of strzcmp16 for comparing strings in different endianness. -int strzcmp16_h_n(const char16_t *s1H, size_t n1, const char16_t *s2N, size_t n2); - -// Standard string functions on char32_t strings. -size_t strlen32(const char32_t *); -size_t strnlen32(const char32_t *, size_t); - -/** - * Measure the length of a UTF-32 string in UTF-8. If the string is invalid - * such as containing a surrogate character, -1 will be returned. - */ -ssize_t utf32_to_utf8_length(const char32_t *src, size_t src_len); - -/** - * Stores a UTF-8 string converted from "src" in "dst", if "dst_length" is not - * large enough to store the string, the part of the "src" string is stored - * into "dst" as much as possible. See the examples for more detail. - * Returns the size actually used for storing the string. - * dst" is not null-terminated when dst_len is fully used (like strncpy). - * - * Example 1 - * "src" == \u3042\u3044 (\xE3\x81\x82\xE3\x81\x84) - * "src_len" == 2 - * "dst_len" >= 7 - * -> - * Returned value == 6 - * "dst" becomes \xE3\x81\x82\xE3\x81\x84\0 - * (note that "dst" is null-terminated) - * - * Example 2 - * "src" == \u3042\u3044 (\xE3\x81\x82\xE3\x81\x84) - * "src_len" == 2 - * "dst_len" == 5 - * -> - * Returned value == 3 - * "dst" becomes \xE3\x81\x82\0 - * (note that "dst" is null-terminated, but \u3044 is not stored in "dst" - * since "dst" does not have enough size to store the character) - * - * Example 3 - * "src" == \u3042\u3044 (\xE3\x81\x82\xE3\x81\x84) - * "src_len" == 2 - * "dst_len" == 6 - * -> - * Returned value == 6 - * "dst" becomes \xE3\x81\x82\xE3\x81\x84 - * (note that "dst" is NOT null-terminated, like strncpy) - */ -void utf32_to_utf8(const char32_t* src, size_t src_len, char* dst); - -/** - * Returns the unicode value at "index". - * Returns -1 when the index is invalid (equals to or more than "src_len"). - * If returned value is positive, it is able to be converted to char32_t, which - * is unsigned. Then, if "next_index" is not NULL, the next index to be used is - * stored in "next_index". "next_index" can be NULL. - */ -int32_t utf32_from_utf8_at(const char *src, size_t src_len, size_t index, size_t *next_index); - - -/** - * Returns the UTF-8 length of UTF-16 string "src". - */ -ssize_t utf16_to_utf8_length(const char16_t *src, size_t src_len); - -/** - * Converts a UTF-16 string to UTF-8. The destination buffer must be large - * enough to fit the UTF-16 as measured by utf16_to_utf8_length with an added - * NULL terminator. - */ -void utf16_to_utf8(const char16_t* src, size_t src_len, char* dst); - -/** - * Returns the length of "src" when "src" is valid UTF-8 string. - * Returns 0 if src is NULL or 0-length string. Returns -1 when the source - * is an invalid string. - * - * This function should be used to determine whether "src" is valid UTF-8 - * characters with valid unicode codepoints. "src" must be null-terminated. - * - * If you are going to use other utf8_to_... functions defined in this header - * with string which may not be valid UTF-8 with valid codepoint (form 0 to - * 0x10FFFF), you should use this function before calling others, since the - * other functions do not check whether the string is valid UTF-8 or not. - * - * If you do not care whether "src" is valid UTF-8 or not, you should use - * strlen() as usual, which should be much faster. - */ -ssize_t utf8_length(const char *src); - -/** - * Measure the length of a UTF-32 string. - */ -size_t utf8_to_utf32_length(const char *src, size_t src_len); - -/** - * Stores a UTF-32 string converted from "src" in "dst". "dst" must be large - * enough to store the entire converted string as measured by - * utf8_to_utf32_length plus space for a NULL terminator. - */ -void utf8_to_utf32(const char* src, size_t src_len, char32_t* dst); - -/** - * Returns the UTF-16 length of UTF-8 string "src". - */ -ssize_t utf8_to_utf16_length(const uint8_t* src, size_t srcLen); - -/** - * Convert UTF-8 to UTF-16 including surrogate pairs. - * Returns a pointer to the end of the string (where a null terminator might go - * if you wanted to add one). - */ -char16_t* utf8_to_utf16_no_null_terminator(const uint8_t* src, size_t srcLen, char16_t* dst); - -/** - * Convert UTF-8 to UTF-16 including surrogate pairs. The destination buffer - * must be large enough to hold the result as measured by utf8_to_utf16_length - * plus an added NULL terminator. - */ -void utf8_to_utf16(const uint8_t* src, size_t srcLen, char16_t* dst); - -/** - * Like utf8_to_utf16_no_null_terminator, but you can supply a maximum length of the - * decoded string. The decoded string will fill up to that length; if it is longer - * the returned pointer will be to the character after dstLen. - */ -char16_t* utf8_to_utf16_n(const uint8_t* src, size_t srcLen, char16_t* dst, size_t dstLen); - -} - -#endif diff --git a/external/android/include/19/system/core/include/utils/UniquePtr.h b/external/android/include/19/system/core/include/utils/UniquePtr.h deleted file mode 100644 index bc62fe6..0000000 --- a/external/android/include/19/system/core/include/utils/UniquePtr.h +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright (C) 2010 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. - */ - -/* === NOTE === NOTE === NOTE === NOTE === NOTE === NOTE === NOTE === NOTE === - * - * THIS IS A COPY OF libcore/include/UniquePtr.h AND AS SUCH THAT IS THE - * CANONICAL SOURCE OF THIS FILE. PLEASE KEEP THEM IN SYNC. - * - * === NOTE === NOTE === NOTE === NOTE === NOTE === NOTE === NOTE === NOTE === - */ - -#ifndef UNIQUE_PTR_H_included -#define UNIQUE_PTR_H_included - -#include // For NULL. - -// Default deleter for pointer types. -template -struct DefaultDelete { - enum { type_must_be_complete = sizeof(T) }; - DefaultDelete() {} - void operator()(T* p) const { - delete p; - } -}; - -// Default deleter for array types. -template -struct DefaultDelete { - enum { type_must_be_complete = sizeof(T) }; - void operator()(T* p) const { - delete[] p; - } -}; - -// A smart pointer that deletes the given pointer on destruction. -// Equivalent to C++0x's std::unique_ptr (a combination of boost::scoped_ptr -// and boost::scoped_array). -// Named to be in keeping with Android style but also to avoid -// collision with any other implementation, until we can switch over -// to unique_ptr. -// Use thus: -// UniquePtr c(new C); -template > -class UniquePtr { -public: - // Construct a new UniquePtr, taking ownership of the given raw pointer. - explicit UniquePtr(T* ptr = NULL) : mPtr(ptr) { - } - - ~UniquePtr() { - reset(); - } - - // Accessors. - T& operator*() const { return *mPtr; } - T* operator->() const { return mPtr; } - T* get() const { return mPtr; } - - // Returns the raw pointer and hands over ownership to the caller. - // The pointer will not be deleted by UniquePtr. - T* release() __attribute__((warn_unused_result)) { - T* result = mPtr; - mPtr = NULL; - return result; - } - - // Takes ownership of the given raw pointer. - // If this smart pointer previously owned a different raw pointer, that - // raw pointer will be freed. - void reset(T* ptr = NULL) { - if (ptr != mPtr) { - D()(mPtr); - mPtr = ptr; - } - } - -private: - // The raw pointer. - T* mPtr; - - // Comparing unique pointers is probably a mistake, since they're unique. - template bool operator==(const UniquePtr& p) const; - template bool operator!=(const UniquePtr& p) const; - - // Disallow copy and assignment. - UniquePtr(const UniquePtr&); - void operator=(const UniquePtr&); -}; - -// Partial specialization for array types. Like std::unique_ptr, this removes -// operator* and operator-> but adds operator[]. -template -class UniquePtr { -public: - explicit UniquePtr(T* ptr = NULL) : mPtr(ptr) { - } - - ~UniquePtr() { - reset(); - } - - T& operator[](size_t i) const { - return mPtr[i]; - } - T* get() const { return mPtr; } - - T* release() __attribute__((warn_unused_result)) { - T* result = mPtr; - mPtr = NULL; - return result; - } - - void reset(T* ptr = NULL) { - if (ptr != mPtr) { - D()(mPtr); - mPtr = ptr; - } - } - -private: - T* mPtr; - - // Disallow copy and assignment. - UniquePtr(const UniquePtr&); - void operator=(const UniquePtr&); -}; - -#if UNIQUE_PTR_TESTS - -// Run these tests with: -// g++ -g -DUNIQUE_PTR_TESTS -x c++ UniquePtr.h && ./a.out - -#include - -static void assert(bool b) { - if (!b) { - fprintf(stderr, "FAIL\n"); - abort(); - } - fprintf(stderr, "OK\n"); -} -static int cCount = 0; -struct C { - C() { ++cCount; } - ~C() { --cCount; } -}; -static bool freed = false; -struct Freer { - void operator()(int* p) { - assert(*p == 123); - free(p); - freed = true; - } -}; - -int main(int argc, char* argv[]) { - // - // UniquePtr tests... - // - - // Can we free a single object? - { - UniquePtr c(new C); - assert(cCount == 1); - } - assert(cCount == 0); - // Does release work? - C* rawC; - { - UniquePtr c(new C); - assert(cCount == 1); - rawC = c.release(); - } - assert(cCount == 1); - delete rawC; - // Does reset work? - { - UniquePtr c(new C); - assert(cCount == 1); - c.reset(new C); - assert(cCount == 1); - } - assert(cCount == 0); - - // - // UniquePtr tests... - // - - // Can we free an array? - { - UniquePtr cs(new C[4]); - assert(cCount == 4); - } - assert(cCount == 0); - // Does release work? - { - UniquePtr c(new C[4]); - assert(cCount == 4); - rawC = c.release(); - } - assert(cCount == 4); - delete[] rawC; - // Does reset work? - { - UniquePtr c(new C[4]); - assert(cCount == 4); - c.reset(new C[2]); - assert(cCount == 2); - } - assert(cCount == 0); - - // - // Custom deleter tests... - // - assert(!freed); - { - UniquePtr i(reinterpret_cast(malloc(sizeof(int)))); - *i = 123; - } - assert(freed); - return 0; -} -#endif - -#endif // UNIQUE_PTR_H_included diff --git a/external/android/include/19/system/core/include/utils/Vector.h b/external/android/include/19/system/core/include/utils/Vector.h deleted file mode 100644 index ed7b725..0000000 --- a/external/android/include/19/system/core/include/utils/Vector.h +++ /dev/null @@ -1,423 +0,0 @@ -/* - * Copyright (C) 2005 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_VECTOR_H -#define ANDROID_VECTOR_H - -#include -#include -#include - -#include - -#include -#include - -// --------------------------------------------------------------------------- - -namespace android { - -template -class SortedVector; - -/*! - * The main templated vector class ensuring type safety - * while making use of VectorImpl. - * This is the class users want to use. - */ - -template -class Vector : private VectorImpl -{ -public: - typedef TYPE value_type; - - /*! - * Constructors and destructors - */ - - Vector(); - Vector(const Vector& rhs); - explicit Vector(const SortedVector& rhs); - virtual ~Vector(); - - /*! copy operator */ - const Vector& operator = (const Vector& rhs) const; - Vector& operator = (const Vector& rhs); - - const Vector& operator = (const SortedVector& rhs) const; - Vector& operator = (const SortedVector& rhs); - - /* - * empty the vector - */ - - inline void clear() { VectorImpl::clear(); } - - /*! - * vector stats - */ - - //! returns number of items in the vector - inline size_t size() const { return VectorImpl::size(); } - //! returns whether or not the vector is empty - inline bool isEmpty() const { return VectorImpl::isEmpty(); } - //! returns how many items can be stored without reallocating the backing store - inline size_t capacity() const { return VectorImpl::capacity(); } - //! sets the capacity. capacity can never be reduced less than size() - inline ssize_t setCapacity(size_t size) { return VectorImpl::setCapacity(size); } - - /*! - * set the size of the vector. items are appended with the default - * constructor, or removed from the end as needed. - */ - inline ssize_t resize(size_t size) { return VectorImpl::resize(size); } - - /*! - * C-style array access - */ - - //! read-only C-style access - inline const TYPE* array() const; - //! read-write C-style access - TYPE* editArray(); - - /*! - * accessors - */ - - //! read-only access to an item at a given index - inline const TYPE& operator [] (size_t index) const; - //! alternate name for operator [] - inline const TYPE& itemAt(size_t index) const; - //! stack-usage of the vector. returns the top of the stack (last element) - const TYPE& top() const; - - /*! - * modifying the array - */ - - //! copy-on write support, grants write access to an item - TYPE& editItemAt(size_t index); - //! grants right access to the top of the stack (last element) - TYPE& editTop(); - - /*! - * append/insert another vector - */ - - //! insert another vector at a given index - ssize_t insertVectorAt(const Vector& vector, size_t index); - - //! append another vector at the end of this one - ssize_t appendVector(const Vector& vector); - - - //! insert an array at a given index - ssize_t insertArrayAt(const TYPE* array, size_t index, size_t length); - - //! append an array at the end of this vector - ssize_t appendArray(const TYPE* array, size_t length); - - /*! - * add/insert/replace items - */ - - //! insert one or several items initialized with their default constructor - inline ssize_t insertAt(size_t index, size_t numItems = 1); - //! insert one or several items initialized from a prototype item - ssize_t insertAt(const TYPE& prototype_item, size_t index, size_t numItems = 1); - //! pop the top of the stack (removes the last element). No-op if the stack's empty - inline void pop(); - //! pushes an item initialized with its default constructor - inline void push(); - //! pushes an item on the top of the stack - void push(const TYPE& item); - //! same as push() but returns the index the item was added at (or an error) - inline ssize_t add(); - //! same as push() but returns the index the item was added at (or an error) - ssize_t add(const TYPE& item); - //! replace an item with a new one initialized with its default constructor - inline ssize_t replaceAt(size_t index); - //! replace an item with a new one - ssize_t replaceAt(const TYPE& item, size_t index); - - /*! - * remove items - */ - - //! remove several items - inline ssize_t removeItemsAt(size_t index, size_t count = 1); - //! remove one item - inline ssize_t removeAt(size_t index) { return removeItemsAt(index); } - - /*! - * sort (stable) the array - */ - - typedef int (*compar_t)(const TYPE* lhs, const TYPE* rhs); - typedef int (*compar_r_t)(const TYPE* lhs, const TYPE* rhs, void* state); - - inline status_t sort(compar_t cmp); - inline status_t sort(compar_r_t cmp, void* state); - - // for debugging only - inline size_t getItemSize() const { return itemSize(); } - - - /* - * these inlines add some level of compatibility with STL. eventually - * we should probably turn things around. - */ - typedef TYPE* iterator; - typedef TYPE const* const_iterator; - - inline iterator begin() { return editArray(); } - inline iterator end() { return editArray() + size(); } - inline const_iterator begin() const { return array(); } - inline const_iterator end() const { return array() + size(); } - inline void reserve(size_t n) { setCapacity(n); } - inline bool empty() const{ return isEmpty(); } - inline void push_back(const TYPE& item) { insertAt(item, size(), 1); } - inline void push_front(const TYPE& item) { insertAt(item, 0, 1); } - inline iterator erase(iterator pos) { - ssize_t index = removeItemsAt(pos-array()); - return begin() + index; - } - -protected: - virtual void do_construct(void* storage, size_t num) const; - virtual void do_destroy(void* storage, size_t num) const; - virtual void do_copy(void* dest, const void* from, size_t num) const; - virtual void do_splat(void* dest, const void* item, size_t num) const; - virtual void do_move_forward(void* dest, const void* from, size_t num) const; - virtual void do_move_backward(void* dest, const void* from, size_t num) const; -}; - -// Vector can be trivially moved using memcpy() because moving does not -// require any change to the underlying SharedBuffer contents or reference count. -template struct trait_trivial_move > { enum { value = true }; }; - -// --------------------------------------------------------------------------- -// No user serviceable parts from here... -// --------------------------------------------------------------------------- - -template inline -Vector::Vector() - : VectorImpl(sizeof(TYPE), - ((traits::has_trivial_ctor ? HAS_TRIVIAL_CTOR : 0) - |(traits::has_trivial_dtor ? HAS_TRIVIAL_DTOR : 0) - |(traits::has_trivial_copy ? HAS_TRIVIAL_COPY : 0)) - ) -{ -} - -template inline -Vector::Vector(const Vector& rhs) - : VectorImpl(rhs) { -} - -template inline -Vector::Vector(const SortedVector& rhs) - : VectorImpl(static_cast(rhs)) { -} - -template inline -Vector::~Vector() { - finish_vector(); -} - -template inline -Vector& Vector::operator = (const Vector& rhs) { - VectorImpl::operator = (rhs); - return *this; -} - -template inline -const Vector& Vector::operator = (const Vector& rhs) const { - VectorImpl::operator = (static_cast(rhs)); - return *this; -} - -template inline -Vector& Vector::operator = (const SortedVector& rhs) { - VectorImpl::operator = (static_cast(rhs)); - return *this; -} - -template inline -const Vector& Vector::operator = (const SortedVector& rhs) const { - VectorImpl::operator = (rhs); - return *this; -} - -template inline -const TYPE* Vector::array() const { - return static_cast(arrayImpl()); -} - -template inline -TYPE* Vector::editArray() { - return static_cast(editArrayImpl()); -} - - -template inline -const TYPE& Vector::operator[](size_t index) const { - LOG_FATAL_IF(index>=size(), - "%s: index=%u out of range (%u)", __PRETTY_FUNCTION__, - int(index), int(size())); - return *(array() + index); -} - -template inline -const TYPE& Vector::itemAt(size_t index) const { - return operator[](index); -} - -template inline -const TYPE& Vector::top() const { - return *(array() + size() - 1); -} - -template inline -TYPE& Vector::editItemAt(size_t index) { - return *( static_cast(editItemLocation(index)) ); -} - -template inline -TYPE& Vector::editTop() { - return *( static_cast(editItemLocation(size()-1)) ); -} - -template inline -ssize_t Vector::insertVectorAt(const Vector& vector, size_t index) { - return VectorImpl::insertVectorAt(reinterpret_cast(vector), index); -} - -template inline -ssize_t Vector::appendVector(const Vector& vector) { - return VectorImpl::appendVector(reinterpret_cast(vector)); -} - -template inline -ssize_t Vector::insertArrayAt(const TYPE* array, size_t index, size_t length) { - return VectorImpl::insertArrayAt(array, index, length); -} - -template inline -ssize_t Vector::appendArray(const TYPE* array, size_t length) { - return VectorImpl::appendArray(array, length); -} - -template inline -ssize_t Vector::insertAt(const TYPE& item, size_t index, size_t numItems) { - return VectorImpl::insertAt(&item, index, numItems); -} - -template inline -void Vector::push(const TYPE& item) { - return VectorImpl::push(&item); -} - -template inline -ssize_t Vector::add(const TYPE& item) { - return VectorImpl::add(&item); -} - -template inline -ssize_t Vector::replaceAt(const TYPE& item, size_t index) { - return VectorImpl::replaceAt(&item, index); -} - -template inline -ssize_t Vector::insertAt(size_t index, size_t numItems) { - return VectorImpl::insertAt(index, numItems); -} - -template inline -void Vector::pop() { - VectorImpl::pop(); -} - -template inline -void Vector::push() { - VectorImpl::push(); -} - -template inline -ssize_t Vector::add() { - return VectorImpl::add(); -} - -template inline -ssize_t Vector::replaceAt(size_t index) { - return VectorImpl::replaceAt(index); -} - -template inline -ssize_t Vector::removeItemsAt(size_t index, size_t count) { - return VectorImpl::removeItemsAt(index, count); -} - -template inline -status_t Vector::sort(Vector::compar_t cmp) { - return VectorImpl::sort((VectorImpl::compar_t)cmp); -} - -template inline -status_t Vector::sort(Vector::compar_r_t cmp, void* state) { - return VectorImpl::sort((VectorImpl::compar_r_t)cmp, state); -} - -// --------------------------------------------------------------------------- - -template -void Vector::do_construct(void* storage, size_t num) const { - construct_type( reinterpret_cast(storage), num ); -} - -template -void Vector::do_destroy(void* storage, size_t num) const { - destroy_type( reinterpret_cast(storage), num ); -} - -template -void Vector::do_copy(void* dest, const void* from, size_t num) const { - copy_type( reinterpret_cast(dest), reinterpret_cast(from), num ); -} - -template -void Vector::do_splat(void* dest, const void* item, size_t num) const { - splat_type( reinterpret_cast(dest), reinterpret_cast(item), num ); -} - -template -void Vector::do_move_forward(void* dest, const void* from, size_t num) const { - move_forward_type( reinterpret_cast(dest), reinterpret_cast(from), num ); -} - -template -void Vector::do_move_backward(void* dest, const void* from, size_t num) const { - move_backward_type( reinterpret_cast(dest), reinterpret_cast(from), num ); -} - -}; // namespace android - - -// --------------------------------------------------------------------------- - -#endif // ANDROID_VECTOR_H diff --git a/external/android/include/19/system/core/include/utils/VectorImpl.h b/external/android/include/19/system/core/include/utils/VectorImpl.h deleted file mode 100644 index 21ad71c..0000000 --- a/external/android/include/19/system/core/include/utils/VectorImpl.h +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (C) 2005 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_VECTOR_IMPL_H -#define ANDROID_VECTOR_IMPL_H - -#include -#include -#include -#include - -// --------------------------------------------------------------------------- -// No user serviceable parts in here... -// --------------------------------------------------------------------------- - -namespace android { - -/*! - * Implementation of the guts of the vector<> class - * this ensures backward binary compatibility and - * reduces code size. - * For performance reasons, we expose mStorage and mCount - * so these fields are set in stone. - * - */ - -class VectorImpl -{ -public: - enum { // flags passed to the ctor - HAS_TRIVIAL_CTOR = 0x00000001, - HAS_TRIVIAL_DTOR = 0x00000002, - HAS_TRIVIAL_COPY = 0x00000004, - }; - - VectorImpl(size_t itemSize, uint32_t flags); - VectorImpl(const VectorImpl& rhs); - virtual ~VectorImpl(); - - /*! must be called from subclasses destructor */ - void finish_vector(); - - VectorImpl& operator = (const VectorImpl& rhs); - - /*! C-style array access */ - inline const void* arrayImpl() const { return mStorage; } - void* editArrayImpl(); - - /*! vector stats */ - inline size_t size() const { return mCount; } - inline bool isEmpty() const { return mCount == 0; } - size_t capacity() const; - ssize_t setCapacity(size_t size); - ssize_t resize(size_t size); - - /*! append/insert another vector or array */ - ssize_t insertVectorAt(const VectorImpl& vector, size_t index); - ssize_t appendVector(const VectorImpl& vector); - ssize_t insertArrayAt(const void* array, size_t index, size_t length); - ssize_t appendArray(const void* array, size_t length); - - /*! add/insert/replace items */ - ssize_t insertAt(size_t where, size_t numItems = 1); - ssize_t insertAt(const void* item, size_t where, size_t numItems = 1); - void pop(); - void push(); - void push(const void* item); - ssize_t add(); - ssize_t add(const void* item); - ssize_t replaceAt(size_t index); - ssize_t replaceAt(const void* item, size_t index); - - /*! remove items */ - ssize_t removeItemsAt(size_t index, size_t count = 1); - void clear(); - - const void* itemLocation(size_t index) const; - void* editItemLocation(size_t index); - - typedef int (*compar_t)(const void* lhs, const void* rhs); - typedef int (*compar_r_t)(const void* lhs, const void* rhs, void* state); - status_t sort(compar_t cmp); - status_t sort(compar_r_t cmp, void* state); - -protected: - size_t itemSize() const; - void release_storage(); - - virtual void do_construct(void* storage, size_t num) const = 0; - virtual void do_destroy(void* storage, size_t num) const = 0; - virtual void do_copy(void* dest, const void* from, size_t num) const = 0; - virtual void do_splat(void* dest, const void* item, size_t num) const = 0; - virtual void do_move_forward(void* dest, const void* from, size_t num) const = 0; - virtual void do_move_backward(void* dest, const void* from, size_t num) const = 0; - -private: - void* _grow(size_t where, size_t amount); - void _shrink(size_t where, size_t amount); - - inline void _do_construct(void* storage, size_t num) const; - inline void _do_destroy(void* storage, size_t num) const; - inline void _do_copy(void* dest, const void* from, size_t num) const; - inline void _do_splat(void* dest, const void* item, size_t num) const; - inline void _do_move_forward(void* dest, const void* from, size_t num) const; - inline void _do_move_backward(void* dest, const void* from, size_t num) const; - - // These 2 fields are exposed in the inlines below, - // so they're set in stone. - void * mStorage; // base address of the vector - size_t mCount; // number of items - - const uint32_t mFlags; - const size_t mItemSize; -}; - - - -class SortedVectorImpl : public VectorImpl -{ -public: - SortedVectorImpl(size_t itemSize, uint32_t flags); - SortedVectorImpl(const VectorImpl& rhs); - virtual ~SortedVectorImpl(); - - SortedVectorImpl& operator = (const SortedVectorImpl& rhs); - - //! finds the index of an item - ssize_t indexOf(const void* item) const; - - //! finds where this item should be inserted - size_t orderOf(const void* item) const; - - //! add an item in the right place (or replaces it if there is one) - ssize_t add(const void* item); - - //! merges a vector into this one - ssize_t merge(const VectorImpl& vector); - ssize_t merge(const SortedVectorImpl& vector); - - //! removes an item - ssize_t remove(const void* item); - -protected: - virtual int do_compare(const void* lhs, const void* rhs) const = 0; - -private: - ssize_t _indexOrderOf(const void* item, size_t* order = 0) const; - - // these are made private, because they can't be used on a SortedVector - // (they don't have an implementation either) - ssize_t add(); - void pop(); - void push(); - void push(const void* item); - ssize_t insertVectorAt(const VectorImpl& vector, size_t index); - ssize_t appendVector(const VectorImpl& vector); - ssize_t insertArrayAt(const void* array, size_t index, size_t length); - ssize_t appendArray(const void* array, size_t length); - ssize_t insertAt(size_t where, size_t numItems = 1); - ssize_t insertAt(const void* item, size_t where, size_t numItems = 1); - ssize_t replaceAt(size_t index); - ssize_t replaceAt(const void* item, size_t index); -}; - -}; // namespace android - - -// --------------------------------------------------------------------------- - -#endif // ANDROID_VECTOR_IMPL_H diff --git a/external/android/include/19/system/core/include/utils/ashmem.h b/external/android/include/19/system/core/include/utils/ashmem.h deleted file mode 100644 index 0854775..0000000 --- a/external/android/include/19/system/core/include/utils/ashmem.h +++ /dev/null @@ -1,41 +0,0 @@ -/* utils/ashmem.h - ** - ** Copyright 2008 The Android Open Source Project - ** - ** This file is dual licensed. It may be redistributed and/or modified - ** under the terms of the Apache 2.0 License OR version 2 of the GNU - ** General Public License. - */ - -#ifndef _UTILS_ASHMEM_H -#define _UTILS_ASHMEM_H - -#include -#include - -#define ASHMEM_NAME_LEN 256 - -#define ASHMEM_NAME_DEF "dev/ashmem" - -/* Return values from ASHMEM_PIN: Was the mapping purged while unpinned? */ -#define ASHMEM_NOT_REAPED 0 -#define ASHMEM_WAS_REAPED 1 - -/* Return values from ASHMEM_UNPIN: Is the mapping now pinned or unpinned? */ -#define ASHMEM_NOW_UNPINNED 0 -#define ASHMEM_NOW_PINNED 1 - -#define __ASHMEMIOC 0x77 - -#define ASHMEM_SET_NAME _IOW(__ASHMEMIOC, 1, char[ASHMEM_NAME_LEN]) -#define ASHMEM_GET_NAME _IOR(__ASHMEMIOC, 2, char[ASHMEM_NAME_LEN]) -#define ASHMEM_SET_SIZE _IOW(__ASHMEMIOC, 3, size_t) -#define ASHMEM_GET_SIZE _IO(__ASHMEMIOC, 4) -#define ASHMEM_SET_PROT_MASK _IOW(__ASHMEMIOC, 5, unsigned long) -#define ASHMEM_GET_PROT_MASK _IO(__ASHMEMIOC, 6) -#define ASHMEM_PIN _IO(__ASHMEMIOC, 7) -#define ASHMEM_UNPIN _IO(__ASHMEMIOC, 8) -#define ASHMEM_ISPINNED _IO(__ASHMEMIOC, 9) -#define ASHMEM_PURGE_ALL_CACHES _IO(__ASHMEMIOC, 10) - -#endif /* _UTILS_ASHMEM_H */ diff --git a/external/android/include/19/system/core/include/utils/misc.h b/external/android/include/19/system/core/include/utils/misc.h deleted file mode 100644 index 6cccec3..0000000 --- a/external/android/include/19/system/core/include/utils/misc.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2005 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. - */ - -// -// Handy utility functions and portability code. -// -#ifndef _LIBS_UTILS_MISC_H -#define _LIBS_UTILS_MISC_H - -#include - -/* get #of elements in a static array */ -#ifndef NELEM -# define NELEM(x) ((int) (sizeof(x) / sizeof((x)[0]))) -#endif - -namespace android { - -typedef void (*sysprop_change_callback)(void); -void add_sysprop_change_callback(sysprop_change_callback cb, int priority); -void report_sysprop_change(); - -}; // namespace android - -#endif // _LIBS_UTILS_MISC_H diff --git a/external/android/include/19/system/core/include/utils/threads.h b/external/android/include/19/system/core/include/utils/threads.h deleted file mode 100644 index 9de3382..0000000 --- a/external/android/include/19/system/core/include/utils/threads.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 _LIBS_UTILS_THREADS_H -#define _LIBS_UTILS_THREADS_H - -/* - * Please, DO NOT USE! - * - * This file is here only for legacy reasons. Instead, include directly - * the headers you need below. - * - */ - -#include - -#ifdef __cplusplus -#include -#include -#include -#include -#include -#endif - -#endif // _LIBS_UTILS_THREADS_H diff --git a/external/android/include/ndkbuild.mk b/external/android/include/ndkbuild.mk index d970e52..6c34631 100644 --- a/external/android/include/ndkbuild.mk +++ b/external/android/include/ndkbuild.mk @@ -1,30 +1,3 @@ -ANDROID_INCLUDES_14 := \ - $(ANDROID_DIR)/include/14/frameworks/base/include \ - $(ANDROID_DIR)/include/14/frameworks/base/include/media/stagefright/openmax \ - $(ANDROID_DIR)/include/14/system/core/include \ - $(ANDROID_DIR)/include/14/hardware/libhardware/include - -ANDROID_INCLUDES_16 := \ - $(ANDROID_DIR)/include/16/frameworks/native/include \ - $(ANDROID_DIR)/include/16/frameworks/native/include/media/openmax \ - $(ANDROID_DIR)/include/16/frameworks/av/include \ - $(ANDROID_DIR)/include/16/system/core/include \ - $(ANDROID_DIR)/include/16/hardware/libhardware/include - -ANDROID_INCLUDES_18 := \ - $(ANDROID_DIR)/include/18/frameworks/native/include \ - $(ANDROID_DIR)/include/18/frameworks/native/include/media/openmax \ - $(ANDROID_DIR)/include/18/frameworks/av/include \ - $(ANDROID_DIR)/include/18/system/core/include \ - $(ANDROID_DIR)/include/18/hardware/libhardware/include - -ANDROID_INCLUDES_19 := \ - $(ANDROID_DIR)/include/19/frameworks/native/include \ - $(ANDROID_DIR)/include/19/frameworks/native/include/media/openmax \ - $(ANDROID_DIR)/include/19/frameworks/av/include \ - $(ANDROID_DIR)/include/19/system/core/include \ - $(ANDROID_DIR)/include/19/hardware/libhardware/include - ANDROID_INCLUDES_21 := \ $(ANDROID_DIR)/include/21/frameworks/native/include \ $(ANDROID_DIR)/include/21/frameworks/native/include/media/openmax \ diff --git a/external/android/libavos_android/ndkbuild.mk b/external/android/libavos_android/ndkbuild.mk index 0af4152..d1d8a3a 100644 --- a/external/android/libavos_android/ndkbuild.mk +++ b/external/android/libavos_android/ndkbuild.mk @@ -19,18 +19,8 @@ LOCAL_MODULE := libavos_android$(AVOS_LIBS_SUFFIX) LOCAL_SRC_FILES := android_buffer.c android_window.c -ifneq ($(NDK_ANDROID_L),true) - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(ANDROID_INCLUDES_14) - -else - LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(ANDROID_INCLUDES_21) -LOCAL_CFLAGS := -DAVOS_ANDROID_API=21 - -endif - LOCAL_LDLIBS:= -L$(TARGET_OUT) -landroid #-lstagefright -lmedia -lcutils -lutils -lbinder -lui -lhardware include $(BUILD_ANDROID_LIBS) diff --git a/external/android/libsfdec/ndkbuild.mk b/external/android/libsfdec/ndkbuild.mk index deb4344..1a3f797 100644 --- a/external/android/libsfdec/ndkbuild.mk +++ b/external/android/libsfdec/ndkbuild.mk @@ -14,35 +14,6 @@ LOCAL_PATH := $(call my-dir) -ifneq ($(NDK_ANDROID_L),true) - -# not needed for android L and after - -define sfdec_build_shared -include $(CLEAR_VARS) -LOCAL_MODULE := libsfdec.core.$(1)$(AVOS_LIBS_SUFFIX) -LOCAL_SRC_FILES := sfdec_omxcodec.cpp sfdec_common.cpp -ifneq ($(1),14) -LOCAL_SRC_FILES += sfdec_mediacodec.cpp -endif -LOCAL_C_INCLUDES := \ - $(AVOS_DIR)/common/Include \ - $(ANDROID_INCLUDES_$(1)) -LOCAL_CFLAGS := -DSFDEC_ANDROID_API=$(1) -LOCAL_ALLOW_UNDEFINED_SYMBOLS := true -LOCAL_LDLIBS:= -L$(TARGET_OUT) -lstagefright -lmedia -lcutils -lutils -lbinder -lui -include $(BUILD_SHARED_LIBRARY) -endef - -# sfdec.core.* - -$(eval $(call sfdec_build_shared,14)) -$(eval $(call sfdec_build_shared,16)) -$(eval $(call sfdec_build_shared,18)) -$(eval $(call sfdec_build_shared,19)) - -endif # ifneq ($(NDK_ANDROID_L),true) - # sfdec.core.21 (using ndk API) include $(CLEAR_VARS) diff --git a/jni/Android.mk b/jni/Android.mk index ac38959..98e7932 100644 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -34,7 +34,6 @@ else AVOS_LIBS_SUFFIX := endif -NDK_ANDROID_L := true HAVE_ANDROID_SYSTEM_PROP := true ### libavos_android ###