使用Gtk和FFmpeg显示带覆盖层的视频及MIDI介绍
一、使用Gtk和FFmpeg显示视频基础设置
在使用Gtk和FFmpeg显示视频时,首先要进行一系列的初始化操作。以下是相关代码示例:
gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); /* When the window is given the "delete-event" signal (this is given * by the window manager, usually by the "close" option, or on the * titlebar), we ask it to call the delete_event () function * as defined above. The data passed to the callback * function is NULL and is ignored in the callback function. */ g_signal_connect (window, "delete-event", G_CALLBACK (delete_event), NULL); /* Here we connect the "destroy" event to a signal handler. * This event occurs when we call gtk_widget_destroy() on the window, * or if we return FA