RainbowDu
23rd May 2006, 12:09
hi, experts
In my appliction project about online xvid player, the DirectShow source filter gather m4v data through listening incoming UDP packets. In recvfrom() function, I can get data wrapped by UDP. Almost every frame is splitted into several packets. In each packet, m4v data follows a "header data" for the sake of specifying it. In a word, if samply join its all packets, a full m4v frame can be reperesented as following
h1d1 h2d2 h3d3 ...
where "h1" is the "header" of the first packet, "d1" is m4v data in the same packet.
Of course, I can receive all these packets to a temp buffer, and then copy them to pSample's buffer obtained from filter. Unfortunatly, copyMemory() calls consump large cpu time.
Can I save these copyMemory() call? I wish to solve this prolem by receive data directly to pSample, but since each packet has its "header data", it is impossible just sending an offset of pSample's buffer to recvfrom().
Is there any methods to achive only m4v data coming from socket(noted:not stream, but packets) without using temp buffer?
In my appliction project about online xvid player, the DirectShow source filter gather m4v data through listening incoming UDP packets. In recvfrom() function, I can get data wrapped by UDP. Almost every frame is splitted into several packets. In each packet, m4v data follows a "header data" for the sake of specifying it. In a word, if samply join its all packets, a full m4v frame can be reperesented as following
h1d1 h2d2 h3d3 ...
where "h1" is the "header" of the first packet, "d1" is m4v data in the same packet.
Of course, I can receive all these packets to a temp buffer, and then copy them to pSample's buffer obtained from filter. Unfortunatly, copyMemory() calls consump large cpu time.
Can I save these copyMemory() call? I wish to solve this prolem by receive data directly to pSample, but since each packet has its "header data", it is impossible just sending an offset of pSample's buffer to recvfrom().
Is there any methods to achive only m4v data coming from socket(noted:not stream, but packets) without using temp buffer?