[Matroska-cvs] [matroska] r1280 - in trunk/DvdMenuXtractor: .
libdvdread libdvdread/dvdread libdvdread/src libdvdread/win32
mpegparser vobparser
smssms at matroska.org
smssms at matroska.org
Thu Mar 8 10:07:12 CET 2007
Author: smssms
Date: 2007-03-08 12:04:37 +0300 (Thu, 08 Mar 2007)
New Revision: 1280
Removed:
trunk/DvdMenuXtractor/libdvdread/win32/gtchar.h
Modified:
trunk/DvdMenuXtractor/DvdMenuXtractor.proj
trunk/DvdMenuXtractor/chaptermanager.cpp
trunk/DvdMenuXtractor/chaptermanager.h
trunk/DvdMenuXtractor/config.h
trunk/DvdMenuXtractor/dmx.cpp
trunk/DvdMenuXtractor/dmxconsole.cpp
trunk/DvdMenuXtractor/dmxlogwidget.cpp
trunk/DvdMenuXtractor/dmxselectionitem.cpp
trunk/DvdMenuXtractor/dmxselectionitem.h
trunk/DvdMenuXtractor/dmxselectiontree.cpp
trunk/DvdMenuXtractor/dmxwizard.cpp
trunk/DvdMenuXtractor/libdvdread/config.h.in
trunk/DvdMenuXtractor/libdvdread/dvdread/Makefile.am
trunk/DvdMenuXtractor/libdvdread/dvdread/Makefile.in
trunk/DvdMenuXtractor/libdvdread/dvdread/bswap.h
trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_input.c
trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_input.h
trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_reader.c
trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_reader.h
trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_udf.c
trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_udf.h
trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_print.h
trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_read.c
trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_read.h
trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_types.h
trunk/DvdMenuXtractor/libdvdread/dvdread/md5.c
trunk/DvdMenuXtractor/libdvdread/dvdread/md5.h
trunk/DvdMenuXtractor/libdvdread/dvdread/nav_print.h
trunk/DvdMenuXtractor/libdvdread/dvdread/nav_read.h
trunk/DvdMenuXtractor/libdvdread/src/Makefile.am
trunk/DvdMenuXtractor/libdvdread/src/Makefile.in
trunk/DvdMenuXtractor/libdvdread/src/filestat.c
trunk/DvdMenuXtractor/libdvdread/win32/dirent.c
trunk/DvdMenuXtractor/libdvdread/win32/posix.h
trunk/DvdMenuXtractor/logtextedit.cpp
trunk/DvdMenuXtractor/mpegparser/CircBuffer.cpp
trunk/DvdMenuXtractor/mpegparser/M2VParser.cpp
trunk/DvdMenuXtractor/mpegparser/M2VParser.h
trunk/DvdMenuXtractor/mpegparser/MPEGVideoBuffer.cpp
trunk/DvdMenuXtractor/mpegparser/MPEGVideoBuffer.h
trunk/DvdMenuXtractor/outputreader.cpp
trunk/DvdMenuXtractor/selectiontreeitem.cpp
trunk/DvdMenuXtractor/selectiontreesubitem.cpp
trunk/DvdMenuXtractor/selectiontreesubitem.h
trunk/DvdMenuXtractor/utilities.cpp
trunk/DvdMenuXtractor/utilities.h
trunk/DvdMenuXtractor/vobparser/IFOContent.cpp
trunk/DvdMenuXtractor/vobparser/IFOContent.h
trunk/DvdMenuXtractor/vobparser/IFOFile.cpp
trunk/DvdMenuXtractor/vobparser/IFOFile.h
trunk/DvdMenuXtractor/vobparser/VobParser.cpp
trunk/DvdMenuXtractor/vobparser/VobParser.h
Log:
1. Small changes to libdvdread
2. Updated UNICODE support
3. Code changes
4. Removed unused parameters
5. Fixed EOL style
7. Linux support (tested on Ubuntu 64-bit)
8. WIN64 support
Modified: trunk/DvdMenuXtractor/DvdMenuXtractor.proj
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/DvdMenuXtractor.proj 2007-03-06 09:46:59 UTC (r=
ev 1279)
+++ trunk/DvdMenuXtractor/DvdMenuXtractor.proj 2007-03-08 09:04:37 UTC (r=
ev 1280)
@@ -20,13 +20,18 @@
USE vobparser
USE mpegparser
=20
- INCLUDE "$(QTDIR)/include/QtCore"
- INCLUDE "$(QTDIR)/include/QtGui"
- INCLUDE "$(QTDIR)/include/QtXml"
- INCLUDE "$(QTDIR)/include"
+ INCLUDE(COMPILER_MSVC) "$(QTDIR)/include/QtCore"
+ INCLUDE(COMPILER_MSVC) "$(QTDIR)/include/QtGui"
+ INCLUDE(COMPILER_MSVC) "$(QTDIR)/include/QtXml"
+ INCLUDE(COMPILER_MSVC) "$(QTDIR)/include"
INCLUDE(COMPILER_MSVC) libdvdread/win32
+ INCLUDE(COMPILER_GCC) "$(QTDIR)/include/qt4/QtCore"
+ INCLUDE(COMPILER_GCC) "$(QTDIR)/include/qt4/QtGui"
+ INCLUDE(COMPILER_GCC) "$(QTDIR)/include/qt4/QtXml"
+ INCLUDE(COMPILER_GCC) "$(QTDIR)/include/qt4/"
INCLUDE libdvdread
=20
+ DEFINE __STDC_LIMIT_MACROS
DEFINE(QT_NO_DEBUG) QT_NO_DEBUG_STREAM
=20
LIBS_RELEASE(COMPILER_MSVC) qtmain.lib
@@ -47,7 +52,7 @@
LIBS_DEBUG(COMPILER_MSVC && !CONFIG_STATIC) QtGuid4.lib
LIBS_DEBUG(COMPILER_MSVC && !CONFIG_STATIC) QtNetworkd4.lib
LIBS_DEBUG(COMPILER_MSVC && !CONFIG_STATIC) QtXmld4.lib
- LIBS(COMPILER_GCC) qtmain
+ //LIBS(COMPILER_GCC) qtmain
LIBS(COMPILER_GCC && CONFIG_STATIC) QtNetwork
LIBS(COMPILER_GCC && CONFIG_STATIC) QtGui
LIBS(COMPILER_GCC && CONFIG_STATIC) QtCore
Modified: trunk/DvdMenuXtractor/chaptermanager.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/chaptermanager.cpp 2007-03-06 09:46:59 UTC (rev=
1279)
+++ trunk/DvdMenuXtractor/chaptermanager.cpp 2007-03-08 09:04:37 UTC (rev=
1280)
@@ -686,4 +686,4 @@
parentChapterAtom.appendChild(CreateDOMElement(document, "ChapterTimeSt=
art", Utilities::FormatTime(start_time)));
=20
return start_time;
-}
\ No newline at end of file
+}
Modified: trunk/DvdMenuXtractor/chaptermanager.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/chaptermanager.h 2007-03-06 09:46:59 UTC (rev 1=
279)
+++ trunk/DvdMenuXtractor/chaptermanager.h 2007-03-08 09:04:37 UTC (rev 1=
280)
@@ -37,4 +37,4 @@
unsigned INDENT_COUNT;
};
=20
-#endif //CHAPTER_MANAGER_H
\ No newline at end of file
+#endif //CHAPTER_MANAGER_H
Modified: trunk/DvdMenuXtractor/config.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/config.h 2007-03-06 09:46:59 UTC (rev 1279)
+++ trunk/DvdMenuXtractor/config.h 2007-03-08 09:04:37 UTC (rev 1280)
@@ -1,7 +1,7 @@
-#define CONFIG_STATIC
+//#define CONFIG_STATIC
#define CONFIG_UNICODE
-//#define CONFIG_MULTITHREAD
-//#define CONFIG_MSVCRT
+#define CONFIG_MULTITHREAD
+#define CONFIG_MSVCRT
=20
//-----------
// failsafes
Modified: trunk/DvdMenuXtractor/dmx.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/dmx.cpp 2007-03-06 09:46:59 UTC (rev 1279)
+++ trunk/DvdMenuXtractor/dmx.cpp 2007-03-08 09:04:37 UTC (rev 1280)
@@ -7,7 +7,7 @@
#include <QMutexLocker>
=20
DMX::DMX(bool consoleMode)
- : ifoFile_(0), needsAbort_(false), consoleMode_(consoleMode)
+ : ifoFile_(0), consoleMode_(consoleMode), needsAbort_(false)
{
}
=20
@@ -229,37 +229,24 @@
langSuffix =3D QString("_%1_%2%3").arg(QString::number(_ID), QString(_=
attr->lang_code >> 8), QString(_attr->lang_code & 0xFF));
}
=20
-#ifdef UNICODE
- const wchar_t *name =3D 0; // this is used for QString <=3D> wchar_t* c=
onversion
-#endif
QString muxArguments;
QString fullPrefix (destinationPath_ + QDir::separator() + filename + l=
angSuffix);
=20
switch (_audioTracks[_stream]->audio_format)
{
case 0:
- muxArguments =3D muxArgumentsFormat.arg(filename + langSuffix, lang, f=
ullPrefix, "ac3");
- =09
-#ifdef UNICODE
- name =3D reinterpret_cast<const wchar_t*>(fullPrefix.utf16());
- _muxer =3D new AC3DemuxWriter(name, 0x80 + _ID);
-#else
- _muxer =3D new AC3DemuxWriter(qPrintable(fullPrefix), 0x80 + _ID);
-#endif
+ muxArguments =3D muxArgumentsFormat.arg(filename + langSuffix, lang, f=
ullPrefix, "ac3"); =09
+ _muxer =3D new AC3DemuxWriter(fullPrefix, 0x80 + _ID);
+
if (!demuxer.AddDemuxer(SUBSTREAM_AC3_LOW + _ID, _muxer, muxArguments)=
)
delete _muxer;
break;
=20
case 2:
case 3:
- muxArguments =3D muxArgumentsFormat.arg(filename + langSuffix, lang, f=
ullPrefix, "mpa");
- =09
-#ifdef UNICODE
- name =3D reinterpret_cast<const wchar_t*>(fullPrefix.utf16());
- _muxer =3D new MPADemuxWriter(name, 0xC0 + _ID);
-#else
- _muxer =3D new MPADemuxWriter(qPrintable(fullPrefix), 0xC0 + _ID);
-#endif
+ muxArguments =3D muxArgumentsFormat.arg(filename + langSuffix, lang, f=
ullPrefix, "mpa"); =09
+ _muxer =3D new MPADemuxWriter(fullPrefix, 0xC0 + _ID);
+
if (!demuxer.AddDemuxer(AUDIO_STREAM + _ID, _muxer, muxArguments))
delete _muxer;
break;
@@ -267,24 +254,16 @@
case 4:
// TODO possibly other LPCM formats ?
muxArguments =3D muxArgumentsFormat.arg(filename + langSuffix, lang, f=
ullPrefix, "wav");
-#ifdef UNICODE
- name =3D reinterpret_cast<const wchar_t*>(fullPrefix.utf16());
- _muxer =3D new LPCMDemuxWriter(name, 0xA0 + _ID, 48000, 16, 2);
-#else
- _muxer =3D new LPCMDemuxWriter(qPrintable(fullPrefix), 0xA0 + _ID, 480=
00, 16, 2);
-#endif
+ _muxer =3D new LPCMDemuxWriter(fullPrefix, 0xA0 + _ID, 48000, 16, 2);
+
if (!demuxer.AddDemuxer(SUBSTREAM_PCM_LOW + _ID, _muxer, muxArguments)=
)
delete _muxer;
break;
=20
case 6:
muxArguments =3D muxArgumentsFormat.arg(filename + langSuffix, lang, f=
ullPrefix, "dts");
-#ifdef UNICODE
- name =3D reinterpret_cast<const wchar_t*>(fullPrefix.utf16());
- _muxer =3D new DTSDemuxWriter(name, 0x88 + _ID);
-#else
- _muxer =3D new DTSDemuxWriter(qPrintable(fullPrefix), 0x88 + _ID);
-#endif
+ _muxer =3D new DTSDemuxWriter(fullPrefix, 0x88 + _ID);
+
if (!demuxer.AddDemuxer(SUBSTREAM_DTS_LOW + _ID, _muxer, muxArguments)=
)
delete _muxer;
break;
@@ -324,14 +303,10 @@
langSuffix =3D QString("_%1_%2%3").arg(QString::number(_IDs.at(_IDidx=
)), QString(_attr->lang_code >> 8), QString(_attr->lang_code & 0xFF)); =09
}
=20
-#ifdef UNICODE
- QString str (prefix + langSuffix);
- const wchar_t *name =3D reinterpret_cast<const wchar_t*>(str.utf16());
- _muxer =3D new SubDemuxWriter(name, 0x20 + _IDs.at(_IDidx), _width, _h=
eight, _palette, _attr->lang_code, _attr->lang_extension =3D=3D 9);
-#else
- _muxer =3D new SubDemuxWriter(qPrintable(QString(prefix + langSuffix))=
, 0x20 + _IDs.at(_IDidx), _width, _height, _palette, _attr->lang_code, _a=
ttr->lang_extension =3D=3D 9);
-#endif
- if (!demuxer.AddDemuxer(SUBSTREAM_SUB_LOW + _IDs.at(_IDidx), _muxer, s=
ubMuxArgumentsFormat.arg(filename + langSuffix, lang, prefix + langSuffix=
+ ".idx")))
+ _muxer =3D new SubDemuxWriter(QString(prefix + langSuffix), 0x20 + _ID=
s.at(_IDidx), _width, _height, _palette, _attr->lang_code, _attr->lang_ex=
tension =3D=3D 9);
+
+ QString commandLine =3D subMuxArgumentsFormat.arg(filename + langSuffi=
x, lang, prefix + langSuffix + ".idx");
+ if (!demuxer.AddDemuxer(SUBSTREAM_SUB_LOW + _IDs.at(_IDidx), _muxer, c=
ommandLine))
delete _muxer;
}
}
@@ -352,9 +327,6 @@
QString filename;
QString muxCommand;
=20
-#ifdef UNICODE
- const wchar_t *name =3D 0; // used for QString to wchar_t* conversions
-#endif
// init filename
if (title =3D=3D 0)
filename =3D "VMG";
@@ -376,7 +348,6 @@
ifoFile_->VideoSize(title, menu, _width, _height, _fps);
const uint32_t * _palette =3D ifoFile_->GetPalette(title, menu);
=20
- uint32_t cell =3D 0;
CompositeDemuxWriter &demuxer =3D aVobParser->GetDemuxer();
=20
//emit progressChanged(CellsList->count());
@@ -386,13 +357,10 @@
=20
if ((selectionIndex < 0) || (selection_[selectionIndex].isVideoEnable=
d()))
{
-#ifdef UNICODE
- name =3D reinterpret_cast<const wchar_t*>(prefix.utf16());
- Writer *_muxer =3D new VideoDemuxWriter(name, _fps);
-#else
- Writer *_muxer =3D new VideoDemuxWriter(qPrintable(prefix), _fps);
-#endif
- if (!demuxer.AddDemuxer(VIDEO_STREAM, _muxer, demuxArguments.arg(pre=
fix)))
+ Writer *_muxer =3D new VideoDemuxWriter(prefix, _fps);
+
+ QString commandLine =3D demuxArguments.arg(prefix);
+ if (!demuxer.AddDemuxer(VIDEO_STREAM, _muxer, commandLine))
delete _muxer;
}
=20
@@ -441,13 +409,10 @@
}
=20
// create a possible button demuxer too
-#ifdef UNICODE
- name =3D reinterpret_cast<const wchar_t*>(prefix.utf16());
- Writer *_muxer =3D new BtnDemuxWriter(name, _width, _height);
-#else
- Writer *_muxer =3D new BtnDemuxWriter(qPrintable(prefix), _width, _h=
eight);
-#endif
- if (!demuxer.AddDemuxer(SUBSTREAM_PCI, _muxer, btnMuxArgumentsFormat=
.arg(filename, prefix)))
+ Writer *_muxer =3D new BtnDemuxWriter(prefix, _width, _height);
+
+ QString commandLine =3D btnMuxArgumentsFormat.arg(filename, prefix);
+ if (!demuxer.AddDemuxer(SUBSTREAM_PCI, _muxer, commandLine))
delete _muxer;
}
=20
@@ -499,18 +464,18 @@
muxCommand +=3D " --segmentinfo \"" + prefix + ChapterManager::INFO_S=
UFFIX + "\"";
}
=20
-#if defined(WIN32)
+#if (defined(WIN32) || defined(WIN64))
muxCommand.insert(0, "\"" + toolsPath_ + "\\mkvmerge\" -o \"" + prefix=
+ ".mkv\"");
+ QFile muxBatchFile(prefix + "_" + QTime::currentTime().toString("hh_mm=
_ss") + ".bat");
#else
muxCommand.insert(0, toolsPath_ + "/mkvmerge -o \"" + prefix + ".mkv\"=
");
+ QFile muxBatchFile(prefix + "_" + QTime::currentTime().toString("hh_mm=
_ss") + ".sh");
#endif
=20
- QFile muxBatchFile(prefix + "_" + QTime::currentTime().toString("hh_mm=
_ss") + ".bat");
-
if (!muxBatchFile.open( QIODevice::WriteOnly | QIODevice::Text ))
fprintf(stderr, "Could not create batch file\n");
=09
-#if !defined(WIN32)
+#if !defined(WIN32) && !defined(WIN64)
QString shellString ("#!/bin/sh\n\n");
muxBatchFile.write(shellString.toUtf8());
#endif
@@ -521,6 +486,6 @@
}
catch(VobParserException e)
{
- fprintf(stderr, "Vob Parser Exception Occurred: %s\n", e.m_message);
+ fprintf(stderr, "Vob Parser Exception Occurred: %s\n", e.what());
}
}
Modified: trunk/DvdMenuXtractor/dmxconsole.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/dmxconsole.cpp 2007-03-06 09:46:59 UTC (rev 127=
9)
+++ trunk/DvdMenuXtractor/dmxconsole.cpp 2007-03-08 09:04:37 UTC (rev 128=
0)
@@ -73,14 +73,15 @@
subItems.at(VIDEO_INDEX).toInt());
=20
// add audio tracks
+ int index =3D 0;
QStringList trackList =3D extractTrackNumbers(subItems.at(1));
- foreach (QString trackStr, trackList)
- item.addAudioTrack(trackStr.toUInt());
+ for (index =3D 0; index < trackList.size(); ++index)
+ item.addAudioTrack(trackList.at(index).toUInt());
=20
// add subtitle tracks
trackList =3D extractTrackNumbers(subItems.at(2));
- foreach (QString trackStr, trackList)
- item.addSubtitleTrack(trackStr.toUInt());
+ for (index =3D 0; index < trackList.size(); ++index)
+ item.addSubtitleTrack(trackList.at(index).toUInt());
=20
selectionItems.push_back(item);
}
@@ -118,4 +119,3 @@
<< " Specify selection: -s title, extractMenu, extractVideo, {audi=
oTracks}, {subTracks};..."
<< std::endl;
}
-
Modified: trunk/DvdMenuXtractor/dmxlogwidget.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/dmxlogwidget.cpp 2007-03-06 09:46:59 UTC (rev 1=
279)
+++ trunk/DvdMenuXtractor/dmxlogwidget.cpp 2007-03-08 09:04:37 UTC (rev 1=
280)
@@ -1,47 +1,46 @@
-#include <QFile>
-#include <QCloseEvent>
-#include <QFileDialog>
-#include <QMessageBox>
-#include <QTextStream>
-
-#include "dmxlogwidget.h"
-
-DMXLogWidget::DMXLogWidget(QWidget *parent)
- : QWidget(0)
-{
- ui.setupUi(this);
- setWindowFlags(windowFlags() | Qt::Tool);
-
- //setup slots
- connect(ui.saveButton, SIGNAL(clicked()), this, SLOT(saveButtonClicked(=
)));
-}
-
-DMXLogWidget::~DMXLogWidget()
-{
-
-}
-
-void DMXLogWidget::closeEvent(QCloseEvent *event)
-{
- emit closed();
- event->accept();
-}
-
-void DMXLogWidget::saveButtonClicked()
-{
- QString filename =3D QFileDialog::getSaveFileName(this, "Save as...");
-
- if (filename.size())
- {
- QFile output (filename);
- if (!output.open(QIODevice::WriteOnly | QIODevice::Text))
- {
- QMessageBox::critical(this, "Error", "Could not open file for writing=
");
- return;
- }
-
- QTextStream out (&output);
- out << ui.textEdit->toPlainText();
- }
-}
-
+#include <QFile>
+#include <QCloseEvent>
+#include <QFileDialog>
+#include <QMessageBox>
+#include <QTextStream>
+
+#include "dmxlogwidget.h"
+
+DMXLogWidget::DMXLogWidget(QWidget *parent)
+ : QWidget(parent)
+{
+ ui.setupUi(this);
+ setWindowFlags(windowFlags() | Qt::Tool);
+
+ //setup slots
+ connect(ui.saveButton, SIGNAL(clicked()), this, SLOT(saveButtonClicked(=
)));
+}
+
+DMXLogWidget::~DMXLogWidget()
+{
+
+}
+
+void DMXLogWidget::closeEvent(QCloseEvent *event)
+{
+ emit closed();
+ event->accept();
+}
+
+void DMXLogWidget::saveButtonClicked()
+{
+ QString filename =3D QFileDialog::getSaveFileName(this, "Save as...");
+
+ if (filename.size())
+ {
+ QFile output (filename);
+ if (!output.open(QIODevice::WriteOnly | QIODevice::Text))
+ {
+ QMessageBox::critical(this, "Error", "Could not open file for writing=
");
+ return;
+ }
+
+ QTextStream out (&output);
+ out << ui.textEdit->toPlainText();
+ }
+}
Modified: trunk/DvdMenuXtractor/dmxselectionitem.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/dmxselectionitem.cpp 2007-03-06 09:46:59 UTC (r=
ev 1279)
+++ trunk/DvdMenuXtractor/dmxselectionitem.cpp 2007-03-08 09:04:37 UTC (r=
ev 1280)
@@ -1,71 +1,68 @@
-#include <algorithm>
-#include "dmxselectionitem.h"
-
-DMXSelectionItem::DMXSelectionItem(int16_t title, bool isMenu, bool enab=
leVideo =3D 1)
- : title_(title), menu_(isMenu), videoEnabled_(enableVideo)
-{
- // override for VMG
- if (!title)
- menu_ =3D true;
-}
-
-DMXSelectionItem::~DMXSelectionItem()
-{
-}
-
-int16_t DMXSelectionItem::title() const
-{
- return title_;
-}
-
-bool DMXSelectionItem::isMenu() const
-{
- return menu_;
-}
-
-bool DMXSelectionItem::isVideoEnabled() const
-{
- return videoEnabled_;
-}
-
-const DMXSelectionItem::TracksContainerType& DMXSelectionItem::audioTrac=
ks() const
-{
- return audioTracks_;
-}
-
-const DMXSelectionItem::TracksContainerType& DMXSelectionItem::subtitleT=
racks() const
-{
- return subtitleTracks_;
-}
-
-void DMXSelectionItem::disableVideo()
-{
- videoEnabled_ =3D false;
-}
-
-bool DMXSelectionItem::addAudioTrack(size_t trackIndex)
-{
- // check if audio track was already selected
- if (std::count(audioTracks_.begin(), audioTracks_.end(), trackIndex) =3D=
=3D 0)
- {
- audioTracks_.push_back(trackIndex);
- return true;
- }
-
- return false;
-}
-
-bool DMXSelectionItem::addSubtitleTrack(size_t trackIndex)
-{
- // check if audio track was already selected
- if (std::count(subtitleTracks_.begin(), subtitleTracks_.end(), trackInd=
ex) =3D=3D 0)
- {
- subtitleTracks_.push_back(trackIndex);
- return true;
- }
-
- return false;
-}
-
-
-
+#include <algorithm>
+#include "dmxselectionitem.h"
+
+DMXSelectionItem::DMXSelectionItem(int16_t title, bool isMenu, bool enab=
leVideo =3D 1)
+ : title_(title), menu_(isMenu), videoEnabled_(enableVideo)
+{
+ // override for VMG
+ if (!title)
+ menu_ =3D true;
+}
+
+DMXSelectionItem::~DMXSelectionItem()
+{
+}
+
+int16_t DMXSelectionItem::title() const
+{
+ return title_;
+}
+
+bool DMXSelectionItem::isMenu() const
+{
+ return menu_;
+}
+
+bool DMXSelectionItem::isVideoEnabled() const
+{
+ return videoEnabled_;
+}
+
+const DMXSelectionItem::TracksContainerType& DMXSelectionItem::audioTrac=
ks() const
+{
+ return audioTracks_;
+}
+
+const DMXSelectionItem::TracksContainerType& DMXSelectionItem::subtitleT=
racks() const
+{
+ return subtitleTracks_;
+}
+
+void DMXSelectionItem::disableVideo()
+{
+ videoEnabled_ =3D false;
+}
+
+bool DMXSelectionItem::addAudioTrack(size_t trackIndex)
+{
+ // check if audio track was already selected
+ if (std::count(audioTracks_.begin(), audioTracks_.end(), trackIndex) =3D=
=3D 0)
+ {
+ audioTracks_.push_back(trackIndex);
+ return true;
+ }
+
+ return false;
+}
+
+bool DMXSelectionItem::addSubtitleTrack(size_t trackIndex)
+{
+ // check if audio track was already selected
+ if (std::count(subtitleTracks_.begin(), subtitleTracks_.end(), trackInd=
ex) =3D=3D 0)
+ {
+ subtitleTracks_.push_back(trackIndex);
+ return true;
+ }
+
+ return false;
+}
Modified: trunk/DvdMenuXtractor/dmxselectionitem.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/dmxselectionitem.h 2007-03-06 09:46:59 UTC (rev=
1279)
+++ trunk/DvdMenuXtractor/dmxselectionitem.h 2007-03-08 09:04:37 UTC (rev=
1280)
@@ -35,4 +35,4 @@
};
=20
=20
-#endif // DMX_SELECTION_ITEM
\ No newline at end of file
+#endif // DMX_SELECTION_ITEM
Modified: trunk/DvdMenuXtractor/dmxselectiontree.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/dmxselectiontree.cpp 2007-03-06 09:46:59 UTC (r=
ev 1279)
+++ trunk/DvdMenuXtractor/dmxselectiontree.cpp 2007-03-08 09:04:37 UTC (r=
ev 1280)
@@ -133,4 +133,4 @@
}
=20
return selection;
-}
\ No newline at end of file
+}
Modified: trunk/DvdMenuXtractor/dmxwizard.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/dmxwizard.cpp 2007-03-06 09:46:59 UTC (rev 1279=
)
+++ trunk/DvdMenuXtractor/dmxwizard.cpp 2007-03-08 09:04:37 UTC (rev 1280=
)
@@ -1,247 +1,252 @@
-#include <QSettings>
-#include <QDirModel>
-#include <QFileDialog>
-#include <QCloseEvent>
-
-#include "dmxwizard.h"
-
-DMXWizard::DMXWizard(QWidget *parent)
- : QDialog(parent), logWidget_(this)
-{
- ui.setupUi(this);
-
- setupSlots();
- loadSettings();
-
- // set first page
- ui.stackedWidget->setCurrentIndex(SETTINGS_PAGE_INDEX);
- ui.infoLabel->setText(tr("Welcome to DVD Menu Extraction Wizard!\nThe W=
izard will guide You through the extraction process"));
-}
-
-DMXWizard::~DMXWizard()
-{
- storeSettings();
-}
-void DMXWizard::pathEditTextChanged(const QString& path)
-{
- bool ready =3D true;
-
- // set default styles
- QPalette palette =3D ui.dvdPathEdit->palette();
- palette.setColor(QPalette::Base, Qt::white);
- ui.dvdPathEdit->setPalette(palette);
- ui.toolsPathEdit->setPalette(palette);
- ui.outputPathEdit->setPalette(palette);
-
- // hide all message and image labels
- ui.errorInfoLabel->clear();
- ui.warningInfoLabel->clear();
- ui.errorImageLabel->hide();
- ui.warningImageLabel->hide();
-
- // set background to "red" if incorrect paths are specified
- // and show corresponding message
- if (!QFile::exists(ui.dvdPathEdit->text()))
- {=09
- palette.setColor(QPalette::Base, Qt::red);
- ui.dvdPathEdit->setPalette(palette);
- ready =3D false;
- }
-
- if (!QFile::exists(ui.toolsPathEdit->text()))
- {=09
- palette.setColor(QPalette::Base, Qt::red);
- ui.toolsPathEdit->setPalette(palette);
- ready =3D false;
- }
-
- if (!ui.outputPathEdit->text().size())
- {
- palette.setColor(QPalette::Base, Qt::red);
- ui.outputPathEdit->setPalette(palette);
- ready =3D false;
- }
- else if (QFile::exists(ui.outputPathEdit->text())) // just a warning in=
case the output folder exists
- {
- palette.setColor(QPalette::Base, Qt::yellow);
- ui.outputPathEdit->setPalette(palette);
- =09
- ui.warningImageLabel->show();
- ui.warningInfoLabel->setText(tr("Specified path already exists. Conten=
ts will be overwritten"));
- }
-
- // show error info if needed
- if (!ready)
- {
- ui.errorImageLabel->show();
- ui.errorInfoLabel->setText(tr("Missing or incorrect path was specified=
"));
- }
-
- ui.nextButton->setEnabled(ready);
-}
-
-void DMXWizard::browseButtonClicked()
-{
- QString directory =3D QFileDialog::getExistingDirectory(this, "Select d=
irectory...");
-
- if (!directory.size())
- return;
-
- if (QPushButton *senderObject =3D dynamic_cast<QPushButton*>(sender()))
- {
- if (senderObject =3D=3D ui.dvdBrowseButton)
- {
- if (!(directory.endsWith('/') || directory.endsWith('\\')))
- directory.append('/');
-
- ui.dvdPathEdit->setText(directory);
- }
- else if (senderObject =3D=3D ui.outputBrowseButton)
- ui.outputPathEdit->setText(directory);
- else if (senderObject =3D=3D ui.toolsBrowseButton)
- ui.toolsPathEdit->setText(directory);
- }
-}
-
-void DMXWizard::loadSettings()
-{
- QSettings settings ("DMX", "MatroskaTeam");
- ui.dvdPathEdit->setText(settings.value("Wizard/DVDPath").toString());
- ui.outputPathEdit->setText(settings.value("Wizard/OutputPath").toString=
());
- ui.toolsPathEdit->setText(settings.value("Wizard/ToolsPath").toString()=
);
-}
-
-void DMXWizard::storeSettings()
-{
- QSettings settings ("DMX", "MatroskaTeam");
- settings.setValue("Wizard/DVDPath", ui.dvdPathEdit->text());
- settings.setValue("Wizard/OutputPath", ui.outputPathEdit->text());
- settings.setValue("Wizard/ToolsPath", ui.toolsPathEdit->text());
-}
-
-void DMXWizard::setupSlots()
-{
- // setup slots for buttons
- connect(ui.backButton, SIGNAL(clicked()), this, SLOT(backButtonClicked(=
)));
- connect(ui.nextButton, SIGNAL(clicked()), this, SLOT(nextButtonClicked(=
)));
- connect(ui.stopButton, SIGNAL(clicked()), &dmx, SLOT(abort()));
- connect(ui.dvdBrowseButton, SIGNAL(clicked()), this, SLOT(browseButtonC=
licked()));
- connect(ui.outputBrowseButton, SIGNAL(clicked()), this, SLOT(browseButt=
onClicked()));
- connect(ui.toolsBrowseButton, SIGNAL(clicked()), this, SLOT(browseButto=
nClicked()));
-
- // setup slots for edits
- connect(ui.dvdPathEdit, SIGNAL(textChanged(const QString&)), this, SLOT=
(pathEditTextChanged(const QString&)));
- connect(ui.outputPathEdit, SIGNAL(textChanged(const QString&)), this, S=
LOT(pathEditTextChanged(const QString&)));
- connect(ui.toolsPathEdit, SIGNAL(textChanged(const QString&)), this, SL=
OT(pathEditTextChanged(const QString&)));
-
- // setup log widget
- connect(ui.logButton, SIGNAL(toggled(bool)), &logWidget_, SLOT(setVisib=
le(bool)));
- connect(&logWidget_, SIGNAL(closed()), ui.logButton, SLOT(toggle()));
-
- // setup slots for extraction
- connect(&dmx, SIGNAL(finished()), this, SLOT(extractionFinished()));
- connect(&dmx, SIGNAL(progressChanged(int)), ui.progressBar, SLOT(setVal=
ue(int)));
- connect(&dmx, SIGNAL(stepChanged(const QString&)), this, SLOT(extractio=
nStepChanged(const QString&)));
-}
-
-void DMXWizard::nextButtonClicked()
-{
- if (ui.stackedWidget->currentIndex() =3D=3D SETTINGS_PAGE_INDEX)
- {
- // try to load DVD IFO
- if (!ui.selectionTree->loadIFOFile(ui.dvdPathEdit->text()))
- ui.nextButton->setEnabled(false);
-
- // set button states
- ui.backButton->setEnabled(true);
-
- // turn to the "selection page"
- ui.stackedWidget->setCurrentIndex(SELECTION_PAGE_INDEX);
- }
- else if (ui.stackedWidget->currentIndex() =3D=3D SELECTION_PAGE_INDEX)
- {
- ui.nextButton->setEnabled(false);
-
- // turn to the "extraction page"
- ui.stackedWidget->setCurrentIndex(EXTRACTION_PAGE_INDEX);
-
- // get selection
- DMX::SelectionType selection =3D ui.selectionTree->getSelection();
- if (selection.size())
- {
- // unhide
- ui.stopButton->show();
- ui.progressBar->show();
-
- // set button states
- ui.backButton->setEnabled(false);
- ui.stopButton->setEnabled(true);
-
- ui.progressInfoLabel->setText(tr("Please wait...\nYou can stop the pr=
ocess at any moment by clicking the \"Stop\" button."));
-
- dmx.setExtractionParameters(ui.dvdPathEdit->text(), ui.outputPathEdit=
->text(),
- ui.toolsPathEdit->text(), ui.selectionTree->getSelection());
-
- dmx.start();
- }
- else // nothing was selected
- {
- ui.stopButton->hide();
- ui.progressBar->hide();
- ui.progressInfoLabel->clear();
-
- ui.stepInfoLabel->setText(tr("Nothing was selected, nothing to do..."=
));
- =09
- ui.backButton->setEnabled(true);
- ui.stopButton->setEnabled(false);
- }
- }
-}
-
-void DMXWizard::backButtonClicked()
-{
- // if going back from the "selection page"
- if (ui.stackedWidget->currentIndex() =3D=3D SELECTION_PAGE_INDEX)
- {
- // set button states
- ui.backButton->setEnabled(false);
- ui.nextButton->setEnabled(true);
-
- ui.stackedWidget->setCurrentIndex(SETTINGS_PAGE_INDEX);
- }
- else if (ui.stackedWidget->currentIndex() =3D=3D EXTRACTION_PAGE_INDEX)
- {
- // set button states
- ui.backButton->setEnabled(true);
- ui.nextButton->setEnabled(true);
-
- ui.stackedWidget->setCurrentIndex(SELECTION_PAGE_INDEX);
- }
-}
-
-void DMXWizard::extractionFinished()
-{
- // set button states
- ui.backButton->setEnabled(true);
- ui.stopButton->setEnabled(false);
-
- // chage text
- ui.stepInfoLabel->setText("Extraction finished!");
-}
-
-void DMXWizard::extractionStepChanged(const QString &text)
-{
- ui.stepInfoLabel->setText(text);
-=09
- // send the message to the log
- printf(qPrintable(text + '\n'));
-}
-
-void DMXWizard::closeEvent(QCloseEvent *evt)
-{
- // stop extraction if in progress before quitting
- if (dmx.isRunning())
- dmx.abort();
-
- evt->accept();
-}
\ No newline at end of file
+#include <QSettings>
+#include <QDirModel>
+#include <QFileDialog>
+#include <QCloseEvent>
+
+#include "dmxwizard.h"
+
+DMXWizard::DMXWizard(QWidget *parent)
+ : QDialog(parent), logWidget_(0)
+{
+ ui.setupUi(this);
+=09
+ // hide image labels
+ ui.errorImageLabel->setVisible(false);
+ ui.warningImageLabel->setVisible(false);
+
+ setupSlots();
+ loadSettings();
+
+ // set first page
+ ui.stackedWidget->setCurrentIndex(SETTINGS_PAGE_INDEX);
+ ui.infoLabel->setText(tr("Welcome to DVD Menu Extraction Wizard!\nThe W=
izard will guide You through the extraction process"));
+}
+
+DMXWizard::~DMXWizard()
+{
+ storeSettings();
+}
+
+void DMXWizard::pathEditTextChanged(const QString&)
+{
+ bool ready =3D true;
+
+ // set default styles
+ QPalette palette =3D ui.dvdPathEdit->palette();
+ palette.setColor(QPalette::Base, Qt::white);
+ ui.dvdPathEdit->setPalette(palette);
+ ui.toolsPathEdit->setPalette(palette);
+ ui.outputPathEdit->setPalette(palette);
+
+ // hide all message and image labels
+ ui.errorInfoLabel->clear();
+ ui.warningInfoLabel->clear();
+ ui.errorImageLabel->hide();
+ ui.warningImageLabel->hide();
+
+ // set background to "red" if incorrect paths are specified
+ // and show corresponding message
+ if (!QFile::exists(ui.dvdPathEdit->text()))
+ {=09
+ palette.setColor(QPalette::Base, Qt::red);
+ ui.dvdPathEdit->setPalette(palette);
+ ready =3D false;
+ }
+
+ if (!QFile::exists(ui.toolsPathEdit->text()))
+ {=09
+ palette.setColor(QPalette::Base, Qt::red);
+ ui.toolsPathEdit->setPalette(palette);
+ ready =3D false;
+ }
+
+ if (!ui.outputPathEdit->text().size())
+ {
+ palette.setColor(QPalette::Base, Qt::red);
+ ui.outputPathEdit->setPalette(palette);
+ ready =3D false;
+ }
+ else if (QFile::exists(ui.outputPathEdit->text())) // just a warning in=
case the output folder exists
+ {
+ palette.setColor(QPalette::Base, Qt::yellow);
+ ui.outputPathEdit->setPalette(palette);
+ =09
+ ui.warningImageLabel->show();
+ ui.warningInfoLabel->setText(tr("Specified path already exists. Conten=
ts will be overwritten"));
+ }
+
+ // show error info if needed
+ if (!ready)
+ {
+ ui.errorImageLabel->show();
+ ui.errorInfoLabel->setText(tr("Missing or incorrect path was specified=
"));
+ }
+
+ ui.nextButton->setEnabled(ready);
+}
+
+void DMXWizard::browseButtonClicked()
+{
+ QString directory =3D QFileDialog::getExistingDirectory(this, "Select d=
irectory...");
+
+ if (!directory.size())
+ return;
+
+ if (QPushButton *senderObject =3D dynamic_cast<QPushButton*>(sender()))
+ {
+ if (senderObject =3D=3D ui.dvdBrowseButton)
+ {
+ if (!(directory.endsWith('/') || directory.endsWith('\\')))
+ directory.append('/');
+
+ ui.dvdPathEdit->setText(directory);
+ }
+ else if (senderObject =3D=3D ui.outputBrowseButton)
+ ui.outputPathEdit->setText(directory);
+ else if (senderObject =3D=3D ui.toolsBrowseButton)
+ ui.toolsPathEdit->setText(directory);
+ }
+}
+
+void DMXWizard::loadSettings()
+{
+ QSettings settings ("DMX", "MatroskaTeam");
+ ui.dvdPathEdit->setText(settings.value("Wizard/DVDPath").toString());
+ ui.outputPathEdit->setText(settings.value("Wizard/OutputPath").toString=
());
+ ui.toolsPathEdit->setText(settings.value("Wizard/ToolsPath").toString()=
);
+}
+
+void DMXWizard::storeSettings()
+{
+ QSettings settings ("DMX", "MatroskaTeam");
+ settings.setValue("Wizard/DVDPath", ui.dvdPathEdit->text());
+ settings.setValue("Wizard/OutputPath", ui.outputPathEdit->text());
+ settings.setValue("Wizard/ToolsPath", ui.toolsPathEdit->text());
+}
+
+void DMXWizard::setupSlots()
+{
+ // setup slots for buttons
+ connect(ui.backButton, SIGNAL(clicked()), this, SLOT(backButtonClicked(=
)));
+ connect(ui.nextButton, SIGNAL(clicked()), this, SLOT(nextButtonClicked(=
)));
+ connect(ui.stopButton, SIGNAL(clicked()), &dmx, SLOT(abort()));
+ connect(ui.dvdBrowseButton, SIGNAL(clicked()), this, SLOT(browseButtonC=
licked()));
+ connect(ui.outputBrowseButton, SIGNAL(clicked()), this, SLOT(browseButt=
onClicked()));
+ connect(ui.toolsBrowseButton, SIGNAL(clicked()), this, SLOT(browseButto=
nClicked()));
+
+ // setup slots for edits
+ connect(ui.dvdPathEdit, SIGNAL(textChanged(const QString&)), this, SLOT=
(pathEditTextChanged(const QString&)));
+ connect(ui.outputPathEdit, SIGNAL(textChanged(const QString&)), this, S=
LOT(pathEditTextChanged(const QString&)));
+ connect(ui.toolsPathEdit, SIGNAL(textChanged(const QString&)), this, SL=
OT(pathEditTextChanged(const QString&)));
+
+ // setup log widget
+ connect(ui.logButton, SIGNAL(toggled(bool)), &logWidget_, SLOT(setVisib=
le(bool)));
+ connect(&logWidget_, SIGNAL(closed()), ui.logButton, SLOT(toggle()));
+
+ // setup slots for extraction
+ connect(&dmx, SIGNAL(finished()), this, SLOT(extractionFinished()));
+ connect(&dmx, SIGNAL(progressChanged(int)), ui.progressBar, SLOT(setVal=
ue(int)));
+ connect(&dmx, SIGNAL(stepChanged(const QString&)), this, SLOT(extractio=
nStepChanged(const QString&)));
+}
+
+void DMXWizard::nextButtonClicked()
+{
+ if (ui.stackedWidget->currentIndex() =3D=3D SETTINGS_PAGE_INDEX)
+ {
+ // try to load DVD IFO
+ if (!ui.selectionTree->loadIFOFile(ui.dvdPathEdit->text()))
+ ui.nextButton->setEnabled(false);
+
+ // set button states
+ ui.backButton->setEnabled(true);
+
+ // turn to the "selection page"
+ ui.stackedWidget->setCurrentIndex(SELECTION_PAGE_INDEX);
+ }
+ else if (ui.stackedWidget->currentIndex() =3D=3D SELECTION_PAGE_INDEX)
+ {
+ ui.nextButton->setEnabled(false);
+
+ // turn to the "extraction page"
+ ui.stackedWidget->setCurrentIndex(EXTRACTION_PAGE_INDEX);
+
+ // get selection
+ DMX::SelectionType selection =3D ui.selectionTree->getSelection();
+ if (selection.size())
+ {
+ // unhide
+ ui.stopButton->show();
+ ui.progressBar->show();
+
+ // set button states
+ ui.backButton->setEnabled(false);
+ ui.stopButton->setEnabled(true);
+
+ ui.progressInfoLabel->setText(tr("Please wait...\nYou can stop the pr=
ocess at any moment by clicking the \"Stop\" button."));
+
+ dmx.setExtractionParameters(ui.dvdPathEdit->text(), ui.outputPathEdit=
->text(),
+ ui.toolsPathEdit->text(), ui.selectionTree->getSelection());
+
+ dmx.start();
+ }
+ else // nothing was selected
+ {
+ ui.stopButton->hide();
+ ui.progressBar->hide();
+ ui.progressInfoLabel->clear();
+
+ ui.stepInfoLabel->setText(tr("Nothing was selected, nothing to do..."=
));
+ =09
+ ui.backButton->setEnabled(true);
+ ui.stopButton->setEnabled(false);
+ }
+ }
+}
+
+void DMXWizard::backButtonClicked()
+{
+ // if going back from the "selection page"
+ if (ui.stackedWidget->currentIndex() =3D=3D SELECTION_PAGE_INDEX)
+ {
+ // set button states
+ ui.backButton->setEnabled(false);
+ ui.nextButton->setEnabled(true);
+
+ ui.stackedWidget->setCurrentIndex(SETTINGS_PAGE_INDEX);
+ }
+ else if (ui.stackedWidget->currentIndex() =3D=3D EXTRACTION_PAGE_INDEX)
+ {
+ // set button states
+ ui.backButton->setEnabled(true);
+ ui.nextButton->setEnabled(true);
+
+ ui.stackedWidget->setCurrentIndex(SELECTION_PAGE_INDEX);
+ }
+}
+
+void DMXWizard::extractionFinished()
+{
+ // set button states
+ ui.backButton->setEnabled(true);
+ ui.stopButton->setEnabled(false);
+
+ // chage text
+ ui.stepInfoLabel->setText("Extraction finished!");
+}
+
+void DMXWizard::extractionStepChanged(const QString &text)
+{
+ ui.stepInfoLabel->setText(text);
+=09
+ // send the message to the log
+ printf(qPrintable(text + '\n'));
+}
+
+void DMXWizard::closeEvent(QCloseEvent *evt)
+{
+ // stop extraction if in progress before quitting
+ if (dmx.isRunning())
+ dmx.abort();
+
+ evt->accept();
+}
Modified: trunk/DvdMenuXtractor/libdvdread/config.h.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/libdvdread/config.h.in 2007-03-06 09:46:59 UTC =
(rev 1279)
+++ trunk/DvdMenuXtractor/libdvdread/config.h.in 2007-03-08 09:04:37 UTC =
(rev 1280)
@@ -106,6 +106,3 @@
/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t
=20
-#ifndef LOG_ERROR
-#define LOG_ERROR fprintf
-#endif
Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/libdvdread/dvdread/Makefile.am 2007-03-06 09:46=
:59 UTC (rev 1279)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/Makefile.am 2007-03-08 09:04=
:37 UTC (rev 1280)
@@ -3,12 +3,12 @@
lib_LTLIBRARIES =3D libdvdread.la
libdvdread_la_SOURCES =3D dvd_input.c dvd_reader.c dvd_udf.c ifo_read.c =
\
ifo_print.c nav_read.c nav_print.c bswap.h dvd_udf.h dvd_input.h \
- dvdread_internal.h \
+ dvdread_internal.h cmd_print.c \
md5.c md5.h
libdvdread_la_LIBADD =3D @DL_LIBS@ @CSS_LIBS@
-libdvdread_la_LDFLAGS =3D -version-info 3:0:0 -export-symbols-regex "(DV=
D.*|ifo.*|nav.*)"
+libdvdread_la_LDFLAGS =3D -version-info 5:1:2 -export-symbols-regex "(DV=
D.*|ifo.*|nav.*|cmd.*)"
=20
pkgincludedir =3D $(includedir)/dvdread
=20
pkginclude_HEADERS =3D dvd_reader.h ifo_types.h ifo_read.h \
- ifo_print.h nav_types.h nav_read.h nav_print.h
+ ifo_print.h nav_types.h nav_read.h nav_print.h cmd_print.h
Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/Makefile.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/libdvdread/dvdread/Makefile.in 2007-03-06 09:46=
:59 UTC (rev 1279)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/Makefile.in 2007-03-08 09:04=
:37 UTC (rev 1280)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.6.2 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
=20
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -13,166 +13,244 @@
# PARTICULAR PURPOSE.
=20
@SET_MAKE@
-SHELL =3D @SHELL@
=20
+
srcdir =3D @srcdir@
top_srcdir =3D @top_srcdir@
VPATH =3D @srcdir@
-prefix =3D @prefix@
-exec_prefix =3D @exec_prefix@
-
-bindir =3D @bindir@
-sbindir =3D @sbindir@
-libexecdir =3D @libexecdir@
-datadir =3D @datadir@
-sysconfdir =3D @sysconfdir@
-sharedstatedir =3D @sharedstatedir@
-localstatedir =3D @localstatedir@
-libdir =3D @libdir@
-infodir =3D @infodir@
-mandir =3D @mandir@
-includedir =3D @includedir@
-oldincludedir =3D /usr/include
pkgdatadir =3D $(datadir)/@PACKAGE@
pkglibdir =3D $(libdir)/@PACKAGE@
top_builddir =3D ..
-
-ACLOCAL =3D @ACLOCAL@
-AUTOCONF =3D @AUTOCONF@
-AUTOMAKE =3D @AUTOMAKE@
-AUTOHEADER =3D @AUTOHEADER@
-
am__cd =3D CDPATH=3D"$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL =3D @INSTALL@
-INSTALL_PROGRAM =3D @INSTALL_PROGRAM@
-INSTALL_DATA =3D @INSTALL_DATA@
install_sh_DATA =3D $(install_sh) -c -m 644
install_sh_PROGRAM =3D $(install_sh) -c
install_sh_SCRIPT =3D $(install_sh) -c
-INSTALL_SCRIPT =3D @INSTALL_SCRIPT@
INSTALL_HEADER =3D $(INSTALL_DATA)
-transform =3D @program_transform_name@
+transform =3D $(program_transform_name)
NORMAL_INSTALL =3D :
PRE_INSTALL =3D :
POST_INSTALL =3D :
NORMAL_UNINSTALL =3D :
PRE_UNINSTALL =3D :
POST_UNINSTALL =3D :
-host_alias =3D @host_alias@
+build_triplet =3D @build@
host_triplet =3D @host@
-
-EXEEXT =3D @EXEEXT@
-OBJEXT =3D @OBJEXT@
-PATH_SEPARATOR =3D @PATH_SEPARATOR@
-
+subdir =3D dvdread
+DIST_COMMON =3D $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 =3D $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps =3D $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps =3D $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) =
\
+ $(ACLOCAL_M4)
+mkinstalldirs =3D $(install_sh) -d
+CONFIG_HEADER =3D $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =3D
+am__vpath_adj_setup =3D srcdirstrip=3D`echo "$(srcdir)" | sed 's|.|.|g'`=
;
+am__vpath_adj =3D case $$p in \
+ $(srcdir)/*) f=3D`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=3D$$p;; \
+ esac;
+am__strip_dir =3D `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs =3D "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)"
+libLTLIBRARIES_INSTALL =3D $(INSTALL)
+LTLIBRARIES =3D $(lib_LTLIBRARIES)
+libdvdread_la_DEPENDENCIES =3D
+am_libdvdread_la_OBJECTS =3D dvd_input.lo dvd_reader.lo dvd_udf.lo \
+ ifo_read.lo ifo_print.lo nav_read.lo nav_print.lo cmd_print.lo \
+ md5.lo
+libdvdread_la_OBJECTS =3D $(am_libdvdread_la_OBJECTS)
+DEFAULT_INCLUDES =3D -I. -I$(srcdir) -I$(top_builddir)
+depcomp =3D $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe =3D depfiles
+COMPILE =3D $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS)=
\
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE =3D $(LIBTOOL) --tag=3DCC --mode=3Dcompile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD =3D $(CC)
+LINK =3D $(LIBTOOL) --tag=3DCC --mode=3Dlink $(CCLD) $(AM_CFLAGS) $(CFLA=
GS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES =3D $(libdvdread_la_SOURCES)
+DIST_SOURCES =3D $(libdvdread_la_SOURCES)
+pkgincludeHEADERS_INSTALL =3D $(INSTALL_HEADER)
+HEADERS =3D $(pkginclude_HEADERS)
+ETAGS =3D etags
+CTAGS =3D ctags
+DISTFILES =3D $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
pkgincludedir =3D $(includedir)/dvdread
+ACLOCAL =3D @ACLOCAL@
+AMDEP_FALSE =3D @AMDEP_FALSE@
+AMDEP_TRUE =3D @AMDEP_TRUE@
AMTAR =3D @AMTAR@
-AS =3D @AS@
+AR =3D @AR@
+AUTOCONF =3D @AUTOCONF@
+AUTOHEADER =3D @AUTOHEADER@
+AUTOMAKE =3D @AUTOMAKE@
AWK =3D @AWK@
CC =3D @CC@
+CCDEPMODE =3D @CCDEPMODE@
+CFLAGS =3D @CFLAGS@
+CPP =3D @CPP@
+CPPFLAGS =3D @CPPFLAGS@
CSS_CFLAGS =3D @CSS_CFLAGS@
CSS_LIBS =3D @CSS_LIBS@
+CXX =3D @CXX@
+CXXCPP =3D @CXXCPP@
+CXXDEPMODE =3D @CXXDEPMODE@
+CXXFLAGS =3D @CXXFLAGS@
+CYGPATH_W =3D @CYGPATH_W@
+DEFS =3D @DEFS@
DEPDIR =3D @DEPDIR@
-DLLTOOL =3D @DLLTOOL@
DL_LIBS =3D @DL_LIBS@
ECHO =3D @ECHO@
+ECHO_C =3D @ECHO_C@
+ECHO_N =3D @ECHO_N@
+ECHO_T =3D @ECHO_T@
+EGREP =3D @EGREP@
+EXEEXT =3D @EXEEXT@
+F77 =3D @F77@
+FFLAGS =3D @FFLAGS@
+INSTALL_DATA =3D @INSTALL_DATA@
+INSTALL_PROGRAM =3D @INSTALL_PROGRAM@
+INSTALL_SCRIPT =3D @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM =3D @INSTALL_STRIP_PROGRAM@
+LDFLAGS =3D @LDFLAGS@
+LIBOBJS =3D @LIBOBJS@
+LIBS =3D @LIBS@
LIBTOOL =3D @LIBTOOL@
LN_S =3D @LN_S@
+LTLIBOBJS =3D @LTLIBOBJS@
MAINT =3D @MAINT@
-OBJDUMP =3D @OBJDUMP@
+MAINTAINER_MODE_FALSE =3D @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE =3D @MAINTAINER_MODE_TRUE@
+MAKEINFO =3D @MAKEINFO@
+OBJEXT =3D @OBJEXT@
PACKAGE =3D @PACKAGE@
+PACKAGE_BUGREPORT =3D @PACKAGE_BUGREPORT@
+PACKAGE_NAME =3D @PACKAGE_NAME@
+PACKAGE_STRING =3D @PACKAGE_STRING@
+PACKAGE_TARNAME =3D @PACKAGE_TARNAME@
+PACKAGE_VERSION =3D @PACKAGE_VERSION@
+PATH_SEPARATOR =3D @PATH_SEPARATOR@
RANLIB =3D @RANLIB@
+SET_MAKE =3D @SET_MAKE@
+SHELL =3D @SHELL@
STRIP =3D @STRIP@
VERSION =3D @VERSION@
+ac_ct_AR =3D @ac_ct_AR@
+ac_ct_CC =3D @ac_ct_CC@
+ac_ct_CXX =3D @ac_ct_CXX@
+ac_ct_F77 =3D @ac_ct_F77@
+ac_ct_RANLIB =3D @ac_ct_RANLIB@
+ac_ct_STRIP =3D @ac_ct_STRIP@
+am__fastdepCC_FALSE =3D @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE =3D @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE =3D @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE =3D @am__fastdepCXX_TRUE@
am__include =3D @am__include@
+am__leading_dot =3D @am__leading_dot@
am__quote =3D @am__quote@
+am__tar =3D @am__tar@
+am__untar =3D @am__untar@
+bindir =3D @bindir@
+build =3D @build@
+build_alias =3D @build_alias@
+build_cpu =3D @build_cpu@
+build_os =3D @build_os@
+build_vendor =3D @build_vendor@
+datadir =3D @datadir@
+exec_prefix =3D @exec_prefix@
+host =3D @host@
+host_alias =3D @host_alias@
+host_cpu =3D @host_cpu@
+host_os =3D @host_os@
+host_vendor =3D @host_vendor@
+includedir =3D @includedir@
+infodir =3D @infodir@
install_sh =3D @install_sh@
+libdir =3D @libdir@
+libexecdir =3D @libexecdir@
+localstatedir =3D @localstatedir@
+mandir =3D @mandir@
+mkdir_p =3D @mkdir_p@
+oldincludedir =3D @oldincludedir@
+prefix =3D @prefix@
+program_transform_name =3D @program_transform_name@
+sbindir =3D @sbindir@
+sharedstatedir =3D @sharedstatedir@
+sysconfdir =3D @sysconfdir@
+target_alias =3D @target_alias@
INCLUDES =3D -I$(top_srcdir) @CSS_CFLAGS@
-
lib_LTLIBRARIES =3D libdvdread.la
libdvdread_la_SOURCES =3D dvd_input.c dvd_reader.c dvd_udf.c ifo_read.c =
\
ifo_print.c nav_read.c nav_print.c bswap.h dvd_udf.h dvd_input.h \
- dvdread_internal.h \
+ dvdread_internal.h cmd_print.c \
md5.c md5.h
=20
libdvdread_la_LIBADD =3D @DL_LIBS@ @CSS_LIBS@
-libdvdread_la_LDFLAGS =3D -version-info 3:0:0 -export-symbols-regex "(DV=
D.*|ifo.*|nav.*)"
-
+libdvdread_la_LDFLAGS =3D -version-info 5:1:2 -export-symbols-regex "(DV=
D.*|ifo.*|nav.*|cmd.*)"
pkginclude_HEADERS =3D dvd_reader.h ifo_types.h ifo_read.h \
- ifo_print.h nav_types.h nav_read.h nav_print.h
+ ifo_print.h nav_types.h nav_read.h nav_print.h cmd_print.h
=20
-subdir =3D dvdread
-mkinstalldirs =3D $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER =3D $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =3D
-LTLIBRARIES =3D $(lib_LTLIBRARIES)
-
-libdvdread_la_DEPENDENCIES =3D
-am_libdvdread_la_OBJECTS =3D dvd_input.lo dvd_reader.lo dvd_udf.lo \
- ifo_read.lo ifo_print.lo nav_read.lo nav_print.lo md5.lo
-libdvdread_la_OBJECTS =3D $(am_libdvdread_la_OBJECTS)
-
-DEFS =3D @DEFS@
-DEFAULT_INCLUDES =3D -I. -I$(srcdir) -I$(top_builddir)
-CPPFLAGS =3D @CPPFLAGS@
-LDFLAGS =3D @LDFLAGS@
-LIBS =3D @LIBS@
-depcomp =3D $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe =3D depfiles
- at AMDEP_TRUE@DEP_FILES =3D ./$(DEPDIR)/dvd_input.Plo \
- at AMDEP_TRUE@ ./$(DEPDIR)/dvd_reader.Plo ./$(DEPDIR)/dvd_udf.Plo \
- at AMDEP_TRUE@ ./$(DEPDIR)/ifo_print.Plo ./$(DEPDIR)/ifo_read.Plo \
- at AMDEP_TRUE@ ./$(DEPDIR)/md5.Plo ./$(DEPDIR)/nav_print.Plo \
- at AMDEP_TRUE@ ./$(DEPDIR)/nav_read.Plo
-COMPILE =3D $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS)=
\
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE =3D $(LIBTOOL) --mode=3Dcompile $(CC) $(DEFS) $(DEFAULT_INCLUD=
ES) \
- $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD =3D $(CC)
-LINK =3D $(LIBTOOL) --mode=3Dlink $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-CFLAGS =3D @CFLAGS@
-DIST_SOURCES =3D $(libdvdread_la_SOURCES)
-HEADERS =3D $(pkginclude_HEADERS)
-
-DIST_COMMON =3D $(pkginclude_HEADERS) Makefile.am Makefile.in
-SOURCES =3D $(libdvdread_la_SOURCES)
-
all: all-am
=20
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)=
/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(a=
m__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu dvdread/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu dvdread/Makefile
-Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/=
config.status
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfi=
les_maybe)
-libLTLIBRARIES_INSTALL =3D $(INSTALL)
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ =
$(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__d=
epfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_D=
EPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(libdir)
+ test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
@list=3D'$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
- f=3D"`echo $$p | sed -e 's|^.*/||'`"; \
- echo " $(LIBTOOL) --mode=3Dinstall $(libLTLIBRARIES_INSTALL) $(INST=
ALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \
- $(LIBTOOL) --mode=3Dinstall $(libLTLIBRARIES_INSTALL) $(INSTALL_STR=
IP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \
+ f=3D$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=3Dinstall $(libLTLIBRARIES_INSTALL) $(INST=
ALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
+ $(LIBTOOL) --mode=3Dinstall $(libLTLIBRARIES_INSTALL) $(INSTALL_STR=
IP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
else :; fi; \
done
=20
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
- @list=3D'$(lib_LTLIBRARIES)'; for p in $$list; do \
- p=3D"`echo $$p | sed -e 's|^.*/||'`"; \
- echo " $(LIBTOOL) --mode=3Duninstall rm -f $(DESTDIR)$(libdir)/$$p"; =
\
- $(LIBTOOL) --mode=3Duninstall rm -f $(DESTDIR)$(libdir)/$$p; \
+ @set -x; list=3D'$(lib_LTLIBRARIES)'; for p in $$list; do \
+ p=3D$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=3Duninstall rm -f '$(DESTDIR)$(libdir)/$$p'"=
; \
+ $(LIBTOOL) --mode=3Duninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
done
=20
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list=3D'$(lib_LTLIBRARIES)'; for p in $$list; do \
dir=3D"`echo $$p | sed -e 's|/[^/]*$$||'`"; \
- test -z "$dir" && dir=3D.; \
+ test "$$dir" !=3D "$$p" || dir=3D.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
@@ -180,11 +258,12 @@
$(LINK) -rpath $(libdir) $(libdvdread_la_LDFLAGS) $(libdvdread_la_OBJEC=
TS) $(libdvdread_la_LIBADD) $(LIBS)
=20
mostlyclean-compile:
- -rm -f *.$(OBJEXT) core *.core
+ -rm -f *.$(OBJEXT)
=20
distclean-compile:
-rm -f *.tab.c
=20
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cmd_print.Plo at am__quote=
@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dvd_input.Plo at am__quote=
@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dvd_reader.Plo at am__quot=
e@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dvd_udf.Plo at am__quote@
@@ -194,27 +273,26 @@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nav_print.Plo at am__quote=
@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/nav_read.Plo at am__quote@
=20
-distclean-depend:
- -rm -rf ./$(DEPDIR)
-
.c.o:
- at AMDEP_TRUE@ source=3D'$<' object=3D'$@' libtool=3Dno @AMDEPBACKSLASH@
- at AMDEP_TRUE@ depfile=3D'$(DEPDIR)/$*.Po' tmpdepfile=3D'$(DEPDIR)/$*.TPo'=
@AMDEPBACKSLASH@
- at AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
+ at am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo"=
-c -o $@ $<; \
+ at am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; el=
se rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source=3D'$<' object=3D'$@' libtool=3D=
no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=3D$(DEPDIR) $(CCDEPMODE) $(depc=
omp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c $<
=20
.c.obj:
- at AMDEP_TRUE@ source=3D'$<' object=3D'$@' libtool=3Dno @AMDEPBACKSLASH@
- at AMDEP_TRUE@ depfile=3D'$(DEPDIR)/$*.Po' tmpdepfile=3D'$(DEPDIR)/$*.TPo'=
@AMDEPBACKSLASH@
- at AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- $(COMPILE) -c `cygpath -w $<`
+ at am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo"=
-c -o $@ `$(CYGPATH_W) '$<'`; \
+ at am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; el=
se rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source=3D'$<' object=3D'$@' libtool=3D=
no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=3D$(DEPDIR) $(CCDEPMODE) $(depc=
omp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
=20
.c.lo:
- at AMDEP_TRUE@ source=3D'$<' object=3D'$@' libtool=3Dyes @AMDEPBACKSLASH@
- at AMDEP_TRUE@ depfile=3D'$(DEPDIR)/$*.Plo' tmpdepfile=3D'$(DEPDIR)/$*.TPl=
o' @AMDEPBACKSLASH@
- at AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
-CCDEPMODE =3D @CCDEPMODE@
+ at am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tp=
o" -c -o $@ $<; \
+ at am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; e=
lse rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source=3D'$<' object=3D'$@' libtool=3D=
yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=3D$(DEPDIR) $(CCDEPMODE) $(depc=
omp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
=20
mostlyclean-libtool:
-rm -f *.lo
@@ -225,30 +303,24 @@
distclean-libtool:
-rm -f libtool
uninstall-info-am:
-pkgincludeHEADERS_INSTALL =3D $(INSTALL_HEADER)
install-pkgincludeHEADERS: $(pkginclude_HEADERS)
@$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(pkgincludedir)
+ test -z "$(pkgincludedir)" || $(mkdir_p) "$(DESTDIR)$(pkgincludedir)"
@list=3D'$(pkginclude_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=3D; else d=3D"$(srcdir)/"; fi; \
- f=3D"`echo $$p | sed -e 's|^.*/||'`"; \
- echo " $(pkgincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(pkgincludedir)=
/$$f"; \
- $(pkgincludeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(pkgincludedir)/$$f; \
+ f=3D$(am__strip_dir) \
+ echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincluded=
ir)/$$f'"; \
+ $(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f=
"; \
done
=20
uninstall-pkgincludeHEADERS:
@$(NORMAL_UNINSTALL)
@list=3D'$(pkginclude_HEADERS)'; for p in $$list; do \
- f=3D"`echo $$p | sed -e 's|^.*/||'`"; \
- echo " rm -f $(DESTDIR)$(pkgincludedir)/$$f"; \
- rm -f $(DESTDIR)$(pkgincludedir)/$$f; \
+ f=3D$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \
done
=20
-ETAGS =3D etags
-ETAGSFLAGS =3D
-
-tags: TAGS
-
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list=3D'$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=3D`for i in $$list; do \
@@ -257,6 +329,7 @@
$(AWK) ' { files[$$0] =3D 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
+tags: TAGS
=20
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
@@ -268,8 +341,24 @@
done | \
$(AWK) ' { files[$$0] =3D 1; } \
END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$tags$$unique" \
- || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=3D$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=3D; \
+ here=3D`pwd`; \
+ list=3D'$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=3D`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] =3D 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
=20
GTAGS:
@@ -278,19 +367,21 @@
&& gtags -i $(GTAGS_ARGS) $$here
=20
distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
-DISTFILES =3D $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
=20
-top_distdir =3D ..
-distdir =3D $(top_distdir)/$(PACKAGE)-$(VERSION)
-
distdir: $(DISTFILES)
- @list=3D'$(DISTFILES)'; for file in $$list; do \
+ @srcdirstrip=3D`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=3D`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list=3D'$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=3D`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=3D`echo "$$file" | sed "s|^$$topsrcdirstrip/|=
$(top_builddir)/|"`;; \
+ esac; \
if test -f $$file || test -d $$file; then d=3D.; else d=3D$(srcdir); =
fi; \
dir=3D`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" !=3D "$$file" && test "$$dir" !=3D "."; then \
dir=3D"/$$dir"; \
- $(mkinstalldirs) "$(distdir)$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
else \
dir=3D''; \
fi; \
@@ -308,10 +399,10 @@
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
-
installdirs:
- $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(pkgincludedir)
-
+ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
@@ -323,7 +414,7 @@
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=3D"$(INSTALL_STRIP_PROGRAM)" \
- INSTALL_STRIP_FLAG=3D-s \
+ install_sh_PROGRAM=3D"$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=3D=
-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=3DSTRIPPROG=3D'$(STRIP)'"` install
mostlyclean-generic:
@@ -331,7 +422,7 @@
clean-generic:
=20
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
=20
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -342,14 +433,17 @@
mostlyclean-am
=20
distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
=20
-distclean-am: clean-am distclean-compile distclean-depend \
- distclean-generic distclean-libtool distclean-tags
-
dvi: dvi-am
=20
dvi-am:
=20
+html: html-am
+
info: info-am
=20
info-am:
@@ -365,7 +459,8 @@
installcheck-am:
=20
maintainer-clean: maintainer-clean-am
-
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
=20
mostlyclean: mostlyclean-am
@@ -373,21 +468,30 @@
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
=20
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \
uninstall-pkgincludeHEADERS
=20
-.PHONY: GTAGS all all-am check check-am clean clean-generic \
- clean-libLTLIBRARIES clean-libtool distclean distclean-compile \
- distclean-depend distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am info info-am install \
- install-am install-data install-data-am install-exec \
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libLTLIBRARIES clean-libtool ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am \
install-libLTLIBRARIES install-man install-pkgincludeHEADERS \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- tags uninstall uninstall-am uninstall-info-am \
- uninstall-libLTLIBRARIES uninstall-pkgincludeHEADERS
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-info-am uninstall-libLTLIBRARIES \
+ uninstall-pkgincludeHEADERS
=20
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/bswap.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/libdvdread/dvdread/bswap.h 2007-03-06 09:46:59 =
UTC (rev 1279)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/bswap.h 2007-03-08 09:04:37 =
UTC (rev 1280)
@@ -84,7 +84,7 @@
#define B2N_64(x) x =3D OSSwapBigToHostConstInt64(x)
=20
#else
-#if defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defin=
ed(WIN32) || defined(__BEOS__) || defined(__INTERIX)
+#if defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defin=
ed(WIN64) || defined(WIN32) || defined(__BEOS__) || defined(__INTERIX)
/* These systems don't have swap macros */
#else
/* If there isn't a header provided with your system with this functiona=
lity
Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_input.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_input.c 2007-03-06 09:46=
:59 UTC (rev 1279)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_input.c 2007-03-08 09:04=
:37 UTC (rev 1280)
@@ -20,7 +20,7 @@
=20
#include "config.h"
=20
-#if defined(WIN32)
+#if defined(WIN32) || defined(WIN64)
#include "posix.h"
#endif
#include <stdio.h>
@@ -30,8 +30,7 @@
#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
-
-#if defined(WIN32)
+#if defined(WIN32) || defined(WIN64)
#include <io.h> // for open(), close(), etc..
#include <share.h>
#endif
@@ -42,7 +41,7 @@
#include "dvdread_internal.h"
=20
/* The function pointers that is the exported interface of this file. */
-dvd_input_t (*dvdinput_open) (const TCHAR *);
+dvd_input_t (*dvdinput_open) (const char *);
int (*dvdinput_close) (dvd_input_t);
int (*dvdinput_seek) (dvd_input_t, int);
int (*dvdinput_title) (dvd_input_t, int);=20
@@ -63,13 +62,13 @@
#define DVDcss_title dvdcss_title
#define DVDcss_read dvdcss_read
#define DVDcss_error dvdcss_error
-#else=20
+#else
/* dlopening libdvdcss */
#if defined(HAVE_DLFCN_H)
#include <dlfcn.h>
#endif
typedef struct dvdcss_s *dvdcss_handle;
-static dvdcss_handle (*DVDcss_open) (const TCHAR *);
+static dvdcss_handle (*DVDcss_open) (const char *);
static int (*DVDcss_close) (dvdcss_handle);
static int (*DVDcss_seek) (dvdcss_handle, int, int);
static int (*DVDcss_title) (dvdcss_handle, int);=20
@@ -90,7 +89,7 @@
/**
* initialize and open a DVD device or file.
*/
-static dvd_input_t css_open(const TCHAR *target)
+static dvd_input_t css_open(const char *target)
{
dvd_input_t dev;
=20
@@ -173,7 +172,7 @@
/**
* initialize and open a DVD device or file.
*/
-static dvd_input_t file_open(const TCHAR *target)
+static dvd_input_t file_open(const char *target)
{
dvd_input_t dev;
char *use_odirect;
@@ -194,11 +193,7 @@
}
=20
/* Open the device */
-#if defined(_CRT_NONSTDC_DEPRECATE)
- dev->fd =3D _topen(target, oflags);
-#else
dev->fd =3D open(target, oflags);
-#endif
if(dev->fd < 0) {
free(dev);
return NULL;
@@ -223,11 +218,7 @@
{
off_t pos =3D (off_t)blocks * (off_t)DVD_VIDEO_LB_LEN;
=20
-#if defined(_CRT_NONSTDC_DEPRECATE)
- pos =3D _lseek(dev->fd, pos, SEEK_SET);
-#else
pos =3D lseek(dev->fd, pos, SEEK_SET);
-#endif
if(pos < 0) {
return pos;
}
@@ -256,11 +247,7 @@
=20
while(len > 0) {
=20
-#if defined(_CRT_NONSTDC_DEPRECATE)
- ret =3D _read(dev->fd, buf, len);
-#else
ret =3D read(dev->fd, buf, len);
-#endif
=20
if(ret < 0) {
/* One of the reads failed, too bad. We won't even bother
@@ -273,12 +260,8 @@
/* Nothing more to read. Return the whole blocks, if any, that we=
got.
and adjust the file possition back to the previous block bounda=
ry. */
size_t bytes =3D (size_t)blocks * DVD_VIDEO_LB_LEN - len;
- off_t over_read =3D (unsigned)-(bytes % DVD_VIDEO_LB_LEN);
-#if defined(_CRT_NONSTDC_DEPRECATE)
- /*off_t pos =3D*/ _lseek(dev->fd, over_read, SEEK_CUR);
-#else
- /*off_t pos =3D*/ lseek(dev->fd, over_read, SEEK_CUR);
-#endif
+ off_t over_read =3D -(off_t)(bytes % DVD_VIDEO_LB_LEN);
+ /*off_t pos =3D*/ lseek(dev->fd, over_read, SEEK_CUR);
/* should have pos % 2048 =3D=3D 0 */
return (int) (bytes / DVD_VIDEO_LB_LEN);
}
@@ -297,12 +280,7 @@
{
int ret;
=20
-#if defined(_CRT_NONSTDC_DEPRECATE)
- ret =3D _close(dev->fd);
-#else
ret =3D close(dev->fd);
-#endif
- =20
=20
if(ret < 0)
return ret;
@@ -364,7 +342,7 @@
dvdcss_version =3D &dvdcss_interface_2;
=20
#else
-#if defined(WIN32)
+#if defined(WIN32) || defined(WIN64)
dvdcss_library =3D LoadLibraryA("libdvdcss.dll");
#else
dvdcss_library =3D dlopen("libdvdcss.so.2", RTLD_LAZY);
@@ -376,7 +354,7 @@
#else
#define U_S
#endif
- DVDcss_open =3D (dvdcss_handle (*)(const TCHAR*))
+ DVDcss_open =3D (dvdcss_handle (*)(const char*))
dlsym(dvdcss_library, U_S "dvdcss_open");
DVDcss_close =3D (int (*)(dvdcss_handle))
dlsym(dvdcss_library, U_S "dvdcss_close");
Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_input.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_input.h 2007-03-06 09:46=
:59 UTC (rev 1279)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_input.h 2007-03-08 09:04=
:37 UTC (rev 1280)
@@ -33,7 +33,7 @@
/**
* Pointers which will be filled either the input methods functions.
*/
-extern dvd_input_t (*dvdinput_open) (const TCHAR *);
+extern dvd_input_t (*dvdinput_open) (const char *);
extern int (*dvdinput_close) (dvd_input_t);
extern int (*dvdinput_seek) (dvd_input_t, int);
extern int (*dvdinput_title) (dvd_input_t, int);=20
Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_reader.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_reader.c 2007-03-06 09:4=
6:59 UTC (rev 1279)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_reader.c 2007-03-08 09:0=
4:37 UTC (rev 1280)
@@ -21,13 +21,12 @@
=20
#include "config.h"
=20
-#if defined(WIN32)
+#if defined(WIN32) || defined(WIN64)
#include "posix.h"
-#include "gtchar.h"
#endif
#include <sys/types.h>
#include <sys/stat.h>
-#if !defined(WIN32)
+#if !defined(WIN32) && !defined(WIN64)
#include <sys/time.h> /* For the timing of dvdcss_title crack. */
#endif
#include <fcntl.h>
@@ -75,7 +74,7 @@
dvd_input_t dev;
=20
/* Information required for a directory path drive. */
- TCHAR *path_root;
+ char *path_root;
=20
/* Filesystem cache */
int udfcache_level; /* 0 - turned off, 1 - on */
@@ -191,7 +190,7 @@
dev->align =3D align;
}
=20
-#ifdef WIN32 /* replacement gettimeofday implementation */
+#if defined(WIN32) || defined(WIN64) /* replacement gettimeofday impleme=
ntation */
#include <sys/timeb.h>
#include <winsock.h> // for timeval
static int gettimeofday( struct timeval *tv, void *tz )
@@ -210,7 +209,7 @@
{
struct timeval all_s, all_e;
struct timeval t_s, t_e;
- TCHAR filename[ MAX_UDF_FILE_NAME_LEN ];
+ char filename[ MAX_UDF_FILE_NAME_LEN ];
uint32_t start, len;
int title;
=20
@@ -229,9 +228,9 @@
for( title =3D 0; title < 100; title++ ) {
gettimeofday( &t_s, NULL );
if( title =3D=3D 0 ) {
- _stprintf( filename, _T("/VIDEO_TS/VIDEO_TS.VOB") );
+ sprintf( filename, "/VIDEO_TS/VIDEO_TS.VOB" );
} else {
- _stprintf( filename, _T("/VIDEO_TS/VTS_%02d_%d.VOB"), title, 0 );
+ sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, 0 );
}
start =3D UDFFindFile( dvd, filename, &len );
if( start !=3D 0 && len !=3D 0 ) {
@@ -255,7 +254,7 @@
if( title =3D=3D 0 ) continue;
=20
gettimeofday( &t_s, NULL );
- _stprintf( filename, _T("/VIDEO_TS/VTS_%02d_%d.VOB"), title, 1 );
+ sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, 1 );
start =3D UDFFindFile( dvd, filename, &len );
if( start =3D=3D 0 || len =3D=3D 0 ) break;
=20
@@ -295,7 +294,7 @@
* Checks if the root directory in the udf image file can be found.
* If not it assumes this isn't a valid udf image and returns NULL
*/
-static dvd_reader_t *DVDOpenImageFile( const TCHAR *location, int have_c=
ss )
+static dvd_reader_t *DVDOpenImageFile( const char *location, int have_cs=
s )
{
dvd_reader_t *dvd;
dvd_input_t dev;
@@ -339,7 +338,7 @@
dvd->css_title =3D 0;
=20
/* sanity check, is it a valid UDF image, can we find the root dir */
- if(!UDFFindFile(dvd, _T("/"), NULL)) {
+ if(!UDFFindFile(dvd, "/", NULL)) {
dvdinput_close(dvd->dev);
if(dvd->udfcache) {
FreeUDFCache(dvd, dvd->udfcache);
@@ -355,7 +354,7 @@
return dvd;
}
=20
-static dvd_reader_t *DVDOpenPath( const TCHAR *path_root )
+static dvd_reader_t *DVDOpenPath( const char *path_root )
{
dvd_reader_t *dvd;
=20
@@ -366,8 +365,7 @@
dvd->verbose =3D get_verbose();
dvd->isImageFile =3D 0;
dvd->dev =3D 0;
-=20
- dvd->path_root =3D _tcsdup( path_root );=20
+ dvd->path_root =3D strdup( path_root );
if(!dvd->path_root) {
free(dvd);
return 0;
@@ -439,11 +437,11 @@
#endif
=20
=20
-dvd_reader_t *DVDOpen( const TCHAR *path )
+dvd_reader_t *DVDOpen( const char *path )
{
- struct _stat fileinfo;
+ struct stat fileinfo;
int ret, have_css;
- TCHAR *dev_name =3D NULL;
+ char *dev_name =3D NULL;
int internal_errno =3D 0;
int verbose;
=20
@@ -454,7 +452,7 @@
=20
verbose =3D get_verbose();
=20
-#ifdef WIN32
+#if defined(WIN32) || defined(WIN64)
/* Stat doesn't work on devices under mingwin/cygwin. */
//if( path[0] && path[1] =3D=3D ':' && path[2] =3D=3D '\0' )
// {
@@ -464,7 +462,7 @@
//else
#endif
{
- ret =3D _tstat( path, &fileinfo );
+ ret =3D stat( path, &fileinfo );
if( ret < 0 ) {
int tmp_errno =3D errno;
/* If we can't stat the file, give up */
@@ -492,8 +490,6 @@
dev_name =3D sun_block2char( path );
#elif defined(SYS_BSD)
dev_name =3D bsd_block2char( path );
-#elif defined(_CRT_NONSTDC_DEPRECATE)
- dev_name =3D _tcsdup( path );
#else
dev_name =3D strdup( path );
#endif
@@ -503,7 +499,7 @@
return dvd;
} else if( S_ISDIR( fileinfo.st_mode ) ) {
dvd_reader_t *auth_drive =3D 0;
- TCHAR *path_copy;
+ char *path_copy;
#if defined(SYS_BSD)
struct fstab* fe;
#elif defined(__sun) || defined(__linux__)
@@ -511,13 +507,9 @@
#endif
=20
/* XXX: We should scream real loud here. */
-#if defined(_CRT_NONSTDC_DEPRECATE)
- if( !(path_copy =3D _tcsdup( path ) ) ) return 0;
-#else
if( !(path_copy =3D strdup( path ) ) ) return 0;
-#endif
=20
-#ifndef WIN32 /* don't have fchdir, and getcwd( NULL, ... ) is strange *=
/
+#if !defined(WIN32) && !defined(WIN64) /* don't have fchdir, and getcwd(=
NULL, ... ) is strange */
/* Resolve any symlinks and get the absolut dir name. */
{
char *new_path;
@@ -555,16 +547,16 @@
* is the mountpoint for a DVD-ROM which we can use instead.
*/
=20
- if( _tcslen( path_copy ) > 1 ) {
- if( path_copy[ _tcslen( path_copy ) - 1 ] =3D=3D '/' ) {
- path_copy[ _tcslen( path_copy ) - 1 ] =3D '\0';
+ if( strlen( path_copy ) > 1 ) {
+ if( path_copy[ strlen( path_copy ) - 1 ] =3D=3D '/' ) {
+ path_copy[ strlen( path_copy ) - 1 ] =3D '\0';
}
}
=20
- if( _tcslen( path_copy ) >=3D 9 ) {
- if( !_tcsicmp( &(path_copy[ _tcslen( path_copy ) - 9 ]),=20
- _T("/video_ts") ) ) {
- path_copy[ _tcslen( path_copy ) - 9 ] =3D '\0';
+ if( strlen( path_copy ) >=3D 9 ) {
+ if( !strcasecmp( &(path_copy[ strlen( path_copy ) - 9 ]),=20
+ "/video_ts" ) ) {
+ path_copy[ strlen( path_copy ) - 9 ] =3D '\0';
if(path_copy[0] =3D=3D '\0') {
path_copy[0] =3D '/';
path_copy[1] =3D '\0';
@@ -704,7 +696,7 @@
/**
* Open an unencrypted file on a DVD image file.
*/
-static dvd_file_t *DVDOpenFileUDF( dvd_reader_t *dvd, TCHAR *filename )
+static dvd_file_t *DVDOpenFileUDF( dvd_reader_t *dvd, char *filename )
{
uint32_t start, len;
dvd_file_t *dvd_file;
@@ -730,35 +722,35 @@
* or -1 on file not found.
* or -2 on path not found.
*/
-static int findDirFile( const TCHAR *path, const TCHAR *file, TCHAR *fil=
ename )=20
+static int findDirFile( const char *path, const char *file, char *filena=
me )=20
{
- _TDIR *dir;
- struct _tdirent *ent;
+ DIR *dir;
+ struct dirent *ent;
=20
- dir =3D _topendir( path );
+ dir =3D opendir( path );
if( !dir ) return -2;
=20
- while( ( ent =3D _treaddir( dir ) ) !=3D NULL ) {
- if( !_tcsicmp( ent->d_name, file ) ) {
- _stprintf( filename, _T("%s%s%s"), path,
- ( ( path[ _tcslen( path ) - 1 ] =3D=3D '/' ) ? _T("") : _=
T("/") ),
+ while( ( ent =3D readdir( dir ) ) !=3D NULL ) {
+ if( !strcasecmp( ent->d_name, file ) ) {
+ sprintf( filename, "%s%s%s", path,
+ ( ( path[ strlen( path ) - 1 ] =3D=3D '/' ) ? "" : "/" ),
ent->d_name );
- _tclosedir(dir);
+ closedir(dir);
return 0;
}
}
- _tclosedir(dir);
+ closedir(dir);
return -1;
}
=20
-static int findDVDFile( dvd_reader_t *dvd, const TCHAR *file, TCHAR *fil=
ename )
+static int findDVDFile( dvd_reader_t *dvd, const char *file, char *filen=
ame )
{
- TCHAR video_path[ PATH_MAX + 1 ];
- const TCHAR *nodirfile;
+ char video_path[ PATH_MAX + 1 ];
+ const char *nodirfile;
int ret;
=20
/* Strip off the directory for our search */
- if( !_tcsnicmp( _T("/VIDEO_TS/"), file, 10 ) ) {
+ if( !strncasecmp( "/VIDEO_TS/", file, 10 ) ) {
nodirfile =3D &(file[ 10 ]);
} else {
nodirfile =3D file;
@@ -767,11 +759,11 @@
ret =3D findDirFile( dvd->path_root, nodirfile, filename );
if( ret < 0 ) {
/* Try also with adding the path, just in case. */
- _stprintf( video_path, _T("%s/VIDEO_TS/"), dvd->path_root );
+ sprintf( video_path, "%s/VIDEO_TS/", dvd->path_root );
ret =3D findDirFile( video_path, nodirfile, filename );
if( ret < 0 ) {
/* Try with the path, but in lower case. */
- _stprintf( video_path, _T("%s/video_ts/"), dvd->path_root );
+ sprintf( video_path, "%s/video_ts/", dvd->path_root );
ret =3D findDirFile( video_path, nodirfile, filename );
if( ret < 0 ) {
return 0;
@@ -785,11 +777,11 @@
/**
* Open an unencrypted file from a DVD directory tree.
*/
-static dvd_file_t *DVDOpenFilePath( dvd_reader_t *dvd, TCHAR *filename )
+static dvd_file_t *DVDOpenFilePath( dvd_reader_t *dvd, char *filename )
{
- TCHAR full_path[ PATH_MAX + 1 ];
+ char full_path[ PATH_MAX + 1 ];
dvd_file_t *dvd_file;
- struct _stat fileinfo;
+ struct stat fileinfo;
dvd_input_t dev;
=20
/* Get the full path of the file. */
@@ -807,7 +799,7 @@
memset( dvd_file->title_devs, 0, sizeof( dvd_file->title_devs ) );
dvd_file->filesize =3D 0;
=20
- if( _tstat( full_path, &fileinfo ) < 0 ) {
+ if( stat( full_path, &fileinfo ) < 0 ) {
if(dvd->verbose >=3D 1) {
fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
}
@@ -823,14 +815,14 @@
=20
static dvd_file_t *DVDOpenVOBUDF( dvd_reader_t *dvd, int title, int menu=
)
{
- TCHAR filename[ MAX_UDF_FILE_NAME_LEN ];
+ char filename[ MAX_UDF_FILE_NAME_LEN ];
uint32_t start, len;
dvd_file_t *dvd_file;
=20
if( title =3D=3D 0 ) {
- _stprintf( filename, _T("/VIDEO_TS/VIDEO_TS.VOB") );
+ sprintf( filename, "/VIDEO_TS/VIDEO_TS.VOB" );
} else {
- _stprintf( filename, _T("/VIDEO_TS/VTS_%02d_%d.VOB"), title, menu ? =
0 : 1 );
+ sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, menu ? 0 : 1 =
);
}
start =3D UDFFindFile( dvd, filename, &len );
if( start =3D=3D 0 ) return 0;
@@ -850,7 +842,7 @@
int cur;
=20
for( cur =3D 2; cur < 10; cur++ ) {
- _stprintf( filename, _T("/VIDEO_TS/VTS_%02d_%d.VOB"), title, cur )=
;
+ sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, cur );
if( !UDFFindFile( dvd, filename, &len ) ) break;
dvd_file->filesize +=3D len / DVD_VIDEO_LB_LEN;
}
@@ -872,9 +864,9 @@
=20
static dvd_file_t *DVDOpenVOBPath( dvd_reader_t *dvd, int title, int men=
u )
{
- TCHAR filename[ MAX_UDF_FILE_NAME_LEN ];
- TCHAR full_path[ PATH_MAX + 1 ];
- struct _stat fileinfo;
+ char filename[ MAX_UDF_FILE_NAME_LEN ];
+ char full_path[ PATH_MAX + 1 ];
+ struct stat fileinfo;
dvd_file_t *dvd_file;
int i;
=20
@@ -892,9 +884,9 @@
dvd_input_t dev;
=20
if( title =3D=3D 0 ) {
- _stprintf( filename, _T("VIDEO_TS.VOB") );
+ sprintf( filename, "VIDEO_TS.VOB" );
} else {
- _stprintf( filename, _T("VTS_%02i_0.VOB"), title );
+ sprintf( filename, "VTS_%02i_0.VOB", title );
}
if( !findDVDFile( dvd, filename, full_path ) ) {
free( dvd_file );
@@ -907,7 +899,7 @@
return 0;
}
=20
- if( _tstat( full_path, &fileinfo ) < 0 ) {
+ if( stat( full_path, &fileinfo ) < 0 ) {
if(dvd->verbose >=3D 1) {
fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
}
@@ -922,12 +914,12 @@
} else {
for( i =3D 0; i < 9; ++i ) {
=20
- _stprintf( filename, _T("VTS_%02i_%i.VOB"), title, i + 1 );
+ sprintf( filename, "VTS_%02i_%i.VOB", title, i + 1 );
if( !findDVDFile( dvd, filename, full_path ) ) {
break;
}
=20
- if( _tstat( full_path, &fileinfo ) < 0 ) {
+ if( stat( full_path, &fileinfo ) < 0 ) {
if(dvd->verbose >=3D 1) {
fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
}
@@ -951,7 +943,7 @@
dvd_file_t *DVDOpenFile( dvd_reader_t *dvd, int titlenum,=20
dvd_read_domain_t domain )
{
- TCHAR filename[ MAX_UDF_FILE_NAME_LEN ];
+ char filename[ MAX_UDF_FILE_NAME_LEN ];
=20
/* Check arguments. */
if( dvd =3D=3D NULL || titlenum < 0 ) {
@@ -962,16 +954,16 @@
switch( domain ) {
case DVD_READ_INFO_FILE:
if( titlenum =3D=3D 0 ) {
- _stprintf( filename, _T("/VIDEO_TS/VIDEO_TS.IFO") );
+ sprintf( filename, "/VIDEO_TS/VIDEO_TS.IFO" );
} else {
- _stprintf( filename, _T("/VIDEO_TS/VTS_%02i_0.IFO"), titlenum );
+ sprintf( filename, "/VIDEO_TS/VTS_%02i_0.IFO", titlenum );
}
break;
case DVD_READ_INFO_BACKUP_FILE:
if( titlenum =3D=3D 0 ) {
- _stprintf( filename, _T("/VIDEO_TS/VIDEO_TS.BUP") );
+ sprintf( filename, "/VIDEO_TS/VIDEO_TS.BUP" );
} else {
- _stprintf( filename, _T("/VIDEO_TS/VTS_%02i_0.BUP"), titlenum );
+ sprintf( filename, "/VIDEO_TS/VTS_%02i_0.BUP", titlenum );
}
break;
case DVD_READ_MENU_VOBS:
@@ -1027,7 +1019,7 @@
static int DVDFileStatVOBUDF(dvd_reader_t *dvd, int title,=20
int menu, dvd_stat_t *statbuf)
{
- TCHAR filename[ MAX_UDF_FILE_NAME_LEN ];
+ char filename[ MAX_UDF_FILE_NAME_LEN ];
uint32_t size;
off_t tot_size;
off_t parts_size[9];
@@ -1035,9 +1027,9 @@
int n;
=20
if( title =3D=3D 0 ) {
- _stprintf( filename, _T("/VIDEO_TS/VIDEO_TS.VOB") );
+ sprintf( filename, "/VIDEO_TS/VIDEO_TS.VOB" );
} else {
- _stprintf( filename, _T("/VIDEO_TS/VTS_%02d_%d.VOB"), title, menu ? =
0 : 1 );
+ sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, menu ? 0 : 1 =
);
}
if(!UDFFindFile( dvd, filename, &size )) {
return -1;
@@ -1050,7 +1042,7 @@
int cur;
=20
for( cur =3D 2; cur < 10; cur++ ) {
- _stprintf( filename, _T("/VIDEO_TS/VTS_%02d_%d.VOB"), title, cur )=
;
+ sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, cur );
if( !UDFFindFile( dvd, filename, &size ) ) {
break;
}
@@ -1072,9 +1064,9 @@
static int DVDFileStatVOBPath( dvd_reader_t *dvd, int title,
int menu, dvd_stat_t *statbuf )
{
- TCHAR filename[ MAX_UDF_FILE_NAME_LEN ];
- TCHAR full_path[ PATH_MAX + 1 ];
- struct _stat fileinfo;
+ char filename[ MAX_UDF_FILE_NAME_LEN ];
+ char full_path[ PATH_MAX + 1 ];
+ struct stat fileinfo;
off_t tot_size;
off_t parts_size[9];
int nr_parts =3D 0;
@@ -1083,15 +1075,15 @@
=20
=20
if( title =3D=3D 0 ) {
- _stprintf( filename, _T("VIDEO_TS.VOB") );
+ sprintf( filename, "VIDEO_TS.VOB" );
} else {
- _stprintf( filename, _T("VTS_%02d_%d.VOB"), title, menu ? 0 : 1 );
+ sprintf( filename, "VTS_%02d_%d.VOB", title, menu ? 0 : 1 );
}
if( !findDVDFile( dvd, filename, full_path ) ) {
return -1;
}
=20
- if( _tstat( full_path, &fileinfo ) < 0 ) {
+ if( stat( full_path, &fileinfo ) < 0 ) {
if(dvd->verbose >=3D 1) {
fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
}
@@ -1108,12 +1100,12 @@
=20
for( cur =3D 2; cur < 10; cur++ ) {
=20
- _stprintf( filename, _T("VTS_%02d_%d.VOB"), title, cur );
+ sprintf( filename, "VTS_%02d_%d.VOB", title, cur );
if( !findDVDFile( dvd, filename, full_path ) ) {
break;
}
=20
- if( _tstat( full_path, &fileinfo ) < 0 ) {
+ if( stat( full_path, &fileinfo ) < 0 ) {
if(dvd->verbose >=3D 1) {
fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
}
@@ -1138,9 +1130,9 @@
int DVDFileStat(dvd_reader_t *dvd, int titlenum,=20
dvd_read_domain_t domain, dvd_stat_t *statbuf)
{
- TCHAR filename[ MAX_UDF_FILE_NAME_LEN ];
- TCHAR full_path[ PATH_MAX + 1 ];
- struct _stat fileinfo;
+ char filename[ MAX_UDF_FILE_NAME_LEN ];
+ char full_path[ PATH_MAX + 1 ];
+ struct stat fileinfo;
uint32_t size;
=20
/* Check arguments. */
@@ -1152,16 +1144,16 @@
switch( domain ) {
case DVD_READ_INFO_FILE:
if( titlenum =3D=3D 0 ) {
- _stprintf( filename, _T("/VIDEO_TS/VIDEO_TS.IFO") );
+ sprintf( filename, "/VIDEO_TS/VIDEO_TS.IFO" );
} else {
- _stprintf( filename, _T("/VIDEO_TS/VTS_%02i_0.IFO"), titlenum );
+ sprintf( filename, "/VIDEO_TS/VTS_%02i_0.IFO", titlenum );
}
break;
case DVD_READ_INFO_BACKUP_FILE:
if( titlenum =3D=3D 0 ) {
- _stprintf( filename, _T("/VIDEO_TS/VIDEO_TS.BUP") );
+ sprintf( filename, "/VIDEO_TS/VIDEO_TS.BUP" );
} else {
- _stprintf( filename, _T("/VIDEO_TS/VTS_%02i_0.BUP"), titlenum );
+ sprintf( filename, "/VIDEO_TS/VTS_%02i_0.BUP", titlenum );
}
break;
case DVD_READ_MENU_VOBS:
@@ -1198,7 +1190,7 @@
}
} else {
if( findDVDFile( dvd, filename, full_path ) ) {
- if( _tstat( full_path, &fileinfo ) < 0 ) {
+ if( stat( full_path, &fileinfo ) < 0 ) {
if(dvd->verbose >=3D 1) {
fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
}
@@ -1409,7 +1401,7 @@
return offset;
}
=20
-#ifndef HAVE_UINTPTR_T
+#if !defined(HAVE_UINTPTR_T) && !defined(HAVE_STDINT_H)
#warning "Assuming that (unsigned long) can hold (void *)"
typedef unsigned long uintptr_t;
#endif
@@ -1600,7 +1592,7 @@
=20
=20
int DVDUDFVolumeInfo( dvd_reader_t *dvd,
- TCHAR *volid, unsigned int volid_size,
+ char *volid, unsigned int volid_size,
unsigned char *volsetid, unsigned int volsetid_siz=
e )
{
int ret;
Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_reader.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_reader.h 2007-03-06 09:4=
6:59 UTC (rev 1279)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_reader.h 2007-03-08 09:0=
4:37 UTC (rev 1280)
@@ -22,10 +22,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 =
USA
*/
=20
-#include <inttypes.h> // include local inttypes for WIN32
+#include <inttypes.h> // include local inttypes for WINDOWS
#include <sys/types.h>
-#ifdef _WIN32
-#include "gtchar.h"
+#if defined(WIN32) || defined(WIN64)
typedef SSIZE_T ssize_t;
#endif
=20
@@ -98,7 +97,7 @@
* The current working directory is global to all threads,
* so using chdir/getcwd in another thread could give unexpected results=
.
*/
-dvd_reader_t *DVDOpen( const TCHAR * );
+dvd_reader_t *DVDOpen( const char * );
=20
/**
* Closes and cleans up the DVD reader object.
@@ -302,7 +301,7 @@
* @param volsetid_size At most volsetid_size bytes will be copied to vo=
lsetid.
* @return 0 on success, -1 on error.
*/
-int DVDUDFVolumeInfo( dvd_reader_t *, TCHAR *, unsigned int,
+int DVDUDFVolumeInfo( dvd_reader_t *, char *, unsigned int,
unsigned char *, unsigned int );
=20
/**
Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_udf.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_udf.c 2007-03-06 09:46:5=
9 UTC (rev 1279)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_udf.c 2007-03-08 09:04:3=
7 UTC (rev 1280)
@@ -35,7 +35,7 @@
#include <stdlib.h>
#include <string.h>
=20
-#if defined(WIN32)
+#if defined(WIN32) || defined(WIN64)
#include "posix.h"
#endif
#include <sys/types.h>
@@ -59,7 +59,7 @@
#define EMEDIUMTYPE ENOENT
#endif
=20
-#ifndef HAVE_UINTPTR_T
+#if !defined(HAVE_UINTPTR_T) && !defined(HAVE_STDINT_H)
#warning "Assuming that (unsigned long) can hold (void *)"
typedef unsigned long uintptr_t;
#endif
@@ -237,10 +237,10 @@
=20
struct Partition {
int valid;
- TCHAR VolumeDesc[128];
+ char VolumeDesc[128];
uint16_t Flags;
uint16_t Number;
- TCHAR Contents[32];
+ char Contents[32];
uint32_t AccessType;
uint32_t Start;
uint32_t Length;
@@ -498,7 +498,7 @@
/* This is wrong with regard to endianess */
#define GETN(p, n, target) memcpy(target, &data[p], n)
=20
-static int Unicodedecode( uint8_t *data, int len, TCHAR *target )=20
+static int Unicodedecode( uint8_t *data, int len, char *target )=20
{
int p =3D 1, i =3D 0;
=20
@@ -569,7 +569,7 @@
=20
=20
static int UDFPartition( uint8_t *data, uint16_t *Flags, uint16_t *Numbe=
r,
- TCHAR *Contents, uint32_t *Start, uint32_t *Len=
gth )
+ char *Contents, uint32_t *Start, uint32_t *Leng=
th )
{
*Flags =3D GETN2(20);
*Number =3D GETN2(22);
@@ -583,7 +583,7 @@
* Reads the volume descriptor and checks the parameters. Returns 0 on =
OK, 1
* on error.
*/
-static int UDFLogVolume( uint8_t *data, TCHAR *VolumeDescriptor )
+static int UDFLogVolume( uint8_t *data, char *VolumeDescriptor )
{
uint32_t lbsize, MT_L, N_PM;
Unicodedecode(&data[84], 128, VolumeDescriptor);
@@ -633,7 +633,7 @@
}
=20
static int UDFFileIdentifier( uint8_t *data, uint8_t *FileCharacteristic=
s,
- TCHAR *FileName, struct AD *FileICB )
+ char *FileName, struct AD *FileICB )
{
uint8_t L_FI;
uint16_t L_IU;
@@ -703,11 +703,11 @@
* FileICB: Location of ICB of the found file
* return 1 on success, 0 on error;
*/
-static int UDFScanDir( dvd_reader_t *device, struct AD Dir, TCHAR *FileN=
ame,
+static int UDFScanDir( dvd_reader_t *device, struct AD Dir, char *FileNa=
me,
struct Partition *partition, struct AD *FileICB,
int cache_file_info)=20
{
- TCHAR filename[ MAX_UDF_FILE_NAME_LEN ];
+ char filename[ MAX_UDF_FILE_NAME_LEN ];
uint8_t *directory;
uint32_t lbnum;
uint16_t TagID;
@@ -754,7 +754,7 @@
uint8_t tmpFiletype;
struct AD tmpFile;
=20
- if( !_tcsicmp( FileName, filename ) ) {
+ if( !strcasecmp( FileName, filename ) ) {
*FileICB =3D tmpICB;
found =3D 1;
=20
@@ -762,7 +762,7 @@
UDFMapICB(device, tmpICB, &tmpFiletype,
partition, &tmpFile);
} else {
- if( !_tcsicmp( FileName, filename ) ) {
+ if( !strcasecmp( FileName, filename ) ) {
*FileICB =3D tmpICB;
return 1;
}
@@ -804,7 +804,7 @@
if( TagID =3D=3D 257 ) {
p +=3D UDFFileIdentifier( &directory[ p ], &filechar,
filename, FileICB );
- if( !_tcsicmp( FileName, filename ) ) {
+ if( !strcasecmp( FileName, filename ) ) {
dvdalign_lbfree(device, directory);
return 1;
}
@@ -967,23 +967,23 @@
return part->valid;
}
=20
-uint32_t UDFFindFile( dvd_reader_t *device, TCHAR *filename,
+uint32_t UDFFindFile( dvd_reader_t *device, char *filename,
uint32_t *filesize )
{
uint8_t *LogBlock;
uint32_t lbnum;
uint16_t TagID;
struct Partition partition;
- struct AD RootICB, File, ICB;
- TCHAR tokenline[ MAX_UDF_FILE_NAME_LEN ];
- TCHAR *token;
+ struct AD RootICB, File, ICB =3D {0};
+ char tokenline[ MAX_UDF_FILE_NAME_LEN ];
+ char *token;
uint8_t filetype;
=20
if(filesize) {
*filesize =3D 0;
}
tokenline[0] =3D '\0';
- _tcscat( tokenline, filename );
+ strcat( tokenline, filename );
=20
=20
if(!(GetUDFCache(device, PartitionCache, 0, &partition) &&
@@ -1036,7 +1036,7 @@
{
int cache_file_info =3D 0;
/* Tokenize filepath */
- token =3D _tcstok(tokenline, _T("/"));
+ token =3D strtok(tokenline, "/");
=20
while( token !=3D NULL ) {
=20
@@ -1047,10 +1047,10 @@
if( !UDFMapICB( device, ICB, &filetype, &partition, &File ) ) {
return 0;
}
- if(!_tcscmp(token, _T("VIDEO_TS"))) {
+ if(!strcmp(token, "VIDEO_TS")) {
cache_file_info =3D 1;
}
- token =3D _tcstok( NULL, _T("/") );
+ token =3D strtok( NULL, "/" );
}
}=20
=20
@@ -1168,7 +1168,7 @@
* volid_size, size of the buffer volid points to
* returns the size of buffer needed for all data
*/
-int UDFGetVolumeIdentifier(dvd_reader_t *device, TCHAR *volid,
+int UDFGetVolumeIdentifier(dvd_reader_t *device, char *volid,
unsigned int volid_size)
{
struct pvd_t pvd;
Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_udf.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_udf.h 2007-03-06 09:46:5=
9 UTC (rev 1279)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/dvd_udf.h 2007-03-08 09:04:3=
7 UTC (rev 1280)
@@ -53,11 +53,11 @@
* This implementation relies on that the file size is less than 2^32
* A DVD file can at most be 2^30 (-2048 ?).
*/
-uint32_t UDFFindFile( dvd_reader_t *device, TCHAR *filename, uint32_t *s=
ize );
+uint32_t UDFFindFile( dvd_reader_t *device, char *filename, uint32_t *si=
ze );
=20
void FreeUDFCache(dvd_reader_t *device, void *cache);
int UDFGetVolumeIdentifier(dvd_reader_t *device,
- TCHAR *volid, unsigned int volid_size);
+ char *volid, unsigned int volid_size);
int UDFGetVolumeSetIdentifier(dvd_reader_t *device,
uint8_t *volsetid, unsigned int volsetid_s=
ize);
#ifdef __cplusplus
Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_print.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_print.h 2007-03-06 09:46=
:59 UTC (rev 1279)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_print.h 2007-03-08 09:04=
:37 UTC (rev 1280)
@@ -1,3 +1,4 @@
+/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */
#ifndef IFO_PRINT_H_INCLUDED
#define IFO_PRINT_H_INCLUDED
=20
Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_read.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_read.c 2007-03-06 09:46:=
59 UTC (rev 1279)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_read.c 2007-03-08 09:04:=
37 UTC (rev 1280)
@@ -1274,7 +1274,7 @@
free(ptl_mait);
return 0;
}
- for (j =3D 0; j < ((ptl_mait->nr_of_vtss + 1) * 8); j++) {
+ for (j =3D 0; j < (unsigned)((ptl_mait->nr_of_vtss + 1) * 8); j++) {
B2N_16(pf_temp[j]);
}
ptl_mait->countries[i].pf_ptl_mai =3D (pf_level_t *)malloc(info_leng=
th);
@@ -1520,7 +1520,7 @@
=20
static int ifoRead_C_ADT_internal(ifo_handle_t *ifofile,=20
c_adt_t *c_adt, unsigned int sector) {
- int i, info_length;
+ unsigned int i, info_length;
=20
if(!DVDFileSeek_(ifofile->file, sector * DVD_BLOCK_LEN))
return 0;
Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_read.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_read.h 2007-03-06 09:46:=
59 UTC (rev 1279)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_read.h 2007-03-08 09:04:=
37 UTC (rev 1280)
@@ -1,3 +1,4 @@
+/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */
#ifndef IFO_READ_H_INCLUDED
#define IFO_READ_H_INCLUDED
=20
Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_types.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_types.h 2007-03-06 09:46=
:59 UTC (rev 1279)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/ifo_types.h 2007-03-08 09:04=
:37 UTC (rev 1280)
@@ -27,11 +27,11 @@
#if !defined(_INTTYPES_H_) && !defined(_INTTYPES_H) && !defined(_STDINT_=
H_) && !defined(_STDINT_H)
#error "Must include <inttypes.h> or <stdint.h> before any libdvdread he=
ader."
#endif
-#elif defined(WIN32) && !defined(HAVE_INTTYPES_H) && !defined(HAVE_STDIN=
T_H)
+#else
+#if !defined(UINT8_MAX) || !defined(UINT16_MAX) || !defined(INT32_MAX)
#error "Must include <inttypes.h> or <stdint.h> before any libdvdread he=
ader."
-#elif !defined(WIN32) && (!defined(UINT8_MAX) || !defined(UINT16_MAX) ||=
!defined(INT32_MAX))
-#error "Must include <inttypes.h> or <stdint.h> before any libdvdread he=
ader."
#endif
+#endif
=20
#undef ATTRIBUTE_PACKED
#undef PRAGMA_PACK_BEGIN=20
Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/md5.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/libdvdread/dvdread/md5.c 2007-03-06 09:46:59 UT=
C (rev 1279)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/md5.c 2007-03-08 09:04:37 UT=
C (rev 1280)
@@ -1,3 +1,4 @@
+/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */
/* md5.c - Functions to compute MD5 message digest of files or memory bl=
ocks
according to the definition of MD5 in RFC 1321 from April 1992.
Copyright (C) 1995, 1996, 2001 Free Software Foundation, Inc.
@@ -36,7 +37,7 @@
#endif
=20
#include "md5.h"
-/* #include "unlocked-io.h" */
+//#include "unlocked-io.h"
=20
#ifdef _LIBC
# include <endian.h>
@@ -46,8 +47,8 @@
#endif
=20
#ifdef WORDS_BIGENDIAN
-# define SWAP(n) \
- (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) =
>> 24))
+# define SWAP(n) =
\
+ (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >>=
24))
#else
# define SWAP(n) (n)
#endif
@@ -116,7 +117,7 @@
/* Put the 64-bit file length in *bits* at the end of the buffer. */
*(md5_uint32 *) &ctx->buffer[bytes + pad] =3D SWAP (ctx->total[0] << 3=
);
*(md5_uint32 *) &ctx->buffer[bytes + pad + 4] =3D SWAP ((ctx->total[1]=
<< 3) |
- (ctx->total[0] >> 29));
+ (ctx->total[0] >=
> 29));
=20
/* Process last bytes. */
md5_process_block (ctx->buffer, bytes + pad + 8, ctx);
@@ -145,29 +146,29 @@
while (1)
{
/* We read the file in blocks of BLOCKSIZE bytes. One call of the
- computation function processes the whole buffer so that with the
- next round of the loop another block can be read. */
+ computation function processes the whole buffer so that with th=
e
+ next round of the loop another block can be read. */
size_t n;
sum =3D 0;
=20
/* Read block. Take care for partial reads. */
do
- {
- n =3D fread (buffer + sum, 1, BLOCKSIZE - sum, stream);
+ {
+ n =3D fread (buffer + sum, 1, BLOCKSIZE - sum, stream);
=20
- sum +=3D n;
- }
+ sum +=3D n;
+ }
while (sum < BLOCKSIZE && n !=3D 0);
if (n =3D=3D 0 && ferror (stream))
return 1;
=20
/* If end of file is reached, end the loop. */
if (n =3D=3D 0)
- break;
+ break;
=20
/* Process buffer with BLOCKSIZE bytes. Note that
- BLOCKSIZE % 64 =3D=3D 0
- */
+ BLOCKSIZE % 64 =3D=3D 0
+ */
md5_process_block (buffer, BLOCKSIZE, &ctx);
}
=20
@@ -220,13 +221,13 @@
ctx->buflen +=3D add;
=20
if (left_over + add > 64)
- {
- md5_process_block (ctx->buffer, (left_over + add) & ~63, ctx);
- /* The regions in the following copy operation cannot overlap. */
- memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63],
- (left_over + add) & 63);
- ctx->buflen =3D (left_over + add) & 63;
- }
+ {
+ md5_process_block (ctx->buffer, (left_over + add) & ~63, ctx);
+ /* The regions in the following copy operation cannot overlap.=
*/
+ memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63],
+ (left_over + add) & 63);
+ ctx->buflen =3D (left_over + add) & 63;
+ }
=20
buffer =3D (const char *) buffer + add;
len -=3D add;
@@ -294,28 +295,28 @@
md5_uint32 D_save =3D D;
=20
/* First round: using the given function, the context and a consta=
nt
- the next context is computed. Because the algorithms processing
- unit is a 32-bit word and it is determined to work on words in
- little endian byte order we perhaps have to change the byte order
- before the computation. To reduce the work for the next steps
- we store the swapped words in the array CORRECT_WORDS. */
+ the next context is computed. Because the algorithms processin=
g
+ unit is a 32-bit word and it is determined to work on words in
+ little endian byte order we perhaps have to change the byte ord=
er
+ before the computation. To reduce the work for the next steps
+ we store the swapped words in the array CORRECT_WORDS. */
=20
-#define OP(a, b, c, d, s, T) \
- do \
- { \
- a +=3D FF (b, c, d) + (*cwp++ =3D SWAP (*words)) + T; \
- ++words; \
- a =3D rol (a, s); \
- a +=3D b; \
- } \
+#define OP(a, b, c, d, s, T) \
+ do \
+ { \
+ a +=3D FF (b, c, d) + (*cwp++ =3D SWAP (*words)) + T; \
+ ++words; \
+ a =3D rol (a, s); \
+ a +=3D b; \
+ } \
while (0)
=20
/* Before we start, one word to the strange constants.
- They are defined in RFC 1321 as
+ They are defined in RFC 1321 as
=20
- T[i] =3D (int) (4294967296.0 * fabs (sin (i))), i=3D1..64, or
- perl -e 'foreach(1..64){printf "0x%08x\n", int (4294967296 * abs (sin =
$_))}'
- */
+ T[i] =3D (int) (4294967296.0 * fabs (sin (i))), i=3D1..64, or
+ perl -e 'foreach(1..64){printf "0x%08x\n", int (4294967296 * ab=
s (sin $_))}'
+ */
=20
/* Round 1. */
OP (A, B, C, D, 7, 0xd76aa478);
@@ -336,16 +337,16 @@
OP (B, C, D, A, 22, 0x49b40821);
=20
/* For the second to fourth round we have the possibly swapped wor=
ds
- in CORRECT_WORDS. Redefine the macro to take an additional first
- argument specifying the function to use. */
+ in CORRECT_WORDS. Redefine the macro to take an additional fir=
st
+ argument specifying the function to use. */
#undef OP
-#define OP(f, a, b, c, d, k, s, T) \
- do \
- { \
- a +=3D f (b, c, d) + correct_words[k] + T; \
- a =3D rol (a, s); \
- a +=3D b; \
- } \
+#define OP(f, a, b, c, d, k, s, T) \
+ do \
+ { \
+ a +=3D f (b, c, d) + correct_words[k] + T; \
+ a =3D rol (a, s); \
+ a +=3D b; \
+ } \
while (0)
=20
/* Round 2. */
Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/md5.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/libdvdread/dvdread/md5.h 2007-03-06 09:46:59 UT=
C (rev 1279)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/md5.h 2007-03-08 09:04:37 UT=
C (rev 1280)
@@ -1,3 +1,4 @@
+/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */
/* md5.h - Declaration of functions and data types used for MD5 sum
computing library functions.
Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc.
@@ -54,17 +55,17 @@
# endif
=20
# if UINT_MAX =3D=3D UINT_MAX_32_BITS
- typedef unsigned int md5_uint32;
+typedef unsigned int md5_uint32;
# else
# if USHRT_MAX =3D=3D UINT_MAX_32_BITS
- typedef unsigned short md5_uint32;
+typedef unsigned short md5_uint32;
# else
# if ULONG_MAX =3D=3D UINT_MAX_32_BITS
- typedef unsigned long md5_uint32;
+typedef unsigned long md5_uint32;
# else
- /* The following line is intended to evoke an error.
- Using #error is not portable enough. */
- "Cannot determine unsigned 32-bit data type."
+/* The following line is intended to evoke an error.
+ Using #error is not portable enough. */
+"Cannot determine unsigned 32-bit data type."
# endif
# endif
# endif
@@ -72,9 +73,9 @@
=20
#undef __P
#if defined (__STDC__) && __STDC__
-#define __P(x) x
+#define __P(x) x
#else
-#define __P(x) ()
+#define __P(x) ()
#endif
=20
/* Structure to save state of computation between the single steps. */
@@ -104,14 +105,14 @@
starting at BUFFER.
It is necessary that LEN is a multiple of 64!!! */
extern void md5_process_block __P ((const void *buffer, size_t len,
- struct md5_ctx *ctx));
+ struct md5_ctx *ctx));
=20
/* Starting with the result of former calls of this function (or the
initialization function update the context for the next LEN bytes
starting at BUFFER.
It is NOT required that LEN is a multiple of 64. */
extern void md5_process_bytes __P ((const void *buffer, size_t len,
- struct md5_ctx *ctx));
+ struct md5_ctx *ctx));
=20
/* Process the remaining bytes in the buffer and put result from CTX
in first 16 bytes following RESBUF. The result is always in little
@@ -150,8 +151,8 @@
rol(md5_uint32 x, int n)
{
__asm__("roll %%cl,%0"
- :"=3Dr" (x)
- :"0" (x),"c" (n));
+ :"=3Dr" (x)
+ :"0" (x),"c" (n));
return x;
}
#else
Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/nav_print.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/libdvdread/dvdread/nav_print.h 2007-03-06 09:46=
:59 UTC (rev 1279)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/nav_print.h 2007-03-08 09:04=
:37 UTC (rev 1280)
@@ -1,3 +1,4 @@
+/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */
#ifndef NAV_PRINT_H_INCLUDED
#define NAV_PRINT_H_INCLUDED
=20
Modified: trunk/DvdMenuXtractor/libdvdread/dvdread/nav_read.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/libdvdread/dvdread/nav_read.h 2007-03-06 09:46:=
59 UTC (rev 1279)
+++ trunk/DvdMenuXtractor/libdvdread/dvdread/nav_read.h 2007-03-08 09:04:=
37 UTC (rev 1280)
@@ -1,3 +1,4 @@
+/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */
#ifndef NAV_READ_H_INCLUDED
#define NAV_READ_H_INCLUDED
=20
Modified: trunk/DvdMenuXtractor/libdvdread/src/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/libdvdread/src/Makefile.am 2007-03-06 09:46:59 =
UTC (rev 1279)
+++ trunk/DvdMenuXtractor/libdvdread/src/Makefile.am 2007-03-08 09:04:37 =
UTC (rev 1280)
@@ -4,7 +4,7 @@
=20
INCLUDES =3D -I$(top_srcdir)
=20
-noinst_PROGRAMS =3D ifo_dump play_title title_info disc_id
+noinst_PROGRAMS =3D ifo_dump play_title title_info disc_id filestat
=20
ifo_dump_SOURCES =3D ifo_dump.c
ifo_dump_LDADD =3D $(top_builddir)/dvdread/libdvdread.la @DL_LIBS@ @CSS_=
LIBS@
@@ -18,3 +18,6 @@
disc_id_SOURCES =3D disc_id.c
disc_id_LDADD =3D $(top_builddir)/dvdread/libdvdread.la @DL_LIBS@ @CSS_L=
IBS@
=20
+filestat_SOURCES =3D filestat.c
+filestat_LDADD =3D $(top_builddir)/dvdread/libdvdread.la @DL_LIBS@ @CSS_=
LIBS@
+
Modified: trunk/DvdMenuXtractor/libdvdread/src/Makefile.in
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/libdvdread/src/Makefile.in 2007-03-06 09:46:59 =
UTC (rev 1279)
+++ trunk/DvdMenuXtractor/libdvdread/src/Makefile.in 2007-03-08 09:04:37 =
UTC (rev 1280)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.6.2 from Makefile.am.
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
=20
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -17,153 +17,223 @@
#=20
# There really shouldn't be any need to use @DL_LIBS@ and @CSS_LIBS@
# here but old versions of libtool failed to do the correct thing
-SHELL =3D @SHELL@
=20
srcdir =3D @srcdir@
top_srcdir =3D @top_srcdir@
VPATH =3D @srcdir@
-prefix =3D @prefix@
-exec_prefix =3D @exec_prefix@
-
-bindir =3D @bindir@
-sbindir =3D @sbindir@
-libexecdir =3D @libexecdir@
-datadir =3D @datadir@
-sysconfdir =3D @sysconfdir@
-sharedstatedir =3D @sharedstatedir@
-localstatedir =3D @localstatedir@
-libdir =3D @libdir@
-infodir =3D @infodir@
-mandir =3D @mandir@
-includedir =3D @includedir@
-oldincludedir =3D /usr/include
pkgdatadir =3D $(datadir)/@PACKAGE@
pkglibdir =3D $(libdir)/@PACKAGE@
pkgincludedir =3D $(includedir)/@PACKAGE@
top_builddir =3D ..
-
-ACLOCAL =3D @ACLOCAL@
-AUTOCONF =3D @AUTOCONF@
-AUTOMAKE =3D @AUTOMAKE@
-AUTOHEADER =3D @AUTOHEADER@
-
am__cd =3D CDPATH=3D"$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL =3D @INSTALL@
-INSTALL_PROGRAM =3D @INSTALL_PROGRAM@
-INSTALL_DATA =3D @INSTALL_DATA@
install_sh_DATA =3D $(install_sh) -c -m 644
install_sh_PROGRAM =3D $(install_sh) -c
install_sh_SCRIPT =3D $(install_sh) -c
-INSTALL_SCRIPT =3D @INSTALL_SCRIPT@
INSTALL_HEADER =3D $(INSTALL_DATA)
-transform =3D @program_transform_name@
+transform =3D $(program_transform_name)
NORMAL_INSTALL =3D :
PRE_INSTALL =3D :
POST_INSTALL =3D :
NORMAL_UNINSTALL =3D :
PRE_UNINSTALL =3D :
POST_UNINSTALL =3D :
-host_alias =3D @host_alias@
+build_triplet =3D @build@
host_triplet =3D @host@
-
-EXEEXT =3D @EXEEXT@
-OBJEXT =3D @OBJEXT@
-PATH_SEPARATOR =3D @PATH_SEPARATOR@
+noinst_PROGRAMS =3D ifo_dump$(EXEEXT) play_title$(EXEEXT) \
+ title_info$(EXEEXT) disc_id$(EXEEXT) filestat$(EXEEXT)
+subdir =3D src
+DIST_COMMON =3D $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 =3D $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps =3D $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps =3D $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) =
\
+ $(ACLOCAL_M4)
+mkinstalldirs =3D $(install_sh) -d
+CONFIG_HEADER =3D $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =3D
+PROGRAMS =3D $(noinst_PROGRAMS)
+am_disc_id_OBJECTS =3D disc_id.$(OBJEXT)
+disc_id_OBJECTS =3D $(am_disc_id_OBJECTS)
+disc_id_DEPENDENCIES =3D $(top_builddir)/dvdread/libdvdread.la
+am_filestat_OBJECTS =3D filestat.$(OBJEXT)
+filestat_OBJECTS =3D $(am_filestat_OBJECTS)
+filestat_DEPENDENCIES =3D $(top_builddir)/dvdread/libdvdread.la
+am_ifo_dump_OBJECTS =3D ifo_dump.$(OBJEXT)
+ifo_dump_OBJECTS =3D $(am_ifo_dump_OBJECTS)
+ifo_dump_DEPENDENCIES =3D $(top_builddir)/dvdread/libdvdread.la
+am_play_title_OBJECTS =3D play_title.$(OBJEXT)
+play_title_OBJECTS =3D $(am_play_title_OBJECTS)
+play_title_DEPENDENCIES =3D $(top_builddir)/dvdread/libdvdread.la
+am_title_info_OBJECTS =3D title_info.$(OBJEXT)
+title_info_OBJECTS =3D $(am_title_info_OBJECTS)
+title_info_DEPENDENCIES =3D $(top_builddir)/dvdread/libdvdread.la
+DEFAULT_INCLUDES =3D -I. -I$(srcdir) -I$(top_builddir)
+depcomp =3D $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe =3D depfiles
+COMPILE =3D $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS)=
\
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE =3D $(LIBTOOL) --tag=3DCC --mode=3Dcompile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD =3D $(CC)
+LINK =3D $(LIBTOOL) --tag=3DCC --mode=3Dlink $(CCLD) $(AM_CFLAGS) $(CFLA=
GS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES =3D $(disc_id_SOURCES) $(filestat_SOURCES) $(ifo_dump_SOURCES) \
+ $(play_title_SOURCES) $(title_info_SOURCES)
+DIST_SOURCES =3D $(disc_id_SOURCES) $(filestat_SOURCES) \
+ $(ifo_dump_SOURCES) $(play_title_SOURCES) \
+ $(title_info_SOURCES)
+ETAGS =3D etags
+CTAGS =3D ctags
+DISTFILES =3D $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL =3D @ACLOCAL@
+AMDEP_FALSE =3D @AMDEP_FALSE@
+AMDEP_TRUE =3D @AMDEP_TRUE@
AMTAR =3D @AMTAR@
-AS =3D @AS@
+AR =3D @AR@
+AUTOCONF =3D @AUTOCONF@
+AUTOHEADER =3D @AUTOHEADER@
+AUTOMAKE =3D @AUTOMAKE@
AWK =3D @AWK@
CC =3D @CC@
+CCDEPMODE =3D @CCDEPMODE@
+CFLAGS =3D @CFLAGS@
+CPP =3D @CPP@
+CPPFLAGS =3D @CPPFLAGS@
CSS_CFLAGS =3D @CSS_CFLAGS@
CSS_LIBS =3D @CSS_LIBS@
+CXX =3D @CXX@
+CXXCPP =3D @CXXCPP@
+CXXDEPMODE =3D @CXXDEPMODE@
+CXXFLAGS =3D @CXXFLAGS@
+CYGPATH_W =3D @CYGPATH_W@
+DEFS =3D @DEFS@
DEPDIR =3D @DEPDIR@
-DLLTOOL =3D @DLLTOOL@
DL_LIBS =3D @DL_LIBS@
ECHO =3D @ECHO@
+ECHO_C =3D @ECHO_C@
+ECHO_N =3D @ECHO_N@
+ECHO_T =3D @ECHO_T@
+EGREP =3D @EGREP@
+EXEEXT =3D @EXEEXT@
+F77 =3D @F77@
+FFLAGS =3D @FFLAGS@
+INSTALL_DATA =3D @INSTALL_DATA@
+INSTALL_PROGRAM =3D @INSTALL_PROGRAM@
+INSTALL_SCRIPT =3D @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM =3D @INSTALL_STRIP_PROGRAM@
+LDFLAGS =3D @LDFLAGS@
+LIBOBJS =3D @LIBOBJS@
+LIBS =3D @LIBS@
LIBTOOL =3D @LIBTOOL@
LN_S =3D @LN_S@
+LTLIBOBJS =3D @LTLIBOBJS@
MAINT =3D @MAINT@
-OBJDUMP =3D @OBJDUMP@
+MAINTAINER_MODE_FALSE =3D @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE =3D @MAINTAINER_MODE_TRUE@
+MAKEINFO =3D @MAKEINFO@
+OBJEXT =3D @OBJEXT@
PACKAGE =3D @PACKAGE@
+PACKAGE_BUGREPORT =3D @PACKAGE_BUGREPORT@
+PACKAGE_NAME =3D @PACKAGE_NAME@
+PACKAGE_STRING =3D @PACKAGE_STRING@
+PACKAGE_TARNAME =3D @PACKAGE_TARNAME@
+PACKAGE_VERSION =3D @PACKAGE_VERSION@
+PATH_SEPARATOR =3D @PATH_SEPARATOR@
RANLIB =3D @RANLIB@
+SET_MAKE =3D @SET_MAKE@
+SHELL =3D @SHELL@
STRIP =3D @STRIP@
VERSION =3D @VERSION@
+ac_ct_AR =3D @ac_ct_AR@
+ac_ct_CC =3D @ac_ct_CC@
+ac_ct_CXX =3D @ac_ct_CXX@
+ac_ct_F77 =3D @ac_ct_F77@
+ac_ct_RANLIB =3D @ac_ct_RANLIB@
+ac_ct_STRIP =3D @ac_ct_STRIP@
+am__fastdepCC_FALSE =3D @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE =3D @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE =3D @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE =3D @am__fastdepCXX_TRUE@
am__include =3D @am__include@
+am__leading_dot =3D @am__leading_dot@
am__quote =3D @am__quote@
+am__tar =3D @am__tar@
+am__untar =3D @am__untar@
+bindir =3D @bindir@
+build =3D @build@
+build_alias =3D @build_alias@
+build_cpu =3D @build_cpu@
+build_os =3D @build_os@
+build_vendor =3D @build_vendor@
+datadir =3D @datadir@
+exec_prefix =3D @exec_prefix@
+host =3D @host@
+host_alias =3D @host_alias@
+host_cpu =3D @host_cpu@
+host_os =3D @host_os@
+host_vendor =3D @host_vendor@
+includedir =3D @includedir@
+infodir =3D @infodir@
install_sh =3D @install_sh@
-
+libdir =3D @libdir@
+libexecdir =3D @libexecdir@
+localstatedir =3D @localstatedir@
+mandir =3D @mandir@
+mkdir_p =3D @mkdir_p@
+oldincludedir =3D @oldincludedir@
+prefix =3D @prefix@
+program_transform_name =3D @program_transform_name@
+sbindir =3D @sbindir@
+sharedstatedir =3D @sharedstatedir@
+sysconfdir =3D @sysconfdir@
+target_alias =3D @target_alias@
INCLUDES =3D -I$(top_srcdir)
-
-noinst_PROGRAMS =3D ifo_dump play_title title_info disc_id
-
ifo_dump_SOURCES =3D ifo_dump.c
ifo_dump_LDADD =3D $(top_builddir)/dvdread/libdvdread.la @DL_LIBS@ @CSS_=
LIBS@
-
play_title_SOURCES =3D play_title.c
play_title_LDADD =3D $(top_builddir)/dvdread/libdvdread.la @DL_LIBS@ @CS=
S_LIBS@
-
title_info_SOURCES =3D title_info.c
title_info_LDADD =3D $(top_builddir)/dvdread/libdvdread.la @DL_LIBS@ @CS=
S_LIBS@
-
disc_id_SOURCES =3D disc_id.c
disc_id_LDADD =3D $(top_builddir)/dvdread/libdvdread.la @DL_LIBS@ @CSS_L=
IBS@
-subdir =3D src
-mkinstalldirs =3D $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER =3D $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =3D
-noinst_PROGRAMS =3D ifo_dump$(EXEEXT) play_title$(EXEEXT) \
- title_info$(EXEEXT) disc_id$(EXEEXT)
-PROGRAMS =3D $(noinst_PROGRAMS)
-
-am_disc_id_OBJECTS =3D disc_id.$(OBJEXT)
-disc_id_OBJECTS =3D $(am_disc_id_OBJECTS)
-disc_id_DEPENDENCIES =3D $(top_builddir)/dvdread/libdvdread.la
-disc_id_LDFLAGS =3D
-am_ifo_dump_OBJECTS =3D ifo_dump.$(OBJEXT)
-ifo_dump_OBJECTS =3D $(am_ifo_dump_OBJECTS)
-ifo_dump_DEPENDENCIES =3D $(top_builddir)/dvdread/libdvdread.la
-ifo_dump_LDFLAGS =3D
-am_play_title_OBJECTS =3D play_title.$(OBJEXT)
-play_title_OBJECTS =3D $(am_play_title_OBJECTS)
-play_title_DEPENDENCIES =3D $(top_builddir)/dvdread/libdvdread.la
-play_title_LDFLAGS =3D
-am_title_info_OBJECTS =3D title_info.$(OBJEXT)
-title_info_OBJECTS =3D $(am_title_info_OBJECTS)
-title_info_DEPENDENCIES =3D $(top_builddir)/dvdread/libdvdread.la
-title_info_LDFLAGS =3D
-
-DEFS =3D @DEFS@
-DEFAULT_INCLUDES =3D -I. -I$(srcdir) -I$(top_builddir)
-CPPFLAGS =3D @CPPFLAGS@
-LDFLAGS =3D @LDFLAGS@
-LIBS =3D @LIBS@
-depcomp =3D $(SHELL) $(top_srcdir)/depcomp
-am__depfiles_maybe =3D depfiles
- at AMDEP_TRUE@DEP_FILES =3D ./$(DEPDIR)/disc_id.Po ./$(DEPDIR)/ifo_dump.Po=
\
- at AMDEP_TRUE@ ./$(DEPDIR)/play_title.Po ./$(DEPDIR)/title_info.Po
-COMPILE =3D $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS)=
\
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE =3D $(LIBTOOL) --mode=3Dcompile $(CC) $(DEFS) $(DEFAULT_INCLUD=
ES) \
- $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD =3D $(CC)
-LINK =3D $(LIBTOOL) --mode=3Dlink $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-CFLAGS =3D @CFLAGS@
-DIST_SOURCES =3D $(disc_id_SOURCES) $(ifo_dump_SOURCES) \
- $(play_title_SOURCES) $(title_info_SOURCES)
-DIST_COMMON =3D Makefile.am Makefile.in
-SOURCES =3D $(disc_id_SOURCES) $(ifo_dump_SOURCES) $(play_title_SOURCES)=
$(title_info_SOURCES)
-
+filestat_SOURCES =3D filestat.c
+filestat_LDADD =3D $(top_builddir)/dvdread/libdvdread.la @DL_LIBS@ @CSS_=
LIBS@
all: all-am
=20
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)=
/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(a=
m__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu src/Makefile
-Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/=
config.status
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfi=
les_maybe)
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ =
$(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__d=
epfiles_maybe);; \
+ esac;
=20
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_D=
EPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
clean-noinstPROGRAMS:
@list=3D'$(noinst_PROGRAMS)'; for p in $$list; do \
f=3D`echo $$p|sed 's/$(EXEEXT)$$//'`; \
@@ -173,6 +243,9 @@
disc_id$(EXEEXT): $(disc_id_OBJECTS) $(disc_id_DEPENDENCIES)=20
@rm -f disc_id$(EXEEXT)
$(LINK) $(disc_id_LDFLAGS) $(disc_id_OBJECTS) $(disc_id_LDADD) $(LIBS)
+filestat$(EXEEXT): $(filestat_OBJECTS) $(filestat_DEPENDENCIES)=20
+ @rm -f filestat$(EXEEXT)
+ $(LINK) $(filestat_LDFLAGS) $(filestat_OBJECTS) $(filestat_LDADD) $(LIB=
S)
ifo_dump$(EXEEXT): $(ifo_dump_OBJECTS) $(ifo_dump_DEPENDENCIES)=20
@rm -f ifo_dump$(EXEEXT)
$(LINK) $(ifo_dump_LDFLAGS) $(ifo_dump_OBJECTS) $(ifo_dump_LDADD) $(LIB=
S)
@@ -184,37 +257,37 @@
$(LINK) $(title_info_LDFLAGS) $(title_info_OBJECTS) $(title_info_LDADD)=
$(LIBS)
=20
mostlyclean-compile:
- -rm -f *.$(OBJEXT) core *.core
+ -rm -f *.$(OBJEXT)
=20
distclean-compile:
-rm -f *.tab.c
=20
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/disc_id.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/filestat.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ifo_dump.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/play_title.Po at am__quote=
@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/title_info.Po at am__quote=
@
=20
-distclean-depend:
- -rm -rf ./$(DEPDIR)
-
.c.o:
- at AMDEP_TRUE@ source=3D'$<' object=3D'$@' libtool=3Dno @AMDEPBACKSLASH@
- at AMDEP_TRUE@ depfile=3D'$(DEPDIR)/$*.Po' tmpdepfile=3D'$(DEPDIR)/$*.TPo'=
@AMDEPBACKSLASH@
- at AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
+ at am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo"=
-c -o $@ $<; \
+ at am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; el=
se rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source=3D'$<' object=3D'$@' libtool=3D=
no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=3D$(DEPDIR) $(CCDEPMODE) $(depc=
omp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c $<
=20
.c.obj:
- at AMDEP_TRUE@ source=3D'$<' object=3D'$@' libtool=3Dno @AMDEPBACKSLASH@
- at AMDEP_TRUE@ depfile=3D'$(DEPDIR)/$*.Po' tmpdepfile=3D'$(DEPDIR)/$*.TPo'=
@AMDEPBACKSLASH@
- at AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- $(COMPILE) -c `cygpath -w $<`
+ at am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo"=
-c -o $@ `$(CYGPATH_W) '$<'`; \
+ at am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; el=
se rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source=3D'$<' object=3D'$@' libtool=3D=
no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=3D$(DEPDIR) $(CCDEPMODE) $(depc=
omp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
=20
.c.lo:
- at AMDEP_TRUE@ source=3D'$<' object=3D'$@' libtool=3Dyes @AMDEPBACKSLASH@
- at AMDEP_TRUE@ depfile=3D'$(DEPDIR)/$*.Plo' tmpdepfile=3D'$(DEPDIR)/$*.TPl=
o' @AMDEPBACKSLASH@
- at AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
-CCDEPMODE =3D @CCDEPMODE@
+ at am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tp=
o" -c -o $@ $<; \
+ at am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; e=
lse rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ source=3D'$<' object=3D'$@' libtool=3D=
yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=3D$(DEPDIR) $(CCDEPMODE) $(depc=
omp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
=20
mostlyclean-libtool:
-rm -f *.lo
@@ -226,11 +299,6 @@
-rm -f libtool
uninstall-info-am:
=20
-ETAGS =3D etags
-ETAGSFLAGS =3D
-
-tags: TAGS
-
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list=3D'$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=3D`for i in $$list; do \
@@ -239,6 +307,7 @@
$(AWK) ' { files[$$0] =3D 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
+tags: TAGS
=20
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
@@ -250,8 +319,24 @@
done | \
$(AWK) ' { files[$$0] =3D 1; } \
END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$tags$$unique" \
- || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=3D$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=3D; \
+ here=3D`pwd`; \
+ list=3D'$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=3D`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] =3D 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
=20
GTAGS:
@@ -260,19 +345,21 @@
&& gtags -i $(GTAGS_ARGS) $$here
=20
distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
-DISTFILES =3D $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
=20
-top_distdir =3D ..
-distdir =3D $(top_distdir)/$(PACKAGE)-$(VERSION)
-
distdir: $(DISTFILES)
- @list=3D'$(DISTFILES)'; for file in $$list; do \
+ @srcdirstrip=3D`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=3D`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list=3D'$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=3D`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=3D`echo "$$file" | sed "s|^$$topsrcdirstrip/|=
$(top_builddir)/|"`;; \
+ esac; \
if test -f $$file || test -d $$file; then d=3D.; else d=3D$(srcdir); =
fi; \
dir=3D`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" !=3D "$$file" && test "$$dir" !=3D "."; then \
dir=3D"/$$dir"; \
- $(mkinstalldirs) "$(distdir)$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
else \
dir=3D''; \
fi; \
@@ -290,9 +377,7 @@
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
-
installdirs:
-
install: install-am
install-exec: install-exec-am
install-data: install-data-am
@@ -304,7 +389,7 @@
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM=3D"$(INSTALL_STRIP_PROGRAM)" \
- INSTALL_STRIP_FLAG=3D-s \
+ install_sh_PROGRAM=3D"$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=3D=
-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=3DSTRIPPROG=3D'$(STRIP)'"` install
mostlyclean-generic:
@@ -312,7 +397,7 @@
clean-generic:
=20
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
=20
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -323,14 +408,17 @@
mostlyclean-am
=20
distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
=20
-distclean-am: clean-am distclean-compile distclean-depend \
- distclean-generic distclean-libtool distclean-tags
-
dvi: dvi-am
=20
dvi-am:
=20
+html: html-am
+
info: info-am
=20
info-am:
@@ -346,7 +434,8 @@
installcheck-am:
=20
maintainer-clean: maintainer-clean-am
-
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
=20
mostlyclean: mostlyclean-am
@@ -354,18 +443,27 @@
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
=20
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
uninstall-am: uninstall-info-am
=20
-.PHONY: GTAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-noinstPROGRAMS distclean distclean-compile \
- distclean-depend distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am info info-am install \
- install-am install-data install-data-am install-exec \
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstPROGRAMS ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- tags uninstall uninstall-am uninstall-info-am
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-info-am
=20
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
Modified: trunk/DvdMenuXtractor/libdvdread/src/filestat.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/libdvdread/src/filestat.c 2007-03-06 09:46:59 U=
TC (rev 1279)
+++ trunk/DvdMenuXtractor/libdvdread/src/filestat.c 2007-03-08 09:04:37 U=
TC (rev 1280)
@@ -70,18 +70,10 @@
if(titlenum =3D=3D 0) {
switch(dom) {
case DVD_READ_INFO_FILE:
-#if defined(_CRT_SECURE_NO_DEPRECAT)
sprintf(filename, "VIDEO_TS.IFO");
-#else
- sprintf_s(filename, 256, "VIDEO_TS.IFO");
-#endif
break;
case DVD_READ_INFO_BACKUP_FILE:
-#if defined(_CRT_SECURE_NO_DEPRECAT)
sprintf(filename, "VIDEO_TS.BUP");
-#else
- sprintf_s(filename, 256, "VIDEO_TS.BUP");
-#endif
break;
case DVD_READ_MENU_VOBS:
sprintf(filename, "VIDEO_TS.VOB");
Modified: trunk/DvdMenuXtractor/libdvdread/win32/dirent.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/libdvdread/win32/dirent.c 2007-03-06 09:46:59 U=
TC (rev 1279)
+++ trunk/DvdMenuXtractor/libdvdread/win32/dirent.c 2007-03-08 09:04:37 U=
TC (rev 1280)
@@ -1,298 +1,297 @@
-/*
- * dirent.c
- *
- * Derived from DIRLIB.C by Matt J. Weinstein=20
- * This note appears in the DIRLIB.H
- * DIRLIB.H by M. J. Weinstein Released to public domain 1-Jan-89
- *
- * Updated by Jeremy Bettis <jeremy at hksys.com>
- * Significantly revised and rewinddir, seekdir and telldir added by Col=
in
- * Peters <colin at fu.is.saga-u.ac.jp>
- *
- * Resource leaks fixed by <steve.lhomme at free.fr>
- *
- *=09
- * $Revision: 1.1 $
- * $Author: ds $
- * $Date: 2004/04/29 02:52:21 $
- *
- */
-
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-#include <io.h>
-#include <direct.h>
-#include "dirent.h"
-#include "gtchar.h"
-#define SUFFIX _T("*")
-#define SLASH _T("\\")
-
-#include <stdio.h>
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h> /* for GetFileAttributes */
-
-/*
- * opendir
- *
- * Returns a pointer to a DIR structure appropriately filled in to begin
- * searching a directory.
- */
-_TDIR *
-_topendir (const _TCHAR * szPath)
-{
- _TDIR *nd;
- unsigned int rc;
- _TCHAR szFullPath[MAX_PATH];
-
- errno =3D 0;
-
- if (!szPath) {
- errno =3D EFAULT;
- return (_TDIR *) 0;
- }
-
- if (szPath[0] =3D=3D _T ('\0')) {
- errno =3D ENOTDIR;
- return (_TDIR *) 0;
- }
-
- /* Attempt to determine if the given path really is a directory. */
- rc =3D GetFileAttributes (szPath);
- if (rc =3D=3D (unsigned int) -1) {
- /* call GetLastError for more error info */
- errno =3D ENOENT;
- return (_TDIR *) 0;
- }
- if (!(rc & FILE_ATTRIBUTE_DIRECTORY)) {
- /* Error, entry exists but not a directory. */
- errno =3D ENOTDIR;
- return (_TDIR *) 0;
- }
-
- /* Make an absolute pathname. */
- _tfullpath (szFullPath, szPath, MAX_PATH);
-
- /* Allocate enough space to store DIR structure and the complete
- * directory path given. */
- nd =3D (_TDIR *) malloc (sizeof (_TDIR) + (_tcslen (szFullPath) +
- _tcslen (SLASH) + _tcslen (SUFFIX) + 1) * sizeof (_TCHAR));
-
- if (!nd) {
- /* Error, out of memory. */
- errno =3D ENOMEM;
- return (_TDIR *) 0;
- }
-
- /* Create the search expression. */
- _tcscpy (nd->dd_name, szFullPath);
-
- /* Add on a slash if the path does not end with one. */
- if (nd->dd_name[0] !=3D _T ('\0') &&
- nd->dd_name[_tcslen (nd->dd_name) - 1] !=3D _T ('/') &&
- nd->dd_name[_tcslen (nd->dd_name) - 1] !=3D _T ('\\')) {
- _tcscat_s (nd->dd_name, MAX_PATH, SLASH);
- }
-
- /* Add on the search pattern */
- _tcscat (nd->dd_name, SUFFIX);
-
- /* Initialize handle to -1 so that a premature closedir doesn't try
- * to call _findclose on it. */
- nd->dd_handle =3D -1;
-
- /* Initialize the status. */
- nd->dd_stat =3D 0;
-
- /* Initialize the dirent structure. ino and reclen are invalid under
- * Win32, and name simply points at the appropriate part of the
- * findfirst_t structure. */
- nd->dd_dir.d_ino =3D 0;
- nd->dd_dir.d_reclen =3D 0;
- nd->dd_dir.d_namlen =3D 0;
- // Added by jcsston 02/04/2004, memset was writing to a bad pointer
- nd->dd_dir.d_name =3D malloc (FILENAME_MAX);
- // End add
- memset (nd->dd_dir.d_name, 0, FILENAME_MAX);
-
- return nd;
-}
-
-
-/*
- * readdir
- *
- * Return a pointer to a dirent structure filled with the information on=
the
- * next entry in the directory.
- */
-struct _tdirent *
-_treaddir (_TDIR * dirp)
-{
- errno =3D 0;
-
- /* Check for valid DIR struct. */
- if (!dirp) {
- errno =3D EFAULT;
- return (struct _tdirent *) 0;
- }
-
- if (dirp->dd_stat < 0) {
- /* We have already returned all files in the directory
- * (or the structure has an invalid dd_stat). */
- return (struct _tdirent *) 0;
- } else if (dirp->dd_stat =3D=3D 0) {
- /* We haven't started the search yet. */
- /* Start the search */
- dirp->dd_handle =3D _tfindfirst (dirp->dd_name, &(dirp->dd_dta));
-
- if (dirp->dd_handle =3D=3D -1) {
- /* Whoops! Seems there are no files in that
- * directory. */
- dirp->dd_stat =3D -1;
- } else {
- dirp->dd_stat =3D 1;
- }
- } else {
- /* Get the next search entry. */
- if (_tfindnext (dirp->dd_handle, &(dirp->dd_dta))) {
- /* We are off the end or otherwise error. =20
- _findnext sets errno to ENOENT if no more file
- Undo this. */
- DWORD winerr =3D GetLastError ();
-
- if (winerr =3D=3D ERROR_NO_MORE_FILES)
- errno =3D 0;
- _findclose (dirp->dd_handle);
- dirp->dd_handle =3D -1;
- dirp->dd_stat =3D -1;
- } else {
- /* Update the status to indicate the correct
- * number. */
- dirp->dd_stat++;
- }
- }
-
- if (dirp->dd_stat > 0) {
- /* Successfully got an entry. Everything about the file is
- * already appropriately filled in except the length of the
- * file name. */
- dirp->dd_dir.d_namlen =3D _tcslen (dirp->dd_dta.name);
- _tcscpy (dirp->dd_dir.d_name, dirp->dd_dta.name);
- return &dirp->dd_dir;
- }
-
- return (struct _tdirent *) 0;
-}
-
-
-/*
- * closedir
- *
- * Frees up resources allocated by opendir.
- */
-int
-_tclosedir (_TDIR * dirp)
-{
- int rc;
-
- errno =3D 0;
- rc =3D 0;
-
- if (!dirp) {
- errno =3D EFAULT;
- return -1;
- }
-
- if (dirp->dd_handle !=3D -1) {
- rc =3D _findclose (dirp->dd_handle);
- }
-
- if (dirp->dd_dir.d_name)
- free(dirp->dd_dir.d_name);
-
- /* Delete the dir structure. */
- free (dirp);
-
- return rc;
-}
-
-/*
- * rewinddir
- *
- * Return to the beginning of the directory "stream". We simply call fin=
dclose
- * and then reset things like an opendir.
- */
-void
-_trewinddir (_TDIR * dirp)
-{
- errno =3D 0;
-
- if (!dirp) {
- errno =3D EFAULT;
- return;
- }
-
- if (dirp->dd_handle !=3D -1) {
- _findclose (dirp->dd_handle);
- }
-
- dirp->dd_handle =3D -1;
- dirp->dd_stat =3D 0;
-}
-
-/*
- * telldir
- *
- * Returns the "position" in the "directory stream" which can be used wi=
th
- * seekdir to go back to an old entry. We simply return the value in sta=
t.
- */
-long
-_ttelldir (_TDIR * dirp)
-{
- errno =3D 0;
-
- if (!dirp) {
- errno =3D EFAULT;
- return -1;
- }
- return dirp->dd_stat;
-}
-
-/*
- * seekdir
- *
- * Seek to an entry previously returned by telldir. We rewind the direct=
ory
- * and call readdir repeatedly until either dd_stat is the position numb=
er
- * or -1 (off the end). This is not perfect, in that the directory may
- * have changed while we weren't looking. But that is probably the case =
with
- * any such system.
- */
-void
-_tseekdir (_TDIR * dirp, long lPos)
-{
- errno =3D 0;
-
- if (!dirp) {
- errno =3D EFAULT;
- return;
- }
-
- if (lPos < -1) {
- /* Seeking to an invalid position. */
- errno =3D EINVAL;
- return;
- } else if (lPos =3D=3D -1) {
- /* Seek past end. */
- if (dirp->dd_handle !=3D -1) {
- _findclose (dirp->dd_handle);
- }
- dirp->dd_handle =3D -1;
- dirp->dd_stat =3D -1;
- } else {
- /* Rewind and read forward to the appropriate index. */
- _trewinddir (dirp);
-
- while ((dirp->dd_stat < lPos) && _treaddir (dirp));
- }
-}
+/*
+ * dirent.c
+ *
+ * Derived from DIRLIB.C by Matt J. Weinstein=20
+ * This note appears in the DIRLIB.H
+ * DIRLIB.H by M. J. Weinstein Released to public domain 1-Jan-89
+ *
+ * Updated by Jeremy Bettis <jeremy at hksys.com>
+ * Significantly revised and rewinddir, seekdir and telldir added by Col=
in
+ * Peters <colin at fu.is.saga-u.ac.jp>
+ *
+ * Resource leaks fixed by <steve.lhomme at free.fr>
+ *
+ *=09
+ * $Revision: 1.1 $
+ * $Author: ds $
+ * $Date: 2004/04/29 02:52:21 $
+ *
+ */
+
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <io.h>
+#include <direct.h>
+#include "dirent.h"
+#define SLASH "\\"
+#define SUFFIX "*"
+
+#include <stdio.h>
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h> /* for GetFileAttributes */
+
+/*
+ * opendir
+ *
+ * Returns a pointer to a DIR structure appropriately filled in to begin
+ * searching a directory.
+ */
+DIR *
+opendir (const char * szPath)
+{
+ DIR *nd;
+ unsigned int rc;
+ char szFullPath[MAX_PATH];
+
+ errno =3D 0;
+
+ if (!szPath) {
+ errno =3D EFAULT;
+ return (DIR *) 0;
+ }
+
+ if (szPath[0] =3D=3D '\0') {
+ errno =3D ENOTDIR;
+ return (DIR *) 0;
+ }
+
+ /* Attempt to determine if the given path really is a directory. */
+ rc =3D GetFileAttributesA (szPath);
+ if (rc =3D=3D (unsigned int) -1) {
+ /* call GetLastError for more error info */
+ errno =3D ENOENT;
+ return (DIR *) 0;
+ }
+ if (!(rc & FILE_ATTRIBUTE_DIRECTORY)) {
+ /* Error, entry exists but not a directory. */
+ errno =3D ENOTDIR;
+ return (DIR *) 0;
+ }
+
+ /* Make an absolute pathname. */
+ _fullpath (szFullPath, szPath, MAX_PATH);
+
+ /* Allocate enough space to store DIR structure and the complete
+ * directory path given. */
+ nd =3D (DIR *) malloc (sizeof (DIR) + (strlen (szFullPath) +
+ strlen (SLASH) + strlen (SUFFIX) + 1) * sizeof (char));
+
+ if (!nd) {
+ /* Error, out of memory. */
+ errno =3D ENOMEM;
+ return (DIR *) 0;
+ }
+
+ /* Create the search expression. */
+ strcpy (nd->dd_name, szFullPath);
+
+ /* Add on a slash if the path does not end with one. */
+ if (nd->dd_name[0] !=3D '\0' &&
+ nd->dd_name[strlen (nd->dd_name) - 1] !=3D '/'&&
+ nd->dd_name[strlen (nd->dd_name) - 1] !=3D '\\') {
+ strcat_s (nd->dd_name, MAX_PATH, SLASH);
+ }
+
+ /* Add on the search pattern */
+ strcat (nd->dd_name, SUFFIX);
+
+ /* Initialize handle to -1 so that a premature closedir doesn't try
+ * to call _findclose on it. */
+ nd->dd_handle =3D -1;
+
+ /* Initialize the status. */
+ nd->dd_stat =3D 0;
+
+ /* Initialize the dirent structure. ino and reclen are invalid under
+ * Win32, and name simply points at the appropriate part of the
+ * findfirst_t structure. */
+ nd->dd_dir.d_ino =3D 0;
+ nd->dd_dir.d_reclen =3D 0;
+ nd->dd_dir.d_namlen =3D 0;
+ // Added by jcsston 02/04/2004, memset was writing to a bad pointer
+ nd->dd_dir.d_name =3D malloc (FILENAME_MAX);
+ // End add
+ memset (nd->dd_dir.d_name, 0, FILENAME_MAX);
+
+ return nd;
+}
+
+
+/*
+ * readdir
+ *
+ * Return a pointer to a dirent structure filled with the information on=
the
+ * next entry in the directory.
+ */
+struct dirent *
+readdir (DIR * dirp)
+{
+ errno =3D 0;
+
+ /* Check for valid DIR struct. */
+ if (!dirp) {
+ errno =3D EFAULT;
+ return (struct dirent *) 0;
+ }
+
+ if (dirp->dd_stat < 0) {
+ /* We have already returned all files in the directory
+ * (or the structure has an invalid dd_stat). */
+ return (struct dirent *) 0;
+ } else if (dirp->dd_stat =3D=3D 0) {
+ /* We haven't started the search yet. */
+ /* Start the search */
+ dirp->dd_handle =3D _findfirst (dirp->dd_name, &(dirp->dd_dta));
+
+ if (dirp->dd_handle =3D=3D -1) {
+ /* Whoops! Seems there are no files in that
+ * directory. */
+ dirp->dd_stat =3D -1;
+ } else {
+ dirp->dd_stat =3D 1;
+ }
+ } else {
+ /* Get the next search entry. */
+ if (_findnext (dirp->dd_handle, &(dirp->dd_dta))) {
+ /* We are off the end or otherwise error. =20
+ _findnext sets errno to ENOENT if no more file
+ Undo this. */
+ DWORD winerr =3D GetLastError ();
+
+ if (winerr =3D=3D ERROR_NO_MORE_FILES)
+ errno =3D 0;
+ _findclose (dirp->dd_handle);
+ dirp->dd_handle =3D -1;
+ dirp->dd_stat =3D -1;
+ } else {
+ /* Update the status to indicate the correct
+ * number. */
+ dirp->dd_stat++;
+ }
+ }
+
+ if (dirp->dd_stat > 0) {
+ /* Successfully got an entry. Everything about the file is
+ * already appropriately filled in except the length of the
+ * file name. */
+ dirp->dd_dir.d_namlen =3D strlen (dirp->dd_dta.name);
+ strcpy (dirp->dd_dir.d_name, dirp->dd_dta.name);
+ return &dirp->dd_dir;
+ }
+
+ return (struct dirent *) 0;
+}
+
+
+/*
+ * closedir
+ *
+ * Frees up resources allocated by opendir.
+ */
+int
+closedir (DIR * dirp)
+{
+ int rc;
+
+ errno =3D 0;
+ rc =3D 0;
+
+ if (!dirp) {
+ errno =3D EFAULT;
+ return -1;
+ }
+
+ if (dirp->dd_handle !=3D -1) {
+ rc =3D _findclose (dirp->dd_handle);
+ }
+
+ if (dirp->dd_dir.d_name)
+ free(dirp->dd_dir.d_name);
+
+ /* Delete the dir structure. */
+ free (dirp);
+
+ return rc;
+}
+
+/*
+ * rewinddir
+ *
+ * Return to the beginning of the directory "stream". We simply call fin=
dclose
+ * and then reset things like an opendir.
+ */
+void
+rewinddir (DIR * dirp)
+{
+ errno =3D 0;
+
+ if (!dirp) {
+ errno =3D EFAULT;
+ return;
+ }
+
+ if (dirp->dd_handle !=3D -1) {
+ _findclose (dirp->dd_handle);
+ }
+
+ dirp->dd_handle =3D -1;
+ dirp->dd_stat =3D 0;
+}
+
+/*
+ * telldir
+ *
+ * Returns the "position" in the "directory stream" which can be used wi=
th
+ * seekdir to go back to an old entry. We simply return the value in sta=
t.
+ */
+long
+telldir (DIR * dirp)
+{
+ errno =3D 0;
+
+ if (!dirp) {
+ errno =3D EFAULT;
+ return -1;
+ }
+ return dirp->dd_stat;
+}
+
+/*
+ * seekdir
+ *
+ * Seek to an entry previously returned by telldir. We rewind the direct=
ory
+ * and call readdir repeatedly until either dd_stat is the position numb=
er
+ * or -1 (off the end). This is not perfect, in that the directory may
+ * have changed while we weren't looking. But that is probably the case =
with
+ * any such system.
+ */
+void
+seekdir (DIR * dirp, long lPos)
+{
+ errno =3D 0;
+
+ if (!dirp) {
+ errno =3D EFAULT;
+ return;
+ }
+
+ if (lPos < -1) {
+ /* Seeking to an invalid position. */
+ errno =3D EINVAL;
+ return;
+ } else if (lPos =3D=3D -1) {
+ /* Seek past end. */
+ if (dirp->dd_handle !=3D -1) {
+ _findclose (dirp->dd_handle);
+ }
+ dirp->dd_handle =3D -1;
+ dirp->dd_stat =3D -1;
+ } else {
+ /* Rewind and read forward to the appropriate index. */
+ rewinddir (dirp);
+
+ while ((dirp->dd_stat < lPos) && readdir (dirp));
+ }
+}
Deleted: trunk/DvdMenuXtractor/libdvdread/win32/gtchar.h
Modified: trunk/DvdMenuXtractor/libdvdread/win32/posix.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/libdvdread/win32/posix.h 2007-03-06 09:46:59 UT=
C (rev 1279)
+++ trunk/DvdMenuXtractor/libdvdread/win32/posix.h 2007-03-08 09:04:37 UT=
C (rev 1280)
@@ -29,6 +29,8 @@
#include <stdlib.h>
=20
#define PATH_MAX _MAX_PATH
+#define strcasecmp(x, y) stricmp(x, y)
+#define strncasecmp(x, y, z) strnicmp(x, y, z)
=20
#include <windows.h>
#define dlclose(x) FreeLibrary(x)
Modified: trunk/DvdMenuXtractor/logtextedit.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/logtextedit.cpp 2007-03-06 09:46:59 UTC (rev 12=
79)
+++ trunk/DvdMenuXtractor/logtextedit.cpp 2007-03-08 09:04:37 UTC (rev 12=
80)
@@ -1,46 +1,50 @@
-#include <QDate>
-#include <QFile>
-#include <QTextStream>
-#include "logtextedit.h"
-#include "outputreader.h"
-
-LogTextEdit::LogTextEdit(QWidget *parent)
- : QTextEdit(parent), notifier_(OutputReader::instance())
-{
- // set flags
- setReadOnly(true);
- setLineWrapMode(QTextEdit::NoWrap);
-
- if (!notifier_.redirect())
- {
- setHtml("ERROR: Could not start output redirection");
- notifier_.cancelRedirect();
- return;
- }
-
- // setup slots
- connect(¬ifier_, SIGNAL(readyReadStandardError()), this, SLOT(standa=
rdErrorReady()));
- connect(¬ifier_, SIGNAL(readyReadStandardOutput()), this, SLOT(stand=
ardOutputReady()));
-}
-
-LogTextEdit::~LogTextEdit()
-{
-}
-
-void LogTextEdit::standardErrorReady()
-{
- static const QString format("%1;%2 - WARNING: %3");
-=09
- QString message =3D notifier_.readError();
- foreach (QString line, message.split('\n', QString::SkipEmptyParts))
- append(format.arg(QDate::currentDate().toString(), QTime::currentTime(=
).toString(), line));
-}
-
-void LogTextEdit::standardOutputReady()
-{
- static const QString format("%1;%2: %3");
-
- QString message =3D notifier_.readOutput();
- foreach (QString line, message.split('\n', QString::SkipEmptyParts))
- append(format.arg(QDate::currentDate().toString(), QTime::currentTime(=
).toString(), line));
-}
+#include <QDate>
+#include <QFile>
+#include <QTextStream>
+#include "logtextedit.h"
+#include "outputreader.h"
+
+LogTextEdit::LogTextEdit(QWidget *parent)
+ : QTextEdit(parent), notifier_(OutputReader::instance())
+{
+ // set flags
+ setReadOnly(true);
+ setLineWrapMode(QTextEdit::NoWrap);
+
+ if (!notifier_.redirect())
+ {
+ setHtml("ERROR: Could not start output redirection");
+ notifier_.cancelRedirect();
+ return;
+ }
+
+ // setup slots
+ connect(¬ifier_, SIGNAL(readyReadStandardError()), this, SLOT(standa=
rdErrorReady()));
+ connect(¬ifier_, SIGNAL(readyReadStandardOutput()), this, SLOT(stand=
ardOutputReady()));
+}
+
+LogTextEdit::~LogTextEdit()
+{
+}
+
+void LogTextEdit::standardErrorReady()
+{
+ static const QString format("%1;%2 - WARNING: %3");
+=09
+ int index =3D 0;
+ QString message =3D notifier_.readError();
+ QStringList messages =3D message.split('\n', QString::SkipEmptyParts);
+ for (index =3D 0; index < messages.size(); ++index)
+ append(format.arg(QDate::currentDate().toString(), QTime::currentTime(=
).toString(), messages.at(index)));
+}
+
+void LogTextEdit::standardOutputReady()
+{
+ static const QString format("%1;%2: %3");
+
+ int index =3D 0;
+ QString message =3D notifier_.readOutput();
+ QStringList messages =3D message.split('\n', QString::SkipEmptyParts);
+ for (index =3D 0; index < messages.size(); ++index)
+ append(format.arg(QDate::currentDate().toString(), QTime::currentTime(=
).toString(), messages.at(index)));
+}
Modified: trunk/DvdMenuXtractor/mpegparser/CircBuffer.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/mpegparser/CircBuffer.cpp 2007-03-06 09:46:59 U=
TC (rev 1279)
+++ trunk/DvdMenuXtractor/mpegparser/CircBuffer.cpp 2007-03-08 09:04:37 U=
TC (rev 1280)
@@ -22,7 +22,7 @@
=20
#include "CircBuffer.h"
#include <string.h>
-#include <assert.h>
+#include <cassert>
=20
CircBuffer::CircBuffer(uint32_t size){
m_buf =3D new binary[size];
Modified: trunk/DvdMenuXtractor/mpegparser/M2VParser.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/mpegparser/M2VParser.cpp 2007-03-06 09:46:59 UT=
C (rev 1279)
+++ trunk/DvdMenuXtractor/mpegparser/M2VParser.cpp 2007-03-08 09:04:37 UT=
C (rev 1280)
@@ -39,10 +39,13 @@
this->size =3D size;
firstRef =3D -1;
secondRef =3D -1;
+ seqHdrData =3D NULL;
+ seqHdrDataSize =3D 0;
}
=20
MPEGFrame::~MPEGFrame(){
safefree(data);
+ safefree(seqHdrData);
}
=20
void M2VParser::SetEOS(){
@@ -124,6 +127,8 @@
nextSkip =3D -1;
nextSkipDuration =3D -1;
seqHdrChunk =3D NULL;
+ gopChunk =3D NULL;
+ keepSeqHdrsInBitstream =3D true;
}
=20
int32_t M2VParser::InitParser(){
@@ -156,6 +161,7 @@
M2VParser::~M2VParser(){
DumpQueues();
delete seqHdrChunk;
+ delete gopChunk;
delete mpgBuf;
}
=20
@@ -203,7 +209,7 @@
MPEGChunk* c =3D chunks[i];
if(c->GetType() =3D=3D MPEG_VIDEO_PICTURE_START_CODE){
MPEG2PictureHeader h;
- ParsePictureHeader(c, h);
+ ParsePictureHeader(c, h);
if(h.frameType =3D=3D MPEG2_B_FRAME){
count +=3D GetFrameDuration(h);
}else{
@@ -214,26 +220,50 @@
return -1;
}
=20
-int32_t M2VParser::QueueFrame(MPEGChunk* seqHdr, MPEGChunk* chunk, Media=
Time timecode, MPEG2PictureHeader picHdr){
+int32_t M2VParser::QueueFrame(MPEGChunk* chunk, MediaTime timecode, MPEG=
2PictureHeader picHdr){
MPEGFrame* outBuf;
bool bCopy =3D true;
binary* pData =3D chunk->GetPointer();
uint32_t dataLen =3D chunk->GetSize();
=20
- if(seqHdr){
+ if ((seqHdrChunk && keepSeqHdrsInBitstream &&
+ (MPEG2_I_FRAME =3D=3D picHdr.frameType)) || gopChunk) {
+ uint32_t pos =3D 0;
bCopy =3D false;
- dataLen +=3D seqHdr->GetSize();
+ dataLen +=3D
+ (seqHdrChunk && keepSeqHdrsInBitstream ? seqHdrChunk->GetSize() : =
0) +
+ (gopChunk ? gopChunk->GetSize() : 0);
pData =3D (binary *)safemalloc(dataLen);
- memcpy(pData, seqHdr->GetPointer(), seqHdr->GetSize());
- memcpy(pData+seqHdr->GetSize(),chunk->GetPointer(), chunk->GetSize()=
);
- delete seqHdr;
- seqHdr =3D NULL;
+ if (seqHdrChunk && keepSeqHdrsInBitstream &&
+ (MPEG2_I_FRAME =3D=3D picHdr.frameType)) {
+ memcpy(pData, seqHdrChunk->GetPointer(), seqHdrChunk->GetSize());
+ pos +=3D seqHdrChunk->GetSize();
+ delete seqHdrChunk;
+ seqHdrChunk =3D NULL;
+ }
+ if (gopChunk) {
+ memcpy(pData + pos, gopChunk->GetPointer(), gopChunk->GetSize());
+ pos +=3D gopChunk->GetSize();
+ delete gopChunk;
+ gopChunk =3D NULL;
+ }
+ memcpy(pData + pos, chunk->GetPointer(), chunk->GetSize());
}
=20
MediaTime duration =3D GetFrameDuration(picHdr);
=20
outBuf =3D new MPEGFrame(pData, dataLen, bCopy);
=20
+ if (seqHdrChunk && !keepSeqHdrsInBitstream &&
+ (MPEG2_I_FRAME =3D=3D picHdr.frameType)) {
+ outBuf->seqHdrData =3D (binary *)safemalloc(seqHdrChunk->GetSize());
+ outBuf->seqHdrDataSize =3D seqHdrChunk->GetSize();
+ memcpy(outBuf->seqHdrData, seqHdrChunk->GetPointer(),
+ outBuf->seqHdrDataSize);
+ delete seqHdrChunk;
+ seqHdrChunk =3D NULL;
+ }
+
if(picHdr.frameType =3D=3D MPEG2_I_FRAME){
outBuf->frameType =3D 'I';
}else if(picHdr.frameType =3D=3D MPEG2_P_FRAME){
@@ -282,26 +312,27 @@
while(!done){
MediaTime myTime =3D currentStampingTime;
MPEGChunk* chunk =3D chunks.front();
- MPEGChunk* seqHdr =3D NULL;
- while(chunk->GetType() !=3D MPEG_VIDEO_PICTURE_START_CODE){
- if(chunk->GetType() =3D=3D MPEG_VIDEO_SEQUENCE_START_CODE){
- if (chunks.size() =3D=3D 1) return -1;
- if(seqHdr) delete seqHdr;
+ while (chunk->GetType() !=3D MPEG_VIDEO_PICTURE_START_CODE) {
+ if (chunk->GetType() =3D=3D MPEG_VIDEO_GOP_START_CODE) {
+ if (gopChunk)
+ delete gopChunk;
+ gopChunk =3D chunk;
+
+ } else if (chunk->GetType() =3D=3D MPEG_VIDEO_SEQUENCE_START_CODE)=
{
+ if (seqHdrChunk)
+ delete seqHdrChunk;
ParseSequenceHeader(chunk, m_seqHdr);
- seqHdr =3D chunk;
- }else{
- delete chunk; //Skip all non picture, non seq headers
+ seqHdrChunk =3D chunk;
+
}
+
chunks.erase(chunks.begin());
- if(chunks.empty()){
- if(seqHdr !=3D NULL)
- chunks.push_back(seqHdr);
+ if (chunks.empty())
return -1;
- }
chunk =3D chunks.front();
}
MPEG2PictureHeader picHdr;
- ParsePictureHeader(chunk, picHdr);
+ ParsePictureHeader(chunk, picHdr);
MediaTime bcount;
if(myTime =3D=3D nextSkip){
myTime+=3DnextSkipDuration;
@@ -320,7 +351,7 @@
currentStampingTime +=3D GetFrameDuration(picHdr);;
}
ShoveRef(myTime);
- QueueFrame(seqHdr,chunk,myTime,picHdr);
+ QueueFrame(chunk, myTime, picHdr);
notReachedFirstGOP =3D false;
break;
case MPEG2_P_FRAME:
@@ -335,16 +366,17 @@
currentStampingTime+=3DGetFrameDuration(picHdr);
}
ShoveRef(myTime);
- QueueFrame(seqHdr, chunk, myTime, picHdr);
+ QueueFrame(chunk, myTime, picHdr);
break;
default: //B-frames
if(firstRef =3D=3D -1 || secondRef =3D=3D -1) break;
- QueueFrame(seqHdr,chunk,myTime,picHdr);
+ QueueFrame(chunk, myTime, picHdr);
currentStampingTime+=3DGetFrameDuration(picHdr);
}
chunks.erase(chunks.begin());
delete chunk;
- if(chunks.empty()) return -1;
+ if (chunks.empty())
+ return -1;
}
return 0;
}
Modified: trunk/DvdMenuXtractor/mpegparser/M2VParser.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/mpegparser/M2VParser.h 2007-03-06 09:46:59 UTC =
(rev 1279)
+++ trunk/DvdMenuXtractor/mpegparser/M2VParser.h 2007-03-08 09:04:37 UTC =
(rev 1280)
@@ -28,16 +28,18 @@
#include <queue>
=20
enum MPEG2ParserState {
- MPV_PARSER_STATE_FRAME,
- MPV_PARSER_STATE_NEED_DATA,
- MPV_PARSER_STATE_EOS,
- MPV_PARSER_STATE_ERROR
+ MPV_PARSER_STATE_FRAME,
+ MPV_PARSER_STATE_NEED_DATA,
+ MPV_PARSER_STATE_EOS,
+ MPV_PARSER_STATE_ERROR
};
=20
class MPEGFrame {
public:
binary *data;
uint32_t size;
+ binary *seqHdrData;
+ uint32_t seqHdrDataSize;
MediaTime duration;
char frameType;
MediaTime timecode;
@@ -59,13 +61,14 @@
std::queue<MPEGFrame*> buffers; //Holds stamped buffers until they are=
requested.
MediaTime position;
//Added to allow reading the header's raw data, contains first found s=
eq hdr.
- MPEGChunk* seqHdrChunk;
+ MPEGChunk* seqHdrChunk, *gopChunk;
MPEG2SequenceHeader m_seqHdr; //current sequence header
MediaTime currentStampingTime;
MediaTime firstRef;
bool needInit;
bool m_eos;
bool notReachedFirstGOP;
+ bool keepSeqHdrsInBitstream;
MediaTime nextSkip;
MediaTime nextSkipDuration;
MediaTime secondRef;
@@ -79,7 +82,7 @@
MediaTime CountBFrames();
void ShoveRef(MediaTime ref);
MediaTime GetFrameDuration(MPEG2PictureHeader picHdr);
- int32_t QueueFrame(MPEGChunk* seqHdr, MPEGChunk* chunk, MediaTime time=
code, MPEG2PictureHeader picHdr);
+ int32_t QueueFrame(MPEGChunk* chunk, MediaTime timecode, MPEG2PictureH=
eader picHdr);
public:
M2VParser();
virtual ~M2VParser();
@@ -117,6 +120,10 @@
//Sets "end of stream" status on the buffer, forces timestamping of fr=
ames waiting.
//Do not call this without good reason.
void SetEOS();
+
+ void SeparateSequenceHeaders() {
+ keepSeqHdrsInBitstream =3D false;
+ }
};
=20
=20
Modified: trunk/DvdMenuXtractor/mpegparser/MPEGVideoBuffer.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/mpegparser/MPEGVideoBuffer.cpp 2007-03-06 09:46=
:59 UTC (rev 1279)
+++ trunk/DvdMenuXtractor/mpegparser/MPEGVideoBuffer.cpp 2007-03-08 09:04=
:37 UTC (rev 1280)
@@ -61,10 +61,14 @@
return;
}
if(chunkStart =3D=3D -1){
- chunkStart =3D FindStartCode(0);
+ test =3D FindStartCode(0);
+ if(test !=3D -1) //We found a new startcode
+ chunkStart =3D test;
}
if(chunkEnd =3D=3D -1){
- chunkEnd =3D FindStartCode(chunkStart+4);
+ test =3D FindStartCode(chunkStart+4);
+ if(test !=3D -1) //We found a new startcode
+ chunkEnd =3D test;
}
if(chunkStart =3D=3D -1 || chunkEnd =3D=3D -1){
state =3D MPEG2_BUFFER_STATE_NEED_MORE_DATA;
Modified: trunk/DvdMenuXtractor/mpegparser/MPEGVideoBuffer.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/mpegparser/MPEGVideoBuffer.h 2007-03-06 09:46:5=
9 UTC (rev 1279)
+++ trunk/DvdMenuXtractor/mpegparser/MPEGVideoBuffer.h 2007-03-08 09:04:3=
7 UTC (rev 1280)
@@ -25,7 +25,7 @@
=20
#include "Types.h"
#include "CircBuffer.h"
-#include <assert.h>
+#include <cassert>
=20
#define MPEG_VIDEO_PICTURE_START_CODE 0x00
#define MPEG_VIDEO_SEQUENCE_START_CODE 0xb3
@@ -34,10 +34,10 @@
#define MPEG_VIDEO_USER_START_CODE 0xb2
=20
enum MPEG2BufferState {
- MPEG2_BUFFER_STATE_NEED_MORE_DATA,
- MPEG2_BUFFER_STATE_CHUNK_READY,
- MPEG2_BUFFER_STATE_EMPTY,
- MPEG2_BUFFER_INVALID
+ MPEG2_BUFFER_STATE_NEED_MORE_DATA,
+ MPEG2_BUFFER_STATE_CHUNK_READY,
+ MPEG2_BUFFER_STATE_EMPTY,
+ MPEG2_BUFFER_INVALID
};
=20
#define MPEG2_I_FRAME 1
Modified: trunk/DvdMenuXtractor/outputreader.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/outputreader.cpp 2007-03-06 09:46:59 UTC (rev 1=
279)
+++ trunk/DvdMenuXtractor/outputreader.cpp 2007-03-08 09:04:37 UTC (rev 1=
280)
@@ -1,4 +1,6 @@
+#if defined(WIN32) || defined(WIN64)
#include <io.h>
+#endif
#include <QDir>
#include <fcntl.h>
#include <fstream>
@@ -7,8 +9,12 @@
#include "outputreader.h"
=20
OutputReader::OutputReader(QObject *parent /* =3D 0*/)
- : QObject(parent), stderrStream(0), stdoutStream(0), redirecting_(fals=
e),
- stderrFileName("stderr.txt"), stdoutFileName("stdout.txt")
+ : QObject(parent)
+ ,redirecting_(false)
+ ,stdoutFileName("stdout.txt")
+ ,stderrFileName("stderr.txt")
+ ,stderrStream(0)
+ ,stdoutStream(0)
{
}
=20
@@ -55,20 +61,20 @@
return true;
=20
// save old descriptors
+#if defined(WIN32) || defined(WIN64)
stdout_desc =3D _dup(1);
stderr_desc =3D _dup(2);
+#else
+ stdout_desc =3D dup(1);
+ stderr_desc =3D dup(2);
+#endif
=20
if ((stdout_desc =3D=3D -1) || (stderr_desc =3D=3D -1))
return false;
=20
// redirect stdout and stderr to corresponding files
-#if defined(_CRT_SECURE_NO_DEPRECATE)
stdoutStream =3D freopen(stdoutFileName.toAscii(), "wc", stdout);
stderrStream =3D freopen(stderrFileName.toAscii(), "wc", stderr);
-#else
- freopen_s(&stdoutStream, stdoutFileName.toAscii(), "wc", stdout);
- freopen_s(&stderrStream, stderrFileName.toAscii(), "wc", stderr);
-#endif
=20
if ((stderrStream =3D=3D 0) || (stdoutStream =3D=3D 0))
return false;
@@ -95,9 +101,15 @@
fclose(stdoutStream);
=20
// set back standard file descriptors
+#if defined(WIN32) || defined(WIN64)
if (( -1 =3D=3D _dup2(stdout_desc, 1))=20
||( -1 =3D=3D _dup2(stderr_desc, 2)))
return false;
+#else
+ if (( -1 =3D=3D dup2(stdout_desc, 1))=20
+ ||( -1 =3D=3D dup2(stderr_desc, 2)))
+ return false;
+#endif
=20
// stop monitoring
timer.stop();
@@ -162,4 +174,4 @@
{
static OutputReader reader;
return reader;
-}
\ No newline at end of file
+}
Modified: trunk/DvdMenuXtractor/selectiontreeitem.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/selectiontreeitem.cpp 2007-03-06 09:46:59 UTC (=
rev 1279)
+++ trunk/DvdMenuXtractor/selectiontreeitem.cpp 2007-03-08 09:04:37 UTC (=
rev 1280)
@@ -2,7 +2,9 @@
#include "selectiontreeitem.h"
=20
SelectionTreeItem::SelectionTreeItem(QTreeWidget *parent, int16_t title,=
bool isMenuItem)
- : QTreeWidgetItem(parent), title_(title), isMenuItem_(isMenuItem)
+ : QTreeWidgetItem(parent)
+ ,title_(title)
+ ,isMenuItem_(isMenuItem)
{
static const QString vmgTitleFormat(QObject::tr("VMG"));
static const QString vtsTitleFormat(QObject::tr("Title %1"));
@@ -20,7 +22,9 @@
}
=20
SelectionTreeItem::SelectionTreeItem(const SelectionTreeItem &other)
- : QTreeWidgetItem(other), title_(other.title_), isMenuItem_(other.isMen=
uItem_)
+ : QTreeWidgetItem(other)
+ ,title_(other.title_)
+ ,isMenuItem_(other.isMenuItem_)
{
setCheckState(0, other.checkState(0));
}
Modified: trunk/DvdMenuXtractor/selectiontreesubitem.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/selectiontreesubitem.cpp 2007-03-06 09:46:59 UT=
C (rev 1279)
+++ trunk/DvdMenuXtractor/selectiontreesubitem.cpp 2007-03-08 09:04:37 UT=
C (rev 1280)
@@ -1,42 +1,48 @@
-#include <QTreeWidgetItem>
-#include "selectiontreesubitem.h"
-
-SelectionTreeSubItem::SelectionTreeSubItem(QTreeWidgetItem *parent, cons=
t SelectionTreeItem &titleItem, size_t index, SelectionTreeSubItem::SubIt=
emType type)
- : QTreeWidgetItem(parent), titleItem_(titleItem), index_(index), type_(=
type)
-{
- static const QString audioTrackTitleFormat ("Audio Track %1");
- static const QString subTrackTitleFormat ("Subtitle Track %1");
-=09
- if (type =3D=3D AUDIO_TRACK)
- setText(0, audioTrackTitleFormat.arg(index));
- else
- setText(0, subTrackTitleFormat.arg(index));
-
- setFlags(flags() | Qt::ItemIsTristate);
- setCheckState(0, Qt::Checked);
-}
-
-SelectionTreeSubItem::SelectionTreeSubItem(const SelectionTreeSubItem &o=
ther)
- : QTreeWidgetItem(other), titleItem_(other.titleItem_), index_(other.in=
dex_), type_(other.type_)
-{
- setCheckState(0, other.checkState(0));
-}
-
-SelectionTreeSubItem::~SelectionTreeSubItem()
-{
-}
-
-size_t SelectionTreeSubItem::index() const
-{
- return index_;
-}
-
-SelectionTreeSubItem::SubItemType SelectionTreeSubItem::type() const
-{
- return type_;
-}
-
-const SelectionTreeItem& SelectionTreeSubItem::titleItem() const
-{
- return titleItem_;
-}
+#include <QTreeWidgetItem>
+#include "selectiontreesubitem.h"
+
+SelectionTreeSubItem::SelectionTreeSubItem(QTreeWidgetItem *parent, cons=
t SelectionTreeItem &titleItem, size_t index, SelectionTreeSubItem::SubIt=
emType type)
+ : QTreeWidgetItem(parent)
+ ,index_(index)
+ ,type_(type)
+ ,titleItem_(titleItem)
+{
+ static const QString audioTrackTitleFormat ("Audio Track %1");
+ static const QString subTrackTitleFormat ("Subtitle Track %1");
+=09
+ if (type =3D=3D AUDIO_TRACK)
+ setText(0, audioTrackTitleFormat.arg(index));
+ else
+ setText(0, subTrackTitleFormat.arg(index));
+
+ setFlags(flags() | Qt::ItemIsTristate);
+ setCheckState(0, Qt::Checked);
+}
+
+SelectionTreeSubItem::SelectionTreeSubItem(const SelectionTreeSubItem &o=
ther)
+ : QTreeWidgetItem(other)
+ ,index_(other.index_)
+ ,type_(other.type_)
+ ,titleItem_(other.titleItem_)
+{
+ setCheckState(0, other.checkState(0));
+}
+
+SelectionTreeSubItem::~SelectionTreeSubItem()
+{
+}
+
+size_t SelectionTreeSubItem::index() const
+{
+ return index_;
+}
+
+SelectionTreeSubItem::SubItemType SelectionTreeSubItem::type() const
+{
+ return type_;
+}
+
+const SelectionTreeItem& SelectionTreeSubItem::titleItem() const
+{
+ return titleItem_;
+}
Modified: trunk/DvdMenuXtractor/selectiontreesubitem.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/selectiontreesubitem.h 2007-03-06 09:46:59 UTC =
(rev 1279)
+++ trunk/DvdMenuXtractor/selectiontreesubitem.h 2007-03-08 09:04:37 UTC =
(rev 1280)
@@ -23,4 +23,4 @@
const SelectionTreeItem &titleItem_;
};
=20
-#endif // SELECTION_TREE_SUB_ITEM_H
\ No newline at end of file
+#endif // SELECTION_TREE_SUB_ITEM_H
Modified: trunk/DvdMenuXtractor/utilities.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/utilities.cpp 2007-03-06 09:46:59 UTC (rev 1279=
)
+++ trunk/DvdMenuXtractor/utilities.cpp 2007-03-08 09:04:37 UTC (rev 1280=
)
@@ -29,4 +29,4 @@
result +=3D QString("%1 ").arg(buffer[i], 2, 16, QChar('0'));
=20
return result.trimmed();
-}
\ No newline at end of file
+}
Modified: trunk/DvdMenuXtractor/utilities.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/utilities.h 2007-03-06 09:46:59 UTC (rev 1279)
+++ trunk/DvdMenuXtractor/utilities.h 2007-03-08 09:04:37 UTC (rev 1280)
@@ -5,7 +5,7 @@
#include <stdint.h>
#include "DvdMenuXtractor_project.h"
=20
-#define T(x) (x)
+#define _T(x) (x)
=20
namespace Utilities
{
@@ -17,4 +17,4 @@
QString EncodeHex(const unsigned char *buffer, unsigned size);
}
=20
-#endif // UTILITIES_H
\ No newline at end of file
+#endif // UTILITIES_H
Modified: trunk/DvdMenuXtractor/vobparser/IFOContent.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/vobparser/IFOContent.cpp 2007-03-06 09:46:59 UT=
C (rev 1279)
+++ trunk/DvdMenuXtractor/vobparser/IFOContent.cpp 2007-03-08 09:04:37 UT=
C (rev 1280)
@@ -1,273 +1,273 @@
-// ---------------------------------------------------------------------=
-------
-#include "IFOContent.h"
-// ---------------------------------------------------------------------=
-------
-// Macro to convert Binary Coded Decimal to Decimal
-#define BCD2D(__x__) (((__x__ & 0xf0) >> 4) * 10 + (__x__ & 0x0f))
-// ---------------------------------------------------------------------=
-------
-int dvdtime2frame(dvd_time_t* dtime, double & frame_dur)
-{
- double frame_rate;
- double result =3D 0.0;
- assert((dtime->hour>>4) < 0xa && (dtime->hour&0xf) < 0xa);
- assert((dtime->minute>>4) < 0x7 && (dtime->minute&0xf) < 0xa);
- assert((dtime->second>>4) < 0x7 && (dtime->second&0xf) < 0xa);
- assert((dtime->frame_u&0xf) < 0xa);
-
- int hh, min, sec, ff;
- hh =3D BCD2D(dtime->hour);
- min =3D BCD2D(dtime->minute);
- sec =3D BCD2D(dtime->second);
- ff =3D BCD2D(dtime->frame_u & 0x3f);
-
- frame_rate =3D ((dtime->frame_u & 0xc0) >> 6) =3D=3D 1 ? 25.0 : (30000.=
0/1001.0);
- result =3D (((((hh * 60) + min) * 60) + sec) * frame_rate) + (ff & 0x3f=
);
- frame_dur =3D 1000.0 / frame_rate;
-
- return (int)result;
-}
-// ---------------------------------------------------------------------=
-------
-IFOContent::IFOContent(dvd_reader_t *dvdr, int16_t title)
- :m_title(title)
-{
- m_handle =3D ifoOpen(dvdr, title);
- if (!m_handle)
- throw IFOInvalidFileFormatException();
-
- CellsHashType CellsHash;
-
- if (title =3D=3D 0)
- {
- if (m_handle->vmgi_mat)
- {
- const vmgi_mat_t &vmgi_mat =3D *m_handle->vmgi_mat;
- if (vmgi_mat.nr_of_vmgm_audio_streams)
- m_langAudio.push_back(&vmgi_mat.vmgm_audio_attr);
- if (vmgi_mat.nr_of_vmgm_subp_streams)
- m_langSubs.push_back(&vmgi_mat.vmgm_subp_attr);
- }
-
- if (m_handle->pgci_ut && m_handle->menu_c_adt)
- {
- // add each cell in a list
- // order this list according to vob ID, cell ID
- // for each cell, find the duration (and start time) from all menu PG=
Cs
- for(uint16_t i =3D 0; i < m_handle->pgci_ut->nr_of_lus; i++)
- {
- pgci_lu_t& lu =3D m_handle->pgci_ut->lu[i];
- GetPGCCells(*lu.pgcit, *m_handle->menu_c_adt, &CellsHash);
- }
-
- // Transfer hash map to the list to be sorted
- m_langCellsList.clear();
- =09
- for(CellsHashType::iterator it =3D CellsHash.begin(); it !=3D CellsHa=
sh.end(); ++it )
- {
- m_langCellsList.append(it.value());
- }
-
- m_langCellsList.arrange();
- }
- }
- else
- {
- if (m_handle->vtsi_mat)
- {
- const vtsi_mat_t & vtsi_mat =3D *m_handle->vtsi_mat;
- if (vtsi_mat.nr_of_vtsm_audio_streams)
- m_langAudio.push_back(&vtsi_mat.vtsm_audio_attr);
- if (vtsi_mat.nr_of_vtsm_subp_streams)
- m_langSubs.push_back(&vtsi_mat.vtsm_subp_attr);
-
- uint8_t _stream;
- for (_stream=3D0; _stream < vtsi_mat.nr_of_vts_audio_streams; _stream=
++)
- m_Audio.push_back(&vtsi_mat.vts_audio_attr[_stream]);
- for (_stream=3D0; _stream < vtsi_mat.nr_of_vts_subp_streams; _stream+=
+)
- m_Subs.push_back(&vtsi_mat.vts_subp_attr[_stream]);
- }
-
- // handle the list of menu cells with their ID and sectors
- CellsHash.clear();
- if (m_handle->pgci_ut && m_handle->menu_c_adt)
- {
- // add each cell in a list
- // order this list according to vob ID, cell ID
- // for each cell, find the duration (and start time) from all menu PG=
Cs
- for(int i =3D 0; i < m_handle->pgci_ut->nr_of_lus; i++)
- {
- pgci_lu_t& lu =3D m_handle->pgci_ut->lu[i];
- GetPGCCells(*lu.pgcit, *m_handle->menu_c_adt, &CellsHash);
- }
-
- // Transfer hash map to the list to be sorted
- m_langCellsList.clear();
- CellsHashType::iterator it;
- for( it =3D CellsHash.begin(); it !=3D CellsHash.end(); ++it )
- {
- m_langCellsList.append(it.value());
- }
-
- m_langCellsList.arrange();
- }
-
- // handle the list of cells with their ID and sectors
- CellsHash.clear();
- if (m_handle->vts_pgcit && m_handle->vts_c_adt)
- {
- // add each cell in a list
- // order this list according to vob ID, cell ID
- // for each cell, find the duration (and start time) from all PGCs
- GetPGCCells(*m_handle->vts_pgcit, *m_handle->vts_c_adt, &CellsHash);
-
- // Transfer hash map to the list to be sorted
- m_CellsList.clear();
- =09
- for(CellsHashType::iterator it =3D CellsHash.begin(); it !=3D CellsHa=
sh.end(); ++it )
- {
- m_CellsList.append(it.value());
- }
-
- m_CellsList.arrange();
- }
- }
-}
-// ---------------------------------------------------------------------=
-------
-void IFOContent::GetPGCCells(const pgcit_t & pgcit, const c_adt_t & adt,=
CellsHashType * CellsHash)
-{
- CellListElem* cle;
-
- for(int j=3D0; j < pgcit.nr_of_pgci_srp; j++)
- {
- pgci_srp_t& srp =3D pgcit.pgci_srp[j];
- for(int k=3D0; k < srp.pgc->nr_of_cells; k++)
- {
- uint16_t vob_id =3D srp.pgc->cell_position[k].vob_id_nr;
- uint8_t cell_id =3D srp.pgc->cell_position[k].cell_nr;
-
- if (CellsHash->find(MAKE_CELLS_KEY(vob_id, cell_id)) =3D=3D CellsHash=
->end())
- {
- size_t cell_nr =3D adt.last_byte;
- cell_nr -=3D 7;
- cell_nr /=3D sizeof(cell_adr_t);
- for (size_t l=3D0; l < cell_nr; l++)
- {
- if (adt.cell_adr_table[l].vob_id =3D=3D vob_id && adt.cell_adr_tabl=
e[l].cell_id =3D=3D cell_id)
- {
- cle =3D new CellListElem();
- (*CellsHash)[MAKE_CELLS_KEY(vob_id, cell_id)] =3D cle;
-
- cle->vobid =3D vob_id;
- cle->cellid =3D cell_id;
-
- cle->start_sector =3D adt.cell_adr_table[l].start_sector;
- cle->last_sector =3D adt.cell_adr_table[l].last_sector;
- cle->selected =3D true; // all cells selected for the moment
- cle->found =3D false;
- /* debug * / cle->found =3D true;*/
-
- cle->nb_frames =3D dvdtime2frame(&srp.pgc->cell_playback[k].playba=
ck_time, cle->frame_dur);
- cle->isStill =3D (srp.pgc->cell_playback[k].still_time > 0);
- if (cle->isStill)
- {
- if (srp.pgc->cell_playback[k].still_time =3D=3D 0xFF) {
- qWarning(qPrintable(QString("Still cell (%1.%2) detected with i=
nfinite duration !").arg(vob_id).arg(cell_id)));
- } else {
- qWarning(qPrintable(QString("Still cell (%1.%2) detected. Assum=
ing there is just one frame.").arg(vob_id).arg(cell_id)));
- cle->nb_frames =3D 1; // maybe not true ?
- cle->frame_dur =3D srp.pgc->cell_playback[k].still_time * 1000.0=
/ cle->nb_frames;
- }
- }
- break;
- }
- }
- }
- }
- }
-}
-// ---------------------------------------------------------------------=
-------
-uint8_t IFOContent::FindAudioStream(uint8_t streamID, bool menu) const
-{
- assert(m_handle !=3D NULL);
- if (menu)
- {
- if (m_handle->pgci_ut)
- {
- for (int i=3D0; i<m_handle->pgci_ut->nr_of_lus; i++)
- {
- pgci_lu_t &_lu =3D m_handle->pgci_ut->lu[i];
- for (int j=3D0; j < _lu.pgcit->nr_of_pgci_srp; j++)
- {
- pgc_t *_pgc =3D _lu.pgcit->pgci_srp[j].pgc;
- if(_pgc->audio_control[streamID] & 0x8000) // if present
- return (_pgc->audio_control[streamID] >> 8) & 0x7F;
- }
- }
- }
- }
- else
- {
- if (m_handle->vts_pgcit)
- {
- for (int j=3D0; j < m_handle->vts_pgcit->nr_of_pgci_srp; j++)
- {
- pgc_t *_pgc =3D m_handle->vts_pgcit->pgci_srp[j].pgc;
- if(_pgc->audio_control[streamID] & 0x8000) // if present
- return (_pgc->audio_control[streamID] >> 8) & 0x7F;
- }
- }
- }
- return streamID;
-}
-// ---------------------------------------------------------------------=
-------
-IdArray IFOContent::FindSubStream(uint8_t streamID, bool menu) const
-{
- IdArray result;
-
- assert(m_handle !=3D NULL);
- if (menu)
- {
- if (m_handle->pgci_ut)
- {
- for (int i=3D0; i<m_handle->pgci_ut->nr_of_lus; i++)
- {
- pgci_lu_t &_lu =3D m_handle->pgci_ut->lu[i];
- for (int j=3D0; j < _lu.pgcit->nr_of_pgci_srp; j++)
- {
- pgc_t *_pgc =3D _lu.pgcit->pgci_srp[j].pgc;
- if(_pgc->subp_control[streamID] & 0x80000000) // if present
- {
- result.push_back( _pgc->subp_control[streamID] >> 24 & 0x7F);
- if (_pgc->subp_control[streamID] & 0x007F0000)
- result.push_back( _pgc->subp_control[streamID] >> 16 & 0x7F);
- if (_pgc->subp_control[streamID] & 0x00007F00)
- result.push_back( _pgc->subp_control[streamID] >> 8 & 0x7F);
- if (_pgc->subp_control[streamID] & 0x0000007F)
- result.push_back( _pgc->subp_control[streamID] >> 0 & 0x7F);
- }
- }
- }
- }
- }
- else
- {
- if (m_handle->vts_pgcit)
- {
- for (int j=3D0; j < m_handle->vts_pgcit->nr_of_pgci_srp; j++)
- {
- pgc_t *_pgc =3D m_handle->vts_pgcit->pgci_srp[j].pgc;
- if(_pgc->subp_control[streamID] & 0x80000000) // if present
- {
- result.push_back( _pgc->subp_control[streamID] >> 24 & 0x7F);
- if (_pgc->subp_control[streamID] & 0x007F0000)
- result.push_back( _pgc->subp_control[streamID] >> 16 & 0x7F);
- if (_pgc->subp_control[streamID] & 0x00007F00)
- result.push_back( _pgc->subp_control[streamID] >> 8 & 0x7F);
- if (_pgc->subp_control[streamID] & 0x0000007F)
- result.push_back( _pgc->subp_control[streamID] >> 0 & 0x7F);
- }
- }
- }
- }
-
- return result;
-}
-// ---------------------------------------------------------------------=
-------
\ No newline at end of file
+// ---------------------------------------------------------------------=
-------
+#include "IFOContent.h"
+// ---------------------------------------------------------------------=
-------
+// Macro to convert Binary Coded Decimal to Decimal
+#define BCD2D(__x__) (((__x__ & 0xf0) >> 4) * 10 + (__x__ & 0x0f))
+// ---------------------------------------------------------------------=
-------
+int dvdtime2frame(dvd_time_t* dtime, double & frame_dur)
+{
+ double frame_rate;
+ double result =3D 0.0;
+ assert((dtime->hour>>4) < 0xa && (dtime->hour&0xf) < 0xa);
+ assert((dtime->minute>>4) < 0x7 && (dtime->minute&0xf) < 0xa);
+ assert((dtime->second>>4) < 0x7 && (dtime->second&0xf) < 0xa);
+ assert((dtime->frame_u&0xf) < 0xa);
+
+ int hh, min, sec, ff;
+ hh =3D BCD2D(dtime->hour);
+ min =3D BCD2D(dtime->minute);
+ sec =3D BCD2D(dtime->second);
+ ff =3D BCD2D(dtime->frame_u & 0x3f);
+
+ frame_rate =3D ((dtime->frame_u & 0xc0) >> 6) =3D=3D 1 ? 25.0 : (30000.=
0/1001.0);
+ result =3D (((((hh * 60) + min) * 60) + sec) * frame_rate) + (ff & 0x3f=
);
+ frame_dur =3D 1000.0 / frame_rate;
+
+ return (int)result;
+}
+// ---------------------------------------------------------------------=
-------
+IFOContent::IFOContent(dvd_reader_t *dvdr, int16_t title)
+ :m_title(title)
+{
+ m_handle =3D ifoOpen(dvdr, title);
+ if (!m_handle)
+ throw IFOInvalidFileFormatException();
+
+ CellsHashType CellsHash;
+
+ if (title =3D=3D 0)
+ {
+ if (m_handle->vmgi_mat)
+ {
+ const vmgi_mat_t &vmgi_mat =3D *m_handle->vmgi_mat;
+ if (vmgi_mat.nr_of_vmgm_audio_streams)
+ m_langAudio.push_back(&vmgi_mat.vmgm_audio_attr);
+ if (vmgi_mat.nr_of_vmgm_subp_streams)
+ m_langSubs.push_back(&vmgi_mat.vmgm_subp_attr);
+ }
+
+ if (m_handle->pgci_ut && m_handle->menu_c_adt)
+ {
+ // add each cell in a list
+ // order this list according to vob ID, cell ID
+ // for each cell, find the duration (and start time) from all menu PG=
Cs
+ for(uint16_t i =3D 0; i < m_handle->pgci_ut->nr_of_lus; i++)
+ {
+ pgci_lu_t& lu =3D m_handle->pgci_ut->lu[i];
+ GetPGCCells(*lu.pgcit, *m_handle->menu_c_adt, &CellsHash);
+ }
+
+ // Transfer hash map to the list to be sorted
+ m_langCellsList.clear();
+ =09
+ for(CellsHashType::iterator it =3D CellsHash.begin(); it !=3D CellsHa=
sh.end(); ++it )
+ {
+ m_langCellsList.append(it.value());
+ }
+
+ m_langCellsList.arrange();
+ }
+ }
+ else
+ {
+ if (m_handle->vtsi_mat)
+ {
+ const vtsi_mat_t & vtsi_mat =3D *m_handle->vtsi_mat;
+ if (vtsi_mat.nr_of_vtsm_audio_streams)
+ m_langAudio.push_back(&vtsi_mat.vtsm_audio_attr);
+ if (vtsi_mat.nr_of_vtsm_subp_streams)
+ m_langSubs.push_back(&vtsi_mat.vtsm_subp_attr);
+
+ uint8_t _stream;
+ for (_stream=3D0; _stream < vtsi_mat.nr_of_vts_audio_streams; _stream=
++)
+ m_Audio.push_back(&vtsi_mat.vts_audio_attr[_stream]);
+ for (_stream=3D0; _stream < vtsi_mat.nr_of_vts_subp_streams; _stream+=
+)
+ m_Subs.push_back(&vtsi_mat.vts_subp_attr[_stream]);
+ }
+
+ // handle the list of menu cells with their ID and sectors
+ CellsHash.clear();
+ if (m_handle->pgci_ut && m_handle->menu_c_adt)
+ {
+ // add each cell in a list
+ // order this list according to vob ID, cell ID
+ // for each cell, find the duration (and start time) from all menu PG=
Cs
+ for(int i =3D 0; i < m_handle->pgci_ut->nr_of_lus; i++)
+ {
+ pgci_lu_t& lu =3D m_handle->pgci_ut->lu[i];
+ GetPGCCells(*lu.pgcit, *m_handle->menu_c_adt, &CellsHash);
+ }
+
+ // Transfer hash map to the list to be sorted
+ m_langCellsList.clear();
+ CellsHashType::iterator it;
+ for( it =3D CellsHash.begin(); it !=3D CellsHash.end(); ++it )
+ {
+ m_langCellsList.append(it.value());
+ }
+
+ m_langCellsList.arrange();
+ }
+
+ // handle the list of cells with their ID and sectors
+ CellsHash.clear();
+ if (m_handle->vts_pgcit && m_handle->vts_c_adt)
+ {
+ // add each cell in a list
+ // order this list according to vob ID, cell ID
+ // for each cell, find the duration (and start time) from all PGCs
+ GetPGCCells(*m_handle->vts_pgcit, *m_handle->vts_c_adt, &CellsHash);
+
+ // Transfer hash map to the list to be sorted
+ m_CellsList.clear();
+ =09
+ for(CellsHashType::iterator it =3D CellsHash.begin(); it !=3D CellsHa=
sh.end(); ++it )
+ {
+ m_CellsList.append(it.value());
+ }
+
+ m_CellsList.arrange();
+ }
+ }
+}
+// ---------------------------------------------------------------------=
-------
+void IFOContent::GetPGCCells(const pgcit_t & pgcit, const c_adt_t & adt,=
CellsHashType * CellsHash)
+{
+ CellListElem* cle;
+
+ for(int j=3D0; j < pgcit.nr_of_pgci_srp; j++)
+ {
+ pgci_srp_t& srp =3D pgcit.pgci_srp[j];
+ for(int k=3D0; k < srp.pgc->nr_of_cells; k++)
+ {
+ uint16_t vob_id =3D srp.pgc->cell_position[k].vob_id_nr;
+ uint8_t cell_id =3D srp.pgc->cell_position[k].cell_nr;
+
+ if (CellsHash->find(MAKE_CELLS_KEY(vob_id, cell_id)) =3D=3D CellsHash=
->end())
+ {
+ size_t cell_nr =3D adt.last_byte;
+ cell_nr -=3D 7;
+ cell_nr /=3D sizeof(cell_adr_t);
+ for (size_t l=3D0; l < cell_nr; l++)
+ {
+ if (adt.cell_adr_table[l].vob_id =3D=3D vob_id && adt.cell_adr_tabl=
e[l].cell_id =3D=3D cell_id)
+ {
+ cle =3D new CellListElem();
+ (*CellsHash)[MAKE_CELLS_KEY(vob_id, cell_id)] =3D cle;
+
+ cle->vobid =3D vob_id;
+ cle->cellid =3D cell_id;
+
+ cle->start_sector =3D adt.cell_adr_table[l].start_sector;
+ cle->last_sector =3D adt.cell_adr_table[l].last_sector;
+ cle->selected =3D true; // all cells selected for the moment
+ cle->found =3D false;
+ /* debug * / cle->found =3D true;*/
+
+ cle->nb_frames =3D dvdtime2frame(&srp.pgc->cell_playback[k].playba=
ck_time, cle->frame_dur);
+ cle->isStill =3D (srp.pgc->cell_playback[k].still_time > 0);
+ if (cle->isStill)
+ {
+ if (srp.pgc->cell_playback[k].still_time =3D=3D 0xFF) {
+ qWarning(qPrintable(QString("Still cell (%1.%2) detected with i=
nfinite duration !").arg(vob_id).arg(cell_id)));
+ } else {
+ qWarning(qPrintable(QString("Still cell (%1.%2) detected. Assum=
ing there is just one frame.").arg(vob_id).arg(cell_id)));
+ cle->nb_frames =3D 1; // maybe not true ?
+ cle->frame_dur =3D srp.pgc->cell_playback[k].still_time * 1000.0=
/ cle->nb_frames;
+ }
+ }
+ break;
+ }
+ }
+ }
+ }
+ }
+}
+// ---------------------------------------------------------------------=
-------
+uint8_t IFOContent::FindAudioStream(uint8_t streamID, bool menu) const
+{
+ assert(m_handle !=3D NULL);
+ if (menu)
+ {
+ if (m_handle->pgci_ut)
+ {
+ for (int i=3D0; i<m_handle->pgci_ut->nr_of_lus; i++)
+ {
+ pgci_lu_t &_lu =3D m_handle->pgci_ut->lu[i];
+ for (int j=3D0; j < _lu.pgcit->nr_of_pgci_srp; j++)
+ {
+ pgc_t *_pgc =3D _lu.pgcit->pgci_srp[j].pgc;
+ if(_pgc->audio_control[streamID] & 0x8000) // if present
+ return (_pgc->audio_control[streamID] >> 8) & 0x7F;
+ }
+ }
+ }
+ }
+ else
+ {
+ if (m_handle->vts_pgcit)
+ {
+ for (int j=3D0; j < m_handle->vts_pgcit->nr_of_pgci_srp; j++)
+ {
+ pgc_t *_pgc =3D m_handle->vts_pgcit->pgci_srp[j].pgc;
+ if(_pgc->audio_control[streamID] & 0x8000) // if present
+ return (_pgc->audio_control[streamID] >> 8) & 0x7F;
+ }
+ }
+ }
+ return streamID;
+}
+// ---------------------------------------------------------------------=
-------
+IdArray IFOContent::FindSubStream(uint8_t streamID, bool menu) const
+{
+ IdArray result;
+
+ assert(m_handle !=3D NULL);
+ if (menu)
+ {
+ if (m_handle->pgci_ut)
+ {
+ for (int i=3D0; i<m_handle->pgci_ut->nr_of_lus; i++)
+ {
+ pgci_lu_t &_lu =3D m_handle->pgci_ut->lu[i];
+ for (int j=3D0; j < _lu.pgcit->nr_of_pgci_srp; j++)
+ {
+ pgc_t *_pgc =3D _lu.pgcit->pgci_srp[j].pgc;
+ if(_pgc->subp_control[streamID] & 0x80000000) // if present
+ {
+ result.push_back( _pgc->subp_control[streamID] >> 24 & 0x7F);
+ if (_pgc->subp_control[streamID] & 0x007F0000)
+ result.push_back( _pgc->subp_control[streamID] >> 16 & 0x7F);
+ if (_pgc->subp_control[streamID] & 0x00007F00)
+ result.push_back( _pgc->subp_control[streamID] >> 8 & 0x7F);
+ if (_pgc->subp_control[streamID] & 0x0000007F)
+ result.push_back( _pgc->subp_control[streamID] >> 0 & 0x7F);
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ if (m_handle->vts_pgcit)
+ {
+ for (int j=3D0; j < m_handle->vts_pgcit->nr_of_pgci_srp; j++)
+ {
+ pgc_t *_pgc =3D m_handle->vts_pgcit->pgci_srp[j].pgc;
+ if(_pgc->subp_control[streamID] & 0x80000000) // if present
+ {
+ result.push_back( _pgc->subp_control[streamID] >> 24 & 0x7F);
+ if (_pgc->subp_control[streamID] & 0x007F0000)
+ result.push_back( _pgc->subp_control[streamID] >> 16 & 0x7F);
+ if (_pgc->subp_control[streamID] & 0x00007F00)
+ result.push_back( _pgc->subp_control[streamID] >> 8 & 0x7F);
+ if (_pgc->subp_control[streamID] & 0x0000007F)
+ result.push_back( _pgc->subp_control[streamID] >> 0 & 0x7F);
+ }
+ }
+ }
+ }
+
+ return result;
+}
+// ---------------------------------------------------------------------=
-------
Modified: trunk/DvdMenuXtractor/vobparser/IFOContent.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/vobparser/IFOContent.h 2007-03-06 09:46:59 UTC =
(rev 1279)
+++ trunk/DvdMenuXtractor/vobparser/IFOContent.h 2007-03-08 09:04:37 UTC =
(rev 1280)
@@ -68,4 +68,4 @@
};
// ---------------------------------------------------------------------=
-------
#endif
-// ---------------------------------------------------------------------=
-------
\ No newline at end of file
+// ---------------------------------------------------------------------=
-------
Modified: trunk/DvdMenuXtractor/vobparser/IFOFile.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/vobparser/IFOFile.cpp 2007-03-06 09:46:59 UTC (=
rev 1279)
+++ trunk/DvdMenuXtractor/vobparser/IFOFile.cpp 2007-03-08 09:04:37 UTC (=
rev 1280)
@@ -5,12 +5,7 @@
// ---------------------------------------------------------------------=
-------
IFOFile::IFOFile(const QString& filename)
{=09
-#ifdef UNICODE
- const wchar_t *name =3D reinterpret_cast<const wchar_t*>(filename.utf16=
());
- m_dvd =3D DVDOpen(name);
-#else
- m_dvd =3D DVDOpen(qPrintable(filename));
-#endif
+ m_dvd =3D DVDOpen(QFile::encodeName(filename));
=09
if(!m_dvd) {
throw IFOInvalidFileFormatException();
@@ -70,10 +65,9 @@
const pgci_ut_t *IFOFile::LanguageUnits(unsigned int title) const
{
IFOContent *_ifo =3D m_ifos.getIfoContent(title);
+=09
if (_ifo)
- {
return _ifo->Handle().pgci_ut;
- }
=09
return NULL;
}
@@ -230,14 +224,11 @@
{
IFOContent *_ifo =3D m_ifos.getIfoContent(title);
assert(_ifo !=3D NULL);
- video_attr_t *_attr =3D NULL;
=09
if (menu)
return (_ifo->Handle().pgci_ut->lu->pgcit->pgci_srp->pgc->palette);
- else
- return (_ifo->Handle().vts_pgcit->pgci_srp->pgc->palette);
-
- return NULL;
+=09
+ return (_ifo->Handle().vts_pgcit->pgci_srp->pgc->palette);
}
// ---------------------------------------------------------------------=
-------
uint8_t IFOFile::GetAudioId(uint8_t streamID, uint8_t title, bool menu) =
const
@@ -306,4 +297,4 @@
++node;
}
}
-// ---------------------------------------------------------------------=
-------
\ No newline at end of file
+// ---------------------------------------------------------------------=
-------
Modified: trunk/DvdMenuXtractor/vobparser/IFOFile.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/vobparser/IFOFile.h 2007-03-06 09:46:59 UTC (re=
v 1279)
+++ trunk/DvdMenuXtractor/vobparser/IFOFile.h 2007-03-08 09:04:37 UTC (re=
v 1280)
@@ -4,7 +4,7 @@
// ---------------------------------------------------------------------=
-------
#include <QStringList>
=20
-#include "IfoContent.h"
+#include "IFOContent.h"
// ---------------------------------------------------------------------=
-------
class IfoHandleList: public QList<IFOContent*>
{
Modified: trunk/DvdMenuXtractor/vobparser/VobParser.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/vobparser/VobParser.cpp 2007-03-06 09:46:59 UTC=
(rev 1279)
+++ trunk/DvdMenuXtractor/vobparser/VobParser.cpp 2007-03-08 09:04:37 UTC=
(rev 1280)
@@ -1,1320 +1,1351 @@
-// =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
-// VOBParser class
-// Copyright =A9 2002 : Christophe PARIS (christophe.paris at free.fr)
-// =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
-
-#include <QFileInfo>
-
-#include "IFOFile.h"
-#include "VobParser.h"
-#include "iso/iso_lang.h"
-
-// ---------------------------------------------------------------------=
-------
-
-#define VOB_SLICE 0x00000100
-#define PACK_HEADER 0xBA
-#define SYSTEM_HEADER 0xBB
-#define PROGRAM_STREAM_MAP 0xBC
-#define PRIVATE_STREAM1 0xBD
-#define PADDING_STREAM 0xBE
-#define PRIVATE_STREAM2 0xBF
-#define CURRENT_OFFSET (m_pktindex * DVD_VIDEO_LB_LEN + m_index)
-
-#define INDENT_UNIT 2
-unsigned int indent_lvl =3D 0;
-inline void inc_lvl() { indent_lvl +=3D INDENT_UNIT; }
-inline void dec_lvl() { indent_lvl -=3D INDENT_UNIT; }
-void debug (const QString& str)
-{
- QString debugStr (indent_lvl, ' ');
- debugStr +=3D str;
- qDebug(qPrintable(debugStr));
-}
-
-// ---------------------------------------------------------------------=
-------
-// CompositeDemuxWriter
-// ---------------------------------------------------------------------=
-------
-
-CompositeDemuxWriter::CompositeDemuxWriter()
-{
- for (int i=3D0; i<256; i++)
- m_muxers[i] =3D NULL;
-}
-
-CompositeDemuxWriter::~CompositeDemuxWriter()
-{
- Reset();
-}
-
-bool CompositeDemuxWriter::AddDemuxer(uint8_t streamID, Writer * demuxer=
, QString& CommandLine)
-{
- if (m_muxers[streamID] !=3D NULL)
- return false;
- m_muxers[streamID] =3D demuxer;
- m_strings[streamID] =3D CommandLine;
- return true;
-}
-
-void CompositeDemuxWriter::ProcessStream(int streamID, uint8_t* buff, ui=
nt32_t size, int32_t start_time, int32_t end_time, const QString& debug)
-{
- if (m_muxers[streamID] !=3D NULL)
- m_muxers[streamID]->ProcessStream(buff, size, start_time, end_time, de=
bug);
-}
-
-void CompositeDemuxWriter::Reset()
-{
- for (int i=3D0; i<256; i++)
- {
- if (m_muxers[i] !=3D NULL)
- {
- delete m_muxers[i];
- m_muxers[i] =3D NULL;
- }
- }
-}
-
-void CompositeDemuxWriter::SetBoundary(uint32_t start_timecode, uint32_t=
duration, const CellListElem *cell)
-{
- for (int i=3D0; i<256; i++)
- {
- if (m_muxers[i] !=3D NULL)
- {
- m_muxers[i]->SetBoundary(start_timecode, duration, cell);
- }
- }
-}
-
-// ---------------------------------------------------------------------=
-------
-
-VobParser::VobParser(const char* dirname, int16_t title, bool menu)
- :m_title(title)
- ,m_dvdhandle(NULL)
- ,m_stream(NULL)
- ,m_language(menu)
- ,m_bFirstPacket(true)
-{
- m_pktcount =3D 0;
-
- QFileInfo _tmpDirName(dirname);
-
- // handle all parts of this title (VIDEO_TS.vob or VTS_XX_Y.vob)
-#ifdef UNICODE
- const wchar_t *name =3D reinterpret_cast<const wchar_t*>(_tmpDirName.ca=
nonicalFilePath().utf16());
- m_dvdhandle =3D DVDOpen(name);
-#else
- m_dvdhandle =3D DVDOpen(qPrintable(_tmpDirName.canonicalPath()));
-#endif
-
- if (m_dvdhandle)
- {
- if (m_language)
- m_stream =3D DVDOpenFile(m_dvdhandle, title, DVD_READ_MENU_VOBS);
- else
- m_stream =3D DVDOpenFile(m_dvdhandle, title, DVD_READ_TITLE_VOBS);
- }
-
- if(!m_stream)
- {
- throw VobParserFileNotFoundException(dirname);
- }
- else
- {
- m_pktcount =3D DVDFileSize(m_stream);
- }
-
- Reset();
-}
-
-// ---------------------------------------------------------------------=
-------
-
-VobParser::~VobParser()
-{
- if (m_stream)
- DVDCloseFile(m_stream);
-
- if (m_dvdhandle)
- DVDClose(m_dvdhandle);
-}
-
-// ---------------------------------------------------------------------=
-------
-
-uint32_t VobParser::GetPacketCount() const
-{
- return m_pktcount;
-}
-
-// ---------------------------------------------------------------------=
-------
-
-uint32_t VobParser::GetPacketIndex() const
-{
- return m_pktindex;
-}
-
-// ---------------------------------------------------------------------=
-------
-
-char* VobParser::GetCurrentPacketData() const
-{
- return (char*)m_buff;
-}
-
-// ---------------------------------------------------------------------=
-------
-
-bool VobParser::ParseNextPacket(const CellsListType & Cells)
-{
- if(GetNextPacket())
- {=09
- pktinfo.identifier =3D GetNext32Bits();
- if((pktinfo.identifier & VOB_SLICE) !=3D VOB_SLICE || (pktinfo.identif=
ier & PACK_HEADER) !=3D PACK_HEADER)
- {
- // Invalid block start code
- throw VobParserInvalidPacketException(CURRENT_OFFSET-4);
- }
- =09
- ParseSCR(); // System Clock Reference
-
- // Program Mux Rate (measured in units of 50 bytes/second)
- pktinfo.program_mux_rate =3D (GetNext8Bits() << 14) |=20
- (GetNext8Bits() << 6) | (GetNext8Bits() >> 2);
-
- // Skip Pack stuffing length
- int stuffing_nb =3D GetNext8Bits() & 0x07;
- SkipNBytes(stuffing_nb);
- =09
- uint32_t _Header =3D GetNext32Bits();
- int _StreamID;
- if ((_Header & VOB_SLICE) =3D=3D VOB_SLICE)
- {
- _StreamID =3D _Header & 0xFF;
- if (_StreamID =3D=3D SYSTEM_HEADER)
- {
- // skip the system header data
- uint16_t _size =3D GetNext16Bits();
- SkipNBytes(_size);
-
- while (AvailablePacketData())
- {
- _Header =3D GetNext32Bits();
- uint8_t _StreamId =3D _Header & 0xFF;
- if (_StreamId =3D=3D PRIVATE_STREAM2)
- {
- debug("Navigation pack {\n");
- inc_lvl();
- debug(QString("SCR: %1.%2\n").arg(pktinfo.scr).arg(pktinfo.scr_ext=
));
- debug(QString("Program mux rate: %1 (%2 bps)\n").arg(pktinfo.progr=
am_mux_rate).arg(pktinfo.program_mux_rate * 50 * 8));
- ParseNavPacket();
- dec_lvl();
- debug("}\n");
- }
- else
- {
- // skip these data
- uint16_t _size =3D GetNext16Bits();
- SkipNBytes(_size);
- }
- }
- if (IsNewCell()) {
- CellListElem* cell =3D Cells.at(GetVobID(), GetCellID());
-
- if (cell !=3D NULL)
- {
- cell->found =3D true;
- if (m_dsi.nv_pck_scr =3D=3D 0)
- m_pci_vob_timecode_offset =3D m_pci.vobu_s_ptm / 90;
- m_demuxer.SetBoundary(m_pci.vobu_s_ptm/90 - m_pci_vob_timecode_off=
set, cell->nb_frames * cell->frame_dur, cell);
- }
- }
- if (m_pci.btn_ns !=3D 0)
- { // there are some buttons
- uint32_t t3 =3D m_pci.vobu_s_ptm/90 - m_pci_vob_timecode_offset;
- uint32_t t4 =3D m_pci.vobu_e_ptm/90 - m_pci_vob_timecode_offset;
- m_demuxer.ProcessStream(SUBSTREAM_PCI, &m_buff[m_pci_position], m_p=
ci_size+2, t3, t4,=20
- QString("# %1 -> %2 / %3 / %4 / %5 / %6 / off %7\n")
- .arg(m_pci.vobu_s_ptm/90).arg(m_pci.vobu_e_ptm/90)
- .arg(m_dsi.c_eltm, 0, 16).arg(m_pci.c_eltm, 0, 16)
- .arg(t3).arg(t4).arg(m_pci_vob_timecode_offset));
- =09
- }
- }
- else if ((_StreamID & VIDEO_STREAM) =3D=3D VIDEO_STREAM)
- {
- debug("Video pack {}\n");
- ParseVideoPacket();
- }
- else if ((_StreamID & AUDIO_STREAM) =3D=3D AUDIO_STREAM)
- {
- debug("Audio pack {}\n");
- ParseAudioPacket(_StreamID);
- }
- else if (_StreamID =3D=3D PRIVATE_STREAM1)
- {
- debug("Private stream 1 pack {\n");
- inc_lvl();
- ParsePrivateStream1();
- dec_lvl();
- debug("}\n");
- }
- else
- {
- uint16_t _size =3D GetNext16Bits();
- SkipNBytes(_size);
- debug("Unknown slice type\n");
- }
-
- if (m_bFirstPacket && _StreamID !=3D SYSTEM_HEADER)
- {
- m_bFirstPacket =3D false;
- m_startdts =3D pktinfo.dts;
- m_startpts =3D pktinfo.pts;
- }
- }
- else
- {
- debug("Unknown start code\n");
- }
- =09
- m_pktindex++;
- }
- else
- {
- return false;
- }
-
- return true;
-}
-
-// ---------------------------------------------------------------------=
-------
-
-bool VobParser::AvailablePacketData() const
-{
- return (m_index < DVD_VIDEO_LB_LEN);
-}
-
-// ---------------------------------------------------------------------=
-------
-
-bool VobParser::GetNextPacket()
-{
- m_index =3D 0;
-
- return (DVDReadBlocks(m_stream, m_pktindex, 1, m_buff) =3D=3D 1);
-}
-
-// ---------------------------------------------------------------------=
-------
-
-uint32_t VobParser::GetNext32Bits()
-{
- uint32_t result =3D 0;
- result |=3D m_buff[m_index++];
- result <<=3D 8;
- result |=3D m_buff[m_index++];
- result <<=3D 8;
- result |=3D m_buff[m_index++];
- result <<=3D 8;
- result |=3D m_buff[m_index++];
- return result;
-}
-
-// ---------------------------------------------------------------------=
-------
-
-uint16_t VobParser::GetNext16Bits()
-{
- uint32_t result =3D 0;
- result |=3D m_buff[m_index++];
- result <<=3D 8;
- result |=3D m_buff[m_index++];
- return result;
-}
-
-// ---------------------------------------------------------------------=
-------
-
-uint8_t VobParser::GetNext8Bits()
-{
- return m_buff[m_index++];
-}
-
-// ---------------------------------------------------------------------=
-------
-
-void VobParser::SkipNBytes(int n)
-{
- m_index +=3D n;
-}
-
-// ---------------------------------------------------------------------=
-------
-
-void VobParser::ParseSCR()
-{
-
-/* From http://dvd.sourceforge.net/dvdinfo/packhdr.html
-
- Byte 4 Byte 5
- +--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+
- | 7| 6| 5| 4| 3| 2| 1| 0| | 7| 6| 5| 4| 3| 2| 1| 0|
- +--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+
-SCR bits |f0|f1|32|31|30|f1|29|28| |27|26|25|24|23|22|21|20|
- +--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+
-
- Byte 6 Byte 7
- +--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+
- | 7| 6| 5| 4| 3| 2| 1| 0| | 7| 6| 5| 4| 3| 2| 1| 0|
- +--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+
-SCR bits |19|18|17|16|15|f1|14|13| |12|11|10| 9| 8| 7| 6| 5|
- +--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+
-
- Byte 8 Byte 9
- +--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+
- | 7| 6| 5| 4| 3| 2| 1| 0| | 7| 6| 5| 4| 3| 2| 1| 0|
- +--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+
-SCR bits | 4| 3| 2| 1| 0|f1|e8|e7| |e6|e5|e4|e3|e2|f1|e0|c1|
- +--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+
-
- fx =3D bit value fixed to x
- ex =3D bit x of scr_ext
-*/
-
- uint8_t byte4, byte5, byte6, byte7, byte8, byte9;
- byte4 =3D GetNext8Bits(); byte5 =3D GetNext8Bits();
- byte6 =3D GetNext8Bits(); byte7 =3D GetNext8Bits();
- byte8 =3D GetNext8Bits(); byte9 =3D GetNext8Bits();
-
- assert((byte4 & 0xc4) =3D=3D 0x44);
- assert(byte6 & 0x04);
- assert(byte8 & 0x04);
- assert(byte9 & 0x01);
- =09
- uint64_t scr =3D 0;
- scr |=3D ((((byte4 & 0x38) >> 1) | (byte4 & 0x03)) << 28);
- scr |=3D (byte5 << 20);
- scr |=3D ((((byte6 & 0xf8) >> 1) | (byte6 & 0x03)) << 13);
- scr |=3D (byte7 << 5);
- scr |=3D ((byte8 & 0xf8) >> 3);
-
- uint16_t scr_ext =3D 0;
- scr_ext |=3D ((byte8 & 0x03) << 7);
- scr_ext |=3D ((byte9 & 0xfe) >> 1);
-
- pktinfo.scr =3D scr;
- pktinfo.scr_ext =3D scr_ext;
-}
-
-// ---------------------------------------------------------------------=
-------
-
-void VobParser::ParseNavPacket()
-{
- uint32_t endStreamIndex =3D 0;
- uint32_t position =3D m_index;
- uint16_t length =3D GetNext16Bits();
- endStreamIndex =3D m_index + length;
- uint8_t substreamID =3D GetNext8Bits();
-=09
- switch(substreamID)
- {
- case SUBSTREAM_PCI:
- debug("PCI {\n");
- inc_lvl();
- ParsePCI();
- m_pci_position =3D position-4; // keep the Private Stream 2 header
- m_pci_size =3D length+4;
- dec_lvl();
- debug("}\n");
- break;
- case SUBSTREAM_DSI:
- debug("DSI {\n");
- inc_lvl();
- ParseDSI();
- dec_lvl();
- debug("}\n");
- break;
- default:
- debug(QString("ParseNavPacket: unknown substream id @LBA=3D%1\n").arg=
(m_pktindex));
- }
-=09
- m_index =3D endStreamIndex;
-}
-
-// ---------------------------------------------------------------------=
-------
-
-void VobParser::ParsePCI()
-{
- int i,j;
- uint8_t onebyte;
-
- // PCI General Information
- m_pci.nv_pck_lbn =3D GetNext32Bits();
- m_pci.vobu_cat =3D GetNext16Bits();
- m_pci.reserved1 =3D GetNext16Bits();
- m_pci.vobu_uop_ctl =3D GetNext32Bits();
- m_pci.vobu_s_ptm =3D GetNext32Bits();
- m_pci.vobu_e_ptm =3D GetNext32Bits();
- m_pci.vobu_se_e_ptm =3D GetNext32Bits();
- m_pci.c_eltm =3D GetNext32Bits();
- memcpy(m_pci.vobu_isrc, &m_buff[m_index],32*1);=09
- SkipNBytes(32*1);
-
- // Non Seamless Angle Information
- memcpy(m_pci.nsml_agli_dsta, &m_buff[m_index], 9*4);
- SkipNBytes(9*4);
-
- // Highlight General Information=20
- m_pci.hli_ss =3D GetNext16Bits();
- m_pci.hli_s_ptm =3D GetNext32Bits();
- m_pci.hli_e_ptm =3D GetNext32Bits();
- m_pci.btn_sl_e_ptm =3D GetNext32Bits();
- m_pci.btn_md =3D GetNext16Bits();
- m_pci.btn_sn =3D GetNext8Bits();
- m_pci.btn_ns =3D GetNext8Bits();
- m_pci.nsl_btn_ns =3D GetNext8Bits();
- m_pci.reserved1 =3D GetNext8Bits();
- m_pci.fosl_btnn =3D GetNext8Bits();
- m_pci.foac_btnn =3D GetNext8Bits();
-=09
- // Button Color Information Table=20
- for(i =3D 0; i < 3; i++)
- for(j =3D 0; j < 2; j++)
- m_pci.btn_coli[i][j] =3D GetNext32Bits();
-
- // Button Information
- for(i =3D 0; i < 36; i++)
- {
- onebyte =3D GetNext8Bits();
- m_pci.btnit[i].btn_coln =3D (onebyte & 0xC0) >> 6;
- m_pci.btnit[i].start_x =3D (onebyte & 0x3F) << 4;
-
- onebyte =3D GetNext8Bits();
- m_pci.btnit[i].start_x |=3D (onebyte & 0xF0) >> 4;
- m_pci.btnit[i].end_x =3D (onebyte & 0x03) << 8;
-
- onebyte =3D GetNext8Bits();
- m_pci.btnit[i].end_x |=3D onebyte;
-
- onebyte =3D GetNext8Bits();
- m_pci.btnit[i].auto_action_flag =3D (onebyte & 0xC0) >> 6;
- m_pci.btnit[i].start_y =3D (onebyte & 0x3F) << 4;
- =09
- onebyte =3D GetNext8Bits();
- m_pci.btnit[i].start_y |=3D (onebyte & 0xF0) >> 4;
- m_pci.btnit[i].end_y =3D (onebyte & 0x03) << 8;
- =09
- onebyte =3D GetNext8Bits();
- m_pci.btnit[i].end_y |=3D onebyte;
-
- m_pci.btnit[i].up =3D GetNext8Bits() & 0x3F;
- m_pci.btnit[i].down =3D GetNext8Bits() & 0x3F;
- m_pci.btnit[i].left =3D GetNext8Bits() & 0x3F;
- m_pci.btnit[i].right =3D GetNext8Bits() & 0x3F;
- =09
- memcpy(m_pci.btnit[i].vm_cmd, &m_buff[m_index],8*1);
- SkipNBytes(8*1);
- }
-
- debug(QString("nv_pck_lbn: %1\n").arg(m_pci.nv_pck_lbn));
- debug(QString("vobu_cat: %1\n").arg(m_pci.vobu_cat));
- debug(QString("reserved1: %1\n").arg(m_pci.reserved1));
- debug(QString("vobu_uop_ctl: %1\n").arg(m_pci.vobu_uop_ctl));
- debug(QString("vobu_s_ptm: %1\n").arg(m_pci.vobu_s_ptm));
- debug(QString("vobu_e_ptm: %1\n").arg(m_pci.vobu_e_ptm));
- debug(QString("vobu_se_e_ptm: %1\n").arg(m_pci.vobu_se_e_ptm));
- debug(QString("e_eltm: %1\n").arg(m_pci.c_eltm));
- debug(QString("vobu_isrc: ...\n").toAscii());
- debug(QString("nsml_agli_dsta: ...\n").toAscii());
- debug(QString("hli_ss: %1\n").arg(m_pci.hli_ss));
-}
-
-// ---------------------------------------------------------------------=
-------
-
-void VobParser::ParseDSI()
-{
- m_dsi.nv_pck_scr =3D GetNext32Bits();
- m_dsi.nv_pck_lbn =3D GetNext32Bits();
- m_dsi.vobu_ea =3D GetNext32Bits();
- m_dsi.vobu_1stref_ea =3D GetNext32Bits();
- m_dsi.vobu_2ndref_ea =3D GetNext32Bits();
- m_dsi.vobu_3rdref_ea =3D GetNext32Bits();
- m_dsi.vobu_vob_idn =3D GetNext16Bits();
- m_dsi.reserved =3D GetNext8Bits();
- m_dsi.vobu_c_idn =3D GetNext8Bits();
- m_dsi.c_eltm =3D GetNext32Bits();
-
- debug(QString("nv_pck_scr: %1\n").arg(m_dsi.nv_pck_scr));
- debug(QString("nv_pck_lbn: %1\n").arg(m_dsi.nv_pck_lbn));
- debug(QString("vobu_ea: %1\n").arg(m_dsi.vobu_ea));
- debug(QString("vobu_1stref_ea: %1\n").arg(m_dsi.vobu_1stref_ea));
- debug(QString("vobu_2ndref_ea: %1\n").arg(m_dsi.vobu_2ndref_ea));
- debug(QString("vobu_3rdref_ea: %1\n").arg(m_dsi.vobu_3rdref_ea));
- debug(QString("vobu_vob_idn: %1\n").arg(m_dsi.vobu_vob_idn));
- debug(QString("reserved: %1\n").arg(m_dsi.reserved));
- debug(QString("vobu_c_idn: %1\n").arg(m_dsi.vobu_c_idn));
- debug(QString("c_eltm: %1\n").arg(m_dsi.c_eltm));
-}
-
-// ---------------------------------------------------------------------=
-------
-
-uint8_t GetBit(uint32_t data, uint8_t n)
-{
- return ((data >> n) & 0x01);
-}
-
-// ---------------------------------------------------------------------=
-------
-
-void VobParser::ParsePESHeaderDataContentFlag()
-{=09
- uint8_t byte6 =3D GetNext8Bits();
- assert((byte6 & 0xC0) =3D=3D 0x80);
- pes_header_data_content.PES_scrambling_control =3D (byte6 & 0x30) >> 4;
- pes_header_data_content.PES_priority =3D GetBit(byte6,3);
- pes_header_data_content.data_alignment_indicator =3D GetBit(byte6,2);
- pes_header_data_content.copyright =3D GetBit(byte6,1);
- pes_header_data_content.original_or_copy =3D GetBit(byte6,0);
-
- uint8_t byte7 =3D GetNext8Bits();
- pes_header_data_content.PTS_flag =3D GetBit(byte7,7);
- pes_header_data_content.DTS_flag =3D GetBit(byte7,6);
- pes_header_data_content.ESCR_flag =3D GetBit(byte7,5);
- pes_header_data_content.ES_rate_flag =3D GetBit(byte7,4);
- pes_header_data_content.DSM_trick_mode_flag =3D GetBit(byte7,3);
- pes_header_data_content.additionnal_copy_info_flag =3D GetBit(byte7,2);
- pes_header_data_content.PES_CRC_flag =3D GetBit(byte7,1);
- pes_header_data_content.PES_extension_flag =3D GetBit(byte7,0);
-=09
- pes_header_data_content.PES_header_data_len =3D GetNext8Bits();
-}
-
-// ---------------------------------------------------------------------=
-------
-
-uint64_t VobParser::ParsePTS_DTS()
-{
- // PTS and DTS have same format
- uint64_t result =3D 0;
-
- uint8_t byte0 =3D GetNext8Bits();
- uint16_t word0 =3D GetNext16Bits();
- uint16_t word1 =3D GetNext16Bits();
-
- assert(word0 & 0x01);
- assert(word1 & 0x01);
-
- result |=3D (((byte0 & 0x0E) >> 1) << 30);
- result |=3D ((word0 >> 1) << 15);
- result |=3D (word1 >> 1);
-
- return result;
-}
-
-// ---------------------------------------------------------------------=
-------
-
-void VobParser::ParsePESHeaderData()
-{
- uint8_t bytesLeft =3D pes_header_data_content.PES_header_data_len;
- if(pes_header_data_content.PTS_flag)
- {
- // PTS : Presentation Time Stamp
- pktinfo.pts =3D ParsePTS_DTS();
- bytesLeft -=3D 5;
- if (m_bFirstPacket)
- {
- m_startpts =3D pktinfo.pts;
- }
- pktinfo.pts -=3D m_startpts;
- }
- if(pes_header_data_content.DTS_flag)
- {
- // DTS : Decoding Time Stamp
- pktinfo.dts =3D ParsePTS_DTS();
- bytesLeft -=3D 5;
- if (m_bFirstPacket)
- {
- m_startdts =3D pktinfo.dts;
- }
- pktinfo.dts -=3D m_startdts;
- }
- m_bFirstPacket =3D false;
-
- // Skip the rest
- SkipNBytes(bytesLeft);
-}
-
-// ---------------------------------------------------------------------=
-------
-
-void VobParser::ParseVideoPacket()
-{
- uint16_t length =3D GetNext16Bits();
- ParsePESHeaderDataContentFlag();
- ParsePESHeaderData();
-
- m_demuxer.ProcessStream(VIDEO_STREAM, &m_buff[m_index],
- length - 3 - pes_header_data_content.PES_header_data_len, pktinfo.dts/=
90, pktinfo.pts/90,
- QString("DTS %1 PTS %2 - %3 %4\n").arg(m_startdts/90).arg(m_startpts/9=
0).arg(pktinfo.dts/90).arg(pktinfo.pts/90));
-}
-
-void VobParser::ParseAudioPacket(int StreamID)
-{
- uint16_t length =3D GetNext16Bits();
- ParsePESHeaderDataContentFlag();
- ParsePESHeaderData();
-
- m_demuxer.ProcessStream(StreamID, &m_buff[m_index],
- length - 3 - pes_header_data_content.PES_header_data_len, pktinfo.pts/=
90, pktinfo.dts/90,
- QString("DTS %1 PTS %2 - %3 %4\n").arg(m_startdts/90).arg(m_startpts/9=
0).arg(pktinfo.dts/90).arg(pktinfo.pts/90));
-}
-
-// ---------------------------------------------------------------------=
-------
-
-void VobParser::ParsePrivateStream1()
-{
- uint16_t length =3D GetNext16Bits();=09
- uint16_t dataStartIndex =3D m_index;
- // PES : Packetized Elementary Stream
- ParsePESHeaderDataContentFlag();
- ParsePESHeaderData();
- uint8_t substreamID =3D GetNext8Bits();
-
- uint32_t t3 =3D m_pci.vobu_s_ptm/90 - m_pci_vob_timecode_offset;
- uint32_t t4 =3D m_pci.vobu_e_ptm/90 - m_pci_vob_timecode_offset;
- if(substreamID >=3D SUBSTREAM_SUB_LOW && substreamID < SUBSTREAM_SUB_HI=
GH)
- {
- debug(QString("Subtitles streamID =3D 0x%1\n").arg(substreamID, 0, 16)=
);
-
- // .sub files the VobSub way (includes the whole packet)
- m_demuxer.ProcessStream(substreamID, m_buff, DVD_VIDEO_LB_LEN, t3, t4,=
=20
- QString("DTS %1 PTS %2 - %3 %4\n").arg(m_startdts/90).arg(m_startp=
ts/90).arg(pktinfo.dts/90).arg(pktinfo.pts/90));
- }
- else if(substreamID >=3D SUBSTREAM_AC3_LOW && substreamID < SUBSTREAM_A=
C3_HIGH)
- {
- debug(QString("AC3 streamID =3D 0x%1\n").arg(substreamID, 0, 16));
-
- // Skip frame header number
- SkipNBytes(1);
- // Skip first access unit pointer
- SkipNBytes(2);
-
- uint16_t ac3DataLen =3D length - (m_index - dataStartIndex);
- m_demuxer.ProcessStream(substreamID, &m_buff[m_index], ac3DataLen, t3,=
t4,=20
- QString("DTS %1 PTS %2 - %3 %4\n").arg(m_startdts/90).arg(m_startp=
ts/90).arg(pktinfo.dts/90).arg(pktinfo.pts/90));
- }
- else if(substreamID >=3D SUBSTREAM_DTS_LOW && substreamID < SUBSTREAM_D=
TS_HIGH)
- {
- debug(QString("DTS streamID =3D 0x%1\n").arg(substreamID, 0, 16));
- =09
- // Skip frame header number
- SkipNBytes(1);
- // Skip first access unit pointer
- SkipNBytes(2);
-
- uint16_t ac3DataLen =3D length - (m_index - dataStartIndex);
- m_demuxer.ProcessStream(substreamID, &m_buff[m_index], ac3DataLen, t3,=
t4,=20
- QString("DTS %1 PTS %2 - %3 %4\n").arg(m_startdts/90).arg(m_startp=
ts/90).arg(pktinfo.dts/90).arg(pktinfo.pts/90));
- }
- else if(substreamID >=3D SUBSTREAM_PCM_LOW && substreamID < SUBSTREAM_P=
CM_HIGH)
- {
- debug(QString("LPCM streamID =3D 0x%1\n").arg(substreamID, 0, 16));
-
- // Skip unknown data
- SkipNBytes(6);
-
- uint16_t ac3DataLen =3D length - (m_index - dataStartIndex);
- m_demuxer.ProcessStream(substreamID, &m_buff[m_index], ac3DataLen, t3,=
t4,=20
- QString("DTS %1 PTS %2 - %3 %4\n").arg(m_startdts/90).arg(m_startpts/=
90).arg(pktinfo.dts/90).arg(pktinfo.pts/90));
- }
- else
- {
- debug("Unknown\n");
- }
-}
-
-// ---------------------------------------------------------------------=
-------
-
-void VobParser::Reset()
-{
- memset(&m_dsi, 0, sizeof(m_dsi));
- memset(&pktinfo, 0, sizeof(pktinfo));
- memset(&pes_header_data_content, 0, sizeof(pes_header_data_content));
- previous_vobid =3D -1;
- previous_cellid =3D -1;
- m_index =3D 0;
- m_pktindex =3D 0;
- DVDFileSeek(m_stream,0);
-}
-
-// ---------------------------------------------------------------------=
-------
-
-bool VobParser::IsNewCell()
-{
- bool result =3D (GetVobID() !=3D previous_vobid ||
- GetCellID() !=3D previous_cellid);
-=09
- previous_vobid =3D GetVobID();
- previous_cellid =3D GetCellID();
- if (result)
- m_bFirstPacket =3D true;
-
- return result;
-}
-
-// ---------------------------------------------------------------------=
-------
-
-inline uint8_t VobParser::GetVobID() const
-{
- return m_dsi.vobu_vob_idn;
-}
-
-// ---------------------------------------------------------------------=
-------
-
-inline uint8_t VobParser::GetCellID() const
-{
- return m_dsi.vobu_c_idn;
-}
-
-// ---------------------------------------------------------------------=
-------
-
-uint32_t VobParser::GetCellSCR() const
-{
- return m_dsi.nv_pck_scr;
-}
-
-// ---------------------------------------------------------------------=
-------
-=20
-void SubDemuxWriter::WriteTimecodeInfo(uint32_t start_time, uint32_t end=
_time, uint64_t filepos, const QString& debug)
-{
- int i;
-
- if (!m_TimecodeFile)
- {
- QString m_filename (m_Filename);
- m_filename +=3D ".idx";
-#ifdef UNICODE
- const wchar_t* name =3D reinterpret_cast<const wchar_t*>(m_filename.ut=
f16());
- m_TimecodeFile =3D _tfopen(name, _T("w"));
-#else
- m_TimecodeFile =3D fopen(qPrintable(m_filename),"w");
-#endif
- fwrite("# VobSub index file, v7 (do not modify this line!)\n#\n", 1, 5=
3, m_TimecodeFile);
- fwrite("# Settings\n\n# Original frame size\nsize: ", 1, 40, m_Timecod=
eFile);
- fprintf(m_TimecodeFile, "%dx%d\n\n", m_width, m_height);
- fwrite("# Origin, relative to the upper-left corner, can be overloaded=
by aligment\n"
- "org: 0, 0\n\n"
- "# Image scaling (hor,ver), origin is at the upper-left corner =
or at the alignment coord (x, y)\n"
- "scale: 100%, 100%\n\n"
- "# Alpha blending\n"
- "alpha: 100%\n\n"
- "# Smoothing for very blocky images (use OLD for no filtering)\=
n"
- "smooth: OFF\n\n"
- "# In millisecs\n"
- "fadein/out: 50, 50\n\n"
- "# Force subtitle placement relative to (org.x, org.y)\n"
- "align: OFF at LEFT TOP\n\n"
- "# For correcting non-progressive desync. (in millisecs or hh:m=
m:ss:ms)\n"
- "# Note: Not effective in DirectVobSub, use \"delay: ... \" ins=
tead.\n"
- "time offset: 0\n\n"
- "# ON: displays only forced subtitles, OFF: shows everything\n"
- "forced subs: OFF\n\n"
- "# The original palette of the DVD\n"
- "palette: ", 1, 692, m_TimecodeFile);
- for (i=3D0; i<15; i++)
- {
- fprintf(m_TimecodeFile, "%06x, ", m_palette[i]);
- }
- fprintf(m_TimecodeFile, "%06x\n\n", m_palette[i]);
- fwrite("# Custom colors (transp idxs and the four colors)\n"
- "custom colors: OFF, tridx: 0000, colors: 000000, 000000, 00000=
0, 000000\n\n"
- "# Language index in use\n"
- "langidx: 0\n\n"
- "id: ", 1, 163, m_TimecodeFile);
- if (m_language)
- fprintf(m_TimecodeFile, "%c%c", m_language >> 8, m_language);
- else
- fwrite("un", 1, 2, m_TimecodeFile);
- fwrite(", index: 0\n"
- "# Decomment next line to activate alternative name in DirectVo=
bSub / Windows Media Player 6.x\n"
- "# alt: ", 1, 112, m_TimecodeFile);
- fprintf(m_TimecodeFile, "%s\n\n", DecodeLanguage(m_language));
- }
- int32_t delay =3D start_time + m_start_timecode;
- int millisecond =3D delay % 1000;
- delay /=3D 1000;
- int second =3D delay % 60;
- delay /=3D 60;
- int minute =3D delay % 60;
- delay /=3D 60;
- fprintf(m_TimecodeFile, "timestamp: %02d:%02d:%02d:%03d, filepos: %09x\=
n", delay,minute,second,millisecond,filepos);
-}
-
-void BtnDemuxWriter::WriteTimecodeInfo(uint32_t start_time, uint32_t end=
_time, uint64_t filepos, const QString& debug)
-{
-//static uint32_t time =3D0;
- m_TimecodeFile =3D GetTimecodeFile();
- if (start_time > m_last_end_timecode)
- {
- if (m_last_end_timecode > m_start_timecode)
- fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
- fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_last_start_t=
imecode) / 1000.0);
- fprintf(m_TimecodeFile, "gap,%lf\n", (start_time - m_last_end_timecode=
) / 1000.0);
- m_start_timecode =3D start_time;
- }
-//fwrite(debug.c_str(), debug.size(), 1, m_TimecodeFile);
-//fprintf(m_TimecodeFile, "# %d =3D> %d\n",time, time + end_time - start=
_time);
-//time +=3D end_time - start_time;
- m_last_start_timecode =3D start_time;
- m_last_end_timecode =3D end_time;
-}
-
-void DTSDemuxWriter::WriteTimecodeInfo(uint32_t start_time, uint32_t end=
_time, uint64_t filepos, const QString& debug)
-{
- m_TimecodeFile =3D GetTimecodeFile();
- if (start_time > m_last_end_timecode)
- {
- if (m_last_end_timecode > m_start_timecode)
- fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
- fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_last_start_t=
imecode) / 1000.0);
- fprintf(m_TimecodeFile, "gap,%lf\n", (start_time - m_last_end_timecode=
) / 1000.0);
- m_start_timecode =3D start_time;
- }
- m_last_start_timecode =3D start_time;
- m_last_end_timecode =3D end_time;
-}
-
-void LPCMDemuxWriter::WriteTimecodeInfo(uint32_t start_time, uint32_t en=
d_time, uint64_t filepos, const QString& debug)
-{
- m_TimecodeFile =3D GetTimecodeFile();
- if (start_time > m_last_end_timecode)
- {
- if (m_last_end_timecode > m_start_timecode)
- fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
- fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timeco=
de) / 1000.0);
- fprintf(m_TimecodeFile, "gap,%lf\n", (start_time - m_last_end_timecode=
) / 1000.0);
- m_start_timecode =3D start_time;
- }
- m_last_start_timecode =3D start_time;
- m_last_end_timecode =3D end_time;
-}
-
-void MPADemuxWriter::WriteTimecodeInfo(uint32_t start_time, uint32_t end=
_time, uint64_t filepos, const QString& debug)
-{
- m_TimecodeFile =3D GetTimecodeFile();
-}
-
-void AC3DemuxWriter::WriteTimecodeInfo(uint32_t start_time, uint32_t end=
_time, uint64_t filepos, const QString& debug)
-{
- m_TimecodeFile =3D GetTimecodeFile();
- if (start_time > m_last_end_timecode)
- {
- if (m_last_end_timecode > m_start_timecode)
- fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
- fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_last_start_t=
imecode) / 1000.0);
- fprintf(m_TimecodeFile, "gap,%lf\n", (start_time - m_last_end_timecode=
) / 1000.0);
- m_start_timecode =3D start_time;
- }
- m_last_start_timecode =3D start_time;
- m_last_end_timecode =3D end_time;
-}
-
-void VideoDemuxWriter::WriteTimecodeInfo(uint32_t start_time, uint32_t e=
nd_time, uint64_t filepos, const QString& debug)
-{
- // TODO detect gaps in the stream
-}
-
-// =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
-
-void VideoDemuxWriter::ProcessStream(uint8_t* buff, uint32_t size, uint3=
2_t start_time, uint32_t end_time, const QString& debug)
-{
- if (m_parser =3D=3D NULL)
- m_parser =3D new M2VParser;
-=09
- m_parser->WriteData(buff, size);
-
- MPEG2ParserState state =3D m_parser->GetState();
-
- while (state =3D=3D MPV_PARSER_STATE_FRAME)=20
- {
- delete m_parser->ReadFrame();
- state =3D m_parser->GetState();
- }
-
- Write(buff, size, start_time, end_time, debug);=20
-}
-
-void VideoDemuxWriter::SetBoundary(uint32_t start_timecode, uint32_t dur=
ation, const CellListElem *cell)
-{
- if (m_parser !=3D NULL)
- {
- m_parser->SetEOS();
-
- MPEG2ParserState state =3D m_parser->GetState();
-
- while (state =3D=3D MPV_PARSER_STATE_FRAME)=20
- {
- MPEGFrame* current_frame =3D m_parser->ReadFrame();
- if ((current_frame->timecode + current_frame->duration) / 1000000 > m=
_last_end_timecode)
- {
- m_last_start_timecode =3D current_frame->timecode / 1000000;
- m_last_end_timecode =3D (current_frame->timecode + current_frame->du=
ration) / 1000000;
- }
- delete current_frame;
-
- state =3D m_parser->GetState();
- }
- =09
- delete m_parser;
- }
-=09
- m_parser =3D new M2VParser();
-
- m_TimecodeFile =3D GetTimecodeFile();
-
- if (m_end_timecode !=3D 0)
- {
- if (m_is_still) {
- fwrite(" (Still)\n", 1, 9, m_TimecodeFile);
- fprintf(m_TimecodeFile, "%lf,%lf\n", (m_end_timecode - m_start_timeco=
de) / 1000.0, 1000.0 / (m_end_timecode - m_start_timecode));
- }
- else if (m_last_end_timecode < m_end_timecode)
- {
- fprintf(m_TimecodeFile, "\n%lf\n", (m_last_end_timecode - m_start_tim=
ecode) / 1000.0);
- fprintf(m_TimecodeFile, "gap,%lf\n", (m_end_timecode - m_last_end_tim=
ecode) / 1000.0);
- }
- else
- {
- if (m_last_end_timecode > m_end_timecode)
- qWarning("There is more video that indicated in the cell.");
- fprintf(m_TimecodeFile, "\n%lf\n", (m_last_end_timecode - m_start_tim=
ecode) / 1000.0);
- }
- }
-
- m_start_timecode =3D start_timecode;
- m_end_timecode =3D start_timecode + duration;
- m_last_end_timecode =3D start_timecode;
- m_is_still =3D cell->isStill;
-
- fprintf(m_TimecodeFile, "\n# VOB %d Cell %d", cell->vobid, cell->cellid=
);
-}
-
-void AC3DemuxWriter::SetBoundary(uint32_t start_timecode, uint32_t durat=
ion, const CellListElem *cell)
-{
- m_TimecodeFile =3D GetTimecodeFile();
-
- // handle ending of the previous cell
- if (m_last_end_timecode < m_end_timecode)
- {
- if (m_last_end_timecode > m_start_timecode)
- fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
- fprintf(m_TimecodeFile, "gap,%lf\n", (m_end_timecode - m_last_end_time=
code) / 1000.0);
- }
- else
- {
- if (m_end_timecode !=3D 0)
- {
- if (m_last_end_timecode > m_end_timecode)
- qWarning("There is more AC3 audio that indicated in the cell.");
- fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
- }
- }
-
- m_start_timecode =3D start_timecode;
- m_end_timecode =3D start_timecode + duration;
- m_last_end_timecode =3D start_timecode;
- m_last_start_timecode =3D start_timecode;
-
- fprintf(m_TimecodeFile, "\n# VOB %d Cell %d\n", cell->vobid, cell->cell=
id);
-}
-
-void DTSDemuxWriter::SetBoundary(uint32_t start_timecode, uint32_t durat=
ion, const CellListElem *cell)
-{
- m_TimecodeFile =3D GetTimecodeFile();
-
- // handle ending of the previous cell
- if (m_last_end_timecode < m_end_timecode)
- {
- if (m_last_end_timecode > m_start_timecode)
- fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
- fprintf(m_TimecodeFile, "gap,%lf\n", (m_end_timecode - m_last_end_time=
code) / 1000.0);
- }
- else
- {
- if (m_end_timecode !=3D 0)
- {
- if (m_last_end_timecode > m_end_timecode)
- qWarning("There is more DTS audio that indicated in the cell.");
- fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
- }
- }
-
- m_start_timecode =3D start_timecode;
- m_end_timecode =3D start_timecode + duration;
- m_last_end_timecode =3D start_timecode;
- m_last_start_timecode =3D start_timecode;
-
- fprintf(m_TimecodeFile, "\n# VOB %d Cell %d\n", cell->vobid, cell->cell=
id);
-}
-
-void LPCMDemuxWriter::SetBoundary(uint32_t start_timecode, uint32_t dura=
tion, const CellListElem *cell)
-{
- m_TimecodeFile =3D GetTimecodeFile();
-
- // handle ending of the previous cell
- if (m_last_end_timecode < m_end_timecode)
- {
- if (m_last_end_timecode > m_start_timecode)
- fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
- fprintf(m_TimecodeFile, "gap,%lf\n", (m_end_timecode - m_last_end_time=
code) / 1000.0);
- }
- else
- {
- if (m_end_timecode !=3D 0)
- {
- if (m_last_end_timecode > m_end_timecode)
- qWarning("There is more PCM audio that indicated in the cell.");
- fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
- }
- }
-
- m_start_timecode =3D start_timecode;
- m_end_timecode =3D start_timecode + duration;
- m_last_end_timecode =3D start_timecode;
- m_last_start_timecode =3D start_timecode;
-
- fprintf(m_TimecodeFile, "\n# VOB %d Cell %d\n", cell->vobid, cell->cell=
id);
-}
-
-void MPADemuxWriter::SetBoundary(uint32_t start_timecode, uint32_t durat=
ion, const CellListElem *cell)
-{
-}
-
-void SubDemuxWriter::SetBoundary(uint32_t start_timecode, uint32_t durat=
ion, const CellListElem *cell)
-{
- if (start_timecode =3D=3D 0)
- m_start_timecode =3D m_end_timecode;
- m_end_timecode +=3D duration;
-}
-
-void BtnDemuxWriter::SetBoundary(uint32_t start_timecode, uint32_t durat=
ion, const CellListElem *cell)
-{
- m_TimecodeFile =3D GetTimecodeFile();
-
- // handle ending of the previous cell
- if (m_last_end_timecode < m_end_timecode)
- {
- if (m_last_end_timecode > m_start_timecode)
- fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
- fprintf(m_TimecodeFile, "gap,%lf\n", (m_end_timecode - m_last_end_time=
code) / 1000.0);
- }
- else
- {
- if (m_end_timecode !=3D 0)
- {
- if (m_last_end_timecode > m_end_timecode)
- qWarning("There is more Button data that indicated in the cell.");
- fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
- }
- }
-
- m_start_timecode =3D start_timecode;
- m_end_timecode =3D start_timecode + duration;
- m_last_end_timecode =3D start_timecode;
- m_last_start_timecode =3D start_timecode;
-
- fprintf(m_TimecodeFile, "\n# VOB %d Cell %d\n", cell->vobid, cell->cell=
id);
-}
-
-VideoDemuxWriter::~VideoDemuxWriter()
-{
- m_TimecodeFile =3D GetTimecodeFile();
- if (m_parser !=3D NULL)
- {
- m_parser->SetEOS();
-
- MPEG2ParserState state =3D m_parser->GetState();
-
- while (state =3D=3D MPV_PARSER_STATE_FRAME)=20
- {
- MPEGFrame* current_frame =3D m_parser->ReadFrame();
- if ((current_frame->timecode + current_frame->duration) / 1000000 > m=
_last_end_timecode)
- {
- m_last_start_timecode =3D current_frame->timecode / 1000000;
- m_last_end_timecode =3D (current_frame->timecode + current_frame->du=
ration) / 1000000;
- }
- delete current_frame;
-
- state =3D m_parser->GetState();
- }
- delete m_parser;
- }
-
-
- if (m_end_timecode !=3D 0)
- {
- if (m_is_still) {
- fwrite(" (Still)\n", 1, 9, m_TimecodeFile);
- fprintf(m_TimecodeFile, "%lf,%lf\n", (m_end_timecode - m_start_timeco=
de) / 1000.0, 1000.0 / (m_end_timecode - m_start_timecode));
- }
- else if (m_last_end_timecode < m_end_timecode)
- {
- fprintf(m_TimecodeFile, "\n%lf\n", (m_last_end_timecode - m_start_tim=
ecode) / 1000.0);
- fprintf(m_TimecodeFile, "gap,%lf\n", (m_end_timecode - m_last_end_tim=
ecode) / 1000.0);
- }
- else
- fprintf(m_TimecodeFile, "\n%lf\n", (m_end_timecode - m_start_timecode=
) / 1000.0);
- }
-}
-
-AC3DemuxWriter::~AC3DemuxWriter()
-{
- m_TimecodeFile =3D GetTimecodeFile();
-
- // handle ending of the previous cell
- if (m_last_end_timecode < m_end_timecode)
- {
- if (m_last_end_timecode > m_start_timecode)
- fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
- fprintf(m_TimecodeFile, "gap,%lf\n", (m_end_timecode - m_last_end_time=
code) / 1000.0);
- }
- else
- {
- if (m_end_timecode !=3D 0)
- fprintf(m_TimecodeFile, "%lf\n", (m_end_timecode - m_start_timecode) =
/ 1000.0);
- }
-}
-
-DTSDemuxWriter::~DTSDemuxWriter()
-{
- m_TimecodeFile =3D GetTimecodeFile();
-
- // handle ending of the previous cell
- if (m_last_end_timecode < m_end_timecode)
- {
- if (m_last_end_timecode > m_start_timecode)
- fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
- fprintf(m_TimecodeFile, "gap,%lf\n", (m_end_timecode - m_last_end_time=
code) / 1000.0);
- }
- else
- {
- if (m_end_timecode !=3D 0)
- fprintf(m_TimecodeFile, "%lf\n", (m_end_timecode - m_start_timecode) =
/ 1000.0);
- }
-}
-
-LPCMDemuxWriter::~LPCMDemuxWriter()
-{
- m_TimecodeFile =3D GetTimecodeFile();
-
- // handle ending of the previous cell
- if (m_last_end_timecode < m_end_timecode)
- {
- if (m_last_end_timecode > m_start_timecode)
- fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
- fprintf(m_TimecodeFile, "gap,%lf\n", (m_end_timecode - m_last_end_time=
code) / 1000.0);
- }
- else
- {
- if (m_end_timecode !=3D 0)
- fprintf(m_TimecodeFile, "%lf\n", (m_end_timecode - m_start_timecode) =
/ 1000.0);
- }
-}
-
-BtnDemuxWriter::~BtnDemuxWriter()
-{
- m_TimecodeFile =3D GetTimecodeFile();
-
- // handle ending of the previous cell
- if (m_last_end_timecode < m_end_timecode)
- {
- if (m_last_end_timecode > m_start_timecode)
- fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
- fprintf(m_TimecodeFile, "gap,%lf\n", (m_end_timecode - m_last_end_time=
code) / 1000.0);
- }
- else
- {
- if (m_end_timecode !=3D 0)
- fprintf(m_TimecodeFile, "%lf\n", (m_end_timecode - m_start_timecode) =
/ 1000.0);
- }
-}
-
-WavWriter::~WavWriter()
-{
- if (m_file)
- {
- uint8_t _tinteger[4];
-
- fseek(m_file, m_size_position2, SEEK_SET);
- _tinteger[0] =3D m_size & 0xFF;
- _tinteger[1] =3D (m_size >> 8) & 0xFF;
- _tinteger[2] =3D (m_size >> 16) & 0xFF;
- _tinteger[3] =3D (m_size >> 24) & 0xFF;
- fwrite(_tinteger,4,1, m_file);
- =09
- m_size +=3D 36;
- fseek(m_file, m_size_position1, SEEK_SET);
- _tinteger[0] =3D m_size & 0xFF;
- _tinteger[1] =3D (m_size >> 8) & 0xFF;
- _tinteger[2] =3D (m_size >> 16) & 0xFF;
- _tinteger[3] =3D (m_size >> 24) & 0xFF;
- fwrite(_tinteger,4,1, m_file);
- }
-}
-
-void WavWriter::Write(uint8_t* buff, uint32_t size, uint32_t start_time,=
uint32_t end_time, const QString& debug)
-{
- if (m_bit_depth !=3D 16) // not supported
- return;
- if (m_file =3D=3D NULL)
- {
- uint8_t _tinteger[4];
- m_file =3D OpenOuputFile();
-
- // create the WAV header
- // RIFF head
- fwrite("RIFF",4,1, m_file);
- m_size_position1 =3D ftell(m_file);
- fwrite("0000",4,1, m_file);
- fwrite("WAVE",4,1, m_file);
- =09
- // Format head
- fwrite("fmt ",4,1, m_file);
- _tinteger[0] =3D 16;
- _tinteger[1] =3D 0;
- _tinteger[2] =3D 0;
- _tinteger[3] =3D 0;
- fwrite(_tinteger,4,1, m_file);
- =09
- _tinteger[0] =3D 1;
- fwrite(_tinteger,2,1, m_file); // PCM
- =09
- _tinteger[0] =3D m_channel_nb;
- _tinteger[1] =3D 0;
- fwrite(_tinteger,2,1, m_file); // Channels
- =09
- _tinteger[0] =3D m_sample_rate & 0xFF;
- _tinteger[1] =3D (m_sample_rate >> 8) & 0xFF;
- _tinteger[2] =3D (m_sample_rate >> 16) & 0xFF;
- _tinteger[3] =3D (m_sample_rate >> 24) & 0xFF;
- fwrite(_tinteger,4,1, m_file); // Sampling freq
- =09
- uint32_t _byte_rate =3D (m_sample_rate * m_channel_nb * m_bit_depth) >=
> 3;
- _tinteger[0] =3D _byte_rate & 0xFF;
- _tinteger[1] =3D (_byte_rate >> 8) & 0xFF;
- _tinteger[2] =3D (_byte_rate >> 16) & 0xFF;
- _tinteger[3] =3D (_byte_rate >> 24) & 0xFF;
- fwrite(_tinteger,4,1, m_file); // Byte Rate
- =09
- uint16_t _block_align =3D (m_channel_nb * m_bit_depth) >> 3;
- _tinteger[0] =3D _block_align & 0xFF;
- _tinteger[1] =3D (_block_align >> 8) & 0xFF;
- fwrite(_tinteger,2,1, m_file); // Block Align
- =09
- _tinteger[0] =3D m_bit_depth;
- _tinteger[1] =3D 0;
- fwrite(_tinteger,2,1, m_file); // Block Align
- =09
- // Data head
- fwrite("data",4,1, m_file);
- m_size_position2 =3D ftell(m_file);
- fwrite("0000",4,1, m_file);
- m_size =3D 0;
- }
- uint16_t _tmp;
- for (size_t i=3D0; i < size; i+=3D2) {
- _tmp =3D buff[i];
- _tmp <<=3D 8;
- _tmp +=3D buff[i+1];
- buff[i] =3D _tmp & 0xFF;
- buff[i+1] =3D _tmp >> 8;
- }
- Writer::Write(buff, size, start_time, end_time, debug);
- m_size +=3D size;
-}
+// =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
+// VOBParser class
+// Copyright =A9 2002 : Christophe PARIS (christophe.paris at free.fr)
+// =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
+
+#include <QFileInfo>
+
+#include "IFOFile.h"
+#include "VobParser.h"
+#include "iso/iso_lang.h"
+
+// ---------------------------------------------------------------------=
-------
+
+#define VOB_SLICE 0x00000100
+#define PACK_HEADER 0xBA
+#define SYSTEM_HEADER 0xBB
+#define PROGRAM_STREAM_MAP 0xBC
+#define PRIVATE_STREAM1 0xBD
+#define PADDING_STREAM 0xBE
+#define PRIVATE_STREAM2 0xBF
+#define CURRENT_OFFSET (m_pktindex * DVD_VIDEO_LB_LEN + m_index)
+
+#define INDENT_UNIT 2
+unsigned int indent_lvl =3D 0;
+inline void inc_lvl() { indent_lvl +=3D INDENT_UNIT; }
+inline void dec_lvl() { indent_lvl -=3D INDENT_UNIT; }
+void debug (const QString& str)
+{
+ QString debugStr (indent_lvl, ' ');
+ debugStr +=3D str;
+ qDebug(qPrintable(debugStr));
+}
+
+// ---------------------------------------------------------------------=
-------
+// CompositeDemuxWriter
+// ---------------------------------------------------------------------=
-------
+
+CompositeDemuxWriter::CompositeDemuxWriter()
+{
+ for (int i=3D0; i<256; i++)
+ m_muxers[i] =3D NULL;
+}
+
+CompositeDemuxWriter::~CompositeDemuxWriter()
+{
+ Reset();
+}
+
+bool CompositeDemuxWriter::AddDemuxer(uint8_t streamID, Writer * demuxer=
, QString& CommandLine)
+{
+ if (m_muxers[streamID] !=3D NULL)
+ return false;
+ m_muxers[streamID] =3D demuxer;
+ m_strings[streamID] =3D CommandLine;
+ return true;
+}
+
+void CompositeDemuxWriter::ProcessStream(int streamID, uint8_t* buff, ui=
nt32_t size, int32_t start_time, int32_t end_time, const QString& debug)
+{
+ if (m_muxers[streamID] !=3D NULL)
+ m_muxers[streamID]->ProcessStream(buff, size, start_time, end_time, de=
bug);
+}
+
+void CompositeDemuxWriter::Reset()
+{
+ for (int i=3D0; i<256; i++)
+ {
+ if (m_muxers[i] !=3D NULL)
+ {
+ delete m_muxers[i];
+ m_muxers[i] =3D NULL;
+ }
+ }
+}
+
+void CompositeDemuxWriter::SetBoundary(uint32_t start_timecode, uint32_t=
duration, const CellListElem *cell)
+{
+ for (int i=3D0; i<256; i++)
+ {
+ if (m_muxers[i] !=3D NULL)
+ {
+ m_muxers[i]->SetBoundary(start_timecode, duration, cell);
+ }
+ }
+}
+
+// ---------------------------------------------------------------------=
-------
+
+VobParser::VobParser(const char* dirname, int16_t title, bool menu)
+ :m_title(title)
+ ,m_dvdhandle(NULL)
+ ,m_stream(NULL)
+ ,m_language(menu)
+ ,m_bFirstPacket(true)
+{
+ m_pktcount =3D 0;
+
+ QFileInfo _tmpDirName(dirname);
+
+ // handle all parts of this title (VIDEO_TS.vob or VTS_XX_Y.vob)
+ m_dvdhandle =3D DVDOpen(QFile::encodeName(_tmpDirName.canonicalPath()))=
;
+
+ if (m_dvdhandle)
+ {
+ if (m_language)
+ m_stream =3D DVDOpenFile(m_dvdhandle, title, DVD_READ_MENU_VOBS);
+ else
+ m_stream =3D DVDOpenFile(m_dvdhandle, title, DVD_READ_TITLE_VOBS);
+ }
+
+ if(!m_stream)
+ {
+ throw VobParserFileNotFoundException(dirname);
+ }
+ else
+ {
+ m_pktcount =3D DVDFileSize(m_stream);
+ }
+
+ Reset();
+}
+
+// ---------------------------------------------------------------------=
-------
+
+VobParser::~VobParser()
+{
+ if (m_stream)
+ DVDCloseFile(m_stream);
+
+ if (m_dvdhandle)
+ DVDClose(m_dvdhandle);
+}
+
+// ---------------------------------------------------------------------=
-------
+
+uint32_t VobParser::GetPacketCount() const
+{
+ return m_pktcount;
+}
+
+// ---------------------------------------------------------------------=
-------
+
+uint32_t VobParser::GetPacketIndex() const
+{
+ return m_pktindex;
+}
+
+// ---------------------------------------------------------------------=
-------
+
+char* VobParser::GetCurrentPacketData() const
+{
+ return (char*)m_buff;
+}
+
+// ---------------------------------------------------------------------=
-------
+
+bool VobParser::ParseNextPacket(const CellsListType & Cells)
+{
+ if(GetNextPacket())
+ {=09
+ pktinfo.identifier =3D GetNext32Bits();
+ if((pktinfo.identifier & VOB_SLICE) !=3D VOB_SLICE || (pktinfo.identif=
ier & PACK_HEADER) !=3D PACK_HEADER)
+ {
+ // Invalid block start code
+ throw VobParserInvalidPacketException(CURRENT_OFFSET-4);
+ }
+ =09
+ ParseSCR(); // System Clock Reference
+
+ // Program Mux Rate (measured in units of 50 bytes/second)
+ pktinfo.program_mux_rate =3D (GetNext8Bits() << 14) |=20
+ (GetNext8Bits() << 6) | (GetNext8Bits() >> 2);
+
+ // Skip Pack stuffing length
+ int stuffing_nb =3D GetNext8Bits() & 0x07;
+ SkipNBytes(stuffing_nb);
+ =09
+ uint32_t _Header =3D GetNext32Bits();
+ int _StreamID;
+ if ((_Header & VOB_SLICE) =3D=3D VOB_SLICE)
+ {
+ _StreamID =3D _Header & 0xFF;
+ if (_StreamID =3D=3D SYSTEM_HEADER)
+ {
+ // skip the system header data
+ uint16_t _size =3D GetNext16Bits();
+ SkipNBytes(_size);
+
+ while (AvailablePacketData())
+ {
+ _Header =3D GetNext32Bits();
+ uint8_t _StreamId =3D _Header & 0xFF;
+ if (_StreamId =3D=3D PRIVATE_STREAM2)
+ {
+ debug("Navigation pack {\n");
+ inc_lvl();
+ debug(QString("SCR: %1.%2\n").arg(pktinfo.scr).arg(pktinfo.scr_ext=
));
+ debug(QString("Program mux rate: %1 (%2 bps)\n").arg(pktinfo.progr=
am_mux_rate).arg(pktinfo.program_mux_rate * 50 * 8));
+ ParseNavPacket();
+ dec_lvl();
+ debug("}\n");
+ }
+ else
+ {
+ // skip these data
+ uint16_t _size =3D GetNext16Bits();
+ SkipNBytes(_size);
+ }
+ }
+ if (IsNewCell()) {
+ CellListElem* cell =3D Cells.at(GetVobID(), GetCellID());
+
+ if (cell !=3D NULL)
+ {
+ cell->found =3D true;
+ if (m_dsi.nv_pck_scr =3D=3D 0)
+ m_pci_vob_timecode_offset =3D m_pci.vobu_s_ptm / 90;
+ m_demuxer.SetBoundary(m_pci.vobu_s_ptm/90 - m_pci_vob_timecode_off=
set, cell->nb_frames * cell->frame_dur, cell);
+ }
+ }
+ if (m_pci.btn_ns !=3D 0)
+ { // there are some buttons
+ uint32_t t3 =3D m_pci.vobu_s_ptm/90 - m_pci_vob_timecode_offset;
+ uint32_t t4 =3D m_pci.vobu_e_ptm/90 - m_pci_vob_timecode_offset;
+ m_demuxer.ProcessStream(SUBSTREAM_PCI, &m_buff[m_pci_position], m_p=
ci_size+2, t3, t4,=20
+ QString("# %1 -> %2 / %3 / %4 / %5 / %6 / off %7\n")
+ .arg(m_pci.vobu_s_ptm/90).arg(m_pci.vobu_e_ptm/90)
+ .arg(m_dsi.c_eltm, 0, 16).arg(m_pci.c_eltm, 0, 16)
+ .arg(t3).arg(t4).arg(m_pci_vob_timecode_offset));
+ =09
+ }
+ }
+ else if ((_StreamID & VIDEO_STREAM) =3D=3D VIDEO_STREAM)
+ {
+ debug("Video pack {}\n");
+ ParseVideoPacket();
+ }
+ else if ((_StreamID & AUDIO_STREAM) =3D=3D AUDIO_STREAM)
+ {
+ debug("Audio pack {}\n");
+ ParseAudioPacket(_StreamID);
+ }
+ else if (_StreamID =3D=3D PRIVATE_STREAM1)
+ {
+ debug("Private stream 1 pack {\n");
+ inc_lvl();
+ ParsePrivateStream1();
+ dec_lvl();
+ debug("}\n");
+ }
+ else
+ {
+ uint16_t _size =3D GetNext16Bits();
+ SkipNBytes(_size);
+ debug("Unknown slice type\n");
+ }
+
+ if (m_bFirstPacket && _StreamID !=3D SYSTEM_HEADER)
+ {
+ m_bFirstPacket =3D false;
+ m_startdts =3D pktinfo.dts;
+ m_startpts =3D pktinfo.pts;
+ }
+ }
+ else
+ {
+ debug("Unknown start code\n");
+ }
+ =09
+ m_pktindex++;
+ }
+ else
+ {
+ return false;
+ }
+
+ return true;
+}
+
+// ---------------------------------------------------------------------=
-------
+
+bool VobParser::AvailablePacketData() const
+{
+ return (m_index < DVD_VIDEO_LB_LEN);
+}
+
+// ---------------------------------------------------------------------=
-------
+
+bool VobParser::GetNextPacket()
+{
+ m_index =3D 0;
+
+ return (DVDReadBlocks(m_stream, m_pktindex, 1, m_buff) =3D=3D 1);
+}
+
+// ---------------------------------------------------------------------=
-------
+
+uint32_t VobParser::GetNext32Bits()
+{
+ uint32_t result =3D 0;
+ result |=3D m_buff[m_index++];
+ result <<=3D 8;
+ result |=3D m_buff[m_index++];
+ result <<=3D 8;
+ result |=3D m_buff[m_index++];
+ result <<=3D 8;
+ result |=3D m_buff[m_index++];
+ return result;
+}
+
+// ---------------------------------------------------------------------=
-------
+
+uint16_t VobParser::GetNext16Bits()
+{
+ uint32_t result =3D 0;
+ result |=3D m_buff[m_index++];
+ result <<=3D 8;
+ result |=3D m_buff[m_index++];
+ return result;
+}
+
+// ---------------------------------------------------------------------=
-------
+
+uint8_t VobParser::GetNext8Bits()
+{
+ return m_buff[m_index++];
+}
+
+// ---------------------------------------------------------------------=
-------
+
+void VobParser::SkipNBytes(int n)
+{
+ m_index +=3D n;
+}
+
+// ---------------------------------------------------------------------=
-------
+
+void VobParser::ParseSCR()
+{
+
+/* From http://dvd.sourceforge.net/dvdinfo/packhdr.html
+
+ Byte 4 Byte 5
+ +--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+
+ | 7| 6| 5| 4| 3| 2| 1| 0| | 7| 6| 5| 4| 3| 2| 1| 0|
+ +--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+
+SCR bits |f0|f1|32|31|30|f1|29|28| |27|26|25|24|23|22|21|20|
+ +--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+
+
+ Byte 6 Byte 7
+ +--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+
+ | 7| 6| 5| 4| 3| 2| 1| 0| | 7| 6| 5| 4| 3| 2| 1| 0|
+ +--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+
+SCR bits |19|18|17|16|15|f1|14|13| |12|11|10| 9| 8| 7| 6| 5|
+ +--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+
+
+ Byte 8 Byte 9
+ +--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+
+ | 7| 6| 5| 4| 3| 2| 1| 0| | 7| 6| 5| 4| 3| 2| 1| 0|
+ +--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+
+SCR bits | 4| 3| 2| 1| 0|f1|e8|e7| |e6|e5|e4|e3|e2|f1|e0|c1|
+ +--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+
+
+ fx =3D bit value fixed to x
+ ex =3D bit x of scr_ext
+*/
+
+ uint8_t byte4, byte5, byte6, byte7, byte8, byte9;
+ byte4 =3D GetNext8Bits(); byte5 =3D GetNext8Bits();
+ byte6 =3D GetNext8Bits(); byte7 =3D GetNext8Bits();
+ byte8 =3D GetNext8Bits(); byte9 =3D GetNext8Bits();
+
+ assert((byte4 & 0xc4) =3D=3D 0x44);
+ assert(byte6 & 0x04);
+ assert(byte8 & 0x04);
+ assert(byte9 & 0x01);
+ =09
+ uint64_t scr =3D 0;
+ scr |=3D ((((byte4 & 0x38) >> 1) | (byte4 & 0x03)) << 28);
+ scr |=3D (byte5 << 20);
+ scr |=3D ((((byte6 & 0xf8) >> 1) | (byte6 & 0x03)) << 13);
+ scr |=3D (byte7 << 5);
+ scr |=3D ((byte8 & 0xf8) >> 3);
+
+ uint16_t scr_ext =3D 0;
+ scr_ext |=3D ((byte8 & 0x03) << 7);
+ scr_ext |=3D ((byte9 & 0xfe) >> 1);
+
+ pktinfo.scr =3D scr;
+ pktinfo.scr_ext =3D scr_ext;
+}
+
+// ---------------------------------------------------------------------=
-------
+
+void VobParser::ParseNavPacket()
+{
+ uint32_t endStreamIndex =3D 0;
+ uint32_t position =3D m_index;
+ uint16_t length =3D GetNext16Bits();
+ endStreamIndex =3D m_index + length;
+ uint8_t substreamID =3D GetNext8Bits();
+=09
+ switch(substreamID)
+ {
+ case SUBSTREAM_PCI:
+ debug("PCI {\n");
+ inc_lvl();
+ ParsePCI();
+ m_pci_position =3D position-4; // keep the Private Stream 2 header
+ m_pci_size =3D length+4;
+ dec_lvl();
+ debug("}\n");
+ break;
+ case SUBSTREAM_DSI:
+ debug("DSI {\n");
+ inc_lvl();
+ ParseDSI();
+ dec_lvl();
+ debug("}\n");
+ break;
+ default:
+ debug(QString("ParseNavPacket: unknown substream id @LBA=3D%1\n").arg=
(m_pktindex));
+ }
+=09
+ m_index =3D endStreamIndex;
+}
+
+// ---------------------------------------------------------------------=
-------
+
+void VobParser::ParsePCI()
+{
+ int i,j;
+ uint8_t onebyte;
+
+ // PCI General Information
+ m_pci.nv_pck_lbn =3D GetNext32Bits();
+ m_pci.vobu_cat =3D GetNext16Bits();
+ m_pci.reserved1 =3D GetNext16Bits();
+ m_pci.vobu_uop_ctl =3D GetNext32Bits();
+ m_pci.vobu_s_ptm =3D GetNext32Bits();
+ m_pci.vobu_e_ptm =3D GetNext32Bits();
+ m_pci.vobu_se_e_ptm =3D GetNext32Bits();
+ m_pci.c_eltm =3D GetNext32Bits();
+ memcpy(m_pci.vobu_isrc, &m_buff[m_index],32*1);=09
+ SkipNBytes(32*1);
+
+ // Non Seamless Angle Information
+ memcpy(m_pci.nsml_agli_dsta, &m_buff[m_index], 9*4);
+ SkipNBytes(9*4);
+
+ // Highlight General Information=20
+ m_pci.hli_ss =3D GetNext16Bits();
+ m_pci.hli_s_ptm =3D GetNext32Bits();
+ m_pci.hli_e_ptm =3D GetNext32Bits();
+ m_pci.btn_sl_e_ptm =3D GetNext32Bits();
+ m_pci.btn_md =3D GetNext16Bits();
+ m_pci.btn_sn =3D GetNext8Bits();
+ m_pci.btn_ns =3D GetNext8Bits();
+ m_pci.nsl_btn_ns =3D GetNext8Bits();
+ m_pci.reserved1 =3D GetNext8Bits();
+ m_pci.fosl_btnn =3D GetNext8Bits();
+ m_pci.foac_btnn =3D GetNext8Bits();
+=09
+ // Button Color Information Table=20
+ for(i =3D 0; i < 3; i++)
+ for(j =3D 0; j < 2; j++)
+ m_pci.btn_coli[i][j] =3D GetNext32Bits();
+
+ // Button Information
+ for(i =3D 0; i < 36; i++)
+ {
+ onebyte =3D GetNext8Bits();
+ m_pci.btnit[i].btn_coln =3D (onebyte & 0xC0) >> 6;
+ m_pci.btnit[i].start_x =3D (onebyte & 0x3F) << 4;
+
+ onebyte =3D GetNext8Bits();
+ m_pci.btnit[i].start_x |=3D (onebyte & 0xF0) >> 4;
+ m_pci.btnit[i].end_x =3D (onebyte & 0x03) << 8;
+
+ onebyte =3D GetNext8Bits();
+ m_pci.btnit[i].end_x |=3D onebyte;
+
+ onebyte =3D GetNext8Bits();
+ m_pci.btnit[i].auto_action_flag =3D (onebyte & 0xC0) >> 6;
+ m_pci.btnit[i].start_y =3D (onebyte & 0x3F) << 4;
+ =09
+ onebyte =3D GetNext8Bits();
+ m_pci.btnit[i].start_y |=3D (onebyte & 0xF0) >> 4;
+ m_pci.btnit[i].end_y =3D (onebyte & 0x03) << 8;
+ =09
+ onebyte =3D GetNext8Bits();
+ m_pci.btnit[i].end_y |=3D onebyte;
+
+ m_pci.btnit[i].up =3D GetNext8Bits() & 0x3F;
+ m_pci.btnit[i].down =3D GetNext8Bits() & 0x3F;
+ m_pci.btnit[i].left =3D GetNext8Bits() & 0x3F;
+ m_pci.btnit[i].right =3D GetNext8Bits() & 0x3F;
+ =09
+ memcpy(m_pci.btnit[i].vm_cmd, &m_buff[m_index],8*1);
+ SkipNBytes(8*1);
+ }
+
+ debug(QString("nv_pck_lbn: %1\n").arg(m_pci.nv_pck_lbn));
+ debug(QString("vobu_cat: %1\n").arg(m_pci.vobu_cat));
+ debug(QString("reserved1: %1\n").arg(m_pci.reserved1));
+ debug(QString("vobu_uop_ctl: %1\n").arg(m_pci.vobu_uop_ctl));
+ debug(QString("vobu_s_ptm: %1\n").arg(m_pci.vobu_s_ptm));
+ debug(QString("vobu_e_ptm: %1\n").arg(m_pci.vobu_e_ptm));
+ debug(QString("vobu_se_e_ptm: %1\n").arg(m_pci.vobu_se_e_ptm));
+ debug(QString("e_eltm: %1\n").arg(m_pci.c_eltm));
+ debug(QString("vobu_isrc: ...\n").toAscii());
+ debug(QString("nsml_agli_dsta: ...\n").toAscii());
+ debug(QString("hli_ss: %1\n").arg(m_pci.hli_ss));
+}
+
+// ---------------------------------------------------------------------=
-------
+
+void VobParser::ParseDSI()
+{
+ m_dsi.nv_pck_scr =3D GetNext32Bits();
+ m_dsi.nv_pck_lbn =3D GetNext32Bits();
+ m_dsi.vobu_ea =3D GetNext32Bits();
+ m_dsi.vobu_1stref_ea =3D GetNext32Bits();
+ m_dsi.vobu_2ndref_ea =3D GetNext32Bits();
+ m_dsi.vobu_3rdref_ea =3D GetNext32Bits();
+ m_dsi.vobu_vob_idn =3D GetNext16Bits();
+ m_dsi.reserved =3D GetNext8Bits();
+ m_dsi.vobu_c_idn =3D GetNext8Bits();
+ m_dsi.c_eltm =3D GetNext32Bits();
+
+ debug(QString("nv_pck_scr: %1\n").arg(m_dsi.nv_pck_scr));
+ debug(QString("nv_pck_lbn: %1\n").arg(m_dsi.nv_pck_lbn));
+ debug(QString("vobu_ea: %1\n").arg(m_dsi.vobu_ea));
+ debug(QString("vobu_1stref_ea: %1\n").arg(m_dsi.vobu_1stref_ea));
+ debug(QString("vobu_2ndref_ea: %1\n").arg(m_dsi.vobu_2ndref_ea));
+ debug(QString("vobu_3rdref_ea: %1\n").arg(m_dsi.vobu_3rdref_ea));
+ debug(QString("vobu_vob_idn: %1\n").arg(m_dsi.vobu_vob_idn));
+ debug(QString("reserved: %1\n").arg(m_dsi.reserved));
+ debug(QString("vobu_c_idn: %1\n").arg(m_dsi.vobu_c_idn));
+ debug(QString("c_eltm: %1\n").arg(m_dsi.c_eltm));
+}
+
+// ---------------------------------------------------------------------=
-------
+
+uint8_t GetBit(uint32_t data, uint8_t n)
+{
+ return ((data >> n) & 0x01);
+}
+
+// ---------------------------------------------------------------------=
-------
+
+void VobParser::ParsePESHeaderDataContentFlag()
+{=09
+ uint8_t byte6 =3D GetNext8Bits();
+ assert((byte6 & 0xC0) =3D=3D 0x80);
+ pes_header_data_content.PES_scrambling_control =3D (byte6 & 0x30) >> 4;
+ pes_header_data_content.PES_priority =3D GetBit(byte6,3);
+ pes_header_data_content.data_alignment_indicator =3D GetBit(byte6,2);
+ pes_header_data_content.copyright =3D GetBit(byte6,1);
+ pes_header_data_content.original_or_copy =3D GetBit(byte6,0);
+
+ uint8_t byte7 =3D GetNext8Bits();
+ pes_header_data_content.PTS_flag =3D GetBit(byte7,7);
+ pes_header_data_content.DTS_flag =3D GetBit(byte7,6);
+ pes_header_data_content.ESCR_flag =3D GetBit(byte7,5);
+ pes_header_data_content.ES_rate_flag =3D GetBit(byte7,4);
+ pes_header_data_content.DSM_trick_mode_flag =3D GetBit(byte7,3);
+ pes_header_data_content.additionnal_copy_info_flag =3D GetBit(byte7,2);
+ pes_header_data_content.PES_CRC_flag =3D GetBit(byte7,1);
+ pes_header_data_content.PES_extension_flag =3D GetBit(byte7,0);
+=09
+ pes_header_data_content.PES_header_data_len =3D GetNext8Bits();
+}
+
+// ---------------------------------------------------------------------=
-------
+
+uint64_t VobParser::ParsePTS_DTS()
+{
+ // PTS and DTS have same format
+ uint64_t result =3D 0;
+
+ uint8_t byte0 =3D GetNext8Bits();
+ uint16_t word0 =3D GetNext16Bits();
+ uint16_t word1 =3D GetNext16Bits();
+
+ assert(word0 & 0x01);
+ assert(word1 & 0x01);
+
+ result |=3D (((byte0 & 0x0E) >> 1) << 30);
+ result |=3D ((word0 >> 1) << 15);
+ result |=3D (word1 >> 1);
+
+ return result;
+}
+
+// ---------------------------------------------------------------------=
-------
+
+void VobParser::ParsePESHeaderData()
+{
+ uint8_t bytesLeft =3D pes_header_data_content.PES_header_data_len;
+ if(pes_header_data_content.PTS_flag)
+ {
+ // PTS : Presentation Time Stamp
+ pktinfo.pts =3D ParsePTS_DTS();
+ bytesLeft -=3D 5;
+ if (m_bFirstPacket)
+ {
+ m_startpts =3D pktinfo.pts;
+ }
+ pktinfo.pts -=3D m_startpts;
+ }
+ if(pes_header_data_content.DTS_flag)
+ {
+ // DTS : Decoding Time Stamp
+ pktinfo.dts =3D ParsePTS_DTS();
+ bytesLeft -=3D 5;
+ if (m_bFirstPacket)
+ {
+ m_startdts =3D pktinfo.dts;
+ }
+ pktinfo.dts -=3D m_startdts;
+ }
+ m_bFirstPacket =3D false;
+
+ // Skip the rest
+ SkipNBytes(bytesLeft);
+}
+
+// ---------------------------------------------------------------------=
-------
+
+void VobParser::ParseVideoPacket()
+{
+ uint16_t length =3D GetNext16Bits();
+ ParsePESHeaderDataContentFlag();
+ ParsePESHeaderData();
+
+ m_demuxer.ProcessStream(VIDEO_STREAM, &m_buff[m_index],
+ length - 3 - pes_header_data_content.PES_header_data_len, pktinfo.dts/=
90, pktinfo.pts/90,
+ QString("DTS %1 PTS %2 - %3 %4\n").arg(m_startdts/90).arg(m_startpts/9=
0).arg(pktinfo.dts/90).arg(pktinfo.pts/90));
+}
+
+void VobParser::ParseAudioPacket(int StreamID)
+{
+ uint16_t length =3D GetNext16Bits();
+ ParsePESHeaderDataContentFlag();
+ ParsePESHeaderData();
+
+ m_demuxer.ProcessStream(StreamID, &m_buff[m_index],
+ length - 3 - pes_header_data_content.PES_header_data_len, pktinfo.pts/=
90, pktinfo.dts/90,
+ QString("DTS %1 PTS %2 - %3 %4\n").arg(m_startdts/90).arg(m_startpts/9=
0).arg(pktinfo.dts/90).arg(pktinfo.pts/90));
+}
+
+// ---------------------------------------------------------------------=
-------
+
+void VobParser::ParsePrivateStream1()
+{
+ uint16_t length =3D GetNext16Bits();=09
+ uint16_t dataStartIndex =3D m_index;
+ // PES : Packetized Elementary Stream
+ ParsePESHeaderDataContentFlag();
+ ParsePESHeaderData();
+ uint8_t substreamID =3D GetNext8Bits();
+
+ uint32_t t3 =3D m_pci.vobu_s_ptm/90 - m_pci_vob_timecode_offset;
+ uint32_t t4 =3D m_pci.vobu_e_ptm/90 - m_pci_vob_timecode_offset;
+ if(substreamID >=3D SUBSTREAM_SUB_LOW && substreamID < SUBSTREAM_SUB_HI=
GH)
+ {
+ debug(QString("Subtitles streamID =3D 0x%1\n").arg(substreamID, 0, 16)=
);
+
+ // .sub files the VobSub way (includes the whole packet)
+ m_demuxer.ProcessStream(substreamID, m_buff, DVD_VIDEO_LB_LEN, t3, t4,=
=20
+ QString("DTS %1 PTS %2 - %3 %4\n").arg(m_startdts/90).arg(m_startp=
ts/90).arg(pktinfo.dts/90).arg(pktinfo.pts/90));
+ }
+ else if(substreamID >=3D SUBSTREAM_AC3_LOW && substreamID < SUBSTREAM_A=
C3_HIGH)
+ {
+ debug(QString("AC3 streamID =3D 0x%1\n").arg(substreamID, 0, 16));
+
+ // Skip frame header number
+ SkipNBytes(1);
+ // Skip first access unit pointer
+ SkipNBytes(2);
+
+ uint16_t ac3DataLen =3D length - (m_index - dataStartIndex);
+ m_demuxer.ProcessStream(substreamID, &m_buff[m_index], ac3DataLen, t3,=
t4,=20
+ QString("DTS %1 PTS %2 - %3 %4\n").arg(m_startdts/90).arg(m_startp=
ts/90).arg(pktinfo.dts/90).arg(pktinfo.pts/90));
+ }
+ else if(substreamID >=3D SUBSTREAM_DTS_LOW && substreamID < SUBSTREAM_D=
TS_HIGH)
+ {
+ debug(QString("DTS streamID =3D 0x%1\n").arg(substreamID, 0, 16));
+ =09
+ // Skip frame header number
+ SkipNBytes(1);
+ // Skip first access unit pointer
+ SkipNBytes(2);
+
+ uint16_t ac3DataLen =3D length - (m_index - dataStartIndex);
+ m_demuxer.ProcessStream(substreamID, &m_buff[m_index], ac3DataLen, t3,=
t4,=20
+ QString("DTS %1 PTS %2 - %3 %4\n").arg(m_startdts/90).arg(m_startp=
ts/90).arg(pktinfo.dts/90).arg(pktinfo.pts/90));
+ }
+ else if(substreamID >=3D SUBSTREAM_PCM_LOW && substreamID < SUBSTREAM_P=
CM_HIGH)
+ {
+ debug(QString("LPCM streamID =3D 0x%1\n").arg(substreamID, 0, 16));
+
+ // Skip unknown data
+ SkipNBytes(6);
+
+ uint16_t ac3DataLen =3D length - (m_index - dataStartIndex);
+ m_demuxer.ProcessStream(substreamID, &m_buff[m_index], ac3DataLen, t3,=
t4,=20
+ QString("DTS %1 PTS %2 - %3 %4\n").arg(m_startdts/90).arg(m_startpts/=
90).arg(pktinfo.dts/90).arg(pktinfo.pts/90));
+ }
+ else
+ {
+ debug("Unknown\n");
+ }
+}
+
+// ---------------------------------------------------------------------=
-------
+
+void VobParser::Reset()
+{
+ memset(&m_dsi, 0, sizeof(m_dsi));
+ memset(&pktinfo, 0, sizeof(pktinfo));
+ memset(&pes_header_data_content, 0, sizeof(pes_header_data_content));
+ previous_vobid =3D -1;
+ previous_cellid =3D -1;
+ m_index =3D 0;
+ m_pktindex =3D 0;
+ DVDFileSeek(m_stream,0);
+}
+
+// ---------------------------------------------------------------------=
-------
+
+bool VobParser::IsNewCell()
+{
+ bool result =3D (GetVobID() !=3D previous_vobid ||
+ GetCellID() !=3D previous_cellid);
+=09
+ previous_vobid =3D GetVobID();
+ previous_cellid =3D GetCellID();
+ if (result)
+ m_bFirstPacket =3D true;
+
+ return result;
+}
+
+// ---------------------------------------------------------------------=
-------
+
+inline uint8_t VobParser::GetVobID() const
+{
+ return m_dsi.vobu_vob_idn;
+}
+
+// ---------------------------------------------------------------------=
-------
+
+inline uint8_t VobParser::GetCellID() const
+{
+ return m_dsi.vobu_c_idn;
+}
+
+// ---------------------------------------------------------------------=
-------
+
+uint32_t VobParser::GetCellSCR() const
+{
+ return m_dsi.nv_pck_scr;
+}
+
+// ---------------------------------------------------------------------=
-------
+=20
+void SubDemuxWriter::WriteTimecodeInfo(uint32_t start_time, uint32_t end=
_time, uint64_t filepos, const QString& debug)
+{
+ int i;
+
+ if (!m_TimecodeFile)
+ {
+ QString m_filename (m_Filename);
+ m_filename +=3D ".idx";
+ m_TimecodeFile =3D fopen(QFile::encodeName(m_filename),"w");
+
+ fwrite("# VobSub index file, v7 (do not modify this line!)\n#\n", 1, 5=
3, m_TimecodeFile);
+ fwrite("# Settings\n\n# Original frame size\nsize: ", 1, 40, m_Timecod=
eFile);
+ fprintf(m_TimecodeFile, "%dx%d\n\n", m_width, m_height);
+ fwrite("# Origin, relative to the upper-left corner, can be overloaded=
by aligment\n"
+ "org: 0, 0\n\n"
+ "# Image scaling (hor,ver), origin is at the upper-left corner =
or at the alignment coord (x, y)\n"
+ "scale: 100%, 100%\n\n"
+ "# Alpha blending\n"
+ "alpha: 100%\n\n"
+ "# Smoothing for very blocky images (use OLD for no filtering)\=
n"
+ "smooth: OFF\n\n"
+ "# In millisecs\n"
+ "fadein/out: 50, 50\n\n"
+ "# Force subtitle placement relative to (org.x, org.y)\n"
+ "align: OFF at LEFT TOP\n\n"
+ "# For correcting non-progressive desync. (in millisecs or hh:m=
m:ss:ms)\n"
+ "# Note: Not effective in DirectVobSub, use \"delay: ... \" ins=
tead.\n"
+ "time offset: 0\n\n"
+ "# ON: displays only forced subtitles, OFF: shows everything\n"
+ "forced subs: OFF\n\n"
+ "# The original palette of the DVD\n"
+ "palette: ", 1, 692, m_TimecodeFile);
+ for (i=3D0; i<15; i++)
+ {
+ fprintf(m_TimecodeFile, "%06x, ", m_palette[i]);
+ }
+ fprintf(m_TimecodeFile, "%06x\n\n", m_palette[i]);
+ fwrite("# Custom colors (transp idxs and the four colors)\n"
+ "custom colors: OFF, tridx: 0000, colors: 000000, 000000, 00000=
0, 000000\n\n"
+ "# Language index in use\n"
+ "langidx: 0\n\n"
+ "id: ", 1, 163, m_TimecodeFile);
+ if (m_language)
+ fprintf(m_TimecodeFile, "%c%c", m_language >> 8, m_language);
+ else
+ fwrite("un", 1, 2, m_TimecodeFile);
+ fwrite(", index: 0\n"
+ "# Decomment next line to activate alternative name in DirectVo=
bSub / Windows Media Player 6.x\n"
+ "# alt: ", 1, 112, m_TimecodeFile);
+ fprintf(m_TimecodeFile, "%s\n\n", DecodeLanguage(m_language));
+ }
+ int32_t delay =3D start_time + m_start_timecode;
+ int millisecond =3D delay % 1000;
+ delay /=3D 1000;
+ int second =3D delay % 60;
+ delay /=3D 60;
+ int minute =3D delay % 60;
+ delay /=3D 60;
+ fprintf(m_TimecodeFile, "timestamp: %02d:%02d:%02d:%03d, filepos: %09x\=
n", delay,minute,second,millisecond,filepos);
+}
+
+void BtnDemuxWriter::WriteTimecodeInfo(uint32_t start_time, uint32_t end=
_time, uint64_t filepos, const QString& debug)
+{
+//static uint32_t time =3D0;
+ m_TimecodeFile =3D GetTimecodeFile();
+
+ if (start_time > m_last_end_timecode)
+ {
+ if (m_last_end_timecode > m_start_timecode)
+ fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
+ fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_last_start_t=
imecode) / 1000.0);
+ fprintf(m_TimecodeFile, "gap,%lf\n", (start_time - m_last_end_timecode=
) / 1000.0);
+ m_start_timecode =3D start_time;
+ }
+//fwrite(debug.c_str(), debug.size(), 1, m_TimecodeFile);
+//fprintf(m_TimecodeFile, "# %d =3D> %d\n",time, time + end_time - start=
_time);
+//time +=3D end_time - start_time;
+ m_last_start_timecode =3D start_time;
+ m_last_end_timecode =3D end_time;
+}
+
+void DTSDemuxWriter::WriteTimecodeInfo(uint32_t start_time, uint32_t end=
_time, uint64_t filepos, const QString& debug)
+{
+ m_TimecodeFile =3D GetTimecodeFile();
+
+ if (start_time > m_last_end_timecode)
+ {
+ if (m_last_end_timecode > m_start_timecode)
+ fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
+ fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_last_start_t=
imecode) / 1000.0);
+ fprintf(m_TimecodeFile, "gap,%lf\n", (start_time - m_last_end_timecode=
) / 1000.0);
+ m_start_timecode =3D start_time;
+ }
+ m_last_start_timecode =3D start_time;
+ m_last_end_timecode =3D end_time;
+}
+
+void LPCMDemuxWriter::WriteTimecodeInfo(uint32_t start_time, uint32_t en=
d_time, uint64_t filepos, const QString& debug)
+{
+ m_TimecodeFile =3D GetTimecodeFile();
+
+ if (start_time > m_last_end_timecode)
+ {
+ if (m_last_end_timecode > m_start_timecode)
+ fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
+ fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timeco=
de) / 1000.0);
+ fprintf(m_TimecodeFile, "gap,%lf\n", (start_time - m_last_end_timecode=
) / 1000.0);
+ m_start_timecode =3D start_time;
+ }
+ m_last_start_timecode =3D start_time;
+ m_last_end_timecode =3D end_time;
+}
+
+void MPADemuxWriter::WriteTimecodeInfo(uint32_t start_time, uint32_t end=
_time, uint64_t filepos, const QString& debug)
+{
+ m_TimecodeFile =3D GetTimecodeFile();
+}
+
+void AC3DemuxWriter::WriteTimecodeInfo(uint32_t start_time, uint32_t end=
_time, uint64_t filepos, const QString& debug)
+{
+ m_TimecodeFile =3D GetTimecodeFile();
+
+ if (start_time > m_last_end_timecode)
+ {
+ if (m_last_end_timecode > m_start_timecode)
+ fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
+ fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_last_start_t=
imecode) / 1000.0);
+ fprintf(m_TimecodeFile, "gap,%lf\n", (start_time - m_last_end_timecode=
) / 1000.0);
+ m_start_timecode =3D start_time;
+ }
+ m_last_start_timecode =3D start_time;
+ m_last_end_timecode =3D end_time;
+}
+
+void VideoDemuxWriter::WriteTimecodeInfo(uint32_t start_time, uint32_t e=
nd_time, uint64_t filepos, const QString& debug)
+{
+ // TODO detect gaps in the stream
+}
+
+// =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
+
+void VideoDemuxWriter::ProcessStream(uint8_t* buff, uint32_t size, uint3=
2_t start_time, uint32_t end_time, const QString& debug)
+{
+ if (m_parser =3D=3D NULL)
+ m_parser =3D new M2VParser;
+=09
+ m_parser->WriteData(buff, size);
+
+ MPEG2ParserState state =3D m_parser->GetState();
+
+ while (state =3D=3D MPV_PARSER_STATE_FRAME)=20
+ {
+ delete m_parser->ReadFrame();
+ state =3D m_parser->GetState();
+ }
+
+ Write(buff, size, start_time, end_time, debug);=20
+}
+
+void VideoDemuxWriter::SetBoundary(uint32_t start_timecode, uint32_t dur=
ation, const CellListElem *cell)
+{
+ if (m_parser !=3D NULL)
+ {
+ m_parser->SetEOS();
+
+ MPEG2ParserState state =3D m_parser->GetState();
+
+ while (state =3D=3D MPV_PARSER_STATE_FRAME)=20
+ {
+ MPEGFrame* current_frame =3D m_parser->ReadFrame();
+ if ((current_frame->timecode + current_frame->duration) / 1000000 > m=
_last_end_timecode)
+ {
+ m_last_start_timecode =3D current_frame->timecode / 1000000;
+ m_last_end_timecode =3D (current_frame->timecode + current_frame->du=
ration) / 1000000;
+ }
+ delete current_frame;
+
+ state =3D m_parser->GetState();
+ }
+ =09
+ delete m_parser;
+ }
+=09
+ m_parser =3D new M2VParser();
+
+ m_TimecodeFile =3D GetTimecodeFile();
+
+ if (m_end_timecode !=3D 0)
+ {
+ if (m_is_still) {
+ fwrite(" (Still)\n", 1, 9, m_TimecodeFile);
+ fprintf(m_TimecodeFile, "%lf,%lf\n", (m_end_timecode - m_start_timeco=
de) / 1000.0, 1000.0 / (m_end_timecode - m_start_timecode));
+ }
+ else if (m_last_end_timecode < m_end_timecode)
+ {
+ fprintf(m_TimecodeFile, "\n%lf\n", (m_last_end_timecode - m_start_tim=
ecode) / 1000.0);
+ fprintf(m_TimecodeFile, "gap,%lf\n", (m_end_timecode - m_last_end_tim=
ecode) / 1000.0);
+ }
+ else
+ {
+ if (m_last_end_timecode > m_end_timecode)
+ qWarning("There is more video that indicated in the cell.");
+ fprintf(m_TimecodeFile, "\n%lf\n", (m_last_end_timecode - m_start_tim=
ecode) / 1000.0);
+ }
+ }
+
+ m_start_timecode =3D start_timecode;
+ m_end_timecode =3D start_timecode + duration;
+ m_last_end_timecode =3D start_timecode;
+ m_is_still =3D cell->isStill;
+
+ fprintf(m_TimecodeFile, "\n# VOB %d Cell %d", cell->vobid, cell->cellid=
);
+}
+
+void AC3DemuxWriter::SetBoundary(uint32_t start_timecode, uint32_t durat=
ion, const CellListElem *cell)
+{
+ m_TimecodeFile =3D GetTimecodeFile();
+
+ // handle ending of the previous cell
+ if (m_last_end_timecode < m_end_timecode)
+ {
+ if (m_last_end_timecode > m_start_timecode)
+ fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
+ fprintf(m_TimecodeFile, "gap,%lf\n", (m_end_timecode - m_last_end_time=
code) / 1000.0);
+ }
+ else
+ {
+ if (m_end_timecode !=3D 0)
+ {
+ if (m_last_end_timecode > m_end_timecode)
+ qWarning("There is more AC3 audio that indicated in the cell.");
+ fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
+ }
+ }
+
+ m_start_timecode =3D start_timecode;
+ m_end_timecode =3D start_timecode + duration;
+ m_last_end_timecode =3D start_timecode;
+ m_last_start_timecode =3D start_timecode;
+
+ fprintf(m_TimecodeFile, "\n# VOB %d Cell %d\n", cell->vobid, cell->cell=
id);
+}
+
+void DTSDemuxWriter::SetBoundary(uint32_t start_timecode, uint32_t durat=
ion, const CellListElem *cell)
+{
+ m_TimecodeFile =3D GetTimecodeFile();
+
+ // handle ending of the previous cell
+ if (m_last_end_timecode < m_end_timecode)
+ {
+ if (m_last_end_timecode > m_start_timecode)
+ fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
+ fprintf(m_TimecodeFile, "gap,%lf\n", (m_end_timecode - m_last_end_time=
code) / 1000.0);
+ }
+ else
+ {
+ if (m_end_timecode !=3D 0)
+ {
+ if (m_last_end_timecode > m_end_timecode)
+ qWarning("There is more DTS audio that indicated in the cell.");
+ fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
+ }
+ }
+
+ m_start_timecode =3D start_timecode;
+ m_end_timecode =3D start_timecode + duration;
+ m_last_end_timecode =3D start_timecode;
+ m_last_start_timecode =3D start_timecode;
+
+ fprintf(m_TimecodeFile, "\n# VOB %d Cell %d\n", cell->vobid, cell->cell=
id);
+}
+
+void LPCMDemuxWriter::SetBoundary(uint32_t start_timecode, uint32_t dura=
tion, const CellListElem *cell)
+{
+ m_TimecodeFile =3D GetTimecodeFile();
+
+ // handle ending of the previous cell
+ if (m_last_end_timecode < m_end_timecode)
+ {
+ if (m_last_end_timecode > m_start_timecode)
+ fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
+ fprintf(m_TimecodeFile, "gap,%lf\n", (m_end_timecode - m_last_end_time=
code) / 1000.0);
+ }
+ else
+ {
+ if (m_end_timecode !=3D 0)
+ {
+ if (m_last_end_timecode > m_end_timecode)
+ qWarning("There is more PCM audio that indicated in the cell.");
+ fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
+ }
+ }
+
+ m_start_timecode =3D start_timecode;
+ m_end_timecode =3D start_timecode + duration;
+ m_last_end_timecode =3D start_timecode;
+ m_last_start_timecode =3D start_timecode;
+
+ fprintf(m_TimecodeFile, "\n# VOB %d Cell %d\n", cell->vobid, cell->cell=
id);
+}
+
+void MPADemuxWriter::SetBoundary(uint32_t start_timecode, uint32_t durat=
ion, const CellListElem *cell)
+{
+}
+
+void SubDemuxWriter::SetBoundary(uint32_t start_timecode, uint32_t durat=
ion, const CellListElem *cell)
+{
+ if (start_timecode =3D=3D 0)
+ m_start_timecode =3D m_end_timecode;
+ m_end_timecode +=3D duration;
+}
+
+void BtnDemuxWriter::SetBoundary(uint32_t start_timecode, uint32_t durat=
ion, const CellListElem *cell)
+{
+ m_TimecodeFile =3D GetTimecodeFile();
+
+ // handle ending of the previous cell
+ if (m_last_end_timecode < m_end_timecode)
+ {
+ if (m_last_end_timecode > m_start_timecode)
+ fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
+ fprintf(m_TimecodeFile, "gap,%lf\n", (m_end_timecode - m_last_end_time=
code) / 1000.0);
+ }
+ else
+ {
+ if (m_end_timecode !=3D 0)
+ {
+ if (m_last_end_timecode > m_end_timecode)
+ qWarning("There is more Button data that indicated in the cell.");
+ fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
+ }
+ }
+
+ m_start_timecode =3D start_timecode;
+ m_end_timecode =3D start_timecode + duration;
+ m_last_end_timecode =3D start_timecode;
+ m_last_start_timecode =3D start_timecode;
+
+ fprintf(m_TimecodeFile, "\n# VOB %d Cell %d\n", cell->vobid, cell->cell=
id);
+}
+
+VideoDemuxWriter::~VideoDemuxWriter()
+{
+ try
+ {
+ m_TimecodeFile =3D GetTimecodeFile();
+ }
+ catch (VobParserException&)
+ {
+ m_TimecodeFile =3D 0;
+ }
+=09
+ if (m_parser !=3D NULL)
+ {
+ m_parser->SetEOS();
+
+ MPEG2ParserState state =3D m_parser->GetState();
+
+ while (state =3D=3D MPV_PARSER_STATE_FRAME)=20
+ {
+ MPEGFrame* current_frame =3D m_parser->ReadFrame();
+ if ((current_frame->timecode + current_frame->duration) / 1000000 > m=
_last_end_timecode)
+ {
+ m_last_start_timecode =3D current_frame->timecode / 1000000;
+ m_last_end_timecode =3D (current_frame->timecode + current_frame->du=
ration) / 1000000;
+ }
+ delete current_frame;
+
+ state =3D m_parser->GetState();
+ }
+ delete m_parser;
+ }
+
+
+ if ((m_end_timecode !=3D 0) && m_TimecodeFile)
+ {
+ if (m_is_still) {
+ fwrite(" (Still)\n", 1, 9, m_TimecodeFile);
+ fprintf(m_TimecodeFile, "%lf,%lf\n", (m_end_timecode - m_start_timeco=
de) / 1000.0, 1000.0 / (m_end_timecode - m_start_timecode));
+ }
+ else if (m_last_end_timecode < m_end_timecode)
+ {
+ fprintf(m_TimecodeFile, "\n%lf\n", (m_last_end_timecode - m_start_tim=
ecode) / 1000.0);
+ fprintf(m_TimecodeFile, "gap,%lf\n", (m_end_timecode - m_last_end_tim=
ecode) / 1000.0);
+ }
+ else
+ fprintf(m_TimecodeFile, "\n%lf\n", (m_end_timecode - m_start_timecode=
) / 1000.0);
+ }
+}
+
+AC3DemuxWriter::~AC3DemuxWriter()
+{
+ try
+ {
+ m_TimecodeFile =3D GetTimecodeFile();
+ }
+ catch (VobParserException&)
+ {
+ return;
+ }
+
+ // handle ending of the previous cell
+ if (m_last_end_timecode < m_end_timecode)
+ {
+ if (m_last_end_timecode > m_start_timecode)
+ fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
+ fprintf(m_TimecodeFile, "gap,%lf\n", (m_end_timecode - m_last_end_time=
code) / 1000.0);
+ }
+ else
+ {
+ if (m_end_timecode !=3D 0)
+ fprintf(m_TimecodeFile, "%lf\n", (m_end_timecode - m_start_timecode) =
/ 1000.0);
+ }
+}
+
+DTSDemuxWriter::~DTSDemuxWriter()
+{
+ try
+ {
+ m_TimecodeFile =3D GetTimecodeFile();
+ }
+ catch (VobParserException&)
+ {
+ return;
+ }
+
+ // handle ending of the previous cell
+ if (m_last_end_timecode < m_end_timecode)
+ {
+ if (m_last_end_timecode > m_start_timecode)
+ fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
+ fprintf(m_TimecodeFile, "gap,%lf\n", (m_end_timecode - m_last_end_time=
code) / 1000.0);
+ }
+ else
+ {
+ if (m_end_timecode !=3D 0)
+ fprintf(m_TimecodeFile, "%lf\n", (m_end_timecode - m_start_timecode) =
/ 1000.0);
+ }
+}
+
+LPCMDemuxWriter::~LPCMDemuxWriter()
+{
+ try
+ {
+ m_TimecodeFile =3D GetTimecodeFile();
+ }
+ catch (VobParserException&)
+ {
+ return;
+ }
+
+ // handle ending of the previous cell
+ if (m_last_end_timecode < m_end_timecode)
+ {
+ if (m_last_end_timecode > m_start_timecode)
+ fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
+ fprintf(m_TimecodeFile, "gap,%lf\n", (m_end_timecode - m_last_end_time=
code) / 1000.0);
+ }
+ else
+ {
+ if (m_end_timecode !=3D 0)
+ fprintf(m_TimecodeFile, "%lf\n", (m_end_timecode - m_start_timecode) =
/ 1000.0);
+ }
+}
+
+BtnDemuxWriter::~BtnDemuxWriter()
+{
+ try
+ {
+ m_TimecodeFile =3D GetTimecodeFile();
+ }
+ catch (VobParserException&)
+ {
+ return;
+ }
+
+ // handle ending of the previous cell
+ if (m_last_end_timecode < m_end_timecode)
+ {
+ if (m_last_end_timecode > m_start_timecode)
+ fprintf(m_TimecodeFile, "%lf\n", (m_last_end_timecode - m_start_timec=
ode) / 1000.0);
+ fprintf(m_TimecodeFile, "gap,%lf\n", (m_end_timecode - m_last_end_time=
code) / 1000.0);
+ }
+ else
+ {
+ if (m_end_timecode !=3D 0)
+ fprintf(m_TimecodeFile, "%lf\n", (m_end_timecode - m_start_timecode) =
/ 1000.0);
+ }
+}
+
+WavWriter::~WavWriter()
+{
+ if (m_file)
+ {
+ uint8_t _tinteger[4];
+
+ fseek(m_file, m_size_position2, SEEK_SET);
+ _tinteger[0] =3D m_size & 0xFF;
+ _tinteger[1] =3D (m_size >> 8) & 0xFF;
+ _tinteger[2] =3D (m_size >> 16) & 0xFF;
+ _tinteger[3] =3D (m_size >> 24) & 0xFF;
+ fwrite(_tinteger,4,1, m_file);
+ =09
+ m_size +=3D 36;
+ fseek(m_file, m_size_position1, SEEK_SET);
+ _tinteger[0] =3D m_size & 0xFF;
+ _tinteger[1] =3D (m_size >> 8) & 0xFF;
+ _tinteger[2] =3D (m_size >> 16) & 0xFF;
+ _tinteger[3] =3D (m_size >> 24) & 0xFF;
+ fwrite(_tinteger,4,1, m_file);
+ }
+}
+
+void WavWriter::Write(uint8_t* buff, uint32_t size, uint32_t start_time,=
uint32_t end_time, const QString& debug)
+{
+ if (m_bit_depth !=3D 16) // not supported
+ return;
+ if (m_file =3D=3D NULL)
+ {
+ uint8_t _tinteger[4];
+ m_file =3D OpenOuputFile();
+
+ // create the WAV header
+ // RIFF head
+ fwrite("RIFF",4,1, m_file);
+ m_size_position1 =3D ftell(m_file);
+ fwrite("0000",4,1, m_file);
+ fwrite("WAVE",4,1, m_file);
+ =09
+ // Format head
+ fwrite("fmt ",4,1, m_file);
+ _tinteger[0] =3D 16;
+ _tinteger[1] =3D 0;
+ _tinteger[2] =3D 0;
+ _tinteger[3] =3D 0;
+ fwrite(_tinteger,4,1, m_file);
+ =09
+ _tinteger[0] =3D 1;
+ fwrite(_tinteger,2,1, m_file); // PCM
+ =09
+ _tinteger[0] =3D m_channel_nb;
+ _tinteger[1] =3D 0;
+ fwrite(_tinteger,2,1, m_file); // Channels
+ =09
+ _tinteger[0] =3D m_sample_rate & 0xFF;
+ _tinteger[1] =3D (m_sample_rate >> 8) & 0xFF;
+ _tinteger[2] =3D (m_sample_rate >> 16) & 0xFF;
+ _tinteger[3] =3D (m_sample_rate >> 24) & 0xFF;
+ fwrite(_tinteger,4,1, m_file); // Sampling freq
+ =09
+ uint32_t _byte_rate =3D (m_sample_rate * m_channel_nb * m_bit_depth) >=
> 3;
+ _tinteger[0] =3D _byte_rate & 0xFF;
+ _tinteger[1] =3D (_byte_rate >> 8) & 0xFF;
+ _tinteger[2] =3D (_byte_rate >> 16) & 0xFF;
+ _tinteger[3] =3D (_byte_rate >> 24) & 0xFF;
+ fwrite(_tinteger,4,1, m_file); // Byte Rate
+ =09
+ uint16_t _block_align =3D (m_channel_nb * m_bit_depth) >> 3;
+ _tinteger[0] =3D _block_align & 0xFF;
+ _tinteger[1] =3D (_block_align >> 8) & 0xFF;
+ fwrite(_tinteger,2,1, m_file); // Block Align
+ =09
+ _tinteger[0] =3D m_bit_depth;
+ _tinteger[1] =3D 0;
+ fwrite(_tinteger,2,1, m_file); // Block Align
+ =09
+ // Data head
+ fwrite("data",4,1, m_file);
+ m_size_position2 =3D ftell(m_file);
+ fwrite("0000",4,1, m_file);
+ m_size =3D 0;
+ }
+ uint16_t _tmp;
+ for (size_t i=3D0; i < size; i+=3D2) {
+ _tmp =3D buff[i];
+ _tmp <<=3D 8;
+ _tmp +=3D buff[i+1];
+ buff[i] =3D _tmp & 0xFF;
+ buff[i+1] =3D _tmp >> 8;
+ }
+ Writer::Write(buff, size, start_time, end_time, debug);
+ m_size +=3D size;
+}
Modified: trunk/DvdMenuXtractor/vobparser/VobParser.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/DvdMenuXtractor/vobparser/VobParser.h 2007-03-06 09:46:59 UTC (=
rev 1279)
+++ trunk/DvdMenuXtractor/vobparser/VobParser.h 2007-03-08 09:04:37 UTC (=
rev 1280)
@@ -9,12 +9,13 @@
#include <string.h>
#include <stdarg.h>
#include <stdint.h>
+#include <stdexcept>
=20
-#define HAVE_INTTYPES_H
#include "dvdread/ifo_read.h"
#include "mpegparser/M2VParser.h"
=20
#include <QList>
+#include <QFile>
#include <QString>
// =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
=20
@@ -150,31 +151,28 @@
// Exception
// =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
=20
-class Exception
+class VobParserException : public std::runtime_error
{
public:
- Exception() {}
- Exception(const char* message)
- {
- strcpy(m_message, message);
- }
-
- char m_message[512];
+ VobParserException(const char* message) : std::runtime_error(message) {=
}
+ virtual ~VobParserException() throw() {}
};
=20
-class VobParserException : public Exception
+class VobParserFileNotFoundException : public VobParserException
{
public:
- VobParserException() : Exception() {}
- VobParserException(const char* message) : Exception(message) {}
+ VobParserFileNotFoundException(const char* filename)
+ : VobParserException(qPrintable(QString("File not found exception : %1=
").arg(filename)))
+ {
+ }
};
=20
-class VobParserFileNotFoundException : public VobParserException
+class VobParserFileOpenException : public VobParserException
{
public:
- VobParserFileNotFoundException(const char* filename)
+ VobParserFileOpenException(const char* filename)
+ : VobParserException(qPrintable(QString("Could not open/create file: %=
1").arg(filename)))
{
- sprintf(m_message,"File not found exception : %s", filename);
}
};
=20
@@ -182,8 +180,8 @@
{
public:
VobParserInvalidPacketException(int offset)
+ : VobParserException(qPrintable(QString("Invalid packet exception @LBA=
%1").arg(offset)))
{
- sprintf(m_message,"Invalid packet exception @LBA %d", offset);
}
};
=20
@@ -204,18 +202,13 @@
class Writer : public Demuxer
{
public:
- Writer(const TCHAR* filenamePrefix, const TCHAR* extension, double fps)
- :m_file(NULL)
+ Writer(const QString& filenamePrefix, const QString& extension, double =
fps)
+ :m_Filename(filenamePrefix)
+ ,m_fileExtension(extension)
+ ,m_file(NULL)
,m_TimecodeFile(NULL)
,m_fps(fps)
{
-#ifdef UNICODE
- m_Filename =3D QString::fromUtf16(reinterpret_cast<const ushort*>(file=
namePrefix));
- m_fileExtension =3D QString::fromUtf16(reinterpret_cast<const ushort*>=
(extension));
-#else
- m_Filename =3D filenamePrefix;
- m_fileExtension =3D extension;
-#endif
}
=20
virtual ~Writer()
@@ -245,12 +238,11 @@
if (!m_TimecodeFile)
{
QString m_filename =3D QString("%1_%2.tmc").arg(m_Filename).arg(m_fil=
eExtension);
-#ifdef UNICODE
- const wchar_t *name =3D reinterpret_cast<const wchar_t*>(m_filename.u=
tf16());
- m_TimecodeFile =3D _tfopen(name, _T("w"));
-#else
- m_TimecodeFile =3D fopen(qPrintable(m_filename),"w");
-#endif
+ m_TimecodeFile =3D fopen(QFile::encodeName(m_filename),"w");
+ =09
+ if (!m_TimecodeFile)
+ throw VobParserFileOpenException(QFile::encodeName(m_filename));
+ =09
fwrite("# timecode format v3\n", 1, 21, m_TimecodeFile);
fprintf(m_TimecodeFile, "assume %lf\n", m_fps);
}
@@ -262,12 +254,10 @@
if(!m_file)
{
QString m_filename =3D QString("%1.%2").arg(m_Filename).arg(m_fileExt=
ension);
-#ifdef UNICODE
- const wchar_t *name =3D reinterpret_cast<const wchar_t*>(m_filename.u=
tf16());
- m_file =3D _tfopen(name, _T("wb"));
-#else
- m_file =3D fopen(qPrintable(m_filename),"wb");
-#endif
+ m_file =3D fopen(QFile::encodeName(m_filename),"wb");
+
+ if (!m_file)
+ throw VobParserFileOpenException(QFile::encodeName(m_filename));
}
return m_file;
}
@@ -286,8 +276,8 @@
class VideoDemuxWriter : public Writer
{
public:
- VideoDemuxWriter(const TCHAR* filenamePrefix, double fps)
- :Writer(filenamePrefix, _T("m2v"), fps)=20
+ VideoDemuxWriter(const QString& filenamePrefix, double fps)
+ :Writer(filenamePrefix, "m2v", fps)=20
,m_end_timecode(0)
,m_last_start_timecode(0)
,m_last_end_timecode(0)
@@ -313,8 +303,8 @@
class AC3DemuxWriter : public Writer
{
public:
- AC3DemuxWriter(const TCHAR* filenamePrefix, const uint8_t streamID)
- :Writer(filenamePrefix, _T("ac3"), 0.0)
+ AC3DemuxWriter(const QString& filenamePrefix, const uint8_t streamID)
+ :Writer(filenamePrefix, "ac3", 0.0)
,m_streamID(streamID)
,m_end_timecode(0)
,m_last_start_timecode(0)
@@ -341,8 +331,8 @@
class DTSDemuxWriter : public Writer
{
public:
- DTSDemuxWriter(const TCHAR* filenamePrefix, const uint8_t streamID)
- :Writer(filenamePrefix, _T("dts"),0.0)
+ DTSDemuxWriter(const QString& filenamePrefix, const uint8_t streamID)
+ :Writer(filenamePrefix, "dts",0.0)
,m_streamID(streamID)
,m_end_timecode(0)
,m_last_start_timecode(0)
@@ -369,8 +359,8 @@
class WavWriter : public Writer
{
public:
- WavWriter(const TCHAR* filenamePrefix, double fps, uint32_t sample_rat=
e, uint8_t bit_depth, uint8_t channel_nb)
- :Writer(filenamePrefix, _T("wav"), fps)
+ WavWriter(const QString& filenamePrefix, double fps, uint32_t sample_r=
ate, uint8_t bit_depth, uint8_t channel_nb)
+ :Writer(filenamePrefix, "wav", fps)
,m_sample_rate(sample_rate)
,m_bit_depth(bit_depth)
,m_channel_nb(channel_nb)
@@ -386,7 +376,7 @@
class LPCMDemuxWriter : public WavWriter
{
public:
- LPCMDemuxWriter(const TCHAR* filenamePrefix, const uint8_t streamID, ui=
nt32_t sample_rate, uint8_t bit_depth, uint8_t channel_nb)
+ LPCMDemuxWriter(const QString& filenamePrefix, const uint8_t streamID, =
uint32_t sample_rate, uint8_t bit_depth, uint8_t channel_nb)
:WavWriter(filenamePrefix,0.0, sample_rate, bit_depth, channel_nb)
,m_streamID(streamID)
,m_end_timecode(0)
@@ -414,8 +404,8 @@
class MPADemuxWriter : public Writer
{
public:
- MPADemuxWriter(const TCHAR* filenamePrefix, const uint8_t streamID) :
- Writer(filenamePrefix, _T("mpa"),0.0), m_streamID(streamID) {}
+ MPADemuxWriter(const QString& filenamePrefix, const uint8_t streamID) :
+ Writer(filenamePrefix, "mpa",0.0), m_streamID(streamID) {}
void ProcessStream(uint8_t* buff, uint32_t size, uint32_t start_time, u=
int32_t end_time, const QString& debug)
{
Write(buff,size, start_time, end_time, debug);
@@ -432,8 +422,8 @@
class SubDemuxWriter : public Writer
{
public:
- SubDemuxWriter(const TCHAR* filenamePrefix, const uint8_t streamID, uin=
t16_t width, uint16_t height, const uint32_t * palette, uint16_t language=
, bool forced)
- :Writer(filenamePrefix, _T("sub"),0.0)
+ SubDemuxWriter(const QString& filenamePrefix, const uint8_t streamID, u=
int16_t width, uint16_t height, const uint32_t * palette, uint16_t langua=
ge, bool forced)
+ :Writer(filenamePrefix, "sub",0.0)
,m_width(width)
,m_height(height)
,m_forced(forced)
@@ -464,8 +454,8 @@
class BtnDemuxWriter : public Writer
{
public:
- BtnDemuxWriter(const TCHAR* filenamePrefix, uint16_t width, uint16_t he=
ight)
- :Writer(filenamePrefix, _T("btn"),0.0)
+ BtnDemuxWriter(const QString& filenamePrefix, uint16_t width, uint16_t =
height)
+ :Writer(filenamePrefix, "btn",0.0)
,m_width(width)
,m_height(height)
,m_end_timecode(0)
More information about the Matroska-cvs
mailing list