| FFmpegKit Linux API 6.0

Loading...
Searching...
No Matches
StreamInformation.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Taner Sener
3 *
4 * This file is part of FFmpegKit.
5 *
6 * FFmpegKit is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * FFmpegKit is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with FFmpegKit. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef FFMPEG_KIT_STREAM_INFORMATION_H
21#define FFMPEG_KIT_STREAM_INFORMATION_H
22
23// OVERRIDING THE MACRO TO PREVENT APPLICATION TERMINATION
24#define RAPIDJSON_ASSERT(x)
25#include "rapidjson/document.h"
26#include <string>
27#include <memory>
28
29 namespace ffmpegkit {
30
34 class StreamInformation {
35 public:
36 static constexpr const char* KeyIndex = "index";
37 static constexpr const char* KeyType = "codec_type";
38 static constexpr const char* KeyCodec = "codec_name";
39 static constexpr const char* KeyCodecLong = "codec_long_name";
40 static constexpr const char* KeyFormat = "pix_fmt";
41 static constexpr const char* KeyWidth = "width";
42 static constexpr const char* KeyHeight = "height";
43 static constexpr const char* KeyBitRate = "bit_rate";
44 static constexpr const char* KeySampleRate = "sample_rate";
45 static constexpr const char* KeySampleFormat = "sample_fmt";
46 static constexpr const char* KeyChannelLayout = "channel_layout";
47 static constexpr const char* KeySampleAspectRatio = "sample_aspect_ratio";
48 static constexpr const char* KeyDisplayAspectRatio = "display_aspect_ratio";
49 static constexpr const char* KeyAverageFrameRate = "avg_frame_rate";
50 static constexpr const char* KeyRealFrameRate = "r_frame_rate";
51 static constexpr const char* KeyTimeBase = "time_base";
52 static constexpr const char* KeyCodecTimeBase = "codec_time_base";
53 static constexpr const char* KeyTags = "tags";
54
55 StreamInformation(std::shared_ptr<rapidjson::Value> streamInformationValue);
56
62 std::shared_ptr<int64_t> getIndex();
63
69 std::shared_ptr<std::string> getType();
70
76 std::shared_ptr<std::string> getCodec();
77
83 std::shared_ptr<std::string> getCodecLong();
84
90 std::shared_ptr<std::string> getFormat();
91
97 std::shared_ptr<int64_t> getWidth();
98
104 std::shared_ptr<int64_t> getHeight();
105
111 std::shared_ptr<std::string> getBitrate();
112
118 std::shared_ptr<std::string> getSampleRate();
119
125 std::shared_ptr<std::string> getSampleFormat();
126
132 std::shared_ptr<std::string> getChannelLayout();
133
139 std::shared_ptr<std::string> getSampleAspectRatio();
140
146 std::shared_ptr<std::string> getDisplayAspectRatio();
147
153 std::shared_ptr<std::string> getAverageFrameRate();
154
160 std::shared_ptr<std::string> getRealFrameRate();
161
167 std::shared_ptr<std::string> getTimeBase();
168
174 std::shared_ptr<std::string> getCodecTimeBase();
175
181 std::shared_ptr<rapidjson::Value> getTags();
182
188 std::shared_ptr<std::string> getStringProperty(const char* key);
189
195 std::shared_ptr<int64_t> getNumberProperty(const char* key);
196
202 std::shared_ptr<rapidjson::Value> getProperty(const char* key);
203
209 std::shared_ptr<rapidjson::Value> getAllProperties();
210
211 private:
212 std::shared_ptr<rapidjson::Value> _streamInformationValue;
213 };
214
215}
216
217#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::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