summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/camera/CameraHardwareInterface.h53
-rw-r--r--include/media/stagefright/AudioPlayer.h6
-rw-r--r--include/media/stagefright/MPEG4Writer.h1
-rw-r--r--include/private/surfaceflinger/SharedBufferStack.h10
-rw-r--r--include/surfaceflinger/Surface.h2
-rw-r--r--include/ui/InputDispatcher.h11
-rw-r--r--include/ui/egl/android_natives.h12
7 files changed, 85 insertions, 10 deletions
diff --git a/include/camera/CameraHardwareInterface.h b/include/camera/CameraHardwareInterface.h
index 3a77dd1..561a46d 100644
--- a/include/camera/CameraHardwareInterface.h
+++ b/include/camera/CameraHardwareInterface.h
@@ -21,6 +21,8 @@
#include <ui/egl/android_natives.h>
#include <utils/RefBase.h>
#include <surfaceflinger/ISurface.h>
+#include <ui/android_native_buffer.h>
+#include <ui/GraphicBuffer.h>
#include <camera/Camera.h>
#include <camera/CameraParameters.h>
@@ -47,6 +49,17 @@ typedef void (*data_callback)(int32_t msgType,
const sp<IMemory>& dataPtr,
void* user);
+#ifdef USE_GRAPHIC_VIDEO_BUFFERS
+/**
+ * Replace data_callback_timestamp. Once we are done, this
+ * should be renamed as data_callback_timestamp, and the existing
+ * data_callback_timestamp should be deleted.
+ */
+typedef void (*videobuffer_callback_timestamp)(nsecs_t timestamp,
+ int32_t msgType,
+ const sp<android_native_buffer_t>& buf,
+ void* user);
+#endif
typedef void (*data_callback_timestamp)(nsecs_t timestamp,
int32_t msgType,
const sp<IMemory>& dataPtr,
@@ -87,6 +100,46 @@ class CameraHardwareInterface : public virtual RefBase {
public:
virtual ~CameraHardwareInterface() { }
+#ifdef USE_GRAPHIC_VIDEO_BUFFERS
+ /**
+ * Replace existing setCallbacks() method. Once we are done, the
+ * videobuffer_callback_timestamp parameter will be renamed to
+ * data_callback_timestamp, but its signature will be the same
+ * as videobuffer_callback_timestamp, which will be renamed
+ * to data_callback_timestamp and the exiting data_callback_timestamp
+ * will be deleted.
+ */
+ virtual void setCallbacks(notify_callback notify_cb,
+ data_callback data_cb,
+ videobuffer_callback_timestamp data_cb_timestamp,
+ void* user) = 0;
+
+ /**
+ * Replace releaseRecordingFrame(). releaseRecordingFrame() should be
+ * changed so that it has the same signature of releaseVideoBuffer(),
+ * once we are done, and releaseVideoBuffer() will be deleted.
+ */
+ virtual void releaseVideoBuffer(const sp<android_native_buffer_t>& buf) = 0;
+
+ /**
+ * This method should be called after startRecording().
+ *
+ * @param nBuffers the total number of video buffers allocated by the camera
+ * hal
+ * @param buffers an array allocated by the camera hal to hold the pointers
+ * to the individual video buffers. The video buffers and the buffers array
+ * should NOT be modified/released by camera hal until stopRecording() is
+ * called and all outstanding video buffers previously sent out via
+ * CAMERA_MSG_VIDEO_FRAME have been released via releaseVideoBuffer().
+ * Camera hal client must not release the individual buffers and the buffers
+ * array.
+ * @return no error if OK.
+ */
+ virtual status_t getVideoBufferInfo(
+ sp<android_native_buffer_t>** buffers,
+ size_t *nBuffers) = 0;
+#endif
+
/** Set the ANativeWindow to which preview frames are sent */
virtual status_t setPreviewWindow(const sp<ANativeWindow>& buf) = 0;
diff --git a/include/media/stagefright/AudioPlayer.h b/include/media/stagefright/AudioPlayer.h
index ed2f7d7..37af032 100644
--- a/include/media/stagefright/AudioPlayer.h
+++ b/include/media/stagefright/AudioPlayer.h
@@ -49,11 +49,9 @@ public:
status_t start(bool sourceAlreadyStarted = false);
- void pause();
+ void pause(bool playPendingSamples = false);
void resume();
- void stop();
-
// Returns the timestamp of the last buffer played (in us).
int64_t getMediaTimeUs();
@@ -107,6 +105,8 @@ private:
int64_t getRealTimeUsLocked() const;
+ void reset();
+
AudioPlayer(const AudioPlayer &);
AudioPlayer &operator=(const AudioPlayer &);
};
diff --git a/include/media/stagefright/MPEG4Writer.h b/include/media/stagefright/MPEG4Writer.h
index 70bd8e8..cff38b2 100644
--- a/include/media/stagefright/MPEG4Writer.h
+++ b/include/media/stagefright/MPEG4Writer.h
@@ -64,6 +64,7 @@ private:
FILE *mFile;
bool mUse4ByteNalLength;
bool mUse32BitOffset;
+ bool mIsFileSizeLimitExplicitlyRequested;
bool mPaused;
bool mStarted;
off_t mOffset;
diff --git a/include/private/surfaceflinger/SharedBufferStack.h b/include/private/surfaceflinger/SharedBufferStack.h
index d689667..d6ae5e9 100644
--- a/include/private/surfaceflinger/SharedBufferStack.h
+++ b/include/private/surfaceflinger/SharedBufferStack.h
@@ -114,8 +114,9 @@ public:
int32_t identity; // surface's identity (const)
int32_t token; // surface's token (for debugging)
- int32_t reserved32[1];
Statistics stats;
+ int8_t headBuf; // last retired buffer
+ uint8_t reservedBytes[3];
int32_t reserved;
BufferData buffers[NUM_BUFFER_MAX]; // 1024 bytes
};
@@ -201,6 +202,7 @@ public:
status_t undoDequeue(int buf);
status_t lock(int buf);
+ status_t cancel(int buf);
status_t queue(int buf);
bool needNewBuffer(int buffer) const;
status_t setDirtyRegion(int buffer, const Region& reg);
@@ -230,8 +232,9 @@ private:
inline ssize_t operator()();
};
- struct UndoDequeueUpdate : public UpdateBase {
- inline UndoDequeueUpdate(SharedBufferBase* sbb);
+ struct CancelUpdate : public UpdateBase {
+ int tail, buf;
+ inline CancelUpdate(SharedBufferBase* sbb, int tail, int buf);
inline ssize_t operator()();
};
@@ -256,7 +259,6 @@ private:
int mNumBuffers;
int32_t tail;
- int32_t undoDequeueTail;
int32_t queued_head;
// statistics...
nsecs_t mDequeueTime[SharedBufferStack::NUM_BUFFER_MAX];
diff --git a/include/surfaceflinger/Surface.h b/include/surfaceflinger/Surface.h
index a210880..cef439c 100644
--- a/include/surfaceflinger/Surface.h
+++ b/include/surfaceflinger/Surface.h
@@ -200,6 +200,7 @@ private:
*/
static int setSwapInterval(ANativeWindow* window, int interval);
static int dequeueBuffer(ANativeWindow* window, android_native_buffer_t** buffer);
+ static int cancelBuffer(ANativeWindow* window, android_native_buffer_t* buffer);
static int lockBuffer(ANativeWindow* window, android_native_buffer_t* buffer);
static int queueBuffer(ANativeWindow* window, android_native_buffer_t* buffer);
static int query(ANativeWindow* window, int what, int* value);
@@ -208,6 +209,7 @@ private:
int dequeueBuffer(android_native_buffer_t** buffer);
int lockBuffer(android_native_buffer_t* buffer);
int queueBuffer(android_native_buffer_t* buffer);
+ int cancelBuffer(android_native_buffer_t* buffer);
int query(int what, int* value);
int perform(int operation, va_list args);
diff --git a/include/ui/InputDispatcher.h b/include/ui/InputDispatcher.h
index 8d4654f..246df8f 100644
--- a/include/ui/InputDispatcher.h
+++ b/include/ui/InputDispatcher.h
@@ -212,8 +212,15 @@ struct InputWindow {
int32_t ownerPid;
int32_t ownerUid;
- bool visibleFrameIntersects(const InputWindow* other) const;
bool touchableAreaContainsPoint(int32_t x, int32_t y) const;
+ bool frameContainsPoint(int32_t x, int32_t y) const;
+
+ /* Returns true if the window is of a trusted type that is allowed to silently
+ * overlay other windows for the purpose of implementing the secure views feature.
+ * Trusted overlays, such as IME windows, can partly obscure other windows without causing
+ * motion events to be delivered to them with AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED.
+ */
+ bool isTrustedOverlay() const;
};
@@ -973,7 +980,7 @@ private:
bool shouldPokeUserActivityForCurrentInputTargetsLocked();
void pokeUserActivityLocked(nsecs_t eventTime, int32_t eventType);
bool checkInjectionPermission(const InputWindow* window, const InjectionState* injectionState);
- bool isWindowObscuredLocked(const InputWindow* window);
+ bool isWindowObscuredAtPointLocked(const InputWindow* window, int32_t x, int32_t y) const;
bool isWindowFinishedWithPreviousInputLocked(const InputWindow* window);
String8 getApplicationWindowLabelLocked(const InputApplication* application,
const InputWindow* window);
diff --git a/include/ui/egl/android_natives.h b/include/ui/egl/android_natives.h
index d59d72b..654d0f3 100644
--- a/include/ui/egl/android_natives.h
+++ b/include/ui/egl/android_natives.h
@@ -218,7 +218,17 @@ struct ANativeWindow
int (*perform)(struct ANativeWindow* window,
int operation, ... );
- void* reserved_proc[3];
+ /*
+ * hook used to cancel a buffer that has been dequeued.
+ * No synchronization is performed between dequeue() and cancel(), so
+ * either external synchronization is needed, or these functions must be
+ * called from the same thread.
+ */
+ int (*cancelBuffer)(struct ANativeWindow* window,
+ struct android_native_buffer_t* buffer);
+
+
+ void* reserved_proc[2];
};
// Backwards compatibility... please switch to ANativeWindow.