Merge branch 'ct' of git.pipapo.org:cinelerra-ct into ct
[cinelerra_cv/ct.git] / cinelerra / filedv.h
blob2d453a7e3cc1dd8484332fb7fb9bc004357ed665
1 #ifndef FILEDV_H
2 #define FILEDV_H
4 #include "config.h"
5 #include "filebase.h"
6 #include "file.inc"
8 #ifdef DV_USE_FFMPEG
9 #include <avcodec.h>
10 #endif
12 #include <libdv/dv.h>
15 class FileDV : public FileBase
17 public:
18 FileDV(Asset_GC asset, File *file);
19 ~FileDV();
21 static void get_parameters(BC_WindowBase *parent_window,
22 Asset_GC asset,
23 BC_WindowBase* &format_window,
24 int audio_options,
25 int video_options);
27 int reset_parameters_derived();
28 int open_file(int rd, int wr);
30 static int check_sig(Asset_GC asset);
31 int close_file_derived();
33 int64_t get_video_position();
34 int64_t get_audio_position();
36 int set_video_position(int64_t x);
37 int set_audio_position(int64_t x);
39 int audio_samples_copy(double **buffer, int64_t len);
41 int write_samples(double **buffer, int64_t len);
42 int write_frames(VFrame ***frames, int len);
44 int read_compressed_frame(VFrame *buffer);
45 int write_compressed_frame(VFrame *buffers);
47 int64_t compressed_frame_size();
49 int read_samples(double *buffer, int64_t len);
50 int read_frame(VFrame *frame);
52 int colormodel_supported(int colormodel);
54 int can_copy_from(Edit *edit, int64_t position);
56 static int get_best_colormodel(Asset_GC asset, int driver);
58 int get_audio_frame(int64_t pos);
59 int get_audio_offset(int64_t pos);
61 private:
62 FILE *stream;
64 Mutex *stream_lock;
65 Mutex *decoder_lock;
66 Mutex *video_position_lock;
68 dv_decoder_t *decoder;
69 dv_encoder_t *encoder;
70 dv_encoder_t *audio_encoder;
72 int64_t audio_position;
73 int64_t video_position;
75 unsigned char *video_buffer;
76 unsigned char *audio_buffer;
78 int16_t **audio_sample_buffer;
79 int audio_sample_buffer_start;
80 int audio_sample_buffer_end;
81 int audio_sample_buffer_len;
82 int audio_sample_buffer_maxsize;
84 int audio_frames_written;
86 int output_size;
87 int isPAL;
91 class DVConfigAudio: public BC_Window
93 public:
94 DVConfigAudio(BC_WindowBase *parent_window, Asset_GC asset);
95 ~DVConfigAudio();
97 int create_objects();
98 int close_event();
100 private:
101 Asset_GC asset;
102 BC_WindowBase *parent_window;
107 class DVConfigVideo: public BC_Window
109 public:
110 DVConfigVideo(BC_WindowBase *parent_window, Asset_GC asset);
111 ~DVConfigVideo();
113 int create_objects();
114 int close_event();
116 private:
117 Asset_GC asset;
118 BC_WindowBase *parent_window;
122 #endif
124 // Local Variables:
125 // mode: C++
126 // c-file-style: "linux"
127 // End: