Ignore:
Timestamp:
08/27/10 04:10:58 (21 months ago)
Author:
shiretu
Message:

-- android stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/thelib/src/protocols/rtp/connectivity/baseconnectivity.cpp

    r49 r109  
    2121#include "protocols/rtp/connectivity/baseconnectivity.h" 
    2222 
     23//#define LIVE555WAY 
     24 
    2325BaseConnectivity::BaseConnectivity() { 
    2426 
     
    2729BaseConnectivity::~BaseConnectivity() { 
    2830} 
     31 
     32uint32_t BaseConnectivity::ToRTPTS(struct timeval &tv, uint32_t rate) { 
     33#ifdef LIVE555WAY 
     34        u_int32_t timestampIncrement = (rate * tv.tv_sec); 
     35        timestampIncrement += (u_int32_t) ((2.0 * rate * tv.tv_usec + 1000000.0) / 2000000); 
     36        return timestampIncrement; 
     37#else 
     38        return (uint32_t) ((((double) tv.tv_sec * 1000000.00 + (double) tv.tv_usec) / 1000000.00)*(double) rate); 
     39#endif 
     40} 
     41 
     42uint32_t BaseConnectivity::ToRTPTS(double milliseconds, uint32_t rate) { 
     43#ifdef LIVE555WAY 
     44        struct timeval tv; 
     45        tv.tv_sec = (milliseconds / 1000.00); 
     46        tv.tv_usec = (((uint32_t) milliseconds) % 1000)*1000; 
     47        return ToRTPTS(tv, rate); 
     48#else 
     49        return (uint32_t) ((milliseconds / 1000.00)*(double) rate); 
     50#endif 
     51} 
     52 
    2953#endif /* HAS_PROTOCOL_RTP */ 
Note: See TracChangeset for help on using the changeset viewer.