FFmpegfs Fuse Multi Media Filesystem 2.16
ffmpeg_subtitle.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2017-2024 by Norbert Schlia (nschlia@oblivion-software.de)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
17 *
18 * On Debian systems, the complete text of the GNU General Public License
19 * Version 3 can be found in `/usr/share/common-licenses/GPL-3'.
20 */
21
32#ifndef FFMPEG_SUBTITLE_H
33#define FFMPEG_SUBTITLE_H
34
35#pragma once
36
37#include "ffmpeg_utils.h"
38
39#include <memory>
40
41struct AVSubtitle;
42
46class FFmpeg_Subtitle : public std::shared_ptr<AVSubtitle>
47{
48public:
53 explicit FFmpeg_Subtitle(int stream_index = INVALID_STREAM);
57 virtual ~FFmpeg_Subtitle() = default;
62 int res() const;
66 void unref() noexcept;
67
71 operator AVSubtitle*();
75 operator const AVSubtitle*() const;
80 AVSubtitle* operator->();
81
82protected:
87 AVSubtitle* alloc_subtitle();
92 static void delete_subtitle(AVSubtitle *subtitle);
93
94protected:
95 int m_res;
97public:
99};
100
101#endif // FFMPEG_SUBTITLE_H
The FFmpeg_Subtitle class.
FFmpeg_Subtitle(int stream_index=INVALID_STREAM)
Construct FFmpeg_Subtitle object.
int m_stream_idx
Stream index frame belongs to, or -1 (INVALID_STREAM)
void unref() noexcept
Unreference underlying frame. Synonym for shared_ptr::reset().
int m_res
0 if last operation was successful, or negative AVERROR value
static void delete_subtitle(AVSubtitle *subtitle)
Delete a subtitle.
int res() const
Get result of last operation.
AVSubtitle * alloc_subtitle()
Allocate a subtitle.
virtual ~FFmpeg_Subtitle()=default
Destruct FFmpeg_Subtitle object.
Various FFmpegfs utility functions.
#define INVALID_STREAM
Denote an invalid stream.
Definition: ffmpeg_utils.h:77