# FFmpegKit Linux API: StreamInformation.h Source File

StreamInformation.h
Go to the documentation of this file.
/*
* Copyright (c) 2022 Taner Sener
*
* This file is part of FFmpegKit.
*
* FFmpegKit is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FFmpegKit is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with FFmpegKit. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FFMPEG_KIT_STREAM_INFORMATION_H
#define FFMPEG_KIT_STREAM_INFORMATION_H
// OVERRIDING THE MACRO TO PREVENT APPLICATION TERMINATION
#define RAPIDJSON_ASSERT(x)
#include "rapidjson/document.h"
#include <string>
#include <memory>
namespace ffmpegkit {
class StreamInformation {
public:
static constexpr const char* KeyIndex = "index";
static constexpr const char* KeyType = "codec_type";
static constexpr const char* KeyCodec = "codec_name";
static constexpr const char* KeyCodecLong = "codec_long_name";
static constexpr const char* KeyFormat = "pix_fmt";
static constexpr const char* KeyWidth = "width";
static constexpr const char* KeyHeight = "height";
static constexpr const char* KeyBitRate = "bit_rate";
static constexpr const char* KeySampleRate = "sample_rate";
static constexpr const char* KeySampleFormat = "sample_fmt";
static constexpr const char* KeyChannelLayout = "channel_layout";
static constexpr const char* KeySampleAspectRatio = "sample_aspect_ratio";
static constexpr const char* KeyDisplayAspectRatio = "display_aspect_ratio";
static constexpr const char* KeyAverageFrameRate = "avg_frame_rate";
static constexpr const char* KeyRealFrameRate = "r_frame_rate";
static constexpr const char* KeyTimeBase = "time_base";
static constexpr const char* KeyCodecTimeBase = "codec_time_base";
static constexpr const char* KeyTags = "tags";
StreamInformation(std::shared_ptr<rapidjson::Value> streamInformationValue);
std::shared_ptr<int64_t> getIndex();
std::shared_ptr<std::string> getType();
std::shared_ptr<std::string> getCodec();
std::shared_ptr<std::string> getCodecLong();
std::shared_ptr<std::string> getFormat();
std::shared_ptr<int64_t> getWidth();
std::shared_ptr<int64_t> getHeight();
std::shared_ptr<std::string> getBitrate();
std::shared_ptr<std::string> getSampleRate();
std::shared_ptr<std::string> getSampleFormat();
std::shared_ptr<std::string> getChannelLayout();
std::shared_ptr<std::string> getSampleAspectRatio();
std::shared_ptr<std::string> getDisplayAspectRatio();
std::shared_ptr<std::string> getAverageFrameRate();
std::shared_ptr<std::string> getRealFrameRate();
std::shared_ptr<std::string> getTimeBase();
std::shared_ptr<std::string> getCodecTimeBase();
std::shared_ptr<rapidjson::Value> getTags();
std::shared_ptr<std::string> getStringProperty(const char* key);
std::shared_ptr<int64_t> getNumberProperty(const char* key);
std::shared_ptr<rapidjson::Value> getProperty(const char* key);
std::shared_ptr<rapidjson::Value> getAllProperties();
private:
std::shared_ptr<rapidjson::Value> _streamInformationValue;
};
}
#endif // FFMPEG_KIT_STREAM_INFORMATION_H
ffmpegkit::StreamInformation
Definition: StreamInformation.h:34
ffmpegkit::StreamInformation::KeyCodecLong
static constexpr const char * KeyCodecLong
Definition: StreamInformation.h:39
ffmpegkit::StreamInformation::KeyTags
static constexpr const char * KeyTags
Definition: StreamInformation.h:53
ffmpegkit::StreamInformation::getType
std::shared_ptr< std::string > getType()
Definition: StreamInformation.cpp:29
ffmpegkit::StreamInformation::getProperty
std::shared_ptr< rapidjson::Value > getProperty(const char *key)
Definition: StreamInformation.cpp:113
ffmpegkit::StreamInformation::getIndex
std::shared_ptr< int64_t > getIndex()
Definition: StreamInformation.cpp:25
ffmpegkit::StreamInformation::getNumberProperty
std::shared_ptr< int64_t > getNumberProperty(const char *key)
Definition: StreamInformation.cpp:105
ffmpegkit::StreamInformation::KeyHeight
static constexpr const char * KeyHeight
Definition: StreamInformation.h:42
ffmpegkit::StreamInformation::KeyCodec
static constexpr const char * KeyCodec
Definition: StreamInformation.h:38
ffmpegkit::StreamInformation::getSampleFormat
std::shared_ptr< std::string > getSampleFormat()
Definition: StreamInformation.cpp:61
ffmpegkit::StreamInformation::KeyDisplayAspectRatio
static constexpr const char * KeyDisplayAspectRatio
Definition: StreamInformation.h:48
ffmpegkit::StreamInformation::getHeight
std::shared_ptr< int64_t > getHeight()
Definition: StreamInformation.cpp:49
ffmpegkit::StreamInformation::getSampleAspectRatio
std::shared_ptr< std::string > getSampleAspectRatio()
Definition: StreamInformation.cpp:69
ffmpegkit::StreamInformation::getTags
std::shared_ptr< rapidjson::Value > getTags()
Definition: StreamInformation.cpp:93
ffmpegkit::StreamInformation::KeyFormat
static constexpr const char * KeyFormat
Definition: StreamInformation.h:40
ffmpegkit::StreamInformation::KeyRealFrameRate
static constexpr const char * KeyRealFrameRate
Definition: StreamInformation.h:50
ffmpegkit::StreamInformation::getSampleRate
std::shared_ptr< std::string > getSampleRate()
Definition: StreamInformation.cpp:57
ffmpegkit::StreamInformation::KeyType
static constexpr const char * KeyType
Definition: StreamInformation.h:37
ffmpegkit::StreamInformation::KeyBitRate
static constexpr const char * KeyBitRate
Definition: StreamInformation.h:43
ffmpegkit::StreamInformation::getStringProperty
std::shared_ptr< std::string > getStringProperty(const char *key)
Definition: StreamInformation.cpp:97
ffmpegkit::StreamInformation::KeySampleRate
static constexpr const char * KeySampleRate
Definition: StreamInformation.h:44
ffmpegkit::StreamInformation::getCodecLong
std::shared_ptr< std::string > getCodecLong()
Definition: StreamInformation.cpp:37
ffmpegkit::StreamInformation::KeyChannelLayout
static constexpr const char * KeyChannelLayout
Definition: StreamInformation.h:46
ffmpegkit::StreamInformation::getDisplayAspectRatio
std::shared_ptr< std::string > getDisplayAspectRatio()
Definition: StreamInformation.cpp:73
ffmpegkit::StreamInformation::KeyIndex
static constexpr const char * KeyIndex
Definition: StreamInformation.h:36
ffmpegkit::StreamInformation::getRealFrameRate
std::shared_ptr< std::string > getRealFrameRate()
Definition: StreamInformation.cpp:81
ffmpegkit::StreamInformation::KeyTimeBase
static constexpr const char * KeyTimeBase
Definition: StreamInformation.h:51
ffmpegkit::StreamInformation::KeySampleFormat
static constexpr const char * KeySampleFormat
Definition: StreamInformation.h:45
ffmpegkit::StreamInformation::getWidth
std::shared_ptr< int64_t > getWidth()
Definition: StreamInformation.cpp:45
ffmpegkit::StreamInformation::getFormat
std::shared_ptr< std::string > getFormat()
Definition: StreamInformation.cpp:41
ffmpegkit::StreamInformation::getTimeBase
std::shared_ptr< std::string > getTimeBase()
Definition: StreamInformation.cpp:85
ffmpegkit::StreamInformation::getAllProperties
std::shared_ptr< rapidjson::Value > getAllProperties()
Definition: StreamInformation.cpp:123
ffmpegkit::StreamInformation::getAverageFrameRate
std::shared_ptr< std::string > getAverageFrameRate()
Definition: StreamInformation.cpp:77
ffmpegkit::StreamInformation::KeyCodecTimeBase
static constexpr const char * KeyCodecTimeBase
Definition: StreamInformation.h:52
ffmpegkit::StreamInformation::KeyWidth
static constexpr const char * KeyWidth
Definition: StreamInformation.h:41
ffmpegkit::StreamInformation::StreamInformation
StreamInformation(std::shared_ptr< rapidjson::Value > streamInformationValue)
Definition: StreamInformation.cpp:22
ffmpegkit::StreamInformation::KeySampleAspectRatio
static constexpr const char * KeySampleAspectRatio
Definition: StreamInformation.h:47
ffmpegkit::StreamInformation::getCodecTimeBase
std::shared_ptr< std::string > getCodecTimeBase()
Definition: StreamInformation.cpp:89
ffmpegkit::StreamInformation::_streamInformationValue
std::shared_ptr< rapidjson::Value > _streamInformationValue
Definition: StreamInformation.h:212
ffmpegkit::StreamInformation::getBitrate
std::shared_ptr< std::string > getBitrate()
Definition: StreamInformation.cpp:53
ffmpegkit::StreamInformation::KeyAverageFrameRate
static constexpr const char * KeyAverageFrameRate
Definition: StreamInformation.h:49
ffmpegkit::StreamInformation::getChannelLayout
std::shared_ptr< std::string > getChannelLayout()
Definition: StreamInformation.cpp:65
ffmpegkit::StreamInformation::getCodec
std::shared_ptr< std::string > getCodec()
Definition: StreamInformation.cpp:33
ffmpegkit
Definition: AbstractSession.h:25