transcoding: add test to test watchdog error returned to client
This change only affects tests.
bug: 169453212
test: MediaTranscodingService unit tests.
Change-Id: I657414e93158c0ed3c64c9dff37c682f10ce89a7
diff --git a/services/mediatranscoding/SimulatedTranscoder.h b/services/mediatranscoding/SimulatedTranscoder.h
index 6b51b4e..010f0f0 100644
--- a/services/mediatranscoding/SimulatedTranscoder.h
+++ b/services/mediatranscoding/SimulatedTranscoder.h
@@ -21,6 +21,7 @@
#include <media/TranscoderInterface.h>
#include <list>
+#include <map>
#include <mutex>
namespace android {
@@ -70,8 +71,9 @@
std::list<Event> mQueue GUARDED_BY(mLock);
bool mLooperReady;
- // Minimum time spent on transcode the video. This is used just for testing.
- int64_t mSessionProcessingTimeMs = kSessionDurationUs / 1000;
+ using SessionKeyType = std::pair<ClientIdType, SessionIdType>;
+ // map of session's remaining time in microsec.
+ std::map<SessionKeyType, std::chrono::microseconds> mRemainingTimeMap;
static const char* toString(Event::Type type);
void queueEvent(Event::Type type, ClientIdType clientId, SessionIdType sessionId,