Remove all things Quicktime (#393)
This commit is contained in:
parent
a922f46562
commit
a599d98bca
|
@ -139,18 +139,10 @@ If a previous binary of OpenToonz was already installed, this step and the follo
|
|||
1. In the Solution Explorer, select the OpenToonz project within the OpenToonz solution.
|
||||
2. In the Project menu, choose Set as StartUp Project.
|
||||
|
||||
## Creating the Files for the `srv` Folder
|
||||
OpenToonz utilizes the QuickTime SDK's `mov` and associated file formats. Since the QuickTime SDK only comes in 32-bit versions, the 32-bit file `t32bitsrv.exe` from the QuickTime SDK is used in both the 64-bit and 32-bit versions of OpenToonz. As a result, the following instructions apply to both the 32 and 64-bit versions of OpenToonz.
|
||||
|
||||
### Qt
|
||||
- https://www.qt.io/download-open-source/
|
||||
- Install Qt 5.9 (32-bit version) by the by [Qt Online Installer for Windows](http://download.qt.io/official_releases/online_installers/qt-unified-windows-x86-online.exe).
|
||||
|
||||
### QuickTime SDK
|
||||
1. Sign in using your Apple developer ID and download `QuickTime 7.3 SDK for Windows.zip` from the following url.
|
||||
- https://developer.apple.com/downloads/?q=quicktime
|
||||
2. After installing the QuickTime SDK, copy the contents of `C:\Program Files (x86)\QuickTime SDK` to `$opentoonz/thirdparty/quicktime/QT73SDK`
|
||||
|
||||
### Using CMake to Create a Visual Studio 32-bit Project
|
||||
- Follow the same instructions as for the 64-bit version, but change the following:
|
||||
- `$opentoonz/toonz/build` to `$opentoonz/toonz/build32`
|
||||
|
@ -163,7 +155,6 @@ OpenToonz utilizes the QuickTime SDK's `mov` and associated file formats. Since
|
|||
### Layout of the `srv` Folder
|
||||
- For the 64-bit version, copy the following files to the `srv` folder:
|
||||
- From `$opentoonz/toonz/build32/Release`
|
||||
- t32bitsrv.exe
|
||||
- image.dll
|
||||
- tnzcore.dll
|
||||
- From the 32-bit version of Qt
|
||||
|
|
|
@ -96,18 +96,10 @@ CMake上で、`WITH_STOPMOTION` オプションをONにします。CMake上、
|
|||
### 実行
|
||||
OpenToonz.exe を実行して動作すれば成功です。おめでとうございます。
|
||||
|
||||
## `srv` フォルダ内のファイルの生成
|
||||
OpenToonz は QuickTime SDK を用いて mov 形式などへ対応しています。 QuickTime SDK は 32 ビット版しかないため、 `t32bitsrv.exe` という 32 ビット版の実行可能ファイルにQuickTime SDKを組み込み、64ビット版の OpenToonz は `t32bitsrv.exe` を経由して QuickTime SDK の機能を使用しています。以下の手順では `t32bitsrv.exe` などと合わせて、 32 ビット版の OpenToonz も生成されます。
|
||||
|
||||
### Qt
|
||||
- https://www.qt.io/download-open-source/
|
||||
- 64 ビット版と同じインストーラーで Qt 5.9 (32 ビット版) を適当なフォルダにインストールします
|
||||
|
||||
### QuickTime SDK
|
||||
1. Apple の開発者登録をして下記のURLから `QuickTime 7.3 SDK for Windows.zip` をダウンロードします
|
||||
- https://developer.apple.com/downloads/?q=quicktime
|
||||
2. QuickTime SDK をインストールして、 `C:\Program Files (x86)\QuickTime SDK` の中身を `thirdparty/quicktime/QT73SDK` の中にコピーします
|
||||
|
||||
### CMake で Visual Studio の 32 ビット版のプロジェクトを生成する
|
||||
- 64 ビット版と同様の手順で、次のようにフォルダ名とターゲットを読み替えます
|
||||
- `$opentoonz/toonz/build` → `$opentoonz/toonz/build32`
|
||||
|
@ -120,7 +112,6 @@ OpenToonz は QuickTime SDK を用いて mov 形式などへ対応していま
|
|||
### `srv` フォルダの配置
|
||||
- 64 ビット版の `srv` フォルダの中に下記のファイルをコピーします
|
||||
- `$opentoonz/toonz/build32/Release` から
|
||||
- t32bitsrv.exe
|
||||
- image.dll
|
||||
- tnzcore.dll
|
||||
- Qt の 32ビット版のインストール先から
|
||||
|
|
2
thirdparty/quicktime/QT73SDK/.gitignore
vendored
2
thirdparty/quicktime/QT73SDK/.gitignore
vendored
|
@ -1,2 +0,0 @@
|
|||
*
|
||||
!.gitignore
|
1
thirdparty/quicktime/copy_QT73SDK.txt
vendored
1
thirdparty/quicktime/copy_QT73SDK.txt
vendored
|
@ -1 +0,0 @@
|
|||
Copy folders in 'C:\Program Files (x86)\QuickTime SDK' to QT73SDK
|
|
@ -37,10 +37,6 @@ cp -RH $BINROOT/bin/tfarmcontroller.app/Contents/MacOS/tfarmcontroller $BINROOT/
|
|||
echo ' Copy converter...'
|
||||
cp -RH $BINROOT/bin/tconverter.app/Contents/MacOS/tconverter $BINROOT/bin/Toonz\ 7.1.app/Contents/MacOS/
|
||||
|
||||
echo ' Copy t32bitsrv...'
|
||||
lipo -remove x86_64 $BINROOT/bin/t32bitsrv.app/Contents/MacOS/t32bitsrv -output $BINROOT/bin/t32bitsrv.app/Contents/MacOS/t32bitsrv
|
||||
cp -RH $BINROOT/bin/t32bitsrv.app/Contents/MacOS/t32bitsrv $BINROOT/bin/Toonz\ 7.1.app/Contents/MacOS/
|
||||
|
||||
echo ' Copy QTCore 4.8 Frameworks...'
|
||||
mkdir -p $BINROOT/bin/Toonz\ 7.1.app/Contents/Frameworks/QtCore.framework/Versions/4
|
||||
cp /Library/Frameworks/QtCore.framework/Versions/4/QtCore $BINROOT/bin/Toonz\ 7.1.app/Contents/Frameworks/QtCore.framework/Versions/4/
|
||||
|
|
|
@ -331,33 +331,23 @@ install_name_tool -change /usr/local/Trolltech/Qt-4.8.0/lib/QtOpenGL.framework/V
|
|||
install_name_tool -id @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork $BINROOT/bin/Toonz\ 7.1.app/Contents/Frameworks/QtNetwork.framework/Versions/4/QtNetwork
|
||||
install_name_tool -change /usr/local/Trolltech/Qt-4.8.0/lib/QtNetwork.framework/Versions/4/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork $BINROOT/bin/Toonz\ 7.1.app/Contents/MacOS/tcomposer
|
||||
|
||||
# modifico le liblrerie in t32bitsrv
|
||||
|
||||
#tnzcore
|
||||
|
||||
install_name_tool -id @executable_path/../Frameworks/libtnzcore.1.dylib $BINROOT/bin/Toonz\ 7.1.app/Contents/Frameworks/libtnzcore.1.dylib
|
||||
install_name_tool -change libtnzcore.1.dylib @executable_path/../Frameworks/libtnzcore.1.dylib $BINROOT/bin/Toonz\ 7.1.app/Contents/MacOS/t32bitsrv
|
||||
|
||||
|
||||
# image
|
||||
|
||||
install_name_tool -id @executable_path/../Frameworks/libimage.1.dylib $BINROOT/bin/Toonz\ 7.1.app/Contents/Frameworks/libimage.1.dylib
|
||||
install_name_tool -change libimage.1.dylib @executable_path/../Frameworks/libimage.1.dylib $BINROOT/bin/Toonz\ 7.1.app/Contents/MacOS/t32bitsrv
|
||||
|
||||
|
||||
# Qt
|
||||
|
||||
install_name_tool -id @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore $BINROOT/bin/Toonz\ 7.1.app/Contents/Frameworks/QtCore.framework/Versions/4/QtCore
|
||||
install_name_tool -change /usr/local/Trolltech/Qt-4.8.0/lib/QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore $BINROOT/bin/Toonz\ 7.1.app/Contents/MacOS/t32bitsrv
|
||||
|
||||
install_name_tool -id @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui $BINROOT/bin/Toonz\ 7.1.app/Contents/Frameworks/QtGui.framework/Versions/4/QtGui
|
||||
install_name_tool -change /usr/local/Trolltech/Qt-4.8.0/lib/QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui $BINROOT/bin/Toonz\ 7.1.app/Contents/MacOS/t32bitsrv
|
||||
|
||||
|
||||
install_name_tool -id @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork $BINROOT/bin/Toonz\ 7.1.app/Contents/Frameworks/QtNetwork.framework/Versions/4/QtNetwork
|
||||
install_name_tool -change /usr/local/Trolltech/Qt-4.8.0/lib/QtNetwork.framework/Versions/4/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork $BINROOT/bin/Toonz\ 7.1.app/Contents/MacOS/t32bitsrv
|
||||
|
||||
|
||||
|
||||
|
||||
# modifico le liblrerie in tcleanup
|
||||
|
|
|
@ -368,9 +368,6 @@ if(BUILD_ENV_MSVC)
|
|||
set(CANON_LIB ${SDKROOT}/canon/library/EDSDK.lib)
|
||||
endif()
|
||||
endif()
|
||||
if(PLATFORM EQUAL 32)
|
||||
set(QT_LIB ${SDKROOT}/quicktime/QT73SDK/Libraries/QTMLClient.lib)
|
||||
endif()
|
||||
set(MYPAINT_LIB_INCLUDE_DIRS ${SDKROOT}/libmypaint/dist/${PLATFORM}/include/libmypaint)
|
||||
set(MYPAINT_LIB_LDFLAGS ${SDKROOT}/libmypaint/dist/${PLATFORM}/libmypaint.lib)
|
||||
elseif(BUILD_ENV_APPLE)
|
||||
|
@ -409,9 +406,6 @@ elseif(BUILD_ENV_APPLE)
|
|||
endif()
|
||||
|
||||
set(OPENBLAS_LIB) # unused?
|
||||
if(PLATFORM EQUAL 32)
|
||||
find_library(QT_LIB QuickTime)
|
||||
endif()
|
||||
|
||||
set(JPEG_LIB ${JPEG_LIBRARY})
|
||||
set(LZ4_LIB ${LZ4_LIB_LDFLAGS})
|
||||
|
@ -641,10 +635,6 @@ if(BUILD_ENV_APPLE)
|
|||
add_subdirectory(mousedragfilter)
|
||||
endif()
|
||||
|
||||
if((PLATFORM EQUAL 32) AND ((BUILD_TARGET_WIN AND BUILD_ENV_MSVC) OR BUILD_TARGET_APPLE))
|
||||
add_subdirectory(t32bitsrv)
|
||||
endif()
|
||||
|
||||
if(BUILD_ENV_APPLE)
|
||||
add_custom_command(TARGET executable
|
||||
POST_BUILD COMMAND
|
||||
|
|
|
@ -1,470 +0,0 @@
|
|||
|
||||
|
||||
#include "texception.h"
|
||||
#include "tpropertytype.h"
|
||||
//#include "timageinfo.h"
|
||||
//#include "tlevel_io.h"
|
||||
#include "tproperty.h"
|
||||
#include "tiio.h"
|
||||
|
||||
#if !defined(x64) && !defined(__LP64__) && !defined(LINUX) && !(defined(__GNUC__) && defined(_WIN32))
|
||||
|
||||
//*******************************************************************************
|
||||
// 32-bit version
|
||||
//*******************************************************************************
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable : 4996)
|
||||
#endif
|
||||
|
||||
#define list QuickTime_list
|
||||
#define map QuickTime_map
|
||||
#define iterator QuickTime_iterator
|
||||
#define float_t QuickTime_float_t
|
||||
#define GetProcessInformation QuickTime_GetProcessInformation
|
||||
#define int_fast8_t QuickTime_int_fast8_t
|
||||
#define int_fast16_t QuickTime_int_fast16_t
|
||||
#define uint_fast16_t QuickTime_uint_fast16_t
|
||||
|
||||
#include "QTML.h"
|
||||
#include "Movies.h"
|
||||
#include "Script.h"
|
||||
#include "FixMath.h"
|
||||
#include "Sound.h"
|
||||
|
||||
#include "QuickTimeComponents.h"
|
||||
#include "tquicktime.h"
|
||||
|
||||
#undef list
|
||||
#undef map
|
||||
#undef iterator
|
||||
#undef float_t
|
||||
#undef GetProcessInformation
|
||||
#undef int_fast8_t
|
||||
#undef int_fast16_t
|
||||
#undef uint_fast16_t
|
||||
|
||||
#else
|
||||
|
||||
#define list List
|
||||
#define map Map
|
||||
#define iterator Iterator
|
||||
#define float_t Float_t
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <QuickTime/Movies.h>
|
||||
#include <QuickTime/ImageCompression.h>
|
||||
#include <QuickTime/QuickTimeComponents.h>
|
||||
|
||||
#undef list
|
||||
#undef map
|
||||
#undef iterator
|
||||
#undef float_t
|
||||
|
||||
#endif
|
||||
/*
|
||||
questo file gestisce il salvataggio in un .tnz e il caricamento dei setting dei
|
||||
mov.
|
||||
viene usato il popup fornito da quicktime, con tutti i suoi setting e i sotto
|
||||
settings.
|
||||
i setting sono memorizzati da quicktime in un componentInstance. Da qui, possono
|
||||
essere convertiti in un atomContainer,
|
||||
che e' una struttura simile alla nostra propertyGroup, ma con gli atomi
|
||||
strutturati ad albero.
|
||||
sono state scritte due funzioni di conversione da atomContainer a propertygroup
|
||||
e viceversa
|
||||
ogni atom ha un type, id, e numero figli. se numero figli=0 allora l'atomo e'una
|
||||
foglia,
|
||||
e quindi ha un buffer di dati di valori char.
|
||||
|
||||
ogni atomo viene trasformato in una stringProperty. il nome della stringProperty
|
||||
e'
|
||||
"type id numeroFigli"
|
||||
se numerofigli>0, allora la stringProperty ha un valore nullo, e le prossime
|
||||
numerofigli property contengono i figli;
|
||||
se numerofigli==0, allora il valore della property contiene il buffer di dati,
|
||||
convertito in stringa.
|
||||
ecco coem viene convertito il buffer in stringa:
|
||||
se ad esempio il buffer e' composto di 3 bytes, buf[0] = 13 buf[1]=0 buf[2]=231
|
||||
allora la strnga valore sara' "13 0 231"
|
||||
se ci sono piu 0 consecutivi, vengono memorizzati per salvare spazio come "z
|
||||
count" in cui count e' il numero di 0.
|
||||
esempio: buf[0] = 13 buf[1]=0 buf[2]=0 buf[3]=0 buf[4]=0 buf5]=231
|
||||
allora str = "13 z 4 231"
|
||||
*/
|
||||
|
||||
#include "movsettings.h"
|
||||
|
||||
//------------------------------------------------
|
||||
|
||||
void visitAtoms(const QTAtomContainer &atoms, const QTAtom &parent,
|
||||
TPropertyGroup &pg) {
|
||||
QTAtom curr = 0;
|
||||
|
||||
do {
|
||||
if (QTNextChildAnyType(atoms, parent, curr, &curr) != noErr) assert(false);
|
||||
|
||||
if (curr == 0) break;
|
||||
QTAtomType atomType;
|
||||
QTAtomID id;
|
||||
|
||||
QTGetAtomTypeAndID(atoms, curr, &atomType, &id);
|
||||
int sonCount = QTCountChildrenOfType(atoms, curr, 0);
|
||||
|
||||
char buffer[1024];
|
||||
snprintf(buffer, sizeof(buffer), "%d %d %d",
|
||||
(int)atomType, (int)id, sonCount);
|
||||
string str(buffer);
|
||||
|
||||
if (sonCount > 0) {
|
||||
pg.add(new TStringProperty(str, TString()));
|
||||
visitAtoms(atoms, curr, pg);
|
||||
}
|
||||
|
||||
else {
|
||||
long size;
|
||||
UCHAR *atomData;
|
||||
if (QTGetAtomDataPtr(atoms, curr, &size, (char **)&atomData) != noErr)
|
||||
assert(false);
|
||||
|
||||
string strapp;
|
||||
for (int i = 0; i < size; i++) {
|
||||
string num;
|
||||
if (atomData[i] == 0) {
|
||||
int count = 1;
|
||||
while ((i + 1) < size && atomData[i + 1] == 0) i++, count++;
|
||||
if (count > 1) {
|
||||
num = std::to_string(count);
|
||||
strapp = strapp + "z " + num + " ";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
num = std::to_string(atomData[i]);
|
||||
|
||||
strapp = strapp + string(num) + " ";
|
||||
}
|
||||
|
||||
// unsigned short*buffer = new unsigned short[size];
|
||||
// buffer[size]=0;
|
||||
// for (i=0; i<size; i++)
|
||||
// buffer[i] = atomData[i]+1;
|
||||
|
||||
wstring data = ::to_wstring(strapp);
|
||||
|
||||
pg.add(new TStringProperty(str, data));
|
||||
}
|
||||
} while (curr != 0);
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
namespace {
|
||||
void compareAtoms(const QTAtomContainer &atoms1, QTAtom parent1,
|
||||
const QTAtomContainer &atoms2, QTAtom parent2) {
|
||||
QTAtom curr1 = 0, curr2 = 0;
|
||||
|
||||
assert(QTCountChildrenOfType(atoms1, parent1, 0) ==
|
||||
QTCountChildrenOfType(atoms2, parent2, 0));
|
||||
|
||||
do {
|
||||
if (QTNextChildAnyType(atoms1, parent1, curr1, &curr1) != noErr)
|
||||
assert(false);
|
||||
|
||||
if (QTNextChildAnyType(atoms2, parent2, curr2, &curr2) != noErr)
|
||||
assert(false);
|
||||
assert((curr1 != 0 && curr2 != 0) || (curr1 == 0 && curr2 == 0));
|
||||
|
||||
if (curr1 == 0 || curr2 == 0) break;
|
||||
|
||||
QTAtomType atomType1, atomType2;
|
||||
QTAtomID id1, id2;
|
||||
|
||||
QTGetAtomTypeAndID(atoms1, curr1, &atomType1, &id1);
|
||||
QTGetAtomTypeAndID(atoms2, curr2, &atomType2, &id2);
|
||||
assert(atomType1 == atomType2);
|
||||
|
||||
int sonCount1 = QTCountChildrenOfType(atoms1, curr1, 0);
|
||||
int sonCount2 = QTCountChildrenOfType(atoms2, curr2, 0);
|
||||
assert(sonCount1 == sonCount2);
|
||||
if (sonCount1 > 0)
|
||||
compareAtoms(atoms1, curr1, atoms2, curr2);
|
||||
else {
|
||||
long size1;
|
||||
UCHAR *atomData1;
|
||||
long size2;
|
||||
UCHAR *atomData2;
|
||||
if (QTGetAtomDataPtr(atoms1, curr1, &size1, (char **)&atomData1) != noErr)
|
||||
assert(false);
|
||||
if (QTGetAtomDataPtr(atoms2, curr2, &size2, (char **)&atomData2) != noErr)
|
||||
assert(false);
|
||||
assert(size1 == size2);
|
||||
for (int i = 0; i < size1; i++) assert(atomData1[i] == atomData2[i]);
|
||||
}
|
||||
} while (curr1 != 0 && curr2 != 0);
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
|
||||
void fromAtomsToProperties(const QTAtomContainer &atoms, TPropertyGroup &pg) {
|
||||
pg.clear();
|
||||
visitAtoms(atoms, kParentAtomIsContainer, pg);
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
void visitprops(TPropertyGroup &pg, int &index, QTAtomContainer &atoms,
|
||||
QTAtom parent) {
|
||||
int count = pg.getPropertyCount();
|
||||
while (index < count) {
|
||||
TStringProperty *p = (TStringProperty *)pg.getProperty(index++);
|
||||
string str0 = p->getName();
|
||||
const char *buf = str0.c_str();
|
||||
int atomType, id, sonCount;
|
||||
sscanf(buf, "%d %d %d", &atomType, &id, &sonCount);
|
||||
QTAtom newAtom;
|
||||
if (sonCount == 0) {
|
||||
wstring appow = p->getValue();
|
||||
string appo = ::to_string(appow);
|
||||
const char *str = appo.c_str();
|
||||
|
||||
vector<UCHAR> buf;
|
||||
while (strlen(str) > 0) {
|
||||
if (str[0] == 'z') {
|
||||
int count = atoi(str + 1);
|
||||
str += (count < 10) ? 4 : ((count < 100) ? 5 : 6);
|
||||
while (count--) buf.push_back(0);
|
||||
} else {
|
||||
int val = atoi(str);
|
||||
assert(val >= 0 && val < 256);
|
||||
|
||||
str += (val < 10) ? 2 : ((val < 100) ? 3 : 4);
|
||||
buf.push_back(val);
|
||||
}
|
||||
}
|
||||
// const unsigned short*bufs = str1.c_str();
|
||||
// UCHAR *bufc = new UCHAR[size];
|
||||
// for (int i=0; i<size; i++)
|
||||
// {
|
||||
// assert(bufs[i]<257);
|
||||
// bufc[i] = (UCHAR)(bufs[i]-1);
|
||||
// }
|
||||
void *ptr = 0;
|
||||
if (buf.size() != 0) {
|
||||
ptr = &(buf[0]);
|
||||
}
|
||||
QTInsertChild(atoms, parent, (QTAtomType)atomType, (QTAtomID)id, 0,
|
||||
buf.size(), (void *)ptr, 0);
|
||||
} else {
|
||||
QTInsertChild(atoms, parent, (QTAtomType)atomType, (QTAtomID)id, 0, 0, 0,
|
||||
&newAtom);
|
||||
visitprops(pg, index, atoms, newAtom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
|
||||
void fromPropertiesToAtoms(TPropertyGroup &pg, QTAtomContainer &atoms) {
|
||||
int index = 0;
|
||||
visitprops(pg, index, atoms, kParentAtomIsContainer);
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
/*
|
||||
#ifdef MACOSX
|
||||
|
||||
SCExtendedProcs gProcStruct, ptr;
|
||||
|
||||
static Boolean QTCmpr_FilterProc
|
||||
(DialogPtr theDialog, EventRecord *theEvent,
|
||||
short *theItemHit, long theRefCon)
|
||||
{
|
||||
#pragma unused(theItemHit, theRefCon)
|
||||
Boolean myEventHandled = false;
|
||||
WindowRef myEventWindow = NULL;
|
||||
WindowRef myDialogWindow = NULL;
|
||||
|
||||
myDialogWindow = GetDialogWindow(theDialog);
|
||||
|
||||
switch (theEvent->what) {
|
||||
case updateEvt:
|
||||
myEventWindow = (WindowRef)theEvent->message;
|
||||
// Change the window class
|
||||
HIWindowChangeClass(myEventWindow,kUtilityWindowClass);
|
||||
// Activate the window scope
|
||||
SetWindowActivationScope(myEventWindow,kWindowActivationScopeAll);
|
||||
// Set the brushed metal theme on the window
|
||||
SetThemeWindowBackground(myEventWindow,kThemeBrushUtilityWindowBackgroundActive,true);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return(myEventHandled);
|
||||
}
|
||||
|
||||
#endif
|
||||
*/
|
||||
//------------------------------------------------
|
||||
|
||||
void openMovSettingsPopup(TPropertyGroup *props, bool macBringToFront) {
|
||||
#ifdef _WIN32
|
||||
if (InitializeQTML(0) != noErr) return;
|
||||
#endif
|
||||
|
||||
ComponentInstance ci =
|
||||
OpenDefaultComponent(StandardCompressionType, StandardCompressionSubType);
|
||||
|
||||
QTAtomContainer atoms;
|
||||
QTNewAtomContainer(&atoms);
|
||||
|
||||
fromPropertiesToAtoms(*props, atoms);
|
||||
|
||||
ComponentResult err;
|
||||
|
||||
if ((err = SCSetSettingsFromAtomContainer(ci, atoms)) != noErr) {
|
||||
CloseComponent(ci);
|
||||
ci = OpenDefaultComponent(StandardCompressionType,
|
||||
StandardCompressionSubType);
|
||||
assert(false);
|
||||
}
|
||||
|
||||
QTDisposeAtomContainer(atoms);
|
||||
|
||||
#ifdef MACOSX
|
||||
|
||||
// Install an external procedure to use a callback filter on the request
|
||||
// settings dialog
|
||||
// On MACOSX we need to change the dialog appearance in order to pop-up in front
|
||||
// of the
|
||||
// toonz main window.
|
||||
/*
|
||||
gProcStruct.filterProc = NewSCModalFilterUPP(QTCmpr_FilterProc);
|
||||
// I don't install any hook
|
||||
gProcStruct.hookProc = NULL;
|
||||
gProcStruct.customName[0] = 0;
|
||||
// I don't use refcon
|
||||
gProcStruct.refcon = 0;
|
||||
|
||||
// set the current extended procs
|
||||
SCSetInfo(ci, scExtendedProcsType, &gProcStruct);
|
||||
*/
|
||||
#endif
|
||||
|
||||
err = SCRequestSequenceSettings(ci);
|
||||
// assert(err==noErr);
|
||||
QTAtomContainer atomsOut;
|
||||
|
||||
if (SCGetSettingsAsAtomContainer(ci, &atomsOut) != noErr) assert(false);
|
||||
|
||||
fromAtomsToProperties(atomsOut, *props);
|
||||
|
||||
QTDisposeAtomContainer(atomsOut);
|
||||
CloseComponent(ci);
|
||||
|
||||
// int dataSize=0, numChildren = 0, numLevels=0;
|
||||
// retrieveData(settings, kParentAtomIsContainer, dataSize, numChildren,
|
||||
// numLevels);
|
||||
}
|
||||
|
||||
bool Tiio::isQuicktimeInstalled() {
|
||||
#ifdef MACOSX
|
||||
return true;
|
||||
#else
|
||||
|
||||
static int ret = -1;
|
||||
if (ret == -1) ret = (InitializeQTML(0) == noErr) ? 1 : 0;
|
||||
|
||||
return (ret == 1);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#else // x64
|
||||
|
||||
//*******************************************************************************
|
||||
// 64-bit proxied version
|
||||
//*******************************************************************************
|
||||
|
||||
// Toonz includes
|
||||
#include "tfilepath.h"
|
||||
#include "tstream.h"
|
||||
|
||||
// tipc includes
|
||||
#include "tipc.h"
|
||||
#include "t32bitsrv_wrap.h"
|
||||
|
||||
// MAC-Specific includes
|
||||
#ifdef MACOSX
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
#endif
|
||||
|
||||
#include "movsettings.h"
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
// Using 32-bit background server correspondence to achieve the same result
|
||||
void openMovSettingsPopup(TPropertyGroup *props, bool unused) {
|
||||
QLocalSocket socket;
|
||||
if (!tipc::startSlaveConnection(&socket, t32bitsrv::srvName(), 3000,
|
||||
t32bitsrv::srvCmdline(), "_main"))
|
||||
return;
|
||||
|
||||
// Send the appropriate commands to the server
|
||||
tipc::Stream stream(&socket);
|
||||
tipc::Message msg;
|
||||
|
||||
// We'll communicate through temporary files.
|
||||
stream << (msg << QString("$tmpfile_request") << QString("openMovSets"));
|
||||
QString res(tipc::readMessage(stream, msg));
|
||||
|
||||
QString fp;
|
||||
msg >> fp;
|
||||
assert(res == "ok" && !fp.isEmpty());
|
||||
|
||||
TFilePath tfp(fp.toStdWString());
|
||||
{
|
||||
// Save the input props to the temporary file
|
||||
TOStream os(tfp);
|
||||
props->saveData(os);
|
||||
}
|
||||
|
||||
// Invoke the settings popup
|
||||
stream << (msg << tipc::clr << QString("$openMovSettingsPopup") << fp);
|
||||
res =
|
||||
tipc::readMessageNB(stream, msg, -1, QEventLoop::ExcludeUserInputEvents);
|
||||
assert(res == "ok");
|
||||
|
||||
#ifdef MACOSX
|
||||
|
||||
// Bring this application back to front
|
||||
ProcessSerialNumber psn = {0, kCurrentProcess};
|
||||
SetFrontProcess(&psn);
|
||||
|
||||
#endif // MACOSX
|
||||
|
||||
props->clear();
|
||||
{
|
||||
// Save the input props to the temporary file
|
||||
TIStream is(tfp);
|
||||
props->loadData(is);
|
||||
}
|
||||
|
||||
// Release the temporary file
|
||||
stream << (msg << tipc::clr << QString("$tmpfile_release")
|
||||
<< QString("openMovSets"));
|
||||
res = tipc::readMessage(stream, msg);
|
||||
assert(res == "ok");
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
bool Tiio::isQuicktimeInstalled() {
|
||||
// NOTE: This is *NOT* the same function as IsQuickTimeInstalled(), which is
|
||||
// implemented locally in the image lib and used there. This function here is
|
||||
// actually NEVER USED throughout Toonz, so we're placing a dummy
|
||||
// implementation here.
|
||||
|
||||
assert(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // else
|
|
@ -1,77 +0,0 @@
|
|||
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
#include "t32bitsrv_wrap.h"
|
||||
|
||||
//================================================================================
|
||||
|
||||
int t32bitsrv::BufferExchanger::read(const char *srcBuf, int len) {
|
||||
m_data = (UCHAR *)memcpy(m_data, srcBuf, len);
|
||||
return len;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
|
||||
int t32bitsrv::BufferExchanger::write(char *dstBuf, int len) {
|
||||
memcpy(dstBuf, m_data, len);
|
||||
m_data += len;
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
|
||||
template <typename PIXEL>
|
||||
int t32bitsrv::RasterExchanger<PIXEL>::read(const char *srcBuf, int len) {
|
||||
if (m_ras->getWrap() == m_ras->getLx()) {
|
||||
memcpy(m_pix, srcBuf, len);
|
||||
m_pix = (PIXEL *)((UCHAR *)m_pix + len);
|
||||
} else {
|
||||
int xStart = (m_pix - m_ras->pixels(0)) % m_ras->getWrap();
|
||||
int remainingData = len;
|
||||
int lineData = m_ras->getLx() * sizeof(PIXEL);
|
||||
int lineDataToRead = std::min(
|
||||
(int)((m_ras->getLx() - xStart) * sizeof(PIXEL)), remainingData);
|
||||
|
||||
for (; remainingData > 0;
|
||||
m_pix += (m_ras->getWrap() - xStart), remainingData -= lineDataToRead,
|
||||
lineDataToRead = std::min(lineData, remainingData), xStart = 0)
|
||||
memcpy(m_pix, srcBuf, lineDataToRead);
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
|
||||
template <typename PIXEL>
|
||||
int t32bitsrv::RasterExchanger<PIXEL>::write(char *dstBuf, int len) {
|
||||
// We pass entire pixels, not just bytes
|
||||
len = len - (len % sizeof(PIXEL));
|
||||
|
||||
if (m_ras->getWrap() == m_ras->getLx()) {
|
||||
memcpy(dstBuf, m_pix, len);
|
||||
m_pix = (PIXEL *)((UCHAR *)m_pix + len);
|
||||
} else {
|
||||
int xStart = (m_pix - m_ras->pixels(0)) % m_ras->getWrap();
|
||||
int remainingData = len;
|
||||
int lineData = m_ras->getLx() * sizeof(PIXEL);
|
||||
int lineDataToWrite = std::min(
|
||||
(int)((m_ras->getLx() - xStart) * sizeof(PIXEL)), remainingData);
|
||||
|
||||
for (; remainingData > 0;
|
||||
m_pix += (m_ras->getWrap() - xStart), remainingData -= lineDataToWrite,
|
||||
lineDataToWrite = std::min(lineData, remainingData), xStart = 0)
|
||||
memcpy(dstBuf, m_pix, lineDataToWrite);
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
|
||||
// Explicit specialization of raster exchangers
|
||||
template class DVAPI t32bitsrv::RasterExchanger<TPixel32>;
|
||||
|
||||
//================================================================================
|
|
@ -1,121 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#ifndef TIIO_3GP_H
|
||||
#define TIIO_3_H
|
||||
|
||||
#if defined(x64) || (defined(__GNUC__) && defined(_WIN32))
|
||||
#include "tiio_3gp_proxy.h"
|
||||
#else
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
namespace QuickTime {
|
||||
#define list List
|
||||
#define map Map
|
||||
#define iterator Iterator
|
||||
#define float_t Float_t
|
||||
#define int_fast8_t QT_int_fast8_t
|
||||
#define int_fast16_t QT_int_fast16_t
|
||||
#define uint_fast16_t QT_uint_fast16_t
|
||||
|
||||
#include "QTML.h"
|
||||
#include "Movies.h"
|
||||
#include "Script.h"
|
||||
#include "FixMath.h"
|
||||
#include "Sound.h"
|
||||
|
||||
#include "QuickTimeComponents.h"
|
||||
#include "tquicktime.h"
|
||||
|
||||
#undef list
|
||||
#undef map
|
||||
#undef iterator
|
||||
#undef float_t
|
||||
#undef QT_int_fast8_t
|
||||
#undef QT_int_fast16_t
|
||||
#undef QT_uint_fast16_t
|
||||
}
|
||||
|
||||
#include "tlevel_io.h"
|
||||
#include "tthreadmessage.h"
|
||||
|
||||
using namespace QuickTime;
|
||||
|
||||
class TImageWriter3gp;
|
||||
class TImageReader3gp;
|
||||
|
||||
bool IsQuickTimeInstalled();
|
||||
|
||||
class TLevelWriter3gp final : public TLevelWriter {
|
||||
public:
|
||||
TLevelWriter3gp(const TFilePath &path, TPropertyGroup *winfo);
|
||||
~TLevelWriter3gp();
|
||||
TImageWriterP getFrameWriter(TFrameId fid) override;
|
||||
|
||||
bool m_initDone;
|
||||
int m_IOError;
|
||||
Handle m_dataRef;
|
||||
Handle m_hMovieData;
|
||||
Handle m_soundDataRef;
|
||||
Handle m_hSoundMovieData;
|
||||
MovieExportComponent m_myExporter;
|
||||
void save(const TImageP &img, int frameIndex);
|
||||
|
||||
private:
|
||||
Movie m_movie;
|
||||
Track m_videoTrack;
|
||||
Media m_videoMedia;
|
||||
GWorldPtr m_gworld;
|
||||
PixMapHandle m_pixmap;
|
||||
short m_refNum;
|
||||
UCHAR m_cancelled;
|
||||
TSoundTrack *m_st;
|
||||
|
||||
PixelXRGB *buf;
|
||||
int buf_lx;
|
||||
int buf_ly;
|
||||
TThread::Mutex m_mutex;
|
||||
|
||||
public:
|
||||
static TLevelWriter *create(const TFilePath &f, TPropertyGroup *winfo) {
|
||||
return new TLevelWriter3gp(f, winfo);
|
||||
};
|
||||
void saveSoundTrack(TSoundTrack *st) override;
|
||||
};
|
||||
|
||||
class TLevelReader3gp final : public TLevelReader {
|
||||
public:
|
||||
TLevelReader3gp(const TFilePath &path);
|
||||
~TLevelReader3gp();
|
||||
TImageReaderP getFrameReader(TFrameId fid) override;
|
||||
// friend class TImageReaderMov;
|
||||
TLevelP loadInfo() override;
|
||||
|
||||
void load(const TRasterP &rasP, int frameIndex, const TPoint &pos,
|
||||
int shrinkX = 1, int shrinkY = 1);
|
||||
TDimension getSize() const { return TDimension(m_lx, m_ly); }
|
||||
TRect getBBox() const { return TRect(0, 0, m_lx - 1, m_ly - 1); }
|
||||
|
||||
int m_IOError;
|
||||
|
||||
private:
|
||||
short m_refNum;
|
||||
Movie m_movie;
|
||||
short m_resId;
|
||||
Track m_track;
|
||||
long m_depth;
|
||||
std::vector<TimeValue> currentTimes;
|
||||
int m_lx, m_ly;
|
||||
|
||||
public:
|
||||
static TLevelReader *create(const TFilePath &f) {
|
||||
return new TLevelReader3gp(f);
|
||||
};
|
||||
TThread::Mutex m_mutex;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#endif //! x64
|
||||
|
||||
#endif // TIIO_MOV_H
|
File diff suppressed because it is too large
Load diff
|
@ -1,121 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#ifndef TIIO_3GP_H
|
||||
#define TIIO_3GP_H
|
||||
|
||||
#ifdef __LP64__
|
||||
#include "tiio_3gp_proxy.h"
|
||||
#else
|
||||
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <QuickTime/Movies.h>
|
||||
#include <QuickTime/ImageCompression.h>
|
||||
#include <QuickTime/QuickTimeComponents.h>
|
||||
|
||||
#include "tquicktime.h"
|
||||
#include "tthreadmessage.h"
|
||||
|
||||
#include "tlevel_io.h"
|
||||
#include "tthread.h"
|
||||
|
||||
class TImageWriter3gp;
|
||||
class TImageReader3gp;
|
||||
|
||||
bool IsQuickTimeInstalled();
|
||||
|
||||
class TLevelWriter3gp : public TLevelWriter {
|
||||
public:
|
||||
TLevelWriter3gp(const TFilePath &path, TPropertyGroup *winfo);
|
||||
~TLevelWriter3gp();
|
||||
TImageWriterP getFrameWriter(TFrameId fid);
|
||||
|
||||
bool m_initDone;
|
||||
int m_IOError;
|
||||
Handle m_dataRef;
|
||||
Handle m_hMovieData;
|
||||
Handle m_soundDataRef;
|
||||
Handle m_hSoundMovieData;
|
||||
MovieExportComponent m_myExporter;
|
||||
|
||||
void save(const TImageP &img, int frameIndex);
|
||||
|
||||
private:
|
||||
Movie m_movie;
|
||||
Track m_videoTrack;
|
||||
Media m_videoMedia;
|
||||
GWorldPtr m_gworld;
|
||||
PixMapHandle m_pixmap;
|
||||
Handle m_compressedData;
|
||||
short m_refNum;
|
||||
UCHAR m_cancelled;
|
||||
|
||||
PixelXRGB *buf;
|
||||
int buf_lx;
|
||||
int buf_ly;
|
||||
TThread::Mutex m_mutex;
|
||||
|
||||
public:
|
||||
static TLevelWriter *create(const TFilePath &f, TPropertyGroup *winfo) {
|
||||
return new TLevelWriter3gp(f, winfo);
|
||||
};
|
||||
void saveSoundTrack(TSoundTrack *st);
|
||||
};
|
||||
|
||||
class TLevelReader3gp : public TLevelReader {
|
||||
public:
|
||||
TLevelReader3gp(const TFilePath &path);
|
||||
~TLevelReader3gp();
|
||||
TImageReaderP getFrameReader(TFrameId fid);
|
||||
// friend class TImageReader3gp;
|
||||
TLevelP loadInfo();
|
||||
|
||||
void load(const TRasterP &rasP, int frameIndex, const TPoint &pos,
|
||||
int shrinkX = 1, int shrinkY = 1);
|
||||
TDimension getSize() const { return TDimension(m_lx, m_ly); }
|
||||
TRect getBBox() const { return TRect(0, 0, m_lx - 1, m_ly - 1); }
|
||||
|
||||
int m_IOError;
|
||||
|
||||
private:
|
||||
short m_refNum;
|
||||
Movie m_movie;
|
||||
short m_resId;
|
||||
Track m_track;
|
||||
long m_depth;
|
||||
vector<TimeValue> currentTimes;
|
||||
int m_lx, m_ly;
|
||||
|
||||
public:
|
||||
static TLevelReader *create(const TFilePath &f) {
|
||||
return new TLevelReader3gp(f);
|
||||
};
|
||||
TThread::Mutex m_mutex;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
class TWriterInfo3gp : public TWriterInfo {
|
||||
friend class TLevelWriter3gp;
|
||||
public:
|
||||
static TWriterInfo *create(const string &ext);
|
||||
~TWriterInfo3gp();
|
||||
TWriterInfo *clone() const;
|
||||
private:
|
||||
TWriterInfo3gp();
|
||||
|
||||
|
||||
TWriterInfo3gp(const TWriterInfo3gp&);
|
||||
|
||||
TWriterInfo3gp&operator=(const TWriterInfo3gp&); // not implemented
|
||||
|
||||
typedef map<int, CodecQ> CodecTable;
|
||||
typedef map<int, CodecType> QualityTable;
|
||||
CodecTable m_codecTable;
|
||||
QualityTable m_qualityTable;
|
||||
};
|
||||
*/
|
||||
|
||||
#endif //!__LP64__
|
||||
|
||||
#endif // TIIO_3gp_H
|
File diff suppressed because it is too large
Load diff
|
@ -1,436 +0,0 @@
|
|||
|
||||
|
||||
#if defined(x64) || defined(__LP64__) || defined(LINUX) || (defined(_WIN32) && defined(__GNUC__))
|
||||
|
||||
// Toonz includes
|
||||
#include "tfilepath.h"
|
||||
#include "trasterimage.h"
|
||||
#include "tstream.h"
|
||||
#include "timageinfo.h"
|
||||
#include "trop.h"
|
||||
#include "tsound.h"
|
||||
#include "tmsgcore.h"
|
||||
|
||||
// tipc includes
|
||||
#include "tipc.h"
|
||||
#include "t32bitsrv_wrap.h"
|
||||
|
||||
// Qt includes
|
||||
#include <QSharedMemory>
|
||||
#include <QMutexLocker>
|
||||
#include <QDataStream>
|
||||
|
||||
#include "tiio_3gp_proxy.h"
|
||||
|
||||
/*
|
||||
For a list of supported commands through the 32-bit background server,
|
||||
see the related "t32libserver" project.
|
||||
*/
|
||||
|
||||
//******************************************************************************
|
||||
// Generic stuff implementation
|
||||
//******************************************************************************
|
||||
|
||||
/*NOT PRESENT: Inherits the MOV stuff*/
|
||||
|
||||
//******************************************************************************
|
||||
// TImageWriter3gp Proxy implementation
|
||||
//******************************************************************************
|
||||
|
||||
class TImageWriter3gpProxy final : public TImageWriter {
|
||||
TLevelWriter3gp *m_lw;
|
||||
|
||||
public:
|
||||
int m_frameIndex;
|
||||
|
||||
public:
|
||||
TImageWriter3gpProxy(const TFilePath &fp, int frameIndex,
|
||||
TLevelWriter3gp *lw);
|
||||
~TImageWriter3gpProxy();
|
||||
|
||||
bool is64bitOutputSupported() { return false; }
|
||||
void save(const TImageP &);
|
||||
|
||||
private:
|
||||
// not implemented
|
||||
TImageWriter3gpProxy(const TImageWriter3gpProxy &);
|
||||
TImageWriter3gpProxy &operator=(const TImageWriter3gpProxy &src);
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
TImageWriter3gpProxy::TImageWriter3gpProxy(const TFilePath &fp, int frameIndex,
|
||||
TLevelWriter3gp *lw)
|
||||
: TImageWriter(fp), m_lw(lw), m_frameIndex(frameIndex) {
|
||||
m_lw->addRef();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
TImageWriter3gpProxy::~TImageWriter3gpProxy() { m_lw->release(); }
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void TImageWriter3gpProxy::save(const TImageP &img) {
|
||||
m_lw->save(img, m_frameIndex);
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
// TLevelWriter3gp Proxy implementation
|
||||
//******************************************************************************
|
||||
|
||||
TLevelWriter3gp::TLevelWriter3gp(const TFilePath &path, TPropertyGroup *winfo)
|
||||
: TLevelWriter(path, winfo) {
|
||||
static TAtomicVar count;
|
||||
unsigned int currCount = ++count;
|
||||
m_id = currCount;
|
||||
|
||||
QLocalSocket socket;
|
||||
tipc::startSlaveConnection(&socket, t32bitsrv::srvName(), -1,
|
||||
t32bitsrv::srvCmdline());
|
||||
|
||||
tipc::Stream stream(&socket);
|
||||
tipc::Message msg;
|
||||
|
||||
QString res, propsFp;
|
||||
if (winfo) {
|
||||
// Request a temporary file to store the infos to
|
||||
stream << (msg << QString("$tmpfile_request")
|
||||
<< QString("initLW3") + QString::number(currCount));
|
||||
if (tipc::readMessage(stream, msg) != "ok") goto err;
|
||||
|
||||
msg >> propsFp >> tipc::clr;
|
||||
assert(!propsFp.isEmpty());
|
||||
|
||||
TFilePath propsTfp(propsFp.toStdWString());
|
||||
{
|
||||
TOStream os(propsTfp);
|
||||
winfo->saveData(os);
|
||||
}
|
||||
}
|
||||
|
||||
// Pass fp to the server
|
||||
stream << (msg << QString("$initLW3gp") << m_id
|
||||
<< QString::fromStdWString(path.getWideString()) << propsFp);
|
||||
if (tipc::readMessage(stream, msg) != "ok") goto err;
|
||||
|
||||
if (winfo) {
|
||||
stream << (msg << tipc::clr << QString("$tmpfile_release")
|
||||
<< QString("initLW3gp") + QString::number(currCount));
|
||||
if (tipc::readMessage(stream, msg) != "ok") goto err;
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
err:
|
||||
|
||||
throw TException("Unable to write file");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
TLevelWriter3gp::~TLevelWriter3gp() {
|
||||
QLocalSocket socket;
|
||||
tipc::startSlaveConnection(&socket, t32bitsrv::srvName(), -1,
|
||||
t32bitsrv::srvCmdline());
|
||||
|
||||
tipc::Stream stream(&socket);
|
||||
tipc::Message msg;
|
||||
QString res;
|
||||
|
||||
stream << (msg << QString("$closeLW3gp") << m_id);
|
||||
if (tipc::readMessage(stream, msg) != "ok")
|
||||
DVGui::warning("Unable to write file");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void TLevelWriter3gp::setFrameRate(double fps) {
|
||||
TLevelWriter::setFrameRate(fps);
|
||||
|
||||
QLocalSocket socket;
|
||||
tipc::startSlaveConnection(&socket, t32bitsrv::srvName(), -1,
|
||||
t32bitsrv::srvCmdline());
|
||||
|
||||
tipc::Stream stream(&socket);
|
||||
tipc::Message msg;
|
||||
QString res;
|
||||
|
||||
stream << (msg << QString("$LW3gpSetFrameRate") << m_id << fps);
|
||||
if (tipc::readMessage(stream, msg) != "ok")
|
||||
throw TException("Unexpected error");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
TImageWriterP TLevelWriter3gp::getFrameWriter(TFrameId fid) {
|
||||
if (fid.getLetter() != 0) return TImageWriterP(0);
|
||||
|
||||
int index = fid.getNumber() - 1;
|
||||
return new TImageWriter3gpProxy(m_path, index, this);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void TLevelWriter3gp::save(const TImageP &img, int frameIndex) {
|
||||
TRasterImageP ri(img);
|
||||
if (!img) throw TImageException(getFilePath(), "Unsupported image type");
|
||||
|
||||
TRasterP ras(ri->getRaster());
|
||||
|
||||
int lx = ras->getLx(), ly = ras->getLy(), pixSize = ras->getPixelSize();
|
||||
if (pixSize != 4)
|
||||
throw TImageException(getFilePath(), "Unsupported pixel type");
|
||||
|
||||
int size = lx * ly * pixSize;
|
||||
|
||||
// Send messages
|
||||
QLocalSocket socket;
|
||||
tipc::startSlaveConnection(&socket, t32bitsrv::srvName(), -1,
|
||||
t32bitsrv::srvCmdline());
|
||||
|
||||
tipc::Stream stream(&socket);
|
||||
tipc::Message msg;
|
||||
|
||||
// Send the write message.
|
||||
stream << (msg << QString("$LW3gpImageWrite") << m_id << frameIndex << lx
|
||||
<< ly);
|
||||
|
||||
// Send the data through a shared memory segment
|
||||
{
|
||||
t32bitsrv::RasterExchanger<TPixel32> exch(ras);
|
||||
tipc::writeShMemBuffer(stream, msg << tipc::clr, size, &exch);
|
||||
}
|
||||
|
||||
if (tipc::readMessage(stream, msg) != "ok")
|
||||
throw TImageException(getFilePath(), "Couln't save image");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void TLevelWriter3gp::saveSoundTrack(TSoundTrack *st) {
|
||||
if (st == 0) return;
|
||||
|
||||
// Prepare connection
|
||||
QLocalSocket socket;
|
||||
tipc::startSlaveConnection(&socket, t32bitsrv::srvName(), -1,
|
||||
t32bitsrv::srvCmdline());
|
||||
|
||||
unsigned int size = st->getSampleSize() * st->getSampleCount();
|
||||
|
||||
// Send the saveSoundTract command to the server
|
||||
tipc::Stream stream(&socket);
|
||||
tipc::Message msg;
|
||||
|
||||
stream << (msg << QString("$LW3gpSaveSoundTrack") << m_id
|
||||
<< st->getSampleRate() << st->getBitPerSample()
|
||||
<< st->getChannelCount() << st->getSampleCount()
|
||||
<< st->getFormat().m_signedSample);
|
||||
|
||||
t32bitsrv::BufferExchanger exch((UCHAR *)st->getRawData());
|
||||
tipc::writeShMemBuffer(stream, msg << tipc::clr, size, &exch);
|
||||
|
||||
QString res(tipc::readMessage(stream, msg));
|
||||
assert(res == "ok");
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
// TImageReaderMov Proxy implementation
|
||||
//******************************************************************************
|
||||
|
||||
class TImageReader3gpProxy final : public TImageReader {
|
||||
TLevelReader3gp *m_lr;
|
||||
TImageInfo *m_info;
|
||||
|
||||
public:
|
||||
int m_frameIndex;
|
||||
|
||||
public:
|
||||
TImageReader3gpProxy(const TFilePath &fp, int frameIndex, TLevelReader3gp *lr,
|
||||
TImageInfo *info);
|
||||
~TImageReader3gpProxy() { m_lr->release(); }
|
||||
|
||||
TImageP load();
|
||||
void load(const TRasterP &rasP, const TPoint &pos = TPoint(0, 0),
|
||||
int shrinkX = 1, int shrinkY = 1);
|
||||
|
||||
TDimension getSize() const { return m_lr->getSize(); }
|
||||
TRect getBBox() const { return m_lr->getBBox(); }
|
||||
|
||||
const TImageInfo *getImageInfo() const { return m_info; }
|
||||
|
||||
private:
|
||||
// not implemented
|
||||
TImageReader3gpProxy(const TImageReader3gpProxy &);
|
||||
TImageReader3gpProxy &operator=(const TImageReader3gpProxy &src);
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
TImageReader3gpProxy::TImageReader3gpProxy(const TFilePath &fp, int frameIndex,
|
||||
TLevelReader3gp *lr,
|
||||
TImageInfo *info)
|
||||
: TImageReader(fp), m_lr(lr), m_frameIndex(frameIndex), m_info(info) {
|
||||
m_lr->addRef();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
TImageP TImageReader3gpProxy::load() {
|
||||
TRaster32P ras(m_lr->getSize());
|
||||
m_lr->load(ras, m_frameIndex, TPointI(), 1, 1);
|
||||
return TRasterImageP(ras);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void TImageReader3gpProxy::load(const TRasterP &rasP, const TPoint &pos,
|
||||
int shrinkX, int shrinkY) {
|
||||
// NOTE: The original implementation is different. But is also does not make
|
||||
// sense...
|
||||
// I've substituted it with the lrm plain call.
|
||||
m_lr->load(rasP, m_frameIndex, pos, shrinkX, shrinkY);
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
// TLevelReader3gp Proxy implementation
|
||||
//******************************************************************************
|
||||
|
||||
TLevelReader3gp::TLevelReader3gp(const TFilePath &path) : TLevelReader(path) {
|
||||
static TAtomicVar count;
|
||||
unsigned int currCount = ++count;
|
||||
m_id = currCount;
|
||||
|
||||
QLocalSocket socket;
|
||||
tipc::startSlaveConnection(&socket, t32bitsrv::srvName(), -1,
|
||||
t32bitsrv::srvCmdline());
|
||||
|
||||
tipc::Stream stream(&socket);
|
||||
tipc::Message msg;
|
||||
|
||||
stream << (msg << QString("$initLR3gp") << m_id
|
||||
<< QString::fromStdWString(path.getWideString()));
|
||||
if (tipc::readMessage(stream, msg) != "ok")
|
||||
throw TImageException(path, "Couldn't open file");
|
||||
|
||||
double frameRate;
|
||||
msg >> m_lx >> m_ly >> frameRate >> tipc::clr;
|
||||
|
||||
m_info = new TImageInfo;
|
||||
m_info->m_lx = m_lx;
|
||||
m_info->m_ly = m_ly;
|
||||
m_info->m_frameRate = frameRate;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
TLevelReader3gp::~TLevelReader3gp() {
|
||||
QLocalSocket socket;
|
||||
tipc::startSlaveConnection(&socket, t32bitsrv::srvName(), -1,
|
||||
t32bitsrv::srvCmdline());
|
||||
|
||||
tipc::Stream stream(&socket);
|
||||
tipc::Message msg;
|
||||
|
||||
stream << (msg << QString("$closeLR3gp") << m_id);
|
||||
QString res(tipc::readMessage(stream, msg));
|
||||
assert(res == "ok");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
TImageReaderP TLevelReader3gp::getFrameReader(TFrameId fid) {
|
||||
if (fid.getLetter() != 0) return TImageReaderP(0);
|
||||
|
||||
int index = fid.getNumber() - 1;
|
||||
return new TImageReader3gpProxy(m_path, index, this, m_info);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
TLevelP TLevelReader3gp::loadInfo() {
|
||||
QLocalSocket socket;
|
||||
tipc::startSlaveConnection(&socket, t32bitsrv::srvName(), -1,
|
||||
t32bitsrv::srvCmdline());
|
||||
|
||||
tipc::Stream stream(&socket);
|
||||
tipc::Message msg;
|
||||
|
||||
TLevelP level;
|
||||
{
|
||||
QString shMemId(tipc::uniqueId());
|
||||
|
||||
// Send the appropriate command
|
||||
stream << (msg << QString("$LR3gpLoadInfo") << m_id << shMemId);
|
||||
if (tipc::readMessage(stream, msg) != "ok") goto err;
|
||||
|
||||
int frameCount;
|
||||
|
||||
msg >> frameCount >> tipc::clr;
|
||||
|
||||
// Read the data in the shared memory segment
|
||||
QSharedMemory shmem(shMemId);
|
||||
shmem.attach();
|
||||
shmem.lock();
|
||||
|
||||
int *f, *fBegin = (int *)shmem.data(), *fEnd = fBegin + frameCount;
|
||||
assert(fBegin);
|
||||
|
||||
for (f = fBegin; f < fEnd; ++f) level->setFrame(*f, TImageP());
|
||||
|
||||
shmem.unlock();
|
||||
shmem.detach();
|
||||
|
||||
// Release the shared memory segment
|
||||
stream << (msg << QString("$shmem_release") << shMemId);
|
||||
if (tipc::readMessage(stream, msg) != "ok") goto err;
|
||||
}
|
||||
|
||||
return level;
|
||||
|
||||
err:
|
||||
|
||||
throw TException("Couldn't read movie data");
|
||||
return TLevelP();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void TLevelReader3gp::enableRandomAccessRead(bool enable) {
|
||||
QLocalSocket socket;
|
||||
tipc::startSlaveConnection(&socket, t32bitsrv::srvName(), -1,
|
||||
t32bitsrv::srvCmdline());
|
||||
|
||||
tipc::Stream stream(&socket);
|
||||
tipc::Message msg;
|
||||
|
||||
stream << (msg << QString("$LR3gpEnableRandomAccessRead") << m_id
|
||||
<< QString(enable ? "true" : "false"));
|
||||
QString res(tipc::readMessage(stream, msg));
|
||||
assert(res == "ok");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void TLevelReader3gp::load(const TRasterP &ras, int frameIndex,
|
||||
const TPoint &pos, int shrinkX, int shrinkY) {
|
||||
QLocalSocket socket;
|
||||
tipc::startSlaveConnection(&socket, t32bitsrv::srvName(), -1,
|
||||
t32bitsrv::srvCmdline());
|
||||
|
||||
tipc::Stream stream(&socket);
|
||||
tipc::Message msg;
|
||||
|
||||
unsigned int size = ras->getLx() * ras->getLy() * ras->getPixelSize();
|
||||
|
||||
// Send the appropriate command to the 32-bit server
|
||||
stream << (msg << QString("$LR3gpImageRead") << m_id << ras->getLx()
|
||||
<< ras->getLy() << ras->getPixelSize() << frameIndex << pos.x
|
||||
<< pos.y << shrinkX << shrinkY);
|
||||
|
||||
t32bitsrv::RasterExchanger<TPixel32> exch(ras);
|
||||
if (!tipc::readShMemBuffer(stream, msg << tipc::clr, &exch))
|
||||
throw TException("Couldn't load image");
|
||||
}
|
||||
|
||||
#endif // x64
|
|
@ -1,80 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#ifndef TIIO_3GP_PROXY_H
|
||||
#define TIIO_3GP_PROXY_H
|
||||
|
||||
#if defined(x64) || defined(__LP64__) || defined(LINUX) || (defined(_WIN32) && defined(__GNUC__))
|
||||
|
||||
// Qt includes
|
||||
#include <QString>
|
||||
#include <QLocalSocket>
|
||||
|
||||
#include "tlevel_io.h"
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
// QuickTime check
|
||||
bool IsQuickTimeInstalled();
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
//******************************************************************************
|
||||
// TLevelWriter3gp Proxy - delegates to a background 32-bit process
|
||||
//******************************************************************************
|
||||
|
||||
class TLevelWriter3gp final : public TLevelWriter {
|
||||
unsigned int m_id;
|
||||
|
||||
public:
|
||||
TLevelWriter3gp(const TFilePath &path, TPropertyGroup *winfo);
|
||||
~TLevelWriter3gp();
|
||||
|
||||
void setFrameRate(double fps);
|
||||
|
||||
TImageWriterP getFrameWriter(TFrameId fid);
|
||||
void save(const TImageP &img, int frameIndex);
|
||||
|
||||
void saveSoundTrack(TSoundTrack *st);
|
||||
|
||||
public:
|
||||
static TLevelWriter *create(const TFilePath &f, TPropertyGroup *winfo) {
|
||||
return new TLevelWriter3gp(f, winfo);
|
||||
};
|
||||
|
||||
QLocalSocket *socket();
|
||||
};
|
||||
|
||||
//******************************************************************************
|
||||
// TLevelReader3gp Proxy
|
||||
//******************************************************************************
|
||||
|
||||
class TLevelReader3gp final : public TLevelReader {
|
||||
unsigned int m_id;
|
||||
int m_lx, m_ly;
|
||||
|
||||
public:
|
||||
TLevelReader3gp(const TFilePath &path);
|
||||
~TLevelReader3gp();
|
||||
TImageReaderP getFrameReader(TFrameId fid);
|
||||
TLevelP loadInfo();
|
||||
|
||||
const TImageInfo *getImageInfo(TFrameId fid) { return m_info; }
|
||||
const TImageInfo *getImageInfo() { return m_info; }
|
||||
|
||||
void enableRandomAccessRead(bool enable);
|
||||
void load(const TRasterP &rasP, int frameIndex, const TPoint &pos,
|
||||
int shrinkX = 1, int shrinkY = 1);
|
||||
TDimension getSize() const { return TDimension(m_lx, m_ly); }
|
||||
TRect getBBox() const { return TRect(0, 0, m_lx - 1, m_ly - 1); }
|
||||
|
||||
public:
|
||||
static TLevelReader *create(const TFilePath &f) {
|
||||
return new TLevelReader3gp(f);
|
||||
}
|
||||
};
|
||||
|
||||
//===========================================================================
|
||||
|
||||
#endif // x64
|
||||
|
||||
#endif // TIIO_3GP_PROXY_H
|
|
@ -18,8 +18,6 @@ set(HEADERS
|
|||
tzp/toonztags.h
|
||||
tzl/tiio_tzl.h
|
||||
../include/tnzimage.h
|
||||
mov/tiio_mov_proxy.h
|
||||
3gp/tiio_3gp_proxy.h
|
||||
ffmpeg/tiio_gif.h
|
||||
ffmpeg/tiio_webm.h
|
||||
ffmpeg/tiio_mp4.h
|
||||
|
@ -49,8 +47,6 @@ set(SOURCES
|
|||
tzp/tiio_tzp.cpp
|
||||
tzp/avl.c
|
||||
tzl/tiio_tzl.cpp
|
||||
mov/tiio_mov_proxy.cpp
|
||||
3gp/tiio_3gp_proxy.cpp
|
||||
ffmpeg/tiio_gif.cpp
|
||||
ffmpeg/tiio_webm.cpp
|
||||
ffmpeg/tiio_mp4.cpp
|
||||
|
@ -62,31 +58,9 @@ set(SOURCES
|
|||
if(BUILD_TARGET_WIN)
|
||||
set(HEADERS ${HEADERS}
|
||||
avi/tiio_avi.h
|
||||
mov/tiio_mov.h
|
||||
3gp/tiio_3gp.h
|
||||
)
|
||||
set(SOURCES ${SOURCES}
|
||||
avi/tiio_avi.cpp
|
||||
mov/tiio_movW.cpp
|
||||
3gp/tiio_3gpW.cpp
|
||||
)
|
||||
elseif(BUILD_TARGET_APPLE)
|
||||
set(HEADERS ${HEADERS}
|
||||
mov/tiio_movM.h
|
||||
3gp/tiio_3gpM.h
|
||||
)
|
||||
set(SOURCES ${SOURCES}
|
||||
mov/tiio_movM.cpp
|
||||
3gp/tiio_3gpM.cpp
|
||||
)
|
||||
elseif(BUILD_TARGET_UNIX)
|
||||
set(HEADERS ${HEADERS}
|
||||
3gp/tiio_3gp_proxy.h
|
||||
mov/tiio_mov_proxy.h
|
||||
)
|
||||
set(SOURCES ${SOURCES}
|
||||
mov/tiio_mov_proxy.cpp
|
||||
3gp/tiio_3gp_proxy.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
|
@ -122,7 +96,6 @@ endif()
|
|||
if(BUILD_TARGET_WIN AND PLATFORM EQUAL 32)
|
||||
include_directories(
|
||||
SYSTEM
|
||||
${SDKROOT}/quicktime/QT73SDK/CIncludes
|
||||
)
|
||||
endif()
|
||||
|
||||
|
|
|
@ -1,177 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#ifndef TIIO_MOV_H
|
||||
#define TIIO_MOV_H
|
||||
|
||||
#if defined(x64) || (defined(__GNUC__) && defined(_WIN32))
|
||||
#include "tiio_mov_proxy.h"
|
||||
#else
|
||||
|
||||
// Windows include
|
||||
#include <windows.h>
|
||||
|
||||
// QuickTime includes
|
||||
namespace QuickTime {
|
||||
#define list QuickTime_list
|
||||
#define map QuickTime_map
|
||||
#define iterator QuickTime_iterator
|
||||
#define float_t QuickTime_float_t
|
||||
#define GetProcessInformation QuickTime_GetProcessInformation
|
||||
#define int_fast8_t QuickTime_int_fast8_t
|
||||
#define int_fast16_t QuickTime_int_fast16_t
|
||||
#define uint_fast16_t QuickTime_uint_fast16_t
|
||||
|
||||
#include "QTML.h"
|
||||
#include "Movies.h"
|
||||
#include "Script.h"
|
||||
#include "FixMath.h"
|
||||
#include "Sound.h"
|
||||
#include "QuickTimeComponents.h"
|
||||
|
||||
#undef list
|
||||
#undef map
|
||||
#undef iterator
|
||||
#undef float_t
|
||||
#undef GetProcessInformation
|
||||
#undef int_fast8_t
|
||||
#undef int_fast16_t
|
||||
#undef uint_fast16_t
|
||||
|
||||
#include "tquicktime.h"
|
||||
} // namespace QuickTime
|
||||
|
||||
// Toonz includes
|
||||
#include "tlevel_io.h"
|
||||
#include "tthreadmessage.h"
|
||||
#include "tcommon.h"
|
||||
|
||||
#undef DVAPI
|
||||
#undef DVVAR
|
||||
#ifdef IMAGE_EXPORTS
|
||||
#define DVAPI DV_EXPORT_API
|
||||
#define DVVAR DV_EXPORT_VAR
|
||||
#else
|
||||
#define DVAPI DV_IMPORT_API
|
||||
#define DVVAR DV_IMPORT_VAR
|
||||
#endif
|
||||
|
||||
using namespace QuickTime;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Forward declarations
|
||||
|
||||
class TImageWriterMov;
|
||||
class TImageReaderMov;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Global functions
|
||||
|
||||
bool IsQuickTimeInstalled();
|
||||
|
||||
//***********************************************************************************
|
||||
// Mov TLevelWriter class
|
||||
//***********************************************************************************
|
||||
|
||||
class TLevelWriterMov final : public TLevelWriter {
|
||||
std::vector<std::pair<int, TimeValue>> m_savedFrames;
|
||||
int m_IOError;
|
||||
|
||||
Movie m_movie;
|
||||
Track m_videoTrack;
|
||||
Track m_soundTrack;
|
||||
Media m_videoMedia;
|
||||
Media m_soundMedia;
|
||||
GWorldPtr m_gworld;
|
||||
PixMapHandle m_pixmap;
|
||||
short m_refNum;
|
||||
PixelXRGB *m_buf;
|
||||
int buf_lx;
|
||||
int buf_ly;
|
||||
int m_firstFrame;
|
||||
TThread::Mutex m_mutex;
|
||||
ComponentInstance m_ci;
|
||||
|
||||
public:
|
||||
TLevelWriterMov(const TFilePath &path, TPropertyGroup *winfo);
|
||||
~TLevelWriterMov();
|
||||
|
||||
TImageWriterP getFrameWriter(TFrameId fid) override;
|
||||
|
||||
void save(const TImageP &img, int frameIndex);
|
||||
void saveSoundTrack(TSoundTrack *st) override;
|
||||
|
||||
public:
|
||||
static TLevelWriter *create(const TFilePath &f, TPropertyGroup *winfo) {
|
||||
return new TLevelWriterMov(f, winfo);
|
||||
}
|
||||
};
|
||||
|
||||
//***********************************************************************************
|
||||
// Mov TLevelReader class
|
||||
//***********************************************************************************
|
||||
|
||||
class DVAPI TLevelReaderMov final : public TLevelReader {
|
||||
bool m_readAsToonzOutput; // default: false
|
||||
bool m_yMirror; // default: true
|
||||
bool m_loadTimecode; // default: false
|
||||
int m_IOError;
|
||||
|
||||
short m_refNum;
|
||||
Movie m_movie;
|
||||
Track m_track;
|
||||
MediaHandler m_timecodeHandler;
|
||||
long m_depth;
|
||||
std::map<int, TimeValue> currentTimes;
|
||||
int m_lx, m_ly;
|
||||
int m_hh, m_mm, m_ss, m_ff;
|
||||
TThread::Mutex m_mutex;
|
||||
|
||||
public:
|
||||
TLevelReaderMov(const TFilePath &path);
|
||||
~TLevelReaderMov();
|
||||
|
||||
TImageReaderP getFrameReader(TFrameId fid) override;
|
||||
TLevelP loadInfo() override;
|
||||
void load(const TRasterP &rasP, int frameIndex, const TPoint &pos,
|
||||
int shrinkX = 1, int shrinkY = 1);
|
||||
|
||||
void timecode(int frame, UCHAR &hh, UCHAR &mm, UCHAR &ss, UCHAR &ff);
|
||||
void loadedTimecode(UCHAR &hh, UCHAR &mm, UCHAR &ss, UCHAR &ff);
|
||||
|
||||
const TImageInfo *getImageInfo(TFrameId fid) override { return m_info; }
|
||||
const TImageInfo *getImageInfo() override { return m_info; }
|
||||
|
||||
void setYMirror(bool enabled);
|
||||
void setLoadTimecode(bool enabled);
|
||||
void enableRandomAccessRead(bool enable) override;
|
||||
|
||||
TDimension getSize() const { return TDimension(m_lx, m_ly); }
|
||||
TRect getBBox() const { return TRect(0, 0, m_lx - 1, m_ly - 1); }
|
||||
|
||||
public:
|
||||
static TLevelReader *create(const TFilePath &f);
|
||||
|
||||
private:
|
||||
TLevelP loadToonzOutputFormatInfo();
|
||||
};
|
||||
|
||||
//===========================================================================
|
||||
|
||||
// Mov Properties
|
||||
|
||||
namespace Tiio {
|
||||
|
||||
class MovWriterProperties final : public TPropertyGroup {
|
||||
public:
|
||||
MovWriterProperties();
|
||||
};
|
||||
|
||||
} // namespace Tiio
|
||||
|
||||
//===========================================================================
|
||||
|
||||
#endif //! x64
|
||||
|
||||
#endif // TIIO_MOV_H
|
|
@ -1,299 +0,0 @@
|
|||
|
||||
|
||||
#include <openquicktime.h>
|
||||
#include <colormodels.h>
|
||||
|
||||
#include "tiio_movL.h"
|
||||
#include "traster.h"
|
||||
#include "trasterimage.h"
|
||||
#include "tsound.h"
|
||||
#include "tconvert.h"
|
||||
#include "trop.h"
|
||||
#include "tsystem.h"
|
||||
//#define DUMP_KEYFRAMES
|
||||
|
||||
bool IsQuickTimeInstalled() { return true; }
|
||||
|
||||
enum {
|
||||
QTNoError = 0,
|
||||
QTUnableToOpenFile,
|
||||
QTUnableToSeekToKeyFrame,
|
||||
QTNoSuchFile,
|
||||
QTUnsupportedVideoFormat
|
||||
};
|
||||
|
||||
class TQTException : public TImageException {
|
||||
public:
|
||||
TQTException(const TFilePath &fp, int ec)
|
||||
: TImageException(fp, getErrorMessage(ec)) {}
|
||||
TQTException(const TFilePath &fp, int ec, int v)
|
||||
: TImageException(fp, getErrorMessage(ec) + toString(v)) {}
|
||||
|
||||
~TQTException() {}
|
||||
static string getErrorMessage(int ec) {
|
||||
switch (ec) {
|
||||
case QTNoError:
|
||||
return "No error";
|
||||
case QTUnableToOpenFile:
|
||||
return "unable to open file";
|
||||
case QTUnableToSeekToKeyFrame:
|
||||
return "unable to seek to keyframe";
|
||||
case QTNoSuchFile:
|
||||
return "no such file";
|
||||
case QTUnsupportedVideoFormat:
|
||||
return "Unsupported video format";
|
||||
}
|
||||
return "unknown error";
|
||||
}
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// TImageWriterMov
|
||||
//-----------------------------------------------------------
|
||||
|
||||
class TImageWriterMov : public TImageWriter {
|
||||
public:
|
||||
TImageWriterMov(const TFilePath &, int frameIndex, TLevelWriterMov *);
|
||||
~TImageWriterMov() {}
|
||||
bool is64bitOutputSupported() { return false; }
|
||||
|
||||
private:
|
||||
// not implemented
|
||||
TImageWriterMov(const TImageWriterMov &);
|
||||
TImageWriterMov &operator=(const TImageWriterMov &src);
|
||||
|
||||
public:
|
||||
void save(const TImageP &);
|
||||
int m_frameIndex;
|
||||
|
||||
private:
|
||||
TLevelWriterMov *m_lwm;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// TImageReaderMov
|
||||
//-----------------------------------------------------------
|
||||
class TImageReaderMov : public TImageReader {
|
||||
public:
|
||||
TImageReaderMov(const TFilePath &, int frameIndex, TLevelReaderMov *);
|
||||
~TImageReaderMov() {}
|
||||
|
||||
private:
|
||||
// not implemented
|
||||
TImageReaderMov(const TImageReaderMov &);
|
||||
TImageReaderMov &operator=(const TImageReaderMov &src);
|
||||
|
||||
public:
|
||||
TImageP load();
|
||||
int m_frameIndex;
|
||||
|
||||
TDimension getSize() const { return TDimension(m_lrm->m_lx, m_lrm->m_ly); }
|
||||
TRect getBBox() const {
|
||||
return TRect(0, 0, m_lrm->m_lx - 1, m_lrm->m_ly - 1);
|
||||
}
|
||||
|
||||
private:
|
||||
TLevelReaderMov *m_lrm;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------
|
||||
//-----------------------------------------------------------
|
||||
// TImageWriterMov
|
||||
//-----------------------------------------------------------
|
||||
|
||||
TImageWriterMov::TImageWriterMov(const TFilePath &path, int frameIndex,
|
||||
TLevelWriterMov *lwm)
|
||||
: TImageWriter(path), m_lwm(lwm), m_frameIndex(frameIndex) {}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
void TImageWriterMov::save(const TImageP &img) { assert(false); }
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// TLevelWriterMov
|
||||
//-----------------------------------------------------------
|
||||
|
||||
/*
|
||||
class TWriterInfoMov : public TWriterInfo {
|
||||
public:
|
||||
TWriterInfoMov() : TWriterInfo() { assert(!"Not implemented"); }
|
||||
~TWriterInfoMov() {}
|
||||
private:
|
||||
};
|
||||
*/
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
TLevelWriterMov::TLevelWriterMov(const TFilePath &path, TWriterInfo *info)
|
||||
: TLevelWriter(path, info)
|
||||
//,m_initDone(false)
|
||||
//,m_rate(25)
|
||||
//,m_IOError(QTNoError)
|
||||
//,quality(DM_IMAGE_QUALITY_NORMAL)
|
||||
//,compression(DM_IMAGE_QT_ANIM)
|
||||
//,m_writerInfo(new TWriterInfoMov())
|
||||
{
|
||||
assert(false);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
void TLevelWriterMov::saveSoundTrack(TSoundTrack *) {
|
||||
throw TImageException(m_path,
|
||||
"TLevelWriterMov::saveSoundTrack not Implemented");
|
||||
}
|
||||
//-----------------------------------------------------------
|
||||
|
||||
/*
|
||||
TWriterInfo *TLevelWriterMov::getWriterInfo() const
|
||||
{
|
||||
return m_writerInfo;
|
||||
}
|
||||
*/
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
TLevelWriterMov::~TLevelWriterMov() { assert(0); }
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
TImageWriterP TLevelWriterMov::getFrameWriter(TFrameId fid) { assert(false); }
|
||||
|
||||
//-----------------------------------------------------------
|
||||
//------------------------------------------------
|
||||
|
||||
//------------------------------------------------
|
||||
// TImageReaderMov
|
||||
//------------------------------------------------
|
||||
|
||||
TImageReaderMov::TImageReaderMov(const TFilePath &path, int frameIndex,
|
||||
TLevelReaderMov *lrm)
|
||||
: TImageReader(path), m_lrm(lrm), m_frameIndex(frameIndex) {}
|
||||
|
||||
//------------------------------------------------
|
||||
|
||||
using namespace std;
|
||||
|
||||
TLevelReaderMov::TLevelReaderMov(const TFilePath &path)
|
||||
: TLevelReader(path)
|
||||
, m_IOError(QTNoError)
|
||||
, m_lastFrameDecoded(-1)
|
||||
, m_fileMov(0)
|
||||
, m_lx(0)
|
||||
, m_ly(0) {
|
||||
if (!TFileStatus(path).doesExist()) {
|
||||
m_IOError = QTNoSuchFile;
|
||||
return;
|
||||
}
|
||||
m_fileMov = oqt_open((char *)path.getString().c_str());
|
||||
if (!m_fileMov) {
|
||||
m_IOError = QTUnableToOpenFile;
|
||||
return;
|
||||
}
|
||||
|
||||
oqt_read_headers(m_fileMov);
|
||||
|
||||
/*
|
||||
if(!oqt_get_video_track_count(m_fileMov))
|
||||
{
|
||||
m_status = !DM_SUCCESS;
|
||||
m_IOError = QTCheckLibError;
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
m_lx = oqt_get_video_width(m_fileMov, 0);
|
||||
m_ly = oqt_get_video_height(m_fileMov, 0);
|
||||
/*
|
||||
char *vc = oqt_get_video_compressor(m_fileMov, 0);
|
||||
cout << "video compressor = " << vc[0] << vc[1] << vc[2] << vc[3] << endl;
|
||||
*/
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
|
||||
TLevelReaderMov::~TLevelReaderMov() {
|
||||
if (m_fileMov) oqt_close(m_fileMov);
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
|
||||
TLevelP TLevelReaderMov::loadInfo() {
|
||||
TLevelP level;
|
||||
if (m_IOError != QTNoError) {
|
||||
throw TQTException(m_path, m_IOError);
|
||||
}
|
||||
if (oqt_supported_video(m_fileMov, 0) == 0) {
|
||||
m_IOError = QTUnsupportedVideoFormat;
|
||||
throw TQTException(m_path, m_IOError);
|
||||
}
|
||||
|
||||
int frameCount = oqt_get_video_length(m_fileMov, 0);
|
||||
|
||||
for (int i = 1; i <= frameCount; i++) level->setFrame(TFrameId(i), TImageP());
|
||||
|
||||
#ifdef DUMP_KEYFRAMES
|
||||
for (int k = 1; k < frameCount; k++) {
|
||||
cout << "frame = " << k << "; keyframe before = "
|
||||
<< oqt_get_video_keyframe_before(m_fileMov, 0, k)
|
||||
<< "; keyframe after = "
|
||||
<< oqt_get_video_keyframe_after(m_fileMov, 0, k) << endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
return level;
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
|
||||
TImageP TImageReaderMov::load() {
|
||||
if (m_lrm->m_IOError != QTNoError)
|
||||
throw TQTException(m_path, m_lrm->m_IOError);
|
||||
|
||||
TThread::ScopedLock sl(m_lrm->m_mutex);
|
||||
int rc;
|
||||
TRaster32P ret(m_lrm->m_lx, m_lrm->m_ly);
|
||||
unsigned char **data =
|
||||
(unsigned char **)malloc(m_lrm->m_ly * sizeof(unsigned char *));
|
||||
for (int i = 0; i < m_lrm->m_ly; ++i) {
|
||||
unsigned char *ptr = (unsigned char *)ret->pixels(i);
|
||||
data[i] = ptr;
|
||||
}
|
||||
int cmodel = BC_RGBA8888;
|
||||
int frame;
|
||||
if (m_lrm->m_lastFrameDecoded != (m_frameIndex - 1)) {
|
||||
oqt_int64_t kfb =
|
||||
oqt_get_video_keyframe_before(m_lrm->m_fileMov, 0, m_frameIndex);
|
||||
assert(kfb <= m_frameIndex);
|
||||
rc = oqt_set_video_position(m_lrm->m_fileMov, 0, kfb);
|
||||
if (rc) {
|
||||
throw TQTException(m_lrm->m_path, QTUnableToSeekToKeyFrame, kfb);
|
||||
}
|
||||
frame = kfb - 1;
|
||||
} else
|
||||
frame = m_lrm->m_lastFrameDecoded;
|
||||
|
||||
do {
|
||||
rc = oqt_decode_video(m_lrm->m_fileMov, 0, cmodel, data);
|
||||
frame++;
|
||||
} while (frame != m_frameIndex);
|
||||
|
||||
m_lrm->m_lastFrameDecoded = m_frameIndex;
|
||||
ret->yMirror();
|
||||
free(data);
|
||||
return TRasterImageP(ret);
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
|
||||
TImageReaderP TLevelReaderMov::getFrameReader(TFrameId fid) {
|
||||
if (m_IOError != QTNoError) {
|
||||
throw TQTException(m_path, m_IOError);
|
||||
}
|
||||
|
||||
if (fid.getLetter() != 0) return TImageReaderP(0);
|
||||
int index = fid.getNumber() - 1;
|
||||
|
||||
TImageReaderMov *irm = new TImageReaderMov(m_path, index, this);
|
||||
return TImageReaderP(irm);
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#ifndef TIIO_MOV_H
|
||||
#define TIIO_MOV_H
|
||||
|
||||
#include "openquicktime.h"
|
||||
#include "tlevel_io.h"
|
||||
#include "tthread.h"
|
||||
|
||||
class TImageWriterMov;
|
||||
class TImageReaderMov;
|
||||
|
||||
bool IsQuickTimeInstalled();
|
||||
|
||||
class TLevelWriterMov : public TLevelWriter {
|
||||
public:
|
||||
TLevelWriterMov(const TFilePath &path, TWriterInfo *winfo);
|
||||
~TLevelWriterMov();
|
||||
TImageWriterP getFrameWriter(TFrameId fid);
|
||||
friend class TImageWriterMov;
|
||||
|
||||
public:
|
||||
static TLevelWriter *create(const TFilePath &f, TWriterInfo *winfo) {
|
||||
return new TLevelWriterMov(f, winfo);
|
||||
};
|
||||
void saveSoundTrack(TSoundTrack *st);
|
||||
};
|
||||
|
||||
class TLevelReaderMov : public TLevelReader {
|
||||
public:
|
||||
TLevelReaderMov(const TFilePath &path);
|
||||
~TLevelReaderMov();
|
||||
TImageReaderP getFrameReader(TFrameId fid);
|
||||
friend class TImageReaderMov;
|
||||
TLevelP loadInfo();
|
||||
|
||||
int m_IOError;
|
||||
|
||||
private:
|
||||
TThread::Mutex m_mutex;
|
||||
short m_refNum;
|
||||
short m_resId;
|
||||
long m_depth;
|
||||
int m_lx, m_ly;
|
||||
oqt_t *m_fileMov;
|
||||
int m_lastFrameDecoded;
|
||||
|
||||
public:
|
||||
static TLevelReader *create(const TFilePath &f) {
|
||||
return new TLevelReaderMov(f);
|
||||
};
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class TWriterInfoMov : public TWriterInfo {
|
||||
// friend TImageWriterMov;
|
||||
public:
|
||||
static TWriterInfo *create(const string &ext) { return new TWriterInfoMov(); }
|
||||
~TWriterInfoMov() {}
|
||||
TWriterInfo *clone() const { return new TWriterInfoMov(); }
|
||||
|
||||
private:
|
||||
TWriterInfoMov() {}
|
||||
|
||||
TWriterInfoMov(const TWriterInfoMov &);
|
||||
|
||||
TWriterInfoMov &operator=(const TWriterInfoMov &); // not implemented
|
||||
};
|
||||
|
||||
#endif // TIIO_MOV_H
|
File diff suppressed because it is too large
Load diff
|
@ -1,141 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#ifndef TIIO_MOV_H
|
||||
#define TIIO_MOV_H
|
||||
|
||||
#ifdef __LP64__
|
||||
#include "tiio_mov_proxy.h"
|
||||
#else
|
||||
|
||||
//#include <Carbon/Carbon.h>
|
||||
//#include <Movies.h>
|
||||
//#include <ImageCompression.h>
|
||||
//#include "QuickTimeComponents.h"
|
||||
|
||||
#include <QuickTime/QuickTime.h>
|
||||
|
||||
#include "tquicktime.h"
|
||||
#include "tlevel_io.h"
|
||||
#include "tthread.h"
|
||||
#include "tthreadmessage.h"
|
||||
|
||||
bool IsQuickTimeInstalled();
|
||||
|
||||
class TLevelWriterMov : public TLevelWriter {
|
||||
std::vector<std::pair<int, TimeValue>> m_savedFrames;
|
||||
|
||||
public:
|
||||
TLevelWriterMov(const TFilePath &path, TPropertyGroup *winfo);
|
||||
~TLevelWriterMov();
|
||||
TImageWriterP getFrameWriter(TFrameId fid);
|
||||
|
||||
int m_IOError;
|
||||
|
||||
void save(const TImageP &img, int frameIndex);
|
||||
|
||||
private:
|
||||
Movie m_movie;
|
||||
Track m_videoTrack;
|
||||
Media m_videoMedia;
|
||||
Track m_soundTrack;
|
||||
Media m_soundMedia;
|
||||
|
||||
GWorldPtr m_gworld;
|
||||
PixMapHandle m_pixmap;
|
||||
// Handle m_compressedData;
|
||||
short m_refNum;
|
||||
|
||||
PixelXRGB *buf;
|
||||
int buf_lx;
|
||||
int buf_ly;
|
||||
int m_firstFrame;
|
||||
TThread::Mutex m_mutex;
|
||||
ComponentInstance m_ci;
|
||||
|
||||
public:
|
||||
static TLevelWriter *create(const TFilePath &f, TPropertyGroup *winfo) {
|
||||
return new TLevelWriterMov(f, winfo);
|
||||
};
|
||||
void saveSoundTrack(TSoundTrack *st);
|
||||
};
|
||||
|
||||
class TLevelReaderMov : public TLevelReader {
|
||||
bool m_readAsToonzOutput;
|
||||
|
||||
public:
|
||||
TLevelReaderMov(const TFilePath &path);
|
||||
~TLevelReaderMov();
|
||||
TImageReaderP getFrameReader(TFrameId fid);
|
||||
// friend class TImageReaderMov;
|
||||
TLevelP loadInfo();
|
||||
|
||||
void enableRandomAccessRead(bool enable) { m_readAsToonzOutput = enable; }
|
||||
void load(const TRasterP &rasP, int frameIndex, const TPoint &pos,
|
||||
int shrinkX = 1, int shrinkY = 1);
|
||||
TDimension getSize() const { return TDimension(m_lx, m_ly); }
|
||||
TRect getBBox() const { return TRect(0, 0, m_lx - 1, m_ly - 1); }
|
||||
|
||||
int m_IOError;
|
||||
|
||||
private:
|
||||
short m_refNum;
|
||||
Movie m_movie;
|
||||
short m_resId;
|
||||
Track m_track;
|
||||
long m_depth;
|
||||
map<int, TimeValue> currentTimes;
|
||||
int m_lx, m_ly;
|
||||
|
||||
public:
|
||||
static TLevelReader *create(const TFilePath &f) {
|
||||
return new TLevelReaderMov(f);
|
||||
};
|
||||
TThread::Mutex m_mutex;
|
||||
|
||||
TLevelP loadToonzOutputFormatInfo();
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
class TWriterInfoMov : public TWriterInfo {
|
||||
friend class TLevelWriterMov;
|
||||
public:
|
||||
static TWriterInfo *create(const string &ext);
|
||||
~TWriterInfoMov();
|
||||
TWriterInfo *clone() const;
|
||||
private:
|
||||
TWriterInfoMov();
|
||||
|
||||
|
||||
TWriterInfoMov(const TWriterInfoMov&);
|
||||
|
||||
TWriterInfoMov&operator=(const TWriterInfoMov&); // not implemented
|
||||
|
||||
typedef map<int, CodecQ> CodecTable;
|
||||
typedef map<int, CodecType> QualityTable;
|
||||
CodecTable m_codecTable;
|
||||
QualityTable m_qualityTable;
|
||||
};
|
||||
*/
|
||||
|
||||
namespace Tiio {
|
||||
|
||||
class MovWriterProperties : public TPropertyGroup {
|
||||
// std::map<wstring, CodecType> m_codecMap;
|
||||
// std::map<wstring, CodecQ> m_qualityMap;
|
||||
|
||||
public:
|
||||
MovWriterProperties();
|
||||
// TPropertyGroup* clone() const;
|
||||
// TEnumProperty m_codec;
|
||||
// TEnumProperty m_quality;
|
||||
// CodecType getCurrentCodec()const;
|
||||
// wstring getCurrentNameFromCodec(CodecType &cCodec)const;
|
||||
// wstring getCurrentQualityFromCodeQ(CodecQ &cCodeQ)const;
|
||||
// CodecQ getCurrentQuality()const;
|
||||
};
|
||||
}
|
||||
|
||||
#endif //__LP64__
|
||||
|
||||
#endif // TIIO_MOV_H
|
File diff suppressed because it is too large
Load diff
|
@ -1,326 +0,0 @@
|
|||
|
||||
|
||||
#include "tiio_movX.h"
|
||||
#include "traster.h"
|
||||
#include "trasterimage.h"
|
||||
#include "tsound.h"
|
||||
|
||||
#ifdef NOTE
|
||||
Supportato solo RGBM32, sotto NT sarebbe possibile supportare anche 1bpp,
|
||||
ma mancano i TRaster opportuni...
|
||||
|
||||
viene supportata
|
||||
solo(LA PRIMA) traccia video !!!!
|
||||
#endif
|
||||
|
||||
// namespace {
|
||||
enum QTLibError {
|
||||
QTNoError = 0x0000,
|
||||
|
||||
QTCantCreateParams = 0x0101,
|
||||
QTCantSetParams = 0x0102,
|
||||
QTPixelTypeError = 0x0103,
|
||||
QTCheckLibError = 0x0104
|
||||
};
|
||||
|
||||
string buildQTErrorString(int ec) {
|
||||
switch (ec) {
|
||||
case QTCantCreateParams:
|
||||
return "Unable to create default params";
|
||||
case QTCantSetParams:
|
||||
return "Unable to set default params";
|
||||
case QTPixelTypeError:
|
||||
return "Unsupported pixel type";
|
||||
case QTCheckLibError:
|
||||
return mvGetErrorStr(mvGetErrno());
|
||||
default:
|
||||
return "Unknown error";
|
||||
}
|
||||
}
|
||||
//}
|
||||
//-----------------------------------------------------------
|
||||
// TImageWriterMov
|
||||
//-----------------------------------------------------------
|
||||
|
||||
class TImageWriterMov : public TImageWriter {
|
||||
public:
|
||||
TImageWriterMov(const TFilePath &, int frameIndex, TLevelWriterMov *);
|
||||
~TImageWriterMov() {}
|
||||
bool is64bitOutputSupported() { return false; }
|
||||
|
||||
private:
|
||||
// not implemented
|
||||
TImageWriterMov(const TImageWriterMov &);
|
||||
TImageWriterMov &operator=(const TImageWriterMov &src);
|
||||
|
||||
public:
|
||||
void save(const TImageP &);
|
||||
int m_frameIndex;
|
||||
|
||||
private:
|
||||
TLevelWriterMov *m_lwm;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// TImageReaderMov
|
||||
//-----------------------------------------------------------
|
||||
class TImageReaderMov : public TImageReader {
|
||||
public:
|
||||
TImageReaderMov(const TFilePath &, int frameIndex, TLevelReaderMov *);
|
||||
~TImageReaderMov() {}
|
||||
|
||||
private:
|
||||
// not implemented
|
||||
TImageReaderMov(const TImageReaderMov &);
|
||||
TImageReaderMov &operator=(const TImageReaderMov &src);
|
||||
|
||||
public:
|
||||
TImageP load();
|
||||
int m_frameIndex;
|
||||
|
||||
TDimension getSize() const { return TDimension(m_lrm->m_lx, m_lrm->m_ly); }
|
||||
TRect getBBox() const {
|
||||
return TRect(0, 0, m_lrm->m_lx - 1, m_lrm->m_ly - 1);
|
||||
}
|
||||
|
||||
private:
|
||||
TLevelReaderMov *m_lrm;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------
|
||||
//-----------------------------------------------------------
|
||||
// TImageWriterMov
|
||||
//-----------------------------------------------------------
|
||||
|
||||
TImageWriterMov::TImageWriterMov(const TFilePath &path, int frameIndex,
|
||||
TLevelWriterMov *lwm)
|
||||
: TImageWriter(path), m_lwm(lwm), m_frameIndex(frameIndex) {}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
void TImageWriterMov::save(const TImageP &img) {
|
||||
TRasterImageP image(img);
|
||||
int lx = image->getRaster()->getLx();
|
||||
int ly = image->getRaster()->getLy();
|
||||
void *buffer = image->getRaster()->getRawData();
|
||||
int pixSize = image->getRaster()->getPixelSize();
|
||||
if (pixSize != 4)
|
||||
throw TImageException(m_lwm->getFilePath(), "Unsupported pixel type");
|
||||
|
||||
if (!m_lwm->m_initDone) {
|
||||
DMparams *imageTrackParams;
|
||||
|
||||
if (dmParamsCreate(&imageTrackParams) != DM_SUCCESS)
|
||||
throw TImageException(m_lwm->getFilePath(),
|
||||
"Unable to create image track params");
|
||||
|
||||
if (dmSetImageDefaults(imageTrackParams, lx, ly, DM_IMAGE_PACKING_XRGB) !=
|
||||
DM_SUCCESS) {
|
||||
dmParamsDestroy(imageTrackParams);
|
||||
throw TImageException(m_lwm->getFilePath(),
|
||||
"Unable to set image defaults");
|
||||
}
|
||||
|
||||
if (dmParamsSetFloat(imageTrackParams, DM_IMAGE_RATE,
|
||||
(double)m_lwm->m_rate) != DM_SUCCESS) {
|
||||
dmParamsDestroy(imageTrackParams);
|
||||
throw TImageException(m_lwm->getFilePath(), "Unable to set frame rate");
|
||||
}
|
||||
|
||||
if (dmParamsSetEnum(imageTrackParams, DM_IMAGE_ORIENTATION,
|
||||
DM_TOP_TO_BOTTOM) != DM_SUCCESS) {
|
||||
dmParamsDestroy(imageTrackParams);
|
||||
throw TImageException(m_lwm->getFilePath(), "Unable to set frame rate");
|
||||
}
|
||||
|
||||
if (dmParamsSetFloat(imageTrackParams, DM_IMAGE_QUALITY_SPATIAL,
|
||||
m_lwm->quality) != DM_SUCCESS) {
|
||||
dmParamsDestroy(imageTrackParams);
|
||||
throw TImageException(m_lwm->getFilePath(), "Unable to set quality");
|
||||
}
|
||||
|
||||
if (dmParamsSetString(imageTrackParams, DM_IMAGE_COMPRESSION,
|
||||
m_lwm->compression) != DM_SUCCESS) {
|
||||
dmParamsDestroy(imageTrackParams);
|
||||
throw TImageException(m_lwm->getFilePath(), "Unable to set compression");
|
||||
}
|
||||
|
||||
if (mvAddTrack(m_lwm->id, DM_IMAGE, imageTrackParams, NULL,
|
||||
&(m_lwm->imageTrack)) == DM_FAILURE) {
|
||||
dmParamsDestroy(imageTrackParams);
|
||||
throw TImageException(m_lwm->getFilePath(),
|
||||
"Unable to add image track to movie");
|
||||
}
|
||||
|
||||
dmParamsDestroy(imageTrackParams);
|
||||
m_lwm->m_initDone = true;
|
||||
}
|
||||
|
||||
if (mvInsertFrames(m_lwm->imageTrack, m_frameIndex, 1, lx * ly * pixSize,
|
||||
buffer) != DM_SUCCESS) {
|
||||
throw TImageException(m_lwm->getFilePath(),
|
||||
"Unable to write image to movie");
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// TLevelWriterMov
|
||||
//-----------------------------------------------------------
|
||||
|
||||
class TWriterInfoMov : public TWriterInfo {
|
||||
public:
|
||||
TWriterInfoMov() : TWriterInfo() { assert(!"Not implemented"); }
|
||||
~TWriterInfoMov() {}
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
TLevelWriterMov::TLevelWriterMov(const TFilePath &path)
|
||||
: TLevelWriter(path)
|
||||
, m_initDone(false)
|
||||
, m_rate(25)
|
||||
, m_IOError(QTNoError)
|
||||
, quality(DM_IMAGE_QUALITY_NORMAL)
|
||||
, compression(DM_IMAGE_QT_ANIM)
|
||||
, m_writerInfo(new TWriterInfoMov()) {
|
||||
DMparams *movieParams;
|
||||
|
||||
if (dmParamsCreate(&movieParams) != DM_SUCCESS) {
|
||||
m_IOError = QTCantCreateParams;
|
||||
return;
|
||||
}
|
||||
|
||||
if (mvSetMovieDefaults(movieParams, MV_FORMAT_QT) != DM_SUCCESS) {
|
||||
dmParamsDestroy(movieParams);
|
||||
m_IOError = QTCantCreateParams;
|
||||
return;
|
||||
}
|
||||
if (mvCreateFile(path.getFullPath().c_str(), movieParams, NULL, &id) ==
|
||||
DM_FAILURE) {
|
||||
static char m[1024];
|
||||
dmParamsDestroy(movieParams);
|
||||
m_IOError = QTCheckLibError;
|
||||
return;
|
||||
}
|
||||
|
||||
dmParamsDestroy(movieParams);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
void TLevelWriterMov::saveSoundTrack(TSoundTrack *) {
|
||||
throw TImageException(m_path,
|
||||
"TLevelWriterMov::saveSoundTrack not Implemented");
|
||||
}
|
||||
//-----------------------------------------------------------
|
||||
|
||||
TWriterInfo *TLevelWriterMov::getWriterInfo() const { return m_writerInfo; }
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
TLevelWriterMov::~TLevelWriterMov() {
|
||||
bool rc = (mvClose(id) == DM_SUCCESS);
|
||||
// if (!rc)
|
||||
// throw TImageException(getFilePath(), "Error closing mov file");
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
TImageWriterP TLevelWriterMov::getFrameWriter(TFrameId fid) {
|
||||
if (m_IOError) throw TImageException(m_path, buildQTErrorString(m_IOError));
|
||||
if (fid.getLetter() != 0) return TImageWriterP(0);
|
||||
int index = fid.getNumber() - 1;
|
||||
|
||||
TImageWriterMov *iwm = new TImageWriterMov(m_path, index, this);
|
||||
return TImageWriterP(iwm);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
TLevelReaderMov::TLevelReaderMov(const TFilePath &path)
|
||||
: TLevelReader(path)
|
||||
, IOError(QTNoError)
|
||||
|
||||
{
|
||||
m_status = mvOpenFile(path.getFullPath().c_str(), O_RDONLY, &movie);
|
||||
if (m_status != DM_SUCCESS) {
|
||||
IOError = QTCheckLibError;
|
||||
return;
|
||||
}
|
||||
track = 0;
|
||||
m_status = mvFindTrackByMedium(movie, DM_IMAGE, &track);
|
||||
if (m_status != DM_SUCCESS) {
|
||||
IOError = QTCheckLibError;
|
||||
return;
|
||||
}
|
||||
m_lx = mvGetImageWidth(track);
|
||||
m_ly = mvGetImageHeight(track);
|
||||
DMpacking packing = mvGetImagePacking(track);
|
||||
if (packing != DM_IMAGE_PACKING_XRGB) {
|
||||
IOError = QTPixelTypeError;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
|
||||
//------------------------------------------------
|
||||
// TImageReaderMov
|
||||
//------------------------------------------------
|
||||
|
||||
TImageReaderMov::TImageReaderMov(const TFilePath &path, int frameIndex,
|
||||
TLevelReaderMov *lrm)
|
||||
: TImageReader(path), m_lrm(lrm), m_frameIndex(frameIndex) {}
|
||||
|
||||
//------------------------------------------------
|
||||
|
||||
TLevelReaderMov::~TLevelReaderMov() { mvClose(movie); }
|
||||
|
||||
//------------------------------------------------
|
||||
|
||||
TLevelP TLevelReaderMov::loadInfo() {
|
||||
TLevelP level;
|
||||
if (IOError != QTNoError)
|
||||
throw TImageException(m_path, buildQTErrorString(IOError));
|
||||
|
||||
if (!track)
|
||||
throw TImageException(getFilePath().getFullPath().c_str(),
|
||||
" error reading info");
|
||||
|
||||
MVframe nFrames = mvGetTrackLength(track);
|
||||
if (nFrames == -1) return level;
|
||||
for (int i = 1; i <= nFrames; i++) level->setFrame(TFrameId(i), TImageP());
|
||||
return level;
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
|
||||
TImageP TImageReaderMov::load() {
|
||||
TRaster32P ret(m_lrm->m_lx, m_lrm->m_ly);
|
||||
|
||||
DMstatus status =
|
||||
mvReadFrames(m_lrm->track, m_frameIndex, 1, m_lrm->m_lx * m_lrm->m_ly * 4,
|
||||
ret->getRawData());
|
||||
if (status != DM_SUCCESS) {
|
||||
throw TImageException(getFilePath().getFullPath().c_str(),
|
||||
mvGetErrorStr(mvGetErrno()));
|
||||
}
|
||||
|
||||
// getImage()->setRaster(ret);
|
||||
return TRasterImageP(ret);
|
||||
}
|
||||
|
||||
//------------------------------------------------
|
||||
|
||||
TImageReaderP TLevelReaderMov::getFrameReader(TFrameId fid) {
|
||||
if (IOError != QTNoError)
|
||||
throw TImageException(m_path, buildQTErrorString(IOError));
|
||||
|
||||
if (fid.getLetter() != 0) return TImageReaderP(0);
|
||||
int index = fid.getNumber() - 1;
|
||||
|
||||
TImageReaderMov *irm = new TImageReaderMov(m_path, index, this);
|
||||
return TImageReaderP(irm);
|
||||
}
|
|
@ -1,504 +0,0 @@
|
|||
|
||||
|
||||
#if defined(x64) || defined(__LP64__) || defined(LINUX) || (defined(_WIN32) && defined(__GNUC__))
|
||||
|
||||
// Toonz includes
|
||||
#include "tfilepath.h"
|
||||
#include "trasterimage.h"
|
||||
#include "tstream.h"
|
||||
#include "timageinfo.h"
|
||||
#include "trop.h"
|
||||
#include "tsound.h"
|
||||
#include "tmsgcore.h"
|
||||
|
||||
// tipc includes
|
||||
#include "tipc.h"
|
||||
#include "t32bitsrv_wrap.h"
|
||||
|
||||
// Qt includes
|
||||
#include <QSharedMemory>
|
||||
#include <QMutexLocker>
|
||||
#include <QDataStream>
|
||||
|
||||
#include "tiio_mov_proxy.h"
|
||||
|
||||
/*
|
||||
For a list of supported commands through the 32-bit background server,
|
||||
see the related "t32libserver" project.
|
||||
*/
|
||||
|
||||
//******************************************************************************
|
||||
// Generic stuff implementation
|
||||
//******************************************************************************
|
||||
|
||||
bool IsQuickTimeInstalled() {
|
||||
#if !defined(__OSX__)
|
||||
// NOTE: This is *NOT* the same function as Tiio::isQuickTimeInstalled !!
|
||||
// There actually are 2 distinct functions with essentially the same name, one
|
||||
// in tnzcore lib, the other in image. The core version is currently NEVER
|
||||
// USED
|
||||
// throughout Toonz, even if it's EXPORT-defined.
|
||||
QLocalSocket socket;
|
||||
if (!tipc::startSlaveConnection(&socket, t32bitsrv::srvName(), 3000,
|
||||
t32bitsrv::srvCmdline()))
|
||||
return false;
|
||||
|
||||
tipc::Stream stream(&socket);
|
||||
tipc::Message msg;
|
||||
|
||||
stream << (msg << QString("$isQTInstalled"));
|
||||
|
||||
if (tipc::readMessage(stream, msg) != "yes") return false;
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
Tiio::MovWriterProperties::MovWriterProperties() {
|
||||
QLocalSocket socket;
|
||||
tipc::startSlaveConnection(&socket, t32bitsrv::srvName(), -1,
|
||||
t32bitsrv::srvCmdline());
|
||||
|
||||
tipc::Stream stream(&socket);
|
||||
tipc::Message msg;
|
||||
|
||||
// Retrieve a temporary file to pass the data
|
||||
QString fp;
|
||||
{
|
||||
stream << (msg << QString("$tmpfile_request") << QString("MovWriterProps"));
|
||||
|
||||
if (tipc::readMessage(stream, msg) != "ok") goto err;
|
||||
|
||||
msg >> fp;
|
||||
assert(!fp.isEmpty());
|
||||
}
|
||||
|
||||
// Make the server write the data to the file
|
||||
{
|
||||
stream << (msg << tipc::clr << QString("$defaultMovProps") << fp);
|
||||
if (tipc::readMessage(stream, msg) != "ok") goto err;
|
||||
|
||||
// Load the data
|
||||
TFilePath tfp(fp.toStdWString());
|
||||
TIStream is(tfp);
|
||||
loadData(is);
|
||||
}
|
||||
|
||||
// Release the temporary file
|
||||
{
|
||||
stream << (msg << tipc::clr << QString("$tmpfile_release")
|
||||
<< QString("MovWriterProps"));
|
||||
if (tipc::readMessage(stream, msg) != "ok") goto err;
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
err:
|
||||
|
||||
throw TException("Server error");
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
// TImageWriterMov Proxy implementation
|
||||
//******************************************************************************
|
||||
|
||||
class TImageWriterMovProxy final : public TImageWriter {
|
||||
TLevelWriterMov *m_lw;
|
||||
|
||||
public:
|
||||
int m_frameIndex;
|
||||
|
||||
public:
|
||||
TImageWriterMovProxy(const TFilePath &fp, int frameIndex,
|
||||
TLevelWriterMov *lw);
|
||||
~TImageWriterMovProxy();
|
||||
|
||||
bool is64bitOutputSupported() { return false; }
|
||||
void save(const TImageP &);
|
||||
|
||||
private:
|
||||
// not implemented
|
||||
TImageWriterMovProxy(const TImageWriterMovProxy &);
|
||||
TImageWriterMovProxy &operator=(const TImageWriterMovProxy &src);
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
TImageWriterMovProxy::TImageWriterMovProxy(const TFilePath &fp, int frameIndex,
|
||||
TLevelWriterMov *lw)
|
||||
: TImageWriter(fp), m_lw(lw), m_frameIndex(frameIndex) {
|
||||
m_lw->addRef();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
TImageWriterMovProxy::~TImageWriterMovProxy() { m_lw->release(); }
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void TImageWriterMovProxy::save(const TImageP &img) {
|
||||
m_lw->save(img, m_frameIndex);
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
// TLevelWriterMov Proxy implementation
|
||||
//******************************************************************************
|
||||
|
||||
TLevelWriterMov::TLevelWriterMov(const TFilePath &path, TPropertyGroup *winfo)
|
||||
: TLevelWriter(path, winfo) {
|
||||
static TAtomicVar count;
|
||||
unsigned int currCount = ++count;
|
||||
m_id = currCount;
|
||||
|
||||
QLocalSocket socket;
|
||||
tipc::startSlaveConnection(&socket, t32bitsrv::srvName(), -1,
|
||||
t32bitsrv::srvCmdline());
|
||||
|
||||
tipc::Stream stream(&socket);
|
||||
tipc::Message msg;
|
||||
|
||||
QString res, propsFp;
|
||||
if (winfo) {
|
||||
// Request a temporary file to store the infos to
|
||||
stream << (msg << QString("$tmpfile_request")
|
||||
<< QString("initLWMov") + QString::number(currCount));
|
||||
if (tipc::readMessage(stream, msg) != "ok") goto err;
|
||||
|
||||
msg >> propsFp >> tipc::clr;
|
||||
assert(!propsFp.isEmpty());
|
||||
|
||||
TFilePath propsTfp(propsFp.toStdWString());
|
||||
{
|
||||
TOStream os(propsTfp);
|
||||
winfo->saveData(os);
|
||||
}
|
||||
}
|
||||
|
||||
// Pass fp to the server
|
||||
stream << (msg << QString("$initLWMov") << m_id
|
||||
<< QString::fromStdWString(path.getWideString()) << propsFp);
|
||||
if (tipc::readMessage(stream, msg) != "ok") goto err;
|
||||
|
||||
if (winfo) {
|
||||
stream << (msg << tipc::clr << QString("$tmpfile_release")
|
||||
<< QString("initLWMov") + QString::number(currCount));
|
||||
if (tipc::readMessage(stream, msg) != "ok") goto err;
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
err:
|
||||
|
||||
throw TException("Unable to write file");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
TLevelWriterMov::~TLevelWriterMov() {
|
||||
QLocalSocket socket;
|
||||
tipc::startSlaveConnection(&socket, t32bitsrv::srvName(), -1,
|
||||
t32bitsrv::srvCmdline());
|
||||
|
||||
tipc::Stream stream(&socket);
|
||||
tipc::Message msg;
|
||||
QString res;
|
||||
|
||||
stream << (msg << QString("$closeLWMov") << m_id);
|
||||
if (tipc::readMessage(stream, msg) != "ok")
|
||||
DVGui::warning("Unable to write file");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void TLevelWriterMov::setFrameRate(double fps) {
|
||||
TLevelWriter::setFrameRate(fps);
|
||||
|
||||
QLocalSocket socket;
|
||||
tipc::startSlaveConnection(&socket, t32bitsrv::srvName(), -1,
|
||||
t32bitsrv::srvCmdline());
|
||||
|
||||
tipc::Stream stream(&socket);
|
||||
tipc::Message msg;
|
||||
QString res;
|
||||
|
||||
stream << (msg << QString("$LWMovSetFrameRate") << m_id << fps);
|
||||
if (tipc::readMessage(stream, msg) != "ok")
|
||||
throw TException("Unexpected error");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
TImageWriterP TLevelWriterMov::getFrameWriter(TFrameId fid) {
|
||||
if (fid.getLetter() != 0) return TImageWriterP(0);
|
||||
|
||||
int index = fid.getNumber() - 1;
|
||||
return new TImageWriterMovProxy(m_path, index, this);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void TLevelWriterMov::save(const TImageP &img, int frameIndex) {
|
||||
TRasterImageP ri(img);
|
||||
if (!img) throw TImageException(getFilePath(), "Unsupported image type");
|
||||
|
||||
TRasterP ras(ri->getRaster());
|
||||
|
||||
int lx = ras->getLx(), ly = ras->getLy(), pixSize = ras->getPixelSize();
|
||||
if (pixSize != 4)
|
||||
throw TImageException(getFilePath(), "Unsupported pixel type");
|
||||
|
||||
int size = lx * ly * pixSize;
|
||||
|
||||
// Send messages
|
||||
QLocalSocket socket;
|
||||
tipc::startSlaveConnection(&socket, t32bitsrv::srvName(), -1,
|
||||
t32bitsrv::srvCmdline());
|
||||
|
||||
tipc::Stream stream(&socket);
|
||||
tipc::Message msg;
|
||||
|
||||
// Send the write message.
|
||||
stream << (msg << QString("$LWMovImageWrite") << m_id << frameIndex << lx
|
||||
<< ly);
|
||||
|
||||
// Send the data through a shared memory segment
|
||||
{
|
||||
t32bitsrv::RasterExchanger<TPixel32> exch(ras);
|
||||
tipc::writeShMemBuffer(stream, msg << tipc::clr, size, &exch);
|
||||
}
|
||||
|
||||
if (tipc::readMessage(stream, msg) != "ok")
|
||||
throw TImageException(getFilePath(), "Couln't save image");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void TLevelWriterMov::saveSoundTrack(TSoundTrack *st) {
|
||||
if (st == 0) return;
|
||||
|
||||
// Prepare connection
|
||||
QLocalSocket socket;
|
||||
tipc::startSlaveConnection(&socket, t32bitsrv::srvName(), -1,
|
||||
t32bitsrv::srvCmdline());
|
||||
|
||||
unsigned int size = st->getSampleSize() * st->getSampleCount();
|
||||
|
||||
// Send the saveSoundTract command to the server
|
||||
tipc::Stream stream(&socket);
|
||||
tipc::Message msg;
|
||||
|
||||
stream << (msg << QString("$LWMovSaveSoundTrack") << m_id
|
||||
<< st->getSampleRate() << st->getBitPerSample()
|
||||
<< st->getChannelCount() << st->getSampleCount()
|
||||
<< st->getFormat().m_signedSample);
|
||||
|
||||
t32bitsrv::BufferExchanger exch((UCHAR *)st->getRawData());
|
||||
tipc::writeShMemBuffer(stream, msg << tipc::clr, size, &exch);
|
||||
|
||||
QString res(tipc::readMessage(stream, msg));
|
||||
assert(res == "ok");
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
// TImageReaderMov Proxy implementation
|
||||
//******************************************************************************
|
||||
|
||||
class TImageReaderMovProxy final : public TImageReader {
|
||||
TLevelReaderMov *m_lr;
|
||||
TImageInfo *m_info;
|
||||
|
||||
public:
|
||||
int m_frameIndex;
|
||||
|
||||
public:
|
||||
TImageReaderMovProxy(const TFilePath &fp, int frameIndex, TLevelReaderMov *lr,
|
||||
TImageInfo *info);
|
||||
~TImageReaderMovProxy() { m_lr->release(); }
|
||||
|
||||
TImageP load();
|
||||
void load(const TRasterP &rasP, const TPoint &pos = TPoint(0, 0),
|
||||
int shrinkX = 1, int shrinkY = 1);
|
||||
|
||||
TDimension getSize() const { return m_lr->getSize(); }
|
||||
TRect getBBox() const { return m_lr->getBBox(); }
|
||||
|
||||
const TImageInfo *getImageInfo() const { return m_info; }
|
||||
|
||||
private:
|
||||
// not implemented
|
||||
TImageReaderMovProxy(const TImageReaderMovProxy &);
|
||||
TImageReaderMovProxy &operator=(const TImageReaderMovProxy &src);
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
TImageReaderMovProxy::TImageReaderMovProxy(const TFilePath &fp, int frameIndex,
|
||||
TLevelReaderMov *lr,
|
||||
TImageInfo *info)
|
||||
: TImageReader(fp), m_lr(lr), m_frameIndex(frameIndex), m_info(info) {
|
||||
m_lr->addRef();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
TImageP TImageReaderMovProxy::load() {
|
||||
TRaster32P ras(m_lr->getSize());
|
||||
m_lr->load(ras, m_frameIndex, TPointI(), 1, 1);
|
||||
return TRasterImageP(ras);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void TImageReaderMovProxy::load(const TRasterP &rasP, const TPoint &pos,
|
||||
int shrinkX, int shrinkY) {
|
||||
// NOTE: The original implementation is different. But is also does not make
|
||||
// sense...
|
||||
// I've substituted it with the lrm plain call.
|
||||
m_lr->load(rasP, m_frameIndex, pos, shrinkX, shrinkY);
|
||||
}
|
||||
|
||||
//******************************************************************************
|
||||
// TLevelReaderMov Proxy implementation
|
||||
//******************************************************************************
|
||||
|
||||
TLevelReaderMov::TLevelReaderMov(const TFilePath &path) : TLevelReader(path) {
|
||||
static TAtomicVar count;
|
||||
unsigned int currCount = ++count;
|
||||
m_id = currCount;
|
||||
|
||||
QLocalSocket socket;
|
||||
tipc::startSlaveConnection(&socket, t32bitsrv::srvName(), -1,
|
||||
t32bitsrv::srvCmdline());
|
||||
|
||||
tipc::Stream stream(&socket);
|
||||
tipc::Message msg;
|
||||
|
||||
stream << (msg << QString("$initLRMov") << m_id
|
||||
<< QString::fromStdWString(path.getWideString()));
|
||||
if (tipc::readMessage(stream, msg) != "ok")
|
||||
throw TImageException(path, "Couldn't open file");
|
||||
|
||||
double frameRate;
|
||||
msg >> m_lx >> m_ly >> frameRate >> tipc::clr;
|
||||
|
||||
m_info = new TImageInfo;
|
||||
m_info->m_lx = m_lx;
|
||||
m_info->m_ly = m_ly;
|
||||
m_info->m_frameRate = frameRate;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
TLevelReaderMov::~TLevelReaderMov() {
|
||||
QLocalSocket socket;
|
||||
tipc::startSlaveConnection(&socket, t32bitsrv::srvName(), -1,
|
||||
t32bitsrv::srvCmdline());
|
||||
|
||||
tipc::Stream stream(&socket);
|
||||
tipc::Message msg;
|
||||
|
||||
stream << (msg << QString("$closeLRMov") << m_id);
|
||||
QString res(tipc::readMessage(stream, msg));
|
||||
assert(res == "ok");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
TImageReaderP TLevelReaderMov::getFrameReader(TFrameId fid) {
|
||||
if (fid.getLetter() != 0) return TImageReaderP(0);
|
||||
|
||||
int index = fid.getNumber() - 1;
|
||||
return new TImageReaderMovProxy(m_path, index, this, m_info);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
TLevelP TLevelReaderMov::loadInfo() {
|
||||
QLocalSocket socket;
|
||||
tipc::startSlaveConnection(&socket, t32bitsrv::srvName(), -1,
|
||||
t32bitsrv::srvCmdline());
|
||||
|
||||
tipc::Stream stream(&socket);
|
||||
tipc::Message msg;
|
||||
|
||||
TLevelP level;
|
||||
{
|
||||
QString shMemId(tipc::uniqueId());
|
||||
|
||||
// Send the appropriate command
|
||||
stream << (msg << QString("$LRMovLoadInfo") << m_id << shMemId);
|
||||
if (tipc::readMessage(stream, msg) != "ok") goto err;
|
||||
|
||||
int frameCount;
|
||||
|
||||
msg >> frameCount >> tipc::clr;
|
||||
|
||||
// Read the data in the shared memory segment
|
||||
QSharedMemory shmem(shMemId);
|
||||
shmem.attach();
|
||||
shmem.lock();
|
||||
|
||||
int *f, *fBegin = (int *)shmem.data(), *fEnd = fBegin + frameCount;
|
||||
assert(fBegin);
|
||||
|
||||
for (f = fBegin; f < fEnd; ++f) level->setFrame(*f, TImageP());
|
||||
|
||||
shmem.unlock();
|
||||
shmem.detach();
|
||||
|
||||
// Release the shared memory segment
|
||||
stream << (msg << QString("$shmem_release") << shMemId);
|
||||
if (tipc::readMessage(stream, msg) != "ok") goto err;
|
||||
}
|
||||
|
||||
return level;
|
||||
|
||||
err:
|
||||
|
||||
throw TException("Couldn't read movie data");
|
||||
return TLevelP();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void TLevelReaderMov::enableRandomAccessRead(bool enable) {
|
||||
QLocalSocket socket;
|
||||
tipc::startSlaveConnection(&socket, t32bitsrv::srvName(), -1,
|
||||
t32bitsrv::srvCmdline());
|
||||
|
||||
tipc::Stream stream(&socket);
|
||||
tipc::Message msg;
|
||||
|
||||
stream << (msg << QString("$LRMovEnableRandomAccessRead") << m_id
|
||||
<< QString(enable ? "true" : "false"));
|
||||
QString res(tipc::readMessage(stream, msg));
|
||||
assert(res == "ok");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
void TLevelReaderMov::load(const TRasterP &ras, int frameIndex,
|
||||
const TPoint &pos, int shrinkX, int shrinkY) {
|
||||
QLocalSocket socket;
|
||||
tipc::startSlaveConnection(&socket, t32bitsrv::srvName(), -1,
|
||||
t32bitsrv::srvCmdline());
|
||||
|
||||
tipc::Stream stream(&socket);
|
||||
tipc::Message msg;
|
||||
|
||||
unsigned int size = ras->getLx() * ras->getLy() * ras->getPixelSize();
|
||||
|
||||
// Send the appropriate command to the 32-bit server
|
||||
stream << (msg << QString("$LRMovImageRead") << m_id << ras->getLx()
|
||||
<< ras->getLy() << ras->getPixelSize() << frameIndex << pos.x
|
||||
<< pos.y << shrinkX << shrinkY);
|
||||
|
||||
t32bitsrv::RasterExchanger<TPixel32> exch(ras);
|
||||
if (!tipc::readShMemBuffer(stream, msg << tipc::clr, &exch))
|
||||
throw TException("Couldn't load image");
|
||||
}
|
||||
|
||||
#endif // x64
|
|
@ -1,89 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#ifndef TIIO_MOV_PROXY_H
|
||||
#define TIIO_MOV_PROXY_H
|
||||
|
||||
#if defined(x64) || defined(__LP64__) || defined(LINUX) || (defined(_WIN32) && defined(__GNUC__))
|
||||
|
||||
// Qt includes
|
||||
#include <QString>
|
||||
#include <QLocalSocket>
|
||||
|
||||
#include "tlevel_io.h"
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
// QuickTime check
|
||||
bool IsQuickTimeInstalled();
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
//******************************************************************************
|
||||
// TLevelWriterMov Proxy - delegates to a background 32-bit process
|
||||
//******************************************************************************
|
||||
|
||||
class TLevelWriterMov final : public TLevelWriter {
|
||||
unsigned int m_id;
|
||||
|
||||
public:
|
||||
TLevelWriterMov(const TFilePath &path, TPropertyGroup *winfo);
|
||||
~TLevelWriterMov();
|
||||
|
||||
void setFrameRate(double fps);
|
||||
|
||||
TImageWriterP getFrameWriter(TFrameId fid);
|
||||
void save(const TImageP &img, int frameIndex);
|
||||
|
||||
void saveSoundTrack(TSoundTrack *st);
|
||||
|
||||
public:
|
||||
static TLevelWriter *create(const TFilePath &f, TPropertyGroup *winfo) {
|
||||
return new TLevelWriterMov(f, winfo);
|
||||
};
|
||||
|
||||
QLocalSocket *socket();
|
||||
};
|
||||
|
||||
//******************************************************************************
|
||||
// TLevelReaderMov Proxy
|
||||
//******************************************************************************
|
||||
|
||||
class TLevelReaderMov final : public TLevelReader {
|
||||
unsigned int m_id;
|
||||
int m_lx, m_ly;
|
||||
|
||||
public:
|
||||
TLevelReaderMov(const TFilePath &path);
|
||||
~TLevelReaderMov();
|
||||
TImageReaderP getFrameReader(TFrameId fid);
|
||||
TLevelP loadInfo();
|
||||
|
||||
const TImageInfo *getImageInfo(TFrameId fid) { return m_info; }
|
||||
const TImageInfo *getImageInfo() { return m_info; }
|
||||
|
||||
void enableRandomAccessRead(bool enable);
|
||||
void load(const TRasterP &rasP, int frameIndex, const TPoint &pos,
|
||||
int shrinkX = 1, int shrinkY = 1);
|
||||
TDimension getSize() const { return TDimension(m_lx, m_ly); }
|
||||
TRect getBBox() const { return TRect(0, 0, m_lx - 1, m_ly - 1); }
|
||||
|
||||
public:
|
||||
static TLevelReader *create(const TFilePath &f) {
|
||||
return new TLevelReaderMov(f);
|
||||
}
|
||||
};
|
||||
|
||||
//===========================================================================
|
||||
|
||||
namespace Tiio {
|
||||
class MovWriterProperties final : public TPropertyGroup {
|
||||
public:
|
||||
MovWriterProperties();
|
||||
};
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
||||
#endif // x64
|
||||
|
||||
#endif // TIIO_MOV_PROXY_H
|
|
@ -22,18 +22,6 @@
|
|||
|
||||
#if !defined(x64) && !defined(__GNUC__)
|
||||
|
||||
#define list QuickTime_list
|
||||
#define map QuickTime_map
|
||||
#define iterator QuickTime_iterator
|
||||
#define float_t QuickTime_float_t
|
||||
#define GetProcessInformation QuickTime_GetProcessInformation
|
||||
#define int_fast8_t QuickTime_int_fast8_t
|
||||
#define int_fast16_t QuickTime_int_fast16_t
|
||||
#define uint_fast16_t QuickTime_uint_fast16_t
|
||||
|
||||
#include "QuickTimeComponents.h"
|
||||
#include "tquicktime.h"
|
||||
|
||||
#undef list
|
||||
#undef map
|
||||
#undef iterator
|
||||
|
@ -45,22 +33,12 @@
|
|||
|
||||
#endif
|
||||
|
||||
#include "./mov/tiio_mov.h"
|
||||
#include "./3gp/tiio_3gp.h"
|
||||
#include "./zcc/tiio_zcc.h"
|
||||
|
||||
#elif defined(MACOSX)
|
||||
#include "./mov/tiio_movM.h"
|
||||
#include "./3gp/tiio_3gpM.h"
|
||||
|
||||
#elif defined(LINUX) // No more supported by the way...
|
||||
// #include "./mov/tiio_movL.h"
|
||||
#include "./mov/tiio_mov_proxy.h"
|
||||
#include "./3gp/tiio_3gp_proxy.h"
|
||||
#endif
|
||||
|
||||
// Common includes
|
||||
#include "./quantel/tiio_quantel.h"
|
||||
//#include "./quantel/tiio_quantel.h"
|
||||
#include "./sgi/tiio_sgi.h"
|
||||
#include "./tga/tiio_tga.h"
|
||||
#include "./png/tiio_png.h"
|
||||
|
@ -116,10 +94,6 @@ void initImageIo(bool lightVersion) {
|
|||
Tiio::defineWriterMaker("plt", Tiio::makePltWriter, false);
|
||||
TFileType::declare("plt", TFileType::RASTER_IMAGE);
|
||||
|
||||
Tiio::defineReaderMaker("nol", Tiio::makePngReader);
|
||||
Tiio::defineWriterMaker("nol", Tiio::makePngWriter, false);
|
||||
TFileType::declare("nol", TFileType::RASTER_IMAGE);
|
||||
|
||||
TLevelWriter::define("psd", TLevelWriterPsd::create, false);
|
||||
TLevelReader::define("psd", TLevelReaderPsd::create);
|
||||
TFileType::declare("psd", TFileType::RASTER_LEVEL);
|
||||
|
@ -200,31 +174,4 @@ void initImageIo(bool lightVersion) {
|
|||
|
||||
#endif // _WIN32
|
||||
|
||||
if (IsQuickTimeInstalled()) {
|
||||
TLevelWriter::define("mov", TLevelWriterMov::create, true);
|
||||
TLevelReader::define("mov", TLevelReaderMov::create);
|
||||
TFileType::declare("mov", TFileType::RASTER_LEVEL);
|
||||
Tiio::defineWriterProperties("mov", new Tiio::MovWriterProperties());
|
||||
|
||||
TLevelWriter::define("3gp", TLevelWriter3gp::create, false);
|
||||
TLevelReader::define("3gp", TLevelReader3gp::create);
|
||||
TFileType::declare("3gp", TFileType::RASTER_LEVEL);
|
||||
Tiio::defineWriterProperties("3gp", new Tiio::MovWriterProperties());
|
||||
}
|
||||
|
||||
/*
|
||||
#if (defined(_WIN32) && !defined(x64))
|
||||
TLevelWriter::define("pct", TLevelWriterPicPct::create, true);
|
||||
TLevelReader::define("pct", TLevelReaderPicPct::create);
|
||||
TFileType::declare("pct", TFileType::RASTER_LEVEL);
|
||||
Tiio::defineWriterProperties("pct", new Tiio::PctWriterProperties());
|
||||
TLevelWriter::define("pic", TLevelWriterPicPct::create, true);
|
||||
TLevelReader::define("pic", TLevelReaderPicPct::create);
|
||||
TFileType::declare("pic", TFileType::RASTER_LEVEL);
|
||||
TLevelWriter::define("pict", TLevelWriterPicPct::create, true);
|
||||
TLevelReader::define("pict", TLevelReaderPicPct::create);
|
||||
TFileType::declare("pict", TFileType::RASTER_LEVEL);
|
||||
Tiio::defineWriterProperties("pict", new Tiio::PctWriterProperties());
|
||||
#endif // _WIN32 && 32-bit
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -248,14 +248,6 @@ typedef struct {
|
|||
|
||||
/*---------------------------------------------------------------*/
|
||||
|
||||
/*TNZMOVIE_QUALITY pct_quality;
|
||||
TNZMOVIE_COMPRESSION pct_compression;
|
||||
*/
|
||||
/*---------------------------------------------------------------*/
|
||||
/*
|
||||
TNZMOVIE_QUALITY mov_quality;
|
||||
TNZMOVIE_COMPRESSION mov_compression;
|
||||
*/
|
||||
int avi_bpp;
|
||||
char *avi_compression;
|
||||
} IMG_IO_SETTINGS;
|
||||
|
|
|
@ -1,80 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#ifndef TMOVSETTINGS_INCLUDED
|
||||
#define TMOVSETTINGS_INCLUDED
|
||||
|
||||
#undef DVAPI
|
||||
#undef DVVAR
|
||||
#ifdef TNZCORE_EXPORTS
|
||||
#define DVAPI DV_EXPORT_API
|
||||
#define DVVAR DV_EXPORT_VAR
|
||||
#else
|
||||
#define DVAPI DV_IMPORT_API
|
||||
#define DVVAR DV_IMPORT_VAR
|
||||
#endif
|
||||
|
||||
#if !defined(x64) && !defined(__LP64__) && !defined(LINUX) && !(defined(__GNUC__) && defined(_WIN32))
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#define list QuickTime_list
|
||||
#define map QuickTime_map
|
||||
#define iterator QuickTime_iterator
|
||||
#define float_t QuickTime_float_t
|
||||
#define GetProcessInformation QuickTime_GetProcessInformation
|
||||
#define int_fast8_t QuickTime_int_fast8_t
|
||||
#define int_fast16_t QuickTime_int_fast16_t
|
||||
#define uint_fast16_t QuickTime_uint_fast16_t
|
||||
|
||||
#include "QTML.h"
|
||||
#include "Movies.h"
|
||||
#include "Script.h"
|
||||
#include "FixMath.h"
|
||||
#include "Sound.h"
|
||||
|
||||
#include "QuickTimeComponents.h"
|
||||
#include "tquicktime.h"
|
||||
|
||||
#undef list
|
||||
#undef map
|
||||
#undef iterator
|
||||
#undef float_t
|
||||
#undef GetProcessInformation
|
||||
#undef int_fast8_t
|
||||
#undef int_fast16_t
|
||||
#undef uint_fast16_t
|
||||
|
||||
#include "texception.h"
|
||||
#include "tpropertytype.h"
|
||||
//#include "timageinfo.h"
|
||||
//#include "tlevel_io.h"
|
||||
#include "tproperty.h"
|
||||
|
||||
#else // _WIN32
|
||||
|
||||
#define list List
|
||||
#define map Map
|
||||
#define iterator Iterator
|
||||
#undef float_t
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <QuickTime/Movies.h>
|
||||
#include <QuickTime/ImageCompression.h>
|
||||
#include <QuickTime/QuickTimeComponents.h>
|
||||
|
||||
#undef list
|
||||
#undef map
|
||||
#undef iterator
|
||||
#undef float_t
|
||||
|
||||
#endif // !_WIN32
|
||||
|
||||
void DVAPI fromPropertiesToAtoms(TPropertyGroup &pg, QTAtomContainer &atoms);
|
||||
void DVAPI fromAtomsToProperties(const QTAtomContainer &atoms,
|
||||
TPropertyGroup &pg);
|
||||
|
||||
#endif //! 64 bit
|
||||
|
||||
void DVAPI openMovSettingsPopup(TPropertyGroup *props,
|
||||
bool macBringToFront = false);
|
||||
|
||||
#endif
|
|
@ -1,103 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#ifndef T32BITSRV_WRAP
|
||||
#define T32BITSRV_WRAP
|
||||
|
||||
// TnzBase includes
|
||||
#include "tenv.h"
|
||||
|
||||
// TnzCore includes
|
||||
#include "tcommon.h"
|
||||
#include "traster.h"
|
||||
#include "tipc.h"
|
||||
|
||||
// Qt includes
|
||||
#include <QCoreApplication>
|
||||
#include <QDir>
|
||||
|
||||
#undef DVAPI
|
||||
#undef DVVAR
|
||||
#ifdef TNZCORE_EXPORTS
|
||||
#define DVAPI DV_EXPORT_API
|
||||
#define DVVAR DV_EXPORT_VAR
|
||||
#else
|
||||
#define DVAPI DV_IMPORT_API
|
||||
#define DVVAR DV_IMPORT_VAR
|
||||
#endif
|
||||
|
||||
/*
|
||||
This file contains the platform-specific command lines and server names to
|
||||
address 64-bit Toonz's background 32-bit process (used to deal with QuickTime,
|
||||
to say one).
|
||||
*/
|
||||
|
||||
namespace t32bitsrv {
|
||||
|
||||
//*************************************************************************************
|
||||
// Platform-specific Server Command Lines
|
||||
//*************************************************************************************
|
||||
|
||||
static QString srvName() {
|
||||
static QString name(tipc::applicationSpecificServerName("t32bitsrv"));
|
||||
return name;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
static QString srvCmdline() {
|
||||
static QString cmd("srv/t32bitsrv.exe " + srvName());
|
||||
return cmd;
|
||||
}
|
||||
#else
|
||||
static QString srvCmdline() {
|
||||
return "\"" + QCoreApplication::applicationDirPath() + "/t32bitsrv\" " +
|
||||
srvName();
|
||||
}
|
||||
#endif
|
||||
|
||||
//*************************************************************************************
|
||||
// Buffer data exchanger
|
||||
//*************************************************************************************
|
||||
|
||||
class DVAPI BufferExchanger final : public tipc::ShMemReader,
|
||||
public tipc::ShMemWriter {
|
||||
UCHAR *m_buf;
|
||||
UCHAR *m_data;
|
||||
|
||||
public:
|
||||
BufferExchanger(UCHAR *buf) : m_buf(buf), m_data(buf) {}
|
||||
~BufferExchanger() {}
|
||||
|
||||
UCHAR *buffer() const { return m_buf; }
|
||||
|
||||
int read(const char *srcBuf, int len) override;
|
||||
int write(char *dstBuf, int len) override;
|
||||
};
|
||||
|
||||
//*************************************************************************************
|
||||
// Raster data exchanger
|
||||
//*************************************************************************************
|
||||
|
||||
template <typename PIXEL>
|
||||
class DVAPI RasterExchanger final : public tipc::ShMemReader,
|
||||
public tipc::ShMemWriter {
|
||||
typedef PIXEL pix_type;
|
||||
|
||||
TRasterPT<PIXEL> m_ras;
|
||||
PIXEL *m_pix;
|
||||
|
||||
public:
|
||||
RasterExchanger(TRasterP ras) : m_ras(ras) {
|
||||
m_ras->lock();
|
||||
m_pix = m_ras->pixels(0);
|
||||
}
|
||||
~RasterExchanger() { m_ras->unlock(); }
|
||||
|
||||
TRasterP raster() const { return m_ras; }
|
||||
|
||||
int read(const char *srcBuf, int len) override;
|
||||
int write(char *dstBuf, int len) override;
|
||||
};
|
||||
|
||||
} // namespace t32bitsrv
|
||||
|
||||
#endif // T32BITSRV_WRAP
|
|
@ -170,8 +170,6 @@ DVAPI void defineVectorWriterMaker(const char *ext, Tiio::VectorWriterMaker *fn,
|
|||
|
||||
DVAPI void defineWriterProperties(const char *ext, TPropertyGroup *);
|
||||
|
||||
DVAPI bool isQuicktimeInstalled();
|
||||
|
||||
DVAPI void updateFileWritersPropertiesTranslation();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
|
|
@ -226,7 +226,7 @@ public:
|
|||
// Some useful utility inlines
|
||||
|
||||
inline bool isMovieType(std::string type) {
|
||||
return (type == "mov" || type == "avi" || type == "3gp" || type == "webm" ||
|
||||
return (type == "avi" || type == "webm" ||
|
||||
type == "mp4");
|
||||
}
|
||||
|
||||
|
@ -241,7 +241,7 @@ inline bool isMovieType(const TFilePath &fp) {
|
|||
|
||||
inline bool doesSupportRandomAccess(const TFilePath &fp,
|
||||
bool isToonzOutput = false) {
|
||||
return (fp.getDots() == "..") || (isToonzOutput && fp.getType() == "mov");
|
||||
return (fp.getDots() == "..");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include "tcm.h"
|
||||
#include "machine.h"
|
||||
#include "pixel.h"
|
||||
#include "tnzmovie.h"
|
||||
|
||||
#undef TNZAPI
|
||||
#ifdef TNZ_IS_IMAGELIB
|
||||
|
@ -124,16 +123,6 @@ typedef struct {
|
|||
|
||||
IMG_CM_ALGORITHM cm_algorithm;
|
||||
|
||||
/*---------------------------------------------------------------*/
|
||||
|
||||
TNZMOVIE_QUALITY pct_quality;
|
||||
TNZMOVIE_COMPRESSION pct_compression;
|
||||
|
||||
/*---------------------------------------------------------------*/
|
||||
|
||||
TNZMOVIE_QUALITY mov_quality;
|
||||
TNZMOVIE_COMPRESSION mov_compression;
|
||||
|
||||
int avi_bpp;
|
||||
char *avi_compression;
|
||||
} IMG_IO_SETTINGS;
|
||||
|
|
|
@ -1,147 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#ifndef _QT_MOVIE_H_
|
||||
#define _QT_MOVIE_H_
|
||||
|
||||
/**************************************************************
|
||||
This APIs permit to handle MACINTOSH QUICKTIME movies.
|
||||
They are intended only for creation; viewing and updating movies
|
||||
is not currently supported.
|
||||
Moreover, image insertion is not permitted; only appending.
|
||||
To view .mov file, use quicktime tools present on both NT(movieplayer)
|
||||
and IRIX(movieplayer, moviemaker) platform.
|
||||
The .mov created are cross-platform
|
||||
**************************************************************/
|
||||
|
||||
#include "toonz4.6/toonz.h"
|
||||
#include "tsound.h"
|
||||
|
||||
#undef TNZAPI
|
||||
#ifdef TNZ_IS_IMAGELIB
|
||||
#define TNZAPI TNZ_EXPORT_API
|
||||
#else
|
||||
#define TNZAPI TNZ_IMPORT_API
|
||||
#endif
|
||||
|
||||
#undef TNZAPI2
|
||||
#ifdef TNZ_IS_COMMONLIB
|
||||
#define TNZAPI2 TNZ_EXPORT_API
|
||||
#else
|
||||
#define TNZAPI2 TNZ_IMPORT_API
|
||||
#endif
|
||||
|
||||
/*opaque definition for the movie object*/
|
||||
|
||||
typedef struct TNZMOVIE_DATA *TNZMOVIE;
|
||||
|
||||
typedef struct _RASTER *MY_RASTER; /*to avoid raster.h inclusion */
|
||||
|
||||
/* Warning: TNZMOVIE_TYPE makes sense only on NT; on IRIX is always RGBX*/
|
||||
|
||||
typedef enum TNZMOVIE_TYPE {
|
||||
TM_RGBX_TYPE = 0,
|
||||
TM_RGB16_TYPE,
|
||||
TM_RGB8_TYPE,
|
||||
TM_BW_TYPE,
|
||||
TM_HOW_MANY_TYPE
|
||||
} TNZMOVIE_TYPE;
|
||||
|
||||
typedef enum TNZMOVIE_QUALITY {
|
||||
TM_MIN_QUALITY = 0,
|
||||
TM_LOW_QUALITY,
|
||||
TM_NORMAL_QUALITY,
|
||||
TM_HIGH_QUALITY,
|
||||
TM_MAX_QUALITY,
|
||||
TM_LOSSLESS_QUALITY,
|
||||
TM_HOW_MANY_QUALITY
|
||||
} TNZMOVIE_QUALITY;
|
||||
|
||||
#ifdef WIN32
|
||||
typedef int TNZMOVIE_COMPRESSION;
|
||||
#else
|
||||
typedef enum TNZMOVIE_COMPRESSION {
|
||||
TM_JPG_COMPRESSION = 0,
|
||||
TM_VIDEO_COMPRESSION,
|
||||
TM_ANIM_COMPRESSION,
|
||||
TM_CINEPAK_COMPRESSION,
|
||||
TM_HOW_MANY_COMPRESSION
|
||||
} TNZMOVIE_COMPRESSION;
|
||||
|
||||
#endif
|
||||
|
||||
typedef unsigned long CodecQ;
|
||||
typedef unsigned long CodecType;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
TNZAPI2 TBOOL tnz_movies_available(void);
|
||||
TNZAPI2 TBOOL tnz_avi_available(void);
|
||||
|
||||
TNZAPI2 TBOOL get_movie_codec_info(char ***quality_string, int *numQ, int *defQ,
|
||||
char ***compression_string, int *numC,
|
||||
int *defC);
|
||||
|
||||
/*
|
||||
#ifdef WIN32
|
||||
TNZAPI2 TBOOL get_movie_codec_val(char *quality_string, ULONG *quality_val,
|
||||
char *compression_string, ULONG
|
||||
*compression_val);
|
||||
#else
|
||||
*/
|
||||
TNZAPI2 TBOOL get_movie_codec_val(char *quality_string,
|
||||
TNZMOVIE_QUALITY *quality_val,
|
||||
char *compression_string,
|
||||
TNZMOVIE_COMPRESSION *compression_val);
|
||||
|
||||
/*
|
||||
#endif
|
||||
*/
|
||||
|
||||
#ifndef WIN32
|
||||
TNZAPI2 TBOOL get_movie_codec_info(char ***quality_string, int *numQ, int *defQ,
|
||||
char ***compression_string, int *numC,
|
||||
int *defC);
|
||||
|
||||
#endif
|
||||
|
||||
TNZAPI2 CodecQ tm_get_quality(int quality);
|
||||
TNZAPI2 CodecType tm_get_compression(int compression);
|
||||
|
||||
/**************************************************************
|
||||
This function creates and open a new movie, ready to append images;
|
||||
NIL is returned on error; Remember to use tm_close
|
||||
when finished!!!
|
||||
**************************************************************/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
TNZAPI TNZMOVIE tm_create(char *fullpathname, TBOOL do_overwrite_file,
|
||||
TNZMOVIE_TYPE type, int rate, int lx, int ly,
|
||||
TNZMOVIE_QUALITY quality,
|
||||
TNZMOVIE_COMPRESSION compression);
|
||||
|
||||
/**************************************************************
|
||||
Warning: raster lx and ly must be the same of the movie.
|
||||
Raster is converted to the suitable format(cloning it)
|
||||
**************************************************************/
|
||||
|
||||
TNZAPI TBOOL tm_append_raster(TNZMOVIE movie, MY_RASTER r);
|
||||
|
||||
/**************************************************************
|
||||
Append a .wav(NT) or .aiff(IRIX) audio file to the movie.
|
||||
The length of the resulting movie is forced to be equal to the video track,
|
||||
so any overflowing audio is truncated. For this reason, is adviced to add
|
||||
the audio when the video part has been completely added.
|
||||
The position can be a negative value too;
|
||||
If 'position' is >0, the audio track is added beginning from video frame
|
||||
'position'.
|
||||
If 'position' is <0, the audio is added starting from audio frame 'position',
|
||||
at the beginning of video track.
|
||||
**************************************************************/
|
||||
|
||||
TNZAPI TBOOL tm_add_audio_track(TNZMOVIE movie, char *audiofullpathname,
|
||||
int img_offs, int audio_offs, int frames,
|
||||
TS_STRACK audioTrack);
|
||||
|
||||
TNZAPI TBOOL tm_close(TNZMOVIE movie);
|
||||
|
||||
#endif
|
|
@ -1,10 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#ifndef TQUICKTIME_INCLUDED
|
||||
#define TQUICKTIME_INCLUDED
|
||||
|
||||
struct PixelXRGB {
|
||||
UCHAR x, r, g, b;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,40 +0,0 @@
|
|||
add_executable(t32bitsrv
|
||||
main.cpp
|
||||
t323gpmsg.cpp
|
||||
t323gpmsg.h
|
||||
t32fontmsg.cpp
|
||||
t32fontmsg.h
|
||||
t32movmsg.cpp
|
||||
t32movmsg.h
|
||||
)
|
||||
|
||||
if(BUILD_TARGET_WIN)
|
||||
include_directories(
|
||||
SYSTEM
|
||||
${SDKROOT}/quicktime/QT73SDK/CIncludes
|
||||
)
|
||||
endif()
|
||||
|
||||
target_link_libraries(t32bitsrv
|
||||
Qt5::Core
|
||||
Qt5::Network
|
||||
tnzcore
|
||||
image
|
||||
)
|
||||
|
||||
if(BUILD_ENV_APPLE AND PLATFORM EQUAL 32)
|
||||
get_target_property(bin t32bitsrv LOCATION)
|
||||
get_filename_component(bindir ${bin} DIRECTORY)
|
||||
|
||||
get_target_property(loc tnzcore LOCATION)
|
||||
add_custom_command(TARGET t32bitsrv POST_BUILD COMMAND cp ${loc} ${bindir})
|
||||
get_target_property(loc image LOCATION)
|
||||
add_custom_command(TARGET t32bitsrv POST_BUILD COMMAND cp ${loc} ${bindir})
|
||||
get_target_property(loc tnzbase LOCATION)
|
||||
add_custom_command(TARGET t32bitsrv POST_BUILD COMMAND cp ${loc} ${bindir})
|
||||
|
||||
add_custom_command(TARGET t32bitsrv
|
||||
POST_BUILD COMMAND
|
||||
${CMAKE_INSTALL_NAME_TOOL} -add_rpath @executable_path/. ${bin}
|
||||
)
|
||||
endif()
|
|
@ -1,90 +0,0 @@
|
|||
|
||||
|
||||
#if (!(defined(x64) || defined(__LP64__) || defined(LINUX)))
|
||||
|
||||
// Toonz includes
|
||||
#include "tiio_std.h"
|
||||
#include "tnzimage.h"
|
||||
|
||||
// Qt includes
|
||||
#include <QCoreApplication>
|
||||
#include <QThread>
|
||||
|
||||
// tipc includes
|
||||
#include "tipcmsg.h"
|
||||
#include "tipcsrv.h"
|
||||
|
||||
// Specific Parsers includes
|
||||
#include "t32movmsg.h"
|
||||
#include "t323gpmsg.h"
|
||||
#include "t32fontmsg.h"
|
||||
|
||||
//************************************************************************
|
||||
// Server Thread
|
||||
//************************************************************************
|
||||
|
||||
class ServerThread : public QThread {
|
||||
QString m_srvName;
|
||||
|
||||
public:
|
||||
ServerThread(const QString &srvName) : m_srvName(srvName) {}
|
||||
|
||||
void run() override {
|
||||
// Start a local server receiving connections on the specified key
|
||||
tipc::Server server;
|
||||
mov_io::addParsers(&server);
|
||||
_3gp_io::addParsers(&server);
|
||||
#ifdef MACOSX
|
||||
font_io::addParsers(&server);
|
||||
#endif
|
||||
|
||||
// Start listening on supplied key
|
||||
bool ok = server.listen(m_srvName);
|
||||
|
||||
exec();
|
||||
}
|
||||
};
|
||||
|
||||
//************************************************************************
|
||||
// Main server implementation
|
||||
//************************************************************************
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
if (argc < 2) // The server key name must be passed
|
||||
return -1;
|
||||
|
||||
QCoreApplication a(argc, argv);
|
||||
|
||||
Tiio::defineStd();
|
||||
initImageIo();
|
||||
|
||||
QString srvName(QString::fromUtf8(argv[1]));
|
||||
QString mainSrvName(srvName + "_main");
|
||||
|
||||
QLocalServer::removeServer(srvName);
|
||||
QLocalServer::removeServer(mainSrvName);
|
||||
|
||||
// Start a separate thread to host most of the event processing
|
||||
ServerThread *srvThread = new ServerThread(srvName);
|
||||
srvThread->start();
|
||||
|
||||
// Start a server on the main thread too - this one to host
|
||||
// commands that need to be explicitly performed on the main thread
|
||||
tipc::Server server;
|
||||
mov_io::addParsers(&server);
|
||||
_3gp_io::addParsers(&server);
|
||||
#ifdef MACOSX
|
||||
font_io::addParsers(&server);
|
||||
#endif
|
||||
|
||||
// Start listening on supplied key
|
||||
bool ok = server.listen(srvName + "_main");
|
||||
|
||||
a.exec();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int main(int argc, char *argv[]) { return 0; }
|
||||
|
||||
#endif // !x64 && !__LP64__
|
|
@ -1,349 +0,0 @@
|
|||
|
||||
|
||||
#if (!(defined(x64) || defined(__LP64__) || defined(LINUX)))
|
||||
|
||||
// Toonz stuff
|
||||
#include "tiio.h"
|
||||
#include "timage_io.h"
|
||||
#include "tlevel_io.h"
|
||||
#include "trasterimage.h"
|
||||
#include "traster.h"
|
||||
#include "tstream.h"
|
||||
#include "movsettings.h"
|
||||
#include "tproperty.h"
|
||||
#include "tsound.h"
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include "../image/3gp/tiio_3gp.h"
|
||||
#elif defined(MACOSX)
|
||||
#include "../image/3gp/tiio_3gpM.h"
|
||||
#endif
|
||||
|
||||
// Qt stuff
|
||||
#include <QString>
|
||||
#include <QHash>
|
||||
#include <QSharedMemory>
|
||||
#include <QDebug>
|
||||
|
||||
#include <QLocalSocket>
|
||||
#include <QDataStream>
|
||||
|
||||
// tipc includes
|
||||
#include "tipc.h"
|
||||
#include "tipcmsg.h"
|
||||
#include "tipcsrv.h"
|
||||
#include "t32bitsrv_wrap.h"
|
||||
|
||||
#include "t323gpmsg.h"
|
||||
|
||||
//---------------------------------------------------
|
||||
|
||||
// Local namespace stuff
|
||||
|
||||
namespace {
|
||||
QHash<unsigned int, TLevelReaderP> readers;
|
||||
QHash<unsigned int, TLevelWriterP> writers;
|
||||
}
|
||||
|
||||
//---------------------------------------------------
|
||||
|
||||
using namespace tipc;
|
||||
|
||||
namespace _3gp_io {
|
||||
|
||||
void addParsers(tipc::Server *srv) {
|
||||
srv->addParser(new InitLW3gpParser);
|
||||
srv->addParser(new LWSetFrameRateParser);
|
||||
srv->addParser(new LWImageWriteParser);
|
||||
srv->addParser(new LWSaveSoundTrackParser);
|
||||
srv->addParser(new CloseLW3gpParser);
|
||||
srv->addParser(new InitLR3gpParser);
|
||||
srv->addParser(new LRLoadInfoParser);
|
||||
srv->addParser(new LREnableRandomAccessReadParser);
|
||||
srv->addParser(new LRImageReadParser);
|
||||
srv->addParser(new CloseLR3gpParser);
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// InitLWMov Parser
|
||||
//************************************************************************
|
||||
|
||||
void InitLW3gpParser::operator()(Message &msg) {
|
||||
unsigned int id;
|
||||
QString fp, propsFp;
|
||||
msg >> id >> fp >> propsFp >> clr;
|
||||
|
||||
TFilePath tfp(fp.toStdWString()), propsTFp(propsFp.toStdWString());
|
||||
|
||||
try {
|
||||
TPropertyGroup *props = 0;
|
||||
if (!propsTFp.isEmpty()) {
|
||||
props = new TPropertyGroup;
|
||||
|
||||
TIStream is(propsTFp);
|
||||
props->loadData(is);
|
||||
}
|
||||
|
||||
writers.insert(id, TLevelWriterP(tfp, props));
|
||||
|
||||
msg << QString("ok");
|
||||
} catch (...) {
|
||||
msg << QString("err");
|
||||
}
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// LWsetFrameRate Parser
|
||||
//************************************************************************
|
||||
|
||||
void LWSetFrameRateParser::operator()(Message &msg) {
|
||||
unsigned int id;
|
||||
double fps;
|
||||
|
||||
msg >> id >> fps >> clr;
|
||||
|
||||
writers.find(id).value()->setFrameRate(fps);
|
||||
|
||||
msg << QString("ok");
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// LWImageWrite Parser
|
||||
//************************************************************************
|
||||
|
||||
void LWImageWriteParser::operator()(Message &msg) {
|
||||
unsigned int id;
|
||||
int frameIdx, lx, ly;
|
||||
|
||||
msg >> id >> frameIdx >> lx >> ly;
|
||||
|
||||
// Read the data through a shared memory segment
|
||||
TRaster32P ras(lx, ly);
|
||||
t32bitsrv::RasterExchanger<TPixel32> exch(ras);
|
||||
tipc::readShMemBuffer(*stream(), msg, &exch);
|
||||
|
||||
// Save the image
|
||||
try {
|
||||
TImageWriterP iw(writers.find(id).value()->getFrameWriter(frameIdx + 1));
|
||||
iw->save(TRasterImageP(ras));
|
||||
|
||||
msg << QString("ok");
|
||||
} catch (...) {
|
||||
msg << QString("err");
|
||||
}
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// LWSaveSoundTrack Parser
|
||||
//************************************************************************
|
||||
|
||||
void LWSaveSoundTrackParser::operator()(Message &msg) {
|
||||
unsigned int id;
|
||||
QString shMemId;
|
||||
|
||||
TUINT32 sampleRate;
|
||||
TINT32 sCount;
|
||||
int bps, chanCount;
|
||||
bool signedSample;
|
||||
|
||||
msg >> id >> sampleRate >> bps >> chanCount >> sCount >> signedSample;
|
||||
|
||||
// Retrieve the soundtrack buffer
|
||||
TSoundTrackP st =
|
||||
TSoundTrack::create(sampleRate, bps, chanCount, sCount, signedSample);
|
||||
t32bitsrv::BufferExchanger exch((UCHAR *)st->getRawData());
|
||||
tipc::readShMemBuffer(*stream(), msg, &exch);
|
||||
|
||||
// Write the soundtrack
|
||||
try {
|
||||
writers.find(id).value()->saveSoundTrack(st.getPointer());
|
||||
msg << QString("ok");
|
||||
} catch (...) {
|
||||
msg << QString("err");
|
||||
}
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// CloseLW3gp Parser
|
||||
//************************************************************************
|
||||
|
||||
void CloseLW3gpParser::operator()(Message &msg) {
|
||||
unsigned int id;
|
||||
msg >> id >> clr;
|
||||
|
||||
try {
|
||||
writers.take(id);
|
||||
msg << QString("ok");
|
||||
} catch (...) {
|
||||
msg << QString("err");
|
||||
}
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// InitLR3gp Parser
|
||||
//************************************************************************
|
||||
|
||||
void InitLR3gpParser::operator()(Message &msg) {
|
||||
unsigned int id;
|
||||
QString fp, propsFp;
|
||||
msg >> id >> fp >> clr;
|
||||
assert(!fp.isEmpty());
|
||||
|
||||
TFilePath tfp(fp.toStdWString());
|
||||
|
||||
try {
|
||||
TLevelReaderP lrm(tfp);
|
||||
|
||||
// Extract some info to be returned
|
||||
const TImageInfo *info = lrm->getImageInfo();
|
||||
if (!info) throw TImageException(tfp, "Couldn't retrieve image properties");
|
||||
|
||||
int lx = info->m_lx, ly = info->m_ly;
|
||||
double frameRate = info->m_frameRate;
|
||||
|
||||
readers.insert(id, lrm);
|
||||
|
||||
msg << QString("ok") << lx << ly << frameRate;
|
||||
} catch (...) {
|
||||
msg << QString("err");
|
||||
}
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// LRLoadInfo Parser
|
||||
//************************************************************************
|
||||
|
||||
void LRLoadInfoParser::operator()(Message &msg) {
|
||||
// Read command data
|
||||
unsigned int id;
|
||||
QString shMemId;
|
||||
msg >> id >> shMemId >> clr;
|
||||
|
||||
QHash<unsigned int, TLevelReaderP>::iterator it = readers.find(id);
|
||||
if (it == readers.end()) goto err;
|
||||
|
||||
// Read level infos
|
||||
{
|
||||
TLevelP level;
|
||||
try {
|
||||
level = it.value()->loadInfo();
|
||||
} catch (...) {
|
||||
goto err;
|
||||
}
|
||||
|
||||
int frameCount = level->getFrameCount();
|
||||
if (!shMemId.isEmpty()) {
|
||||
// Create a shared memory segment to transfer the infos to
|
||||
tipc::DefaultMessageParser<SHMEM_REQUEST> msgParser;
|
||||
Message shMsg;
|
||||
|
||||
shMsg << shMemId << frameCount * (int)sizeof(int) << reset;
|
||||
msgParser(shMsg);
|
||||
|
||||
QString str;
|
||||
shMsg >> reset >> str;
|
||||
if (str != QString("ok")) goto err;
|
||||
|
||||
// Copy level data to the shared memory segment
|
||||
{
|
||||
QSharedMemory shmem(shMemId);
|
||||
shmem.attach();
|
||||
shmem.lock();
|
||||
|
||||
TLevel::Table *table = level->getTable();
|
||||
|
||||
TLevel::Table::const_iterator jt;
|
||||
int *f = (int *)shmem.data();
|
||||
for (jt = table->begin(); jt != table->end(); ++jt, ++f)
|
||||
*f = jt->first.getNumber();
|
||||
|
||||
shmem.unlock();
|
||||
shmem.detach();
|
||||
}
|
||||
}
|
||||
|
||||
msg << QString("ok") << frameCount;
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
err:
|
||||
|
||||
msg << QString("err");
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// LREnableRandomAccessRead Parser
|
||||
//************************************************************************
|
||||
|
||||
void LREnableRandomAccessReadParser::operator()(Message &msg) {
|
||||
unsigned int id;
|
||||
QString str;
|
||||
msg >> id >> str >> clr;
|
||||
bool enable = (str == "true");
|
||||
|
||||
QHash<unsigned int, TLevelReaderP>::iterator it = readers.find(id);
|
||||
if (it == readers.end()) {
|
||||
msg << QString("err");
|
||||
return;
|
||||
}
|
||||
|
||||
it.value()->enableRandomAccessRead(enable);
|
||||
|
||||
msg << QString("ok");
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// LRImageRead Parser
|
||||
//************************************************************************
|
||||
|
||||
void LRImageReadParser::operator()(Message &msg) {
|
||||
{
|
||||
unsigned int id;
|
||||
int lx, ly, pixSize, frameIdx, x, y, shrinkX, shrinkY;
|
||||
|
||||
msg >> id >> lx >> ly >> pixSize >> frameIdx >> x >> y >> shrinkX >>
|
||||
shrinkY >> clr;
|
||||
|
||||
if (pixSize != 4) goto err;
|
||||
|
||||
QHash<unsigned int, TLevelReaderP>::iterator it = readers.find(id);
|
||||
if (it == readers.end()) goto err;
|
||||
|
||||
// Load the raster
|
||||
TRaster32P ras(lx, ly);
|
||||
try {
|
||||
TImageReaderP ir(it.value()->getFrameReader(frameIdx + 1));
|
||||
ir->load(ras, TPoint(x, y), shrinkX, shrinkY);
|
||||
} catch (...) {
|
||||
goto err;
|
||||
}
|
||||
|
||||
t32bitsrv::RasterExchanger<TPixel32> exch(ras);
|
||||
if (!tipc::writeShMemBuffer(*stream(), msg << clr,
|
||||
lx * ly * sizeof(TPixel32), &exch))
|
||||
goto err;
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
err:
|
||||
|
||||
msg << QString("err");
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// CloseLRMov Parser
|
||||
//************************************************************************
|
||||
|
||||
void CloseLR3gpParser::operator()(Message &msg) {
|
||||
unsigned int id;
|
||||
msg >> id >> clr;
|
||||
|
||||
readers.take(id);
|
||||
msg << QString("ok");
|
||||
}
|
||||
|
||||
} // namespace mov_io
|
||||
|
||||
#endif // !x64 && !__LP64__
|
|
@ -1,144 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#ifndef t323gpmsg_h
|
||||
#define t323gpmsg_h
|
||||
|
||||
#include "tipcmsg.h"
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
// Forward declarations
|
||||
namespace tipc {
|
||||
class Server;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
using namespace tipc;
|
||||
|
||||
namespace _3gp_io {
|
||||
|
||||
void addParsers(tipc::Server *srv);
|
||||
|
||||
//************************************************************************************
|
||||
// Write messages
|
||||
//************************************************************************************
|
||||
|
||||
class InitLW3gpParser : public tipc::MessageParser {
|
||||
// Syntax: $initLW3gp <id> <fp> <props fp>
|
||||
// Reply: ok | err
|
||||
|
||||
public:
|
||||
QString header() const override { return "$initLW3gp"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class LWSetFrameRateParser : public tipc::MessageParser {
|
||||
// Syntax: $LW3gpSetFrameRate <id> <fps>
|
||||
// Reply: ok | err
|
||||
|
||||
public:
|
||||
QString header() const override { return "$LW3gpSetFrameRate"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class LWImageWriteParser : public tipc::MessageParser {
|
||||
// Syntax: [$LW3gpImageWrite <id> <frameIdx> <lx> <ly>] [data writer]
|
||||
// Reply: ok | err
|
||||
|
||||
public:
|
||||
QString header() const override { return "$LW3gpImageWrite"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class LWSaveSoundTrackParser : public tipc::MessageParser {
|
||||
// Syntax: $LW3gpSaveSoundTrack <id> <sampleRate> <bps> <chanCount> <sCount>
|
||||
// <signedSample> <shmem-id>
|
||||
// Reply: ok | err
|
||||
|
||||
public:
|
||||
QString header() const override { return "$LW3gpSaveSoundTrack"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class CloseLW3gpParser : public tipc::MessageParser {
|
||||
// Syntax: $closeLW3gp <id>
|
||||
// Reply: ok | err
|
||||
|
||||
public:
|
||||
QString header() const override { return "$closeLW3gp"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
//************************************************************************************
|
||||
// Read messages
|
||||
//************************************************************************************
|
||||
|
||||
class InitLR3gpParser : public tipc::MessageParser {
|
||||
// Syntax: $initLR3gp <id> <fp>
|
||||
// Reply: ok <lx> <ly> <framerate> | err
|
||||
|
||||
public:
|
||||
QString header() const override { return "$initLR3gp"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class LRLoadInfoParser : public tipc::MessageParser {
|
||||
// Syntax: $LR3gpLoadInfo <id> <shmem id>
|
||||
// Reply: ok <frameCount> | err
|
||||
|
||||
// NOTE: Expects an external call to $shmem_release <shmem_id> after data is
|
||||
// dealt with.
|
||||
|
||||
public:
|
||||
QString header() const override { return "$LR3gpLoadInfo"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class LREnableRandomAccessReadParser : public tipc::MessageParser {
|
||||
// Syntax: $LR3gpEnableRandomAccessRead <id> <"true" | "false">
|
||||
// Reply: ok | err
|
||||
|
||||
public:
|
||||
QString header() const override { return "$LR3gpEnableRandomAccessRead"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class LRImageReadParser : public tipc::MessageParser {
|
||||
// Syntax: $LR3gpImageRead <id> <lx> <ly> <bypp> <frameIdx> <x> <y> <shrinkX>
|
||||
// <shrinkY>
|
||||
// Reply: [data reader]
|
||||
|
||||
public:
|
||||
QString header() const override { return "$LR3gpImageRead"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class CloseLR3gpParser : public tipc::MessageParser {
|
||||
// Syntax: $closeLR3gp <id>
|
||||
// Reply: ok | err
|
||||
|
||||
public:
|
||||
QString header() const override { return "$closeLR3gp"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
} // namespace _3gp_io
|
||||
|
||||
#endif // t323gpmsg_h
|
|
@ -1,283 +0,0 @@
|
|||
|
||||
|
||||
#ifdef MACOSX
|
||||
#ifndef __LP64__
|
||||
|
||||
// Toonz stuff
|
||||
#include "tvectorimage.h"
|
||||
#include "tstroke.h"
|
||||
#include "traster.h"
|
||||
#include "tfont.h"
|
||||
|
||||
// Qt stuff
|
||||
#include <QString>
|
||||
#include <QSharedMemory>
|
||||
#include <QDebug>
|
||||
|
||||
// tipc includes
|
||||
#include "tipc.h"
|
||||
#include "tipcmsg.h"
|
||||
#include "tipcsrv.h"
|
||||
|
||||
#include "t32fontmsg.h"
|
||||
|
||||
//---------------------------------------------------
|
||||
|
||||
// Local namespace stuff
|
||||
|
||||
namespace {}
|
||||
|
||||
QDataStream &operator<<(QDataStream &ds, const TThickPoint &p) {
|
||||
ds << p.x << p.y << p.thick;
|
||||
return ds;
|
||||
}
|
||||
|
||||
//---------------------------------------------------
|
||||
|
||||
using namespace tipc;
|
||||
|
||||
namespace font_io {
|
||||
|
||||
void addParsers(tipc::Server *srv) {
|
||||
srv->addParser(new LoadFontNamesParser);
|
||||
srv->addParser(new GetAllFamiliesParser);
|
||||
srv->addParser(new GetAllTypefacesParser);
|
||||
srv->addParser(new SetFamilyParser);
|
||||
srv->addParser(new SetTypefaceParser);
|
||||
srv->addParser(new SetSizeParser);
|
||||
srv->addParser(new GetCurrentFamilyParser);
|
||||
srv->addParser(new GetCurrentTypefaceParser);
|
||||
srv->addParser(new GetDistanceParser);
|
||||
srv->addParser(new DrawCharVIParser);
|
||||
srv->addParser(new DrawCharGRParser);
|
||||
srv->addParser(new DrawCharCMParser);
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// LoadFontNames Parser
|
||||
//************************************************************************
|
||||
|
||||
void LoadFontNamesParser::operator()(Message &msg) {
|
||||
TFontManager::instance()->loadFontNames();
|
||||
msg << clr << QString("ok");
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// GetAllFamilies Parser
|
||||
//************************************************************************
|
||||
|
||||
void GetAllFamiliesParser::operator()(Message &msg) {
|
||||
std::vector<std::wstring> families;
|
||||
TFontManager::instance()->getAllFamilies(families);
|
||||
|
||||
msg << clr << QString("ok") << families;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// GetAllTypefaces Parser
|
||||
//************************************************************************
|
||||
|
||||
void GetAllTypefacesParser::operator()(Message &msg) {
|
||||
std::vector<std::wstring> typefaces;
|
||||
TFontManager::instance()->getAllTypefaces(typefaces);
|
||||
|
||||
msg << clr << QString("ok") << typefaces;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// SetFamily Parser
|
||||
//************************************************************************
|
||||
|
||||
void SetFamilyParser::operator()(Message &msg) {
|
||||
std::wstring family;
|
||||
msg >> family >> clr;
|
||||
|
||||
TFontManager::instance()->setFamily(family);
|
||||
msg << QString("ok");
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// SetTypeface Parser
|
||||
//************************************************************************
|
||||
|
||||
void SetTypefaceParser::operator()(Message &msg) {
|
||||
std::wstring typeface;
|
||||
msg >> typeface >> clr;
|
||||
|
||||
TFontManager *fm = TFontManager::instance();
|
||||
fm->setTypeface(typeface);
|
||||
msg << QString("ok") << fm->getLineAscender() << fm->getLineDescender();
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// SetSize Parser
|
||||
//************************************************************************
|
||||
|
||||
void SetSizeParser::operator()(Message &msg) {
|
||||
int size;
|
||||
msg >> size >> clr;
|
||||
|
||||
TFontManager *fm = TFontManager::instance();
|
||||
fm->setSize(size);
|
||||
msg << QString("ok") << fm->getLineAscender() << fm->getLineDescender();
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// GetCurrentFamily Parser
|
||||
//************************************************************************
|
||||
|
||||
void GetCurrentFamilyParser::operator()(Message &msg) {
|
||||
std::wstring family(TFontManager::instance()->getCurrentFamily());
|
||||
msg << clr << QString("ok") << family;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// GetCurrentTypeface Parser
|
||||
//************************************************************************
|
||||
|
||||
void GetCurrentTypefaceParser::operator()(Message &msg) {
|
||||
std::wstring typeface(TFontManager::instance()->getCurrentTypeface());
|
||||
msg << clr << QString("ok") << typeface;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// GetDistance Parser
|
||||
//************************************************************************
|
||||
|
||||
void GetDistanceParser::operator()(Message &msg) {
|
||||
wchar_t firstChar, secondChar;
|
||||
msg >> firstChar >> secondChar >> clr;
|
||||
|
||||
TPoint dist = TFontManager::instance()->getDistance(firstChar, secondChar);
|
||||
msg << QString("ok") << dist.x << dist.y;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// DrawCharVI Parser
|
||||
//************************************************************************
|
||||
|
||||
void DrawCharVIParser::operator()(Message &msg) {
|
||||
wchar_t charCode, nextCode;
|
||||
msg >> charCode >> nextCode >> clr;
|
||||
|
||||
TVectorImageP vi(new TVectorImage);
|
||||
|
||||
TPoint p = TFontManager::instance()->drawChar(vi, charCode, nextCode);
|
||||
msg << QString("ok") << p.x << p.y;
|
||||
|
||||
// Write the vector image
|
||||
std::vector<TThickPoint> cps;
|
||||
|
||||
unsigned int i, strokesCount = vi->getStrokeCount();
|
||||
for (i = 0; i < strokesCount; ++i) {
|
||||
TStroke *stroke = vi->getStroke(i);
|
||||
|
||||
cps.clear();
|
||||
stroke->getControlPoints(cps);
|
||||
|
||||
msg << cps;
|
||||
}
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// DrawCharGR Parser
|
||||
//************************************************************************
|
||||
|
||||
void DrawCharGRParser::operator()(Message &msg) {
|
||||
int ink;
|
||||
QString shMemId;
|
||||
wchar_t charCode, nextCode;
|
||||
msg >> ink >> shMemId >> charCode >> nextCode >> clr;
|
||||
|
||||
// Build the character
|
||||
TRasterGR8P charRas;
|
||||
TPoint unused;
|
||||
TPoint p =
|
||||
TFontManager::instance()->drawChar(charRas, unused, charCode, nextCode);
|
||||
|
||||
// Retrieve the raster size
|
||||
int lx = charRas->getLx(), ly = charRas->getLy();
|
||||
int size = lx * ly * sizeof(TPixelGR8);
|
||||
|
||||
// Request a shared memory segment of that size
|
||||
{
|
||||
tipc::DefaultMessageParser<SHMEM_REQUEST> msgParser;
|
||||
Message shMsg;
|
||||
|
||||
shMsg << shMemId << size << reset;
|
||||
msgParser(shMsg);
|
||||
|
||||
QString str;
|
||||
shMsg >> reset >> str;
|
||||
if (str != QString("ok")) {
|
||||
msg << QString("err");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Copy charRas to the shared segment
|
||||
QSharedMemory shmem(shMemId);
|
||||
shmem.attach();
|
||||
shmem.lock();
|
||||
|
||||
memcpy(shmem.data(), charRas->getRawData(), size);
|
||||
|
||||
shmem.unlock();
|
||||
shmem.detach();
|
||||
|
||||
msg << QString("ok") << lx << ly << p.x << p.y;
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// DrawCharCM Parser
|
||||
//************************************************************************
|
||||
|
||||
void DrawCharCMParser::operator()(Message &msg) {
|
||||
int ink;
|
||||
QString shMemId;
|
||||
wchar_t charCode, nextCode;
|
||||
msg >> ink >> shMemId >> charCode >> nextCode >> clr;
|
||||
|
||||
// Build the character
|
||||
TRasterCM32P charRas;
|
||||
TPoint unused;
|
||||
TPoint p = TFontManager::instance()->drawChar(charRas, unused, ink, charCode,
|
||||
nextCode);
|
||||
|
||||
// Retrieve the raster size
|
||||
int lx = charRas->getLx(), ly = charRas->getLy();
|
||||
int size = lx * ly * sizeof(TPixelCM32);
|
||||
|
||||
// Request a shared memory segment of that size
|
||||
{
|
||||
tipc::DefaultMessageParser<SHMEM_REQUEST> msgParser;
|
||||
Message shMsg;
|
||||
|
||||
shMsg << shMemId << size << reset;
|
||||
msgParser(shMsg);
|
||||
|
||||
QString str;
|
||||
shMsg >> reset >> str;
|
||||
if (str != QString("ok")) {
|
||||
msg << QString("err");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Copy charRas to the shared segment
|
||||
QSharedMemory shmem(shMemId);
|
||||
shmem.attach();
|
||||
shmem.lock();
|
||||
|
||||
memcpy(shmem.data(), charRas->getRawData(), size);
|
||||
|
||||
shmem.unlock();
|
||||
shmem.detach();
|
||||
|
||||
msg << QString("ok") << lx << ly << p.x << p.y;
|
||||
}
|
||||
|
||||
} // namespace font_io
|
||||
|
||||
#endif // !__LP64
|
||||
#endif // MACOSX
|
|
@ -1,164 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#ifdef MACOSX
|
||||
|
||||
#include "tipcmsg.h"
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
// Forward declarations
|
||||
namespace tipc {
|
||||
class Server;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
using namespace tipc;
|
||||
|
||||
namespace font_io {
|
||||
|
||||
void addParsers(tipc::Server *srv);
|
||||
|
||||
//************************************************************************************
|
||||
// Initialization messages
|
||||
//************************************************************************************
|
||||
|
||||
class LoadFontNamesParser : public tipc::MessageParser {
|
||||
// Syntax : $FNTloadFontNames
|
||||
// Reply: ok | err
|
||||
|
||||
public:
|
||||
QString header() const { return "$FNTloadFontNames"; }
|
||||
void operator()(Message &stream);
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class GetAllFamiliesParser : public tipc::MessageParser {
|
||||
// Syntax : $FNTgetAllFamilies
|
||||
// Reply: ok <families vector> | err
|
||||
|
||||
public:
|
||||
QString header() const { return "$FNTgetAllFamilies"; }
|
||||
void operator()(Message &stream);
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class GetAllTypefacesParser : public tipc::MessageParser {
|
||||
// Syntax : $FNTgetAllTypefaces
|
||||
// Reply: ok <typefaces vector> | err
|
||||
|
||||
public:
|
||||
QString header() const { return "$FNTgetAllTypefaces"; }
|
||||
void operator()(Message &stream);
|
||||
};
|
||||
|
||||
//************************************************************************************
|
||||
// Setter messages
|
||||
//************************************************************************************
|
||||
|
||||
class SetFamilyParser : public tipc::MessageParser {
|
||||
// Syntax: $FNTsetFamily <family>
|
||||
// Reply: ok | err
|
||||
|
||||
public:
|
||||
QString header() const { return "$FNTsetFamily"; }
|
||||
void operator()(Message &stream);
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class SetTypefaceParser : public tipc::MessageParser {
|
||||
// Syntax: $FNTsetTypeface <typeface>
|
||||
// Reply: ok <ascender> <descender> | err
|
||||
|
||||
public:
|
||||
QString header() const { return "$FNTsetTypeface"; }
|
||||
void operator()(Message &stream);
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class SetSizeParser : public tipc::MessageParser {
|
||||
// Syntax: $FNTsetSize <size>
|
||||
// Reply: ok <ascender> <descender> | err
|
||||
|
||||
public:
|
||||
QString header() const { return "$FNTsetSize"; }
|
||||
void operator()(Message &stream);
|
||||
};
|
||||
|
||||
//************************************************************************************
|
||||
// Getter messages
|
||||
//************************************************************************************
|
||||
|
||||
class GetCurrentFamilyParser : public tipc::MessageParser {
|
||||
// Syntax: $FNTgetCurrentFamily
|
||||
// Reply: ok <family name> | err
|
||||
|
||||
public:
|
||||
QString header() const { return "$FNTgetCurrentFamily"; }
|
||||
void operator()(Message &stream);
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class GetCurrentTypefaceParser : public tipc::MessageParser {
|
||||
// Syntax: $FNTgetCurrentTypeface
|
||||
// Reply: ok <typeface name> | err
|
||||
|
||||
public:
|
||||
QString header() const { return "$FNTgetCurrentTypeface"; }
|
||||
void operator()(Message &stream);
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class GetDistanceParser : public tipc::MessageParser {
|
||||
// Syntax: $FNTgetDistance <firstChar> <secondChar>
|
||||
// Reply: ok <x> <y> | err
|
||||
|
||||
public:
|
||||
QString header() const { return "$FNTgetDistance"; }
|
||||
void operator()(Message &stream);
|
||||
};
|
||||
|
||||
//************************************************************************************
|
||||
// Draw messages
|
||||
//************************************************************************************
|
||||
|
||||
class DrawCharVIParser : public tipc::MessageParser {
|
||||
// Syntax: $FNTdrawCharVI <char> <nextChar>
|
||||
// Reply: ok <x> <y> <strokes vector> | err
|
||||
|
||||
public:
|
||||
QString header() const { return "$FNTdrawCharVI"; }
|
||||
void operator()(Message &stream);
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class DrawCharGRParser : public tipc::MessageParser {
|
||||
// Syntax: $FNTdrawCharGR <shmem-id> <char> <nextChar>
|
||||
// Reply: ok <lx> <ly> <x> <y> | err
|
||||
|
||||
public:
|
||||
QString header() const { return "$FNTdrawCharGR"; }
|
||||
void operator()(Message &stream);
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class DrawCharCMParser : public tipc::MessageParser {
|
||||
// Syntax: $FNTdrawCharCM <ink> <shmem-id> <char> <nextChar>
|
||||
// Reply: ok <lx> <ly> <x> <y> | err
|
||||
|
||||
public:
|
||||
QString header() const { return "$FNTdrawCharCM"; }
|
||||
void operator()(Message &stream);
|
||||
};
|
||||
|
||||
} // namespace tlevelwriter_mov
|
||||
|
||||
#endif
|
|
@ -1,620 +0,0 @@
|
|||
|
||||
|
||||
#if (!(defined(x64) || defined(__LP64__) || defined(LINUX)))
|
||||
|
||||
// Toonz stuff
|
||||
#include "tiio.h"
|
||||
#include "timage_io.h"
|
||||
#include "tlevel_io.h"
|
||||
#include "trasterimage.h"
|
||||
#include "traster.h"
|
||||
#include "tstream.h"
|
||||
#include "movsettings.h"
|
||||
#include "tproperty.h"
|
||||
#include "tsound.h"
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include "../image/mov/tiio_mov.h"
|
||||
#elif defined(MACOSX)
|
||||
#include "../image/mov/tiio_movM.h"
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
#endif
|
||||
|
||||
// Qt stuff
|
||||
#include <QString>
|
||||
#include <QHash>
|
||||
#include <QSharedMemory>
|
||||
#include <QDebug>
|
||||
|
||||
#include <QLocalSocket>
|
||||
#include <QDataStream>
|
||||
|
||||
// tipc includes
|
||||
#include "tipc.h"
|
||||
#include "tipcmsg.h"
|
||||
#include "tipcsrv.h"
|
||||
#include "t32bitsrv_wrap.h"
|
||||
|
||||
#include "t32movmsg.h"
|
||||
|
||||
//---------------------------------------------------
|
||||
|
||||
// Diagnostics stuff
|
||||
|
||||
//#define TIPC_DEBUG
|
||||
|
||||
#ifdef TIPC_DEBUG
|
||||
#define tipc_debug(expr) expr
|
||||
#else
|
||||
#define tipc_debug(expr)
|
||||
#endif
|
||||
|
||||
#ifdef TIPC_DEBUG
|
||||
#include <QTime>
|
||||
#endif
|
||||
|
||||
//---------------------------------------------------
|
||||
|
||||
// Local namespace stuff
|
||||
|
||||
namespace {
|
||||
QHash<unsigned int, TLevelReaderP> readers;
|
||||
QHash<unsigned int, TLevelWriterP> writers;
|
||||
}
|
||||
|
||||
//---------------------------------------------------
|
||||
|
||||
using namespace tipc;
|
||||
|
||||
namespace mov_io {
|
||||
|
||||
void addParsers(tipc::Server *srv) {
|
||||
srv->addParser(new IsQTInstalledParser);
|
||||
srv->addParser(new DefaultMovPropsParser);
|
||||
srv->addParser(new OpenMovSettingsPopupParser);
|
||||
srv->addParser(new InitLWMovParser);
|
||||
srv->addParser(new LWSetFrameRateParser);
|
||||
srv->addParser(new LWImageWriteParser);
|
||||
srv->addParser(new LWSaveSoundTrackParser);
|
||||
srv->addParser(new CloseLWMovParser);
|
||||
srv->addParser(new InitLRMovParser);
|
||||
srv->addParser(new LRLoadInfoParser);
|
||||
srv->addParser(new LREnableRandomAccessReadParser);
|
||||
srv->addParser(new LRImageReadParser);
|
||||
srv->addParser(new LRImageReadSHMParser);
|
||||
srv->addParser(new CloseLRMovParser);
|
||||
|
||||
#ifdef WIN32
|
||||
srv->addParser(new LRSetYMirrorParser);
|
||||
srv->addParser(new LRSetLoadTimecodeParser);
|
||||
srv->addParser(new LRTimecodeParser);
|
||||
#endif
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// IsQTInstalled Parser
|
||||
//************************************************************************
|
||||
|
||||
void IsQTInstalledParser::operator()(Message &msg) {
|
||||
bool ret = Tiio::isQuicktimeInstalled();
|
||||
msg << clr << QString((ret) ? "yes" : "no");
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// DefaultMovProps Parser
|
||||
//************************************************************************
|
||||
|
||||
void DefaultMovPropsParser::operator()(Message &msg) {
|
||||
// Ensure the file path was passed - and retrieve it
|
||||
QString reply;
|
||||
msg >> reply >> clr;
|
||||
if (reply.isEmpty()) goto err;
|
||||
|
||||
#ifdef WIN32
|
||||
// Ensure that QuickTime is correctly running
|
||||
if (InitializeQTML(0) != noErr) goto err;
|
||||
#endif
|
||||
|
||||
// Success - retrieve the props
|
||||
{
|
||||
TPropertyGroup movProps;
|
||||
{
|
||||
// Low-level QuickTime stuff
|
||||
ComponentInstance ci = OpenDefaultComponent(StandardCompressionType,
|
||||
StandardCompressionSubType);
|
||||
QTAtomContainer settings;
|
||||
|
||||
if (SCGetSettingsAsAtomContainer(ci, &settings) != noErr) assert(false);
|
||||
|
||||
fromAtomsToProperties(settings, movProps);
|
||||
}
|
||||
|
||||
// Write the retrieved properties
|
||||
TFilePath tfp(reply.toStdWString());
|
||||
TOStream os(tfp);
|
||||
|
||||
movProps.saveData(os);
|
||||
|
||||
msg << QString("ok");
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
err:
|
||||
|
||||
msg << QString("err");
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// OpenMovSettingsPopup Parser
|
||||
//************************************************************************
|
||||
|
||||
void OpenMovSettingsPopupParser::operator()(Message &msg) {
|
||||
// Open the properties file
|
||||
QString fp;
|
||||
msg >> fp >> clr;
|
||||
|
||||
// Retrieve the properties
|
||||
TPropertyGroup *props = new TPropertyGroup;
|
||||
TFilePath tfp(fp.toStdWString());
|
||||
{
|
||||
TIStream is(tfp);
|
||||
props->loadData(is);
|
||||
}
|
||||
|
||||
#ifdef MACOSX
|
||||
|
||||
ProcessSerialNumber psn = {0, kCurrentProcess};
|
||||
TransformProcessType(&psn, kProcessTransformToForegroundApplication);
|
||||
SetFrontProcess(&psn);
|
||||
|
||||
#endif
|
||||
|
||||
openMovSettingsPopup(props, true);
|
||||
|
||||
{
|
||||
TOStream os(tfp); // Should NOT append
|
||||
props->saveData(os);
|
||||
}
|
||||
|
||||
delete props;
|
||||
|
||||
msg << QString("ok");
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// InitLWMov Parser
|
||||
//************************************************************************
|
||||
|
||||
void InitLWMovParser::operator()(Message &msg) {
|
||||
unsigned int id;
|
||||
QString fp, propsFp;
|
||||
msg >> id >> fp >> propsFp >> clr;
|
||||
|
||||
TFilePath tfp(fp.toStdWString()), propsTFp(propsFp.toStdWString());
|
||||
|
||||
try {
|
||||
TPropertyGroup *props = 0;
|
||||
if (!propsTFp.isEmpty()) {
|
||||
props = new TPropertyGroup;
|
||||
|
||||
TIStream is(propsTFp);
|
||||
props->loadData(is);
|
||||
}
|
||||
|
||||
writers.insert(id, TLevelWriterP(tfp, props));
|
||||
|
||||
msg << QString("ok");
|
||||
} catch (...) {
|
||||
msg << QString("err");
|
||||
}
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// LWsetFrameRate Parser
|
||||
//************************************************************************
|
||||
|
||||
void LWSetFrameRateParser::operator()(Message &msg) {
|
||||
unsigned int id;
|
||||
double fps;
|
||||
|
||||
msg >> id >> fps >> clr;
|
||||
|
||||
writers.find(id).value()->setFrameRate(fps);
|
||||
|
||||
msg << QString("ok");
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// LWImageWrite Parser
|
||||
//************************************************************************
|
||||
|
||||
void LWImageWriteParser::operator()(Message &msg) {
|
||||
unsigned int id;
|
||||
int frameIdx, lx, ly;
|
||||
|
||||
msg >> id >> frameIdx >> lx >> ly;
|
||||
|
||||
// Read the data through a shared memory segment
|
||||
TRaster32P ras(lx, ly);
|
||||
t32bitsrv::RasterExchanger<TPixel32> exch(ras);
|
||||
tipc::readShMemBuffer(*stream(), msg, &exch);
|
||||
|
||||
// Save the image
|
||||
try {
|
||||
TImageWriterP iw(writers.find(id).value()->getFrameWriter(frameIdx + 1));
|
||||
iw->save(TRasterImageP(ras));
|
||||
|
||||
msg << QString("ok");
|
||||
} catch (...) {
|
||||
msg << QString("err");
|
||||
}
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// LWSaveSoundTrack Parser
|
||||
//************************************************************************
|
||||
|
||||
void LWSaveSoundTrackParser::operator()(Message &msg) {
|
||||
unsigned int id;
|
||||
QString shMemId;
|
||||
|
||||
TUINT32 sampleRate;
|
||||
TINT32 sCount;
|
||||
int bps, chanCount;
|
||||
bool signedSample;
|
||||
|
||||
msg >> id >> sampleRate >> bps >> chanCount >> sCount >> signedSample;
|
||||
|
||||
// Retrieve the soundtrack buffer
|
||||
TSoundTrackP st =
|
||||
TSoundTrack::create(sampleRate, bps, chanCount, sCount, signedSample);
|
||||
t32bitsrv::BufferExchanger exch((UCHAR *)st->getRawData());
|
||||
tipc::readShMemBuffer(*stream(), msg, &exch);
|
||||
|
||||
// Write the soundtrack
|
||||
try {
|
||||
writers.find(id).value()->saveSoundTrack(st.getPointer());
|
||||
msg << QString("ok");
|
||||
} catch (...) {
|
||||
msg << QString("err");
|
||||
}
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// CloseLWMov Parser
|
||||
//************************************************************************
|
||||
|
||||
void CloseLWMovParser::operator()(Message &msg) {
|
||||
unsigned int id;
|
||||
msg >> id >> clr;
|
||||
|
||||
try {
|
||||
writers.take(id);
|
||||
msg << QString("ok");
|
||||
} catch (...) {
|
||||
msg << QString("err");
|
||||
}
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// InitLRMov Parser
|
||||
//************************************************************************
|
||||
|
||||
void InitLRMovParser::operator()(Message &msg) {
|
||||
unsigned int id;
|
||||
QString fp, propsFp;
|
||||
msg >> id >> fp >> clr;
|
||||
assert(!fp.isEmpty());
|
||||
|
||||
TFilePath tfp(fp.toStdWString());
|
||||
|
||||
try {
|
||||
TLevelReaderP lrm(tfp);
|
||||
|
||||
// Extract some info to be returned
|
||||
const TImageInfo *info = lrm->getImageInfo();
|
||||
if (!info) throw TImageException(tfp, "Couldn't retrieve image properties");
|
||||
|
||||
int lx = info->m_lx, ly = info->m_ly;
|
||||
double frameRate = info->m_frameRate;
|
||||
|
||||
tipc_debug(qDebug() << "Inserted image"
|
||||
<< QString::fromStdWString(tfp.getWideString()));
|
||||
readers.insert(id, lrm);
|
||||
|
||||
msg << QString("ok") << lx << ly << frameRate;
|
||||
} catch (...) {
|
||||
msg << QString("err");
|
||||
}
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// LRLoadInfo Parser
|
||||
//************************************************************************
|
||||
|
||||
void LRLoadInfoParser::operator()(Message &msg) {
|
||||
// Read command data
|
||||
unsigned int id;
|
||||
QString shMemId;
|
||||
msg >> id >> shMemId >> clr;
|
||||
|
||||
QHash<unsigned int, TLevelReaderP>::iterator it = readers.find(id);
|
||||
if (it == readers.end()) goto err;
|
||||
|
||||
// Read level infos
|
||||
{
|
||||
TLevelP level;
|
||||
try {
|
||||
level = it.value()->loadInfo();
|
||||
} catch (...) {
|
||||
goto err;
|
||||
}
|
||||
|
||||
int frameCount = level->getFrameCount();
|
||||
if (!shMemId.isEmpty()) {
|
||||
// Create a shared memory segment to transfer the infos to
|
||||
tipc::DefaultMessageParser<SHMEM_REQUEST> msgParser;
|
||||
Message shMsg;
|
||||
|
||||
shMsg << shMemId << frameCount * (int)sizeof(int) << reset;
|
||||
msgParser(shMsg);
|
||||
|
||||
QString str;
|
||||
shMsg >> reset >> str;
|
||||
if (str != QString("ok")) goto err;
|
||||
|
||||
// Copy level data to the shared memory segment
|
||||
{
|
||||
QSharedMemory shmem(shMemId);
|
||||
shmem.attach();
|
||||
shmem.lock();
|
||||
|
||||
TLevel::Table *table = level->getTable();
|
||||
|
||||
TLevel::Table::const_iterator jt;
|
||||
int *f = (int *)shmem.data();
|
||||
for (jt = table->begin(); jt != table->end(); ++jt, ++f)
|
||||
*f = jt->first.getNumber();
|
||||
|
||||
shmem.unlock();
|
||||
shmem.detach();
|
||||
}
|
||||
}
|
||||
|
||||
msg << QString("ok") << frameCount;
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
err:
|
||||
|
||||
msg << QString("err");
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// LREnableRandomAccessRead Parser
|
||||
//************************************************************************
|
||||
|
||||
void LREnableRandomAccessReadParser::operator()(Message &msg) {
|
||||
unsigned int id;
|
||||
QString str;
|
||||
msg >> id >> str >> clr;
|
||||
bool enable = (str == "true");
|
||||
|
||||
QHash<unsigned int, TLevelReaderP>::iterator it = readers.find(id);
|
||||
if (it == readers.end()) {
|
||||
msg << QString("err");
|
||||
return;
|
||||
}
|
||||
|
||||
it.value()->enableRandomAccessRead(enable);
|
||||
|
||||
msg << QString("ok");
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// LRSetYMirror Parser
|
||||
//************************************************************************
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
void LRSetYMirrorParser::operator()(Message &msg) {
|
||||
unsigned int id;
|
||||
QString str;
|
||||
msg >> id >> str >> clr;
|
||||
bool enable = (str == "true");
|
||||
|
||||
QHash<unsigned int, TLevelReaderP>::iterator it = readers.find(id);
|
||||
if (it == readers.end()) {
|
||||
msg << QString("err");
|
||||
return;
|
||||
}
|
||||
|
||||
static_cast<TLevelReaderMov *>(it.value().getPointer())->setYMirror(enable);
|
||||
|
||||
msg << QString("ok");
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// LRSetLoadTimecode Parser
|
||||
//************************************************************************
|
||||
|
||||
void LRSetLoadTimecodeParser::operator()(Message &msg) {
|
||||
unsigned int id;
|
||||
QString str;
|
||||
msg >> id >> str >> clr;
|
||||
bool enable = (str == "true");
|
||||
|
||||
QHash<unsigned int, TLevelReaderP>::iterator it = readers.find(id);
|
||||
if (it == readers.end()) {
|
||||
msg << QString("err");
|
||||
return;
|
||||
}
|
||||
|
||||
static_cast<TLevelReaderMov *>(it.value().getPointer())
|
||||
->setLoadTimecode(enable);
|
||||
|
||||
msg << QString("ok");
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// LRTimecode Parser
|
||||
//************************************************************************
|
||||
|
||||
void LRTimecodeParser::operator()(Message &msg) {
|
||||
unsigned int id;
|
||||
int frameIdx;
|
||||
QString str;
|
||||
msg >> id >> frameIdx >> clr;
|
||||
|
||||
QHash<unsigned int, TLevelReaderP>::iterator it = readers.find(id);
|
||||
if (it == readers.end()) {
|
||||
msg << QString("err");
|
||||
return;
|
||||
}
|
||||
|
||||
UCHAR hh, mm, ss, ff;
|
||||
static_cast<TLevelReaderMov *>(it.value().getPointer())
|
||||
->timecode(frameIdx, hh, mm, ss, ff);
|
||||
|
||||
msg << QString("ok") << hh << mm << ss << ff;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//************************************************************************
|
||||
// LRImageRead Parser
|
||||
//************************************************************************
|
||||
|
||||
void LRImageReadParser::operator()(Message &msg) {
|
||||
tipc_debug(QTime fTime; QTime irTime; QTime shTime; fTime.start(););
|
||||
|
||||
{
|
||||
unsigned int id;
|
||||
int lx, ly, pixSize, frameIdx, x, y, shrinkX, shrinkY;
|
||||
|
||||
msg >> id >> lx >> ly >> pixSize >> frameIdx >> x >> y >> shrinkX >>
|
||||
shrinkY >> clr;
|
||||
|
||||
if (pixSize != 4) goto err;
|
||||
|
||||
QHash<unsigned int, TLevelReaderP>::iterator it = readers.find(id);
|
||||
if (it == readers.end()) goto err;
|
||||
|
||||
tipc_debug(irTime.start());
|
||||
|
||||
// Load the raster
|
||||
TRaster32P ras(lx, ly);
|
||||
try {
|
||||
TImageReaderP ir(it.value()->getFrameReader(frameIdx + 1));
|
||||
ir->load(ras, TPoint(x, y), shrinkX, shrinkY);
|
||||
} catch (...) {
|
||||
goto err;
|
||||
}
|
||||
|
||||
tipc_debug(qDebug() << "load time:" << irTime.elapsed());
|
||||
tipc_debug(shTime.start());
|
||||
|
||||
t32bitsrv::RasterExchanger<TPixel32> exch(ras);
|
||||
if (!tipc::writeShMemBuffer(*stream(), msg << clr,
|
||||
lx * ly * sizeof(TPixel32), &exch))
|
||||
goto err;
|
||||
|
||||
tipc_debug(qDebug() << "exchange time:" << shTime.elapsed());
|
||||
tipc_debug(qDebug() << "TLevelReaderMov::loadImage time:"
|
||||
<< fTime.elapsed());
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
err:
|
||||
|
||||
msg << QString("err");
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// LRImageReadSHM Parser
|
||||
//************************************************************************
|
||||
|
||||
void LRImageReadSHMParser::operator()(Message &msg) {
|
||||
tipc_debug(QTime fTime; QTime irTime; fTime.start(););
|
||||
|
||||
unsigned int id;
|
||||
int lx, ly, frameIdx;
|
||||
QString shMemId;
|
||||
|
||||
msg >> id >> lx >> ly >> frameIdx >> shMemId >> clr;
|
||||
|
||||
tipc_debug(qDebug() << "LoadImageSHM data:" << id << lx << ly << frameIdx
|
||||
<< shMemId);
|
||||
|
||||
QHash<unsigned int, TLevelReaderP>::iterator it = readers.find(id);
|
||||
if (it == readers.end()) goto err;
|
||||
|
||||
// Attach the shared memory segment the raster
|
||||
{
|
||||
QSharedMemory shm(shMemId);
|
||||
shm.attach();
|
||||
if (!shm.isAttached()) goto err;
|
||||
|
||||
// Load the raster
|
||||
TRaster32P ras(lx, ly, lx, (TPixel32 *)shm.data());
|
||||
try {
|
||||
tipc_debug(qDebug() << "loading image...");
|
||||
tipc_debug(irTime.start());
|
||||
|
||||
shm.lock();
|
||||
TImageReaderP ir(it.value()->getFrameReader(frameIdx + 1));
|
||||
ir->load(ras, TPoint(), 1, 1);
|
||||
shm.unlock();
|
||||
|
||||
tipc_debug(qDebug() << "load time:" << irTime.elapsed());
|
||||
} catch (TImageException e) {
|
||||
shm.unlock();
|
||||
tipc_debug(qDebug() << "Image Read Error:"
|
||||
<< QString::fromStdWString(e.getMessage()));
|
||||
goto err;
|
||||
} catch (...) {
|
||||
shm.unlock();
|
||||
tipc_debug(qDebug() << "Unknown Image Read Error");
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
msg << QString("ok");
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
UCHAR hh, mm, ss, ff;
|
||||
TLevelReaderMov *lrm =
|
||||
static_cast<TLevelReaderMov *>(it.value().getPointer());
|
||||
lrm->loadedTimecode(hh, mm, ss, ff);
|
||||
|
||||
tipc_debug(qDebug() << "TLevelReaderMov::loadImage time:" << fTime.elapsed());
|
||||
msg << hh << mm << ss << ff;
|
||||
|
||||
#endif
|
||||
|
||||
return;
|
||||
|
||||
err:
|
||||
|
||||
msg << QString("err");
|
||||
}
|
||||
|
||||
//************************************************************************
|
||||
// CloseLRMov Parser
|
||||
//************************************************************************
|
||||
|
||||
void CloseLRMovParser::operator()(Message &msg) {
|
||||
unsigned int id;
|
||||
msg >> id >> clr;
|
||||
|
||||
readers.take(id);
|
||||
msg << QString("ok");
|
||||
}
|
||||
|
||||
} // namespace mov_io
|
||||
|
||||
#endif // !x64 && !__LP64__
|
|
@ -1,229 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#ifndef T32MOVMSG_H
|
||||
#define T32MOVMSG_H
|
||||
|
||||
#include "tipcmsg.h"
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
// Forward declarations
|
||||
namespace tipc {
|
||||
class Server;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
using namespace tipc;
|
||||
|
||||
namespace mov_io {
|
||||
|
||||
void addParsers(tipc::Server *srv);
|
||||
|
||||
//************************************************************************************
|
||||
// Generic messages
|
||||
//************************************************************************************
|
||||
|
||||
class IsQTInstalledParser : public tipc::MessageParser {
|
||||
// Syntax : $isQTInstalled
|
||||
// Reply: yes | no
|
||||
|
||||
public:
|
||||
QString header() const override { return "$isQTInstalled"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class DefaultMovPropsParser : public tipc::MessageParser {
|
||||
// Syntax : $defaultMovProps <props fp>\n
|
||||
// Reply: ok | err
|
||||
|
||||
public:
|
||||
QString header() const override { return "$defaultMovProps"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class OpenMovSettingsPopupParser : public tipc::MessageParser {
|
||||
// Syntax : $openMovPopup <props fp>\n
|
||||
// Reply: ok
|
||||
|
||||
public:
|
||||
QString header() const override { return "$openMovSettingsPopup"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
//************************************************************************************
|
||||
// Write messages
|
||||
//************************************************************************************
|
||||
|
||||
class InitLWMovParser : public tipc::MessageParser {
|
||||
// Syntax: $initLWMov <id> <fp> <props fp>
|
||||
// Reply: ok | err
|
||||
|
||||
public:
|
||||
QString header() const override { return "$initLWMov"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class LWSetFrameRateParser : public tipc::MessageParser {
|
||||
// Syntax: $LWMovSetFrameRate <id> <fps>
|
||||
// Reply: ok | err
|
||||
|
||||
public:
|
||||
QString header() const override { return "$LWMovSetFrameRate"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class LWImageWriteParser : public tipc::MessageParser {
|
||||
// Syntax: [$LWMovImageWrite <id> <frameIdx> <lx> <ly>] [data writer]
|
||||
// Reply: ok | err
|
||||
|
||||
public:
|
||||
QString header() const override { return "$LWMovImageWrite"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class LWSaveSoundTrackParser : public tipc::MessageParser {
|
||||
// Syntax: [$LWMovSaveSoundTrack <id> <sampleRate> <bps> <chanCount> <sCount>
|
||||
// <signedSample>] [data writer]
|
||||
// Reply: ok | err
|
||||
|
||||
public:
|
||||
QString header() const override { return "$LWMovSaveSoundTrack"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class CloseLWMovParser : public tipc::MessageParser {
|
||||
// Syntax: $closeLWMov <id>
|
||||
// Reply: ok | err
|
||||
|
||||
public:
|
||||
QString header() const override { return "$closeLWMov"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
//************************************************************************************
|
||||
// Read messages
|
||||
//************************************************************************************
|
||||
|
||||
class InitLRMovParser : public tipc::MessageParser {
|
||||
// Syntax: $initLRMov <id> <fp>
|
||||
// Reply: ok <lx> <ly> <framerate> | err
|
||||
|
||||
public:
|
||||
QString header() const override { return "$initLRMov"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class LRLoadInfoParser : public tipc::MessageParser {
|
||||
// Syntax: $LRMovLoadInfo <id> <shmem id>
|
||||
// Reply: ok <frameCount> | err
|
||||
|
||||
// NOTE: Expects an external call to $shmem_release <shmem_id> after data is
|
||||
// dealt with.
|
||||
// If the shmem_id is empty, the level infos are not returned.
|
||||
|
||||
public:
|
||||
QString header() const override { return "$LRMovLoadInfo"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class LREnableRandomAccessReadParser : public tipc::MessageParser {
|
||||
// Syntax: $LRMovEnableRandomAccessRead <id> <"true" | "false">
|
||||
// Reply: ok | err
|
||||
|
||||
public:
|
||||
QString header() const override { return "$LRMovEnableRandomAccessRead"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#ifdef WIN32 // The following commands are used only from Digital Dailies Lab -
|
||||
// Windows only
|
||||
|
||||
class LRSetYMirrorParser : public tipc::MessageParser {
|
||||
// Syntax: $LRMovSetYMirror <id> <"true" | "false">
|
||||
// Reply: ok | err
|
||||
|
||||
public:
|
||||
QString header() const override { return "$LRMovSetYMirror"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class LRSetLoadTimecodeParser : public tipc::MessageParser {
|
||||
// Syntax: $LRMovSetLoadTimecode <id> <"true" | "false">
|
||||
// Reply: ok | err
|
||||
|
||||
public:
|
||||
QString header() const override { return "$LRMovSetLoadTimecode"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class LRTimecodeParser : public tipc::MessageParser {
|
||||
// Syntax: $LRMovTimecode <id> <frame>
|
||||
// Reply: ok <hh> <mm> <ss> <ff> | err
|
||||
|
||||
public:
|
||||
QString header() const override { return "$LRMovTimecode"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class LRImageReadParser : public tipc::MessageParser {
|
||||
// Syntax: $LRMovImageRead <id> <lx> <ly> <bypp> <frameIdx> <x> <y> <shrinkX>
|
||||
// <shrinkY>
|
||||
// Reply: [data reader]
|
||||
|
||||
public:
|
||||
QString header() const override { return "$LRMovImageRead"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class LRImageReadSHMParser : public tipc::MessageParser {
|
||||
// Syntax: $LRMovImageReadSHM <id> <lx> <ly> <frameIdx> <shmem id>
|
||||
// Reply: ok <hh> <mm> <ss> <ff> | err
|
||||
|
||||
public:
|
||||
QString header() const override { return "$LRMovImageReadSHM"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class CloseLRMovParser : public tipc::MessageParser {
|
||||
// Syntax: $closeLRMov <id>
|
||||
// Reply: ok | err
|
||||
|
||||
public:
|
||||
QString header() const override { return "$closeLRMov"; }
|
||||
void operator()(Message &stream) override;
|
||||
};
|
||||
|
||||
} // namespace tlevelwriter_mov
|
||||
|
||||
#endif // T32MOVMSG_H
|
|
@ -448,8 +448,7 @@ int main(int argc, char *argv[]) {
|
|||
exit(1);
|
||||
}
|
||||
}
|
||||
if (ext != "3gp" && ext != "pli") {
|
||||
// assert(ext!="3gp" && ext!="pli" && ext!="tlv");
|
||||
if (ext != "pli") {
|
||||
convert(srcFilePath, dstFilePath, range, width, prop, resQuality);
|
||||
} else {
|
||||
msg = "Cannot convert to ." + ext + " format.";
|
||||
|
|
|
@ -14,7 +14,6 @@ set(HEADERS ${MOC_HEADERS}
|
|||
../common/trop/quickputP.h
|
||||
../common/tiio/compatibility/tfile_io.h
|
||||
../common/tiio/bmp/filebmp.h
|
||||
../include/movsettings.h
|
||||
../include/tconst.h
|
||||
../include/transparencycheck.h
|
||||
../include/trastercm.h
|
||||
|
@ -115,7 +114,6 @@ set(HEADERS ${MOC_HEADERS}
|
|||
../include/ttoonzimage.h
|
||||
../include/tipc.h
|
||||
../include/tipcmsg.h
|
||||
../include/t32bitsrv_wrap.h
|
||||
../include/tenv.h
|
||||
../include/tmeshimage.h
|
||||
../include/tgldisplaylistsmanager.h
|
||||
|
@ -225,7 +223,6 @@ set(SOURCES
|
|||
../common/tiio/tiio_jpg_util.cpp
|
||||
../common/tiio/tiio_jpg_exif.cpp
|
||||
../common/tiio/tiio_std.cpp
|
||||
../common/tiio/movsettings.cpp
|
||||
../common/tiio/compatibility/tfile_io.c
|
||||
../common/tiio/bmp/filebmp.c
|
||||
../common/trop/tfracmove.cpp
|
||||
|
@ -236,7 +233,6 @@ set(SOURCES
|
|||
../common/tipc/tipc.cpp
|
||||
../common/tipc/tipcmsg.cpp
|
||||
../common/tipc/tipcsrv.cpp
|
||||
../common/tipc/t32bitsrv_wrap.cpp
|
||||
../common/tsystem/tsystempd.cpp
|
||||
../common/tapptools/tenv.cpp
|
||||
../common/tmeshimage/tmeshimage.cpp
|
||||
|
@ -306,7 +302,6 @@ if(BUILD_TARGET_WIN)
|
|||
if(PLATFORM EQUAL 32)
|
||||
include_directories(
|
||||
SYSTEM
|
||||
${SDKROOT}/quicktime/QT73SDK/CIncludes
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -430,7 +430,6 @@ if(BUILD_TARGET_WIN)
|
|||
if(PLATFORM EQUAL 32)
|
||||
include_directories(
|
||||
SYSTEM
|
||||
${SDKROOT}/quicktime/QT73SDK/CIncludes
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -289,7 +289,7 @@ void BatchesController::setTasksTree(TaskTreeModel *tree) {
|
|||
//------------------------------------------------------------------------------
|
||||
|
||||
inline bool isMovieType(string type) {
|
||||
return (type == "mov" || type == "avi" || type == "3gp");
|
||||
return (type == "avi");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
|
|
@ -871,8 +871,7 @@ void CastBrowser::viewFile() {
|
|||
if (!TFileType::isViewable(TFileType::getInfo(filePath))) return;
|
||||
|
||||
if (Preferences::instance()->isDefaultViewerEnabled() &&
|
||||
(filePath.getType() == "mov" || filePath.getType() == "avi" ||
|
||||
filePath.getType() == "3gp"))
|
||||
(filePath.getType() == "avi"))
|
||||
QDesktopServices::openUrl(QUrl("file:///" + toQString(filePath)));
|
||||
else
|
||||
::viewFile(filePath);
|
||||
|
|
|
@ -388,10 +388,7 @@ ConvertPopup::ConvertPopup(bool specifyInput)
|
|||
<< "gif"
|
||||
<< "bmp"
|
||||
<< "avi"
|
||||
<< "mov"
|
||||
<< "jpg"
|
||||
<< "pic"
|
||||
<< "pict"
|
||||
<< "rgb"
|
||||
<< "sgi"
|
||||
<< "png";
|
||||
|
|
|
@ -371,8 +371,7 @@ you want to do?";*/
|
|||
if (m_frame >= totalFrameCount &&
|
||||
Preferences::instance()->isGeneratedMovieViewEnabled()) {
|
||||
if (Preferences::instance()->isDefaultViewerEnabled() &&
|
||||
(outPath.getType() == "mov" || outPath.getType() == "avi" ||
|
||||
outPath.getType() == "3gp")) {
|
||||
(outPath.getType() == "avi")) {
|
||||
QString name = QString::fromStdString(outPath.getName());
|
||||
|
||||
if (!TSystem::showDocument(outPath)) {
|
||||
|
@ -857,7 +856,6 @@ ExportPanel::ExportPanel(QWidget *parent, Qt::WFlags flags)
|
|||
m_fileFormat->setFixedHeight(DVGui::WidgetHeight + 2);
|
||||
connect(m_fileFormat, SIGNAL(currentIndexChanged(const QString &)),
|
||||
SLOT(onFormatChanged(const QString &)));
|
||||
// m_fileFormat->setCurrentIndex(formats.indexOf("mov"));
|
||||
|
||||
QPushButton *fileFormatButton = new QPushButton(QString(tr("Options")));
|
||||
fileFormatButton->setMinimumWidth(75);
|
||||
|
@ -988,10 +986,7 @@ void ExportPanel::generateMovie() {
|
|||
QString path = m_saveInFileFld->getPath();
|
||||
TFilePath outPath(path.toStdWString());
|
||||
outPath = (outPath + m_fileNameFld->text().toStdWString()).withType(ext);
|
||||
if (TFileType::getInfo(outPath) == TFileType::RASTER_IMAGE ||
|
||||
outPath.getType() == "pct" || outPath.getType() == "pic" ||
|
||||
outPath.getType() == "pict") // pct e' un formato"livello" (ha i settings
|
||||
// di quicktime) ma fatto di diversi frames
|
||||
if (TFileType::getInfo(outPath) == TFileType::RASTER_IMAGE)
|
||||
outPath = outPath.withFrame(TFrameId::EMPTY_FRAME);
|
||||
RenderController::instance()->generateMovie(scene->decodeFilePath(outPath));
|
||||
}
|
||||
|
|
|
@ -145,8 +145,8 @@ QMutex levelFileMutex;
|
|||
} // namespace
|
||||
|
||||
inline bool isMultipleFrameType(std::string type) {
|
||||
return (type == "tlv" || type == "tzl" || type == "pli" || type == "mov" ||
|
||||
type == "avi" || type == "3gp" || type == "gif" || type == "mp4" ||
|
||||
return (type == "tlv" || type == "tzl" || type == "pli" ||
|
||||
type == "avi" || type == "gif" || type == "mp4" ||
|
||||
type == "webm");
|
||||
}
|
||||
|
||||
|
|
|
@ -1947,10 +1947,6 @@ LoadColorModelPopup::LoadColorModelPopup()
|
|||
setOkText(tr("Load"));
|
||||
addFilterType("bmp");
|
||||
addFilterType("jpg");
|
||||
addFilterType("nol");
|
||||
addFilterType("pic");
|
||||
addFilterType("pict");
|
||||
addFilterType("pct");
|
||||
addFilterType("png");
|
||||
addFilterType("rgb");
|
||||
addFilterType("sgi");
|
||||
|
|
|
@ -370,8 +370,7 @@ void FileSelection::viewFile() {
|
|||
if (!TFileType::isViewable(TFileType::getInfo(files[0]))) continue;
|
||||
|
||||
if (Preferences::instance()->isDefaultViewerEnabled() &&
|
||||
(files[i].getType() == "mov" || files[i].getType() == "avi" ||
|
||||
files[i].getType() == "3gp"))
|
||||
(files[i].getType() == "avi"))
|
||||
QDesktopServices::openUrl(QUrl("file:///" + toQString(files[i])));
|
||||
else {
|
||||
FlipBook *fb = ::viewFile(files[i]);
|
||||
|
|
|
@ -367,17 +367,14 @@ LoadImagesPopup::LoadImagesPopup(FlipBook *flip)
|
|||
m_shrinkField = new DVGui::LineEdit("1", this);
|
||||
|
||||
// Define the append/load filter types
|
||||
m_appendFilterTypes << "3gp"
|
||||
<< "mov"
|
||||
<< "jpg"
|
||||
m_appendFilterTypes << "jpg"
|
||||
<< "png"
|
||||
<< "tga"
|
||||
<< "tif"
|
||||
<< "tiff"
|
||||
<< "bmp"
|
||||
<< "sgi"
|
||||
<< "rgb"
|
||||
<< "nol";
|
||||
<< "rgb";
|
||||
|
||||
#ifdef _WIN32
|
||||
m_appendFilterTypes << "avi";
|
||||
|
@ -658,10 +655,7 @@ bool FlipBook::doSaveImages(TFilePath fp) {
|
|||
return true;
|
||||
}
|
||||
|
||||
if (TFileType::getInfo(fp) == TFileType::RASTER_IMAGE || ext == "pct" ||
|
||||
ext == "pic" || ext == "pict") // pct e' un formato"livello" (ha i
|
||||
// settings di quicktime) ma fatto di
|
||||
// diversi frames
|
||||
if (TFileType::getInfo(fp) == TFileType::RASTER_IMAGE)
|
||||
fp = fp.withFrame(TFrameId::EMPTY_FRAME);
|
||||
|
||||
fp = scene->decodeFilePath(fp);
|
||||
|
@ -2228,8 +2222,7 @@ FlipBook *viewFile(const TFilePath &path, int from, int to, int step,
|
|||
}
|
||||
|
||||
// Movie files must not have the ".." extension
|
||||
if ((path.getType() == "mov" || path.getType() == "avi" ||
|
||||
path.getType() == "3gp") &&
|
||||
if ((path.getType() == "avi") &&
|
||||
path.isLevelName()) {
|
||||
DVGui::warning(QObject::tr("%1 has an invalid extension format.")
|
||||
.arg(QString::fromStdString(path.getLevelName())));
|
||||
|
@ -2240,7 +2233,7 @@ FlipBook *viewFile(const TFilePath &path, int from, int to, int step,
|
|||
if (path.getType() == "scr") return NULL;
|
||||
|
||||
// Avi and movs may be viewed by an external viewer, depending on preferences
|
||||
if ((path.getType() == "mov" || path.getType() == "avi") && !flipbook) {
|
||||
if ((path.getType() == "avi") && !flipbook) {
|
||||
QString str;
|
||||
QSettings().value("generatedMovieViewEnabled", str);
|
||||
if (str.toInt() != 0) {
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
// TnzCore includes
|
||||
#include "tlevel_io.h"
|
||||
#include "tproperty.h"
|
||||
#include "movsettings.h"
|
||||
#include "timageinfo.h"
|
||||
|
||||
// Qt includes
|
||||
|
@ -294,23 +293,6 @@ FormatSettingsPopup *openFormatSettingsPopup(QWidget *parent,
|
|||
const std::string &format,
|
||||
TPropertyGroup *props,
|
||||
const TFilePath &levelPath) {
|
||||
if (format == "mov" || format == "3gp") // trattato diversamente; il format
|
||||
// popup dei mov e' quello di
|
||||
// quicktime
|
||||
{
|
||||
// gmt 26/9/07. con la penna capita spesso di premere ripetutamente il
|
||||
// bottone.
|
||||
// si aprono due popup uno sopra l'altro (brutto di per se e puo' causare
|
||||
// dei crash misteriosi)
|
||||
static bool popupIsOpen = false;
|
||||
if (popupIsOpen) return 0;
|
||||
|
||||
popupIsOpen = true;
|
||||
openMovSettingsPopup(props);
|
||||
popupIsOpen = false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!props || props->getPropertyCount() == 0) return 0;
|
||||
|
||||
|
|
|
@ -3889,11 +3889,6 @@ void RecentFiles::loadRecentFiles() {
|
|||
if (!levels.isEmpty()) {
|
||||
for (i = 0; i < levels.size(); i++) {
|
||||
QString path = levels.at(i).toString();
|
||||
#ifdef x64
|
||||
if (path.endsWith(".mov") || path.endsWith(".3gp") ||
|
||||
path.endsWith(".pct") || path.endsWith(".pict"))
|
||||
continue;
|
||||
#endif
|
||||
m_recentLevels.append(path);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -159,7 +159,7 @@ public:
|
|||
TPointD center(0.5 * cameraSize.lx, 0.5 * cameraSize.ly);
|
||||
m_viewAff = TTranslation(center);
|
||||
std::string ext = fp.getType();
|
||||
m_isFrames = ext != "avi" && ext != "mov" && ext != "3gp";
|
||||
m_isFrames = ext != "avi";
|
||||
m_fileOptions = properties.getFileFormatProperties(ext);
|
||||
}
|
||||
|
||||
|
|
|
@ -865,10 +865,7 @@ bool Previewer::Imp::doSaveRenderedFrames(TFilePath fp) {
|
|||
}
|
||||
|
||||
if (fp.getWideName() == L"") fp = fp.withName(scene->getSceneName());
|
||||
if (TFileType::getInfo(fp) == TFileType::RASTER_IMAGE || ext == "pct" ||
|
||||
fp.getType() == "pic" || ext == "pict") // pct e' un formato"livello" (ha
|
||||
// i settings di quicktime) ma
|
||||
// fatto di diversi frames
|
||||
if (TFileType::getInfo(fp) == TFileType::RASTER_IMAGE)
|
||||
fp = fp.withFrame(TFrameId::EMPTY_FRAME);
|
||||
|
||||
fp = scene->decodeFilePath(fp);
|
||||
|
|
|
@ -87,8 +87,8 @@ public:
|
|||
|
||||
if (Preferences::instance()->isGeneratedMovieViewEnabled()) {
|
||||
if (!isPreview && (Preferences::instance()->isDefaultViewerEnabled()) &&
|
||||
(m_fp.getType() == "mov" || m_fp.getType() == "avi" ||
|
||||
m_fp.getType() == "3gp" || m_fp.getType() == "mp4" ||
|
||||
(m_fp.getType() == "avi" ||
|
||||
m_fp.getType() == "mp4" ||
|
||||
m_fp.getType() == "gif" || m_fp.getType() == "webm")) {
|
||||
QString name = QString::fromStdString(m_fp.getName());
|
||||
int index;
|
||||
|
@ -255,11 +255,7 @@ sprop->getOutputProperties()->setRenderSettings(rso);*/
|
|||
if (fp.getWideName() == L"")
|
||||
fp = fp.withName(scene->getScenePath().getName());
|
||||
/*-- For raster images, add the frame number to the filename --*/
|
||||
if (TFileType::getInfo(fp) == TFileType::RASTER_IMAGE ||
|
||||
fp.getType() == "pct" || fp.getType() == "pic" ||
|
||||
fp.getType() == "pict") // pct e' un formato"livello" (ha i settings di
|
||||
// quicktime) ma fatto di diversi frames
|
||||
// Tahoma2D no longer supports the pct, pic or pict file types.
|
||||
if (TFileType::getInfo(fp) == TFileType::RASTER_IMAGE)
|
||||
fp = fp.withFrame(TFrameId::EMPTY_FRAME);
|
||||
fp = scene->decodeFilePath(fp);
|
||||
|
||||
|
@ -441,7 +437,7 @@ void RenderCommand::rasterRender(bool isPreview) {
|
|||
// depth). I tried to make OT to detect the mov settings and adaptively switch
|
||||
// the behavior, but ended in vain :-(
|
||||
// So I just omitted every mov from applying solid background as a quick fix.
|
||||
if (isMovieType(ext) && ext != "mov") {
|
||||
if (isMovieType(ext)) {
|
||||
scene->getProperties()->setBgColor(currBgColor);
|
||||
}
|
||||
// for non alpha-enabled images (like jpg), background color will be inserted
|
||||
|
|
Binary file not shown.
|
@ -1,212 +0,0 @@
|
|||
# -----------------------------------------------------------
|
||||
# This file is generated by the Qt Visual Studio Integration.
|
||||
# -----------------------------------------------------------
|
||||
|
||||
|
||||
#Header files
|
||||
HEADERS += ../../sources/tab30qt/actioncommand.h \
|
||||
../../sources/tab30qt/addfilmstripframespopup.h \
|
||||
../../sources/tab30qt/browser.h \
|
||||
../../sources/tab30qt/browsermodel.h \
|
||||
../../sources/tab30qt/browserselection.h \
|
||||
../../sources/tab30qt/castselection.h \
|
||||
../../sources/tab30qt/castviewer.h \
|
||||
../../sources/tab30qt/celldata.h \
|
||||
../../sources/tab30qt/cellselection.h \
|
||||
../../sources/tab30qt/colorfield.h \
|
||||
../../sources/tab30qt/columncommand.h \
|
||||
../../sources/tab30qt/columndata.h \
|
||||
../../sources/tab30qt/columnselection.h \
|
||||
../../sources/tab30qt/curscenepanel.h \
|
||||
../../sources/tab30qt/cursormanager.h \
|
||||
../../sources/tab30qt/duplicatepopup.h \
|
||||
../../sources/tab30qt/dvdialog.h \
|
||||
../../sources/tab30qt/dvitemview.h \
|
||||
../../sources/tab30qt/dvwidgets.h \
|
||||
../../sources/tab30qt/exportpanel.h \
|
||||
../../sources/tab30qt/filebrowser.h \
|
||||
../../sources/tab30qt/filebrowserpopup.h \
|
||||
../../sources/tab30qt/fileinfopopup.h \
|
||||
../../sources/tab30qt/fileselection.h \
|
||||
../../sources/tab30qt/filmstrip.h \
|
||||
../../sources/tab30qt/filmstripcommand.h \
|
||||
../../sources/tab30qt/filmstripselection.h \
|
||||
../../sources/tab30qt/floatingpanelcommand.h \
|
||||
../../sources/tab30qt/formatsettingspopups.h \
|
||||
../../sources/tab30qt/frameheadgadget.h \
|
||||
../../sources/tab30qt/gutil.h \
|
||||
../../sources/tab30qt/history.h \
|
||||
../../sources/tab30qt/icongenerator.h \
|
||||
../../sources/tab30qt/imagedata.h \
|
||||
../../sources/tab30qt/imagegrouping.h \
|
||||
../../sources/tab30qt/imageutils.h \
|
||||
../../sources/tab30qt/iocommand.h \
|
||||
../../sources/tab30qt/keyframedata.h \
|
||||
../../sources/tab30qt/keyframenavigator.h \
|
||||
../../sources/tab30qt/keyframeselection.h \
|
||||
../../sources/tab30qt/menubar.h \
|
||||
../../sources/tab30qt/menubarcommand.h \
|
||||
../../sources/tab30qt/menubarcommandids.h \
|
||||
../../sources/tab30qt/moviegenerator.h \
|
||||
../../sources/tab30qt/onionskinmaskgui.h \
|
||||
../../sources/tab30qt/palettecmd.h \
|
||||
../../sources/tab30qt/paletteviewer.h \
|
||||
../../sources/tab30qt/pane.h \
|
||||
../../sources/tab30qt/pegbarutil.h \
|
||||
../../sources/tab30qt/pltgizmopopup.h \
|
||||
../../sources/tab30qt/qtofflinegl.h \
|
||||
../../sources/tab30qt/renumberpopup.h \
|
||||
../../sources/tab30qt/ruler.h \
|
||||
../../sources/tab30qt/scenesettingspopup.h \
|
||||
../../sources/tab30qt/sceneviewer.h \
|
||||
../../sources/tab30qt/selection.h \
|
||||
../../sources/tab30qt/shortcutpopup.h \
|
||||
../../sources/tab30qt/styledata.h \
|
||||
../../sources/tab30qt/styleeditor.h \
|
||||
../../sources/tab30qt/stylepicker.h \
|
||||
../../sources/tab30qt/styleselection.h \
|
||||
../../sources/tab30qt/subscenecommand.h \
|
||||
../../sources/tab30qt/tab30qt.h \
|
||||
../../sources/tab30qt/tabslider.h \
|
||||
../../sources/tab30qt/tapp.h \
|
||||
../../sources/tab30qt/tcolumnhandle.h \
|
||||
../../sources/tab30qt/tframehandle.h \
|
||||
../../sources/tab30qt/tobjecthandle.h \
|
||||
../../sources/tab30qt/tonionskinmaskhandle.h \
|
||||
../../sources/tab30qt/tool.h \
|
||||
../../sources/tab30qt/toolbar.h \
|
||||
../../sources/tab30qt/toolhandle.h \
|
||||
../../sources/tab30qt/tooloptions.h \
|
||||
../../sources/tab30qt/tooloptionscontrols.h \
|
||||
../../sources/tab30qt/toolutils.h \
|
||||
../../sources/tab30qt/toonzimagedata.h \
|
||||
../../sources/tab30qt/tpalettehandle.h \
|
||||
../../sources/tab30qt/tscenehandle.h \
|
||||
../../sources/tab30qt/tselectionhandle.h \
|
||||
../../sources/tab30qt/txsheethandle.h \
|
||||
../../sources/tab30qt/txshlevelhandle.h \
|
||||
../../sources/tab30qt/vectorizerpopup.h \
|
||||
../../sources/tab30qt/viewerdraw.h \
|
||||
../../sources/tab30qt/viewerpane.h \
|
||||
../../sources/tab30qt/viewerpopup.h \
|
||||
../../sources/tab30qt/xshcellviewer.h \
|
||||
../../sources/tab30qt/xshcolumnviewer.h \
|
||||
../../sources/tab30qt/xsheetdragtool.h \
|
||||
../../sources/tab30qt/xsheetviewer.h \
|
||||
../../sources/tab30qt/xshrowviewer.h
|
||||
|
||||
#Source files
|
||||
SOURCES += ../../sources/tab30qt/browsermodel.cpp \
|
||||
../../sources/tab30qt/cursormanager.cpp \
|
||||
../../sources/tab30qt/floatingpanelcommand.cpp \
|
||||
../../sources/tab30qt/gutil.cpp \
|
||||
../../sources/tab30qt/history.cpp \
|
||||
../../sources/tab30qt/icongenerator.cpp \
|
||||
../../sources/tab30qt/imagedata.cpp \
|
||||
../../sources/tab30qt/imageutils.cpp \
|
||||
../../sources/tab30qt/keyframenavigator.cpp \
|
||||
../../sources/tab30qt/main.cpp \
|
||||
../../sources/tab30qt/menubar.cpp \
|
||||
../../sources/tab30qt/menubarcommand.cpp \
|
||||
../../sources/tab30qt/moviegenerator.cpp \
|
||||
../../sources/tab30qt/pane.cpp \
|
||||
../../sources/tab30qt/pegbarutil.cpp \
|
||||
../../sources/tab30qt/qtofflinegl.cpp \
|
||||
../../sources/tab30qt/ruler.cpp \
|
||||
../../sources/tab30qt/stylepicker.cpp \
|
||||
../../sources/tab30qt/tab30qt.cpp \
|
||||
../../sources/tab30qt/tabslider.cpp \
|
||||
../../sources/tab30qt/tapp.cpp \
|
||||
../../sources/tab30qt/tool.cpp \
|
||||
../../sources/tab30qt/toolbar.cpp \
|
||||
../../sources/tab30qt/tooloptions.cpp \
|
||||
../../sources/tab30qt/tooloptionscontrols.cpp \
|
||||
../../sources/tab30qt/toolutils.cpp \
|
||||
../../sources/tab30qt/toonzimagedata.cpp \
|
||||
../../sources/tab30qt/arrowtool.cpp \
|
||||
../../sources/tab30qt/bendertool.cpp \
|
||||
../../sources/tab30qt/cutstroketool.cpp \
|
||||
../../sources/tab30qt/erasertool.cpp \
|
||||
../../sources/tab30qt/filltool.cpp \
|
||||
../../sources/tab30qt/imagegrouping.cpp \
|
||||
../../sources/tab30qt/joinertool.cpp \
|
||||
../../sources/tab30qt/pentool.cpp \
|
||||
../../sources/tab30qt/pickRGBtool.cpp \
|
||||
../../sources/tab30qt/pickstyletool.cpp \
|
||||
../../sources/tab30qt/primitivetool.cpp \
|
||||
../../sources/tab30qt/smoothstroketool.cpp \
|
||||
../../sources/tab30qt/splineeditortool.cpp \
|
||||
../../sources/tab30qt/strokearrowtool.cpp \
|
||||
../../sources/tab30qt/texttool.cpp \
|
||||
../../sources/tab30qt/thicknessmodifytool.cpp \
|
||||
../../sources/tab30qt/vectormodifytool.cpp \
|
||||
../../sources/tab30qt/viewtools.cpp \
|
||||
../../sources/tab30qt/warptool.cpp \
|
||||
../../sources/tab30qt/browser.cpp \
|
||||
../../sources/tab30qt/castviewer.cpp \
|
||||
../../sources/tab30qt/curscenepanel.cpp \
|
||||
../../sources/tab30qt/exportpanel.cpp \
|
||||
../../sources/tab30qt/filebrowser.cpp \
|
||||
../../sources/tab30qt/filmstrip.cpp \
|
||||
../../sources/tab30qt/paletteviewer.cpp \
|
||||
../../sources/tab30qt/sceneviewer.cpp \
|
||||
../../sources/tab30qt/styleeditor.cpp \
|
||||
../../sources/tab30qt/viewerdraw.cpp \
|
||||
../../sources/tab30qt/viewerpane.cpp \
|
||||
../../sources/tab30qt/xshcellviewer.cpp \
|
||||
../../sources/tab30qt/xshcolumnviewer.cpp \
|
||||
../../sources/tab30qt/xsheetdragtool.cpp \
|
||||
../../sources/tab30qt/xsheetviewer.cpp \
|
||||
../../sources/tab30qt/xshrowviewer.cpp \
|
||||
../../sources/tab30qt/browserselection.cpp \
|
||||
../../sources/tab30qt/castselection.cpp \
|
||||
../../sources/tab30qt/cellselection.cpp \
|
||||
../../sources/tab30qt/columnselection.cpp \
|
||||
../../sources/tab30qt/fileselection.cpp \
|
||||
../../sources/tab30qt/filmstripselection.cpp \
|
||||
../../sources/tab30qt/keyframeselection.cpp \
|
||||
../../sources/tab30qt/selection.cpp \
|
||||
../../sources/tab30qt/strokeselection.cpp \
|
||||
../../sources/tab30qt/styleselection.cpp \
|
||||
../../sources/tab30qt/tcolumnhandle.cpp \
|
||||
../../sources/tab30qt/tframehandle.cpp \
|
||||
../../sources/tab30qt/tobjecthandle.cpp \
|
||||
../../sources/tab30qt/tonionskinmaskhandle.cpp \
|
||||
../../sources/tab30qt/toolhandle.cpp \
|
||||
../../sources/tab30qt/tpalettehandle.cpp \
|
||||
../../sources/tab30qt/tscenehandle.cpp \
|
||||
../../sources/tab30qt/tselectionhandle.cpp \
|
||||
../../sources/tab30qt/txsheethandle.cpp \
|
||||
../../sources/tab30qt/txshlevelhandle.cpp \
|
||||
../../sources/tab30qt/addfilmstripframespopup.cpp \
|
||||
../../sources/tab30qt/duplicatepopup.cpp \
|
||||
../../sources/tab30qt/dvdialog.cpp \
|
||||
../../sources/tab30qt/filebrowserpopup.cpp \
|
||||
../../sources/tab30qt/fileinfopopup.cpp \
|
||||
../../sources/tab30qt/formatsettingspopups.cpp \
|
||||
../../sources/tab30qt/pltgizmopopup.cpp \
|
||||
../../sources/tab30qt/renumberpopup.cpp \
|
||||
../../sources/tab30qt/scenesettingspopup.cpp \
|
||||
../../sources/tab30qt/shortcutpopup.cpp \
|
||||
../../sources/tab30qt/vectorizerpopup.cpp \
|
||||
../../sources/tab30qt/viewerpopup.cpp \
|
||||
../../sources/tab30qt/columncommand.cpp \
|
||||
../../sources/tab30qt/filmstripcommand.cpp \
|
||||
../../sources/tab30qt/iocommand.cpp \
|
||||
../../sources/tab30qt/levelcommand.cpp \
|
||||
../../sources/tab30qt/palettecmd.cpp \
|
||||
../../sources/tab30qt/print.cpp \
|
||||
../../sources/tab30qt/subscenecommand.cpp \
|
||||
../../sources/tab30qt/xsheetcmd.cpp \
|
||||
../../sources/tab30qt/celldata.cpp \
|
||||
../../sources/tab30qt/columndata.cpp \
|
||||
../../sources/tab30qt/keyframedata.cpp \
|
||||
../../sources/tab30qt/styledata.cpp \
|
||||
../../sources/tab30qt/colorfield.cpp \
|
||||
../../sources/tab30qt/dvitemview.cpp \
|
||||
../../sources/tab30qt/dvwidgets.cpp \
|
||||
../../sources/tab30qt/frameheadgadget.cpp \
|
||||
../../sources/tab30qt/onionskinmaskgui.cpp
|
||||
|
||||
#Resource file(s)
|
||||
RESOURCES += ../../projects/tab30qt//tab30qt.qrc
|
|
@ -1,35 +0,0 @@
|
|||
|
||||
TEMPLATE = app
|
||||
TARGET = tab30
|
||||
DESTDIR = $(SOURCEROOT)/tab30qt
|
||||
QT += opengl svg xml network
|
||||
CONFIG += debug_and_release
|
||||
DEFINES += MACOSX $(processor)
|
||||
release: DEFINES += NDEBUG
|
||||
INCLUDEPATH += ./GeneratedFiles \
|
||||
./GeneratedFiles/Debug \
|
||||
$(SOURCEROOT)/include \
|
||||
$(SOURCEROOT)/toonz \
|
||||
/depot/sdk/boost/boost_1_33_1/ \
|
||||
/depot/sdk/cryptopp/cryptopp5.5.1 \
|
||||
/Developer/Headers/FlatCarbon
|
||||
LIBS += -L"$(BINROOT)/bin" \
|
||||
-ltoonzlib \
|
||||
-ltnzbase \
|
||||
-ltnzcore \
|
||||
-ltnzext \
|
||||
-L/depot/sdk/boost/boost_1_33_1/lib_toonz/darwin/$(processor)/ \
|
||||
-lboost_thread-1_33_1 \
|
||||
-framework GLUT \
|
||||
-framework Quicktime \
|
||||
/depot/sdk/cryptopp/cryptopp5.5.1/libcryptopp_$(processor).a
|
||||
DEPENDPATH += .
|
||||
MOC_DIR += ./GeneratedFiles/debug
|
||||
OBJECTS_DIR += debug
|
||||
UI_DIR += ./GeneratedFiles
|
||||
RCC_DIR += ./GeneratedFiles
|
||||
|
||||
# Quando avremo l'icona abilitare la riga seguente
|
||||
ICON = tab30.icns
|
||||
|
||||
include(tab30qt.pri)
|
|
@ -1,35 +0,0 @@
|
|||
|
||||
TEMPLATE = app
|
||||
TARGET = tab30student
|
||||
DESTDIR = $(SOURCEROOT)/tab30qt
|
||||
QT += opengl svg xml network
|
||||
CONFIG += debug_and_release
|
||||
DEFINES += MACOSX STUDENT $(processor)
|
||||
release: DEFINES += NDEBUG
|
||||
INCLUDEPATH += ./GeneratedFiles \
|
||||
./GeneratedFiles/Debug \
|
||||
$(SOURCEROOT)/include \
|
||||
$(SOURCEROOT)/toonz \
|
||||
/depot/sdk/boost/boost_1_33_1/ \
|
||||
/depot/sdk/cryptopp/cryptopp5.5.1 \
|
||||
/Developer/Headers/FlatCarbon
|
||||
LIBS += -L"$(BINROOT)/bin" \
|
||||
-ltoonzlib \
|
||||
-ltnzbase \
|
||||
-ltnzcore \
|
||||
-ltnzext \
|
||||
-L/depot/sdk/boost/boost_1_33_1/lib_toonz/darwin/$(processor)/ \
|
||||
-lboost_thread-1_33_1 \
|
||||
-framework GLUT \
|
||||
-framework Quicktime \
|
||||
/depot/sdk/cryptopp/cryptopp5.5.1/libcryptopp_$(processor).a
|
||||
DEPENDPATH += .
|
||||
MOC_DIR += ./GeneratedFiles/debug
|
||||
OBJECTS_DIR += debug
|
||||
UI_DIR += ./GeneratedFiles
|
||||
RCC_DIR += ./GeneratedFiles
|
||||
|
||||
# Quando avremo l'icona abilitare la riga seguente
|
||||
ICON = tab30student.icns
|
||||
|
||||
include(tab30qt.pri)
|
|
@ -36,7 +36,7 @@ using namespace DVGui;
|
|||
|
||||
namespace {
|
||||
bool isMovieType(std::string type) {
|
||||
return (type == "mov" || type == "avi" || type == "3gp" || type == "mp4" ||
|
||||
return (type == "avi" || type == "mp4" ||
|
||||
type == "webm");
|
||||
}
|
||||
}; // namespace
|
||||
|
|
|
@ -98,10 +98,6 @@ void XDTSImportPopup::updateSuggestions(const QString samplePath) {
|
|||
QStringList filters;
|
||||
filters << "*.bmp"
|
||||
<< "*.jpg"
|
||||
<< "*.nol"
|
||||
<< "*.pic"
|
||||
<< "*.pict"
|
||||
<< "*.pct"
|
||||
<< "*.png"
|
||||
<< "*.rgb"
|
||||
<< "*.sgi"
|
||||
|
|
|
@ -26,10 +26,6 @@ namespace {
|
|||
inline bool supportsRandomAccess(const TFilePath &fp) {
|
||||
const std::string &type = fp.getType();
|
||||
return type == "tlv" || // TLVs do support random access
|
||||
// type == "pli" || // PLIs... I
|
||||
// thought they would - but no :(
|
||||
// type == "mov" || // MOVs are
|
||||
// 'on the way' to support it... for now, no
|
||||
fp.getDots() == ".."; // Multi-file levels of course do
|
||||
}
|
||||
|
||||
|
|
|
@ -800,7 +800,7 @@ else
|
|||
p->setValue(L"64(RGBM)");
|
||||
}
|
||||
|
||||
bool isMovie = (format=="mov" || format=="avi" || format=="3gp");
|
||||
bool isMovie = (format=="avi");
|
||||
|
||||
|
||||
TLevelWriterP lw;
|
||||
|
|
|
@ -267,7 +267,7 @@ QString InfoViewerImp::getTypeString() {
|
|||
return "Smart Raster Level";
|
||||
else if (ext == "pli" || ext == "svg")
|
||||
return "Vector Level";
|
||||
else if (ext == "mov" || ext == "avi" || ext == "3gp")
|
||||
else if (ext == "avi")
|
||||
return "Movie File";
|
||||
else if (ext == "tnz")
|
||||
return "Tahoma2D Scene";
|
||||
|
|
|
@ -2038,7 +2038,7 @@ else return false;
|
|||
|
||||
CustomStyleManager *CustomStyleChooserPage::styleManager() {
|
||||
static const QString filters(
|
||||
"*.pli *.tif *.png *.tga *.tiff *.sgi *.rgb *.pct *.pic");
|
||||
"*.pli *.tif *.png *.tga *.tiff *.sgi *.rgb");
|
||||
static CustomStyleManager theManager(TFilePath("custom styles"), filters);
|
||||
return &theManager;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue