summaryrefslogtreecommitdiff
path: root/media/eco/ECOSession.cpp
diff options
context:
space:
mode:
authorHangyu Kuang <hkuang@google.com>2019-05-15 16:40:56 -0700
committerHangyu Kuang <hkuang@google.com>2019-05-15 16:40:56 -0700
commit9277a2eef39e07442ab2d761c2e1dbc9703ea75a (patch)
treea04a26fb23e287bea75f2b0762681165d52b2467 /media/eco/ECOSession.cpp
parentb7ea6023a82d9a00f6c280afb78e1ec9b887ce10 (diff)
downloadav-9277a2eef39e07442ab2d761c2e1dbc9703ea75a.tar.gz
ECOService: Add support for handling actual bitrate stats.
Bug: 117877984 Test: Unit test. Change-Id: Iaa3c6425c0cbebdc09af035a42358c452cb163c5
Diffstat (limited to 'media/eco/ECOSession.cpp')
-rw-r--r--media/eco/ECOSession.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/media/eco/ECOSession.cpp b/media/eco/ECOSession.cpp
index 752df4e..1bdfa61 100644
--- a/media/eco/ECOSession.cpp
+++ b/media/eco/ECOSession.cpp
@@ -299,9 +299,13 @@ void ECOSession::processFrameStats(const ECOData& stats) {
const ECOData::ECODataValueType value = entry.second;
ECOLOGD("Processing %s key", key.c_str());
- // Only process the keys that are supported by ECOService 1.0.
- if (!key.compare(FRAME_NUM) || !key.compare(FRAME_PTS_US) || !key.compare(FRAME_TYPE) ||
- !key.compare(FRAME_SIZE_BYTES)) {
+ if (!key.compare(KEY_STATS_TYPE)) {
+ // Skip the key KEY_STATS_TYPE as that has been parsed already.
+ continue;
+ } else if (!key.compare(FRAME_NUM) || !key.compare(FRAME_PTS_US) ||
+ !key.compare(FRAME_TYPE) || !key.compare(FRAME_SIZE_BYTES) ||
+ !key.compare(ENCODER_ACTUAL_BITRATE_BPS)) {
+ // Only process the keys that are supported by ECOService 1.0.
info.set(key, value);
} else if (!key.compare(FRAME_AVG_QP)) {
// Check the qp to see if need to notify the listener.