From guillem at minisip.org Tue Jun 24 17:37:47 2008 From: guillem at minisip.org (guillem at minisip.org) Date: Tue, 24 Jun 2008 17:37:47 +0200 (CEST) Subject: r3583 - in trunk/libminisip: include/libminisip/media/rtp source/subsystem_media/rtp Message-ID: <20080624153747.D4AA822FD7@mail.minisip.org> Author: guillem Date: 2008-06-24 17:37:47 +0200 (Tue, 24 Jun 2008) New Revision: 3583 Modified: trunk/libminisip/include/libminisip/media/rtp/RtpPacket.h trunk/libminisip/include/libminisip/media/rtp/SRtpPacket.h trunk/libminisip/source/subsystem_media/rtp/RtpPacket.cxx trunk/libminisip/source/subsystem_media/rtp/SRtpPacket.cxx Log: * Added a method to create a new SRtpPacket from an RTP header, an RTP Content and its length, setting to NULL the MKI and the TAG * Modified the header of the RtpPacket constructor to receive a reference of an RTP header, to avoid copying it Modified: trunk/libminisip/include/libminisip/media/rtp/RtpPacket.h =================================================================== --- trunk/libminisip/include/libminisip/media/rtp/RtpPacket.h 2008-05-28 12:18:24 UTC (rev 3582) +++ trunk/libminisip/include/libminisip/media/rtp/RtpPacket.h 2008-06-24 15:37:47 UTC (rev 3583) @@ -48,7 +48,7 @@ RtpPacket(); RtpPacket(unsigned char *content, int content_length, int seq_no, unsigned timestamp, unsigned ssrc); - RtpPacket(RtpHeader hdr, unsigned char *content, int content_length); + RtpPacket(const RtpHeader &hdr, unsigned char *content, int content_length); virtual ~RtpPacket(); static RtpPacket *readPacket(UDPSocket &udp_sock, int timeout=-1); Modified: trunk/libminisip/include/libminisip/media/rtp/SRtpPacket.h =================================================================== --- trunk/libminisip/include/libminisip/media/rtp/SRtpPacket.h 2008-05-28 12:18:24 UTC (rev 3582) +++ trunk/libminisip/include/libminisip/media/rtp/SRtpPacket.h 2008-06-24 15:37:47 UTC (rev 3583) @@ -49,6 +49,7 @@ SRtpPacket( unsigned char *content, int content_length, int seq_no, unsigned timestamp, unsigned ssrc); + SRtpPacket(RtpHeader hdr, unsigned char *content, int content_length); virtual ~SRtpPacket(); /** Modified: trunk/libminisip/source/subsystem_media/rtp/RtpPacket.cxx =================================================================== --- trunk/libminisip/source/subsystem_media/rtp/RtpPacket.cxx 2008-05-28 12:18:24 UTC (rev 3582) +++ trunk/libminisip/source/subsystem_media/rtp/RtpPacket.cxx 2008-06-24 15:37:47 UTC (rev 3583) @@ -73,7 +73,7 @@ this->content = NULL; } -RtpPacket::RtpPacket(RtpHeader hdr, unsigned char *content_, int cl): header(hdr) { +RtpPacket::RtpPacket(const RtpHeader &hdr, unsigned char *content_, int cl): header(hdr) { extensionLength = 0; extensionHeader = NULL; Modified: trunk/libminisip/source/subsystem_media/rtp/SRtpPacket.cxx =================================================================== --- trunk/libminisip/source/subsystem_media/rtp/SRtpPacket.cxx 2008-05-28 12:18:24 UTC (rev 3582) +++ trunk/libminisip/source/subsystem_media/rtp/SRtpPacket.cxx 2008-06-24 15:37:47 UTC (rev 3583) @@ -186,7 +186,14 @@ this->mki = NULL; } +SRtpPacket::SRtpPacket(RtpHeader hdr, unsigned char *content, int content_length): + RtpPacket(hdr, content, content_length ), encrypted(false), tag_length(0), mki_length(0){ + this->tag = NULL; + this->mki = NULL; +} + + SRtpPacket::~SRtpPacket(){ if( mki ) delete [] mki; From guillem at minisip.org Tue Jun 24 20:43:59 2008 From: guillem at minisip.org (guillem at minisip.org) Date: Tue, 24 Jun 2008 20:43:59 +0200 (CEST) Subject: r3584 - in trunk/libminisip/source: subsystem_media subsystem_signaling/sip Message-ID: <20080624184359.83DD031CCB@mail.minisip.org> Author: guillem Date: 2008-06-24 20:43:59 +0200 (Tue, 24 Jun 2008) New Revision: 3584 Modified: trunk/libminisip/source/subsystem_media/MediaStream.cxx trunk/libminisip/source/subsystem_signaling/sip/SipSoftPhoneConfiguration.cxx Log: * Bug fix: CODEC payload type negotiation was broken. The payload number was converted to a character that was then converted to zero. In this revision video works. Modified: trunk/libminisip/source/subsystem_media/MediaStream.cxx =================================================================== --- trunk/libminisip/source/subsystem_media/MediaStream.cxx 2008-06-24 15:37:47 UTC (rev 3583) +++ trunk/libminisip/source/subsystem_media/MediaStream.cxx 2008-06-24 18:43:59 UTC (rev 3584) @@ -112,7 +112,7 @@ for( iC = codecs.begin(); iC != codecs.end(); iC ++ ){ string codecRtpMap; - uint8_t codecPayloadType; + int codecPayloadType; codecRtpMap = (*iC)->getSdpMediaAttributes(); codecPayloadType = (*iC)->getSdpMediaType(); @@ -131,7 +131,7 @@ bool sdpRtpMapEqual = !strCaseCmp( codecName.c_str(), sdpName.c_str() ) && codecRate == sdpRate && codecParam == sdpParam; if ( sdpRtpMapEqual ) { - localPayloadType = codecPayloadType; + localPayloadType = itoa(codecPayloadType); return true; } else { @@ -141,7 +141,7 @@ } else{ if( sdpPayloadType == itoa(codecPayloadType) ){ - localPayloadType = codecPayloadType; + localPayloadType = itoa(codecPayloadType); return true; }else{ } @@ -474,7 +474,7 @@ seqNo = (uint16_t)rand(); ssrc = rand(); lastTs = rand(); - payloadType = 255; + payloadType = "255"; setMuted( true ); muteCounter = 0; if( senderSocket ){ @@ -586,7 +586,7 @@ } packet = new SRtpPacket( data, length, seqNo++, lastTs, ssrc ); - + if( dtmf ){ packet->getHeader().setPayloadType( 101 ); } @@ -700,10 +700,12 @@ bool RealtimeMediaStreamSender::matches( MRef m, uint32_t formatIndex ){ bool result = RealtimeMediaStream::matches( m, formatIndex ); + if( result && !selectedCodec ){ selectedCodec = realtimeMedia->createCodecInstance( atoi( localPayloadType.c_str() ) ); - payloadType = (uint8_t)atoi(m->getFormat( formatIndex ).c_str()); + payloadType = itoa( (uint8_t)atoi(m->getFormat( formatIndex ).c_str()) ) ; + result=true; } return result; Modified: trunk/libminisip/source/subsystem_signaling/sip/SipSoftPhoneConfiguration.cxx =================================================================== --- trunk/libminisip/source/subsystem_signaling/sip/SipSoftPhoneConfiguration.cxx 2008-06-24 15:37:47 UTC (rev 3583) +++ trunk/libminisip/source/subsystem_signaling/sip/SipSoftPhoneConfiguration.cxx 2008-06-24 18:43:59 UTC (rev 3584) @@ -376,9 +376,7 @@ backend->save( cmdActionsPath + "params", params ); } -#ifdef VIDEO_SUPPORT backend->save( "video_device", videoDevice ); -#endif backend->save( "frame_width", frameWidth ); backend->save( "frame_height", frameHeight ); @@ -845,9 +843,7 @@ ii++; }while( true ); -#ifdef VIDEO_SUPPORT videoDevice = backend->loadString( "video_device", "" ); -#endif //Even if we can't send video, we might be able to display it. //Therefore this is not within the VIDEO_SUPPORT ifdef frameWidth = backend->loadInt( "frame_width", 176 );