Created
January 13, 2012 21:20
-
-
Save j0sh/1608758 to your computer and use it in GitHub Desktop.
RTMP: Allow application-selectable innet streams.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| From 16a5d60ae90601063f251a953e307261d991310b Mon Sep 17 00:00:00 2001 | |
| From: Josh Allmann <joshua.allmann@gmail.com> | |
| Date: Fri, 13 Jan 2012 18:25:28 -0800 | |
| Subject: [PATCH 1/3] -- RTMP: Allow application-selectable innet streams. | |
| --- | |
| .../protocols/rtmp/basertmpappprotocolhandler.h | 11 +++++++++++ | |
| .../include/protocols/rtmp/basertmpprotocol.h | 1 + | |
| .../protocols/rtmp/streaming/innetrtmpstream.h | 5 ++--- | |
| .../protocols/rtmp/basertmpappprotocolhandler.cpp | 8 ++++++++ | |
| .../thelib/src/protocols/rtmp/basertmpprotocol.cpp | 12 +++++++----- | |
| .../protocols/rtmp/streaming/innetrtmpstream.cpp | 6 +++--- | |
| 6 files changed, 32 insertions(+), 11 deletions(-) | |
| diff --git a/sources/thelib/include/protocols/rtmp/basertmpappprotocolhandler.h b/sources/thelib/include/protocols/rtmp/basertmpappprotocolhandler.h | |
| index 0bca06b..564c497 100644 | |
| --- a/sources/thelib/include/protocols/rtmp/basertmpappprotocolhandler.h | |
| +++ b/sources/thelib/include/protocols/rtmp/basertmpappprotocolhandler.h | |
| @@ -32,6 +32,7 @@ | |
| class OutboundRTMPProtocol; | |
| class BaseRTMPProtocol; | |
| class BaseOutFileStream; | |
| +class InNetRTMPStream; | |
| class DLLEXP BaseRTMPAppProtocolHandler | |
| : public BaseAppProtocolHandler { | |
| @@ -243,6 +244,16 @@ public: | |
| * append - Whether to append this stream to an exiting file | |
| * */ | |
| virtual BaseOutFileStream *CreateOutFileStream(BaseRTMPProtocol *pFrom, Variant &meta, bool append); | |
| + | |
| + /* | |
| + * Create a file stream for writing to disk. | |
| + * pFrom - The connection which wants to stream to disk | |
| + * meta - Stream metadata | |
| + * append - Whether to append this stream to an exiting file | |
| + * */ | |
| + virtual InNetRTMPStream *CreateInNetStream(BaseRTMPProtocol *pFrom, | |
| + uint32_t channelId, uint32_t streamId, string streamName); | |
| + | |
| private: | |
| /* | |
| * Will transform stream names of type streamName?param1=value1¶m2=value2&... | |
| diff --git a/sources/thelib/include/protocols/rtmp/basertmpprotocol.h b/sources/thelib/include/protocols/rtmp/basertmpprotocol.h | |
| index 25eab77..33f8b62 100644 | |
| --- a/sources/thelib/include/protocols/rtmp/basertmpprotocol.h | |
| +++ b/sources/thelib/include/protocols/rtmp/basertmpprotocol.h | |
| @@ -103,6 +103,7 @@ public: | |
| void SetWinAckSize(uint32_t winAckSize); | |
| uint32_t GetOutboundChunkSize(); | |
| + uint32_t GetInboundChunkSize(); | |
| bool SetInboundChunkSize(uint32_t chunkSize); | |
| void TrySetOutboundChunkSize(uint32_t chunkSize); | |
| diff --git a/sources/thelib/include/protocols/rtmp/streaming/innetrtmpstream.h b/sources/thelib/include/protocols/rtmp/streaming/innetrtmpstream.h | |
| index 4e6f619..374a541 100644 | |
| --- a/sources/thelib/include/protocols/rtmp/streaming/innetrtmpstream.h | |
| +++ b/sources/thelib/include/protocols/rtmp/streaming/innetrtmpstream.h | |
| @@ -53,9 +53,8 @@ private: | |
| uint64_t _videoBytesCount; | |
| uint64_t _videoDroppedBytesCount; | |
| public: | |
| - InNetRTMPStream(BaseProtocol *pProtocol, StreamsManager *pStreamsManager, | |
| - string name, uint32_t rtmpStreamId, uint32_t chunkSize, | |
| - uint32_t channelId); | |
| + InNetRTMPStream(BaseRTMPProtocol *pProtocol, StreamsManager *pStreamsManager, | |
| + string name, uint32_t rtmpStreamId, uint32_t channelId); | |
| virtual ~InNetRTMPStream(); | |
| virtual StreamCapabilities * GetCapabilities(); | |
| diff --git a/sources/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp b/sources/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp | |
| index 895c180..d506077 100644 | |
| --- a/sources/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp | |
| +++ b/sources/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp | |
| @@ -1886,6 +1886,14 @@ BaseOutFileStream* BaseRTMPAppProtocolHandler::CreateOutFileStream( | |
| return NULL; | |
| } | |
| +InNetRTMPStream *BaseRTMPAppProtocolHandler::CreateInNetStream( | |
| + BaseRTMPProtocol *pFrom, uint32_t channelId, uint32_t streamId, | |
| + string streamName) { | |
| + return new InNetRTMPStream(pFrom, | |
| + GetApplication()->GetStreamsManager(), streamName, streamId, channelId); | |
| + | |
| +} | |
| + | |
| string NormalizeStreamName(string streamName) { | |
| replace(streamName, "-", "_"); | |
| replace(streamName, "?", "-"); | |
| diff --git a/sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp b/sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp | |
| index 368d453..e332466 100644 | |
| --- a/sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp | |
| +++ b/sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp | |
| @@ -311,6 +311,10 @@ uint32_t BaseRTMPProtocol::GetOutboundChunkSize() { | |
| return _outboundChunkSize; | |
| } | |
| +uint32_t BaseRTMPProtocol::GetInboundChunkSize() { | |
| + return _inboundChunkSize; | |
| +} | |
| + | |
| bool BaseRTMPProtocol::SetInboundChunkSize(uint32_t chunkSize) { | |
| /*WARN("Chunk size changed for RTMP connection %p: %u->%u", this, | |
| _inboundChunkSize, chunkSize);*/ | |
| @@ -423,7 +427,7 @@ RTMPStream * BaseRTMPProtocol::CreateNeutralStream(uint32_t & streamId) { | |
| } | |
| InNetRTMPStream * BaseRTMPProtocol::CreateINS(uint32_t channelId, | |
| - uint32_t streamId, string streamName) { | |
| + uint32_t streamId, string streamName) { | |
| if (streamId == 0 || streamId >= MAX_STREAMS_COUNT) { | |
| FATAL("Invalid stream id: %u", streamId); | |
| return NULL; | |
| @@ -442,10 +446,8 @@ InNetRTMPStream * BaseRTMPProtocol::CreateINS(uint32_t channelId, | |
| delete _streams[streamId]; | |
| _streams[streamId] = NULL; | |
| - InNetRTMPStream *pStream = new InNetRTMPStream(this, | |
| - GetApplication()->GetStreamsManager(), streamName, streamId, | |
| - _inboundChunkSize, channelId); | |
| - | |
| + InNetRTMPStream *pStream = _pProtocolHandler->CreateInNetStream(this, | |
| + channelId, streamId, streamName); | |
| _streams[streamId] = pStream; | |
| return pStream; | |
| diff --git a/sources/thelib/src/protocols/rtmp/streaming/innetrtmpstream.cpp b/sources/thelib/src/protocols/rtmp/streaming/innetrtmpstream.cpp | |
| index 7ac1d1a..81603bf 100644 | |
| --- a/sources/thelib/src/protocols/rtmp/streaming/innetrtmpstream.cpp | |
| +++ b/sources/thelib/src/protocols/rtmp/streaming/innetrtmpstream.cpp | |
| @@ -26,12 +26,12 @@ | |
| #include "protocols/rtmp/streaming/outfilertmpflvstream.h" | |
| #include "streaming/streamstypes.h" | |
| -InNetRTMPStream::InNetRTMPStream(BaseProtocol *pProtocol, | |
| +InNetRTMPStream::InNetRTMPStream(BaseRTMPProtocol *pProtocol, | |
| StreamsManager *pStreamsManager, string name, | |
| - uint32_t rtmpStreamId, uint32_t chunkSize, uint32_t channelId) | |
| + uint32_t rtmpStreamId, uint32_t channelId) | |
| : BaseInNetStream(pProtocol, pStreamsManager, ST_IN_NET_RTMP, name) { | |
| _rtmpStreamId = rtmpStreamId; | |
| - _chunkSize = chunkSize; | |
| + _chunkSize = pProtocol->GetInboundChunkSize(); | |
| _channelId = channelId; | |
| _clientId = format("%d_%d_%"PRIz"u", _pProtocol->GetId(), _rtmpStreamId, (size_t)this); | |
| _lastVideoTime = 0; | |
| -- | |
| 1.7.5.4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| From 75f08e3f3d610c08e717cbc99dcaf6b4fec48af5 Mon Sep 17 00:00:00 2001 | |
| From: Josh Allmann <joshua.allmann@gmail.com> | |
| Date: Fri, 13 Jan 2012 16:20:57 -0800 | |
| Subject: [PATCH 2/3] -- RTMP: Make stream creation and teardown more | |
| resilient to weirdness. | |
| --- | |
| .../thelib/src/protocols/rtmp/basertmpprotocol.cpp | 10 +++++----- | |
| 1 files changed, 5 insertions(+), 5 deletions(-) | |
| diff --git a/sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp b/sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp | |
| index e332466..958e549 100644 | |
| --- a/sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp | |
| +++ b/sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp | |
| @@ -359,8 +359,8 @@ bool BaseRTMPProtocol::CloseStream(uint32_t streamId, bool createNeutralStream) | |
| } | |
| if (_streams[streamId] == NULL) { | |
| - FATAL("Try to close a NULL stream"); | |
| - return false; | |
| + WARN("Try to close a NULL stream"); | |
| + return true; | |
| } | |
| if (TAG_KIND_OF(_streams[streamId]->GetType(), ST_OUT_NET_RTMP)) { | |
| @@ -461,9 +461,8 @@ BaseOutNetRTMPStream * BaseRTMPProtocol::CreateONS(uint32_t streamId, | |
| } | |
| if (_streams[streamId] == NULL) { | |
| - FATAL("Try to play a stream on a NULL placeholder"); | |
| - return NULL; | |
| - } | |
| + WARN("Try to play a stream on a NULL placeholder"); | |
| + } else { | |
| if (_streams[streamId]->GetType() != ST_NEUTRAL_RTMP) { | |
| FATAL("Try to play a stream over a non neutral stream: id: %u; type: %"PRIu64, | |
| @@ -473,6 +472,7 @@ BaseOutNetRTMPStream * BaseRTMPProtocol::CreateONS(uint32_t streamId, | |
| delete _streams[streamId]; | |
| _streams[streamId] = NULL; | |
| + } | |
| BaseOutNetRTMPStream *pBaseOutNetRTMPStream = BaseOutNetRTMPStream::GetInstance( | |
| this, GetApplication()->GetStreamsManager(), streamName, streamId, | |
| -- | |
| 1.7.5.4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| From 2ea7a0c4ceff698f25ecf3d67621605d1cf95fbc Mon Sep 17 00:00:00 2001 | |
| From: Josh Allmann <joshua.allmann@gmail.com> | |
| Date: Fri, 13 Jan 2012 18:27:35 -0800 | |
| Subject: [PATCH 3/3] -- RTMP: Cosmetics in CreateONS. | |
| --- | |
| .../thelib/src/protocols/rtmp/basertmpprotocol.cpp | 14 +++++++------- | |
| 1 files changed, 7 insertions(+), 7 deletions(-) | |
| diff --git a/sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp b/sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp | |
| index 958e549..79021c5 100644 | |
| --- a/sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp | |
| +++ b/sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp | |
| @@ -464,14 +464,14 @@ BaseOutNetRTMPStream * BaseRTMPProtocol::CreateONS(uint32_t streamId, | |
| WARN("Try to play a stream on a NULL placeholder"); | |
| } else { | |
| - if (_streams[streamId]->GetType() != ST_NEUTRAL_RTMP) { | |
| - FATAL("Try to play a stream over a non neutral stream: id: %u; type: %"PRIu64, | |
| - streamId, _streams[streamId]->GetType()); | |
| - return NULL; | |
| - } | |
| + if (_streams[streamId]->GetType() != ST_NEUTRAL_RTMP) { | |
| + FATAL("Try to play a stream over a non neutral stream: id: %u; type: %"PRIu64, | |
| + streamId, _streams[streamId]->GetType()); | |
| + return NULL; | |
| + } | |
| - delete _streams[streamId]; | |
| - _streams[streamId] = NULL; | |
| + delete _streams[streamId]; | |
| + _streams[streamId] = NULL; | |
| } | |
| BaseOutNetRTMPStream *pBaseOutNetRTMPStream = BaseOutNetRTMPStream::GetInstance( | |
| -- | |
| 1.7.5.4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| From e5c799f31b35a577ff827096fe02e447b5377040 Mon Sep 17 00:00:00 2001 | |
| From: Josh Allmann <joshua.allmann@gmail.com> | |
| Date: Fri, 13 Jan 2012 18:51:42 -0800 | |
| Subject: [PATCH 4/4] -- RTMP: stream types should take a BaseRTMPProtocol in | |
| the constructor. | |
| --- | |
| .../rtmp/streaming/baseoutnetrtmpstream.h | 4 ++-- | |
| .../protocols/rtmp/streaming/infilertmpstream.h | 2 +- | |
| .../rtmp/streaming/outfilertmpflvstream.h | 4 +++- | |
| .../rtmp/streaming/outnetrtmp4rtmpstream.h | 2 +- | |
| .../protocols/rtmp/streaming/outnetrtmp4tsstream.h | 2 +- | |
| .../include/protocols/rtmp/streaming/rtmpstream.h | 4 +++- | |
| .../rtmp/streaming/baseoutnetrtmpstream.cpp | 4 ++-- | |
| .../protocols/rtmp/streaming/infilertmpstream.cpp | 4 ++-- | |
| .../rtmp/streaming/outfilertmpflvstream.cpp | 4 ++-- | |
| .../rtmp/streaming/outnetrtmp4rtmpstream.cpp | 2 +- | |
| .../rtmp/streaming/outnetrtmp4tsstream.cpp | 2 +- | |
| .../src/protocols/rtmp/streaming/rtmpstream.cpp | 3 ++- | |
| 12 files changed, 21 insertions(+), 16 deletions(-) | |
| diff --git a/sources/thelib/include/protocols/rtmp/streaming/baseoutnetrtmpstream.h b/sources/thelib/include/protocols/rtmp/streaming/baseoutnetrtmpstream.h | |
| index eabca31..3552da7 100644 | |
| --- a/sources/thelib/include/protocols/rtmp/streaming/baseoutnetrtmpstream.h | |
| +++ b/sources/thelib/include/protocols/rtmp/streaming/baseoutnetrtmpstream.h | |
| @@ -73,10 +73,10 @@ private: | |
| uint64_t _videoBytesCount; | |
| uint64_t _videoDroppedBytesCount; | |
| protected: | |
| - BaseOutNetRTMPStream(BaseProtocol *pProtocol, StreamsManager *pStreamsManager, | |
| + BaseOutNetRTMPStream(BaseRTMPProtocol *pProtocol, StreamsManager *pStreamsManager, | |
| uint64_t type, string name, uint32_t rtmpStreamId, uint32_t chunkSize); | |
| public: | |
| - static BaseOutNetRTMPStream *GetInstance(BaseProtocol *pProtocol, | |
| + static BaseOutNetRTMPStream *GetInstance(BaseRTMPProtocol *pProtocol, | |
| StreamsManager *pStreamsManager, | |
| string name, uint32_t rtmpStreamId, | |
| uint32_t chunkSize, | |
| diff --git a/sources/thelib/include/protocols/rtmp/streaming/infilertmpstream.h b/sources/thelib/include/protocols/rtmp/streaming/infilertmpstream.h | |
| index b3d7563..ea1886f 100644 | |
| --- a/sources/thelib/include/protocols/rtmp/streaming/infilertmpstream.h | |
| +++ b/sources/thelib/include/protocols/rtmp/streaming/infilertmpstream.h | |
| @@ -95,7 +95,7 @@ protected: | |
| Variant _completeMetadata; | |
| uint32_t _chunkSize; | |
| public: | |
| - InFileRTMPStream(BaseProtocol *pProtocol, StreamsManager *pStreamsManager, | |
| + InFileRTMPStream(BaseRTMPProtocol *pProtocol, StreamsManager *pStreamsManager, | |
| string name); | |
| virtual ~InFileRTMPStream(); | |
| diff --git a/sources/thelib/include/protocols/rtmp/streaming/outfilertmpflvstream.h b/sources/thelib/include/protocols/rtmp/streaming/outfilertmpflvstream.h | |
| index ebca7ce..254339f 100644 | |
| --- a/sources/thelib/include/protocols/rtmp/streaming/outfilertmpflvstream.h | |
| +++ b/sources/thelib/include/protocols/rtmp/streaming/outfilertmpflvstream.h | |
| @@ -23,6 +23,8 @@ | |
| #include "streaming/baseoutfilestream.h" | |
| +class BaseRTMPProtocol; | |
| + | |
| class DLLEXP OutFileRTMPFLVStream | |
| : public BaseOutFileStream { | |
| private: | |
| @@ -32,7 +34,7 @@ private: | |
| IOBuffer _videoBuffer; | |
| uint32_t _prevTagSize; | |
| public: | |
| - OutFileRTMPFLVStream(BaseProtocol *pProtocol, StreamsManager *pStreamsManager, | |
| + OutFileRTMPFLVStream(BaseRTMPProtocol *pProtocol, StreamsManager *pStreamsManager, | |
| string name); | |
| virtual ~OutFileRTMPFLVStream(); | |
| diff --git a/sources/thelib/include/protocols/rtmp/streaming/outnetrtmp4rtmpstream.h b/sources/thelib/include/protocols/rtmp/streaming/outnetrtmp4rtmpstream.h | |
| index ee2e618..2164f08 100644 | |
| --- a/sources/thelib/include/protocols/rtmp/streaming/outnetrtmp4rtmpstream.h | |
| +++ b/sources/thelib/include/protocols/rtmp/streaming/outnetrtmp4rtmpstream.h | |
| @@ -27,7 +27,7 @@ | |
| class DLLEXP OutNetRTMP4RTMPStream | |
| : public BaseOutNetRTMPStream { | |
| public: | |
| - OutNetRTMP4RTMPStream(BaseProtocol *pProtocol, StreamsManager *pStreamsManager, | |
| + OutNetRTMP4RTMPStream(BaseRTMPProtocol *pProtocol, StreamsManager *pStreamsManager, | |
| string name, uint32_t rtmpStreamId, uint32_t chunkSize); | |
| virtual ~OutNetRTMP4RTMPStream(); | |
| diff --git a/sources/thelib/include/protocols/rtmp/streaming/outnetrtmp4tsstream.h b/sources/thelib/include/protocols/rtmp/streaming/outnetrtmp4tsstream.h | |
| index c7ac999..16cbc48 100644 | |
| --- a/sources/thelib/include/protocols/rtmp/streaming/outnetrtmp4tsstream.h | |
| +++ b/sources/thelib/include/protocols/rtmp/streaming/outnetrtmp4tsstream.h | |
| @@ -36,7 +36,7 @@ private: | |
| IOBuffer _videoBuffer; | |
| bool _inboundStreamIsRTP; | |
| public: | |
| - OutNetRTMP4TSStream(BaseProtocol *pProtocol, StreamsManager *pStreamsManager, | |
| + OutNetRTMP4TSStream(BaseRTMPProtocol *pProtocol, StreamsManager *pStreamsManager, | |
| string name, uint32_t rtmpStreamId, uint32_t chunkSize); | |
| virtual ~OutNetRTMP4TSStream(); | |
| diff --git a/sources/thelib/include/protocols/rtmp/streaming/rtmpstream.h b/sources/thelib/include/protocols/rtmp/streaming/rtmpstream.h | |
| index 531a71c..895dd6a 100644 | |
| --- a/sources/thelib/include/protocols/rtmp/streaming/rtmpstream.h | |
| +++ b/sources/thelib/include/protocols/rtmp/streaming/rtmpstream.h | |
| @@ -24,12 +24,14 @@ | |
| #include "streaming/basestream.h" | |
| +class BaseRTMPProtocol; | |
| + | |
| class DLLEXP RTMPStream | |
| : public BaseStream { | |
| private: | |
| uint32_t _rtmpStreamId; | |
| public: | |
| - RTMPStream(BaseProtocol *pProtocol, StreamsManager *pStreamsManager, | |
| + RTMPStream(BaseRTMPProtocol *pProtocol, StreamsManager *pStreamsManager, | |
| uint32_t rtmpStreamId); | |
| virtual ~RTMPStream(); | |
| virtual StreamCapabilities * GetCapabilities(); | |
| diff --git a/sources/thelib/src/protocols/rtmp/streaming/baseoutnetrtmpstream.cpp b/sources/thelib/src/protocols/rtmp/streaming/baseoutnetrtmpstream.cpp | |
| index 3411699..2352de4 100644 | |
| --- a/sources/thelib/src/protocols/rtmp/streaming/baseoutnetrtmpstream.cpp | |
| +++ b/sources/thelib/src/protocols/rtmp/streaming/baseoutnetrtmpstream.cpp | |
| @@ -43,7 +43,7 @@ | |
| //the number represents the percent of frames that we will drop (0-100) | |
| //#define SIMULATE_DROPPING_FRAMES 40 | |
| -BaseOutNetRTMPStream::BaseOutNetRTMPStream(BaseProtocol *pProtocol, | |
| +BaseOutNetRTMPStream::BaseOutNetRTMPStream(BaseRTMPProtocol *pProtocol, | |
| StreamsManager *pStreamsManager, uint64_t type, string name, uint32_t rtmpStreamId, | |
| uint32_t chunkSize) | |
| : BaseOutNetStream(pProtocol, pStreamsManager, type, name) { | |
| @@ -82,7 +82,7 @@ BaseOutNetRTMPStream::BaseOutNetRTMPStream(BaseProtocol *pProtocol, | |
| InternalReset(); | |
| } | |
| -BaseOutNetRTMPStream *BaseOutNetRTMPStream::GetInstance(BaseProtocol *pProtocol, | |
| +BaseOutNetRTMPStream *BaseOutNetRTMPStream::GetInstance(BaseRTMPProtocol *pProtocol, | |
| StreamsManager *pStreamsManager, | |
| string name, uint32_t rtmpStreamId, | |
| uint32_t chunkSize, | |
| diff --git a/sources/thelib/src/protocols/rtmp/streaming/infilertmpstream.cpp b/sources/thelib/src/protocols/rtmp/streaming/infilertmpstream.cpp | |
| index 22ad46f..e14c8be 100644 | |
| --- a/sources/thelib/src/protocols/rtmp/streaming/infilertmpstream.cpp | |
| +++ b/sources/thelib/src/protocols/rtmp/streaming/infilertmpstream.cpp | |
| @@ -173,7 +173,7 @@ bool InFileRTMPStream::PassThroughBuilder::BuildFrame(FileClass *pFile, | |
| return true; | |
| } | |
| -InFileRTMPStream::InFileRTMPStream(BaseProtocol *pProtocol, | |
| +InFileRTMPStream::InFileRTMPStream(BaseRTMPProtocol *pProtocol, | |
| StreamsManager *pStreamsManager, string name) | |
| : BaseInFileStream(pProtocol, pStreamsManager, ST_IN_FILE_RTMP, name) { | |
| _chunkSize = 4 * 1024 * 1024; | |
| @@ -274,7 +274,7 @@ InFileRTMPStream *InFileRTMPStream::GetInstance(BaseRTMPProtocol *pRTMPProtocol, | |
| || metadata[META_MEDIA_TYPE] == MEDIA_TYPE_MOV | |
| //||metadata[META_MEDIA_TYPE] == MEDIA_TYPE_NSV | |
| ) { | |
| - pResult = new InFileRTMPStream((BaseProtocol *) pRTMPProtocol, | |
| + pResult = new InFileRTMPStream(pRTMPProtocol, | |
| pStreamsManager, metadata[META_SERVER_FULL_PATH]); | |
| } else { | |
| FATAL("File type not supported yet. Metadata:\n%s", | |
| diff --git a/sources/thelib/src/protocols/rtmp/streaming/outfilertmpflvstream.cpp b/sources/thelib/src/protocols/rtmp/streaming/outfilertmpflvstream.cpp | |
| index b39fdeb..528e69d 100644 | |
| --- a/sources/thelib/src/protocols/rtmp/streaming/outfilertmpflvstream.cpp | |
| +++ b/sources/thelib/src/protocols/rtmp/streaming/outfilertmpflvstream.cpp | |
| @@ -21,9 +21,9 @@ | |
| #ifdef HAS_PROTOCOL_RTMP | |
| #include "protocols/rtmp/streaming/outfilertmpflvstream.h" | |
| #include "streaming/streamstypes.h" | |
| -#include "protocols/baseprotocol.h" | |
| +#include "protocols/rtmp/basertmpprotocol.h" | |
| -OutFileRTMPFLVStream::OutFileRTMPFLVStream(BaseProtocol *pProtocol, | |
| +OutFileRTMPFLVStream::OutFileRTMPFLVStream(BaseRTMPProtocol *pProtocol, | |
| StreamsManager *pStreamsManager, string name) | |
| : BaseOutFileStream(pProtocol, pStreamsManager, ST_OUT_FILE_RTMP_FLV, name) { | |
| _timeBase = -1; | |
| diff --git a/sources/thelib/src/protocols/rtmp/streaming/outnetrtmp4rtmpstream.cpp b/sources/thelib/src/protocols/rtmp/streaming/outnetrtmp4rtmpstream.cpp | |
| index 088d2cb..c706a11 100644 | |
| --- a/sources/thelib/src/protocols/rtmp/streaming/outnetrtmp4rtmpstream.cpp | |
| +++ b/sources/thelib/src/protocols/rtmp/streaming/outnetrtmp4rtmpstream.cpp | |
| @@ -21,7 +21,7 @@ | |
| #include "protocols/rtmp/streaming/outnetrtmp4rtmpstream.h" | |
| #include "streaming/streamstypes.h" | |
| -OutNetRTMP4RTMPStream::OutNetRTMP4RTMPStream(BaseProtocol *pProtocol, | |
| +OutNetRTMP4RTMPStream::OutNetRTMP4RTMPStream(BaseRTMPProtocol *pProtocol, | |
| StreamsManager *pStreamsManager, string name, uint32_t rtmpStreamId, | |
| uint32_t chunkSize) | |
| : BaseOutNetRTMPStream(pProtocol, pStreamsManager, ST_OUT_NET_RTMP_4_RTMP, | |
| diff --git a/sources/thelib/src/protocols/rtmp/streaming/outnetrtmp4tsstream.cpp b/sources/thelib/src/protocols/rtmp/streaming/outnetrtmp4tsstream.cpp | |
| index d45585e..3b0ccd0 100644 | |
| --- a/sources/thelib/src/protocols/rtmp/streaming/outnetrtmp4tsstream.cpp | |
| +++ b/sources/thelib/src/protocols/rtmp/streaming/outnetrtmp4tsstream.cpp | |
| @@ -24,7 +24,7 @@ | |
| #define SPSPPS_MAX_LENGTH 1024 | |
| -OutNetRTMP4TSStream::OutNetRTMP4TSStream(BaseProtocol *pProtocol, | |
| +OutNetRTMP4TSStream::OutNetRTMP4TSStream(BaseRTMPProtocol *pProtocol, | |
| StreamsManager *pStreamsManager, string name, uint32_t rtmpStreamId, | |
| uint32_t chunkSize) | |
| : BaseOutNetRTMPStream(pProtocol, pStreamsManager, ST_OUT_NET_RTMP_4_TS, | |
| diff --git a/sources/thelib/src/protocols/rtmp/streaming/rtmpstream.cpp b/sources/thelib/src/protocols/rtmp/streaming/rtmpstream.cpp | |
| index 80104f7..be70a09 100644 | |
| --- a/sources/thelib/src/protocols/rtmp/streaming/rtmpstream.cpp | |
| +++ b/sources/thelib/src/protocols/rtmp/streaming/rtmpstream.cpp | |
| @@ -18,10 +18,11 @@ | |
| */ | |
| #ifdef HAS_PROTOCOL_RTMP | |
| +#include "protocols/rtmp/basertmpprotocol.h" | |
| #include "protocols/rtmp/streaming/rtmpstream.h" | |
| #include "streaming/streamstypes.h" | |
| -RTMPStream::RTMPStream(BaseProtocol *pProtocol, | |
| +RTMPStream::RTMPStream(BaseRTMPProtocol *pProtocol, | |
| StreamsManager *pStreamsManager, uint32_t rtmpStreamId) | |
| : BaseStream(pProtocol, pStreamsManager, ST_NEUTRAL_RTMP, "") { | |
| _rtmpStreamId = rtmpStreamId; | |
| -- | |
| 1.7.5.4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment