fix for F_sine segv, bunch of intl fixes
[goodguy/history.git] / cinelerra-5.1 / cinelerra / libdv.h
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 #define CODEC_TAG_DVSD "dvsd"
12
13 // Norms
14 #define DV_NTSC 0
15 #define DV_PAL 1
16
17
18 #include <libdv/dv.h>
19 #include <pthread.h>
20 #include <sys/time.h>
21
22 typedef struct
23 {
24         dv_decoder_t *decoder;
25         dv_encoder_t *encoder;
26         short *temp_audio[4];
27         unsigned char *temp_video;
28         int use_mmx;
29         int audio_frames;
30 } dv_t;
31
32
33 // ================================== The frame decoder
34 dv_t* dv_new();
35 int dv_delete(dv_t* dv);
36
37 // Decode a video frame from the data and return nonzero if failure
38 int dv_read_video(dv_t *dv,
39                 unsigned char **output_rows,
40                 unsigned char *data,
41                 long bytes,
42                 int color_model);
43 // Decode audio from the data and return the number of samples decoded.
44 int dv_read_audio(dv_t *dv,
45                 unsigned char *samples,
46                 unsigned char *data,
47                 long size,
48                 int channels,
49                 int bits);
50
51 void dv_write_video(dv_t *dv,
52                 unsigned char *data,
53                 unsigned char **input_rows,
54                 int color_model,
55                 int norm);
56
57 // Write audio into frame after video is encoded.
58 // Returns the number of samples put in frame.
59 int dv_write_audio(dv_t *dv,
60                 unsigned char *data,
61                 unsigned char *input_samples,
62                 int max_samples,
63                 int channels,
64                 int bits,
65                 int rate,
66                 int norm);
67
68
69 #ifdef __cplusplus
70 }
71 #endif
72
73 #endif