Transcoding: Log transcoder level metrics.
- Add transcoder-level metric logging through west world,
to monitor performance and failures.
- Add new unit tests for TranscodingLogger class.
Bug: 179274112
Test: New and existing unit tests.
Change-Id: Ie8d9bc589c714a7b8be8f4f298c4fa75a81a6e56
diff --git a/media/libmediatranscoding/transcoder/VideoTrackTranscoder.cpp b/media/libmediatranscoding/transcoder/VideoTrackTranscoder.cpp
index 04a513e..acf5f6c 100644
--- a/media/libmediatranscoding/transcoder/VideoTrackTranscoder.cpp
+++ b/media/libmediatranscoding/transcoder/VideoTrackTranscoder.cpp
@@ -51,32 +51,6 @@
// Default frame rate.
static constexpr int32_t kDefaultFrameRate = 30;
-// Determines whether a track format describes HDR video content or not. The
-// logic is based on isHdr() in libstagefright/Utils.cpp.
-static bool isHdr(AMediaFormat* format) {
- // If VUI signals HDR content, this internal flag is set by the extractor.
- int32_t isHdr;
- if (AMediaFormat_getInt32(format, "android._is-hdr", &isHdr)) {
- return isHdr;
- }
-
- // If container supplied HDR static info without transfer set, assume HDR.
- const char* hdrInfo;
- int32_t transfer;
- if ((AMediaFormat_getString(format, AMEDIAFORMAT_KEY_HDR_STATIC_INFO, &hdrInfo) ||
- AMediaFormat_getString(format, "hdr10-plus-info", &hdrInfo)) &&
- !AMediaFormat_getInt32(format, AMEDIAFORMAT_KEY_COLOR_TRANSFER, &transfer)) {
- return true;
- }
-
- // Otherwise, check if an HDR transfer function is set.
- if (AMediaFormat_getInt32(format, AMEDIAFORMAT_KEY_COLOR_TRANSFER, &transfer)) {
- return transfer == COLOR_TRANSFER_ST2084 || transfer == COLOR_TRANSFER_HLG;
- }
-
- return false;
-}
-
template <typename T>
void VideoTrackTranscoder::BlockingQueue<T>::push(T const& value, bool front) {
{
@@ -347,7 +321,7 @@
}
// Request decoder to convert HDR content to SDR.
- const bool sourceIsHdr = isHdr(mSourceFormat.get());
+ const bool sourceIsHdr = VideoIsHdr(mSourceFormat.get());
if (sourceIsHdr) {
AMediaFormat_setInt32(decoderFormat.get(),
TBD_AMEDIACODEC_PARAMETER_KEY_COLOR_TRANSFER_REQUEST,