Skip to content
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
38 changes: 1 addition & 37 deletions src/AvTranscoder/file/InputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,42 +126,6 @@ InputStream& InputFile::getStream(size_t index)
}
}

std::string InputFile::getFormatName() const
{
if(_formatContext.getAVInputFormat().name == NULL)
{
LOG_WARN("Unknown demuxer format name of '" << _filename << "'.")
return "";
}
return std::string(_formatContext.getAVInputFormat().name);
}

std::string InputFile::getFormatLongName() const
{
if(_formatContext.getAVInputFormat().long_name == NULL)
{
LOG_WARN("Unknown demuxer format long name of '" << _filename << "'.")
return "";
}
return std::string(_formatContext.getAVInputFormat().long_name);
}

std::string InputFile::getFormatMimeType() const
{
#if LIBAVFORMAT_VERSION_MAJOR <= 55
LOG_WARN("Cannot get mime type format of '" << _filename
<< "' because your libavformat library has a major version <= 55.")
return "not available";
#else
if(_formatContext.getAVInputFormat().mime_type == NULL)
{
LOG_WARN("Unknown demuxer format mime type of '" << _filename << "'.")
return "";
}
return std::string(_formatContext.getAVInputFormat().mime_type);
#endif
}

double InputFile::getFps()
{
double fps = 1;
Expand Down Expand Up @@ -250,4 +214,4 @@ std::ostream& operator<<(std::ostream& flux, const InputFile& input)

return flux;
}
}
}
15 changes: 0 additions & 15 deletions src/AvTranscoder/file/InputFile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,6 @@ class AvExport InputFile

std::string getFilename() const { return _filename; }

/**
* @brief A comma separated list of short names for the format, or empty if unknown.
*/
std::string getFormatName() const;

/**
* @brief Descriptive name for the format, meant to be more human-readable than name, or empty if unknown.
*/
std::string getFormatLongName() const;

/**
* @brief Comma-separated list of mime types, or empty if unknown.
*/
std::string getFormatMimeType() const;

FormatContext& getFormatContext() { return _formatContext; }

/**
Expand Down
16 changes: 16 additions & 0 deletions src/AvTranscoder/properties/FileProperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,22 @@ std::string FileProperties::getFormatLongName() const
return _avFormatContext->iformat->long_name;
}

std::string FileProperties::getFormatMimeType() const
{
#if LIBAVFORMAT_VERSION_MAJOR <= 55
LOG_WARN("Cannot get mime type format of '" << getFilename()
<< "' because your libavformat library has a major version <= 55.")
return "not available";
#else
if(_avFormatContext->iformat->mime_type == NULL)
{
LOG_WARN("Unknown demuxer format mime type of '" << getFilename() << "'.")
return "";
}
return std::string(_avFormatContext->iformat->mime_type);
#endif
}

size_t FileProperties::getProgramsCount() const
{
if(!_avFormatContext)
Expand Down
5 changes: 3 additions & 2 deletions src/AvTranscoder/properties/FileProperties.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ class AvExport FileProperties
void extractStreamProperties(IProgress& progress, const EAnalyseLevel level);

std::string getFilename() const;
std::string getFormatName() const; ///< A comma separated list of short names for the format
std::string getFormatLongName() const;
std::string getFormatName() const; ///< A comma separated list of short names for the format, or empty if unknown.
std::string getFormatLongName() const; ///< Descriptive name for the format, meant to be more human-readable than name, or empty if unknown.
std::string getFormatMimeType() const; ///< Comma-separated list of mime types, or empty if unknown.

size_t getProgramsCount() const;
double getStartTime() const;
Expand Down