#ifdef HAS_AVC_SUPPORT
#define HAVE_LIBDV
#ifndef _FRAME_H
#define _FRAME_H 1
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <time.h>
#include <string>
using std::string;
#include <libdv/dv.h>
#include <libdv/dv_types.h>
#define DV_AUDIO_MAX_SAMPLES 1944
#define FRAME_MAX_WIDTH 720
#define FRAME_MAX_HEIGHT 576
namespace avcap
{
typedef struct Pack
{
unsigned char data[ 5 ];
}
Pack;
typedef struct TimeCode
{
int hour;
int min;
int sec;
int frame;
}
TimeCode;
typedef struct AudioInfo
{
int frames;
int frequency;
int samples;
int channels;
int quantization;
}
AudioInfo;
class VideoInfo
{
public:
int width;
int height;
bool isPAL;
TimeCode timeCode;
struct tm recDate;
VideoInfo();
}
;
class Frame
{
public:
unsigned char data[ 144000 ];
int bytesInFrame;
#ifdef HAVE_LIBDV
dv_decoder_t *decoder;
#endif
int16_t *audio_buffers[ 4 ];
public:
Frame();
~Frame();
bool GetSSYBPack( int packNum, Pack &pack ) const;
bool GetVAUXPack( int packNum, Pack &pack ) const;
bool GetAAUXPack( int packNum, Pack &pack ) const;
bool GetTimeCode( TimeCode &timeCode ) const;
bool GetRecordingDate( struct tm &recDate ) const;
string GetRecordingDate( void ) const;
bool GetAudioInfo( AudioInfo &info ) const;
bool GetVideoInfo( VideoInfo &info ) const;
int GetFrameSize( void ) const;
float GetFrameRate() const;
bool IsPAL( void ) const;
bool IsNewRecording( void ) const;
bool IsNormalSpeed() const;
bool IsComplete( void ) const;
int ExtractAudio( void *sound ) const;
void ExtractHeader( void );
#ifdef HAVE_LIBDV
void SetPreferredQuality( );
int ExtractAudio( int16_t **channels ) const;
int ExtractRGB( void *rgb );
int ExtractPreviewRGB( void *rgb );
int ExtractYUV( void *yuv );
int ExtractPreviewYUV( void *yuv );
bool IsWide( void ) const;
int GetWidth();
int GetHeight();
void SetRecordingDate( time_t *datetime, int frame );
void SetTimeCode( int frame );
#endif
void Deinterlace( void *image, int bpp );
private:
#ifndef HAVE_LIBDV
static bool maps_initialized;
static int palmap_ch1[ 2000 ];
static int palmap_ch2[ 2000 ];
static int palmap_2ch1[ 2000 ];
static int palmap_2ch2[ 2000 ];
static int ntscmap_ch1[ 2000 ];
static int ntscmap_ch2[ 2000 ];
static int ntscmap_2ch1[ 2000 ];
static int ntscmap_2ch2[ 2000 ];
static short compmap[ 4096 ];
#endif
};
}
#endif
#endif