#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <time.h>
#include "avilib.h"
#include <inttypes.h>
#include <sys/types.h>
#include "defs.h"
Go to the source code of this file.
Defines | |
#define | AVIF_COPYRIGHTED 0x00020000 |
#define | AVIF_COPYRIGHTED 0x00020000 |
#define | AVIF_HASINDEX 0x00000010 |
#define | AVIF_HASINDEX 0x00000010 |
#define | AVIF_ISINTERLEAVED 0x00000100 |
#define | AVIF_ISINTERLEAVED 0x00000100 |
#define | AVIF_MUSTUSEINDEX 0x00000020 |
#define | AVIF_MUSTUSEINDEX 0x00000020 |
#define | AVIF_TRUSTCKTYPE 0x00000800 |
#define | AVIF_TRUSTCKTYPE 0x00000800 |
#define | AVIF_WASCAPTUREFILE 0x00010000 |
#define | AVIF_WASCAPTUREFILE 0x00010000 |
#define | ERR_EXIT(x) |
#define | HEADERBYTES 2048 |
#define | INFO_LIST |
#define | MAX_INFO_STRLEN 64 |
#define | OUT4CC(s) if(nhb<=HEADERBYTES-4) memcpy(AVI_header+nhb,s,4); nhb += 4 |
#define | OUTCHR(n) |
#define | OUTLONG(n) if(nhb<=HEADERBYTES-4) long2str(AVI_header+nhb,n); nhb += 4 |
#define | OUTMEM(d, s) |
#define | OUTSHRT(n) |
#define | PACKAGE "guvcview" |
#define | PAD_EVEN(x) ( ((x)+1) & ~1 ) |
#define | S_IRGRP 00040 |
#define | S_IROTH 00004 |
#define | S_IRUSR 00400 |
#define | S_IRWXG 00070 |
#define | S_IRWXO 00007 |
#define | S_IRWXU 00700 |
#define | S_IWGRP 00020 |
#define | S_IWOTH 00002 |
#define | S_IWUSR 00200 |
#define | S_IXGRP 00010 |
#define | S_IXOTH 00001 |
#define | S_IXUSR 00100 |
#define | VERSION "0.9" |
Functions | |
static int | avi_add_chunk (struct avi_t *AVI, BYTE *tag, BYTE *data, int length) |
static int | avi_add_index_entry (struct avi_t *AVI, BYTE *tag, long flags, long pos, long len) |
int | AVI_append_audio (struct avi_t *AVI, BYTE *data, long bytes) |
ULONG | AVI_bytes_remain (struct avi_t *AVI) |
ULONG | AVI_bytes_written (struct avi_t *AVI) |
int | AVI_close (struct avi_t *AVI) |
static int | avi_close_output_file (struct avi_t *AVI) |
int | AVI_dup_frame (struct avi_t *AVI) |
int | AVI_getErrno () |
int | AVI_open_output_file (struct avi_t *AVI, const char *filename) |
void | AVI_print_error (char *str) |
static int | avi_sampsize (struct avi_t *AVI, int j) |
void | AVI_set_audio (struct avi_t *AVI, int channels, long rate, int mpgrate, int bits, int format) |
int | AVI_set_audio_track (struct avi_t *AVI, int track) |
void | AVI_set_audio_vbr (struct avi_t *AVI, long is_vbr) |
ULONG | AVI_set_MAX_LEN (ULONG len) |
void | AVI_set_video (struct avi_t *AVI, int width, int height, double fps, char *compressor) |
char * | AVI_strerror () |
static int | avi_update_header (struct avi_t *AVI) |
static ssize_t | avi_write (int fd, BYTE *buf, size_t len) |
int | AVI_write_audio (struct avi_t *AVI, BYTE *data, long bytes) |
static int | avi_write_data (struct avi_t *AVI, BYTE *data, long length, int audio, int keyframe) |
int | AVI_write_frame (struct avi_t *AVI, BYTE *data, long bytes, int keyframe) |
static void | long2str (unsigned char *dst, int n) |
static unsigned long | str2ulong (BYTE *str) |
Variables | |
long | AVI_errno = 0 |
char * | avi_errors [] |
ULONG | AVI_MAX_LEN = AVI_MAX_SIZE |
static char | error_string [4096] |
static char | id_str [MAX_INFO_STRLEN] |
static int | num_avi_errors = sizeof(avi_errors)/sizeof(char*) |
#define AVIF_COPYRIGHTED 0x00020000 |
#define AVIF_COPYRIGHTED 0x00020000 |
#define AVIF_HASINDEX 0x00000010 |
#define AVIF_HASINDEX 0x00000010 |
#define AVIF_ISINTERLEAVED 0x00000100 |
#define AVIF_ISINTERLEAVED 0x00000100 |
#define AVIF_MUSTUSEINDEX 0x00000020 |
#define AVIF_MUSTUSEINDEX 0x00000020 |
#define AVIF_TRUSTCKTYPE 0x00000800 |
#define AVIF_TRUSTCKTYPE 0x00000800 |
#define AVIF_WASCAPTUREFILE 0x00010000 |
#define AVIF_WASCAPTUREFILE 0x00010000 |
#define ERR_EXIT | ( | x | ) |
#define OUT4CC | ( | s | ) | if(nhb<=HEADERBYTES-4) memcpy(AVI_header+nhb,s,4); nhb += 4 |
#define OUTCHR | ( | n | ) |
if(nhb<=HEADERBYTES-1) { \ AVI_header[nhb ] = (n )&0xff; \ } \ nhb += 1
#define OUTLONG | ( | n | ) | if(nhb<=HEADERBYTES-4) long2str(AVI_header+nhb,n); nhb += 4 |
#define OUTMEM | ( | d, | |||
s | ) |
{ \ unsigned int s_ = (s); \ if(nhb <= HEADERBYTES-s_) \ memcpy(AVI_header+nhb, (d), s_); \ nhb += s_; \ }
#define OUTSHRT | ( | n | ) |
if(nhb<=HEADERBYTES-2) { \ AVI_header[nhb ] = (n )&0xff; \ AVI_header[nhb+1] = (n>>8)&0xff; \ } \ nhb += 2
static int avi_close_output_file | ( | struct avi_t * | AVI | ) | [static] |
int AVI_open_output_file | ( | struct avi_t * | AVI, | |
const char * | filename | |||
) |
static int avi_sampsize | ( | struct avi_t * | AVI, | |
int | j | |||
) | [static] |
void AVI_set_audio | ( | struct avi_t * | AVI, | |
int | channels, | |||
long | rate, | |||
int | mpgrate, | |||
int | bits, | |||
int | format | |||
) |
void AVI_set_audio_vbr | ( | struct avi_t * | AVI, | |
long | is_vbr | |||
) |
void AVI_set_video | ( | struct avi_t * | AVI, | |
int | width, | |||
int | height, | |||
double | fps, | |||
char * | compressor | |||
) |
static int avi_update_header | ( | struct avi_t * | AVI | ) | [static] |
static ssize_t avi_write | ( | int | fd, | |
BYTE * | buf, | |||
size_t | len | |||
) | [static] |
static void long2str | ( | unsigned char * | dst, | |
int | n | |||
) | [static] |
char* avi_errors[] |
{ "avilib - No Error", "avilib - AVI file size limit reached", "avilib - Error opening AVI file", "avilib - Error reading from AVI file", "avilib - Error writing to AVI file", "avilib - Error writing index (file may still be useable)", "avilib - Error closing AVI file", "avilib - Operation (read/write) not permitted", "avilib - Out of memory (malloc failed)", "avilib - Not an AVI file", "avilib - AVI file has no header list (corrupted?)", "avilib - AVI file has no MOVI list (corrupted?)", "avilib - AVI file has no video data", "avilib - operation needs an index", "avilib - Unkown Error" }
ULONG AVI_MAX_LEN = AVI_MAX_SIZE |
char error_string[4096] [static] |
int num_avi_errors = sizeof(avi_errors)/sizeof(char*) [static] |