Changeset 109


Ignore:
Timestamp:
08/27/10 03:10:58 (18 months ago)
Author:
shiretu
Message:

-- android stuff

Location:
trunk/sources
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/androidapplestreaming/src/api.cpp

    r102 r109  
    139139        } 
    140140 
     141#ifdef HAS_PROTOCOL_RTMP 
    141142        //9. Create the RTMP acceptor 
    142143        acceptorConfig[CONF_PORT] = (uint16_t) (1935); 
     
    151152                ASSERT("Unable to fire up acceptor"); 
    152153        } 
     154#endif /* HAS_PROTOCOL_RTMP */ 
    153155 
    154156        //10. Create the timer UDP protocol 
  • trunk/sources/androidapplestreaming/src/main.cpp

    r106 r109  
    136136//#define MY_SESSION_ID "playback=HTTP_CLOUD_MOBILE&contentId=11090061&appAccountName=mlb&eventId=14-265698-2010-08-25&ipid=11627706&sessionKey=Pff4k8IQCTNjs46Plh6%2BBOvMEBw%3D&deviceId=ANDROID_A0000022419B22&country=us&postalCode=10011&platform=ANDROID" 
    137137 
    138 #define MY_URL "http://localhost/~shiretu/ts10/200/prog_index.m3u8" 
    139 #define MY_KEY "" 
    140 #define MY_SESSION_ID "" 
     138//#define MY_URL "http://localhost/~shiretu/ts10/200/prog_index.m3u8" 
     139//#define MY_KEY "" 
     140//#define MY_SESSION_ID "" 
     141 
     142#define MY_URL "http://mlblive-akc.mlb.com/mlbam/2010/08/26/MLB_GAME_VIDEO_ARISDN_HOME_20100826/master_mobile.m3u8" 
     143#define MY_KEY "Ey5xHlceWWeYwHOlMRuYMm/DZqE=" 
     144#define MY_SESSION_ID "playback=HTTP_CLOUD_MOBILE&contentId=11131241&appAccountName=mlb&eventId=14-265710-2010-08-26&ipid=11627706&sessionKey=8EcVAKWRJQVyLjuxvLCJXgz6aSI%3D&deviceId=ANDROID_null&country=us&postalCode=10011&platform=ANDROID" 
    141145 
    142146//#define CONDENSED_CONN_STRING "base64:aHR0cDovL21sYnZvZC1ha2MubWxiLmNvbS9tbGJhbS8yMDEwLzA0LzA4L01MQl9HQU1FX1ZJREVPX0xBTlBJVF9IT01FXzIwMTAwNDA4L21hc3Rlcl93aXJlZC5tM3U4fHlNQmVFcEl6OEJEaUFYV0k0dUdIUm1UaHdIRT18cGxheWJhY2s9SFRUUF9DTE9VRF9XSVJFRCZjb250ZW50SWQ9NzMyMDA4NSZhcHBBY2NvdW50TmFtZT1tbGImZXZlbnRJZD0xNC0yNjM4NDktMjAxMC0wNC0wOCZpcGlkPTExNjI3NzA2JnNlc3Npb25LZXk9cUNveGRIaUlOY3FDbHlEcEZoU2dma3dJSWc0JTNE" 
     
    148152 
    149153        uint32_t contextId = (uint32_t) ASC_RES_PARAM(result, "contextId"); 
    150         result = CommandSetBitrates(contextId, " []"); 
     154        result = CommandSetBitrates(contextId, " [800000]"); 
    151155        FINEST("result:\n%s", STR(result.ToString())); 
    152156 
  • trunk/sources/applications/applestreamingclient/include/clientcontext.h

    r104 r109  
    7070        StreamsManager *_pStreamsManager; 
    7171        double _lastWallClock; 
     72        double _firstFeedTime; 
    7273        map<uint32_t, uint32_t> _allowedBitrates; 
    7374private: 
  • trunk/sources/applications/applestreamingclient/src/clientcontext.cpp

    r106 r109  
    5656        _lastWallClock = 0; 
    5757        _avData.EnsureSize(_maxAVBufferSize * 3); 
     58        _firstFeedTime = 0; 
    5859        INFO("Context created: %d (%p)", _id, this); 
    5960} 
     
    323324        //1. initialize _lastFeedTime 
    324325        if (_lastWallClock == 0) { 
     326#ifdef HAS_MS_TIMER 
     327                GETCLOCKS(_lastWallClock); 
     328#else 
    325329                _lastWallClock = time(NULL)*1000.0; 
     330#endif /* HAS_MS_TIMER */ 
    326331                return true; 
    327332        } 
     
    385390 
    386391        //5. How much seconds do we have to feed? 
     392#ifdef HAS_MS_TIMER 
     393        double currentTime; 
     394        GETCLOCKS(currentTime); 
     395        double wallClockDelta = ((currentTime - _lastWallClock) / (double) CLOCKS_PER_SECOND)*1000.00; 
     396#else 
    387397        double wallClockDelta = time(NULL)*1000.00 - _lastWallClock; 
     398#endif /* HAS_MS_TIMER */ 
     399 
     400        if (_firstFeedTime == 0) { 
     401                _firstFeedTime = pStream->GetFeedTime(); 
     402        } 
    388403 
    389404        //6. Feed 
    390405        //      FINEST("BEFORE: wallClockDelta: %.2f; GetFeedTime: %.2f", 
    391406        //                      wallClockDelta, pStream->GetFeedTime()); 
    392         while ((wallClockDelta > (pStream->GetFeedTime())) && 
     407        while ((wallClockDelta + 1000 > (pStream->GetFeedTime() - _firstFeedTime)) && 
    393408                        (GETAVAILABLEBYTESCOUNT(_avData) > 8192)) { 
    394409                if (!pTS->SignalInputData(_avData)) { 
  • trunk/sources/thelib/include/protocols/rtp/connectivity/baseconnectivity.h

    r58 r109  
    2828        BaseConnectivity(); 
    2929        virtual ~BaseConnectivity(); 
     30 
     31        static uint32_t ToRTPTS(struct timeval &tv, uint32_t rate); 
     32        static uint32_t ToRTPTS(double milliseconds, uint32_t rate); 
    3033}; 
    3134 
  • 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 */ 
  • trunk/sources/thelib/src/protocols/rtp/connectivity/outboundconnectivity.cpp

    r108 r109  
    529529 
    530530        //6. RTP 
    531         uint32_t timestampIncrement = (rate * timeNow.tv_sec); 
    532         timestampIncrement += (uint32_t) ((2.0 * rate * timeNow.tv_usec + 1000000.0) / 2000000); 
    533         uint32_t rtpTimestamp = 0 + timestampIncrement; 
    534         put_htonl(pDest + 16, rtpTimestamp); 
     531        put_htonl(pDest + 16, ToRTPTS(timeNow, rate)); 
    535532 
    536533        //7. sender's packet count 
  • trunk/sources/thelib/src/protocols/rtp/streaming/outnetrtpudph264stream.cpp

    r106 r109  
    228228                //3. Timestamp 
    229229                put_htonl(((uint8_t *) _videoData.msg_iov[0].iov_base) + 4, 
    230                                 (uint32_t) (absoluteTimestamp * 90.0)); 
     230                                BaseConnectivity::ToRTPTS(absoluteTimestamp, 90000)); 
    231231 
    232232                if (chunkSize == totalLength) { 
     
    316316                //4. Timestamp 
    317317                put_htonl(((uint8_t *) _audioData.msg_iov[0].iov_base) + 4, 
    318                                 (uint32_t) (absoluteTimestamp 
    319                                 * (double) GetCapabilities()->audioCodecInfo.aac.sampleRate / 1000.000)); 
     318                                BaseConnectivity::ToRTPTS(absoluteTimestamp, 
     319                                GetCapabilities()->audioCodecInfo.aac.sampleRate)); 
    320320 
    321321                //6. put the actual buffer 
Note: See TracChangeset for help on using the changeset viewer.