Has anyone implemented their own CefAudioHandler yet?

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.

Has anyone implemented their own CefAudioHandler yet?

Postby callum » Fri Feb 19, 2021 8:13 pm

Upgrading CEF in our application to 4324 (Chrome 88) mostly to pick up the recent Chromium exploits and I wanted to also address the various audio issues we have by using the ForceWaveAudio mode, and finally implementing a CefAudioHandler() implementation.

I have hooked up the interface and getting valid looking callbacks in OnAudioStreamPacket(...) etc. so now I need to select an SDK to play back the audio data. I might be able to use something our main application builds against (FMod) and if not, Port Audio is looking like a reasonable choice. (https://portaudio.com).

My question is how do you keep the audio in sync with the video? I don't see any in the callbacks that help such as a high resolution time offset from the stream start position. If anyone has tackled this and can share what they did, I'd be very grateful.
callum
Expert
 
Posts: 326
Joined: Mon Feb 23, 2015 6:19 pm

Re: Has anyone implemented their own CefAudioHandler yet?

Postby Zabrimus » Fri Feb 26, 2021 6:42 am

I implemented both OnPaint and OnAudioStreamPacket to do some encoding and muxing.
PTS of Audiostream is a parameter of OnAudioStreamPacket (in ms, must be multiplied with 1000 to be in sync with Videostream).
PTS of Videostream is av_gettime() from avutil (ffmpeg) (in ns).

The last code changes/many fixes are not yet committed and the repository is a little bit outdated and still wrong, but i hope you can get the idea.
https://github.com/Zabrimus/vdr-osr-bro ... andler.cpp
https://github.com/Zabrimus/vdr-osr-bro ... ncoder.cpp

Zabrimus
Zabrimus
Newbie
 
Posts: 6
Joined: Mon Apr 13, 2020 1:17 pm

Re: Has anyone implemented their own CefAudioHandler yet?

Postby callum » Mon Mar 01, 2021 3:55 pm

Zabrimus wrote:The last code changes/many fixes are not yet committed and the repository is a little bit outdated and still wrong, but i hope you can get the idea.

Thank you! I had a quick look and seems very promising - bookmarked for later today.

Much appreciated! Cheers!
callum
Expert
 
Posts: 326
Joined: Mon Feb 23, 2015 6:19 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 63 guests