~akirad/cinecutie/trunk

« back to all changes in this revision

Viewing changes to quicktime/libdv.h

  • Committer: Paolo Rampino
  • Date: 2010-02-17 19:46:21 UTC
  • Revision ID: git-v1:c39ff77ffa6ae08441c12e7d7f54e3897ddde7f1
Initial Merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef LIBDV_H
 
2
#define LIBDV_H
 
3
 
 
4
#ifdef __cplusplus
 
5
extern "C" {
 
6
#endif
 
7
 
 
8
// Buffer sizes
 
9
#define DV_NTSC_SIZE 120000
 
10
#define DV_PAL_SIZE 144000
 
11
 
 
12
// Norms
 
13
#define DV_NTSC 0
 
14
#define DV_PAL 1
 
15
 
 
16
 
 
17
#include <libdv/dv.h>
 
18
#include <pthread.h>
 
19
#include <sys/time.h>
 
20
 
 
21
typedef struct
 
22
{
 
23
        dv_decoder_t *decoder;
 
24
        dv_encoder_t *encoder;
 
25
        short *temp_audio[4];
 
26
        unsigned char *temp_video;
 
27
        int use_mmx;
 
28
        int audio_frames;
 
29
} dv_t;
 
30
 
 
31
 
 
32
// ================================== The frame decoder
 
33
dv_t* dv_new();
 
34
int dv_delete(dv_t* dv);
 
35
 
 
36
// Decode a video frame from the data and return nonzero if failure
 
37
int dv_read_video(dv_t *dv, 
 
38
                unsigned char **output_rows, 
 
39
                unsigned char *data, 
 
40
                long bytes,
 
41
                int color_model);
 
42
// Decode audio from the data and return the number of samples decoded.
 
43
int dv_read_audio(dv_t *dv, 
 
44
                unsigned char *samples,
 
45
                unsigned char *data,
 
46
                long size,
 
47
                int channels,
 
48
                int bits);
 
49
 
 
50
void dv_write_video(dv_t *dv,
 
51
                unsigned char *data,
 
52
                unsigned char **input_rows,
 
53
                int color_model,
 
54
                int norm);
 
55
 
 
56
// Write audio into frame after video is encoded.
 
57
// Returns the number of samples put in frame.
 
58
int dv_write_audio(dv_t *dv,
 
59
                unsigned char *data,
 
60
                unsigned char *input_samples,
 
61
                int max_samples,
 
62
                int channels,
 
63
                int bits,
 
64
                int rate,
 
65
                int norm);
 
66
 
 
67
 
 
68
#ifdef __cplusplus
 
69
}
 
70
#endif
 
71
 
 
72
#endif