diff options
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/AudioSystem.h | 11 | ||||
-rw-r--r-- | include/media/IMediaMetadataRetriever.h | 9 | ||||
-rw-r--r-- | include/media/IMediaPlayer.h | 1 | ||||
-rw-r--r-- | include/media/IMediaPlayerClient.h | 2 | ||||
-rw-r--r-- | include/media/IOMX.h | 1 | ||||
-rw-r--r-- | include/media/MediaMetadataRetrieverInterface.h | 6 | ||||
-rw-r--r-- | include/media/MediaPlayerInterface.h | 9 | ||||
-rw-r--r-- | include/media/MemoryLeakTrackUtil.h | 28 | ||||
-rw-r--r-- | include/media/mediametadataretriever.h | 12 | ||||
-rw-r--r-- | include/media/mediaplayer.h | 5 | ||||
-rw-r--r-- | include/media/mediarecorder.h | 63 | ||||
-rw-r--r-- | include/media/mediascanner.h | 5 | ||||
-rw-r--r-- | include/media/stagefright/AudioPlayer.h | 2 | ||||
-rw-r--r-- | include/media/stagefright/CameraSource.h | 28 | ||||
-rw-r--r-- | include/media/stagefright/DataSource.h | 6 | ||||
-rw-r--r-- | include/media/stagefright/FileSource.h | 6 | ||||
-rw-r--r-- | include/media/stagefright/MPEG4Writer.h | 2 | ||||
-rw-r--r-- | include/media/stagefright/MediaDefs.h | 1 |
18 files changed, 128 insertions, 69 deletions
diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h index 2dc4beb..edf4b8b 100644 --- a/include/media/AudioSystem.h +++ b/include/media/AudioSystem.h @@ -33,6 +33,7 @@ class AudioSystem { public: + // must match android/media/AudioSystem.java STREAM_* constants enum stream_type { DEFAULT =-1, VOICE_CALL = 0, @@ -54,6 +55,8 @@ public: PCM_SUB_8_BIT = 0x2, // must be 2 for backward compatibility }; + // FIXME These sub_format enums are currently unused + // MP3 sub format field definition : can use 11 LSBs in the same way as MP3 frame header to specify // bit rate, stereo mode, version... enum mp3_sub_format { @@ -100,7 +103,7 @@ public: }; - // Channel mask definitions must be kept in sync with JAVA values in /media/java/android/media/AudioFormat.java + // Channel mask definitions must be kept in sync with values in /media/java/android/media/AudioFormat.java enum audio_channels { // output channels CHANNEL_OUT_FRONT_LEFT = 0x4, @@ -150,6 +153,7 @@ public: CHANNEL_IN_VOICE_UPLINK | CHANNEL_IN_VOICE_DNLINK) }; + // must match android/media/AudioSystem.java MODE_* values enum audio_mode { MODE_INVALID = -2, MODE_CURRENT = -1, @@ -189,6 +193,7 @@ public: // set/get master volume static status_t setMasterVolume(float value); static status_t getMasterVolume(float* volume); + // mute/unmute audio outputs static status_t setMasterMute(bool mute); static status_t getMasterMute(bool* mute); @@ -234,7 +239,7 @@ public: static status_t setVoiceVolume(float volume); // return the number of audio frames written by AudioFlinger to audio HAL and - // audio dsp to DAC since the output on which the specificed stream is playing + // audio dsp to DAC since the output on which the specified stream is playing // has exited standby. // returned status (from utils/Errors.h) can be: // - NO_ERROR: successful operation, halFrames and dspFrames point to valid data @@ -321,7 +326,7 @@ public: FORCE_DEFAULT = FORCE_NONE }; - // usages used for setForceUse() + // usages used for setForceUse(), must match AudioSystem.java enum force_use { FOR_COMMUNICATION, FOR_MEDIA, diff --git a/include/media/IMediaMetadataRetriever.h b/include/media/IMediaMetadataRetriever.h index 8e3cdbb..1c1c268 100644 --- a/include/media/IMediaMetadataRetriever.h +++ b/include/media/IMediaMetadataRetriever.h @@ -18,10 +18,11 @@ #ifndef ANDROID_IMEDIAMETADATARETRIEVER_H #define ANDROID_IMEDIAMETADATARETRIEVER_H -#include <utils/RefBase.h> #include <binder/IInterface.h> #include <binder/Parcel.h> #include <binder/IMemory.h> +#include <utils/KeyedVector.h> +#include <utils/RefBase.h> namespace android { @@ -30,7 +31,11 @@ class IMediaMetadataRetriever: public IInterface public: DECLARE_META_INTERFACE(MediaMetadataRetriever); virtual void disconnect() = 0; - virtual status_t setDataSource(const char* srcUrl) = 0; + + virtual status_t setDataSource( + const char *srcUrl, + const KeyedVector<String8, String8> *headers = NULL) = 0; + virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; virtual sp<IMemory> getFrameAtTime(int64_t timeUs, int option) = 0; virtual sp<IMemory> extractAlbumArt() = 0; diff --git a/include/media/IMediaPlayer.h b/include/media/IMediaPlayer.h index 70519ef..9b1af6b 100644 --- a/include/media/IMediaPlayer.h +++ b/include/media/IMediaPlayer.h @@ -24,7 +24,6 @@ namespace android { class Parcel; -class ISurface; class Surface; class ISurfaceTexture; diff --git a/include/media/IMediaPlayerClient.h b/include/media/IMediaPlayerClient.h index eee6c97..daec1c7 100644 --- a/include/media/IMediaPlayerClient.h +++ b/include/media/IMediaPlayerClient.h @@ -28,7 +28,7 @@ class IMediaPlayerClient: public IInterface public: DECLARE_META_INTERFACE(MediaPlayerClient); - virtual void notify(int msg, int ext1, int ext2) = 0; + virtual void notify(int msg, int ext1, int ext2, const Parcel *obj) = 0; }; // ---------------------------------------------------------------------------- diff --git a/include/media/IOMX.h b/include/media/IOMX.h index 16a9342..3c65147 100644 --- a/include/media/IOMX.h +++ b/include/media/IOMX.h @@ -33,7 +33,6 @@ namespace android { class IMemory; class IOMXObserver; class IOMXRenderer; -class ISurface; class Surface; class IOMX : public IInterface { diff --git a/include/media/MediaMetadataRetrieverInterface.h b/include/media/MediaMetadataRetrieverInterface.h index 0449122..27b7e4d 100644 --- a/include/media/MediaMetadataRetrieverInterface.h +++ b/include/media/MediaMetadataRetrieverInterface.h @@ -30,7 +30,11 @@ class MediaMetadataRetrieverBase : public RefBase public: MediaMetadataRetrieverBase() {} virtual ~MediaMetadataRetrieverBase() {} - virtual status_t setDataSource(const char *url) = 0; + + virtual status_t setDataSource( + const char *url, + const KeyedVector<String8, String8> *headers = NULL) = 0; + virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; virtual VideoFrame* getFrameAtTime(int64_t timeUs, int option) = 0; virtual MediaAlbumArt* extractAlbumArt() = 0; diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h index 117d7eb..e1b6dd6 100644 --- a/include/media/MediaPlayerInterface.h +++ b/include/media/MediaPlayerInterface.h @@ -32,7 +32,6 @@ namespace android { class Parcel; -class ISurface; class Surface; class ISurfaceTexture; @@ -56,7 +55,8 @@ enum player_type { // callback mechanism for passing messages to MediaPlayer object -typedef void (*notify_callback_f)(void* cookie, int msg, int ext1, int ext2); +typedef void (*notify_callback_f)(void* cookie, + int msg, int ext1, int ext2, const Parcel *obj); // abstract base class - use MediaPlayerInterface class MediaPlayerBase : public RefBase @@ -160,9 +160,10 @@ public: mCookie = cookie; mNotify = notifyFunc; } - void sendEvent(int msg, int ext1=0, int ext2=0) { + void sendEvent(int msg, int ext1=0, int ext2=0, + const Parcel *obj=NULL) { Mutex::Autolock autoLock(mNotifyLock); - if (mNotify) mNotify(mCookie, msg, ext1, ext2); + if (mNotify) mNotify(mCookie, msg, ext1, ext2, obj); } private: diff --git a/include/media/MemoryLeakTrackUtil.h b/include/media/MemoryLeakTrackUtil.h new file mode 100644 index 0000000..290b748 --- /dev/null +++ b/include/media/MemoryLeakTrackUtil.h @@ -0,0 +1,28 @@ + +/* + * Copyright 2011, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef MEMORY_LEAK_TRACK_UTIL_H +#define MEMORY_LEAK_TRACK_UTIL_H + +namespace android { +/* + * Dump the memory adddress of the calling process to the given fd. + */ +extern void dumpMemoryAddresses(int fd); + +}; + +#endif // MEMORY_LEAK_TRACK_UTIL_H diff --git a/include/media/mediametadataretriever.h b/include/media/mediametadataretriever.h index e905006..3e343e0 100644 --- a/include/media/mediametadataretriever.h +++ b/include/media/mediametadataretriever.h @@ -47,6 +47,12 @@ enum { METADATA_KEY_ALBUMARTIST = 13, METADATA_KEY_DISC_NUMBER = 14, METADATA_KEY_COMPILATION = 15, + METADATA_KEY_HAS_AUDIO = 16, + METADATA_KEY_HAS_VIDEO = 17, + METADATA_KEY_VIDEO_WIDTH = 18, + METADATA_KEY_VIDEO_HEIGHT = 19, + METADATA_KEY_BITRATE = 20, + // Add more here... }; @@ -56,7 +62,11 @@ public: MediaMetadataRetriever(); ~MediaMetadataRetriever(); void disconnect(); - status_t setDataSource(const char* dataSourceUrl); + + status_t setDataSource( + const char *dataSourceUrl, + const KeyedVector<String8, String8> *headers = NULL); + status_t setDataSource(int fd, int64_t offset, int64_t length); sp<IMemory> getFrameAtTime(int64_t timeUs, int option); sp<IMemory> extractAlbumArt(); diff --git a/include/media/mediaplayer.h b/include/media/mediaplayer.h index 528eeb9..748e489 100644 --- a/include/media/mediaplayer.h +++ b/include/media/mediaplayer.h @@ -37,6 +37,7 @@ enum media_event_type { MEDIA_BUFFERING_UPDATE = 3, MEDIA_SEEK_COMPLETE = 4, MEDIA_SET_VIDEO_SIZE = 5, + MEDIA_TIMED_TEXT = 99, MEDIA_ERROR = 100, MEDIA_INFO = 200, }; @@ -129,7 +130,7 @@ enum media_player_states { class MediaPlayerListener: virtual public RefBase { public: - virtual void notify(int msg, int ext1, int ext2) = 0; + virtual void notify(int msg, int ext1, int ext2, const Parcel *obj) = 0; }; class MediaPlayer : public BnMediaPlayerClient, @@ -166,7 +167,7 @@ public: status_t setLooping(int loop); bool isLooping(); status_t setVolume(float leftVolume, float rightVolume); - void notify(int msg, int ext1, int ext2); + void notify(int msg, int ext1, int ext2, const Parcel *obj = NULL); static sp<IMemory> decode(const char* url, uint32_t *pSampleRate, int* pNumChannels, int* pFormat); static sp<IMemory> decode(int fd, int64_t offset, int64_t length, uint32_t *pSampleRate, int* pNumChannels, int* pFormat); status_t invoke(const Parcel& request, Parcel *reply); diff --git a/include/media/mediarecorder.h b/include/media/mediarecorder.h index a710546..67d940b 100644 --- a/include/media/mediarecorder.h +++ b/include/media/mediarecorder.h @@ -104,35 +104,62 @@ enum video_encoder { }; /* - * The state machine of the media_recorder uses a set of different state names. - * The mapping between the media_recorder and the pvauthorengine is shown below: - * - * mediarecorder pvauthorengine - * ---------------------------------------------------------------- - * MEDIA_RECORDER_ERROR ERROR - * MEDIA_RECORDER_IDLE IDLE - * MEDIA_RECORDER_INITIALIZED OPENED - * MEDIA_RECORDER_DATASOURCE_CONFIGURED - * MEDIA_RECORDER_PREPARED INITIALIZED - * MEDIA_RECORDER_RECORDING RECORDING + * The state machine of the media_recorder. */ enum media_recorder_states { + // Error state. MEDIA_RECORDER_ERROR = 0, + + // Recorder was just created. MEDIA_RECORDER_IDLE = 1 << 0, + + // Recorder has been initialized. MEDIA_RECORDER_INITIALIZED = 1 << 1, + + // Configuration of the recorder has been completed. MEDIA_RECORDER_DATASOURCE_CONFIGURED = 1 << 2, + + // Recorder is ready to start. MEDIA_RECORDER_PREPARED = 1 << 3, + + // Recording is in progress. MEDIA_RECORDER_RECORDING = 1 << 4, }; // The "msg" code passed to the listener in notify. enum media_recorder_event_type { + MEDIA_RECORDER_EVENT_LIST_START = 1, MEDIA_RECORDER_EVENT_ERROR = 1, - MEDIA_RECORDER_EVENT_INFO = 2 + MEDIA_RECORDER_EVENT_INFO = 2, + MEDIA_RECORDER_EVENT_LIST_END = 99, + + // Track related event types + MEDIA_RECORDER_TRACK_EVENT_LIST_START = 100, + MEDIA_RECORDER_TRACK_EVENT_ERROR = 100, + MEDIA_RECORDER_TRACK_EVENT_INFO = 101, + MEDIA_RECORDER_TRACK_EVENT_LIST_END = 1000, }; +/* + * The (part of) "what" code passed to the listener in notify. + * When the error or info type is track specific, the what has + * the following layout: + * the left-most 16-bit is meant for error or info type. + * the right-most 4-bit is meant for track id. + * the rest is reserved. + * + * | track id | reserved | error or info type | + * 31 28 16 0 + * + */ enum media_recorder_error_type { - MEDIA_RECORDER_ERROR_UNKNOWN = 1 + MEDIA_RECORDER_ERROR_UNKNOWN = 1, + + // Track related error type + MEDIA_RECORDER_TRACK_ERROR_LIST_START = 100, + MEDIA_RECORDER_TRACK_ERROR_GENERAL = 100, + MEDIA_RECORDER_ERROR_VIDEO_NO_SYNC_FRAME = 200, + MEDIA_RECORDER_TRACK_ERROR_LIST_END = 1000, }; // The codes are distributed as follow: @@ -141,11 +168,15 @@ enum media_recorder_error_type { // enum media_recorder_info_type { MEDIA_RECORDER_INFO_UNKNOWN = 1, + MEDIA_RECORDER_INFO_MAX_DURATION_REACHED = 800, MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED = 801, - MEDIA_RECORDER_INFO_COMPLETION_STATUS = 802, - MEDIA_RECORDER_INFO_PROGRESS_FRAME_STATUS = 803, - MEDIA_RECORDER_INFO_PROGRESS_TIME_STATUS = 804, + + // All track related informtional events start here + MEDIA_RECORDER_TRACK_INFO_LIST_START = 1000, + MEDIA_RECORDER_TRACK_INFO_COMPLETION_STATUS = 1000, + MEDIA_RECORDER_TRACK_INFO_PROGRESS_IN_TIME = 1001, + MEDIA_RECORDER_TRACK_INFO_LIST_END = 2000, }; // ---------------------------------------------------------------------------- diff --git a/include/media/mediascanner.h b/include/media/mediascanner.h index df5be32..765c039 100644 --- a/include/media/mediascanner.h +++ b/include/media/mediascanner.h @@ -55,7 +55,7 @@ private: status_t doProcessDirectory( char *path, int pathRemaining, MediaScannerClient &client, - ExceptionCheck exceptionCheck, void *exceptionEnv); + bool noMedia, ExceptionCheck exceptionCheck, void *exceptionEnv); MediaScanner(const MediaScanner &); MediaScanner &operator=(const MediaScanner &); @@ -72,10 +72,9 @@ public: void endFile(); virtual bool scanFile(const char* path, long long lastModified, - long long fileSize, bool isDirectory) = 0; + 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 bool addNoMediaFolder(const char* path) = 0; protected: void convertValues(uint32_t encoding); diff --git a/include/media/stagefright/AudioPlayer.h b/include/media/stagefright/AudioPlayer.h index d12ee9c..0b79324 100644 --- a/include/media/stagefright/AudioPlayer.h +++ b/include/media/stagefright/AudioPlayer.h @@ -108,6 +108,8 @@ private: void reset(); + uint32_t getNumFramesPendingPlayout() const; + AudioPlayer(const AudioPlayer &); AudioPlayer &operator=(const AudioPlayer &); }; diff --git a/include/media/stagefright/CameraSource.h b/include/media/stagefright/CameraSource.h index 4a39fbf..bb25bae 100644 --- a/include/media/stagefright/CameraSource.h +++ b/include/media/stagefright/CameraSource.h @@ -99,34 +99,6 @@ public: virtual sp<MetaData> getFormat(); /** - * Retrieve the total number of video buffers available from - * this source. - * - * This method is useful if these video buffers are used - * for passing video frame data to other media components, - * such as OMX video encoders, in order to eliminate the - * memcpy of the data. - * - * @return the total numbner of video buffers. Returns 0 to - * indicate that this source does not make the video - * buffer information availalble. - */ - size_t getNumberOfVideoBuffers() const; - - /** - * Retrieve the individual video buffer available from - * this source. - * - * @param index the index corresponding to the video buffer. - * Valid range of the index is [0, n], where n = - * getNumberOfVideoBuffers() - 1. - * - * @return the video buffer corresponding to the given index. - * If index is out of range, 0 should be returned. - */ - sp<IMemory> getVideoBuffer(size_t index) const; - - /** * Tell whether this camera source stores meta data or real YUV * frame data in video buffers. * diff --git a/include/media/stagefright/DataSource.h b/include/media/stagefright/DataSource.h index f95e56a..6b6fcdf 100644 --- a/include/media/stagefright/DataSource.h +++ b/include/media/stagefright/DataSource.h @@ -75,15 +75,17 @@ public: static void RegisterDefaultSniffers(); // for DRM - virtual DecryptHandle* DrmInitialization() { + virtual sp<DecryptHandle> DrmInitialization() { return NULL; } - virtual void getDrmInfo(DecryptHandle **handle, DrmManagerClient **client) {}; + virtual void getDrmInfo(sp<DecryptHandle> &handle, DrmManagerClient **client) {}; virtual String8 getUri() { return String8(); } + virtual String8 getMIMEType() const; + protected: virtual ~DataSource() {} diff --git a/include/media/stagefright/FileSource.h b/include/media/stagefright/FileSource.h index 51a4343..6cf86dc 100644 --- a/include/media/stagefright/FileSource.h +++ b/include/media/stagefright/FileSource.h @@ -38,9 +38,9 @@ public: virtual status_t getSize(off64_t *size); - virtual DecryptHandle* DrmInitialization(); + virtual sp<DecryptHandle> DrmInitialization(); - virtual void getDrmInfo(DecryptHandle **handle, DrmManagerClient **client); + virtual void getDrmInfo(sp<DecryptHandle> &handle, DrmManagerClient **client); protected: virtual ~FileSource(); @@ -52,7 +52,7 @@ private: Mutex mLock; /*for DRM*/ - DecryptHandle *mDecryptHandle; + sp<DecryptHandle> mDecryptHandle; DrmManagerClient *mDrmManagerClient; int64_t mDrmBufOffset; int64_t mDrmBufSize; diff --git a/include/media/stagefright/MPEG4Writer.h b/include/media/stagefright/MPEG4Writer.h index 5c5229d..15f86ea 100644 --- a/include/media/stagefright/MPEG4Writer.h +++ b/include/media/stagefright/MPEG4Writer.h @@ -157,7 +157,7 @@ private: bool use32BitFileOffset() const; bool exceedsFileDurationLimit(); bool isFileStreamable() const; - void trackProgressStatus(const Track* track, int64_t timeUs, status_t err = OK); + void trackProgressStatus(size_t trackId, int64_t timeUs, status_t err = OK); void writeCompositionMatrix(int32_t degrees); MPEG4Writer(const MPEG4Writer &); diff --git a/include/media/stagefright/MediaDefs.h b/include/media/stagefright/MediaDefs.h index 66dfff6..6a21627 100644 --- a/include/media/stagefright/MediaDefs.h +++ b/include/media/stagefright/MediaDefs.h @@ -45,6 +45,7 @@ extern const char *MEDIA_MIMETYPE_CONTAINER_WAV; extern const char *MEDIA_MIMETYPE_CONTAINER_OGG; extern const char *MEDIA_MIMETYPE_CONTAINER_MATROSKA; extern const char *MEDIA_MIMETYPE_CONTAINER_MPEG2TS; +extern const char *MEDIA_MIMETYPE_CONTAINER_AVI; extern const char *MEDIA_MIMETYPE_CONTAINER_WVM; |