media: update on concurrent codec usage
This change includes:
- Calculating and passing application concurrent codec
usage for Video (Hw, SW), Audio and Image codecs to
stats.
- Updating the resource manager with change in resolution
for the video codecs
Bug: 265488359
Test: atest cts/tests/media/misc/src/android/media/misc/cts/ResourceManagerTest.java
/data/nativetest64/ResourceManagerService_test/ResourceManagerService_test
/data/nativetest64/ResourceObserverService_test/ResourceObserverService_test
Merged-In: I69536f10e01f66556536812dbbe3af7831a3c722
Change-Id: I69536f10e01f66556536812dbbe3af7831a3c722
diff --git a/services/mediaresourcemanager/ResourceManagerMetrics.h b/services/mediaresourcemanager/ResourceManagerMetrics.h
index b7810e5..3124aa2 100644
--- a/services/mediaresourcemanager/ResourceManagerMetrics.h
+++ b/services/mediaresourcemanager/ResourceManagerMetrics.h
@@ -77,6 +77,16 @@
struct ConcurrentCodecs {
ConcurrentCodecsMap mCurrent;
ConcurrentCodecsMap mPeak;
+ // concurrent HW Video codecs.
+ int mHWVideoCodecs;
+ // concurrent SW Video codecs.
+ int mSWVideoCodecs;
+ // concurrent Video codecs.
+ int mVideoCodecs;
+ // concurrent Audio codecs.
+ int mAudioCodecs;
+ // concurrent Image codecs.
+ int mImageCodecs;
};
// Current and Peak pixel count for a process.
@@ -119,6 +129,9 @@
// To be called when a client is stopped.
void notifyClientStopped(const ClientConfigParcel& clientConfig);
+ // To be called when a client's configuration has changed.
+ void notifyClientConfigChanged(const ClientConfigParcel& clientConfig);
+
// To be called when after a reclaim event.
void pushReclaimAtom(const ClientInfoParcel& clientInfo,
const std::vector<int>& priorities,
@@ -143,8 +156,9 @@
void increaseConcurrentCodecs(int32_t pid, CodecBucket codecBucket);
void decreaseConcurrentCodecs(int32_t pid, CodecBucket codecBucket);
- // To increase/decrease the concurrent pixels usage for a process.
+ // To increase/update/decrease the concurrent pixels usage for a process.
void increasePixelCount(int32_t pid, long pixels);
+ void updatePixelCount(int32_t pid, long newPixels, long lastPixels);
void decreasePixelCount(int32_t pid, long pixels);
// Issued when the process/application with given pid/uid is terminated.