-
Notifications
You must be signed in to change notification settings - Fork 5
/
dvd_vmg_ifo.h
159 lines (146 loc) · 5.16 KB
/
dvd_vmg_ifo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#ifndef DVD_INFO_VMG_IFO_H
#define DVD_INFO_VMG_IFO_H
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include <stdbool.h>
#include <dvdread/dvd_reader.h>
#include <dvdread/ifo_read.h>
#include "dvd_specs.h"
/**
* Functions used to get basic DVD data:
* - Disc ID (libdvdread)
* - Disc Title
* - # tracks
* - # VTS
* - # Provider ID
* - # VMG ID
*/
/**
* Check if the IFO is a VMG or not.
*
* libdvdread populates the ifo_handle with various data, but the structure is
* the same for both a VMG IFO and a VTS one. This does a few checks to make
* sure that the ifo_handle passed in is a VMG.
*/
bool ifo_is_vmg(ifo_handle_t *ifo);
/**
* Check if the IFO is a VTS or not.
*
* libdvdread populates the ifo_handle with various data, but the structure is
* the same for both a VMG IFO and a VTS one. This does a few checks to make
* sure that the ifo_handle passed in is a Video Title Set.
*/
bool ifo_is_vts(ifo_handle_t *ifo);
/**
* Get the DVD title, which maxes out at a 32-character string.
* All DVDs should have one.
*
* This is the same value as a volume name on an ISO, the string sits outside
* of the encrypted content, so a simple seek to the location reveals the
* contents. In other words, this doesn't depend on libdvdread. However, I
* have had DVD drives that, for some reason or another, will complain if
* the disc has not been decrypted first, so I would recommend decrypting the
* CSS at some point before doing any reads from the data. I could be
* completely wrong about the CSS thing, but lots of anecdotal evidence says
* otherwise. In time, I hope to track down the real issue, but until then,
* the generic suggestion stands. :)
*
* The title is going to be alpha-numeric, all upper-case, up to 32
* characters in length.
*
* These should *not* be considered as unique identifiers for discs.
*
* Some examples:
* - The Nightmare Before Christmas: NIGHTMARE
* - Powerpuff Girls: POWERPUFF_GIRLS_DISC_1
* - Star Trek: Voyager: VOYAGER_S7D1
*
* This whole function is mostly lifted from lsdvd.
*/
bool dvd_title(char *dest_str, const char *device_filename);
/**
* Get a unique identifier of the DVD.
*
* Uses libdvdreads DVDDiscID() function to return an MD5 string of the first
* 10 IFOs on the DVD.
*/
bool dvd_dvdread_id(char *dest_str, dvd_reader_t *dvdread_dvd);
/**
* Get the number of tracks on a DVD
*
* The word 'title' and 'track' are sometimes used interchangeably when talking
* about DVDs. For context, I always use 'track' to mean the actual number of
* distinct tracks on a DVD.
*
* I don't like to use the word 'title' when referencing a track, because one
* video/audio track can have multiple "titles" in the sense of episodes. Fex,
* a Looney Tunes DVD track can have a dozen 7-minute shorts on it, and they
* are all separated by chapter markers.
*
* At the very minimum, there is always going to be 1 track (seems obvious, but
* I want to point that out). At the very *most*, there will be 99 tracks.
* Having 99 is unusual, and if you see it, it generally means that the DVD has
* ARccOS copy-protection on it -- which, historically, has the distinct
* feature of breaking libdvdread and libdvdnav sometimes. 99 tracks is rare.
*
* Movies that have no special features or extra content will have one track.
*
* Some examples of number of tracks on DVDs:
*
* Superman (Warner. Bros): 4
* The Black Cauldron (Walt Disney): 99
* Searching For Bobby Fischer: 4
*/
uint16_t dvd_tracks(ifo_handle_t *vmg_ifo);
/**
* Get the number of VTS on a DVD
*/
uint16_t dvd_video_title_sets(ifo_handle_t *vmg_ifo);
/**
* Get the provider ID
*
* The provider ID is a string that can be up to 32 characters long. In my
* experience, it looks like the content is arbitrarily set -- some DVDs are
* mastered with the value being the studio, some with (what looks to be like)
* the authoring software instead. And then a lot are just numbers, or the
* title of the movie.
*
* Unlike the DVD title, these strings have spaces and both upper and lower
* case letters.
*
* Some examples:
* - Challenge of the Super Friends: WARNER HOME VIDEO
* - Felix the Cat (Disc 1): Giant Interactive
* - The Escape Artist: ESCAPE_ARTIST
* - Pink Panther (cartoons): LASERPACIFIC MEDIA CORPORATION
*
* It's not unusual for this one to be empty as well.
*
* These should *not* be considered as unique identifiers for discs.
*/
bool dvd_provider_id(char *dest_str, ifo_handle_t *vmg_ifo);
/**
* Get the DVD's VMG id
* It's entirely possible, and common, that the string is blank. If it's not
* blank, it is probably 'DVDVIDEO-VMG'.
*/
bool dvd_vmg_id(char *dest_str, ifo_handle_t *vmg_ifo);
/**
* Get the DVD side
*
* Some DVDs will have content burned on two sides -- for example there is
* a widescreen version of the movie one one, and a fullscreen on the other.
*
* I haven't ever checked this before, so I don't know what DVDs are authored
* with. I'm going to simply return 2 if it's set to that, and a 1 otherwise.
*/
uint8_t dvd_info_side(ifo_handle_t *vmg_ifo);
/**
* Get the DVD specifiation version
*
* Example: 1.0
*/
bool dvd_specification_version(char *dest_str, ifo_handle_t *vmg_ifo);
#endif