Skip to content

Commit 468dad2

Browse files
committed
Transcoder: add getters for number of decoded and generated frames
1 parent 87e071d commit 468dad2

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

src/AvTranscoder/transcoder/StreamTranscoder.hpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,23 @@ class AvExport StreamTranscoder
100100
/// Returns a reference to the stream which wraps data
101101
IOutputStream& getOutputStream() const { return *_outputStream; }
102102

103+
/// Returns the total number of generated frames for this processed stream
104+
size_t getNumberOfGeneratedFrames() const {
105+
size_t generatedFrames = 0;
106+
for (IDecoder* generator : _generators) {
107+
generatedFrames += generator->getNbDecodedFrames();
108+
}
109+
return generatedFrames;
110+
}
111+
/// Returns the total number of decoded frames for this processed stream
112+
size_t getNumberOfDecodedFrames() const {
113+
size_t decodedFrames = 0;
114+
for (IDecoder* inputDecoder : _inputDecoders) {
115+
decodedFrames += inputDecoder->getNbDecodedFrames();
116+
}
117+
return decodedFrames;
118+
}
119+
103120
/**
104121
* @brief Returns if the stream has the ability to switch to a generator.
105122
*/

src/AvTranscoder/transcoder/Transcoder.hpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,24 @@ class AvExport Transcoder
139139
void setProcessMethod(const EProcessMethod eProcessMethod, const size_t indexBasedStream = 0,
140140
const double outputDuration = 0);
141141

142+
/**
143+
* @brief Returns the total number of generated frames for a specific stream
144+
* @param streamIndex: the index of the stream
145+
* @return The total number of generated frames
146+
*/
147+
size_t getNumberOfGeneratedFrames(const size_t streamIndex) const {
148+
return _streamTranscoders.at(streamIndex)->getNumberOfGeneratedFrames();
149+
}
150+
151+
/**
152+
* @brief Returns the total number of decoded frames for a specific stream
153+
* @param streamIndex: the index of the stream
154+
* @return The total number of decoded frames
155+
*/
156+
size_t getNumberOfDecodedFrames(const size_t streamIndex) const {
157+
return _streamTranscoders.at(streamIndex)->getNumberOfDecodedFrames();
158+
}
159+
142160
private:
143161
void addRewrapStream(const InputStreamDesc& inputStreamDesc, const float offset);
144162
void addTranscodeStream(const std::vector<InputStreamDesc>& inputStreamDescArray, const ProfileLoader::Profile& profile,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy