mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 12:23:31 +00:00
import avifil32 from WINE 0.9.1
svn path=/trunk/; revision=19403
This commit is contained in:
@@ -51,6 +51,7 @@
|
||||
<property name="BASEADDRESS_WINFAX" value="0x722C0000" />
|
||||
<property name="BASEADDRESS_WINSCARD" value="0x723D0000" />
|
||||
<property name="BASEADDRESS_DEVMGR" value="0x72a90000" />
|
||||
<property name="BASEADDRESS_AVIFIL32" value="0x73ac0000" />
|
||||
<property name="BASEADDRESS_LZ32" value="0x73d80000" />
|
||||
<property name="BASEADDRESS_COREDLL" value="0x73d80000" />
|
||||
<property name="BASEADDRESS_USERENV" value="0x74850000" />
|
||||
|
||||
@@ -61,6 +61,7 @@ drivers\usb\usbport\usbport.sys 2
|
||||
lib\advapi32\advapi32.dll 1
|
||||
lib\advpack\advpack.dll 1
|
||||
lib\aclui\aclui.dll 1
|
||||
lib\avifil32\avifil32.dll 1
|
||||
lib\cabinet\cabinet.dll 1
|
||||
lib\cards\cards.dll 1
|
||||
lib\cpl\access\access.cpl 1
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
TOPSRCDIR = @top_srcdir@
|
||||
TOPOBJDIR = ../..
|
||||
SRCDIR = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
MODULE = avifil32.dll
|
||||
IMPORTLIB = libavifil32.$(IMPLIBEXT)
|
||||
IMPORTS = msacm32 msvfw32 winmm ole32 user32 advapi32 kernel32 ntdll
|
||||
EXTRALIBS = -luuid
|
||||
|
||||
C_SRCS = \
|
||||
acmstream.c \
|
||||
api.c \
|
||||
avifile.c \
|
||||
editstream.c \
|
||||
extrachunk.c \
|
||||
factory.c \
|
||||
getframe.c \
|
||||
icmstream.c \
|
||||
regsvr.c \
|
||||
tmpfile.c \
|
||||
wavfile.c
|
||||
|
||||
SPEC_SRCS16 = avifile.spec
|
||||
|
||||
RC_SRCS = \
|
||||
rsrc.rc
|
||||
|
||||
@MAKE_DLL_RULES@
|
||||
|
||||
### Dependencies:
|
||||
@@ -0,0 +1,747 @@
|
||||
/*
|
||||
* Copyright 2002 Michael Günnewig
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#define COM_NO_WINDOWS_H
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "winnls.h"
|
||||
#include "winerror.h"
|
||||
#include "windowsx.h"
|
||||
#include "mmsystem.h"
|
||||
#include "vfw.h"
|
||||
#include "msacm.h"
|
||||
|
||||
#include "avifile_private.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(avifile);
|
||||
|
||||
/***********************************************************************/
|
||||
|
||||
static HRESULT WINAPI ACMStream_fnQueryInterface(IAVIStream*iface,REFIID refiid,LPVOID *obj);
|
||||
static ULONG WINAPI ACMStream_fnAddRef(IAVIStream*iface);
|
||||
static ULONG WINAPI ACMStream_fnRelease(IAVIStream* iface);
|
||||
static HRESULT WINAPI ACMStream_fnCreate(IAVIStream*iface,LPARAM lParam1,LPARAM lParam2);
|
||||
static HRESULT WINAPI ACMStream_fnInfo(IAVIStream*iface,AVISTREAMINFOW *psi,LONG size);
|
||||
static LONG WINAPI ACMStream_fnFindSample(IAVIStream*iface,LONG pos,LONG flags);
|
||||
static HRESULT WINAPI ACMStream_fnReadFormat(IAVIStream*iface,LONG pos,LPVOID format,LONG *formatsize);
|
||||
static HRESULT WINAPI ACMStream_fnSetFormat(IAVIStream*iface,LONG pos,LPVOID format,LONG formatsize);
|
||||
static HRESULT WINAPI ACMStream_fnRead(IAVIStream*iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,LONG *bytesread,LONG *samplesread);
|
||||
static HRESULT WINAPI ACMStream_fnWrite(IAVIStream*iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,DWORD flags,LONG *sampwritten,LONG *byteswritten);
|
||||
static HRESULT WINAPI ACMStream_fnDelete(IAVIStream*iface,LONG start,LONG samples);
|
||||
static HRESULT WINAPI ACMStream_fnReadData(IAVIStream*iface,DWORD fcc,LPVOID lp,LONG *lpread);
|
||||
static HRESULT WINAPI ACMStream_fnWriteData(IAVIStream*iface,DWORD fcc,LPVOID lp,LONG size);
|
||||
static HRESULT WINAPI ACMStream_fnSetInfo(IAVIStream*iface,AVISTREAMINFOW*info,LONG infolen);
|
||||
|
||||
static const struct IAVIStreamVtbl iacmst = {
|
||||
ACMStream_fnQueryInterface,
|
||||
ACMStream_fnAddRef,
|
||||
ACMStream_fnRelease,
|
||||
ACMStream_fnCreate,
|
||||
ACMStream_fnInfo,
|
||||
ACMStream_fnFindSample,
|
||||
ACMStream_fnReadFormat,
|
||||
ACMStream_fnSetFormat,
|
||||
ACMStream_fnRead,
|
||||
ACMStream_fnWrite,
|
||||
ACMStream_fnDelete,
|
||||
ACMStream_fnReadData,
|
||||
ACMStream_fnWriteData,
|
||||
ACMStream_fnSetInfo
|
||||
};
|
||||
|
||||
typedef struct _IAVIStreamImpl {
|
||||
/* IUnknown stuff */
|
||||
const IAVIStreamVtbl *lpVtbl;
|
||||
LONG ref;
|
||||
|
||||
/* IAVIStream stuff */
|
||||
PAVISTREAM pStream;
|
||||
AVISTREAMINFOW sInfo;
|
||||
|
||||
HACMSTREAM has;
|
||||
|
||||
LPWAVEFORMATEX lpInFormat;
|
||||
LONG cbInFormat;
|
||||
|
||||
LPWAVEFORMATEX lpOutFormat;
|
||||
LONG cbOutFormat;
|
||||
|
||||
ACMSTREAMHEADER acmStreamHdr;
|
||||
} IAVIStreamImpl;
|
||||
|
||||
/***********************************************************************/
|
||||
|
||||
#define CONVERT_STREAM_to_THIS(a) do { \
|
||||
DWORD __bytes; \
|
||||
acmStreamSize(This->has,*(a) * This->lpInFormat->nBlockAlign,\
|
||||
&__bytes, ACM_STREAMSIZEF_SOURCE); \
|
||||
*(a) = __bytes / This->lpOutFormat->nBlockAlign; } while(0)
|
||||
|
||||
#define CONVERT_THIS_to_STREAM(a) do { \
|
||||
DWORD __bytes; \
|
||||
acmStreamSize(This->has,*(a) * This->lpOutFormat->nBlockAlign,\
|
||||
&__bytes, ACM_STREAMSIZEF_DESTINATION); \
|
||||
*(a) = __bytes / This->lpInFormat->nBlockAlign; } while(0)
|
||||
|
||||
static HRESULT AVIFILE_OpenCompressor(IAVIStreamImpl *This);
|
||||
|
||||
HRESULT AVIFILE_CreateACMStream(REFIID riid, LPVOID *ppv)
|
||||
{
|
||||
IAVIStreamImpl *pstream;
|
||||
HRESULT hr;
|
||||
|
||||
assert(riid != NULL && ppv != NULL);
|
||||
|
||||
*ppv = NULL;
|
||||
|
||||
pstream = (IAVIStreamImpl*)LocalAlloc(LPTR, sizeof(IAVIStreamImpl));
|
||||
if (pstream == NULL)
|
||||
return AVIERR_MEMORY;
|
||||
|
||||
pstream->lpVtbl = &iacmst;
|
||||
|
||||
hr = IAVIStream_QueryInterface((IAVIStream*)pstream, riid, ppv);
|
||||
if (FAILED(hr))
|
||||
LocalFree((HLOCAL)pstream);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ACMStream_fnQueryInterface(IAVIStream *iface,
|
||||
REFIID refiid, LPVOID *obj)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
|
||||
TRACE("(%p,%s,%p)\n", iface, debugstr_guid(refiid), obj);
|
||||
|
||||
if (IsEqualGUID(&IID_IUnknown, refiid) ||
|
||||
IsEqualGUID(&IID_IAVIStream, refiid)) {
|
||||
*obj = This;
|
||||
IAVIStream_AddRef(iface);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
return OLE_E_ENUM_NOMORE;
|
||||
}
|
||||
|
||||
static ULONG WINAPI ACMStream_fnAddRef(IAVIStream *iface)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
ULONG ref = InterlockedIncrement(&This->ref);
|
||||
|
||||
TRACE("(%p) -> %ld\n", iface, ref);
|
||||
|
||||
/* also add reference to the nested stream */
|
||||
if (This->pStream != NULL)
|
||||
IAVIStream_AddRef(This->pStream);
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
static ULONG WINAPI ACMStream_fnRelease(IAVIStream* iface)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
ULONG ref = InterlockedDecrement(&This->ref);
|
||||
|
||||
TRACE("(%p) -> %ld\n", iface, ref);
|
||||
|
||||
if (ref == 0) {
|
||||
/* destruct */
|
||||
if (This->has != NULL) {
|
||||
if (This->acmStreamHdr.fdwStatus & ACMSTREAMHEADER_STATUSF_PREPARED)
|
||||
acmStreamUnprepareHeader(This->has, &This->acmStreamHdr, 0);
|
||||
acmStreamClose(This->has, 0);
|
||||
This->has = NULL;
|
||||
}
|
||||
if (This->acmStreamHdr.pbSrc != NULL) {
|
||||
GlobalFreePtr(This->acmStreamHdr.pbSrc);
|
||||
This->acmStreamHdr.pbSrc = NULL;
|
||||
}
|
||||
if (This->acmStreamHdr.pbDst != NULL) {
|
||||
GlobalFreePtr(This->acmStreamHdr.pbDst);
|
||||
This->acmStreamHdr.pbDst = NULL;
|
||||
}
|
||||
if (This->lpInFormat != NULL) {
|
||||
GlobalFreePtr(This->lpInFormat);
|
||||
This->lpInFormat = NULL;
|
||||
This->cbInFormat = 0;
|
||||
}
|
||||
if (This->lpOutFormat != NULL) {
|
||||
GlobalFreePtr(This->lpOutFormat);
|
||||
This->lpOutFormat = NULL;
|
||||
This->cbOutFormat = 0;
|
||||
}
|
||||
if (This->pStream != NULL) {
|
||||
IAVIStream_Release(This->pStream);
|
||||
This->pStream = NULL;
|
||||
}
|
||||
LocalFree((HLOCAL)This);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* also release reference to the nested stream */
|
||||
if (This->pStream != NULL)
|
||||
IAVIStream_Release(This->pStream);
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
/* lParam1: PAVISTREAM
|
||||
* lParam2: LPAVICOMPRESSOPTIONS -- even if doc's say LPWAVEFORMAT
|
||||
*/
|
||||
static HRESULT WINAPI ACMStream_fnCreate(IAVIStream *iface, LPARAM lParam1,
|
||||
LPARAM lParam2)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
|
||||
TRACE("(%p,0x%08lX,0x%08lX)\n", iface, lParam1, lParam2);
|
||||
|
||||
/* check for swapped parameters */
|
||||
if ((LPVOID)lParam1 != NULL &&
|
||||
((LPAVICOMPRESSOPTIONS)lParam1)->fccType == streamtypeAUDIO) {
|
||||
register LPARAM tmp = lParam1;
|
||||
|
||||
lParam1 = lParam2;
|
||||
lParam2 = tmp;
|
||||
}
|
||||
|
||||
if ((LPVOID)lParam1 == NULL)
|
||||
return AVIERR_BADPARAM;
|
||||
|
||||
IAVIStream_Info((PAVISTREAM)lParam1, &This->sInfo, sizeof(This->sInfo));
|
||||
if (This->sInfo.fccType != streamtypeAUDIO)
|
||||
return AVIERR_ERROR; /* error in registry or AVIMakeCompressedStream */
|
||||
|
||||
This->sInfo.fccHandler = 0; /* be paranoid */
|
||||
|
||||
/* FIXME: check ACM version? Which version does we need? */
|
||||
|
||||
if ((LPVOID)lParam2 != NULL) {
|
||||
/* We only need the format from the compress-options */
|
||||
if (((LPAVICOMPRESSOPTIONS)lParam2)->fccType == streamtypeAUDIO)
|
||||
lParam2 = (LPARAM)((LPAVICOMPRESSOPTIONS)lParam2)->lpFormat;
|
||||
|
||||
if (((LPWAVEFORMATEX)lParam2)->wFormatTag != WAVE_FORMAT_PCM)
|
||||
This->cbOutFormat = sizeof(WAVEFORMATEX) + ((LPWAVEFORMATEX)lParam2)->cbSize;
|
||||
else
|
||||
This->cbOutFormat = sizeof(PCMWAVEFORMAT);
|
||||
|
||||
This->lpOutFormat = (LPWAVEFORMATEX)GlobalAllocPtr(GHND, This->cbOutFormat);
|
||||
if (This->lpOutFormat == NULL)
|
||||
return AVIERR_MEMORY;
|
||||
|
||||
memcpy(This->lpOutFormat, (LPVOID)lParam2, This->cbOutFormat);
|
||||
} else {
|
||||
This->lpOutFormat = NULL;
|
||||
This->cbOutFormat = 0;
|
||||
}
|
||||
|
||||
This->pStream = (PAVISTREAM)lParam1;
|
||||
IAVIStream_AddRef(This->pStream);
|
||||
|
||||
return AVIERR_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ACMStream_fnInfo(IAVIStream *iface,LPAVISTREAMINFOW psi,
|
||||
LONG size)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
|
||||
TRACE("(%p,%p,%ld)\n", iface, psi, size);
|
||||
|
||||
if (psi == NULL)
|
||||
return AVIERR_BADPARAM;
|
||||
if (size < 0)
|
||||
return AVIERR_BADSIZE;
|
||||
|
||||
/* Need codec to correct some values in structure */
|
||||
if (This->has == NULL) {
|
||||
HRESULT hr = AVIFILE_OpenCompressor(This);
|
||||
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
}
|
||||
|
||||
memcpy(psi, &This->sInfo, min(size, (LONG)sizeof(This->sInfo)));
|
||||
|
||||
if (size < (LONG)sizeof(This->sInfo))
|
||||
return AVIERR_BUFFERTOOSMALL;
|
||||
return AVIERR_OK;
|
||||
}
|
||||
|
||||
static LONG WINAPI ACMStream_fnFindSample(IAVIStream *iface, LONG pos,
|
||||
LONG flags)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
|
||||
TRACE("(%p,%ld,0x%08lX)\n",iface,pos,flags);
|
||||
|
||||
if (flags & FIND_FROM_START) {
|
||||
pos = This->sInfo.dwStart;
|
||||
flags &= ~(FIND_FROM_START|FIND_PREV);
|
||||
flags |= FIND_NEXT;
|
||||
}
|
||||
|
||||
/* convert pos from our 'space' to This->pStream's one */
|
||||
CONVERT_THIS_to_STREAM(&pos);
|
||||
|
||||
/* ask stream */
|
||||
pos = IAVIStream_FindSample(This->pStream, pos, flags);
|
||||
|
||||
if (pos != -1) {
|
||||
/* convert pos back to our 'space' if it's no size or physical pos */
|
||||
if ((flags & FIND_RET) == 0)
|
||||
CONVERT_STREAM_to_THIS(&pos);
|
||||
}
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ACMStream_fnReadFormat(IAVIStream *iface, LONG pos,
|
||||
LPVOID format, LONG *formatsize)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
|
||||
TRACE("(%p,%ld,%p,%p)\n", iface, pos, format, formatsize);
|
||||
|
||||
if (formatsize == NULL)
|
||||
return AVIERR_BADPARAM;
|
||||
|
||||
if (This->has == NULL) {
|
||||
HRESULT hr = AVIFILE_OpenCompressor(This);
|
||||
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
}
|
||||
|
||||
/* only interested in needed buffersize? */
|
||||
if (format == NULL || *formatsize <= 0) {
|
||||
*formatsize = This->cbOutFormat;
|
||||
|
||||
return AVIERR_OK;
|
||||
}
|
||||
|
||||
/* copy initial format (only as much as will fit) */
|
||||
memcpy(format, This->lpOutFormat, min(*formatsize, This->cbOutFormat));
|
||||
if (*formatsize < This->cbOutFormat) {
|
||||
*formatsize = This->cbOutFormat;
|
||||
return AVIERR_BUFFERTOOSMALL;
|
||||
}
|
||||
|
||||
*formatsize = This->cbOutFormat;
|
||||
return AVIERR_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ACMStream_fnSetFormat(IAVIStream *iface, LONG pos,
|
||||
LPVOID format, LONG formatsize)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p,%ld,%p,%ld)\n", iface, pos, format, formatsize);
|
||||
|
||||
/* check parameters */
|
||||
if (format == NULL || formatsize <= 0)
|
||||
return AVIERR_BADPARAM;
|
||||
|
||||
/* Input format already known?
|
||||
* Changing is unsupported, but be quiet if it's the same */
|
||||
if (This->lpInFormat != NULL) {
|
||||
if (This->cbInFormat != formatsize ||
|
||||
memcmp(format, This->lpInFormat, formatsize) != 0)
|
||||
return AVIERR_UNSUPPORTED;
|
||||
|
||||
return AVIERR_OK;
|
||||
}
|
||||
|
||||
/* Does the nested stream support writing? */
|
||||
if ((This->sInfo.dwCaps & AVIFILECAPS_CANWRITE) == 0)
|
||||
return AVIERR_READONLY;
|
||||
|
||||
This->lpInFormat = (LPWAVEFORMATEX)GlobalAllocPtr(GMEM_MOVEABLE, formatsize);
|
||||
if (This->lpInFormat == NULL)
|
||||
return AVIERR_MEMORY;
|
||||
This->cbInFormat = formatsize;
|
||||
memcpy(This->lpInFormat, format, formatsize);
|
||||
|
||||
/* initialize formats and get compressor */
|
||||
hr = AVIFILE_OpenCompressor(This);
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
CONVERT_THIS_to_STREAM(&pos);
|
||||
|
||||
/* tell the nested stream the new format */
|
||||
return IAVIStream_SetFormat(This->pStream, pos, This->lpOutFormat,
|
||||
This->cbOutFormat);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ACMStream_fnRead(IAVIStream *iface, LONG start,
|
||||
LONG samples, LPVOID buffer,
|
||||
LONG buffersize, LPLONG bytesread,
|
||||
LPLONG samplesread)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
|
||||
HRESULT hr;
|
||||
DWORD size;
|
||||
|
||||
TRACE("(%p,%ld,%ld,%p,%ld,%p,%p)\n", iface, start, samples, buffer,
|
||||
buffersize, bytesread, samplesread);
|
||||
|
||||
/* clear return parameters if given */
|
||||
if (bytesread != NULL)
|
||||
*bytesread = 0;
|
||||
if (samplesread != NULL)
|
||||
*samplesread = 0;
|
||||
|
||||
/* Do we have our compressor? */
|
||||
if (This->has == NULL) {
|
||||
hr = AVIFILE_OpenCompressor(This);
|
||||
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
}
|
||||
|
||||
/* only need to pass through? */
|
||||
if (This->cbInFormat == This->cbOutFormat &&
|
||||
memcmp(This->lpInFormat, This->lpOutFormat, This->cbInFormat) == 0) {
|
||||
return IAVIStream_Read(This->pStream, start, samples, buffer, buffersize,
|
||||
bytesread, samplesread);
|
||||
}
|
||||
|
||||
/* read as much as fit? */
|
||||
if (samples == -1)
|
||||
samples = buffersize / This->lpOutFormat->nBlockAlign;
|
||||
/* limit to buffersize */
|
||||
if (samples * This->lpOutFormat->nBlockAlign > buffersize)
|
||||
samples = buffersize / This->lpOutFormat->nBlockAlign;
|
||||
|
||||
/* only return needed size? */
|
||||
if (buffer == NULL || buffersize <= 0 || samples == 0) {
|
||||
if (bytesread == NULL && samplesread == NULL)
|
||||
return AVIERR_BADPARAM;
|
||||
|
||||
if (bytesread != NULL)
|
||||
*bytesread = samples * This->lpOutFormat->nBlockAlign;
|
||||
if (samplesread != NULL)
|
||||
*samplesread = samples;
|
||||
|
||||
return AVIERR_OK;
|
||||
}
|
||||
|
||||
/* map our positions to pStream positions */
|
||||
CONVERT_THIS_to_STREAM(&start);
|
||||
|
||||
/* our needed internal buffersize */
|
||||
size = samples * This->lpInFormat->nBlockAlign;
|
||||
|
||||
/* Need to free destination buffer used for writing? */
|
||||
if (This->acmStreamHdr.pbDst != NULL) {
|
||||
GlobalFreePtr(This->acmStreamHdr.pbDst);
|
||||
This->acmStreamHdr.pbDst = NULL;
|
||||
This->acmStreamHdr.dwDstUser = 0;
|
||||
}
|
||||
|
||||
/* need bigger source buffer? */
|
||||
if (This->acmStreamHdr.pbSrc == NULL ||
|
||||
This->acmStreamHdr.dwSrcUser < size) {
|
||||
if (This->acmStreamHdr.pbSrc == NULL)
|
||||
This->acmStreamHdr.pbSrc = GlobalAllocPtr(GMEM_MOVEABLE, size);
|
||||
else
|
||||
This->acmStreamHdr.pbSrc = GlobalReAllocPtr(This->acmStreamHdr.pbSrc,
|
||||
size, GMEM_MOVEABLE);
|
||||
if (This->acmStreamHdr.pbSrc == NULL)
|
||||
return AVIERR_MEMORY;
|
||||
This->acmStreamHdr.dwSrcUser = size;
|
||||
}
|
||||
|
||||
This->acmStreamHdr.cbStruct = sizeof(This->acmStreamHdr);
|
||||
This->acmStreamHdr.cbSrcLengthUsed = 0;
|
||||
This->acmStreamHdr.cbDstLengthUsed = 0;
|
||||
This->acmStreamHdr.cbSrcLength = size;
|
||||
|
||||
/* read source data */
|
||||
hr = IAVIStream_Read(This->pStream, start, -1, This->acmStreamHdr.pbSrc,
|
||||
This->acmStreamHdr.cbSrcLength,
|
||||
(LONG *)&This->acmStreamHdr.cbSrcLength, NULL);
|
||||
if (FAILED(hr) || This->acmStreamHdr.cbSrcLength == 0)
|
||||
return hr;
|
||||
|
||||
/* need to prepare stream? */
|
||||
This->acmStreamHdr.pbDst = buffer;
|
||||
This->acmStreamHdr.cbDstLength = buffersize;
|
||||
if ((This->acmStreamHdr.fdwStatus & ACMSTREAMHEADER_STATUSF_PREPARED) == 0) {
|
||||
if (acmStreamPrepareHeader(This->has, &This->acmStreamHdr, 0) != S_OK) {
|
||||
This->acmStreamHdr.pbDst = NULL;
|
||||
This->acmStreamHdr.cbDstLength = 0;
|
||||
return AVIERR_COMPRESSOR;
|
||||
}
|
||||
}
|
||||
|
||||
/* now do the conversion */
|
||||
/* FIXME: use ACM_CONVERTF_* flags */
|
||||
if (acmStreamConvert(This->has, &This->acmStreamHdr, 0) != S_OK)
|
||||
hr = AVIERR_COMPRESSOR;
|
||||
|
||||
This->acmStreamHdr.pbDst = NULL;
|
||||
This->acmStreamHdr.cbDstLength = 0;
|
||||
|
||||
/* fill out return parameters if given */
|
||||
if (bytesread != NULL)
|
||||
*bytesread = This->acmStreamHdr.cbDstLengthUsed;
|
||||
if (samplesread != NULL)
|
||||
*samplesread =
|
||||
This->acmStreamHdr.cbDstLengthUsed / This->lpOutFormat->nBlockAlign;
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ACMStream_fnWrite(IAVIStream *iface, LONG start,
|
||||
LONG samples, LPVOID buffer,
|
||||
LONG buffersize, DWORD flags,
|
||||
LPLONG sampwritten,
|
||||
LPLONG byteswritten)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
|
||||
HRESULT hr;
|
||||
ULONG size;
|
||||
|
||||
TRACE("(%p,%ld,%ld,%p,%ld,0x%08lX,%p,%p)\n", iface, start, samples,
|
||||
buffer, buffersize, flags, sampwritten, byteswritten);
|
||||
|
||||
/* clear return parameters if given */
|
||||
if (sampwritten != NULL)
|
||||
*sampwritten = 0;
|
||||
if (byteswritten != NULL)
|
||||
*byteswritten = 0;
|
||||
|
||||
/* check parameters */
|
||||
if (buffer == NULL && (buffersize > 0 || samples > 0))
|
||||
return AVIERR_BADPARAM;
|
||||
|
||||
/* Have we write capability? */
|
||||
if ((This->sInfo.dwCaps & AVIFILECAPS_CANWRITE) == 0)
|
||||
return AVIERR_READONLY;
|
||||
|
||||
/* also need a compressor */
|
||||
if (This->has == NULL)
|
||||
return AVIERR_NOCOMPRESSOR;
|
||||
|
||||
/* map our sizes to pStream sizes */
|
||||
size = buffersize;
|
||||
CONVERT_THIS_to_STREAM(&size);
|
||||
CONVERT_THIS_to_STREAM(&start);
|
||||
|
||||
/* no bytes to write? -- short circuit */
|
||||
if (size == 0) {
|
||||
return IAVIStream_Write(This->pStream, -1, samples, buffer, size,
|
||||
flags, sampwritten, byteswritten);
|
||||
}
|
||||
|
||||
/* Need to free source buffer used for reading? */
|
||||
if (This->acmStreamHdr.pbSrc != NULL) {
|
||||
GlobalFreePtr(This->acmStreamHdr.pbSrc);
|
||||
This->acmStreamHdr.pbSrc = NULL;
|
||||
This->acmStreamHdr.dwSrcUser = 0;
|
||||
}
|
||||
|
||||
/* Need bigger destination buffer? */
|
||||
if (This->acmStreamHdr.pbDst == NULL ||
|
||||
This->acmStreamHdr.dwDstUser < size) {
|
||||
if (This->acmStreamHdr.pbDst == NULL)
|
||||
This->acmStreamHdr.pbDst = GlobalAllocPtr(GMEM_MOVEABLE, size);
|
||||
else
|
||||
This->acmStreamHdr.pbDst = GlobalReAllocPtr(This->acmStreamHdr.pbDst,
|
||||
size, GMEM_MOVEABLE);
|
||||
if (This->acmStreamHdr.pbDst == NULL)
|
||||
return AVIERR_MEMORY;
|
||||
This->acmStreamHdr.dwDstUser = size;
|
||||
}
|
||||
This->acmStreamHdr.cbStruct = sizeof(This->acmStreamHdr);
|
||||
This->acmStreamHdr.cbSrcLengthUsed = 0;
|
||||
This->acmStreamHdr.cbDstLengthUsed = 0;
|
||||
This->acmStreamHdr.cbDstLength = This->acmStreamHdr.dwDstUser;
|
||||
|
||||
/* need to prepare stream? */
|
||||
This->acmStreamHdr.pbSrc = buffer;
|
||||
This->acmStreamHdr.cbSrcLength = buffersize;
|
||||
if ((This->acmStreamHdr.fdwStatus & ACMSTREAMHEADER_STATUSF_PREPARED) == 0) {
|
||||
if (acmStreamPrepareHeader(This->has, &This->acmStreamHdr, 0) != S_OK) {
|
||||
This->acmStreamHdr.pbSrc = NULL;
|
||||
This->acmStreamHdr.cbSrcLength = 0;
|
||||
return AVIERR_COMPRESSOR;
|
||||
}
|
||||
}
|
||||
|
||||
/* now do the conversion */
|
||||
/* FIXME: use ACM_CONVERTF_* flags */
|
||||
if (acmStreamConvert(This->has, &This->acmStreamHdr, 0) != S_OK)
|
||||
hr = AVIERR_COMPRESSOR;
|
||||
else
|
||||
hr = AVIERR_OK;
|
||||
|
||||
This->acmStreamHdr.pbSrc = NULL;
|
||||
This->acmStreamHdr.cbSrcLength = 0;
|
||||
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
return IAVIStream_Write(This->pStream,-1,This->acmStreamHdr.cbDstLengthUsed /
|
||||
This->lpOutFormat->nBlockAlign,This->acmStreamHdr.pbDst,
|
||||
This->acmStreamHdr.cbDstLengthUsed,flags,sampwritten,
|
||||
byteswritten);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ACMStream_fnDelete(IAVIStream *iface, LONG start,
|
||||
LONG samples)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
|
||||
TRACE("(%p,%ld,%ld)\n", iface, start, samples);
|
||||
|
||||
/* check parameters */
|
||||
if (start < 0 || samples < 0)
|
||||
return AVIERR_BADPARAM;
|
||||
|
||||
/* Delete before start of stream? */
|
||||
if ((DWORD)(start + samples) < This->sInfo.dwStart)
|
||||
return AVIERR_OK;
|
||||
|
||||
/* Delete after end of stream? */
|
||||
if ((DWORD)start > This->sInfo.dwLength)
|
||||
return AVIERR_OK;
|
||||
|
||||
/* For the rest we need write capability */
|
||||
if ((This->sInfo.dwCaps & AVIFILECAPS_CANWRITE) == 0)
|
||||
return AVIERR_READONLY;
|
||||
|
||||
/* A compressor is also necessary */
|
||||
if (This->has == NULL)
|
||||
return AVIERR_NOCOMPRESSOR;
|
||||
|
||||
/* map our positions to pStream positions */
|
||||
CONVERT_THIS_to_STREAM(&start);
|
||||
CONVERT_THIS_to_STREAM(&samples);
|
||||
|
||||
return IAVIStream_Delete(This->pStream, start, samples);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ACMStream_fnReadData(IAVIStream *iface, DWORD fcc,
|
||||
LPVOID lp, LPLONG lpread)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
|
||||
TRACE("(%p,0x%08lX,%p,%p)\n", iface, fcc, lp, lpread);
|
||||
|
||||
assert(This->pStream != NULL);
|
||||
|
||||
return IAVIStream_ReadData(This->pStream, fcc, lp, lpread);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ACMStream_fnWriteData(IAVIStream *iface, DWORD fcc,
|
||||
LPVOID lp, LONG size)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
|
||||
TRACE("(%p,0x%08lx,%p,%ld)\n", iface, fcc, lp, size);
|
||||
|
||||
assert(This->pStream != NULL);
|
||||
|
||||
return IAVIStream_WriteData(This->pStream, fcc, lp, size);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ACMStream_fnSetInfo(IAVIStream *iface,
|
||||
LPAVISTREAMINFOW info, LONG infolen)
|
||||
{
|
||||
FIXME("(%p,%p,%ld): stub\n", iface, info, infolen);
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/***********************************************************************/
|
||||
|
||||
static HRESULT AVIFILE_OpenCompressor(IAVIStreamImpl *This)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
/* pre-conditions */
|
||||
assert(This != NULL);
|
||||
assert(This->pStream != NULL);
|
||||
|
||||
if (This->has != NULL)
|
||||
return AVIERR_OK;
|
||||
|
||||
if (This->lpInFormat == NULL) {
|
||||
/* decode or encode the data from pStream */
|
||||
hr = AVIStreamFormatSize(This->pStream, This->sInfo.dwStart, &This->cbInFormat);
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
This->lpInFormat = (LPWAVEFORMATEX)GlobalAllocPtr(GMEM_MOVEABLE, This->cbInFormat);
|
||||
if (This->lpInFormat == NULL)
|
||||
return AVIERR_MEMORY;
|
||||
|
||||
hr = IAVIStream_ReadFormat(This->pStream, This->sInfo.dwStart,
|
||||
This->lpInFormat, &This->cbInFormat);
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
if (This->lpOutFormat == NULL) {
|
||||
/* we must decode to default format */
|
||||
This->cbOutFormat = sizeof(PCMWAVEFORMAT);
|
||||
This->lpOutFormat = (LPWAVEFORMATEX)GlobalAllocPtr(GHND, This->cbOutFormat);
|
||||
if (This->lpOutFormat == NULL)
|
||||
return AVIERR_MEMORY;
|
||||
|
||||
This->lpOutFormat->wFormatTag = WAVE_FORMAT_PCM;
|
||||
if (acmFormatSuggest(NULL, This->lpInFormat, This->lpOutFormat,
|
||||
This->cbOutFormat, ACM_FORMATSUGGESTF_WFORMATTAG) != S_OK)
|
||||
return AVIERR_NOCOMPRESSOR;
|
||||
}
|
||||
} else if (This->lpOutFormat == NULL)
|
||||
return AVIERR_ERROR; /* To what should I encode? */
|
||||
|
||||
if (acmStreamOpen(&This->has, NULL, This->lpInFormat, This->lpOutFormat,
|
||||
NULL, 0, 0, ACM_STREAMOPENF_NONREALTIME) != S_OK)
|
||||
return AVIERR_NOCOMPRESSOR;
|
||||
|
||||
/* update AVISTREAMINFO structure */
|
||||
This->sInfo.dwSampleSize = This->lpOutFormat->nBlockAlign;
|
||||
This->sInfo.dwScale = This->lpOutFormat->nBlockAlign;
|
||||
This->sInfo.dwRate = This->lpOutFormat->nAvgBytesPerSec;
|
||||
This->sInfo.dwQuality = (DWORD)ICQUALITY_DEFAULT;
|
||||
SetRectEmpty(&This->sInfo.rcFrame);
|
||||
|
||||
/* convert positions ansd sizes to output format */
|
||||
CONVERT_STREAM_to_THIS(&This->sInfo.dwStart);
|
||||
CONVERT_STREAM_to_THIS(&This->sInfo.dwLength);
|
||||
CONVERT_STREAM_to_THIS(&This->sInfo.dwSuggestedBufferSize);
|
||||
|
||||
return AVIERR_OK;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,79 @@
|
||||
@ stdcall AVIBuildFilter(str long long) AVIBuildFilterA
|
||||
@ stdcall AVIBuildFilterA(str long long)
|
||||
@ stdcall AVIBuildFilterW(wstr long long)
|
||||
@ stdcall AVIClearClipboard()
|
||||
@ stdcall AVIFileAddRef(ptr)
|
||||
@ stdcall AVIFileCreateStream(ptr ptr ptr) AVIFileCreateStreamA
|
||||
@ stdcall AVIFileCreateStreamA(ptr ptr ptr)
|
||||
@ stdcall AVIFileCreateStreamW(ptr ptr ptr)
|
||||
@ stdcall AVIFileEndRecord(ptr)
|
||||
@ stdcall AVIFileExit()
|
||||
@ stdcall AVIFileGetStream(ptr ptr long long)
|
||||
@ stdcall AVIFileInfo (ptr ptr long) AVIFileInfoA # A in both Win95 and NT
|
||||
@ stdcall AVIFileInfoA(ptr ptr long)
|
||||
@ stdcall AVIFileInfoW(ptr ptr long)
|
||||
@ stdcall AVIFileInit()
|
||||
@ stdcall AVIFileOpen(ptr str long ptr) AVIFileOpenA
|
||||
@ stdcall AVIFileOpenA(ptr str long ptr)
|
||||
@ stdcall AVIFileOpenW(ptr wstr long ptr)
|
||||
@ stdcall AVIFileReadData(ptr long ptr ptr)
|
||||
@ stdcall AVIFileRelease(ptr)
|
||||
@ stdcall AVIFileWriteData(ptr long ptr long)
|
||||
@ stdcall AVIGetFromClipboard(ptr)
|
||||
@ stdcall AVIMakeCompressedStream(ptr ptr ptr ptr)
|
||||
@ stdcall AVIMakeFileFromStreams(ptr long ptr)
|
||||
@ stdcall AVIMakeStreamFromClipboard(long long ptr)
|
||||
@ stdcall AVIPutFileOnClipboard(ptr)
|
||||
@ varargs AVISave(str ptr ptr long ptr ptr) AVISaveA
|
||||
@ varargs AVISaveA(str ptr ptr long ptr ptr)
|
||||
@ stdcall AVISaveOptions(long long long ptr ptr)
|
||||
@ stdcall AVISaveOptionsFree(long ptr)
|
||||
@ stdcall AVISaveV(str ptr ptr long ptr ptr) AVISaveVA
|
||||
@ stdcall AVISaveVA(str ptr ptr long ptr ptr)
|
||||
@ stdcall AVISaveVW(wstr ptr ptr long ptr ptr)
|
||||
@ varargs AVISaveW(wstr ptr ptr long ptr ptr)
|
||||
@ stdcall AVIStreamAddRef(ptr)
|
||||
@ stdcall AVIStreamBeginStreaming(ptr long long long)
|
||||
@ stdcall AVIStreamCreate(ptr long long ptr)
|
||||
@ stdcall AVIStreamEndStreaming(ptr)
|
||||
@ stdcall AVIStreamFindSample(ptr long long)
|
||||
@ stdcall AVIStreamGetFrame(ptr long)
|
||||
@ stdcall AVIStreamGetFrameClose(ptr)
|
||||
@ stdcall AVIStreamGetFrameOpen(ptr ptr)
|
||||
@ stdcall AVIStreamInfo (ptr ptr long) AVIStreamInfoA
|
||||
@ stdcall AVIStreamInfoA(ptr ptr long)
|
||||
@ stdcall AVIStreamInfoW(ptr ptr long)
|
||||
@ stdcall AVIStreamLength(ptr)
|
||||
@ stdcall AVIStreamOpenFromFile (ptr str long long long ptr) AVIStreamOpenFromFileA
|
||||
@ stdcall AVIStreamOpenFromFileA(ptr str long long long ptr)
|
||||
@ stdcall AVIStreamOpenFromFileW(ptr wstr long long long ptr)
|
||||
@ stdcall AVIStreamRead(ptr long long ptr long ptr ptr)
|
||||
@ stdcall AVIStreamReadData(ptr long ptr ptr)
|
||||
@ stdcall AVIStreamReadFormat(ptr long ptr long)
|
||||
@ stdcall AVIStreamRelease(ptr)
|
||||
@ stdcall AVIStreamSampleToTime(ptr long)
|
||||
@ stdcall AVIStreamSetFormat(ptr long ptr long)
|
||||
@ stdcall AVIStreamStart(ptr)
|
||||
@ stdcall AVIStreamTimeToSample(ptr long)
|
||||
@ stdcall AVIStreamWrite(ptr long long ptr long long ptr ptr)
|
||||
@ stdcall AVIStreamWriteData(ptr long ptr long)
|
||||
@ extern CLSID_AVISimpleUnMarshal
|
||||
@ stdcall CreateEditableStream(ptr ptr)
|
||||
@ stdcall -private DllCanUnloadNow()
|
||||
@ stdcall -private DllGetClassObject(ptr ptr ptr)
|
||||
@ stdcall -private DllRegisterServer()
|
||||
@ stdcall -private DllUnregisterServer()
|
||||
@ stdcall EditStreamClone(ptr ptr)
|
||||
@ stdcall EditStreamCopy(ptr ptr ptr ptr)
|
||||
@ stdcall EditStreamCut(ptr ptr ptr ptr)
|
||||
@ stdcall EditStreamPaste(ptr ptr ptr ptr long long)
|
||||
@ stdcall EditStreamSetInfo(ptr ptr long) EditStreamSetInfoA
|
||||
@ stdcall EditStreamSetInfoA(ptr ptr long)
|
||||
@ stdcall EditStreamSetInfoW(ptr ptr long)
|
||||
@ stdcall EditStreamSetName(ptr str) EditStreamSetNameA
|
||||
@ stdcall EditStreamSetNameA(ptr str)
|
||||
@ stdcall EditStreamSetNameW(ptr wstr)
|
||||
@ extern IID_IAVIEditStream
|
||||
@ extern IID_IAVIFile
|
||||
@ extern IID_IAVIStream
|
||||
@ extern IID_IGetFrame
|
||||
@@ -0,0 +1,28 @@
|
||||
<module name="avifil32" type="win32dll" baseaddress="${BASEADDRESS_AVIFIL32}" installbase="system32" installname="avifil32.dll">
|
||||
<importlibrary definition="avifil32.spec.def" />
|
||||
<include base="avifil32">.</include>
|
||||
<include base="ReactOS">include/wine</include>
|
||||
<define name="__USE_W32API" />
|
||||
<define name="_WIN32_WINNT">0x501</define>
|
||||
<library>uuid</library>
|
||||
<library>ntdll</library>
|
||||
<library>winmm</library>
|
||||
<library>ole32</library>
|
||||
<library>msvfw32</library>
|
||||
<library>msacm32</library>
|
||||
<library>kernel32</library>
|
||||
<library>wine</library>
|
||||
<file>acmstream.c</file>
|
||||
<file>api.c</file>
|
||||
<file>avifile.c</file>
|
||||
<file>editstream.c</file>
|
||||
<file>extrachunk.c</file>
|
||||
<file>factory.c</file>
|
||||
<file>getframe.c</file>
|
||||
<file>icmstream.c</file>
|
||||
<file>regsvr.c</file>
|
||||
<file>tmpfile.c</file>
|
||||
<file>wavfile.c</file>
|
||||
<file>rsrc.rc</file>
|
||||
<file>avifil32.spec</file>
|
||||
</module>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,64 @@
|
||||
# I'm just using "long" instead of "ptr" for the interface pointers,
|
||||
# because they are 32-bit pointers, not converted to 16-bit format,
|
||||
# but the app doesn't really need to know, it should never need to
|
||||
# dereference the interface pointer itself (if we're lucky)...
|
||||
|
||||
#1 stub WEP
|
||||
2 stub DLLGETCLASSOBJECT
|
||||
3 stub DLLCANUNLOADNOW
|
||||
4 stub ___EXPORTEDSTUB
|
||||
10 stub _IID_IAVISTREAM
|
||||
11 stub _IID_IAVIFILE
|
||||
12 stub _IID_IAVIEDITSTREAM
|
||||
13 stub _IID_IGETFRAME
|
||||
14 stub _CLSID_AVISIMPLEUNMARSHAL
|
||||
100 pascal AVIFileInit() AVIFileInit
|
||||
101 pascal AVIFileExit() AVIFileExit
|
||||
102 pascal AVIFileOpen(ptr str word ptr) AVIFileOpenA
|
||||
103 pascal AVIStreamOpenFromFile(ptr str long long word ptr) AVIStreamOpenFromFileA
|
||||
104 pascal AVIStreamCreate(ptr long long ptr) AVIStreamCreate
|
||||
105 stub AVIMAKECOMPRESSEDSTREAM
|
||||
106 stub AVIMAKEFILEFROMSTREAMS
|
||||
107 stub AVIMAKESTREAMFROMCLIPBOARD
|
||||
110 pascal AVIStreamGetFrame(long long) AVIStreamGetFrame
|
||||
111 pascal AVIStreamGetFrameClose(long) AVIStreamGetFrameClose
|
||||
112 pascal AVIStreamGetFrameOpen(long ptr) AVIStreamGetFrameOpen
|
||||
120 stub _AVISAVE
|
||||
121 stub AVISAVEV
|
||||
122 stub AVISAVEOPTIONS
|
||||
123 pascal AVIBuildFilter(str long word) AVIBuildFilterA
|
||||
124 pascal AVISaveOptionsFree(word ptr) AVISaveOptionsFree
|
||||
130 pascal AVIStreamStart(long) AVIStreamStart
|
||||
131 pascal AVIStreamLength(long) AVIStreamLength
|
||||
132 pascal AVIStreamTimeToSample(long long) AVIStreamTimeToSample
|
||||
133 pascal AVIStreamSampleToTime(long long) AVIStreamSampleToTime
|
||||
140 pascal AVIFileAddRef(long) AVIFileAddRef
|
||||
141 pascal AVIFileRelease(long) AVIFileRelease
|
||||
142 pascal AVIFileInfo(long ptr long) AVIFileInfoA
|
||||
143 pascal AVIFileGetStream(long ptr long long) AVIFileGetStream
|
||||
144 pascal AVIFileCreateStream(long ptr ptr) AVIFileCreateStreamA
|
||||
146 pascal AVIFileWriteData(long long ptr long) AVIFileWriteData
|
||||
147 pascal AVIFileReadData(long long ptr ptr) AVIFileReadData
|
||||
148 pascal AVIFileEndRecord(long) AVIFileEndRecord
|
||||
160 pascal AVIStreamAddRef(long) AVIStreamAddRef
|
||||
161 pascal AVIStreamRelease(long) AVIStreamRelease
|
||||
162 pascal AVIStreamInfo(long ptr long) AVIStreamInfoA
|
||||
163 pascal AVIStreamFindSample(long long long) AVIStreamFindSample
|
||||
164 pascal AVIStreamReadFormat(long long ptr ptr) AVIStreamReadFormat
|
||||
165 pascal AVIStreamReadData(long long ptr ptr) AVIStreamReadData
|
||||
166 pascal AVIStreamWriteData(long long ptr long) AVIStreamWriteData
|
||||
167 pascal AVIStreamRead(long long long ptr long ptr ptr) AVIStreamRead
|
||||
168 pascal AVIStreamWrite(long long long ptr long long ptr ptr) AVIStreamWrite
|
||||
169 pascal AVIStreamSetFormat(long long ptr long) AVIStreamSetFormat
|
||||
180 stub EDITSTREAMCOPY
|
||||
181 stub EDITSTREAMCUT
|
||||
182 stub EDITSTREAMPASTE
|
||||
184 stub CREATEEDITABLESTREAM
|
||||
185 stub AVIPUTFILEONCLIPBOARD
|
||||
187 stub AVIGETFROMCLIPBOARD
|
||||
188 stub AVICLEARCLIPBOARD
|
||||
190 stub EDITSTREAMCLONE
|
||||
191 stub EDITSTREAMSETNAME
|
||||
192 stub EDITSTREAMSETINFO
|
||||
200 stub AVISTREAMBEGINSTREAMING
|
||||
201 stub AVISTREAMENDSTREAMING
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright 2002 Michael Günnewig
|
||||
*
|
||||
* Czech resources for avifile
|
||||
* Copyright 2004 David Kredba
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
|
||||
|
||||
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Nastavení komprese"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "&Vyber datový proud:",-1,2,5,114,10
|
||||
COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
PUSHBUTTON "V&olby...",IDC_OPTIONS,145,17,45,14
|
||||
AUTOCHECKBOX "Prolo¾&it ka¾dých",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP
|
||||
EDITTEXT IDC_INTERLEAVEEVERY,66,41,32,12,ES_AUTOHSCROLL
|
||||
LTEXT "rámcù",-1,104,43,36,9
|
||||
LTEXT "Souèasný formát:",-1,3,56,53,9
|
||||
LTEXT "Zbývající místo",IDC_FORMATTEXT,55,56,90,26
|
||||
DEFPUSHBUTTON "Budi¾",IDOK,145,42,45,14
|
||||
PUSHBUTTON "Zru¹it",IDCANCEL,145,61,45,14
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_WAVESTREAMFORMAT "Waveform: %s"
|
||||
IDS_WAVEFILETYPE "Waveform"
|
||||
IDS_ALLMULTIMEDIA "V¹echny soubory multimédií"
|
||||
IDS_ALLFILES "V¹echny soubory (*.*)@*.*"
|
||||
IDS_VIDEO "video"
|
||||
IDS_AUDIO "audio"
|
||||
IDS_AVISTREAMFORMAT "%s %s #%d"
|
||||
IDS_AVIFILETYPE "Wine AVI-default-filehandler"
|
||||
IDS_UNCOMPRESSED "nekomprimovaný"
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright 2002 Michael Günnewig
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
|
||||
|
||||
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Komprimierungsoptionen"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "&Wählen Sie die Eingangsdaten aus:",-1,2,5,114,10
|
||||
COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
PUSHBUTTON "&Optionen...",IDC_OPTIONS,145,17,45,14
|
||||
AUTOCHECKBOX "&Interleave alle",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP
|
||||
EDITTEXT IDC_INTERLEAVEEVERY,66,41,32,12,ES_AUTOHSCROLL
|
||||
LTEXT "Einzelbilder",-1,104,43,36,9
|
||||
LTEXT "Akuelles Format:",-1,3,56,53,9
|
||||
LTEXT "This space for rent",IDC_FORMATTEXT,55,56,90,26
|
||||
DEFPUSHBUTTON "OK",IDOK,145,42,45,14
|
||||
PUSHBUTTON "Abbrechen",IDCANCEL,145,61,45,14
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_WAVESTREAMFORMAT "Waveform: %s"
|
||||
IDS_WAVEFILETYPE "Waveform"
|
||||
IDS_ALLMULTIMEDIA "Alle Multimedia-Dateien"
|
||||
IDS_ALLFILES "Alle Dateien (*.*)@*.*"
|
||||
IDS_VIDEO "Video"
|
||||
IDS_AUDIO "Audio"
|
||||
IDS_AVISTREAMFORMAT "%s %s #%d"
|
||||
IDS_AVIFILETYPE "Wine AVI-Standard-Dateibehandlungsroutine"
|
||||
IDS_UNCOMPRESSED "Unkomprimiert"
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright 2002 Michael Günnewig
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
|
||||
|
||||
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Compress options"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "&Choose a stream:",-1,2,5,114,10
|
||||
COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
PUSHBUTTON "&Options...",IDC_OPTIONS,145,17,45,14
|
||||
AUTOCHECKBOX "&Interleave every",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP
|
||||
EDITTEXT IDC_INTERLEAVEEVERY,66,41,32,12,ES_AUTOHSCROLL
|
||||
LTEXT "frames",-1,104,43,36,9
|
||||
LTEXT "Current format:",-1,3,56,53,9
|
||||
LTEXT "This space for rent",IDC_FORMATTEXT,55,56,90,26
|
||||
DEFPUSHBUTTON "OK",IDOK,145,42,45,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,145,61,45,14
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_WAVESTREAMFORMAT "Waveform: %s"
|
||||
IDS_WAVEFILETYPE "Waveform"
|
||||
IDS_ALLMULTIMEDIA "All multimedia files"
|
||||
IDS_ALLFILES "All files (*.*)@*.*"
|
||||
IDS_VIDEO "video"
|
||||
IDS_AUDIO "audio"
|
||||
IDS_AVISTREAMFORMAT "%s %s #%d"
|
||||
IDS_AVIFILETYPE "Wine AVI-default-filehandler"
|
||||
IDS_UNCOMPRESSED "uncompressed"
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright 2003 José Manuel Ferrer Ortiz
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL
|
||||
|
||||
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Opciones de compresión"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "&Elija un stream:",-1,2,5,114,10
|
||||
COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
PUSHBUTTON "&Opciones...",IDC_OPTIONS,145,17,45,14
|
||||
AUTOCHECKBOX "&Interleave cada",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP
|
||||
EDITTEXT IDC_INTERLEAVEEVERY,66,41,32,12,ES_AUTOHSCROLL
|
||||
LTEXT "cuadros",-1,104,43,36,9
|
||||
LTEXT "Formato actual:",-1,3,56,53,9
|
||||
LTEXT "Espacio en alquiler",IDC_FORMATTEXT,55,56,90,26
|
||||
DEFPUSHBUTTON "Aceptar",IDOK,145,42,45,14
|
||||
PUSHBUTTON "Cancelar",IDCANCEL,145,61,45,14
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_WAVESTREAMFORMAT "Formato de ondas: %s"
|
||||
IDS_WAVEFILETYPE "Formato de ondas"
|
||||
IDS_ALLMULTIMEDIA "Todos los archivos multimedia"
|
||||
IDS_ALLFILES "Todos los archivos (*.*)@*.*"
|
||||
IDS_VIDEO "vídeo"
|
||||
IDS_AUDIO "audio"
|
||||
IDS_AVISTREAMFORMAT "%s %s #%d"
|
||||
IDS_AVIFILETYPE "Manejador de archivo AVI por defecto de Wine"
|
||||
IDS_UNCOMPRESSED "sin compresión"
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Avifil32
|
||||
* French language support
|
||||
*
|
||||
* Copyright 2002 Michael Günnewig
|
||||
* Copyright 2003 Vincent Béron
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
|
||||
|
||||
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Options de compression"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "&Sélectionnez un flux :",-1,2,5,114,10
|
||||
COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
PUSHBUTTON "&Options...",IDC_OPTIONS,145,17,45,14
|
||||
AUTOCHECKBOX "&Imbriquer à chaque",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP
|
||||
EDITTEXT IDC_INTERLEAVEEVERY,66,41,32,12,ES_AUTOHSCROLL
|
||||
LTEXT "images",-1,104,43,36,9
|
||||
LTEXT "Format actuel :",-1,3,56,53,9
|
||||
LTEXT "Cet espace est à louer",IDC_FORMATTEXT,55,56,90,26
|
||||
DEFPUSHBUTTON "OK",IDOK,145,42,45,14
|
||||
PUSHBUTTON "Annuler",IDCANCEL,145,61,45,14
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_WAVESTREAMFORMAT "Waveform: %s"
|
||||
IDS_WAVEFILETYPE "Waveform"
|
||||
IDS_ALLMULTIMEDIA "Tous les fichiers multimédias"
|
||||
IDS_ALLFILES "Tous les fichier (*.*)@*.*"
|
||||
IDS_VIDEO "vidéo"
|
||||
IDS_AUDIO "audio"
|
||||
IDS_AVISTREAMFORMAT "%s %s #%d"
|
||||
IDS_AVIFILETYPE "Wine AVI-default-filehandler"
|
||||
IDS_UNCOMPRESSED "non compressé"
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2002 Michael Günnewig
|
||||
* Copyright 2003 Ivan Leo Puoti
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_ITALIAN, SUBLANG_DEFAULT
|
||||
|
||||
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Opzioni di compressione"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "&Scegliere un flusso:",-1,2,5,114,10
|
||||
COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
PUSHBUTTON "&Opzioni...",IDC_OPTIONS,145,17,45,14
|
||||
AUTOCHECKBOX "&Interfoliazione ogni",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP
|
||||
EDITTEXT IDC_INTERLEAVEEVERY,66,41,32,12,ES_AUTOHSCROLL
|
||||
LTEXT "fotogrammi",-1,104,43,36,9
|
||||
LTEXT "Formato attuale:",-1,3,56,53,9
|
||||
LTEXT "This space for rent",IDC_FORMATTEXT,55,56,90,26
|
||||
DEFPUSHBUTTON "OK",IDOK,145,42,45,14
|
||||
PUSHBUTTON "Annulla",IDCANCEL,145,61,45,14
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_WAVESTREAMFORMAT "Formato wave: %s"
|
||||
IDS_WAVEFILETYPE "Formato wave"
|
||||
IDS_ALLMULTIMEDIA "Tutti i file multimediali"
|
||||
IDS_ALLFILES "Tutti i file (*.*)@*.*"
|
||||
IDS_VIDEO "Video"
|
||||
IDS_AUDIO "Audio"
|
||||
IDS_AVISTREAMFORMAT "%s %s #%d"
|
||||
IDS_AVIFILETYPE "Gestore predefinito di Wine dei file AVI"
|
||||
IDS_UNCOMPRESSED "Non compresso"
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright 2004 Hajime Segawa
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
|
||||
|
||||
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "圧縮オプション"
|
||||
FONT 9, "MS UI Gothic"
|
||||
BEGIN
|
||||
LTEXT "ストリームを選択(&C):",-1,2,5,114,10
|
||||
COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
PUSHBUTTON "オプション(&O)...",IDC_OPTIONS,145,17,45,14
|
||||
AUTOCHECKBOX "インターリーブ(&I)",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP
|
||||
EDITTEXT IDC_INTERLEAVEEVERY,66,41,32,12,ES_AUTOHSCROLL
|
||||
LTEXT "フレーム",-1,104,43,36,9
|
||||
LTEXT "現在のフォーマット:",-1,3,56,53,9
|
||||
LTEXT "This space for rent",IDC_FORMATTEXT,55,56,90,26
|
||||
DEFPUSHBUTTON "OK",IDOK,145,42,45,14
|
||||
PUSHBUTTON "キャンセル",IDCANCEL,145,61,45,14
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_WAVESTREAMFORMAT "Waveファイル: %s"
|
||||
IDS_WAVEFILETYPE "Waveファイル"
|
||||
IDS_ALLMULTIMEDIA "全てのマルチメディアファイル"
|
||||
IDS_ALLFILES "全てのファイル (*.*)@*.*"
|
||||
IDS_VIDEO "ビデオ"
|
||||
IDS_AUDIO "音声"
|
||||
IDS_AVISTREAMFORMAT "%s %s #%d"
|
||||
IDS_AVIFILETYPE "Wine AVI-default-filehandler"
|
||||
IDS_UNCOMPRESSED "未圧縮"
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* avifile (Dutch resources)
|
||||
*
|
||||
* Copyright 2003 Hans Leidekker
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_DUTCH, SUBLANG_DEFAULT
|
||||
|
||||
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Compressie-instellingen"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "&Kies een invoerbestand:",-1,2,5,114,10
|
||||
COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
PUSHBUTTON "&Opties...",IDC_OPTIONS,145,17,45,14
|
||||
AUTOCHECKBOX "&Interleave alle",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP
|
||||
EDITTEXT IDC_INTERLEAVEEVERY,66,41,32,12,ES_AUTOHSCROLL
|
||||
LTEXT "Losse frames",-1,104,43,36,9
|
||||
LTEXT "Huidig formaat:",-1,3,56,53,9
|
||||
LTEXT "This space for rent",IDC_FORMATTEXT,55,56,90,26
|
||||
DEFPUSHBUTTON "OK",IDOK,145,42,45,14
|
||||
PUSHBUTTON "Annuleren",IDCANCEL,145,61,45,14
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_WAVESTREAMFORMAT "Waveform: %s"
|
||||
IDS_WAVEFILETYPE "Waveform"
|
||||
IDS_ALLMULTIMEDIA "Alle multimediabestanden"
|
||||
IDS_ALLFILES "Alle bestanden (*.*)@*.*"
|
||||
IDS_VIDEO "video"
|
||||
IDS_AUDIO "audio"
|
||||
IDS_AVISTREAMFORMAT "%s %s #%d"
|
||||
IDS_AVIFILETYPE "Wine AVI-standaard-bestandskoppeling"
|
||||
IDS_UNCOMPRESSED "ongecomprimeerd"
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright 2005 Alexander N. Sørnes <[email protected]>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL
|
||||
|
||||
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Komprimeringsinnstillinger"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "&Velg en strøm:",-1,2,5,114,10
|
||||
COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
PUSHBUTTON "I&nnstillinger . . .",IDC_OPTIONS,145,17,45,14
|
||||
AUTOCHECKBOX "Sett &inn for hver",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP
|
||||
EDITTEXT IDC_INTERLEAVEEVERY,66,41,32,12,ES_AUTOHSCROLL
|
||||
LTEXT "bilde",-1,104,43,36,9
|
||||
LTEXT "Gjeldende format:",-1,3,56,53,9
|
||||
LTEXT "Denne plassen er til leie",IDC_FORMATTEXT,55,56,90,26
|
||||
DEFPUSHBUTTON "OK",IDOK,145,42,45,14
|
||||
PUSHBUTTON "Avbryt",IDCANCEL,145,61,45,14
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_WAVESTREAMFORMAT "Lydformat: %s"
|
||||
IDS_WAVEFILETYPE "Lydformat"
|
||||
IDS_ALLMULTIMEDIA "Alle multimedia-filer"
|
||||
IDS_ALLFILES "Alle filer (*.*)@*.*"
|
||||
IDS_VIDEO "video"
|
||||
IDS_AUDIO "lyd"
|
||||
IDS_AVISTREAMFORMAT "%s %s #%d"
|
||||
IDS_AVIFILETYPE "Wine standardfilhåndterer for AVI"
|
||||
IDS_UNCOMPRESSED "ukomprimert"
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2002 Michael Günnewig
|
||||
* Copyright 2004 Piotr Caban
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_POLISH, SUBLANG_DEFAULT
|
||||
|
||||
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Opcje kompresji"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "&Wybierz strumieñ:",-1,2,5,114,10
|
||||
COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
PUSHBUTTON "&Opcje...",IDC_OPTIONS,145,17,45,14
|
||||
AUTOCHECKBOX "&Przeplot co",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP
|
||||
EDITTEXT IDC_INTERLEAVEEVERY,66,41,32,12,ES_AUTOHSCROLL
|
||||
LTEXT "klatek",-1,104,43,36,9
|
||||
LTEXT "Wybrany format:",-1,2,56,53,9
|
||||
LTEXT "Zarezerwownae miejsce",IDC_FORMATTEXT,55,56,90,26
|
||||
DEFPUSHBUTTON "OK",IDOK,145,42,45,14
|
||||
PUSHBUTTON "Anuluj",IDCANCEL,145,61,45,14
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_WAVESTREAMFORMAT "Waveform: %s"
|
||||
IDS_WAVEFILETYPE "Waveform"
|
||||
IDS_ALLMULTIMEDIA "Wszystkie pliki multimedialne"
|
||||
IDS_ALLFILES "Wszystkie pliki (*.*)@*.*"
|
||||
IDS_VIDEO "obraz"
|
||||
IDS_AUDIO "dŸwiêk"
|
||||
IDS_AVISTREAMFORMAT "%s %s #%d"
|
||||
IDS_AVIFILETYPE "Wine AVI-domyœlna-obs³uga-pliku"
|
||||
IDS_UNCOMPRESSED "nie skompresowany"
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright 2003 Marcelo Duarte
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_PORTUGUESE, SUBLANG_DEFAULT
|
||||
|
||||
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Opções de compressão"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "&Escolha a stream:",-1,2,5,114,10
|
||||
COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
PUSHBUTTON "&Opções...",IDC_OPTIONS,145,17,45,14
|
||||
AUTOCHECKBOX "&Interleave every",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP
|
||||
EDITTEXT IDC_INTERLEAVEEVERY,66,41,32,12,ES_AUTOHSCROLL
|
||||
LTEXT "frames",-1,104,43,36,9
|
||||
LTEXT "Formato atual:",-1,3,56,53,9
|
||||
LTEXT "This space for rent",IDC_FORMATTEXT,55,56,90,26
|
||||
DEFPUSHBUTTON "OK",IDOK,145,42,45,14
|
||||
PUSHBUTTON "Cancelar",IDCANCEL,145,61,45,14
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_WAVESTREAMFORMAT "Formato wave: %s"
|
||||
IDS_WAVEFILETYPE "Formato wave"
|
||||
IDS_ALLMULTIMEDIA "Todos arquivos multimídia"
|
||||
IDS_ALLFILES "Todos os arquivos (*.*)@*.*"
|
||||
IDS_VIDEO "vídeo"
|
||||
IDS_AUDIO "áudio"
|
||||
IDS_AVISTREAMFORMAT "%s %s #%d"
|
||||
IDS_AVIFILETYPE "Wine AVI-manipulador padrão de arquivo"
|
||||
IDS_UNCOMPRESSED "sem compressão"
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* avifil32.dll (Russian resources)
|
||||
*
|
||||
* Copyright 2003 Igor Stepin
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
|
||||
|
||||
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Íàñòðîéêè ñæàòèÿ"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "&Âûáåðèòå ïîòîê:",-1,2,5,114,10
|
||||
COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
PUSHBUTTON "&Îïöèè...",IDC_OPTIONS,145,17,45,14
|
||||
AUTOCHECKBOX "&Ïðîñëàèâàòü êàæäûå",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP
|
||||
EDITTEXT IDC_INTERLEAVEEVERY,66,41,32,12,ES_AUTOHSCROLL
|
||||
LTEXT "ôðåéìà",-1,104,43,36,9
|
||||
LTEXT "Òåêóùèé ôîðìàò:",-1,3,56,53,9
|
||||
LTEXT "Ýòî ìåñòî ñäà¸òñÿ â àðåíäó",IDC_FORMATTEXT,55,56,90,26
|
||||
DEFPUSHBUTTON "OK",IDOK,145,42,45,14
|
||||
PUSHBUTTON "Îòìåíà",IDCANCEL,145,61,45,14
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_WAVESTREAMFORMAT "Çâóêîâîé ïîòîê: %s"
|
||||
IDS_WAVEFILETYPE "Çâóêîâîé ïîòîê"
|
||||
IDS_ALLMULTIMEDIA "Âñå ôàéëû ìóëüòèìåäèà"
|
||||
IDS_ALLFILES "Âñå ôàéëû (*.*)@*.*"
|
||||
IDS_VIDEO "âèäåî"
|
||||
IDS_AUDIO "àóäèî"
|
||||
IDS_AVISTREAMFORMAT "%s %s #%d"
|
||||
IDS_AVIFILETYPE "Îáðàáîò÷èê ïî óìîë÷àíèþ avi-ôàéëîâ â Wine"
|
||||
IDS_UNCOMPRESSED "áåç ñæàòèÿ"
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright 2003 Rok Mandeljc <[email protected]>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT
|
||||
|
||||
IDD_SAVEOPTIONS DIALOG FIXED IMPURE 43, 37, 196, 82
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Možnosti za stiskanje"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "&Izbira toka:",-1,2,5,114,10
|
||||
COMBOBOX IDC_STREAM,2,18,134,61,CBS_DROPDOWNLIST | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
PUSHBUTTON "&Možnosti ...",IDC_OPTIONS,145,17,45,14
|
||||
AUTOCHECKBOX "&Preplet vsake",IDC_INTERLEAVE,3,42,60,11,WS_TABSTOP
|
||||
EDITTEXT IDC_INTERLEAVEEVERY,66,41,32,12,ES_AUTOHSCROLL
|
||||
LTEXT "slike",-1,104,43,36,9
|
||||
LTEXT "Trenutna oblika zapisa:",-1,3,56,53,9
|
||||
LTEXT "This space for rent",IDC_FORMATTEXT,55,56,90,26
|
||||
DEFPUSHBUTTON "V redu",IDOK,145,42,45,14
|
||||
PUSHBUTTON "Preklièi",IDCANCEL,145,61,45,14
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_WAVESTREAMFORMAT "Waveform: %s"
|
||||
IDS_WAVEFILETYPE "Waveform"
|
||||
IDS_ALLMULTIMEDIA "Vse veèpredstavnostne datoteke"
|
||||
IDS_ALLFILES "Vse datoteke (*.*)@*.*"
|
||||
IDS_VIDEO "video"
|
||||
IDS_AUDIO "avdio"
|
||||
IDS_AVISTREAMFORMAT "%s %s #%d"
|
||||
IDS_AVIFILETYPE "Privzeti program za obravnavo AVI datotek"
|
||||
IDS_UNCOMPRESSED "nestisnjeno"
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright 2002 Michael Günnewig
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __AVIFILE_PRIVATE_H
|
||||
#define __AVIFILE_PRIVATE_H
|
||||
|
||||
#ifndef MAX_AVISTREAMS
|
||||
#define MAX_AVISTREAMS 8
|
||||
#endif
|
||||
|
||||
#ifndef comptypeDIB
|
||||
#define comptypeDIB mmioFOURCC('D','I','B',' ')
|
||||
#endif
|
||||
|
||||
#ifndef DIBWIDTHBYTES
|
||||
#define WIDTHBYTES(i) (((i+31)&(~31))/8)
|
||||
#define DIBWIDTHBYTES(bi) WIDTHBYTES((bi).biWidth * (bi).biBitCount)
|
||||
#endif
|
||||
|
||||
#ifndef DIBPTR
|
||||
#define DIBPTR(lp) ((LPBYTE)(lp) + (lp)->biSize + \
|
||||
(lp)->biClrUsed * sizeof(RGBQUAD))
|
||||
#endif
|
||||
|
||||
#define IDD_SAVEOPTIONS 0x0100
|
||||
#define IDC_INTERLEAVE 0x0110
|
||||
#define IDC_INTERLEAVEEVERY 0x0111
|
||||
#define IDC_STREAM 0x0112
|
||||
#define IDC_OPTIONS 0x0113
|
||||
#define IDC_FORMATTEXT 0x0114
|
||||
|
||||
#define IDS_WAVESTREAMFORMAT 0x0100
|
||||
#define IDS_WAVEFILETYPE 0x0101
|
||||
#define IDS_ALLMULTIMEDIA 0x0184
|
||||
#define IDS_ALLFILES 0x0185
|
||||
#define IDS_VIDEO 0x0189
|
||||
#define IDS_AUDIO 0x0190
|
||||
#define IDS_AVISTREAMFORMAT 0x0191
|
||||
#define IDS_AVIFILETYPE 0x0192
|
||||
#define IDS_UNCOMPRESSED 0x0193
|
||||
|
||||
DEFINE_AVIGUID(CLSID_ICMStream, 0x00020001, 0, 0);
|
||||
DEFINE_AVIGUID(CLSID_WAVFile, 0x00020003, 0, 0);
|
||||
DEFINE_AVIGUID(CLSID_ACMStream, 0x0002000F, 0, 0);
|
||||
DEFINE_AVIGUID(IID_IEditStreamInternal, 0x0002000A,0,0);
|
||||
|
||||
extern HMODULE AVIFILE_hModule;
|
||||
|
||||
extern HRESULT AVIFILE_CreateAVIFile(REFIID riid, LPVOID *ppobj);
|
||||
extern HRESULT AVIFILE_CreateWAVFile(REFIID riid, LPVOID *ppobj);
|
||||
extern HRESULT AVIFILE_CreateACMStream(REFIID riid, LPVOID *ppobj);
|
||||
extern HRESULT AVIFILE_CreateICMStream(REFIID riid, LPVOID *ppobj);
|
||||
extern PAVIEDITSTREAM AVIFILE_CreateEditStream(PAVISTREAM pstream);
|
||||
extern PGETFRAME AVIFILE_CreateGetFrame(PAVISTREAM pstream);
|
||||
extern PAVIFILE AVIFILE_CreateAVITempFile(int nStreams,PAVISTREAM *ppStreams);
|
||||
|
||||
extern LPCWSTR AVIFILE_BasenameW(LPCWSTR szFileName);
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,200 @@
|
||||
/*
|
||||
* Copyright 2002 Michael Günnewig
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#define COM_NO_WINDOWS_H
|
||||
#include <assert.h>
|
||||
|
||||
#include "extrachunk.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "windowsx.h"
|
||||
#include "vfw.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(avifile);
|
||||
|
||||
/* reads a chunk outof the extrachunk-structure */
|
||||
HRESULT ReadExtraChunk(LPEXTRACHUNKS extra,FOURCC ckid,LPVOID lpData,
|
||||
LPLONG size)
|
||||
{
|
||||
LPBYTE lp;
|
||||
DWORD cb;
|
||||
|
||||
/* pre-conditions */
|
||||
assert(extra != NULL);
|
||||
assert(size != NULL);
|
||||
|
||||
lp = extra->lp;
|
||||
cb = extra->cb;
|
||||
|
||||
if (lp != NULL) {
|
||||
while (cb > 0) {
|
||||
if (((FOURCC*)lp)[0] == ckid) {
|
||||
/* found correct chunk */
|
||||
if (lpData != NULL && *size > 0)
|
||||
memcpy(lpData, lp + 2 * sizeof(DWORD),
|
||||
min(((LPDWORD)lp)[1], *(LPDWORD)size));
|
||||
|
||||
*(LPDWORD)size = ((LPDWORD)lp)[1];
|
||||
|
||||
return AVIERR_OK;
|
||||
} else {
|
||||
/* skip to next chunk */
|
||||
cb -= ((LPDWORD)lp)[1] + 2 * sizeof(DWORD);
|
||||
lp += ((LPDWORD)lp)[1] + 2 * sizeof(DWORD);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* wanted chunk doesn't exist */
|
||||
*size = 0;
|
||||
|
||||
return AVIERR_NODATA;
|
||||
}
|
||||
|
||||
/* writes a chunk into the extrachunk-structure */
|
||||
HRESULT WriteExtraChunk(LPEXTRACHUNKS extra,FOURCC ckid,LPVOID lpData,
|
||||
LONG size)
|
||||
{
|
||||
LPDWORD lp;
|
||||
|
||||
/* pre-conditions */
|
||||
assert(extra != NULL);
|
||||
assert(lpData != NULL);
|
||||
assert(size > 0);
|
||||
|
||||
if (extra->lp)
|
||||
lp = (LPDWORD)GlobalReAllocPtr(extra->lp, extra->cb + size + 2 * sizeof(DWORD), GHND);
|
||||
else
|
||||
lp = (LPDWORD)GlobalAllocPtr(GHND, size + 2 * sizeof(DWORD));
|
||||
|
||||
if (lp == NULL)
|
||||
return AVIERR_MEMORY;
|
||||
|
||||
extra->lp = lp;
|
||||
lp = (LPDWORD) ((LPBYTE)lp + extra->cb);
|
||||
extra->cb += size + 2 * sizeof(DWORD);
|
||||
|
||||
/* insert chunk-header in block */
|
||||
lp[0] = ckid;
|
||||
lp[1] = size;
|
||||
|
||||
if (lpData != NULL && size > 0)
|
||||
memcpy(lp + 2, lpData, size);
|
||||
|
||||
return AVIERR_OK;
|
||||
}
|
||||
|
||||
/* reads a chunk fomr the HMMIO into the extrachunk-structure */
|
||||
HRESULT ReadChunkIntoExtra(LPEXTRACHUNKS extra,HMMIO hmmio,MMCKINFO *lpck)
|
||||
{
|
||||
LPDWORD lp;
|
||||
DWORD cb;
|
||||
|
||||
/* pre-conditions */
|
||||
assert(extra != NULL);
|
||||
assert(hmmio != NULL);
|
||||
assert(lpck != NULL);
|
||||
|
||||
cb = lpck->cksize + 2 * sizeof(DWORD);
|
||||
cb += (cb & 1);
|
||||
|
||||
if (extra->lp != NULL) {
|
||||
lp = (LPDWORD)GlobalReAllocPtr(extra->lp, extra->cb + cb, GHND);
|
||||
} else
|
||||
lp = (LPDWORD)GlobalAllocPtr(GHND, cb);
|
||||
|
||||
if (lp == NULL)
|
||||
return AVIERR_MEMORY;
|
||||
|
||||
extra->lp = lp;
|
||||
lp = (LPDWORD) ((LPBYTE)lp + extra->cb);
|
||||
extra->cb += cb;
|
||||
|
||||
/* insert chunk-header in block */
|
||||
lp[0] = lpck->ckid;
|
||||
lp[1] = lpck->cksize;
|
||||
|
||||
if (lpck->cksize > 0) {
|
||||
if (mmioSeek(hmmio, lpck->dwDataOffset, SEEK_SET) == -1)
|
||||
return AVIERR_FILEREAD;
|
||||
if (mmioRead(hmmio, (HPSTR)&lp[2], lpck->cksize) != (LONG)lpck->cksize)
|
||||
return AVIERR_FILEREAD;
|
||||
}
|
||||
|
||||
return AVIERR_OK;
|
||||
}
|
||||
|
||||
/* reads all non-junk chunks into the extrachunk-structure until it finds
|
||||
* the given chunk or the optional parent-chunk is at the end */
|
||||
HRESULT FindChunkAndKeepExtras(LPEXTRACHUNKS extra,HMMIO hmmio,MMCKINFO *lpck,
|
||||
MMCKINFO *lpckParent,UINT flags)
|
||||
{
|
||||
FOURCC ckid;
|
||||
FOURCC fccType;
|
||||
HRESULT hr;
|
||||
|
||||
/* pre-conditions */
|
||||
assert(extra != NULL);
|
||||
assert(hmmio != NULL);
|
||||
assert(lpck != NULL);
|
||||
|
||||
TRACE("({%p,%lu},%p,%p,%p,0x%X)\n", extra->lp, extra->cb, hmmio, lpck,
|
||||
lpckParent, flags);
|
||||
|
||||
/* what chunk id and form/list type should we search? */
|
||||
if (flags & MMIO_FINDCHUNK) {
|
||||
ckid = lpck->ckid;
|
||||
fccType = 0;
|
||||
} else if (flags & MMIO_FINDLIST) {
|
||||
ckid = FOURCC_LIST;
|
||||
fccType = lpck->fccType;
|
||||
} else if (flags & MMIO_FINDRIFF) {
|
||||
ckid = FOURCC_RIFF;
|
||||
fccType = lpck->fccType;
|
||||
} else
|
||||
ckid = fccType = (FOURCC)-1; /* collect everything into extra! */
|
||||
|
||||
TRACE(": find ckid=0x%08lX fccType=0x%08lX\n", ckid, fccType);
|
||||
|
||||
for (;;) {
|
||||
hr = mmioDescend(hmmio, lpck, lpckParent, 0);
|
||||
if (hr != S_OK) {
|
||||
/* No extra chunks in front of desired chunk? */
|
||||
if (flags == 0 && hr == MMIOERR_CHUNKNOTFOUND)
|
||||
hr = AVIERR_OK;
|
||||
return hr;
|
||||
}
|
||||
|
||||
/* Have we found what we search for? */
|
||||
if ((lpck->ckid == ckid) &&
|
||||
(fccType == (FOURCC)0 || lpck->fccType == fccType))
|
||||
return AVIERR_OK;
|
||||
|
||||
/* Skip padding chunks, the others put into the extrachunk-structure */
|
||||
if (lpck->ckid == ckidAVIPADDING ||
|
||||
lpck->ckid == mmioFOURCC('p','a','d','d'))
|
||||
hr = mmioAscend(hmmio, lpck, 0);
|
||||
else
|
||||
hr = ReadChunkIntoExtra(extra, hmmio, lpck);
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright 2002 Michael Günnewig
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __WINE_EXTRACHUNK_H
|
||||
#define __WINE_EXTRACHUNK_H
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "mmsystem.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct _EXTRACHUNKS {
|
||||
LPVOID lp;
|
||||
DWORD cb;
|
||||
} EXTRACHUNKS, *LPEXTRACHUNKS;
|
||||
|
||||
/* reads a chunk outof the extrachunk-structure */
|
||||
HRESULT ReadExtraChunk(LPEXTRACHUNKS extra,FOURCC ckid,LPVOID lp,LPLONG size);
|
||||
|
||||
/* writes a chunk into the extrachunk-structure */
|
||||
HRESULT WriteExtraChunk(LPEXTRACHUNKS extra,FOURCC ckid,LPVOID lp,LONG size);
|
||||
|
||||
/* reads a chunk fomr the HMMIO into the extrachunk-structure */
|
||||
HRESULT ReadChunkIntoExtra(LPEXTRACHUNKS extra,HMMIO hmmio,MMCKINFO *lpck);
|
||||
|
||||
/* reads all non-junk chunks into the extrachunk-structure until it finds
|
||||
* the given chunk or the optional parent-chunk is at the end */
|
||||
HRESULT FindChunkAndKeepExtras(LPEXTRACHUNKS extra,HMMIO hmmio,
|
||||
MMCKINFO *lpck,MMCKINFO *lpckParent,UINT flags);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,220 @@
|
||||
/*
|
||||
* Copyright 2002 Michael Günnewig
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#define COBJMACROS
|
||||
#define COM_NO_WINDOWS_H
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "winnls.h"
|
||||
#include "winerror.h"
|
||||
|
||||
#include "ole2.h"
|
||||
#include "vfw.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(avifile);
|
||||
|
||||
#include "initguid.h"
|
||||
#include "avifile_private.h"
|
||||
|
||||
HMODULE AVIFILE_hModule = NULL;
|
||||
|
||||
BOOL AVIFILE_bLocked = FALSE;
|
||||
UINT AVIFILE_uUseCount = 0;
|
||||
|
||||
static HRESULT WINAPI IClassFactory_fnQueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj);
|
||||
static ULONG WINAPI IClassFactory_fnAddRef(LPCLASSFACTORY iface);
|
||||
static ULONG WINAPI IClassFactory_fnRelease(LPCLASSFACTORY iface);
|
||||
static HRESULT WINAPI IClassFactory_fnCreateInstance(LPCLASSFACTORY iface,LPUNKNOWN pOuter,REFIID riid,LPVOID *ppobj);
|
||||
static HRESULT WINAPI IClassFactory_fnLockServer(LPCLASSFACTORY iface,BOOL dolock);
|
||||
|
||||
static const IClassFactoryVtbl iclassfact = {
|
||||
IClassFactory_fnQueryInterface,
|
||||
IClassFactory_fnAddRef,
|
||||
IClassFactory_fnRelease,
|
||||
IClassFactory_fnCreateInstance,
|
||||
IClassFactory_fnLockServer
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* IUnknown fields */
|
||||
const IClassFactoryVtbl *lpVtbl;
|
||||
DWORD dwRef;
|
||||
|
||||
CLSID clsid;
|
||||
} IClassFactoryImpl;
|
||||
|
||||
static HRESULT AVIFILE_CreateClassFactory(const CLSID *pclsid, const IID *riid,
|
||||
LPVOID *ppv)
|
||||
{
|
||||
IClassFactoryImpl *pClassFactory = NULL;
|
||||
HRESULT hr;
|
||||
|
||||
*ppv = NULL;
|
||||
|
||||
pClassFactory = (IClassFactoryImpl*)LocalAlloc(LPTR, sizeof(*pClassFactory));
|
||||
if (pClassFactory == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
pClassFactory->lpVtbl = &iclassfact;
|
||||
pClassFactory->dwRef = 0;
|
||||
memcpy(&pClassFactory->clsid, pclsid, sizeof(pClassFactory->clsid));
|
||||
|
||||
hr = IClassFactory_QueryInterface((IClassFactory*)pClassFactory, riid, ppv);
|
||||
if (FAILED(hr)) {
|
||||
LocalFree((HLOCAL)pClassFactory);
|
||||
*ppv = NULL;
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IClassFactory_fnQueryInterface(LPCLASSFACTORY iface,
|
||||
REFIID riid,LPVOID *ppobj)
|
||||
{
|
||||
TRACE("(%p,%p,%p)\n", iface, riid, ppobj);
|
||||
|
||||
if ((IsEqualGUID(&IID_IUnknown, riid)) ||
|
||||
(IsEqualGUID(&IID_IClassFactory, riid))) {
|
||||
*ppobj = iface;
|
||||
IClassFactory_AddRef(iface);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static ULONG WINAPI IClassFactory_fnAddRef(LPCLASSFACTORY iface)
|
||||
{
|
||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
||||
|
||||
TRACE("(%p)\n", iface);
|
||||
|
||||
return ++(This->dwRef);
|
||||
}
|
||||
|
||||
static ULONG WINAPI IClassFactory_fnRelease(LPCLASSFACTORY iface)
|
||||
{
|
||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
||||
|
||||
TRACE("(%p)\n", iface);
|
||||
if ((--(This->dwRef)) > 0)
|
||||
return This->dwRef;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IClassFactory_fnCreateInstance(LPCLASSFACTORY iface,
|
||||
LPUNKNOWN pOuter,
|
||||
REFIID riid,LPVOID *ppobj)
|
||||
{
|
||||
IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
|
||||
|
||||
TRACE("(%p,%p,%s,%p)\n", iface, pOuter, debugstr_guid(riid),
|
||||
ppobj);
|
||||
|
||||
if (ppobj == NULL || pOuter != NULL)
|
||||
return E_FAIL;
|
||||
*ppobj = NULL;
|
||||
|
||||
if (IsEqualGUID(&CLSID_AVIFile, &This->clsid))
|
||||
return AVIFILE_CreateAVIFile(riid,ppobj);
|
||||
if (IsEqualGUID(&CLSID_ICMStream, &This->clsid))
|
||||
return AVIFILE_CreateICMStream(riid,ppobj);
|
||||
if (IsEqualGUID(&CLSID_WAVFile, &This->clsid))
|
||||
return AVIFILE_CreateWAVFile(riid,ppobj);
|
||||
if (IsEqualGUID(&CLSID_ACMStream, &This->clsid))
|
||||
return AVIFILE_CreateACMStream(riid,ppobj);
|
||||
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IClassFactory_fnLockServer(LPCLASSFACTORY iface,BOOL dolock)
|
||||
{
|
||||
TRACE("(%p,%d)\n",iface,dolock);
|
||||
|
||||
AVIFILE_bLocked = dolock;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
LPCWSTR AVIFILE_BasenameW(LPCWSTR szPath)
|
||||
{
|
||||
#define SLASH(w) ((w) == '/' || (w) == '\\')
|
||||
|
||||
LPCWSTR szCur;
|
||||
|
||||
for (szCur = szPath + lstrlenW(szPath);
|
||||
szCur > szPath && !SLASH(*szCur) && *szCur != ':';)
|
||||
szCur--;
|
||||
|
||||
if (szCur == szPath)
|
||||
return szCur;
|
||||
else
|
||||
return szCur + 1;
|
||||
|
||||
#undef SLASH
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* DllGetClassObject (AVIFIL32.@)
|
||||
*/
|
||||
HRESULT WINAPI DllGetClassObject(REFCLSID pclsid, REFIID piid, LPVOID *ppv)
|
||||
{
|
||||
TRACE("(%s,%s,%p)\n", debugstr_guid(pclsid), debugstr_guid(piid), ppv);
|
||||
|
||||
if (pclsid == NULL || piid == NULL || ppv == NULL)
|
||||
return E_FAIL;
|
||||
|
||||
return AVIFILE_CreateClassFactory(pclsid,piid,ppv);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* DllCanUnloadNow (AVIFIL32.@)
|
||||
*/
|
||||
HRESULT WINAPI DllCanUnloadNow(void)
|
||||
{
|
||||
return ((AVIFILE_bLocked || AVIFILE_uUseCount) ? S_FALSE : S_OK);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* DllMain [AVIFIL32.init]
|
||||
*/
|
||||
BOOL WINAPI DllMain(HINSTANCE hInstDll, DWORD fdwReason, LPVOID lpvReserved)
|
||||
{
|
||||
TRACE("(%p,%ld,%p)\n", hInstDll, fdwReason, lpvReserved);
|
||||
|
||||
switch (fdwReason) {
|
||||
case DLL_PROCESS_ATTACH:
|
||||
DisableThreadLibraryCalls(hInstDll);
|
||||
AVIFILE_hModule = (HMODULE)hInstDll;
|
||||
break;
|
||||
case DLL_PROCESS_DETACH:
|
||||
break;
|
||||
};
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -0,0 +1,527 @@
|
||||
/*
|
||||
* Copyright 2002-2003 Michael Günnewig
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#define COM_NO_WINDOWS_H
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winnls.h"
|
||||
#include "windowsx.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "vfw.h"
|
||||
|
||||
#include "avifile_private.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(avifile);
|
||||
|
||||
#ifndef DIBPTR
|
||||
#define DIBPTR(lp) ((LPBYTE)(lp) + (lp)->biSize + \
|
||||
(lp)->biClrUsed * sizeof(RGBQUAD))
|
||||
#endif
|
||||
|
||||
/***********************************************************************/
|
||||
|
||||
static HRESULT WINAPI IGetFrame_fnQueryInterface(IGetFrame *iface,
|
||||
REFIID refiid, LPVOID *obj);
|
||||
static ULONG WINAPI IGetFrame_fnAddRef(IGetFrame *iface);
|
||||
static ULONG WINAPI IGetFrame_fnRelease(IGetFrame *iface);
|
||||
static LPVOID WINAPI IGetFrame_fnGetFrame(IGetFrame *iface, LONG lPos);
|
||||
static HRESULT WINAPI IGetFrame_fnBegin(IGetFrame *iface, LONG lStart,
|
||||
LONG lEnd, LONG lRate);
|
||||
static HRESULT WINAPI IGetFrame_fnEnd(IGetFrame *iface);
|
||||
static HRESULT WINAPI IGetFrame_fnSetFormat(IGetFrame *iface,
|
||||
LPBITMAPINFOHEADER lpbi,
|
||||
LPVOID lpBits, INT x, INT y,
|
||||
INT dx, INT dy);
|
||||
|
||||
static const struct IGetFrameVtbl igetframeVtbl = {
|
||||
IGetFrame_fnQueryInterface,
|
||||
IGetFrame_fnAddRef,
|
||||
IGetFrame_fnRelease,
|
||||
IGetFrame_fnGetFrame,
|
||||
IGetFrame_fnBegin,
|
||||
IGetFrame_fnEnd,
|
||||
IGetFrame_fnSetFormat
|
||||
};
|
||||
|
||||
typedef struct _IGetFrameImpl {
|
||||
/* IUnknown stuff */
|
||||
const IGetFrameVtbl *lpVtbl;
|
||||
LONG ref;
|
||||
|
||||
/* IGetFrame stuff */
|
||||
BOOL bFixedStream;
|
||||
PAVISTREAM pStream;
|
||||
|
||||
LPVOID lpInBuffer;
|
||||
LONG cbInBuffer;
|
||||
LPBITMAPINFOHEADER lpInFormat;
|
||||
LONG cbInFormat;
|
||||
|
||||
LONG lCurrentFrame;
|
||||
LPBITMAPINFOHEADER lpOutFormat;
|
||||
LPVOID lpOutBuffer;
|
||||
|
||||
HIC hic;
|
||||
BOOL bResize;
|
||||
DWORD x;
|
||||
DWORD y;
|
||||
DWORD dx;
|
||||
DWORD dy;
|
||||
|
||||
BOOL bFormatChanges;
|
||||
DWORD dwFormatChangeCount;
|
||||
DWORD dwEditCount;
|
||||
} IGetFrameImpl;
|
||||
|
||||
/***********************************************************************/
|
||||
|
||||
static void AVIFILE_CloseCompressor(IGetFrameImpl *This)
|
||||
{
|
||||
if (This->lpOutFormat != NULL && This->lpInFormat != This->lpOutFormat) {
|
||||
GlobalFreePtr(This->lpOutFormat);
|
||||
This->lpOutFormat = NULL;
|
||||
}
|
||||
if (This->lpInFormat != NULL) {
|
||||
GlobalFreePtr(This->lpInFormat);
|
||||
This->lpInFormat = NULL;
|
||||
}
|
||||
if (This->hic != NULL) {
|
||||
if (This->bResize)
|
||||
ICDecompressExEnd(This->hic);
|
||||
else
|
||||
ICDecompressEnd(This->hic);
|
||||
ICClose(This->hic);
|
||||
This->hic = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
PGETFRAME AVIFILE_CreateGetFrame(PAVISTREAM pStream)
|
||||
{
|
||||
IGetFrameImpl *pg;
|
||||
|
||||
/* check parameter */
|
||||
if (pStream == NULL)
|
||||
return NULL;
|
||||
|
||||
pg = (IGetFrameImpl*)LocalAlloc(LPTR, sizeof(IGetFrameImpl));
|
||||
if (pg != NULL) {
|
||||
pg->lpVtbl = &igetframeVtbl;
|
||||
pg->ref = 1;
|
||||
pg->lCurrentFrame = -1;
|
||||
pg->pStream = pStream;
|
||||
IAVIStream_AddRef(pStream);
|
||||
}
|
||||
|
||||
return (PGETFRAME)pg;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IGetFrame_fnQueryInterface(IGetFrame *iface,
|
||||
REFIID refiid, LPVOID *obj)
|
||||
{
|
||||
IGetFrameImpl *This = (IGetFrameImpl *)iface;
|
||||
|
||||
TRACE("(%p,%s,%p)\n", This, debugstr_guid(refiid), obj);
|
||||
|
||||
if (IsEqualGUID(&IID_IUnknown, refiid) ||
|
||||
IsEqualGUID(&IID_IGetFrame, refiid)) {
|
||||
*obj = iface;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
return OLE_E_ENUM_NOMORE;
|
||||
}
|
||||
|
||||
static ULONG WINAPI IGetFrame_fnAddRef(IGetFrame *iface)
|
||||
{
|
||||
IGetFrameImpl *This = (IGetFrameImpl *)iface;
|
||||
ULONG ref = InterlockedIncrement(&This->ref);
|
||||
|
||||
TRACE("(%p)\n", iface);
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
static ULONG WINAPI IGetFrame_fnRelease(IGetFrame *iface)
|
||||
{
|
||||
IGetFrameImpl *This = (IGetFrameImpl *)iface;
|
||||
ULONG ref = InterlockedDecrement(&This->ref);
|
||||
|
||||
TRACE("(%p)\n", iface);
|
||||
|
||||
if (!ref) {
|
||||
AVIFILE_CloseCompressor(This);
|
||||
if (This->pStream != NULL) {
|
||||
IAVIStream_Release(This->pStream);
|
||||
This->pStream = NULL;
|
||||
}
|
||||
|
||||
LocalFree((HLOCAL)iface);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
static LPVOID WINAPI IGetFrame_fnGetFrame(IGetFrame *iface, LONG lPos)
|
||||
{
|
||||
IGetFrameImpl *This = (IGetFrameImpl *)iface;
|
||||
|
||||
LONG readBytes;
|
||||
LONG readSamples;
|
||||
|
||||
TRACE("(%p,%ld)\n", iface, lPos);
|
||||
|
||||
/* We don't want negative start values! -- marks invalid buffer content */
|
||||
if (lPos < 0)
|
||||
return NULL;
|
||||
|
||||
/* check state */
|
||||
if (This->pStream == NULL)
|
||||
return NULL;
|
||||
if (This->lpInFormat == NULL)
|
||||
return NULL;
|
||||
|
||||
/* Could stream have changed? */
|
||||
if (! This->bFixedStream) {
|
||||
AVISTREAMINFOW sInfo;
|
||||
|
||||
IAVIStream_Info(This->pStream, &sInfo, sizeof(sInfo));
|
||||
|
||||
if (sInfo.dwEditCount != This->dwEditCount) {
|
||||
This->dwEditCount = sInfo.dwEditCount;
|
||||
This->lCurrentFrame = -1;
|
||||
}
|
||||
|
||||
if (sInfo.dwFormatChangeCount != This->dwFormatChangeCount) {
|
||||
/* stream has changed */
|
||||
if (This->lpOutFormat != NULL) {
|
||||
BITMAPINFOHEADER bi;
|
||||
|
||||
memcpy(&bi, This->lpOutFormat, sizeof(bi));
|
||||
AVIFILE_CloseCompressor(This);
|
||||
|
||||
if (FAILED(IGetFrame_SetFormat(iface, &bi, NULL, 0, 0, -1, -1))) {
|
||||
if (FAILED(IGetFrame_SetFormat(iface, NULL, NULL, 0, 0, -1, -1)))
|
||||
return NULL;
|
||||
}
|
||||
} else if (FAILED(IGetFrame_SetFormat(iface, NULL, NULL, 0, 0, -1, -1)))
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (lPos != This->lCurrentFrame) {
|
||||
LONG lNext = IAVIStream_FindSample(This->pStream,lPos,FIND_KEY|FIND_PREV);
|
||||
|
||||
if (lNext == -1)
|
||||
return NULL; /* frame doesn't exist */
|
||||
if (lNext <= This->lCurrentFrame && This->lCurrentFrame < lPos)
|
||||
lNext = This->lCurrentFrame + 1;
|
||||
|
||||
for (; lNext <= lPos; lNext++) {
|
||||
/* new format for this frame? */
|
||||
if (This->bFormatChanges) {
|
||||
IAVIStream_ReadFormat(This->pStream, lNext,
|
||||
This->lpInFormat, &This->cbInFormat);
|
||||
if (This->lpOutFormat != NULL) {
|
||||
if (This->lpOutFormat->biBitCount <= 8)
|
||||
ICDecompressGetPalette(This->hic, This->lpInFormat,
|
||||
This->lpOutFormat);
|
||||
}
|
||||
}
|
||||
|
||||
/* read input frame */
|
||||
while (FAILED(AVIStreamRead(This->pStream, lNext, 1, This->lpInBuffer,
|
||||
This->cbInBuffer, &readBytes, &readSamples))) {
|
||||
/* not enough memory for input buffer? */
|
||||
readBytes = 0;
|
||||
if (FAILED(AVIStreamSampleSize(This->pStream, lNext, &readBytes)))
|
||||
return NULL; /* bad thing, but bad things will happen */
|
||||
if (readBytes <= 0) {
|
||||
ERR(": IAVIStream::REad doesn't return needed bytes!\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* IAVIStream::Read failed because of other reasons not buffersize? */
|
||||
if (This->cbInBuffer >= readBytes)
|
||||
break;
|
||||
This->cbInBuffer = This->cbInFormat + readBytes;
|
||||
This->lpInFormat = GlobalReAllocPtr(This->lpInFormat, This->cbInBuffer, 0);
|
||||
if (This->lpInFormat == NULL)
|
||||
return NULL; /* out of memory */
|
||||
This->lpInBuffer = (BYTE*)This->lpInFormat + This->cbInFormat;
|
||||
}
|
||||
|
||||
if (readSamples != 1) {
|
||||
ERR(": no frames read\n");
|
||||
return NULL;
|
||||
}
|
||||
if (readBytes != 0) {
|
||||
This->lpInFormat->biSizeImage = readBytes;
|
||||
|
||||
/* nothing to decompress? */
|
||||
if (This->hic == NULL) {
|
||||
This->lCurrentFrame = lPos;
|
||||
return This->lpInFormat;
|
||||
}
|
||||
|
||||
if (This->bResize) {
|
||||
ICDecompressEx(This->hic,0,This->lpInFormat,This->lpInBuffer,0,0,
|
||||
This->lpInFormat->biWidth,This->lpInFormat->biHeight,
|
||||
This->lpOutFormat,This->lpOutBuffer,This->x,This->y,
|
||||
This->dx,This->dy);
|
||||
} else {
|
||||
ICDecompress(This->hic, 0, This->lpInFormat, This->lpInBuffer,
|
||||
This->lpOutFormat, This->lpOutBuffer);
|
||||
}
|
||||
}
|
||||
} /* for (lNext < lPos) */
|
||||
} /* if (This->lCurrentFrame != lPos) */
|
||||
|
||||
return (This->hic == NULL ? This->lpInFormat : This->lpOutFormat);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IGetFrame_fnBegin(IGetFrame *iface, LONG lStart,
|
||||
LONG lEnd, LONG lRate)
|
||||
{
|
||||
IGetFrameImpl *This = (IGetFrameImpl *)iface;
|
||||
|
||||
TRACE("(%p,%ld,%ld,%ld)\n", iface, lStart, lEnd, lRate);
|
||||
|
||||
This->bFixedStream = TRUE;
|
||||
|
||||
return (IGetFrame_GetFrame(iface, lStart) ? AVIERR_OK : AVIERR_ERROR);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IGetFrame_fnEnd(IGetFrame *iface)
|
||||
{
|
||||
IGetFrameImpl *This = (IGetFrameImpl *)iface;
|
||||
|
||||
TRACE("(%p)\n", iface);
|
||||
|
||||
This->bFixedStream = FALSE;
|
||||
|
||||
return AVIERR_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IGetFrame_fnSetFormat(IGetFrame *iface,
|
||||
LPBITMAPINFOHEADER lpbiWanted,
|
||||
LPVOID lpBits, INT x, INT y,
|
||||
INT dx, INT dy)
|
||||
{
|
||||
IGetFrameImpl *This = (IGetFrameImpl *)iface;
|
||||
|
||||
AVISTREAMINFOW sInfo;
|
||||
LPBITMAPINFOHEADER lpbi = lpbiWanted;
|
||||
BOOL bBestDisplay = FALSE;
|
||||
|
||||
TRACE("(%p,%p,%p,%d,%d,%d,%d)\n", iface, lpbiWanted, lpBits,
|
||||
x, y, dx, dy);
|
||||
|
||||
if (This->pStream == NULL)
|
||||
return AVIERR_ERROR;
|
||||
|
||||
if (lpbiWanted == (LPBITMAPINFOHEADER)AVIGETFRAMEF_BESTDISPLAYFMT) {
|
||||
lpbi = NULL;
|
||||
bBestDisplay = TRUE;
|
||||
}
|
||||
|
||||
IAVIStream_Info(This->pStream, &sInfo, sizeof(sInfo));
|
||||
if (sInfo.fccType != streamtypeVIDEO)
|
||||
return AVIERR_UNSUPPORTED;
|
||||
|
||||
This->bFormatChanges =
|
||||
(sInfo.dwFlags & AVISTREAMINFO_FORMATCHANGES ? TRUE : FALSE );
|
||||
This->dwFormatChangeCount = sInfo.dwFormatChangeCount;
|
||||
This->dwEditCount = sInfo.dwEditCount;
|
||||
This->lCurrentFrame = -1;
|
||||
|
||||
/* get input format from stream */
|
||||
if (This->lpInFormat == NULL) {
|
||||
HRESULT hr;
|
||||
|
||||
This->cbInBuffer = (LONG)sInfo.dwSuggestedBufferSize;
|
||||
if (This->cbInBuffer == 0)
|
||||
This->cbInBuffer = 1024;
|
||||
|
||||
IAVIStream_ReadFormat(This->pStream, sInfo.dwStart,
|
||||
NULL, &This->cbInFormat);
|
||||
|
||||
This->lpInFormat =
|
||||
(LPBITMAPINFOHEADER)GlobalAllocPtr(GHND, This->cbInFormat + This->cbInBuffer);
|
||||
if (This->lpInFormat == NULL) {
|
||||
AVIFILE_CloseCompressor(This);
|
||||
return AVIERR_MEMORY;
|
||||
}
|
||||
|
||||
hr = IAVIStream_ReadFormat(This->pStream, sInfo.dwStart, This->lpInFormat, &This->cbInFormat);
|
||||
if (FAILED(hr)) {
|
||||
AVIFILE_CloseCompressor(This);
|
||||
return hr;
|
||||
}
|
||||
|
||||
This->lpInBuffer = ((LPBYTE)This->lpInFormat) + This->cbInFormat;
|
||||
}
|
||||
|
||||
/* check input format */
|
||||
if (This->lpInFormat->biClrUsed == 0 && This->lpInFormat->biBitCount <= 8)
|
||||
This->lpInFormat->biClrUsed = 1u << This->lpInFormat->biBitCount;
|
||||
if (This->lpInFormat->biSizeImage == 0 &&
|
||||
This->lpInFormat->biCompression == BI_RGB) {
|
||||
This->lpInFormat->biSizeImage =
|
||||
DIBWIDTHBYTES(*This->lpInFormat) * This->lpInFormat->biHeight;
|
||||
}
|
||||
|
||||
/* only to pass through? */
|
||||
if (This->lpInFormat->biCompression == BI_RGB && lpBits == NULL) {
|
||||
if (lpbi == NULL ||
|
||||
(lpbi->biCompression == BI_RGB &&
|
||||
lpbi->biWidth == This->lpInFormat->biWidth &&
|
||||
lpbi->biHeight == This->lpInFormat->biHeight &&
|
||||
lpbi->biBitCount == This->lpInFormat->biBitCount)) {
|
||||
This->lpOutFormat = This->lpInFormat;
|
||||
This->lpOutBuffer = DIBPTR(This->lpInFormat);
|
||||
return AVIERR_OK;
|
||||
}
|
||||
}
|
||||
|
||||
/* need memory for output format? */
|
||||
if (This->lpOutFormat == NULL) {
|
||||
This->lpOutFormat =
|
||||
(LPBITMAPINFOHEADER)GlobalAllocPtr(GHND, sizeof(BITMAPINFOHEADER)
|
||||
+ 256 * sizeof(RGBQUAD));
|
||||
if (This->lpOutFormat == NULL) {
|
||||
AVIFILE_CloseCompressor(This);
|
||||
return AVIERR_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
/* need handle to video compressor */
|
||||
if (This->hic == NULL) {
|
||||
FOURCC fccHandler;
|
||||
|
||||
if (This->lpInFormat->biCompression == BI_RGB)
|
||||
fccHandler = comptypeDIB;
|
||||
else if (This->lpInFormat->biCompression == BI_RLE8)
|
||||
fccHandler = mmioFOURCC('R','L','E',' ');
|
||||
else
|
||||
fccHandler = sInfo.fccHandler;
|
||||
|
||||
if (lpbi != NULL) {
|
||||
if (lpbi->biWidth == 0)
|
||||
lpbi->biWidth = This->lpInFormat->biWidth;
|
||||
if (lpbi->biHeight == 0)
|
||||
lpbi->biHeight = This->lpInFormat->biHeight;
|
||||
}
|
||||
|
||||
This->hic = ICLocate(ICTYPE_VIDEO, fccHandler, This->lpInFormat, lpbi, ICMODE_DECOMPRESS);
|
||||
if (This->hic == NULL) {
|
||||
AVIFILE_CloseCompressor(This);
|
||||
return AVIERR_NOCOMPRESSOR;
|
||||
}
|
||||
}
|
||||
|
||||
/* output format given? */
|
||||
if (lpbi != NULL) {
|
||||
/* check the given output format ... */
|
||||
if (lpbi->biClrUsed == 0 && lpbi->biBitCount <= 8)
|
||||
lpbi->biClrUsed = 1u << lpbi->biBitCount;
|
||||
|
||||
/* ... and remember it */
|
||||
memcpy(This->lpOutFormat, lpbi,
|
||||
lpbi->biSize + lpbi->biClrUsed * sizeof(RGBQUAD));
|
||||
if (lpbi->biBitCount <= 8)
|
||||
ICDecompressGetPalette(This->hic, This->lpInFormat, This->lpOutFormat);
|
||||
|
||||
return AVIERR_OK;
|
||||
} else {
|
||||
if (bBestDisplay) {
|
||||
ICGetDisplayFormat(This->hic, This->lpInFormat,
|
||||
This->lpOutFormat, 0, dx, dy);
|
||||
} else if (ICDecompressGetFormat(This->hic, This->lpInFormat,
|
||||
This->lpOutFormat) < 0) {
|
||||
AVIFILE_CloseCompressor(This);
|
||||
return AVIERR_NOCOMPRESSOR;
|
||||
}
|
||||
|
||||
/* check output format */
|
||||
if (This->lpOutFormat->biClrUsed == 0 &&
|
||||
This->lpOutFormat->biBitCount <= 8)
|
||||
This->lpOutFormat->biClrUsed = 1u << This->lpOutFormat->biBitCount;
|
||||
if (This->lpOutFormat->biSizeImage == 0 &&
|
||||
This->lpOutFormat->biCompression == BI_RGB) {
|
||||
This->lpOutFormat->biSizeImage =
|
||||
DIBWIDTHBYTES(*This->lpOutFormat) * This->lpOutFormat->biHeight;
|
||||
}
|
||||
|
||||
if (lpBits == NULL) {
|
||||
register DWORD size = This->lpOutFormat->biClrUsed * sizeof(RGBQUAD);
|
||||
|
||||
size += This->lpOutFormat->biSize + This->lpOutFormat->biSizeImage;
|
||||
This->lpOutFormat =
|
||||
(LPBITMAPINFOHEADER)GlobalReAllocPtr(This->lpOutFormat, size, GMEM_MOVEABLE);
|
||||
if (This->lpOutFormat == NULL) {
|
||||
AVIFILE_CloseCompressor(This);
|
||||
return AVIERR_MEMORY;
|
||||
}
|
||||
This->lpOutBuffer = DIBPTR(This->lpOutFormat);
|
||||
} else
|
||||
This->lpOutBuffer = lpBits;
|
||||
|
||||
/* for user size was irrelevant */
|
||||
if (dx == -1)
|
||||
dx = This->lpOutFormat->biWidth;
|
||||
if (dy == -1)
|
||||
dy = This->lpOutFormat->biHeight;
|
||||
|
||||
/* need to resize? */
|
||||
if (x != 0 || y != 0) {
|
||||
if (dy == This->lpOutFormat->biHeight &&
|
||||
dx == This->lpOutFormat->biWidth)
|
||||
This->bResize = FALSE;
|
||||
else
|
||||
This->bResize = TRUE;
|
||||
}
|
||||
|
||||
if (This->bResize) {
|
||||
This->x = x;
|
||||
This->y = y;
|
||||
This->dx = dx;
|
||||
This->dy = dy;
|
||||
|
||||
if (ICDecompressExBegin(This->hic,0,This->lpInFormat,This->lpInBuffer,0,
|
||||
0,This->lpInFormat->biWidth,
|
||||
This->lpInFormat->biHeight,This->lpOutFormat,
|
||||
This->lpOutBuffer, x, y, dx, dy) == ICERR_OK)
|
||||
return AVIERR_OK;
|
||||
} else if (ICDecompressBegin(This->hic, This->lpInFormat,
|
||||
This->lpOutFormat) == ICERR_OK)
|
||||
return AVIERR_OK;
|
||||
|
||||
AVIFILE_CloseCompressor(This);
|
||||
|
||||
return AVIERR_COMPRESSOR;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************/
|
||||
@@ -0,0 +1,976 @@
|
||||
/*
|
||||
* Copyright 2002 Michael Günnewig
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#define COM_NO_WINDOWS_H
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "winnls.h"
|
||||
#include "winerror.h"
|
||||
#include "windowsx.h"
|
||||
#include "mmsystem.h"
|
||||
#include "vfw.h"
|
||||
#include "msacm.h"
|
||||
|
||||
#include "avifile_private.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(avifile);
|
||||
|
||||
#define MAX_FRAMESIZE (16 * 1024 * 1024)
|
||||
#define MAX_FRAMESIZE_DIFF 512
|
||||
|
||||
/***********************************************************************/
|
||||
|
||||
static HRESULT WINAPI ICMStream_fnQueryInterface(IAVIStream*iface,REFIID refiid,LPVOID *obj);
|
||||
static ULONG WINAPI ICMStream_fnAddRef(IAVIStream*iface);
|
||||
static ULONG WINAPI ICMStream_fnRelease(IAVIStream* iface);
|
||||
static HRESULT WINAPI ICMStream_fnCreate(IAVIStream*iface,LPARAM lParam1,LPARAM lParam2);
|
||||
static HRESULT WINAPI ICMStream_fnInfo(IAVIStream*iface,AVISTREAMINFOW *psi,LONG size);
|
||||
static LONG WINAPI ICMStream_fnFindSample(IAVIStream*iface,LONG pos,LONG flags);
|
||||
static HRESULT WINAPI ICMStream_fnReadFormat(IAVIStream*iface,LONG pos,LPVOID format,LONG *formatsize);
|
||||
static HRESULT WINAPI ICMStream_fnSetFormat(IAVIStream*iface,LONG pos,LPVOID format,LONG formatsize);
|
||||
static HRESULT WINAPI ICMStream_fnRead(IAVIStream*iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,LONG *bytesread,LONG *samplesread);
|
||||
static HRESULT WINAPI ICMStream_fnWrite(IAVIStream*iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,DWORD flags,LONG *sampwritten,LONG *byteswritten);
|
||||
static HRESULT WINAPI ICMStream_fnDelete(IAVIStream*iface,LONG start,LONG samples);
|
||||
static HRESULT WINAPI ICMStream_fnReadData(IAVIStream*iface,DWORD fcc,LPVOID lp,LONG *lpread);
|
||||
static HRESULT WINAPI ICMStream_fnWriteData(IAVIStream*iface,DWORD fcc,LPVOID lp,LONG size);
|
||||
static HRESULT WINAPI ICMStream_fnSetInfo(IAVIStream*iface,AVISTREAMINFOW*info,LONG infolen);
|
||||
|
||||
static const struct IAVIStreamVtbl iicmst = {
|
||||
ICMStream_fnQueryInterface,
|
||||
ICMStream_fnAddRef,
|
||||
ICMStream_fnRelease,
|
||||
ICMStream_fnCreate,
|
||||
ICMStream_fnInfo,
|
||||
ICMStream_fnFindSample,
|
||||
ICMStream_fnReadFormat,
|
||||
ICMStream_fnSetFormat,
|
||||
ICMStream_fnRead,
|
||||
ICMStream_fnWrite,
|
||||
ICMStream_fnDelete,
|
||||
ICMStream_fnReadData,
|
||||
ICMStream_fnWriteData,
|
||||
ICMStream_fnSetInfo
|
||||
};
|
||||
|
||||
typedef struct _IAVIStreamImpl {
|
||||
/* IUnknown stuff */
|
||||
const IAVIStreamVtbl *lpVtbl;
|
||||
LONG ref;
|
||||
|
||||
/* IAVIStream stuff */
|
||||
PAVISTREAM pStream;
|
||||
AVISTREAMINFOW sInfo;
|
||||
|
||||
PGETFRAME pg;
|
||||
HIC hic;
|
||||
DWORD dwICMFlags;
|
||||
|
||||
LONG lCurrent;
|
||||
LONG lLastKey;
|
||||
LONG lKeyFrameEvery;
|
||||
DWORD dwLastQuality;
|
||||
DWORD dwBytesPerFrame;
|
||||
DWORD dwUnusedBytes;
|
||||
|
||||
LPBITMAPINFOHEADER lpbiCur; /* current frame */
|
||||
LPVOID lpCur;
|
||||
LPBITMAPINFOHEADER lpbiPrev; /* previous frame */
|
||||
LPVOID lpPrev;
|
||||
|
||||
LPBITMAPINFOHEADER lpbiOutput; /* output format of codec */
|
||||
LONG cbOutput;
|
||||
LPBITMAPINFOHEADER lpbiInput; /* input format for codec */
|
||||
LONG cbInput;
|
||||
} IAVIStreamImpl;
|
||||
|
||||
/***********************************************************************/
|
||||
|
||||
static HRESULT AVIFILE_EncodeFrame(IAVIStreamImpl *This,
|
||||
LPBITMAPINFOHEADER lpbi, LPVOID lpBits);
|
||||
static HRESULT AVIFILE_OpenGetFrame(IAVIStreamImpl *This);
|
||||
|
||||
static inline void AVIFILE_Reset(IAVIStreamImpl *This)
|
||||
{
|
||||
This->lCurrent = -1;
|
||||
This->lLastKey = 0;
|
||||
This->dwLastQuality = ICQUALITY_HIGH;
|
||||
This->dwUnusedBytes = 0;
|
||||
}
|
||||
|
||||
HRESULT AVIFILE_CreateICMStream(REFIID riid, LPVOID *ppv)
|
||||
{
|
||||
IAVIStreamImpl *pstream;
|
||||
HRESULT hr;
|
||||
|
||||
assert(riid != NULL && ppv != NULL);
|
||||
|
||||
*ppv = NULL;
|
||||
|
||||
pstream = (IAVIStreamImpl*)LocalAlloc(LPTR, sizeof(IAVIStreamImpl));
|
||||
if (pstream == NULL)
|
||||
return AVIERR_MEMORY;
|
||||
|
||||
pstream->lpVtbl = &iicmst;
|
||||
AVIFILE_Reset(pstream);
|
||||
|
||||
hr = IAVIStream_QueryInterface((IAVIStream*)pstream, riid, ppv);
|
||||
if (FAILED(hr))
|
||||
LocalFree((HLOCAL)pstream);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ICMStream_fnQueryInterface(IAVIStream *iface,
|
||||
REFIID refiid, LPVOID *obj)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
|
||||
TRACE("(%p,%s,%p)\n", iface, debugstr_guid(refiid), obj);
|
||||
|
||||
if (IsEqualGUID(&IID_IUnknown, refiid) ||
|
||||
IsEqualGUID(&IID_IAVIStream, refiid)) {
|
||||
*obj = This;
|
||||
IAVIStream_AddRef(iface);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
return OLE_E_ENUM_NOMORE;
|
||||
}
|
||||
|
||||
static ULONG WINAPI ICMStream_fnAddRef(IAVIStream *iface)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
ULONG ref = InterlockedIncrement(&This->ref);
|
||||
|
||||
TRACE("(%p) -> %ld\n", iface, ref);
|
||||
|
||||
/* also add reference to the nested stream */
|
||||
if (This->pStream != NULL)
|
||||
IAVIStream_AddRef(This->pStream);
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
static ULONG WINAPI ICMStream_fnRelease(IAVIStream* iface)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
ULONG ref = InterlockedDecrement(&This->ref);
|
||||
|
||||
TRACE("(%p) -> %ld\n", iface, ref);
|
||||
|
||||
if (ref == 0) {
|
||||
/* destruct */
|
||||
if (This->pg != NULL) {
|
||||
AVIStreamGetFrameClose(This->pg);
|
||||
This->pg = NULL;
|
||||
}
|
||||
if (This->pStream != NULL) {
|
||||
IAVIStream_Release(This->pStream);
|
||||
This->pStream = NULL;
|
||||
}
|
||||
if (This->hic != NULL) {
|
||||
if (This->lpbiPrev != NULL) {
|
||||
ICDecompressEnd(This->hic);
|
||||
GlobalFreePtr(This->lpbiPrev);
|
||||
This->lpbiPrev = NULL;
|
||||
This->lpPrev = NULL;
|
||||
}
|
||||
ICCompressEnd(This->hic);
|
||||
This->hic = NULL;
|
||||
}
|
||||
if (This->lpbiCur != NULL) {
|
||||
GlobalFreePtr(This->lpbiCur);
|
||||
This->lpbiCur = NULL;
|
||||
This->lpCur = NULL;
|
||||
}
|
||||
if (This->lpbiOutput != NULL) {
|
||||
GlobalFreePtr(This->lpbiOutput);
|
||||
This->lpbiOutput = NULL;
|
||||
This->cbOutput = 0;
|
||||
}
|
||||
if (This->lpbiInput != NULL) {
|
||||
GlobalFreePtr(This->lpbiInput);
|
||||
This->lpbiInput = NULL;
|
||||
This->cbInput = 0;
|
||||
}
|
||||
|
||||
LocalFree((HLOCAL)This);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* also release reference to the nested stream */
|
||||
if (This->pStream != NULL)
|
||||
IAVIStream_Release(This->pStream);
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
/* lParam1: PAVISTREAM
|
||||
* lParam2: LPAVICOMPRESSOPTIONS
|
||||
*/
|
||||
static HRESULT WINAPI ICMStream_fnCreate(IAVIStream *iface, LPARAM lParam1,
|
||||
LPARAM lParam2)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
|
||||
ICINFO icinfo;
|
||||
ICCOMPRESSFRAMES icFrames;
|
||||
LPAVICOMPRESSOPTIONS pco = (LPAVICOMPRESSOPTIONS)lParam2;
|
||||
|
||||
TRACE("(%p,0x%08lX,0x%08lX)\n", iface, lParam1, lParam2);
|
||||
|
||||
/* check parameter */
|
||||
if ((LPVOID)lParam1 == NULL)
|
||||
return AVIERR_BADPARAM;
|
||||
|
||||
/* get infos from stream */
|
||||
IAVIStream_Info((PAVISTREAM)lParam1, &This->sInfo, sizeof(This->sInfo));
|
||||
if (This->sInfo.fccType != streamtypeVIDEO)
|
||||
return AVIERR_ERROR; /* error in registry or AVIMakeCompressedStream */
|
||||
|
||||
/* add reference to the stream */
|
||||
This->pStream = (PAVISTREAM)lParam1;
|
||||
IAVIStream_AddRef(This->pStream);
|
||||
|
||||
AVIFILE_Reset(This);
|
||||
|
||||
if (pco != NULL && pco->fccHandler != comptypeDIB) {
|
||||
/* we should compress */
|
||||
This->sInfo.fccHandler = pco->fccHandler;
|
||||
|
||||
This->hic = ICOpen(ICTYPE_VIDEO, pco->fccHandler, ICMODE_COMPRESS);
|
||||
if (This->hic == NULL)
|
||||
return AVIERR_NOCOMPRESSOR;
|
||||
|
||||
/* restore saved state of codec */
|
||||
if (pco->cbParms > 0 && pco->lpParms != NULL) {
|
||||
ICSetState(This->hic, pco->lpParms, pco->cbParms);
|
||||
}
|
||||
|
||||
/* set quality -- resolve default quality */
|
||||
This->sInfo.dwQuality = pco->dwQuality;
|
||||
if (pco->dwQuality == ICQUALITY_DEFAULT)
|
||||
This->sInfo.dwQuality = ICGetDefaultQuality(This->hic);
|
||||
|
||||
/* get capabilities of codec */
|
||||
ICGetInfo(This->hic, &icinfo, sizeof(icinfo));
|
||||
This->dwICMFlags = icinfo.dwFlags;
|
||||
|
||||
/* use keyframes? */
|
||||
if ((pco->dwFlags & AVICOMPRESSF_KEYFRAMES) &&
|
||||
(icinfo.dwFlags & (VIDCF_TEMPORAL|VIDCF_FASTTEMPORALC))) {
|
||||
This->lKeyFrameEvery = pco->dwKeyFrameEvery;
|
||||
} else
|
||||
This->lKeyFrameEvery = 1;
|
||||
|
||||
/* use datarate? */
|
||||
if ((pco->dwFlags & AVICOMPRESSF_DATARATE)) {
|
||||
/* Do we have a chance to reduce size to desired one? */
|
||||
if ((icinfo.dwFlags & (VIDCF_CRUNCH|VIDCF_QUALITY)) == 0)
|
||||
return AVIERR_NOCOMPRESSOR;
|
||||
|
||||
assert(This->sInfo.dwRate != 0);
|
||||
|
||||
This->dwBytesPerFrame = MulDiv(pco->dwBytesPerSecond,
|
||||
This->sInfo.dwScale, This->sInfo.dwRate);
|
||||
} else {
|
||||
pco->dwBytesPerSecond = 0;
|
||||
This->dwBytesPerFrame = 0;
|
||||
}
|
||||
|
||||
if (icinfo.dwFlags & VIDCF_COMPRESSFRAMES) {
|
||||
memset(&icFrames, 0, sizeof(icFrames));
|
||||
icFrames.lpbiOutput = This->lpbiOutput;
|
||||
icFrames.lpbiInput = This->lpbiInput;
|
||||
icFrames.lFrameCount = This->sInfo.dwLength;
|
||||
icFrames.lQuality = This->sInfo.dwQuality;
|
||||
icFrames.lDataRate = pco->dwBytesPerSecond;
|
||||
icFrames.lKeyRate = This->lKeyFrameEvery;
|
||||
icFrames.dwRate = This->sInfo.dwRate;
|
||||
icFrames.dwScale = This->sInfo.dwScale;
|
||||
ICSendMessage(This->hic, ICM_COMPRESS_FRAMES_INFO,
|
||||
(LPARAM)&icFrames, (LPARAM)sizeof(icFrames));
|
||||
}
|
||||
} else
|
||||
This->sInfo.fccHandler = comptypeDIB;
|
||||
|
||||
return AVIERR_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ICMStream_fnInfo(IAVIStream *iface,LPAVISTREAMINFOW psi,
|
||||
LONG size)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
|
||||
TRACE("(%p,%p,%ld)\n", iface, psi, size);
|
||||
|
||||
if (psi == NULL)
|
||||
return AVIERR_BADPARAM;
|
||||
if (size < 0)
|
||||
return AVIERR_BADSIZE;
|
||||
|
||||
memcpy(psi, &This->sInfo, min((DWORD)size, sizeof(This->sInfo)));
|
||||
|
||||
if ((DWORD)size < sizeof(This->sInfo))
|
||||
return AVIERR_BUFFERTOOSMALL;
|
||||
return AVIERR_OK;
|
||||
}
|
||||
|
||||
static LONG WINAPI ICMStream_fnFindSample(IAVIStream *iface, LONG pos,
|
||||
LONG flags)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
|
||||
TRACE("(%p,%ld,0x%08lX)\n",iface,pos,flags);
|
||||
|
||||
if (flags & FIND_FROM_START) {
|
||||
pos = This->sInfo.dwStart;
|
||||
flags &= ~(FIND_FROM_START|FIND_PREV);
|
||||
flags |= FIND_NEXT;
|
||||
}
|
||||
|
||||
if (flags & FIND_RET)
|
||||
WARN(": FIND_RET flags will be ignored!\n");
|
||||
|
||||
if (flags & FIND_KEY) {
|
||||
if (This->hic == NULL)
|
||||
return pos; /* we decompress so every frame is a keyframe */
|
||||
|
||||
if (flags & FIND_PREV) {
|
||||
/* need to read old or new frames? */
|
||||
if (This->lLastKey <= pos || pos < This->lCurrent)
|
||||
IAVIStream_Read(iface, pos, 1, NULL, 0, NULL, NULL);
|
||||
|
||||
return This->lLastKey;
|
||||
}
|
||||
} else if (flags & FIND_ANY) {
|
||||
return pos; /* We really don't know, reread is to expensive, so guess. */
|
||||
} else if (flags & FIND_FORMAT) {
|
||||
if (flags & FIND_PREV)
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ICMStream_fnReadFormat(IAVIStream *iface, LONG pos,
|
||||
LPVOID format, LONG *formatsize)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
|
||||
LPBITMAPINFOHEADER lpbi;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p,%ld,%p,%p)\n", iface, pos, format, formatsize);
|
||||
|
||||
if (formatsize == NULL)
|
||||
return AVIERR_BADPARAM;
|
||||
|
||||
if (This->pg == NULL) {
|
||||
hr = AVIFILE_OpenGetFrame(This);
|
||||
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
}
|
||||
|
||||
lpbi = (LPBITMAPINFOHEADER)AVIStreamGetFrame(This->pg, pos);
|
||||
if (lpbi == NULL)
|
||||
return AVIERR_MEMORY;
|
||||
|
||||
if (This->hic == NULL) {
|
||||
LONG size = lpbi->biSize + lpbi->biClrUsed * sizeof(RGBQUAD);
|
||||
|
||||
if (size > 0) {
|
||||
if (This->sInfo.dwSuggestedBufferSize < lpbi->biSizeImage)
|
||||
This->sInfo.dwSuggestedBufferSize = lpbi->biSizeImage;
|
||||
|
||||
This->cbOutput = size;
|
||||
if (format != NULL) {
|
||||
if (This->lpbiOutput != NULL)
|
||||
memcpy(format, This->lpbiOutput, min(*formatsize, This->cbOutput));
|
||||
else
|
||||
memcpy(format, lpbi, min(*formatsize, size));
|
||||
}
|
||||
}
|
||||
} else if (format != NULL)
|
||||
memcpy(format, This->lpbiOutput, min(*formatsize, This->cbOutput));
|
||||
|
||||
if (*formatsize < This->cbOutput)
|
||||
hr = AVIERR_BUFFERTOOSMALL;
|
||||
else
|
||||
hr = AVIERR_OK;
|
||||
|
||||
*formatsize = This->cbOutput;
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ICMStream_fnSetFormat(IAVIStream *iface, LONG pos,
|
||||
LPVOID format, LONG formatsize)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
|
||||
TRACE("(%p,%ld,%p,%ld)\n", iface, pos, format, formatsize);
|
||||
|
||||
/* check parameters */
|
||||
if (format == NULL || formatsize <= 0)
|
||||
return AVIERR_BADPARAM;
|
||||
|
||||
/* We can only accept RGB data for writing */
|
||||
if (((LPBITMAPINFOHEADER)format)->biCompression != BI_RGB) {
|
||||
WARN(": need RGB data as input\n");
|
||||
return AVIERR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
/* Input format already known?
|
||||
* Changing of palette is supported, but be quiet if it's the same */
|
||||
if (This->lpbiInput != NULL) {
|
||||
if (This->cbInput != formatsize)
|
||||
return AVIERR_UNSUPPORTED;
|
||||
|
||||
if (memcmp(format, This->lpbiInput, formatsize) == 0)
|
||||
return AVIERR_OK;
|
||||
}
|
||||
|
||||
/* Does the nested stream support writing? */
|
||||
if ((This->sInfo.dwCaps & AVIFILECAPS_CANWRITE) == 0)
|
||||
return AVIERR_READONLY;
|
||||
|
||||
/* check if frame is already written */
|
||||
if (This->sInfo.dwLength + This->sInfo.dwStart > pos)
|
||||
return AVIERR_UNSUPPORTED;
|
||||
|
||||
/* check if we should compress */
|
||||
if (This->sInfo.fccHandler == 0 ||
|
||||
This->sInfo.fccHandler == mmioFOURCC('N','O','N','E'))
|
||||
This->sInfo.fccHandler = comptypeDIB;
|
||||
|
||||
/* only pass through? */
|
||||
if (This->sInfo.fccHandler == comptypeDIB)
|
||||
return IAVIStream_SetFormat(This->pStream, pos, format, formatsize);
|
||||
|
||||
/* initial format setting? */
|
||||
if (This->lpbiInput == NULL) {
|
||||
ULONG size;
|
||||
|
||||
assert(This->hic != NULL);
|
||||
|
||||
/* get memory for input format */
|
||||
This->lpbiInput = (LPBITMAPINFOHEADER)GlobalAllocPtr(GHND, formatsize);
|
||||
if (This->lpbiInput == NULL)
|
||||
return AVIERR_MEMORY;
|
||||
This->cbInput = formatsize;
|
||||
memcpy(This->lpbiInput, format, formatsize);
|
||||
|
||||
/* get output format */
|
||||
size = ICCompressGetFormatSize(This->hic, This->lpbiInput);
|
||||
if (size < sizeof(BITMAPINFOHEADER))
|
||||
return AVIERR_COMPRESSOR;
|
||||
This->lpbiOutput = (LPBITMAPINFOHEADER)GlobalAllocPtr(GHND, size);
|
||||
if (This->lpbiOutput == NULL)
|
||||
return AVIERR_MEMORY;
|
||||
This->cbOutput = size;
|
||||
if (ICCompressGetFormat(This->hic,This->lpbiInput,This->lpbiOutput) < S_OK)
|
||||
return AVIERR_COMPRESSOR;
|
||||
|
||||
/* update AVISTREAMINFO structure */
|
||||
This->sInfo.rcFrame.right =
|
||||
This->sInfo.rcFrame.left + This->lpbiOutput->biWidth;
|
||||
This->sInfo.rcFrame.bottom =
|
||||
This->sInfo.rcFrame.top + This->lpbiOutput->biHeight;
|
||||
|
||||
/* prepare codec for compression */
|
||||
if (ICCompressBegin(This->hic, This->lpbiInput, This->lpbiOutput) != S_OK)
|
||||
return AVIERR_COMPRESSOR;
|
||||
|
||||
/* allocate memory for compressed frame */
|
||||
size = ICCompressGetSize(This->hic, This->lpbiInput, This->lpbiOutput);
|
||||
This->lpbiCur =
|
||||
(LPBITMAPINFOHEADER)GlobalAllocPtr(GMEM_MOVEABLE, This->cbOutput + size);
|
||||
if (This->lpbiCur == NULL)
|
||||
return AVIERR_MEMORY;
|
||||
memcpy(This->lpbiCur, This->lpbiOutput, This->cbOutput);
|
||||
This->lpCur = DIBPTR(This->lpbiCur);
|
||||
|
||||
/* allocate memory for last frame if needed */
|
||||
if (This->lKeyFrameEvery != 1 &&
|
||||
(This->dwICMFlags & VIDCF_FASTTEMPORALC) == 0) {
|
||||
size = ICDecompressGetFormatSize(This->hic, This->lpbiOutput);
|
||||
This->lpbiPrev = (LPBITMAPINFOHEADER)GlobalAllocPtr(GHND, size);
|
||||
if (This->lpbiPrev == NULL)
|
||||
return AVIERR_MEMORY;
|
||||
if (ICDecompressGetFormat(This->hic, This->lpbiOutput, This->lpbiPrev) < S_OK)
|
||||
return AVIERR_COMPRESSOR;
|
||||
|
||||
if (This->lpbiPrev->biSizeImage == 0) {
|
||||
This->lpbiPrev->biSizeImage =
|
||||
DIBWIDTHBYTES(*This->lpbiPrev) * This->lpbiPrev->biHeight;
|
||||
}
|
||||
|
||||
/* get memory for format and picture */
|
||||
size += This->lpbiPrev->biSizeImage;
|
||||
This->lpbiPrev =
|
||||
(LPBITMAPINFOHEADER)GlobalReAllocPtr(This->lpbiPrev,size,GMEM_MOVEABLE);
|
||||
if (This->lpbiPrev == NULL)
|
||||
return AVIERR_MEMORY;
|
||||
This->lpPrev = DIBPTR(This->lpbiPrev);
|
||||
|
||||
/* prepare codec also for decompression */
|
||||
if (ICDecompressBegin(This->hic,This->lpbiOutput,This->lpbiPrev) != S_OK)
|
||||
return AVIERR_COMPRESSOR;
|
||||
}
|
||||
} else {
|
||||
/* format change -- check that's only the palette */
|
||||
LPBITMAPINFOHEADER lpbi = (LPBITMAPINFOHEADER)format;
|
||||
|
||||
if (lpbi->biSize != This->lpbiInput->biSize ||
|
||||
lpbi->biWidth != This->lpbiInput->biWidth ||
|
||||
lpbi->biHeight != This->lpbiInput->biHeight ||
|
||||
lpbi->biBitCount != This->lpbiInput->biBitCount ||
|
||||
lpbi->biPlanes != This->lpbiInput->biPlanes ||
|
||||
lpbi->biCompression != This->lpbiInput->biCompression ||
|
||||
lpbi->biClrUsed != This->lpbiInput->biClrUsed)
|
||||
return AVIERR_UNSUPPORTED;
|
||||
|
||||
/* get new output format */
|
||||
if (ICCompressGetFormat(This->hic, lpbi, This->lpbiOutput) < S_OK)
|
||||
return AVIERR_BADFORMAT;
|
||||
|
||||
/* restart compression */
|
||||
ICCompressEnd(This->hic);
|
||||
if (ICCompressBegin(This->hic, lpbi, This->lpbiOutput) != S_OK)
|
||||
return AVIERR_COMPRESSOR;
|
||||
|
||||
/* check if we need to restart decompresion also */
|
||||
if (This->lKeyFrameEvery != 1 &&
|
||||
(This->dwICMFlags & VIDCF_FASTTEMPORALC) == 0) {
|
||||
ICDecompressEnd(This->hic);
|
||||
if (ICDecompressGetFormat(This->hic,This->lpbiOutput,This->lpbiPrev) < S_OK)
|
||||
return AVIERR_COMPRESSOR;
|
||||
if (ICDecompressBegin(This->hic,This->lpbiOutput,This->lpbiPrev) != S_OK)
|
||||
return AVIERR_COMPRESSOR;
|
||||
}
|
||||
}
|
||||
|
||||
/* tell nested stream the new format */
|
||||
return IAVIStream_SetFormat(This->pStream, pos,
|
||||
This->lpbiOutput, This->cbOutput);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ICMStream_fnRead(IAVIStream *iface, LONG start,
|
||||
LONG samples, LPVOID buffer,
|
||||
LONG buffersize, LPLONG bytesread,
|
||||
LPLONG samplesread)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
|
||||
LPBITMAPINFOHEADER lpbi;
|
||||
|
||||
TRACE("(%p,%ld,%ld,%p,%ld,%p,%p)\n", iface, start, samples, buffer,
|
||||
buffersize, bytesread, samplesread);
|
||||
|
||||
/* clear return parameters if given */
|
||||
if (bytesread != NULL)
|
||||
*bytesread = 0;
|
||||
if (samplesread != NULL)
|
||||
*samplesread = 0;
|
||||
|
||||
if (samples == 0)
|
||||
return AVIERR_OK;
|
||||
|
||||
/* check parameters */
|
||||
if (samples != 1 && (bytesread == NULL && samplesread == NULL))
|
||||
return AVIERR_BADPARAM;
|
||||
if (samples == -1) /* read as much as we could */
|
||||
samples = 1;
|
||||
|
||||
if (This->pg == NULL) {
|
||||
HRESULT hr = AVIFILE_OpenGetFrame(This);
|
||||
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
}
|
||||
|
||||
/* compress or decompress? */
|
||||
if (This->hic == NULL) {
|
||||
/* decompress */
|
||||
lpbi = (LPBITMAPINFOHEADER)AVIStreamGetFrame(This->pg, start);
|
||||
if (lpbi == NULL)
|
||||
return AVIERR_MEMORY;
|
||||
|
||||
if (buffer != NULL && buffersize > 0) {
|
||||
/* check buffersize */
|
||||
if (buffersize < lpbi->biSizeImage)
|
||||
return AVIERR_BUFFERTOOSMALL;
|
||||
|
||||
memcpy(buffer, DIBPTR(lpbi), lpbi->biSizeImage);
|
||||
}
|
||||
|
||||
/* fill out return parameters if given */
|
||||
if (bytesread != NULL)
|
||||
*bytesread = lpbi->biSizeImage;
|
||||
} else {
|
||||
/* compress */
|
||||
if (This->lCurrent > start)
|
||||
AVIFILE_Reset(This);
|
||||
|
||||
while (start > This->lCurrent) {
|
||||
HRESULT hr;
|
||||
|
||||
lpbi = (LPBITMAPINFOHEADER)AVIStreamGetFrame(This->pg, ++This->lCurrent);
|
||||
if (lpbi == NULL) {
|
||||
AVIFILE_Reset(This);
|
||||
return AVIERR_MEMORY;
|
||||
}
|
||||
|
||||
hr = AVIFILE_EncodeFrame(This, lpbi, DIBPTR(lpbi));
|
||||
if (FAILED(hr)) {
|
||||
AVIFILE_Reset(This);
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
|
||||
if (buffer != NULL && buffersize > 0) {
|
||||
/* check buffersize */
|
||||
if (This->lpbiCur->biSizeImage > buffersize)
|
||||
return AVIERR_BUFFERTOOSMALL;
|
||||
|
||||
memcpy(buffer, This->lpCur, This->lpbiCur->biSizeImage);
|
||||
}
|
||||
|
||||
/* fill out return parameters if given */
|
||||
if (bytesread != NULL)
|
||||
*bytesread = This->lpbiCur->biSizeImage;
|
||||
}
|
||||
|
||||
/* fill out return parameters if given */
|
||||
if (samplesread != NULL)
|
||||
*samplesread = 1;
|
||||
|
||||
return AVIERR_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ICMStream_fnWrite(IAVIStream *iface, LONG start,
|
||||
LONG samples, LPVOID buffer,
|
||||
LONG buffersize, DWORD flags,
|
||||
LPLONG sampwritten,
|
||||
LPLONG byteswritten)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p,%ld,%ld,%p,%ld,0x%08lX,%p,%p)\n", iface, start, samples,
|
||||
buffer, buffersize, flags, sampwritten, byteswritten);
|
||||
|
||||
/* clear return parameters if given */
|
||||
if (sampwritten != NULL)
|
||||
*sampwritten = 0;
|
||||
if (byteswritten != NULL)
|
||||
*byteswritten = 0;
|
||||
|
||||
/* check parameters */
|
||||
if (buffer == NULL && (buffersize > 0 || samples > 0))
|
||||
return AVIERR_BADPARAM;
|
||||
|
||||
if (This->sInfo.fccHandler == comptypeDIB) {
|
||||
/* only pass through */
|
||||
flags |= AVIIF_KEYFRAME;
|
||||
|
||||
return IAVIStream_Write(This->pStream, start, samples, buffer, buffersize,
|
||||
flags, sampwritten, byteswritten);
|
||||
} else {
|
||||
/* compress data before writing to pStream */
|
||||
if (samples != 1 && (sampwritten == NULL && byteswritten == NULL))
|
||||
return AVIERR_UNSUPPORTED;
|
||||
|
||||
This->lCurrent = start;
|
||||
hr = AVIFILE_EncodeFrame(This, This->lpbiInput, buffer);
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
if (This->lLastKey == start)
|
||||
flags |= AVIIF_KEYFRAME;
|
||||
|
||||
return IAVIStream_Write(This->pStream, start, samples, This->lpCur,
|
||||
This->lpbiCur->biSizeImage, flags, byteswritten,
|
||||
sampwritten);
|
||||
}
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ICMStream_fnDelete(IAVIStream *iface, LONG start,
|
||||
LONG samples)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
|
||||
TRACE("(%p,%ld,%ld)\n", iface, start, samples);
|
||||
|
||||
return IAVIStream_Delete(This->pStream, start, samples);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ICMStream_fnReadData(IAVIStream *iface, DWORD fcc,
|
||||
LPVOID lp, LPLONG lpread)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
|
||||
TRACE("(%p,0x%08lX,%p,%p)\n", iface, fcc, lp, lpread);
|
||||
|
||||
assert(This->pStream != NULL);
|
||||
|
||||
return IAVIStream_ReadData(This->pStream, fcc, lp, lpread);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ICMStream_fnWriteData(IAVIStream *iface, DWORD fcc,
|
||||
LPVOID lp, LONG size)
|
||||
{
|
||||
IAVIStreamImpl *This = (IAVIStreamImpl *)iface;
|
||||
|
||||
TRACE("(%p,0x%08lx,%p,%ld)\n", iface, fcc, lp, size);
|
||||
|
||||
assert(This->pStream != NULL);
|
||||
|
||||
return IAVIStream_WriteData(This->pStream, fcc, lp, size);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ICMStream_fnSetInfo(IAVIStream *iface,
|
||||
LPAVISTREAMINFOW info, LONG infolen)
|
||||
{
|
||||
FIXME("(%p,%p,%ld): stub\n", iface, info, infolen);
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/***********************************************************************/
|
||||
|
||||
static HRESULT AVIFILE_EncodeFrame(IAVIStreamImpl *This,
|
||||
LPBITMAPINFOHEADER lpbi, LPVOID lpBits)
|
||||
{
|
||||
DWORD dwMinQual, dwMaxQual, dwCurQual;
|
||||
DWORD dwRequest;
|
||||
DWORD icmFlags = 0;
|
||||
DWORD idxFlags = 0;
|
||||
BOOL bDecreasedQual = FALSE;
|
||||
BOOL doSizeCheck;
|
||||
BOOL noPrev;
|
||||
|
||||
/* make lKeyFrameEvery and at start a keyframe */
|
||||
if ((This->lKeyFrameEvery != 0 &&
|
||||
(This->lCurrent - This->lLastKey) >= This->lKeyFrameEvery) ||
|
||||
This->lCurrent == This->sInfo.dwStart) {
|
||||
idxFlags = AVIIF_KEYFRAME;
|
||||
icmFlags = ICCOMPRESS_KEYFRAME;
|
||||
}
|
||||
|
||||
if (This->lKeyFrameEvery != 0) {
|
||||
if (This->lCurrent == This->sInfo.dwStart) {
|
||||
if (idxFlags & AVIIF_KEYFRAME) {
|
||||
/* for keyframes allow to consume all unused bytes */
|
||||
dwRequest = This->dwBytesPerFrame + This->dwUnusedBytes;
|
||||
This->dwUnusedBytes = 0;
|
||||
} else {
|
||||
/* for non-keyframes only allow something of the unused bytes to be consumed */
|
||||
DWORD tmp1 = 0;
|
||||
DWORD tmp2;
|
||||
|
||||
if (This->dwBytesPerFrame >= This->dwUnusedBytes)
|
||||
tmp1 = This->dwBytesPerFrame / This->lKeyFrameEvery;
|
||||
tmp2 = (This->dwUnusedBytes + tmp1) / This->lKeyFrameEvery;
|
||||
|
||||
dwRequest = This->dwBytesPerFrame - tmp1 + tmp2;
|
||||
This->dwUnusedBytes -= tmp2;
|
||||
}
|
||||
} else
|
||||
dwRequest = MAX_FRAMESIZE;
|
||||
} else {
|
||||
/* only one keyframe at start desired */
|
||||
if (This->lCurrent == This->sInfo.dwStart) {
|
||||
dwRequest = This->dwBytesPerFrame + This->dwUnusedBytes;
|
||||
This->dwUnusedBytes = 0;
|
||||
} else
|
||||
dwRequest = MAX_FRAMESIZE;
|
||||
}
|
||||
|
||||
/* must we check for framesize to gain requested
|
||||
* datarate or could we trust codec? */
|
||||
doSizeCheck = (dwRequest != 0 && ((This->dwICMFlags & (VIDCF_CRUNCH|VIDCF_QUALITY)) == 0));
|
||||
|
||||
dwMaxQual = dwCurQual = This->sInfo.dwQuality;
|
||||
dwMinQual = ICQUALITY_LOW;
|
||||
|
||||
noPrev = TRUE;
|
||||
if ((icmFlags & ICCOMPRESS_KEYFRAME) == 0 &&
|
||||
(This->dwICMFlags & VIDCF_FASTTEMPORALC) == 0)
|
||||
noPrev = FALSE;
|
||||
|
||||
do {
|
||||
DWORD idxCkid = 0;
|
||||
HRESULT hr;
|
||||
|
||||
hr = ICCompress(This->hic,icmFlags,This->lpbiCur,This->lpCur,lpbi,lpBits,
|
||||
&idxCkid, &idxFlags, This->lCurrent, dwRequest, dwCurQual,
|
||||
noPrev ? NULL:This->lpbiPrev, noPrev ? NULL:This->lpPrev);
|
||||
if (hr == ICERR_NEWPALETTE) {
|
||||
FIXME(": codec has changed palette -- unhandled!\n");
|
||||
} else if (hr != ICERR_OK)
|
||||
return AVIERR_COMPRESSOR;
|
||||
|
||||
/* need to check for framesize */
|
||||
if (! doSizeCheck)
|
||||
break;
|
||||
|
||||
if (dwRequest >= This->lpbiCur->biSizeImage) {
|
||||
/* frame is smaller -- try to maximize quality */
|
||||
if (dwMaxQual - dwCurQual > 10) {
|
||||
DWORD tmp = dwRequest / 8;
|
||||
|
||||
if (tmp < MAX_FRAMESIZE_DIFF)
|
||||
tmp = MAX_FRAMESIZE_DIFF;
|
||||
|
||||
if (tmp < dwRequest - This->lpbiCur->biSizeImage && bDecreasedQual) {
|
||||
tmp = dwCurQual;
|
||||
dwCurQual = (dwMinQual + dwMaxQual) / 2;
|
||||
dwMinQual = tmp;
|
||||
continue;
|
||||
}
|
||||
} else
|
||||
break;
|
||||
} else if (dwMaxQual - dwMinQual <= 1) {
|
||||
break;
|
||||
} else {
|
||||
dwMaxQual = dwCurQual;
|
||||
|
||||
if (bDecreasedQual || dwCurQual == This->dwLastQuality)
|
||||
dwCurQual = (dwMinQual + dwMaxQual) / 2;
|
||||
else
|
||||
FIXME(": no new quality computed min=%lu cur=%lu max=%lu last=%lu\n",
|
||||
dwMinQual, dwCurQual, dwMaxQual, This->dwLastQuality);
|
||||
|
||||
bDecreasedQual = TRUE;
|
||||
}
|
||||
} while (TRUE);
|
||||
|
||||
/* remember some values */
|
||||
This->dwLastQuality = dwCurQual;
|
||||
This->dwUnusedBytes = dwRequest - This->lpbiCur->biSizeImage;
|
||||
if (icmFlags & ICCOMPRESS_KEYFRAME)
|
||||
This->lLastKey = This->lCurrent;
|
||||
|
||||
/* Does we manage previous frame? */
|
||||
if (This->lpPrev != NULL && This->lKeyFrameEvery != 1)
|
||||
ICDecompress(This->hic, 0, This->lpbiCur, This->lpCur,
|
||||
This->lpbiPrev, This->lpPrev);
|
||||
|
||||
return AVIERR_OK;
|
||||
}
|
||||
|
||||
static HRESULT AVIFILE_OpenGetFrame(IAVIStreamImpl *This)
|
||||
{
|
||||
LPBITMAPINFOHEADER lpbi;
|
||||
DWORD size;
|
||||
|
||||
/* pre-conditions */
|
||||
assert(This != NULL);
|
||||
assert(This->pStream != NULL);
|
||||
assert(This->pg == NULL);
|
||||
|
||||
This->pg = AVIStreamGetFrameOpen(This->pStream, NULL);
|
||||
if (This->pg == NULL)
|
||||
return AVIERR_ERROR;
|
||||
|
||||
/* When we only decompress this is enough */
|
||||
if (This->sInfo.fccHandler == comptypeDIB)
|
||||
return AVIERR_OK;
|
||||
|
||||
assert(This->hic != NULL);
|
||||
assert(This->lpbiOutput == NULL);
|
||||
|
||||
/* get input format */
|
||||
lpbi = (LPBITMAPINFOHEADER)AVIStreamGetFrame(This->pg, This->sInfo.dwStart);
|
||||
if (lpbi == NULL)
|
||||
return AVIERR_MEMORY;
|
||||
|
||||
/* get memory for output format */
|
||||
size = ICCompressGetFormatSize(This->hic, lpbi);
|
||||
if ((LONG)size < (LONG)sizeof(BITMAPINFOHEADER))
|
||||
return AVIERR_COMPRESSOR;
|
||||
This->lpbiOutput = (LPBITMAPINFOHEADER)GlobalAllocPtr(GHND, size);
|
||||
if (This->lpbiOutput == NULL)
|
||||
return AVIERR_MEMORY;
|
||||
This->cbOutput = size;
|
||||
|
||||
if (ICCompressGetFormat(This->hic, lpbi, This->lpbiOutput) < S_OK)
|
||||
return AVIERR_BADFORMAT;
|
||||
|
||||
/* update AVISTREAMINFO structure */
|
||||
This->sInfo.rcFrame.right =
|
||||
This->sInfo.rcFrame.left + This->lpbiOutput->biWidth;
|
||||
This->sInfo.rcFrame.bottom =
|
||||
This->sInfo.rcFrame.top + This->lpbiOutput->biHeight;
|
||||
This->sInfo.dwSuggestedBufferSize =
|
||||
ICCompressGetSize(This->hic, lpbi, This->lpbiOutput);
|
||||
|
||||
/* prepare codec for compression */
|
||||
if (ICCompressBegin(This->hic, lpbi, This->lpbiOutput) != S_OK)
|
||||
return AVIERR_COMPRESSOR;
|
||||
|
||||
/* allocate memory for current frame */
|
||||
size += This->sInfo.dwSuggestedBufferSize;
|
||||
This->lpbiCur = (LPBITMAPINFOHEADER)GlobalAllocPtr(GMEM_MOVEABLE, size);
|
||||
if (This->lpbiCur == NULL)
|
||||
return AVIERR_MEMORY;
|
||||
memcpy(This->lpbiCur, This->lpbiOutput, This->cbOutput);
|
||||
This->lpCur = DIBPTR(This->lpbiCur);
|
||||
|
||||
/* allocate memory for last frame if needed */
|
||||
if (This->lKeyFrameEvery != 1 &&
|
||||
(This->dwICMFlags & VIDCF_FASTTEMPORALC) == 0) {
|
||||
size = ICDecompressGetFormatSize(This->hic, This->lpbiOutput);
|
||||
This->lpbiPrev = (LPBITMAPINFOHEADER)GlobalAllocPtr(GHND, size);
|
||||
if (This->lpbiPrev == NULL)
|
||||
return AVIERR_MEMORY;
|
||||
if (ICDecompressGetFormat(This->hic, This->lpbiOutput, This->lpbiPrev) < S_OK)
|
||||
return AVIERR_COMPRESSOR;
|
||||
|
||||
if (This->lpbiPrev->biSizeImage == 0) {
|
||||
This->lpbiPrev->biSizeImage =
|
||||
DIBWIDTHBYTES(*This->lpbiPrev) * This->lpbiPrev->biHeight;
|
||||
}
|
||||
|
||||
/* get memory for format and picture */
|
||||
size += This->lpbiPrev->biSizeImage;
|
||||
This->lpbiPrev =
|
||||
(LPBITMAPINFOHEADER)GlobalReAllocPtr(This->lpbiPrev,size,GMEM_MOVEABLE);
|
||||
if (This->lpbiPrev == NULL)
|
||||
return AVIERR_MEMORY;
|
||||
This->lpPrev = DIBPTR(This->lpbiPrev);
|
||||
|
||||
/* prepare codec also for decompression */
|
||||
if (ICDecompressBegin(This->hic,This->lpbiOutput,This->lpbiPrev) != S_OK)
|
||||
return AVIERR_COMPRESSOR;
|
||||
}
|
||||
|
||||
return AVIERR_OK;
|
||||
}
|
||||
@@ -0,0 +1,580 @@
|
||||
/*
|
||||
* self-registerable dll functions for avifile.dll and avifil32.dll
|
||||
*
|
||||
* Copyright (C) 2003 John K. Hohm
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#define COM_NO_WINDOWS_H
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "winreg.h"
|
||||
#include "winerror.h"
|
||||
|
||||
#include "mmsystem.h"
|
||||
#include "vfw.h"
|
||||
#include "avifile_private.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(avifile);
|
||||
|
||||
/*
|
||||
* Near the bottom of this file are the exported DllRegisterServer and
|
||||
* DllUnregisterServer, which make all this worthwhile.
|
||||
*/
|
||||
|
||||
/***********************************************************************
|
||||
* interface for self-registering
|
||||
*/
|
||||
struct regsvr_interface
|
||||
{
|
||||
IID const *iid; /* NULL for end of list */
|
||||
LPCSTR name; /* can be NULL to omit */
|
||||
IID const *base_iid; /* can be NULL to omit */
|
||||
int num_methods; /* can be <0 to omit */
|
||||
CLSID const *ps_clsid; /* can be NULL to omit */
|
||||
CLSID const *ps_clsid32; /* can be NULL to omit */
|
||||
};
|
||||
|
||||
static HRESULT register_interfaces(struct regsvr_interface const *list);
|
||||
static HRESULT unregister_interfaces(struct regsvr_interface const *list);
|
||||
|
||||
struct regsvr_coclass
|
||||
{
|
||||
CLSID const *clsid; /* NULL for end of list */
|
||||
LPCSTR name; /* can be NULL to omit */
|
||||
LPCSTR ips; /* can be NULL to omit */
|
||||
LPCSTR ips32; /* can be NULL to omit */
|
||||
LPCSTR ips32_tmodel; /* can be NULL to omit */
|
||||
LPCSTR progid; /* can be NULL to omit */
|
||||
LPCSTR viprogid; /* can be NULL to omit */
|
||||
LPCSTR progid_extra; /* can be NULL to omit */
|
||||
};
|
||||
|
||||
static HRESULT register_coclasses(struct regsvr_coclass const *list);
|
||||
static HRESULT unregister_coclasses(struct regsvr_coclass const *list);
|
||||
|
||||
/***********************************************************************
|
||||
* static string constants
|
||||
*/
|
||||
static WCHAR const interface_keyname[10] = {
|
||||
'I', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'e', 0 };
|
||||
static WCHAR const base_ifa_keyname[14] = {
|
||||
'B', 'a', 's', 'e', 'I', 'n', 't', 'e', 'r', 'f', 'a', 'c',
|
||||
'e', 0 };
|
||||
static WCHAR const num_methods_keyname[11] = {
|
||||
'N', 'u', 'm', 'M', 'e', 't', 'h', 'o', 'd', 's', 0 };
|
||||
static WCHAR const ps_clsid_keyname[15] = {
|
||||
'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's',
|
||||
'i', 'd', 0 };
|
||||
static WCHAR const ps_clsid32_keyname[17] = {
|
||||
'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's',
|
||||
'i', 'd', '3', '2', 0 };
|
||||
static WCHAR const clsid_keyname[6] = {
|
||||
'C', 'L', 'S', 'I', 'D', 0 };
|
||||
static WCHAR const curver_keyname[7] = {
|
||||
'C', 'u', 'r', 'V', 'e', 'r', 0 };
|
||||
static WCHAR const ips_keyname[13] = {
|
||||
'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
|
||||
0 };
|
||||
static WCHAR const ips32_keyname[15] = {
|
||||
'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r',
|
||||
'3', '2', 0 };
|
||||
static WCHAR const progid_keyname[7] = {
|
||||
'P', 'r', 'o', 'g', 'I', 'D', 0 };
|
||||
static WCHAR const viprogid_keyname[25] = {
|
||||
'V', 'e', 'r', 's', 'i', 'o', 'n', 'I', 'n', 'd', 'e', 'p',
|
||||
'e', 'n', 'd', 'e', 'n', 't', 'P', 'r', 'o', 'g', 'I', 'D',
|
||||
0 };
|
||||
static char const tmodel_valuename[] = "ThreadingModel";
|
||||
|
||||
/***********************************************************************
|
||||
* static helper functions
|
||||
*/
|
||||
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid);
|
||||
static LONG register_key_defvalueW(HKEY base, WCHAR const *name,
|
||||
WCHAR const *value);
|
||||
static LONG register_key_defvalueA(HKEY base, WCHAR const *name,
|
||||
char const *value);
|
||||
static LONG register_progid(WCHAR const *clsid,
|
||||
char const *progid, char const *curver_progid,
|
||||
char const *name, char const *extra);
|
||||
static LONG recursive_delete_key(HKEY key);
|
||||
static LONG recursive_delete_keyA(HKEY base, char const *name);
|
||||
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name);
|
||||
|
||||
/***********************************************************************
|
||||
* register_interfaces
|
||||
*/
|
||||
static HRESULT register_interfaces(struct regsvr_interface const *list)
|
||||
{
|
||||
LONG res = ERROR_SUCCESS;
|
||||
HKEY interface_key;
|
||||
|
||||
res = RegCreateKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0, NULL, 0,
|
||||
KEY_READ | KEY_WRITE, NULL, &interface_key, NULL);
|
||||
if (res != ERROR_SUCCESS) goto error_return;
|
||||
|
||||
for (; res == ERROR_SUCCESS && list->iid; ++list) {
|
||||
WCHAR buf[39];
|
||||
HKEY iid_key;
|
||||
|
||||
StringFromGUID2(list->iid, buf, 39);
|
||||
res = RegCreateKeyExW(interface_key, buf, 0, NULL, 0,
|
||||
KEY_READ | KEY_WRITE, NULL, &iid_key, NULL);
|
||||
if (res != ERROR_SUCCESS) goto error_close_interface_key;
|
||||
|
||||
if (list->name) {
|
||||
res = RegSetValueExA(iid_key, NULL, 0, REG_SZ,
|
||||
(CONST BYTE*)(list->name),
|
||||
strlen(list->name) + 1);
|
||||
if (res != ERROR_SUCCESS) goto error_close_iid_key;
|
||||
}
|
||||
|
||||
if (list->base_iid) {
|
||||
register_key_guid(iid_key, base_ifa_keyname, list->base_iid);
|
||||
if (res != ERROR_SUCCESS) goto error_close_iid_key;
|
||||
}
|
||||
|
||||
if (0 <= list->num_methods) {
|
||||
static WCHAR const fmt[3] = { '%', 'd', 0 };
|
||||
HKEY key;
|
||||
|
||||
res = RegCreateKeyExW(iid_key, num_methods_keyname, 0, NULL, 0,
|
||||
KEY_READ | KEY_WRITE, NULL, &key, NULL);
|
||||
if (res != ERROR_SUCCESS) goto error_close_iid_key;
|
||||
|
||||
wsprintfW(buf, fmt, list->num_methods);
|
||||
res = RegSetValueExW(key, NULL, 0, REG_SZ,
|
||||
(CONST BYTE*)buf,
|
||||
(lstrlenW(buf) + 1) * sizeof(WCHAR));
|
||||
RegCloseKey(key);
|
||||
|
||||
if (res != ERROR_SUCCESS) goto error_close_iid_key;
|
||||
}
|
||||
|
||||
if (list->ps_clsid) {
|
||||
register_key_guid(iid_key, ps_clsid_keyname, list->ps_clsid);
|
||||
if (res != ERROR_SUCCESS) goto error_close_iid_key;
|
||||
}
|
||||
|
||||
if (list->ps_clsid32) {
|
||||
register_key_guid(iid_key, ps_clsid32_keyname, list->ps_clsid32);
|
||||
if (res != ERROR_SUCCESS) goto error_close_iid_key;
|
||||
}
|
||||
|
||||
error_close_iid_key:
|
||||
RegCloseKey(iid_key);
|
||||
}
|
||||
|
||||
error_close_interface_key:
|
||||
RegCloseKey(interface_key);
|
||||
error_return:
|
||||
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* unregister_interfaces
|
||||
*/
|
||||
static HRESULT unregister_interfaces(struct regsvr_interface const *list)
|
||||
{
|
||||
LONG res = ERROR_SUCCESS;
|
||||
HKEY interface_key;
|
||||
|
||||
res = RegOpenKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0,
|
||||
KEY_READ | KEY_WRITE, &interface_key);
|
||||
if (res == ERROR_FILE_NOT_FOUND) return S_OK;
|
||||
if (res != ERROR_SUCCESS) goto error_return;
|
||||
|
||||
for (; res == ERROR_SUCCESS && list->iid; ++list) {
|
||||
WCHAR buf[39];
|
||||
|
||||
StringFromGUID2(list->iid, buf, 39);
|
||||
res = recursive_delete_keyW(interface_key, buf);
|
||||
}
|
||||
|
||||
RegCloseKey(interface_key);
|
||||
error_return:
|
||||
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* register_coclasses
|
||||
*/
|
||||
static HRESULT register_coclasses(struct regsvr_coclass const *list)
|
||||
{
|
||||
LONG res = ERROR_SUCCESS;
|
||||
HKEY coclass_key;
|
||||
|
||||
res = RegCreateKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0, NULL, 0,
|
||||
KEY_READ | KEY_WRITE, NULL, &coclass_key, NULL);
|
||||
if (res != ERROR_SUCCESS) goto error_return;
|
||||
|
||||
for (; res == ERROR_SUCCESS && list->clsid; ++list) {
|
||||
WCHAR buf[39];
|
||||
HKEY clsid_key;
|
||||
|
||||
StringFromGUID2(list->clsid, buf, 39);
|
||||
res = RegCreateKeyExW(coclass_key, buf, 0, NULL, 0,
|
||||
KEY_READ | KEY_WRITE, NULL, &clsid_key, NULL);
|
||||
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
|
||||
|
||||
if (list->name) {
|
||||
res = RegSetValueExA(clsid_key, NULL, 0, REG_SZ,
|
||||
(CONST BYTE*)(list->name),
|
||||
strlen(list->name) + 1);
|
||||
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
|
||||
}
|
||||
|
||||
if (list->ips) {
|
||||
res = register_key_defvalueA(clsid_key, ips_keyname, list->ips);
|
||||
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
|
||||
}
|
||||
|
||||
if (list->ips32) {
|
||||
HKEY ips32_key;
|
||||
|
||||
res = RegCreateKeyExW(clsid_key, ips32_keyname, 0, NULL, 0,
|
||||
KEY_READ | KEY_WRITE, NULL,
|
||||
&ips32_key, NULL);
|
||||
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
|
||||
|
||||
res = RegSetValueExA(ips32_key, NULL, 0, REG_SZ,
|
||||
(CONST BYTE*)list->ips32,
|
||||
lstrlenA(list->ips32) + 1);
|
||||
if (res == ERROR_SUCCESS && list->ips32_tmodel)
|
||||
res = RegSetValueExA(ips32_key, tmodel_valuename, 0, REG_SZ,
|
||||
(CONST BYTE*)list->ips32_tmodel,
|
||||
strlen(list->ips32_tmodel) + 1);
|
||||
RegCloseKey(ips32_key);
|
||||
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
|
||||
}
|
||||
|
||||
if (list->progid) {
|
||||
res = register_key_defvalueA(clsid_key, progid_keyname,
|
||||
list->progid);
|
||||
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
|
||||
|
||||
res = register_progid(buf, list->progid, NULL,
|
||||
list->name, list->progid_extra);
|
||||
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
|
||||
}
|
||||
|
||||
if (list->viprogid) {
|
||||
res = register_key_defvalueA(clsid_key, viprogid_keyname,
|
||||
list->viprogid);
|
||||
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
|
||||
|
||||
res = register_progid(buf, list->viprogid, list->progid,
|
||||
list->name, list->progid_extra);
|
||||
if (res != ERROR_SUCCESS) goto error_close_clsid_key;
|
||||
}
|
||||
|
||||
error_close_clsid_key:
|
||||
RegCloseKey(clsid_key);
|
||||
}
|
||||
|
||||
error_close_coclass_key:
|
||||
RegCloseKey(coclass_key);
|
||||
error_return:
|
||||
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* unregister_coclasses
|
||||
*/
|
||||
static HRESULT unregister_coclasses(struct regsvr_coclass const *list)
|
||||
{
|
||||
LONG res = ERROR_SUCCESS;
|
||||
HKEY coclass_key;
|
||||
|
||||
res = RegOpenKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0,
|
||||
KEY_READ | KEY_WRITE, &coclass_key);
|
||||
if (res == ERROR_FILE_NOT_FOUND) return S_OK;
|
||||
if (res != ERROR_SUCCESS) goto error_return;
|
||||
|
||||
for (; res == ERROR_SUCCESS && list->clsid; ++list) {
|
||||
WCHAR buf[39];
|
||||
|
||||
StringFromGUID2(list->clsid, buf, 39);
|
||||
res = recursive_delete_keyW(coclass_key, buf);
|
||||
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
|
||||
|
||||
if (list->progid) {
|
||||
res = recursive_delete_keyA(HKEY_CLASSES_ROOT, list->progid);
|
||||
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
|
||||
}
|
||||
|
||||
if (list->viprogid) {
|
||||
res = recursive_delete_keyA(HKEY_CLASSES_ROOT, list->viprogid);
|
||||
if (res != ERROR_SUCCESS) goto error_close_coclass_key;
|
||||
}
|
||||
}
|
||||
|
||||
error_close_coclass_key:
|
||||
RegCloseKey(coclass_key);
|
||||
error_return:
|
||||
return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* regsvr_key_guid
|
||||
*/
|
||||
static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid)
|
||||
{
|
||||
WCHAR buf[39];
|
||||
|
||||
StringFromGUID2(guid, buf, 39);
|
||||
return register_key_defvalueW(base, name, buf);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* regsvr_key_defvalueW
|
||||
*/
|
||||
static LONG register_key_defvalueW(
|
||||
HKEY base,
|
||||
WCHAR const *name,
|
||||
WCHAR const *value)
|
||||
{
|
||||
LONG res;
|
||||
HKEY key;
|
||||
|
||||
res = RegCreateKeyExW(base, name, 0, NULL, 0,
|
||||
KEY_READ | KEY_WRITE, NULL, &key, NULL);
|
||||
if (res != ERROR_SUCCESS) return res;
|
||||
res = RegSetValueExW(key, NULL, 0, REG_SZ, (CONST BYTE*)value,
|
||||
(lstrlenW(value) + 1) * sizeof(WCHAR));
|
||||
RegCloseKey(key);
|
||||
return res;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* regsvr_key_defvalueA
|
||||
*/
|
||||
static LONG register_key_defvalueA(
|
||||
HKEY base,
|
||||
WCHAR const *name,
|
||||
char const *value)
|
||||
{
|
||||
LONG res;
|
||||
HKEY key;
|
||||
|
||||
res = RegCreateKeyExW(base, name, 0, NULL, 0,
|
||||
KEY_READ | KEY_WRITE, NULL, &key, NULL);
|
||||
if (res != ERROR_SUCCESS) return res;
|
||||
res = RegSetValueExA(key, NULL, 0, REG_SZ, (CONST BYTE*)value,
|
||||
lstrlenA(value) + 1);
|
||||
RegCloseKey(key);
|
||||
return res;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* regsvr_progid
|
||||
*/
|
||||
static LONG register_progid(
|
||||
WCHAR const *clsid,
|
||||
char const *progid,
|
||||
char const *curver_progid,
|
||||
char const *name,
|
||||
char const *extra)
|
||||
{
|
||||
LONG res;
|
||||
HKEY progid_key;
|
||||
|
||||
res = RegCreateKeyExA(HKEY_CLASSES_ROOT, progid, 0,
|
||||
NULL, 0, KEY_READ | KEY_WRITE, NULL,
|
||||
&progid_key, NULL);
|
||||
if (res != ERROR_SUCCESS) return res;
|
||||
|
||||
if (name) {
|
||||
res = RegSetValueExA(progid_key, NULL, 0, REG_SZ,
|
||||
(CONST BYTE*)name, strlen(name) + 1);
|
||||
if (res != ERROR_SUCCESS) goto error_close_progid_key;
|
||||
}
|
||||
|
||||
if (clsid) {
|
||||
res = register_key_defvalueW(progid_key, clsid_keyname, clsid);
|
||||
if (res != ERROR_SUCCESS) goto error_close_progid_key;
|
||||
}
|
||||
|
||||
if (curver_progid) {
|
||||
res = register_key_defvalueA(progid_key, curver_keyname,
|
||||
curver_progid);
|
||||
if (res != ERROR_SUCCESS) goto error_close_progid_key;
|
||||
}
|
||||
|
||||
if (extra) {
|
||||
HKEY extra_key;
|
||||
|
||||
res = RegCreateKeyExA(progid_key, extra, 0,
|
||||
NULL, 0, KEY_READ | KEY_WRITE, NULL,
|
||||
&extra_key, NULL);
|
||||
if (res == ERROR_SUCCESS)
|
||||
RegCloseKey(extra_key);
|
||||
}
|
||||
|
||||
error_close_progid_key:
|
||||
RegCloseKey(progid_key);
|
||||
return res;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* recursive_delete_key
|
||||
*/
|
||||
static LONG recursive_delete_key(HKEY key)
|
||||
{
|
||||
LONG res;
|
||||
WCHAR subkey_name[MAX_PATH];
|
||||
DWORD cName;
|
||||
HKEY subkey;
|
||||
|
||||
for (;;) {
|
||||
cName = sizeof(subkey_name) / sizeof(WCHAR);
|
||||
res = RegEnumKeyExW(key, 0, subkey_name, &cName,
|
||||
NULL, NULL, NULL, NULL);
|
||||
if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) {
|
||||
res = ERROR_SUCCESS; /* presumably we're done enumerating */
|
||||
break;
|
||||
}
|
||||
res = RegOpenKeyExW(key, subkey_name, 0,
|
||||
KEY_READ | KEY_WRITE, &subkey);
|
||||
if (res == ERROR_FILE_NOT_FOUND) continue;
|
||||
if (res != ERROR_SUCCESS) break;
|
||||
|
||||
res = recursive_delete_key(subkey);
|
||||
RegCloseKey(subkey);
|
||||
if (res != ERROR_SUCCESS) break;
|
||||
}
|
||||
|
||||
if (res == ERROR_SUCCESS) res = RegDeleteKeyW(key, 0);
|
||||
return res;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* recursive_delete_keyA
|
||||
*/
|
||||
static LONG recursive_delete_keyA(HKEY base, char const *name)
|
||||
{
|
||||
LONG res;
|
||||
HKEY key;
|
||||
|
||||
res = RegOpenKeyExA(base, name, 0, KEY_READ | KEY_WRITE, &key);
|
||||
if (res == ERROR_FILE_NOT_FOUND) return ERROR_SUCCESS;
|
||||
if (res != ERROR_SUCCESS) return res;
|
||||
res = recursive_delete_key(key);
|
||||
RegCloseKey(key);
|
||||
return res;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* recursive_delete_keyW
|
||||
*/
|
||||
static LONG recursive_delete_keyW(HKEY base, WCHAR const *name)
|
||||
{
|
||||
LONG res;
|
||||
HKEY key;
|
||||
|
||||
res = RegOpenKeyExW(base, name, 0, KEY_READ | KEY_WRITE, &key);
|
||||
if (res == ERROR_FILE_NOT_FOUND) return ERROR_SUCCESS;
|
||||
if (res != ERROR_SUCCESS) return res;
|
||||
res = recursive_delete_key(key);
|
||||
RegCloseKey(key);
|
||||
return res;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* coclass list
|
||||
*/
|
||||
static GUID const CLSID_AVIProxy = {
|
||||
0x0002000D, 0x0000, 0x0000, {0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46} };
|
||||
|
||||
static struct regsvr_coclass const coclass_list[] = {
|
||||
{ &CLSID_AVIFile,
|
||||
"Microsoft AVI Files",
|
||||
"avifile.dll",
|
||||
"avifil32.dll",
|
||||
"Apartment"
|
||||
},
|
||||
{ &CLSID_ICMStream,
|
||||
"AVI Compressed Stream",
|
||||
"avifile.dll",
|
||||
"avifil32.dll",
|
||||
"Apartment"
|
||||
},
|
||||
{ &CLSID_WAVFile,
|
||||
"Microsoft Wave File",
|
||||
"avifile.dll",
|
||||
"avifil32.dll",
|
||||
"Apartment"
|
||||
},
|
||||
{ &CLSID_AVIProxy,
|
||||
"IAVIStream & IAVIFile Proxy",
|
||||
"avifile.dll",
|
||||
"avifil32.dll",
|
||||
"Apartment"
|
||||
},
|
||||
{ &CLSID_ACMStream,
|
||||
"ACM Compressed Audio Stream",
|
||||
"avifile.dll",
|
||||
"avifil32.dll",
|
||||
"Apartment"
|
||||
},
|
||||
{ NULL } /* list terminator */
|
||||
};
|
||||
|
||||
/***********************************************************************
|
||||
* interface list
|
||||
*/
|
||||
|
||||
static struct regsvr_interface const interface_list[] = {
|
||||
{ NULL } /* list terminator */
|
||||
};
|
||||
|
||||
/***********************************************************************
|
||||
* DllRegisterServer (AVIFILE.@)
|
||||
*/
|
||||
HRESULT WINAPI DllRegisterServer(void)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("\n");
|
||||
|
||||
hr = register_coclasses(coclass_list);
|
||||
if (SUCCEEDED(hr))
|
||||
hr = register_interfaces(interface_list);
|
||||
return hr;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* DllUnregisterServer (AVIFILE.@)
|
||||
*/
|
||||
HRESULT WINAPI DllUnregisterServer(void)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("\n");
|
||||
|
||||
hr = unregister_coclasses(coclass_list);
|
||||
if (SUCCEEDED(hr))
|
||||
hr = unregister_interfaces(interface_list);
|
||||
return hr;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Top level resource file for avifil32.dll
|
||||
*
|
||||
* Copyright 2002 Michael Günnewig
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winuser.h"
|
||||
#include "winver.h"
|
||||
#include "avifile_private.h"
|
||||
|
||||
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||
|
||||
#define WINE_OLESELFREGISTER
|
||||
#define WINE_FILEDESCRIPTION_STR "Wine AVI file support library"
|
||||
#define WINE_FILENAME_STR "avifil32.dll"
|
||||
#define WINE_FILEVERSION 4,0,3,1998
|
||||
#define WINE_FILEVERSION_STR "4.03.1998"
|
||||
|
||||
#include "wine/wine_common_ver.rc"
|
||||
|
||||
/*
|
||||
* Everything specific to any language goes
|
||||
* in one of the specific files.
|
||||
*/
|
||||
#include "avifile_Cs.rc"
|
||||
#include "avifile_De.rc"
|
||||
#include "avifile_En.rc"
|
||||
#include "avifile_Es.rc"
|
||||
#include "avifile_Fr.rc"
|
||||
#include "avifile_It.rc"
|
||||
#include "avifile_Ja.rc"
|
||||
#include "avifile_Nl.rc"
|
||||
#include "avifile_No.rc"
|
||||
#include "avifile_Pl.rc"
|
||||
#include "avifile_Pt.rc"
|
||||
#include "avifile_Ru.rc"
|
||||
#include "avifile_Si.rc"
|
||||
@@ -0,0 +1,290 @@
|
||||
/*
|
||||
* Copyright 2003 Michael Günnewig
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#define COM_NO_WINDOWS_H
|
||||
#include <assert.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wingdi.h"
|
||||
#include "winuser.h"
|
||||
#include "winnls.h"
|
||||
#include "winerror.h"
|
||||
#include "windowsx.h"
|
||||
#include "mmsystem.h"
|
||||
#include "vfw.h"
|
||||
|
||||
#include "avifile_private.h"
|
||||
#include "extrachunk.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(avifile);
|
||||
|
||||
/***********************************************************************/
|
||||
|
||||
static HRESULT WINAPI ITmpFile_fnQueryInterface(IAVIFile* iface,REFIID refiid,LPVOID *obj);
|
||||
static ULONG WINAPI ITmpFile_fnAddRef(IAVIFile* iface);
|
||||
static ULONG WINAPI ITmpFile_fnRelease(IAVIFile* iface);
|
||||
static HRESULT WINAPI ITmpFile_fnInfo(IAVIFile*iface,AVIFILEINFOW*afi,LONG size);
|
||||
static HRESULT WINAPI ITmpFile_fnGetStream(IAVIFile*iface,PAVISTREAM*avis,DWORD fccType,LONG lParam);
|
||||
static HRESULT WINAPI ITmpFile_fnCreateStream(IAVIFile*iface,PAVISTREAM*avis,AVISTREAMINFOW*asi);
|
||||
static HRESULT WINAPI ITmpFile_fnWriteData(IAVIFile*iface,DWORD ckid,LPVOID lpData,LONG size);
|
||||
static HRESULT WINAPI ITmpFile_fnReadData(IAVIFile*iface,DWORD ckid,LPVOID lpData,LONG *size);
|
||||
static HRESULT WINAPI ITmpFile_fnEndRecord(IAVIFile*iface);
|
||||
static HRESULT WINAPI ITmpFile_fnDeleteStream(IAVIFile*iface,DWORD fccType,LONG lParam);
|
||||
|
||||
static const struct IAVIFileVtbl itmpft = {
|
||||
ITmpFile_fnQueryInterface,
|
||||
ITmpFile_fnAddRef,
|
||||
ITmpFile_fnRelease,
|
||||
ITmpFile_fnInfo,
|
||||
ITmpFile_fnGetStream,
|
||||
ITmpFile_fnCreateStream,
|
||||
ITmpFile_fnWriteData,
|
||||
ITmpFile_fnReadData,
|
||||
ITmpFile_fnEndRecord,
|
||||
ITmpFile_fnDeleteStream
|
||||
};
|
||||
|
||||
typedef struct _ITmpFileImpl {
|
||||
/* IUnknown stuff */
|
||||
const IAVIFileVtbl *lpVtbl;
|
||||
LONG ref;
|
||||
|
||||
/* IAVIFile stuff */
|
||||
AVIFILEINFOW fInfo;
|
||||
PAVISTREAM *ppStreams;
|
||||
} ITmpFileImpl;
|
||||
|
||||
PAVIFILE AVIFILE_CreateAVITempFile(int nStreams, PAVISTREAM *ppStreams) {
|
||||
ITmpFileImpl *tmpFile;
|
||||
int i;
|
||||
|
||||
tmpFile = LocalAlloc(LPTR, sizeof(ITmpFileImpl));
|
||||
if (tmpFile == NULL)
|
||||
return NULL;
|
||||
|
||||
tmpFile->lpVtbl = &itmpft;
|
||||
tmpFile->ref = 1;
|
||||
memset(&tmpFile->fInfo, 0, sizeof(tmpFile->fInfo));
|
||||
|
||||
tmpFile->fInfo.dwStreams = nStreams;
|
||||
tmpFile->ppStreams = LocalAlloc(LPTR, nStreams * sizeof(PAVISTREAM));
|
||||
if (tmpFile->ppStreams == NULL) {
|
||||
LocalFree((HLOCAL)tmpFile);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < nStreams; i++) {
|
||||
AVISTREAMINFOW sInfo;
|
||||
|
||||
tmpFile->ppStreams[i] = ppStreams[i];
|
||||
|
||||
AVIStreamAddRef(ppStreams[i]);
|
||||
AVIStreamInfoW(ppStreams[i], &sInfo, sizeof(sInfo));
|
||||
if (i == 0) {
|
||||
tmpFile->fInfo.dwScale = sInfo.dwScale;
|
||||
tmpFile->fInfo.dwRate = sInfo.dwRate;
|
||||
if (!sInfo.dwScale || !sInfo.dwRate) {
|
||||
tmpFile->fInfo.dwScale = 1;
|
||||
tmpFile->fInfo.dwRate = 100;
|
||||
}
|
||||
}
|
||||
|
||||
if (tmpFile->fInfo.dwSuggestedBufferSize < sInfo.dwSuggestedBufferSize)
|
||||
tmpFile->fInfo.dwSuggestedBufferSize = sInfo.dwSuggestedBufferSize;
|
||||
|
||||
{
|
||||
register DWORD tmp;
|
||||
|
||||
tmp = MulDiv(AVIStreamSampleToTime(ppStreams[i], sInfo.dwLength), \
|
||||
tmpFile->fInfo.dwScale, tmpFile->fInfo.dwRate * 1000);
|
||||
if (tmpFile->fInfo.dwLength < tmp)
|
||||
tmpFile->fInfo.dwLength = tmp;
|
||||
|
||||
tmp = sInfo.rcFrame.right - sInfo.rcFrame.left;
|
||||
if (tmpFile->fInfo.dwWidth < tmp)
|
||||
tmpFile->fInfo.dwWidth = tmp;
|
||||
tmp = sInfo.rcFrame.bottom - sInfo.rcFrame.top;
|
||||
if (tmpFile->fInfo.dwHeight < tmp)
|
||||
tmpFile->fInfo.dwHeight = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
return (PAVIFILE)tmpFile;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ITmpFile_fnQueryInterface(IAVIFile *iface, REFIID refiid,
|
||||
LPVOID *obj)
|
||||
{
|
||||
ITmpFileImpl *This = (ITmpFileImpl *)iface;
|
||||
|
||||
TRACE("(%p,%s,%p)\n", This, debugstr_guid(refiid), obj);
|
||||
|
||||
if (IsEqualGUID(&IID_IUnknown, refiid) ||
|
||||
IsEqualGUID(&IID_IAVIFile, refiid)) {
|
||||
*obj = iface;
|
||||
IAVIFile_AddRef(iface);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
return OLE_E_ENUM_NOMORE;
|
||||
}
|
||||
|
||||
static ULONG WINAPI ITmpFile_fnAddRef(IAVIFile *iface)
|
||||
{
|
||||
ITmpFileImpl *This = (ITmpFileImpl *)iface;
|
||||
ULONG ref = InterlockedIncrement(&This->ref);
|
||||
|
||||
TRACE("(%p) -> %ld\n", iface, ref);
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
static ULONG WINAPI ITmpFile_fnRelease(IAVIFile *iface)
|
||||
{
|
||||
ITmpFileImpl *This = (ITmpFileImpl *)iface;
|
||||
ULONG ref = InterlockedDecrement(&This->ref);
|
||||
|
||||
TRACE("(%p) -> %ld\n", iface, ref);
|
||||
|
||||
if (!ref) {
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < This->fInfo.dwStreams; i++) {
|
||||
if (This->ppStreams[i] != NULL) {
|
||||
AVIStreamRelease(This->ppStreams[i]);
|
||||
|
||||
This->ppStreams[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
LocalFree((HLOCAL)This);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ITmpFile_fnInfo(IAVIFile *iface,
|
||||
AVIFILEINFOW *afi, LONG size)
|
||||
{
|
||||
ITmpFileImpl *This = (ITmpFileImpl *)iface;
|
||||
|
||||
TRACE("(%p,%p,%ld)\n",iface,afi,size);
|
||||
|
||||
if (afi == NULL)
|
||||
return AVIERR_BADPARAM;
|
||||
if (size < 0)
|
||||
return AVIERR_BADSIZE;
|
||||
|
||||
memcpy(afi, &This->fInfo, min((DWORD)size, sizeof(This->fInfo)));
|
||||
|
||||
if ((DWORD)size < sizeof(This->fInfo))
|
||||
return AVIERR_BUFFERTOOSMALL;
|
||||
return AVIERR_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ITmpFile_fnGetStream(IAVIFile *iface, PAVISTREAM *avis,
|
||||
DWORD fccType, LONG lParam)
|
||||
{
|
||||
ITmpFileImpl *This = (ITmpFileImpl *)iface;
|
||||
|
||||
ULONG nStream = (ULONG)-1;
|
||||
|
||||
TRACE("(%p,%p,0x%08lX,%ld)\n", iface, avis, fccType, lParam);
|
||||
|
||||
if (avis == NULL || lParam < 0)
|
||||
return AVIERR_BADPARAM;
|
||||
|
||||
if (fccType != streamtypeANY) {
|
||||
/* search the number of the specified stream */
|
||||
ULONG i;
|
||||
|
||||
for (i = 0; i < This->fInfo.dwStreams; i++) {
|
||||
AVISTREAMINFOW sInfo;
|
||||
HRESULT hr;
|
||||
|
||||
hr = AVIStreamInfoW(This->ppStreams[i], &sInfo, sizeof(sInfo));
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
|
||||
if (sInfo.fccType == fccType) {
|
||||
if (lParam == 0) {
|
||||
nStream = i;
|
||||
break;
|
||||
} else
|
||||
lParam--;
|
||||
}
|
||||
}
|
||||
} else
|
||||
nStream = lParam;
|
||||
|
||||
/* Does the requested stream exist ? */
|
||||
if (nStream < This->fInfo.dwStreams && This->ppStreams[nStream] != NULL) {
|
||||
*avis = This->ppStreams[nStream];
|
||||
AVIStreamAddRef(*avis);
|
||||
|
||||
return AVIERR_OK;
|
||||
}
|
||||
|
||||
/* Sorry, but the specified stream doesn't exist */
|
||||
return AVIERR_NODATA;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ITmpFile_fnCreateStream(IAVIFile *iface,PAVISTREAM *avis,
|
||||
AVISTREAMINFOW *asi)
|
||||
{
|
||||
TRACE("(%p,%p,%p)\n",iface,avis,asi);
|
||||
|
||||
return AVIERR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ITmpFile_fnWriteData(IAVIFile *iface, DWORD ckid,
|
||||
LPVOID lpData, LONG size)
|
||||
{
|
||||
TRACE("(%p,0x%08lX,%p,%ld)\n", iface, ckid, lpData, size);
|
||||
|
||||
return AVIERR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ITmpFile_fnReadData(IAVIFile *iface, DWORD ckid,
|
||||
LPVOID lpData, LONG *size)
|
||||
{
|
||||
TRACE("(%p,0x%08lX,%p,%p)\n", iface, ckid, lpData, size);
|
||||
|
||||
return AVIERR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ITmpFile_fnEndRecord(IAVIFile *iface)
|
||||
{
|
||||
TRACE("(%p)\n",iface);
|
||||
|
||||
return AVIERR_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ITmpFile_fnDeleteStream(IAVIFile *iface, DWORD fccType,
|
||||
LONG lParam)
|
||||
{
|
||||
TRACE("(%p,0x%08lX,%ld)\n", iface, fccType, lParam);
|
||||
|
||||
return AVIERR_UNSUPPORTED;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -17,6 +17,9 @@
|
||||
<directory name="authz">
|
||||
<xi:include href="authz/authz.xml" />
|
||||
</directory>
|
||||
<directory name="avifil32">
|
||||
<xi:include href="avifil32/avifil32.xml" />
|
||||
</directory>
|
||||
<directory name="cabinet">
|
||||
<xi:include href="cabinet/cabinet.xml" />
|
||||
</directory>
|
||||
|
||||
+110
-21
@@ -13,6 +13,9 @@
|
||||
#if !defined (_OLE2_H) && !defined (__OBJC__)
|
||||
#include <ole2.h>
|
||||
#endif
|
||||
#if !defined NOMMREG
|
||||
#include <mmreg.h>
|
||||
#endif
|
||||
|
||||
#define VFWAPI WINAPI
|
||||
#define VFWAPIV WINAPIV
|
||||
@@ -23,6 +26,11 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct IAVIStream *PAVISTREAM;
|
||||
typedef struct IAVIFile *PAVIFILE;
|
||||
typedef struct IGetFrame *PGETFRAME;
|
||||
typedef struct IAVIEditStream *PAVIEDITSTREAM;
|
||||
|
||||
#define ICERR_OK 0
|
||||
#define ICERR_DONTDRAW 1
|
||||
#define ICERR_NEWPALETTE 2
|
||||
@@ -640,8 +648,39 @@ DEFINE_AVIGUID(IID_IAVIStream,0x00020021,0,0);
|
||||
DEFINE_AVIGUID(IID_IAVIStreaming,0x00020022,0,0);
|
||||
DEFINE_AVIGUID(IID_IGetFrame,0x00020023,0,0);
|
||||
DEFINE_AVIGUID(IID_IAVIEditStream,0x00020024,0,0);
|
||||
DEFINE_AVIGUID(CLSID_AVISimpleUnMarshal,0x00020009, 0, 0);
|
||||
DEFINE_AVIGUID(CLSID_AVIFile,0x00020000,0,0);
|
||||
|
||||
/*****************************************************************************
|
||||
* IGetFrame interface
|
||||
*/
|
||||
#define INTERFACE IGetFrame
|
||||
DECLARE_INTERFACE_(IGetFrame,IUnknown)
|
||||
{
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
|
||||
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release)(THIS) PURE;
|
||||
/*** IGetFrame methods ***/
|
||||
STDMETHOD_(LPVOID,GetFrame)(THIS_ LONG lPos) PURE;
|
||||
STDMETHOD(Begin)(THIS_ LONG lStart, LONG lEnd, LONG lRate) PURE;
|
||||
STDMETHOD(End)(THIS) PURE;
|
||||
STDMETHOD(SetFormat)(THIS_ LPBITMAPINFOHEADER lpbi, LPVOID lpBits, INT x, INT y, INT dx, INT dy) PURE;
|
||||
};
|
||||
#undef INTERFACE
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
/*** IUnknown methods ***/
|
||||
#define IGetFrame_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IGetFrame_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IGetFrame_Release(p) (p)->lpVtbl->Release(p)
|
||||
/*** IGetFrame methods ***/
|
||||
#define IGetFrame_GetFrame(p,a) (p)->lpVtbl->GetFrame(p,a)
|
||||
#define IGetFrame_Begin(p,a,b,c) (p)->lpVtbl->Begin(p,a,b,c)
|
||||
#define IGetFrame_End(p) (p)->lpVtbl->End(p)
|
||||
#define IGetFrame_SetFormat(p,a,b,c,d,e,f) (p)->lpVtbl->SetFormat(p,a,b,c,d,e,f)
|
||||
#endif
|
||||
|
||||
#define INTERFACE IAVIStream
|
||||
DECLARE_INTERFACE_(IAVIStream, IUnknown)
|
||||
{
|
||||
@@ -662,17 +701,31 @@ DECLARE_INTERFACE_(IAVIStream, IUnknown)
|
||||
};
|
||||
typedef IAVIStream *PAVISTREAM;
|
||||
|
||||
/*****************************************************************************
|
||||
* IAVIStreaming interface
|
||||
*/
|
||||
#define INTERFACE IAVIStreaming
|
||||
DECLARE_INTERFACE_(IAVIStreaming, IUnknown)
|
||||
DECLARE_INTERFACE_(IAVIStreaming,IUnknown)
|
||||
{
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
|
||||
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release)(THIS) PURE;
|
||||
STDMETHOD(Begin)(THIS_ LONG,LONG,LONG) PURE;
|
||||
STDMETHOD(End)(THIS) PURE;
|
||||
/*** IUnknown methods ***/
|
||||
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
|
||||
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release)(THIS) PURE;
|
||||
/*** IAVIStreaming methods ***/
|
||||
STDMETHOD(Begin)(IAVIStreaming*iface,LONG lStart,LONG lEnd,LONG lRate) PURE;
|
||||
STDMETHOD(End)(IAVIStreaming*iface) PURE;
|
||||
};
|
||||
#undef INTERFACE
|
||||
typedef IAVIStreaming *PAVISTREAMING;
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
/*** IUnknown methods ***/
|
||||
#define IAVIStreaming_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IAVIStreaming_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IAVIStreaming_Release(p) (p)->lpVtbl->Release(p)
|
||||
/*** IAVIStreaming methods ***/
|
||||
#define IAVIStreaming_Begin(p,a,b,c) (p)->lpVtbl->Begin(p,a,b,c)
|
||||
#define IAVIStreaming_End(p) (p)->lpVtbl->End(p)
|
||||
#endif
|
||||
|
||||
#define INTERFACE IAVIEditStream
|
||||
DECLARE_INTERFACE_(IAVIEditStream, IUnknown)
|
||||
@@ -705,19 +758,55 @@ DECLARE_INTERFACE_(IAVIFile, IUnknown)
|
||||
#undef INTERFACE
|
||||
typedef IAVIFile *PAVIFILE;
|
||||
|
||||
#define INTERFACE IGetFrame
|
||||
DECLARE_INTERFACE_(IGetFrame, IUnknown)
|
||||
{
|
||||
STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
|
||||
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
|
||||
STDMETHOD_(ULONG,Release)(THIS) PURE;
|
||||
STDMETHOD_(LPVOID,GetFrame)(THIS_ LONG) PURE;
|
||||
STDMETHOD(Begin)(THIS_ LONG,LONG,LONG) PURE;
|
||||
STDMETHOD(End)(THIS) PURE;
|
||||
STDMETHOD(SetFormat)(THIS_ LPBITMAPINFOHEADER,LPVOID,INT,INT,INT,INT) PURE;
|
||||
};
|
||||
#undef INTERFACE
|
||||
typedef IGetFrame *PGETFRAME;
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
/*** IUnknown methods ***/
|
||||
#define IAVIFile_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IAVIFile_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IAVIFile_Release(p) (p)->lpVtbl->Release(p)
|
||||
/*** IAVIFile methods ***/
|
||||
#define IAVIFile_Info(p,a,b) (p)->lpVtbl->Info(p,a,b)
|
||||
#define IAVIFile_GetStream(p,a,b,c) (p)->lpVtbl->GetStream(p,a,b,c)
|
||||
#define IAVIFile_CreateStream(p,a,b) (p)->lpVtbl->CreateStream(p,a,b)
|
||||
#define IAVIFile_WriteData(p,a,b,c) (p)->lpVtbl->WriteData(p,a,b,c)
|
||||
#define IAVIFile_ReadData(p,a,b,c) (p)->lpVtbl->ReadData(p,a,b,c)
|
||||
#define IAVIFile_EndRecord(p) (p)->lpVtbl->EndRecord(p)
|
||||
#define IAVIFile_DeleteStream(p,a,b) (p)->lpVtbl->DeleteStream(p,a,b)
|
||||
#endif
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
/*** IUnknown methods ***/
|
||||
#define IAVIEditStream_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IAVIEditStream_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IAVIEditStream_Release(p) (p)->lpVtbl->Release(p)
|
||||
/*** IAVIEditStream methods ***/
|
||||
#define IAVIEditStream_Cut(p,a,b,c) (p)->lpVtbl->Cut(p,a,b,c)
|
||||
#define IAVIEditStream_Copy(p,a,b,c) (p)->lpVtbl->Copy(p,a,b,c)
|
||||
#define IAVIEditStream_Paste(p,a,b,c,d,e) (p)->lpVtbl->Paste(p,a,b,c,d,e)
|
||||
#define IAVIEditStream_Clone(p,a) (p)->lpVtbl->Clone(p,a)
|
||||
#define IAVIEditStream_SetInfo(p,a,b) (p)->lpVtbl->SetInfo(p,a,b)
|
||||
#endif
|
||||
|
||||
#if !defined(__cplusplus) || defined(CINTERFACE)
|
||||
/*** IUnknown methods ***/
|
||||
#define IAVIStream_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
||||
#define IAVIStream_AddRef(p) (p)->lpVtbl->AddRef(p)
|
||||
#define IAVIStream_Release(p) (p)->lpVtbl->Release(p)
|
||||
/*** IAVIStream methods ***/
|
||||
#define IAVIStream_Create(p,a,b) (p)->lpVtbl->Create(p,a,b)
|
||||
#define IAVIStream_Info(p,a,b) (p)->lpVtbl->Info(p,a,b)
|
||||
#define IAVIStream_FindSample(p,a,b) (p)->lpVtbl->FindSample(p,a,b)
|
||||
#define IAVIStream_ReadFormat(p,a,b,c) (p)->lpVtbl->ReadFormat(p,a,b,c)
|
||||
#define IAVIStream_SetFormat(p,a,b,c) (p)->lpVtbl->SetFormat(p,a,b,c)
|
||||
#define IAVIStream_Read(p,a,b,c,d,e,f) (p)->lpVtbl->Read(p,a,b,c,d,e,f)
|
||||
#define IAVIStream_Write(p,a,b,c,d,e,f,g) (p)->lpVtbl->Write(p,a,b,c,d,e,f,g)
|
||||
#define IAVIStream_Delete(p,a,b) (p)->lpVtbl->Delete(p,a,b)
|
||||
#define IAVIStream_ReadData(p,a,b,c) (p)->lpVtbl->ReadData(p,a,b,c)
|
||||
#define IAVIStream_WriteData(p,a,b,c) (p)->lpVtbl->WriteData(p,a,b,c)
|
||||
#define IAVIStream_SetInfo(p,a,b) (p)->lpVtbl->SetInfo(p,a,b)
|
||||
#endif
|
||||
|
||||
#define AVISTREAMREAD_CONVENIENT (-1L)
|
||||
|
||||
#endif /* !defined (__OBJC__) */
|
||||
|
||||
DWORD VFWAPI VideoForWindowsVersion(VOID);
|
||||
@@ -757,7 +846,7 @@ HRESULT WINAPI AVIStreamRead(PAVISTREAM,LONG,LONG,LPVOID,LONG,LONG*,LONG*);
|
||||
HRESULT WINAPI AVIStreamWrite(PAVISTREAM,LONG,LONG,LPVOID,LONG,DWORD,LONG*,LONG*);
|
||||
HRESULT WINAPI AVIStreamReadData(PAVISTREAM,DWORD,LPVOID,LONG*);
|
||||
HRESULT WINAPI AVIStreamWriteData(PAVISTREAM,DWORD,LPVOID,LONG);
|
||||
PGETFRAME WINAPI AVIStreamGetFrameOpen(PAVISTREAM,LPBITMAPINFOHEADER);
|
||||
PGETFRAME WINAPI AVIStreamGetFrameOpen(PAVISTREAM pavi,LPBITMAPINFOHEADER lpbiWanted);
|
||||
LPVOID WINAPI AVIStreamGetFrame(PGETFRAME,LONG);
|
||||
HRESULT WINAPI AVIStreamGetFrameClose(PGETFRAME);
|
||||
HRESULT WINAPI AVIMakeCompressedStream(PAVISTREAM*,PAVISTREAM,AVICOMPRESSOPTIONS*,CLSID*);
|
||||
|
||||
Reference in New Issue
Block a user