transcoder: plumb uid/pid to transcoder createCodec
Instead of using ResourceManagerService::overrideProcessInfo to
override the procinfo of the native MediaTranscodingService,
use the newly added AMediaCodec create methods with UID/PID.
This will allow the codec instance to be attributed to the
actual client (for battery reporting as well resource managerment
purposes), instead of all to media.transcoding.
Plumb uid/pid to transcoder to create the codec with them.
Fix up the unit test after the change.
bug: 159172726
test: transcoder unit tests.
Change-Id: Ie7e6fd813ec53f125590665ab3466758a0fd4601
diff --git a/media/libmediatranscoding/TranscoderWrapper.cpp b/media/libmediatranscoding/TranscoderWrapper.cpp
index fffbfe9..8cc8dd2 100644
--- a/media/libmediatranscoding/TranscoderWrapper.cpp
+++ b/media/libmediatranscoding/TranscoderWrapper.cpp
@@ -347,7 +347,8 @@
mCurrentClientId = clientId;
mCurrentSessionId = sessionId;
mTranscoderCb = std::make_shared<CallbackImpl>(shared_from_this(), clientId, sessionId);
- mTranscoder = MediaTranscoder::create(mTranscoderCb, pausedState);
+ mTranscoder = MediaTranscoder::create(mTranscoderCb, request.clientPid, request.clientUid,
+ pausedState);
if (mTranscoder == nullptr) {
ALOGE("failed to create transcoder");
return AMEDIA_ERROR_UNKNOWN;