summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/camera/Camera.h8
-rw-r--r--include/camera/ICamera.h9
-rw-r--r--include/media/AudioTrack.h44
-rw-r--r--include/media/IHDCP.h15
-rw-r--r--include/media/stagefright/ACodec.h2
-rw-r--r--include/media/stagefright/SurfaceMediaSource.h8
6 files changed, 69 insertions, 17 deletions
diff --git a/include/camera/Camera.h b/include/camera/Camera.h
index 37626a4..c34b3ea 100644
--- a/include/camera/Camera.h
+++ b/include/camera/Camera.h
@@ -121,7 +121,15 @@ public:
void setListener(const sp<CameraListener>& listener);
void setRecordingProxyListener(const sp<ICameraRecordingProxyListener>& listener);
+
+ // Configure preview callbacks to app. Only one of the older
+ // callbacks or the callback surface can be active at the same time;
+ // enabling one will disable the other if active. Flags can be
+ // disabled by calling it with CAMERA_FRAME_CALLBACK_FLAG_NOOP, and
+ // Target by calling it with a NULL interface.
void setPreviewCallbackFlags(int preview_callback_flag);
+ status_t setPreviewCallbackTarget(
+ const sp<IGraphicBufferProducer>& callbackProducer);
sp<ICameraRecordingProxy> getRecordingProxy();
diff --git a/include/camera/ICamera.h b/include/camera/ICamera.h
index 2236c1f..b2125bd 100644
--- a/include/camera/ICamera.h
+++ b/include/camera/ICamera.h
@@ -51,8 +51,15 @@ public:
const sp<IGraphicBufferProducer>& bufferProducer) = 0;
// set the preview callback flag to affect how the received frames from
- // preview are handled.
+ // preview are handled. Enabling preview callback flags disables any active
+ // preview callback surface set by setPreviewCallbackTarget().
virtual void setPreviewCallbackFlag(int flag) = 0;
+ // set a buffer interface to use for client-received preview frames instead
+ // of preview callback buffers. Passing a valid interface here disables any
+ // active preview callbacks set by setPreviewCallbackFlag(). Passing NULL
+ // disables the use of the callback target.
+ virtual status_t setPreviewCallbackTarget(
+ const sp<IGraphicBufferProducer>& callbackProducer) = 0;
// start preview mode, must call setPreviewDisplay first
virtual status_t startPreview() = 0;
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h
index 64f82bb..0b616e3 100644
--- a/include/media/AudioTrack.h
+++ b/include/media/AudioTrack.h
@@ -304,15 +304,24 @@ public:
/* Enables looping and sets the start and end points of looping.
* Only supported for static buffer mode.
*
+ * FIXME The comments below are for the new planned interpretation which is not yet implemented.
+ * Currently the legacy behavior is still implemented, where loopStart and loopEnd
+ * are in wrapping (overflow) frame units like the return value of getPosition().
+ * The plan is to fix all callers to use the new version at same time implementation changes.
+ *
* Parameters:
*
- * loopStart: loop start expressed as the number of PCM frames played since AudioTrack start.
- * loopEnd: loop end expressed as the number of PCM frames played since AudioTrack start.
+ * loopStart: loop start in frames relative to start of buffer.
+ * loopEnd: loop end in frames relative to start of buffer.
* loopCount: number of loops to execute. Calling setLoop() with loopCount == 0 cancels any
- * pending or active loop. loopCount = -1 means infinite looping.
+ * pending or active loop. loopCount == -1 means infinite looping.
*
* For proper operation the following condition must be respected:
- * (loopEnd-loopStart) <= framecount()
+ * loopCount != 0 implies 0 <= loopStart < loopEnd <= frameCount().
+ *
+ * If the loop period (loopEnd - loopStart) is too small for the implementation to support,
+ * setLoop() will return BAD_VALUE.
+ *
*/
status_t setLoop(uint32_t loopStart, uint32_t loopEnd, int loopCount);
@@ -354,18 +363,19 @@ public:
status_t setPositionUpdatePeriod(uint32_t updatePeriod);
status_t getPositionUpdatePeriod(uint32_t *updatePeriod) const;
- /* Sets playback head position within AudioTrack buffer. The new position is specified
- * in number of frames.
- * This method must be called with the AudioTrack in paused or stopped state.
- * Note that the actual position set is <position> modulo the AudioTrack buffer size in frames.
- * Therefore using this method makes sense only when playing a "static" audio buffer
- * as opposed to streaming.
- * The getPosition() method on the other hand returns the total number of frames played since
- * playback start.
+ /* Sets playback head position.
+ * Only supported for static buffer mode.
+ *
+ * FIXME The comments below are for the new planned interpretation which is not yet implemented.
+ * Currently the legacy behavior is still implemented, where the new position
+ * is in wrapping (overflow) frame units like the return value of getPosition().
+ * The plan is to fix all callers to use the new version at same time implementation changes.
*
* Parameters:
*
- * position: New playback head position within AudioTrack buffer.
+ * position: New playback head position in frames relative to start of buffer.
+ * 0 <= position <= frameCount(). Note that end of buffer is permitted,
+ * but will result in an immediate underrun if started.
*
* Returned status (from utils/Errors.h) can be:
* - NO_ERROR: successful operation
@@ -381,6 +391,14 @@ public:
*/
status_t getPosition(uint32_t *position);
+#if 0
+ /* For static buffer mode only, this returns the current playback position in frames
+ * relative to start of buffer. It is analogous to the new API for
+ * setLoop() and setPosition(). After underrun, the position will be at end of buffer.
+ */
+ status_t getBufferPosition(uint32_t *position);
+#endif
+
/* Forces AudioTrack buffer full condition. When playing a static buffer, this method avoids
* rewriting the buffer before restarting playback after a stop.
* This method must be called with the AudioTrack in paused or stopped state.
diff --git a/include/media/IHDCP.h b/include/media/IHDCP.h
index 6d27b18..54fefa3 100644
--- a/include/media/IHDCP.h
+++ b/include/media/IHDCP.h
@@ -17,6 +17,7 @@
#include <binder/IInterface.h>
#include <media/hardware/HDCPAPI.h>
#include <media/stagefright/foundation/ABase.h>
+#include <ui/GraphicBuffer.h>
namespace android {
@@ -59,6 +60,20 @@ struct IHDCP : public IInterface {
const void *inData, size_t size, uint32_t streamCTR,
uint64_t *outInputCTR, void *outData) = 0;
+ // Encrypt data according to the HDCP spec. "size" bytes of data starting
+ // at location "offset" are available in "buffer" (buffer handle). "size"
+ // may not be a multiple of 128 bits (16 bytes). An equal number of
+ // encrypted bytes should be written to the buffer at "outData" (virtual
+ // address). This operation is to be synchronous, i.e. this call does not
+ // return until outData contains size bytes of encrypted data.
+ // streamCTR will be assigned by the caller (to 0 for the first PES stream,
+ // 1 for the second and so on)
+ // inputCTR _will_be_maintained_by_the_callee_ for each PES stream.
+ virtual status_t encryptNative(
+ const sp<GraphicBuffer> &graphicBuffer,
+ size_t offset, size_t size, uint32_t streamCTR,
+ uint64_t *outInputCTR, void *outData) = 0;
+
// DECRYPTION only:
// Decrypt data according to the HDCP spec.
// "size" bytes of encrypted data are available at "inData"
diff --git a/include/media/stagefright/ACodec.h b/include/media/stagefright/ACodec.h
index 34bae29..391c089 100644
--- a/include/media/stagefright/ACodec.h
+++ b/include/media/stagefright/ACodec.h
@@ -182,7 +182,7 @@ private:
bool mSentFormat;
bool mIsEncoder;
-
+ bool mUseMetadataOnEncoderOutput;
bool mShutdownInProgress;
// If "mKeepComponentAllocated" we only transition back to Loaded state
diff --git a/include/media/stagefright/SurfaceMediaSource.h b/include/media/stagefright/SurfaceMediaSource.h
index 5f21da9..7d40379 100644
--- a/include/media/stagefright/SurfaceMediaSource.h
+++ b/include/media/stagefright/SurfaceMediaSource.h
@@ -146,9 +146,13 @@ private:
// this consumer
sp<BufferQueue> mBufferQueue;
- // mBufferSlot caches GraphicBuffers from the buffer queue
- sp<GraphicBuffer> mBufferSlot[BufferQueue::NUM_BUFFER_SLOTS];
+ struct SlotData {
+ sp<GraphicBuffer> mGraphicBuffer;
+ uint64_t mFrameNumber;
+ };
+ // mSlots caches GraphicBuffers and frameNumbers from the buffer queue
+ SlotData mSlots[BufferQueue::NUM_BUFFER_SLOTS];
// The permenent width and height of SMS buffers
int mWidth;