Skip to content

Commit c479c56

Browse files
author
Clement Champetier
committed
FileProperties: added isRawFormat method
To check if it's a container, or a raw bitstreams without access to timing information.
1 parent 8a4e575 commit c479c56

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/AvTranscoder/properties/FileProperties.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,16 @@ std::string FileProperties::getFormatLongName() const
145145
return _avFormatContext->iformat->long_name;
146146
}
147147

148+
bool FileProperties::isRawFormat() const
149+
{
150+
if(getNbStreams() != 1)
151+
return false;
152+
// the format name should be the same as the codec name
153+
if(getFormatName() == getStreamProperties().at(0)->getCodecName())
154+
return true;
155+
return false;
156+
}
157+
148158
std::string FileProperties::getFormatMimeType() const
149159
{
150160
#if LIBAVFORMAT_VERSION_MAJOR <= 55

src/AvTranscoder/properties/FileProperties.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class AvExport FileProperties
4141
std::string getFilename() const;
4242
std::string getFormatName() const; ///< A comma separated list of short names for the format, or empty if unknown.
4343
std::string getFormatLongName() const; ///< Descriptive name for the format, meant to be more human-readable than name, or empty if unknown.
44+
bool isRawFormat() const; ///< Is there a container, or a raw bitstreams without access to timing information.
4445
std::string getFormatMimeType() const; ///< Comma-separated list of mime types, or empty if unknown.
4546

4647
size_t getProgramsCount() const;

0 commit comments

Comments
 (0)