[theora] ogg_stream_pageout function...

Andrea Fontana advmail at katamail.com
Sun Nov 30 13:25:46 PST 2008


I write this small piece of code, that get pixels and encode them:

    ogg_page       page;
    ogg_packet     packet;

    m_frameSource.getYUVBits(m_buffer.y, m_buffer.u, m_buffer.v);

    theora_encode_YUVin(&m_encoder, &m_buffer);

    while(theora_encode_packetout(&m_encoder, isLastFrame, &packet))
        ogg_stream_packetin(&m_oggStream, &packet);

    while (ogg_stream_pageout(&m_oggStream, &page))
    {
        fwrite(page.header,page.header_len, 1, m_oggFile);
        fwrite(page.body,page.body_len, 1, m_oggFile);
    }

This piece of code runs in real-time. I want to remove the last while block
and save theora packets directly to a temporary file. Then when capture is
finished I read packets from temp file and send them to ogg_stream_pageout.
Does this solution improve performance?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/theora/attachments/20081130/43bdc807/attachment.htm 


More information about the theora mailing list