Author: robux4
Date: 2004-09-15 17:42:25 +0400 (Wed, 15 Sep 2004)
New Revision: 810
Modified:
trunk/DvdMenuXtractor/DvdMenuXtractor.cpp
Log:
preliminary support for PTT
Modified: trunk/DvdMenuXtractor/DvdMenuXtractor.cpp
===================================================================
--- trunk/DvdMenuXtractor/DvdMenuXtractor.cpp 2004-09-15 12:42:35 UTC (rev 809)
+++ trunk/DvdMenuXtractor/DvdMenuXtractor.cpp 2004-09-15 13:42:25 UTC (rev 810)
@@ -882,9 +882,11 @@
uint64_t OutputPGC(int lvl, wxTextFile & XmlFile, const pgc_t * pgc, uint64_t start_time, uint16_t pgc_num, unsigned char pgc_type)
{
static unsigned char _PrivatePGC[] = {0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+ static unsigned char _PrivatePTT[] = {0x18, 0x00, 0x00};
uint64_t st_time = start_time, end_time;
- lvl++;
+ XmlFile.AddLine(IndentString(lvl)+"<ChapterAtom>");
+ lvl++;
wxString _myUID = CreateUID();
XmlFile.AddLine(IndentString(lvl)+"<ChapterUID>"+_myUID+"</ChapterUID>");
_PrivatePGC[1] = (pgc_num+1) >> 8;
@@ -905,20 +907,40 @@
// PGC commands
AddCommands(lvl, XmlFile, pgc->command_tbl);
- // _TODO_: get the PTT map to include it inside the PGCs
-
- // Handle the Programs/Cells in the PGC
- for (int i=0; i< pgc->nr_of_programs; i++)
- {
- XmlFile.AddLine(IndentString(lvl)+"<!-- Program #"+wxString::Format("%d",i+1)+" in this PGC -->");
- XmlFile.AddLine(IndentString(lvl)+"<ChapterAtom>");
- st_time = OutputProgram(lvl, XmlFile, pgc, i, st_time);
- XmlFile.AddLine(IndentString(lvl)+"</ChapterAtom>");
- }
+ // _TODO_: for the moment we assume we have 1 PTT per PGC
+ XmlFile.AddLine(IndentString(lvl)+wxString::Format("<!-- Chapter #%d -->", pgc_num+1));
+ XmlFile.AddLine(IndentString(lvl)+"<ChapterAtom>");
+ lvl++;
+ wxString _myUIDa = CreateUID();
+ XmlFile.AddLine(IndentString(lvl)+"<ChapterUID>"+_myUIDa+"</ChapterUID>");
+ _PrivatePTT[1] = (pgc_num+1) >> 8;
+ _PrivatePTT[2] = (pgc_num+1) & 0xFF;
+ XmlFile.AddLine(IndentString(lvl)+"<ChapterProcessPrivate>"+encodebase64(_PrivatePTT,3)+"</ChapterProcessPrivate>");
+ // display the UID for the lazy rippers
+ XmlFile.AddLine(IndentString(lvl)+"<ChapterDisplay>");
+ lvl++;
+ XmlFile.AddLine(IndentString(lvl)+wxString::Format("<ChapterString>Your Name Here For Chapter #%d</ChapterString>", pgc_num+1));
+ lvl--;
+ XmlFile.AddLine(IndentString(lvl)+"</ChapterDisplay>");
+
+ // Handle the Programs/Cells in the PGC
+ for (int i=0; i< pgc->nr_of_programs; i++)
+ {
+ XmlFile.AddLine(IndentString(lvl)+"<!-- Program #"+wxString::Format("%d",i+1)+" in this PGC -->");
+ XmlFile.AddLine(IndentString(lvl)+"<ChapterAtom>");
+ st_time = OutputProgram(lvl, XmlFile, pgc, i, st_time);
+ XmlFile.AddLine(IndentString(lvl)+"</ChapterAtom>");
+ }
+
+ // PTT start/end times
+ DisplayTime(lvl, XmlFile, start_time, st_time);
+ lvl--;
+ XmlFile.AddLine(IndentString(lvl)+"</ChapterAtom>");
// PGC start/end times
DisplayTime(lvl, XmlFile, start_time, st_time);
lvl--;
+ XmlFile.AddLine(IndentString(lvl)+"</ChapterAtom>");
return start_time + DvdTimecodeToNano(pgc->playback_time);
}
@@ -1008,9 +1030,7 @@
{
const pgci_srp_t &_PGC_SRP = _LU.pgcit->pgci_srp[j];
XmlFile.AddLine("\n"+IndentString(lvl)+"<!-- PGC type "+GetPGCType(_PGC_SRP.entry_id)+" -->");
- XmlFile.AddLine(IndentString(lvl)+"<ChapterAtom>");
timecode_endB = OutputPGC(lvl, XmlFile, _PGC_SRP.pgc, timecode_endB, j, _PGC_SRP.entry_id);
- XmlFile.AddLine(IndentString(lvl)+"</ChapterAtom>");
}
}
DisplayTime(lvl, XmlFile, timecode_startB, timecode_endB);
@@ -1124,7 +1144,7 @@
{
XmlFile.AddLine(IndentString(lvl)+wxString::Format("<!-- Title #%d -->",i));
XmlFile.AddLine(IndentString(lvl)+"<ChapterAtom>");
- lvl++;
+ lvl++;
wxString _myUIDa = CreateUID();
XmlFile.AddLine(IndentString(lvl)+"<ChapterUID>"+_myUIDa+"</ChapterUID>");
@@ -1134,20 +1154,12 @@
// add the PGC that match this PTT
uint64_t timecode_startC = timecode_startB, timecode_endC = timecode_startB;
- for (int j=0; j<IfoFile->VtsPGCs()->nr_of_pgci_srp; j++)
+ for (int k=0; k<IfoFile->VtsPGCs()->nr_of_pgci_srp; k++)
{
- if ((IfoFile->VtsPGCs()->pgci_srp[j].entry_id & 0x7F) == i+1)
+ if ((IfoFile->VtsPGCs()->pgci_srp[k].entry_id & 0x7F) == i+1)
{
- XmlFile.AddLine(IndentString(lvl)+"<ChapterAtom>");
- lvl++;
- wxString _myUIDa = CreateUID();
- XmlFile.AddLine(IndentString(lvl)+"<ChapterUID>"+_myUIDa+"</ChapterUID>");
-
timecode_startC = OutputPGC(lvl, XmlFile,
- IfoFile->VtsPGCs()->pgci_srp[j].pgc, timecode_startC, j, 0);
-
- lvl--;
- XmlFile.AddLine(IndentString(lvl)+"</ChapterAtom>");
+ IfoFile->VtsPGCs()->pgci_srp[k].pgc, timecode_startC, k, 0);
}
}
timecode_endB = timecode_startC;
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.