| 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
28 namespace ffmpegkit {
29
33 class MediaInformation {
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
Chapter.h
StreamInformation.h
ffmpegkit::MediaInformation
Definition MediaInformation.h:33
ffmpegkit::MediaInformation::getProperty
std::shared_ptr< rapidjson::Value > getProperty(const char *key)
Definition MediaInformation.cpp:91
ffmpegkit::MediaInformation::getDuration
std::shared_ptr< std::string > getDuration()
Definition MediaInformation.cpp:42
ffmpegkit::MediaInformation::getBitrate
std::shared_ptr< std::string > getBitrate()
Definition MediaInformation.cpp:50
ffmpegkit::MediaInformation::KeySize
static constexpr const char * KeySize
Definition MediaInformation.h:41
ffmpegkit::MediaInformation::getFormatProperties
std::shared_ptr< rapidjson::Value > getFormatProperties()
Definition MediaInformation.cpp:131
ffmpegkit::MediaInformation::getStartTime
std::shared_ptr< std::string > getStartTime()
Definition MediaInformation.cpp:38
ffmpegkit::MediaInformation::getStreams
std::shared_ptr< std::vector< std::shared_ptr< ffmpegkit::StreamInformation > > > getStreams()
Definition MediaInformation.cpp:65
ffmpegkit::MediaInformation::getFormatProperty
std::shared_ptr< rapidjson::Value > getFormatProperty(const char *key)
Definition MediaInformation.cpp:120
ffmpegkit::MediaInformation::getNumberFormatProperty
std::shared_ptr< int64_t > getNumberFormatProperty(const char *key)
Definition MediaInformation.cpp:111
ffmpegkit::MediaInformation::getLongFormat
std::shared_ptr< std::string > getLongFormat()
Definition MediaInformation.cpp:34
ffmpegkit::MediaInformation::KeyDuration
static constexpr const char * KeyDuration
Definition MediaInformation.h:40
ffmpegkit::MediaInformation::KeyBitRate
static constexpr const char * KeyBitRate
Definition MediaInformation.h:42
ffmpegkit::MediaInformation::getSize
std::shared_ptr< std::string > getSize()
Definition MediaInformation.cpp:46
ffmpegkit::MediaInformation::KeyFilename
static constexpr const char * KeyFilename
Definition MediaInformation.h:36
ffmpegkit::MediaInformation::getChapters
std::shared_ptr< std::vector< std::shared_ptr< ffmpegkit::Chapter > > > getChapters()
Definition MediaInformation.cpp:69
ffmpegkit::MediaInformation::getStringProperty
std::shared_ptr< std::string > getStringProperty(const char *key)
Definition MediaInformation.cpp:73
ffmpegkit::MediaInformation::KeyFormatLong
static constexpr const char * KeyFormatLong
Definition MediaInformation.h:38
ffmpegkit::MediaInformation::getAllProperties
std::shared_ptr< rapidjson::Value > getAllProperties()
Definition MediaInformation.cpp:141
ffmpegkit::MediaInformation::KeyFormat
static constexpr const char * KeyFormat
Definition MediaInformation.h:37
ffmpegkit::MediaInformation::getStringFormatProperty
std::shared_ptr< std::string > getStringFormatProperty(const char *key)
Definition MediaInformation.cpp:102
ffmpegkit::MediaInformation::getFormat
std::shared_ptr< std::string > getFormat()
Definition MediaInformation.cpp:30
ffmpegkit::MediaInformation::getNumberProperty
std::shared_ptr< int64_t > getNumberProperty(const char *key)
Definition MediaInformation.cpp:82
ffmpegkit::MediaInformation::getFilename
std::shared_ptr< std::string > getFilename()
Definition MediaInformation.cpp:26
ffmpegkit::MediaInformation::KeyFormatProperties
static constexpr const char * KeyFormatProperties
Definition MediaInformation.h:35
ffmpegkit::MediaInformation::KeyStartTime
static constexpr const char * KeyStartTime
Definition MediaInformation.h:39
ffmpegkit::MediaInformation::getTags
std::shared_ptr< rapidjson::Value > getTags()
Definition MediaInformation.cpp:54
ffmpegkit::MediaInformation::KeyTags
static constexpr const char * KeyTags
Definition MediaInformation.h:43
ffmpegkit::MediaInformation::_streams
std::shared_ptr< std::vector< std::shared_ptr< ffmpegkit::StreamInformation > > > _streams
Definition MediaInformation.h:175
ffmpegkit::MediaInformation::_mediaInformationValue
std::shared_ptr< rapidjson::Value > _mediaInformationValue
Definition MediaInformation.h:174
ffmpegkit::MediaInformation::_chapters
std::shared_ptr< std::vector< std::shared_ptr< ffmpegkit::Chapter > > > _chapters
Definition MediaInformation.h:176
ffmpegkit
Definition AbstractSession.h:25