Done.
/*********************************** <Br /> * a FIFO queue for encoded data <br/> * and RTP sender. <br/> * encoder write, RTP sender read. <br/> * Author: norz. <br/> * Date: 2011.02.21 <br/> * version: 1.01 <br/> *********************************** **/<br/> # ifndef _ rtp_1_o_h _ <br/> # DEFINE _ rtp_1_o_h _ <br/> # include <stdio. h> <br/> # include <stdlib. h> <br/> # include <stdint. h> <br/> # include <string. H> <br/> # include "rtperrorinfo. H "<br/> const int readsize = 1360; // each RTP packet own 1360 bytes payload <br/> const int max_data_size = 20*1024; <br/> class rtpfifo; <br/>/******************************** <br /> * the node class for the FIFO <br/> *************************** * ***/<br/> class rtpfifonode <br/> {<br/> public: <br/> uint8_t * data; // a buffer for encoded data <br/> size_t size ;// Available size of the buffer <br/> unsigned int offset; // offset of this node, probale read once cannot read out this buffer <br/> void * next; // a pointer point to next position, void type is smaller-_-| <br/> rtpfifonode (); <br/> rtpfifonode (uint8_t * D, size_t Len ); <br/> ~ Rtpfifonode (); <br/> size_t getremainingsize (); // return remaining buffer size (size-offset) <br/> void setoffset (int ofs ); // set Offset equal to offset + OFS <br/> }; <br/>/************************ <br/> * The FIFO control class <br/> ************************/<br/> class rtpfifo <br/> {< br/> public: <br/> rtpfifo (); <br/> ~ Rtpfifo (); <br/> rtpfifostatus write (uint8_t * item, size_t size); // public method for enqueue <br/> rtpfifostatus read (uint8_t * pbuf, size_t size ); // public method for dequeue, deal some conditions <br/> uint8_t * getfrontdata (); // get front node's buffer <br/> size_t getfrontsize (); // get front node's size <br/> size_t getfrontremainingsize (); // get front remaing size <br/> rtpfifostatus isempty (); // Return Current FIFO status <br/> PRIVATE: <br/> rtpfifostatus enqueue (uint8_t * item, size_t size); <br/> void dequeue (); <br/> rtpfifonode * front; // front node always point to the head <br/> rtpfifonode * rear; // rear node always point to the tail <br/> }; <br/> # endif // _ rtp_1_o_h _ <br/>
To do list:
1. Interaction with the upper layer, including obtaining the surface and signaling negotiation results
2. Time Synchronization or cache mechanism
At present, time synchronization is not considered... but why can't we draw images from surface, surfacecontrol, and isurface on the Java layer...
Is it a dynamic library problem? Okay... it turned out to be a Java-layer student who didn't set the surface type when processing surfaceholder... the problem of surface was solved.