initial commit
[goodguy/history.git] / cinelerra-5.0 / cinelerra / fileffmpeg.h
1 #ifndef __FILEFFMPEG_H__
2 #define __FILEFFMPEG_H__
3
4 #include "asset.inc" 
5 #include "bcwindowbase.inc"
6 #include "bitspopup.inc" 
7 #include "filebase.h"
8 #include "fileffmpeg.inc"
9 #include "mwindow.inc"
10 #include "mutex.h"
11 #include "vframe.inc"
12
13 #include <stdio.h>
14 #include <stdint.h>
15 #include <stdlib.h>
16 #include <unistd.h>
17 #include <string.h>
18
19
20 class FileFFMPEG : public FileBase
21 {
22 public:
23         FFMPEG *ff;
24
25         FileFFMPEG(Asset *asset, File *file);
26         ~FileFFMPEG();
27         static void ff_lock(const char *cp=0);
28         static void ff_unlock();
29
30         static void get_parameters(BC_WindowBase *parent_window,Asset *asset,
31            BC_WindowBase *&format_window,int audio_options,int video_options);
32         static int check_sig(Asset *asset);
33         int get_video_info(int track, int &pid, double &framerate,
34                 int &width, int &height, char *title=0);
35         int get_audio_for_video(int vstream, int astream, int64_t &channel_mask);
36         static void get_info(char *path,char *text);
37         int open_file(int rd,int wr);
38         int close_file(void);
39         int set_video_position(int64_t pos);
40         int set_audio_position(int64_t pos);
41         int write_samples(double **buffer,int64_t len);
42         int write_frames(VFrame ***frames,int len);
43         int read_samples(double *buffer,int64_t len);
44         int read_frame(VFrame *frame);
45         int64_t get_memory_usage(void);
46         int colormodel_supported(int colormodel);
47         int get_best_colormodel(Asset *asset,int driver);
48         int select_video_stream(Asset *asset, int vstream);
49         int select_audio_stream(Asset *asset, int astream);
50 };
51
52
53 class FFMPEGConfigAudio : public BC_Window
54 {
55 public:
56         FFMPEGConfigAudio(BC_WindowBase *parent_window, Asset *asset);
57         ~FFMPEGConfigAudio();
58
59         void create_objects();
60         int close_event();
61
62         ArrayList<BC_ListBoxItem*> presets;
63         FFMPEGConfigAudioPopup *preset_popup;
64         BC_WindowBase *parent_window;
65         Asset *asset;
66 };
67
68
69 class FFMPEGConfigAudioPopup : public BC_PopupTextBox
70 {
71 public:
72         FFMPEGConfigAudioPopup(FFMPEGConfigAudio *popup, int x, int y);
73         int handle_event();
74         FFMPEGConfigAudio *popup;
75 };
76
77
78 class FFMPEGConfigAudioToggle : public BC_CheckBox
79 {
80 public:
81         FFMPEGConfigAudioToggle(FFMPEGConfigAudio *popup,
82                 char *title_text, int x, int y, int *output);
83         int handle_event();
84         int *output;
85         FFMPEGConfigAudio *popup;
86 };
87
88 class FFMPEGConfigVideo : public BC_Window
89 {
90 public:
91         FFMPEGConfigVideo(BC_WindowBase *parent_window, Asset *asset);
92         ~FFMPEGConfigVideo();
93
94         void create_objects();
95         int close_event();
96
97         ArrayList<BC_ListBoxItem*> presets;
98         FFMPEGConfigVideoPopup *preset_popup;
99         BC_WindowBase *parent_window;
100         Asset *asset;
101 };
102
103 class FFMPEGConfigVideoPopup : public BC_PopupTextBox
104 {
105 public:
106         FFMPEGConfigVideoPopup(FFMPEGConfigVideo *popup, int x, int y);
107         int handle_event();
108         FFMPEGConfigVideo *popup;
109 };
110
111 class FFMPEGConfigVideoToggle : public BC_CheckBox
112 {
113 public:
114         FFMPEGConfigVideoToggle(FFMPEGConfigVideo *popup,
115                 char *title_text, int x, int y, int *output);
116         int handle_event();
117         int *output;
118         FFMPEGConfigVideo *popup;
119 };
120
121 #endif