cef and audio in OSR mode

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

cef and audio in OSR mode

Postby tgayet » Mon May 27, 2019 11:29 am

hi,

I am using CEF without any display, in OnScreenRendering mode and handles the recovery of images from the onPaint callback.

In this browser, I read a video and I wanted to know if in this mode I should have the sound too? is it sent to audio pulse or droped?

Is it already planned to have a callback for the sound as the one proposed for the video?

Thanks in advance.

Thierry
tgayet
Techie
 
Posts: 27
Joined: Wed Apr 24, 2019 6:53 am

Re: cef and audio in OSR mode

Postby magreenblatt » Mon May 27, 2019 11:32 am

magreenblatt
Site Admin
 
Posts: 12384
Joined: Fri May 29, 2009 6:57 pm

Re: cef and audio in OSR mode

Postby tgayet » Wed May 29, 2019 2:58 am

hi,

Thanks for your reply.

I saw the commit provided about the interface for the audio frames. In addition to unit tests, I would have liked to know if you would have an example of functional use of this interface?

Indeed, i wanna know if there is somewhere an example of functional code that implement the audio interface.

Thanks in advance.

Thierry
tgayet
Techie
 
Posts: 27
Joined: Wed Apr 24, 2019 6:53 am

Re: cef and audio in OSR mode

Postby jgh » Sun Jul 14, 2019 10:53 am

The relevant interface (IIRC 3683+ or maybe the version earlier than that) is CefAudioHandler - it works like the RenderHandler, check the header file that contains it for the functions you need to implement to make the audio callbacks work. I have implemented it myself and it works well, my only complaint is the audio streams are floating point but that's a pretty minor one.
jgh
Techie
 
Posts: 16
Joined: Sun Jul 14, 2019 10:38 am

Re: cef and audio in OSR mode

Postby tgayet » Mon Jul 15, 2019 5:02 am

hi jgh,

Is it possible to share a little part of the callback in order to have a asample ?

How did you test it ? did you valid it over ffplay, vlc or gstreamer ?

Thanks in advance.

BR
tgayet
Techie
 
Posts: 27
Joined: Wed Apr 24, 2019 6:53 am

Re: cef and audio in OSR mode

Postby jgh » Tue Jul 16, 2019 4:45 am

My code is part of a larger media system so it is not really trivial for me to pull out a working example implementation. The interface is used just like the render handler interface for offscreen rendering though (or indeed any of the other interfaces you need to implement just to get CEF working).

The interface you're looking for is CefAudioHandler, and the minimum functions you need to implement to make it work are:

- CefAudioHandler::OnAudioStreamStarted where you are notified that a new audio stream has started and you are given the properties of the LPCM stream.
- CefAudioHandler::OnAudioStreamPacket where you receive audio buffers. They are in non-interlaced 32-bit float format.
- CefAudioHandler::OnAudioStreamStopped where you are notified that an audio stream has ended.

I've tested it by encoding and streaming it to external livestreaming platforms (and monitoring properties like rms).
jgh
Techie
 
Posts: 16
Joined: Sun Jul 14, 2019 10:38 am


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 29 guests