Calling get_frame constantly without waiting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Nov 15, 2009 at 8:56 PM, Emil Berg <emilbergg at gmail.com> wrote:
> Hello,
>
> I'm using only the pjmedia library and I'm not sure how to retrieve data
> correctly.
> A listener thread is calling get_frame() and if it doesn't receive any frame
> (or receives an empty buffer),
> then I sleep for 1 millisecond and call it again.
>
> Is it good to sleep so little time?
> I'm afraid that when calling the get_frame() with such little pauses, the
> jitter buffer gets empty after each call, thus becomes useless.
> Am I right?
>

Calling get_frame() repeatedly on a stream is probably a bad idea, as
the stream gets its "clock" from the get_frame() calls. A better idea
is to use the master clock (please see pjmedia docs), which will
create a thread and do get_frame() on a regular interval for you.

Cheers
 Benny



> Thanks,
> Emil.
>



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux