imem example code

This forum is about all development around libVLC.
quentusrex
New Cone
New Cone
Posts: 6
Joined: 20 Dec 2007 02:29

imem example code

Postby quentusrex » 03 Mar 2012 02:27

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?

quentusrex
New Cone
New Cone
Posts: 6
Joined: 20 Dec 2007 02:29

Re: imem example code

Postby quentusrex » 03 Mar 2012 02:53

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.

Rémi Denis-Courmont
Developer
Developer
Posts: 15229
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: imem example code

Postby Rémi Denis-Courmont » 03 Mar 2012 07:21

The cookie is useless in your use case. Ignore it.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

axet
Blank Cone
Blank Cone
Posts: 13
Joined: 13 Jun 2007 12:54

Re: imem example code

Postby axet » 22 Dec 2012 21:02

can you provide more details about imem?

i do not understand how to use it.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 12 guests