remove whitespace at eol
[goodguy/history.git] / cinelerra-5.1 / cinelerra / videodevice.C
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008-2013 Adam Williams <broadcast at earthling dot net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  */
21
22 #include "asset.h"
23 #include "assets.h"
24 #include "bccapture.h"
25 #include "bcsignals.h"
26 #include "channel.h"
27 #include "channeldb.h"
28 #include "chantables.h"
29 #include "edl.h"
30 #include "edlsession.h"
31 #include "file.inc"
32 #include "libdv.h"
33 #include "libmjpeg.h"
34 #include "mainmenu.h"
35 #include "mutex.h"
36 #include "mwindow.h"
37 #include "mwindowgui.h"
38 #include "picture.h"
39 #include "playbackconfig.h"
40 #include "playbackengine.h"
41 #include "preferences.h"
42 #include "recordconfig.h"
43 #include "recordgui.h"
44 #include "recordmonitor.h"
45 #include "record.h"
46 #ifdef HAVE_FIREWIRE
47 #include "vdevice1394.h"
48 #endif
49 #include "vdevicedvb.h"
50 #include "vdevicev4l2.h"
51 #include "vdevicev4l2jpeg.h"
52 #include "vdevicev4l2mpeg.h"
53 #include "vdevicex11.h"
54 #include "videoconfig.h"
55 #include "videodevice.h"
56 #include "videowindow.h"
57 #include "videowindowgui.h"
58 #include "vframe.h"
59
60 #include <string.h>
61 #include <unistd.h>
62 #include <fcntl.h>
63
64 KeepaliveThread::KeepaliveThread(VideoDevice *device)
65  : Thread(1, 0, 0)
66 {
67         still_alive = 1;
68         failed = 0;
69         interrupted = 0;
70         set_synchronous(1);
71         this->device = device;
72         capturing = 0;
73         startup_lock = new Mutex("KeepaliveThread::startup_lock");
74 }
75
76 KeepaliveThread::~KeepaliveThread()
77 {
78         delete startup_lock;
79 }
80
81 int KeepaliveThread::start_keepalive()
82 {
83         startup_lock->lock("KeepaliveThread::start_keepalive 1");
84         start();
85         startup_lock->lock("KeepaliveThread::start_keepalive 2");
86         startup_lock->unlock();
87         return 0;
88 }
89
90 void KeepaliveThread::run()
91 {
92         startup_lock->unlock();
93         while(!interrupted)
94         {
95                 still_alive = 0;
96 // Give the capture a moment
97 // Should fix the delay in case users want slower frame rates.
98                 timer.delay((long)(KEEPALIVE_DELAY * 1000));
99
100 // See if a capture happened
101                 if(still_alive == 0 && capturing)
102                 {
103 //                      printf("KeepaliveThread::run: device crashed\n");
104                         failed++;
105                 }
106                 else
107                         failed = 0;
108         }
109 }
110
111 int KeepaliveThread::reset_keepalive()
112 {
113         still_alive = 1;
114         return 0;
115 }
116
117 int KeepaliveThread::get_failed()
118 {
119         if(failed) return 1; else return 0;
120 }
121
122 int KeepaliveThread::stop()
123 {
124         interrupted = 1;
125
126 // Force an immediate exit even if capture_frame worked.
127         Thread::cancel();
128         Thread::join();
129         return 0;
130 }
131
132
133
134
135
136
137
138 VideoDevice::VideoDevice(MWindow *mwindow)
139 {
140         this->mwindow = mwindow;
141         in_config = new VideoInConfig;
142         out_config = new VideoOutConfig;
143         channel = new Channel;
144         picture = new PictureConfig();
145         sharing_lock = new Mutex("VideoDevice::sharing_lock");
146         channel_lock = new Mutex("VideoDevice::channel_lock");
147         picture_lock = new Mutex("VideoDevice::picture_lock");
148         initialize();
149 }
150
151
152 VideoDevice::~VideoDevice()
153 {
154         input_sources.remove_all_objects();
155         delete in_config;
156         delete out_config;
157         delete channel;
158         delete picture;
159         delete sharing_lock;
160         delete channel_lock;
161         delete picture_lock;
162 }
163
164 int VideoDevice::initialize()
165 {
166         sharing = 0;
167         done_sharing = 0;
168         sharing_lock->reset();
169         orate = irate = 0;
170         out_w = out_h = 0;
171         r = w = 0;
172         is_playing_back = is_recording = 0;
173         input_x = 0;
174         input_y = 0;
175         input_z = 1;
176         frame_resized = 0;
177         frame_rate = 0;
178         timestamp = -1.;
179         capturing = 0;
180         keepalive = 0;
181         swap_bytes = 0;
182         in_config_updated = 0;
183         input_base = 0;
184         output_base = 0;
185         output_format = 0;
186         interrupt = 0;
187         adevice = 0;
188         quality = 80;
189         cpus = 1;
190         single_frame = 0;
191         channel_changed = 0;
192         picture_changed = 0;
193         return 0;
194 }
195
196 int VideoDevice::open_input(VideoInConfig *config,
197         int input_x,
198         int input_y,
199         float input_z,
200         double frame_rate)
201 {
202         int result = 0;
203
204         *this->in_config = *config;
205
206         r = 1;
207         this->input_z = -1;   // Force initialization.
208         this->frame_rate = frame_rate;
209         if( input_base ) return 1; // device already open
210
211         switch(in_config->driver) {
212 #ifdef HAVE_VIDEO4LINUX2
213
214                 case VIDEO4LINUX2:
215                 case VIDEO4LINUX2JPEG:
216                 case VIDEO4LINUX2MPEG:
217                 case CAPTURE_JPEG_WEBCAM:
218                 case CAPTURE_YUYV_WEBCAM:
219                         break;
220
221 #endif
222
223                 case SCREENCAPTURE:
224                         this->input_x = input_x;
225                         this->input_y = input_y;
226                         break;
227 #ifdef HAVE_FIREWIRE
228                 case CAPTURE_FIREWIRE:
229                 case CAPTURE_IEC61883:
230                         break;
231 #endif
232
233 #ifdef HAVE_DVB
234                 case CAPTURE_DVB:
235                         break;
236 #endif
237
238                 default:
239                         return 1;
240         }
241
242         new_device_base();
243         if( !input_base ) return 1;
244         result = input_base->open_input();
245         if(!result) capturing = 1;
246         in_config_updated = 0;
247         return 0;
248 }
249
250 VDeviceBase* VideoDevice::new_device_base()
251 {
252         switch(in_config->driver) {
253 #ifdef HAVE_VIDEO4LINUX2
254         case VIDEO4LINUX2:
255         case CAPTURE_JPEG_WEBCAM:
256         case CAPTURE_YUYV_WEBCAM:
257                 return input_base = new VDeviceV4L2(this);
258         case VIDEO4LINUX2JPEG:
259                 return input_base = new VDeviceV4L2JPEG(this);
260         case VIDEO4LINUX2MPEG:
261                 return input_base = new VDeviceV4L2MPEG(this);
262 #endif
263
264         case SCREENCAPTURE:
265                 return input_base = new VDeviceX11(this, 0);
266
267 #ifdef HAVE_FIREWIRE
268         case CAPTURE_FIREWIRE:
269         case CAPTURE_IEC61883:
270                 return input_base = new VDevice1394(this);
271 #endif
272
273 #ifdef HAVE_DVB
274         case CAPTURE_DVB:
275                 return input_base = new VDeviceDVB(this);
276 #endif
277         }
278         return 0;
279 }
280
281 static const char* get_channeldb_path(VideoInConfig *vconfig_in)
282 {
283         char *path = 0;
284         switch(vconfig_in->driver)
285         {
286                 case VIDEO4LINUX2:
287                 case CAPTURE_JPEG_WEBCAM:
288                 case CAPTURE_YUYV_WEBCAM:
289                         path = (char*)"channels_v4l2";
290                         break;
291                 case VIDEO4LINUX2JPEG:
292                         path = (char*)"channels_v4l2jpeg";
293                         break;
294                 case VIDEO4LINUX2MPEG:
295                         path = (char*)"channels_v4l2mpeg";
296                         break;
297                 case CAPTURE_DVB:
298                         path = (char*)"channels_dvb";
299                         break;
300         }
301         return path;
302 }
303
304 void VideoDevice::load_channeldb(ChannelDB *channeldb, VideoInConfig *vconfig_in)
305 {
306         channeldb->load(get_channeldb_path(vconfig_in));
307 }
308
309 void VideoDevice::save_channeldb(ChannelDB *channeldb, VideoInConfig *vconfig_in)
310 {
311         channeldb->save(get_channeldb_path(vconfig_in));
312 }
313
314
315 VDeviceBase* VideoDevice::get_input_base()
316 {
317         return input_base;
318 }
319
320 VDeviceBase* VideoDevice::get_output_base()
321 {
322         return output_base;
323 }
324
325 DeviceMPEGInput *VideoDevice::mpeg_device()
326 {
327         return !input_base ? 0 : input_base->mpeg_device();
328 }
329
330 int VideoDevice::is_compressed(int driver, int use_file, int use_fixed)
331 {
332 // FileMOV needs to have write_frames called so the start codes get scanned.
333         return ((driver == VIDEO4LINUX2JPEG && use_fixed) ||
334                 (driver == CAPTURE_JPEG_WEBCAM && use_fixed) ||
335                 driver == CAPTURE_FIREWIRE ||
336                 driver == CAPTURE_IEC61883);
337 }
338
339 int VideoDevice::is_compressed(int use_file, int use_fixed)
340 {
341         return is_compressed(in_config->driver, use_file, use_fixed);
342 }
343
344
345 void VideoDevice::fix_asset(Asset *asset, int driver)
346 {
347 // Fix asset using legacy routine
348         const char *vcodec = 0;
349         switch(driver) {
350         case CAPTURE_IEC61883:
351         case CAPTURE_FIREWIRE:
352                 vcodec = CODEC_TAG_DVSD;
353                 break;
354
355         case VIDEO4LINUX2JPEG:
356                 vcodec = CODEC_TAG_MJPEG;
357                 break;
358
359         case CAPTURE_JPEG_WEBCAM:
360                 vcodec = CODEC_TAG_JPEG;
361                 break;
362         }
363         if( vcodec ) {
364                 asset->format = FILE_FFMPEG;
365                 strcpy(asset->vcodec, vcodec);
366                 return;
367         }
368
369 // Fix asset using inherited routine
370         new_device_base();
371
372         if(input_base) input_base->fix_asset(asset);
373         delete input_base;
374         input_base = 0;
375 }
376
377
378 const char* VideoDevice::drivertostr(int driver)
379 {
380         switch(driver) {
381         case PLAYBACK_X11:     return PLAYBACK_X11_TITLE;
382         case PLAYBACK_X11_XV:  return PLAYBACK_X11_XV_TITLE;
383         case PLAYBACK_X11_GL:  return PLAYBACK_X11_GL_TITLE;
384         case VIDEO4LINUX2:     return VIDEO4LINUX2_TITLE;
385         case VIDEO4LINUX2JPEG: return VIDEO4LINUX2JPEG_TITLE;
386         case VIDEO4LINUX2MPEG: return VIDEO4LINUX2MPEG_TITLE;
387         case CAPTURE_JPEG_WEBCAM: return CAPTURE_JPEG_WEBCAM_TITLE;
388         case CAPTURE_YUYV_WEBCAM: return CAPTURE_YUYV_WEBCAM_TITLE;
389         case SCREENCAPTURE:    return SCREENCAPTURE_TITLE;
390         case CAPTURE_DVB:      return CAPTURE_DVB_TITLE;
391 #ifdef HAVE_FIREWIRE
392         case CAPTURE_FIREWIRE: return CAPTURE_FIREWIRE_TITLE;
393         case CAPTURE_IEC61883: return CAPTURE_IEC61883_TITLE;
394 #endif
395         }
396         return "";
397 }
398
399 int VideoDevice::get_best_colormodel(Asset *asset)
400 {
401         return input_base ? input_base->get_best_colormodel(asset) : BC_RGB888;
402 }
403
404 int VideoDevice::drop_frames(int frames)
405 {
406         return input_base ? input_base->drop_frames(frames) : 1;
407 }
408
409 double VideoDevice::device_timestamp()
410 {
411         return input_base ? input_base->device_timestamp() : -1.;
412 }
413
414 double VideoDevice::get_timestamp()
415 {
416         return timestamp;
417 }
418
419 int VideoDevice::close_all()
420 {
421         if(w) {
422                 if( output_base ) {
423                         output_base->close_all();
424                         delete output_base;
425                         output_base = 0;
426                 }
427         }
428
429         if(r && capturing) {
430                 capturing = 0;
431                 if(input_base) {
432                         input_base->close_all();
433                         delete input_base;
434                         input_base = 0;
435                 }
436                 if(keepalive) {
437                         keepalive->stop();
438                         delete keepalive;
439                 }
440         }
441
442         input_sources.remove_all_objects();
443         initialize();
444         return 0;
445 }
446
447
448 int VideoDevice::set_adevice(AudioDevice *adev)
449 {
450         adevice = adev;
451         return 0;
452 }
453
454
455 ArrayList<Channel*>* VideoDevice::get_inputs()
456 {
457         return &input_sources;
458 }
459
460 Channel* VideoDevice::new_input_source(char *device_name)
461 {
462         for( int i=0; i<input_sources.total; ++i ) {
463                 if(!strcmp(input_sources.values[i]->device_name, device_name))
464                         return input_sources.values[i];
465         }
466         Channel *item = new Channel;
467         strcpy(item->device_name, device_name);
468         input_sources.append(item);
469         return item;
470 }
471
472 int VideoDevice::get_failed()
473 {
474         return keepalive ? keepalive->get_failed() : 0;
475 }
476
477 int VideoDevice::interrupt_crash()
478 {
479         return input_base ? input_base->interrupt_crash() : 0;
480 }
481
482 int VideoDevice::set_translation(int in_x, int in_y)
483 {
484         input_x = in_x;
485         input_y = in_y;
486         return 0;
487 }
488
489 int VideoDevice::set_field_order(int odd_field_first)
490 {
491         this->odd_field_first = odd_field_first;
492         return 0;
493 }
494
495 int VideoDevice::set_channel(Channel *channel)
496 {
497         int result = 0;
498         if( channel ) {
499                 channel_lock->lock("VideoDevice::set_channel");
500                 this->channel->copy_settings(channel);
501                 channel_changed = 1;
502                 channel_lock->unlock();
503                 result = input_base ? input_base->set_channel(channel) :
504                          output_base ? output_base->set_channel(channel) :
505                          1;
506         }
507         return result;
508 }
509
510 int VideoDevice::set_captioning(int mode)
511 {
512         if( input_base )
513                 input_base->set_captioning(mode);
514         return 0;
515 }
516
517 void VideoDevice::set_quality(int quality)
518 {
519         this->quality = quality;
520 }
521
522 void VideoDevice::set_cpus(int cpus)
523 {
524         this->cpus = cpus;
525 }
526
527 int VideoDevice::set_picture(PictureConfig *picture)
528 {
529         if( picture ) {
530                 picture_lock->lock("VideoDevice::set_picture");
531                 this->picture->copy_settings(picture);
532                 picture_changed = 1;
533                 picture_lock->unlock();
534
535                 if(input_base) return input_base->set_picture(picture);
536         }
537         return 0;
538 }
539
540 int VideoDevice::update_translation()
541 {
542         float frame_in_capture_x1f, frame_in_capture_x2f, frame_in_capture_y1f, frame_in_capture_y2f;
543         float capture_in_frame_x1f, capture_in_frame_x2f, capture_in_frame_y1f, capture_in_frame_y2f;
544         //int z_changed = 0;
545
546         if(frame_resized) {
547                 input_x = new_input_x;
548                 input_y = new_input_y;
549                 if( in_config->driver == VIDEO4LINUX2 ) {
550                         if(input_z != new_input_z) {
551                                 input_z = new_input_z;
552                                 //z_changed = 1;
553
554                                 capture_w = (int)((float)in_config->w * input_z + 0.5);
555                                 capture_h = (int)((float)in_config->h * input_z + 0.5);
556
557 // Need to align to multiple of 4
558                                 capture_w &= ~3;
559                                 capture_h &= ~3;
560                         }
561
562                         frame_in_capture_x1f = (float)input_x * input_z + capture_w / 2 - in_config->w / 2;
563                         frame_in_capture_x2f = (float)input_x * input_z  + capture_w / 2 + in_config->w / 2;
564                         frame_in_capture_y1f = (float)input_y * input_z  + capture_h / 2 - in_config->h / 2;
565                         frame_in_capture_y2f = (float)input_y * input_z  + capture_h / 2 + in_config->h / 2;
566
567                         capture_in_frame_x1f = 0;
568                         capture_in_frame_y1f = 0;
569                         capture_in_frame_x2f = in_config->w;
570                         capture_in_frame_y2f = in_config->h;
571
572                         if(frame_in_capture_x1f < 0) { capture_in_frame_x1f -= frame_in_capture_x1f; frame_in_capture_x1f = 0; }
573                         if(frame_in_capture_y1f < 0) { capture_in_frame_y1f -= frame_in_capture_y1f; frame_in_capture_y1f = 0; }
574                         if(frame_in_capture_x2f > capture_w) { capture_in_frame_x2f -= frame_in_capture_x2f - capture_w; frame_in_capture_x2f = capture_w; }
575                         if(frame_in_capture_y2f > capture_h) { capture_in_frame_y2f -= frame_in_capture_y2f - capture_h; frame_in_capture_y2f = capture_h; }
576
577                         frame_in_capture_x1 = (int)frame_in_capture_x1f;
578                         frame_in_capture_y1 = (int)frame_in_capture_y1f;
579                         frame_in_capture_x2 = (int)frame_in_capture_x2f;
580                         frame_in_capture_y2 = (int)frame_in_capture_y2f;
581
582                         capture_in_frame_x1 = (int)capture_in_frame_x1f;
583                         capture_in_frame_y1 = (int)capture_in_frame_y1f;
584                         capture_in_frame_x2 = (int)capture_in_frame_x2f;
585                         capture_in_frame_y2 = (int)capture_in_frame_y2f;
586
587                         frame_resized = 0;
588                 }
589         }
590         return 0;
591 }
592
593 int VideoDevice::set_latency_counter(int value)
594 {
595         latency_counter = value;
596         return 0;
597 }
598
599 int VideoDevice::has_signal()
600 {
601         return input_base ? input_base->has_signal() : 0;
602 }
603
604 int VideoDevice::create_channeldb(ArrayList<Channel*> *channeldb)
605 {
606         return input_base ? input_base->create_channeldb(channeldb) : 1;
607 }
608
609
610 int VideoDevice::read_buffer(VFrame *frame)
611 {
612         int result = 0;
613         if(!capturing) return 0;
614
615 //printf("VideoDevice::read_buffer %p %p\n", frame, input_base);
616         if(input_base) {
617 // Reset the keepalive thread
618                 if(keepalive) keepalive->capturing = 1;
619                 result = input_base->read_buffer(frame);
620                 timestamp = frame->get_timestamp();
621                 if( timestamp < 0 ) {
622                         struct timeval tv;  gettimeofday(&tv, 0);
623                         timestamp = tv.tv_sec + tv.tv_usec / 1000000.0;
624                 }
625                 if(keepalive) {
626                         keepalive->capturing = 0;
627                         keepalive->reset_keepalive();
628                 }
629                 return result;
630         }
631
632         return 0;
633 }
634
635
636 // ================================= OUTPUT ==========================================
637
638
639 int VideoDevice::open_output(VideoOutConfig *config, float rate,
640         int out_w, int out_h, Canvas *output, int single_frame)
641 {
642         w = 1;
643 //printf("VideoDevice::open_output 1 %d\n", out_config->driver);
644         *this->out_config = *config;
645 //printf("VideoDevice::open_output 1 %d\n", out_config->driver);
646         this->out_w = out_w;
647         this->out_h = out_h;
648         this->orate = rate;
649         this->single_frame = single_frame;
650
651 //printf("VideoDevice::open_output 1 %d\n", out_config->driver);
652         switch(out_config->driver) {
653         case PLAYBACK_X11:
654         case PLAYBACK_X11_XV:
655         case PLAYBACK_X11_GL:
656                 output_base = new VDeviceX11(this, output);
657                 break;
658
659 #ifdef HAVE_FIREWIRE
660         case PLAYBACK_DV1394:
661         case PLAYBACK_FIREWIRE:
662         case PLAYBACK_IEC61883:
663                 output_base = new VDevice1394(this);
664                 break;
665 #endif
666         }
667 //printf("VideoDevice::open_output 2 %d\n", out_config->driver);
668
669         if(output_base->open_output()) {
670                 delete output_base;
671                 output_base = 0;
672         }
673 //printf("VideoDevice::open_output 3 %d\n", out_config->driver);
674         return output_base ? 0 : 1;
675 }
676
677
678
679 int VideoDevice::start_playback()
680 {
681 // arm buffer before doing this
682         is_playing_back = 1;
683         interrupt = 0;
684         return output_base ? output_base->start_playback() : 1;
685 }
686
687 int VideoDevice::stop_playback()
688 {
689         if( output_base ) output_base->stop_playback();
690         is_playing_back = 0;
691         interrupt = 0;
692         return 0;
693 }
694
695 void VideoDevice::goose_input()
696 {
697         if(input_base) input_base->goose_input();
698 }
699
700 void VideoDevice::new_output_buffer(VFrame **output, int colormodel)
701 {
702         if(!output_base) return;
703         output_base->new_output_buffer(output, colormodel);
704 }
705
706
707 int VideoDevice::interrupt_playback()
708 {
709         interrupt = 1;
710         return 0;
711 }
712
713 int VideoDevice::write_buffer(VFrame *output, EDL *edl)
714 {
715         return output_base ? output_base->write_buffer(output, edl) : 1;
716 }
717
718 int VideoDevice::output_visible()
719 {
720         return output_base ? output_base->output_visible() : 0;
721 }
722
723 BC_Bitmap* VideoDevice::get_bitmap()
724 {
725         return output_base ? output_base->get_bitmap() : 0;
726 }
727
728
729 int VideoDevice::set_cloexec_flag(int desc, int value)
730 {
731         int oldflags = fcntl(desc, F_GETFD, 0);
732         if( oldflags < 0 ) return oldflags;
733         if( value != 0 )
734                 oldflags |= FD_CLOEXEC;
735         else
736                 oldflags &= ~FD_CLOEXEC;
737         return fcntl(desc, F_SETFD, oldflags);
738 }
739
740
741 void VideoDevice::auto_update(double rate, int width, int height)
742 {
743         if( !in_config || !in_config->follow_video ) return;
744         capture_w = width;
745         capture_h = height;
746         frame_rate = rate;
747         in_config_updated = 1;
748 }
749
750 int VideoDevice::config_updated()
751 {
752         if( !in_config || !in_config->follow_video ) return 0;
753         return in_config_updated;
754 }
755
756 void VideoDevice::config_update()
757 {
758         in_config_updated = 0;
759         VideoInConfig *vconfig_in = mwindow->edl->session->vconfig_in;
760         vconfig_in->w = capture_w;
761         vconfig_in->h = capture_h;
762         vconfig_in->in_framerate = frame_rate;
763 }
764
765
766 int VideoDevice::start_toc(const char *path, const char *toc_path)
767 {
768         return input_base ? input_base->start_toc(path, toc_path) : -1;
769 }
770
771 int VideoDevice::start_record(int fd, int bsz)
772 {
773         return input_base ? input_base->start_record(fd, bsz) : -1;
774 }
775
776 int VideoDevice::stop_record()
777 {
778         return input_base ? input_base->stop_record() : -1;
779 }
780
781
782 int VideoDevice::total_video_streams()
783 {
784         return input_base ? input_base->total_video_streams() : 0;
785 }
786
787
788 // skimming
789 int VideoDevice::get_video_pid(int track)
790 {
791         return !input_base ? -1 : input_base->get_video_pid(track);
792
793 }
794
795 int VideoDevice::get_video_info(int track, int &pid,
796                 double &framerate, int &width, int &height, char *title)
797 {
798         return !input_base ? 1 : input_base->
799                 get_video_info(track, pid, framerate, width, height, title);
800 }
801
802 int VideoDevice::get_thumbnail(int stream, int64_t &position,
803                 unsigned char *&thumbnail, int &ww, int &hh)
804 {
805         return !input_base ? 1 :
806                 input_base->get_thumbnail(stream, position, thumbnail, ww, hh);
807 }
808
809 int VideoDevice::set_skimming(int track, int skim, skim_fn fn, void *vp)
810 {
811         return !input_base ? 1 :
812                 input_base->set_skimming(track, skim, fn, vp);
813 }
814