[matroska] r773 - trunk/DvdMenuXtractor

[email protected]
Newsgroups gmane.comp.multimedia.matroska.cvs
Message-ID <[email protected]>
Author: robux4
Date: 2004-09-09 19:23:50 +0400 (Thu, 09 Sep 2004)
New Revision: 773

Modified:
   trunk/DvdMenuXtractor/DvdMenuXtractor.cpp
   trunk/DvdMenuXtractor/IFOFile.cpp
   trunk/DvdMenuXtractor/IFOFile.h
Log:
the VTS PGC are now handled (by missing the PG numbers)
so the whole DVD is now mapped to Matroska chapters (still some TODO in the code for special cases)

Modified: trunk/DvdMenuXtractor/DvdMenuXtractor.cpp
===================================================================
--- trunk/DvdMenuXtractor/DvdMenuXtractor.cpp	2004-09-09 14:12:20 UTC (rev 772)
+++ trunk/DvdMenuXtractor/DvdMenuXtractor.cpp	2004-09-09 15:23:50 UTC (rev 773)
@@ -1064,6 +1064,7 @@
 		static unsigned char _PrivateFP[]  = {0x30, 0x00};
 		static unsigned char _PrivateVM[]  = {0x30, 0xC0};
 		static unsigned char _PrivateVTS[] = {0x30, 0x80};
+		static unsigned char _PrivateTT[]  = {0x28, 0x00, 0x00};
 
 		wxString line;
 		wxFileConfig *pConfig = (wxFileConfig *)wxConfigBase::Get();
@@ -1152,7 +1153,45 @@
 					timecode_startA = timecode_endA;
 					
 					// TODO: VTS content
+					if (MovieFile->VtsTitles() && MovieFile->VtsPGCs())
+					{
+						for (int i=0; i<MovieFile->VtsTitles()->nr_of_srpts; i++)
+						{
+							XmlFile.AddLine(IndentString(lvl)+"<!-- Title #"+wxString::Format("%d",i)+" -->");
+							XmlFile.AddLine(IndentString(lvl)+"<ChapterAtom>");
+								lvl++;
+								wxString _myUIDa = CreateUID();
+								XmlFile.AddLine(IndentString(lvl)+"<ChapterUID>"+_myUIDa+"</ChapterUID>");
+								_PrivateTT[1] = i >> 8;
+								_PrivateTT[2] = i & 0xFF;
+								XmlFile.AddLine(IndentString(lvl)+"<ChapterProcessPrivate>"+encodebase64(_PrivateTT,3)+"</ChapterProcessPrivate>");
+							
+								// TODO: so far we assume all the PGCN/PG of VtsPGCs() belongs to all titles
+
+								// add the PGC/PTT
+								uint64_t timecode_startB = timecode_startA, timecode_endB = timecode_startA;
+								for (int j=0; j<MovieFile->VtsPGCs()->nr_of_pgci_srp; j++)
+								{
+									XmlFile.AddLine(IndentString(lvl)+"<ChapterAtom>");
+										lvl++;
+										wxString _myUIDa = CreateUID();
+										XmlFile.AddLine(IndentString(lvl)+"<ChapterUID>"+_myUIDa+"</ChapterUID>");
+									
+										const pgc_t *_pgc = MovieFile->VtsPGCs()->pgci_srp->pgc;
+										timecode_startB = OutputPGC(lvl, XmlFile, MovieFile->VtsPGCs()->pgci_srp->pgc, timecode_startB, j, 0);
+									
+										lvl--;
+									XmlFile.AddLine(IndentString(lvl)+"</ChapterAtom>");
+								}
+								timecode_endA = timecode_startB;
+								
+								DisplayTime(lvl, XmlFile, timecode_startA, timecode_endA);
+								lvl--;
+							XmlFile.AddLine(IndentString(lvl)+"</ChapterAtom>");
+						}
+					}
 					
+					DisplayTime(lvl, XmlFile, timecode_startA, timecode_endA);
 					lvl--;
 				XmlFile.AddLine(IndentString(lvl)+"</ChapterAtom>");
 			}

Modified: trunk/DvdMenuXtractor/IFOFile.cpp
===================================================================
--- trunk/DvdMenuXtractor/IFOFile.cpp	2004-09-09 14:12:20 UTC (rev 772)
+++ trunk/DvdMenuXtractor/IFOFile.cpp	2004-09-09 15:23:50 UTC (rev 773)
@@ -114,6 +114,26 @@
 
 // ----------------------------------------------------------------------------
 
+const vts_ptt_srpt_t *IFOFile::VtsTitles() const
+{
+	if (m_ifo)
+		return m_ifo->vts_ptt_srpt;
+	else
+		return NULL;
+}
+
+// ----------------------------------------------------------------------------
+
+const pgcit_t *IFOFile::VtsPGCs() const
+{
+	if (m_ifo)
+		return m_ifo->vts_pgcit;
+	else
+		return NULL;
+}
+
+// ----------------------------------------------------------------------------
+
 // declare a hash map with int keys and CellListElem* values
 WX_DECLARE_HASH_MAP( int, CellListElem*, wxIntegerHash, wxIntegerEqual, CellsHashType );
 #define MAKE_CELLS_KEY(__cell_elem__)  ((__cell_elem__->vobid << 8) | __cell_elem__->cellid)

Modified: trunk/DvdMenuXtractor/IFOFile.h
===================================================================
--- trunk/DvdMenuXtractor/IFOFile.h	2004-09-09 14:12:20 UTC (rev 772)
+++ trunk/DvdMenuXtractor/IFOFile.h	2004-09-09 15:23:50 UTC (rev 773)
@@ -45,6 +45,8 @@
 	virtual ~IFOFile();
 	const pgc_t *FirstPlayPGC() const;
 	const pgci_ut_t *LanguageUnits() const;
+	const vts_ptt_srpt_t *VtsTitles() const;
+	const pgcit_t *VtsPGCs() const;
 
 private:
 	ifo_handle_t* m_ifo;
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.