mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Add reference counter for Filter
Filters should start demux reading thread for IPTV when start() is called and they should PAUSE the thread when stop() is called. They should only be paused when all associated filters of the demux are closed. This CL adds reference counters for filters to track that. Bug: 288170590 Test: manual Change-Id: I087175a685a4559918ceaa511971b79e7fcb0a51
This commit is contained in:
@@ -326,6 +326,8 @@ Filter::~Filter() {
|
||||
ALOGV("%s", __FUNCTION__);
|
||||
mFilterThreadRunning = true;
|
||||
std::vector<DemuxFilterEvent> events;
|
||||
|
||||
mFilterCount += 1;
|
||||
// All the filter event callbacks in start are for testing purpose.
|
||||
switch (mType.mainType) {
|
||||
case DemuxFilterMainType::TS:
|
||||
@@ -362,6 +364,8 @@ Filter::~Filter() {
|
||||
::ndk::ScopedAStatus Filter::stop() {
|
||||
ALOGV("%s", __FUNCTION__);
|
||||
|
||||
mFilterCount -= 1;
|
||||
|
||||
mFilterThreadRunning = false;
|
||||
if (mFilterThread.joinable()) {
|
||||
mFilterThread.join();
|
||||
|
||||
@@ -289,6 +289,7 @@ class Filter : public BnFilter {
|
||||
uint8_t mIpCidMonitored = 0;
|
||||
|
||||
PlaybackStatus mIptvDvrPlaybackStatus;
|
||||
std::atomic<int> mFilterCount = 0;
|
||||
};
|
||||
|
||||
} // namespace tuner
|
||||
|
||||
Reference in New Issue
Block a user