FFmpegKit Linux API 6.0
Loading...
Searching...
No Matches
Chapter.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_CHAPTER_H
21#define FFMPEG_KIT_CHAPTER_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 <iostream>
28#include <memory>
29
30namespace ffmpegkit {
31
35 class Chapter {
36 public:
37 static constexpr const char* KeyId = "id";
38 static constexpr const char* KeyTimeBase = "time_base";
39 static constexpr const char* KeyStart = "start";
40 static constexpr const char* KeyStartTime = "start_time";
41 static constexpr const char* KeyEnd = "end";
42 static constexpr const char* KeyEndTime = "end_time";
43 static constexpr const char* KeyTags = "tags";
44
45 Chapter(std::shared_ptr<rapidjson::Value> chapterValue);
46
47 std::shared_ptr<int64_t> getId();
48
49 std::shared_ptr<std::string> getTimeBase();
50
51 std::shared_ptr<int64_t> getStart();
52
53 std::shared_ptr<std::string> getStartTime();
54
55 std::shared_ptr<int64_t> getEnd();
56
57 std::shared_ptr<std::string> getEndTime();
58
59 std::shared_ptr<rapidjson::Value> getTags();
60
66 std::shared_ptr<std::string> getStringProperty(const char* key);
67
73 std::shared_ptr<int64_t> getNumberProperty(const char* key);
74
80 std::shared_ptr<rapidjson::Value> getProperty(const char* key);
81
87 std::shared_ptr<rapidjson::Value> getAllProperties();
88
89 private:
90 std::shared_ptr<rapidjson::Value> _chapterValue;
91 };
92
93}
94
95#endif // FFMPEG_KIT_CHAPTER_H
static constexpr const char * KeyEnd
Definition Chapter.h:41
std::shared_ptr< rapidjson::Value > getProperty(const char *key)
Definition Chapter.cpp:69
std::shared_ptr< std::string > getStartTime()
Definition Chapter.cpp:37
std::shared_ptr< int64_t > getNumberProperty(const char *key)
Definition Chapter.cpp:61
static constexpr const char * KeyStartTime
Definition Chapter.h:40
std::shared_ptr< rapidjson::Value > getAllProperties()
Definition Chapter.cpp:79
static constexpr const char * KeyId
Definition Chapter.h:37
std::shared_ptr< int64_t > getStart()
Definition Chapter.cpp:33
static constexpr const char * KeyTags
Definition Chapter.h:43
static constexpr const char * KeyStart
Definition Chapter.h:39
std::shared_ptr< int64_t > getEnd()
Definition Chapter.cpp:41
std::shared_ptr< rapidjson::Value > _chapterValue
Definition Chapter.h:90
std::shared_ptr< std::string > getEndTime()
Definition Chapter.cpp:45
static constexpr const char * KeyEndTime
Definition Chapter.h:42
static constexpr const char * KeyTimeBase
Definition Chapter.h:38
std::shared_ptr< int64_t > getId()
Definition Chapter.cpp:25
std::shared_ptr< std::string > getStringProperty(const char *key)
Definition Chapter.cpp:53
std::shared_ptr< std::string > getTimeBase()
Definition Chapter.cpp:29
std::shared_ptr< rapidjson::Value > getTags()
Definition Chapter.cpp:49