Update tuner default AIDL HAL.
*) Use tuner AIDL HAL return values.
*) Replace mTunerService with mTuner to avoid confusing.
*) Merge other HIDL HAL changes.
*) ag/15371813, ag/15371814 and ag/15371815.
Bug: 191825295
Test: make and run VtsHalTvTunerTargetTest
Change-Id: Ibbf94c4fc36c3bda94a7e0f3e0697c83ac414d0e
diff --git a/tv/tuner/aidl/default/Dvr.h b/tv/tuner/aidl/default/Dvr.h
index fb22a2e..68933ae 100644
--- a/tv/tuner/aidl/default/Dvr.h
+++ b/tv/tuner/aidl/default/Dvr.h
@@ -21,7 +21,9 @@
#include <fmq/AidlMessageQueue.h>
#include <math.h>
+#include <atomic>
#include <set>
+#include <thread>
#include "Demux.h"
#include "Frontend.h"
#include "Tuner.h"
@@ -107,10 +109,7 @@
* Each filter handler handles the data filtering/output writing/filterEvent updating.
*/
void startTpidFilter(vector<int8_t> data);
- static void* __threadLoopPlayback(void* user);
- static void* __threadLoopRecord(void* user);
void playbackThreadLoop();
- void recordThreadLoop();
unique_ptr<DvrMQ> mDvrMQ;
EventFlag* mDvrEventFlag;
@@ -121,7 +120,7 @@
DvrSettings mDvrSettings;
// Thread handlers
- pthread_t mDvrThread;
+ std::thread mDvrThread;
// FMQ status local records
PlaybackStatus mPlaybackStatus;
@@ -129,7 +128,7 @@
/**
* If a specific filter's writing loop is still running
*/
- bool mDvrThreadRunning;
+ std::atomic<bool> mDvrThreadRunning;
bool mKeepFetchingDataFromFrontend;
/**
* Lock to protect writes to the FMQs
@@ -140,13 +139,8 @@
*/
std::mutex mPlaybackStatusLock;
std::mutex mRecordStatusLock;
- std::mutex mDvrThreadLock;
const bool DEBUG_DVR = false;
-
- // Booleans to check if recording is running.
- // Recording is ready when both of the following are set to true.
- bool mIsRecordStarted = false;
};
} // namespace tuner