FFmpegfs Fuse Multi Media Filesystem 2.16
vcdutils.h
Go to the documentation of this file.
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 3 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
15 */
16
28#ifndef VCDUTILS_H
29#define VCDUTILS_H
30
31#pragma once
32
33#include "vcd/vcdchapter.h"
34
35#include <string>
36#include <array>
37
40#define BCD2DEC(hex) (((hex & 0xF0) >> 4) * 10 + (hex & 0x0F))
41
44#define VCD_MAX_CHAPTERS 500
45
46#pragma pack(push, 1)
47
54typedef struct VCDMSF
55{
56 uint8_t m_min;
57 uint8_t m_sec;
58 uint8_t m_frame;
61typedef const VCDMSF * LPCVCDMSF;
65typedef struct VCDCHAPTER
66{
67 uint8_t m_track_no;
71typedef const VCDCHAPTER * LPCVCDCHAPTER;
75typedef struct VCDENTRIES
76{
77 std::array<char, 8> m_ID;
84 uint8_t m_type;
96 uint16_t m_num_entries;
104 std::array<VCDCHAPTER, VCD_MAX_CHAPTERS> m_chapter;
105
106 std::array<uint8_t, 36> reserved;
109typedef const VCDENTRY * LPCVCDENTRIES;
111#pragma pack(pop)
112
113extern const std::array<char, 12> SYNC;
118namespace VCDUTILS
119{
127std::string convert_txt2string(const char * txt, int size, bool trimmed = true);
136bool locate_file(const std::string & path, const std::string & filename, std::string & fullname, bool & is_vcd);
144int locate_video(const std::string & path, int track_no, std::string & fullname);
150std::string get_type_str(VCDTYPE type);
156std::string get_profile_tag_str(VCDPROFILETAG tag);
163void get_directory(const std::string & fullname, std::string * directory);
164}
165
166#endif // VCDUTILS_H
Video CD utility functions.
Definition: vcdutils.cc:40
bool locate_file(const std::string &path, const std::string &filename, std::string &fullname, bool &is_vcd)
Check if path is a S/VCD.
Definition: vcdutils.cc:64
int locate_video(const std::string &path, int track_no, std::string &fullname)
Locate AVSEQ*DAT/MPEG video file for track_no.
Definition: vcdutils.cc:88
std::string convert_txt2string(const char *txt, int size, bool trimmed)
Non-zero terminated text is converted to std::string.
Definition: vcdutils.cc:41
void get_directory(const std::string &fullname, std::string *directory)
Check if fullname is a directory. Remove the filename if necessary.
Definition: vcdutils.cc:151
std::string get_type_str(VCDTYPE type)
Return disk type as a human readable string.
Definition: vcdutils.cc:111
std::string get_profile_tag_str(VCDPROFILETAG tag)
Profile as a human readable string.
Definition: vcdutils.cc:132
Video CD chapter.
Definition: vcdutils.h:66
uint8_t m_track_no
Track number.
Definition: vcdutils.h:67
VCDMSF m_msf
MSF position of chapter in file.
Definition: vcdutils.h:68
Video CD entry.
Definition: vcdutils.h:76
uint16_t m_num_entries
2 Bytes: 1 <= tracks <= 500
Definition: vcdutils.h:96
std::array< VCDCHAPTER, VCD_MAX_CHAPTERS > m_chapter
Chapters.
Definition: vcdutils.h:104
uint8_t m_type
1 Byte: CD type
Definition: vcdutils.h:84
std::array< char, 8 > m_ID
8 Bytes: ID "ENTRYVCD" or "ENTRYSVD"
Definition: vcdutils.h:77
std::array< uint8_t, 36 > reserved
RESERVED, must be 0x00.
Definition: vcdutils.h:106
uint8_t m_profile_tag
1 Byte: System Profile Tag.
Definition: vcdutils.h:91
Video CD MSF time format.
Definition: vcdutils.h:55
uint8_t m_min
Minute in BCD code.
Definition: vcdutils.h:56
uint8_t m_frame
Number of frames, for a 25 frames per second movie 0...24.
Definition: vcdutils.h:58
uint8_t m_sec
Second in BCD code.
Definition: vcdutils.h:57
S/VCD VcdChapter class.
VCDTYPE
Definition: vcdchapter.h:40
VCDPROFILETAG
Definition: vcdchapter.h:50
struct VCDENTRIES * LPVCDENTRIES
Pointer version of VCDENTRY.
const std::array< char, 12 > SYNC
Chapter synchronisation in S/VCD mpeg/dat files (12 byte: 0x00FFFFFFFFFFFFFFFFFFFF00)
Definition: vcdentries.cc:44
struct VCDCHAPTER * LPVCDCHAPTER
Pointer version of VCDCHAPTER.
struct VCDCHAPTER VCDCHAPTER
Video CD chapter.
struct VCDENTRIES VCDENTRY
Video CD entry.
struct VCDMSF * LPVCDMSF
Pointer version of VCDMSF.
const VCDMSF * LPCVCDMSF
Pointer to const version of VCDMSF.
Definition: vcdutils.h:61
const VCDENTRY * LPCVCDENTRIES
Pointer to const version of VCDENTRY.
Definition: vcdutils.h:109
struct VCDMSF VCDMSF
Video CD MSF time format.
const VCDCHAPTER * LPCVCDCHAPTER
Pointer to const version of VCDCHAPTER.
Definition: vcdutils.h:71