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
27 #include "../config.h"
38 class FileDV : public FileBase
41 FileDV(Asset *asset, File *file);
44 static void get_parameters(BC_WindowBase *parent_window,
46 BC_WindowBase* &format_window,
50 int reset_parameters_derived();
51 int open_file(int rd, int wr);
53 static int check_sig(Asset *asset);
54 int close_file_derived();
56 int64_t get_video_position();
57 int64_t get_audio_position();
59 int set_video_position(int64_t x);
60 int set_audio_position(int64_t x);
62 int audio_samples_copy(double **buffer, int64_t len);
64 int write_samples(double **buffer, int64_t len);
65 int write_frames(VFrame ***frames, int len);
67 int read_compressed_frame(VFrame *buffer);
68 int write_compressed_frame(VFrame *buffers);
70 int64_t compressed_frame_size();
72 int read_samples(double *buffer, int64_t len);
73 int read_frame(VFrame *frame);
75 int colormodel_supported(int colormodel);
77 int can_copy_from(Edit *edit, int64_t position);
79 static int get_best_colormodel(Asset *asset, int driver);
81 int get_audio_frame(int64_t pos);
82 int get_audio_offset(int64_t pos);
89 Mutex *video_position_lock;
91 dv_decoder_t *decoder;
92 dv_encoder_t *encoder;
93 dv_encoder_t *audio_encoder;
95 int64_t audio_position;
96 int64_t video_position;
98 unsigned char *video_buffer;
99 unsigned char *audio_buffer;
101 int16_t **audio_sample_buffer;
102 int audio_sample_buffer_start;
103 int audio_sample_buffer_end;
104 int audio_sample_buffer_len;
105 int audio_sample_buffer_maxsize;
107 int audio_frames_written;
114 class DVConfigAudio: public BC_Window
117 DVConfigAudio(BC_WindowBase *parent_window, Asset *asset);
120 void create_objects();
125 BC_WindowBase *parent_window;
130 class DVConfigVideo: public BC_Window
133 DVConfigVideo(BC_WindowBase *parent_window, Asset *asset);
136 void create_objects();
141 BC_WindowBase *parent_window;