Skip to content

Add getters for decoded frames #331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/AvTranscoder/transcoder/StreamTranscoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,23 @@ class AvExport StreamTranscoder
/// Returns a reference to the stream which wraps data
IOutputStream& getOutputStream() const { return *_outputStream; }

/// Returns the total number of generated frames for this processed stream
size_t getNumberOfGeneratedFrames() const {
size_t generatedFrames = 0;
for (IDecoder* generator : _generators) {
generatedFrames += generator->getNbDecodedFrames();
}
return generatedFrames;
}
/// Returns the total number of decoded frames for this processed stream
size_t getNumberOfDecodedFrames() const {
size_t decodedFrames = 0;
for (IDecoder* inputDecoder : _inputDecoders) {
decodedFrames += inputDecoder->getNbDecodedFrames();
}
return decodedFrames;
}

/**
* @brief Returns if the stream has the ability to switch to a generator.
*/
Expand Down
18 changes: 18 additions & 0 deletions src/AvTranscoder/transcoder/Transcoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,24 @@ class AvExport Transcoder
void setProcessMethod(const EProcessMethod eProcessMethod, const size_t indexBasedStream = 0,
const double outputDuration = 0);

/**
* @brief Returns the total number of generated frames for a specific stream
* @param streamIndex: the index of the stream
* @return The total number of generated frames
*/
size_t getNumberOfGeneratedFrames(const size_t streamIndex) const {
return _streamTranscoders.at(streamIndex)->getNumberOfGeneratedFrames();
}

/**
* @brief Returns the total number of decoded frames for a specific stream
* @param streamIndex: the index of the stream
* @return The total number of decoded frames
*/
size_t getNumberOfDecodedFrames(const size_t streamIndex) const {
return _streamTranscoders.at(streamIndex)->getNumberOfDecodedFrames();
}

private:
void addRewrapStream(const InputStreamDesc& inputStreamDesc, const float offset);
void addTranscodeStream(const std::vector<InputStreamDesc>& inputStreamDescArray, const ProfileLoader::Profile& profile,
Expand Down
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