From: Good Guy Date: Thu, 21 Dec 2017 16:03:18 +0000 (-0700) Subject: add grabshot, move snapshot, asset update mtime, plugins.txt for ffmpeg 3.4.1 X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=be678a5c5c4ec7dd15b9f49e4f476375f98649e0;p=goodguy%2Fhistory.git add grabshot, move snapshot, asset update mtime, plugins.txt for ffmpeg 3.4.1 --- diff --git a/cinelerra-5.1/cinelerra/assetpopup.C b/cinelerra-5.1/cinelerra/assetpopup.C index 677b8bab..bb0e2a33 100644 --- a/cinelerra-5.1/cinelerra/assetpopup.C +++ b/cinelerra-5.1/cinelerra/assetpopup.C @@ -23,16 +23,20 @@ #include "assetedit.h" #include "assetpopup.h" #include "assetremove.h" +#include "assets.h" #include "awindow.h" #include "awindowgui.h" +#include "bccapture.h" #include "bcdisplayinfo.h" #include "bcsignals.h" +#include "cache.h" #include "clipedit.h" #include "cstrdup.h" #include "cwindow.h" #include "cwindowgui.h" #include "edl.h" #include "edlsession.h" +#include "file.h" #include "filexml.h" #include "language.h" #include "localsession.h" @@ -41,7 +45,12 @@ #include "mainsession.h" #include "mwindow.h" #include "mwindowgui.h" +#include "preferences.h" +#include "renderengine.h" #include "tracks.h" +#include "transportque.h" +#include "vframe.h" +#include "vrender.h" #include "vwindow.h" #include "vwindowgui.h" #include "zwindow.h" @@ -433,6 +442,10 @@ AssetListMenu::AssetListMenu(MWindow *mwindow, AWindowGUI *gui) AssetListMenu::~AssetListMenu() { + if( !shots_displayed ) { + delete asset_snapshot; + delete asset_grabshot; + } } void AssetListMenu::create_objects() @@ -441,12 +454,34 @@ void AssetListMenu::create_objects() add_item(new AWindowListSort(mwindow, gui)); add_item(new AssetListCopy(mwindow, gui)); add_item(new AssetListPaste(mwindow, gui)); - update_titles(); -} - -void AssetListMenu::update_titles() + SnapshotSubMenu *snapshot_submenu; + add_item(asset_snapshot = new AssetSnapshot(mwindow, this)); + asset_snapshot->add_submenu(snapshot_submenu = new SnapshotSubMenu(asset_snapshot)); + snapshot_submenu->add_submenuitem(new SnapshotMenuItem(snapshot_submenu, _("png"), SNAPSHOT_PNG)); + snapshot_submenu->add_submenuitem(new SnapshotMenuItem(snapshot_submenu, _("jpeg"), SNAPSHOT_JPEG)); + snapshot_submenu->add_submenuitem(new SnapshotMenuItem(snapshot_submenu, _("tiff"), SNAPSHOT_TIFF)); + GrabshotSubMenu *grabshot_submenu; + add_item(asset_grabshot = new AssetGrabshot(mwindow, this)); + asset_grabshot->add_submenu(grabshot_submenu = new GrabshotSubMenu(asset_grabshot)); + grabshot_submenu->add_submenuitem(new GrabshotMenuItem(grabshot_submenu, _("png"), GRABSHOT_PNG)); + grabshot_submenu->add_submenuitem(new GrabshotMenuItem(grabshot_submenu, _("jpeg"), GRABSHOT_JPEG)); + grabshot_submenu->add_submenuitem(new GrabshotMenuItem(grabshot_submenu, _("tiff"), GRABSHOT_TIFF)); + update_titles(shots_displayed = 1); +} + +void AssetListMenu::update_titles(int shots) { format->update(); + if( shots && !shots_displayed ) { + shots_displayed = 1; + add_item(asset_snapshot); + add_item(asset_grabshot); + } + else if( !shots && shots_displayed ) { + shots_displayed = 0; + remove_item(asset_snapshot); + remove_item(asset_grabshot); + } } AssetListCopy::AssetListCopy(MWindow *mwindow, AWindowGUI *gui) @@ -701,3 +736,367 @@ int AssetPasteWindow::resize_event(int w, int h) return 0; } + + +AssetSnapshot::AssetSnapshot(MWindow *mwindow, AssetListMenu *asset_list_menu) + : BC_MenuItem(_("Snapshot...")) +{ + this->mwindow = mwindow; + this->asset_list_menu = asset_list_menu; +} + +AssetSnapshot::~AssetSnapshot() +{ +} + +SnapshotSubMenu::SnapshotSubMenu(AssetSnapshot *asset_snapshot) +{ + this->asset_snapshot = asset_snapshot; +} + +SnapshotSubMenu::~SnapshotSubMenu() +{ +} + +SnapshotMenuItem::SnapshotMenuItem(SnapshotSubMenu *submenu, const char *text, int mode) + : BC_MenuItem(text) +{ + this->submenu = submenu; + this->mode = mode; +} + +SnapshotMenuItem::~SnapshotMenuItem() +{ +} + +int SnapshotMenuItem::handle_event() +{ + MWindow *mwindow = submenu->asset_snapshot->mwindow; + EDL *edl = mwindow->edl; + if( !edl->have_video() ) return 1; + + Preferences *preferences = mwindow->preferences; + char filename[BCTEXTLEN]; + static const char *exts[] = { "png", "jpg", "tif" }; + time_t tt; time(&tt); + struct tm tm; localtime_r(&tt,&tm); + snprintf(filename,sizeof(filename),"%s/%s_%04d%02d%02d-%02d%02d%02d.%s", + preferences->snapshot_path, _("snap"), + 1900+tm.tm_year,1+tm.tm_mon,tm.tm_mday, + tm.tm_hour,tm.tm_min,tm.tm_sec, exts[mode]); + int fw = edl->get_w(), fh = edl->get_h(); + int fcolor_model = edl->session->color_model; + + Asset *asset = new Asset(filename); + switch( mode ) { + case SNAPSHOT_PNG: + asset->format = FILE_PNG; + asset->png_use_alpha = 1; + break; + case SNAPSHOT_JPEG: + asset->format = FILE_JPEG; + asset->jpeg_quality = 90; + break; + case SNAPSHOT_TIFF: + asset->format = FILE_TIFF; + asset->tiff_cmodel = 0; + asset->tiff_compression = 0; + break; + } + asset->width = fw; + asset->height = fh; + asset->audio_data = 0; + asset->video_data = 1; + asset->video_length = 1; + asset->layers = 1; + + File file; + int processors = preferences->project_smp + 1; + if( processors > 8 ) processors = 8; + file.set_processors(processors); + int ret = file.open_file(preferences, asset, 0, 1); + if( !ret ) { + file.start_video_thread(1, fcolor_model, + processors > 1 ? 2 : 1, 0); + VFrame ***frames = file.get_video_buffer(); + VFrame *frame = frames[0][0]; + TransportCommand command; + //command.command = audio_tracks ? NORMAL_FWD : CURRENT_FRAME; + command.command = CURRENT_FRAME; + command.get_edl()->copy_all(edl); + command.change_type = CHANGE_ALL; + command.realtime = 0; + + RenderEngine render_engine(0, preferences, 0, 0); + CICache video_cache(preferences); + render_engine.set_vcache(&video_cache); + render_engine.arm_command(&command); + + double position = edl->local_session->get_selectionstart(1); + int64_t source_position = (int64_t)(position * edl->get_frame_rate()); + ret = render_engine.vrender->process_buffer(frame, source_position, 0); + if( !ret ) + ret = file.write_video_buffer(1); + file.close_file(); + } + if( !ret ) { + asset->awindow_folder = AW_MEDIA_FOLDER; + mwindow->edl->assets->append(asset); + mwindow->awindow->gui->async_update_assets(); + } + else { + eprintf(_("snapshot render failed")); + asset->remove_user(); + } + return 1; +} + + +AssetGrabshot::AssetGrabshot(MWindow *mwindow, AssetListMenu *asset_list_menu) + : BC_MenuItem(_("Grabshot...")) +{ + this->mwindow = mwindow; + this->asset_list_menu = asset_list_menu; +} + +AssetGrabshot::~AssetGrabshot() +{ +} + +GrabshotSubMenu::GrabshotSubMenu(AssetGrabshot *asset_grabshot) +{ + this->asset_grabshot = asset_grabshot; +} + +GrabshotSubMenu::~GrabshotSubMenu() +{ +} + +GrabshotMenuItem::GrabshotMenuItem(GrabshotSubMenu *submenu, const char *text, int mode) + : BC_MenuItem(text) +{ + this->submenu = submenu; + this->mode = mode; + grab_thread = 0; +} + +GrabshotMenuItem::~GrabshotMenuItem() +{ + delete grab_thread; +} + +int GrabshotMenuItem::handle_event() +{ + if( !grab_thread ) + grab_thread = new GrabshotThread(submenu->asset_grabshot->mwindow); + if( !grab_thread->running() ) + grab_thread->start(this); + return 1; +} + +GrabshotThread::GrabshotThread(MWindow *mwindow) + : Thread(1, 0, 0) +{ + this->mwindow = mwindow; + popup = 0; + done = -1; +} +GrabshotThread::~GrabshotThread() +{ + delete popup; +} + +void GrabshotThread::start(GrabshotMenuItem *menu_item) +{ + popup = new GrabshotPopup(this, menu_item->mode); + popup->lock_window("GrabshotThread::start"); + for( int i=0; i<4; ++i ) + edge[i] = new BC_Popup(mwindow->gui, 0,0, 1,1, ORANGE, 1); + mwindow->gui->grab_buttons(); + mwindow->gui->grab_cursor(); + popup->grab(mwindow->gui); + popup->create_objects(); + popup->show_window(); + popup->unlock_window(); + done = 0; + Thread::start(); +} + +void GrabshotThread::run() +{ + popup->lock_window("GrabshotThread::run 0"); + while( !done ) { + popup->update(); + popup->unlock_window(); + enable_cancel(); + Timer::delay(200); + disable_cancel(); + popup->lock_window("GrabshotThread::run 1"); + } + mwindow->gui->ungrab_cursor(); + mwindow->gui->ungrab_buttons(); + popup->ungrab(mwindow->gui); + for( int i=0; i<4; ++i ) delete edge[i]; + popup->unlock_window(); + delete popup; popup = 0; +} + +GrabshotPopup::GrabshotPopup(GrabshotThread *grab_thread, int mode) + : BC_Popup(grab_thread->mwindow->gui, 0,0, 16,16, -1,1) +{ + this->grab_thread = grab_thread; + this->mode = mode; + dragging = -1; + grab_color = ORANGE; + x0 = y0 = x1 = y1 = -1; + lx0 = ly0 = lx1 = ly1 = -1; +} +GrabshotPopup::~GrabshotPopup() +{ +} + +int GrabshotPopup::grab_event(XEvent *event) +{ + int cur_drag = dragging; + switch( event->type ) { + case ButtonPress: + if( cur_drag > 0 ) return 1; + x0 = event->xbutton.x_root; + y0 = event->xbutton.y_root; + if( !cur_drag ) { + draw_selection(-1); + if( event->xbutton.button == RIGHT_BUTTON ) break; + if( x0>=get_x() && x0=get_y() && y0 0 ) { + x1 = event->xbutton.x_root; + y1 = event->xbutton.y_root; + draw_selection(0); + } + return 1; + default: + return 0; + } + + int cx = lx0, cy = ly0; + int cw = lx1-lx0, ch = ly1-ly0; + hide_window(); + sync_display(); + + MWindow *mwindow = grab_thread->mwindow; + Preferences *preferences = mwindow->preferences; + char filename[BCTEXTLEN]; + static const char *exts[] = { "png", "jpg", "tif" }; + time_t tt; time(&tt); + struct tm tm; localtime_r(&tt,&tm); + snprintf(filename,sizeof(filename),"%s/%s_%04d%02d%02d-%02d%02d%02d.%s", + preferences->snapshot_path, _("grab"), + 1900+tm.tm_year,1+tm.tm_mon,tm.tm_mday, + tm.tm_hour,tm.tm_min,tm.tm_sec, exts[mode]); + + Asset *asset = new Asset(filename); + switch( mode ) { + case SNAPSHOT_PNG: + asset->format = FILE_PNG; + asset->png_use_alpha = 1; + break; + case SNAPSHOT_JPEG: + asset->format = FILE_JPEG; + asset->jpeg_quality = 90; + break; + case SNAPSHOT_TIFF: + asset->format = FILE_TIFF; + asset->tiff_cmodel = 0; + asset->tiff_compression = 0; + break; + } +// no odd dimensions + int rw = get_root_w(0), rh = get_root_h(0); + if( cx < 0 ) { cw += cx; cx = 0; } + if( cy < 0 ) { ch += cy; cy = 0; } + if( cx+cw > rw ) cw = rw-cx; + if( cy+ch > rh ) ch = rh-cy; + VFrame vframe(cw,ch, BC_RGB888); + if( cx+cw < rw ) ++cw; + if( cy+ch < rh ) ++ch; + BC_Capture capture_bitmap(cw,ch, 0); + capture_bitmap.capture_frame(&vframe, cx,cy); + + asset->width = vframe.get_w(); + asset->height = vframe.get_h(); + asset->audio_data = 0; + asset->video_data = 1; + asset->video_length = 1; + asset->layers = 1; + + File file; + int fcolor_model = mwindow->edl->session->color_model; + int processors = preferences->project_smp + 1; + if( processors > 8 ) processors = 8; + file.set_processors(processors); + int ret = file.open_file(preferences, asset, 0, 1); + if( !ret ) { + file.start_video_thread(1, fcolor_model, + processors > 1 ? 2 : 1, 0); + VFrame ***frames = file.get_video_buffer(); + VFrame *frame = frames[0][0]; + frame->transfer_from(&vframe); + ret = file.write_video_buffer(1); + file.close_file(); + } + if( !ret ) { + asset->awindow_folder = AW_MEDIA_FOLDER; + mwindow->edl->assets->append(asset); + mwindow->awindow->gui->async_update_assets(); + } + else { + eprintf(_("grabshot render failed")); + asset->remove_user(); + } + + grab_thread->done = 1; + return 1; +} + +void GrabshotPopup::update() +{ + set_color(grab_color ^= GREEN); + draw_box(0,0, get_w(),get_h()); + flash(1); +} + +void GrabshotPopup::draw_selection(int show) +{ + if( show < 0 ) { + for( int i=0; i<4; ++i ) hide_window(0); + flush(); + return; + } + + int nx0 = x0 < x1 ? x0 : x1; + int nx1 = x0 < x1 ? x1 : x0; + int ny0 = y0 < y1 ? y0 : y1; + int ny1 = y0 < y1 ? y1 : y0; + lx0 = nx0; lx1 = nx1; ly0 = ny0; ly1 = ny1; + + --nx0; --ny0; + BC_Popup **edge = grab_thread->edge; + edge[0]->reposition_window(nx0,ny0, nx1-nx0, 1); + edge[1]->reposition_window(nx1,ny0, 1, ny1-ny0); + edge[2]->reposition_window(nx0,ny1, nx1-nx0, 1); + edge[3]->reposition_window(nx0,ny0, 1, ny1-ny0); + + if( show > 0 ) { + for( int i=0; i<4; ++i ) edge[i]->show_window(0); + } + flush(); +} + diff --git a/cinelerra-5.1/cinelerra/assetpopup.h b/cinelerra-5.1/cinelerra/assetpopup.h index b9191a77..774d8425 100644 --- a/cinelerra-5.1/cinelerra/assetpopup.h +++ b/cinelerra-5.1/cinelerra/assetpopup.h @@ -221,11 +221,14 @@ public: ~AssetListMenu(); void create_objects(); - void update_titles(); + void update_titles(int shots); MWindow *mwindow; AWindowGUI *gui; AWindowListFormat *format; + AssetSnapshot *asset_snapshot; + AssetGrabshot *asset_grabshot; + int shots_displayed; }; class AssetListCopy : public BC_MenuItem @@ -313,4 +316,98 @@ public: BC_ScrollTextBox *file_list; }; +class AssetSnapshot : public BC_MenuItem +{ +public: + AssetSnapshot(MWindow *mwindow, AssetListMenu *asset_list_menu); + ~AssetSnapshot(); + + MWindow *mwindow; + AssetListMenu *asset_list_menu; +}; + +class SnapshotSubMenu : public BC_SubMenu +{ +public: + SnapshotSubMenu(AssetSnapshot *asset_snapshot); + ~SnapshotSubMenu(); + + AssetSnapshot *asset_snapshot; +}; + +class SnapshotMenuItem : public BC_MenuItem +{ +public: + SnapshotMenuItem(SnapshotSubMenu *submenu, const char *text, int mode); + ~SnapshotMenuItem(); + + int handle_event(); + SnapshotSubMenu *submenu; + int mode; +}; + + +class AssetGrabshot : public BC_MenuItem +{ +public: + AssetGrabshot(MWindow *mwindow, AssetListMenu *asset_list_menu); + ~AssetGrabshot(); + + MWindow *mwindow; + AssetListMenu *asset_list_menu; +}; + +class GrabshotSubMenu : public BC_SubMenu +{ +public: + GrabshotSubMenu(AssetGrabshot *asset_grabshot); + ~GrabshotSubMenu(); + + AssetGrabshot *asset_grabshot; +}; + +class GrabshotMenuItem : public BC_MenuItem +{ +public: + GrabshotMenuItem(GrabshotSubMenu *submenu, const char *text, int mode); + ~GrabshotMenuItem(); + + int handle_event(); + GrabshotSubMenu *submenu; + int mode; + GrabshotThread *grab_thread; +}; + +class GrabshotThread : public Thread +{ +public: + GrabshotThread(MWindow* mwindow); + ~GrabshotThread(); + + MWindow *mwindow; + GrabshotPopup *popup; + BC_Popup *edge[4]; + int done; + + void start(GrabshotMenuItem *menu_item); + void run(); +}; + +class GrabshotPopup : public BC_Popup +{ +public: + GrabshotPopup(GrabshotThread *grab_thread, int mode); + ~GrabshotPopup(); + int grab_event(XEvent *event); + void draw_selection(int invert); + void update(); + + GrabshotThread *grab_thread; + int mode; + int dragging; + int grab_color; + int x0, y0, x1, y1; + int lx0, ly0, lx1, ly1; +}; + #endif diff --git a/cinelerra-5.1/cinelerra/assetpopup.inc b/cinelerra-5.1/cinelerra/assetpopup.inc index 66e2e396..ed37dc4e 100644 --- a/cinelerra-5.1/cinelerra/assetpopup.inc +++ b/cinelerra-5.1/cinelerra/assetpopup.inc @@ -22,6 +22,14 @@ #ifndef ASSETPOPUP_INC #define ASSETPOPUP_INC +#define SNAPSHOT_PNG 0 +#define SNAPSHOT_JPEG 1 +#define SNAPSHOT_TIFF 2 + +#define GRABSHOT_PNG 0 +#define GRABSHOT_JPEG 1 +#define GRABSHOT_TIFF 2 + class AssetPopup; class AssetPopupInfo; class AssetPopupSort; @@ -42,5 +50,13 @@ class AssetCopyWindow; class AssetListPaste; class AssetPasteDialog; class AssetPasteWindow; +class AssetSnapshot; +class SnapshotSubMenu; +class SnapshotMenuItem; +class AssetGrabshot; +class GrabshotSubMenu; +class GrabshotMenuItem; +class GrabshotThread; +class GrabshotPopup; #endif diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index a0b7d385..f071ea3d 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -1110,7 +1110,11 @@ void AWindowGUI::update_asset_list() if( !picon->in_use ) { delete picon; assets.remove_number(i); + continue; } + if( !picon->indexable->is_asset ) continue; + struct stat st; + picon->mtime = !stat(picon->indexable->path, &st) ? st.st_mtime : 0; } } @@ -1556,7 +1560,7 @@ int AWindowAssets::button_press_event() break; case AW_MEDIA_FOLDER: case AW_PROXY_FOLDER: - gui->assetlist_menu->update_titles(); + gui->assetlist_menu->update_titles(folder==AW_MEDIA_FOLDER); gui->assetlist_menu->activate_menu(); break; } diff --git a/cinelerra-5.1/cinelerra/editpopup.C b/cinelerra-5.1/cinelerra/editpopup.C index df0be8dc..694c2d2a 100644 --- a/cinelerra-5.1/cinelerra/editpopup.C +++ b/cinelerra-5.1/cinelerra/editpopup.C @@ -25,7 +25,6 @@ #include "awindowgui.h" #include "edit.h" #include "editpopup.h" -#include "cache.h" #include "edl.h" #include "edlsession.h" #include "file.h" @@ -36,15 +35,10 @@ #include "mwindow.h" #include "mwindowgui.h" #include "plugindialog.h" -#include "preferences.h" -#include "renderengine.h" #include "resizetrackthread.h" #include "track.h" #include "tracks.h" #include "trackcanvas.h" -#include "transportque.h" -#include "vframe.h" -#include "vrender.h" #include @@ -67,13 +61,6 @@ void EditPopup::create_objects() add_item(new EditPopupDeleteTrack(mwindow, this)); add_item(new EditPopupAddTrack(mwindow, this)); // add_item(new EditPopupTitle(mwindow, this)); - EditSnapshot *edit_snapshot; - SnapshotSubMenu *snapshot_submenu; - add_item(edit_snapshot = new EditSnapshot(mwindow, this)); - edit_snapshot->add_submenu(snapshot_submenu = new SnapshotSubMenu(edit_snapshot)); - snapshot_submenu->add_submenuitem(new SnapshotMenuItem(snapshot_submenu, _("png"), SNAPSHOT_PNG)); - snapshot_submenu->add_submenuitem(new SnapshotMenuItem(snapshot_submenu, _("jpeg"), SNAPSHOT_JPEG)); - snapshot_submenu->add_submenuitem(new SnapshotMenuItem(snapshot_submenu, _("tiff"), SNAPSHOT_TIFF)); resize_option = 0; matchsize_option = 0; } @@ -340,117 +327,3 @@ int EditPopupTitleText::handle_event() return 1; } - - -EditSnapshot::EditSnapshot(MWindow *mwindow, EditPopup *popup) - : BC_MenuItem(_("Snapshot...")) -{ - this->mwindow = mwindow; - this->popup = popup; -} - -EditSnapshot::~EditSnapshot() -{ -} - -SnapshotSubMenu::SnapshotSubMenu(EditSnapshot *edit_snapshot) -{ - this->edit_snapshot = edit_snapshot; -} - -SnapshotSubMenu::~SnapshotSubMenu() -{ -} - -SnapshotMenuItem::SnapshotMenuItem(SnapshotSubMenu *submenu, const char *text, int mode) - : BC_MenuItem(text) -{ - this->submenu = submenu; - this->mode = mode; -} - -SnapshotMenuItem::~SnapshotMenuItem() -{ -} - -int SnapshotMenuItem::handle_event() -{ - MWindow *mwindow = submenu->edit_snapshot->mwindow; - EDL *edl = mwindow->edl; - if( !edl->have_video() ) return 1; - - Preferences *preferences = mwindow->preferences; - char filename[BCTEXTLEN]; - static const char *exts[] = { "png", "jpg", "tif" }; - time_t tt; time(&tt); - struct tm tm; localtime_r(&tt,&tm); - snprintf(filename,sizeof(filename),"%s/snap_%04d%02d%02d-%02d%02d%02d.%s", - preferences->snapshot_path, 1900+tm.tm_year,1+tm.tm_mon,tm.tm_mday, - tm.tm_hour,tm.tm_min,tm.tm_sec, exts[mode]); - int fw = edl->get_w(), fh = edl->get_h(); - int fcolor_model = edl->session->color_model; - - Asset *asset = new Asset(filename); - switch( mode ) { - case SNAPSHOT_PNG: - asset->format = FILE_PNG; - asset->png_use_alpha = 1; - break; - case SNAPSHOT_JPEG: - asset->format = FILE_JPEG; - asset->jpeg_quality = 90; - break; - case SNAPSHOT_TIFF: - asset->format = FILE_TIFF; - asset->tiff_cmodel = 0; - asset->tiff_compression = 0; - break; - } - asset->width = fw; - asset->height = fh; - asset->audio_data = 0; - asset->video_data = 1; - asset->video_length = 1; - asset->layers = 1; - - File file; - int processors = preferences->project_smp + 1; - if( processors > 8 ) processors = 8; - file.set_processors(processors); - int ret = file.open_file(preferences, asset, 0, 1); - if( !ret ) { - file.start_video_thread(1, fcolor_model, - processors > 1 ? 2 : 1, 0); - VFrame ***frames = file.get_video_buffer(); - VFrame *frame = frames[0][0]; - TransportCommand command; - //command.command = audio_tracks ? NORMAL_FWD : CURRENT_FRAME; - command.command = CURRENT_FRAME; - command.get_edl()->copy_all(edl); - command.change_type = CHANGE_ALL; - command.realtime = 0; - - RenderEngine render_engine(0, preferences, 0, 0); - CICache video_cache(preferences); - render_engine.set_vcache(&video_cache); - render_engine.arm_command(&command); - - double position = edl->local_session->get_selectionstart(1); - int64_t source_position = (int64_t)(position * edl->get_frame_rate()); - int ret = render_engine.vrender->process_buffer(frame, source_position, 0); - if( !ret ) - ret = file.write_video_buffer(1); - file.close_file(); - } - if( !ret ) { - asset->awindow_folder = AW_MEDIA_FOLDER; - mwindow->edl->assets->append(asset); - mwindow->awindow->gui->async_update_assets(); - } - else { - eprintf("snapshot render failed"); - asset->remove_user(); - } - return 1; -} - diff --git a/cinelerra-5.1/cinelerra/editpopup.h b/cinelerra-5.1/cinelerra/editpopup.h index 4b400065..e6a4c5dc 100644 --- a/cinelerra-5.1/cinelerra/editpopup.h +++ b/cinelerra-5.1/cinelerra/editpopup.h @@ -29,19 +29,12 @@ #include "plugindialog.inc" #include "resizetrackthread.inc" -#define SNAPSHOT_PNG 0 -#define SNAPSHOT_JPEG 1 -#define SNAPSHOT_TIFF 2 - class EditPopupResize; class EditPopupMatchSize; class EditPopupTitleText; class EditPopupTitleWindow; class EditPopupTitleButton; class EditPopupTitleButtonRes; -class EditSnapshot; -class SnapshotSubMenu; -class SnapshotMenuItem; class EditPopup : public BC_PopupMenu { @@ -182,35 +175,4 @@ public: char new_text[BCTEXTLEN]; }; - -class EditSnapshot : public BC_MenuItem -{ -public: - EditSnapshot(MWindow *mwindow, EditPopup *popup); - ~EditSnapshot(); - - MWindow *mwindow; - EditPopup *popup; -}; - -class SnapshotSubMenu : public BC_SubMenu -{ -public: - SnapshotSubMenu(EditSnapshot *edit_snapshot); - ~SnapshotSubMenu(); - - EditSnapshot *edit_snapshot; -}; - -class SnapshotMenuItem : public BC_MenuItem -{ -public: - SnapshotMenuItem(SnapshotSubMenu *submenu, const char *text, int mode); - ~SnapshotMenuItem(); - - int handle_event(); - SnapshotSubMenu *submenu; - int mode; -}; - #endif diff --git a/cinelerra-5.1/cinelerra/record.C b/cinelerra-5.1/cinelerra/record.C index 417063bd..473e10c3 100644 --- a/cinelerra-5.1/cinelerra/record.C +++ b/cinelerra-5.1/cinelerra/record.C @@ -2049,7 +2049,7 @@ run() usleep(500000); disable_cancel(); color ^= YELLOW ^ BLUE; - if( timer.get_difference() > 10*60*1000 ) { // 10 minites + if( timer.get_difference() > 10*60*1000 ) { // 10 minutes record->stop_commercial_capture(0); done = 1; } diff --git a/cinelerra-5.1/cinelerra/recordtransport.C b/cinelerra-5.1/cinelerra/recordtransport.C index bf545c5b..7f2b59da 100644 --- a/cinelerra-5.1/cinelerra/recordtransport.C +++ b/cinelerra-5.1/cinelerra/recordtransport.C @@ -324,6 +324,7 @@ RecordGUIBack::RecordGUIBack(RecordTransport *record_transport, int x, int y) { this->record_transport = record_transport; set_tooltip(_("Fast rewind")); + repeat_id = 257; } RecordGUIBack::~RecordGUIBack() @@ -364,6 +365,7 @@ RecordGUIFwd::RecordGUIFwd(RecordTransport *record_transport, int x, int y) { this->record_transport = record_transport; set_tooltip(_("Fast forward")); + repeat_id = 255; } RecordGUIFwd::~RecordGUIFwd() diff --git a/cinelerra-5.1/ffmpeg/plugin.opts b/cinelerra-5.1/ffmpeg/plugin.opts index 95236fdb..d7c19513 100644 --- a/cinelerra-5.1/ffmpeg/plugin.opts +++ b/cinelerra-5.1/ffmpeg/plugin.opts @@ -316,7 +316,7 @@ smartblur #superequalizer #surround tlut2 -tonemap +#tonemap #vmafmotion ; in git #afir diff --git a/cinelerra-5.1/info/plugins.txt b/cinelerra-5.1/info/plugins.txt index b8e9253e..c678b026 100644 --- a/cinelerra-5.1/info/plugins.txt +++ b/cinelerra-5.1/info/plugins.txt @@ -241,6 +241,7 @@ F_cropdetect: Auto-detect crop size F_datascope: Video data analysis. F_deband: Debands video. F_deflate: Applies deflate effect. +F_deflicker: Remove temporal frame luminance variations. F_dejudder: Removes judder produced by pullup. F_delogo: Removes logo from input video. When using this plugin a green box will appear on the @@ -250,7 +251,10 @@ F_delogo: Removes logo from input video. and the size of the box (so you can adjust it to the size of the logo). F_deshake: Stabilizes shaky video. +F_despill: Remove unwanted foreground colors, caused by reflected color + of green or blue screen. F_dilation: Applies dilation effect. +F_doubleweave: Weave input video fields into double number of frames. F_drawbox: Draws a colored box on the input video. Through the settings you are able to choose the position of the box on X and Y coordinates, @@ -271,6 +275,7 @@ F_fade: Fade in/out input video. F_fftfilt: Apply arbitrary expressions to pixels in frequency domain. F_field: Extract a field from the input video. F_fieldorder: Set the field order. +F_floodfill: Fill area of the same color with another color. F_framerate: Upsamples or downsamples progressive source between specified frame rates. F_fspp: Applies Fast Simple Post-processing filter. @@ -289,7 +294,9 @@ F_inflate: Applies inflate effect. F_interlace: Convert progressive video into interlaced. F_kerndeint: Applies kernel deinterlacing to the input. F_lenscorrection: Rectifies the image by correcting for lens distortion. +F_limiter: Limit pixels components to the specified range. F_loop: Loops video frames. +F_lumakey: Turns a certain luma into transparency. F_lut: Compute and apply a lookup table to the RGB/YUV input video. F_lutrgb: Compute and apply a lookup table to the RGB input video. @@ -304,13 +311,18 @@ F_noise: Adds noise to the video. Through the settings you can select the variables of the noise (strength, flag and seed). +F_oscilloscope: 2D video oscilloscope. Useful to measure spatial impulse, + step responses, and chroma delays. F_owndenoise: Denoises using wavelets. F_perms: Set permissions for the output video frame. F_perspective: Corrects the perspective of video. F_phase: Phases shift fields. +F_pixscope: Pixel data analysis for checking color and levels. It will + display sample values of color channels. F_pp: Filters video using libpostproc. F_pp7: Applies Postprocessing 7 filter. F_prewitt: Apply prewitt operator. +F_pseudocolor: Make pseudocolored video frames. F_readeia608: Read EIA-608 Closed Caption codes from input video and write them to frame metadata. F_readvitc: Reads vertical interval @@ -318,6 +330,10 @@ F_readvitc: Reads vertical interval F_realtime: Slows down filtering to match realtime. F_removegrain: Removes grain. F_repeatfields: Hard repeat fields based on MPEG repeat field flag. +F_roberts: Apply roberts cross operator which performs a simple/quick 2-D + spatial gradient measurement on the video (usually a graysacle + image). It highlights regions of high spatial frequency which + most likely correspond to edges. F_rotate: Rotates the input image. F_sab: Applies shape adaptive blur. F_separatefields: Split input video frames into fields. @@ -337,6 +353,7 @@ F_super2xsai: Scales the input by 2x using F_swaprect: Swaps 2 rectangular objects in video. F_swapuv: Swaps U and V components. F_tinterlace: Performs temporal field interlacing. +F_tlut2: Compute and apply a lookup table from 2 successive frames. F_transpose: Transposes input video. F_uspp: Applies Ultra Simple/Slow Post-processing filter. F_vaguedenoiser: Applies a Wavelet based Denoiser. @@ -381,6 +398,10 @@ F_biquad: Applies a biquad IIR filter with the given coefficents. F_chorus: Adds a chorus effect to the audio. F_compand: Compresses or expands audio dynamic range. F_compensationdelay: audio compensation delay line. +F_crossfeed: Apply headphone crossfeed which blends the left and right + channels of a stereo audio recording. It is mainly used + to reduce extreme stereo separation of low frequencies in + order to produce more speaker like sound. F_crystalizer: Simple Expand Audio Dynamic Range filter. F_dcshift: Applies a DC shift to the audio. F_dyaudnorm: Dynamic Audio Normalizer. When using this plugin, @@ -402,6 +423,10 @@ F_extrastereo: Increases difference between stereo audio brings up an menu. Highlight the effect shown in the middle section and click OK. F_flanger: Applies a flanging effect to the audio. +F_haas: Apply Haas Stereo Enhancer for a more natural sounding pan effect + or more clarity in the center of the mix. With this filter + applied to mono signals it give some directionality and stretches + its stereo image F_highpass: Applies a high-pass filter with 3dB point frequency. F_loudnorm: EBU R128 loudness normalization. F_lowpass: Applies a low-pass filter with 3dB point frequency.