X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Flivevideo%2Flivevideo.C;h=c30034ab64001fc8c81e1a043aff88e00ad4730e;hb=9d54c23d957ea350c5ffd756ac2c1c221c94637b;hp=92187364426db10e50570c5cb3297b8aebedd059;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/plugins/livevideo/livevideo.C b/cinelerra-5.1/plugins/livevideo/livevideo.C index 92187364..c30034ab 100644 --- a/cinelerra-5.1/plugins/livevideo/livevideo.C +++ b/cinelerra-5.1/plugins/livevideo/livevideo.C @@ -26,11 +26,14 @@ #include "channeldb.h" #include "clip.h" #include "bchash.h" +#include "edl.h" #include "edlsession.h" #include "filexml.h" #include "guicast.h" #include "language.h" +#if HAVE_LIBDV #include "libdv.h" +#endif #include "libmjpeg.h" #include "mwindow.h" #include "picture.h" @@ -149,7 +152,9 @@ public: int prev_channel; int w, h; // Decompressors for different video drivers +#if HAVE_DV dv_t *dv; +#endif mjpeg_t *mjpeg; }; @@ -196,8 +201,8 @@ LiveVideoWindow::LiveVideoWindow(LiveVideo *plugin) : PluginClientWindow(plugin, plugin->w, plugin->h, - 100, - 100, + xS(100), + yS(100), 1) { this->plugin = plugin; @@ -210,9 +215,11 @@ LiveVideoWindow::~LiveVideoWindow() void LiveVideoWindow::create_objects() { - int x = 10, y = 10; + int xs10 = xS(10); + int ys5 = yS(5), ys10 = yS(10); + int x = xs10, y = ys10; - EDLSession *session = plugin->PluginClient::get_edlsession(); + EDLSession *session = plugin->get_edl()->session; if(session) VideoDevice::load_channeldb(plugin->channeldb, session->vconfig_in); for(int i = 0; i < plugin->channeldb->size(); i++) @@ -224,14 +231,14 @@ void LiveVideoWindow::create_objects() } add_subwindow(title = new BC_Title(x, y, _("Channels:"))); - y += title->get_h() + 5; + y += title->get_h() + ys5; add_subwindow(list = new LiveChannelList(plugin, this, x, y, - get_w() - x - 10, - get_h() - y - BC_OKButton::calculate_h() - 10 - 10)); - y += list->get_h() + 10; + get_w() - x - xs10, + get_h() - y - BC_OKButton::calculate_h() - ys10 - ys10)); + y += list->get_h() + ys10; add_subwindow(select = new LiveChannelSelect(plugin, this, x, @@ -344,10 +351,12 @@ LiveVideo::LiveVideo(PluginServer *server) vdevice = 0; temp = 0; channeldb = new ChannelDB; - w = 320; - h = 640; + w = xS(320); + h = yS(640); prev_channel = 0; +#if HAVE_DV dv = 0; +#endif mjpeg = 0; picture = 0; this->server = server; @@ -367,7 +376,9 @@ LiveVideo::~LiveVideo() delete channeldb; delete temp; +#if HAVE_DV if(dv) dv_delete(dv); +#endif if(mjpeg) mjpeg_delete(mjpeg); delete picture; } @@ -382,7 +393,7 @@ int LiveVideo::process_buffer(VFrame *frame, //printf("LiveVideo::process_buffer 10 start_position=%lld buffer_size=%d size=%d\n", //start_position, get_buffer_size(), size); - EDLSession *session = PluginClient::get_edlsession(); + EDLSession *session = get_edl()->session; if(!vdevice) { if(session) @@ -496,6 +507,7 @@ int LiveVideo::process_buffer(VFrame *frame, { switch(session->vconfig_in->driver) { +#if HAVE_DV case CAPTURE_FIREWIRE: case CAPTURE_IEC61883: // Decompress a DV frame from the driver @@ -508,7 +520,7 @@ int LiveVideo::process_buffer(VFrame *frame, frame->get_color_model()); frame->set_opengl_state(VFrame::RAM); break; - +#endif case VIDEO4LINUX2JPEG: if(!mjpeg) mjpeg = mjpeg_new(frame->get_w(),