diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/media/AudioEffect.h | 8 | ||||
-rw-r--r-- | include/media/AudioSystem.h | 5 | ||||
-rw-r--r-- | include/media/IAudioPolicyService.h | 5 | ||||
-rw-r--r-- | include/media/IMediaRecorder.h | 2 | ||||
-rw-r--r-- | include/media/MediaProfiles.h | 46 | ||||
-rw-r--r-- | include/media/MediaRecorderBase.h | 2 | ||||
-rw-r--r-- | include/media/mediarecorder.h | 10 | ||||
-rw-r--r-- | include/media/mediascanner.h | 40 | ||||
-rw-r--r-- | include/media/stagefright/DataSource.h | 5 | ||||
-rw-r--r-- | include/media/stagefright/HardwareAPI.h | 7 | ||||
-rw-r--r-- | include/media/stagefright/MediaSource.h | 2 | ||||
-rw-r--r-- | include/media/stagefright/StagefrightMediaScanner.h | 6 | ||||
-rw-r--r-- | include/media/stagefright/SurfaceMediaSource.h | 350 | ||||
-rw-r--r-- | include/media/stagefright/openmax/OMX_IVCommon.h | 411 |
14 files changed, 672 insertions, 227 deletions
diff --git a/include/media/AudioEffect.h b/include/media/AudioEffect.h index dd93fd8..496b23e 100644 --- a/include/media/AudioEffect.h +++ b/include/media/AudioEffect.h @@ -188,7 +188,7 @@ public: * sessionID: audio session this effect is associated to. If 0, the effect will be global to * the output mix. If not 0, the effect will be applied to all players * (AudioTrack or MediaPLayer) within the same audio session. - * output: HAL audio output stream to which this effect must be attached. Leave at 0 for + * io: HAL audio output or input stream to which this effect must be attached. Leave at 0 for * automatic output selection by AudioFlinger. */ @@ -198,7 +198,7 @@ public: effect_callback_t cbf = 0, void* user = 0, int sessionId = 0, - audio_io_handle_t output = 0 + audio_io_handle_t io = 0 ); /* Constructor. @@ -210,7 +210,7 @@ public: effect_callback_t cbf = 0, void* user = 0, int sessionId = 0, - audio_io_handle_t output = 0 + audio_io_handle_t io = 0 ); /* Terminates the AudioEffect and unregisters it from AudioFlinger. @@ -232,7 +232,7 @@ public: effect_callback_t cbf = 0, void* user = 0, int sessionId = 0, - audio_io_handle_t output = 0 + audio_io_handle_t io = 0 ); /* Result of constructing the AudioEffect. This must be checked diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h index 89213b7..f20e234 100644 --- a/include/media/AudioSystem.h +++ b/include/media/AudioSystem.h @@ -160,7 +160,8 @@ public: uint32_t samplingRate = 0, uint32_t format = AUDIO_FORMAT_DEFAULT, uint32_t channels = AUDIO_CHANNEL_IN_MONO, - audio_in_acoustics_t acoustics = (audio_in_acoustics_t)0); + audio_in_acoustics_t acoustics = (audio_in_acoustics_t)0, + int sessionId = 0); static status_t startInput(audio_io_handle_t input); static status_t stopInput(audio_io_handle_t input); static void releaseInput(audio_io_handle_t input); @@ -175,7 +176,7 @@ public: static audio_io_handle_t getOutputForEffect(effect_descriptor_t *desc); static status_t registerEffect(effect_descriptor_t *desc, - audio_io_handle_t output, + audio_io_handle_t io, uint32_t strategy, int session, int id); diff --git a/include/media/IAudioPolicyService.h b/include/media/IAudioPolicyService.h index 0fc8dbf..86b9f85 100644 --- a/include/media/IAudioPolicyService.h +++ b/include/media/IAudioPolicyService.h @@ -65,7 +65,8 @@ public: uint32_t samplingRate = 0, uint32_t format = AUDIO_FORMAT_DEFAULT, uint32_t channels = 0, - audio_in_acoustics_t acoustics = (audio_in_acoustics_t)0) = 0; + audio_in_acoustics_t acoustics = (audio_in_acoustics_t)0, + int audioSession = 0) = 0; virtual status_t startInput(audio_io_handle_t input) = 0; virtual status_t stopInput(audio_io_handle_t input) = 0; virtual void releaseInput(audio_io_handle_t input) = 0; @@ -78,7 +79,7 @@ public: virtual uint32_t getDevicesForStream(audio_stream_type_t stream) = 0; virtual audio_io_handle_t getOutputForEffect(effect_descriptor_t *desc) = 0; virtual status_t registerEffect(effect_descriptor_t *desc, - audio_io_handle_t output, + audio_io_handle_t io, uint32_t strategy, int session, int id) = 0; diff --git a/include/media/IMediaRecorder.h b/include/media/IMediaRecorder.h index a73267d..007aea6 100644 --- a/include/media/IMediaRecorder.h +++ b/include/media/IMediaRecorder.h @@ -26,6 +26,7 @@ class Surface; class ICamera; class ICameraRecordingProxy; class IMediaRecorderClient; +class ISurfaceTexture; class IMediaRecorder: public IInterface { @@ -55,6 +56,7 @@ public: virtual status_t init() = 0; virtual status_t close() = 0; virtual status_t release() = 0; + virtual sp<ISurfaceTexture> querySurfaceMediaSource() = 0; }; // ---------------------------------------------------------------------------- diff --git a/include/media/MediaProfiles.h b/include/media/MediaProfiles.h index ed26e63..69d5001 100644 --- a/include/media/MediaProfiles.h +++ b/include/media/MediaProfiles.h @@ -45,6 +45,18 @@ enum camcorder_quality { CAMCORDER_QUALITY_TIME_LAPSE_LIST_END = 1006, }; +/** + *Set CIF as default maximum import and export resolution of video editor. + *The maximum import and export resolutions are platform specific, + *which should be defined in media_profiles.xml. + */ +enum videoeditor_capability { + VIDEOEDITOR_DEFAULT_MAX_INPUT_FRAME_WIDTH = 352, + VIDEOEDITOR_DEFUALT_MAX_INPUT_FRAME_HEIGHT = 288, + VIDEOEDITOR_DEFAULT_MAX_OUTPUT_FRAME_WIDTH = 352, + VIDEOEDITOR_DEFUALT_MAX_OUTPUT_FRAME_HEIGHT = 288, +}; + enum video_decoder { VIDEO_DECODER_WMV, }; @@ -117,6 +129,17 @@ public: int getVideoEncoderParamByName(const char *name, video_encoder codec) const; /** + * Returns the value for the given param name for the video editor cap + * param or -1 if error. + * Supported param name are: + * videoeditor.input.width.max - max input video frame width + * videoeditor.input.height.max - max input video frame height + * videoeditor.output.width.max - max output video frame width + * videoeditor.output.height.max - max output video frame height + */ + int getVideoEditorCapParamByName(const char *name) const; + + /** * Returns the audio encoders supported. */ Vector<audio_encoder> getAudioEncoders() const; @@ -164,7 +187,7 @@ private: MediaProfiles& operator=(const MediaProfiles&); // Don't call me MediaProfiles(const MediaProfiles&); // Don't call me - MediaProfiles() {} // Dummy default constructor + MediaProfiles() { mVideoEditorCap = NULL; } // Dummy default constructor ~MediaProfiles(); // Don't delete me struct VideoCodec { @@ -310,6 +333,22 @@ private: Vector<int> mLevels; }; + struct VideoEditorCap { + VideoEditorCap(int inFrameWidth, int inFrameHeight, + int outFrameWidth, int outFrameHeight) + : mMaxInputFrameWidth(inFrameWidth), + mMaxInputFrameHeight(inFrameHeight), + mMaxOutputFrameWidth(outFrameWidth), + mMaxOutputFrameHeight(outFrameHeight) {} + + ~VideoEditorCap() {} + + int mMaxInputFrameWidth; + int mMaxInputFrameHeight; + int mMaxOutputFrameWidth; + int mMaxOutputFrameHeight; + }; + int getCamcorderProfileIndex(int cameraId, camcorder_quality quality) const; void initRequiredProfileRefs(const Vector<int>& cameraIds); int getRequiredProfileRefIndex(int cameraId); @@ -321,6 +360,7 @@ private: static void logAudioEncoderCap(const AudioEncoderCap& cap); static void logVideoDecoderCap(const VideoDecoderCap& cap); static void logAudioDecoderCap(const AudioDecoderCap& cap); + static void logVideoEditorCap(const VideoEditorCap& cap); // If the xml configuration file does exist, use the settings // from the xml @@ -332,6 +372,8 @@ private: static VideoDecoderCap* createVideoDecoderCap(const char **atts); static VideoEncoderCap* createVideoEncoderCap(const char **atts); static AudioEncoderCap* createAudioEncoderCap(const char **atts); + static VideoEditorCap* createVideoEditorCap( + const char **atts, MediaProfiles *profiles); static CamcorderProfile* createCamcorderProfile( int cameraId, const char **atts, Vector<int>& cameraIds); @@ -375,6 +417,7 @@ private: static void createDefaultEncoderOutputFileFormats(MediaProfiles *profiles); static void createDefaultImageEncodingQualityLevels(MediaProfiles *profiles); static void createDefaultImageDecodingMaxMemory(MediaProfiles *profiles); + static void createDefaultVideoEditorCap(MediaProfiles *profiles); static VideoEncoderCap* createDefaultH263VideoEncoderCap(); static VideoEncoderCap* createDefaultM4vVideoEncoderCap(); static AudioEncoderCap* createDefaultAmrNBEncoderCap(); @@ -431,6 +474,7 @@ private: RequiredProfiles *mRequiredProfileRefs; Vector<int> mCameraIds; + VideoEditorCap* mVideoEditorCap; }; }; // namespace android diff --git a/include/media/MediaRecorderBase.h b/include/media/MediaRecorderBase.h index 1c08969..ef799f5 100644 --- a/include/media/MediaRecorderBase.h +++ b/include/media/MediaRecorderBase.h @@ -26,6 +26,7 @@ namespace android { class ICameraRecordingProxy; class Surface; +class ISurfaceTexture; struct MediaRecorderBase { MediaRecorderBase() {} @@ -54,6 +55,7 @@ struct MediaRecorderBase { virtual status_t reset() = 0; virtual status_t getMaxAmplitude(int *max) = 0; virtual status_t dump(int fd, const Vector<String16>& args) const = 0; + virtual sp<ISurfaceTexture> querySurfaceMediaSource() const = 0; private: MediaRecorderBase(const MediaRecorderBase &); diff --git a/include/media/mediarecorder.h b/include/media/mediarecorder.h index af12d3c..72d3736 100644 --- a/include/media/mediarecorder.h +++ b/include/media/mediarecorder.h @@ -31,12 +31,15 @@ class Surface; class IMediaRecorder; class ICamera; class ICameraRecordingProxy; +class ISurfaceTexture; +class SurfaceTextureClient; typedef void (*media_completion_f)(status_t status, void *cookie); enum video_source { VIDEO_SOURCE_DEFAULT = 0, VIDEO_SOURCE_CAMERA = 1, + VIDEO_SOURCE_GRALLOC_BUFFER = 2, VIDEO_SOURCE_LIST_END // must be last - used to validate audio source type }; @@ -226,6 +229,7 @@ public: status_t close(); status_t release(); void notify(int msg, int ext1, int ext2); + sp<ISurfaceTexture> querySurfaceMediaSourceFromMediaServer(); private: void doCleanUp(); @@ -233,6 +237,12 @@ private: sp<IMediaRecorder> mMediaRecorder; sp<MediaRecorderListener> mListener; + + // Reference toISurfaceTexture + // for encoding GL Frames. That is useful only when the + // video source is set to VIDEO_SOURCE_GRALLOC_BUFFER + sp<ISurfaceTexture> mSurfaceMediaSource; + media_recorder_states mCurrentState; bool mIsAudioSourceSet; bool mIsVideoSourceSet; diff --git a/include/media/mediascanner.h b/include/media/mediascanner.h index 765c039..803bffb 100644 --- a/include/media/mediascanner.h +++ b/include/media/mediascanner.h @@ -23,23 +23,33 @@ #include <utils/Errors.h> #include <pthread.h> +struct dirent; + namespace android { class MediaScannerClient; class StringArray; +enum MediaScanResult { + // This file or directory was scanned successfully. + MEDIA_SCAN_RESULT_OK, + // This file or directory was skipped because it was not found, could + // not be opened, was of an unsupported type, or was malfored in some way. + MEDIA_SCAN_RESULT_SKIPPED, + // The scan should be aborted due to a fatal error such as out of memory + // or an exception. + MEDIA_SCAN_RESULT_ERROR, +}; + struct MediaScanner { MediaScanner(); virtual ~MediaScanner(); - virtual status_t processFile( - const char *path, const char *mimeType, - MediaScannerClient &client) = 0; + virtual MediaScanResult processFile( + const char *path, const char *mimeType, MediaScannerClient &client) = 0; - typedef bool (*ExceptionCheck)(void* env); - virtual status_t processDirectory( - const char *path, MediaScannerClient &client, - ExceptionCheck exceptionCheck, void *exceptionEnv); + virtual MediaScanResult processDirectory( + const char *path, MediaScannerClient &client); void setLocale(const char *locale); @@ -53,9 +63,11 @@ private: // current locale (like "ja_JP"), created/destroyed with strdup()/free() char *mLocale; - status_t doProcessDirectory( - char *path, int pathRemaining, MediaScannerClient &client, - bool noMedia, ExceptionCheck exceptionCheck, void *exceptionEnv); + MediaScanResult doProcessDirectory( + char *path, int pathRemaining, MediaScannerClient &client, bool noMedia); + MediaScanResult doProcessDirectoryEntry( + char *path, int pathRemaining, MediaScannerClient &client, bool noMedia, + struct dirent* entry, char* fileSpot); MediaScanner(const MediaScanner &); MediaScanner &operator=(const MediaScanner &); @@ -68,13 +80,13 @@ public: virtual ~MediaScannerClient(); void setLocale(const char* locale); void beginFile(); - bool addStringTag(const char* name, const char* value); + status_t addStringTag(const char* name, const char* value); void endFile(); - virtual bool scanFile(const char* path, long long lastModified, + virtual status_t scanFile(const char* path, long long lastModified, long long fileSize, bool isDirectory, bool noMedia) = 0; - virtual bool handleStringTag(const char* name, const char* value) = 0; - virtual bool setMimeType(const char* mimeType) = 0; + virtual status_t handleStringTag(const char* name, const char* value) = 0; + virtual status_t setMimeType(const char* mimeType) = 0; protected: void convertValues(uint32_t encoding); diff --git a/include/media/stagefright/DataSource.h b/include/media/stagefright/DataSource.h index 48d1464..713af92 100644 --- a/include/media/stagefright/DataSource.h +++ b/include/media/stagefright/DataSource.h @@ -20,6 +20,7 @@ #include <sys/types.h> +#include <media/stagefright/MediaErrors.h> #include <utils/Errors.h> #include <utils/KeyedVector.h> #include <utils/List.h> @@ -61,6 +62,10 @@ public: return 0; } + virtual status_t reconnectAtOffset(off64_t offset) { + return ERROR_UNSUPPORTED; + } + //////////////////////////////////////////////////////////////////////////// bool sniff(String8 *mimeType, float *confidence, sp<AMessage> *meta); diff --git a/include/media/stagefright/HardwareAPI.h b/include/media/stagefright/HardwareAPI.h index 946a0aa..32eed3f 100644 --- a/include/media/stagefright/HardwareAPI.h +++ b/include/media/stagefright/HardwareAPI.h @@ -99,6 +99,13 @@ struct GetAndroidNativeBufferUsageParams { OMX_U32 nUsage; // OUT }; +// An enum OMX_COLOR_FormatAndroidOpaque to indicate an opaque colorformat +// is declared in media/stagefright/openmax/OMX_IVCommon.h +// This will inform the encoder that the actual +// colorformat will be relayed by the GRalloc Buffers. +// OMX_COLOR_FormatAndroidOpaque = 0x7F000001, + + } // namespace android extern android::OMXPluginBase *createOMXPlugin(); diff --git a/include/media/stagefright/MediaSource.h b/include/media/stagefright/MediaSource.h index 37dbcd8..3818e63 100644 --- a/include/media/stagefright/MediaSource.h +++ b/include/media/stagefright/MediaSource.h @@ -29,7 +29,7 @@ namespace android { class MediaBuffer; class MetaData; -struct MediaSource : public RefBase { +struct MediaSource : public virtual RefBase { MediaSource(); // To be called before any other methods on this object, except diff --git a/include/media/stagefright/StagefrightMediaScanner.h b/include/media/stagefright/StagefrightMediaScanner.h index 108acb4..6510a59 100644 --- a/include/media/stagefright/StagefrightMediaScanner.h +++ b/include/media/stagefright/StagefrightMediaScanner.h @@ -26,7 +26,7 @@ struct StagefrightMediaScanner : public MediaScanner { StagefrightMediaScanner(); virtual ~StagefrightMediaScanner(); - virtual status_t processFile( + virtual MediaScanResult processFile( const char *path, const char *mimeType, MediaScannerClient &client); @@ -35,6 +35,10 @@ struct StagefrightMediaScanner : public MediaScanner { private: StagefrightMediaScanner(const StagefrightMediaScanner &); StagefrightMediaScanner &operator=(const StagefrightMediaScanner &); + + MediaScanResult processFileInternal( + const char *path, const char *mimeType, + MediaScannerClient &client); }; } // namespace android diff --git a/include/media/stagefright/SurfaceMediaSource.h b/include/media/stagefright/SurfaceMediaSource.h new file mode 100644 index 0000000..56bd9c3 --- /dev/null +++ b/include/media/stagefright/SurfaceMediaSource.h @@ -0,0 +1,350 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ANDROID_GUI_SURFACEMEDIASOURCE_H +#define ANDROID_GUI_SURFACEMEDIASOURCE_H + +#include <gui/ISurfaceTexture.h> + +#include <utils/threads.h> +#include <utils/Vector.h> +#include <media/stagefright/MediaSource.h> +#include <media/stagefright/MediaBuffer.h> + +namespace android { +// ---------------------------------------------------------------------------- + +class IGraphicBufferAlloc; +class String8; +class GraphicBuffer; + +class SurfaceMediaSource : public BnSurfaceTexture, public MediaSource, + public MediaBufferObserver { +public: + enum { MIN_UNDEQUEUED_BUFFERS = 3 }; + enum { + MIN_ASYNC_BUFFER_SLOTS = MIN_UNDEQUEUED_BUFFERS + 1, + MIN_SYNC_BUFFER_SLOTS = MIN_UNDEQUEUED_BUFFERS + }; + enum { NUM_BUFFER_SLOTS = 32 }; + enum { NO_CONNECTED_API = 0 }; + + struct FrameAvailableListener : public virtual RefBase { + // onFrameAvailable() is called from queueBuffer() is the FIFO is + // empty. You can use SurfaceMediaSource::getQueuedCount() to + // figure out if there are more frames waiting. + // This is called without any lock held can be called concurrently by + // multiple threads. + virtual void onFrameAvailable() = 0; + }; + + SurfaceMediaSource(uint32_t bufW, uint32_t bufH); + + virtual ~SurfaceMediaSource(); + + + // For the MediaSource interface for use by StageFrightRecorder: + virtual status_t start(MetaData *params = NULL); + virtual status_t stop(); + virtual status_t read( + MediaBuffer **buffer, const ReadOptions *options = NULL); + virtual sp<MetaData> getFormat(); + + // Get / Set the frame rate used for encoding. Default fps = 30 + status_t setFrameRate(int32_t fps) ; + int32_t getFrameRate( ) const; + + // The call for the StageFrightRecorder to tell us that + // it is done using the MediaBuffer data so that its state + // can be set to FREE for dequeuing + virtual void signalBufferReturned(MediaBuffer* buffer); + // end of MediaSource interface + + uint32_t getBufferCount( ) const { return mBufferCount;} + + + // setBufferCount updates the number of available buffer slots. After + // calling this all buffer slots are both unallocated and owned by the + // SurfaceMediaSource object (i.e. they are not owned by the client). + virtual status_t setBufferCount(int bufferCount); + + virtual status_t requestBuffer(int slot, sp<GraphicBuffer>* buf); + + // dequeueBuffer gets the next buffer slot index for the client to use. If a + // buffer slot is available then that slot index is written to the location + // pointed to by the buf argument and a status of OK is returned. If no + // slot is available then a status of -EBUSY is returned and buf is + // unmodified. + virtual status_t dequeueBuffer(int *buf, uint32_t w, uint32_t h, + uint32_t format, uint32_t usage); + + // queueBuffer returns a filled buffer to the SurfaceMediaSource. In addition, a + // timestamp must be provided for the buffer. The timestamp is in + // nanoseconds, and must be monotonically increasing. Its other semantics + // (zero point, etc) are client-dependent and should be documented by the + // client. + virtual status_t queueBuffer(int buf, int64_t timestamp, + uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform); + virtual void cancelBuffer(int buf); + + // onFrameReceivedLocked informs the buffer consumers (StageFrightRecorder) + // or listeners that a frame has been received + // The buffer is not made available for dequeueing immediately. We need to + // wait to hear from StageFrightRecorder to set the buffer FREE + // Make sure this is called when the mutex is locked + virtual status_t onFrameReceivedLocked(); + + virtual status_t setScalingMode(int mode) { } // no op for encoding + virtual int query(int what, int* value); + + // Just confirming to the ISurfaceTexture interface as of now + virtual status_t setCrop(const Rect& reg) { return OK; } + virtual status_t setTransform(uint32_t transform) {return OK;} + + // setSynchronousMode set whether dequeueBuffer is synchronous or + // asynchronous. In synchronous mode, dequeueBuffer blocks until + // a buffer is available, the currently bound buffer can be dequeued and + // queued buffers will be retired in order. + // The default mode is synchronous. + // TODO: Clarify the minute differences bet sycn /async + // modes (S.Encoder vis-a-vis SurfaceTexture) + virtual status_t setSynchronousMode(bool enabled); + + // connect attempts to connect a client API to the SurfaceMediaSource. This + // must be called before any other ISurfaceTexture methods are called except + // for getAllocator. + // + // This method will fail if the connect was previously called on the + // SurfaceMediaSource and no corresponding disconnect call was made. + virtual status_t connect(int api); + + // disconnect attempts to disconnect a client API from the SurfaceMediaSource. + // Calling this method will cause any subsequent calls to other + // ISurfaceTexture methods to fail except for getAllocator and connect. + // Successfully calling connect after this will allow the other methods to + // succeed again. + // + // This method will fail if the the SurfaceMediaSource is not currently + // connected to the specified client API. + virtual status_t disconnect(int api); + + // getqueuedCount returns the number of queued frames waiting in the + // FIFO. In asynchronous mode, this always returns 0 or 1 since + // frames are not accumulating in the FIFO. + size_t getQueuedCount() const; + + // setBufferCountServer set the buffer count. If the client has requested + // a buffer count using setBufferCount, the server-buffer count will + // take effect once the client sets the count back to zero. + status_t setBufferCountServer(int bufferCount); + + // getTimestamp retrieves the timestamp associated with the image + // set by the most recent call to updateFrameInfoLocked(). + // + // The timestamp is in nanoseconds, and is monotonically increasing. Its + // other semantics (zero point, etc) are source-dependent and should be + // documented by the source. + int64_t getTimestamp(); + + // setFrameAvailableListener sets the listener object that will be notified + // when a new frame becomes available. + void setFrameAvailableListener(const sp<FrameAvailableListener>& listener); + + // getCurrentBuffer returns the buffer associated with the current image. + sp<GraphicBuffer> getCurrentBuffer() const; + + // dump our state in a String + void dump(String8& result) const; + void dump(String8& result, const char* prefix, char* buffer, + size_t SIZE) const; + + // isMetaDataStoredInVideoBuffers tells the encoder whether we will + // pass metadata through the buffers. Currently, it is force set to true + bool isMetaDataStoredInVideoBuffers() const; + +protected: + + // freeAllBuffers frees the resources (both GraphicBuffer and EGLImage) for + // all slots. + void freeAllBuffers(); + static bool isExternalFormat(uint32_t format); + +private: + + status_t setBufferCountServerLocked(int bufferCount); + + enum { INVALID_BUFFER_SLOT = -1 }; + + struct BufferSlot { + + BufferSlot() + : mBufferState(BufferSlot::FREE), + mRequestBufferCalled(false), + mTimestamp(0) { + } + + // mGraphicBuffer points to the buffer allocated for this slot or is + // NULL if no buffer has been allocated. + sp<GraphicBuffer> mGraphicBuffer; + + // BufferState represents the different states in which a buffer slot + // can be. + enum BufferState { + // FREE indicates that the buffer is not currently being used and + // will not be used in the future until it gets dequeued and + // subseqently queued by the client. + FREE = 0, + + // DEQUEUED indicates that the buffer has been dequeued by the + // client, but has not yet been queued or canceled. The buffer is + // considered 'owned' by the client, and the server should not use + // it for anything. + // + // Note that when in synchronous-mode (mSynchronousMode == true), + // the buffer that's currently attached to the texture may be + // dequeued by the client. That means that the current buffer can + // be in either the DEQUEUED or QUEUED state. In asynchronous mode, + // however, the current buffer is always in the QUEUED state. + DEQUEUED = 1, + + // QUEUED indicates that the buffer has been queued by the client, + // and has not since been made available for the client to dequeue. + // Attaching the buffer to the texture does NOT transition the + // buffer away from the QUEUED state. However, in Synchronous mode + // the current buffer may be dequeued by the client under some + // circumstances. See the note about the current buffer in the + // documentation for DEQUEUED. + QUEUED = 2, + }; + + // mBufferState is the current state of this buffer slot. + BufferState mBufferState; + + // mRequestBufferCalled is used for validating that the client did + // call requestBuffer() when told to do so. Technically this is not + // needed but useful for debugging and catching client bugs. + bool mRequestBufferCalled; + + // mTimestamp is the current timestamp for this buffer slot. This gets + // to set by queueBuffer each time this slot is queued. + int64_t mTimestamp; + }; + + // mSlots is the array of buffer slots that must be mirrored on the client + // side. This allows buffer ownership to be transferred between the client + // and server without sending a GraphicBuffer over binder. The entire array + // is initialized to NULL at construction time, and buffers are allocated + // for a slot when requestBuffer is called with that slot's index. + BufferSlot mSlots[NUM_BUFFER_SLOTS]; + + // mDefaultWidth holds the default width of allocated buffers. It is used + // in requestBuffers() if a width and height of zero is specified. + uint32_t mDefaultWidth; + + // mDefaultHeight holds the default height of allocated buffers. It is used + // in requestBuffers() if a width and height of zero is specified. + uint32_t mDefaultHeight; + + // mPixelFormat holds the pixel format of allocated buffers. It is used + // in requestBuffers() if a format of zero is specified. + uint32_t mPixelFormat; + + // mBufferCount is the number of buffer slots that the client and server + // must maintain. It defaults to MIN_ASYNC_BUFFER_SLOTS and can be changed + // by calling setBufferCount or setBufferCountServer + int mBufferCount; + + // mClientBufferCount is the number of buffer slots requested by the + // client. The default is zero, which means the client doesn't care how + // many buffers there are + int mClientBufferCount; + + // mServerBufferCount buffer count requested by the server-side + int mServerBufferCount; + + // mCurrentSlot is the buffer slot index of the buffer that is currently + // being used by buffer consumer + // (e.g. StageFrightRecorder in the case of SurfaceMediaSource or GLTexture + // in the case of SurfaceTexture). + // It is initialized to INVALID_BUFFER_SLOT, + // indicating that no buffer slot is currently bound to the texture. Note, + // however, that a value of INVALID_BUFFER_SLOT does not necessarily mean + // that no buffer is bound to the texture. A call to setBufferCount will + // reset mCurrentTexture to INVALID_BUFFER_SLOT. + int mCurrentSlot; + + + // mCurrentBuf is the graphic buffer of the current slot to be used by + // buffer consumer. It's possible that this buffer is not associated + // with any buffer slot, so we must track it separately in order to + // properly use IGraphicBufferAlloc::freeAllGraphicBuffersExcept. + sp<GraphicBuffer> mCurrentBuf; + + + // mCurrentTimestamp is the timestamp for the current texture. It + // gets set to mLastQueuedTimestamp each time updateTexImage is called. + int64_t mCurrentTimestamp; + + // mGraphicBufferAlloc is the connection to SurfaceFlinger that is used to + // allocate new GraphicBuffer objects. + sp<IGraphicBufferAlloc> mGraphicBufferAlloc; + + // mFrameAvailableListener is the listener object that will be called when a + // new frame becomes available. If it is not NULL it will be called from + // queueBuffer. + sp<FrameAvailableListener> mFrameAvailableListener; + + // mSynchronousMode whether we're in synchronous mode or not + bool mSynchronousMode; + + // mConnectedApi indicates the API that is currently connected to this + // SurfaceTexture. It defaults to NO_CONNECTED_API (= 0), and gets updated + // by the connect and disconnect methods. + int mConnectedApi; + + // mDequeueCondition condition used for dequeueBuffer in synchronous mode + mutable Condition mDequeueCondition; + + + // mQueue is a FIFO of queued buffers used in synchronous mode + typedef Vector<int> Fifo; + Fifo mQueue; + + // mMutex is the mutex used to prevent concurrent access to the member + // variables of SurfaceMediaSource objects. It must be locked whenever the + // member variables are accessed. + mutable Mutex mMutex; + + ////////////////////////// For MediaSource + // Set to a default of 30 fps if not specified by the client side + int32_t mFrameRate; + + // mStarted is a flag to check if the recording has started + bool mStarted; + + // mFrameAvailableCondition condition used to indicate whether there + // is a frame available for dequeuing + Condition mFrameAvailableCondition; + Condition mFrameCompleteCondition; + + // Avoid copying and equating and default constructor + DISALLOW_IMPLICIT_CONSTRUCTORS(SurfaceMediaSource); +}; + +// ---------------------------------------------------------------------------- +}; // namespace android + +#endif // ANDROID_GUI_SURFACEMEDIASOURCE_H diff --git a/include/media/stagefright/openmax/OMX_IVCommon.h b/include/media/stagefright/openmax/OMX_IVCommon.h index 7ed072b..97170d7 100644 --- a/include/media/stagefright/openmax/OMX_IVCommon.h +++ b/include/media/stagefright/openmax/OMX_IVCommon.h @@ -16,29 +16,29 @@ * ------------------------------------------------------------------- */ /** - * Copyright (c) 2008 The Khronos Group Inc. - * + * 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: + * to the following conditions: * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * + * 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. + * 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. @@ -53,7 +53,7 @@ extern "C" { /** * 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 + * file to compile successfully */ #include <OMX_Core.h> @@ -64,8 +64,8 @@ extern "C" { */ -/** - * Enumeration defining possible uncompressed image/video formats. +/** + * Enumeration defining possible uncompressed image/video formats. * * ENUMS: * Unused : Placeholder value when format is N/A @@ -113,7 +113,7 @@ typedef enum OMX_COLOR_FORMATTYPE { OMX_COLOR_Format16bitBGR565, OMX_COLOR_Format18bitRGB666, OMX_COLOR_Format18bitARGB1665, - OMX_COLOR_Format19bitARGB1666, + OMX_COLOR_Format19bitARGB1666, OMX_COLOR_Format24bitRGB888, OMX_COLOR_Format24bitBGR888, OMX_COLOR_Format24bitARGB1887, @@ -136,55 +136,62 @@ typedef enum OMX_COLOR_FORMATTYPE { 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_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_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 = 0x7F000001, OMX_TI_COLOR_FormatYUV420PackedSemiPlanar = 0x7F000100, OMX_QCOM_COLOR_FormatYVU420SemiPlanar = 0x7FA30C00, 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 + * 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_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: +/** + * 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_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 +/** + * Enumeration of possible image filter types */ typedef enum OMX_IMAGEFILTERTYPE { OMX_ImageFilterNone, @@ -195,23 +202,23 @@ typedef enum OMX_IMAGEFILTERTYPE { OMX_ImageFilterOilPaint, OMX_ImageFilterHatch, OMX_ImageFilterGpen, - OMX_ImageFilterAntialias, - OMX_ImageFilterDeRing, + OMX_ImageFilterAntialias, + OMX_ImageFilterDeRing, OMX_ImageFilterSolarize, - OMX_ImageFilterKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + 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 +/** + * Image filter configuration * * STRUCT MEMBERS: - * nSize : Size of the structure in bytes + * nSize : Size of the structure in bytes * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eImageFilter : Image filter type enumeration + * nPortIndex : Port that this structure applies to + * eImageFilter : Image filter type enumeration */ typedef struct OMX_CONFIG_IMAGEFILTERTYPE { OMX_U32 nSize; @@ -221,22 +228,22 @@ typedef struct OMX_CONFIG_IMAGEFILTERTYPE { } OMX_CONFIG_IMAGEFILTERTYPE; -/** - * Customized U and V for color enhancement +/** + * Customized U and V for color enhancement * * STRUCT MEMBERS: * nSize : Size of the structure in bytes - * nVersion : OMX specification version information + * 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 + * nCustomizedU : Practical values: 16-240, range: 0-255, value set for * U component - * nCustomizedV : Practical values: 16-240, range: 0-255, value set for + * 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_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bColorEnhancement; OMX_U8 nCustomizedU; @@ -244,12 +251,12 @@ typedef struct OMX_CONFIG_COLORENHANCEMENTTYPE { } OMX_CONFIG_COLORENHANCEMENTTYPE; -/** - * Define color key and color key mask +/** + * Define color key and color key mask * * STRUCT MEMBERS: * nSize : Size of the structure in bytes - * nVersion : OMX specification version information + * 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 @@ -263,12 +270,12 @@ typedef struct OMX_CONFIG_COLORKEYTYPE { } OMX_CONFIG_COLORKEYTYPE; -/** - * List of color blend types for pre/post processing +/** + * List of color blend types for pre/post processing * * ENUMS: * None : No color blending present - * AlphaConstant : Function is (alpha_constant * src) + + * 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 @@ -284,21 +291,21 @@ typedef enum OMX_COLORBLENDTYPE { OMX_ColorBlendAnd, OMX_ColorBlendOr, OMX_ColorBlendInvert, - OMX_ColorBlendKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + 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 +/** + * Color blend configuration * * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to + * 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 + * eColorBlend : Color blend type enumeration */ typedef struct OMX_CONFIG_COLORBLENDTYPE { OMX_U32 nSize; @@ -309,15 +316,15 @@ typedef struct OMX_CONFIG_COLORBLENDTYPE { } OMX_CONFIG_COLORBLENDTYPE; -/** +/** * Hold frame dimension * * STRUCT MEMBERS: - * nSize : Size of the structure in bytes + * 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 + * nPortIndex : Port that this structure applies to + * nWidth : Frame width in pixels + * nHeight : Frame height in pixels */ typedef struct OMX_FRAMESIZETYPE { OMX_U32 nSize; @@ -329,69 +336,69 @@ typedef struct OMX_FRAMESIZETYPE { /** - * Rotation configuration + * Rotation configuration * * STRUCT MEMBERS: - * nSize : Size of the structure in bytes + * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to - * nRotation : +/- integer rotation value + * nRotation : +/- integer rotation value */ typedef struct OMX_CONFIG_ROTATIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; - OMX_S32 nRotation; + OMX_S32 nRotation; } OMX_CONFIG_ROTATIONTYPE; -/** - * Possible mirroring directions for pre/post processing +/** + * 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 + * 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_MirrorBoth, + OMX_MirrorKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_MirrorVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ - OMX_MirrorMax = 0x7FFFFFFF + OMX_MirrorMax = 0x7FFFFFFF } OMX_MIRRORTYPE; -/** - * Mirroring configuration +/** + * Mirroring configuration * * STRUCT MEMBERS: - * nSize : Size of the structure in bytes + * nSize : Size of the structure in bytes * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eMirror : Mirror type enumeration + * nPortIndex : Port that this structure applies to + * eMirror : Mirror type enumeration */ typedef struct OMX_CONFIG_MIRRORTYPE { OMX_U32 nSize; - OMX_VERSIONTYPE nVersion; + OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_MIRRORTYPE eMirror; } OMX_CONFIG_MIRRORTYPE; -/** - * Position information only +/** + * Position information only * * STRUCT MEMBERS: - * nSize : Size of the structure in bytes + * 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 - */ + * nX : X coordinate for the point + * nY : Y coordinate for the point + */ typedef struct OMX_CONFIG_POINTTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; @@ -401,37 +408,37 @@ typedef struct OMX_CONFIG_POINTTYPE { } OMX_CONFIG_POINTTYPE; -/** - * Frame size plus position +/** + * 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 + * 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 + * 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_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 +/** + * 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 + * nSize : Size of the structure in bytes + * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to - * bDeblocking : Enable/disable deblocking mode + * bDeblocking : Enable/disable deblocking mode */ typedef struct OMX_PARAM_DEBLOCKINGTYPE { OMX_U32 nSize; @@ -441,13 +448,13 @@ typedef struct OMX_PARAM_DEBLOCKINGTYPE { } OMX_PARAM_DEBLOCKINGTYPE; -/** - * Stabilization state +/** + * Stabilization state * * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to + * 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 { @@ -458,8 +465,8 @@ typedef struct OMX_CONFIG_FRAMESTABTYPE { } OMX_CONFIG_FRAMESTABTYPE; -/** - * White Balance control type +/** + * White Balance control type * * STRUCT MEMBERS: * SunLight : Referenced in JSR-234 @@ -476,20 +483,20 @@ typedef enum OMX_WHITEBALCONTROLTYPE { OMX_WhiteBalControlIncandescent, OMX_WhiteBalControlFlash, OMX_WhiteBalControlHorizon, - OMX_WhiteBalControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + 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 +/** + * White Balance control configuration * * STRUCT MEMBERS: - * nSize : Size of the structure in bytes + * nSize : Size of the structure in bytes * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eWhiteBalControl : White balance enumeration + * nPortIndex : Port that this structure applies to + * eWhiteBalControl : White balance enumeration */ typedef struct OMX_CONFIG_WHITEBALCONTROLTYPE { OMX_U32 nSize; @@ -499,8 +506,8 @@ typedef struct OMX_CONFIG_WHITEBALCONTROLTYPE { } OMX_CONFIG_WHITEBALCONTROLTYPE; -/** - * Exposure control type +/** + * Exposure control type */ typedef enum OMX_EXPOSURECONTROLTYPE { OMX_ExposureControlOff = 0, @@ -513,20 +520,20 @@ typedef enum OMX_EXPOSURECONTROLTYPE { OMX_ExposureControlBeach, OMX_ExposureControlLargeAperture, OMX_ExposureControlSmallApperture, - OMX_ExposureControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + 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 +/** + * White Balance control configuration * * STRUCT MEMBERS: - * nSize : Size of the structure in bytes + * nSize : Size of the structure in bytes * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to - * eExposureControl : Exposure control enumeration + * nPortIndex : Port that this structure applies to + * eExposureControl : Exposure control enumeration */ typedef struct OMX_CONFIG_EXPOSURECONTROLTYPE { OMX_U32 nSize; @@ -536,16 +543,16 @@ typedef struct OMX_CONFIG_EXPOSURECONTROLTYPE { } OMX_CONFIG_EXPOSURECONTROLTYPE; -/** - * Defines sensor supported mode. +/** + * Defines sensor supported mode. * * STRUCT MEMBERS: - * nSize : Size of the structure in bytes + * 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 + * 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 + * sFrameSize : Framesize */ typedef struct OMX_PARAM_SENSORMODETYPE { OMX_U32 nSize; @@ -557,13 +564,13 @@ typedef struct OMX_PARAM_SENSORMODETYPE { } OMX_PARAM_SENSORMODETYPE; -/** - * Defines contrast level +/** + * Defines contrast level * * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information - * nPortIndex : Port that this structure applies to + * 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 { @@ -574,14 +581,14 @@ typedef struct OMX_CONFIG_CONTRASTTYPE { } OMX_CONFIG_CONTRASTTYPE; -/** - * Defines brightness level +/** + * 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% + * 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; @@ -591,16 +598,16 @@ typedef struct OMX_CONFIG_BRIGHTNESSTYPE { } OMX_CONFIG_BRIGHTNESSTYPE; -/** - * Defines backlight level configuration for a video sink, e.g. LCD panel +/** + * 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 + * 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 + * nTimeout : Number of milliseconds before backlight automatically turns + * off. A value of 0x0 disables backight timeout */ typedef struct OMX_CONFIG_BACKLIGHTTYPE { OMX_U32 nSize; @@ -611,12 +618,12 @@ typedef struct OMX_CONFIG_BACKLIGHTTYPE { } OMX_CONFIG_BACKLIGHTTYPE; -/** - * Defines setting for Gamma +/** + * Defines setting for Gamma * * STRUCT MEMBERS: * nSize : Size of the structure in bytes - * nVersion : OMX specification version information + * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nGamma : Values allowed for gamma -100 to 100, zero means no change */ @@ -628,14 +635,14 @@ typedef struct OMX_CONFIG_GAMMATYPE { } OMX_CONFIG_GAMMATYPE; -/** - * Define for setting saturation - * +/** + * 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 + * nSaturation : Values allowed for saturation -100 to 100, zero means * no change */ typedef struct OMX_CONFIG_SATURATIONTYPE { @@ -646,14 +653,14 @@ typedef struct OMX_CONFIG_SATURATIONTYPE { } OMX_CONFIG_SATURATIONTYPE; -/** - * Define for setting Lightness +/** + * 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 + * nLightness : Values allowed for lightness -100 to 100, zero means no * change */ typedef struct OMX_CONFIG_LIGHTNESSTYPE { @@ -664,17 +671,17 @@ typedef struct OMX_CONFIG_LIGHTNESSTYPE { } OMX_CONFIG_LIGHTNESSTYPE; -/** - * Plane blend configuration +/** + * Plane blend configuration * * STRUCT MEMBERS: - * nSize : Size of the structure in bytes + * 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. + * 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. + * nAlpha : Transparency blending component for the entire plane. * See blending modes for more detail. */ typedef struct OMX_CONFIG_PLANEBLENDTYPE { @@ -686,17 +693,17 @@ typedef struct OMX_CONFIG_PLANEBLENDTYPE { } OMX_CONFIG_PLANEBLENDTYPE; -/** +/** * Define interlace type * * STRUCT MEMBERS: - * nSize : Size of the structure in bytes - * nVersion : OMX specification version information + * 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 + * bEnable : Enable control variable for this functionality * (see below) - * nInterleavePortIndex : Index of input or output port associated with - * the interleaved plane. + * 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 { @@ -708,8 +715,8 @@ typedef struct OMX_PARAM_INTERLEAVETYPE { } OMX_PARAM_INTERLEAVETYPE; -/** - * Defines the picture effect used for an input picture +/** + * Defines the picture effect used for an input picture */ typedef enum OMX_TRANSITIONEFFECTTYPE { OMX_EffectNone, @@ -719,18 +726,18 @@ typedef enum OMX_TRANSITIONEFFECTTYPE { OMX_EffectDissolve, OMX_EffectWipe, OMX_EffectUnspecifiedMixOfTwoScenes, - OMX_EffectKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + 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 +/** + * Structure used to configure current transition effect * * STRUCT MEMBERS: * nSize : Size of the structure in bytes - * nVersion : OMX specification version information + * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eEffect : Effect to enable */ @@ -742,43 +749,43 @@ typedef struct OMX_CONFIG_TRANSITIONEFFECTTYPE { } OMX_CONFIG_TRANSITIONEFFECTTYPE; -/** - * Defines possible data unit types for encoded video data. The data unit +/** + * 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. + * 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_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. +/** + * 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_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 +/** + * 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_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port that this structure applies to */ OMX_DATAUNITTYPE eUnitType; OMX_DATAUNITENCAPSULATIONTYPE eEncapsulationType; @@ -786,25 +793,25 @@ typedef struct OMX_PARAM_DATAUNITTYPE { /** - * Defines dither types + * 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_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 +/** + * 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_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; @@ -813,28 +820,28 @@ 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 + 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 + 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_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; @@ -843,14 +850,14 @@ typedef struct OMX_CONFIG_EXPOSUREVALUETYPE { 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 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 +/** + * Focus region configuration * * STRUCT MEMBERS: * nSize : Size of the structure in bytes @@ -881,8 +888,8 @@ typedef struct OMX_CONFIG_FOCUSREGIONTYPE { OMX_BOOL bBottomRight; } OMX_CONFIG_FOCUSREGIONTYPE; -/** - * Focus Status type +/** + * Focus Status type */ typedef enum OMX_FOCUSSTATUSTYPE { OMX_FocusStatusOff = 0, @@ -890,13 +897,13 @@ typedef enum OMX_FOCUSSTATUSTYPE { OMX_FocusStatusReached, OMX_FocusStatusUnableToReach, OMX_FocusStatusLost, - OMX_FocusStatusKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ + 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 +/** + * Focus status configuration * * STRUCT MEMBERS: * nSize : Size of the structure in bytes |