[Live-devel] generic MP3source and streamState

pierre.lhussiez pierre.lhussiez at laposte.net
Thu Aug 25 11:11:17 PDT 2005


Hi ross,
What do you think about to change something in the MP3StreamState class to allow MP3StreamState::readFromStream(unsigned char* buf, unsigned numChars) to read from another source than a file.
It will give the choice to read from file, or from any kind of buffer. 
I have changed MP3StreamState::readFromStream() access type from private to protected, so i could have created a generic MP3streamState able to handle file input type and some other extra inputs types. May be it will be better to virtualize MP3StreamState::readFromStream(), i don't know.

If you decide to add this little change to the next release then there will be an another interesting (to my mind) modification to do. I explain:
For now, the MP3FileSource class use an MP3streamState object to read from stream , but it will be interesting to create a generic MP3Source which would use the generic MP3StreamState class instead MP3streamState class. For now the MP3streamState used by theMP3FileSource is instanced in the constructor:
MP3FileSource::MP3FileSource(UsageEnvironment& env, FILE* fid)
: FramedFileSource(env, fid),
fStreamState(new MP3StreamState(env)) { }
So i'm not able to use the generic StreamState class instead of the MP3StreamState one without adding change to the MP3FileSource class.
Can we add a public method
MP3FileSource::assignStreamState(GenericMP3StreamState *streamState) Or modify the MP3FileSource::CreateNew() method to take the desired streamState in input parameter.

Adding those kind of modification would allow peoples to reuse MP3FileSource class and MP3StreamState class to read from another source type without having to modify those class.

Accédez au courrier électronique de La Poste : www.laposte.net ; 
3615 LAPOSTENET (0,34€/mn) ; tél : 08 92 68 13 50 (0,34€/mn)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.live.com/pipermail/live-devel/attachments/20050825/dd4b6c05/attachment.html


More information about the live-devel mailing list