transcoding: fixes for binder died handling

Change client id type to uintptr_t counter, instead of
casting binder to int64_t.

Save all shared_ptrs of clients in global registry.

bug: 154734285
bug: 145233472

test: transcoding unit tests; manually plant crash
in test client and check binderDied handling in log.
Change-Id: If6523a1c6b7ce797a2201462399174e9cf0a3c71

Change-Id: I6b312c0f28a345285e27b738c37baee2bccae755
diff --git a/media/libmediatranscoding/TranscodingJobScheduler.cpp b/media/libmediatranscoding/TranscodingJobScheduler.cpp
index 83d7a82..cf9d3c8 100644
--- a/media/libmediatranscoding/TranscodingJobScheduler.cpp
+++ b/media/libmediatranscoding/TranscodingJobScheduler.cpp
@@ -174,7 +174,7 @@
     }
 }
 
-bool TranscodingJobScheduler::submit(ClientIdType clientId, int32_t jobId, uid_t uid,
+bool TranscodingJobScheduler::submit(ClientIdType clientId, JobIdType jobId, uid_t uid,
                                      const TranscodingRequestParcel& request,
                                      const std::weak_ptr<ITranscodingClientCallback>& callback) {
     JobKeyType jobKey = std::make_pair(clientId, jobId);
@@ -231,7 +231,7 @@
     return true;
 }
 
-bool TranscodingJobScheduler::cancel(ClientIdType clientId, int32_t jobId) {
+bool TranscodingJobScheduler::cancel(ClientIdType clientId, JobIdType jobId) {
     JobKeyType jobKey = std::make_pair(clientId, jobId);
 
     ALOGV("%s: job %s", __FUNCTION__, jobToString(jobKey).c_str());
@@ -257,7 +257,7 @@
     return true;
 }
 
-bool TranscodingJobScheduler::getJob(ClientIdType clientId, int32_t jobId,
+bool TranscodingJobScheduler::getJob(ClientIdType clientId, JobIdType jobId,
                                      TranscodingRequestParcel* request) {
     JobKeyType jobKey = std::make_pair(clientId, jobId);
 
@@ -272,7 +272,7 @@
     return true;
 }
 
-void TranscodingJobScheduler::onFinish(ClientIdType clientId, int32_t jobId) {
+void TranscodingJobScheduler::onFinish(ClientIdType clientId, JobIdType jobId) {
     JobKeyType jobKey = std::make_pair(clientId, jobId);
 
     ALOGV("%s: job %s", __FUNCTION__, jobToString(jobKey).c_str());
@@ -308,7 +308,8 @@
     validateState_l();
 }
 
-void TranscodingJobScheduler::onError(int64_t clientId, int32_t jobId, TranscodingErrorCode err) {
+void TranscodingJobScheduler::onError(ClientIdType clientId, JobIdType jobId,
+                                      TranscodingErrorCode err) {
     JobKeyType jobKey = std::make_pair(clientId, jobId);
 
     ALOGV("%s: job %s, err %d", __FUNCTION__, jobToString(jobKey).c_str(), (int32_t)err);
@@ -344,7 +345,8 @@
     validateState_l();
 }
 
-void TranscodingJobScheduler::onProgressUpdate(int64_t clientId, int32_t jobId, int32_t progress) {
+void TranscodingJobScheduler::onProgressUpdate(ClientIdType clientId, JobIdType jobId,
+                                               int32_t progress) {
     JobKeyType jobKey = std::make_pair(clientId, jobId);
 
     ALOGV("%s: job %s, progress %d", __FUNCTION__, jobToString(jobKey).c_str(), progress);