cleanup of hv6 merge, add webm rendering
authorGood Guy <good1.2guy@gmail.com>
Wed, 16 Nov 2016 23:35:29 +0000 (16:35 -0700)
committerGood Guy <good1.2guy@gmail.com>
Wed, 16 Nov 2016 23:35:29 +0000 (16:35 -0700)
12 files changed:
cinelerra-5.1/cinelerra/batchrender.C
cinelerra-5.1/cinelerra/batchrender.h
cinelerra-5.1/cinelerra/filexml.h
cinelerra-5.1/cinelerra/mwindow.C
cinelerra-5.1/cinelerra/renderfarmclient.C
cinelerra-5.1/cinelerra/renderfarmclient.h
cinelerra-5.1/ffmpeg/audio/webm.dfl [new file with mode: 0644]
cinelerra-5.1/ffmpeg/audio/webm.webm [new file with mode: 0644]
cinelerra-5.1/ffmpeg/video/webm.dfl [new file with mode: 0644]
cinelerra-5.1/ffmpeg/video/webm.webm [new file with mode: 0644]
cinelerra-5.1/guicast/bcsignals.C
cinelerra-5.1/guicast/bcsignals.h

index 0f698f4f3595fe910f4dce4686b76534f6941310..d0714452cdfd640b4b4a24f73d8ecb682de35c09 100644 (file)
@@ -595,11 +595,21 @@ void BatchRenderThread::start_rendering(char *config_path,
        // XXX the above stuff is leaked,
 //PRINT_TRACE
 // Initialize stuff which MWindow does.
-       signals->initialize();
+       signals->initialize("/tmp/cinelerra_batch%d.dmp");
        MWindow::init_defaults(boot_defaults, config_path);
        load_defaults(boot_defaults);
        preferences = new Preferences;
        preferences->load_defaults(boot_defaults);
+       BC_Signals::set_trap_hook(trap_hook, this);
+       BC_Signals::set_catch_segv(preferences->trap_sigsegv);
+       BC_Signals::set_catch_intr(0);
+       if( preferences->trap_sigsegv ) {
+               BC_Trace::enable_locks();
+       }
+       else {
+               BC_Trace::disable_locks();
+       }
+
        MWindow::init_plugins(0, preferences);
        char font_path[BCTEXTLEN];
        strcpy(font_path, preferences->plugin_dir);
@@ -731,7 +741,16 @@ void BatchRenderThread::move_batch(int src, int dst)
        }
 }
 
-
+void BatchRenderThread::trap_hook(FILE *fp, void *vp)
+{
+       MWindow *mwindow = ((BatchRenderThread *)vp)->mwindow;
+       fprintf(fp, "\nEDL:\n");
+       mwindow->dump_edl(fp);
+       fprintf(fp, "\nUNDO:\n");
+       mwindow->dump_undo(fp);
+       fprintf(fp, "\nEXE:\n");
+       mwindow->dump_exe(fp);
+}
 
 
 
@@ -1126,16 +1145,10 @@ void BatchRenderSaveList::run()
 {
        char default_path[BCTEXTLEN];
        sprintf(default_path, "~");
-       BC_FileBox filewindow(100,
-                             100,
-                             this->thread->mwindow->defaults->get("DEFAULT_BATCHLOADPATH", default_path),
-                             _("Save Batch Render List"),
-                             _("Enter a Batch Render filename to save as:"),
-                             0,
-                             0,
-                             0,
-                             0);
-
+       BC_FileBox filewindow(100, 100,
+                       this->thread->mwindow->defaults->get("DEFAULT_BATCHLOADPATH", default_path),
+                       _("Save Batch Render List"), _("Enter a Batch Render filename to save as:"),
+                       0, 0, 0, 0);
        gui = &filewindow;
 
        startup_lock->unlock();
index 2791d0e43b7abac89e8c43f448f5118f2f2ffab3..c24eb088c909690ced7df74cb8c1453c883e5898 100644 (file)
@@ -118,6 +118,7 @@ public:
        void update_active(int number);
        void update_done(int number, int create_list, double elapsed_time);
        void move_batch(int src, int dst);
+       static void trap_hook(FILE *fp, void *vp);
 
        MWindow *mwindow;
        double current_start;
index 4cff675866c22510f115fcba962491ba5e8bb8c3..270b763df7b29bf8e7533545c954cc8552ec42cd 100644 (file)
@@ -100,7 +100,6 @@ public:
        int64_t get_property(const char *property, int64_t default_);
        float get_property(const char *property, float default_);
        double get_property(const char *property, double default_);
-       const char* get_property_text(const char *property);
 
        int set_title(const char *text);
        int set_property(const char *text, const char *value);
index 4884c641fa4383242efe4f63a9ddb7f6c4381343..9f597d27e6705b6f777dcc9bc679bce40cf105ab 100644 (file)
@@ -785,7 +785,6 @@ void MWindow::init_preferences()
        session->load_defaults(defaults);
        // set x11_host, screens, window_config
        screens = session->set_default_x11_host();
-       BC_Signals::set_trap_path("/tmp/cinelerra_%d.dmp");
        BC_Signals::set_trap_hook(trap_hook, this);
        BC_Signals::set_catch_segv(preferences->trap_sigsegv);
        BC_Signals::set_catch_intr(preferences->trap_sigintr);
@@ -1098,7 +1097,7 @@ void MWindow::init_gui()
 void MWindow::init_signals()
 {
        sighandler = new SigHandler;
-       sighandler->initialize();
+       sighandler->initialize("/tmp/cinelerra_%d.dmp");
 ENABLE_BUFFER
 }
 
index 5895710f13ffcf66737dc6ffe802853d71f88ed9..7a3507a87f0e5e988e332f202e6917669070b3a8 100644 (file)
@@ -65,7 +65,7 @@ RenderFarmClient::RenderFarmClient(int port,
        this->port = port;
        this->deamon_path = deamon_path;
        SigHandler *signals = new SigHandler;
-       signals->initialize();
+       signals->initialize("/tmp/cinelerra_farm%d.dmp");
 
        this_pid = getpid();
        (void)nice(nice_value);
@@ -75,6 +75,14 @@ RenderFarmClient::RenderFarmClient(int port,
        boot_preferences = new Preferences;
        boot_preferences->load_defaults(boot_defaults);
        MWindow::init_plugins(0, boot_preferences);
+       BC_Signals::set_catch_segv(boot_preferences->trap_sigsegv);
+       BC_Signals::set_catch_intr(0);
+        if( boot_preferences->trap_sigsegv ) {
+                BC_Trace::enable_locks();
+        }
+        else {
+                BC_Trace::disable_locks();
+        }
 
        strcpy(string, boot_preferences->plugin_dir);
        strcat(string, "/" FONT_SEARCHPATH);
@@ -86,11 +94,8 @@ RenderFarmClient::RenderFarmClient(int port,
 
 RenderFarmClient::~RenderFarmClient()
 {
-//     delete thread;
        delete boot_defaults;
        delete boot_preferences;
-       plugindb->remove_all_objects();
-       delete plugindb;
 }
 
 
@@ -157,53 +162,40 @@ void RenderFarmClient::main_loop()
        printf("RenderFarmClient::main_loop: client started\n");
        while(1)
        {
-               if(listen(socket_fd, 256) < 0)
-       {
-               perror(_("RenderFarmClient::main_loop: listen"));
-               return;
-       }
+               if(listen(socket_fd, 256) < 0) {
+                       perror(_("RenderFarmClient::main_loop: listen"));
+                       return;
+               }
 
                int new_socket_fd;
 
-
-
                if(!deamon_path)
                {
                        struct sockaddr_in clientname;
                        socklen_t size = sizeof(clientname);
-               if((new_socket_fd = accept(socket_fd,
-                               (struct sockaddr*)&clientname,
-                                               &size)) < 0)
-               {
-                       perror(_("RenderFarmClient::main_loop: accept"));
-                       return;
-               }
-                       else
-                       {
-printf("RenderFarmClient::main_loop: Session started from %s\n", inet_ntoa(clientname.sin_addr));
-                               RenderFarmClientThread *thread =
-                                       new RenderFarmClientThread(this);
-                               thread->main_loop(new_socket_fd);
+                       if( (new_socket_fd = accept(socket_fd,
+                               (struct sockaddr*)&clientname, &size) ) < 0 ) {
+                               perror(_("RenderFarmClient::main_loop: accept"));
+                               return;
                        }
+printf("RenderFarmClient::main_loop: Session started from %s\n", inet_ntoa(clientname.sin_addr));
+                       RenderFarmClientThread *thread =
+                               new RenderFarmClientThread(this);
+                       thread->main_loop(new_socket_fd);
                }
                else
                {
                        struct sockaddr_un clientname;
                        socklen_t size = sizeof(clientname);
-               if((new_socket_fd = accept(socket_fd,
-                               (struct sockaddr*)&clientname,
-                                               &size)) < 0)
-               {
-                       perror(_("RenderFarmClient::main_loop: accept"));
-                       return;
-               }
-                       else
-                       {
-printf("RenderFarmClient::main_loop: Session started from %s\n", clientname.sun_path);
-                               RenderFarmClientThread *thread =
-                                       new RenderFarmClientThread(this);
-                               thread->main_loop(new_socket_fd);
+                       if( (new_socket_fd = accept(socket_fd,
+                                       (struct sockaddr*)&clientname, &size)) < 0 ) {
+                               perror(_("RenderFarmClient::main_loop: accept"));
+                               return;
                        }
+printf("RenderFarmClient::main_loop: Session started from %s\n", clientname.sun_path);
+                       RenderFarmClientThread *thread =
+                               new RenderFarmClientThread(this);
+                       thread->main_loop(new_socket_fd);
                }
        }
 }
@@ -228,6 +220,7 @@ RenderFarmClientThread::RenderFarmClientThread(RenderFarmClient *client)
  : Thread(0, 0, 1)
 {
        this->client = client;
+       this->edl = 0;
        frames_per_second = 0;
        Thread::set_synchronous(0);
 //     fs_client = 0;
@@ -447,32 +440,19 @@ void RenderFarmClientThread::read_asset(int socket_fd, Asset *asset)
 }
 
 void RenderFarmClientThread::read_edl(int socket_fd,
-       EDL *edl,
-       Preferences *preferences)
+               EDL *edl, Preferences *preferences)
 {
        lock("RenderFarmClientThread::read_edl");
-       send_request_header(RENDERFARM_EDL,
-               0);
+       send_request_header(RENDERFARM_EDL, 0);
 
        char *string;
        read_string(string);
 
-
        FileXML file;
        file.read_from_string((char*)string);
        delete [] string;
 
-
-
-
-
-
-
-
-       edl->load_xml(&file,
-               LOAD_ALL);
-
-
+       edl->load_xml(&file, LOAD_ALL);
        unlock();
 }
 
@@ -571,8 +551,7 @@ void RenderFarmClientThread::run()
 
 // Get the pid of the fork if inside the fork
        pid = getpid();
-
-
+       BC_Signals::set_trap_hook(trap_hook, this);
 
        int socket_fd = this->socket_fd;
 
@@ -621,8 +600,6 @@ void RenderFarmClientThread::do_tuner(int socket_fd)
 
 void RenderFarmClientThread::do_packages(int socket_fd)
 {
-
-       EDL *edl;
        RenderPackage *package;
        Asset *default_asset;
        Preferences *preferences;
@@ -642,11 +619,6 @@ void RenderFarmClientThread::do_packages(int socket_fd)
        edl = new EDL;
        edl->create_objects();
 
-
-
-
-
-
 //printf("RenderFarmClientThread::run 3\n");
        read_preferences(socket_fd, preferences);
 //printf("RenderFarmClientThread::run 4\n");
@@ -656,17 +628,7 @@ void RenderFarmClientThread::do_packages(int socket_fd)
 //edl->dump();
 //printf("RenderFarmClientThread::run 6\n");
 
-
-
-
-
-
-
-
-       package_renderer.initialize(0,
-                       edl,
-                       preferences,
-                       default_asset);
+       package_renderer.initialize(0, edl, preferences, default_asset);
 
 // Read packages
        while(1)
@@ -712,16 +674,18 @@ void RenderFarmClientThread::do_packages(int socket_fd)
        default_asset->Garbage::remove_user();
 //printf("RenderFarmClientThread::run 10\n");
        edl->Garbage::remove_user();
+       edl = 0;
 //printf("RenderFarmClientThread::run 11\n");
        delete preferences;
 printf(_("RenderFarmClientThread::run: Session finished.\n"));
 }
 
-
-
-
-
-
+void RenderFarmClientThread::trap_hook(FILE *fp, void *vp)
+{
+       RenderFarmClientThread *thread = (RenderFarmClientThread*)vp;
+       fprintf(fp, "\nEDL:\n");
+       if( thread->edl ) thread->edl->dump(fp);
+}
 
 
 
@@ -758,19 +722,6 @@ void RenderFarmKeepalive::run()
 }
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
 FarmPackageRenderer::FarmPackageRenderer(RenderFarmClientThread *thread,
                int socket_fd)
  : PackageRenderer()
@@ -780,7 +731,6 @@ FarmPackageRenderer::FarmPackageRenderer(RenderFarmClientThread *thread,
 }
 
 
-
 FarmPackageRenderer::~FarmPackageRenderer()
 {
 }
@@ -857,11 +807,3 @@ int FarmPackageRenderer::set_video_map(int64_t position, int value)
 }
 
 
-
-
-
-
-
-
-
-
index 1ee7ce53c2b0518956e14b70392a219dbebafaf5..1da3893f6e6e75fd6f3e55c07bc2b3a9cf90f9e9 100644 (file)
@@ -46,14 +46,9 @@ public:
 
        void main_loop();
 
-
-
-
 // After a socket times out, kill the render node.
        void kill_client();
 
-//     RenderFarmClientThread *thread;
-
        int port;
        char *deamon_path;
 // PID to be returned to background render object
@@ -61,7 +56,6 @@ public:
 // The plugin paths must be known before any threads are started
        BC_Hash *boot_defaults;
        Preferences *boot_preferences;
-       ArrayList<PluginServer*> *plugindb;
 };
 
 class RenderFarmClientThread : public Thread
@@ -86,20 +80,16 @@ public:
 // Lock access to the socket during complete transactions
        void lock(const char *location);
        void unlock();
-
-
+       static void trap_hook(FILE *fp, void *vp);
 
        void do_tuner(int socket_fd);
        void do_packages(int socket_fd);
 
-
        void get_command(int socket_fd, int *command);
        void read_preferences(int socket_fd,
                Preferences *preferences);
        void read_asset(int socket_fd, Asset *asset);
-       void read_edl(int socket_fd,
-               EDL *edl,
-               Preferences *preferences);
+       void read_edl(int socket_fd, EDL *edl, Preferences *preferences);
        int read_package(int socket_fd, RenderPackage *package);
        int send_completion(int socket_fd);
        void ping_server();
@@ -108,6 +98,7 @@ public:
        void main_loop(int socket_fd);
        void run();
 
+       EDL *edl;
 // Everything must be contained in run()
        int socket_fd;
 // Read only
diff --git a/cinelerra-5.1/ffmpeg/audio/webm.dfl b/cinelerra-5.1/ffmpeg/audio/webm.dfl
new file mode 100644 (file)
index 0000000..d546cbf
--- /dev/null
@@ -0,0 +1 @@
+webm.webm
diff --git a/cinelerra-5.1/ffmpeg/audio/webm.webm b/cinelerra-5.1/ffmpeg/audio/webm.webm
new file mode 100644 (file)
index 0000000..d380c11
--- /dev/null
@@ -0,0 +1 @@
+webm libvorbis
diff --git a/cinelerra-5.1/ffmpeg/video/webm.dfl b/cinelerra-5.1/ffmpeg/video/webm.dfl
new file mode 100644 (file)
index 0000000..d546cbf
--- /dev/null
@@ -0,0 +1 @@
+webm.webm
diff --git a/cinelerra-5.1/ffmpeg/video/webm.webm b/cinelerra-5.1/ffmpeg/video/webm.webm
new file mode 100644 (file)
index 0000000..da4b56e
--- /dev/null
@@ -0,0 +1 @@
+webm libvpx
index e1e5aa38104a588cc42a56d5555fb103dded0bcd..2a6c8943315ab7cd1d220aef7ec4d34c5f8d60ca 100644 (file)
@@ -266,10 +266,11 @@ int BC_Signals::x_error_handler(Display *display, XErrorEvent *event)
 }
 
 
-void BC_Signals::initialize()
+void BC_Signals::initialize(const char *trap_path)
 {
        BC_Signals::global_signals = this;
        BC_Trace::global_trace = this;
+       set_trap_path(trap_path);
        handler_lock = (pthread_mutex_t*)calloc(1, sizeof(pthread_mutex_t));
        pthread_mutex_init(handler_lock, 0);
        old_err_handler = XSetErrorHandler(x_error_handler);
index 0d6d9d74bb25b8e9a7565051f7d31913e5b608dc..42fbebebcb4aa5bfbca0185f0e1b1c3487ddb708 100644 (file)
@@ -43,7 +43,7 @@ class BC_Signals : public BC_Trace
 public:
        BC_Signals();
        ~BC_Signals();
-       void initialize();
+       void initialize(const char *trap_path=0);
        void initialize2();
        void terminate();