summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/binder/IBatteryStats.h12
-rw-r--r--include/gui/BufferQueueCore.h12
2 files changed, 24 insertions, 0 deletions
diff --git a/include/binder/IBatteryStats.h b/include/binder/IBatteryStats.h
index f4a8aa3..7ddac57 100644
--- a/include/binder/IBatteryStats.h
+++ b/include/binder/IBatteryStats.h
@@ -30,10 +30,22 @@ public:
virtual void noteStartSensor(int uid, int sensor) = 0;
virtual void noteStopSensor(int uid, int sensor) = 0;
+ virtual void noteStartVideo(int uid) = 0;
+ virtual void noteStopVideo(int uid) = 0;
+ virtual void noteStartAudio(int uid) = 0;
+ virtual void noteStopAudio(int uid) = 0;
+ virtual void noteResetVideo() = 0;
+ virtual void noteResetAudio() = 0;
enum {
NOTE_START_SENSOR_TRANSACTION = IBinder::FIRST_CALL_TRANSACTION,
NOTE_STOP_SENSOR_TRANSACTION,
+ NOTE_START_VIDEO_TRANSACTION,
+ NOTE_STOP_VIDEO_TRANSACTION,
+ NOTE_START_AUDIO_TRANSACTION,
+ NOTE_STOP_AUDIO_TRANSACTION,
+ NOTE_RESET_VIDEO_TRANSACTION,
+ NOTE_RESET_AUDIO_TRANSACTION,
};
};
diff --git a/include/gui/BufferQueueCore.h b/include/gui/BufferQueueCore.h
index cfcb7a5..1050e3b 100644
--- a/include/gui/BufferQueueCore.h
+++ b/include/gui/BufferQueueCore.h
@@ -120,6 +120,9 @@ private:
// in one of the slots.
bool stillTracking(const BufferItem* item) const;
+ // waitWhileAllocatingLocked blocks until mIsAllocating is false.
+ void waitWhileAllocatingLocked() const;
+
// mAllocator is the connection to SurfaceFlinger that is used to allocate
// new GraphicBuffer objects.
sp<IGraphicBufferAlloc> mAllocator;
@@ -234,6 +237,15 @@ private:
// mSidebandStream is a handle to the sideband buffer stream, if any
sp<NativeHandle> mSidebandStream;
+ // mIsAllocating indicates whether a producer is currently trying to allocate buffers (which
+ // releases mMutex while doing the allocation proper). Producers should not modify any of the
+ // FREE slots while this is true. mIsAllocatingCondition is signaled when this value changes to
+ // false.
+ bool mIsAllocating;
+
+ // mIsAllocatingCondition is a condition variable used by producers to wait until mIsAllocating
+ // becomes false.
+ mutable Condition mIsAllocatingCondition;
}; // class BufferQueueCore
} // namespace android