FFmpegKit Linux API 6.0
Loading...
Searching...
No Matches
MediaInformation.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_MEDIA_INFORMATION_H
21#define FFMPEG_KIT_MEDIA_INFORMATION_H
22
23#include "Chapter.h"
24#include "StreamInformation.h"
25#include <memory>
26#include <vector>
27
28namespace ffmpegkit {
29
34 public:
35 static constexpr const char* KeyFormatProperties = "format";
36 static constexpr const char* KeyFilename = "filename";
37 static constexpr const char* KeyFormat = "format_name";
38 static constexpr const char* KeyFormatLong = "format_long_name";
39 static constexpr const char* KeyStartTime = "start_time";
40 static constexpr const char* KeyDuration = "duration";
41 static constexpr const char* KeySize = "size";
42 static constexpr const char* KeyBitRate = "bit_rate";
43 static constexpr const char* KeyTags = "tags";
44
45 MediaInformation(std::shared_ptr<rapidjson::Value> mediaInformationValue, std::shared_ptr<std::vector<std::shared_ptr<ffmpegkit::StreamInformation>>> streams, std::shared_ptr<std::vector<std::shared_ptr<ffmpegkit::Chapter>>> chapters);
46
52 std::shared_ptr<std::string> getFilename();
53
59 std::shared_ptr<std::string> getFormat();
60
66 std::shared_ptr<std::string> getLongFormat();
67
73 std::shared_ptr<std::string> getDuration();
74
80 std::shared_ptr<std::string> getStartTime();
81
87 std::shared_ptr<std::string> getSize();
88
94 std::shared_ptr<std::string> getBitrate();
95
101 std::shared_ptr<rapidjson::Value> getTags();
102
108 std::shared_ptr<std::vector<std::shared_ptr<ffmpegkit::StreamInformation>>> getStreams();
109
115 std::shared_ptr<std::vector<std::shared_ptr<ffmpegkit::Chapter>>> getChapters();
116
122 std::shared_ptr<std::string> getStringProperty(const char* key);
123
129 std::shared_ptr<int64_t> getNumberProperty(const char* key);
130
136 std::shared_ptr<rapidjson::Value> getProperty(const char* key);
137
143 std::shared_ptr<std::string> getStringFormatProperty(const char* key);
144
150 std::shared_ptr<int64_t> getNumberFormatProperty(const char* key);
151
157 std::shared_ptr<rapidjson::Value> getFormatProperty(const char* key);
158
164 std::shared_ptr<rapidjson::Value> getFormatProperties();
165
171 std::shared_ptr<rapidjson::Value> getAllProperties();
172
173 private:
174 std::shared_ptr<rapidjson::Value> _mediaInformationValue;
175 std::shared_ptr<std::vector<std::shared_ptr<ffmpegkit::StreamInformation>>> _streams;
176 std::shared_ptr<std::vector<std::shared_ptr<ffmpegkit::Chapter>>> _chapters;
177 };
178
179}
180
181#endif // FFMPEG_KIT_MEDIA_INFORMATION_H
std::shared_ptr< rapidjson::Value > getProperty(const char *key)
std::shared_ptr< std::string > getDuration()
std::shared_ptr< std::string > getBitrate()
static constexpr const char * KeySize
std::shared_ptr< rapidjson::Value > getFormatProperties()
std::shared_ptr< std::string > getStartTime()
std::shared_ptr< std::vector< std::shared_ptr< ffmpegkit::StreamInformation > > > getStreams()
std::shared_ptr< rapidjson::Value > getFormatProperty(const char *key)
std::shared_ptr< int64_t > getNumberFormatProperty(const char *key)
std::shared_ptr< std::string > getLongFormat()
static constexpr const char * KeyDuration
static constexpr const char * KeyBitRate
std::shared_ptr< std::string > getSize()
static constexpr const char * KeyFilename
std::shared_ptr< std::vector< std::shared_ptr< ffmpegkit::Chapter > > > getChapters()
std::shared_ptr< std::string > getStringProperty(const char *key)
static constexpr const char * KeyFormatLong
std::shared_ptr< rapidjson::Value > getAllProperties()
static constexpr const char * KeyFormat
std::shared_ptr< std::string > getStringFormatProperty(const char *key)
std::shared_ptr< std::string > getFormat()
std::shared_ptr< int64_t > getNumberProperty(const char *key)
std::shared_ptr< std::string > getFilename()
static constexpr const char * KeyFormatProperties
static constexpr const char * KeyStartTime
std::shared_ptr< rapidjson::Value > getTags()
static constexpr const char * KeyTags
std::shared_ptr< std::vector< std::shared_ptr< ffmpegkit::StreamInformation > > > _streams
std::shared_ptr< rapidjson::Value > _mediaInformationValue
std::shared_ptr< std::vector< std::shared_ptr< ffmpegkit::Chapter > > > _chapters