如何将ffplay作为无窗口进程运行? [英] How to run ffplay as a window-less process?

查看:865
本文介绍了如何将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正在添加停靠项,其中

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作为无窗口进程运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆