Log in

View Full Version : vstrip.dll from VB.net


nkarnold
1st December 2005, 00:18
Sort of worked out some functions, but one is not working properly. any comments or help appreciated.

The one im having problems with is ifoGetPGCICells
as it passes a structure down Byref, which holds the chapter, start_lba etc.
the value's I get back are just rubbish, so i suspect something is getting overwritten or my understanding of that call is all wrong.


Here are the definitions ive processed so for

Public Declare Function ifoOpen Lib "C:\temp\vstrip.dll" (ByVal v_Filename As String, ByVal v_Flags As Integer) As Integer
Public Declare Function ifoClose Lib "C:\temp\vstrip.dll" (ByVal v_IFO_handle As Integer) As Boolean

Public Declare Function ifoGetVideoDesc Lib "C:\temp\vstrip.dll" (ByVal v_IFO_handle As Integer) As String
Public Declare Function ifoGetNumAudio Lib "C:\temp\vstrip.dll" (ByVal v_IFO_handle As Integer) As Integer
Public Declare Function ifoGetNumSubPic Lib "C:\temp\vstrip.dll" (ByVal v_IFO_handle As Integer) As Integer

Public Declare Function ifoGetAudioDesc Lib "C:\temp\vstrip.dll" (ByVal v_IFO_handle As Integer, ByVal v_Ptr As Integer) As String
Public Declare Function ifoGetSubPicDesc Lib "C:\temp\vstrip.dll" (ByVal v_IFO_handle As Integer, ByVal v_Ptr As Integer) As String
Public Declare Function ifoGetNumPGCI Lib "C:\temp\vstrip.dll" (ByVal v_IFO_handle As Integer) As Integer
Public Declare Function ifoGetPGCIInfo Lib "C:\temp\vstrip.dll" (ByVal v_IFO_handle As Integer, ByVal v_ptr As Integer, ByRef v_len As TitleTime) As Integer
Public Declare Function ifoGetPGCICells Lib "C:\temp\vstrip.dll" (ByVal v_IFO_handle As Integer, ByVal v_ptr As Integer, ByRef v_cells As t_vs_vobcellid) As Boolean


Public Structure TIFOProgramChain
Dim NumCells As Integer
Dim Length As Double
Dim Cells As t_vs_vobcellid
End Structure

Public Structure TitleTime
Dim s1 As Byte
Dim s2 As Byte
Dim s3 As Byte
Dim s4 As Byte
End Structure

Public Structure t_vs_vobcellid
Dim start_lba, end_lba As Integer
Dim vob_id As Integer
Dim cell_id As Byte
Dim angle As Byte
Dim chapter As Byte
Dim time As TitleTime
End Structure

-------------------------------- Code on form ------------------

filename = "E:\VIDEO_TS\VTS_01_0.IFO"
ifo_hnd = ifoOpen(filename, 0) ' nka - check what flags are
lblDVD.Text = ifoGetVideoDesc(ifo_hnd)

For i = 0 To ifoGetNumAudio(ifo_hnd)
If ifoGetAudioDesc(ifo_hnd, i) <> "" Then
ListBox1.Items.Add(ifoGetAudioDesc(ifo_hnd, i))
End If
Next

For i = 0 To ifoGetNumSubPic(ifo_hnd)
If ifoGetSubPicDesc(ifo_hnd, i) <> "" Then
ListBox2.Items.Add(ifoGetSubPicDesc(ifo_hnd, i))
End If
Next

For i = 0 To numIFOchains - 1
numCells = ifoGetPGCIInfo(ifo_hnd, i, sLen)
tottime = Format$(sLen.s1, "##00") & ":" & Format$(sLen.s2, "##00") & ":" & Format$(sLen.s3, "##00") & ":" & Format$(sLen.s4, "##00")
txt = Str(i) & "." & "Length: " & tottime & " in " & Trim(Str(numCells)) & " cell(s)"
TreeView1.Nodes.Add(txt)

------- at this point i start to call the ifoGetPGCICells function..


Cheers

iNFO-DVD
3rd December 2005, 19:20
Did you get anywhere?

I've always thought of messing with 'vstrip.dll' from vb.net just never got round to it. Did you kind of self convert the vstrip source from 'c'? Or did you look at other examples? I tried once, a few years back, but just got it all in a mess.

nkarnold
5th December 2005, 01:39
Did you get anywhere?

I've always thought of messing with 'vstrip.dll' from vb.net just never got round to it. Did you kind of self convert the vstrip source from 'c'? Or did you look at other examples? I tried once, a few years back, but just got it all in a mess.

I translated much of it from the vstrip gui. written in Delphi.

Still can't see whats going wrong though.

I even put strict type conversions in.ie.

delphi cardinal type mapped to VB.net uInt16 type..
still no joy.. the first chapter it reads has the correct values, from then on.. its junk in the vars.

iNFO-DVD
6th December 2005, 00:13
I might have a mess if I get some time. Would be great if we could get vstrip.dll up and running using vb.net.