diff --git a/YUViewLib/src/filesource/FileSource.cpp b/YUViewLib/src/filesource/FileSource.cpp index 325f76823..4709467b5 100644 --- a/YUViewLib/src/filesource/FileSource.cpp +++ b/YUViewLib/src/filesource/FileSource.cpp @@ -35,8 +35,6 @@ #include #include -#include - #include #include #include diff --git a/YUViewLib/src/parser/ParserAnnexB.cpp b/YUViewLib/src/parser/ParserAnnexB.cpp index 81ce53216..21f669b29 100644 --- a/YUViewLib/src/parser/ParserAnnexB.cpp +++ b/YUViewLib/src/parser/ParserAnnexB.cpp @@ -287,12 +287,12 @@ bool ParserAnnexB::runParsingOfFile(const std::filesystem::path &compressedFileP return this->parseAnnexBFile(file); } -vector ParserAnnexB::StreamInfo::getStreamInfo() +vector ParserAnnexB::createTreeItemsFromStreamInfo() const { vector infoList; - infoList.push_back( - new QTreeWidgetItem(QStringList() << "File size" << QString::number(file_size))); - if (parsing) + infoList.push_back(new QTreeWidgetItem( + QStringList() << "File size" << QString::number(this->streamInfo.file_size))); + if (this->streamInfo.parsing) { infoList.push_back(new QTreeWidgetItem(QStringList() << "Number NAL units" << "Parsing...")); @@ -301,10 +301,10 @@ vector ParserAnnexB::StreamInfo::getStreamInfo() } else { - infoList.push_back(new QTreeWidgetItem(QStringList() << "Number NAL units" - << QString::number(this->nrNalUnits))); - infoList.push_back( - new QTreeWidgetItem(QStringList() << "Number Frames" << QString::number(this->nrFrames))); + infoList.push_back(new QTreeWidgetItem( + QStringList() << "Number NAL units" << QString::number(this->streamInfo.nrNalUnits))); + infoList.push_back(new QTreeWidgetItem( + QStringList() << "Number Frames" << QString::number(this->streamInfo.nrFrames))); } return infoList; diff --git a/YUViewLib/src/parser/ParserAnnexB.h b/YUViewLib/src/parser/ParserAnnexB.h index 3a1e96934..1104403c8 100644 --- a/YUViewLib/src/parser/ParserAnnexB.h +++ b/YUViewLib/src/parser/ParserAnnexB.h @@ -67,7 +67,7 @@ class ParserAnnexB : public Parser // Clear all knowledge about the bitstream. void clearData(); - vector getStreamInfo() override { return this->streamInfo.getStreamInfo(); } + vector getStreamInfo() override { return createTreeItemsFromStreamInfo(); } unsigned int getNrStreams() override { return 1; } std::string getShortStreamDescription(const int streamIndex) const override; @@ -161,14 +161,13 @@ class ParserAnnexB : public Parser // Save general information about the file here struct StreamInfo { - vector getStreamInfo(); - int64_t file_size{}; unsigned nrNalUnits{0}; unsigned nrFrames{0}; bool parsing{false}; }; - StreamInfo streamInfo{}; + StreamInfo streamInfo{}; + vector createTreeItemsFromStreamInfo() const; int getFramePOC(FrameIndexDisplayOrder frameIdx);