[Live-devel] Reception Packet Information
Ross Finlayson
finlayson at live.com
Tue Jun 22 03:10:33 PDT 2004
>In RTCP.hh added the following method definition:
>void getCurrentReceiverPacketInfo(long* numPacketReceived, long*
>numPacketLost);
> // hack to allow application that creates RTCPInstance to retrieve
> // packet information since last reset.
>
>Then in RTCP.cpp:
>// Implemented by MGC to retrieve receiver packet loss information.
>void RTCPInstance::getCurrentReceiverPacketInfo(long* numPacketReceived,
>long* numPacketLost) {
> if (fSource != NULL) {
> RTPReceptionStatsDB& allReceptionStats =
> fSource->receptionStatsDB();
No, you shouldn't need to add anything to the "RTCPInstance"
class. Instead, just use the "RTPSource" object directly. I.e., in your
(receiving) client code, just get the 'reception stats' directly from the
"RTPSource" object, as you did in the last line quoted above. You don't
need to do anything at all with the "RTCPInstance" object.
>The way to use is to create an RTCPInstance within your application and then
>call the method anytime you want. For example, I created a thread for
>testing:
>DWORD WINAPI thread_proc(LPVOID lpParameter) {
> long x = 0;
> long y = 0;
> while (1){
>
>sessionState.rtcpInstance->getCurrentReceiverPacketInfo(&x, &y);
> Sleep(5000); // For testing.
> }
>}
That's bad. You shouldn't call the LIVE.COM library from more than one
thread like this. See the FAQ. Instead, do this within an event handler
(e.g., using "scheduleDelayedTask()").
Ross Finlayson
LIVE.COM
<http://www.live.com/>
More information about the live-devel
mailing list