00001 /* $Id: dvdid2.h 1743 2009-03-21 20:04:26Z chris $ */ 00002 00003 #ifndef DVDID__DVDID2_H 00004 #define DVDID__DVDID2_H 00005 00006 #include <stdint.h> 00007 00008 00009 #include "export.h" 00010 00011 00012 #include "dvdid.h" 00013 00014 00015 #ifdef __cplusplus 00016 extern "C" { 00017 #endif 00018 00019 00020 typedef struct dvdid_hashinfo_s dvdid_hashinfo_t; 00021 typedef struct dvdid_fileinfo_s dvdid_fileinfo_t; 00022 00023 00024 struct dvdid_fileinfo_s { 00025 uint64_t creation_time; /* creation time as a Win32 FILETIME */ 00026 uint32_t size; /* lowest 32bits of file size */ 00027 char *name; /* filename */ 00028 }; 00029 00030 00031 DVDID_API(dvdid_status_t) dvdid_calculate2(uint64_t *dvdid, const dvdid_hashinfo_t *hi); 00032 00033 /* Create a hashinfo struct. Returns non-zero on error */ 00034 DVDID_API(dvdid_status_t) dvdid_hashinfo_create(dvdid_hashinfo_t **hi); 00035 00036 /* Add a file to the hashinfo struct. The fileinfo will be copied, 00037 and memory allocated as appropriate. Returns non-zero on error, in 00038 which case dvdid_hashinfo_free must be called on the hashinfo struct 00039 as it's not guaranteed to be useable */ 00040 DVDID_API(dvdid_status_t) dvdid_hashinfo_addfile(dvdid_hashinfo_t *hi, const dvdid_fileinfo_t *fi); 00041 00042 /* Sets the pointer to the data read from VIDEO_TS.IFO. This buffer 00043 will be copied, so does not need to be valid until dvd_hashinfo_free is 00044 called */ 00045 /* We need at most the first DVDID_HASHINFO_VXXI_MAXBUF bytes of the file */ 00046 #define DVDID_HASHINFO_VXXI_MAXBUF 0x10000 00047 DVDID_API(dvdid_status_t) dvdid_hashinfo_set_vmgi(dvdid_hashinfo_t *hi, const uint8_t *buf, size_t size); 00048 00049 /* As above for VTS_01_0.IFO */ 00050 DVDID_API(dvdid_status_t) dvdid_hashinfo_set_vts01i(dvdid_hashinfo_t *hi, const uint8_t *buf, size_t size); 00051 00052 /* Having added the necessary files and set pointers to the necessary buffers, 00053 perform any additional init work before dvdid_calculate2 gets called */ 00054 DVDID_API(dvdid_status_t) dvdid_hashinfo_init(dvdid_hashinfo_t *hi); 00055 00056 /* Free hashinfo struct one finished with */ 00057 DVDID_API(void) dvdid_hashinfo_free(dvdid_hashinfo_t *hi); 00058 00059 00060 #ifdef __cplusplus 00061 } 00062 #endif 00063 00064 00065 #endif