Changeset 53
- Timestamp:
- 08/04/10 19:56:40 (18 months ago)
- Location:
- trunk
- Files:
-
- 8 edited
-
builders/cmake/rtmpserver/rtmpserver.lua (modified) (1 diff)
-
sources/thelib/include/protocols/rtp/connectivity/inboundconnectivity.h (modified) (1 diff)
-
sources/thelib/include/protocols/rtp/rtspprotocol.h (modified) (1 diff)
-
sources/thelib/include/protocols/rtp/sdp.h (modified) (1 diff)
-
sources/thelib/src/protocols/rtp/basertspappprotocolhandler.cpp (modified) (1 diff)
-
sources/thelib/src/protocols/rtp/connectivity/inboundconnectivity.cpp (modified) (3 diffs)
-
sources/thelib/src/protocols/rtp/rtspprotocol.cpp (modified) (1 diff)
-
sources/thelib/src/protocols/rtp/sdp.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/builders/cmake/rtmpserver/rtmpserver.lua
r41 r53 149 149 --[[{ 150 150 url="rtsp://82.177.67.61/axis-media/media.amp", 151 streamName="stream1", 151 152 forceTcp=false 152 },153 {154 url="rtsp://217.153.33.206/axis-media/media.amp",155 forceTcp=true156 153 }, 157 154 { -
trunk/sources/thelib/include/protocols/rtp/connectivity/inboundconnectivity.h
r49 r53 53 53 void EnqueueForDelete(); 54 54 55 bool Initialize(Variant &videoTrack, Variant &audioTrack, bool forceTcp); 55 bool Initialize(Variant &videoTrack, Variant &audioTrack, 56 string streamName, bool forceTcp); 56 57 57 58 string GetTransportHeaderLine(bool isAudio); -
trunk/sources/thelib/include/protocols/rtp/rtspprotocol.h
r49 r53 91 91 92 92 InboundConnectivity *GetInboundConnectivity(Variant &videoTrack, 93 Variant &audioTrack );93 Variant &audioTrack, string sdpStreamName); 94 94 void CloseInboundConnectivity(); 95 95 -
trunk/sources/thelib/include/protocols/rtp/sdp.h
r49 r53 58 58 static bool ParseSDP(SDP &sdp, string &raw); 59 59 Variant GetVideoTrack(uint32_t index, string uri); 60 string GetStreamName(); 60 61 private: 61 62 static bool ParseSection(Variant &result, vector<string> &lines, -
trunk/sources/thelib/src/protocols/rtp/basertspappprotocolhandler.cpp
r49 r53 488 488 requestHeaders[RTSP_FIRST_LINE][RTSP_URL]); 489 489 Variant audioTrack; 490 FINEST("videoTrack:\n%s", STR(videoTrack.ToString()));490 //FINEST("videoTrack:\n%s", STR(videoTrack.ToString())); 491 491 492 492 493 493 //5. Create the inbound connectivity 494 if (pFrom->GetInboundConnectivity(videoTrack, audioTrack) == NULL) { 494 if (pFrom->GetInboundConnectivity(videoTrack, audioTrack, 495 sdp.GetStreamName()) == NULL) { 495 496 FATAL("Unable to get the inbound connectivity"); 496 497 return false; -
trunk/sources/thelib/src/protocols/rtp/connectivity/inboundconnectivity.cpp
r49 r53 54 54 55 55 bool InboundConnectivity::Initialize(Variant &videoTrack, Variant &audioTrack, 56 bool forceTcp) {56 string streamName, bool forceTcp) { 57 57 _forceTcp = forceTcp; 58 58 … … 87 87 88 88 //5. Create the in stream 89 if (streamName == "") 90 streamName = format("rtsp_%d", _pRTSP->GetId()); 89 91 _pInStream = new InNetRTPStream(_pRTSP, pApplication->GetStreamsManager(), 90 format("rtsp_%d", _pRTSP->GetId()),92 streamName, 91 93 unb64((string) SDP_VIDEO_CODEC_H264_SPS(videoTrack)), 92 94 unb64((string) SDP_VIDEO_CODEC_H264_PPS(videoTrack))); … … 214 216 //FINEST("%s:%d length: %d", inet_ntoa(address.sin_addr), ntohs(address.sin_port), length); 215 217 return sendto(pRTCP->GetIOHandler()->GetOutboundFd(), 216 (char *) pBuffer, length, 0, (sockaddr *) & address, sizeof (address)) == (int32_t) length;218 (char *) pBuffer, length, 0, (sockaddr *) & address, sizeof (address)) == (int32_t) length; 217 219 } 218 220 -
trunk/sources/thelib/src/protocols/rtp/rtspprotocol.cpp
r41 r53 278 278 279 279 InboundConnectivity *RTSPProtocol::GetInboundConnectivity(Variant &videoTrack, 280 Variant &audioTrack ) {280 Variant &audioTrack, string sdpStreamName) { 281 281 CloseInboundConnectivity(); 282 string streamName; 283 if (GetCustomParameters().HasKey("streamName")) { 284 streamName = (string) GetCustomParameters()["streamName"]; 285 } else { 286 streamName = sdpStreamName; 287 } 282 288 _pInboundConnectivity = new InboundConnectivity(this); 283 289 if (!_pInboundConnectivity->Initialize(videoTrack, audioTrack, 284 (bool)GetCustomParameters()["forceTcp"])) {290 streamName, (bool)GetCustomParameters()["forceTcp"])) { 285 291 FATAL("Unable to initialize inbound connectivity"); 286 292 CloseInboundConnectivity(); -
trunk/sources/thelib/src/protocols/rtp/sdp.cpp
r49 r53 1 1 /* 2 * Copyright (c) 2010,3 * Gavriloaie Eugen-Andrei (shiretu@gmail.com)4 * 5 * This file is part of crtmpserver.6 * crtmpserver is free software: you can redistribute it and/or modify7 * it under the terms of the GNU General Public License as published by8 * the Free Software Foundation, either version 3 of the License, or9 * (at your option) any later version.10 * 11 * crtmpserver is distributed in the hope that it will be useful,12 * but WITHOUT ANY WARRANTY; without even the implied warranty of13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14 * GNU General Public License for more details.15 * 16 * You should have received a copy of the GNU General Public License17 * along with crtmpserver. If not, see <http://www.gnu.org/licenses/>.18 */2 * Copyright (c) 2010, 3 * Gavriloaie Eugen-Andrei (shiretu@gmail.com) 4 * 5 * This file is part of crtmpserver. 6 * crtmpserver is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation, either version 3 of the License, or 9 * (at your option) any later version. 10 * 11 * crtmpserver is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with crtmpserver. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 19 20 20 #ifdef HAS_PROTOCOL_RTP … … 127 127 //3. Done 128 128 return result; 129 } 130 131 string SDP::GetStreamName() { 132 if (!HasKey(SDP_SESSION)) 133 return ""; 134 if (!(*this)[SDP_SESSION].HasKey(SDP_S)) 135 return ""; 136 return (string) (*this)[SDP_SESSION][SDP_S]; 129 137 } 130 138
Note: See TracChangeset
for help on using the changeset viewer.
