Transcoder: Name transcoder threads for easier trace identification.
Bug: 183751395
Test: build_and_run_all_unit_tests.sh
Change-Id: I7b210d876584e3864540ba9991ed0e2a2de048e6
diff --git a/media/libmediatranscoding/transcoder/VideoTrackTranscoder.cpp b/media/libmediatranscoding/transcoder/VideoTrackTranscoder.cpp
index 383bedd..6ed45ed 100644
--- a/media/libmediatranscoding/transcoder/VideoTrackTranscoder.cpp
+++ b/media/libmediatranscoding/transcoder/VideoTrackTranscoder.cpp
@@ -21,6 +21,7 @@
#include <android-base/properties.h>
#include <media/NdkCommon.h>
#include <media/VideoTrackTranscoder.h>
+#include <sys/prctl.h>
using namespace AMediaFormatUtils;
@@ -588,6 +589,8 @@
}
media_status_t VideoTrackTranscoder::runTranscodeLoop(bool* stopped) {
+ prctl(PR_SET_NAME, (unsigned long)"VideTranscodTrd", 0, 0, 0);
+
// Push start decoder and encoder as two messages, so that these are subject to the
// stop request as well. If the session is cancelled (or paused) immediately after start,
// we don't need to waste time start then stop the codecs.