[MPlayer-dev-eng] Re: help on libmpdemux usage (Modifié par Jérôme Cornet)
Alban Bedel
albeu at free.fr
Tue Jan 13 09:57:54 CET 2004
Hi Jérôme Cornet,
on Tue, 26 Aug 2003 18:36:06 +0200 you wrote:
> Hello everyone,
>
> sorry to disturb for that topic, my question does not seem to be in any
> FAQ or mailing list
> someone told me to post here.
>
> I am trying to write a component which would allow QuickTime to read
> the file formats supported by MPlayer, especially the avi format for
> which
> MPlayer's demuxing is famous. I have successfully integrated libmpdemux
> in my component but I don't know how to use it.
It would probably be a good idea to explain a bit more what you are
doing, in particular if you intend to release the code, as some seems
to alredy worry about licenses/legal stuff.
> Actually my component can only read file data from memory. So I have a
> buffer which
> i can fill with a special OS function. I have tried to use a memory
> stream but
> don't know how go further. Here is my init code :
>
> inputStream = new_memory_stream(store->buffer, importerBufferSize);
> demuxer = new_demuxer(inputStream, DEMUXER_TYPE_AVI, 0, 0, 0);
Then you have to read packet's from the demuxer stream's
(ie demuxer->audio and demuxer->video) using ds_get_packet().
Finnaly close the demuxer and the stream.
>
> How can i tell libmpdemux that i have changed my memory buffer? (by
> loading
> it with new data)
Afaik you can't do that with the current "memory stream". You probably
need to write your own stream type wich interface with the API provided
to your component.
> How can i read demuxed data into a buffer?
The demuxers return packets in alredy allocated memory. If you want/need
to copy the data you have to do it yourself.
> Can I get informations on demuxed stream and how? (video size, audio
> sample rate,
> for example).
This is in stream headers (sh_video_t*)demuxer->video->sh and
(sh_audio_t*)demuxer->audio->sh. Note that the demuxer stream
is always present, but it's useable only if ->sh is not NULL.
Albeu
--
Everything is controlled by a small evil group
to which, unfortunately, no one we know belongs.
More information about the MPlayer-dev-eng
mailing list