summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/camera/CameraMetadata.h5
-rw-r--r--include/media/AudioSystem.h4
-rw-r--r--include/media/AudioTrack.h12
-rw-r--r--include/media/EffectsFactoryApi.h24
-rw-r--r--include/media/IAudioFlinger.h5
-rw-r--r--include/media/MediaPlayerInterface.h2
-rw-r--r--include/media/stagefright/ACodec.h1
-rw-r--r--include/media/stagefright/AudioPlayer.h2
-rw-r--r--include/media/stagefright/CameraSourceTimeLapse.h6
-rw-r--r--include/media/stagefright/DataSource.h4
-rw-r--r--include/media/stagefright/MetaData.h3
-rw-r--r--include/media/stagefright/Utils.h3
-rw-r--r--include/private/media/AudioTrackShared.h19
-rw-r--r--include/private/media/StaticAudioTrackState.h10
14 files changed, 55 insertions, 45 deletions
diff --git a/include/camera/CameraMetadata.h b/include/camera/CameraMetadata.h
index fe2bd19..1254d3c 100644
--- a/include/camera/CameraMetadata.h
+++ b/include/camera/CameraMetadata.h
@@ -99,6 +99,11 @@ class CameraMetadata {
status_t append(const CameraMetadata &other);
/**
+ * Append metadata from a raw camera_metadata buffer
+ */
+ status_t append(const camera_metadata* other);
+
+ /**
* Number of metadata entries.
*/
size_t entryCount() const;
diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h
index 225ef76..4c22412 100644
--- a/include/media/AudioSystem.h
+++ b/include/media/AudioSystem.h
@@ -127,8 +127,8 @@ public:
// NOTE: this feature is not supported on all hardware platforms and it is
// necessary to check returned status before using the returned values.
static status_t getRenderPosition(audio_io_handle_t output,
- size_t *halFrames,
- size_t *dspFrames,
+ uint32_t *halFrames,
+ uint32_t *dspFrames,
audio_stream_type_t stream = AUDIO_STREAM_DEFAULT);
// return the number of input frames lost by HAL implementation, or 0 if the handle is invalid
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h
index f2f9c22..f6646ab 100644
--- a/include/media/AudioTrack.h
+++ b/include/media/AudioTrack.h
@@ -187,7 +187,8 @@ public:
int notificationFrames = 0,
int sessionId = 0,
transfer_type transferType = TRANSFER_DEFAULT,
- const audio_offload_info_t *offloadInfo = NULL);
+ const audio_offload_info_t *offloadInfo = NULL,
+ int uid = -1);
/* Creates an audio track and registers it with AudioFlinger.
* With this constructor, the track is configured for static buffer mode.
@@ -211,7 +212,8 @@ public:
int notificationFrames = 0,
int sessionId = 0,
transfer_type transferType = TRANSFER_DEFAULT,
- const audio_offload_info_t *offloadInfo = NULL);
+ const audio_offload_info_t *offloadInfo = NULL,
+ int uid = -1);
/* Terminates the AudioTrack and unregisters it from AudioFlinger.
* Also destroys all resources associated with the AudioTrack.
@@ -248,7 +250,8 @@ public:
bool threadCanCallJava = false,
int sessionId = 0,
transfer_type transferType = TRANSFER_DEFAULT,
- const audio_offload_info_t *offloadInfo = NULL);
+ const audio_offload_info_t *offloadInfo = NULL,
+ int uid = -1);
/* Result of constructing the AudioTrack. This must be checked for successful initialization
* before using any AudioTrack API (except for set()), because using
@@ -658,7 +661,7 @@ protected:
sp<AudioTrackThread> mAudioTrackThread;
float mVolume[2];
float mSendLevel;
- uint32_t mSampleRate;
+ mutable uint32_t mSampleRate; // mutable because getSampleRate() can update it.
size_t mFrameCount; // corresponds to current IAudioTrack
size_t mReqFrameCount; // frame count to request the next time a new
// IAudioTrack is needed
@@ -751,6 +754,7 @@ private:
sp<DeathNotifier> mDeathNotifier;
uint32_t mSequence; // incremented for each new IAudioTrack attempt
audio_io_handle_t mOutput; // cached output io handle
+ int mClientUid;
};
class TimedAudioTrack : public AudioTrack
diff --git a/include/media/EffectsFactoryApi.h b/include/media/EffectsFactoryApi.h
index b1143b9..b1ed7b0 100644
--- a/include/media/EffectsFactoryApi.h
+++ b/include/media/EffectsFactoryApi.h
@@ -171,30 +171,6 @@ int EffectGetDescriptor(const effect_uuid_t *pEffectUuid, effect_descriptor_t *p
////////////////////////////////////////////////////////////////////////////////
int EffectIsNullUuid(const effect_uuid_t *pEffectUuid);
-////////////////////////////////////////////////////////////////////////////////
-//
-// Function: EffectGetSubEffects
-//
-// Description: Returns the descriptors of the sub effects of the effect
-// whose uuid is pointed to by first argument.
-//
-// Input:
-// pEffectUuid: pointer to the effect uuid.
-// size: size of the buffer pointed by pDescriptor.
-//
-// Input/Output:
-// pDescriptor: address where to return the sub effect descriptors.
-//
-// Output:
-// returned value: 0 successful operation.
-// -ENODEV factory failed to initialize
-// -EINVAL invalid pEffectUuid or pDescriptor
-// -ENOENT no effect with this uuid found
-// *pDescriptor: updated with the sub effect descriptors.
-//
-////////////////////////////////////////////////////////////////////////////////
-int EffectGetSubEffects(const effect_uuid_t *pEffectUuid, effect_descriptor_t *pDescriptors, size_t size);
-
#if __cplusplus
} // extern "C"
#endif
diff --git a/include/media/IAudioFlinger.h b/include/media/IAudioFlinger.h
index eaf7780..282f275 100644
--- a/include/media/IAudioFlinger.h
+++ b/include/media/IAudioFlinger.h
@@ -74,6 +74,7 @@ public:
// output: server's description of IAudioTrack for display in logs.
// Don't attempt to parse, as the format could change.
String8& name,
+ int clientUid,
status_t *status) = 0;
virtual sp<IAudioRecord> openRecord(
@@ -166,10 +167,10 @@ public:
virtual status_t setVoiceVolume(float volume) = 0;
- virtual status_t getRenderPosition(size_t *halFrames, size_t *dspFrames,
+ virtual status_t getRenderPosition(uint32_t *halFrames, uint32_t *dspFrames,
audio_io_handle_t output) const = 0;
- virtual size_t getInputFramesLost(audio_io_handle_t ioHandle) const = 0;
+ virtual uint32_t getInputFramesLost(audio_io_handle_t ioHandle) const = 0;
virtual int newAudioSessionId() = 0;
diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h
index 3b151ef..26d8729 100644
--- a/include/media/MediaPlayerInterface.h
+++ b/include/media/MediaPlayerInterface.h
@@ -99,6 +99,8 @@ public:
virtual status_t getPosition(uint32_t *position) const = 0;
virtual status_t getFramesWritten(uint32_t *frameswritten) const = 0;
virtual int getSessionId() const = 0;
+ virtual audio_stream_type_t getAudioStreamType() const = 0;
+ virtual uint32_t getSampleRate() const = 0;
// If no callback is specified, use the "write" API below to submit
// audio data.
diff --git a/include/media/stagefright/ACodec.h b/include/media/stagefright/ACodec.h
index a8ffd4a..e796ab3 100644
--- a/include/media/stagefright/ACodec.h
+++ b/include/media/stagefright/ACodec.h
@@ -264,6 +264,7 @@ private:
status_t setupMPEG4EncoderParameters(const sp<AMessage> &msg);
status_t setupH263EncoderParameters(const sp<AMessage> &msg);
status_t setupAVCEncoderParameters(const sp<AMessage> &msg);
+ status_t setupVPXEncoderParameters(const sp<AMessage> &msg);
status_t verifySupportForProfileAndLevel(int32_t profile, int32_t level);
diff --git a/include/media/stagefright/AudioPlayer.h b/include/media/stagefright/AudioPlayer.h
index 912a43c..14afb85 100644
--- a/include/media/stagefright/AudioPlayer.h
+++ b/include/media/stagefright/AudioPlayer.h
@@ -129,7 +129,7 @@ private:
void reset();
uint32_t getNumFramesPendingPlayout() const;
- int64_t getOutputPlayPositionUs_l() const;
+ int64_t getOutputPlayPositionUs_l();
bool allowDeepBuffering() const { return (mCreateFlags & ALLOW_DEEP_BUFFERING) != 0; }
bool useOffload() const { return (mCreateFlags & USE_OFFLOAD) != 0; }
diff --git a/include/media/stagefright/CameraSourceTimeLapse.h b/include/media/stagefright/CameraSourceTimeLapse.h
index 6b7a63c..34213be 100644
--- a/include/media/stagefright/CameraSourceTimeLapse.h
+++ b/include/media/stagefright/CameraSourceTimeLapse.h
@@ -41,7 +41,8 @@ public:
Size videoSize,
int32_t videoFrameRate,
const sp<IGraphicBufferProducer>& surface,
- int64_t timeBetweenTimeLapseFrameCaptureUs);
+ int64_t timeBetweenTimeLapseFrameCaptureUs,
+ bool storeMetaDataInVideoBuffers = true);
virtual ~CameraSourceTimeLapse();
@@ -116,7 +117,8 @@ private:
Size videoSize,
int32_t videoFrameRate,
const sp<IGraphicBufferProducer>& surface,
- int64_t timeBetweenTimeLapseFrameCaptureUs);
+ int64_t timeBetweenTimeLapseFrameCaptureUs,
+ bool storeMetaDataInVideoBuffers = true);
// Wrapper over CameraSource::signalBufferReturned() to implement quick stop.
// It only handles the case when mLastReadBufferCopy is signalled. Otherwise
diff --git a/include/media/stagefright/DataSource.h b/include/media/stagefright/DataSource.h
index 742bc0e..157b1aa 100644
--- a/include/media/stagefright/DataSource.h
+++ b/include/media/stagefright/DataSource.h
@@ -80,7 +80,6 @@ public:
const sp<DataSource> &source, String8 *mimeType,
float *confidence, sp<AMessage> *meta);
- static void RegisterSniffer(SnifferFunc func);
static void RegisterDefaultSniffers();
// for DRM
@@ -101,6 +100,9 @@ protected:
private:
static Mutex gSnifferMutex;
static List<SnifferFunc> gSniffers;
+ static bool gSniffersRegistered;
+
+ static void RegisterSniffer_l(SnifferFunc func);
DataSource(const DataSource &);
DataSource &operator=(const DataSource &);
diff --git a/include/media/stagefright/MetaData.h b/include/media/stagefright/MetaData.h
index de3fc36..db8216b 100644
--- a/include/media/stagefright/MetaData.h
+++ b/include/media/stagefright/MetaData.h
@@ -134,6 +134,7 @@ enum {
kKeyRequiresSecureBuffers = 'secu', // bool (int32_t)
kKeyIsADTS = 'adts', // bool (int32_t)
+ kKeyAACAOT = 'aaot', // int32_t
// If a MediaBuffer's data represents (at least partially) encrypted
// data, the following fields aid in decryption.
@@ -214,6 +215,8 @@ public:
bool findData(uint32_t key, uint32_t *type,
const void **data, size_t *size) const;
+ bool hasData(uint32_t key) const;
+
void dumpToLog() const;
protected:
diff --git a/include/media/stagefright/Utils.h b/include/media/stagefright/Utils.h
index c24f612..bbad271 100644
--- a/include/media/stagefright/Utils.h
+++ b/include/media/stagefright/Utils.h
@@ -57,7 +57,8 @@ status_t mapMimeToAudioFormat(audio_format_t& format, const char* mime);
status_t sendMetaDataToHal(sp<MediaPlayerBase::AudioSink>& sink, const sp<MetaData>& meta);
// Check whether the stream defined by meta can be offloaded to hardware
-bool canOffloadStream(const sp<MetaData>& meta, bool hasVideo, bool isStreaming);
+bool canOffloadStream(const sp<MetaData>& meta, bool hasVideo,
+ bool isStreaming, audio_stream_type_t streamType);
} // namespace android
diff --git a/include/private/media/AudioTrackShared.h b/include/private/media/AudioTrackShared.h
index 395f164..2d033e6 100644
--- a/include/private/media/AudioTrackShared.h
+++ b/include/private/media/AudioTrackShared.h
@@ -65,7 +65,9 @@ typedef SingleStateQueue<StaticAudioTrackState> StaticAudioTrackSingleStateQueue
struct AudioTrackSharedStatic {
StaticAudioTrackSingleStateQueue::Shared
mSingleStateQueue;
- size_t mBufferPosition; // updated asynchronously by server,
+ // This field should be a size_t, but since it is located in shared memory we
+ // force to 32-bit. The client and server may have different typedefs for size_t.
+ uint32_t mBufferPosition; // updated asynchronously by server,
// "for entertainment purposes only"
};
@@ -108,7 +110,9 @@ struct audio_track_cblk_t
private:
- size_t mMinimum; // server wakes up client if available >= mMinimum
+ // This field should be a size_t, but since it is located in shared memory we
+ // force to 32-bit. The client and server may have different typedefs for size_t.
+ uint32_t mMinimum; // server wakes up client if available >= mMinimum
// Channel volumes are fixed point U4.12, so 0x1000 means 1.0.
// Left channel is in [0:15], right channel is in [16:31].
@@ -245,7 +249,11 @@ public:
}
void setMinimum(size_t minimum) {
- mCblk->mMinimum = minimum;
+ // This can only happen on a 64-bit client
+ if (minimum > UINT32_MAX) {
+ minimum = UINT32_MAX;
+ }
+ mCblk->mMinimum = (uint32_t) minimum;
}
// Return the number of frames that would need to be obtained and released
@@ -360,6 +368,7 @@ public:
// which must be > 0.
// buffer->mNonContig is unused.
// buffer->mRaw is unused.
+ // ackFlush is true iff being called from Track::start to acknowledge a pending flush.
// On exit:
// buffer->mFrameCount has the actual number of contiguous available frames,
// which is always 0 when the return status != NO_ERROR.
@@ -370,7 +379,7 @@ public:
// NO_ERROR Success, buffer->mFrameCount > 0.
// WOULD_BLOCK No frames are available.
// NO_INIT Shared memory is corrupt.
- virtual status_t obtainBuffer(Buffer* buffer);
+ virtual status_t obtainBuffer(Buffer* buffer, bool ackFlush = false);
// Release (some of) the frames last obtained.
// On entry, buffer->mFrameCount should have the number of frames to release,
@@ -437,7 +446,7 @@ protected:
public:
virtual size_t framesReady();
virtual void framesReadyIsCalledByMultipleThreads();
- virtual status_t obtainBuffer(Buffer* buffer);
+ virtual status_t obtainBuffer(Buffer* buffer, bool ackFlush);
virtual void releaseBuffer(Buffer* buffer);
virtual void tallyUnderrunFrames(uint32_t frameCount);
virtual uint32_t getUnderrunFrames() const { return 0; }
diff --git a/include/private/media/StaticAudioTrackState.h b/include/private/media/StaticAudioTrackState.h
index 46a5946..d483061 100644
--- a/include/private/media/StaticAudioTrackState.h
+++ b/include/private/media/StaticAudioTrackState.h
@@ -25,9 +25,13 @@ namespace android {
// state is wrapped by a SingleStateQueue.
struct StaticAudioTrackState {
// do not define constructors, destructors, or virtual methods
- size_t mLoopStart;
- size_t mLoopEnd;
- int mLoopCount;
+
+ // These fields should both be size_t, but since they are located in shared memory we
+ // force to 32-bit. The client and server may have different typedefs for size_t.
+ uint32_t mLoopStart;
+ uint32_t mLoopEnd;
+
+ int mLoopCount;
};
} // namespace android