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
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