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
29namespace ffmpegkit {
30
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
static constexpr const char * KeyCodecLong
static constexpr const char * KeyTags
std::shared_ptr< std::string > getType()
std::shared_ptr< rapidjson::Value > getProperty(const char *key)
std::shared_ptr< int64_t > getIndex()
std::shared_ptr< int64_t > getNumberProperty(const char *key)
static constexpr const char * KeyHeight
static constexpr const char * KeyCodec
std::shared_ptr< std::string > getSampleFormat()
static constexpr const char * KeyDisplayAspectRatio
std::shared_ptr< int64_t > getHeight()
std::shared_ptr< std::string > getSampleAspectRatio()
std::shared_ptr< rapidjson::Value > getTags()
static constexpr const char * KeyFormat
static constexpr const char * KeyRealFrameRate
std::shared_ptr< std::string > getSampleRate()
static constexpr const char * KeyType
static constexpr const char * KeyBitRate
std::shared_ptr< std::string > getStringProperty(const char *key)
static constexpr const char * KeySampleRate
std::shared_ptr< std::string > getCodecLong()
static constexpr const char * KeyChannelLayout
std::shared_ptr< std::string > getDisplayAspectRatio()
static constexpr const char * KeyIndex
std::shared_ptr< std::string > getRealFrameRate()
static constexpr const char * KeyTimeBase
static constexpr const char * KeySampleFormat
std::shared_ptr< int64_t > getWidth()
std::shared_ptr< std::string > getFormat()
std::shared_ptr< std::string > getTimeBase()
std::shared_ptr< rapidjson::Value > getAllProperties()
std::shared_ptr< std::string > getAverageFrameRate()
static constexpr const char * KeyCodecTimeBase
static constexpr const char * KeyWidth
static constexpr const char * KeySampleAspectRatio
std::shared_ptr< std::string > getCodecTimeBase()
std::shared_ptr< rapidjson::Value > _streamInformationValue
std::shared_ptr< std::string > getBitrate()
static constexpr const char * KeyAverageFrameRate
std::shared_ptr< std::string > getChannelLayout()
std::shared_ptr< std::string > getCodec()