1 #ifndef __FILEFFMPEG_H__
2 #define __FILEFFMPEG_H__
5 #include "bcwindowbase.inc"
6 #include "bitspopup.inc"
8 #include "fileffmpeg.inc"
20 class FFMpegConfigNum;
25 class FFMPEGConfigAudio;
27 class FFMPEGConfigAudioPopup;
28 class FFMPEGConfigAudioToggle;
29 class FFMPEGConfigVideo;
31 class FFMPEGConfigVideoPopup;
32 class FFMPEGConfigVideoToggle;
34 class FileFFMPEG : public FileBase
39 FileFFMPEG(Asset *asset, File *file);
41 static void ff_lock(const char *cp=0);
42 static void ff_unlock();
44 static void get_parameters(BC_WindowBase *parent_window,Asset *asset,
45 BC_WindowBase *&format_window,int audio_options,int video_options);
46 static int check_sig(Asset *asset);
47 int get_video_info(int track, int &pid, double &framerate,
48 int &width, int &height, char *title=0);
49 int get_audio_for_video(int vstream, int astream, int64_t &channel_mask);
50 static void get_info(char *path,char *text);
51 int open_file(int rd,int wr);
53 int set_video_position(int64_t pos);
54 int set_audio_position(int64_t pos);
55 int write_samples(double **buffer,int64_t len);
56 int write_frames(VFrame ***frames,int len);
57 int read_samples(double *buffer,int64_t len);
58 int read_frame(VFrame *frame);
59 int64_t get_memory_usage(void);
60 int colormodel_supported(int colormodel);
61 int get_best_colormodel(Asset *asset,int driver);
62 int select_video_stream(Asset *asset, int vstream);
63 int select_audio_stream(Asset *asset, int astream);
66 class FFMpegConfigNum : public BC_TumbleTextBox
69 FFMpegConfigNum(BC_Window *window, int x, int y,
70 char *title_text, int *output);
73 void create_objects();
82 class FFMpegAudioNum : public FFMpegConfigNum
85 FFMpegAudioNum(BC_Window *window, int x, int y, char *title_text, int *output);
88 FFMPEGConfigAudio *window() { return (FFMPEGConfigAudio *)FFMpegConfigNum::window; }
91 class FFMpegAudioBitrate : public FFMpegAudioNum
94 FFMpegAudioBitrate(BC_Window *window, int x, int y, char *title_text, int *output)
95 : FFMpegAudioNum(window, x, y, title_text, output) {}
99 class FFMpegVideoNum : public FFMpegConfigNum
102 FFMpegVideoNum(BC_Window *window, int x, int y, char *title_text, int *output);
105 FFMPEGConfigVideo *window() { return (FFMPEGConfigVideo *)FFMpegConfigNum::window; }
108 class FFMpegVideoBitrate : public FFMpegVideoNum
111 FFMpegVideoBitrate(BC_Window *window, int x, int y, char *title_text, int *output)
112 : FFMpegVideoNum(window, x, y, title_text, output) {}
116 class FFMpegVideoQuality : public FFMpegVideoNum
119 FFMpegVideoQuality(BC_Window *window, int x, int y, char *title_text, int *output)
120 : FFMpegVideoNum(window, x, y, title_text, output) {}
124 class FFMPEGConfigAudio : public BC_Window
127 FFMPEGConfigAudio(BC_WindowBase *parent_window, Asset *asset);
128 ~FFMPEGConfigAudio();
130 void create_objects();
133 ArrayList<BC_ListBoxItem*> presets;
134 FFMPEGConfigAudioPopup *preset_popup;
135 FFMpegAudioBitrate *bitrate;
136 FFAudioOptions *audio_options;
137 BC_WindowBase *parent_window;
141 class FFAudioOptions : public BC_TextBox
144 FFAudioOptions(FFMPEGConfigAudio *audio_popup,
145 int x, int y, int w, int rows, int size, char *text);
148 FFMPEGConfigAudio *audio_popup;
152 class FFMPEGConfigAudioPopup : public BC_PopupTextBox
155 FFMPEGConfigAudioPopup(FFMPEGConfigAudio *popup, int x, int y);
157 FFMPEGConfigAudio *popup;
161 class FFMPEGConfigAudioToggle : public BC_CheckBox
164 FFMPEGConfigAudioToggle(FFMPEGConfigAudio *popup,
165 char *title_text, int x, int y, int *output);
168 FFMPEGConfigAudio *popup;
171 class FFMPEGConfigVideo : public BC_Window
174 FFMPEGConfigVideo(BC_WindowBase *parent_window, Asset *asset);
175 ~FFMPEGConfigVideo();
177 void create_objects();
180 ArrayList<BC_ListBoxItem*> presets;
181 FFMPEGConfigVideoPopup *preset_popup;
182 BC_WindowBase *parent_window;
183 FFMpegVideoBitrate *bitrate;
184 FFMpegVideoQuality *quality;
185 FFVideoOptions *video_options;
189 class FFVideoOptions : public BC_TextBox
192 FFVideoOptions(FFMPEGConfigVideo *video_popup,
193 int x, int y, int w, int rows, int size, char *text);
196 FFMPEGConfigVideo *video_popup;
199 class FFMPEGConfigVideoPopup : public BC_PopupTextBox
202 FFMPEGConfigVideoPopup(FFMPEGConfigVideo *popup, int x, int y);
204 FFMPEGConfigVideo *popup;
207 class FFMPEGConfigVideoToggle : public BC_CheckBox
210 FFMPEGConfigVideoToggle(FFMPEGConfigVideo *popup,
211 char *title_text, int x, int y, int *output);
214 FFMPEGConfigVideo *popup;