Skip to content

Commit

Permalink
reSharper: remove redundant template zarguments
Browse files Browse the repository at this point in the history
  • Loading branch information
jcdr428 committed Aug 9, 2023
1 parent 0df4910 commit a86543b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
22 changes: 11 additions & 11 deletions tsMuxer/bufferedReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ BufferedReader::BufferedReader(const uint32_t blockSize, const uint32_t allocSiz

ReaderData* BufferedReader::getReader(const uint32_t readerID)
{
std::lock_guard<std::mutex> lock(m_readersMtx);
std::lock_guard lock(m_readersMtx);
const auto itr = m_readers.find(readerID);
return itr != m_readers.end() ? itr->second : nullptr;
}

bool BufferedReader::incSeek(const uint32_t readerID, const int64_t offset)
{
std::lock_guard<std::mutex> lock(m_readersMtx);
std::lock_guard lock(m_readersMtx);
const auto itr = m_readers.find(readerID);
if (itr != m_readers.end())
{
Expand Down Expand Up @@ -87,7 +87,7 @@ uint32_t BufferedReader::createReader(const int readBuffOffset)
data->m_lastBlock = false;
size_t rSize;
{
std::lock_guard<std::mutex> lock(m_readersMtx);
std::lock_guard lock(m_readersMtx);
newReaderID = createNewReaderID();
m_readers[newReaderID] = data;
rSize = m_readers.size();
Expand All @@ -105,7 +105,7 @@ uint32_t BufferedReader::createReader(const int readBuffOffset)
void BufferedReader::deleteReader(const uint32_t readerID)
{
{
std::lock_guard<std::mutex> lock(m_readersMtx);
std::lock_guard lock(m_readersMtx);
const auto iterator = m_readers.find(readerID);
if (iterator == m_readers.end())
return;
Expand All @@ -126,7 +126,7 @@ uint8_t* BufferedReader::readBlock(const uint32_t readerID, uint32_t& readCnt, i
{
ReaderData* data = nullptr;
{
std::lock_guard<std::mutex> lock(m_readersMtx);
std::lock_guard lock(m_readersMtx);
const auto itr = m_readers.find(readerID);
if (itr != m_readers.end())
{
Expand All @@ -148,7 +148,7 @@ uint8_t* BufferedReader::readBlock(const uint32_t readerID, uint32_t& readCnt, i

if (!data->m_nextBlockSize)
{
std::unique_lock<std::mutex> lk(m_readMtx);
std::unique_lock lk(m_readMtx);
while (data->m_nextBlockSize == 0 && !data->m_eof) m_readCond.wait(lk);
}
readCnt = data->m_nextBlockSize >= 0 ? data->m_nextBlockSize : 0;
Expand All @@ -175,7 +175,7 @@ void BufferedReader::notify(const uint32_t readerID, const uint32_t dataReaded)
return;
if (dataReaded >= m_prereadThreshold && !data->m_notified)
{
std::lock_guard<std::mutex> lock(m_readersMtx);
std::lock_guard lock(m_readersMtx);
data->m_notified = true;
data->m_atQueue++;
m_readQueue.push(readerID);
Expand All @@ -184,7 +184,7 @@ void BufferedReader::notify(const uint32_t readerID, const uint32_t dataReaded)

uint32_t BufferedReader::getReaderCount()
{
std::lock_guard<std::mutex> lock(m_readersMtx);
std::lock_guard lock(m_readersMtx);
return static_cast<uint32_t>(m_readers.size());
}

Expand Down Expand Up @@ -260,14 +260,14 @@ void BufferedReader::thread_main()
}

{
std::lock_guard<std::mutex> lk(m_readMtx);
std::lock_guard lk(m_readMtx);
data->m_nextBlockSize = bytesReaded;
m_readCond.notify_one();
}
}

{
std::lock_guard<std::mutex> lock(m_readersMtx);
std::lock_guard lock(m_readersMtx);
data->m_atQueue--;
if (data->m_deleted && data->m_atQueue == 0)
{
Expand All @@ -291,7 +291,7 @@ void BufferedReader::thread_main()
void BufferedReader::setFileIterator(FileNameIterator* itr, const int readerID)
{
assert(readerID != -1);
std::lock_guard<std::mutex> lock(m_readersMtx);
std::lock_guard lock(m_readersMtx);
const auto reader = m_readers.find(readerID);
if (reader != m_readers.end())
reader->second->itr = itr;
Expand Down
4 changes: 2 additions & 2 deletions tsMuxer/tsMuxer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ void TSMuxer::buildPesHeader(const int pesStreamID, AVPacket& avPacket, int pid)
m_pesData.resize(bufLen);
memcpy(m_pesData.data(), tmpBuffer, bufLen);
for (auto& i : tmpPriorityData)
m_priorityData.push_back(std::pair<int, int>(i.first + pesPacket->getHeaderLength(), i.second));
m_priorityData.push_back(std::pair(i.first + pesPacket->getHeaderLength(), i.second));
}

void TSMuxer::addData(const int pesStreamID, const int pid, AVPacket& avPacket)
Expand All @@ -672,7 +672,7 @@ void TSMuxer::addData(const int pesStreamID, const int pid, AVPacket& avPacket)
if (!m_priorityData.empty() && m_priorityData.rbegin()->first + m_priorityData.rbegin()->second == beforePesLen)
m_priorityData.rbegin()->second += avPacket.size + pesHeaderLen;
else
m_priorityData.push_back(pair<int, int>(beforePesLen, avPacket.size + pesHeaderLen));
m_priorityData.push_back(pair(beforePesLen, avPacket.size + pesHeaderLen));
}
}

Expand Down
14 changes: 7 additions & 7 deletions tsMuxer/vvc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ int VvcVpsUnit::deserialize()
{
vps_id = m_reader.getBits(4);
vps_max_layers = m_reader.getBits(6) + 1;
vector<vector<bool>> vps_direct_ref_layer_flag(vps_max_layers, vector<bool>(vps_max_layers));
vector vps_direct_ref_layer_flag(vps_max_layers, vector<bool>(vps_max_layers));

vps_max_sublayers = m_reader.getBits(3) + 1;
bool vps_default_ptl_dpb_hrd_max_tid_flag =
Expand Down Expand Up @@ -277,8 +277,8 @@ int VvcVpsUnit::deserialize()
vps_num_ptls = m_reader.getBits(8) + 1;
}

vector<bool> vps_pt_present_flag(vps_num_ptls, true);
vector<int> vps_ptl_max_tid(vps_num_ptls, vps_max_sublayers - 1);
vector vps_pt_present_flag(vps_num_ptls, true);
vector vps_ptl_max_tid(vps_num_ptls, vps_max_sublayers - 1);

if (!vps_default_ptl_dpb_hrd_max_tid_flag)
vps_ptl_max_tid[0] = m_reader.getBits(3);
Expand Down Expand Up @@ -307,10 +307,10 @@ int VvcVpsUnit::deserialize()
if (vps_ols_mode_idc == 2)
{
layerIncludedInOlsFlag.resize(TotalNumOlss, vector<bool>(vps_max_layers));
vector<vector<bool>> dependencyFlag(vps_max_layers, vector<bool>(vps_max_layers));
vector<vector<bool>> ReferenceLayerIdx(vps_max_layers, vector<bool>(vps_max_layers));
vector<vector<bool>> OutputLayerIdx(TotalNumOlss, vector<bool>(vps_max_layers));
vector<int> NumRefLayers(vps_max_layers, 0);
vector dependencyFlag(vps_max_layers, vector<bool>(vps_max_layers));
vector ReferenceLayerIdx(vps_max_layers, vector<bool>(vps_max_layers));
vector OutputLayerIdx(TotalNumOlss, vector<bool>(vps_max_layers));
vector NumRefLayers(vps_max_layers, 0);

for (int i = 0; i < vps_max_layers; i++)
{
Expand Down

0 comments on commit a86543b

Please sign in to comment.