FFmpegfs Fuse Multi Media Filesystem 2.16
vcdio.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018-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
34#ifndef VCDIO_H
35#define VCDIO_H
36
37#pragma once
38
39#ifdef USE_LIBVCD
40
41#include "fileio.h"
42
45class VcdIO : public FileIO
46{
47public:
51 explicit VcdIO();
57 virtual ~VcdIO();
58
63 virtual VIRTUALTYPE type() const override;
68 virtual size_t bufsize() const override;
69
76 virtual int openio(LPVIRTUALFILE virtualfile) override;
86 virtual size_t readio(void *data, size_t size) override;
91 virtual int error() const override;
97 virtual int64_t duration() const override;
102 virtual size_t size() const override;
107 virtual size_t tell() const override;
122 virtual int seek(int64_t offset, int whence) override;
127 virtual bool eof() const override;
131 virtual void closeio() override;
132
133private:
138 void pvt_close();
139
140protected:
141 FILE * m_fpi;
147 uint64_t m_start_pos;
148 uint64_t m_end_pos;
149};
150#endif // USE_LIBVCD
151
152#endif // VCDIO_H
Base class for I/O.
Definition: fileio.h:260
LPVIRTUALFILE virtualfile()
Get virtual file object.
Definition: fileio.cc:113
Video CD and Super Video CD I/O class.
Definition: vcdio.h:46
virtual ~VcdIO()
Free VcdIO object.
Definition: vcdio.cc:52
bool m_full_title
If true, ignore m_chapter_no and provide full track.
Definition: vcdio.h:143
virtual int seek(int64_t offset, int whence) override
Seek to position in file.
Definition: vcdio.cc:152
virtual size_t size() const override
Get the file size.
Definition: vcdio.cc:129
virtual void closeio() override
Close virtual file.
Definition: vcdio.cc:198
VcdIO()
Create VcdIO object.
Definition: vcdio.cc:41
int m_chapter_no
Chapter number (1..)
Definition: vcdio.h:145
void pvt_close()
Close virtual file. Non-virtual version to be safely called from constructor/destructor.
Definition: vcdio.cc:203
uint64_t m_end_pos
End offset in bytes (not including this byte)
Definition: vcdio.h:148
virtual int openio(LPVIRTUALFILE virtualfile) override
Open a virtual file.
Definition: vcdio.cc:67
FILE * m_fpi
File pointer to source media.
Definition: vcdio.h:141
int m_track_no
Track number (1..)
Definition: vcdio.h:144
virtual int64_t duration() const override
Get the duration of the file, in AV_TIME_BASE fractional seconds.
Definition: vcdio.cc:124
virtual size_t readio(void *data, size_t size) override
Read data from file.
Definition: vcdio.cc:104
uint64_t m_start_pos
Start offset in bytes.
Definition: vcdio.h:147
virtual VIRTUALTYPE type() const override
Get type of the virtual file.
Definition: vcdio.cc:57
virtual bool eof() const override
Check if at end of file.
Definition: vcdio.cc:193
virtual int error() const override
Get last error.
Definition: vcdio.cc:119
virtual size_t bufsize() const override
Get the ideal buffer size.
Definition: vcdio.cc:62
virtual size_t tell() const override
Get current read position.
Definition: vcdio.cc:147
FileIO class.
VIRTUALTYPE
Virtual file types enum.
Definition: fileio.h:92
Virtual file definition.
Definition: fileio.h:123