4 * Copyright (C) 2004 Richard Baverstock
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
38 class FileDV : public FileBase
41 FileDV(Asset *asset, File *file);
44 static void get_parameters(BC_WindowBase *parent_window,
45 Asset *asset, BC_WindowBase* &format_window,
46 int audio_options, int video_options, EDL *edl);
48 int reset_parameters_derived();
49 int open_file(int rd, int wr);
51 static int check_sig(Asset *asset);
52 int close_file_derived();
54 int64_t get_video_position();
55 int64_t get_audio_position();
57 int set_video_position(int64_t x);
58 int set_audio_position(int64_t x);
60 int audio_samples_copy(double **buffer, int64_t len);
62 int write_samples(double **buffer, int64_t len);
63 int write_frames(VFrame ***frames, int len);
65 int read_compressed_frame(VFrame *buffer);
66 int write_compressed_frame(VFrame *buffers);
68 int64_t compressed_frame_size();
70 int read_samples(double *buffer, int64_t len);
71 int read_frame(VFrame *frame);
73 int colormodel_supported(int colormodel);
75 int can_copy_from(Edit *edit, int64_t position);
77 static int get_best_colormodel(Asset *asset, int driver);
79 int get_audio_frame(int64_t pos);
80 int get_audio_offset(int64_t pos);
87 Mutex *video_position_lock;
89 dv_decoder_t *decoder;
90 dv_encoder_t *encoder;
91 dv_encoder_t *audio_encoder;
93 int64_t audio_position;
94 int64_t video_position;
96 unsigned char *video_buffer;
97 unsigned char *audio_buffer;
99 int16_t **audio_sample_buffer;
100 int audio_sample_buffer_start;
101 int audio_sample_buffer_end;
102 int audio_sample_buffer_len;
103 int audio_sample_buffer_maxsize;
105 int audio_frames_written;
112 class DVConfigAudio: public BC_Window
115 DVConfigAudio(BC_WindowBase *parent_window, Asset *asset);
118 void create_objects();
123 BC_WindowBase *parent_window;
128 class DVConfigVideo: public BC_Window
131 DVConfigVideo(BC_WindowBase *parent_window, Asset *asset);
134 void create_objects();
139 BC_WindowBase *parent_window;