cleanup unused android libs in phonelibs (#19702)
Co-authored-by: Comma Device <device@comma.ai>albatross
parent
f1d356af6a
commit
873341e2d5
|
@ -1,93 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
* Copyright (C) 2015 The CyanogenMod Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_BATTERYSERVICE_H
|
||||
#define ANDROID_BATTERYSERVICE_H
|
||||
|
||||
#include <binder/Parcel.h>
|
||||
#include <sys/types.h>
|
||||
#include <utils/Errors.h>
|
||||
#include <utils/String8.h>
|
||||
|
||||
namespace android {
|
||||
|
||||
// must be kept in sync with definitions in BatteryManager.java
|
||||
enum {
|
||||
BATTERY_STATUS_UNKNOWN = 1, // equals BatteryManager.BATTERY_STATUS_UNKNOWN constant
|
||||
BATTERY_STATUS_CHARGING = 2, // equals BatteryManager.BATTERY_STATUS_CHARGING constant
|
||||
BATTERY_STATUS_DISCHARGING = 3, // equals BatteryManager.BATTERY_STATUS_DISCHARGING constant
|
||||
BATTERY_STATUS_NOT_CHARGING = 4, // equals BatteryManager.BATTERY_STATUS_NOT_CHARGING constant
|
||||
BATTERY_STATUS_FULL = 5, // equals BatteryManager.BATTERY_STATUS_FULL constant
|
||||
};
|
||||
|
||||
// must be kept in sync with definitions in BatteryManager.java
|
||||
enum {
|
||||
BATTERY_HEALTH_UNKNOWN = 1, // equals BatteryManager.BATTERY_HEALTH_UNKNOWN constant
|
||||
BATTERY_HEALTH_GOOD = 2, // equals BatteryManager.BATTERY_HEALTH_GOOD constant
|
||||
BATTERY_HEALTH_OVERHEAT = 3, // equals BatteryManager.BATTERY_HEALTH_OVERHEAT constant
|
||||
BATTERY_HEALTH_DEAD = 4, // equals BatteryManager.BATTERY_HEALTH_DEAD constant
|
||||
BATTERY_HEALTH_OVER_VOLTAGE = 5, // equals BatteryManager.BATTERY_HEALTH_OVER_VOLTAGE constant
|
||||
BATTERY_HEALTH_UNSPECIFIED_FAILURE = 6, // equals BatteryManager.BATTERY_HEALTH_UNSPECIFIED_FAILURE constant
|
||||
BATTERY_HEALTH_COLD = 7, // equals BatteryManager.BATTERY_HEALTH_COLD constant
|
||||
};
|
||||
|
||||
// must be kept in sync with definitions in BatteryProperty.java
|
||||
enum {
|
||||
BATTERY_PROP_CHARGE_COUNTER = 1, // equals BatteryProperty.CHARGE_COUNTER constant
|
||||
BATTERY_PROP_CURRENT_NOW = 2, // equals BatteryProperty.CURRENT_NOW constant
|
||||
BATTERY_PROP_CURRENT_AVG = 3, // equals BatteryProperty.CURRENT_AVG constant
|
||||
BATTERY_PROP_CAPACITY = 4, // equals BatteryProperty.CAPACITY constant
|
||||
BATTERY_PROP_ENERGY_COUNTER = 5, // equals BatteryProperty.ENERGY_COUNTER constant
|
||||
};
|
||||
|
||||
struct BatteryProperties {
|
||||
bool chargerAcOnline;
|
||||
bool chargerUsbOnline;
|
||||
bool chargerWirelessOnline;
|
||||
int maxChargingCurrent;
|
||||
int batteryStatus;
|
||||
int batteryHealth;
|
||||
bool batteryPresent;
|
||||
int batteryLevel;
|
||||
int batteryVoltage;
|
||||
int batteryTemperature;
|
||||
String8 batteryTechnology;
|
||||
|
||||
bool dockBatterySupported;
|
||||
bool chargerDockAcOnline;
|
||||
int dockBatteryStatus;
|
||||
int dockBatteryHealth;
|
||||
bool dockBatteryPresent;
|
||||
int dockBatteryLevel;
|
||||
int dockBatteryVoltage;
|
||||
int dockBatteryTemperature;
|
||||
String8 dockBatteryTechnology;
|
||||
|
||||
status_t writeToParcel(Parcel* parcel) const;
|
||||
status_t readFromParcel(Parcel* parcel);
|
||||
};
|
||||
|
||||
struct BatteryProperty {
|
||||
int64_t valueInt64;
|
||||
|
||||
status_t writeToParcel(Parcel* parcel) const;
|
||||
status_t readFromParcel(Parcel* parcel);
|
||||
};
|
||||
|
||||
}; // namespace android
|
||||
|
||||
#endif // ANDROID_BATTERYSERVICE_H
|
|
@ -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_IBATTERYPROPERTIESLISTENER_H
|
||||
#define ANDROID_IBATTERYPROPERTIESLISTENER_H
|
||||
|
||||
#include <binder/IBinder.h>
|
||||
#include <binder/IInterface.h>
|
||||
|
||||
#include <batteryservice/BatteryService.h>
|
||||
|
||||
namespace android {
|
||||
|
||||
// must be kept in sync with interface defined in IBatteryPropertiesListener.aidl
|
||||
enum {
|
||||
TRANSACT_BATTERYPROPERTIESCHANGED = IBinder::FIRST_CALL_TRANSACTION,
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class IBatteryPropertiesListener : public IInterface {
|
||||
public:
|
||||
DECLARE_META_INTERFACE(BatteryPropertiesListener);
|
||||
|
||||
virtual void batteryPropertiesChanged(struct BatteryProperties props) = 0;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
}; // namespace android
|
||||
|
||||
#endif // ANDROID_IBATTERYPROPERTIESLISTENER_H
|
|
@ -1,52 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
* Copyright (C) 2015 The CyanogenMod Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_IBATTERYPROPERTIESREGISTRAR_H
|
||||
#define ANDROID_IBATTERYPROPERTIESREGISTRAR_H
|
||||
|
||||
#include <binder/IInterface.h>
|
||||
#include <batteryservice/IBatteryPropertiesListener.h>
|
||||
|
||||
namespace android {
|
||||
|
||||
// must be kept in sync with interface defined in IBatteryPropertiesRegistrar.aidl
|
||||
enum {
|
||||
REGISTER_LISTENER = IBinder::FIRST_CALL_TRANSACTION,
|
||||
UNREGISTER_LISTENER,
|
||||
GET_PROPERTY,
|
||||
GET_DOCK_PROPERTY,
|
||||
};
|
||||
|
||||
class IBatteryPropertiesRegistrar : public IInterface {
|
||||
public:
|
||||
DECLARE_META_INTERFACE(BatteryPropertiesRegistrar);
|
||||
|
||||
virtual void registerListener(const sp<IBatteryPropertiesListener>& listener) = 0;
|
||||
virtual void unregisterListener(const sp<IBatteryPropertiesListener>& listener) = 0;
|
||||
virtual status_t getProperty(int id, struct BatteryProperty *val) = 0;
|
||||
virtual status_t getDockProperty(int id, struct BatteryProperty *val) = 0;
|
||||
};
|
||||
|
||||
class BnBatteryPropertiesRegistrar : public BnInterface<IBatteryPropertiesRegistrar> {
|
||||
public:
|
||||
virtual status_t onTransact(uint32_t code, const Parcel& data,
|
||||
Parcel* reply, uint32_t flags = 0);
|
||||
};
|
||||
|
||||
}; // namespace android
|
||||
|
||||
#endif // ANDROID_IBATTERYPROPERTIESREGISTRAR_H
|
|
@ -1,30 +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 __LIBDISKUSAGE_DIRSIZE_H
|
||||
#define __LIBDISKUSAGE_DIRSIZE_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
int64_t stat_size(struct stat *s);
|
||||
int64_t calculate_dir_size(int dfd);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* __LIBDISKUSAGE_DIRSIZE_H */
|
|
@ -1,52 +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 _LIBINPUT_IINPUT_FLINGER_H
|
||||
#define _LIBINPUT_IINPUT_FLINGER_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <binder/IInterface.h>
|
||||
|
||||
namespace android {
|
||||
|
||||
/*
|
||||
* This class defines the Binder IPC interface for accessing various
|
||||
* InputFlinger features.
|
||||
*/
|
||||
class IInputFlinger : public IInterface {
|
||||
public:
|
||||
DECLARE_META_INTERFACE(InputFlinger);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Binder implementation.
|
||||
*/
|
||||
class BnInputFlinger : public BnInterface<IInputFlinger> {
|
||||
public:
|
||||
enum {
|
||||
DO_SOMETHING_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION,
|
||||
};
|
||||
|
||||
virtual status_t onTransact(uint32_t code, const Parcel& data,
|
||||
Parcel* reply, uint32_t flags = 0);
|
||||
};
|
||||
|
||||
} // namespace android
|
||||
|
||||
#endif // _LIBINPUT_IINPUT_FLINGER_H
|
|
@ -1,681 +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 _LIBINPUT_INPUT_H
|
||||
#define _LIBINPUT_INPUT_H
|
||||
|
||||
/**
|
||||
* Native input event structures.
|
||||
*/
|
||||
|
||||
#include <android/input.h>
|
||||
#include <utils/BitSet.h>
|
||||
#include <utils/KeyedVector.h>
|
||||
#include <utils/RefBase.h>
|
||||
#include <utils/String8.h>
|
||||
#include <utils/Timers.h>
|
||||
#include <utils/Vector.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/*
|
||||
* Additional private constants not defined in ndk/ui/input.h.
|
||||
*/
|
||||
enum {
|
||||
/* Signifies that the key is being predispatched */
|
||||
AKEY_EVENT_FLAG_PREDISPATCH = 0x20000000,
|
||||
|
||||
/* 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 {
|
||||
|
||||
/**
|
||||
* This flag indicates that the window that received this motion event is partly
|
||||
* or wholly obscured by another visible window above it. This flag is set to true
|
||||
* even if the event did not directly pass through the obscured area.
|
||||
* A security sensitive application can check this flag to identify situations in which
|
||||
* a malicious application may have covered up part of its content for the purpose
|
||||
* of misleading the user or hijacking touches. An appropriate response might be
|
||||
* to drop the suspect touches or to take additional precautions to confirm the user's
|
||||
* actual intent.
|
||||
*/
|
||||
AMOTION_EVENT_FLAG_WINDOW_IS_PARTIALLY_OBSCURED = 0x2,
|
||||
|
||||
/* Motion event is inconsistent with previously sent motion events. */
|
||||
AMOTION_EVENT_FLAG_TAINTED = 0x80000000,
|
||||
};
|
||||
|
||||
enum {
|
||||
/* Used when a motion event is not associated with any display.
|
||||
* Typically used for non-pointer events. */
|
||||
ADISPLAY_ID_NONE = -1,
|
||||
|
||||
/* The default display id. */
|
||||
ADISPLAY_ID_DEFAULT = 0,
|
||||
};
|
||||
|
||||
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,
|
||||
};
|
||||
|
||||
enum {
|
||||
/**
|
||||
* Constants for LEDs. Hidden from the API since we don't actually expose a way to interact
|
||||
* with LEDs to developers
|
||||
*
|
||||
* NOTE: If you add LEDs here, you must also add them to InputEventLabels.h
|
||||
*/
|
||||
|
||||
ALED_NUM_LOCK = 0x00,
|
||||
ALED_CAPS_LOCK = 0x01,
|
||||
ALED_SCROLL_LOCK = 0x02,
|
||||
ALED_COMPOSE = 0x03,
|
||||
ALED_KANA = 0x04,
|
||||
ALED_SLEEP = 0x05,
|
||||
ALED_SUSPEND = 0x06,
|
||||
ALED_MUTE = 0x07,
|
||||
ALED_MISC = 0x08,
|
||||
ALED_MAIL = 0x09,
|
||||
ALED_CHARGING = 0x0a,
|
||||
ALED_CONTROLLER_1 = 0x10,
|
||||
ALED_CONTROLLER_2 = 0x11,
|
||||
ALED_CONTROLLER_3 = 0x12,
|
||||
ALED_CONTROLLER_4 = 0x13,
|
||||
};
|
||||
|
||||
/* Maximum number of controller LEDs we support */
|
||||
#define MAX_CONTROLLER_LEDS 4
|
||||
|
||||
/*
|
||||
* 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 number of samples supported per motion event.
|
||||
*/
|
||||
#define MAX_SAMPLES UINT16_MAX
|
||||
|
||||
/*
|
||||
* 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 want a flag to be able to set in a keylayout file, then you must add it to
|
||||
* InputEventLabels.h as well. */
|
||||
|
||||
// Indicates that the event should wake the device.
|
||||
POLICY_FLAG_WAKE = 0x00000001,
|
||||
|
||||
// Indicates that the key is virtual, such as a capacitive button, and should
|
||||
// generate haptic feedback. Virtual keys may be suppressed for some time
|
||||
// after a recent touch to prevent accidental activation of virtual keys adjacent
|
||||
// to the touch screen during an edge swipe.
|
||||
POLICY_FLAG_VIRTUAL = 0x00000002,
|
||||
|
||||
// Indicates that the key is the special function modifier.
|
||||
POLICY_FLAG_FUNCTION = 0x00000004,
|
||||
|
||||
// Indicates that the key represents a special gesture that has been detected by
|
||||
// the touch firmware or driver. Causes touch events from the same device to be canceled.
|
||||
POLICY_FLAG_GESTURE = 0x00000008,
|
||||
|
||||
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 device was in an interactive state when the
|
||||
// event was intercepted.
|
||||
POLICY_FLAG_INTERACTIVE = 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,
|
||||
};
|
||||
|
||||
/*
|
||||
* Pointer coordinate data.
|
||||
*/
|
||||
struct PointerCoords {
|
||||
enum { MAX_AXES = 30 }; // 30 so that sizeof(PointerCoords) == 128
|
||||
|
||||
// Bitfield of axes that are present in this structure.
|
||||
uint64_t bits __attribute__((aligned(8)));
|
||||
|
||||
// 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() {
|
||||
BitSet64::clear(bits);
|
||||
}
|
||||
|
||||
bool isEmpty() const {
|
||||
return BitSet64::isEmpty(bits);
|
||||
}
|
||||
|
||||
float getAxisValue(int32_t axis) const;
|
||||
status_t setAxisValue(int32_t axis, float value);
|
||||
|
||||
void scale(float scale);
|
||||
void applyOffset(float xOffset, float yOffset);
|
||||
|
||||
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 void setFlags(int32_t flags) { mFlags = flags; }
|
||||
|
||||
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; }
|
||||
|
||||
static const char* getLabel(int32_t keyCode);
|
||||
static int32_t getKeyCodeFromLabel(const char* label);
|
||||
|
||||
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 int32_t setButtonState(int32_t buttonState) { mButtonState = buttonState; }
|
||||
|
||||
inline int32_t getActionButton() const { return mActionButton; }
|
||||
|
||||
inline void setActionButton(int32_t button) { mActionButton = button; }
|
||||
|
||||
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 actionButton,
|
||||
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);
|
||||
|
||||
// Apply 3x3 perspective matrix transformation.
|
||||
// Matrix is in row-major form and compatible with SkMatrix.
|
||||
void transform(const float matrix[9]);
|
||||
|
||||
#ifdef HAVE_ANDROID_OS
|
||||
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();
|
||||
}
|
||||
|
||||
static const char* getLabel(int32_t axis);
|
||||
static int32_t getAxisFromLabel(const char* label);
|
||||
|
||||
protected:
|
||||
int32_t mAction;
|
||||
int32_t mActionButton;
|
||||
int32_t mFlags;
|
||||
int32_t mEdgeFlags;
|
||||
int32_t mMetaState;
|
||||
int32_t mButtonState;
|
||||
float mXOffset;
|
||||
float mYOffset;
|
||||
float mXPrecision;
|
||||
float mYPrecision;
|
||||
nsecs_t mDownTime;
|
||||
Vector<PointerProperties> mPointerProperties;
|
||||
Vector<nsecs_t> mSampleEventTimes;
|
||||
Vector<PointerCoords> 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;
|
||||
};
|
||||
|
||||
/*
|
||||
* An input event factory implementation that maintains a pool of input events.
|
||||
*/
|
||||
class PooledInputEventFactory : public InputEventFactoryInterface {
|
||||
public:
|
||||
PooledInputEventFactory(size_t maxPoolSize = 20);
|
||||
virtual ~PooledInputEventFactory();
|
||||
|
||||
virtual KeyEvent* createKeyEvent();
|
||||
virtual MotionEvent* createMotionEvent();
|
||||
|
||||
void recycle(InputEvent* event);
|
||||
|
||||
private:
|
||||
const size_t mMaxPoolSize;
|
||||
|
||||
Vector<KeyEvent*> mKeyEventPool;
|
||||
Vector<MotionEvent*> mMotionEventPool;
|
||||
};
|
||||
|
||||
} // namespace android
|
||||
|
||||
#endif // _LIBINPUT_INPUT_H
|
|
@ -1,170 +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 _LIBINPUT_INPUT_DEVICE_H
|
||||
#define _LIBINPUT_INPUT_DEVICE_H
|
||||
|
||||
#include <input/Input.h>
|
||||
#include <input/KeyCharacterMap.h>
|
||||
|
||||
namespace android {
|
||||
|
||||
/*
|
||||
* Identifies a device.
|
||||
*/
|
||||
struct InputDeviceIdentifier {
|
||||
inline InputDeviceIdentifier() :
|
||||
bus(0), vendor(0), product(0), version(0) {
|
||||
}
|
||||
|
||||
// Information provided by the kernel.
|
||||
String8 name;
|
||||
String8 location;
|
||||
String8 uniqueId;
|
||||
uint16_t bus;
|
||||
uint16_t vendor;
|
||||
uint16_t product;
|
||||
uint16_t version;
|
||||
|
||||
// A composite input device descriptor string that uniquely identifies the device
|
||||
// even across reboots or reconnections. The value of this field is used by
|
||||
// upper layers of the input system to associate settings with individual devices.
|
||||
// It is hashed from whatever kernel provided information is available.
|
||||
// Ideally, the way this value is computed should not change between Android releases
|
||||
// because that would invalidate persistent settings that rely on it.
|
||||
String8 descriptor;
|
||||
|
||||
// A value added to uniquely identify a device in the absence of a unique id. This
|
||||
// is intended to be a minimum way to distinguish from other active devices and may
|
||||
// reuse values that are not associated with an input anymore.
|
||||
uint16_t nonce;
|
||||
};
|
||||
|
||||
/*
|
||||
* 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;
|
||||
float resolution;
|
||||
};
|
||||
|
||||
void initialize(int32_t id, int32_t generation, int32_t controllerNumber,
|
||||
const InputDeviceIdentifier& identifier, const String8& alias, bool isExternal,
|
||||
bool hasMic);
|
||||
|
||||
inline int32_t getId() const { return mId; }
|
||||
inline int32_t getControllerNumber() const { return mControllerNumber; }
|
||||
inline int32_t getGeneration() const { return mGeneration; }
|
||||
inline const InputDeviceIdentifier& getIdentifier() const { return mIdentifier; }
|
||||
inline const String8& getAlias() const { return mAlias; }
|
||||
inline const String8& getDisplayName() const {
|
||||
return mAlias.isEmpty() ? mIdentifier.name : mAlias;
|
||||
}
|
||||
inline bool isExternal() const { return mIsExternal; }
|
||||
inline bool hasMic() const { return mHasMic; }
|
||||
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, float resolution);
|
||||
void addMotionRange(const MotionRange& range);
|
||||
|
||||
inline void setKeyboardType(int32_t keyboardType) { mKeyboardType = keyboardType; }
|
||||
inline int32_t getKeyboardType() const { return mKeyboardType; }
|
||||
|
||||
inline void setKeyCharacterMap(const sp<KeyCharacterMap>& value) {
|
||||
mKeyCharacterMap = value;
|
||||
}
|
||||
|
||||
inline sp<KeyCharacterMap> getKeyCharacterMap() const {
|
||||
return mKeyCharacterMap;
|
||||
}
|
||||
|
||||
inline void setVibrator(bool hasVibrator) { mHasVibrator = hasVibrator; }
|
||||
inline bool hasVibrator() const { return mHasVibrator; }
|
||||
|
||||
inline void setButtonUnderPad(bool hasButton) { mHasButtonUnderPad = hasButton; }
|
||||
inline bool hasButtonUnderPad() const { return mHasButtonUnderPad; }
|
||||
|
||||
inline const Vector<MotionRange>& getMotionRanges() const {
|
||||
return mMotionRanges;
|
||||
}
|
||||
|
||||
private:
|
||||
int32_t mId;
|
||||
int32_t mGeneration;
|
||||
int32_t mControllerNumber;
|
||||
InputDeviceIdentifier mIdentifier;
|
||||
String8 mAlias;
|
||||
bool mIsExternal;
|
||||
bool mHasMic;
|
||||
uint32_t mSources;
|
||||
int32_t mKeyboardType;
|
||||
sp<KeyCharacterMap> mKeyCharacterMap;
|
||||
bool mHasVibrator;
|
||||
bool mHasButtonUnderPad;
|
||||
|
||||
Vector<MotionRange> mMotionRanges;
|
||||
};
|
||||
|
||||
/* 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 // _LIBINPUT_INPUT_DEVICE_H
|
|
@ -1,447 +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 _LIBINPUT_INPUT_EVENT_LABELS_H
|
||||
#define _LIBINPUT_INPUT_EVENT_LABELS_H
|
||||
|
||||
#include <input/Input.h>
|
||||
#include <android/keycodes.h>
|
||||
|
||||
#define DEFINE_KEYCODE(key) { #key, AKEYCODE_##key }
|
||||
#define DEFINE_AXIS(axis) { #axis, AMOTION_EVENT_AXIS_##axis }
|
||||
#define DEFINE_LED(led) { #led, ALED_##led }
|
||||
#define DEFINE_FLAG(flag) { #flag, POLICY_FLAG_##flag }
|
||||
|
||||
namespace android {
|
||||
|
||||
template<typename T, size_t N>
|
||||
size_t size(T (&)[N]) { return N; }
|
||||
|
||||
struct InputEventLabel {
|
||||
const char *literal;
|
||||
int value;
|
||||
};
|
||||
|
||||
|
||||
static const InputEventLabel KEYCODES[] = {
|
||||
// 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.
|
||||
DEFINE_KEYCODE(UNKNOWN),
|
||||
DEFINE_KEYCODE(SOFT_LEFT),
|
||||
DEFINE_KEYCODE(SOFT_RIGHT),
|
||||
DEFINE_KEYCODE(HOME),
|
||||
DEFINE_KEYCODE(BACK),
|
||||
DEFINE_KEYCODE(CALL),
|
||||
DEFINE_KEYCODE(ENDCALL),
|
||||
DEFINE_KEYCODE(0),
|
||||
DEFINE_KEYCODE(1),
|
||||
DEFINE_KEYCODE(2),
|
||||
DEFINE_KEYCODE(3),
|
||||
DEFINE_KEYCODE(4),
|
||||
DEFINE_KEYCODE(5),
|
||||
DEFINE_KEYCODE(6),
|
||||
DEFINE_KEYCODE(7),
|
||||
DEFINE_KEYCODE(8),
|
||||
DEFINE_KEYCODE(9),
|
||||
DEFINE_KEYCODE(STAR),
|
||||
DEFINE_KEYCODE(POUND),
|
||||
DEFINE_KEYCODE(DPAD_UP),
|
||||
DEFINE_KEYCODE(DPAD_DOWN),
|
||||
DEFINE_KEYCODE(DPAD_LEFT),
|
||||
DEFINE_KEYCODE(DPAD_RIGHT),
|
||||
DEFINE_KEYCODE(DPAD_CENTER),
|
||||
DEFINE_KEYCODE(VOLUME_UP),
|
||||
DEFINE_KEYCODE(VOLUME_DOWN),
|
||||
DEFINE_KEYCODE(POWER),
|
||||
DEFINE_KEYCODE(CAMERA),
|
||||
DEFINE_KEYCODE(CLEAR),
|
||||
DEFINE_KEYCODE(A),
|
||||
DEFINE_KEYCODE(B),
|
||||
DEFINE_KEYCODE(C),
|
||||
DEFINE_KEYCODE(D),
|
||||
DEFINE_KEYCODE(E),
|
||||
DEFINE_KEYCODE(F),
|
||||
DEFINE_KEYCODE(G),
|
||||
DEFINE_KEYCODE(H),
|
||||
DEFINE_KEYCODE(I),
|
||||
DEFINE_KEYCODE(J),
|
||||
DEFINE_KEYCODE(K),
|
||||
DEFINE_KEYCODE(L),
|
||||
DEFINE_KEYCODE(M),
|
||||
DEFINE_KEYCODE(N),
|
||||
DEFINE_KEYCODE(O),
|
||||
DEFINE_KEYCODE(P),
|
||||
DEFINE_KEYCODE(Q),
|
||||
DEFINE_KEYCODE(R),
|
||||
DEFINE_KEYCODE(S),
|
||||
DEFINE_KEYCODE(T),
|
||||
DEFINE_KEYCODE(U),
|
||||
DEFINE_KEYCODE(V),
|
||||
DEFINE_KEYCODE(W),
|
||||
DEFINE_KEYCODE(X),
|
||||
DEFINE_KEYCODE(Y),
|
||||
DEFINE_KEYCODE(Z),
|
||||
DEFINE_KEYCODE(COMMA),
|
||||
DEFINE_KEYCODE(PERIOD),
|
||||
DEFINE_KEYCODE(ALT_LEFT),
|
||||
DEFINE_KEYCODE(ALT_RIGHT),
|
||||
DEFINE_KEYCODE(SHIFT_LEFT),
|
||||
DEFINE_KEYCODE(SHIFT_RIGHT),
|
||||
DEFINE_KEYCODE(TAB),
|
||||
DEFINE_KEYCODE(SPACE),
|
||||
DEFINE_KEYCODE(SYM),
|
||||
DEFINE_KEYCODE(EXPLORER),
|
||||
DEFINE_KEYCODE(ENVELOPE),
|
||||
DEFINE_KEYCODE(ENTER),
|
||||
DEFINE_KEYCODE(DEL),
|
||||
DEFINE_KEYCODE(GRAVE),
|
||||
DEFINE_KEYCODE(MINUS),
|
||||
DEFINE_KEYCODE(EQUALS),
|
||||
DEFINE_KEYCODE(LEFT_BRACKET),
|
||||
DEFINE_KEYCODE(RIGHT_BRACKET),
|
||||
DEFINE_KEYCODE(BACKSLASH),
|
||||
DEFINE_KEYCODE(SEMICOLON),
|
||||
DEFINE_KEYCODE(APOSTROPHE),
|
||||
DEFINE_KEYCODE(SLASH),
|
||||
DEFINE_KEYCODE(AT),
|
||||
DEFINE_KEYCODE(NUM),
|
||||
DEFINE_KEYCODE(HEADSETHOOK),
|
||||
DEFINE_KEYCODE(FOCUS), // *Camera* focus
|
||||
DEFINE_KEYCODE(PLUS),
|
||||
DEFINE_KEYCODE(MENU),
|
||||
DEFINE_KEYCODE(NOTIFICATION),
|
||||
DEFINE_KEYCODE(SEARCH),
|
||||
DEFINE_KEYCODE(MEDIA_PLAY_PAUSE),
|
||||
DEFINE_KEYCODE(MEDIA_STOP),
|
||||
DEFINE_KEYCODE(MEDIA_NEXT),
|
||||
DEFINE_KEYCODE(MEDIA_PREVIOUS),
|
||||
DEFINE_KEYCODE(MEDIA_REWIND),
|
||||
DEFINE_KEYCODE(MEDIA_FAST_FORWARD),
|
||||
DEFINE_KEYCODE(MUTE),
|
||||
DEFINE_KEYCODE(PAGE_UP),
|
||||
DEFINE_KEYCODE(PAGE_DOWN),
|
||||
DEFINE_KEYCODE(PICTSYMBOLS),
|
||||
DEFINE_KEYCODE(SWITCH_CHARSET),
|
||||
DEFINE_KEYCODE(BUTTON_A),
|
||||
DEFINE_KEYCODE(BUTTON_B),
|
||||
DEFINE_KEYCODE(BUTTON_C),
|
||||
DEFINE_KEYCODE(BUTTON_X),
|
||||
DEFINE_KEYCODE(BUTTON_Y),
|
||||
DEFINE_KEYCODE(BUTTON_Z),
|
||||
DEFINE_KEYCODE(BUTTON_L1),
|
||||
DEFINE_KEYCODE(BUTTON_R1),
|
||||
DEFINE_KEYCODE(BUTTON_L2),
|
||||
DEFINE_KEYCODE(BUTTON_R2),
|
||||
DEFINE_KEYCODE(BUTTON_THUMBL),
|
||||
DEFINE_KEYCODE(BUTTON_THUMBR),
|
||||
DEFINE_KEYCODE(BUTTON_START),
|
||||
DEFINE_KEYCODE(BUTTON_SELECT),
|
||||
DEFINE_KEYCODE(BUTTON_MODE),
|
||||
DEFINE_KEYCODE(ESCAPE),
|
||||
DEFINE_KEYCODE(FORWARD_DEL),
|
||||
DEFINE_KEYCODE(CTRL_LEFT),
|
||||
DEFINE_KEYCODE(CTRL_RIGHT),
|
||||
DEFINE_KEYCODE(CAPS_LOCK),
|
||||
DEFINE_KEYCODE(SCROLL_LOCK),
|
||||
DEFINE_KEYCODE(META_LEFT),
|
||||
DEFINE_KEYCODE(META_RIGHT),
|
||||
DEFINE_KEYCODE(FUNCTION),
|
||||
DEFINE_KEYCODE(SYSRQ),
|
||||
DEFINE_KEYCODE(BREAK),
|
||||
DEFINE_KEYCODE(MOVE_HOME),
|
||||
DEFINE_KEYCODE(MOVE_END),
|
||||
DEFINE_KEYCODE(INSERT),
|
||||
DEFINE_KEYCODE(FORWARD),
|
||||
DEFINE_KEYCODE(MEDIA_PLAY),
|
||||
DEFINE_KEYCODE(MEDIA_PAUSE),
|
||||
DEFINE_KEYCODE(MEDIA_CLOSE),
|
||||
DEFINE_KEYCODE(MEDIA_EJECT),
|
||||
DEFINE_KEYCODE(MEDIA_RECORD),
|
||||
DEFINE_KEYCODE(F1),
|
||||
DEFINE_KEYCODE(F2),
|
||||
DEFINE_KEYCODE(F3),
|
||||
DEFINE_KEYCODE(F4),
|
||||
DEFINE_KEYCODE(F5),
|
||||
DEFINE_KEYCODE(F6),
|
||||
DEFINE_KEYCODE(F7),
|
||||
DEFINE_KEYCODE(F8),
|
||||
DEFINE_KEYCODE(F9),
|
||||
DEFINE_KEYCODE(F10),
|
||||
DEFINE_KEYCODE(F11),
|
||||
DEFINE_KEYCODE(F12),
|
||||
DEFINE_KEYCODE(NUM_LOCK),
|
||||
DEFINE_KEYCODE(NUMPAD_0),
|
||||
DEFINE_KEYCODE(NUMPAD_1),
|
||||
DEFINE_KEYCODE(NUMPAD_2),
|
||||
DEFINE_KEYCODE(NUMPAD_3),
|
||||
DEFINE_KEYCODE(NUMPAD_4),
|
||||
DEFINE_KEYCODE(NUMPAD_5),
|
||||
DEFINE_KEYCODE(NUMPAD_6),
|
||||
DEFINE_KEYCODE(NUMPAD_7),
|
||||
DEFINE_KEYCODE(NUMPAD_8),
|
||||
DEFINE_KEYCODE(NUMPAD_9),
|
||||
DEFINE_KEYCODE(NUMPAD_DIVIDE),
|
||||
DEFINE_KEYCODE(NUMPAD_MULTIPLY),
|
||||
DEFINE_KEYCODE(NUMPAD_SUBTRACT),
|
||||
DEFINE_KEYCODE(NUMPAD_ADD),
|
||||
DEFINE_KEYCODE(NUMPAD_DOT),
|
||||
DEFINE_KEYCODE(NUMPAD_COMMA),
|
||||
DEFINE_KEYCODE(NUMPAD_ENTER),
|
||||
DEFINE_KEYCODE(NUMPAD_EQUALS),
|
||||
DEFINE_KEYCODE(NUMPAD_LEFT_PAREN),
|
||||
DEFINE_KEYCODE(NUMPAD_RIGHT_PAREN),
|
||||
DEFINE_KEYCODE(VOLUME_MUTE),
|
||||
DEFINE_KEYCODE(INFO),
|
||||
DEFINE_KEYCODE(CHANNEL_UP),
|
||||
DEFINE_KEYCODE(CHANNEL_DOWN),
|
||||
DEFINE_KEYCODE(ZOOM_IN),
|
||||
DEFINE_KEYCODE(ZOOM_OUT),
|
||||
DEFINE_KEYCODE(TV),
|
||||
DEFINE_KEYCODE(WINDOW),
|
||||
DEFINE_KEYCODE(GUIDE),
|
||||
DEFINE_KEYCODE(DVR),
|
||||
DEFINE_KEYCODE(BOOKMARK),
|
||||
DEFINE_KEYCODE(CAPTIONS),
|
||||
DEFINE_KEYCODE(SETTINGS),
|
||||
DEFINE_KEYCODE(TV_POWER),
|
||||
DEFINE_KEYCODE(TV_INPUT),
|
||||
DEFINE_KEYCODE(STB_POWER),
|
||||
DEFINE_KEYCODE(STB_INPUT),
|
||||
DEFINE_KEYCODE(AVR_POWER),
|
||||
DEFINE_KEYCODE(AVR_INPUT),
|
||||
DEFINE_KEYCODE(PROG_RED),
|
||||
DEFINE_KEYCODE(PROG_GREEN),
|
||||
DEFINE_KEYCODE(PROG_YELLOW),
|
||||
DEFINE_KEYCODE(PROG_BLUE),
|
||||
DEFINE_KEYCODE(APP_SWITCH),
|
||||
DEFINE_KEYCODE(BUTTON_1),
|
||||
DEFINE_KEYCODE(BUTTON_2),
|
||||
DEFINE_KEYCODE(BUTTON_3),
|
||||
DEFINE_KEYCODE(BUTTON_4),
|
||||
DEFINE_KEYCODE(BUTTON_5),
|
||||
DEFINE_KEYCODE(BUTTON_6),
|
||||
DEFINE_KEYCODE(BUTTON_7),
|
||||
DEFINE_KEYCODE(BUTTON_8),
|
||||
DEFINE_KEYCODE(BUTTON_9),
|
||||
DEFINE_KEYCODE(BUTTON_10),
|
||||
DEFINE_KEYCODE(BUTTON_11),
|
||||
DEFINE_KEYCODE(BUTTON_12),
|
||||
DEFINE_KEYCODE(BUTTON_13),
|
||||
DEFINE_KEYCODE(BUTTON_14),
|
||||
DEFINE_KEYCODE(BUTTON_15),
|
||||
DEFINE_KEYCODE(BUTTON_16),
|
||||
DEFINE_KEYCODE(LANGUAGE_SWITCH),
|
||||
DEFINE_KEYCODE(MANNER_MODE),
|
||||
DEFINE_KEYCODE(3D_MODE),
|
||||
DEFINE_KEYCODE(CONTACTS),
|
||||
DEFINE_KEYCODE(CALENDAR),
|
||||
DEFINE_KEYCODE(MUSIC),
|
||||
DEFINE_KEYCODE(CALCULATOR),
|
||||
DEFINE_KEYCODE(ZENKAKU_HANKAKU),
|
||||
DEFINE_KEYCODE(EISU),
|
||||
DEFINE_KEYCODE(MUHENKAN),
|
||||
DEFINE_KEYCODE(HENKAN),
|
||||
DEFINE_KEYCODE(KATAKANA_HIRAGANA),
|
||||
DEFINE_KEYCODE(YEN),
|
||||
DEFINE_KEYCODE(RO),
|
||||
DEFINE_KEYCODE(KANA),
|
||||
DEFINE_KEYCODE(ASSIST),
|
||||
DEFINE_KEYCODE(BRIGHTNESS_DOWN),
|
||||
DEFINE_KEYCODE(BRIGHTNESS_UP),
|
||||
DEFINE_KEYCODE(MEDIA_AUDIO_TRACK),
|
||||
DEFINE_KEYCODE(SLEEP),
|
||||
DEFINE_KEYCODE(WAKEUP),
|
||||
DEFINE_KEYCODE(PAIRING),
|
||||
DEFINE_KEYCODE(MEDIA_TOP_MENU),
|
||||
DEFINE_KEYCODE(11),
|
||||
DEFINE_KEYCODE(12),
|
||||
DEFINE_KEYCODE(LAST_CHANNEL),
|
||||
DEFINE_KEYCODE(TV_DATA_SERVICE),
|
||||
DEFINE_KEYCODE(VOICE_ASSIST),
|
||||
DEFINE_KEYCODE(TV_RADIO_SERVICE),
|
||||
DEFINE_KEYCODE(TV_TELETEXT),
|
||||
DEFINE_KEYCODE(TV_NUMBER_ENTRY),
|
||||
DEFINE_KEYCODE(TV_TERRESTRIAL_ANALOG),
|
||||
DEFINE_KEYCODE(TV_TERRESTRIAL_DIGITAL),
|
||||
DEFINE_KEYCODE(TV_SATELLITE),
|
||||
DEFINE_KEYCODE(TV_SATELLITE_BS),
|
||||
DEFINE_KEYCODE(TV_SATELLITE_CS),
|
||||
DEFINE_KEYCODE(TV_SATELLITE_SERVICE),
|
||||
DEFINE_KEYCODE(TV_NETWORK),
|
||||
DEFINE_KEYCODE(TV_ANTENNA_CABLE),
|
||||
DEFINE_KEYCODE(TV_INPUT_HDMI_1),
|
||||
DEFINE_KEYCODE(TV_INPUT_HDMI_2),
|
||||
DEFINE_KEYCODE(TV_INPUT_HDMI_3),
|
||||
DEFINE_KEYCODE(TV_INPUT_HDMI_4),
|
||||
DEFINE_KEYCODE(TV_INPUT_COMPOSITE_1),
|
||||
DEFINE_KEYCODE(TV_INPUT_COMPOSITE_2),
|
||||
DEFINE_KEYCODE(TV_INPUT_COMPONENT_1),
|
||||
DEFINE_KEYCODE(TV_INPUT_COMPONENT_2),
|
||||
DEFINE_KEYCODE(TV_INPUT_VGA_1),
|
||||
DEFINE_KEYCODE(TV_AUDIO_DESCRIPTION),
|
||||
DEFINE_KEYCODE(TV_AUDIO_DESCRIPTION_MIX_UP),
|
||||
DEFINE_KEYCODE(TV_AUDIO_DESCRIPTION_MIX_DOWN),
|
||||
DEFINE_KEYCODE(TV_ZOOM_MODE),
|
||||
DEFINE_KEYCODE(TV_CONTENTS_MENU),
|
||||
DEFINE_KEYCODE(TV_MEDIA_CONTEXT_MENU),
|
||||
DEFINE_KEYCODE(TV_TIMER_PROGRAMMING),
|
||||
DEFINE_KEYCODE(HELP),
|
||||
DEFINE_KEYCODE(NAVIGATE_PREVIOUS),
|
||||
DEFINE_KEYCODE(NAVIGATE_NEXT),
|
||||
DEFINE_KEYCODE(NAVIGATE_IN),
|
||||
DEFINE_KEYCODE(NAVIGATE_OUT),
|
||||
DEFINE_KEYCODE(STEM_PRIMARY),
|
||||
DEFINE_KEYCODE(STEM_1),
|
||||
DEFINE_KEYCODE(STEM_2),
|
||||
DEFINE_KEYCODE(STEM_3),
|
||||
DEFINE_KEYCODE(MEDIA_SKIP_FORWARD),
|
||||
DEFINE_KEYCODE(MEDIA_SKIP_BACKWARD),
|
||||
DEFINE_KEYCODE(MEDIA_STEP_FORWARD),
|
||||
DEFINE_KEYCODE(MEDIA_STEP_BACKWARD),
|
||||
DEFINE_KEYCODE(SOFT_SLEEP),
|
||||
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
static const InputEventLabel AXES[] = {
|
||||
DEFINE_AXIS(X),
|
||||
DEFINE_AXIS(Y),
|
||||
DEFINE_AXIS(PRESSURE),
|
||||
DEFINE_AXIS(SIZE),
|
||||
DEFINE_AXIS(TOUCH_MAJOR),
|
||||
DEFINE_AXIS(TOUCH_MINOR),
|
||||
DEFINE_AXIS(TOOL_MAJOR),
|
||||
DEFINE_AXIS(TOOL_MINOR),
|
||||
DEFINE_AXIS(ORIENTATION),
|
||||
DEFINE_AXIS(VSCROLL),
|
||||
DEFINE_AXIS(HSCROLL),
|
||||
DEFINE_AXIS(Z),
|
||||
DEFINE_AXIS(RX),
|
||||
DEFINE_AXIS(RY),
|
||||
DEFINE_AXIS(RZ),
|
||||
DEFINE_AXIS(HAT_X),
|
||||
DEFINE_AXIS(HAT_Y),
|
||||
DEFINE_AXIS(LTRIGGER),
|
||||
DEFINE_AXIS(RTRIGGER),
|
||||
DEFINE_AXIS(THROTTLE),
|
||||
DEFINE_AXIS(RUDDER),
|
||||
DEFINE_AXIS(WHEEL),
|
||||
DEFINE_AXIS(GAS),
|
||||
DEFINE_AXIS(BRAKE),
|
||||
DEFINE_AXIS(DISTANCE),
|
||||
DEFINE_AXIS(TILT),
|
||||
DEFINE_AXIS(GENERIC_1),
|
||||
DEFINE_AXIS(GENERIC_2),
|
||||
DEFINE_AXIS(GENERIC_3),
|
||||
DEFINE_AXIS(GENERIC_4),
|
||||
DEFINE_AXIS(GENERIC_5),
|
||||
DEFINE_AXIS(GENERIC_6),
|
||||
DEFINE_AXIS(GENERIC_7),
|
||||
DEFINE_AXIS(GENERIC_8),
|
||||
DEFINE_AXIS(GENERIC_9),
|
||||
DEFINE_AXIS(GENERIC_10),
|
||||
DEFINE_AXIS(GENERIC_11),
|
||||
DEFINE_AXIS(GENERIC_12),
|
||||
DEFINE_AXIS(GENERIC_13),
|
||||
DEFINE_AXIS(GENERIC_14),
|
||||
DEFINE_AXIS(GENERIC_15),
|
||||
DEFINE_AXIS(GENERIC_16),
|
||||
|
||||
// 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, 0 }
|
||||
};
|
||||
|
||||
static const InputEventLabel LEDS[] = {
|
||||
DEFINE_LED(NUM_LOCK),
|
||||
DEFINE_LED(CAPS_LOCK),
|
||||
DEFINE_LED(SCROLL_LOCK),
|
||||
DEFINE_LED(COMPOSE),
|
||||
DEFINE_LED(KANA),
|
||||
DEFINE_LED(SLEEP),
|
||||
DEFINE_LED(SUSPEND),
|
||||
DEFINE_LED(MUTE),
|
||||
DEFINE_LED(MISC),
|
||||
DEFINE_LED(MAIL),
|
||||
DEFINE_LED(CHARGING),
|
||||
DEFINE_LED(CONTROLLER_1),
|
||||
DEFINE_LED(CONTROLLER_2),
|
||||
DEFINE_LED(CONTROLLER_3),
|
||||
DEFINE_LED(CONTROLLER_4),
|
||||
|
||||
// NOTE: If you add new LEDs here, you must also add them to Input.h
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
static const InputEventLabel FLAGS[] = {
|
||||
DEFINE_FLAG(WAKE),
|
||||
DEFINE_FLAG(VIRTUAL),
|
||||
DEFINE_FLAG(FUNCTION),
|
||||
DEFINE_FLAG(GESTURE),
|
||||
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
static int lookupValueByLabel(const char* literal, const InputEventLabel *list) {
|
||||
while (list->literal) {
|
||||
if (strcmp(literal, list->literal) == 0) {
|
||||
return list->value;
|
||||
}
|
||||
list++;
|
||||
}
|
||||
return list->value;
|
||||
}
|
||||
|
||||
static const char* lookupLabelByValue(int value, const InputEventLabel* list) {
|
||||
while (list->literal) {
|
||||
if (list->value == value) {
|
||||
return list->literal;
|
||||
}
|
||||
list++;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int32_t getKeyCodeByLabel(const char* label) {
|
||||
return int32_t(lookupValueByLabel(label, KEYCODES));
|
||||
}
|
||||
|
||||
static const char* getLabelByKeyCode(int32_t keyCode) {
|
||||
if (keyCode >= 0 && keyCode < size(KEYCODES)) {
|
||||
return KEYCODES[keyCode].literal;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static uint32_t getKeyFlagByLabel(const char* label) {
|
||||
return uint32_t(lookupValueByLabel(label, FLAGS));
|
||||
}
|
||||
|
||||
static int32_t getAxisByLabel(const char* label) {
|
||||
return int32_t(lookupValueByLabel(label, AXES));
|
||||
}
|
||||
|
||||
static const char* getAxisLabel(int32_t axisId) {
|
||||
return lookupLabelByValue(axisId, AXES);
|
||||
}
|
||||
|
||||
static int32_t getLedByLabel(const char* label) {
|
||||
return int32_t(lookupValueByLabel(label, LEDS));
|
||||
}
|
||||
|
||||
|
||||
} // namespace android
|
||||
#endif // _LIBINPUT_INPUT_EVENT_LABELS_H
|
|
@ -1,453 +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 _LIBINPUT_INPUT_TRANSPORT_H
|
||||
#define _LIBINPUT_INPUT_TRANSPORT_H
|
||||
|
||||
/**
|
||||
* Native input transport.
|
||||
*
|
||||
* The InputChannel provides a mechanism for exchanging InputMessage structures across processes.
|
||||
*
|
||||
* The InputPublisher and InputConsumer each handle one end-point of an input channel.
|
||||
* The InputPublisher is used by the input dispatcher to send events to the application.
|
||||
* The InputConsumer is used by the application to receive events from the input dispatcher.
|
||||
*/
|
||||
|
||||
#include <input/Input.h>
|
||||
#include <utils/Errors.h>
|
||||
#include <utils/Timers.h>
|
||||
#include <utils/RefBase.h>
|
||||
#include <utils/String8.h>
|
||||
#include <utils/Vector.h>
|
||||
#include <utils/BitSet.h>
|
||||
|
||||
namespace android {
|
||||
|
||||
/*
|
||||
* Intermediate representation used to send input events and related signals.
|
||||
*
|
||||
* Note that this structure is used for IPCs so its layout must be identical
|
||||
* on 64 and 32 bit processes. This is tested in StructLayout_test.cpp.
|
||||
*/
|
||||
struct InputMessage {
|
||||
enum {
|
||||
TYPE_KEY = 1,
|
||||
TYPE_MOTION = 2,
|
||||
TYPE_FINISHED = 3,
|
||||
};
|
||||
|
||||
struct Header {
|
||||
uint32_t type;
|
||||
// We don't need this field in order to align the body below but we
|
||||
// leave it here because InputMessage::size() and other functions
|
||||
// compute the size of this structure as sizeof(Header) + sizeof(Body).
|
||||
uint32_t padding;
|
||||
} header;
|
||||
|
||||
// Body *must* be 8 byte aligned.
|
||||
union Body {
|
||||
struct Key {
|
||||
uint32_t seq;
|
||||
nsecs_t eventTime __attribute__((aligned(8)));
|
||||
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 __attribute__((aligned(8)));
|
||||
|
||||
inline size_t size() const {
|
||||
return sizeof(Key);
|
||||
}
|
||||
} key;
|
||||
|
||||
struct Motion {
|
||||
uint32_t seq;
|
||||
nsecs_t eventTime __attribute__((aligned(8)));
|
||||
int32_t deviceId;
|
||||
int32_t source;
|
||||
int32_t action;
|
||||
int32_t actionButton;
|
||||
int32_t flags;
|
||||
int32_t metaState;
|
||||
int32_t buttonState;
|
||||
int32_t edgeFlags;
|
||||
nsecs_t downTime __attribute__((aligned(8)));
|
||||
float xOffset;
|
||||
float yOffset;
|
||||
float xPrecision;
|
||||
float yPrecision;
|
||||
uint32_t pointerCount;
|
||||
// Note that PointerCoords requires 8 byte alignment.
|
||||
struct Pointer {
|
||||
PointerProperties properties;
|
||||
PointerCoords coords;
|
||||
} pointers[MAX_POINTERS];
|
||||
|
||||
int32_t getActionId() const {
|
||||
uint32_t index = (action & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK)
|
||||
>> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT;
|
||||
return pointers[index].properties.id;
|
||||
}
|
||||
|
||||
inline size_t size() const {
|
||||
return sizeof(Motion) - sizeof(Pointer) * MAX_POINTERS
|
||||
+ sizeof(Pointer) * pointerCount;
|
||||
}
|
||||
} motion;
|
||||
|
||||
struct Finished {
|
||||
uint32_t seq;
|
||||
bool handled;
|
||||
|
||||
inline size_t size() const {
|
||||
return sizeof(Finished);
|
||||
}
|
||||
} finished;
|
||||
} __attribute__((aligned(8))) body;
|
||||
|
||||
bool isValid(size_t actualSize) const;
|
||||
size_t size() const;
|
||||
};
|
||||
|
||||
/*
|
||||
* An input channel consists of a local unix domain socket used to send and receive
|
||||
* input messages across processes. Each channel has a descriptive name for debugging purposes.
|
||||
*
|
||||
* Each endpoint has its own InputChannel object that specifies its file descriptor.
|
||||
*
|
||||
* The input channel is closed when all references to it are released.
|
||||
*/
|
||||
class InputChannel : public RefBase {
|
||||
protected:
|
||||
virtual ~InputChannel();
|
||||
|
||||
public:
|
||||
InputChannel(const String8& name, int fd);
|
||||
|
||||
/* Creates a pair of input channels.
|
||||
*
|
||||
* Returns OK on success.
|
||||
*/
|
||||
static status_t openInputChannelPair(const String8& name,
|
||||
sp<InputChannel>& outServerChannel, sp<InputChannel>& outClientChannel);
|
||||
|
||||
inline String8 getName() const { return mName; }
|
||||
inline int getFd() const { return mFd; }
|
||||
|
||||
/* Sends a message to the other endpoint.
|
||||
*
|
||||
* If the channel is full then the message is guaranteed not to have been sent at all.
|
||||
* Try again after the consumer has sent a finished signal indicating that it has
|
||||
* consumed some of the pending messages from the channel.
|
||||
*
|
||||
* Returns OK on success.
|
||||
* Returns WOULD_BLOCK if the channel is full.
|
||||
* Returns DEAD_OBJECT if the channel's peer has been closed.
|
||||
* Other errors probably indicate that the channel is broken.
|
||||
*/
|
||||
status_t sendMessage(const InputMessage* msg);
|
||||
|
||||
/* Receives a message sent by the other endpoint.
|
||||
*
|
||||
* If there is no message present, try again after poll() indicates that the fd
|
||||
* is readable.
|
||||
*
|
||||
* Returns OK on success.
|
||||
* Returns WOULD_BLOCK if there is no message present.
|
||||
* Returns DEAD_OBJECT if the channel's peer has been closed.
|
||||
* Other errors probably indicate that the channel is broken.
|
||||
*/
|
||||
status_t receiveMessage(InputMessage* msg);
|
||||
|
||||
/* Returns a new object that has a duplicate of this channel's fd. */
|
||||
sp<InputChannel> dup() const;
|
||||
|
||||
private:
|
||||
String8 mName;
|
||||
int mFd;
|
||||
};
|
||||
|
||||
/*
|
||||
* Publishes input events to an input channel.
|
||||
*/
|
||||
class InputPublisher {
|
||||
public:
|
||||
/* Creates a publisher associated with an input channel. */
|
||||
explicit InputPublisher(const sp<InputChannel>& channel);
|
||||
|
||||
/* Destroys the publisher and releases its input channel. */
|
||||
~InputPublisher();
|
||||
|
||||
/* Gets the underlying input channel. */
|
||||
inline sp<InputChannel> getChannel() { return mChannel; }
|
||||
|
||||
/* Publishes a key event to the input channel.
|
||||
*
|
||||
* Returns OK on success.
|
||||
* Returns WOULD_BLOCK if the channel is full.
|
||||
* Returns DEAD_OBJECT if the channel's peer has been closed.
|
||||
* Returns BAD_VALUE if seq is 0.
|
||||
* Other errors probably indicate that the channel is broken.
|
||||
*/
|
||||
status_t publishKeyEvent(
|
||||
uint32_t seq,
|
||||
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 input channel.
|
||||
*
|
||||
* Returns OK on success.
|
||||
* Returns WOULD_BLOCK if the channel is full.
|
||||
* Returns DEAD_OBJECT if the channel's peer has been closed.
|
||||
* Returns BAD_VALUE if seq is 0 or if pointerCount is less than 1 or greater than MAX_POINTERS.
|
||||
* Other errors probably indicate that the channel is broken.
|
||||
*/
|
||||
status_t publishMotionEvent(
|
||||
uint32_t seq,
|
||||
int32_t deviceId,
|
||||
int32_t source,
|
||||
int32_t action,
|
||||
int32_t actionButton,
|
||||
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,
|
||||
uint32_t pointerCount,
|
||||
const PointerProperties* pointerProperties,
|
||||
const PointerCoords* pointerCoords);
|
||||
|
||||
/* Receives the finished signal from the consumer in reply to the original dispatch signal.
|
||||
* If a signal was received, returns the message sequence number,
|
||||
* and whether the consumer handled the message.
|
||||
*
|
||||
* The returned sequence number is never 0 unless the operation failed.
|
||||
*
|
||||
* 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 receiveFinishedSignal(uint32_t* outSeq, bool* outHandled);
|
||||
|
||||
private:
|
||||
sp<InputChannel> mChannel;
|
||||
};
|
||||
|
||||
/*
|
||||
* Consumes input events from an input channel.
|
||||
*/
|
||||
class InputConsumer {
|
||||
public:
|
||||
/* Creates a consumer associated with an input channel. */
|
||||
explicit InputConsumer(const sp<InputChannel>& channel);
|
||||
|
||||
/* Destroys the consumer and releases its input channel. */
|
||||
~InputConsumer();
|
||||
|
||||
/* Gets the underlying input channel. */
|
||||
inline sp<InputChannel> getChannel() { return mChannel; }
|
||||
|
||||
/* Consumes an input event from the input channel and copies its contents into
|
||||
* an InputEvent object created using the specified factory.
|
||||
*
|
||||
* Tries to combine a series of move events into larger batches whenever possible.
|
||||
*
|
||||
* If consumeBatches is false, then defers consuming pending batched events if it
|
||||
* is possible for additional samples to be added to them later. Call hasPendingBatch()
|
||||
* to determine whether a pending batch is available to be consumed.
|
||||
*
|
||||
* If consumeBatches is true, then events are still batched but they are consumed
|
||||
* immediately as soon as the input channel is exhausted.
|
||||
*
|
||||
* The frameTime parameter specifies the time when the current display frame started
|
||||
* rendering in the CLOCK_MONOTONIC time base, or -1 if unknown.
|
||||
*
|
||||
* The returned sequence number is never 0 unless the operation failed.
|
||||
*
|
||||
* Returns OK on success.
|
||||
* Returns WOULD_BLOCK if there is no event present.
|
||||
* Returns DEAD_OBJECT if the channel's peer has been closed.
|
||||
* Returns NO_MEMORY if the event could not be created.
|
||||
* Other errors probably indicate that the channel is broken.
|
||||
*/
|
||||
status_t consume(InputEventFactoryInterface* factory, bool consumeBatches,
|
||||
nsecs_t frameTime, uint32_t* outSeq, InputEvent** outEvent);
|
||||
|
||||
/* Sends a finished signal to the publisher to inform it that the message
|
||||
* with the specified sequence number has finished being process and whether
|
||||
* the message was handled by the consumer.
|
||||
*
|
||||
* Returns OK on success.
|
||||
* Returns BAD_VALUE if seq is 0.
|
||||
* Other errors probably indicate that the channel is broken.
|
||||
*/
|
||||
status_t sendFinishedSignal(uint32_t seq, bool handled);
|
||||
|
||||
/* Returns true if there is a deferred event waiting.
|
||||
*
|
||||
* Should be called after calling consume() to determine whether the consumer
|
||||
* has a deferred event to be processed. Deferred events are somewhat special in
|
||||
* that they have already been removed from the input channel. If the input channel
|
||||
* becomes empty, the client may need to do extra work to ensure that it processes
|
||||
* the deferred event despite the fact that the input channel's file descriptor
|
||||
* is not readable.
|
||||
*
|
||||
* One option is simply to call consume() in a loop until it returns WOULD_BLOCK.
|
||||
* This guarantees that all deferred events will be processed.
|
||||
*
|
||||
* Alternately, the caller can call hasDeferredEvent() to determine whether there is
|
||||
* a deferred event waiting and then ensure that its event loop wakes up at least
|
||||
* one more time to consume the deferred event.
|
||||
*/
|
||||
bool hasDeferredEvent() const;
|
||||
|
||||
/* Returns true if there is a pending batch.
|
||||
*
|
||||
* Should be called after calling consume() with consumeBatches == false to determine
|
||||
* whether consume() should be called again later on with consumeBatches == true.
|
||||
*/
|
||||
bool hasPendingBatch() const;
|
||||
|
||||
private:
|
||||
// True if touch resampling is enabled.
|
||||
const bool mResampleTouch;
|
||||
|
||||
// The input channel.
|
||||
sp<InputChannel> mChannel;
|
||||
|
||||
// The current input message.
|
||||
InputMessage mMsg;
|
||||
|
||||
// True if mMsg contains a valid input message that was deferred from the previous
|
||||
// call to consume and that still needs to be handled.
|
||||
bool mMsgDeferred;
|
||||
|
||||
// Batched motion events per device and source.
|
||||
struct Batch {
|
||||
Vector<InputMessage> samples;
|
||||
};
|
||||
Vector<Batch> mBatches;
|
||||
|
||||
// Touch state per device and source, only for sources of class pointer.
|
||||
struct History {
|
||||
nsecs_t eventTime;
|
||||
BitSet32 idBits;
|
||||
int32_t idToIndex[MAX_POINTER_ID + 1];
|
||||
PointerCoords pointers[MAX_POINTERS];
|
||||
|
||||
void initializeFrom(const InputMessage* msg) {
|
||||
eventTime = msg->body.motion.eventTime;
|
||||
idBits.clear();
|
||||
for (uint32_t i = 0; i < msg->body.motion.pointerCount; i++) {
|
||||
uint32_t id = msg->body.motion.pointers[i].properties.id;
|
||||
idBits.markBit(id);
|
||||
idToIndex[id] = i;
|
||||
pointers[i].copyFrom(msg->body.motion.pointers[i].coords);
|
||||
}
|
||||
}
|
||||
|
||||
const PointerCoords& getPointerById(uint32_t id) const {
|
||||
return pointers[idToIndex[id]];
|
||||
}
|
||||
};
|
||||
struct TouchState {
|
||||
int32_t deviceId;
|
||||
int32_t source;
|
||||
size_t historyCurrent;
|
||||
size_t historySize;
|
||||
History history[2];
|
||||
History lastResample;
|
||||
|
||||
void initialize(int32_t deviceId, int32_t source) {
|
||||
this->deviceId = deviceId;
|
||||
this->source = source;
|
||||
historyCurrent = 0;
|
||||
historySize = 0;
|
||||
lastResample.eventTime = 0;
|
||||
lastResample.idBits.clear();
|
||||
}
|
||||
|
||||
void addHistory(const InputMessage* msg) {
|
||||
historyCurrent ^= 1;
|
||||
if (historySize < 2) {
|
||||
historySize += 1;
|
||||
}
|
||||
history[historyCurrent].initializeFrom(msg);
|
||||
}
|
||||
|
||||
const History* getHistory(size_t index) const {
|
||||
return &history[(historyCurrent + index) & 1];
|
||||
}
|
||||
};
|
||||
Vector<TouchState> mTouchStates;
|
||||
|
||||
// Chain of batched sequence numbers. When multiple input messages are combined into
|
||||
// a batch, we append a record here that associates the last sequence number in the
|
||||
// batch with the previous one. When the finished signal is sent, we traverse the
|
||||
// chain to individually finish all input messages that were part of the batch.
|
||||
struct SeqChain {
|
||||
uint32_t seq; // sequence number of batched input message
|
||||
uint32_t chain; // sequence number of previous batched input message
|
||||
};
|
||||
Vector<SeqChain> mSeqChains;
|
||||
|
||||
status_t consumeBatch(InputEventFactoryInterface* factory,
|
||||
nsecs_t frameTime, uint32_t* outSeq, InputEvent** outEvent);
|
||||
status_t consumeSamples(InputEventFactoryInterface* factory,
|
||||
Batch& batch, size_t count, uint32_t* outSeq, InputEvent** outEvent);
|
||||
|
||||
void updateTouchState(InputMessage* msg);
|
||||
void rewriteMessage(const TouchState& state, InputMessage* msg);
|
||||
void resampleTouchState(nsecs_t frameTime, MotionEvent* event,
|
||||
const InputMessage *next);
|
||||
|
||||
ssize_t findBatch(int32_t deviceId, int32_t source) const;
|
||||
ssize_t findTouchState(int32_t deviceId, int32_t source) const;
|
||||
|
||||
status_t sendUnchainedFinishedSignal(uint32_t seq, bool handled);
|
||||
|
||||
static void initializeKeyEvent(KeyEvent* event, const InputMessage* msg);
|
||||
static void initializeMotionEvent(MotionEvent* event, const InputMessage* msg);
|
||||
static void addSample(MotionEvent* event, const InputMessage* msg);
|
||||
static bool canAddSample(const Batch& batch, const InputMessage* msg);
|
||||
static ssize_t findSampleNoLaterThan(const Batch& batch, nsecs_t time);
|
||||
static bool shouldResampleTool(int32_t toolType);
|
||||
|
||||
static bool isTouchResamplingEnabled();
|
||||
};
|
||||
|
||||
} // namespace android
|
||||
|
||||
#endif // _LIBINPUT_INPUT_TRANSPORT_H
|
|
@ -1,265 +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 _LIBINPUT_KEY_CHARACTER_MAP_H
|
||||
#define _LIBINPUT_KEY_CHARACTER_MAP_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#if HAVE_ANDROID_OS
|
||||
#include <binder/IBinder.h>
|
||||
#endif
|
||||
|
||||
#include <input/Input.h>
|
||||
#include <utils/Errors.h>
|
||||
#include <utils/KeyedVector.h>
|
||||
#include <utils/Tokenizer.h>
|
||||
#include <utils/String8.h>
|
||||
#include <utils/Unicode.h>
|
||||
#include <utils/RefBase.h>
|
||||
|
||||
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.
|
||||
*
|
||||
* This object is immutable after it has been loaded.
|
||||
*/
|
||||
class KeyCharacterMap : public RefBase {
|
||||
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,
|
||||
KEYBOARD_TYPE_OVERLAY = 6,
|
||||
};
|
||||
|
||||
enum Format {
|
||||
// Base keyboard layout, may contain device-specific options, such as "type" declaration.
|
||||
FORMAT_BASE = 0,
|
||||
// Overlay keyboard layout, more restrictive, may be published by applications,
|
||||
// cannot override device-specific options.
|
||||
FORMAT_OVERLAY = 1,
|
||||
// Either base or overlay layout ok.
|
||||
FORMAT_ANY = 2,
|
||||
};
|
||||
|
||||
// Substitute key code and meta state for fallback action.
|
||||
struct FallbackAction {
|
||||
int32_t keyCode;
|
||||
int32_t metaState;
|
||||
};
|
||||
|
||||
/* Loads a key character map from a file. */
|
||||
static status_t load(const String8& filename, Format format, sp<KeyCharacterMap>* outMap);
|
||||
|
||||
/* Loads a key character map from its string contents. */
|
||||
static status_t loadContents(const String8& filename,
|
||||
const char* contents, Format format, sp<KeyCharacterMap>* outMap);
|
||||
|
||||
/* Combines a base key character map and an overlay. */
|
||||
static sp<KeyCharacterMap> combine(const sp<KeyCharacterMap>& base,
|
||||
const sp<KeyCharacterMap>& overlay);
|
||||
|
||||
/* Returns an empty key character map. */
|
||||
static sp<KeyCharacterMap> empty();
|
||||
|
||||
/* 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<KeyEvent>& outEvents) const;
|
||||
|
||||
/* Maps a scan code and usage code to a key code, in case this key map overrides
|
||||
* the mapping in some way. */
|
||||
status_t mapKey(int32_t scanCode, int32_t usageCode, int32_t* outKeyCode) const;
|
||||
|
||||
/* Tries to find a replacement key code for a given key code and meta state
|
||||
* in character map. */
|
||||
void tryRemapKey(int32_t scanCode, int32_t metaState,
|
||||
int32_t* outKeyCode, int32_t* outMetaState) const;
|
||||
|
||||
#if HAVE_ANDROID_OS
|
||||
/* Reads a key map from a parcel. */
|
||||
static sp<KeyCharacterMap> readFromParcel(Parcel* parcel);
|
||||
|
||||
/* Writes a key map to a parcel. */
|
||||
void writeToParcel(Parcel* parcel) const;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual ~KeyCharacterMap();
|
||||
|
||||
private:
|
||||
struct Behavior {
|
||||
Behavior();
|
||||
Behavior(const Behavior& other);
|
||||
|
||||
/* 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;
|
||||
|
||||
/* The replacement keycode if the key has to be replaced outright. */
|
||||
int32_t replacementKeyCode;
|
||||
};
|
||||
|
||||
struct Key {
|
||||
Key();
|
||||
Key(const Key& other);
|
||||
~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;
|
||||
Format mFormat;
|
||||
State mState;
|
||||
int32_t mKeyCode;
|
||||
|
||||
public:
|
||||
Parser(KeyCharacterMap* map, Tokenizer* tokenizer, Format format);
|
||||
~Parser();
|
||||
status_t parse();
|
||||
|
||||
private:
|
||||
status_t parseType();
|
||||
status_t parseMap();
|
||||
status_t parseMapKey();
|
||||
status_t parseKey();
|
||||
status_t parseKeyProperty();
|
||||
status_t finishKey(Key* key);
|
||||
status_t parseModifier(const String8& token, int32_t* outMetaState);
|
||||
status_t parseCharacterLiteral(char16_t* outCharacter);
|
||||
};
|
||||
|
||||
static sp<KeyCharacterMap> sEmpty;
|
||||
|
||||
KeyedVector<int32_t, Key*> mKeys;
|
||||
int mType;
|
||||
|
||||
KeyedVector<int32_t, int32_t> mKeysByScanCode;
|
||||
KeyedVector<int32_t, int32_t> mKeysByUsageCode;
|
||||
|
||||
KeyCharacterMap();
|
||||
KeyCharacterMap(const KeyCharacterMap& other);
|
||||
|
||||
bool getKey(int32_t keyCode, const Key** outKey) const;
|
||||
bool getKeyBehavior(int32_t keyCode, int32_t metaState,
|
||||
const Key** outKey, const Behavior** outBehavior) const;
|
||||
static bool matchesMetaState(int32_t eventMetaState, int32_t behaviorMetaState);
|
||||
|
||||
bool findKey(char16_t ch, int32_t* outKeyCode, int32_t* outMetaState) const;
|
||||
|
||||
static status_t load(Tokenizer* tokenizer, Format format, sp<KeyCharacterMap>* outMap);
|
||||
|
||||
static void addKey(Vector<KeyEvent>& outEvents,
|
||||
int32_t deviceId, int32_t keyCode, int32_t metaState, bool down, nsecs_t time);
|
||||
static void addMetaKeys(Vector<KeyEvent>& outEvents,
|
||||
int32_t deviceId, int32_t metaState, bool down, nsecs_t time,
|
||||
int32_t* currentMetaState);
|
||||
static bool addSingleEphemeralMetaKey(Vector<KeyEvent>& 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<KeyEvent>& 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<KeyEvent>& outEvents,
|
||||
int32_t deviceId, int32_t metaState, nsecs_t time,
|
||||
int32_t keyCode, int32_t keyMetaState,
|
||||
int32_t* currentMetaState);
|
||||
};
|
||||
|
||||
} // namespace android
|
||||
|
||||
#endif // _LIBINPUT_KEY_CHARACTER_MAP_H
|
|
@ -1,117 +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 _LIBINPUT_KEY_LAYOUT_MAP_H
|
||||
#define _LIBINPUT_KEY_LAYOUT_MAP_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <utils/Errors.h>
|
||||
#include <utils/KeyedVector.h>
|
||||
#include <utils/Tokenizer.h>
|
||||
#include <utils/RefBase.h>
|
||||
|
||||
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.
|
||||
*
|
||||
* This object is immutable after it has been loaded.
|
||||
*/
|
||||
class KeyLayoutMap : public RefBase {
|
||||
public:
|
||||
static status_t load(const String8& filename, sp<KeyLayoutMap>* outMap);
|
||||
|
||||
status_t mapKey(int32_t scanCode, int32_t usageCode,
|
||||
int32_t* outKeyCode, uint32_t* outFlags) const;
|
||||
status_t findScanCodesForKey(int32_t keyCode, Vector<int32_t>* outScanCodes) const;
|
||||
status_t findScanCodeForLed(int32_t ledCode, int32_t* outScanCode) const;
|
||||
status_t findUsageCodeForLed(int32_t ledCode, int32_t* outUsageCode) const;
|
||||
|
||||
status_t mapAxis(int32_t scanCode, AxisInfo* outAxisInfo) const;
|
||||
|
||||
protected:
|
||||
virtual ~KeyLayoutMap();
|
||||
|
||||
private:
|
||||
struct Key {
|
||||
int32_t keyCode;
|
||||
uint32_t flags;
|
||||
};
|
||||
|
||||
struct Led {
|
||||
int32_t ledCode;
|
||||
};
|
||||
|
||||
|
||||
KeyedVector<int32_t, Key> mKeysByScanCode;
|
||||
KeyedVector<int32_t, Key> mKeysByUsageCode;
|
||||
KeyedVector<int32_t, AxisInfo> mAxes;
|
||||
KeyedVector<int32_t, Led> mLedsByScanCode;
|
||||
KeyedVector<int32_t, Led> mLedsByUsageCode;
|
||||
|
||||
KeyLayoutMap();
|
||||
|
||||
const Key* getKey(int32_t scanCode, int32_t usageCode) const;
|
||||
|
||||
class Parser {
|
||||
KeyLayoutMap* mMap;
|
||||
Tokenizer* mTokenizer;
|
||||
|
||||
public:
|
||||
Parser(KeyLayoutMap* map, Tokenizer* tokenizer);
|
||||
~Parser();
|
||||
status_t parse();
|
||||
|
||||
private:
|
||||
status_t parseKey();
|
||||
status_t parseAxis();
|
||||
status_t parseLed();
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace android
|
||||
|
||||
#endif // _LIBINPUT_KEY_LAYOUT_MAP_H
|
|
@ -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 _LIBINPUT_KEYBOARD_H
|
||||
#define _LIBINPUT_KEYBOARD_H
|
||||
|
||||
#include <input/Input.h>
|
||||
#include <input/InputDevice.h>
|
||||
#include <input/InputEventLabels.h>
|
||||
#include <utils/Errors.h>
|
||||
#include <utils/String8.h>
|
||||
#include <utils/PropertyMap.h>
|
||||
|
||||
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;
|
||||
sp<KeyLayoutMap> keyLayoutMap;
|
||||
|
||||
String8 keyCharacterMapFile;
|
||||
sp<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);
|
||||
|
||||
/**
|
||||
* Updates a meta state field when a key is pressed or released.
|
||||
*/
|
||||
extern int32_t updateMetaState(int32_t keyCode, bool down, int32_t oldMetaState);
|
||||
|
||||
/**
|
||||
* Normalizes the meta state such that if either the left or right modifier
|
||||
* meta state bits are set then the result will also include the universal
|
||||
* bit for that modifier.
|
||||
*/
|
||||
extern int32_t normalizeMetaState(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 // _LIBINPUT_KEYBOARD_H
|
|
@ -1,107 +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 _LIBINPUT_VELOCITY_CONTROL_H
|
||||
#define _LIBINPUT_VELOCITY_CONTROL_H
|
||||
|
||||
#include <input/Input.h>
|
||||
#include <input/VelocityTracker.h>
|
||||
#include <utils/Timers.h>
|
||||
|
||||
namespace android {
|
||||
|
||||
/*
|
||||
* 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;
|
||||
};
|
||||
|
||||
} // namespace android
|
||||
|
||||
#endif // _LIBINPUT_VELOCITY_CONTROL_H
|
|
@ -1,269 +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 _LIBINPUT_VELOCITY_TRACKER_H
|
||||
#define _LIBINPUT_VELOCITY_TRACKER_H
|
||||
|
||||
#include <input/Input.h>
|
||||
#include <utils/Timers.h>
|
||||
#include <utils/BitSet.h>
|
||||
|
||||
namespace android {
|
||||
|
||||
class VelocityTrackerStrategy;
|
||||
|
||||
/*
|
||||
* Calculates the velocity of pointer movements over time.
|
||||
*/
|
||||
class VelocityTracker {
|
||||
public:
|
||||
struct Position {
|
||||
float x, y;
|
||||
};
|
||||
|
||||
struct Estimator {
|
||||
static const size_t MAX_DEGREE = 4;
|
||||
|
||||
// Estimator time base.
|
||||
nsecs_t time;
|
||||
|
||||
// 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() {
|
||||
time = 0;
|
||||
degree = 0;
|
||||
confidence = 0;
|
||||
for (size_t i = 0; i <= MAX_DEGREE; i++) {
|
||||
xCoeff[i] = 0;
|
||||
yCoeff[i] = 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Creates a velocity tracker using the specified strategy.
|
||||
// If strategy is NULL, uses the default strategy for the platform.
|
||||
VelocityTracker(const char* strategy = NULL);
|
||||
|
||||
~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 an estimator for the recent 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, 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 mCurrentPointerIdBits; }
|
||||
|
||||
private:
|
||||
static const char* DEFAULT_STRATEGY;
|
||||
|
||||
nsecs_t mLastEventTime;
|
||||
BitSet32 mCurrentPointerIdBits;
|
||||
int32_t mActivePointerId;
|
||||
VelocityTrackerStrategy* mStrategy;
|
||||
|
||||
bool configureStrategy(const char* strategy);
|
||||
|
||||
static VelocityTrackerStrategy* createStrategy(const char* strategy);
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Implements a particular velocity tracker algorithm.
|
||||
*/
|
||||
class VelocityTrackerStrategy {
|
||||
protected:
|
||||
VelocityTrackerStrategy() { }
|
||||
|
||||
public:
|
||||
virtual ~VelocityTrackerStrategy() { }
|
||||
|
||||
virtual void clear() = 0;
|
||||
virtual void clearPointers(BitSet32 idBits) = 0;
|
||||
virtual void addMovement(nsecs_t eventTime, BitSet32 idBits,
|
||||
const VelocityTracker::Position* positions) = 0;
|
||||
virtual bool getEstimator(uint32_t id, VelocityTracker::Estimator* outEstimator) const = 0;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Velocity tracker algorithm based on least-squares linear regression.
|
||||
*/
|
||||
class LeastSquaresVelocityTrackerStrategy : public VelocityTrackerStrategy {
|
||||
public:
|
||||
enum Weighting {
|
||||
// No weights applied. All data points are equally reliable.
|
||||
WEIGHTING_NONE,
|
||||
|
||||
// Weight by time delta. Data points clustered together are weighted less.
|
||||
WEIGHTING_DELTA,
|
||||
|
||||
// Weight such that points within a certain horizon are weighed more than those
|
||||
// outside of that horizon.
|
||||
WEIGHTING_CENTRAL,
|
||||
|
||||
// Weight such that points older than a certain amount are weighed less.
|
||||
WEIGHTING_RECENT,
|
||||
};
|
||||
|
||||
// Degree must be no greater than Estimator::MAX_DEGREE.
|
||||
LeastSquaresVelocityTrackerStrategy(uint32_t degree, Weighting weighting = WEIGHTING_NONE);
|
||||
virtual ~LeastSquaresVelocityTrackerStrategy();
|
||||
|
||||
virtual void clear();
|
||||
virtual void clearPointers(BitSet32 idBits);
|
||||
virtual void addMovement(nsecs_t eventTime, BitSet32 idBits,
|
||||
const VelocityTracker::Position* positions);
|
||||
virtual bool getEstimator(uint32_t id, VelocityTracker::Estimator* outEstimator) const;
|
||||
|
||||
private:
|
||||
// Sample horizon.
|
||||
// We don't use too much history by default since we want to react to quick
|
||||
// changes in direction.
|
||||
static const nsecs_t HORIZON = 100 * 1000000; // 100 ms
|
||||
|
||||
// Number of samples to keep.
|
||||
static const uint32_t HISTORY_SIZE = 20;
|
||||
|
||||
struct Movement {
|
||||
nsecs_t eventTime;
|
||||
BitSet32 idBits;
|
||||
VelocityTracker::Position positions[MAX_POINTERS];
|
||||
|
||||
inline const VelocityTracker::Position& getPosition(uint32_t id) const {
|
||||
return positions[idBits.getIndexOfBit(id)];
|
||||
}
|
||||
};
|
||||
|
||||
float chooseWeight(uint32_t index) const;
|
||||
|
||||
const uint32_t mDegree;
|
||||
const Weighting mWeighting;
|
||||
uint32_t mIndex;
|
||||
Movement mMovements[HISTORY_SIZE];
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Velocity tracker algorithm that uses an IIR filter.
|
||||
*/
|
||||
class IntegratingVelocityTrackerStrategy : public VelocityTrackerStrategy {
|
||||
public:
|
||||
// Degree must be 1 or 2.
|
||||
IntegratingVelocityTrackerStrategy(uint32_t degree);
|
||||
~IntegratingVelocityTrackerStrategy();
|
||||
|
||||
virtual void clear();
|
||||
virtual void clearPointers(BitSet32 idBits);
|
||||
virtual void addMovement(nsecs_t eventTime, BitSet32 idBits,
|
||||
const VelocityTracker::Position* positions);
|
||||
virtual bool getEstimator(uint32_t id, VelocityTracker::Estimator* outEstimator) const;
|
||||
|
||||
private:
|
||||
// Current state estimate for a particular pointer.
|
||||
struct State {
|
||||
nsecs_t updateTime;
|
||||
uint32_t degree;
|
||||
|
||||
float xpos, xvel, xaccel;
|
||||
float ypos, yvel, yaccel;
|
||||
};
|
||||
|
||||
const uint32_t mDegree;
|
||||
BitSet32 mPointerIdBits;
|
||||
State mPointerState[MAX_POINTER_ID + 1];
|
||||
|
||||
void initState(State& state, nsecs_t eventTime, float xpos, float ypos) const;
|
||||
void updateState(State& state, nsecs_t eventTime, float xpos, float ypos) const;
|
||||
void populateEstimator(const State& state, VelocityTracker::Estimator* outEstimator) const;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Velocity tracker strategy used prior to ICS.
|
||||
*/
|
||||
class LegacyVelocityTrackerStrategy : public VelocityTrackerStrategy {
|
||||
public:
|
||||
LegacyVelocityTrackerStrategy();
|
||||
virtual ~LegacyVelocityTrackerStrategy();
|
||||
|
||||
virtual void clear();
|
||||
virtual void clearPointers(BitSet32 idBits);
|
||||
virtual void addMovement(nsecs_t eventTime, BitSet32 idBits,
|
||||
const VelocityTracker::Position* positions);
|
||||
virtual bool getEstimator(uint32_t id, VelocityTracker::Estimator* outEstimator) const;
|
||||
|
||||
private:
|
||||
// Oldest sample to consider when calculating the velocity.
|
||||
static const nsecs_t HORIZON = 200 * 1000000; // 100 ms
|
||||
|
||||
// Number of samples to keep.
|
||||
static const uint32_t HISTORY_SIZE = 20;
|
||||
|
||||
// The minimum duration between samples when estimating velocity.
|
||||
static const nsecs_t MIN_DURATION = 10 * 1000000; // 10 ms
|
||||
|
||||
struct Movement {
|
||||
nsecs_t eventTime;
|
||||
BitSet32 idBits;
|
||||
VelocityTracker::Position positions[MAX_POINTERS];
|
||||
|
||||
inline const VelocityTracker::Position& getPosition(uint32_t id) const {
|
||||
return positions[idBits.getIndexOfBit(id)];
|
||||
}
|
||||
};
|
||||
|
||||
uint32_t mIndex;
|
||||
Movement mMovements[HISTORY_SIZE];
|
||||
};
|
||||
|
||||
} // namespace android
|
||||
|
||||
#endif // _LIBINPUT_VELOCITY_TRACKER_H
|
|
@ -1,81 +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 _LIBINPUT_VIRTUAL_KEY_MAP_H
|
||||
#define _LIBINPUT_VIRTUAL_KEY_MAP_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <input/Input.h>
|
||||
#include <utils/Errors.h>
|
||||
#include <utils/KeyedVector.h>
|
||||
#include <utils/Tokenizer.h>
|
||||
#include <utils/String8.h>
|
||||
#include <utils/Unicode.h>
|
||||
|
||||
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.
|
||||
*
|
||||
* This object is immutable after it has been loaded.
|
||||
*/
|
||||
class VirtualKeyMap {
|
||||
public:
|
||||
~VirtualKeyMap();
|
||||
|
||||
static status_t load(const String8& filename, VirtualKeyMap** outMap);
|
||||
|
||||
inline const Vector<VirtualKeyDefinition>& 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<VirtualKeyDefinition> mVirtualKeys;
|
||||
|
||||
VirtualKeyMap();
|
||||
};
|
||||
|
||||
} // namespace android
|
||||
|
||||
#endif // _LIBINPUT_KEY_CHARACTER_MAP_H
|
|
@ -1,419 +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 <utils/List.h>
|
||||
#include <utils/String8.h>
|
||||
#include <utils/Vector.h>
|
||||
#include <utils/KeyedVector.h>
|
||||
#include <utils/RefBase.h>
|
||||
#include <utils/Mutex.h>
|
||||
#include <media/stagefright/foundation/ABase.h>
|
||||
|
||||
// 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,
|
||||
kDrmPluginEventSessionReclaimed,
|
||||
kDrmPluginEventExpirationUpdate,
|
||||
kDrmPluginEventKeysChange,
|
||||
};
|
||||
|
||||
// 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
|
||||
};
|
||||
|
||||
// Enumerate KeyRequestTypes to allow an app to determine the
|
||||
// type of a key request returned from getKeyRequest.
|
||||
enum KeyRequestType {
|
||||
kKeyRequestType_Unknown,
|
||||
kKeyRequestType_Initial,
|
||||
kKeyRequestType_Renewal,
|
||||
kKeyRequestType_Release
|
||||
};
|
||||
|
||||
// Enumerate KeyStatusTypes which indicate the state of a key
|
||||
enum KeyStatusType
|
||||
{
|
||||
kKeyStatusType_Usable,
|
||||
kKeyStatusType_Expired,
|
||||
kKeyStatusType_OutputNotAllowed,
|
||||
kKeyStatusType_StatusPending,
|
||||
kKeyStatusType_InternalError
|
||||
};
|
||||
|
||||
// Used by sendKeysChange to report the usability status of each
|
||||
// key to the app.
|
||||
struct KeyStatus
|
||||
{
|
||||
Vector<uint8_t> mKeyId;
|
||||
KeyStatusType mType;
|
||||
};
|
||||
|
||||
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<uint8_t> &sessionId) = 0;
|
||||
|
||||
// Close a session on the DrmPlugin object.
|
||||
virtual status_t closeSession(Vector<uint8_t> 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<uint8_t> const &scope,
|
||||
Vector<uint8_t> const &initData,
|
||||
String8 const &mimeType, KeyType keyType,
|
||||
KeyedVector<String8, String8> const &optionalParameters,
|
||||
Vector<uint8_t> &request, String8 &defaultUrl,
|
||||
KeyRequestType *keyRequestType) = 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<uint8_t> const &scope,
|
||||
Vector<uint8_t> const &response,
|
||||
Vector<uint8_t> &keySetId) = 0;
|
||||
|
||||
// Remove the current keys from a session
|
||||
virtual status_t removeKeys(Vector<uint8_t> 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<uint8_t> const &sessionId,
|
||||
Vector<uint8_t> 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<uint8_t> const &sessionId,
|
||||
KeyedVector<String8, String8> &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(String8 const &cert_type,
|
||||
String8 const &cert_authority,
|
||||
Vector<uint8_t> &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<uint8_t> const &response,
|
||||
Vector<uint8_t> &certificate,
|
||||
Vector<uint8_t> &wrapped_key) = 0;
|
||||
|
||||
// Remove device provisioning.
|
||||
virtual status_t unprovisionDevice() = 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<Vector<uint8_t> > &secureStops) = 0;
|
||||
virtual status_t getSecureStop(Vector<uint8_t> const &ssid, Vector<uint8_t> &secureStop) = 0;
|
||||
virtual status_t releaseSecureStops(Vector<uint8_t> const &ssRelease) = 0;
|
||||
virtual status_t releaseAllSecureStops() = 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<uint8_t> &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<uint8_t> 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<uint8_t> 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<uint8_t> 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<uint8_t> const &sessionId,
|
||||
Vector<uint8_t> const &keyId,
|
||||
Vector<uint8_t> const &input,
|
||||
Vector<uint8_t> const &iv,
|
||||
Vector<uint8_t> &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<uint8_t> const &sessionId,
|
||||
Vector<uint8_t> const &keyId,
|
||||
Vector<uint8_t> const &input,
|
||||
Vector<uint8_t> const &iv,
|
||||
Vector<uint8_t> &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<uint8_t> const &sessionId,
|
||||
Vector<uint8_t> const &keyId,
|
||||
Vector<uint8_t> const &message,
|
||||
Vector<uint8_t> &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<uint8_t> const &sessionId,
|
||||
Vector<uint8_t> const &keyId,
|
||||
Vector<uint8_t> const &message,
|
||||
Vector<uint8_t> const &signature,
|
||||
bool &match) = 0;
|
||||
|
||||
|
||||
// Compute an RSA signature on the provided message using the algorithm
|
||||
// specified by algorithm.
|
||||
virtual status_t signRSA(Vector<uint8_t> const &sessionId,
|
||||
String8 const &algorithm,
|
||||
Vector<uint8_t> const &message,
|
||||
Vector<uint8_t> const &wrapped_key,
|
||||
Vector<uint8_t> &signature) = 0;
|
||||
|
||||
|
||||
status_t setListener(const sp<DrmPluginListener>& listener) {
|
||||
Mutex::Autolock lock(mEventLock);
|
||||
mListener = listener;
|
||||
return OK;
|
||||
}
|
||||
|
||||
protected:
|
||||
// Plugins call these methods to deliver events to the java app
|
||||
void sendEvent(EventType eventType, int extra,
|
||||
Vector<uint8_t> const *sessionId,
|
||||
Vector<uint8_t> const *data);
|
||||
|
||||
void sendExpirationUpdate(Vector<uint8_t> const *sessionId,
|
||||
int64_t expiryTimeInMS);
|
||||
|
||||
void sendKeysChange(Vector<uint8_t> const *sessionId,
|
||||
Vector<DrmPlugin::KeyStatus> const *keyStatusList,
|
||||
bool hasNewUsableKey);
|
||||
|
||||
private:
|
||||
Mutex mEventLock;
|
||||
sp<DrmPluginListener> mListener;
|
||||
|
||||
DISALLOW_EVIL_CONSTRUCTORS(DrmPlugin);
|
||||
};
|
||||
|
||||
class DrmPluginListener: virtual public RefBase
|
||||
{
|
||||
public:
|
||||
virtual void sendEvent(DrmPlugin::EventType eventType, int extra,
|
||||
Vector<uint8_t> const *sessionId,
|
||||
Vector<uint8_t> const *data) = 0;
|
||||
|
||||
virtual void sendExpirationUpdate(Vector<uint8_t> const *sessionId,
|
||||
int64_t expiryTimeInMS) = 0;
|
||||
|
||||
virtual void sendKeysChange(Vector<uint8_t> const *sessionId,
|
||||
Vector<DrmPlugin::KeyStatus> const *keyStatusList,
|
||||
bool hasNewUsableKey) = 0;
|
||||
};
|
||||
|
||||
inline void DrmPlugin::sendEvent(EventType eventType, int extra,
|
||||
Vector<uint8_t> const *sessionId,
|
||||
Vector<uint8_t> const *data) {
|
||||
mEventLock.lock();
|
||||
sp<DrmPluginListener> listener = mListener;
|
||||
mEventLock.unlock();
|
||||
|
||||
if (listener != NULL) {
|
||||
listener->sendEvent(eventType, extra, sessionId, data);
|
||||
}
|
||||
}
|
||||
|
||||
inline void DrmPlugin::sendExpirationUpdate(Vector<uint8_t> const *sessionId,
|
||||
int64_t expiryTimeInMS) {
|
||||
mEventLock.lock();
|
||||
sp<DrmPluginListener> listener = mListener;
|
||||
mEventLock.unlock();
|
||||
|
||||
if (listener != NULL) {
|
||||
listener->sendExpirationUpdate(sessionId, expiryTimeInMS);
|
||||
}
|
||||
}
|
||||
|
||||
inline void DrmPlugin::sendKeysChange(Vector<uint8_t> const *sessionId,
|
||||
Vector<DrmPlugin::KeyStatus> const *keyStatusList,
|
||||
bool hasNewUsableKey) {
|
||||
mEventLock.lock();
|
||||
sp<DrmPluginListener> listener = mListener;
|
||||
mEventLock.unlock();
|
||||
|
||||
if (listener != NULL) {
|
||||
listener->sendKeysChange(sessionId, keyStatusList, hasNewUsableKey);
|
||||
}
|
||||
}
|
||||
} // namespace android
|
||||
|
||||
#endif // DRM_API_H_
|
|
@ -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 <stdint.h>
|
||||
#include <android/rect.h>
|
||||
|
||||
#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
|
|
@ -1,115 +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 <media/stagefright/MediaErrors.h>
|
||||
#include <utils/Errors.h>
|
||||
#include <utils/Vector.h>
|
||||
|
||||
#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 {
|
||||
uint32_t mNumBytesOfClearData;
|
||||
uint32_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;
|
||||
|
||||
// To implement resolution constraints, the crypto plugin needs to know
|
||||
// the resolution of the video being decrypted. The media player should
|
||||
// call this method when the resolution is determined and any time it
|
||||
// is subsequently changed.
|
||||
|
||||
virtual void notifyResolution(uint32_t /* width */, uint32_t /* height */) {}
|
||||
|
||||
// A MediaDrm session may be associated with a MediaCrypto session. The
|
||||
// associated MediaDrm session is used to load decryption keys
|
||||
// into the crypto/drm plugin. The keys are then referenced by key-id
|
||||
// in the 'key' parameter to the decrypt() method.
|
||||
// Should return NO_ERROR on success, ERROR_DRM_SESSION_NOT_OPENED if
|
||||
// the session is not opened and a code from MediaErrors.h otherwise.
|
||||
virtual status_t setMediaDrmSession(const Vector<uint8_t> & /*sessionId */) {
|
||||
return ERROR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
// 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_
|
|
@ -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.
|
||||
*/
|
||||
|
||||
#ifndef HDCP_API_H_
|
||||
|
||||
#define HDCP_API_H_
|
||||
|
||||
#include <utils/Errors.h>
|
||||
#include <system/window.h>
|
||||
|
||||
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;
|
||||
|
||||
// Returns the capability bitmask of this HDCP session.
|
||||
virtual uint32_t getCaps() {
|
||||
return HDCP_CAPS_ENCRYPT;
|
||||
}
|
||||
|
||||
// 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_
|
||||
|
|
@ -1,288 +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 <media/hardware/OMXPluginBase.h>
|
||||
#include <media/hardware/MetadataBufferType.h>
|
||||
#include <system/window.h>
|
||||
#include <utils/RefBase.h>
|
||||
|
||||
#include <OMX_Component.h>
|
||||
|
||||
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" or
|
||||
// "OMX.google.android.index.storeANWBufferInMetadata" 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 parameter.
|
||||
//
|
||||
// Currently, this is used to pass meta data from video source (camera component, for instance) to
|
||||
// video encoder to avoid memcpying of input video frame data, as well as to pass dynamic output
|
||||
// buffer to video decoder. To do this, bStoreMetaData is set to OMX_TRUE.
|
||||
//
|
||||
// If bStoreMetaData is set to false, real YUV frame data will be stored in input buffers, and
|
||||
// the output buffers contain either real YUV frame data, or are themselves native handles as
|
||||
// directed by enable/use-android-native-buffer parameter settings.
|
||||
// In addition, if no OMX_SetParameter() call is made on a port with the corresponding extension
|
||||
// index, the component should not assume that the client is not using metadata mode for the port.
|
||||
//
|
||||
// If the component supports this using the "OMX.google.android.index.storeANWBufferInMetadata"
|
||||
// extension and bStoreMetaData is set to OMX_TRUE, data is passed using the VideoNativeMetadata
|
||||
// layout as defined below. Each buffer will be accompanied by a fence. The fence must signal
|
||||
// before the buffer can be used (e.g. read from or written into). When returning such buffer to
|
||||
// the client, component must provide a new fence that must signal before the returned buffer can
|
||||
// be used (e.g. read from or written into). The component owns the incoming fenceFd, and must close
|
||||
// it when fence has signaled. The client will own and close the returned fence file descriptor.
|
||||
//
|
||||
// If the component supports this using the "OMX.google.android.index.storeMetaDataInBuffers"
|
||||
// extension and bStoreMetaData is set to OMX_TRUE, data is passed using VideoGrallocMetadata
|
||||
// (the layout of which is the VideoGrallocMetadata defined below). Camera input can be also passed
|
||||
// as "CameraSource", the layout of which is vendor dependent.
|
||||
//
|
||||
// Metadata buffers are registered with the component using UseBuffer calls, or can be allocated
|
||||
// by the component for encoder-metadata-output buffers.
|
||||
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 VideoGrallocMetadata {
|
||||
MetadataBufferType eType; // must be kMetadataBufferTypeGrallocSource
|
||||
#ifdef OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS
|
||||
OMX_PTR pHandle;
|
||||
#else
|
||||
buffer_handle_t pHandle;
|
||||
#endif
|
||||
};
|
||||
|
||||
// Legacy name for VideoGrallocMetadata struct.
|
||||
struct VideoDecoderOutputMetaData : public VideoGrallocMetadata {};
|
||||
|
||||
struct VideoNativeMetadata {
|
||||
MetadataBufferType eType; // must be kMetadataBufferTypeANWBuffer
|
||||
#ifdef OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS
|
||||
OMX_PTR pBuffer;
|
||||
#else
|
||||
struct ANativeWindowBuffer* pBuffer;
|
||||
#endif
|
||||
int nFenceFd; // -1 if unused
|
||||
};
|
||||
|
||||
// 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<ANativeWindowBuffer>& 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;
|
||||
};
|
||||
|
||||
// Structure describing a media image (frame)
|
||||
// Currently only supporting YUV
|
||||
struct MediaImage {
|
||||
enum Type {
|
||||
MEDIA_IMAGE_TYPE_UNKNOWN = 0,
|
||||
MEDIA_IMAGE_TYPE_YUV,
|
||||
};
|
||||
|
||||
enum PlaneIndex {
|
||||
Y = 0,
|
||||
U,
|
||||
V,
|
||||
MAX_NUM_PLANES
|
||||
};
|
||||
|
||||
Type mType;
|
||||
uint32_t mNumPlanes; // number of planes
|
||||
uint32_t mWidth; // width of largest plane (unpadded, as in nFrameWidth)
|
||||
uint32_t mHeight; // height of largest plane (unpadded, as in nFrameHeight)
|
||||
uint32_t mBitDepth; // useable bit depth
|
||||
struct PlaneInfo {
|
||||
uint32_t mOffset; // offset of first pixel of the plane in bytes
|
||||
// from buffer offset
|
||||
uint32_t mColInc; // column increment in bytes
|
||||
uint32_t mRowInc; // row increment in bytes
|
||||
uint32_t mHorizSubsampling; // subsampling compared to the largest plane
|
||||
uint32_t mVertSubsampling; // subsampling compared to the largest plane
|
||||
};
|
||||
PlaneInfo mPlane[MAX_NUM_PLANES];
|
||||
};
|
||||
|
||||
// A pointer to this struct is passed to OMX_GetParameter when the extension
|
||||
// index for the 'OMX.google.android.index.describeColorFormat'
|
||||
// extension is given. This method can be called from any component state
|
||||
// other than invalid. The color-format, frame width/height, and stride/
|
||||
// slice-height parameters are ones that are associated with a raw video
|
||||
// port (input or output), but the stride/slice height parameters may be
|
||||
// incorrect. bUsingNativeBuffers is OMX_TRUE if native android buffers will
|
||||
// be used (while specifying this color format).
|
||||
//
|
||||
// The component shall fill out the MediaImage structure that
|
||||
// corresponds to the described raw video format, and the potentially corrected
|
||||
// stride and slice-height info.
|
||||
//
|
||||
// The behavior is slightly different if bUsingNativeBuffers is OMX_TRUE,
|
||||
// though most implementations can ignore this difference. When using native buffers,
|
||||
// the component may change the configured color format to an optimized format.
|
||||
// Additionally, when allocating these buffers for flexible usecase, the framework
|
||||
// will set the SW_READ/WRITE_OFTEN usage flags. In this case (if bUsingNativeBuffers
|
||||
// is OMX_TRUE), the component shall fill out the MediaImage information for the
|
||||
// scenario when these SW-readable/writable buffers are locked using gralloc_lock.
|
||||
// Note, that these buffers may also be locked using gralloc_lock_ycbcr, which must
|
||||
// be supported for vendor-specific formats.
|
||||
//
|
||||
// For non-YUV packed planar/semiplanar image formats, or if bUsingNativeBuffers
|
||||
// is OMX_TRUE and the component does not support this color format with native
|
||||
// buffers, the component shall set mNumPlanes to 0, and mType to MEDIA_IMAGE_TYPE_UNKNOWN.
|
||||
struct DescribeColorFormatParams {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
// input: parameters from OMX_VIDEO_PORTDEFINITIONTYPE
|
||||
OMX_COLOR_FORMATTYPE eColorFormat;
|
||||
OMX_U32 nFrameWidth;
|
||||
OMX_U32 nFrameHeight;
|
||||
OMX_U32 nStride;
|
||||
OMX_U32 nSliceHeight;
|
||||
OMX_BOOL bUsingNativeBuffers;
|
||||
|
||||
// output: fill out the MediaImage fields
|
||||
MediaImage sMediaImage;
|
||||
};
|
||||
|
||||
// A pointer to this struct is passed to OMX_SetParameter or OMX_GetParameter
|
||||
// when the extension index for the
|
||||
// 'OMX.google.android.index.configureVideoTunnelMode' extension is given.
|
||||
// If the extension is supported then tunneled playback mode should be supported
|
||||
// by the codec. If bTunneled is set to OMX_TRUE then the video decoder should
|
||||
// operate in "tunneled" mode and output its decoded frames directly to the
|
||||
// sink. In this case nAudioHwSync is the HW SYNC ID of the audio HAL Output
|
||||
// stream to sync the video with. If bTunneled is set to OMX_FALSE, "tunneled"
|
||||
// mode should be disabled and nAudioHwSync should be ignored.
|
||||
// OMX_GetParameter is used to query tunneling configuration. bTunneled should
|
||||
// return whether decoder is operating in tunneled mode, and if it is,
|
||||
// pSidebandWindow should contain the codec allocated sideband window handle.
|
||||
struct ConfigureVideoTunnelModeParams {
|
||||
OMX_U32 nSize; // IN
|
||||
OMX_VERSIONTYPE nVersion; // IN
|
||||
OMX_U32 nPortIndex; // IN
|
||||
OMX_BOOL bTunneled; // IN/OUT
|
||||
OMX_U32 nAudioHwSync; // IN
|
||||
OMX_PTR pSidebandWindow; // OUT
|
||||
};
|
||||
|
||||
} // namespace android
|
||||
|
||||
extern android::OMXPluginBase *createOMXPlugin();
|
||||
|
||||
#endif // HARDWARE_API_H_
|
|
@ -1,127 +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 | buffer_handle_t buffer |
|
||||
* --------------------------------------------------------------
|
||||
*
|
||||
* See the VideoGrallocMetadata structure.
|
||||
*/
|
||||
kMetadataBufferTypeGrallocSource = 1,
|
||||
|
||||
/*
|
||||
* kMetadataBufferTypeGraphicBuffer is used to indicate that
|
||||
* the payload of the metadata buffers can be interpreted as
|
||||
* an ANativeWindowBuffer, and that a fence is provided.
|
||||
*
|
||||
* In this case, the metadata will have a byte stream that consists of three parts:
|
||||
* 1. First, there is an integer indicating that the metadata
|
||||
* contains an ANativeWindowBuffer (kMetadataBufferTypeANWBuffer)
|
||||
* 2. This is followed by the pointer to the ANativeWindowBuffer.
|
||||
* Codec must not free this buffer as it does not actually own this buffer.
|
||||
* 3. Finally, there is an integer containing a fence file descriptor.
|
||||
* The codec must wait on the fence before encoding or decoding into this
|
||||
* buffer. When the buffer is returned, codec must replace this file descriptor
|
||||
* with a new fence, that will be waited on before the buffer is replaced
|
||||
* (encoder) or read (decoder).
|
||||
* ---------------------------------
|
||||
* | kMetadataBufferTypeANWBuffer |
|
||||
* ---------------------------------
|
||||
* | ANativeWindowBuffer *buffer |
|
||||
* ---------------------------------
|
||||
* | int fenceFd |
|
||||
* ---------------------------------
|
||||
*
|
||||
* See the VideoNativeMetadata structure.
|
||||
*/
|
||||
kMetadataBufferTypeANWBuffer = 2,
|
||||
|
||||
/* This value is used by framework, but is never used inside a metadata buffer */
|
||||
kMetadataBufferTypeInvalid = -1,
|
||||
|
||||
|
||||
// Add more here...
|
||||
|
||||
} MetadataBufferType;
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // namespace android
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // METADATA_BUFFER_TYPE_H
|
|
@ -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 <sys/types.h>
|
||||
|
||||
#include <OMX_Component.h>
|
||||
|
||||
#include <utils/String8.h>
|
||||
#include <utils/Vector.h>
|
||||
|
||||
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<String8> *roles) = 0;
|
||||
|
||||
private:
|
||||
OMXPluginBase(const OMXPluginBase &);
|
||||
OMXPluginBase &operator=(const OMXPluginBase &);
|
||||
};
|
||||
|
||||
} // namespace android
|
||||
|
||||
#endif // OMX_PLUGIN_BASE_H_
|
|
@ -1,947 +0,0 @@
|
|||
/*
|
||||
* Copyright 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT 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: This file contains several sections for individual OMX include files.
|
||||
Each section has its own include guard. This file should be included AFTER
|
||||
the OMX include files. */
|
||||
|
||||
#ifdef OMX_Audio_h
|
||||
/* asString definitions if media/openmax/OMX_Audio.h was included */
|
||||
|
||||
#ifndef AS_STRING_FOR_OMX_AUDIO_H
|
||||
#define AS_STRING_FOR_OMX_AUDIO_H
|
||||
|
||||
inline static const char *asString(OMX_AUDIO_CODINGTYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_AUDIO_CodingUnused: return "Unused"; // unused
|
||||
case OMX_AUDIO_CodingAutoDetect: return "AutoDetect"; // unused
|
||||
case OMX_AUDIO_CodingPCM: return "PCM";
|
||||
case OMX_AUDIO_CodingADPCM: return "ADPCM"; // unused
|
||||
case OMX_AUDIO_CodingAMR: return "AMR";
|
||||
case OMX_AUDIO_CodingGSMFR: return "GSMFR";
|
||||
case OMX_AUDIO_CodingGSMEFR: return "GSMEFR"; // unused
|
||||
case OMX_AUDIO_CodingGSMHR: return "GSMHR"; // unused
|
||||
case OMX_AUDIO_CodingPDCFR: return "PDCFR"; // unused
|
||||
case OMX_AUDIO_CodingPDCEFR: return "PDCEFR"; // unused
|
||||
case OMX_AUDIO_CodingPDCHR: return "PDCHR"; // unused
|
||||
case OMX_AUDIO_CodingTDMAFR: return "TDMAFR"; // unused
|
||||
case OMX_AUDIO_CodingTDMAEFR: return "TDMAEFR"; // unused
|
||||
case OMX_AUDIO_CodingQCELP8: return "QCELP8"; // unused
|
||||
case OMX_AUDIO_CodingQCELP13: return "QCELP13"; // unused
|
||||
case OMX_AUDIO_CodingEVRC: return "EVRC"; // unused
|
||||
case OMX_AUDIO_CodingSMV: return "SMV"; // unused
|
||||
case OMX_AUDIO_CodingG711: return "G711";
|
||||
case OMX_AUDIO_CodingG723: return "G723"; // unused
|
||||
case OMX_AUDIO_CodingG726: return "G726"; // unused
|
||||
case OMX_AUDIO_CodingG729: return "G729"; // unused
|
||||
case OMX_AUDIO_CodingAAC: return "AAC";
|
||||
case OMX_AUDIO_CodingMP3: return "MP3";
|
||||
case OMX_AUDIO_CodingSBC: return "SBC"; // unused
|
||||
case OMX_AUDIO_CodingVORBIS: return "VORBIS";
|
||||
case OMX_AUDIO_CodingWMA: return "WMA"; // unused
|
||||
case OMX_AUDIO_CodingRA: return "RA"; // unused
|
||||
case OMX_AUDIO_CodingMIDI: return "MIDI"; // unused
|
||||
case OMX_AUDIO_CodingFLAC: return "FLAC";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_AUDIO_PCMMODETYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_AUDIO_PCMModeLinear: return "Linear";
|
||||
case OMX_AUDIO_PCMModeALaw: return "ALaw";
|
||||
case OMX_AUDIO_PCMModeMULaw: return "MULaw";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_AUDIO_CHANNELTYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_AUDIO_ChannelNone: return "None"; // unused
|
||||
case OMX_AUDIO_ChannelLF: return "LF";
|
||||
case OMX_AUDIO_ChannelRF: return "RF";
|
||||
case OMX_AUDIO_ChannelCF: return "CF";
|
||||
case OMX_AUDIO_ChannelLS: return "LS";
|
||||
case OMX_AUDIO_ChannelRS: return "RS";
|
||||
case OMX_AUDIO_ChannelLFE: return "LFE";
|
||||
case OMX_AUDIO_ChannelCS: return "CS";
|
||||
case OMX_AUDIO_ChannelLR: return "LR";
|
||||
case OMX_AUDIO_ChannelRR: return "RR";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_AUDIO_CHANNELMODETYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_AUDIO_ChannelModeStereo: return "Stereo";
|
||||
// case OMX_AUDIO_ChannelModeJointStereo: return "JointStereo";
|
||||
// case OMX_AUDIO_ChannelModeDual: return "Dual";
|
||||
case OMX_AUDIO_ChannelModeMono: return "Mono";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_AUDIO_AACSTREAMFORMATTYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
// case OMX_AUDIO_AACStreamFormatMP2ADTS: return "MP2ADTS";
|
||||
case OMX_AUDIO_AACStreamFormatMP4ADTS: return "MP4ADTS";
|
||||
// case OMX_AUDIO_AACStreamFormatMP4LOAS: return "MP4LOAS";
|
||||
// case OMX_AUDIO_AACStreamFormatMP4LATM: return "MP4LATM";
|
||||
// case OMX_AUDIO_AACStreamFormatADIF: return "ADIF";
|
||||
case OMX_AUDIO_AACStreamFormatMP4FF: return "MP4FF";
|
||||
// case OMX_AUDIO_AACStreamFormatRAW: return "RAW";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_AUDIO_AMRFRAMEFORMATTYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
// case OMX_AUDIO_AMRFrameFormatConformance: return "Conformance";
|
||||
// case OMX_AUDIO_AMRFrameFormatIF1: return "IF1";
|
||||
// case OMX_AUDIO_AMRFrameFormatIF2: return "IF2";
|
||||
case OMX_AUDIO_AMRFrameFormatFSF: return "FSF";
|
||||
// case OMX_AUDIO_AMRFrameFormatRTPPayload: return "RTPPayload";
|
||||
// case OMX_AUDIO_AMRFrameFormatITU: return "ITU";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_AUDIO_AMRBANDMODETYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_AUDIO_AMRBandModeUnused: return "Unused";
|
||||
case OMX_AUDIO_AMRBandModeNB0: return "NB0";
|
||||
case OMX_AUDIO_AMRBandModeNB1: return "NB1";
|
||||
case OMX_AUDIO_AMRBandModeNB2: return "NB2";
|
||||
case OMX_AUDIO_AMRBandModeNB3: return "NB3";
|
||||
case OMX_AUDIO_AMRBandModeNB4: return "NB4";
|
||||
case OMX_AUDIO_AMRBandModeNB5: return "NB5";
|
||||
case OMX_AUDIO_AMRBandModeNB6: return "NB6";
|
||||
case OMX_AUDIO_AMRBandModeNB7: return "NB7";
|
||||
case OMX_AUDIO_AMRBandModeWB0: return "WB0";
|
||||
case OMX_AUDIO_AMRBandModeWB1: return "WB1";
|
||||
case OMX_AUDIO_AMRBandModeWB2: return "WB2";
|
||||
case OMX_AUDIO_AMRBandModeWB3: return "WB3";
|
||||
case OMX_AUDIO_AMRBandModeWB4: return "WB4";
|
||||
case OMX_AUDIO_AMRBandModeWB5: return "WB5";
|
||||
case OMX_AUDIO_AMRBandModeWB6: return "WB6";
|
||||
case OMX_AUDIO_AMRBandModeWB7: return "WB7";
|
||||
case OMX_AUDIO_AMRBandModeWB8: return "WB8";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_AUDIO_AMRDTXMODETYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_AUDIO_AMRDTXModeOff: return "ModeOff";
|
||||
// case OMX_AUDIO_AMRDTXModeOnVAD1: return "ModeOnVAD1";
|
||||
// case OMX_AUDIO_AMRDTXModeOnVAD2: return "ModeOnVAD2";
|
||||
// case OMX_AUDIO_AMRDTXModeOnAuto: return "ModeOnAuto";
|
||||
// case OMX_AUDIO_AMRDTXasEFR: return "asEFR";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // AS_STRING_FOR_OMX_AUDIO_H
|
||||
|
||||
#endif // OMX_Audio_h
|
||||
|
||||
#ifdef OMX_AudioExt_h
|
||||
/* asString definitions if media/openmax/OMX_AudioExt.h was included */
|
||||
|
||||
#ifndef AS_STRING_FOR_OMX_AUDIOEXT_H
|
||||
#define AS_STRING_FOR_OMX_AUDIOEXT_H
|
||||
|
||||
inline static const char *asString(OMX_AUDIO_CODINGEXTTYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_AUDIO_CodingAndroidAC3: return "AndroidAC3";
|
||||
case OMX_AUDIO_CodingAndroidOPUS: return "AndroidOPUS";
|
||||
default: return asString((OMX_AUDIO_CODINGTYPE)i, def);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // AS_STRING_FOR_OMX_AUDIOEXT_H
|
||||
|
||||
#endif // OMX_AudioExt_h
|
||||
|
||||
#ifdef OMX_Component_h
|
||||
/* asString definitions if media/openmax/OMX_Component.h was included */
|
||||
|
||||
#ifndef AS_STRING_FOR_OMX_COMPONENT_H
|
||||
#define AS_STRING_FOR_OMX_COMPONENT_H
|
||||
|
||||
inline static const char *asString(OMX_PORTDOMAINTYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_PortDomainAudio: return "Audio";
|
||||
case OMX_PortDomainVideo: return "Video";
|
||||
case OMX_PortDomainImage: return "Image";
|
||||
// case OMX_PortDomainOther: return "Other";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // AS_STRING_FOR_OMX_COMPONENT_H
|
||||
|
||||
#endif // OMX_Component_h
|
||||
|
||||
#ifdef OMX_Core_h
|
||||
/* asString definitions if media/openmax/OMX_Core.h was included */
|
||||
|
||||
#ifndef AS_STRING_FOR_OMX_CORE_H
|
||||
#define AS_STRING_FOR_OMX_CORE_H
|
||||
|
||||
inline static const char *asString(OMX_COMMANDTYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_CommandStateSet: return "StateSet";
|
||||
case OMX_CommandFlush: return "Flush";
|
||||
case OMX_CommandPortDisable: return "PortDisable";
|
||||
case OMX_CommandPortEnable: return "PortEnable";
|
||||
// case OMX_CommandMarkBuffer: return "MarkBuffer";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_STATETYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_StateInvalid: return "Invalid";
|
||||
case OMX_StateLoaded: return "Loaded";
|
||||
case OMX_StateIdle: return "Idle";
|
||||
case OMX_StateExecuting: return "Executing";
|
||||
// case OMX_StatePause: return "Pause";
|
||||
// case OMX_StateWaitForResources: return "WaitForResources";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_ERRORTYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_ErrorNone: return "None";
|
||||
case OMX_ErrorInsufficientResources: return "InsufficientResources";
|
||||
case OMX_ErrorUndefined: return "Undefined";
|
||||
case OMX_ErrorInvalidComponentName: return "InvalidComponentName";
|
||||
case OMX_ErrorComponentNotFound: return "ComponentNotFound";
|
||||
case OMX_ErrorInvalidComponent: return "InvalidComponent"; // unused
|
||||
case OMX_ErrorBadParameter: return "BadParameter";
|
||||
case OMX_ErrorNotImplemented: return "NotImplemented";
|
||||
case OMX_ErrorUnderflow: return "Underflow"; // unused
|
||||
case OMX_ErrorOverflow: return "Overflow"; // unused
|
||||
case OMX_ErrorHardware: return "Hardware"; // unused
|
||||
case OMX_ErrorInvalidState: return "InvalidState";
|
||||
case OMX_ErrorStreamCorrupt: return "StreamCorrupt";
|
||||
case OMX_ErrorPortsNotCompatible: return "PortsNotCompatible"; // unused
|
||||
case OMX_ErrorResourcesLost: return "ResourcesLost";
|
||||
case OMX_ErrorNoMore: return "NoMore";
|
||||
case OMX_ErrorVersionMismatch: return "VersionMismatch"; // unused
|
||||
case OMX_ErrorNotReady: return "NotReady"; // unused
|
||||
case OMX_ErrorTimeout: return "Timeout"; // unused
|
||||
case OMX_ErrorSameState: return "SameState"; // unused
|
||||
case OMX_ErrorResourcesPreempted: return "ResourcesPreempted"; // unused
|
||||
case OMX_ErrorPortUnresponsiveDuringAllocation:
|
||||
return "PortUnresponsiveDuringAllocation"; // unused
|
||||
case OMX_ErrorPortUnresponsiveDuringDeallocation:
|
||||
return "PortUnresponsiveDuringDeallocation"; // unused
|
||||
case OMX_ErrorPortUnresponsiveDuringStop:
|
||||
return "PortUnresponsiveDuringStop"; // unused
|
||||
case OMX_ErrorIncorrectStateTransition:
|
||||
return "IncorrectStateTransition"; // unused
|
||||
case OMX_ErrorIncorrectStateOperation:
|
||||
return "IncorrectStateOperation"; // unused
|
||||
case OMX_ErrorUnsupportedSetting: return "UnsupportedSetting";
|
||||
case OMX_ErrorUnsupportedIndex: return "UnsupportedIndex";
|
||||
case OMX_ErrorBadPortIndex: return "BadPortIndex";
|
||||
case OMX_ErrorPortUnpopulated: return "PortUnpopulated"; // unused
|
||||
case OMX_ErrorComponentSuspended: return "ComponentSuspended"; // unused
|
||||
case OMX_ErrorDynamicResourcesUnavailable:
|
||||
return "DynamicResourcesUnavailable"; // unused
|
||||
case OMX_ErrorMbErrorsInFrame: return "MbErrorsInFrame"; // unused
|
||||
case OMX_ErrorFormatNotDetected: return "FormatNotDetected"; // unused
|
||||
case OMX_ErrorContentPipeOpenFailed: return "ContentPipeOpenFailed"; // unused
|
||||
case OMX_ErrorContentPipeCreationFailed:
|
||||
return "ContentPipeCreationFailed"; // unused
|
||||
case OMX_ErrorSeperateTablesUsed: return "SeperateTablesUsed"; // unused
|
||||
case OMX_ErrorTunnelingUnsupported: return "TunnelingUnsupported"; // unused
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_EVENTTYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_EventCmdComplete: return "CmdComplete";
|
||||
case OMX_EventError: return "Error";
|
||||
// case OMX_EventMark: return "Mark";
|
||||
case OMX_EventPortSettingsChanged: return "PortSettingsChanged";
|
||||
case OMX_EventBufferFlag: return "BufferFlag";
|
||||
// case OMX_EventResourcesAcquired: return "ResourcesAcquired";
|
||||
// case OMX_EventComponentResumed: return "ComponentResumed";
|
||||
// case OMX_EventDynamicResourcesAvailable: return "DynamicResourcesAvailable";
|
||||
// case OMX_EventPortFormatDetected: return "PortFormatDetected";
|
||||
case OMX_EventOutputRendered: return "OutputRendered";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // AS_STRING_FOR_OMX_CORE_H
|
||||
|
||||
#endif // OMX_Core_h
|
||||
|
||||
#ifdef OMX_Image_h
|
||||
/* asString definitions if media/openmax/OMX_Image.h was included */
|
||||
|
||||
#ifndef AS_STRING_FOR_OMX_IMAGE_H
|
||||
#define AS_STRING_FOR_OMX_IMAGE_H
|
||||
|
||||
inline static const char *asString(OMX_IMAGE_CODINGTYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_IMAGE_CodingUnused: return "Unused";
|
||||
case OMX_IMAGE_CodingAutoDetect: return "AutoDetect"; // unused
|
||||
case OMX_IMAGE_CodingJPEG: return "JPEG";
|
||||
case OMX_IMAGE_CodingJPEG2K: return "JPEG2K"; // unused
|
||||
case OMX_IMAGE_CodingEXIF: return "EXIF"; // unused
|
||||
case OMX_IMAGE_CodingTIFF: return "TIFF"; // unused
|
||||
case OMX_IMAGE_CodingGIF: return "GIF"; // unused
|
||||
case OMX_IMAGE_CodingPNG: return "PNG"; // unused
|
||||
case OMX_IMAGE_CodingLZW: return "LZW"; // unused
|
||||
case OMX_IMAGE_CodingBMP: return "BMP"; // unused
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // AS_STRING_FOR_OMX_IMAGE_H
|
||||
|
||||
#endif // OMX_Image_h
|
||||
|
||||
#ifdef OMX_Index_h
|
||||
/* asString definitions if media/openmax/OMX_Index.h was included */
|
||||
|
||||
#ifndef AS_STRING_FOR_OMX_INDEX_H
|
||||
#define AS_STRING_FOR_OMX_INDEX_H
|
||||
|
||||
inline static const char *asString(OMX_INDEXTYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
// case OMX_IndexParamPriorityMgmt: return "ParamPriorityMgmt";
|
||||
// case OMX_IndexParamAudioInit: return "ParamAudioInit";
|
||||
// case OMX_IndexParamImageInit: return "ParamImageInit";
|
||||
// case OMX_IndexParamVideoInit: return "ParamVideoInit";
|
||||
// case OMX_IndexParamOtherInit: return "ParamOtherInit";
|
||||
// case OMX_IndexParamNumAvailableStreams: return "ParamNumAvailableStreams";
|
||||
// case OMX_IndexParamActiveStream: return "ParamActiveStream";
|
||||
// case OMX_IndexParamSuspensionPolicy: return "ParamSuspensionPolicy";
|
||||
// case OMX_IndexParamComponentSuspended: return "ParamComponentSuspended";
|
||||
// case OMX_IndexConfigCapturing: return "ConfigCapturing";
|
||||
// case OMX_IndexConfigCaptureMode: return "ConfigCaptureMode";
|
||||
// case OMX_IndexAutoPauseAfterCapture: return "AutoPauseAfterCapture";
|
||||
// case OMX_IndexParamContentURI: return "ParamContentURI";
|
||||
// case OMX_IndexParamCustomContentPipe: return "ParamCustomContentPipe";
|
||||
// case OMX_IndexParamDisableResourceConcealment:
|
||||
// return "ParamDisableResourceConcealment";
|
||||
// case OMX_IndexConfigMetadataItemCount: return "ConfigMetadataItemCount";
|
||||
// case OMX_IndexConfigContainerNodeCount: return "ConfigContainerNodeCount";
|
||||
// case OMX_IndexConfigMetadataItem: return "ConfigMetadataItem";
|
||||
// case OMX_IndexConfigCounterNodeID: return "ConfigCounterNodeID";
|
||||
// case OMX_IndexParamMetadataFilterType: return "ParamMetadataFilterType";
|
||||
// case OMX_IndexParamMetadataKeyFilter: return "ParamMetadataKeyFilter";
|
||||
// case OMX_IndexConfigPriorityMgmt: return "ConfigPriorityMgmt";
|
||||
case OMX_IndexParamStandardComponentRole: return "ParamStandardComponentRole";
|
||||
case OMX_IndexParamPortDefinition: return "ParamPortDefinition";
|
||||
// case OMX_IndexParamCompBufferSupplier: return "ParamCompBufferSupplier";
|
||||
case OMX_IndexParamAudioPortFormat: return "ParamAudioPortFormat";
|
||||
case OMX_IndexParamAudioPcm: return "ParamAudioPcm";
|
||||
case OMX_IndexParamAudioAac: return "ParamAudioAac";
|
||||
// case OMX_IndexParamAudioRa: return "ParamAudioRa";
|
||||
case OMX_IndexParamAudioMp3: return "ParamAudioMp3";
|
||||
// case OMX_IndexParamAudioAdpcm: return "ParamAudioAdpcm";
|
||||
// case OMX_IndexParamAudioG723: return "ParamAudioG723";
|
||||
// case OMX_IndexParamAudioG729: return "ParamAudioG729";
|
||||
case OMX_IndexParamAudioAmr: return "ParamAudioAmr";
|
||||
// case OMX_IndexParamAudioWma: return "ParamAudioWma";
|
||||
// case OMX_IndexParamAudioSbc: return "ParamAudioSbc";
|
||||
// case OMX_IndexParamAudioMidi: return "ParamAudioMidi";
|
||||
// case OMX_IndexParamAudioGsm_FR: return "ParamAudioGsm_FR";
|
||||
// case OMX_IndexParamAudioMidiLoadUserSound: return "ParamAudioMidiLoadUserSound";
|
||||
// case OMX_IndexParamAudioG726: return "ParamAudioG726";
|
||||
// case OMX_IndexParamAudioGsm_EFR: return "ParamAudioGsm_EFR";
|
||||
// case OMX_IndexParamAudioGsm_HR: return "ParamAudioGsm_HR";
|
||||
// case OMX_IndexParamAudioPdc_FR: return "ParamAudioPdc_FR";
|
||||
// case OMX_IndexParamAudioPdc_EFR: return "ParamAudioPdc_EFR";
|
||||
// case OMX_IndexParamAudioPdc_HR: return "ParamAudioPdc_HR";
|
||||
// case OMX_IndexParamAudioTdma_FR: return "ParamAudioTdma_FR";
|
||||
// case OMX_IndexParamAudioTdma_EFR: return "ParamAudioTdma_EFR";
|
||||
// case OMX_IndexParamAudioQcelp8: return "ParamAudioQcelp8";
|
||||
// case OMX_IndexParamAudioQcelp13: return "ParamAudioQcelp13";
|
||||
// case OMX_IndexParamAudioEvrc: return "ParamAudioEvrc";
|
||||
// case OMX_IndexParamAudioSmv: return "ParamAudioSmv";
|
||||
case OMX_IndexParamAudioVorbis: return "ParamAudioVorbis";
|
||||
case OMX_IndexParamAudioFlac: return "ParamAudioFlac";
|
||||
// case OMX_IndexConfigAudioMidiImmediateEvent: return "ConfigAudioMidiImmediateEvent";
|
||||
// case OMX_IndexConfigAudioMidiControl: return "ConfigAudioMidiControl";
|
||||
// case OMX_IndexConfigAudioMidiSoundBankProgram:
|
||||
// return "ConfigAudioMidiSoundBankProgram";
|
||||
// case OMX_IndexConfigAudioMidiStatus: return "ConfigAudioMidiStatus";
|
||||
// case OMX_IndexConfigAudioMidiMetaEvent: return "ConfigAudioMidiMetaEvent";
|
||||
// case OMX_IndexConfigAudioMidiMetaEventData: return "ConfigAudioMidiMetaEventData";
|
||||
// case OMX_IndexConfigAudioVolume: return "ConfigAudioVolume";
|
||||
// case OMX_IndexConfigAudioBalance: return "ConfigAudioBalance";
|
||||
// case OMX_IndexConfigAudioChannelMute: return "ConfigAudioChannelMute";
|
||||
// case OMX_IndexConfigAudioMute: return "ConfigAudioMute";
|
||||
// case OMX_IndexConfigAudioLoudness: return "ConfigAudioLoudness";
|
||||
// case OMX_IndexConfigAudioEchoCancelation: return "ConfigAudioEchoCancelation";
|
||||
// case OMX_IndexConfigAudioNoiseReduction: return "ConfigAudioNoiseReduction";
|
||||
// case OMX_IndexConfigAudioBass: return "ConfigAudioBass";
|
||||
// case OMX_IndexConfigAudioTreble: return "ConfigAudioTreble";
|
||||
// case OMX_IndexConfigAudioStereoWidening: return "ConfigAudioStereoWidening";
|
||||
// case OMX_IndexConfigAudioChorus: return "ConfigAudioChorus";
|
||||
// case OMX_IndexConfigAudioEqualizer: return "ConfigAudioEqualizer";
|
||||
// case OMX_IndexConfigAudioReverberation: return "ConfigAudioReverberation";
|
||||
// case OMX_IndexConfigAudioChannelVolume: return "ConfigAudioChannelVolume";
|
||||
// case OMX_IndexParamImagePortFormat: return "ParamImagePortFormat";
|
||||
// case OMX_IndexParamFlashControl: return "ParamFlashControl";
|
||||
// case OMX_IndexConfigFocusControl: return "ConfigFocusControl";
|
||||
// case OMX_IndexParamQFactor: return "ParamQFactor";
|
||||
// case OMX_IndexParamQuantizationTable: return "ParamQuantizationTable";
|
||||
// case OMX_IndexParamHuffmanTable: return "ParamHuffmanTable";
|
||||
// case OMX_IndexConfigFlashControl: return "ConfigFlashControl";
|
||||
case OMX_IndexParamVideoPortFormat: return "ParamVideoPortFormat";
|
||||
// case OMX_IndexParamVideoQuantization: return "ParamVideoQuantization";
|
||||
// case OMX_IndexParamVideoFastUpdate: return "ParamVideoFastUpdate";
|
||||
case OMX_IndexParamVideoBitrate: return "ParamVideoBitrate";
|
||||
// case OMX_IndexParamVideoMotionVector: return "ParamVideoMotionVector";
|
||||
case OMX_IndexParamVideoIntraRefresh: return "ParamVideoIntraRefresh";
|
||||
case OMX_IndexParamVideoErrorCorrection: return "ParamVideoErrorCorrection";
|
||||
// case OMX_IndexParamVideoVBSMC: return "ParamVideoVBSMC";
|
||||
// case OMX_IndexParamVideoMpeg2: return "ParamVideoMpeg2";
|
||||
case OMX_IndexParamVideoMpeg4: return "ParamVideoMpeg4";
|
||||
// case OMX_IndexParamVideoWmv: return "ParamVideoWmv";
|
||||
// case OMX_IndexParamVideoRv: return "ParamVideoRv";
|
||||
case OMX_IndexParamVideoAvc: return "ParamVideoAvc";
|
||||
case OMX_IndexParamVideoH263: return "ParamVideoH263";
|
||||
case OMX_IndexParamVideoProfileLevelQuerySupported:
|
||||
return "ParamVideoProfileLevelQuerySupported";
|
||||
case OMX_IndexParamVideoProfileLevelCurrent: return "ParamVideoProfileLevelCurrent";
|
||||
case OMX_IndexConfigVideoBitrate: return "ConfigVideoBitrate";
|
||||
// case OMX_IndexConfigVideoFramerate: return "ConfigVideoFramerate";
|
||||
case OMX_IndexConfigVideoIntraVOPRefresh: return "ConfigVideoIntraVOPRefresh";
|
||||
// case OMX_IndexConfigVideoIntraMBRefresh: return "ConfigVideoIntraMBRefresh";
|
||||
// case OMX_IndexConfigVideoMBErrorReporting: return "ConfigVideoMBErrorReporting";
|
||||
// case OMX_IndexParamVideoMacroblocksPerFrame: return "ParamVideoMacroblocksPerFrame";
|
||||
// case OMX_IndexConfigVideoMacroBlockErrorMap: return "ConfigVideoMacroBlockErrorMap";
|
||||
// case OMX_IndexParamVideoSliceFMO: return "ParamVideoSliceFMO";
|
||||
// case OMX_IndexConfigVideoAVCIntraPeriod: return "ConfigVideoAVCIntraPeriod";
|
||||
// case OMX_IndexConfigVideoNalSize: return "ConfigVideoNalSize";
|
||||
// case OMX_IndexParamCommonDeblocking: return "ParamCommonDeblocking";
|
||||
// case OMX_IndexParamCommonSensorMode: return "ParamCommonSensorMode";
|
||||
// case OMX_IndexParamCommonInterleave: return "ParamCommonInterleave";
|
||||
// case OMX_IndexConfigCommonColorFormatConversion:
|
||||
// return "ConfigCommonColorFormatConversion";
|
||||
case OMX_IndexConfigCommonScale: return "ConfigCommonScale";
|
||||
// case OMX_IndexConfigCommonImageFilter: return "ConfigCommonImageFilter";
|
||||
// case OMX_IndexConfigCommonColorEnhancement: return "ConfigCommonColorEnhancement";
|
||||
// case OMX_IndexConfigCommonColorKey: return "ConfigCommonColorKey";
|
||||
// case OMX_IndexConfigCommonColorBlend: return "ConfigCommonColorBlend";
|
||||
// case OMX_IndexConfigCommonFrameStabilisation: return "ConfigCommonFrameStabilisation";
|
||||
// case OMX_IndexConfigCommonRotate: return "ConfigCommonRotate";
|
||||
// case OMX_IndexConfigCommonMirror: return "ConfigCommonMirror";
|
||||
// case OMX_IndexConfigCommonOutputPosition: return "ConfigCommonOutputPosition";
|
||||
case OMX_IndexConfigCommonInputCrop: return "ConfigCommonInputCrop";
|
||||
case OMX_IndexConfigCommonOutputCrop: return "ConfigCommonOutputCrop";
|
||||
// case OMX_IndexConfigCommonDigitalZoom: return "ConfigCommonDigitalZoom";
|
||||
// case OMX_IndexConfigCommonOpticalZoom: return "ConfigCommonOpticalZoom";
|
||||
// case OMX_IndexConfigCommonWhiteBalance: return "ConfigCommonWhiteBalance";
|
||||
// case OMX_IndexConfigCommonExposure: return "ConfigCommonExposure";
|
||||
// case OMX_IndexConfigCommonContrast: return "ConfigCommonContrast";
|
||||
// case OMX_IndexConfigCommonBrightness: return "ConfigCommonBrightness";
|
||||
// case OMX_IndexConfigCommonBacklight: return "ConfigCommonBacklight";
|
||||
// case OMX_IndexConfigCommonGamma: return "ConfigCommonGamma";
|
||||
// case OMX_IndexConfigCommonSaturation: return "ConfigCommonSaturation";
|
||||
// case OMX_IndexConfigCommonLightness: return "ConfigCommonLightness";
|
||||
// case OMX_IndexConfigCommonExclusionRect: return "ConfigCommonExclusionRect";
|
||||
// case OMX_IndexConfigCommonDithering: return "ConfigCommonDithering";
|
||||
// case OMX_IndexConfigCommonPlaneBlend: return "ConfigCommonPlaneBlend";
|
||||
// case OMX_IndexConfigCommonExposureValue: return "ConfigCommonExposureValue";
|
||||
// case OMX_IndexConfigCommonOutputSize: return "ConfigCommonOutputSize";
|
||||
// case OMX_IndexParamCommonExtraQuantData: return "ParamCommonExtraQuantData";
|
||||
// case OMX_IndexConfigCommonFocusRegion: return "ConfigCommonFocusRegion";
|
||||
// case OMX_IndexConfigCommonFocusStatus: return "ConfigCommonFocusStatus";
|
||||
// case OMX_IndexConfigCommonTransitionEffect: return "ConfigCommonTransitionEffect";
|
||||
// case OMX_IndexParamOtherPortFormat: return "ParamOtherPortFormat";
|
||||
// case OMX_IndexConfigOtherPower: return "ConfigOtherPower";
|
||||
// case OMX_IndexConfigOtherStats: return "ConfigOtherStats";
|
||||
// case OMX_IndexConfigTimeScale: return "ConfigTimeScale";
|
||||
// case OMX_IndexConfigTimeClockState: return "ConfigTimeClockState";
|
||||
// case OMX_IndexConfigTimeActiveRefClock: return "ConfigTimeActiveRefClock";
|
||||
// case OMX_IndexConfigTimeCurrentMediaTime: return "ConfigTimeCurrentMediaTime";
|
||||
// case OMX_IndexConfigTimeCurrentWallTime: return "ConfigTimeCurrentWallTime";
|
||||
// case OMX_IndexConfigTimeCurrentAudioReference:
|
||||
// return "ConfigTimeCurrentAudioReference";
|
||||
// case OMX_IndexConfigTimeCurrentVideoReference:
|
||||
// return "ConfigTimeCurrentVideoReference";
|
||||
// case OMX_IndexConfigTimeMediaTimeRequest: return "ConfigTimeMediaTimeRequest";
|
||||
// case OMX_IndexConfigTimeClientStartTime: return "ConfigTimeClientStartTime";
|
||||
// case OMX_IndexConfigTimePosition: return "ConfigTimePosition";
|
||||
// case OMX_IndexConfigTimeSeekMode: return "ConfigTimeSeekMode";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // AS_STRING_FOR_OMX_INDEX_H
|
||||
|
||||
#endif // OMX_Index_h
|
||||
|
||||
#ifdef OMX_IndexExt_h
|
||||
/* asString definitions if media/openmax/OMX_IndexExt.h was included */
|
||||
|
||||
#ifndef AS_STRING_FOR_OMX_INDEXEXT_H
|
||||
#define AS_STRING_FOR_OMX_INDEXEXT_H
|
||||
|
||||
inline static const char *asString(OMX_INDEXEXTTYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
// case OMX_IndexConfigCallbackRequest: return "ConfigCallbackRequest";
|
||||
// case OMX_IndexConfigCommitMode: return "ConfigCommitMode";
|
||||
// case OMX_IndexConfigCommit: return "ConfigCommit";
|
||||
case OMX_IndexParamAudioAndroidAc3: return "ParamAudioAndroidAc3";
|
||||
case OMX_IndexParamAudioAndroidOpus: return "ParamAudioAndroidOpus";
|
||||
case OMX_IndexParamAudioAndroidAacPresentation: return "ParamAudioAndroidAacPresentation";
|
||||
// case OMX_IndexParamNalStreamFormatSupported: return "ParamNalStreamFormatSupported";
|
||||
// case OMX_IndexParamNalStreamFormat: return "ParamNalStreamFormat";
|
||||
// case OMX_IndexParamNalStreamFormatSelect: return "ParamNalStreamFormatSelect";
|
||||
case OMX_IndexParamVideoVp8: return "ParamVideoVp8";
|
||||
// case OMX_IndexConfigVideoVp8ReferenceFrame: return "ConfigVideoVp8ReferenceFrame";
|
||||
// case OMX_IndexConfigVideoVp8ReferenceFrameType: return "ConfigVideoVp8ReferenceFrameType";
|
||||
case OMX_IndexParamVideoAndroidVp8Encoder: return "ParamVideoAndroidVp8Encoder";
|
||||
case OMX_IndexParamVideoHevc: return "ParamVideoHevc";
|
||||
// case OMX_IndexParamSliceSegments: return "ParamSliceSegments";
|
||||
case OMX_IndexConfigAutoFramerateConversion: return "ConfigAutoFramerateConversion";
|
||||
case OMX_IndexConfigPriority: return "ConfigPriority";
|
||||
case OMX_IndexConfigOperatingRate: return "ConfigOperatingRate";
|
||||
case OMX_IndexParamConsumerUsageBits: return "ParamConsumerUsageBits";
|
||||
default: return asString((OMX_INDEXTYPE)i, def);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // AS_STRING_FOR_OMX_INDEXEXT_H
|
||||
|
||||
#endif // OMX_IndexExt_h
|
||||
|
||||
#ifdef OMX_IVCommon_h
|
||||
/* asString definitions if media/openmax/OMX_IVCommon.h was included */
|
||||
|
||||
#ifndef AS_STRING_FOR_OMX_IVCOMMON_H
|
||||
#define AS_STRING_FOR_OMX_IVCOMMON_H
|
||||
|
||||
inline static const char *asString(OMX_COLOR_FORMATTYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_COLOR_FormatUnused:
|
||||
return "COLOR_FormatUnused";
|
||||
case OMX_COLOR_FormatMonochrome:
|
||||
return "COLOR_FormatMonochrome";
|
||||
case OMX_COLOR_Format8bitRGB332:
|
||||
return "COLOR_Format8bitRGB332";
|
||||
case OMX_COLOR_Format12bitRGB444:
|
||||
return "COLOR_Format12bitRGB444";
|
||||
case OMX_COLOR_Format16bitARGB4444:
|
||||
return "COLOR_Format16bitARGB4444";
|
||||
case OMX_COLOR_Format16bitARGB1555:
|
||||
return "COLOR_Format16bitARGB1555";
|
||||
case OMX_COLOR_Format16bitRGB565:
|
||||
return "COLOR_Format16bitRGB565";
|
||||
case OMX_COLOR_Format16bitBGR565:
|
||||
return "COLOR_Format16bitBGR565";
|
||||
case OMX_COLOR_Format18bitRGB666:
|
||||
return "COLOR_Format18bitRGB666";
|
||||
case OMX_COLOR_Format18bitARGB1665:
|
||||
return "COLOR_Format18bitARGB1665";
|
||||
case OMX_COLOR_Format19bitARGB1666:
|
||||
return "COLOR_Format19bitARGB1666";
|
||||
case OMX_COLOR_Format24bitRGB888:
|
||||
return "COLOR_Format24bitRGB888";
|
||||
case OMX_COLOR_Format24bitBGR888:
|
||||
return "COLOR_Format24bitBGR888";
|
||||
case OMX_COLOR_Format24bitARGB1887:
|
||||
return "COLOR_Format24bitARGB1887";
|
||||
case OMX_COLOR_Format25bitARGB1888:
|
||||
return "COLOR_Format25bitARGB1888";
|
||||
case OMX_COLOR_Format32bitBGRA8888:
|
||||
return "COLOR_Format32bitBGRA8888";
|
||||
case OMX_COLOR_Format32bitARGB8888:
|
||||
return "COLOR_Format32bitARGB8888";
|
||||
case OMX_COLOR_FormatYUV411Planar:
|
||||
return "COLOR_FormatYUV411Planar";
|
||||
case OMX_COLOR_FormatYUV411PackedPlanar:
|
||||
return "COLOR_FormatYUV411PackedPlanar";
|
||||
case OMX_COLOR_FormatYUV420Planar:
|
||||
return "COLOR_FormatYUV420Planar";
|
||||
case OMX_COLOR_FormatYUV420PackedPlanar:
|
||||
return "COLOR_FormatYUV420PackedPlanar";
|
||||
case OMX_COLOR_FormatYUV420SemiPlanar:
|
||||
return "COLOR_FormatYUV420SemiPlanar";
|
||||
case OMX_COLOR_FormatYUV422Planar:
|
||||
return "COLOR_FormatYUV422Planar";
|
||||
case OMX_COLOR_FormatYUV422PackedPlanar:
|
||||
return "COLOR_FormatYUV422PackedPlanar";
|
||||
case OMX_COLOR_FormatYUV422SemiPlanar:
|
||||
return "COLOR_FormatYUV422SemiPlanar";
|
||||
case OMX_COLOR_FormatYCbYCr:
|
||||
return "COLOR_FormatYCbYCr";
|
||||
case OMX_COLOR_FormatYCrYCb:
|
||||
return "COLOR_FormatYCrYCb";
|
||||
case OMX_COLOR_FormatCbYCrY:
|
||||
return "COLOR_FormatCbYCrY";
|
||||
case OMX_COLOR_FormatCrYCbY:
|
||||
return "COLOR_FormatCrYCbY";
|
||||
case OMX_COLOR_FormatYUV444Interleaved:
|
||||
return "COLOR_FormatYUV444Interleaved";
|
||||
case OMX_COLOR_FormatRawBayer8bit:
|
||||
return "COLOR_FormatRawBayer8bit";
|
||||
case OMX_COLOR_FormatRawBayer10bit:
|
||||
return "COLOR_FormatRawBayer10bit";
|
||||
case OMX_COLOR_FormatRawBayer8bitcompressed:
|
||||
return "COLOR_FormatRawBayer8bitcompressed";
|
||||
case OMX_COLOR_FormatL2:
|
||||
return "COLOR_FormatL2";
|
||||
case OMX_COLOR_FormatL4:
|
||||
return "COLOR_FormatL4";
|
||||
case OMX_COLOR_FormatL8:
|
||||
return "COLOR_FormatL8";
|
||||
case OMX_COLOR_FormatL16:
|
||||
return "COLOR_FormatL16";
|
||||
case OMX_COLOR_FormatL24:
|
||||
return "COLOR_FormatL24";
|
||||
case OMX_COLOR_FormatL32:
|
||||
return "COLOR_FormatL32";
|
||||
case OMX_COLOR_FormatYUV420PackedSemiPlanar:
|
||||
return "COLOR_FormatYUV420PackedSemiPlanar";
|
||||
case OMX_COLOR_FormatYUV422PackedSemiPlanar:
|
||||
return "COLOR_FormatYUV422PackedSemiPlanar";
|
||||
case OMX_COLOR_Format18BitBGR666:
|
||||
return "COLOR_Format18BitBGR666";
|
||||
case OMX_COLOR_Format24BitARGB6666:
|
||||
return "COLOR_Format24BitARGB6666";
|
||||
case OMX_COLOR_Format24BitABGR6666:
|
||||
return "COLOR_Format24BitABGR6666";
|
||||
case OMX_COLOR_FormatAndroidOpaque:
|
||||
return "COLOR_FormatAndroidOpaque";
|
||||
case OMX_COLOR_FormatYUV420Flexible:
|
||||
return "COLOR_FormatYUV420Flexible";
|
||||
case OMX_TI_COLOR_FormatYUV420PackedSemiPlanar:
|
||||
return "TI_COLOR_FormatYUV420PackedSemiPlanar";
|
||||
case OMX_QCOM_COLOR_FormatYVU420SemiPlanar:
|
||||
return "QCOM_COLOR_FormatYVU420SemiPlanar";
|
||||
// case OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka:
|
||||
// return "QCOM_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka";
|
||||
// case OMX_SEC_COLOR_FormatNV12Tiled:
|
||||
// return "SEC_COLOR_FormatNV12Tiled";
|
||||
// case OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar32m:
|
||||
// return "QCOM_COLOR_FormatYUV420PackedSemiPlanar32m";
|
||||
default:
|
||||
return def;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // AS_STRING_FOR_OMX_IVCOMMON_H
|
||||
|
||||
#endif // OMX_IVCommon_h
|
||||
|
||||
#ifdef OMX_Types_h
|
||||
/* asString definitions if media/openmax/OMX_Types.h was included */
|
||||
|
||||
#ifndef AS_STRING_FOR_OMX_TYPES_H
|
||||
#define AS_STRING_FOR_OMX_TYPES_H
|
||||
|
||||
inline static const char *asString(OMX_BOOL i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_FALSE: return "FALSE";
|
||||
case OMX_TRUE: return "TRUE";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_DIRTYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_DirInput: return "Input";
|
||||
case OMX_DirOutput: return "Output";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_ENDIANTYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_EndianBig: return "Big";
|
||||
// case OMX_EndianLittle: return "Little";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_NUMERICALDATATYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_NumericalDataSigned: return "Signed";
|
||||
// case OMX_NumericalDataUnsigned: return "Unsigned";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // AS_STRING_FOR_OMX_TYPES_H
|
||||
|
||||
#endif // OMX_Types_h
|
||||
|
||||
#ifdef OMX_Video_h
|
||||
/* asString definitions if media/openmax/OMX_Video.h was included */
|
||||
|
||||
#ifndef AS_STRING_FOR_OMX_VIDEO_H
|
||||
#define AS_STRING_FOR_OMX_VIDEO_H
|
||||
|
||||
inline static const char *asString(OMX_VIDEO_CODINGTYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_VIDEO_CodingUnused: return "Unused";
|
||||
case OMX_VIDEO_CodingAutoDetect: return "AutoDetect"; // unused
|
||||
case OMX_VIDEO_CodingMPEG2: return "MPEG2";
|
||||
case OMX_VIDEO_CodingH263: return "H263";
|
||||
case OMX_VIDEO_CodingMPEG4: return "MPEG4";
|
||||
case OMX_VIDEO_CodingWMV: return "WMV"; // unused
|
||||
case OMX_VIDEO_CodingRV: return "RV"; // unused
|
||||
case OMX_VIDEO_CodingAVC: return "AVC";
|
||||
case OMX_VIDEO_CodingMJPEG: return "MJPEG"; // unused
|
||||
case OMX_VIDEO_CodingVP8: return "VP8";
|
||||
case OMX_VIDEO_CodingVP9: return "VP9";
|
||||
case OMX_VIDEO_CodingHEVC: return "HEVC";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_VIDEO_CONTROLRATETYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
// case OMX_Video_ControlRateDisable: return "Disable";
|
||||
case OMX_Video_ControlRateVariable: return "Variable";
|
||||
case OMX_Video_ControlRateConstant: return "Constant";
|
||||
// case OMX_Video_ControlRateVariableSkipFrames: return "VariableSkipFrames";
|
||||
// case OMX_Video_ControlRateConstantSkipFrames: return "ConstantSkipFrames";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_VIDEO_INTRAREFRESHTYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_VIDEO_IntraRefreshCyclic: return "Cyclic";
|
||||
case OMX_VIDEO_IntraRefreshAdaptive: return "Adaptive";
|
||||
case OMX_VIDEO_IntraRefreshBoth: return "Both";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_VIDEO_H263PROFILETYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_VIDEO_H263ProfileBaseline: return "Baseline";
|
||||
case OMX_VIDEO_H263ProfileH320Coding: return "H320Coding";
|
||||
case OMX_VIDEO_H263ProfileBackwardCompatible: return "BackwardCompatible";
|
||||
case OMX_VIDEO_H263ProfileISWV2: return "ISWV2";
|
||||
case OMX_VIDEO_H263ProfileISWV3: return "ISWV3";
|
||||
case OMX_VIDEO_H263ProfileHighCompression: return "HighCompression";
|
||||
case OMX_VIDEO_H263ProfileInternet: return "Internet";
|
||||
case OMX_VIDEO_H263ProfileInterlace: return "Interlace";
|
||||
case OMX_VIDEO_H263ProfileHighLatency: return "HighLatency";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_VIDEO_H263LEVELTYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_VIDEO_H263Level10: return "Level10";
|
||||
case OMX_VIDEO_H263Level20: return "Level20";
|
||||
case OMX_VIDEO_H263Level30: return "Level30";
|
||||
case OMX_VIDEO_H263Level40: return "Level40";
|
||||
case OMX_VIDEO_H263Level45: return "Level45";
|
||||
case OMX_VIDEO_H263Level50: return "Level50";
|
||||
case OMX_VIDEO_H263Level60: return "Level60";
|
||||
case OMX_VIDEO_H263Level70: return "Level70";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_VIDEO_PICTURETYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_VIDEO_PictureTypeI: return "I";
|
||||
case OMX_VIDEO_PictureTypeP: return "P";
|
||||
case OMX_VIDEO_PictureTypeB: return "B";
|
||||
// case OMX_VIDEO_PictureTypeSI: return "SI";
|
||||
// case OMX_VIDEO_PictureTypeSP: return "SP";
|
||||
// case OMX_VIDEO_PictureTypeEI: return "EI";
|
||||
// case OMX_VIDEO_PictureTypeEP: return "EP";
|
||||
// case OMX_VIDEO_PictureTypeS: return "S";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_VIDEO_MPEG4PROFILETYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_VIDEO_MPEG4ProfileSimple: return "Simple";
|
||||
case OMX_VIDEO_MPEG4ProfileSimpleScalable: return "SimpleScalable";
|
||||
case OMX_VIDEO_MPEG4ProfileCore: return "Core";
|
||||
case OMX_VIDEO_MPEG4ProfileMain: return "Main";
|
||||
case OMX_VIDEO_MPEG4ProfileNbit: return "Nbit";
|
||||
case OMX_VIDEO_MPEG4ProfileScalableTexture: return "ScalableTexture";
|
||||
case OMX_VIDEO_MPEG4ProfileSimpleFace: return "SimpleFace";
|
||||
case OMX_VIDEO_MPEG4ProfileSimpleFBA: return "SimpleFBA";
|
||||
case OMX_VIDEO_MPEG4ProfileBasicAnimated: return "BasicAnimated";
|
||||
case OMX_VIDEO_MPEG4ProfileHybrid: return "Hybrid";
|
||||
case OMX_VIDEO_MPEG4ProfileAdvancedRealTime: return "AdvancedRealTime";
|
||||
case OMX_VIDEO_MPEG4ProfileCoreScalable: return "CoreScalable";
|
||||
case OMX_VIDEO_MPEG4ProfileAdvancedCoding: return "AdvancedCoding";
|
||||
case OMX_VIDEO_MPEG4ProfileAdvancedCore: return "AdvancedCore";
|
||||
case OMX_VIDEO_MPEG4ProfileAdvancedScalable: return "AdvancedScalable";
|
||||
case OMX_VIDEO_MPEG4ProfileAdvancedSimple: return "AdvancedSimple";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_VIDEO_MPEG4LEVELTYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_VIDEO_MPEG4Level0: return "Level0";
|
||||
case OMX_VIDEO_MPEG4Level0b: return "Level0b";
|
||||
case OMX_VIDEO_MPEG4Level1: return "Level1";
|
||||
case OMX_VIDEO_MPEG4Level2: return "Level2";
|
||||
case OMX_VIDEO_MPEG4Level3: return "Level3";
|
||||
case OMX_VIDEO_MPEG4Level4: return "Level4";
|
||||
case OMX_VIDEO_MPEG4Level4a: return "Level4a";
|
||||
case OMX_VIDEO_MPEG4Level5: return "Level5";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_VIDEO_AVCPROFILETYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_VIDEO_AVCProfileBaseline: return "Baseline";
|
||||
case OMX_VIDEO_AVCProfileMain: return "Main";
|
||||
case OMX_VIDEO_AVCProfileExtended: return "Extended";
|
||||
case OMX_VIDEO_AVCProfileHigh: return "High";
|
||||
case OMX_VIDEO_AVCProfileHigh10: return "High10";
|
||||
case OMX_VIDEO_AVCProfileHigh422: return "High422";
|
||||
case OMX_VIDEO_AVCProfileHigh444: return "High444";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_VIDEO_AVCLEVELTYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_VIDEO_AVCLevel1: return "Level1";
|
||||
case OMX_VIDEO_AVCLevel1b: return "Level1b";
|
||||
case OMX_VIDEO_AVCLevel11: return "Level11";
|
||||
case OMX_VIDEO_AVCLevel12: return "Level12";
|
||||
case OMX_VIDEO_AVCLevel13: return "Level13";
|
||||
case OMX_VIDEO_AVCLevel2: return "Level2";
|
||||
case OMX_VIDEO_AVCLevel21: return "Level21";
|
||||
case OMX_VIDEO_AVCLevel22: return "Level22";
|
||||
case OMX_VIDEO_AVCLevel3: return "Level3";
|
||||
case OMX_VIDEO_AVCLevel31: return "Level31";
|
||||
case OMX_VIDEO_AVCLevel32: return "Level32";
|
||||
case OMX_VIDEO_AVCLevel4: return "Level4";
|
||||
case OMX_VIDEO_AVCLevel41: return "Level41";
|
||||
case OMX_VIDEO_AVCLevel42: return "Level42";
|
||||
case OMX_VIDEO_AVCLevel5: return "Level5";
|
||||
case OMX_VIDEO_AVCLevel51: return "Level51";
|
||||
case OMX_VIDEO_AVCLevel52: return "Level52";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_VIDEO_AVCLOOPFILTERTYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_VIDEO_AVCLoopFilterEnable: return "Enable";
|
||||
// case OMX_VIDEO_AVCLoopFilterDisable: return "Disable";
|
||||
// case OMX_VIDEO_AVCLoopFilterDisableSliceBoundary: return "DisableSliceBoundary";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // AS_STRING_FOR_OMX_VIDEO_H
|
||||
|
||||
#endif // OMX_Video_h
|
||||
|
||||
#ifdef OMX_VideoExt_h
|
||||
/* asString definitions if media/openmax/OMX_VideoExt.h was included */
|
||||
|
||||
#ifndef AS_STRING_FOR_OMX_VIDEOEXT_H
|
||||
#define AS_STRING_FOR_OMX_VIDEOEXT_H
|
||||
|
||||
inline static const char *asString(OMX_VIDEO_VP8PROFILETYPE i, const char *def = "!!") {
|
||||
switch (i) {
|
||||
case OMX_VIDEO_VP8ProfileMain: return "Main";
|
||||
case OMX_VIDEO_VP8ProfileUnknown: return "Unknown"; // unused
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_VIDEO_VP8LEVELTYPE i, const char *def = "!!") {
|
||||
switch (i) {
|
||||
case OMX_VIDEO_VP8Level_Version0: return "_Version0";
|
||||
case OMX_VIDEO_VP8Level_Version1: return "_Version1";
|
||||
case OMX_VIDEO_VP8Level_Version2: return "_Version2";
|
||||
case OMX_VIDEO_VP8Level_Version3: return "_Version3";
|
||||
case OMX_VIDEO_VP8LevelUnknown: return "Unknown"; // unused
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(
|
||||
OMX_VIDEO_ANDROID_VPXTEMPORALLAYERPATTERNTYPE i, const char *def = "??") {
|
||||
switch (i) {
|
||||
case OMX_VIDEO_VPXTemporalLayerPatternNone: return "VPXTemporalLayerPatternNone";
|
||||
case OMX_VIDEO_VPXTemporalLayerPatternWebRTC: return "VPXTemporalLayerPatternWebRTC";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_VIDEO_HEVCPROFILETYPE i, const char *def = "!!") {
|
||||
switch (i) {
|
||||
case OMX_VIDEO_HEVCProfileUnknown: return "Unknown"; // unused
|
||||
case OMX_VIDEO_HEVCProfileMain: return "Main";
|
||||
case OMX_VIDEO_HEVCProfileMain10: return "Main10";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
inline static const char *asString(OMX_VIDEO_HEVCLEVELTYPE i, const char *def = "!!") {
|
||||
switch (i) {
|
||||
case OMX_VIDEO_HEVCLevelUnknown: return "LevelUnknown"; // unused
|
||||
case OMX_VIDEO_HEVCMainTierLevel1: return "MainTierLevel1";
|
||||
case OMX_VIDEO_HEVCHighTierLevel1: return "HighTierLevel1";
|
||||
case OMX_VIDEO_HEVCMainTierLevel2: return "MainTierLevel2";
|
||||
case OMX_VIDEO_HEVCHighTierLevel2: return "HighTierLevel2";
|
||||
case OMX_VIDEO_HEVCMainTierLevel21: return "MainTierLevel21";
|
||||
case OMX_VIDEO_HEVCHighTierLevel21: return "HighTierLevel21";
|
||||
case OMX_VIDEO_HEVCMainTierLevel3: return "MainTierLevel3";
|
||||
case OMX_VIDEO_HEVCHighTierLevel3: return "HighTierLevel3";
|
||||
case OMX_VIDEO_HEVCMainTierLevel31: return "MainTierLevel31";
|
||||
case OMX_VIDEO_HEVCHighTierLevel31: return "HighTierLevel31";
|
||||
case OMX_VIDEO_HEVCMainTierLevel4: return "MainTierLevel4";
|
||||
case OMX_VIDEO_HEVCHighTierLevel4: return "HighTierLevel4";
|
||||
case OMX_VIDEO_HEVCMainTierLevel41: return "MainTierLevel41";
|
||||
case OMX_VIDEO_HEVCHighTierLevel41: return "HighTierLevel41";
|
||||
case OMX_VIDEO_HEVCMainTierLevel5: return "MainTierLevel5";
|
||||
case OMX_VIDEO_HEVCHighTierLevel5: return "HighTierLevel5";
|
||||
case OMX_VIDEO_HEVCMainTierLevel51: return "MainTierLevel51";
|
||||
case OMX_VIDEO_HEVCHighTierLevel51: return "HighTierLevel51";
|
||||
case OMX_VIDEO_HEVCMainTierLevel52: return "MainTierLevel52";
|
||||
case OMX_VIDEO_HEVCHighTierLevel52: return "HighTierLevel52";
|
||||
case OMX_VIDEO_HEVCMainTierLevel6: return "MainTierLevel6";
|
||||
case OMX_VIDEO_HEVCHighTierLevel6: return "HighTierLevel6";
|
||||
case OMX_VIDEO_HEVCMainTierLevel61: return "MainTierLevel61";
|
||||
case OMX_VIDEO_HEVCHighTierLevel61: return "HighTierLevel61";
|
||||
case OMX_VIDEO_HEVCMainTierLevel62: return "MainTierLevel62";
|
||||
case OMX_VIDEO_HEVCHighTierLevel62: return "HighTierLevel62";
|
||||
default: return def;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // AS_STRING_FOR_OMX_VIDEOEXT_H
|
||||
|
||||
#endif // OMX_VideoExt_h
|
File diff suppressed because it is too large
Load Diff
|
@ -1,102 +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_AudioExt.h - OpenMax IL version 1.1.2
|
||||
* The OMX_AudioExt header file contains extensions to the
|
||||
* definitions used by both the application and the component to
|
||||
* access video items.
|
||||
*/
|
||||
|
||||
#ifndef OMX_AudioExt_h
|
||||
#define OMX_AudioExt_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 <OMX_Core.h>
|
||||
|
||||
#define OMX_AUDIO_AACToolAndroidSSBR (OMX_AUDIO_AACToolVendor << 0) /**< SSBR: MPEG-4 Single-rate (downsampled) Spectral Band Replication tool allowed or active */
|
||||
#define OMX_AUDIO_AACToolAndroidDSBR (OMX_AUDIO_AACToolVendor << 1) /**< DSBR: MPEG-4 Dual-rate Spectral Band Replication tool allowed or active */
|
||||
|
||||
typedef enum OMX_AUDIO_CODINGEXTTYPE {
|
||||
OMX_AUDIO_CodingAndroidUnused = OMX_AUDIO_CodingKhronosExtensions + 0x00100000,
|
||||
OMX_AUDIO_CodingAndroidAC3, /**< AC3 encoded data */
|
||||
OMX_AUDIO_CodingAndroidOPUS, /**< OPUS encoded data */
|
||||
OMX_AUDIO_CodingAndroidEAC3, /**< EAC3 encoded data */
|
||||
} OMX_AUDIO_CODINGEXTTYPE;
|
||||
|
||||
typedef struct OMX_AUDIO_PARAM_ANDROID_AC3TYPE {
|
||||
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
|
||||
variable or unknown sampling rate. */
|
||||
} OMX_AUDIO_PARAM_ANDROID_AC3TYPE;
|
||||
|
||||
typedef struct OMX_AUDIO_PARAM_ANDROID_EAC3TYPE {
|
||||
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
|
||||
variable or unknown sampling rate. */
|
||||
} OMX_AUDIO_PARAM_ANDROID_EAC3TYPE;
|
||||
|
||||
typedef struct OMX_AUDIO_PARAM_ANDROID_OPUSTYPE {
|
||||
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 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_PARAM_ANDROID_OPUSTYPE;
|
||||
|
||||
typedef struct OMX_AUDIO_PARAM_ANDROID_AACPRESENTATIONTYPE {
|
||||
OMX_U32 nSize; /**< size of the structure in bytes */
|
||||
OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
|
||||
OMX_S32 nMaxOutputChannels; /**< Maximum channel count to be output, -1 if unspecified, 0 if downmixing disabled */
|
||||
OMX_S32 nDrcCut; /**< The DRC attenuation factor, between 0 and 127, -1 if unspecified */
|
||||
OMX_S32 nDrcBoost; /**< The DRC amplification factor, between 0 and 127, -1 if unspecified */
|
||||
OMX_S32 nHeavyCompression; /**< 0 for light compression, 1 for heavy compression, -1 if unspecified */
|
||||
OMX_S32 nTargetReferenceLevel; /**< Target reference level, between 0 and 127, -1 if unspecified */
|
||||
OMX_S32 nEncodedTargetLevel; /**< Target reference level assumed at the encoder, between 0 and 127, -1 if unspecified */
|
||||
OMX_S32 nPCMLimiterEnable; /**< Signal level limiting, 0 for disable, 1 for enable, -1 if unspecified */
|
||||
} OMX_AUDIO_PARAM_ANDROID_AACPRESENTATIONTYPE;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* OMX_AudioExt_h */
|
||||
/* File EOF */
|
|
@ -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 <OMX_Audio.h>
|
||||
#include <OMX_Video.h>
|
||||
#include <OMX_Image.h>
|
||||
#include <OMX_Other.h>
|
||||
|
||||
/** @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 */
|
|
@ -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
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -1,958 +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 <OMX_Core.h>
|
||||
|
||||
/** @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 */
|
||||
/**<Reserved android opaque colorformat. Tells the encoder that
|
||||
* the actual colorformat will be relayed by the
|
||||
* Gralloc Buffers.
|
||||
* FIXME: In the process of reserving some enum values for
|
||||
* Android-specific OMX IL colorformats. Change this enum to
|
||||
* an acceptable range once that is done.
|
||||
* */
|
||||
OMX_COLOR_FormatAndroidOpaque = 0x7F000789,
|
||||
OMX_COLOR_Format32BitRGBA8888 = 0x7F00A000,
|
||||
/** Flexible 8-bit YUV format. Codec should report this format
|
||||
* as being supported if it supports any YUV420 packed planar
|
||||
* or semiplanar formats. When port is set to use this format,
|
||||
* codec can substitute any YUV420 packed planar or semiplanar
|
||||
* format for it. */
|
||||
OMX_COLOR_FormatYUV420Flexible = 0x7F420888,
|
||||
|
||||
OMX_TI_COLOR_FormatYUV420PackedSemiPlanar = 0x7F000100,
|
||||
OMX_QCOM_COLOR_FormatYVU420SemiPlanar = 0x7FA30C00,
|
||||
OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka = 0x7FA30C03,
|
||||
OMX_SEC_COLOR_FormatNV12Tiled = 0x7FC00002,
|
||||
OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar32m = 0x7FA30C04,
|
||||
OMX_COLOR_FormatMax = 0x7FFFFFFF
|
||||
} OMX_COLOR_FORMATTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Defines the matrix for conversion from RGB to YUV or vice versa.
|
||||
* iColorMatrix should be initialized with the fixed point values
|
||||
* used in converting between formats.
|
||||
*/
|
||||
typedef struct OMX_CONFIG_COLORCONVERSIONTYPE {
|
||||
OMX_U32 nSize; /**< Size of the structure in bytes */
|
||||
OMX_VERSIONTYPE nVersion; /**< OMX specification version info */
|
||||
OMX_U32 nPortIndex; /**< Port that this struct applies to */
|
||||
OMX_S32 xColorMatrix[3][3]; /**< Stored in signed Q16 format */
|
||||
OMX_S32 xColorOffset[4]; /**< Stored in signed Q16 format */
|
||||
}OMX_CONFIG_COLORCONVERSIONTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Structure defining percent to scale each frame dimension. For example:
|
||||
* To make the width 50% larger, use fWidth = 1.5 and to make the width
|
||||
* 1/2 the original size, use fWidth = 0.5
|
||||
*/
|
||||
typedef struct OMX_CONFIG_SCALEFACTORTYPE {
|
||||
OMX_U32 nSize; /**< Size of the structure in bytes */
|
||||
OMX_VERSIONTYPE nVersion; /**< OMX specification version info */
|
||||
OMX_U32 nPortIndex; /**< Port that this struct applies to */
|
||||
OMX_S32 xWidth; /**< Fixed point value stored as Q16 */
|
||||
OMX_S32 xHeight; /**< Fixed point value stored as Q16 */
|
||||
}OMX_CONFIG_SCALEFACTORTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Enumeration of possible image filter types
|
||||
*/
|
||||
typedef enum OMX_IMAGEFILTERTYPE {
|
||||
OMX_ImageFilterNone,
|
||||
OMX_ImageFilterNoise,
|
||||
OMX_ImageFilterEmboss,
|
||||
OMX_ImageFilterNegative,
|
||||
OMX_ImageFilterSketch,
|
||||
OMX_ImageFilterOilPaint,
|
||||
OMX_ImageFilterHatch,
|
||||
OMX_ImageFilterGpen,
|
||||
OMX_ImageFilterAntialias,
|
||||
OMX_ImageFilterDeRing,
|
||||
OMX_ImageFilterSolarize,
|
||||
OMX_ImageFilterKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_ImageFilterVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_ImageFilterMax = 0x7FFFFFFF
|
||||
} OMX_IMAGEFILTERTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Image filter configuration
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* eImageFilter : Image filter type enumeration
|
||||
*/
|
||||
typedef struct OMX_CONFIG_IMAGEFILTERTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_IMAGEFILTERTYPE eImageFilter;
|
||||
} OMX_CONFIG_IMAGEFILTERTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Customized U and V for color enhancement
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* bColorEnhancement : Enable/disable color enhancement
|
||||
* nCustomizedU : Practical values: 16-240, range: 0-255, value set for
|
||||
* U component
|
||||
* nCustomizedV : Practical values: 16-240, range: 0-255, value set for
|
||||
* V component
|
||||
*/
|
||||
typedef struct OMX_CONFIG_COLORENHANCEMENTTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_BOOL bColorEnhancement;
|
||||
OMX_U8 nCustomizedU;
|
||||
OMX_U8 nCustomizedV;
|
||||
} OMX_CONFIG_COLORENHANCEMENTTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Define color key and color key mask
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nARGBColor : 32bit Alpha, Red, Green, Blue Color
|
||||
* nARGBMask : 32bit Mask for Alpha, Red, Green, Blue channels
|
||||
*/
|
||||
typedef struct OMX_CONFIG_COLORKEYTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_U32 nARGBColor;
|
||||
OMX_U32 nARGBMask;
|
||||
} OMX_CONFIG_COLORKEYTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* List of color blend types for pre/post processing
|
||||
*
|
||||
* ENUMS:
|
||||
* None : No color blending present
|
||||
* AlphaConstant : Function is (alpha_constant * src) +
|
||||
* (1 - alpha_constant) * dst)
|
||||
* AlphaPerPixel : Function is (alpha * src) + (1 - alpha) * dst)
|
||||
* Alternate : Function is alternating pixels from src and dst
|
||||
* And : Function is (src & dst)
|
||||
* Or : Function is (src | dst)
|
||||
* Invert : Function is ~src
|
||||
*/
|
||||
typedef enum OMX_COLORBLENDTYPE {
|
||||
OMX_ColorBlendNone,
|
||||
OMX_ColorBlendAlphaConstant,
|
||||
OMX_ColorBlendAlphaPerPixel,
|
||||
OMX_ColorBlendAlternate,
|
||||
OMX_ColorBlendAnd,
|
||||
OMX_ColorBlendOr,
|
||||
OMX_ColorBlendInvert,
|
||||
OMX_ColorBlendKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_ColorBlendVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_ColorBlendMax = 0x7FFFFFFF
|
||||
} OMX_COLORBLENDTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Color blend configuration
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nRGBAlphaConstant : Constant global alpha values when global alpha is used
|
||||
* eColorBlend : Color blend type enumeration
|
||||
*/
|
||||
typedef struct OMX_CONFIG_COLORBLENDTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_U32 nRGBAlphaConstant;
|
||||
OMX_COLORBLENDTYPE eColorBlend;
|
||||
} OMX_CONFIG_COLORBLENDTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Hold frame dimension
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nWidth : Frame width in pixels
|
||||
* nHeight : Frame height in pixels
|
||||
*/
|
||||
typedef struct OMX_FRAMESIZETYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_U32 nWidth;
|
||||
OMX_U32 nHeight;
|
||||
} OMX_FRAMESIZETYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Rotation configuration
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nRotation : +/- integer rotation value
|
||||
*/
|
||||
typedef struct OMX_CONFIG_ROTATIONTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_S32 nRotation;
|
||||
} OMX_CONFIG_ROTATIONTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Possible mirroring directions for pre/post processing
|
||||
*
|
||||
* ENUMS:
|
||||
* None : No mirroring
|
||||
* Vertical : Vertical mirroring, flip on X axis
|
||||
* Horizontal : Horizontal mirroring, flip on Y axis
|
||||
* Both : Both vertical and horizontal mirroring
|
||||
*/
|
||||
typedef enum OMX_MIRRORTYPE {
|
||||
OMX_MirrorNone = 0,
|
||||
OMX_MirrorVertical,
|
||||
OMX_MirrorHorizontal,
|
||||
OMX_MirrorBoth,
|
||||
OMX_MirrorKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_MirrorVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_MirrorMax = 0x7FFFFFFF
|
||||
} OMX_MIRRORTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Mirroring configuration
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* eMirror : Mirror type enumeration
|
||||
*/
|
||||
typedef struct OMX_CONFIG_MIRRORTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_MIRRORTYPE eMirror;
|
||||
} OMX_CONFIG_MIRRORTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Position information only
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nX : X coordinate for the point
|
||||
* nY : Y coordinate for the point
|
||||
*/
|
||||
typedef struct OMX_CONFIG_POINTTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_S32 nX;
|
||||
OMX_S32 nY;
|
||||
} OMX_CONFIG_POINTTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Frame size plus position
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nLeft : X Coordinate of the top left corner of the rectangle
|
||||
* nTop : Y Coordinate of the top left corner of the rectangle
|
||||
* nWidth : Width of the rectangle
|
||||
* nHeight : Height of the rectangle
|
||||
*/
|
||||
typedef struct OMX_CONFIG_RECTTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_S32 nLeft;
|
||||
OMX_S32 nTop;
|
||||
OMX_U32 nWidth;
|
||||
OMX_U32 nHeight;
|
||||
} OMX_CONFIG_RECTTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Deblocking state; it is required to be set up before starting the codec
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* bDeblocking : Enable/disable deblocking mode
|
||||
*/
|
||||
typedef struct OMX_PARAM_DEBLOCKINGTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_BOOL bDeblocking;
|
||||
} OMX_PARAM_DEBLOCKINGTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Stabilization state
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* bStab : Enable/disable frame stabilization state
|
||||
*/
|
||||
typedef struct OMX_CONFIG_FRAMESTABTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_BOOL bStab;
|
||||
} OMX_CONFIG_FRAMESTABTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* White Balance control type
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* SunLight : Referenced in JSR-234
|
||||
* Flash : Optimal for device's integrated flash
|
||||
*/
|
||||
typedef enum OMX_WHITEBALCONTROLTYPE {
|
||||
OMX_WhiteBalControlOff = 0,
|
||||
OMX_WhiteBalControlAuto,
|
||||
OMX_WhiteBalControlSunLight,
|
||||
OMX_WhiteBalControlCloudy,
|
||||
OMX_WhiteBalControlShade,
|
||||
OMX_WhiteBalControlTungsten,
|
||||
OMX_WhiteBalControlFluorescent,
|
||||
OMX_WhiteBalControlIncandescent,
|
||||
OMX_WhiteBalControlFlash,
|
||||
OMX_WhiteBalControlHorizon,
|
||||
OMX_WhiteBalControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_WhiteBalControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_WhiteBalControlMax = 0x7FFFFFFF
|
||||
} OMX_WHITEBALCONTROLTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* White Balance control configuration
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* eWhiteBalControl : White balance enumeration
|
||||
*/
|
||||
typedef struct OMX_CONFIG_WHITEBALCONTROLTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_WHITEBALCONTROLTYPE eWhiteBalControl;
|
||||
} OMX_CONFIG_WHITEBALCONTROLTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Exposure control type
|
||||
*/
|
||||
typedef enum OMX_EXPOSURECONTROLTYPE {
|
||||
OMX_ExposureControlOff = 0,
|
||||
OMX_ExposureControlAuto,
|
||||
OMX_ExposureControlNight,
|
||||
OMX_ExposureControlBackLight,
|
||||
OMX_ExposureControlSpotLight,
|
||||
OMX_ExposureControlSports,
|
||||
OMX_ExposureControlSnow,
|
||||
OMX_ExposureControlBeach,
|
||||
OMX_ExposureControlLargeAperture,
|
||||
OMX_ExposureControlSmallApperture,
|
||||
OMX_ExposureControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_ExposureControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_ExposureControlMax = 0x7FFFFFFF
|
||||
} OMX_EXPOSURECONTROLTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* White Balance control configuration
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* eExposureControl : Exposure control enumeration
|
||||
*/
|
||||
typedef struct OMX_CONFIG_EXPOSURECONTROLTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_EXPOSURECONTROLTYPE eExposureControl;
|
||||
} OMX_CONFIG_EXPOSURECONTROLTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Defines sensor supported mode.
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nFrameRate : Single shot mode is indicated by a 0
|
||||
* bOneShot : Enable for single shot, disable for streaming
|
||||
* sFrameSize : Framesize
|
||||
*/
|
||||
typedef struct OMX_PARAM_SENSORMODETYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_U32 nFrameRate;
|
||||
OMX_BOOL bOneShot;
|
||||
OMX_FRAMESIZETYPE sFrameSize;
|
||||
} OMX_PARAM_SENSORMODETYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Defines contrast level
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nContrast : Values allowed for contrast -100 to 100, zero means no change
|
||||
*/
|
||||
typedef struct OMX_CONFIG_CONTRASTTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_S32 nContrast;
|
||||
} OMX_CONFIG_CONTRASTTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Defines brightness level
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nBrightness : 0-100%
|
||||
*/
|
||||
typedef struct OMX_CONFIG_BRIGHTNESSTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_U32 nBrightness;
|
||||
} OMX_CONFIG_BRIGHTNESSTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Defines backlight level configuration for a video sink, e.g. LCD panel
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nBacklight : Values allowed for backlight 0-100%
|
||||
* nTimeout : Number of milliseconds before backlight automatically turns
|
||||
* off. A value of 0x0 disables backight timeout
|
||||
*/
|
||||
typedef struct OMX_CONFIG_BACKLIGHTTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_U32 nBacklight;
|
||||
OMX_U32 nTimeout;
|
||||
} OMX_CONFIG_BACKLIGHTTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Defines setting for Gamma
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nGamma : Values allowed for gamma -100 to 100, zero means no change
|
||||
*/
|
||||
typedef struct OMX_CONFIG_GAMMATYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_S32 nGamma;
|
||||
} OMX_CONFIG_GAMMATYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Define for setting saturation
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nSaturation : Values allowed for saturation -100 to 100, zero means
|
||||
* no change
|
||||
*/
|
||||
typedef struct OMX_CONFIG_SATURATIONTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_S32 nSaturation;
|
||||
} OMX_CONFIG_SATURATIONTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Define for setting Lightness
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nLightness : Values allowed for lightness -100 to 100, zero means no
|
||||
* change
|
||||
*/
|
||||
typedef struct OMX_CONFIG_LIGHTNESSTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_S32 nLightness;
|
||||
} OMX_CONFIG_LIGHTNESSTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Plane blend configuration
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Index of input port associated with the plane.
|
||||
* nDepth : Depth of the plane in relation to the screen. Higher
|
||||
* numbered depths are "behind" lower number depths.
|
||||
* This number defaults to the Port Index number.
|
||||
* nAlpha : Transparency blending component for the entire plane.
|
||||
* See blending modes for more detail.
|
||||
*/
|
||||
typedef struct OMX_CONFIG_PLANEBLENDTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_U32 nDepth;
|
||||
OMX_U32 nAlpha;
|
||||
} OMX_CONFIG_PLANEBLENDTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Define interlace type
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* bEnable : Enable control variable for this functionality
|
||||
* (see below)
|
||||
* nInterleavePortIndex : Index of input or output port associated with
|
||||
* the interleaved plane.
|
||||
* pPlanarPortIndexes[4] : Index of input or output planar ports.
|
||||
*/
|
||||
typedef struct OMX_PARAM_INTERLEAVETYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_BOOL bEnable;
|
||||
OMX_U32 nInterleavePortIndex;
|
||||
} OMX_PARAM_INTERLEAVETYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Defines the picture effect used for an input picture
|
||||
*/
|
||||
typedef enum OMX_TRANSITIONEFFECTTYPE {
|
||||
OMX_EffectNone,
|
||||
OMX_EffectFadeFromBlack,
|
||||
OMX_EffectFadeToBlack,
|
||||
OMX_EffectUnspecifiedThroughConstantColor,
|
||||
OMX_EffectDissolve,
|
||||
OMX_EffectWipe,
|
||||
OMX_EffectUnspecifiedMixOfTwoScenes,
|
||||
OMX_EffectKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_EffectVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_EffectMax = 0x7FFFFFFF
|
||||
} OMX_TRANSITIONEFFECTTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Structure used to configure current transition effect
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* eEffect : Effect to enable
|
||||
*/
|
||||
typedef struct OMX_CONFIG_TRANSITIONEFFECTTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_TRANSITIONEFFECTTYPE eEffect;
|
||||
} OMX_CONFIG_TRANSITIONEFFECTTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Defines possible data unit types for encoded video data. The data unit
|
||||
* types are used both for encoded video input for playback as well as
|
||||
* encoded video output from recording.
|
||||
*/
|
||||
typedef enum OMX_DATAUNITTYPE {
|
||||
OMX_DataUnitCodedPicture,
|
||||
OMX_DataUnitVideoSegment,
|
||||
OMX_DataUnitSeveralSegments,
|
||||
OMX_DataUnitArbitraryStreamSection,
|
||||
OMX_DataUnitKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_DataUnitVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_DataUnitMax = 0x7FFFFFFF
|
||||
} OMX_DATAUNITTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Defines possible encapsulation types for coded video data unit. The
|
||||
* encapsulation information is used both for encoded video input for
|
||||
* playback as well as encoded video output from recording.
|
||||
*/
|
||||
typedef enum OMX_DATAUNITENCAPSULATIONTYPE {
|
||||
OMX_DataEncapsulationElementaryStream,
|
||||
OMX_DataEncapsulationGenericPayload,
|
||||
OMX_DataEncapsulationRtpPayload,
|
||||
OMX_DataEncapsulationKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_DataEncapsulationVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_DataEncapsulationMax = 0x7FFFFFFF
|
||||
} OMX_DATAUNITENCAPSULATIONTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Structure used to configure the type of being decoded/encoded
|
||||
*/
|
||||
typedef struct OMX_PARAM_DATAUNITTYPE {
|
||||
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_DATAUNITTYPE eUnitType;
|
||||
OMX_DATAUNITENCAPSULATIONTYPE eEncapsulationType;
|
||||
} OMX_PARAM_DATAUNITTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Defines dither types
|
||||
*/
|
||||
typedef enum OMX_DITHERTYPE {
|
||||
OMX_DitherNone,
|
||||
OMX_DitherOrdered,
|
||||
OMX_DitherErrorDiffusion,
|
||||
OMX_DitherOther,
|
||||
OMX_DitherKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_DitherVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_DitherMax = 0x7FFFFFFF
|
||||
} OMX_DITHERTYPE;
|
||||
|
||||
|
||||
/**
|
||||
* Structure used to configure current type of dithering
|
||||
*/
|
||||
typedef struct OMX_CONFIG_DITHERTYPE {
|
||||
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_DITHERTYPE eDither; /**< Type of dithering to use */
|
||||
} OMX_CONFIG_DITHERTYPE;
|
||||
|
||||
typedef struct OMX_CONFIG_CAPTUREMODETYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex; /**< Port that this structure applies to */
|
||||
OMX_BOOL bContinuous; /**< If true then ignore frame rate and emit capture
|
||||
* data as fast as possible (otherwise obey port's frame rate). */
|
||||
OMX_BOOL bFrameLimited; /**< If true then terminate capture after the port emits the
|
||||
* specified number of frames (otherwise the port does not
|
||||
* terminate the capture until instructed to do so by the client).
|
||||
* Even if set, the client may manually terminate the capture prior
|
||||
* to reaching the limit. */
|
||||
OMX_U32 nFrameLimit; /**< Limit on number of frames emitted during a capture (only
|
||||
* valid if bFrameLimited is set). */
|
||||
} OMX_CONFIG_CAPTUREMODETYPE;
|
||||
|
||||
typedef enum OMX_METERINGTYPE {
|
||||
|
||||
OMX_MeteringModeAverage, /**< Center-weighted average metering. */
|
||||
OMX_MeteringModeSpot, /**< Spot (partial) metering. */
|
||||
OMX_MeteringModeMatrix, /**< Matrix or evaluative metering. */
|
||||
|
||||
OMX_MeteringKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_MeteringVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_EVModeMax = 0x7fffffff
|
||||
} OMX_METERINGTYPE;
|
||||
|
||||
typedef struct OMX_CONFIG_EXPOSUREVALUETYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_METERINGTYPE eMetering;
|
||||
OMX_S32 xEVCompensation; /**< Fixed point value stored as Q16 */
|
||||
OMX_U32 nApertureFNumber; /**< e.g. nApertureFNumber = 2 implies "f/2" - Q16 format */
|
||||
OMX_BOOL bAutoAperture; /**< Whether aperture number is defined automatically */
|
||||
OMX_U32 nShutterSpeedMsec; /**< Shutterspeed in milliseconds */
|
||||
OMX_BOOL bAutoShutterSpeed; /**< Whether shutter speed is defined automatically */
|
||||
OMX_U32 nSensitivity; /**< e.g. nSensitivity = 100 implies "ISO 100" */
|
||||
OMX_BOOL bAutoSensitivity; /**< Whether sensitivity is defined automatically */
|
||||
} OMX_CONFIG_EXPOSUREVALUETYPE;
|
||||
|
||||
/**
|
||||
* Focus region configuration
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* bCenter : Use center region as focus region of interest
|
||||
* bLeft : Use left region as focus region of interest
|
||||
* bRight : Use right region as focus region of interest
|
||||
* bTop : Use top region as focus region of interest
|
||||
* bBottom : Use bottom region as focus region of interest
|
||||
* bTopLeft : Use top left region as focus region of interest
|
||||
* bTopRight : Use top right region as focus region of interest
|
||||
* bBottomLeft : Use bottom left region as focus region of interest
|
||||
* bBottomRight : Use bottom right region as focus region of interest
|
||||
*/
|
||||
typedef struct OMX_CONFIG_FOCUSREGIONTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_BOOL bCenter;
|
||||
OMX_BOOL bLeft;
|
||||
OMX_BOOL bRight;
|
||||
OMX_BOOL bTop;
|
||||
OMX_BOOL bBottom;
|
||||
OMX_BOOL bTopLeft;
|
||||
OMX_BOOL bTopRight;
|
||||
OMX_BOOL bBottomLeft;
|
||||
OMX_BOOL bBottomRight;
|
||||
} OMX_CONFIG_FOCUSREGIONTYPE;
|
||||
|
||||
/**
|
||||
* Focus Status type
|
||||
*/
|
||||
typedef enum OMX_FOCUSSTATUSTYPE {
|
||||
OMX_FocusStatusOff = 0,
|
||||
OMX_FocusStatusRequest,
|
||||
OMX_FocusStatusReached,
|
||||
OMX_FocusStatusUnableToReach,
|
||||
OMX_FocusStatusLost,
|
||||
OMX_FocusStatusKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
OMX_FocusStatusVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
|
||||
OMX_FocusStatusMax = 0x7FFFFFFF
|
||||
} OMX_FOCUSSTATUSTYPE;
|
||||
|
||||
/**
|
||||
* Focus status configuration
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* eFocusStatus : Specifies the focus status
|
||||
* bCenterStatus : Use center region as focus region of interest
|
||||
* bLeftStatus : Use left region as focus region of interest
|
||||
* bRightStatus : Use right region as focus region of interest
|
||||
* bTopStatus : Use top region as focus region of interest
|
||||
* bBottomStatus : Use bottom region as focus region of interest
|
||||
* bTopLeftStatus : Use top left region as focus region of interest
|
||||
* bTopRightStatus : Use top right region as focus region of interest
|
||||
* bBottomLeftStatus : Use bottom left region as focus region of interest
|
||||
* bBottomRightStatus : Use bottom right region as focus region of interest
|
||||
*/
|
||||
typedef struct OMX_PARAM_FOCUSSTATUSTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_FOCUSSTATUSTYPE eFocusStatus;
|
||||
OMX_BOOL bCenterStatus;
|
||||
OMX_BOOL bLeftStatus;
|
||||
OMX_BOOL bRightStatus;
|
||||
OMX_BOOL bTopStatus;
|
||||
OMX_BOOL bBottomStatus;
|
||||
OMX_BOOL bTopLeftStatus;
|
||||
OMX_BOOL bTopRightStatus;
|
||||
OMX_BOOL bBottomLeftStatus;
|
||||
OMX_BOOL bBottomRightStatus;
|
||||
} OMX_PARAM_FOCUSSTATUSTYPE;
|
||||
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
/* File EOF */
|
|
@ -1,345 +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_Image.h - OpenMax IL version 1.1.2
|
||||
* The structures needed by Image components to exchange parameters and
|
||||
* configuration data with the components.
|
||||
*/
|
||||
#ifndef OMX_Image_h
|
||||
#define OMX_Image_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 <OMX_IVCommon.h>
|
||||
|
||||
/** @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 */
|
|
@ -1,274 +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 <OMX_Types.h>
|
||||
|
||||
/** 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, /**<reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */
|
||||
OMX_IndexConfigTimePosition, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE */
|
||||
OMX_IndexConfigTimeSeekMode, /**< reference: OMX_TIME_CONFIG_SEEKMODETYPE */
|
||||
|
||||
|
||||
OMX_IndexKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
|
||||
/* Vendor specific area */
|
||||
OMX_IndexVendorStartUnused = 0x7F000000,
|
||||
/* Vendor specific structures should be in the range of 0x7F000000
|
||||
to 0x7FFFFFFE. This range is not broken out by vendor, so
|
||||
private indexes are not guaranteed unique and therefore should
|
||||
only be sent to the appropriate component. */
|
||||
|
||||
OMX_IndexMax = 0x7FFFFFFF
|
||||
|
||||
} OMX_INDEXTYPE;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
/* File EOF */
|
|
@ -1,101 +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.
|
||||
*
|
||||
*/
|
||||
|
||||
/** @file OMX_IndexExt.h - OpenMax IL version 1.1.2
|
||||
* The OMX_IndexExt header file contains extensions to the definitions
|
||||
* for both applications and components .
|
||||
*/
|
||||
|
||||
#ifndef OMX_IndexExt_h
|
||||
#define OMX_IndexExt_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 <OMX_Index.h>
|
||||
|
||||
|
||||
/** 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,
|
||||
OMX_IndexParamAudioAndroidAc3, /**< reference: OMX_AUDIO_PARAM_ANDROID_AC3TYPE */
|
||||
OMX_IndexParamAudioAndroidOpus, /**< reference: OMX_AUDIO_PARAM_ANDROID_OPUSTYPE */
|
||||
OMX_IndexParamAudioAndroidAacPresentation, /**< reference: OMX_AUDIO_PARAM_ANDROID_AACPRESENTATIONTYPE */
|
||||
OMX_IndexParamAudioAndroidEac3, /**< reference: OMX_AUDIO_PARAM_ANDROID_EAC3TYPE */
|
||||
|
||||
/* 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 */
|
||||
OMX_IndexParamVideoAndroidVp8Encoder, /**< reference: OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE */
|
||||
OMX_IndexParamVideoHevc, /**< reference: OMX_VIDEO_PARAM_HEVCTYPE */
|
||||
OMX_IndexParamSliceSegments, /**< reference: OMX_VIDEO_SLICESEGMENTSTYPE */
|
||||
|
||||
/* Image & Video common configurations */
|
||||
OMX_IndexExtCommonStartUnused = OMX_IndexKhronosExtensions + 0x00700000,
|
||||
|
||||
/* Other configurations */
|
||||
OMX_IndexExtOtherStartUnused = OMX_IndexKhronosExtensions + 0x00800000,
|
||||
OMX_IndexConfigAutoFramerateConversion, /**< reference: OMX_CONFIG_BOOLEANTYPE */
|
||||
OMX_IndexConfigPriority, /**< reference: OMX_PARAM_U32TYPE */
|
||||
OMX_IndexConfigOperatingRate, /**< reference: OMX_PARAM_U32TYPE in Q16 format for video and in Hz for audio */
|
||||
OMX_IndexParamConsumerUsageBits, /**< reference: OMX_PARAM_U32TYPE */
|
||||
|
||||
/* Time configurations */
|
||||
OMX_IndexExtTimeStartUnused = OMX_IndexKhronosExtensions + 0x00900000,
|
||||
|
||||
OMX_IndexExtMax = 0x7FFFFFFF
|
||||
} OMX_INDEXEXTTYPE;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* OMX_IndexExt_h */
|
||||
/* File EOF */
|
|
@ -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 <OMX_Core.h>
|
||||
|
||||
|
||||
/**
|
||||
* 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 */
|
|
@ -1,387 +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
|
||||
|
||||
#include <stdint.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 uint32_t OMX_U32;
|
||||
|
||||
/** OMX_S32 is a 32 bit signed quantity that is 32 bit word aligned */
|
||||
typedef int32_t 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;
|
||||
|
||||
/*
|
||||
* Temporary Android 64 bit modification
|
||||
*
|
||||
* #define OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS
|
||||
* overrides all OMX pointer types to be uint32_t.
|
||||
*
|
||||
* After this change, OMX codecs will work in 32 bit only, so 64 bit processes
|
||||
* must communicate to a remote 32 bit process for OMX to work.
|
||||
*/
|
||||
|
||||
#ifdef OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS
|
||||
|
||||
typedef uint32_t OMX_PTR;
|
||||
typedef OMX_PTR OMX_STRING;
|
||||
typedef OMX_PTR OMX_BYTE;
|
||||
|
||||
#else /* OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS */
|
||||
|
||||
/** 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;
|
||||
|
||||
#endif /* OMX_ANDROID_COMPILE_AS_32BIT_ON_64BIT_PLATFORMS */
|
||||
|
||||
/** 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 OMX_PTR 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 OMX_PTR 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 OMX_PTR 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 */
|
File diff suppressed because it is too large
Load Diff
|
@ -1,224 +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 <OMX_Core.h>
|
||||
|
||||
/** 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;
|
||||
|
||||
/** Maximum number of VP8 temporal layers */
|
||||
#define OMX_VIDEO_ANDROID_MAXVP8TEMPORALLAYERS 3
|
||||
|
||||
/** VP8 temporal layer patterns */
|
||||
typedef enum OMX_VIDEO_ANDROID_VPXTEMPORALLAYERPATTERNTYPE {
|
||||
OMX_VIDEO_VPXTemporalLayerPatternNone = 0,
|
||||
OMX_VIDEO_VPXTemporalLayerPatternWebRTC = 1,
|
||||
OMX_VIDEO_VPXTemporalLayerPatternMax = 0x7FFFFFFF
|
||||
} OMX_VIDEO_ANDROID_VPXTEMPORALLAYERPATTERNTYPE;
|
||||
|
||||
/**
|
||||
* Android specific VP8 encoder params
|
||||
*
|
||||
* STRUCT MEMBERS:
|
||||
* nSize : Size of the structure in bytes
|
||||
* nVersion : OMX specification version information
|
||||
* nPortIndex : Port that this structure applies to
|
||||
* nKeyFrameInterval : Key frame interval in frames
|
||||
* eTemporalPattern : Type of temporal layer pattern
|
||||
* nTemporalLayerCount : Number of temporal coding layers
|
||||
* nTemporalLayerBitrateRatio : Bitrate ratio allocation between temporal
|
||||
* streams in percentage
|
||||
* nMinQuantizer : Minimum (best quality) quantizer
|
||||
* nMaxQuantizer : Maximum (worst quality) quantizer
|
||||
*/
|
||||
typedef struct OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_U32 nKeyFrameInterval;
|
||||
OMX_VIDEO_ANDROID_VPXTEMPORALLAYERPATTERNTYPE eTemporalPattern;
|
||||
OMX_U32 nTemporalLayerCount;
|
||||
OMX_U32 nTemporalLayerBitrateRatio[OMX_VIDEO_ANDROID_MAXVP8TEMPORALLAYERS];
|
||||
OMX_U32 nMinQuantizer;
|
||||
OMX_U32 nMaxQuantizer;
|
||||
} OMX_VIDEO_PARAM_ANDROID_VP8ENCODERTYPE;
|
||||
|
||||
/** HEVC Profile enum type */
|
||||
typedef enum OMX_VIDEO_HEVCPROFILETYPE {
|
||||
OMX_VIDEO_HEVCProfileUnknown = 0x0,
|
||||
OMX_VIDEO_HEVCProfileMain = 0x1,
|
||||
OMX_VIDEO_HEVCProfileMain10 = 0x2,
|
||||
OMX_VIDEO_HEVCProfileMax = 0x7FFFFFFF
|
||||
} OMX_VIDEO_HEVCPROFILETYPE;
|
||||
|
||||
/** HEVC Level enum type */
|
||||
typedef enum OMX_VIDEO_HEVCLEVELTYPE {
|
||||
OMX_VIDEO_HEVCLevelUnknown = 0x0,
|
||||
OMX_VIDEO_HEVCMainTierLevel1 = 0x1,
|
||||
OMX_VIDEO_HEVCHighTierLevel1 = 0x2,
|
||||
OMX_VIDEO_HEVCMainTierLevel2 = 0x4,
|
||||
OMX_VIDEO_HEVCHighTierLevel2 = 0x8,
|
||||
OMX_VIDEO_HEVCMainTierLevel21 = 0x10,
|
||||
OMX_VIDEO_HEVCHighTierLevel21 = 0x20,
|
||||
OMX_VIDEO_HEVCMainTierLevel3 = 0x40,
|
||||
OMX_VIDEO_HEVCHighTierLevel3 = 0x80,
|
||||
OMX_VIDEO_HEVCMainTierLevel31 = 0x100,
|
||||
OMX_VIDEO_HEVCHighTierLevel31 = 0x200,
|
||||
OMX_VIDEO_HEVCMainTierLevel4 = 0x400,
|
||||
OMX_VIDEO_HEVCHighTierLevel4 = 0x800,
|
||||
OMX_VIDEO_HEVCMainTierLevel41 = 0x1000,
|
||||
OMX_VIDEO_HEVCHighTierLevel41 = 0x2000,
|
||||
OMX_VIDEO_HEVCMainTierLevel5 = 0x4000,
|
||||
OMX_VIDEO_HEVCHighTierLevel5 = 0x8000,
|
||||
OMX_VIDEO_HEVCMainTierLevel51 = 0x10000,
|
||||
OMX_VIDEO_HEVCHighTierLevel51 = 0x20000,
|
||||
OMX_VIDEO_HEVCMainTierLevel52 = 0x40000,
|
||||
OMX_VIDEO_HEVCHighTierLevel52 = 0x80000,
|
||||
OMX_VIDEO_HEVCMainTierLevel6 = 0x100000,
|
||||
OMX_VIDEO_HEVCHighTierLevel6 = 0x200000,
|
||||
OMX_VIDEO_HEVCMainTierLevel61 = 0x400000,
|
||||
OMX_VIDEO_HEVCHighTierLevel61 = 0x800000,
|
||||
OMX_VIDEO_HEVCMainTierLevel62 = 0x1000000,
|
||||
OMX_VIDEO_HEVCHighTierLevel62 = 0x2000000,
|
||||
OMX_VIDEO_HEVCHighTiermax = 0x7FFFFFFF
|
||||
} OMX_VIDEO_HEVCLEVELTYPE;
|
||||
|
||||
/** Structure for controlling HEVC video encoding and decoding */
|
||||
typedef struct OMX_VIDEO_PARAM_HEVCTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_VIDEO_HEVCPROFILETYPE eProfile;
|
||||
OMX_VIDEO_HEVCLEVELTYPE eLevel;
|
||||
} OMX_VIDEO_PARAM_HEVCTYPE;
|
||||
|
||||
/** Structure to define if dependent slice segments should be used */
|
||||
typedef struct OMX_VIDEO_SLICESEGMENTSTYPE {
|
||||
OMX_U32 nSize;
|
||||
OMX_VERSIONTYPE nVersion;
|
||||
OMX_U32 nPortIndex;
|
||||
OMX_BOOL bDepedentSegments;
|
||||
OMX_BOOL bEnableLoopFilterAcrossSlices;
|
||||
} OMX_VIDEO_SLICESEGMENTSTYPE;
|
||||
|
||||
/** Structure to return timestamps of rendered output frames as well as EOS
|
||||
* for tunneled components.
|
||||
*/
|
||||
typedef struct OMX_VIDEO_RENDEREVENTTYPE {
|
||||
OMX_S64 nMediaTimeUs; // timestamp of rendered video frame
|
||||
OMX_S64 nSystemTimeNs; // system monotonic time at the time frame was rendered
|
||||
// Use INT64_MAX for nMediaTimeUs to signal that the EOS
|
||||
// has been reached. In this case, nSystemTimeNs MUST be
|
||||
// the system time when the last frame was rendered.
|
||||
// This MUST be done in addition to returning (and
|
||||
// following) the render information for the last frame.
|
||||
} OMX_VIDEO_RENDEREVENTTYPE;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* OMX_VideoExt_h */
|
||||
/* File EOF */
|
|
@ -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 ANDROID_IPOWERMANAGER_H
|
||||
#define ANDROID_IPOWERMANAGER_H
|
||||
|
||||
#include <utils/Errors.h>
|
||||
#include <binder/IInterface.h>
|
||||
#include <hardware/power.h>
|
||||
|
||||
namespace android {
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// must be kept in sync with interface defined in IPowerManager.aidl
|
||||
class IPowerManager : public IInterface
|
||||
{
|
||||
public:
|
||||
DECLARE_META_INTERFACE(PowerManager);
|
||||
|
||||
// FIXME remove the bool isOneWay parameters as they are not oneway in the .aidl
|
||||
virtual status_t acquireWakeLock(int flags, const sp<IBinder>& lock, const String16& tag,
|
||||
const String16& packageName, bool isOneWay = false) = 0;
|
||||
virtual status_t acquireWakeLockWithUid(int flags, const sp<IBinder>& lock, const String16& tag,
|
||||
const String16& packageName, int uid, bool isOneWay = false) = 0;
|
||||
virtual status_t releaseWakeLock(const sp<IBinder>& lock, int flags, bool isOneWay = false) = 0;
|
||||
virtual status_t updateWakeLockUids(const sp<IBinder>& lock, int len, const int *uids,
|
||||
bool isOneWay = false) = 0;
|
||||
// oneway in the .aidl
|
||||
virtual status_t powerHint(int hintId, int data) = 0;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
}; // namespace android
|
||||
|
||||
#endif // ANDROID_IPOWERMANAGER_H
|
|
@ -1,37 +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_POWERMANAGER_H
|
||||
#define ANDROID_POWERMANAGER_H
|
||||
|
||||
namespace android {
|
||||
|
||||
// must be kept in sync with definitions in PowerManager.java
|
||||
enum {
|
||||
POWERMANAGER_PARTIAL_WAKE_LOCK = 1, // equals PowerManager.PARTIAL_WAKE_LOCK constant
|
||||
};
|
||||
|
||||
enum {
|
||||
USER_ACTIVITY_EVENT_OTHER = 0,
|
||||
USER_ACTIVITY_EVENT_BUTTON = 1,
|
||||
USER_ACTIVITY_EVENT_TOUCH = 2,
|
||||
|
||||
USER_ACTIVITY_EVENT_LAST = USER_ACTIVITY_EVENT_TOUCH, // Last valid event code.
|
||||
};
|
||||
|
||||
}; // namespace android
|
||||
|
||||
#endif // ANDROID_POWERMANAGER_H
|
|
@ -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.
|
||||
*/
|
||||
|
||||
// All static variables go here, to control initialization and
|
||||
// destruction order in the library.
|
||||
|
||||
#include <utils/threads.h>
|
||||
|
||||
#include <binder/IBinder.h>
|
||||
#include <binder/IMemory.h>
|
||||
#include <binder/ProcessState.h>
|
||||
#include <binder/IPermissionController.h>
|
||||
#include <binder/IServiceManager.h>
|
||||
|
||||
namespace android {
|
||||
|
||||
// For TextStream.cpp
|
||||
extern Vector<int32_t> gTextBuffers;
|
||||
|
||||
// For ProcessState.cpp
|
||||
extern Mutex gProcessMutex;
|
||||
extern sp<ProcessState> gProcess;
|
||||
|
||||
// For IServiceManager.cpp
|
||||
extern Mutex gDefaultServiceManagerLock;
|
||||
extern sp<IServiceManager> gDefaultServiceManager;
|
||||
extern sp<IPermissionController> gPermissionController;
|
||||
|
||||
} // namespace android
|
|
@ -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 _BINDER_MODULE_H_
|
||||
#define _BINDER_MODULE_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace android {
|
||||
#endif
|
||||
|
||||
/* obtain structures and constants from the kernel header */
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <linux/binder.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // namespace android
|
||||
#endif
|
||||
|
||||
#endif // _BINDER_MODULE_H_
|
|
@ -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 ANDROID_PRIVATE_GUI_COMPOSER_SERVICE_H
|
||||
#define ANDROID_PRIVATE_GUI_COMPOSER_SERVICE_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <utils/Singleton.h>
|
||||
#include <utils/StrongPointer.h>
|
||||
|
||||
|
||||
namespace android {
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class IMemoryHeap;
|
||||
class ISurfaceComposer;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// This holds our connection to the composer service (i.e. SurfaceFlinger).
|
||||
// If the remote side goes away, we will re-establish the connection.
|
||||
// Users of this class should not retain the value from
|
||||
// getComposerService() for an extended period.
|
||||
//
|
||||
// (It's not clear that using Singleton is useful here anymore.)
|
||||
class ComposerService : public Singleton<ComposerService>
|
||||
{
|
||||
sp<ISurfaceComposer> mComposerService;
|
||||
sp<IBinder::DeathRecipient> mDeathObserver;
|
||||
Mutex mLock;
|
||||
|
||||
ComposerService();
|
||||
void connectLocked();
|
||||
void composerServiceDied();
|
||||
friend class Singleton<ComposerService>;
|
||||
public:
|
||||
|
||||
// Get a connection to the Composer Service. This will block until
|
||||
// a connection is established.
|
||||
static sp<ISurfaceComposer> getComposerService();
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
}; // namespace android
|
||||
|
||||
#endif // ANDROID_PRIVATE_GUI_COMPOSER_SERVICE_H
|
|
@ -1,143 +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_SF_LAYER_STATE_H
|
||||
#define ANDROID_SF_LAYER_STATE_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <utils/Errors.h>
|
||||
|
||||
#include <ui/Region.h>
|
||||
#include <ui/Rect.h>
|
||||
|
||||
namespace android {
|
||||
|
||||
class Parcel;
|
||||
class ISurfaceComposerClient;
|
||||
|
||||
/*
|
||||
* Used to communicate layer information between SurfaceFlinger and its clients.
|
||||
*/
|
||||
struct layer_state_t {
|
||||
|
||||
|
||||
enum {
|
||||
eLayerHidden = 0x01, // SURFACE_HIDDEN in SurfaceControl.java
|
||||
eLayerOpaque = 0x02, // SURFACE_OPAQUE
|
||||
eLayerSecure = 0x80, // SECURE
|
||||
};
|
||||
|
||||
enum {
|
||||
ePositionChanged = 0x00000001,
|
||||
eLayerChanged = 0x00000002,
|
||||
eSizeChanged = 0x00000004,
|
||||
eAlphaChanged = 0x00000008,
|
||||
eMatrixChanged = 0x00000010,
|
||||
eTransparentRegionChanged = 0x00000020,
|
||||
eFlagsChanged = 0x00000040,
|
||||
eLayerStackChanged = 0x00000080,
|
||||
eCropChanged = 0x00000100,
|
||||
eBlurChanged = 0x00400000,
|
||||
eBlurMaskSurfaceChanged = 0x00800000,
|
||||
eBlurMaskSamplingChanged = 0x01000000,
|
||||
eBlurMaskAlphaThresholdChanged = 0x02000000,
|
||||
};
|
||||
|
||||
layer_state_t()
|
||||
: what(0),
|
||||
x(0), y(0), z(0), w(0), h(0), layerStack(0), blur(0),
|
||||
blurMaskSampling(0), blurMaskAlphaThreshold(0), alpha(0), flags(0), mask(0),
|
||||
reserved(0)
|
||||
{
|
||||
matrix.dsdx = matrix.dtdy = 1.0f;
|
||||
matrix.dsdy = matrix.dtdx = 0.0f;
|
||||
crop.makeInvalid();
|
||||
}
|
||||
|
||||
status_t write(Parcel& output) const;
|
||||
status_t read(const Parcel& input);
|
||||
|
||||
struct matrix22_t {
|
||||
float dsdx;
|
||||
float dtdx;
|
||||
float dsdy;
|
||||
float dtdy;
|
||||
};
|
||||
sp<IBinder> surface;
|
||||
uint32_t what;
|
||||
float x;
|
||||
float y;
|
||||
uint32_t z;
|
||||
uint32_t w;
|
||||
uint32_t h;
|
||||
uint32_t layerStack;
|
||||
float blur;
|
||||
sp<IBinder> blurMaskSurface;
|
||||
uint32_t blurMaskSampling;
|
||||
float blurMaskAlphaThreshold;
|
||||
float alpha;
|
||||
uint8_t flags;
|
||||
uint8_t mask;
|
||||
uint8_t reserved;
|
||||
matrix22_t matrix;
|
||||
Rect crop;
|
||||
// non POD must be last. see write/read
|
||||
Region transparentRegion;
|
||||
};
|
||||
|
||||
struct ComposerState {
|
||||
sp<ISurfaceComposerClient> client;
|
||||
layer_state_t state;
|
||||
status_t write(Parcel& output) const;
|
||||
status_t read(const Parcel& input);
|
||||
};
|
||||
|
||||
struct DisplayState {
|
||||
|
||||
enum {
|
||||
eOrientationDefault = 0,
|
||||
eOrientation90 = 1,
|
||||
eOrientation180 = 2,
|
||||
eOrientation270 = 3,
|
||||
eOrientationUnchanged = 4,
|
||||
eOrientationSwapMask = 0x01
|
||||
};
|
||||
|
||||
enum {
|
||||
eSurfaceChanged = 0x01,
|
||||
eLayerStackChanged = 0x02,
|
||||
eDisplayProjectionChanged = 0x04,
|
||||
eDisplaySizeChanged = 0x08
|
||||
};
|
||||
|
||||
uint32_t what;
|
||||
sp<IBinder> token;
|
||||
sp<IGraphicBufferProducer> surface;
|
||||
uint32_t layerStack;
|
||||
uint32_t orientation;
|
||||
Rect viewport;
|
||||
Rect frame;
|
||||
uint32_t width, height;
|
||||
status_t write(Parcel& output) const;
|
||||
status_t read(const Parcel& input);
|
||||
};
|
||||
|
||||
}; // namespace android
|
||||
|
||||
#endif // ANDROID_SF_LAYER_STATE_H
|
||||
|
|
@ -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_GUI_SYNC_FEATURES_H
|
||||
#define ANDROID_GUI_SYNC_FEATURES_H
|
||||
|
||||
#include <utils/Singleton.h>
|
||||
#include <utils/String8.h>
|
||||
|
||||
|
||||
namespace android {
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class SyncFeatures : public Singleton<SyncFeatures> {
|
||||
friend class Singleton<SyncFeatures>;
|
||||
bool mHasNativeFenceSync;
|
||||
bool mHasFenceSync;
|
||||
bool mHasWaitSync;
|
||||
String8 mString;
|
||||
SyncFeatures();
|
||||
|
||||
public:
|
||||
bool useNativeFenceSync() const;
|
||||
bool useFenceSync() const;
|
||||
bool useWaitSync() const;
|
||||
String8 toString() const;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
}; // namespace android
|
||||
|
||||
#endif // ANDROID_GUI_SYNC_FEATURES_H
|
|
@ -1,301 +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_PRIVATE_REGION_HELPER_H
|
||||
#define ANDROID_UI_PRIVATE_REGION_HELPER_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
namespace android {
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
template<typename RECT>
|
||||
class region_operator
|
||||
{
|
||||
public:
|
||||
typedef typename RECT::value_type TYPE;
|
||||
static const TYPE max_value = 0x7FFFFFF;
|
||||
|
||||
/*
|
||||
* Common boolean operations:
|
||||
* value is computed as 0b101 op 0b110
|
||||
* other boolean operation are possible, simply compute
|
||||
* their corresponding value with the above formulae and use
|
||||
* it when instantiating a region_operator.
|
||||
*/
|
||||
static const uint32_t LHS = 0x5; // 0b101
|
||||
static const uint32_t RHS = 0x6; // 0b110
|
||||
enum {
|
||||
op_nand = LHS & ~RHS,
|
||||
op_and = LHS & RHS,
|
||||
op_or = LHS | RHS,
|
||||
op_xor = LHS ^ RHS
|
||||
};
|
||||
|
||||
struct region {
|
||||
RECT const* rects;
|
||||
size_t count;
|
||||
TYPE dx;
|
||||
TYPE dy;
|
||||
inline region(const region& rhs)
|
||||
: rects(rhs.rects), count(rhs.count), dx(rhs.dx), dy(rhs.dy) { }
|
||||
inline region(RECT const* r, size_t c)
|
||||
: rects(r), count(c), dx(), dy() { }
|
||||
inline region(RECT const* r, size_t c, TYPE dx, TYPE dy)
|
||||
: rects(r), count(c), dx(dx), dy(dy) { }
|
||||
};
|
||||
|
||||
class region_rasterizer {
|
||||
friend class region_operator;
|
||||
virtual void operator()(const RECT& rect) = 0;
|
||||
public:
|
||||
virtual ~region_rasterizer() { };
|
||||
};
|
||||
|
||||
inline region_operator(int op, const region& lhs, const region& rhs)
|
||||
: op_mask(op), spanner(lhs, rhs)
|
||||
{
|
||||
}
|
||||
|
||||
void operator()(region_rasterizer& rasterizer) {
|
||||
RECT current;
|
||||
do {
|
||||
SpannerInner spannerInner(spanner.lhs, spanner.rhs);
|
||||
int inside = spanner.next(current.top, current.bottom);
|
||||
spannerInner.prepare(inside);
|
||||
do {
|
||||
TYPE left, right;
|
||||
int inside = spannerInner.next(current.left, current.right);
|
||||
if ((op_mask >> inside) & 1) {
|
||||
if (current.left < current.right &&
|
||||
current.top < current.bottom) {
|
||||
rasterizer(current);
|
||||
}
|
||||
}
|
||||
} while(!spannerInner.isDone());
|
||||
} while(!spanner.isDone());
|
||||
}
|
||||
|
||||
private:
|
||||
uint32_t op_mask;
|
||||
|
||||
class SpannerBase
|
||||
{
|
||||
public:
|
||||
SpannerBase()
|
||||
: lhs_head(max_value), lhs_tail(max_value),
|
||||
rhs_head(max_value), rhs_tail(max_value) {
|
||||
}
|
||||
|
||||
enum {
|
||||
lhs_before_rhs = 0,
|
||||
lhs_after_rhs = 1,
|
||||
lhs_coincide_rhs = 2
|
||||
};
|
||||
|
||||
protected:
|
||||
TYPE lhs_head;
|
||||
TYPE lhs_tail;
|
||||
TYPE rhs_head;
|
||||
TYPE rhs_tail;
|
||||
|
||||
inline int next(TYPE& head, TYPE& tail,
|
||||
bool& more_lhs, bool& more_rhs)
|
||||
{
|
||||
int inside;
|
||||
more_lhs = false;
|
||||
more_rhs = false;
|
||||
if (lhs_head < rhs_head) {
|
||||
inside = lhs_before_rhs;
|
||||
head = lhs_head;
|
||||
if (lhs_tail <= rhs_head) {
|
||||
tail = lhs_tail;
|
||||
more_lhs = true;
|
||||
} else {
|
||||
lhs_head = rhs_head;
|
||||
tail = rhs_head;
|
||||
}
|
||||
} else if (rhs_head < lhs_head) {
|
||||
inside = lhs_after_rhs;
|
||||
head = rhs_head;
|
||||
if (rhs_tail <= lhs_head) {
|
||||
tail = rhs_tail;
|
||||
more_rhs = true;
|
||||
} else {
|
||||
rhs_head = lhs_head;
|
||||
tail = lhs_head;
|
||||
}
|
||||
} else {
|
||||
inside = lhs_coincide_rhs;
|
||||
head = lhs_head;
|
||||
if (lhs_tail <= rhs_tail) {
|
||||
tail = rhs_head = lhs_tail;
|
||||
more_lhs = true;
|
||||
}
|
||||
if (rhs_tail <= lhs_tail) {
|
||||
tail = lhs_head = rhs_tail;
|
||||
more_rhs = true;
|
||||
}
|
||||
}
|
||||
return inside;
|
||||
}
|
||||
};
|
||||
|
||||
class Spanner : protected SpannerBase
|
||||
{
|
||||
friend class region_operator;
|
||||
region lhs;
|
||||
region rhs;
|
||||
|
||||
public:
|
||||
inline Spanner(const region& lhs, const region& rhs)
|
||||
: lhs(lhs), rhs(rhs)
|
||||
{
|
||||
if (lhs.count) {
|
||||
SpannerBase::lhs_head = lhs.rects->top + lhs.dy;
|
||||
SpannerBase::lhs_tail = lhs.rects->bottom + lhs.dy;
|
||||
}
|
||||
if (rhs.count) {
|
||||
SpannerBase::rhs_head = rhs.rects->top + rhs.dy;
|
||||
SpannerBase::rhs_tail = rhs.rects->bottom + rhs.dy;
|
||||
}
|
||||
}
|
||||
|
||||
inline bool isDone() const {
|
||||
return !rhs.count && !lhs.count;
|
||||
}
|
||||
|
||||
inline int next(TYPE& top, TYPE& bottom)
|
||||
{
|
||||
bool more_lhs = false;
|
||||
bool more_rhs = false;
|
||||
int inside = SpannerBase::next(top, bottom, more_lhs, more_rhs);
|
||||
if (more_lhs) {
|
||||
advance(lhs, SpannerBase::lhs_head, SpannerBase::lhs_tail);
|
||||
}
|
||||
if (more_rhs) {
|
||||
advance(rhs, SpannerBase::rhs_head, SpannerBase::rhs_tail);
|
||||
}
|
||||
return inside;
|
||||
}
|
||||
|
||||
private:
|
||||
static inline
|
||||
void advance(region& reg, TYPE& aTop, TYPE& aBottom) {
|
||||
// got to next span
|
||||
size_t count = reg.count;
|
||||
RECT const * rects = reg.rects;
|
||||
RECT const * const end = rects + count;
|
||||
const int top = rects->top;
|
||||
while (rects != end && rects->top == top) {
|
||||
rects++;
|
||||
count--;
|
||||
}
|
||||
if (rects != end) {
|
||||
aTop = rects->top + reg.dy;
|
||||
aBottom = rects->bottom + reg.dy;
|
||||
} else {
|
||||
aTop = max_value;
|
||||
aBottom = max_value;
|
||||
}
|
||||
reg.rects = rects;
|
||||
reg.count = count;
|
||||
}
|
||||
};
|
||||
|
||||
class SpannerInner : protected SpannerBase
|
||||
{
|
||||
region lhs;
|
||||
region rhs;
|
||||
|
||||
public:
|
||||
inline SpannerInner(const region& lhs, const region& rhs)
|
||||
: lhs(lhs), rhs(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
inline void prepare(int inside) {
|
||||
if (inside == SpannerBase::lhs_before_rhs) {
|
||||
if (lhs.count) {
|
||||
SpannerBase::lhs_head = lhs.rects->left + lhs.dx;
|
||||
SpannerBase::lhs_tail = lhs.rects->right + lhs.dx;
|
||||
}
|
||||
SpannerBase::rhs_head = max_value;
|
||||
SpannerBase::rhs_tail = max_value;
|
||||
} else if (inside == SpannerBase::lhs_after_rhs) {
|
||||
SpannerBase::lhs_head = max_value;
|
||||
SpannerBase::lhs_tail = max_value;
|
||||
if (rhs.count) {
|
||||
SpannerBase::rhs_head = rhs.rects->left + rhs.dx;
|
||||
SpannerBase::rhs_tail = rhs.rects->right + rhs.dx;
|
||||
}
|
||||
} else {
|
||||
if (lhs.count) {
|
||||
SpannerBase::lhs_head = lhs.rects->left + lhs.dx;
|
||||
SpannerBase::lhs_tail = lhs.rects->right + lhs.dx;
|
||||
}
|
||||
if (rhs.count) {
|
||||
SpannerBase::rhs_head = rhs.rects->left + rhs.dx;
|
||||
SpannerBase::rhs_tail = rhs.rects->right + rhs.dx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline bool isDone() const {
|
||||
return SpannerBase::lhs_head == max_value &&
|
||||
SpannerBase::rhs_head == max_value;
|
||||
}
|
||||
|
||||
inline int next(TYPE& left, TYPE& right)
|
||||
{
|
||||
bool more_lhs = false;
|
||||
bool more_rhs = false;
|
||||
int inside = SpannerBase::next(left, right, more_lhs, more_rhs);
|
||||
if (more_lhs) {
|
||||
advance(lhs, SpannerBase::lhs_head, SpannerBase::lhs_tail);
|
||||
}
|
||||
if (more_rhs) {
|
||||
advance(rhs, SpannerBase::rhs_head, SpannerBase::rhs_tail);
|
||||
}
|
||||
return inside;
|
||||
}
|
||||
|
||||
private:
|
||||
static inline
|
||||
void advance(region& reg, TYPE& left, TYPE& right) {
|
||||
if (reg.rects && reg.count) {
|
||||
const int cur_span_top = reg.rects->top;
|
||||
reg.rects++;
|
||||
reg.count--;
|
||||
if (!reg.count || reg.rects->top != cur_span_top) {
|
||||
left = max_value;
|
||||
right = max_value;
|
||||
} else {
|
||||
left = reg.rects->left + reg.dx;
|
||||
right = reg.rects->right + reg.dx;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Spanner spanner;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
};
|
||||
|
||||
#endif /* ANDROID_UI_PRIVATE_REGION_HELPER_H */
|
Loading…
Reference in New Issue