Changeset 718


Ignore:
Timestamp:
01/14/12 03:59:44 (4 months ago)
Author:
josh
Message:

-- RTMP: Allow application-selectable innet streams.

Location:
trunk/sources/thelib
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/thelib/include/protocols/rtmp/basertmpappprotocolhandler.h

    r715 r718  
    3333class BaseRTMPProtocol; 
    3434class BaseOutFileStream; 
     35class InNetRTMPStream; 
    3536 
    3637class DLLEXP BaseRTMPAppProtocolHandler 
     
    244245         * */ 
    245246        virtual BaseOutFileStream *CreateOutFileStream(BaseRTMPProtocol *pFrom, Variant &meta, bool append); 
     247 
     248        /* 
     249         * Create a file stream for writing to disk. 
     250         * pFrom - The connection which wants to stream to disk 
     251         * meta - Stream metadata 
     252         * append - Whether to append this stream to an exiting file 
     253         * */ 
     254        virtual InNetRTMPStream *CreateInNetStream(BaseRTMPProtocol *pFrom, 
     255                uint32_t channelId, uint32_t streamId, string streamName); 
     256 
    246257private: 
    247258        /* 
  • trunk/sources/thelib/include/protocols/rtmp/basertmpprotocol.h

    r651 r718  
    104104 
    105105        uint32_t GetOutboundChunkSize(); 
     106        uint32_t GetInboundChunkSize(); 
    106107        bool SetInboundChunkSize(uint32_t chunkSize); 
    107108        void TrySetOutboundChunkSize(uint32_t chunkSize); 
  • trunk/sources/thelib/include/protocols/rtmp/streaming/innetrtmpstream.h

    r715 r718  
    5454        uint64_t _videoDroppedBytesCount; 
    5555public: 
    56         InNetRTMPStream(BaseProtocol *pProtocol, StreamsManager *pStreamsManager, 
    57                         string name, uint32_t rtmpStreamId, uint32_t chunkSize, 
    58                         uint32_t channelId); 
     56        InNetRTMPStream(BaseRTMPProtocol *pProtocol, StreamsManager *pStreamsManager, 
     57                        string name, uint32_t rtmpStreamId, uint32_t channelId); 
    5958        virtual ~InNetRTMPStream(); 
    6059        virtual StreamCapabilities * GetCapabilities(); 
  • trunk/sources/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp

    r715 r718  
    18871887} 
    18881888 
     1889InNetRTMPStream *BaseRTMPAppProtocolHandler::CreateInNetStream( 
     1890        BaseRTMPProtocol *pFrom, uint32_t channelId, uint32_t streamId, 
     1891        string streamName) { 
     1892        return new InNetRTMPStream(pFrom, 
     1893                GetApplication()->GetStreamsManager(), streamName, streamId, channelId); 
     1894 
     1895} 
     1896 
    18891897string NormalizeStreamName(string streamName) { 
    18901898        replace(streamName, "-", "_"); 
  • trunk/sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp

    r693 r718  
    312312} 
    313313 
     314uint32_t BaseRTMPProtocol::GetInboundChunkSize() { 
     315        return _inboundChunkSize; 
     316} 
     317 
    314318bool BaseRTMPProtocol::SetInboundChunkSize(uint32_t chunkSize) { 
    315319        /*WARN("Chunk size changed for RTMP connection %p: %u->%u", this, 
     
    424428 
    425429InNetRTMPStream * BaseRTMPProtocol::CreateINS(uint32_t channelId, 
    426                 uint32_t streamId, string streamName) { 
     430        uint32_t streamId, string streamName) { 
    427431        if (streamId == 0 || streamId >= MAX_STREAMS_COUNT) { 
    428432                FATAL("Invalid stream id: %u", streamId); 
     
    443447        _streams[streamId] = NULL; 
    444448 
    445         InNetRTMPStream *pStream = new InNetRTMPStream(this, 
    446                         GetApplication()->GetStreamsManager(), streamName, streamId, 
    447                         _inboundChunkSize, channelId); 
    448  
     449        InNetRTMPStream *pStream = _pProtocolHandler->CreateInNetStream(this, 
     450                channelId, streamId, streamName); 
    449451        _streams[streamId] = pStream; 
    450452 
  • trunk/sources/thelib/src/protocols/rtmp/streaming/innetrtmpstream.cpp

    r715 r718  
    2727#include "streaming/streamstypes.h" 
    2828 
    29 InNetRTMPStream::InNetRTMPStream(BaseProtocol *pProtocol, 
     29InNetRTMPStream::InNetRTMPStream(BaseRTMPProtocol *pProtocol, 
    3030                StreamsManager *pStreamsManager, string name, 
    31                 uint32_t rtmpStreamId, uint32_t chunkSize, uint32_t channelId) 
     31                uint32_t rtmpStreamId, uint32_t channelId) 
    3232: BaseInNetStream(pProtocol, pStreamsManager, ST_IN_NET_RTMP, name) { 
    3333        _rtmpStreamId = rtmpStreamId; 
    34         _chunkSize = chunkSize; 
     34        _chunkSize = pProtocol->GetInboundChunkSize(); 
    3535        _channelId = channelId; 
    3636        _clientId = format("%d_%d_%"PRIz"u", _pProtocol->GetId(), _rtmpStreamId, (size_t)this); 
Note: See TracChangeset for help on using the changeset viewer.