summaryrefslogtreecommitdiff
path: root/media/eco/ECOSession.cpp
diff options
context:
space:
mode:
authorHangyu Kuang <hkuang@google.com>2019-05-07 16:06:16 -0700
committerHangyu Kuang <hkuang@google.com>2019-05-08 10:49:55 -0700
commit8357764cc0d7ec9524556339e2c564e73becd29a (patch)
treeedd151ed5fb2c4048ea51495134ebc3423f3b3d4 /media/eco/ECOSession.cpp
parent5903f3939d93a1be58ccb690626e52651c137296 (diff)
downloadav-8357764cc0d7ec9524556339e2c564e73becd29a.tar.gz
[ECOService]: Add dumpsys support to ECOService.
Run "adb shell /vendor/bin/dumpsys media.ecoservice" DUMP OF SERVICE media.ecoservice: == ECO Service info: == Number of ECOServices: 1 == Session Info: == Width: 1280 Height: 720 isCameraRecording: 1, target-bitrate: 12000000 bps codetype: 1 profile: 8 level: 32768 Provider: QTIEncoder =================== Bug:117877984 Test: Unit test Change-Id: I9f578620a02ad6b71feadd063b0ca8d797f89e85
Diffstat (limited to 'media/eco/ECOSession.cpp')
-rw-r--r--media/eco/ECOSession.cpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/media/eco/ECOSession.cpp b/media/eco/ECOSession.cpp
index 1a1bc59..b184cdb 100644
--- a/media/eco/ECOSession.cpp
+++ b/media/eco/ECOSession.cpp
@@ -190,8 +190,8 @@ bool ECOSession::processSessionStats(const ECOData& stats) {
mCodecLevel = std::get<int32_t>(value);
ECOLOGV("codec level is %d", mCodecLevel);
} else if (!key.compare(ENCODER_TARGET_BITRATE_BPS)) {
- mBitrateBps = std::get<int32_t>(value);
- ECOLOGV("codec bitrate is %d", mBitrateBps);
+ mTargetBitrateBps = std::get<int32_t>(value);
+ ECOLOGV("codec target bitrate is %d", mTargetBitrateBps);
} else if (!key.compare(ENCODER_KFI_FRAMES)) {
mKeyFrameIntervalFrames = std::get<int32_t>(value);
ECOLOGV("codec kfi is %d", mKeyFrameIntervalFrames);
@@ -255,8 +255,8 @@ ECOData ECOSession::generateLatestSessionInfoEcoData() {
hasInfo = true;
}
- if (mBitrateBps != -1) {
- info.setInt32(ENCODER_TARGET_BITRATE_BPS, mBitrateBps);
+ if (mTargetBitrateBps != -1) {
+ info.setInt32(ENCODER_TARGET_BITRATE_BPS, mTargetBitrateBps);
hasInfo = true;
}
@@ -369,6 +369,7 @@ Status ECOSession::addStatsProvider(
}
mProvider = provider;
+ mProviderName = name;
*status = true;
return binder::Status::ok();
}
@@ -436,6 +437,7 @@ Status ECOSession::addInfoListener(
IPCThreadState::self()->getCallingUid(), IPCThreadState::self()->getCallingPid());
mListener = listener;
+ mListenerName = name;
mNewListenerAdded = true;
mWorkerWaitCV.notify_all();
@@ -494,6 +496,21 @@ Status ECOSession::getNumOfProviders(int32_t* _aidl_return) {
ECOLOGV("binderDied");
}
+status_t ECOSession::dump(int fd, const Vector<String16>& /*args*/) {
+ std::scoped_lock<std::mutex> lock(mSessionLock);
+ dprintf(fd, "\n== Session Info: ==\n\n");
+ dprintf(fd,
+ "Width: %d Height: %d isCameraRecording: %d, target-bitrate: %d bps codetype: %d "
+ "profile: %d level: %d\n",
+ mWidth, mHeight, mIsCameraRecording, mTargetBitrateBps, mCodecType, mCodecProfile,
+ mCodecLevel);
+ dprintf(fd, "Provider: %s \n", ::android::String8(mProviderName).string());
+ dprintf(fd, "Listener: %s \n", ::android::String8(mListenerName).string());
+ dprintf(fd, "\n===================\n\n");
+
+ return NO_ERROR;
+}
+
void ECOSession::logStats(const ECOData& data) {
// Check if mLogStats is true;
if (!mLogStats || mLogStatsEntries == 0) return;