repair default keyframe load, tweak init default histogram threshold
[goodguy/history.git] / cinelerra-5.1 / cinelerra / fileffmpeg.h
index aa68a77c3eb7a1df95939b903a4d2752372c7946..5453b77ca61d0f0c692484fd4c45b11d93747170 100644 (file)
@@ -1,10 +1,11 @@
 #ifndef __FILEFFMPEG_H__
 #define __FILEFFMPEG_H__
 
-#include "asset.inc" 
+#include "asset.inc"
 #include "bcdialog.h"
 #include "bcwindowbase.inc"
-#include "bitspopup.inc" 
+#include "bitspopup.inc"
+#include "edl.inc"
 #include "ffmpeg.h"
 #include "filebase.h"
 #include "fileffmpeg.inc"
@@ -31,9 +32,12 @@ public:
        static void ff_lock(const char *cp=0);
        static void ff_unlock();
 
-       static void get_parameters(BC_WindowBase *parent_window,Asset *asset,
-          BC_WindowBase *&format_window,int audio_options,int video_options);
+       static void set_options(char *cp, int len, const char *bp);
+       static void get_parameters(BC_WindowBase *parent_window,
+               Asset *asset, BC_WindowBase *&format_window,
+               int audio_options,int video_options, EDL *edl);
        static int check_sig(Asset *asset);
+       int get_best_colormodel(int driver, int vstream);
        int get_video_info(int track, int &pid, double &framerate,
                int &width, int &height, char *title=0);
        int get_audio_for_video(int vstream, int astream, int64_t &channel_mask);
@@ -45,6 +49,7 @@ public:
        int write_frames(VFrame ***frames,int len);
        int read_samples(double *buffer,int64_t len);
        int read_frame(VFrame *frame);
+       int can_scale_input() { return 1; }
        int64_t get_memory_usage(void);
        int colormodel_supported(int colormodel);
        static int get_best_colormodel(Asset *asset, int driver);
@@ -60,6 +65,7 @@ public:
         ~FFMpegConfigNum();
 
         void create_objects();
+       int update_param(const char *param, const char *opts);
         int handle_event();
         int *output;
         BC_Window *window;
@@ -85,6 +91,14 @@ public:
        int handle_event();
 };
 
+class FFMpegAudioQuality : public FFMpegAudioNum
+{
+public:
+        FFMpegAudioQuality(BC_Window *window, int x, int y, char *title_text, int *output)
+          : FFMpegAudioNum(window, x, y, title_text, output) {}
+       int handle_event();
+};
+
 class FFMpegVideoNum : public FFMpegConfigNum
 {
 public:
@@ -110,21 +124,56 @@ public:
        int handle_event();
 };
 
+class FFMpegPixFmtItems : public ArrayList<BC_ListBoxItem*>
+{
+public:
+       FFMpegPixFmtItems() {}
+       ~FFMpegPixFmtItems() { remove_all_objects(); }
+};
+
+class FFMpegPixelFormat : public BC_PopupTextBox
+{
+public:
+       FFMpegPixelFormat(FFMPEGConfigVideo *vid_config, int x, int y, int w, int list_h);
+
+        FFMPEGConfigVideo *vid_config;
+       FFMpegPixFmtItems pixfmts;
+
+       int handle_event();
+       void update_formats();
+};
+
+class FFMpegSampleFormat : public BC_PopupTextBox
+{
+public:
+       FFMpegSampleFormat(FFMPEGConfigAudio *aud_config, int x, int y, int w, int list_h);
+
+        FFMPEGConfigAudio *aud_config;
+       ArrayList<BC_ListBoxItem*> samplefmts;
+
+       int handle_event();
+       void update_formats();
+};
+
 class FFMPEGConfigAudio : public BC_Window
 {
 public:
-       FFMPEGConfigAudio(BC_WindowBase *parent_window, Asset *asset);
+       FFMPEGConfigAudio(BC_WindowBase *parent_window, Asset *asset, EDL *edl);
        ~FFMPEGConfigAudio();
 
        void create_objects();
        int close_event();
+       void load_options();
 
+       FFMpegSampleFormat *sample_format;
        ArrayList<BC_ListBoxItem*> presets;
        FFMPEGConfigAudioPopup *preset_popup;
        FFMpegAudioBitrate *bitrate;
+       FFMpegAudioQuality *quality;
        FFAudioOptions *audio_options;
        BC_WindowBase *parent_window;
        Asset *asset;
+       EDL *edl;
        FFOptionsDialog *ff_options_dialog;
 };
 
@@ -133,7 +182,6 @@ class FFAudioOptions : public BC_ScrollTextBox
 public:
        FFAudioOptions(FFMPEGConfigAudio *audio_popup,
                int x, int y, int w, int rows, int size, char *text);
-       int handle_event();
 
        FFMPEGConfigAudio *audio_popup;
 };
@@ -161,12 +209,14 @@ public:
 class FFMPEGConfigVideo : public BC_Window
 {
 public:
-       FFMPEGConfigVideo(BC_WindowBase *parent_window, Asset *asset);
+       FFMPEGConfigVideo(BC_WindowBase *parent_window, Asset *asset, EDL *edl);
        ~FFMPEGConfigVideo();
 
        void create_objects();
        int close_event();
+       void load_options();
 
+       FFMpegPixelFormat *pixel_format;
        ArrayList<BC_ListBoxItem*> presets;
        FFMPEGConfigVideoPopup *preset_popup;
        BC_WindowBase *parent_window;
@@ -174,6 +224,7 @@ public:
        FFMpegVideoQuality *quality;
        FFVideoOptions *video_options;
        Asset *asset;
+       EDL *edl;
        FFOptionsDialog *ff_options_dialog;
 };
 
@@ -182,7 +233,6 @@ class FFVideoOptions : public BC_ScrollTextBox
 public:
        FFVideoOptions(FFMPEGConfigVideo *video_popup,
                int x, int y, int w, int rows, int size, char *text);
-       int handle_event();
 
        FFMPEGConfigVideo *video_popup;
 };