I'm trying to replace a rtp sender loop with libev using ev_periodic.
It should start at a given time and since then it should output a packet
depending on the time previous packet takes to be played (this is an
rtsp/rtp server).
Right now I'm using ev_periodic_set and ev_periodic_again inside the
ev_periodic callback action. From time to time the frame in the packet
is fragmented, thus having the function to reschedule itself to ev_now.
You have such periodic event for each stream being sent.
the result is strange:
[send] MPA 1239035856.358935 mtime 0.000000 duration 0.026122 send time
1239035856.385057
[send] H264 1239035856.358935 mtime 0.000000 duration 0.040000 send time
1239035856.358935
[send] H264 1239035856.359215 mtime 0.000000 duration 0.040000 send time
1239035856.359215
[send] H264 1239035856.366715 mtime 0.040000 duration 0.040000 send time
1239035856.406715
[send] MPA 1239035856.385120 mtime 0.026122 duration 0.026122 send time
1239035856.411242
[send] H264 1239035856.408131 mtime 0.080000 duration 0.040000 send time
1239035856.448131
[send] MPA 1239035856.413124 mtime 0.052245 duration 0.026122 send time
1239035856.439246
the H264 packet with mtime 0.04 is sent before the mpa one with mtime
0.02 even if it is scheduled before and it's deadline is between the 4th
and the 5th packet same goes for the following ones.
The actual code could be seen in rtp_write_cb
http://cgit.lscube.org/cgit.cgi/feng/tree/src/network/rtp.c
I wonder which is the proper way to archive my aim.
lu
--
Luca Barbato
Gentoo Council Member
Gentoo/linux Gentoo/PPC
http://dev.gentoo.org/~lu_zero
_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev