Move testing ts on Cuttlefish under /data/ directory
/data directory is a proper place for test pusher to adb push the ts
during run time. It saves image size comparing to bundle the ts during
compiling.
Files under the /data directory could only be passed around by fd
instead of directly opening. This CL also changes the way the DVR VTS
reads the ts.
Also for virtual frontend, to read the shell data file, we need the
DVR playback to input the data when testing frontend.
This CL also changes the way default implementation reads the data -
from the dvr playback fmq.
Test: atest VtsHalTvTunerV1_0TargetTest
Bug: 153366959
Change-Id: I72a98e4c4c0328206da106fb1c3459745c1644b7
diff --git a/tv/tuner/1.0/default/Dvr.h b/tv/tuner/1.0/default/Dvr.h
index 08afd5d..a63a256 100644
--- a/tv/tuner/1.0/default/Dvr.h
+++ b/tv/tuner/1.0/default/Dvr.h
@@ -81,8 +81,11 @@
bool createDvrMQ();
void sendBroadcastInputToDvrRecord(vector<uint8_t> byteBuffer);
bool writeRecordFMQ(const std::vector<uint8_t>& data);
- DvrType getType();
- bool addPlaybackFilter(sp<IFilter> filter);
+ bool addPlaybackFilter(uint32_t filterId, sp<IFilter> filter);
+ bool removePlaybackFilter(uint32_t filterId);
+ bool readPlaybackFMQ(bool isVirtualFrontend, bool isRecording);
+ bool startFilterDispatcher(bool isVirtualFrontend, bool isRecording);
+ EventFlag* getDvrEventFlag();
private:
// Demux service
@@ -105,9 +108,7 @@
* A dispatcher to read and dispatch input data to all the started filters.
* Each filter handler handles the data filtering/output writing/filterEvent updating.
*/
- bool readPlaybackFMQ();
void startTpidFilter(vector<uint8_t> data);
- bool startFilterDispatcher();
static void* __threadLoopPlayback(void* user);
static void* __threadLoopRecord(void* user);
void playbackThreadLoop();
@@ -123,7 +124,6 @@
// Thread handlers
pthread_t mDvrThread;
- pthread_t mBroadcastInputThread;
// FMQ status local records
PlaybackStatus mPlaybackStatus;
@@ -132,7 +132,6 @@
* If a specific filter's writing loop is still running
*/
bool mDvrThreadRunning;
- bool mBroadcastInputThreadRunning;
bool mKeepFetchingDataFromFrontend;
/**
* Lock to protect writes to the FMQs
@@ -143,7 +142,6 @@
*/
std::mutex mPlaybackStatusLock;
std::mutex mRecordStatusLock;
- std::mutex mBroadcastInputThreadLock;
std::mutex mDvrThreadLock;
const bool DEBUG_DVR = false;
@@ -151,7 +149,6 @@
// Booleans to check if recording is running.
// Recording is ready when both of the following are set to true.
bool mIsRecordStarted = false;
- bool mIsRecordFilterAttached = false;
};
} // namespace implementation