Merge branch 'ct' of git.pipapo.org:cinelerra-ct into ct
[cinelerra_cv/ct.git] / quicktime / libdv.h
blob1d1dbd16702e6924af53048fe178d79d7caed506
1 #ifndef LIBDV_H
2 #define LIBDV_H
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
8 // Buffer sizes
9 #define DV_NTSC_SIZE 120000
10 #define DV_PAL_SIZE 144000
12 // Norms
13 #define DV_NTSC 0
14 #define DV_PAL 1
17 #include <libdv/dv.h>
18 #include <pthread.h>
19 #include <sys/time.h>
21 typedef struct
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;
32 // ================================== The frame decoder
33 dv_t* dv_new();
34 int dv_delete(dv_t* dv);
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);
50 void dv_write_video(dv_t *dv,
51 unsigned char *data,
52 unsigned char **input_rows,
53 int color_model,
54 int norm);
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);
68 #ifdef __cplusplus
70 #endif
72 #endif