9 #include "interlacemodes.h"
12 #include "mwindow.inc"
13 #include "quicktime.h"
15 #include "videodevice.inc"
16 #include "cmodel_permutation.h"
18 #include <sys/types.h>
27 FileDV::FileDV(Asset *asset, File *file)
28 : FileBase(asset, file)
40 audio_sample_buffer = 0;
41 audio_sample_buffer_len = 0;
42 audio_sample_buffer_start = 0;
43 audio_sample_buffer_end = 0;
44 audio_sample_buffer_maxsize = 0;
46 audio_frames_written = 0;
48 if(asset->format == FILE_UNKNOWN)
49 asset->format = FILE_RAWDV;
50 asset->byte_order = 0;
52 stream_lock = new Mutex("FileDV::stream_lock");
53 decoder_lock = new Mutex("FileDV::decoder_lock");
54 video_position_lock = new Mutex("FileDV::video_position_lock");
59 if(stream) close_file();
61 if(decoder) dv_decoder_free(decoder);
62 if(encoder) dv_encoder_free(encoder);
63 if(audio_encoder) dv_encoder_free(audio_encoder);
67 delete video_position_lock;
69 delete[] video_buffer;
70 delete[] audio_buffer;
72 if(audio_sample_buffer)
74 for(int i = 0; i < asset->channels; i++)
75 delete[] audio_sample_buffer[i];
76 delete[] audio_sample_buffer;
80 void FileDV::get_parameters(BC_WindowBase *parent_window,
82 BC_WindowBase* &format_window,
88 DVConfigAudio *window = new DVConfigAudio(parent_window, asset);
89 format_window = window;
90 window->create_objects();
97 DVConfigVideo *window = new DVConfigVideo(parent_window, asset);
98 format_window = window;
99 window->create_objects();
100 window->run_window();
106 int FileDV::reset_parameters_derived()
108 if(decoder) dv_decoder_free(decoder);
109 if(encoder) dv_encoder_free(encoder);
110 if(audio_encoder) dv_encoder_free(audio_encoder);
115 TRACE("FileDV::reset_parameters_derived 10")
117 TRACE("FileDV::reset_parameters_derived: 20")
118 delete[] audio_buffer;
119 delete[] video_buffer;
120 TRACE("FileDV::reset_parameters_derived: 30")
125 if(stream) fclose(stream);
132 if(audio_sample_buffer)
134 for(int i = 0; i < asset->channels; i++)
135 delete[] audio_sample_buffer[i];
136 delete[] audio_sample_buffer;
138 audio_sample_buffer = 0;
139 audio_sample_buffer_start = 0;
140 audio_sample_buffer_len = 0;
141 audio_sample_buffer_end = 0;
142 audio_sample_buffer_maxsize = 0;
144 audio_frames_written = 0;
145 // output_size gets set in open_file, once we know if the frames are PAL or NTSC
146 // output and input are allocated at the same point.
153 int FileDV::open_file(int rd, int wr)
156 TRACE("FileDV::open_file 10")
161 TRACE("FileDV::open_file 20")
164 if (!(asset->height == 576 && asset->width == 720 && asset->frame_rate == 25) &&
165 !(asset->height == 480 && asset->width == 720 && (asset->frame_rate >= 29.96 && asset->frame_rate <= 29.98)))
167 printf("Resolution not supported for dv: %ix%i framerate: %f\n", asset->width, asset->height, asset->frame_rate);
168 if (asset->height == 480 && asset->width == 720 && asset->frame_rate == 30)
170 printf("Suggestion: Proper frame rate for NTSC DV is 29.97\n");
174 if (!(asset->channels == 2 && (asset->sample_rate == 48000 || asset->sample_rate == 44100)) &&
175 !((asset->channels == 4 || asset->channels == 2) && asset->sample_rate == 32000))
177 printf("Audio configuration not supported for dv: channels: %i, sample rate: %i\n", asset->channels, asset->sample_rate);
185 if((stream = fopen(asset->path, "w+b")) == 0)
187 perror(_("FileDV::open_file rdwr"));
191 // Create a new encoder
192 if(encoder) dv_encoder_free(encoder);
193 encoder = dv_encoder_new(0,0,0);
194 encoder->vlc_encode_passes = 3;
195 encoder->static_qno = 0;
196 encoder->force_dct = DV_DCT_AUTO;
198 if(audio_encoder) dv_encoder_free(audio_encoder);
199 audio_encoder = dv_encoder_new(0, 0, 0);
200 audio_encoder->vlc_encode_passes = 3;
201 audio_encoder->static_qno = 0;
202 audio_encoder->force_dct = DV_DCT_AUTO;
204 if(decoder) dv_decoder_free(decoder);
205 decoder = dv_decoder_new(0,0,0);
206 decoder->quality = DV_QUALITY_BEST;
209 isPAL = (asset->height == 576 ? 1 : 0);
210 encoder->isPAL = isPAL;
211 output_size = (isPAL ? DV1394_PAL_FRAME_SIZE : DV1394_NTSC_FRAME_SIZE);
213 // Compare to 16 / 8 rather than == 16 / 9 in case of floating point
215 encoder->is16x9 = asset->aspect_ratio > 16 / 8;
221 TRACE("FileDV::open_file 30")
225 TRACE("FileDV::open_file 40")
227 if((stream = fopen(asset->path, "rb")) == 0)
229 perror(_("FileDV::open_file rd"));
233 // temp storage to find out the correct info from the stream.
234 temp = new unsigned char[DV1394_PAL_FRAME_SIZE];
235 memset(temp, 0, DV1394_PAL_FRAME_SIZE);
237 // need file size info to get length.
238 stat(asset->path, &info);
240 TRACE("FileDV::open_file 50")
242 // read the first frame so we can get the stream info from it
243 // by reading the greatest possible frame size, we ensure we get all the
244 // data. libdv will determine if it's PAL or NTSC, and input and output
245 // buffers get allocated accordingly.
246 fread(temp, DV1394_PAL_FRAME_SIZE, 1, stream);
248 TRACE("FileDV::open_file 60")
250 if(decoder) dv_decoder_free(decoder);
251 decoder = dv_decoder_new(0,0,0);
252 decoder->quality = DV_QUALITY_BEST;
255 if(dv_parse_header(decoder, temp) > -1 )
257 // define video params first -- we need to find out output_size
259 asset->video_data = 1;
262 //TODO: according to the information I found, letterbox and widescreen
263 //are the same thing; however, libdv provides a function to check
264 //if the video feed is one of the other. Need to find out if there
266 if(dv_format_normal(decoder) != 0) asset->aspect_ratio = (double) 4 / 3;
267 else asset->aspect_ratio = (double) 16 / 9;
269 asset->width = decoder->width;
270 asset->height = decoder->height;
272 if(dv_is_progressive(decoder) > 0)
273 asset->interlace_mode = BC_ILACE_MODE_NOTINTERLACED;
275 asset->interlace_mode = BC_ILACE_MODE_BOTTOM_FIRST;
277 isPAL = dv_is_PAL(decoder);
279 output_size = (isPAL ? DV1394_PAL_FRAME_SIZE : DV1394_NTSC_FRAME_SIZE);
280 asset->video_length = info.st_size / output_size;
282 if(!asset->frame_rate)
283 asset->frame_rate = (isPAL ? 25 : 29.97);
284 strncpy(asset->vcodec, "dvc ", 4);
286 // see if there are any audio tracks
287 asset->channels = dv_get_num_channels(decoder);
288 if(asset->channels > 0)
290 asset->audio_data = 1;
291 asset->sample_rate = dv_get_frequency(decoder);
292 // libdv always scales the quantization up to 16 bits for dv_decode_full_audio
294 asset->audio_length = (int64_t) (info.st_size / output_size / asset->frame_rate * asset->sample_rate);
295 strncpy(asset->acodec, "dvc ", 4);
298 asset->audio_data = 0;
302 asset->audio_data = 0;
303 asset->video_data = 0;
306 fseeko(stream, 0, SEEK_SET);
307 TRACE("FileDV::open_file 80")
312 // allocate space for audio and video
313 video_buffer = new unsigned char[output_size + 4];
314 audio_buffer = new unsigned char[output_size + 4];
320 int FileDV::check_sig(Asset *asset)
322 unsigned char temp[3];
323 FILE *t_stream = fopen(asset->path, "rb");
325 fread(&temp, 3, 1, t_stream);
329 if(temp[0] == 0x1f &&
337 int FileDV::close_file_derived()
339 if(stream) fclose(stream);
345 int64_t FileDV::get_video_position()
347 return video_position;
350 int64_t FileDV::get_audio_position()
352 return audio_position;
355 int FileDV::set_video_position(int64_t x)
361 int FileDV::set_audio_position(int64_t x)
367 int FileDV::audio_samples_copy(double **buffer, int64_t len)
369 // take the buffer and copy it into a queue
370 if(!audio_sample_buffer)
372 audio_sample_buffer = new int16_t*[asset->channels];
373 if(!audio_sample_buffer)
375 fprintf(stderr, "ERROR: Unable to allocate memory for audio_sample_buffer.\n");
379 for(int i = 0; i < asset->channels; i++)
381 audio_sample_buffer[i] = new int16_t[len * 2];
383 if(!audio_sample_buffer[i])
385 fprintf(stderr, "ERROR: Unable to allocate memory for "
386 "audio_sample_buffer channel %d\n", i);
390 audio_sample_buffer_maxsize = len * 2;
391 audio_sample_buffer_len = 0;
392 audio_sample_buffer_start = 0;
393 audio_sample_buffer_end = 0;
396 if(audio_sample_buffer_maxsize <= audio_sample_buffer_len + len)
398 // Allocate double the needed size
399 for(int i = 0; i < asset->channels; i++)
401 int16_t *tmp = new int16_t[(audio_sample_buffer_len + len) * 2];
404 fprintf(stderr, "ERROR: Unable to reallocate memory for "
405 "audio_sample_buffer channel %d\n", i);
408 // Copy everything from audio_sample_buffer into tmp
409 for(int a = 0, b = audio_sample_buffer_start;
410 a < audio_sample_buffer_len;
411 a++, b = (b < (audio_sample_buffer_maxsize - 1) ? (b + 1) : 0))
413 tmp[a] = audio_sample_buffer[i][b];
415 // Free the current buffer, and reassign tmp to audio_sample_buffer[i]
416 delete[] audio_sample_buffer[i];
417 audio_sample_buffer[i] = tmp;
419 audio_sample_buffer_start = 0;
420 audio_sample_buffer_end = audio_sample_buffer_len - 1;
421 audio_sample_buffer_maxsize = (audio_sample_buffer_len + len) * 2;
425 for(int i = 0; i < asset->channels; i++)
427 if(len + audio_sample_buffer_end < audio_sample_buffer_maxsize)
429 // copy buffer into audio_sample_buffer, straight out (no loop around)
430 for(int a = 0; a < len; a++)
432 audio_sample_buffer[i][audio_sample_buffer_end + a] =
433 (buffer[i][a] * 32767);
435 if(i == (asset->channels - 1))
436 audio_sample_buffer_end += len;
440 // Need to loop back to the start of audio_sample_buffer
441 int copy_size = audio_sample_buffer_maxsize - audio_sample_buffer_end;
443 for(int a = 0; a < copy_size; a++)
444 audio_sample_buffer[i][a + audio_sample_buffer_end] =
445 (buffer[i][a] * 32767);
447 for(int a = 0; a < len - copy_size; a++)
448 audio_sample_buffer[i][a] = (buffer[i][a + copy_size] * 32767);
450 if(i == (asset->channels - 1))
451 audio_sample_buffer_end = len - copy_size;
455 audio_sample_buffer_len += len;
460 int FileDV::write_samples(double **buffer, int64_t len)
462 if(audio_samples_copy(buffer, len) != 0)
464 fprintf(stderr, "ERROR: Unable to store sample for FileDV::write_samples\n");
467 video_position_lock->lock("FileDV::write_samples");
469 TRACE("FileDV::write_samples 200")
470 // Get number of frames to be written. Order of operations is important here;
471 // the buffer length must be multiplied by the frame rate first in case the
472 // number of samples in the buffer is less than the sample rate.
473 int nFrames = MIN(video_position - audio_frames_written,
474 audio_sample_buffer_len * asset->frame_rate / asset->sample_rate);
476 video_position_lock->unlock();
478 TRACE("FileDV::write_samples 210")
480 int16_t **tmp_buf = new int16_t*[asset->channels];
481 for(int a = 0; a < asset->channels; a++)
482 tmp_buf[a] = new int16_t[asset->sample_rate];
484 TRACE("FileDV::write_samples 220")
486 for(int i = 0; i < nFrames; i++)
488 stream_lock->lock("FileDV::write_samples 10");
489 if(fseeko(stream, (off_t) audio_frames_written * output_size, SEEK_SET) != 0)
491 fprintf(stderr, "ERROR: Unable to set audio write position to %lli\n", (off_t) audio_frames_written * output_size);
492 stream_lock->unlock();
496 if(fread(audio_buffer, output_size, 1, stream) != 1)
498 fprintf(stderr, "ERROR: Unable to read from file\n");
499 stream_lock->unlock();
503 stream_lock->unlock();
507 TRACE("FileDV::write_samples 230")
509 int samples = dv_calculate_samples(audio_encoder, asset->sample_rate,
510 audio_frames_written);
512 if(samples > audio_sample_buffer_maxsize - 1 - audio_sample_buffer_start)
514 TRACE("FileDV::write_samples 240")
515 int copy_size = audio_sample_buffer_maxsize - audio_sample_buffer_start - 1;
517 for(int a = 0; a < asset->channels; a++)
519 memcpy(tmp_buf[a], audio_sample_buffer[a] + audio_sample_buffer_start,
521 memcpy(tmp_buf[a] + copy_size, audio_sample_buffer[a],
522 samples - copy_size);
524 TRACE("FileDV::write_samples 250")
525 // Encode the audio into the frame
526 if(dv_encode_full_audio(audio_encoder, tmp_buf, asset->channels,
527 asset->sample_rate, audio_buffer) < 0)
529 fprintf(stderr, "ERROR: unable to encode audio frame %d\n", audio_frames_written);
534 TRACE("FileDV::write_samples 260")
535 int16_t **tmp_buf2 = new int16_t*[asset->channels];
536 for(int a = 0; a < asset->channels; a++)
537 tmp_buf2[a] = audio_sample_buffer[a] + audio_sample_buffer_start;
538 if(dv_encode_full_audio(audio_encoder, tmp_buf2,
539 asset->channels, asset->sample_rate, audio_buffer) < 0)
541 fprintf(stderr, "ERROR: unable to encode audio frame %d\n", audio_frames_written);
546 TRACE("FileDV::write_samples 270")
548 stream_lock->lock("FileDV::write_samples 20");
549 if(fseeko(stream, (off_t) audio_frames_written * output_size, SEEK_SET) != 0)
551 fprintf(stderr, "ERROR: Unable to relocate for audio write to %lli\n", (off_t) audio_frames_written * output_size);
552 stream_lock->unlock();
556 if(fwrite(audio_buffer, output_size, 1, stream) != 1)
558 fprintf(stderr, "ERROR: Unable to write audio\n");
559 stream_lock->unlock();
563 stream_lock->unlock();
565 audio_frames_written++;
566 audio_sample_buffer_len -= samples;
567 audio_sample_buffer_start += samples;
568 if(audio_sample_buffer_start >= audio_sample_buffer_maxsize)
569 audio_sample_buffer_start -= audio_sample_buffer_maxsize;
572 TRACE("FileDV::write_samples 280")
574 for(int a = 0; a < asset->channels; a++)
578 TRACE("FileDV::write_samples 290")
586 int FileDV::write_frames(VFrame ***frames, int len)
590 if(stream == 0) return 1;
592 for(int j = 0; j < len && !result; j++)
594 VFrame *temp_frame = frames[0][j];
596 //printf("FileDV::write_frames: color_model %i\n", temp_frame->get_color_model());
597 switch(temp_frame->get_color_model())
600 memcpy(video_buffer, temp_frame->get_data(), output_size);
603 //printf("FileDV::write_frames: 4\n");
604 dv_encode_full_frame(encoder, temp_frame->get_rows(),
605 e_dv_color_yuv, video_buffer);
608 //printf("FileDV::write_frames: 5\n");
609 dv_encode_full_frame(encoder, temp_frame->get_rows(),
610 e_dv_color_rgb, video_buffer);
613 unsigned char *data = new unsigned char[asset->height * asset->width * 2];
614 unsigned char **cmodel_buf = new unsigned char *[asset->height];
615 //printf("FileDV::write_frames: 6\n");
616 unsigned char **row_pointers = temp_frame->get_rows();
617 for(int i = 0; i < asset->height; i++)
618 cmodel_buf[i] = data + asset->width * 2 * i;
620 cmodel_transfer(cmodel_buf,
636 temp_frame->get_color_model(),
642 dv_encode_full_frame(encoder, cmodel_buf,
643 e_dv_color_yuv, video_buffer);
649 //printf("FileDV::write_frames: 7\n");
651 // This is the only thread that modifies video_position,
652 // so video_position_lock can remain unlocked for reads.
653 stream_lock->lock("FileDV::write_frames");
654 if(fseeko(stream, (off_t) video_position * output_size, SEEK_SET) != 0)
656 fprintf(stderr, "FileDV::write_frames: Unable to seek file to %lli\n", (off_t)(video_position * output_size));
658 if(fwrite(video_buffer, output_size, 1, stream) < 1)
660 fprintf(stderr, "FileDV::write_frames: Unable to write video data.\n");
662 stream_lock->unlock();
664 video_position_lock->lock();
666 video_position_lock->unlock();
672 int FileDV::read_compressed_frame(VFrame *buffer)
675 if(stream == 0) return 0;
677 if (fseeko(stream, (off_t) video_position * output_size, SEEK_SET))
679 fprintf(stderr, "FileDV::read_compressed_frame: Unable to seek file to %lli\n", (off_t)(video_position * output_size));
681 result = fread(buffer->get_data(), output_size, 1, stream);
684 buffer->set_compressed_size(result);
689 int FileDV::write_compressed_frame(VFrame *buffer)
692 if(stream == 0) return 0;
694 if (fseeko(stream, (off_t) video_position * output_size, SEEK_SET))
696 fprintf(stderr, "FileDV::read_compressed_frame: Unable to seek file to %lli", (off_t)(video_position * output_size));
698 result = fwrite(buffer->get_data(), buffer->get_compressed_size(), 1, stream);
703 int64_t FileDV::compressed_frame_size()
708 int FileDV::read_samples(double *buffer, int64_t len)
712 int frame_count = get_audio_frame(audio_position);
713 int offset = get_audio_offset(audio_position);
715 stream_lock->lock("FileDV::read_samples");
718 stream_lock->unlock();
721 stream_lock->unlock();
723 // If the sample rate is 32 kHz, and the bitsize is 12, libdv
724 // requires we have space allocated for 4 channels even if
725 // the data only contains two channels.
727 // decoder will exist since it is not free'd after open_file
728 int channels = (asset->sample_rate == 32000 && decoder->audio->quantization == 12) ? 4 : 2;
730 int16_t **out_buffer = new int16_t*[channels];
731 for(int i = 0; i < channels; i++)
732 out_buffer[i] = new int16_t[DV_AUDIO_MAX_SAMPLES];
738 if(fseeko(stream, (off_t) frame_count * output_size, SEEK_SET) != 0)
740 stream_lock->unlock();
745 if(fread(audio_buffer, output_size, 1, stream) < 1)
747 stream_lock->unlock();
752 stream_lock->unlock();
756 decoder_lock->lock("FileDV::read_samples");
758 if(dv_decode_full_audio(decoder, audio_buffer, out_buffer) < 0)
760 fprintf(stderr, "Error decoding audio frame %d\n", frame_count - 1);
763 int end = dv_get_num_samples(decoder);
764 decoder_lock->unlock();
766 if(len - count + offset < end)
767 end = len - count + offset;
769 for(int i = offset; i < end; i++)
770 buffer[count++] = out_buffer[file->current_channel][i] / 32767.0;
775 for(int i = 0; i < channels; i++)
776 delete[] out_buffer[i];
779 audio_position += len;
784 int FileDV::read_frame(VFrame *frame)
786 if(stream == 0) return 1;
787 int pitches[3] = {720 * 2, 0, 0};
789 TRACE("FileDV::read_frame 1")
790 unsigned char **row_pointers = frame->get_rows();
793 TRACE("FileDV::read_frame 10")
795 // Seek to video position
796 stream_lock->lock("FileDV::read_frame");
797 if(fseeko(stream, (off_t) video_position * output_size, SEEK_SET) < 0)
799 fprintf(stderr, "FileDV::read_frame: Unable to seek file to %lli", (off_t)(video_position * output_size));
800 stream_lock->unlock();
803 fread(video_buffer, output_size, 1, stream);
804 stream_lock->unlock();
808 TRACE("FileDV::read_frame 20")
810 switch(frame->get_color_model())
814 TRACE("FileDV::read_frame 30")
816 frame->allocate_compressed_data(output_size);
817 frame->set_compressed_size(output_size);
818 memcpy(frame->get_data(), video_buffer, output_size);
822 TRACE("FileDV::read_frame 40")
824 pitches[0] = 720 * 3;
825 decoder_lock->lock("FileDV::read_frame 10");
826 dv_decode_full_frame(decoder, video_buffer, e_dv_color_rgb,
827 row_pointers, pitches);
828 decoder_lock->unlock();
831 TRACE("FileDV::read_frame 50")
832 decoder_lock->lock("FileDV::read_frame 20");
833 dv_decode_full_frame(decoder, video_buffer, e_dv_color_yuv,
834 row_pointers, pitches);
835 decoder_lock->unlock();
839 unsigned char *data = new unsigned char[asset->height * asset->width * 2];
840 unsigned char **temp_pointers = new unsigned char*[asset->height];
842 for(int i = 0; i < asset->height; i++)
843 temp_pointers[i] = data + asset->width * 2 * i;
846 TRACE("FileDV::read_frame 69")
848 decoder_lock->lock("FileDV::read_frame 30");
849 dv_decode_full_frame(decoder, video_buffer, e_dv_color_yuv,
850 temp_pointers, pitches);
851 decoder_lock->unlock();
853 TRACE("FileDV::read_frame 70")
855 cmodel_transfer(row_pointers,
872 frame->get_color_model(),
877 //for(int i = 0; i < asset->height; i++)
878 // delete[] temp_pointers[i];
879 delete[] temp_pointers;
886 TRACE("FileDV::read_frame 80")
893 int FileDV::colormodel_supported(int colormodel)
898 int FileDV::can_copy_from(Edit *edit, int64_t position)
900 if(edit->asset->format == FILE_RAWDV ||
901 (edit->asset->format == FILE_MOV &&
902 (match4(edit->asset->vcodec, QUICKTIME_DV) ||
903 match4(edit->asset->vcodec, QUICKTIME_DVSD) ||
904 match4(edit->asset->vcodec, QUICKTIME_DVCP))))
910 int FileDV::get_best_colormodel(Asset *asset, int driver)
917 case PLAYBACK_X11_XV:
920 case PLAYBACK_DV1394:
921 case PLAYBACK_FIREWIRE:
922 return BC_COMPRESSED;
932 case VIDEO4LINUX2JPEG:
935 case CAPTURE_FIREWIRE:
936 return BC_COMPRESSED;
942 int FileDV::get_audio_frame(int64_t pos)
944 return (double) pos * asset->frame_rate / asset->sample_rate;
947 // Get the sample offset from the frame start reported by get_audio_frame
948 int FileDV::get_audio_offset(int64_t pos)
950 int frame = get_audio_frame(pos);
952 // Samples needed from last frame
953 return pos - frame * asset->sample_rate / asset->frame_rate;
976 DVConfigAudio::DVConfigAudio(BC_WindowBase *parent_window, Asset *asset)
977 : BC_Window(PROGRAM_NAME ": Audio Compression",
978 parent_window->get_abs_cursor_x(1),
979 parent_window->get_abs_cursor_y(1),
983 this->parent_window = parent_window;
987 DVConfigAudio::~DVConfigAudio()
992 int DVConfigAudio::create_objects()
994 add_tool(new BC_Title(10, 10, _("There are no audio options for this format")));
995 add_subwindow(new BC_OKButton(this));
999 int DVConfigAudio::close_event()
1010 DVConfigVideo::DVConfigVideo(BC_WindowBase *parent_window, Asset *asset)
1011 : BC_Window(PROGRAM_NAME ": Video Compression",
1012 parent_window->get_abs_cursor_x(1),
1013 parent_window->get_abs_cursor_y(1),
1017 this->parent_window = parent_window;
1018 this->asset = asset;
1021 DVConfigVideo::~DVConfigVideo()
1026 int DVConfigVideo::create_objects()
1028 add_tool(new BC_Title(10, 10, _("There are no video options for this format")));
1029 add_subwindow(new BC_OKButton(this));
1033 int DVConfigVideo::close_event()