Page 1 of 1

imem example code

Posted: 03 Mar 2012 02:27
by quentusrex
My application is generating a PCM audio buffer and I'd like a way to use libvlc to stream the audio out over http. I have figured out all of the pieces, except how to actually send the raw audio data to libvlc. From my searching I have seen references to using imem for this, but I don't see any examples of how to send chunks of the audio at a time.

Any assistance?

Re: imem example code

Posted: 03 Mar 2012 02:53
by quentusrex
As best as I can tell I'm looking at an options string of:

"--imem-cat 1 --imem-get=my_audio_get_function --imem-release=my_audio_release_function --imem-data=pointer_to_data --imem-cookie=the_cookie"

Since I'm passing in audio, imem-cat should be the value 1. From here it seems to me that I have to implement a get function, and a release function. Then the two functions will be passed the pointer, and the cookie. I have yet to figure out what the cookie is for, but if I under stand the other pieces correctly I think I'm getting closer.

I realize I will probably need to set the codec, channels and samplerate as well, but that seems simple enough.

Re: imem example code

Posted: 03 Mar 2012 07:21
by RĂ©mi Denis-Courmont
The cookie is useless in your use case. Ignore it.

Re: imem example code

Posted: 22 Dec 2012 21:02
by axet
can you provide more details about imem?

i do not understand how to use it.