Initial community commit

This commit is contained in:
Jef 2024-09-24 14:54:57 +02:00
parent 537bcbc862
commit fc06254474
16440 changed files with 4239995 additions and 2 deletions

View file

@ -0,0 +1,86 @@
/****************************************************************************
Entry for "C" calls
****************************************************************************/
#ifndef WCOMPC_H
#define WCOMPC_H
#ifndef YUVINPUTBUFFERCONFIG
#define YUVINPUTBUFFERCONFIG
typedef struct
{
int YWidth;
int YHeight;
int YStride;
int UVWidth;
int UVHeight;
int UVStride;
char * YBuffer;
char * UBuffer;
char * VBuffer;
} YUV_INPUT_BUFFER_CONFIG;
#endif
#ifdef __cplusplus
extern "C"
{
#endif
void NewWC(void **wc);
void DeleteWC(void **wc);
int BeginCompressWC(
void *wc,
int ScreenWidth,
int ScreenHeight,
int Width,
int Height,
int XOffset,
int YOffset);
int CompressYUVWC(void *wc,
YUV_INPUT_BUFFER_CONFIG *YuvInputData,
unsigned char *OutputBufferPtr,
unsigned char *ReconBufferPtr,
int TargetSize);
int CompressWC(void *wc,
unsigned char *InputData,
unsigned char *OutputBufferPtr,
unsigned char *ReconBufferPtr,
int TargetSize);
int AnalyzeWC(void *wc,
unsigned char *InputData);
void EndCompressWC(void *wc);
int BeginDecompressWC(void *wc,
int ScreenWidth,
int ScreenHeight,
int Width,
int Height,
int XOffset,
int YOffset);
int DecompressWC(void *wc,
unsigned char *InputBufferPtr,
unsigned char *OutputBufferPtr);
void EndDecompressWC(void *wc);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,47 @@
//==========================================================================
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
// Copyright (c) 1999 - 2001 On2 Technologies Inc. All Rights Reserved.
//
//--------------------------------------------------------------------------
#ifndef ASMCOLORCONVERSIONS_H
#define ASMCOLORCONVERSIONS_H
void CC_RGB32toYV12_MMX( unsigned char *RGBABuffer, int ImageWidth, int ImageHeight,
unsigned char *YBuffer, unsigned char *UBuffer, unsigned char *VBuffer, int SrcPitch,int DstPitch );
void CC_RGB32toYV12_XMM( unsigned char *RGBABuffer, int ImageWidth, int ImageHeight,
unsigned char *YBuffer, unsigned char *UBuffer, unsigned char *VBuffer, int SrcPitch,int DstPitch );
void CC_RGB24toYV12_MMX( unsigned char *RGBBuffer, int ImageWidth, int ImageHeight,
unsigned char *YBuffer, unsigned char *UBuffer, unsigned char *VBuffer, int SrcPitch,int DstPitch );
void CC_RGB24toYV12_XMM( unsigned char *RGBBuffer, int ImageWidth, int ImageHeight,
unsigned char *YBuffer, unsigned char *UBuffer, unsigned char *VBuffer, int SrcPitch,int DstPitch );
void CC_UYVYtoYV12_MMX( unsigned char *UYVYBuffer, int ImageWidth, int ImageHeight,
unsigned char *YBuffer, unsigned char *UBuffer, unsigned char *VBuffer, int SrcPitch, int DstPitch );
void CC_UYVYtoYV12_XMM( unsigned char *UYVYBuffer, int ImageWidth, int ImageHeight,
unsigned char *YBuffer, unsigned char *UBuffer, unsigned char *VBuffer, int SrcPitch, int DstPitch );
void CC_YUY2toYV12_MMX( unsigned char *YUY2Buffer, int ImageWidth, int ImageHeight,
unsigned char *YBuffer, unsigned char *UBuffer, unsigned char *VBuffer, int SrcPitch, int DstPitch );
void CC_YUY2toYV12_XMM( unsigned char *YUY2Buffer, int ImageWidth, int ImageHeight,
unsigned char *YBuffer, unsigned char *UBuffer, unsigned char *VBuffer, int SrcPitch, int DstPitch );
void CC_YVYUtoYV12_MMX( unsigned char *YVYUBuffer, int ImageWidth, int ImageHeight,
unsigned char *YBuffer, unsigned char *UBuffer, unsigned char *VBuffer, int SrcPitch,int DstPitch );
void CC_YVYUtoYV12_XMM( unsigned char *YVYUBuffer, int ImageWidth, int ImageHeight,
unsigned char *YBuffer, unsigned char *UBuffer, unsigned char *VBuffer, int SrcPitch,int DstPitch );
#endif /* ASMCOLORCONVERSIONS_H */

View file

@ -0,0 +1,21 @@
#ifndef _bigend_h
#define _bigend_h
#if defined(__cplusplus)
extern "C" {
#endif
#define invert2(x) ( (((x)>>8)&0x00ff) | (((x)<<8)&0xff00) )
#define invert4(x) ( ((invert2(x)&0x0000ffff)<<16) | (invert2((x>>16))&0x0000ffff) )
#define highByte(x) (unsigned char)x
#define mid2Byte(x) (unsigned char)(x >> 8)
#define mid1Byte(x) (unsigned char)(x >> 16)
#define lowByte(x) (unsigned char)(x >> 24)
#define SWAPENDS 1
#if defined(__cplusplus)
}
#endif
#endif

View file

@ -0,0 +1,20 @@
//==========================================================================
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
// Copyright (c) 1999 - 2001 On2 Technologies Inc. All Rights Reserved.
//
//--------------------------------------------------------------------------
#ifndef _CIDASM_H
#define _CIDASM_H
extern PROCTYPE getCPUType(void);
extern void InitXMMReg( void );
extern void TrashXMMReg( void *Junk );
extern int VerifyXMMReg( void );
#endif /* _CIDASM_H */

View file

@ -0,0 +1,37 @@
//==========================================================================
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
// Copyright (c) 1999 - 2001 On2 Technologies Inc. All Rights Reserved.
//
//--------------------------------------------------------------------------
#ifndef COLORCONVERSIONS_H
#define COLORCONVERSIONS_H
#define ScaleFactor 0x8000
#define ShiftFactor 15
#define PixelsPerBlock 4
#define PixelsPerBlockShift 2
void CC_RGB32toYV12_C( unsigned char *RGBABuffer, int ImageWidth, int ImageHeight,
unsigned char *YBuffer, unsigned char *UBuffer, unsigned char *VBuffer, int SrcPitch,int DstPitch );
void CC_RGB24toYV12_C( unsigned char *RGBBuffer, int ImageWidth, int ImageHeight,
unsigned char *YBuffer, unsigned char *UBuffer, unsigned char *VBuffer, int SrcPitch,int DstPitch );
void CC_UYVYtoYV12_C( unsigned char *UYVYBuffer, int ImageWidth, int ImageHeight,
unsigned char *YBuffer, unsigned char *UBuffer, unsigned char *VBuffer, int SrcPitch, int DstPitch );
void CC_YUY2toYV12_C( unsigned char *YUY2Buffer, int ImageWidth, int ImageHeight,
unsigned char *YBuffer, unsigned char *UBuffer, unsigned char *VBuffer, int SrcPitch, int DstPitch );
void CC_YVYUtoYV12_C( unsigned char *YVYUBuffer, int ImageWidth, int ImageHeight,
unsigned char *YBuffer, unsigned char *UBuffer, unsigned char *VBuffer, int SrcPitch,int DstPitch );
#endif /* COLORCONVERSIONS_H */

View file

@ -0,0 +1,73 @@
//==========================================================================
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
// Copyright (c) 1999 - 2001 On2 Technologies Inc. All Rights Reserved.
//
//--------------------------------------------------------------------------
#ifndef _dkpltfrm_h
#define _dkpltfrm_h
/********************************************************
PC for Win95/DOS/etc...
********************************************************/
/*
#define DX_COUNTERS 0
*/
/* #define VOXWARE_WIN32 1 */
#define SUPPORT565 1
#define DX_TR20 1
#define TINKER 1
#define LARGECHUNKS 1
#define RGBORDER 0
#define BGRORDER 1
#define DKTRUE 1
#define DKFALSE !DKTRUE
#define TBLOFFSET 0
#define CENTER_TABLE 0
#define BLACK16X2 0x00000000
//#include "nofar.h"
#include "littlend.h"
#define LIMITREADS /* limit reads average frame size */
#define LIMIT_1_5 /* limit reads to 1.5x the average frame size */
#define DISPLAYDIB 0
#define AUDIOINTERLEAVED 1
typedef int GfsHn;
#define slow_seek duck_seek
#define gooseCD(x,y)
#define COLORORDER RGBORDER
#define SWAPENDS 0
#define HW_CD_BUFFER 0
#define CD_ONLY 0
#define DX24BIT
#if !defined(UINT64)
typedef unsigned __int64 UINT64;
#endif
#endif /* include guards */

View file

@ -0,0 +1,871 @@
#ifndef _duck_hfb_h
#define _duck_hfb_h
/******************************************************************************\
<table BGCOLOR=#FFC0C0 border=1 WIDTH=100% ><tr><td><b>
duck_hfb.h </b></td><td><b> TrueMotion include file for buffering/streaming libraries </b>
</td></tr><tr><td>&nbsp</td><td> Version: 6.0.0
</td></tr><tr><td>&nbsp</td><td> Updated: $Date: 2010/07/23 19:10:44 $
</td></tr><tr><td>&nbsp</td><td> Copyright (c) 1994-98, The Duck Corp. All rights reserved.
</td></tr>
</table>
******************************************************************************/
#define lHFB_ HFB_
#define libFunc
#if defined(__cplusplus)
extern "C" {
#endif
#include "duck_bmp.h"
#include "duck_wav.h"
#include <string.h> /* for size_t */
typedef enum dukDirect { /* direction to move within stream */
DUK_BACKWARD=-1, /* move backward from current position */
DUK_ABSOLUTE=0, /* move to an absolute position */
DUK_FORWARD=1, /* move forward from current position */
DUK_RESET=2 /* reset stream according to file position */
} hfbDirection;
typedef enum HFB_FileType { /* type of file opened */
DUK_NULFILE = 0, /* not a TrueMotion "S" A/V file */
DUK_DUKFILE = 1, /* TrueMotion "S" duk file */
DUK_AVIFILE = -1, /* TrueMotion "S" Video for Windows AVI compatible file */
DUK_QTFILE = 3 /* TrueMotion "S" Quicktime MOV compatible file */
} hfbFileType;
typedef enum HFB_StreamType {/* stream types */
DUK_UNDEFINED = 0, /* indeterminate or uninitialized stream */
DUK_AUDSTREAM = 1, /* audio stream */
DUK_VIDSTREAM = 2, /* video stream */
DUK_TXTSTREAM = 3 /* text stream */
} hfbStreamType;
typedef enum HFB_Modes { /* HFB buffering modes */
HFBMODE_NORMAL = 0, /* normal play once mode */
HFBMODE_FORWARDLOOP = 1, /* forward looping mode (loop back to start) */
HFBMODE_REVERSE = 2, /* reverse play once mode (not yet implemented)*/
HFBMODE_REVERSELOOP = 4, /* reverse looping mode (not yet implemented)*/
HFBMODE_QUEUE = 8, /* file queue mode (not yet implemented)*/
HFBMODE_FLYINDEX = 16, /* HFB does not have to read the AVI index to play the movie */ /* FWG 6-23-99 */
HFBMODE_ASYNC = 32, /* HFB is in asnyc mode. Needed for first read and index stuff */ /* FWG 7-7-99 */
HFBMODE_ASYNC_FLYINDEX = 64, /* Asnyc & Fly-Index mode. */ /* FWG 7-7-99 */
HFBMODE_PSEUDO_ASYNC = 128 /* */
} hfbBufferMode;
typedef enum BUFFERSTATUS {
HFB_BUSY = 0,
HFB_COMPLETE
} hfbBufferStatus;
typedef enum PRELOADSPEC {
HFB_FULL = -2,
HFB_THREEQUARTERS = -1,
HFB_NONE = 0
} hfbPreloadSpec;
#define HFB_USE_DEFAULT 0L
#define HFB_RESET_COUNT -1L
#define HFB_IGNORE_COUNT -2L
#define HFB_DATA_READ 0x01
#define HFB_DATA_RELEASED 0x02
#define HFB_DATA_KEYFRAME 0x08
typedef struct tHFB_STREAM_INFO{
hfbStreamType streamType;
int streamNum;
int lSampleRate;
int lStart;
int lLength;
char szName[24];
union {
DKWAVEFORM WaveformInfo;
DKBITMAP BitmapInfo;
DKBITMAP_old depricatedBitmapInfo; /* please don't use this */
} a;
DK_BITMAPINFOHEADER bmih; /* should be part of union or replace DKBITMAP ... but due to healthy paranoia add here ... */
} HFB_STREAM_INFO, MFP_STREAM_INFO;
typedef struct tHFB_FILE_INFO{
int lFileSize;
int lNumStreams;
char sName[96];
int lNumFrames;
} HFB_FILE_INFO, MFP_FILE_INFO;
typedef struct tHFBFile *HFB_FILE_HANDLE;
typedef struct tHFBStream *HFB_STREAM_HANDLE;
typedef struct tHFBBuffer *HFB_BUFFER_HANDLE;
typedef int HFB_DATA_HANDLE;
#define DCK_DEFAULT_READSIZE 0
#define DCK_DEFAULT_BUFFSIZE 0
/* main HFB initialization and exit routines */
/*@
@Name HFB_Init
@Description Allocate and initialize required data structures.If all three parameters are -1,
HFB will dynamically allocate objects as needed.
@Return value 0 if success or negative return code.
@*/
libFunc int HFB_Init(
int maxOpenFiles, /* maximum of concurently open file objects. */
int maxOpenStreams, /* maximum of concurently open streams. */
int maxOpenBuffers /* maximum of concurently open buffer objects. */
);
/*@
@Name HFB_Exit
@Description free any allocated strcutures, close all files, etc.
@Return value none.
@*/
libFunc void HFB_Exit(void);
/*@
@Name HFB_SeekToIndex
@Description Seek to the index in the AVI file
@Return Value returns 0 on success.
@*/
libFunc int HFB_SeekToIndex(HFB_FILE_HANDLE FileHandle);
/*@
@!Name HFB_BeginLoadIndex
@Description
@Return value
@*/
libFunc int HFB_BeginLoadIndex(
HFB_BUFFER_HANDLE dckPtr, /* */
int size /* */
);
/*@
@!Name HFB_FinishLoadIndex
@Description
@Return value
@*/
libFunc int HFB_FinishLoadIndex(
HFB_BUFFER_HANDLE dckPtr, /* */
void *data, /* */
int size /* */
);
/*@
@!Name HFB_ParseBigIndex
@Description
@Return value
@*/
libFunc int HFB_ParseBigIndex(
HFB_BUFFER_HANDLE dckPtr,
void *data,
int size
);
/*@
@Name HFB_OpenFile
@Description open specified file, parse its header(s) and load the index
@Return value handle to HFB file object.
@*/
libFunc HFB_FILE_HANDLE HFB_OpenFile(
const char *fileName, /* file to be opened. */
HFB_BUFFER_HANDLE bufferHandle, /* handle to a pre-existing HFB buffer. */
unsigned int userData /* user data. */
);
/* the following three functions, findfile, parsefile and loadindex,
are encapsulated by openfile, they are provided as a convenience
for use on systems with asynchronous i/o */
#if 0 // Changed to a static funtion MEW 11-6-03
/*@
@Name HFB_FindFile
@Description This function implements a portion of the functionality performed by HFB_OpenFile.
@Return value Handle to a HFB file object.
@*/
libFunc HFB_FILE_HANDLE HFB_FindFile(
const char *fileName, /* name of file to open */
unsigned int userData /* user data */
);
#endif
/*@
@Name HFB_ParseFile
@Description After a file has been found, and at least a single sector is buffered, it's header can be
parsedfor the information necessary to describe what the file contains. The combination of loading functions must
appear in this order HFB_FindFile, HFB_ParseFile, HFBLoadIndex.
@Return value none.
@*/
libFunc int HFB_ParseFile(
HFB_FILE_HANDLE fileHandle, /* handle to an HFB file object. */
HFB_BUFFER_HANDLE bufferHandle /* handle to an HFB buffer object. */
);
/*@
@Name HFB_LoadIndex
@Description Load a TrueMotion file's index into the specified buffer object.
Must be used in this order ... HFB_FindFile, HFB_ParseFile, HFB_LoadIndex.
@Return value 0 if successful, -1 if error
@*/
libFunc int HFB_LoadIndex(
HFB_FILE_HANDLE fileHandle, /* handle to HFB file object. */
HFB_BUFFER_HANDLE bufferHandle /* handle to HFFB buffer object. */
);
/*@
@Name HFB_CloseFile
@Description Close a TrueMotion file (AVI) and release file structures.
@Return value None.
@*/
libFunc void HFB_CloseFile(
HFB_FILE_HANDLE fHnd /* handle to an HFB file object. */
);
/*@
@Name HFB_GetFileInfo
@Description Used to read information about an opened TrueMotion File (AVI).
@Return value a pointer to an HFB_FILE_INFO structure describing the indicated file.
@*/
libFunc HFB_FILE_INFO *HFB_GetFileInfo(
HFB_FILE_HANDLE fileHandle /* handle to an HFB file object. */
);
/*@
@Name HFB_CreateBuffer
@Description Create High-speed File Buffer.
@Return value Handle to an HFB Buffer object, or null if no buffer objects available.
@*/
libFunc HFB_BUFFER_HANDLE HFB_CreateBuffer(
int sizeOfBuffer, /* size in bytes of buffer to allocate. */
int reserved /* reserved - must bbe zero. */
);
/*@
@Name HFB_InitBuffer
@Description After creating a buffer and opening a file, an application mst initialize the buffer with data.
@Return value Zero if successful, non-zero if not successful.
@*/
libFunc int HFB_InitBuffer(
HFB_BUFFER_HANDLE bufferHandle, /* handle to HFB buffer object. */
HFB_FILE_HANDLE fileToLoad, /* handle to HFB file object */
int startFrame, /* frame at which to being playback , normally 0. */
int initialReadSize /* amount of buffer to preload with data (specified in bytes). -1 means 3/4 buffer. -2 fill entire buffer */
);
/*@
@Name HFB_FillBuffer
@Description read additional data from a file into space invalidated by HFB_ReleaseStreamingData calls
or any empty buffer space available. For best results call this function once per frame with the elapsedFrames set to DUCK_IGNORE_COUNT.
The function will use the elapsedFrame parameter in conjunction with internal computed values to determine the amount to read from the file
in order to avoid waiting for data to become availabble.
@Return value Number of bytes actually read from the disk file into the buffer or a negative error code.
@*/
libFunc int HFB_FillBuffer(
HFB_BUFFER_HANDLE bufferHandle, /* handle to a buffer objects */
int maxToRead, /* maximum number of bytes to read during this call */
int elapsedFrames /* number of frames elapsed since start of play */
);
/*@
@Name HFB_DestroyBuffer
@Description Free memory used by buffer and release buffer object.
@Return value none.
@*/
libFunc void HFB_DestroyBuffer(
HFB_BUFFER_HANDLE bufferHandle /* handle to an HFB buffer object */
);
/*@
@!Name HFB_ResetStreams
@Description
@Return value
@*/
libFunc void HFB_ResetStreams(
HFB_BUFFER_HANDLE bufferHandle /* */
);
/*@
@Name HFB_SetBufferMode
@Description Sets the mode for the specified bufffer. Buffer mode defaults to HFBMODE_NORMAL unless this function is called.
@Return value
@*/
libFunc int HFB_SetBufferMode(
HFB_BUFFER_HANDLE buffer, /* handle to HFB buffer object. */
hfbBufferMode mode /* mode. */
);
/*@
@!Name HFB_GetBufferPerCentFull
@Description
@Return value
@*/
libFunc int HFB_GetBufferPerCentFull(
HFB_BUFFER_HANDLE buffer /* */
);
/*@
@!Name HFB_GetmovieSize
@Description
@Return value
@*/
libFunc int HFB_GetmovieSize(
HFB_BUFFER_HANDLE buffer /* */
);
/*@
@!Name HFB_GetBufferSpace
@Description
@Return value
@*/
libFunc int HFB_GetBufferSpace(
HFB_BUFFER_HANDLE buffer /* */
);
/*@
@Name HFB_GetBufferStatus
@Description Use this to detemine if a buffer has reached an end of file.
@Return value 0 - buffer OK. 1 - Buffer reached end of file.
@*/
libFunc hfbBufferStatus HFB_GetBufferStatus(
HFB_BUFFER_HANDLE buffer /* handle to an HFB buffer object. */
);
/*@
@!Name HFB_ConditionBuffer
@Description
@Return value
@*/
libFunc int HFB_ConditionBuffer(
HFB_BUFFER_HANDLE bufferHandle, /* */
int bufferSize, /* */
int reserved /* */
);
#define HFB_ResetBuffer HFB_ConditionBuffer
/*@
@Name HFB_GetStream
@Description get a stream reference handle by name, number, or type.
@Return value handle to a stream object.
@*/
libFunc HFB_STREAM_HANDLE HFB_GetStream(
HFB_FILE_HANDLE fileHandle, /* handle to HFB file object. */
const char *StreamNameOrNull, /* C string containing the name of a stream within the specified file. Null to ignore. */
int streamNumber, /* an absolute stream number or the nth occuring stream of the specified file. */
unsigned int streamType /* the type of stream to be opened. */
);
/*@
@Name HFB_ReleaseStream
@Description relinquish reference to stream object so it may return to the pool.
@Return value none.
@*/
libFunc void HFB_ReleaseStream(
HFB_STREAM_HANDLE streamHandle /* handle to an HFB stream object. */
);
/*@
@Name HFB_GetStreamInfo
@Description get a pointer to stream info struct
@Return value pointer to a struct containing the stream info.
@*/
libFunc HFB_STREAM_INFO* HFB_GetStreamInfo(
HFB_STREAM_HANDLE streamHandle /* handle to an HFB stream object */
);
#define HFB_GetStreamLength(strmh) HFB_GetStreamInfo(strmh)->lLength
#define HFB_GetStreamName(strmh) HFB_GetStreamInfo(strmh)->szName
/*@
@Name HFB_GetStreamingData
@Description Get pointer to buffered record and length. Normally this will be balanced by a call to HFB_ReleaseStreamingData, unless
the entire file fits within the HFB buffer. The operation does not move compressed data.
@Return value >= 0 handle to compressed block; -1 request out of range ; -2 block exists but is not in the buffer ...
usually caused by unrleased block of buffer starvation ; -4 block has been release from use.
@*/
libFunc HFB_DATA_HANDLE HFB_GetStreamingData(
HFB_STREAM_HANDLE streamHandle, /* handle to an HFB stream object. */
void **ptrToPtr, /* pointer to pointer to compressed data. */
int *ptrToLength, /* pointer to length of data in bytes. */
hfbDirection directionToMove, /* direction in which to read records. */
int framesToMove /* the number of reqested records. */
);
/*@
@Name HFB_ReleaseStreamingData
@Description release buffer space occupied by record
@Return value none.
@*/
libFunc void HFB_ReleaseStreamingData(
HFB_BUFFER_HANDLE bufferHandle, /* handle to HFB buffer object. */
HFB_DATA_HANDLE recordToRelease /* index of data record to release. */
);
/*@
@Name HFB_ReadData
@Description read data directly from a file into a supplied buffer,
limit is set by initial value of *ptrToLength
@Return value 0 on success, or negative error code.
@*/
libFunc int HFB_ReadData(
HFB_STREAM_HANDLE streamHandle, /* handle to HFB stream object. */
void *data, /* pointer to where data should be copied. Used by duck_read. */
int *maxLength, /* pointer to max data size, will be over-written with actual count of bytes read. */
hfbDirection directionToMove, /* direction in which the seek should move. */
int count /* the number of datarecords to move before reading. Absolute referencse begin at 0. */
);
libFunc int HFB_ReadDataBlocking(
HFB_STREAM_HANDLE streamHandle, /* handle to HFB stream object. */
void *data, /* pointer to where data should be copied. Used by duck_read. */
int *maxLength, /* pointer to max data size, will be over-written with actual count of bytes read. */
hfbDirection directionToMove, /* direction in which the seek should move. */
int count /* the number of datarecords to move before reading. Absolute referencse begin at 0. */
);
/*@
@!Name HFB_FramestoNextKeyFrame
@Description
@Return value
@*/
libFunc int HFB_FramestoNextKeyFrame(
HFB_STREAM_HANDLE streamHandle, /* */
int recordHandle, /* */
int *numberOfRecordsSpanned /* */
);
/*@
@!Name HFB_FrameToChunk
@Description
@Return value
@*/
libFunc int HFB_FrameToChunk(
HFB_STREAM_HANDLE streamHandle, /* */
int frameNumber /* */
);
/*@
@Name HFB_PreviousKeyFrame
@Description Get the frameNumber of the keyframe at or prior to the specified frameNumber
@Return value
@*/
libFunc int HFB_PreviousKeyFrame(
HFB_STREAM_HANDLE streamHandle, /* */
int frameNumber /* */
);
typedef enum FTYPE {
HFB_FRAMENUM = 0,
HFB_INDEXNUM = 1
} hfbFrameNumber;
/*@
@Name HFB_GetIndexFlags
@Description get the HFB index flags for the specified record/frame
@Return value >= 0 data block flags for data block specifid; -1 frameNum is out of index range ; -2 frameNum is out of frame range.
@*/
libFunc int HFB_GetIndexFlags(
HFB_STREAM_HANDLE , /* handle to HFB stream object. */
hfbFrameNumber frameNumberType, /* one of HFB_FRAMENUM, HFB_INDEXNUM */
int recordHandleOrFrameNumber /* record handle or frame number. */
);
/*@
@Name HFB_AddIndexFlags
@Description add the HFB index flags for the specified record/frame
@Return value 0 if unsuccessful; 1 if successful;
@*/
libFunc int HFB_AddIndexFlags(
HFB_STREAM_HANDLE , /* handle to HFB stream object. */
hfbFrameNumber frameNumberType, /* one of HFB_FRAMENUM, HFB_INDEXNUM */
int recordHandleOrFrameNumber, /* record handle or frame number. */
int flags /* flags to add */
);
/*@
@Name HFB_GetDataPosition
@Description get current data position. video - frameNumber, audio - sampleCount.
This is useful for resolving differences between streams when starting from a position other than the beginning of the file.
@Return value Longword starting position of the data record within the stream, expressed in audio samples for audio streams and frames for video streams.
@*/
libFunc int HFB_GetDataPosition(
HFB_STREAM_HANDLE streamHandle, /* handle to HFB stream object. */
HFB_DATA_HANDLE dataIndex /* index to a data record within a stream. Use -1 to find position of first available record in the buffered stream */
);
/*@
@Name HFB_GetAudioInfo
@Description Get information about audio stream.
@Return value pointer to a DKWAVEFORM structure describing the audio information contained in the stream.
@*/
libFunc DKWAVEFORM *HFB_GetAudioInfo(
HFB_STREAM_HANDLE aStream, /* handle to HFB stream object */
int *NumChannels, /* pointer to number of channels in the audio stream. */
int *SamplesPerSec, /* pointer to samples per second in the audio stream. */
int *BytesPerSec, /* pointer to bytes per second in the audio stream. */
int *wFormat /* pointer to the format tag value for the audio stream. */
);
/*@
@!Name HFB_GetInitialFrames
@Description /* get the amount of audio skew expressed in records
@Return value
@*/
libFunc int HFB_GetInitialFrames(
HFB_STREAM_HANDLE videoStream, /* handle to video stream */
HFB_STREAM_HANDLE audioStream /* handle to audio stream */
);
/*@
@Name HFB_GetSamplesPerFrame
@Description get the number of audio frames elapsed during a single video frame
@Return value The number of audio samples from the audio stream occurring within a single frame interval of video.
@*/
libFunc int HFB_GetSamplesPerFrame(
HFB_STREAM_HANDLE videoStream, /* handle to an HFB video stream */
HFB_STREAM_HANDLE audioStream /* handle to an HFB audio stream */
);
/*@
@Name HFB_GetFrameRates
@Description get video frame rate and calculated audio skew (in audio samples)
@Return value
@*/
libFunc void HFB_GetFrameRates(
HFB_STREAM_HANDLE videoStream, /* handle to an HFB video stream */
HFB_STREAM_HANDLE audioStream, /* handle to an HFB audio stream */
int *ptrToIntegerFrameRate, /* pointer to receive frame rate of dominant stream. */
int *ptrToEstimatedAudioSampleSkew /* pointer to number of audio samples appearing before the first video frame in file. */
);
/*@
@Name HFB_GetDRMData
@Description get the DRMX data chunk
@Return value
@*/
libFunc int HFB_GetDRMData(
HFB_FILE_HANDLE dckPtr, /* */
unsigned int* pOutEncFourCC, /* */
int* pOutLength, /* */
unsigned char** ppOutData /* */
);
/*@
@!Name HFB_GetStreamParentBuffer
@Description functions to retrieve parent buffer and file of a given stream
@Return value
@*/
libFunc HFB_BUFFER_HANDLE HFB_GetStreamParentBuffer(
HFB_STREAM_HANDLE streamHandle /* */
);
/*@
@!Name HFB_GetStreamParentFile
@Description
@Return value
@*/
libFunc HFB_FILE_HANDLE HFB_GetStreamParentFile(
HFB_STREAM_HANDLE streamHandle /* */
);
/*@
@!Name HFB_GetStreamParentFileHandle
@Description function to retrieve parent file handle of a given stream
@Return value
@*/
libFunc int HFB_GetStreamParentFileHandle(
HFB_STREAM_HANDLE streamhandle /* */
); /* FWG 6-23-99 */
/*@
@Name HFB_SetMaxFrameSize
@Description Tell HFB maximum frame size in bytes.
****** DO NOT GIVE WRONG NUMBER****** This might cause
HFB to crash. Only used in Fly-Index mode.
@Return Value T.B.D.
@*/
libFunc int HFB_SetMaxFrameSize(
HFB_BUFFER_HANDLE Buffer, /* handle to an HFB Buffer */
int maxFrameSize /* maximum frame size */
); /* FWG 7-7-99 */
libFunc hfbBufferMode HFB_GetBufferMode(HFB_BUFFER_HANDLE); /* FWG 7-8-99 */
/* used to precisely calculate rational frame rates
for a specific stream */
libFunc void HFB_GetStreamRateAndScale(
HFB_STREAM_HANDLE xStream, /* stream handle */
int *rate, /* rate - of rate and scale. */
int *scale /* scale - of rate and scale. */
);
/*@
@Name HFB_GetStreamFCCs
@Description get stream type and handler fourCC codes,
@Return Value returns type (not handler)
@*/
libFunc unsigned int HFB_GetStreamFCCs(
HFB_STREAM_HANDLE xStream, /* handle to compressed stream */
unsigned int *type, /* pointer to stream type */
unsigned int *handler /* pointer to fourCC code */
);
/*@
@Name HFB_NextKeyFrame
@Description returns the index of the next keyframe, looking forward from StartChunk.
byteRate is the projected byterate up to that keyframe.
@Return Value returns the index of the next keyframe
@*/
int HFB_NextKeyFrame(
HFB_STREAM_HANDLE sPtr, /* stream handle */
int StartChunk, /* look forward from here. */
int *byteRate /* */
);
/*
@Name HFB_isVideoKeyFrame
@Description checks if a video frame is a key frame (in logarithmic time)
@Return Value returns 1 if key frame, 0 if not, -1 on error
@Note: only works for the first video stream*/
int HFB_isVideoKeyFrame(
HFB_BUFFER_HANDLE dckPtr, /* buffer handle */
int frameNum /* video frame to check */
);
int HFB_ProjectBitRate(HFB_STREAM_HANDLE sPtr, int StartChunk, int *numFrames );
// returns the byterate for the next *numFrames , given a starting chunkIndex
// numFrames is a pointer since the actual amount looked ahead may be adjusted
// as you get to the end of the stream
/* Determine the stream to which we can switch that has the highest precedence */
/* (defined by order in the array), but is below the ceiling specified by the caller */
/* Note: We can only switch to another stream if its next frame is a keyframe. */
/* Note: If no streams are below the ceiling, we will attempt to switch to the */
/* lowest bitrate stream on a keyframe. */
int HFB_SelectBestFitStream(
HFB_STREAM_HANDLE* streamArray, // array of streams to consider
int numberOfStreamsInArray, // number of streams in the array
int currentStream, // array index matching currently used stream
int desiredProjectionSpan, // distance in frames ahead to project
int bitRateCeiling); // we're looking for a stream under this bitrate
/* get streamSampleSize, <= 0 means variable */
libFunc int HFB_GetStreamSampleSize(HFB_STREAM_HANDLE xStream);
/*@
@!Name HFB_WhatsAhead
@Description
@Return value
@*/
libFunc int HFB_WhatsAhead(
HFB_STREAM_HANDLE sPtr, /* */
int StartChunk, /* */
int *horizon /* */
);
/* windows 95 dll system abstraction functions */
libFunc void HFB_Setmalloc(
void *(*mallocFuncPtr)(unsigned int size)
);
libFunc void HFB_Setcalloc(
void *(*callocFuncPtr)(unsigned int size, unsigned int number)
);
libFunc void HFB_Setfree(
void (*freeFuncPtr)(void *)
);
libFunc void HFB_Setopen(
int (*openFuncPtr)(const char *, int,...)
);
libFunc void HFB_Setclose(
int (*closeFuncPtr)(int)
);
libFunc void HFB_Setread(
int (*readFuncPtr)(int,void *, unsigned int)
);
libFunc void HFB_Setseek(
int (*seekFuncPtr)(int,int,int)
);
/*@
@Name HFB_GetStreamArray
@Description HFB_GetStreamArray
will return an array of all streams in a file
that are of the given type. If the given type is DUK_UNDEFINED,
all streams will be included in the array, regardless of type.
This function will also report back the size of the array (ie: the number
of matching streams) through the numberOfStreams pointer.
@Return value The array of stream handles
@*/
HFB_STREAM_HANDLE* HFB_GetStreamArray(
HFB_FILE_HANDLE FileHandle, /* the file we will be looking in for our streams */
unsigned int StreamType, /* the type of stream we are looking for */
unsigned int* numberOfStreams /* a pointer to the number of matching streams */
);
/*@
@Name HFB_ReleaseStreamArray
@Description HFB_ReleaseStreamArray will deallocate an array of streams which
was previously allocated by a call to HFB_GetStreamArray().
@Return Value
@*/
void HFB_ReleaseStreamArray(
HFB_STREAM_HANDLE* StreamArray, /* the array of streams we want to release */
unsigned int numberOfStreams /* number of streams in the array */
);
/*@
@Name HFB_GetLastError
@Description HFB_GetLastError will return the last error that occured
@Return Value 0 if successful, -1 if unsuccessful
@*/
int HFB_GetLastError(
HFB_BUFFER_HANDLE bfHnd, /* pointer to the buffer handle */
int* lastErrorCode, /* will return negative value for HFB error,
positive value for SAL error */
char errorString[], /* will return error string */
size_t maxLen /* max size of error string */
);
typedef enum HFB_ERR_t {
HFB_ERR_MIN = -7,
HFB_ERROR_LOADING_INDEX = -6,
HFB_ERROR_PARSING_FILE = -5,
HFB_PARTIALREAD = -4,
HFB_ENDOFSTREAM = -3,
HFB_NOTREADY = -2,
HFB_ERROR = -1,
HFB_OK = 0
} HFB_ERR;
typedef struct HFB_ERR_DECODE_temp
{
HFB_ERR code;
char* decode;
} HFB_ERR_DECODE_t;
#if defined(__cplusplus)
}
#endif
#undef libFunc
#endif

View file

@ -0,0 +1,340 @@
#if !defined(_duck_ifstream_h)
#define _duck_ifstream_h
#include "duck_io.h"
#include <stdio.h>
#include <sstream>
#include <ios>
#include <assert.h>
#include "iduck_ifstream.hpp"
class duck_ifstream_ifstream : duck_ifstream
{
public:
bool operator!() const
{
return (m_fd == 0);
}
bool is_open()
{
return (m_fd != 0);
}
int length()
{
if (m_length < 0)
{
FILE* fp = (FILE* ) m_fd;
long off = ftell(fp);
fseek(fp, 0,SEEK_END);
long off2 = ftell(fp);
fseek(fp, off, SEEK_SET);
m_length = (int ) off2;
return (int) off2;
}
else
{
return m_length;
}
}
void time_out(unsigned long milli)
{
;
}
bool eof()
{
return feof(m_fd);
}
operator bool () const
{
return (m_fd != 0);
}
void open(const char* filename, std::ios_base::openmode mode)
{
m_length = -1;
m_fd = fopen(filename, "rb");
}
void open(void *src, void* ignore)
{
assert(0);
}
void close()
{
if (m_fd)
{
fclose(m_fd);
}
}
void read(void *buffer, size_t len)
{
fread((unsigned char* ) buffer, sizeof(char), len, m_fd);
}
void get(char& c)
{
fread((unsigned char* ) &c, sizeof(char), 1, m_fd);
}
void seekg(long position)
{
fseek(m_fd, position, SEEK_SET);
}
void seekg(long offset, int origin)
{
switch (origin)
{
case std::ios_base::cur :
fseek(m_fd, offset , SEEK_CUR);
break;
case std::ios_base::end :
fseek(m_fd, offset, SEEK_END);
break;
case std::ios_base::beg :
fseek(m_fd, offset, SEEK_SET);
break;
default :
assert(0);
break;
}
}
void ignore(long offset)
{
fseek(m_fd, offset, SEEK_CUR);
}
long tellg()
{
const std::streamoff off = ftell(m_fd);
return std::streampos(off);
}
private:
FILE* m_fd;
int m_length;
};
extern "C" {
void MessageBox(char* title, char* msg);
}
#include "duck_io.h"
class duck_ifstream_http : duck_ifstream
{
public:
bool operator!() const
{
return (m_fd <= 0);
}
bool is_open()
{
return (m_fd > 0);
}
~duck_ifstream_http()
{
duck_exit_http(m_fd);
}
operator bool () const
{
return (m_fd >= 0);
}
int length()
{
return duck_length((int ) m_fd);
}
void time_out(unsigned long milli)
{
duck_http_timeout(m_fd, milli);
}
bool eof()
{
return duck_eof(m_fd);
}
void open(const char* url, std::ios_base::openmode mode)
{
m_fd = (int) duck_init_http(url);
if (duck_open((char *) m_fd, 0) < 0)
{
if (m_fd)
{
duck_close((int ) m_fd);
m_fd = -1;
}
}
}
void open(void *src, void* ignore)
{
assert(0);
}
void close()
{
if (m_fd >= 0)
{
duck_close(m_fd);
}
}
void read(void *buffer, size_t len)
{
size_t x;
x = duck_read(m_fd, (unsigned char* ) buffer, (long ) len);
if (x != len)
{
MessageBox("Error", "NSV Read Failed");
}
}
void get(char& c)
{
duck_read(m_fd, (unsigned char *) &c, 1);
}
void seekg(long position)
{
long o = position - duck_tell(m_fd);
if (o >= 0)
{
duck_seek(m_fd, o, SEEK_CUR);
}
else
{
duck_close(m_fd);
duck_open((char *) m_fd, 0);
duck_seek(m_fd, position, SEEK_CUR);
}
}
void seekg(long offset, int origin)
{
switch (origin)
{
case std::ios_base::cur :
duck_seek(m_fd, offset, SEEK_CUR);
break;
default :
/* don't do it ! */
/* assert(0); */
break;
}
}
void ignore(long offset)
{
duck_seek(m_fd, offset, SEEK_CUR);
}
long tellg()
{
long off = duck_tell(m_fd);
return off;
}
private:
int m_fd;
#if 0
/* disable copying ! */
duck_ifstream_http(const duck_ifstream_http& );
/* disable copying ! */
operator= (const duck_ifstream_http& );
#endif
};
#endif

View file

@ -0,0 +1,26 @@
//==========================================================================
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
// Copyright (c) 1999 - 2001 On2 Technologies Inc. All Rights Reserved.
//
//--------------------------------------------------------------------------
#ifndef _duck_int_h
#define _duck_int_h
#if defined(__cplusplus)
extern "C" {
#endif
int *duck_int386x(int intVal, void *r1, void *r2, void *sr);
#if defined(__cplusplus)
}
#endif
#endif

View file

@ -0,0 +1,109 @@
//==========================================================================
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
// Copyright (c) 1999 - 2001 On2 Technologies Inc. All Rights Reserved.
//
//--------------------------------------------------------------------------
#ifndef _duck_io_h
#define _duck_io_h
#if defined(__cplusplus)
extern "C" {
#endif
#if defined (_WIN32)
typedef __int64 int64_t;
#endif
typedef struct
{
int64_t offset; // offset to start from
int blocking; // non-zero for blocking
} ReOpen_t;
typedef enum {
SAL_ERR_MAX = -10,
SAL_ERROR = -11, // Default error
SAL_ERR_WSASTARTUP = -12,
SAL_ERR_SOCKET_CREATE = -13,
SAL_ERR_RESOLVING_HOSTNAME = -14,
SAL_ERR_SERVER_CONNECTION = -15,
SAL_ERR_SENDING_DATA = -16,
SAL_ERR_RECEIVING_DATA = -17,
SAL_ERR_404_FILE_NOT_FOUND = -18,
SAL_ERR_PARSING_HTTP_HEADER = -19,
SAL_ERR_PARSING_CONTENT_LEN = -20,
SAL_ERR_CONNECTION_TIMEOUT = -21,
SAL_ERR_FILE_OPEN_FAILED = -22,
SAL_ERR_MIN = -23
} SAL_ERR; /* EMH 1-15-03 */
typedef struct SalErrMap_temp
{
SAL_ERR code;
const char* decode;
} SalErrMap_t;
static char* SalErrText(SAL_ERR e)
{
int t;
const SalErrMap_t gSalErrMap[] =
{
{ SAL_ERR_WSASTARTUP, "Error with WSAStartup" },
{ SAL_ERR_SOCKET_CREATE, "Error creating socket" },
{ SAL_ERR_RESOLVING_HOSTNAME, "Error resolving hostname" },
{ SAL_ERR_SERVER_CONNECTION, "Error connecting to server" },
{ SAL_ERR_SENDING_DATA, "Error sending data" },
{ SAL_ERR_RECEIVING_DATA, "Error receiving data" },
{ SAL_ERR_404_FILE_NOT_FOUND, "Error file not found " },
{ SAL_ERR_PARSING_HTTP_HEADER, "Error parsing http header" },
{ SAL_ERR_PARSING_CONTENT_LEN, "Error parsing content length" },
{ SAL_ERR_CONNECTION_TIMEOUT, "Error Connection timed out" },
{ SAL_ERR_FILE_OPEN_FAILED, "Error opening file" }
};
for(t = 0; t < sizeof(gSalErrMap)/sizeof(SalErrMap_t); t++)
{
if (e == gSalErrMap[t].code)
return (char *) gSalErrMap[t].decode;
}
return 0;
}
int duck_open(const char *fname, unsigned long userData);
void duck_close(int ghndl);
int duck_read(int ghndl,unsigned char *buf, int nbytes);
int64_t duck_seek(int gHndl,int64_t offs, int origin);
int duck_readFinished(int han, int flag); /* FWG 7-9-99 */
int duck_name(int handle, char name[], size_t maxLen); /* EMH 9-23-03 */
int duck_read_blocking(int handle,unsigned char *buffer,int bytes); /* EMH 9-23-03 */
int64_t duck_available_data(int handle); /* EMH 10-23-03 */
#if defined(__cplusplus)
}
#endif
#endif

View file

@ -0,0 +1,44 @@
//==========================================================================
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
// Copyright (c) 1999 - 2001 On2 Technologies Inc. All Rights Reserved.
//
//--------------------------------------------------------------------------
#ifndef _duck_io_h_old
#define _duck_io_h_old
#if defined(__cplusplus)
extern "C" {
#endif
#if defined (_WIN32)
typedef __int64 int64_t;
#else
typedef long long int64_t;
#endif
#include "duck_io.h"
int duck_open_file(const char *fname, unsigned long userData);
void duck_close_file(int ghndl);
int duck_read_file(int ghndl,unsigned char *buf, int nbytes);
int64_t duck_seek_file(int gHndl,int64_t offs, int origin);
int duck_name_file(int handle, char fname[], size_t maxLen); /* EMH 9-23-03 */
int64_t duck_available_data_file(int handle); /* EMH 10-23-03 */
#if defined(__cplusplus)
}
#endif
#endif

View file

@ -0,0 +1,62 @@
//==========================================================================
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
// Copyright (c) 1999 - 2001 On2 Technologies Inc. All Rights Reserved.
//
//--------------------------------------------------------------------------
#ifndef _duck_io_h_http
#define _duck_io_h_http
#include <string.h> /* get size_t */
#include "duck_io.h"
#if defined(__cplusplus)
extern "C" {
#endif
#if defined (_WIN32)
typedef __int64 int64_t;
#else
typedef long long int64_t;
#endif
int duck_open_http(const char *fname, unsigned long userData);
void duck_close_http(int ghndl);
int duck_read_http(int ghndl,unsigned char *buf, int nbytes);
int64_t duck_seek_http(int gHndl,int64_t offs, int origin);
int duck_sal_error_http(void* handle, SAL_ERR* lastErrorCode, char buffer[], size_t maxLen); /* EMH 1-15-03 */
char* duck_init_http(char* url); /* EMH 1-17-03 */
void duck_exit_http(int handle); /* EMH 6-09-03 */
int duck_sal_fill(void * handle, bool blocking); /* EMH 6-12-03 */
void duck_http_timeout(int handle, unsigned long milliseconds);
int duck_sal_buff_percent(void* handle); /* debug */
int64_t duck_available_data_http(int handle); /* EMH 10-23-03 */
int64_t duck_content_len(void *handle);
int duck_name_http(int handle, char url[], size_t maxLen); /* EMH 9-23-03 */
int duck_read_blocking_http(int handle,unsigned char *buffer, int bytes); /* EMH 9-23-03 */
#if defined(__cplusplus)
}
#endif
#endif

View file

@ -0,0 +1,18 @@
//==========================================================================
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
// Copyright (c) 1999 - 2001 On2 Technologies Inc. All Rights Reserved.
//
//--------------------------------------------------------------------------
#ifndef _duck_mem_h
#define _duck_mem_h
#include "../on2_common/src/on2_mem/include/on2_mem.h"
#endif

View file

@ -0,0 +1,29 @@
#ifndef _duck_wav_h
#define _duck_wav_h
#if defined(__cplusplus)
extern "C" {
#endif
typedef struct tDKWAVEFORM
{
unsigned short wFormatTag; /* format type */
unsigned short nChannels; /* number of channels (i.e. mono, stereo...) */
unsigned int nSamplesPerSec; /* sample rate */
unsigned int nAvgBytesPerSec; /* for buffer estimation */
unsigned short nBlockAlign; /* block size of data */
unsigned short wBitsPerSample; /* Number of bits per sample of mono data */
unsigned short cbSize; /* The count in bytes of the size of
extra information (after cbSize) */
unsigned short wSamplesPerBlock;
unsigned int userData[16];
} DKWAVEFORM;
/* don't try to endian fix the userData ! */
static int DKWAVEFORM_REFLECT[ ] = { 2,2, 4,4, 2,2,2,2 };
#if defined(__cplusplus)
}
#endif
#endif

View file

@ -0,0 +1,25 @@
#ifndef _duktypes_h
#define _duktypes_h
#if defined(__cplusplus)
extern "C" {
#endif
typedef unsigned char U8;
typedef unsigned short U16;
typedef unsigned long U32;
typedef signed char I8;
typedef short I16;
typedef long I32;
/*
//typedef int Boolean;
*/
#if 1 /* def _MSC_VER */
typedef unsigned char uchar;
/*typedef unsigned short ushort;*/
typedef unsigned long ulong;
#endif
#if defined(__cplusplus)
}
#endif
#endif

View file

@ -0,0 +1,38 @@
#ifndef _dxl_aud_h
#define _dxl_aud_h
#include "duck_hfb.h"
#include "duck_dxl.h"
enum spkrst8 { SPEAKEROFF = 0, SPEAKERON = 1, FEEDSPEAKER = 2, MONOSPEAKER = 3};
enum syncst8 { NOSYNC = 0, SYNCSPEAKER = 1, SYNCSYSTEM = 2};
extern enum spkrst8 speakerstate;
extern enum syncst8 syncstate;
void Announcement(char *msg);
extern "C" {
int FillAudio( HFB_BUFFER_HANDLE hfb, MFP_STREAM_HANDLE as, int *index,
void **blk, long *Len, int buffPreload, int MultiBlock);
int SetupAudio( HFB_BUFFER_HANDLE hfb, MFP_STREAM_HANDLE as, int Setstate,
int freq, int width16, int Stereo);
void StartPlaying(void) ;
void StopPlaying(void);
void ResyncAudio(
HFB_BUFFER_HANDLE hfb,
HFB_STREAM_HANDLE astr,
int *index, void **blk, long *Len, int frame, int frame_rate);
}
#endif

View file

@ -0,0 +1,307 @@
//==========================================================================
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
// Copyright (c) 1999 - 2001 On2 Technologies Inc. All Rights Reserved.
//
//--------------------------------------------------------------------------
#ifndef _dxl_main_h
#define _dxl_main_h
#if defined(__cplusplus)
extern "C" {
#endif
struct vScreen;
struct tXImage;
struct tAudioBuff;
struct tXAudioSource;
#if defined(__cplusplus)
}
#endif
#if defined(_WIN32_WCE)
#ifndef NULL
#define NULL 0
#endif
#endif
#include "dkpltfrm.h"
//#include "duktypes.h"
#include "duck_dxl.h"
#if defined(__cplusplus)
extern "C" {
#endif
#define TMRTType 5
#define validate(x) {if (!x) return (int ) DXL_NULLSOURCE; if (!x->dkFlags.inUse) return (int ) DXL_NOTINUSE ;}
typedef void *blitFunc;
/*typedef void (*blitFunc2)(DXL_XIMAGE_HANDLE,DXL_VSCREEN_HANDLE); */
typedef int DXL_BLIT_FORMAT;
enum DKOBJECTTYPE {
DXUNUSED = 0,
DXXIMAGE = 1,
DXVSCREEN = 2
};
enum COLORDEPTH {
PALETTE8 = 0,
RGB555 = 1,
RGB555A = 2,
RGB888 = 3,
RGBA8888 = 4
};
typedef struct tagflgs {
unsigned inUse : 1;
unsigned DXed : 1;
unsigned clutOwner: 1;
unsigned doCompleteBlit : 1;
unsigned keyFrame : 1;
unsigned nullFrame : 1;
unsigned interframe : 1;
unsigned logo : 1;
unsigned allocated : 1;
} dkInfoFlags;
typedef struct vflgs {
unsigned clipped : 1;
unsigned showInfoDots : 1;
} vFlags;
typedef struct frameheader {
unsigned char hdrSize;
unsigned char Type;
unsigned char DeltaSet;
unsigned char Table;
unsigned short Ysize;
unsigned short Xsize;
unsigned short CheckSum;
unsigned char CVersion;
unsigned char metaType;
unsigned char Frameinfo;
unsigned char Control;
unsigned short xoff,yoff,width,height;
} FRAMEHEADER;
typedef struct DXINFOSTRUCT{
int imwidth;
int imheight;
int blockpower;
int lpbmione;
int block2x;
unsigned char *vectbl;
int hinterp;
int interframe;
int iskeyframe;
int sprite;
int bitcnt;
int hdrSize;
int drawing;
int fmt;
FRAMEHEADER f;
int algorithm;
} dxInfoStruct;
/*
base "class" for xImage(s):
enum DKOBJECTTYPE dkObjectType; // type of object
dkInfoFlags dkFlags; // universal flags
enum COLORDEPTH cDepth; // colorDepth
short imWidth,imHeight; // internal width & height
short x,y,w,h; // location and dx'd dimensions
unsigned char *addr; // pointer to compressed data
DXL_VSCREEN_HANDLE lVScreen; // last know destination
DXL_XIMAGE_HANDLE (*create)(void); // creator (constructor)
DXL_XIMAGE_HANDLE (*recreate)(void); // recreate base w/h/type/etc.
int (*destroy)(void); // destroyer (destructor)
int (*seedData)(void); // reseed with new compressed data
int (*dx)(void); // decompress (to vScreen)
int (*blit)(void); // blit from internal state
*/
/*
char *(*perfStats)(DXL_XIMAGE_HANDLE, char *storage); \
*/
typedef struct profilePack_t
{
UINT64 dxClocks;
UINT64 profileStart;
UINT64 profileEnd;
int frameCount;
} DXL_PROFILEPACK;
#define xImageBaseStruct \
enum DKOBJECTTYPE dkObjectType; \
dkInfoFlags dkFlags; \
enum COLORDEPTH colorDepth; \
short imWidth,imHeight; \
short x,y,w,h; \
unsigned char *addr; \
DXL_VSCREEN_HANDLE lVScreen; \
enum BITDEPTH *bdPrefs; \
DXL_XIMAGE_HANDLE (*create)(void *); \
DXL_XIMAGE_HANDLE (*recreate)(DXL_XIMAGE_HANDLE,void *,int,int,int,int); \
int (*destroy)(DXL_XIMAGE_HANDLE); \
int (*seedData)(DXL_XIMAGE_HANDLE); \
int (*dx)(DXL_XIMAGE_HANDLE, DXL_VSCREEN_HANDLE); \
int (*blit)(DXL_XIMAGE_HANDLE, DXL_VSCREEN_HANDLE); \
int (*internalFormat)(DXL_XIMAGE_HANDLE, DXL_VSCREEN_HANDLE); \
int (*verify)(DXL_XIMAGE_HANDLE, DXL_VSCREEN_HANDLE); \
int fSize; \
long (*GetXImageCSize)(DXL_XIMAGE_HANDLE); \
void *(*getFrameBuffer)(DXL_XIMAGE_HANDLE); \
void (*setParameter)(DXL_XIMAGE_HANDLE, int , unsigned long );\
DXL_PROFILEPACK prof
typedef struct tXImage{
xImageBaseStruct;
} DXL_XIMAGE;
typedef struct tXImage1{
xImageBaseStruct;
/********** TM1 specific follows **********/
enum IMAGETYPE imType;
unsigned char *lineBuffer;
int lineBufferSize;
unsigned long *chromaBuffer;
int chromaBufferSize;
short dxCount; /* number of lines left to decompress */
short lw,lh;
enum BGMODE sprMode;
short sprColor; /* sprite mode and color for blending */
dxInfoStruct dxInfo;
} DXL_XIMAGE_1,*DXL_XIMAGE_1HANDLE;
typedef struct vScreen{
enum DKOBJECTTYPE dkObjectType;
unsigned char *addr,*laddr; /* address of destination and what it was the last time */
unsigned char *bAddr,*bOffsetAddr; /* address of sprite background */
enum BITDEPTH bd; /* format of destination */
enum BLITQUALITY bq; /* blit translation mode */
short pitch,height; /* pitch and height of dest */
short bx,by,bPitch; /* x,y, and pitch of background */
short viewX,viewY; /* offset/clipping viewport within destination */
short viewW,viewH;
short clipX,clipY; /* clipping rectangle within viewport */
short clipW,clipH;
dkInfoFlags dkFlags;
DXL_XIMAGE_HANDLE lXImage; /* last XImage decompressed here, useful for smart blitting */
unsigned char *clut1,*clut2;
DXL_BLIT_FORMAT blitFormat;
void *blitSetup;
void *blitter;
void *blitExit;
int vesaMode;
unsigned char *drawAddr;
short drawW,drawH;
vFlags flags;
} DXL_VSCREEN;
/* private functions */
int decodeHeader(void *data,register dxInfoStruct *dxInfo);
#define MAX_CDEPTHS DXMAX
#define MAX_BQUALITIES DXBLITMAX
typedef enum tDXL_INTERNAL_FORMAT {
DXL_NULL_IFORMAT = -1,
DXL_LINE16 = 0,
DXL_LINE16i = 1,
DXL_LINE16hi = 2,
DXL_LINE16spr = 3,
DXL_LINE8 = 4,
TM2_BLOCK24 = 5,
TM1_24 = 6,
TORQ_YUY2 = 7,
TORQ_YUY2hi = 8,
YV12 = 9,
SWET_YUV = 10,
DXL_MAX_IFORMATS
} DXL_INTERNAL_FORMAT;
DXL_BLIT_FORMAT DXL_ReserveBlitter(void);
DXL_BLIT_FORMAT DXL_OverrideBlitter(enum BLITQUALITY bq,enum BITDEPTH bd);
int DXL_RegisterBlitter(DXL_BLIT_FORMAT dFormat, DXL_INTERNAL_FORMAT ,
blitFunc blit, blitFunc setup, blitFunc exit);
blitFunc DXL_GetBlitFunc(DXL_XIMAGE_HANDLE ,DXL_VSCREEN_HANDLE );
blitFunc DXL_GetBlitSetupFunc(DXL_XIMAGE_HANDLE ,DXL_VSCREEN_HANDLE );
blitFunc DXL_GetBlitExitFunc(DXL_XIMAGE_HANDLE ,DXL_VSCREEN_HANDLE );
blitFunc DXL_GetVBlitFunc(DXL_VSCREEN_HANDLE ,DXL_VSCREEN_HANDLE );
blitFunc DXL_GetVBlitSetupFunc(DXL_VSCREEN_HANDLE ,DXL_VSCREEN_HANDLE );
blitFunc DXL_GetVBlitExitFunc(DXL_VSCREEN_HANDLE ,DXL_VSCREEN_HANDLE );
DXL_BLIT_FORMAT DXL_GetVScreenBlitFormat(DXL_VSCREEN_HANDLE );
DXL_INTERNAL_FORMAT DXL_GetXImageInternalFormat(DXL_XIMAGE_HANDLE ,DXL_VSCREEN_HANDLE );
DXL_INTERNAL_FORMAT DXL_GetVScreenInternalFormat(DXL_VSCREEN_HANDLE vScreen);
int dxl_GetAlgHandle(unsigned long fourcc);
int dxl_RegisterInternalFormat(int xHandle, DXL_INTERNAL_FORMAT xFormat);
int DXL_VScreenInfoDots(DXL_XIMAGE_HANDLE src, DXL_VSCREEN_HANDLE dst);
int DXL_GetVScreenSizeOfPixel(DXL_VSCREEN_HANDLE );
unsigned char *DXL_GetDestAddress(DXL_XIMAGE_HANDLE src, DXL_VSCREEN_HANDLE dst);
int DXL_GetXImageOffset(DXL_XIMAGE_HANDLE,int *,int *);
typedef DXL_XIMAGE_HANDLE (*createFunc)(unsigned char *data);
int DXL_RegisterXImage(createFunc creator,unsigned long fourcc,DXL_INTERNAL_FORMAT iForm);
void registerDuckBlitters(void);
void resetBlitters(void);
void dxv_logo( unsigned char *dst, int width, int height, int pitch,
enum BITDEPTH format, int dci, enum BLITQUALITY bq);
void dxl_24c(void *compaddr, void *scrnaddr,
int dstPitch,int iskeyframe,
int hinterp,int doublesize,
int scrnwidth,int scrnheight,
int blockpower, int block2x,
int forceheight, char *lastdecomp,
char *lastcdecomp);
#define DXL_MKFOURCC( ch0, ch1, ch2, ch3 ) \
( (unsigned long)(unsigned char)(ch0) | ( (unsigned long)(unsigned char)(ch1) << 8 ) | \
( (unsigned long)(unsigned char)(ch2) << 16 ) | ( (unsigned long)(unsigned char)(ch3) << 24 ) )
#if defined(__cplusplus)
}
#endif
#endif

View file

@ -0,0 +1,25 @@
#ifndef _littlend_h
#define _littlend_h
#if defined(__cplusplus)
extern "C" {
#endif
#define invert2(x) (x)
#define invert4(x) (x)
#define lowByte(x) (unsigned char)x
#define mid1Byte(x) (unsigned char)(x >> 8)
#define mid2Byte(x) (unsigned char)(x >> 16)
#define highByte(x) (unsigned char)(x >> 24)
#define SWAPENDS 0
#if defined(__cplusplus)
}
#endif
#endif

View file

@ -0,0 +1,19 @@
//==========================================================================
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
// Copyright (c) 1999 - 2001 On2 Technologies Inc. All Rights Reserved.
//
//--------------------------------------------------------------------------
#ifndef MISCASM_H
#define MISCASM_H
void CC_RGB32toYV12_MMXLU( unsigned char *RGBABuffer, int ImageWidth, int ImageHeight,
unsigned char *YBuffer, unsigned char *UBuffer, unsigned char *VBuffer );
#endif MISCASM_H

View file

@ -0,0 +1,340 @@
#ifndef _nethfb_h
#define _nethfb_h
#include "duck_hfb.h"
#ifndef NETHFB
#define lHFB_GetDataSize HFB_GetDataSize
#define lHFB_GetStreamingData HFB_GetStreamingData
#define lHFB_ReleaseStreamingData HFB_ReleaseStreamingData
#define lHFB_ReadData HFB_ReadData
#define lHFB_WhatsAhead HFB_WhatsAhead
#define lHFB_GetAudioInfo HFB_GetAudioInfo
#define lHFB_GetInitialFrames HFB_GetInitialFrames
#define lHFB_GetSamplesPerFrame HFB_GetSamplesPerFrame
#define lHFB_GetFrameRates HFB_GetFrameRates
#define lHFB_GetDRMData HFB_GetDRMData
#define lHFB_LoadIndex HFB_LoadIndex
#define lHFB_ParseFile HFB_ParseFile
#define lHFB_Init HFB_Init
#define lHFB_Exit HFB_Exit
#define lHFB_FindFile HFB_FindFile
#define lHFB_OpenFile HFB_OpenFile
#define lHFB_SeekToIndex HFB_SeekToIndex
#define lHFB_BeginLoadIndex HFB_BeginLoadIndex
#define lHFB_FinishLoadIndex HFB_FinishLoadIndex
#define lHFB_ReadMoreIndex HFB_ReadMoreIndex
#define lHFB_ParseBigIndex HFB_ParseBigIndex
#define lHFB_CloseFile HFB_CloseFile
#define lHFB_GetFileInfo HFB_GetFileInfo
#define lHFB_ResetStreams HFB_ResetStreams
#define lHFB_GetStream HFB_GetStream
#define lHFB_ReleaseStream HFB_ReleaseStream
#define lHFB_GetStreamInfo HFB_GetStreamInfo
#define lHFB_CreateBuffer HFB_CreateBuffer
#define lHFB_DestroyBuffer HFB_DestroyBuffer
#define lHFB_ResetBuffer HFB_ResetBuffer
#define lHFB_SetBufferMode HFB_SetBufferMode
#define lHFB_QueueOpenFile HFB_QueueOpenFile
#define lHFB_GetBufferPerCentFull HFB_GetBufferPerCentFull
#define lHFB_GetmovieSize HFB_GetmovieSize
#define lHFB_InitBuffer HFB_InitBuffer
#define lHFB_GetBufferSpace HFB_GetBufferSpace
#define lHFB_FillBuffer HFB_FillBuffer
#define lHFB_GetBufferStatus HFB_GetBufferStatus
#define lHFB_FramestoNextKeyFrame HFB_FramestoNextKeyFrame
#define lHFB_FrameToChunk HFB_FrameToChunk
#define lHFB_PreviousKeyFrame HFB_PreviousKeyFrame
#define lHFB_GetIndexFlags HFB_GetIndexFlags
#define lHFB_AddIndexFlags HFB_AddIndexFlags
#define lHFB_GetDataPosition HFB_GetDataPosition
#define lHFB_ConditionBuffer HFB_ConditionBuffer
#define lHFB_WalkFlags HFB_WalkFlags
#define lHFB_isVideoKeyFrame HFB_isVideoKeyFrame
#define lHFB_GetStreamParentBuffer HFB_GetStreamParentBuffer
#define lHFB_GetStreamParentFile HFB_GetStreamParentFile
#define lHFB_GetStreamRateAndScale HFB_GetStreamRateAndScale
#define lHFB_GetStreamFCCs HFB_GetStreamFCCs
#define lHFB_GetStreamSampleSize HFB_GetStreamSampleSize
#define lHFB_GetLastError HFB_GetLastError
#else
#if defined(__cplusplus)
extern "C" {
#endif
/* main HFB initialization and exit routines */
int lHFB_Init(int ,int ,int );
void lHFB_Exit(void);
/* FWG 9-13-2000 */
int lHFB_SeekToIndex(HFB_FILE_HANDLE FileHandle);
int lHFB_BeginLoadIndex(HFB_BUFFER_HANDLE dckPtr, int size);
int lHFB_FinishLoadIndex(HFB_BUFFER_HANDLE dckPtr, void *data, int size);
/* open specified file, parse its header(s) and load the index */
HFB_FILE_HANDLE lHFB_OpenFile(
const char *fileName,
HFB_BUFFER_HANDLE bufferHandle,
unsigned int userData
);
/* the following three functions, findfile, parsefile and loadindex,
are encapsulated by openfile, they are provided as a convenience
for use on systems with asynchronous i/o */
//HFB_FILE_HANDLE lHFB_FindFile(const char *fileName, unsigned int userData);
int lHFB_ParseFile(
HFB_FILE_HANDLE fileHandle,
HFB_BUFFER_HANDLE bufferHandle
);
int lHFB_LoadIndex(
HFB_FILE_HANDLE fileHandle,
HFB_BUFFER_HANDLE bufferHandle
);
void lHFB_CloseFile(HFB_FILE_HANDLE fHnd);
HFB_FILE_INFO *lHFB_GetFileInfo(HFB_FILE_HANDLE fileHandle);
HFB_BUFFER_HANDLE lHFB_CreateBuffer(
int sizeOfBuffer,
int reserved
);
void lHFB_InitBuffer(
HFB_BUFFER_HANDLE bufferHandle,
HFB_FILE_HANDLE fileToLoad,
int startFrame,
int initialReadSize
);
int lHFB_FillBuffer(
HFB_BUFFER_HANDLE bufferHandle,
int maxToRead,
int frameSyncCounter
);
void lHFB_DestroyBuffer(HFB_BUFFER_HANDLE bufferHandle);
void lHFB_ResetStreams(HFB_BUFFER_HANDLE bufferHandle);
int lHFB_SetBufferMode(
HFB_BUFFER_HANDLE ,
hfbBufferMode mode
);
int lHFB_GetBufferPerCentFull(HFB_BUFFER_HANDLE );
int lHFB_GetmovieSize(HFB_BUFFER_HANDLE );
int lHFB_GetBufferSpace(HFB_BUFFER_HANDLE );
hfbBufferStatus lHFB_GetBufferStatus(HFB_BUFFER_HANDLE );
int lHFB_ConditionBuffer(
HFB_BUFFER_HANDLE bufferHandle,
int bufferSize,
int reserved);
#define lHFB_ResetBuffer lHFB_ConditionBuffer
/* get a stream reference handle */
HFB_STREAM_HANDLE lHFB_GetStream(
HFB_FILE_HANDLE fileHandle,
const char *StreamNameOrNull,
int streamNumber,
unsigned int streamType);
/* relinquish reference to stream */
void lHFB_ReleaseStream(HFB_STREAM_HANDLE streamHandle);
/* get a pointer to stream info struct */
HFB_STREAM_INFO *lHFB_GetStreamInfo(HFB_STREAM_HANDLE );
#define lHFB_GetStreamLength(strmh) \
lHFB_GetStreamInfo(strmh)->lLength
#define lHFB_GetStreamName(strmh) \
lHFB_GetStreamInfo(strmh)->szName
/* get pointer to buffered record and length */
HFB_DATA_HANDLE lHFB_GetStreamingData(
HFB_STREAM_HANDLE streamHandle,
void **ptrToPtr,
int *ptrToLength,
hfbDirection directionToMove,
int framesToMove
);
/* release buffer space occupied by record */
void lHFB_ReleaseStreamingData(
HFB_BUFFER_HANDLE bufferHandle,
HFB_DATA_HANDLE recordToRelease);
/* read data directly from a file into a
supplied buffer, limit is set by initial value
of *ptrToLength */
int lHFB_ReadData(
HFB_STREAM_HANDLE streamHandle,
void *ptrToBuffer,
int *ptrToLength,
hfbDirection directionToMove,
int framesToMove);
int lHFB_FramestoNextKeyFrame(
HFB_STREAM_HANDLE streamHandle,
int recordHandle,
int *numberOfRecordsSpanned
);
int lHFB_FrameToChunk(
HFB_STREAM_HANDLE streamHandle,
int frameNumber
);
/* get the frameNumber of the keyframe
at or prior to the specified frameNumber */
int lHFB_PreviousKeyFrame(
HFB_STREAM_HANDLE streamHandle,
int frameNumber
);
/* get the HFB index flags for the specified record/frame */
int lHFB_GetIndexFlags(
HFB_STREAM_HANDLE ,
hfbFrameNumber frameNumberType,
int recordHandleOrFrameNumber);
/* add the HFB index flags for the specified record/frame */
int lHFB_AddIndexFlags(
HFB_STREAM_HANDLE ,
hfbFrameNumber frameNumberType,
int recordHandleOrFrameNumber,
int flagsToAdd);
/* get current data position
video - frameNumber
audio - sampleCount */
int lHFB_GetDataPosition(
HFB_STREAM_HANDLE streamHandle,
HFB_DATA_HANDLE dataRecordHandle
);
/* get information about audio stream */
DKWAVEFORM *lHFB_GetAudioInfo(
HFB_STREAM_HANDLE nStream,
int *NumChannels,
int *SamplesPerSec,
int *BytesPerSec,
int *wFormat);
/* get the amount of audio skew
expressed in records */
int lHFB_GetInitialFrames(
HFB_STREAM_HANDLE videoStream,
HFB_STREAM_HANDLE audioStream
);
/* get the number of audio frames elapsed
during a single video frame */
int lHFB_GetSamplesPerFrame(
HFB_STREAM_HANDLE videoStream,
HFB_STREAM_HANDLE audioStream
);
/* get video frame rate and
calculated audio skew (in audio samples) */
void lHFB_GetFrameRates(
HFB_STREAM_HANDLE videoStream,
HFB_STREAM_HANDLE audioStream,
int *ptrToIntegerFrameRate,
int *ptrToEstimatedAudioSampleSkew);
/* */
int lHFB_GetDRMData(
HFB_FILE_HANDLE dckPtr,
unsigned int* pOutEncFourCC,
int* pOutLength,
unsigned char** ppOutData);
/*get pointer to stream information streuct */
HFB_STREAM_INFO *lHFB_GetStreamInfo(HFB_STREAM_HANDLE );
/* functions to retrieve parent buffer
and file of a given stream*/
HFB_BUFFER_HANDLE lHFB_GetStreamParentBuffer(HFB_STREAM_HANDLE );
HFB_FILE_HANDLE lHFB_GetStreamParentFile(HFB_STREAM_HANDLE);
/* used to precisely calculate rational frame rates
for a specific stream */
void lHFB_GetStreamRateAndScale(
HFB_STREAM_HANDLE xStream,
int *rate, int *scale
);
/* get stream type and handler fourCC codes,
returns type (not handler) */
unsigned int lHFB_GetStreamFCCs(
HFB_STREAM_HANDLE xStream,
unsigned int *type,
unsigned int *handler
);
/* get the last error that occured in HFB */
int lHFB_GetLastError(
HFB_BUFFER_HANDLE bfHnd,
int* lastErrorCode,
char errorString[],
size_t maxLen
);
/* get streamSampleSize, <= 0 means variable */
int lHFB_GetStreamSampleSize(HFB_STREAM_HANDLE xStream);
int lHFB_WhatsAhead(HFB_STREAM_HANDLE ,int ,int *);
/* windows 95 dll system abstraction functions */
void lHFB_Setmalloc(
void *(*mallocFuncPtr)(unsigned int size)
);
void lHFB_Setcalloc(
void *(*callocFuncPtr)(unsigned int size, unsigned int number)
);
void lHFB_Setfree(
void (*freeFuncPtr)(void *)
);
void lHFB_Setopen(
int (*openFuncPtr)(const char *, int,...)
);
void lHFB_Setclose(
int (*closeFuncPtr)(int)
);
void lHFB_Setread(
int (*readFuncPtr)(int,void *, unsigned int)
);
void lHFB_Setseek(
int (*seekFuncPtr)(int,int,int)
);
#if defined(__cplusplus)
}
#endif
#endif
#endif

View file

@ -0,0 +1,24 @@
#if !defined(_TestResults_h)
#define _TestResults_h
#include <string.h>
#if defined(__cplusplus)
extern "C" {
#endif
typedef struct TestResults_T
{
char * results;
int testResultMaxLength;
} TestResults;
int GetTestResults( TestResults *T ,int argc, char *argv[]);
const char * GetTestHelp(void);
inline void StoreTestResult(TestResults *p, char *msg)
{
if (p)
{
sprintf(&(p->results[strlen(p->results)]),"%s",msg);
}
}
#if defined(__cplusplus)
}
#endif
#endif /* include guards */

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,148 @@
/*****************************************************************************
*
* Module tvGetStr.H
* The defines and prototypes for the ToolVox error string
* reporting module.
*
* Voxware Proprietary Material
* Copyright 1996, Voxware, Inc.
* All Rights Resrved
*
* DISTRIBUTION PROHIBITED without
* written authorization from Voxware
*
****************************************************************************/
#if (_DEBUG_MESSAGES == 1) || defined(_DEBUG)
#ifndef __TVGETSTR_H_
#define __TVGETSTR_H_
#ifdef __cplusplus
extern "C" {
#endif
/* Windows users must define VOXWARE_??? as a compiler option. This will */
/* enable system specific code. */
#if defined (VOXWARE_WIN16) || (VOXWARE_WIN32)
#define STRING_FORMAT wsprintf
#elif defined(VOXWARE_MAC)
#define STRING_FORMAT sprintf
#elif defined(VOXWARE_HP)
#define STRING_FORMAT sprintf
#elif defined(VOXWARE_SUN)
#define STRING_FORMAT sprintf
#elif defined(VOXWARE_DOS)
#define STRING_FORMAT sprintf
#else
#pragma message ("TVGETSTR.H: Platform indicator #define not setup.")
#pragma message ("TVGETSTR.H: One of the following must be initialized:")
#pragma message ("TVGETSTR.H: #define VOXWARE_WIN16")
#pragma message ("TVGETSTR.H: #define VOXWARE_WIN32")
#pragma message ("TVGETSTR.H: #define VOXWARE_MAC")
#pragma message ("TVGETSTR.H: #define VOXWARE_SUN")
#pragma message ("TVGETSTR.H: #define VOXWARE_HP")
#pragma message ("TVGETSTR.H: #define VOXWARE_AIX")
#pragma message ("TVGETSTR.H: #define VOXWARE_DOS")
#pragma message ("TVGETSTR.H: Check the Voxware manual for more information.")
#endif
#define TVGETSTR_MAX_STRING_LENGTH 512
void tvGetStringFromError(VOXWARE_RETCODE wVoxwareError, signed long dwReturnCode,
char VOX_FAR *lpMessage);
#ifdef __cplusplus
}
#endif
#endif /*__TVGETSTR_H_*/
#endif /* _DEBUG_MESSAGES */

View file

@ -0,0 +1,127 @@
/**********************************************************************
* (c) 1996 Voxware, Inc. All Rights Reserved. This file contains
* proprietary information of trade secrets of Voxware, Inc. and may
* not be distributed without the authorization of Voxware, Inc.
**********************************************************************
*
* File: VOXCHUNK.H
* Purpose: Types and #defines which describe the handling of
* the INFO chunks in the vox files.
* Created: 5/29/96 - George T. Talbot
* Modified: 6/17/96 - GTT - Added code to set lengths to -1 on
* the VOXCHUNK_SET() macro so that
* the default behaviour is to read
* existing info data.
* Notes:
*
**********************************************************************/
#ifndef _VOXCHUNK_H_
#define _VOXCHUNK_H_
typedef struct tagVox_Chunk_Info
{
unsigned long id;
long length;
char info[256];
} VOX_CHUNK_INFO;
// Important note: When adding a new VOXCHUNK_xxx, make sure to add
// the cooresponding elements to the gRIFF_VoxChunk_IDs[] and
// gAIFF_VoxChunk_IDs[] arrays in INFOCHNK.C
#define VOXCHUNK_NONE 0
#define VOXCHUNK_URL 1
#define VOXCHUNK_COPYRIGHT 2
#define VOXCHUNK_TITLE 3
#define VOXCHUNK_SOFTWARE 4
#define VOXCHUNK_AUTHOR 5
#define VOXCHUNK_COMMENT 6
#define VOXCHUNK_NUM_KINDS 7
// Convenience macros...
// Clear out a set of VOX_CHUNK_INFO records for use...
//
// Parameters are: _zz1 - Pointer to array of VOX_CHUNK_INFO.
// _zz2 - Number of elements in the array.
#define VOXCHUNK_SET(_zz1, _zz2) { \
memset((_zz1), 0, (_zz2) * sizeof(VOX_CHUNK_INFO)); \
for (short i=0; i<(_zz2); ++i) \
{ \
(_zz1)[i].length = -1; \
} \
}
// Write a C string into a VOX_CHUNK_INFO record...
//
// Parameters are: _zz1 - VOX_CHUNK_INFO record
// _zz2 - Chunk ID from above list
// _zz3 - A C string
#define VOXCHUNK_INFO(_zz1, _zz2, _zz3) \
{ \
(_zz1).id = (_zz2); \
(_zz1).length = strlen(_zz3)+1; \
memcpy((_zz1).info, (_zz3), (_zz1).length); \
}
#endif