How to IPC with utility process

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

How to IPC with utility process

Postby Nicky » Wed Jul 08, 2020 4:29 pm

I want to send messages from the browser process to the utility (--type=utility) process.
There is SendProcessMessage and OnProcessMessageReceived for this, But for SendProcessMessage I can only set either PID_BROWSER or PID_RENDERER, I would expect something like PID_UTILITY.
I tried treating it like a rendering process (using PID_RENDER and passing a CefRenderProcessHandler implementation to CefExecuteProcess) but it didn't work; ultimately it makes no real sense anyway that it works like that, but I wanted to try before creating a thread here.

Is there some supported way to send messages to the utility process? I obviously could rig my own, but not only would this be very messy, it also would be very platform specific; while CEF or at least Chromium under the hood must already be fully capable of talking to the utility process and exchanging messages with it.
Nicky
Newbie
 
Posts: 2
Joined: Fri May 01, 2020 3:55 pm

Re: How to IPC with utility process

Postby magreenblatt » Wed Jul 08, 2020 5:18 pm

Why do you want to send IPC messages to the utility process?
magreenblatt
Site Admin
 
Posts: 10188
Joined: Fri May 29, 2009 6:57 pm

Re: How to IPC with utility process

Postby Nicky » Thu Jul 09, 2020 3:17 am

It's another iteration for calum's problem here: viewtopic.php?f=6&t=17533

The utility process is the one who plays the audio when AudioServiceOutOfProcess is true. So my idea was to send a volume message to this process and then handle it accordingly.\

I tried your other suggestion from that thread (walking the DOM via Javascript), but on sites like youtube this became quickly non trivial (admittedly I am no experienced JavaScript Developer)
I also tried using chrome.tabCapture.capture to capture the tab, then get an audio context, a gain sink etc for it, but again no luck. Using this would have been my preferred solution, as it is the least intrusive of them all.
Nicky
Newbie
 
Posts: 2
Joined: Fri May 01, 2020 3:55 pm

Re: How to IPC with utility process

Postby magreenblatt » Thu Jul 09, 2020 10:18 am

You can use CefAudioHandler to get the audio content, mute CEF playback with CefBrowserHost::SetAudioMuted, then play the audio yourself at whatever volume you prefer.
magreenblatt
Site Admin
 
Posts: 10188
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 28 guests