本文介绍了如何将ffplay作为无窗口进程运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将ffplay作为后台进程运行,该进程将图像数据提供给我的主UI进程.我已设置"SDL_VIDEODRIVER = dummy"以禁止在SDL窗口中显示ffplay视频.

I am running ffplay as a background process which supplies image data to my main UI process. I have set "SDL_VIDEODRIVER = dummy" to suppress the ffplay video being shown in a SDL window.

问题在于,即使未显示视频输出窗口,ffplay进程仍显示为应用程序窗口(坞站,CMD + TAB条目等).我该如何避免呢?

The issue is that the ffplay process still appears as an application window (dock, CMD+TAB entries etc.) even if the video output window is not displayed. How can I avoid that?

推荐答案

SDLMain.m正在添加停靠项,其中到ffplay中才能在Mac上播放.在SDLMain.m中注释了以下各行之后,ffplay作为无窗口进程运行.

The dock entry was being added by SDLMain.m which needs to be compiled into ffplay for it to play on a Mac. After commenting the following lines in SDLMain.m, ffplay is running as a window-less process.

//#ifdef SDL_USE_CPS
//    {
//        CPSProcessSerNum PSN;
//        /* Tell the dock about us */
//        if (!CPSGetCurrentProcess(&PSN))
//            if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
//                if (!CPSSetFrontProcess(&PSN))
//                    [NSApplication sharedApplication];
//    }
//#endif /* SDL_USE_CPS */

/* Set up the menubar */
//[NSApp setMainMenu:[[NSMenu alloc] init]];
//setApplicationMenu();
//setupWindowMenu();

编辑这仅会影响Mac,因为在其他平台上我们不需要SDLMain.m包装器int main()

Edit This only affects Mac since we don't need the SDLMain.m wrapper around int main() on other platforms

这篇关于如何将ffplay作为无窗口进程运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 08:55