Re: libmng data-push mechanism(s)
"Gerard Juyn" <gjuyn-qWit8jRvyhVmR6Xm/[email protected]> Thu, 15 Apr 2004 18:58:35 +0200
| Newsgroups | gmane.comp.graphics.mng.general |
|---|---|
| Organization | Triple-T |
| Message-ID | <407EDB5B.19417.A2F4B77@localhost> |
> I've done now following
>
> imgContainerMNG::WriteMNG(const char* rawData, PRUint32 count, PRUint32*
> writeCount) { fprintf(stderr, "Push %d Data to MNG\n",count);
> int error = mng_read_pushdata(mHandle, NS_CONST_CAST(char *, rawData),
>
> count, MNG_FALSE);
> fprintf(stderr, "Push error %d\n",error);
> *writeCount=count;
>
> --> I've now added this 2 lines
>
> int ret = mng_display_resume(mHandle);
> fprintf(stderr, "Resume error %d\n",ret);
>
> --> Above lines added.
>
> return NS_OK;
> }
>
> And now it works. The programming is not how I'd expected it ... but OK
> it works. :-)
Ah yes. Perhaps my instructions weren't clear enough. Whenever libmng
returns MNG_NEEDTIMERWAIT you need to wait for the previously set interval
and then call display_resume().
The same is true for MNG_NEEDMOREDATA; you just have to wait for data to
come back in, read_pushdata() it, and then call display_resume().
A similar thing would have been in place previously, except you (or rather tor)
would have buffered the data yourself and waited for the readdata() callback
to actually put it into libmng.
But I'm happy it works! Good job!
Gerard
--
Send the message body "help" to [email protected]