View Full Version : I'm looking for vStrip.dll documentation
Atak_Snajpera
23rd November 2008, 23:04
Does anybody know how to access vStrip.dll from Delphi? Simple examples in delphi would be the best.
LoRd_MuldeR
23rd November 2008, 23:46
I got zero knowledge about vStrip.dll, but if you got the C-API then it shouldn't be too hard to convert to Delphi.
In the past I wrote Delphi bindings for Win32 API functions that were not available in Delphi 7.0 Pro. I used the Win32 API documentation for the C language as my reference....
LoRd_MuldeR
24th November 2008, 00:26
According to vstrip.h, I'd start like this:
const
VSV_FORCE_DWORD = -1;
VSV_NONE = 0;
VSV_DECRYPT = 1;
type
TVStrip_VersionFlags = VSV_FORCE_DWORD..VSV_DECRYPT;
PVStrip_VersionFlags = ^TVStrip_VersionFlags;
type
TVStrip_GetVersion = function(flags: PVStrip_VersionFlags):DWORD; cdecl;
function DoSomethingWithVStrip:Boolean;
var
Lib_vStrip: HModule;
VStrip_GetVersion: TVStrip_GetVersion;
Flags: TVStrip_VersionFlags;
Version: DWORD;
begin
Lib_vStrip := SafeLoadLibrary('vStrip.dll');
if Lib_vStrip = 0 then
begin
Result := False;
Exit;
end;
@VStrip_GetVersion = GetProcAddress(Lib_vStrip, 'vs_get_version');
if @VStrip_GetVersion = nil then
begin
Result := False;
Exit;
end;
Flags := VSV_NONE;
Version := VStrip_GetVersion(@Flags);
[...]
Result := True;
end;
Completely untested :D
LoRd_MuldeR
24th November 2008, 03:21
Here you go:
http://www.mediafire.com/file/g4dmmikylu2/vStrip_Delphi.7z
Now it should be relatively easy to write wrappers for all the other functions, just look at the "vstrip.h" file ;)
First of all you may want to load vStrip.dll globally, instead of loading/unloading it for each call...
Atak_Snajpera
25th November 2008, 15:13
Now it should be relatively easy to write wrappers for all the other functions, just look at the "vstrip.h" file
Are you sure that vstrip.h contains all functions
http://pastebin.com/f54207eb6
Sorry but i'm not familiar with C.
BTW. BIG THANKS FOR EVERYTHING.
PS. I want to create simple command line tool for chapters extraction (ifo2chapters). I'm not happy with ChapterXtractor because it always opens form for split second...
LoRd_MuldeR
25th November 2008, 17:19
Yes, the C language uses "header files" (*.h) to make functions available from outside a module.
Even if you want to use a function implemented in one .c module in another .c module of the same program, you need to export that function via .h file first.
So I'm pretty sure that all the functions exported from the vStrip.dll (the functions accessible to other programs) are declared in the vstrip.h file.
At least if some function is exported, it must be declared in some .h file somewhere. So the .h files are your friends here...
(I may be mistaken, I'm a C newbie ^^)
Kurtnoise
26th November 2008, 10:19
there is a delphi gui using this lib in the d9 download sources page...
bolide
27th November 2008, 20:28
Kurtnoise13, true.
(*************************************************************************
vStrip: Unit for vStrip-DLL Interface
Copyright (C) 2001 [maven] (maven@maven.de)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*************************************************************************)
unit vStrip;
interface
uses
SysUtils, Windows, ComCtrls;
const
vs_DllName = 'vStrip.dll';
inb_MAX_OUTPUT = 8;
fio_BUFFER_SIZE = 65536;
fio_SECTOR_SIZE = 2048;
DVD_TIME_AND = $3f;
vso_APPEND = 1;
vso_SPLIT_VOBID = 2;
vso_SPLIT_CELLID = 4;
vso_DEMUX = 8;
vso_KEEP_AC3_IDENT_BYTES = 16;
vso_KEEP_PCM_IDENT_BYTES = 32;
vso_ONLY_KEEP_GOPS = 64;
vs_PRINT_SUMMARY = 1;
vs_PRINT_INFO = 2;
vs_PRINT_ERROR = 4;
vs_IGNORE_UNKNOWN_CELLS = 8;
vs_NO_VOB = 16;
vs_USE_ASPI = 32;
vs_DEMACRO = 64;
vs_PREFER_ASPI = 128;
vs_SUPPORT_1GB = 256;
{$IFDEF vs_DECRYPT}
vs_DONT_CRACK = 512;
vs_CRACK_EACH_VOB_ID = 1024;
vs_CRACK_EACH_CELL_ID = 2048;
{$ENDIF}
vsv_NONE = 0;
vsv_DECRYPT = 1;
udf_MAX_NAMELEN = 256;
fio_APPEND = 1;
fio_WRITEABLE = 2;
fio_USE_ASPI = 4;
fio_PREFER_ASPI = 8;
fio_SUPPORT_1GB = 16;
type
t_vs_streaminfo = packed record
stream_id : Cardinal;
substream_id : Cardinal;
vob_id : Cardinal;
cell_id : Cardinal;
lba : Cardinal;
idx : Cardinal;
length : Cardinal;
encrypted : Boolean;
end;
t_vs_streamflags = packed record
user_func : Cardinal; // ignore
user_data : Cardinal; // ignore
packets : Cardinal;
bytes : Cardinal;
pts : Double;
remap_to : Byte;
save : Byte; // bits 0-7 for each output file
found : Boolean;
end;
tp_vs_streamflags = ^t_vs_streamflags;
ta_vs_streamflags = array[0..255] of t_vs_streamflags;
tpa_vs_streamflags = ^ta_vs_streamflags;
t_inb_buffer = packed record
infp : Cardinal;
outfp : array[0..inb_MAX_OUTPUT - 1] of Cardinal;
bytes : ^Byte;
idx : Cardinal;
num_bytes : Cardinal;
buffer_size : Cardinal;
lba : Cardinal;
encrypted : Boolean;
has_system : Boolean;
is_vob : Boolean;
even : Boolean;
save : Byte;
// inb_status
end;
tp_inb_buffer = ^t_inb_buffer;
t_vs_internal_data = packed record
outfileprep : array[0..inb_MAX_OUTPUT - 1, 0..255] of Char;
outfileext : array[0..inb_MAX_OUTPUT - 1, 0..255] of Char;
buffer : tp_inb_buffer;
sti : t_vs_streaminfo;
cur_stream : tp_vs_streamflags;
framerate : Cardinal;
aspectratio : Cardinal;
pack_packets : Cardinal;
system_packets : Cardinal;
opened : Cardinal;
only_gop_mask : Byte;
did_video_info : Boolean;
save_cell : Boolean;
init_ok : Boolean;
{$IFDEF vs_DECRYPT}
valid_key : Boolean;
vob_key : Boolean;
cell_key : Boolean;
{$ENDIF}
end;
t_vs_output_data = packed record
outfile : array[0..255] of Char;
split_output : Cardinal;
flags : Cardinal;
end;
t_vs_data = packed record
infile : PChar;
num_outputs : Cardinal;
outputs : array[0..inb_MAX_OUTPUT - 1] of t_vs_output_data;
framerate : Cardinal;
aspectratio : Cardinal;
max_sync_bytes : Cardinal;
start_lba : Cardinal;
end_lba : Cardinal;
flags : Cardinal;
{$IFDEF vs_DECRYPT}
same_guess : Cardinal;
pad_guess : Cardinal;
pc_guess : Cardinal;
key : array[0..4] of Byte;
{$ENDIF}
_in : t_vs_internal_data;
end;
tp_vs_data = ^t_vs_data;
t_vs_vobcellid = packed record
start_lba, end_lba: Cardinal;
vob_id : Word;
cell_id : Byte;
angle : Byte;
chapter : Byte;
time : array[0..3] of Byte;
end;
tp_vs_vobcellid = ^t_vs_vobcellid;
TAVobCellID = array[0..65535] of t_vs_vobcellid;
TPAVobCellID = ^TAVobCellID;
t_vs_time = array[0..3] of Byte; //hh.mm.ss.ms
t_vs_errorcode = (vse_OK, vse_DONE, vse_USER_FUNC_EXIT, vse_INIT_FAILED, vse_CANT_OPEN_INPUT,
vse_CANT_CREATE_OUTPUT, vse_CANT_WRITE_OUTPUT, vse_CANT_CRACK, vse_LOST_SYNC);
t_udf_file = packed record
name : array[0..udf_MAX_NAMELEN - 1] of Char;
is_dir : Boolean;
is_parent : Boolean;
// other stuff
end;
tp_udf_file = ^t_udf_file;
var
aspi_ok: Boolean;
function vs_get_version(var flags: Cardinal): Cardinal; cdecl; external vs_DllName;
function vs_get_author(): PChar; cdecl; external vs_DllName;
function vs_init(var vsd: t_vs_data; var streams: ta_vs_streamflags; var substreams: ta_vs_streamflags): t_vs_errorcode;
cdecl; external vs_DllName;
function vs_done(var vsd: t_vs_data; var streams: ta_vs_streamflags; var substreams: ta_vs_streamflags): t_vs_errorcode;
cdecl; external vs_DllName;
function vs_strip_one_block(var vsd: t_vs_data; var streams: ta_vs_streamflags; var substreams: ta_vs_streamflags;
num_idl: Cardinal; idl: tp_vs_vobcellid): t_vs_errorcode; cdecl; external vs_DllName;
function vs_get_time(const time: double): PChar; cdecl; external vs_DllName;
function ifoOpen(const name: PChar; const fio_flags: Cardinal): Cardinal; cdecl; external vs_DllName;
function ifoClose(const ifo: Cardinal): Boolean; cdecl; external vs_DllName;
function ifoGetNumPGCI(const ifo: Cardinal): Integer; cdecl; external vs_DllName;
function ifoGetPGCIInfo(const ifo: Cardinal; const title: Cardinal; var time_out: t_vs_time): Integer; cdecl; external vs_DllName;
function ifoGetPGCICells(const ifo: Cardinal; const title: Cardinal; cells: tp_vs_vobcellid): Boolean; cdecl; external vs_DllName;
function ifoGetVideoDesc(const ifo: Cardinal): PChar; cdecl; external vs_DllName;
function ifoGetNumAudio(const ifo: Cardinal): Integer; cdecl; external vs_DllName;
function ifoGetAudioDesc(const ifo: Cardinal; audio_idx: Integer): PChar; cdecl; external vs_DllName;
function ifoGetNumSubPic(const ifo: Cardinal): Integer; cdecl; external vs_DllName;
function ifoGetSubPicDesc(const ifo: Cardinal; subp_idx: Integer): PChar; cdecl; external vs_DllName;
function aspi_Init(): Boolean; cdecl; external vs_DllName;
procedure aspi_Done(); cdecl; external vs_DllName;
function aspi_GetDriveAddress(drive_letter: Char; var address: Cardinal): Boolean; cdecl; external vs_DllName;
function aspi_GetSectorInfo(const address: Cardinal; var secSize, maxSec: Cardinal): Boolean; cdecl; external vs_DllName;
function aspi_SetTimeout(Const address, seconds: Cardinal): Boolean; cdecl; external vs_DllName;
function udf_get_root(const address: Cardinal; const partition_number: Word; const support_1gb: Boolean): tp_udf_file; cdecl; external vs_DllName;
function udf_get_next(const address: Cardinal; f: tp_udf_file): tp_udf_file; cdecl; external vs_DllName;
function udf_get_sub(const address: Cardinal; f: tp_udf_file): tp_udf_file; cdecl; external vs_DllName;
function udf_get_lba(const address: Cardinal; const f: tp_udf_file; var start_lba, end_lba: Cardinal): Boolean; cdecl; external vs_DllName;
procedure udf_free(f: tp_udf_file); cdecl; external vs_DllName;
function udf_find_file(const address: Cardinal; const partition_number: Word; const support_1gb: Boolean; const name: PChar): tp_udf_file; cdecl; external vs_DllName;
function uGetSize(Name: String): Cardinal;
function uFileExists(Name: String): Boolean;
function CreateStreamList(ListView: TListView; var total_lba: Int64): PChar;
implementation
function uGetSize(Name: String): Cardinal;
var
i: Integer;
address, slba, elba: Cardinal;
f: tp_udf_file;
begin
i := FileOpen(Name, fmOpenRead or fmShareDenyNone);
if (i <> -1) then begin
Result := GetFileSize(i, nil);
FileClose(i);
end else
Result := 0;
if ((Result = 0) and aspi_ok and aspi_GetDriveAddress(Name[1], address)) then begin
f := udf_find_file(address, 0, True, PChar(Copy(Name, 3, Length(Name) - 2)));
if (f <> Nil) then begin
if (udf_get_lba(address, f, slba, elba)) then
Result := (elba - slba + 1) shl 11;
udf_free(f);
end;
end;
end;
function uFileExists(Name: String): Boolean;
var
address: Cardinal;
f: tp_udf_file;
begin
Result := FileExists(Name);
if (not Result and aspi_ok and aspi_GetDriveAddress(Name[1], address)) then begin
f := udf_find_file(address, 0, False, PChar(Copy(Name, 3, Length(Name) - 2)));
if (f <> Nil) then begin
Result := True;
udf_free(f);
end;
end;
end;
function CreateStreamList(ListView: TListView; var total_lba: Int64): PChar;
var
i, j: Integer;
s: String;
list: PChar;
begin
Result := nil;
if (ListView.Items.Count > 0) then begin
s := ':';
total_lba := 0;
for i := 0 to ListView.Items.Count - 1 do begin
s := s + ListView.Items[i].Caption + #0;
Inc(total_lba, uGetSize(ListView.Items[i].Caption) shr 11)
end;
s := s + #0;
j := Length(s);
GetMem(list, j);
for i := 0 to j - 1 do
list[i] := s[i + 1];
Result := list;
end;
end;
initialization
aspi_ok := aspi_Init();
finalization
if (aspi_ok) then
aspi_Done();
end.
Emp3r0r
28th November 2008, 07:04
Please see ChapterGrabber in the alternative format forum. I have source code that does what you need.
Atak_Snajpera
28th November 2008, 10:15
Thanks. Does your app support command line. Why your app requires .net 3.5?
LoRd_MuldeR
30th November 2008, 04:11
Why your app requires .net 3.5?
It was developed with Delphi 8 or newer, I guess. Delphi 7, the one I use, was the last one for "native" Win32 development. Delphi 8 is for Microsoft.NET Framework only.
However starting with Delphi 2005 they combined both, native Win32 and .NET development, in one Delphi IDE...
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.